Check-in [8722b3746c]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:build undroidwish for MacOS with experimental jsmpeg SDL video driver plus other changes
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:8722b3746ccfd67d088e41c72c2967808d37e8ae
User & Date: chw 2019-02-14 06:10:03
Context
2019-02-14
06:20
add tk upstream changes check-in: 1005fc58e8 user: chw tags: trunk
06:12
merge with trunk check-in: 82d11a9e50 user: chw tags: wtf-8-experiment
06:10
build undroidwish for MacOS with experimental jsmpeg SDL video driver plus other changes check-in: 8722b3746c user: chw tags: trunk
2019-02-13
18:33
use internally built libwebsockets for Wayland and KMSDRM undroidwishes check-in: 22ec538f4d user: chw tags: trunk
Changes

Changes to jni/SDL2/configure.

24453
24454
24455
24456
24457
24458
24459

24460
24461
24462
24463
24464
24465
24466
        CheckDummyAudio
        CheckDLOPEN
        CheckCOCOA
        CheckX11
        CheckMacGL
        CheckOpenGLX11
        CheckVulkan

        CheckPTHREAD

        # Set up files for the audio library
        if test x$enable_audio = xyes; then

$as_echo "#define SDL_AUDIO_DRIVER_COREAUDIO 1" >>confdefs.h








>







24453
24454
24455
24456
24457
24458
24459
24460
24461
24462
24463
24464
24465
24466
24467
        CheckDummyAudio
        CheckDLOPEN
        CheckCOCOA
        CheckX11
        CheckMacGL
        CheckOpenGLX11
        CheckVulkan
        CheckJSMPEGVideo
        CheckPTHREAD

        # Set up files for the audio library
        if test x$enable_audio = xyes; then

$as_echo "#define SDL_AUDIO_DRIVER_COREAUDIO 1" >>confdefs.h

Changes to jni/SDL2/configure.in.

3758
3759
3760
3761
3762
3763
3764

3765
3766
3767
3768
3769
3770
3771
        CheckDummyAudio
        CheckDLOPEN
        CheckCOCOA
        CheckX11
        CheckMacGL
        CheckOpenGLX11
        CheckVulkan

        CheckPTHREAD

        # Set up files for the audio library
        if test x$enable_audio = xyes; then
            AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
            SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m"
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox"







>







3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
        CheckDummyAudio
        CheckDLOPEN
        CheckCOCOA
        CheckX11
        CheckMacGL
        CheckOpenGLX11
        CheckVulkan
        CheckJSMPEGVideo
        CheckPTHREAD

        # Set up files for the audio library
        if test x$enable_audio = xyes; then
            AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
            SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m"
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox"

Changes to jni/SDL2/src/video/SDL_video.c.

1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
    /* Some platforms blow up if the windows are too large. Raise it later? */
    if ((w > 16384) || (h > 16384)) {
        SDL_SetError("Window is too large.");
        return NULL;
    }

    /* Some platforms have OpenGL enabled by default */
#if (SDL_VIDEO_OPENGL && __MACOSX__) || __IPHONEOS__ || __ANDROID__ || __NACL__
    if (!_this->is_dummy && !(flags & SDL_WINDOW_VULKAN)) {
        flags |= SDL_WINDOW_OPENGL;
    }
#endif
    if (flags & SDL_WINDOW_OPENGL) {
        if (!_this->GL_CreateContext) {
            SDL_SetError("No OpenGL support in video driver");







|







1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
    /* Some platforms blow up if the windows are too large. Raise it later? */
    if ((w > 16384) || (h > 16384)) {
        SDL_SetError("Window is too large.");
        return NULL;
    }

    /* Some platforms have OpenGL enabled by default */
#if __IPHONEOS__ || __ANDROID__ || __NACL__
    if (!_this->is_dummy && !(flags & SDL_WINDOW_VULKAN)) {
        flags |= SDL_WINDOW_OPENGL;
    }
#endif
    if (flags & SDL_WINDOW_OPENGL) {
        if (!_this->GL_CreateContext) {
            SDL_SetError("No OpenGL support in video driver");

Changes to jni/SDL2/src/video/jsmpeg/SDL_jsmpeg.c.

463
464
465
466
467
468
469
470





471
472
473
474
475
476
477
#define LIB_AVUTIL_55  "avutil-55.dll"
#define LIB_AVUTIL_56  "avutil-56.dll"
#define LIB_AVCODEC_57 "avcodec-57.dll"
#define LIB_AVCODEC_58 "avcodec-58.dll"
#define LIB_SWSCALE_4  "swscale-4.dll"
#define LIB_SWSCALE_5  "swscale-5.dll"
#elif defined(__MACOSX__)
#error fix library names for MACOSX





#else
#define LIB_AVUTIL_55  "libavutil.so.55"
#define LIB_AVUTIL_56  "libavutil.so.56"
#define LIB_AVCODEC_57 "libavcodec.so.57"
#define LIB_AVCODEC_58 "libavcodec.so.58"
#define LIB_SWSCALE_4  "libswscale.so.4"
#define LIB_SWSCALE_5  "libswscale.so.5"







|
>
>
>
>
>







463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
#define LIB_AVUTIL_55  "avutil-55.dll"
#define LIB_AVUTIL_56  "avutil-56.dll"
#define LIB_AVCODEC_57 "avcodec-57.dll"
#define LIB_AVCODEC_58 "avcodec-58.dll"
#define LIB_SWSCALE_4  "swscale-4.dll"
#define LIB_SWSCALE_5  "swscale-5.dll"
#elif defined(__MACOSX__)
#define LIB_AVUTIL_55  "libavutil.55.dylib"
#define LIB_AVUTIL_56  "libavutil.56.dylib"
#define LIB_AVCODEC_57 "libavcodec.57.dylib"
#define LIB_AVCODEC_58 "libavcodec.58.dylib"
#define LIB_SWSCALE_4  "libswscale.4.dylib"
#define LIB_SWSCALE_5  "libswscale.5.dylib"
#else
#define LIB_AVUTIL_55  "libavutil.so.55"
#define LIB_AVUTIL_56  "libavutil.so.56"
#define LIB_AVCODEC_57 "libavcodec.so.57"
#define LIB_AVCODEC_58 "libavcodec.so.58"
#define LIB_SWSCALE_4  "libswscale.so.4"
#define LIB_SWSCALE_5  "libswscale.so.5"

Changes to jni/SDL2/src/video/jsmpeg/SDL_jsmpeg_files.h.

6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
  0x76, 0x65, 0x6e, 0x74, 0x0a, 0x09, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65,
  0x20, 0x7b, 0x0a, 0x09, 0x09, 0x69, 0x66, 0x20, 0x28, 0x20, 0x61, 0x63,
  0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x3d, 0x20, 0x4b, 0x45, 0x59, 0x5f,
  0x44, 0x4f, 0x57, 0x4e, 0x20, 0x26, 0x26, 0x20, 0x65, 0x76, 0x2e, 0x6b,
  0x65, 0x79, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x20, 0x3e, 0x20,
  0x30, 0x20, 0x26, 0x26, 0x20, 0x65, 0x76, 0x2e, 0x6b, 0x65, 0x79, 0x2e,
  0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x20, 0x3c, 0x3d, 0x20, 0x32, 0x20,
  0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x76, 0x61, 0x72, 0x20, 0x6c,
  0x6f, 0x20, 0x3d, 0x20, 0x65, 0x76, 0x2e, 0x6b, 0x65, 0x79, 0x2e, 0x63,
  0x68, 0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x41, 0x74, 0x28, 0x30, 0x29,
  0x3b, 0x0a, 0x09, 0x09, 0x09, 0x76, 0x61, 0x72, 0x20, 0x68, 0x69, 0x20,
  0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x28,
  0x20, 0x6c, 0x6f, 0x20, 0x3e, 0x3d, 0x20, 0x30, 0x78, 0x44, 0x38, 0x30,
  0x30, 0x20, 0x26, 0x26, 0x20, 0x6c, 0x6f, 0x20, 0x3c, 0x20, 0x30, 0x78,
  0x44, 0x43, 0x30, 0x30, 0x20, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09,
  0x09, 0x69, 0x66, 0x20, 0x28, 0x65, 0x76, 0x2e, 0x6b, 0x65, 0x79, 0x2e,
  0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x20, 0x3e, 0x20, 0x31, 0x29, 0x20,
  0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x68, 0x69, 0x20, 0x3d, 0x20,
  0x65, 0x76, 0x2e, 0x6b, 0x65, 0x79, 0x2e, 0x63, 0x68, 0x61, 0x72, 0x43,
  0x6f, 0x64, 0x65, 0x41, 0x74, 0x28, 0x31, 0x29, 0x3b, 0x0a, 0x09, 0x09,
  0x09, 0x09, 0x7d, 0x0a, 0x09, 0x09, 0x09, 0x7d, 0x0a, 0x09, 0x09, 0x09,
  0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x6e, 0x64, 0x28,
  0x6e, 0x65, 0x77, 0x20, 0x55, 0x69, 0x6e, 0x74, 0x31, 0x36, 0x41, 0x72,
  0x72, 0x61, 0x79, 0x28, 0x5b, 0x49, 0x4e, 0x50, 0x55, 0x54, 0x5f, 0x4b,
  0x45, 0x59, 0x2c, 0x20, 0x4b, 0x45, 0x59, 0x5f, 0x50, 0x52, 0x45, 0x53,
  0x53, 0x2c, 0x20, 0x6c, 0x6f, 0x2c, 0x20, 0x68, 0x69, 0x5d, 0x29, 0x29,
  0x3b, 0x0a, 0x09, 0x09, 0x7d, 0x0a, 0x09, 0x09, 0x65, 0x76, 0x2e, 0x70,
  0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c,
  0x74, 0x28, 0x29, 0x3b, 0x0a, 0x09, 0x7d, 0x0a, 0x09, 0x69, 0x66, 0x20,
  0x28, 0x20, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x3d, 0x20,
  0x4b, 0x45, 0x59, 0x5f, 0x55, 0x50, 0x20, 0x29, 0x20, 0x7b, 0x0a, 0x09,
  0x09, 0x65, 0x76, 0x2e, 0x73, 0x74, 0x6f, 0x70, 0x50, 0x72, 0x6f, 0x70,
  0x61, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x3b, 0x0a, 0x09,
  0x7d, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x73, 0x74, 0x72,
  0x75, 0x63, 0x74, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x6d, 0x6f,
  0x75, 0x73, 0x65, 0x5f, 0x74, 0x20, 0x7b, 0x20, 0x75, 0x69, 0x6e, 0x74,
  0x31, 0x36, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x20, 0x75, 0x69, 0x6e,
  0x74, 0x31, 0x36, 0x20, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3b, 0x20, 0x66,
  0x6c, 0x6f, 0x61, 0x74, 0x33, 0x32, 0x20, 0x78, 0x3b, 0x20, 0x66, 0x6c,
  0x6f, 0x61, 0x74, 0x33, 0x32, 0x20, 0x79, 0x3b, 0x20, 0x7d, 0x0a, 0x76,
  0x61, 0x72, 0x20, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61,
  0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x20, 0x3d, 0x20, 0x6e, 0x65, 0x77,
  0x20, 0x41, 0x72, 0x72, 0x61, 0x79, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72,
  0x28, 0x31, 0x32, 0x29, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x20, 0x6d, 0x6f,
  0x75, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x46,
  0x6c, 0x61, 0x67, 0x73, 0x20, 0x3d, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x55,
  0x69, 0x6e, 0x74, 0x31, 0x36, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x6d,
  0x6f, 0x75, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x42, 0x75, 0x66, 0x66,
  0x65, 0x72, 0x2c, 0x20, 0x30, 0x29, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x20,
  0x6d, 0x6f, 0x75, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6f,
  0x72, 0x64, 0x73, 0x20, 0x3d, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x46, 0x6c,
  0x6f, 0x61, 0x74, 0x33, 0x32, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x6d,
  0x6f, 0x75, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x42, 0x75, 0x66, 0x66,
  0x65, 0x72, 0x2c, 0x20, 0x34, 0x29, 0x3b, 0x0a, 0x0a, 0x76, 0x61, 0x72,
  0x20, 0x73, 0x65, 0x6e, 0x64, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x20, 0x3d,
  0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x76,
  0x2c, 0x20, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x20, 0x7b, 0x0a,
  0x09, 0x76, 0x61, 0x72, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x20,
  0x30, 0x3b, 0x0a, 0x09, 0x76, 0x61, 0x72, 0x20, 0x78, 0x2c, 0x20, 0x79,
  0x3b, 0x0a, 0x0a, 0x09, 0x69, 0x66, 0x28, 0x20, 0x61, 0x63, 0x74, 0x69,
  0x6f, 0x6e, 0x20, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x74, 0x79, 0x70,
  0x65, 0x20, 0x7c, 0x3d, 0x20, 0x49, 0x4e, 0x50, 0x55, 0x54, 0x5f, 0x4d,
  0x4f, 0x55, 0x53, 0x45, 0x5f, 0x42, 0x55, 0x54, 0x54, 0x4f, 0x4e, 0x3b,
  0x0a, 0x09, 0x09, 0x0a, 0x09, 0x09, 0x2f, 0x2f, 0x20, 0x41, 0x74, 0x74,
  0x65, 0x6d, 0x70, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x6c, 0x6f, 0x63, 0x6b,
  0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x20, 0x61, 0x74, 0x20,
  0x6d, 0x6f, 0x75, 0x73, 0x65, 0x31, 0x20, 0x64, 0x6f, 0x77, 0x6e, 0x0a,
  0x09, 0x09, 0x69, 0x66, 0x28, 0x20, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x4c,
  0x6f, 0x63, 0x6b, 0x20, 0x26, 0x26, 0x20, 0x61, 0x63, 0x74, 0x69, 0x6f,
  0x6e, 0x20, 0x3d, 0x3d, 0x3d, 0x20, 0x4d, 0x4f, 0x55, 0x53, 0x45, 0x5f,
  0x31, 0x5f, 0x44, 0x4f, 0x57, 0x4e, 0x20, 0x29, 0x20, 0x7b, 0x0a, 0x09,
  0x09, 0x09, 0x63, 0x61, 0x6e, 0x76, 0x61, 0x73, 0x2e, 0x72, 0x65, 0x71,
  0x75, 0x65, 0x73, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x4c,
  0x6f, 0x63, 0x6b, 0x28, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x7d, 0x0a, 0x09,
  0x7d, 0x0a, 0x09, 0x0a, 0x09, 0x2f, 0x2f, 0x20, 0x4f, 0x6e, 0x6c, 0x79,
  0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69,
  0x76, 0x65, 0x20, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x20, 0x6d, 0x6f, 0x76,
  0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f,
  0x20, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x70,
  0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x0a, 0x09, 0x69, 0x66, 0x28, 0x20,
  0x21, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x26, 0x26, 0x20, 0x6d,
  0x6f, 0x75, 0x73, 0x65, 0x4c, 0x6f, 0x63, 0x6b, 0x20, 0x29, 0x20, 0x7b,
  0x0a, 0x09, 0x09, 0x74, 0x79, 0x70, 0x65, 0x20, 0x7c, 0x3d, 0x20, 0x49,
  0x4e, 0x50, 0x55, 0x54, 0x5f, 0x4d, 0x4f, 0x55, 0x53, 0x45, 0x5f, 0x52,
  0x45, 0x4c, 0x41, 0x54, 0x49, 0x56, 0x45, 0x3b, 0x0a, 0x09, 0x09, 0x0a,
  0x09, 0x09, 0x76, 0x61, 0x72, 0x20, 0x70, 0x20, 0x3d, 0x20, 0x65, 0x76,
  0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x54, 0x6f, 0x75, 0x63,
  0x68, 0x65, 0x73, 0x20, 0x3f, 0x20, 0x65, 0x76, 0x2e, 0x63, 0x68, 0x61,
  0x6e, 0x67, 0x65, 0x64, 0x54, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x73, 0x5b,
  0x30, 0x5d, 0x20, 0x3a, 0x20, 0x65, 0x76, 0x3b, 0x0a, 0x09, 0x09, 0x0a,
  0x09, 0x09, 0x2f, 0x2f, 0x20, 0x46, 0x55, 0x43, 0x4b, 0x2c, 0x20, 0x44,
  0x49, 0x44, 0x20, 0x49, 0x20, 0x4d, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e,
  0x20, 0x49, 0x20, 0x4c, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x56, 0x45, 0x20,
  0x56, 0x45, 0x4e, 0x44, 0x4f, 0x52, 0x20, 0x50, 0x52, 0x45, 0x46, 0x49,
  0x58, 0x45, 0x53, 0x3f, 0x20, 0x53, 0x4f, 0x20, 0x55, 0x53, 0x45, 0x46,
  0x55, 0x4c, 0x21, 0x0a, 0x09, 0x09, 0x78, 0x20, 0x3d, 0x20, 0x70, 0x2e,
  0x6d, 0x6f, 0x76, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x58, 0x20, 0x7c, 0x7c,
  0x20, 0x70, 0x2e, 0x6d, 0x6f, 0x7a, 0x4d, 0x6f, 0x76, 0x65, 0x6d, 0x65,
  0x6e, 0x74, 0x58, 0x20, 0x7c, 0x7c, 0x20, 0x70, 0x2e, 0x77, 0x65, 0x62,
  0x6b, 0x69, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x58,
  0x3b, 0x0a, 0x09, 0x09, 0x79, 0x20, 0x3d, 0x20, 0x70, 0x2e, 0x6d, 0x6f,
  0x76, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x59, 0x20, 0x7c, 0x7c, 0x20, 0x70,
  0x2e, 0x6d, 0x6f, 0x7a, 0x4d, 0x6f, 0x76, 0x65, 0x6d, 0x65, 0x6e, 0x74,
  0x59, 0x20, 0x7c, 0x7c, 0x20, 0x70, 0x2e, 0x77, 0x65, 0x62, 0x6b, 0x69,
  0x74, 0x4d, 0x6f, 0x76, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x59, 0x3b, 0x0a,
  0x0a, 0x09, 0x09, 0x69, 0x66, 0x28, 0x20, 0x74, 0x79, 0x70, 0x65, 0x6f,
  0x66, 0x20, 0x78, 0x20, 0x3d, 0x3d, 0x3d, 0x20, 0x27, 0x75, 0x6e, 0x64,
  0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x27, 0x20, 0x29, 0x20, 0x7b, 0x0a,
  0x09, 0x09, 0x09, 0x78, 0x20, 0x3d, 0x20, 0x70, 0x2e, 0x63, 0x6c, 0x69,
  0x65, 0x6e, 0x74, 0x58, 0x20, 0x2d, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x4d,
  0x6f, 0x75, 0x73, 0x65, 0x2e, 0x78, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x79,
  0x20, 0x3d, 0x20, 0x70, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x59,
  0x20, 0x2d, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x75, 0x73, 0x65,
  0x2e, 0x79, 0x3b, 0x0a, 0x09, 0x09, 0x7d, 0x0a, 0x0a, 0x09, 0x09, 0x6c,
  0x61, 0x73, 0x74, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x2e, 0x78, 0x20, 0x3d,
  0x20, 0x70, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x58, 0x3b, 0x0a,
  0x09, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x2e,
  0x79, 0x20, 0x3d, 0x20, 0x70, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74,
  0x59, 0x3b, 0x0a, 0x09, 0x7d, 0x0a, 0x0a, 0x09, 0x2f, 0x2f, 0x20, 0x49,
  0x66, 0x20, 0x77, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, 0x61, 0x62,
  0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x20, 0x6d, 0x6f, 0x75, 0x73, 0x65,
  0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x73, 0x2c, 0x20, 0x77, 0x65, 0x20,
  0x63, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x64,
  0x6f, 0x20, 0x73, 0x6f, 0x2c, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x20, 0x66,
  0x6f, 0x72, 0x0a, 0x09, 0x2f, 0x2f, 0x20, 0x62, 0x75, 0x74, 0x74, 0x6f,
  0x6e, 0x20, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x2e, 0x0a, 0x09,
  0x69, 0x66, 0x28, 0x20, 0x21, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x4c, 0x6f,
  0x63, 0x6b, 0x20, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x74, 0x79, 0x70,
  0x65, 0x20, 0x7c, 0x3d, 0x20, 0x49, 0x4e, 0x50, 0x55, 0x54, 0x5f, 0x4d,
  0x4f, 0x55, 0x53, 0x45, 0x5f, 0x41, 0x42, 0x53, 0x4f, 0x4c, 0x55, 0x54,
  0x45, 0x3b, 0x0a, 0x09, 0x09, 0x0a, 0x09, 0x09, 0x76, 0x61, 0x72, 0x20,
  0x72, 0x65, 0x63, 0x74, 0x20, 0x3d, 0x20, 0x63, 0x61, 0x6e, 0x76, 0x61,
  0x73, 0x2e, 0x67, 0x65, 0x74, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e,
  0x67, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x74, 0x28,
  0x29, 0x3b, 0x0a, 0x09, 0x09, 0x76, 0x61, 0x72, 0x20, 0x73, 0x63, 0x61,
  0x6c, 0x65, 0x58, 0x20, 0x3d, 0x20, 0x63, 0x61, 0x6e, 0x76, 0x61, 0x73,
  0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x20, 0x2f, 0x20, 0x28, 0x72, 0x65,
  0x63, 0x74, 0x2e, 0x72, 0x69, 0x67, 0x68, 0x74, 0x2d, 0x72, 0x65, 0x63,
  0x74, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x29, 0x2c, 0x0a, 0x09, 0x09, 0x09,
  0x73, 0x63, 0x61, 0x6c, 0x65, 0x59, 0x20, 0x3d, 0x20, 0x63, 0x61, 0x6e,
  0x76, 0x61, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x20, 0x2f,
  0x20, 0x28, 0x72, 0x65, 0x63, 0x74, 0x2e, 0x62, 0x6f, 0x74, 0x74, 0x6f,
  0x6d, 0x2d, 0x72, 0x65, 0x63, 0x74, 0x2e, 0x74, 0x6f, 0x70, 0x29, 0x3b,
  0x0a, 0x09, 0x09, 0x0a, 0x09, 0x09, 0x76, 0x61, 0x72, 0x20, 0x70, 0x20,
  0x3d, 0x20, 0x65, 0x76, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64,
  0x54, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x73, 0x20, 0x3f, 0x20, 0x65, 0x76,
  0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x54, 0x6f, 0x75, 0x63,
  0x68, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x20, 0x3a, 0x20, 0x65, 0x76, 0x3b,
  0x0a, 0x09, 0x09, 0x76, 0x61, 0x72, 0x20, 0x78, 0x20, 0x3d, 0x20, 0x28,
  0x70, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x58, 0x20, 0x2d, 0x20,
  0x72, 0x65, 0x63, 0x74, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x29, 0x20, 0x2a,
  0x20, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x58, 0x2c, 0x0a, 0x09, 0x09, 0x09,
  0x79, 0x20, 0x3d, 0x20, 0x28, 0x70, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e,
  0x74, 0x59, 0x20, 0x2d, 0x20, 0x72, 0x65, 0x63, 0x74, 0x2e, 0x74, 0x6f,
  0x70, 0x29, 0x20, 0x2a, 0x20, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x59, 0x3b,
  0x0a, 0x09, 0x7d, 0x0a, 0x0a, 0x09, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x44,
  0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x73,
  0x5b, 0x30, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3b, 0x0a,
  0x09, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79,
  0x70, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x5b, 0x31, 0x5d, 0x20, 0x3d,
  0x20, 0x28, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x7c, 0x7c, 0x30, 0x29,
  0x3b, 0x0a, 0x09, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61,
  0x43, 0x6f, 0x6f, 0x72, 0x64, 0x73, 0x5b, 0x30, 0x5d, 0x20, 0x3d, 0x20,
  0x78, 0x3b, 0x0a, 0x09, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x44, 0x61, 0x74,
  0x61, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x73, 0x5b, 0x31, 0x5d, 0x20, 0x3d,
  0x20, 0x79, 0x3b, 0x0a, 0x09, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e,
  0x74, 0x2e, 0x73, 0x65, 0x6e, 0x64, 0x28, 0x6d, 0x6f, 0x75, 0x73, 0x65,
  0x44, 0x61, 0x74, 0x61, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x29, 0x3b,
  0x0a, 0x09, 0x65, 0x76, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74,
  0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x28, 0x29, 0x3b, 0x0a, 0x7d,
  0x3b, 0x0a, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x4b, 0x65, 0x79, 0x62, 0x6f,
  0x61, 0x72, 0x64, 0x0a, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x61,
  0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65,
  0x6e, 0x65, 0x72, 0x28, 0x27, 0x6b, 0x65, 0x79, 0x64, 0x6f, 0x77, 0x6e,
  0x27, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
  0x65, 0x76, 0x29, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x4b, 0x65,
  0x79, 0x28, 0x65, 0x76, 0x2c, 0x20, 0x4b, 0x45, 0x59, 0x5f, 0x44, 0x4f,
  0x57, 0x4e, 0x2c, 0x20, 0x65, 0x76, 0x2e, 0x6b, 0x65, 0x79, 0x43, 0x6f,
  0x64, 0x65, 0x29, 0x3b, 0x20, 0x7d, 0x2c, 0x20, 0x66, 0x61, 0x6c, 0x73,
  0x65, 0x20, 0x29, 0x3b, 0x0a, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e,
  0x61, 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74,
  0x65, 0x6e, 0x65, 0x72, 0x28, 0x27, 0x6b, 0x65, 0x79, 0x75, 0x70, 0x27,
  0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65,
  0x76, 0x29, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x4b, 0x65, 0x79,
  0x28, 0x65, 0x76, 0x2c, 0x20, 0x4b, 0x45, 0x59, 0x5f, 0x55, 0x50, 0x2c,
  0x20, 0x65, 0x76, 0x2e, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x29,
  0x3b, 0x20, 0x7d, 0x2c, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x20, 0x29,
  0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x0a,
  0x63, 0x61, 0x6e, 0x76, 0x61, 0x73, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76,
  0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28,
  0x27, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x27, 0x2c,
  0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x76,
  0x29, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x4d, 0x6f, 0x75, 0x73,
  0x65, 0x28, 0x65, 0x76, 0x2c, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x3b,
  0x20, 0x7d, 0x2c, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a,
  0x63, 0x61, 0x6e, 0x76, 0x61, 0x73, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76,
  0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28,
  0x27, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x64, 0x6f, 0x77, 0x6e, 0x27, 0x2c,
  0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x76,
  0x29, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x4d, 0x6f, 0x75, 0x73,
  0x65, 0x28, 0x65, 0x76, 0x2c, 0x20, 0x65, 0x76, 0x2e, 0x62, 0x75, 0x74,
  0x74, 0x6f, 0x6e, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x20, 0x3f, 0x20, 0x4d,
  0x4f, 0x55, 0x53, 0x45, 0x5f, 0x32, 0x5f, 0x44, 0x4f, 0x57, 0x4e, 0x20,
  0x3a, 0x20, 0x4d, 0x4f, 0x55, 0x53, 0x45, 0x5f, 0x31, 0x5f, 0x44, 0x4f,
  0x57, 0x4e, 0x29, 0x3b, 0x20, 0x7d, 0x2c, 0x20, 0x66, 0x61, 0x6c, 0x73,
  0x65, 0x29, 0x3b, 0x0a, 0x63, 0x61, 0x6e, 0x76, 0x61, 0x73, 0x2e, 0x61,
  0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65,
  0x6e, 0x65, 0x72, 0x28, 0x27, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x75, 0x70,
  0x27, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
  0x65, 0x76, 0x29, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x4d, 0x6f,
  0x75, 0x73, 0x65, 0x28, 0x65, 0x76, 0x2c, 0x20, 0x65, 0x76, 0x2e, 0x62,
  0x75, 0x74, 0x74, 0x6f, 0x6e, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x20, 0x3f,
  0x20, 0x4d, 0x4f, 0x55, 0x53, 0x45, 0x5f, 0x32, 0x5f, 0x55, 0x50, 0x20,
  0x3a, 0x20, 0x4d, 0x4f, 0x55, 0x53, 0x45, 0x5f, 0x31, 0x5f, 0x55, 0x50,
  0x29, 0x3b, 0x20, 0x7d, 0x2c, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29,
  0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x6f, 0x75, 0x63, 0x68, 0x0a,
  0x63, 0x61, 0x6e, 0x76, 0x61, 0x73, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76,
  0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28,
  0x27, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x73, 0x74, 0x61, 0x72, 0x74, 0x27,
  0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65,
  0x76, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f,
  0x75, 0x73, 0x65, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x65, 0x76, 0x2e, 0x63,
  0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x54, 0x6f, 0x75, 0x63, 0x68, 0x65,
  0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x58,
  0x3b, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x75, 0x73, 0x65,
  0x2e, 0x79, 0x20, 0x3d, 0x20, 0x65, 0x76, 0x2e, 0x63, 0x68, 0x61, 0x6e,
  0x67, 0x65, 0x64, 0x54, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x73, 0x5b, 0x30,
  0x5d, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x59, 0x3b, 0x0a, 0x09,
  0x73, 0x65, 0x6e, 0x64, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x28, 0x65, 0x76,
  0x2c, 0x20, 0x4d, 0x4f, 0x55, 0x53, 0x45, 0x5f, 0x31, 0x5f, 0x44, 0x4f,
  0x57, 0x4e, 0x29, 0x3b, 0x0a, 0x7d, 0x2c, 0x20, 0x66, 0x61, 0x6c, 0x73,
  0x65, 0x29, 0x3b, 0x0a, 0x63, 0x61, 0x6e, 0x76, 0x61, 0x73, 0x2e, 0x61,
  0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65,
  0x6e, 0x65, 0x72, 0x28, 0x27, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x6e,
  0x64, 0x27, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
  0x28, 0x65, 0x76, 0x29, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x4d,
  0x6f, 0x75, 0x73, 0x65, 0x28, 0x65, 0x76, 0x2c, 0x20, 0x4d, 0x4f, 0x55,
  0x53, 0x45, 0x5f, 0x31, 0x5f, 0x55, 0x50, 0x29, 0x3b, 0x20, 0x7d, 0x2c,
  0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x63, 0x61, 0x6e,
  0x76, 0x61, 0x73, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74,
  0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x27, 0x74, 0x6f,
  0x75, 0x63, 0x68, 0x6d, 0x6f, 0x76, 0x65, 0x27, 0x2c, 0x20, 0x66, 0x75,
  0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x76, 0x29, 0x20, 0x7b,
  0x20, 0x73, 0x65, 0x6e, 0x64, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x28, 0x65,
  0x76, 0x2c, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x3b, 0x20, 0x7d, 0x2c,
  0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f,
  0x20, 0x54, 0x6f, 0x75, 0x63, 0x68, 0x20, 0x62, 0x75, 0x74, 0x74, 0x6f,
  0x6e, 0x73, 0x20, 0x65, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6e, 0x67,
  0x20, 0x6b, 0x65, 0x79, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x20, 0x6b, 0x65,
  0x79, 0x73, 0x0a, 0x76, 0x61, 0x72, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e,
  0x65, 0x54, 0x6f, 0x75, 0x63, 0x68, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e,
  0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
  0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x20, 0x6b, 0x65, 0x79,
  0x43, 0x6f, 0x64, 0x65, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x65, 0x6c, 0x65,
  0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e,
  0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x27, 0x74,
  0x6f, 0x75, 0x63, 0x68, 0x73, 0x74, 0x61, 0x72, 0x74, 0x27, 0x2c, 0x20,
  0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x76, 0x29,
  0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x4b, 0x65, 0x79, 0x28, 0x65,
  0x76, 0x2c, 0x20, 0x4b, 0x45, 0x59, 0x5f, 0x44, 0x4f, 0x57, 0x4e, 0x2c,
  0x20, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x29, 0x3b, 0x20, 0x7d,
  0x2c, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x09, 0x65,
  0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76,
  0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28,
  0x27, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x6e, 0x64, 0x27, 0x2c, 0x20,
  0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x76, 0x29,
  0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x4b, 0x65, 0x79, 0x28, 0x65,
  0x76, 0x2c, 0x20, 0x4b, 0x45, 0x59, 0x5f, 0x55, 0x50, 0x2c, 0x20, 0x6b,
  0x65, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x29, 0x3b, 0x20, 0x7d, 0x2c, 0x20,
  0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a,
  0x76, 0x61, 0x72, 0x20, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x4b, 0x65, 0x79,
  0x73, 0x20, 0x3d, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
  0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74,
  0x6f, 0x72, 0x41, 0x6c, 0x6c, 0x28, 0x27, 0x2e, 0x6b, 0x65, 0x79, 0x27,
  0x29, 0x3b, 0x0a, 0x66, 0x6f, 0x72, 0x28, 0x20, 0x76, 0x61, 0x72, 0x20,
  0x69, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x20, 0x69, 0x20, 0x3c, 0x20, 0x74,
  0x6f, 0x75, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x6e,
  0x67, 0x74, 0x68, 0x3b, 0x20, 0x69, 0x2b, 0x2b, 0x20, 0x29, 0x20, 0x7b,
  0x0a, 0x09, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x54, 0x6f, 0x75, 0x63,
  0x68, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x28, 0x74, 0x6f, 0x75, 0x63,
  0x68, 0x4b, 0x65, 0x79, 0x73, 0x5b, 0x69, 0x5d, 0x2c, 0x20, 0x74, 0x6f,
  0x75, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x73, 0x5b, 0x69, 0x5d, 0x2e, 0x64,
  0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x29,
  0x3b, 0x0a, 0x7d, 0x0a
};

static struct {
    const char *name;
    int length;
    const unsigned char *data;
} JSMPEG_files[] = {
{
  "index.html",
  sizeof(JSMPEG_file_1),
  JSMPEG_file_1
},
{
  "jsmpg.js",
  sizeof(JSMPEG_file_2),
  JSMPEG_file_2
},
{
  "jsmpg-vnc.js",
  sizeof(JSMPEG_file_3),
  JSMPEG_file_3
},
{ NULL, 0, NULL }
};








|
|

|

|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|


|




|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|


6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
  0x76, 0x65, 0x6e, 0x74, 0x0a, 0x09, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65,
  0x20, 0x7b, 0x0a, 0x09, 0x09, 0x69, 0x66, 0x20, 0x28, 0x20, 0x61, 0x63,
  0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x3d, 0x20, 0x4b, 0x45, 0x59, 0x5f,
  0x44, 0x4f, 0x57, 0x4e, 0x20, 0x26, 0x26, 0x20, 0x65, 0x76, 0x2e, 0x6b,
  0x65, 0x79, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x20, 0x3e, 0x20,
  0x30, 0x20, 0x26, 0x26, 0x20, 0x65, 0x76, 0x2e, 0x6b, 0x65, 0x79, 0x2e,
  0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x20, 0x3c, 0x3d, 0x20, 0x32, 0x20,
  0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x76, 0x61, 0x72, 0x20, 0x68,
  0x69, 0x20, 0x3d, 0x20, 0x65, 0x76, 0x2e, 0x6b, 0x65, 0x79, 0x2e, 0x63,
  0x68, 0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x41, 0x74, 0x28, 0x30, 0x29,
  0x3b, 0x0a, 0x09, 0x09, 0x09, 0x76, 0x61, 0x72, 0x20, 0x6c, 0x6f, 0x20,
  0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x28,
  0x20, 0x68, 0x69, 0x20, 0x3e, 0x3d, 0x20, 0x30, 0x78, 0x44, 0x38, 0x30,
  0x30, 0x20, 0x26, 0x26, 0x20, 0x68, 0x69, 0x20, 0x3c, 0x20, 0x30, 0x78,
  0x44, 0x43, 0x30, 0x30, 0x20, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09,
  0x09, 0x69, 0x66, 0x20, 0x28, 0x20, 0x65, 0x76, 0x2e, 0x6b, 0x65, 0x79,
  0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x20, 0x3e, 0x20, 0x31, 0x20,
  0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x20,
  0x3d, 0x20, 0x65, 0x76, 0x2e, 0x6b, 0x65, 0x79, 0x2e, 0x63, 0x68, 0x61,
  0x72, 0x43, 0x6f, 0x64, 0x65, 0x41, 0x74, 0x28, 0x31, 0x29, 0x3b, 0x0a,
  0x09, 0x09, 0x09, 0x09, 0x7d, 0x0a, 0x09, 0x09, 0x09, 0x7d, 0x0a, 0x09,
  0x09, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x6e,
  0x64, 0x28, 0x6e, 0x65, 0x77, 0x20, 0x55, 0x69, 0x6e, 0x74, 0x31, 0x36,
  0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x5b, 0x49, 0x4e, 0x50, 0x55, 0x54,
  0x5f, 0x4b, 0x45, 0x59, 0x2c, 0x20, 0x4b, 0x45, 0x59, 0x5f, 0x50, 0x52,
  0x45, 0x53, 0x53, 0x2c, 0x20, 0x68, 0x69, 0x2c, 0x20, 0x6c, 0x6f, 0x5d,
  0x29, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x7d, 0x0a, 0x09, 0x09, 0x65, 0x76,
  0x2e, 0x70, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x61,
  0x75, 0x6c, 0x74, 0x28, 0x29, 0x3b, 0x0a, 0x09, 0x7d, 0x0a, 0x09, 0x69,
  0x66, 0x20, 0x28, 0x20, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d,
  0x3d, 0x20, 0x4b, 0x45, 0x59, 0x5f, 0x55, 0x50, 0x20, 0x29, 0x20, 0x7b,
  0x0a, 0x09, 0x09, 0x65, 0x76, 0x2e, 0x73, 0x74, 0x6f, 0x70, 0x50, 0x72,
  0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x3b,
  0x0a, 0x09, 0x7d, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x73,
  0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f,
  0x6d, 0x6f, 0x75, 0x73, 0x65, 0x5f, 0x74, 0x20, 0x7b, 0x20, 0x75, 0x69,
  0x6e, 0x74, 0x31, 0x36, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x20, 0x75,
  0x69, 0x6e, 0x74, 0x31, 0x36, 0x20, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3b,
  0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x32, 0x20, 0x78, 0x3b, 0x20,
  0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x32, 0x20, 0x79, 0x3b, 0x20, 0x7d,
  0x0a, 0x76, 0x61, 0x72, 0x20, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x44, 0x61,
  0x74, 0x61, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x20, 0x3d, 0x20, 0x6e,
  0x65, 0x77, 0x20, 0x41, 0x72, 0x72, 0x61, 0x79, 0x42, 0x75, 0x66, 0x66,
  0x65, 0x72, 0x28, 0x31, 0x32, 0x29, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x20,
  0x6d, 0x6f, 0x75, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70,
  0x65, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x20, 0x3d, 0x20, 0x6e, 0x65, 0x77,
  0x20, 0x55, 0x69, 0x6e, 0x74, 0x31, 0x36, 0x41, 0x72, 0x72, 0x61, 0x79,
  0x28, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x42, 0x75,
  0x66, 0x66, 0x65, 0x72, 0x2c, 0x20, 0x30, 0x29, 0x3b, 0x0a, 0x76, 0x61,
  0x72, 0x20, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x43,
  0x6f, 0x6f, 0x72, 0x64, 0x73, 0x20, 0x3d, 0x20, 0x6e, 0x65, 0x77, 0x20,
  0x46, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x32, 0x41, 0x72, 0x72, 0x61, 0x79,
  0x28, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x42, 0x75,
  0x66, 0x66, 0x65, 0x72, 0x2c, 0x20, 0x34, 0x29, 0x3b, 0x0a, 0x0a, 0x76,
  0x61, 0x72, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x4d, 0x6f, 0x75, 0x73, 0x65,
  0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
  0x65, 0x76, 0x2c, 0x20, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x20,
  0x7b, 0x0a, 0x09, 0x76, 0x61, 0x72, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20,
  0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x09, 0x76, 0x61, 0x72, 0x20, 0x78, 0x2c,
  0x20, 0x79, 0x3b, 0x0a, 0x0a, 0x09, 0x69, 0x66, 0x28, 0x20, 0x61, 0x63,
  0x74, 0x69, 0x6f, 0x6e, 0x20, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x74,
  0x79, 0x70, 0x65, 0x20, 0x7c, 0x3d, 0x20, 0x49, 0x4e, 0x50, 0x55, 0x54,
  0x5f, 0x4d, 0x4f, 0x55, 0x53, 0x45, 0x5f, 0x42, 0x55, 0x54, 0x54, 0x4f,
  0x4e, 0x3b, 0x0a, 0x09, 0x09, 0x0a, 0x09, 0x09, 0x2f, 0x2f, 0x20, 0x41,
  0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x6c, 0x6f,
  0x63, 0x6b, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x20, 0x61,
  0x74, 0x20, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x31, 0x20, 0x64, 0x6f, 0x77,
  0x6e, 0x0a, 0x09, 0x09, 0x69, 0x66, 0x28, 0x20, 0x6d, 0x6f, 0x75, 0x73,
  0x65, 0x4c, 0x6f, 0x63, 0x6b, 0x20, 0x26, 0x26, 0x20, 0x61, 0x63, 0x74,
  0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x3d, 0x3d, 0x20, 0x4d, 0x4f, 0x55, 0x53,
  0x45, 0x5f, 0x31, 0x5f, 0x44, 0x4f, 0x57, 0x4e, 0x20, 0x29, 0x20, 0x7b,
  0x0a, 0x09, 0x09, 0x09, 0x63, 0x61, 0x6e, 0x76, 0x61, 0x73, 0x2e, 0x72,
  0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x65,
  0x72, 0x4c, 0x6f, 0x63, 0x6b, 0x28, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x7d,
  0x0a, 0x09, 0x7d, 0x0a, 0x09, 0x0a, 0x09, 0x2f, 0x2f, 0x20, 0x4f, 0x6e,
  0x6c, 0x79, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x72, 0x65, 0x6c, 0x61,
  0x74, 0x69, 0x76, 0x65, 0x20, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x20, 0x6d,
  0x6f, 0x76, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x69, 0x66, 0x20,
  0x6e, 0x6f, 0x20, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x20, 0x69, 0x73,
  0x20, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x0a, 0x09, 0x69, 0x66,
  0x28, 0x20, 0x21, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x26, 0x26,
  0x20, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x4c, 0x6f, 0x63, 0x6b, 0x20, 0x29,
  0x20, 0x7b, 0x0a, 0x09, 0x09, 0x74, 0x79, 0x70, 0x65, 0x20, 0x7c, 0x3d,
  0x20, 0x49, 0x4e, 0x50, 0x55, 0x54, 0x5f, 0x4d, 0x4f, 0x55, 0x53, 0x45,
  0x5f, 0x52, 0x45, 0x4c, 0x41, 0x54, 0x49, 0x56, 0x45, 0x3b, 0x0a, 0x09,
  0x09, 0x0a, 0x09, 0x09, 0x76, 0x61, 0x72, 0x20, 0x70, 0x20, 0x3d, 0x20,
  0x65, 0x76, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x54, 0x6f,
  0x75, 0x63, 0x68, 0x65, 0x73, 0x20, 0x3f, 0x20, 0x65, 0x76, 0x2e, 0x63,
  0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x54, 0x6f, 0x75, 0x63, 0x68, 0x65,
  0x73, 0x5b, 0x30, 0x5d, 0x20, 0x3a, 0x20, 0x65, 0x76, 0x3b, 0x0a, 0x09,
  0x09, 0x0a, 0x09, 0x09, 0x2f, 0x2f, 0x20, 0x46, 0x55, 0x43, 0x4b, 0x2c,
  0x20, 0x44, 0x49, 0x44, 0x20, 0x49, 0x20, 0x4d, 0x45, 0x4e, 0x54, 0x49,
  0x4f, 0x4e, 0x20, 0x49, 0x20, 0x4c, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x56,
  0x45, 0x20, 0x56, 0x45, 0x4e, 0x44, 0x4f, 0x52, 0x20, 0x50, 0x52, 0x45,
  0x46, 0x49, 0x58, 0x45, 0x53, 0x3f, 0x20, 0x53, 0x4f, 0x20, 0x55, 0x53,
  0x45, 0x46, 0x55, 0x4c, 0x21, 0x0a, 0x09, 0x09, 0x78, 0x20, 0x3d, 0x20,
  0x70, 0x2e, 0x6d, 0x6f, 0x76, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x58, 0x20,
  0x7c, 0x7c, 0x20, 0x70, 0x2e, 0x6d, 0x6f, 0x7a, 0x4d, 0x6f, 0x76, 0x65,
  0x6d, 0x65, 0x6e, 0x74, 0x58, 0x20, 0x7c, 0x7c, 0x20, 0x70, 0x2e, 0x77,
  0x65, 0x62, 0x6b, 0x69, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x6d, 0x65, 0x6e,
  0x74, 0x58, 0x3b, 0x0a, 0x09, 0x09, 0x79, 0x20, 0x3d, 0x20, 0x70, 0x2e,
  0x6d, 0x6f, 0x76, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x59, 0x20, 0x7c, 0x7c,
  0x20, 0x70, 0x2e, 0x6d, 0x6f, 0x7a, 0x4d, 0x6f, 0x76, 0x65, 0x6d, 0x65,
  0x6e, 0x74, 0x59, 0x20, 0x7c, 0x7c, 0x20, 0x70, 0x2e, 0x77, 0x65, 0x62,
  0x6b, 0x69, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x59,
  0x3b, 0x0a, 0x0a, 0x09, 0x09, 0x69, 0x66, 0x28, 0x20, 0x74, 0x79, 0x70,
  0x65, 0x6f, 0x66, 0x20, 0x78, 0x20, 0x3d, 0x3d, 0x3d, 0x20, 0x27, 0x75,
  0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x27, 0x20, 0x29, 0x20,
  0x7b, 0x0a, 0x09, 0x09, 0x09, 0x78, 0x20, 0x3d, 0x20, 0x70, 0x2e, 0x63,
  0x6c, 0x69, 0x65, 0x6e, 0x74, 0x58, 0x20, 0x2d, 0x20, 0x6c, 0x61, 0x73,
  0x74, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x2e, 0x78, 0x3b, 0x0a, 0x09, 0x09,
  0x09, 0x79, 0x20, 0x3d, 0x20, 0x70, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e,
  0x74, 0x59, 0x20, 0x2d, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x75,
  0x73, 0x65, 0x2e, 0x79, 0x3b, 0x0a, 0x09, 0x09, 0x7d, 0x0a, 0x0a, 0x09,
  0x09, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x2e, 0x78,
  0x20, 0x3d, 0x20, 0x70, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x58,
  0x3b, 0x0a, 0x09, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x75, 0x73,
  0x65, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x70, 0x2e, 0x63, 0x6c, 0x69, 0x65,
  0x6e, 0x74, 0x59, 0x3b, 0x0a, 0x09, 0x7d, 0x0a, 0x0a, 0x09, 0x2f, 0x2f,
  0x20, 0x49, 0x66, 0x20, 0x77, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20,
  0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x20, 0x6d, 0x6f, 0x75,
  0x73, 0x65, 0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x73, 0x2c, 0x20, 0x77,
  0x65, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73,
  0x20, 0x64, 0x6f, 0x20, 0x73, 0x6f, 0x2c, 0x20, 0x65, 0x76, 0x65, 0x6e,
  0x20, 0x66, 0x6f, 0x72, 0x0a, 0x09, 0x2f, 0x2f, 0x20, 0x62, 0x75, 0x74,
  0x74, 0x6f, 0x6e, 0x20, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x2e,
  0x0a, 0x09, 0x69, 0x66, 0x28, 0x20, 0x21, 0x6d, 0x6f, 0x75, 0x73, 0x65,
  0x4c, 0x6f, 0x63, 0x6b, 0x20, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x74,
  0x79, 0x70, 0x65, 0x20, 0x7c, 0x3d, 0x20, 0x49, 0x4e, 0x50, 0x55, 0x54,
  0x5f, 0x4d, 0x4f, 0x55, 0x53, 0x45, 0x5f, 0x41, 0x42, 0x53, 0x4f, 0x4c,
  0x55, 0x54, 0x45, 0x3b, 0x0a, 0x09, 0x09, 0x0a, 0x09, 0x09, 0x76, 0x61,
  0x72, 0x20, 0x72, 0x65, 0x63, 0x74, 0x20, 0x3d, 0x20, 0x63, 0x61, 0x6e,
  0x76, 0x61, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x42, 0x6f, 0x75, 0x6e, 0x64,
  0x69, 0x6e, 0x67, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x63,
  0x74, 0x28, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x76, 0x61, 0x72, 0x20, 0x73,
  0x63, 0x61, 0x6c, 0x65, 0x58, 0x20, 0x3d, 0x20, 0x63, 0x61, 0x6e, 0x76,
  0x61, 0x73, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x20, 0x2f, 0x20, 0x28,
  0x72, 0x65, 0x63, 0x74, 0x2e, 0x72, 0x69, 0x67, 0x68, 0x74, 0x2d, 0x72,
  0x65, 0x63, 0x74, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x29, 0x2c, 0x0a, 0x09,
  0x09, 0x09, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x59, 0x20, 0x3d, 0x20, 0x63,
  0x61, 0x6e, 0x76, 0x61, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74,
  0x20, 0x2f, 0x20, 0x28, 0x72, 0x65, 0x63, 0x74, 0x2e, 0x62, 0x6f, 0x74,
  0x74, 0x6f, 0x6d, 0x2d, 0x72, 0x65, 0x63, 0x74, 0x2e, 0x74, 0x6f, 0x70,
  0x29, 0x3b, 0x0a, 0x09, 0x09, 0x0a, 0x09, 0x09, 0x76, 0x61, 0x72, 0x20,
  0x70, 0x20, 0x3d, 0x20, 0x65, 0x76, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67,
  0x65, 0x64, 0x54, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x73, 0x20, 0x3f, 0x20,
  0x65, 0x76, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x54, 0x6f,
  0x75, 0x63, 0x68, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x20, 0x3a, 0x20, 0x65,
  0x76, 0x3b, 0x0a, 0x09, 0x09, 0x76, 0x61, 0x72, 0x20, 0x78, 0x20, 0x3d,
  0x20, 0x28, 0x70, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x58, 0x20,
  0x2d, 0x20, 0x72, 0x65, 0x63, 0x74, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x29,
  0x20, 0x2a, 0x20, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x58, 0x2c, 0x0a, 0x09,
  0x09, 0x09, 0x79, 0x20, 0x3d, 0x20, 0x28, 0x70, 0x2e, 0x63, 0x6c, 0x69,
  0x65, 0x6e, 0x74, 0x59, 0x20, 0x2d, 0x20, 0x72, 0x65, 0x63, 0x74, 0x2e,
  0x74, 0x6f, 0x70, 0x29, 0x20, 0x2a, 0x20, 0x73, 0x63, 0x61, 0x6c, 0x65,
  0x59, 0x3b, 0x0a, 0x09, 0x7d, 0x0a, 0x0a, 0x09, 0x6d, 0x6f, 0x75, 0x73,
  0x65, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x46, 0x6c, 0x61,
  0x67, 0x73, 0x5b, 0x30, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x79, 0x70, 0x65,
  0x3b, 0x0a, 0x09, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61,
  0x54, 0x79, 0x70, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x5b, 0x31, 0x5d,
  0x20, 0x3d, 0x20, 0x28, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x7c, 0x7c,
  0x30, 0x29, 0x3b, 0x0a, 0x09, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x44, 0x61,
  0x74, 0x61, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x73, 0x5b, 0x30, 0x5d, 0x20,
  0x3d, 0x20, 0x78, 0x3b, 0x0a, 0x09, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x44,
  0x61, 0x74, 0x61, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x73, 0x5b, 0x31, 0x5d,
  0x20, 0x3d, 0x20, 0x79, 0x3b, 0x0a, 0x09, 0x0a, 0x09, 0x63, 0x6c, 0x69,
  0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x6e, 0x64, 0x28, 0x6d, 0x6f, 0x75,
  0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72,
  0x29, 0x3b, 0x0a, 0x09, 0x65, 0x76, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x65,
  0x6e, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x28, 0x29, 0x3b,
  0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x4b, 0x65, 0x79,
  0x62, 0x6f, 0x61, 0x72, 0x64, 0x0a, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77,
  0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73,
  0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x27, 0x6b, 0x65, 0x79, 0x64, 0x6f,
  0x77, 0x6e, 0x27, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
  0x6e, 0x28, 0x65, 0x76, 0x29, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64,
  0x4b, 0x65, 0x79, 0x28, 0x65, 0x76, 0x2c, 0x20, 0x4b, 0x45, 0x59, 0x5f,
  0x44, 0x4f, 0x57, 0x4e, 0x2c, 0x20, 0x65, 0x76, 0x2e, 0x6b, 0x65, 0x79,
  0x43, 0x6f, 0x64, 0x65, 0x29, 0x3b, 0x20, 0x7d, 0x2c, 0x20, 0x66, 0x61,
  0x6c, 0x73, 0x65, 0x20, 0x29, 0x3b, 0x0a, 0x77, 0x69, 0x6e, 0x64, 0x6f,
  0x77, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69,
  0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x27, 0x6b, 0x65, 0x79, 0x75,
  0x70, 0x27, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
  0x28, 0x65, 0x76, 0x29, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x4b,
  0x65, 0x79, 0x28, 0x65, 0x76, 0x2c, 0x20, 0x4b, 0x45, 0x59, 0x5f, 0x55,
  0x50, 0x2c, 0x20, 0x65, 0x76, 0x2e, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x64,
  0x65, 0x29, 0x3b, 0x20, 0x7d, 0x2c, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65,
  0x20, 0x29, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x4d, 0x6f, 0x75, 0x73,
  0x65, 0x0a, 0x63, 0x61, 0x6e, 0x76, 0x61, 0x73, 0x2e, 0x61, 0x64, 0x64,
  0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65,
  0x72, 0x28, 0x27, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6d, 0x6f, 0x76, 0x65,
  0x27, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
  0x65, 0x76, 0x29, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x4d, 0x6f,
  0x75, 0x73, 0x65, 0x28, 0x65, 0x76, 0x2c, 0x20, 0x6e, 0x75, 0x6c, 0x6c,
  0x29, 0x3b, 0x20, 0x7d, 0x2c, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29,
  0x3b, 0x0a, 0x63, 0x61, 0x6e, 0x76, 0x61, 0x73, 0x2e, 0x61, 0x64, 0x64,
  0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65,
  0x72, 0x28, 0x27, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x64, 0x6f, 0x77, 0x6e,
  0x27, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
  0x65, 0x76, 0x29, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x4d, 0x6f,
  0x75, 0x73, 0x65, 0x28, 0x65, 0x76, 0x2c, 0x20, 0x65, 0x76, 0x2e, 0x62,
  0x75, 0x74, 0x74, 0x6f, 0x6e, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x20, 0x3f,
  0x20, 0x4d, 0x4f, 0x55, 0x53, 0x45, 0x5f, 0x32, 0x5f, 0x44, 0x4f, 0x57,
  0x4e, 0x20, 0x3a, 0x20, 0x4d, 0x4f, 0x55, 0x53, 0x45, 0x5f, 0x31, 0x5f,
  0x44, 0x4f, 0x57, 0x4e, 0x29, 0x3b, 0x20, 0x7d, 0x2c, 0x20, 0x66, 0x61,
  0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x63, 0x61, 0x6e, 0x76, 0x61, 0x73,
  0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73,
  0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x27, 0x6d, 0x6f, 0x75, 0x73, 0x65,
  0x75, 0x70, 0x27, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
  0x6e, 0x28, 0x65, 0x76, 0x29, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64,
  0x4d, 0x6f, 0x75, 0x73, 0x65, 0x28, 0x65, 0x76, 0x2c, 0x20, 0x65, 0x76,
  0x2e, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x20, 0x3d, 0x3d, 0x20, 0x32,
  0x20, 0x3f, 0x20, 0x4d, 0x4f, 0x55, 0x53, 0x45, 0x5f, 0x32, 0x5f, 0x55,
  0x50, 0x20, 0x3a, 0x20, 0x4d, 0x4f, 0x55, 0x53, 0x45, 0x5f, 0x31, 0x5f,
  0x55, 0x50, 0x29, 0x3b, 0x20, 0x7d, 0x2c, 0x20, 0x66, 0x61, 0x6c, 0x73,
  0x65, 0x29, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x6f, 0x75, 0x63,
  0x68, 0x0a, 0x63, 0x61, 0x6e, 0x76, 0x61, 0x73, 0x2e, 0x61, 0x64, 0x64,
  0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65,
  0x72, 0x28, 0x27, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x73, 0x74, 0x61, 0x72,
  0x74, 0x27, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
  0x28, 0x65, 0x76, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74,
  0x4d, 0x6f, 0x75, 0x73, 0x65, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x65, 0x76,
  0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x54, 0x6f, 0x75, 0x63,
  0x68, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e,
  0x74, 0x58, 0x3b, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x75,
  0x73, 0x65, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x65, 0x76, 0x2e, 0x63, 0x68,
  0x61, 0x6e, 0x67, 0x65, 0x64, 0x54, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x73,
  0x5b, 0x30, 0x5d, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x59, 0x3b,
  0x0a, 0x09, 0x73, 0x65, 0x6e, 0x64, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x28,
  0x65, 0x76, 0x2c, 0x20, 0x4d, 0x4f, 0x55, 0x53, 0x45, 0x5f, 0x31, 0x5f,
  0x44, 0x4f, 0x57, 0x4e, 0x29, 0x3b, 0x0a, 0x7d, 0x2c, 0x20, 0x66, 0x61,
  0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x63, 0x61, 0x6e, 0x76, 0x61, 0x73,
  0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73,
  0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x27, 0x74, 0x6f, 0x75, 0x63, 0x68,
  0x65, 0x6e, 0x64, 0x27, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
  0x6f, 0x6e, 0x28, 0x65, 0x76, 0x29, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e,
  0x64, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x28, 0x65, 0x76, 0x2c, 0x20, 0x4d,
  0x4f, 0x55, 0x53, 0x45, 0x5f, 0x31, 0x5f, 0x55, 0x50, 0x29, 0x3b, 0x20,
  0x7d, 0x2c, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x63,
  0x61, 0x6e, 0x76, 0x61, 0x73, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65,
  0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x27,
  0x74, 0x6f, 0x75, 0x63, 0x68, 0x6d, 0x6f, 0x76, 0x65, 0x27, 0x2c, 0x20,
  0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x76, 0x29,
  0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x4d, 0x6f, 0x75, 0x73, 0x65,
  0x28, 0x65, 0x76, 0x2c, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x3b, 0x20,
  0x7d, 0x2c, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x0a,
  0x2f, 0x2f, 0x20, 0x54, 0x6f, 0x75, 0x63, 0x68, 0x20, 0x62, 0x75, 0x74,
  0x74, 0x6f, 0x6e, 0x73, 0x20, 0x65, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69,
  0x6e, 0x67, 0x20, 0x6b, 0x65, 0x79, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x20,
  0x6b, 0x65, 0x79, 0x73, 0x0a, 0x76, 0x61, 0x72, 0x20, 0x64, 0x65, 0x66,
  0x69, 0x6e, 0x65, 0x54, 0x6f, 0x75, 0x63, 0x68, 0x42, 0x75, 0x74, 0x74,
  0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
  0x6e, 0x28, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x20, 0x6b,
  0x65, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x65,
  0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76,
  0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28,
  0x27, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x73, 0x74, 0x61, 0x72, 0x74, 0x27,
  0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65,
  0x76, 0x29, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x4b, 0x65, 0x79,
  0x28, 0x65, 0x76, 0x2c, 0x20, 0x4b, 0x45, 0x59, 0x5f, 0x44, 0x4f, 0x57,
  0x4e, 0x2c, 0x20, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x29, 0x3b,
  0x20, 0x7d, 0x2c, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a,
  0x09, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x64, 0x64,
  0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65,
  0x72, 0x28, 0x27, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x6e, 0x64, 0x27,
  0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65,
  0x76, 0x29, 0x20, 0x7b, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x4b, 0x65, 0x79,
  0x28, 0x65, 0x76, 0x2c, 0x20, 0x4b, 0x45, 0x59, 0x5f, 0x55, 0x50, 0x2c,
  0x20, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x29, 0x3b, 0x20, 0x7d,
  0x2c, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x7d, 0x3b,
  0x0a, 0x0a, 0x76, 0x61, 0x72, 0x20, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x4b,
  0x65, 0x79, 0x73, 0x20, 0x3d, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
  0x6e, 0x74, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6c, 0x65,
  0x63, 0x74, 0x6f, 0x72, 0x41, 0x6c, 0x6c, 0x28, 0x27, 0x2e, 0x6b, 0x65,
  0x79, 0x27, 0x29, 0x3b, 0x0a, 0x66, 0x6f, 0x72, 0x28, 0x20, 0x76, 0x61,
  0x72, 0x20, 0x69, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x20, 0x69, 0x20, 0x3c,
  0x20, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x73, 0x2e, 0x6c,
  0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x20, 0x69, 0x2b, 0x2b, 0x20, 0x29,
  0x20, 0x7b, 0x0a, 0x09, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x54, 0x6f,
  0x75, 0x63, 0x68, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x28, 0x74, 0x6f,
  0x75, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x73, 0x5b, 0x69, 0x5d, 0x2c, 0x20,
  0x74, 0x6f, 0x75, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x73, 0x5b, 0x69, 0x5d,
  0x2e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x64,
  0x65, 0x29, 0x3b, 0x0a, 0x7d, 0x0a
};

static const struct {
    const char *name;
    int length;
    const unsigned char *data;
} JSMPEG_files[] = {
    {
        "index.html",
        sizeof(JSMPEG_file_1),
        JSMPEG_file_1
    },
    {
        "jsmpg.js",
        sizeof(JSMPEG_file_2),
        JSMPEG_file_2
    },
    {
        "jsmpg-vnc.js",
        sizeof(JSMPEG_file_3),
        JSMPEG_file_3
    },
    { NULL, 0, NULL }
};

Changes to jni/SDL2/src/video/jsmpeg/genfiles.sh.

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
    xxd -i < $i
    echo '};'
    echo
    count=$(expr $count + 1)
done >> SDL_jsmpeg_files.h

cat >> SDL_jsmpeg_files.h <<'EOF'
static struct {
    const char *name;
    int length;
    const unsigned char *data;
} JSMPEG_files[] = {
EOF

count=1
for i in $FILES ; do
    echo '{'
    echo '  "'$(basename $i)'",'
    echo '  sizeof(JSMPEG_file_'$count'),'
    echo '  JSMPEG_file_'$count
    echo '},'
    count=$(expr $count + 1)
done >> SDL_jsmpeg_files.h
echo '{ NULL, 0, NULL }' >> SDL_jsmpeg_files.h
echo '};' >> SDL_jsmpeg_files.h
echo  >> SDL_jsmpeg_files.h
exit 0







|








|
|
|
|
|


|



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
    xxd -i < $i
    echo '};'
    echo
    count=$(expr $count + 1)
done >> SDL_jsmpeg_files.h

cat >> SDL_jsmpeg_files.h <<'EOF'
static const struct {
    const char *name;
    int length;
    const unsigned char *data;
} JSMPEG_files[] = {
EOF

count=1
for i in $FILES ; do
    echo '    {'
    echo '        "'$(basename $i)'",'
    echo '        sizeof(JSMPEG_file_'$count'),'
    echo '        JSMPEG_file_'$count
    echo '    },'
    count=$(expr $count + 1)
done >> SDL_jsmpeg_files.h
echo '    { NULL, 0, NULL }' >> SDL_jsmpeg_files.h
echo '};' >> SDL_jsmpeg_files.h
echo  >> SDL_jsmpeg_files.h
exit 0

Changes to jni/sdl2tk/sdl/SdlTkX.c.

5438
5439
5440
5441
5442
5443
5444


5445
5446
5447
5448
5449
5450
5451
....
5557
5558
5559
5560
5561
5562
5563









5564
5565
5566
5567
5568
5569
5570
    int initMask = SDL_INIT_VIDEO | SDL_INIT_JOYSTICK;
#ifndef ANDROID
    int tfmt = SDL_PIXELFORMAT_RGB888;
#endif
#ifdef linux
    int setQuit = 0, checkInput = 0;
    char *p;


#endif
    XGCValues values;

#ifdef AGG_CUSTOM_ALLOCATOR
    /* Init AGG custom allocator functions. */
    agg_custom_alloc = (void *(*)(unsigned int)) Tcl_Alloc;
    agg_custom_free = (void (*)(void *)) Tcl_Free;
................................................................................
	SdlTkX.arg_nogl = 1;
	SdlTkX.arg_swcursor = 1;
    }
    if (CheckGroups(checkInput) < 0) {
	SDL_LogCritical(SDL_LOG_CATEGORY_APPLICATION,
			"Permission problem, exiting");
	goto fatal;









    }
#endif
    SDL_SetHint(SDL_HINT_NO_SIGNAL_HANDLERS, "1");
retryInit:
#endif
    if (SDL_Init(initMask) < 0) {
#ifdef ANDROID







>
>







 







>
>
>
>
>
>
>
>
>







5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
....
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
    int initMask = SDL_INIT_VIDEO | SDL_INIT_JOYSTICK;
#ifndef ANDROID
    int tfmt = SDL_PIXELFORMAT_RGB888;
#endif
#ifdef linux
    int setQuit = 0, checkInput = 0;
    char *p;
#elif defined(__APPLE__)
    char *p;
#endif
    XGCValues values;

#ifdef AGG_CUSTOM_ALLOCATOR
    /* Init AGG custom allocator functions. */
    agg_custom_alloc = (void *(*)(unsigned int)) Tcl_Alloc;
    agg_custom_free = (void (*)(void *)) Tcl_Free;
................................................................................
	SdlTkX.arg_nogl = 1;
	SdlTkX.arg_swcursor = 1;
    }
    if (CheckGroups(checkInput) < 0) {
	SDL_LogCritical(SDL_LOG_CATEGORY_APPLICATION,
			"Permission problem, exiting");
	goto fatal;
    }
#elif defined(__APPLE__)
    p = getenv("SDL_VIDEODRIVER");
    if ((p != NULL) && (p[0] != '\0')) {
	if (strcmp(p, "jsmpeg") == 0) {
	    SdlTkX.arg_nogl = 1;
	    SdlTkX.arg_swcursor = 1;
	    setenv("SDL_RENDER_DRIVER", "software", 1);
	}
    }
#endif
    SDL_SetHint(SDL_HINT_NO_SIGNAL_HANDLERS, "1");
retryInit:
#endif
    if (SDL_Init(initMask) < 0) {
#ifdef ANDROID

Changes to undroid/README.txt.

83
84
85
86
87
88
89

90
91
92
93
94
95
96
...
109
110
111
112
113
114
115

116

117
118
119
120
populated by the "init" action. The disk space needed for a full build per
platform is 700 to 900 MByte on a Linux development system.

On Debian GNU/Linux and derivates, these packages should be present for
building (more may be required):

    bc

    libasound2-dev
    libaugeas-dev
    libcairo2-dev
    libdbus-1-dev
    libfontconfig1-dev
    libfreetype6-dev
    libgbm-dev
................................................................................
    zip
    zlib1g-dev

On MacOSX these homebrew packages are needed for building (more may be
required):

    augeas

    dbus

    libusb
    nasm
    pkgconfig








>







 







>

>




83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
...
110
111
112
113
114
115
116
117
118
119
120
121
122
123
populated by the "init" action. The disk space needed for a full build per
platform is 700 to 900 MByte on a Linux development system.

On Debian GNU/Linux and derivates, these packages should be present for
building (more may be required):

    bc
    cmake
    libasound2-dev
    libaugeas-dev
    libcairo2-dev
    libdbus-1-dev
    libfontconfig1-dev
    libfreetype6-dev
    libgbm-dev
................................................................................
    zip
    zlib1g-dev

On MacOSX these homebrew packages are needed for building (more may be
required):

    augeas
    cmake
    dbus
    ffmpeg
    libusb
    nasm
    pkgconfig

Changes to undroid/build-undroidwish-kmsdrm.sh.

600
601
602
603
604
605
606

607
608
609
610
611
612
613
(
  exec 3>&1
  exec >> build.log 2>&1
  CC="$CC -fPIC"
  CXX="$CXX -fPIC"
  mkdir -p libwebsockets/build
  cd libwebsockets/build

  cmake .. -DCMAKE_INSTALL_PREFIX=${PFX_HERE}/extra \
    -DLWS_IPV6=ON -DLWS_WITH_SHARED=OFF -DLWS_WITH_SSL=OFF || exit 1
  make VERBOSE=1 COLOR=0 || exit 1
  make VERBOSE=1 COLOR=0 install || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail







>







600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
(
  exec 3>&1
  exec >> build.log 2>&1
  CC="$CC -fPIC"
  CXX="$CXX -fPIC"
  mkdir -p libwebsockets/build
  cd libwebsockets/build
  test -e build-stamp && echo >&3 "already done" && exit 0
  cmake .. -DCMAKE_INSTALL_PREFIX=${PFX_HERE}/extra \
    -DLWS_IPV6=ON -DLWS_WITH_SHARED=OFF -DLWS_WITH_SSL=OFF || exit 1
  make VERBOSE=1 COLOR=0 || exit 1
  make VERBOSE=1 COLOR=0 install || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

Changes to undroid/build-undroidwish-macosx.sh.

77
78
79
80
81
82
83
84

85
86
87
88
89
90
91
...
127
128
129
130
131
132
133



134
135
136
137
138
139
140
...
239
240
241
242
243
244
245






246
247
248
249
250
251
252
...
542
543
544
545
546
547
548

















549
550
551
552
553
554
555
556
557

558
559
560
561
562
563
564
565
566
567
568
569
CC="cc -DTCL_UTF_MAX=6"
CXX="c++ -fno-exceptions -fno-rtti -DTCL_UTF_MAX=6"
NM=nm
# RPATH for binaries
ADD_RPATH="/Applications/VLC.app/Contents/MacOS/lib"
export STRIP AR RANLIB CC CXX RC NM ADD_RPATH

SUBDIRS="tcl libressl zlib curl tcludp tdom tclvfs tclkit trofs tbcload tls"

SUBDIRS="${SUBDIRS} Memchan TclCurl freetype SDL2 sdl2tk blt jpeg-turbo"
SUBDIRS="${SUBDIRS} 3dcanvas tkimg trf tktable tktreectrl tkpath itk tkhtml"
SUBDIRS="${SUBDIRS} dbus-tcl dbus-intf tclx libdmtx ZBar zint tcl-augeas"
SUBDIRS="${SUBDIRS} snack tkvnc tksvg VecTcl tclral"
SUBDIRS="${SUBDIRS} tclepeg tcluvc xotcl nsf vu rl_json mpexpr"
SUBDIRS="${SUBDIRS} tclcsv tkzinc libffi ffidl tcl-lmdb DiffUtilTcl"
SUBDIRS="${SUBDIRS} tclparser tclcompiler tserialport topcua parse_args tkvlc"
................................................................................
      xotcl|nsf)
        rm -f ${i}/*.o ${i}/generic/stubs*/*.o
        rm -f ${i}/build-stamp
        ;;
      mpexpr)
        rm -f ${i}/unix/build-stamp
        ;;



      *)
        rm -f ${i}/build-stamp
        ;;
     esac
  done
}

................................................................................
        ;;
      tdom)
        (
          exec >> build.log 2>&1
          make -C tdom ${ACTION} || true
          make -C tdom/extensions/tnc ${ACTION} || true
        ) || true






        ;;
      *)
        (
          exec >> build.log 2>&1
          make -C $i ${ACTION} || true
        ) || true
        ;;
................................................................................
  perl -ni -e 'print unless /t42_driver/' objs/ftmodule.h
  perl -ni -e 'print unless /winfnt_driver/' objs/ftmodule.h
  make || exit 1
  make install || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail


















echo -n "build SDL2 (static, pic) ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  CC="$CC -fPIC"
  CXX="$CXX -fPIC"
  cd SDL2
  test -e build-stamp && echo >&3 "already done" && exit 0

  ./configure --prefix=${PFX_HERE} \
      --disable-shared --disable-arts --disable-esd --disable-nas \
      --disable-ibus --enable-alsa --disable-video-x11 \
      --disable-rpath --disable-video-opengles2 \
      --disable-video-vulkan || exit 1
  make || exit 1
  make install || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build Tk (SDL2 backend, static) ... "







|
>







 







>
>
>







 







>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>









>
|



|







77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
...
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
...
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
...
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
CC="cc -DTCL_UTF_MAX=6"
CXX="c++ -fno-exceptions -fno-rtti -DTCL_UTF_MAX=6"
NM=nm
# RPATH for binaries
ADD_RPATH="/Applications/VLC.app/Contents/MacOS/lib"
export STRIP AR RANLIB CC CXX RC NM ADD_RPATH

SUBDIRS="tcl libressl zlib curl tcludp tdom tclvfs tclkit trofs tbcload"
SUBDIRS="${SUBDIRS} tls libwebsockets"
SUBDIRS="${SUBDIRS} Memchan TclCurl freetype SDL2 sdl2tk blt jpeg-turbo"
SUBDIRS="${SUBDIRS} 3dcanvas tkimg trf tktable tktreectrl tkpath itk tkhtml"
SUBDIRS="${SUBDIRS} dbus-tcl dbus-intf tclx libdmtx ZBar zint tcl-augeas"
SUBDIRS="${SUBDIRS} snack tkvnc tksvg VecTcl tclral"
SUBDIRS="${SUBDIRS} tclepeg tcluvc xotcl nsf vu rl_json mpexpr"
SUBDIRS="${SUBDIRS} tclcsv tkzinc libffi ffidl tcl-lmdb DiffUtilTcl"
SUBDIRS="${SUBDIRS} tclparser tclcompiler tserialport topcua parse_args tkvlc"
................................................................................
      xotcl|nsf)
        rm -f ${i}/*.o ${i}/generic/stubs*/*.o
        rm -f ${i}/build-stamp
        ;;
      mpexpr)
        rm -f ${i}/unix/build-stamp
        ;;
      libwebsockets)
        rm -f ${i}/build/build-stamp
        ;;
      *)
        rm -f ${i}/build-stamp
        ;;
     esac
  done
}

................................................................................
        ;;
      tdom)
        (
          exec >> build.log 2>&1
          make -C tdom ${ACTION} || true
          make -C tdom/extensions/tnc ${ACTION} || true
        ) || true
        ;;
      libwebsockets)
        (
          exec >> build.log 2>&1
          rm -rf libwebsockets/build
        ) || true
        ;;
      *)
        (
          exec >> build.log 2>&1
          make -C $i ${ACTION} || true
        ) || true
        ;;
................................................................................
  perl -ni -e 'print unless /t42_driver/' objs/ftmodule.h
  perl -ni -e 'print unless /winfnt_driver/' objs/ftmodule.h
  make || exit 1
  make install || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build libwebsockets (static, pic) ..."
(
  exec 3>&1
  exec >> build.log 2>&1
  CC="$CC -fPIC"
  CXX="$CXX -fPIC"
  mkdir -p libwebsockets/build
  cd libwebsockets/build
  test -e build-stamp && echo >&3 "already done" && exit 0
  cmake .. -DCMAKE_INSTALL_PREFIX=${PFX_HERE}/extra \
    -DLWS_IPV6=ON -DLWS_WITH_SHARED=OFF -DLWS_WITH_SSL=OFF || exit 1
  make VERBOSE=1 COLOR=0 || exit 1
  make VERBOSE=1 COLOR=0 install || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build SDL2 (static, pic) ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  CC="$CC -fPIC"
  CXX="$CXX -fPIC"
  cd SDL2
  test -e build-stamp && echo >&3 "already done" && exit 0
  PKG_CONFIG_PATH=${PFX_HERE}/extra/lib/pkgconfig \
    ./configure --prefix=${PFX_HERE} \
      --disable-shared --disable-arts --disable-esd --disable-nas \
      --disable-ibus --enable-alsa --disable-video-x11 \
      --disable-rpath --disable-video-opengles2 \
      --disable-video-vulkan --enable-video-jsmpeg || exit 1
  make || exit 1
  make install || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build Tk (SDL2 backend, static) ... "

Changes to undroid/build-undroidwish-wayland.sh.

600
601
602
603
604
605
606

607
608
609
610
611
612
613
(
  exec 3>&1
  exec >> build.log 2>&1
  CC="$CC -fPIC"
  CXX="$CXX -fPIC"
  mkdir -p libwebsockets/build
  cd libwebsockets/build

  cmake .. -DCMAKE_INSTALL_PREFIX=${PFX_HERE}/extra \
    -DLWS_IPV6=ON -DLWS_WITH_SHARED=OFF -DLWS_WITH_SSL=OFF || exit 1
  make VERBOSE=1 COLOR=0 || exit 1
  make VERBOSE=1 COLOR=0 install || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail







>







600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
(
  exec 3>&1
  exec >> build.log 2>&1
  CC="$CC -fPIC"
  CXX="$CXX -fPIC"
  mkdir -p libwebsockets/build
  cd libwebsockets/build
  test -e build-stamp && echo >&3 "already done" && exit 0
  cmake .. -DCMAKE_INSTALL_PREFIX=${PFX_HERE}/extra \
    -DLWS_IPV6=ON -DLWS_WITH_SHARED=OFF -DLWS_WITH_SSL=OFF || exit 1
  make VERBOSE=1 COLOR=0 || exit 1
  make VERBOSE=1 COLOR=0 install || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail