├── .editorconfig ├── .gitattributes ├── .gitignore ├── .gitmodules ├── LICENSE ├── PROGRAMMING.md ├── README.md ├── RUNTIME.md ├── bin └── linux ├── c ├── README.md ├── bcrypt │ ├── bcrypt.version │ └── build ├── bearssl │ └── build ├── blake3 │ └── build ├── build-all ├── cjson │ ├── build │ └── cjson.txt ├── cpu_supports │ ├── build │ └── cpu_supports.c ├── expat │ ├── build │ └── expat_config.h ├── genx │ ├── COPYING │ ├── WHAT │ ├── build │ ├── charProps.c │ ├── genx.c │ └── genx.h ├── jsmin │ ├── WHAT │ ├── build │ ├── jsmin.c │ └── jsmin.txt ├── ldecNumber │ ├── build │ └── ldecnumber.txt ├── libjpeg │ └── build ├── libspng │ ├── build │ └── premultiply.c ├── libtls_bearssl │ └── build ├── lpeglabel │ ├── build │ └── lpeglabel.md ├── lua-headers │ ├── WHAT │ ├── lauxlib.h │ ├── lua.h │ ├── luaconf.h │ └── lualib.h ├── luajit │ ├── apply-patches │ ├── build │ ├── lib_package.c.patch │ ├── luaconf.h.patch │ ├── luajit.c.patch │ └── vmdef.lua ├── lz4 │ └── build ├── md5 │ ├── WHAT │ ├── build │ ├── md5.c │ └── md5.h ├── minizip2 │ └── build ├── pillow_simd │ ├── Python.c │ ├── Python.h │ ├── build │ ├── pillow_simd.c │ └── pillow_simd.version ├── precompile ├── precompile.lua ├── sha2 │ ├── WHAT │ ├── build │ ├── sha2.c │ └── sha2.h ├── syms ├── xxhash │ └── build └── zlib-ng │ ├── build │ └── zconf.h ├── etc └── ca-certificates.crt ├── gen-release-notes.sh ├── lua ├── TODO.txt ├── base64.lua ├── bcrypt.lua ├── bitmap.lua ├── bitmap_rgbaf.lua ├── blake3.lua ├── bmp.lua ├── cmdline.lua ├── connpool.lua ├── coro.lua ├── cpu_supports.lua ├── csv.lua ├── daemon.lua ├── debugger.lua ├── events.lua ├── expat_h.lua ├── fs.lua ├── fs_posix.lua ├── fs_win.lua ├── genx_h.lua ├── glue.lua ├── gzip.lua ├── heap.lua ├── hmac.lua ├── http.lua ├── http_client.lua ├── http_date.lua ├── http_headers.lua ├── http_server.lua ├── imtui.lua ├── ipv6.lua ├── jit │ ├── bc.lua │ ├── bcsave.lua │ ├── dis_x64.lua │ ├── dis_x86.lua │ ├── dump.lua │ ├── p.lua │ ├── v.lua │ ├── vmdef.lua │ ├── vmdef_linux.lua │ ├── vmdef_windows.lua │ └── zone.lua ├── jpeg.lua ├── json.lua ├── lang.lua ├── libjpeg_h.lua ├── libspng_h.lua ├── libtls.lua ├── libtls_h.lua ├── linkedlist.lua ├── logging.lua ├── lrucache.lua ├── lua_h.lua ├── luajit_h.lua ├── luastate.lua ├── lz4.lua ├── md5.lua ├── mess.lua ├── minizip2_h.lua ├── minizip2_rw_h.lua ├── minizip2_strm_h.lua ├── msgpack.lua ├── multipart.lua ├── mustache.lua ├── mysql.lua ├── mysql_print.lua ├── os_thread.lua ├── path.lua ├── pbuffer.lua ├── pillow.lua ├── png.lua ├── pp.lua ├── proc.lua ├── proc_posix.lua ├── proc_win.lua ├── pthread.lua ├── query.lua ├── queue.lua ├── rect.lua ├── reflect.lua ├── relabel.lua ├── resize_image.lua ├── resolver.lua ├── schema.lua ├── schema_std.lua ├── scite.lua ├── sdk.lua ├── sha1.lua ├── sha2.lua ├── signal.lua ├── smtp.lua ├── sock.lua ├── sock_libtls.lua ├── sqlpp.lua ├── sqlpp_mysql.lua ├── sqlpp_tarantool.lua ├── strict.lua ├── tarantool.lua ├── tasks.lua ├── termios.lua ├── time.lua ├── unixperms.lua ├── url.lua ├── webb.lua ├── webb_action.lua ├── webb_auth.lua ├── webb_push.lua ├── webb_spa.lua ├── winapi.lua ├── winapi │ ├── init.lua │ ├── namespace.lua │ ├── process.lua │ ├── registry.lua │ ├── thread.lua │ ├── types.lua │ ├── util.lua │ ├── wcs.lua │ └── winbase.lua ├── xapp.lua ├── xauth.lua ├── xlang.lua ├── xlsxwriter.md ├── xlsxwriter │ ├── _images │ │ ├── demo.png │ │ ├── formats_intro.png │ │ ├── formats_num_str.png │ │ ├── formats_set_bg_color.png │ │ ├── logo.png │ │ ├── merge_range.png │ │ ├── tutorial01.png │ │ ├── tutorial02.png │ │ ├── tutorial03.png │ │ ├── workbook01.png │ │ ├── workbook02.png │ │ ├── working_with_dates_and_times01.png │ │ ├── working_with_dates_and_times02.png │ │ ├── worksheet00.png │ │ ├── worksheet01.png │ │ ├── worksheet02.png │ │ └── worksheet_activate.png │ ├── app.lua │ ├── bugs.md │ ├── contenttypes.lua │ ├── core.lua │ ├── faq.md │ ├── format.lua │ ├── format.md │ ├── packager.lua │ ├── page_setup.md │ ├── relationships.lua │ ├── sharedstrings.lua │ ├── styles.lua │ ├── theme.lua │ ├── tutorial01.md │ ├── tutorial02.md │ ├── tutorial03.md │ ├── utility.lua │ ├── workbook.lua │ ├── workbook.md │ ├── working_with_cell_notation.md │ ├── working_with_colors.md │ ├── working_with_dates_and_time.md │ ├── working_with_formats.md │ ├── working_with_memory.md │ ├── worksheet.lua │ ├── worksheet.md │ └── xmlwriter.lua ├── xml.lua ├── xml_parse.lua ├── xmodule.lua ├── xrowset.lua ├── xrowset_sql.lua ├── xxhash.lua ├── xxhash_h.lua ├── zip.lua └── zlib_h.lua ├── tests ├── base64_test.lua ├── bitmap_test.lua ├── blake3_test.lua ├── blake3_test │ └── test_vectors.json ├── bmp_test.lua ├── bmp_test │ ├── .gitignore │ ├── WHAT │ ├── bad │ │ ├── badbitcount.bmp │ │ ├── badbitssize.bmp │ │ ├── baddens1.bmp │ │ ├── baddens2.bmp │ │ ├── badfilesize.bmp │ │ ├── badheadersize.bmp │ │ ├── badpalettesize.bmp │ │ ├── badplanes.bmp │ │ ├── badrle.bmp │ │ ├── badwidth.bmp │ │ ├── pal2.bmp │ │ ├── pal8badindex.bmp │ │ ├── reallybig.bmp │ │ ├── rletopdown.bmp │ │ └── shortfile.bmp │ ├── good │ │ ├── pal1.bmp │ │ ├── pal1bg.bmp │ │ ├── pal1wb.bmp │ │ ├── pal4.bmp │ │ ├── pal4rle.bmp │ │ ├── pal8-0.bmp │ │ ├── pal8.bmp │ │ ├── pal8nonsquare.bmp │ │ ├── pal8rle.bmp │ │ ├── pal8topdown.bmp │ │ ├── pal8v2.bmp │ │ ├── pal8v4.bmp │ │ ├── pal8v5.bmp │ │ ├── pal8w124.bmp │ │ ├── pal8w125.bmp │ │ ├── pal8w126.bmp │ │ ├── rgb16-565.bmp │ │ ├── rgb16-565pal.bmp │ │ ├── rgb16.bmp │ │ ├── rgb24.bmp │ │ ├── rgb24pal.bmp │ │ ├── rgb32.bmp │ │ └── rgb32bf.bmp │ ├── parrot.bmp │ ├── questionable │ │ ├── pal1p1.bmp │ │ ├── pal4rletrns.bmp │ │ ├── pal8offs.bmp │ │ ├── pal8oversizepal.bmp │ │ ├── pal8rletrns.bmp │ │ ├── rgb16-231.bmp │ │ ├── rgb24jpeg.bmp │ │ ├── rgb24largepal.bmp │ │ ├── rgb24png.bmp │ │ ├── rgb32-111110.bmp │ │ ├── rgb32fakealpha.bmp │ │ ├── rgba16-4444.bmp │ │ ├── rgba32.bmp │ │ └── rgba32abf.bmp │ ├── rgb_24bit.bmp │ └── rgb_3bit.bmp ├── canvas_ui_demo_app │ ├── .gitignore │ ├── README.md │ ├── cui │ ├── cui.cmd │ ├── cui.conf │ └── cui.lua ├── cert ├── connpool_test.lua ├── coro_test.lua ├── csv_test.lua ├── csv_test │ ├── BOM.csv │ ├── bars.txt │ ├── blank-line.csv │ ├── embedded-newlines.csv │ ├── embedded-quotes.csv │ └── header.csv ├── fs_test.lua ├── glue_test.lua ├── gzip_test.lua ├── gzip_test │ └── test.txt.gz ├── hash_benchmark.lua ├── heap_test.lua ├── http_client_test.lua ├── http_headers_test.lua ├── http_server_test.lua ├── imtui_demo.lua ├── jpeg_test.lua ├── jpeg_test │ └── progressive.jpg ├── ldecnumber_test.lua ├── libtls_test.lua ├── linebuffer_test.lua ├── linkedlist_test.lua ├── localhost.crt ├── localhost.key ├── lpeglabel_test.lua ├── luastate_test.lua ├── md5_hmac_test.lua ├── md5_test.lua ├── msgpack_test.lua ├── mustache_test.lua ├── mustache_test │ ├── comments.json │ ├── delimiters.json │ ├── interpolation.json │ ├── inverted.json │ ├── lambdas.lua │ ├── partials.json │ └── sections.json ├── mysql_example.lua ├── mysql_test.lua ├── os_thread_test.lua ├── path_test.lua ├── png_test.lua ├── png_test │ ├── WHAT │ ├── bad │ │ ├── xc1n0g08.png │ │ ├── xc9n2c08.png │ │ ├── xcrn0g04.png │ │ ├── xcsn0g01.png │ │ ├── xd0n2c08.png │ │ ├── xd3n2c08.png │ │ ├── xd9n2c08.png │ │ ├── xdtn0g01.png │ │ ├── xhdn0g08.png │ │ ├── xlfn0g04.png │ │ ├── xs1n0g01.png │ │ ├── xs2n0g01.png │ │ ├── xs4n0g01.png │ │ └── xs7n0g01.png │ └── good │ │ ├── basi0g01.png │ │ ├── basi0g02.png │ │ ├── basi0g04.png │ │ ├── basi0g08.png │ │ ├── basi0g16.png │ │ ├── basi2c08.png │ │ ├── basi2c16.png │ │ ├── basi3p01.png │ │ ├── basi3p02.png │ │ ├── basi3p04.png │ │ ├── basi3p08.png │ │ ├── basi4a08.png │ │ ├── basi4a16.png │ │ ├── basi6a08.png │ │ ├── basi6a16.png │ │ ├── basn0g01.png │ │ ├── basn0g02.png │ │ ├── basn0g04.png │ │ ├── basn0g08.png │ │ ├── basn0g16.png │ │ ├── basn2c08.png │ │ ├── basn2c16.png │ │ ├── basn3p01.png │ │ ├── basn3p02.png │ │ ├── basn3p04.png │ │ ├── basn3p08.png │ │ ├── basn4a08.png │ │ ├── basn4a16.png │ │ ├── basn6a08.png │ │ ├── basn6a16.png │ │ ├── bgai4a08.png │ │ ├── bgai4a16.png │ │ ├── bgan6a08.png │ │ ├── bgan6a16.png │ │ ├── bgbn4a08.png │ │ ├── bggn4a16.png │ │ ├── bgwn6a08.png │ │ ├── bgyn6a16.png │ │ ├── ccwn2c08.png │ │ ├── ccwn3p08.png │ │ ├── cdfn2c08.png │ │ ├── cdhn2c08.png │ │ ├── cdsn2c08.png │ │ ├── cdun2c08.png │ │ ├── ch1n3p04.png │ │ ├── ch2n3p08.png │ │ ├── cm0n0g04.png │ │ ├── cm7n0g04.png │ │ ├── cm9n0g04.png │ │ ├── cs3n2c16.png │ │ ├── cs3n3p08.png │ │ ├── cs5n2c08.png │ │ ├── cs5n3p08.png │ │ ├── cs8n2c08.png │ │ ├── cs8n3p08.png │ │ ├── ct0n0g04.png │ │ ├── ct1n0g04.png │ │ ├── cten0g04.png │ │ ├── ctfn0g04.png │ │ ├── ctgn0g04.png │ │ ├── cthn0g04.png │ │ ├── ctjn0g04.png │ │ ├── ctzn0g04.png │ │ ├── f00n0g08.png │ │ ├── f00n2c08.png │ │ ├── f01n0g08.png │ │ ├── f01n2c08.png │ │ ├── f02n0g08.png │ │ ├── f02n2c08.png │ │ ├── f03n0g08.png │ │ ├── f03n2c08.png │ │ ├── f04n0g08.png │ │ ├── f04n2c08.png │ │ ├── f99n0g04.png │ │ ├── g03n0g16.png │ │ ├── g03n2c08.png │ │ ├── g03n3p04.png │ │ ├── g04n0g16.png │ │ ├── g04n2c08.png │ │ ├── g04n3p04.png │ │ ├── g05n0g16.png │ │ ├── g05n2c08.png │ │ ├── g05n3p04.png │ │ ├── g07n0g16.png │ │ ├── g07n2c08.png │ │ ├── g07n3p04.png │ │ ├── g10n0g16.png │ │ ├── g10n2c08.png │ │ ├── g10n3p04.png │ │ ├── g25n0g16.png │ │ ├── g25n2c08.png │ │ ├── g25n3p04.png │ │ ├── oi1n0g16.png │ │ ├── oi1n2c16.png │ │ ├── oi2n0g16.png │ │ ├── oi2n2c16.png │ │ ├── oi4n0g16.png │ │ ├── oi4n2c16.png │ │ ├── oi9n0g16.png │ │ ├── oi9n2c16.png │ │ ├── pp0n2c16.png │ │ ├── pp0n6a08.png │ │ ├── ps1n0g08.png │ │ ├── ps1n2c16.png │ │ ├── ps2n0g08.png │ │ ├── ps2n2c16.png │ │ ├── s01i3p01.png │ │ ├── s01n3p01.png │ │ ├── s02i3p01.png │ │ ├── s02n3p01.png │ │ ├── s03i3p01.png │ │ ├── s03n3p01.png │ │ ├── s04i3p01.png │ │ ├── s04n3p01.png │ │ ├── s05i3p02.png │ │ ├── s05n3p02.png │ │ ├── s06i3p02.png │ │ ├── s06n3p02.png │ │ ├── s07i3p02.png │ │ ├── s07n3p02.png │ │ ├── s08i3p02.png │ │ ├── s08n3p02.png │ │ ├── s09i3p02.png │ │ ├── s09n3p02.png │ │ ├── s32i3p04.png │ │ ├── s32n3p04.png │ │ ├── s33i3p04.png │ │ ├── s33n3p04.png │ │ ├── s34i3p04.png │ │ ├── s34n3p04.png │ │ ├── s35i3p04.png │ │ ├── s35n3p04.png │ │ ├── s36i3p04.png │ │ ├── s36n3p04.png │ │ ├── s37i3p04.png │ │ ├── s37n3p04.png │ │ ├── s38i3p04.png │ │ ├── s38n3p04.png │ │ ├── s39i3p04.png │ │ ├── s39n3p04.png │ │ ├── s40i3p04.png │ │ ├── s40n3p04.png │ │ ├── tbbn0g04.png │ │ ├── tbbn2c16.png │ │ ├── tbbn3p08.png │ │ ├── tbgn2c16.png │ │ ├── tbgn3p08.png │ │ ├── tbrn2c08.png │ │ ├── tbwn0g16.png │ │ ├── tbwn3p08.png │ │ ├── tbyn3p08.png │ │ ├── tp0n0g08.png │ │ ├── tp0n2c08.png │ │ ├── tp0n3p08.png │ │ ├── tp1n3p08.png │ │ ├── z00n2c08.png │ │ ├── z03n2c08.png │ │ ├── z06n2c08.png │ │ └── z09n2c08.png ├── pp_test.lua ├── proc_test.lua ├── pthread_example.lua ├── pthread_test.lua ├── queue_test.lua ├── relabel_test.lua ├── resize_image_test.lua ├── resize_image_test │ ├── .gitignore │ └── birds.jpg ├── schema_test.lua ├── sha1_hmac_test.lua ├── sha1_test.lua ├── sha2_hmac_test.lua ├── sha2_test.lua ├── sha2_test │ ├── vector001.dat │ ├── vector001.info │ ├── vector002.dat │ ├── vector002.info │ ├── vector003.dat │ ├── vector003.info │ ├── vector004.dat │ ├── vector004.info │ ├── vector005.dat │ ├── vector005.info │ ├── vector006.dat │ ├── vector006.info │ ├── vector007.dat │ ├── vector007.info │ ├── vector008.dat │ ├── vector008.info │ ├── vector009.dat │ ├── vector009.info │ ├── vector010.dat │ ├── vector010.info │ ├── vector011.dat │ ├── vector011.info │ ├── vector012.dat │ ├── vector012.info │ ├── vector013.dat │ ├── vector013.info │ ├── vector014.dat │ ├── vector014.info │ ├── vector015.dat │ ├── vector015.info │ ├── vector016.dat │ ├── vector016.info │ ├── vector017.dat │ ├── vector017.info │ ├── vector018.dat │ └── vector018.info ├── smtp_test.lua ├── sock_test.lua ├── sqlpp_mysql_test.lua ├── tarantool_test.lua ├── test-all ├── test-ca.key ├── test-ca.pem ├── unit.lua ├── url_test.lua ├── xlsxwriter_demos │ ├── array_formula.lua │ ├── date_strings.lua │ ├── date_times.lua │ ├── defined_name.lua │ ├── demo.lua │ ├── doc_properties.lua │ ├── headers_footers.lua │ ├── hello_world.lua │ ├── hide_sheet.lua │ ├── hyperlink.lua │ ├── merge1.lua │ ├── perf_tester.lua │ ├── tab_colors.lua │ ├── text_indent.lua │ ├── tutorial1.lua │ ├── tutorial2.lua │ ├── tutorial3.lua │ ├── utf8.lua │ ├── utf8_polish.lua │ ├── utf8_polish.txt │ └── worksheet_protection.lua ├── xml_parse_test.lua ├── xml_test.lua ├── xrowset_test.lua ├── zip_test.lua └── zip_test │ └── test-aes.zip └── www ├── mustache.js └── webb_spa.js /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.*] 2 | charset = utf-8 3 | indent_style = tab 4 | indent_size = 3 5 | trim_trailing_whitespace = true 6 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.lua text eol=lf 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.mgit 2 | /tests/*.log 3 | test.* 4 | /www/test.* 5 | .DS_Store 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2020 Allegory Software SRL 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included 11 | in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /bin/linux: -------------------------------------------------------------------------------- 1 | debian12 -------------------------------------------------------------------------------- /c/bcrypt/bcrypt.version: -------------------------------------------------------------------------------- 1 | bcrypt { 2 | global: crypt; crypt_gensalt; 3 | local: *; 4 | }; 5 | -------------------------------------------------------------------------------- /c/bcrypt/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build}" || exit 1 3 | 4 | build() { 5 | ${X}gcc -c -O2 $C -fomit-frame-pointer -funroll-loops \ 6 | src/crypt_blowfish.c src/crypt_gensalt.c src/wrapper.c -Isrc 7 | ${X}gcc *.o -shared -o ../../bin/$P/$D $L\ 8 | -Wl,--version-script=bcrypt.version 9 | rm -f ../../bin/$P/$A 10 | ${X}ar rcs ../../bin/$P/$A *.o 11 | rm *.o 12 | } 13 | 14 | if [ "$OSTYPE" = "msys" ]; then 15 | P=windows L="-s -static-libgcc" D=bcrypt1.dll A=bcrypt1.a build 16 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 17 | P=osx C="-arch x86_64" L="-arch x86_64 -install_name @rpath/libbcrypt1.dylib" \ 18 | D=libbcrypt1.dylib A=libbcrypt1.a build 19 | else 20 | P=linux C="-fPIC" L="-s -static-libgcc" D=libbcrypt1.so A=libbcrypt1.a build 21 | fi 22 | -------------------------------------------------------------------------------- /c/bearssl/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build}" || exit 1 3 | 4 | build() { 5 | ${X}gcc -c -g src/src/*/*.c -W -Wall -Wno-unknown-pragmas -O2 -fPIC -Isrc/src -Isrc/inc 6 | ${X}gcc -g *.o -shared -o ../../bin/$P/$D -L../../bin/$P $L 7 | rm -f ../../bin/$P/$A 8 | ${X}ar rcs ../../bin/$P/$A *.o 9 | rm *.o 10 | } 11 | 12 | if [ "$OSTYPE" = "msys" ]; then 13 | C="-D_WIN32_WINNT=0x601 -DWINVER=0x601" P=windows L="-s -static-libgcc" \ 14 | D=bearssl.dll A=bearssl.a build 15 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 16 | P=osx C="-arch x86_64 mz_crypt_apple.c mz_strm_os_posix.c mz_os_posix.c" \ 17 | L="-arch x86_64 -install_name @rpath/libbearssl.dylib 18 | -framework CoreFoundation -framework Security -liconv 19 | " D=libbearssl.dylib A=libbearssl.a build 20 | else 21 | P=linux L="-s -static-libgcc" D=libbearssl.so A=libbearssl.a build 22 | fi 23 | -------------------------------------------------------------------------------- /c/blake3/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build}" || exit 1 3 | 4 | build() { 5 | ${X}gcc $C -c -O3 -Wall -Wextra -std=c11 -pedantic -Isrc/c \ 6 | src/c/blake3.c \ 7 | src/c/blake3_dispatch.c \ 8 | src/c/blake3_portable.c \ 9 | src/c/blake3_sse2_x86-64_$S.S \ 10 | src/c/blake3_sse41_x86-64_$S.S \ 11 | src/c/blake3_avx2_x86-64_$S.S \ 12 | src/c/blake3_avx512_x86-64_$S.S 13 | ${X}gcc *.o -shared -o ../../bin/$P/$D $L 14 | rm -f ../../bin/$P/$A 15 | ${X}ar rcs ../../bin/$P/$A *.o 16 | rm *.o 17 | } 18 | 19 | if [ "$OSTYPE" = "msys" ]; then 20 | S=windows_gnu P=windows L="-s -static-libgcc" D=blake3.dll A=blake3.a build 21 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 22 | S=unix P=osx C="-arch x86_64" L="-arch x86_64 -install_name @rpath/libblake3.dylib" \ 23 | D=libblake3.dylib A=libblake3.a build 24 | else 25 | S=unix P=linux C="-fPIC" L="-s -static-libgcc" D=libblake3.so A=libblake3.a build 26 | fi 27 | -------------------------------------------------------------------------------- /c/build-all: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build-all}" || exit 1 3 | for d in *; do 4 | if [ -f "$d/build" ]; then 5 | echo "$d:" 6 | $d/build 7 | fi 8 | done 9 | -------------------------------------------------------------------------------- /c/cjson/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build}" || exit 1 3 | 4 | build() { 5 | ${X}gcc -c -O2 $C src/strbuf.c src/lua_cjson.c src/fpconv.c -I../lua-headers \ 6 | -Wall -pedantic -DDISABLE_INVALID_NUMBERS 7 | ${X}gcc *.o -shared -o ../../bin/$P/clib/$D $L 8 | rm -f ../../bin/$P/$A 9 | ${X}ar rcs ../../bin/$P/$A *.o 10 | rm *.o 11 | } 12 | 13 | if [ "$OSTYPE" = "msys" ]; then 14 | P=windows D=cjson.dll A=cjson.a \ 15 | L="-s -static-libgcc -L../../bin/windows -llua51" build 16 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 17 | P=osx D=cjson.so A=libcjson.a C="-arch x86_64" \ 18 | L="-arch x86_64 -undefined dynamic_lookup -Wno-static-in-inline" build 19 | else 20 | P=linux C=-fPIC L="-s -static-libgcc" D=cjson.so A=libcjson.a build 21 | fi 22 | -------------------------------------------------------------------------------- /c/cpu_supports/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build}" || exit 1 3 | 4 | build() { 5 | ${X}gcc -c $C cpu_supports.c 6 | ${X}gcc *.o -shared -o ../../bin/$P/$D $L 7 | rm -f ../../bin/$P/$A 8 | ${X}ar rcs ../../bin/$P/$A *.o 9 | rm *.o 10 | } 11 | 12 | if [ "$OSTYPE" = "msys" ]; then 13 | P=windows L="-s -static-libgcc" D=cpu_supports.dll A=cpu_supports.a build 14 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 15 | P=osx C="-arch x86_64" L="-arch x86_64 -install_name @rpath/libcpu_supports.dylib" \ 16 | D=libcpu_supports.dylib A=libcpu_supports.a build 17 | else 18 | P=linux C="-fPIC" L="-s -static-libgcc" D=libcpu_supports.so A=libcpu_supports.a build 19 | fi 20 | -------------------------------------------------------------------------------- /c/cpu_supports/cpu_supports.c: -------------------------------------------------------------------------------- 1 | 2 | #define CPU_SUPPORTS_SSE 0x0001 3 | #define CPU_SUPPORTS_SSE2 0x0002 4 | #define CPU_SUPPORTS_SSE3 0x0010 5 | #define CPU_SUPPORTS_SSSE3 0x0020 6 | #define CPU_SUPPORTS_SSE41 0x0040 7 | #define CPU_SUPPORTS_SSE42 0x0080 8 | #define CPU_SUPPORTS_AVX 0x0100 9 | #define CPU_SUPPORTS_AVX2 0x0200 10 | 11 | int cpu_supports() { 12 | __builtin_cpu_init(); 13 | return 14 | (__builtin_cpu_supports("sse" ) ? CPU_SUPPORTS_SSE : 0) | 15 | (__builtin_cpu_supports("sse2" ) ? CPU_SUPPORTS_SSE2 : 0) | 16 | (__builtin_cpu_supports("sse3" ) ? CPU_SUPPORTS_SSE3 : 0) | 17 | (__builtin_cpu_supports("ssse3" ) ? CPU_SUPPORTS_SSSE3 : 0) | 18 | (__builtin_cpu_supports("sse4.1") ? CPU_SUPPORTS_SSE41 : 0) | 19 | (__builtin_cpu_supports("sse4.2") ? CPU_SUPPORTS_SSE42 : 0) | 20 | (__builtin_cpu_supports("avx" ) ? CPU_SUPPORTS_AVX : 0) | 21 | (__builtin_cpu_supports("avx2" ) ? CPU_SUPPORTS_AVX2 : 0); 22 | } 23 | -------------------------------------------------------------------------------- /c/expat/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build}" || exit 1 3 | 4 | build() { 5 | ${X}gcc -c -O2 $C src/expat/lib/*.c -Isrc/expat/lib -I. 6 | ${X}gcc *.o -shared -o ../../bin/$P/$D $L 7 | rm -f ../../bin/$P/$A 8 | ${X}ar rcs ../../bin/$P/$A *.o 9 | rm *.o 10 | } 11 | 12 | if [ "$OSTYPE" = "msys" ]; then 13 | P=windows L="-s -static-libgcc" D=expat.dll A=expat.a build 14 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 15 | P=osx C="-arch x86_64 -DHAVE_ARC4RANDOM_BUF" \ 16 | L="-arch x86_64 -install_name @rpath/libexpat.dylib" \ 17 | D=libexpat.dylib A=libexpat.a build 18 | else 19 | P=linux C="-fPIC -DHAVE_GETRANDOM" L="-s -static-libgcc" \ 20 | D=libexpat.so A=libexpat.a build 21 | fi 22 | -------------------------------------------------------------------------------- /c/genx/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) Tim Bray and Sun Microsystems, 2004. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included 12 | in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /c/genx/WHAT: -------------------------------------------------------------------------------- 1 | genx beta5 from http://www.tbray.org/ongoing/When/200x/2004/02/20/GenxStatus (MIT License) 2 | -------------------------------------------------------------------------------- /c/genx/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build}" || exit 1 3 | 4 | build() { 5 | ${X}gcc -c -O2 $C -Wall -pedantic -Wno-stringop-truncation genx.c charProps.c 6 | ${X}gcc *.o -shared -o ../../bin/$P/$D $L 7 | rm -f ../../bin/$P/$A 8 | ${X}ar rcs ../../bin/$P/$A *.o 9 | rm *.o 10 | } 11 | 12 | if [ "$OSTYPE" = "msys" ]; then 13 | P=windows L="-s -static-libgcc" D=genx.dll A=genx.a build 14 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 15 | P=osx C="-arch x86_64" L="-arch x86_64 -install_name @rpath/libgenx.dylib" \ 16 | D=libgenx.dylib A=libgenx.a build 17 | else 18 | P=linux C=-fPIC L="-s -static-libgcc" D=libgenx.so A=libgenx.a build 19 | fi 20 | -------------------------------------------------------------------------------- /c/jsmin/WHAT: -------------------------------------------------------------------------------- 1 | JSMin 7d7aea2 from https://github.com/douglascrockford/JSMin (Good not Evil License) 2 | -------------------------------------------------------------------------------- /c/jsmin/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build}" || exit 1 3 | 4 | build() { 5 | ${X}gcc -c -O2 $C *.c -I. -I../lua-headers -Wall -pedantic 6 | ${X}gcc *.o -shared -o ../../bin/$P/clib/$D -L../../bin/$P $L 7 | rm -f ../../bin/$P/$A 8 | ${X}ar rcs ../../bin/$P/$A *.o 9 | rm *.o 10 | } 11 | 12 | if [ "$OSTYPE" = "msys" ]; then 13 | P=windows L="-s -static-libgcc -llua51" D=jsmin.dll A=jsmin.a build 14 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 15 | P=osx C="-arch x86_64" L="-arch x86_64 -undefined dynamic_lookup" \ 16 | D=jsmin.so A=jsmin.a build 17 | else 18 | P=linux C=-fPIC L="-s -static-libgcc" D=jsmin.so A=libjsmin.a build 19 | fi 20 | -------------------------------------------------------------------------------- /c/jsmin/jsmin.txt: -------------------------------------------------------------------------------- 1 | --[=[ 2 | 3 | local jsmin = require'jsmin' 4 | 5 | JavaScript minification tool. 6 | 7 | jsmin.minify(s) -> s 8 | 9 | Minify JavaScript string and return it as a string. 10 | Raises an error if JavaScript has basic syntax errors in it. 11 | 12 | WARNING: JsMin is not a guaranteed-correct parser and it will fail on some 13 | inputs, notably regex literals after which a newline is significant. 14 | Because of that, and because the size of minified & gzipped js only goes down 15 | about 30% of the gzipped size, jsmin is not enabled by default in webb. 16 | 17 | ]=] 18 | -------------------------------------------------------------------------------- /c/ldecNumber/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build}" || exit 1 3 | 4 | files=" 5 | src/decNumber/decContext.c 6 | src/decNumber/decNumber.c 7 | src/decNumber/decPacked.c 8 | src/decNumber/decimal128.c 9 | src/decNumber/decimal32.c 10 | src/decNumber/decimal64.c 11 | src/ldecNumber.c 12 | " 13 | 14 | build() { 15 | ${X}gcc -c -O2 $C $files -Isrc -Isrc/decNumber -I../lua-headers 16 | ${X}gcc *.o -shared -o ../../bin/$P/clib/$D $L 17 | rm -f ../../bin/$P/$A 18 | ${X}ar rcs ../../bin/$P/$A *.o 19 | rm *.o 20 | } 21 | 22 | if [ "$OSTYPE" = "msys" ]; then 23 | P=windows L="-s -static-libgcc -L../../bin/windows -llua51" \ 24 | D=ldecnumber.dll A=ldecnumber.a build 25 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 26 | echo NYI 27 | else 28 | P=linux C="-fPIC" L="-s -static-libgcc -L../../bin/linux" \ 29 | D=ldecnumber.so A=libldecnumber.a build 30 | fi 31 | -------------------------------------------------------------------------------- /c/ldecNumber/ldecnumber.txt: -------------------------------------------------------------------------------- 1 | --[=[ 2 | 3 | local ldecnumber = require'ldecnumber' 4 | 5 | Decimal arithmetic based on IBM's decNumber. 6 | 7 | EXAMPLE 8 | 9 | local decnumber = require'ldecnumber' 10 | local balance = decnumber.tonumber'0.00' 11 | balance = balance + '0.01' 12 | balance = balance + '1.25' 13 | balance = balance - '1.12' 14 | balance:isfinite() --> true 15 | balance:isinfinite() --> false 16 | balance:isnan() --> false 17 | balance:tostring() --> '0.14' 18 | 19 | ldecNumber docs : ttps://htmlpreview.github.io/?https://github.com/tarantool/ldecnumber/blob/master/doc/ldecNumber.html 20 | decNumber docs : http://speleotrove.com/decimal/decnumber.html 21 | 22 | Two methods added: dn:frompacked() and dn:topacked() for working with 23 | tarantool. 24 | 25 | ]=] 26 | -------------------------------------------------------------------------------- /c/libjpeg/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build}" || exit 1 3 | 4 | build() { 5 | src_dir="$PWD/src" 6 | rm -rf "$B" 7 | mkdir -p "$B" 8 | cd "$B" || exit 1 9 | cmake -G "$M" "$src_dir" 10 | make clean 11 | make jpeg 12 | strip "$B/$DI" 13 | cp -f "$B/$DI" "$src_dir/../../../bin/$P/$D" 14 | make jpeg-static 15 | cp -f "$B/$AI" "$src_dir/../../../bin/$P/$A" 16 | make clean 17 | cd "$src_dir" 18 | rm -rf "$B" 19 | } 20 | 21 | if [ "$OSTYPE" = "msys" ]; then 22 | B="$PWD/out" M="MSYS Makefiles" \ 23 | DI=libjpeg-62.dll D=jpeg.dll AI=libjpeg.a A=jpeg.a \ 24 | P=windows build 25 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 26 | echo NYI 27 | else 28 | B="$HOME/libjpegturbo-out" M="Unix Makefiles" \ 29 | DI=libjpeg.so D=libjpeg.so AI=libjpeg.a A=libjpeg.a \ 30 | P=linux build 31 | fi 32 | -------------------------------------------------------------------------------- /c/libspng/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build}" || exit 1 3 | 4 | build() { 5 | ${X}gcc $C -c -O3 -DSPNG_SSE=4 src/spng/*.c premultiply.c -Isrc/spng \ 6 | -DZLIB_COMPAT -I../zlib-ng/src -I../zlib-ng 7 | ${X}gcc *.o -shared -o ../../bin/$P/$D -L../../bin/$P -lz $L 8 | rm -f ../../bin/$P/$A 9 | ${X}ar rcs ../../bin/$P/$A *.o 10 | rm *.o 11 | } 12 | 13 | if [ "$OSTYPE" = "msys" ]; then 14 | P=windows L="-s -static-libgcc" D=spng.dll A=spng.a build 15 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 16 | echo NYI 17 | else 18 | P=linux C="-fPIC -U_FORTIFY_SOURCE" L="-s -static-libgcc" \ 19 | D=libspng.so A=libspng.a build 20 | fi 21 | -------------------------------------------------------------------------------- /c/libspng/premultiply.c: -------------------------------------------------------------------------------- 1 | #define SPNG__BUILD 2 | #include 3 | #include 4 | #include "spng.h" 5 | 6 | SPNG_API void spng_rgba8_to_bgra8(uint8_t* p, uint32_t n) { 7 | assert(!(n & 3)); 8 | while (n -= 4) { 9 | uint8_t t = p[0]; 10 | p[0] = p[2]; 11 | p[2] = t; 12 | p += 4; 13 | } 14 | } 15 | 16 | SPNG_API void spng_premultiply_alpha_rgba8(uint32_t* p, uint32_t n) { 17 | assert(!(n & 3)); 18 | while (n -= 4) { 19 | uint8_t a = (*p >> 24) & 0xff; 20 | uint8_t r = (((*p >> 0) & 0xff) * a) / 0xff; 21 | uint8_t g = (((*p >> 8) & 0xff) * a) / 0xff; 22 | uint8_t b = (((*p >> 16) & 0xff) * a) / 0xff; 23 | *p++ = (a << 24) | (b << 16) | (g << 8) | (r << 0); 24 | } 25 | } 26 | 27 | SPNG_API void spng_premultiply_alpha_ga8(uint16_t* p, uint32_t n) { 28 | assert(!(n & 1)); 29 | while (n -= 2) { 30 | uint8_t a = (*p >> 8) & 0xff; 31 | uint8_t g = (((*p >> 0) & 0xff) * a) / 0xff; 32 | *p++ = (a << 8) | (g << 0); 33 | } 34 | } 35 | 36 | SPNG_API void spng_premultiply_alpha_rgba16(uint64_t* p, uint32_t n) { 37 | assert(!(n & 7)); 38 | while (n -= 8) { 39 | uint16_t a = (*p >> 48) & 0xffff; 40 | uint16_t r = (((*p >> 0) & 0xffff) * a) / 0xffff; 41 | uint16_t g = (((*p >> 16) & 0xffff) * a) / 0xffff; 42 | uint16_t b = (((*p >> 32) & 0xffff) * a) / 0xffff; 43 | *p++ = ((uint64_t)a << 48) | ((uint64_t)b << 32) | ((uint64_t)g << 16) | ((uint64_t)r << 0); 44 | } 45 | } 46 | 47 | SPNG_API void spng_premultiply_alpha_ga16(uint32_t* p, uint32_t n) { 48 | assert(!(n & 3)); 49 | while (n -= 4) { 50 | uint16_t a = (*p >> 16) & 0xffff; 51 | uint16_t g = (((*p >> 0) & 0xffff) * a) / 0xffff; 52 | *p++ = (a << 16) | (g << 0); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /c/libtls_bearssl/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build}" || exit 1 3 | 4 | build() { 5 | ${X}gcc -c src/*.c src/compat/*.c -Isrc -I../bearssl/src/inc -O2 -fPIC $C \ 6 | -Wall -D_GNU_SOURCE -D_POSIX_SOURCE 7 | ${X}gcc *.o -g -shared -o ../../bin/$P/$D -L../../bin/$P -lbearssl $L 8 | rm -f ../../bin/$P/$A 9 | ${X}ar rcs ../../bin/$P/$A *.o 10 | rm *.o 11 | } 12 | 13 | if [ "$OSTYPE" = "msys" ]; then 14 | P=windows C="-D_WIN32_WINNT=0x601 -DWINVER=0x601" \ 15 | L="-s -static-libgcc -lws2_32 -Wl,-Bstatic -lpthread" \ 16 | D=tls_bearssl.dll A=tls_bearssl.a build 17 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 18 | P=osx C="-arch x86_64 mz_crypt_apple.c mz_strm_os_posix.c mz_os_posix.c" \ 19 | L="-arch x86_64 -install_name @rpath/libtls_bearssl.dylib 20 | -framework CoreFoundation -framework Security -liconv" \ 21 | D=libtls_bearssl.dylib A=libtls_bearssl.a build 22 | else 23 | C=" 24 | -DHAVE_STRSEP 25 | -DHAVE_STPCPY 26 | -DHAVE_EXPLICIT_BZERO 27 | " P=linux L="-s -static-libgcc" \ 28 | D=libtls_bearssl.so A=libtls_bearssl.a build 29 | fi 30 | -------------------------------------------------------------------------------- /c/lpeglabel/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build}" || exit 1 3 | 4 | build() { 5 | ${X}gcc -c -O2 $C src/*.c -I. -I../lua-headers -ansi 6 | ${X}gcc *.o -shared -o ../../bin/$P/clib/$D -L../../bin/$P $L 7 | rm -f ../../bin/$P/$A 8 | ${X}ar rcs ../../bin/$P/$A *.o 9 | rm *.o 10 | } 11 | 12 | if [ "$OSTYPE" = "msys" ]; then 13 | P=windows L="-s -static-libgcc -llua51" D=lpeglabel.dll A=lpeglabel.a build 14 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 15 | echo NYI 16 | else 17 | P=linux C=-fPIC L="-s -static-libgcc" D=lpeglabel.so A=liblpeglabel.a build 18 | fi 19 | -------------------------------------------------------------------------------- /c/lua-headers/WHAT: -------------------------------------------------------------------------------- 1 | lua-headers 5.1.5 from http://www.lua.org/ (MIT license) 2 | 3 | used to compile Lua C modules. 4 | -------------------------------------------------------------------------------- /c/lua-headers/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lualib.h,v 1.36 2005/12/27 17:12:00 roberto Exp $ 3 | ** Lua standard libraries 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lualib_h 9 | #define lualib_h 10 | 11 | #include "lua.h" 12 | 13 | 14 | /* Key to file-handle type */ 15 | #define LUA_FILEHANDLE "FILE*" 16 | 17 | 18 | #define LUA_COLIBNAME "coroutine" 19 | LUALIB_API int (luaopen_base) (lua_State *L); 20 | 21 | #define LUA_TABLIBNAME "table" 22 | LUALIB_API int (luaopen_table) (lua_State *L); 23 | 24 | #define LUA_IOLIBNAME "io" 25 | LUALIB_API int (luaopen_io) (lua_State *L); 26 | 27 | #define LUA_OSLIBNAME "os" 28 | LUALIB_API int (luaopen_os) (lua_State *L); 29 | 30 | #define LUA_STRLIBNAME "string" 31 | LUALIB_API int (luaopen_string) (lua_State *L); 32 | 33 | #define LUA_MATHLIBNAME "math" 34 | LUALIB_API int (luaopen_math) (lua_State *L); 35 | 36 | #define LUA_DBLIBNAME "debug" 37 | LUALIB_API int (luaopen_debug) (lua_State *L); 38 | 39 | #define LUA_LOADLIBNAME "package" 40 | LUALIB_API int (luaopen_package) (lua_State *L); 41 | 42 | 43 | /* open all previous libraries */ 44 | LUALIB_API void (luaL_openlibs) (lua_State *L); 45 | 46 | 47 | 48 | #ifndef lua_assert 49 | #define lua_assert(x) ((void)0) 50 | #endif 51 | 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /c/luajit/apply-patches: -------------------------------------------------------------------------------- 1 | # read the first line on each .patch file to see what it does. 2 | cat *.patch | patch -N -p0 3 | 4 | # remove SONAME from library to avoid dependencies on libluajit 5 | # to fixate on the name of the file. 6 | sed 's|-Wl,-soname,\$(TARGET_SONAME)||g' -i src/src/Makefile 7 | -------------------------------------------------------------------------------- /c/luajit/build: -------------------------------------------------------------------------------- 1 | #go@ plink d10 -t sh sdk/c/luajit/build 2 | #go@ sh build 3 | #!/bin/sh 4 | 5 | gcc --version | grep gcc 6 | 7 | cd "${0%build}" || exit 1 8 | 9 | set -e 10 | cd src/src || exit 1 11 | 12 | build() { 13 | 14 | local CFLAGS="$CFLAGS \ 15 | -msse4.2 \ 16 | -DALLEGORY_BUILD \ 17 | -DLUAJIT_ENABLE_GC64 \ 18 | -DLUAJIT_ENABLE_LUA52COMPAT \ 19 | -DLUA_PATH_DEFAULT='\"$LUA_PATH_DEFAULT\"' \ 20 | -DLUA_CPATH_DEFAULT='\"$LUA_CPATH_DEFAULT\"' \ 21 | -I. \ 22 | " 23 | 24 | local B=../../../../bin/$P 25 | local J=$B/../../lua/jit 26 | 27 | rm -f $B/$X 28 | rm -f rm $B/$D 29 | 30 | make clean 31 | make HOST_CC=gcc amalg Q=" " \ 32 | LDFLAGS="$LDFLAGS" \ 33 | CFLAGS="$CFLAGS -DCOUNTS" \ 34 | DASM_XFLAGS="$DASM_XFLAGS" 35 | 36 | [ "$X0" ] || X0=$X; cp -f $X0 $B/$X 37 | [ "$D0" ] || D0=$D; cp -f $D0 $B/$D 38 | 39 | mkdir -p $J 40 | cp -f jit/*.lua $J/ 41 | cp -f jit/vmdef.lua $J/vmdef_$P.lua 42 | cp -f ../../vmdef.lua $J/vmdef.lua 43 | 44 | make clean 45 | } 46 | 47 | if [ "$OSTYPE" = "msys" ]; then 48 | LUA_PATH_DEFAULT="!\\\\..\\\\..\\\\lua\\\\?.lua" \ 49 | LUA_CPATH_DEFAULT="!\\\\clib\\\\?.dll" \ 50 | P=windows LDFLAGS="-static-libgcc" \ 51 | X=luajit.exe D=lua51.dll A=luajit.a \ 52 | build 53 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 54 | echo NYI 55 | else 56 | export LUA_PATH_DEFAULT="!/../../lua/?.lua" 57 | export LUA_CPATH_DEFAULT="!/clib/?.so" 58 | P=linux CFLAGS="-pthread -DCOUNTS" \ 59 | LDFLAGS="-pthread -static-libgcc -Wl,--disable-new-dtags -Wl,-rpath,'\$\$ORIGIN'" \ 60 | X=luajit D=libluajit.so A=libluajit.a \ 61 | build 62 | fi 63 | -------------------------------------------------------------------------------- /c/luajit/luaconf.h.patch: -------------------------------------------------------------------------------- 1 | Patch to allow LUA_PATH and LUA_CPATH to be overriden from the outside. 2 | --- luaconf.h 2019-10-26 13:00:52 +0300 3 | +++ src/src/luaconf.h 2019-10-26 13:03:37 +0300 4 | @@ -20,10 +20,14 @@ 5 | */ 6 | #define LUA_LDIR "!\\lua\\" 7 | #define LUA_CDIR "!\\" 8 | +#ifndef LUA_PATH_DEFAULT 9 | #define LUA_PATH_DEFAULT \ 10 | ".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" 11 | +#endif 12 | +#ifndef LUA_CPATH_DEFAULT 13 | #define LUA_CPATH_DEFAULT \ 14 | ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll" 15 | +#endif 16 | #else 17 | /* 18 | ** Note to distribution maintainers: do NOT patch the following lines! 19 | @@ -58,9 +62,13 @@ 20 | #define LUA_LCPATH1 ";" LUA_LCDIR "?.so" 21 | #define LUA_LCPATH2 ";" LUA_LCDIR "loadall.so" 22 | 23 | +#ifndef LUA_PATH_DEFAULT 24 | #define LUA_PATH_DEFAULT "./?.lua" LUA_JPATH LUA_LLPATH LUA_RLPATH 25 | +#endif 26 | +#ifndef LUA_CPATH_DEFAULT 27 | #define LUA_CPATH_DEFAULT "./?.so" LUA_LCPATH1 LUA_RCPATH LUA_LCPATH2 28 | #endif 29 | +#endif 30 | 31 | /* Environment variable names for path overrides and initialization code. */ 32 | #define LUA_PATH "LUA_PATH" 33 | -------------------------------------------------------------------------------- /c/luajit/luajit.c.patch: -------------------------------------------------------------------------------- 1 | Patch to require'terra' when running .t files from the command line. 2 | --- luajit.c 2019-10-27 09:46:26 +0200 3 | +++ src/src/luajit.c 2019-10-27 09:42:31 +0200 4 | @@ -273,7 +273,28 @@ 5 | const char *fname = argx[0]; 6 | if (strcmp(fname, "-") == 0 && strcmp(argx[-1], "--") != 0) 7 | fname = NULL; /* stdin */ 8 | - status = luaL_loadfile(L, fname); 9 | +#ifdef ALLEGORY_BUILD 10 | + // call require('terra') before running a *.t file. 11 | + if (fname) { 12 | + int len = strlen(fname); 13 | + if (len >= 3 && fname[len - 1] == 't' && fname[len - 2] == '.') { 14 | + lua_getglobal(L, "require"); 15 | + lua_pushliteral(L, "terra"); 16 | + lua_call(L, 1, 0); 17 | + } 18 | + } 19 | + // use terra-overriden _G.loadfile instead of luaL_loadfile. 20 | + lua_getglobal(L, "loadfile"); 21 | + lua_pushstring(L, fname); 22 | + lua_call(L, 1, 2); // pushes (chunk, nil) or (nil, err) 23 | + status = lua_isnil(L, -2); 24 | + if (status) 25 | + lua_remove(L, -2); // remove nil, leave the error 26 | + else 27 | + lua_pop(L, 1); // remove nil, leave the chunk 28 | +#else 29 | + status = luaL_loadfile(L, fname); // pushes the chunk or an error message 30 | +#endif 31 | if (status == LUA_OK) { 32 | /* Fetch args from arg table. LUA_INIT or -e might have changed them. */ 33 | int narg = 0; 34 | -------------------------------------------------------------------------------- /c/luajit/vmdef.lua: -------------------------------------------------------------------------------- 1 | local ffi = require'ffi' 2 | if ffi.os == 'Windows' then 3 | return require'jit.vmdef_windows' 4 | elseif ffi.os == 'Linux' then 5 | return require'jit.vmdef_linux' 6 | elseif ffi.os == 'OSX' then 7 | return require'jit.vmdef_osx' 8 | else 9 | error('jit.vmdef_'..ffi.os:lower()..' missing') 10 | end 11 | -------------------------------------------------------------------------------- /c/lz4/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build}" || exit 1 3 | 4 | build() { 5 | ${X}gcc -c -O3 -std=c99 -pedantic $C src/lib/lz4*.c -I. -I../xxhash 6 | ${X}gcc *.o -shared -lxxhash -o ../../bin/$P/$D $L 7 | rm -f ../../bin/$P/$A 8 | ${X}ar rcs ../../bin/$P/$A *.o 9 | rm *.o 10 | } 11 | 12 | if [ "$OSTYPE" = "msys" ]; then 13 | P=windows L="-s -static-libgcc -L../../bin/windows" D=lz4.dll A=lz4.a build 14 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 15 | echo NYI 16 | else 17 | P=linux C="-fPIC" L="-s -static-libgcc -L../../bin/linux" \ 18 | D=liblz4.so A=liblz4.a build 19 | fi 20 | -------------------------------------------------------------------------------- /c/md5/WHAT: -------------------------------------------------------------------------------- 1 | md5 1.0 from http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5 (public domain) 2 | -------------------------------------------------------------------------------- /c/md5/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build}" || exit 1 3 | 4 | build() { 5 | ${X}gcc -c -O2 $C md5.c -Wall -I. 6 | ${X}gcc *.o -shared -o ../../bin/$P/$D $L 7 | rm -f ../../bin/$P/$A 8 | ${X}ar rcs ../../bin/$P/$A *.o 9 | rm *.o 10 | } 11 | 12 | if [ "$OSTYPE" = "msys" ]; then 13 | P=windows L="-s -static-libgcc" D=md5.dll A=md5.a build 14 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 15 | P=osx C="-arch x86_64" L="-arch x86_64 -install_name @rpath/libmd5.dylib" \ 16 | D=libmd5.dylib A=libmd5.a build 17 | else 18 | P=linux C="-fPIC" L="-s -static-libgcc" D=libmd5.so A=libmd5.a build 19 | fi 20 | -------------------------------------------------------------------------------- /c/md5/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc. 3 | * MD5 Message-Digest Algorithm (RFC 1321). 4 | * 5 | * Homepage: 6 | * http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5 7 | * 8 | * Author: 9 | * Alexander Peslyak, better known as Solar Designer 10 | * 11 | * This software was written by Alexander Peslyak in 2001. No copyright is 12 | * claimed, and the software is hereby placed in the public domain. 13 | * In case this attempt to disclaim copyright and place the software in the 14 | * public domain is deemed null and void, then the software is 15 | * Copyright (c) 2001 Alexander Peslyak and it is hereby released to the 16 | * general public under the following terms: 17 | * 18 | * Redistribution and use in source and binary forms, with or without 19 | * modification, are permitted. 20 | * 21 | * There's ABSOLUTELY NO WARRANTY, express or implied. 22 | * 23 | * See md5.c for more information. 24 | */ 25 | 26 | #ifdef HAVE_OPENSSL 27 | #include 28 | #elif !defined(_MD5_H) 29 | #define _MD5_H 30 | 31 | /* Any 32-bit or wider unsigned integer data type will do */ 32 | typedef unsigned int MD5_u32plus; 33 | 34 | typedef struct { 35 | MD5_u32plus lo, hi; 36 | MD5_u32plus a, b, c, d; 37 | unsigned char buffer[64]; 38 | MD5_u32plus block[16]; 39 | } MD5_CTX; 40 | 41 | extern void MD5_Init(MD5_CTX *ctx); 42 | extern void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size); 43 | extern void MD5_Final(unsigned char *result, MD5_CTX *ctx); 44 | 45 | #endif -------------------------------------------------------------------------------- /c/minizip2/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build}" || exit 1 3 | 4 | build() { 5 | local C="$C 6 | -DHAVE_STDINT_H 7 | -DHAVE_ZLIB 8 | -DHAVE_WZAES 9 | -DHAVE_PKCRYPT 10 | -DMZ_ZIP_SIGNING 11 | src/mz_crypt.c 12 | src/mz_os.c 13 | src/mz_strm.c 14 | src/mz_strm_buf.c 15 | src/mz_strm_mem.c 16 | src/mz_strm_pkcrypt.c 17 | src/mz_strm_split.c 18 | src/mz_strm_wzaes.c 19 | src/mz_strm_zlib.c 20 | src/mz_zip.c 21 | src/mz_zip_rw.c 22 | " 23 | ${X}gcc -c -msse3 -msse4.1 -O3 $C -Isrc \ 24 | -DZLIB_COMPAT -I../zlib-ng/src -I../zlib-ng 25 | ${X}gcc *.o -shared -o ../../bin/$P/$D -L../../bin/$P -lz $L 26 | rm -f ../../bin/$P/$A 27 | ${X}ar rcs ../../bin/$P/$A *.o 28 | rm *.o 29 | } 30 | 31 | if [ "$OSTYPE" = "msys" ]; then 32 | C="src/mz_os_win32.c src/mz_strm_os_win32.c src/mz_crypt_winvista.c src/mz_crypt_winxp.c 33 | -D_WIN32_WINNT=0x601 -DWINVER=0x601" P=windows L="-s -static-libgcc -lcrypt32 -lbcrypt -lncrypt" \ 34 | D=minizip2.dll A=minizip2.a build 35 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 36 | P=osx C="-arch x86_64 src/mz_crypt_apple.c src/mz_strm_os_posix.c src/mz_os_posix.c" \ 37 | L="-arch x86_64 -install_name @rpath/libminizip2.dylib 38 | -framework CoreFoundation -framework Security -liconv" \ 39 | D=libminizip2.dylib A=libminizip2.a build 40 | else 41 | C="-fPIC src/mz_crypt_openssl.c src/mz_strm_os_posix.c src/mz_os_posix.c" \ 42 | P=linux L="-s -static-libgcc -Wl,--unresolved-symbols=report-all -lssl -lcrypto" \ 43 | D=libminizip2.so A=libminizip2.a build 44 | fi 45 | -------------------------------------------------------------------------------- /c/pillow_simd/Python.c: -------------------------------------------------------------------------------- 1 | 2 | #include "Python.h" 3 | #include "Imaging.h" 4 | 5 | void 6 | ImagingSectionEnter(ImagingSectionCookie *cookie) {}; 7 | void 8 | ImagingSectionLeave(ImagingSectionCookie *cookie) {}; 9 | 10 | void * 11 | ImagingError_MemoryError(void) {}; 12 | void * 13 | ImagingError_ModeError(void) {}; 14 | void * 15 | ImagingError_ValueError(const char *message) {}; 16 | void * 17 | ImagingError_Mismatch(void) {}; 18 | 19 | void 20 | ImagingError_Clear(void) {}; 21 | -------------------------------------------------------------------------------- /c/pillow_simd/Python.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef PYTHON_H 3 | #define PYTHON_H 4 | 5 | #include 6 | 7 | /* Resample.c forgot to include those. */ 8 | #include 9 | #include 10 | #include 11 | 12 | typedef ssize_t Py_ssize_t; 13 | 14 | typedef struct _PyObject { 15 | 16 | } PyObject; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /c/pillow_simd/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #go@ sh build 3 | #go@ plink d10 sdk/c/pillow_simd/build 4 | cd "${0%build}" || exit 1 5 | 6 | build() { 7 | ${X}gcc -O3 -c -Isrc/src/libImaging -I. $C \ 8 | -DHAVE_PROTOTYPES \ 9 | -DSTDC_HEADERS \ 10 | -DSIZEOF_SHORT=2 \ 11 | -DSIZEOF_INT=4 \ 12 | -DSIZEOF_LONG_LONG=8 \ 13 | src/src/libImaging/Resample.c \ 14 | src/src/libImaging/Storage.c \ 15 | src/src/libImaging/Copy.c \ 16 | src/src/libImaging/Palette.c \ 17 | Python.c \ 18 | pillow_simd.c 19 | ${X}gcc -Wl,--version-script=pillow_simd.version *.o -shared -o ../../bin/$P/$D $L 20 | rm -f ../../bin/$P/$A 21 | ${X}ar rcs ../../bin/$P/$A *.o 22 | rm *.o 23 | } 24 | 25 | build_s() { 26 | if [ "$OSTYPE" = "msys" ]; then 27 | P=windows L="-s -static-libgcc" D=pillow_simd$S.dll A=pillow_simd$S.a build 28 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 29 | P=osx64 C="$C -arch x86_64 -DSIZEOF_LONG=8" \ 30 | L="-arch x86_64 -install_name @rpath/libboxblur.dylib" \ 31 | D=libpillow_simd$S.dylib A=libpillow_simd$S.a build 32 | else 33 | P=linux C="$C -fPIC" L="-s -static-libgcc -DSIZEOF_LONG=8" \ 34 | D=libpillow_simd$S.so A=libpillow_simd$S.a build 35 | fi 36 | } 37 | C="-msse4.2" build_s 38 | C="-mavx2" S=_avx2 build_s 39 | -------------------------------------------------------------------------------- /c/pillow_simd/pillow_simd.c: -------------------------------------------------------------------------------- 1 | 2 | #include "Imaging.h" 3 | 4 | #define INT64_MAX 9223372036854775807LL 5 | 6 | Imaging pillow_image_create_for_data(char *data, char* mode, 7 | int w, int h, int stride, int bottom_up 8 | ) { 9 | if (h > INT64_MAX / stride) 10 | return NULL; 11 | Imaging im = ImagingNewPrologueSubtype(mode, w, h, sizeof(struct ImagingMemoryInstance)); 12 | if (!im) 13 | return NULL; 14 | /* setup file pointers */ 15 | if (bottom_up) 16 | for (int y = 0; y < h; y++) 17 | im->image[h - y - 1] = data + y * stride; 18 | else 19 | for (int y = 0; y < h; y++) 20 | im->image[y] = data + y * stride; 21 | return im; 22 | } 23 | 24 | void pillow_image_free(Imaging im) { 25 | ImagingDelete(im); 26 | } 27 | 28 | int pillow_image_width (Imaging im) { return im->xsize; } 29 | int pillow_image_height (Imaging im) { return im->ysize; } 30 | char* pillow_image_mode (Imaging im) { return im->mode; } 31 | char** pillow_image_rows (Imaging im) { return im->image; } 32 | 33 | Imaging pillow_resample(Imaging im, int w, int h, int cx, int cy, int cw, int ch, int filter) { 34 | float box[4] = {cx, cy, cw, ch}; 35 | return ImagingResample(im, w, h, filter, box); 36 | } 37 | -------------------------------------------------------------------------------- /c/pillow_simd/pillow_simd.version: -------------------------------------------------------------------------------- 1 | pillow_simd { 2 | global: pillow_*; 3 | local: *; 4 | }; 5 | -------------------------------------------------------------------------------- /c/precompile: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # preprocess multiple C header files into a single Lua file 3 | 4 | usage() { 5 | echo "USAGE: CFLAGS=... ./precompile [-m32] [-posix] FILE1.h ..." 6 | exit 1 7 | } 8 | 9 | [ "x$1" = "x-m32" ] && { CFLAGS="$CFLAGS -m32"; shift; } 10 | [ "x$1" = "x-posix" ] && { CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=200112L"; shift; } 11 | [ "$1" ] || usage 12 | 13 | inc_headers() { 14 | if [ "x$1" = "x-" ]; then 15 | cat 16 | else 17 | for h in $@; do 18 | if [ -f "$h" ]; then 19 | echo "#include \"$h\"" 20 | else 21 | echo "#include <$h>" 22 | fi 23 | done 24 | fi 25 | } 26 | 27 | inc_headers "$@" | gcc $CFLAGS -E -dD -xc - \ 28 | | grep -v '^$' \ 29 | | grep -v '#undef' \ 30 | | sed 's/__asm\(.*\)//g' \ 31 | | "../bin/linux/luajit" precompile.lua 32 | -------------------------------------------------------------------------------- /c/precompile.lua: -------------------------------------------------------------------------------- 1 | local f0 --current filename 2 | local files = {} --{filename = lines_t} 3 | local def = {} 4 | local fstack = {} 5 | 6 | for s in io.stdin:lines() do 7 | local f = s:match'^# %d+ "(.-)"' 8 | if f then 9 | f0 = f 10 | else 11 | if not files[f0] then 12 | fstack[#fstack+1] = f0 13 | files[f0] = {} 14 | end 15 | 16 | local df = files[f0] 17 | 18 | local d,v = s:match'^#define%s+([_%w]+)%s+(.*)' 19 | if d then 20 | if v ~= '' and not d:find'^_(.-)_H_$' then 21 | if not def[f0] then 22 | table.insert(df, 'enum {') 23 | end 24 | table.insert(df, string.format('\t%-20s = %s,', d, v)) 25 | def[f0] = d 26 | end 27 | else 28 | if def[f0] then 29 | table.insert(df, '};') 30 | def[f0] = nil 31 | end 32 | table.insert(df, s) 33 | end 34 | end 35 | end 36 | 37 | for f,df in pairs(files) do 38 | if def[f] then 39 | table.insert(df, '};') 40 | end 41 | end 42 | 43 | local f = io.stdout 44 | f:write[=[ 45 | local ffi = require'ffi' 46 | ffi.cdef[[ 47 | ]=] 48 | for _,m in ipairs(fstack) do 49 | f:write('\n// '..m..'\n') 50 | for _,s in ipairs(files[m]) do 51 | f:write(s..'\n') 52 | end 53 | end 54 | f:write']]\n' 55 | f:close() 56 | -------------------------------------------------------------------------------- /c/sha2/WHAT: -------------------------------------------------------------------------------- 1 | sha2 1.0.1 from http://www.aarongifford.com/computers/sha.html (BSD License) 2 | -------------------------------------------------------------------------------- /c/sha2/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build}" || exit 1 3 | 4 | build() { 5 | ${X}gcc -c -O2 $C sha2.c -I. -DSHA2_USE_INTTYPES_H -DBYTE_ORDER -DLITTLE_ENDIAN 6 | ${X}gcc *.o -shared -o ../../bin/$P/$D $L 7 | rm -f ../../bin/$P/$A 8 | ${X}ar rcs ../../bin/$P/$A *.o 9 | rm *.o 10 | } 11 | 12 | if [ "$OSTYPE" = "msys" ]; then 13 | P=windows L="-s -static-libgcc" D=sha2.dll A=sha2.a build 14 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 15 | P=osx C="-arch x86_64" L="-arch x86_64 -install_name @rpath/libsha2.dylib" \ 16 | D=libsha2.dylib A=libsha2.a build 17 | else 18 | P=linux C="-fPIC" L="-s -static-libgcc" D=libsha2.so A=libsha2.a build 19 | fi 20 | -------------------------------------------------------------------------------- /c/xxhash/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build}" || exit 1 3 | 4 | build() { 5 | ${X}gcc -c -O3 $C -DXXH_SSE2 -msse2 src/*.c -Isrc \ 6 | -std=c99 -Wall -Wextra -Wshadow -Wcast-qual -Wcast-align \ 7 | -Wstrict-prototypes -Wstrict-aliasing=1 -Wswitch-enum -Wundef -pedantic 8 | ${X}gcc *.o -shared -o ../../bin/$P/$D $L 9 | rm -f ../../bin/$P/$A 10 | ${X}ar rcs ../../bin/$P/$A *.o 11 | rm *.o 12 | } 13 | 14 | if [ "$OSTYPE" = "msys" ]; then 15 | C="-fno-asynchronous-unwind-tables" P=windows L="-s -static-libgcc" \ 16 | D=xxhash.dll A=xxhash.a build 17 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 18 | P=osx C="-arch x86_64" L="-arch x86_64 -install_name @rpath/libxxhash.dylib" \ 19 | D=libxxhash.dylib A=libxxhash.a build 20 | else 21 | P=linux C="-fPIC" L="-s -static-libgcc" D=libxxhash.so A=libxxhash.a build 22 | fi 23 | -------------------------------------------------------------------------------- /c/zlib-ng/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%build}" || exit 1 3 | 4 | build() { 5 | ${X}gcc -c -O2 $C -DZLIB_COMPAT -msse4.2 src/*.c -Isrc -I. 6 | ${X}gcc *.o -shared -o ../../bin/$P/$D $L 7 | rm -f ../../bin/$P/$A 8 | rm -f ../../bin/$P/$A 9 | ${X}ar rcs ../../bin/$P/$A *.o 10 | rm *.o 11 | } 12 | 13 | if [ "$OSTYPE" = "msys" ]; then 14 | P=windows C=-DZLIB_DLL L="-s -static-libgcc" D=z.dll A=z.a build 15 | elif [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then 16 | P=osx C="-arch x86_64 -mmacosx-version-min=10.9" \ 17 | L="-arch x86_64 -mmacosx-version-min=10.9 -install_name @rpath/libz.dylib" \ 18 | D=libz.dylib A=libz.a build 19 | else 20 | P=linux C="-fPIC" L="-s -static-libgcc" D=libz.so A=libz.a build 21 | fi 22 | -------------------------------------------------------------------------------- /gen-release-notes.sh: -------------------------------------------------------------------------------- 1 | #go@ sh * 2 | V1=$(git tag --sort=-committerdate | head -1) 3 | V0=$(git tag --sort=-committerdate | head -2 | awk '{split($0, tags, "\n")} END {print tags[1]}') 4 | CHANGES=$(git log --pretty="- %s" $V1...$V0 | grep -v unimportant) 5 | printf " 6 | ## Changes between $V0 and $V1 7 | 8 | $CHANGES 9 | 10 | _Total commits: $(echo "$CHANGES" | wc -l)_ 11 | " 12 | -------------------------------------------------------------------------------- /lua/bcrypt.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | bcrypt binding. 4 | Written by Cosmin Apreutesei. Public Domain. 5 | 6 | bcrypt_hash(password, [rounds]) -> hash 7 | bcrypt_verify(password, hash) -> true|false 8 | 9 | ]] 10 | 11 | require'glue' 12 | local C = ffi.load'bcrypt1' 13 | 14 | cdef[[ 15 | char *crypt(const char *key, const char *setting); 16 | char *crypt_gensalt(const char *prefix, unsigned long count, 17 | const char *input, int size); 18 | ]] 19 | 20 | function bcrypt_hash(key, rounds) 21 | local secret = random_string(16) 22 | local salt = C.crypt_gensalt('$2a$', rounds or 10, secret, #secret) 23 | assert(salt ~= nil, 'secret too short') 24 | return ffi.string(C.crypt(key, salt)) 25 | end 26 | 27 | function bcrypt_verify(key, hash) 28 | return ffi.string(C.crypt(key, hash)) == hash 29 | end 30 | 31 | if not ... then 32 | math.randomseed(require'time'.clock()) 33 | local hash = bcrypt_hash('dude') 34 | print(#hash, hash) --60 bytes 35 | assert(bcrypt_verify('dude', hash)) 36 | end 37 | -------------------------------------------------------------------------------- /lua/bitmap_rgbaf.lua: -------------------------------------------------------------------------------- 1 | 2 | --floating point RGBA bitmap types for HDR storage and internal processing. 3 | require'bitmap' 4 | require'glue' 5 | local conv = bitmap_converters 6 | 7 | bitmap_colortypes.rgbaf = {channels = 'rgba', max = 1} 8 | 9 | bitmap_formats.rgbaf = merge({bpp = 32 * 4, ctype = ctype'float', 10 | colortype = 'rgbaf', bitmap_formats.rgba8}) 11 | 12 | bitmap_formats.rgbad = merge({bpp = 64 * 4, ctype = ctype'double', 13 | colortype = 'rgbaf', bitmap_formats.rgba8}) 14 | 15 | conv.rgbaf = {} 16 | 17 | function conv.rgbaf.rgba8(r, g, b, a) 18 | return r * 255, g * 255, b * 255, a * 255 19 | end 20 | 21 | function conv.rgba8.rgbaf(r, g, b, a) 22 | return r * (1 / 255), g * (1 / 255), b * (1 / 255), a * (1 / 255) 23 | end 24 | 25 | function conv.rgbaf.rgba16(r, g, b, a) 26 | return r * 65535, g * 65535, b * 65535, a * 65535 27 | end 28 | 29 | function bitmap_converters.rgba16.rgbaf(r, g, b, a) 30 | return r * (1 / 65535), g * (1 / 65535), b * (1 / 65535), a * (1 / 65535) 31 | end 32 | 33 | function conv.rgbaf.ga8(r, g, b, a) 34 | return bitmap_rgb2g(r, g, b) * 255, a 35 | end 36 | 37 | function conv.ga8.rgbaf(g, a) 38 | g = g / 255 39 | a = a / 255 40 | return g, g, g, a 41 | end 42 | 43 | function conv.rgbaf.ga16(r, g, b, a) 44 | return bitmap_rgb2g(r, g, b) * 65535, a 45 | end 46 | 47 | function conv.ga16.rgbaf(g, a) 48 | g = g / 65535 49 | a = a / 65535 50 | return g, g, g, a 51 | end 52 | 53 | function conv.cmyk8.rgbaf(c, m, y, k) 54 | return c * k / 65535, m * k / 65535, y * k / 65535, 1 55 | end 56 | 57 | function conv.ycck8.rgbaf(y, cb, cr, k) 58 | return 59 | (y + 1.402 * (cr - 128)) / 255, 60 | (y - 0.34414 * (cb - 128) - 0.71414 * (cr - 128)) / 255, 61 | (y + 1.772 * (cb - 128) ) / 255, 62 | 1 63 | end 64 | -------------------------------------------------------------------------------- /lua/cpu_supports.lua: -------------------------------------------------------------------------------- 1 | local ffi = require'ffi' 2 | local bit = require'bit' 3 | local C = ffi.load'cpu_supports' 4 | ffi.cdef'int cpu_supports();' 5 | 6 | local flags = { 7 | sse = 0x0001, 8 | sse2 = 0x0002, 9 | sse3 = 0x0010, 10 | ssse3 = 0x0020, 11 | sse41 = 0x0040, 12 | sse42 = 0x0080, 13 | avx = 0x0100, 14 | avx2 = 0x0200, 15 | } 16 | 17 | local band = bit.band 18 | local assert = assert 19 | function cpu_supports(what) 20 | return band(C.cpu_supports(), assert(flags[what])) ~= 0 21 | end 22 | -------------------------------------------------------------------------------- /lua/hmac.lua: -------------------------------------------------------------------------------- 1 | --[=[ 2 | 3 | HMAC authentication (RFC 2104) 4 | Written by Cosmin Apreutesei. Public Domain. 5 | 6 | hmac_md5 (message, key) -> HMAC-MD5 7 | hmac_sha1 (message, key) -> HMAC-SHA256 8 | hmac_sha256 (message, key) -> HMAC-SHA256 9 | hmac_sha384 (message, key) -> HMAC-SHA384 10 | hmac_sha512 (message, key) -> HMAC-SHA512 11 | 12 | ]=] 13 | 14 | require'glue' 15 | 16 | local 17 | cast, u8a, xor, str, rep = 18 | cast, u8a, xor, str, rep 19 | 20 | local function str_xor(s, c, n) 21 | assert(#s == n) 22 | local p = cast(u8p, s) 23 | local b = u8a(n) 24 | for i = 0, n-1 do 25 | b[i] = xor(p[i], c) 26 | end 27 | return str(b, n) 28 | end 29 | 30 | function hmac(key, message, hash, blocksize, opad, ipad) 31 | if #key > blocksize then 32 | key = hash(key) --keys longer than blocksize are shortened 33 | end 34 | key = key .. rep('\0', blocksize - #key) 35 | --^^keys shorter than blocksize are zero-padded. 36 | opad = opad or str_xor(key, 0x5c, blocksize) 37 | ipad = ipad or str_xor(key, 0x36, blocksize) 38 | --^^opad and ipad can be cached for the same key. 39 | return hash(opad .. hash(ipad .. message)), opad, ipad 40 | end 41 | 42 | local function mk(module_name, hash_name, blocksize) 43 | require(module_name) 44 | local hash = _G[hash_name] 45 | return function(message, key) 46 | return hmac(key, message, hash, blocksize) 47 | end 48 | end 49 | hmac_md5 = mk('md5' , 'md5' , 64) 50 | hmac_sha1 = mk('sha1', 'sha1' , 64) 51 | hmac_sha256 = mk('sha2', 'sha256', 64) 52 | hmac_sha384 = mk('sha2', 'sha384', 128) 53 | hmac_sha512 = mk('sha2', 'sha512', 128) 54 | -------------------------------------------------------------------------------- /lua/jit/dis_x64.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------------------- 2 | -- LuaJIT x64 disassembler wrapper module. 3 | -- 4 | -- Copyright (C) 2005-2022 Mike Pall. All rights reserved. 5 | -- Released under the MIT license. See Copyright Notice in luajit.h 6 | ---------------------------------------------------------------------------- 7 | -- This module just exports the 64 bit functions from the combined 8 | -- x86/x64 disassembler module. All the interesting stuff is there. 9 | ------------------------------------------------------------------------------ 10 | 11 | local dis_x86 = require((string.match(..., ".*%.") or "").."dis_x86") 12 | return { 13 | create = dis_x86.create64, 14 | disass = dis_x86.disass64, 15 | regname = dis_x86.regname64 16 | } 17 | 18 | -------------------------------------------------------------------------------- /lua/jit/vmdef.lua: -------------------------------------------------------------------------------- 1 | local ffi = require'ffi' 2 | if ffi.os == 'Windows' then 3 | return require'jit.vmdef_windows' 4 | elseif ffi.os == 'Linux' then 5 | return require'jit.vmdef_linux' 6 | elseif ffi.os == 'OSX' then 7 | return require'jit.vmdef_osx' 8 | else 9 | error('jit.vmdef_'..ffi.os:lower()..' missing') 10 | end 11 | -------------------------------------------------------------------------------- /lua/jit/zone.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------------------- 2 | -- LuaJIT profiler zones. 3 | -- 4 | -- Copyright (C) 2005-2022 Mike Pall. All rights reserved. 5 | -- Released under the MIT license. See Copyright Notice in luajit.h 6 | ---------------------------------------------------------------------------- 7 | -- 8 | -- This module implements a simple hierarchical zone model. 9 | -- 10 | -- Example usage: 11 | -- 12 | -- local zone = require("jit.zone") 13 | -- zone("AI") 14 | -- ... 15 | -- zone("A*") 16 | -- ... 17 | -- print(zone:get()) --> "A*" 18 | -- ... 19 | -- zone() 20 | -- ... 21 | -- print(zone:get()) --> "AI" 22 | -- ... 23 | -- zone() 24 | -- 25 | ---------------------------------------------------------------------------- 26 | 27 | local remove = table.remove 28 | 29 | return setmetatable({ 30 | flush = function(t) 31 | for i=#t,1,-1 do t[i] = nil end 32 | end, 33 | get = function(t) 34 | return t[#t] 35 | end 36 | }, { 37 | __call = function(t, zone) 38 | if zone then 39 | t[#t+1] = zone 40 | else 41 | return (assert(remove(t), "empty zone stack")) 42 | end 43 | end 44 | }) 45 | 46 | -------------------------------------------------------------------------------- /lua/luajit_h.lua: -------------------------------------------------------------------------------- 1 | --luajit.h extensions from lualib.h from luajit 2.0 2 | require'lua_h' 3 | require'ffi'.cdef[[ 4 | enum { 5 | /* More external and GCobj tags for internal objects. */ 6 | LUA_TPROTO = (LUA_TTHREAD+1), 7 | LUA_TCDATA = (LUA_TTHREAD+2) 8 | }; 9 | 10 | int (luaopen_bit) (lua_State *L); 11 | int (luaopen_ffi) (lua_State *L); 12 | int (luaopen_jit) (lua_State *L); 13 | ]] 14 | -------------------------------------------------------------------------------- /lua/md5.lua: -------------------------------------------------------------------------------- 1 | --[=[ 2 | 3 | MD5 hash and digest. 4 | 5 | md5(s[, #s]) -> s compute the MD5 hash of a string or buffer. 6 | md5_digest() -> digest get a closure that can consume data chunks. 7 | digest(s[, size]) digest a string 8 | digest(cdata, size) digest a cdata buffer 9 | digest() -> s return the hash 10 | 11 | The functions return the binary representation of the hash. 12 | To get the hex representation, use tohex(). 13 | 14 | ]=] 15 | 16 | if not ... then 17 | require'md5_test' 18 | require'md5_hmac_test' 19 | return 20 | end 21 | 22 | local ffi = require'ffi' 23 | local C = ffi.load'md5' 24 | 25 | ffi.cdef[[ 26 | typedef struct { 27 | uint32_t lo, hi; 28 | uint32_t a, b, c, d; 29 | uint8_t buffer[64]; 30 | uint32_t block[16]; 31 | } MD5_CTX; 32 | 33 | void MD5_Init(MD5_CTX *ctx); 34 | void MD5_Update(MD5_CTX *ctx, const uint8_t *data, uint32_t size); 35 | void MD5_Final(const uint8_t *result, MD5_CTX *ctx); 36 | ]] 37 | 38 | function md5_digest() 39 | local ctx = ffi.new'MD5_CTX' 40 | local result = ffi.new'uint8_t[16]' 41 | C.MD5_Init(ctx) 42 | return function(data, size) 43 | if data then 44 | C.MD5_Update(ctx, data, size or #data) 45 | else 46 | C.MD5_Final(result, ctx) 47 | return ffi.string(result, 16) 48 | end 49 | end 50 | end 51 | 52 | function md5(data, size) 53 | local d = md5_digest(); d(data, size); return d() 54 | end 55 | -------------------------------------------------------------------------------- /lua/scite.lua: -------------------------------------------------------------------------------- 1 | io.stdout:setvbuf'no' 2 | io.stderr:setvbuf'no' 3 | require'glue' 4 | require'fs' 5 | local tests_dir = exedir()..'/../../tests' 6 | luapath(tests_dir) 7 | 8 | if win then 9 | local sdkd_dir = indir('x:/sdkd') 10 | sopath (indir(sdkd_dir, 'bin/windows')) 11 | luapath(indir(sdkd_dir, 'lua')) 12 | luapath(indir(sdkd_dir, 'tests')) 13 | end 14 | 15 | --chdir(tests_dir) 16 | -------------------------------------------------------------------------------- /lua/sdk.lua: -------------------------------------------------------------------------------- 1 | require'glue' 2 | require'pp' 3 | require'logging' 4 | -------------------------------------------------------------------------------- /lua/strict.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- strict.lua 3 | -- checks uses of undeclared global variables 4 | -- All global variables must be 'declared' through a regular assignment 5 | -- (even assigning nil will do) in a main chunk before being used 6 | -- anywhere or assigned to inside a function. 7 | -- 8 | -- modified for better compatibility with LuaJIT, see: 9 | -- http://www.freelists.org/post/luajit/strictlua-with-stripped-bytecode 10 | 11 | local 12 | debug_getinfo, error, rawset, rawget = 13 | debug.getinfo, error, rawset, rawget 14 | 15 | local mt = getmetatable(_G) 16 | if mt == nil then 17 | mt = {} 18 | setmetatable(_G, mt) 19 | end 20 | 21 | mt.__declared = {} 22 | 23 | mt.__newindex = function (t, n, v) 24 | if not mt.__declared[n] then 25 | local info = debug_getinfo(2, "S") 26 | if info and info.linedefined > 0 then 27 | error("assign to undeclared variable '"..n.."'", 2) 28 | end 29 | mt.__declared[n] = true 30 | end 31 | rawset(t, n, v) 32 | end 33 | 34 | mt.__index = function (t, n) 35 | if not mt.__declared[n] then 36 | local info = debug_getinfo(2, "S") 37 | if info and info.linedefined > 0 then 38 | error("variable '"..n.."' is not declared", 2) 39 | end 40 | end 41 | return rawget(t, n) 42 | end 43 | -------------------------------------------------------------------------------- /lua/winapi.lua: -------------------------------------------------------------------------------- 1 | return require'winapi.init' -------------------------------------------------------------------------------- /lua/winapi/init.lua: -------------------------------------------------------------------------------- 1 | 2 | --binding/winapi: main winapi module 3 | --Written by Cosmin Apreutesei. Public Domain. 4 | 5 | if not ... then require'winapi_demo'; return end 6 | 7 | setfenv(1, require'winapi.namespace') 8 | require'winapi.types' 9 | require'winapi.util' 10 | require'winapi.wcs' 11 | return _M 12 | -------------------------------------------------------------------------------- /lua/winapi/namespace.lua: -------------------------------------------------------------------------------- 1 | 2 | --binding/namespace: namespace module and utils 3 | --Written by Cosmin Apreutesei. Public Domain. 4 | 5 | --additional sub-namespaces are published here too. 6 | 7 | local _M = {__index = _G} 8 | setmetatable(_M, _M) 9 | _M._M = _M 10 | 11 | setfenv(1, _M) --all sub-modules use this pattern to publish their stuff. 12 | 13 | --utility to import the contents of a table into the global winapi namespace 14 | --because when strict mode is enabled we can't do update(_M, t) 15 | function import(globals) 16 | for k,v in pairs(globals) do 17 | rawset(_M, k, v) 18 | end 19 | return globals 20 | end 21 | 22 | --import a table as module globals and return the reverse lookup table of it. 23 | function constants(t) 24 | import(t) 25 | return index(t) 26 | end 27 | 28 | --WM is a namespace for registering window message decoders. 29 | WM = {} --{WM_* = function(wParam, lParam) return decoded values ... end} 30 | 31 | --NM is a namespace for registering WM_NOTIFY message decoders. 32 | NM = {} --{NM_* = function(hdr, wParam) return decoded values ... end} 33 | 34 | return _M 35 | -------------------------------------------------------------------------------- /lua/winapi/thread.lua: -------------------------------------------------------------------------------- 1 | 2 | --proc/system/thread: Threads API 3 | --Written by Cosmin Apreutesei. Public Domain. 4 | 5 | local ffi = require'ffi' 6 | 7 | setfenv(1, require'winapi') 8 | require'winapi.winbase' 9 | 10 | ffi.cdef[[ 11 | typedef DWORD (*LPTHREAD_START_ROUTINE)(LPVOID lpThreadParameter); 12 | 13 | HANDLE CreateThread( 14 | LPSECURITY_ATTRIBUTES lpThreadAttributes, 15 | SIZE_T dwStackSize, 16 | LPTHREAD_START_ROUTINE lpStartAddress, 17 | LPVOID lpParameter, 18 | DWORD dwCreationFlags, 19 | LPDWORD lpThreadId 20 | ); 21 | 22 | DWORD ResumeThread( 23 | HANDLE hThread 24 | ); 25 | ]] 26 | 27 | function ResumeThread(h) 28 | local sc = C.ResumeThread(h) 29 | if sc == 4294967295 then sc = -1 end 30 | return retpoz(sc) 31 | end 32 | -------------------------------------------------------------------------------- /lua/winapi/winbase.lua: -------------------------------------------------------------------------------- 1 | 2 | --proc/system/winbase: winbase.h. incomplete :) 3 | --Written by Cosmin Apreutesei. Public Domain. 4 | 5 | setfenv(1, require'winapi') 6 | 7 | FILE_FLAG_WRITE_THROUGH = 0x80000000 8 | FILE_FLAG_OVERLAPPED = 0x40000000 9 | FILE_FLAG_NO_BUFFERING = 0x20000000 10 | FILE_FLAG_RANDOM_ACCESS = 0x10000000 11 | FILE_FLAG_SEQUENTIAL_SCAN = 0x08000000 12 | FILE_FLAG_DELETE_ON_CLOSE = 0x04000000 13 | FILE_FLAG_BACKUP_SEMANTICS = 0x02000000 14 | FILE_FLAG_POSIX_SEMANTICS = 0x01000000 15 | FILE_FLAG_SESSION_AWARE = 0x00800000 16 | FILE_FLAG_OPEN_REPARSE_POINT = 0x00200000 17 | FILE_FLAG_OPEN_NO_RECALL = 0x00100000 18 | FILE_FLAG_FIRST_PIPE_INSTANCE = 0x00080000 19 | FILE_FLAG_OPEN_REQUIRING_OPLOCK = 0x00040000 --Win8+ 20 | 21 | INVALID_HANDLE_VALUE = ffi.cast('HANDLE', -1) 22 | 23 | ffi.cdef[[ 24 | typedef struct _SECURITY_ATTRIBUTES { 25 | DWORD nLength; 26 | LPVOID lpSecurityDescriptor; 27 | BOOL bInheritHandle; 28 | } SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES; 29 | 30 | DWORD GetCurrentThreadId(void); 31 | 32 | BOOL CloseHandle (HANDLE hObject); 33 | BOOL DuplicateHandle ( 34 | HANDLE hSourceProcessHandle, 35 | HANDLE hSourceHandle, 36 | HANDLE hTargetProcessHandle, 37 | LPHANDLE lpTargetHandle, 38 | DWORD dwDesiredAccess, 39 | BOOL bInheritHandle, 40 | DWORD dwOptions); 41 | 42 | BOOL GetHandleInformation (HANDLE hObject, LPDWORD lpdwFlags); 43 | BOOL SetHandleInformation (HANDLE hObject, DWORD dwMask, DWORD dwFlags); 44 | ]] 45 | 46 | GetCurrentThreadId = C.GetCurrentThreadId 47 | 48 | function CloseHandle(h) 49 | return retnz(C.CloseHandle(h)) 50 | end 51 | 52 | ffi.cdef[[ 53 | BOOL SetDllDirectoryW( 54 | LPCWSTR lpPathName 55 | ); 56 | ]] 57 | 58 | function SetDllDirectory(s) 59 | checknz(C.SetDllDirectoryW(wcs(s))) 60 | end 61 | -------------------------------------------------------------------------------- /lua/xlsxwriter.md: -------------------------------------------------------------------------------- 1 | 2 | ## `local xlsxwriter = require'xlsxwriter'` 3 | 4 | Excel XLSX file generator for Excel 2007+. 5 | 6 | ### Features 7 | 8 | * High degree of fidelity with files produced by Excel. 9 | * Can write very large files with semi-constant memory. 10 | * Full formatting. 11 | * Merged cells. 12 | * Worksheet setup methods. 13 | * Defined names. 14 | * Document properties. 15 | 16 | ### Limitations 17 | 18 | It can only create **new files**. It cannot read or modify existing files. 19 | 20 | ## Example 21 | 22 | ```lua 23 | local Workbook = require "xlsxwriter.workbook" 24 | 25 | local workbook = Workbook:new("demo.xlsx") 26 | local worksheet = workbook:add_worksheet() 27 | 28 | -- Widen the first column to make the text clearer. 29 | worksheet:set_column("A:A", 20) 30 | 31 | -- Add a bold format to use to highlight cells. 32 | local bold = workbook:add_format({bold = true}) 33 | 34 | -- Write some simple text. 35 | worksheet:write("A1", "Hello") 36 | 37 | -- Text with formatting. 38 | worksheet:write("A2", "World", bold) 39 | 40 | -- Write some numbers, with row/column notation. 41 | worksheet:write(2, 0, 123) 42 | worksheet:write(3, 0, 123.456) 43 | 44 | workbook:close() 45 | ``` 46 | 47 | ## Documentation 48 | 49 | Full documentation in the [lua/xlsxwriter](../../../tree/dev/lua/xlsxwriter) folder. 50 | -------------------------------------------------------------------------------- /lua/xlsxwriter/_images/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/lua/xlsxwriter/_images/demo.png -------------------------------------------------------------------------------- /lua/xlsxwriter/_images/formats_intro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/lua/xlsxwriter/_images/formats_intro.png -------------------------------------------------------------------------------- /lua/xlsxwriter/_images/formats_num_str.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/lua/xlsxwriter/_images/formats_num_str.png -------------------------------------------------------------------------------- /lua/xlsxwriter/_images/formats_set_bg_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/lua/xlsxwriter/_images/formats_set_bg_color.png -------------------------------------------------------------------------------- /lua/xlsxwriter/_images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/lua/xlsxwriter/_images/logo.png -------------------------------------------------------------------------------- /lua/xlsxwriter/_images/merge_range.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/lua/xlsxwriter/_images/merge_range.png -------------------------------------------------------------------------------- /lua/xlsxwriter/_images/tutorial01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/lua/xlsxwriter/_images/tutorial01.png -------------------------------------------------------------------------------- /lua/xlsxwriter/_images/tutorial02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/lua/xlsxwriter/_images/tutorial02.png -------------------------------------------------------------------------------- /lua/xlsxwriter/_images/tutorial03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/lua/xlsxwriter/_images/tutorial03.png -------------------------------------------------------------------------------- /lua/xlsxwriter/_images/workbook01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/lua/xlsxwriter/_images/workbook01.png -------------------------------------------------------------------------------- /lua/xlsxwriter/_images/workbook02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/lua/xlsxwriter/_images/workbook02.png -------------------------------------------------------------------------------- /lua/xlsxwriter/_images/working_with_dates_and_times01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/lua/xlsxwriter/_images/working_with_dates_and_times01.png -------------------------------------------------------------------------------- /lua/xlsxwriter/_images/working_with_dates_and_times02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/lua/xlsxwriter/_images/working_with_dates_and_times02.png -------------------------------------------------------------------------------- /lua/xlsxwriter/_images/worksheet00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/lua/xlsxwriter/_images/worksheet00.png -------------------------------------------------------------------------------- /lua/xlsxwriter/_images/worksheet01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/lua/xlsxwriter/_images/worksheet01.png -------------------------------------------------------------------------------- /lua/xlsxwriter/_images/worksheet02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/lua/xlsxwriter/_images/worksheet02.png -------------------------------------------------------------------------------- /lua/xlsxwriter/_images/worksheet_activate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/lua/xlsxwriter/_images/worksheet_activate.png -------------------------------------------------------------------------------- /lua/xlsxwriter/working_with_colors.md: -------------------------------------------------------------------------------- 1 | Working with Colors {#colors} 2 | =================== 3 | 4 | Throughout `xlsxwriter` colors are specified using a Html sytle 5 | `#RRGGBB` value. For example with a `Format `{.interpreted-text 6 | role="ref"} object: 7 | 8 | format:set_font_color('#FF0000') 9 | 10 | For convenience a limited number of color names are supported: 11 | 12 | format:set_font_color('red') 13 | 14 | The color names and corresponding `#RRGGBB` value are shown below: 15 | 16 | ----------------------------- 17 | Color name RGB color code 18 | ------------ ---------------- 19 | black `#000000` 20 | 21 | blue `#0000FF` 22 | 23 | brown `#800000` 24 | 25 | cyan `#00FFFF` 26 | 27 | gray `#808080` 28 | 29 | green `#008000` 30 | 31 | lime `#00FF00` 32 | 33 | magenta `#FF00FF` 34 | 35 | navy `#000080` 36 | 37 | orange `#FF6600` 38 | 39 | pink `#FF00FF` 40 | 41 | purple `#800080` 42 | 43 | red `#FF0000` 44 | 45 | silver `#C0C0C0` 46 | 47 | white `#FFFFFF` 48 | 49 | yellow `#FFFF00` 50 | ----------------------------- 51 | -------------------------------------------------------------------------------- /lua/xmodule.lua: -------------------------------------------------------------------------------- 1 | --[==[ 2 | 3 | webb | xmodule persistence 4 | 5 | ACTIONS 6 | 7 | xmodule_next_id 8 | xmodule_layer.json 9 | sql_rowset.json 10 | 11 | CALLS 12 | 13 | xmodule_layer_file(layer) 14 | xmodule_layer(layer) 15 | 16 | ]==] 17 | 18 | require'xrowset' 19 | require'webb_action' 20 | require'fs' 21 | 22 | --xmodule -------------------------------------------------------------------- 23 | 24 | function xmodule_layer_file(layer) 25 | return varpath(_('xm-%s.json', layer)) 26 | end 27 | 28 | function xmodule_layer(layer) 29 | local s = load(xmodule_layer_file(layer), false) 30 | return s and json_encode(s) 31 | end 32 | 33 | function action.xmodule_next_id(module) 34 | local file = varpath(_('x-%s-next-id', module)) 35 | local id = tonumber(load(file, '1')) 36 | if method'post' then 37 | save(file, tostring(id + 1)) 38 | end 39 | setmime'txt' 40 | outall(module..id) 41 | end 42 | 43 | action['xmodule_layer.json'] = function(layer) 44 | layer = checkarg(str_arg(layer)) 45 | checkarg(layer:find'^[%w_%-]+$') 46 | local file = xmodule_layer_file(layer) 47 | if method'post' then 48 | save(file, json_encode(post(), '\t')) 49 | else 50 | outall(load(file, '{}')) 51 | end 52 | end 53 | 54 | action['sql_rowset.json'] = function(id, ...) 55 | local module = checkarg(id:match'^[^_%d]+') 56 | local layer = checkarg(xmodule_layer(_('%s-server', module))) 57 | local t = checkfound(layer[id]) 58 | local rs = {} 59 | for k,v in pairs(t) do 60 | if k:starts'sql_' then 61 | rs[k:sub(5)] = v 62 | end 63 | end 64 | outall(sql_rowset(rs):respond()) 65 | end 66 | -------------------------------------------------------------------------------- /lua/xxhash_h.lua: -------------------------------------------------------------------------------- 1 | require'ffi'.cdef[[ 2 | unsigned XXH_versionNumber(void); 3 | 4 | typedef union { 5 | uint64_t u64[2]; 6 | uint32_t u32[4]; 7 | uint8_t u8[16]; 8 | } XXH128_hash_t; 9 | 10 | uint32_t XXH32 (const void* input, size_t length, uint32_t seed); 11 | uint64_t XXH64 (const void* input, size_t length, uint64_t seed); 12 | XXH128_hash_t XXH128(const void* input, size_t length, uint64_t seed); 13 | 14 | XXH128_hash_t XXH3_128bits_withSecret(const void* data, size_t len, const void* secret, size_t secretSize); 15 | 16 | typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode; 17 | 18 | typedef struct XXH3_state_s XXH3_state_t; 19 | XXH3_state_t* XXH3_createState(void); 20 | XXH_errorcode XXH3_freeState(XXH3_state_t* statePtr); 21 | void XXH3_copyState(XXH3_state_t* dst_state, const XXH3_state_t* src_state); 22 | 23 | XXH_errorcode XXH3_128bits_reset(XXH3_state_t* statePtr); 24 | XXH_errorcode XXH3_128bits_reset_withSeed(XXH3_state_t* statePtr, uint64_t seed); 25 | XXH_errorcode XXH3_128bits_reset_withSecret(XXH3_state_t* statePtr, const void* secret, size_t secretSize); 26 | 27 | XXH_errorcode XXH3_128bits_update (XXH3_state_t* statePtr, const void* input, size_t length); 28 | XXH128_hash_t XXH3_128bits_digest (const XXH3_state_t* statePtr); 29 | ]] 30 | -------------------------------------------------------------------------------- /tests/base64_test.lua: -------------------------------------------------------------------------------- 1 | require'glue' 2 | require'base64' 3 | 4 | assert(base64_decode'YW55IGNhcm5hbCBwbGVhc3VyZS4=' == 'any carnal pleasure.') 5 | assert(base64_decode'YW55IGNhcm5hbCBwbGVhc3VyZQ==' == 'any carnal pleasure') 6 | assert(base64_decode'YW55IGNhcm5hbCBwbGVhc3Vy' == 'any carnal pleasur') 7 | assert(base64_decode'YW55IGNhcm5hbCBwbGVhc3U=' == 'any carnal pleasu') 8 | assert(base64_decode'YW55IGNhcm5hbCBwbGVhcw==' == 'any carnal pleas') 9 | assert(base64_decode'., ? !@#$%^& \n\r\n\r YW55IGNhcm5hbCBwbGVhcw== \n\r' == 'any carnal pleas') 10 | 11 | assert(base64_encode'any carnal pleasure.' == 'YW55IGNhcm5hbCBwbGVhc3VyZS4=') 12 | assert(base64_encode'any carnal pleasure' == 'YW55IGNhcm5hbCBwbGVhc3VyZQ==') 13 | assert(base64_encode'any carnal pleasur' == 'YW55IGNhcm5hbCBwbGVhc3Vy') 14 | assert(base64_encode'any carnal pleasu' == 'YW55IGNhcm5hbCBwbGVhc3U=') 15 | assert(base64_encode'any carnal pleas' == 'YW55IGNhcm5hbCBwbGVhcw==') 16 | 17 | assert(base64_decode((base64_encode'')) == '') 18 | assert(base64_decode((base64_encode'x')) == 'x') 19 | assert(base64_decode((base64_encode'xx')) == 'xx') 20 | assert(base64_decode'.!@#$%^&*( \n\r\t' == '') 21 | 22 | local function encln(s, n) return base64_encode(s:rep(n), nil, nil, nil, 76) end 23 | assert(encln('.', 1) == 'Lg==\r\n') 24 | assert(encln('.', 76/4*3) == ('Li4u'):rep(76/4)..'\r\n') 25 | assert(encln('.', 76/4*3+1) == ('Li4u'):rep(76/4)..'\r\nLg==\r\n') 26 | print'ok' 27 | -------------------------------------------------------------------------------- /tests/bitmap_test.lua: -------------------------------------------------------------------------------- 1 | 2 | require'bitmap' 3 | require'glue' 4 | require'unit' 5 | io.stdout:setvbuf'no' 6 | 7 | bitmap_dumpinfo() 8 | print() 9 | local w, h = 1921, 1081 10 | if os.getenv'AUTO' then w, h = 13, 17 end --make it faster 11 | 12 | local n = 0 13 | for src_format in sortedpairs(bitmap_formats) do 14 | 15 | print(_('%-6s %-4s %-10s %-10s %9s %9s %7s %13s', 16 | 'time', '', 'src', 'dst', 'src size', 'dst size', 'stride', 'r+w speed')) 17 | 18 | jit.flush() 19 | for dst_format in bitmap_conversions(src_format) do 20 | local src = bitmap(w, h, src_format) 21 | local dst = bitmap(w, h, dst_format, 'flipped', true) 22 | 23 | timediff() 24 | bitmap_paint(dst, src) 25 | local dt = timediff() 26 | 27 | local flag = src_format == dst_format and '*' or '' 28 | print(_('%-6.4f %-4s %-10s %-10s %6.2f MB %6.2f MB %-7s %6d MB/s', 29 | dt, flag, src.format, dst.format, src.size / 1024^2, dst.size / 1024^2, src.stride, 30 | (src.size + dst.size) / 1024^2 / dt)) 31 | 32 | end 33 | n = n + 1 34 | end 35 | print('bitmap conversions:', n) 36 | -------------------------------------------------------------------------------- /tests/blake3_test.lua: -------------------------------------------------------------------------------- 1 | 2 | require'glue' 3 | require'blake3' 4 | require'json' 5 | require'fs' 6 | 7 | local tests = json_decode(assert(load'blake3_test/test_vectors.json')) 8 | 9 | local b1 = blake3_state() 10 | local b2 = blake3_state(tests.key) 11 | local b3 = blake3_derive_key(tests.context_string) 12 | 13 | assert(#tests.cases == 35) 14 | for i,t in ipairs(tests.cases) do 15 | local s = ffi.new('uint8_t[?]', t.input_len) 16 | for i = 0, t.input_len-1 do 17 | s[i] = i % 251 18 | end 19 | local h1 = b1:update(s, t.input_len):finalize() 20 | local h2 = b2:update(s, t.input_len):finalize() 21 | local h3 = b3:update(s, t.input_len):finalize() 22 | assert(tohex(h1) == t.hash:sub(1, 64)) 23 | assert(tohex(h2) == t.keyed_hash:sub(1, 64)) 24 | assert(tohex(h3) == t.derive_key:sub(1, 64)) 25 | b1:reset() 26 | b2:reset() 27 | b3:reset() 28 | end 29 | print'ok' 30 | -------------------------------------------------------------------------------- /tests/bmp_test.lua: -------------------------------------------------------------------------------- 1 | require'glue' 2 | require'fs' 3 | require'bitmap' 4 | require'bmp' 5 | 6 | local function perr(fname, err) 7 | printf('%-46s %s', fname, err) 8 | end 9 | 10 | local function show(fname) 11 | local f = open(fname) 12 | local reader = f:unbuffered_reader() 13 | local bmp, err = try_bmp_open(reader) 14 | if not bmp then 15 | perr(fname, err) 16 | else 17 | local wbmp, err = bmp:try_load'bgra8' 18 | if not wbmp then 19 | perr(fname, err) 20 | else 21 | --save a copy of the bitmap so we test the saving API too 22 | local f1 = open(fname:gsub('%.bmp', '-saved.bmp'), 'w') 23 | bmp_save(wbmp, function(buf, sz) 24 | assert(f1:write(buf, sz)) 25 | end) 26 | f1:close() 27 | end 28 | end 29 | f:close() 30 | end 31 | 32 | local function show_iter(fname) 33 | local f = open(fname) 34 | local reader = f:unbuffered_reader() 35 | local bmp, err = try_bmp_open(reader) 36 | if bmp then 37 | local ok, err = pcall(function() 38 | for j, row_bmp in bmp:rows('bgr8', nil, true) do 39 | --bitmap_paint(wbmp, row_bmp) 40 | end 41 | end) 42 | if not ok then 43 | perr(fname, err) 44 | end 45 | end 46 | f:close() 47 | end 48 | 49 | for i,d in ipairs{'good', 'bad', 'questionable'} do 50 | for f in ls('bmp_test/'..d) do 51 | if f:find'%.bmp$' and not f:find'%-saved' then 52 | local f = 'bmp_test/'..d..'/'..f 53 | show(f) 54 | show_iter(f) 55 | end 56 | end 57 | end 58 | -------------------------------------------------------------------------------- /tests/bmp_test/.gitignore: -------------------------------------------------------------------------------- 1 | *-saved.bmp 2 | -------------------------------------------------------------------------------- /tests/bmp_test/WHAT: -------------------------------------------------------------------------------- 1 | images from bmpsuite 2.1 http://entropymine.com/jason/bmpsuite/ 2 | 3 | browser support for the bmp format, for comparison: 4 | 5 | http://entropymine.com/jason/bmpsuite/bmpsuite/html/bmpsuite.html 6 | 7 | Be sure that your loader supports the good, and doesn't crash on the bad and questionable. 8 | -------------------------------------------------------------------------------- /tests/bmp_test/bad/badbitcount.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/bad/badbitcount.bmp -------------------------------------------------------------------------------- /tests/bmp_test/bad/badbitssize.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/bad/badbitssize.bmp -------------------------------------------------------------------------------- /tests/bmp_test/bad/baddens1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/bad/baddens1.bmp -------------------------------------------------------------------------------- /tests/bmp_test/bad/baddens2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/bad/baddens2.bmp -------------------------------------------------------------------------------- /tests/bmp_test/bad/badfilesize.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/bad/badfilesize.bmp -------------------------------------------------------------------------------- /tests/bmp_test/bad/badheadersize.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/bad/badheadersize.bmp -------------------------------------------------------------------------------- /tests/bmp_test/bad/badpalettesize.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/bad/badpalettesize.bmp -------------------------------------------------------------------------------- /tests/bmp_test/bad/badplanes.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/bad/badplanes.bmp -------------------------------------------------------------------------------- /tests/bmp_test/bad/badrle.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/bad/badrle.bmp -------------------------------------------------------------------------------- /tests/bmp_test/bad/badwidth.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/bad/badwidth.bmp -------------------------------------------------------------------------------- /tests/bmp_test/bad/pal2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/bad/pal2.bmp -------------------------------------------------------------------------------- /tests/bmp_test/bad/pal8badindex.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/bad/pal8badindex.bmp -------------------------------------------------------------------------------- /tests/bmp_test/bad/reallybig.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/bad/reallybig.bmp -------------------------------------------------------------------------------- /tests/bmp_test/bad/rletopdown.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/bad/rletopdown.bmp -------------------------------------------------------------------------------- /tests/bmp_test/bad/shortfile.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/bad/shortfile.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/pal1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/pal1.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/pal1bg.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/pal1bg.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/pal1wb.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/pal1wb.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/pal4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/pal4.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/pal4rle.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/pal4rle.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/pal8-0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/pal8-0.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/pal8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/pal8.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/pal8nonsquare.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/pal8nonsquare.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/pal8rle.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/pal8rle.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/pal8topdown.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/pal8topdown.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/pal8v2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/pal8v2.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/pal8v4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/pal8v4.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/pal8v5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/pal8v5.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/pal8w124.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/pal8w124.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/pal8w125.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/pal8w125.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/pal8w126.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/pal8w126.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/rgb16-565.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/rgb16-565.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/rgb16-565pal.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/rgb16-565pal.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/rgb16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/rgb16.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/rgb24.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/rgb24.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/rgb24pal.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/rgb24pal.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/rgb32.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/rgb32.bmp -------------------------------------------------------------------------------- /tests/bmp_test/good/rgb32bf.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/good/rgb32bf.bmp -------------------------------------------------------------------------------- /tests/bmp_test/parrot.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/parrot.bmp -------------------------------------------------------------------------------- /tests/bmp_test/questionable/pal1p1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/questionable/pal1p1.bmp -------------------------------------------------------------------------------- /tests/bmp_test/questionable/pal4rletrns.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/questionable/pal4rletrns.bmp -------------------------------------------------------------------------------- /tests/bmp_test/questionable/pal8offs.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/questionable/pal8offs.bmp -------------------------------------------------------------------------------- /tests/bmp_test/questionable/pal8oversizepal.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/questionable/pal8oversizepal.bmp -------------------------------------------------------------------------------- /tests/bmp_test/questionable/pal8rletrns.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/questionable/pal8rletrns.bmp -------------------------------------------------------------------------------- /tests/bmp_test/questionable/rgb24jpeg.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/questionable/rgb24jpeg.bmp -------------------------------------------------------------------------------- /tests/bmp_test/questionable/rgb24largepal.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/questionable/rgb24largepal.bmp -------------------------------------------------------------------------------- /tests/bmp_test/questionable/rgb24png.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/questionable/rgb24png.bmp -------------------------------------------------------------------------------- /tests/bmp_test/questionable/rgb32-111110.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/questionable/rgb32-111110.bmp -------------------------------------------------------------------------------- /tests/bmp_test/questionable/rgb32fakealpha.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/questionable/rgb32fakealpha.bmp -------------------------------------------------------------------------------- /tests/bmp_test/questionable/rgba16-4444.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/questionable/rgba16-4444.bmp -------------------------------------------------------------------------------- /tests/bmp_test/questionable/rgba32.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/questionable/rgba32.bmp -------------------------------------------------------------------------------- /tests/bmp_test/questionable/rgba32abf.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/questionable/rgba32abf.bmp -------------------------------------------------------------------------------- /tests/bmp_test/rgb_24bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/rgb_24bit.bmp -------------------------------------------------------------------------------- /tests/bmp_test/rgb_3bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/bmp_test/rgb_3bit.bmp -------------------------------------------------------------------------------- /tests/canvas_ui_demo_app/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | *.pid 3 | -------------------------------------------------------------------------------- /tests/canvas_ui_demo_app/README.md: -------------------------------------------------------------------------------- 1 | This a simple RTC signaling server used by canvas-ui screen sharing demo. 2 | It also serves canvas-ui's demo html. 3 | 4 | To start it just type: 5 | 6 | cui on Windows, or 7 | ./cui on Linux. 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/canvas_ui_demo_app/cui: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec "${0%cui}/../../bin/linux/luajit" "${0%cui}cui.lua" "$@" 3 | -------------------------------------------------------------------------------- /tests/canvas_ui_demo_app/cui.cmd: -------------------------------------------------------------------------------- 1 | @call "%~dp0..\..\bin\windows\luajit.exe" "%~dp0cui.lua" %* 2 | -------------------------------------------------------------------------------- /tests/canvas_ui_demo_app/cui.conf: -------------------------------------------------------------------------------- 1 | http_port = 8888 2 | https_addr = false 3 | verbose = true 4 | -------------------------------------------------------------------------------- /tests/cert: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # generates a test CA to be put in the browser. 3 | # generates a server certificates signed by the CA to configure http servers with. 4 | 5 | usage() { echo "USAGE: sh cert $1"; exit; } 6 | 7 | do_ca() { 8 | openssl genrsa -out test-ca.key 2048 9 | openssl req -x509 -new -nodes -key test-ca.key -sha256 -days 9999 -out test-ca.pem 10 | } 11 | 12 | do_server() { 13 | local NAME="$1"; [ "$NAME" ] || usage "server " 14 | openssl genrsa -out $NAME.key 2048 15 | openssl req -new -key $NAME.key -out $NAME.csr 16 | >$NAME.ext cat <<-EOF 17 | authorityKeyIdentifier=keyid,issuer 18 | basicConstraints=CA:FALSE 19 | keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment 20 | subjectAltName = @alt_names 21 | [alt_names] 22 | DNS.1 = $NAME 23 | EOF 24 | openssl x509 -req -in $NAME.csr -CA test-ca.pem -CAkey test-ca.key -CAcreateserial \ 25 | -out $NAME.crt -days 9999 -sha256 -extfile $NAME.ext 26 | rm $NAME.ext 27 | } 28 | 29 | cmd="$1"; shift 30 | [ "$cmd" ] || usage "ca | server HOST" 31 | "do_$cmd" "$@" 32 | -------------------------------------------------------------------------------- /tests/connpool_test.lua: -------------------------------------------------------------------------------- 1 | 2 | require'sock' 3 | require'connpool' 4 | logging.debug = true 5 | 6 | local pool = connpool{max_connections = 2, max_waiting_threads = 1} 7 | local h = 'test' 8 | 9 | run(function() 10 | 11 | local c1 = pool:put(h, {}, {}) 12 | local c2 = pool:put(h, {}, {}) 13 | print(pool:get(h, clock() + .1)) 14 | 15 | --local c, err = pool:get(h, -1) 16 | --assert(not c and err == 'empty') 17 | --local s = {close = function() print'close' end} 18 | --local c1 = {s = s} 19 | --c = pool:put(h, c1, s) 20 | --c:release() 21 | --local c, err = pool:get(h, 5) 22 | --assert(c == c1) 23 | --s:close() 24 | 25 | end) 26 | 27 | -------------------------------------------------------------------------------- /tests/csv_test/BOM.csv: -------------------------------------------------------------------------------- 1 | alpha,bravo,charlie 2 | ONE,two,3 3 | four,five,6 -------------------------------------------------------------------------------- /tests/csv_test/bars.txt: -------------------------------------------------------------------------------- 1 | there's a comma in this field, but no newline|"embedded 2 | newline"|"embedded 3 | newline" 4 | "embedded 5 | newline"|"embedded 6 | newline"|"embedded 7 | newline" -------------------------------------------------------------------------------- /tests/csv_test/blank-line.csv: -------------------------------------------------------------------------------- 1 | this,file,ends,with,a,blank,line 2 | 3 | -------------------------------------------------------------------------------- /tests/csv_test/embedded-newlines.csv: -------------------------------------------------------------------------------- 1 | "embedded 2 | newline","embedded 3 | newline","embedded 4 | newline" 5 | "embedded 6 | newline","embedded 7 | newline","embedded 8 | newline" -------------------------------------------------------------------------------- /tests/csv_test/embedded-quotes.csv: -------------------------------------------------------------------------------- 1 | "embedded ""quotes""","embedded ""quotes""","embedded ""quotes""" 2 | "embedded ""quotes""","embedded ""quotes""","embedded ""quotes""" -------------------------------------------------------------------------------- /tests/csv_test/header.csv: -------------------------------------------------------------------------------- 1 | alpha,bravo,charlie 2 | ONE,two,3 3 | four,five,6 -------------------------------------------------------------------------------- /tests/gzip_test.lua: -------------------------------------------------------------------------------- 1 | require'gzip' 2 | require'glue' 3 | require'unit' 4 | 5 | test(tohex(adler32'The game done changed.'), '587507ba') 6 | test(tohex(crc32'Game\'s the same, just got more fierce.'), '2c40120a') 7 | 8 | local function gztest(file, content) 9 | local gz = gzip_open(file) 10 | test(gz:read(#content), content) 11 | test(#gz:read(1), 0) 12 | test(gz:eof(), true) 13 | gz:close() 14 | end 15 | 16 | local gz = gzip_open('gzip_test/test1.txt.gz', 'w') 17 | test(gz:write'The game done changed.', #'The game done changed.') 18 | gz:close() 19 | 20 | gztest('gzip_test/test.txt.gz', 'The game done changed.') 21 | gztest('gzip_test/test1.txt.gz', 'The game done changed.') 22 | os.remove('gzip_test/test1.txt.gz') 23 | 24 | local function gen(n) 25 | local t = {} 26 | for i=1,n do 27 | t[i] = string.format('dude %g\r\n', math.random()) 28 | end 29 | return table.concat(t) 30 | end 31 | 32 | local function reader(s) 33 | local done 34 | return function() 35 | if done then return end 36 | done = true 37 | return s 38 | end 39 | end 40 | 41 | local function writer() 42 | local t = {} 43 | return function(data, sz) 44 | if not data then return table.concat(t) end 45 | t[#t+1] = ffi.string(data, sz) 46 | end 47 | end 48 | 49 | local function test(format, size) 50 | local src = gen(size) 51 | local write = writer() 52 | deflate(reader(src), write, nil, format) 53 | local dst = write() 54 | local write = writer() 55 | inflate(reader(dst), write, nil, format) 56 | local src2 = write() 57 | assert(src == src2) 58 | print(string.format('format: %-8s size: %5dK ratio: %d%%', 59 | format, #src/1024, #dst / #src * 100)) 60 | end 61 | for _,size in ipairs{0, 1, 13, 2049, 100000} do 62 | test('gzip', size) 63 | test('zlib', size) 64 | test('deflate', size) 65 | end 66 | -------------------------------------------------------------------------------- /tests/gzip_test/test.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/gzip_test/test.txt.gz -------------------------------------------------------------------------------- /tests/hash_benchmark.lua: -------------------------------------------------------------------------------- 1 | --benchmark for the included hash functions. 2 | require'glue' 3 | 4 | if ... then return end --prevent loading as module 5 | 6 | io.stdout:setvbuf'no' 7 | io.stderr:setvbuf'no' 8 | 9 | local function benchmark(s, hash, iter) 10 | local sz = 1024^2 * 10 11 | local iter = iter or 100 12 | local key = u8a(sz) 13 | for i=0,sz-1 do key[i] = i % 256 end 14 | local h = 0 15 | local t0 = clock() 16 | for i=1,iter do 17 | h = hash(key, sz, h) 18 | end 19 | local t1 = clock() 20 | print(format('%s %8.2f MB/s (%s)', s, 21 | (sz * iter) / 1024^2 / (t1 - t0), 22 | type(h) == 'string' and (#h * 8)..' bits' or type(h))) 23 | collectgarbage() 24 | end 25 | 26 | require'blake3' 27 | require'md5' 28 | require'gzip' 29 | require'xxhash' 30 | require'sha1' 31 | require'sha2' 32 | 33 | benchmark('BLAKE3 ', function(s, sz) return blake3(s, sz) end) 34 | benchmark('sha1 Lua ', function(s, sz) return sha1(str(s, sz)) end, 4) 35 | benchmark('md5 C ', md5, 128) 36 | benchmark('crc32 C ', crc32, 256) 37 | benchmark('xxHash32 C ', xxhash32, 2048) 38 | benchmark('xxHash64 C ', xxhash64, 2048) 39 | benchmark('adler32 C ', adler32, 1024) 40 | benchmark('sha256 C ', sha256, 32) 41 | benchmark('sha384 C ', sha384, 32) 42 | benchmark('sha512 C ', sha512, 32) 43 | -------------------------------------------------------------------------------- /tests/http_client_test.lua: -------------------------------------------------------------------------------- 1 | require'glue' 2 | require'http_client' 3 | logging.verbose = true 4 | --logging.debug = true 5 | --config('getpage_debug', 'protocol stream') 6 | logging.filter.tls = true 7 | 8 | local function search_page_url(pn) 9 | return 'https://luapower.com/' 10 | end 11 | 12 | function test_update_ca_file() 13 | resume(thread(function() 14 | update_ca_file() 15 | end)) 16 | start() 17 | end 18 | 19 | function test_getpage(url, n) 20 | local b = 0 21 | for i=1,n do 22 | resume(thread(function() 23 | local s, err = getpage{url = url} 24 | b = b + (s and #s or 0) 25 | say('%-10s %s', s and kbytes(#s) or err, url) 26 | end, 'P'..i)) 27 | end 28 | local t0 = clock() 29 | start() 30 | t1 = clock() 31 | pr(kbytes(b / (t1 - t0))..'/s') 32 | end 33 | 34 | --test_update_ca_file() 35 | --test_getpage('http://luapower.com/', 1) 36 | test_getpage('https://mm.allegory.ro', 1) 37 | -------------------------------------------------------------------------------- /tests/http_server_test.lua: -------------------------------------------------------------------------------- 1 | --go@ plink d10 -t -batch sdk/bin/linux/luajit sdk/tests/http_server_test.lua 2 | require'glue' 3 | require'http_server' 4 | logging.debug = true 5 | local zero6 = Linux 6 | 7 | local server = http_server{ 8 | listen = { 9 | { 10 | host = 'localhost', 11 | addr = zero6 and '10.0.0.6' or '127.0.0.1', 12 | port = 80, 13 | }, 14 | { 15 | host = 'localhost', 16 | addr = zero6 and '10.0.0.6' or '127.0.0.1', 17 | port = 443, 18 | tls = true, 19 | tls_options = { 20 | keypairs = { 21 | { 22 | cert_file = exedir()..'/../../tests/localhost.crt', 23 | key_file = exedir()..'/../../tests/localhost.key', 24 | }, 25 | }, 26 | }, 27 | }, 28 | }, 29 | debug = { 30 | protocol = true, 31 | --stream = true, 32 | --tracebacks = true, 33 | errors = true, 34 | }, 35 | respond = function(req, thread) 36 | local read_body = req:read_body'reader' 37 | while true do 38 | local buf, sz = read_body() 39 | if buf == nil then break end --eof 40 | local s = str(buf, sz) 41 | print(s) 42 | end 43 | if req.uri == '/favicon.ico' then 44 | raise('http_response', {status = 404}) 45 | end 46 | local out = req:respond({ 47 | --compress = false, 48 | want_out_function = true, 49 | }) 50 | out(('hello '):rep(1000)) 51 | --raise{status = 404, content = 'Dude, no page here'} 52 | end, 53 | --respond = webb_respond, 54 | } 55 | 56 | start() 57 | -------------------------------------------------------------------------------- /tests/jpeg_test.lua: -------------------------------------------------------------------------------- 1 | require'glue' 2 | require'jpeg' 3 | require'fs' 4 | 5 | local function test_load_save() 6 | local infile = 'jpeg_test/progressive.jpg' 7 | local outfile = 'jpeg_test/test.jpg' 8 | local f = open(infile) 9 | local img = jpeg_open(f:unbuffered_reader()) 10 | local bmp = img:load() 11 | f:close() 12 | 13 | local f2 = open(outfile, 'w') 14 | local function write(buf, sz) 15 | return f2:write(buf, sz) 16 | end 17 | jpeg_save{bitmap = bmp, write = write} 18 | img:free() 19 | f2:close() 20 | 21 | local f = open(outfile) 22 | local img = jpeg_open{ 23 | read = f:unbuffered_reader(), 24 | partial_loading = false, --break on errors 25 | } 26 | local bmp2 = img:load() 27 | img:free() 28 | f:close() 29 | rmfile(outfile) 30 | assert(bmp.w == bmp2.w) 31 | assert(bmp.h == bmp2.h) 32 | print'ok' 33 | end 34 | 35 | test_load_save() 36 | -------------------------------------------------------------------------------- /tests/jpeg_test/progressive.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/jpeg_test/progressive.jpg -------------------------------------------------------------------------------- /tests/ldecnumber_test.lua: -------------------------------------------------------------------------------- 1 | local decnumber = require'ldecnumber' 2 | 3 | local balance = decnumber.tonumber'0.00' 4 | 5 | balance = balance + '0.01' 6 | balance = balance + '1.25' 7 | balance = balance - '1.12' 8 | 9 | assert(balance:isfinite() == true) 10 | assert(balance:isinfinite() == false) 11 | assert(balance:isnan() == false) 12 | 13 | assert(balance:tostring() == '0.14') 14 | -------------------------------------------------------------------------------- /tests/libtls_test.lua: -------------------------------------------------------------------------------- 1 | require'glue' 2 | require'libtls' 3 | 4 | local c = tls_client{ 5 | alpn = '123', 6 | ca = 'x', 7 | --ciphers = 'P-256', 8 | --crl = 'x', 9 | --dheparams = 'a', 10 | --ecdhecurve = 'x', 11 | --ecdhecurves = 'z,y', 12 | --ocsp_staple = 'x', 13 | --protocols = 'x', 14 | verify_depth = true, 15 | 16 | --TODO: add sessions to libtls-bearssl and test them. 17 | --session_id = '1', 18 | --session_lifetime = 1, 19 | 20 | prefer_ciphers_client = true, 21 | prefer_ciphers_server = true, 22 | insecure_noverifycert = true, 23 | insecure_noverifyname = true, 24 | insecure_noverifytime = true, 25 | ocsp_require_stapling = true, 26 | verify = true, 27 | verify_client = true, 28 | verify_client_optional = true, 29 | } 30 | 31 | c:free() 32 | print'ok' 33 | -------------------------------------------------------------------------------- /tests/linkedlist_test.lua: -------------------------------------------------------------------------------- 1 | 2 | require'linkedlist' 3 | 4 | local list = linkedlist() 5 | 6 | local function test(t) --test length and list traversal in both directions 7 | assert(list.length == #t) 8 | local i = 0 9 | for item in list:items() do 10 | i = i + 1 11 | assert(item[1] == t[i]) 12 | end 13 | assert(i == #t) 14 | local i = #t + 1 15 | for item in list:reverse_items() do 16 | i = i - 1 17 | assert(item[1] == t[i]) 18 | end 19 | assert(i == 1) 20 | end 21 | 22 | list:insert_last({'a'}); test{'a'} 23 | list:insert_last({'b'}); test{'a','b'} 24 | list:insert_first({'0'}); test{'0','a','b'} 25 | list:insert_after(list:next(), {'1'}); test{'0','1','a','b'} 26 | assert(list:remove_last()[1] == 'b'); test{'0','1','a'} 27 | assert(list:remove_first()[1] == '0'); test{'1','a'} 28 | assert(list:remove(list:next())[1] == '1'); test{'a'} 29 | assert(list:remove(list:prev())[1] == 'a'); test{} 30 | 31 | list:clear(); test{} 32 | assert(list:remove_last() == nil) 33 | 34 | list:clear(); list:insert_first({'a'}); test{'a'} 35 | list:clear(); list:insert_first({'a'}); test{'a'} 36 | 37 | -------------------------------------------------------------------------------- /tests/localhost.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDfTCCAmWgAwIBAgIUGgV8aE1JMnOgHHqANskxfUnl+A0wDQYJKoZIhvcNAQEL 3 | BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM 4 | GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMDExMjcxMTI1MDVaFw00ODA0 5 | MTMxMTI1MDVaMFkxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw 6 | HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxEjAQBgNVBAMMCWxvY2Fs 7 | aG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKkpLhQqJeO+PV+Y 8 | 2xJqwQuidlT2m9Gb8wPFcO/og8CmsbGqSSusKRbVtDtV5fdVesuLlTO/a6+GTjey 9 | zLbd9/YV2MDVkp4krCTmBMAjygZGWFI4FqAovnDQCH0c5+9fIaPWvPHCP/5GH4tQ 10 | Pvz2bb6M+MvxK/h6iomi1pfGRfNmCCePMXeUIXW4OR7F9xIxKjwKec9aDEnBK6Tj 11 | 8mQD/Ms+lPtkXZAOSJ7LZ7lJl4YpwYa8JMipJvgvcPXfHo9jbv0SuxwsyGk9klXe 12 | 7unQKPexL2pmp/8kfFSVNJsuH5oHXjHtIb1iDtOiPTs2vCxxv7+JoL7pTjO/JLwx 13 | 3CCIMH0CAwEAAaNRME8wHwYDVR0jBBgwFoAUtkCirv9RAUwNMEn7hBAkKJFaUsQw 14 | CQYDVR0TBAIwADALBgNVHQ8EBAMCBPAwFAYDVR0RBA0wC4IJbG9jYWxob3N0MA0G 15 | CSqGSIb3DQEBCwUAA4IBAQAEJhle7o1SBN49Fhkqo/ynDnjYHdXRBEFIU8qLpM+1 16 | shmopLXgUg9xp86VcxU/CG/4vI4xpQE3i0/uYOPCZ5Id1/T03x2vj8W8v2vURkD7 17 | Gw0JqTCp7uB5g9LjpzIQmrLxv5p3Odt7F3Sb7apXiBa3Q6262dhXlwFjRlXMwBkI 18 | 3NJAvV8NVywHyrCX6pUkCFpqqH3dV6KKRT/n+lu9fMFpaa37bIj5BWpLcYhY5I/t 19 | FCyC5zSNvwb7Cz7IxknoppSa0wgvki7mCjc9YweaBaspdaZ1Qnch8BN/FxBy2ako 20 | MYpBtfhEJRxu0uZ4IBR1AcExBtmjOI8bc6Hc7IJSs7MP 21 | -----END CERTIFICATE----- 22 | -------------------------------------------------------------------------------- /tests/localhost.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEAqSkuFCol4749X5jbEmrBC6J2VPab0ZvzA8Vw7+iDwKaxsapJ 3 | K6wpFtW0O1Xl91V6y4uVM79rr4ZON7LMtt339hXYwNWSniSsJOYEwCPKBkZYUjgW 4 | oCi+cNAIfRzn718ho9a88cI//kYfi1A+/PZtvoz4y/Er+HqKiaLWl8ZF82YIJ48x 5 | d5Qhdbg5HsX3EjEqPAp5z1oMScErpOPyZAP8yz6U+2RdkA5InstnuUmXhinBhrwk 6 | yKkm+C9w9d8ej2Nu/RK7HCzIaT2SVd7u6dAo97Evaman/yR8VJU0my4fmgdeMe0h 7 | vWIO06I9Oza8LHG/v4mgvulOM78kvDHcIIgwfQIDAQABAoIBAFihA8x63Mk7JmrM 8 | 6pL2rdhLsZYIc1FaVPP34ZlBCK7KZ7V/U8D2/bxCEaE4+zkgZyr4Ih8vvtsDEj4q 9 | hwmUuNMNVTiLbbs/2ZWnknudBL9O4f2J94jIcCcpSBlNKNQI0tZFr083iFHQKbzT 10 | OX1OG+fHcp9f57rTcXx1fdudfY7tX1s6shfFxk7ugCsPCY1gC6ayR9b9V9KT+dGq 11 | 6UcpN6cqzcynPgc00tAZo0ETBh0bnUmLVnJjOWsAjMMpIqNiDXbmQBDFY9VmCXny 12 | 2jNbvXMsrPIq0ANhUO7MSO21lY3VpsS3tYzc+OzimnDzsgwX5G00pO3N5rj90/v1 13 | A+nsKZ0CgYEA1ZjbA+0OCBDkg5Iv9mr5nvYCWRMRQkvjRJQV8dFGIDIvisaFIiuo 14 | xYOxh71rqRtvdvved6Fyd4HqDBu7ZMuAE0NBvIA3tSkFmj105+owbSkoy+vGqgjh 15 | kxNkjReF5m02BKYP0RZ/JgI60zsVwWKwUCL/cD5O2hnJTFuZ0OV6/lsCgYEAyr4L 16 | w0vp1Lz7f56Ho4A8LmE49wb+o0xSm7cljYEXO3s5z/m98/UhrJx8+JMEmB5LuROj 17 | 37QgEwOH69gD93aRvIk7HdrohedAwK27EztA7FuTQ+3c8ISqrLcLkpoDK9Oago5u 18 | 3+AiJChRABc9ajwWHKGBMI0bhPtDCjBwUmTedAcCgYEAvpMALlOOZmH0EPQYuQqf 19 | J1YlqCXcC0O8RY6+uZ/Xqpg8VNxlIqTDk165wfuemCYzYHy+9AvnHnuaQC1qGDd9 20 | UTJ771yS157/MavNp7IKfQrxLGh0O3drFBeEamJnhL1CKgmkKRCiZ14r8BVShtWv 21 | rABd2l6taekB8o/0AC8PeusCgYAElBYf6u705u+nCiV2A8dYJMnsijPl7CtRaOlo 22 | MKodpcLAd5tajwabp00LMAbCiKydGVxyCNdQlpvTL6WnSP4xi8fR/MeTfo1vzHyV 23 | CpmEvOyudAixRc206M1SGjhIHRc4K49FbwJWXrK1ldDFPWYib2NDfWxJrILvD/j5 24 | Y13CsQKBgEpQTVl3hlm5emvBhyoOWNKYIYXUd/fq10CzfcKuw+B/FgVfP7REyWTD 25 | x5aEzJiAOF+kJgwCbrv8RW9daS9k5OMYOzWclqTS8q6pPoJvylAA1YFj0JssK/AZ 26 | yvNC3EwAsKcVIAANw/jn+KVgU4Z3epwu48vJ86lxfyAB3ThVJoI7 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /tests/luastate_test.lua: -------------------------------------------------------------------------------- 1 | require'luastate' 2 | 3 | local lua = luastate() 4 | lua:openlibs('base') 5 | lua:openlibs() 6 | 7 | --test arg. and retval passing 8 | assert(lua:loadstring([[ 9 | return ... 10 | ]], 'main')) 11 | local a1, a2, a3, a4, a5 = 42.5, nil, false, "str", {k=5,t={},[{a=1}]={b=""}} 12 | local b1, b2, b3, b4, b5 = lua:call(a1, a2, a3, a4, a5) 13 | assert(a1 == b1) 14 | assert(a2 == b2) 15 | assert(a3 == b3) 16 | assert(a4 == b4) 17 | assert(a5.k == b5.k) 18 | assert(next(b5.t) == nil) 19 | local tk, tv 20 | for k,v in pairs(b5) do 21 | if type(k) == 'table' then 22 | tk, tv = k, v 23 | end 24 | end 25 | assert(tk.a == 1) 26 | assert(tv.b == '') 27 | 28 | --test max. depth for table copy 29 | local upvalue = 5 30 | local depth = 3000 31 | lua:push(function(depth, ...) 32 | assert(upvalue == nil) 33 | local function deep_table(depth) 34 | local root = {} 35 | local t = root 36 | for i=1,depth do --test stack overflow 37 | t[1] = {} 38 | t = t[1] 39 | end 40 | return root 41 | end 42 | return deep_table(depth) 43 | end) 44 | local function deep_table(depth) 45 | local root = {} 46 | local t = root 47 | for i=1,depth do --test stack overflow 48 | t[1] = {} 49 | t = t[1] 50 | end 51 | return root 52 | end 53 | local t = lua:call(depth, 'hi', 'there', deep_table(depth)) 54 | local n = -1 55 | while t do 56 | n = n + 1 57 | t = t[1] 58 | end 59 | assert(n == depth) 60 | lua:push(function(x) return x^2 end) 61 | local f = lua:get() 62 | assert(f(5) == 25) 63 | lua:pop() 64 | 65 | --test copying upvalues 66 | local x, y = 1, {a = 1} 67 | local function f0() 68 | assert(x == 1) 69 | assert(y.a == 1) 70 | end 71 | f0() 72 | lua:push(f0, 'u') 73 | local f2 = lua:get(nil, 'u') 74 | lua:call() 75 | f2() 76 | 77 | assert(lua:gettop() == 0) 78 | lua:close() 79 | print'ok' 80 | -------------------------------------------------------------------------------- /tests/md5_hmac_test.lua: -------------------------------------------------------------------------------- 1 | require'glue' 2 | require'unit' 3 | require'hmac' 4 | 5 | test(tohex((hmac_md5('dude', 'key'))), 'e9ecd7d5b2d9dc558d1c2cd173be7c38') 6 | test(tohex((hmac_md5('what do ya want for nothing?', 'Jefe'))), '750c783e6ab0b503eaa86e310a5db738') 7 | 8 | print'ok' 9 | -------------------------------------------------------------------------------- /tests/md5_test.lua: -------------------------------------------------------------------------------- 1 | require'md5' 2 | require'glue' 3 | 4 | local function sumhex(s) 5 | return tohex(md5(s)) 6 | end 7 | 8 | assert(sumhex'your momma is fat' == 'f208dff3c12214035c3e53498275a2cb') 9 | assert(sumhex'it\'s all int the game yo' == '58e00aee91545abffe9ce1b3da72271f') 10 | 11 | -- test some known sumhexs 12 | assert(sumhex('') == 'd41d8cd98f00b204e9800998ecf8427e') 13 | assert(sumhex('a') == '0cc175b9c0f1b6a831c399e269772661') 14 | assert(sumhex('abc') == '900150983cd24fb0d6963f7d28e17f72') 15 | assert(sumhex('abcdefghijklmnopqrstuvwxyz') == 'c3fcd3d76192e4007dfb496cca67e13b') 16 | assert(sumhex('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') 17 | == 'd174ab98d277d9f5a5611c2c9f419d9f') 18 | 19 | -- test padding borders 20 | assert(sumhex(rep('a',53)) == 'e9e7e260dce84ffa6e0e7eb5fd9d37fc') 21 | assert(sumhex(rep('a',54)) == 'eced9e0b81ef2bba605cbc5e2e76a1d0') 22 | assert(sumhex(rep('a',55)) == 'ef1772b6dff9a122358552954ad0df65') 23 | assert(sumhex(rep('a',56)) == '3b0c8ac703f828b04c6c197006d17218') 24 | assert(sumhex(rep('a',57)) == '652b906d60af96844ebd21b674f35e93') 25 | assert(sumhex(rep('a',63)) == 'b06521f39153d618550606be297466d5') 26 | assert(sumhex(rep('a',64)) == '014842d480b571495a4a0363793f7367') 27 | assert(sumhex(rep('a',65)) == 'c743a45e0d2e6a95cb859adae0248435') 28 | assert(sumhex(rep('a',255)) == '46bc249a5a8fc5d622cf12c42c463ae0') 29 | assert(sumhex(rep('a',256)) == '81109eec5aa1a284fb5327b10e9c16b9') 30 | 31 | assert(sumhex( 32 | '12345678901234567890123456789012345678901234567890123456789012345678901234567890') 33 | == '57edf4a22be3c955ac49da2e2107b67a') 34 | 35 | print'ok' 36 | -------------------------------------------------------------------------------- /tests/mysql_example.lua: -------------------------------------------------------------------------------- 1 | require'mysql' 2 | require'sock' 3 | 4 | run(function() 5 | 6 | local cn = mysql_connect{ 7 | host = '10.0.0.5', 8 | port = 3307, 9 | user = 'root', 10 | password = 'root', 11 | charset = 'utf8mb4', 12 | max_packet_size = 1024 * 1024, 13 | } 14 | 15 | cn:query'create database if not exists example' 16 | cn:use'example' 17 | cn:query'drop table if exists cats' 18 | 19 | local res = cn:query('create table cats ' 20 | .. '(id serial primary key, ' 21 | .. 'name varchar(5))') 22 | 23 | local res = cn:query('insert into cats (name) ' 24 | .. "values ('Bob'),(''),(null)") 25 | 26 | print(res.affected_rows, ' rows inserted into table cats ', 27 | '(last insert id: ', res.insert_id, ')') 28 | 29 | pr(cn:query('select * from cats order by id asc')) 30 | 31 | cn:close() 32 | 33 | end) 34 | -------------------------------------------------------------------------------- /tests/png_test.lua: -------------------------------------------------------------------------------- 1 | 2 | require'glue' 3 | require'png' 4 | require'fs' 5 | 6 | local function load(file) 7 | local f = open(file) 8 | local img = png_open{read = f:buffered_reader()} 9 | local bmp = img:load{accept = {bgra8 = true}} 10 | f:close() 11 | return img, bmp 12 | end 13 | 14 | local function save(bmp, file) 15 | local f = open(file, 'w') 16 | png_save{ 17 | bitmap = bmp, 18 | write = function(buf, sz) 19 | return f:write(buf, sz) 20 | end, 21 | } 22 | f:close() 23 | end 24 | 25 | local img, bmp = load'png_test/good/z09n2c08.png' 26 | save(bmp, 'png_test/good/z09n2c08_1.png') 27 | local img2, bmp2 = load'png_test/good/z09n2c08_1.png' 28 | rmfile'png_test/good/z09n2c08_1.png' 29 | assert(bmp.size == bmp2.size) 30 | for i=0,bmp.size-1 do 31 | assert(bmp.data[i] == bmp2.data[i]) 32 | end 33 | print'ok' 34 | -------------------------------------------------------------------------------- /tests/png_test/WHAT: -------------------------------------------------------------------------------- 1 | PngSuite images from http://www.schaik.com/pngsuite/ 2 | 3 | Be sure to support the good and not crash on the bad images. 4 | -------------------------------------------------------------------------------- /tests/png_test/bad/xc1n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/bad/xc1n0g08.png -------------------------------------------------------------------------------- /tests/png_test/bad/xc9n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/bad/xc9n2c08.png -------------------------------------------------------------------------------- /tests/png_test/bad/xcrn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/bad/xcrn0g04.png -------------------------------------------------------------------------------- /tests/png_test/bad/xcsn0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/bad/xcsn0g01.png -------------------------------------------------------------------------------- /tests/png_test/bad/xd0n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/bad/xd0n2c08.png -------------------------------------------------------------------------------- /tests/png_test/bad/xd3n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/bad/xd3n2c08.png -------------------------------------------------------------------------------- /tests/png_test/bad/xd9n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/bad/xd9n2c08.png -------------------------------------------------------------------------------- /tests/png_test/bad/xdtn0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/bad/xdtn0g01.png -------------------------------------------------------------------------------- /tests/png_test/bad/xhdn0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/bad/xhdn0g08.png -------------------------------------------------------------------------------- /tests/png_test/bad/xlfn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/bad/xlfn0g04.png -------------------------------------------------------------------------------- /tests/png_test/bad/xs1n0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/bad/xs1n0g01.png -------------------------------------------------------------------------------- /tests/png_test/bad/xs2n0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/bad/xs2n0g01.png -------------------------------------------------------------------------------- /tests/png_test/bad/xs4n0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/bad/xs4n0g01.png -------------------------------------------------------------------------------- /tests/png_test/bad/xs7n0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/bad/xs7n0g01.png -------------------------------------------------------------------------------- /tests/png_test/good/basi0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basi0g01.png -------------------------------------------------------------------------------- /tests/png_test/good/basi0g02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basi0g02.png -------------------------------------------------------------------------------- /tests/png_test/good/basi0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basi0g04.png -------------------------------------------------------------------------------- /tests/png_test/good/basi0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basi0g08.png -------------------------------------------------------------------------------- /tests/png_test/good/basi0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basi0g16.png -------------------------------------------------------------------------------- /tests/png_test/good/basi2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basi2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/basi2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basi2c16.png -------------------------------------------------------------------------------- /tests/png_test/good/basi3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basi3p01.png -------------------------------------------------------------------------------- /tests/png_test/good/basi3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basi3p02.png -------------------------------------------------------------------------------- /tests/png_test/good/basi3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basi3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/basi3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basi3p08.png -------------------------------------------------------------------------------- /tests/png_test/good/basi4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basi4a08.png -------------------------------------------------------------------------------- /tests/png_test/good/basi4a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basi4a16.png -------------------------------------------------------------------------------- /tests/png_test/good/basi6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basi6a08.png -------------------------------------------------------------------------------- /tests/png_test/good/basi6a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basi6a16.png -------------------------------------------------------------------------------- /tests/png_test/good/basn0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basn0g01.png -------------------------------------------------------------------------------- /tests/png_test/good/basn0g02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basn0g02.png -------------------------------------------------------------------------------- /tests/png_test/good/basn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basn0g04.png -------------------------------------------------------------------------------- /tests/png_test/good/basn0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basn0g08.png -------------------------------------------------------------------------------- /tests/png_test/good/basn0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basn0g16.png -------------------------------------------------------------------------------- /tests/png_test/good/basn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basn2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/basn2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basn2c16.png -------------------------------------------------------------------------------- /tests/png_test/good/basn3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basn3p01.png -------------------------------------------------------------------------------- /tests/png_test/good/basn3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basn3p02.png -------------------------------------------------------------------------------- /tests/png_test/good/basn3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basn3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/basn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basn3p08.png -------------------------------------------------------------------------------- /tests/png_test/good/basn4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basn4a08.png -------------------------------------------------------------------------------- /tests/png_test/good/basn4a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basn4a16.png -------------------------------------------------------------------------------- /tests/png_test/good/basn6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basn6a08.png -------------------------------------------------------------------------------- /tests/png_test/good/basn6a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/basn6a16.png -------------------------------------------------------------------------------- /tests/png_test/good/bgai4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/bgai4a08.png -------------------------------------------------------------------------------- /tests/png_test/good/bgai4a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/bgai4a16.png -------------------------------------------------------------------------------- /tests/png_test/good/bgan6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/bgan6a08.png -------------------------------------------------------------------------------- /tests/png_test/good/bgan6a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/bgan6a16.png -------------------------------------------------------------------------------- /tests/png_test/good/bgbn4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/bgbn4a08.png -------------------------------------------------------------------------------- /tests/png_test/good/bggn4a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/bggn4a16.png -------------------------------------------------------------------------------- /tests/png_test/good/bgwn6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/bgwn6a08.png -------------------------------------------------------------------------------- /tests/png_test/good/bgyn6a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/bgyn6a16.png -------------------------------------------------------------------------------- /tests/png_test/good/ccwn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/ccwn2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/ccwn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/ccwn3p08.png -------------------------------------------------------------------------------- /tests/png_test/good/cdfn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/cdfn2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/cdhn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/cdhn2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/cdsn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/cdsn2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/cdun2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/cdun2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/ch1n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/ch1n3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/ch2n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/ch2n3p08.png -------------------------------------------------------------------------------- /tests/png_test/good/cm0n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/cm0n0g04.png -------------------------------------------------------------------------------- /tests/png_test/good/cm7n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/cm7n0g04.png -------------------------------------------------------------------------------- /tests/png_test/good/cm9n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/cm9n0g04.png -------------------------------------------------------------------------------- /tests/png_test/good/cs3n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/cs3n2c16.png -------------------------------------------------------------------------------- /tests/png_test/good/cs3n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/cs3n3p08.png -------------------------------------------------------------------------------- /tests/png_test/good/cs5n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/cs5n2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/cs5n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/cs5n3p08.png -------------------------------------------------------------------------------- /tests/png_test/good/cs8n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/cs8n2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/cs8n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/cs8n3p08.png -------------------------------------------------------------------------------- /tests/png_test/good/ct0n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/ct0n0g04.png -------------------------------------------------------------------------------- /tests/png_test/good/ct1n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/ct1n0g04.png -------------------------------------------------------------------------------- /tests/png_test/good/cten0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/cten0g04.png -------------------------------------------------------------------------------- /tests/png_test/good/ctfn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/ctfn0g04.png -------------------------------------------------------------------------------- /tests/png_test/good/ctgn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/ctgn0g04.png -------------------------------------------------------------------------------- /tests/png_test/good/cthn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/cthn0g04.png -------------------------------------------------------------------------------- /tests/png_test/good/ctjn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/ctjn0g04.png -------------------------------------------------------------------------------- /tests/png_test/good/ctzn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/ctzn0g04.png -------------------------------------------------------------------------------- /tests/png_test/good/f00n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/f00n0g08.png -------------------------------------------------------------------------------- /tests/png_test/good/f00n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/f00n2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/f01n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/f01n0g08.png -------------------------------------------------------------------------------- /tests/png_test/good/f01n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/f01n2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/f02n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/f02n0g08.png -------------------------------------------------------------------------------- /tests/png_test/good/f02n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/f02n2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/f03n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/f03n0g08.png -------------------------------------------------------------------------------- /tests/png_test/good/f03n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/f03n2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/f04n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/f04n0g08.png -------------------------------------------------------------------------------- /tests/png_test/good/f04n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/f04n2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/f99n0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/f99n0g04.png -------------------------------------------------------------------------------- /tests/png_test/good/g03n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/g03n0g16.png -------------------------------------------------------------------------------- /tests/png_test/good/g03n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/g03n2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/g03n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/g03n3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/g04n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/g04n0g16.png -------------------------------------------------------------------------------- /tests/png_test/good/g04n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/g04n2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/g04n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/g04n3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/g05n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/g05n0g16.png -------------------------------------------------------------------------------- /tests/png_test/good/g05n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/g05n2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/g05n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/g05n3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/g07n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/g07n0g16.png -------------------------------------------------------------------------------- /tests/png_test/good/g07n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/g07n2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/g07n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/g07n3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/g10n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/g10n0g16.png -------------------------------------------------------------------------------- /tests/png_test/good/g10n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/g10n2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/g10n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/g10n3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/g25n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/g25n0g16.png -------------------------------------------------------------------------------- /tests/png_test/good/g25n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/g25n2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/g25n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/g25n3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/oi1n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/oi1n0g16.png -------------------------------------------------------------------------------- /tests/png_test/good/oi1n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/oi1n2c16.png -------------------------------------------------------------------------------- /tests/png_test/good/oi2n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/oi2n0g16.png -------------------------------------------------------------------------------- /tests/png_test/good/oi2n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/oi2n2c16.png -------------------------------------------------------------------------------- /tests/png_test/good/oi4n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/oi4n0g16.png -------------------------------------------------------------------------------- /tests/png_test/good/oi4n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/oi4n2c16.png -------------------------------------------------------------------------------- /tests/png_test/good/oi9n0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/oi9n0g16.png -------------------------------------------------------------------------------- /tests/png_test/good/oi9n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/oi9n2c16.png -------------------------------------------------------------------------------- /tests/png_test/good/pp0n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/pp0n2c16.png -------------------------------------------------------------------------------- /tests/png_test/good/pp0n6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/pp0n6a08.png -------------------------------------------------------------------------------- /tests/png_test/good/ps1n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/ps1n0g08.png -------------------------------------------------------------------------------- /tests/png_test/good/ps1n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/ps1n2c16.png -------------------------------------------------------------------------------- /tests/png_test/good/ps2n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/ps2n0g08.png -------------------------------------------------------------------------------- /tests/png_test/good/ps2n2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/ps2n2c16.png -------------------------------------------------------------------------------- /tests/png_test/good/s01i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s01i3p01.png -------------------------------------------------------------------------------- /tests/png_test/good/s01n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s01n3p01.png -------------------------------------------------------------------------------- /tests/png_test/good/s02i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s02i3p01.png -------------------------------------------------------------------------------- /tests/png_test/good/s02n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s02n3p01.png -------------------------------------------------------------------------------- /tests/png_test/good/s03i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s03i3p01.png -------------------------------------------------------------------------------- /tests/png_test/good/s03n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s03n3p01.png -------------------------------------------------------------------------------- /tests/png_test/good/s04i3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s04i3p01.png -------------------------------------------------------------------------------- /tests/png_test/good/s04n3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s04n3p01.png -------------------------------------------------------------------------------- /tests/png_test/good/s05i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s05i3p02.png -------------------------------------------------------------------------------- /tests/png_test/good/s05n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s05n3p02.png -------------------------------------------------------------------------------- /tests/png_test/good/s06i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s06i3p02.png -------------------------------------------------------------------------------- /tests/png_test/good/s06n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s06n3p02.png -------------------------------------------------------------------------------- /tests/png_test/good/s07i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s07i3p02.png -------------------------------------------------------------------------------- /tests/png_test/good/s07n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s07n3p02.png -------------------------------------------------------------------------------- /tests/png_test/good/s08i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s08i3p02.png -------------------------------------------------------------------------------- /tests/png_test/good/s08n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s08n3p02.png -------------------------------------------------------------------------------- /tests/png_test/good/s09i3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s09i3p02.png -------------------------------------------------------------------------------- /tests/png_test/good/s09n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s09n3p02.png -------------------------------------------------------------------------------- /tests/png_test/good/s32i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s32i3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/s32n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s32n3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/s33i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s33i3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/s33n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s33n3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/s34i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s34i3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/s34n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s34n3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/s35i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s35i3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/s35n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s35n3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/s36i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s36i3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/s36n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s36n3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/s37i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s37i3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/s37n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s37n3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/s38i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s38i3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/s38n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s38n3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/s39i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s39i3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/s39n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s39n3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/s40i3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s40i3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/s40n3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/s40n3p04.png -------------------------------------------------------------------------------- /tests/png_test/good/tbbn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/tbbn0g04.png -------------------------------------------------------------------------------- /tests/png_test/good/tbbn2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/tbbn2c16.png -------------------------------------------------------------------------------- /tests/png_test/good/tbbn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/tbbn3p08.png -------------------------------------------------------------------------------- /tests/png_test/good/tbgn2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/tbgn2c16.png -------------------------------------------------------------------------------- /tests/png_test/good/tbgn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/tbgn3p08.png -------------------------------------------------------------------------------- /tests/png_test/good/tbrn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/tbrn2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/tbwn0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/tbwn0g16.png -------------------------------------------------------------------------------- /tests/png_test/good/tbwn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/tbwn3p08.png -------------------------------------------------------------------------------- /tests/png_test/good/tbyn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/tbyn3p08.png -------------------------------------------------------------------------------- /tests/png_test/good/tp0n0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/tp0n0g08.png -------------------------------------------------------------------------------- /tests/png_test/good/tp0n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/tp0n2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/tp0n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/tp0n3p08.png -------------------------------------------------------------------------------- /tests/png_test/good/tp1n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/tp1n3p08.png -------------------------------------------------------------------------------- /tests/png_test/good/z00n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/z00n2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/z03n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/z03n2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/z06n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/z06n2c08.png -------------------------------------------------------------------------------- /tests/png_test/good/z09n2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/png_test/good/z09n2c08.png -------------------------------------------------------------------------------- /tests/pthread_example.lua: -------------------------------------------------------------------------------- 1 | 2 | local ffi = require'ffi' 3 | require'pthread' 4 | require'luastate' 5 | 6 | --make a new Lua state 7 | local state = luastate() 8 | 9 | --load the standard libraries into the Lua state 10 | state:openlibs() 11 | 12 | --create a callback into the Lua state to be called from a different thread 13 | state:push(function() 14 | 15 | --up-values are not copied, so we have to require ffi again. 16 | local ffi = require'ffi' 17 | 18 | --this is our worker function that will run in a different thread. 19 | local function worker() 20 | --print() is thread-safe so no need to guard it. 21 | print'Hello from thread!' 22 | end 23 | 24 | --make a ffi callback frame to call into our worker function. 25 | --luajit anchors both the callback object and its function 26 | --so we don't care about them getting garbage collected. 27 | local worker_cb = ffi.cast('void *(*)(void *)', worker) 28 | 29 | --get the callback pointer out of the Lua state as a number, 30 | --because we can't pass cdata between Lua states. 31 | --tonumber() works on x64 too in this case because the Lua state 32 | --was allocated by LuaJIT which can only allocate stuff in the 33 | --lowest 4GB of the address space. 34 | return tonumber(ffi.cast('intptr_t', worker_cb)) 35 | end) 36 | 37 | --call the function that we just pushed into the Lua state 38 | --to get the callback pointer. 39 | local worker_cb_ptr = ffi.cast('void*', state:call()) 40 | 41 | --create a thread which will start running automatically. 42 | local thread = pthread(worker_cb_ptr) 43 | 44 | --wait for the thread to finish. 45 | thread:join() 46 | 47 | --close the Lua state. 48 | state:close() 49 | -------------------------------------------------------------------------------- /tests/queue_test.lua: -------------------------------------------------------------------------------- 1 | require'queue' 2 | 3 | local q = queue(4) 4 | local function test(s) 5 | local t = {} 6 | for s in q:items() do t[#t+1] = s end 7 | local s1 = table.concat(t) 8 | assert(s1 == s) 9 | assert(q:count() == #s) 10 | end 11 | assert(q:push'a') 12 | assert(q:push'b') 13 | assert(q:push'c') 14 | assert(q:push'd') 15 | assert(q:full()) 16 | assert(q:pop()) 17 | assert(q:push'e') 18 | assert(q:pop()) 19 | assert(q:push'f') 20 | test'cdef' 21 | q:remove'd' 22 | test'cef' 23 | q:remove'e' 24 | test'cf' 25 | q:remove'c' 26 | test'f' 27 | q:remove'f' 28 | test''; assert(q:empty()) 29 | assert(q:push'a') 30 | assert(q:push'b') 31 | assert(q:push'c') 32 | assert(q:push'd') 33 | assert(q:pop()) 34 | assert(q:pop()) 35 | assert(q:push'e') 36 | assert(q:push'f') 37 | test'cdef' 38 | assert(q:exists'c') 39 | assert(q:exists'd') 40 | assert(q:exists'e') 41 | assert(q:exists'f') 42 | -------------------------------------------------------------------------------- /tests/resize_image_test.lua: -------------------------------------------------------------------------------- 1 | 2 | require'resize_image' 3 | logging.verbose = true 4 | logging.debug = true 5 | 6 | resize_image( 7 | 'resize_image_test/birds.jpg', 8 | 'resize_image_test/birds-small.jpg' 9 | , 1/0, 400 10 | ) 11 | pr'ok' 12 | -------------------------------------------------------------------------------- /tests/resize_image_test/.gitignore: -------------------------------------------------------------------------------- 1 | birds-small.jpg 2 | -------------------------------------------------------------------------------- /tests/resize_image_test/birds.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/resize_image_test/birds.jpg -------------------------------------------------------------------------------- /tests/sha2_test.lua: -------------------------------------------------------------------------------- 1 | --go @ plink d10 sdk/bin/linux/luajit sdk/tests/sha2_test.lua 2 | require'glue' 3 | require'sha2' 4 | 5 | sha = { 6 | SHA256 = function(s) return tohex(sha256(s)) end, 7 | SHA384 = function(s) return tohex(sha384(s)) end, 8 | SHA512 = function(s) return tohex(sha512(s)) end, 9 | } 10 | 11 | for file in io.popen('ls sha2_test/*.dat'):lines() do 12 | local s = load(file) 13 | local hashes = {} 14 | do 15 | local f = assert(io.open(file:gsub('%.dat$', '')..'.info')) 16 | do 17 | local name, hash 18 | for line in f:lines() do 19 | if line:find'^SHA' then 20 | name = line:match'^(SHA.?.?.?)' 21 | hash = '' 22 | elseif hash then 23 | if #line == 0 then 24 | hashes[name] = hash 25 | hash = nil 26 | elseif hash then 27 | hash = hash .. line:match'^%s*(.-)%s*$' 28 | end 29 | end 30 | end 31 | end 32 | f:close() 33 | end 34 | 35 | for k,v in pairs(hashes) do 36 | local h = sha[k](s) 37 | --print(file, k..'x', #s, h == v and 'ok' or h .. ' ~= ' .. v) 38 | assert(h == v) 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /tests/sha2_test/vector001.dat: -------------------------------------------------------------------------------- 1 | abc -------------------------------------------------------------------------------- /tests/sha2_test/vector001.info: -------------------------------------------------------------------------------- 1 | DESCRIPTION: 2 | This test vector is taken from the PDF document that describes 3 | the SHA-256/384/512 algorithms. That document contains sample 4 | output for all three versions (SHA-256, SHA-384, and SHA-512). 5 | 6 | (Total length of test vector data: 3) 7 | 8 | FILE: 9 | vector001.dat 10 | 11 | SHA256: 12 | ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad 13 | 14 | SHA384: 15 | cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed 16 | 8086072ba1e7cc2358baeca134c825a7 17 | 18 | SHA512: 19 | ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a 20 | 2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f 21 | 22 | -------------------------------------------------------------------------------- /tests/sha2_test/vector002.dat: -------------------------------------------------------------------------------- 1 | abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq -------------------------------------------------------------------------------- /tests/sha2_test/vector002.info: -------------------------------------------------------------------------------- 1 | DESCRIPTION: 2 | The PDF document only provided sample output for SHA-256 using 3 | this test data. I have provided SHA-384 and SHA-512 sample 4 | output from my own implementation which may not be correct. 5 | 6 | (Total length of test vector data: 56) 7 | 8 | FILE: 9 | vector002.dat 10 | 11 | SHA256: 12 | 248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1 13 | 14 | SHA384: 15 | 3391fdddfc8dc7393707a65b1b4709397cf8b1d162af05abfe8f450de5f36bc6 16 | b0455a8520bc4e6f5fe95b1fe3c8452b 17 | 18 | SHA512: 19 | 204a8fc6dda82f0a0ced7beb8e08a41657c16ef468b228a8279be331a703c335 20 | 96fd15c13b1b07f9aa1d3bea57789ca031ad85c7a71dd70354ec631238ca3445 21 | 22 | -------------------------------------------------------------------------------- /tests/sha2_test/vector003.dat: -------------------------------------------------------------------------------- 1 | abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu -------------------------------------------------------------------------------- /tests/sha2_test/vector003.info: -------------------------------------------------------------------------------- 1 | DESCRIPTION: 2 | For this test data (from the PDF document), no example output 3 | was provided for SHA-256 (SHA-384 and SHA-512 samples were 4 | provided), so the sample for SHA-256 comes from the output of 5 | my own implementation and so may not be correct. 6 | 7 | (Total length of test vector data: 112) 8 | 9 | FILE: 10 | vector003.dat 11 | 12 | SHA256: 13 | cf5b16a778af8380036ce59e7b0492370b249b11e8f07a51afac45037afee9d1 14 | 15 | SHA384: 16 | 09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712 17 | fcc7c71a557e2db966c3e9fa91746039 18 | 19 | SHA512: 20 | 8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018 21 | 501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909 22 | 23 | -------------------------------------------------------------------------------- /tests/sha2_test/vector004.dat: -------------------------------------------------------------------------------- 1 | Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battlefield of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this. But, in a larger sense, we can not dedicate--we can not consecrate--we can not hallow--this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us--that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion--that we here highly resolve that these dead shall not have died in vain--that this nation, under God, shall have a new birth of freedom--and that government of the people, by the people, for the people, shall not perish from the earth. -- President Abraham Lincoln, November 19, 1863 -------------------------------------------------------------------------------- /tests/sha2_test/vector004.info: -------------------------------------------------------------------------------- 1 | DESCRIPTION: 2 | The output samples for this test vector come exclusively from my 3 | own implementation and so may be completely incorrect. Use with 4 | a very large grain of salt. The input sample comes from...well 5 | most anyone in the U.S. will know and many outside the U.S. too. 6 | 7 | (Total length of test vector data: 1515) 8 | 9 | FILE: 10 | vector004.dat 11 | 12 | SHA256: 13 | 4d25fccf8752ce470a58cd21d90939b7eb25f3fa418dd2da4c38288ea561e600 14 | 15 | SHA384: 16 | 69cc75b95280bdd9e154e743903e37b1205aa382e92e051b1f48a6db9d0203f8 17 | a17c1762d46887037275606932d3381e 18 | 19 | SHA512: 20 | 23450737795d2f6a13aa61adcca0df5eef6df8d8db2b42cd2ca8f783734217a7 21 | 3e9cabc3c9b8a8602f8aeaeb34562b6b1286846060f9809b90286b3555751f09 22 | 23 | -------------------------------------------------------------------------------- /tests/sha2_test/vector005.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/sha2_test/vector005.dat -------------------------------------------------------------------------------- /tests/sha2_test/vector005.info: -------------------------------------------------------------------------------- 1 | DESCRIPTION: 2 | The output samples for this test vector come exclusively from my 3 | own implementation and so may be completely incorrect. Use with 4 | a very large grain of salt. The input sample is EMPTY (no bits). 5 | Mr. David A. Ireland's SHA-256 implementation agrees with my own 6 | implementation on the output of this test vector (SHA-256 only). 7 | 8 | (Total length of test vector data: 0) 9 | 10 | FILE: 11 | vector005.dat 12 | 13 | SHA256: 14 | e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 15 | 16 | SHA384: 17 | 38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da 18 | 274edebfe76f65fbd51ad2f14898b95b 19 | 20 | SHA512: 21 | cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce 22 | 47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e 23 | 24 | -------------------------------------------------------------------------------- /tests/sha2_test/vector006.dat: -------------------------------------------------------------------------------- 1 | This is exactly 64 bytes long, not counting the terminating byte -------------------------------------------------------------------------------- /tests/sha2_test/vector006.info: -------------------------------------------------------------------------------- 1 | DESCRIPTION: 2 | The output samples for thi test vector come exclusively from my 3 | own implementation and so may be completely incorrect. Use with 4 | a very large grain of salt. The input sample exactly the same 5 | length as the SHA-256 block length. 6 | 7 | (Total length of test vector data: 64) 8 | 9 | FILE: 10 | vector006.dat 11 | 12 | SHA256: 13 | ab64eff7e88e2e46165e29f2bce41826bd4c7b3552f6b382a9e7d3af47c245f8 14 | 15 | SHA384: 16 | e28e35e25a1874908bf0958bb088b69f3d742a753c86993e9f4b1c4c21988f95 17 | 8bd1fe0315b195aca7b061213ac2a9bd 18 | 19 | SHA512: 20 | 70aefeaa0e7ac4f8fe17532d7185a289bee3b428d950c14fa8b713ca09814a38 21 | 7d245870e007a80ad97c369d193e41701aa07f3221d15f0e65a1ff970cedf030 22 | 23 | -------------------------------------------------------------------------------- /tests/sha2_test/vector007.dat: -------------------------------------------------------------------------------- 1 | For this sample, this 63-byte string will be used as input data -------------------------------------------------------------------------------- /tests/sha2_test/vector007.info: -------------------------------------------------------------------------------- 1 | DESCRIPTION: 2 | The output samples for thi test vector come exclusively from my 3 | own implementation and so may be completely incorrect. Use with 4 | a very large grain of salt. The input sample one byte shorter 5 | than the SHA-256 block length. 6 | 7 | (Total length of test vector data: 63) 8 | 9 | FILE: 10 | vector007.dat 11 | 12 | SHA256: 13 | f08a78cbbaee082b052ae0708f32fa1e50c5c421aa772ba5dbb406a2ea6be342 14 | 15 | SHA384: 16 | 37b49ef3d08de53e9bd018b0630067bd43d09c427d06b05812f48531bce7d2a6 17 | 98ee2d1ed1ffed46fd4c3b9f38a8a557 18 | 19 | SHA512: 20 | b3de4afbc516d2478fe9b518d063bda6c8dd65fc38402dd81d1eb7364e72fb6e 21 | 6663cf6d2771c8f5a6da09601712fb3d2a36c6ffea3e28b0818b05b0a8660766 22 | 23 | -------------------------------------------------------------------------------- /tests/sha2_test/vector008.dat: -------------------------------------------------------------------------------- 1 | And this textual data, astonishing as it may appear, is exactly 128 bytes in length, as are both SHA-384 and SHA-512 block sizes -------------------------------------------------------------------------------- /tests/sha2_test/vector008.info: -------------------------------------------------------------------------------- 1 | DESCRIPTION: 2 | The output samples for thi test vector come exclusively from my 3 | own implementation and so may be completely incorrect. Use with 4 | a very large grain of salt. The input sample exactly the same 5 | length as the SHA-384 and SHA-512 block lengths. 6 | 7 | (Total length of test vector data: 128) 8 | 9 | FILE: 10 | vector008.dat 11 | 12 | SHA256: 13 | 0ab803344830f92089494fb635ad00d76164ad6e57012b237722df0d7ad26896 14 | 15 | SHA384: 16 | e3e3602f4d90c935321d788f722071a8809f4f09366f2825cd85da97ccd2955e 17 | b6b8245974402aa64789ed45293e94ba 18 | 19 | SHA512: 20 | 97fb4ec472f3cb698b9c3c12a12768483e5b62bcdad934280750b4fa4701e5e0 21 | 550a80bb0828342c19631ba55a55e1cee5de2fda91fc5d40e7bee1d4e6d415b3 22 | 23 | -------------------------------------------------------------------------------- /tests/sha2_test/vector009.dat: -------------------------------------------------------------------------------- 1 | By hashing data that is one byte less than a multiple of a hash block length (like this 127-byte string), bugs may be revealed. -------------------------------------------------------------------------------- /tests/sha2_test/vector009.info: -------------------------------------------------------------------------------- 1 | DESCRIPTION: 2 | The output samples for thi test vector come exclusively from my 3 | own implementation and so may be completely incorrect. Use with 4 | a very large grain of salt. The input sample is one byte shorter 5 | in length than the SHA-384 and SHA-512 block lengths. 6 | 7 | (Total length of test vector data: 127) 8 | 9 | FILE: 10 | vector009.dat 11 | 12 | SHA256: 13 | e4326d0459653d7d3514674d713e74dc3df11ed4d30b4013fd327fdb9e394c26 14 | 15 | SHA384: 16 | 1ca650f38480fa9dfb5729636bec4a935ebc1cd4c0055ee50cad2aa627e06687 17 | 1044fd8e6fdb80edf10b85df15ba7aab 18 | 19 | SHA512: 20 | d399507bbf5f2d0da51db1ff1fc51c1c9ff1de0937e00d01693b240e84fcc340 21 | 0601429f45c297acc6e8fcf1e4e4abe9ff21a54a0d3d88888f298971bd206cd5 22 | 23 | -------------------------------------------------------------------------------- /tests/sha2_test/vector010.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/sha2_test/vector010.dat -------------------------------------------------------------------------------- /tests/sha2_test/vector010.info: -------------------------------------------------------------------------------- 1 | DESCRIPTION: 2 | The output samples for thi test vector come exclusively from my 3 | own implementation and so may be completely incorrect. Use with 4 | a very large grain of salt. The input sample is exactly 5 times 5 | size of the SHA-256 block length. 6 | 7 | (Total length of test vector data: 320) 8 | 9 | FILE: 10 | vector010.dat 11 | 12 | SHA256: 13 | a7f001d996dd25af402d03b5f61aef950565949c1a6ad5004efa730328d2dbf3 14 | 15 | SHA384: 16 | b8261ddcd7df7b3969a516b72550de6fbf0e394a4a7bb2bbc60ec603c2ceff64 17 | 3c5bf62bc6dcbfa5beb54b62d750b969 18 | 19 | SHA512: 20 | caf970d3638e21053173a638c4b94d6d1ff87bc47b58f8ee928fbe9e245c23ab 21 | f81019e45bf017ecc8610e5e0b95e3b025ccd611a772ca4fb3dfba26f0859725 22 | 23 | -------------------------------------------------------------------------------- /tests/sha2_test/vector011.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/sha2_test/vector011.dat -------------------------------------------------------------------------------- /tests/sha2_test/vector011.info: -------------------------------------------------------------------------------- 1 | DESCRIPTION: 2 | The output samples for thi test vector come exclusively from my 3 | own implementation and so may be completely incorrect. Use with 4 | a very large grain of salt. The input sample is one byte less 5 | than 7 times the size of the SHA-256 block length. 6 | 7 | (Total length of test vector data: 447) 8 | 9 | FILE: 10 | vector011.dat 11 | 12 | SHA256: 13 | 6dcd63a07b0922cc3a9b3315b158478681cc32543b0a4180abe58a73c5e14cc2 14 | 15 | SHA384: 16 | 548e4e9a1ff57f469ed47b023bf5279dfb4d4ca08c65051e3a5c41fab84479a2 17 | 05496276906008b4b3c5b0970b2f5446 18 | 19 | SHA512: 20 | ee5d07460183b130687c977e9f8d43110989b0864b18fe6ee00a53dec5eda111 21 | f3aaa3bac7ab8dae26ed545a4de33ed45190f18fa0c327c44642ab9424265330 22 | 23 | -------------------------------------------------------------------------------- /tests/sha2_test/vector012.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/sha2_test/vector012.dat -------------------------------------------------------------------------------- /tests/sha2_test/vector012.info: -------------------------------------------------------------------------------- 1 | DESCRIPTION: 2 | The output samples for thi test vector come exclusively from my 3 | own implementation and so may be completely incorrect. Use with 4 | a very large grain of salt. The input sample is exactly 5 times 5 | size of the SHA-384 and SHA-512 block lengths. 6 | 7 | (Total length of test vector data: 640) 8 | 9 | FILE: 10 | vector012.dat 11 | 12 | SHA256: 13 | af6ebfde7d93d5badb6cde6287ecc2061c1cafc5b1c1217cd984fbcdb9c61aaa 14 | 15 | SHA384: 16 | c6fec3a3278dd6b5afc8c0971d32d38faf5802f1a21527c32563b32a1ac34065 17 | 6b433b44fe2648aa2232206f4301193a 18 | 19 | SHA512: 20 | 73ffeb67716c3495fbc33f2d62fe08e2616706a5599881c7e67e9ef2b68f4988 21 | ea8b3b604ba87e50b07962692705c420fa31a00be41d6aaa9f3b11eafe9cf49b 22 | 23 | -------------------------------------------------------------------------------- /tests/sha2_test/vector013.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/sha2_test/vector013.dat -------------------------------------------------------------------------------- /tests/sha2_test/vector013.info: -------------------------------------------------------------------------------- 1 | DESCRIPTION: 2 | The output samples for thi test vector come exclusively from my 3 | own implementation and so may be completely incorrect. Use with 4 | a very large grain of salt. The input sample is one byte short 5 | of 17 times size of the SHA-384 and SHA-512 block lengths. 6 | 7 | (Total length of test vector data: 2175) 8 | 9 | FILE: 10 | vector013.dat 11 | 12 | SHA256: 13 | 8ff59c6d33c5a991088bc44dd38f037eb5ad5630c91071a221ad6943e872ac29 14 | 15 | SHA384: 16 | 92dca5655229b3c34796a227ff1809e273499adc2830149481224e0f54ff4483 17 | bd49834d4865e508ef53d4cd22b703ce 18 | 19 | SHA512: 20 | 0e928db6207282bfb498ee871202f2337f4074f3a1f5055a24f08e912ac118f8 21 | 101832cdb9c2f702976e629183db9bacfdd7b086c800687c3599f15de7f7b9dd 22 | 23 | -------------------------------------------------------------------------------- /tests/sha2_test/vector014.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/sha2_test/vector014.dat -------------------------------------------------------------------------------- /tests/sha2_test/vector014.info: -------------------------------------------------------------------------------- 1 | DESCRIPTION: 2 | The output samples for thi test vector come exclusively from my 3 | own implementation and so may be completely incorrect. Use with 4 | a very large grain of salt. The input sample 4 KB of misc. 5 | data. 6 | 7 | (Total length of test vector data: 16384) 8 | 9 | FILE: 10 | vector014.dat 11 | 12 | SHA256: 13 | 1818e87564e0c50974ecaabbb2eb4ca2f6cc820234b51861e2590be625f1f703 14 | 15 | SHA384: 16 | 310fbb2027bdb7042f0e09e7b092e9ada506649510a7aa029825c8e8019e9c30 17 | 749d723f2de1bd8c043d8d89d3748c2f 18 | 19 | SHA512: 20 | a001636f3ff1ce34f432f8e8f7785b78be84318beb8485a406650a8b243c419f 21 | 7db6435cf6bf3000c6524adb5b52bad01afb76b3ceff701331e18b85b0e4cbd3 22 | 23 | -------------------------------------------------------------------------------- /tests/sha2_test/vector015.info: -------------------------------------------------------------------------------- 1 | DESCRIPTION: 2 | This is yet another of my own test vectors for a larger 3 | input data set. The input data is the string "qwerty 4 | repeated 65536 times. 5 | 6 | (Total length of test vector data: 393216) 7 | 8 | FILE: 9 | vector015.dat 10 | 11 | SHA256: 12 | 5e3dfe0cc98fd1c2de2a9d2fd893446da43d290f2512200c515416313cdf3192 13 | 14 | SHA384: 15 | 0d5e45317bc7997cb9c8a23bad9bac9170d5bc81789b51af6bcd74ace379fd64 16 | 9a2b48cb56c4cb4ec1477e6933329e0e 17 | 18 | SHA512: 19 | 735bd6bebfe6f8070d70069105bc761f35ed1ac3742f2e372fdc14d2a51898e6 20 | 153ccaff9073324130abdc451c730dc5dab5a0452487b1171c4dd97f92e267b7 21 | 22 | -------------------------------------------------------------------------------- /tests/sha2_test/vector016.info: -------------------------------------------------------------------------------- 1 | DESCRIPTION: 2 | This test vector came from Brian LaMacchia in his e-mail 3 | message containing several samples of output from his SHA-256 4 | and SHA-512 implementations. My own implementations match 5 | his output exactly. The input data data set is the string 6 | "Rijndael is AES" repeated 1024 times. 7 | 8 | (Total length of test vector data: 15360) 9 | 10 | FILE: 11 | vector016.dat 12 | 13 | SHA256: 14 | 80fced5a97176a5009207cd119551b42c5b51ceb445230d02ecc2663bbfb483a 15 | 16 | SHA384: 17 | aa1e77c094e5ce6db81a1add4c095201d020b7f8885a4333218da3b799b9fc42 18 | f00d60cd438a1724ae03bd7b515b739b 19 | 20 | SHA512: 21 | fae25ec70bcb3bbdef9698b9d579da49db68318dbdf18c021d1f76aaceff9628 22 | 38873235597e7cce0c68aabc610e0deb79b13a01c302abc108e459ddfbe9bee8 23 | 24 | -------------------------------------------------------------------------------- /tests/sha2_test/vector017.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/sha2_test/vector017.dat -------------------------------------------------------------------------------- /tests/sha2_test/vector017.info: -------------------------------------------------------------------------------- 1 | DESCRIPTION: 2 | Rogier van de Pol notified me that my implementation differed 3 | with several others on several test data sets he had tested 4 | against. This test vector data set is one Rogier provided 5 | to me that highlighted an off-by-one bug in my implementation 6 | that affected SHA-256/384/512 hashes where the data set length 7 | was of a certain length. In the case of SHA512 or SHA384, if 8 | the data length after subtracting 111 was an even multiple of 9 | 128 bytes, the bug surfaced. In the case of SHA256, after 10 | subtracting 55, the remaining length was an even multiple of 64, 11 | the bug surfaced. The fix was simple. In SHA512_Last() and in 12 | SHA256_Final() functions, I simply replaced a single "<" test 13 | with a "<=" test. 14 | 15 | Thanks, Rogier! 16 | 17 | (Total length of test vector data: 12271) 18 | 19 | FILE: 20 | vector017.dat 21 | 22 | SHA256: 23 | 88ee6ada861083094f4c64b373657e178d88ef0a4674fce6e4e1d84e3b176afb 24 | 25 | SHA384: 26 | 78cc6402a29eb984b8f8f888ab0102cabe7c06f0b9570e3d8d744c969db14397 27 | f58ecd14e70f324bf12d8dd4cd1ad3b2 28 | 29 | SHA512: 30 | 211bec83fbca249c53668802b857a9889428dc5120f34b3eac1603f13d1b4796 31 | 5c387b39ef6af15b3a44c5e7b6bbb6c1096a677dc98fc8f472737540a332f378 32 | 33 | -------------------------------------------------------------------------------- /tests/sha2_test/vector018.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/sha2_test/vector018.dat -------------------------------------------------------------------------------- /tests/sha2_test/vector018.info: -------------------------------------------------------------------------------- 1 | DESCRIPTION: 2 | I added this vector after fixing a bug first discovered by 3 | Rogier van de Pol. The length of this data set is designed to 4 | test for that bug or similar bugs in SHA-256 hashes. The bug 5 | was an off-by-one bug where I used a "<" test instead of a "<=" 6 | test in SHA256_Final(). Whenever data set lengths were an even 7 | multiple of 64 after subtracting 55, the bug showed up. The 8 | fix was easy, once the problem was fully diagnosed. 9 | 10 | Thanks, Rogier! 11 | 12 | (Total length of test vector data: 1079) 13 | 14 | FILE: 15 | vector018.dat 16 | 17 | SHA256: 18 | 5a2e925a7f8399fa63a20a1524ae83a7e3c48452f9af4df493c8c51311b04520 19 | 20 | SHA384: 21 | 72ec26cc742bc5fb1ef82541c9cadcf01a15c8104650d305f24ec8b006d7428e 22 | 8ebe2bb320a465dbdd5c6326bbd8c9ad 23 | 24 | SHA512: 25 | ebad464e6d9f1df7e8aadff69f52db40a001b253fbf65a018f29974dcc7fbf8e 26 | 58b69e247975fbadb4153d7289357c9b6212752d0ab67dd3d9bbc0bb908aa98c 27 | -------------------------------------------------------------------------------- /tests/smtp_test.lua: -------------------------------------------------------------------------------- 1 | require'glue' 2 | require'smtp' 3 | require'resolver' 4 | require'sock' 5 | require'logging' 6 | require'multipart' 7 | logging.filter.tls = true 8 | config('ca_file', exedir()..'/../../tests/cacert.pem') 9 | 10 | logging.debug = true 11 | 12 | config('smtp_host' , 'mail.bpnpart.com') 13 | --config('smtp_tls' , false) 14 | config('smtp_user' , 'admin@bpnpart.com') 15 | config('smtp_pass' , 'Bpnpart@0@0') 16 | config('smtp_debug', 'protocol stream') 17 | 18 | run(function() 19 | 20 | if false then 21 | 22 | sendmail{ 23 | from = 'admin@bpnpart.com', 24 | to = 'cosmin.apreutesei@gmail.com', 25 | message = 'Hello Dude!', 26 | headers = { 27 | from = 'admin@bpnpart.com', 28 | to = 'cosmin.apreutesei@gmail.com', 29 | subject = 'How are you today?', 30 | }, 31 | } 32 | 33 | else 34 | 35 | sendmail{ 36 | from = 'admin@bpnpart.com', 37 | to = 'cosmin.apreutesei@gmail.com', 38 | subject = 'How are you today?', 39 | text = 'Hello Dude!', 40 | html = '

Hello

Hello Dude

', 41 | inlines = { 42 | { 43 | cid = 'img1', 44 | filename = 'progressive.jpg', 45 | content_type = 'image/jpeg', 46 | contents = load'jpeg_test/progressive.jpg', 47 | }, 48 | { 49 | cid = 'img2', 50 | filename = 'birds.jpg', 51 | content_type = 'image/jpeg', 52 | contents = load'resize_image_test/birds.jpg', 53 | }, 54 | }, 55 | attachments = { 56 | { 57 | name = 'Att1', 58 | filename = 'att1.txt', 59 | content_type = 'text/plain', 60 | contents = 'att1!', 61 | }, 62 | { 63 | name = 'Att2', 64 | filename = 'att2.html', 65 | content_type = 'text/html', 66 | contents = '

Wasup

', 67 | }, 68 | }, 69 | } 70 | 71 | end 72 | 73 | end) 74 | -------------------------------------------------------------------------------- /tests/test-all: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "${0%test-all}" || exit 1 3 | 4 | [ "$OSTYPE" = "msys" ] && P=windows || P=linux 5 | 6 | for f in *_test.lua; do 7 | echo "$f" 8 | AUTO=1 ../bin/$P/luajit -e"require'glue'.luapath'.'" "$f" 9 | done 10 | -------------------------------------------------------------------------------- /tests/test-ca.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpAIBAAKCAQEA4Hwyfc2gsjxi2K7HcgDsQxwoh6nV27AD8HQxejxPfDnJ8IhC 3 | ARWR2DrJyQzt0sAiMn+OuV3gAAbddIFbjY2y8Ia8UyYyiSz0rvHGTEBOVfNhyBSh 4 | n+/wVlNGnfdAqiJwB6OF3CcLkl4W1tx19W95ywk8pCcpRx2eb6cLZBolUhsUaYUl 5 | B8TYUTnpkZQ28FuSM3UoAlSWywBT+cE/IiFrzZYOx5TQJ3EYZYg7/KFyN09NeiR7 6 | hXno2D596mvuD49NvjJRcqE031QKLd1HzcAEjN69qUR859JmZV7hFcoYd8xW6Uiu 7 | gXh6ZdMwHIMOIcncMksTTQUyWoyy66j9cDF/QwIDAQABAoIBAQCEgUrcby/XhUVj 8 | WWdop5rN0iUqTtlpH3Bz0mISIN9aGFJWpFcxhKXd2HWbMwJ+T+Lfo+N/DyZVXbgC 9 | OQjteSKSTzWCbx2NUvfq+9Ns1thma47gJy1v1pUqn2UjgPqucj1mhONSm8l80ATz 10 | NpZ6FR7y9bTRwDvhOl520UcsAzLcTvyoV9vaazqOUU7+ZXtWfw2bDODuo22M6vc5 11 | VTPk/x1/BbEtH5Rif9ltm3SMZTBQ6xZWalILTrFHS58PM8ydvtc7rV9VcMDujWA3 12 | JNwlhGHN8zZki5iPQtQZws4DBfkKrIl7EMXO2vPLBSAuMkjDmKxr4G6LRqLxCaDA 13 | XWPBmgvhAoGBAPM9jY1Oe0SXMh2gLnUEHLjhrKHyyqLm2KgekgcCsgXC2DwZnMS/ 14 | Ro1Lxdemmtqtlf48qpWDCU1Fsw9unj0xqntJJRRwmgxWvvAeu6HO3DZiCU1Qdw4B 15 | 4BD78TGz0pAOYRwtRBinnzj0crU+2RxVH2+x2niLWSqdZZQXTiGLNtFfAoGBAOxC 16 | yBpDXZvsJAhMbYCDbnFhfZWuhUrmFXwgj9RyASF+ou1evI3ylLf1ipO4TPks12lv 17 | tqwvs0HtyKttaS6eqJFgB6IOH+SWW8Ykl5t/WX/Z2kEZEul3TWXR48y6D+mAs+rf 18 | 2DbgOR2dXYwGBAFg3eIU75iI7+MNaKaIV8LVS+idAoGBAJDaMxXXiukJ8TpbTc85 19 | p7EiE6BN6gag2p0jt2qdXE65/fOsfQNdtTIn0aXe/ZEElrJUhnGLG1r9CulBwtJG 20 | ZXQN1xsZA2QdtI9iffKaMeHg+BEmvf+Fdl4m6zfiEp7fMU2KV2cnS1arnDP7PWf1 21 | +UaW77ehpHQQT5GlX03yja6ZAoGAIgrBUF9yhnvw+S0h/glyCW41rTKXTCJ46Ai9 22 | EKxYk13u1er3mjBg01zS2dQNaz3V0ABjvs2ks5QyfNjn9eqweTnv/56vY71yfctZ 23 | +PLRj4VxWD3nprIk+c3TV/VbQ5bi1a3pNob6U9UP3JQlUZmGfwPrPfxFLF8LPCub 24 | EZywMlUCgYARJwbbqmSfbga03HoWY1EwJCJ9cJQLU9mSAmmlsJ0hJ4PycZsDYFe3 25 | 500x8r50xPf5Di2XICOvdXnijod/J991ksPQ7va4Dpnjmb7lnUCvCRjFf+0KtNsV 26 | kQK2ZGTjrrSUyIyRyrrc3S6Wvh8+4Z82iTt3EKp3uKmRtEtaXVe5KQ== 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /tests/test-ca.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDazCCAlOgAwIBAgIUfkx5teS8/Hv2MF/8fx9jPwEvMAEwDQYJKoZIhvcNAQEL 3 | BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM 4 | GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMDExMjcxMTIwMzZaFw00ODA0 5 | MTMxMTIwMzZaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw 6 | HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB 7 | AQUAA4IBDwAwggEKAoIBAQDgfDJ9zaCyPGLYrsdyAOxDHCiHqdXbsAPwdDF6PE98 8 | OcnwiEIBFZHYOsnJDO3SwCIyf465XeAABt10gVuNjbLwhrxTJjKJLPSu8cZMQE5V 9 | 82HIFKGf7/BWU0ad90CqInAHo4XcJwuSXhbW3HX1b3nLCTykJylHHZ5vpwtkGiVS 10 | GxRphSUHxNhROemRlDbwW5IzdSgCVJbLAFP5wT8iIWvNlg7HlNAncRhliDv8oXI3 11 | T016JHuFeejYPn3qa+4Pj02+MlFyoTTfVAot3UfNwASM3r2pRHzn0mZlXuEVyhh3 12 | zFbpSK6BeHpl0zAcgw4hydwySxNNBTJajLLrqP1wMX9DAgMBAAGjUzBRMB0GA1Ud 13 | DgQWBBS2QKKu/1EBTA0wSfuEECQokVpSxDAfBgNVHSMEGDAWgBS2QKKu/1EBTA0w 14 | SfuEECQokVpSxDAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCP 15 | ZoZ4bsVp7Fo46SopKJAb1tn8okeitaXahBcNZ7j4bDHKAIo6dUl07H3wbGd3Qtz8 16 | FJVrRfIBLPwoz9fv6qYRhcGAjfOrc2j3nx7hW7jDmt0RtRd7lIqpNxDdRrJT+rMX 17 | Nwzgy+vFfqYceOPZugf0L6vlQhCdiNqwfbtdC6IJimYNjEmY5ESDyUCs1cX+dXDw 18 | 9fuNJ5ZIpnXyx91iw195UsdPbHpBQLmCh/LS4Tx5Ho4DiWCvktgHK/RL1xXrViUv 19 | MNXDu8UIgBfwD7HzcCQMaBKW19QGQDujQqYoNS14WD/H90jfJboDSGej/T+v1eyY 20 | wQwORWhFktO4OU4bNZBk 21 | -----END CERTIFICATE----- 22 | -------------------------------------------------------------------------------- /tests/unit.lua: -------------------------------------------------------------------------------- 1 | 2 | require'glue' 3 | require'fs' 4 | 5 | assert(chdir(exedir()..'/../../tests')) 6 | 7 | local tostr = pp 8 | local function _test(t1, t2, prefix, level) 9 | if type(t1)=='table' and type(t2)=='table' then 10 | --for k,v in pairs(t1) do print('>t1',k,v) end 11 | --for k,v in pairs(t2) do print('>t2',k,v) end 12 | for k,v in pairs(t1) do 13 | _test(t2[k], v, prefix .. '.' .. tostr(k), level + 1) 14 | end 15 | for k,v in pairs(t2) do 16 | _test(t1[k], v, prefix .. '.' .. tostr(k), level + 1) 17 | end 18 | else 19 | if (t1 == t1 and t1 ~= t2) or (t1 ~= t1 and t2 == t2) then 20 | error(tostr(t1) .. " ~= " .. tostr(t2) .. 21 | " [" .. prefix .. "]", level) 22 | end 23 | end 24 | end 25 | 26 | function test(t1, t2) 27 | return _test(t1, t2, 't', 3) 28 | end 29 | 30 | function testmatch(s, pat) 31 | if not s:match(pat) then 32 | error("'" .. s .. "'" .. " not matching '" .. pat .. "'", 2) 33 | end 34 | end 35 | 36 | function ptest(t1,t2) 37 | print(t1) 38 | test(t1,t2,nil,3) 39 | end 40 | 41 | do 42 | local time 43 | local last_time 44 | function timediff() 45 | local time = clock() 46 | local d = last_time and (time - last_time) or 0 47 | last_time = time 48 | return d 49 | end 50 | end 51 | 52 | -------------------------------------------------------------------------------- /tests/xlsxwriter_demos/array_formula.lua: -------------------------------------------------------------------------------- 1 | ---- 2 | -- 3 | -- Example of how to use the xlsxwriter.lua module to write 4 | -- simple array formulas. 5 | -- 6 | -- Copyright 2014-2015, John McNamara, jmcnamara@cpan.org 7 | -- 8 | 9 | local Workbook = require "xlsxwriter.workbook" 10 | 11 | -- Create a new workbook and add a worksheet 12 | local workbook = Workbook:new("array_formula.xlsx") 13 | local worksheet = workbook:add_worksheet() 14 | 15 | -- Write some test data. 16 | worksheet:write("B1", 500) 17 | worksheet:write("B2", 10) 18 | worksheet:write("B5", 1) 19 | worksheet:write("B6", 2) 20 | worksheet:write("B7", 3) 21 | worksheet:write("C1", 300) 22 | worksheet:write("C2", 15) 23 | worksheet:write("C5", 20234) 24 | worksheet:write("C6", 21003) 25 | worksheet:write("C7", 10000) 26 | 27 | -- Write an array formula that returns a single value 28 | worksheet:write_formula("A1", "{=SUM(B1:C1*B2:C2)}") 29 | 30 | -- Same as above but more explicit. 31 | worksheet:write_array_formula("A2:A2", "{=SUM(B1:C1*B2:C2)}") 32 | 33 | -- Write an array formula that returns a range of values 34 | worksheet:write_array_formula("A5:A7", "{=TREND(C5:C7,B5:B7)}") 35 | 36 | workbook:close() 37 | -------------------------------------------------------------------------------- /tests/xlsxwriter_demos/date_strings.lua: -------------------------------------------------------------------------------- 1 | ---- 2 | -- 3 | -- A simple program to write some dates and times to an Excel file 4 | -- using the xlsxwriter.lua module. 5 | -- 6 | -- Copyright 2014-2015, John McNamara, jmcnamara@cpan.org 7 | -- 8 | 9 | local Workbook = require "xlsxwriter.workbook" 10 | 11 | local workbook = Workbook:new("date_strings.xlsx") 12 | local worksheet = workbook:add_worksheet() 13 | local bold = workbook:add_format({bold = true}) 14 | 15 | -- Expand the first columns so that the date is visible. 16 | worksheet:set_column("A:B", 30) 17 | 18 | -- Write the column headers. 19 | worksheet:write("A1", "Formatted date", bold) 20 | worksheet:write("B1", "Format", bold) 21 | 22 | -- Create an ISO8601 style date string to use in the examples. 23 | local date_string = "2013-01-23T12:30:05.123" 24 | 25 | -- Examples date and time formats. In the output file compare how changing 26 | -- the format codes change the appearance of the date. 27 | local date_formats = { 28 | "dd/mm/yy", 29 | "mm/dd/yy", 30 | "dd m yy", 31 | "d mm yy", 32 | "d mmm yy", 33 | "d mmmm yy", 34 | "d mmmm yyy", 35 | "d mmmm yyyy", 36 | "dd/mm/yy hh:mm", 37 | "dd/mm/yy hh:mm:ss", 38 | "dd/mm/yy hh:mm:ss.000", 39 | "hh:mm", 40 | "hh:mm:ss", 41 | "hh:mm:ss.000", 42 | } 43 | 44 | -- Write the same date and time using each of the above formats. 45 | for row, date_format_str in ipairs(date_formats) do 46 | 47 | -- Create a format for the date or time. 48 | local date_format = workbook:add_format({num_format = date_format_str, 49 | align = "left"}) 50 | 51 | -- Write the same date using different formats. 52 | worksheet:write_date_string(row, 0, date_string, date_format) 53 | 54 | -- Also write the format string for comparison. 55 | worksheet:write_string(row, 1, date_format_str) 56 | 57 | end 58 | 59 | workbook:close() 60 | -------------------------------------------------------------------------------- /tests/xlsxwriter_demos/date_times.lua: -------------------------------------------------------------------------------- 1 | ---- 2 | -- 3 | -- A simple program to write some dates and times to an Excel file 4 | -- using the xlsxwriter.lua module. 5 | -- 6 | -- Copyright 2014-2015, John McNamara, jmcnamara@cpan.org 7 | -- 8 | 9 | local Workbook = require "xlsxwriter.workbook" 10 | 11 | local workbook = Workbook:new("date_times.xlsx") 12 | local worksheet = workbook:add_worksheet() 13 | local bold = workbook:add_format({bold = true}) 14 | 15 | -- Expand the first columns so that the date is visible. 16 | worksheet:set_column("A:B", 30) 17 | 18 | -- Write the column headers. 19 | worksheet:write("A1", "Formatted date", bold) 20 | worksheet:write("B1", "Format", bold) 21 | 22 | -- Create a os.time() style date table to use in the examples. 23 | local date_time = {year = 2013, month =1, day = 23, 24 | hour = 12, min = 30, sec = 5.123} 25 | 26 | -- Examples date and time formats. In the output file compare how changing 27 | -- the format codes change the appearance of the date. 28 | local date_formats = { 29 | "dd/mm/yy", 30 | "mm/dd/yy", 31 | "dd m yy", 32 | "d mm yy", 33 | "d mmm yy", 34 | "d mmmm yy", 35 | "d mmmm yyy", 36 | "d mmmm yyyy", 37 | "dd/mm/yy hh:mm", 38 | "dd/mm/yy hh:mm:ss", 39 | "dd/mm/yy hh:mm:ss.000", 40 | "hh:mm", 41 | "hh:mm:ss", 42 | "hh:mm:ss.000", 43 | } 44 | 45 | -- Write the same date and time using each of the above formats. 46 | for row, date_format_str in ipairs(date_formats) do 47 | 48 | -- Create a format for the date or time. 49 | local date_format = workbook:add_format({num_format = date_format_str, 50 | align = "left"}) 51 | 52 | -- Write the same date using different formats. 53 | worksheet:write_date_time(row, 0, date_time, date_format) 54 | 55 | -- Also write the format string for comparison. 56 | worksheet:write_string(row, 1, date_format_str) 57 | 58 | end 59 | 60 | workbook:close() 61 | -------------------------------------------------------------------------------- /tests/xlsxwriter_demos/defined_name.lua: -------------------------------------------------------------------------------- 1 | ---- 2 | -- 3 | -- Example of how to create defined names with the xlsxwriter.lua module. 4 | -- 5 | -- This method is used to define a user friendly name to represent a value, 6 | -- a single cell or a range of cells in a workbook. 7 | -- 8 | -- Copyright 2014-2015, John McNamara, jmcnamara@cpan.org 9 | -- 10 | 11 | local Workbook = require "xlsxwriter.workbook" 12 | 13 | local workbook = Workbook:new("defined_name.xlsx") 14 | local worksheet1 = workbook:add_worksheet() 15 | local worksheet2 = workbook:add_worksheet() 16 | 17 | -- Define some global/workbook names. 18 | workbook:define_name("Exchange_rate", "=0.96") 19 | workbook:define_name("Sales", "=Sheet1!$G$1:$H$10") 20 | 21 | -- Define a local/worksheet name. Over-rides the "Sales" name above. 22 | workbook:define_name("Sheet2!Sales", "=Sheet2!$G$1:$G$10") 23 | 24 | -- Write some text in the file and one of the defined names in a formula. 25 | for _, worksheet in ipairs(workbook:worksheets()) do 26 | worksheet:set_column("A:A", 45) 27 | 28 | worksheet:write("A1", "This worksheet contains some defined names.") 29 | worksheet:write("A2", "See Formulas -> Name Manager above.") 30 | worksheet:write("A3", "Example formula in cell B3 ->") 31 | 32 | worksheet:write("B3", "=Exchange_rate") 33 | end 34 | 35 | workbook:close() 36 | -------------------------------------------------------------------------------- /tests/xlsxwriter_demos/demo.lua: -------------------------------------------------------------------------------- 1 | ---- 2 | -- 3 | -- A simple example of some of the features of the xlsxwriter.lua module. 4 | -- 5 | -- Copyright 2014-2015, John McNamara, jmcnamara@cpan.org 6 | -- 7 | 8 | local Workbook = require "xlsxwriter.workbook" 9 | 10 | local workbook = Workbook:new("demo.xlsx") 11 | local worksheet = workbook:add_worksheet() 12 | 13 | -- Widen the first column to make the text clearer. 14 | worksheet:set_column("A:A", 20) 15 | 16 | -- Add a bold format to use to highlight cells. 17 | local bold = workbook:add_format({bold = true}) 18 | 19 | -- Write some simple text. 20 | worksheet:write("A1", "Hello") 21 | 22 | -- Text with formatting. 23 | worksheet:write("A2", "World", bold) 24 | 25 | -- Write some numbers, with row/column notation. 26 | worksheet:write(2, 0, 123) 27 | worksheet:write(3, 0, 123.456) 28 | 29 | workbook:close() 30 | -------------------------------------------------------------------------------- /tests/xlsxwriter_demos/doc_properties.lua: -------------------------------------------------------------------------------- 1 | ---- 2 | -- 3 | -- An example of adding document properites to a xlsxwriter.lua file. 4 | -- 5 | -- Copyright 2014-2015, John McNamara, jmcnamara@cpan.org 6 | -- 7 | 8 | local Workbook = require "xlsxwriter.workbook" 9 | 10 | local workbook = Workbook:new("doc_properties.xlsx") 11 | local worksheet = workbook:add_worksheet() 12 | 13 | workbook:set_properties({ 14 | title = "This is an example spreadsheet", 15 | subject = "With document properties", 16 | author = "Someone", 17 | manager = "Dr. Heinz Doofenshmirtz", 18 | company = "of Wolves", 19 | category = "Example spreadsheets", 20 | keywords = "Sample, Example, Properties", 21 | comments = "Created with Lua and the xlsxwriter module", 22 | status = "Quo", 23 | }) 24 | 25 | worksheet:set_column("A:A", 70) 26 | worksheet:write("A1", "Select 'Workbook Properties' to see properties.") 27 | 28 | workbook:close() 29 | -------------------------------------------------------------------------------- /tests/xlsxwriter_demos/hello_world.lua: -------------------------------------------------------------------------------- 1 | ---- 2 | -- 3 | -- A hello world spreadsheet using the xlsxwriter.lua module. 4 | -- 5 | -- Copyright 2014-2015, John McNamara, jmcnamara@cpan.org 6 | -- 7 | 8 | local Workbook = require "xlsxwriter.workbook" 9 | 10 | local workbook = Workbook:new("hello_world.xlsx") 11 | local worksheet = workbook:add_worksheet() 12 | 13 | worksheet:write("A1", "Hello world") 14 | 15 | workbook:close() 16 | -------------------------------------------------------------------------------- /tests/xlsxwriter_demos/hide_sheet.lua: -------------------------------------------------------------------------------- 1 | ---- 2 | -- 3 | -- Example of how to hide a worksheet with xlsxwriter.lua. 4 | -- 5 | -- Copyright 2014-2015, John McNamara, jmcnamara@cpan.org 6 | -- 7 | 8 | local Workbook = require "xlsxwriter.workbook" 9 | 10 | local workbook = Workbook:new("hide_sheet.xlsx") 11 | 12 | local worksheet1 = workbook:add_worksheet() 13 | local worksheet2 = workbook:add_worksheet() 14 | local worksheet3 = workbook:add_worksheet() 15 | 16 | worksheet1:set_column("A:A", 30) 17 | worksheet2:set_column("A:A", 30) 18 | worksheet3:set_column("A:A", 30) 19 | 20 | -- Hide Sheet2. It won't be visible until it is unhidden in Excel. 21 | worksheet2:hide() 22 | 23 | worksheet1:write("A1", "Sheet2 is hidden") 24 | worksheet2:write("A1", "Now it's my turn to find you!") 25 | worksheet3:write("A1", "Sheet2 is hidden") 26 | 27 | workbook:close() 28 | -------------------------------------------------------------------------------- /tests/xlsxwriter_demos/hyperlink.lua: -------------------------------------------------------------------------------- 1 | ---- 2 | -- 3 | -- Example of how to use the xlsxwriter.lua module to write hyperlinks. 4 | -- 5 | -- Copyright 2014-2015, John McNamara, jmcnamara@cpan.org 6 | -- 7 | 8 | local Workbook = require "xlsxwriter.workbook" 9 | 10 | local workbook = Workbook:new("hyperlink.xlsx") 11 | local worksheet = workbook:add_worksheet("Hyperlinks") 12 | 13 | -- Format the first column 14 | worksheet:set_column('A:A', 30) 15 | 16 | -- Add the standard url link format. 17 | local url_format = workbook:add_format({ 18 | font_color = 'blue', 19 | underline = 1 20 | }) 21 | 22 | -- Add a sample alternative link format. 23 | local red_format = workbook:add_format({ 24 | font_color = 'red', 25 | bold = 1, 26 | underline = 1, 27 | font_size = 12, 28 | }) 29 | 30 | -- Add an alternate description string to the URL. 31 | local alt_string = 'Lua home' 32 | 33 | -- Add a "tool tip" to the URL. 34 | local tip_string = 'Get the latest Lua news here.' 35 | 36 | -- Write some hyperlinks 37 | worksheet:write_url('A1', 'http://www.lua.org/', url_format) 38 | worksheet:write_url('A3', 'http://www.lua.org/', url_format, alt_string) 39 | worksheet:write_url('A5', 'http://www.lua.org/', url_format, alt_string, tip_string) 40 | worksheet:write_url('A7', 'http://www.lua.org/', red_format) 41 | worksheet:write_url('A9', 'mailto:jmcnamaracpan.org', url_format, 'Mail me') 42 | 43 | -- Write a URL that isn't a hyperlink 44 | worksheet:write_string('A11', 'http://www.lua.org/') 45 | 46 | workbook:close() 47 | -------------------------------------------------------------------------------- /tests/xlsxwriter_demos/merge1.lua: -------------------------------------------------------------------------------- 1 | ---- 2 | -- 3 | -- A simple example of merging cells with the xlsxwriter Lua module. 4 | -- 5 | -- Copyright 2014-2015, John McNamara, jmcnamara@cpan.org 6 | -- 7 | 8 | local Workbook = require "xlsxwriter.workbook" 9 | 10 | local workbook = Workbook:new("merge1.xlsx") 11 | local worksheet = workbook:add_worksheet() 12 | 13 | -- Increase the cell size of the merged cells to highlight the formatting. 14 | worksheet:set_column("B:D", 12) 15 | worksheet:set_row(3, 30) 16 | worksheet:set_row(6, 30) 17 | worksheet:set_row(7, 30) 18 | 19 | -- Create a format to use in the merged range. 20 | merge_format = workbook:add_format({ 21 | bold = true, 22 | border = 1, 23 | align = "center", 24 | valign = "vcenter", 25 | fg_color = "yellow"}) 26 | 27 | -- Merge 3 cells. 28 | worksheet:merge_range("B4:D4", "Merged Range", merge_format) 29 | 30 | -- Merge 3 cells over two rows. 31 | worksheet:merge_range("B7:D8", "Merged Range", merge_format) 32 | 33 | workbook:close() 34 | -------------------------------------------------------------------------------- /tests/xlsxwriter_demos/tab_colors.lua: -------------------------------------------------------------------------------- 1 | ---- 2 | -- 3 | -- Example of how to set Excel worksheet tab colours using 4 | -- the Xlsxwriter.lua module. 5 | -- 6 | -- Copyright 2014-2015, John McNamara, jmcnamara@cpan.org 7 | -- 8 | 9 | local Workbook = require "xlsxwriter.workbook" 10 | 11 | local workbook = Workbook:new("tab_colors.xlsx") 12 | 13 | -- Set up some worksheets. 14 | local worksheet1 = workbook:add_worksheet() 15 | local worksheet2 = workbook:add_worksheet() 16 | local worksheet3 = workbook:add_worksheet() 17 | local worksheet4 = workbook:add_worksheet() 18 | 19 | -- Set tab colours, worksheet4 will have the default colour. 20 | worksheet1:set_tab_color("red") 21 | worksheet2:set_tab_color("green") 22 | worksheet3:set_tab_color("#FF9900") 23 | 24 | workbook:close() 25 | -------------------------------------------------------------------------------- /tests/xlsxwriter_demos/text_indent.lua: -------------------------------------------------------------------------------- 1 | ---- 2 | -- 3 | -- An example of indenting text in a cell using the xlsxwriter.lua module. 4 | -- 5 | -- Copyright 2014-2015, John McNamara, jmcnamara@cpan.org 6 | -- 7 | 8 | local Workbook = require "xlsxwriter.workbook" 9 | 10 | local workbook = Workbook:new("text_indent.xlsx") 11 | local worksheet = workbook:add_worksheet() 12 | 13 | local indent1 = workbook:add_format({indent = 1}) 14 | local indent2 = workbook:add_format({indent = 2}) 15 | 16 | worksheet:set_column("A:A", 40) 17 | 18 | worksheet:write("A1", "This text is indented 1 level", indent1) 19 | worksheet:write("A2", "This text is indented 2 levels", indent2) 20 | 21 | workbook:close() 22 | -------------------------------------------------------------------------------- /tests/xlsxwriter_demos/tutorial1.lua: -------------------------------------------------------------------------------- 1 | ---- 2 | -- 3 | -- A simple program to write some data to an Excel file using the 4 | -- xlsxwriter.lua module. 5 | -- 6 | -- This program is shown, with explanations, in Tutorial 1 of the xlsxwriter 7 | -- documentation. 8 | -- 9 | -- Copyright 2014-2015, John McNamara, jmcnamara@cpan.org 10 | -- 11 | 12 | local Workbook = require "xlsxwriter.workbook" 13 | 14 | 15 | -- Create a workbook and add a worksheet. 16 | local workbook = Workbook:new("Expensese01.xlsx") 17 | local worksheet = workbook:add_worksheet() 18 | 19 | -- Some data we want to write to the worksheet. 20 | local expenses = { 21 | {"Rent", 1000}, 22 | {"Gas", 100}, 23 | {"Food", 300}, 24 | {"Gym", 50}, 25 | } 26 | 27 | -- Start from the first cell. Rows and columns are zero indexed. 28 | local row = 0 29 | local col = 0 30 | 31 | -- Iterate over the data and write it out element by element. 32 | for _, expense in ipairs(expenses) do 33 | local item, cost = unpack(expense) 34 | worksheet:write(row, col, item) 35 | worksheet:write(row, col + 1, cost) 36 | row = row + 1 37 | end 38 | 39 | -- Write a total using a formula. 40 | worksheet:write(row, 0, "Total") 41 | worksheet:write(row, 1, "=SUM(B1:B4)") 42 | 43 | workbook:close() 44 | -------------------------------------------------------------------------------- /tests/xlsxwriter_demos/tutorial2.lua: -------------------------------------------------------------------------------- 1 | ---- 2 | -- 3 | -- A simple program to write some data to an Excel file using the 4 | -- xlsxwriter.lua module. 5 | -- 6 | -- This program is shown, with explanations, in Tutorial 2 of the xlsxwriter 7 | -- documentation. 8 | -- 9 | -- Copyright 2014-2015, John McNamara, jmcnamara@cpan.org 10 | -- 11 | 12 | local Workbook = require "xlsxwriter.workbook" 13 | 14 | 15 | -- Create a workbook and add a worksheet. 16 | local workbook = Workbook:new("Expensese02.xlsx") 17 | local worksheet = workbook:add_worksheet() 18 | 19 | -- Add a bold format to use to highlight cells. 20 | local bold = workbook:add_format({bold = true}) 21 | 22 | -- Add a number format for cells with money. 23 | local money = workbook:add_format({num_format = "$#,##0"}) 24 | 25 | -- Write some data header. 26 | worksheet:write("A1", "Item", bold) 27 | worksheet:write("B1", "Cost", bold) 28 | 29 | -- Some data we want to write to the worksheet. 30 | local expenses = { 31 | {"Rent", 1000}, 32 | {"Gas", 100}, 33 | {"Food", 300}, 34 | {"Gym", 50}, 35 | } 36 | 37 | -- Start from the first cell below the headers. 38 | local row = 1 39 | local col = 0 40 | 41 | -- Iterate over the data and write it out element by element. 42 | for _, expense in ipairs(expenses) do 43 | local item, cost = unpack(expense) 44 | worksheet:write(row, col, item) 45 | worksheet:write(row, col + 1, cost, money) 46 | row = row + 1 47 | end 48 | 49 | -- Write a total using a formula. 50 | worksheet:write(row, 0, "Total", bold) 51 | worksheet:write(row, 1, "=SUM(B2:B5)", money) 52 | 53 | workbook:close() 54 | -------------------------------------------------------------------------------- /tests/xlsxwriter_demos/utf8.lua: -------------------------------------------------------------------------------- 1 | ---- 2 | -- 3 | -- A simple Unicode UTF-8 example using the xlsxwriter.lua module. 4 | -- 5 | -- Note: The source file must be UTF-8 encoded. 6 | -- 7 | -- Copyright 2014-2015, John McNamara, jmcnamara@cpan.org 8 | -- 9 | 10 | local Workbook = require "xlsxwriter.workbook" 11 | 12 | local workbook = Workbook:new("utf8.xlsx") 13 | local worksheet = workbook:add_worksheet() 14 | 15 | worksheet:write("B3", "Это фраза на русском!") 16 | 17 | workbook:close() 18 | -------------------------------------------------------------------------------- /tests/xlsxwriter_demos/utf8_polish.lua: -------------------------------------------------------------------------------- 1 | ---- 2 | -- 3 | -- A simple example of converting some Unicode text to an Excel file using 4 | -- the xlsxwriter.lua module. 5 | -- 6 | -- This example generates a spreadsheet with some Polish text from a file 7 | -- with UTF-8 encoded text. 8 | -- 9 | -- Copyright 2014-2015, John McNamara, jmcnamara@cpan.org 10 | -- 11 | 12 | local Workbook = require "xlsxwriter.workbook" 13 | 14 | local workbook = Workbook:new("utf8_polish.xlsx") 15 | local worksheet = workbook:add_worksheet() 16 | 17 | -- Widen the first column to make the text clearer. 18 | worksheet:set_column("A:A", 50) 19 | 20 | -- Open a source of UTF-8 data. 21 | local file = assert(io.open("utf8_polish.txt", "r")) 22 | 23 | -- Read the text file and write it to the worksheet. 24 | local line = file:read("*l") 25 | local row = 0 26 | 27 | while line do 28 | -- Ignore comments in the text file. 29 | if not string.match(line, "^#") then 30 | worksheet:write(row, 0, line) 31 | row = row + 1 32 | end 33 | line = file:read("*l") 34 | end 35 | 36 | workbook:close() 37 | -------------------------------------------------------------------------------- /tests/xlsxwriter_demos/utf8_polish.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Xlsxwriter Unicode example. 3 | # 4 | # The text is Polish encoded as UTF-8. 5 | # 6 | # See the utf8_polish.lua example. 7 | # 8 | WŚRÓD NOCNEJ CISZY 9 | 10 | Wśród nocnej ciszy głos się rozchodzi: 11 | Wstańcie, pasterze, Bóg się nam rodzi! 12 | Czym prędzej się wybierajcie, 13 | Do Betlejem pospieszajcie 14 | Przywitać Pana. 15 | 16 | Poszli, znaleźli Dzieciątko w żłobie 17 | Z wszystkimi znaki danymi sobie. 18 | Jako Bogu cześć Mu dali, 19 | A witając zawołali 20 | Z wielkiej radości: 21 | 22 | Ach, witaj Zbawco z dawno żądany, 23 | Wiele tysięcy lat wyglądany 24 | Na Ciebie króle, prorocy 25 | Czekali, a Tyś tej nocy 26 | Nam się objawił. 27 | 28 | I my czekamy na Ciebie, Pana, 29 | A skoro przyjdziesz na głos kapłana, 30 | Padniemy na twarz przed Tobą, 31 | Wierząc, żeś jest pod osłoną 32 | Chleba i wina. 33 | -------------------------------------------------------------------------------- /tests/xlsxwriter_demos/worksheet_protection.lua: -------------------------------------------------------------------------------- 1 | ---- 2 | -- 3 | -- Example of cell locking and formula hiding in an Excel worksheet 4 | -- using Python and the XlsxWriter module. 5 | -- 6 | -- Copyright 2014-2015, John McNamara, jmcnamara@cpan.org 7 | -- 8 | local Workbook = require "xlsxwriter.workbook" 9 | 10 | local workbook = Workbook:new("protection.xlsx") 11 | local worksheet = workbook:add_worksheet() 12 | 13 | -- Create some cell formats with protection properties. 14 | unlocked = workbook:add_format({locked = false}) 15 | hidden = workbook:add_format({hidden = true}) 16 | 17 | -- Format the columns to make the text more visible. 18 | worksheet:set_column('A:A', 40) 19 | 20 | -- Turn worksheet protection on. 21 | worksheet:protect() 22 | 23 | -- Write a locked, unlocked and hidden cell. 24 | worksheet:write('A1', 'Cell B1 is locked. It cannot be edited.') 25 | worksheet:write('A2', 'Cell B2 is unlocked. It can be edited.') 26 | worksheet:write('A3', "Cell B3 is hidden. The formula isn't visible.") 27 | 28 | worksheet:write_formula('B1', '=1+2') -- Locked by default. 29 | worksheet:write_formula('B2', '=1+2', unlocked) 30 | worksheet:write_formula('B3', '=1+2', hidden) 31 | 32 | workbook:close() 33 | -------------------------------------------------------------------------------- /tests/xml_test.lua: -------------------------------------------------------------------------------- 1 | require'glue' 2 | require'xml' 3 | 4 | local w = xml() 5 | 6 | local ns1 = w:ns('ns1', 'pns1') 7 | local ns2 = w:ns('ns2', 'pns2') 8 | local body = w:tag('body', ns1) 9 | local a1 = w:attr('a1') 10 | local a2 = w:attr('a2') 11 | 12 | w:start_doc(io.stdout) 13 | w:start_tag'root' 14 | w:text'hello' 15 | w:end_tag() 16 | w:end_doc() 17 | print() 18 | 19 | local t = {} 20 | w:start_doc(function(s, sz) 21 | s = s and (sz and str(s, sz) or str(s)) or '\n!EOF\n' 22 | t[#t+1] = s 23 | end) 24 | 25 | w:start_tag('html') 26 | w:add_ns(ns1) 27 | w:add_ns(ns2, 'g') 28 | 29 | w:text'\n\t' 30 | w:start_tag('head') 31 | w:add_attr('b', 'vb') 32 | w:add_attr('a', 'va') 33 | w:text'hello' 34 | w:end_tag() 35 | w:text'\n\t' 36 | 37 | w:start_tag(body) 38 | w:add_attr(a1, 'v1') 39 | w:add_attr(a2, 'v2') 40 | w:text'hey' 41 | w:end_tag() 42 | w:text'\n' 43 | 44 | w:end_tag() 45 | 46 | w:end_doc() 47 | 48 | w:free() 49 | 50 | local s = table.concat(t) 51 | assert(s == [[ 52 | 53 | hello 54 | hey 55 | 56 | !EOF 57 | ]]) 58 | -------------------------------------------------------------------------------- /tests/zip_test/test-aes.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allegory-software/allegory-sdk/41468c532b6d7ac045aa15b72258b88f9ff4c494/tests/zip_test/test-aes.zip --------------------------------------------------------------------------------