[
  {
    "path": ".github/workflows/dco.yml",
    "content": "# .github/workflows/dco.yml\nname: DCO\non:\n  pull_request:\n  push:\n    branches:\n      - main\njobs:\n  check:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v3\n    - name: Set up Python 3.x\n      uses: actions/setup-python@v4\n      with:\n        python-version: '3.x'\n    - name: Check DCO\n      env:\n        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      run: |\n        pip3 install -U dco-check\n        dco-check\n"
  },
  {
    "path": ".gitignore",
    "content": "/OSXvnc.xcodeproj/project.xcworkspace\n/OSXvnc.xcodeproj/xcuserdata/\n\n# xcodebuild -configuration Deployment\n/build\n"
  },
  {
    "path": ".gitmodules",
    "content": "[submodule \"libjpeg-turbo\"]\n\tpath = libjpeg-turbo\n\turl = https://github.com/libjpeg-turbo/libjpeg-turbo.git\n"
  },
  {
    "path": ".travis.yml",
    "content": "# Travis CI for OSXvnc.\n\nos: osx\nosx_image: xcode12.2\n\naddons:\nbefore_deploy:\nbefore_install:\nbranches:\ncompiler:\ndeploy:\ndist:\nmatrix:\nnotification:\nsudo:\n  # TODO\n\ninstall:\n  # libjpeg is already installed.\n  # - brew install libjpeg\n  # Patch project configuration to use installed libjpeg.\n  - ruby -pi -e 'gsub(\"libturbojpeg\", \"libjpeg\")' OSXvnc.xcodeproj/project.pbxproj\n  - ruby -pi -e 'gsub(\"/opt/libjpeg-turbo\", \"/usr/local\")' OSXvnc.xcodeproj/project.pbxproj\n\nscript:\n  - ./build-libjpeg-turbo.sh\n  - xcodebuild\n"
  },
  {
    "path": "Base.lproj/MainMenu.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.Cocoa.XIB\" version=\"3.0\" toolsVersion=\"8191\" systemVersion=\"15A284\" targetRuntime=\"MacOSX.Cocoa\" propertyAccessControl=\"none\">\n    <dependencies>\n        <deployment identifier=\"macosx\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.CocoaPlugin\" version=\"8191\"/>\n        <capability name=\"box content view\" minToolsVersion=\"7.0\"/>\n    </dependencies>\n    <objects>\n        <customObject id=\"-2\" userLabel=\"File's Owner\" customClass=\"NSApplication\">\n            <connections>\n                <outlet property=\"delegate\" destination=\"1668\" id=\"1783\"/>\n                <outlet property=\"dockMenu\" destination=\"1669\" id=\"1784\"/>\n            </connections>\n        </customObject>\n        <customObject id=\"-1\" userLabel=\"First Responder\" customClass=\"FirstResponder\"/>\n        <customObject id=\"-3\" customClass=\"NSObject\"/>\n        <customObject id=\"1507\" customClass=\"NSApplication\"/>\n        <window title=\"Vine Server Preferences\" allowsToolTipsWhenApplicationIsInactive=\"NO\" autorecalculatesKeyViewLoop=\"NO\" deferred=\"NO\" oneShot=\"NO\" releasedWhenClosed=\"NO\" visibleAtLaunch=\"NO\" frameAutosaveName=\"Preferences\" animationBehavior=\"default\" id=\"1508\">\n            <windowStyleMask key=\"styleMask\" titled=\"YES\" closable=\"YES\" miniaturizable=\"YES\"/>\n            <windowPositionMask key=\"initialPositionMask\" leftStrut=\"YES\" rightStrut=\"YES\" topStrut=\"YES\" bottomStrut=\"YES\"/>\n            <rect key=\"contentRect\" x=\"601\" y=\"672\" width=\"434\" height=\"348\"/>\n            <rect key=\"screenRect\" x=\"0.0\" y=\"0.0\" width=\"2560\" height=\"1418\"/>\n            <value key=\"minSize\" type=\"size\" width=\"127\" height=\"5\"/>\n            <view key=\"contentView\" id=\"1509\">\n                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"434\" height=\"348\"/>\n                <autoresizingMask key=\"autoresizingMask\"/>\n                <subviews>\n                    <tabView id=\"1510\">\n                        <rect key=\"frame\" x=\"-10\" y=\"30\" width=\"452\" height=\"312\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" flexibleMinY=\"YES\"/>\n                        <animations/>\n                        <font key=\"font\" metaFont=\"system\"/>\n                        <tabViewItems>\n                            <tabViewItem label=\"Connection\" identifier=\"\" id=\"1511\">\n                                <view key=\"view\" id=\"1512\">\n                                    <rect key=\"frame\" x=\"10\" y=\"33\" width=\"432\" height=\"266\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                    <subviews>\n                                        <textField verticalHuggingPriority=\"750\" id=\"1513\">\n                                            <rect key=\"frame\" x=\"17\" y=\"195\" width=\"125\" height=\"19\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                            <string key=\"toolTip\">Display Number for VNC Server\nNote: This number+5900 is the port that will be used</string>\n                                            <animations/>\n                                            <textFieldCell key=\"cell\" sendsActionOnEndEditing=\"YES\" alignment=\"right\" title=\"Display Number:\" id=\"1514\">\n                                                <font key=\"font\" metaFont=\"system\"/>\n                                                <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                            </textFieldCell>\n                                        </textField>\n                                        <textField verticalHuggingPriority=\"750\" id=\"1998\">\n                                            <rect key=\"frame\" x=\"273\" y=\"197\" width=\"50\" height=\"19\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                            <string key=\"toolTip\">Display Number for VNC Server\nNote: This number+5900 is the port that will be used</string>\n                                            <animations/>\n                                            <textFieldCell key=\"cell\" sendsActionOnEndEditing=\"YES\" alignment=\"right\" title=\"Port:\" id=\"1999\">\n                                                <font key=\"font\" metaFont=\"system\"/>\n                                                <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                            </textFieldCell>\n                                        </textField>\n                                        <popUpButton verticalHuggingPriority=\"750\" id=\"1515\">\n                                            <rect key=\"frame\" x=\"144\" y=\"191\" width=\"94\" height=\"26\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" flexibleMinY=\"YES\"/>\n                                            <string key=\"toolTip\">Display Number for VNC Server\nNote: This number+5900 is the port that will be used</string>\n                                            <animations/>\n                                            <popUpButtonCell key=\"cell\" type=\"push\" title=\"Auto\" bezelStyle=\"rounded\" alignment=\"left\" lineBreakMode=\"clipping\" state=\"on\" borderStyle=\"borderAndBezel\" inset=\"2\" arrowPosition=\"arrowAtCenter\" preferredEdge=\"maxY\" selectedItem=\"1518\" id=\"1516\">\n                                                <behavior key=\"behavior\" pushIn=\"YES\" lightByBackground=\"YES\" lightByGray=\"YES\"/>\n                                                <font key=\"font\" metaFont=\"menu\"/>\n                                                <menu key=\"menu\" title=\"OtherViews\" id=\"1517\">\n                                                    <items>\n                                                        <menuItem title=\"Auto\" state=\"on\" id=\"1518\"/>\n                                                        <menuItem title=\"0\" tag=\"5900\" id=\"1519\"/>\n                                                        <menuItem title=\"1\" tag=\"5901\" id=\"1528\"/>\n                                                        <menuItem title=\"2\" tag=\"5902\" id=\"1527\"/>\n                                                        <menuItem title=\"3\" tag=\"5903\" id=\"1529\"/>\n                                                        <menuItem title=\"4\" tag=\"5904\" id=\"1526\"/>\n                                                        <menuItem title=\"5\" tag=\"5905\" id=\"1525\"/>\n                                                        <menuItem title=\"6\" tag=\"5906\" id=\"1524\"/>\n                                                        <menuItem title=\"7\" tag=\"5907\" id=\"1523\"/>\n                                                        <menuItem title=\"8\" tag=\"5908\" id=\"1522\"/>\n                                                        <menuItem title=\"9\" tag=\"5909\" id=\"1521\"/>\n                                                        <menuItem title=\"--\" tag=\"99\" id=\"1520\"/>\n                                                    </items>\n                                                </menu>\n                                            </popUpButtonCell>\n                                            <connections>\n                                                <action selector=\"changeDisplayNumber:\" target=\"1668\" id=\"1860\"/>\n                                            </connections>\n                                        </popUpButton>\n                                        <textField verticalHuggingPriority=\"750\" id=\"1530\">\n                                            <rect key=\"frame\" x=\"328\" y=\"194\" width=\"64\" height=\"22\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" flexibleMinX=\"YES\" flexibleMinY=\"YES\"/>\n                                            <string key=\"toolTip\">Port Number that VNC will use to  communicate.\nNote: Same as Display Number+5900\nNote: Same as Display Number+5900</string>\n                                            <animations/>\n                                            <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" selectable=\"YES\" editable=\"YES\" sendsActionOnEndEditing=\"YES\" state=\"on\" borderStyle=\"bezel\" alignment=\"left\" drawsBackground=\"YES\" id=\"1531\">\n                                                <font key=\"font\" metaFont=\"system\"/>\n                                                <color key=\"textColor\" name=\"textColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                <color key=\"backgroundColor\" name=\"textBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                            </textFieldCell>\n                                            <connections>\n                                                <action selector=\"changePort:\" target=\"1668\" id=\"1861\"/>\n                                            </connections>\n                                        </textField>\n                                        <textField toolTip=\"Name that the VNC viewer will see for this server.\" verticalHuggingPriority=\"750\" id=\"1534\">\n                                            <rect key=\"frame\" x=\"38\" y=\"223\" width=\"104\" height=\"20\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                            <animations/>\n                                            <textFieldCell key=\"cell\" sendsActionOnEndEditing=\"YES\" alignment=\"right\" title=\"Display Name:\" id=\"1535\">\n                                                <font key=\"font\" metaFont=\"system\"/>\n                                                <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                            </textFieldCell>\n                                        </textField>\n                                        <textField toolTip=\"Name that the VNC viewer will see for this server.\" verticalHuggingPriority=\"750\" id=\"1536\">\n                                            <rect key=\"frame\" x=\"147\" y=\"224\" width=\"245\" height=\"22\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" flexibleMinY=\"YES\"/>\n                                            <animations/>\n                                            <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" selectable=\"YES\" editable=\"YES\" sendsActionOnEndEditing=\"YES\" state=\"on\" borderStyle=\"bezel\" alignment=\"left\" title=\"Mac OS X\" drawsBackground=\"YES\" id=\"1537\">\n                                                <font key=\"font\" metaFont=\"system\"/>\n                                                <color key=\"textColor\" name=\"textColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                <color key=\"backgroundColor\" name=\"textBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                            </textFieldCell>\n                                            <connections>\n                                                <action selector=\"changeDisplayName:\" target=\"1668\" id=\"1862\"/>\n                                            </connections>\n                                        </textField>\n                                        <box title=\"Authentication\" id=\"1538\">\n                                            <rect key=\"frame\" x=\"29\" y=\"54\" width=\"366\" height=\"121\"/>\n                                            <autoresizingMask key=\"autoresizingMask\"/>\n                                            <view key=\"contentView\" id=\"NGi-6l-1cZ\">\n                                                <rect key=\"frame\" x=\"2\" y=\"2\" width=\"362\" height=\"104\"/>\n                                                <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                                <subviews>\n                                                    <textField verticalHuggingPriority=\"750\" id=\"1539\">\n                                                        <rect key=\"frame\" x=\"161\" y=\"72\" width=\"88\" height=\"22\"/>\n                                                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" flexibleMinY=\"YES\"/>\n                                                        <string key=\"toolTip\">Password required to connect with VNC Clients\nNote: Password length is not preserved</string>\n                                                        <animations/>\n                                                        <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" selectable=\"YES\" editable=\"YES\" sendsActionOnEndEditing=\"YES\" state=\"on\" borderStyle=\"bezel\" alignment=\"left\" drawsBackground=\"YES\" id=\"1540\">\n                                                            <font key=\"font\" metaFont=\"system\"/>\n                                                            <color key=\"textColor\" name=\"textColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                            <color key=\"backgroundColor\" name=\"textBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                        </textFieldCell>\n                                                        <connections>\n                                                            <action selector=\"changePassword:\" target=\"1668\" id=\"1863\"/>\n                                                            <outlet property=\"delegate\" destination=\"1668\" id=\"1787\"/>\n                                                        </connections>\n                                                    </textField>\n                                                    <matrix verticalHuggingPriority=\"750\" allowsEmptySelection=\"NO\" autosizesCells=\"NO\" id=\"1541\">\n                                                        <rect key=\"frame\" x=\"27\" y=\"53\" width=\"134\" height=\"38\"/>\n                                                        <autoresizingMask key=\"autoresizingMask\"/>\n                                                        <animations/>\n                                                        <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                        <size key=\"cellSize\" width=\"134\" height=\"18\"/>\n                                                        <size key=\"intercellSpacing\" width=\"4\" height=\"2\"/>\n                                                        <buttonCell key=\"prototype\" type=\"radio\" title=\"Radio\" imagePosition=\"left\" alignment=\"left\" inset=\"2\" id=\"1542\">\n                                                            <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                            <font key=\"font\" metaFont=\"system\"/>\n                                                        </buttonCell>\n                                                        <cells>\n                                                            <column>\n                                                                <buttonCell type=\"radio\" title=\"VNC Password\" imagePosition=\"left\" alignment=\"left\" state=\"on\" toolTip=\"Password required to connect with VNC Client\" tag=\"1\" inset=\"2\" id=\"1543\">\n                                                                    <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                                    <font key=\"font\" metaFont=\"system\"/>\n                                                                </buttonCell>\n                                                                <buttonCell type=\"radio\" title=\"None\" imagePosition=\"left\" alignment=\"left\" tag=\"2\" inset=\"2\" id=\"1544\">\n                                                                    <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                                    <font key=\"font\" metaFont=\"system\"/>\n                                                                </buttonCell>\n                                                            </column>\n                                                        </cells>\n                                                        <connections>\n                                                            <action selector=\"changeAuthenticationType:\" target=\"1668\" id=\"1906\"/>\n                                                        </connections>\n                                                    </matrix>\n                                                    <button id=\"1545\">\n                                                        <rect key=\"frame\" x=\"27\" y=\"9\" width=\"379\" height=\"18\"/>\n                                                        <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                                        <animations/>\n                                                        <buttonCell key=\"cell\" type=\"check\" title=\"Require Remote Login (SSH)\" bezelStyle=\"regularSquare\" imagePosition=\"left\" alignment=\"left\" inset=\"2\" id=\"1546\">\n                                                            <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                            <font key=\"font\" metaFont=\"system\"/>\n                                                        </buttonCell>\n                                                        <connections>\n                                                            <action selector=\"optionChanged:\" target=\"1668\" id=\"1877\"/>\n                                                        </connections>\n                                                    </button>\n                                                </subviews>\n                                                <animations/>\n                                            </view>\n                                            <animations/>\n                                            <color key=\"borderColor\" white=\"0.0\" alpha=\"0.41999999999999998\" colorSpace=\"calibratedWhite\"/>\n                                            <color key=\"fillColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"calibratedWhite\"/>\n                                        </box>\n                                    </subviews>\n                                    <animations/>\n                                </view>\n                                <connections>\n                                    <outlet property=\"initialFirstResponder\" destination=\"1536\" id=\"1846\"/>\n                                </connections>\n                            </tabViewItem>\n                            <tabViewItem label=\"Device\" identifier=\"\" id=\"1573\">\n                                <view key=\"view\" id=\"1574\">\n                                    <rect key=\"frame\" x=\"10\" y=\"33\" width=\"432\" height=\"266\"/>\n                                    <autoresizingMask key=\"autoresizingMask\"/>\n                                    <subviews>\n                                        <box title=\"Mouse\" id=\"1575\">\n                                            <rect key=\"frame\" x=\"19\" y=\"109\" width=\"392\" height=\"54\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" flexibleMinY=\"YES\"/>\n                                            <string key=\"toolTip\">Checking this box swaps the middle and right mouse buttons.  By convention the buttons sent by VNC client is in the opposite order as Mac OS X buttons.</string>\n                                            <view key=\"contentView\" id=\"vvI-AC-Rgd\">\n                                                <rect key=\"frame\" x=\"2\" y=\"2\" width=\"388\" height=\"37\"/>\n                                                <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                                <subviews>\n                                                    <button id=\"1576\">\n                                                        <rect key=\"frame\" x=\"12\" y=\"8\" width=\"208\" height=\"18\"/>\n                                                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" flexibleMinY=\"YES\"/>\n                                                        <animations/>\n                                                        <buttonCell key=\"cell\" type=\"check\" title=\"Swap Mouse Buttons 2 and 3\" bezelStyle=\"regularSquare\" imagePosition=\"left\" alignment=\"left\" state=\"on\" inset=\"2\" id=\"1577\">\n                                                            <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                            <font key=\"font\" metaFont=\"system\"/>\n                                                        </buttonCell>\n                                                        <connections>\n                                                            <action selector=\"optionChanged:\" target=\"1668\" id=\"1882\"/>\n                                                        </connections>\n                                                    </button>\n                                                </subviews>\n                                                <animations/>\n                                            </view>\n                                            <animations/>\n                                            <color key=\"borderColor\" white=\"0.0\" alpha=\"0.41999999999999998\" colorSpace=\"calibratedWhite\"/>\n                                            <color key=\"fillColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"calibratedWhite\"/>\n                                        </box>\n                                        <box title=\"Display\" id=\"1578\">\n                                            <rect key=\"frame\" x=\"19\" y=\"162\" width=\"392\" height=\"98\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" flexibleMinY=\"YES\"/>\n                                            <view key=\"contentView\" id=\"IqN-to-8QS\">\n                                                <rect key=\"frame\" x=\"2\" y=\"2\" width=\"388\" height=\"81\"/>\n                                                <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                                <subviews>\n                                                    <button id=\"1579\">\n                                                        <rect key=\"frame\" x=\"12\" y=\"51\" width=\"175\" height=\"18\"/>\n                                                        <autoresizingMask key=\"autoresizingMask\"/>\n                                                        <string key=\"toolTip\">Enable this if you want to allow the machine to sleep.\nSleeping machines can not be reached by VNC.</string>\n                                                        <animations/>\n                                                        <buttonCell key=\"cell\" type=\"check\" title=\"Allow machine to sleep\" bezelStyle=\"regularSquare\" imagePosition=\"left\" alignment=\"left\" inset=\"2\" id=\"1580\">\n                                                            <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                            <font key=\"font\" metaFont=\"system\"/>\n                                                        </buttonCell>\n                                                        <connections>\n                                                            <action selector=\"optionChanged:\" target=\"1668\" id=\"1880\"/>\n                                                        </connections>\n                                                    </button>\n                                                    <button id=\"1581\">\n                                                        <rect key=\"frame\" x=\"12\" y=\"31\" width=\"181\" height=\"18\"/>\n                                                        <autoresizingMask key=\"autoresizingMask\"/>\n                                                        <string key=\"toolTip\">Enable this to prevent the screen from dimming while clients are connected.\nAny Input will un-dim the screen.</string>\n                                                        <animations/>\n                                                        <buttonCell key=\"cell\" type=\"check\" title=\"Allow display dimming\" bezelStyle=\"regularSquare\" imagePosition=\"left\" alignment=\"left\" state=\"on\" inset=\"2\" id=\"1582\">\n                                                            <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                            <font key=\"font\" metaFont=\"system\"/>\n                                                        </buttonCell>\n                                                        <connections>\n                                                            <action selector=\"optionChanged:\" target=\"1668\" id=\"1881\"/>\n                                                        </connections>\n                                                    </button>\n                                                    <button toolTip=\"Enable this to allow the screen saver to turn on when clients are connected.\" id=\"1583\">\n                                                        <rect key=\"frame\" x=\"12\" y=\"11\" width=\"200\" height=\"18\"/>\n                                                        <autoresizingMask key=\"autoresizingMask\"/>\n                                                        <animations/>\n                                                        <buttonCell key=\"cell\" type=\"check\" title=\"Allow screen saver to start\" bezelStyle=\"regularSquare\" imagePosition=\"left\" alignment=\"left\" state=\"on\" inset=\"2\" id=\"1584\">\n                                                            <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                            <font key=\"font\" metaFont=\"system\"/>\n                                                        </buttonCell>\n                                                        <connections>\n                                                            <action selector=\"optionChanged:\" target=\"1668\" id=\"1889\"/>\n                                                        </connections>\n                                                    </button>\n                                                </subviews>\n                                                <animations/>\n                                            </view>\n                                            <animations/>\n                                            <color key=\"borderColor\" white=\"0.0\" alpha=\"0.41999999999999998\" colorSpace=\"calibratedWhite\"/>\n                                            <color key=\"fillColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"calibratedWhite\"/>\n                                        </box>\n                                        <box toolTip=\"The keyboard layout that Vine Server uses to interpret keystrokes from a VNC viewer.\" title=\"Keyboard (Mac OS X 10.4 and later)\" id=\"1585\">\n                                            <rect key=\"frame\" x=\"19\" y=\"44\" width=\"392\" height=\"61\"/>\n                                            <autoresizingMask key=\"autoresizingMask\"/>\n                                            <view key=\"contentView\" id=\"GdF-Jl-94f\">\n                                                <rect key=\"frame\" x=\"2\" y=\"2\" width=\"388\" height=\"44\"/>\n                                                <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                                <subviews>\n                                                    <popUpButton toolTip=\"The keyboard layout that Vine Server uses to interpret keystrokes from a VNC viewer.\" verticalHuggingPriority=\"750\" id=\"1586\">\n                                                        <rect key=\"frame\" x=\"156\" y=\"9\" width=\"219\" height=\"26\"/>\n                                                        <autoresizingMask key=\"autoresizingMask\"/>\n                                                        <animations/>\n                                                        <popUpButtonCell key=\"cell\" type=\"push\" title=\"U.S.\" bezelStyle=\"rounded\" alignment=\"left\" lineBreakMode=\"truncatingTail\" state=\"on\" borderStyle=\"borderAndBezel\" inset=\"2\" arrowPosition=\"arrowAtCenter\" preferredEdge=\"maxY\" selectedItem=\"1591\" id=\"1587\">\n                                                            <behavior key=\"behavior\" lightByBackground=\"YES\" lightByGray=\"YES\"/>\n                                                            <font key=\"font\" metaFont=\"menu\"/>\n                                                            <menu key=\"menu\" title=\"OtherViews\" id=\"1588\">\n                                                                <items>\n                                                                    <menuItem title=\"U.S.\" state=\"on\" id=\"1591\"/>\n                                                                    <menuItem title=\"Unicode Hex Input\" tag=\"2\" id=\"1589\"/>\n                                                                    <menuItem title=\"Current Keyboard\" tag=\"1\" id=\"1590\"/>\n                                                                </items>\n                                                            </menu>\n                                                        </popUpButtonCell>\n                                                        <connections>\n                                                            <action selector=\"optionChanged:\" target=\"1668\" id=\"1892\"/>\n                                                        </connections>\n                                                    </popUpButton>\n                                                    <textField verticalHuggingPriority=\"750\" id=\"1592\">\n                                                        <rect key=\"frame\" x=\"13\" y=\"15\" width=\"114\" height=\"17\"/>\n                                                        <autoresizingMask key=\"autoresizingMask\"/>\n                                                        <animations/>\n                                                        <textFieldCell key=\"cell\" sendsActionOnEndEditing=\"YES\" title=\"Keyboard Layout:\" id=\"1593\">\n                                                            <font key=\"font\" metaFont=\"system\"/>\n                                                            <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                            <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                        </textFieldCell>\n                                                    </textField>\n                                                </subviews>\n                                                <animations/>\n                                            </view>\n                                            <animations/>\n                                            <color key=\"borderColor\" white=\"0.0\" alpha=\"0.41999999999999998\" colorSpace=\"calibratedWhite\"/>\n                                            <color key=\"fillColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"calibratedWhite\"/>\n                                        </box>\n                                    </subviews>\n                                    <animations/>\n                                </view>\n                            </tabViewItem>\n                            <tabViewItem label=\"Sharing\" identifier=\"\" id=\"1547\">\n                                <view key=\"view\" id=\"1548\">\n                                    <rect key=\"frame\" x=\"10\" y=\"33\" width=\"432\" height=\"266\"/>\n                                    <autoresizingMask key=\"autoresizingMask\"/>\n                                    <subviews>\n                                        <box toolTip=\"This section controls how multiple VNC clients share the screen\" title=\"Server Sharing\" id=\"1549\">\n                                            <rect key=\"frame\" x=\"19\" y=\"37\" width=\"392\" height=\"123\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" flexibleMinY=\"YES\"/>\n                                            <view key=\"contentView\" id=\"nCC-6o-qMK\">\n                                                <rect key=\"frame\" x=\"2\" y=\"2\" width=\"388\" height=\"103\"/>\n                                                <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                                <subviews>\n                                                    <matrix verticalHuggingPriority=\"750\" allowsEmptySelection=\"NO\" autosizesCells=\"NO\" id=\"1550\">\n                                                        <rect key=\"frame\" x=\"14\" y=\"34\" width=\"350\" height=\"59\"/>\n                                                        <autoresizingMask key=\"autoresizingMask\"/>\n                                                        <animations/>\n                                                        <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                        <size key=\"cellSize\" width=\"350\" height=\"18\"/>\n                                                        <size key=\"intercellSpacing\" width=\"4\" height=\"2\"/>\n                                                        <buttonCell key=\"prototype\" type=\"radio\" title=\"Radio\" imagePosition=\"left\" alignment=\"left\" inset=\"2\" id=\"1551\">\n                                                            <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                            <font key=\"font\" metaFont=\"system\"/>\n                                                        </buttonCell>\n                                                        <cells>\n                                                            <column>\n                                                                <buttonCell type=\"radio\" title=\"Always allow multiple VNC connections\" bezelStyle=\"regularSquare\" imagePosition=\"left\" alignment=\"left\" toolTip=\"Always allow multiple VNC clients\" tag=\"1\" inset=\"2\" id=\"1552\">\n                                                                    <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                                    <font key=\"font\" metaFont=\"system\"/>\n                                                                </buttonCell>\n                                                                <buttonCell type=\"radio\" title=\"Let viewers request exclusive access\" imagePosition=\"left\" alignment=\"left\" state=\"on\" toolTip=\"Allow client to specify if it will work while other VNC clients are connected.\" inset=\"2\" id=\"1553\">\n                                                                    <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                                    <font key=\"font\" metaFont=\"system\"/>\n                                                                </buttonCell>\n                                                                <buttonCell type=\"radio\" title=\"Allow only one VNC connection at a time\" bezelStyle=\"regularSquare\" imagePosition=\"left\" alignment=\"left\" toolTip=\"Never allow multiple VNC clients\" tag=\"2\" inset=\"2\" id=\"1554\">\n                                                                    <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                                    <font key=\"font\" metaFont=\"system\"/>\n                                                                </buttonCell>\n                                                            </column>\n                                                        </cells>\n                                                        <connections>\n                                                            <action selector=\"changeSharing:\" target=\"1668\" id=\"1874\"/>\n                                                        </connections>\n                                                    </matrix>\n                                                    <button toolTip=\"Checking this box means the new client is denied access.  Unchecking it means the existing client is disconnected.\" id=\"1555\">\n                                                        <rect key=\"frame\" x=\"29\" y=\"12\" width=\"353\" height=\"18\"/>\n                                                        <autoresizingMask key=\"autoresizingMask\"/>\n                                                        <animations/>\n                                                        <buttonCell key=\"cell\" type=\"check\" title=\"Keep existing viewer if a new viewer tries to connect\" bezelStyle=\"regularSquare\" imagePosition=\"left\" alignment=\"left\" state=\"on\" inset=\"2\" id=\"1556\">\n                                                            <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                            <font key=\"font\" metaFont=\"system\"/>\n                                                        </buttonCell>\n                                                        <connections>\n                                                            <action selector=\"optionChanged:\" target=\"1668\" id=\"1875\"/>\n                                                        </connections>\n                                                    </button>\n                                                </subviews>\n                                                <animations/>\n                                            </view>\n                                            <animations/>\n                                            <color key=\"borderColor\" white=\"0.0\" alpha=\"0.41999999999999998\" colorSpace=\"calibratedWhite\"/>\n                                            <color key=\"fillColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"calibratedWhite\"/>\n                                            <font key=\"titleFont\" metaFont=\"system\"/>\n                                        </box>\n                                        <button id=\"1557\">\n                                            <rect key=\"frame\" x=\"23\" y=\"230\" width=\"378\" height=\"18\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                            <animations/>\n                                            <buttonCell key=\"cell\" type=\"check\" title=\"Disable remote control of keyboard and mouse\" bezelStyle=\"regularSquare\" imagePosition=\"left\" alignment=\"left\" inset=\"2\" id=\"1558\">\n                                                <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                <font key=\"font\" metaFont=\"system\"/>\n                                            </buttonCell>\n                                            <connections>\n                                                <action selector=\"optionChanged:\" target=\"1668\" id=\"1876\"/>\n                                            </connections>\n                                        </button>\n                                        <button id=\"1559\">\n                                            <rect key=\"frame\" x=\"23\" y=\"190\" width=\"278\" height=\"18\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                            <animations/>\n                                            <buttonCell key=\"cell\" type=\"check\" title=\"Advertise server via Bonjour\" bezelStyle=\"regularSquare\" imagePosition=\"left\" alignment=\"left\" inset=\"2\" id=\"1560\">\n                                                <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                <font key=\"font\" metaFont=\"system\"/>\n                                            </buttonCell>\n                                            <connections>\n                                                <action selector=\"optionChanged:\" target=\"1668\" id=\"1885\"/>\n                                            </connections>\n                                        </button>\n                                        <button id=\"1561\">\n                                            <rect key=\"frame\" x=\"23\" y=\"210\" width=\"333\" height=\"18\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                            <animations/>\n                                            <buttonCell key=\"cell\" type=\"check\" title=\"Disable rich clipboard support (Vine Viewer Only)\" bezelStyle=\"regularSquare\" imagePosition=\"left\" alignment=\"left\" inset=\"2\" id=\"1562\">\n                                                <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                <font key=\"font\" metaFont=\"system\"/>\n                                            </buttonCell>\n                                        </button>\n                                    </subviews>\n                                    <animations/>\n                                </view>\n                            </tabViewItem>\n                            <tabViewItem label=\"Startup\" identifier=\"\" id=\"1563\">\n                                <view key=\"view\" id=\"1564\">\n                                    <rect key=\"frame\" x=\"10\" y=\"33\" width=\"432\" height=\"266\"/>\n                                    <autoresizingMask key=\"autoresizingMask\"/>\n                                    <subviews>\n                                        <button id=\"1565\">\n                                            <rect key=\"frame\" x=\"18\" y=\"230\" width=\"383\" height=\"18\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                            <animations/>\n                                            <buttonCell key=\"cell\" type=\"check\" title=\"Start server when Vine Server application is launched\" bezelStyle=\"regularSquare\" imagePosition=\"left\" alignment=\"left\" inset=\"2\" id=\"1566\">\n                                                <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                <font key=\"font\" metaFont=\"system\"/>\n                                            </buttonCell>\n                                            <connections>\n                                                <action selector=\"saveUserDefaults:\" target=\"1668\" id=\"1878\"/>\n                                            </connections>\n                                        </button>\n                                        <button id=\"1567\">\n                                            <rect key=\"frame\" x=\"18\" y=\"190\" width=\"383\" height=\"18\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                            <animations/>\n                                            <buttonCell key=\"cell\" type=\"check\" title=\"Restart server if it stops unexpectedly\" bezelStyle=\"regularSquare\" imagePosition=\"left\" alignment=\"left\" state=\"on\" inset=\"2\" id=\"1568\">\n                                                <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                <font key=\"font\" metaFont=\"system\"/>\n                                            </buttonCell>\n                                        </button>\n                                        <button id=\"1569\">\n                                            <rect key=\"frame\" x=\"18\" y=\"210\" width=\"389\" height=\"18\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                            <animations/>\n                                            <buttonCell key=\"cell\" type=\"check\" title=\"Stop server on a fast user switch\" bezelStyle=\"regularSquare\" imagePosition=\"left\" alignment=\"left\" inset=\"2\" id=\"1570\">\n                                                <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                <font key=\"font\" metaFont=\"system\"/>\n                                            </buttonCell>\n                                            <connections>\n                                                <action selector=\"optionChanged:\" target=\"1668\" id=\"1883\"/>\n                                            </connections>\n                                        </button>\n                                        <button verticalHuggingPriority=\"750\" id=\"1571\">\n                                            <rect key=\"frame\" x=\"14\" y=\"104\" width=\"196\" height=\"32\"/>\n                                            <autoresizingMask key=\"autoresizingMask\"/>\n                                            <animations/>\n                                            <buttonCell key=\"cell\" type=\"push\" title=\"System Server...\" bezelStyle=\"rounded\" alignment=\"center\" borderStyle=\"border\" inset=\"2\" id=\"1572\">\n                                                <behavior key=\"behavior\" pushIn=\"YES\" lightByBackground=\"YES\" lightByGray=\"YES\"/>\n                                                <font key=\"font\" metaFont=\"system\"/>\n                                            </buttonCell>\n                                            <connections>\n                                                <action selector=\"makeKeyAndOrderFront:\" target=\"1726\" id=\"1910\"/>\n                                            </connections>\n                                        </button>\n                                    </subviews>\n                                    <animations/>\n                                </view>\n                            </tabViewItem>\n                            <tabViewItem label=\"Advanced\" identifier=\"\" id=\"1594\">\n                                <view key=\"view\" id=\"1595\">\n                                    <rect key=\"frame\" x=\"10\" y=\"33\" width=\"432\" height=\"266\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                    <subviews>\n                                        <box toolTip=\"The event taps that Vine Server uses to interpret keystrokes from a VNC viewer.\" title=\"Keyboard\" id=\"1596\">\n                                            <rect key=\"frame\" x=\"19\" y=\"19\" width=\"403\" height=\"86\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                            <view key=\"contentView\" id=\"DRX-jY-fqU\">\n                                                <rect key=\"frame\" x=\"2\" y=\"2\" width=\"399\" height=\"69\"/>\n                                                <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                                <subviews>\n                                                    <popUpButton toolTip=\"The OS level at which Vine Server interprets keyboard input from a VNC viewer.\" verticalHuggingPriority=\"750\" id=\"1597\">\n                                                        <rect key=\"frame\" x=\"166\" y=\"35\" width=\"219\" height=\"26\"/>\n                                                        <autoresizingMask key=\"autoresizingMask\"/>\n                                                        <animations/>\n                                                        <popUpButtonCell key=\"cell\" type=\"push\" title=\"Smart Event Management\" bezelStyle=\"rounded\" alignment=\"left\" lineBreakMode=\"truncatingTail\" state=\"on\" borderStyle=\"borderAndBezel\" tag=\"3\" inset=\"2\" arrowPosition=\"arrowAtCenter\" preferredEdge=\"maxY\" selectedItem=\"1600\" id=\"1598\">\n                                                            <behavior key=\"behavior\" lightByBackground=\"YES\" lightByGray=\"YES\"/>\n                                                            <font key=\"font\" metaFont=\"menu\"/>\n                                                            <menu key=\"menu\" title=\"OtherViews\" id=\"1599\">\n                                                                <items>\n                                                                    <menuItem title=\"Smart Event Management\" state=\"on\" tag=\"3\" id=\"1600\"/>\n                                                                    <menuItem title=\"Hardware Events \" id=\"1602\"/>\n                                                                    <menuItem title=\"User Session Events\" tag=\"1\" id=\"1601\"/>\n                                                                </items>\n                                                            </menu>\n                                                        </popUpButtonCell>\n                                                        <connections>\n                                                            <action selector=\"optionChanged:\" target=\"1668\" id=\"1916\"/>\n                                                        </connections>\n                                                    </popUpButton>\n                                                    <textField verticalHuggingPriority=\"750\" id=\"1603\">\n                                                        <rect key=\"frame\" x=\"16\" y=\"41\" width=\"121\" height=\"17\"/>\n                                                        <autoresizingMask key=\"autoresizingMask\"/>\n                                                        <animations/>\n                                                        <textFieldCell key=\"cell\" sendsActionOnEndEditing=\"YES\" title=\"Keyboard Events:\" id=\"1604\">\n                                                            <font key=\"font\" metaFont=\"system\"/>\n                                                            <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                            <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                        </textFieldCell>\n                                                    </textField>\n                                                    <popUpButton toolTip=\"The OS level at which Vine Server interprets keyboard input from a VNC viewer.\" verticalHuggingPriority=\"750\" id=\"1605\">\n                                                        <rect key=\"frame\" x=\"166\" y=\"9\" width=\"219\" height=\"26\"/>\n                                                        <autoresizingMask key=\"autoresizingMask\"/>\n                                                        <animations/>\n                                                        <popUpButtonCell key=\"cell\" type=\"push\" title=\"HID Event Source\" bezelStyle=\"rounded\" alignment=\"left\" lineBreakMode=\"truncatingTail\" state=\"on\" borderStyle=\"borderAndBezel\" inset=\"2\" arrowPosition=\"arrowAtCenter\" preferredEdge=\"maxY\" selectedItem=\"1610\" id=\"1606\">\n                                                            <behavior key=\"behavior\" lightByBackground=\"YES\" lightByGray=\"YES\"/>\n                                                            <font key=\"font\" metaFont=\"menu\"/>\n                                                            <menu key=\"menu\" title=\"OtherViews\" id=\"1607\">\n                                                                <items>\n                                                                    <menuItem title=\"Private Event Source\" tag=\"2\" id=\"1608\"/>\n                                                                    <menuItem title=\"Combined Event Source\" tag=\"1\" id=\"1609\"/>\n                                                                    <menuItem title=\"HID Event Source\" state=\"on\" id=\"1610\"/>\n                                                                    <menuItem title=\"10.3 API (No Source)\" tag=\"3\" id=\"1611\"/>\n                                                                </items>\n                                                            </menu>\n                                                        </popUpButtonCell>\n                                                        <connections>\n                                                            <action selector=\"optionChanged:\" target=\"1668\" id=\"1915\"/>\n                                                        </connections>\n                                                    </popUpButton>\n                                                    <textField verticalHuggingPriority=\"750\" id=\"1612\">\n                                                        <rect key=\"frame\" x=\"16\" y=\"15\" width=\"121\" height=\"17\"/>\n                                                        <autoresizingMask key=\"autoresizingMask\"/>\n                                                        <animations/>\n                                                        <textFieldCell key=\"cell\" sendsActionOnEndEditing=\"YES\" title=\"Event Source:\" id=\"1613\">\n                                                            <font key=\"font\" metaFont=\"system\"/>\n                                                            <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                            <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                        </textFieldCell>\n                                                    </textField>\n                                                </subviews>\n                                                <animations/>\n                                            </view>\n                                            <animations/>\n                                            <color key=\"borderColor\" white=\"0.0\" alpha=\"0.41999999999999998\" colorSpace=\"calibratedWhite\"/>\n                                            <color key=\"fillColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"calibratedWhite\"/>\n                                        </box>\n                                        <box title=\"RFB Protocol\" borderType=\"line\" id=\"1614\">\n                                            <rect key=\"frame\" x=\"19\" y=\"200\" width=\"162\" height=\"60\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n                                            <view key=\"contentView\" id=\"84T-ob-M1v\">\n                                                <rect key=\"frame\" x=\"1\" y=\"1\" width=\"160\" height=\"44\"/>\n                                                <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                                <subviews>\n                                                    <popUpButton toolTip=\"Select to force the server to use an older protocol.\" verticalHuggingPriority=\"750\" id=\"1615\">\n                                                        <rect key=\"frame\" x=\"15\" y=\"10\" width=\"130\" height=\"26\"/>\n                                                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\"/>\n                                                        <animations/>\n                                                        <popUpButtonCell key=\"cell\" type=\"push\" title=\"Default (3.8)\" bezelStyle=\"rounded\" alignment=\"left\" lineBreakMode=\"truncatingTail\" state=\"on\" borderStyle=\"borderAndBezel\" inset=\"2\" arrowPosition=\"arrowAtCenter\" preferredEdge=\"maxY\" selectedItem=\"1619\" id=\"1616\">\n                                                            <behavior key=\"behavior\" lightByBackground=\"YES\" lightByGray=\"YES\"/>\n                                                            <font key=\"font\" metaFont=\"menu\"/>\n                                                            <menu key=\"menu\" title=\"OtherViews\" id=\"1617\">\n                                                                <items>\n                                                                    <menuItem title=\"Default (3.8)\" state=\"on\" id=\"1619\"/>\n                                                                    <menuItem title=\"3.7\" id=\"1618\"/>\n                                                                    <menuItem title=\"3.3\" id=\"1620\"/>\n                                                                </items>\n                                                            </menu>\n                                                        </popUpButtonCell>\n                                                        <connections>\n                                                            <action selector=\"optionChanged:\" target=\"1668\" id=\"1891\"/>\n                                                        </connections>\n                                                    </popUpButton>\n                                                </subviews>\n                                                <animations/>\n                                            </view>\n                                            <animations/>\n                                            <color key=\"borderColor\" white=\"0.0\" alpha=\"0.41999999999999998\" colorSpace=\"calibratedWhite\"/>\n                                            <color key=\"fillColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"calibratedWhite\"/>\n                                        </box>\n                                        <box title=\"Command Line Arguments\" borderType=\"line\" id=\"1621\">\n                                            <rect key=\"frame\" x=\"19\" y=\"116\" width=\"404\" height=\"80\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n                                            <view key=\"contentView\" id=\"WH1-xk-HxX\">\n                                                <rect key=\"frame\" x=\"1\" y=\"1\" width=\"402\" height=\"64\"/>\n                                                <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                                <subviews>\n                                                    <textField verticalHuggingPriority=\"750\" id=\"1622\">\n                                                        <rect key=\"frame\" x=\"22\" y=\"23\" width=\"358\" height=\"22\"/>\n                                                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\"/>\n                                                        <animations/>\n                                                        <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" selectable=\"YES\" editable=\"YES\" sendsActionOnEndEditing=\"YES\" state=\"on\" borderStyle=\"bezel\" drawsBackground=\"YES\" id=\"1623\">\n                                                            <font key=\"font\" metaFont=\"system\"/>\n                                                            <color key=\"textColor\" name=\"textColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                            <color key=\"backgroundColor\" name=\"textBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                        </textFieldCell>\n                                                        <connections>\n                                                            <action selector=\"optionChanged:\" target=\"1668\" id=\"1890\"/>\n                                                        </connections>\n                                                    </textField>\n                                                </subviews>\n                                                <animations/>\n                                            </view>\n                                            <animations/>\n                                            <color key=\"borderColor\" white=\"0.0\" alpha=\"0.41999999999999998\" colorSpace=\"calibratedWhite\"/>\n                                            <color key=\"fillColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"calibratedWhite\"/>\n                                        </box>\n                                    </subviews>\n                                    <animations/>\n                                </view>\n                            </tabViewItem>\n                        </tabViewItems>\n                    </tabView>\n                    <textField verticalHuggingPriority=\"750\" id=\"1624\">\n                        <rect key=\"frame\" x=\"17\" y=\"15\" width=\"400\" height=\"17\"/>\n                        <autoresizingMask key=\"autoresizingMask\"/>\n                        <animations/>\n                        <textFieldCell key=\"cell\" sendsActionOnEndEditing=\"YES\" title=\"Preference Message\" id=\"1625\">\n                            <font key=\"font\" metaFont=\"system\"/>\n                            <color key=\"textColor\" red=\"1\" green=\"0.0\" blue=\"0.0\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                            <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                        </textFieldCell>\n                    </textField>\n                </subviews>\n                <animations/>\n            </view>\n            <connections>\n                <outlet property=\"delegate\" destination=\"1668\" id=\"1785\"/>\n                <outlet property=\"initialFirstResponder\" destination=\"1515\" id=\"1786\"/>\n            </connections>\n        </window>\n        <menu title=\"MainMenu\" systemMenu=\"main\" id=\"1626\">\n            <items>\n                <menuItem title=\"Vine Server\" id=\"1627\">\n                    <menu key=\"submenu\" title=\"Vine Server\" systemMenu=\"apple\" id=\"1628\">\n                        <items>\n                            <menuItem title=\"About Vine Server\" id=\"1629\">\n                                <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                <connections>\n                                    <action selector=\"orderFrontStandardAboutPanel:\" target=\"-2\" id=\"1850\"/>\n                                </connections>\n                            </menuItem>\n                            <menuItem title=\"Preferences...\" keyEquivalent=\",\" id=\"1640\">\n                                <connections>\n                                    <action selector=\"makeKeyAndOrderFront:\" target=\"1508\" id=\"1894\"/>\n                                </connections>\n                            </menuItem>\n                            <menuItem isSeparatorItem=\"YES\" id=\"1634\">\n                                <modifierMask key=\"keyEquivalentModifierMask\" command=\"YES\"/>\n                            </menuItem>\n                            <menuItem title=\"Services\" id=\"1630\">\n                                <menu key=\"submenu\" title=\"Services\" systemMenu=\"services\" id=\"1631\"/>\n                            </menuItem>\n                            <menuItem isSeparatorItem=\"YES\" id=\"1635\">\n                                <modifierMask key=\"keyEquivalentModifierMask\" command=\"YES\"/>\n                            </menuItem>\n                            <menuItem title=\"Hide Vine Server\" keyEquivalent=\"h\" id=\"1632\">\n                                <connections>\n                                    <action selector=\"hide:\" target=\"-2\" id=\"1852\"/>\n                                </connections>\n                            </menuItem>\n                            <menuItem title=\"Hide Others\" id=\"1636\">\n                                <connections>\n                                    <action selector=\"hideOtherApplications:\" target=\"-2\" id=\"1854\"/>\n                                </connections>\n                            </menuItem>\n                            <menuItem title=\"Show All\" id=\"1638\">\n                                <connections>\n                                    <action selector=\"unhideAllApplications:\" target=\"-2\" id=\"1855\"/>\n                                </connections>\n                            </menuItem>\n                            <menuItem isSeparatorItem=\"YES\" id=\"1637\">\n                                <modifierMask key=\"keyEquivalentModifierMask\" command=\"YES\"/>\n                            </menuItem>\n                            <menuItem title=\"Quit Vine Server...\" keyEquivalent=\"q\" id=\"1633\">\n                                <connections>\n                                    <action selector=\"terminateRequest:\" target=\"1668\" id=\"1853\"/>\n                                </connections>\n                            </menuItem>\n                            <menuItem title=\"Quit Vine Server\" alternate=\"YES\" keyEquivalent=\"q\" id=\"1639\">\n                                <modifierMask key=\"keyEquivalentModifierMask\" option=\"YES\" command=\"YES\"/>\n                                <connections>\n                                    <action selector=\"terminate:\" target=\"-2\" id=\"1893\"/>\n                                </connections>\n                            </menuItem>\n                        </items>\n                    </menu>\n                </menuItem>\n                <menuItem title=\"Server\" id=\"1641\">\n                    <menu key=\"submenu\" title=\"Server\" id=\"1642\">\n                        <items>\n                            <menuItem title=\"Start Server\" id=\"1649\">\n                                <string key=\"keyEquivalent\" base64-UTF8=\"YES\">\nDQ\n</string>\n                                <connections>\n                                    <action selector=\"startServer:\" target=\"1668\" id=\"1900\"/>\n                                </connections>\n                            </menuItem>\n                            <menuItem title=\"Stop Server\" keyEquivalent=\".\" id=\"1643\">\n                                <connections>\n                                    <action selector=\"stopServer:\" target=\"1668\" id=\"1864\"/>\n                                </connections>\n                            </menuItem>\n                            <menuItem isSeparatorItem=\"YES\" id=\"1645\">\n                                <modifierMask key=\"keyEquivalentModifierMask\" command=\"YES\"/>\n                            </menuItem>\n                            <menuItem title=\"View Log\" keyEquivalent=\"V\" id=\"1644\">\n                                <connections>\n                                    <action selector=\"openLog:\" target=\"1668\" id=\"1868\"/>\n                                </connections>\n                            </menuItem>\n                            <menuItem title=\"Reverse Connection...\" keyEquivalent=\"r\" id=\"1647\">\n                                <connections>\n                                    <action selector=\"reverseConnection:\" target=\"1668\" id=\"1897\"/>\n                                </connections>\n                            </menuItem>\n                            <menuItem isSeparatorItem=\"YES\" id=\"1648\">\n                                <modifierMask key=\"keyEquivalentModifierMask\" command=\"YES\"/>\n                            </menuItem>\n                            <menuItem title=\"Server...\" keyEquivalent=\"s\" id=\"1650\">\n                                <connections>\n                                    <action selector=\"makeKeyAndOrderFront:\" target=\"1677\" id=\"1914\"/>\n                                </connections>\n                            </menuItem>\n                            <menuItem title=\"System Server...\" keyEquivalent=\"S\" id=\"1646\">\n                                <connections>\n                                    <action selector=\"makeKeyAndOrderFront:\" target=\"1726\" id=\"1873\"/>\n                                </connections>\n                            </menuItem>\n                        </items>\n                    </menu>\n                </menuItem>\n                <menuItem title=\"Edit\" id=\"1658\">\n                    <menu key=\"submenu\" title=\"Edit\" id=\"1659\">\n                        <items>\n                            <menuItem title=\"Cut\" keyEquivalent=\"x\" id=\"1661\">\n                                <connections>\n                                    <action selector=\"cut:\" target=\"-1\" id=\"1857\"/>\n                                </connections>\n                            </menuItem>\n                            <menuItem title=\"Copy\" keyEquivalent=\"c\" id=\"1660\">\n                                <connections>\n                                    <action selector=\"copy:\" target=\"-1\" id=\"1856\"/>\n                                </connections>\n                            </menuItem>\n                            <menuItem title=\"Paste\" keyEquivalent=\"v\" id=\"1662\">\n                                <connections>\n                                    <action selector=\"paste:\" target=\"-1\" id=\"1858\"/>\n                                </connections>\n                            </menuItem>\n                            <menuItem title=\"Select All\" keyEquivalent=\"a\" id=\"1663\">\n                                <connections>\n                                    <action selector=\"selectAll:\" target=\"-1\" id=\"1859\"/>\n                                </connections>\n                            </menuItem>\n                        </items>\n                    </menu>\n                </menuItem>\n                <menuItem title=\"Window\" id=\"1664\">\n                    <menu key=\"submenu\" title=\"Window\" systemMenu=\"window\" id=\"1665\">\n                        <items>\n                            <menuItem title=\"Close Window\" keyEquivalent=\"w\" id=\"1667\">\n                                <connections>\n                                    <action selector=\"performClose:\" target=\"-1\" id=\"1869\"/>\n                                </connections>\n                            </menuItem>\n                            <menuItem title=\"Minimize\" keyEquivalent=\"m\" id=\"1666\">\n                                <connections>\n                                    <action selector=\"performMiniaturize:\" target=\"-1\" id=\"1865\"/>\n                                </connections>\n                            </menuItem>\n                        </items>\n                    </menu>\n                </menuItem>\n                <menuItem title=\"Help \" id=\"1651\">\n                    <menu key=\"submenu\" title=\"Help \" id=\"1652\">\n                        <items>\n                            <menuItem title=\"Vine Server Help\" keyEquivalent=\"?\" id=\"1653\">\n                                <connections>\n                                    <action selector=\"showHelp:\" target=\"-1\" id=\"1851\"/>\n                                </connections>\n                            </menuItem>\n                            <menuItem title=\"Configure Firewall\" id=\"1657\">\n                                <connections>\n                                    <action selector=\"openFirewall:\" target=\"1668\" id=\"1902\"/>\n                                </connections>\n                            </menuItem>\n                            <menuItem isSeparatorItem=\"YES\" id=\"1655\">\n                                <modifierMask key=\"keyEquivalentModifierMask\" command=\"YES\"/>\n                            </menuItem>\n                            <menuItem title=\"Release Notes\" id=\"1654\">\n                                <connections>\n                                    <action selector=\"openReleaseNotes:\" target=\"1668\" id=\"1866\"/>\n                                </connections>\n                            </menuItem>\n                            <menuItem title=\"GPL License\" id=\"1656\">\n                                <connections>\n                                    <action selector=\"openGPL:\" target=\"1668\" id=\"1867\"/>\n                                </connections>\n                            </menuItem>\n                        </items>\n                    </menu>\n                </menuItem>\n            </items>\n        </menu>\n        <customObject id=\"1668\" customClass=\"VNCController\">\n            <connections>\n                <outlet property=\"allowDimmingCheckbox\" destination=\"1581\" id=\"1788\"/>\n                <outlet property=\"allowRendezvousCheckbox\" destination=\"1559\" id=\"1789\"/>\n                <outlet property=\"allowScreenSaverCheckbox\" destination=\"1583\" id=\"1790\"/>\n                <outlet property=\"allowSleepCheckbox\" destination=\"1579\" id=\"1791\"/>\n                <outlet property=\"authenticationType\" destination=\"1541\" id=\"1792\"/>\n                <outlet property=\"connectHost\" destination=\"1714\" id=\"1793\"/>\n                <outlet property=\"connectPort\" destination=\"1718\" id=\"1794\"/>\n                <outlet property=\"disableRemoteEventsCheckbox\" destination=\"1557\" id=\"1795\"/>\n                <outlet property=\"disableRichClipboardCheckbox\" destination=\"1561\" id=\"1796\"/>\n                <outlet property=\"disableStartupButton\" destination=\"1734\" id=\"1797\"/>\n                <outlet property=\"displayNameField\" destination=\"1536\" id=\"1798\"/>\n                <outlet property=\"displayNumText\" destination=\"1703\" id=\"1799\"/>\n                <outlet property=\"displayNumberField\" destination=\"1515\" id=\"1800\"/>\n                <outlet property=\"dontDisconnectCheckbox\" destination=\"1555\" id=\"1801\"/>\n                <outlet property=\"eventSourcePopup\" destination=\"1605\" id=\"1802\"/>\n                <outlet property=\"hostNamesBox\" destination=\"1683\" id=\"1803\"/>\n                <outlet property=\"hostNamesField\" destination=\"1684\" id=\"1804\"/>\n                <outlet property=\"initialAuthenticationType\" destination=\"1775\" id=\"1805\"/>\n                <outlet property=\"initialDoneButton\" destination=\"1781\" id=\"1806\"/>\n                <outlet property=\"initialPasswordText\" destination=\"1773\" id=\"1807\"/>\n                <outlet property=\"initialWindow\" destination=\"1771\" id=\"1808\"/>\n                <outlet property=\"ipAddressesBox\" destination=\"1686\" id=\"1809\"/>\n                <outlet property=\"ipAddressesView\" destination=\"1690\" id=\"1810\"/>\n                <outlet property=\"keyboardEvents\" destination=\"1597\" id=\"1811\"/>\n                <outlet property=\"keyboardLayout\" destination=\"1586\" id=\"1812\"/>\n                <outlet property=\"limitToLocalConnections\" destination=\"1545\" id=\"1813\"/>\n                <outlet property=\"optionsTabView\" destination=\"1510\" id=\"1814\"/>\n                <outlet property=\"otherArguments\" destination=\"1622\" id=\"1815\"/>\n                <outlet property=\"passwordField\" destination=\"1539\" id=\"1816\"/>\n                <outlet property=\"portField\" destination=\"1530\" id=\"1817\"/>\n                <outlet property=\"portNumText\" destination=\"1699\" id=\"1818\"/>\n                <outlet property=\"preferenceWindow\" destination=\"1508\" id=\"1819\"/>\n                <outlet property=\"preferencesMessageTestField\" destination=\"1624\" id=\"1820\"/>\n                <outlet property=\"protocolVersion\" destination=\"1615\" id=\"1821\"/>\n                <outlet property=\"reverseConnectionMessageField\" destination=\"1724\" id=\"1822\"/>\n                <outlet property=\"reverseConnectionWindow\" destination=\"1709\" id=\"1823\"/>\n                <outlet property=\"serverKeepAliveCheckbox\" destination=\"1567\" id=\"1824\"/>\n                <outlet property=\"serverMenuItem\" destination=\"1650\" id=\"1825\"/>\n                <outlet property=\"setStartupButton\" destination=\"1728\" id=\"1826\"/>\n                <outlet property=\"sharingMatrix\" destination=\"1550\" id=\"1827\"/>\n                <outlet property=\"startServerButton\" destination=\"1679\" id=\"1828\"/>\n                <outlet property=\"startServerMenuItem\" destination=\"1649\" id=\"1829\"/>\n                <outlet property=\"startServerOnLaunchCheckbox\" destination=\"1565\" id=\"1830\"/>\n                <outlet property=\"startupItemStatusMessageField\" destination=\"1732\" id=\"1831\"/>\n                <outlet property=\"statusMessageField\" destination=\"1706\" id=\"1832\"/>\n                <outlet property=\"statusWindow\" destination=\"1677\" id=\"1833\"/>\n                <outlet property=\"stopServerButton\" destination=\"1681\" id=\"1834\"/>\n                <outlet property=\"stopServerMenuItem\" destination=\"1643\" id=\"1835\"/>\n                <outlet property=\"swapMouseButtonsCheckbox\" destination=\"1576\" id=\"1836\"/>\n                <outlet property=\"systemServerAuthenticationType\" destination=\"1765\" id=\"1837\"/>\n                <outlet property=\"systemServerDisplayNameField\" destination=\"1760\" id=\"1838\"/>\n                <outlet property=\"systemServerDisplayNumberField\" destination=\"1739\" id=\"1839\"/>\n                <outlet property=\"systemServerLimitToLocalConnections\" destination=\"1769\" id=\"1840\"/>\n                <outlet property=\"systemServerMenu\" destination=\"1646\" id=\"1841\"/>\n                <outlet property=\"systemServerPasswordField\" destination=\"1763\" id=\"1842\"/>\n                <outlet property=\"systemServerPortField\" destination=\"1754\" id=\"1843\"/>\n                <outlet property=\"systemServerWindow\" destination=\"1726\" id=\"1844\"/>\n                <outlet property=\"terminateOnFastUserSwitch\" destination=\"1569\" id=\"1845\"/>\n            </connections>\n        </customObject>\n        <menu title=\"Menu\" id=\"1669\">\n            <items>\n                <menuItem title=\"Preferences...\" id=\"1676\">\n                    <connections>\n                        <action selector=\"makeKeyAndOrderFront:\" target=\"1508\" id=\"1901\"/>\n                    </connections>\n                </menuItem>\n                <menuItem isSeparatorItem=\"YES\" id=\"1671\">\n                    <modifierMask key=\"keyEquivalentModifierMask\" command=\"YES\"/>\n                </menuItem>\n                <menuItem title=\"Start Server\" id=\"1670\">\n                    <connections>\n                        <action selector=\"startServer:\" target=\"1668\" id=\"1870\"/>\n                    </connections>\n                </menuItem>\n                <menuItem title=\"Stop Server\" id=\"1672\">\n                    <connections>\n                        <action selector=\"stopServer:\" target=\"1668\" id=\"1871\"/>\n                    </connections>\n                </menuItem>\n                <menuItem isSeparatorItem=\"YES\" id=\"1675\">\n                    <modifierMask key=\"keyEquivalentModifierMask\" command=\"YES\"/>\n                </menuItem>\n                <menuItem title=\"View Log\" id=\"1673\">\n                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                    <connections>\n                        <action selector=\"openLog:\" target=\"1668\" id=\"1872\"/>\n                    </connections>\n                </menuItem>\n                <menuItem title=\"Reverse Connection...\" id=\"1674\">\n                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                    <connections>\n                        <action selector=\"reverseConnection:\" target=\"1668\" id=\"1899\"/>\n                    </connections>\n                </menuItem>\n            </items>\n        </menu>\n        <window title=\"Vine Server\" deferred=\"NO\" releasedWhenClosed=\"NO\" frameAutosaveName=\"Server\" animationBehavior=\"default\" id=\"1677\">\n            <windowStyleMask key=\"styleMask\" titled=\"YES\" closable=\"YES\" miniaturizable=\"YES\" resizable=\"YES\" texturedBackground=\"YES\"/>\n            <windowPositionMask key=\"initialPositionMask\" leftStrut=\"YES\" rightStrut=\"YES\" topStrut=\"YES\" bottomStrut=\"YES\"/>\n            <rect key=\"contentRect\" x=\"191\" y=\"684\" width=\"408\" height=\"337\"/>\n            <rect key=\"screenRect\" x=\"0.0\" y=\"0.0\" width=\"2560\" height=\"1418\"/>\n            <value key=\"minSize\" type=\"size\" width=\"350\" height=\"330\"/>\n            <view key=\"contentView\" id=\"1678\">\n                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"408\" height=\"337\"/>\n                <autoresizingMask key=\"autoresizingMask\"/>\n                <subviews>\n                    <button verticalHuggingPriority=\"750\" id=\"1681\">\n                        <rect key=\"frame\" x=\"11\" y=\"12\" width=\"128\" height=\"32\"/>\n                        <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n                        <animations/>\n                        <buttonCell key=\"cell\" type=\"push\" title=\"Stop Server\" bezelStyle=\"rounded\" alignment=\"center\" enabled=\"NO\" borderStyle=\"border\" inset=\"2\" id=\"1682\">\n                            <behavior key=\"behavior\" pushIn=\"YES\" lightByBackground=\"YES\" lightByGray=\"YES\"/>\n                            <font key=\"font\" metaFont=\"system\"/>\n                        </buttonCell>\n                        <connections>\n                            <action selector=\"stopServer:\" target=\"1668\" id=\"1896\"/>\n                        </connections>\n                    </button>\n                    <scrollView autohidesScrollers=\"YES\" horizontalLineScroll=\"10\" horizontalPageScroll=\"10\" verticalLineScroll=\"10\" verticalPageScroll=\"10\" hasHorizontalScroller=\"NO\" usesPredominantAxisScrolling=\"NO\" id=\"1705\">\n                        <rect key=\"frame\" x=\"17\" y=\"54\" width=\"371\" height=\"62\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <clipView key=\"contentView\" id=\"M4J-wl-2jg\">\n                            <rect key=\"frame\" x=\"1\" y=\"1\" width=\"369\" height=\"60\"/>\n                            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                            <subviews>\n                                <textView editable=\"NO\" importsGraphics=\"NO\" richText=\"NO\" findStyle=\"panel\" usesRuler=\"YES\" usesFontPanel=\"YES\" verticallyResizable=\"YES\" spellingCorrection=\"YES\" smartInsertDelete=\"YES\" id=\"1706\">\n                                    <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"369\" height=\"60\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                    <animations/>\n                                    <color key=\"textColor\" name=\"textColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"calibratedWhite\"/>\n                                    <size key=\"minSize\" width=\"369\" height=\"60\"/>\n                                    <size key=\"maxSize\" width=\"371\" height=\"10000000\"/>\n                                    <attributedString key=\"textStorage\">\n                                        <fragment content=\"The server is not running\">\n                                            <attributes>\n                                                <color key=\"NSColor\" name=\"textColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                <font key=\"NSFont\" metaFont=\"user\"/>\n                                                <paragraphStyle key=\"NSParagraphStyle\" alignment=\"natural\" lineBreakMode=\"wordWrapping\" baseWritingDirection=\"natural\"/>\n                                            </attributes>\n                                        </fragment>\n                                    </attributedString>\n                                    <color key=\"insertionPointColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    <size key=\"minSize\" width=\"369\" height=\"60\"/>\n                                    <size key=\"maxSize\" width=\"371\" height=\"10000000\"/>\n                                </textView>\n                            </subviews>\n                            <animations/>\n                            <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"calibratedWhite\"/>\n                        </clipView>\n                        <animations/>\n                        <scroller key=\"horizontalScroller\" hidden=\"YES\" verticalHuggingPriority=\"750\" doubleValue=\"1\" horizontal=\"YES\" id=\"1707\">\n                            <rect key=\"frame\" x=\"-100\" y=\"-100\" width=\"87\" height=\"18\"/>\n                            <autoresizingMask key=\"autoresizingMask\"/>\n                            <animations/>\n                        </scroller>\n                        <scroller key=\"verticalScroller\" hidden=\"YES\" verticalHuggingPriority=\"750\" horizontal=\"NO\" id=\"1708\">\n                            <rect key=\"frame\" x=\"355\" y=\"1\" width=\"15\" height=\"60\"/>\n                            <autoresizingMask key=\"autoresizingMask\"/>\n                            <animations/>\n                        </scroller>\n                    </scrollView>\n                    <box title=\"IP Address\" id=\"1686\">\n                        <rect key=\"frame\" x=\"14\" y=\"172\" width=\"377\" height=\"74\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" flexibleMinY=\"YES\"/>\n                        <view key=\"contentView\" id=\"zDW-8G-rc6\">\n                            <rect key=\"frame\" x=\"2\" y=\"2\" width=\"373\" height=\"57\"/>\n                            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                            <subviews>\n                                <scrollView borderType=\"none\" autohidesScrollers=\"YES\" horizontalLineScroll=\"10\" horizontalPageScroll=\"10\" verticalLineScroll=\"10\" verticalPageScroll=\"10\" hasHorizontalScroller=\"NO\" usesPredominantAxisScrolling=\"NO\" id=\"1687\">\n                                    <rect key=\"frame\" x=\"11\" y=\"2\" width=\"358\" height=\"54\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                    <clipView key=\"contentView\" autoresizesSubviews=\"NO\" drawsBackground=\"NO\" copiesOnScroll=\"NO\" id=\"Fg5-NT-tqu\">\n                                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"358\" height=\"54\"/>\n                                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                        <subviews>\n                                            <matrix verticalHuggingPriority=\"750\" mode=\"track\" selectionByRect=\"NO\" allowsEmptySelection=\"NO\" autosizesCells=\"NO\" id=\"1690\">\n                                                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"358\" height=\"34\"/>\n                                                <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                                <animations/>\n                                                <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                <size key=\"cellSize\" width=\"169\" height=\"17\"/>\n                                                <size key=\"intercellSpacing\" width=\"10\" height=\"0.0\"/>\n                                                <textFieldCell key=\"prototype\" selectable=\"YES\" enabled=\"NO\" sendsActionOnEndEditing=\"YES\" tag=\"-1\" id=\"1691\">\n                                                    <font key=\"font\" metaFont=\"system\"/>\n                                                    <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                    <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                </textFieldCell>\n                                                <cells>\n                                                    <column>\n                                                        <textFieldCell selectable=\"YES\" enabled=\"NO\" sendsActionOnEndEditing=\"YES\" state=\"on\" title=\"IP1\" id=\"1695\">\n                                                            <font key=\"font\" metaFont=\"system\"/>\n                                                            <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                            <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                        </textFieldCell>\n                                                        <textFieldCell selectable=\"YES\" enabled=\"NO\" sendsActionOnEndEditing=\"YES\" tag=\"2\" title=\"IP2\" id=\"1693\">\n                                                            <font key=\"font\" metaFont=\"system\"/>\n                                                            <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                            <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                        </textFieldCell>\n                                                    </column>\n                                                    <column>\n                                                        <textFieldCell selectable=\"YES\" enabled=\"NO\" sendsActionOnEndEditing=\"YES\" tag=\"1\" title=\"Status1\" id=\"1694\">\n                                                            <font key=\"font\" metaFont=\"system\"/>\n                                                            <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                            <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                        </textFieldCell>\n                                                        <textFieldCell selectable=\"YES\" enabled=\"NO\" sendsActionOnEndEditing=\"YES\" tag=\"2\" title=\"Status2\" id=\"1692\">\n                                                            <font key=\"font\" metaFont=\"system\"/>\n                                                            <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                            <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                        </textFieldCell>\n                                                    </column>\n                                                </cells>\n                                            </matrix>\n                                        </subviews>\n                                        <animations/>\n                                    </clipView>\n                                    <animations/>\n                                    <scroller key=\"horizontalScroller\" hidden=\"YES\" verticalHuggingPriority=\"750\" doubleValue=\"1\" controlSize=\"small\" horizontal=\"YES\" id=\"1689\">\n                                        <rect key=\"frame\" x=\"-100\" y=\"-100\" width=\"314\" height=\"15\"/>\n                                        <autoresizingMask key=\"autoresizingMask\"/>\n                                        <animations/>\n                                    </scroller>\n                                    <scroller key=\"verticalScroller\" hidden=\"YES\" verticalHuggingPriority=\"750\" doubleValue=\"0.64705884456634521\" controlSize=\"small\" horizontal=\"NO\" id=\"1688\">\n                                        <rect key=\"frame\" x=\"-22\" y=\"0.0\" width=\"11\" height=\"54\"/>\n                                        <autoresizingMask key=\"autoresizingMask\"/>\n                                        <animations/>\n                                    </scroller>\n                                </scrollView>\n                            </subviews>\n                            <animations/>\n                        </view>\n                        <animations/>\n                        <color key=\"borderColor\" white=\"0.0\" alpha=\"0.41999999999999998\" colorSpace=\"calibratedWhite\"/>\n                        <color key=\"fillColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"calibratedWhite\"/>\n                    </box>\n                    <box title=\"Host Name\" id=\"1683\">\n                        <rect key=\"frame\" x=\"14\" y=\"247\" width=\"377\" height=\"80\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" flexibleMinY=\"YES\"/>\n                        <view key=\"contentView\" id=\"47s-8l-G0w\">\n                            <rect key=\"frame\" x=\"2\" y=\"2\" width=\"373\" height=\"63\"/>\n                            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                            <subviews>\n                                <textField toolTip=\"Host Name that can be used to refer to this machine\" verticalHuggingPriority=\"750\" id=\"1684\">\n                                    <rect key=\"frame\" x=\"11\" y=\"11\" width=\"349\" height=\"48\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                    <animations/>\n                                    <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" selectable=\"YES\" sendsActionOnEndEditing=\"YES\" alignment=\"left\" id=\"1685\">\n                                        <font key=\"font\" metaFont=\"cellTitle\"/>\n                                        <string key=\"title\">Host Name1\nHost Name2\nHost Name3</string>\n                                        <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                        <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    </textFieldCell>\n                                </textField>\n                            </subviews>\n                            <animations/>\n                        </view>\n                        <animations/>\n                        <color key=\"borderColor\" white=\"0.0\" alpha=\"0.41999999999999998\" colorSpace=\"calibratedWhite\"/>\n                        <color key=\"fillColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"calibratedWhite\"/>\n                    </box>\n                    <box title=\"Port\" id=\"1696\">\n                        <rect key=\"frame\" x=\"14\" y=\"120\" width=\"377\" height=\"50\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" flexibleMinY=\"YES\"/>\n                        <view key=\"contentView\" id=\"102-xM-zuw\">\n                            <rect key=\"frame\" x=\"2\" y=\"2\" width=\"373\" height=\"33\"/>\n                            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                            <subviews>\n                                <textField verticalHuggingPriority=\"750\" id=\"1697\">\n                                    <rect key=\"frame\" x=\"284\" y=\"8\" width=\"37\" height=\"17\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" flexibleMinX=\"YES\"/>\n                                    <animations/>\n                                    <textFieldCell key=\"cell\" sendsActionOnEndEditing=\"YES\" title=\"Port:\" id=\"1698\">\n                                        <font key=\"font\" metaFont=\"cellTitle\"/>\n                                        <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                        <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    </textFieldCell>\n                                </textField>\n                                <textField verticalHuggingPriority=\"750\" id=\"1699\">\n                                    <rect key=\"frame\" x=\"323\" y=\"8\" width=\"37\" height=\"17\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" flexibleMinX=\"YES\"/>\n                                    <animations/>\n                                    <textFieldCell key=\"cell\" sendsActionOnEndEditing=\"YES\" title=\"5900\" id=\"1700\">\n                                        <font key=\"font\" metaFont=\"cellTitle\"/>\n                                        <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                        <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    </textFieldCell>\n                                </textField>\n                                <textField verticalHuggingPriority=\"750\" id=\"1701\">\n                                    <rect key=\"frame\" x=\"10\" y=\"8\" width=\"110\" height=\"17\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\"/>\n                                    <animations/>\n                                    <textFieldCell key=\"cell\" sendsActionOnEndEditing=\"YES\" title=\"Display Number:\" id=\"1702\">\n                                        <font key=\"font\" metaFont=\"cellTitle\"/>\n                                        <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                        <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    </textFieldCell>\n                                </textField>\n                                <textField verticalHuggingPriority=\"750\" id=\"1703\">\n                                    <rect key=\"frame\" x=\"125\" y=\"8\" width=\"37\" height=\"17\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\"/>\n                                    <animations/>\n                                    <textFieldCell key=\"cell\" sendsActionOnEndEditing=\"YES\" title=\"0\" id=\"1704\">\n                                        <font key=\"font\" metaFont=\"cellTitle\"/>\n                                        <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                        <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    </textFieldCell>\n                                </textField>\n                            </subviews>\n                            <animations/>\n                        </view>\n                        <animations/>\n                        <color key=\"borderColor\" white=\"0.0\" alpha=\"0.41999999999999998\" colorSpace=\"calibratedWhite\"/>\n                        <color key=\"fillColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"calibratedWhite\"/>\n                    </box>\n                    <button verticalHuggingPriority=\"750\" id=\"1679\">\n                        <rect key=\"frame\" x=\"266\" y=\"12\" width=\"128\" height=\"32\"/>\n                        <autoresizingMask key=\"autoresizingMask\" flexibleMinX=\"YES\" flexibleMaxY=\"YES\"/>\n                        <animations/>\n                        <buttonCell key=\"cell\" type=\"push\" title=\"Start Server\" bezelStyle=\"rounded\" alignment=\"center\" borderStyle=\"border\" inset=\"2\" id=\"1680\">\n                            <behavior key=\"behavior\" pushIn=\"YES\" lightByBackground=\"YES\" lightByGray=\"YES\"/>\n                            <font key=\"font\" metaFont=\"system\"/>\n                            <string key=\"keyEquivalent\" base64-UTF8=\"YES\">\nDQ\n</string>\n                        </buttonCell>\n                        <connections>\n                            <action selector=\"startServer:\" target=\"1668\" id=\"1895\"/>\n                        </connections>\n                    </button>\n                </subviews>\n                <animations/>\n            </view>\n            <connections>\n                <outlet property=\"delegate\" destination=\"1668\" id=\"1847\"/>\n            </connections>\n        </window>\n        <window title=\"Window\" allowsToolTipsWhenApplicationIsInactive=\"NO\" autorecalculatesKeyViewLoop=\"NO\" releasedWhenClosed=\"NO\" visibleAtLaunch=\"NO\" animationBehavior=\"default\" id=\"1709\">\n            <windowStyleMask key=\"styleMask\" titled=\"YES\" closable=\"YES\" miniaturizable=\"YES\"/>\n            <windowPositionMask key=\"initialPositionMask\" leftStrut=\"YES\" rightStrut=\"YES\" topStrut=\"YES\" bottomStrut=\"YES\"/>\n            <rect key=\"contentRect\" x=\"336\" y=\"421\" width=\"423\" height=\"143\"/>\n            <rect key=\"screenRect\" x=\"0.0\" y=\"0.0\" width=\"2560\" height=\"1418\"/>\n            <value key=\"minSize\" type=\"size\" width=\"213\" height=\"107\"/>\n            <view key=\"contentView\" id=\"1710\">\n                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"423\" height=\"143\"/>\n                <autoresizingMask key=\"autoresizingMask\"/>\n                <subviews>\n                    <box title=\"Reverse Connection\" id=\"1713\">\n                        <rect key=\"frame\" x=\"14\" y=\"49\" width=\"398\" height=\"85\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" flexibleMinY=\"YES\"/>\n                        <view key=\"contentView\" id=\"lGB-UO-jpX\">\n                            <rect key=\"frame\" x=\"2\" y=\"2\" width=\"394\" height=\"68\"/>\n                            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                            <subviews>\n                                <textField toolTip=\"IP/Machine Name of listening VNC viewer\" verticalHuggingPriority=\"750\" id=\"1714\">\n                                    <rect key=\"frame\" x=\"189\" y=\"35\" width=\"189\" height=\"22\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\"/>\n                                    <animations/>\n                                    <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" selectable=\"YES\" editable=\"YES\" state=\"on\" borderStyle=\"bezel\" alignment=\"left\" drawsBackground=\"YES\" id=\"1715\">\n                                        <font key=\"font\" metaFont=\"system\"/>\n                                        <color key=\"textColor\" name=\"textColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                        <color key=\"backgroundColor\" name=\"textBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    </textFieldCell>\n                                    <connections>\n                                        <action selector=\"performClick:\" target=\"1711\" id=\"1886\"/>\n                                    </connections>\n                                </textField>\n                                <textField verticalHuggingPriority=\"750\" id=\"1716\">\n                                    <rect key=\"frame\" x=\"14\" y=\"36\" width=\"170\" height=\"18\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                    <animations/>\n                                    <textFieldCell key=\"cell\" sendsActionOnEndEditing=\"YES\" alignment=\"right\" title=\"Viewer Host Name or IP:\" id=\"1717\">\n                                        <font key=\"font\" metaFont=\"system\"/>\n                                        <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                        <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    </textFieldCell>\n                                </textField>\n                                <textField toolTip=\"Port Number to connect listening VNC viewer\" verticalHuggingPriority=\"750\" id=\"1718\">\n                                    <rect key=\"frame\" x=\"189\" y=\"8\" width=\"74\" height=\"22\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\"/>\n                                    <animations/>\n                                    <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" selectable=\"YES\" editable=\"YES\" state=\"on\" borderStyle=\"bezel\" alignment=\"left\" drawsBackground=\"YES\" id=\"1719\">\n                                        <font key=\"font\" metaFont=\"system\"/>\n                                        <color key=\"textColor\" name=\"textColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                        <color key=\"backgroundColor\" name=\"textBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    </textFieldCell>\n                                    <connections>\n                                        <action selector=\"performClick:\" target=\"1711\" id=\"1887\"/>\n                                    </connections>\n                                </textField>\n                                <textField verticalHuggingPriority=\"750\" id=\"2002\">\n                                    <rect key=\"frame\" x=\"134\" y=\"9\" width=\"50\" height=\"19\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                    <string key=\"toolTip\">Display Number for VNC Server\nNote: This number+5900 is the port that will be used</string>\n                                    <animations/>\n                                    <textFieldCell key=\"cell\" sendsActionOnEndEditing=\"YES\" alignment=\"right\" title=\"Port:\" id=\"2003\">\n                                        <font key=\"font\" metaFont=\"system\"/>\n                                        <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                        <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    </textFieldCell>\n                                </textField>\n                            </subviews>\n                            <animations/>\n                        </view>\n                        <animations/>\n                        <color key=\"borderColor\" white=\"0.0\" alpha=\"0.41999999999999998\" colorSpace=\"calibratedWhite\"/>\n                        <color key=\"fillColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"calibratedWhite\"/>\n                        <font key=\"titleFont\" metaFont=\"smallSystemBold\"/>\n                    </box>\n                    <button toolTip=\"Add a listening VNC viewer.\" verticalHuggingPriority=\"750\" id=\"1711\">\n                        <rect key=\"frame\" x=\"314\" y=\"12\" width=\"101\" height=\"32\"/>\n                        <autoresizingMask key=\"autoresizingMask\" flexibleMinX=\"YES\"/>\n                        <animations/>\n                        <buttonCell key=\"cell\" type=\"push\" title=\"Connect\" bezelStyle=\"rounded\" alignment=\"center\" borderStyle=\"border\" inset=\"2\" id=\"1712\">\n                            <behavior key=\"behavior\" pushIn=\"YES\" lightByBackground=\"YES\" lightByGray=\"YES\"/>\n                            <font key=\"font\" metaFont=\"system\"/>\n                            <string key=\"keyEquivalent\" base64-UTF8=\"YES\">\nDQ\n</string>\n                        </buttonCell>\n                        <connections>\n                            <action selector=\"connectHost:\" target=\"1668\" id=\"1888\"/>\n                        </connections>\n                    </button>\n                    <button toolTip=\"Add a listening VNC viewer.\" verticalHuggingPriority=\"750\" id=\"1722\">\n                        <rect key=\"frame\" x=\"213\" y=\"12\" width=\"101\" height=\"32\"/>\n                        <autoresizingMask key=\"autoresizingMask\" flexibleMinX=\"YES\"/>\n                        <animations/>\n                        <buttonCell key=\"cell\" type=\"push\" title=\"Cancel\" bezelStyle=\"rounded\" alignment=\"center\" borderStyle=\"border\" inset=\"2\" id=\"1723\">\n                            <behavior key=\"behavior\" pushIn=\"YES\" lightByBackground=\"YES\" lightByGray=\"YES\"/>\n                            <font key=\"font\" metaFont=\"system\"/>\n                            <string key=\"keyEquivalent\" base64-UTF8=\"YES\">\nGw\n</string>\n                        </buttonCell>\n                        <connections>\n                            <action selector=\"cancelConnectHost:\" target=\"1668\" id=\"1898\"/>\n                        </connections>\n                    </button>\n                    <textField verticalHuggingPriority=\"750\" id=\"1724\">\n                        <rect key=\"frame\" x=\"14\" y=\"16\" width=\"197\" height=\"29\"/>\n                        <autoresizingMask key=\"autoresizingMask\"/>\n                        <animations/>\n                        <textFieldCell key=\"cell\" sendsActionOnEndEditing=\"YES\" title=\"Reverse Connection Message\" id=\"1725\">\n                            <font key=\"font\" metaFont=\"smallSystem\"/>\n                            <color key=\"textColor\" red=\"1\" green=\"0.0\" blue=\"0.0\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                            <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                        </textFieldCell>\n                    </textField>\n                </subviews>\n                <animations/>\n            </view>\n        </window>\n        <window title=\"System Server\" allowsToolTipsWhenApplicationIsInactive=\"NO\" autorecalculatesKeyViewLoop=\"NO\" releasedWhenClosed=\"NO\" visibleAtLaunch=\"NO\" frameAutosaveName=\"System Server\" animationBehavior=\"default\" id=\"1726\">\n            <windowStyleMask key=\"styleMask\" titled=\"YES\" closable=\"YES\" miniaturizable=\"YES\"/>\n            <windowPositionMask key=\"initialPositionMask\" leftStrut=\"YES\" rightStrut=\"YES\" topStrut=\"YES\" bottomStrut=\"YES\"/>\n            <rect key=\"contentRect\" x=\"610\" y=\"634\" width=\"430\" height=\"390\"/>\n            <rect key=\"screenRect\" x=\"0.0\" y=\"0.0\" width=\"2560\" height=\"1418\"/>\n            <value key=\"minSize\" type=\"size\" width=\"213\" height=\"107\"/>\n            <view key=\"contentView\" id=\"1727\">\n                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"430\" height=\"390\"/>\n                <autoresizingMask key=\"autoresizingMask\"/>\n                <subviews>\n                    <textField verticalHuggingPriority=\"750\" id=\"1730\">\n                        <rect key=\"frame\" x=\"20\" y=\"73\" width=\"376\" height=\"85\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" flexibleMinY=\"YES\"/>\n                        <animations/>\n                        <textFieldCell key=\"cell\" sendsActionOnEndEditing=\"YES\" alignment=\"left\" id=\"1731\">\n                            <font key=\"font\" metaFont=\"smallSystem\"/>\n                            <string key=\"title\">The System Server will start when the machine boots and display the console screen independent of users' desktop servers.  Specify connection preferences for the system server above.  Other preferences are shared with desktop servers.\n\nClipboard sharing is unavailable prior to Mac OS X 10.5</string>\n                            <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                            <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                        </textFieldCell>\n                    </textField>\n                    <box title=\"Connection Preferences\" id=\"1736\">\n                        <rect key=\"frame\" x=\"17\" y=\"162\" width=\"396\" height=\"221\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" flexibleMinY=\"YES\"/>\n                        <view key=\"contentView\" id=\"Jsc-iY-VGb\">\n                            <rect key=\"frame\" x=\"2\" y=\"2\" width=\"392\" height=\"201\"/>\n                            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                            <subviews>\n                                <textField verticalHuggingPriority=\"750\" id=\"1737\">\n                                    <rect key=\"frame\" x=\"3\" y=\"140\" width=\"125\" height=\"19\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                    <string key=\"toolTip\">Display Number for VNC Server\nNote: This number+5900 is the port that will be used</string>\n                                    <animations/>\n                                    <textFieldCell key=\"cell\" sendsActionOnEndEditing=\"YES\" alignment=\"right\" title=\"Display Number:\" id=\"1738\">\n                                        <font key=\"font\" metaFont=\"system\"/>\n                                        <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                        <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    </textFieldCell>\n                                </textField>\n                                <popUpButton verticalHuggingPriority=\"750\" id=\"1739\">\n                                    <rect key=\"frame\" x=\"130\" y=\"136\" width=\"94\" height=\"26\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" flexibleMinY=\"YES\"/>\n                                    <string key=\"toolTip\">Display Number for VNC Server\nNote: This number+5900 is the port that will be used</string>\n                                    <animations/>\n                                    <popUpButtonCell key=\"cell\" type=\"push\" title=\"Auto\" bezelStyle=\"rounded\" alignment=\"left\" lineBreakMode=\"clipping\" state=\"on\" borderStyle=\"borderAndBezel\" inset=\"2\" arrowPosition=\"arrowAtCenter\" preferredEdge=\"maxY\" selectedItem=\"1745\" id=\"1740\">\n                                        <behavior key=\"behavior\" pushIn=\"YES\" lightByBackground=\"YES\" lightByGray=\"YES\"/>\n                                        <font key=\"font\" metaFont=\"menu\"/>\n                                        <menu key=\"menu\" title=\"OtherViews\" id=\"1741\">\n                                            <items>\n                                                <menuItem title=\"Auto\" state=\"on\" id=\"1745\"/>\n                                                <menuItem title=\"0\" tag=\"5900\" id=\"1749\"/>\n                                                <menuItem title=\"1\" tag=\"5901\" id=\"1746\"/>\n                                                <menuItem title=\"2\" tag=\"5902\" id=\"1748\"/>\n                                                <menuItem title=\"3\" tag=\"5903\" id=\"1743\"/>\n                                                <menuItem title=\"4\" tag=\"5904\" id=\"1747\"/>\n                                                <menuItem title=\"5\" tag=\"5905\" id=\"1744\"/>\n                                                <menuItem title=\"6\" tag=\"5906\" id=\"1752\"/>\n                                                <menuItem title=\"7\" tag=\"5907\" id=\"1753\"/>\n                                                <menuItem title=\"8\" tag=\"5908\" id=\"1742\"/>\n                                                <menuItem title=\"9\" tag=\"5909\" id=\"1751\"/>\n                                                <menuItem title=\"--\" tag=\"99\" id=\"1750\"/>\n                                            </items>\n                                        </menu>\n                                    </popUpButtonCell>\n                                    <connections>\n                                        <action selector=\"changeSystemServerPort:\" target=\"1668\" id=\"1903\"/>\n                                    </connections>\n                                </popUpButton>\n                                <textField verticalHuggingPriority=\"750\" id=\"1754\">\n                                    <rect key=\"frame\" x=\"314\" y=\"139\" width=\"64\" height=\"22\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" flexibleMinX=\"YES\" flexibleMinY=\"YES\"/>\n                                    <string key=\"toolTip\">Port Number that VNC will use to  communicate.\nNote: Same as Display Number+5900\nNote: Same as Display Number+5900</string>\n                                    <animations/>\n                                    <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" selectable=\"YES\" editable=\"YES\" sendsActionOnEndEditing=\"YES\" state=\"on\" borderStyle=\"bezel\" alignment=\"left\" drawsBackground=\"YES\" id=\"1755\">\n                                        <font key=\"font\" metaFont=\"system\"/>\n                                        <color key=\"textColor\" name=\"textColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                        <color key=\"backgroundColor\" name=\"textBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    </textFieldCell>\n                                    <connections>\n                                        <action selector=\"changeSystemServerPort:\" target=\"1668\" id=\"1904\"/>\n                                    </connections>\n                                </textField>\n                                <textField toolTip=\"Name that the VNC viewer will see for this server.\" verticalHuggingPriority=\"750\" id=\"1758\">\n                                    <rect key=\"frame\" x=\"24\" y=\"168\" width=\"104\" height=\"20\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                    <animations/>\n                                    <textFieldCell key=\"cell\" sendsActionOnEndEditing=\"YES\" alignment=\"right\" title=\"Display Name:\" id=\"1759\">\n                                        <font key=\"font\" metaFont=\"system\"/>\n                                        <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                        <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    </textFieldCell>\n                                </textField>\n                                <textField toolTip=\"Name that the VNC viewer will see for this server.\" verticalHuggingPriority=\"750\" id=\"1760\">\n                                    <rect key=\"frame\" x=\"133\" y=\"169\" width=\"245\" height=\"22\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" flexibleMinY=\"YES\"/>\n                                    <animations/>\n                                    <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" selectable=\"YES\" editable=\"YES\" sendsActionOnEndEditing=\"YES\" state=\"on\" borderStyle=\"bezel\" alignment=\"left\" title=\"Mac OS X\" drawsBackground=\"YES\" id=\"1761\">\n                                        <font key=\"font\" metaFont=\"system\"/>\n                                        <color key=\"textColor\" name=\"textColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                        <color key=\"backgroundColor\" name=\"textBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    </textFieldCell>\n                                    <connections>\n                                        <action selector=\"saveUserDefaults:\" target=\"1668\" id=\"1905\"/>\n                                    </connections>\n                                </textField>\n                                <box title=\"Authentication\" id=\"1762\">\n                                    <rect key=\"frame\" x=\"13\" y=\"7\" width=\"366\" height=\"121\"/>\n                                    <autoresizingMask key=\"autoresizingMask\"/>\n                                    <view key=\"contentView\" id=\"0lc-Hl-MQJ\">\n                                        <rect key=\"frame\" x=\"2\" y=\"2\" width=\"362\" height=\"104\"/>\n                                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                        <subviews>\n                                            <textField verticalHuggingPriority=\"750\" id=\"1763\">\n                                                <rect key=\"frame\" x=\"167\" y=\"72\" width=\"88\" height=\"22\"/>\n                                                <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" flexibleMinY=\"YES\"/>\n                                                <string key=\"toolTip\">Password required to connect with VNC Client.\nNote: Size is not preserved</string>\n                                                <animations/>\n                                                <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" selectable=\"YES\" editable=\"YES\" sendsActionOnEndEditing=\"YES\" state=\"on\" borderStyle=\"bezel\" alignment=\"left\" drawsBackground=\"YES\" id=\"1764\">\n                                                    <font key=\"font\" metaFont=\"system\"/>\n                                                    <color key=\"textColor\" name=\"textColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                    <color key=\"backgroundColor\" name=\"textBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                </textFieldCell>\n                                                <connections>\n                                                    <action selector=\"changeSystemServerAuthentication:\" target=\"1668\" id=\"1907\"/>\n                                                    <outlet property=\"delegate\" destination=\"1668\" id=\"1848\"/>\n                                                </connections>\n                                            </textField>\n                                            <matrix verticalHuggingPriority=\"750\" allowsEmptySelection=\"NO\" autosizesCells=\"NO\" id=\"1765\">\n                                                <rect key=\"frame\" x=\"27\" y=\"53\" width=\"116\" height=\"38\"/>\n                                                <autoresizingMask key=\"autoresizingMask\"/>\n                                                <animations/>\n                                                <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                <size key=\"cellSize\" width=\"116\" height=\"18\"/>\n                                                <size key=\"intercellSpacing\" width=\"4\" height=\"2\"/>\n                                                <buttonCell key=\"prototype\" type=\"radio\" title=\"Radio\" imagePosition=\"left\" alignment=\"left\" inset=\"2\" id=\"1768\">\n                                                    <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                    <font key=\"font\" metaFont=\"system\"/>\n                                                </buttonCell>\n                                                <cells>\n                                                    <column>\n                                                        <buttonCell type=\"radio\" title=\"VNC Password\" imagePosition=\"left\" alignment=\"left\" state=\"on\" toolTip=\"Password required to connect with VNC Client\" tag=\"1\" inset=\"2\" id=\"1767\">\n                                                            <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                            <font key=\"font\" metaFont=\"system\"/>\n                                                        </buttonCell>\n                                                        <buttonCell type=\"radio\" title=\"None\" imagePosition=\"left\" alignment=\"left\" tag=\"2\" inset=\"2\" id=\"1766\">\n                                                            <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                            <font key=\"font\" metaFont=\"system\"/>\n                                                        </buttonCell>\n                                                    </column>\n                                                </cells>\n                                                <connections>\n                                                    <action selector=\"changeSystemServerAuthentication:\" target=\"1668\" id=\"1908\"/>\n                                                </connections>\n                                            </matrix>\n                                            <button id=\"1769\">\n                                                <rect key=\"frame\" x=\"27\" y=\"9\" width=\"379\" height=\"18\"/>\n                                                <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                                <animations/>\n                                                <buttonCell key=\"cell\" type=\"check\" title=\"Require Remote Login (SSH)\" bezelStyle=\"regularSquare\" imagePosition=\"left\" alignment=\"left\" inset=\"2\" id=\"1770\">\n                                                    <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                                    <font key=\"font\" metaFont=\"system\"/>\n                                                </buttonCell>\n                                                <connections>\n                                                    <action selector=\"saveUserDefaults:\" target=\"1668\" id=\"1909\"/>\n                                                </connections>\n                                            </button>\n                                        </subviews>\n                                        <animations/>\n                                    </view>\n                                    <animations/>\n                                    <color key=\"borderColor\" white=\"0.0\" alpha=\"0.41999999999999998\" colorSpace=\"calibratedWhite\"/>\n                                    <color key=\"fillColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"calibratedWhite\"/>\n                                </box>\n                                <textField verticalHuggingPriority=\"750\" id=\"2000\">\n                                    <rect key=\"frame\" x=\"259\" y=\"140\" width=\"50\" height=\"19\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                    <string key=\"toolTip\">Display Number for VNC Server\nNote: This number+5900 is the port that will be used</string>\n                                    <animations/>\n                                    <textFieldCell key=\"cell\" sendsActionOnEndEditing=\"YES\" alignment=\"right\" title=\"Port:\" id=\"2001\">\n                                        <font key=\"font\" metaFont=\"system\"/>\n                                        <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                        <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    </textFieldCell>\n                                </textField>\n                            </subviews>\n                            <animations/>\n                        </view>\n                        <animations/>\n                        <color key=\"borderColor\" white=\"0.0\" alpha=\"0.41999999999999998\" colorSpace=\"calibratedWhite\"/>\n                        <color key=\"fillColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"calibratedWhite\"/>\n                        <font key=\"titleFont\" metaFont=\"system\"/>\n                    </box>\n                    <textField verticalHuggingPriority=\"750\" id=\"1732\">\n                        <rect key=\"frame\" x=\"20\" y=\"52\" width=\"368\" height=\"17\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <animations/>\n                        <textFieldCell key=\"cell\" lineBreakMode=\"clipping\" sendsActionOnEndEditing=\"YES\" alignment=\"left\" title=\"System Server Text\" id=\"1733\">\n                            <font key=\"font\" metaFont=\"systemBold\"/>\n                            <color key=\"textColor\" red=\"0.0\" green=\"0.0\" blue=\"0.0\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                            <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                        </textFieldCell>\n                    </textField>\n                    <button verticalHuggingPriority=\"750\" id=\"1734\">\n                        <rect key=\"frame\" x=\"17\" y=\"12\" width=\"160\" height=\"32\"/>\n                        <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n                        <animations/>\n                        <buttonCell key=\"cell\" type=\"push\" title=\"Stop System Server\" bezelStyle=\"rounded\" alignment=\"center\" borderStyle=\"border\" inset=\"2\" id=\"1735\">\n                            <behavior key=\"behavior\" pushIn=\"YES\" lightByBackground=\"YES\" lightByGray=\"YES\"/>\n                            <font key=\"font\" metaFont=\"system\"/>\n                        </buttonCell>\n                        <connections>\n                            <action selector=\"removeService:\" target=\"1668\" id=\"1884\"/>\n                        </connections>\n                    </button>\n                    <button verticalHuggingPriority=\"750\" id=\"1728\">\n                        <rect key=\"frame\" x=\"249\" y=\"12\" width=\"167\" height=\"32\"/>\n                        <autoresizingMask key=\"autoresizingMask\" flexibleMinX=\"YES\" flexibleMaxY=\"YES\"/>\n                        <animations/>\n                        <buttonCell key=\"cell\" type=\"push\" title=\"Start System Server\" bezelStyle=\"rounded\" alignment=\"center\" borderStyle=\"border\" inset=\"2\" id=\"1729\">\n                            <behavior key=\"behavior\" pushIn=\"YES\" lightByBackground=\"YES\" lightByGray=\"YES\"/>\n                            <font key=\"font\" metaFont=\"system\"/>\n                        </buttonCell>\n                        <connections>\n                            <action selector=\"installAsService:\" target=\"1668\" id=\"1879\"/>\n                        </connections>\n                    </button>\n                </subviews>\n                <animations/>\n            </view>\n        </window>\n        <window title=\"Window\" allowsToolTipsWhenApplicationIsInactive=\"NO\" autorecalculatesKeyViewLoop=\"NO\" releasedWhenClosed=\"NO\" visibleAtLaunch=\"NO\" animationBehavior=\"default\" id=\"1771\">\n            <windowStyleMask key=\"styleMask\" titled=\"YES\" closable=\"YES\" miniaturizable=\"YES\" resizable=\"YES\"/>\n            <windowPositionMask key=\"initialPositionMask\" leftStrut=\"YES\" rightStrut=\"YES\" topStrut=\"YES\" bottomStrut=\"YES\"/>\n            <rect key=\"contentRect\" x=\"207\" y=\"859\" width=\"382\" height=\"164\"/>\n            <rect key=\"screenRect\" x=\"0.0\" y=\"0.0\" width=\"2560\" height=\"1418\"/>\n            <value key=\"minSize\" type=\"size\" width=\"213\" height=\"107\"/>\n            <view key=\"contentView\" id=\"1772\">\n                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"382\" height=\"164\"/>\n                <autoresizingMask key=\"autoresizingMask\"/>\n                <subviews>\n                    <textField verticalHuggingPriority=\"750\" id=\"1773\">\n                        <rect key=\"frame\" x=\"218\" y=\"81\" width=\"88\" height=\"22\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" flexibleMinY=\"YES\"/>\n                        <string key=\"toolTip\">Password required to connect with VNC Client.\nNote: Password length is not preserved</string>\n                        <animations/>\n                        <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" selectable=\"YES\" editable=\"YES\" sendsActionOnEndEditing=\"YES\" state=\"on\" borderStyle=\"bezel\" alignment=\"left\" drawsBackground=\"YES\" id=\"1774\">\n                            <font key=\"font\" metaFont=\"system\"/>\n                            <color key=\"textColor\" name=\"textColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                            <color key=\"backgroundColor\" name=\"textBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                        </textFieldCell>\n                        <connections>\n                            <action selector=\"validateInitialAuthentication:\" target=\"1668\" id=\"1911\"/>\n                            <outlet property=\"delegate\" destination=\"1668\" id=\"1849\"/>\n                        </connections>\n                    </textField>\n                    <matrix verticalHuggingPriority=\"750\" allowsEmptySelection=\"NO\" autosizesCells=\"NO\" id=\"1775\">\n                        <rect key=\"frame\" x=\"84\" y=\"62\" width=\"134\" height=\"38\"/>\n                        <autoresizingMask key=\"autoresizingMask\"/>\n                        <animations/>\n                        <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                        <size key=\"cellSize\" width=\"134\" height=\"18\"/>\n                        <size key=\"intercellSpacing\" width=\"4\" height=\"2\"/>\n                        <buttonCell key=\"prototype\" type=\"radio\" title=\"Radio\" imagePosition=\"left\" alignment=\"left\" inset=\"2\" id=\"1778\">\n                            <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                            <font key=\"font\" metaFont=\"system\"/>\n                        </buttonCell>\n                        <cells>\n                            <column>\n                                <buttonCell type=\"radio\" title=\"VNC Password\" imagePosition=\"left\" alignment=\"left\" state=\"on\" toolTip=\"Password required to connect with VNC Client\" tag=\"1\" inset=\"2\" id=\"1777\">\n                                    <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                    <font key=\"font\" metaFont=\"system\"/>\n                                </buttonCell>\n                                <buttonCell type=\"radio\" title=\"None\" imagePosition=\"left\" alignment=\"left\" tag=\"2\" inset=\"2\" id=\"1776\">\n                                    <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                    <font key=\"font\" metaFont=\"system\"/>\n                                </buttonCell>\n                            </column>\n                        </cells>\n                        <connections>\n                            <action selector=\"validateInitialAuthentication:\" target=\"1668\" id=\"1912\"/>\n                        </connections>\n                    </matrix>\n                    <textField verticalHuggingPriority=\"750\" id=\"1779\">\n                        <rect key=\"frame\" x=\"17\" y=\"111\" width=\"357\" height=\"40\"/>\n                        <autoresizingMask key=\"autoresizingMask\"/>\n                        <animations/>\n                        <textFieldCell key=\"cell\" sendsActionOnEndEditing=\"YES\" title=\"Before accepting connections from VNC clients you must select an authentication type:\" id=\"1780\">\n                            <font key=\"font\" metaFont=\"system\"/>\n                            <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                            <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                        </textFieldCell>\n                    </textField>\n                    <button verticalHuggingPriority=\"750\" id=\"1781\">\n                        <rect key=\"frame\" x=\"286\" y=\"12\" width=\"82\" height=\"32\"/>\n                        <autoresizingMask key=\"autoresizingMask\"/>\n                        <animations/>\n                        <buttonCell key=\"cell\" type=\"push\" title=\"Done\" bezelStyle=\"rounded\" alignment=\"center\" enabled=\"NO\" borderStyle=\"border\" inset=\"2\" id=\"1782\">\n                            <behavior key=\"behavior\" pushIn=\"YES\" lightByBackground=\"YES\" lightByGray=\"YES\"/>\n                            <font key=\"font\" metaFont=\"system\"/>\n                            <string key=\"keyEquivalent\" base64-UTF8=\"YES\">\nDQ\n</string>\n                        </buttonCell>\n                        <connections>\n                            <action selector=\"setInitialAuthentication:\" target=\"1668\" id=\"1913\"/>\n                        </connections>\n                    </button>\n                </subviews>\n                <animations/>\n            </view>\n        </window>\n    </objects>\n</document>\n"
  },
  {
    "path": "Bundles/Echoware/ACConnection.cpp",
    "content": "#include \"StdAfx.h\"\n#include \"acconnection.h\"\n#include \"ProxyConnection.h\"\n#include \"DllProxyInfo.h\"\n#include \"NetPacket.h\"\n\n#include <sys/cdefs.h>\n#include <sys/utfconv.h>\n#include <libkern/OSByteOrder.h>\n//#include <CoreFoundation/CFByteOrder.h>\n\nusing namespace APISocket;\n\n//time for send live message\n#define SEND_LIVE_MESSAGE\t10000\n\nCACConnection::CACConnection(CProxyConnection* pProxyConnection) : CClientSocket()\n{\n\tm_pProxyConnection = pProxyConnection;\n\n\tm_nEncryptionLevel = 1;\n\n\tm_bConnected = false;\n\tm_bStopConnecting = false;\n\n\tm_dwConnectingStatus=0;\n\n\tm_pReadBuffer = new CBuffer();\n\tm_pSendBuffer = new CBuffer();\n\n\tm_dwLastIsAliveMsg = GetTickCount();\n}\n\nCACConnection::~CACConnection(void)\n{\n\tStopSend(THREAD_STOP_TIMEOUT);\n\n\tClose();\n\n\tdelete m_pReadBuffer;\n\tdelete m_pSendBuffer;\n}\n\nvoid CACConnection::StopConnect()\n{\n\tm_bStopConnecting = true;\n}\n\n//connect the socket to szIP on port nPort\n//first, try directly and if failed then try use proxy settings\nbool CACConnection::Connect(const char* szIP, unsigned int nPort)\n{\n\tbool res = false;\n\tif (CClientSocket::Connect(szIP, nPort) == 0)\n\t\tres = true;\n\n\tif (!res)\n\t\tres = g_globals.m_proxiesManager.ConnectViaProxy(this, szIP, nPort);\n\n\treturn res;\n}\n\n//try connect to echoServer\nint CACConnection::Connect()\n{\n\tint nRet=CONNECTION_SUCCESSFUL;\n\n\tif (m_bConnected)\n\t{\n\t\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_CONNECTING, false);\n\t\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_AUTHENTICATING, false);\n\t\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_AUTHENTICATION_FAILED, false);\n\t\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_ESTABLISHING_DATA_CHANNEL, false);\n\t\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_SEARCHING_FOR_PARTNER, false);\n\t\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_DISCONNECTED_FROM_PROXY, false);\n\t\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_CONNECTED, true);\n\t\treturn PROXY_ALREADY_CONNECTED;\n\t}\n\n\t//create the socket\n\tCreate();\n\n\tg_globals.m_logger.Write(\"CACConnection: Enter connect\");\n\n\tm_critSection.Lock();\n\n\tCDllProxyInfo* pProxyInfo = m_pProxyConnection->GetProxyInfo();\n\n\tif (pProxyInfo->GetConnectTimeout()!=-1)\n\t{\n\t\tg_globals.m_logger.WriteFormated(\"CACConnection: Timeout=%d\", pProxyInfo->GetConnectTimeout());\n\n\t\t//set the connection timeout\n\t\tCClientSocket::SetTimeouts(pProxyInfo->GetConnectTimeout()*1000);\n\t\tSetBlockMode(false);\n\t}\n\n\tpProxyInfo->SetStatus(STATUS_DISCONNECTED_FROM_PROXY, false);\n\n\tg_globals.m_logger.WriteFormated(\"\\tCACConnection: Try connect %s:%s %s\", pProxyInfo->GetIP(), pProxyInfo->GetPort(), pProxyInfo->GetMyID());\n\n\t//connect\n\tbool a = Connect(pProxyInfo->GetIP(), atoi(pProxyInfo->GetPort()));\n\tif (a)\n\t{\n\t\tCClientSocket::SetTimeouts(pProxyInfo->GetConnectTimeout()*1000, pProxyInfo->GetSendTimeout()*1000, pProxyInfo->GetReceiveTimeout()*1000);\n\t\tunsigned int conn_timeout = (unsigned int)pProxyInfo->GetConnectTimeout() * 1000;\n\t\tm_pReadBuffer->Empty();\n\t\tm_pSendBuffer->Empty();\n\n\t\tm_dwConnectingStatus = STATUS_CONNECTING;\n\t\tm_bConnected = true;\n\n\t\tStartRoutine();\n\t\tSendMessage(MSG_PROXY_CONNECTED, 0, 0);\n\t\tif (errored)\n\t\t\tm_bStopConnecting = true;\n\n\t\tg_globals.m_logger.Write(\"\\t\\tCACConnection: connected\");\n\n\t\tDWORD dwStartTime = GetTickCount();\n\n\t\twhile (m_dwConnectingStatus != STATUS_CONNECTED && m_dwConnectingStatus != STATUS_AUTHENTICATION_FAILED)\n\t\t{\n\t\t\tif (m_bStopConnecting)\n\t\t\t\tbreak;\n\n\t\t\tSleep(5000);\n\n\t\t\tif (GetTickCount() - dwStartTime > conn_timeout)\n\t\t\t\tbreak;\n\t\t}\n\t\tg_globals.m_logger.Write(\"\\t\\tCACConnection: connected2\");\n\n\t\tswitch(m_dwConnectingStatus)\n\t\t{\n\t\tcase STATUS_CONNECTED:\n\t\t\tm_bConnected = true;\n\t\t\tnRet=CONNECTION_SUCCESSFUL;\n\t\t\tpProxyInfo->SetStatus(STATUS_CONNECTING, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_AUTHENTICATING, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_AUTHENTICATION_FAILED, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_ESTABLISHING_DATA_CHANNEL, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_SEARCHING_FOR_PARTNER, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_DISCONNECTED_FROM_PROXY, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_CONNECTED, true);\n\t\t\tpProxyInfo->SetReconnectProxy(true);\n\t\t\tbreak;\n\t\tcase STATUS_AUTHENTICATION_FAILED:\n\t\t\tm_bConnected = true;\n\t\t\tnRet=AUTHENTICATION_FAILED;\n\t\t\tpProxyInfo->SetStatus(STATUS_CONNECTING, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_AUTHENTICATING, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_AUTHENTICATION_FAILED, true);\n\t\t\tpProxyInfo->SetStatus(STATUS_ESTABLISHING_DATA_CHANNEL, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_SEARCHING_FOR_PARTNER, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_DISCONNECTED_FROM_PROXY, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_CONNECTED, false);\n\t\t\tpProxyInfo->SetReconnectProxy(false);\n\t\t\tbreak;\n\t\tcase STATUS_AUTHENTICATING:\n\t\t\tm_bConnected = false;\n\t\t\tnRet=CONNECTION_TIMED_OUT;\n\t\t\tpProxyInfo->SetStatus(STATUS_CONNECTING, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_AUTHENTICATING, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_AUTHENTICATION_FAILED, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_ESTABLISHING_DATA_CHANNEL, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_SEARCHING_FOR_PARTNER, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_DISCONNECTED_FROM_PROXY, true);\n\t\t\tpProxyInfo->SetStatus(STATUS_CONNECTED, false);\n\t\t\tbreak;\n\t\tcase STATUS_CONNECTING:\n\t\t\tm_bConnected = false;\n\t\t\tnRet=CONNECTION_TIMED_OUT;\n\t\t\tpProxyInfo->SetStatus(STATUS_CONNECTING, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_AUTHENTICATING, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_AUTHENTICATION_FAILED, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_ESTABLISHING_DATA_CHANNEL, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_SEARCHING_FOR_PARTNER, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_DISCONNECTED_FROM_PROXY, true);\n\t\t\tpProxyInfo->SetStatus(STATUS_CONNECTED, false);\n\t\t\tbreak;\n\t\tcase STATUS_DISCONNECTED_FROM_PROXY:\n\t\t\tm_bConnected = false;\n\t\t\tnRet=ERROR_CONNECTING_TO_PROXY;\n\t\t\tpProxyInfo->SetStatus(STATUS_CONNECTING, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_AUTHENTICATING, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_AUTHENTICATION_FAILED, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_ESTABLISHING_DATA_CHANNEL, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_SEARCHING_FOR_PARTNER, false);\n\t\t\tpProxyInfo->SetStatus(STATUS_DISCONNECTED_FROM_PROXY, true);\n\t\t\tpProxyInfo->SetStatus(STATUS_CONNECTED, false);\n\t\t\tbreak;\n\t\t}\n\t}\n\telse\n\t{\n\t\tm_bConnected = false;\n\t\tpProxyInfo->SetStatus(STATUS_CONNECTED, false);\n\t\tnRet = NO_PROXY_SERVER_FOUND_TO_CONNECT;\n\t\tg_globals.m_logger.WriteFormated(\"\\t\\tCACConnection: not connected error: %d\", CClientSocket::GetLastError());\n\t}\n\n\tg_globals.m_logger.Write(\"\\tCACConnection: End Try connect\");\n\n\tm_critSection.Unlock();\n\n\tg_globals.m_logger.Write(\"CACConnection: Exit connect\");\n\tm_bStopConnecting = false;\n\n\treturn nRet;\n}\n\n//disconnect from echoServer\nbool CACConnection::Disconnect()\n{\n\tbool bRet = true;\n\n\tm_bStopConnecting = true;\n\tm_critSection.Lock();\n\n\tStopSend(THREAD_STOP_TIMEOUT);\n\tif (m_bConnected)\n\t{\n\t\tbRet = CClientSocket::Close();\n\t\tm_bConnected = !m_bConnected;\n\t}\n\n\tm_bStopConnecting = false;\n\tm_critSection.Unlock();\n\n\treturn bRet;\n}\n\n//sets the encryption level\nvoid CACConnection::SetEncryptionLevel(int level)\n{\n\tm_critSection.Lock();\n\n\tm_nEncryptionLevel = level;\n\n\tm_critSection.Unlock();\n}\n\n//process messages received from echoserver\n//there are received some data and try to process it\n//it is a notify message from CClientSocket\nvoid CACConnection::OnReceive(char* buff, int len)\n{\n\tm_pReadBuffer->Write(buff, len);\n\n\tchar szProxyEcho[sizeof(PROXY_ECHO)];\n\tif (m_pReadBuffer->Peak(szProxyEcho, sizeof(PROXY_ECHO))!=sizeof(PROXY_ECHO))\n\t{\n\t\tif (!strcmp(szProxyEcho, PROXY_ECHO))\n\t\t{\n\t\t\tm_pReadBuffer->Read(szProxyEcho, sizeof(PROXY_ECHO));\n\t\t\treturn;\n\t\t}\n\t}\n\n\tDWORD lenMsg=0;\n\n\tif (m_pReadBuffer->Peak(&lenMsg, sizeof(DWORD))!=sizeof(DWORD))\n\t\treturn;\n\tlenMsg=OSSwapLittleToHostInt32(lenMsg);\n\n\tchar* msg=new char[lenMsg];\n\tif (m_pReadBuffer->Peak(msg, lenMsg)!=lenMsg)\n\t{\n\t\tdelete []msg;\n\t\treturn;\n\t}\n\n\tm_pReadBuffer->Drop(lenMsg);\n\n\tNetPacketHeader netPacketHeader;\n\tmemcpy(&netPacketHeader, msg+sizeof(DWORD), sizeof(NetPacketHeader));\n\tnetPacketHeader.len = OSSwapLittleToHostInt32(netPacketHeader.len);\n\n\tCProxyMsg* pProxyMsg=(CProxyMsg*)(msg+sizeof(DWORD)+sizeof(NetPacketHeader));\n\tpProxyMsg->messageid = OSSwapLittleToHostInt32(pProxyMsg->messageid);\n\tpProxyMsg->datalength = OSSwapLittleToHostInt32(pProxyMsg->datalength);\n\n\tchar* pData=0;\n\n\tif (pProxyMsg->datalength)\n\t\tpData=((char*)pProxyMsg)+sizeof(CProxyMsg);\n\n\tif (pProxyMsg->messageid==MSG_PROXY_CONNECTED)\n\t{\n\t\tg_globals.m_logger.Write(\"CACConnection: Receive MSG_PROXY_CONNECTED\");\n\n\t\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_DISCONNECTED_FROM_PROXY, false);\n\n\t\tm_rsaKeys.Generate();\n\t\tSendMessage(MSG_PROXY_PUBLICKEY, (char*)m_rsaKeys.m_pPublicKeyLE, m_rsaKeys.GetPublicKeyLength());\n\t}\n\telse if (pProxyMsg->messageid==MSG_PROXY_PUBLICKEY)\n\t{\n\t\tg_globals.m_logger.Write(\"CACConnection: Receive MSG_PROXY_PUBLICKEY\");\n\n\t\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_AUTHENTICATING, true);\n\n\t\tm_dwConnectingStatus=STATUS_AUTHENTICATING;\n\n\t\tSendEncryptedPass(pData, pProxyMsg->datalength);\n\t}\n\telse if (pProxyMsg->messageid==MSG_PROXY_HANDSHAKEFAILED)\n\t{\n\t\tCClientSocket::Close();\n\t\tm_bConnected=false;\n\n\t\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_AUTHENTICATION_FAILED, true);\n\t\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_AUTHENTICATING, false);\n\n\t\tg_globals.m_logger.Write(\"CACConnection: Receive MSG_PROXY_HANDSHAKEFAILED\");\n\n\t\tm_dwConnectingStatus=STATUS_AUTHENTICATION_FAILED;\n\t}\n\telse if (pProxyMsg->messageid==MSG_PROXY_HANDSHAKECONFIRM)\n\t{\n\t\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_DISCONNECTED_FROM_PROXY, false);\n\n\t\tchar szServerName[ID_STRING_SIZE];\n\t\tstrcpy(szServerName, pData);\n\n\t\tif (strlen(szServerName))\n\t\t\tm_pProxyConnection->GetProxyInfo()->SetName(szServerName);\n\t\telse\n\t\t\tm_pProxyConnection->GetProxyInfo()->SetName((char*)m_pProxyConnection->GetProxyInfo()->GetIP());\n\t\t//1.926\n\t\tchar szPublicIP[ID_STRING_SIZE];\n\t\tchar szUserID[ID_STRING_SIZE];\n\t\tmemset(szPublicIP, 0, ID_STRING_SIZE);\n\t\tmemset(szUserID, 0, ID_STRING_SIZE);\n\t\tint nReceivedData = strlen(szServerName) + 1;\n\t\tif (nReceivedData < pProxyMsg->datalength)\n\t\t{\n\t\t\tstrcpy(szPublicIP, pData + nReceivedData);\n\t\t\tnReceivedData += strlen(szPublicIP) + 1;\n\t\t}\n\t\tif (nReceivedData < pProxyMsg->datalength)\n\t\t{\n\t\t\tmemcpy(szUserID, pData + nReceivedData, 255);\n\t\t}\n\t\tif (strlen(szUserID))\n\t\t{\n//2007.08.09\n\t\t\tchar szEmail[ID_STRING_SIZE];\n\t\t\tg_globals.ParseFormattedID(szUserID, ID_STRING_SIZE, szEmail);\n\t\t\tg_globals.m_logger.WriteFormated(\"CACConnection: Receive Client %s, Form %s\", szUserID, szEmail);\n\t\t\tm_pProxyConnection->GetProxyInfo()->SetMyID(szEmail);\n\t\t}\n\n\t\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_CONNECTED, true);\n\t\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_AUTHENTICATING, false);\n\t\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_CONNECTING, false);\n\n\t\tg_globals.m_logger.Write(\"CACConnection: Receive MSG_PROXY_HANDSHAKECONFIRM\");\n\n\t\tm_dwConnectingStatus=STATUS_CONNECTED;\n\t}\n\telse if (pProxyMsg->messageid==MSG_PROXY_DISCONNECTED)\n\t{\n\t\tCClientSocket::Close();\n\t\tm_bConnected=false;\n\n\t\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_DISCONNECTED_FROM_PROXY, true);\n\t\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_CONNECTED, false);\n\n\t\tg_globals.m_logger.Write(\"CACConnection: Receive MSG_PROXY_DISCONNECTED\");\n\t}\n\telse if (pProxyMsg->messageid==MSG_PROXY_DUPLICATE_LOGIN)\n\t{\n\t\tCClientSocket::Close();\n\t\tm_bConnected=false;\n\n\t\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_CONNECTED, false);\n\n\t\tm_dwConnectingStatus=STATUS_DISCONNECTED_FROM_PROXY;\n\n\t\tg_globals.m_logger.Write(\"CACConnection: Receive MSG_PROXY_DUPLICATE_LOGIN\");\n\t}\n\telse if (pProxyMsg->messageid==MSG_PROXY_PARTNERFOUND)\n\t{\n\t\tm_dwConnectingStatus=MSG_PROXY_PARTNERFOUND;\n\t\tg_globals.m_logger.Write(\"CACConnection: Receive MSG_PROXY_PARTNERFOUND\");\n\t}\n\telse if (pProxyMsg->messageid==MSG_PROXY_PARTNERNOTFOUND)\n\t{\n\t\tm_dwConnectingStatus=MSG_PROXY_PARTNERNOTFOUND;\n\t\tg_globals.m_logger.Write(\"CACConnection: Receive MSG_PROXY_PARTNERNOTFOUND\");\n\t}\n\telse if (pProxyMsg->messageid==MSG_CHANNEL_CODE)\n\t{\n\t\t/* initiator receives from echoserver */\n\n\t\tm_dwConnectingStatus=MSG_CHANNEL_CODE;\n\t\tg_globals.m_logger.WriteFormated(\"CACConnection: Receive MSG_CHANNEL_CODE %s\", pData);\n\t}\n\telse if (pProxyMsg->messageid==MSG_PEER_KEY)\n\t{\n\t\t/* initiator receives from echoserver (initiatorchannelcode/dhpart2) */\n\n\t\tm_dwConnectingStatus=MSG_PEER_KEY;\n\n\t\tmemcpy(m_szChannelCode, pData, CHANNEL_CODE_SIZE);\n\t\tm_szChannelCode[CHANNEL_CODE_SIZE]=0;\n\n#warning the RSA key? is that char or int data?\n\t\tmemcpy(m_szPeerPublicKey, pData+CHANNEL_CODE_SIZE, RSA_PUBLIC_KEY*sizeof(unsigned int));\n\t\tm_szPeerPublicKey[RSA_PUBLIC_KEY*sizeof(unsigned int)]=0;\n\n\t\tg_globals.m_logger.WriteFormated(\"CACConnection: Receive MSG_PEER_KEY, chanel code=%s\", m_szChannelCode);\n\t}\n\telse if (pProxyMsg->messageid==MSG_CONNECT_TO_PEER)\n\t{\n\t\t/* responder receives from echoserver (respchannelcode/respID/dhPart1) */\n\n\t\tg_globals.m_logger.Write(\"CACConnection: Receive MSG_CONNECT_TO_PEER 1\");\n\n\t\tm_dwConnectingStatus=MSG_CONNECT_TO_PEER;\n\n\t\tmemcpy(m_szChannelCode, pData, CHANNEL_CODE_SIZE);\n\t\tm_szChannelCode[CHANNEL_CODE_SIZE]=0;\n\n\t\tmemcpy(m_szPeerID, pData+CHANNEL_CODE_SIZE, ID_STRING_SIZE);\n\t\tm_szPeerID[ID_STRING_SIZE]=0;\n#warning the RSA key? is that char or int data?\n\t\tmemcpy(m_szPeerPublicKey, pData+ID_STRING_SIZE+CHANNEL_CODE_SIZE, RSA_PUBLIC_KEY*sizeof(unsigned int));\n\t\tm_szPeerPublicKey[RSA_PUBLIC_KEY*sizeof(unsigned int)]=0;\n\n\t\tchar *pBuff = NULL;\n\t\tDWORD dwTotalLength = 0;\n\t\tDWORD dwTemp = 0;\n\n\t\t/* responder sends MSG_PEER_KEY to echoserver\n\t\t\t(initiatorId,dhpart2,respchannelcode) */\n\n\t\tdwTotalLength += CHANNEL_CODE_SIZE;//sizeof(m_szChannelCode);\n\t\tdwTotalLength += ID_STRING_SIZE;//sizeof(m_szPeerID);\n\t\tdwTotalLength += m_rsaKeys.GetPublicKeyLength();\n\t\tpBuff = new char[dwTotalLength];\n\n\t\tmemset(pBuff,0,dwTotalLength);// Total Buffer size\n\t\tmemcpy(pBuff,m_szPeerID,sizeof(m_szPeerID));\n\t\tdwTemp = ID_STRING_SIZE;//sizeof(m_szPeerID);\n\t\tmemcpy(pBuff + dwTemp,m_szChannelCode, sizeof(m_szChannelCode));\n\t\tdwTemp += CHANNEL_CODE_SIZE;//sizeof(m_szChannelCode);\n\n\t\t/* set DHpart2 to all zero if no encryption */\n\t\tif (m_nEncryptionLevel==1)\n\t\t\tmemcpy(pBuff+dwTemp, (char*)m_rsaKeys.m_pPublicKeyLE, m_rsaKeys.GetPublicKeyLength());\n\t\telse\n\t\t\tmemset(pBuff+dwTemp, 0, m_rsaKeys.GetPublicKeyLength());\n\n\n\t\tg_globals.m_logger.WriteFormated(\"CACConnection: Receive MSG_CONNECT_TO_PEER 2, channel code=%s\", m_szChannelCode);\n\n\t\tSendMessage(MSG_PEER_KEY,pBuff,dwTotalLength);\n\n\t\tg_globals.m_logger.WriteFormated(\"CACConnection: Receive MSG_CONNECT_TO_PEER 3, channel code=%s\", m_szChannelCode);\n\n\t\tdelete []pBuff;\n\n\t\tm_pProxyConnection->OnRemotePartnerConnect(m_szChannelCode, m_szPeerID, m_szPeerPublicKey);\n\n\t\tg_globals.m_logger.WriteFormated(\"CACConnection: Receive MSG_CONNECT_TO_PEER end, channel code=%s\", m_szChannelCode);\n\t}\n\telse if (pProxyMsg->messageid==MSG_ISALIVE)\n\t{\n\t\tg_globals.m_logger.Write(\"CACConnection: Receive MSG_ISALIVE\");\n\t}\n\n\tdelete []msg;\n}\n\n//send data to echoServer\n//if the send buffer contain data, then this data is read it for send to echoServer\n//if there are no data to send, then send IsAliveMessage if is time to do it\n//it is a notify message from CClientSocket\nvoid CACConnection::OnSend(char* buff, int& len)\n{\n\tif (!m_bConnected)\n\t{\n\t\tlen=0;\n\t\treturn;\n\t}\n\n\tlen=m_pSendBuffer->Read(buff, len);\n}\n\nvoid CACConnection::OnTimer()\n{\n\tAPISocket::CClientSocket::OnTimer();\n\n\tif (!m_pSendBuffer->Size() && m_bConnected &&\n\t\t\tGetTickCount() - m_dwLastIsAliveMsg >= SEND_LIVE_MESSAGE)\n\t{\n\t\tm_dwLastIsAliveMsg = GetTickCount();\n\t\tSendMessage(MSG_ISALIVE, 0, 0);\n\t}\n}\n\n//compose message packet to send to echoServer\n//message : the message type\n//data : the message data\n//datalen : the message data length\nvoid CACConnection::SendMessage(DWORD message, char *data, unsigned int datalen)\n{\n\tchar*\tlpBuf = NULL;\n\tDWORD\tnBytesSent = 0;\n\n\tCProxyMsg msg(message);\n\n\tNetPacketHeader header;\n\n\theader.len = msg.MakeMessage(&header, lpBuf, data, datalen);//create the message\n\n\tDWORD dwToSend=OSSwapHostToLittleInt32(header.len+sizeof(DWORD));\n\tm_pSendBuffer->Write(&dwToSend, sizeof(DWORD));\n\tm_pSendBuffer->Write(lpBuf, header.len);\n\tSend();\n\n\tif (lpBuf)\n\t\tdelete lpBuf;\n}\n\n//compose MSG_PROXY_PASSWORD message packet\nvoid CACConnection::SendEncryptedPass(char * pData,DWORD dwDataLength)\n{\n\tchar pEncPass[1024];\n\n\tm_rsaKeys.EncryptPassword(pData, dwDataLength, m_pProxyConnection->GetProxyInfo()->GetPassword(), pEncPass);\n\n\tchar szEmail[ID_STRING_SIZE];\n\tif (g_globals.GetFormattedID(szEmail, ID_STRING_SIZE, m_pProxyConnection->GetProxyInfo()->GetMyID()) == -1)\n\t\treturn;\n\tconst int nTotalPkgSize = 1024 + ID_STRING_SIZE+ sizeof(DWORD);\n\tchar szTotalData[nTotalPkgSize];\n\tmemset(szTotalData, 0, nTotalPkgSize);\n\tmemcpy(szTotalData, pEncPass,1024);\n\tmemcpy(szTotalData + 1024, szEmail, ID_STRING_SIZE);\n\n\tSendMessage(MSG_PROXY_PASSWORD, szTotalData, nTotalPkgSize);\n}\n\n//calback function, notify that there was an error on read or send data to echoserver on this channel\n//it is a notify message from CClientSocket\nvoid CACConnection::OnError(int error)\n{\n\tCClientSocket::OnError(error);\n\tm_bStopConnecting = true;\n\tm_pProxyConnection->OnError(error);\n\n\tCDllProxyInfo* pProxyInfo=m_pProxyConnection->GetProxyInfo();\n\tpProxyInfo->SetStatus(STATUS_CONNECTED, false);\n\tpProxyInfo->SetStatus(STATUS_DISCONNECTED_FROM_PROXY, true);\n\n\tm_bConnected = false;\n}\n\n//find partner on echoServer\n//sends MSG_PROXY_FIND_PARTNER message and wait for echoServer answer\nbool CACConnection::FindPartner(const char* szPartener)\n{\n\tg_globals.m_logger.WriteFormated(\"CACConnection: FindPartner %s\", szPartener);\n\n\tif (!m_bConnected)\n\t{\n\t\tg_globals.m_logger.WriteFormated(\"CACConnection: FindPartner %s end, not connected\", szPartener);\n\t\treturn false;\n\t}\n\n\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_SEARCHING_FOR_PARTNER, true);\n\n\tchar sz[ID_STRING_SIZE];\n\tif (g_globals.GetFormattedID(sz, ID_STRING_SIZE, szPartener) == -1)\n\t\treturn false;\n\n\tm_dwConnectingStatus=0;\n\tSendMessage(MSG_PROXY_FIND_PARTNER, (char*)sz, (unsigned int)ID_STRING_SIZE);\n\n\tg_globals.m_logger.WriteFormated(\"CACConnection: FindPartner wait %d seconds\", m_pProxyConnection->GetProxyInfo()->GetConnectTimeout());\n\n\tDWORD dwStartTime=GetTickCount();\n\twhile (!m_dwConnectingStatus)\n\t{\n\t\tSleep(10000);\n\n\t\tif (GetTickCount()-dwStartTime>(unsigned int)m_pProxyConnection->GetProxyInfo()->GetConnectTimeout()*1000)\n\t\t\tbreak;\n\t}\n\n\tg_globals.m_logger.Write(\"CACConnection: FindPartner wait end\");\n\n\tm_pProxyConnection->GetProxyInfo()->SetStatus(STATUS_SEARCHING_FOR_PARTNER, false);\n\n\tg_globals.m_logger.WriteFormated(\"CACConnection: FindPartner status=%d\", m_dwConnectingStatus);\n\n\treturn (bool)(m_dwConnectingStatus==MSG_PROXY_PARTNERFOUND);\n}\n\n//try to connect to szPartner on echoServer\n//sends MSG_CONNECT_TO_PEER message and wait for echoServer answer\nbool CACConnection::ConnectToPeer(const char* szPartener, char* szChannelCode, char* szPeerPublicKey)\n{\n\tg_globals.m_logger.WriteFormated(\"CACConnection: Try connect to peer %s, channel code \", szPartener, szChannelCode);\n\n\tchar *pBuff = NULL;\n\tDWORD dwTotalLength = 0;\n\tDWORD dwTemp = 0;\n\n\tdwTotalLength += ID_STRING_SIZE;//(DWORD)strlen(szPartener)+1;\n\tdwTotalLength += m_rsaKeys.GetPublicKeyLength();\n\n\tpBuff = new char[dwTotalLength];\n\tmemset(pBuff, 0, dwTotalLength);\n\tg_globals.GetFormattedID(pBuff, ID_STRING_SIZE, szPartener);\n\tdwTemp = ID_STRING_SIZE;//(DWORD)strlen(szPartener)+1;\n\n\t/* set DHpart1 to all zero if no encryption */\n\tif (m_nEncryptionLevel==1)\n\t\tmemcpy(pBuff+dwTemp, m_rsaKeys.GetPublicKey(), m_rsaKeys.GetPublicKeyLength());\n\telse\n\t\tmemset(pBuff+dwTemp, 0, m_rsaKeys.GetPublicKeyLength());\n\n\tm_dwConnectingStatus=0;\n\n\tm_szPeerPublicKey[0]=m_szChannelCode[0]=0;\n\n\tSendMessage(MSG_CONNECT_TO_PEER, pBuff, dwTotalLength);\n\n\tdelete [] pBuff;\n\n\tDWORD dwStartTime=GetTickCount();\n\twhile (m_dwConnectingStatus!=MSG_PEER_KEY && m_dwConnectingStatus!=MSG_PROXY_PARTNERNOTFOUND)\n\t{\n\t\tSleep(10000);\n\n\t\tif (GetTickCount()-dwStartTime>(unsigned int)m_pProxyConnection->GetProxyInfo()->GetConnectTimeout()*1000)\n\t\t\tbreak;\n\t}\n\n\tif (m_dwConnectingStatus==MSG_PEER_KEY)\n\t{\n\t\tstrcpy(szChannelCode, m_szChannelCode);\n\t\tmemcpy(szPeerPublicKey, m_szPeerPublicKey, RSA_PUBLIC_KEY*sizeof(unsigned int));\n\t}\n\n\tif (m_dwConnectingStatus==MSG_PEER_KEY)\n\t\tg_globals.m_logger.WriteFormated(\"CACConnection: Success connect to peer %s, channel code \", szPartener, szChannelCode);\n\telse\n\t\tg_globals.m_logger.WriteFormated(\"CACConnection: Fail connect to peer %s, channel code \", szPartener, szChannelCode);\n\n\treturn m_dwConnectingStatus==MSG_PEER_KEY;\n}"
  },
  {
    "path": "Bundles/Echoware/ACConnection.h",
    "content": "#ifndef _ACCONNECTION_H\n#define _ACCONNECTION_H\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n#include \"APISocket.h\"\n#include \"CritSection.h\"\n#include \"RSAKeys.h\"\n\nclass CProxyConnection;\nclass CBuffer;\n\n/*\nAuthentication channel class\nIt is used for client authentication and identification on the echoServer\n*/\n\nclass CACConnection :\n\tpublic APISocket::CClientSocket\n{\npublic:\n\tCACConnection(CProxyConnection* pProxyConnection);\n\tvirtual ~CACConnection(void);\n\n\t//connect to echoServer\n\tint Connect();\n\n\t//disconnect from echoServer\n\tbool Disconnect();\n\n\tvoid StopConnect();\n\n\t//sets the encryption level\n\tvoid SetEncryptionLevel(int level);\n\n\t//find partner on echoServer\n\tbool FindPartner(const char* szPartener);\n\n\t//connect to peer on echoServer\n\tbool ConnectToPeer(const char* szPartener);\n\tbool ConnectToPeer(const char* szPartener, char* szChannelCode, char* szPeerPublicKey);\n\n\t//generate a session key from a public key\n\tchar* GenerateSessionKey(char* szSessionKey, char* szPeerPublicKey)\n\t{\n\t\tm_rsaKeys.GenerateSessionKey(szPeerPublicKey, szSessionKey);\n\t\treturn szSessionKey;\n\t}\n\nprotected:\n\t//overwrited notification functions\n\tvoid OnReceive(char* buff, int len);\n\tvoid OnSend(char* buff, int& len);\n\tvirtual void OnError(int error);\n\n\tvirtual void OnTimer();\n\n\t//construct message to send to echoServer\n\tvoid SendMessage(DWORD message, char *data, unsigned int datalen);\n\t//construct mesage MSG_PROXY_PASSWORD\n\tvoid SendEncryptedPass(char * pData,DWORD dwDataLength);\n\n\t//connect to szIP:nPort\n\tbool Connect(const char* szIP, unsigned int nPort);\n\nprotected:\n\tCCritSection m_critSection;\n\tint m_nEncryptionLevel;\n\n\t//parent proxy connection\n\tCProxyConnection* m_pProxyConnection;\n\n\tbool m_bStopConnecting;\n\tbool m_bConnected;\n\tint m_dwConnectingStatus;\n\n\t//buffers for recv/send on socket\n\tCBuffer* m_pReadBuffer;\n\tCBuffer* m_pSendBuffer;\n\n\tCRSAKeys m_rsaKeys;\n\tchar m_pRemotePublicKey[RSA_PUBLIC_KEY];\n\nprivate:\n\tchar m_szChannelCode[12];\n\tchar m_szPeerID[256];\n\tchar m_szPeerPublicKey[RSA_PUBLIC_KEY*sizeof(unsigned int)+1];\n\n\tDWORD m_dwLastIsAliveMsg;\n};\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/AES.cpp",
    "content": "#include \"StdAfx.h\"\n#include \"aes.h\"\n\nCAES::CAES(void)\n{\n}\n\nCAES::~CAES(void)\n{\n}\n\nvoid CAES::Decrypt(const unsigned char *in, int length, unsigned char *out)\n{\n\tCryptData(in, out, length, AES_DECRYPT);\n}\n\nvoid CAES::Encrypt(const unsigned char *in, int length, unsigned char *out)\n{\n\tCryptData(in, out, length, AES_ENCRYPT);\n}\n\nint CAES::SetDecryptKey(const unsigned char *userKey, const int bits)\n{\n\t//return AES_set_decrypt_key(userKey, bits, &m_aesDecKey);\n\n\tmemcpy(m_userDecKey, userKey, bits);\n\treturn 0;\n}\n\nint CAES::SetEncryptKey(const unsigned char *userKey, const int bits)\n{\n\t//return AES_set_encrypt_key(userKey, bits, &m_aesEncKey);\n\tmemcpy(m_userEncKey, userKey, bits);\n\treturn 0;\n}\n\nvoid CAES::CryptData(const unsigned char *in, unsigned char *out, int length, const int enc)\n{\n\tAES_KEY aesKey;\n\tif (AES_ENCRYPT == enc)\n\t\tAES_set_encrypt_key(m_userEncKey, 128, &aesKey);\n\telse\n\t\tAES_set_decrypt_key(m_userDecKey, 128, &aesKey);\n\n\tunsigned long len = length;\n\tunsigned char tmp[AES_BLOCK_SIZE];\n\n\twhile (len >= AES_BLOCK_SIZE)\n\t{\n\t\tmemset(tmp,0,AES_BLOCK_SIZE);\n\t\tmemcpy(tmp,in,AES_BLOCK_SIZE);\n\n\t\tif (AES_ENCRYPT == enc)\n\t\t{\n\t\t\tAES_encrypt(tmp, out, &aesKey);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tAES_decrypt(tmp, out, &aesKey);\n\t\t}\n\n\t\tlen -= AES_BLOCK_SIZE;\n\t\tin += AES_BLOCK_SIZE;\n\t\tout += AES_BLOCK_SIZE;\n\t}\n\n\tif (len)\n\t{\n\t\tmemset(tmp,0,AES_BLOCK_SIZE);\n\t\tmemcpy(tmp,in,AES_BLOCK_SIZE);\n\t\tif (AES_ENCRYPT == enc)\n\t\t{\n\t\t\tAES_encrypt(tmp, tmp, &aesKey);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tAES_decrypt(tmp, tmp, &aesKey);\n\t\t}\n\t\tmemcpy(out, tmp, AES_BLOCK_SIZE);\n\t}\n}"
  },
  {
    "path": "Bundles/Echoware/AES.h",
    "content": "#pragma once\n\n#include \"OpenSSL/aes.h\"\n\n//wrapper class for AES encryption\n\nclass CAES\n{\npublic:\n\tCAES(void);\n\t~CAES(void);\n\n\tvoid Decrypt(const unsigned char *in, int length, unsigned char *out);\n\tvoid Encrypt(const unsigned char *in, int length, unsigned char *out);\n\n\tint SetDecryptKey(const unsigned char *userKey, const int bits);\n\tint SetEncryptKey(const unsigned char *userKey, const int bits);\n\nprotected:\n\tvoid CryptData(const unsigned char *in, unsigned char *out, int length, const int enc);\n\nprotected:\n\tAES_KEY m_aesEncKey;\n\tAES_KEY m_aesDecKey;\n\npublic:\n\tunsigned char m_userDecKey[128];\n\tunsigned char m_userEncKey[128];\n};\n"
  },
  {
    "path": "Bundles/Echoware/APISocket/APISocket.h",
    "content": "#ifndef __APISOCKET__\n#define __APISOCKET__\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n#undef FD_SETSIZE\n#define FD_SETSIZE 1024\n\n#define __stdcall\n#define MAX_BUFFER\t(64*1024)\n\n#import <CoreFoundation/CoreFoundation.h>\n\n#include \"CritSection.h\"\n\nnamespace APISocket\n{\n\n//generic socket class\nclass CSocket\n{\npublic:\n\n\tCSocket(int sock=0);\n\n\tCSocket(const CSocket& other);\n\n\tvirtual ~CSocket();\n\n\t//[in]Timeouts in milliseconds\n\tvoid SetTimeouts(int nConnectTimeout=-1, int nSendTimeout=-1, int nRecvTimeout=-1, int nAcceptTimeOut=-1);\n\n\t//[in]bBlock : true for bloking socket, false for non-blocking socket\n\tvoid SetBlockMode(bool bBlock);\n\n\tint GetConnectTimeout();\n\tint GetSendTimeout();\n\tint GetRecvTimeout();\n\tint GetAcceptTimeout();\n\tbool GetBlockMode();\n\n\t//[in] nPort : port to bind\n\t//return : true or false\n\tvirtual bool Create(unsigned int nPort=0);\n\n\t//return : 0 fail, port bindit for ok\n\tunsigned int Bind(unsigned int nPort=0, bool bLocal=true);\n\n\t//[in] backlog\n\t//return : true or false\n\tbool Listen(int backlog=10);\n\n\t//return : -1 for error, 0 for success, 1 for timeout\n\tint Accept(int& sock);\n\n\t//[in] szServerIP\n\t//[in] nPort\n\t//connect socket to szServer (ip xxx.xxx.xxx.xxx or host name) on port nPort\n\t//return -1 for error, 0 for OK, 1 for timeout\n\tint Connect(const char* szServer, unsigned int nPort);\n\n\t//shutdown socket\n\t//[in] how : SD_RECEIVE, SD_SEND, SD_BOTH\n\t//return : true or false\n\tbool Shutdown(int how);\n\n\t//send\n\t//[in] buff : buff to send\n\t//[in] nLen : buff length\n\t//return -1 for error, 0 for OK, 1 for timeout\n\tint Send(const char* buff, int& nLen, int nFlag=0);\n\n\t//receive\n\t//[in] buff\n\t//[in, out] nLength : size of buff\n\t//[in] flag : 0, MSG_PEEK  or MSG_OOB\n\t//return -1 for error, 0 for OK, 1 for timeout\n\tint Receive(char* buff, int& nLength, int nFlag=0);\n\n\tbool Close();\n\n\tvirtual void OnClose();\n\tvirtual void OnError(int error);\n\tvirtual void OnReceive(char* buff, int len);\n\tvirtual void OnSend(char* buff, int &len);\n\n\t//gets the TCP_NODELAY socket option\n\t//return true for success and false for error to get the TCP_NODELAY socket option\n\tbool GetSockOption(bool& bTcpNodelay);\n\n\t//sets the TCP_NODELAY socket option\n\t//return true for success and false for error to set the TCP_NODELAY socket option\n\tbool SetSockOption(bool bTcpNodelay);\n\n\t//gets the socket last error\n\tint GetLastError();\n\n\tbool GetLocalPort(unsigned int& nPort);\n\tbool GetRemotePort(unsigned int& nPort);\n\tbool GetRemoteIP(char* szRemoteIP);\n\n\t//unsigned int GetSock(){return m_sock;};\n\n\t//atach a sock to this class\n\tint Attach(int sock);\n\n\t//detach the sock from this class\n\tint Detach();\n\n\tvoid OnWrite();\n\tvoid OnRead();\n\n\tint Send();\n\tint ReadableByteCount();\n\n\tint getSocket();\n\n\tbool StartAsync();\n\tbool StopAsync();\n\nprotected:\n\t//Set the socket to either blocking or non-blocking mode\n\t//[in] bNonBlock : true for non-blocking mode, false for blocking mode\n\t//return true or false\n\tbool NonBlock(bool bNonBlock);\n\n\t//[in] nTimeout in milliseconds\n\t//[in] nType 0 for read, 1 for write\n\t//return -1 for error, 0 for OK, 1 for timeout\n\tint WaitNonBlockCompletion(int nTimeout, int nType);\n\nprotected:\n\tint m_sock;\n\n\tint m_nConnectTimeout, m_nSendTimeout, m_nRecvTimeout, m_nAcceptTimeout;\n\n\tbool m_bBlockMode;\n\n\tvoid* m_hAsyncThread;\n\tunsigned long m_dwAsyncThread;\n\tbool shouldAsyncQuit;\n\tbool hasAsyncQuit;\n\n\tbool inAsyncNotificationLoop;\n\tbool errored;\n\n\tCCritSection m_csAsync;\n\tstatic unsigned long AsyncThreadProc(void* lpParameter);\n\tvoid AsyncNotifications();\n\tvoid AsyncNotificationLoop();\n};\n\n//a base class for client socket\nclass CClientSocket : public CSocket\n{\npublic:\n\tCClientSocket(int sock=0);\n\tvirtual ~CClientSocket(void);\n\n\t//start send data\n\tvirtual bool StartSend();\n\n\t//stop send data\n\t//[in] dwTimeout : milliseconds for waitting to stop\n\tbool StopSend(unsigned long dwWaitTimeout);\n\n\tvirtual void OnTimer();\n\nprotected:\n\n\tbool StartRoutine();\n\n\tbool StopRoutine(unsigned long dwWaitTimeout);\n\n\t//routine thread handle\n\tvoid* m_hRoutineThread;\n\n\t//routine thread id\n\tunsigned long m_dwRoutineThread;\n\n\t//some routine thread proc\n\tstatic unsigned long __stdcall RoutineThreadProc(void* lpParameter);\n\n\tbool routineShouldQuit;\n\tbool routineHasQuit;\n};\n\n//a base class for server socket\nclass CServerSocket : public CSocket\n{\npublic:\n\tCServerSocket(unsigned int nPort=0);\n\tvirtual ~CServerSocket(void);\n\n\t//return : true or false\n\tvirtual bool Create();\n\n\t//[in] backlog\n\t//return : true or false\n\tbool Listen(int backlog=10);\n\n\t//start waitting for clients\n\tbool StartAccept();\n\n\t//stop waitting for clients\n\t//[in] dwTimeout : milliseconds for waitting to stop\n\tbool StopAccept(unsigned long dwWaitTimeout);\n\n\t//notification : new client connected\n\tvirtual void OnNewClient(int sock);\n\n\tvirtual void OnLeaveClient(CSocket* pClient);\n\n\tunsigned int GetListenPort();\nprotected:\n\t//listen port\n\tunsigned int m_nPort;\n\n\t//accept thread handle\n\tvoid* m_hAcceptThread;\n\n\t//accept thread id\n\tunsigned long m_dwAcceptThread;\n\n\t//accept thread proc\n\tstatic unsigned long __stdcall AcceptThreadProc(void* lpParameter);\n\n\tbool shouldQuit;\n\tbool hasQuit;\n};\n}\n#endif"
  },
  {
    "path": "Bundles/Echoware/APISocket/ClientSocket.cpp",
    "content": "#include \"stdafx.h\"\n#include \"APISocket.h\"\n\n#include \"EchoToOSX.h\"\n\nAPISocket::CClientSocket::CClientSocket(int sock /*=0*/)\n\t:APISocket::CSocket(sock)\n{\n\tm_hRoutineThread=0;\n\tm_dwRoutineThread=0;\n}\n\nAPISocket::CClientSocket::~CClientSocket(void)\n{\n}\n\nbool APISocket::CClientSocket::StartSend()\n{\n\tbool res = StartRoutine();\n\tint ret = Send();\n\n\treturn res && (ret == 0);\n}\n\nbool APISocket::CClientSocket::StopSend(unsigned long dwWaitTimeout)\n{\n\treturn StopRoutine(dwWaitTimeout);\n}\n\nbool APISocket::CClientSocket::StartRoutine()\n{\n\tif (m_hRoutineThread)\n\t\treturn true;\n\n\troutineShouldQuit=0;\n\troutineHasQuit=0;\n\tif (!(m_hRoutineThread=CreateThread(0, 0, RoutineThreadProc, this, 0, &m_dwRoutineThread)))\n\t\treturn false;\n\treturn true;\n}\n\nbool APISocket::CClientSocket::StopRoutine(unsigned long dwWaitTimeout)\n{\n\tif (!m_hRoutineThread)\n\t\treturn true;\n\n\tbool termResult = ShutdownThread(m_hRoutineThread, dwWaitTimeout, &routineShouldQuit, &routineHasQuit);\n\tm_hRoutineThread=0;\n\tm_dwRoutineThread=0;\n\treturn termResult;\n}\n\nvoid APISocket::CClientSocket::OnTimer()\n{\n}\n\nunsigned long __stdcall APISocket::CClientSocket::RoutineThreadProc(void* lpParameter)\n{\n\tAPISocket::CClientSocket* pClient =\t(APISocket::CClientSocket*) lpParameter;\n\twhile (true)\n\t{\n\t\tif (pClient->routineShouldQuit)\n\t\t\tbreak;\n\t\tpClient->OnTimer();\n\t\tSleep(500000);\n\t}\n\tpClient->routineHasQuit = 1;\n\treturn 0;\n}"
  },
  {
    "path": "Bundles/Echoware/APISocket/ServerSocket.cpp",
    "content": "#include \"stdafx.h\"\n#include \"APISocket.h\"\n\nAPISocket::CServerSocket::CServerSocket(unsigned int nPort/*=0*/)\n\t:APISocket::CSocket()\n{\n\tm_nPort=nPort;\n\n\tm_hAcceptThread=0;\n\tm_dwAcceptThread=0;\n}\n\nAPISocket::CServerSocket::~CServerSocket(void)\n{\n}\n\nbool APISocket::CServerSocket::Create()\n{\n\tif (!CSocket::Create(m_nPort))\n\t\treturn false;\n\n\tif (!(m_nPort=Bind(m_nPort)))\n\t\treturn false;\n\n\treturn true;\n}\n\nbool APISocket::CServerSocket::Listen(int backlog)\n{\n\treturn CSocket::Listen();\n}\n\nunsigned int APISocket::CServerSocket::GetListenPort()\n{\n\treturn m_nPort;\n}\n\nbool APISocket::CServerSocket::StartAccept()\n{\n\tif (m_hAcceptThread)\n\t\treturn true;\n\n\tshouldQuit = 0;\n\thasQuit = 0;\n\tif (!(m_hAcceptThread=CreateThread(0, 0, AcceptThreadProc, this, 0, &m_dwAcceptThread)))\n\t\treturn false;\n\n\treturn true;\n}\n\nbool APISocket::CServerSocket::StopAccept(unsigned long dwWaitTimeout)\n{\n\tbool termResult = ShutdownThread(m_hAcceptThread, dwWaitTimeout, &shouldQuit, &hasQuit);\n\tm_hAcceptThread = 0;\n\tm_dwAcceptThread = 0;\n\treturn termResult;\n}\n\nvoid APISocket::CServerSocket::OnNewClient(int sock)\n{\n}\n\nvoid APISocket::CServerSocket::OnLeaveClient(CSocket* pClient)\n{\n}\n\nunsigned long __stdcall APISocket::CServerSocket::AcceptThreadProc(void* lpParameter)\n{\n\tCServerSocket* pServerSock=\t(CServerSocket*) lpParameter;\n\n\tint sock;\n\n\twhile (true)\n\t{\n\t\tif (pServerSock->shouldQuit)\n\t\t\tbreak;\n\n\t\tint rc=pServerSock->Accept(sock);\n\t\tif (rc==0)\n\t\t\tpServerSock->OnNewClient(sock);\n\t\telse if (rc==-1)\n\t\t{\n\t\t\tif (pServerSock->shouldQuit)\n\t\t\t\tbreak;\n\n\t\t\tpServerSock->OnError(pServerSock->GetLastError());\n\t\t\tSleep(10000);\n\t\t}\n\t\telse if (rc==1)\n\t\t\tSleep(1000);\n\t}\n\tpServerSock->hasQuit=1;\n\treturn 0;\n}\n"
  },
  {
    "path": "Bundles/Echoware/APISocket/Socket.cpp",
    "content": "#include \"apisocket.h\"\n#include <stdio.h>\n\n#include \"errno.h\"\n#include <sys/types.h>\n#include <sys/socket.h>\n#include \"sys/fcntl.h\"\n#include <sys/ioctl.h>\n#include <netinet/in.h>\n#include <arpa/inet.h>\n\n#include <netdb.h>\n\n#include \"../EchoToOSX.h\"\n#include <string.h>\n#include <sys/select.h>\n#include <unistd.h>\n\n#include \"globals.h\"\n\nAPISocket::CSocket::CSocket(int sock/*=0*/)\n{\n\tm_sock = sock;\n\n\terrored = false;\n\tm_nConnectTimeout = m_nSendTimeout = m_nRecvTimeout = m_nAcceptTimeout = -1;\n\n\tm_bBlockMode = false;\n\tm_hAsyncThread = 0;\n\tm_dwAsyncThread = 0;\n\tinAsyncNotificationLoop = false;\n\tStartAsync();\n}\n\nAPISocket::CSocket::CSocket(const CSocket& other)\n{\n\tm_sock = other.m_sock;\n\n\terrored = false;\n\tm_nConnectTimeout = other.m_nConnectTimeout;\n\tm_nSendTimeout = other.m_nSendTimeout;\n\tm_nRecvTimeout = other.m_nRecvTimeout;\n\tm_nAcceptTimeout = other.m_nAcceptTimeout;\n\n\tm_bBlockMode = other.m_bBlockMode;\n\tm_hAsyncThread = 0;\n\tm_dwAsyncThread = 0;\n\tinAsyncNotificationLoop = false;\n\tStartAsync();\n}\n\nAPISocket::CSocket::~CSocket()\n{\n\tStopAsync();\n\n\tClose();\n\tm_sock = 0;\n}\n\nvoid APISocket::CSocket::SetTimeouts(int nConnectTimeout/*=-1*/, int nSendTimeout/*=-1*/, int nRecvTimeout/*=-1*/, int nAcceptTimeout/*=-1*/)\n{\n\tm_nConnectTimeout = nConnectTimeout;\n\tm_nSendTimeout = nSendTimeout;\n\tm_nRecvTimeout = nRecvTimeout;\n\tm_nAcceptTimeout = nAcceptTimeout;\n}\n\nvoid APISocket::CSocket::SetBlockMode(bool bBlock)\n{\n\tm_bBlockMode = bBlock;\n\tNonBlock(!bBlock);\n}\n\nint APISocket::CSocket::GetConnectTimeout()\n{\n\treturn m_nConnectTimeout;\n}\n\nint APISocket::CSocket::GetSendTimeout()\n{\n\treturn m_nSendTimeout;\n}\n\nint APISocket::CSocket::GetRecvTimeout()\n{\n\treturn m_nRecvTimeout;\n}\n\nint APISocket::CSocket::GetAcceptTimeout()\n{\n\treturn m_nAcceptTimeout;\n}\n\nbool APISocket::CSocket::GetBlockMode()\n{\n\treturn m_bBlockMode;\n}\n\nbool APISocket::CSocket::Create(unsigned int nPort /*=0*/)\n{\n\tint sock = socket(AF_INET, SOCK_STREAM, 0);\n\n\tif (!sock)\n\t\tsock = socket(AF_INET, SOCK_STREAM, 0);\n\n\tif (!(sock < 0))\n\t{\n\t\tm_sock = sock;\n\t\tSetSockOption(true);\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nunsigned int APISocket::CSocket::Bind(unsigned int nPort/*=0*/, bool bLocal/*=true*/)\n{\n\tstruct sockaddr_in self;\n\tmemset(&self, 0, sizeof(self));\n\n\tself.sin_family = AF_INET;\n\tself.sin_port = htons(nPort);\n\tif (!bLocal)\n\t\tself.sin_addr.s_addr = htonl(INADDR_ANY);\n\telse\n\t\tself.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n\n\tif (bind(m_sock, (struct sockaddr *)&self, sizeof(self)) != 0)\n\t\treturn 0;\n\n\tif (!nPort)\n\t\tGetLocalPort(nPort);\n\n\treturn nPort;\n}\n\nbool APISocket::CSocket::Listen(int backlog)\n{\n\treturn !listen(m_sock, backlog);\n}\n\nint APISocket::CSocket::Accept(int& sock)\n{\n\tstruct sockaddr_in client_addr;\n\tint addrlen=sizeof(client_addr);\n\n\tsock = 0;\n\n\tif (!m_bBlockMode)\n\t{\n\t\tint rc = 0;\n\t\tif ((rc = WaitNonBlockCompletion(m_nAcceptTimeout, 0)) != 0)\n\t\t\treturn rc;\n\t}\n\n\tsock = accept(m_sock,(struct sockaddr  *)&client_addr,(socklen_t *) &addrlen);\n\n\tif (sock == INVALID_SOCKET)\n\t\treturn -1;\n\n    return 0;\n}\n\nint APISocket::CSocket::Connect(const char* szServer, unsigned int nPort)\n{\n\tif (!m_sock)\n\t\treturn -1;\n\n\terrored = false;\n\tStartAsync();\n\n\tstruct sockaddr_in sockAddr;\n\tZeroMemory(&sockAddr, sizeof(sockAddr));\n\n\tsockAddr.sin_family = AF_INET;\n\tsockAddr.sin_port = htons(nPort);\n\tsockAddr.sin_addr.s_addr = inet_addr(szServer);\n\n\tif (sockAddr.sin_addr.s_addr == INADDR_NONE)\n\t{\n\t\tLPHOSTENT lphost;\n\t\tlphost = gethostbyname(szServer);\n\t\tif (lphost != NULL)\n\t\t\tsockAddr.sin_addr.s_addr = ((struct in_addr *)lphost->h_addr)->s_addr;\n\t}\n\n\tif (connect(m_sock, (struct sockaddr*)&sockAddr, sizeof(sockAddr)) != 0)\n\t{\n\t\tif (!m_bBlockMode)\n\t\t{\n\t\t\twhile (!inAsyncNotificationLoop) Sleep(10000);\n\t\t\treturn WaitNonBlockCompletion(m_nConnectTimeout, 1);\n\t\t}\n\t}\n\n\twhile (!inAsyncNotificationLoop) Sleep(10000);\n\n\treturn 0;\n}\n\nbool APISocket::CSocket::Close()\n{\n\tbool ret = false;\n\tShutdown(SD_BOTH);\n\tif (m_sock)\n\t\tret = !closesocket(m_sock);\n\tm_sock = 0;\n\treturn ret;\n}\n\nbool APISocket::CSocket::Shutdown(int how)\n{\n\tif (m_sock)\n\t\treturn !shutdown(m_sock, how);\n\telse\n\t\treturn false;\n}\n\nint APISocket::CSocket::Send(const char* buff, int& nLen, int nFlag/*=0*/)\n{\n\tnLen=send(m_sock, buff, nLen, nFlag);\n\n\tif (nLen<=0)\n\t{\n\t\tif (nLen==SOCKET_ERROR)\n\t\t{\n\t\t\tnLen=0;\n\t\t\tint err;\n\t\t\tuint errlen = sizeof(err);\n\t\t\tgetsockopt(m_sock, SOL_SOCKET, SO_ERROR, (char*)&err, &errlen);\n\t\t\treturn (err == WSAEWOULDBLOCK)?(0):(-1);\n\t\t}\n\n\t\treturn -1;\n\t}\n\n\treturn 0;\n}\n\nint APISocket::CSocket::Receive(char* buff, int& nLength, int nFlag/*=0*/)\n{\n\tnLength=recv(m_sock, buff, nLength, nFlag);\n\n\tif (nLength<=0)\n\t{\n\t\tif (nLength==SOCKET_ERROR)\n\t\t{\n\t\t\tnLength=0;\n\t\t\tint err;\n\t\t\tuint errlen = sizeof(err);\n\t\t\tgetsockopt(m_sock, SOL_SOCKET, SO_ERROR, (char*)&err, &errlen);\n\t\t\treturn (err == WSAEWOULDBLOCK)?(0):(-1);\n\t\t}\n\t\treturn -1;\n\t}\n\n\treturn 0;\n}\n\n//gets the TCP_NODELAY socket option\n//return true for success and false for error to get the TCP_NODELAY socket option\nbool APISocket::CSocket::GetSockOption(bool& bTcpNodelay)\n{\n\tint on;\n\tuint len=sizeof(on);\n\tbool ret=!getsockopt(m_sock, IPPROTO_TCP, TCP_NODELAY, (char*)&on, &len);\n\tbTcpNodelay=(on!=0);\n\treturn ret;\n}\n\n//sets the TCP_NODELAY socket option\n//return true for success and false for error to set the TCP_NODELAY socket option\nbool APISocket::CSocket::SetSockOption(bool bTcpNodelay)\n{\n\tint on=(int)bTcpNodelay;\n\treturn !setsockopt(m_sock, IPPROTO_TCP, TCP_NODELAY, (char*)&on, sizeof(on));\n}\n\nint APISocket::CSocket::GetLastError()\n{\n\treturn WSAGetLastError();\n}\n\nbool APISocket::CSocket::NonBlock(bool bNonBlock)\n{\n\tif (bNonBlock)\n\t\treturn (fcntl(m_sock, F_SETFL, O_NONBLOCK) != -1);\n\telse\n\t\treturn (fcntl(m_sock, F_SETFL, fcntl(m_sock, F_GETFL, 0) & ~O_NONBLOCK) != -1);\n}\n\nint APISocket::CSocket::WaitNonBlockCompletion(int nTimeout, int nType)\n{\n\tfd_set fd;\n\tstruct timeval time;\n\n\ttime.tv_sec = nTimeout/1000;\n\ttime.tv_usec = (nTimeout-time.tv_sec*1000)*1000;\n\n\tFD_ZERO(&fd);\n\tFD_SET(m_sock, &fd);\n\n\tint rc=0;\n\n\tif (nType==0)\n\t\trc = select(m_sock+1, &fd, NULL, NULL, &time);\n\telse if (nType==1)\n\t\trc = select(m_sock+1, NULL, &fd, NULL, &time);\n\n\tif (rc==-1)\n\t\treturn -1;// error\n\telse if (rc==0)\n\t\treturn 1;//timeout\n\n\tif (FD_ISSET(m_sock, &fd))\n\t\treturn 0;\n\telse\n\t\treturn -1;\n}\n\nbool APISocket::CSocket::GetLocalPort(unsigned int& nPort)\n{\n\tstruct sockaddr_in self;\n\tmemset(&self, 0, sizeof(self));\n\n\tuint len=sizeof(self);\n\n\tif (getsockname( m_sock, (struct sockaddr*)&self, &len ))\n\t\treturn false;\n\n\tnPort=ntohs(self.sin_port);\n\n\treturn true;\n}\n\nbool APISocket::CSocket::GetRemotePort(unsigned int& nPort)\n{\n\tstruct sockaddr_in self;\n\tmemset(&self, 0, sizeof(self));\n\n\tint len=sizeof(self);\n\n\tif (getpeername( m_sock, (struct sockaddr*)&self, (socklen_t *) &len ))\n\t\treturn false;\n\n\tnPort=ntohs(self.sin_port);\n\n\treturn true;\n}\n\nbool APISocket::CSocket::GetRemoteIP(char* szRemoteIP)\n{\n\tstruct sockaddr_in self;\n\tmemset(&self, 0, sizeof(self));\n\n\tuint len=sizeof(self);\n\n\tif (getpeername( m_sock, (struct sockaddr*)&self, &len ))\n\t\treturn false;\n\n\tsprintf(szRemoteIP, \"%s\", inet_ntoa(self.sin_addr));\n\n\treturn true;\n}\n\nint APISocket::CSocket::Attach(int sock)\n{\n\tint old=m_sock;\n\n\tm_sock=sock;\n\n\treturn old;\n}\n\nint APISocket::CSocket::Detach()\n{\n\tint old=m_sock;\n\n\tm_sock=0;\n\n\treturn old;\n}\n\nvoid APISocket::CSocket::OnClose()\n{\n}\n\nvoid APISocket::CSocket::OnError(int error)\n{\n\terrored = true;\n\tg_globals.m_logger.WriteFormated(\"CSocket::OnError sock = %d err = %d\", m_sock, error);\n}\n\nvoid APISocket::CSocket::OnReceive(char* buff, int len)\n{\n}\n\nvoid APISocket::CSocket::OnSend(char* buff, int &len)\n{\n\tlen = 0;\n}\n\nvoid APISocket::CSocket::OnWrite()\n{\n\terrored = false;\n\tint r = Send();\n}\n\nvoid APISocket::CSocket::OnRead()\n{\n\terrored = false;\n\tint len_to_read = ReadableByteCount();\n\tif (len_to_read <= 0) return;\n\tif (len_to_read > 65000) /////////////\n\t\tlen_to_read = 65000; ////////////\n\tchar *buff = new char[len_to_read];\n\tint len_readed = len_to_read;\n\tint r = Receive(buff, len_readed);\n\tif (len_readed <= 0)\n\t{\n\t\tdelete [] buff;\n\t\treturn;\n\t}\n\n\tOnReceive(buff, len_readed);\n\tdelete[] buff;\n}\n\nint APISocket::CSocket::ReadableByteCount()\n{\n\tif (!m_sock)\n\t\treturn 0;\n\n\tint\tbytesAvailable = 0;\n\n\tif (ioctl(m_sock, FIONREAD, &bytesAvailable) == -1)\n\t{\n\t\tif (errno == EINVAL)\n\t\t\tbytesAvailable = -1;\n\t\telse\n\t\t\tbytesAvailable = 0;\n\t}\n\n\treturn bytesAvailable;\n}\n\nint APISocket::CSocket::Send()\n{\n\tif (!m_sock || errored)\n\t\treturn 1;\n\tchar *buff = new char[MAX_BUFFER];\n\tint len = MAX_BUFFER;\n\tOnSend(buff, len);\n\tint ret = 0;\n\tif (len > 0)\n\t\tret = Send(buff, len);\n\tdelete [] buff;\n\treturn ret;\n}\n\nint APISocket::CSocket::getSocket()\n{\n\treturn m_sock;\n}\n\nbool APISocket::CSocket::StartAsync()\n{\n\tif (m_hAsyncThread)\n\t\treturn true;\n\n\tinAsyncNotificationLoop = false;\n\tshouldAsyncQuit = 0;\n\thasAsyncQuit = 0;\n\tif (!(m_hAsyncThread = CreateThread(0, 0, AsyncThreadProc, this, 0, &m_dwAsyncThread)))\n\t\treturn false;\n\treturn true;\n}\n\nbool APISocket::CSocket::StopAsync()\n{\n\tif (!m_hAsyncThread)\n\t\treturn true;\n\n\tshouldAsyncQuit = true;\n\tm_csAsync.Lock();\n\tm_csAsync.Unlock();\n\tbool stopResult = ShutdownThread(m_hAsyncThread, THREAD_STOP_TIMEOUT, &shouldAsyncQuit, &hasAsyncQuit);\n\tm_hAsyncThread = 0;\n\tm_dwAsyncThread = 0;\n\treturn stopResult;\n}\n\nvoid APISocket::CSocket::AsyncNotifications()\n{\n\tif (!m_sock) return;\n\n\tfd_set read_fds, write_fds;\n\tFD_ZERO(&read_fds);\n\tFD_ZERO(&write_fds);\n\tFD_SET(m_sock, &read_fds);\n\tFD_SET(m_sock, &write_fds);\n\n\tint res = select(m_sock + 1, &read_fds, &write_fds, NULL, NULL);\n\tif (res > 0)\n\t{\n\t\tif (FD_ISSET(m_sock, &read_fds))\n\t\t{\n\t\t\tif (ReadableByteCount())\n\t\t\t{\n\t\t\t\tinAsyncNotificationLoop = true;\n\t\t\t\tOnRead();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tinAsyncNotificationLoop = true;\n\t\t\t\tOnError(GetLastError());\n\t\t\t\tshouldAsyncQuit = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (FD_ISSET(m_sock, &write_fds))\n\t\t{\n\t\t\tinAsyncNotificationLoop = true;\n\t\t\tOnWrite();\n\t\t}\n\t}\n\tinAsyncNotificationLoop = true;\n}\n\nvoid APISocket::CSocket::AsyncNotificationLoop()\n{\n\twhile (!shouldAsyncQuit)\n\t{\n\t\tAsyncNotifications();\n\t\tSleep(10000);\n\t}\n\tinAsyncNotificationLoop = false;\n\tm_hAsyncThread = 0;\n\tm_dwAsyncThread = 0;\n\thasAsyncQuit = 1;\n}\n\nunsigned long APISocket::CSocket::AsyncThreadProc(void* lpParameter)\n{\n\tAPISocket::CSocket *socket = (APISocket::CSocket*)lpParameter;\n\tsocket->m_csAsync.Lock();\n\tsocket->AsyncNotificationLoop();\n\tsocket->m_csAsync.Unlock();\n\tSleep(50000);\n\treturn 0;\n}\n"
  },
  {
    "path": "Bundles/Echoware/CritSection.cpp",
    "content": "#include \"StdAfx.h\"\n#include \"critsection.h\"\n#include \"errno.h\"\n\nCCritSection::CCritSection(void)\n{\n\tpthread_mutex_init(&m_critSection, NULL);\n}\n\nCCritSection::~CCritSection(void)\n{\n\tif (pthread_mutex_destroy(&m_critSection) == EBUSY)\n\t{\n\t\tUnlock();\n\t\tpthread_mutex_destroy(&m_critSection);\n\t}\n}\n\nvoid CCritSection::Lock()\n{\n\tpthread_testcancel();\n\tpthread_mutex_lock(&m_critSection);\n}\n\nvoid CCritSection::Unlock()\n{\n\tpthread_mutex_unlock(&m_critSection);\n\tpthread_testcancel();\n}\n"
  },
  {
    "path": "Bundles/Echoware/CritSection.h",
    "content": "#ifndef _CRITSECTION_H\n#define _CRITSECTION_H\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n#include \"EchoToOSX.h\"\n\n//critical section class\nclass CCritSection\n{\npublic:\n\tCCritSection(void);\n\tvirtual ~CCritSection(void);\n\n\tvoid Lock();\n\n\tvoid Unlock();\n\nprotected:\n\t\tpthread_mutex_t m_critSection;\n\t//CRITICAL_SECTION m_critSection;\n};\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/DataChannel.cpp",
    "content": "#include \"StdAfx.h\"\n#include \"DataChannel.h\"\n#include \"DataChannels.h\"\n#include \"LocalDataChannel.h\"\n#include \"EchoSrvDataChannel.h\"\n#include \"DllProxyInfo.h\"\n\n#define RSA_PUBLIC_KEY\t80\n\n#pragma warning(disable : 4355)\nCDataChannel::CDataChannel(CDataChannels* pDataChannels, const char* szChannelCode,\n\t\t\t\t\t\t   const char* szSessionKey, bool bEncryptDecrypt) :\n\t m_localListener(this), m_bEncryptDecrypt(bEncryptDecrypt)\n{\n\tm_bLocalDC=false;\n\n\tm_pDataChannels=pDataChannels;\n\tm_pLocalDataChannel=new CLocalDataChannel(this);\n\tm_pEchoServerDataChannel=new CEchoSrvDataChannel(this);\n\n\tconst CDllProxyInfo* pProxyInfo=pDataChannels->GetProxyInfo();\n\n\tm_pLocalDataChannel->SetTimeouts(pProxyInfo->GetConnectTimeout()*1000,\n\t\t\t\t\t\t\t\t\tpProxyInfo->GetSendTimeout()*1000,\n\t\t\t\t\t\t\t\t\tpProxyInfo->GetReceiveTimeout()*1000);\n\tm_pEchoServerDataChannel->SetTimeouts(pProxyInfo->GetConnectTimeout()*1000,\n\t\t\t\t\t\t\t\t\tpProxyInfo->GetSendTimeout()*1000,\n\t\t\t\t\t\t\t\t\tpProxyInfo->GetReceiveTimeout()*1000);\n\n\tm_szChannelCode=new char[12];\n\tstrcpy(m_szChannelCode, szChannelCode);\n\n\tm_szSessionKey=new char[1024];\n\tstrcpy(m_szSessionKey, szSessionKey);\n\n\tm_aes.SetEncryptKey((const unsigned char*)m_szSessionKey, 128);\n\n\tm_aes.SetDecryptKey((const unsigned char*)m_szSessionKey, 128);\n\n\tg_globals.m_logger.WriteFormated(\"CDataChannel: New data channel: code=%s , encrypt=%c\", szChannelCode, (m_bEncryptDecrypt)?('Y'):('N'));\n}\n#pragma warning(default : 4355)\n\nCDataChannel::~CDataChannel(void)\n{\n\tStopListen();\n\n\tif (m_pEchoServerDataChannel)\n\t{\n//\t\tm_pEchoServerDataChannel->Shutdown(SD_BOTH);\n\t\tm_pEchoServerDataChannel->Close();\n\n\t\tm_pEchoServerDataChannel->StopSend(THREAD_STOP_TIMEOUT);\n\t}\n\n\tif (m_pLocalDataChannel)\n\t{\n//\t\tm_pLocalDataChannel->Shutdown(SD_BOTH);\n\t\tm_pLocalDataChannel->Close();\n\n\t\tm_pLocalDataChannel->StopSend(THREAD_STOP_TIMEOUT);\n\t}\n\n\tif (m_pEchoServerDataChannel)\n\t{\n\t\tdelete m_pEchoServerDataChannel;\n\t\tm_pEchoServerDataChannel=0;\n\t}\n\n\tif (m_pLocalDataChannel)\n\t{\n\t\tdelete m_pLocalDataChannel;\n\t\tm_pLocalDataChannel=0;\n\t}\n\n\tdelete []m_szChannelCode;\n\tdelete []m_szSessionKey;\n}\n\nbool CDataChannel::ConnectEchoServer()\n{\n\tg_globals.m_logger.Write(\"=>ConnectEchoServer\");\n\tif (!m_pEchoServerDataChannel->Create() ||\n\t\tm_pEchoServerDataChannel->Connect(m_pDataChannels->GetProxyInfo()->GetIP(),\n\t\t\t\t\t\t\t\t\t\tatoi(m_pDataChannels->GetProxyInfo()->GetPort()),\n\t\t\t\t\t\t\t\t\t\tm_szChannelCode,\n\t\t\t\t\t\t\t\t\t\tm_pDataChannels->GetProxyInfo()->GetMyID())!=0)\n\t{\n\t\tOnError(m_pEchoServerDataChannel, 1);\n\n\t\tg_globals.m_logger.WriteFormated(\"CDataChannel: Error connect data channel %p to channel code %s\", this, m_szChannelCode);\n\n\t\treturn false;\n\t}\n\n\tm_pLocalDataChannel->SetPairChannel(m_pEchoServerDataChannel);\n\tm_pEchoServerDataChannel->SetPairChannel(m_pLocalDataChannel);\n\n\tm_pEchoServerDataChannel->SetOffLoadingDataChannel(true);\n\tm_pEchoServerDataChannel->StartSend();\n\n\tg_globals.m_logger.Write(\"<=ConnectEchoServer\");\n\n\treturn true;\n}\n\nbool CDataChannel::ConnectLocalServer()\n{\n\tm_pDataChannels->LocalConnectDataChannel(this);\n\n\treturn true;\n}\n\n//try to connect to the local server on the port nPort\nbool CDataChannel::ConnectLocalServer(unsigned int nPort)\n{\n\t//g_globals.m_logger.Write(\"=>CDataChannel::ConnectLocalServer\");\n\tm_crtLocalDCSection.Lock();\n\n\tif (m_bLocalDC)\n\t{\n\t\tm_crtLocalDCSection.Unlock();\n\t\treturn true;\n\t}\n\n\tg_globals.m_logger.WriteFormated(\"=>Try connect local server port: %d\", nPort);\n\n\tAPISocket::CClientSocket client;\n\tif (!client.Create())\n\t{\n\t\tm_crtLocalDCSection.Unlock();\n\t\tg_globals.m_logger.Write(\"<=Try connect local server - error create\");\n\t\treturn false;\n\t}\n\n\tclient.SetBlockMode(false);\n\tconst CDllProxyInfo* pProxyInfo=m_pDataChannels->GetProxyInfo();\n\tclient.SetTimeouts(pProxyInfo->GetConnectTimeout(), pProxyInfo->GetSendTimeout(), pProxyInfo->GetReceiveTimeout());\n\tint connectRes = client.Connect(\"127.0.0.1\", nPort);\n\tif (connectRes != 0)\n\t{\n\t\tm_crtLocalDCSection.Unlock();\n\t\tg_globals.m_logger.WriteFormated(\"<=Try connect local server - error connect err code: %d\", connectRes);\n\t\treturn false;\n\t}\n\n\tm_bLocalDC=true;\n\n\tOnLocalDataChannel(client.Detach(), true);\n\n\tg_globals.m_logger.Write(\"<=Try connect local server - success\");\n\n\tm_crtLocalDCSection.Unlock();\n\n\treturn true;\n}\n\n//start to listen for local connections\nbool CDataChannel::Listen(unsigned int& nPort)\n{\n\tg_globals.m_logger.Write(\"CDataChannel: Enter Listen for local client\");\n\tif (!m_localListener.Create())\n\t\treturn false;\n\n\tif (!m_localListener.Listen())\n\t\treturn false;\n\n\tnPort=m_localListener.GetListenPort();\n\n\tif (!m_localListener.StartAccept())\n\t\treturn false;\n\n\tg_globals.m_logger.Write(\"CDataChannel: Listen for local client started\");\n\n\treturn true;\n}\n\n//stop listen for local connections\nvoid CDataChannel::StopListen()\n{\n\tm_localListener.Close();\n\tm_localListener.StopAccept(5000);\n}\n\n//notify that there was an error on sockets operations\nvoid CDataChannel::OnError(APISocket::CSocket* pSocket, unsigned int err)\n{\n\tif (m_pEchoServerDataChannel == pSocket)\n\t{\n\t\tg_globals.m_logger.WriteFormated(\"CDataChannel: Start Remove data channel %p due to error on echochannel %d\", this, err);\n\t\tif (m_pDataChannels)\n\t\t\tm_pDataChannels->RemoveDataChannel(this);\n\t\tg_globals.m_logger.WriteFormated(\"CDataChannel: End Remove data channel %p\", this);\n\t}\n\telse\n\t{\n\t\tif (m_pEchoServerDataChannel->m_bOffLoadingDataChannel && (m_pEchoServerDataChannel->m_nRetryCounter < RECONNECTION_COUNT))\n\t\t{\n\t\t\tg_globals.m_logger.WriteFormated(\"CDataChannel: Start trying reuse datachannel %p due to error on localchannel %d\", this, err);\n\n\t\t\t((APISocket::CClientSocket*)pSocket)->StopSend(THREAD_STOP_TIMEOUT);\n\t\t\t((APISocket::CClientSocket*)pSocket)->StopAsync();\n\t\t\tm_pEchoServerDataChannel->ResetRetryTimer();\n\t\t\tm_pEchoServerDataChannel->m_fStartRetry = true;\n\t\t\tg_globals.m_logger.WriteFormated(\"CDataChannel: End trying reuse datachannel %p due to error on localchannel %d\", this, err);\n\t\t\treturn;\n\t\t}\n\t\tg_globals.m_logger.WriteFormated(\"CDataChannel: Start Remove data channel %p due to error on localchannel %d\", this, err);\n\t\tif (m_pDataChannels)\n\t\t\tm_pDataChannels->RemoveDataChannel(this);\n\t\tg_globals.m_logger.WriteFormated(\"CDataChannel: End Remove data channel %p\", this);\n\t}\n\n}\n\n//sets the encryption level\nvoid CDataChannel::SetEncriptionLevel(int nLevel)\n{\n\tm_pEchoServerDataChannel->SetEncriptionLevel(nLevel);\n}\n\n//gets the encryption level\nint CDataChannel::GetEncriptionLevel()\n{\n\treturn m_pEchoServerDataChannel->GetEncriptionLevel();\n}\n\n//notify that we have a local connection\n//there are 2 types of local connections :  OffLoadingDataChannel or not\n//try to create the data channel to echoServer\nvoid CDataChannel::OnLocalDataChannel(unsigned int sock, bool bOffLoadingDataChannel/*=false*/)\n{\n\tm_pLocalDataChannel->Attach(sock);\n\t//m_pLocalDataChannel->SetOffLoadingDataChannel(bOffLoadingDataChannel);\n\n\tif (!bOffLoadingDataChannel)\n\t{\n\t\tg_globals.m_logger.WriteFormated(\"CDataChannel: Try connect data channel %p to channel code %s\", this, m_szChannelCode);\n\n\t\tif (!m_pEchoServerDataChannel->Create() ||\n\t\t\tm_pEchoServerDataChannel->Connect(m_pDataChannels->GetProxyInfo()->GetIP(),\n\t\t\t\t\t\t\t\t\t\t\tatoi(m_pDataChannels->GetProxyInfo()->GetPort()),\n\t\t\t\t\t\t\t\t\t\t\tm_szChannelCode,\n\t\t\t\t\t\t\t\t\t\t\tm_pDataChannels->GetProxyInfo()->GetMyID())!=0)\n\t\t{\n\t\t\tOnError(m_pEchoServerDataChannel, 1);\n\n\t\t\tg_globals.m_logger.WriteFormated(\"CDataChannel: Error connect data channel %p to channel code %s\", this, m_szChannelCode);\n\n\t\t\treturn;\n\t\t}\n\n\t\tg_globals.m_logger.WriteFormated(\"CDataChannel: Success connect data channel %p to channel code %s\", this, m_szChannelCode);\n\n\t\tm_pLocalDataChannel->SetPairChannel(m_pEchoServerDataChannel);\n\t\tm_pEchoServerDataChannel->SetPairChannel(m_pLocalDataChannel);\n\n\t\tm_pEchoServerDataChannel->StartSend();\n\t}\n\n\tm_pLocalDataChannel->StartSend();\n}\n"
  },
  {
    "path": "Bundles/Echoware/DataChannel.h",
    "content": "#ifndef _DATACHANNEL_H\n#define _DATACHANNEL_H\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\nclass CDataChannels;\nclass CLocalDataChannel;\nclass CEchoSrvDataChannel;\n\nclass CLocalDCTimer;\n\n#include \"LocalListener.h\"\n#include \"AES.h\"\n\n//class for pair Local connection<->echoServer connection\nclass CDataChannel\n{\npublic:\n\tCDataChannel(CDataChannels* pDataChannels, const char* szChannelCode,\n\t\tconst char* szSessionKey, bool bEncryptDecrypt);\n\tvirtual ~CDataChannel(void);\n\n\t//connect to echoServer\n\tbool ConnectEchoServer();\n\n\t//connect to local server\n\tbool ConnectLocalServer();\n\n\t//connect to local server\n\tbool ConnectLocalServer(unsigned int nPort);\n\n\t//listen for local client\n\tbool Listen(unsigned int& nPort);\n\tvoid StopListen();\n\n\tvoid OnError(APISocket::CSocket* pSocket, unsigned int err);\n\n\t//sets the encryption level for this data channel\n\tvoid SetEncriptionLevel(int nLevel);\n\t//gets the encryption level for this data channel\n\tint GetEncriptionLevel();\n\n\t//a local connection\n\tvoid OnLocalDataChannel(unsigned int sock, bool bOffLoadingDataChannel=false);\n\n\tconst char* GetSessionKey(){return m_szSessionKey;}\n\tCLocalDataChannel* m_pLocalDataChannel;\n\nprotected:\n\t//the data channels manager\n\tCDataChannels* m_pDataChannels;\n\n\tCLocalListener m_localListener;\n\n\tCEchoSrvDataChannel* m_pEchoServerDataChannel;\n\n\tchar* m_szChannelCode;\n\tchar* m_szSessionKey;\n\npublic:\n\tCAES m_aes;\n\tbool m_bEncryptDecrypt;\n\n\tCCritSection m_crtLocalDCSection;\n\tbool m_bLocalDC;\n};\n\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/DataChannelSocket.cpp",
    "content": "#include \"StdAfx.h\"\n#include \"datachannelsocket.h\"\n#include \"DataChannel.h\"\n\nCDataChannelSocket::CDataChannelSocket(CDataChannel* pDataChannel)\n{\n\tm_pDataChannel=pDataChannel;\n\n\tm_pRecvBuffer=new CBuffer();\n\tm_pSendBuffer=new CBuffer();\n\n\tm_nEncriptionLevel=1;\n\n\tm_pPairChannel=0;\n}\n\nCDataChannelSocket::~CDataChannelSocket(void)\n{\n\tStopSend(THREAD_STOP_TIMEOUT);\n\n\tClose();\n\n\tdelete m_pRecvBuffer;\n\tm_pRecvBuffer=0;\n\n\tdelete m_pSendBuffer;\n\tm_pSendBuffer=0;\n}\n\nvoid CDataChannelSocket::OnReceive(char* buff, int len)\n{\n\tm_pPairChannel->WriteData(buff, len);\n}\n\nvoid CDataChannelSocket::OnSend(char* buff, int& len)\n{\n\tlen = m_pSendBuffer->Read(buff, len);\n}\n\nvoid CDataChannelSocket::OnError(int error)\n{\n\tCClientSocket::OnError(error);\n\tm_pDataChannel->OnError(this, error);\n}\n\n//sets the pair data channel for this data channel\nvoid CDataChannelSocket::SetPairChannel(CDataChannelSocket* pPairChannel)\n{\n\tm_pPairChannel=pPairChannel;\n}\n\n//gets the pair data channel for this data channel\nCDataChannelSocket* CDataChannelSocket::GetPairChannel()\n{\n\treturn m_pPairChannel;\n}\n\nvoid CDataChannelSocket::ReadData(char* buff, unsigned int& read_size)\n{\n\tread_size = m_pRecvBuffer->Read(buff, read_size);\n}\n\nvoid CDataChannelSocket::WriteData(char* buff, unsigned int write_size)\n{\n\tm_pSendBuffer->Write(buff, write_size);\n}\n\n//sets the encryption level for this data channel\nvoid CDataChannelSocket::SetEncriptionLevel(int nLevel)\n{\n\tm_nEncriptionLevel=nLevel;\n}\n\n//gets the encryption level for this data channel\nint CDataChannelSocket::GetEncriptionLevel()\n{\n\treturn m_nEncriptionLevel;\n}"
  },
  {
    "path": "Bundles/Echoware/DataChannelSocket.h",
    "content": "#ifndef _DATACHANNELSOCKET_H\n#define _DATACHANNELSOCKET_H\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n#include \"apisocket.h\"\n\nclass CDataChannel;\nclass CBuffer;\n\n//data channel socket class\n//a base class for CLocalDataChannel class and CEchoSrvDataChannel class\nclass CDataChannelSocket :\n\tpublic APISocket::CClientSocket\n{\npublic:\n\tCDataChannelSocket(CDataChannel* pDataChannel);\n\tvirtual ~CDataChannelSocket(void);\n\n\t//notification : there are data to read\n\t//[in] len : length of data\n\t//[in] buff: data\n\tvirtual void OnReceive(char* buff, int len);\n\n\t//notification : can send data\n\t//[in] len : length of data\n\t//[in] buff: data\n\tvirtual void OnSend(char* buff, int& len);\n\n\t//notification : receive error\n\t//[out] error\n\tvirtual void OnError(int error);\n\n\t//sets the pair data channel for this data channel\n\tvoid SetPairChannel(CDataChannelSocket* pPairChannel);\n\t//gets the pair data channel for this data channel\n\tCDataChannelSocket* GetPairChannel();\n\n\tvoid ReadData(char* buff, unsigned int& read_size);\n\tvoid WriteData(char* buff, unsigned int write_size);\n\n\t//sets the encryption level for this data channel\n\tvoid SetEncriptionLevel(int nLevel);\n\t//gets the encryption level for this data channel\n\tint GetEncriptionLevel();\n\nprotected:\n\t//the parent data channel\n\tCDataChannel* m_pDataChannel;\n\n\t//buffers for recv/send on socket\n\tCBuffer* m_pRecvBuffer;\n\tCBuffer* m_pSendBuffer;\n\n\t//the pair data channel for this data channel\n\tCDataChannelSocket* m_pPairChannel;\n\n\tint m_nEncriptionLevel;\n};\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/DataChannel_timer.cpp",
    "content": "#include \"StdAfx.h\"\n#include \"DataChannel.h\"\n#include \"DataChannels.h\"\n#include \"LocalDataChannel.h\"\n#include \"EchoSrvDataChannel.h\"\n#include \"DllProxyInfo.h\"\n\n#define RSA_PUBLIC_KEY\t80\n\n#pragma warning(disable : 4355)\nCDataChannel::CDataChannel(CDataChannels* pDataChannels, const char* szChannelCode,\n\t\t\t\t\t\t   const char* szSessionKey, bool bEncryptDecrypt) :\n\t m_localListener(this), m_bEncryptDecrypt(bEncryptDecrypt)\n{\n\tm_pLocalDCTimer=new CLocalDCTimer(this);\n\tm_bLocalDC=false;\n\n\tm_pDataChannels=pDataChannels;\n\tm_pLocalDataChannel=new CLocalDataChannel(this);\n\tm_pEchoServerDataChannel=new CEchoSrvDataChannel(this);\n\n\tconst CDllProxyInfo* pProxyInfo=pDataChannels->GetProxyInfo();\n\n\tm_pLocalDataChannel->SetTimeouts(pProxyInfo->GetConnectTimeout()*1000,\n\t\t\t\t\t\t\t\t\tpProxyInfo->GetSendTimeout()*1000,\n\t\t\t\t\t\t\t\t\tpProxyInfo->GetReceiveTimeout()*1000);\n\tm_pEchoServerDataChannel->SetTimeouts(pProxyInfo->GetConnectTimeout()*1000,\n\t\t\t\t\t\t\t\t\tpProxyInfo->GetSendTimeout()*1000,\n\t\t\t\t\t\t\t\t\tpProxyInfo->GetReceiveTimeout()*1000);\n\n\tm_szChannelCode=new char[12];\n\tstrcpy(m_szChannelCode, szChannelCode);\n\n\tm_szSessionKey=new char[1024];\n\tstrcpy(m_szSessionKey, szSessionKey);\n\n\tm_aes.SetEncryptKey((const unsigned char*)m_szSessionKey, 128);\n\n\tm_aes.SetDecryptKey((const unsigned char*)m_szSessionKey, 128);\n\n\tg_globals.m_logger.WriteFormated(\"CDataChannel: New data channel: code=%s , encrypt=%c\", szChannelCode, (m_bEncryptDecrypt)?('Y'):('N'));\n}\n#pragma warning(default : 4355)\n\nCDataChannel::~CDataChannel(void)\n{\n\tif (m_pLocalDCTimer)\n\t{\n\t\tdelete m_pLocalDCTimer;\n\t\tm_pLocalDCTimer=0;\n\t}\n\n\tStopListen();\n\n\tif (m_pEchoServerDataChannel)\n\t{\n\t\tm_pEchoServerDataChannel->Shutdown(SD_BOTH);\n\t\tm_pEchoServerDataChannel->Close();\n\n\t\tm_pEchoServerDataChannel->StopReceive(THREAD_STOP_TIMEOUT);\n\t\tm_pEchoServerDataChannel->StopSend(THREAD_STOP_TIMEOUT);\n\t}\n\n\tif (m_pLocalDataChannel)\n\t{\n\t\tm_pLocalDataChannel->Shutdown(SD_BOTH);\n\t\tm_pLocalDataChannel->Close();\n\n\t\tm_pLocalDataChannel->StopReceive(THREAD_STOP_TIMEOUT);\n\t\tm_pLocalDataChannel->StopSend(THREAD_STOP_TIMEOUT);\n\t}\n\n\tif (m_pEchoServerDataChannel)\n\t{\n\t\tdelete m_pEchoServerDataChannel;\n\t\tm_pEchoServerDataChannel=0;\n\t}\n\n\tif (m_pLocalDataChannel)\n\t{\n\t\tdelete m_pLocalDataChannel;\n\t\tm_pLocalDataChannel=0;\n\t}\n\n\tdelete []m_szChannelCode;\n\tdelete []m_szSessionKey;\n}\n\nbool CDataChannel::ConnectEchoServer()\n{\n\tg_globals.m_logger.Write(\"=>ConnectEchoServer\");\n\tif (!m_pEchoServerDataChannel->Create() ||\n\t\tm_pEchoServerDataChannel->Connect(m_pDataChannels->GetProxyInfo()->GetIP(),\n\t\t\t\t\t\t\t\t\t\tatoi(m_pDataChannels->GetProxyInfo()->GetPort()),\n\t\t\t\t\t\t\t\t\t\tm_szChannelCode,\n\t\t\t\t\t\t\t\t\t\tm_pDataChannels->GetProxyInfo()->GetMyID())!=0)\n\t{\n\t\tOnError(m_pEchoServerDataChannel, 1);\n\n\t\tg_globals.m_logger.WriteFormated(\"CDataChannel: Error connect data channel %p to channel code %s\", this, m_szChannelCode);\n\n\t\treturn false;\n\t}\n\n\tm_pLocalDataChannel->SetPairChannel(m_pEchoServerDataChannel);\n\tm_pEchoServerDataChannel->SetPairChannel(m_pLocalDataChannel);\n\n\tm_pEchoServerDataChannel->SetOffLoadingDataChannel();\n\tm_pEchoServerDataChannel->StartReceive();\n\tm_pEchoServerDataChannel->StartSend();\n\n\t//ConnectLocalServer();\n\n\tm_pLocalDCTimer->SetTimer(CONNECTION_TO_OFFLOAD_TIMER_VALUE);\n\n\tg_globals.m_logger.Write(\"<=ConnectEchoServer\");\n\n\treturn true;\n}\n\nbool CDataChannel::ConnectLocalServer()\n{\n\tm_pDataChannels->LocalConnectDataChannel(this);\n\n\treturn true;\n}\n\n//try to connect to the local server on the port nPort\nbool CDataChannel::ConnectLocalServer(unsigned int nPort)\n{\n\tg_globals.m_logger.Write(\"=>CDataChannel::ConnectLocalServer\");\n\tm_crtLocalDCSection.Lock();\n\n\tif (m_bLocalDC)\n\t{\n\t\tm_crtLocalDCSection.Unlock();\n\t\treturn true;\n\t}\n\n\tif (m_pLocalDCTimer)\n\t{\n\t\tdelete m_pLocalDCTimer;\n\t\tm_pLocalDCTimer=0;\n\t}\n\n\tg_globals.m_logger.Write(\"=>Try connect local server\");\n\n\tAPISocket::CClientSocket client;\n\tif (!client.Create())\n\t{\n\t\tm_crtLocalDCSection.Unlock();\n\t\tg_globals.m_logger.Write(\"<=Try connect local server - error create\");\n\t\treturn false;\n\t}\n\n\tclient.SetBlockMode(false);\n\tconst CDllProxyInfo* pProxyInfo=m_pDataChannels->GetProxyInfo();\n\tclient.SetTimeouts(pProxyInfo->GetConnectTimeout(), pProxyInfo->GetSendTimeout(), pProxyInfo->GetReceiveTimeout());\n\tif (client.Connect(\"127.0.0.1\", nPort)!=0)\n\t{\n\t\tm_crtLocalDCSection.Unlock();\n\t\tg_globals.m_logger.Write(\"<=Try connect local server - error connect\");\n\t\treturn false;\n\t}\n\n\tm_bLocalDC=true;\n\n\tOnLocalDataChannel(client.Detach(), true);\n\n\tg_globals.m_logger.Write(\"<=Try connect local server - success\");\n\n\tm_crtLocalDCSection.Unlock();\n\n\treturn true;\n}\n\n//start to listen for local connections\nbool CDataChannel::Listen(unsigned int& nPort)\n{\n\tg_globals.m_logger.Write(\"CDataChannel: Enter Listen for local client\");\n\tif (!m_localListener.Create())\n\t\treturn false;\n\n\tif (!m_localListener.Listen())\n\t\treturn false;\n\n\tnPort=m_localListener.GetListenPort();\n\n\tif (!m_localListener.StartAccept())\n\t\treturn false;\n\n\tg_globals.m_logger.Write(\"CDataChannel: Listen for local client started\");\n\n\treturn true;\n}\n\n//stop listen for local connections\nvoid CDataChannel::StopListen()\n{\n\tm_localListener.Close();\n\tm_localListener.StopAccept(5000);\n}\n\n//notify that there was an error on sockets operations\nvoid CDataChannel::OnError(APISocket::CSocket* pSocket, unsigned int err)\n{\n\tg_globals.m_logger.WriteFormated(\"CDataChannel: Start Remove data channel %p\", this);\n\tif (m_pDataChannels)\n\t\tm_pDataChannels->RemoveDataChannel(this);\n\tg_globals.m_logger.WriteFormated(\"CDataChannel: End Remove data channel %p\", this);\n}\n\n//sets the encryption level\nvoid CDataChannel::SetEncriptionLevel(int nLevel)\n{\n\tm_pEchoServerDataChannel->SetEncriptionLevel(nLevel);\n}\n\n//gets the encryption level\nint CDataChannel::GetEncriptionLevel()\n{\n\treturn m_pEchoServerDataChannel->GetEncriptionLevel();\n}\n\n//notify that we have a local connection\n//there are 2 types of local connections :  OffLoadingDataChannel or not\n//try to create the data channel to echoServer\nvoid CDataChannel::OnLocalDataChannel(unsigned int sock, bool bOffLoadingDataChannel/*=false*/)\n{\n\tm_pLocalDataChannel->Attach(sock);\n\tm_pLocalDataChannel->m_bOffLoadingDataChannel=bOffLoadingDataChannel;\n\n\tif (!bOffLoadingDataChannel)\n\t{\n\t\tg_globals.m_logger.WriteFormated(\"CDataChannel: Try connect data channel %p to channel code %s\", this, m_szChannelCode);\n\n\t\tif (!m_pEchoServerDataChannel->Create() ||\n\t\t\tm_pEchoServerDataChannel->Connect(m_pDataChannels->GetProxyInfo()->GetIP(),\n\t\t\t\t\t\t\t\t\t\t\tatoi(m_pDataChannels->GetProxyInfo()->GetPort()),\n\t\t\t\t\t\t\t\t\t\t\tm_szChannelCode,\n\t\t\t\t\t\t\t\t\t\t\tm_pDataChannels->GetProxyInfo()->GetMyID())!=0)\n\t\t{\n\t\t\tOnError(m_pEchoServerDataChannel, 1);\n\n\t\t\tg_globals.m_logger.WriteFormated(\"CDataChannel: Error connect data channel %p to channel code %s\", this, m_szChannelCode);\n\n\t\t\treturn;\n\t\t}\n\n\t\tg_globals.m_logger.WriteFormated(\"CDataChannel: Success connect data channel %p to channel code %s\", this, m_szChannelCode);\n\n\t\tm_pLocalDataChannel->SetPairChannel(m_pEchoServerDataChannel);\n\t\tm_pEchoServerDataChannel->SetPairChannel(m_pLocalDataChannel);\n\n\t\tm_pEchoServerDataChannel->StartReceive();\n\t\tm_pEchoServerDataChannel->StartSend();\n\t}\n\n\n\tm_pLocalDataChannel->StartReceive();\n\tm_pLocalDataChannel->StartSend();\n}\n"
  },
  {
    "path": "Bundles/Echoware/DataChannels.cpp",
    "content": "#include \"StdAfx.h\"\n#include \"DataChannels.h\"\n#include \"DataChannel.h\"\n\n#include \"pthread.h\"\n\n#define WM_REMOVE_CHANNEL\t\t(WM_USER+1)\n#define WM_REMOVE_ALLCHANNEL\t(WM_USER+2)\n#define WM_LOCAL_CONNECT_DC\t\t(WM_USER+3)\n\nCDataChannels::CDataChannels(CDllProxyInfo* pProxyInfo)\n{\n\tpthread_mutex_init(&m_ManageThreadMutex, NULL);\n\tpthread_cond_init(&m_ManageThreadCond, NULL);\n\n\tm_nEncriptionLevel=1;\n\tm_pProxyInfo=pProxyInfo;\n\tremoveChannel = 0;\n\tlocalConnectDC = 0;\n\tremoveAllChannels = false;\n\n\tshouldQuit = 0;\n\thasQuit = 0;\n\tm_hManageThread=CreateThread(0, 0, ManageThreadProc, this, 0, &m_dwManageThread);\n}\n\nCDataChannels::~CDataChannels(void)\n{\n\tshouldQuit=1;\n\tpthread_cond_signal(&m_ManageThreadCond);\n\tShutdownThread(m_hManageThread, THREAD_STOP_TIMEOUT, &shouldQuit, &hasQuit);\n\tm_hManageThread=0;\n\tm_dwManageThread=0;\n}\n\n//adds a data channel to the list\nvoid CDataChannels::AddDataChannel(CDataChannel* pDataChannel)\n{\n\tg_globals.m_logger.WriteFormated(\"CDataChannels: Enter Add data channel %p\", pDataChannel);\n\n\tm_critSection.Lock();\n\n\tm_lstDataChannels.push_back(pDataChannel);\n\tpDataChannel->SetEncriptionLevel(m_nEncriptionLevel);\n\n\tm_critSection.Unlock();\n\n\tg_globals.m_logger.WriteFormated(\"CDataChannels: Exit Add data channel %p, count=%d\", pDataChannel, m_lstDataChannels.size());\n}\n\nvoid CDataChannels::InternalRemoveDataChannel(CDataChannel* pDataChannel)\n{\n\tg_globals.m_logger.WriteFormated(\"CDataChannels: Enter Remove data channel %p\", pDataChannel);\n\n\tm_critSection.Lock();\n\n\tsize_t size=m_lstDataChannels.size();\n\n\tm_lstDataChannels.remove(pDataChannel);\n\n\tif (m_lstDataChannels.size()<size)\n\t{\n\t\tdelete pDataChannel;\n\t\tpDataChannel=0;\n\t}\n\n\tm_critSection.Unlock();\n\n\tg_globals.m_logger.WriteFormated(\"CDataChannels: Exit Remove data channel %p, count=%d\", pDataChannel, m_lstDataChannels.size());\n}\n\nvoid CDataChannels::InternalRemoveAllDataChannels()\n{\n\tm_critSection.Lock();\n\n\tint i = 0;\n\tfor(std::list<CDataChannel*>::iterator it=m_lstDataChannels.begin(); it!=m_lstDataChannels.end(); it++)\n\t{\n\t\ti++;\n\t\tCDataChannel* pDataChannel=(CDataChannel*)(*it);\n\t\tg_globals.m_logger.WriteFormated(\"Remove channel %d %d\", i, pDataChannel);\n\n\t\tdelete pDataChannel;\n\n\t\t*it=0;\n\t}\n\n\tm_lstDataChannels.clear();\n\n\tg_globals.m_logger.Write(\"CDataChannels: Remove all data channel\");\n\n\tm_critSection.Unlock();\n}\n\n//removes a data channel from the list\nvoid CDataChannels::RemoveDataChannel(CDataChannel* pDataChannel)\n{\n\tif (m_hManageThread)\n\t{\n\t\tpthread_mutex_lock(&m_ManageThreadMutex);\n\t\tremoveChannel = pDataChannel;\n\t\tpthread_mutex_unlock(&m_ManageThreadMutex);\n\t\tpthread_cond_signal(&m_ManageThreadCond);\n\t}\n}\n\n//removes all the data channels from the list\nvoid CDataChannels::RemoveAllDataChannels()\n{\n\tif (m_hManageThread)\n\t{\n\t\tpthread_mutex_lock(&m_ManageThreadMutex);\n\t\tremoveAllChannels = true;\n\t\tpthread_mutex_unlock(&m_ManageThreadMutex);\n\t\tpthread_cond_signal(&m_ManageThreadCond);\n\t}\n}\n\n//sets the encryption level for this proxy connection\nvoid CDataChannels::SetEncriptionLevel(int nLevel)\n{\n\tm_critSection.Lock();\n\n\tm_nEncriptionLevel=nLevel;\n\n\tfor(std::list<CDataChannel*>::iterator it=m_lstDataChannels.begin(); it!=m_lstDataChannels.end(); it++)\n\t\t((CDataChannel*)*it)->SetEncriptionLevel(nLevel);\n\n\tm_critSection.Unlock();\n}\n\n//gets the encryption level for this proxy connection\nint CDataChannels::GetEncriptionLevel()\n{\n\treturn m_nEncriptionLevel;\n}\n\nvoid CDataChannels::LocalConnectDataChannel(CDataChannel* pDataChannel)\n{\n\tif (m_hManageThread)\n\t{\n\t\tpthread_mutex_lock(&m_ManageThreadMutex);\n\t\tlocalConnectDC = pDataChannel;\n\t\tpthread_mutex_unlock(&m_ManageThreadMutex);\n\t\tpthread_cond_signal(&m_ManageThreadCond);\n\t}\n}\n\nvoid CDataChannels::InternalLocalConnectDataChannel(CDataChannel* pDataChannel)\n{\n\t//g_globals.m_logger.WriteFormated(\"CDataChannels: Enter InternalLocalConnectDataChannel data channel %p\", pDataChannel);\n\n\tm_critSection.Lock();\n\n\tfor (std::list<CDataChannel*>::iterator it=m_lstDataChannels.begin(); it!=m_lstDataChannels.end(); it++)\n\t{\n\t\tif (*it==pDataChannel)\n\t\t{\n\t\t\tif (!pDataChannel->ConnectLocalServer(g_globals.GetPortForOffLoadingData()))\n\t\t\t{\n\t\t\t\tRemoveDataChannel(pDataChannel);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tm_critSection.Unlock();\n\n\t//g_globals.m_logger.WriteFormated(\"CDataChannels: Exit InternalLocalConnectDataChannel data channel %p\", pDataChannel);\n}\n\n#include \"InterfaceDllProxyInfo.h\"\n#include \"DllProxyInfo.h\"\nunsigned long __stdcall CDataChannels::ManageThreadProc(void* lpParameter)\n{\n\tCDataChannels* pDataChannels=(CDataChannels*)lpParameter;\n\n\twhile (true)\n\t{\n\t\tpthread_cond_wait(&pDataChannels->m_ManageThreadCond, &pDataChannels->m_ManageThreadMutex);\n\n\t\tif (pDataChannels->shouldQuit)\n\t\t{\n\t\t\tpthread_mutex_unlock(&pDataChannels->m_ManageThreadMutex);\n\t\t\tbreak;\n\t\t}\n\n\t\tif (pDataChannels->removeChannel)\n\t\t{\n\t\t\tpDataChannels->InternalRemoveDataChannel(pDataChannels->removeChannel);\n\t\t\tpDataChannels->removeChannel=0;\n\t\t}\n\t\tif (pDataChannels->removeAllChannels)\n\t\t{\n\t\t\tpDataChannels->removeAllChannels=FALSE;\n\t\t\tpDataChannels->InternalRemoveAllDataChannels();\n\t\t}\n\t\tif (pDataChannels->localConnectDC)\n\t\t{\n\t\t\tpDataChannels->InternalLocalConnectDataChannel(pDataChannels->localConnectDC);\n\t\t\tpDataChannels->localConnectDC=0;\n\t\t}\n\t\tpthread_mutex_unlock(&pDataChannels->m_ManageThreadMutex);\n\t}\n\n\tpDataChannels->hasQuit=true;\n\tpthread_cond_destroy(&pDataChannels->m_ManageThreadCond);\n\tpthread_mutex_destroy(&pDataChannels->m_ManageThreadMutex);\n\n\treturn 0;\n}"
  },
  {
    "path": "Bundles/Echoware/DataChannels.h",
    "content": "#ifndef _DATACHANNELS_H\n#define _DATACHANNELS_H\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\nclass CDataChannel;\nclass CDllProxyInfo;\n#include \"CritSection.h\"\n#include <list>\n#include \"pthread.h\"\n\n//data channels manager\n//manages all data channels for a proxy connection\nclass CDataChannels\n{\npublic:\n\tCDataChannels(CDllProxyInfo* pProxyInfo);\n\tvirtual ~CDataChannels(void);\n\n\t//adds a data channel to the list\n\tvoid AddDataChannel(CDataChannel* pDataChannel);\n\n\t//removes a data channel from the list\n\tvoid RemoveDataChannel(CDataChannel* pDataChannel);\n\t//removes all the data channels from the list\n\tvoid RemoveAllDataChannels();\n\t//make a local data channel connection\n\tvoid LocalConnectDataChannel(CDataChannel* pDataChannel);\n\n\t//sets the encryption level for this proxy connection\n\tvoid SetEncriptionLevel(int nLevel);\n\t//gets the encryption level for this proxy connection\n\tint GetEncriptionLevel();\n\n\tconst CDllProxyInfo* GetProxyInfo() const {return m_pProxyInfo;}\n\n\t// Thread communication flags\n\tbool shouldQuit;\n\tbool hasQuit;\n\n\tbool removeAllChannels;\n\tCDataChannel *removeChannel;\n\tCDataChannel *localConnectDC;\n\tpthread_cond_t m_ManageThreadCond;\n\tpthread_mutex_t m_ManageThreadMutex;\n\nprotected:\n\tvoid InternalRemoveDataChannel(CDataChannel* pDataChannel);\n\tvoid InternalRemoveAllDataChannels();\n\tvoid InternalLocalConnectDataChannel(CDataChannel* pDataChannel);\n\nprotected:\n\tCCritSection m_critSection;\n\tstd::list<CDataChannel*> m_lstDataChannels;\n\n\tint m_nEncriptionLevel;\n\n\tCDllProxyInfo* m_pProxyInfo;\n\nprotected:\n\tvoid* m_hManageThread;\n\tunsigned long m_dwManageThread;\n\n\t//thread proc for manage data channel notifications\n\tstatic unsigned long __stdcall ManageThreadProc(void* lpParameter);\n};\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/DirService.cpp",
    "content": "/*\n *  DirService.cpp\n *  Echoware\n *\n *  Created by admin on 4/11/07.\n *  Copyright 2007 __MyCompanyName__. All rights reserved.\n *\n */\n\n#include \"DirService.h\"\n\nCDirService::CDirService()\n{\n\ttDirStatus dsStatus;\n\n\tdsRef = 0;\n\tdsSearchNodeRef = 0;\n\n\tdsStatus = dsOpenDirService(&dsRef);\n\tif (dsStatus != eDSNoErr)\n\t{\n\t\t\tcleanup();\n\t\t\treturn;\n\t}\n\n\tdsStatus = OpenSearchNode(dsRef, &dsSearchNodeRef);\n\tif (dsStatus != eDSNoErr)\n\t{\n\t\tcleanup();\n\t\treturn;\n\t}\n}\n\nCDirService::~CDirService()\n{\n\tcleanup();\n}\n\nvoid CDirService::cleanup()\n{\n\tif (dsSearchNodeRef)\n\t\tdsCloseDirNode(dsSearchNodeRef);\n\tdsSearchNodeRef = 0;\n\tif (dsRef)\n\t\tdsCloseDirService(dsRef);\n\tdsRef = 0;\n}\n\n\nNSDictionary* CDirService::attributeDataForNodeOfType(const char* type,\n\t\t\t\t\t\t\t\t\t\t\t\t const char* value,\n\t\t\t\t\t\t\t\t\t\t\t\t const char* attr1,\n\t\t\t\t\t\t\t\t\t\t\t\t const char* attr2,\n\t\t\t\t\t\t\t\t\t\t\t\t const char* attr3,\n\t\t\t\t\t\t\t\t\t\t\t\t const char* attr4,\n\t\t\t\t\t\t\t\t\t\t\t\t const char* attr5,\n\t\t\t\t\t\t\t\t\t\t\t\t const char* attr6)\n{\n\tNSMutableDictionary* dict = [NSMutableDictionary dictionary];\n\n\ttDirStatus\t\tdsStatus\t\t= eDSRecordNotFound;\n\ttDataListPtr\tpAttribsToGet\t= NULL;\n\ttDataListPtr\tpRecTypeList\t= NULL;\n\ttDataListPtr\tpRecNameList\t= NULL;\n\ttDataBufferPtr\tpSearchBuffer\t= NULL;\n\tunsigned long\tulRecCount\t\t= 0;\t// do not limit the number of records we are expecting\n\tunsigned long\tulBufferSize\t= 2048;\t// start with a 2k buffer for any data\n\n\t// we will want the actual record name and the name of the node where the user resides\n\tpAttribsToGet = dsBuildListFromStrings( dsRef, attr1, attr2, attr3, attr4, attr5, attr6 );\n\tif( pAttribsToGet == NULL ) {\n\t\tdsStatus = eMemoryAllocError;\n\t\tgoto cleanup;\n\t}\n\n\t// build a list to search for user record\n\tpRecNameList = dsBuildListFromStrings( dsRef, value, NULL );\n\tif( pRecNameList == NULL ) {\n\t\tdsStatus = eMemoryAllocError;\n\t\tgoto cleanup;\n\t}\n\n\t// build a list of record types to search, in this case users\n\tpRecTypeList = dsBuildListFromStrings( dsRef, type, NULL);\n\tif( pRecTypeList == NULL ) {\n\t\tdsStatus = eMemoryAllocError;\n\t\tgoto cleanup;\n\t}\n\n\t// allocate a working buffer, this may be grown if we receive a eDSBufferTooSmall error\n\tpSearchBuffer = dsDataBufferAllocate( dsRef, ulBufferSize );\n\tif( pSearchBuffer == NULL ) {\n\t\tdsStatus = eMemoryAllocError;\n\t\tgoto cleanup;\n\t}\n\n\t// now search for the record using dsGetRecordList\n\tdsStatus = dsGetRecordList( dsSearchNodeRef, pSearchBuffer, pRecNameList, eDSExact, pRecTypeList,\n\t\t\t\t\t\t\t\tpAttribsToGet, 0, &ulRecCount, NULL );\n\n\t// if there was not an error and we found only 1 record for this user\n\tif( dsStatus == eDSNoErr && ulRecCount == 1 ) {\n\t\ttAttributeListRef\tdsAttributeListRef\t= 0;\n\t\ttRecordEntryPtr\t\tdsRecordEntryPtr\t= 0;\n\t\tint\t\t\t\t\tii;\n\n\t\t// Get the 1st record entry from the buffer since we only expect 1 result\n\t\tdsStatus = dsGetRecordEntry( dsSearchNodeRef, pSearchBuffer, 1, &dsAttributeListRef, &dsRecordEntryPtr );\n\t\tif (dsStatus == eDSNoErr)\n\t\t{\n\t\t\t// loop through the attributes in the record to get the data we requested\n\t\t\t// all indexes with Open Directory APIs start with 1 not 0\n\t\t\tfor (ii = 1 ; ii <= dsRecordEntryPtr->fRecordAttributeCount; ii++)\n\t\t\t{\n\t\t\t\ttAttributeEntryPtr\t\tdsAttributeEntryPtr\t\t\t= NULL;\n\t\t\t\ttAttributeValueEntryPtr\tdsAttributeValueEntryPtr\t= NULL;\n\t\t\t\ttAttributeValueListRef\tdsAttributeValueListRef\t\t= 0;\n\n\t\t\t\t// get the attribute entry from the record\n\t\t\t\tdsStatus = dsGetAttributeEntry( dsSearchNodeRef, pSearchBuffer, dsAttributeListRef, ii,\n\t\t\t\t\t\t\t\t\t\t\t\t&dsAttributeValueListRef, &dsAttributeEntryPtr );\n\n\t\t\t\t// get the value from the attribute if we were successful at getting an entry\n\t\t\t\tif( dsStatus == eDSNoErr ) {\n\t\t\t\t\tint valueIndex=1;\n\t\t\t\t\tNSMutableArray* values = [NSMutableArray array];\n\n\t\t\t\t\twhile( (dsStatus = dsGetAttributeValue( dsSearchNodeRef, pSearchBuffer, valueIndex, dsAttributeValueListRef, &dsAttributeValueEntryPtr )) == eDSNoErr ) {\n\t\t\t\t\t\tNSString* key   = [NSString stringWithCString: dsAttributeEntryPtr->fAttributeSignature.fBufferData encoding: NSUTF8StringEncoding];\n\t\t\t\t\t\tNSString* value = [NSString stringWithCString: dsAttributeValueEntryPtr->fAttributeValueData.fBufferData encoding: NSUTF8StringEncoding];\n\t\t\t\t\t\t[values addObject:value];\n\t\t\t\t\t\tif ([dict objectForKey:key]==nil) {\n\t\t\t\t\t\t\t[dict setObject:values forKey:key];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalueIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// close any value list references that may have been opened\n\t\t\t\tif( dsAttributeValueListRef != 0 ) {\n\t\t\t\t\tdsCloseAttributeValueList( dsAttributeValueListRef );\n\t\t\t\t\tdsAttributeValueListRef = 0;\n\t\t\t\t}\n\n\t\t\t\t// free the attribute value entry if we got an entry\n\t\t\t\tif( dsAttributeValueEntryPtr != NULL ) {\n\t\t\t\t\tdsDeallocAttributeValueEntry( dsRef, dsAttributeValueEntryPtr );\n\t\t\t\t\tdsAttributeValueEntryPtr = NULL;\n\t\t\t\t}\n\n\t\t\t\t// free the attribute entry itself as well\n\t\t\t\tif( dsAttributeEntryPtr != NULL ) {\n\t\t\t\t\tdsDeallocAttributeEntry( dsRef, dsAttributeEntryPtr );\n\t\t\t\t\tdsAttributeEntryPtr = NULL;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// close any reference to attribute list\n\t\t\tif( dsAttributeListRef != 0 ) {\n\t\t\t\tdsCloseAttributeList( dsAttributeListRef );\n\t\t\t\tdsAttributeListRef = 0;\n\t\t\t}\n\n\t\t\t// deallocate the record entry\n\t\t\tif( dsRecordEntryPtr != NULL ) {\n\t\t\t\tdsDeallocRecordEntry( dsRef, dsRecordEntryPtr );\n\t\t\t\tdsRecordEntryPtr = NULL;\n\t\t\t}\n\t\t}\n\t} else if( dsStatus == eDSNoErr && ulRecCount > 1 ) {\n\t\t// if we have more than 1 user, then we shouldn't attempt to authenticate\n\t\t// we chose to return eDSAuthInvalidUserName as an error since we can't distinguish\n\t\t// the specific user to return\n\t\tdsStatus = eDSAuthInvalidUserName;\n\t}\n\ncleanup:\n\t\t// if we allocated pAttribsToGet, we need to clean up\n\t\tif( pAttribsToGet != NULL ) {\n\t\t\tdsDataListDeallocate( dsRef, pAttribsToGet );\n\n\t\t\t// need to free pointer as dsDataListDeallocate does not free it, just the list items\n\t\t\tfree( pAttribsToGet );\n\t\t\tpAttribsToGet = NULL;\n\t\t}\n\n\t// if we allocated pRecTypeList, we need to clean up\n\tif( pRecTypeList != NULL ) {\n\t\tdsDataListDeallocate( dsRef, pRecTypeList );\n\n\t\t// need to free pointer as dsDataListDeallocate does not free it, just the list items\n\t\tfree( pRecTypeList );\n\t\tpRecTypeList = NULL;\n\t}\n\n\t// if we allocated pRecNameList, we need to clean up\n\tif( pRecNameList != NULL ) {\n\t\tdsDataListDeallocate( dsRef, pRecNameList );\n\n\t\t// need to free pointer as dsDataListDeallocate does not free it, just the list items\n\t\tfree( pRecNameList );\n\t\tpRecNameList = NULL;\n\t}\n\n\t// if we allocated pSearchBuffer, we need to clean up\n\tif( pSearchBuffer != NULL ) {\n\t\tdsDataBufferDeAllocate( dsRef, pSearchBuffer );\n\t\tpSearchBuffer = NULL;\n\t}\n\n\treturn dict;\n}\n\nbool CDirService::authenticateUser(const char* username, const char* password)\n{\n\tNSDictionary* userInfo = attributeDataForNodeOfType(kDSStdRecordTypeUsers, username, kDSNAttrRecordName, kDSNAttrMetaNodeLocation,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNULL, NULL,\tNULL, NULL);\n\tNSString* recordName   = [[userInfo objectForKey:[NSString stringWithCString:kDSNAttrRecordName encoding:NSUTF8StringEncoding]] objectAtIndex:0];\n\tNSString* nodeLocation = [[userInfo objectForKey:[NSString stringWithCString:kDSNAttrMetaNodeLocation encoding:NSUTF8StringEncoding]] objectAtIndex:0];\n\tbool rc = false;\n\tif ([recordName length] > 0 && [nodeLocation length] > 0)\n\t{\n\t\ttDirNodeReference\tdsUserNodeRef\t= 0;\n\t\ttDirStatus\t\t\tdsStatus;\n\n\t\ttDataListPtr dsUserNodePath = dsBuildFromPath( dsRef, [nodeLocation cStringUsingEncoding:NSUTF8StringEncoding], \"/\" );\n\n\t\tdsStatus = dsOpenDirNode( dsRef, dsUserNodePath, &dsUserNodeRef );\n\n\t\tif ( dsStatus == eDSNoErr )\n\t\t{\n\n\t\t\t// Use our Utility routine to do the authentication\n\t\t\tdsStatus = DoPasswordAuth( dsRef, dsUserNodeRef, kDSStdAuthNodeNativeClearTextOK,\n\t\t\t\t\t\t\t\t\t   [recordName cStringUsingEncoding:NSUTF8StringEncoding], password );\n\n\t\t\t// Determine if successful.  There are cases where you may receive other errors\n\t\t\t// such as eDSAuthPasswordExpired.\n\t\t\tif ( dsStatus == eDSNoErr )\n\t\t\t{\n\t\t\t\trc = true;\n\t\t\t}\n\t\t}\n\n\t\t// free the data list as it is no longer needed\n\t\tdsDataListDeallocate( dsRef, dsUserNodePath );\n\t\tfree( dsUserNodePath );\n\t\tdsUserNodePath = NULL;\n\t}\n\n\treturn rc;\n}\n\ntDirStatus CDirService::OpenSearchNode(tDirReference inDSRef, tDirNodeReference *outNodeRef)\n{\n\ttDataBufferPtr\t\tpWorkingBuffer\t= NULL;\n\ttDataListPtr\t\tpSearchNode\t\t= NULL;\n\ttDirStatus\t\t\tdsStatus;\n\ttContextData\t\tdsContext\t\t= NULL;\n\tunsigned long\t\tulReturnCount\t= 0;\n\n\t// verify none of the parameters are NULL, if so return an eDSNullParameter\n\tif( outNodeRef == NULL || inDSRef == 0 ) {\n\t\treturn eDSNullParameter;\n\t}\n\n\t// allocate a buffer to hold return information, defaulting to 4k\n\tpWorkingBuffer = dsDataBufferAllocate( inDSRef, 4096 );\n\tif( pWorkingBuffer == NULL ) {\n\t\treturn eMemoryAllocError;\n\t}\n\n\t// locate the name of the search node\n\tdsStatus = dsFindDirNodes( inDSRef, pWorkingBuffer, NULL, eDSSearchNodeName, &ulReturnCount, &dsContext );\n\tif( dsStatus == eDSNoErr ) {\n\t\t// pass 1 for node index since there should only be one value\n\t\tdsStatus = dsGetDirNodeName( inDSRef, pWorkingBuffer, 1, &pSearchNode );\n\t}\n\n\t// if we ended up with a context, we should release it\n\tif( dsContext != NULL ) {\n\t\tdsReleaseContinueData( inDSRef, dsContext );\n\t\tdsContext = NULL;\n\t}\n\n\t// release the current working buffer\n\tif( pWorkingBuffer != NULL ) {\n\t\tdsDataBufferDeAllocate( inDSRef, pWorkingBuffer );\n\t\tpWorkingBuffer = NULL;\n\t}\n\n\t// open search node\n\tif( dsStatus == eDSNoErr && pSearchNode != NULL ) {\n\t\tdsStatus = dsOpenDirNode( inDSRef, pSearchNode, outNodeRef );\n\t}\n\n\t// deallocate the tDataListPtr item used to locate the Search node\n\tif( pSearchNode != NULL ) {\n\t\tdsDataListDeallocate( inDSRef, pSearchNode );\n\n\t\t// need to free pointer as dsDataListDeallocate does not free it, just the list items\n\t\tfree( pSearchNode );\n\t\tpSearchNode = NULL;\n\t}\n\n\treturn dsStatus;\n} // OpenSearchNode\n\ntDirStatus CDirService::DoPasswordAuth(tDirReference inDSRef, tDirNodeReference inNodeRef, const char *inAuthMethod,\n\t\t\t\t\t\t   const char *inRecordName, const char *inPassword)\n{\n\ttDirStatus\t\tdsStatus\t\t= eDSAuthFailed;\n\ttDataNodePtr\tpAuthMethod\t\t= NULL;\n\ttDataBufferPtr\tpAuthStepData\t= NULL;\n\ttDataBufferPtr\tpAuthRespData\t= NULL;\n\ttContextData\tpContextData\t= NULL;\n\n\t// if any of our parameters are NULL, return a NULL parameter\n\t// if a password is not set for a user, an empty string should be sent for the password\n\tif( inDSRef == 0 || inNodeRef == 0 || inRecordName == NULL || inPassword == NULL ) {\n\t\treturn eDSNullParameter;\n\t}\n\n\t// since this is password based, we can only support password-based methods\n\tif( strcmp(inAuthMethod, kDSStdAuthNodeNativeNoClearText) == 0 ||\n\t\tstrcmp(inAuthMethod, kDSStdAuthNodeNativeClearTextOK) == 0 ||\n\t\tstrcmp(inAuthMethod, kDSStdAuthClearText) == 0 ||\n\t\tstrcmp(inAuthMethod, kDSStdAuthCrypt) == 0 ) {\n\n\t\t// turn the specified method into a tDataNode\n\t\tpAuthMethod = dsDataNodeAllocateString( inDSRef, inAuthMethod );\n\t\tif( pAuthMethod == NULL ) {\n\t\t\tdsStatus = eMemoryAllocError;\n\t\t\tgoto cleanup;\n\t\t}\n\n\t\t// allocate a buffer large enough to hold all the username and password plus length bytes\n\t\tpAuthStepData = dsDataBufferAllocate( inDSRef, 4 + strlen(inRecordName) + 4 + strlen(inPassword) );\n\t\tif( pAuthStepData == NULL ) {\n\t\t\tdsStatus = eMemoryAllocError;\n\t\t\tgoto cleanup;\n\t\t}\n\n\t\t// allocate a buffer for the out step data even though we don't expect anything,\n\t\t// it is a required parameter\n\t\tpAuthRespData = dsDataBufferAllocate( inDSRef, 128 );\n\t\tif( pAuthRespData == NULL ) {\n\t\t\tdsStatus = eMemoryAllocError;\n\t\t\tgoto cleanup;\n\t\t}\n\n\t\t// now place the username and password into the buffer\n\t\tAppendStringToBuffer( pAuthStepData, inRecordName, strlen(inRecordName) );\n\t\tAppendStringToBuffer( pAuthStepData, inPassword, strlen(inPassword) );\n\n\t\t// attempt the authentication\n\t\tdsStatus = dsDoDirNodeAuth( inNodeRef, pAuthMethod, 1, pAuthStepData, pAuthRespData, &pContextData );\n\n\t} else {\n\t\t// otherwise, return a parameter error\n\t\tdsStatus = eDSAuthParameterError;\n\t}\n\ncleanup:\n\n\t\t// release pContextData if we had continue data\n\t\tif( pContextData != NULL ) {\n\t\t\tdsReleaseContinueData( inDSRef, pContextData );\n\t\t\tpContextData = NULL;\n\t\t}\n\n\t// deallocate memory for pAuthRespData if it was allocated\n\tif( pAuthRespData != NULL ) {\n\t\tdsDataNodeDeAllocate( inDSRef, pAuthRespData );\n\t\tpAuthRespData = NULL;\n\t}\n\n\t// deallocate memory for pAuthStepData if it was allocated\n\tif( pAuthStepData != NULL ) {\n\t\tdsDataBufferDeAllocate( inDSRef, pAuthStepData );\n\t\tpAuthStepData = NULL;\n\t}\n\n\t// deallocate memory for pAuthMethod if it was allocated\n\tif( pAuthMethod != NULL ) {\n\t\tdsDataNodeDeAllocate( inDSRef, pAuthMethod );\n\t\tpAuthMethod = NULL;\n\t}\n\n\treturn dsStatus;\n} // DoPasswordAuth\n\n#pragma mark Support Functions\n\ntDirStatus CDirService::AppendStringToBuffer(tDataBufferPtr inBuffer, const char *inString, long inLength)\n{\n\ttDirStatus\tdsStatus\t= eDSBufferTooSmall;\n\n\t// ensure neither of our parameters are NULL\n\tif( inString == NULL || inBuffer == NULL ) {\n\t\treturn eDSNullParameter;\n\t}\n\n\t// check to see if we have enough room in the buffer for the string and the 4 byte length\n\tif( inBuffer->fBufferSize >= (inBuffer->fBufferLength + 4 + inLength) ) {\n\n\t\tchar\t*pBufferEnd = inBuffer->fBufferData + inBuffer->fBufferLength;\n\n\t\t// prepend the data with the length of the string\n\t\tbcopy( &inLength, pBufferEnd, sizeof(long) );\n\t\tpBufferEnd += sizeof( long );\n\n\t\t// now add the string to the buffer\n\t\tbcopy( inString, pBufferEnd, inLength );\n\n\t\t// increase the buffer accordingly\n\t\tinBuffer->fBufferLength += 4 + inLength;\n\n\t\t// set successful error status\n\t\tdsStatus = eDSNoErr;\n\t}\n\n\treturn dsStatus;\n} // AppendStringToBuffer\n"
  },
  {
    "path": "Bundles/Echoware/DirService.h",
    "content": "/*\n *  DirService.h\n *  Echoware\n *\n *  Created by admin on 4/11/07.\n *  Copyright 2007 __MyCompanyName__. All rights reserved.\n *\n */\n\n#import <Cocoa/Cocoa.h>\n#import <DirectoryService/DirectoryService.h>\n\nclass CDirService\n{\n\tprivate:\n\t\ttDirReference dsRef;\n\t\ttDirNodeReference dsSearchNodeRef;\n\n\t\ttDirStatus OpenSearchNode(tDirReference inDSRef, tDirNodeReference *outNodeRef);\n\t\ttDirStatus DoPasswordAuth(tDirReference inDSRef, tDirNodeReference inNodeRef, const char *inAuthMethod,\n\t\t\t\t\t\t   const char *inRecordName, const char *inPassword);\n\t\ttDirStatus AppendStringToBuffer(tDataBufferPtr inBuffer, const char *inString, long inLength);\n\tpublic:\n\t\tCDirService();\n\t\tvirtual ~CDirService();\n\n\t\tNSDictionary* attributeDataForNodeOfType(const char* type,\n\t\t\t\t\t\t\t\t\t\t\t\t const char* value,\n\t\t\t\t\t\t\t\t\t\t\t\t const char* attr1,\n\t\t\t\t\t\t\t\t\t\t\t\t const char* attr2,\n\t\t\t\t\t\t\t\t\t\t\t\t const char* attr3,\n\t\t\t\t\t\t\t\t\t\t\t\t const char* attr4,\n\t\t\t\t\t\t\t\t\t\t\t\t const char* attr5,\n\t\t\t\t\t\t\t\t\t\t\t\t const char* attr6);\n\n\t\tbool authenticateUser(const char* username, const char* password);\n\t\tvoid cleanup();\n};\n"
  },
  {
    "path": "Bundles/Echoware/DllProxyInfo.cpp",
    "content": "#include \"stdafx.h\"\n#include \"DllProxyInfo.h\"\n#include \"globals.h\"\n\nCDllProxyInfo::CDllProxyInfo()\n:\tm_strName(\"\")\n\t,m_strIP(\"\")\n\t,m_strPort(\"\")\n\t,m_strPass(\"\")\n\t,m_strMyID(\"\")\n\t,m_dwStatus(0)\n\t,m_strIPPort(\"\")\n\t,m_bReconnectProxy(false)\n{\n\tm_nConnectTimeOut=m_nReceiveTimeOut=m_nSendTimeOut=30;\n}\n\nCDllProxyInfo::~CDllProxyInfo()\n{\n}\n\n//Sets the Proxy Name for the proxy Info object\nvoid CDllProxyInfo::SetName(char* name)\n{\n\tm_strName=name;\n}\n\n//Sets the IP Address of the proxy along with a specified Port\nvoid CDllProxyInfo::SetIPPort(char* ipport)\n{\n\tchar* p;\n\tif ((p=strchr(ipport, ':')))\n\t{\n\t\tm_strIP.assign(ipport, p-ipport);\n\t\tm_strPort.assign(p);\n\t}\n\telse\n\t\tm_strIP=ipport;\n\n\tm_strIPPort=ipport;\n}\n\n//Sets the IP Address of the proxy info Object\nvoid CDllProxyInfo::SetIP(const char* ip)\n{\n\tm_strIP=ip;\n\n\tm_strIPPort=m_strIP;\n\n\tif (!m_strPort.empty())\n\t\tm_strIPPort+=\":\"+m_strPort;\n}\n\n//Sets the port of the proxy info object\nvoid CDllProxyInfo::SetPort(const char* port)\n{\n\tm_strPort=port;\n\n\tm_strIPPort=m_strIP+\":\"+m_strPort;\n}\n\n//Sets the authentication channel password for the Proxy\nvoid CDllProxyInfo::SetPassword(const char* pass)\n{\n\tm_strPass=pass;\n}\n\n//Sets the status of the proxy whether connected or not\nvoid CDllProxyInfo::SetStatus(int Status, bool bStatus)\n{\n\tif (bStatus)\n\t\tm_dwStatus |=Status;\n\telse\n\t\tm_dwStatus &=~Status;\n}\n\n//Set ID for authentication and/or identification with a proxy server\n//Each proxyInfo object may have a different MyID value.\nbool CDllProxyInfo::SetMyID(const char* MyID)\n{\n\tm_strMyID=MyID;\n\treturn true;\n}\n\n//Set timeouts for Connect, Receive, Send\nbool CDllProxyInfo::SetSocketTimeout(int connectTimeout, int ReceiveTimeout, int SendTimeout)\n{\n\tm_nConnectTimeOut=connectTimeout;\n\tm_nReceiveTimeOut=ReceiveTimeout;\n\tm_nSendTimeOut=SendTimeout;\n\n\tg_globals.m_logger.WriteFormated(\"CDllProxyInfo: connectTimeout=%d ReceiveTimeout=%d SendTimeout=%d\", m_nConnectTimeOut, m_nReceiveTimeOut, m_nSendTimeOut);\n\treturn true;\n}\n\n//Retrieves the name of the Proxy\nconst char* CDllProxyInfo::GetName() const\n{\n\treturn m_strName.c_str();\n}\n\n//Retrieves the IP and Port of the Proxy info together\nconst char* CDllProxyInfo::GetIpPort() const\n{\n\tif (m_strPort.empty())\n\t\treturn m_strIP.c_str();\n\n\treturn m_strIPPort.c_str();\n}\n\n//Retrieves the IP address for the Proxy Info\nconst char* CDllProxyInfo::GetIP() const\n{\n\treturn m_strIP.c_str();\n}\n\n//Retrieves the Port for the Proxy\nconst char* CDllProxyInfo::GetPort() const\n{\n\treturn m_strPort.c_str();\n}\n\n//Retrieves the authentication channel password of the Proxy\nconst char* CDllProxyInfo::GetPassword() const\n{\n\treturn m_strPass.c_str();\n}\n\n//Retrieves the status of the Proxy, connected or not, the status of any \"in-process\"\n//connection attempts, and all active data connections with those proxies.\nint CDllProxyInfo::GetStatus() const\n{\n\treturn m_dwStatus;\n}\n\n//Obtain the MyID value associated with a proxyInfo object\nconst char* CDllProxyInfo::GetMyID() const\n{\n\treturn m_strMyID.c_str();\n}\n\nint CDllProxyInfo::GetConnectTimeout() const\n{\n\treturn m_nConnectTimeOut;\n}\n\nint CDllProxyInfo::GetReceiveTimeout() const\n{\n\treturn m_nReceiveTimeOut;\n}\n\nint CDllProxyInfo::GetSendTimeout() const\n{\n\treturn m_nSendTimeOut;\n}\n\nbool CDllProxyInfo::GetReconnectProxy() const\n{\n\treturn m_bReconnectProxy;\n}\n\nvoid CDllProxyInfo::SetReconnectProxy(bool bReconnectProxy)\n{\n\tm_bReconnectProxy=bReconnectProxy;\n}"
  },
  {
    "path": "Bundles/Echoware/DllProxyInfo.h",
    "content": "#ifndef _PROXYINFO_H\n#define _PROXYINFO_H\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n#include <string>\n#include \"InterfaceDllProxyInfo.h\"\n\n//#define ID_STRING_SIZE\t\t255\n\n//IDllProxyInfo implementation\n\nclass CDllProxyInfo : public IDllProxyInfo\n{\nprotected:\n\tstd::string m_strName;\n\tstd::string m_strIP;\n\tstd::string m_strPort;\n\tstd::string  m_strPass;\n\tstd::string m_strMyID;\n\tDWORD m_dwStatus;\n\n\tint m_nConnectTimeOut, m_nReceiveTimeOut, m_nSendTimeOut;\n\n\tstd::string m_strIPPort;\n\tbool m_bReconnectProxy;\n\npublic:\n\tCDllProxyInfo();\n\tvirtual ~CDllProxyInfo();\n\n\tvirtual void SetName(char* name);\n\tvirtual void SetIPPort(char* ipport);\n\tvirtual void SetIP(const char* ip);\n\tvirtual void SetPort(const char* port);\n\tvirtual void SetPassword(const char* pass);\n\tvirtual void SetStatus(int Status, bool bStatus);\n\tvirtual bool SetMyID(const char* MyID);\n\tvirtual bool SetSocketTimeout(int connectTimeout, int ReceiveTimeout, int SendTimeout);\n\tvirtual void SetReconnectProxy(bool bReconnectProxy);\n\n\tvirtual const char* GetName() const;\n\tvirtual const char* GetIpPort() const;\n\tvirtual const char* GetIP() const;\n\tvirtual const char* GetPort() const;\n\tvirtual const char* GetPassword() const;\n\tvirtual int\t  GetStatus() const;\n\tvirtual\tconst char* GetMyID() const;\n\tvirtual bool GetReconnectProxy()const;\n\n\tvirtual int GetConnectTimeout() const;\n\tvirtual int GetReceiveTimeout() const;\n\tvirtual int GetSendTimeout() const;\n};\n#endif\n"
  },
  {
    "path": "Bundles/Echoware/EchoController.h",
    "content": "/* EchoController */\n\n#import <Cocoa/Cocoa.h>\n\nclass CServerListSynchronize;\nclass CCritSection;\nclass CMyDllProxyInfo;\n\n@interface EchoController : NSObject\n{\n\tNSTabView *mainTabView;\n\n    IBOutlet NSView *echoServersView;\n\n\t@public IBOutlet NSTableView *echoTableView;\n\n    IBOutlet NSButton *addButton;\n    IBOutlet NSButton *editButton;\n    IBOutlet NSButton *removeButton;\n    IBOutlet NSWindow *addServerWindow;\n\tIBOutlet NSWindow *editServerWindow;\n\n\tIBOutlet NSTextFieldCell *echoServerField;\n\tIBOutlet NSTextFieldCell *usernameField;\n\tIBOutlet NSTextFieldCell *passwordField;\n\tIBOutlet NSTextFieldCell *echoServerField_edit;\n\tIBOutlet NSTextFieldCell *usernameField_edit;\n\tIBOutlet NSTextFieldCell *passwordField_edit;\n\n\tIBOutlet NSButton *advancedSettingsButton;\n\tIBOutlet NSWindow *advancedSettingsWindow;\n\n\tIBOutlet NSButton *proxyAuthenticationCheckbox;\n    IBOutlet NSTextField *proxyAddress;\n    IBOutlet NSTextField *proxyPort;\n    IBOutlet NSTextField *proxyUsername;\n    IBOutlet NSTextField *proxyUsernameLabel;\n    IBOutlet NSTextField *proxyPassword;\n    IBOutlet NSTextField *proxyPasswordLabel;\n\n    IBOutlet NSButton *disableEchoCheckbox;\n    IBOutlet NSButton *enableLoggingCheckbox;\n\t//IBOutlet NSButton *useAESCheckbox; YS: 21.12.2006 due to remove \"128 bit encryption\" button\n\n\tIBOutlet NSTextField *versionTextField;\n\n\t@public NSMutableArray *echoServers;\n\t@public NSMutableArray *echoInfoProxys;\n\t@public NSMutableArray *echoInfoProxysToRemove;\n\n\tint m_nEditIndex;\n\tCServerListSynchronize *m_ServerList;\n\tCCritSection *m_critSection;\n}\n\n- (void) loadGUI: sender;\n- (void) setOffloadingPort: (id)sender;\n\n- (void) loadServerList;\n- (void) loadProxyFields;\n\n- (void) reloadData;\n- (void) selectRow: (int)row;\n- (void) removeRow: (int)row removeProxy: (bool)rmProxy removeServer: (bool)rmServer;\n- (CMyDllProxyInfo*) getDllProxyInfo: (int)row;\n- (void) addInfo: (CMyDllProxyInfo*)info;\n- (void) saveData;\n\n- (NSString*) GetColumnValue: (int)row column: (NSString*)col;\n\n- (void)windowWillClose: (NSNotification*)aNotification;\n\n- (IBAction)addServer:(id)sender;\n- (IBAction)advancedSettings:(id)sender;\n- (IBAction)cancelAddServer:(id)sender;\n- (IBAction)cancelAdvancedSettings:(id)sender;\n- (IBAction)completeAddServer:(id)sender;\n- (IBAction)completeAdvancedSettings:(id)sender;\n- (IBAction)disableEcho:(id)sender;\n- (IBAction)enableLogging:(id)sender;\n- (IBAction)removeServer:(id)sender;\n- (IBAction)requireProxyAuthentication:(id)sender;\n- (IBAction)useEncryption:(id)sender;\n- (IBAction)editServer:(id)sender;\n- (IBAction)cancelEditServer:(id)sender;\n- (IBAction)completeEditServer:(id)sender;\n@end\n"
  },
  {
    "path": "Bundles/Echoware/EchoController.m",
    "content": "\n#import \"EchoController.h\"\n#import \"Echoware.h\"\n#import \"InterfaceDLLProxyInfo.h\"\n#import \"unistd.h\"\n\n#include <CoreFoundation/CoreFoundation.h>\n#include <SystemConfiguration/SystemConfiguration.h>\n\n#include \"User.h\"\n#include \"ProxiesManager.h\"\n#include \"MyDllProxyInfo.h\"\n#include \"globals.h\"\n#include \"ServerListSynchronize.h\"\n#include \"CritSection.h\"\n\nstatic EchoController *sharedEchoController;\n\n@interface NSString (EchoExtenstions)\n\n- (NSData *) nullTerminatedData;\n\n@end\n\n@implementation NSString (EchoExtenstions)\n\n- (NSData *) nullTerminatedData\n{\n\treturn [NSData dataWithBytes:[self lossyCString] length:[self cStringLength]+1];\n}\n\n@end\n\n@implementation EchoController (RFBBundle)\n\n+ (void) loadGUI\n{\n\tsharedEchoController = [[self alloc] init];\n}\n\n+ (void) rfbUsage\n{\n}\n\n#include \"rfbserver.h\"\n#include \"RFBBundleWrapper.h\"\n\n+ (void) rfbStartup: theServer\n{\n\tCRFBBundleWrapper::GetInstance()->rfb_port = ((rfbserver*)theServer)->rfbPort;\n\tCRFBBundleWrapper::GetInstance()->is_rfb = true;\n\tCRFBBundleWrapper::GetInstance()->UserDefaultsChecking();\n\tCRFBBundleWrapper::GetInstance()->startRunLoop();\n}\n\n+ (void) rfbRunning\n{\n}\n\n+ (void) rfbPoll\n{\n}\n\n+ (void) rfbReceivedClientMessage\n{\n}\n\n+ (void) rfbShutdown\n{\n\tCRFBBundleWrapper::FreeInstance();\n}\n\n@end\n\n@implementation EchoController\n\n- init\n{\n\tself = [super init];\n\n\tif (self)\n\t{\n\t\techoInfoProxys = [[NSMutableArray alloc] init];\n\t\techoInfoProxysToRemove = [[NSMutableArray alloc] init];\n\t\tm_nEditIndex = -1;\n\n\t\tm_critSection = new CCritSection();\n\t\tm_ServerList = new CServerListSynchronize();\n\n\t\t[self loadGUI: self];\n\n\t\tNSLog(@\"Starting Threads...\");\n\t\tm_ServerList->Init();\n\t\tm_ServerList->Start(self);\n\t\tNSLog(@\"Starting Threads done...\");\n\t}\n}\n\n- (void)windowWillClose: (NSNotification*)aNotification;\n{\n\tNSLog(@\"Terminating Threads...\");\n\tif (m_ServerList)\n\t\tm_ServerList->Terminate();\n\tNSLog(@\"Terminating Threads done...\");\n\n\tNSLog(@\"Disconnecting All Connections...\");\n\tbool disconnected = DisconnectAllProxies();\n\tNSLog(@\"Disconnecting All Connections done... %d\", disconnected);\n\tif (m_ServerList)\n\t\tdelete m_ServerList;\n\tm_ServerList = NULL;\n\n\tif (m_critSection)\n\t\tdelete m_critSection;\n\tm_critSection = NULL;\n\n\t[echoInfoProxys removeAllObjects];\n\t[echoInfoProxysToRemove removeAllObjects];\n\n\t[echoInfoProxys release];\n\t[echoInfoProxysToRemove release];\n\n\t[echoServers removeAllObjects];\n\t[echoServers release];\n\n\tm_nEditIndex = -1;\n}\n\n- (void) loadGUI: sender\n{\n\tNSEnumerator *viewEnum = [[[[[NSApp delegate] window] contentView] subviews] objectEnumerator];\n\n\twhile (mainTabView = [viewEnum nextObject])\n\t\tif ([mainTabView isKindOfClass:[NSTabView class]])\n\t\t\tbreak;\n\n\tif (mainTabView)\n\t{\n\t\tif ([NSBundle loadNibNamed:@\"EchoServers\" owner:self])\n\t\t\tNSLog(@\"EchoServer Gui loaded\");\n\t\telse\n\t\t\tNSLog(@\"EchoServer Gui loading Error %d\", errno);\n\n\t\tNSRect rect = [[mainTabView window] frame];\n\t\trect.size.width += 80;\n\t\t[[mainTabView window] setFrame: rect display: YES];\n\t}\n\telse\n\t{ // Sometimes we aren't able to get the main window, let's try again\n\t\t[self performSelector:@selector(loadGUI:) withObject:self afterDelay:1.0];\n\t}\n}\n\n- (BOOL) canWriteToFile: (NSString *) path\n{\n    if ([[NSFileManager defaultManager] fileExistsAtPath:path])\n        return [[NSFileManager defaultManager] isWritableFileAtPath:path];\n    else\n        return [[NSFileManager defaultManager] isWritableFileAtPath:[path stringByDeletingLastPathComponent]];\n}\n\n- (void) setOffloadingPort: (id)sender\n{\n\tSetPortForOffLoadingData((int) [[NSApp delegate] runningPortNum]);\n}\n\n- (void) awakeFromNib\n{\n\tif (InitializeProxyDll())\n\t{\n\t\tNSTabViewItem *newTab = [[NSTabViewItem alloc] initWithIdentifier:@\"Echo\"];\n\n\t\t//SetLoggingOptions(TRUE, \"/tmp/EchoServer.log\");\n\t\t//YS: choose log file, where we can write\n\t\tNSArray *logFiles = [NSArray arrayWithObjects:\n\t\t\t[[NSUserDefaults standardUserDefaults] stringForKey:@\"LogFile\"],\n\t\t\t@\"/var/log/OSXvnc-server.log\",\n\t\t\t@\"~/Library/Logs/OSXvnc-server.log\",\n\t\t\t[[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@\"OSXvnc-server.log\"],\n\t\t\t@\"/tmp/OSXvnc-server.log\",\n\t\t\tnil];\n\t\tNSEnumerator *logEnumerators = [logFiles objectEnumerator];\n\t\t// Find first writable location for the log file\n\t\tNSString *logFile = nil;\n\t\twhile (logFile = [logEnumerators nextObject])\n\t\t{\n\t\t\tlogFile = [logFile stringByStandardizingPath];\n\t\t\tif ([logFile length] && [self canWriteToFile:logFile])\n\t\t\t{\n\t\t\t\t[logFile retain];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//\n\n\t\t//converto from NSString to char*\n\t\tint len_logFile = [logFile length];\n\t\tchar pLogFile[len_logFile + 1];\n\t\tstrncpy(pLogFile, [logFile cString], len_logFile);\n\t\tpLogFile[len_logFile] = '\\0';\n\t\t//\n\n\t\tbool enableLog = [[NSUserDefaults standardUserDefaults] boolForKey:@\"EnableLogging\"];\n\t\t[enableLoggingCheckbox setState: enableLog];\n\t\tSetLoggingOptions(enableLog, pLogFile);\n\n\t\tSetPortForOffLoadingData((int) [[NSApp delegate] runningPortNum]);\n\n\t\t[disableEchoCheckbox setState: [[NSUserDefaults standardUserDefaults] boolForKey:@\"EchoDisabled\"]];\n\t\t[self disableEcho:self];\n\t\t//YS: 21.12.2006 due to remove \"128 bit encryption\" button\n\t\t//[useAESCheckbox setState: [[NSUserDefaults standardUserDefaults] boolForKey:@\"EchoAESEncryption\"]];\n\n\t\t[self loadProxyFields];\n\n\t\t[newTab setLabel:@\"echoServer\"];\n\t\t[mainTabView addTabViewItem:newTab];\n\t\t[newTab setView:echoServersView];\n\n\t\tNSString *first = [NSString stringWithCString: GetDllVersion()];\n\t\tNSString *second = [NSString stringWithFormat: @\"EchoWare version %@\", first];\n\t\t[versionTextField setStringValue: second];\n\t\tNSLog(second);\n\n\t\t[self loadServerList];\n\t\t[self saveData];\n\n\t\t[echoTableView setTarget:self];\n\t\t[echoTableView setDoubleAction:@selector(editServer:)];\n\t}\n}\n\n- (void) loadProxyFields\n{\n\t// The EchoDLL expects us to manage memory on these strings that are passed in so we'll make some NSData objects\n\tstatic id proxyStringsDictionary = nil;\n\n\tNSString *proxyAddrString = [[NSUserDefaults standardUserDefaults] stringForKey:@\"EchoProxyAddr\"];\n\tNSString *proxyPortString = [[NSUserDefaults standardUserDefaults] stringForKey:@\"EchoProxyPort\"];\n\tNSString *proxyUserString = [[NSUserDefaults standardUserDefaults] stringForKey:@\"EchoProxyUser\"];\n\tNSString *proxyPassString = [[NSUserDefaults standardUserDefaults] stringForKey:@\"EchoProxyPass\"];\n\n\t/* Load To GUI */\n\tif (proxyAddrString)\n\t\t[proxyAddress setStringValue: proxyAddrString];\n\tif ([proxyPortString intValue])\n\t\t[proxyPort setIntValue: [proxyPortString intValue]];\n\n\tif (proxyUserString)\n\t{\n\t\t[proxyUsername setStringValue: proxyUserString];\n\t\tif (proxyPassString)\n\t\t\t[proxyPassword setStringValue: proxyPassString];\n\t\telse\n\t\t\tproxyPassString = @\"\";\n\n\t\t[proxyAuthenticationCheckbox setState: TRUE];\n\t}\n\telse\n\t{\n\t\tproxyUserString = @\"\";\n\t\tproxyPassString = @\"\";\n\t}\n\n\t[self requireProxyAuthentication:self];\n\n\t// Load to EchoWare\n\tif ([proxyAddrString length] && [proxyPortString intValue])\n\t{\n\t\t[proxyStringsDictionary release];\n\t\tproxyStringsDictionary = [[NSMutableDictionary alloc] init];\n\n\t\t[proxyStringsDictionary setObject:[proxyAddrString nullTerminatedData] forKey:@\"EchoProxyAddr\"];\n\t\t[proxyStringsDictionary setObject:[proxyPortString nullTerminatedData] forKey:@\"EchoProxyPort\"];\n\t\tif (proxyUserString)\n\t\t\t[proxyStringsDictionary setObject:[proxyUserString nullTerminatedData] forKey:@\"EchoProxyUser\"];\n\t\telse\n\t\t\t[proxyStringsDictionary setObject:[@\"\" nullTerminatedData] forKey:@\"EchoProxyUser\"];\n\n\t\tif (proxyPassString)\n\t\t\t[proxyStringsDictionary setObject:[proxyPassString nullTerminatedData] forKey:@\"EchoProxyPass\"];\n\t\telse\n\t\t\t[proxyStringsDictionary setObject:[@\"\" nullTerminatedData] forKey:@\"EchoProxyPass\"];\n\n\t\tSetLocalProxyInfo((char *) [[proxyStringsDictionary objectForKey:@\"EchoProxyAddr\"] bytes],\n\t\t\t\t\t\t  (char *) [[proxyStringsDictionary objectForKey:@\"EchoProxyPort\"] bytes],\n\t\t\t\t\t\t  (char *) [[proxyStringsDictionary objectForKey:@\"EchoProxyUser\"] bytes],\n\t\t\t\t\t\t  (char *) [[proxyStringsDictionary objectForKey:@\"EchoProxyPass\"] bytes]);\n\t}\n}\n\n- (void) createEchoServerFromDictionary: (NSMutableDictionary *) echoDict\n{\n\tIDllProxyInfo* proxyInfo = (IDllProxyInfo*)CreateProxyInfoClassObject();\n\n\t[echoDict setObject:[[[echoDict objectForKey:@\"IPAddress\"] nullTerminatedData] retain] forKey:@\"IPAddress_cStringData\"];\n\tproxyInfo->SetIP((const char *)[[echoDict objectForKey:@\"IPAddress_cStringData\"] bytes]);\n\n\tif ([echoDict objectForKey:@\"Port\"])\n\t{\n\t\t[echoDict setObject:[[[echoDict objectForKey:@\"Port\"] nullTerminatedData] retain] forKey:@\"Port_cStringData\"];\n\t\tproxyInfo->SetPort((const char *)[[echoDict objectForKey:@\"Port_cStringData\"] bytes]);\n\t}\n\telse\n\t\tproxyInfo->SetPort(\"1328\");\n\n\tif ([echoDict objectForKey:@\"User\"])\n\t{\n\t\t[echoDict setObject:[[[echoDict objectForKey:@\"User\"] nullTerminatedData] retain] forKey:@\"User_cStringData\"];\n\t\tproxyInfo->SetMyID((char *)[[echoDict objectForKey:@\"User_cStringData\"] bytes]);\n\t}\n\tif ([echoDict objectForKey:@\"Pass\"])\n\t{\n\t\t[echoDict setObject:[[[echoDict objectForKey:@\"Pass\"] nullTerminatedData] retain] forKey:@\"Pass_cStringData\"];\n\t\tproxyInfo->SetPassword((const char *)[[echoDict objectForKey:@\"Pass_cStringData\"] bytes]);\n\t}\n\n\t//YS: 21.12.2006 due to remove \"128 bit encryption\" button\n\t//old code: SetEncryptionLevel([useAESCheckbox state], proxyInfo);\n\tSetEncryptionLevel(1, proxyInfo);//nnn\n\n\tCMyDllProxyInfo *pMyProxyInfo = new CMyDllProxyInfo(proxyInfo);\n\tpMyProxyInfo->setStatus(CMyDllProxyInfo::Connecting);\n\n\t[self addInfo: pMyProxyInfo];\n\t[echoTableView displayRect:[echoTableView rectOfRow:[echoInfoProxys count]]];\n\t[echoTableView setNeedsDisplay:YES];\n\t[echoTableView displayIfNeeded];\n}\n\n- (void) loadServerList\n{\n\tNSUserDefaults *uDef = [NSUserDefaults standardUserDefaults];\n\tNSEnumerator *echoEnum = [[uDef objectForKey:@\"EchoServers\"] objectEnumerator];\n\tNSMutableDictionary *anEchoServer = nil;\n\n\t[echoServers release];\n\techoServers = [[NSMutableArray alloc] init];\n\n\twhile (anEchoServer = [[[echoEnum nextObject] mutableCopy] autorelease])\n\t{\n\t\t[echoServers addObject: anEchoServer];\n\t\t[self createEchoServerFromDictionary: anEchoServer];\n\t}\n\t[uDef setObject:echoServers forKey: @\"EchoServers\"];\n}\n\n#include <SystemConfiguration/SCDynamicStoreCopySpecific.h>\n\n-(NSString*) GetComputerName\n{\n\tCFStringRef name = NULL;\n\tNSString *computerName = NULL;\n\tname = SCDynamicStoreCopyComputerName(NULL, NULL);\n\tif (name != NULL)\n\t\tcomputerName = [NSString stringWithString:(NSString*)name];\n\tCFRelease(name);\n\treturn computerName;\n}\n\n- (IBAction)addServer:(id)sender\n{\n//YS: 21.12.2006 due to set by default all edits on add server screen\n{\n\tNSString *server_default = @\"demo.echovnc.com\";\n\tNSString *password_default = @\"demo2007\";\n\tNSString *username_default = [self GetComputerName];\n\tif (username_default == NULL)\n\t\tusername_default = @\"VineServerDemo\";\n\n\t[echoServerField setStringValue: server_default];\n\t[usernameField setStringValue: username_default];\n\t[passwordField setStringValue: password_default];\n}\n\t[NSApp beginSheet:addServerWindow\n\t   modalForWindow:[echoServersView window]\n\t\tmodalDelegate:self\n\t   didEndSelector:NULL\n\t\t  contextInfo:NULL];\n}\n\n- (IBAction)cancelAddServer:(id)sender\n{\n\t[NSApp endSheet:addServerWindow returnCode:NSAlertAlternateReturn];\n\t[addServerWindow orderOut:self];\n}\n\n- (IBAction)completeAddServer:(id)sender\n{\n\tNSMutableDictionary *newEchoServer = [[NSMutableDictionary alloc] init];\n\n\t[addServerWindow makeFirstResponder:[addServerWindow nextResponder]];\n\n\tNSArray *serverAndPort = [[echoServerField stringValue] componentsSeparatedByString:@\":\"];\n\n\tif ([[serverAndPort objectAtIndex:0] length])\n\t{\n\t\t[newEchoServer setObject:[serverAndPort objectAtIndex:0] forKey:@\"IPAddress\"];\n\t\tif ([serverAndPort count] > 1)\n\t\t\t[newEchoServer setObject:[serverAndPort objectAtIndex:1] forKey:@\"Port\"];\n\t\tif ([[usernameField stringValue] length])\n\t\t{\n\t\t\tNSString * tmp = [usernameField stringValue];\n\t\t\ttmp = [tmp stringByAppendingString: @\":vnc\"];\n\t\t\t[newEchoServer setObject:tmp forKey:@\"User\"];\n\t\t}\n\t\tif ([[passwordField stringValue] length])\n\t\t\t[newEchoServer setObject:[passwordField stringValue] forKey:@\"Pass\"];\n\n\t\t[echoServers addObject:newEchoServer];\n\t}\n\n\t[NSApp endSheet:addServerWindow returnCode:NSAlertDefaultReturn];\n\t[addServerWindow orderOut:self];\n\n\t[self createEchoServerFromDictionary: newEchoServer];\n\t[self reloadData];\n\t[self selectRow: [echoServers count] - 1];\n\t[self saveData];\n}\n\n- (IBAction)removeServer:(id)sender\n{\n\tint index = [echoTableView selectedRow];\n\tif (index >= 0)\n\t{\n\t\tCMyDllProxyInfo *pMyProxyInfo = [self getDllProxyInfo: index];\n\t\tif (pMyProxyInfo == NULL)\n\t\t\treturn;\n\t\tif (pMyProxyInfo->getStatus() == CMyDllProxyInfo::Removing)\n\t\t\treturn;\n\n\t\t[self removeRow: index removeProxy: true removeServer: true];\n\t\t[self reloadData];\n\t\tif (index >= [echoServers count])\n\t\t\tindex = [echoServers count] - 1;\n\t\t[self selectRow: index];\n\t\t[self saveData];\n\n\t\tpMyProxyInfo->setStatus(CMyDllProxyInfo::Removing);\n\t\t[echoInfoProxysToRemove addObject: [NSValue valueWithPointer: pMyProxyInfo]];\n\t}\n}\n\n- (IBAction)advancedSettings:(id)sender\n{\n\t[NSApp beginSheet:advancedSettingsWindow\n\t  modalForWindow:[echoServersView window]\n\t   modalDelegate:self\n\t  didEndSelector:NULL\n\t\t contextInfo:NULL];\n}\n\n- (IBAction)cancelAdvancedSettings:(id)sender\n{\n\t[NSApp endSheet:advancedSettingsWindow returnCode:NSAlertAlternateReturn];\n\t[advancedSettingsWindow orderOut:self];\n\t[self loadProxyFields];\n}\n\n- (IBAction)completeAdvancedSettings:(id)sender\n{\n\t[[NSUserDefaults standardUserDefaults] setObject:[proxyAddress stringValue] forKey:@\"EchoProxyAddr\"];\n\t[[NSUserDefaults standardUserDefaults] setInteger:[proxyPort intValue]  forKey:@\"EchoProxyPort\"];\n\n\tif ([proxyAuthenticationCheckbox state])\n\t{\n\t\t[[NSUserDefaults standardUserDefaults] setObject:[proxyUsername stringValue] forKey:@\"EchoProxyUser\"];\n\t\t[[NSUserDefaults standardUserDefaults] setObject:[proxyPassword stringValue] forKey:@\"EchoProxyPass\"];\n\t}\n\telse\n\t{\n\t\t[[NSUserDefaults standardUserDefaults] removeObjectForKey:@\"EchoProxyUser\"];\n\t\t[[NSUserDefaults standardUserDefaults] removeObjectForKey:@\"EchoProxyPass\"];\n\t}\n\n\t[[NSUserDefaults standardUserDefaults] synchronize];\n\t[self loadProxyFields];\n\n\t[NSApp endSheet:advancedSettingsWindow returnCode:NSAlertDefaultReturn];\n\t[advancedSettingsWindow orderOut:self];\n}\n\n- (IBAction)requireProxyAuthentication:(id)sender\n{\n\tBOOL enabled = [proxyAuthenticationCheckbox state];\n\n\t[proxyUsername setEnabled:enabled];\n\t[proxyPassword setEnabled:enabled];\n\t[proxyUsernameLabel setTextColor:(enabled ? [NSColor blackColor] : [NSColor grayColor])];\n\t[proxyPasswordLabel setTextColor:(enabled ? [NSColor blackColor] : [NSColor grayColor])];\n}\n\n- (IBAction)disableEcho:(id)sender\n{\n\tBOOL disabled = [disableEchoCheckbox state];\n\n\t[addButton setEnabled:!disabled];\n\t[advancedSettingsButton setEnabled:!disabled];\n\t[echoTableView setEnabled:!disabled];\n\t[removeButton setEnabled:!disabled];\n\n\t//YS: 21.12.2006 due to remove \"128 bit encryption\" button\n\t//[useAESCheckbox setEnabled:!disabled];\n\n\t[[NSUserDefaults standardUserDefaults] setBool:disabled forKey:@\"EchoDisabled\"];\n\t[[NSUserDefaults standardUserDefaults] synchronize];\n}\n\n- (IBAction)enableLogging:(id)sender\n{\n\tbool enabled = [enableLoggingCheckbox state];\n\n\tEnableLogging(enabled);\n\n\t[[NSUserDefaults standardUserDefaults] setBool: enabled forKey: @\"EnableLogging\"];\n\t[[NSUserDefaults standardUserDefaults] synchronize];\n}\n\n- (IBAction)useEncryption:(id)sender\n{\n\tid proxyEnum = [echoInfoProxys objectEnumerator];\n\tNSValue *aProxyValue = nil;\n\n\twhile (aProxyValue = [proxyEnum nextObject])\n\t{\n\t\t//YS: 21.12.2006 due to remove \"128 bit encryption\" button\n\t\t//old code: SetEncryptionLevel([useAESCheckbox state], [aProxyValue pointerValue]);\n\t\tSetEncryptionLevel(1, [aProxyValue pointerValue]);\n\t}\n\n\t//YS: 21.12.2006 due to remove \"128 bit encryption\" button\n\t//[[NSUserDefaults standardUserDefaults] setBool:[useAESCheckbox state] forKey:@\"EchoAESEncryption\"];\n\t//[[NSUserDefaults standardUserDefaults] synchronize];\n}\n\n- (IBAction)editServer:(id)sender\n{\n\tm_nEditIndex = [echoTableView selectedRow];\n\tif (m_nEditIndex >= 0)\n\t{\n\t\tCMyDllProxyInfo *pMyProxyInfo = [self getDllProxyInfo: m_nEditIndex];\n\t\tif (pMyProxyInfo == NULL)\n\t\t\treturn;\n\t\tIDllProxyInfo *echoProxyInfo = pMyProxyInfo->getDllProxyInfo();\n\t\tif (pMyProxyInfo->getStatus() == CMyDllProxyInfo::Removing\n\t\t || pMyProxyInfo->getStatus() == CMyDllProxyInfo::Connecting\n\t\t || pMyProxyInfo->getStatus() == CMyDllProxyInfo::Reconnecting)\n\t\t \treturn;\n\n\t\tint nLen = strlen(echoProxyInfo->GetMyID());\n\t\tchar* sTmp = new char[nLen + 1];\n\t\tmemset(sTmp, 0, nLen + 1);\n\t\tmemcpy(sTmp, echoProxyInfo->GetMyID(), nLen);\n\t\tchar* p = strstr(sTmp, \":\");\n\t\tif (p != NULL)\n\t\t\t*p = 0;\n\t\tNSString *username = [NSString stringWithCString:sTmp];\n\t\tdelete sTmp;\n\t\tNSString *password =[NSString stringWithCString: echoProxyInfo->GetPassword()];\n\t\tNSString *server = [NSString stringWithCString: echoProxyInfo->GetIpPort()];\n\n\t\t[echoServerField_edit setStringValue: server];\n\t\t[usernameField_edit setStringValue: username];\n\t\t[passwordField_edit setStringValue: password];\n\n\t\t[NSApp beginSheet:editServerWindow\n\t\t\tmodalForWindow:[echoServersView window]\n\t\t\tmodalDelegate:self\n\t\t\tdidEndSelector:NULL\n\t\t\tcontextInfo:NULL];\n\t}\n}\n\n- (IBAction)cancelEditServer:(id)sender\n{\n\t[NSApp endSheet:editServerWindow returnCode:NSAlertAlternateReturn];\n\t[editServerWindow orderOut:self];\n}\n\n- (IBAction)completeEditServer:(id)sender\n{\n\t[editServerWindow makeFirstResponder:[editServerWindow nextResponder]];\n\t[NSApp endSheet:editServerWindow returnCode:NSAlertDefaultReturn];\n\t[editServerWindow orderOut:self];\n\n\tif (m_nEditIndex >= 0)\n\t{\n\t\tCMyDllProxyInfo *pMyProxyInfo = [self getDllProxyInfo: m_nEditIndex];\n\t\tif (pMyProxyInfo == NULL) return;\n\t\tIDllProxyInfo *echoProxyInfo = pMyProxyInfo->getDllProxyInfo();\n\n\t\tNSString *username = [usernameField_edit stringValue];\n\t\tusername = [username stringByAppendingString: @\":vnc\"];\n\t\tNSString *password = [passwordField_edit stringValue];\n\n\t\tint len_username = [username length];\n\t\tint len_password = [password length];\n\t\tchar pUsername[len_username + 1];\n\t\tchar pPassword[len_password + 1];\n\t\tstrncpy(pUsername, [username cString], len_username);\n\t\tstrncpy(pPassword, [password cString], len_password);\n\t\tpUsername[len_username] = 0;\n\t\tpPassword[len_password] = 0;\n\n\t\techoProxyInfo->SetMyID(pUsername);\n\t\techoProxyInfo->SetPassword(pPassword);\n\n\t\tNSMutableDictionary *echoDict = [[[echoServers objectAtIndex: m_nEditIndex] mutableCopy] autorelease];\n\n\t\t[echoDict setObject: username forKey: @\"User\"];\n\t\t[echoDict setObject: password forKey: @\"Pass\"];\n\t\t[echoDict setObject: [[username nullTerminatedData] retain] forKey:@\"User_cStringData\"];\n\t\t[echoDict setObject: [[password nullTerminatedData] retain] forKey:@\"Pass_cStringData\"];\n\n\t\t[echoServers replaceObjectAtIndex: m_nEditIndex withObject: echoDict];\n\n\t\tpMyProxyInfo->setStatus(CMyDllProxyInfo::Reconnecting);\n\t\t[self reloadData];\n\t\t[self selectRow: m_nEditIndex];\n\t\t[self saveData];\n\t}\n}\n\n- (void) reloadData\n{\n\tm_critSection->Lock();\n\t[echoTableView reloadData];\n\tm_critSection->Unlock();\n}\n\n- (void) selectRow: (int)row;\n{\n\tm_critSection->Lock();\n\t[echoTableView selectRow: row byExtendingSelection: false];\n\tm_critSection->Unlock();\n}\n\n- (void) removeRow: (int)row removeProxy: (bool)rmProxy removeServer: (bool)rmServer;\n{\n\tm_critSection->Lock();\n\tif (rmProxy)\n\t\t[echoInfoProxys removeObjectAtIndex: row];\n\tif (rmServer)\n\t\t[echoServers removeObjectAtIndex: row];\n\tm_critSection->Unlock();\n}\n\n- (CMyDllProxyInfo*) getDllProxyInfo: (int)row\n{\n\tCMyDllProxyInfo *res = NULL;\n\tm_critSection->Lock();\n\tif (row >= 0 && row < [echoInfoProxys count])\n\t\tres = (CMyDllProxyInfo*)[[echoInfoProxys objectAtIndex: row] pointerValue];\n\tm_critSection->Unlock();\n\treturn res;\n}\n\n- (void) addInfo: (CMyDllProxyInfo*)info\n{\n\tm_critSection->Lock();\n\t[echoInfoProxys\taddObject: [NSValue valueWithPointer: info]];\n\tm_critSection->Unlock();\n}\n\n- (void) saveData\n{\n\tm_critSection->Lock();\n\n\tNSUserDefaults *suDefaults = [NSUserDefaults standardUserDefaults];\n\t[suDefaults setObject:echoServers forKey:@\"EchoServers\"];\n\t[suDefaults synchronize];\n\n\tm_critSection->Unlock();\n}\n\n- (NSString*) GetColumnValue: (int)row column: (NSString*)col\n{\n\tNSString* res = @\"\";\n\tif (col && row >= 0)\n\t{\n\t\tNSDictionary *echoServer = [echoServers objectAtIndex: row];\n\t\tCMyDllProxyInfo *pMyProxyInfo = (CMyDllProxyInfo *)[[echoInfoProxys objectAtIndex: row] pointerValue];\n\t\tIDllProxyInfo *proxyInfo = pMyProxyInfo->getDllProxyInfo();\n\n\t\tif ([col isEqualToString:@\"echoServer\"])\n\t\t{\n\t\t\tif (proxyInfo->GetName() != nil)\n\t\t\t\tres = [NSString stringWithCString:proxyInfo->GetName() encoding:NSUTF8StringEncoding];\n\t\t\telse\n\t\t\t\tres = @\"<Unknown>\";\n\t\t}\n\t\telse if ([col isEqualToString:@\"IP\"])\n\t\t{\n\t\t\tif ([echoServer objectForKey:@\"Port\"])\n\t\t\t\tres = [NSString stringWithFormat:@\"%@:%@\", [echoServer objectForKey:@\"IPAddress\"], [echoServer objectForKey:@\"Port\"]]\u000b;\n\t\t\telse\n\t\t\t\tres = [NSString stringWithFormat:@\"%@\", [echoServer objectForKey:@\"IPAddress\"]]\u000b;\n\t\t}\n\t\telse if ([col isEqualToString:@\"Status\"])\n\t\t{\n\t\t\tres = [NSString stringWithCString: pMyProxyInfo->getStatusString()];\n\t\t}\n\t\telse if ([col isEqualToString:@\"User\"])\n\t\t{\n\t\t\tint nLen = strlen(proxyInfo->GetMyID());\n\t\t\tchar* sTmp = new char[nLen + 1];\n\t\t\tmemset(sTmp, 0, nLen + 1);\n\t\t\tmemcpy(sTmp, proxyInfo->GetMyID(), nLen);\n\t\t\tchar* p = strstr(sTmp, \":\");\n\t\t\tif (p != NULL)\n\t\t\t\t*p = 0;\n\t\t\tres = [NSString stringWithCString:sTmp encoding:NSUTF8StringEncoding];\n\t\t\tdelete sTmp;\n\t\t}\n\t}\n\treturn res;\n}\n@end\n\n@implementation EchoController (TableDataSource)\n\n- (int)numberOfRowsInTableView:(NSTableView *)tableView\n{\n\treturn [echoServers count];\n}\n\n- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row\n{\n\treturn [self GetColumnValue: row column: [tableColumn identifier]];\n}\n\n@end\n"
  },
  {
    "path": "Bundles/Echoware/EchoSrvDataChannel.cpp",
    "content": "#include \"StdAfx.h\"\n#include \"echosrvdatachannel.h\"\n#include \"localdatachannel.h\"\n#include \"NetPacket.h\"\n#include \"DataChannel.h\"\n\nCEchoSrvDataChannel::CEchoSrvDataChannel(CDataChannel* pDataChannel)\n:CDataChannelSocket(pDataChannel)\n{\n\tm_bOffLoadingDataChannel = false;\n\tResetOffLoadingTimer();\n\tResetRetryTimer();\n\tm_nRetryCounter = 0;\n\tm_fStartRetry = false;\n}\n\nCEchoSrvDataChannel::~CEchoSrvDataChannel(void)\n{\n\tg_globals.m_logger.WriteFormated(\"CEchoSrvDataChannel: send buff=%d, rec buff=%d\", m_pSendBuffer->Size(), m_pRecvBuffer->Size());\n}\n\nbool CEchoSrvDataChannel::Connect(const char* szIP, unsigned int nPort)\n{\n\tif (CDataChannelSocket::Connect(szIP, nPort)==0)\n\t\treturn true;\n\n\treturn g_globals.m_proxiesManager.ConnectViaProxy(this, szIP, nPort);\n}\n\n//connects tis data channel to echoServer and authenticating this connection\nint CEchoSrvDataChannel::Connect(const char* szServer, unsigned int nPort, const char* szChannelCode, const char* szMyID)\n{\n\tif (!Connect(szServer, nPort))\n\t\treturn -1;\n\n\tDWORD dwTemp = ID_STRING_SIZE;\n\tDWORD dwTotalLength = ID_STRING_SIZE;\n\tdwTotalLength += CHANNEL_CODE_SIZE;//(DWORD)strlen(szChannelCode)+1;\n\tchar *pBuff = new char[dwTotalLength];\n\tg_globals.GetFormattedID(pBuff, dwTotalLength, szMyID);\n\tmemcpy(pBuff+dwTemp, szChannelCode, strlen(szChannelCode)+1);\n\n\tSendMessage(MSG_DATA_CHANNEL_CONNECT,pBuff,dwTotalLength);\n\n\tdelete[] pBuff;\n\n\tm_dwOffLoadingTime = GetTickCount();\n\n\treturn 0;\n}\n\n//message composer\nvoid CEchoSrvDataChannel::SendMessage(DWORD message, char *data, unsigned int datalen)\n{\n\tchar*\tlpBuf = NULL;\n\tDWORD\tnBytesSent = 0;\n\n\tCProxyMsg msg(message );\n\n\tNetPacketHeader header;\n\n\theader.len = msg.MakeMessage(&header, lpBuf, data, datalen); //create the message\n\n\tDWORD dwToSend = OSSwapHostToLittleInt32(header.len + sizeof(DWORD));\n\tm_pSendBuffer->Write(&dwToSend, sizeof(DWORD));\n\tm_pSendBuffer->Write(lpBuf, header.len);\n\tSend();\n\n\tif (lpBuf)\n\t\tdelete lpBuf;\n}\n\nvoid CEchoSrvDataChannel::OnReceive(char* buff, int len)\n{\n\tCDataChannelSocket::OnReceive(buff, len);\n\tif (m_bOffLoadingDataChannel)\n\t\tm_pDataChannel->ConnectLocalServer();\n\tm_pPairChannel->Send();\n}\n\nvoid CEchoSrvDataChannel::OnSend(char* buff, int& len)\n{\n\tCDataChannelSocket::OnSend(buff, len);\n\tif (len > 0)\n\t\tg_globals.m_logger.WriteFormated(\"CEchoSrvDataChannel::OnSend sock = %d len = %d\", getSocket(), len);\n}\n\nvoid CEchoSrvDataChannel::OnError(int error)\n{\n\tCDataChannelSocket::OnError(error);\n}\n\nvoid CEchoSrvDataChannel::ResetOffLoadingTimer()\n{\n\tm_dwOffLoadingTime = GetTickCount();\n}\n\nvoid CEchoSrvDataChannel::ResetRetryTimer()\n{\n\tm_dwRetryTime = GetTickCount();\n}\n\nvoid CEchoSrvDataChannel::OnTimer()\n{\n\tAPISocket::CClientSocket::OnTimer();\n\n\tif (m_bOffLoadingDataChannel && GetTickCount() - m_dwOffLoadingTime >= CONNECTION_TO_OFFLOAD_TIMER_VALUE)\n\t{\n\t\tm_pDataChannel->ConnectLocalServer();\n\t\tResetOffLoadingTimer();\n\t}\n\n\tif (m_fStartRetry && m_bOffLoadingDataChannel && GetTickCount() - m_dwRetryTime >= RECONNECTION_TO_OFFLOAD_TIMER_VALUE)\n\t{\n\t\tg_globals.m_logger.WriteFormated(\"CEchoSrvDataChannel::OnTimer Start retrying the localdatachannel\");\n\t\tm_pDataChannel->m_pLocalDataChannel->StartAsync();\n\t\tm_pDataChannel->m_pLocalDataChannel->StartSend();\n\t\tResetRetryTimer();\n\t\tm_nRetryCounter++;\n\t\tm_fStartRetry = false;\n\t\tg_globals.m_logger.WriteFormated(\"CEchoSrvDataChannel::OnTimer End retrying the localdatachannel\");\n\t}\n}\n"
  },
  {
    "path": "Bundles/Echoware/EchoSrvDataChannel.h",
    "content": "#ifndef _ECHOSRVDATACHANNELS_H\n#define _ECHOSRVDATACHANNELS_H\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n#include \"DataChannelSocket.h\"\n\nclass CDataChannel;\n\n//data channel to echoServer\nclass CEchoSrvDataChannel :\n\tpublic CDataChannelSocket\n{\npublic:\n\tCEchoSrvDataChannel(CDataChannel* pDataChannel);\n\tvirtual ~CEchoSrvDataChannel(void);\n\n\t//connect to echoServer\n\tint Connect(const char* szServer, unsigned int nPort, const char* szChannelCode, const char* szMyID);\n\n\t//notification : there are data to read\n\t//[in] len : length of data\n\t//[in] buff: data\n\tvirtual void OnReceive(char* buff, int len);\n\n\t//notification : can send data\n\t//[in] len : length of data\n\t//[in] buff: data\n\tvirtual void OnSend(char* buff, int& len);\n\n\tvirtual void OnError(int error);\n\n\tvirtual void OnTimer();\n\n\tvoid SetOffLoadingDataChannel(bool value) { m_bOffLoadingDataChannel = value; }\n\tvoid ResetOffLoadingTimer();\n\tvoid ResetRetryTimer();\n\tint m_nRetryCounter;\n\tbool m_bOffLoadingDataChannel;\n\tbool m_fStartRetry;\n\nprotected:\n\t//construct message to send to echoServer\n\tvoid SendMessage(DWORD message, char *data, unsigned int datalen);\n\t//connect the socket\n\tbool Connect(const char* szIP, unsigned int nPort);\n\nprotected:\n\n\tDWORD m_dwOffLoadingTime;\n\tDWORD m_dwRetryTime;\n};\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/EchoToOSX.cpp",
    "content": "/*\n *  EchoToOSX.cpp\n *  Echoware\n *\n *  Created by Jonathan on 3/29/06.\n *  Copyright 2006 __MyCompanyName__. All rights reserved.\n *\n */\n\n#include <time.h>\n#include <pthread.h>\n#include <unistd.h>\n\n#include \"EchoToOSX.h\"\n\n\n// Get Relative Time in milliseconds (not to be used for absolute time)\nDWORD GetTickCount()\n{\n\tstruct timeval startTime;\n\tgettimeofday(&startTime, NULL);\n\treturn (DWORD) ((startTime.tv_sec * 1000) + (startTime.tv_usec / 1000));\n}\n\nvoid *CreateThread(int securityFlags,\n\t\t\t\t   int stackSize,\n\t\t\t\t   long unsigned int (*start_routine)(void *),\n\t\t\t\t   void *arg,\n\t\t\t\t   int creationFlags,\n\t\t\t\t   long unsigned int *lpThreadId)\n{\n\tpthread_t newThread;\n\tint threadID = pthread_create(&newThread,\n\t\t\t\t\t\t\t\t  NULL,\n\t\t\t\t\t\t\t\t  (void *(*)(void *))start_routine,\n\t\t\t\t\t\t\t\t  arg);\n\t*lpThreadId = threadID;\n\n\tpthread_detach(newThread);\n\n\treturn newThread;\n}\n\nbool PostThreadMessage(unsigned long , int, void *, int)\n{\n\t// mach_msg, socket comm, shared state?\n}\n\nbool PeekMessage(void *, int,int,int, int)\n{\n\n}\n\nbool ShutdownThread(void *shutdownThread, unsigned long waitTimeout, bool *shouldQuit, bool *hasQuit)\n{\n\tif (shutdownThread)\n\t{\n\t\tif (!(*hasQuit))\n\t\t{\n\t\t\t*shouldQuit = 1;\n\n\t\t\t{\n\t\t\t\tDWORD startTime = GetTickCount();\n\n\t\t\t\twhile (!(*hasQuit) && (GetTickCount() - startTime < waitTimeout))\n\t\t\t\t{\n\t\t\t\t\tSleep(250000);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!(*hasQuit))\n\t\t\t{\n\t\t\t\tif (shutdownThread)\n\t\t\t\t\tpthread_cancel((pthread_t) shutdownThread);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true;\n}\n\n\n"
  },
  {
    "path": "Bundles/Echoware/EchoToOSX.h",
    "content": "/*\n *  EchoToVNC.h\n *  Echoware\n *\n *  Created by Jonathan on 3/3/06.\n *  Copyright 2006 __MyCompanyName__. All rights reserved.\n *\n */\n\n#include <sys/socket.h>\n\n// Some basic redifines\n\n#undef TCP_NODELAY\n#define TCP_NODELAY 0x01\n\n#define INVALID_SOCKET -1\n#define SOCKET_ERROR -1\n#define LPHOSTENT struct hostent *\n#define LPIN_ADDR struct in_addr *\n\n#define WSAEALREADY EALREADY\n#define WSAEINVAL EINVAL\n#define WSAEWOULDBLOCK EAGAIN\n#define WSAEISCONN EISCONN\n#define WSAECONNRESET ECONNRESET\n#define WSAECONNABORTED ECONNABORTED\n#define WSAESHUTDOWN ESHUTDOWN\n#define WSAENOTSOCK ENOTSOCK\n\n#define WSAGetLastError()   errno\n#define closesocket    close\n#define ZeroMemory     bzero\n\n#define Sleep          usleep\n\n// Nothing\n#define FAR\n\n#define UINT unsigned int\n\n#define CHAR        unsigned char\n#ifndef DWORD\n#define DWORD       long unsigned int\n#endif\n#define WORD  \t\tunsigned short\n#define BYTE        unsigned char\n#define INFINITE 2^16\n\n#define BOOL bool\n\n#define\tmin(a,b)    (((a)<(b))?(a):(b))\n\n#define TRUE 1\n#define FALSE 0\n\n#define __stdcall\n#define LPVOID      void *\n\n#ifndef MAKEWORD\n#define MAKEWORD(b1, b2) ((WORD)(((BYTE)(b1)) | ((WORD)((BYTE)(b2))) << 8))\n#endif\n\n#ifndef LOBYTE\n#define LOBYTE(w) ((BYTE)(w))\n#endif\n\n#ifndef HIBYTE\n#define HIBYTE(w) ((BYTE)(((WORD)(w) >> 8) & 0xFF))\n#endif\n\n#define SD_RECEIVE SHUT_RD\n#define SD_SEND    SHUT_WR\n#define SD_BOTH    SHUT_RDWR\n\n#define WM_USER 1024\n\n// Functions which need to be implemented or the callers reworked\nDWORD GetTickCount();\n\n#define WPARAM void *\nvoid *CreateThread(int, int, long unsigned int (*)(void *), void *, int, long unsigned int *);\n\nbool ShutdownThread(void *, unsigned long, bool *, bool *);\n\nbool PostThreadMessage(unsigned long , int, void *, int);\nbool PeekMessage(void *, int,int,int, int);\n\n//#define STILL_ACTIVE 1\n//#define WAIT_TIMEOUT 18\n\n#define HANDLE void **\n\n#ifndef ECHOWARE_API\n#ifdef ECHOWARE_EXPORTS\n#define ECHOWARE_API __attribute__ ((dllexport))\n#else\n//#define ECHOWARE_API __attribute__ ((dllimport))\n#define ECHOWARE_API\n#endif\n#endif\n"
  },
  {
    "path": "Bundles/Echoware/Echoware.cpp",
    "content": "// Echoware.cpp : Defines the entry point for the DLL application.\n//\n\n#include \"stdafx.h\"\n#include \"Echoware.h\"\n#include \"Globals.h\"\n#include \"DllProxyInfo.h\"\n\n//BOOL APIENTRY DllMain( HANDLE hModule,\nBOOL DllMain( HANDLE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved ) {\n//#define DLL_PROCESS_ATTACH 0\n//#define DLL_THREAD_ATTACH  1\n//#define DLL_THREAD_DETACH  2\n//#define\tDLL_PROCESS_DETACH 3\n//\tswitch (ul_reason_for_call)\n//\t{\n//\tcase DLL_PROCESS_ATTACH:\n//\t\tbreak;\n//\tcase DLL_THREAD_ATTACH:\n//\t\tbreak;\n//\tcase DLL_THREAD_DETACH:\n//\t\tbreak;\n//\tcase DLL_PROCESS_DETACH:\n//\t\t/*if (g_globals.GetDllInitialized())\n//\t\t{\n//\t\t\tg_globals.m_logger.Write(\"ReleaseSockets\");\n//\t\t\tg_globals.ReleaseSockets();\n//\t\t}*/\n//\t\tbreak;\n//\t}\n    return TRUE;\n}\n\n#define ECHOWARE_VERSION\t\t\"1.926\"\n\nextern \"C\" ECHOWARE_API char* GetDllVersion()\n{\n\treturn ECHOWARE_VERSION;\n}\n\nextern \"C\" ECHOWARE_API bool InitializeProxyDll()\n{\n\tif (g_globals.GetDllInitialized())\n\t{\n\t\tg_globals.m_logger.Write(\"InitializeProxyDll : already been intialized\");\n\t\treturn true;\n\t}\n\n\tif (!g_globals.InitSockets(1, 1))\n\t{\n\t\tg_globals.SetDllInitialized(false);\n\t\treturn false;\n\t}\n\n\tg_globals.SetDllInitialized(true);\n\n\treturn true;\n}\n\nextern \"C\" ECHOWARE_API void SetLoggingOptions(bool bEnablelogging, char *szLogPath)\n{\n\tg_globals.m_logger.SetLogger(bEnablelogging);\n\tg_globals.m_logger.SetLoggerPath(szLogPath);\n}\n\nextern \"C\" ECHOWARE_API void EnableLogging(bool bEnablelogging)\n{\n\tg_globals.m_logger.SetLogger(bEnablelogging);\n}\n\nextern \"C\" ECHOWARE_API bool SetPortForOffLoadingData(int DataOffLoadingPort)\n{\n\tg_globals.SetPortForOffLoadingData(DataOffLoadingPort);\n\n\tg_globals.m_logger.WriteFormated(\"Data offloading port : %d\", DataOffLoadingPort);\n\n\treturn true;\n}\n\nextern \"C\" ECHOWARE_API void* CreateProxyInfoClassObject()\n{\n\tif (!g_globals.GetDllInitialized())\n\t{\n\t\tg_globals.m_logger.Write(\"CreateProxyInfoClassObject : not been initialized\");\n\t\treturn 0;\n\t}\n\n\tCDllProxyInfo* pProxyInfo=new CDllProxyInfo;\n\tg_globals.m_proxiesManager.AddProxy(pProxyInfo);\n\n\treturn (IDllProxyInfo*)pProxyInfo;\n}\n\nextern \"C\" ECHOWARE_API void DeleteProxyInfoClassObject (void* pProxyInfo)\n{\n\tif (!g_globals.GetDllInitialized())\n\t{\n\t\tg_globals.m_logger.Write(\"DeleteProxyInfoClassObject : not been initialized\");\n\t\treturn;\n\t}\n\n\tg_globals.m_proxiesManager.RemoveProxy((CDllProxyInfo*)pProxyInfo);\n}\n\nextern \"C\" ECHOWARE_API void AutoConnect()\n{\n\tif (!g_globals.GetDllInitialized())\n\t{\n\t\tg_globals.m_logger.Write(\"AutoConnect : not been initialized\");\n\t\treturn ;\n\t}\n\n\tg_globals.m_proxiesManager.AutoConnect();\n}\n\nextern \"C\" ECHOWARE_API int ConnectProxy(void* pProxyInfo)\n{\n\tif (!g_globals.GetDllInitialized())\n\t{\n\t\tg_globals.m_logger.Write(\"ConnectProxy : not been initialized\");\n\t\treturn ERROR_CONNECTING_TO_PROXY;\n\t}\n\n\treturn g_globals.m_proxiesManager.ConnectProxy((CDllProxyInfo*)pProxyInfo);\n}\n\nextern \"C\" ECHOWARE_API bool DisconnectProxy(void* pProxyInfo)\n{\n\tif (!g_globals.GetDllInitialized())\n\t{\n\t\tg_globals.m_logger.Write(\"DisconnectProxy : not been initialized\");\n\t\treturn false;\n\t}\n\n\treturn g_globals.m_proxiesManager.DisconnectProxy((CDllProxyInfo*)pProxyInfo);\n}\n\nextern \"C\" ECHOWARE_API bool DisconnectAllProxies()\n{\n\tif (!g_globals.GetDllInitialized())\n\t{\n\t\tg_globals.m_logger.Write(\"DisconnectAllProxies : not been initialized\");\n\t\treturn false;\n\t}\n\n\treturn g_globals.m_proxiesManager.DisconnectAllProxies();\n}\n\nextern \"C\" ECHOWARE_API void StopConnecting(void* pProxyInfo)\n{\n\tif (!g_globals.GetDllInitialized())\n\t{\n\t\tg_globals.m_logger.Write(\"StopConnecting : not been initialized\");\n\t\treturn;\n\t}\n\n\tg_globals.m_proxiesManager.StopConnecting((CDllProxyInfo*)pProxyInfo);\n}\n\nextern \"C\" ECHOWARE_API int EstablishNewDataChannel(void* pProxyInfo , char* IDOfPartner)\n{\n\tif (!g_globals.GetDllInitialized())\n\t{\n\t\tg_globals.m_logger.Write(\"EstablishNewDataChannel : not been initialized\");\n\t\treturn 0;\n\t}\n\n\treturn g_globals.m_proxiesManager.EstablishNewDataChannel((CDllProxyInfo*)pProxyInfo, IDOfPartner);\n}\n\nextern \"C\" ECHOWARE_API void SetEncryptionLevel(int level, void* pProxyInfo)\n{\n\tif (!g_globals.GetDllInitialized())\n\t{\n\t\tg_globals.m_logger.Write(\"SetEncryptionLevel : not been initialized\");\n\t\treturn;\n\t}\n\n\tg_globals.m_logger.WriteFormated(\"Set Encryption Level to %d for %s\", level, ((CDllProxyInfo*)pProxyInfo)->GetIpPort());\n\n\tg_globals.m_proxiesManager.SetEncryptionLevel(level, (CDllProxyInfo*)pProxyInfo);\n}\n\nextern \"C\" ECHOWARE_API void SetLocalProxyInfo(char* ip, char* port, char* username, char* password)\n{\n\tif (!g_globals.GetDllInitialized())\n\t{\n\t\tg_globals.m_logger.Write(\"SetLocalProxyInfo : not been initialized\");\n\t\treturn;\n\t}\n\n\tg_globals.m_proxiesManager.SetLocalProxyInfo(ip, port, username, password);\n}\n\nextern \"C\" ECHOWARE_API bool CheckServer(char* ip, unsigned short port)\n{\n\tif (!g_globals.GetDllInitialized())\n\t{\n\t\tg_globals.m_logger.Write(\"SetLocalProxyInfo : not been initialized\");\n\t\treturn false;\n\t}\n\n\tAPISocket::CClientSocket sock;\n\tsock.Create();\n\tif (sock.Connect(ip, port)==0)\n\t\treturn true;\n\n\treturn g_globals.m_proxiesManager.ConnectViaProxy(&sock, ip, port);\n\n\treturn false;\n}"
  },
  {
    "path": "Bundles/Echoware/Echoware.dsp",
    "content": "# Microsoft Developer Studio Project File - Name=\"Echoware\" - Package Owner=<4>\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\n# ** DO NOT EDIT **\n\n# TARGTYPE \"Win32 (x86) Dynamic-Link Library\" 0x0102\n\nCFG=Echoware - Win32 Debug\n!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n!MESSAGE use the Export Makefile command and run\n!MESSAGE\n!MESSAGE NMAKE /f \"Echoware.mak\".\n!MESSAGE\n!MESSAGE You can specify a configuration when running NMAKE\n!MESSAGE by defining the macro CFG on the command line. For example:\n!MESSAGE\n!MESSAGE NMAKE /f \"Echoware.mak\" CFG=\"Echoware - Win32 Debug\"\n!MESSAGE\n!MESSAGE Possible choices for configuration are:\n!MESSAGE\n!MESSAGE \"Echoware - Win32 Release\" (based on \"Win32 (x86) Dynamic-Link Library\")\n!MESSAGE \"Echoware - Win32 Debug\" (based on \"Win32 (x86) Dynamic-Link Library\")\n!MESSAGE\n\n# Begin Project\n# PROP AllowPerConfigDependencies 0\n# PROP Scc_ProjName \"\"\n# PROP Scc_LocalPath \"\"\nCPP=cl.exe\nMTL=midl.exe\nRSC=rc.exe\n\n!IF  \"$(CFG)\" == \"Echoware - Win32 Release\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 0\n# PROP BASE Output_Dir \"Echoware___Win32_Release\"\n# PROP BASE Intermediate_Dir \"Echoware___Win32_Release\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 0\n# PROP Output_Dir \"Release6\"\n# PROP Intermediate_Dir \"Release6\"\n# PROP Ignore_Export_Lib 0\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /D \"_MBCS\" /D \"_USRDLL\" /D \"ECHOWARE_EXPORTS\" /YX /FD /c\n# ADD CPP /nologo /MT /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /D \"_MBCS\" /D \"_USRDLL\" /D \"ECHOWARE_EXPORTS\" /YX /FD /c\n# ADD BASE MTL /nologo /D \"NDEBUG\" /mktyplib203 /win32\n# ADD MTL /nologo /D \"NDEBUG\" /mktyplib203 /win32\n# ADD BASE RSC /l 0x409 /d \"NDEBUG\"\n# ADD RSC /l 0x409 /d \"NDEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLINK32=link.exe\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386\n# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /dll /machine:I386 /nodefaultlib:\"MSVCRT.lib\" /nodefaultlib:\"LIBC.lib\"\n\n!ELSEIF  \"$(CFG)\" == \"Echoware - Win32 Debug\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 1\n# PROP BASE Output_Dir \"Echoware___Win32_Debug0\"\n# PROP BASE Intermediate_Dir \"Echoware___Win32_Debug0\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 1\n# PROP Output_Dir \"Debug6\"\n# PROP Intermediate_Dir \"Debug6\"\n# PROP Ignore_Export_Lib 0\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /D \"_MBCS\" /D \"_USRDLL\" /D \"ECHOWARE_EXPORTS\" /YX /FD /GZ  /c\n# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /D \"_MBCS\" /D \"_USRDLL\" /D \"ECHOWARE_EXPORTS\" /YX /FD /GZ  /c\n# ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32\n# ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32\n# ADD BASE RSC /l 0x409 /d \"_DEBUG\"\n# ADD RSC /l 0x409 /d \"_DEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLINK32=link.exe\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept\n# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /dll /debug /machine:I386 /nodefaultlib:\"MSVCRTD.lib\" /nodefaultlib:\"LIBCD.lib\" /pdbtype:sept\n\n!ENDIF\n\n# Begin Target\n\n# Name \"Echoware - Win32 Release\"\n# Name \"Echoware - Win32 Debug\"\n# Begin Group \"Source Files\"\n\n# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat\"\n# Begin Source File\n\nSOURCE=.\\ACConnection.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\AES.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\blowfish.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\CritSection.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\DataChannel.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\DataChannels.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\DataChannelSocket.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\DllProxyInfo.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\EchoSrvDataChannel.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Echoware.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Globals.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\LocalDataChannel.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\LocalListener.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Logger.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\ProxiesManager.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\ProxyConnection.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\RSAKeys.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\stdafx.cpp\n# End Source File\n# End Group\n# Begin Group \"Header Files\"\n\n# PROP Default_Filter \"h;hpp;hxx;hm;inl\"\n# Begin Source File\n\nSOURCE=.\\ACConnection.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\AES.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\blowfish.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\CritSection.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\DataChannel.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\DataChannels.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\DataChannelSocket.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\DllProxyInfo.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\EchoSrvDataChannel.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Echoware.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Globals.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\InterfaceDllProxyInfo.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\LocalDataChannel.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\LocalListener.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Logger.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\NetPacket.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\ProxiesManager.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\ProxyConnection.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\RSAKeys.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\stdafx.h\n# End Source File\n# End Group\n# Begin Group \"Resource Files\"\n\n# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe\"\n# End Group\n# Begin Group \"APISocket\"\n\n# PROP Default_Filter \"\"\n# Begin Source File\n\nSOURCE=.\\APISocket\\APISocket.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\APISocket\\ClientSocket.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\APISocket\\ServerSocket.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\APISocket\\Socket.cpp\n# End Source File\n# End Group\n# End Target\n# End Project\n"
  },
  {
    "path": "Bundles/Echoware/Echoware.dsw",
    "content": "Microsoft Developer Studio Workspace File, Format Version 6.00\n# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\n\n###############################################################################\n\nProject: \"Echoware\"=.\\Echoware.dsp - Package Owner=<4>\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<4>\n{{{\n    Begin Project Dependency\n    Project_Dep_Name LibeaySt\n    End Project Dependency\n    Begin Project Dependency\n    Project_Dep_Name ProxyConnect\n    End Project Dependency\n    Begin Project Dependency\n    Project_Dep_Name RSA\n    End Project Dependency\n}}}\n\n###############################################################################\n\nProject: \"LibeaySt\"=.\\OpenSSL\\LibeaySt.dsp - Package Owner=<4>\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<4>\n{{{\n}}}\n\n###############################################################################\n\nProject: \"ProxyConnect\"=.\\ProxyConnect\\ProxyConnect.dsp - Package Owner=<4>\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<4>\n{{{\n}}}\n\n###############################################################################\n\nProject: \"RSA\"=.\\RSA\\RSA.dsp - Package Owner=<4>\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<4>\n{{{\n}}}\n\n###############################################################################\n\nGlobal:\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<3>\n{{{\n}}}\n\n###############################################################################\n\n"
  },
  {
    "path": "Bundles/Echoware/Echoware.h",
    "content": "#if !defined(_ECHOWARE_H)\n#define _ECHOWARE_H\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\nextern \"C\" char* GetDllVersion();\nextern \"C\" bool InitializeProxyDll();\nextern \"C\" void SetLoggingOptions(bool bEnablelogging, char *szLogPath);\nextern \"C\" void EnableLogging(bool bEnablelogging);\nextern \"C\" bool SetPortForOffLoadingData(int DataOffLoadingPort);\nextern \"C\" void* CreateProxyInfoClassObject();\nextern \"C\" void DeleteProxyInfoClassObject (void* pProxyInfo);\n\nextern \"C\" void AutoConnect();\nextern \"C\" int ConnectProxy(void* pProxyInfo);\nextern \"C\" bool DisconnectProxy(void* pProxyInfo);\nextern \"C\" bool DisconnectAllProxies();\nextern \"C\" void StopConnecting(void* pProxyInfo);\n\nextern \"C\" void SetEncryptionLevel(int level, void* pProxyInfo);\nextern \"C\" void SetLocalProxyInfo(char* ip, char* port, char* username, char* password);\nextern \"C\" bool CheckServer(char* ip, unsigned short port);\n\n#ifndef ECHOWARE_API\n#ifdef ECHOWARE_EXPORTS\n#define ECHOWARE_API __declspec(dllexport)\n#else\n#define ECHOWARE_API __declspec(dllimport)\n#endif\n#endif\n\n\n\n#endif\n\n\n"
  },
  {
    "path": "Bundles/Echoware/Echoware.sln",
    "content": "Microsoft Visual Studio Solution File, Format Version 7.00\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"Echoware\", \"Echoware.vcproj\", \"{1CC002F1-843A-4B82-ADD1-A045B93A2DBA}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"LibeaySt\", \"OpenSSL\\LibeaySt.vcproj\", \"{5CDA6CEE-1D30-4C05-ACCA-327274FFC553}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"RSA\", \"RSA\\RSA.vcproj\", \"{3FEAADB2-4A97-473B-8839-4E97C0CD4F4B}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"ProxyConnect\", \"ProxyConnect\\ProxyConnect.vcproj\", \"{CCEA3A1B-1170-4302-85A8-E4B441552105}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfiguration) = preSolution\n\t\tConfigName.0 = Debug\n\t\tConfigName.1 = Release\n\tEndGlobalSection\n\tGlobalSection(ProjectDependencies) = postSolution\n\t\t{1CC002F1-843A-4B82-ADD1-A045B93A2DBA}.0 = {5CDA6CEE-1D30-4C05-ACCA-327274FFC553}\n\t\t{1CC002F1-843A-4B82-ADD1-A045B93A2DBA}.1 = {CCEA3A1B-1170-4302-85A8-E4B441552105}\n\t\t{1CC002F1-843A-4B82-ADD1-A045B93A2DBA}.2 = {3FEAADB2-4A97-473B-8839-4E97C0CD4F4B}\n\tEndGlobalSection\n\tGlobalSection(ProjectConfiguration) = postSolution\n\t\t{1CC002F1-843A-4B82-ADD1-A045B93A2DBA}.Debug.ActiveCfg = Debug|Win32\n\t\t{1CC002F1-843A-4B82-ADD1-A045B93A2DBA}.Debug.Build.0 = Debug|Win32\n\t\t{1CC002F1-843A-4B82-ADD1-A045B93A2DBA}.Release.ActiveCfg = Release|Win32\n\t\t{1CC002F1-843A-4B82-ADD1-A045B93A2DBA}.Release.Build.0 = Release|Win32\n\t\t{5CDA6CEE-1D30-4C05-ACCA-327274FFC553}.Debug.ActiveCfg = Debug|Win32\n\t\t{5CDA6CEE-1D30-4C05-ACCA-327274FFC553}.Debug.Build.0 = Debug|Win32\n\t\t{5CDA6CEE-1D30-4C05-ACCA-327274FFC553}.Release.ActiveCfg = Release|Win32\n\t\t{5CDA6CEE-1D30-4C05-ACCA-327274FFC553}.Release.Build.0 = Release|Win32\n\t\t{3FEAADB2-4A97-473B-8839-4E97C0CD4F4B}.Debug.ActiveCfg = Debug|Win32\n\t\t{3FEAADB2-4A97-473B-8839-4E97C0CD4F4B}.Debug.Build.0 = Debug|Win32\n\t\t{3FEAADB2-4A97-473B-8839-4E97C0CD4F4B}.Release.ActiveCfg = Release|Win32\n\t\t{3FEAADB2-4A97-473B-8839-4E97C0CD4F4B}.Release.Build.0 = Release|Win32\n\t\t{CCEA3A1B-1170-4302-85A8-E4B441552105}.Debug.ActiveCfg = Debug|Win32\n\t\t{CCEA3A1B-1170-4302-85A8-E4B441552105}.Debug.Build.0 = Debug|Win32\n\t\t{CCEA3A1B-1170-4302-85A8-E4B441552105}.Release.ActiveCfg = Release|Win32\n\t\t{CCEA3A1B-1170-4302-85A8-E4B441552105}.Release.Build.0 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityAddIns) = postSolution\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "Bundles/Echoware/Echoware.vcproj",
    "content": "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"7.00\"\n\tName=\"Echoware\"\n\tProjectGUID=\"{1CC002F1-843A-4B82-ADD1-A045B93A2DBA}\"\n\tKeyword=\"Win32Proj\">\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"/>\n\t</Platforms>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|Win32\"\n\t\t\tOutputDirectory=\"Debug\"\n\t\t\tIntermediateDirectory=\"Debug\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"2\">\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_WINDOWS;_USRDLL;ECHOWARE_EXPORTS\"\n\t\t\t\tMinimalRebuild=\"TRUE\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"1\"\n\t\t\t\tUsePrecompiledHeader=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"TRUE\"\n\t\t\t\tDebugInformationFormat=\"4\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalOptions=\"/FORCE:MULTIPLE \"\n\t\t\t\tAdditionalDependencies=\"Ws2_32.lib $(OutDir)/rsa.lib $(OutDir)/ProxyConnect.lib\"\n\t\t\t\tOutputFile=\"$(OutDir)/Echoware.dll\"\n\t\t\t\tLinkIncremental=\"2\"\n\t\t\t\tIgnoreDefaultLibraryNames=\"MSVCRTD.lib;LIBCD.lib\"\n\t\t\t\tGenerateDebugInformation=\"TRUE\"\n\t\t\t\tProgramDatabaseFile=\"$(OutDir)/Echoware.pdb\"\n\t\t\t\tSubSystem=\"2\"\n\t\t\t\tImportLibrary=\"$(OutDir)/Echoware.lib\"\n\t\t\t\tTargetMachine=\"1\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|Win32\"\n\t\t\tOutputDirectory=\"Release\"\n\t\t\tIntermediateDirectory=\"Release\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"2\">\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"2\"\n\t\t\t\tInlineFunctionExpansion=\"1\"\n\t\t\t\tOmitFramePointers=\"TRUE\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_WINDOWS;_USRDLL;ECHOWARE_EXPORTS\"\n\t\t\t\tStringPooling=\"TRUE\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tEnableFunctionLevelLinking=\"TRUE\"\n\t\t\t\tUsePrecompiledHeader=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"TRUE\"\n\t\t\t\tDebugInformationFormat=\"3\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalOptions=\"/FORCE:MULTIPLE \"\n\t\t\t\tAdditionalDependencies=\"Ws2_32.lib $(OutDir)/rsa.lib $(OutDir)/LibeaySt.lib $(OutDir)/ProxyConnect.lib\"\n\t\t\t\tOutputFile=\"$(OutDir)/Echoware.dll\"\n\t\t\t\tLinkIncremental=\"1\"\n\t\t\t\tIgnoreDefaultLibraryNames=\"MSVCRT.lib;LIBC.lib\"\n\t\t\t\tGenerateDebugInformation=\"TRUE\"\n\t\t\t\tSubSystem=\"2\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tImportLibrary=\"$(OutDir)/Echoware.lib\"\n\t\t\t\tTargetMachine=\"1\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"/>\n\t\t</Configuration>\n\t</Configurations>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"Source Files\"\n\t\t\tFilter=\"cpp;c;cxx;def;odl;idl;hpj;bat;asm\">\n\t\t\t<File\n\t\t\t\tRelativePath=\"ACConnection.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"AES.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"CritSection.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"DataChannel.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"DataChannelSocket.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"DataChannels.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"DllProxyInfo.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"EchoSrvDataChannel.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Echoware.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Globals.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"LocalDataChannel.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"LocalListener.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Logger.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"ProxiesManager.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"ProxyConnection.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"RSAKeys.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"blowfish.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"stdafx.cpp\">\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Debug|Win32\">\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tUsePrecompiledHeader=\"1\"/>\n\t\t\t\t</FileConfiguration>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Release|Win32\">\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tUsePrecompiledHeader=\"1\"/>\n\t\t\t\t</FileConfiguration>\n\t\t\t</File>\n\t\t\t<Filter\n\t\t\t\tName=\"APISocket\"\n\t\t\t\tFilter=\"\">\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"APISocket\\ClientSocket.cpp\">\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"APISocket\\ServerSocket.cpp\">\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"APISocket\\Socket.cpp\">\n\t\t\t\t</File>\n\t\t\t</Filter>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Header Files\"\n\t\t\tFilter=\"h;hpp;hxx;hm;inl;inc\">\n\t\t\t<File\n\t\t\t\tRelativePath=\"ACConnection.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"AES.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"CritSection.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"DataChannel.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"DataChannelSocket.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"DataChannels.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"DllProxyInfo.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"EchoSrvDataChannel.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Echoware.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Globals.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"InterfaceDllProxyInfo.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"LocalDataChannel.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"LocalListener.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Logger.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"NetPacket.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"ProxiesManager.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"ProxyConnection.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"RSAKeys.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"blowfish.H\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"stdafx.h\">\n\t\t\t</File>\n\t\t\t<Filter\n\t\t\t\tName=\"APISocket\"\n\t\t\t\tFilter=\"\">\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"APISocket\\APISocket.h\">\n\t\t\t\t</File>\n\t\t\t</Filter>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Resource Files\"\n\t\t\tFilter=\"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe\">\n\t\t</Filter>\n\t\t<File\n\t\t\tRelativePath=\"ReadMe.txt\">\n\t\t</File>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "Bundles/Echoware/Echoware.xcodeproj/admin.mode1",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>ActivePerspectiveName</key>\n\t<string>Project</string>\n\t<key>AllowedModules</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>BundleLoadPath</key>\n\t\t\t<string></string>\n\t\t\t<key>MaxInstances</key>\n\t\t\t<string>n</string>\n\t\t\t<key>Module</key>\n\t\t\t<string>PBXSmartGroupTreeModule</string>\n\t\t\t<key>Name</key>\n\t\t\t<string>Groups and Files Outline View</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>BundleLoadPath</key>\n\t\t\t<string></string>\n\t\t\t<key>MaxInstances</key>\n\t\t\t<string>n</string>\n\t\t\t<key>Module</key>\n\t\t\t<string>PBXNavigatorGroup</string>\n\t\t\t<key>Name</key>\n\t\t\t<string>Editor</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>BundleLoadPath</key>\n\t\t\t<string></string>\n\t\t\t<key>MaxInstances</key>\n\t\t\t<string>n</string>\n\t\t\t<key>Module</key>\n\t\t\t<string>XCTaskListModule</string>\n\t\t\t<key>Name</key>\n\t\t\t<string>Task List</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>BundleLoadPath</key>\n\t\t\t<string></string>\n\t\t\t<key>MaxInstances</key>\n\t\t\t<string>n</string>\n\t\t\t<key>Module</key>\n\t\t\t<string>XCDetailModule</string>\n\t\t\t<key>Name</key>\n\t\t\t<string>File and Smart Group Detail Viewer</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>BundleLoadPath</key>\n\t\t\t<string></string>\n\t\t\t<key>MaxInstances</key>\n\t\t\t<string>1</string>\n\t\t\t<key>Module</key>\n\t\t\t<string>PBXBuildResultsModule</string>\n\t\t\t<key>Name</key>\n\t\t\t<string>Detailed Build Results Viewer</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>BundleLoadPath</key>\n\t\t\t<string></string>\n\t\t\t<key>MaxInstances</key>\n\t\t\t<string>1</string>\n\t\t\t<key>Module</key>\n\t\t\t<string>PBXProjectFindModule</string>\n\t\t\t<key>Name</key>\n\t\t\t<string>Project Batch Find Tool</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>BundleLoadPath</key>\n\t\t\t<string></string>\n\t\t\t<key>MaxInstances</key>\n\t\t\t<string>n</string>\n\t\t\t<key>Module</key>\n\t\t\t<string>PBXRunSessionModule</string>\n\t\t\t<key>Name</key>\n\t\t\t<string>Run Log</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>BundleLoadPath</key>\n\t\t\t<string></string>\n\t\t\t<key>MaxInstances</key>\n\t\t\t<string>n</string>\n\t\t\t<key>Module</key>\n\t\t\t<string>PBXBookmarksModule</string>\n\t\t\t<key>Name</key>\n\t\t\t<string>Bookmarks Tool</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>BundleLoadPath</key>\n\t\t\t<string></string>\n\t\t\t<key>MaxInstances</key>\n\t\t\t<string>n</string>\n\t\t\t<key>Module</key>\n\t\t\t<string>PBXClassBrowserModule</string>\n\t\t\t<key>Name</key>\n\t\t\t<string>Class Browser</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>BundleLoadPath</key>\n\t\t\t<string></string>\n\t\t\t<key>MaxInstances</key>\n\t\t\t<string>n</string>\n\t\t\t<key>Module</key>\n\t\t\t<string>PBXCVSModule</string>\n\t\t\t<key>Name</key>\n\t\t\t<string>Source Code Control Tool</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>BundleLoadPath</key>\n\t\t\t<string></string>\n\t\t\t<key>MaxInstances</key>\n\t\t\t<string>n</string>\n\t\t\t<key>Module</key>\n\t\t\t<string>PBXDebugBreakpointsModule</string>\n\t\t\t<key>Name</key>\n\t\t\t<string>Debug Breakpoints Tool</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>BundleLoadPath</key>\n\t\t\t<string></string>\n\t\t\t<key>MaxInstances</key>\n\t\t\t<string>n</string>\n\t\t\t<key>Module</key>\n\t\t\t<string>XCDockableInspector</string>\n\t\t\t<key>Name</key>\n\t\t\t<string>Inspector</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>BundleLoadPath</key>\n\t\t\t<string></string>\n\t\t\t<key>MaxInstances</key>\n\t\t\t<string>n</string>\n\t\t\t<key>Module</key>\n\t\t\t<string>PBXOpenQuicklyModule</string>\n\t\t\t<key>Name</key>\n\t\t\t<string>Open Quickly Tool</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>BundleLoadPath</key>\n\t\t\t<string></string>\n\t\t\t<key>MaxInstances</key>\n\t\t\t<string>1</string>\n\t\t\t<key>Module</key>\n\t\t\t<string>PBXDebugSessionModule</string>\n\t\t\t<key>Name</key>\n\t\t\t<string>Debugger</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>BundleLoadPath</key>\n\t\t\t<string></string>\n\t\t\t<key>MaxInstances</key>\n\t\t\t<string>1</string>\n\t\t\t<key>Module</key>\n\t\t\t<string>PBXDebugCLIModule</string>\n\t\t\t<key>Name</key>\n\t\t\t<string>Debug Console</string>\n\t\t</dict>\n\t</array>\n\t<key>Description</key>\n\t<string>DefaultDescriptionKey</string>\n\t<key>DockingSystemVisible</key>\n\t<false/>\n\t<key>Extension</key>\n\t<string>mode1</string>\n\t<key>FavBarConfig</key>\n\t<dict>\n\t\t<key>PBXProjectModuleGUID</key>\n\t\t<string>84DAA48B0B132F2800222618</string>\n\t\t<key>XCBarModuleItemNames</key>\n\t\t<dict/>\n\t\t<key>XCBarModuleItems</key>\n\t\t<array/>\n\t</dict>\n\t<key>FirstTimeWindowDisplayed</key>\n\t<false/>\n\t<key>Identifier</key>\n\t<string>com.apple.perspectives.project.mode1</string>\n\t<key>MajorVersion</key>\n\t<integer>31</integer>\n\t<key>MinorVersion</key>\n\t<integer>1</integer>\n\t<key>Name</key>\n\t<string>Default</string>\n\t<key>Notifications</key>\n\t<array/>\n\t<key>OpenEditors</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>Content</key>\n\t\t\t<dict>\n\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t<string>849C677DC5B0469200F11330</string>\n\t\t\t\t<key>PBXProjectModuleLabel</key>\n\t\t\t\t<string>EchoController.m</string>\n\t\t\t\t<key>PBXSplitModuleInNavigatorKey</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Split0</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t\t\t<string>849C6784C5B0469200F11330</string>\n\t\t\t\t\t\t<key>PBXProjectModuleLabel</key>\n\t\t\t\t\t\t<string>EchoController.m</string>\n\t\t\t\t\t\t<key>_historyCapacity</key>\n\t\t\t\t\t\t<integer>0</integer>\n\t\t\t\t\t\t<key>bookmark</key>\n\t\t\t\t\t\t<string>8487D8B40C6B3851006BDD7C</string>\n\t\t\t\t\t\t<key>history</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<string>849C6785C5B0469200F11330</string>\n\t\t\t\t\t\t\t<string>8487D8A90C6B37E3006BDD7C</string>\n\t\t\t\t\t\t\t<string>8487D8AA0C6B37E3006BDD7C</string>\n\t\t\t\t\t\t\t<string>8487D8910C6B307D006BDD7C</string>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t\t<key>prevStack</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<string>849C6787C5B0469200F11330</string>\n\t\t\t\t\t\t\t<string>849C6788C5B0469200F11330</string>\n\t\t\t\t\t\t\t<string>8487D8AB0C6B37E3006BDD7C</string>\n\t\t\t\t\t\t\t<string>8487D8AC0C6B37E3006BDD7C</string>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>SplitCount</key>\n\t\t\t\t\t<string>1</string>\n\t\t\t\t</dict>\n\t\t\t\t<key>StatusBarVisibility</key>\n\t\t\t\t<true/>\n\t\t\t</dict>\n\t\t\t<key>Geometry</key>\n\t\t\t<dict>\n\t\t\t\t<key>Frame</key>\n\t\t\t\t<string>{{0, 20}, {750, 461}}</string>\n\t\t\t\t<key>PBXModuleWindowStatusBarHidden2</key>\n\t\t\t\t<false/>\n\t\t\t\t<key>RubberWindowFrame</key>\n\t\t\t\t<string>259 175 750 502 0 0 1024 746 </string>\n\t\t\t</dict>\n\t\t</dict>\n\t</array>\n\t<key>PerspectiveWidths</key>\n\t<array>\n\t\t<integer>-1</integer>\n\t\t<integer>-1</integer>\n\t</array>\n\t<key>Perspectives</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>ChosenToolbarItems</key>\n\t\t\t<array>\n\t\t\t\t<string>active-target-popup</string>\n\t\t\t\t<string>active-buildstyle-popup</string>\n\t\t\t\t<string>action</string>\n\t\t\t\t<string>NSToolbarFlexibleSpaceItem</string>\n\t\t\t\t<string>buildOrClean</string>\n\t\t\t\t<string>build-and-runOrDebug</string>\n\t\t\t\t<string>com.apple.ide.PBXToolbarStopButton</string>\n\t\t\t\t<string>get-info</string>\n\t\t\t\t<string>toggle-editor</string>\n\t\t\t\t<string>NSToolbarFlexibleSpaceItem</string>\n\t\t\t\t<string>com.apple.pbx.toolbar.searchfield</string>\n\t\t\t</array>\n\t\t\t<key>ControllerClassBaseName</key>\n\t\t\t<string></string>\n\t\t\t<key>IconName</key>\n\t\t\t<string>WindowOfProjectWithEditor</string>\n\t\t\t<key>Identifier</key>\n\t\t\t<string>perspective.project</string>\n\t\t\t<key>IsVertical</key>\n\t\t\t<false/>\n\t\t\t<key>Layout</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>ContentConfiguration</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>PBXBottomSmartGroupGIDs</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<string>1C37FBAC04509CD000000102</string>\n\t\t\t\t\t\t\t<string>1C37FAAC04509CD000000102</string>\n\t\t\t\t\t\t\t<string>1C08E77C0454961000C914BD</string>\n\t\t\t\t\t\t\t<string>1C37FABC05509CD000000102</string>\n\t\t\t\t\t\t\t<string>1C37FABC05539CD112110102</string>\n\t\t\t\t\t\t\t<string>E2644B35053B69B200211256</string>\n\t\t\t\t\t\t\t<string>1C37FABC04509CD000100104</string>\n\t\t\t\t\t\t\t<string>1CC0EA4004350EF90044410B</string>\n\t\t\t\t\t\t\t<string>1CC0EA4004350EF90041110B</string>\n\t\t\t\t\t\t\t<string>1C77FABC04509CD000000102</string>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t\t\t<string>1CE0B1FE06471DED0097A5F4</string>\n\t\t\t\t\t\t<key>PBXProjectModuleLabel</key>\n\t\t\t\t\t\t<string>Files</string>\n\t\t\t\t\t\t<key>PBXProjectStructureProvided</key>\n\t\t\t\t\t\t<string>yes</string>\n\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleColumnData</key>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>\n\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t<real>217</real>\n\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>\n\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t<string>MainColumn</string>\n\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>\n\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t<string>089C166AFE841209C02AAC07</string>\n\t\t\t\t\t\t\t\t<string>8400B9DE0B60F36E00FB16B3</string>\n\t\t\t\t\t\t\t\t<string>19C28FB8FE9D52D311CA2CBB</string>\n\t\t\t\t\t\t\t\t<string>1CC0EA4004350EF90041110B</string>\n\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>\n\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t\t<integer>27</integer>\n\t\t\t\t\t\t\t\t\t<integer>1</integer>\n\t\t\t\t\t\t\t\t\t<integer>0</integer>\n\t\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>\n\t\t\t\t\t\t\t<string>{{0, 190}, {217, 589}}</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<key>PBXTopSmartGroupGIDs</key>\n\t\t\t\t\t\t<array/>\n\t\t\t\t\t\t<key>XCIncludePerspectivesSwitch</key>\n\t\t\t\t\t\t<true/>\n\t\t\t\t\t\t<key>XCSharingToken</key>\n\t\t\t\t\t\t<string>com.apple.Xcode.GFSharingToken</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>GeometryConfiguration</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>Frame</key>\n\t\t\t\t\t\t<string>{{0, 0}, {234, 607}}</string>\n\t\t\t\t\t\t<key>GroupTreeTableConfiguration</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<string>MainColumn</string>\n\t\t\t\t\t\t\t<real>217</real>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t\t<key>RubberWindowFrame</key>\n\t\t\t\t\t\t<string>7 98 1024 648 0 0 1024 746 </string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>Module</key>\n\t\t\t\t\t<string>PBXSmartGroupTreeModule</string>\n\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t<string>234pt</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Dock</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>BecomeActive</key>\n\t\t\t\t\t\t\t<true/>\n\t\t\t\t\t\t\t<key>ContentConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t\t\t\t\t<string>1CE0B20306471E060097A5F4</string>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleLabel</key>\n\t\t\t\t\t\t\t\t<string>EchoController.m</string>\n\t\t\t\t\t\t\t\t<key>PBXSplitModuleInNavigatorKey</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Split0</key>\n\t\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t\t\t\t\t\t\t<string>1CE0B20406471E060097A5F4</string>\n\t\t\t\t\t\t\t\t\t\t<key>PBXProjectModuleLabel</key>\n\t\t\t\t\t\t\t\t\t\t<string>EchoController.m</string>\n\t\t\t\t\t\t\t\t\t\t<key>_historyCapacity</key>\n\t\t\t\t\t\t\t\t\t\t<integer>0</integer>\n\t\t\t\t\t\t\t\t\t\t<key>bookmark</key>\n\t\t\t\t\t\t\t\t\t\t<string>8487D8B30C6B3851006BDD7C</string>\n\t\t\t\t\t\t\t\t\t\t<key>history</key>\n\t\t\t\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E4D00B4C1D20006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E4D20B4C1D20006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E5290B4C22C7006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E7040B4D0EC2006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E7060B4D0EC2006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E7080B4D0EC2006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E70A0B4D0EC2006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E70C0B4D0EC2006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E71A0B4D0EC2006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E71C0B4D0EC2006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E86F0B4E88C3006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E8700B4E88C3006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E8710B4E88C3006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E8720B4E88C3006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E8730B4E88C3006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E8740B4E88C3006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E8750B4E88C3006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E8770B4E88C3006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E9090B4E956F006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D9EE770B53EC5D00C10970</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D60AB30B5BB8EF00D9EBCB</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D60AB40B5BB8EF00D9EBCB</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D4FE540B5D2A960058AE41</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84DFC6550B64D26200858CAB</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>848C41450B84919C00BD11B3</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>848C416E0B84946E00BD11B3</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>848C424C0B84C97700BD11B3</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84AFF17D0B8C87E400D93058</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84AFF17F0B8C87E400D93058</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84AFF1B20B8C89CC00D93058</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84B1AF9F0B94350200D477E7</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC71A90B959EDF00BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC71AA0B959EDF00BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC71AB0B959EDF00BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC71AD0B959EDF00BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC71AE0B959EDF00BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC71B00B959EDF00BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC721F0B95BC1100BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC730F0B95D09000BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC73980B95F0D000BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC74FA0B9604DE00BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC75800B9610B400BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84B0A8140B96D8B400B60726</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84B0A9360B9707B000B60726</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84B0AB400B973C9E00B60726</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8428A4450B984D8900F257E1</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84AF08E40B98819600B348CB</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84AF08E60B98819600B348CB</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BE444E0B9D67F2007EF582</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BE44970B9D6EE7007EF582</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84239D390BB2A1BA00C28522</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84239D3C0BB2A1BA00C28522</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84DDE9750BB90B6B0074B26A</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BF70560BC3D30900AB75ED</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BF70BE0BC3DAC200AB75ED</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84DE1A860BCCE1DA0033A95C</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>840034DB0BCD16CB00D03C1B</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BE28730BCD2B780086E6B3</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84409C610BCE2D4700A7BC33</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84B18DB40BCF7EEF005360E0</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8420DD240BD394E900937A80</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>847EA4B40BDDEC2B005AC757</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>847EA4B60BDDEC2B005AC757</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>847EA4FB0BDDF714005AC757</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>847EA4FC0BDDF714005AC757</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>847EA4FD0BDDF714005AC757</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8418426EC5B04BFC00DC27BC</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84A37A52C5B0A121003069A5</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84C86843C5B077FA0013D2B1</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84C86844C5B077FA0013D2B1</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>844D2C290C31125500A71AF3</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84464D2F0C3A520F00064760</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84464D330C3A520F00064760</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84464D4C0C3A523400064760</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84464E470C3A8F4900064760</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84DF556F0C3CC76F00AD2F4B</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>843C1D500C3F94EB000BB087</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8491B6BD0C44CB2B00E4B477</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84E20C5D0C57AF7C004FB864</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>849C6797C5B0469200F11330</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8487D8A10C6B37E3006BDD7C</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8487D8A20C6B37E3006BDD7C</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8487D8A30C6B37E3006BDD7C</string>\n\t\t\t\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t\t\t\t<key>prevStack</key>\n\t\t\t\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E4D70B4C1D20006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E4D90B4C1D20006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E52D0B4C22C7006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E71E0B4D0EC2006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E71F0B4D0EC2006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E7200B4D0EC2006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E7210B4D0EC2006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E7230B4D0EC2006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E7250B4D0EC2006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E7270B4D0EC2006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E7290B4D0EC2006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E72B0B4D0EC2006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E72D0B4D0EC2006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E87B0B4E88C3006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E87C0B4E88C3006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E87D0B4E88C3006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E90A0B4E956F006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8456E95E0B4EA7D1006B7550</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84F22A380B53D80F004CD709</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D9EE150B53E20600C10970</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84E9145B0B564E2E009AD6FC</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84E9145E0B564E2E009AD6FC</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84E8F34C0B57B4DF001DACF7</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D60ABD0B5BB8EF00D9EBCB</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D60AC10B5BB8EF00D9EBCB</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D60AC30B5BB8EF00D9EBCB</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D60AC40B5BB8EF00D9EBCB</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D60AC90B5BB8EF00D9EBCB</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D60ACC0B5BB8EF00D9EBCB</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D60B760B5BC12200D9EBCB</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D60B770B5BC12200D9EBCB</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D60BA40B5BC49500D9EBCB</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D60BA50B5BC49500D9EBCB</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D4FA460B5CCFFB0058AE41</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D4FB3F0B5CFCE50058AE41</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D4FB5B0B5CFE640058AE41</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D4FCA60B5D15890058AE41</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D4FCA70B5D15890058AE41</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D5200B0B5E19C10050DE52</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D520E40B5E2C1A0050DE52</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8400BEAE0B612C7C00FB16B3</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84DFC45E0B64BF8200858CAB</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84DFC6580B64D26200858CAB</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84C5A4370B67B31C00A596C5</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8460E80A0B8469BA009E0CB5</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8460E80B0B8469BA009E0CB5</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>848C41470B84919C00BD11B3</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>848C414C0B84919C00BD11B3</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>848C414D0B84919C00BD11B3</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>848C41AE0B84A77400BD11B3</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>848C42570B84C97700BD11B3</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>848C42580B84C97700BD11B3</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>848C42590B84C97700BD11B3</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>848C425B0B84C97700BD11B3</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84AFF1850B8C87E400D93058</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84AFF1890B8C87E400D93058</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84AFF18A0B8C87E400D93058</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84AFF18D0B8C87E400D93058</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D448D60B8EE46C008F9D1F</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84D44A870B8F44B4008F9D1F</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84B1AFA50B94350200D477E7</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84B1AFA80B94350200D477E7</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84B1B0070B9465A300D477E7</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC71BE0B959EDF00BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC71BF0B959EDF00BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC71C30B959EDF00BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC71C50B959EDF00BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC71CB0B959EDF00BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC71CC0B959EDF00BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC72210B95BC1100BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC74FF0B9604DE00BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84BC75900B9610B400BFC169</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84B0A81D0B96D8B400B60726</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84AF48B20BCCD4FB00C5BF0A</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>84184270C5B04BFC00DC27BC</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>841842B1C5B0606800DC27BC</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>849C6798C5B0469200F11330</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8487D8A40C6B37E3006BDD7C</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>8487D8A50C6B37E3006BDD7C</string>\n\t\t\t\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t\t<key>SplitCount</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>StatusBarVisibility</key>\n\t\t\t\t\t\t\t\t<true/>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>GeometryConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Frame</key>\n\t\t\t\t\t\t\t\t<string>{{0, 0}, {785, 493}}</string>\n\t\t\t\t\t\t\t\t<key>RubberWindowFrame</key>\n\t\t\t\t\t\t\t\t<string>7 98 1024 648 0 0 1024 746 </string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Module</key>\n\t\t\t\t\t\t\t<string>PBXNavigatorGroup</string>\n\t\t\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t\t\t<string>493pt</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>ContentConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t\t\t\t\t<string>1CE0B20506471E060097A5F4</string>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleLabel</key>\n\t\t\t\t\t\t\t\t<string>Detail</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>GeometryConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Frame</key>\n\t\t\t\t\t\t\t\t<string>{{0, 498}, {785, 109}}</string>\n\t\t\t\t\t\t\t\t<key>RubberWindowFrame</key>\n\t\t\t\t\t\t\t\t<string>7 98 1024 648 0 0 1024 746 </string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Module</key>\n\t\t\t\t\t\t\t<string>XCDetailModule</string>\n\t\t\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t\t\t<string>109pt</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t<string>785pt</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t\t<key>Name</key>\n\t\t\t<string>Project</string>\n\t\t\t<key>ServiceClasses</key>\n\t\t\t<array>\n\t\t\t\t<string>XCModuleDock</string>\n\t\t\t\t<string>PBXSmartGroupTreeModule</string>\n\t\t\t\t<string>XCModuleDock</string>\n\t\t\t\t<string>PBXNavigatorGroup</string>\n\t\t\t\t<string>XCDetailModule</string>\n\t\t\t</array>\n\t\t\t<key>TableOfContents</key>\n\t\t\t<array>\n\t\t\t\t<string>8487D8A70C6B37E3006BDD7C</string>\n\t\t\t\t<string>1CE0B1FE06471DED0097A5F4</string>\n\t\t\t\t<string>8487D8A80C6B37E3006BDD7C</string>\n\t\t\t\t<string>1CE0B20306471E060097A5F4</string>\n\t\t\t\t<string>1CE0B20506471E060097A5F4</string>\n\t\t\t</array>\n\t\t\t<key>ToolbarConfiguration</key>\n\t\t\t<string>xcode.toolbar.config.default</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>ControllerClassBaseName</key>\n\t\t\t<string></string>\n\t\t\t<key>IconName</key>\n\t\t\t<string>WindowOfProject</string>\n\t\t\t<key>Identifier</key>\n\t\t\t<string>perspective.morph</string>\n\t\t\t<key>IsVertical</key>\n\t\t\t<integer>0</integer>\n\t\t\t<key>Layout</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>BecomeActive</key>\n\t\t\t\t\t<integer>1</integer>\n\t\t\t\t\t<key>ContentConfiguration</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>PBXBottomSmartGroupGIDs</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<string>1C37FBAC04509CD000000102</string>\n\t\t\t\t\t\t\t<string>1C37FAAC04509CD000000102</string>\n\t\t\t\t\t\t\t<string>1C08E77C0454961000C914BD</string>\n\t\t\t\t\t\t\t<string>1C37FABC05509CD000000102</string>\n\t\t\t\t\t\t\t<string>1C37FABC05539CD112110102</string>\n\t\t\t\t\t\t\t<string>E2644B35053B69B200211256</string>\n\t\t\t\t\t\t\t<string>1C37FABC04509CD000100104</string>\n\t\t\t\t\t\t\t<string>1CC0EA4004350EF90044410B</string>\n\t\t\t\t\t\t\t<string>1CC0EA4004350EF90041110B</string>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t\t\t<string>11E0B1FE06471DED0097A5F4</string>\n\t\t\t\t\t\t<key>PBXProjectModuleLabel</key>\n\t\t\t\t\t\t<string>Files</string>\n\t\t\t\t\t\t<key>PBXProjectStructureProvided</key>\n\t\t\t\t\t\t<string>yes</string>\n\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleColumnData</key>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>\n\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t<real>186</real>\n\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>\n\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t<string>MainColumn</string>\n\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>\n\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t<string>29B97314FDCFA39411CA2CEA</string>\n\t\t\t\t\t\t\t\t<string>1C37FABC05509CD000000102</string>\n\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>\n\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t\t<integer>0</integer>\n\t\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>\n\t\t\t\t\t\t\t<string>{{0, 0}, {186, 337}}</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<key>PBXTopSmartGroupGIDs</key>\n\t\t\t\t\t\t<array/>\n\t\t\t\t\t\t<key>XCIncludePerspectivesSwitch</key>\n\t\t\t\t\t\t<integer>1</integer>\n\t\t\t\t\t\t<key>XCSharingToken</key>\n\t\t\t\t\t\t<string>com.apple.Xcode.GFSharingToken</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>GeometryConfiguration</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>Frame</key>\n\t\t\t\t\t\t<string>{{0, 0}, {203, 355}}</string>\n\t\t\t\t\t\t<key>GroupTreeTableConfiguration</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<string>MainColumn</string>\n\t\t\t\t\t\t\t<real>186</real>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t\t<key>RubberWindowFrame</key>\n\t\t\t\t\t\t<string>373 269 690 397 0 0 1440 878 </string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>Module</key>\n\t\t\t\t\t<string>PBXSmartGroupTreeModule</string>\n\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t<string>100%</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t\t<key>Name</key>\n\t\t\t<string>Morph</string>\n\t\t\t<key>PreferredWidth</key>\n\t\t\t<integer>300</integer>\n\t\t\t<key>ServiceClasses</key>\n\t\t\t<array>\n\t\t\t\t<string>XCModuleDock</string>\n\t\t\t\t<string>PBXSmartGroupTreeModule</string>\n\t\t\t</array>\n\t\t\t<key>TableOfContents</key>\n\t\t\t<array>\n\t\t\t\t<string>11E0B1FE06471DED0097A5F4</string>\n\t\t\t</array>\n\t\t\t<key>ToolbarConfiguration</key>\n\t\t\t<string>xcode.toolbar.config.default.short</string>\n\t\t</dict>\n\t</array>\n\t<key>PerspectivesBarVisible</key>\n\t<false/>\n\t<key>PinnedNavigatorIdentifier</key>\n\t<string>849C677DC5B0469200F11330</string>\n\t<key>ShelfIsVisible</key>\n\t<false/>\n\t<key>SourceDescription</key>\n\t<string>file at '/System/Library/PrivateFrameworks/DevToolsInterface.framework/Versions/A/Resources/XCPerspectivesSpecificationMode1.xcperspec'</string>\n\t<key>StatusbarIsVisible</key>\n\t<true/>\n\t<key>TimeStamp</key>\n\t<real>0.0</real>\n\t<key>ToolbarDisplayMode</key>\n\t<integer>1</integer>\n\t<key>ToolbarIsVisible</key>\n\t<true/>\n\t<key>ToolbarSizeMode</key>\n\t<integer>1</integer>\n\t<key>Type</key>\n\t<string>Perspectives</string>\n\t<key>UpdateMessage</key>\n\t<string>The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the \"Metro-Morph\" feature).  You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature.  Do you wish to update to the latest Workspace defaults for project '%@'?</string>\n\t<key>WindowJustification</key>\n\t<integer>5</integer>\n\t<key>WindowOrderList</key>\n\t<array>\n\t\t<string>1C0AD2B3069F1EA900FABCE6</string>\n\t\t<string>849C677DC5B0469200F11330</string>\n\t\t<string>/Users/admin/Projects/Echoware/Echoware.xcodeproj</string>\n\t</array>\n\t<key>WindowString</key>\n\t<string>7 98 1024 648 0 0 1024 746 </string>\n\t<key>WindowTools</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>FirstTimeWindowDisplayed</key>\n\t\t\t<false/>\n\t\t\t<key>Identifier</key>\n\t\t\t<string>windowTool.build</string>\n\t\t\t<key>IsVertical</key>\n\t\t\t<true/>\n\t\t\t<key>Layout</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Dock</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>BecomeActive</key>\n\t\t\t\t\t\t\t<true/>\n\t\t\t\t\t\t\t<key>ContentConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t\t\t\t\t<string>1CD0528F0623707200166675</string>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleLabel</key>\n\t\t\t\t\t\t\t\t<string>EchoController.m</string>\n\t\t\t\t\t\t\t\t<key>StatusBarVisibility</key>\n\t\t\t\t\t\t\t\t<true/>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>GeometryConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Frame</key>\n\t\t\t\t\t\t\t\t<string>{{0, 0}, {851, 355}}</string>\n\t\t\t\t\t\t\t\t<key>RubberWindowFrame</key>\n\t\t\t\t\t\t\t\t<string>99 121 851 615 0 0 1024 746 </string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Module</key>\n\t\t\t\t\t\t\t<string>PBXNavigatorGroup</string>\n\t\t\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t\t\t<string>355pt</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>ContentConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t\t\t\t\t<string>XCMainBuildResultsModuleGUID</string>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleLabel</key>\n\t\t\t\t\t\t\t\t<string>Build</string>\n\t\t\t\t\t\t\t\t<key>XCBuildResultsTrigger_Collapse</key>\n\t\t\t\t\t\t\t\t<integer>1021</integer>\n\t\t\t\t\t\t\t\t<key>XCBuildResultsTrigger_Open</key>\n\t\t\t\t\t\t\t\t<integer>1011</integer>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>GeometryConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Frame</key>\n\t\t\t\t\t\t\t\t<string>{{0, 360}, {851, 214}}</string>\n\t\t\t\t\t\t\t\t<key>RubberWindowFrame</key>\n\t\t\t\t\t\t\t\t<string>99 121 851 615 0 0 1024 746 </string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Module</key>\n\t\t\t\t\t\t\t<string>PBXBuildResultsModule</string>\n\t\t\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t\t\t<string>214pt</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t<string>574pt</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t\t<key>Name</key>\n\t\t\t<string>Build Results</string>\n\t\t\t<key>ServiceClasses</key>\n\t\t\t<array>\n\t\t\t\t<string>PBXBuildResultsModule</string>\n\t\t\t</array>\n\t\t\t<key>StatusbarIsVisible</key>\n\t\t\t<true/>\n\t\t\t<key>TableOfContents</key>\n\t\t\t<array>\n\t\t\t\t<string>84DAA48C0B132F2800222618</string>\n\t\t\t\t<string>8487D89C0C6B3773006BDD7C</string>\n\t\t\t\t<string>1CD0528F0623707200166675</string>\n\t\t\t\t<string>XCMainBuildResultsModuleGUID</string>\n\t\t\t</array>\n\t\t\t<key>ToolbarConfiguration</key>\n\t\t\t<string>xcode.toolbar.config.build</string>\n\t\t\t<key>WindowString</key>\n\t\t\t<string>99 121 851 615 0 0 1024 746 </string>\n\t\t\t<key>WindowToolGUID</key>\n\t\t\t<string>84DAA48C0B132F2800222618</string>\n\t\t\t<key>WindowToolIsVisible</key>\n\t\t\t<true/>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>FirstTimeWindowDisplayed</key>\n\t\t\t<false/>\n\t\t\t<key>Identifier</key>\n\t\t\t<string>windowTool.debugger</string>\n\t\t\t<key>IsVertical</key>\n\t\t\t<true/>\n\t\t\t<key>Layout</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Dock</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>ContentConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Debugger</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>HorizontalSplitView</key>\n\t\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t\t<key>_collapsingFrameDimension</key>\n\t\t\t\t\t\t\t\t\t\t<real>0.0</real>\n\t\t\t\t\t\t\t\t\t\t<key>_indexOfCollapsedView</key>\n\t\t\t\t\t\t\t\t\t\t<integer>0</integer>\n\t\t\t\t\t\t\t\t\t\t<key>_percentageOfCollapsedView</key>\n\t\t\t\t\t\t\t\t\t\t<real>0.0</real>\n\t\t\t\t\t\t\t\t\t\t<key>isCollapsed</key>\n\t\t\t\t\t\t\t\t\t\t<string>yes</string>\n\t\t\t\t\t\t\t\t\t\t<key>sizes</key>\n\t\t\t\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t\t\t\t<string>{{0, 0}, {266, 300}}</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>{{266, 0}, {582, 300}}</string>\n\t\t\t\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t\t<key>VerticalSplitView</key>\n\t\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t\t<key>_collapsingFrameDimension</key>\n\t\t\t\t\t\t\t\t\t\t<real>0.0</real>\n\t\t\t\t\t\t\t\t\t\t<key>_indexOfCollapsedView</key>\n\t\t\t\t\t\t\t\t\t\t<integer>0</integer>\n\t\t\t\t\t\t\t\t\t\t<key>_percentageOfCollapsedView</key>\n\t\t\t\t\t\t\t\t\t\t<real>0.0</real>\n\t\t\t\t\t\t\t\t\t\t<key>isCollapsed</key>\n\t\t\t\t\t\t\t\t\t\t<string>yes</string>\n\t\t\t\t\t\t\t\t\t\t<key>sizes</key>\n\t\t\t\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t\t\t\t<string>{{0, 0}, {848, 300}}</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>{{0, 300}, {848, 271}}</string>\n\t\t\t\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>LauncherConfigVersion</key>\n\t\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t\t\t\t\t<string>1C162984064C10D400B95A72</string>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleLabel</key>\n\t\t\t\t\t\t\t\t<string>Debug - GLUTExamples (Underwater)</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>GeometryConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DebugConsoleDrawerSize</key>\n\t\t\t\t\t\t\t\t<string>{100, 120}</string>\n\t\t\t\t\t\t\t\t<key>DebugConsoleVisible</key>\n\t\t\t\t\t\t\t\t<string>None</string>\n\t\t\t\t\t\t\t\t<key>DebugConsoleWindowFrame</key>\n\t\t\t\t\t\t\t\t<string>{{200, 200}, {500, 300}}</string>\n\t\t\t\t\t\t\t\t<key>DebugSTDIOWindowFrame</key>\n\t\t\t\t\t\t\t\t<string>{{200, 200}, {500, 300}}</string>\n\t\t\t\t\t\t\t\t<key>Frame</key>\n\t\t\t\t\t\t\t\t<string>{{0, 0}, {848, 571}}</string>\n\t\t\t\t\t\t\t\t<key>RubberWindowFrame</key>\n\t\t\t\t\t\t\t\t<string>119 134 848 612 0 0 1024 746 </string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Module</key>\n\t\t\t\t\t\t\t<string>PBXDebugSessionModule</string>\n\t\t\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t\t\t<string>571pt</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t<string>571pt</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t\t<key>Name</key>\n\t\t\t<string>Debugger</string>\n\t\t\t<key>ServiceClasses</key>\n\t\t\t<array>\n\t\t\t\t<string>PBXDebugSessionModule</string>\n\t\t\t</array>\n\t\t\t<key>StatusbarIsVisible</key>\n\t\t\t<true/>\n\t\t\t<key>TableOfContents</key>\n\t\t\t<array>\n\t\t\t\t<string>1CD10A99069EF8BA00B06720</string>\n\t\t\t\t<string>84464E510C3A8F4900064760</string>\n\t\t\t\t<string>1C162984064C10D400B95A72</string>\n\t\t\t\t<string>84464E520C3A8F4900064760</string>\n\t\t\t\t<string>84464E530C3A8F4900064760</string>\n\t\t\t\t<string>84464E540C3A8F4900064760</string>\n\t\t\t\t<string>84464E550C3A8F4900064760</string>\n\t\t\t\t<string>84464E560C3A8F4900064760</string>\n\t\t\t\t<string>84464E570C3A8F4900064760</string>\n\t\t\t</array>\n\t\t\t<key>ToolbarConfiguration</key>\n\t\t\t<string>xcode.toolbar.config.debug</string>\n\t\t\t<key>WindowString</key>\n\t\t\t<string>119 134 848 612 0 0 1024 746 </string>\n\t\t\t<key>WindowToolGUID</key>\n\t\t\t<string>1CD10A99069EF8BA00B06720</string>\n\t\t\t<key>WindowToolIsVisible</key>\n\t\t\t<false/>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>FirstTimeWindowDisplayed</key>\n\t\t\t<false/>\n\t\t\t<key>Identifier</key>\n\t\t\t<string>windowTool.find</string>\n\t\t\t<key>IsVertical</key>\n\t\t\t<true/>\n\t\t\t<key>Layout</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Dock</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Dock</key>\n\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>BecomeActive</key>\n\t\t\t\t\t\t\t\t\t<true/>\n\t\t\t\t\t\t\t\t\t<key>ContentConfiguration</key>\n\t\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t\t\t\t\t\t\t<string>1CDD528C0622207200134675</string>\n\t\t\t\t\t\t\t\t\t\t<key>PBXProjectModuleLabel</key>\n\t\t\t\t\t\t\t\t\t\t<string>ACConnection.cpp</string>\n\t\t\t\t\t\t\t\t\t\t<key>StatusBarVisibility</key>\n\t\t\t\t\t\t\t\t\t\t<true/>\n\t\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t\t<key>GeometryConfiguration</key>\n\t\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t\t<key>Frame</key>\n\t\t\t\t\t\t\t\t\t\t<string>{{0, 0}, {1024, 348}}</string>\n\t\t\t\t\t\t\t\t\t\t<key>RubberWindowFrame</key>\n\t\t\t\t\t\t\t\t\t\t<string>36 62 1024 671 0 0 1024 746 </string>\n\t\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t\t<key>Module</key>\n\t\t\t\t\t\t\t\t\t<string>PBXNavigatorGroup</string>\n\t\t\t\t\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t\t\t\t\t<string>1024pt</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t\t\t<string>348pt</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>ContentConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t\t\t\t\t<string>1CD0528E0623707200166675</string>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleLabel</key>\n\t\t\t\t\t\t\t\t<string>Project Find</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>GeometryConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Frame</key>\n\t\t\t\t\t\t\t\t<string>{{0, 353}, {1024, 277}}</string>\n\t\t\t\t\t\t\t\t<key>RubberWindowFrame</key>\n\t\t\t\t\t\t\t\t<string>36 62 1024 671 0 0 1024 746 </string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Module</key>\n\t\t\t\t\t\t\t<string>PBXProjectFindModule</string>\n\t\t\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t\t\t<string>277pt</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t<string>630pt</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t\t<key>Name</key>\n\t\t\t<string>Project Find</string>\n\t\t\t<key>ServiceClasses</key>\n\t\t\t<array>\n\t\t\t\t<string>PBXProjectFindModule</string>\n\t\t\t</array>\n\t\t\t<key>StatusbarIsVisible</key>\n\t\t\t<true/>\n\t\t\t<key>TableOfContents</key>\n\t\t\t<array>\n\t\t\t\t<string>1C530D57069F1CE1000CFCEE</string>\n\t\t\t\t<string>84E20C5A0C57AF7B004FB864</string>\n\t\t\t\t<string>84E20C5B0C57AF7B004FB864</string>\n\t\t\t\t<string>1CDD528C0622207200134675</string>\n\t\t\t\t<string>1CD0528E0623707200166675</string>\n\t\t\t</array>\n\t\t\t<key>WindowString</key>\n\t\t\t<string>36 62 1024 671 0 0 1024 746 </string>\n\t\t\t<key>WindowToolGUID</key>\n\t\t\t<string>1C530D57069F1CE1000CFCEE</string>\n\t\t\t<key>WindowToolIsVisible</key>\n\t\t\t<false/>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>Identifier</key>\n\t\t\t<string>MENUSEPARATOR</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>FirstTimeWindowDisplayed</key>\n\t\t\t<false/>\n\t\t\t<key>Identifier</key>\n\t\t\t<string>windowTool.debuggerConsole</string>\n\t\t\t<key>IsVertical</key>\n\t\t\t<true/>\n\t\t\t<key>Layout</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Dock</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>ContentConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t\t\t\t\t<string>1C78EAAC065D492600B07095</string>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleLabel</key>\n\t\t\t\t\t\t\t\t<string>Debugger Console</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>GeometryConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Frame</key>\n\t\t\t\t\t\t\t\t<string>{{0, 0}, {440, 358}}</string>\n\t\t\t\t\t\t\t\t<key>RubberWindowFrame</key>\n\t\t\t\t\t\t\t\t<string>65 297 440 400 0 0 1024 746 </string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Module</key>\n\t\t\t\t\t\t\t<string>PBXDebugCLIModule</string>\n\t\t\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t\t\t<string>358pt</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t<string>359pt</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t\t<key>Name</key>\n\t\t\t<string>Debugger Console</string>\n\t\t\t<key>ServiceClasses</key>\n\t\t\t<array>\n\t\t\t\t<string>PBXDebugCLIModule</string>\n\t\t\t</array>\n\t\t\t<key>StatusbarIsVisible</key>\n\t\t\t<true/>\n\t\t\t<key>TableOfContents</key>\n\t\t\t<array>\n\t\t\t\t<string>84DAA5480B14CCD900222618</string>\n\t\t\t\t<string>84C86822C5B0743E0013D2B1</string>\n\t\t\t\t<string>1C78EAAC065D492600B07095</string>\n\t\t\t</array>\n\t\t\t<key>WindowString</key>\n\t\t\t<string>65 297 440 400 0 0 1024 746 </string>\n\t\t\t<key>WindowToolGUID</key>\n\t\t\t<string>84DAA5480B14CCD900222618</string>\n\t\t\t<key>WindowToolIsVisible</key>\n\t\t\t<false/>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>FirstTimeWindowDisplayed</key>\n\t\t\t<false/>\n\t\t\t<key>Identifier</key>\n\t\t\t<string>windowTool.run</string>\n\t\t\t<key>IsVertical</key>\n\t\t\t<true/>\n\t\t\t<key>Layout</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Dock</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>ContentConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>LauncherConfigVersion</key>\n\t\t\t\t\t\t\t\t<string>3</string>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t\t\t\t\t<string>1CD0528B0623707200166675</string>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleLabel</key>\n\t\t\t\t\t\t\t\t<string>Run</string>\n\t\t\t\t\t\t\t\t<key>Runner</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>HorizontalSplitView</key>\n\t\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t\t<key>_collapsingFrameDimension</key>\n\t\t\t\t\t\t\t\t\t\t<real>0.0</real>\n\t\t\t\t\t\t\t\t\t\t<key>_indexOfCollapsedView</key>\n\t\t\t\t\t\t\t\t\t\t<integer>0</integer>\n\t\t\t\t\t\t\t\t\t\t<key>_percentageOfCollapsedView</key>\n\t\t\t\t\t\t\t\t\t\t<real>0.0</real>\n\t\t\t\t\t\t\t\t\t\t<key>isCollapsed</key>\n\t\t\t\t\t\t\t\t\t\t<string>yes</string>\n\t\t\t\t\t\t\t\t\t\t<key>sizes</key>\n\t\t\t\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t\t\t\t<string>{{0, 0}, {493, 167}}</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>{{0, 176}, {493, 267}}</string>\n\t\t\t\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t\t<key>VerticalSplitView</key>\n\t\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t\t<key>_collapsingFrameDimension</key>\n\t\t\t\t\t\t\t\t\t\t<real>0.0</real>\n\t\t\t\t\t\t\t\t\t\t<key>_indexOfCollapsedView</key>\n\t\t\t\t\t\t\t\t\t\t<integer>0</integer>\n\t\t\t\t\t\t\t\t\t\t<key>_percentageOfCollapsedView</key>\n\t\t\t\t\t\t\t\t\t\t<real>0.0</real>\n\t\t\t\t\t\t\t\t\t\t<key>isCollapsed</key>\n\t\t\t\t\t\t\t\t\t\t<string>yes</string>\n\t\t\t\t\t\t\t\t\t\t<key>sizes</key>\n\t\t\t\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t\t\t\t<string>{{0, 0}, {405, 443}}</string>\n\t\t\t\t\t\t\t\t\t\t\t<string>{{414, 0}, {514, 443}}</string>\n\t\t\t\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>GeometryConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Frame</key>\n\t\t\t\t\t\t\t\t<string>{{0, 0}, {657, 425}}</string>\n\t\t\t\t\t\t\t\t<key>RubberWindowFrame</key>\n\t\t\t\t\t\t\t\t<string>254 226 657 466 0 0 1024 746 </string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Module</key>\n\t\t\t\t\t\t\t<string>PBXRunSessionModule</string>\n\t\t\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t\t\t<string>425pt</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t<string>425pt</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t\t<key>Name</key>\n\t\t\t<string>Run Log</string>\n\t\t\t<key>ServiceClasses</key>\n\t\t\t<array>\n\t\t\t\t<string>PBXRunSessionModule</string>\n\t\t\t</array>\n\t\t\t<key>StatusbarIsVisible</key>\n\t\t\t<true/>\n\t\t\t<key>TableOfContents</key>\n\t\t\t<array>\n\t\t\t\t<string>1C0AD2B3069F1EA900FABCE6</string>\n\t\t\t\t<string>8487D89D0C6B3773006BDD7C</string>\n\t\t\t\t<string>1CD0528B0623707200166675</string>\n\t\t\t\t<string>8487D89E0C6B3773006BDD7C</string>\n\t\t\t</array>\n\t\t\t<key>ToolbarConfiguration</key>\n\t\t\t<string>xcode.toolbar.config.run</string>\n\t\t\t<key>WindowString</key>\n\t\t\t<string>254 226 657 466 0 0 1024 746 </string>\n\t\t\t<key>WindowToolGUID</key>\n\t\t\t<string>1C0AD2B3069F1EA900FABCE6</string>\n\t\t\t<key>WindowToolIsVisible</key>\n\t\t\t<false/>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>Identifier</key>\n\t\t\t<string>windowTool.scm</string>\n\t\t\t<key>Layout</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Dock</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>ContentConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t\t\t\t\t<string>1C78EAB2065D492600B07095</string>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleLabel</key>\n\t\t\t\t\t\t\t\t<string>&lt;No Editor&gt;</string>\n\t\t\t\t\t\t\t\t<key>PBXSplitModuleInNavigatorKey</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Split0</key>\n\t\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t\t\t\t\t\t\t<string>1C78EAB3065D492600B07095</string>\n\t\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t\t<key>SplitCount</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>StatusBarVisibility</key>\n\t\t\t\t\t\t\t\t<integer>1</integer>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>GeometryConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Frame</key>\n\t\t\t\t\t\t\t\t<string>{{0, 0}, {452, 0}}</string>\n\t\t\t\t\t\t\t\t<key>RubberWindowFrame</key>\n\t\t\t\t\t\t\t\t<string>743 379 452 308 0 0 1280 1002 </string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Module</key>\n\t\t\t\t\t\t\t<string>PBXNavigatorGroup</string>\n\t\t\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t\t\t<string>0pt</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>BecomeActive</key>\n\t\t\t\t\t\t\t<integer>1</integer>\n\t\t\t\t\t\t\t<key>ContentConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t\t\t\t\t<string>1CD052920623707200166675</string>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleLabel</key>\n\t\t\t\t\t\t\t\t<string>SCM</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>GeometryConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>ConsoleFrame</key>\n\t\t\t\t\t\t\t\t<string>{{0, 259}, {452, 0}}</string>\n\t\t\t\t\t\t\t\t<key>Frame</key>\n\t\t\t\t\t\t\t\t<string>{{0, 7}, {452, 259}}</string>\n\t\t\t\t\t\t\t\t<key>RubberWindowFrame</key>\n\t\t\t\t\t\t\t\t<string>743 379 452 308 0 0 1280 1002 </string>\n\t\t\t\t\t\t\t\t<key>TableConfiguration</key>\n\t\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t\t<string>Status</string>\n\t\t\t\t\t\t\t\t\t<real>30</real>\n\t\t\t\t\t\t\t\t\t<string>FileName</string>\n\t\t\t\t\t\t\t\t\t<real>199</real>\n\t\t\t\t\t\t\t\t\t<string>Path</string>\n\t\t\t\t\t\t\t\t\t<real>197.09500122070312</real>\n\t\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t\t<key>TableFrame</key>\n\t\t\t\t\t\t\t\t<string>{{0, 0}, {452, 250}}</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Module</key>\n\t\t\t\t\t\t\t<string>PBXCVSModule</string>\n\t\t\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t\t\t<string>262pt</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t<string>266pt</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t\t<key>Name</key>\n\t\t\t<string>SCM</string>\n\t\t\t<key>ServiceClasses</key>\n\t\t\t<array>\n\t\t\t\t<string>PBXCVSModule</string>\n\t\t\t</array>\n\t\t\t<key>StatusbarIsVisible</key>\n\t\t\t<integer>1</integer>\n\t\t\t<key>TableOfContents</key>\n\t\t\t<array>\n\t\t\t\t<string>1C78EAB4065D492600B07095</string>\n\t\t\t\t<string>1C78EAB5065D492600B07095</string>\n\t\t\t\t<string>1C78EAB2065D492600B07095</string>\n\t\t\t\t<string>1CD052920623707200166675</string>\n\t\t\t</array>\n\t\t\t<key>ToolbarConfiguration</key>\n\t\t\t<string>xcode.toolbar.config.scm</string>\n\t\t\t<key>WindowString</key>\n\t\t\t<string>743 379 452 308 0 0 1280 1002 </string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>FirstTimeWindowDisplayed</key>\n\t\t\t<false/>\n\t\t\t<key>Identifier</key>\n\t\t\t<string>windowTool.breakpoints</string>\n\t\t\t<key>IsVertical</key>\n\t\t\t<false/>\n\t\t\t<key>Layout</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Dock</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>ContentConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>PBXBottomSmartGroupGIDs</key>\n\t\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t\t<string>1C77FABC04509CD000000102</string>\n\t\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t\t\t\t\t<string>1CE0B1FE06471DED0097A5F4</string>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleLabel</key>\n\t\t\t\t\t\t\t\t<string>Files</string>\n\t\t\t\t\t\t\t\t<key>PBXProjectStructureProvided</key>\n\t\t\t\t\t\t\t\t<string>no</string>\n\t\t\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleColumnData</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>\n\t\t\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t\t\t<real>168</real>\n\t\t\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>\n\t\t\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t\t\t<string>MainColumn</string>\n\t\t\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>\n\t\t\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t\t\t<string>1C77FABC04509CD000000102</string>\n\t\t\t\t\t\t\t\t\t\t<string>1C3E0DCA080725EA00A55177</string>\n\t\t\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>\n\t\t\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t\t\t\t<integer>0</integer>\n\t\t\t\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t\t\t<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>\n\t\t\t\t\t\t\t\t\t<string>{{0, 0}, {168, 350}}</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>PBXTopSmartGroupGIDs</key>\n\t\t\t\t\t\t\t\t<array/>\n\t\t\t\t\t\t\t\t<key>XCIncludePerspectivesSwitch</key>\n\t\t\t\t\t\t\t\t<false/>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>GeometryConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Frame</key>\n\t\t\t\t\t\t\t\t<string>{{0, 0}, {185, 368}}</string>\n\t\t\t\t\t\t\t\t<key>GroupTreeTableConfiguration</key>\n\t\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t\t<string>MainColumn</string>\n\t\t\t\t\t\t\t\t\t<real>168</real>\n\t\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t\t<key>RubberWindowFrame</key>\n\t\t\t\t\t\t\t\t<string>283 268 744 409 0 0 1024 746 </string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Module</key>\n\t\t\t\t\t\t\t<string>PBXSmartGroupTreeModule</string>\n\t\t\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t\t\t<string>185pt</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>BecomeActive</key>\n\t\t\t\t\t\t\t<true/>\n\t\t\t\t\t\t\t<key>ContentConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t\t\t\t\t<string>1CA1AED706398EBD00589147</string>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleLabel</key>\n\t\t\t\t\t\t\t\t<string>Detail</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>GeometryConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Frame</key>\n\t\t\t\t\t\t\t\t<string>{{190, 0}, {554, 368}}</string>\n\t\t\t\t\t\t\t\t<key>RubberWindowFrame</key>\n\t\t\t\t\t\t\t\t<string>283 268 744 409 0 0 1024 746 </string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Module</key>\n\t\t\t\t\t\t\t<string>XCDetailModule</string>\n\t\t\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t\t\t<string>554pt</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t<string>368pt</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t\t<key>MajorVersion</key>\n\t\t\t<integer>2</integer>\n\t\t\t<key>MinorVersion</key>\n\t\t\t<integer>0</integer>\n\t\t\t<key>Name</key>\n\t\t\t<string>Breakpoints</string>\n\t\t\t<key>ServiceClasses</key>\n\t\t\t<array>\n\t\t\t\t<string>PBXSmartGroupTreeModule</string>\n\t\t\t\t<string>XCDetailModule</string>\n\t\t\t</array>\n\t\t\t<key>StatusbarIsVisible</key>\n\t\t\t<true/>\n\t\t\t<key>TableOfContents</key>\n\t\t\t<array>\n\t\t\t\t<string>84C5A4630B67B67E00A596C5</string>\n\t\t\t\t<string>84C5A4640B67B67E00A596C5</string>\n\t\t\t\t<string>1CE0B1FE06471DED0097A5F4</string>\n\t\t\t\t<string>1CA1AED706398EBD00589147</string>\n\t\t\t</array>\n\t\t\t<key>ToolbarConfiguration</key>\n\t\t\t<string>xcode.toolbar.config.breakpoints</string>\n\t\t\t<key>WindowString</key>\n\t\t\t<string>283 268 744 409 0 0 1024 746 </string>\n\t\t\t<key>WindowToolGUID</key>\n\t\t\t<string>84C5A4630B67B67E00A596C5</string>\n\t\t\t<key>WindowToolIsVisible</key>\n\t\t\t<false/>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>Identifier</key>\n\t\t\t<string>windowTool.debugAnimator</string>\n\t\t\t<key>Layout</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Dock</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Module</key>\n\t\t\t\t\t\t\t<string>PBXNavigatorGroup</string>\n\t\t\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t\t\t<string>100%</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t<string>100%</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t\t<key>Name</key>\n\t\t\t<string>Debug Visualizer</string>\n\t\t\t<key>ServiceClasses</key>\n\t\t\t<array>\n\t\t\t\t<string>PBXNavigatorGroup</string>\n\t\t\t</array>\n\t\t\t<key>StatusbarIsVisible</key>\n\t\t\t<integer>1</integer>\n\t\t\t<key>ToolbarConfiguration</key>\n\t\t\t<string>xcode.toolbar.config.debugAnimator</string>\n\t\t\t<key>WindowString</key>\n\t\t\t<string>100 100 700 500 0 0 1280 1002 </string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>Identifier</key>\n\t\t\t<string>windowTool.bookmarks</string>\n\t\t\t<key>Layout</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Dock</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Module</key>\n\t\t\t\t\t\t\t<string>PBXBookmarksModule</string>\n\t\t\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t\t\t<string>100%</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t<string>100%</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t\t<key>Name</key>\n\t\t\t<string>Bookmarks</string>\n\t\t\t<key>ServiceClasses</key>\n\t\t\t<array>\n\t\t\t\t<string>PBXBookmarksModule</string>\n\t\t\t</array>\n\t\t\t<key>StatusbarIsVisible</key>\n\t\t\t<integer>0</integer>\n\t\t\t<key>WindowString</key>\n\t\t\t<string>538 42 401 187 0 0 1280 1002 </string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>Identifier</key>\n\t\t\t<string>windowTool.classBrowser</string>\n\t\t\t<key>Layout</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Dock</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>BecomeActive</key>\n\t\t\t\t\t\t\t<integer>1</integer>\n\t\t\t\t\t\t\t<key>ContentConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>OptionsSetName</key>\n\t\t\t\t\t\t\t\t<string>Hierarchy, all classes</string>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleGUID</key>\n\t\t\t\t\t\t\t\t<string>1CA6456E063B45B4001379D8</string>\n\t\t\t\t\t\t\t\t<key>PBXProjectModuleLabel</key>\n\t\t\t\t\t\t\t\t<string>Class Browser - NSObject</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>GeometryConfiguration</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>ClassesFrame</key>\n\t\t\t\t\t\t\t\t<string>{{0, 0}, {374, 96}}</string>\n\t\t\t\t\t\t\t\t<key>ClassesTreeTableConfiguration</key>\n\t\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t\t<string>PBXClassNameColumnIdentifier</string>\n\t\t\t\t\t\t\t\t\t<real>208</real>\n\t\t\t\t\t\t\t\t\t<string>PBXClassBookColumnIdentifier</string>\n\t\t\t\t\t\t\t\t\t<real>22</real>\n\t\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t\t<key>Frame</key>\n\t\t\t\t\t\t\t\t<string>{{0, 0}, {630, 331}}</string>\n\t\t\t\t\t\t\t\t<key>MembersFrame</key>\n\t\t\t\t\t\t\t\t<string>{{0, 105}, {374, 395}}</string>\n\t\t\t\t\t\t\t\t<key>MembersTreeTableConfiguration</key>\n\t\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t\t<string>PBXMemberTypeIconColumnIdentifier</string>\n\t\t\t\t\t\t\t\t\t<real>22</real>\n\t\t\t\t\t\t\t\t\t<string>PBXMemberNameColumnIdentifier</string>\n\t\t\t\t\t\t\t\t\t<real>216</real>\n\t\t\t\t\t\t\t\t\t<string>PBXMemberTypeColumnIdentifier</string>\n\t\t\t\t\t\t\t\t\t<real>97</real>\n\t\t\t\t\t\t\t\t\t<string>PBXMemberBookColumnIdentifier</string>\n\t\t\t\t\t\t\t\t\t<real>22</real>\n\t\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t\t<key>PBXModuleWindowStatusBarHidden2</key>\n\t\t\t\t\t\t\t\t<integer>1</integer>\n\t\t\t\t\t\t\t\t<key>RubberWindowFrame</key>\n\t\t\t\t\t\t\t\t<string>385 179 630 352 0 0 1440 878 </string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Module</key>\n\t\t\t\t\t\t\t<string>PBXClassBrowserModule</string>\n\t\t\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t\t\t<string>332pt</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t\t<key>Proportion</key>\n\t\t\t\t\t<string>332pt</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t\t<key>Name</key>\n\t\t\t<string>Class Browser</string>\n\t\t\t<key>ServiceClasses</key>\n\t\t\t<array>\n\t\t\t\t<string>PBXClassBrowserModule</string>\n\t\t\t</array>\n\t\t\t<key>StatusbarIsVisible</key>\n\t\t\t<integer>0</integer>\n\t\t\t<key>TableOfContents</key>\n\t\t\t<array>\n\t\t\t\t<string>1C0AD2AF069F1E9B00FABCE6</string>\n\t\t\t\t<string>1C0AD2B0069F1E9B00FABCE6</string>\n\t\t\t\t<string>1CA6456E063B45B4001379D8</string>\n\t\t\t</array>\n\t\t\t<key>ToolbarConfiguration</key>\n\t\t\t<string>xcode.toolbar.config.classbrowser</string>\n\t\t\t<key>WindowString</key>\n\t\t\t<string>385 179 630 352 0 0 1440 878 </string>\n\t\t\t<key>WindowToolGUID</key>\n\t\t\t<string>1C0AD2AF069F1E9B00FABCE6</string>\n\t\t\t<key>WindowToolIsVisible</key>\n\t\t\t<integer>0</integer>\n\t\t</dict>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "Bundles/Echoware/Echoware.xcodeproj/admin.pbxuser",
    "content": "// !$*UTF8*$!\n{\n\t089C1669FE841209C02AAC07 /* Project object */ = {\n\t\tactiveBuildConfigurationName = Deployment;\n\t\tactiveExecutable = 8480D0BC0B5F8D200030E8C0 /* Vine Server 2.1 */;\n\t\tactiveTarget = 8D5B49AC048680CD000E48DA /* Echoware */;\n\t\taddToTargets = (\n\t\t\t8D5B49AC048680CD000E48DA /* Echoware */,\n\t\t);\n\t\tbreakpoints = (\n\t\t);\n\t\tbreakpointsGroup = 84DAA51F0B14A33800222618 /* XCBreakpointsBucket */;\n\t\tcodeSenseManager = 84DAA48F0B132F2900222618 /* Code sense */;\n\t\texecutables = (\n\t\t\t8480D0BC0B5F8D200030E8C0 /* Vine Server 2.1 */,\n\t\t);\n\t\texpressions = (\n\t\t\tdwKey,\n\t\t\t\"*(dwKey)\",\n\t\t);\n\t\tperUserDictionary = {\n\t\t\t\"PBXConfiguration.PBXBreakpointsDataSource.v1:1CA1AED706398EBD00589147\" = {\n\t\t\t\tPBXFileTableDataSourceColumnSortingDirectionKey = 1;\n\t\t\t\tPBXFileTableDataSourceColumnSortingKey = PBXBreakpointsDataSource_ContinueID;\n\t\t\t\tPBXFileTableDataSourceColumnWidthsKey = (\n\t\t\t\t\t20,\n\t\t\t\t\t20,\n\t\t\t\t\t210,\n\t\t\t\t\t20,\n\t\t\t\t\t110,\n\t\t\t\t\t109,\n\t\t\t\t\t20,\n\t\t\t\t);\n\t\t\t\tPBXFileTableDataSourceColumnsKey = (\n\t\t\t\t\tPBXBreakpointsDataSource_ActionID,\n\t\t\t\t\tPBXBreakpointsDataSource_TypeID,\n\t\t\t\t\tPBXBreakpointsDataSource_BreakpointID,\n\t\t\t\t\tPBXBreakpointsDataSource_UseID,\n\t\t\t\t\tPBXBreakpointsDataSource_LocationID,\n\t\t\t\t\tPBXBreakpointsDataSource_ConditionID,\n\t\t\t\t\tPBXBreakpointsDataSource_ContinueID,\n\t\t\t\t);\n\t\t\t};\n\t\t\t\"PBXConfiguration.PBXBreakpointsDataSource.v1:1CE0B20506471E060097A5F4\" = {\n\t\t\t\tPBXFileTableDataSourceColumnSortingDirectionKey = \"-1\";\n\t\t\t\tPBXFileTableDataSourceColumnSortingKey = PBXBreakpointsDataSource_BreakpointID;\n\t\t\t\tPBXFileTableDataSourceColumnWidthsKey = (\n\t\t\t\t\t20,\n\t\t\t\t\t20,\n\t\t\t\t\t287,\n\t\t\t\t\t20,\n\t\t\t\t\t186,\n\t\t\t\t\t187,\n\t\t\t\t\t20,\n\t\t\t\t);\n\t\t\t\tPBXFileTableDataSourceColumnsKey = (\n\t\t\t\t\tPBXBreakpointsDataSource_ActionID,\n\t\t\t\t\tPBXBreakpointsDataSource_TypeID,\n\t\t\t\t\tPBXBreakpointsDataSource_BreakpointID,\n\t\t\t\t\tPBXBreakpointsDataSource_UseID,\n\t\t\t\t\tPBXBreakpointsDataSource_LocationID,\n\t\t\t\t\tPBXBreakpointsDataSource_ConditionID,\n\t\t\t\t\tPBXBreakpointsDataSource_ContinueID,\n\t\t\t\t);\n\t\t\t};\n\t\t\tPBXConfiguration.PBXFileTableDataSource3.PBXBookmarksDataSource = {\n\t\t\t\tPBXFileTableDataSourceColumnSortingDirectionKey = \"-1\";\n\t\t\t\tPBXFileTableDataSourceColumnSortingKey = PBXBookmarksDataSource_NameID;\n\t\t\t\tPBXFileTableDataSourceColumnWidthsKey = (\n\t\t\t\t\t200,\n\t\t\t\t\t200,\n\t\t\t\t\t57.5835,\n\t\t\t\t);\n\t\t\t\tPBXFileTableDataSourceColumnsKey = (\n\t\t\t\t\tPBXBookmarksDataSource_LocationID,\n\t\t\t\t\tPBXBookmarksDataSource_NameID,\n\t\t\t\t\tPBXBookmarksDataSource_CommentsID,\n\t\t\t\t);\n\t\t\t};\n\t\t\tPBXConfiguration.PBXFileTableDataSource3.PBXErrorsWarningsDataSource = {\n\t\t\t\tPBXFileTableDataSourceColumnSortingDirectionKey = \"-1\";\n\t\t\t\tPBXFileTableDataSourceColumnSortingKey = PBXErrorsWarningsDataSource_LocationID;\n\t\t\t\tPBXFileTableDataSourceColumnWidthsKey = (\n\t\t\t\t\t20,\n\t\t\t\t\t300,\n\t\t\t\t\t260,\n\t\t\t\t);\n\t\t\t\tPBXFileTableDataSourceColumnsKey = (\n\t\t\t\t\tPBXErrorsWarningsDataSource_TypeID,\n\t\t\t\t\tPBXErrorsWarningsDataSource_MessageID,\n\t\t\t\t\tPBXErrorsWarningsDataSource_LocationID,\n\t\t\t\t);\n\t\t\t};\n\t\t\tPBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = {\n\t\t\t\tPBXFileTableDataSourceColumnSortingDirectionKey = \"-1\";\n\t\t\t\tPBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID;\n\t\t\t\tPBXFileTableDataSourceColumnWidthsKey = (\n\t\t\t\t\t22,\n\t\t\t\t\t300,\n\t\t\t\t\t257,\n\t\t\t\t);\n\t\t\t\tPBXFileTableDataSourceColumnsKey = (\n\t\t\t\t\tPBXExecutablesDataSource_ActiveFlagID,\n\t\t\t\t\tPBXExecutablesDataSource_NameID,\n\t\t\t\t\tPBXExecutablesDataSource_CommentsID,\n\t\t\t\t);\n\t\t\t};\n\t\t\tPBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {\n\t\t\t\tPBXFileTableDataSourceColumnSortingDirectionKey = \"-1\";\n\t\t\t\tPBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;\n\t\t\t\tPBXFileTableDataSourceColumnWidthsKey = (\n\t\t\t\t\t20,\n\t\t\t\t\t546,\n\t\t\t\t\t20,\n\t\t\t\t\t48,\n\t\t\t\t\t43,\n\t\t\t\t\t43,\n\t\t\t\t\t20,\n\t\t\t\t);\n\t\t\t\tPBXFileTableDataSourceColumnsKey = (\n\t\t\t\t\tPBXFileDataSource_FiletypeID,\n\t\t\t\t\tPBXFileDataSource_Filename_ColumnID,\n\t\t\t\t\tPBXFileDataSource_Built_ColumnID,\n\t\t\t\t\tPBXFileDataSource_ObjectSize_ColumnID,\n\t\t\t\t\tPBXFileDataSource_Errors_ColumnID,\n\t\t\t\t\tPBXFileDataSource_Warnings_ColumnID,\n\t\t\t\t\tPBXFileDataSource_Target_ColumnID,\n\t\t\t\t);\n\t\t\t};\n\t\t\tPBXConfiguration.PBXFileTableDataSource3.PBXFindDataSource = {\n\t\t\t\tPBXFileTableDataSourceColumnSortingDirectionKey = \"-1\";\n\t\t\t\tPBXFileTableDataSourceColumnSortingKey = PBXFindDataSource_LocationID;\n\t\t\t\tPBXFileTableDataSourceColumnWidthsKey = (\n\t\t\t\t\t200,\n\t\t\t\t\t120,\n\t\t\t\t);\n\t\t\t\tPBXFileTableDataSourceColumnsKey = (\n\t\t\t\t\tPBXFindDataSource_MessageID,\n\t\t\t\t\tPBXFindDataSource_LocationID,\n\t\t\t\t);\n\t\t\t};\n\t\t\tPBXConfiguration.PBXFileTableDataSource3.PBXSymbolsDataSource = {\n\t\t\t\tPBXFileTableDataSourceColumnSortingDirectionKey = \"-1\";\n\t\t\t\tPBXFileTableDataSourceColumnSortingKey = PBXSymbolsDataSource_SymbolNameID;\n\t\t\t\tPBXFileTableDataSourceColumnWidthsKey = (\n\t\t\t\t\t16,\n\t\t\t\t\t200,\n\t\t\t\t\t50,\n\t\t\t\t\t183,\n\t\t\t\t);\n\t\t\t\tPBXFileTableDataSourceColumnsKey = (\n\t\t\t\t\tPBXSymbolsDataSource_SymbolTypeIconID,\n\t\t\t\t\tPBXSymbolsDataSource_SymbolNameID,\n\t\t\t\t\tPBXSymbolsDataSource_SymbolTypeID,\n\t\t\t\t\tPBXSymbolsDataSource_ReferenceNameID,\n\t\t\t\t);\n\t\t\t};\n\t\t\tPBXConfiguration.PBXFileTableDataSource3.XCSCMDataSource = {\n\t\t\t\tPBXFileTableDataSourceColumnSortingDirectionKey = \"-1\";\n\t\t\t\tPBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;\n\t\t\t\tPBXFileTableDataSourceColumnWidthsKey = (\n\t\t\t\t\t20,\n\t\t\t\t\t20,\n\t\t\t\t\t121,\n\t\t\t\t\t20,\n\t\t\t\t\t48,\n\t\t\t\t\t43,\n\t\t\t\t\t43,\n\t\t\t\t\t20,\n\t\t\t\t);\n\t\t\t\tPBXFileTableDataSourceColumnsKey = (\n\t\t\t\t\tPBXFileDataSource_SCM_ColumnID,\n\t\t\t\t\tPBXFileDataSource_FiletypeID,\n\t\t\t\t\tPBXFileDataSource_Filename_ColumnID,\n\t\t\t\t\tPBXFileDataSource_Built_ColumnID,\n\t\t\t\t\tPBXFileDataSource_ObjectSize_ColumnID,\n\t\t\t\t\tPBXFileDataSource_Errors_ColumnID,\n\t\t\t\t\tPBXFileDataSource_Warnings_ColumnID,\n\t\t\t\t\tPBXFileDataSource_Target_ColumnID,\n\t\t\t\t);\n\t\t\t};\n\t\t\tPBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = {\n\t\t\t\tPBXFileTableDataSourceColumnSortingDirectionKey = \"-1\";\n\t\t\t\tPBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;\n\t\t\t\tPBXFileTableDataSourceColumnWidthsKey = (\n\t\t\t\t\t20,\n\t\t\t\t\t200,\n\t\t\t\t\t366,\n\t\t\t\t\t20,\n\t\t\t\t\t48,\n\t\t\t\t\t43,\n\t\t\t\t\t43,\n\t\t\t\t);\n\t\t\t\tPBXFileTableDataSourceColumnsKey = (\n\t\t\t\t\tPBXFileDataSource_FiletypeID,\n\t\t\t\t\tPBXFileDataSource_Filename_ColumnID,\n\t\t\t\t\tPBXTargetDataSource_PrimaryAttribute,\n\t\t\t\t\tPBXFileDataSource_Built_ColumnID,\n\t\t\t\t\tPBXFileDataSource_ObjectSize_ColumnID,\n\t\t\t\t\tPBXFileDataSource_Errors_ColumnID,\n\t\t\t\t\tPBXFileDataSource_Warnings_ColumnID,\n\t\t\t\t);\n\t\t\t};\n\t\t\tPBXPerProjectTemplateStateSaveDate = 208340943;\n\t\t\tPBXWorkspaceStateSaveDate = 208340943;\n\t\t};\n\t\tperUserProjectItems = {\n\t\t\t840034DB0BCD16CB00D03C1B /* PBXTextBookmark */ = 840034DB0BCD16CB00D03C1B /* PBXTextBookmark */;\n\t\t\t8400BEAE0B612C7C00FB16B3 /* PBXTextBookmark */ = 8400BEAE0B612C7C00FB16B3 /* PBXTextBookmark */;\n\t\t\t8418426EC5B04BFC00DC27BC /* PBXTextBookmark */ = 8418426EC5B04BFC00DC27BC /* PBXTextBookmark */;\n\t\t\t84184270C5B04BFC00DC27BC /* PBXTextBookmark */ = 84184270C5B04BFC00DC27BC /* PBXTextBookmark */;\n\t\t\t841842B1C5B0606800DC27BC /* PBXTextBookmark */ = 841842B1C5B0606800DC27BC /* PBXTextBookmark */;\n\t\t\t8420DD240BD394E900937A80 /* PBXTextBookmark */ = 8420DD240BD394E900937A80 /* PBXTextBookmark */;\n\t\t\t84239D390BB2A1BA00C28522 /* PBXTextBookmark */ = 84239D390BB2A1BA00C28522 /* PBXTextBookmark */;\n\t\t\t84239D3C0BB2A1BA00C28522 /* PBXTextBookmark */ = 84239D3C0BB2A1BA00C28522 /* PBXTextBookmark */;\n\t\t\t8428A4450B984D8900F257E1 /* PBXTextBookmark */ = 8428A4450B984D8900F257E1 /* PBXTextBookmark */;\n\t\t\t843C1D500C3F94EB000BB087 /* PBXTextBookmark */ = 843C1D500C3F94EB000BB087 /* PBXTextBookmark */;\n\t\t\t84409C610BCE2D4700A7BC33 /* PBXTextBookmark */ = 84409C610BCE2D4700A7BC33 /* PBXTextBookmark */;\n\t\t\t84464D2F0C3A520F00064760 /* PBXTextBookmark */ = 84464D2F0C3A520F00064760 /* PBXTextBookmark */;\n\t\t\t84464D330C3A520F00064760 /* PBXTextBookmark */ = 84464D330C3A520F00064760 /* PBXTextBookmark */;\n\t\t\t84464D4C0C3A523400064760 /* PBXTextBookmark */ = 84464D4C0C3A523400064760 /* PBXTextBookmark */;\n\t\t\t84464E470C3A8F4900064760 /* PBXTextBookmark */ = 84464E470C3A8F4900064760 /* PBXTextBookmark */;\n\t\t\t844D2C290C31125500A71AF3 /* PBXTextBookmark */ = 844D2C290C31125500A71AF3 /* PBXTextBookmark */;\n\t\t\t8456E4D00B4C1D20006B7550 /* PBXTextBookmark */ = 8456E4D00B4C1D20006B7550 /* PBXTextBookmark */;\n\t\t\t8456E4D20B4C1D20006B7550 /* PBXTextBookmark */ = 8456E4D20B4C1D20006B7550 /* PBXTextBookmark */;\n\t\t\t8456E4D70B4C1D20006B7550 /* PBXTextBookmark */ = 8456E4D70B4C1D20006B7550 /* PBXTextBookmark */;\n\t\t\t8456E4D90B4C1D20006B7550 /* PBXTextBookmark */ = 8456E4D90B4C1D20006B7550 /* PBXTextBookmark */;\n\t\t\t8456E5290B4C22C7006B7550 /* PBXTextBookmark */ = 8456E5290B4C22C7006B7550 /* PBXTextBookmark */;\n\t\t\t8456E52D0B4C22C7006B7550 /* PBXTextBookmark */ = 8456E52D0B4C22C7006B7550 /* PBXTextBookmark */;\n\t\t\t8456E7040B4D0EC2006B7550 /* PBXTextBookmark */ = 8456E7040B4D0EC2006B7550 /* PBXTextBookmark */;\n\t\t\t8456E7060B4D0EC2006B7550 /* PBXTextBookmark */ = 8456E7060B4D0EC2006B7550 /* PBXTextBookmark */;\n\t\t\t8456E7080B4D0EC2006B7550 /* PBXTextBookmark */ = 8456E7080B4D0EC2006B7550 /* PBXTextBookmark */;\n\t\t\t8456E70A0B4D0EC2006B7550 /* PBXTextBookmark */ = 8456E70A0B4D0EC2006B7550 /* PBXTextBookmark */;\n\t\t\t8456E70C0B4D0EC2006B7550 /* PBXTextBookmark */ = 8456E70C0B4D0EC2006B7550 /* PBXTextBookmark */;\n\t\t\t8456E71A0B4D0EC2006B7550 /* PBXTextBookmark */ = 8456E71A0B4D0EC2006B7550 /* PBXTextBookmark */;\n\t\t\t8456E71C0B4D0EC2006B7550 /* PBXTextBookmark */ = 8456E71C0B4D0EC2006B7550 /* PBXTextBookmark */;\n\t\t\t8456E71E0B4D0EC2006B7550 /* PBXTextBookmark */ = 8456E71E0B4D0EC2006B7550 /* PBXTextBookmark */;\n\t\t\t8456E71F0B4D0EC2006B7550 /* PBXTextBookmark */ = 8456E71F0B4D0EC2006B7550 /* PBXTextBookmark */;\n\t\t\t8456E7200B4D0EC2006B7550 /* PBXTextBookmark */ = 8456E7200B4D0EC2006B7550 /* PBXTextBookmark */;\n\t\t\t8456E7210B4D0EC2006B7550 /* PBXTextBookmark */ = 8456E7210B4D0EC2006B7550 /* PBXTextBookmark */;\n\t\t\t8456E7230B4D0EC2006B7550 /* PBXTextBookmark */ = 8456E7230B4D0EC2006B7550 /* PBXTextBookmark */;\n\t\t\t8456E7250B4D0EC2006B7550 /* PBXTextBookmark */ = 8456E7250B4D0EC2006B7550 /* PBXTextBookmark */;\n\t\t\t8456E7270B4D0EC2006B7550 /* PBXTextBookmark */ = 8456E7270B4D0EC2006B7550 /* PBXTextBookmark */;\n\t\t\t8456E7290B4D0EC2006B7550 /* PBXTextBookmark */ = 8456E7290B4D0EC2006B7550 /* PBXTextBookmark */;\n\t\t\t8456E72B0B4D0EC2006B7550 /* PBXTextBookmark */ = 8456E72B0B4D0EC2006B7550 /* PBXTextBookmark */;\n\t\t\t8456E72D0B4D0EC2006B7550 /* PBXTextBookmark */ = 8456E72D0B4D0EC2006B7550 /* PBXTextBookmark */;\n\t\t\t8456E86F0B4E88C3006B7550 /* PBXTextBookmark */ = 8456E86F0B4E88C3006B7550 /* PBXTextBookmark */;\n\t\t\t8456E8700B4E88C3006B7550 /* PBXTextBookmark */ = 8456E8700B4E88C3006B7550 /* PBXTextBookmark */;\n\t\t\t8456E8710B4E88C3006B7550 /* PBXTextBookmark */ = 8456E8710B4E88C3006B7550 /* PBXTextBookmark */;\n\t\t\t8456E8720B4E88C3006B7550 /* PBXTextBookmark */ = 8456E8720B4E88C3006B7550 /* PBXTextBookmark */;\n\t\t\t8456E8730B4E88C3006B7550 /* PBXTextBookmark */ = 8456E8730B4E88C3006B7550 /* PBXTextBookmark */;\n\t\t\t8456E8740B4E88C3006B7550 /* PBXTextBookmark */ = 8456E8740B4E88C3006B7550 /* PBXTextBookmark */;\n\t\t\t8456E8750B4E88C3006B7550 /* PBXTextBookmark */ = 8456E8750B4E88C3006B7550 /* PBXTextBookmark */;\n\t\t\t8456E8770B4E88C3006B7550 /* PBXTextBookmark */ = 8456E8770B4E88C3006B7550 /* PBXTextBookmark */;\n\t\t\t8456E87B0B4E88C3006B7550 /* PBXTextBookmark */ = 8456E87B0B4E88C3006B7550 /* PBXTextBookmark */;\n\t\t\t8456E87C0B4E88C3006B7550 /* PBXTextBookmark */ = 8456E87C0B4E88C3006B7550 /* PBXTextBookmark */;\n\t\t\t8456E87D0B4E88C3006B7550 /* PBXTextBookmark */ = 8456E87D0B4E88C3006B7550 /* PBXTextBookmark */;\n\t\t\t8456E9090B4E956F006B7550 /* PBXTextBookmark */ = 8456E9090B4E956F006B7550 /* PBXTextBookmark */;\n\t\t\t8456E90A0B4E956F006B7550 /* PBXTextBookmark */ = 8456E90A0B4E956F006B7550 /* PBXTextBookmark */;\n\t\t\t8456E95E0B4EA7D1006B7550 /* PBXTextBookmark */ = 8456E95E0B4EA7D1006B7550 /* PBXTextBookmark */;\n\t\t\t8460E80A0B8469BA009E0CB5 /* PBXTextBookmark */ = 8460E80A0B8469BA009E0CB5 /* PBXTextBookmark */;\n\t\t\t8460E80B0B8469BA009E0CB5 /* PBXTextBookmark */ = 8460E80B0B8469BA009E0CB5 /* PBXTextBookmark */;\n\t\t\t847EA4B40BDDEC2B005AC757 /* PBXTextBookmark */ = 847EA4B40BDDEC2B005AC757 /* PBXTextBookmark */;\n\t\t\t847EA4B60BDDEC2B005AC757 /* PBXTextBookmark */ = 847EA4B60BDDEC2B005AC757 /* PBXTextBookmark */;\n\t\t\t847EA4FB0BDDF714005AC757 /* PBXTextBookmark */ = 847EA4FB0BDDF714005AC757 /* PBXTextBookmark */;\n\t\t\t847EA4FC0BDDF714005AC757 /* PBXTextBookmark */ = 847EA4FC0BDDF714005AC757 /* PBXTextBookmark */;\n\t\t\t847EA4FD0BDDF714005AC757 /* PBXTextBookmark */ = 847EA4FD0BDDF714005AC757 /* PBXTextBookmark */;\n\t\t\t8487D8910C6B307D006BDD7C /* PBXBookmark */ = 8487D8910C6B307D006BDD7C /* PBXBookmark */;\n\t\t\t8487D8A10C6B37E3006BDD7C /* PBXTextBookmark */ = 8487D8A10C6B37E3006BDD7C /* PBXTextBookmark */;\n\t\t\t8487D8A20C6B37E3006BDD7C /* PBXTextBookmark */ = 8487D8A20C6B37E3006BDD7C /* PBXTextBookmark */;\n\t\t\t8487D8A30C6B37E3006BDD7C /* PBXTextBookmark */ = 8487D8A30C6B37E3006BDD7C /* PBXTextBookmark */;\n\t\t\t8487D8A40C6B37E3006BDD7C /* PBXTextBookmark */ = 8487D8A40C6B37E3006BDD7C /* PBXTextBookmark */;\n\t\t\t8487D8A50C6B37E3006BDD7C /* PBXTextBookmark */ = 8487D8A50C6B37E3006BDD7C /* PBXTextBookmark */;\n\t\t\t8487D8A90C6B37E3006BDD7C /* PBXTextBookmark */ = 8487D8A90C6B37E3006BDD7C /* PBXTextBookmark */;\n\t\t\t8487D8AA0C6B37E3006BDD7C /* PBXTextBookmark */ = 8487D8AA0C6B37E3006BDD7C /* PBXTextBookmark */;\n\t\t\t8487D8AB0C6B37E3006BDD7C /* PBXTextBookmark */ = 8487D8AB0C6B37E3006BDD7C /* PBXTextBookmark */;\n\t\t\t8487D8AC0C6B37E3006BDD7C /* PBXTextBookmark */ = 8487D8AC0C6B37E3006BDD7C /* PBXTextBookmark */;\n\t\t\t8487D8B30C6B3851006BDD7C /* PBXTextBookmark */ = 8487D8B30C6B3851006BDD7C /* PBXTextBookmark */;\n\t\t\t8487D8B40C6B3851006BDD7C /* PBXTextBookmark */ = 8487D8B40C6B3851006BDD7C /* PBXTextBookmark */;\n\t\t\t848C41450B84919C00BD11B3 /* PBXTextBookmark */ = 848C41450B84919C00BD11B3 /* PBXTextBookmark */;\n\t\t\t848C41470B84919C00BD11B3 /* PBXTextBookmark */ = 848C41470B84919C00BD11B3 /* PBXTextBookmark */;\n\t\t\t848C414C0B84919C00BD11B3 /* PBXTextBookmark */ = 848C414C0B84919C00BD11B3 /* PBXTextBookmark */;\n\t\t\t848C414D0B84919C00BD11B3 /* PBXTextBookmark */ = 848C414D0B84919C00BD11B3 /* PBXTextBookmark */;\n\t\t\t848C416E0B84946E00BD11B3 /* PBXTextBookmark */ = 848C416E0B84946E00BD11B3 /* PBXTextBookmark */;\n\t\t\t848C41AE0B84A77400BD11B3 /* PBXTextBookmark */ = 848C41AE0B84A77400BD11B3 /* PBXTextBookmark */;\n\t\t\t848C424C0B84C97700BD11B3 /* PBXTextBookmark */ = 848C424C0B84C97700BD11B3 /* PBXTextBookmark */;\n\t\t\t848C42570B84C97700BD11B3 /* PBXTextBookmark */ = 848C42570B84C97700BD11B3 /* PBXTextBookmark */;\n\t\t\t848C42580B84C97700BD11B3 /* PBXTextBookmark */ = 848C42580B84C97700BD11B3 /* PBXTextBookmark */;\n\t\t\t848C42590B84C97700BD11B3 /* PBXTextBookmark */ = 848C42590B84C97700BD11B3 /* PBXTextBookmark */;\n\t\t\t848C425B0B84C97700BD11B3 /* PBXTextBookmark */ = 848C425B0B84C97700BD11B3 /* PBXTextBookmark */;\n\t\t\t8491B6BD0C44CB2B00E4B477 /* PBXTextBookmark */ = 8491B6BD0C44CB2B00E4B477 /* PBXTextBookmark */;\n\t\t\t849C6785C5B0469200F11330 /* PBXTextBookmark */ = 849C6785C5B0469200F11330 /* PBXTextBookmark */;\n\t\t\t849C6787C5B0469200F11330 /* PBXTextBookmark */ = 849C6787C5B0469200F11330 /* PBXTextBookmark */;\n\t\t\t849C6788C5B0469200F11330 /* PBXTextBookmark */ = 849C6788C5B0469200F11330 /* PBXTextBookmark */;\n\t\t\t849C6797C5B0469200F11330 /* PBXTextBookmark */ = 849C6797C5B0469200F11330 /* PBXTextBookmark */;\n\t\t\t849C6798C5B0469200F11330 /* PBXTextBookmark */ = 849C6798C5B0469200F11330 /* PBXTextBookmark */;\n\t\t\t84A37A52C5B0A121003069A5 /* PBXTextBookmark */ = 84A37A52C5B0A121003069A5 /* PBXTextBookmark */;\n\t\t\t84AF08E40B98819600B348CB /* PBXTextBookmark */ = 84AF08E40B98819600B348CB /* PBXTextBookmark */;\n\t\t\t84AF08E60B98819600B348CB /* PBXTextBookmark */ = 84AF08E60B98819600B348CB /* PBXTextBookmark */;\n\t\t\t84AF48B20BCCD4FB00C5BF0A /* PBXTextBookmark */ = 84AF48B20BCCD4FB00C5BF0A /* PBXTextBookmark */;\n\t\t\t84AFF17D0B8C87E400D93058 /* PBXTextBookmark */ = 84AFF17D0B8C87E400D93058 /* PBXTextBookmark */;\n\t\t\t84AFF17F0B8C87E400D93058 /* PBXTextBookmark */ = 84AFF17F0B8C87E400D93058 /* PBXTextBookmark */;\n\t\t\t84AFF1850B8C87E400D93058 /* PBXTextBookmark */ = 84AFF1850B8C87E400D93058 /* PBXTextBookmark */;\n\t\t\t84AFF1890B8C87E400D93058 /* PBXTextBookmark */ = 84AFF1890B8C87E400D93058 /* PBXTextBookmark */;\n\t\t\t84AFF18A0B8C87E400D93058 /* PBXTextBookmark */ = 84AFF18A0B8C87E400D93058 /* PBXTextBookmark */;\n\t\t\t84AFF18D0B8C87E400D93058 /* PBXTextBookmark */ = 84AFF18D0B8C87E400D93058 /* PBXTextBookmark */;\n\t\t\t84AFF1B20B8C89CC00D93058 /* PBXTextBookmark */ = 84AFF1B20B8C89CC00D93058 /* PBXTextBookmark */;\n\t\t\t84B0A8140B96D8B400B60726 /* PBXTextBookmark */ = 84B0A8140B96D8B400B60726 /* PBXTextBookmark */;\n\t\t\t84B0A81D0B96D8B400B60726 /* PBXTextBookmark */ = 84B0A81D0B96D8B400B60726 /* PBXTextBookmark */;\n\t\t\t84B0A9360B9707B000B60726 /* PBXTextBookmark */ = 84B0A9360B9707B000B60726 /* PBXTextBookmark */;\n\t\t\t84B0AB400B973C9E00B60726 /* PBXTextBookmark */ = 84B0AB400B973C9E00B60726 /* PBXTextBookmark */;\n\t\t\t84B18DB40BCF7EEF005360E0 /* PBXTextBookmark */ = 84B18DB40BCF7EEF005360E0 /* PBXTextBookmark */;\n\t\t\t84B1AF9F0B94350200D477E7 /* PBXTextBookmark */ = 84B1AF9F0B94350200D477E7 /* PBXTextBookmark */;\n\t\t\t84B1AFA50B94350200D477E7 /* PBXTextBookmark */ = 84B1AFA50B94350200D477E7 /* PBXTextBookmark */;\n\t\t\t84B1AFA80B94350200D477E7 /* PBXTextBookmark */ = 84B1AFA80B94350200D477E7 /* PBXTextBookmark */;\n\t\t\t84B1B0070B9465A300D477E7 /* PBXTextBookmark */ = 84B1B0070B9465A300D477E7 /* PBXTextBookmark */;\n\t\t\t84BC71A90B959EDF00BFC169 /* PBXTextBookmark */ = 84BC71A90B959EDF00BFC169 /* PBXTextBookmark */;\n\t\t\t84BC71AA0B959EDF00BFC169 /* PBXTextBookmark */ = 84BC71AA0B959EDF00BFC169 /* PBXTextBookmark */;\n\t\t\t84BC71AB0B959EDF00BFC169 /* PBXTextBookmark */ = 84BC71AB0B959EDF00BFC169 /* PBXTextBookmark */;\n\t\t\t84BC71AD0B959EDF00BFC169 /* PBXTextBookmark */ = 84BC71AD0B959EDF00BFC169 /* PBXTextBookmark */;\n\t\t\t84BC71AE0B959EDF00BFC169 /* PBXTextBookmark */ = 84BC71AE0B959EDF00BFC169 /* PBXTextBookmark */;\n\t\t\t84BC71B00B959EDF00BFC169 /* PBXTextBookmark */ = 84BC71B00B959EDF00BFC169 /* PBXTextBookmark */;\n\t\t\t84BC71BE0B959EDF00BFC169 /* PBXTextBookmark */ = 84BC71BE0B959EDF00BFC169 /* PBXTextBookmark */;\n\t\t\t84BC71BF0B959EDF00BFC169 /* PBXTextBookmark */ = 84BC71BF0B959EDF00BFC169 /* PBXTextBookmark */;\n\t\t\t84BC71C30B959EDF00BFC169 /* PBXTextBookmark */ = 84BC71C30B959EDF00BFC169 /* PBXTextBookmark */;\n\t\t\t84BC71C50B959EDF00BFC169 /* PBXTextBookmark */ = 84BC71C50B959EDF00BFC169 /* PBXTextBookmark */;\n\t\t\t84BC71CB0B959EDF00BFC169 /* PBXTextBookmark */ = 84BC71CB0B959EDF00BFC169 /* PBXTextBookmark */;\n\t\t\t84BC71CC0B959EDF00BFC169 /* PBXTextBookmark */ = 84BC71CC0B959EDF00BFC169 /* PBXTextBookmark */;\n\t\t\t84BC721F0B95BC1100BFC169 /* PBXTextBookmark */ = 84BC721F0B95BC1100BFC169 /* PBXTextBookmark */;\n\t\t\t84BC72210B95BC1100BFC169 /* PBXTextBookmark */ = 84BC72210B95BC1100BFC169 /* PBXTextBookmark */;\n\t\t\t84BC730F0B95D09000BFC169 /* PBXTextBookmark */ = 84BC730F0B95D09000BFC169 /* PBXTextBookmark */;\n\t\t\t84BC73980B95F0D000BFC169 /* PBXTextBookmark */ = 84BC73980B95F0D000BFC169 /* PBXTextBookmark */;\n\t\t\t84BC74FA0B9604DE00BFC169 /* PBXTextBookmark */ = 84BC74FA0B9604DE00BFC169 /* PBXTextBookmark */;\n\t\t\t84BC74FF0B9604DE00BFC169 /* PBXTextBookmark */ = 84BC74FF0B9604DE00BFC169 /* PBXTextBookmark */;\n\t\t\t84BC75800B9610B400BFC169 /* PBXTextBookmark */ = 84BC75800B9610B400BFC169 /* PBXTextBookmark */;\n\t\t\t84BC75900B9610B400BFC169 /* PBXTextBookmark */ = 84BC75900B9610B400BFC169 /* PBXTextBookmark */;\n\t\t\t84BE28730BCD2B780086E6B3 /* PBXTextBookmark */ = 84BE28730BCD2B780086E6B3 /* PBXTextBookmark */;\n\t\t\t84BE444E0B9D67F2007EF582 /* PBXTextBookmark */ = 84BE444E0B9D67F2007EF582 /* PBXTextBookmark */;\n\t\t\t84BE44970B9D6EE7007EF582 /* PBXTextBookmark */ = 84BE44970B9D6EE7007EF582 /* PBXTextBookmark */;\n\t\t\t84BF70560BC3D30900AB75ED /* PBXTextBookmark */ = 84BF70560BC3D30900AB75ED /* PBXTextBookmark */;\n\t\t\t84BF70BE0BC3DAC200AB75ED /* PBXTextBookmark */ = 84BF70BE0BC3DAC200AB75ED /* PBXTextBookmark */;\n\t\t\t84C5A4370B67B31C00A596C5 /* PBXTextBookmark */ = 84C5A4370B67B31C00A596C5 /* PBXTextBookmark */;\n\t\t\t84C86843C5B077FA0013D2B1 /* PBXTextBookmark */ = 84C86843C5B077FA0013D2B1 /* PBXTextBookmark */;\n\t\t\t84C86844C5B077FA0013D2B1 /* PBXTextBookmark */ = 84C86844C5B077FA0013D2B1 /* PBXTextBookmark */;\n\t\t\t84D448D60B8EE46C008F9D1F /* PBXTextBookmark */ = 84D448D60B8EE46C008F9D1F /* PBXTextBookmark */;\n\t\t\t84D44A870B8F44B4008F9D1F /* PBXTextBookmark */ = 84D44A870B8F44B4008F9D1F /* PBXTextBookmark */;\n\t\t\t84D4FA460B5CCFFB0058AE41 /* PBXTextBookmark */ = 84D4FA460B5CCFFB0058AE41 /* PBXTextBookmark */;\n\t\t\t84D4FB3F0B5CFCE50058AE41 /* PBXTextBookmark */ = 84D4FB3F0B5CFCE50058AE41 /* PBXTextBookmark */;\n\t\t\t84D4FB5B0B5CFE640058AE41 /* PBXTextBookmark */ = 84D4FB5B0B5CFE640058AE41 /* PBXTextBookmark */;\n\t\t\t84D4FCA60B5D15890058AE41 /* PBXTextBookmark */ = 84D4FCA60B5D15890058AE41 /* PBXTextBookmark */;\n\t\t\t84D4FCA70B5D15890058AE41 /* PBXTextBookmark */ = 84D4FCA70B5D15890058AE41 /* PBXTextBookmark */;\n\t\t\t84D4FE540B5D2A960058AE41 /* PBXTextBookmark */ = 84D4FE540B5D2A960058AE41 /* PBXTextBookmark */;\n\t\t\t84D5200B0B5E19C10050DE52 /* PBXTextBookmark */ = 84D5200B0B5E19C10050DE52 /* PBXTextBookmark */;\n\t\t\t84D520E40B5E2C1A0050DE52 /* PBXTextBookmark */ = 84D520E40B5E2C1A0050DE52 /* PBXTextBookmark */;\n\t\t\t84D60AB30B5BB8EF00D9EBCB /* PBXTextBookmark */ = 84D60AB30B5BB8EF00D9EBCB /* PBXTextBookmark */;\n\t\t\t84D60AB40B5BB8EF00D9EBCB /* PBXTextBookmark */ = 84D60AB40B5BB8EF00D9EBCB /* PBXTextBookmark */;\n\t\t\t84D60ABD0B5BB8EF00D9EBCB /* PBXTextBookmark */ = 84D60ABD0B5BB8EF00D9EBCB /* PBXTextBookmark */;\n\t\t\t84D60AC10B5BB8EF00D9EBCB /* PBXTextBookmark */ = 84D60AC10B5BB8EF00D9EBCB /* PBXTextBookmark */;\n\t\t\t84D60AC30B5BB8EF00D9EBCB /* PBXTextBookmark */ = 84D60AC30B5BB8EF00D9EBCB /* PBXTextBookmark */;\n\t\t\t84D60AC40B5BB8EF00D9EBCB /* PBXTextBookmark */ = 84D60AC40B5BB8EF00D9EBCB /* PBXTextBookmark */;\n\t\t\t84D60AC90B5BB8EF00D9EBCB /* PBXTextBookmark */ = 84D60AC90B5BB8EF00D9EBCB /* PBXTextBookmark */;\n\t\t\t84D60ACC0B5BB8EF00D9EBCB /* PBXTextBookmark */ = 84D60ACC0B5BB8EF00D9EBCB /* PBXTextBookmark */;\n\t\t\t84D60B760B5BC12200D9EBCB /* PBXTextBookmark */ = 84D60B760B5BC12200D9EBCB /* PBXTextBookmark */;\n\t\t\t84D60B770B5BC12200D9EBCB /* PBXTextBookmark */ = 84D60B770B5BC12200D9EBCB /* PBXTextBookmark */;\n\t\t\t84D60BA40B5BC49500D9EBCB /* PBXTextBookmark */ = 84D60BA40B5BC49500D9EBCB /* PBXTextBookmark */;\n\t\t\t84D60BA50B5BC49500D9EBCB /* PBXTextBookmark */ = 84D60BA50B5BC49500D9EBCB /* PBXTextBookmark */;\n\t\t\t84D9EE150B53E20600C10970 /* PBXTextBookmark */ = 84D9EE150B53E20600C10970 /* PBXTextBookmark */;\n\t\t\t84D9EE770B53EC5D00C10970 /* PBXTextBookmark */ = 84D9EE770B53EC5D00C10970 /* PBXTextBookmark */;\n\t\t\t84DDE9750BB90B6B0074B26A /* PBXTextBookmark */ = 84DDE9750BB90B6B0074B26A /* PBXTextBookmark */;\n\t\t\t84DE1A860BCCE1DA0033A95C /* PBXTextBookmark */ = 84DE1A860BCCE1DA0033A95C /* PBXTextBookmark */;\n\t\t\t84DF556F0C3CC76F00AD2F4B /* PBXTextBookmark */ = 84DF556F0C3CC76F00AD2F4B /* PBXTextBookmark */;\n\t\t\t84DFC45E0B64BF8200858CAB /* PBXTextBookmark */ = 84DFC45E0B64BF8200858CAB /* PBXTextBookmark */;\n\t\t\t84DFC6550B64D26200858CAB /* PBXTextBookmark */ = 84DFC6550B64D26200858CAB /* PBXTextBookmark */;\n\t\t\t84DFC6580B64D26200858CAB /* PBXTextBookmark */ = 84DFC6580B64D26200858CAB /* PBXTextBookmark */;\n\t\t\t84E20C5D0C57AF7C004FB864 /* PBXTextBookmark */ = 84E20C5D0C57AF7C004FB864 /* PBXTextBookmark */;\n\t\t\t84E8F34C0B57B4DF001DACF7 /* PBXTextBookmark */ = 84E8F34C0B57B4DF001DACF7 /* PBXTextBookmark */;\n\t\t\t84E9145B0B564E2E009AD6FC /* PBXTextBookmark */ = 84E9145B0B564E2E009AD6FC /* PBXTextBookmark */;\n\t\t\t84E9145E0B564E2E009AD6FC /* PBXTextBookmark */ = 84E9145E0B564E2E009AD6FC /* PBXTextBookmark */;\n\t\t\t84F22A380B53D80F004CD709 /* PBXTextBookmark */ = 84F22A380B53D80F004CD709 /* PBXTextBookmark */;\n\t\t};\n\t\tsourceControlManager = 84DAA48E0B132F2900222618 /* Source Control */;\n\t\tuserBuildSettings = {\n\t\t\tOBJROOT = \"/Users/admin/Projects/VS 2.1/Echoware.build\";\n\t\t\tSYMROOT = \"/Users/admin/Projects/VS 2.1/Vine Server.app/Contents/Resources\";\n\t\t};\n\t};\n\t089C167EFE841241C02AAC07 /* English */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {658, 446}}\";\n\t\t\tsepNavSelRange = \"{127, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {658, 446}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 222}, {697, 519}}\";\n\t\t};\n\t};\n\t32DBCF630370AF2F00C91783 /* Echoware_Prefix.pch */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {574, 538}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {574, 538}}\";\n\t\t\tsepNavWindowFrame = \"{{38, 201}, {697, 519}}\";\n\t\t};\n\t};\n\t840034180BCD0E4900D03C1B /* RFBBundleWrapper.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 504}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{150, 107}, {864, 604}}\";\n\t\t};\n\t};\n\t840034190BCD0E4900D03C1B /* RFBBundleWrapper.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {788, 8372}}\";\n\t\t\tsepNavSelRange = \"{17275, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 5713}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{149, 106}, {864, 604}}\";\n\t\t};\n\t};\n\t840034DB0BCD16CB00D03C1B /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA2F0B60F36F00FB16B3 /* CritSection.cpp */;\n\t\tname = \"CritSection.cpp: 28\";\n\t\trLen = 0;\n\t\trLoc = 479;\n\t\trType = 0;\n\t\tvrLen = 482;\n\t\tvrLoc = 0;\n\t};\n\t8400B9DF0B60F36E00FB16B3 /* ACConnection.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {896, 9212}}\";\n\t\t\tsepNavSelRange = \"{17181, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 7112}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{259, 119}, {750, 558}}\";\n\t\t};\n\t};\n\t8400B9E00B60F36E00FB16B3 /* ACConnection.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {983, 1316}}\";\n\t\t\tsepNavSelRange = \"{1264, 7}\";\n\t\t\tsepNavVisRect = \"{{0, 507}, {983, 316}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 75}, {697, 671}}\";\n\t\t};\n\t};\n\t8400B9E10B60F36E00FB16B3 /* AES.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 1134}}\";\n\t\t\tsepNavSelRange = \"{92, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 666}, {744, 461}}\";\n\t\t};\n\t};\n\t8400B9E40B60F36E00FB16B3 /* APISocket.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 3248}}\";\n\t\t\tsepNavSelRange = \"{3376, 19}\";\n\t\t\tsepNavVisRect = \"{{0, 1835}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{167, 128}, {743, 543}}\";\n\t\t};\n\t};\n\t8400B9E50B60F36E00FB16B3 /* ClientSocket.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {983, 966}}\";\n\t\t\tsepNavSelRange = \"{336, 6}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {983, 316}}\";\n\t\t\tsepNavWindowFrame = \"{{167, 128}, {743, 543}}\";\n\t\t};\n\t};\n\t8400B9E60B60F36E00FB16B3 /* ServerSocket.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {983, 1330}}\";\n\t\t\tsepNavSelRange = \"{1557, 8}\";\n\t\t\tsepNavVisRect = \"{{0, 1014}, {983, 316}}\";\n\t\t\tsepNavWindowFrame = \"{{130, 93}, {743, 543}}\";\n\t\t};\n\t};\n\t8400B9E70B60F36E00FB16B3 /* Socket.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {866, 7742}}\";\n\t\t\tsepNavSelRange = \"{9004, 19}\";\n\t\t\tsepNavVisRect = \"{{0, 6553}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{112, 88}, {743, 543}}\";\n\t\t};\n\t};\n\t8400B9E80B60F36E00FB16B3 /* blowfish.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 3248}}\";\n\t\t\tsepNavSelRange = \"{2113, 5}\";\n\t\t\tsepNavVisRect = \"{{0, 533}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{249, 105}, {743, 543}}\";\n\t\t};\n\t};\n\t8400B9E90B60F36E00FB16B3 /* blowfish.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {704, 1204}}\";\n\t\t\tsepNavSelRange = \"{360, 31}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {704, 414}}\";\n\t\t\tsepNavWindowFrame = \"{{249, 105}, {743, 543}}\";\n\t\t};\n\t};\n\t8400BA2F0B60F36F00FB16B3 /* CritSection.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 461}}\";\n\t\t\tsepNavSelRange = \"{479, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 70}, {743, 671}}\";\n\t\t};\n\t};\n\t8400BA300B60F36F00FB16B3 /* CritSection.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 461}}\";\n\t\t\tsepNavSelRange = \"{158, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{98, 156}, {743, 543}}\";\n\t\t};\n\t};\n\t8400BA310B60F36F00FB16B3 /* DataChannel.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {884, 3374}}\";\n\t\t\tsepNavSelRange = \"{4444, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 2832}, {658, 542}}\";\n\t\t\tsepNavWindowFrame = \"{{306, 75}, {697, 671}}\";\n\t\t};\n\t};\n\t8400BA320B60F36F00FB16B3 /* DataChannel.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {983, 980}}\";\n\t\t\tsepNavSelRange = \"{557, 18}\";\n\t\t\tsepNavVisRect = \"{{0, 241}, {983, 316}}\";\n\t\t\tsepNavWindowFrame = \"{{306, 75}, {697, 671}}\";\n\t\t};\n\t};\n\t8400BA350B60F36F00FB16B3 /* DataChannels.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {824, 2954}}\";\n\t\t\tsepNavSelRange = \"{4092, 24}\";\n\t\t\tsepNavVisRect = \"{{0, 1}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{167, 128}, {743, 543}}\";\n\t\t};\n\t};\n\t8400BA360B60F36F00FB16B3 /* DataChannels.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {983, 980}}\";\n\t\t\tsepNavSelRange = \"{1113, 14}\";\n\t\t\tsepNavVisRect = \"{{0, 521}, {983, 316}}\";\n\t\t\tsepNavWindowFrame = \"{{343, 71}, {697, 671}}\";\n\t\t};\n\t};\n\t8400BA370B60F36F00FB16B3 /* DataChannelSocket.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 1092}}\";\n\t\t\tsepNavSelRange = \"{781, 44}\";\n\t\t\tsepNavVisRect = \"{{0, 393}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{306, 75}, {697, 671}}\";\n\t\t};\n\t};\n\t8400BA380B60F36F00FB16B3 /* DataChannelSocket.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 882}}\";\n\t\t\tsepNavSelRange = \"{187, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 70}, {743, 671}}\";\n\t\t};\n\t};\n\t8400BA390B60F36F00FB16B3 /* DllProxyInfo.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {980, 2310}}\";\n\t\t\tsepNavSelRange = \"{1820, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 627}, {746, 367}}\";\n\t\t\tsepNavWindowFrame = \"{{163, 75}, {697, 519}}\";\n\t\t};\n\t};\n\t8400BA3A0B60F36F00FB16B3 /* DllProxyInfo.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {746, 812}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {746, 367}}\";\n\t\t};\n\t};\n\t8400BA3B0B60F36F00FB16B3 /* EchoController.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {825, 1232}}\";\n\t\t\tsepNavSelRange = \"{185, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 620}, {825, 475}}\";\n\t\t\tsepNavWindowFrame = \"{{276, -4}, {864, 604}}\";\n\t\t};\n\t};\n\t8400BA3C0B60F36F00FB16B3 /* EchoController.m */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {824, 10276}}\";\n\t\t\tsepNavSelRange = \"{21478, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 9551}, {711, 429}}\";\n\t\t\tsepNavWindowFrame = \"{{84, 103}, {864, 604}}\";\n\t\t};\n\t};\n\t8400BA3D0B60F36F00FB16B3 /* EchoSrvDataChannel.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {818, 1806}}\";\n\t\t\tsepNavSelRange = \"{1057, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 378}, {711, 429}}\";\n\t\t\tsepNavWindowFrame = \"{{259, 119}, {750, 558}}\";\n\t\t};\n\t};\n\t8400BA3E0B60F36F00FB16B3 /* EchoSrvDataChannel.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {983, 714}}\";\n\t\t\tsepNavSelRange = \"{748, 8}\";\n\t\t\tsepNavVisRect = \"{{0, 325}, {983, 316}}\";\n\t\t\tsepNavWindowFrame = \"{{409, 75}, {743, 671}}\";\n\t\t};\n\t};\n\t8400BA3F0B60F36F00FB16B3 /* EchoToOSX.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {983, 1036}}\";\n\t\t\tsepNavSelRange = \"{1336, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 737}, {983, 244}}\";\n\t\t\tsepNavWindowFrame = \"{{447, 79}, {743, 543}}\";\n\t\t};\n\t};\n\t8400BA400B60F36F00FB16B3 /* EchoToOSX.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 1428}}\";\n\t\t\tsepNavSelRange = \"{1514, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 919}, {744, 429}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 70}, {739, 671}}\";\n\t\t};\n\t};\n\t8400BA410B60F36F00FB16B3 /* Echoware.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {983, 2954}}\";\n\t\t\tsepNavSelRange = \"{788, 4}\";\n\t\t\tsepNavVisRect = \"{{0, 311}, {983, 316}}\";\n\t\t\tsepNavWindowFrame = \"{{187, 31}, {864, 604}}\";\n\t\t};\n\t};\n\t8400BA440B60F36F00FB16B3 /* Echoware.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {810, 546}}\";\n\t\t\tsepNavSelRange = \"{263, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {810, 323}}\";\n\t\t\tsepNavWindowFrame = \"{{149, 106}, {864, 604}}\";\n\t\t};\n\t};\n\t8400BA4C0B60F36F00FB16B3 /* Echoware_Prefix.pch */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {746, 367}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {746, 367}}\";\n\t\t};\n\t};\n\t8400BA550B60F36F00FB16B3 /* Globals.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 1862}}\";\n\t\t\tsepNavSelRange = \"{2121, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 1309}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{84, 135}, {743, 543}}\";\n\t\t};\n\t};\n\t8400BA560B60F36F00FB16B3 /* Globals.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {711, 2352}}\";\n\t\t\tsepNavSelRange = \"{230, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 245}, {711, 429}}\";\n\t\t\tsepNavWindowFrame = \"{{61, 156}, {743, 543}}\";\n\t\t};\n\t};\n\t8400BA580B60F36F00FB16B3 /* InterfaceDllProxyInfo.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 798}}\";\n\t\t\tsepNavSelRange = \"{295, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 126}, {744, 429}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 70}, {697, 671}}\";\n\t\t};\n\t};\n\t8400BA590B60F36F00FB16B3 /* LocalDataChannel.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {986, 2408}}\";\n\t\t\tsepNavSelRange = \"{747, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{306, 75}, {697, 671}}\";\n\t\t};\n\t};\n\t8400BA5A0B60F36F00FB16B3 /* LocalDataChannel.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {810, 560}}\";\n\t\t\tsepNavSelRange = \"{724, 32}\";\n\t\t\tsepNavVisRect = \"{{0, 237}, {810, 323}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 70}, {743, 671}}\";\n\t\t};\n\t};\n\t8400BA5B0B60F36F00FB16B3 /* LocalListener.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {933, 546}}\";\n\t\t\tsepNavSelRange = \"{423, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {933, 546}}\";\n\t\t\tsepNavWindowFrame = \"{{38, 45}, {972, 675}}\";\n\t\t};\n\t};\n\t8400BA5C0B60F36F00FB16B3 /* LocalListener.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {704, 542}}\";\n\t\t\tsepNavSelRange = \"{328, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {704, 542}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 70}, {743, 671}}\";\n\t\t};\n\t};\n\t8400BA5D0B60F36F00FB16B3 /* LocalProxyConnection.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {825, 475}}\";\n\t\t\tsepNavSelRange = \"{177, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {825, 475}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 137}, {864, 604}}\";\n\t\t};\n\t};\n\t8400BA5E0B60F36F00FB16B3 /* LocalProxyConnection.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavWindowFrame = \"{{15, 137}, {864, 604}}\";\n\t\t};\n\t};\n\t8400BA5F0B60F36F00FB16B3 /* Logger.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 1582}}\";\n\t\t\tsepNavSelRange = \"{408, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {744, 429}}\";\n\t\t\tsepNavWindowFrame = \"{{50, 188}, {750, 558}}\";\n\t\t};\n\t};\n\t8400BA600B60F36F00FB16B3 /* Logger.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 546}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 137}, {864, 604}}\";\n\t\t};\n\t};\n\t8400BA610B60F36F00FB16B3 /* MyDllProxyInfo.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 1596}}\";\n\t\t\tsepNavSelRange = \"{218, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 939}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{130, 93}, {743, 543}}\";\n\t\t};\n\t};\n\t8400BA620B60F36F00FB16B3 /* MyDllProxyInfo.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {851, 588}}\";\n\t\t\tsepNavSelRange = \"{272, 8}\";\n\t\t\tsepNavVisRect = \"{{0, 82}, {851, 506}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 106}, {890, 635}}\";\n\t\t};\n\t};\n\t8400BA630B60F36F00FB16B3 /* NetPacket.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavWindowFrame = \"{{15, 70}, {697, 671}}\";\n\t\t};\n\t};\n\t8400BA650B60F36F00FB16B3 /* aes.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {704, 1820}}\";\n\t\t\tsepNavSelRange = \"{2900, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 710}, {704, 470}}\";\n\t\t\tsepNavWindowFrame = \"{{38, 177}, {743, 543}}\";\n\t\t};\n\t};\n\t8400BA660B60F36F00FB16B3 /* aes_core.c */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {704, 17850}}\";\n\t\t\tsepNavSelRange = \"{42609, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 12316}, {704, 470}}\";\n\t\t\tsepNavWindowFrame = \"{{61, 156}, {743, 543}}\";\n\t\t};\n\t};\n\t8400BA6C0B60F36F00FB16B3 /* ProxiesManager.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {825, 4088}}\";\n\t\t\tsepNavSelRange = \"{2721, 10}\";\n\t\t\tsepNavVisRect = \"{{0, 1380}, {825, 475}}\";\n\t\t\tsepNavWindowFrame = \"{{150, 107}, {864, 604}}\";\n\t\t};\n\t};\n\t8400BA6D0B60F36F00FB16B3 /* ProxiesManager.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 1120}}\";\n\t\t\tsepNavSelRange = \"{205, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 70}, {743, 671}}\";\n\t\t};\n\t};\n\t8400BA720B60F36F00FB16B3 /* md5.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {746, 4858}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {746, 367}}\";\n\t\t};\n\t};\n\t8400BA750B60F36F00FB16B3 /* ntlmv2.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {983, 12180}}\";\n\t\t\tsepNavSelRange = \"{19225, 5}\";\n\t\t\tsepNavVisRect = \"{{0, 10833}, {983, 244}}\";\n\t\t};\n\t};\n\t8400BA760B60F36F00FB16B3 /* ProxyConnect.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {983, 14266}}\";\n\t\t\tsepNavSelRange = \"{5332, 5}\";\n\t\t\tsepNavVisRect = \"{{0, 3517}, {983, 316}}\";\n\t\t\tsepNavWindowFrame = \"{{183, 75}, {743, 671}}\";\n\t\t};\n\t};\n\t8400BA780B60F36F00FB16B3 /* ProxyConnect.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {746, 1414}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {746, 367}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 106}, {890, 635}}\";\n\t\t};\n\t};\n\t8400BA7B0B60F36F00FB16B3 /* stdafx.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {746, 367}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {746, 367}}\";\n\t\t};\n\t};\n\t8400BA7C0B60F36F00FB16B3 /* ProxyConnection.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {983, 2240}}\";\n\t\t\tsepNavSelRange = \"{3544, 24}\";\n\t\t\tsepNavVisRect = \"{{0, 1924}, {983, 316}}\";\n\t\t\tsepNavWindowFrame = \"{{255, 96}, {743, 543}}\";\n\t\t};\n\t};\n\t8400BA7D0B60F36F00FB16B3 /* ProxyConnection.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {746, 714}}\";\n\t\t\tsepNavSelRange = \"{185, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {746, 367}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 70}, {743, 671}}\";\n\t\t};\n\t};\n\t8400BA870B60F36F00FB16B3 /* Hnumber.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {807, 7434}}\";\n\t\t\tsepNavSelRange = \"{392, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 210}, {807, 239}}\";\n\t\t\tsepNavWindowFrame = \"{{61, 156}, {743, 543}}\";\n\t\t};\n\t};\n\t8400BA8A0B60F36F00FB16B3 /* Keys_main.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 462}}\";\n\t\t\tsepNavSelRange = \"{158, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {744, 461}}\";\n\t\t};\n\t};\n\t8400BA920B60F36F00FB16B3 /* PrimeGen.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {983, 3122}}\";\n\t\t\tsepNavSelRange = \"{1602, 4}\";\n\t\t\tsepNavVisRect = \"{{0, 1095}, {983, 316}}\";\n\t\t};\n\t};\n\t8400BA990B60F36F00FB16B3 /* RSAKeys.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {770, 2534}}\";\n\t\t\tsepNavSelRange = \"{3200, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 1571}, {744, 429}}\";\n\t\t\tsepNavWindowFrame = \"{{278, 149}, {743, 543}}\";\n\t\t};\n\t};\n\t8400BA9A0B60F36F00FB16B3 /* RSAKeys.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 700}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {744, 461}}\";\n\t\t};\n\t};\n\t8400BA9D0B60F36F00FB16B3 /* stdafx.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 429}}\";\n\t\t\tsepNavSelRange = \"{295, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {744, 429}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 137}, {864, 604}}\";\n\t\t};\n\t};\n\t8400BA9E0B60F36F00FB16B3 /* stdafx.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 429}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {744, 429}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 70}, {743, 671}}\";\n\t\t};\n\t};\n\t8400BAA00B60F36F00FB16B3 /* version.plist */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {825, 475}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {825, 475}}\";\n\t\t\tsepNavWindowFrame = \"{{149, 106}, {864, 604}}\";\n\t\t};\n\t};\n\t8400BEAE0B612C7C00FB16B3 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA560B60F36F00FB16B3 /* Globals.h */;\n\t\tname = \"Globals.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 551;\n\t\tvrLoc = 0;\n\t};\n\t8418426EC5B04BFC00DC27BC /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84AF48A40BCCD42400C5BF0A /* DirService.cpp */;\n\t\tname = \"DirService.cpp: 5\";\n\t\trLen = 0;\n\t\trLoc = 55;\n\t\trType = 0;\n\t\tvrLen = 463;\n\t\tvrLoc = 0;\n\t};\n\t84184270C5B04BFC00DC27BC /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84AF48A40BCCD42400C5BF0A /* DirService.cpp */;\n\t\tname = \"DirService.cpp: 5\";\n\t\trLen = 0;\n\t\trLoc = 55;\n\t\trType = 0;\n\t\tvrLen = 463;\n\t\tvrLoc = 0;\n\t};\n\t841842B1C5B0606800DC27BC /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400B9E70B60F36E00FB16B3 /* Socket.cpp */;\n\t\tname = \"Socket.cpp: 491\";\n\t\trLen = 0;\n\t\trLoc = 9285;\n\t\trType = 0;\n\t\tvrLen = 668;\n\t\tvrLoc = 8801;\n\t};\n\t8420DD240BD394E900937A80 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA380B60F36F00FB16B3 /* DataChannelSocket.h */;\n\t\tname = \"DataChannelSocket.h: 13\";\n\t\trLen = 0;\n\t\trLoc = 187;\n\t\trType = 0;\n\t\tvrLen = 761;\n\t\tvrLoc = 0;\n\t};\n\t84239D390BB2A1BA00C28522 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA5F0B60F36F00FB16B3 /* Logger.cpp */;\n\t\tname = \"Logger.cpp: 17\";\n\t\trLen = 0;\n\t\trLoc = 408;\n\t\trType = 0;\n\t\tvrLen = 597;\n\t\tvrLoc = 0;\n\t};\n\t84239D3C0BB2A1BA00C28522 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA9E0B60F36F00FB16B3 /* stdafx.h */;\n\t\tname = \"stdafx.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 173;\n\t\tvrLoc = 0;\n\t};\n\t8428A4450B984D8900F257E1 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA320B60F36F00FB16B3 /* DataChannel.h */;\n\t\tname = \"#include \\\"L\";\n\t\trLen = 12;\n\t\trLoc = 184;\n\t\trType = 0;\n\t\tvrLen = 606;\n\t\tvrLoc = 110;\n\t};\n\t843C1D500C3F94EB000BB087 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400B9E40B60F36E00FB16B3 /* APISocket.h */;\n\t\tname = \"atic unsigned long\";\n\t\trLen = 19;\n\t\trLoc = 3426;\n\t\trType = 0;\n\t\tvrLen = 648;\n\t\tvrLoc = 3105;\n\t};\n\t84409C610BCE2D4700A7BC33 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA6C0B60F36F00FB16B3 /* ProxiesManager.cpp */;\n\t\tname = \"ProxiesManager.cpp: 241\";\n\t\trLen = 0;\n\t\trLoc = 5615;\n\t\trType = 0;\n\t\tvrLen = 839;\n\t\tvrLoc = 5916;\n\t};\n\t84464D2F0C3A520F00064760 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA300B60F36F00FB16B3 /* CritSection.h */;\n\t\tname = \"CritSection.h: 12\";\n\t\trLen = 0;\n\t\trLoc = 158;\n\t\trType = 0;\n\t\tvrLen = 343;\n\t\tvrLoc = 0;\n\t};\n\t84464D330C3A520F00064760 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84AFF1410B8C841D00D93058 /* ServerListSynchronize.cpp */;\n\t\tname = \"ServerListSynchronize.cpp: 250\";\n\t\trLen = 0;\n\t\trLoc = 6209;\n\t\trType = 0;\n\t\tvrLen = 973;\n\t\tvrLoc = 6596;\n\t};\n\t84464D4C0C3A523400064760 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA3D0B60F36F00FB16B3 /* EchoSrvDataChannel.cpp */;\n\t\tname = \"EchoSrvDataChannel.cpp: 38\";\n\t\trLen = 0;\n\t\trLoc = 1104;\n\t\trType = 0;\n\t\tvrLen = 962;\n\t\tvrLoc = 0;\n\t};\n\t84464E470C3A8F4900064760 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA590B60F36F00FB16B3 /* LocalDataChannel.cpp */;\n\t\tname = \"LocalDataChannel.cpp: 32\";\n\t\trLen = 0;\n\t\trLoc = 747;\n\t\trType = 0;\n\t\tvrLen = 752;\n\t\tvrLoc = 0;\n\t};\n\t844D2C290C31125500A71AF3 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA350B60F36F00FB16B3 /* DataChannels.cpp */;\n\t\tname = GetPortForOffLoadingData;\n\t\trLen = 24;\n\t\trLoc = 4092;\n\t\trType = 0;\n\t\tvrLen = 824;\n\t\tvrLoc = 0;\n\t};\n\t8456E4D00B4C1D20006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E4D10B4C1D20006B7550 /* OSByteOrder.h */;\n\t\tname = \"(null): 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 869;\n\t\tvrLoc = 2963;\n\t};\n\t8456E4D10B4C1D20006B7550 /* OSByteOrder.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = OSByteOrder.h;\n\t\tpath = /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/libkern/ppc/OSByteOrder.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E4D20B4C1D20006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E4D30B4C1D20006B7550 /* OSByteOrder.h */;\n\t\tname = \"(null): 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 674;\n\t\tvrLoc = 2856;\n\t};\n\t8456E4D30B4C1D20006B7550 /* OSByteOrder.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = OSByteOrder.h;\n\t\tpath = /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/libkern/i386/OSByteOrder.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E4D70B4C1D20006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E4D80B4C1D20006B7550 /* OSByteOrder.h */;\n\t\tname = \"(null): 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1346;\n\t\tvrLoc = 0;\n\t};\n\t8456E4D80B4C1D20006B7550 /* OSByteOrder.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = OSByteOrder.h;\n\t\tpath = /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/libkern/i386/OSByteOrder.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E4D90B4C1D20006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E4DA0B4C1D20006B7550 /* OSByteOrder.h */;\n\t\tname = \"(null): 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 869;\n\t\tvrLoc = 2963;\n\t};\n\t8456E4DA0B4C1D20006B7550 /* OSByteOrder.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = OSByteOrder.h;\n\t\tpath = /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/libkern/ppc/OSByteOrder.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E5290B4C22C7006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E52A0B4C22C7006B7550 /* endian.h */;\n\t\tname = \"(null): 101\";\n\t\trLen = 0;\n\t\trLoc = 3927;\n\t\trType = 0;\n\t\tvrLen = 971;\n\t\tvrLoc = 3502;\n\t};\n\t8456E52A0B4C22C7006B7550 /* endian.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = endian.h;\n\t\tpath = /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/i386/endian.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E52D0B4C22C7006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E52E0B4C22C7006B7550 /* endian.h */;\n\t\tname = \"(null): 101\";\n\t\trLen = 0;\n\t\trLoc = 3927;\n\t\trType = 0;\n\t\tvrLen = 971;\n\t\tvrLoc = 3502;\n\t};\n\t8456E52E0B4C22C7006B7550 /* endian.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = endian.h;\n\t\tpath = /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/i386/endian.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E5570B4CFD3B006B7550 /* MacTypes.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = MacTypes.h;\n\t\tpath = /Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks/CoreServices.framework/Headers/../Frameworks/CarbonCore.framework/Headers/MacTypes.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E7040B4D0EC2006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E7050B4D0EC2006B7550 /* CoreFoundation.h */;\n\t\tname = \"(null): 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 775;\n\t\tvrLoc = 0;\n\t};\n\t8456E7050B4D0EC2006B7550 /* CoreFoundation.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CoreFoundation.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E7060B4D0EC2006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E7070B4D0EC2006B7550 /* CFXMLNode.h */;\n\t\tname = \"(null): 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1825;\n\t\tvrLoc = 0;\n\t};\n\t8456E7070B4D0EC2006B7550 /* CFXMLNode.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CFXMLNode.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLNode.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E7080B4D0EC2006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E7090B4D0EC2006B7550 /* CFTimeZone.h */;\n\t\tname = \"(null): 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 810;\n\t\tvrLoc = 0;\n\t};\n\t8456E7090B4D0EC2006B7550 /* CFTimeZone.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CFTimeZone.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E70A0B4D0EC2006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E70B0B4D0EC2006B7550 /* CFBag.h */;\n\t\tname = \"(null): 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1167;\n\t\tvrLoc = 0;\n\t};\n\t8456E70B0B4D0EC2006B7550 /* CFBag.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CFBag.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBag.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E70C0B4D0EC2006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E70D0B4D0EC2006B7550 /* CFBinaryHeap.h */;\n\t\tname = \"(null): 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1344;\n\t\tvrLoc = 0;\n\t};\n\t8456E70D0B4D0EC2006B7550 /* CFBinaryHeap.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CFBinaryHeap.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBinaryHeap.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E70F0B4D0EC2006B7550 /* CFData.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CFData.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E7110B4D0EC2006B7550 /* CFStream.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CFStream.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E7130B4D0EC2006B7550 /* CFRunLoop.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CFRunLoop.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CFRunLoop.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E7150B4D0EC2006B7550 /* CFPlugInCOM.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CFPlugInCOM.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CFPlugInCOM.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E7170B4D0EC2006B7550 /* CFNumberFormatter.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CFNumberFormatter.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumberFormatter.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E7190B4D0EC2006B7550 /* CFAttributedString.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CFAttributedString.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CFAttributedString.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E71A0B4D0EC2006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E71B0B4D0EC2006B7550 /* CFCalendar.h */;\n\t\tname = \"(null): 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1160;\n\t\tvrLoc = 0;\n\t};\n\t8456E71B0B4D0EC2006B7550 /* CFCalendar.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CFCalendar.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E71C0B4D0EC2006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E71D0B4D0EC2006B7550 /* CFMachPort.h */;\n\t\tname = \"(null): 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1463;\n\t\tvrLoc = 0;\n\t};\n\t8456E71D0B4D0EC2006B7550 /* CFMachPort.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CFMachPort.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CFMachPort.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E71E0B4D0EC2006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A6F09968B340046F588 /* NetPacket.h */;\n\t\tname = \"NetPacket.h: 66\";\n\t\trLen = 0;\n\t\trLoc = 1569;\n\t\trType = 0;\n\t\tvrLen = 1003;\n\t\tvrLoc = 0;\n\t};\n\t8456E71F0B4D0EC2006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A4E09968B340046F588 /* ACConnection.cpp */;\n\t\tname = \"ACConnection.cpp: 10\";\n\t\trLen = 0;\n\t\trLoc = 208;\n\t\trType = 0;\n\t\tvrLen = 905;\n\t\tvrLoc = 0;\n\t};\n\t8456E7200B4D0EC2006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E5570B4CFD3B006B7550 /* MacTypes.h */;\n\t\tname = \"TimeBase            base;                   /* reference to the time base */\";\n\t\trLen = 78;\n\t\trLoc = 20972;\n\t\trType = 0;\n\t\tvrLen = 1624;\n\t\tvrLoc = 20028;\n\t};\n\t8456E7210B4D0EC2006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 32DBCF630370AF2F00C91783 /* Echoware_Prefix.pch */;\n\t\tname = \"//\";\n\t\trLen = 3;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 148;\n\t\tvrLoc = 0;\n\t};\n\t8456E7230B4D0EC2006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E7240B4D0EC2006B7550 /* CoreFoundation.h */;\n\t\tname = \"(null): 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 775;\n\t\tvrLoc = 0;\n\t};\n\t8456E7240B4D0EC2006B7550 /* CoreFoundation.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CoreFoundation.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E7250B4D0EC2006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E7260B4D0EC2006B7550 /* CFXMLNode.h */;\n\t\tname = \"(null): 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1825;\n\t\tvrLoc = 0;\n\t};\n\t8456E7260B4D0EC2006B7550 /* CFXMLNode.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CFXMLNode.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLNode.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E7270B4D0EC2006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E7280B4D0EC2006B7550 /* CFTimeZone.h */;\n\t\tname = \"(null): 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 810;\n\t\tvrLoc = 0;\n\t};\n\t8456E7280B4D0EC2006B7550 /* CFTimeZone.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CFTimeZone.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E7290B4D0EC2006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E72A0B4D0EC2006B7550 /* CFBag.h */;\n\t\tname = \"(null): 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1167;\n\t\tvrLoc = 0;\n\t};\n\t8456E72A0B4D0EC2006B7550 /* CFBag.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CFBag.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBag.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E72B0B4D0EC2006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E72C0B4D0EC2006B7550 /* CFBinaryHeap.h */;\n\t\tname = \"(null): 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1344;\n\t\tvrLoc = 0;\n\t};\n\t8456E72C0B4D0EC2006B7550 /* CFBinaryHeap.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CFBinaryHeap.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBinaryHeap.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E72D0B4D0EC2006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E72E0B4D0EC2006B7550 /* CFCalendar.h */;\n\t\tname = \"(null): 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1160;\n\t\tvrLoc = 0;\n\t};\n\t8456E72E0B4D0EC2006B7550 /* CFCalendar.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CFCalendar.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E7BC0B4D1B38006B7550 /* libkern.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = libkern.h;\n\t\tpath = /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/libkern/libkern.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E86F0B4E88C3006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E5570B4CFD3B006B7550 /* MacTypes.h */;\n\t\tname = \"MacTypes.h: 504\";\n\t\trLen = 0;\n\t\trLoc = 21014;\n\t\trType = 0;\n\t\tvrLen = 1768;\n\t\tvrLoc = 19789;\n\t};\n\t8456E8700B4E88C3006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E7190B4D0EC2006B7550 /* CFAttributedString.h */;\n\t\tname = \"CFAttributedString.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1735;\n\t\tvrLoc = 24;\n\t};\n\t8456E8710B4E88C3006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E7170B4D0EC2006B7550 /* CFNumberFormatter.h */;\n\t\tname = \"CFNumberFormatter.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1215;\n\t\tvrLoc = 0;\n\t};\n\t8456E8720B4E88C3006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E7150B4D0EC2006B7550 /* CFPlugInCOM.h */;\n\t\tname = \"CFPlugInCOM.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1361;\n\t\tvrLoc = 0;\n\t};\n\t8456E8730B4E88C3006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E7130B4D0EC2006B7550 /* CFRunLoop.h */;\n\t\tname = \"CFRunLoop.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1941;\n\t\tvrLoc = 0;\n\t};\n\t8456E8740B4E88C3006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E7110B4D0EC2006B7550 /* CFStream.h */;\n\t\tname = \"CFStream.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1164;\n\t\tvrLoc = 0;\n\t};\n\t8456E8750B4E88C3006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E70F0B4D0EC2006B7550 /* CFData.h */;\n\t\tname = \"CFData.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1054;\n\t\tvrLoc = 0;\n\t};\n\t8456E8770B4E88C3006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E7BC0B4D1B38006B7550 /* libkern.h */;\n\t\tname = \"min(u_int a, u_int b)\";\n\t\trLen = 22;\n\t\trLoc = 3708;\n\t\trType = 0;\n\t\tvrLen = 2243;\n\t\tvrLoc = 524;\n\t};\n\t8456E87A0B4E88C3006B7550 /* CFByteOrder.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CFByteOrder.h;\n\t\tpath = /System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8456E87B0B4E88C3006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E70F0B4D0EC2006B7550 /* CFData.h */;\n\t\tname = \"CFData.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1054;\n\t\tvrLoc = 0;\n\t};\n\t8456E87C0B4E88C3006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A6309968B340046F588 /* Echoware.h */;\n\t\tname = \"Echoware.h: ConnectProxy\";\n\t\trLen = 0;\n\t\trLoc = 540;\n\t\trType = 0;\n\t\tvrLen = 959;\n\t\tvrLoc = 0;\n\t};\n\t8456E87D0B4E88C3006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E7BC0B4D1B38006B7550 /* libkern.h */;\n\t\tname = \"min(u_int a, u_int b)\";\n\t\trLen = 22;\n\t\trLoc = 3708;\n\t\trType = 0;\n\t\tvrLen = 2243;\n\t\tvrLoc = 524;\n\t};\n\t8456E9090B4E956F006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E87A0B4E88C3006B7550 /* CFByteOrder.h */;\n\t\tname = \"CFByteOrder.h: 23\";\n\t\trLen = 0;\n\t\trLoc = 516;\n\t\trType = 0;\n\t\tvrLen = 1042;\n\t\tvrLoc = 0;\n\t};\n\t8456E90A0B4E956F006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8456E87A0B4E88C3006B7550 /* CFByteOrder.h */;\n\t\tname = \"CFByteOrder.h: 23\";\n\t\trLen = 0;\n\t\trLoc = 516;\n\t\trType = 0;\n\t\tvrLen = 1042;\n\t\tvrLoc = 0;\n\t};\n\t8456E95E0B4EA7D1006B7550 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A6009968B340046F588 /* EchoSrvDataChannel.cpp */;\n\t\tname = \"EchoSrvDataChannel.cpp: 69\";\n\t\trLen = 0;\n\t\trLoc = 1778;\n\t\trType = 0;\n\t\tvrLen = 871;\n\t\tvrLoc = 1388;\n\t};\n\t8460E80A0B8469BA009E0CB5 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA600B60F36F00FB16B3 /* Logger.h */;\n\t\tname = \"Logger.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 544;\n\t\tvrLoc = 0;\n\t};\n\t8460E80B0B8469BA009E0CB5 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA5F0B60F36F00FB16B3 /* Logger.cpp */;\n\t\tname = \"Logger.cpp: CLogger\";\n\t\trLen = 0;\n\t\trLoc = 190;\n\t\trType = 0;\n\t\tvrLen = 533;\n\t\tvrLoc = 0;\n\t};\n\t847EA4B40BDDEC2B005AC757 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA600B60F36F00FB16B3 /* Logger.h */;\n\t\tname = \"Logger.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 724;\n\t\tvrLoc = 0;\n\t};\n\t847EA4B60BDDEC2B005AC757 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA410B60F36F00FB16B3 /* Echoware.cpp */;\n\t\tname = \"Echoware.cpp: 14\";\n\t\trLen = 0;\n\t\trLoc = 380;\n\t\trType = 0;\n\t\tvrLen = 721;\n\t\tvrLoc = 203;\n\t};\n\t847EA4FB0BDDF714005AC757 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA560B60F36F00FB16B3 /* Globals.h */;\n\t\tname = \"Globals.h: 15\";\n\t\trLen = 0;\n\t\trLoc = 230;\n\t\trType = 0;\n\t\tvrLen = 648;\n\t\tvrLoc = 0;\n\t};\n\t847EA4FC0BDDF714005AC757 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA440B60F36F00FB16B3 /* Echoware.h */;\n\t\tname = \"Echoware.h: EnableLogging\";\n\t\trLen = 0;\n\t\trLoc = 263;\n\t\trType = 0;\n\t\tvrLen = 1050;\n\t\tvrLoc = 0;\n\t};\n\t847EA4FD0BDDF714005AC757 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84AFF1400B8C841D00D93058 /* ServerListSynchronize.h */;\n\t\tname = \"ServerListSynchronize.h: 41\";\n\t\trLen = 0;\n\t\trLoc = 775;\n\t\trType = 0;\n\t\tvrLen = 788;\n\t\tvrLoc = 519;\n\t};\n\t8480D0BC0B5F8D200030E8C0 /* Vine Server 2.1 */ = {\n\t\tisa = PBXExecutable;\n\t\tactiveArgIndex = 2147483647;\n\t\tactiveArgIndices = (\n\t\t);\n\t\targumentStrings = (\n\t\t);\n\t\tautoAttachOnCrash = 1;\n\t\tconfigStateDict = {\n\t\t};\n\t\tcustomDataFormattersEnabled = 1;\n\t\tdebuggerPlugin = GDBDebugging;\n\t\tdisassemblyDisplayState = 0;\n\t\tdylibVariantSuffix = \"\";\n\t\tenableDebugStr = 1;\n\t\tenvironmentEntries = (\n\t\t);\n\t\texecutableSystemSymbolLevel = 0;\n\t\texecutableUserSymbolLevel = 0;\n\t\tlaunchableReference = 8480D0BD0B5F8D200030E8C0 /* Vine Server.app */;\n\t\tlibgmallocEnabled = 0;\n\t\tname = \"Vine Server 2.1\";\n\t\tsavedGlobals = {\n\t\t};\n\t\tsourceDirectories = (\n\t\t);\n\t\tvariableFormatDictionary = {\n\t\t\t$cs = 1;\n\t\t\t$ds = 1;\n\t\t\t$eax = 1;\n\t\t\t$ebp = 1;\n\t\t\t$ebx = 1;\n\t\t\t$ecx = 1;\n\t\t\t$edi = 1;\n\t\t\t$edx = 1;\n\t\t\t$eflags = 1;\n\t\t\t$eip = 1;\n\t\t\t$es = 1;\n\t\t\t$esi = 1;\n\t\t\t$esp = 1;\n\t\t\t$gs = 1;\n\t\t\t$mm0 = 1;\n\t\t\t$mm1 = 1;\n\t\t\t$mm2 = 1;\n\t\t\t$mm3 = 1;\n\t\t\t$mm4 = 1;\n\t\t\t$mm5 = 1;\n\t\t\t$mm6 = 1;\n\t\t\t$mm7 = 1;\n\t\t\t$mxcsr = 1;\n\t\t\t$ss = 1;\n\t\t\t$xmm0 = 1;\n\t\t\t$xmm1 = 1;\n\t\t\t$xmm2 = 1;\n\t\t\t$xmm3 = 1;\n\t\t\t$xmm4 = 1;\n\t\t\t$xmm5 = 1;\n\t\t\t$xmm6 = 1;\n\t\t\t$xmm7 = 1;\n\t\t};\n\t};\n\t8480D0BD0B5F8D200030E8C0 /* Vine Server.app */ = {\n\t\tisa = PBXFileReference;\n\t\texplicitFileType = wrapper.application;\n\t\tname = \"Vine Server.app\";\n\t\tpath = \"/Users/admin/Projects/VS 2.1/Vine Server.app\";\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t8487D8910C6B307D006BDD7C /* PBXBookmark */ = {\n\t\tisa = PBXBookmark;\n\t\tfRef = 8400BA3C0B60F36F00FB16B3 /* EchoController.m */;\n\t};\n\t8487D8A10C6B37E3006BDD7C /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA550B60F36F00FB16B3 /* Globals.cpp */;\n\t\tname = \"Globals.cpp: 111\";\n\t\trLen = 0;\n\t\trLoc = 2121;\n\t\trType = 0;\n\t\tvrLen = 946;\n\t\tvrLoc = 1684;\n\t};\n\t8487D8A20C6B37E3006BDD7C /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400B9DF0B60F36E00FB16B3 /* ACConnection.cpp */;\n\t\tname = \"ACConnection.cpp: 550\";\n\t\trLen = 0;\n\t\trLoc = 17181;\n\t\trType = 0;\n\t\tvrLen = 1002;\n\t\tvrLoc = 15841;\n\t};\n\t8487D8A30C6B37E3006BDD7C /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tcomments = \"error: expected ',' or ';' before 'if'\";\n\t\tfRef = 8400BA3C0B60F36F00FB16B3 /* EchoController.m */;\n\t\trLen = 1;\n\t\trLoc = 710;\n\t\trType = 1;\n\t};\n\t8487D8A40C6B37E3006BDD7C /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA550B60F36F00FB16B3 /* Globals.cpp */;\n\t\tname = \"Globals.cpp: 111\";\n\t\trLen = 0;\n\t\trLoc = 2121;\n\t\trType = 0;\n\t\tvrLen = 946;\n\t\tvrLoc = 1684;\n\t};\n\t8487D8A50C6B37E3006BDD7C /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400B9DF0B60F36E00FB16B3 /* ACConnection.cpp */;\n\t\tname = \"ACConnection.cpp: 550\";\n\t\trLen = 0;\n\t\trLoc = 17181;\n\t\trType = 0;\n\t\tvrLen = 1002;\n\t\tvrLoc = 15841;\n\t};\n\t8487D8A90C6B37E3006BDD7C /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA3D0B60F36F00FB16B3 /* EchoSrvDataChannel.cpp */;\n\t\tname = \"EchoSrvDataChannel.cpp: 37\";\n\t\trLen = 0;\n\t\trLoc = 1057;\n\t\trType = 0;\n\t\tvrLen = 853;\n\t\tvrLoc = 760;\n\t};\n\t8487D8AA0C6B37E3006BDD7C /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400B9DF0B60F36E00FB16B3 /* ACConnection.cpp */;\n\t\tname = \"ACConnection.cpp: 345\";\n\t\trLen = 0;\n\t\trLoc = 10364;\n\t\trType = 0;\n\t\tvrLen = 1173;\n\t\tvrLoc = 9811;\n\t};\n\t8487D8AB0C6B37E3006BDD7C /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA3D0B60F36F00FB16B3 /* EchoSrvDataChannel.cpp */;\n\t\tname = \"EchoSrvDataChannel.cpp: 37\";\n\t\trLen = 0;\n\t\trLoc = 1057;\n\t\trType = 0;\n\t\tvrLen = 853;\n\t\tvrLoc = 760;\n\t};\n\t8487D8AC0C6B37E3006BDD7C /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400B9DF0B60F36E00FB16B3 /* ACConnection.cpp */;\n\t\tname = \"ACConnection.cpp: 345\";\n\t\trLen = 0;\n\t\trLoc = 10364;\n\t\trType = 0;\n\t\tvrLen = 1173;\n\t\tvrLoc = 9811;\n\t};\n\t8487D8B30C6B3851006BDD7C /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA3C0B60F36F00FB16B3 /* EchoController.m */;\n\t\tname = \"EchoController.m: 381\";\n\t\trLen = 0;\n\t\trLoc = 11082;\n\t\trType = 0;\n\t\tvrLen = 1105;\n\t\tvrLoc = 11010;\n\t};\n\t8487D8B40C6B3851006BDD7C /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA3C0B60F36F00FB16B3 /* EchoController.m */;\n\t\tname = \"EchoController.m: 714\";\n\t\trLen = 0;\n\t\trLoc = 21478;\n\t\trType = 0;\n\t\tvrLen = 1148;\n\t\tvrLoc = 20315;\n\t};\n\t848C411E0B848FDC00BD11B3 /* rfbserver.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {810, 630}}\";\n\t\t\tsepNavSelRange = \"{272, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 57}, {810, 323}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 70}, {739, 671}}\";\n\t\t};\n\t};\n\t848C411F0B848FDC00BD11B3 /* rfbserver.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {746, 367}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {746, 367}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 70}, {739, 671}}\";\n\t\t};\n\t};\n\t848C41450B84919C00BD11B3 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 848C411F0B848FDC00BD11B3 /* rfbserver.cpp */;\n\t\tname = \"rfbserver.cpp: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 161;\n\t\tvrLoc = 0;\n\t};\n\t848C41470B84919C00BD11B3 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA310B60F36F00FB16B3 /* DataChannel.cpp */;\n\t\tname = \"DataChannel.cpp: 129\";\n\t\trLen = 0;\n\t\trLoc = 3338;\n\t\trType = 0;\n\t\tvrLen = 866;\n\t\tvrLoc = 3315;\n\t};\n\t848C414C0B84919C00BD11B3 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 848C411E0B848FDC00BD11B3 /* rfbserver.h */;\n\t\tname = \"rfbserver.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 488;\n\t\tvrLoc = 0;\n\t};\n\t848C414D0B84919C00BD11B3 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 848C411F0B848FDC00BD11B3 /* rfbserver.cpp */;\n\t\tname = \"rfbserver.cpp: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 161;\n\t\tvrLoc = 0;\n\t};\n\t848C416E0B84946E00BD11B3 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 848C411E0B848FDC00BD11B3 /* rfbserver.h */;\n\t\tname = \"CGKeyCode *keyTable;\";\n\t\trLen = 25;\n\t\trLoc = 709;\n\t\trType = 0;\n\t\tvrLen = 469;\n\t\tvrLoc = 339;\n\t};\n\t848C41AE0B84A77400BD11B3 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA320B60F36F00FB16B3 /* DataChannel.h */;\n\t\tname = \"DataChannel.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 551;\n\t\tvrLoc = 0;\n\t};\n\t848C424C0B84C97700BD11B3 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A6C09968B340046F588 /* LocalProxyConnection.h */;\n\t\tname = \"LocalProxyConnection.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 274;\n\t\tvrLoc = 0;\n\t};\n\t848C42570B84C97700BD11B3 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A6709968B340046F588 /* LocalDataChannel.cpp */;\n\t\tname = \"LocalDataChannel.cpp: ~CLocalDataChannel\";\n\t\trLen = 0;\n\t\trLoc = 406;\n\t\trType = 0;\n\t\tvrLen = 522;\n\t\tvrLoc = 3026;\n\t};\n\t848C42580B84C97700BD11B3 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A6809968B340046F588 /* LocalDataChannel.h */;\n\t\tname = \"LocalDataChannel.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 573;\n\t\tvrLoc = 0;\n\t};\n\t848C42590B84C97700BD11B3 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A6C09968B340046F588 /* LocalProxyConnection.h */;\n\t\tname = \"LocalProxyConnection.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 274;\n\t\tvrLoc = 0;\n\t};\n\t848C425B0B84C97700BD11B3 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400B9E50B60F36E00FB16B3 /* ClientSocket.cpp */;\n\t\tname = \"ClientSocket.cpp: 178\";\n\t\trLen = 0;\n\t\trLoc = 1383;\n\t\trType = 0;\n\t\tvrLen = 0;\n\t\tvrLoc = 1331;\n\t};\n\t8491B6BD0C44CB2B00E4B477 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400B9E70B60F36E00FB16B3 /* Socket.cpp */;\n\t\tname = \"m_csAsync.Lock();\";\n\t\trLen = 19;\n\t\trLoc = 9004;\n\t\trType = 0;\n\t\tvrLen = 726;\n\t\tvrLoc = 8689;\n\t};\n\t849C6785C5B0469200F11330 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA560B60F36F00FB16B3 /* Globals.h */;\n\t\tname = \"Globals.h: 15\";\n\t\trLen = 0;\n\t\trLoc = 230;\n\t\trType = 0;\n\t\tvrLen = 640;\n\t\tvrLoc = 311;\n\t};\n\t849C6787C5B0469200F11330 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400B9DF0B60F36E00FB16B3 /* ACConnection.cpp */;\n\t\tname = \"ACConnection.cpp: 352\";\n\t\trLen = 0;\n\t\trLoc = 10666;\n\t\trType = 0;\n\t\tvrLen = 1011;\n\t\tvrLoc = 9996;\n\t};\n\t849C6788C5B0469200F11330 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA560B60F36F00FB16B3 /* Globals.h */;\n\t\tname = \"Globals.h: 15\";\n\t\trLen = 0;\n\t\trLoc = 230;\n\t\trType = 0;\n\t\tvrLen = 640;\n\t\tvrLoc = 311;\n\t};\n\t849C6797C5B0469200F11330 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 840034190BCD0E4900D03C1B /* RFBBundleWrapper.cpp */;\n\t\tname = \"RFBBundleWrapper.cpp: 425\";\n\t\trLen = 0;\n\t\trLoc = 17275;\n\t\trType = 0;\n\t\tvrLen = 1389;\n\t\tvrLoc = 16529;\n\t};\n\t849C6798C5B0469200F11330 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 840034190BCD0E4900D03C1B /* RFBBundleWrapper.cpp */;\n\t\tname = \"RFBBundleWrapper.cpp: 425\";\n\t\trLen = 0;\n\t\trLoc = 17275;\n\t\trType = 0;\n\t\tvrLen = 1389;\n\t\tvrLoc = 16529;\n\t};\n\t84A37A52C5B0A121003069A5 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400B9E80B60F36E00FB16B3 /* blowfish.cpp */;\n\t\tname = PArr;\n\t\trLen = 5;\n\t\trLoc = 2113;\n\t\trType = 0;\n\t\tvrLen = 934;\n\t\tvrLoc = 948;\n\t};\n\t84AF08E40B98819600B348CB /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400B9E50B60F36E00FB16B3 /* ClientSocket.cpp */;\n\t\tname = \"ClientSocket.cpp: 48\";\n\t\trLen = 0;\n\t\trLoc = 979;\n\t\trType = 0;\n\t\tvrLen = 675;\n\t\tvrLoc = 708;\n\t};\n\t84AF08E60B98819600B348CB /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400B9E00B60F36E00FB16B3 /* ACConnection.h */;\n\t\tname = \"ACConnection.h: 19\";\n\t\trLen = 0;\n\t\trLoc = 310;\n\t\trType = 0;\n\t\tvrLen = 552;\n\t\tvrLoc = 0;\n\t};\n\t84AF48A30BCCD42400C5BF0A /* DirService.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {691, 546}}\";\n\t\t\tsepNavSelRange = \"{207, 18}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {691, 435}}\";\n\t\t\tsepNavWindowFrame = \"{{174, 42}, {864, 703}}\";\n\t\t};\n\t};\n\t84AF48A40BCCD42400C5BF0A /* DirService.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {1124, 5950}}\";\n\t\t\tsepNavSelRange = \"{55, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{78, 42}, {864, 703}}\";\n\t\t};\n\t};\n\t84AF48B20BCCD4FB00C5BF0A /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84AF48A30BCCD42400C5BF0A /* DirService.h */;\n\t\tname = \"DirService.h: 5\";\n\t\trLen = 0;\n\t\trLoc = 46;\n\t\trType = 0;\n\t\tvrLen = 164;\n\t\tvrLoc = 0;\n\t};\n\t84AF49000BCCD76E00C5BF0A /* User.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 630}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{170, 142}, {864, 604}}\";\n\t\t};\n\t};\n\t84AF49010BCCD76E00C5BF0A /* User.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {1028, 1862}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{102, 43}, {864, 703}}\";\n\t\t};\n\t};\n\t84AFF1400B8C841D00D93058 /* ServerListSynchronize.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {744, 840}}\";\n\t\t\tsepNavSelRange = \"{775, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 379}, {744, 461}}\";\n\t\t\tsepNavWindowFrame = \"{{150, 107}, {864, 604}}\";\n\t\t};\n\t};\n\t84AFF1410B8C841D00D93058 /* ServerListSynchronize.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {842, 5348}}\";\n\t\t\tsepNavSelRange = \"{8843, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 4678}, {711, 429}}\";\n\t\t\tsepNavWindowFrame = \"{{306, 75}, {697, 671}}\";\n\t\t};\n\t};\n\t84AFF17D0B8C87E400D93058 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA570B60F36F00FB16B3 /* Info.plist */;\n\t\tname = \"Info.plist: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 718;\n\t\tvrLoc = 0;\n\t};\n\t84AFF17F0B8C87E400D93058 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA3A0B60F36F00FB16B3 /* DllProxyInfo.h */;\n\t\tname = \"DllProxyInfo.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 518;\n\t\tvrLoc = 0;\n\t};\n\t84AFF1850B8C87E400D93058 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400B9E40B60F36E00FB16B3 /* APISocket.h */;\n\t\tname = StopSend;\n\t\trLen = 8;\n\t\trLoc = 3858;\n\t\trType = 0;\n\t\tvrLen = 551;\n\t\tvrLoc = 3590;\n\t};\n\t84AFF1890B8C87E400D93058 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA570B60F36F00FB16B3 /* Info.plist */;\n\t\tname = \"Info.plist: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 718;\n\t\tvrLoc = 0;\n\t};\n\t84AFF18A0B8C87E400D93058 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84AFF1400B8C841D00D93058 /* ServerListSynchronize.h */;\n\t\tname = \"ServerListSynchronize.h: 11\";\n\t\trLen = 0;\n\t\trLoc = 174;\n\t\trType = 0;\n\t\tvrLen = 583;\n\t\tvrLoc = 0;\n\t};\n\t84AFF18D0B8C87E400D93058 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84AFF1410B8C841D00D93058 /* ServerListSynchronize.cpp */;\n\t\tname = \"ServerListSynchronize.cpp: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 600;\n\t\tvrLoc = 0;\n\t};\n\t84AFF1B20B8C89CC00D93058 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA4C0B60F36F00FB16B3 /* Echoware_Prefix.pch */;\n\t\tname = \"Echoware_Prefix.pch: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 148;\n\t\tvrLoc = 0;\n\t};\n\t84B0A8140B96D8B400B60726 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400B9EA0B60F36E00FB16B3 /* blowfish.h2 */;\n\t\tname = \"blowfish.h2: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1230;\n\t\tvrLoc = 0;\n\t};\n\t84B0A81D0B96D8B400B60726 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400B9EA0B60F36E00FB16B3 /* blowfish.h2 */;\n\t\tname = \"blowfish.h2: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1230;\n\t\tvrLoc = 0;\n\t};\n\t84B0A9360B9707B000B60726 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA7D0B60F36F00FB16B3 /* ProxyConnection.h */;\n\t\tname = \"ProxyConnection.h: 14\";\n\t\trLen = 0;\n\t\trLoc = 185;\n\t\trType = 0;\n\t\tvrLen = 480;\n\t\tvrLoc = 0;\n\t};\n\t84B0AB400B973C9E00B60726 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA760B60F36F00FB16B3 /* ProxyConnect.cpp */;\n\t\tname = \"ProxyConnect.cpp: 206\";\n\t\trLen = 0;\n\t\trLoc = 4183;\n\t\trType = 0;\n\t\tvrLen = 399;\n\t\tvrLoc = 4019;\n\t};\n\t84B18DB40BCF7EEF005360E0 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA7C0B60F36F00FB16B3 /* ProxyConnection.cpp */;\n\t\tname = \"ProxyConnection.cpp: 26\";\n\t\trLen = 0;\n\t\trLoc = 517;\n\t\trType = 0;\n\t\tvrLen = 920;\n\t\tvrLoc = 2710;\n\t};\n\t84B1AF9F0B94350200D477E7 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA5A0B60F36F00FB16B3 /* LocalDataChannel.h */;\n\t\tname = \"LocalDataChannel.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 573;\n\t\tvrLoc = 0;\n\t};\n\t84B1AFA50B94350200D477E7 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA370B60F36F00FB16B3 /* DataChannelSocket.cpp */;\n\t\tname = \"DataChannelSocket.cpp: 68\";\n\t\trLen = 0;\n\t\trLoc = 1322;\n\t\trType = 0;\n\t\tvrLen = 581;\n\t\tvrLoc = 978;\n\t};\n\t84B1AFA80B94350200D477E7 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA380B60F36F00FB16B3 /* DataChannelSocket.h */;\n\t\tname = \"DataChannelSocket.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 614;\n\t\tvrLoc = 0;\n\t};\n\t84B1B0070B9465A300D477E7 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA9E0B60F36F00FB16B3 /* stdafx.h */;\n\t\tname = \"stdafx.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 173;\n\t\tvrLoc = 0;\n\t};\n\t84BC718E0B959CCB00BFC169 /* OpenTransportProviders.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = OpenTransportProviders.h;\n\t\tpath = /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/OpenTransportProviders.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t84BC71A90B959EDF00BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA7B0B60F36F00FB16B3 /* stdafx.h */;\n\t\tname = \"stdafx.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 330;\n\t\tvrLoc = 0;\n\t};\n\t84BC71AA0B959EDF00BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA780B60F36F00FB16B3 /* ProxyConnect.h */;\n\t\tname = \"ProxyConnect.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 579;\n\t\tvrLoc = 0;\n\t};\n\t84BC71AB0B959EDF00BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA770B60F36F00FB16B3 /* ProxyConnect.dsp */;\n\t\tname = \"ProxyConnect.dsp: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1009;\n\t\tvrLoc = 0;\n\t};\n\t84BC71AD0B959EDF00BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA720B60F36F00FB16B3 /* md5.cpp */;\n\t\tname = \"md5.cpp: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 996;\n\t\tvrLoc = 0;\n\t};\n\t84BC71AE0B959EDF00BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84D520B90B5E27CD0050DE52 /* NSObjCRuntime.h */;\n\t\tname = \"@class NSString;\";\n\t\trLen = 17;\n\t\trLoc = 1535;\n\t\trType = 0;\n\t\tvrLen = 1062;\n\t\tvrLoc = 1134;\n\t};\n\t84BC71B00B959EDF00BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84BC718E0B959CCB00BFC169 /* OpenTransportProviders.h */;\n\t\tname = \"TCP_NODELAY                   = 0x01,\";\n\t\trLen = 40;\n\t\trLoc = 2260;\n\t\trType = 0;\n\t\tvrLen = 931;\n\t\tvrLoc = 2059;\n\t};\n\t84BC71BE0B959EDF00BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA780B60F36F00FB16B3 /* ProxyConnect.h */;\n\t\tname = \"ProxyConnect.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 579;\n\t\tvrLoc = 0;\n\t};\n\t84BC71BF0B959EDF00BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA7B0B60F36F00FB16B3 /* stdafx.h */;\n\t\tname = \"stdafx.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 330;\n\t\tvrLoc = 0;\n\t};\n\t84BC71C30B959EDF00BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA770B60F36F00FB16B3 /* ProxyConnect.dsp */;\n\t\tname = \"ProxyConnect.dsp: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1009;\n\t\tvrLoc = 0;\n\t};\n\t84BC71C50B959EDF00BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA720B60F36F00FB16B3 /* md5.cpp */;\n\t\tname = \"md5.cpp: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 996;\n\t\tvrLoc = 0;\n\t};\n\t84BC71CB0B959EDF00BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA300B60F36F00FB16B3 /* CritSection.h */;\n\t\tname = \"CritSection.h: 8\";\n\t\trLen = 0;\n\t\trLoc = 89;\n\t\trType = 0;\n\t\tvrLen = 343;\n\t\tvrLoc = 0;\n\t};\n\t84BC71CC0B959EDF00BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84BC718E0B959CCB00BFC169 /* OpenTransportProviders.h */;\n\t\tname = \"TCP_NODELAY                   = 0x01,\";\n\t\trLen = 40;\n\t\trLoc = 2260;\n\t\trType = 0;\n\t\tvrLen = 931;\n\t\tvrLoc = 2059;\n\t};\n\t84BC71E40B95A00F00BFC169 /* CFRunLoop.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = CFRunLoop.h;\n\t\tpath = /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFRunLoop.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t84BC721F0B95BC1100BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84BC71E40B95A00F00BFC169 /* CFRunLoop.h */;\n\t\tname = \"CFRunLoop.h: 344\";\n\t\trLen = 0;\n\t\trLoc = 13964;\n\t\trType = 0;\n\t\tvrLen = 951;\n\t\tvrLoc = 13650;\n\t};\n\t84BC72210B95BC1100BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84BC71E40B95A00F00BFC169 /* CFRunLoop.h */;\n\t\tname = \"CFRunLoop.h: 344\";\n\t\trLen = 0;\n\t\trLoc = 13964;\n\t\trType = 0;\n\t\tvrLen = 951;\n\t\tvrLoc = 13650;\n\t};\n\t84BC730F0B95D09000BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400B9E60B60F36E00FB16B3 /* ServerSocket.cpp */;\n\t\tname = \"ServerSocket.cpp: 25\";\n\t\trLen = 0;\n\t\trLoc = 403;\n\t\trType = 0;\n\t\tvrLen = 561;\n\t\tvrLoc = 880;\n\t};\n\t84BC73980B95F0D000BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA390B60F36F00FB16B3 /* DllProxyInfo.cpp */;\n\t\tname = \"DllProxyInfo.cpp: 92\";\n\t\trLen = 0;\n\t\trLoc = 1820;\n\t\trType = 0;\n\t\tvrLen = 500;\n\t\tvrLoc = 801;\n\t};\n\t84BC744A0B95FDC800BFC169 /* limits */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.cpp.h;\n\t\tname = limits;\n\t\tpath = \"/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/limits\";\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t84BC74FA0B9604DE00BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84BC744A0B95FDC800BFC169 /* limits */;\n\t\tname = \"static _Tp min() throw() { return static_cast<_Tp>(0); }\";\n\t\trLen = 63;\n\t\trLoc = 10942;\n\t\trType = 0;\n\t\tvrLen = 1390;\n\t\tvrLoc = 10448;\n\t};\n\t84BC74FF0B9604DE00BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84BC744A0B95FDC800BFC169 /* limits */;\n\t\tname = \"static _Tp min() throw() { return static_cast<_Tp>(0); }\";\n\t\trLen = 63;\n\t\trLoc = 10942;\n\t\trType = 0;\n\t\tvrLen = 1390;\n\t\tvrLoc = 10448;\n\t};\n\t84BC75800B9610B400BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA360B60F36F00FB16B3 /* DataChannels.h */;\n\t\tname = \"DataChannels.h: 49\";\n\t\trLen = 0;\n\t\trLoc = 1214;\n\t\trType = 0;\n\t\tvrLen = 643;\n\t\tvrLoc = 1007;\n\t};\n\t84BC75900B9610B400BFC169 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA7D0B60F36F00FB16B3 /* ProxyConnection.h */;\n\t\tname = \"ProxyConnection.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 506;\n\t\tvrLoc = 0;\n\t};\n\t84BE28730BCD2B780086E6B3 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA6D0B60F36F00FB16B3 /* ProxiesManager.h */;\n\t\tname = \"ProxiesManager.h: 13\";\n\t\trLen = 0;\n\t\trLoc = 205;\n\t\trType = 0;\n\t\tvrLen = 775;\n\t\tvrLoc = 0;\n\t};\n\t84BE444E0B9D67F2007EF582 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA580B60F36F00FB16B3 /* InterfaceDllProxyInfo.h */;\n\t\tname = \"InterfaceDllProxyInfo.h: STATUS_AUTHENTICATING\";\n\t\trLen = 0;\n\t\trLoc = 295;\n\t\trType = 0;\n\t\tvrLen = 813;\n\t\tvrLoc = 135;\n\t};\n\t84BE44970B9D6EE7007EF582 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA990B60F36F00FB16B3 /* RSAKeys.cpp */;\n\t\tname = \"RSAKeys.cpp: 135\";\n\t\trLen = 0;\n\t\trLoc = 3200;\n\t\trType = 0;\n\t\tvrLen = 775;\n\t\tvrLoc = 2653;\n\t};\n\t84BF70560BC3D30900AB75ED /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA3E0B60F36F00FB16B3 /* EchoSrvDataChannel.h */;\n\t\tname = \"EchoSrvDataChannel.h: 30\";\n\t\trLen = 0;\n\t\trLoc = 685;\n\t\trType = 0;\n\t\tvrLen = 775;\n\t\tvrLoc = 104;\n\t};\n\t84BF70BE0BC3DAC200AB75ED /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA400B60F36F00FB16B3 /* EchoToOSX.h */;\n\t\tname = \"EchoToOSX.h: GetTickCount\";\n\t\trLen = 0;\n\t\trLoc = 1512;\n\t\trType = 0;\n\t\tvrLen = 738;\n\t\tvrLoc = 1238;\n\t};\n\t84C5A4370B67B31C00A596C5 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400B9E80B60F36E00FB16B3 /* blowfish.cpp */;\n\t\tname = Xr;\n\t\trLen = 5;\n\t\trLoc = 2113;\n\t\trType = 0;\n\t\tvrLen = 762;\n\t\tvrLoc = 1076;\n\t};\n\t84C86843C5B077FA0013D2B1 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA310B60F36F00FB16B3 /* DataChannel.cpp */;\n\t\tname = \"DataChannel.cpp: 164\";\n\t\trLen = 0;\n\t\trLoc = 4451;\n\t\trType = 0;\n\t\tvrLen = 810;\n\t\tvrLoc = 4235;\n\t};\n\t84C86844C5B077FA0013D2B1 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA3B0B60F36F00FB16B3 /* EchoController.h */;\n\t\tname = loadGUI;\n\t\trLen = 7;\n\t\trLoc = 1579;\n\t\trType = 0;\n\t\tvrLen = 971;\n\t\tvrLoc = 1121;\n\t};\n\t84D448D60B8EE46C008F9D1F /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400B9E60B60F36E00FB16B3 /* ServerSocket.cpp */;\n\t\tname = \"ServerSocket.cpp: 70\";\n\t\trLen = 0;\n\t\trLoc = 1255;\n\t\trType = 0;\n\t\tvrLen = 419;\n\t\tvrLoc = 1067;\n\t};\n\t84D44A870B8F44B4008F9D1F /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA760B60F36F00FB16B3 /* ProxyConnect.cpp */;\n\t\tname = \"ProxyConnect.cpp: 206\";\n\t\trLen = 0;\n\t\trLoc = 4183;\n\t\trType = 0;\n\t\tvrLen = 400;\n\t\tvrLoc = 4019;\n\t};\n\t84D4FA460B5CCFFB0058AE41 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A7009968B340046F588 /* ProxiesManager.cpp */;\n\t\tname = \"ProxiesManager.cpp: 309\";\n\t\trLen = 0;\n\t\trLoc = 6068;\n\t\trType = 0;\n\t\tvrLen = 0;\n\t\tvrLoc = 6731;\n\t};\n\t84D4FB3F0B5CFCE50058AE41 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A7209968B340046F588 /* ProxyConnection.cpp */;\n\t\tname = \"ProxyConnection.cpp: 149\";\n\t\trLen = 0;\n\t\trLoc = 3442;\n\t\trType = 0;\n\t\tvrLen = 859;\n\t\tvrLoc = 2691;\n\t};\n\t84D4FB5B0B5CFE640058AE41 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A6609968B340046F588 /* InterfaceDllProxyInfo.h */;\n\t\tname = \"ERROR_CONNECTING_TO_PROXY = -1,\";\n\t\trLen = 34;\n\t\trLoc = 548;\n\t\trType = 0;\n\t\tvrLen = 902;\n\t\tvrLoc = 0;\n\t};\n\t84D4FCA60B5D15890058AE41 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A6209968B340046F588 /* Echoware.cpp */;\n\t\tname = \"Echoware.cpp: 121\";\n\t\trLen = 0;\n\t\trLoc = 2866;\n\t\trType = 0;\n\t\tvrLen = 895;\n\t\tvrLoc = 2401;\n\t};\n\t84D4FCA70B5D15890058AE41 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A6109968B340046F588 /* EchoSrvDataChannel.h */;\n\t\tname = \"EchoSrvDataChannel.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 1035;\n\t\tvrLoc = 0;\n\t};\n\t84D4FE540B5D2A960058AE41 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84D60B3C0B5BBF2400D9EBCB /* MyDllProxyInfo.h */;\n\t\tname = \"MyDllProxyInfo.h: 14\";\n\t\trLen = 0;\n\t\trLoc = 227;\n\t\trType = 0;\n\t\tvrLen = 742;\n\t\tvrLoc = 0;\n\t};\n\t84D5200B0B5E19C10050DE52 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A5609968B340046F588 /* CritSection.cpp */;\n\t\tname = \"CritSection.cpp: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 482;\n\t\tvrLoc = 0;\n\t};\n\t84D520B90B5E27CD0050DE52 /* NSObjCRuntime.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = NSObjCRuntime.h;\n\t\tpath = /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t84D520E40B5E2C1A0050DE52 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84D520B90B5E27CD0050DE52 /* NSObjCRuntime.h */;\n\t\tname = \"NSObjCRuntime.h: 62\";\n\t\trLen = 0;\n\t\trLoc = 1575;\n\t\trType = 0;\n\t\tvrLen = 1247;\n\t\tvrLoc = 1017;\n\t};\n\t84D60AB30B5BB8EF00D9EBCB /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A5309968B340046F588 /* AES.h */;\n\t\tname = \"AES.h: 9\";\n\t\trLen = 0;\n\t\trLoc = 104;\n\t\trType = 0;\n\t\tvrLen = 671;\n\t\tvrLoc = 0;\n\t};\n\t84D60AB40B5BB8EF00D9EBCB /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB090FF909DB286900098B1F /* EchoToOSX.cpp */;\n\t\tname = Thread;\n\t\trLen = 6;\n\t\trLoc = 671;\n\t\trType = 0;\n\t\tvrLen = 876;\n\t\tvrLoc = 0;\n\t};\n\t84D60ABD0B5BB8EF00D9EBCB /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A5309968B340046F588 /* AES.h */;\n\t\tname = \"AES.h: 9\";\n\t\trLen = 0;\n\t\trLoc = 104;\n\t\trType = 0;\n\t\tvrLen = 671;\n\t\tvrLoc = 0;\n\t};\n\t84D60AC10B5BB8EF00D9EBCB /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB090FF909DB286900098B1F /* EchoToOSX.cpp */;\n\t\tname = Thread;\n\t\trLen = 6;\n\t\trLoc = 671;\n\t\trType = 0;\n\t\tvrLen = 876;\n\t\tvrLoc = 0;\n\t};\n\t84D60AC30B5BB8EF00D9EBCB /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A5B09968B340046F588 /* DataChannels.h */;\n\t\tname = \"DataChannels.h: 59\";\n\t\trLen = 0;\n\t\trLoc = 1494;\n\t\trType = 0;\n\t\tvrLen = 997;\n\t\tvrLoc = 732;\n\t};\n\t84D60AC40B5BB8EF00D9EBCB /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A5F09968B340046F588 /* DllProxyInfo.h */;\n\t\tname = \"DllProxyInfo.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 858;\n\t\tvrLoc = 0;\n\t};\n\t84D60AC90B5BB8EF00D9EBCB /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A5A09968B340046F588 /* DataChannels.cpp */;\n\t\tname = \"DataChannels.cpp: 18\";\n\t\trLen = 0;\n\t\trLoc = 521;\n\t\trType = 0;\n\t\tvrLen = 995;\n\t\tvrLoc = 0;\n\t};\n\t84D60ACC0B5BB8EF00D9EBCB /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB090FF809DB286900098B1F /* EchoToOSX.h */;\n\t\tname = \"EchoToOSX.h: INVALID_SOCKET\";\n\t\trLen = 0;\n\t\trLoc = 257;\n\t\trType = 0;\n\t\tvrLen = 870;\n\t\tvrLoc = 1174;\n\t};\n\t84D60B3C0B5BBF2400D9EBCB /* MyDllProxyInfo.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {824, 598}}\";\n\t\t\tsepNavSelRange = \"{741, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {824, 598}}\";\n\t\t\tsepNavWindowFrame = \"{{426, 51}, {863, 671}}\";\n\t\t};\n\t};\n\t84D60B3D0B5BBF2400D9EBCB /* MyDllProxyInfo.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {574, 1344}}\";\n\t\t\tsepNavSelRange = \"{368, 22}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {574, 538}}\";\n\t\t\tsepNavWindowFrame = \"{{58, 203}, {743, 543}}\";\n\t\t};\n\t};\n\t84D60B760B5BC12200D9EBCB /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744AE70996A9700046F588 /* EchoController.h */;\n\t\tname = \"EchoController.h: echoServersView\";\n\t\trLen = 0;\n\t\trLoc = 202;\n\t\trType = 0;\n\t\tvrLen = 1179;\n\t\tvrLoc = 0;\n\t};\n\t84D60B770B5BC12200D9EBCB /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A7109968B340046F588 /* ProxiesManager.h */;\n\t\tname = \"ProxiesManager.h: 14\";\n\t\trLen = 0;\n\t\trLoc = 252;\n\t\trType = 0;\n\t\tvrLen = 989;\n\t\tvrLoc = 0;\n\t};\n\t84D60BA40B5BC49500D9EBCB /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84D60B3C0B5BBF2400D9EBCB /* MyDllProxyInfo.h */;\n\t\tname = \"MyDllProxyInfo.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 630;\n\t\tvrLoc = 0;\n\t};\n\t84D60BA50B5BC49500D9EBCB /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84D60B3D0B5BBF2400D9EBCB /* MyDllProxyInfo.cpp */;\n\t\tname = \"MyDllProxyInfo.cpp: 21\";\n\t\trLen = 0;\n\t\trLoc = 501;\n\t\trType = 0;\n\t\tvrLen = 668;\n\t\tvrLoc = 0;\n\t};\n\t84D9EE150B53E20600C10970 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A6409968B340046F588 /* Globals.cpp */;\n\t\tname = \"Globals.cpp: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 832;\n\t\tvrLoc = 0;\n\t};\n\t84D9EE770B53EC5D00C10970 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A6F09968B340046F588 /* NetPacket.h */;\n\t\tname = \"NetPacket.h: 106\";\n\t\trLen = 0;\n\t\trLoc = 2669;\n\t\trType = 0;\n\t\tvrLen = 1311;\n\t\tvrLoc = 2270;\n\t};\n\t84DAA48E0B132F2900222618 /* Source Control */ = {\n\t\tisa = PBXSourceControlManager;\n\t\tfallbackIsa = XCSourceControlManager;\n\t\tisSCMEnabled = 0;\n\t\tscmConfiguration = {\n\t\t};\n\t\tscmType = \"\";\n\t};\n\t84DAA48F0B132F2900222618 /* Code sense */ = {\n\t\tisa = PBXCodeSenseManager;\n\t\tindexTemplatePath = \"\";\n\t};\n\t84DAA51F0B14A33800222618 /* XCBreakpointsBucket */ = {\n\t\tisa = XCBreakpointsBucket;\n\t\tname = Echoware;\n\t\tobjects = (\n\t\t);\n\t};\n\t84DDE9750BB90B6B0074B26A /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA9D0B60F36F00FB16B3 /* stdafx.cpp */;\n\t\tname = \"stdafx.cpp: 9\";\n\t\trLen = 0;\n\t\trLoc = 295;\n\t\trType = 0;\n\t\tvrLen = 295;\n\t\tvrLoc = 0;\n\t};\n\t84DE1A860BCCE1DA0033A95C /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84AF48A30BCCD42400C5BF0A /* DirService.h */;\n\t\tname = \"class CDirService\";\n\t\trLen = 18;\n\t\trLoc = 207;\n\t\trType = 0;\n\t\tvrLen = 924;\n\t\tvrLoc = 0;\n\t};\n\t84DF556F0C3CC76F00AD2F4B /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA370B60F36F00FB16B3 /* DataChannelSocket.cpp */;\n\t\tname = \"//sets the pair data channel for this data c\";\n\t\trLen = 44;\n\t\trLoc = 781;\n\t\trType = 0;\n\t\tvrLen = 742;\n\t\tvrLoc = 462;\n\t};\n\t84DFC45E0B64BF8200858CAB /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400B9E00B60F36E00FB16B3 /* ACConnection.h */;\n\t\tname = \"ACConnection.h: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 485;\n\t\tvrLoc = 0;\n\t};\n\t84DFC6460B64CFED00858CAB /* NSUserDefaults.h */ = {\n\t\tisa = PBXFileReference;\n\t\tlastKnownFileType = sourcecode.c.h;\n\t\tname = NSUserDefaults.h;\n\t\tpath = /System/Library/Frameworks/Foundation.framework/Headers/NSUserDefaults.h;\n\t\tsourceTree = \"<absolute>\";\n\t};\n\t84DFC6550B64D26200858CAB /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84DFC6460B64CFED00858CAB /* NSUserDefaults.h */;\n\t\tname = registerDefaults;\n\t\trLen = 16;\n\t\trLoc = 1413;\n\t\trType = 0;\n\t\tvrLen = 1139;\n\t\tvrLoc = 813;\n\t};\n\t84DFC6580B64D26200858CAB /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 84DFC6460B64CFED00858CAB /* NSUserDefaults.h */;\n\t\tname = registerDefaults;\n\t\trLen = 16;\n\t\trLoc = 1413;\n\t\trType = 0;\n\t\tvrLen = 1139;\n\t\tvrLoc = 813;\n\t};\n\t84E20C5D0C57AF7C004FB864 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = 8400BA610B60F36F00FB16B3 /* MyDllProxyInfo.cpp */;\n\t\tname = \"MyDllProxyInfo.cpp: 12\";\n\t\trLen = 0;\n\t\trLoc = 218;\n\t\trType = 0;\n\t\tvrLen = 577;\n\t\tvrLoc = 1223;\n\t};\n\t84E8F34C0B57B4DF001DACF7 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A7609968B340046F588 /* stdafx.cpp */;\n\t\tname = \"stdafx.cpp: 1\";\n\t\trLen = 0;\n\t\trLoc = 0;\n\t\trType = 0;\n\t\tvrLen = 295;\n\t\tvrLoc = 0;\n\t};\n\t84E9145B0B564E2E009AD6FC /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A7409968B340046F588 /* RSAKeys.cpp */;\n\t\tname = \"RSAKeys.cpp: 69\";\n\t\trLen = 0;\n\t\trLoc = 315;\n\t\trType = 0;\n\t\tvrLen = 1414;\n\t\tvrLoc = 1015;\n\t};\n\t84E9145E0B564E2E009AD6FC /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744A5E09968B340046F588 /* DllProxyInfo.cpp */;\n\t\tname = \"m_nConnectTimeOut=connectTimeout;\";\n\t\trLen = 35;\n\t\trLoc = 1704;\n\t\trType = 0;\n\t\tvrLen = 1012;\n\t\tvrLoc = 1229;\n\t};\n\t84F22A380B53D80F004CD709 /* PBXTextBookmark */ = {\n\t\tisa = PBXTextBookmark;\n\t\tfRef = AB744AE60996A9700046F588 /* EchoController.m */;\n\t\tname = \"EchoController.m: 88\";\n\t\trLen = 0;\n\t\trLoc = 3779;\n\t\trType = 0;\n\t\tvrLen = 1458;\n\t\tvrLoc = 1128;\n\t};\n\t8D5B49AC048680CD000E48DA /* Echoware */ = {\n\t\tactiveExec = 0;\n\t};\n\t8D5B49B7048680CD000E48DA /* Info.plist */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {686, 446}}\";\n\t\t\tsepNavSelRange = \"{163, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {658, 446}}\";\n\t\t\tsepNavWindowFrame = \"{{38, 201}, {697, 519}}\";\n\t\t};\n\t};\n\tAB090FF809DB286900098B1F /* EchoToOSX.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {584, 1428}}\";\n\t\t\tsepNavSelRange = \"{187, 25}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {568, 367}}\";\n\t\t\tsepNavWindowFrame = \"{{38, 201}, {697, 519}}\";\n\t\t};\n\t};\n\tAB090FF909DB286900098B1F /* EchoToOSX.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {807, 1036}}\";\n\t\t\tsepNavSelRange = \"{1136, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 756}, {807, 239}}\";\n\t\t\tsepNavWindowFrame = \"{{212, -32}, {697, 671}}\";\n\t\t};\n\t};\n\tAB7449FE09968AF50046F588 /* APISocket.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {680, 3360}}\";\n\t\t\tsepNavSelRange = \"{3717, 48}\";\n\t\t\tsepNavVisRect = \"{{0, 1892}, {658, 598}}\";\n\t\t\tsepNavWindowFrame = \"{{245, 42}, {697, 671}}\";\n\t\t};\n\t};\n\tAB7449FF09968AF50046F588 /* ClientSocket.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {710, 2548}}\";\n\t\t\tsepNavSelRange = \"{1315, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 496}, {658, 598}}\";\n\t\t\tsepNavWindowFrame = \"{{142, -28}, {697, 671}}\";\n\t\t};\n\t};\n\tAB744A0109968AF50046F588 /* Socket.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {866, 5740}}\";\n\t\t\tsepNavSelRange = \"{3793, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 2576}, {807, 239}}\";\n\t\t\tsepNavWindowFrame = \"{{175, 165}, {697, 519}}\";\n\t\t};\n\t};\n\tAB744A1109968AF60046F588 /* ntlmv2.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {881, 12180}}\";\n\t\t\tsepNavSelRange = \"{6198, 3}\";\n\t\t\tsepNavVisRect = \"{{0, 2156}, {881, 323}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 66}, {863, 675}}\";\n\t\t};\n\t};\n\tAB744A1F09968AF60046F588 /* Hnfunct.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {807, 5096}}\";\n\t\t\tsepNavSelRange = \"{3516, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 2030}, {807, 239}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 75}, {863, 671}}\";\n\t\t};\n\t};\n\tAB744A2109968AF60046F588 /* Hnumber.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {807, 7434}}\";\n\t\t\tsepNavSelRange = \"{8700, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 6370}, {807, 239}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 75}, {863, 671}}\";\n\t\t};\n\t};\n\tAB744A2309968AF60046F588 /* Keys.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {752, 2506}}\";\n\t\t\tsepNavSelRange = \"{3129, 77}\";\n\t\t\tsepNavVisRect = \"{{0, 1963}, {752, 261}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 75}, {863, 671}}\";\n\t\t};\n\t};\n\tAB744A2909968AF60046F588 /* MyTypes.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {916, 224}}\";\n\t\t\tsepNavSelRange = \"{166, 7}\";\n\t\t\tsepNavVisRect = \"{{0, 20}, {916, 204}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 75}, {863, 671}}\";\n\t\t};\n\t};\n\tAB744A2C09968AF60046F588 /* PrimeGen.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {881, 3122}}\";\n\t\t\tsepNavSelRange = \"{2636, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 1719}, {881, 301}}\";\n\t\t\tsepNavWindowFrame = \"{{166, -51}, {863, 671}}\";\n\t\t};\n\t};\n\tAB744A3009968AF70046F588 /* stdafx.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {996, 244}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {996, 244}}\";\n\t\t};\n\t};\n\tAB744A4E09968B340046F588 /* ACConnection.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {896, 8778}}\";\n\t\t\tsepNavSelRange = \"{14656, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 6748}, {568, 367}}\";\n\t\t\tsepNavWindowFrame = \"{{192, 67}, {697, 671}}\";\n\t\t};\n\t};\n\tAB744A4F09968B340046F588 /* ACConnection.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {658, 1246}}\";\n\t\t\tsepNavSelRange = \"{531, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {658, 598}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 75}, {697, 671}}\";\n\t\t};\n\t};\n\tAB744A5209968B340046F588 /* AES.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {824, 1134}}\";\n\t\t\tsepNavSelRange = \"{219, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {824, 598}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 75}, {863, 671}}\";\n\t\t};\n\t};\n\tAB744A5309968B340046F588 /* AES.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {574, 538}}\";\n\t\t\tsepNavSelRange = \"{104, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {574, 538}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 75}, {863, 671}}\";\n\t\t};\n\t};\n\tAB744A5409968B340046F588 /* blowfish.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {824, 3290}}\";\n\t\t\tsepNavSelRange = \"{2924, 17}\";\n\t\t\tsepNavVisRect = \"{{0, 1342}, {824, 598}}\";\n\t\t\tsepNavWindowFrame = \"{{191, 75}, {863, 671}}\";\n\t\t};\n\t};\n\tAB744A5609968B340046F588 /* CritSection.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {658, 446}}\";\n\t\t\tsepNavSelRange = \"{415, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {658, 446}}\";\n\t\t\tsepNavWindowFrame = \"{{174, 108}, {697, 519}}\";\n\t\t};\n\t};\n\tAB744A5709968B340046F588 /* CritSection.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {658, 446}}\";\n\t\t\tsepNavSelRange = \"{297, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {658, 446}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 222}, {697, 519}}\";\n\t\t};\n\t};\n\tAB744A5809968B340046F588 /* DataChannel.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {884, 3472}}\";\n\t\t\tsepNavSelRange = \"{1833, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {658, 598}}\";\n\t\t\tsepNavWindowFrame = \"{{261, 4}, {697, 671}}\";\n\t\t};\n\t};\n\tAB744A5909968B340046F588 /* DataChannel.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {658, 980}}\";\n\t\t\tsepNavSelRange = \"{1144, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 534}, {658, 446}}\";\n\t\t\tsepNavWindowFrame = \"{{61, 180}, {697, 519}}\";\n\t\t};\n\t};\n\tAB744A5A09968B340046F588 /* DataChannels.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {824, 2842}}\";\n\t\t\tsepNavSelRange = \"{5238, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 2226}, {658, 598}}\";\n\t\t\tsepNavWindowFrame = \"{{263, 75}, {697, 671}}\";\n\t\t};\n\t};\n\tAB744A5B09968B340046F588 /* DataChannels.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {658, 980}}\";\n\t\t\tsepNavSelRange = \"{1511, 12}\";\n\t\t\tsepNavVisRect = \"{{0, 382}, {658, 598}}\";\n\t\t\tsepNavWindowFrame = \"{{343, 71}, {697, 671}}\";\n\t\t};\n\t};\n\tAB744A5C09968B340046F588 /* DataChannelSocket.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {896, 1400}}\";\n\t\t\tsepNavSelRange = \"{333, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 140}, {807, 239}}\";\n\t\t\tsepNavWindowFrame = \"{{306, 75}, {697, 671}}\";\n\t\t};\n\t};\n\tAB744A5D09968B340046F588 /* DataChannelSocket.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {658, 882}}\";\n\t\t\tsepNavSelRange = \"{1340, 1}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {658, 602}}\";\n\t\t\tsepNavWindowFrame = \"{{166, 28}, {697, 675}}\";\n\t\t};\n\t};\n\tAB744A5E09968B340046F588 /* DllProxyInfo.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {980, 2310}}\";\n\t\t\tsepNavSelRange = \"{194, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 29}, {658, 446}}\";\n\t\t\tsepNavWindowFrame = \"{{163, 75}, {697, 519}}\";\n\t\t};\n\t};\n\tAB744A5F09968B340046F588 /* DllProxyInfo.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {574, 812}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {574, 538}}\";\n\t\t\tsepNavWindowFrame = \"{{15, 75}, {863, 671}}\";\n\t\t};\n\t};\n\tAB744A6009968B340046F588 /* EchoSrvDataChannel.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {818, 1358}}\";\n\t\t\tsepNavSelRange = \"{1814, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 674}, {574, 538}}\";\n\t\t\tsepNavWindowFrame = \"{{166, 63}, {697, 671}}\";\n\t\t};\n\t};\n\tAB744A6109968B340046F588 /* EchoSrvDataChannel.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {668, 644}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {568, 538}}\";\n\t\t};\n\t};\n\tAB744A6209968B340046F588 /* Echoware.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {807, 2786}}\";\n\t\t\tsepNavSelRange = \"{2523, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 1456}, {807, 239}}\";\n\t\t\tsepNavWindowFrame = \"{{166, 60}, {697, 519}}\";\n\t\t};\n\t};\n\tAB744A6309968B340046F588 /* Echoware.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {574, 538}}\";\n\t\t\tsepNavSelRange = \"{488, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {574, 538}}\";\n\t\t\tsepNavWindowFrame = \"{{84, 159}, {697, 519}}\";\n\t\t};\n\t};\n\tAB744A6409968B340046F588 /* Globals.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {658, 1372}}\";\n\t\t\tsepNavSelRange = \"{172, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {658, 598}}\";\n\t\t\tsepNavWindowFrame = \"{{215, -120}, {697, 671}}\";\n\t\t};\n\t};\n\tAB744A6509968B340046F588 /* Globals.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {658, 2268}}\";\n\t\t\tsepNavSelRange = \"{684, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 268}, {658, 446}}\";\n\t\t\tsepNavWindowFrame = \"{{517, 89}, {697, 519}}\";\n\t\t};\n\t};\n\tAB744A6609968B340046F588 /* InterfaceDllProxyInfo.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {584, 798}}\";\n\t\t\tsepNavSelRange = \"{295, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 126}, {568, 538}}\";\n\t\t\tsepNavWindowFrame = \"{{260, 13}, {697, 519}}\";\n\t\t};\n\t};\n\tAB744A6709968B340046F588 /* LocalDataChannel.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {986, 2296}}\";\n\t\t\tsepNavSelRange = \"{441, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {658, 390}}\";\n\t\t\tsepNavWindowFrame = \"{{227, 92}, {697, 519}}\";\n\t\t};\n\t};\n\tAB744A6809968B340046F588 /* LocalDataChannel.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {746, 490}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {746, 367}}\";\n\t\t};\n\t};\n\tAB744A6909968B340046F588 /* LocalListener.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {704, 476}}\";\n\t\t\tsepNavSelRange = \"{497, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 62}, {704, 414}}\";\n\t\t\tsepNavWindowFrame = \"{{38, 177}, {743, 543}}\";\n\t\t};\n\t};\n\tAB744A6B09968B340046F588 /* LocalProxyConnection.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {704, 414}}\";\n\t\t\tsepNavSelRange = \"{177, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {704, 414}}\";\n\t\t\tsepNavWindowFrame = \"{{61, 156}, {743, 543}}\";\n\t\t};\n\t};\n\tAB744A6C09968B340046F588 /* LocalProxyConnection.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {746, 367}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {746, 367}}\";\n\t\t\tsepNavWindowFrame = \"{{84, 135}, {743, 543}}\";\n\t\t};\n\t};\n\tAB744A6D09968B340046F588 /* Logger.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {807, 1568}}\";\n\t\t\tsepNavSelRange = \"{1398, 54}\";\n\t\t\tsepNavVisRect = \"{{0, 1062}, {807, 249}}\";\n\t\t};\n\t};\n\tAB744A6E09968B340046F588 /* Logger.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {1118, 546}}\";\n\t\t\tsepNavSelRange = \"{86, 19}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {1118, 323}}\";\n\t\t};\n\t};\n\tAB744A6F09968B340046F588 /* NetPacket.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {807, 2100}}\";\n\t\t\tsepNavSelRange = \"{2854, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 1861}, {807, 239}}\";\n\t\t\tsepNavWindowFrame = \"{{116, 41}, {863, 671}}\";\n\t\t};\n\t};\n\tAB744A7009968B340046F588 /* ProxiesManager.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {716, 4886}}\";\n\t\t\tsepNavSelRange = \"{7971, 82}\";\n\t\t\tsepNavVisRect = \"{{0, 4697}, {695, 189}}\";\n\t\t\tsepNavWindowFrame = \"{{242, 109}, {697, 519}}\";\n\t\t};\n\t};\n\tAB744A7109968B340046F588 /* ProxiesManager.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {568, 1120}}\";\n\t\t\tsepNavSelRange = \"{245, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {568, 538}}\";\n\t\t};\n\t};\n\tAB744A7209968B340046F588 /* ProxyConnection.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {695, 2254}}\";\n\t\t\tsepNavSelRange = \"{2831, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 1621}, {695, 189}}\";\n\t\t\tsepNavWindowFrame = \"{{153, 150}, {697, 519}}\";\n\t\t};\n\t};\n\tAB744A7309968B340046F588 /* ProxyConnection.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {1118, 728}}\";\n\t\t\tsepNavSelRange = \"{132, 22}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {1118, 323}}\";\n\t\t};\n\t};\n\tAB744A7409968B340046F588 /* RSAKeys.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {807, 2240}}\";\n\t\t\tsepNavSelRange = \"{2886, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 1680}, {807, 239}}\";\n\t\t\tsepNavWindowFrame = \"{{84, 135}, {743, 543}}\";\n\t\t};\n\t};\n\tAB744A7509968B340046F588 /* RSAKeys.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {824, 700}}\";\n\t\t\tsepNavSelRange = \"{381, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {824, 598}}\";\n\t\t\tsepNavWindowFrame = \"{{293, 75}, {863, 671}}\";\n\t\t};\n\t};\n\tAB744A7609968B340046F588 /* stdafx.cpp */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {574, 538}}\";\n\t\t\tsepNavSelRange = \"{0, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 0}, {574, 538}}\";\n\t\t};\n\t};\n\tAB744AE60996A9700046F588 /* EchoController.m */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {1088, 16268}}\";\n\t\t\tsepNavSelRange = \"{25003, 18}\";\n\t\t\tsepNavVisRect = \"{{0, 10576}, {746, 367}}\";\n\t\t\tsepNavWindowFrame = \"{{278, 104}, {743, 543}}\";\n\t\t};\n\t};\n\tAB744AE70996A9700046F588 /* EchoController.h */ = {\n\t\tuiCtxt = {\n\t\t\tsepNavIntBoundsRect = \"{{0, 0}, {668, 1694}}\";\n\t\t\tsepNavSelRange = \"{512, 0}\";\n\t\t\tsepNavVisRect = \"{{0, 277}, {568, 367}}\";\n\t\t\tsepNavWindowFrame = \"{{233, 181}, {697, 519}}\";\n\t\t};\n\t};\n}\n"
  },
  {
    "path": "Bundles/Echoware/Echoware.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 42;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t8400341A0BCD0E4900D03C1B /* RFBBundleWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 840034190BCD0E4900D03C1B /* RFBBundleWrapper.cpp */; };\n\t\t8456E5530B4CFCFE006B7550 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8456E5520B4CFCFE006B7550 /* CoreFoundation.framework */; };\n\t\t848C41200B848FDC00BD11B3 /* rfbserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 848C411F0B848FDC00BD11B3 /* rfbserver.cpp */; };\n\t\t84AE56F50B42906500425DCA /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84AE56F40B42906500425DCA /* SystemConfiguration.framework */; };\n\t\t84AF48140BCCCE0B00C5BF0A /* DirectoryService.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84AF48130BCCCE0B00C5BF0A /* DirectoryService.framework */; };\n\t\t84AF48A50BCCD42400C5BF0A /* DirService.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84AF48A40BCCD42400C5BF0A /* DirService.cpp */; };\n\t\t84AF49020BCCD76E00C5BF0A /* User.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84AF49010BCCD76E00C5BF0A /* User.cpp */; };\n\t\t84AFF1420B8C841D00D93058 /* ServerListSynchronize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84AFF1410B8C841D00D93058 /* ServerListSynchronize.cpp */; };\n\t\t84D60B3E0B5BBF2400D9EBCB /* MyDllProxyInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84D60B3D0B5BBF2400D9EBCB /* MyDllProxyInfo.cpp */; };\n\t\t84FD7F370BCB729100C66DF1 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84FD7F360BCB729100C66DF1 /* Security.framework */; };\n\t\t8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; };\n\t\t8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; };\n\t\tAB090FFA09DB286900098B1F /* EchoToOSX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB090FF909DB286900098B1F /* EchoToOSX.cpp */; };\n\t\tAB744AE50996A1320046F588 /* EchoServers.nib in Resources */ = {isa = PBXBuildFile; fileRef = AB744AE30996A1320046F588 /* EchoServers.nib */; };\n\t\tAB87EAEF09B8E11900AC7E96 /* CritSection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A5609968B340046F588 /* CritSection.cpp */; };\n\t\tAB87EB2E09B8E2FE00AC7E96 /* EchoController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB744AE60996A9700046F588 /* EchoController.m */; };\n\t\tAB87EB3B09B8E3B000AC7E96 /* ACConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A4E09968B340046F588 /* ACConnection.cpp */; };\n\t\tAB87EBFE09B8E87B00AC7E96 /* AES.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A5209968B340046F588 /* AES.cpp */; };\n\t\tAB87EC0009B8E88200AC7E96 /* blowfish.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A5409968B340046F588 /* blowfish.cpp */; };\n\t\tAB87EC0509B8E8B100AC7E96 /* DataChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A5809968B340046F588 /* DataChannel.cpp */; };\n\t\tAB87EC5609B8F13F00AC7E96 /* DataChannels.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A5A09968B340046F588 /* DataChannels.cpp */; };\n\t\tAB87EC5709B8F14000AC7E96 /* DataChannelSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A5C09968B340046F588 /* DataChannelSocket.cpp */; };\n\t\tAB87EC5809B8F14200AC7E96 /* DllProxyInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A5E09968B340046F588 /* DllProxyInfo.cpp */; };\n\t\tAB87EC5A09B8F15000AC7E96 /* stdafx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A7609968B340046F588 /* stdafx.cpp */; };\n\t\tAB87EC5C09B8F15300AC7E96 /* EchoSrvDataChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A6009968B340046F588 /* EchoSrvDataChannel.cpp */; };\n\t\tAB87EC5D09B8F15400AC7E96 /* Echoware.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A6209968B340046F588 /* Echoware.cpp */; };\n\t\tAB87EC5E09B8F15500AC7E96 /* Globals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A6409968B340046F588 /* Globals.cpp */; };\n\t\tAB87EC5F09B8F15600AC7E96 /* LocalDataChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A6709968B340046F588 /* LocalDataChannel.cpp */; };\n\t\tAB87EC6009B8F15800AC7E96 /* LocalListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A6909968B340046F588 /* LocalListener.cpp */; };\n\t\tAB87EC6109B8F15900AC7E96 /* LocalProxyConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A6B09968B340046F588 /* LocalProxyConnection.cpp */; };\n\t\tAB87EC6209B8F15A00AC7E96 /* Logger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A6D09968B340046F588 /* Logger.cpp */; };\n\t\tAB87EC6309B8F15B00AC7E96 /* ProxiesManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A7009968B340046F588 /* ProxiesManager.cpp */; };\n\t\tAB87EC6409B8F15C00AC7E96 /* ProxyConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A7209968B340046F588 /* ProxyConnection.cpp */; };\n\t\tAB87ECF309BB3B8E00AC7E96 /* Code.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A1909968AF60046F588 /* Code.cpp */; };\n\t\tAB87ECF409BB3B8F00AC7E96 /* Commonf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A1A09968AF60046F588 /* Commonf.cpp */; };\n\t\tAB87ECF609BB3B9100AC7E96 /* Hnfunct.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A1F09968AF60046F588 /* Hnfunct.cpp */; };\n\t\tAB87ECF709BB3B9200AC7E96 /* Hnumber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A2109968AF60046F588 /* Hnumber.cpp */; };\n\t\tAB87ECF809BB3B9400AC7E96 /* Keys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A2309968AF60046F588 /* Keys.cpp */; };\n\t\tAB87ECF909BB3B9500AC7E96 /* Keys_main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A2409968AF60046F588 /* Keys_main.cpp */; };\n\t\tAB87ECFA09BB3B9600AC7E96 /* Mynum.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A2509968AF60046F588 /* Mynum.cpp */; };\n\t\tAB87ECFB09BB3B9700AC7E96 /* Myprint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A2709968AF60046F588 /* Myprint.cpp */; };\n\t\tAB87ECFC09BB3B9700AC7E96 /* Operator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A2A09968AF60046F588 /* Operator.cpp */; };\n\t\tAB87ECFD09BB3B9800AC7E96 /* PrimeGen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A2C09968AF60046F588 /* PrimeGen.cpp */; };\n\t\tAB87ED0009BB3B9A00AC7E96 /* stdafx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A3009968AF70046F588 /* stdafx.cpp */; };\n\t\tAB87F13B09C1F95100AC7E96 /* RSAKeys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A7409968B340046F588 /* RSAKeys.cpp */; };\n\t\tAB87F1A209C1FE2700AC7E96 /* aes_core.c in Sources */ = {isa = PBXBuildFile; fileRef = AB744A0409968AF60046F588 /* aes_core.c */; };\n\t\tAB87F1A409C1FE3300AC7E96 /* md4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A0C09968AF60046F588 /* md4.cpp */; };\n\t\tAB87F1A509C1FE3300AC7E96 /* md5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A0E09968AF60046F588 /* md5.cpp */; };\n\t\tAB87F1A809C1FE3B00AC7E96 /* stdafx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A1609968AF60046F588 /* stdafx.cpp */; };\n\t\tAB87F1AB09C1FE5E00AC7E96 /* Gsimply.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A1D09968AF60046F588 /* Gsimply.cpp */; };\n\t\tAB87F2D009C211AB00AC7E96 /* ProxyConnect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A1209968AF60046F588 /* ProxyConnect.cpp */; };\n\t\tAB87F2D109C211AC00AC7E96 /* ntlmv2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A1109968AF60046F588 /* ntlmv2.cpp */; };\n\t\tAB87F5A109C5FFC100AC7E96 /* ClientSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB7449FF09968AF50046F588 /* ClientSocket.cpp */; };\n\t\tAB87F5D609C602A500AC7E96 /* ServerSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A0009968AF50046F588 /* ServerSocket.cpp */; };\n\t\tAB87F5DB09C602BB00AC7E96 /* Socket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB744A0109968AF50046F588 /* Socket.cpp */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXFileReference section */\n\t\t089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = \"<absolute>\"; };\n\t\t089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = \"<group>\"; };\n\t\t089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = \"<absolute>\"; };\n\t\t1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = \"<absolute>\"; };\n\t\t32DBCF630370AF2F00C91783 /* Echoware_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Echoware_Prefix.pch; sourceTree = \"<group>\"; };\n\t\t840034180BCD0E4900D03C1B /* RFBBundleWrapper.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = RFBBundleWrapper.h; sourceTree = \"<group>\"; };\n\t\t840034190BCD0E4900D03C1B /* RFBBundleWrapper.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = RFBBundleWrapper.cpp; sourceTree = \"<group>\"; };\n\t\t8400B9DF0B60F36E00FB16B3 /* ACConnection.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = ACConnection.cpp; sourceTree = \"<group>\"; };\n\t\t8400B9E00B60F36E00FB16B3 /* ACConnection.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = ACConnection.h; sourceTree = \"<group>\"; };\n\t\t8400B9E10B60F36E00FB16B3 /* AES.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = AES.cpp; sourceTree = \"<group>\"; };\n\t\t8400B9E20B60F36E00FB16B3 /* AES.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = AES.h; sourceTree = \"<group>\"; };\n\t\t8400B9E40B60F36E00FB16B3 /* APISocket.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = APISocket.h; sourceTree = \"<group>\"; };\n\t\t8400B9E50B60F36E00FB16B3 /* ClientSocket.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = ClientSocket.cpp; sourceTree = \"<group>\"; };\n\t\t8400B9E60B60F36E00FB16B3 /* ServerSocket.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = ServerSocket.cpp; sourceTree = \"<group>\"; };\n\t\t8400B9E70B60F36E00FB16B3 /* Socket.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = Socket.cpp; sourceTree = \"<group>\"; };\n\t\t8400B9E80B60F36E00FB16B3 /* blowfish.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = blowfish.cpp; sourceTree = \"<group>\"; };\n\t\t8400B9E90B60F36E00FB16B3 /* blowfish.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = blowfish.h; sourceTree = \"<group>\"; };\n\t\t8400B9EA0B60F36E00FB16B3 /* blowfish.h2 */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = blowfish.h2; sourceTree = \"<group>\"; };\n\t\t8400BA2F0B60F36F00FB16B3 /* CritSection.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = CritSection.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA300B60F36F00FB16B3 /* CritSection.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = CritSection.h; sourceTree = \"<group>\"; };\n\t\t8400BA310B60F36F00FB16B3 /* DataChannel.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = DataChannel.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA320B60F36F00FB16B3 /* DataChannel.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = DataChannel.h; sourceTree = \"<group>\"; };\n\t\t8400BA350B60F36F00FB16B3 /* DataChannels.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = DataChannels.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA360B60F36F00FB16B3 /* DataChannels.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = DataChannels.h; sourceTree = \"<group>\"; };\n\t\t8400BA370B60F36F00FB16B3 /* DataChannelSocket.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = DataChannelSocket.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA380B60F36F00FB16B3 /* DataChannelSocket.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = DataChannelSocket.h; sourceTree = \"<group>\"; };\n\t\t8400BA390B60F36F00FB16B3 /* DllProxyInfo.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = DllProxyInfo.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA3A0B60F36F00FB16B3 /* DllProxyInfo.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = DllProxyInfo.h; sourceTree = \"<group>\"; };\n\t\t8400BA3B0B60F36F00FB16B3 /* EchoController.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = EchoController.h; sourceTree = \"<group>\"; };\n\t\t8400BA3C0B60F36F00FB16B3 /* EchoController.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = EchoController.m; sourceTree = \"<group>\"; };\n\t\t8400BA3D0B60F36F00FB16B3 /* EchoSrvDataChannel.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = EchoSrvDataChannel.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA3E0B60F36F00FB16B3 /* EchoSrvDataChannel.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = EchoSrvDataChannel.h; sourceTree = \"<group>\"; };\n\t\t8400BA3F0B60F36F00FB16B3 /* EchoToOSX.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = EchoToOSX.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA400B60F36F00FB16B3 /* EchoToOSX.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = EchoToOSX.h; sourceTree = \"<group>\"; };\n\t\t8400BA410B60F36F00FB16B3 /* Echoware.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = Echoware.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA440B60F36F00FB16B3 /* Echoware.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = Echoware.h; sourceTree = \"<group>\"; };\n\t\t8400BA480B60F36F00FB16B3 /* Echoware.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; path = Echoware.xcodeproj; sourceTree = \"<group>\"; };\n\t\t8400BA4C0B60F36F00FB16B3 /* Echoware_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Echoware_Prefix.pch; sourceTree = \"<group>\"; };\n\t\t8400BA540B60F36F00FB16B3 /* English */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = \"<group>\"; };\n\t\t8400BA550B60F36F00FB16B3 /* Globals.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = Globals.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA560B60F36F00FB16B3 /* Globals.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = Globals.h; sourceTree = \"<group>\"; };\n\t\t8400BA570B60F36F00FB16B3 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t8400BA580B60F36F00FB16B3 /* InterfaceDllProxyInfo.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = InterfaceDllProxyInfo.h; sourceTree = \"<group>\"; };\n\t\t8400BA590B60F36F00FB16B3 /* LocalDataChannel.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = LocalDataChannel.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA5A0B60F36F00FB16B3 /* LocalDataChannel.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = LocalDataChannel.h; sourceTree = \"<group>\"; };\n\t\t8400BA5B0B60F36F00FB16B3 /* LocalListener.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = LocalListener.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA5C0B60F36F00FB16B3 /* LocalListener.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = LocalListener.h; sourceTree = \"<group>\"; };\n\t\t8400BA5D0B60F36F00FB16B3 /* LocalProxyConnection.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = LocalProxyConnection.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA5E0B60F36F00FB16B3 /* LocalProxyConnection.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = LocalProxyConnection.h; sourceTree = \"<group>\"; };\n\t\t8400BA5F0B60F36F00FB16B3 /* Logger.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = Logger.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA600B60F36F00FB16B3 /* Logger.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = Logger.h; sourceTree = \"<group>\"; };\n\t\t8400BA610B60F36F00FB16B3 /* MyDllProxyInfo.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = MyDllProxyInfo.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA620B60F36F00FB16B3 /* MyDllProxyInfo.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = MyDllProxyInfo.h; sourceTree = \"<group>\"; };\n\t\t8400BA630B60F36F00FB16B3 /* NetPacket.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = NetPacket.h; sourceTree = \"<group>\"; };\n\t\t8400BA650B60F36F00FB16B3 /* aes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = aes.h; sourceTree = \"<group>\"; };\n\t\t8400BA660B60F36F00FB16B3 /* aes_core.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = aes_core.c; sourceTree = \"<group>\"; };\n\t\t8400BA670B60F36F00FB16B3 /* aes_locl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = aes_locl.h; sourceTree = \"<group>\"; };\n\t\t8400BA680B60F36F00FB16B3 /* e_os2.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = e_os2.h; sourceTree = \"<group>\"; };\n\t\t8400BA690B60F36F00FB16B3 /* LibeaySt.dsp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = LibeaySt.dsp; sourceTree = \"<group>\"; };\n\t\t8400BA6A0B60F36F00FB16B3 /* LibeaySt.vcproj */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = LibeaySt.vcproj; sourceTree = \"<group>\"; };\n\t\t8400BA6B0B60F36F00FB16B3 /* opensslconf.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = opensslconf.h; sourceTree = \"<group>\"; };\n\t\t8400BA6C0B60F36F00FB16B3 /* ProxiesManager.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = ProxiesManager.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA6D0B60F36F00FB16B3 /* ProxiesManager.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = ProxiesManager.h; sourceTree = \"<group>\"; };\n\t\t8400BA6F0B60F36F00FB16B3 /* global.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = global.h; sourceTree = \"<group>\"; };\n\t\t8400BA700B60F36F00FB16B3 /* md4.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = md4.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA710B60F36F00FB16B3 /* md4.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = md4.h; sourceTree = \"<group>\"; };\n\t\t8400BA720B60F36F00FB16B3 /* md5.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = md5.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA730B60F36F00FB16B3 /* md5.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = md5.h; sourceTree = \"<group>\"; };\n\t\t8400BA740B60F36F00FB16B3 /* ntlm.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ntlm.h; sourceTree = \"<group>\"; };\n\t\t8400BA750B60F36F00FB16B3 /* ntlmv2.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ntlmv2.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA760B60F36F00FB16B3 /* ProxyConnect.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = ProxyConnect.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA770B60F36F00FB16B3 /* ProxyConnect.dsp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ProxyConnect.dsp; sourceTree = \"<group>\"; };\n\t\t8400BA780B60F36F00FB16B3 /* ProxyConnect.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProxyConnect.h; sourceTree = \"<group>\"; };\n\t\t8400BA790B60F36F00FB16B3 /* ProxyConnect.vcproj */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = ProxyConnect.vcproj; sourceTree = \"<group>\"; };\n\t\t8400BA7A0B60F36F00FB16B3 /* stdafx.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = stdafx.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA7B0B60F36F00FB16B3 /* stdafx.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = stdafx.h; sourceTree = \"<group>\"; };\n\t\t8400BA7C0B60F36F00FB16B3 /* ProxyConnection.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = ProxyConnection.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA7D0B60F36F00FB16B3 /* ProxyConnection.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = ProxyConnection.h; sourceTree = \"<group>\"; };\n\t\t8400BA7F0B60F36F00FB16B3 /* Code.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Code.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA800B60F36F00FB16B3 /* Commonf.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Commonf.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA810B60F36F00FB16B3 /* Commonf.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Commonf.h; sourceTree = \"<group>\"; };\n\t\t8400BA820B60F36F00FB16B3 /* Function.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Function.h; sourceTree = \"<group>\"; };\n\t\t8400BA830B60F36F00FB16B3 /* Gsimply.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Gsimply.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA840B60F36F00FB16B3 /* Gsimply.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Gsimply.h; sourceTree = \"<group>\"; };\n\t\t8400BA850B60F36F00FB16B3 /* Hnfunct.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Hnfunct.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA860B60F36F00FB16B3 /* Hnfunct.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Hnfunct.h; sourceTree = \"<group>\"; };\n\t\t8400BA870B60F36F00FB16B3 /* Hnumber.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Hnumber.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA880B60F36F00FB16B3 /* HNumber.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HNumber.h; sourceTree = \"<group>\"; };\n\t\t8400BA890B60F36F00FB16B3 /* Keys.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Keys.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA8A0B60F36F00FB16B3 /* Keys_main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Keys_main.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA8B0B60F36F00FB16B3 /* Mynum.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Mynum.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA8C0B60F36F00FB16B3 /* MyNum.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MyNum.h; sourceTree = \"<group>\"; };\n\t\t8400BA8D0B60F36F00FB16B3 /* Myprint.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Myprint.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA8E0B60F36F00FB16B3 /* Myprint.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Myprint.h; sourceTree = \"<group>\"; };\n\t\t8400BA8F0B60F36F00FB16B3 /* MyTypes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MyTypes.h; sourceTree = \"<group>\"; };\n\t\t8400BA900B60F36F00FB16B3 /* Operator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Operator.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA910B60F36F00FB16B3 /* Operator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Operator.h; sourceTree = \"<group>\"; };\n\t\t8400BA920B60F36F00FB16B3 /* PrimeGen.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PrimeGen.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA930B60F36F00FB16B3 /* Profiler.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Profiler.h; sourceTree = \"<group>\"; };\n\t\t8400BA940B60F36F00FB16B3 /* RSA.dsp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = RSA.dsp; sourceTree = \"<group>\"; };\n\t\t8400BA950B60F36F00FB16B3 /* RSA.vcproj */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = RSA.vcproj; sourceTree = \"<group>\"; };\n\t\t8400BA960B60F36F00FB16B3 /* stdafx.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = stdafx.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA970B60F36F00FB16B3 /* StdAfx.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StdAfx.h; sourceTree = \"<group>\"; };\n\t\t8400BA980B60F36F00FB16B3 /* TMSG.H */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = TMSG.H; sourceTree = \"<group>\"; };\n\t\t8400BA990B60F36F00FB16B3 /* RSAKeys.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = RSAKeys.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA9A0B60F36F00FB16B3 /* RSAKeys.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = RSAKeys.h; sourceTree = \"<group>\"; };\n\t\t8400BA9D0B60F36F00FB16B3 /* stdafx.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = stdafx.cpp; sourceTree = \"<group>\"; };\n\t\t8400BA9E0B60F36F00FB16B3 /* stdafx.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; path = stdafx.h; sourceTree = \"<group>\"; };\n\t\t8400BAA00B60F36F00FB16B3 /* version.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = version.plist; sourceTree = \"<group>\"; };\n\t\t8456E5520B4CFCFE006B7550 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = \"<absolute>\"; };\n\t\t848C411E0B848FDC00BD11B3 /* rfbserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rfbserver.h; sourceTree = \"<group>\"; };\n\t\t848C411F0B848FDC00BD11B3 /* rfbserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rfbserver.cpp; sourceTree = \"<group>\"; };\n\t\t84AE56F40B42906500425DCA /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = /System/Library/Frameworks/SystemConfiguration.framework; sourceTree = \"<absolute>\"; };\n\t\t84AF48130BCCCE0B00C5BF0A /* DirectoryService.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DirectoryService.framework; path = /System/Library/Frameworks/DirectoryService.framework; sourceTree = \"<absolute>\"; };\n\t\t84AF48A30BCCD42400C5BF0A /* DirService.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DirService.h; sourceTree = \"<group>\"; };\n\t\t84AF48A40BCCD42400C5BF0A /* DirService.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = DirService.cpp; sourceTree = \"<group>\"; };\n\t\t84AF49000BCCD76E00C5BF0A /* User.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = User.h; sourceTree = \"<group>\"; };\n\t\t84AF49010BCCD76E00C5BF0A /* User.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = User.cpp; sourceTree = \"<group>\"; };\n\t\t84AFF1400B8C841D00D93058 /* ServerListSynchronize.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = ServerListSynchronize.h; sourceTree = \"<group>\"; };\n\t\t84AFF1410B8C841D00D93058 /* ServerListSynchronize.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = ServerListSynchronize.cpp; sourceTree = \"<group>\"; };\n\t\t84D60B3C0B5BBF2400D9EBCB /* MyDllProxyInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyDllProxyInfo.h; sourceTree = \"<group>\"; };\n\t\t84D60B3D0B5BBF2400D9EBCB /* MyDllProxyInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MyDllProxyInfo.cpp; sourceTree = \"<group>\"; };\n\t\t84FD7F360BCB729100C66DF1 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = \"<absolute>\"; };\n\t\t8D5B49B6048680CD000E48DA /* Echoware.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Echoware.bundle; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\tAB090FF809DB286900098B1F /* EchoToOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EchoToOSX.h; sourceTree = \"<group>\"; };\n\t\tAB090FF909DB286900098B1F /* EchoToOSX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EchoToOSX.cpp; sourceTree = \"<group>\"; };\n\t\tAB7449FE09968AF50046F588 /* APISocket.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = APISocket.h; sourceTree = \"<group>\"; };\n\t\tAB7449FF09968AF50046F588 /* ClientSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ClientSocket.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A0009968AF50046F588 /* ServerSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ServerSocket.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A0109968AF50046F588 /* Socket.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Socket.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A0309968AF50046F588 /* aes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = aes.h; sourceTree = \"<group>\"; };\n\t\tAB744A0409968AF60046F588 /* aes_core.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = aes_core.c; sourceTree = \"<group>\"; };\n\t\tAB744A0509968AF60046F588 /* aes_locl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = aes_locl.h; sourceTree = \"<group>\"; };\n\t\tAB744A0609968AF60046F588 /* e_os2.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = e_os2.h; sourceTree = \"<group>\"; };\n\t\tAB744A0909968AF60046F588 /* opensslconf.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = opensslconf.h; sourceTree = \"<group>\"; };\n\t\tAB744A0B09968AF60046F588 /* global.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = global.h; sourceTree = \"<group>\"; };\n\t\tAB744A0C09968AF60046F588 /* md4.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = md4.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A0D09968AF60046F588 /* md4.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = md4.h; sourceTree = \"<group>\"; };\n\t\tAB744A0E09968AF60046F588 /* md5.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = md5.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A0F09968AF60046F588 /* md5.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = md5.h; sourceTree = \"<group>\"; };\n\t\tAB744A1009968AF60046F588 /* ntlm.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ntlm.h; sourceTree = \"<group>\"; };\n\t\tAB744A1109968AF60046F588 /* ntlmv2.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ntlmv2.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A1209968AF60046F588 /* ProxyConnect.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ProxyConnect.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A1409968AF60046F588 /* ProxyConnect.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProxyConnect.h; sourceTree = \"<group>\"; };\n\t\tAB744A1609968AF60046F588 /* stdafx.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = stdafx.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A1709968AF60046F588 /* stdafx.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = stdafx.h; sourceTree = \"<group>\"; };\n\t\tAB744A1909968AF60046F588 /* Code.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Code.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A1A09968AF60046F588 /* Commonf.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Commonf.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A1B09968AF60046F588 /* Commonf.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Commonf.h; sourceTree = \"<group>\"; };\n\t\tAB744A1C09968AF60046F588 /* Function.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Function.h; sourceTree = \"<group>\"; };\n\t\tAB744A1D09968AF60046F588 /* Gsimply.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Gsimply.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A1E09968AF60046F588 /* Gsimply.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Gsimply.h; sourceTree = \"<group>\"; };\n\t\tAB744A1F09968AF60046F588 /* Hnfunct.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Hnfunct.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A2009968AF60046F588 /* Hnfunct.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Hnfunct.h; sourceTree = \"<group>\"; };\n\t\tAB744A2109968AF60046F588 /* Hnumber.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Hnumber.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A2209968AF60046F588 /* HNumber.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HNumber.h; sourceTree = \"<group>\"; };\n\t\tAB744A2309968AF60046F588 /* Keys.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Keys.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A2409968AF60046F588 /* Keys_main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Keys_main.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A2509968AF60046F588 /* Mynum.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Mynum.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A2609968AF60046F588 /* MyNum.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MyNum.h; sourceTree = \"<group>\"; };\n\t\tAB744A2709968AF60046F588 /* Myprint.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Myprint.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A2809968AF60046F588 /* Myprint.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Myprint.h; sourceTree = \"<group>\"; };\n\t\tAB744A2909968AF60046F588 /* MyTypes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MyTypes.h; sourceTree = \"<group>\"; };\n\t\tAB744A2A09968AF60046F588 /* Operator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Operator.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A2B09968AF60046F588 /* Operator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Operator.h; sourceTree = \"<group>\"; };\n\t\tAB744A2C09968AF60046F588 /* PrimeGen.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PrimeGen.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A2D09968AF70046F588 /* Profiler.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Profiler.h; sourceTree = \"<group>\"; };\n\t\tAB744A3009968AF70046F588 /* stdafx.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = stdafx.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A3109968AF70046F588 /* StdAfx.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StdAfx.h; sourceTree = \"<group>\"; };\n\t\tAB744A3209968AF70046F588 /* TMSG.H */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = TMSG.H; sourceTree = \"<group>\"; };\n\t\tAB744A4E09968B340046F588 /* ACConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ACConnection.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A4F09968B340046F588 /* ACConnection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ACConnection.h; sourceTree = \"<group>\"; };\n\t\tAB744A5209968B340046F588 /* AES.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AES.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A5309968B340046F588 /* AES.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AES.h; sourceTree = \"<group>\"; };\n\t\tAB744A5409968B340046F588 /* blowfish.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = blowfish.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A5509968B340046F588 /* blowfish.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = blowfish.h; sourceTree = \"<group>\"; };\n\t\tAB744A5609968B340046F588 /* CritSection.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CritSection.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A5709968B340046F588 /* CritSection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CritSection.h; sourceTree = \"<group>\"; };\n\t\tAB744A5809968B340046F588 /* DataChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DataChannel.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A5909968B340046F588 /* DataChannel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DataChannel.h; sourceTree = \"<group>\"; };\n\t\tAB744A5A09968B340046F588 /* DataChannels.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DataChannels.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A5B09968B340046F588 /* DataChannels.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DataChannels.h; sourceTree = \"<group>\"; };\n\t\tAB744A5C09968B340046F588 /* DataChannelSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DataChannelSocket.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A5D09968B340046F588 /* DataChannelSocket.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DataChannelSocket.h; sourceTree = \"<group>\"; };\n\t\tAB744A5E09968B340046F588 /* DllProxyInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DllProxyInfo.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A5F09968B340046F588 /* DllProxyInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DllProxyInfo.h; sourceTree = \"<group>\"; };\n\t\tAB744A6009968B340046F588 /* EchoSrvDataChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = EchoSrvDataChannel.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A6109968B340046F588 /* EchoSrvDataChannel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EchoSrvDataChannel.h; sourceTree = \"<group>\"; };\n\t\tAB744A6209968B340046F588 /* Echoware.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Echoware.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A6309968B340046F588 /* Echoware.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Echoware.h; sourceTree = \"<group>\"; };\n\t\tAB744A6409968B340046F588 /* Globals.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Globals.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A6509968B340046F588 /* Globals.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Globals.h; sourceTree = \"<group>\"; };\n\t\tAB744A6609968B340046F588 /* InterfaceDllProxyInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InterfaceDllProxyInfo.h; sourceTree = \"<group>\"; };\n\t\tAB744A6709968B340046F588 /* LocalDataChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LocalDataChannel.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A6809968B340046F588 /* LocalDataChannel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LocalDataChannel.h; sourceTree = \"<group>\"; };\n\t\tAB744A6909968B340046F588 /* LocalListener.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LocalListener.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A6A09968B340046F588 /* LocalListener.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LocalListener.h; sourceTree = \"<group>\"; };\n\t\tAB744A6B09968B340046F588 /* LocalProxyConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LocalProxyConnection.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A6C09968B340046F588 /* LocalProxyConnection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LocalProxyConnection.h; sourceTree = \"<group>\"; };\n\t\tAB744A6D09968B340046F588 /* Logger.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Logger.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A6E09968B340046F588 /* Logger.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Logger.h; sourceTree = \"<group>\"; };\n\t\tAB744A6F09968B340046F588 /* NetPacket.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NetPacket.h; sourceTree = \"<group>\"; };\n\t\tAB744A7009968B340046F588 /* ProxiesManager.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ProxiesManager.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A7109968B340046F588 /* ProxiesManager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProxiesManager.h; sourceTree = \"<group>\"; };\n\t\tAB744A7209968B340046F588 /* ProxyConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ProxyConnection.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A7309968B340046F588 /* ProxyConnection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProxyConnection.h; sourceTree = \"<group>\"; };\n\t\tAB744A7409968B340046F588 /* RSAKeys.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RSAKeys.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A7509968B340046F588 /* RSAKeys.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RSAKeys.h; sourceTree = \"<group>\"; };\n\t\tAB744A7609968B340046F588 /* stdafx.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = stdafx.cpp; sourceTree = \"<group>\"; };\n\t\tAB744A7709968B340046F588 /* stdafx.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = stdafx.h; sourceTree = \"<group>\"; };\n\t\tAB744AE40996A1320046F588 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/EchoServers.nib; sourceTree = \"<group>\"; };\n\t\tAB744AE60996A9700046F588 /* EchoController.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = EchoController.m; sourceTree = \"<group>\"; };\n\t\tAB744AE70996A9700046F588 /* EchoController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EchoController.h; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t8D5B49B3048680CD000E48DA /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */,\n\t\t\t\t84AE56F50B42906500425DCA /* SystemConfiguration.framework in Frameworks */,\n\t\t\t\t8456E5530B4CFCFE006B7550 /* CoreFoundation.framework in Frameworks */,\n\t\t\t\t84FD7F370BCB729100C66DF1 /* Security.framework in Frameworks */,\n\t\t\t\t84AF48140BCCCE0B00C5BF0A /* DirectoryService.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t089C166AFE841209C02AAC07 /* Echoware */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t8400B9DE0B60F36E00FB16B3 /* Echoware */,\n\t\t\t\t08FB77AFFE84173DC02AAC07 /* Classes */,\n\t\t\t\t32C88E010371C26100C91783 /* Other Sources */,\n\t\t\t\t089C167CFE841241C02AAC07 /* Resources */,\n\t\t\t\t089C1671FE841209C02AAC07 /* Frameworks and Libraries */,\n\t\t\t\t19C28FB8FE9D52D311CA2CBB /* Products */,\n\t\t\t\tAB744AE30996A1320046F588 /* EchoServers.nib */,\n\t\t\t);\n\t\t\tname = Echoware;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t089C1671FE841209C02AAC07 /* Frameworks and Libraries */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t84AF48130BCCCE0B00C5BF0A /* DirectoryService.framework */,\n\t\t\t\t84FD7F360BCB729100C66DF1 /* Security.framework */,\n\t\t\t\t1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */,\n\t\t\t\t8456E5520B4CFCFE006B7550 /* CoreFoundation.framework */,\n\t\t\t\t84AE56F40B42906500425DCA /* SystemConfiguration.framework */,\n\t\t\t\t089C1672FE841209C02AAC07 /* Foundation.framework */,\n\t\t\t\t089C167FFE841241C02AAC07 /* AppKit.framework */,\n\t\t\t\t1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */,\n\t\t\t\t1058C7AEFEA557BF11CA2CBB /* Other Frameworks */,\n\t\t\t);\n\t\t\tname = \"Frameworks and Libraries\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t089C167CFE841241C02AAC07 /* Resources */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t8D5B49B7048680CD000E48DA /* Info.plist */,\n\t\t\t\t089C167DFE841241C02AAC07 /* InfoPlist.strings */,\n\t\t\t);\n\t\t\tname = Resources;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t08FB77AFFE84173DC02AAC07 /* Classes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tAB744AE60996A9700046F588 /* EchoController.m */,\n\t\t\t\tAB744AE70996A9700046F588 /* EchoController.h */,\n\t\t\t\tAB090FF909DB286900098B1F /* EchoToOSX.cpp */,\n\t\t\t\tAB090FF809DB286900098B1F /* EchoToOSX.h */,\n\t\t\t\tAB744A5309968B340046F588 /* AES.h */,\n\t\t\t\tAB744A6609968B340046F588 /* InterfaceDllProxyInfo.h */,\n\t\t\t\tAB744A6209968B340046F588 /* Echoware.cpp */,\n\t\t\t\tAB744A6309968B340046F588 /* Echoware.h */,\n\t\t\t\tAB744A4E09968B340046F588 /* ACConnection.cpp */,\n\t\t\t\tAB744A4F09968B340046F588 /* ACConnection.h */,\n\t\t\t\tAB744A5409968B340046F588 /* blowfish.cpp */,\n\t\t\t\tAB744A5509968B340046F588 /* blowfish.h */,\n\t\t\t\tAB744A5609968B340046F588 /* CritSection.cpp */,\n\t\t\t\tAB744A5709968B340046F588 /* CritSection.h */,\n\t\t\t\tAB744A5809968B340046F588 /* DataChannel.cpp */,\n\t\t\t\tAB744A5909968B340046F588 /* DataChannel.h */,\n\t\t\t\tAB744A5209968B340046F588 /* AES.cpp */,\n\t\t\t\tAB744A5A09968B340046F588 /* DataChannels.cpp */,\n\t\t\t\tAB744A5B09968B340046F588 /* DataChannels.h */,\n\t\t\t\tAB744A5C09968B340046F588 /* DataChannelSocket.cpp */,\n\t\t\t\tAB744A5D09968B340046F588 /* DataChannelSocket.h */,\n\t\t\t\tAB744A5E09968B340046F588 /* DllProxyInfo.cpp */,\n\t\t\t\tAB744A5F09968B340046F588 /* DllProxyInfo.h */,\n\t\t\t\tAB744A6009968B340046F588 /* EchoSrvDataChannel.cpp */,\n\t\t\t\tAB744A6109968B340046F588 /* EchoSrvDataChannel.h */,\n\t\t\t\tAB744A6409968B340046F588 /* Globals.cpp */,\n\t\t\t\tAB744A6509968B340046F588 /* Globals.h */,\n\t\t\t\tAB744A6709968B340046F588 /* LocalDataChannel.cpp */,\n\t\t\t\tAB744A6809968B340046F588 /* LocalDataChannel.h */,\n\t\t\t\tAB744A6909968B340046F588 /* LocalListener.cpp */,\n\t\t\t\tAB744A6A09968B340046F588 /* LocalListener.h */,\n\t\t\t\tAB744A6B09968B340046F588 /* LocalProxyConnection.cpp */,\n\t\t\t\tAB744A6C09968B340046F588 /* LocalProxyConnection.h */,\n\t\t\t\tAB744A6D09968B340046F588 /* Logger.cpp */,\n\t\t\t\tAB744A6E09968B340046F588 /* Logger.h */,\n\t\t\t\tAB744A6F09968B340046F588 /* NetPacket.h */,\n\t\t\t\tAB744A7009968B340046F588 /* ProxiesManager.cpp */,\n\t\t\t\tAB744A7109968B340046F588 /* ProxiesManager.h */,\n\t\t\t\tAB744A7209968B340046F588 /* ProxyConnection.cpp */,\n\t\t\t\tAB744A7309968B340046F588 /* ProxyConnection.h */,\n\t\t\t\tAB744A7409968B340046F588 /* RSAKeys.cpp */,\n\t\t\t\tAB744A7509968B340046F588 /* RSAKeys.h */,\n\t\t\t\tAB744A7609968B340046F588 /* stdafx.cpp */,\n\t\t\t\tAB744A7709968B340046F588 /* stdafx.h */,\n\t\t\t\t84D60B3C0B5BBF2400D9EBCB /* MyDllProxyInfo.h */,\n\t\t\t\t84D60B3D0B5BBF2400D9EBCB /* MyDllProxyInfo.cpp */,\n\t\t\t\tAB7449FD09968AF50046F588 /* APISocket */,\n\t\t\t\tAB744A0209968AF50046F588 /* OpenSSL */,\n\t\t\t\tAB744A0A09968AF60046F588 /* ProxyConnect */,\n\t\t\t\tAB744A1809968AF60046F588 /* RSA */,\n\t\t\t\t848C411E0B848FDC00BD11B3 /* rfbserver.h */,\n\t\t\t\t848C411F0B848FDC00BD11B3 /* rfbserver.cpp */,\n\t\t\t);\n\t\t\tname = Classes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t);\n\t\t\tname = \"Linked Frameworks\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1058C7AEFEA557BF11CA2CBB /* Other Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t);\n\t\t\tname = \"Other Frameworks\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t19C28FB8FE9D52D311CA2CBB /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t8D5B49B6048680CD000E48DA /* Echoware.bundle */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t32C88E010371C26100C91783 /* Other Sources */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t32DBCF630370AF2F00C91783 /* Echoware_Prefix.pch */,\n\t\t\t);\n\t\t\tname = \"Other Sources\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t8400B9DE0B60F36E00FB16B3 /* Echoware */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t840034180BCD0E4900D03C1B /* RFBBundleWrapper.h */,\n\t\t\t\t840034190BCD0E4900D03C1B /* RFBBundleWrapper.cpp */,\n\t\t\t\t84AF49000BCCD76E00C5BF0A /* User.h */,\n\t\t\t\t84AF49010BCCD76E00C5BF0A /* User.cpp */,\n\t\t\t\t84AF48A30BCCD42400C5BF0A /* DirService.h */,\n\t\t\t\t84AF48A40BCCD42400C5BF0A /* DirService.cpp */,\n\t\t\t\t8400B9DF0B60F36E00FB16B3 /* ACConnection.cpp */,\n\t\t\t\t8400B9E00B60F36E00FB16B3 /* ACConnection.h */,\n\t\t\t\t8400B9E10B60F36E00FB16B3 /* AES.cpp */,\n\t\t\t\t8400B9E20B60F36E00FB16B3 /* AES.h */,\n\t\t\t\t8400B9E30B60F36E00FB16B3 /* APISocket */,\n\t\t\t\t8400B9E80B60F36E00FB16B3 /* blowfish.cpp */,\n\t\t\t\t8400B9E90B60F36E00FB16B3 /* blowfish.h */,\n\t\t\t\t8400B9EA0B60F36E00FB16B3 /* blowfish.h2 */,\n\t\t\t\t8400BA2F0B60F36F00FB16B3 /* CritSection.cpp */,\n\t\t\t\t8400BA300B60F36F00FB16B3 /* CritSection.h */,\n\t\t\t\t8400BA310B60F36F00FB16B3 /* DataChannel.cpp */,\n\t\t\t\t8400BA320B60F36F00FB16B3 /* DataChannel.h */,\n\t\t\t\t8400BA350B60F36F00FB16B3 /* DataChannels.cpp */,\n\t\t\t\t8400BA360B60F36F00FB16B3 /* DataChannels.h */,\n\t\t\t\t8400BA370B60F36F00FB16B3 /* DataChannelSocket.cpp */,\n\t\t\t\t8400BA380B60F36F00FB16B3 /* DataChannelSocket.h */,\n\t\t\t\t8400BA390B60F36F00FB16B3 /* DllProxyInfo.cpp */,\n\t\t\t\t8400BA3A0B60F36F00FB16B3 /* DllProxyInfo.h */,\n\t\t\t\t8400BA3B0B60F36F00FB16B3 /* EchoController.h */,\n\t\t\t\t8400BA3C0B60F36F00FB16B3 /* EchoController.m */,\n\t\t\t\t8400BA3D0B60F36F00FB16B3 /* EchoSrvDataChannel.cpp */,\n\t\t\t\t8400BA3E0B60F36F00FB16B3 /* EchoSrvDataChannel.h */,\n\t\t\t\t8400BA3F0B60F36F00FB16B3 /* EchoToOSX.cpp */,\n\t\t\t\t8400BA400B60F36F00FB16B3 /* EchoToOSX.h */,\n\t\t\t\t8400BA410B60F36F00FB16B3 /* Echoware.cpp */,\n\t\t\t\t8400BA440B60F36F00FB16B3 /* Echoware.h */,\n\t\t\t\t8400BA480B60F36F00FB16B3 /* Echoware.xcodeproj */,\n\t\t\t\t8400BA4C0B60F36F00FB16B3 /* Echoware_Prefix.pch */,\n\t\t\t\t8400BA530B60F36F00FB16B3 /* InfoPlist.strings */,\n\t\t\t\t8400BA550B60F36F00FB16B3 /* Globals.cpp */,\n\t\t\t\t8400BA560B60F36F00FB16B3 /* Globals.h */,\n\t\t\t\t8400BA570B60F36F00FB16B3 /* Info.plist */,\n\t\t\t\t8400BA580B60F36F00FB16B3 /* InterfaceDllProxyInfo.h */,\n\t\t\t\t8400BA590B60F36F00FB16B3 /* LocalDataChannel.cpp */,\n\t\t\t\t8400BA5A0B60F36F00FB16B3 /* LocalDataChannel.h */,\n\t\t\t\t8400BA5B0B60F36F00FB16B3 /* LocalListener.cpp */,\n\t\t\t\t8400BA5C0B60F36F00FB16B3 /* LocalListener.h */,\n\t\t\t\t8400BA5D0B60F36F00FB16B3 /* LocalProxyConnection.cpp */,\n\t\t\t\t8400BA5E0B60F36F00FB16B3 /* LocalProxyConnection.h */,\n\t\t\t\t8400BA5F0B60F36F00FB16B3 /* Logger.cpp */,\n\t\t\t\t8400BA600B60F36F00FB16B3 /* Logger.h */,\n\t\t\t\t8400BA610B60F36F00FB16B3 /* MyDllProxyInfo.cpp */,\n\t\t\t\t8400BA620B60F36F00FB16B3 /* MyDllProxyInfo.h */,\n\t\t\t\t8400BA630B60F36F00FB16B3 /* NetPacket.h */,\n\t\t\t\t8400BA640B60F36F00FB16B3 /* OpenSSL */,\n\t\t\t\t8400BA6C0B60F36F00FB16B3 /* ProxiesManager.cpp */,\n\t\t\t\t8400BA6D0B60F36F00FB16B3 /* ProxiesManager.h */,\n\t\t\t\t8400BA6E0B60F36F00FB16B3 /* ProxyConnect */,\n\t\t\t\t8400BA7C0B60F36F00FB16B3 /* ProxyConnection.cpp */,\n\t\t\t\t8400BA7D0B60F36F00FB16B3 /* ProxyConnection.h */,\n\t\t\t\t8400BA7E0B60F36F00FB16B3 /* RSA */,\n\t\t\t\t8400BA990B60F36F00FB16B3 /* RSAKeys.cpp */,\n\t\t\t\t8400BA9A0B60F36F00FB16B3 /* RSAKeys.h */,\n\t\t\t\t8400BA9D0B60F36F00FB16B3 /* stdafx.cpp */,\n\t\t\t\t8400BA9E0B60F36F00FB16B3 /* stdafx.h */,\n\t\t\t\t8400BAA00B60F36F00FB16B3 /* version.plist */,\n\t\t\t\t84AFF1400B8C841D00D93058 /* ServerListSynchronize.h */,\n\t\t\t\t84AFF1410B8C841D00D93058 /* ServerListSynchronize.cpp */,\n\t\t\t);\n\t\t\tname = Echoware;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t8400B9E30B60F36E00FB16B3 /* APISocket */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t8400B9E40B60F36E00FB16B3 /* APISocket.h */,\n\t\t\t\t8400B9E50B60F36E00FB16B3 /* ClientSocket.cpp */,\n\t\t\t\t8400B9E60B60F36E00FB16B3 /* ServerSocket.cpp */,\n\t\t\t\t8400B9E70B60F36E00FB16B3 /* Socket.cpp */,\n\t\t\t);\n\t\t\tpath = APISocket;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t8400BA490B60F36F00FB16B3 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t8400BA640B60F36F00FB16B3 /* OpenSSL */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t8400BA650B60F36F00FB16B3 /* aes.h */,\n\t\t\t\t8400BA660B60F36F00FB16B3 /* aes_core.c */,\n\t\t\t\t8400BA670B60F36F00FB16B3 /* aes_locl.h */,\n\t\t\t\t8400BA680B60F36F00FB16B3 /* e_os2.h */,\n\t\t\t\t8400BA690B60F36F00FB16B3 /* LibeaySt.dsp */,\n\t\t\t\t8400BA6A0B60F36F00FB16B3 /* LibeaySt.vcproj */,\n\t\t\t\t8400BA6B0B60F36F00FB16B3 /* opensslconf.h */,\n\t\t\t);\n\t\t\tpath = OpenSSL;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t8400BA6E0B60F36F00FB16B3 /* ProxyConnect */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t8400BA6F0B60F36F00FB16B3 /* global.h */,\n\t\t\t\t8400BA700B60F36F00FB16B3 /* md4.cpp */,\n\t\t\t\t8400BA710B60F36F00FB16B3 /* md4.h */,\n\t\t\t\t8400BA720B60F36F00FB16B3 /* md5.cpp */,\n\t\t\t\t8400BA730B60F36F00FB16B3 /* md5.h */,\n\t\t\t\t8400BA740B60F36F00FB16B3 /* ntlm.h */,\n\t\t\t\t8400BA750B60F36F00FB16B3 /* ntlmv2.cpp */,\n\t\t\t\t8400BA760B60F36F00FB16B3 /* ProxyConnect.cpp */,\n\t\t\t\t8400BA770B60F36F00FB16B3 /* ProxyConnect.dsp */,\n\t\t\t\t8400BA780B60F36F00FB16B3 /* ProxyConnect.h */,\n\t\t\t\t8400BA790B60F36F00FB16B3 /* ProxyConnect.vcproj */,\n\t\t\t\t8400BA7A0B60F36F00FB16B3 /* stdafx.cpp */,\n\t\t\t\t8400BA7B0B60F36F00FB16B3 /* stdafx.h */,\n\t\t\t);\n\t\t\tpath = ProxyConnect;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t8400BA7E0B60F36F00FB16B3 /* RSA */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t8400BA7F0B60F36F00FB16B3 /* Code.cpp */,\n\t\t\t\t8400BA800B60F36F00FB16B3 /* Commonf.cpp */,\n\t\t\t\t8400BA810B60F36F00FB16B3 /* Commonf.h */,\n\t\t\t\t8400BA820B60F36F00FB16B3 /* Function.h */,\n\t\t\t\t8400BA830B60F36F00FB16B3 /* Gsimply.cpp */,\n\t\t\t\t8400BA840B60F36F00FB16B3 /* Gsimply.h */,\n\t\t\t\t8400BA850B60F36F00FB16B3 /* Hnfunct.cpp */,\n\t\t\t\t8400BA860B60F36F00FB16B3 /* Hnfunct.h */,\n\t\t\t\t8400BA870B60F36F00FB16B3 /* Hnumber.cpp */,\n\t\t\t\t8400BA880B60F36F00FB16B3 /* HNumber.h */,\n\t\t\t\t8400BA890B60F36F00FB16B3 /* Keys.cpp */,\n\t\t\t\t8400BA8A0B60F36F00FB16B3 /* Keys_main.cpp */,\n\t\t\t\t8400BA8B0B60F36F00FB16B3 /* Mynum.cpp */,\n\t\t\t\t8400BA8C0B60F36F00FB16B3 /* MyNum.h */,\n\t\t\t\t8400BA8D0B60F36F00FB16B3 /* Myprint.cpp */,\n\t\t\t\t8400BA8E0B60F36F00FB16B3 /* Myprint.h */,\n\t\t\t\t8400BA8F0B60F36F00FB16B3 /* MyTypes.h */,\n\t\t\t\t8400BA900B60F36F00FB16B3 /* Operator.cpp */,\n\t\t\t\t8400BA910B60F36F00FB16B3 /* Operator.h */,\n\t\t\t\t8400BA920B60F36F00FB16B3 /* PrimeGen.cpp */,\n\t\t\t\t8400BA930B60F36F00FB16B3 /* Profiler.h */,\n\t\t\t\t8400BA940B60F36F00FB16B3 /* RSA.dsp */,\n\t\t\t\t8400BA950B60F36F00FB16B3 /* RSA.vcproj */,\n\t\t\t\t8400BA960B60F36F00FB16B3 /* stdafx.cpp */,\n\t\t\t\t8400BA970B60F36F00FB16B3 /* StdAfx.h */,\n\t\t\t\t8400BA980B60F36F00FB16B3 /* TMSG.H */,\n\t\t\t);\n\t\t\tpath = RSA;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tAB7449FD09968AF50046F588 /* APISocket */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tAB7449FE09968AF50046F588 /* APISocket.h */,\n\t\t\t\tAB7449FF09968AF50046F588 /* ClientSocket.cpp */,\n\t\t\t\tAB744A0009968AF50046F588 /* ServerSocket.cpp */,\n\t\t\t\tAB744A0109968AF50046F588 /* Socket.cpp */,\n\t\t\t);\n\t\t\tpath = APISocket;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tAB744A0209968AF50046F588 /* OpenSSL */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tAB744A0309968AF50046F588 /* aes.h */,\n\t\t\t\tAB744A0409968AF60046F588 /* aes_core.c */,\n\t\t\t\tAB744A0509968AF60046F588 /* aes_locl.h */,\n\t\t\t\tAB744A0609968AF60046F588 /* e_os2.h */,\n\t\t\t\tAB744A0909968AF60046F588 /* opensslconf.h */,\n\t\t\t);\n\t\t\tpath = OpenSSL;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tAB744A0A09968AF60046F588 /* ProxyConnect */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tAB744A0B09968AF60046F588 /* global.h */,\n\t\t\t\tAB744A0C09968AF60046F588 /* md4.cpp */,\n\t\t\t\tAB744A0D09968AF60046F588 /* md4.h */,\n\t\t\t\tAB744A0E09968AF60046F588 /* md5.cpp */,\n\t\t\t\tAB744A0F09968AF60046F588 /* md5.h */,\n\t\t\t\tAB744A1009968AF60046F588 /* ntlm.h */,\n\t\t\t\tAB744A1109968AF60046F588 /* ntlmv2.cpp */,\n\t\t\t\tAB744A1209968AF60046F588 /* ProxyConnect.cpp */,\n\t\t\t\tAB744A1409968AF60046F588 /* ProxyConnect.h */,\n\t\t\t\tAB744A1609968AF60046F588 /* stdafx.cpp */,\n\t\t\t\tAB744A1709968AF60046F588 /* stdafx.h */,\n\t\t\t);\n\t\t\tpath = ProxyConnect;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tAB744A1809968AF60046F588 /* RSA */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tAB744A1909968AF60046F588 /* Code.cpp */,\n\t\t\t\tAB744A1A09968AF60046F588 /* Commonf.cpp */,\n\t\t\t\tAB744A1B09968AF60046F588 /* Commonf.h */,\n\t\t\t\tAB744A1C09968AF60046F588 /* Function.h */,\n\t\t\t\tAB744A1D09968AF60046F588 /* Gsimply.cpp */,\n\t\t\t\tAB744A1E09968AF60046F588 /* Gsimply.h */,\n\t\t\t\tAB744A1F09968AF60046F588 /* Hnfunct.cpp */,\n\t\t\t\tAB744A2009968AF60046F588 /* Hnfunct.h */,\n\t\t\t\tAB744A2109968AF60046F588 /* Hnumber.cpp */,\n\t\t\t\tAB744A2209968AF60046F588 /* HNumber.h */,\n\t\t\t\tAB744A2309968AF60046F588 /* Keys.cpp */,\n\t\t\t\tAB744A2409968AF60046F588 /* Keys_main.cpp */,\n\t\t\t\tAB744A2509968AF60046F588 /* Mynum.cpp */,\n\t\t\t\tAB744A2609968AF60046F588 /* MyNum.h */,\n\t\t\t\tAB744A2709968AF60046F588 /* Myprint.cpp */,\n\t\t\t\tAB744A2809968AF60046F588 /* Myprint.h */,\n\t\t\t\tAB744A2909968AF60046F588 /* MyTypes.h */,\n\t\t\t\tAB744A2A09968AF60046F588 /* Operator.cpp */,\n\t\t\t\tAB744A2B09968AF60046F588 /* Operator.h */,\n\t\t\t\tAB744A2C09968AF60046F588 /* PrimeGen.cpp */,\n\t\t\t\tAB744A2D09968AF70046F588 /* Profiler.h */,\n\t\t\t\tAB744A3009968AF70046F588 /* stdafx.cpp */,\n\t\t\t\tAB744A3109968AF70046F588 /* StdAfx.h */,\n\t\t\t\tAB744A3209968AF70046F588 /* TMSG.H */,\n\t\t\t);\n\t\t\tpath = RSA;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t8D5B49AC048680CD000E48DA /* Echoware */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = AB7449F309968AB50046F588 /* Build configuration list for PBXNativeTarget \"Echoware\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t8D5B49AF048680CD000E48DA /* Resources */,\n\t\t\t\t8D5B49B1048680CD000E48DA /* Sources */,\n\t\t\t\t8D5B49B3048680CD000E48DA /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = Echoware;\n\t\t\tproductInstallPath = \"$(HOME)/Library/Bundles\";\n\t\t\tproductName = Echoware;\n\t\t\tproductReference = 8D5B49B6048680CD000E48DA /* Echoware.bundle */;\n\t\t\tproductType = \"com.apple.product-type.bundle\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t089C1669FE841209C02AAC07 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tbuildConfigurationList = AB7449F709968AB50046F588 /* Build configuration list for PBXProject \"Echoware\" */;\n\t\t\thasScannedForEncodings = 1;\n\t\t\tmainGroup = 089C166AFE841209C02AAC07 /* Echoware */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectReferences = (\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 8400BA490B60F36F00FB16B3 /* Products */;\n\t\t\t\t\tProjectRef = 8400BA480B60F36F00FB16B3 /* Echoware.xcodeproj */;\n\t\t\t\t},\n\t\t\t);\n\t\t\ttargets = (\n\t\t\t\t8D5B49AC048680CD000E48DA /* Echoware */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t8D5B49AF048680CD000E48DA /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */,\n\t\t\t\tAB744AE50996A1320046F588 /* EchoServers.nib in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t8D5B49B1048680CD000E48DA /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tAB87EAEF09B8E11900AC7E96 /* CritSection.cpp in Sources */,\n\t\t\t\tAB87EB2E09B8E2FE00AC7E96 /* EchoController.m in Sources */,\n\t\t\t\tAB87EB3B09B8E3B000AC7E96 /* ACConnection.cpp in Sources */,\n\t\t\t\tAB87EBFE09B8E87B00AC7E96 /* AES.cpp in Sources */,\n\t\t\t\tAB87EC0009B8E88200AC7E96 /* blowfish.cpp in Sources */,\n\t\t\t\tAB87EC0509B8E8B100AC7E96 /* DataChannel.cpp in Sources */,\n\t\t\t\tAB87EC5609B8F13F00AC7E96 /* DataChannels.cpp in Sources */,\n\t\t\t\tAB87EC5709B8F14000AC7E96 /* DataChannelSocket.cpp in Sources */,\n\t\t\t\tAB87EC5809B8F14200AC7E96 /* DllProxyInfo.cpp in Sources */,\n\t\t\t\tAB87EC5A09B8F15000AC7E96 /* stdafx.cpp in Sources */,\n\t\t\t\tAB87EC5C09B8F15300AC7E96 /* EchoSrvDataChannel.cpp in Sources */,\n\t\t\t\tAB87EC5D09B8F15400AC7E96 /* Echoware.cpp in Sources */,\n\t\t\t\tAB87EC5E09B8F15500AC7E96 /* Globals.cpp in Sources */,\n\t\t\t\tAB87EC5F09B8F15600AC7E96 /* LocalDataChannel.cpp in Sources */,\n\t\t\t\tAB87EC6009B8F15800AC7E96 /* LocalListener.cpp in Sources */,\n\t\t\t\tAB87EC6109B8F15900AC7E96 /* LocalProxyConnection.cpp in Sources */,\n\t\t\t\tAB87EC6209B8F15A00AC7E96 /* Logger.cpp in Sources */,\n\t\t\t\tAB87EC6309B8F15B00AC7E96 /* ProxiesManager.cpp in Sources */,\n\t\t\t\tAB87EC6409B8F15C00AC7E96 /* ProxyConnection.cpp in Sources */,\n\t\t\t\tAB87ECF309BB3B8E00AC7E96 /* Code.cpp in Sources */,\n\t\t\t\tAB87ECF409BB3B8F00AC7E96 /* Commonf.cpp in Sources */,\n\t\t\t\tAB87ECF609BB3B9100AC7E96 /* Hnfunct.cpp in Sources */,\n\t\t\t\tAB87ECF709BB3B9200AC7E96 /* Hnumber.cpp in Sources */,\n\t\t\t\tAB87ECF809BB3B9400AC7E96 /* Keys.cpp in Sources */,\n\t\t\t\tAB87ECF909BB3B9500AC7E96 /* Keys_main.cpp in Sources */,\n\t\t\t\tAB87ECFA09BB3B9600AC7E96 /* Mynum.cpp in Sources */,\n\t\t\t\tAB87ECFB09BB3B9700AC7E96 /* Myprint.cpp in Sources */,\n\t\t\t\tAB87ECFC09BB3B9700AC7E96 /* Operator.cpp in Sources */,\n\t\t\t\tAB87ECFD09BB3B9800AC7E96 /* PrimeGen.cpp in Sources */,\n\t\t\t\tAB87ED0009BB3B9A00AC7E96 /* stdafx.cpp in Sources */,\n\t\t\t\tAB87F13B09C1F95100AC7E96 /* RSAKeys.cpp in Sources */,\n\t\t\t\tAB87F1A209C1FE2700AC7E96 /* aes_core.c in Sources */,\n\t\t\t\tAB87F1A409C1FE3300AC7E96 /* md4.cpp in Sources */,\n\t\t\t\tAB87F1A509C1FE3300AC7E96 /* md5.cpp in Sources */,\n\t\t\t\tAB87F1A809C1FE3B00AC7E96 /* stdafx.cpp in Sources */,\n\t\t\t\tAB87F1AB09C1FE5E00AC7E96 /* Gsimply.cpp in Sources */,\n\t\t\t\tAB87F2D009C211AB00AC7E96 /* ProxyConnect.cpp in Sources */,\n\t\t\t\tAB87F2D109C211AC00AC7E96 /* ntlmv2.cpp in Sources */,\n\t\t\t\tAB87F5A109C5FFC100AC7E96 /* ClientSocket.cpp in Sources */,\n\t\t\t\tAB87F5D609C602A500AC7E96 /* ServerSocket.cpp in Sources */,\n\t\t\t\tAB87F5DB09C602BB00AC7E96 /* Socket.cpp in Sources */,\n\t\t\t\tAB090FFA09DB286900098B1F /* EchoToOSX.cpp in Sources */,\n\t\t\t\t84D60B3E0B5BBF2400D9EBCB /* MyDllProxyInfo.cpp in Sources */,\n\t\t\t\t848C41200B848FDC00BD11B3 /* rfbserver.cpp in Sources */,\n\t\t\t\t84AFF1420B8C841D00D93058 /* ServerListSynchronize.cpp in Sources */,\n\t\t\t\t84AF48A50BCCD42400C5BF0A /* DirService.cpp in Sources */,\n\t\t\t\t84AF49020BCCD76E00C5BF0A /* User.cpp in Sources */,\n\t\t\t\t8400341A0BCD0E4900D03C1B /* RFBBundleWrapper.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXVariantGroup section */\n\t\t089C167DFE841241C02AAC07 /* InfoPlist.strings */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t089C167EFE841241C02AAC07 /* English */,\n\t\t\t);\n\t\t\tname = InfoPlist.strings;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t8400BA530B60F36F00FB16B3 /* InfoPlist.strings */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t8400BA540B60F36F00FB16B3 /* English */,\n\t\t\t);\n\t\t\tname = InfoPlist.strings;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tAB744AE30996A1320046F588 /* EchoServers.nib */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\tAB744AE40996A1320046F588 /* English */,\n\t\t\t);\n\t\t\tname = EchoServers.nib;\n\t\t\tsourceTree = SOURCE_ROOT;\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\tAB7449F409968AB50046F588 /* Development */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tARCHS = (\n\t\t\t\t\ti386,\n\t\t\t\t\tppc,\n\t\t\t\t\tppc7400,\n\t\t\t\t);\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_ENABLE_FIX_AND_CONTINUE = YES;\n\t\t\t\tGCC_GENERATE_DEBUGGING_SYMBOLS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = Echoware_Prefix.pch;\n\t\t\t\tHEADER_SEARCH_PATHS = \"$(SRCROOT)/\";\n\t\t\t\tINFOPLIST_FILE = Info.plist;\n\t\t\t\tINSTALL_PATH = \"$(HOME)/Library/Bundles\";\n\t\t\t\tPRODUCT_NAME = Echoware;\n\t\t\t\tWRAPPER_EXTENSION = bundle;\n\t\t\t\tZERO_LINK = YES;\n\t\t\t};\n\t\t\tname = Development;\n\t\t};\n\t\tAB7449F509968AB50046F588 /* Deployment */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tGCC_ENABLE_FIX_AND_CONTINUE = NO;\n\t\t\t\tGCC_GENERATE_DEBUGGING_SYMBOLS = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = Echoware_Prefix.pch;\n\t\t\t\tINFOPLIST_FILE = Info.plist;\n\t\t\t\tINSTALL_MODE_FLAG = rwx;\n\t\t\t\tINSTALL_PATH = \"$(HOME)/Library/Bundles\";\n\t\t\t\tPRODUCT_NAME = Echoware;\n\t\t\t\tWRAPPER_EXTENSION = bundle;\n\t\t\t\tZERO_LINK = NO;\n\t\t\t};\n\t\t\tname = Deployment;\n\t\t};\n\t\tAB7449F609968AB50046F588 /* Default */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tGCC_GENERATE_DEBUGGING_SYMBOLS = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = Echoware_Prefix.pch;\n\t\t\t\tINFOPLIST_FILE = Info.plist;\n\t\t\t\tINSTALL_PATH = \"$(HOME)/Library/Bundles\";\n\t\t\t\tPRODUCT_NAME = Echoware;\n\t\t\t\tWRAPPER_EXTENSION = bundle;\n\t\t\t};\n\t\t\tname = Default;\n\t\t};\n\t\tAB7449F809968AB50046F588 /* Development */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tARCHS = (\n\t\t\t\t\tppc,\n\t\t\t\t\ti386,\n\t\t\t\t);\n\t\t\t\tBUNDLE_LOADER = \"\";\n\t\t\t\tCONFIGURATION_BUILD_DIR = \"$(BUILD_DIR)\";\n\t\t\t\tGCC_MODEL_TUNING = G3;\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = YES;\n\t\t\t\tGCC_VERSION = 4.0;\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(HEADER_SEARCH_PATHS)\",\n\t\t\t\t\t../,\n\t\t\t\t);\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.3;\n\t\t\t\tOTHER_LDFLAGS = \"\";\n\t\t\t\tSDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;\n\t\t\t\tSTANDARD_C_PLUS_PLUS_LIBRARY_TYPE = dynamic;\n\t\t\t\tSYMROOT = \"/Users/admin/Projects/Vine Server.app/Contents/Resources\";\n\t\t\t};\n\t\t\tname = Development;\n\t\t};\n\t\tAB7449F909968AB50046F588 /* Deployment */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tARCHS = (\n\t\t\t\t\tppc,\n\t\t\t\t\ti386,\n\t\t\t\t);\n\t\t\t\tBUNDLE_LOADER = \"$(inherited)\";\n\t\t\t\tCONFIGURATION_BUILD_DIR = \"$(BUILD_DIR)\";\n\t\t\t\tCONFIGURATION_TEMP_DIR = \"$(PROJECT_TEMP_DIR)/$(CONFIGURATION)\";\n\t\t\t\tGCC_CHAR_IS_UNSIGNED_CHAR = NO;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tGCC_ENABLE_OBJC_EXCEPTIONS = NO;\n\t\t\t\tGCC_ENABLE_TRIGRAPHS = NO;\n\t\t\t\tGCC_GENERATE_DEBUGGING_SYMBOLS = NO;\n\t\t\t\tGCC_MODEL_TUNING = G3;\n\t\t\t\tGCC_NO_NIL_RECEIVERS = NO;\n\t\t\t\tGCC_PFE_FILE_C_DIALECTS = \"$(inherited)\";\n\t\t\t\tGCC_SHORT_ENUMS = NO;\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = YES;\n\t\t\t\tGCC_VERSION = 4.0;\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(HEADER_SEARCH_PATHS)\",\n\t\t\t\t\t../,\n\t\t\t\t);\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.3;\n\t\t\t\tOBJROOT = \"$(PROJECT_TEMP_DIR)\";\n\t\t\t\tOTHER_LDFLAGS = \"-lstdc++\";\n\t\t\t\tREZ_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tSDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;\n\t\t\t\tSTANDARD_C_PLUS_PLUS_LIBRARY_TYPE = dynamic;\n\t\t\t\tSYMROOT = \"/Users/admin/Projects/Vine Server.app/Contents/Resources\";\n\t\t\t};\n\t\t\tname = Deployment;\n\t\t};\n\t\tAB7449FA09968AB50046F588 /* Default */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tGCC_MODEL_TUNING = G3;\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = YES;\n\t\t\t\tGCC_VERSION = 3.3;\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(HEADER_SEARCH_PATHS)\",\n\t\t\t\t\t../,\n\t\t\t\t);\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.3;\n\t\t\t\tOTHER_LDFLAGS = \"-lstdc++\";\n\t\t\t\tSDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;\n\t\t\t\tSTANDARD_C_PLUS_PLUS_LIBRARY_TYPE = dynamic;\n\t\t\t\tSYMROOT = \"/Users/admin/Projects/Vine Server.app/Contents/Resources\";\n\t\t\t};\n\t\t\tname = Default;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\tAB7449F309968AB50046F588 /* Build configuration list for PBXNativeTarget \"Echoware\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tAB7449F409968AB50046F588 /* Development */,\n\t\t\t\tAB7449F509968AB50046F588 /* Deployment */,\n\t\t\t\tAB7449F609968AB50046F588 /* Default */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Default;\n\t\t};\n\t\tAB7449F709968AB50046F588 /* Build configuration list for PBXProject \"Echoware\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tAB7449F809968AB50046F588 /* Development */,\n\t\t\t\tAB7449F909968AB50046F588 /* Deployment */,\n\t\t\t\tAB7449FA09968AB50046F588 /* Default */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Default;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 089C1669FE841209C02AAC07 /* Project object */;\n}\n"
  },
  {
    "path": "Bundles/Echoware/Echoware_Prefix.pch",
    "content": "//\n// Prefix header for all source files of the 'Echoware' target in the 'Echoware' project.\n//\n\n#ifdef __OBJC__\n    #import <Cocoa/Cocoa.h>\n#endif\n"
  },
  {
    "path": "Bundles/Echoware/English.lproj/EchoServers.nib/classes.nib",
    "content": "{\n    IBClasses = (\n        {\n            ACTIONS = {\n                addServer = id;\n                advancedSettings = id;\n                cancelAddServer = id;\n                cancelAdvancedSettings = id;\n                cancelEditServer = id;\n                completeAddServer = id;\n                completeAdvancedSettings = id;\n                completeEditServer = id;\n                disableEcho = id;\n                editServer = id;\n                enableLogging = id;\n                loadGUI = id;\n                removeServer = id;\n                requireProxyAuthentication = id;\n                setOffloadingPort = id;\n                useEncryption = id;\n            };\n            CLASS = EchoController;\n            LANGUAGE = ObjC;\n            OUTLETS = {\n                addButton = NSButton;\n                addServerWindow = NSWindow;\n                advancedSettingsButton = NSButton;\n                advancedSettingsWindow = NSWindow;\n                disableEchoCheckbox = NSButton;\n                echoServerField = NSTextFieldCell;\n                \"echoServerField_edit\" = NSTextFieldCell;\n                echoServersView = NSView;\n                echoTableView = NSTableView;\n                editButton = NSButton;\n                editServerWindow = NSWindow;\n                enableLoggingCheckbox = NSButton;\n                passwordField = NSTextFieldCell;\n                \"passwordField_edit\" = NSTextFieldCell;\n                proxyAddress = NSTextField;\n                proxyAuthenticationCheckbox = NSButton;\n                proxyPassword = NSTextField;\n                proxyPasswordLabel = NSTextField;\n                proxyPort = NSTextField;\n                proxyUsername = NSTextField;\n                proxyUsernameLabel = NSTextField;\n                removeButton = NSButton;\n                usernameField = NSTextFieldCell;\n                \"usernameField_edit\" = NSTextFieldCell;\n                versionTextField = NSTextField;\n            };\n            SUPERCLASS = NSObject;\n        },\n        {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }\n    );\n    IBVersion = 1;\n}"
  },
  {
    "path": "Bundles/Echoware/English.lproj/EchoServers.nib/info.nib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>IBDocumentLocation</key>\n\t<string>37 274 648 379 0 0 1024 746 </string>\n\t<key>IBFramework Version</key>\n\t<string>446.1</string>\n\t<key>IBLockedTabItems</key>\n\t<array>\n\t\t<integer>20</integer>\n\t</array>\n\t<key>IBSystem Version</key>\n\t<string>8A428</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "Bundles/Echoware/Globals.cpp",
    "content": "#include \"stdafx.h\"\n#include \"Globals.h\"\n\n//#include <Winsock2.h>\n\nCGlobals g_globals;\n\nCGlobals::CGlobals()\n{\n\tm_bIsDllInitialized=false;\n\tm_nPortForOffLoadingData=0;\n}\n\nCGlobals::~CGlobals()\n{\n\tif (g_globals.GetDllInitialized())\n\t{\n\t\tg_globals.m_logger.Write(\"ReleaseSockets\");\n\t\tg_globals.ReleaseSockets();\n\t}\n}\n\nbool CGlobals::InitSockets(unsigned char nHighVersion, unsigned char nLowVersion)\n{\n// No Socket System Init Needed on OSX\n//\tWORD wVersionRequested;\n//\tWSADATA wsaData;\n//\tint err;\n//\n//\twVersionRequested = MAKEWORD(nLowVersion, nHighVersion);\n//\n//\terr = WSAStartup( wVersionRequested, &wsaData );\n//\tif (err!=0)\n//\t\treturn false;\n//\n//\tif (LOBYTE(wsaData.wVersion)!=nLowVersion || HIBYTE(wsaData.wVersion)!=nHighVersion)\n//\t{\n//\t\tWSACleanup();\n//\t\treturn false;\n//\t}\n\treturn true;\n}\n\nbool CGlobals::ReleaseSockets()\n{\n// No Socket System Init Needed on OSX\n//\tif (WSACleanup()==0)\n//\t\treturn true;\n//\n//\tif (WSAGetLastError()==WSAEINPROGRESS)\n//\t\treturn false;\n\treturn true;\n}\n\nvoid CGlobals::SetDllInitialized(bool bIsDllInitialized)\n{\n\tm_critSection.Lock();\n\n\tm_bIsDllInitialized=bIsDllInitialized;\n\n\tm_critSection.Unlock();\n}\n\nbool CGlobals::GetDllInitialized()\n{\n\tbool bRet;\n\n\tm_critSection.Lock();\n\n\tbRet=m_bIsDllInitialized;\n\n\tm_critSection.Unlock();\n\n\treturn bRet;\n}\n\nvoid CGlobals::SetPortForOffLoadingData(int nPortForOffLoadingData)\n{\n\tm_critSection.Lock();\n\n\tm_nPortForOffLoadingData=nPortForOffLoadingData;\n\n\tm_critSection.Unlock();\n}\n\nint CGlobals::GetPortForOffLoadingData()\n{\n\tint nRet;\n\n\tm_critSection.Lock();\n\n\tnRet=m_nPortForOffLoadingData;\n\n\tm_critSection.Unlock();\n\n\treturn nRet;\n}\n//-----------------------------------------------------------------------------------------\n\nint CGlobals::GetFormattedID(char *szBuffer, int len, const char* szPartner)\n{\n\tif (len < ID_STRING_SIZE)\n\t\treturn -1;\n\tmemset(szBuffer, 0, len);\n\tchar *pColon;\n\tpColon = strrchr( szPartner, ':');\n\tif (pColon == NULL)\n\t{\n\t\tstrcpy(szBuffer + CLIENT_ID_OFFSET, szPartner);\n\t\treturn 0;\n\t}\n\telse\n\t{\n\t\tstrncpy(szBuffer + CLIENT_ID_OFFSET, szPartner, (int)(pColon - szPartner));\n\t\tstrcpy(szBuffer + APP_ID_OFFSET, szPartner + (int)(pColon - szPartner + 1));\n\t\treturn 1;\n\t}\n}\n//-----------------------------------------------------------------------------------------\n\nint CGlobals::ParseFormattedID(char *szBuffer, int len, char* szPartner)\n{\n\tmemset(szPartner, 0, len);\n\tif (szBuffer + APP_ID_OFFSET != NULL)\n\t{\n\t\tsprintf(szPartner, \"%s:%s\", szBuffer, szBuffer + APP_ID_OFFSET);\n\t}\n\telse\n\t\tsprintf(szPartner, \"%s\", szBuffer);\n\treturn ID_STRING_SIZE;\n}\n//-----------------------------------------------------------------------------------------\n"
  },
  {
    "path": "Bundles/Echoware/Globals.h",
    "content": "#ifndef _GLOBALS_H\n#define _GLOBALS_H\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n#define CHANNEL_CODE_SIZE\t11\n#define ID_STRING_SIZE\t\t255\n\n#define CLIENT_ID_OFFSET\t\t 0\n#define APP_ID_OFFSET\t\t\t64\n#define APP_INDEX_OFFSET\t\t96\n#define ECHO_VERSION_OFFSET\t\t128\n#define RESERVED_OFFSET\t\t\t136\n\n#include \"Logger.h\"\n#include \"CritSection.h\"\n#include \"ProxiesManager.h\"\n\n// in miliseconds\n#define THREAD_STOP_TIMEOUT 2000\n#define CONNECTION_TO_OFFLOAD_TIMER_VALUE\t3000\n#define RECONNECTION_TO_OFFLOAD_TIMER_VALUE\t500\n#define RECONNECTION_COUNT\t\t\t\t\t3\n\nclass CGlobals\n{\npublic:\n\tCGlobals();\n\tvirtual ~CGlobals();\n\n\tvoid SetDllInitialized(bool bIsDllInitialized=true);\n\tbool GetDllInitialized();\n\n\tvoid SetPortForOffLoadingData(int nPortForOffLoadingData);\n\tint GetPortForOffLoadingData();\n\n\tbool InitSockets(unsigned char nHighVersion, unsigned char nLowVersion);\n\tbool ReleaseSockets();\n\n\t//format the MyID to the CONNECT_TO_PEER message format\n\t//[out szBuffer]\tresult of formating\n\t//[in len]\t\t\tinput length of the szBuffer\n\t//[in szPartner]\tPeer Id in the form \"ClientID:App1,App2\"\n\t//[return] 0 if there is no appid and 1 if ithere is some, -1 if error\n\tint GetFormattedID(char *szBuffer, int len, const char* szPartner);\n\n\tint ParseFormattedID(char *szBuffer, int len, char* szPartner);\n\npublic:\n\tCLogger m_logger;\n\n\t//proxies list manager\n\tCProxiesManager m_proxiesManager;\n\nprotected:\n\tbool m_bIsDllInitialized;\n\tint m_nPortForOffLoadingData;\n\n\tCCritSection m_critSection;\n};\n\nextern CGlobals g_globals;\n\n//a generic buffer class\nclass CBuffer\n{\npublic:\n\tCBuffer(unsigned int size=1024)\n\t{\n\t\tm_buff=new char[size];\n\n\t\tm_nSize=size;\n\t\tm_nWritePosition=0;\n\t}\n\n\tvirtual ~CBuffer()\n\t{\n\t\tdelete []m_buff;\n\t}\n\n\tvoid Write(void* buff, unsigned int write_size)\n\t{\n\t\t//g_globals.m_logger.WriteFormated(\"=>CBuffer: Write len=%d\", write_size);\n\n\t\tm_critSection.Lock();\n\n\t\tif (write_size>m_nSize-m_nWritePosition)\n\t\t{\n\t\t\tchar* tmp=new char[m_nWritePosition+write_size];\n\t\t\tmemcpy(tmp, m_buff, m_nWritePosition);\n\n\t\t\tdelete []m_buff;\n\n\t\t\tm_buff=tmp;\n\n\t\t\tm_nSize=m_nWritePosition+write_size;\n\t\t}\n\n\t\tmemcpy(m_buff+m_nWritePosition, buff, write_size);\n\n\t\tm_nWritePosition+=write_size;\n\n\t\tm_critSection.Unlock();\n\n\t\t//g_globals.m_logger.WriteFormated(\"<=CBuffer: Write len=%d\", write_size);\n\t}\n\n\tunsigned int Read(void* buff, unsigned int read_size)\n\t{\n\t\t//g_globals.m_logger.WriteFormated(\"=>CBuffer: Read max=%d\", read_size);\n\t\tm_critSection.Lock();\n\n\t\t//g_globals.m_logger.WriteFormated(\"read_size=%d m_nWritePos=%d\", read_size, m_nWritePosition);\n\n\t\tif (read_size>m_nWritePosition)\n\t\t\tread_size=m_nWritePosition;\n\n\t\tmemcpy(buff, m_buff, read_size);\n\t\tmemmove(m_buff, m_buff+read_size, m_nWritePosition-read_size);\n\n\t\tm_nWritePosition-=read_size;\n\n\t\tm_critSection.Unlock();\n\n\t\t//g_globals.m_logger.WriteFormated(\"<=CBuffer: Read len=%d\", read_size);\n\n\t\treturn read_size;\n\t}\n\n\tunsigned int Peak(void* buff, unsigned int read_size)\n\t{\n\t\tm_critSection.Lock();\n\n\t\tif (read_size>m_nWritePosition)\n\t\t\tread_size=m_nWritePosition;\n\n\t\tmemcpy(buff, m_buff, read_size);\n\n\t\tm_critSection.Unlock();\n\n\t\treturn read_size;\n\t}\n\n\tunsigned int Size()\n\t{\n\t\treturn m_nWritePosition;\n\t}\n\n\tvoid Drop(unsigned int drop_size)\n\t{\n\t\tm_critSection.Lock();\n\n\t\tif (drop_size>=m_nWritePosition)\n\t\t{\n\t\t\t//drop all\n\t\t\tm_nWritePosition=0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmemmove(m_buff, m_buff+drop_size, m_nWritePosition-drop_size);\n\n\t\t\tm_nWritePosition-=drop_size;\n\t\t}\n\n\t\tm_critSection.Unlock();\n\t}\n\n\tvoid Empty()\n\t{\n\t\tm_nWritePosition=0;\n\t}\n\nprotected:\n\tchar* m_buff;\n\tunsigned int m_nSize;\n\tunsigned int m_nWritePosition;\n\n\tCCritSection m_critSection;\n};\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>English</string>\n\t<key>CFBundleExecutable</key>\n\t<string>Echoware</string>\n\t<key>CFBundleIconFile</key>\n\t<string></string>\n\t<key>CFBundleIdentifier</key>\n\t<string>com.yourcompany.yourcocoabundle</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundlePackageType</key>\n\t<string>BNDL</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1.0</string>\n\t<key>NSPrincipalClass</key>\n\t<string></string>\n</dict>\n</plist>\n"
  },
  {
    "path": "Bundles/Echoware/InterfaceDllProxyInfo.h",
    "content": "#ifndef _INTERFACE_DLL_PROXY_INFO_H\n#define _INTERFACE_DLL_PROXY_INFO_H\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n//enum\n//{\n//\tSTATUS_MSG_BASE = WM_USER + 3000,\n\n#define STATUS_CONNECTING\t\t\t\t\t0x00000001\n#define STATUS_CONNECTED\t\t\t\t\t0x00000002\n#define STATUS_AUTHENTICATING\t\t\t\t0x00000004\n#define STATUS_AUTHENTICATION_FAILED\t\t0x00000008\n#define STATUS_ESTABLISHING_DATA_CHANNEL\t0x00000010\n#define STATUS_SEARCHING_FOR_PARTNER\t\t0x00000020\n#define STATUS_DISCONNECTED_FROM_PROXY\t\t0x00000040\n\n//\tSTATUS_MSG_LAST\n//};\n\nenum\n{\n\tERROR_CONNECTING_TO_PROXY = -1,\n\tCONNECTION_SUCCESSFUL,\n\tNO_PROXY_SERVER_FOUND_TO_CONNECT,\n\tAUTHENTICATION_FAILED,\n\tPROXY_ALREADY_CONNECTED,\n\tCONNECTION_TIMED_OUT,\n\tID_FOUND_EMPTY\n};\n\nclass IDllProxyInfo\n{\npublic:\n\tvirtual void SetName(char* name) = 0;\n\tvirtual void SetIPPort(char* ipport) = 0;\n\tvirtual void SetIP(const char* ip) = 0;\n\tvirtual void SetPort(const char* port) = 0;\n\tvirtual void SetPassword(const char* pass) = 0;\n\tvirtual void SetStatus(int Status, bool bStatus) = 0;\n\tvirtual bool SetMyID(const char* MyID) = 0;\n\tvirtual bool SetSocketTimeout(int connectTimeout, int ReceiveTimeout, int SendTimeout) =0;\n\tvirtual void SetReconnectProxy(bool bReconnectProxy) = 0;\n\n\tvirtual const char* GetName() const= 0;\n\tvirtual const char* GetIpPort() const= 0;\n\tvirtual const char* GetIP() const= 0;\n\tvirtual const char* GetPort() const= 0;\n\tvirtual const char* GetPassword() const= 0;\n\tvirtual int\t  GetStatus() const= 0;\n\tvirtual\tconst char* GetMyID() const= 0;\n\tvirtual bool GetReconnectProxy()const = 0;\n};\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/LICENSE.txt",
    "content": "EchoWare OSX Bundle 1.926\n9 August 07\n\nThe openssl material used in EchoWare comes with license material that\nis appended to the end of this document.\n\n  EchoWare License\n  ----------------\n\nEchoWare is Copyright (C) 2004-2007 Echogent Systems, Inc. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n  * Redistributions of source code must retain the above copyright notice,\n    this list of conditions and the following disclaimer.\n\n  * Redistributions in binary form must reproduce the above copyright notice,\n    this list of conditions and the following disclaimer in the documentation\n    and/or other materials provided with the distribution.\n\n  * Redistributions in any form must be accompanied by information on how\n    to obtain complete source code for the echoware software and any\n    accompanying software that uses the echoware software. The source code\n    must either be included in the distribution or be available for no more\n    than the cost of distribution plus a nominal fee, and must be freely\n    redistributable under reasonable conditions. For an executable file,\n    complete source code means the source code for all modules it contains.\n    It does not include source code for modules or files that typically\n    accompany the major components of the operating system on which the\n    executable file runs.\n\nTHIS SOFTWARE IS PROVIDED BY ECHOGENT SYSTEMS, INC. ``AS IS'' AND ANY EXPRESS\nOR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT,\nARE DISCLAIMED. IN NO EVENT SHALL ECHOGENT SYSTEMS, INC. BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\nTHIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nFor more informationL: echoware@echogent.com\n\n\n  OpenSSL License\n  ---------------\n\n/* ====================================================================\n * Copyright (c) 1998-2004 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n  Original SSLeay License\n  -----------------------\n\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publicly available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n\n"
  },
  {
    "path": "Bundles/Echoware/LocalDataChannel.cpp",
    "content": "\n#include \"StdAfx.h\"\n#include \"LocalDataChannel.h\"\n#include \"DataChannel.h\"\n#include \"globals.h\"\n\nCLocalDataChannel::CLocalDataChannel(CDataChannel* pDataChannel)\n:CDataChannelSocket(pDataChannel)\n{\n\tm_bRFB=false;\n}\n\nCLocalDataChannel::~CLocalDataChannel(void)\n{\n\tg_globals.m_logger.WriteFormated(\"~CLocalDataChannel: send buff=%d, rec buff=%d\", m_pSendBuffer->Size(), m_pRecvBuffer->Size());\n}\n\nvoid crypt_data(const unsigned char *in, unsigned char *out, int length, const AES_KEY *key, const int enc)\n{\n\tunsigned long len = length;\n\tunsigned char tmp[AES_BLOCK_SIZE];\n\n\twhile (len >= AES_BLOCK_SIZE)\n\t{\n\t\tmemset(tmp,0,AES_BLOCK_SIZE);\n\t\tmemcpy(tmp,in,AES_BLOCK_SIZE);\n\n\t\tif (AES_ENCRYPT == enc)\n\t\t{\n\t\t\tAES_encrypt(tmp, out, key);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tAES_decrypt(tmp, out, key);\n\t\t}\n\n\t\tlen -= AES_BLOCK_SIZE;\n\t\tin += AES_BLOCK_SIZE;\n\t\tout += AES_BLOCK_SIZE;\n\t}\n\n\tif (len)\n\t{\n\t\tmemset(tmp,0,AES_BLOCK_SIZE);\n\t\tmemcpy(tmp,in,AES_BLOCK_SIZE);\n\t\tif (AES_ENCRYPT == enc)\n\t\t{\n\t\t\tAES_encrypt(tmp, tmp, key);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tAES_decrypt(tmp, tmp, key);\n\t\t}\n\t\tmemcpy(out, tmp, AES_BLOCK_SIZE);\n\t}\n}\n\n//send data to local server\n//it is a notify message from CClientSocket\nvoid CLocalDataChannel::OnSend(char* buff, int& len)\n{\n\tif (!m_pDataChannel->m_bEncryptDecrypt)\n\t{\n\t\tCDataChannelSocket::OnSend(buff, len);\n\t}\n\telse\n\t{\n\t\tchar temp[17];\n\n\t\tif (m_pSendBuffer->Peak(temp, 17)<17)\n\t\t{\n\t\t\tlen=0;\n\t\t\treturn;\n\t\t}\n\n\t\tint nLength, nMsgLength;\n\n\t\tsscanf(temp, \"%d:%d\", &nMsgLength, &nLength);\n\n\t\tif (nLength>len+17)\n\t\t{\n\t\t\tlen=0;\n\t\t\treturn;\n\t\t}\n\n\t\tunsigned int read=0;\n\n\t\tif ((read=m_pSendBuffer->Peak(buff, nLength+17))<(unsigned int)nLength+17)\n\t\t{\n\t\t\tlen=0;\n\t\t\treturn;\n\t\t}\n\n\t\t//nLength=read;\n\n\t\t//g_globals.m_logger.WriteFormated(\"CLocalDataChannel: Send on data channel %p, sock=%d ip=%s: len=%d\", m_pDataChannel, m_sock, \"127.0.0.1\", nMsgLength);\n\n\t\tm_pSendBuffer->Drop(nLength+17);\n\n\t\tchar* p=new char[nLength];\n\t\tmemcpy(p, buff+17, nLength);\n\n\t\t//m_pDataChannel->m_aes.Decrypt((unsigned char*)p, nLength, (unsigned char*)buff);\n\t\t/*CAES aes;\n\t\taes.SetEncryptKey(m_pDataChannel->m_aes.m_userEncKey, 128);\n\t\taes.SetDecryptKey(m_pDataChannel->m_aes.m_userDecKey, 128);\n\n\t\taes.Decrypt((unsigned char*)p, nLength, (unsigned char*)buff);\t*/\n\n\t\tAES_KEY aesKey;\n\t\tAES_set_decrypt_key((unsigned char*)m_pDataChannel->GetSessionKey(), 128, &aesKey);\n\t\tcrypt_data((unsigned char*)p,\n\t\t\t\t\t   (unsigned char*)buff,\n\t\t\t\t\t   nLength,\n\t\t\t\t\t   &aesKey,\n\t\t\t\t\t   AES_DECRYPT );\n\n\t\tdelete []p;\n\n\t\tlen=nMsgLength;\n\t}\n}\n\n//there are received some data from local server and try to process it\n//it is a notify message from CClientSocket\nvoid CLocalDataChannel::OnReceive(char* buff, int len)\n{\n\tif (len > 0)\n\t\tg_globals.m_logger.WriteFormated(\"CLocalDataChannel::OnReceive sock = %d len = %d\", getSocket(), len);\n\n\tif (!m_pDataChannel->m_bEncryptDecrypt)\n\t\tCDataChannelSocket::OnReceive(buff, len);\n\telse\n\t{\n\t\tint nLength=len+16-len%16;\n\t\tchar temp[18];\n\t\tmemset(temp, 0, 18);\n\t\tsprintf(temp, \"%d:%d\", len, nLength);\n\t\tchar *p=new char[nLength + 17];\n\t\tmemcpy(p, temp, 17);\n\t\tAES_KEY aesKey;\n\t\tAES_set_encrypt_key((unsigned char*)m_pDataChannel->GetSessionKey(), 128, &aesKey);\n\t\tcrypt_data((unsigned char*)buff, (unsigned char*)(p + 17), nLength, &aesKey, AES_ENCRYPT);\n\t\tm_pPairChannel->WriteData(p, nLength + 17);\n\t\tdelete []p;\n\t}\n\tm_pPairChannel->Send();\n}\n\nbool CLocalDataChannel::StartSend()\n{\n\tint ret = Send();\n\treturn (ret == 0);\n}\n\n"
  },
  {
    "path": "Bundles/Echoware/LocalDataChannel.h",
    "content": "#ifndef _LOCALDATACHANNELS_H\n#define _LOCALDATACHANNELS_H\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n#include \"datachannelsocket.h\"\n\n#define RECONNECT\n\nclass CDataChannel;\n\n//local data channel class\nclass CLocalDataChannel :\n\tpublic CDataChannelSocket\n{\npublic:\n\tCLocalDataChannel(CDataChannel* pDataChannel);\n\tvirtual ~CLocalDataChannel(void);\n\n\t//notification : there are data to read\n\t//[in] len : length of data\n\t//[in] buff: data\n\tvirtual void OnReceive(char* buff, int len);\n\n\t//notification : can send data\n\t//[in] len : length of data\n\t//[in] buff: data\n\tvirtual void OnSend(char* buff, int& len);\n\n\tbool StartSend();\nprotected:\n\tbool m_bRFB;\n};\n\n#endif.30"
  },
  {
    "path": "Bundles/Echoware/LocalListener.cpp",
    "content": "#include \"StdAfx.h\"\n#include \"locallistener.h\"\n#include \"DataChannel.h\"\n\nCLocalListener::CLocalListener(CDataChannel* pDataChannel)\n{\n\tm_pDataChannel=pDataChannel;\n\tm_bAcceptConnection=false;\n}\n\nCLocalListener::~CLocalListener(void)\n{\n\tClose();\n\tStopAccept(5000);\n}\n\n//notify message\n//a local client is connected and can create a local data channel\nvoid CLocalListener::OnNewClient(unsigned int sock)\n{\n\tAPISocket::CSocket sock_obj(sock);\n\n\tsock_obj.SetSockOption(true);\n\n\tm_pDataChannel->OnLocalDataChannel(sock_obj.Detach());\n\n\tm_bAcceptConnection=false;\n}\n\nvoid CLocalListener::OnLeaveClient(APISocket::CSocket*)\n{\n\tm_bAcceptConnection=true;\n}\n"
  },
  {
    "path": "Bundles/Echoware/LocalListener.h",
    "content": "#ifndef _LOCALLISTENER_H\n#define _LOCALLISTENER_H\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n#include \"apisocket.h\"\n\nclass CDataChannel;\n\n//local listener for clients\nclass CLocalListener :\n\tpublic APISocket::CServerSocket\n{\npublic:\n\tCLocalListener(CDataChannel* pDataChannel);\n\tvirtual ~CLocalListener(void);\n\n\t//notifications\n\tvirtual void OnNewClient(unsigned int sock);\n\tvirtual void OnLeaveClient(APISocket::CSocket* pClient);\n\nprotected:\n\n\nprotected:\n\tbool m_bAcceptConnection;\n\tCDataChannel* m_pDataChannel;\n};\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/LocalProxyConnection.cpp",
    "content": "#include \"StdAfx.h\"\n#include \"LocalProxyConnection.h\"\n\nCLocalProxyConnection::CLocalProxyConnection(void)\n{\n}\n\nCLocalProxyConnection::~CLocalProxyConnection(void)\n{\n}\n"
  },
  {
    "path": "Bundles/Echoware/LocalProxyConnection.h",
    "content": "#ifndef _LOCALPROXICONNECT_H\n#define _LOCALPROXICONNECT_H\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n#include \"proxyconnection.h\"\n\nclass CLocalProxyConnection : public CProxyConnection\n{\npublic:\n\tCLocalProxyConnection(void);\n\tvirtual ~CLocalProxyConnection(void);\n};\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/Logger.cpp",
    "content": "#include \"StdAfx.h\"\n#include <time.h>\n#include \"logger.h\"\n\n//if defined _CONSOLE_ then the logging data are writted to a console, not to a file\n//#define _CONSOLE_\n\nCLogger::CLogger(bool bLogging, const char* szFilePath)\n{\n\tm_strFilePath=(szFilePath)?(szFilePath):(\"\");\n\tm_bLogging=bLogging;\n\n#ifdef _CONSOLE_\n\tAllocConsole();\n\tfreopen(\"CONIN$\",\"rb\",stdin);\n    freopen(\"CONOUT$\",\"wb\",stdout);\n    freopen(\"CONOUT$\",\"wb\",stderr);\n    setbuf(stderr, 0);\n#endif\n}\n\nCLogger::~CLogger(void)\n{\n#ifdef _CONSOLE_\n\tFreeConsole();\n#endif\n}\n\nvoid CLogger::SetLogger(bool bLogging)\n{\n\tm_crtSection.Lock();\n\n\tm_bLogging=bLogging;\n\n\tm_crtSection.Unlock();\n}\n\nbool CLogger::GetLogger()\n{\n\tm_crtSection.Lock();\n\n\treturn m_bLogging;\n\n\tm_crtSection.Unlock();\n}\n\nvoid CLogger::SetLoggerPath(const char* szFilePath)\n{\n\tm_crtSection.Lock();\n\n\tif (szFilePath)\n\t{\n\t\tm_strFilePath=szFilePath;\n\t}\n\n\tm_crtSection.Unlock();\n}\n\nconst char* CLogger::GetLoggerPath()\n{\n\tm_crtSection.Lock();\n\n\treturn m_strFilePath.c_str();\n\n\tm_crtSection.Unlock();\n}\n\nvoid CLogger::Write(const char* szText)\n{\n\tm_crtSection.Lock();\n\n\tif (m_bLogging && !m_strFilePath.empty())\n\t{\n#ifndef _CONSOLE_\n\t\tFILE* f=fopen(m_strFilePath.c_str(), \"a\");\n\n\t\tif (f)\n#endif\n\t\t{\n\t\t\ttime_t theTime;\n\t\t\ttime(&theTime);\n\n\t\t\tchar* tmp_time = ctime(&theTime);\n\t\t\tint len_time = strlen(tmp_time);\n\t\t\tif (tmp_time[len_time - 1] == '\\n')\n\t\t\t\ttmp_time[len_time - 1] = '\\0';\n\n#ifdef _CONSOLE_\n\t\t\tfprintf(stdout, \"[%s] echoServer : %s\\n\", tmp_time, szText);\n#else\n\t\t\tfprintf(f, \"[%s] echoServer : %s\\n\", tmp_time, szText);\n\n\t\t\tfclose(f);\n#endif\n\t\t}\n\t}\n\n\tm_crtSection.Unlock();\n}\n\nvoid CLogger::WriteFormated(const char* szFormat, ...)\n{\n\tva_list valist;\n\n\tva_start(valist, szFormat);\n\n\tchar szMsg[1024];\n\tvsprintf(szMsg, szFormat, valist);\n\n\tva_end(valist);\n\n\tWrite(szMsg);\n}\n"
  },
  {
    "path": "Bundles/Echoware/Logger.h",
    "content": "#ifndef _LOGGER_H\n#define _LOGGER_H\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n#include <string>\n#include \"CritSection.h\"\n\n//a generic logger class\nclass CLogger\n{\npublic:\n\tCLogger(bool bLogging=false, const char* szFilePath=0);\n\t~CLogger(void);\n\n\t//set enable/disable loggings\n\tvoid SetLogger(bool bLogging);\n\t//get enable/disable loggings\n\tbool GetLogger();\n\t//set the logger path\n\tvoid SetLoggerPath(const char* szFilePath);\n\t//get the logger path\n\tconst char* GetLoggerPath();\n\n\t//write the string to logger file\n\tvoid Write(const char* szText);\n\t//write formatted string(like printf) to logger file\n\tvoid WriteFormated(const char* szFormat, ...);\n\nprotected:\n\tstd::string m_strFilePath;\n\tbool m_bLogging;\n\n\tCCritSection m_crtSection;\n};\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/MyDllProxyInfo.cpp",
    "content": "/*\n *  MyDllProxyInfo.cpp\n *  Echoware\n *\n *  Created by Vasya Pupkin on 1/15/07.\n *  Copyright 2007 __MyCompanyName__. All rights reserved.\n *\n */\n\n#include \"MyDllProxyInfo.h\"\n#include \"unistd.h\"\n#include \"EchoToOSX.h\"\n\nCMyDllProxyInfo::CMyDllProxyInfo(IDllProxyInfo *pProxyInfo)\n{\n\tm_pDllProxyInfo = pProxyInfo;\n\tm_eStatus = CMyDllProxyInfo::None;\n\tm_nPrevStatus = 0;\n\tif (m_pDllProxyInfo)\n\t\tm_nPrevStatus = m_pDllProxyInfo->GetStatus();\n}\n\nCMyDllProxyInfo::~CMyDllProxyInfo()\n{\n\tm_pDllProxyInfo = 0;\n\tm_eStatus = CMyDllProxyInfo::None;\n\tm_nPrevStatus = 0;\n}\n\nIDllProxyInfo* CMyDllProxyInfo::getDllProxyInfo()\n{\n\treturn m_pDllProxyInfo;\n}\n\nvoid CMyDllProxyInfo::setDllProxyInfo(IDllProxyInfo *pProxyInfo)\n{\n\tm_pDllProxyInfo = pProxyInfo;\n}\n\nCMyDllProxyInfo::STATUS CMyDllProxyInfo::getStatus()\n{\n\treturn m_eStatus;\n}\n\nvoid CMyDllProxyInfo::setStatus(CMyDllProxyInfo::STATUS status)\n{\n\tm_eStatus = status;\n}\n\nvoid CMyDllProxyInfo::RemoveStatus()\n{\n\tsetStatus(CMyDllProxyInfo::None);\n}\n\nint CMyDllProxyInfo::getPrevStatus()\n{\n\treturn m_nPrevStatus;\n}\n\nvoid CMyDllProxyInfo::setPrevStatus(int status)\n{\n\tm_nPrevStatus = status;\n}\n\nbool CMyDllProxyInfo::isStatusChanged(int newStatus)\n{\n\treturn (m_nPrevStatus != newStatus);\n}\n\nvoid CMyDllProxyInfo::WaitForStatus(int status, int timeout, int interval)\n{\n\tif (m_pDllProxyInfo)\n\t{\n\t\tint t = 0;\n\t\twhile (!(m_pDllProxyInfo->GetStatus() & status))\n\t\t{\n\t\t\tSleep(interval);\n\t\t\tt += interval;\n\t\t\tif (timeout > 0 && t >= timeout)\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n\nchar* CMyDllProxyInfo::getStatusString()\n{\n\tif (m_pDllProxyInfo)\n\t{\n\t\tswitch(m_eStatus)\n\t\t{\n\t\t\tcase Connecting:\n\t\t\tcase Reconnecting:\n\t\t\t\treturn \"Connecting...\";\n\t\t\tcase Removing:\n\t\t\t\treturn \"Removing...\";\n\t\t}\n\n\t\tint status = (int)m_pDllProxyInfo->GetStatus();\n\n\t\tif (status & STATUS_SEARCHING_FOR_PARTNER)\n\t\t\treturn \"Partner Search Initiated\";\n\t\telse if (status & STATUS_ESTABLISHING_DATA_CHANNEL)\n\t\t\treturn \"Establishing Data Channel...\";\n\t\telse if (status & STATUS_AUTHENTICATION_FAILED)\n\t\t\treturn \"Authentication Failed\";\n\t\telse if (status & STATUS_AUTHENTICATING)\n\t\t\treturn \"Authenticating...\";\n\t\telse if (status & STATUS_DISCONNECTED_FROM_PROXY || !status)\n\t\t\treturn \"No Proxy Connection\";\n\t\telse if (status & STATUS_CONNECTED)\n\t\t\treturn \"Proxy Channel Connected\";\n\t}\n\treturn \"\";\n}"
  },
  {
    "path": "Bundles/Echoware/MyDllProxyInfo.h",
    "content": "/*\n *  MyDllProxyInfo.h\n *  Echoware\n *\n *  Created by Vasya Pupkin on 1/15/07.\n *  Copyright 2007 __MyCompanyName__. All rights reserved.\n *\n */\n\n#import \"Echoware.h\"\n#import \"InterfaceDLLProxyInfo.h\"∂\n\nclass CMyDllProxyInfo\n{\n\tpublic:\n\t\tenum STATUS {None, Connecting, Removing, Reconnecting};\n\n\tprivate:\n\t\tIDllProxyInfo *m_pDllProxyInfo;\n\t\tSTATUS m_eStatus;\n\n\t\tint m_nPrevStatus;\n\n\tpublic:\n\t\tCMyDllProxyInfo(IDllProxyInfo *pProxyInfo);\n\t\t~CMyDllProxyInfo();\n\n\t\tIDllProxyInfo* getDllProxyInfo();\n\t\tvoid setDllProxyInfo(IDllProxyInfo *pProxyInfo);\n\n\t\tSTATUS getStatus();\n\t\tvoid setStatus(STATUS status);\n\t\tvoid RemoveStatus();\n\n\t\tint getPrevStatus();\n\t\tvoid setPrevStatus(int status);\n\n\t\tbool isStatusChanged(int newStatus);\n\n\t\tvoid WaitForStatus(int status, int timeout = 0, int interval = 50000);\n\t\tchar* getStatusString();\n};"
  },
  {
    "path": "Bundles/Echoware/NetPacket.h",
    "content": "#ifndef _NETPACKET_H\n#define _NETPACKET_H\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\nenum\n{\n    PROXY_MSG_BASE = WM_USER + 1301,\n\n    MSG_PROXY_CONNECTED = PROXY_MSG_BASE + 1, // 2326\n    MSG_PROXY_PUBLICKEY,\t// 2327\n    MSG_PROXY_PASSWORD,\t\t// 2328\n    MSG_PROXY_INIT_HANDSHAKE,\t// 2329\n    MSG_PROXY_INIT_HANDSHAKEREPLY,\t//2330\n    MSG_PROXY_HANDSHAKECONFIRM,\t// 2331\n    MSG_PROXY_HANDSHAKECOMPLETE,\t//2332\n\tMSG_PROXY_HANDSHAKEFAILED,\t//2333\n\tMSG_PROXY_DISCONNECTED,\t// 2334\n\tMSG_PROXY_FIND_PARTNER,\t// 2335\n\tMSG_PROXY_PARTNERNOTFOUND,\t//2336\n\tMSG_PROXY_PARTNERFOUND,\t// 2337\n\tMSG_PROXY_VPN_SUCCESSFUL,\t// 2339//2338\n\tMSG_PROXY_VPN_DISCONNECTED,\t// 2340//2339\n\tMSG_PROXY_DUPLICATE_LOGIN,\t// 2341//2340\n\tMSG_ISALIVE,\t// 2342//2341\n\n\tMSG_CONNECT_TO_PEER, // 2343//2342\n\tMSG_CHANNEL_CODE, // 2344//2343\n\tMSG_PEER_KEY, // 2345//2344\n\tMSG_DATA_CHANNEL_CONNECT,\t// 2346//2345\n\n\tPROXY_MSG_LAST\n};\n\n#define EF_NET_PACKET_ID \"EF1.0\"\n#define PROXY_ECHO \"KaboodleProxy_Protocol Version 1.0_Server Version 1.0\"\n\nenum {PACKET_MESSAGE=1,PACKET_OTHER=2};\n\nstruct NetPacketHeader\n{\n\tchar id[6];//EF packet and version identifier\n\tchar type; //type of packet (usually message)\n\tlong len;\n\tNetPacketHeader()\n\t{\n\t\tstrcpy( id, EF_NET_PACKET_ID );\n\t\ttype = PACKET_MESSAGE;\n\t}\n};\n\nclass CProxyMsg\n{\npublic:\n\tUINT\tmessageid;//message or event id\n\tBYTE\tusertype;//user type\n\tlong\tdatalength;//length of the data following this header\n\t//bytearray data;//the actual data\n\tCProxyMsg() {}\n\n\tCProxyMsg(DWORD messageid,long datalength=0,BYTE usertype=0)\n\t{\n\t\tthis->messageid=messageid;\n\t\tthis->datalength=datalength;\n\t\tthis->usertype=usertype;\n\t}\n\tint size()\n\t{\n\t\treturn sizeof(CProxyMsg);\n\t}\n\tint MakeMessage(NetPacketHeader* pheader,char*& destbuffer,void* datapart=NULL,long datalength=0)\n\t{\n\t/*\n\t\tint s1 = sizeof(pheader->id);\n\t\tint s2 = sizeof(pheader->type);\n\t\tint s3 = sizeof(pheader->len);\n\n\t\tint s4 = sizeof(this->messageid);\n\t\tint s5 = sizeof(this->datalength);\n\t\tint s6 = sizeof(this->usertype);\n\n\t\tint len = s1 + s2 + s3 + s4 + s5 + s6;\n\n\t\tdestbuffer = new char[len];\n\n\t\tpheader->len = len;\n\t\tmemcpy(destbuffer, pheader->id, s1);\n\t\tmemcpy(destbuffer + s1, &pheader->type, s2);\n\n\t\tDWORD tmp = OSSwapHostToLittleInt32(pheader->len);\n\t\tmemcpy(destbuffer + s1 + s2, &tmp, s3);\n\n\t\tthis->datalength=datalength;\n\t\ttmp = OSSwapHostToLittleInt32(this->messageid);\n\t\tmemcpy(destbuffer + s1 + s2 + s3, &tmp, s4);\n\t\tmemcpy(destbuffer + s1 + s2 + s3 + s4, &this->usertype, s5);\n\t\ttmp = OSSwapHostToLittleInt32(this->datalength);\n\t\tmemcpy(destbuffer + s1 + s2 + s3 + s4 + s5, &tmp, s6);\n\n\t\tif (datapart) //copy data\n\t\t\tmemcpy(destbuffer + len, datapart, datalength);\n\n\t\treturn len;\n*/\n\t\tint headersize=sizeof(NetPacketHeader);\n\t\tint mysize=sizeof(CProxyMsg);\n\t\tdestbuffer=new char[headersize+mysize+datalength];\n\t\tmemset(destbuffer, 0, headersize+mysize+datalength);\n\n\t\tpheader->len=OSSwapHostToLittleInt32(headersize+mysize+datalength);\n\n\t\tmemcpy(destbuffer, &pheader->id, sizeof(pheader->id));\n\n\t\tWORD tmp1 = pheader->type;\n\t\tmemcpy(destbuffer + sizeof(pheader->id), &tmp1, sizeof(tmp1));\n\n\t\tDWORD tmp2 = pheader->len;\n\t\tmemcpy(destbuffer + sizeof(pheader->id) + sizeof(tmp1), &tmp2, sizeof(tmp2));\n\n//\t\tmemcpy(destbuffer,pheader,headersize); //copy packet header\n\t\tpheader->len=headersize+mysize+datalength;\n\n\t\t// Swap to LE\n\t\tthis->messageid=OSSwapHostToLittleInt32(messageid);\n\t\tthis->datalength=OSSwapHostToLittleInt32(datalength);\n\n\t\tDWORD tmp = this->messageid;\n\t\tmemcpy(destbuffer + headersize, &tmp, sizeof(tmp));\n\n\t\ttmp = this->usertype;\n\t\ttmp = OSSwapHostToLittleInt32(tmp);\n\t\tmemcpy(destbuffer + headersize + sizeof(tmp), &tmp, sizeof(tmp));\n\n\t\ttmp = this->datalength;\n\t\tmemcpy(destbuffer + headersize + sizeof(tmp) + sizeof(tmp), &tmp, sizeof(tmp));\n\n\t\t//memcpy(destbuffer+headersize,this,mysize); //copy message descriptor\n\n\t\t// Reverse\n\t\tthis->messageid=OSSwapLittleToHostInt32(messageid);\n\t\tthis->datalength=datalength;\n\n\t\tif (datapart) //copy data\n\t\t\tmemcpy(destbuffer+headersize+mysize,datapart,datalength);\n\t\treturn headersize+mysize+datalength;\n\t}\n};\n#endif"
  },
  {
    "path": "Bundles/Echoware/OpenSSL/LibeaySt.dsp",
    "content": "# Microsoft Developer Studio Project File - Name=\"LibeaySt\" - Package Owner=<4>\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\n# ** DO NOT EDIT **\n\n# TARGTYPE \"Win32 (x86) Static Library\" 0x0104\n\nCFG=LibeaySt - Win32 Debug\n!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n!MESSAGE use the Export Makefile command and run\n!MESSAGE\n!MESSAGE NMAKE /f \"LibeaySt.mak\".\n!MESSAGE\n!MESSAGE You can specify a configuration when running NMAKE\n!MESSAGE by defining the macro CFG on the command line. For example:\n!MESSAGE\n!MESSAGE NMAKE /f \"LibeaySt.mak\" CFG=\"LibeaySt - Win32 Debug\"\n!MESSAGE\n!MESSAGE Possible choices for configuration are:\n!MESSAGE\n!MESSAGE \"LibeaySt - Win32 Release\" (based on \"Win32 (x86) Static Library\")\n!MESSAGE \"LibeaySt - Win32 Debug\" (based on \"Win32 (x86) Static Library\")\n!MESSAGE\n\n# Begin Project\n# PROP AllowPerConfigDependencies 0\n# PROP Scc_ProjName \"\"\n# PROP Scc_LocalPath \"\"\nCPP=cl.exe\nRSC=rc.exe\n\n!IF  \"$(CFG)\" == \"LibeaySt - Win32 Release\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 0\n# PROP BASE Output_Dir \"Release\"\n# PROP BASE Intermediate_Dir \"Release\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 0\n# PROP Output_Dir \"Release6\"\n# PROP Intermediate_Dir \"Release6\"\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_MBCS\" /D \"_LIB\" /YX /FD /c\n# ADD CPP /nologo /MD /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_MBCS\" /D \"_LIB\" /YX /FD /c\n# ADD BASE RSC /l 0x419 /d \"NDEBUG\"\n# ADD RSC /l 0x419 /d \"NDEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLIB32=link.exe -lib\n# ADD BASE LIB32 /nologo\n# ADD LIB32 /nologo /out:\"..\\Release6\\LibeaySt.lib\"\n\n!ELSEIF  \"$(CFG)\" == \"LibeaySt - Win32 Debug\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 1\n# PROP BASE Output_Dir \"Debug\"\n# PROP BASE Intermediate_Dir \"Debug\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 1\n# PROP Output_Dir \"Debug6\"\n# PROP Intermediate_Dir \"Debug6\"\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_MBCS\" /D \"_LIB\" /YX /FD /GZ /c\n# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_MBCS\" /D \"_LIB\" /YX /FD /GZ /c\n# ADD BASE RSC /l 0x419 /d \"_DEBUG\"\n# ADD RSC /l 0x419 /d \"_DEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLIB32=link.exe -lib\n# ADD BASE LIB32 /nologo\n# ADD LIB32 /nologo /out:\"..\\Debug6\\LibeaySt.lib\"\n\n!ENDIF\n\n# Begin Target\n\n# Name \"LibeaySt - Win32 Release\"\n# Name \"LibeaySt - Win32 Debug\"\n# Begin Group \"Source Files\"\n\n# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat\"\n# Begin Source File\n\nSOURCE=.\\aes_core.c\n# End Source File\n# End Group\n# Begin Group \"Header Files\"\n\n# PROP Default_Filter \"h;hpp;hxx;hm;inl\"\n# Begin Source File\n\nSOURCE=.\\aes.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\aes_locl.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\e_os2.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\opensslconf.h\n# End Source File\n# End Group\n# End Target\n# End Project\n"
  },
  {
    "path": "Bundles/Echoware/OpenSSL/LibeaySt.vcproj",
    "content": "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"7.00\"\n\tName=\"LibeaySt\"\n\tProjectGUID=\"{5CDA6CEE-1D30-4C05-ACCA-327274FFC553}\"\n\tSccProjectName=\"\"\n\tSccLocalPath=\"\">\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"/>\n\t</Platforms>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Release|Win32\"\n\t\t\tOutputDirectory=\"Release\"\n\t\t\tIntermediateDirectory=\"Release\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tUseOfMFC=\"0\"\n\t\t\tATLMinimizesCRunTimeLibraryUsage=\"FALSE\"\n\t\t\tCharacterSet=\"2\">\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tInlineFunctionExpansion=\"1\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32,NDEBUG,_LIB\"\n\t\t\t\tStringPooling=\"TRUE\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tEnableFunctionLevelLinking=\"TRUE\"\n\t\t\t\tUsePrecompiledHeader=\"2\"\n\t\t\t\tPrecompiledHeaderFile=\".\\Release/LibeaySt.pch\"\n\t\t\t\tAssemblerListingLocation=\".\\Release/\"\n\t\t\t\tObjectFile=\".\\Release/\"\n\t\t\t\tProgramDataBaseFileName=\".\\Release/\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tSuppressStartupBanner=\"TRUE\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"..\\$(OutDir)\\LibeaySt.lib\"\n\t\t\t\tSuppressStartupBanner=\"TRUE\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG\"\n\t\t\t\tCulture=\"1049\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|Win32\"\n\t\t\tOutputDirectory=\"Debug\"\n\t\t\tIntermediateDirectory=\"Debug\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tUseOfMFC=\"0\"\n\t\t\tATLMinimizesCRunTimeLibraryUsage=\"FALSE\"\n\t\t\tCharacterSet=\"2\">\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32,_DEBUG,_LIB\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tUsePrecompiledHeader=\"2\"\n\t\t\t\tPrecompiledHeaderFile=\".\\Debug/LibeaySt.pch\"\n\t\t\t\tAssemblerListingLocation=\".\\Debug/\"\n\t\t\t\tObjectFile=\".\\Debug/\"\n\t\t\t\tProgramDataBaseFileName=\".\\Debug/\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tSuppressStartupBanner=\"TRUE\"\n\t\t\t\tDebugInformationFormat=\"4\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"..\\$(OutDir)\\LibeaySt.lib\"\n\t\t\t\tSuppressStartupBanner=\"TRUE\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG\"\n\t\t\t\tCulture=\"1049\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"/>\n\t\t</Configuration>\n\t</Configurations>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"Source Files\"\n\t\t\tFilter=\"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat\">\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\aes_core.c\">\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Header Files\"\n\t\t\tFilter=\"h;hpp;hxx;hm;inl\">\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\aes.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\aes_locl.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\e_os2.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\opensslconf.h\">\n\t\t\t</File>\n\t\t</Filter>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "Bundles/Echoware/OpenSSL/aes.h",
    "content": "/* crypto/aes/aes.h -*- mode:C; c-file-style: \"eay\" -*- */\n/* ====================================================================\n * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n */\n\n#ifndef HEADER_AES_H\n#define HEADER_AES_H\n\n\n#include \"e_os2.h\"\n\n#ifdef OPENSSL_NO_AES\n#error AES is disabled.\n#endif\n\n#define AES_ENCRYPT\t1\n#define AES_DECRYPT\t0\n\n/* Because array size can't be a const in C, the following two are macros.\n   Both sizes are in bytes. */\n#define AES_MAXNR 14\n#define AES_BLOCK_SIZE 16\n\n#if defined(OPENSSL_FIPS)\n#define FIPS_AES_SIZE_T\tint\n#endif\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/* This should be a hidden type, but EVP requires that the size be known */\nstruct aes_key_st {\n    unsigned int rd_key[4 *(AES_MAXNR + 1)];\n    int rounds;\n};\ntypedef struct aes_key_st AES_KEY;\n\nconst char *AES_options(void);\n\nint AES_set_encrypt_key(const unsigned char *userKey, const int bits,\n\tAES_KEY *key);\nint AES_set_decrypt_key(const unsigned char *userKey, const int bits,\n\tAES_KEY *key);\n\nvoid AES_encrypt(const unsigned char *in, unsigned char *out,\n\tconst AES_KEY *key);\nvoid AES_decrypt(const unsigned char *in, unsigned char *out,\n\tconst AES_KEY *key);\n\nvoid AES_ecb_encrypt(const unsigned char *in, unsigned char *out,\n\tconst AES_KEY *key, const int enc);\nvoid AES_cbc_encrypt(const unsigned char *in, unsigned char *out,\n\tconst unsigned long length, const AES_KEY *key,\n\tunsigned char *ivec, const int enc);\nvoid AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,\n\tconst unsigned long length, const AES_KEY *key,\n\tunsigned char *ivec, int *num, const int enc);\nvoid AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,\n\tconst unsigned long length, const AES_KEY *key,\n\tunsigned char *ivec, int *num, const int enc);\nvoid AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,\n\tconst unsigned long length, const AES_KEY *key,\n\tunsigned char *ivec, int *num, const int enc);\nvoid AES_cfbr_encrypt_block(const unsigned char *in,unsigned char *out,\n\t\t\t    const int nbits,const AES_KEY *key,\n\t\t\t    unsigned char *ivec,const int enc);\nvoid AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,\n\tconst unsigned long length, const AES_KEY *key,\n\tunsigned char *ivec, int *num);\nvoid AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,\n\tconst unsigned long length, const AES_KEY *key,\n\tunsigned char ivec[AES_BLOCK_SIZE],\n\tunsigned char ecount_buf[AES_BLOCK_SIZE],\n\tunsigned int *num);\n\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif /* !HEADER_AES_H */\n\n"
  },
  {
    "path": "Bundles/Echoware/OpenSSL/aes_core.c",
    "content": "/* crypto/aes/aes_core.c -*- mode:C; c-file-style: \"eay\" -*- */\n/**\n * rijndael-alg-fst.c\n *\n * @version 3.0 (December 2000)\n *\n * Optimised ANSI C code for the Rijndael cipher (now AES)\n *\n * @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>\n * @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>\n * @author Paulo Barreto <paulo.barreto@terra.com.br>\n *\n * This code is hereby placed in the public domain.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* Note: rewritten a little bit to provide error control and an OpenSSL-\n   compatible API */\n\n#ifndef AES_DEBUG\n# ifndef NDEBUG\n#  define NDEBUG\n# endif\n#endif\n#include <assert.h>\n\n#include <stdlib.h>\n#include \"aes.h\"\n#include \"aes_locl.h\"\n\n/*\nTe0[x] = S [x].[02, 01, 01, 03];\nTe1[x] = S [x].[03, 02, 01, 01];\nTe2[x] = S [x].[01, 03, 02, 01];\nTe3[x] = S [x].[01, 01, 03, 02];\nTe4[x] = S [x].[01, 01, 01, 01];\n\nTd0[x] = Si[x].[0e, 09, 0d, 0b];\nTd1[x] = Si[x].[0b, 0e, 09, 0d];\nTd2[x] = Si[x].[0d, 0b, 0e, 09];\nTd3[x] = Si[x].[09, 0d, 0b, 0e];\nTd4[x] = Si[x].[01, 01, 01, 01];\n*/\n\n#ifdef AES_ASM\nextern const u32 AES_Te[5][256];\n#define Te0 AES_Te[0]\n#define Te1 AES_Te[1]\n#define Te2 AES_Te[2]\n#define Te3 AES_Te[3]\n#else\nstatic const u32 Te0[256] = {\n    0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU,\n    0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U,\n    0x60303050U, 0x02010103U, 0xce6767a9U, 0x562b2b7dU,\n    0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, 0xec76769aU,\n    0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U,\n    0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU,\n    0x41adadecU, 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU,\n    0x239c9cbfU, 0x53a4a4f7U, 0xe4727296U, 0x9bc0c05bU,\n    0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, 0x4c26266aU,\n    0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU,\n    0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U,\n    0xe2717193U, 0xabd8d873U, 0x62313153U, 0x2a15153fU,\n    0x0804040cU, 0x95c7c752U, 0x46232365U, 0x9dc3c35eU,\n    0x30181828U, 0x379696a1U, 0x0a05050fU, 0x2f9a9ab5U,\n    0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU,\n    0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU,\n    0x1209091bU, 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU,\n    0x361b1b2dU, 0xdc6e6eb2U, 0xb45a5aeeU, 0x5ba0a0fbU,\n    0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, 0x7db3b3ceU,\n    0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U,\n    0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU,\n    0x40202060U, 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU,\n    0xd46a6abeU, 0x8dcbcb46U, 0x67bebed9U, 0x7239394bU,\n    0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, 0x85cfcf4aU,\n    0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U,\n    0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U,\n    0x8a4545cfU, 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U,\n    0xa05050f0U, 0x783c3c44U, 0x259f9fbaU, 0x4ba8a8e3U,\n    0xa25151f3U, 0x5da3a3feU, 0x804040c0U, 0x058f8f8aU,\n    0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U,\n    0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U,\n    0x20101030U, 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU,\n    0x81cdcd4cU, 0x180c0c14U, 0x26131335U, 0xc3ecec2fU,\n    0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, 0x2e171739U,\n    0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U,\n    0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U,\n    0xc06060a0U, 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU,\n    0x44222266U, 0x542a2a7eU, 0x3b9090abU, 0x0b888883U,\n    0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, 0x2814143cU,\n    0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U,\n    0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU,\n    0x924949dbU, 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U,\n    0x9fc2c25dU, 0xbdd3d36eU, 0x43acacefU, 0xc46262a6U,\n    0x399191a8U, 0x319595a4U, 0xd3e4e437U, 0xf279798bU,\n    0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U,\n    0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U,\n    0xd86c6cb4U, 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U,\n    0xca6565afU, 0xf47a7a8eU, 0x47aeaee9U, 0x10080818U,\n    0x6fbabad5U, 0xf0787888U, 0x4a25256fU, 0x5c2e2e72U,\n    0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U,\n    0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U,\n    0x964b4bddU, 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U,\n    0xe0707090U, 0x7c3e3e42U, 0x71b5b5c4U, 0xcc6666aaU,\n    0x904848d8U, 0x06030305U, 0xf7f6f601U, 0x1c0e0e12U,\n    0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U,\n    0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U,\n    0xd9e1e138U, 0xebf8f813U, 0x2b9898b3U, 0x22111133U,\n    0xd26969bbU, 0xa9d9d970U, 0x078e8e89U, 0x339494a7U,\n    0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, 0xc9e9e920U,\n    0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU,\n    0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U,\n    0x65bfbfdaU, 0xd7e6e631U, 0x844242c6U, 0xd06868b8U,\n    0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U,\n    0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU,\n};\nstatic const u32 Te1[256] = {\n    0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU,\n    0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U,\n    0x50603030U, 0x03020101U, 0xa9ce6767U, 0x7d562b2bU,\n    0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, 0x9aec7676U,\n    0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU,\n    0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U,\n    0xec41adadU, 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU,\n    0xbf239c9cU, 0xf753a4a4U, 0x96e47272U, 0x5b9bc0c0U,\n    0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, 0x6a4c2626U,\n    0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU,\n    0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U,\n    0x93e27171U, 0x73abd8d8U, 0x53623131U, 0x3f2a1515U,\n    0x0c080404U, 0x5295c7c7U, 0x65462323U, 0x5e9dc3c3U,\n    0x28301818U, 0xa1379696U, 0x0f0a0505U, 0xb52f9a9aU,\n    0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U,\n    0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U,\n    0x1b120909U, 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU,\n    0x2d361b1bU, 0xb2dc6e6eU, 0xeeb45a5aU, 0xfb5ba0a0U,\n    0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, 0xce7db3b3U,\n    0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U,\n    0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU,\n    0x60402020U, 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU,\n    0xbed46a6aU, 0x468dcbcbU, 0xd967bebeU, 0x4b723939U,\n    0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, 0x4a85cfcfU,\n    0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU,\n    0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U,\n    0xcf8a4545U, 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU,\n    0xf0a05050U, 0x44783c3cU, 0xba259f9fU, 0xe34ba8a8U,\n    0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, 0x8a058f8fU,\n    0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U,\n    0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U,\n    0x30201010U, 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U,\n    0x4c81cdcdU, 0x14180c0cU, 0x35261313U, 0x2fc3ececU,\n    0xe1be5f5fU, 0xa2359797U, 0xcc884444U, 0x392e1717U,\n    0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU,\n    0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U,\n    0xa0c06060U, 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU,\n    0x66442222U, 0x7e542a2aU, 0xab3b9090U, 0x830b8888U,\n    0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, 0x3c281414U,\n    0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU,\n    0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU,\n    0xdb924949U, 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU,\n    0x5d9fc2c2U, 0x6ebdd3d3U, 0xef43acacU, 0xa6c46262U,\n    0xa8399191U, 0xa4319595U, 0x37d3e4e4U, 0x8bf27979U,\n    0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU,\n    0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U,\n    0xb4d86c6cU, 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU,\n    0xafca6565U, 0x8ef47a7aU, 0xe947aeaeU, 0x18100808U,\n    0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, 0x725c2e2eU,\n    0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U,\n    0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU,\n    0xdd964b4bU, 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU,\n    0x90e07070U, 0x427c3e3eU, 0xc471b5b5U, 0xaacc6666U,\n    0xd8904848U, 0x05060303U, 0x01f7f6f6U, 0x121c0e0eU,\n    0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U,\n    0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU,\n    0x38d9e1e1U, 0x13ebf8f8U, 0xb32b9898U, 0x33221111U,\n    0xbbd26969U, 0x70a9d9d9U, 0x89078e8eU, 0xa7339494U,\n    0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, 0x20c9e9e9U,\n    0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU,\n    0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU,\n    0xda65bfbfU, 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U,\n    0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU,\n    0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U,\n};\nstatic const u32 Te2[256] = {\n    0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU,\n    0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U,\n    0x30506030U, 0x01030201U, 0x67a9ce67U, 0x2b7d562bU,\n    0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, 0x769aec76U,\n    0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU,\n    0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U,\n    0xadec41adU, 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU,\n    0x9cbf239cU, 0xa4f753a4U, 0x7296e472U, 0xc05b9bc0U,\n    0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, 0x266a4c26U,\n    0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU,\n    0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U,\n    0x7193e271U, 0xd873abd8U, 0x31536231U, 0x153f2a15U,\n    0x040c0804U, 0xc75295c7U, 0x23654623U, 0xc35e9dc3U,\n    0x18283018U, 0x96a13796U, 0x050f0a05U, 0x9ab52f9aU,\n    0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U,\n    0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U,\n    0x091b1209U, 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU,\n    0x1b2d361bU, 0x6eb2dc6eU, 0x5aeeb45aU, 0xa0fb5ba0U,\n    0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, 0xb3ce7db3U,\n    0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U,\n    0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU,\n    0x20604020U, 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU,\n    0x6abed46aU, 0xcb468dcbU, 0xbed967beU, 0x394b7239U,\n    0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, 0xcf4a85cfU,\n    0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU,\n    0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U,\n    0x45cf8a45U, 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU,\n    0x50f0a050U, 0x3c44783cU, 0x9fba259fU, 0xa8e34ba8U,\n    0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, 0x8f8a058fU,\n    0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U,\n    0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U,\n    0x10302010U, 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U,\n    0xcd4c81cdU, 0x0c14180cU, 0x13352613U, 0xec2fc3ecU,\n    0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, 0x17392e17U,\n    0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU,\n    0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U,\n    0x60a0c060U, 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU,\n    0x22664422U, 0x2a7e542aU, 0x90ab3b90U, 0x88830b88U,\n    0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, 0x143c2814U,\n    0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU,\n    0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU,\n    0x49db9249U, 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU,\n    0xc25d9fc2U, 0xd36ebdd3U, 0xacef43acU, 0x62a6c462U,\n    0x91a83991U, 0x95a43195U, 0xe437d3e4U, 0x798bf279U,\n    0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU,\n    0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U,\n    0x6cb4d86cU, 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU,\n    0x65afca65U, 0x7a8ef47aU, 0xaee947aeU, 0x08181008U,\n    0xbad56fbaU, 0x7888f078U, 0x256f4a25U, 0x2e725c2eU,\n    0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U,\n    0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU,\n    0x4bdd964bU, 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU,\n    0x7090e070U, 0x3e427c3eU, 0xb5c471b5U, 0x66aacc66U,\n    0x48d89048U, 0x03050603U, 0xf601f7f6U, 0x0e121c0eU,\n    0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U,\n    0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU,\n    0xe138d9e1U, 0xf813ebf8U, 0x98b32b98U, 0x11332211U,\n    0x69bbd269U, 0xd970a9d9U, 0x8e89078eU, 0x94a73394U,\n    0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, 0xe920c9e9U,\n    0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU,\n    0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU,\n    0xbfda65bfU, 0xe631d7e6U, 0x42c68442U, 0x68b8d068U,\n    0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU,\n    0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U,\n};\nstatic const u32 Te3[256] = {\n    0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U,\n    0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U,\n    0x30305060U, 0x01010302U, 0x6767a9ceU, 0x2b2b7d56U,\n    0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, 0x76769aecU,\n    0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU,\n    0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU,\n    0xadadec41U, 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U,\n    0x9c9cbf23U, 0xa4a4f753U, 0x727296e4U, 0xc0c05b9bU,\n    0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, 0x26266a4cU,\n    0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U,\n    0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U,\n    0x717193e2U, 0xd8d873abU, 0x31315362U, 0x15153f2aU,\n    0x04040c08U, 0xc7c75295U, 0x23236546U, 0xc3c35e9dU,\n    0x18182830U, 0x9696a137U, 0x05050f0aU, 0x9a9ab52fU,\n    0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU,\n    0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU,\n    0x09091b12U, 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U,\n    0x1b1b2d36U, 0x6e6eb2dcU, 0x5a5aeeb4U, 0xa0a0fb5bU,\n    0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, 0xb3b3ce7dU,\n    0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U,\n    0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U,\n    0x20206040U, 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U,\n    0x6a6abed4U, 0xcbcb468dU, 0xbebed967U, 0x39394b72U,\n    0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, 0xcfcf4a85U,\n    0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU,\n    0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U,\n    0x4545cf8aU, 0xf9f910e9U, 0x02020604U, 0x7f7f81feU,\n    0x5050f0a0U, 0x3c3c4478U, 0x9f9fba25U, 0xa8a8e34bU,\n    0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, 0x8f8f8a05U,\n    0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U,\n    0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U,\n    0x10103020U, 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU,\n    0xcdcd4c81U, 0x0c0c1418U, 0x13133526U, 0xecec2fc3U,\n    0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, 0x1717392eU,\n    0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU,\n    0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U,\n    0x6060a0c0U, 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U,\n    0x22226644U, 0x2a2a7e54U, 0x9090ab3bU, 0x8888830bU,\n    0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, 0x14143c28U,\n    0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU,\n    0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U,\n    0x4949db92U, 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U,\n    0xc2c25d9fU, 0xd3d36ebdU, 0xacacef43U, 0x6262a6c4U,\n    0x9191a839U, 0x9595a431U, 0xe4e437d3U, 0x79798bf2U,\n    0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU,\n    0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U,\n    0x6c6cb4d8U, 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU,\n    0x6565afcaU, 0x7a7a8ef4U, 0xaeaee947U, 0x08081810U,\n    0xbabad56fU, 0x787888f0U, 0x25256f4aU, 0x2e2e725cU,\n    0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U,\n    0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU,\n    0x4b4bdd96U, 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU,\n    0x707090e0U, 0x3e3e427cU, 0xb5b5c471U, 0x6666aaccU,\n    0x4848d890U, 0x03030506U, 0xf6f601f7U, 0x0e0e121cU,\n    0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U,\n    0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U,\n    0xe1e138d9U, 0xf8f813ebU, 0x9898b32bU, 0x11113322U,\n    0x6969bbd2U, 0xd9d970a9U, 0x8e8e8907U, 0x9494a733U,\n    0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, 0xe9e920c9U,\n    0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U,\n    0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU,\n    0xbfbfda65U, 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U,\n    0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU,\n    0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU,\n};\n#endif\nstatic const u32 Te4[256] = {\n    0x63636363U, 0x7c7c7c7cU, 0x77777777U, 0x7b7b7b7bU,\n    0xf2f2f2f2U, 0x6b6b6b6bU, 0x6f6f6f6fU, 0xc5c5c5c5U,\n    0x30303030U, 0x01010101U, 0x67676767U, 0x2b2b2b2bU,\n    0xfefefefeU, 0xd7d7d7d7U, 0xababababU, 0x76767676U,\n    0xcacacacaU, 0x82828282U, 0xc9c9c9c9U, 0x7d7d7d7dU,\n    0xfafafafaU, 0x59595959U, 0x47474747U, 0xf0f0f0f0U,\n    0xadadadadU, 0xd4d4d4d4U, 0xa2a2a2a2U, 0xafafafafU,\n    0x9c9c9c9cU, 0xa4a4a4a4U, 0x72727272U, 0xc0c0c0c0U,\n    0xb7b7b7b7U, 0xfdfdfdfdU, 0x93939393U, 0x26262626U,\n    0x36363636U, 0x3f3f3f3fU, 0xf7f7f7f7U, 0xccccccccU,\n    0x34343434U, 0xa5a5a5a5U, 0xe5e5e5e5U, 0xf1f1f1f1U,\n    0x71717171U, 0xd8d8d8d8U, 0x31313131U, 0x15151515U,\n    0x04040404U, 0xc7c7c7c7U, 0x23232323U, 0xc3c3c3c3U,\n    0x18181818U, 0x96969696U, 0x05050505U, 0x9a9a9a9aU,\n    0x07070707U, 0x12121212U, 0x80808080U, 0xe2e2e2e2U,\n    0xebebebebU, 0x27272727U, 0xb2b2b2b2U, 0x75757575U,\n    0x09090909U, 0x83838383U, 0x2c2c2c2cU, 0x1a1a1a1aU,\n    0x1b1b1b1bU, 0x6e6e6e6eU, 0x5a5a5a5aU, 0xa0a0a0a0U,\n    0x52525252U, 0x3b3b3b3bU, 0xd6d6d6d6U, 0xb3b3b3b3U,\n    0x29292929U, 0xe3e3e3e3U, 0x2f2f2f2fU, 0x84848484U,\n    0x53535353U, 0xd1d1d1d1U, 0x00000000U, 0xededededU,\n    0x20202020U, 0xfcfcfcfcU, 0xb1b1b1b1U, 0x5b5b5b5bU,\n    0x6a6a6a6aU, 0xcbcbcbcbU, 0xbebebebeU, 0x39393939U,\n    0x4a4a4a4aU, 0x4c4c4c4cU, 0x58585858U, 0xcfcfcfcfU,\n    0xd0d0d0d0U, 0xefefefefU, 0xaaaaaaaaU, 0xfbfbfbfbU,\n    0x43434343U, 0x4d4d4d4dU, 0x33333333U, 0x85858585U,\n    0x45454545U, 0xf9f9f9f9U, 0x02020202U, 0x7f7f7f7fU,\n    0x50505050U, 0x3c3c3c3cU, 0x9f9f9f9fU, 0xa8a8a8a8U,\n    0x51515151U, 0xa3a3a3a3U, 0x40404040U, 0x8f8f8f8fU,\n    0x92929292U, 0x9d9d9d9dU, 0x38383838U, 0xf5f5f5f5U,\n    0xbcbcbcbcU, 0xb6b6b6b6U, 0xdadadadaU, 0x21212121U,\n    0x10101010U, 0xffffffffU, 0xf3f3f3f3U, 0xd2d2d2d2U,\n    0xcdcdcdcdU, 0x0c0c0c0cU, 0x13131313U, 0xececececU,\n    0x5f5f5f5fU, 0x97979797U, 0x44444444U, 0x17171717U,\n    0xc4c4c4c4U, 0xa7a7a7a7U, 0x7e7e7e7eU, 0x3d3d3d3dU,\n    0x64646464U, 0x5d5d5d5dU, 0x19191919U, 0x73737373U,\n    0x60606060U, 0x81818181U, 0x4f4f4f4fU, 0xdcdcdcdcU,\n    0x22222222U, 0x2a2a2a2aU, 0x90909090U, 0x88888888U,\n    0x46464646U, 0xeeeeeeeeU, 0xb8b8b8b8U, 0x14141414U,\n    0xdedededeU, 0x5e5e5e5eU, 0x0b0b0b0bU, 0xdbdbdbdbU,\n    0xe0e0e0e0U, 0x32323232U, 0x3a3a3a3aU, 0x0a0a0a0aU,\n    0x49494949U, 0x06060606U, 0x24242424U, 0x5c5c5c5cU,\n    0xc2c2c2c2U, 0xd3d3d3d3U, 0xacacacacU, 0x62626262U,\n    0x91919191U, 0x95959595U, 0xe4e4e4e4U, 0x79797979U,\n    0xe7e7e7e7U, 0xc8c8c8c8U, 0x37373737U, 0x6d6d6d6dU,\n    0x8d8d8d8dU, 0xd5d5d5d5U, 0x4e4e4e4eU, 0xa9a9a9a9U,\n    0x6c6c6c6cU, 0x56565656U, 0xf4f4f4f4U, 0xeaeaeaeaU,\n    0x65656565U, 0x7a7a7a7aU, 0xaeaeaeaeU, 0x08080808U,\n    0xbabababaU, 0x78787878U, 0x25252525U, 0x2e2e2e2eU,\n    0x1c1c1c1cU, 0xa6a6a6a6U, 0xb4b4b4b4U, 0xc6c6c6c6U,\n    0xe8e8e8e8U, 0xddddddddU, 0x74747474U, 0x1f1f1f1fU,\n    0x4b4b4b4bU, 0xbdbdbdbdU, 0x8b8b8b8bU, 0x8a8a8a8aU,\n    0x70707070U, 0x3e3e3e3eU, 0xb5b5b5b5U, 0x66666666U,\n    0x48484848U, 0x03030303U, 0xf6f6f6f6U, 0x0e0e0e0eU,\n    0x61616161U, 0x35353535U, 0x57575757U, 0xb9b9b9b9U,\n    0x86868686U, 0xc1c1c1c1U, 0x1d1d1d1dU, 0x9e9e9e9eU,\n    0xe1e1e1e1U, 0xf8f8f8f8U, 0x98989898U, 0x11111111U,\n    0x69696969U, 0xd9d9d9d9U, 0x8e8e8e8eU, 0x94949494U,\n    0x9b9b9b9bU, 0x1e1e1e1eU, 0x87878787U, 0xe9e9e9e9U,\n    0xcecececeU, 0x55555555U, 0x28282828U, 0xdfdfdfdfU,\n    0x8c8c8c8cU, 0xa1a1a1a1U, 0x89898989U, 0x0d0d0d0dU,\n    0xbfbfbfbfU, 0xe6e6e6e6U, 0x42424242U, 0x68686868U,\n    0x41414141U, 0x99999999U, 0x2d2d2d2dU, 0x0f0f0f0fU,\n    0xb0b0b0b0U, 0x54545454U, 0xbbbbbbbbU, 0x16161616U,\n};\n\n#ifdef AES_ASM\nextern const u32 AES_Td[5][256];\n#define Td0 AES_Td[0]\n#define Td1 AES_Td[1]\n#define Td2 AES_Td[2]\n#define Td3 AES_Td[3]\n#else\nstatic const u32 Td0[256] = {\n    0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U,\n    0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U,\n    0x2030fa55U, 0xad766df6U, 0x88cc7691U, 0xf5024c25U,\n    0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, 0xb562a38fU,\n    0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U,\n    0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U,\n    0x038f5fe7U, 0x15929c95U, 0xbf6d7aebU, 0x955259daU,\n    0xd4be832dU, 0x587421d3U, 0x49e06929U, 0x8ec9c844U,\n    0x75c2896aU, 0xf48e7978U, 0x99583e6bU, 0x27b971ddU,\n    0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U,\n    0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U,\n    0xb16477e0U, 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U,\n    0x70486858U, 0x8f45fd19U, 0x94de6c87U, 0x527bf8b7U,\n    0xab73d323U, 0x724b02e2U, 0xe31f8f57U, 0x6655ab2aU,\n    0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U,\n    0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU,\n    0x8acf1c2bU, 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U,\n    0x65daf4cdU, 0x0605bed5U, 0xd134621fU, 0xc4a6fe8aU,\n    0x342e539dU, 0xa2f355a0U, 0x058ae132U, 0xa4f6eb75U,\n    0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U,\n    0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U,\n    0x91548db5U, 0x71c45d05U, 0x0406d46fU, 0x605015ffU,\n    0x1998fb24U, 0xd6bde997U, 0x894043ccU, 0x67d99e77U,\n    0xb0e842bdU, 0x07898b88U, 0xe7195b38U, 0x79c8eedbU,\n    0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U,\n    0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU,\n    0xfd0efffbU, 0x0f853856U, 0x3daed51eU, 0x362d3927U,\n    0x0a0fd964U, 0x685ca621U, 0x9b5b54d1U, 0x24362e3aU,\n    0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, 0x1b9b919eU,\n    0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U,\n    0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU,\n    0x0e090d0bU, 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U,\n    0x57f11985U, 0xaf75074cU, 0xee99ddbbU, 0xa37f60fdU,\n    0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, 0x5bfb7e34U,\n    0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U,\n    0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U,\n    0x854a247dU, 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU,\n    0x1d9e2f4bU, 0xdcb230f3U, 0x0d8652ecU, 0x77c1e3d0U,\n    0x2bb3166cU, 0xa970b999U, 0x119448faU, 0x47e96422U,\n    0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU,\n    0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U,\n    0xa6f581cfU, 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U,\n    0x2c3a9de4U, 0x5078920dU, 0x6a5fcc9bU, 0x547e4662U,\n    0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, 0x82c3aff5U,\n    0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U,\n    0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU,\n    0xcd267809U, 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U,\n    0xe6956e65U, 0xaaffe67eU, 0x21bccf08U, 0xef15e8e6U,\n    0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, 0x29b07cd6U,\n    0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U,\n    0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U,\n    0xf104984aU, 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU,\n    0x764dd68dU, 0x43efb04dU, 0xccaa4d54U, 0xe49604dfU,\n    0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, 0x4665517fU,\n    0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU,\n    0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U,\n    0x9ad7618cU, 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U,\n    0xcea927eeU, 0xb761c935U, 0xe11ce5edU, 0x7a47b13cU,\n    0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, 0x73c737bfU,\n    0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U,\n    0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU,\n    0x161dc372U, 0xbce2250cU, 0x283c498bU, 0xff0d9541U,\n    0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U,\n    0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U,\n};\nstatic const u32 Td1[256] = {\n    0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU,\n    0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U,\n    0x552030faU, 0xf6ad766dU, 0x9188cc76U, 0x25f5024cU,\n    0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, 0x8fb562a3U,\n    0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U,\n    0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U,\n    0xe7038f5fU, 0x9515929cU, 0xebbf6d7aU, 0xda955259U,\n    0x2dd4be83U, 0xd3587421U, 0x2949e069U, 0x448ec9c8U,\n    0x6a75c289U, 0x78f48e79U, 0x6b99583eU, 0xdd27b971U,\n    0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU,\n    0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU,\n    0xe0b16477U, 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU,\n    0x58704868U, 0x198f45fdU, 0x8794de6cU, 0xb7527bf8U,\n    0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, 0x2a6655abU,\n    0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U,\n    0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U,\n    0x2b8acf1cU, 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U,\n    0xcd65daf4U, 0xd50605beU, 0x1fd13462U, 0x8ac4a6feU,\n    0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, 0x75a4f6ebU,\n    0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U,\n    0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU,\n    0xb591548dU, 0x0571c45dU, 0x6f0406d4U, 0xff605015U,\n    0x241998fbU, 0x97d6bde9U, 0xcc894043U, 0x7767d99eU,\n    0xbdb0e842U, 0x8807898bU, 0x38e7195bU, 0xdb79c8eeU,\n    0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U,\n    0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U,\n    0xfbfd0effU, 0x560f8538U, 0x1e3daed5U, 0x27362d39U,\n    0x640a0fd9U, 0x21685ca6U, 0xd19b5b54U, 0x3a24362eU,\n    0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, 0x9e1b9b91U,\n    0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU,\n    0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U,\n    0x0b0e090dU, 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U,\n    0x8557f119U, 0x4caf7507U, 0xbbee99ddU, 0xfda37f60U,\n    0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, 0x345bfb7eU,\n    0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U,\n    0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U,\n    0x7d854a24U, 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U,\n    0x4b1d9e2fU, 0xf3dcb230U, 0xec0d8652U, 0xd077c1e3U,\n    0x6c2bb316U, 0x99a970b9U, 0xfa119448U, 0x2247e964U,\n    0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U,\n    0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU,\n    0xcfa6f581U, 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU,\n    0xe42c3a9dU, 0x0d507892U, 0x9b6a5fccU, 0x62547e46U,\n    0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, 0xf582c3afU,\n    0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U,\n    0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU,\n    0x09cd2678U, 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU,\n    0x65e6956eU, 0x7eaaffe6U, 0x0821bccfU, 0xe6ef15e8U,\n    0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, 0xd629b07cU,\n    0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U,\n    0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U,\n    0x4af10498U, 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U,\n    0x8d764dd6U, 0x4d43efb0U, 0x54ccaa4dU, 0xdfe49604U,\n    0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, 0x7f466551U,\n    0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U,\n    0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U,\n    0x8c9ad761U, 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU,\n    0xeecea927U, 0x35b761c9U, 0xede11ce5U, 0x3c7a47b1U,\n    0x599cd2dfU, 0x3f55f273U, 0x791814ceU, 0xbf73c737U,\n    0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU,\n    0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U,\n    0x72161dc3U, 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U,\n    0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U,\n    0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U,\n};\nstatic const u32 Td2[256] = {\n    0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U,\n    0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U,\n    0xfa552030U, 0x6df6ad76U, 0x769188ccU, 0x4c25f502U,\n    0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, 0xa38fb562U,\n    0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU,\n    0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U,\n    0x5fe7038fU, 0x9c951592U, 0x7aebbf6dU, 0x59da9552U,\n    0x832dd4beU, 0x21d35874U, 0x692949e0U, 0xc8448ec9U,\n    0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, 0x71dd27b9U,\n    0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU,\n    0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U,\n    0x77e0b164U, 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U,\n    0x68587048U, 0xfd198f45U, 0x6c8794deU, 0xf8b7527bU,\n    0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, 0xab2a6655U,\n    0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U,\n    0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U,\n    0x1c2b8acfU, 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U,\n    0xf4cd65daU, 0xbed50605U, 0x621fd134U, 0xfe8ac4a6U,\n    0x539d342eU, 0x55a0a2f3U, 0xe132058aU, 0xeb75a4f6U,\n    0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU,\n    0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U,\n    0x8db59154U, 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U,\n    0xfb241998U, 0xe997d6bdU, 0x43cc8940U, 0x9e7767d9U,\n    0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, 0xeedb79c8U,\n    0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U,\n    0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU,\n    0xfffbfd0eU, 0x38560f85U, 0xd51e3daeU, 0x3927362dU,\n    0xd9640a0fU, 0xa621685cU, 0x54d19b5bU, 0x2e3a2436U,\n    0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, 0x919e1b9bU,\n    0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U,\n    0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU,\n    0x0d0b0e09U, 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU,\n    0x198557f1U, 0x074caf75U, 0xddbbee99U, 0x60fda37fU,\n    0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, 0x7e345bfbU,\n    0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U,\n    0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U,\n    0x247d854aU, 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U,\n    0x2f4b1d9eU, 0x30f3dcb2U, 0x52ec0d86U, 0xe3d077c1U,\n    0x166c2bb3U, 0xb999a970U, 0x48fa1194U, 0x642247e9U,\n    0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U,\n    0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U,\n    0x81cfa6f5U, 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU,\n    0x9de42c3aU, 0x920d5078U, 0xcc9b6a5fU, 0x4662547eU,\n    0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, 0xaff582c3U,\n    0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U,\n    0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU,\n    0x7809cd26U, 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU,\n    0x6e65e695U, 0xe67eaaffU, 0xcf0821bcU, 0xe8e6ef15U,\n    0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, 0x7cd629b0U,\n    0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U,\n    0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U,\n    0x984af104U, 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U,\n    0xd68d764dU, 0xb04d43efU, 0x4d54ccaaU, 0x04dfe496U,\n    0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, 0x517f4665U,\n    0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU,\n    0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U,\n    0x618c9ad7U, 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U,\n    0x27eecea9U, 0xc935b761U, 0xe5ede11cU, 0xb13c7a47U,\n    0xdf599cd2U, 0x733f55f2U, 0xce791814U, 0x37bf73c7U,\n    0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U,\n    0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U,\n    0xc372161dU, 0x250cbce2U, 0x498b283cU, 0x9541ff0dU,\n    0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U,\n    0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U,\n};\nstatic const u32 Td3[256] = {\n    0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU,\n    0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU,\n    0x30fa5520U, 0x766df6adU, 0xcc769188U, 0x024c25f5U,\n    0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, 0x62a38fb5U,\n    0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU,\n    0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU,\n    0x8f5fe703U, 0x929c9515U, 0x6d7aebbfU, 0x5259da95U,\n    0xbe832dd4U, 0x7421d358U, 0xe0692949U, 0xc9c8448eU,\n    0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, 0xb971dd27U,\n    0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU,\n    0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U,\n    0x6477e0b1U, 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U,\n    0x48685870U, 0x45fd198fU, 0xde6c8794U, 0x7bf8b752U,\n    0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, 0x55ab2a66U,\n    0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U,\n    0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU,\n    0xcf1c2b8aU, 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU,\n    0xdaf4cd65U, 0x05bed506U, 0x34621fd1U, 0xa6fe8ac4U,\n    0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, 0xf6eb75a4U,\n    0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU,\n    0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU,\n    0x548db591U, 0xc45d0571U, 0x06d46f04U, 0x5015ff60U,\n    0x98fb2419U, 0xbde997d6U, 0x4043cc89U, 0xd99e7767U,\n    0xe842bdb0U, 0x898b8807U, 0x195b38e7U, 0xc8eedb79U,\n    0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U,\n    0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU,\n    0x0efffbfdU, 0x8538560fU, 0xaed51e3dU, 0x2d392736U,\n    0x0fd9640aU, 0x5ca62168U, 0x5b54d19bU, 0x362e3a24U,\n    0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, 0x9b919e1bU,\n    0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU,\n    0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U,\n    0x090d0b0eU, 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U,\n    0xf1198557U, 0x75074cafU, 0x99ddbbeeU, 0x7f60fda3U,\n    0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, 0xfb7e345bU,\n    0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U,\n    0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U,\n    0x4a247d85U, 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U,\n    0x9e2f4b1dU, 0xb230f3dcU, 0x8652ec0dU, 0xc1e3d077U,\n    0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, 0xe9642247U,\n    0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U,\n    0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U,\n    0xf581cfa6U, 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU,\n    0x3a9de42cU, 0x78920d50U, 0x5fcc9b6aU, 0x7e466254U,\n    0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, 0xc3aff582U,\n    0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU,\n    0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU,\n    0x267809cdU, 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U,\n    0x956e65e6U, 0xffe67eaaU, 0xbccf0821U, 0x15e8e6efU,\n    0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, 0xb07cd629U,\n    0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U,\n    0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U,\n    0x04984af1U, 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U,\n    0x4dd68d76U, 0xefb04d43U, 0xaa4d54ccU, 0x9604dfe4U,\n    0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, 0x65517f46U,\n    0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU,\n    0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU,\n    0xd7618c9aU, 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU,\n    0xa927eeceU, 0x61c935b7U, 0x1ce5ede1U, 0x47b13c7aU,\n    0xd2df599cU, 0xf2733f55U, 0x14ce7918U, 0xc737bf73U,\n    0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U,\n    0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U,\n    0x1dc37216U, 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU,\n    0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U,\n    0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U,\n};\n#endif\nstatic const u32 Td4[256] = {\n    0x52525252U, 0x09090909U, 0x6a6a6a6aU, 0xd5d5d5d5U,\n    0x30303030U, 0x36363636U, 0xa5a5a5a5U, 0x38383838U,\n    0xbfbfbfbfU, 0x40404040U, 0xa3a3a3a3U, 0x9e9e9e9eU,\n    0x81818181U, 0xf3f3f3f3U, 0xd7d7d7d7U, 0xfbfbfbfbU,\n    0x7c7c7c7cU, 0xe3e3e3e3U, 0x39393939U, 0x82828282U,\n    0x9b9b9b9bU, 0x2f2f2f2fU, 0xffffffffU, 0x87878787U,\n    0x34343434U, 0x8e8e8e8eU, 0x43434343U, 0x44444444U,\n    0xc4c4c4c4U, 0xdedededeU, 0xe9e9e9e9U, 0xcbcbcbcbU,\n    0x54545454U, 0x7b7b7b7bU, 0x94949494U, 0x32323232U,\n    0xa6a6a6a6U, 0xc2c2c2c2U, 0x23232323U, 0x3d3d3d3dU,\n    0xeeeeeeeeU, 0x4c4c4c4cU, 0x95959595U, 0x0b0b0b0bU,\n    0x42424242U, 0xfafafafaU, 0xc3c3c3c3U, 0x4e4e4e4eU,\n    0x08080808U, 0x2e2e2e2eU, 0xa1a1a1a1U, 0x66666666U,\n    0x28282828U, 0xd9d9d9d9U, 0x24242424U, 0xb2b2b2b2U,\n    0x76767676U, 0x5b5b5b5bU, 0xa2a2a2a2U, 0x49494949U,\n    0x6d6d6d6dU, 0x8b8b8b8bU, 0xd1d1d1d1U, 0x25252525U,\n    0x72727272U, 0xf8f8f8f8U, 0xf6f6f6f6U, 0x64646464U,\n    0x86868686U, 0x68686868U, 0x98989898U, 0x16161616U,\n    0xd4d4d4d4U, 0xa4a4a4a4U, 0x5c5c5c5cU, 0xccccccccU,\n    0x5d5d5d5dU, 0x65656565U, 0xb6b6b6b6U, 0x92929292U,\n    0x6c6c6c6cU, 0x70707070U, 0x48484848U, 0x50505050U,\n    0xfdfdfdfdU, 0xededededU, 0xb9b9b9b9U, 0xdadadadaU,\n    0x5e5e5e5eU, 0x15151515U, 0x46464646U, 0x57575757U,\n    0xa7a7a7a7U, 0x8d8d8d8dU, 0x9d9d9d9dU, 0x84848484U,\n    0x90909090U, 0xd8d8d8d8U, 0xababababU, 0x00000000U,\n    0x8c8c8c8cU, 0xbcbcbcbcU, 0xd3d3d3d3U, 0x0a0a0a0aU,\n    0xf7f7f7f7U, 0xe4e4e4e4U, 0x58585858U, 0x05050505U,\n    0xb8b8b8b8U, 0xb3b3b3b3U, 0x45454545U, 0x06060606U,\n    0xd0d0d0d0U, 0x2c2c2c2cU, 0x1e1e1e1eU, 0x8f8f8f8fU,\n    0xcacacacaU, 0x3f3f3f3fU, 0x0f0f0f0fU, 0x02020202U,\n    0xc1c1c1c1U, 0xafafafafU, 0xbdbdbdbdU, 0x03030303U,\n    0x01010101U, 0x13131313U, 0x8a8a8a8aU, 0x6b6b6b6bU,\n    0x3a3a3a3aU, 0x91919191U, 0x11111111U, 0x41414141U,\n    0x4f4f4f4fU, 0x67676767U, 0xdcdcdcdcU, 0xeaeaeaeaU,\n    0x97979797U, 0xf2f2f2f2U, 0xcfcfcfcfU, 0xcecececeU,\n    0xf0f0f0f0U, 0xb4b4b4b4U, 0xe6e6e6e6U, 0x73737373U,\n    0x96969696U, 0xacacacacU, 0x74747474U, 0x22222222U,\n    0xe7e7e7e7U, 0xadadadadU, 0x35353535U, 0x85858585U,\n    0xe2e2e2e2U, 0xf9f9f9f9U, 0x37373737U, 0xe8e8e8e8U,\n    0x1c1c1c1cU, 0x75757575U, 0xdfdfdfdfU, 0x6e6e6e6eU,\n    0x47474747U, 0xf1f1f1f1U, 0x1a1a1a1aU, 0x71717171U,\n    0x1d1d1d1dU, 0x29292929U, 0xc5c5c5c5U, 0x89898989U,\n    0x6f6f6f6fU, 0xb7b7b7b7U, 0x62626262U, 0x0e0e0e0eU,\n    0xaaaaaaaaU, 0x18181818U, 0xbebebebeU, 0x1b1b1b1bU,\n    0xfcfcfcfcU, 0x56565656U, 0x3e3e3e3eU, 0x4b4b4b4bU,\n    0xc6c6c6c6U, 0xd2d2d2d2U, 0x79797979U, 0x20202020U,\n    0x9a9a9a9aU, 0xdbdbdbdbU, 0xc0c0c0c0U, 0xfefefefeU,\n    0x78787878U, 0xcdcdcdcdU, 0x5a5a5a5aU, 0xf4f4f4f4U,\n    0x1f1f1f1fU, 0xddddddddU, 0xa8a8a8a8U, 0x33333333U,\n    0x88888888U, 0x07070707U, 0xc7c7c7c7U, 0x31313131U,\n    0xb1b1b1b1U, 0x12121212U, 0x10101010U, 0x59595959U,\n    0x27272727U, 0x80808080U, 0xececececU, 0x5f5f5f5fU,\n    0x60606060U, 0x51515151U, 0x7f7f7f7fU, 0xa9a9a9a9U,\n    0x19191919U, 0xb5b5b5b5U, 0x4a4a4a4aU, 0x0d0d0d0dU,\n    0x2d2d2d2dU, 0xe5e5e5e5U, 0x7a7a7a7aU, 0x9f9f9f9fU,\n    0x93939393U, 0xc9c9c9c9U, 0x9c9c9c9cU, 0xefefefefU,\n    0xa0a0a0a0U, 0xe0e0e0e0U, 0x3b3b3b3bU, 0x4d4d4d4dU,\n    0xaeaeaeaeU, 0x2a2a2a2aU, 0xf5f5f5f5U, 0xb0b0b0b0U,\n    0xc8c8c8c8U, 0xebebebebU, 0xbbbbbbbbU, 0x3c3c3c3cU,\n    0x83838383U, 0x53535353U, 0x99999999U, 0x61616161U,\n    0x17171717U, 0x2b2b2b2bU, 0x04040404U, 0x7e7e7e7eU,\n    0xbabababaU, 0x77777777U, 0xd6d6d6d6U, 0x26262626U,\n    0xe1e1e1e1U, 0x69696969U, 0x14141414U, 0x63636363U,\n    0x55555555U, 0x21212121U, 0x0c0c0c0cU, 0x7d7d7d7dU,\n};\nstatic const u32 rcon[] = {\n\t0x01000000, 0x02000000, 0x04000000, 0x08000000,\n\t0x10000000, 0x20000000, 0x40000000, 0x80000000,\n\t0x1B000000, 0x36000000, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */\n};\n\n/**\n * Expand the cipher key into the encryption key schedule.\n */\nint AES_set_encrypt_key(const unsigned char *userKey, const int bits,\n\t\t\tAES_KEY *key) {\n\n\tu32 *rk;\n   \tint i = 0;\n\tu32 temp;\n\n\tif (!userKey || !key)\n\t\treturn -1;\n\tif (bits != 128 && bits != 192 && bits != 256)\n\t\treturn -2;\n\n\trk = key->rd_key;\n\n\tif (bits==128)\n\t\tkey->rounds = 10;\n\telse if (bits==192)\n\t\tkey->rounds = 12;\n\telse\n\t\tkey->rounds = 14;\n\n\trk[0] = GETU32(userKey     );\n\trk[1] = GETU32(userKey +  4);\n\trk[2] = GETU32(userKey +  8);\n\trk[3] = GETU32(userKey + 12);\n\tif (bits == 128) {\n\t\twhile (1) {\n\t\t\ttemp  = rk[3];\n\t\t\trk[4] = rk[0] ^\n\t\t\t\t(Te4[(temp >> 16) & 0xff] & 0xff000000) ^\n\t\t\t\t(Te4[(temp >>  8) & 0xff] & 0x00ff0000) ^\n\t\t\t\t(Te4[(temp      ) & 0xff] & 0x0000ff00) ^\n\t\t\t\t(Te4[(temp >> 24)       ] & 0x000000ff) ^\n\t\t\t\trcon[i];\n\t\t\trk[5] = rk[1] ^ rk[4];\n\t\t\trk[6] = rk[2] ^ rk[5];\n\t\t\trk[7] = rk[3] ^ rk[6];\n\t\t\tif (++i == 10) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\trk += 4;\n\t\t}\n\t}\n\trk[4] = GETU32(userKey + 16);\n\trk[5] = GETU32(userKey + 20);\n\tif (bits == 192) {\n\t\twhile (1) {\n\t\t\ttemp = rk[ 5];\n\t\t\trk[ 6] = rk[ 0] ^\n\t\t\t\t(Te4[(temp >> 16) & 0xff] & 0xff000000) ^\n\t\t\t\t(Te4[(temp >>  8) & 0xff] & 0x00ff0000) ^\n\t\t\t\t(Te4[(temp      ) & 0xff] & 0x0000ff00) ^\n\t\t\t\t(Te4[(temp >> 24)       ] & 0x000000ff) ^\n\t\t\t\trcon[i];\n\t\t\trk[ 7] = rk[ 1] ^ rk[ 6];\n\t\t\trk[ 8] = rk[ 2] ^ rk[ 7];\n\t\t\trk[ 9] = rk[ 3] ^ rk[ 8];\n\t\t\tif (++i == 8) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\trk[10] = rk[ 4] ^ rk[ 9];\n\t\t\trk[11] = rk[ 5] ^ rk[10];\n\t\t\trk += 6;\n\t\t}\n\t}\n\trk[6] = GETU32(userKey + 24);\n\trk[7] = GETU32(userKey + 28);\n\tif (bits == 256) {\n\t\twhile (1) {\n\t\t\ttemp = rk[ 7];\n\t\t\trk[ 8] = rk[ 0] ^\n\t\t\t\t(Te4[(temp >> 16) & 0xff] & 0xff000000) ^\n\t\t\t\t(Te4[(temp >>  8) & 0xff] & 0x00ff0000) ^\n\t\t\t\t(Te4[(temp      ) & 0xff] & 0x0000ff00) ^\n\t\t\t\t(Te4[(temp >> 24)       ] & 0x000000ff) ^\n\t\t\t\trcon[i];\n\t\t\trk[ 9] = rk[ 1] ^ rk[ 8];\n\t\t\trk[10] = rk[ 2] ^ rk[ 9];\n\t\t\trk[11] = rk[ 3] ^ rk[10];\n\t\t\tif (++i == 7) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\ttemp = rk[11];\n\t\t\trk[12] = rk[ 4] ^\n\t\t\t\t(Te4[(temp >> 24)       ] & 0xff000000) ^\n\t\t\t\t(Te4[(temp >> 16) & 0xff] & 0x00ff0000) ^\n\t\t\t\t(Te4[(temp >>  8) & 0xff] & 0x0000ff00) ^\n\t\t\t\t(Te4[(temp      ) & 0xff] & 0x000000ff);\n\t\t\trk[13] = rk[ 5] ^ rk[12];\n\t\t\trk[14] = rk[ 6] ^ rk[13];\n\t\t\trk[15] = rk[ 7] ^ rk[14];\n\n\t\t\trk += 8;\n        \t}\n\t}\n\treturn 0;\n}\n\n/**\n * Expand the cipher key into the decryption key schedule.\n */\nint AES_set_decrypt_key(const unsigned char *userKey, const int bits,\n\t\t\t AES_KEY *key) {\n\n\tu32 *rk;\n\tint i, j, status;\n\tu32 temp;\n\n\t/* first, start with an encryption schedule */\n\tstatus = AES_set_encrypt_key(userKey, bits, key);\n\tif (status < 0)\n\t\treturn status;\n\n\trk = key->rd_key;\n\n\t/* invert the order of the round keys: */\n\tfor (i = 0, j = 4*(key->rounds); i < j; i += 4, j -= 4) {\n\t\ttemp = rk[i    ]; rk[i    ] = rk[j    ]; rk[j    ] = temp;\n\t\ttemp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp;\n\t\ttemp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp;\n\t\ttemp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp;\n\t}\n\t/* apply the inverse MixColumn transform to all round keys but the first and the last: */\n\tfor (i = 1; i < (key->rounds); i++) {\n\t\trk += 4;\n\t\trk[0] =\n\t\t\tTd0[Te4[(rk[0] >> 24)       ] & 0xff] ^\n\t\t\tTd1[Te4[(rk[0] >> 16) & 0xff] & 0xff] ^\n\t\t\tTd2[Te4[(rk[0] >>  8) & 0xff] & 0xff] ^\n\t\t\tTd3[Te4[(rk[0]      ) & 0xff] & 0xff];\n\t\trk[1] =\n\t\t\tTd0[Te4[(rk[1] >> 24)       ] & 0xff] ^\n\t\t\tTd1[Te4[(rk[1] >> 16) & 0xff] & 0xff] ^\n\t\t\tTd2[Te4[(rk[1] >>  8) & 0xff] & 0xff] ^\n\t\t\tTd3[Te4[(rk[1]      ) & 0xff] & 0xff];\n\t\trk[2] =\n\t\t\tTd0[Te4[(rk[2] >> 24)       ] & 0xff] ^\n\t\t\tTd1[Te4[(rk[2] >> 16) & 0xff] & 0xff] ^\n\t\t\tTd2[Te4[(rk[2] >>  8) & 0xff] & 0xff] ^\n\t\t\tTd3[Te4[(rk[2]      ) & 0xff] & 0xff];\n\t\trk[3] =\n\t\t\tTd0[Te4[(rk[3] >> 24)       ] & 0xff] ^\n\t\t\tTd1[Te4[(rk[3] >> 16) & 0xff] & 0xff] ^\n\t\t\tTd2[Te4[(rk[3] >>  8) & 0xff] & 0xff] ^\n\t\t\tTd3[Te4[(rk[3]      ) & 0xff] & 0xff];\n\t}\n\treturn 0;\n}\n\n#ifndef AES_ASM\n/*\n * Encrypt a single block\n * in and out can overlap\n */\nvoid AES_encrypt(const unsigned char *in, unsigned char *out,\n\t\t const AES_KEY *key) {\n\n\tconst u32 *rk;\n\tu32 s0, s1, s2, s3, t0, t1, t2, t3;\n#ifndef FULL_UNROLL\n\tint r;\n#endif /* ?FULL_UNROLL */\n\n\tassert(in && out && key);\n\trk = key->rd_key;\n\n\t/*\n\t * map byte array block to cipher state\n\t * and add initial round key:\n\t */\n\ts0 = GETU32(in     ) ^ rk[0];\n\ts1 = GETU32(in +  4) ^ rk[1];\n\ts2 = GETU32(in +  8) ^ rk[2];\n\ts3 = GETU32(in + 12) ^ rk[3];\n#ifdef FULL_UNROLL\n\t/* round 1: */\n   \tt0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[ 4];\n   \tt1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[ 5];\n   \tt2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[ 6];\n   \tt3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[ 7];\n   \t/* round 2: */\n   \ts0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >>  8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[ 8];\n   \ts1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >>  8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[ 9];\n   \ts2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >>  8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[10];\n   \ts3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >>  8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[11];\n\t/* round 3: */\n   \tt0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[12];\n   \tt1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[13];\n   \tt2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[14];\n   \tt3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[15];\n   \t/* round 4: */\n   \ts0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >>  8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[16];\n   \ts1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >>  8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[17];\n   \ts2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >>  8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[18];\n   \ts3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >>  8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[19];\n\t/* round 5: */\n   \tt0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[20];\n   \tt1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[21];\n   \tt2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[22];\n   \tt3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[23];\n   \t/* round 6: */\n   \ts0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >>  8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[24];\n   \ts1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >>  8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[25];\n   \ts2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >>  8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[26];\n   \ts3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >>  8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[27];\n\t/* round 7: */\n   \tt0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[28];\n   \tt1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[29];\n   \tt2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[30];\n   \tt3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[31];\n   \t/* round 8: */\n   \ts0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >>  8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[32];\n   \ts1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >>  8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[33];\n   \ts2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >>  8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[34];\n   \ts3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >>  8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[35];\n\t/* round 9: */\n   \tt0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[36];\n   \tt1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[37];\n   \tt2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[38];\n   \tt3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[39];\n    if (key->rounds > 10) {\n        /* round 10: */\n        s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >>  8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[40];\n        s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >>  8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[41];\n        s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >>  8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[42];\n        s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >>  8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[43];\n        /* round 11: */\n        t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[44];\n        t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[45];\n        t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[46];\n        t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[47];\n        if (key->rounds > 12) {\n            /* round 12: */\n            s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >>  8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[48];\n            s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >>  8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[49];\n            s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >>  8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[50];\n            s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >>  8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[51];\n            /* round 13: */\n            t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[52];\n            t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[53];\n            t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[54];\n            t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[55];\n        }\n    }\n    rk += key->rounds << 2;\n#else  /* !FULL_UNROLL */\n    /*\n     * Nr - 1 full rounds:\n     */\n    r = key->rounds >> 1;\n    for (;;) {\n        t0 =\n            Te0[(s0 >> 24)       ] ^\n            Te1[(s1 >> 16) & 0xff] ^\n            Te2[(s2 >>  8) & 0xff] ^\n            Te3[(s3      ) & 0xff] ^\n            rk[4];\n        t1 =\n            Te0[(s1 >> 24)       ] ^\n            Te1[(s2 >> 16) & 0xff] ^\n            Te2[(s3 >>  8) & 0xff] ^\n            Te3[(s0      ) & 0xff] ^\n            rk[5];\n        t2 =\n            Te0[(s2 >> 24)       ] ^\n            Te1[(s3 >> 16) & 0xff] ^\n            Te2[(s0 >>  8) & 0xff] ^\n            Te3[(s1      ) & 0xff] ^\n            rk[6];\n        t3 =\n            Te0[(s3 >> 24)       ] ^\n            Te1[(s0 >> 16) & 0xff] ^\n            Te2[(s1 >>  8) & 0xff] ^\n            Te3[(s2      ) & 0xff] ^\n            rk[7];\n\n        rk += 8;\n        if (--r == 0) {\n            break;\n        }\n\n        s0 =\n            Te0[(t0 >> 24)       ] ^\n            Te1[(t1 >> 16) & 0xff] ^\n            Te2[(t2 >>  8) & 0xff] ^\n            Te3[(t3      ) & 0xff] ^\n            rk[0];\n        s1 =\n            Te0[(t1 >> 24)       ] ^\n            Te1[(t2 >> 16) & 0xff] ^\n            Te2[(t3 >>  8) & 0xff] ^\n            Te3[(t0      ) & 0xff] ^\n            rk[1];\n        s2 =\n            Te0[(t2 >> 24)       ] ^\n            Te1[(t3 >> 16) & 0xff] ^\n            Te2[(t0 >>  8) & 0xff] ^\n            Te3[(t1      ) & 0xff] ^\n            rk[2];\n        s3 =\n            Te0[(t3 >> 24)       ] ^\n            Te1[(t0 >> 16) & 0xff] ^\n            Te2[(t1 >>  8) & 0xff] ^\n            Te3[(t2      ) & 0xff] ^\n            rk[3];\n    }\n#endif /* ?FULL_UNROLL */\n    /*\n\t * apply last round and\n\t * map cipher state to byte array block:\n\t */\n\ts0 =\n\t\t(Te4[(t0 >> 24)       ] & 0xff000000) ^\n\t\t(Te4[(t1 >> 16) & 0xff] & 0x00ff0000) ^\n\t\t(Te4[(t2 >>  8) & 0xff] & 0x0000ff00) ^\n\t\t(Te4[(t3      ) & 0xff] & 0x000000ff) ^\n\t\trk[0];\n\tPUTU32(out     , s0);\n\ts1 =\n\t\t(Te4[(t1 >> 24)       ] & 0xff000000) ^\n\t\t(Te4[(t2 >> 16) & 0xff] & 0x00ff0000) ^\n\t\t(Te4[(t3 >>  8) & 0xff] & 0x0000ff00) ^\n\t\t(Te4[(t0      ) & 0xff] & 0x000000ff) ^\n\t\trk[1];\n\tPUTU32(out +  4, s1);\n\ts2 =\n\t\t(Te4[(t2 >> 24)       ] & 0xff000000) ^\n\t\t(Te4[(t3 >> 16) & 0xff] & 0x00ff0000) ^\n\t\t(Te4[(t0 >>  8) & 0xff] & 0x0000ff00) ^\n\t\t(Te4[(t1      ) & 0xff] & 0x000000ff) ^\n\t\trk[2];\n\tPUTU32(out +  8, s2);\n\ts3 =\n\t\t(Te4[(t3 >> 24)       ] & 0xff000000) ^\n\t\t(Te4[(t0 >> 16) & 0xff] & 0x00ff0000) ^\n\t\t(Te4[(t1 >>  8) & 0xff] & 0x0000ff00) ^\n\t\t(Te4[(t2      ) & 0xff] & 0x000000ff) ^\n\t\trk[3];\n\tPUTU32(out + 12, s3);\n}\n\n/*\n * Decrypt a single block\n * in and out can overlap\n */\nvoid AES_decrypt(const unsigned char *in, unsigned char *out,\n\t\t const AES_KEY *key) {\n\n\tconst u32 *rk;\n\tu32 s0, s1, s2, s3, t0, t1, t2, t3;\n#ifndef FULL_UNROLL\n\tint r;\n#endif /* ?FULL_UNROLL */\n\n\tassert(in && out && key);\n\trk = key->rd_key;\n\n\t/*\n\t * map byte array block to cipher state\n\t * and add initial round key:\n\t */\n    s0 = GETU32(in     ) ^ rk[0];\n    s1 = GETU32(in +  4) ^ rk[1];\n    s2 = GETU32(in +  8) ^ rk[2];\n    s3 = GETU32(in + 12) ^ rk[3];\n#ifdef FULL_UNROLL\n    /* round 1: */\n    t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[ 4];\n    t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[ 5];\n    t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[ 6];\n    t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[ 7];\n    /* round 2: */\n    s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >>  8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[ 8];\n    s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >>  8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[ 9];\n    s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >>  8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[10];\n    s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >>  8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[11];\n    /* round 3: */\n    t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[12];\n    t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[13];\n    t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[14];\n    t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[15];\n    /* round 4: */\n    s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >>  8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[16];\n    s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >>  8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[17];\n    s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >>  8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[18];\n    s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >>  8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[19];\n    /* round 5: */\n    t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[20];\n    t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[21];\n    t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[22];\n    t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[23];\n    /* round 6: */\n    s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >>  8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[24];\n    s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >>  8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[25];\n    s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >>  8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[26];\n    s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >>  8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[27];\n    /* round 7: */\n    t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[28];\n    t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[29];\n    t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[30];\n    t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[31];\n    /* round 8: */\n    s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >>  8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[32];\n    s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >>  8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[33];\n    s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >>  8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[34];\n    s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >>  8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[35];\n    /* round 9: */\n    t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[36];\n    t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[37];\n    t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[38];\n    t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[39];\n    if (key->rounds > 10) {\n        /* round 10: */\n        s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >>  8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[40];\n        s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >>  8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[41];\n        s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >>  8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[42];\n        s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >>  8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[43];\n        /* round 11: */\n        t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[44];\n        t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[45];\n        t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[46];\n        t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[47];\n        if (key->rounds > 12) {\n            /* round 12: */\n            s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >>  8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[48];\n            s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >>  8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[49];\n            s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >>  8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[50];\n            s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >>  8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[51];\n            /* round 13: */\n            t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[52];\n            t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[53];\n            t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[54];\n            t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[55];\n        }\n    }\n\trk += key->rounds << 2;\n#else  /* !FULL_UNROLL */\n    /*\n     * Nr - 1 full rounds:\n     */\n    r = key->rounds >> 1;\n    for (;;) {\n        t0 =\n            Td0[(s0 >> 24)       ] ^\n            Td1[(s3 >> 16) & 0xff] ^\n            Td2[(s2 >>  8) & 0xff] ^\n            Td3[(s1      ) & 0xff] ^\n            rk[4];\n        t1 =\n            Td0[(s1 >> 24)       ] ^\n            Td1[(s0 >> 16) & 0xff] ^\n            Td2[(s3 >>  8) & 0xff] ^\n            Td3[(s2      ) & 0xff] ^\n            rk[5];\n        t2 =\n            Td0[(s2 >> 24)       ] ^\n            Td1[(s1 >> 16) & 0xff] ^\n            Td2[(s0 >>  8) & 0xff] ^\n            Td3[(s3      ) & 0xff] ^\n            rk[6];\n        t3 =\n            Td0[(s3 >> 24)       ] ^\n            Td1[(s2 >> 16) & 0xff] ^\n            Td2[(s1 >>  8) & 0xff] ^\n            Td3[(s0      ) & 0xff] ^\n            rk[7];\n\n        rk += 8;\n        if (--r == 0) {\n            break;\n        }\n\n        s0 =\n            Td0[(t0 >> 24)       ] ^\n            Td1[(t3 >> 16) & 0xff] ^\n            Td2[(t2 >>  8) & 0xff] ^\n            Td3[(t1      ) & 0xff] ^\n            rk[0];\n        s1 =\n            Td0[(t1 >> 24)       ] ^\n            Td1[(t0 >> 16) & 0xff] ^\n            Td2[(t3 >>  8) & 0xff] ^\n            Td3[(t2      ) & 0xff] ^\n            rk[1];\n        s2 =\n            Td0[(t2 >> 24)       ] ^\n            Td1[(t1 >> 16) & 0xff] ^\n            Td2[(t0 >>  8) & 0xff] ^\n            Td3[(t3      ) & 0xff] ^\n            rk[2];\n        s3 =\n            Td0[(t3 >> 24)       ] ^\n            Td1[(t2 >> 16) & 0xff] ^\n            Td2[(t1 >>  8) & 0xff] ^\n            Td3[(t0      ) & 0xff] ^\n            rk[3];\n    }\n#endif /* ?FULL_UNROLL */\n    /*\n\t * apply last round and\n\t * map cipher state to byte array block:\n\t */\n   \ts0 =\n   \t\t(Td4[(t0 >> 24)       ] & 0xff000000) ^\n   \t\t(Td4[(t3 >> 16) & 0xff] & 0x00ff0000) ^\n   \t\t(Td4[(t2 >>  8) & 0xff] & 0x0000ff00) ^\n   \t\t(Td4[(t1      ) & 0xff] & 0x000000ff) ^\n   \t\trk[0];\n\tPUTU32(out     , s0);\n   \ts1 =\n   \t\t(Td4[(t1 >> 24)       ] & 0xff000000) ^\n   \t\t(Td4[(t0 >> 16) & 0xff] & 0x00ff0000) ^\n   \t\t(Td4[(t3 >>  8) & 0xff] & 0x0000ff00) ^\n   \t\t(Td4[(t2      ) & 0xff] & 0x000000ff) ^\n   \t\trk[1];\n\tPUTU32(out +  4, s1);\n   \ts2 =\n   \t\t(Td4[(t2 >> 24)       ] & 0xff000000) ^\n   \t\t(Td4[(t1 >> 16) & 0xff] & 0x00ff0000) ^\n   \t\t(Td4[(t0 >>  8) & 0xff] & 0x0000ff00) ^\n   \t\t(Td4[(t3      ) & 0xff] & 0x000000ff) ^\n   \t\trk[2];\n\tPUTU32(out +  8, s2);\n   \ts3 =\n   \t\t(Td4[(t3 >> 24)       ] & 0xff000000) ^\n   \t\t(Td4[(t2 >> 16) & 0xff] & 0x00ff0000) ^\n   \t\t(Td4[(t1 >>  8) & 0xff] & 0x0000ff00) ^\n   \t\t(Td4[(t0      ) & 0xff] & 0x000000ff) ^\n   \t\trk[3];\n\tPUTU32(out + 12, s3);\n}\n\n#endif /* AES_ASM */\n"
  },
  {
    "path": "Bundles/Echoware/OpenSSL/aes_locl.h",
    "content": "/* crypto/aes/aes.h -*- mode:C; c-file-style: \"eay\" -*- */\n/* ====================================================================\n * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n */\n\n#ifndef HEADER_AES_LOCL_H\n#define HEADER_AES_LOCL_H\n\n#include \"e_os2.h\"\n\n#ifdef OPENSSL_NO_AES\n#error AES is disabled.\n#endif\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#if defined(_MSC_VER) && !defined(_M_IA64) && !defined(OPENSSL_SYS_WINCE)\n# define SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00)\n# define GETU32(p) SWAP(*((u32 *)(p)))\n# define PUTU32(ct, st) { *((u32 *)(ct)) = SWAP((st)); }\n#else\n# define GETU32(pt) (((u32)(pt)[0] << 24) ^ ((u32)(pt)[1] << 16) ^ ((u32)(pt)[2] <<  8) ^ ((u32)(pt)[3]))\n# define PUTU32(ct, st) { (ct)[0] = (u8)((st) >> 24); (ct)[1] = (u8)((st) >> 16); (ct)[2] = (u8)((st) >>  8); (ct)[3] = (u8)(st); }\n#endif\n\n#ifdef AES_LONG\ntypedef unsigned long u32;\n#else\ntypedef unsigned int u32;\n#endif\ntypedef unsigned short u16;\ntypedef unsigned char u8;\n\n#define MAXKC   (256/32)\n#define MAXKB   (256/8)\n#define MAXNR   14\n\n/* This controls loop-unrolling in aes_core.c */\n#undef FULL_UNROLL\n\n#endif /* !HEADER_AES_LOCL_H */\n"
  },
  {
    "path": "Bundles/Echoware/OpenSSL/e_os2.h",
    "content": "/* e_os2.h */\n/* ====================================================================\n * Copyright (c) 1998-2000 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n#include \"opensslconf.h\"\n\n#ifndef HEADER_E_OS2_H\n#define HEADER_E_OS2_H\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/******************************************************************************\n * Detect operating systems.  This probably needs completing.\n * The result is that at least one OPENSSL_SYS_os macro should be defined.\n * However, if none is defined, Unix is assumed.\n **/\n\n#define OPENSSL_SYS_UNIX\n\n/* ----------------------- Macintosh, before MacOS X ----------------------- */\n#if defined(__MWERKS__) && defined(macintosh) || defined(OPENSSL_SYSNAME_MAC)\n# undef OPENSSL_SYS_UNIX\n# define OPENSSL_SYS_MACINTOSH_CLASSIC\n#endif\n\n/* ----------------------- NetWare ----------------------------------------- */\n#if defined(NETWARE) || defined(OPENSSL_SYSNAME_NETWARE)\n# undef OPENSSL_SYS_UNIX\n# define OPENSSL_SYS_NETWARE\n#endif\n\n/* ---------------------- Microsoft operating systems ---------------------- */\n\n/* The 16 bit environments are pretty straightforward */\n#if defined(OPENSSL_SYSNAME_WIN16) || defined(OPENSSL_SYSNAME_MSDOS)\n# undef OPENSSL_SYS_UNIX\n# define OPENSSL_SYS_MSDOS\n#endif\n#if defined(OPENSSL_SYSNAME_WIN16)\n# undef OPENSSL_SYS_UNIX\n# define OPENSSL_SYS_WIN16\n#endif\n\n/* For 32 bit environment, there seems to be the CygWin environment and then\n   all the others that try to do the same thing Microsoft does... */\n#if defined(OPENSSL_SYSNAME_UWIN)\n# undef OPENSSL_SYS_UNIX\n# define OPENSSL_SYS_WIN32_UWIN\n#else\n# if defined(__CYGWIN32__) || defined(OPENSSL_SYSNAME_CYGWIN32)\n#  undef OPENSSL_SYS_UNIX\n#  define OPENSSL_SYS_WIN32_CYGWIN\n# else\n#  if defined(_WIN32) || defined(OPENSSL_SYSNAME_WIN32)\n#   undef OPENSSL_SYS_UNIX\n#   define OPENSSL_SYS_WIN32\n#  endif\n#  if defined(OPENSSL_SYSNAME_WINNT)\n#   undef OPENSSL_SYS_UNIX\n#   define OPENSSL_SYS_WINNT\n#  endif\n#  if defined(OPENSSL_SYSNAME_WINCE)\n#   undef OPENSSL_SYS_UNIX\n#   define OPENSSL_SYS_WINCE\n#  endif\n# endif\n#endif\n\n/* Anything that tries to look like Microsoft is \"Windows\" */\n#if defined(OPENSSL_SYS_WIN16) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WINNT) || defined(OPENSSL_SYS_WINCE)\n# undef OPENSSL_SYS_UNIX\n# define OPENSSL_SYS_WINDOWS\n# ifndef OPENSSL_SYS_MSDOS\n#  define OPENSSL_SYS_MSDOS\n# endif\n#endif\n\n/* DLL settings.  This part is a bit tough, because it's up to the application\n   implementor how he or she will link the application, so it requires some\n   macro to be used. */\n#ifdef OPENSSL_SYS_WINDOWS\n# ifndef OPENSSL_OPT_WINDLL\n#  if defined(_WINDLL) /* This is used when building OpenSSL to indicate that\n                          DLL linkage should be used */\n#   define OPENSSL_OPT_WINDLL\n#  endif\n# endif\n#endif\n\n/* -------------------------------- OpenVMS -------------------------------- */\n#if defined(__VMS) || defined(VMS) || defined(OPENSSL_SYSNAME_VMS)\n# undef OPENSSL_SYS_UNIX\n# define OPENSSL_SYS_VMS\n# if defined(__DECC)\n#  define OPENSSL_SYS_VMS_DECC\n# elif defined(__DECCXX)\n#  define OPENSSL_SYS_VMS_DECC\n#  define OPENSSL_SYS_VMS_DECCXX\n# else\n#  define OPENSSL_SYS_VMS_NODECC\n# endif\n#endif\n\n/* --------------------------------- OS/2 ---------------------------------- */\n#if defined(__EMX__) || defined(__OS2__)\n# undef OPENSSL_SYS_UNIX\n# define OPENSSL_SYS_OS2\n#endif\n\n/* --------------------------------- Unix ---------------------------------- */\n#ifdef OPENSSL_SYS_UNIX\n# if defined(linux) || defined(__linux__) || defined(OPENSSL_SYSNAME_LINUX)\n#  define OPENSSL_SYS_LINUX\n# endif\n# ifdef OPENSSL_SYSNAME_MPE\n#  define OPENSSL_SYS_MPE\n# endif\n# ifdef OPENSSL_SYSNAME_SNI\n#  define OPENSSL_SYS_SNI\n# endif\n# ifdef OPENSSL_SYSNAME_ULTRASPARC\n#  define OPENSSL_SYS_ULTRASPARC\n# endif\n# ifdef OPENSSL_SYSNAME_NEWS4\n#  define OPENSSL_SYS_NEWS4\n# endif\n# ifdef OPENSSL_SYSNAME_MACOSX\n#  define OPENSSL_SYS_MACOSX\n# endif\n# ifdef OPENSSL_SYSNAME_MACOSX_RHAPSODY\n#  define OPENSSL_SYS_MACOSX_RHAPSODY\n#  define OPENSSL_SYS_MACOSX\n# endif\n# ifdef OPENSSL_SYSNAME_SUNOS\n#  define OPENSSL_SYS_SUNOS\n#endif\n# if defined(_CRAY) || defined(OPENSSL_SYSNAME_CRAY)\n#  define OPENSSL_SYS_CRAY\n# endif\n# if defined(_AIX) || defined(OPENSSL_SYSNAME_AIX)\n#  define OPENSSL_SYS_AIX\n# endif\n#endif\n\n/* --------------------------------- VOS ----------------------------------- */\n#ifdef OPENSSL_SYSNAME_VOS\n# define OPENSSL_SYS_VOS\n#endif\n\n/* ------------------------------- VxWorks --------------------------------- */\n#ifdef OPENSSL_SYSNAME_VXWORKS\n# define OPENSSL_SYS_VXWORKS\n#endif\n\n/**\n * That's it for OS-specific stuff\n *****************************************************************************/\n\n\n/* Specials for I/O an exit */\n#ifdef OPENSSL_SYS_WIN16\n# define OPENSSL_NO_FP_API\n#endif\n#ifdef OPENSSL_SYS_MSDOS\n# define OPENSSL_UNISTD_IO <io.h>\n# define OPENSSL_DECLARE_EXIT extern void exit(int);\n#else\n# define OPENSSL_UNISTD_IO OPENSSL_UNISTD\n# define OPENSSL_DECLARE_EXIT /* declared in unistd.h */\n#endif\n\n/* Definitions of OPENSSL_GLOBAL and OPENSSL_EXTERN, to define and declare\n   certain global symbols that, with some compilers under VMS, have to be\n   defined and declared explicitely with globaldef and globalref.\n   Definitions of OPENSSL_EXPORT and OPENSSL_IMPORT, to define and declare\n   DLL exports and imports for compilers under Win32.  These are a little\n   more complicated to use.  Basically, for any library that exports some\n   global variables, the following code must be present in the header file\n   that declares them, before OPENSSL_EXTERN is used:\n\n   #ifdef SOME_BUILD_FLAG_MACRO\n   # undef OPENSSL_EXTERN\n   # define OPENSSL_EXTERN OPENSSL_EXPORT\n   #endif\n\n   The default is to have OPENSSL_EXPORT, OPENSSL_IMPORT and OPENSSL_GLOBAL\n   have some generally sensible values, and for OPENSSL_EXTERN to have the\n   value OPENSSL_IMPORT.\n*/\n\n#if defined(OPENSSL_SYS_VMS_NODECC)\n# define OPENSSL_EXPORT globalref\n# define OPENSSL_IMPORT globalref\n# define OPENSSL_GLOBAL globaldef\n#elif defined(OPENSSL_SYS_WINDOWS) && defined(OPENSSL_OPT_WINDLL)\n# define OPENSSL_EXPORT extern __declspec(dllexport)\n# define OPENSSL_IMPORT extern __declspec(dllimport)\n# define OPENSSL_GLOBAL\n#else\n# define OPENSSL_EXPORT extern\n# define OPENSSL_IMPORT extern\n# define OPENSSL_GLOBAL\n#endif\n#define OPENSSL_EXTERN OPENSSL_IMPORT\n\n/* Macros to allow global variables to be reached through function calls when\n   required (if a shared library version requvres it, for example.\n   The way it's done allows definitions like this:\n\n\t// in foobar.c\n\tOPENSSL_IMPLEMENT_GLOBAL(int,foobar) = 0;\n\t// in foobar.h\n\tOPENSSL_DECLARE_GLOBAL(int,foobar);\n\t#define foobar OPENSSL_GLOBAL_REF(foobar)\n*/\n#ifdef OPENSSL_EXPORT_VAR_AS_FUNCTION\n# define OPENSSL_IMPLEMENT_GLOBAL(type,name)\t\t\t     \\\n\textern type _hide_##name;\t\t\t\t     \\\n\ttype *_shadow_##name(void) { return &_hide_##name; }\t     \\\n\tstatic type _hide_##name\n# define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void)\n# define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name()))\n#else\n# define OPENSSL_IMPLEMENT_GLOBAL(type,name) OPENSSL_GLOBAL type _shadow_##name\n# define OPENSSL_DECLARE_GLOBAL(type,name) OPENSSL_EXPORT type _shadow_##name\n# define OPENSSL_GLOBAL_REF(name) _shadow_##name\n#endif\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "Bundles/Echoware/OpenSSL/opensslconf.h",
    "content": "/* opensslconf.h */\n/* WARNING: Generated automatically from opensslconf.h.in by Configure. */\n\n/* OpenSSL was configured with the following options: */\n#ifndef OPENSSL_DOING_MAKEDEPEND\n\n#ifndef OPENSSL_NO_GMP\n# define OPENSSL_NO_GMP\n#endif\n#ifndef OPENSSL_NO_KRB5\n# define OPENSSL_NO_KRB5\n#endif\n#ifndef OPENSSL_NO_MDC2\n# define OPENSSL_NO_MDC2\n#endif\n#ifndef OPENSSL_NO_RC5\n# define OPENSSL_NO_RC5\n#endif\n\n#endif /* OPENSSL_DOING_MAKEDEPEND */\n#ifndef OPENSSL_NO_DYNAMIC_ENGINE\n# define OPENSSL_NO_DYNAMIC_ENGINE\n#endif\n\n/* The OPENSSL_NO_* macros are also defined as NO_* if the application\n   asks for it.  This is a transient feature that is provided for those\n   who haven't had the time to do the appropriate changes in their\n   applications.  */\n#ifdef OPENSSL_ALGORITHM_DEFINES\n# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP)\n#  define NO_GMP\n# endif\n# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5)\n#  define NO_KRB5\n# endif\n# if defined(OPENSSL_NO_MDC2) && !defined(NO_MDC2)\n#  define NO_MDC2\n# endif\n# if defined(OPENSSL_NO_RC5) && !defined(NO_RC5)\n#  define NO_RC5\n# endif\n#endif\n\n/* crypto/opensslconf.h.in */\n\n/* Generate 80386 code? */\n#undef I386_ONLY\n\n#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */\n#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)\n#define ENGINESDIR \"/usr/local/ssl/lib/engines\"\n#define OPENSSLDIR \"/usr/local/ssl\"\n#endif\n#endif\n\n#undef OPENSSL_UNISTD\n#define OPENSSL_UNISTD <unistd.h>\n\n#undef OPENSSL_EXPORT_VAR_AS_FUNCTION\n\n#if defined(HEADER_IDEA_H) && !defined(IDEA_INT)\n#define IDEA_INT unsigned int\n#endif\n\n#if defined(HEADER_MD2_H) && !defined(MD2_INT)\n#define MD2_INT unsigned int\n#endif\n\n#if defined(HEADER_RC2_H) && !defined(RC2_INT)\n/* I need to put in a mod for the alpha - eay */\n#define RC2_INT unsigned int\n#endif\n\n#if defined(HEADER_RC4_H)\n#if !defined(RC4_INT)\n/* using int types make the structure larger but make the code faster\n * on most boxes I have tested - up to %20 faster. */\n/*\n * I don't know what does \"most\" mean, but declaring \"int\" is a must on:\n * - Intel P6 because partial register stalls are very expensive;\n * - elder Alpha because it lacks byte load/store instructions;\n */\n#define RC4_INT unsigned int\n#endif\n#if !defined(RC4_CHUNK)\n/*\n * This enables code handling data aligned at natural CPU word\n * boundary. See crypto/rc4/rc4_enc.c for further details.\n */\n#undef RC4_CHUNK\n#endif\n#endif\n\n#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG)\n/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a\n * %20 speed up (longs are 8 bytes, int's are 4). */\n#ifndef DES_LONG\n#define DES_LONG unsigned long\n#endif\n#endif\n\n#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)\n#define CONFIG_HEADER_BN_H\n#undef BN_LLONG\n\n/* Should we define BN_DIV2W here? */\n\n/* Only one for the following should be defined */\n/* The prime number generation stuff may not work when\n * EIGHT_BIT but I don't care since I've only used this mode\n * for debuging the bignum libraries */\n#undef SIXTY_FOUR_BIT_LONG\n#undef SIXTY_FOUR_BIT\n#define THIRTY_TWO_BIT\n#undef SIXTEEN_BIT\n#undef EIGHT_BIT\n#endif\n\n#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)\n#define CONFIG_HEADER_RC4_LOCL_H\n/* if this is defined data[i] is used instead of *data, this is a %20\n * speedup on x86 */\n#undef RC4_INDEX\n#endif\n\n#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)\n#define CONFIG_HEADER_BF_LOCL_H\n#undef BF_PTR\n#endif /* HEADER_BF_LOCL_H */\n\n#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)\n#define CONFIG_HEADER_DES_LOCL_H\n#ifndef DES_DEFAULT_OPTIONS\n/* the following is tweaked from a config script, that is why it is a\n * protected undef/define */\n#ifndef DES_PTR\n#undef DES_PTR\n#endif\n\n/* This helps C compiler generate the correct code for multiple functional\n * units.  It reduces register dependencies at the expense of 2 more\n * registers */\n#ifndef DES_RISC1\n#undef DES_RISC1\n#endif\n\n#ifndef DES_RISC2\n#undef DES_RISC2\n#endif\n\n#if defined(DES_RISC1) && defined(DES_RISC2)\nYOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!\n#endif\n\n/* Unroll the inner loop, this sometimes helps, sometimes hinders.\n * Very much CPU dependent */\n#ifndef DES_UNROLL\n#undef DES_UNROLL\n#endif\n\n/* These default values were supplied by\n * Peter Gutman <pgut001@cs.auckland.ac.nz>\n * They are only used if nothing else has been defined */\n#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL)\n/* Special defines which change the way the code is built depending on the\n   CPU and OS.  For SGI machines you can use _MIPS_SZLONG (32 or 64) to find\n   even newer MIPS CPU's, but at the moment one size fits all for\n   optimization options.  Older Sparc's work better with only UNROLL, but\n   there's no way to tell at compile time what it is you're running on */\n\n#if defined( sun )\t\t/* Newer Sparc's */\n#  define DES_PTR\n#  define DES_RISC1\n#  define DES_UNROLL\n#elif defined( __ultrix )\t/* Older MIPS */\n#  define DES_PTR\n#  define DES_RISC2\n#  define DES_UNROLL\n#elif defined( __osf1__ )\t/* Alpha */\n#  define DES_PTR\n#  define DES_RISC2\n#elif defined ( _AIX )\t\t/* RS6000 */\n  /* Unknown */\n#elif defined( __hpux )\t\t/* HP-PA */\n  /* Unknown */\n#elif defined( __aux )\t\t/* 68K */\n  /* Unknown */\n#elif defined( __dgux )\t\t/* 88K (but P6 in latest boxes) */\n#  define DES_UNROLL\n#elif defined( __sgi )\t\t/* Newer MIPS */\n#  define DES_PTR\n#  define DES_RISC2\n#  define DES_UNROLL\n#elif defined(i386) || defined(__i386__)\t/* x86 boxes, should be gcc */\n#  define DES_PTR\n#  define DES_RISC1\n#  define DES_UNROLL\n#endif /* Systems-specific speed defines */\n#endif\n\n#endif /* DES_DEFAULT_OPTIONS */\n#endif /* HEADER_DES_LOCL_H */\n"
  },
  {
    "path": "Bundles/Echoware/ProxiesManager.cpp",
    "content": "#include \"StdAfx.h\"\n#include \"proxiesmanager.h\"\n#include \"DllProxyInfo.h\"\n//#include <algorithm>\n\nCProxiesManager::CProxiesManager(void)\n{\n\tshouldQuit=0; // Mac OSX\n\thasQuit=0; // Mac OSX\n\n\tm_bLocalProxy=false;\n\tm_pLocalProxy=0;\n\n\tm_hReconectProxiesThread=CreateThread(0, 0, ReconectProxiesThreadProc, this, 0, &m_dwReconectProxiesThread);\n}\n\nCProxiesManager::~CProxiesManager(void)\n{\n\tShutdownThread(m_hReconectProxiesThread, THREAD_STOP_TIMEOUT, &shouldQuit, &hasQuit);\n\tRemoveAllProxies();\n}\n\n//add a proxy to the proxies list\nvoid CProxiesManager::AddProxy(CDllProxyInfo* pProxyInfo)\n{\n\tm_critSection.Lock();\n\n\tCProxyConnection* pProxy=new CProxyConnection(pProxyInfo);\n\n\tm_listProxies.push_back(pProxy);\n\n\tm_critSection.Unlock();\n}\n\n//remove a proxy from the proxies list\nvoid CProxiesManager::RemoveProxy(CDllProxyInfo* pProxyInfo)\n{\n\tm_critSection.Lock();\n\n\tfor(std::list<CProxyConnection*>::iterator it=m_listProxies.begin(); it!=m_listProxies.end(); it++)\n\t\tif (((CProxyConnection*)*it)->GetProxyInfo()==pProxyInfo)\n\t\t{\n\t\t\tCProxyConnection* pProxy=(CProxyConnection*)*it;\n\t\t\tdelete pProxy;\n\t\t\tpProxy=0;\n\n\t\t\tstd::list<CProxyConnection*>::iterator itend=it;\n\t\t\titend++;\n\t\t\tm_listProxies.erase(it, itend);\n\t\t\tbreak;\n\t\t}\n\n\tm_critSection.Unlock();\n}\n\n//remove all the proxies from the proxies list\nvoid CProxiesManager::RemoveAllProxies()\n{\n\tm_critSection.Lock();\n\n\tfor(std::list<CProxyConnection*>::iterator it=m_listProxies.begin(); it!=m_listProxies.end(); it++)\n\t{\n\t\tCProxyConnection* pProxy=(CProxyConnection*)*it;\n\t\tdelete pProxy;\n\t}\n\n\tm_listProxies.clear();\n\n\tm_critSection.Unlock();\n}\n\n//connect a proxy\nint CProxiesManager::ConnectProxy(CDllProxyInfo* pProxyInfo)\n{\n\tint nRet=1;\n\n\tm_critSection.Lock();\n\n\tCProxyConnection* pProxyConnection=(CProxyConnection*)FindProxy(pProxyInfo);\n\n\tif (pProxyConnection)\n\t\tnRet=pProxyConnection->Connect();\n\n\tm_critSection.Unlock();\n\n\treturn nRet;\n}\n\n//disconnect a proxy\nbool CProxiesManager::DisconnectProxy(CDllProxyInfo* pProxyInfo)\n{\n\tbool bRet=true;\n\n\tm_critSection.Lock();\n\n\tCProxyConnection* pProxyConnection=(CProxyConnection*)FindProxy(pProxyInfo);\n\n\tif (pProxyConnection)\n\t\tbRet=pProxyConnection->Disconnect();\n\n\tm_critSection.Unlock();\n\n\treturn bRet;\n}\n\n//stop connecting a proxy\nvoid CProxiesManager::StopConnecting(CDllProxyInfo* pProxyInfo)\n{\n\tCProxyConnection* pProxyConnection=(CProxyConnection*)FindProxy(pProxyInfo);\n\n\tif (pProxyConnection)\n\t\tpProxyConnection->StopConnecting();\n}\n\n//disconnect all the proxies\nbool CProxiesManager::DisconnectAllProxies()\n{\n\tbool bRet=true;\n\n\tm_critSection.Lock();\n\n\tfor(std::list<CProxyConnection*>::iterator it=m_listProxies.begin(); it!=m_listProxies.end(); it++)\n\t{\n\t\tbRet= bRet && ((CProxyConnection*)*it)->Disconnect();\n\t}\n\n\tm_critSection.Unlock();\n\n\treturn bRet;\n}\n\n//set a proxy encryption level\nvoid CProxiesManager::SetEncryptionLevel(int level, CDllProxyInfo* pProxyInfo)\n{\n\tm_critSection.Lock();\n\n\tCProxyConnection* pProxyConnection=(CProxyConnection*)FindProxy(pProxyInfo);\n\n\tif (pProxyConnection)\n\t\tpProxyConnection->SetEncryptionLevel(level);\n\n\tm_critSection.Unlock();\n}\n\n//set info for the local proxy\nvoid CProxiesManager::SetLocalProxyInfo(char* ip, char* port, char* username, char* password)\n{\n\tm_critSection.Lock();\n\n\tm_bLocalProxy=true;\n\n\tif (!m_pLocalProxy)\n\t\tm_pLocalProxy=new CDllProxyInfo;\n\n\tm_pLocalProxy->SetIP(ip);\n\tm_pLocalProxy->SetPort(port);\n\tm_pLocalProxy->SetName(username);\n\tm_pLocalProxy->SetPassword(password);\n\n\tm_critSection.Unlock();\n}\n\n//try to connect all proxies\nvoid CProxiesManager::AutoConnect()\n{\n\tm_critSection.Lock();\n\n\tfor(std::list<CProxyConnection*>::iterator it=m_listProxies.begin(); it!=m_listProxies.end(); it++)\n\t{\n\t\t((CProxyConnection*)*it)->Connect();\n\t}\n\n\tm_critSection.Unlock();\n}\n\n//try to Estabilish new data channel\nint CProxiesManager::EstablishNewDataChannel(CDllProxyInfo* pProxyInfo , char* IDOfPartner)\n{\n\tint nRet=0;\n\n\tm_critSection.Lock();\n\n\tCProxyConnection* pProxyConnection=(CProxyConnection*)FindProxy(pProxyInfo);\n\n\tif (pProxyConnection)\n\t\tnRet=pProxyConnection->EstablishNewDataChannel(IDOfPartner);\n\n\tm_critSection.Unlock();\n\n\treturn nRet;\n}\n\n//find a proxy in the list by CDllProxyInfo\nconst CProxyConnection* CProxiesManager::FindProxy(CDllProxyInfo* pProxyInfo)\n{\n\tfor(std::list<CProxyConnection*>::iterator it=m_listProxies.begin(); it!=m_listProxies.end(); it++)\n\t\tif (((CProxyConnection*)*it)->GetProxyInfo()==pProxyInfo)\n\t\t\treturn (CProxyConnection*)*it;\n\n\treturn 0;\n}\n\n//try to connect a socket using the proxy settings\nbool CProxiesManager::ConnectViaProxy(APISocket::CSocket* pSock, const char* szIp, unsigned int nPort)\n{\n\tif (m_bLocalProxy)\n\t\treturn m_proxyConnect.ConnectViaProxy(*pSock, szIp, nPort, (char*)m_pLocalProxy->GetIP(),\n\t\t\tatoi(m_pLocalProxy->GetPort()), (char*)m_pLocalProxy->GetName(), (char*)m_pLocalProxy->GetPassword())>0;\n\n\tstd::string strProxyIP;\n\tunsigned int nProxyPort;\n\n\tif (GetIEProxySettings(strProxyIP, nProxyPort))\n\t\treturn m_proxyConnect.ConnectViaProxy(*pSock, szIp, nPort, (char*)strProxyIP.c_str(),\n\t\t\tnProxyPort, \"\", \"\")>0;\n\n\treturn false;\n}\n\n//read the Internet Explorer settings about proxy\nint CProxiesManager::GetIEProxySettings(std::string& strProxyIP, unsigned int& nProxyPort)\n{\n\t#warning Must Implement GetIEProxySettings\n\treturn 0;\n}\n\n#define WM_PROXY_ERROR\t\t(WM_USER+50)\n\nvoid CProxiesManager::ProxyError(CDllProxyInfo* pProxyInfo)\n{\n\tm_critSection.Lock();\n\n\tproxyError = pProxyInfo;\n\n\tm_critSection.Unlock();\n}\n\nunsigned long __stdcall CProxiesManager::ReconectProxiesThreadProc(LPVOID lpParameter)\n{\n\tCProxiesManager* pThis = (CProxiesManager*)lpParameter;\n\n\twhile (!pThis->shouldQuit)\n\t{\n\t\tif (pThis->proxyError)\n\t\t{\n\t\t\tpThis->DisconnectProxy(pThis->proxyError);\n\t\t\tpThis->proxyError = NULL;\n\t\t\tSleep(1000000);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tbool sleep15 = false;\n\t\t\tpThis->m_critSection.Lock();\n\t\t\tif (!pThis->m_listProxies.empty())\n\t\t\t{\n\t\t\t\tsleep15 = true;\n\t\t\t\tfor (std::list<CProxyConnection*>::iterator itProxy = pThis->m_listProxies.begin(); itProxy != pThis->m_listProxies.end(); itProxy++)\n\t\t\t\t{\n\t\t\t\t\tCProxyConnection* pProxyConn = (CProxyConnection*)*itProxy;\n\t\t\t\t\tCDllProxyInfo* pProxyInfo = pProxyConn->GetProxyInfo();\n\t\t\t\t\tint dwStatus = pProxyInfo->GetStatus();\n\t\t\t\t\tbool bReconnect = pProxyInfo->GetReconnectProxy();\n\n\t\t\t\t\tif ((dwStatus & STATUS_DISCONNECTED_FROM_PROXY || (dwStatus == 0)) && bReconnect)\n\t\t\t\t\t{\n\t\t\t\t\t\tg_globals.m_logger.Write(\"=>Try reconnect proxy\");\n\n\t\t\t\t\t\tpProxyConn->Connect();\n\n\t\t\t\t\t\tg_globals.m_logger.Write(\"<=Reconnect proxy\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tpThis->m_critSection.Unlock();\n\t\t\tif (sleep15)\n\t\t\t\tSleep(15000000);\n\t\t\telse\n\t\t\t\tSleep(1000000);\n\t\t}\n\t}\n\n\tpThis->hasQuit = 1;\n\treturn 0;\n}"
  },
  {
    "path": "Bundles/Echoware/ProxiesManager.h",
    "content": "#ifndef _PROXIESMANAGER_H\n#define _PROXIESMANAGER_H\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n#include \"ProxyConnection.h\"\n#include <list>\n#include \"CritSection.h\"\n#include \"ProxyConnect/ProxyConnect.h\"\n\n//a proxies manager class\nclass CProxiesManager\n{\npublic:\n\tCProxiesManager(void);\n\t~CProxiesManager(void);\n\n\t//add a proxy to the proxies list\n\tvoid AddProxy(CDllProxyInfo* pProxyInfo);\n\t//remove a proxy from the proxies list\n\tvoid RemoveProxy(CDllProxyInfo* pProxyInfo);\n\t//remove all the proxies from the proxies list\n\tvoid RemoveAllProxies();\n\n\t//connect a proxy\n\tint ConnectProxy(CDllProxyInfo* pProxyInfo);\n\t//disconnect a proxy\n\tbool DisconnectProxy(CDllProxyInfo* pProxyInfo);\n\t//disconnect all the proxies\n\tbool DisconnectAllProxies();\n\t//stops connecting proxy\n\tvoid StopConnecting(CDllProxyInfo* pProxyInfo);\n\n\t//set a proxy encryption level\n\tvoid SetEncryptionLevel(int level, CDllProxyInfo* pProxyInfo);\n\n\t//set info for the local proxy\n\tvoid SetLocalProxyInfo(char* ip, char* port, char* username, char* password);\n\n\t//try to connect all proxies\n\tvoid AutoConnect();\n\n\t//try to Estabilish new data channel\n\tint EstablishNewDataChannel(CDllProxyInfo* pProxyInfo , char* IDOfPartner);\n\n\t//try to connect a socket using the proxy settings\n\tbool ConnectViaProxy(APISocket::CSocket* pSock, const char* szIp, unsigned int nPort);\n\n\tvoid ProxyError(CDllProxyInfo* pProxyInfo);\n\nprotected:\n\t//read the Internet Explorer settings about proxy\n\tint GetIEProxySettings(std::string& strProxyIP, unsigned int& nProxyPort);\n\nprotected:\n\t//find a proxy in the list by CDllProxyInfo\n\tconst CProxyConnection* FindProxy(CDllProxyInfo* pProxyInfo);\n\n\tstatic unsigned long __stdcall ReconectProxiesThreadProc(LPVOID lpParameter);\n\tvoid* m_hReconectProxiesThread;\n\tunsigned long m_dwReconectProxiesThread;\n\nprotected:\n\tstd::list<CProxyConnection*> m_listProxies;\n\n\tCDllProxyInfo* m_pLocalProxy;\n\tbool m_bLocalProxy;\n\n\tCCritSection m_critSection;\n\n\tCProxyConnect m_proxyConnect;\n\n\tbool shouldQuit;\n\tbool hasQuit;\n\tCDllProxyInfo *proxyError;\n};\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/ProxyConnect/ProxyConnect.cpp",
    "content": "#include \"stdafx.h\"\n#include <string>\n#include \"proxyconnect.h\"\n\n#include \"ntlm.h\"\n\n#include <sys/types.h>\n#include <sys/socket.h>\n#include <netinet/in.h>\n#include <arpa/inet.h>\n\n#include \"EchoToOSX.h\"\n\nint CProxyConnect::m_nConnectTimeout_secs = 5;\nint CProxyConnect::m_nReceiveTimeout_secs = 5;\nint CProxyConnect::m_nSendTimeout_secs =    5;\n\n\n/*int TCPConnectWithTimeout(int sock, const struct sockaddr FAR *name, int namelen, int timeout_secs);\nint SockReadyToRead(int socket, int timeout_secs);\nint SockReadyToWrite(int socket, int timeout_secs);\nint read_byte(int fd);\n*/\n\nextern void base64(unsigned char *out, const unsigned char *in, int len);\n\nint read_byte(APISocket::CSocket sock)\n{\n\tunsigned char c;\n\tint nLen=1;\n\tif(sock.Receive((char*)&c, nLen) == 0 && nLen==1)\n\t{\n\t\treturn c;\n\t}\n\treturn -1;\n}\n\n#if 0\nchar * base64Encode(char *str)\n{\n    static char *encoding = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\t\t\t    \"abcdefghijklmnopqrstuvwxyz\"\n\t\t\t    \"0123456789+/\";\n    char *s = NULL;\n    char *outBuf = NULL;\n    int len = -1;\n    int i = 0;\n    unsigned long bits;\n\n    if (str == NULL)\n    {\n\t\treturn NULL;\n    }\n\n    len = strlen(str);\n\n    /*\n    ** Base64 encoding expands 6 bits to 1 char, padded with '=', if\n    ** necessary.\n    */\n\n\tint totalLen = 4 * ((len + 2) / 3) + 1;\n    if ((outBuf = (char*)malloc(totalLen)) == NULL)\n    {\n\t\treturn NULL;\n    }\n\n\tmemset(outBuf, 0, totalLen);\n    s = outBuf;\n    for (i = 0; i <= len - 3; i += 3)\n    {\n\t\tbits = ((unsigned long)(str[i])) << 24;\n\t\tbits |= ((unsigned long)(str[i + 1])) << 16;\n\t\tbits |= ((unsigned long)(str[i + 2])) << 8;\n\n\t\t*s++ = encoding[bits >> 26];\n\t\tbits <<= 6;\n\t\t*s++ = encoding[bits >> 26];\n\t\tbits <<= 6;\n\t\t*s++ = encoding[bits >> 26];\n\t\tbits <<= 6;\n\t\t*s++ = encoding[bits >> 26];\n    }\n\n    switch (len % 3)\n    {\n\t\tcase 0:\n\t\t\tbits = ((unsigned long)(str[i])) << 24;\n\t\t\tbits |= ((unsigned long)(str[i + 1])) << 16;\n\t\t\tbits |= ((unsigned long)(str[i + 2])) << 8;\n\t\t\t*s++ = encoding[bits >> 26];\n\t\t\tbits <<= 6;\n\t\t\t*s++ = encoding[bits >> 26];\n\t\t\tbits <<= 6;\n\t\t\t*s++ = encoding[bits >> 26];\n\t\t\tbits <<= 6;\n\t\t\t*s++ = encoding[bits >> 26];\n\t\t\tbreak;\n\n\t\tcase 2:\n\t\t\tbits = ((unsigned long)(str[len - 2])) << 24;\n\t\t\tbits |= ((unsigned long)(str[len - 1])) << 16;\n\t\t\t*s++ = encoding[bits >> 26];\n\t\t\tbits <<= 6;\n\t\t\t*s++ = encoding[bits >> 26];\n\t\t\tbits <<= 6;\n\t\t\t*s++ = encoding[bits >> 26];\n\t\t\t*s++ = '=';\n\t\t\tbreak;\n\n\t\tcase 1:\n\t\t\tbits = ((unsigned long)(str[len - 2])) << 24;\n\t\t\t*s++ = encoding[bits >> 26];\n\t\t\tbits <<= 6;\n\t\t\t*s++ = encoding[bits >> 26];\n\t\t\t*s++ = '=';\n\t\t\t*s++ = '=';\n\t\t\tbreak;\n    }\n\n    *s = '\\0';\n    return outBuf;\n}\n\n#endif\n\n/*\nint SockReadyToRead(int socket, int timeout_secs)\n{\n\tstruct timeval\ttimeout;\n\tfd_set\t\t\treadfds;\n\ttimeout.tv_sec  = timeout_secs;\n    timeout.tv_usec = 0;\n\n\tFD_ZERO(&readfds);\n\tFD_SET(socket, &readfds);\n\tselect(1, &readfds, NULL, NULL, &timeout);\n\treturn FD_ISSET(socket, &readfds);\n}\n\n\nint SockReadyToWrite(int socket, int timeout_secs)\n{\n\tstruct timeval\ttimeout;\n\tfd_set\t\t\twritefds;\n\ttimeout.tv_sec  = timeout_secs;\n    timeout.tv_usec = 0;\n\n\tFD_ZERO(&writefds);\n\tFD_SET(socket, &writefds);\n\tselect(1, NULL, &writefds, NULL, &timeout);\n\treturn FD_ISSET(socket, &writefds);\n}\n\nint TCPConnectWithTimeout(int sock, const struct sockaddr FAR *name, int namelen, int timeout_secs)\n{\n\tint retval = SOCK_OK;\n    unsigned long blockArg;\n\n    blockArg = 1;\n    if (ioctlsocket(sock, FIONBIO, &blockArg)==0)\n\t{\n\t\tconnect(sock, name, namelen);\n\t\tif (!SockReadyToWrite(sock, timeout_secs))\n\t\t{\n\t\t\tWSASetLastError(WSAETIMEDOUT);\n\t\t\tretval = SOCK_CONNECT_TIMEOUT;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tblockArg = 0;\n\t\t\tioctlsocket(sock, FIONBIO, &blockArg);\n\t\t\tretval = SOCK_OK;\n\t\t}\n\t}\n\telse\n\t{\n\t\tretval = SOCK_ERROR;\n\t}\n\treturn retval;\n}\n\n*/\n\n\nint CProxyConnect::ConnectViaSocks5Proxy(APISocket::CSocket sock, const char* destIp, unsigned int destPort, char* proxyIp,\n\t\t\tunsigned int proxyPort, char* username, char* password)\n{\n\n\tint ret=sock.Connect(proxyIp, proxyPort);\n\n\tif (ret!=0)\n\t\treturn LOCAL_PROXY_CONNECT_FAIL;\n\n\n\tint i;\n\tchar buf[512];\n\tunsigned char len;\n\tunsigned char atyp;\n\n\tbuf[0] = 0x05;\n\tbuf[1] = 0x01;\n\tif(username && password)\n\t\tbuf[2] = 0x02;\n\telse\n\t\tbuf[2] = 0x00;\n\n\tint nLen=3;\n\tsock.Send(buf, nLen);\n\n\tif(read_byte(sock) != 0x05 || read_byte(sock) != buf[2])\n\t{\n\t\tsock.Close();\n\t\treturn LOCAL_PROXY_RESP_FAIL;\n\t}\n\n\tif(username && password)\n\t{\n\t\tunsigned char tmplen;\n\n\t\tmemset(buf, 0, 512);\n\n\t\tbuf[0] = 0x01;\n\t\tlen = (unsigned char)((strlen(username) > 255) ? 255 : strlen(username));\n\t\tbuf[1] = len;\n\t\tmemcpy(buf + 2, username, len);\n\n\t\ttmplen = (unsigned char)((strlen(password) > 255) ? 255 : strlen(password));\n\t\tbuf[2 + len] = tmplen;\n\t\tmemcpy(buf + 3 + len, password, tmplen);\n\n\t\tint nLen=(3 + len + tmplen);\n\t\tsock.Send( buf, nLen);\n\n\t\tif(read_byte(sock) != 0x01 || read_byte(sock) != 0x00)\n\t\t{\n\t\t\tsock.Close();\n\t\t\treturn LOCAL_PROXY_AUTH_FAIL;\n\t\t}\n\t}\n\n\tbuf[0] = SOCKS_V5;\n\tbuf[1] = SOCKS_CONNECT;\n\tbuf[2] = 0x00;\n\tbuf[3] = 0x01; // ipv4 format\n\n\tstruct sockaddr_in tempAddr;\n\ttempAddr.sin_addr.s_addr = inet_addr(destIp);\n\n\tchar ipstr[4];\n\tmemcpy(ipstr, &tempAddr.sin_addr.s_addr, 4);\n\n\tmemcpy(buf+4, ipstr, 4);\n\n\tunsigned short port = htons(destPort);\n\tmemcpy(buf+8, (char*)&port, 2);\n\n\tnLen=10;\n\tsock.Send(buf, nLen);\n\n\tif(read_byte(sock) != 0x05 || read_byte(sock) != 0x00)\n\t{\n\t\tsock.Close();\n\t\treturn LOCAL_PROXY_RESP_FAIL;\n\t}\n\n\tread_byte(sock);\n\tatyp = read_byte(sock);\n\tif(atyp == 0x01)\n\t{\n\t\tfor(i = 0; i < 4; i++)\n\t\t\tread_byte(sock);\n\t}\n\telse if(atyp == 0x03)\n\t{\n\t\tlen = read_byte(sock);\n\t\tfor(i = 0; i < len; i++)\n\t\t\tread_byte(sock);\n\t}\n\telse\n\t{\n\t\tsock.Close();\n\t\treturn LOCAL_PROXY_RESP_FAIL;\n\t}\n\n\tfor(i = 0; i < 2; i++)\n\t\tread_byte(sock);\n\n\treturn 1;\n}\n\n\n\nint CProxyConnect::ConnectViaSocks4Proxy(APISocket::CSocket sock, const char* destIp, unsigned int destPort, char* proxyIp,\n\t\t\tunsigned int proxyPort, char* username, char* password)\n{\n\tif (sock.Connect(proxyIp, proxyPort)!=0)\n\t\treturn LOCAL_PROXY_CONNECT_FAIL;\n\n\tint len=9;\n\n\tchar buf[512];\n\n\tmemset(buf, 0, 512);\n\n\tbuf[0] = SOCKS_V4;\n\tbuf[1] = SOCKS_CONNECT;\n\n\tunsigned short port = htons(destPort);\n\tmemcpy(buf+2, (char*)&port, 2);\n\n\tstruct sockaddr_in tempAddr;\n\ttempAddr.sin_addr.s_addr = inet_addr(destIp);\n\tchar ipstr[4];\n\tmemcpy(ipstr, &tempAddr.sin_addr.s_addr, 4);\n\tmemcpy(buf+4, ipstr, 4);\n\n\tif (username)\n\t{\n    \tmemcpy(buf+8,username,strlen(username));\n\t\tlen = 9 + (int)strlen(username);\n\t}\n\telse\n\t{\n\t\tbuf[8] = 0;\t/* empty username */\n\t\tlen = 9;\n\t}\n\n\tint n=len;\n\tsock.Send(buf, n);\n\n\tunsigned char vn_byte = read_byte(sock);\n\n\tif (vn_byte != 0x00)\n\t{\n\t\tsock.Close();\n\t\treturn LOCAL_PROXY_RESP_FAIL;\n\t}\n\n\tunsigned char cd_byte = read_byte(sock);\n\tif(cd_byte != 90)\n\t{\n\t\tsock.Close();\n\t\treturn LOCAL_PROXY_AUTH_FAIL;\n\t}\n\n\treturn 1;\n}\n\n\n#define MAXLEN 512\n\nint CProxyConnect::ConnectViaHttpProxy(APISocket::CSocket sock, const char* destIp, unsigned int destPort,  char* proxyIp,\n\t\t\tunsigned int proxyPort, char* username, char* password)\n{\n\t//char logstr[512];\n\tchar buf[MAX_LINE_SIZE];\n\tchar proxyAuth[MAX_LINE_SIZE];\n\tchar*bufPtr=NULL;\n\tint numRead, numWrite;//, retval;\n\tstd::string ans;\n\tchar authstring[MAX_LINE_SIZE];\n\tchar* pAuthstring=NULL;\n\n\tmemset(buf, 0 , sizeof(buf));\n\n\tif (sock.Connect(proxyIp, proxyPort)!=0)\n\t{\n\t\treturn LOCAL_PROXY_CONNECT_FAIL;\n\t}\n\n\tif (m_temphttpProxyAuthType==HTTP_AUTH_NTLM)\n\t{\n\t\tunsigned char host[MAX_NAME_LEN];\n\t\tunsigned char domain[MAX_NAME_LEN];\n\t\tunsigned char user[MAX_NAME_LEN];\n\t\tchar tempusername[MAXLEN];\n\n\t\t//\n\t\t// Username = \"domain\\user\" in this case\n\t\t//\n\t\tstrcpy((char*)tempusername, (char*)username);\n\n\t\tif (strstr(tempusername, \"\\\\\") !=NULL)\n\t\t{\n\t\t\tchar * pch;\n\t\t\tpch = strtok (tempusername,\"\\\\\");\n\t\t\tstrcpy((char*)domain, pch);\n\n\t\t\tpch  = strtok(0, \"\\\\\");\n\t\t\tstrcpy((char*)user, pch);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tstrcpy((char*)domain, \"\");\n\t\t\tstrcpy((char*)user, tempusername);\n\t\t}\n\n//\t\tchar pcName[HOST_NAME_MAX+1];\n//\t\tDWORD\tnSize = 256;\n//\t\tGetComputerName(pcName, &nSize);\n//\t\tstrcpy((char*)host, pcName);\n\t\tgethostname((char *)host, MAX_NAME_LEN);\n\n\t\tint retnum= DoNTLMv2\n\t\t\t\t\t(\n\t\t\t\t\t\tsock.getSocket(),\n\t\t\t\t\t\tdestIp,\n\t\t\t\t\t\tdestPort,\n\t\t\t\t\t\t(unsigned char*)host,\n\t\t\t\t\t\t(unsigned char*)domain,\n\t\t\t\t\t\t(unsigned char*)user,\n\t\t\t\t\t\t(unsigned char*)password\n\t\t\t\t\t);\n\t\tif (retnum <0)\n\t\t{\n\t\t\tsock.Close();\n\t\t\treturn retnum;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn retnum;\n\t\t}\n\t}\n\n\tif (m_temphttpProxyAuthType==HTTP_AUTH_BASIC)\n\t{\n\t\t//\n\t\t// Construct a CONNECT string\n\t\t//\n\t\tif (username && password)\n\t\t{\n\t\t\tsprintf(proxyAuth, \"%s:%s\", username, password);\n\n\t\t\tmemset(authstring, 0, MAX_LINE_SIZE);\n\n\t\t\tbase64((unsigned char*)authstring, (unsigned char*)proxyAuth, strlen(proxyAuth));\n\t\t\tsprintf(buf, \"CONNECT %s:%hu HTTP/1.0\\r\\nProxy-Authorization: Basic %s\\r\\nUser-Agent: echoWare\\r\\n\\r\\n\", destIp, destPort, authstring);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsprintf(buf, \"CONNECT %s:%hu HTTP/1.0\\r\\nUser-Agent: echoWare\\r\\n\\r\\n\", destIp, destPort);\n\t\t}\n\n\t\t//\n\t\t// Send to the Proxy\n\t\t//\n\t\tint len=strlen(buf);\n\n\t\tnumWrite = len;\n\n\t\tif (sock.Send(buf, numWrite)!=0)\n\t\t{\n\t\t\tgoto CloseError;\n\t\t}\n\n\t\t//\n\t\t// Receive response from Proxy\n\t\t//\n\t\tmemset(buf, 0 , sizeof(buf));\n\t\tbufPtr = buf;\n\n\t\tnumRead=MAX_LINE_SIZE;\n\t\tif (sock.Receive(bufPtr, numRead)!=0 || numRead==0)\n\t\t{\n\t\t\tsock.Close();\n\t\t\treturn LOCAL_PROXY_RESP_FAIL;\n\t\t}\n\n\t\t//\n\t\t// Check for an OK response\n\t\t//\n\t\tif (strncmp(buf, \"HTTP/1.0 200\", 12)==0 || strncmp(buf, \"HTTP/1.1 200\", 12)==0)\n\t\t{\n\t\t\treturn 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsock.Close();\n\t\t\treturn LOCAL_PROXY_AUTH_FAIL;\n\t\t}\n\t}\n\n\tCloseError:\n\t\tsock.Close();\n\treturn -1;\n}\n\n\n\n//\n// Return -1=error, 0=non-proxy, 1=sock4, 2=sock5, 3=http/https\n//\nint CProxyConnect::TestSocks4Proxy(APISocket::CSocket sock, const char* destIp, unsigned int destPort,  char* proxyIp,\n\t\t\tunsigned int proxyPort, char* username,  char* password)\n{\n\tsock.SetTimeouts(m_nConnectTimeout_secs*1000, m_nSendTimeout_secs*1000, m_nReceiveTimeout_secs*1000, sock.GetAcceptTimeout());\n\tif (sock.Connect(proxyIp, proxyPort)!=0)\n\t\treturn LOCAL_PROXY_CONNECT_FAIL;\n\n\n\n\tchar buf[512];\n\tbuf[0] = SOCKS_V4;\n\tbuf[1] = SOCKS_CONNECT;\n\n\tunsigned short port = htons(destPort);\n\tmemcpy(buf+2, (char*)&port, 2);\n\n\tstruct sockaddr_in tempAddr;\n\ttempAddr.sin_addr.s_addr = inet_addr(destIp);\n\tchar ipstr[4];\n\tmemcpy(ipstr, &tempAddr.sin_addr.s_addr, 4);\n\tmemcpy(buf+4, ipstr, 4);\n\n\tbuf[8] = 0;\t/* empty username */\n\tint len=9;\n\n\tif (sock.Send(buf, len) !=0)\n\t{\n\t\tsock.Close();\n\t\treturn NONE_TYPE;\n\t}\n\n\tunsigned char vn_byte = read_byte(sock);\n\n\tif (vn_byte != 0x00)\n\t{\n\t\tsock.Close();\n\t}\n\telse\n\t{\n\t\tunsigned char cd_byte = read_byte(sock);\n\n\t\tif(cd_byte == 90 || cd_byte == 91 || cd_byte == 92 || cd_byte == 93)\n\t\t{\n\t\t\tsock.Close();\n\t\t\treturn PROXY_TYPE_SOCKS4;\n\t\t}\n\t}\n\n\treturn NONE_TYPE;\n}\n\n\n\nint CProxyConnect::TestSocks5Proxy(APISocket::CSocket sock, const char* destIp, unsigned int destPort,  char* proxyIp,\n\t\t\tunsigned int proxyPort, char* username,  char* password)\n{\n\tchar buf[512];\n\n\tsock.SetTimeouts(m_nConnectTimeout_secs*1000, m_nSendTimeout_secs*1000, m_nReceiveTimeout_secs*1000, sock.GetAcceptTimeout());\n\tif (sock.Connect(proxyIp, proxyPort)!=0)\n\t{\n\t\treturn LOCAL_PROXY_CONNECT_FAIL;\n\t}\n\n\tbuf[0] = 0x05;\n\tbuf[1] = 0x01;\n\tif(username && password)\n\t\tbuf[2] = 0x02;\n\telse\n\t\tbuf[2] = 0x00;\n\n\tint len=3;\n\tif (sock.Send(buf, len) !=0)\n\t{\n\t\tsock.Close();\n\t\treturn NONE_TYPE;\n\t}\n\n\tint ver = read_byte(sock);\n\tint method = read_byte(sock);\n\n\tif ((ver == 0x05 && method == buf[2]) ||\n\t    (ver == 0x05 && method == 0x00))\n\n\t{\n\t\tsock.Close();\n\t\treturn PROXY_TYPE_SOCKS5;\n\t}\n\telse\n\t{\n\n\t\tsock.Close();\n\t}\n\n\treturn NONE_TYPE;\n}\n\n\n#include \"../globals.h\"\n\nint CProxyConnect::TestHttpProxy(APISocket::CSocket sock, const char* destIp, unsigned int destPort,  char* proxyIp,\n\t\t\tunsigned int proxyPort, char* username,  char* password)\n{\n\tchar buf[512];\n\tchar authstring[MAX_LINE_SIZE];\n\n\tsock.SetTimeouts(m_nConnectTimeout_secs*1000, m_nSendTimeout_secs*1000, m_nReceiveTimeout_secs*1000, sock.GetAcceptTimeout());\n\tif (sock.Connect(proxyIp, proxyPort)!=0)\n\t{\n\t\treturn LOCAL_PROXY_CONNECT_FAIL;\n\t}\n\n\tchar logstr[512];\n\tchar proxyAuth[MAX_LINE_SIZE];\n\tchar*bufPtr=NULL;\n\tint numRead, numWrite;\n\tstd::string ans;\n\tmemset(buf, 0 , sizeof(buf));\n\n\t//\n\t// Construct a CONNECT string\n\t//\n    if (username && password)\n    {\n\t\tsprintf(proxyAuth, \"%s:%s\", username, password);\n\n\t\tmemset(authstring, 0, MAX_LINE_SIZE);\n\n\t\tbase64((unsigned char*)authstring, (unsigned char*)proxyAuth, strlen(proxyAuth));\n\t\tsprintf(buf, \"CONNECT %s:%hu HTTP/1.0\\r\\nProxy-Authorization: Basic %s\\r\\nUser-Agent: echoWare\\r\\n\\r\\n\", destIp, destPort, authstring);\n    }\n    else\n    {\n\t\tsprintf(buf, \"CONNECT %s:%hu HTTP/1.0\\r\\nUser-Agent: echoWare\\r\\n\\r\\n\", destIp, destPort);\n    }\n\n\tnumWrite=strlen(buf);\n\tif (sock.Send(buf, numWrite)!=0)\n    {\n\t\tsock.Close();\n\t\treturn NONE_TYPE;\n    }\n\n\tsprintf(logstr, \"Sent to the server buf=%s\", buf);\n\n\n\t//\n\t// Receive response from Proxy\n\t//\n\tmemset(buf, 0 , sizeof(buf));\n\tbufPtr = buf;\n\n\tnumRead=MAX_LINE_SIZE;\n\n\tif (sock.Receive(bufPtr, numRead)!=0)\n\t{\n\n\t\tsock.Close();\n\t}\n\telse\n\t{\n\n\t\tif (strncmp(buf, \"HTTP/1.0 200\", 12)==0 || strncmp(buf, \"HTTP/1.1 200\", 12)==0)\n\t\t{\n\n\t\t\tsock.Close();\n\t\t\treturn PROXY_TYPE_HTTP;\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\tsock.Close();\n\t\t}\n\t}\n\n\treturn NONE_TYPE;\n}\n\n\n\nint CProxyConnect::DetectProxyType(APISocket::CSocket sock, const char* destIp, unsigned int destPort,  char* proxyIp,\n\t\t\tunsigned int proxyPort, char* username,  char* password)\n{\n\tint ret, ret1, ret2, ret3;\n\n\n\n\tret = NONE_TYPE;\n\tm_proxyType = NONE_TYPE;\n\n\tif (strcmp(proxyIp, \"\")==0)\n\t{\n\t\tgoto Done;\n\t}\n\n\tif (strcmp(username, \"\")!=0)\n\t\tret1 = TestSocks5Proxy(sock, destIp, destPort, proxyIp, proxyPort, username, password);\n\telse\n\t\tret1 = TestSocks5Proxy(sock, destIp, destPort, proxyIp, proxyPort, NULL, NULL);\n\n\tif (ret1 == PROXY_TYPE_SOCKS5)\n\t{\n\n\t\tm_proxyType = PROXY_TYPE_SOCKS5;\n\t\tret = ret1;\n\t\tgoto Done;\n\t}\n\telse if (ret1 == LOCAL_PROXY_CONNECT_FAIL)\n\t{\n\t\tret =  LOCAL_PROXY_CONNECT_FAIL;\n\t\tgoto Done;\n\t}\n\n\tif (strcmp(username, \"\")!=0)\n\t\tret2 = TestSocks4Proxy(sock, destIp, destPort, proxyIp, proxyPort, username, password);\n\telse\n\t\tret2 = TestSocks4Proxy(sock, destIp, destPort, proxyIp, proxyPort, NULL, NULL);\n\n\tif (ret2 == PROXY_TYPE_SOCKS4)\n\t{\n\n\t\tm_proxyType = PROXY_TYPE_SOCKS4;\n\t\tret = ret2;\n\t\tgoto Done;\n\t}\n\telse if (ret2 == LOCAL_PROXY_CONNECT_FAIL)\n\t{\n\n\t\tret =  LOCAL_PROXY_CONNECT_FAIL;\n\t\tgoto Done;\n\t}\n\n\tret3 = AnalyzeHttpProxy(sock, destIp, destPort, proxyIp, proxyPort, username, password);\n\n\tif (ret3 == LOCAL_PROXY_CONNECT_FAIL)\n\t{\n\n\t\tret =  LOCAL_PROXY_CONNECT_FAIL;\n\t\tgoto Done;\n\t}\n\telse if (ret3 >0)\n\t{\n\n\t\tm_httpProxyAuthType = ret3;\n\t\tm_proxyType = PROXY_TYPE_HTTP;\n\t\tret = PROXY_TYPE_HTTP;\n\t}\n\telse\n\t{\n\n\t}\n\nDone:\n\n\treturn ret;\n}\n\n\nint CProxyConnect::ConnectViaProxy(APISocket::CSocket sock, const char* destIp, unsigned int destPort, char* proxyIp,\n\t\t\tunsigned int proxyPort, char* username, char* password)\n{\n\ttry\n\t{\n\t\tif (m_bIsAutoDetectDone==false)\n\t\t{\n\t\t\tDetectProxyType\n\t\t\t(\n\t\t\t\tsock,\n\t\t\t\tdestIp,\n\t\t\t\tdestPort,\n\t\t\t\tproxyIp,\n\t\t\t\tproxyPort,\n\t\t\t\tusername,\n\t\t\t\tpassword\n\t\t\t);\n\n\t\t\tif (m_proxyType != NONE_TYPE)\n\t\t\t\tm_bIsAutoDetectDone = true;\n\t\t}\n\n\t\tif (m_proxyType==PROXY_TYPE_SOCKS4)\n\t\t{\n\t\t\tif (strcmp(username, \"\")!=0)\n\t\t\t\treturn ConnectViaSocks4Proxy\n\t\t\t\t\t(\n\t\t\t\t\t\tsock,\n\t\t\t\t\t\tdestIp,\n\t\t\t\t\t\tdestPort,\n\t\t\t\t\t\tproxyIp,\n\t\t\t\t\t\tproxyPort,\n\t\t\t\t\t\tusername,\n\t\t\t\t\t\tpassword\n\t\t\t\t\t);\n\t\t\telse\n\t\t\t\treturn ConnectViaSocks4Proxy\n\t\t\t\t\t(\n\t\t\t\t\t\tsock,\n\t\t\t\t\t\tdestIp,\n\t\t\t\t\t\tdestPort,\n\t\t\t\t\t\tproxyIp,\n\t\t\t\t\t\tproxyPort,\n\t\t\t\t\t\tNULL,\n\t\t\t\t\t\tNULL\n\t\t\t\t\t);\n\n\t\t}\n\t\telse if (m_proxyType==PROXY_TYPE_SOCKS5)\n\t\t{\n\t\t\tif (strcmp(username, \"\")!=0)\n\t\t\t\treturn ConnectViaSocks5Proxy\n\t\t\t\t\t(\n\t\t\t\t\t\tsock,\n\t\t\t\t\t\tdestIp,\n\t\t\t\t\t\tdestPort,\n\t\t\t\t\t\tproxyIp,\n\t\t\t\t\t\tproxyPort,\n\t\t\t\t\t\tusername,\n\t\t\t\t\t\tpassword\n\t\t\t\t\t);\n\t\t\telse\n\t\t\t\treturn ConnectViaSocks5Proxy\n\t\t\t\t\t(\n\t\t\t\t\t\tsock,\n\t\t\t\t\t\tdestIp,\n\t\t\t\t\t\tdestPort,\n\t\t\t\t\t\tproxyIp,\n\t\t\t\t\t\tproxyPort,\n\t\t\t\t\t\tNULL,\n\t\t\t\t\t\tNULL\n\t\t\t\t\t);\n\t\t}\n\t\telse if (m_proxyType==PROXY_TYPE_HTTP)\n\t\t{\n\t\t\tif (m_httpProxyAuthType==HTTP_AUTH_BASIC)\n\t\t\t\tm_temphttpProxyAuthType = HTTP_AUTH_BASIC;\n\t\t\telse if (m_httpProxyAuthType==HTTP_AUTH_NTLM)\n\t\t\t\tm_temphttpProxyAuthType = HTTP_AUTH_NTLM;\n\t\t\telse if (m_httpProxyAuthType==HTTP_AUTH_BASIC_NTLM)\n\t\t\t\tm_temphttpProxyAuthType = HTTP_AUTH_BASIC;\n\t\t\telse if (m_httpProxyAuthType==HTTP_AUTH_NTLM_BASIC)\n\t\t\t\tm_temphttpProxyAuthType = HTTP_AUTH_NTLM;\n\t\t\telse\n\t\t\t\tm_temphttpProxyAuthType = HTTP_AUTH_BASIC;\n\nTryAgain:\n\t\t\tint retnum=-1;\n\t\t\tif (strcmp(username, \"\")!=0)\n\t\t\t\tretnum = ConnectViaHttpProxy\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\tsock,\n\t\t\t\t\t\t\t\tdestIp,\n\t\t\t\t\t\t\t\tdestPort,\n\t\t\t\t\t\t\t\tproxyIp,\n\t\t\t\t\t\t\t\tproxyPort,\n\t\t\t\t\t\t\t\tusername,\n\t\t\t\t\t\t\t\tpassword\n\t\t\t\t\t\t\t);\n\t\t\telse\n\t\t\t\tretnum = ConnectViaHttpProxy\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\tsock,\n\t\t\t\t\t\t\t\tdestIp,\n\t\t\t\t\t\t\t\tdestPort,\n\t\t\t\t\t\t\t\tproxyIp,\n\t\t\t\t\t\t\t\tproxyPort,\n\t\t\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t\t\tNULL\n\t\t\t\t\t\t\t);\n\n\t\t\tif (retnum <=0)\n\t\t\t{\n\t\t\t\tif (m_httpProxyAuthType==HTTP_AUTH_BASIC_NTLM &&\n\t\t\t\t\tm_temphttpProxyAuthType==HTTP_AUTH_BASIC)\n\t\t\t\t{\n\t\t\t\t\tm_temphttpProxyAuthType=HTTP_AUTH_NTLM;\n\n\t\t\t\t\tgoto TryAgain;\n\t\t\t\t}\n\t\t\t\telse if (m_httpProxyAuthType==HTTP_AUTH_NTLM_BASIC &&\n\t\t\t\t\tm_temphttpProxyAuthType==HTTP_AUTH_NTLM)\n\t\t\t\t{\n\t\t\t\t\tm_temphttpProxyAuthType=HTTP_AUTH_BASIC;\n\n\t\t\t\t\tgoto TryAgain;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn retnum;\n\t\t}\n\t}\n\tcatch(...)\n\t{}\n\n\treturn -1;\n}\n\n\n\nCProxyConnect::CProxyConnect()\n{\n\tm_bIsAutoDetectDone = false;\n\tm_httpProxyAuthType = -1;\n\tm_temphttpProxyAuthType = -1;\n}\n\n\nCProxyConnect::~CProxyConnect()\n{\n\n}\n\n\n\n\nint CProxyConnect::AnalyzeHttpProxy(APISocket::CSocket sock, const char* destIp, unsigned int destPort, char* proxyIp,\n\t\t\tunsigned int proxyPort, char* username, char* password)\n{\n\tchar buf[MAX_BUFFER_SIZE];\n\t/*int fd;\n\tstruct sockaddr_in destAddr;\n\n\tfd = socket(AF_INET, SOCK_STREAM, 0);\n\tif(fd == -1)\n\t\treturn -1;\n\n\tmemset(&destAddr, 0, sizeof(destAddr));\n    destAddr.sin_family = AF_INET;\n    destAddr.sin_addr.s_addr = inet_addr(proxyIp);\n\tdestAddr.sin_port = htons(proxyPort);\n\n\tif (TCPConnectWithTimeout(fd, (struct sockaddr*)&destAddr,sizeof(destAddr), connectTimeout_secs)!=SOCK_OK)\n\t{\n\n\t\tclosesocket(fd);\n\t\treturn LOCAL_PROXY_CONNECT_FAIL;;\n\t}\t*/\n\n\tsock.SetTimeouts(m_nConnectTimeout_secs*1000, m_nSendTimeout_secs*1000, m_nReceiveTimeout_secs*1000, sock.GetAcceptTimeout());\n\tif (sock.Connect(proxyIp, proxyPort)!=0)\n\t\treturn LOCAL_PROXY_CONNECT_FAIL;\n\n\tchar logstr[4096];\n\tchar*bufPtr=NULL;\n\tint numRead, numWrite;\n\tmemset(buf, 0 , sizeof(buf));\n\n\tsprintf(buf, \"CONNECT %s:%hu HTTP/1.0\\r\\nUser-Agent: echoWare\\r\\n\\r\\n\", destIp, destPort);\n\n\tnumWrite=strlen(buf);\n\n\tif (sock.Send(buf, numWrite)!=0)\n    {\n\t\tsock.Close();\n\t\treturn -1;\n    }\n\n\tsprintf(logstr, \"Dll : AnalyzeHttpProxy: Sent buf(Actual:%d/Sent:%d)=%s\", strlen(buf), numWrite, buf);\n\n\n\t//\n\t// Receive response from Proxy\n\t//\n\tmemset(buf, 0 , sizeof(buf));\n\tbufPtr = buf;\n\n\tnumRead=MAX_BUFFER_SIZE;\n\tif (sock.Receive(buf, numRead)!=0)\n\t{\n\t\tsock.Close();\n\t\treturn -1;\n\t}\n\telse\n\t{\n\n\t\tif ((strncmp(buf, \"HTTP/1.1 407\", strlen(\"HTTP/1.1 407\"))==0) ||\n\t\t\t(strncmp(buf, \"HTTP/1.0 407\", strlen(\"HTTP/1.0 407\"))==0))\n\t\t{\n\t\t\tchar* s1 = strstr(buf, \"Proxy-Authenticate: Basic\");\n\t\t\tchar* s2 = strstr(buf, \"Proxy-Authenticate: NTLM\");\n\n\t\t\tif (s1!=NULL && s2==NULL)\n\t\t\t{\n\t\t\t\t// Basic Auth\n\t\t\t\tsock.Close();\n\t\t\t\treturn HTTP_AUTH_BASIC;\n\t\t\t}\n\t\t\telse if (s1==NULL && s2!=NULL)\n\t\t\t{\n\t\t\t\t// NTLM Auth\n\t\t\t\tsock.Close();\n\t\t\t\treturn HTTP_AUTH_NTLM;\n\t\t\t}\n\t\t\telse if (s1!=NULL && s2!=NULL)\n\t\t\t{\n\t\t\t\tif (s1 < s2)\n\t\t\t\t{\n\t\t\t\t\t// Basic Auth\n\t\t\t\t\tsock.Close();\n\t\t\t\t\t//return HTTP_AUTH_BASIC_NTLM;\n\t\t\t\t\treturn HTTP_AUTH_NTLM_BASIC; //always try NTLM first\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// NTLM Auth\n\t\t\t\t\tsock.Close();\n\n\t\t\t\t\t//return HTTP_AUTH_BASIC_NTLM;\n\t\t\t\t\treturn HTTP_AUTH_NTLM_BASIC;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//something different\n\t\t\t}\n\t\t}\n\t\telse if (strncmp(buf, \"HTTP/1.0 200\", 12)==0 || strncmp(buf, \"HTTP/1.1 200\", 12)==0)\n\t\t{\n\t\t\tsock.Close();\n\t\t\treturn HTTP_AUTH_BASIC;\n\t\t}\n\t}\n\n\tsock.Close();\n\treturn -1;\n}"
  },
  {
    "path": "Bundles/Echoware/ProxyConnect/ProxyConnect.dsp",
    "content": "# Microsoft Developer Studio Project File - Name=\"ProxyConnect\" - Package Owner=<4>\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\n# ** DO NOT EDIT **\n\n# TARGTYPE \"Win32 (x86) Static Library\" 0x0104\n\nCFG=ProxyConnect - Win32 Debug\n!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n!MESSAGE use the Export Makefile command and run\n!MESSAGE\n!MESSAGE NMAKE /f \"ProxyConnect.mak\".\n!MESSAGE\n!MESSAGE You can specify a configuration when running NMAKE\n!MESSAGE by defining the macro CFG on the command line. For example:\n!MESSAGE\n!MESSAGE NMAKE /f \"ProxyConnect.mak\" CFG=\"ProxyConnect - Win32 Debug\"\n!MESSAGE\n!MESSAGE Possible choices for configuration are:\n!MESSAGE\n!MESSAGE \"ProxyConnect - Win32 Release\" (based on \"Win32 (x86) Static Library\")\n!MESSAGE \"ProxyConnect - Win32 Debug\" (based on \"Win32 (x86) Static Library\")\n!MESSAGE\n\n# Begin Project\n# PROP AllowPerConfigDependencies 0\n# PROP Scc_ProjName \"\"\n# PROP Scc_LocalPath \"\"\nCPP=cl.exe\nRSC=rc.exe\n\n!IF  \"$(CFG)\" == \"ProxyConnect - Win32 Release\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 0\n# PROP BASE Output_Dir \"ProxyConnect___Win32_Release\"\n# PROP BASE Intermediate_Dir \"ProxyConnect___Win32_Release\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 0\n# PROP Output_Dir \"Release6\"\n# PROP Intermediate_Dir \"Release6\"\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_MBCS\" /D \"_LIB\" /YX /FD /c\n# ADD CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_MBCS\" /D \"_LIB\" /YX /FD /c\n# ADD BASE RSC /l 0x409 /d \"NDEBUG\"\n# ADD RSC /l 0x409 /d \"NDEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLIB32=link.exe -lib\n# ADD BASE LIB32 /nologo\n# ADD LIB32 /nologo /out:\"..\\Release6\\ProxyConnect.lib\"\n\n!ELSEIF  \"$(CFG)\" == \"ProxyConnect - Win32 Debug\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 1\n# PROP BASE Output_Dir \"ProxyConnect___Win32_Debug\"\n# PROP BASE Intermediate_Dir \"ProxyConnect___Win32_Debug\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 1\n# PROP Output_Dir \"Debug6\"\n# PROP Intermediate_Dir \"Debug6\"\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_MBCS\" /D \"_LIB\" /YX /FD /GZ  /c\n# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_MBCS\" /D \"_LIB\" /YX /FD /GZ  /c\n# ADD BASE RSC /l 0x409 /d \"_DEBUG\"\n# ADD RSC /l 0x409 /d \"_DEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLIB32=link.exe -lib\n# ADD BASE LIB32 /nologo\n# ADD LIB32 /nologo /out:\"..\\Debug6\\ProxyConnect.lib\"\n\n!ENDIF\n\n# Begin Target\n\n# Name \"ProxyConnect - Win32 Release\"\n# Name \"ProxyConnect - Win32 Debug\"\n# Begin Group \"Source Files\"\n\n# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat\"\n# Begin Source File\n\nSOURCE=.\\md4.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\md5.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\ntlmv2.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\ProxyConnect.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\stdafx.cpp\n# End Source File\n# End Group\n# Begin Group \"Header Files\"\n\n# PROP Default_Filter \"h;hpp;hxx;hm;inl\"\n# Begin Source File\n\nSOURCE=.\\md4.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\md5.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\ProxyConnect.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\stdafx.h\n# End Source File\n# End Group\n# Begin Group \"APISocket\"\n\n# PROP Default_Filter \"\"\n# Begin Source File\n\nSOURCE=..\\APISocket\\APISocket.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\APISocket\\ClientSocket.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=..\\APISocket\\ServerSocket.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=..\\APISocket\\Socket.cpp\n# End Source File\n# End Group\n# End Target\n# End Project\n"
  },
  {
    "path": "Bundles/Echoware/ProxyConnect/ProxyConnect.h",
    "content": "#if !defined(_PROXY_CONNECT_)\n#define _PROXY_CONNECT_\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n#define LOCAL_PROXY_CONNECT_FAIL\t\t-10\n#define LOCAL_PROXY_AUTH_FAIL\t\t\t-11\n#define LOCAL_PROXY_RESP_FAIL\t\t\t-12\n#define LOCAL_PROXY_RECV_FAIL\t\t\t-13\n\n\n#define SOCK_ERROR\t\t\t\t-1\n#define SOCK_OK\t\t\t\t\t0\n\n#define MAX_LINE_SIZE\t\t\t1024\n#define MAX_BUFFER_SIZE\t\t\t65536\n\n#define SOCK_CONNECT_TIMEOUT\t100\n#define SOCK_SEND_TIMEOUT\t\t101\n#define SOCK_RECEIVE_TIMEOUT\t102\n\n#define SOCKS_V5\t\t\t\t5\n#define SOCKS_V4\t\t\t\t4\n#define SOCKS_NOAUTH\t\t\t0\n#define SOCKS_NOMETHOD\t\t\t0xff\n#define SOCKS_CONNECT\t\t\t1\n\n\n#define HTTP_AUTH_NO\t\t\t1\n#define HTTP_AUTH_BASIC\t\t\t2\n#define HTTP_AUTH_NTLM\t\t\t3\n#define HTTP_AUTH_NTLM_BASIC\t4\n#define HTTP_AUTH_BASIC_NTLM\t5\n\n\n\n#define NONE_TYPE\t\t\t\t\t0\n//#define SOCKS4_TYPE\t\t\t\t1\n//#define SOCKS5_TYPE\t\t\t\t2\n//#define HTTP_TYPE\t\t\t\t\t3\n\n\n//#define PROXY_TYPE_AUTO_DECTECT\t\t\t0\n#define PROXY_TYPE_SOCKS4\t\t\t\t\t1\n#define PROXY_TYPE_SOCKS5\t\t\t\t\t2\n#define PROXY_TYPE_HTTP\t\t\t\t\t\t3\n\n\n#include \"../APISocket/APISocket.h\"\n\nclass CProxyConnect\n{\npublic:\n\n\tCProxyConnect();\n\t~CProxyConnect();\n\n\tint TestSocks4Proxy(APISocket::CSocket sock, const char* destIp, unsigned int destPort,  char* proxyIp,\n\t\t\tunsigned int proxyPort, char* username,  char* password);\n\n\tint TestSocks5Proxy(APISocket::CSocket sock, const char* destIp, unsigned int destPort,  char* proxyIp,\n\t\t\tunsigned int proxyPort, char* username,  char* password);\n\n\tint TestHttpProxy(APISocket::CSocket sock, const char* destIp, unsigned int destPort,  char* proxyIp,\n\t\t\tunsigned int proxyPort, char* username,  char* password);\n\n\tint DetectProxyType(APISocket::CSocket sock, const char* destIp, unsigned int destPort,  char* proxyIp,\n\t\t\tunsigned int proxyPort, char* username,  char* password);\n\n\tint ConnectViaHttpProxy(APISocket::CSocket sock, const char* destIp, unsigned int destPort,  char* proxyIp,\n\t\t\tunsigned int proxyPort, char* username, char* password);\n\n\tint ConnectViaSocks5Proxy(APISocket::CSocket sock, const char* destIp, unsigned int destPort, char* proxyIp,\n\t\t\tunsigned int proxyPort, char* username, char* password);\n\n\tint ConnectViaSocks4Proxy(APISocket::CSocket sock, const char* destIp, unsigned int destPort, char* proxyIp,\n\t\t\tunsigned int proxyPort, char* username, char* password);\n\n\tint ConnectViaProxy(APISocket::CSocket sock, const char* destIp, unsigned int destPort, char* proxyIp,\n\t\t\tunsigned int proxyPort, char* username, char* password);\n\n\tint AnalyzeHttpProxy(APISocket::CSocket sock, const char* destIp, unsigned int destPort, char* proxyIp,\n\t\t\tunsigned int proxyPort, char* username, char* password);\n\n\tint m_httpProxyAuthType;\n\tint m_temphttpProxyAuthType;\n\tint m_proxyType;\n\tbool m_bIsAutoDetectDone;\n\nprotected:\n\tstatic int m_nConnectTimeout_secs;\n\tstatic int m_nReceiveTimeout_secs;\n\tstatic int m_nSendTimeout_secs;\n};\n\n\n#endif\n\n"
  },
  {
    "path": "Bundles/Echoware/ProxyConnect/ProxyConnect.vcproj",
    "content": "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"7.00\"\n\tName=\"ProxyConnect\"\n\tProjectGUID=\"{CCEA3A1B-1170-4302-85A8-E4B441552105}\"\n\tKeyword=\"Win32Proj\">\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"/>\n\t</Platforms>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|Win32\"\n\t\t\tOutputDirectory=\"Debug\"\n\t\t\tIntermediateDirectory=\"Debug\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\">\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_LIB\"\n\t\t\t\tMinimalRebuild=\"TRUE\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"5\"\n\t\t\t\tUsePrecompiledHeader=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"TRUE\"\n\t\t\t\tDebugInformationFormat=\"4\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"../$(OutDir)/ProxyConnect.lib\"\n\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\n\t\t\t\tIgnoreDefaultLibraryNames=\"\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|Win32\"\n\t\t\tOutputDirectory=\"Release\"\n\t\t\tIntermediateDirectory=\"Release\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\">\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"2\"\n\t\t\t\tInlineFunctionExpansion=\"1\"\n\t\t\t\tOmitFramePointers=\"TRUE\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_LIB\"\n\t\t\t\tStringPooling=\"TRUE\"\n\t\t\t\tRuntimeLibrary=\"4\"\n\t\t\t\tEnableFunctionLevelLinking=\"TRUE\"\n\t\t\t\tUsePrecompiledHeader=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"TRUE\"\n\t\t\t\tDebugInformationFormat=\"3\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"../$(OutDir)/ProxyConnect.lib\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"/>\n\t\t</Configuration>\n\t</Configurations>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"Source Files\"\n\t\t\tFilter=\"cpp;c;cxx;def;odl;idl;hpj;bat;asm\">\n\t\t\t<File\n\t\t\t\tRelativePath=\"ProxyConnect.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"md4.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"md5.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"ntlmv2.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"stdafx.cpp\">\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Debug|Win32\">\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tUsePrecompiledHeader=\"1\"/>\n\t\t\t\t</FileConfiguration>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Release|Win32\">\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tUsePrecompiledHeader=\"1\"/>\n\t\t\t\t</FileConfiguration>\n\t\t\t</File>\n\t\t\t<Filter\n\t\t\t\tName=\"APISocket\">\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\APISocket\\ClientSocket.cpp\">\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\APISocket\\ServerSocket.cpp\">\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\APISocket\\Socket.cpp\">\n\t\t\t\t</File>\n\t\t\t</Filter>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Header Files\"\n\t\t\tFilter=\"h;hpp;hxx;hm;inl;inc\">\n\t\t\t<File\n\t\t\t\tRelativePath=\"ProxyConnect.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"md4.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"md5.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"stdafx.h\">\n\t\t\t</File>\n\t\t\t<Filter\n\t\t\t\tName=\"APISocket\">\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\APISocket\\APISocket.h\">\n\t\t\t\t</File>\n\t\t\t</Filter>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Resource Files\"\n\t\t\tFilter=\"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe\">\n\t\t</Filter>\n\t\t<File\n\t\t\tRelativePath=\"ReadMe.txt\">\n\t\t</File>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "Bundles/Echoware/ProxyConnect/global.h",
    "content": "/* GLOBAL.H - RSAREF types and constants\n */\n\n/* PROTOTYPES should be set to one if and only if the compiler supports\n  function argument prototyping.\n  The following makes PROTOTYPES default to 0 if it has not already\n  been defined with C compiler flags.\n */\n\n#ifndef PROTOTYPES\n#define PROTOTYPES 0\n#endif\n\n/* POINTER defines a generic pointer type */\ntypedef unsigned char *POINTER;\n\n/* UINT2 defines a two byte word */\ntypedef unsigned short int UINT2;\n\n/* UINT4 defines a four byte word */\ntypedef unsigned long int UINT4;\n\n/* PROTO_LIST is defined depending on how PROTOTYPES is defined above.\nIf using PROTOTYPES, then PROTO_LIST returns the list, otherwise it\n  returns an empty list.\n */\n#if PROTOTYPES\n#define PROTO_LIST(list) list\n#else\n#define PROTO_LIST(list) ()\n#endif\n"
  },
  {
    "path": "Bundles/Echoware/ProxyConnect/md4.cpp",
    "content": "/* MD4C.C - RSA Data Security, Inc., MD4 message-digest algorithm\n */\n\n/* Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved.\n\n   License to copy and use this software is granted provided that it\n   is identified as the \"RSA Data Security, Inc. MD4 Message-Digest\n   Algorithm\" in all material mentioning or referencing this software\n   or this function.\n\n   License is also granted to make and use derivative works provided\n   that such works are identified as \"derived from the RSA Data\n   Security, Inc. MD4 Message-Digest Algorithm\" in all material\n   mentioning or referencing the derived work.\n\n   RSA Data Security, Inc. makes no representations concerning either\n   the merchantability of this software or the suitability of this\n   software for any particular purpose. It is provided \"as is\"\n   without express or implied warranty of any kind.\n\n   These notices must be retained in any copies of any part of this\n   documentation and/or software.\n */\n\n#include \"stdafx.h\"\n#include \"stdio.h\"\n#include \"string.h\"\n#include \"stdlib.h\"\n\n#include \"global.h\"\n#include \"md4.h\"\n\n\n#define printf\n\n\n/* Constants for MD4Transform routine.\n */\n#define S11 3\n#define S12 7\n#define S13 11\n#define S14 19\n#define S21 3\n#define S22 5\n#define S23 9\n#define S24 13\n#define S31 3\n#define S32 9\n#define S33 11\n#define S34 15\n\nstatic void MD4Transform(UINT4 [4], unsigned char [64]);\nstatic void Encode(unsigned char *, UINT4 *, unsigned int);\nstatic void Decode(UINT4 *, unsigned char *, unsigned int);\nstatic void MD4_memcpy(POINTER, POINTER, unsigned int);\nstatic void MD4_memset(POINTER, int, unsigned int);\n\nstatic unsigned char PADDING[64] = {\n  0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n};\n\n/* F, G and H are basic MD4 functions.\n */\n#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))\n#define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z)))\n#define H(x, y, z) ((x) ^ (y) ^ (z))\n\n/* ROTATE_LEFT rotates x left n bits.\n */\n#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))\n\n/* FF, GG and HH are transformations for rounds 1, 2 and 3 */\n/* Rotation is separate from addition to prevent recomputation */\n#define FF(a, b, c, d, x, s) { \\\n    (a) += F ((b), (c), (d)) + (x); \\\n    (a) = ROTATE_LEFT ((a), (s)); \\\n  }\n#define GG(a, b, c, d, x, s) { \\\n    (a) += G ((b), (c), (d)) + (x) + (UINT4)0x5a827999; \\\n    (a) = ROTATE_LEFT ((a), (s)); \\\n  }\n#define HH(a, b, c, d, x, s) { \\\n    (a) += H ((b), (c), (d)) + (x) + (UINT4)0x6ed9eba1; \\\n    (a) = ROTATE_LEFT ((a), (s)); \\\n  }\n\n/* MD4 initialization. Begins an MD4 operation, writing a new context.\n */\n\nvoid MD4Init(MD4_CTX* context)\n{\n  context->count[0] = context->count[1] = 0;\n\n  /* Load magic initialization constants.\n   */\n  context->state[0] = 0x67452301;\n  context->state[1] = 0xefcdab89;\n  context->state[2] = 0x98badcfe;\n  context->state[3] = 0x10325476;\n}\n\n/* MD4 block update operation. Continues an MD4 message-digest\n     operation, processing another message block, and updating the\n     context.\n */\nvoid MD4Update(MD4_CTX *context, unsigned char *input, unsigned int inputLen)\n{\n  unsigned int i, index, partLen;\n\n  /* Compute number of bytes mod 64 */\n  index = (unsigned int)((context->count[0] >> 3) & 0x3F);\n  /* Update number of bits */\n  if ((context->count[0] += ((UINT4)inputLen << 3))\n      < ((UINT4)inputLen << 3))\n    context->count[1]++;\n  context->count[1] += ((UINT4)inputLen >> 29);\n\n  partLen = 64 - index;\n\n  /* Transform as many times as possible.\n   */\n  if (inputLen >= partLen) {\n    MD4_memcpy((POINTER)&context->buffer[index], (POINTER)input, partLen);\n    MD4Transform (context->state, context->buffer);\n\n    for (i = partLen; i + 63 < inputLen; i += 64)\n      MD4Transform (context->state, &input[i]);\n\n    index = 0;\n  }\n  else\n    i = 0;\n\n  /* Buffer remaining input */\n  MD4_memcpy\n    ((POINTER)&context->buffer[index], (POINTER)&input[i],\n     inputLen-i);\n}\n\n/* MD4 finalization. Ends an MD4 message-digest operation, writing the\n     the message digest and zeroizing the context.\n */\n\nvoid MD4Final(unsigned char digest[16], MD4_CTX *context)\n{\n  unsigned char bits[8];\n  unsigned int index, padLen;\n\n  /* Save number of bits */\n  Encode (bits, context->count, 8);\n\n  /* Pad out to 56 mod 64.\n   */\n  index = (unsigned int)((context->count[0] >> 3) & 0x3f);\n  padLen = (index < 56) ? (56 - index) : (120 - index);\n  MD4Update (context, PADDING, padLen);\n\n  /* Append length (before padding) */\n  MD4Update (context, bits, 8);\n  /* Store state in digest */\n  Encode (digest, context->state, 16);\n\n  /* Zeroize sensitive information.\n   */\n  MD4_memset ((POINTER)context, 0, sizeof (*context));\n}\n\n/* MD4 basic transformation. Transforms state based on block.\n */\nstatic void MD4Transform\n(\nUINT4 state[4],\nunsigned char block[64]\n)\n{\n  UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];\n\n  Decode (x, block, 64);\n\n  /* Round 1 */\n  FF (a, b, c, d, x[ 0], S11); /* 1 */\n  FF (d, a, b, c, x[ 1], S12); /* 2 */\n  FF (c, d, a, b, x[ 2], S13); /* 3 */\n  FF (b, c, d, a, x[ 3], S14); /* 4 */\n  FF (a, b, c, d, x[ 4], S11); /* 5 */\n  FF (d, a, b, c, x[ 5], S12); /* 6 */\n  FF (c, d, a, b, x[ 6], S13); /* 7 */\n  FF (b, c, d, a, x[ 7], S14); /* 8 */\n  FF (a, b, c, d, x[ 8], S11); /* 9 */\n  FF (d, a, b, c, x[ 9], S12); /* 10 */\n  FF (c, d, a, b, x[10], S13); /* 11 */\n  FF (b, c, d, a, x[11], S14); /* 12 */\n  FF (a, b, c, d, x[12], S11); /* 13 */\n  FF (d, a, b, c, x[13], S12); /* 14 */\n  FF (c, d, a, b, x[14], S13); /* 15 */\n  FF (b, c, d, a, x[15], S14); /* 16 */\n\n  /* Round 2 */\n  GG (a, b, c, d, x[ 0], S21); /* 17 */\n  GG (d, a, b, c, x[ 4], S22); /* 18 */\n  GG (c, d, a, b, x[ 8], S23); /* 19 */\n  GG (b, c, d, a, x[12], S24); /* 20 */\n  GG (a, b, c, d, x[ 1], S21); /* 21 */\n  GG (d, a, b, c, x[ 5], S22); /* 22 */\n  GG (c, d, a, b, x[ 9], S23); /* 23 */\n  GG (b, c, d, a, x[13], S24); /* 24 */\n  GG (a, b, c, d, x[ 2], S21); /* 25 */\n  GG (d, a, b, c, x[ 6], S22); /* 26 */\n  GG (c, d, a, b, x[10], S23); /* 27 */\n  GG (b, c, d, a, x[14], S24); /* 28 */\n  GG (a, b, c, d, x[ 3], S21); /* 29 */\n  GG (d, a, b, c, x[ 7], S22); /* 30 */\n  GG (c, d, a, b, x[11], S23); /* 31 */\n  GG (b, c, d, a, x[15], S24); /* 32 */\n\n  /* Round 3 */\n  HH (a, b, c, d, x[ 0], S31); /* 33 */\n  HH (d, a, b, c, x[ 8], S32); /* 34 */\n  HH (c, d, a, b, x[ 4], S33); /* 35 */\n  HH (b, c, d, a, x[12], S34); /* 36 */\n  HH (a, b, c, d, x[ 2], S31); /* 37 */\n  HH (d, a, b, c, x[10], S32); /* 38 */\n  HH (c, d, a, b, x[ 6], S33); /* 39 */\n  HH (b, c, d, a, x[14], S34); /* 40 */\n  HH (a, b, c, d, x[ 1], S31); /* 41 */\n  HH (d, a, b, c, x[ 9], S32); /* 42 */\n  HH (c, d, a, b, x[ 5], S33); /* 43 */\n  HH (b, c, d, a, x[13], S34); /* 44 */\n  HH (a, b, c, d, x[ 3], S31); /* 45 */\n  HH (d, a, b, c, x[11], S32); /* 46 */\n  HH (c, d, a, b, x[ 7], S33); /* 47 */\n  HH (b, c, d, a, x[15], S34); /* 48 */\n\n  state[0] += a;\n  state[1] += b;\n  state[2] += c;\n  state[3] += d;\n\n  /* Zeroize sensitive information.\n   */\n  MD4_memset ((POINTER)x, 0, sizeof (x));\n}\n\n/* Encodes input (UINT4) into output (unsigned char). Assumes len is\n     a multiple of 4.\n */\nstatic void Encode\n(\nunsigned char *output,\nUINT4 *input,\nunsigned int len\n)\n{\n  unsigned int i, j;\n\n  for (i = 0, j = 0; j < len; i++, j += 4) {\n    output[j] = (unsigned char)(input[i] & 0xff);\n    output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);\n    output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);\n    output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);\n  }\n}\n\n/* Decodes input (unsigned char) into output (UINT4). Assumes len is\n     a multiple of 4.\n */\nstatic void Decode\n(\nUINT4 *output,\nunsigned char *input,\nunsigned int len\n)\n{\n  unsigned int i, j;\n\n  for (i = 0, j = 0; j < len; i++, j += 4)\n    output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) |\n      (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);\n}\n\n/* Note: Replace \"for loop\" with standard memcpy if possible.\n */\nstatic void MD4_memcpy\n(\nPOINTER output,\nPOINTER input,\nunsigned int len\n)\n{\n  unsigned int i;\n\n  for (i = 0; i < len; i++)\n    output[i] = input[i];\n}\n\n/* Note: Replace \"for loop\" with standard memset if possible.\n */\nstatic void MD4_memset\n(\nPOINTER output,\nint value,\nunsigned int len\n)\n{\n  unsigned int i;\n\n  for (i = 0; i < len; i++)\n    ((char *)output)[i] = (char)value;\n}\n\n\n\n"
  },
  {
    "path": "Bundles/Echoware/ProxyConnect/md4.h",
    "content": "#if !defined(_MD4_)\n#define _MD4_\n\n\n/* MD4.H - header file for MD4C.C\n */\n\n/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All\n   rights reserved.\n\n   License to copy and use this software is granted provided that it\n   is identified as the \"RSA Data Security, Inc. MD4 Message-Digest\n   Algorithm\" in all material mentioning or referencing this software\n   or this function.\n\n   License is also granted to make and use derivative works provided\n   that such works are identified as \"derived from the RSA Data\n   Security, Inc. MD4 Message-Digest Algorithm\" in all material\n   mentioning or referencing the derived work.\n\n   RSA Data Security, Inc. makes no representations concerning either\n   the merchantability of this software or the suitability of this\n   software for any particular purpose. It is provided \"as is\"\n   without express or implied warranty of any kind.\n\n   These notices must be retained in any copies of any part of this\n   documentation and/or software.\n */\n\n/* MD4 context. */\n#include \"stdafx.h\"\n#include \"stdio.h\"\n#include \"string.h\"\n#include \"stdlib.h\"\n\n#include \"global.h\"\n\n\ntypedef struct {\n  UINT4 state[4];                                   /* state (ABCD) */\n  UINT4 count[2];        /* number of bits, modulo 2^64 (lsb first) */\n  unsigned char buffer[64];                         /* input buffer */\n} MD4_CTX;\n\n\nvoid MD4Init(MD4_CTX* context);\nvoid MD4Update(MD4_CTX *context, unsigned char *input, unsigned int inputLen);\nvoid MD4Final(unsigned char digest[16], MD4_CTX *context);\n\n\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/ProxyConnect/md5.cpp",
    "content": "/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm\n */\n\n/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All\nrights reserved.\n\nLicense to copy and use this software is granted provided that it\nis identified as the \"RSA Data Security, Inc. MD5 Message-Digest\nAlgorithm\" in all material mentioning or referencing this software\nor this function.\n\nLicense is also granted to make and use derivative works provided\nthat such works are identified as \"derived from the RSA Data\nSecurity, Inc. MD5 Message-Digest Algorithm\" in all material\nmentioning or referencing the derived work.\n\nRSA Data Security, Inc. makes no representations concerning either\nthe merchantability of this software or the suitability of this\nsoftware for any particular purpose. It is provided \"as is\"\nwithout express or implied warranty of any kind.\n\nThese notices must be retained in any copies of any part of this\ndocumentation and/or software.\n */\n\n\n#include \"stdafx.h\"\n#include \"global.h\"\n#include \"md5.h\"\n\n\n#define printf\n\n\n/* Constants for MD5Transform routine.\n */\n\n#define S11 7\n#define S12 12\n#define S13 17\n#define S14 22\n#define S21 5\n#define S22 9\n#define S23 14\n#define S24 20\n#define S31 4\n#define S32 11\n#define S33 16\n#define S34 23\n#define S41 6\n#define S42 10\n#define S43 15\n#define S44 21\n\nstatic void MD5Transform(UINT4 [4], unsigned char [64]);\nstatic void Encode(unsigned char *, UINT4 *, unsigned int);\nstatic void Decode(UINT4 *, unsigned char *, unsigned int);\nstatic void MD5_memcpy(POINTER, POINTER, unsigned int);\nstatic void MD5_memset(POINTER, int, unsigned int);\n\nstatic unsigned char PADDING[64] = {\n  0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n};\n\n/* F, G, H and I are basic MD5 functions.\n */\n#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))\n#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))\n#define H(x, y, z) ((x) ^ (y) ^ (z))\n#define I(x, y, z) ((y) ^ ((x) | (~z)))\n\n/* ROTATE_LEFT rotates x left n bits.\n */\n#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))\n\n/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.\nRotation is separate from addition to prevent recomputation.\n */\n#define FF(a, b, c, d, x, s, ac) { \\\n (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \\\n (a) = ROTATE_LEFT ((a), (s)); \\\n (a) += (b); \\\n  }\n#define GG(a, b, c, d, x, s, ac) { \\\n (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \\\n (a) = ROTATE_LEFT ((a), (s)); \\\n (a) += (b); \\\n  }\n#define HH(a, b, c, d, x, s, ac) { \\\n (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \\\n (a) = ROTATE_LEFT ((a), (s)); \\\n (a) += (b); \\\n  }\n#define II(a, b, c, d, x, s, ac) { \\\n (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \\\n (a) = ROTATE_LEFT ((a), (s)); \\\n (a) += (b); \\\n  }\n\n/* MD5 initialization. Begins an MD5 operation, writing a new context.\n */\nvoid MD5Init\n(\nMD5_CTX *context                                        /* context */\n)\n{\n  context->count[0] = context->count[1] = 0;\n  /* Load magic initialization constants.\n*/\n  context->state[0] = 0x67452301;\n  context->state[1] = 0xefcdab89;\n  context->state[2] = 0x98badcfe;\n  context->state[3] = 0x10325476;\n}\n\n/* MD5 block update operation. Continues an MD5 message-digest\n  operation, processing another message block, and updating the\n  context.\n */\nvoid MD5Update\n(\nMD5_CTX *context,                                        /* context */\nunsigned char *input,                                /* input block */\nunsigned int inputLen                     /* length of input block */\n)\n{\n  unsigned int i, index, partLen;\n\n  /* Compute number of bytes mod 64 */\n  index = (unsigned int)((context->count[0] >> 3) & 0x3F);\n\n  /* Update number of bits */\n  if ((context->count[0] += ((UINT4)inputLen << 3))\n   < ((UINT4)inputLen << 3))\n context->count[1]++;\n  context->count[1] += ((UINT4)inputLen >> 29);\n\n  partLen = 64 - index;\n\n  /* Transform as many times as possible.\n*/\n  if (inputLen >= partLen) {\n MD5_memcpy\n   ((POINTER)&context->buffer[index], (POINTER)input, partLen);\n MD5Transform (context->state, context->buffer);\n\n for (i = partLen; i + 63 < inputLen; i += 64)\n   MD5Transform (context->state, &input[i]);\n\n index = 0;\n  }\n  else\n i = 0;\n\n  /* Buffer remaining input */\n  MD5_memcpy\n ((POINTER)&context->buffer[index], (POINTER)&input[i],\n  inputLen-i);\n}\n\n/* MD5 finalization. Ends an MD5 message-digest operation, writing the\n  the message digest and zeroizing the context.\n */\nvoid MD5Final\n(\nunsigned char digest[16],                         /* message digest */\nMD5_CTX *context                                       /* context */\n)\n{\n  unsigned char bits[8];\n  unsigned int index, padLen;\n\n  /* Save number of bits */\n  Encode (bits, context->count, 8);\n\n  /* Pad out to 56 mod 64.\n   */\n  index = (unsigned int)((context->count[0] >> 3) & 0x3f);\n  padLen = (index < 56) ? (56 - index) : (120 - index);\n  MD5Update (context, PADDING, padLen);\n\n  /* Append length (before padding) */\n  MD5Update (context, bits, 8);\n\n  /* Store state in digest */\n  Encode (digest, context->state, 16);\n\n  /* Zeroize sensitive information.\n   */\n  MD5_memset ((POINTER)context, 0, sizeof (*context));\n}\n\n/* MD5 basic transformation. Transforms state based on block.\n */\nstatic void MD5Transform\n(\nUINT4 state[4],\nunsigned char block[64]\n)\n{\n  UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];\n\n  Decode (x, block, 64);\n\n  /* Round 1 */\n  FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */\n  FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */\n  FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */\n  FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */\n  FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */\n  FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */\n  FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */\n  FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */\n  FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */\n  FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */\n  FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */\n  FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */\n  FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */\n  FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */\n  FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */\n  FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */\n\n /* Round 2 */\n  GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */\n  GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */\n  GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */\n  GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */\n  GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */\n  GG (d, a, b, c, x[10], S22,  0x2441453); /* 22 */\n  GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */\n  GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */\n  GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */\n  GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */\n  GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */\n  GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */\n  GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */\n  GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */\n  GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */\n  GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */\n\n  /* Round 3 */\n  HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */\n  HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */\n  HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */\n  HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */\n  HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */\n  HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */\n  HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */\n  HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */\n  HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */\n  HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */\n  HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */\n  HH (b, c, d, a, x[ 6], S34,  0x4881d05); /* 44 */\n  HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */\n  HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */\n  HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */\n  HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */\n\n  /* Round 4 */\n  II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */\n  II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */\n  II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */\n  II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */\n  II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */\n  II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */\n  II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */\n  II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */\n  II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */\n  II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */\n  II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */\n  II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */\n  II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */\n  II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */\n  II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */\n  II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */\n\n  state[0] += a;\n  state[1] += b;\n  state[2] += c;\n  state[3] += d;\n\n  /* Zeroize sensitive information.\n   */\n  MD5_memset ((POINTER)x, 0, sizeof (x));\n}\n\n/* Encodes input (UINT4) into output (unsigned char). Assumes len is\n  a multiple of 4.\n */\nstatic void Encode\n(\nunsigned char *output,\nUINT4 *input,\nunsigned int len\n)\n{\n  unsigned int i, j;\n\n  for (i = 0, j = 0; j < len; i++, j += 4) {\n output[j] = (unsigned char)(input[i] & 0xff);\n output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);\n output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);\n output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);\n  }\n}\n\n/* Decodes input (unsigned char) into output (UINT4). Assumes len is\n  a multiple of 4.\n */\nstatic void Decode\n(\nUINT4 *output,\nunsigned char *input,\nunsigned int len\n)\n{\n  unsigned int i, j;\n\n  for (i = 0, j = 0; j < len; i++, j += 4)\n output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) |\n   (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);\n}\n\n/* Note: Replace \"for loop\" with standard memcpy if possible.\n */\n\nstatic void MD5_memcpy(POINTER output, POINTER input, unsigned int len)\n{\n  unsigned int i;\n\n  for (i = 0; i < len; i++)\n    output[i] = input[i];\n}\n\n/* Note: Replace \"for loop\" with standard memset if possible.\n */\nstatic void MD5_memset(POINTER output,int value,unsigned int len)\n{\n  unsigned int i;\n\n  for (i = 0; i < len; i++)\n ((char *)output)[i] = (char)value;\n}\n\n"
  },
  {
    "path": "Bundles/Echoware/ProxyConnect/md5.h",
    "content": "#if !defined(_MD5_)\n#define _MD5_\n\n\n/* MD5.H - header file for MD5C.C\n */\n\n/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All\nrights reserved.\n\nLicense to copy and use this software is granted provided that it\nis identified as the \"RSA Data Security, Inc. MD5 Message-Digest\nAlgorithm\" in all material mentioning or referencing this software\nor this function.\n\nLicense is also granted to make and use derivative works provided\nthat such works are identified as \"derived from the RSA Data\nSecurity, Inc. MD5 Message-Digest Algorithm\" in all material\nmentioning or referencing the derived work.\n\nRSA Data Security, Inc. makes no representations concerning either\nthe merchantability of this software or the suitability of this\nsoftware for any particular purpose. It is provided \"as is\"\nwithout express or implied warranty of any kind.\n\nThese notices must be retained in any copies of any part of this\ndocumentation and/or software.\n */\n\n/* MD5 context. */\n#include \"global.h\"\n\n\ntypedef struct {\n  UINT4 state[4];                                   /* state (ABCD) */\n  UINT4 count[2];        /* number of bits, modulo 2^64 (lsb first) */\n  unsigned char buffer[64];                         /* input buffer */\n} MD5_CTX;\n\nvoid MD5Init(MD5_CTX *);\nvoid MD5Update(MD5_CTX *, unsigned char *, unsigned int);\nvoid MD5Final(unsigned char [16], MD5_CTX *);\n\n\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/ProxyConnect/ntlm.h",
    "content": "#if !defined(_NTLM_)\n#define _NTLM_\n\n\n\n#define MAX_HOSTLEN 32\n#define MAX_DOMLEN 32\n#define MAX_USERLEN 32\n#define RESP_LEN 24\n#define NONCE_LEN 8\n\n#define MAX_NAME_LEN  64\n#define MAX_MSG_LEN   2048\n\n#define NTLM_NEG_UNICODE\t\t0x00000001\n#define NTLM_NEG_OEM\t\t\t0x00000002\n#define NTLM_REQ_TARGET\t\t\t0x00000004\n#define NTLM_NEG_NTLM\t\t\t0x00000200\n#define NTLM_NEG_DOMAIN\t\t\t0x00001000\n#define NTLM_NEG_LOCAL\t\t\t0x00004000\n#define NTLM_NEG_ASIGN\t\t\t0x00008000\n#define NTLM_TAR_DOMAIN\t\t\t0x00010000\n#define NTLM_NEG_NTLM2\t\t\t0x00080000\n\n\n\n#define NTLM_MSG_TYPE_1\t\t\t0x00000001\n#define NTLM_MSG_TYPE_2\t\t\t0x00000002\n#define NTLM_MSG_TYPE_3\t\t\t0x00000003\n\nint DoNTLMv1\n(\n\tint sock,\n\tconst char* destIp,\n\tunsigned int\tdestPort,\n\tunsigned char host[MAX_NAME_LEN],\n\tunsigned char domain[MAX_NAME_LEN],\n\tunsigned char user[MAX_NAME_LEN],\n\tunsigned char password[MAX_NAME_LEN]\n);\n\n\n\nint DoNTLMv2\n(\n\tint sock,\n\tconst char* destIp,\n\tunsigned int\tdestPort,\n\tunsigned char host[MAX_NAME_LEN],\n\tunsigned char domain[MAX_NAME_LEN],\n\tunsigned char user[MAX_NAME_LEN],\n\tunsigned char password[MAX_NAME_LEN]\n);\n\n\n\n\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/ProxyConnect/ntlmv2.cpp",
    "content": "////////////////////////////////////////////////////////////////////////////\n// EchoWare is Copyright (C) 2004,2005 Echogent Systems, Inc. All rights reserved.\n\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n\n//  * Redistributions of source code must retain the above copyright notice,\n//    this list of conditions and the following disclaimer.\n\n//  * Redistributions in binary form must reproduce the above copyright notice,\n//    this list of conditions and the following disclaimer in the documentation\n//    and/or other materials provided with the distribution.\n//\n//  * Redistributions in any form must be accompanied by information on how\n//    to obtain complete source code for the echoware software and any\n//    accompanying software that uses the echoware software. The source code\n//    must either be included in the distribution or be available for no more\n//    than the cost of distribution plus a nominal fee, and must be freely\n//    redistributable under reasonable conditions. For an executable file,\n//   complete source code means the source code for all modules it contains.\n//    It does not include source code for modules or files that typically\n//    accompany the major components of the operating system on which the\n//    executable file runs.\n\n// THIS SOFTWARE IS PROVIDED BY ECHOGENT SYSTEMS, INC. ``AS IS'' AND ANY EXPRESS\n//OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT,\n//ARE DISCLAIMED. IN NO EVENT SHALL ECHOGENT SYSTEMS, INC. BE LIABLE FOR ANY\n//DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n//(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n//ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n//(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n//THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//For more information: echoware@echogent.com\n//\n////////////////////////////////////////////////////////////////////////////\n\n#include \"stdafx.h\"\n//#include \"afx.h\"\n#include \"iostream\"\n//#include \"windows.h\"\n#include \"stdio.h\"\n#include \"string.h\"\n#include \"stdlib.h\"\n\n\n#include \"stdafx.h\"\n#include \"proxyconnect.h\"\n#include \"Echoware.h\"\n/*#include \"VPNProxyDllManager.h\"*/\n\n#include \"md5.h\"\n#include \"md4.h\"\n#include \"ntlm.h\"\n\n#include \"sys/socket.h\"\n#include \"EchoToOSX.h\"\n\n#define printf\n\n//typedef unsigned __int8\t\tuint8_t;\n//typedef unsigned __int16\tuint16_t;\n//typedef unsigned __int32\tuint32_t;\n//typedef unsigned __int64\tuint64_t;\n//typedef __int8\t\t\t\tint8_t;\n//typedef __int16\t\t\t\tint16_t;\n//typedef __int32\t\t\t\tint32_t;\n//typedef __int64\t\t\t\tint64_t;\n\n\n#define bzero( x, n) memset(x, 0, n)\n#define bcopy( s, d, len) memcpy(d, s, len)\n\n/*\n** Function: hmac_md5\n*/\n\nvoid hmac_md5(\nunsigned char* text, /* pointer to data stream */\nint text_len, /* length of data stream */\nunsigned char* key, /* pointer to authentication key */\nint key_len, /* length of authentication key */\nunsigned char digest[16] /* caller digest to be filled in */\n)\n{\n        MD5_CTX context;\n        unsigned char k_ipad[65];    /* inner padding -\n                                      * key XORd with ipad\n                                      */\n        unsigned char k_opad[65];    /* outer padding -\n                                      * key XORd with opad\n                                      */\n        unsigned char tk[16];\n        int i;\n\n\t\t/* if key is longer than 64 bytes reset it to key=MD5(key) */\n        if (key_len > 64) {\n\n\t\t\tMD5_CTX      tctx;\n\t\t\tMD5Init(&tctx);\n\t\t\tMD5Update(&tctx, key, key_len);\n\t\t\tMD5Final(tk, &tctx);\n\n\t\t\tkey = tk;\n\t\t\tkey_len = 16;\n        }\n\n        /*\n         * the HMAC_MD5 transform looks like:\n         *\n         * MD5(K XOR opad, MD5(K XOR ipad, text))\n         *\n         * where K is an n byte key\n         * ipad is the byte 0x36 repeated 64 times\n         * opad is the byte 0x5c repeated 64 times\n         * and text is the data being protected\n         */\n\n        /* start out by storing key in pads */\n        bzero( k_ipad, sizeof k_ipad);\n        bzero( k_opad, sizeof k_opad);\n        bcopy( key, k_ipad, key_len);\n        bcopy( key, k_opad, key_len);\n\n        /* XOR key with ipad and opad values */\n        for (i=0; i<64; i++) {\n                k_ipad[i] ^= 0x36;\n                k_opad[i] ^= 0x5c;\n        }\n        /*\n         * perform inner MD5\n         */\n        MD5Init(&context);                   /* init context for 1st\n                                              * pass */\n        MD5Update(&context, k_ipad, 64);     /* start with inner pad */\n        MD5Update(&context, text, text_len); /* then text of datagram */\n        MD5Final(digest, &context);          /* finish up 1st pass */\n        /*\n         * perform outer MD5\n         */\n        MD5Init(&context);                   /* init context for 2nd\n                                              * pass */\n        MD5Update(&context, k_opad, 64);     /* start with outer pad */\n        MD5Update(&context, digest, 16);     /* then results of 1st\n                                              * hash */\n        MD5Final(digest, &context);          /* finish up 2nd pass */\n}\n\n\n\nstatic const char base64digits[] =\n  \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n#define BAD\t-1\nstatic const char base64val[] = {\n    BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD,\n    BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD,\n    BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD, 62, BAD,BAD,BAD, 63,\n     52, 53, 54, 55,  56, 57, 58, 59,  60, 61,BAD,BAD, BAD,BAD,BAD,BAD,\n    BAD,  0,  1,  2,   3,  4,  5,  6,   7,  8,  9, 10,  11, 12, 13, 14,\n     15, 16, 17, 18,  19, 20, 21, 22,  23, 24, 25,BAD, BAD,BAD,BAD,BAD,\n    BAD, 26, 27, 28,  29, 30, 31, 32,  33, 34, 35, 36,  37, 38, 39, 40,\n     41, 42, 43, 44,  45, 46, 47, 48,  49, 50, 51,BAD, BAD,BAD,BAD,BAD\n};\n#define DECODE64(c)  (isascii(c) ? base64val[c] : BAD)\n\n\n\n#ifndef MAX\n#define MAX( x, y )\t( ( (x)>(y) ) ? (x) : (y) )\n#endif\n\nvoid base64(unsigned char *out, const unsigned char *in, int len)\n{\n  while (len >= 3)\n  {\n    *out++ = base64digits[in[0] >> 2];\n    *out++ = base64digits[((in[0] << 4) & 0x30) | (in[1] >> 4)];\n    *out++ = base64digits[((in[1] << 2) & 0x3c) | (in[2] >> 6)];\n    *out++ = base64digits[in[2] & 0x3f];\n    len -= 3;\n    in += 3;\n }\n\n  if (len > 0)\n  {\n    unsigned char fragment;\n\n    *out++ = base64digits[in[0] >> 2];\n    fragment = (in[0] << 4) & 0x30;\n    if (len > 1)\n      fragment |= in[1] >> 4;\n    *out++ = base64digits[fragment];\n    *out++ = (len < 2) ? '=' : base64digits[(in[1] << 2) & 0x3c];\n    *out++ = '=';\n  }\n  *out = '\\0';\n}\n\nint unbase64(char *out, const char *in, int maxlen)\n{\n    int len = 0;\n    register unsigned char digit1, digit2, digit3, digit4;\n    if (in[0] == '+' && in[1] == ' ')\n\t\tin += 2;\n    if (*in == '\\r')\n\t\treturn(0);\n    do\n\t{\n\t\tdigit1 = in[0];\n\t\tif (DECODE64(digit1) == BAD)\n\t\t\treturn(-1);\n\t\tdigit2 = in[1];\n\t\tif (DECODE64(digit2) == BAD)\n\t\t\treturn(-1);\n\t\tdigit3 = in[2];\n\t\tif (digit3 != '=' && DECODE64(digit3) == BAD)\n\t\t\treturn(-1);\n\t\tdigit4 = in[3];\n\t\tif (digit4 != '=' && DECODE64(digit4) == BAD)\n\t\t\treturn(-1);\n\t\tin += 4;\n\t\t++len;\n\t\tif (maxlen && len > maxlen)\n\t\t\treturn(-1);\n\t\t*out++ = (DECODE64(digit1) << 2) | (DECODE64(digit2) >> 4);\n\t\tif (digit3 != '=')\n\t\t{\n\t\t\t++len;\n\t\t\tif (maxlen && len > maxlen)\n\t\t\t\treturn(-1);\n\t\t\t*out++ = ((DECODE64(digit2) << 4) & 0xf0) | (DECODE64(digit3) >> 2);\n\t\t\tif (digit4 != '=')\n\t\t\t{\n\t\t\t\t++len;\n\t\t\tif (maxlen && len > maxlen)\n\t\t\t\treturn(-1);\n\t\t\t*out++ = ((DECODE64(digit3) << 6) & 0xc0) | DECODE64(digit4);\n\t\t\t}\n\t\t}\n    }\n\twhile (*in && *in != '\\r' && digit4 != '=');\n    return (len);\n}\n\n\n\n#define MSG_BUF_SIZE 4096\n#define NAME_BUF_LEN 256\n#define MAXSIZE 65536\n#define\tSIZE1\t8\n\ntypedef struct\n{\n\tunsigned short\tlength;\n\tunsigned short\tspace;\n\tunsigned long\toffset;\n} securitybuffer;\n\n\ntypedef struct\n{\n\tunsigned char\tdigest[SIZE1];\t\t\t//8 bytes\n\tunsigned char\tserverchallenge[SIZE1];\t\t//8 bytes\n\n\tunsigned long\tsignature;\t\t\t\t//4 bytes\n\tunsigned long\treserved;\t\t\t\t//4 bytes\n\tunsigned long \ttimestamp;\t\t\t\t//4 bytes\n\tunsigned char\tclientchallenge[SIZE1];\t//8 bytes\n\tunsigned long\tunknown;\t\t\t\t//4 bytes\n\t//unsigned long\tdata;\t\t\t\t\t//data\n\tunsigned char\tdata[1];\t\t\t\t//data\n} ntlmv2_blob;\n\n\n\ntypedef struct\n{\n\tunsigned char\tsignature[SIZE1];\t\t//8 bytes\n\tunsigned long\tmessagetype;\t\t\t//4 bytes\n\tunsigned long\tflags;\t\t\t\t\t//4 bytes\n\tsecuritybuffer\tdomain;\t\t\t\t\t//8 bytes\n\tsecuritybuffer\tworkstation;\t\t\t//8 bytes\n} ntlmv2_type1;\n\n\ntypedef struct\n{\n\tunsigned char\tsignature[SIZE1];\t\t//8 bytes\n\tunsigned long\tmessagetype;\t\t\t//4 bytes\n\tsecuritybuffer\ttargetname;\t\t\t\t//8 bytes\n\tunsigned long\tflags;\t\t\t\t\t//4 bytes\n\tunsigned char\tchallenge[SIZE1];\t\t//8 bytes\n\tunsigned long\tcontext1;\t\t\t\t//4 bytes\n\tunsigned long\tcontext2;\t\t\t\t//4 bytes\n\tsecuritybuffer\ttargetinfo;\t\t\t\t//8 bytes\n\tunsigned char\tdata[1];\t\t\t\t//data\n} ntlmv2_type2;\n\n\ntypedef struct\n{\n\tunsigned char\tsignature[SIZE1];\n\tunsigned long\tmessagetype;\n\tsecuritybuffer\tLM_response;\n\tsecuritybuffer\tNTLM_response;\n\tsecuritybuffer\tdomain;\n\tsecuritybuffer\tuser;\n\tsecuritybuffer\tworkstation;\n\tunsigned char\tsessionkey[SIZE1];\n\tunsigned long\tflags;\n\tunsigned char\tdata[1];\n} ntlmv2_type3;\n\n\n\n\n\n//\n// Global variable for NTLMv2\n//\nchar gpassword[NAME_BUF_LEN];\nchar gusername[NAME_BUF_LEN];\nchar gdomain[NAME_BUF_LEN];\nchar gworkstation[NAME_BUF_LEN];\n\nchar ntlmv2_type1_buffer[MSG_BUF_SIZE];\nchar ntlmv2_type3_buffer[MSG_BUF_SIZE];\nchar ntlmv2_type2_buffer[MSG_BUF_SIZE];\n\n\nunsigned char challenge[8];\nunsigned char unicodepassword[NAME_BUF_LEN*2];\n\nunsigned char lmv2digest[16];\n\nunsigned char *blob = NULL;\nint bloblen;\n\nchar *type2_targetinfo;\nint type2_targetinfo_len=0;\n\nunsigned long type2_flags;\nunsigned long unicodeFlag = 0;\n\n\n//\n// Global functions for NTLMv2\n//\nint ntlmv2_build_type1();\nint ntlmv2_parse_type2(unsigned char *buf);\nint ntlmv2_build_type3();\nint ntlmv2_prepare_type3();\n\n\n\nint ntlmv2_build_type1()\n{\n\tntlmv2_type1 type1;\n\tmemset(&type1, 0, sizeof(type1));\n\ttype1.signature[0] = 'N';\n\ttype1.signature[1] = 'T';\n\ttype1.signature[2] = 'L';\n\ttype1.signature[3] = 'M';\n\ttype1.signature[4] = 'S';\n\ttype1.signature[5] = 'S';\n\ttype1.signature[6] = 'P';\n\ttype1.signature[7] = '\\0';\n\n\ttype1.messagetype = NTLM_MSG_TYPE_1;\n\ttype1.flags = NTLM_NEG_UNICODE|NTLM_NEG_OEM|NTLM_REQ_TARGET|\n\t\t\t\t  NTLM_NEG_NTLM|NTLM_NEG_ASIGN|NTLM_NEG_NTLM2;\n\n\tbase64((unsigned char*)ntlmv2_type1_buffer, (unsigned char *)&type1, sizeof(type1));\n\n\treturn 0;\n}\n\n\n\n\n\nint ntlmv2_parse_type2(unsigned char *buf)\n{\n\tint len;\n\tchar response[4096];\n\tntlmv2_type2 *type2=NULL;\n\n\tif ((strncmp((char*)buf, \"HTTP/1.1 407\", strlen(\"HTTP/1.1 407\"))==0) ||\n\t\t(strncmp((char*)buf, \"HTTP/1.0 407\", strlen(\"HTTP/1.0 407\"))==0))\n\t{\n\n\t}\n\telse\n\t{\n\t\treturn -1;\n\t}\n\n\tif (strstr((char*)buf, \"Proxy-Authenticate: NTLM\") == NULL)\n\t{\n\t\treturn -1;\n\t}\n\n\tchar* ptr = strstr((char*)buf, \"Proxy-Authenticate: NTLM \");\n\tptr += strlen(\"Proxy-Authenticate: NTLM \");\n\n\t//\n\t// Get 64 chars response and decode it\n\t//\n\tmemset(response, 0, sizeof(response));\n\tmemcpy(response, ptr, 64);\n\n\tlen = unbase64((char*)ntlmv2_type2_buffer, (char*)response, MSG_BUF_SIZE);\n\tif (len <= 0)\n\t{\n\t\treturn -1;\n\t}\n\n\ttype2 = (ntlmv2_type2*)ntlmv2_type2_buffer;\n\n\tif (strcmp((char*)type2->signature, \"NTLMSSP\") != 0)\n\t{\n\t\treturn -1;\n\t}\n\n\tif (type2->messagetype != NTLM_MSG_TYPE_2)\n\t{\n\t\treturn -1;\n\t}\n\n\n/*\n\tif (!(type2->flags & NTLM_NEG_NTLM && type2->flags & NTLM_NEG_NTLM2))\n\t{\n\t\tif(theApp.bEnablelogging)\n\t\t\tLogVPNProxy(\"Dll : ntlmv2_parse_type2: not support NEG_NTLM/NEG_NTLM2, return -1\");\n\t\treturn -1;\n\t}\n*/\n\n\tif (type2->flags & NTLM_NEG_UNICODE)\n\t\tunicodeFlag = 1;\n\telse\n\t\tunicodeFlag = 0;\n\n\t//\n\t// Save type2 flag to use later\n\t//\n\ttype2_flags = type2->flags;\n\n\t//\n\t// Get the Challenge (8 bytes)\n\t//\n\tmemcpy(challenge, type2->challenge, 8);\n\n\t//\n\t// Target Information\n\t//\n\ttype2_targetinfo = &ntlmv2_type2_buffer[type2->targetinfo.offset];\n\ttype2_targetinfo_len = type2->targetinfo.length;\n\n\treturn ntlmv2_prepare_type3();\n}\n\n\n\nint ntlmv2_prepare_type3()\n{\n\tint i, j;\n\tint passlen = 0;\n\tint userdomainlen=0;\n\tunsigned char passdigest[16];\n\tunsigned char userdomaindigest[16];\n\tunsigned char respdigest[16];\n\tunsigned char lmv2data[16];\n\tunsigned char *userdomain;\n\tntlmv2_blob *blob_ptr;\n\tMD4_CTX passcontext;\n\n\t//\n\t// The NTLM password hash is obtained.\n\t// this is the MD4 digest of the Unicode mixed-case password\n\t//\n\tmemset(unicodepassword, 0, NAME_BUF_LEN*2);\n\tfor (i = 0; i < strlen(gpassword); i++)\n\t{\n\t\tif (unicodeFlag)\n\t\t{\n\t\t\tunicodepassword[i*2] = gpassword[i];\n\t\t\tpasslen++;\n\t\t\tpasslen++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tunicodepassword[i] = gpassword[i];\n\t\t\tpasslen++;\n\t\t}\n\t}\n\n\tMD4Init(&passcontext);\n\tMD4Update(&passcontext, unicodepassword, passlen);\n\tMD4Final(passdigest, &passcontext);\n\n\t//\n\t// The Unicode uppercase username is concatenated with the Unicode uppercase\n\t// authentication target (domain or server name).\n\t// The HMAC-MD5 message authentication code algorithm is applied to this value\n\t// using the 16-byte NTLM hash as the key.\n\t// This results in a 16-byte value - the NTLMv2 hash.\n\t//\n\tuserdomainlen = (strlen(gusername) + strlen(gdomain)) *2;\n\tuserdomain = (unsigned char*)malloc(userdomainlen);\n\tif (!userdomain)\n\t{\n\t\treturn -1;\n\t}\n\n\tmemset(userdomain, 0, userdomainlen);\n\tuserdomainlen = 0;\n\tfor (i = 0; i < strlen(gusername); i++)\n\t{\n\t\tif (unicodeFlag)\n\t\t{\n\t\t\tuserdomain[i*2] = toupper(gusername[i]);\n\t\t\tuserdomainlen++;\n\t\t\tuserdomainlen++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tuserdomain[i] = toupper(gusername[i]);\n\t\t\tuserdomainlen++;\n\t\t}\n\t}\n\n\tfor (j = 0; j < strlen(gdomain); j++)\n\t{\n\t\tif (unicodeFlag)\n\t\t{\n\t\t\tuserdomain[i*2 + j*2] = toupper(gdomain[j]);\n\t\t\tuserdomainlen++;\n\t\t\tuserdomainlen++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tuserdomain[i + j] = toupper(gdomain[j]);\n\t\t\tuserdomainlen++;\n\t\t}\n\t}\n\n\t//\n\t// Apply HMAC-MD5, using NTLM hash as the key\n\t//\n\thmac_md5(userdomain, userdomainlen, passdigest, 16, userdomaindigest);\n\n\tfree(userdomain);\n\n\t//\n\t// A block of data known as the \"blob\" is constructed\n\t//\n\tbloblen = sizeof(ntlmv2_blob) + type2_targetinfo_len;\n\tblob = (unsigned char *)malloc(bloblen);\n\tif (!blob)\n\t{\n\t\treturn -1;\n\t}\n\n\tmemset(blob, 0, bloblen);\n\n\tblob_ptr = (ntlmv2_blob*)blob;\n\n\t//\n\t// The challenge from the Type 2 message is concatenated with the blob.\n\t//\n\tmemcpy(blob_ptr->serverchallenge, challenge, 8);\n\n\t//\n\t// Client Challenge\n\t//\n\tfor (i = 0; i < 8; i++)\n\t\tblob_ptr->clientchallenge[i] = (unsigned char)((256.0*rand())/(RAND_MAX + 1.0)) ;\n\n\tmemcpy(&blob_ptr->data, type2_targetinfo, type2_targetinfo_len);\n\n\tblob_ptr->signature = 0x00000101;\n\n\t//\n\t// The HMAC-MD5 message authentication code algorithm is applied to\n\t// this value using the 16-byte NTLMv2 hash (userdomaindigest) as the key.\n\t// This results in a 16-byte output value.\n\t// This value is concatenated with the blob to form the NTLMv2 response.\n\t//\n\n\t//\n\t// Apply HMAC-MD5\n\t//\n\thmac_md5(blob+8, bloblen-8, userdomaindigest, 16, respdigest);\n\n\tmemcpy(blob_ptr->digest, respdigest, 16);\n\n\t//\n\t// LM2 response\n\t//\n\tmemcpy(lmv2data, blob_ptr->serverchallenge, 8);\n\tmemcpy(lmv2data+8, blob_ptr->clientchallenge, 8);\n\n\t//\n\t// Apply HMAC-MD5\n\t//\n\thmac_md5(lmv2data, 16, userdomaindigest, 16, lmv2digest);\n\n\treturn 0;\n}\n\n\n\nint ntlmv2_build_type3()\n{\n\tint totalLen=0;\n\tint size=1, index=0;\n\tntlmv2_type3 *type3;\n\tunsigned char *ptr;\n\n\tif (unicodeFlag)\n\t\tsize = 2;\n\n\ttotalLen = sizeof(ntlmv2_type3) + (16 + bloblen + size*(strlen(gdomain) + strlen(gusername) + strlen(gworkstation)));\n\ttype3 = (ntlmv2_type3 *)malloc(totalLen);\n\tif (!type3)\n\t{\n\t\treturn -1;\n\t}\n\n\tmemset(type3, 0, totalLen);\n\tptr = (unsigned char*)type3;\n\n\ttype3->signature[0] = 'N';\n\ttype3->signature[1] = 'T';\n\ttype3->signature[2] = 'L';\n\ttype3->signature[3] = 'M';\n\ttype3->signature[4] = 'S';\n\ttype3->signature[5] = 'S';\n\ttype3->signature[6] = 'P';\n\ttype3->signature[7] = '\\0';\n\n\ttype3->messagetype = NTLM_MSG_TYPE_3;\n\n\t//\n\t// LM/LMv2 Resp\n\t//\n\ttype3->LM_response.length = 16;\n\ttype3->LM_response.space = 16;\n\ttype3->LM_response.offset = sizeof(ntlmv2_type3);\n\tmemcpy(&ptr[type3->LM_response.offset], lmv2digest, 16);\n\n\t//\n\t// NTLM/NTLMv2 Resp\n\t//\n\ttype3->NTLM_response.length = bloblen;\n\ttype3->NTLM_response.space = bloblen;\n\ttype3->NTLM_response.offset = type3->LM_response.offset + type3->LM_response.space;\n\tmemcpy(&ptr[type3->NTLM_response.offset], blob, bloblen);\n\n\t//\n\t// Domain\n\t//\n\ttype3->domain.length = size*strlen(gdomain);\n\ttype3->domain.space = size*strlen(gdomain);\n\ttype3->domain.offset = type3->NTLM_response.offset + type3->NTLM_response.space;\n\tfor (index = 0; index < strlen(gdomain); index++)\n\t\tptr[type3->domain.offset + index*size] = gdomain[index];\n\n\t//\n\t// User\n\t//\n\ttype3->user.length = size*strlen(gusername);\n\ttype3->user.space = size*strlen(gusername);\n\ttype3->user.offset = type3->domain.offset + type3->domain.space;\n\tfor (index = 0; index < strlen(gusername); index++)\n\t\tptr[type3->user.offset + index*size] = gusername[index];\n\n\t//\n\t// Workstation\n\t//\n\ttype3->workstation.length = size*strlen(gworkstation);\n\ttype3->workstation.space = size*strlen(gworkstation);\n\ttype3->workstation.offset = type3->user.offset + type3->user.space;\n\tfor (index = 0; index < strlen(gworkstation); index++)\n\t\tptr[type3->workstation.offset + index*size] = gworkstation[index];\n\n\t//\n\t// Flags\n\t//\n\ttype3->flags = type2_flags & ~NTLM_TAR_DOMAIN;\n\n\t//\n\t// Encode\n\t//\n\tbase64((unsigned char*)ntlmv2_type3_buffer, (unsigned char*)type3, totalLen);\n\n\tif (type3 != NULL)\n\t\tfree(type3);\n\n\tif (blob != NULL)\n\t\tfree(blob);\n\n\treturn 0;\n}\n\n\n\nint ConnectViaHttpProxy\n(\n\tconst char* destIp,\n\tUINT\tdestPort,\n\tchar*\tproxyIp,\n\tUINT proxyPort,\n\tchar* username,\n\tchar* password\n);\n\n\n#define MAX_BUFFER_SIZE\t\t\t65536\n#define MAX_NAME_LEN  64\n\n\n#define LOCAL_PROXY_CONNECT_FAIL\t\t-10\n#define LOCAL_PROXY_AUTH_FAIL\t\t\t-11\n#define LOCAL_PROXY_RESP_FAIL\t\t\t-12\n#define LOCAL_PROXY_RECV_FAIL\t\t\t-13\n#define byte unsigned char\n\n\n\n\nint DoNTLMv2\n(\n\tint fd,\n\tconst char* destIp,\n\tUINT\tdestPort,\n\tunsigned char host[MAX_NAME_LEN],\n\tunsigned char domain[MAX_NAME_LEN],\n\tunsigned char user[MAX_NAME_LEN],\n\tunsigned char password[MAX_NAME_LEN]\n)\n\n{\n\tchar buf[MAX_BUFFER_SIZE];\n\tchar logstr[512];\n\tchar*bufPtr=NULL;\n\tint numRead, numWrite;\n\n\tmemset(buf, 0 , sizeof(buf));\n\tmemset(ntlmv2_type1_buffer, 0 , sizeof(ntlmv2_type1_buffer));\n\tmemset(ntlmv2_type3_buffer, 0 , sizeof(ntlmv2_type3_buffer));\n\n\tstrcpy((char*)gworkstation, (char*)host);\n\tstrcpy((char*)gdomain, (char*)domain);\n\tstrcpy((char*)gusername, (char*)user);\n\tstrcpy((char*)gpassword, (char*)password);\n\n\n\n\t//\n\t// Build msg1\n\t//\n\tif (ntlmv2_build_type1()<0)\n\t{\n\n\t\t//closesocket(fd);\n\t\treturn -1;\n\t}\n\n\tprintf(\"ntlmv2_type1_buffer=%s\\n\", ntlmv2_type1_buffer);\n\n\t//\n\t// Send msg1\n\t//\n\tsprintf(buf, \"CONNECT %s:%hu HTTP/1.0\\r\\nProxy-Authorization: NTLM %s\\r\\n\", destIp, destPort, ntlmv2_type1_buffer);\n\tsprintf( buf, \"%sProxy-Connection: Keep-Alive\\r\\n\\r\\n\", buf );\n\n\tnumWrite = send(fd, buf, strlen(buf), 0);\n\tif (numWrite <=0)\n    {\n\t\t//closesocket(fd);\n\t\treturn -1;\n    }\n\n\tsprintf(logstr, \"Dll : DoNTLMv2: Sent type1msg buf(Actual:%d/Sent:%d)=%s\", strlen(buf), numWrite, buf);\n\tprintf(logstr);\n\n\tmemset(buf, 0, sizeof(buf));\n\n\tif ((numRead = recv(fd, buf, MAX_BUFFER_SIZE, 0)) <= 0)\n\t{\n\t\tprintf(\"Failed to receive response from this server\\n\");\n\t\t//closesocket(fd);\n\t\treturn -1;\n\t}\n\telse\n\t{\n\n\t}\n\n\t//\n\t// Analyze response\n\t//\n\tif (ntlmv2_parse_type2((unsigned char*)buf) !=0)\n\t{\n\t\tprintf(\"Wrong Type2\\n\");\n\t\t//closesocket(fd);\n\t\treturn -1;\n\t}\n\n\t//\n\t// Build msg3\n\t//\n\tntlmv2_build_type3();\n\tprintf(\"ntlmv2_type3_buffer=%s\\n\", ntlmv2_type3_buffer);\n\n\tmemset(buf, 0, sizeof(buf));\n\tsprintf(buf, \"CONNECT %s:%hu HTTP/1.0\\r\\nProxy-Authorization: NTLM %s\\r\\n\", destIp, destPort, ntlmv2_type3_buffer);\n\tsprintf( buf, \"%sProxy-Connection: Keep-Alive\\r\\n\\r\\n\", buf );\n\n\t//\n\t// Send msg3\n\t//\n\tnumWrite = send(fd, buf, strlen(buf), 0);\n\tif (numWrite <=0)\n    {\n\t\t//closesocket(fd);\n\t\treturn -1;\n    }\n\n\tsprintf(logstr, \"Dll : DoNTLMv2: Sent type3msg buf(Actual:%d/Sent:%d)=%s\", strlen(buf), numWrite, buf);\n\tprintf(logstr);\n\n\tmemset(buf, 0, sizeof(buf));\n\tif ((numRead = recv(fd, buf, MAX_BUFFER_SIZE, 0)) <= 0)\n\t{\n\t\tprintf(\"Failed to receive response from this server\\n\");\n\t\t//closesocket(fd);\n\t\treturn -1;\n\t}\n\telse\n\t{\n\t\tif (strncmp(buf, \"HTTP/1.0 200\", 12)==0 || strncmp(buf, \"HTTP/1.1 200\", 12)==0)\n\t\t{\n\t\t\tprintf(\"Dll : DoNTLMv2: Successfully connected.\\n\");\n\t\t\treturn fd;\n\t\t}\n\t\telse if ((strncmp((char*)buf, \"HTTP/1.1 407\", strlen(\"HTTP/1.1 407\"))==0) ||\n\t\t\t\t (strncmp((char*)buf, \"HTTP/1.0 407\", strlen(\"HTTP/1.0 407\"))==0))\n\t\t{\n\t\t\t//closesocket(fd);\n\t\t\treturn LOCAL_PROXY_AUTH_FAIL;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//closesocket(fd);\n\t\t\treturn LOCAL_PROXY_AUTH_FAIL;\n\t\t}\n\t}\n\n\treturn -1;\n}\n\n\n"
  },
  {
    "path": "Bundles/Echoware/ProxyConnect/stdafx.cpp",
    "content": "// stdafx.cpp : source file that includes just the standard includes\n// ProxyConnect.pch will be the pre-compiled header\n// stdafx.obj will contain the pre-compiled type information\n\n#include \"stdafx.h\"\n\n// TODO: reference any additional headers you need in STDAFX.H\n// and not in this file\n"
  },
  {
    "path": "Bundles/Echoware/ProxyConnect/stdafx.h",
    "content": "// stdafx.h : include file for standard system include files,\n// or project specific include files that are used frequently, but\n// are changed infrequently\n//\n\n#pragma once\n\n#define WIN32_LEAN_AND_MEAN\t\t// Exclude rarely-used stuff from Windows headers\n\n// TODO: reference additional headers your program requires here\n"
  },
  {
    "path": "Bundles/Echoware/ProxyConnection.cpp",
    "content": "#include \"StdAfx.h\"\n#include \"proxyconnection.h\"\n#include \"dllproxyinfo.h\"\n#include \"ACConnection.h\"\n#include \"DataChannels.h\"\n#include \"DataChannel.h\"\n\nCProxyConnection::CProxyConnection(void)\n{\n}\n\nCProxyConnection::CProxyConnection(CDllProxyInfo* pProxyInfo)\n{\n\tm_pProxyInfo=pProxyInfo;\n\tm_pACConnection=new CACConnection(this);\n\n\tm_pDataChannels=new CDataChannels(pProxyInfo);\n\tm_nEncryptionLevel=1;\n}\n\nCProxyConnection::~CProxyConnection(void)\n{\n\tif (m_pProxyInfo)\n\t\tdelete m_pProxyInfo;\n\n\tdelete m_pACConnection;\n\n\tdelete m_pDataChannels;\n}\n\nCDllProxyInfo* CProxyConnection::GetProxyInfo()\n{\n\treturn m_pProxyInfo;\n}\n\nint CProxyConnection::Connect()\n{\n\tint nRet;\n\n\tm_critSection.Lock();\n\n\tnRet=m_pACConnection->Connect();\n\n\tm_critSection.Unlock();\n\n\treturn nRet;\n}\n\nbool CProxyConnection::Disconnect()\n{\n\tbool bRet;\n\n\tm_critSection.Lock();\n\n\tm_pDataChannels->RemoveAllDataChannels();\n\tbRet=m_pACConnection->Disconnect();\n\n\tm_critSection.Unlock();\n\n\treturn bRet;\n}\n\nvoid CProxyConnection::StopConnecting()\n{\n\tm_pACConnection->StopConnect();\n}\n\nvoid CProxyConnection::SetEncryptionLevel(int level)\n{\n\tm_critSection.Lock();\n\n\tm_nEncryptionLevel=level;\n\tm_pACConnection->SetEncryptionLevel(level);\n\n\tm_critSection.Unlock();\n}\n\nint CProxyConnection::EstablishNewDataChannel(char* IDOfPartner)\n{\n\tg_globals.m_logger.WriteFormated(\"CProxyConnection: EstablishNewDataChannel to partner %s\", IDOfPartner);\n\tg_globals.m_logger.Write(\"CProxyConnection: Find partner\");\n\n\tif (!m_pACConnection->FindPartner(IDOfPartner))\n\t{\n\t\tg_globals.m_logger.Write(\"CProxyConnection: Failed find partner\");\n\t\treturn 0;\n\t}\n\n\tg_globals.m_logger.Write(\"CProxyConnection: Success find partner\");\n\n\tg_globals.m_logger.WriteFormated(\"CProxyConnection: Connect to peer %s\", IDOfPartner);\n\n\tchar szChannelCode[12];\n\tchar szPeerPublicKey[RSA_PUBLIC_KEY*sizeof(unsigned int)+1];\n\n\tif (!m_pACConnection->ConnectToPeer(IDOfPartner, szChannelCode, szPeerPublicKey))\n\t{\n\t\tg_globals.m_logger.WriteFormated(\"CProxyConnection: Failed connect to peer %s\", IDOfPartner);\n\t\treturn 0;\n\t}\n\n\tg_globals.m_logger.WriteFormated(\"CProxyConnection: Success connect to peer %s\", IDOfPartner);\n\n\tbool bEncDec=false;\n\tif (m_nEncryptionLevel && strcmp(szPeerPublicKey, \"\")!=0)\n\t\tbEncDec=true;\n\t//****\n\t//bEncDec=false;\n\t//*****\n\n\tchar szSessionKey[1024];\n\n\tCDataChannel* pDataChannel=new CDataChannel(m_pDataChannels, szChannelCode,\n\t\t\t\t\t\t\t\tm_pACConnection->GenerateSessionKey(szSessionKey, szPeerPublicKey), bEncDec);\n\tm_pDataChannels->AddDataChannel(pDataChannel);\n\n\tunsigned int nPort=0;\n\tif (!pDataChannel->Listen(nPort))\n\t\treturn 0;\n\n\treturn nPort;\n}\n\nvoid CProxyConnection::OnError(int error)\n{\n\tg_globals.m_proxiesManager.ProxyError(m_pProxyInfo);\n}\n\nvoid CProxyConnection::OnRemotePartnerConnect(char* szDataChannelCode, char* IDOfPartner, char* szPeerPublicKey)\n{\n\tg_globals.m_logger.Write(\"=>OnRemotePartnerConnect\");\n\n\tbool bEncDec=false;\n\tif (m_nEncryptionLevel && strcmp(szPeerPublicKey, \"\") != 0)\n\t\tbEncDec=true;\n\t//*****\n\t//bEncDec=false;\n\t//*****\n\n\tchar szSessionKey[1024];\n\tCDataChannel* pDataChannel=new CDataChannel(m_pDataChannels, szDataChannelCode,\n\t\t\t\t\tm_pACConnection->GenerateSessionKey(szSessionKey, szPeerPublicKey), bEncDec);\n\n\n\tm_pDataChannels->AddDataChannel(pDataChannel);\n\n\tif (pDataChannel->ConnectEchoServer())\n\t{\n\t\tg_globals.m_logger.Write(\"OnRemotePartnerConnect success\");\n\t}\n\telse\n\t{\n\t\tg_globals.m_logger.Write(\"OnRemotePartnerConnect fail\");\n\t\tm_pDataChannels->RemoveDataChannel(pDataChannel);\n\t}\n\n\t//pDataChannel->ConnectLocalServer(g_globals.GetPortForOffLoadingData());\n\tg_globals.m_logger.Write(\"<=OnRemotePartnerConnect\");\n}\n"
  },
  {
    "path": "Bundles/Echoware/ProxyConnection.h",
    "content": "#ifndef _PROXCONNECTION_H\n#define _PROXCONNECTION_H\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n#include \"CritSection.h\"\n\nclass CDllProxyInfo;\nclass CACConnection;\nclass CDataChannels;\n\n//proxy connection class\nclass CProxyConnection\n{\npublic:\n\tCProxyConnection(void);\n\tCProxyConnection(CDllProxyInfo* pProxyInfo);\n\tvirtual ~CProxyConnection(void);\n\n\tint Connect();\n\tbool Disconnect();\n\tvoid StopConnecting();\n\n\t//sets the encryption level for this proxy connection\n\tvoid SetEncryptionLevel(int level);\n\n\tCDllProxyInfo* GetProxyInfo();\n\n\t//establish new data channel to partner\n\tint EstablishNewDataChannel(char* IDOfPartner);\n\n\tvoid OnError(int error);\n\n\t//the partner establish to me\n\tvoid OnRemotePartnerConnect(char* szDataChannelCode, char* IDOfPartner, char* szPeerPublicKey);\n\nprotected:\n\t//the proxy info\n\tCDllProxyInfo* m_pProxyInfo;\n\t//the authenticate channel connection\n\tCACConnection* m_pACConnection;\n\n\tCCritSection m_critSection;\n\tint m_nEncryptionLevel;\n\n\t//all data channels for this proxy connection(echoServer)\n\tCDataChannels* m_pDataChannels;\n};\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/README.txt",
    "content": "\n                     EchoWare OSX Bundle Version 1.926\n                          Released: 9 August 2007\n                      ===============================\n\nINTRODUCTION\n------------\nEchoWare is an OSX bundle that enables both client-server as\nwell as peer-to-peer applications to communicate with each other\nvia a \"relay server\" (aka, an \"echoServer\"). All communication\nbetween echoWare and the echoserver appears to be outgoing TCP\nfrom the point of view of the OSX network. This allows the\nechoWare-enabled applications to communicate with each other\nwithout either side of the connection needing to set or adjust\nany firewall or router's port-forwarding settings.\n\nEchoWare is utilized in both the Kaboodle \"Network Manager\nand Personal VPN application\", as well as in EchoVNC, a\nfirewall-friendly VNC Server and Viewer. For more details on\nthese projects, please visit our website at:\n\n   http://www.echogent.com/\n\nEchoWare includes software developed by the OpenSSL Project\nfor use in the OpenSSL Toolkit. (http://www.openssl.org/)\n\nLICENSE\n-------\nEchoWare is Copyright (C) 2004-2007 Echogent Systems, Inc.\nAll rights reserved.\n\nEchoWare is available for use under the open-source \"Sleepycat\"\nlicense. Details can be found in the LICENSE file. In general,\nthe Sleepycat license allows the binary to be freely included in\nany other open-source application. Any application wishing to\nremain closed-source must purchase a separate license from\nEchogent Systems, Inc, the owner of EchoWare.\n\nEchoWare(R) is a registered trademark of Echogent Systems, Inc.\n\nSOURCE\n------\nThe accompanying source code has been built and compiled using\nXCode 2.4.1 for Mac OSX with GCC 4 as the base compiler.\n\nCHANGELIST\n----------\n1.92    11-Nov-07\tInitial OSX release\n1.926   26-Jul-07\tAdded support for login character filtering\n\nENCRYPTION\n----------\nEchoWare's 128-bit AES encryption is enabled by the\nOpenSSL source-code. It is covered by the following\nCopyrights:\n\n   Copyright (c) 1998-2004 The OpenSSL Project\n   Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson\n\nPlease see openssl.org for information about their\nlicense and to contribute to their great efforts.\n\nTECH SUPPORT\n------------\nSupport for our Service Provider customers is available 24/7,\nvia phone or email.\n\nMailing list support is available for all users; you can find\nthose details on the EchoVNC homepage:\n\n  http://echovnc.sourceforge.net/fom-serve/cache/1.html\n\nWhen asking a tech-support question, be sure to include as much\ninformation about your computer and network as possible.\n\nThanks for using EchoWare!\n\nREV20070726SB\n"
  },
  {
    "path": "Bundles/Echoware/RFBBundleWrapper.cpp",
    "content": "/*\n *  RFBBundleWrapper.cpp\n *  Echoware\n *\n *  Created by admin on 4/11/07.\n *  Copyright 2007 __MyCompanyName__. All rights reserved.\n *\n */\n\n#include \"RFBBundleWrapper.h\"\n#include \"globals.h\"\n//#include \"ProxiesManager.h\"\n#import \"Echoware.h\"\n#import \"InterfaceDLLProxyInfo.h\"\n#import \"User.h\"\n#include \"EchoToOSX.h\"\n\n@interface NSString (EchoExtenstions2)\n\n- (NSData *) nullTerminatedData;\n\n@end\n\n@implementation NSString (EchoExtenstions2)\n\n- (NSData *) nullTerminatedData\n{\n\treturn [NSData dataWithBytes:[self lossyCString] length:[self cStringLength]+1];\n}\n\n@end\n\ntypedef void (*LoginNotificationCallBack)  (CFStringRef UserName, uid_t UID, gid_t GID);\ntypedef void (*LogoutNotificationCallBack) ();\n\nstruct LoginLogoutExtraInfoStructure\n{\n    LoginNotificationCallBack  loginFunctionToCall;\n    LogoutNotificationCallBack logoutFunctionToCall;\n};\n\nstatic void LoginFunction(CFStringRef UserName, uid_t UID, gid_t GID)\n{\n\tCRFBBundleWrapper::GetInstance()->UserDefaultsChecking();\n}\n\nstatic void LogoutFunction()\n{\n}\n\nstatic void LoginLogoutProxyCallBackFunction(SCDynamicStoreRef store, CFArrayRef changedKeys, void *info)\n{\n    #pragma unused (changedKeys)\n\n    CFStringRef  consoleUserName;\n    uid_t        consoleUserUID;\n    gid_t        consoleUserGID;\n\n    struct LoginLogoutExtraInfoStructure* loginLogoutCallbackInfo = (struct LoginLogoutExtraInfoStructure*) info;\n    LoginNotificationCallBack loginFunctionToCall = loginLogoutCallbackInfo->loginFunctionToCall;\n    LogoutNotificationCallBack logoutFunctionToCall = loginLogoutCallbackInfo->logoutFunctionToCall;\n\n    consoleUserName = SCDynamicStoreCopyConsoleUser(store, &consoleUserUID, &consoleUserGID);\n\n    if (consoleUserName != NULL) //Now if the username is non-null then we know that someone just logged in.\n\t\t\t\t\t\t\t\t //In this case call the login notification function.\n    {\n\t\tif (loginFunctionToCall)\n\t\t\tloginFunctionToCall(consoleUserName, consoleUserUID, consoleUserGID);\n\n        CFRelease(consoleUserName);\n\t}\n    else\t\t\t\t\t\t//Console username is null which means logout just occurred.\n\t\t\t\t\t\t\t\t//Thus call the logout function instead.\n    {\n\t\tif (logoutFunctionToCall)\n\t\t\tlogoutFunctionToCall();\n    }\n}\n\nstatic int InstallLoginLogoutNotifiers(\n\t\t\tconst CFStringRef StringDescribingYourApplication,\n\t\t\tconst LoginNotificationCallBack YourLoginNotificationFunction,\n\t\t\tconst LogoutNotificationCallBack YourLogoutNotificationFunction,\n\t\t\tCFRunLoopSourceRef* RunloopSourceReturned)\n{\n    CFStringRef SCDebuggingString = NULL;\n    SCDynamicStoreContext DynamicStoreContext =\n                                    { 0, NULL, NULL, NULL, NULL };\n    SCDynamicStoreRef DynamicStoreCommunicationMechanism = NULL;\n    CFStringRef KeyRepresentingConsoleUserNameChange = NULL;\n    CFMutableArrayRef ArrayOfNotificationKeys;\n    Boolean Result;\n    struct LoginLogoutExtraInfoStructure* LoginLogoutCallBackFunctionInfo;\n\n    // --- Setting return variables to known values --- */\n    *RunloopSourceReturned = NULL;\n\n    // --- Checking input arguments to ensure they are valid --- //\n    //Checking the login and logout functions passed to make sure they\n    //are valid (i.e. not null).\n    if ((YourLoginNotificationFunction == NULL) ||\n        (YourLogoutNotificationFunction == NULL))\n    {\n        return(-1); //Invalid arguments passed.  Returning error\n    }\n\n    /* The StringDescribingYourApplication is actually just a\n     * System Configuration framework debugging string.\n     * The string does not need to be unique or even present.  However, if\n     * NULL is passed to this function\n     * we will insert empty string for the debugging string.\n     */\n    if (StringDescribingYourApplication == NULL)\n    {\n        //Since passed null as the debugging string we assume an\n        //'empty' string for the debugging string.\n        SCDebuggingString = CFSTR(\"\");\n    }\n    else\n    {\n        /* Since a actual string was passed we will use it as the debugging\n         * string.  We create copy of the string passed in using\n         * CFStringCreateCopy.\n         * First Argument: Allocator to use.  We want\n         *     default as usual so pass null.\n         * Second Argument: The string to be duplicated.  In this case we\n         *     use the string passed in.\n         * Return Value: The new copy of the CFString in the\n         *     second argument\n         */\n        SCDebuggingString = CFStringCreateCopy(NULL,\n                    StringDescribingYourApplication);\n    }\n\n    if (SCDebuggingString == NULL)\n    {\n        //Since error creating debugging string we assume an\n        //'empty' string for the debugging string.\n        SCDebuggingString = CFSTR(\"\");\n    }\n\n    // --- Creating Dynamic Store Context --- //\n\n    /* Before we create the DynanicStoreCommunicationMechanism we will create\n     * the context information.  The context information we will store\n     * and will be passed to the LoginLogoutCallbackFunction is the login\n     * and logout callbacks which it should call.  We put this information\n     * in a SCDynamicStoreContext variable which will be added to the new\n     * dynamic store.  First step is to allocate the strucutre to put in the\n     * dynamicStoreContext.\n     * Note that we can't deallocate this since it will be pointed to from\n     * the dynamic store itself and used in subsiquent callbacks.\n     */\n     LoginLogoutCallBackFunctionInfo =\n                    (LoginLogoutExtraInfoStructure*)malloc(sizeof(struct LoginLogoutExtraInfoStructure));\n\n     if (LoginLogoutCallBackFunctionInfo == NULL)\n     {\n        //if were unable to allocate strucutre to hold login/logout callback\n        //information then give up here.\n        return(-3);\n     }\n\n    /* Now adding the callback information passed to this function to the\n     * \"LoginLogoutExtraInfoStructure\".  This will then be added to the\n     * dynamic store context.\n     */\n\n    LoginLogoutCallBackFunctionInfo->loginFunctionToCall =\n                                   YourLoginNotificationFunction;\n\n\n    LoginLogoutCallBackFunctionInfo->logoutFunctionToCall =\n                                   YourLogoutNotificationFunction;\n\n\n    /* Now adding the allocated structure to the dynamic store context.  This\n     * context will be added to the dynamic store when it is created\n     */\n\n    DynamicStoreContext.info = (void*) LoginLogoutCallBackFunctionInfo;\n\n    // --- Setting up notification with SystemConfiguration framework --- //\n\n    /* The next step is to set up the notification with the\n     * system configuration framework.  The first step is to create\n     * a dynamic store.  The dynamic store is used to communicate with the\n     * system configuration framework.  Create dynamic store with a\n     * SCDynamicStoreCreate call.\n     *\n     * First Argument: Allocator to use.  As usual we want default\n     *     allocator so pass null.\n     * Second Argument: Before calling this must be a CFString to use as\n     *     the debugging string in a debugging session.  This will be the\n     *     same string passed into this function to describe the\n     *     application or just an empty string.\n     * Third Argument: This is the function which will be called whenever\n     *     a key in the dynamic store changes.  We have a proxy function\n     *     which will get called whenever the console username changes.\n     *     The name change will happen when a new user logs in or out.\n     *     Thus the proxy function gets called any login or logout.  The\n     *     proxy function will in turn call the given Login/Logout\n     *     functions passed to this function.\n     * Forth Argument: The dynamic store context information to be used\n     *        when creating the dynamic store.\n     * Return Value: A mechanism used to comminicate with the dynamic\n     * store and the system configuration framework.  This will be used\n     * in later System Configuration calls.  Note this value must be\n     * released later with CFRelease.\n     */\n    DynamicStoreCommunicationMechanism = SCDynamicStoreCreate\n        (NULL, SCDebuggingString, LoginLogoutProxyCallBackFunction,\n        &DynamicStoreContext);\n        //After creating the dynamic store we are done with the\n        //debugging string.  Thus, releasing now.\n        CFRelease(SCDebuggingString);\n\n    if (DynamicStoreCommunicationMechanism == NULL)\n    {\n        //if DynamicStoreCommunicationMechanism is null then\n        //were unable to create communication mechanism.  Fail here.\n        return(-2); //unable to create dynamic store.\n    }\n\n    /* Now we have a dynamic store communication mechanism we will need\n     * to get the keys with which we want to get notified upon.  There is\n     * actually only one key in this case which is the console username.\n     * We get the console username key using the call\n     * SCDynamicStoreKeyCreateConsoleUser.\n     *\n     * Return Value: A key representing we want to be notified of\n     *     console user name changes.\n     *        Note that the return value has to be released.\n     */\n    KeyRepresentingConsoleUserNameChange =\n                    SCDynamicStoreKeyCreateConsoleUser(NULL);\n\n    if (KeyRepresentingConsoleUserNameChange == NULL)\n    //Note: if key is null we fail.\n    {\n        CFRelease(DynamicStoreCommunicationMechanism);\n        //releasing allocated memory before giving up.\n        return(-4);\n    }\n\n    // --- creating array of notification keys --- //\n    /* Now that we have the console user key which is the key we will\n     * be notifing upon we need to place the\n     * key into an array.  This is because the System Configuration\n     * framework expects all lists of keys to be in an array.  Thus we\n     * will create an array for the occasion then place the key inside\n     * of it.  We create the array with CFArrayCreateMutable.\n     * First Argument: Allocator to use.  As usual we want default\n     *     allocator so pass null.\n     * Second Argument: The number of items which will be in the array.\n     *     In this case we only have one key so the size will be one.\n     * Third Argument: The type of retain/release methods to use with the\n     *     data.  In this case we are using normal Core Foundation types\n     *     which means default CFArray behavior will do.  Thus, as\n     *     retain/release behavior we pick kCFTypeArrayCallBacks which\n     *     represents the normal retain/release for an CFArray.\n     * Return Value: An empty CFArray.  This is the array which will\n     *     hold the notification keys.  Note the CFArray must be released.\n     */\n    ArrayOfNotificationKeys = CFArrayCreateMutable\n                (NULL, (CFIndex)1, &kCFTypeArrayCallBacks);\n\n        /* error creating CFArray of notification keys. */\n    if (ArrayOfNotificationKeys == NULL)\n    {\n        CFRelease(DynamicStoreCommunicationMechanism);\n        //releasing allocated memory before giving up.\n        CFRelease(KeyRepresentingConsoleUserNameChange);\n        return(-5);\n    }\n\n    /* Now that we have our empty array we need to add the notification\n     * key to it.  We do this using CFArrayAppendValue\n     * First Argument: The CFArray which will have an item appended to it.\n     * Second Argument: Key which will be added to CFArray.  The key is\n     * represented as CFString.\n     * No return value\n     */\n    CFArrayAppendValue(ArrayOfNotificationKeys,\n                    KeyRepresentingConsoleUserNameChange);\n\n    /* Now that we have an array repesenting the values to notify upon\n     * we will add this information to the dynamic store.  This way we\n     * can create a CFRunloop source based upon the notification key\n     * chosen.  In this case the notification key was the console\n     * user change.  We add the notification keys to the\n     * dynamic store with the call SCDynamicStoreSetNotificationKeys\n     * First Argument: Dynamic store to add this information to.\n     *     This is the dynamic store we obtained earlier.\n     * Second Argument: The Array of notification keys.  In this case\n     *     the single key representing any change in console user.\n     * Third Argument: Any regex keys to be monitored.  In this case we\n     *     already have all our keys we need from the array.  Thus this\n     * value can be NULL since we don't need any other keys.\n     * Return Value: A boolean representing if operation was successful\n     * (true) or unsuccessful (false).\n     */\n     Result = SCDynamicStoreSetNotificationKeys(\n     DynamicStoreCommunicationMechanism, ArrayOfNotificationKeys, NULL);\n\n     //Done with notification keys array so release\n     CFRelease(ArrayOfNotificationKeys);\n     //done with notification key so release.\n     CFRelease(KeyRepresentingConsoleUserNameChange);\n\n     if (Result == FALSE) //unable to add keys to dynamic store.\n     {\n            //releasing allocated memory before giving up.\n        CFRelease(DynamicStoreCommunicationMechanism);\n        return(-6);\n     }\n\n     /* Now we are creating the CFRunloopSource which we will return on\n      * this function.  This run loop source when inserted in your run loop\n      * will cause your notification functions to get called via the\n      * 'proxy' notification function.  We create the RunLoopSource\n      * using the call SCDynamicStoreCreateRunLoopSource.\n      *\n      * First Argument: Allocator to use.   As usual we want default\n      *     allocator so pass null.\n      * Second Argument: The dynamic store which to base the run loop\n      *     source upon.  We have already created a dynamic store which\n      *     will notify on console user changes.  This will be the dynamic\n      *     store the run loop source is based upon.\n      * Third Argument: The 'order' of the CFRunloop source.  We want\n      *     default behavior here too so pass zero.\n      * Return value: the run loop source created.  Note that the\n      *     return value must eventually be released.\n      */\n    *RunloopSourceReturned = SCDynamicStoreCreateRunLoopSource\n                (NULL, DynamicStoreCommunicationMechanism, (CFIndex) 0);\n\n\treturn 0;\n}\n\nstatic CRFBBundleWrapper* instance = NULL;\n\nCRFBBundleWrapper::CRFBBundleWrapper()\n{\n\trfb_port = 0;\n\tis_rfb = false;\n}\n\nCRFBBundleWrapper::~CRFBBundleWrapper()\n{\n\trfb_port = 0;\n\tis_rfb = false;\n}\n\nbool CRFBBundleWrapper::canWriteToFile(NSString *path)\n{\n    if ([[NSFileManager defaultManager] fileExistsAtPath:path])\n        return [[NSFileManager defaultManager] isWritableFileAtPath:path];\n    else\n        return [[NSFileManager defaultManager] isWritableFileAtPath:[path stringByDeletingLastPathComponent]];\n}\n\nvoid CRFBBundleWrapper::loadProxyFields(NSUserDefaults* suDefaults)\n{\n\tstatic id proxyStringsDictionary = nil;\n\n\tNSString *proxyAddrString = [suDefaults stringForKey:@\"EchoProxyAddr\"];\n\tNSString *proxyPortString = [suDefaults stringForKey:@\"EchoProxyPort\"];\n\tNSString *proxyUserString = [suDefaults stringForKey:@\"EchoProxyUser\"];\n\tNSString *proxyPassString = [suDefaults stringForKey:@\"EchoProxyPass\"];\n\n\t// Load to EchoWare\n\tif ([proxyAddrString length] && [proxyPortString intValue])\n\t{\n\t\t[proxyStringsDictionary release];\n\t\tproxyStringsDictionary = [[NSMutableDictionary alloc] init];\n\n\t\t[proxyStringsDictionary setObject:[proxyAddrString nullTerminatedData] forKey:@\"EchoProxyAddr\"];\n\t\t[proxyStringsDictionary setObject:[proxyPortString nullTerminatedData] forKey:@\"EchoProxyPort\"];\n\n\t\tif (proxyUserString)\n\t\t\t[proxyStringsDictionary setObject:[proxyUserString nullTerminatedData] forKey:@\"EchoProxyUser\"];\n\t\telse\n\t\t\t[proxyStringsDictionary setObject:[@\"\" nullTerminatedData] forKey:@\"EchoProxyUser\"];\n\n\t\tif (proxyPassString)\n\t\t\t[proxyStringsDictionary setObject:[proxyPassString nullTerminatedData] forKey:@\"EchoProxyPass\"];\n\t\telse\n\t\t\t[proxyStringsDictionary setObject:[@\"\" nullTerminatedData] forKey:@\"EchoProxyPass\"];\n\n\t\tSetLocalProxyInfo((char *) [[proxyStringsDictionary objectForKey:@\"EchoProxyAddr\"] bytes],\n\t\t\t\t\t\t  (char *) [[proxyStringsDictionary objectForKey:@\"EchoProxyPort\"] bytes],\n\t\t\t\t\t\t  (char *) [[proxyStringsDictionary objectForKey:@\"EchoProxyUser\"] bytes],\n\t\t\t\t\t\t  (char *) [[proxyStringsDictionary objectForKey:@\"EchoProxyPass\"] bytes]);\n\t}\n}\n\nvoid CRFBBundleWrapper::loadServerList(NSUserDefaults* suDefaults)\n{\n\tg_globals.m_proxiesManager.DisconnectAllProxies();\n\tg_globals.m_proxiesManager.RemoveAllProxies();\n\n\tNSEnumerator *echoEnum = [[suDefaults objectForKey:@\"EchoServers\"] objectEnumerator];\n\tNSMutableDictionary *echoDict = nil;\n\n\twhile (echoDict = [[[echoEnum nextObject] mutableCopy] autorelease])\n\t{\n\t\tIDllProxyInfo* proxyInfo = (IDllProxyInfo*)CreateProxyInfoClassObject();\n\n\t\t[echoDict setObject:[[[echoDict objectForKey:@\"IPAddress\"] nullTerminatedData] retain] forKey:@\"IPAddress_cStringData\"];\n\t\tproxyInfo->SetIP((const char *)[[echoDict objectForKey:@\"IPAddress_cStringData\"] bytes]);\n\n\t\tif ([echoDict objectForKey:@\"Port\"])\n\t\t{\n\t\t\t[echoDict setObject:[[[echoDict objectForKey:@\"Port\"] nullTerminatedData] retain] forKey:@\"Port_cStringData\"];\n\t\t\tproxyInfo->SetPort((const char *)[[echoDict objectForKey:@\"Port_cStringData\"] bytes]);\n\t\t}\n\t\telse\n\t\t\tproxyInfo->SetPort(\"1328\");\n\n\t\tif ([echoDict objectForKey:@\"User\"])\n\t\t{\n\t\t\t[echoDict setObject:[[[echoDict objectForKey:@\"User\"] nullTerminatedData] retain] forKey:@\"User_cStringData\"];\n\t\t\tproxyInfo->SetMyID((char *)[[echoDict objectForKey:@\"User_cStringData\"] bytes]);\n\t\t}\n\n\t\tif ([echoDict objectForKey:@\"Pass\"])\n\t\t{\n\t\t\t[echoDict setObject:[[[echoDict objectForKey:@\"Pass\"] nullTerminatedData] retain] forKey:@\"Pass_cStringData\"];\n\t\t\tproxyInfo->SetPassword((const char *)[[echoDict objectForKey:@\"Pass_cStringData\"] bytes]);\n\t\t}\n\n\t\tg_globals.m_logger.Write(\"\");\n\t\tg_globals.m_logger.WriteFormated(\"IP: %s\", proxyInfo->GetIpPort());\n\t\tg_globals.m_logger.WriteFormated(\"User: %s\", proxyInfo->GetMyID());\n\n\t\tSetEncryptionLevel(1, proxyInfo);\n\n\t\tproxyInfo->SetReconnectProxy(false);\n\t\tint connectResult = ConnectProxy(proxyInfo);\n\t\tswitch (connectResult)\n\t\t{\n\t\t\tcase 0:\n\t\t\t\tg_globals.m_logger.Write(\"Status: Connected\");\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tg_globals.m_logger.Write(\"Status: No Server Avail\");\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tg_globals.m_logger.Write(\"Status: Auth Failed\");\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tg_globals.m_logger.Write(\"Status: Already Active\");\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tg_globals.m_logger.Write(\"Status: Timed Out\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tg_globals.m_logger.Write(\"Status: Unknown Return Code\");\n\t\t\t\tbreak;\n\t\t}\n\t\tproxyInfo->SetReconnectProxy(true);\n\t}\n}\n\nvoid CRFBBundleWrapper::loadLoggingOptions(NSUserDefaults* suDefaults)\n{\n\tNSString *bundle_path = [[NSBundle mainBundle] bundlePath];\n\n\tNSArray *logFiles = [NSArray arrayWithObjects:\n\t\t@\"/var/log/OSXvnc-server.log\",\n\t\t@\"~/Library/Logs/OSXvnc-server.log\",\n\t\t@\"/tmp/OSXvnc-server.log\",\n\t\t[bundle_path stringByAppendingPathComponent:@\"OSXvnc-server.log\"],\n\t\t[suDefaults stringForKey:@\"LogFile\"],\n\t\tnil];\n\tNSEnumerator *logEnumerators = [logFiles objectEnumerator];\n\t// Find first writable location for the log file\n\tNSString *logFile = nil;\n\twhile (logFile = [logEnumerators nextObject])\n\t{\n\t\tlogFile = [logFile stringByStandardizingPath];\n\t\tif ([logFile length] && canWriteToFile(logFile))\n\t\t{\n\t\t\t[logFile retain];\n\t\t\tbreak;\n\t\t}\n\t}\n\tNSLog(logFile);\n\t//\n\n\t//converto from NSString to char*\n\tint len_logFile = [logFile length];\n\tchar pLogFile[len_logFile + 1];\n\tstrncpy(pLogFile, [logFile cString], len_logFile);\n\tpLogFile[len_logFile] = '\\0';\n\t//\n\n\tbool enableLog = [suDefaults boolForKey:@\"EnableLogging\"];\n\tSetLoggingOptions(enableLog, pLogFile);\n}\n\nbool CRFBBundleWrapper::UserDefaultsChecking()\n{\n\tBOOL result = FALSE;\n\n\tNSArray *args = [[NSProcessInfo processInfo] arguments];\n\tint argumentIndex = [args indexOfObject:@\"-donotloadproxy\"];\n\tif (argumentIndex != NSNotFound)\n\t\treturn result;\n\n\tNSString *username = CUser::CurrentConsoleUsername();\n\tif (!username)\n\t\treturn result;\n\n\tCUser user(username);\n\t[username release];\n\n\tuid_t old_uid = geteuid();\n\t[NSUserDefaults resetStandardUserDefaults];\n\tseteuid(user.uid());\n\n\tNSUserDefaults *suDefaults = user.userDefaults(@\"OSXvnc\");\n\n\tloadLoggingOptions(suDefaults);\n\n\tg_globals.m_logger.Write(\"Load echo servers.\");\n\tif (InitializeProxyDll())\n\t{\n\t\tSetPortForOffLoadingData(rfb_port);\n\n\t\tloadProxyFields(suDefaults);\n\t\tloadServerList(suDefaults);\n\t}\n\telse\n\t{\n\t\tg_globals.m_logger.Write(\"Proxy DLL can not be initialized.\");\n\t}\n\tresult = TRUE;\n\n\t[NSUserDefaults resetStandardUserDefaults];\n\tseteuid(old_uid);\n\n\treturn result;\n}\n\nint CRFBBundleWrapper::doInstall()\n{\n\tif (is_rfb)\n\t{\n\t\tCFRunLoopSourceRef testRunloopSource = NULL;\n\n\t\tint result = InstallLoginLogoutNotifiers(\n\t\t\t\tCFSTR(\"This is my crazy program\"), LoginFunction,\n\t\t\t\tLogoutFunction, &testRunloopSource);\n\n\t\tif (result != 0)\n\t\t\treturn 1; //give up since could not install notifier.\n\n\t\tCFRunLoopAddSource(CFRunLoopGetCurrent(), testRunloopSource, kCFRunLoopDefaultMode);\n\t\tCFRelease(testRunloopSource);\n\t\tCFRunLoopRun();\n\t}\n\n    return 0;\n}\n\nCRFBBundleWrapper* CRFBBundleWrapper::GetInstance()\n{\n\tif (!instance)\n\t\tinstance = new CRFBBundleWrapper();\n\treturn instance;\n}\n\nvoid CRFBBundleWrapper::FreeInstance()\n{\n\tif (instance)\n\t\tdelete instance;\n\tinstance = NULL;\n}\n\nunsigned long CRFBBundleWrapper::RunLoopThreadProc(void* lpParameter)\n{\n\tCRFBBundleWrapper *rfb = (CRFBBundleWrapper*)lpParameter;\n\tif (rfb)\n\t\trfb->doInstall();\n\treturn 0;\n}\n\nvoid CRFBBundleWrapper::startRunLoop()\n{\n\tvoid* m_hThread;\n\tunsigned long m_dwThread;\n\n\tm_hThread = CreateThread(0, 0, RunLoopThreadProc, this, 0, &m_dwThread);\n}\n"
  },
  {
    "path": "Bundles/Echoware/RFBBundleWrapper.h",
    "content": "/*\n *  RFBBundleWrapper.h\n *  Echoware\n *\n *  Created by admin on 4/11/07.\n *  Copyright 2007 __MyCompanyName__. All rights reserved.\n *\n */\n\n#import <Cocoa/Cocoa.h>\n\n#include <CoreFoundation/CoreFoundation.h>\n#include <SystemConfiguration/SystemConfiguration.h>\n\nclass CRFBBundleWrapper\n{\n\tprivate:\n\tpublic:\n\t\tbool is_rfb;\n\t\tint rfb_port;\n\n\t\tCRFBBundleWrapper();\n\t\tvirtual ~CRFBBundleWrapper();\n\n\t\tbool canWriteToFile(NSString *path);\n\t\tvoid loadProxyFields(NSUserDefaults* suDefaults);\n\t\tvoid loadServerList(NSUserDefaults* suDefaults);\n\t\tvoid loadLoggingOptions(NSUserDefaults* suDefaults);\n\t\tbool UserDefaultsChecking();\n\t\tint doInstall();\n\t\tvoid startRunLoop();\n\n\t\tstatic CRFBBundleWrapper* GetInstance();\n\t\tstatic void FreeInstance();\n\t\tstatic unsigned long RunLoopThreadProc(void* lpParameter);\n};"
  },
  {
    "path": "Bundles/Echoware/RSA/Code.cpp",
    "content": "#include \"stdafx.h\"\n//#include <mem.h>\n#include <string.h>\n\n#include \"HNumber.h\"\n#include \"GSimply.h\"\n#include \"Operator.h\"\n#include \"HNFunct.h\"\n\nint Encode(unsigned char *msg, int msgLen, HugeNumber &FirstHalf, HugeNumber &SecondHalf)\n// function returns:\n// 1 - OK\n// 0 - failure\n{\n   int i,n,k,j;\n   //char buf[11];\n   HugeNumber x,y;\n   unsigned long CheckSum;\n\n   // Count check sum\n   CheckSum=msgLen;\n   for (i=0; i<msgLen; i++) CheckSum+=msg[i];\n\n   k=0;\n   n=msgLen*2;\n   for (i=0; i<n; i++)\n   {\n      j=msg[i/2];\n      if (i%2==0)\n         x.digit[k]=(x.digit[k]<<4)+(j>>4);\n      else\n         x.digit[k]=(x.digit[k]<<4)+(j&0xF);\n      if (i%3==2) k++;\n   };\n   if (i%3==1) x.digit[k]=x.digit[k]<<8;\n   if (i%3==2) x.digit[k]=x.digit[k]<<4;\n   if (i%3!=0) k++;\n   x.digit[k++]=msgLen/base;\n   x.digit[k++]=msgLen%base;\n   x.digit[k++]=CheckSum%base;\n\n   if (SecondHalf<=x) return 0;   // Message is too long for encoding\n\n   ModPower(y,x,FirstHalf,SecondHalf);\n   y.ToStr((char*)msg,2222);\n   return 1;\n};\n\nint Decode(unsigned char *msg, int &msgLen, HugeNumber &FirstHalf, HugeNumber &SecondHalf)\n// function returns:\n// 1 - OK\n// 0 - failure\n{\n   int i,n,k,j;\n   //char buf[11];\n   HugeNumber x,y;\n   unsigned long CheckSum;\n   unsigned long testCheckSum;\n\n   y=(char*)msg;\n   if (SecondHalf<=y) return 0;   // Message is too long for decoding\n\n   ModPower(x,y,FirstHalf,SecondHalf);\n\n   j=k=0;\n   memset(msg,0,2222);\n   n=x.Razr();\n   // Restore message's length in bytes\n   msgLen=x.digit[n-3];\n   msgLen=msgLen*base+x.digit[n-2];\n   // Restore message's chech sum\n   testCheckSum=x.digit[n-1];\n\n   n=msgLen*2;\n   for (i=0; i<n; i++)\n   {\n      if (i%3==0)\n         j=(j<<4)+((x.digit[k]>>8)&0xF);\n      else if (i%3==1)\n         j=(j<<4)+((x.digit[k]>>4)&0xF);\n      else\n      {\n         j=(j<<4)+(x.digit[k]&0xF);\n         k++;\n      };\n\n      if (i%2==1)\n      {\n         msg[i/2]=j;\n         j=0;\n      };\n   };\n\n   // Count check sum\n   CheckSum=msgLen;\n   for (i=0; i<msgLen; i++) CheckSum+=msg[i];\n\n   if (testCheckSum!=CheckSum%base) return 0;\n   return 1;\n};\n\n\n"
  },
  {
    "path": "Bundles/Echoware/RSA/Commonf.cpp",
    "content": "// General purpose functions\n#include \"stdafx.h\"\n//#include <conio.h>\n#include <math.h>\n#include <string.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <time.h>\n#include \"MyTypes.h\"\n\nextern time_t MakePrimeL_Time;\nextern time_t LongIsPrime_Time;\n\nvoid randomize()\n// Initialization of the random-number generator.\n// It is added for compatibility with Borland C ++ Builder\n{\n   /* Seed the random-number generator with current time so that\n     the numbers will be different every time we run.\n    */\n   srand( (unsigned)time( NULL ) );\n};\n\nlong int random(long int ULimit)\n// Generates a random number in the range 0..ULimit\n// It is added for compatibility with Borland C ++ Builderr\n{\n\treturn (long int)(double(rand())/RAND_MAX*ULimit);\n};\n\nword wmin(word a, word b)\n{\n\tif (a<b)\n\t\treturn a;\n\telse\n\t\treturn b;\n};\n\nword wmax(word a, word b)\n{\n\tif (a>b)\n\t\treturn a;\n\telse\n\t\treturn b;\n};\n\nint LongIsPrime(unsigned long a)\n{\n   time_t t1=clock();\n\tunsigned long b,i;\n\n\tif (a%2==0)\n   {\n      LongIsPrime_Time+=clock()-t1;\n      return 0;\n   }\n\tb=(unsigned long)(sqrt(a))+1;\n\tfor (i=3; i<b; i+=2)\n\t{\n\t\tif (a%i==0)\n      {\n         LongIsPrime_Time+=clock()-t1;\n         return 0; // The tested number is compound\n      }\n\t};\n\n   LongIsPrime_Time+=clock()-t1;\n\treturn 1; // The tested number is prime\n};\n\nunsigned long MakePrimeL()\n// Generation of a random prime number\n{\n   time_t t1=clock();\n\tunsigned long a;\n\n   a=random(5000); // MaxRazr>8200*(lg3/lg16)\n\tfor (;;)\n\t{\n\t\tif (LongIsPrime(a)) break;\n      a++;\n\t};\n   MakePrimeL_Time+=clock()-t1;\n\treturn a;\n};\n/*\nvoid Error(char *msg)\n{\n\tprintf(\"\\n%s\\n\",msg);\n\tabort();\n};\n*/\n"
  },
  {
    "path": "Bundles/Echoware/RSA/Commonf.h",
    "content": "// General purpose functions\n#ifndef __CommonF_H\n#define __CommonF_H\n\n#include <stdio.h>\n#include \"MyTypes.h\"\n#include \"HNumber.h\"\n\nextern void Error(const char *msg);\nextern word wmin(word a, word b);\nextern word wmax(word a, word b);\nextern void Close();\nextern int LongIsPrime(unsigned long a);\nextern unsigned long MakePrimeL();\nextern void Error(char *msg);\n\n#endif\n"
  },
  {
    "path": "Bundles/Echoware/RSA/Function.h",
    "content": "#ifndef __FUNCTION_H\n#define __FUNCTION_H\n\n#include \"HNumber.h\"\nextern int LL(HugeNumber &q);\n//extern word NOD(unsigned long uu, unsigned long vv);\n//extern int SimplyN(word k);\n//extern word SNumber(word k0);\nextern HugeNumber FastPower(HugeNumber &a, HugeNumber &b);\nextern HugeNumber Pow2m1(HugeNumber &q);\n//extern void Error();\n#endif\n"
  },
  {
    "path": "Bundles/Echoware/RSA/Gsimply.cpp",
    "content": "/*\nPrograms of the superbig random numbers generation.\n\nIgorSharov@rambler.ru\n*/\n#include \"stdafx.h\"\n//#include <conio.h>\n#include <math.h>\n#include <string.h>\n#include <time.h>\n\n#include \"HNumber.h\"\n#include \"HNfunct.h\"\n#include \"commonf.h\"\n#include \"operator.h\"\n#include \"GSimply.h\"\n#include \"MyPrint.h\"\n#include \"Profiler.h\"\n\n// For measurement of an operating time of the program\nextern time_t GeneratePrimeHugeNumber_Time;\nextern time_t GeneratePrime_Time;\nextern time_t DeleteN_Time;\nextern time_t Razl_Time;\nextern time_t Construction_Time;\nextern time_t Test_Time;\n\nextern int Test2(HugeNumber &x);\n\nunsigned long *N=NULL;\t// Decomposition of number p-1 on prime multipliers\nint N_size=0; \t\t\t\t// Dimension of N\nint N_size_max=0;\nint N_razr=22;\n\n#define razr_default DeltaIndex\n#define MaxRepeat 555\t// Amount of attempts of multiplier's selection\n\n\nint WasRandomized=0;\nextern int Rabin(int t, HugeNumber &S, HugeNumber &m, HugeNumber &mm1);\nextern void randomize();\n\nvoid PutInList(unsigned long i)\n{\t//  To bring number 'i' in the list of prime multipliers\n\tif (N==NULL)\n\t{\n\t\tN_size_max=razr_default;\n\t\tN=(unsigned long*)malloc(N_size_max*sizeof(unsigned long));\n\t\tif (N==NULL)\n\t\t{\n\t\t\tprintf(\"\\nNot enough memory in PutInList\"); exit(0);\n\t\t};\n\t\tN_size=0;\n\t}\n\telse\n\t{\n\t\tif (N_size==N_size_max)\n\t\t{\n\t\t\tN_size_max+=razr_default;\n\t\t\tN   =(unsigned long*)realloc(N,   N_size_max*sizeof(unsigned long));\n\t\t\tif (N==NULL)\n\t\t\t{\n\t\t\t\tprintf(\"\\nNot enough memory in PutInList\"); exit(0);\n\t\t\t};\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (N_size>N_size_max)\n\t\t\t{\n\t\t\t\tprintf(\"Internal error: N_size is great then N_size_max\"); exit(0);\n\t\t\t};\n\t\t};\n\t};\n\tN[N_size++]=i;\n};\n\nvoid Razl(unsigned long y)\n// Decomposition of number 'y' on prime multipliers\n{\n   time_t t1=clock();\n\tlong i,n;\n\tchar flag;\t// The 'flag' will be equal 'Y' if even one divisor is found.\n\t\t\t\t\t// Otherwise the flag will be equal 'N'.\n\n\tfor (flag='Y'; flag=='Y'; )\n\t{\t// We shall leave from this cycle when we find out that the tested\n\t\t// number has no any prime divider.\n\t\tflag='N';\n\t\tn=(long)(sqrt(y))+1;\n\t\t// We divide tested number by 2,3, ... y^0.5+1\n\t\tfor (i=2; i<=n; i++)\n\t\t{\n\t\t\tif (y%i==0)\n\t\t\t{\t// i divides y without the remainder\n\t\t\t\t// Whether is i a prime number?\n\t\t\t\tif (LongIsPrime(i))\n\t\t\t\t{\t// Put number 'i' in the list of prime multipliers of 'y'\t\t\t\t\tPutInList(i);\n\t\t\t\t\ty=y/i;\n\t\t\t\t\tflag='Y';\n\t\t\t\t\tbreak;\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n\t// The number 'y' does not have any prime divisor.\n\t// Put number y in the list of prime multipliers\n\tif (y!=1) PutInList(y);\n   Razl_Time+=clock()-t1;\n};\n\nint PrimeQ(HugeNumber &km1,HugeNumber &k)\n// This function returns:\n//   1 if the number k MAY BE simple\n//   0 if the number is compound\n{\n\tHugeNumber x;\n\n\tModPower(x,three,km1,k);\n\n\tif (x==one)\n\t\treturn 1;\n\telse\n\t\treturn 0;\n};\n\nvoid DeleteN()\n{\n   time_t t1=clock();\n\n\tif (N!=NULL)\n\t{\n\t\tfree(N); N=NULL;\n\t\tN_size=0;\n\t};\n   DeleteN_Time+=clock()-t1;\n};\n\nint GeneratePrime(HugeNumber &p)\n//\tGenerates prime number 'p' on the basis of prime numbers N [*]\n//\tIf function can not generate simple number, it returns 0.\n//\tFunction returns 1 if the prime number is generated.\n// Knuth vol2 page 420 (?)\n{\n\tHugeNumber x,pm1,y,tmp,z;\n\tint i,j,intTmp;\n\tunsigned long b;\n   time_t t1=clock();\n   time_t t2;\n\n   Protocol(\"Let's try to construct huge prime from small prime's set.\");\n   t2=clock();\n   y=N[0];\n\tfor (i=1; i<N_razr; i++)\n   {\n      Mult1(y,N[i],tmp); y=tmp;\n   };\n   // N[] - set of small prime numbers\n   // y == N[0]*N[1]*...*N[N_razr-1]\n\tx=two;\n\tfor (i=0;i<MaxRepeat;i++)\n\t{\n      tmp=x*y;\n\t\tp=tmp+one;\n      if (Test2(p)==-1)\n      {\n         if (Rabin(0,tmp,p,tmp)==-1)\n         {\n      \t\tif (PrimeQ(tmp,p))\n            {\n               break;\n            };\n         };\n      };\n\t\tx=x+one;\n\t};\n   Construction_Time+=clock()-t2;\n   if (i>=MaxRepeat)\n   {\n      GeneratePrime_Time+=clock()-t1;\n      Protocol(\"Attempt failure\");\n      return 0; // Very big multiplier is not necessary for me\n   };\n\n   ProtocolF(\"The number looks like prime and it's length is: \",(float)BytesInHN(p));\n\t// 'p' looks like a prime number\n   t2=clock();\n\tpm1=p-one;\n\n\t// We search for decomposition of number pm1 on prime multipliers\n\tRazl(UnsignedLong(x));\n\n\t// Check of decomposition of number pm1 on prime multipliers\n\t// This check isn't necessary, but it is a good way to check my\n\t// previous calculatings.\n   y=N[0];\n\tfor (i=1; i<N_size; i++)\n   {\n      Mult1(y,N[i],tmp); y=tmp;\n   };\n\n\tif (y!=pm1)\n\t{\n\t\tProtocol(\"\\nError detected while the number was compiling.\");\n//      getch();\n\t\texit(0);\n\t};\n\n   // Sorting of N[]\n   for (j=0;j!=1;)\n   {\n      j=1;\n      for (i=1; i<N_size; i++)\n      {\n         if (N[i-1]<N[i])\n         {\n            j=0;\n            intTmp=N[i];\n            N[i]=N[i-1];\n            N[i-1]=intTmp;\n         };\n      };\n   };\n\n\t// Let's check up performance of condition x**(pm1/N[i]) mod p != 1\n\tb=0;\n\tfor (i=0; i<N_size; i++)\n\t{\n\t\tif (b!=N[i])\t// To not examine repeating multipliers\n\t\t{\n\t\t\tb=N[i];\n         tmp=b;\n         tmp=pm1/tmp;\n\t\t\tModPower(tmp,three,tmp,p);\n\t\t\tif (tmp==one)\n\t\t\t{\n            GeneratePrime_Time+=clock()-t1;\n            Test_Time+=clock()-t2;\n\t\t\t\t// Number is compound\n\t\t\t\tDeleteN();\n            Protocol(\"Number is not prime.\");\n\t\t\t\treturn 0;\n\t\t\t};\n\t\t};\n\t};\n\n\tDeleteN();\n   GeneratePrime_Time+=clock()-t1;\n   Test_Time+=clock()-t2;\n   Protocol(\"Number is prime.\");\n\treturn 1;\n};\n\nvoid GeneratePrimeHugeNumber(HugeNumber &x)\n{\n\tint j;\n   time_t t1=clock();\n\n\tif (!WasRandomized)\n\t{\n\t\tWasRandomized=-1;\n\t\trandomize();\n\t};\n\tfor (;;)\n\t{\n\t\tDeleteN();\n\t\tfor (j=0; j<N_razr; j++) PutInList(MakePrimeL());\n      Protocol(\"Small prime numbers set is built.\");\n\t\tif (GeneratePrime(x)) break;\n\t};\n\tDeleteN();\n   GeneratePrimeHugeNumber_Time+=clock()-t1;\n};\n\nint SaveKeys(char *FileName, HugeNumber &x, HugeNumber &y)\n// function returns:\n// 1 - OK\n// 0 - failure\n{\n\tFILE *f;\n\tchar buf[2222];\n   unsigned long CheckSum=0;\n   int i,n;\n\n   f=fopen(FileName,\"wt\");\n   if (f==NULL) return 0;\n\n   n=x.Razr();\n   for (i=0; i<n; i++) CheckSum+=x.digit[i];\n   fprintf(f,\"%i\\n0x%s\\n\",n,x.ToStr(buf,2222));\n\n   n=y.Razr();\n   for (i=0; i<n; i++) CheckSum+=y.digit[i];\n   fprintf(f,\"%i\\n0x%s\\n\",n,y.ToStr(buf,2222));\n\n   fprintf(f,\"%u\\n\",CheckSum);\n   fclose(f);\n   return 1;\n};\n\nint RestoreKey(char *FileName, HugeNumber &x, HugeNumber &y)\n// function returns:\n// 1 - OK\n// 0 - failure\n{\n\tint i,n;\n\tFILE *f;\n\tchar buf[2222];\n   unsigned long testCheckSum=0;\n   unsigned long CheckSum=0;\n\n   f=fopen(FileName,\"rt\");\n   if (f==NULL) return 0;\n\n   //=== Reading the first part of the key ===\n   fscanf(f,\"%i\\n\",&n);\n   // Here should be n*2+1>2222\n   // I'm sure but some check won't hurt the program.\n   if (n*2+1>2222)\n   {\n      fclose(f);\n      return 0;\n   };\n\n   fscanf(f,\"%s\\n\",buf);\n\n   x=buf;\n   for (i=0; i<n; i++) CheckSum+=x.digit[i];\n   // See comments above\n   if (n!=x.Razr())\n   {\n      fclose(f);\n      return 0;\n   };\n\n   //=== Reading the second part of the key ===\n   fscanf(f,\"%i\\n\",&n);\n   if (n*2+1>2222)\n   {\n      fclose(f);\n      return 0;\n   };\n\n   fscanf(f,\"%s\\n\",buf);\n   y=buf;\n\n   for (i=0; i<n; i++) CheckSum+=y.digit[i];\n   if (n!=y.Razr())\n   {\n      fclose(f);\n      return 0;\n   };\n\n   fscanf(f,\"%u\\n\",&testCheckSum);\n   fclose(f);\n   if (testCheckSum!=CheckSum) return 0;\n   return 1;\n};\n\n"
  },
  {
    "path": "Bundles/Echoware/RSA/Gsimply.h",
    "content": "#ifndef __GSymply\n#define __GSymply\n\nextern int PrimeQ(HugeNumber &km1, HugeNumber &k);\nextern void GeneratePrimeHugeNumber(HugeNumber &x);\nextern int SaveKeys(char *FileName, HugeNumber &x, HugeNumber &y);\nextern int RestoreKey(char *FileName, HugeNumber &x, HugeNumber &y);\n\n#endif\n\n"
  },
  {
    "path": "Bundles/Echoware/RSA/HNumber.h",
    "content": "#ifndef __HugeNumber_H\n#define __HugeNumber_H\n\n#include <stdlib.h>\n#include \"MyTypes.h\"\n\nclass HugeNumber\n{\n\tpublic:\n\t\tword digit[MaxRazr];\t\t\t\t// Znachenija razriadov\n\t\tHugeNumber();\n\t\tHugeNumber(char *);\n\t\tHugeNumber(unsigned long);\n\t\tHugeNumber(const HugeNumber&);\n\t\tHugeNumber(HugeNumber&);\n\n\t\tvoid Random(int k);\t\t\t\t// Generiryet slychiajnoe chislo iz k razriadov\n\t\tint Razr() const;\t\t\t\t\t// Opredeliaet razriadnost chisla\n\t\tvoid Resize(int k); \t\t\t\t// Yvelichivaet chislo razriadov do k\n\t\tchar *ToStr(char*,int);\t\t\t// Preobrazovivaet chislo v tekstovij vid\n\t\tchar *ToHexStr(char *,int);\n\n\t\tHugeNumber& operator = (const HugeNumber &);\n\t\tfriend HugeNumber operator + ( HugeNumber &, HugeNumber &);\n\t\tfriend HugeNumber operator - ( HugeNumber &u, HugeNumber &v);\n\t\tfriend HugeNumber operator * ( HugeNumber &u, HugeNumber &v);\n\t\tfriend HugeNumber operator / ( HugeNumber &u, HugeNumber &v);\n\t\tfriend HugeNumber operator % ( HugeNumber &u, HugeNumber &v);\n\t\tHugeNumber& operator++();\n\t\tHugeNumber& operator--();\n};\n\nHugeNumber operator + ( HugeNumber &, HugeNumber &);\nHugeNumber operator - ( HugeNumber &u, HugeNumber &v);\nHugeNumber operator * ( HugeNumber &u, HugeNumber &v);\nHugeNumber operator / ( HugeNumber &u, HugeNumber &v);\nHugeNumber operator % ( HugeNumber &u, HugeNumber &v);\n#endif\n"
  },
  {
    "path": "Bundles/Echoware/RSA/Hnfunct.cpp",
    "content": "/*\nFunctions for work with huge numbers\nIgorSharov@rambler.ru\n*/\n\n#include \"stdafx.h\"\n//#include <conio.h>\t//Debug\n#include <time.h>\t\t//Debug\n#include \"Hnumber.h\"\n#include \"operator.h\"\n#include \"commonf.h\"\n#include \"string.h\"\n#include \"stdio.h\"\n#include \"MyPrint.h\"\n\n#define buf_s 2222\nextern time_t ModPower_Time;\n\nHugeNumber zero(\"0\"),one(\"1\"),two(\"2\"),three(\"3\");\n\nint BaseRazr()\n//\t\t\t\tVozvrashaet chislo simvolov, neobxodimsx dlia predstavlenia odnogo razriada\n/// Function returns number of the symbols necessary for representation of one rank\n{\n   int i,n;\n\n\ti=1;\n\n\t#ifdef HexBase\n\t\tfor(n=0; i<base; n++) i=i*0x10;\n\t#else\n\t\t#ifdef DecBase\n\t\tfor(n=0; i<base; n++) i=i*10;\n\t\t#else\n\t\t!!! Ne opredelen vid zapisi chisel !!!\n\t\t!!! 'HexBase' or 'DecBase' should be  determined !!!\n\t\t#endif\n\t#endif\n   return n;\n};\n\nvoid GCD(HugeNumber &uu, HugeNumber &vv, HugeNumber &u)\n//\t\t\t\tVizvrashaet naibolshij obshij delitel (parametr 'u')\n/// Function returns the greatest common divider of two numbers (parameter 'u')\n/// algorithm: see Knuth, vol2 page 361 (?)\n{\n\tHugeNumber r,v;\n\n\tif (uu>vv)\n\t{\n\t\tu=uu;\tv=vv;\n\t}\n\telse\n\t{\n\t\tu=vv;\tv=uu;\n\t}\n\n\tfor (;;)\n\t{\n\t\t// Step A1\n\t\tif (v==zero) return;\n\t\t// Step A2\n\t\tr=u % v; u=v; v=r;\n\t};\n};\n\nvoid LCM(HugeNumber &a, HugeNumber &b, HugeNumber &lcm)\n/// The least common multiple of two nonnegative huge numbers\n{\n   HugeNumber tmp;\n\n\tGCD(a,b,lcm);\n   tmp=a*b;\n\tlcm=tmp/lcm;\n};\n\nvoid Mult1(HugeNumber& u, word v, HugeNumber& w)\n//\t\t\t\tArifmetika smeshannoj tochnosti\n//\t\t\t\tu Mnogimoe c mnogokratnoj tochnostij\n//\t\t\t\tv Mnogitel c odnokratnoj tochnostij\n//\t\t\t\tw Rezultat c mnogokratnoj tochnostij\n\n/// Arithmetics of the mixed accuracy\n/// u - multiplicand (repeated accuracy)\n/// v - multiplier (unitary accuracy)\n/// w - result (repeated accuracy)\n{\n\tint j;\n\tint M;\t//\t\t\t\tIstinnaij razriadnist chisla\n\t\t\t\t/// The real word length of number\n\tdword t,k,dv;\n\n\t//\t\t\t\tShag M1. Nachalnaij ustanovka.\n\t/// Step M1. Initialization\n\tM=u.Razr();\n\tw=zero;\n\tw.Resize(M+1);\n\tdv=v;\n\n\tk=0;\n\tfor (j=0; j<M; j++)\n\t{\n\t\t\t\t//\t\t\t\tShag M4. Umnogit i slogit\n\t\t\t\t/// Step M4. Multiply and add\n\t\t\t\tt=((dword)u.digit[j])*dv+((dword)w.digit[j])+k;\n\t\t\t\tw.digit[j]=word(t % base);\n\t\t\t\t//\t\t\t\t!!! Zdes neobxodimo izpolzovat sdvig !!!\n\t\t\t\t/// !!! Here it is necessary to use shift !!!\n\t\t\t\tk=t/base;\t/// Figure of carry\n\t\t\t\t\t\t\t\t//\t\t\t\tCifra perenosa\n\t};\n\tw.digit[M]=word(k);\n};\n\nvoid Div1(HugeNumber &u, word v, HugeNumber &w, word &r)\n//\t\t\t\tArifmetika smeshannoj tochnosti\n/// Arithmetics of the mixed accuracy\n/// w=u/v; r=u%v\n{\n\tsize_t n;\n\tint i;\n\tdword t;\n\n\tn=u.Razr();\n\tw=zero;\n\tw.Resize( wmax(n,1) );\n\n\tr=0;\n\tfor (i=n-1; i>=0; i--)\n\t{\n\t\tt=r;\n\t\t//\t\t\t\t\tNado zamenit umnogenie na sdvig\n\t\t// !!! It is necessary to replace multiplication t*base with shift !!!\n\t\tt=(t * base) + u.digit[i];\n\t\tw.digit[i]=word(t/v);\n\t\tr=word(t-w.digit[i]*v);\n\t};\n};\n\nvoid Div(HugeNumber& uu, HugeNumber& vv, HugeNumber& qq, HugeNumber& r)\n//\t\t\t\tDelenie uu na vv\n//\t\t\t\tChastnoe - qq\n//\t\t\t\tOstatok - r\n\n// Knuth vol2 page291 (?)\n// qq= uu / vv; r=uu mod vv\n/// !!! To not delete calls of debugging procedure 'Protocol' in comments !!!\n{\n\tword d;\n\tsize_t Nrazr;  //\t\t\t\tNomer razriada, ispolzuemogo pri poluchenii\n                  //\t\t\t\tpredstavlenia chisla v dopolnitelnom kode.\n\t\t\t\t\t\t/// Number of the rank used at reception of representation\n\t\t\t\t\t\t/// of number in an additional code.\n\tHugeNumber u,v,w,z,x,f;\n\tint M;         //\t\t\t\tRazriadnost chastnogo\n\t\t\t\t\t\t/// Rank of quotient.\n\n\tint N;         /// Razriadnost ostatka (delitelia)\n\t\t\t\t\t\t/// Rank of remainder (divisor)\n\n\tint n;         /// n==N-1\n\tint i,j;\n\tint c;         /// Control value on step D4\n\tunsigned long q;\n   int x_razr,f_razr,z_razr;\n\tword tmp;\n\n\t// Obnuliaem chastnoe i ostatok\n\tqq=zero;\t/// quotient\n\tr=zero;\t/// remainder\n\n\t// D0.\t\t\tOpredeliaem resriadnost ...\n\t/// We determine the rank of ...\n\t//\t\t\t\t\t...delitelia\n\t/// ...divisor\n\tN=vv.Razr(); n=N-1;\n\tif ((N==1) && (vv.digit[0]==0))\n   {\n      printf(\"divisor ==0 !\");\n//      getch();\n   }\n\n\t//\t\t\t\t\t...delimogo\n\t/// ...dividend\n\tM=uu.Razr();\n\tif (M==1 && uu.digit[0]==0) return ;\n\n\tif (M<N)\n\t{\t//\t\t\t\tRasriadnost delimogo < rasriadnosti delitelia\n\t\t/// The rank of dividend < the rank of divisor..\n\t\tr=uu;\n\t\treturn;\n\t};\n\n\tif (N==1)\n\t{  //\t\t\t\tRasriadnost delitelia == 1 - primeniaj bolee prostoj algoritm.\n\t\t/// The rank of divisor == 1 - we use more simple algorithm.\n\t\tif (M==1)\n\t\t{\n\t\t\tword a=uu.digit[0];\n\t\t\tword b=vv.digit[0];\n\n\t\t\tqq.digit[0]=a/b;\n\t\t\tr.digit[0]=a-qq.digit[0]*b;\n\t\t}\n\t\telse\n\t\t\tDiv1(uu,vv.digit[0],qq,r.digit[0]);\n\t\treturn;\n\t};\n\n\t// D1. Normalize\n\td=base/(vv.digit[n]+1);\n\tif (d>1)\n\t{\n\t\tMult1(uu,d,u);\n\t\tMult1(vv,d,v);\n\t\t//Protocol(\"u=\",u);\n\t\t//Protocol(\"v=\",v);\n\t}\n\telse\n\t{\t//\t\t\t\tA nugni li eti operatori? Da, nugni.\n\t\t/// Whether or not this operators are necessary???  Yes, they are necessary.\n\t\tv=vv;\n\t\tu=uu;\n\t};\n   M++;\n\n\tu.Resize(M);\n\tx.Resize(N+2);\n\tqq.Resize(M-N+1);\n\tz.Resize(N+1);\n\tfor (j=M-1; j>=N; j--)\n\t{\n\t\t// D3\n\t\tif (u.digit[j]==v.digit[n])\n\t\t\tq=base-1;\n\t\telse\n\t\t{\n\t\t\tq=u.digit[j];\n\t\t\tq=(q*base+u.digit[j-1])/v.digit[n];\n\t\t}\n\n\t\twhile ( v.digit[n-1]*q > (( u.digit[j]*dword(base) + u.digit[j-1] - q*v.digit[n] )*dword(base) + u.digit[j-2])) q--;\n\n\t\t// D4.\t\tUmnogit i vichest. u[j..j+N]=u[j..j+N]-v[0..N]*q\n\t\t/// Multiply and subtract.\n\t\tMult1(v,word(q),w); // w=v*q\n\t\t//Protocol(\"w=\",w);\n\n\t\tfor (i=0; i<=N;     i++) x.digit[N-i]=u.digit[j-i];\t// x[]=u[j..j+N]\n      x_razr=x.Razr();\n\t\tfor (   ; i<x_razr; i++) x.digit[i]=0;\n\t\t//Protocol(\"x=\",x);\n\n\t\tif (x < w)\n\t\t\tc=-1;\n\t\telse\n\t\t\tc=0;\n\t\t//\t\t\t\tc=-1 pri x<w, c=0 pri x=w i pri x>w\n\t\t/// c=-1 if x<w, c=0 if x=w and if x>w\n\n\t\tif (c<0)\n\t\t{\n\t\t\tNrazr=x.Razr();\n\t\t\tx.digit[Nrazr]=1;\n\t\t};\n\n\t\tf=x-w;\t//\t\t\t\tOperisija prisvaivanija moget umenshit razriadnost\n\t\t\t\t\t///  Giving operation can reduce rank\n\t\t//Protocol(\"f=\",f);\n      f_razr=f.Razr();\n\t\tfor (i=0; i<f_razr; i++) z.digit[i]=f.digit[i];\n      z_razr=z.Razr();\n\t\tfor (   ; i<z_razr; i++) z.digit[i]=0;\n\t\t//Protocol(\"z=\",z);\n\n\t\tfor (i=0; i<=N; i++)\n\t\t{\n\t\t\t// u[j..j+N]=u[j..j+N]-v[0..N]*q\n\t\t\tif (N-i>z_razr-1)\n\t\t\t\tu.digit[j-i]=0;\n\t\t\telse\n\t\t\t\tu.digit[j-i]=z.digit[N-i];\n\t\t};\n\t\t//Protocol(\"u=\",u);\n\n\t\t//D5.\t\t\tProverit ostatok\n\t\t/// Check up the remainder.\n\t\tqq.digit[j-N]=word(q);\n\t\t//Protocol(\"qq=\",qq);\n\n\t\tif (c<0)\n\t\t{\n\t\t\t//D6.\t\tKompensirujushee slogenie\n\t\t\t///Compensating addition\n\t\t\tqq.digit[j-N]-=1;\n\t\t\t//Protocol(\"qq=\",qq);\n\n\t\t\t//\t\t\tz zapisano v dopolnitelnom kode -> pri slogenii bydet vixod za\n\t\t\t//\t\t\t'razriadnyjy setky'\n\t\t\t/// z it is written down in additional code - > addition there\n\t\t\t/// will be an output for a 'grid '\n\t\t\tx=z+v;\n\n\t\t\t//\t\t\tYnichtogajy cifry, kotoraja pri slogenii vishla za granicy\n\t\t\t//\t\t\t'razriadnoj setki'\n\t\t\t/// I destroy figure which at addition has left abroad of the grid\n\t\t\t//Protocol(\"1) x=\",x);\n\t\t\tx.digit[Nrazr]=0;\n\t\t\t//Protocol(\"1.1) x=\",x);\n\n\t\t\t//\t\t\tPri kompensiryjyshem slogenii pojavliaetsia perenos v starshij\n\t\t\t//\t\t\trazriad -  etim perenosom sledyet prenebrech\n\t\t\t/// At compensating addition there is a carry to the senior\n\t\t\t/// rank - this carry should be neglected.\n\t\t\t//Protocol(\"2) x=\",x);\n\t\t\tfor (i=0; i<=N; i++) u.digit[j-i]=x.digit[N-i];\n\t\t\t//Protocol(\"3) u=\",u);\n\t\t};\n\t};\n\t//\t\t\t\tTeper qq est isxodnoe chastnoe\n\t/// Now qq is a required quotient.\n\t// D8.\t\tDenormalizacija (poluchaem isxodnij ostatok)\n\t/// Unstandardization (the required quotient is received)\n\t//Protocol(\"u=\",u);\n\n\tDiv1(u,d,r,tmp); // r[]=u[M..0]/d\n\t//Protocol(\"r=\",r);\n};\n\ndouble Double(HugeNumber &a)\n{\n\tdouble x;\n\tint i;\n\tint n;\n\n\tn=a.Razr();\n\tx=0;\n\tfor (i=n-1; i>=0; i--) x=(x*(base)+a.digit[i]);\n\treturn x;\n};\n\nunsigned long UnsignedLong(HugeNumber &a)\n{\n\tunsigned long x;\n\tint i,n;\n\n\tn=a.Razr();\n\tx=0;\n\tfor (i=n-1; i>=0; i--) x=x*base+a.digit[i];\n\treturn x;\n};\n\nvoid ModPower(HugeNumber &Y, HugeNumber &x, HugeNumber &n, HugeNumber &f)\n//\t\t\t\tBinarnij metod vozvedenija v stepen po moduliy f\n/// Binary method of exponentation on the module f\n/// Knuth, page 483 (?)\n/// Y=(x^n) mod f\n{\n\tHugeNumber Nbig,Z;\n\tHugeNumber i;\n\tHugeNumber tmp;\n\n\t// A1.\t\t\tNachlnaja ystanovka\n\t/// Initialisation\n\tNbig=n;\t//Assign(Nbig,n);\n\tY=one;\t//Assign1(Y);\n\tZ=x; \t\t//Assign(Z,x);\n\n\tfor (;;)\n\t{\n\t\t// A2.\t\tRazdelit Nbig popolam\n\t\t/// Divide Nbig half-and-half\n\t\tDiv(Nbig,two,tmp,i);\t//Mod2(i,Nbig);\n\t\t\t\t\t\t\t\t\t//Div2(Nbig,Nbig);\n\t\tNbig=tmp;\n\t\t//Print(\"A2. Nbig=\",Nbig);\n\n\t\t//\t\t\t\tBilo li staroe znachenie Nbig chiotno?\n\t\t/// Whether there was old value Nbig even?\n\t\tif (i!=zero)\t\t\t\t//if (!IsZero(i))\n\t\t{\n\t\t\t// A3.\tUmnogit Y na Z\n\t\t\t/// Multiply Y on Z\n         tmp=Y*Z;\n\t\t\tY=tmp%f;\t\t\t\t//Mult(tmp,Y,Z);\n\t\t\t\t\t\t\t\t\t//Mod(Y,tmp,f);\n\n\t\t\t//Protocol(\"A3. Y=\",Y);\n\t\t\t// A4. Nbig = 0 ?\n\t\t\tif (Nbig==zero) return;\t//if (IsZero(Nbig)) return;\n\t\t};\n\n\t\t// A5.\t\tVozvesti Z v kvadrat\n\t\t/// Raise Z to the second power\n      tmp=Z*Z;\n\t\tZ=tmp%f;\t\t//Mult(tmp,Z,Z);\n\t\t\t\t\t\t//Mod(Z,tmp,f);\n\t\t//Protocol(\"A5. Z=\",Z);\n\t};\n};\n\nvoid Power(HugeNumber &Y, HugeNumber &x, HugeNumber &n)\n// Binary method of exponentation\n// Knuth, page 483 (?)\n// Y=x^n\n{\n\tHugeNumber Nbig,Z;\n\tHugeNumber i;\n\tHugeNumber tmp;\n\n\t// A1. Initialisation\n\tNbig=n;\n\tY=one;\n\tZ=x;\n\n\tfor (;;)\n\t{\n\t\t// A2. Divide Nbig half-and-half\n\t\tDiv(Nbig,two,tmp,i);\n\n\t\tNbig=tmp;\n\t\t//Protocol(\"A2. Nbig=\",Nbig);\n\t\t// Whether there was old value Nbig even?\n\t\tif (i!=zero)\n\t\t{\n\t\t\t// A3. Multiply Y on Z\n         Y=Y*Z;\n\t\t\t//Protocol(\"A3. Y=\",Y);\n\t\t\t// A4. Nbig = 0 ?\n\t\t\tif (Nbig==zero) return;\n\t\t};\n\n\t\t// A5. Vizvesti Z v kvadrat.\n\t\t// Raise Z to the second power\n      Z=Z*Z;\n\t\t//Protocol(\"A5. Z=\",Z);\n\t};\n};\n\nint BytesInHN(HugeNumber &x)\n//\t\t\t\tVozvrashaet chislo baitov v x\n/// Returns number of bytes in x\n{\n   char *buf;\n   int n;\n\n   n=BaseRazr()*x.Razr()+1;\n   buf=new char[n];\n   x.ToStr(buf,n);\n   n=strlen(buf);\n   delete buf;\n   return n;\n};\n\n"
  },
  {
    "path": "Bundles/Echoware/RSA/Hnfunct.h",
    "content": "#ifndef _HNFUNCT__H\n#define _HNFUNCT__H\n\n#include \"Hnumber.h\"\n\nextern HugeNumber zero,one,two,three;\nextern int BaseRazr();\nextern void GCD(HugeNumber &uu, HugeNumber &vv, HugeNumber &u);\nextern void LCM(HugeNumber &uu, HugeNumber &vv, HugeNumber &u);\nextern void Mult1(HugeNumber& u, word v, HugeNumber& w);\nextern void Div1(HugeNumber &u, word v, HugeNumber &w, word &r);\nextern void Div(HugeNumber& uu, HugeNumber& vv, HugeNumber& qq, HugeNumber& r);\nextern double Double(HugeNumber &a);\nextern unsigned long UnsignedLong(HugeNumber &a);\nextern void ModPower(HugeNumber &Y, HugeNumber &x, HugeNumber &n, HugeNumber &f);\nextern void Power(HugeNumber &Y, HugeNumber &x, HugeNumber &n);\nextern int BytesInHN(HugeNumber &x);\n\n#endif\n"
  },
  {
    "path": "Bundles/Echoware/RSA/Hnumber.cpp",
    "content": "/*\nIgorSharov@rambler.ru\n*/\n#include \"stdafx.h\"\n//#include <conio.h>\n#include <string.h>\n#include <math.h>\n#include <stdlib.h>\n\n#include \"operator.h\"\n#include \"CommonF.h\"\n#include \"HNumber.h\"\n#include \"HNfunct.h\"\n#include \"MyTypes.h\"\n\nstatic void Add1(HugeNumber &a, word m);\nstatic void Convert(char *b, HugeNumber &w);\nextern long int random(long int);\n\nHugeNumber::HugeNumber()\n{\n\tint i;\n\n\tfor (i=0; i<MaxRazr; i++) digit[i]=0;\n};\n\nHugeNumber::HugeNumber(HugeNumber &x)\n// Konstryktor kopirovanija\n{\n\tint i;\n\n   for (i=0; i<MaxRazr; i++) digit[i]=x.digit[i];\n};\n\nHugeNumber::HugeNumber(unsigned long num)\n{\n\tchar x[11];\n\tword i;\n\tHugeNumber a;\n\n\tsprintf(x, \"%lu\", num);\t//ultoa(num,x,10);\n\tConvert(x,a);\n\n\tfor (i=0; i<MaxRazr; i++) digit[i]=a.digit[i];\n};\n\nHugeNumber::HugeNumber(char *x)\n{\n   int i,n;\n\n   n=BaseRazr();\n   if (x[1]=='x')\n   {\n\t\t// Chislo v shestnadsaterichnoj zapisi\n      int len,j,k;\n      char buf[11],*str;\n\n      buf[n]=0;\n      len=strlen(x);\n      str= new char[len+n];\n      strcpy(str,&x[2]);\n\n      for (len=strlen(str); len%n!=0; len++)\n      {\n         for (j=len; j>0; j--)\n         {\n            str[j]=str[j-1];\n         };\n         str[0]='0';\n      };\n\n      j=0;\n      for (i=len-1; i>=0; i=i-n)\n      {\n         for (k=0; k<n; k++)\n            buf[k]=str[i-n+k+1];\n         sscanf(buf,\"%x\",&digit[j++]);\n      };\n      delete str;\n      for (;j<MaxRazr;j++) digit[j]=0;\n   }\n   else\n   {\n\t\t// Chislo v desiatichnoj zapisi\n   \tHugeNumber a;\n   \tConvert(x,a);\n   \tfor (i=0; i<MaxRazr; i++) digit[i]=a.digit[i];\n   }\n};\n\nHugeNumber& HugeNumber::operator++()\n{\n\tword j,k;\n\tdword p;\n\n\tk=0;\n\n\t// Pribavliaem 1 k mladshej cifre chisla\n\tp=(((dword)digit[0])+1L);\n\tdigit[0]= word(p % base);\n\n\t// Opredeliaem cifry perenosa\n\tif (p>=base) k=1;\n\n\tfor (j=1; j<MaxRazr; j++)\n\t{\n\t\tif (k==0) return *this;\n\t\tp=(((dword)digit[j])+k);\n\t\tdigit[j]= word(p % base);\n\t\tif (p>=base)\n\t\t\tk=1;\n\t\telse\n\t\t\tk=0;\n\t};\n\t// Ne xvataet razriada - yvelichivay razraidnost chisla\n\tResize(MaxRazr+1);\n\tdigit[j]=k;\n\treturn *this;\n};\n\nHugeNumber& HugeNumber::operator--()\n{\n\tword j,tmp;\n\tsize_t m;\n\tint k;\n\n\tif ((digit[0])==0)\n\t{\n\t\tdigit[0]=base-1;\n\t\tk=-1;\n\t}\n\telse\n\t{\n\t\tdigit[0]=digit[0]-1;\n\t\treturn *this;\n\t}\n\n\tm=Razr();\n\tfor (j=1; j<m; j++)\n\t{\n\t\ttmp=word((((unsigned long)digit[j])+k+base) % base);\n\t\tif (tmp==base-1)\n\t\t\tk=-1;\n\t\telse\n\t\t\tk=0;\n\t\tdigit[j]=tmp;\n\t\tif (k==0) return *this;\n\t};\n\treturn *this;\n};\n\nint HugeNumber::Razr() const\n// Opredeliaet realnyjy razriadnoast chisla\n// Razriadnost chisla nol ==1\n{\n\tword i;\n\n\tfor (i=MaxRazr-1; i>0; i--)\n\t\tif (digit[i]!=0) break;\n\treturn i+1;\n};\n\nvoid HugeNumber::Resize(int k)\n// Yvelichivaet kolichestvo rezriadov v pedstavlenii chisla do k\n{\n\tif (k>MaxRazr)\n\t{\n\t\t//printf(\"Zaprosheno uvelichenie razriadnosti do %i\",k);\n\t\t//printf(\"Request for digit capacity increasing to %i has been found.\", k);\n\t\t//      getch();\n\t}\n}\n\nvoid HugeNumber::Random(int k)\n// Zapolniaet mladshie k razriadov slychajnimi znachenijami\n// Starshie m-k razriadov zapolniajytsia nyliami\n{\n\tint i;\n\n\tResize(k);\n\tfor (i=0; i<k; i++) digit[i]=random(base);\n\tfor (   ; i<MaxRazr; i++) digit[i]=0;\n};\n\nHugeNumber& HugeNumber::operator =( const HugeNumber & source )\n{\n\tword m,i;\n\n\tif (digit!=source.digit)\n\t{\t// Chisla zapisani po raznim adresam pamiati\n\t\tm = source.Razr();\n\t\tfor (i=0; i<m   ; i++) digit[i]=source.digit[i];\n\t\tfor (   ; i<MaxRazr; i++) digit[i]=0;\n\t}\n\telse; // Chisla zapisani po odnomy i tomy ge adresy => prisvaivanie vida a=a\n\treturn *this;\n};\n\nHugeNumber operator + ( HugeNumber &u, HugeNumber &v)\n// Slogenie neotrisatelnix selix chisel\n{\n\tword j;\n\tdword k; // Cifra perenosa\n\tword uk; // Chislo razriadov u\n\tword vk; // Chislo razriadov v\n\tword wk; // Chislo razriadov w\n\tword kw;\n\tdword p;\n\tHugeNumber w; // Zdes bydem nakaplivat rezyltat\n\n\tvk=v.Razr();\n\tuk=u.Razr();\n\twk=wmax(uk,vk);\n\tkw=wmin(uk,vk);\n\tw.Resize(wk+1);\t// Delaem nygnyiy razriadnost rezyltata\n\n\tk=0;\n\t// Symiryem razriadi po samomy korotkomy chisly\n\tfor (j=0; j<kw; j++)\n\t{\n\t\tp=dword(u.digit[j])+dword(v.digit[j])+k;\n\t\tif (p>=base)\n\t\t{\n\t\t\tk=1;\n\t\t\tw.digit[j] = word(p & (base-1));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tk=0;\n\t\t\tw.digit[j]= word(p);\n\t\t};\n\t};\n\n\t// Tiper nado prosymirovat ostavshiesia razriadi dlinnogo chisla i\n\t// razriad perenosa.\n\tif (k!=0)\n\t{\t// Bil perenos pri symmirovanii po korotkomy chisly\n\t\t// Nado symmirivat ostavshiesia razriady\n\t\tif (uk>vk)\n\t\t{\n\t\t\t// Symmiryem, poka est cifra perenosa\n\t\t\tfor (; j<uk; j++)\n\t\t\t{\n\t\t\t\tp=u.digit[j]+k;\n\t\t\t\tif (p>=base)\n\t\t\t\t{\n\t\t\t\t\tk=1;\n      \t\t\tw.digit[j] = word(p & (base-1));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tk=0;\n\t\t\t\t\tw.digit[j]= word(p);\n\t\t\t\t\tbreak;\n\t\t\t\t};\n\t\t\t}\n\t\t\t// Kopiryem ostavshiesia razriady\n\t\t\tif (k==0) for (j++; j<uk; j++) w.digit[j]=u.digit[j];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Symmiryem, poka est cifra perenosa\n\t\t\tfor (; j<vk; j++)\n\t\t\t{\n\t\t\t\tp=v.digit[j]+k;\n\t\t\t\tw.digit[j]= word(p & (base-1));\n\t\t\t\tif (p>=base)\n\t\t\t\t{\n\t\t\t\t\tk=1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tk=0;\n\t\t\t\t\tbreak;\n\t\t\t\t};\n\t\t\t}\n\t\t\t// Kopiryem ostavshiesia razriady\n\t\t\tif (k==0) for (j++; j<vk; j++) w.digit[j]=v.digit[j];\n\t\t};\n\t\tif (k!=0)\n\t\t{\t// Symmirovanie provedeno po vsem razriadam, no eshe est\n\t\t\t// cifra perenosa\n\t\t\tw.digit[j]=word(k);\n\t\t}\n\t}\n\telse\n\t{\t// Nebilo perenosa pri symmirovanii po korotkomy chisly\n\t\t// Nado prosto skopirovat ostavshiesia razriady dlinnogo chisla\n\t\tif (vk>uk)\n\t\t\tfor (; j<vk; j++)\n\t\t\t\tw.digit[j]=v.digit[j];\n\t\telse\n\t\t\tif (uk>vk)\n\t\t\t\tfor (; j<uk; j++)\n\t\t\t\t\tw.digit[j]=word(u.digit[j]+k);\n\t};\n\treturn w;\n};\n\nchar* HugeNumber::ToStr(char *pointer, int size)\n// Preobrasyet chislo mnogokratnoi tochnosti v striky\n// pointer - byfer dlia stroki\n// size    - razmer byfera\n// returns: pointer esli preobrazovanie zaversheno normalno\n//          NULL    esli byfer okazalsia mal\n{\n\tint i,n;\n\tchar buf[5];\n\tchar format[111];\n\n   n=BaseRazr();\n\t// n == chisly simvolov, neobxodimix dlia predstavlenia odnogo razriada\n\tif (size < this->Razr()*n+1) return NULL; // Byfer mal - stroka ne vlezet\n\n\t#ifdef HexBase\n\t\tsprintf(format,\"%%%02iX\",n);\n\t#else\n\t\tsprintf(format,\"%%%02ii\",n);\n\t#endif\n\n\tpointer[0]=0;\n\tfor (i=this->Razr()-1; i>=0; i--)\n\t{\n\t\tsprintf(buf,format,this->digit[i]);\n\t\tstrcat(pointer,buf);\n\t};\n\n   // Ybrat neznachishai nyli\n   for (;pointer[0]=='0';)\n   {\n      n=strlen(pointer);\n\t\tif (n==1) break;\n      for (i=0; i<n; i++) pointer[i]=pointer[i+1];\n   };\n\treturn pointer;\n};\n\nchar* HugeNumber::ToHexStr(char *pointer, int size)\n// Preobrazyet chislo mnogokratnoj tochnosti v stroky\n// pointer - byfer dlia stroki\n// size    - razmer byfera\n// returns: pointer esli preobrazovanie zaversheno normalno\n//          NULL    esli byfer okazalsia mal\n{\n\tint i,razr;\n\tchar buf[5];\n\tchar format[111];\n\tlong l;\n\n\tl=1;\n\tfor (razr=0; l<base; razr++) l=l*0x10;\n\t// razr == chisly simvolov, neobxodimix dlia predstavlenija odnogo razriada\n\tif (size < this->Razr()*razr+1) return NULL; // Malo pamiati.\n\n   strcpy(buf,\"%\");\n\tsprintf(format,\"%s%02iX\",buf,razr);\n\tpointer[0]=0;\n\tfor (i=this->Razr()-1; i>=0; i--)\n\t{\n\t\tsprintf(buf,format,this->digit[i]);\n\t\tstrcat(pointer,buf);\n\t};\n\n\treturn pointer;\n};\n\nHugeNumber operator - ( HugeNumber &u, HugeNumber &v)\n// Bichitanie neotrisatelnix selix chisel w=u-v\n// Vnimanie! u >= v !!!\n//\n{\n\tint j;\n\tint k;\n\tHugeNumber w;\n\tword a,b;\n\n\tw.Resize(u.Razr()); // Razriadnost rezyltata == razriadnosti ymenshaemogo\n\tk=0;\n\tfor (j=0; j<u.Razr(); j++)\n\t{\n\t\ta=u.digit[j];\n\t\tif (j<v.Razr())\n\t\t\tb=v.digit[j];\n\t\telse\n\t\t\tb=0;\n\n\t\tw.digit[j]=(a-b+k+base) & (base-1);\n\t\tif (int(a+k)<int(b))\n\t\t\tk=-1;\n\t\telse\n\t\t\tk=0;\n\t};\n\treturn w;\n};\n\n\nHugeNumber operator * ( HugeNumber &u, HugeNumber &v)\n// u Mnogimoe\n// v Mnogitel\n// w Rezyltat\n{\n\tword  i,j;\n\tword  M,N;\t\t// Deistvitelnaia razriadnost chisel\n\tdword t;\t\t\t// Rezultat ymnogenia 2-x chifr\n\tdword k;\t\t\t// Cifra perenosa\n\tdword a,c;\t\t// Cifri peremnogaemix chisel\n\tHugeNumber w;\t// Promegytochnij rezyltat\n\n\tM=u.Razr();\n\tN=v.Razr();\n\n\tif (M==1)\n\t{\n\t\tw=v;\t// ??? A nygen li etot operator ???\n\t\tMult1(v,u.digit[0],w);\n\t\treturn w;\n\t};\n\n\tif (N==1)\n\t{\n\t\tw=u;\n\t\tMult1(u,v.digit[0],w);\n\t\treturn w;\n\t};\n\n\tw.Resize(M+N+1);\n\tN++; M++;\n\n\t// Dlia provedenija vichislenij nado imet odin razriad v zapase\n\tv.Resize(N);\n\tu.Resize(M);\n\n\tk=0;\n\tfor (j=0; j<N; j++)\n\t{\n\t\t for (i=0; i<M; i++)\n\t\t {\n\t\t\t\t// Step M4. Ymnogit i slogit\n\t\t\t\ta=u.digit[i];\n\t\t\t\tc=v.digit[j];\n\t\t\t\tt=a*c+((unsigned long)w.digit[i+j])+k;\n\t\t\t\tw.digit[i+j]=word(t & (base-1));\n\t\t\t\t// Zdes nado bspolsivat sdvig\n\t\t\t\tk = t / base;\t// Cifra perenosa\n\t\t\t\t// Step M5. Cikl po i\n\t\t };\n\t\t// Step M6. Cikl po j\n\t};\n\n\treturn w;\n};\n\nHugeNumber operator / ( HugeNumber &u, HugeNumber &v)\n{\n\tHugeNumber a,r;\n\tDiv(u,v,a,r);\n\treturn a;\n};\n\nHugeNumber operator % ( HugeNumber &u, HugeNumber &v)\n// Ostatok ot delenija\n{\n\tHugeNumber a,r;\n\tDiv(u,v,a,r);\n\treturn r;\n};\n\nstatic void Add1(HugeNumber &a, word m)\n// Slogenie smeshannoj tochnosti po osnovanijy 'base'\n// a=a+m\n{\n\tdword k;\t// Cifra perenosa\n\tint n;\t// Chislo razriadov v 'a'\n\tint i;\n\n\tn=a.Razr();\n\tk=a.digit[0]+m;\n\ta.digit[0]=word(k % base);\n\tk=k / base;\n\tif (k==0) return;\n\n\tfor (i=1; i<n; i++)\n\t{\n\t\tk=a.digit[i]+k;\n\t\ta.digit[i]=word(k % base);\n\t\tk=k / base;\n\t\tif (k==0) return;\n\t};\n\tif (k==0) return;\n\tif (i==a.Razr()) a.Resize(i+55);\n\ta.digit[i]=word(k);\n};\n\nstatic void Convert(char *b_string, HugeNumber &w)\n// Prweobrazovanie iz stroki v chislo\n{\n\tword n,m;\n\tword i;\n\tchar *b;\n\tHugeNumber tmp;\n\n\t// Ydalit razdeliteli\n\tn=strlen(b_string);\n\tb=new char[n+1];\t// Videlit pamiat dlia stroki po chisly simvolov + 1 byte for\n\t\t\t\t\t\t\t// priznaka konza stroki\n\t// !!! Predidyshij operator bil zapisan s oshibkoj i vigladel tak: b=new char[n];\n\t// Odnako v Borland vsio rabotalo i oshibka vsplila tolko v VC++\n\tstrcpy(b,b_string);\n\n\tfor (;;)\n\t{\n\t\tfor (i=0; i<n; i++) if (b[i]=='`') break;\n\t\tif (i==n) break;\n\t\tfor (   ; i<n; i++) b[i]=b[i+1];\n\t\tn--;\n\t};\n\n\tm=strlen(b);\n\tw.Resize(m+55);\n\tn=w.Razr();\n\n\tfor (i=0; i<n; i++) w.digit[i]=0;\n\tfor (i=0; i<m; i++)\n\t{\n\t\tMult1(w,10,tmp);\n\t\tAdd1(tmp,b[i]-'0');\n\t\tw=tmp;\n\t};\n\tdelete b;\n};\n"
  },
  {
    "path": "Bundles/Echoware/RSA/Keys.cpp",
    "content": "/*\nIgorSharov@rambler.ru\n*/\n#include \"stdafx.h\"\n#include <time.h>\n//#include <conio.h>\n#include <stdlib.h>\n#include <stdio.h>\n\n#include \"MyTypes.h\"\n#include \"Function.h\"\n#include \"CommonF.h\"\n#include \"HNfunct.h\"\n#include \"Operator.h\"\n#include \"MyPrint.h\"\n#include \"MyNum.h\"\n#include \"GSimply.h\"\n\n#define CLK_TCK   CLOCKS_PER_SEC\n\nextern int N_razr;\nextern int WasRandomized;\nextern void MakePrime(int intS, HugeNumber &n);\nextern void randomize();\nextern long int random(long int);\n\ntime_t MakePrimeL_Time=0;\ntime_t LongIsPrime_Time=0;\ntime_t Misha_Time=0;\ntime_t Construction_Time=0;\ntime_t Razl_Time=0;\ntime_t DeleteN_Time=0;\ntime_t Test_Time=0;\ntime_t GeneratePrimeHugeNumber_Time=0;\ntime_t GeneratePrime_Time=0;\n\nvoid clrscr()\n// Dobavlena dlia sovmestimosti s Borland C++ Builder\n// k sogalenijy ja ne obnarygil etoj fynkcii v Visual C++\n// Eta funkcija dolgna ochishat ekran i ystanavlivat kyrsor\n// v levij verxnij ygol ekrana.\n{\n};\n\nvoid Euklid(MyNum &u, MyNum &v, MyNum &nod, MyNum &e)\n// Obobshionnij algorint Evklida\n// Knuth vol2 page367 (?)\n{\n\tMyNum u1,u2,u3;\n\tMyNum v1,v2,v3;\n\tMyNum t1,t2,t3;\n\tMyNum q,tmp;\n\n\t// X1. Nachialnaja ystanovka\n\tAssign1(u1);\n\tAssign0(u2);\n\tAssign(u3,u);\n\n\tAssign0(v1);\n\tAssign1(v2);\n\tAssign(v3,v);\n\n\t// X2. v3==0 ?\n\twhile (!IsZero(v3))\n\t{\n\t\t// X3. Razdelit, Vichest\n\t\tDiv(q,u3,v3);\n\t\tMult(tmp,v1,q);\n\t\tSubtr(t1,u1,tmp);\n\t\tMult(tmp,v2,q);\n\t\tSubtr(t2,u2,tmp);\n\t\tMult(tmp,v3,q);\n\t\tSubtr(t3,u3,tmp);\n\n\t\tAssign(u1,v1);\n\t\tAssign(u2,v2);\n\t\tAssign(u3,v3);\n\t\tAssign(v1,t1);\n\t\tAssign(v2,t2);\n\t\tAssign(v3,t3);\n\t};\n\tAssign(nod,u3);\n\tAssign(e,u2);\n};\n\nvoid CreateKeys(HugeNumber &D, HugeNumber &e, HugeNumber &N)\n// Vichslenie pari klychej (D,N) (e,N)\n{\n\tHugeNumber P,Q,p1q1,i,N100;\n\tHugeNumber a,b,P1,Q1;\n\tMyNum sP,sQ,sa,si,sD,se,sp1q1;\t// Bolshie chisla so znakom\n\tlong k;\n\n\tif (!WasRandomized)\n\t{\n\t\trandomize();\n\t\tWasRandomized=-1;\n\t};\n\n\tfor (k=0;;k++)\n\t{\n      Protocol(\"Calculating P ...\");\n      MakePrime(100, P);\n      Protocol(\"Done. P=\",P);\n      Protocol(\"Calculating Q ...\");\n      MakePrime(100, Q);\n      Protocol(\"Done. Q=\",Q);\n\t\tif (P!=Q) break;\n\t};\n\tN=P*Q;\n   Protocol(\"N=\",N);\n\n\tP1=P-one;\n\tQ1=Q-one;\n\tp1q1=P1*Q1;\n\n   Protocol(\"Calculating D and e ...\");\n// MakePrime(2, P); - tak delat nelzia!\n// Etot metod ne rabotaet dlia malix stepenej dvojki\n   for (k=random(55555); !LongIsPrime(k);k++);\n   D=k;\n\tConvertHugeNumberToMyNum(sp1q1,p1q1);\n\tConvertHugeNumberToMyNum(sD,D);\n\tfor (k=1;;k++)\n\t{\n\t\tEuklid(sp1q1,sD,si,se);\n\t\tif (si.value==one && se.sign>0) break;\n\t\tsD.value=sD.value+one;\n\t};\n   Protocol(\"Done.\");\n\tD=sD.value;\n\te=se.value;\n\t// Vichislena para klychej (D,N) (e,N)\n   Protocol(\"D=\",D);\n   Protocol(\"e=\",e);\n   ProtocolF(\"Amount iteration for calculation D and E is \",float(k));\n};\n\nvoid Keys(HugeNumber &d, HugeNumber &e, HugeNumber &nn)\n{\n\tHugeNumber a,c;\n\tHugeNumber b(\"12345\");\n\tunsigned long t_start;\n\n\tclrscr();\n\trandomize();\n\tProtocol(\"Keys generation process is started.\");\n\tt_start=clock();\n\tCreateKeys(d,e,nn);\n//\tProtocolF(\"Time of calculation (sec)= \",float((clock()-t_start)/CLK_TCK));\n\tProtocolF(\"length (bytes) of d=\",(float)BytesInHN(d));\n\tProtocolF(\"length (bytes) of e=\",(float)BytesInHN(e));\n\tProtocolF(\"length (bytes) of n=\",(float)BytesInHN(nn));\n\tProtocolF(\"Your key's length is \",(float)BytesInHN(nn));\n\tif (nn>b)\n\t{\n\t /*\n\t As a matter in fact we don't need this step\n\t but this is a good way to test our previous calculations.\n\t */\n\t\tt_start=clock();\n\t\tProtocol(\"Begin of test encoding...\");\n\t\t// (d,nn) - klych dlia zashifrovivanija\n\t\tModPower(a,b,d,nn);\n\t\tProtocol(\"Done. Test decoding is started...\");\n\t\t// (e,nn) - klych dlia rasshifrovivanija\n\t\tModPower(c,a,e,nn);\n\t\tProtocol(\"Done.\");\n\t\tif (c!=b)\n\t\t{\n\t\t\tProtocol(\"Error it test calculation.\\n\");\n\t\t\tabort();\n\t\t};\n//\t ProtocolF(\"Time of test = \",(float)(clock()-t_start)/CLK_TCK);\n\t};\n\n\tProtocol(\"Keys generation process is done.\");\n};\n"
  },
  {
    "path": "Bundles/Echoware/RSA/Keys_main.cpp",
    "content": "// Key_main.cpp : Defines the entry point for the console application.\n//\n#include \"stdafx.h\"\n//#include <conio.h>\n#include <stdlib.h>\n#include <stdio.h>\n//#include <conio.h>\n\n#include \"HNumber.h\"\n#include \"GSimply.h\"\n\nextern void Keys(HugeNumber&,HugeNumber&,HugeNumber&);\n\nint main(int argc, char* argv[])\n{\n   HugeNumber e,d,n;\n\n   // Generate keys\n   Keys(e,d,n);\n\n   SaveKeys(\"EncodeKey.txt\",d,n);\n\t// Now \"EncodeKey.txt\" contains a key for encoding\n\n   SaveKeys(\"DecodeKey.txt\",e,n);\n\t// Now \"DecodeKey.txt\" contains a key for decoding\n\n\tprintf(\"\\nPress any key...\");\n//   getch();\n   return 0;\n\t// File \"Prot.txt\" contains some debug information.\n\t// We don't need this file for work.\n}\n"
  },
  {
    "path": "Bundles/Echoware/RSA/MyNum.h",
    "content": "#ifndef __MyNum\n#define __MyNum\n\n#define SizeOfMyNum 4\n\n#ifndef __TByte\n#define __TByte\ntypedef unsigned char byte;\n#endif\n\n#ifndef __TWord\n#define __TWord\ntypedef unsigned int word;\n#endif\n\n#define MyNumLen\t7\n\n#include \"HNumber.h\"\n\nstruct MyNum\n{\n\tint        sign;\t// Znak chisla\n\tHugeNumber value; // Chislo bez znaka\n\n\tMyNum();\n};\n\nextern void Assign1(MyNum &x);\nextern void Assign0(MyNum &x);\nextern void Assign(MyNum &x, MyNum &y);\nextern void ConvertHugeNumberToMyNum(MyNum &a, HugeNumber &b);\nextern int IsZero(MyNum &a);\nextern int CompareAbs(MyNum &a, MyNum &b);\nextern void Subtr(MyNum &c, MyNum &a, MyNum &b);\nextern void Div(MyNum &c, MyNum &a, MyNum &b);\nextern void Mult(MyNum &c, MyNum &a, MyNum &b);\nextern void Mod2(MyNum &c, MyNum &a);\nextern void Div2(MyNum &c, MyNum &a);\n\n#endif\n"
  },
  {
    "path": "Bundles/Echoware/RSA/MyTypes.h",
    "content": "#ifndef __MyTypes_H\n#define __MyTypes_H\n\n#define base 0x1000\t\t  \t// Osnovanie sistemy schislenija\n\n//#define DecBase\t\t\t\t// Ispolzyjy 10-tichnyjy zapis\n#define HexBase\t\t\t\t// Ispolzyjy 16-tichnyjy zapis\n\n#define DeltaIndex 16\t\t// Shag yvelichenija razriadnosti chisla\n#define MaxRazr   128//512\ntypedef unsigned char byte;\ntypedef unsigned int  word;\ntypedef unsigned long dword;\n\n#endif\n"
  },
  {
    "path": "Bundles/Echoware/RSA/Mynum.cpp",
    "content": "/*\nIgorSharov@rambler.ru\nBolshie chisla so znakom\nv2.0\n*/\n\n#include \"stdafx.h\"\n#include \"MyNum.h\"\n#include \"HNFunct.h\"\n#include \"Operator.h\"\n\nMyNum::MyNum()\n{\n\tsign=+1;\n\tvalue=zero;\n};\n\nvoid Assign1(MyNum &x)\n{\n\tx.sign=+1;\n\tx.value=one;\n};\n\nvoid Assign0(MyNum &x)\n{\n\tx.sign=+1;\n\tx.value=zero;\n};\n\nvoid ConvertHugeNumberToMyNum(MyNum &a, HugeNumber &b)\n{\n\ta.sign=+1;\n\ta.value=b;\n};\n\nvoid Assign(MyNum &x, MyNum &y)\n{\n\tx.sign=y.sign;\n\tx.value=y.value;\n};\n\nint IsZero(MyNum &a)\n{\n\tif (a.value==zero)\n\t{\n\t\ta.sign=+1;\t\t// na vsiakij slychaj\n\t\treturn -1;\n\t}\n\telse\n\t\treturn 0;\n};\n\nint CompareAbs(MyNum &a, MyNum &b)\n{\n\tif (a.value>b.value)\n\t\treturn +1;\n\telse if (a.value<b.value)\n\t\treturn -1;\n\telse\n\t\treturn 0;\n};\n\nvoid Subtr(MyNum &c, MyNum &a, MyNum &b)\n{\n\tif (a.sign*b.sign>0)\n\t{\t// Chisla odnogo znaka\n\t\tif (CompareAbs(a,b)>0)\n\t\t{\t// |a|>|b|\n\t\t\tc.sign=a.sign;\n\t\t\tc.value=a.value-b.value;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tc.sign=-b.sign;\n\t\t\tc.value=b.value-a.value;\n\t\t};\n\t}\n\telse\t// Chisla protivopolognix znakov\n\tif (a.sign>b.sign)\n\t{\t// a>0 && b<0\n\t\tc.sign=+1;\n\t\tc.value=a.value+b.value;\n\t}\n\telse\n\t{\t// a<0 && b>0\n\t\tc.sign=-1;\n\t\tc.value=a.value+b.value;\n\t};\n};\n\nvoid Div(MyNum &c, MyNum &a, MyNum &b)\n{\n\tc.sign=a.sign*b.sign;\n\tc.value=a.value/b.value;\n};\n\nvoid Mult(MyNum &c, MyNum &a, MyNum &b)\n{\n\tc.sign=a.sign*b.sign;\n\tc.value=a.value*b.value;\n};\n\n"
  },
  {
    "path": "Bundles/Echoware/RSA/Myprint.cpp",
    "content": "#include \"stdafx.h\"\n#include <stdio.h>\n#include \"HNumber.h\"\n#include \"MyNum.h\"\n\nFILE *Prot=NULL;\n\nvoid Protocol(char *Msg)\n{\n   Prot=fopen(\"Prot.txt\",\"at\");\n\tprintf(\"%s\\n\",Msg);\n\tfprintf(Prot,\"%s\\n\",Msg);\n\tfclose(Prot);\n};\n\nvoid Protocol(const char *Msg, MyNum &a)\n{\n\tchar Buf[222];\n\tHugeNumber hn;\n\n   Prot=fopen(\"Prot.txt\",\"at\");\n\thn=a.value;\n\thn.ToStr(Buf,222);\n\n\tprintf(\"%s \",Msg);\n\tfprintf(Prot,\"%s \",Msg);\n\tif (a.sign<0)\n\t{\n\t\tprintf(\"-\");\n\t\tfprintf(Prot,\"-\");\n\t};\n\tprintf(\"%s\\n\",Buf);\n\tfprintf(Prot,\"%s\\n\",Buf);\n\tfclose(Prot);\n};\n\nvoid ProtocolF(const char *Msg, float a)\n{\n   Prot=fopen(\"Prot.txt\",\"at\");\n\n\tprintf(\"%s %g (dec)\\n\",Msg,a);\n\tfprintf(Prot,\"%s %g (dec)\\n\",Msg,a);\n\tfclose(Prot);\n};\n\nvoid Protocol(char *Msg, HugeNumber &a)\n{\n\tchar Buf[222];\n\n   Prot=fopen(\"Prot.txt\",\"at\");\n\n\ta.ToStr(Buf,222);\n\tprintf(\"%s %s (hex)\\n\",Msg,Buf);\n\tfprintf(Prot,\"%s %s (hex)\\n\",Msg,Buf);\n\tfclose(Prot);\n};\n\nvoid PrintCode(const unsigned char *Msg, const long MsgLen)\n// Vivod zakodirovannogo soovshenija v 'krasivom' vide\n{\n\tconst int MaxLen=24;\n\tint i,j;\n\n\tj=0;\n\tfor (i=0; i<int(MsgLen); i++)\n\t{\n\t\tif (j%2 == 0 && j!=0) printf(\" \");\n\t\tif (j>=MaxLen)\n\t\t{\n\t\t\tj=0;\n\t\t\tprintf(\"\\n\");\n\t\t};\n\t\tprintf(\"%02X\",Msg[i]);\n\t\tj++;\n\t};\n\tprintf(\"\\n\");\n};\n\nvoid PrintChar(unsigned char *ch, const long len)\n{\n\tint i;\n\n\tfor (i=0; i<len; i++) printf(\"%02X \",ch[i]);\n\tprintf(\"\\n\");\n};\n\n"
  },
  {
    "path": "Bundles/Echoware/RSA/Myprint.h",
    "content": "#ifndef __MyPrint\n#define __MyPrint\n\n#include <stdio.h>\n\n#include \"MyNum.h\"\n\nextern FILE *Prot;\nextern void Protocol(char *Msg);\nextern void Protocol(char *Msg, MyNum &a);\nextern void Protocol(char *Msg, HugeNumber &a);\nextern void ProtocolF(const char *Msg, float a);\nextern void PrintCode(const unsigned char *Msg, const long MsgLen);\nextern void PrintChar(unsigned char *ch, const long len);\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/RSA/Operator.cpp",
    "content": "/*\nIgorSharov@rambler.ru\n*/\n#include \"stdafx.h\"\n\n#include \"HNumber.h\"\n\nint operator !=( const HugeNumber &test1, const HugeNumber &test2 )\n// 1 esli test1!=test2, inache 0\n{\n\tword i,r1,r2;\n\n\tr1=test1.Razr(); r2=test2.Razr();\n\tif (r1 != r2) return 1;\n\n\tfor (i=0; i<r1; i++)\n\t{\n\t\tif (test1.digit[i] != test2.digit[i]) return 1;\n\t};\n\treturn 0;\n};\n\nint operator == ( const HugeNumber &test1, const HugeNumber &test2 )\n// 1 esli test1==test2, inache 0\n{\n\tword i,r1,r2;\n\n\tr1=test1.Razr(); r2=test2.Razr();\n\tif (r1 != r2) return 0;\n\n\tfor (i=0; i<r1; i++)\n\t{\n\t\tif (test1.digit[i] != test2.digit[i]) return 0;\n\t};\n\treturn 1;\n};\n\nint operator < ( const HugeNumber &test1, const HugeNumber &test2 )\n// 1 elsi test1<test2, inache 0\n{\n\tsize_t r1,r2;\n\tint i;\n\n\tr1=test1.Razr(); r2=test2.Razr();\n\tif (r1 < r2) return 1;\n\tif (r1 > r2) return 0;\n\n\t// V chislax odinakovoe kolichestvo razriadov\n\tfor (i=r1-1; i>=0; i--)\n\t{\n\t\tif (test1.digit[i] < test2.digit[i]) return 1;\n\t\tif (test1.digit[i] > test2.digit[i]) return 0;\n\t};\n\treturn 0;\n};\n\nint operator > ( const HugeNumber &test1, const HugeNumber &test2 )\n// 1 esli test1<test2, inache 0\n{\n\tsize_t r1,r2;\n\tint i;\n\n\tr1=test1.Razr(); r2=test2.Razr();\n\tif (r1 > r2) return 1;\n\tif (r1 < r2) return 0;\n\n\t// V chislax odinakovoe kolichestvo razriadov\n\tfor (i=r1-1; i>=0; i--)\n\t{\n\t\tif (test1.digit[i] > test2.digit[i]) return 1;\n\t\tif (test1.digit[i] < test2.digit[i]) return 0;\n\t};\n\treturn 0;\n};\n\nint operator <=( const HugeNumber &test1, const HugeNumber &test2 )\n// 1 esli test1<=test2, inache 0\n{\n\tsize_t r1,r2;\n\tint i;\n\n\tr1=test1.Razr(); r2=test2.Razr();\n\tif (r1 < r2) return 1;\n\tif (r1 > r2) return 0;\n\n\t// V chislax odinakovoe kolichestvo razriadov\n\tfor (i=r1-1; i>=0; i--)\n\t{\n\t\tif (test1.digit[i] <= test2.digit[i]) return 1;\n\t\tif (test1.digit[i] >  test2.digit[i]) return 0;\n\t};\n\treturn 0;\n};\n"
  },
  {
    "path": "Bundles/Echoware/RSA/Operator.h",
    "content": "#ifndef __Operator_H\n#define __Operator_H\n\n#include \"HNumber.h\"\n\nextern int operator !=( const HugeNumber & test1, const HugeNumber & test2 );\nextern int operator == ( const HugeNumber & test1, const HugeNumber & test2 );\nextern int operator < ( const HugeNumber & test1, const HugeNumber & test2 );\nextern int operator > ( const HugeNumber & test1, const HugeNumber & test2 );\nextern int operator <=( const HugeNumber & test1, const HugeNumber & test2 );\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/RSA/PrimeGen.cpp",
    "content": "/*\nIgorSharov@rambler.ru\n*/\n#include \"stdafx.h\"\n#include <Time.h>\n#include \"HNumber.h\"\n#include \"HNFunct.h\"\n#include \"Operator.h\"\n#include \"MyPrint.h\"\n#include \"CommonF.h\"\n#include \"MyTypes.h\"\n\n#define MaxInt (int)(2147483647)\n\nextern time_t Misha_Time;\nextern long int random(long int);\n\nvoid NextPrime(int &intA)\n{\n   for (;;)\n   {\n      intA+=2;\n      if (LongIsPrime(intA)) break;\n   };\n};\n\nint Rabin(int t, HugeNumber &S, HugeNumber &m, HugeNumber &mm1)\n// Test Rabina. Ispityemoe chislo imeet vid mm1=m-1=(2^t)*s\n// returns:\n//   0 if x - sostavnoe chislo\n//  -1 esli ne ydjotsia ystanovit, chto x- sostavnoe\n{\n   HugeNumber s,x,b;\n   word wi;\n   int i,flag;\n\n   Protocol(\"Rabin's test is working\");\n   // s dolgno bit nechiotnim\n   for (s=S;;)\n   {\n      Div1(s,2,x,wi);\n      if (wi!=0) break;\n      s=x; t++;\n      if (t==MaxInt)\n      {\n         Protocol(\"Rabin: t is too big!\");\n         return -1;\n      };\n   };\n\n   if (t==0) return -1;\n\n   i=m.Razr()-1;\n   if (i>0)\n      b.Random(i);\n   else\n      b.digit[0]=2+random(UnsignedLong(m)-2);\n\n   ModPower(x,b,s,m);\n   // x==(b^s) mod m\n   if (x!=one && x!=mm1)\n      flag=1;\n   else\n      flag=0;\n\n   for (i=1; i<=t; i++)\n   {\n      x=x*x;\n      x=x%m;\n      if (flag==1 && x==one) return 0;\n      if (x!=one && x!=mm1)\n         flag=1;\n      else\n         flag=0;\n   };\n   if (x!=one)\n      return 0;\n   else\n      return -1;\n};\n\nint Test1(HugeNumber &a, HugeNumber &n, HugeNumber &nm1, HugeNumber &degree)\n// Function returns\n// -1 - n is prime\n// +1 - We need aditionl checks for n\n//  0 - n is not prime\n{\n   HugeNumber b;\n\n   Protocol(\"Main test is working.\");\n   //Protocol(\"n=\",n);\n   // Now: nm1=(2^s)*k, n=nm1+1, k<2^s, degree=(n-1)/2\n\n   ModPower(b,a,degree,n);\n   if (b==nm1) return -1;\n   if (b==one) return +1;\n   return 0;\n};\n\nint Test2(HugeNumber &x)\n// Returns:\n//   0 if x - sjstavnoe chislo\n//  -1 if ne ydajotsia ystanovit, chto x ne prostoe chislo\n{\n   HugeNumber tmp;\n   word wi;\n   int i;\n\n   Div1(x,2,tmp,wi);\n   if (wi==0) return 0;\n   for (i=3; i<base; i+=2)\n   {\n      if (LongIsPrime(i))\n      {\n         Div1(x,i,tmp,wi);\n         if (wi==0) return 0;\n      };\n   };\n   return -1;\n};\n\nvoid MakePrime(int intS, HugeNumber &n)\n// Generator prostix chisel na osnove teoremi, kotoryiy mne dal Misha\n// intS  - stepen dvojki\n{\n   int intA,i,j,BitsPerDigit,counter=0;\n   HugeNumber k,tmp,degree,c,nm1,kMax,HNintA,HNtmp2;\n   word wi;\n   time_t t1=clock();\n\n   #ifdef HexBase\n      BitsPerDigit=BaseRazr()*4;\n   #else\n  //    Can't work in unhexdecimal system!\n   #endif\n\n   //ProtocolF(\"s=\",(float)intS);\n\tHNtmp2=intS;\n   Power(kMax,two,HNtmp2);\n   kMax=kMax-one;\n   k.Random(intS/BitsPerDigit);  // Slychiajnoe k < 2^s\n   for (;;)\n   {\n      k=k+one;\n      for(;k>kMax;) k.Random(intS/BitsPerDigit);  // Slychiajnoe k < 2^s\n      intA=3;\n      // Vibirajy osnovanie modylnoj eksponenti\n      // a and k dolgni bit vzaimno prosty\n      for (;;)\n      {\n         Div1(k,intA,tmp,wi);\n         if (wi!=0) break;\n         NextPrime(intA);\n         if (intA>=base)\n         {\n            intA=3;\n            k.Random(intS/12);  // Slychiajnoe k < 2^s\n         };\n      };\n\n\t  HNtmp2=intS-1;\n      Power(tmp,two,HNtmp2);  // tmp == 2^(s-1)\n\t\t// Zdes ymnogenie na stepen dvojki mogno zamenit sdvigom.\n      degree=k*tmp;           // degree ==(n-1)/2\n                              // Note: n will be defined a bit later\n      //Protocol(\"degree=\",degree);\n\t\t// Zdes toge mogno primenit sdvig\n      Mult1(tmp,2,c);\n      // Now: c=2^s\n      nm1=c*k;\n      // Now: nm1=(2^s)*k\n      n=nm1+one;                // Here n is defined\n      //Protocol(\"n=\",n);\n\n\t\t// Nachnajy sikl proverok chisla\n      for (wi=1;wi==1;)\n      {\n\t\t\t// Test na malii mnogiteli\n         i=Test2(n);\n         if (i==0) break;\n\n\t\t\t// Test Rabina\n         i=Rabin(intS,k,n,nm1);\n         if (i==0) break;\n\n\t\t\t// Vipolnit osnovnoj test na prostoty\n         for (j=0;j<5;j++)\n         {\n\t\t\tHNintA=intA;\n\t\t\t i=Test1(HNintA, n, nm1, degree); counter++;\n            if (i==0)\n            {\n               Protocol(\"n is not prime!\");\n               break;\n            };\n            if (i==-1)\n            {\n               Protocol(\"n is prime!\");\n               break;   // n is prime!\n            };\n            if (i==1)\n            {\n               Protocol(\"We need aditional checks for n\");\n               NextPrime(intA);\n\t\t\t\t\t// Ja xochy chtiby vsegda intA<base\n               if (intA>=base) i=0;\n            };\n            if (i!=1) break;\n         };\n\t\t\t// Esli osnovnoj test ne smog opredelit prostoty za pjat\n\t\t\t// popitok, to bery drugoe chislo\n         if (j==5) break;\n         wi=i;\n      };\n      if (i==-1) break;\n   };\n   //ProtocolF(\"GeneratePrime: Digits in n=\",(float)BytesInHN(n));\n   //ProtocolF(\"GeneratePrime: counter=\",(float)counter);\n   Misha_Time+=clock()-t1;\n   //ProtocolF(\"GeneratePrime: Misha_Time=\",(float)Misha_Time/CLK_TCK);\n};\n\n"
  },
  {
    "path": "Bundles/Echoware/RSA/Profiler.h",
    "content": "#ifndef __Profiler\n#define __Profiler\n\n#include <time.h>\n#define TimeDim 11\n\nextern time_t Time[TimeDim];\nextern void ResetTime();\n\n#endif\n"
  },
  {
    "path": "Bundles/Echoware/RSA/RSA.dsp",
    "content": "# Microsoft Developer Studio Project File - Name=\"RSA\" - Package Owner=<4>\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\n# ** DO NOT EDIT **\n\n# TARGTYPE \"Win32 (x86) Static Library\" 0x0104\n\nCFG=RSA - Win32 Debug\n!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n!MESSAGE use the Export Makefile command and run\n!MESSAGE\n!MESSAGE NMAKE /f \"RSA.mak\".\n!MESSAGE\n!MESSAGE You can specify a configuration when running NMAKE\n!MESSAGE by defining the macro CFG on the command line. For example:\n!MESSAGE\n!MESSAGE NMAKE /f \"RSA.mak\" CFG=\"RSA - Win32 Debug\"\n!MESSAGE\n!MESSAGE Possible choices for configuration are:\n!MESSAGE\n!MESSAGE \"RSA - Win32 Release\" (based on \"Win32 (x86) Static Library\")\n!MESSAGE \"RSA - Win32 Debug\" (based on \"Win32 (x86) Static Library\")\n!MESSAGE\n\n# Begin Project\n# PROP AllowPerConfigDependencies 0\n# PROP Scc_ProjName \"\"\n# PROP Scc_LocalPath \"\"\nCPP=cl.exe\nRSC=rc.exe\n\n!IF  \"$(CFG)\" == \"RSA - Win32 Release\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 0\n# PROP BASE Output_Dir \"Release\"\n# PROP BASE Intermediate_Dir \"Release\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 0\n# PROP Output_Dir \"Release6\"\n# PROP Intermediate_Dir \"Release6\"\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_MBCS\" /D \"_LIB\" /YX /FD /c\n# ADD CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_MBCS\" /D \"_LIB\" /YX /FD /c\n# ADD BASE RSC /l 0x409 /d \"NDEBUG\"\n# ADD RSC /l 0x409 /d \"NDEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLIB32=link.exe -lib\n# ADD BASE LIB32 /nologo\n# ADD LIB32 /nologo /out:\"..\\Release6\\RSA.lib\"\n\n!ELSEIF  \"$(CFG)\" == \"RSA - Win32 Debug\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 1\n# PROP BASE Output_Dir \"RSA___Win32_Debug\"\n# PROP BASE Intermediate_Dir \"RSA___Win32_Debug\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 1\n# PROP Output_Dir \"Debug6\"\n# PROP Intermediate_Dir \"Debug6\"\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_MBCS\" /D \"_LIB\" /YX /FD /GZ /c\n# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_MBCS\" /D \"_LIB\" /YX /FD /GZ /c\n# ADD BASE RSC /l 0x409 /d \"_DEBUG\"\n# ADD RSC /l 0x409 /d \"_DEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLIB32=link.exe -lib\n# ADD BASE LIB32 /nologo\n# ADD LIB32 /nologo /out:\"..\\Debug6\\RSA.lib\"\n\n!ENDIF\n\n# Begin Target\n\n# Name \"RSA - Win32 Release\"\n# Name \"RSA - Win32 Debug\"\n# Begin Group \"Source Files\"\n\n# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat\"\n# Begin Source File\n\nSOURCE=.\\Code.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Commonf.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Gsimply.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Hnfunct.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Hnumber.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Keys.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Keys_main.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Mynum.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Myprint.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Operator.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\PrimeGen.cpp\n# End Source File\n# Begin Source File\n\nSOURCE=.\\stdafx.cpp\n# End Source File\n# End Group\n# Begin Group \"Header Files\"\n\n# PROP Default_Filter \"h;hpp;hxx;hm;inl\"\n# Begin Source File\n\nSOURCE=.\\Commonf.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Function.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Gsimply.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Hnfunct.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\HNumber.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\MyNum.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Myprint.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\MyTypes.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Operator.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\Profiler.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\StdAfx.h\n# End Source File\n# Begin Source File\n\nSOURCE=.\\TMSG.H\n# End Source File\n# End Group\n# End Target\n# End Project\n"
  },
  {
    "path": "Bundles/Echoware/RSA/RSA.vcproj",
    "content": "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"7.00\"\n\tName=\"RSA\"\n\tProjectGUID=\"{3FEAADB2-4A97-473B-8839-4E97C0CD4F4B}\"\n\tKeyword=\"Win32Proj\">\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"/>\n\t</Platforms>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|Win32\"\n\t\t\tOutputDirectory=\"Debug\"\n\t\t\tIntermediateDirectory=\"Debug\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\">\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_LIB\"\n\t\t\t\tMinimalRebuild=\"TRUE\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"5\"\n\t\t\t\tUsePrecompiledHeader=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"TRUE\"\n\t\t\t\tDebugInformationFormat=\"4\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"../$(OutDir)/RSA.lib\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|Win32\"\n\t\t\tOutputDirectory=\"Release\"\n\t\t\tIntermediateDirectory=\"Release\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\">\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"2\"\n\t\t\t\tInlineFunctionExpansion=\"1\"\n\t\t\t\tOmitFramePointers=\"TRUE\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_LIB\"\n\t\t\t\tStringPooling=\"TRUE\"\n\t\t\t\tRuntimeLibrary=\"4\"\n\t\t\t\tEnableFunctionLevelLinking=\"TRUE\"\n\t\t\t\tUsePrecompiledHeader=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"TRUE\"\n\t\t\t\tDebugInformationFormat=\"3\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"../$(OutDir)/RSA.lib\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"/>\n\t\t</Configuration>\n\t</Configurations>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"Source Files\"\n\t\t\tFilter=\"cpp;c;cxx;def;odl;idl;hpj;bat;asm\">\n\t\t\t<File\n\t\t\t\tRelativePath=\"Code.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Commonf.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Gsimply.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Hnfunct.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Hnumber.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Keys.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Keys_main.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Mynum.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Myprint.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Operator.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"PrimeGen.cpp\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"stdafx.cpp\">\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Debug|Win32\">\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tUsePrecompiledHeader=\"1\"/>\n\t\t\t\t</FileConfiguration>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Release|Win32\">\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tUsePrecompiledHeader=\"1\"/>\n\t\t\t\t</FileConfiguration>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Header Files\"\n\t\t\tFilter=\"h;hpp;hxx;hm;inl;inc\">\n\t\t\t<File\n\t\t\t\tRelativePath=\"Commonf.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Function.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Gsimply.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"HNumber.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Hnfunct.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"MyNum.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"MyTypes.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Myprint.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Operator.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"Profiler.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"StdAfx.h\">\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"TMSG.H\">\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Resource Files\"\n\t\t\tFilter=\"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe\">\n\t\t</Filter>\n\t\t<File\n\t\t\tRelativePath=\"ReadMe.txt\">\n\t\t</File>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "Bundles/Echoware/RSA/StdAfx.h",
    "content": "// stdafx.h : include file for standard system include files,\n// or project specific include files that are used frequently, but\n// are changed infrequently\n//\n\n#pragma once\n\n#define WIN32_LEAN_AND_MEAN\t\t// Exclude rarely-used stuff from Windows headers\n\n// TODO: reference additional headers your program requires here\n#include <stdio.h>"
  },
  {
    "path": "Bundles/Echoware/RSA/TMSG.H",
    "content": "#ifndef __TMsg\n#define __TMsg\n// Class for encoding/decoding operations. Any message for\n// coding should be represented as an object of this class.\nclass TMsg\n{\n\tpublic:\n\t\tunsigned int   size;\n\t\tunsigned char *value;\n\n\t\tTMsg();\n\t\t~TMsg();\n\t\tvoid UCharToMsg(const unsigned char *source, const unsigned int slen);\n\t\tvoid AddBytes(unsigned char *bytes, unsigned int len);\n\t\tvoid FreeMem();\n\t\tvoid Resize(const unsigned int NewSize);\n};\n#endif\n"
  },
  {
    "path": "Bundles/Echoware/RSA/stdafx.cpp",
    "content": "// stdafx.cpp : source file that includes just the standard includes\n// RSA.pch will be the pre-compiled header\n// stdafx.obj will contain the pre-compiled type information\n\n#include \"stdafx.h\"\n\n// TODO: reference any additional headers you need in STDAFX.H\n// and not in this file\n"
  },
  {
    "path": "Bundles/Echoware/RSAKeys.cpp",
    "content": "#include \"stdafx.h\"\n#include \"RSAKeys.h\"\n#include <time.h>\n#include \"RSA/HNumber.h\"\n#include \"RSA/Hnfunct.h\"\n#include \"blowfish.h\"\n#include \"rsa/operator.h\"\n\n#define DFLT_GENERATOR\t    \"2\"\n#define DFLT_MODULUS \"7212610147295474909544523785043492409969382148186765460082500085393519556525921455588705423020751421\"\n\nCRSAKeys::CRSAKeys()\n{\n}\n\nCRSAKeys::~CRSAKeys()\n{\n}\n\nconst char* CRSAKeys::GetPublicKey() const\n{\n\treturn m_pPublicKey;\n}\n\nconst char* CRSAKeys::GetPrivateKey() const\n{\n\treturn m_pPrivateKey;\n}\n\nint CRSAKeys::GetPublicKeyLength() const\n{\n\treturn RSA_PUBLIC_KEY * size_of;\n}\n\nint CRSAKeys::GetPrivateKeyLength() const\n{\n\treturn RSA_PRIVATE_KEY;\n}\n\nvoid CRSAKeys::GenerateRandomPrivateKey(char* pKey)\n{\n\tunsigned long temp[5] ;\n\tmemset(temp, 0x00, 16);\n\tunsigned long randomNo;\n\n\tmemset(pKey, 0x00, RSA_PRIVATE_KEY + 1);\n\tfor(int index = 0; index < 5; index++)\n\t{\n\t\tsrand( (unsigned)time( NULL ) + index);\n\t\trandomNo = rand() * rand();\n\t\ttemp[index] = randomNo;\n\t}\n\tsprintf(pKey, \"%08lx%08lx%08lx%08lx%08lx\", temp[0], temp[1], temp[2], temp[3], temp[4]);\n\tpKey[RSA_PRIVATE_KEY] ='\\0';\n}\n\nvoid CRSAKeys::GeneratePublicKey()\n{\n\t//code for Public key generation\n\tHugeNumber Y,x,n,f;\n\tx=HugeNumber(DFLT_GENERATOR);\n\tf=HugeNumber(DFLT_MODULUS);\n\tn=HugeNumber(m_pPrivateKey);\n\t//::ModPower(Y,x,n,f);//execute the modpower function Get the public key as HugeNumber\n\tModPower(x,n,f,Y);\n\n\tmemset(m_pPublicKey, 0, RSA_PUBLIC_KEY * size_of);\n\tmemcpy(m_pPublicKey, Y.digit, RSA_PUBLIC_KEY * size_of); // copy the huge number digit buffer to char *\n\n\tmemset(m_pPublicKeyLE, 0, RSA_PUBLIC_KEY * size_of);\n\t// Mac OS X must swap these for a big endian machine\n\tif (1)\n\t{\n\t\tfor (int i = 0; i < RSA_PUBLIC_KEY; i++)\n\t\t{\n\t\t\tword value = OSSwapHostToLittleInt32(Y.digit[i]);\n\t\t\tmemcpy(m_pPublicKeyLE + i * size_of, &value, size_of);\n\t\t}\n\t}\n}\n\nvoid CRSAKeys::GenerateSessionKey(char* szPeerPublicKey, char* szSessionKey)\n{\n\tHugeNumber Y,n,f,h1;\n\tword *tmp = (word*)szPeerPublicKey;//convert form liitle to host\n\tfor (int i = 0; i < RSA_PUBLIC_KEY; i++)\n\t{\n\t\tword value = OSSwapLittleToHostInt32(tmp[i]);\n\t\th1.digit[i] = value;\n\t}\n//\tmemcpy(h1.digit, szPeerPublicKey, RSA_PUBLIC_KEY * size_of);\n\tmemset(szSessionKey, 0, 1024);\n\n\tf=HugeNumber(DFLT_MODULUS);\n\tn=HugeNumber(m_pPrivateKey);\n\t//::ModPower(Y,h1,n,f);\n\tModPower(h1,n,f,Y);\n\tszSessionKey=Y.ToHexStr(szSessionKey,1024 );\n}\n\nvoid CRSAKeys::Generate()\n{\n\tGenerateRandomPrivateKey(m_pPrivateKey);\n\t// Generate public key (deffie hellman)\n\tGeneratePublicKey();\n}\n\nvoid CRSAKeys::EncryptPassword(char* pData, DWORD dwDataLength, const char* strPass, char* output)\n{\n\tHugeNumber Y,n,f,h1;\n\tif (1)\n\t{\n\t\tword *publicKeyPointer = (word *)pData;\n\t\tfor (int i = 0; i < dwDataLength / size_of; i++)\n\t\t{\n\t\t\th1.digit[i] = OSSwapLittleToHostInt32(publicKeyPointer[i]);\n\t\t}\n\t}\n\telse\n\t\tmemcpy(h1.digit, pData, dwDataLength);\n\n\tchar* pSessionKey = new char[1024];\n\tmemset(pSessionKey, 0, 1024);\n\n\tf=HugeNumber(DFLT_MODULUS);\n\t//::ModPower(Y,h1,n,f);\n\n\tn=HugeNumber(m_pPrivateKey);\n\tModPower(h1,n,f,Y);\n\tpSessionKey = Y.ToHexStr(pSessionKey, 1024);\n\n\t//const char* data = strPass;\n\tchar* data = new char[dwDataLength];\n\tmemset(data, 0, dwDataLength);\n\tmemcpy(data, strPass, min(strlen(strPass), dwDataLength));\n\n\t//translate data to HOST endian\n\tword *dwData = (word*)data;\n\tfor (int i = 0; i < dwDataLength / size_of; i++)\n\t{\n\t\tdwData[i] = OSSwapLittleToHostInt32(dwData[i]);\n\t}\n\n\tCBlowFish blowfish;\n\tblowfish.Initialize((BYTE*)pSessionKey, strlen(pSessionKey));\n\tblowfish.Encode((BYTE*)data, (BYTE*)output, dwDataLength);\n\n\t//SS: added change to big endian\n\tword *publicKeyPointer = (word*)output;\n\tfor (int i = 0; i < dwDataLength / size_of; i++)\n\t{\n\t\tpublicKeyPointer[i] = OSSwapHostToLittleInt32(publicKeyPointer[i]);\n\t}\n\tdelete []pSessionKey;\n\tdelete []data;\n}\n\n//\"Right to Left Binary Algorithm\" from http://en.wikipedia.org/wiki/Modular_exponentiation\n//r=(b^e)(mod m)\nvoid CRSAKeys::ModPower(HugeNumber& b, HugeNumber& e, HugeNumber& m, HugeNumber& r)\n{\n\tr=\"1\";\n\n\tHugeNumber zero(\"0\");\n\tHugeNumber two(\"2\");\n\n\twhile (e > zero)\n\t{\n\t\t//if (e & 1 > 0)\n\t\t//if ((e % two) > zero)\n\t\tif (e.digit[0] % 2 != 0)\n\t\t{\n\t\t\tr=r * b;\n\t\t\tr=r % m;\n\t\t}\n\n\t\te = e / two;\n\t\tb = (b * b);\n\t\tb = (b % m);\n\t}\n}"
  },
  {
    "path": "Bundles/Echoware/RSAKeys.h",
    "content": "#ifndef _RSAKEYS_H\n#define _RSAKEYS_H\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n#include \"rsa/HNumber.h\"\n\n#define RSA_PUBLIC_KEY\t80\n#define RSA_PRIVATE_KEY\t40\n#define size_of sizeof(word)\n\nclass CRSAKeys\n{\npublic:\n\tCRSAKeys();\n\tvirtual ~CRSAKeys();\n\n\t//Generate the Deffie Hellman key pair\n\tvoid Generate();\n\n\tconst char* GetPublicKey() const;\n\tconst char* GetPrivateKey() const;\n\n\tint GetPublicKeyLength() const;\n\tint GetPrivateKeyLength() const;\n\n\tvoid EncryptPassword(char* pData, DWORD dwDataLength, const char* strPass, char* output);\n\n\tvoid GenerateSessionKey(char* szPeerPublicKey, char* szSessionKey);\n\n\tchar m_pPublicKeyLE[RSA_PUBLIC_KEY * size_of];\n\nprotected:\n\t//Generate the random private key\n\tvoid GenerateRandomPrivateKey(char* pKey);\n\t//Generate the public key for the private key\n\tvoid GeneratePublicKey();\n\n\t//\"Right to Left Binary Algorithm\" from http://en.wikipedia.org/wiki/Modular_exponentiation\n\t//r=(b^e)(mod m)\n\tvoid ModPower(HugeNumber& b, HugeNumber& e, HugeNumber& m, HugeNumber& r);\n\nprotected:\n\tchar m_pPublicKey[RSA_PUBLIC_KEY * size_of];\n\tchar m_pPrivateKey[RSA_PRIVATE_KEY + 1];\n};\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/ServerListSynchronize.cpp",
    "content": "/*\n *  ServerListSynchronize.cpp\n *  Echoware\n *\n *  Created by admin on 2/21/07.\n *  Copyright 2007 __MyCompanyName__. All rights reserved.\n *\n */\n\n#include \"ServerListSynchronize.h\"\n#include \"EchoToOSX.h\"\n#include \"ProxiesManager.h\"\n#include \"MyDllProxyInfo.h\"\n#include \"globals.h\"\n\nCServerListSynchronize::CServerListSynchronize()\n{\n\tm_fInitialized = false;\n\techo = nil;\n}\n\nCServerListSynchronize::~CServerListSynchronize()\n{\n\tif (echo)\n\t{\n\t\tint count = [echo->echoInfoProxys count];\n\t\twhile (count > 0)\n\t\t{\n\t\t\tcount--;\n\t\t\tCMyDllProxyInfo *pMyProxyInfo = (CMyDllProxyInfo*)[[echo->echoInfoProxys objectAtIndex:count] pointerValue];\n\t\t\tdelete pMyProxyInfo;\n\t\t}\n\t}\n\n\tm_hManageThread_Connect = 0;\n\tm_dwManageThread_Connect = 0;\n\tm_hManageThread_Remove = 0;\n\tm_dwManageThread_Remove = 0;\n\tm_hManageThread_Update = 0;\n\tm_dwManageThread_Update = 0;\n\n\techo = nil;\n}\n\nvoid CServerListSynchronize::Init()\n{\n\tif (!m_fInitialized)\n\t{\n\t\tm_hManageThread_Connect = 0;\n\t\tm_dwManageThread_Connect = 0;\n\t\tm_hManageThread_Remove = 0;\n\t\tm_dwManageThread_Remove = 0;\n\t\tm_hManageThread_Update = 0;\n\t\tm_dwManageThread_Update = 0;\n\n\t\techo = nil;\n\n\t\tm_fTerminated_Connect = false;\n\t\tm_fTerminated_Remove = false;\n\t\tm_fTerminated_Update = false;\n\n\t\tm_fTerminated = false;\n\n\t\tm_fHasQuit_Connect = false;\n\t\tm_fHasQuit_Remove = false;\n\t\tm_fHasQuit_Update = false;\n\n\t\tm_fStatusChanged = false;\n\t\tm_fInitialized = true;\n\t}\n}\n\nvoid CServerListSynchronize::Start(EchoController *echo)\n{\n\tm_fTerminated_Connect = false;\n\tm_fTerminated_Remove = false;\n\tm_fTerminated_Update = false;\n\n\tm_fTerminated = false;\n\n\tm_fHasQuit_Connect = false;\n\tm_fHasQuit_Remove = false;\n\tm_fHasQuit_Update = false;\n\n\tthis->echo = echo;\n\n\tm_hManageThread_Connect = CreateThread(0, 0, ManageThreadProc_Connect, this, 0, &m_dwManageThread_Connect);\n\tm_hManageThread_Remove = CreateThread(0, 0, ManageThreadProc_Remove, this, 0, &m_dwManageThread_Remove);\n\tm_hManageThread_Update = CreateThread(0, 0, ManageThreadProc_Update, this, 0, &m_dwManageThread_Update);\n}\n\nvoid CServerListSynchronize::Terminate()\n{\n\tm_fHasQuit_Update = false;\n\tm_fHasQuit_Connect = false;\n\tm_fHasQuit_Remove = false;\n\n\tm_fTerminated_Update = true;\n\tm_fTerminated_Connect = true;\n\tm_fTerminated_Remove = true;\n\n\tunsigned long timeout = 5000;\n\n\tShutdownThread(m_hManageThread_Update, timeout, &m_fTerminated_Update, &m_fHasQuit_Update);\n\tShutdownThread(m_hManageThread_Connect, timeout, &m_fTerminated_Connect, &m_fHasQuit_Connect);\n\tShutdownThread(m_hManageThread_Remove, timeout, &m_fTerminated_Remove, &m_fHasQuit_Remove);\n\n\tm_fTerminated = true;\n}\n\nbool CServerListSynchronize::getStatusChanged()\n{\n\treturn m_fStatusChanged;\n}\n\nvoid CServerListSynchronize::setStatusChanged(bool value)\n{\n\tm_fStatusChanged = value;\n}\n\nunsigned long CServerListSynchronize::ManageThreadProc_Connect(void* lpParameter)\n{\n\tCServerListSynchronize* sls = (CServerListSynchronize*)lpParameter;\n\n\twhile (true)\n\t{\n\t\tsls->m_critSection.Lock();\n\n\t\tif (sls->m_fTerminated_Connect)\n\t\t{\n\t\t\tsls->m_critSection.Unlock();\n\t\t\tbreak;\n\t\t}\n\n\t\tif (sls->echo)\n\t\t{\n\t\t\tint count = [sls->echo->echoInfoProxys count];\n\t\t\tint ind = 0;\n\t\t\twhile (ind < count)\n\t\t\t{\n\t\t\t\tCMyDllProxyInfo *pMyProxyInfo = [sls->echo getDllProxyInfo: ind];\n\t\t\t\tif (pMyProxyInfo == NULL)\n\t\t\t\t{\n\t\t\t\t\tind++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tIDllProxyInfo *echoProxyInfo = pMyProxyInfo->getDllProxyInfo();\n\n\t\t\t\tswitch(pMyProxyInfo->getStatus())\n\t\t\t\t{\n\t\t\t\t\tcase CMyDllProxyInfo::Connecting:\n\t\t\t\t\t{\n\t\t\t\t\t\tNSLog(@\"Connecting...\");\n\n\t\t\t\t\t\tint ind = [sls->echo->echoTableView selectedRow];\n\t\t\t\t\t\t[sls->echo reloadData];\n\t\t\t\t\t\t[sls->echo selectRow: ind];\n\n\t\t\t\t\t\techoProxyInfo->SetReconnectProxy(false);\n\t\t\t\t\t\tint connectResult = ConnectProxy(echoProxyInfo);\n\t\t\t\t\t\tswitch (connectResult)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\techoProxyInfo->SetReconnectProxy(true);\n\t\t\t\t\t\t\tNSLog(@\"Status: Connected\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tNSLog(@\"Status: No Server Avail\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tNSLog(@\"Status: Auth Failed\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\techoProxyInfo->SetReconnectProxy(true);\n\t\t\t\t\t\t\tNSLog(@\"Status: Already Active\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\techoProxyInfo->SetReconnectProxy(true);\n\t\t\t\t\t\t\tNSLog(@\"Status: Timed Out\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tNSLog(@\"Status: Unknown Return Code\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (pMyProxyInfo->getStatus() == CMyDllProxyInfo::Connecting)\n\t\t\t\t\t\t\tpMyProxyInfo->RemoveStatus();\n\t\t\t\t\t\tpMyProxyInfo->setPrevStatus(echoProxyInfo->GetStatus());\n\n\t\t\t\t\t\tind = [sls->echo->echoTableView selectedRow];\n\t\t\t\t\t\t[sls->echo reloadData];\n\t\t\t\t\t\t[sls->echo selectRow: ind];\n\n\t\t\t\t\t\tNSLog(@\"Connected...\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase CMyDllProxyInfo::Reconnecting:\n\t\t\t\t\t{\n\t\t\t\t\t\tNSLog(@\"Reconnecting...\");\n\n\t\t\t\t\t\tint ind = [sls->echo->echoTableView selectedRow];\n\t\t\t\t\t\t[sls->echo reloadData];\n\t\t\t\t\t\t[sls->echo selectRow: ind];\n\n\t\t\t\t\t\techoProxyInfo->SetReconnectProxy(false);\n\t\t\t\t\t\tint status = echoProxyInfo->GetStatus();\n\t\t\t\t\t\tif (!(status & STATUS_DISCONNECTED_FROM_PROXY) && status)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbool disconnected = DisconnectProxy(echoProxyInfo);\n\t\t\t\t\t\t\tpMyProxyInfo->WaitForStatus(STATUS_DISCONNECTED_FROM_PROXY, 500000);\n\t\t\t\t\t\t\tif (disconnected)\n\t\t\t\t\t\t\t\tNSLog(@\"Disconnected...\");\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tNSLog(@\"Not disconnected...\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tint connectResult = ConnectProxy(echoProxyInfo);\n\t\t\t\t\t\tswitch (connectResult)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\techoProxyInfo->SetReconnectProxy(true);\n\t\t\t\t\t\t\tNSLog(@\"Status: Connected\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tNSLog(@\"Status: No Server Avail\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tNSLog(@\"Status: Auth Failed\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\techoProxyInfo->SetReconnectProxy(true);\n\t\t\t\t\t\t\tNSLog(@\"Status: Already Active\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\techoProxyInfo->SetReconnectProxy(true);\n\t\t\t\t\t\t\tNSLog(@\"Status: Timed Out\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tNSLog(@\"Status: Unknown Return Code\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (pMyProxyInfo->getStatus() == CMyDllProxyInfo::Reconnecting)\n\t\t\t\t\t\t\tpMyProxyInfo->RemoveStatus();\n\t\t\t\t\t\tpMyProxyInfo->setPrevStatus(echoProxyInfo->GetStatus());\n\n\t\t\t\t\t\tind = [sls->echo->echoTableView selectedRow];\n\t\t\t\t\t\t[sls->echo reloadData];\n\t\t\t\t\t\t[sls->echo selectRow: ind];\n\n\t\t\t\t\t\tNSLog(@\"Reconnected...\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tind++;\n\t\t\t}\n\t\t}\n\n\t\tsls->m_critSection.Unlock();\n\t\tSleep(1000000);\n\t}\n\n\tsls->m_fHasQuit_Connect = true;\n\treturn 0;\n}\n\nunsigned long CServerListSynchronize::ManageThreadProc_Remove(void* lpParameter)\n{\n\tCServerListSynchronize* sls = (CServerListSynchronize*)lpParameter;\n\n\twhile (true)\n\t{\n\t\tsls->m_critSectionRemove.Lock();\n\n\t\tif (sls->m_fTerminated_Remove)\n\t\t{\n\t\t\tsls->m_critSectionRemove.Unlock();\n\t\t\tbreak;\n\t\t}\n\n\t\tif (sls->echo)\n\t\t{\n\t\t\tint count = [sls->echo->echoInfoProxysToRemove count];\n\t\t\twhile (count > 0)\n\t\t\t{\n\t\t\t\tcount--;\n\t\t\t\tCMyDllProxyInfo *pMyProxyInfo = (CMyDllProxyInfo*)[[sls->echo->echoInfoProxysToRemove objectAtIndex:count] pointerValue];\n\t\t\t\tIDllProxyInfo *echoProxyInfo = pMyProxyInfo->getDllProxyInfo();\n\n\t\t\t\tswitch(pMyProxyInfo->getStatus())\n\t\t\t\t{\n\t\t\t\t\tcase CMyDllProxyInfo::Removing:\n\t\t\t\t\t{\n\t\t\t\t\t\tNSLog(@\"Removing...\");\n\n\t\t\t\t\t\techoProxyInfo->SetReconnectProxy(false);\n\t\t\t\t\t\tStopConnecting(echoProxyInfo);\n\t\t\t\t\t\tint status = echoProxyInfo->GetStatus();\n\t\t\t\t\t\tif (!(status & STATUS_DISCONNECTED_FROM_PROXY) && status)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbool disconnected = DisconnectProxy(echoProxyInfo);\n\t\t\t\t\t\t\tpMyProxyInfo->WaitForStatus(STATUS_DISCONNECTED_FROM_PROXY, 500000);\n\t\t\t\t\t\t\tif (disconnected)\n\t\t\t\t\t\t\t\tNSLog(@\"Disconnected...\");\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tNSLog(@\"Not disconnected...\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t[sls->echo->echoInfoProxysToRemove removeObjectAtIndex: count];\n\t\t\t\t\t\tDeleteProxyInfoClassObject(echoProxyInfo);\n\t\t\t\t\t\tpMyProxyInfo->RemoveStatus();\n\t\t\t\t\t\tdelete pMyProxyInfo;\n\n\t\t\t\t\t\tNSLog(@\"Removed...\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tsls->m_critSectionRemove.Unlock();\n\t\tSleep(1000000);\n\t}\n\n\tsls->m_fHasQuit_Remove = true;\n\treturn 0;\n}\n\nunsigned long CServerListSynchronize::ManageThreadProc_Update(void* lpParameter)\n{\n\tCServerListSynchronize* sls = (CServerListSynchronize*)lpParameter;\n\n\twhile (true)\n\t{\n\t\tsls->m_critSection.Lock();\n\n\t\tif (sls->m_fTerminated_Update)\n\t\t{\n\t\t\tsls->m_critSection.Unlock();\n\t\t\tbreak;\n\t\t}\n\n\t\tbool statusChanged = false;\n\t\tif (sls->echo)\n\t\t{\n\t\t\tint count = [sls->echo->echoInfoProxys count];\n\t\t\twhile (count > 0)\n\t\t\t{\n\t\t\t\tcount--;\n\t\t\t\tCMyDllProxyInfo *pMyProxyInfo = [sls->echo getDllProxyInfo: count];\n\t\t\t\tif (pMyProxyInfo == NULL)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tIDllProxyInfo *echoProxyInfo = pMyProxyInfo->getDllProxyInfo();\n\n\t\t\t\tbool status_changed = pMyProxyInfo->isStatusChanged(echoProxyInfo->GetStatus());\n\t\t\t\tif (!statusChanged && status_changed)\n\t\t\t\t{\n\t\t\t\t\tstatusChanged = true;\n\t\t\t\t\tpMyProxyInfo->setPrevStatus(echoProxyInfo->GetStatus());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsls->setStatusChanged(statusChanged);\n\n\t\tif (statusChanged)\n\t\t{\n\t\t\tNSLog(@\"Status was changed\");\n\t\t\tint index = [sls->echo->echoTableView selectedRow];\n\t\t\t[sls->echo reloadData];\n\t\t\t[sls->echo selectRow: index];\n\t\t}\n\n\t\tsls->m_critSection.Unlock();\n\t\tSleep(2000000);\n\t}\n\n\tsls->m_fHasQuit_Update = true;\n\treturn 0;\n}\n"
  },
  {
    "path": "Bundles/Echoware/ServerListSynchronize.h",
    "content": "/*\n *  ServerListSynchronize.h\n *  Echoware\n *\n *  Created by admin on 2/21/07.\n *  Copyright 2007 __MyCompanyName__. All rights reserved.\n *\n */\n\n#include <Carbon/Carbon.h>\n#include \"pthread.h\"\n#include \"CritSection.h\"\n#import <Foundation/Foundation.h>\n#include \"EchoController.h\"\n\nclass CServerListSynchronize\n{\n\tpublic:\n\t\tCServerListSynchronize();\n\t\t~CServerListSynchronize();\n\n\t\tvoid Init();\n\t\tvoid Start(EchoController *echo);\n\t\tvoid Terminate();\n\n\t\tbool getStatusChanged();\n\t\tvoid setStatusChanged(bool value);\n\tprivate:\n\t\tbool m_fTerminated_Connect;\n\t\tbool m_fTerminated_Remove;\n\t\tbool m_fTerminated_Update;\n\n\t\tbool m_fTerminated;\n\n\t\tbool m_fHasQuit_Connect;\n\t\tbool m_fHasQuit_Remove;\n\t\tbool m_fHasQuit_Update;\n\n\t\tbool m_fInitialized;\n\t\tbool m_fStatusChanged;\n\n\t\tEchoController *echo;\n\n\t\tvoid* m_hManageThread_Connect;\n\t\tunsigned long m_dwManageThread_Connect;\n\n\t\tvoid* m_hManageThread_Remove;\n\t\tunsigned long m_dwManageThread_Remove;\n\n\t\tvoid* m_hManageThread_Update;\n\t\tunsigned long m_dwManageThread_Update;\n\n\t\tCCritSection m_critSection;\n\t\tCCritSection m_critSectionRemove;\n\n\t\tstatic unsigned long ManageThreadProc_Connect(void* lpParameter);\n\t\tstatic unsigned long ManageThreadProc_Remove(void* lpParameter);\n\t\tstatic unsigned long ManageThreadProc_Update(void* lpParameter);\n};\n"
  },
  {
    "path": "Bundles/Echoware/User.cpp",
    "content": "/*\n *  User.cpp\n *  Echoware\n *\n *  Created by admin on 4/11/07.\n *  Copyright 2007 __MyCompanyName__. All rights reserved.\n *\n */\n\n#include \"User.h\"\n#include <grp.h>\n#include <pwd.h>\n#include <unistd.h>\n#include <sys/stat.h>\n\nCUser::CUser(NSString *username)\n{\n\tCDirService dirService;\n\tinitWithUsername(username, &dirService);\n}\n\nCUser::CUser(NSString *username, NSString *password)\n{\n\tCDirService dirService;\n\n\tif (dirService.authenticateUser([username cStringUsingEncoding:NSUTF8StringEncoding],\n\t\t\t\t\t\t\t\t\t[password cStringUsingEncoding:NSUTF8StringEncoding]))\n\t{\n\t\tinitWithUsername(username, &dirService);\n\t}\n}\n\nCUser::~CUser()\n{\n\t[m_name release];\n\t[m_realName release];\n\tif (m_groups != NULL) free(m_groups);\n\tm_groups = NULL;\n}\n\nNSUserDefaults* CUser::userDefaults(NSString *domain)\n{\n//\tuid_t old_uid = geteuid();\n//\t[NSUserDefaults resetStandardUserDefaults];\n//\tseteuid(m_uid);\n\n\tNSUserDefaults *suDefaults = [NSUserDefaults standardUserDefaults];\n\tNSDictionary *persistDomain = [suDefaults persistentDomainForName: domain];\n\t[suDefaults registerDefaults: persistDomain];\n\n//\t[NSUserDefaults resetStandardUserDefaults];\n//\tseteuid(tmp_uid);\n//\told_uid = -1;\n\n\treturn suDefaults;\n}\n\nvoid CUser::initWithUsername(NSString* username, CDirService* dirService)\n{\n\t\tNSDictionary* userInfo = dirService->attributeDataForNodeOfType(kDSStdRecordTypeUsers,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  [username cStringUsingEncoding:NSUTF8StringEncoding],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  kDSNAttrRecordName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  kDS1AttrUniqueID,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  kDS1AttrPrimaryGroupID,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  kDS1AttrDistinguishedName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  NULL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  NULL);\n\t\tNSDictionary* adminInfo = dirService->attributeDataForNodeOfType(kDSStdRecordTypeGroups,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  \"admin\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  kDSNAttrRecordName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  kDSNAttrGroupMembership,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  NULL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  NULL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  NULL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  NULL);\n\t\tm_name     = [[[userInfo objectForKey:[NSString stringWithCString:kDSNAttrRecordName encoding:NSUTF8StringEncoding]] objectAtIndex:0] retain];\n\t\tm_realName = [[[userInfo objectForKey:[NSString stringWithCString:kDS1AttrDistinguishedName encoding:NSUTF8StringEncoding]] objectAtIndex:0] retain];\n\t\tm_uid      = [[[userInfo objectForKey:[NSString stringWithCString:kDS1AttrUniqueID encoding:NSUTF8StringEncoding]] objectAtIndex:0] intValue];\n\t\tm_gid      = [[[userInfo objectForKey:[NSString stringWithCString:kDS1AttrPrimaryGroupID encoding:NSUTF8StringEncoding]] objectAtIndex:0] intValue];\n\n\t\tNSArray* adminMembers = [adminInfo objectForKey:[NSString stringWithCString:kDSNAttrGroupMembership encoding:NSUTF8StringEncoding]];\n\t\tm_admin = [adminMembers containsObject:m_realName] || [adminMembers containsObject:m_name];\n\n\t\tif (m_name != nil)\n\t\t{\n\t\t\tm_groups = NULL;\n\n\t\t\tint groupsTemp[256];\n\t\t\tint groupsize = 256;\n\t\t\tgetgrouplist([m_name cStringUsingEncoding:NSUTF8StringEncoding], m_gid, groupsTemp, &groupsize);\n\t\t\tif (groupsize > 1)\n\t\t\t{\n\t\t\t\tm_groups = (int*)malloc( sizeof(int) * groupsize );\n\t\t\t\tm_groups[groupsize - 1] = -1;\n\t\t\t\tint i = 0;\n\t\t\t\tfor (i = 1; i < groupsize; i++)\n\t\t\t\t\tm_groups[i-1] = groupsTemp[i];\n\t\t\t}\n\t\t}\n}\n\nCFStringRef CUser::CopyCurrentConsoleUsername()\n{\n\tCFStringRef consoleUserName;\n\tuid_t uid;\n\tgid_t gid;\n\tconsoleUserName = SCDynamicStoreCopyConsoleUser(NULL, &uid, &gid);\n\treturn consoleUserName;\n}\n\nNSString* CUser::CurrentConsoleUsername()\n{\n\tNSString *res = NULL;\n\tCFStringRef userName = CopyCurrentConsoleUsername();\n\tif (userName != NULL)\n\t{\n\t\tres = (NSString*)userName;\n\t}\n\treturn res;\n}\n\nbool CUser::ConsoleUserIsLoggedIn()\n{\n\tbool result = false;\n\tCFStringRef userName = CopyCurrentConsoleUsername();\n\tif (userName != NULL)\n\t{\n\t\tCFRelease(userName);\n\t\tresult = true;\n\t}\n\treturn result;\n}\n"
  },
  {
    "path": "Bundles/Echoware/User.h",
    "content": "/*\n *  User.h\n *  Echoware\n *\n *  Created by admin on 4/11/07.\n *  Copyright 2007 __MyCompanyName__. All rights reserved.\n *\n */\n\n#import <Cocoa/Cocoa.h>\n\n#include <CoreFoundation/CoreFoundation.h>\n#include <SystemConfiguration/SystemConfiguration.h>\n#include \"DirService.h\"\n\nclass CUser\n{\n\tprivate:\n\t\tNSString* m_name;\n\t\tNSString* m_realName;\n\t\tint m_gid;\n\t\tint m_uid;\n\t\tbool m_admin;\n\t\tint* m_groups;\n\n\t\tvoid initWithUsername(NSString* username, CDirService* dirService);\n\tpublic:\n\t\tCUser(NSString *username);\n\t\tCUser(NSString *username, NSString *password);\n\t\tvirtual ~CUser();\n\n\t\tNSString* name() { return m_name; }\n\t\tNSString* realName() { return m_realName; }\n\t\tint gid() { return m_gid; }\n\t\tint uid() { return m_uid; }\n\t\tbool admin() { return m_admin; }\n\t\tint* groups() { return m_groups; }\n\n\t\tNSUserDefaults *userDefaults(NSString *domain);\n\n\t\tstatic CFStringRef CopyCurrentConsoleUsername();\n\t\tstatic NSString* CurrentConsoleUsername();\n\t\tstatic bool ConsoleUserIsLoggedIn();\n};\n"
  },
  {
    "path": "Bundles/Echoware/blowfish.cpp",
    "content": "// blowfish.cpp   C++ class implementation of the BLOWFISH encryption algorithm\n// _THE BLOWFISH ENCRYPTION ALGORITHM_\n// by Bruce Schneier\n// Revised code--3/20/94\n// Converted to C++ class 5/96, Jim Conger\n#include \"stdafx.h\"\n#include \"blowfish.h\"\n#include \"blowfish.h2\"\t// holds the random digit tables\n\n#define S(x,i) (SBoxes[i][x.w.byte##i])\n#define bf_F(x) (((S(x,0) + S(x,1)) ^ S(x,2)) + S(x,3))\n\n#undef ROUND\n#define ROUND(a,b,n) (a.dword ^= bf_F(b) ^ PArray[n])\n\n\nCBlowFish::CBlowFish ()\n{\n \tPArray = new DWORD [18] ;\n \tSBoxes = new DWORD [4][256] ;\n}\n\nCBlowFish::~CBlowFish ()\n{\n\tdelete [] PArray;\n\tdelete [] SBoxes;\n}\n\n\t// the low level (private) encryption function\nvoid CBlowFish::Blowfish_encipher (DWORD *xl, DWORD *xr)\n{\n\tunion aword  Xl, Xr ;\n\tXl.dword = *xl ;\n\tXr.dword = *xr ;\n\tXl.dword ^= PArray [0];\n\tROUND (Xr, Xl, 1) ; \tROUND (Xl, Xr, 2) ;\n\tROUND (Xr, Xl, 3) ;  \tROUND (Xl, Xr, 4) ;\n\tROUND (Xr, Xl, 5) ;  \tROUND (Xl, Xr, 6) ;\n\tROUND (Xr, Xl, 7) ;  \tROUND (Xl, Xr, 8) ;\n\tROUND (Xr, Xl, 9) ;  \tROUND (Xl, Xr, 10) ;\n\tROUND (Xr, Xl, 11) ; \tROUND (Xl, Xr, 12) ;\n\tROUND (Xr, Xl, 13) ; \tROUND (Xl, Xr, 14) ;\n\tROUND (Xr, Xl, 15) ; \tROUND (Xl, Xr, 16) ;\n\tXr.dword ^= PArray [17] ;\n\n\t*xr = Xl.dword ;\n\t*xl = Xr.dword ;\n}\n\n\t// the low level (private) decryption function\nvoid CBlowFish::Blowfish_decipher (DWORD *xl, DWORD *xr)\n{\n   union aword  Xl ;\n   union aword  Xr ;\n\n   Xl.dword = *xl ;\n   Xr.dword = *xr ;\n\n   Xl.dword ^= PArray [17] ;\n   ROUND (Xr, Xl, 16) ;  ROUND (Xl, Xr, 15) ;\n   ROUND (Xr, Xl, 14) ;  ROUND (Xl, Xr, 13) ;\n   ROUND (Xr, Xl, 12) ;  ROUND (Xl, Xr, 11) ;\n   ROUND (Xr, Xl, 10) ;  ROUND (Xl, Xr, 9) ;\n   ROUND (Xr, Xl, 8) ;   ROUND (Xl, Xr, 7) ;\n   ROUND (Xr, Xl, 6) ;   ROUND (Xl, Xr, 5) ;\n   ROUND (Xr, Xl, 4) ;   ROUND (Xl, Xr, 3) ;\n   ROUND (Xr, Xl, 2) ;   ROUND (Xl, Xr, 1) ;\n   Xr.dword ^= PArray[0];\n\n   *xl = Xr.dword;\n   *xr = Xl.dword;\n}\n\n\n\t// constructs the enctryption sieve\nvoid CBlowFish::Initialize (BYTE key[], int keybytes)\n{\n\tint  \t\ti, j ;\n\tDWORD  \t\tdata, datal, datar ;\n\tunion aword temp ;\n\t// first fill arrays from data tables\n\tfor (i = 0 ; i < 18 ; i++)\n\t\tPArray [i] = (bf_P[i]);\n\n\tfor (i = 0 ; i < 4 ; i++)\n\t{\n\t \tfor (j = 0 ; j < 256 ; j++)\n\t \t\tSBoxes [i][j] = (bf_S[i][j]);\n\t}\n\n\n\tj = 0 ;\n\tfor (i = 0 ; i < NPASS + 2 ; ++i)\n\t{\n\t\ttemp.dword = 0 ;\n\t\ttemp.w.byte0 = key[j];\n\t\ttemp.w.byte1 = key[(j+1) % keybytes] ;\n\t\ttemp.w.byte2 = key[(j+2) % keybytes] ;\n\t\ttemp.w.byte3 = key[(j+3) % keybytes] ;\n\t\tdata = temp.dword ;\n\t\tPArray [i] ^= data ;\n\n\t\tj = (j + 4) % keybytes ;\n\t}\n\n\tdatal = 0 ;\n\tdatar = 0 ;\n\n\tfor (i = 0 ; i < NPASS + 2 ; i += 2)\n\t{\n\t\tBlowfish_encipher (&datal, &datar) ;\n\t\tPArray [i] = datal ;\n\t\tPArray [i + 1] = datar ;\n\t}\n\tfor (i = 0 ; i < 4 ; ++i)\n\t{\n\t\tfor (j = 0 ; j < 256 ; j += 2)\n\t\t{\n\t\t  Blowfish_encipher (&datal, &datar) ;\n\t\t  SBoxes [i][j] = datal ;\n\t\t  SBoxes [i][j + 1] = datar ;\n\t\t}\n\t}\n}\n\n\t// get output length, which must be even MOD 8\nDWORD CBlowFish::GetOutputLength (DWORD lInputLong)\n{\n\tDWORD \tlVal ;\n\n\tlVal = lInputLong % 8 ;\t// find out if uneven number of bytes at the end\n\tif (lVal != 0)\n\t\treturn lInputLong + 8 - lVal ;\n\telse\n\t\treturn lInputLong ;\n}\n\n\t// Encode pIntput into pOutput.  Input length in lSize.  Returned value\n\t// is length of output which will be even MOD 8 bytes.  Input buffer and\n\t// output buffer can be the same, but be sure buffer length is even MOD 8.\nDWORD CBlowFish::Encode (BYTE * pInput, BYTE * pOutput, DWORD lSize)\n{\n\tDWORD \tlCount, lOutSize, lGoodBytes ;\n\tBYTE\t*pi, *po ;\n\tint\t\ti, j ;\n\tint\t\tSameDest = (pInput == pOutput ? 1 : 0) ;\n\n\tlOutSize = GetOutputLength (lSize) ;\n\tfor (lCount = 0 ; lCount < lOutSize ; lCount += 8)\n\t{\n\t\tif (SameDest)\t// if encoded data is being written into input buffer\n\t\t{\n\t\t \tif (lCount < lSize - 7)\t// if not dealing with uneven bytes at end\n\t\t \t{\n\t\t \t \tBlowfish_encipher ((DWORD *) pInput,\n\t\t \t \t\t(DWORD *) (pInput + 4)) ;\n\t\t \t}\n\t\t \telse\t\t// pad end of data with null bytes to complete encryption\n\t\t \t{\n\t\t\t\tpo = pOutput + lSize ;\t// point at byte past the end of actual data\n\t\t\t\tj = (int) (lOutSize - lSize) ;\t// number of bytes to set to null\n\t\t\t\tfor (i = 0 ; i < j ; i++)\n\t\t\t\t\t*po++ = 0 ;\n\t\t \t \tBlowfish_encipher ((DWORD *) pInput,\n\t\t \t \t\t(DWORD *) (pInput + 4)) ;\n\t\t \t}\n\t\t \tpInput += 8 ;\n\t\t}\n\t\telse \t\t\t// output buffer not equal to input buffer, so must copy\n\t\t{               // input to output buffer prior to encrypting\n\t\t \tif (lCount < lSize - 7)\t// if not dealing with uneven bytes at end\n\t\t \t{\n\t\t \t\tpi = pInput ;\n\t\t \t\tpo = pOutput ;\n\t\t \t\tfor (i = 0 ; i < 8 ; i++)\n// copy bytes to output\n\t\t \t\t\t*po++ = *pi++ ;\n\t\t \t \tBlowfish_encipher ((DWORD *) pOutput,\t// now encrypt them\n\t\t \t \t\t(DWORD *) (pOutput + 4)) ;\n\t\t \t}\n\t\t \telse\t\t// pad end of data with null bytes to complete encryption\n\t\t \t{\n\t\t \t\tlGoodBytes = lSize - lCount ;\t// number of remaining data bytes\n\t\t \t\tpo = pOutput ;\n\t\t \t\tfor (i = 0 ; i < (int) lGoodBytes ; i++)\n\t\t \t\t\t*po++ = *pInput++ ;\n\t\t \t\tfor (j = i ; j < 8 ; j++)\n\t\t \t\t\t*po++ = 0 ;\n\t\t \t \tBlowfish_encipher ((DWORD *) pOutput,\n\t\t \t \t\t(DWORD *) (pOutput + 4)) ;\n\t\t \t}\n\t\t \tpInput += 8 ;\n\t\t \tpOutput += 8 ;\n\t\t}\n\t}\n\treturn lOutSize ;\n }\n\n\t// Decode pIntput into pOutput.  Input length in lSize.  Input buffer and\n\t// output buffer can be the same, but be sure buffer length is even MOD 8.\nvoid CBlowFish::Decode (BYTE * pInput, BYTE * pOutput, DWORD lSize)\n{\n\tDWORD \tlCount ;\n\tBYTE\t*pi, *po ;\n\tint\t\ti ;\n\tint\t\tSameDest = (pInput == pOutput ? 1 : 0) ;\n\n\tfor (lCount = 0 ; lCount < lSize ; lCount += 8)\n\t{\n\t\tif (SameDest)\t// if encoded data is being written into input buffer\n\t\t{\n\t \t \tBlowfish_decipher ((DWORD *) pInput,\n\t \t \t\t(DWORD *) (pInput + 4)) ;\n\t\t \tpInput += 8 ;\n\t\t}\n\t\telse \t\t\t// output buffer not equal to input buffer\n\t\t{               // so copy input to output before decoding\n\t \t\tpi = pInput ;\n\t \t\tpo = pOutput ;\n\t \t\tfor (i = 0 ; i < 8 ; i++)\n\t \t\t\t*po++ = *pi++ ;\n\t \t \tBlowfish_decipher ((DWORD *) pOutput,\n\t \t \t\t(DWORD *) (pOutput + 4)) ;\n\t\t \tpInput += 8 ;\n\t\t \tpOutput += 8 ;\n\t\t}\n\t}\n}\n\n\n\n"
  },
  {
    "path": "Bundles/Echoware/blowfish.h",
    "content": "#ifndef _inc_blowfish_h\n#define _inc_blowfish_h\n\n#include <libkern/OSByteOrder.h>\n// blowfish.h     interface file for blowfish.cpp\n// _THE BLOWFISH ENCRYPTION ALGORITHM_\n// by Bruce Schneier\n// Revised code--3/20/94\n// Converted to C++ class 5/96, Jim Conger\n\n#define MAXKEYBYTES \t56\t\t// 448 bits max\n#define NPASS           16\t\t// SBox passes\n\n#ifndef DWORD\n#define DWORD  \t\tunsigned long\n#endif\n#define WORD  \t\tunsigned short\n#define BYTE  \t\tunsigned char\n\nclass CBlowFish\n{\n// choose a byte order for your hardware\n// not needed even more to change\n#if\t\tdefined(__LITTLE_ENDIAN__)\n//#define ORDER_DCBA\t// chosing Intel in this case\n\n//#ifdef ORDER_DCBA  \t// DCBA - little endian - intel\n\tunion aword {\n\t  DWORD dword;\n\t  BYTE byte [4];\n\t  struct {\n\t    unsigned int byte3:8;\n\t    unsigned int byte2:8;\n\t    unsigned int byte1:8;\n\t    unsigned int byte0:8;\n\t  } w;\n\t};\n//#endif\n#elif\t\tdefined(__BIG_ENDIAN__)\n//#ifdef ORDER_ABCD  \t// ABCD - big endian - motorola\n\tunion aword {\n\t  DWORD dword;\n\t  BYTE byte [4];\n\t  struct {\n\t    unsigned int byte0:8;\n\t    unsigned int byte1:8;\n\t    unsigned int byte2:8;\n\t    unsigned int byte3:8;\n\t  } w;\n\t};\n#else\n#error Unknown endianness.\n#endif\n\n/*\n#ifdef ORDER_BADC  \t// BADC - vax\n\tunion aword {\n\t  DWORD dword;\n\t  BYTE byte [4];\n\t  struct {\n\t    unsigned int byte1:8;\n\t    unsigned int byte0:8;\n\t    unsigned int byte3:8;\n\t    unsigned int byte2:8;\n\t  } w;\n};\n#endif\n*/\nprivate:\n\tDWORD \t\t* PArray ;\n\tDWORD\t\t(* SBoxes)[256];\n\tvoid \t\tBlowfish_encipher (DWORD *xl, DWORD *xr) ;\n\tvoid \t\tBlowfish_decipher (DWORD *xl, DWORD *xr) ;\n\npublic:\n\t\t\tCBlowFish () ;\n\t\t\t~CBlowFish () ;\n\tvoid \t\tInitialize (BYTE key[], int keybytes) ;\n\tDWORD\t\tGetOutputLength (DWORD lInputLong) ;\n\tDWORD\t\tEncode (BYTE * pInput, BYTE * pOutput, DWORD lSize) ;\n\tvoid\t\tDecode (BYTE * pInput, BYTE * pOutput, DWORD lSize) ;\n\n} ;\n\n#endif //_inc_blowfish_h\n"
  },
  {
    "path": "Bundles/Echoware/blowfish.h2",
    "content": "// blowfish.h2  header file containing random number tables\n\nstatic DWORD bf_P[NPASS + 2] = {\n  0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,\n  0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,\n  0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,\n  0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,\n  0x9216d5d9, 0x8979fb1b,\n};\nstatic DWORD bf_S[4][256] = {\n  0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,\n  0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,\n  0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,\n  0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,\n  0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee,\n  0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,\n  0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef,\n  0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,\n  0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,\n  0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,\n  0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce,\n  0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,\n  0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e,\n  0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,\n  0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,\n  0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,\n  0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88,\n  0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,\n  0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e,\n  0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,\n  0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,\n  0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,\n  0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88,\n  0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,\n  0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6,\n  0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,\n  0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,\n  0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,\n  0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba,\n  0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,\n  0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f,\n  0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,\n  0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,\n  0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,\n  0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279,\n  0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,\n  0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab,\n  0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,\n  0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,\n  0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,\n  0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0,\n  0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,\n  0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790,\n  0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,\n  0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,\n  0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,\n  0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7,\n  0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,\n  0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad,\n  0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,\n  0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,\n  0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,\n  0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477,\n  0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,\n  0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49,\n  0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,\n  0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,\n  0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,\n  0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41,\n  0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,\n  0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400,\n  0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,\n  0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,\n  0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a,\n  0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623,\n  0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,\n  0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,\n  0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,\n  0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,\n  0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,\n  0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e,\n  0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,\n  0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,\n  0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,\n  0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,\n  0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,\n  0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701,\n  0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,\n  0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,\n  0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,\n  0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,\n  0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,\n  0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e,\n  0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,\n  0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,\n  0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,\n  0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,\n  0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,\n  0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b,\n  0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,\n  0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,\n  0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,\n  0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,\n  0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,\n  0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4,\n  0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,\n  0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,\n  0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,\n  0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,\n  0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,\n  0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510,\n  0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,\n  0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,\n  0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,\n  0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,\n  0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,\n  0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8,\n  0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,\n  0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,\n  0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,\n  0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,\n  0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,\n  0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0,\n  0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,\n  0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,\n  0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,\n  0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,\n  0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,\n  0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00,\n  0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,\n  0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,\n  0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,\n  0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,\n  0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,\n  0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9,\n  0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,\n  0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,\n  0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7,\n  0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,\n  0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,\n  0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,\n  0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,\n  0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45,\n  0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,\n  0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,\n  0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,\n  0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,\n  0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,\n  0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42,\n  0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,\n  0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,\n  0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,\n  0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,\n  0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,\n  0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33,\n  0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,\n  0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,\n  0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,\n  0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,\n  0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,\n  0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b,\n  0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,\n  0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,\n  0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,\n  0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,\n  0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,\n  0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37,\n  0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,\n  0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,\n  0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,\n  0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,\n  0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,\n  0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d,\n  0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,\n  0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,\n  0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,\n  0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,\n  0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,\n  0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d,\n  0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,\n  0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,\n  0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,\n  0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,\n  0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,\n  0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2,\n  0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,\n  0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,\n  0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,\n  0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,\n  0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,\n  0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52,\n  0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,\n  0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,\n  0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,\n  0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,\n  0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,\n  0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24,\n  0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,\n  0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,\n  0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,\n  0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,\n  0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0,\n  0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b,\n  0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,\n  0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,\n  0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,\n  0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8,\n  0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,\n  0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304,\n  0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,\n  0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,\n  0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,\n  0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9,\n  0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,\n  0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593,\n  0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,\n  0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,\n  0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,\n  0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b,\n  0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,\n  0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c,\n  0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,\n  0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,\n  0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,\n  0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb,\n  0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,\n  0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991,\n  0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,\n  0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,\n  0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,\n  0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae,\n  0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,\n  0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5,\n  0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,\n  0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,\n  0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,\n  0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84,\n  0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,\n  0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8,\n  0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,\n  0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,\n  0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,\n  0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38,\n  0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,\n  0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c,\n  0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,\n  0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,\n  0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,\n  0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964,\n  0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,\n  0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8,\n  0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,\n  0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,\n  0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,\n  0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02,\n  0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,\n  0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614,\n  0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,\n  0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,\n  0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,\n  0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0,\n  0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,\n  0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e,\n  0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,\n  0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,\n  0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6,\n};\n\n\n"
  },
  {
    "path": "Bundles/Echoware/rfbserver.cpp",
    "content": "/*\n *  rfbserver.cpp\n *  Echoware\n *\n *  Created by admin on 2/15/07.\n *  Copyright 2007 __MyCompanyName__. All rights reserved.\n *\n */\n\n#include \"rfbserver.h\"\n"
  },
  {
    "path": "Bundles/Echoware/rfbserver.h",
    "content": "/*\n *  rfbserver.h\n *  Echoware\n *\n *  Created by admin on 2/15/07.\n *  Copyright 2007 __MyCompanyName__. All rights reserved.\n *\n */\n\n\n// This structure represents the entire state of the RFB server\n// We use it for passing off to the bundles\n\n//#include <Cocoa/Cocoa.h>\n#include <Carbon/Carbon.h>\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <unistd.h>\n#include <errno.h>\n#include <pwd.h>\n#include <sys/types.h>\n#include <sys/socket.h>\n#include <netinet/in.h>\n#include <arpa/inet.h>\n#include <pthread.h>\n\n#include <netdb.h>\n\ntypedef struct rfbserver {\n\tint vncServer;\n\n\tchar *desktopName;\n\tint rfbPort;\n\tint rfbLocalhostOnly;\n\n\tpthread_mutex_t listenerAccepting;\n\tpthread_cond_t listenerGotNewClient;\n\n    CGKeyCode *keyTable;\n    unsigned char *keyTableMods;\n    int *pressModsForKeys;\n} rfbserver;\n\n"
  },
  {
    "path": "Bundles/Echoware/stdafx.cpp",
    "content": "// stdafx.cpp : source file that includes just the standard includes\n// Echoware.pch will be the pre-compiled header\n// stdafx.obj will contain the pre-compiled type information\n\n#include \"stdafx.h\"\n\n// TODO: reference any additional headers you need in STDAFX.H\n// and not in this file\n"
  },
  {
    "path": "Bundles/Echoware/stdafx.h",
    "content": "#ifndef _STDAFX_H\n#define _STDAFX_H\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n#define WIN32_LEAN_AND_MEAN\n\n//#include <windows.h>\n\n#include \"globals.h\"\n\n#endif"
  },
  {
    "path": "Bundles/Echoware/version.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>BuildVersion</key>\n\t<string>12</string>\n\t<key>CFBundleVersion</key>\n\t<string>1.0</string>\n\t<key>ProductBuildVersion</key>\n\t<string>7K571</string>\n\t<key>ProjectName</key>\n\t<string>DevToolsWizardTemplates</string>\n\t<key>SourceVersion</key>\n\t<string>3870000</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "Bundles/Jaguar/JaguarBundle-Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>English</string>\n\t<key>CFBundleExecutable</key>\n\t<string>${EXECUTABLE_NAME}</string>\n\t<key>CFBundleGetInfoString</key>\n\t<string></string>\n\t<key>CFBundleIconFile</key>\n\t<string></string>\n\t<key>CFBundleIdentifier</key>\n\t<string>com.redstonesoftware.JaguarBundle</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string></string>\n\t<key>CFBundlePackageType</key>\n\t<string>BNDL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string></string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1.0</string>\n\t<key>NSPrincipalClass</key>\n\t<string>JaguarExtensions</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "Bundles/Jaguar/JaguarExtensions.h",
    "content": "//\n//  JaguarExtensions.h\n//  OSXvnc\n//\n//  Created by Jonathan Gillaspie on Fri Jul 11 2003.\n//  Copyright (c) 2003 RedstoneSoftware. All rights reserved.\n//\n\n\n#import <Foundation/Foundation.h>\n#import <Carbon/Carbon.h>\n\n#import \"RFBBundleProtocol.h\"\n#import \"VNCBundle.h\"\n\n@interface JaguarExtensions : VNCBundle <RFBBundleProtocol> {\n}\n\n+ (void) registerRendezvous;\n\n@end\n\n@interface RendezvousDelegate : NSObject\n\n@end\n"
  },
  {
    "path": "Bundles/Jaguar/JaguarExtensions.m",
    "content": "//\n//  JaguarExtensions.m\n//  OSXvnc\n//\n//  Created by Jonathan Gillaspie on Fri Jul 11 2003.\n//  Copyright (c) 2003 RedstoneSoftware, Inc. All rights reserved.\n\n\n#import \"JaguarExtensions.h\"\n\n#import <ApplicationServices/ApplicationServices.h>\n#import <Cocoa/Cocoa.h>\n#import <Carbon/Carbon.h>\n\n#include \"keysymdef.h\"\n#include \"kbdptr.h\"\n\n#include <sys/stat.h>\n#include <sys/types.h>\n#include <sys/socket.h>\n#include <netinet/in.h>\n#include <fcntl.h>\n#include <pthread.h>\n#include <unistd.h>\n#include <signal.h>\n\n#include \"rfb.h\"\n\n#import \"rfbserver.h\"\n#import \"VNCServer.h\"\n\n#import \"../RFBBundleProtocol.h\"\n\n@implementation JaguarExtensions\n\nstatic NSNetService *rfbService;\nstatic NSNetService *vncService;\nstatic BOOL keyboardLoading = FALSE;\n\nstatic KeyboardLayoutRef loadedKeyboardRef;\nstatic BOOL useIP6 = TRUE;\nstatic BOOL listenerFinished = FALSE;\n\nrfbserver *theServer;\n\n+ (void) loadGUI {\n\t//\tProcessSerialNumber psn = { 0, kCurrentProcess };\n\t//\tOSStatus returnCode = TransformProcessType(& psn, kProcessTransformToForegroundApplication);\n\t//\treturnCode = SetFrontProcess(& psn );\n\t//\tif( returnCode != 0) {\n\t//\t\tNSLog(@\"Could not bring the application to front. Error %d\", returnCode);\n\t//\t}\n\t//[[NSApplication sharedApplication] activateIgnoringOtherApps: YES];\n}\n\n+ (void) rfbStartup: (rfbserver *) aServer {\n\t[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:\n\t\t@\"NO\", @\"keyboardLoading\", // allows OSXvnc to look at the users selected keyboard and map keystrokes using it\n\t\t@\"YES\", @\"pressModsForKeys\", // If OSXvnc finds the key you want it will temporarily toggle the modifier keys to produce it\n\t\t[NSArray arrayWithObjects:[NSNumber numberWithInt:kUCKeyActionDisplay], [NSNumber numberWithInt:kUCKeyActionAutoKey], nil], @\"KeyStates\", // Key States to review to find KeyCodes\n\t\t//[NSNumber numberWithInt:kUCKeyActionDisplay], [NSNumber numberWithInt:kUCKeyActionDown], nil],\n\t\tnil]];\n\n    theServer = aServer;\n\n\tkeyboardLoading = [[NSUserDefaults standardUserDefaults] boolForKey:@\"keyboardLoading\"];\n    if (keyboardLoading) {\n\t\tOSErr result;\n\n        NSLog(@\"Keyboard Loading - Enabled\");\n\n        *(theServer->pressModsForKeys) = [[NSUserDefaults standardUserDefaults] boolForKey:@\"pressModsForKeys\"];\n        if (*(theServer->pressModsForKeys))\n            NSLog(@\"Press Modifiers For Keys - Enabled\");\n        else\n            NSLog(@\"Press Modifiers For Keys - Disabled\");\n\n\t\tresult = KLGetCurrentKeyboardLayout(&loadedKeyboardRef);\n        if (result == noErr)\n\t\t\t[self loadKeyboard:loadedKeyboardRef forServer: theServer];\n\t\telse\n\t\t\tNSLog(@\"Error (%u) unabled to load current keyboard layout\", result);\n    }\n\n    if ([[[NSProcessInfo processInfo] arguments] indexOfObject:@\"-ipv4\"] != NSNotFound) {\n\t\tuseIP6 = FALSE;\n\t}\n}\n\n+ (void) rfbUsage {\n    printf(\n        \"\\nJAGUAR BUNDLE OPTIONS (10.2+):\\n\"\n        \"-keyboardLoading flag  This feature allows OSXvnc to look at the users selected keyboard and map keystrokes using it.\\n\"\n        \"                       Disabling this returns OSXvnc to standard (U.S. Keyboard) which will work better with Dead Keys.\\n\"\n        \"                       (default: no), 10.2+ ONLY\\n\"\n        \"-pressModsForKeys flag If OSXvnc finds the key you want it will temporarily toggle the modifier keys to produce it.\\n\"\n        \"                       This flag works well if you have different keyboards on the local and remote machines.\\n\"\n        \"                       Only works if -keyboardLoading is on\\n\"\n        \"                       (default: yes), 10.2+ ONLY\\n\"\n        \"-bonjour flag          Allow OSXvnc to advertise VNC server using Bonjour discovery services.\\n\"\n        \"                       'VNC' will enable the service named VNC (For Eggplant & Chicken 2.02b)\\n\"\n        \"                       'Both' or '2' will enable the services named RFB and VNC\\n\"\n        \"                       (default: RFB:YES VNC:NO), 10.2+ ONLY\\n\"\n        \"-ipv4                  Listen For Connections on IPv4 ONLY (Default: Off). 10.2+ ONLY\\n\"\n        \"-ipv6                  Listen For Connections on IPv6 ONLY (Default: Off). 10.2+ ONLY\\n\"\n    );\n}\n\n+ (void) rfbRunning {\n\t[JaguarExtensions registerRendezvous];\n\tif (useIP6) {\n\t\t[NSThread detachNewThreadSelector:@selector(setupIPv6:) toTarget:self withObject:nil];\n\t\t// Wait for the IP6 to bind, if it binds later it confuses the IPv4 binding into allowing others on the port\n\t\twhile (!listenerFinished)\n\t\t\tusleep(1000);\n\t}\n}\n\n+ (void) setupIPv6: argument {\n    int listen_fd6=0, client_fd=0;\n\tint value=1;  // Need to pass a ptr to this\n\tstruct sockaddr_in6 sin6, peer6;\n\tunsigned int len6=sizeof(sin6);\n\n\tbzero(&sin6, sizeof(sin6));\n\tsin6.sin6_len = sizeof(sin6);\n\tsin6.sin6_family = AF_INET6;\n\tsin6.sin6_port = htons(theServer->rfbPort);\n\tif (theServer->rfbLocalhostOnly)\n\t\tsin6.sin6_addr = in6addr_loopback;\n\telse\n\t\tsin6.sin6_addr = in6addr_any;\n\n\tif ((listen_fd6 = socket(PF_INET6, SOCK_STREAM, 0)) < 0) {\n\t\tNSLog(@\"IPv6: Unable to open socket\");\n\t}\n\t/*\n\t    else if (fcntl(listen_fd6, F_SETFL, O_NONBLOCK) < 0) {\n\t\t\tNSLog(@\"IPv6: fcntl O_NONBLOCK failed\");\n\t\t}\n\t */\n\telse if (setsockopt(listen_fd6, SOL_SOCKET, SO_REUSEADDR, &value, sizeof(value)) < 0) {\n\t\tNSLog(@\"IPv6: setsockopt SO_REUSEADDR failed\");\n\t}\n\telse if (bind(listen_fd6, (struct sockaddr *) &sin6, len6) < 0) {\n\t\tNSLog(@\"IPv6: Failed to bind socket: port %d may be in use by another VNC\", theServer->rfbPort);\n\t}\n\telse if (listen(listen_fd6, 5) < 0) {\n\t\tNSLog(@\"IPv6: Listen failed\");\n\t}\n\telse {\n\t\tNSLog(@\"Started listener thread on IPv6 port %d\", theServer->rfbPort);\n\t\tlistenerFinished = TRUE;\n\n\t    while ((client_fd = accept(listen_fd6, (struct sockaddr *) &peer6, &len6)) !=-1) {\n\t\t\tNSAutoreleasePool *pool=[[NSAutoreleasePool alloc] init];\n\n\t\t\t[[NSNotificationCenter defaultCenter] postNotification:\n\t\t\t\t[NSNotification notificationWithName:@\"NewRFBClient\" object:[NSNumber numberWithInt:client_fd]]];\n\n\t\t\t// We have to trigger a signal so the event loop will pickup (if no clients are connected)\n\t\t\tpthread_cond_signal(&(theServer->listenerGotNewClient));\n\n\t\t\t[pool release];\n\t\t}\n\n\t\tNSLog(@\"IPv6: Accept failed %d\", errno);\n\t}\n\tlistenerFinished = TRUE;\n\n\treturn;\n}\n\n+ (void) registerRendezvous {\n\tBOOL loadRendezvousVNC = NO;\n\tBOOL loadRendezvousRFB = YES;\n\tint argumentIndex = [[[NSProcessInfo processInfo] arguments] indexOfObject:@\"-rendezvous\"];\n\tRendezvousDelegate *rendezvousDelegate = [[RendezvousDelegate alloc] init];\n\n    if (argumentIndex == NSNotFound) {\n\t\targumentIndex = [[[NSProcessInfo processInfo] arguments] indexOfObject:@\"-bonjour\"];\n\t}\n\n    if (argumentIndex != NSNotFound) {\n        NSString *value = nil;\n\n        if ([[[NSProcessInfo processInfo] arguments] count] > argumentIndex + 1)\n            value = [[[NSProcessInfo processInfo] arguments] objectAtIndex:argumentIndex+1];\n\n        if ([value hasPrefix:@\"n\"] || [value hasPrefix:@\"N\"] || [value hasPrefix:@\"0\"]) {\n            loadRendezvousVNC = NO; loadRendezvousRFB = NO;\n\t\t}\n\t\telse if ([value hasPrefix:@\"y\"] || [value hasPrefix:@\"Y\"] || [value hasPrefix:@\"1\"] || [value hasPrefix:@\"rfb\"]) {\n\t\t\tloadRendezvousVNC = NO; loadRendezvousRFB = YES;\n\t\t}\n\t\telse if ([value hasPrefix:@\"b\"] || [value hasPrefix:@\"B\"] || [value hasPrefix:@\"2\"]) {\n\t\t\tloadRendezvousVNC = YES; loadRendezvousRFB = YES;\n\t\t}\n\t\telse if ([value hasPrefix:@\"vnc\"]) {\n\t\t\tloadRendezvousVNC = YES; loadRendezvousRFB = NO;\n\t\t}\n    }\n\n\t// Register For Rendezvous\n    if (loadRendezvousRFB) {\n\t\trfbService = [[NSNetService alloc] initWithDomain:@\"\"\n\t\t\t\t\t\t\t\t\t\t\t\t   type:@\"_rfb._tcp.\"\n\t\t\t\t\t\t\t\t\t\t\t\t   name:[NSString stringWithCString:theServer->desktopName]\n\t\t\t\t\t\t\t\t\t\t\t\t   port:(int) theServer->rfbPort];\n\t\t[rfbService setDelegate:rendezvousDelegate];\n\t\t[rfbService publish];\n\t}\n//\telse\n//\t\tNSLog(@\"Bonjour (_rfb._tcp) - Disabled\");\n\n\tif (loadRendezvousVNC) {\n\t\tvncService = [[NSNetService alloc] initWithDomain:@\"\"\n\t\t\t\t\t\t\t\t\t\t\t\t  type:@\"_vnc._tcp.\"\n\t\t\t\t\t\t\t\t\t\t\t\t  name:[NSString stringWithCString:theServer->desktopName]\n\t\t\t\t\t\t\t\t\t\t\t\t  port:(int) theServer->rfbPort];\n\t\t[vncService setDelegate:rendezvousDelegate];\n\n\t\t[vncService publish];\n\t}\n//\telse\n//\t\tNSLog(@\"Bonjour (_vnc._tcp) - Disabled\");\n}\n\n+ (void) rfbPoll {\n    // Check if keyboardLayoutRef has changed\n    if (keyboardLoading) {\n        KeyboardLayoutRef currentKeyboardLayoutRef;\n\n        if (KLGetCurrentKeyboardLayout(&currentKeyboardLayoutRef) == noErr) {\n            if (currentKeyboardLayoutRef != loadedKeyboardRef) {\n                loadedKeyboardRef = currentKeyboardLayoutRef;\n\t\t\t\t[self loadKeyboard: loadedKeyboardRef forServer:theServer];\n            }\n        }\n    }\n}\n\n+ (void) rfbReceivedClientMessage {\n    return;\n}\n\n+ (void) rfbShutdown {\n    NSLog(@\"Unloading Jaguar Extensions\");\n\t[rfbService stop];\n\t[vncService stop];\n}\n\n@end\n\n@implementation RendezvousDelegate\n\n// Sent when the service is about to publish\n\n- (void)netServiceWillPublish:(NSNetService *)netService {\n\tNSLog(@\"Registering Bonjour Service(%@) - %@\", [netService type], [netService name]);\n}\n\n// Sent if publication fails\n- (void)netService:(NSNetService *)netService didNotPublish:(NSDictionary *)errorDict {\n    NSLog(@\"An error occurred with service %@.%@.%@, error code = %@\",\n\t\t  [netService name], [netService type], [netService domain], [errorDict objectForKey:NSNetServicesErrorCode]);\n}\n\n// Sent when the service stops\n- (void)netServiceDidStop:(NSNetService *)netService {\n\tNSLog(@\"Disabling Bonjour Service - %@\", [netService name]);\n    // You may want to do something here, such as updating a user interfac\n}\n\n\n@end\n\n#include <netdb.h>\n\n@implementation NSProcessInfo (VNCExtension)\n\n- (CGDirectDisplayID) CGMainDisplayID {\n\treturn CGMainDisplayID();\n}\n\n@end\n"
  },
  {
    "path": "Bundles/RFBBundleProtocol.h",
    "content": "//\n//  RFBBundleProtocol.h\n//  OSXvnc\n//\n//  Created by Jonathan Gillaspie on Fri Aug 22 2003.\n//  Copyright (c) 2003 RedstoneSoftware. All rights reserved.\n//\n\n#import \"rfbserver.h\"\n\n// These work on the class but they aren't defined anywhere\n@interface NSObject (ClassPerform)\n\n+ performSelector:(SEL) aSelector;\n\n+ performSelector:(SEL) aSelector withObject: (id) anObject;\n\n@end\n\n@protocol RFBBundleProtocol\n\n+ (void) rfbUsage;\n    /* Print stuff to stderr if you want to add usage information */\n\n+ (void) rfbStartup: (rfbserver *) theServer;\n    /* This method is called during startup and should display with NSLog some information about the Bundle */\n    /* You can use NSProcessInfo to get access to the startup arguments */\n\n+ (void) rfbRunning;\n\t/* This method is called after all of the core services are started -- immediately before listening for connects */\n\n+ (void) rfbPoll;\n    /* This method is called during each check the VNC system does for screen updates, etc. */\n\n+ (void) rfbReceivedClientMessage;\n    /* This method is called immediately as each event is received */\n\n+ (void) rfbShutdown;\n    /* This method is called when we go to shutdown the server */\n\n@end\n\n@interface NSProcessInfo (VNCExtension)\n\n- (CGDirectDisplayID) CGMainDisplayID;\n\n@end\n"
  },
  {
    "path": "Bundles/Tiger/TigerBundle-Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>English</string>\n\t<key>CFBundleExecutable</key>\n\t<string>${EXECUTABLE_NAME}</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>com.redstonesoftware.TigerBundle</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundlePackageType</key>\n\t<string>BNDL</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1.0</string>\n\t<key>NSPrincipalClass</key>\n\t<string>TigerExtensions</string>\n\t<key>LSMinimumSystemVersion</key>\n\t<string>10.4</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "Bundles/Tiger/TigerExtensions.h",
    "content": "//\n//  TigerExtensions.h\n//  OSXvnc\n//\n//  Created by Jonathan Gillaspie on Fri Jul 11 2003.\n//  Copyright (c) 2003 RedstoneSoftware. All rights reserved.\n//\n\n\n#import <Foundation/Foundation.h>\n#import <Carbon/Carbon.h>\n\n#import \"RFBBundleProtocol.h\"\n\n#import \"rfb.h\"\n\n\n@interface TigerExtensions : VNCBundle <RFBBundleProtocol> {\n}\n\n+ (void) systemServerShouldQuit: (NSNotification *) aNotification;\n+ (void) systemServerShouldContinue: (NSNotification *) aNotification;\n\n+ (void) loadUnicodeKeyboard;\n\n- (void) handleKeyboard:(Bool) down forSym: (KeySym) keySym forClient: (rfbClientPtr) cl;\n\n- (void) setKeyModifiers: (CGEventFlags) modifierFlags;\n- (BOOL) checkModiferState;\n- (void) sendKeyEvent: (CGKeyCode) keyCode down: (BOOL) down modifiers: (CGEventFlags) modifiersToSend;\n\n\n@end\n"
  },
  {
    "path": "Bundles/Tiger/TigerExtensions.m",
    "content": "//\n//  TigerExtensions.m\n//  OSXvnc\n//\n//  Created by Jonathan Gillaspie on Fri Jul 11 2003.\n//  Copyright (c) 2003 RedstoneSoftware, Inc. All rights reserved.\n\n#import \"JaguarExtensions.h\"\n#import \"TigerExtensions.h\"\n\n#import <ApplicationServices/ApplicationServices.h>\n#import <Cocoa/Cocoa.h>\n#import <Carbon/Carbon.h>\n\n#import <Security/AuthSession.h>\n\n#include \"keysymdef.h\"\n#include \"kbdptr.h\"\n\n#include \"rfb.h\"\n\n#include \"rfbserver.h\"\n#import \"VNCServer.h\"\n\n#import \"../RFBBundleProtocol.h\"\n\nstatic BOOL readyToStartup = TRUE;\nstatic BOOL dynamicKeyboard = FALSE;\nstatic CGEventSourceRef vncSourceRef=NULL;\nstatic CGEventTapLocation vncTapLocation=0;\n\nstatic TISInputSourceRef unicodeInputSource=NULL;\nstatic TISInputSourceRef currentInputSource=NULL;\n\n// Current Modifiers reflect the \"global\" state of the modifier keys (not a particular VNC connection)\n// This only matters for event taps.  Ideally we could detect their values but\n// that seems to require an active event loop.\nstatic CGEventFlags currentModifiers;\n\n// These correspond to the keycodes of the keys 0-9,A-F\nstatic unsigned char unicodeNumbersToKeyCodes[16] = { 29, 18, 19, 20, 21, 23, 22, 26, 28, 25, 0, 11, 8, 2, 14, 3 };\n\n#ifndef NSAppKitVersionNumber10_3\n#define NSAppKitVersionNumber10_3 743\n#endif\n#ifndef NSAppKitVersionNumber10_4\n#define NSAppKitVersionNumber10_4 824\n#endif\n\n@implementation TigerExtensions\n\nvoid SyncSetKeyboardLayout (TISInputSourceRef inputSource);\n\nbool isConsoleSession();\n\n// The Keycodes to various modifiers on the current keyboard\nCGKeyCode keyCodeShift;\nCGKeyCode keyCodeOption;\nCGKeyCode keyCodeControl;\nCGKeyCode keyCodeCommand;\n\nint modifierDelay = 0;\n\nrfbserver *theServer;\n\n// This routine waits for the window server to register its per-session\n// services in our session.  This code was necessary in various pre-release\n// versions of Mac OS X 10.5, but it is not necessary on the final version.\nstatic void WaitForWindowServerSession(void) {\n    CFDictionaryRef dict;\n    int delay = 100000, maxDelay = 5000000;\n\n\tdict = CGSessionCopyCurrentDictionary();\n\twhile (dict == NULL && maxDelay > 0) {\n\t\tusleep(delay);\n\t\tmaxDelay -= delay;\n        dict = CGSessionCopyCurrentDictionary();\n\t}\n\tif (maxDelay <= 0)\n\t\tNSLog(@\"No CG session Available, max delay reached\");\n\tif (dict != NULL)\n\t\tCFRelease(dict);\n}\n\nbool isConsoleSession() {\n\tBOOL returnValue = FALSE;\n\tCFDictionaryRef sessionInfoDict = CGSessionCopyCurrentDictionary();\n\n\tif (sessionInfoDict == NULL)\n\t\tNSLog(@\"Unable to get session dictionary.\");\n\telse {\n\t\tCFBooleanRef userIsActive = CFDictionaryGetValue(sessionInfoDict, kCGSessionOnConsoleKey);\n\t\treturnValue = CFBooleanGetValue(userIsActive);\n\t\tCFRelease(sessionInfoDict);\n\t}\n\n//\tif (0) {\n//\t\t// This one succeeds in \"off-screen acounts\" also\n//\t\tSecuritySessionId mySession;\n//\t\tSessionAttributeBits sessionInfo;\n//\t\tOSStatus error = SessionGetInfo(callerSecuritySession, &mySession, &sessionInfo);\n//\n//\t\treturnValue = (sessionInfo & sessionHasGraphicAccess);\n//\t}\n//\telse if (0) {\n//\t\t// There must be a better way but for now this seems to indicate if we are a console session or not\n//\t\t// at least for logged in users -- it always returns NO for the login window\n//\t\tCGEventSourceRef testRef = CGEventSourceCreate(kCGEventSourceStatePrivate);\n//\t\tint pollDelay = 0; // No poll at this time, just look once\n//\n//\t\twhile (!testRef && pollDelay) {\n//\t\t\tusleep(100000);\n//\t\t\tpollDelay -= 100000;\n//\t\t\ttestRef = CGEventSourceCreate(kCGEventSourceStatePrivate);\n//\t\t}\n//\n//\t\tif (testRef != NULL) {\n//\t\t\treturnValue = TRUE;\n//\t\t\tCFRelease(testRef);\n//\t\t}\n//\t}\n\n\treturn returnValue;\n}\n\n+ (void) load {\n\tif (NSAppKitVersionNumber < NSAppKitVersionNumber10_4) {\n\t\t[NSException raise:@\"Tiger (10.4) Required\" format:@\"Unable to load Tiger Bundle\"];\n\t}\n}\n\n+ (void) rfbStartup: (rfbserver *) aServer {\n\t[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:\n\t\t@\"NO\", @\"UnicodeKeyboard\", // Load The Unicode Keyboard\n\t\t@\"NO\", @\"DynamicKeyboard\", // Try to set the keyboard \"as we need it\", doesn't work well on Tiger\n\t\t@\"-1\", @\"UnicodeKeyboardIdentifier\", // ID of the Unicode Keyboard resource to use (-1 is Apple's)\n\n\t\t@\"2\", @\"EventSource\", // Always private event source so we don't consolidate with existing keys (however HID for the EventTap always does anyhow)\n\t\t@\"3\", @\"EventTap\", // Default Event Tap (3=HID for Console User and Session For OffScreen Users)\n\t\t@\"5000\", @\"ModifierDelay\", // Delay when shifting modifier keys\n\t\t@\"NO\", @\"SystemServer\",\n\t\tnil]];\n\n    theServer = aServer;\n\t*(id *)(theServer->alternateKeyboardHandler) = [[self alloc] init];\n\n\t// 10.5 System Server special behavior\n\tif (floor(NSAppKitVersionNumber) > floor(NSAppKitVersionNumber10_4) &&\n\t\t[[NSUserDefaults standardUserDefaults] boolForKey:@\"SystemServer\"]) {\n\t\t// On 10.5 we need quit if the user switches out (so we can relinquish the port)\n\t\tif (isConsoleSession()) {\n\t\t\t[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   selector:@selector(systemServerShouldQuit:)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   name: NSWorkspaceSessionDidResignActiveNotification\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t object:nil];\n\t\t}\n\t\t// On 10.5 we need to be able to \"hold\" if we aren't the console session\n\t\telse {\n\t\t\t[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   selector:@selector(systemServerShouldContinue:)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   name: NSWorkspaceSessionDidBecomeActiveNotification\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t object:nil];\n\t\t\treadyToStartup = NO;\n\t\t\t// Run Loop\n\t\t\tNSLog(@\"System Server for non-console session, pausing until we receive console access\");\n\t\t\twhile (!readyToStartup) {\n\t\t\t\tOSStatus resultCode = RunCurrentEventLoop(kEventDurationSecond); //EventTimeout\n\t\t\t\tif (resultCode != eventLoopTimedOutErr) {\n\t\t\t\t\tNSLog(@\"Received Result: %d during event loop, Shutting Down\", resultCode);\n\t\t\t\t\t//rfbShutdown();\n\t\t\t\t\texit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tmodifierDelay = [[NSUserDefaults standardUserDefaults] integerForKey:@\"ModifierDelay\"];\n\n\t[self loadUnicodeKeyboard];\n}\n\n+ (void) systemServerShouldQuit: (NSNotification *) aNotification {\n    NSLog(@\"User Switched Out, Stopping System Server - %@\", [aNotification name]);\n\t//rfbShutdown();\n\texit(0);\n\treturn;\n}\n+ (void) systemServerShouldContinue: (NSNotification *) aNotification {\n    NSLog(@\"User Switched In, Starting System Server - %@\", [aNotification name]);\n\treadyToStartup = YES;\n\treturn;\n}\n\n+ (void) rfbRunning {\n\tif ([[NSUserDefaults standardUserDefaults] boolForKey:@\"DynamicKeyboard\"])\n\t\tdynamicKeyboard = TRUE;\n\n\t// Event Source represents which existing event states should be combined with the incoming events\n\tswitch ([[NSUserDefaults standardUserDefaults] integerForKey:@\"EventSource\"]) {\n\t\tcase 2:\n\t\t\t// Doesn't combine with any other sources\n\t\t\tNSLog(@\"Using Private Event Source\");\n\t\t\tvncSourceRef = CGEventSourceCreate(kCGEventSourceStatePrivate);\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t// Combines with only with other User Session\n\t\t\tNSLog(@\"Using Combined Event Source, WARNING: Doesn't work if we FUS off-screen (10.5.1)\");\n\t\t\tvncSourceRef = CGEventSourceCreate(kCGEventSourceStateCombinedSessionState);\n\t\t\tbreak;\n\t\tcase 0:\n\t\t\t// Combines with Physical Keyboard\n\t\t\tNSLog(@\"Using HID Event Source, WARNING: Doesn't allow keys if we FUS off-screen (10.5.7)\");\n\t\t\tvncSourceRef = CGEventSourceCreate(kCGEventSourceStateHIDSystemState);\n\t\t\tbreak;\n\t\tcase 3: // I am pretty sure works similar to the HID\n\t\tdefault:\n\t\t\tvncSourceRef = NULL;\n\t\t\tbreak;\n\t}\n\tif (!vncSourceRef)\n\t\tNSLog(@\"No Event Source -- Using 10.3 API\");\n\n\t// Event Taps represent at what level of the input manager the events will be interpretted\n\tswitch ([[NSUserDefaults standardUserDefaults] integerForKey:@\"EventTap\"]) {\n\t\tcase 3: {\n\t\t\tif (isConsoleSession()) {\n\t\t\t\tNSLog(@\"Using Smart Event Tap -- HID for console user\");\n\t\t\t\tvncTapLocation = kCGHIDEventTap;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tNSLog(@\"Using Smart Event Tap -- Session for off-screen user\");\n\t\t\t\tvncTapLocation = kCGSessionEventTap;\n\t\t\t}\n\n\t\t\t[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   selector:@selector(userSwitchedIn:)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   name: NSWorkspaceSessionDidBecomeActiveNotification\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t object:nil];\n\t\t\t[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   selector:@selector(userSwitchedOut:)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   name: NSWorkspaceSessionDidResignActiveNotification\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t object:nil];\n\t\t\tbreak;\n\t\t}\n\t\tcase 2:\n\t\t\tNSLog(@\"Using Annotated Session Event Tap\");\n\t\t\tvncTapLocation = kCGAnnotatedSessionEventTap;\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t// At this level will can passed in modifiers\n\t\t\t// it will ignore physical keyboard state\n\t\t\t// it will NOT impact physical keyboard state\n\t\t\tNSLog(@\"Using Session Event Tap\");\n\t\t\tvncTapLocation = kCGSessionEventTap;\n\t\t\tbreak;\n\t\tcase 0:\n\t\tdefault:\n\t\t\t// At this level will ignore passed in modifiers\n\t\t\t// it will combine with the physical keyboard state (CapsLock, etc)\n\t\t\t// it WILL impact physical keyboard state\n\t\t\tNSLog(@\"Using HID Event Tap\");\n\t\t\tvncTapLocation = kCGHIDEventTap;\n\t\t\tbreak;\n\t}\n}\n\n+ (void) loadUnicodeKeyboard {\n\tif ([[NSUserDefaults standardUserDefaults] boolForKey:@\"UnicodeKeyboard\"] && unicodeInputSource == NULL) {\n\t\t// Need to figure out a way to lookup the Unicode Keyboard before this will work\n\n\t\t// OSStatus result = KLGetKeyboardLayoutWithIdentifier([[NSUserDefaults standardUserDefaults] integerForKey:@\"UnicodeKeyboardIdentifier\"], &unicodeLayout);\n\n\t\t// Unicode Keyboard Should load keys from definition\n\t\t(*(theServer->pressModsForKeys) = YES);\n\t\t[self loadKeyboard:unicodeInputSource forServer:theServer];\n\t}\n}\n\n\n+ (void) userSwitchedIn: (NSNotification *) aNotification {\n    NSLog(@\"User Switched In, Using HID Tap - %@\", [aNotification name]);\n\tvncTapLocation = kCGHIDEventTap;\n\treturn;\n}\n+ (void) userSwitchedOut: (NSNotification *) aNotification {\n    NSLog(@\"User Switched Out, Using Session Tap - %@\", [aNotification name]);\n\tvncTapLocation = kCGSessionEventTap;\n\treturn;\n}\n\n+ (void) rfbConnect {\n\tif (unicodeInputSource != NULL && !dynamicKeyboard) {\n\t\tcurrentInputSource = TISCopyCurrentKeyboardInputSource();\n\t\t// Switch to Unicode Keyboard\n\t\tSyncSetKeyboardLayout(unicodeInputSource);\n\t}\n}\n\n+ (void) rfbDisconnect {\n\tif (unicodeInputSource != NULL && !dynamicKeyboard) {\n\t\t// Switch to Old Keyboard\n\t\tSyncSetKeyboardLayout(currentInputSource);\n\t}\n}\n\n+ (void) rfbUsage {\n    fprintf(stderr,\n            \"\\nTiger BUNDLE OPTIONS (10.4+):\\n\"\n\t\t\t);\n}\n\n+ (void) rfbPoll {\n\tif (0 && vncTapLocation == kCGHIDEventTap) {\n\t\tCGEventFlags newModifiers = 0;\n\n\t\tif (CGEventSourceKeyState(kCGEventSourceStateHIDSystemState,keyCodeShift))\n\t\t\tnewModifiers |= kCGEventFlagMaskShift;\n\t\tif (CGEventSourceKeyState(kCGEventSourceStateHIDSystemState,keyCodeOption))\n\t\t\tnewModifiers |= kCGEventFlagMaskAlternate;\n\t\tif (CGEventSourceKeyState(kCGEventSourceStateHIDSystemState,keyCodeControl))\n\t\t\tnewModifiers |= kCGEventFlagMaskControl;\n\t\tif (CGEventSourceKeyState(kCGEventSourceStateHIDSystemState,keyCodeCommand))\n\t\t\tnewModifiers |= kCGEventFlagMaskControl;\n\n\t\tcurrentModifiers = newModifiers;\n\t}\n\n    return;\n}\n\n+ (void) rfbReceivedClientMessage {\n    return;\n}\n\n+ (void) rfbShutdown {\n    NSLog(@\"Unloading Tiger Extensions\");\n}\n\n// Keyboard handling code\n- (void) handleKeyboard:(Bool) down forSym: (KeySym) keySym forClient: (rfbClientPtr) cl {\n\tCGKeyCode keyCode = theServer->keyTable[(unsigned short)keySym];\n\tCGEventFlags modifiersToSend = 0;\n\n\tif (1) {\n\t\t// Find the right keycodes base on the loaded keyboard\n\t\tkeyCodeShift = theServer->keyTable[XK_Shift_L];\n\t\tkeyCodeOption = theServer->keyTable[XK_Meta_L];\n\t\tkeyCodeControl = theServer->keyTable[XK_Control_L];\n\t\tkeyCodeCommand = theServer->keyTable[XK_Alt_L];\n\t}\n\n\t// If we can't locate the keycode then we will use the special OPTION+4 HEX coding that is available on the Unicode HexInput Keyboard\n\tif (keyCode == 0xFFFF) {\n\t\tif (down && unicodeInputSource != NULL) {\n\t\t\tCGKeyCode keyCodeMeta = 58; // KeyCode for the Option key with the Unicode Hex input keyboard\n\t\t\tunsigned short mask=0xF000;\n\t\t\tint rightShift;\n\t\t\tCGEventFlags oldModifiers = currentModifiers;\n\n\t\t\t// Switch to Unicode Keyboard\n\t\t\tif (dynamicKeyboard) {\n\t\t\t\tcurrentInputSource = TISCopyCurrentKeyboardInputSource();\n\t\t\t\tSyncSetKeyboardLayout(unicodeInputSource);\n\t\t\t}\n\n\t\t\tmodifiersToSend = kCGEventFlagMaskAlternate | kCGEventFlagMaskNonCoalesced;\n\n\t\t\t[self setKeyModifiers: modifiersToSend];\n\t\t\tfor (rightShift = 12; rightShift >= 0; rightShift-=4) {\n\t\t\t\tshort unidigit = (keySym & mask) >> rightShift;\n\n\t\t\t\t[self sendKeyEvent:unicodeNumbersToKeyCodes[unidigit] down:1 modifiers:modifiersToSend];\n\t\t\t\t[self sendKeyEvent:unicodeNumbersToKeyCodes[unidigit] down:0 modifiers:modifiersToSend];\n\n\t\t\t\tmask >>= 4;\n\t\t\t}\n\t\t\t[self setKeyModifiers: oldModifiers];\n\n\t\t\t// Switch to Old Keyboard\n\t\t\tif (dynamicKeyboard)\n\t\t\t\tSyncSetKeyboardLayout(currentInputSource);\n\t\t}\n\t}\n\telse {\n\t\tBOOL isModifierKey = (XK_Shift_L <= keySym && keySym <= XK_Hyper_R);\n\n\t\tif (isModifierKey) {\n\t\t\t// Mark the key state for the client, we'll release down keys later\n\t\t\tcl->modiferKeys[keyCode] = down;\n\n\t\t\t// Record them in our \"currentModifiers\"\n\t\t\tswitch (keySym) {\n\t\t\t\tcase XK_Shift_L:\n\t\t\t\tcase XK_Shift_R:\n\t\t\t\t\tif (down)\n\t\t\t\t\t\tcurrentModifiers |= kCGEventFlagMaskShift;\n\t\t\t\t\telse\n\t\t\t\t\t\tcurrentModifiers &= ~kCGEventFlagMaskShift;\n\t\t\t\t\tbreak;\n\t\t\t\tcase XK_Control_L:\n\t\t\t\tcase XK_Control_R:\n\t\t\t\t\tif (down)\n\t\t\t\t\t\tcurrentModifiers |= kCGEventFlagMaskControl;\n\t\t\t\t\telse\n\t\t\t\t\t\tcurrentModifiers &= ~kCGEventFlagMaskControl;\n\t\t\t\t\tbreak;\n\t\t\t\tcase XK_Meta_L:\n\t\t\t\tcase XK_Meta_R:\n\t\t\t\t\tif (down)\n\t\t\t\t\t\tcurrentModifiers |= kCGEventFlagMaskAlternate;\n\t\t\t\t\telse\n\t\t\t\t\t\tcurrentModifiers &= ~kCGEventFlagMaskAlternate;\n\t\t\t\t\tbreak;\n\t\t\t\tcase XK_Alt_L:\n\t\t\t\tcase XK_Alt_R:\n\t\t\t\t\tif (down)\n\t\t\t\t\t\tcurrentModifiers |= kCGEventFlagMaskCommand;\n\t\t\t\t\telse\n\t\t\t\t\t\tcurrentModifiers &= ~kCGEventFlagMaskCommand;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t[self sendKeyEvent:keyCode down:down modifiers:currentModifiers];\n\t\t}\n\t\telse {\n\t\t\tif (*(theServer->pressModsForKeys)) {\n\t\t\t\tif (theServer->keyTableMods[keySym] != 0xFF) {\n\t\t\t\t\t// Setup the state of the appropriate keys based on the value in the KeyTableMods\n\t\t\t\t\tCGEventFlags oldModifiers = currentModifiers;\n\t\t\t\t\tCGEventFlags modifiersToSend = kCGEventFlagMaskNonCoalesced;\n\n\t\t\t\t\tif ((theServer->keyTableMods[keySym] << 8) & shiftKey)\n\t\t\t\t\t\tmodifiersToSend |= kCGEventFlagMaskShift;\n\t\t\t\t\tif ((theServer->keyTableMods[keySym] << 8) & optionKey)\n\t\t\t\t\t\tmodifiersToSend |= kCGEventFlagMaskAlternate;\n\t\t\t\t\tif ((theServer->keyTableMods[keySym] << 8) & controlKey)\n\t\t\t\t\t\tmodifiersToSend |= kCGEventFlagMaskControl;\n\n\t\t\t\t\t// Treat command key separately (not as part of the generation string)\n\t\t\t\t\tmodifiersToSend |= (currentModifiers & kCGEventFlagMaskCommand);\n\n\t\t\t\t\t[self setKeyModifiers: modifiersToSend];\n\t\t\t\t\t[self sendKeyEvent:keyCode down:down modifiers:modifiersToSend];\n\t\t\t\t\t// Back to current depressed state\n\t\t\t\t\t[self setKeyModifiers: oldModifiers];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// Not Modified (special keys, other modifiers)\n\t\t\t\t\t[self sendKeyEvent:keyCode down:down modifiers:currentModifiers];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tCGEventFlags oldModifiers = currentModifiers;\n\t\t\t\tCGEventFlags modifiersToSend = kCGEventFlagMaskNonCoalesced |\n\t\t\t\t\t(cl->modiferKeys[keyCodeShift] ? kCGEventFlagMaskShift : 0) |\n\t\t\t\t\t(cl->modiferKeys[keyCodeControl] ? kCGEventFlagMaskControl : 0) |\n\t\t\t\t\t(cl->modiferKeys[keyCodeOption] ? kCGEventFlagMaskAlternate : 0) |\n\t\t\t\t\t(cl->modiferKeys[keyCodeCommand] ? kCGEventFlagMaskCommand : 0);\n\n\t\t\t\t[self setKeyModifiers: modifiersToSend];\n\t\t\t\t[self sendKeyEvent:keyCode down:down modifiers:modifiersToSend];\n\t\t\t\t[self setKeyModifiers: oldModifiers];\n\t\t\t}\n\t\t}\n\t}\n}\n\n- (void) setKeyModifiers: (CGEventFlags) modifierFlags {\n\t// If it's a session tap (and we have an event source) then we can specify our own modifiers as part of the event (nothing to do here)\n\t// Otherwise we will have to explicitly twiddle them at the HID level based on their current state\n\tif (vncTapLocation == kCGHIDEventTap || !vncSourceRef) {\n\t\tCGEventRef event = nil;\n\n\t\t// Toggle the state of the appropriate keys\n\t\tif ((currentModifiers & kCGEventFlagMaskCommand) != (modifierFlags & kCGEventFlagMaskCommand)) {\n\t\t\t[self sendKeyEvent:keyCodeCommand down:((modifierFlags & kCGEventFlagMaskCommand) != 0) modifiers:0];\n\t\t}\n\t\tif ((currentModifiers & kCGEventFlagMaskShift) != (modifierFlags & kCGEventFlagMaskShift)) {\n\t\t\t[self sendKeyEvent:keyCodeShift down:((modifierFlags & kCGEventFlagMaskShift) != 0) modifiers:0];\n\t\t}\n\t\tif ((currentModifiers & kCGEventFlagMaskAlternate) != (modifierFlags & kCGEventFlagMaskAlternate)) {\n\t\t\t[self sendKeyEvent:keyCodeOption down:((modifierFlags & kCGEventFlagMaskAlternate) != 0) modifiers:0];\n\t\t}\n\t\tif ((currentModifiers & kCGEventFlagMaskControl) != (modifierFlags & kCGEventFlagMaskControl)) {\n\t\t\t[self sendKeyEvent:keyCodeControl down:((modifierFlags & kCGEventFlagMaskControl) != 0) modifiers:0];\n\t\t}\n\n\t\tif (modifierDelay)\n\t\t\tusleep(modifierDelay);\n\t}\n\tcurrentModifiers = modifierFlags;\n}\n\n- (BOOL) checkModiferState {\n\tCGEventFlags actualFlags = CGEventSourceFlagsState(CGEventSourceGetSourceStateID(vncSourceRef));\n\tBOOL match = YES;\n\n\tif ((actualFlags & kCGEventFlagMaskCommand) != (currentModifiers & kCGEventFlagMaskCommand) ||\n\t\t(actualFlags & kCGEventFlagMaskShift) != (currentModifiers & kCGEventFlagMaskShift) ||\n\t\t(actualFlags & kCGEventFlagMaskAlternate) != (currentModifiers & kCGEventFlagMaskAlternate) ||\n\t\t(actualFlags & kCGEventFlagMaskControl) != (currentModifiers & kCGEventFlagMaskControl)) {\n\t\tmatch = NO;\n\t\t//NSLog(@\"Actual(%0x) did not match Recorded (%0x)\", actualFlags & 0xffffffff, currentModifiers & 0xffffffff);\n\t}\n\treturn match;\n}\n\n- (void) sendKeyEvent: (CGKeyCode) keyCode down: (BOOL) down modifiers: (CGEventFlags) modifiersToSend {\n\tif (!vncSourceRef) {\n\t\tCGPostKeyboardEvent(0, keyCode, down);\n\t}\n\telse {\n\t\tCGEventRef event = CGEventCreateKeyboardEvent(vncSourceRef, keyCode, down);\n\n\t\t// The value of this function escapes me (since you still need to specify the keyCode for it to work\n\t\t// CGEventKeyboardSetUnicodeString (event, 1, (const UniChar *) &keySym);\n\n\t\t// If it's a session tap then we can specify our own modifiers as part of the event\n\t\tif (vncTapLocation != kCGHIDEventTap)\n\t\t\tCGEventSetFlags(event, modifiersToSend);\n\n\t\tCGEventPost(vncTapLocation, event);\n\n\t\tif (vncTapLocation == kCGHIDEventTap) {\n\t\t\tint maxWait = 250000; // 1/4 second\n\n\t\t\t// NEED TO WAIT UNTIL MODIFIER FLAGS REFLECT THE EXPECTED STATE\n\t\t\twhile ([self checkModiferState] == NO && maxWait > 0) {\n\t\t\t\tmaxWait -= 10000;\n\t\t\t\tusleep(10000);\n\t\t\t}\n\t\t}\n\n\t\tCFRelease(event);\n\t}\n}\n\n\nvoid SyncSetKeyboardLayout (TISInputSourceRef inputSource) {\n\t// http://developer.apple.com/library/mac/#documentation/TextFonts/Reference/TextInputSourcesReference/Reference/reference.html\n\tif (TISSelectInputSource(inputSource) != noErr) {\n\t\tNSLog(@\"Error selecting input source:\");\n\t}\n}\n\n//- (void) sendKeyEvent: (NSDictionary *) eventData {\n//\tNSDictionary *eventDictionary = [NSDictionary dictionaryWithObjectsAndKeys:\n//\t\t\t\t\t\t\t\t\t [NSNumber numberWithInt: keyCode], @\"keyCode\",\n//\t\t\t\t\t\t\t\t\t [NSNumber numberWithBool:down], @\"down\",\n//\t\t\t\t\t\t\t\t\t [NSNumber numberWithLong: modifiersToSend], @\"modifierFlags\",\n//\t\t\t\t\t\t\t\t\t nil];\n//\t[self performSelectorOnMainThread:@selector(sendKeyEvent:) withObject:eventDictionary waitUntilDone:YES];\n//\tCGKeyCode keyCode = [[eventData objectForKey:@\"keyCode\"] intValue];\n//\tBOOL down = [[eventData objectForKey:@\"down\"] boolValue];\n//\tCGEventFlags localModifierFlags = [[eventData objectForKey:@\"modifierFlags\"] longValue];\n//}\n\n\n@end\n"
  },
  {
    "path": "Bundles/VNCBundle.h",
    "content": "//\n//  VNCBundle.h\n//  OSXvnc\n//\n//  Created by Jonathan Gillaspie on 3/6/08.\n//  Copyright 2008 __MyCompanyName__. All rights reserved.\n//\n\n#import <Cocoa/Cocoa.h>\n\n#import <Carbon/Carbon.h>\n\n#import \"rfbserver.h\"\n\n@interface VNCBundle : NSObject {\n\n}\n\n+ (void) loadKeyboard: (TISInputSourceRef) keyboardLayoutRef forServer: (rfbserver *) theServer;\n\n@end\n"
  },
  {
    "path": "Bundles/VNCBundle.m",
    "content": "//\n//  VNCBundle.m\n//  OSXvnc\n//\n//  Created by Jonathan Gillaspie on 3/6/08.\n//  Copyright 2008 __MyCompanyName__. All rights reserved.\n//\n\n#import \"VNCBundle.h\"\n\n#import \"keysymdef.h\"\n#import \"kbdptr.h\"\n\n\n@implementation VNCBundle\n\n+ (void) initialize {\n\t[[NSUserDefaults standardUserDefaults] registerDefaults:\n\t [NSDictionary dictionaryWithObjectsAndKeys:\n\t  [NSArray arrayWithObjects:[NSNumber numberWithInt:kUCKeyActionAutoKey],[NSNumber numberWithInt:kUCKeyActionDisplay],[NSNumber numberWithInt:kUCKeyActionDown], [NSNumber numberWithInt:kUCKeyActionUp], nil], @\"KeyStates\", // Key States to review to find KeyCodes\n\t  nil]];\n}\n\n// Here are the resources we can think about using for Int'l keyboard support\n\n// http://developer.apple.com/documentation/Carbon/Reference/KeyboardLayoutServices/\n\n// This will let us determine the current keyboard\n// KLGetCurrentKeyboardLayout\n\n// This will set the current keyboard\n// KLSetCurrentKeyboardLayout\n\n// This will get the Properties of a keyboard (like the key code to char tables) but...\n// KLGetKeyboardLayoutProperty\n\n// UCKeyTranslate - This is the opposite of what we need, if you give it a table and some keyCode (key input) it will tell you what Unicode char (or string) you get\n// we need the opposite - we want to know what keys to hit to get a given key (or string)\n\n// This will use the KeyboardLayoutRef to produce a static table of lookups\n// By iterating through all possible KeyCodes\n+ (void) loadKeyboard: (TISInputSourceRef) inputSource forServer: (rfbserver *) theServer{\n    int i, j;\n    UCKeyboardLayout *uchrHandle = NULL;\n    CFStringRef keyboardName;\n    static UInt32 modifierKeyStates[] = {0, shiftKey, optionKey, controlKey, optionKey | shiftKey, optionKey | controlKey, controlKey | shiftKey, optionKey | shiftKey | controlKey};\n\tUInt32 modifierKeyState = 0;\n\tNSArray *keyStates = [[NSUserDefaults standardUserDefaults] arrayForKey:@\"KeyStates\"];\n\n    /* modifiers */\n    //cmdKey                        = 1 << cmdKeyBit,\n    //shiftKey                      = 1 << shiftKeyBit,\n    //alphaLock                     = 1 << alphaLockBit,\n    //optionKey                     = 1 << optionKeyBit,\n    //controlKey                    = 1 << controlKeyBit,\n\n    // KLGetKeyboardLayoutProperty is 10.2 only how do I access these resources in early versions?\n    if (inputSource) {\n        keyboardName = (CFStringRef) TISGetInputSourceProperty(inputSource, kTISPropertyLocalizedName);\n        NSLog(@\"Keyboard detected: %@ - loading keys\", keyboardName);\n\t\tuchrHandle = (CFDataRef) TISGetInputSourceProperty(inputSource, kTISPropertyUnicodeKeyLayoutData);\n    }\n\n    // Initialize them all to 0xFFFF\n    memset(theServer->keyTable, 0xFF, keyTableSize * sizeof(CGKeyCode));\n    memset(theServer->keyTableMods, 0xFF, keyTableSize * sizeof(unsigned char));\n\n    if (uchrHandle) {\n        // Ok - we could get the LIST of Modifier Key States out of the Keyboard Layout\n        // some of them are duplicates so we need to compare them, then we'll iterate through them in reverse order\n        // UCKeyModifiersToTableNum = ; EventRecord\n        // This layout gets a little harry\n\n        UInt16 keyCode;\n        UInt32 keyboardType = LMGetKbdType();\n        UInt32 deadKeyState = 0;\n        UniCharCount actualStringLength;\n        UniChar unicodeChar[255];\n\n        // Iterate Over Each Modifier Keyset\n        for (i=0; i < (sizeof(modifierKeyStates) / sizeof(UInt32)); i++) {\n            modifierKeyState = (modifierKeyStates[i] >> 8) & 0xFF;\n            //NSLog(@\"Loading Keys For Modifer State: %#04x\", modifierKeyState);\n            // Iterate Over Each Key Code\n            for (keyCode = 0; keyCode < 255; keyCode++) {\n\t\t\t\tfor (j=0; j < [keyStates count]; j++) {\n\t\t\t\t\tint keyActionState = [[keyStates objectAtIndex:j] intValue];\n\t\t\t\t\tOSStatus resultCode = UCKeyTranslate (uchrHandle,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t  keyCode,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t  keyActionState,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t  modifierKeyState,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t  keyboardType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t  kUCKeyTranslateNoDeadKeysBit,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t  &deadKeyState,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t  255, // Only 1 key allowed due to VNC behavior\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t  &actualStringLength,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t  unicodeChar);\n\n\t\t\t\t\tif (resultCode == noErr) {\n\t\t\t\t\t\tif (actualStringLength > 1) {\n\t\t\t\t\t\t\tNSLog(@\"Multiple Characters For %d (%#04x): %S\",  keyCode, modifierKeyState, unicodeChar);\n\t\t\t\t\t\t\t//unicodeChar[0] = unicodeChar[actualStringLength-1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// We'll use the FIRST keyCode that we find for that UNICODE character\n\t\t\t\t\t\t\tif (theServer->keyTable[unicodeChar[0]] == 0xFFFF) {\n\t\t\t\t\t\t\t\ttheServer->keyTable[unicodeChar[0]] = keyCode;\n\t\t\t\t\t\t\t\ttheServer->keyTableMods[unicodeChar[0]] = modifierKeyState;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tNSLog(@\"Error Translating %d (%#04x): %d\",  keyCode, modifierKeyState, resultCode);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n        }\n    }\n    else {\n        // This is the old US only keyboard mapping\n        // Map the above key table into a static array so we can just look them up directly\n        NSLog(@\"Unable to determine key map - reverting to US mapping\");\n        for (i = 0; i < (sizeof(USKeyCodes) / sizeof(int)); i += 2)\n            theServer->keyTable[(unsigned short)USKeyCodes[i]] = (CGKeyCode) USKeyCodes[i+1];\n    }\n\n    // This is the old SpecialKeyCodes keyboard mapping\n    // Map the above key table into a static array so we can just look them up directly\n    NSLog(@\"Loading %d XKeysym special keys\", (sizeof(SpecialKeyCodes) / sizeof(int))/2);\n    for (i = 0; i < (sizeof(SpecialKeyCodes) / sizeof(int)); i += 2) {\n        theServer->keyTable[(unsigned short)SpecialKeyCodes[i]] = (CGKeyCode) SpecialKeyCodes[i+1];\n\t}\n}\n\n@end\n"
  },
  {
    "path": "English.lproj/MainMenu.nib/classes.nib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>IBClasses</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>ACTIONS</key>\n\t\t\t<dict>\n\t\t\t\t<key>cancelConnectHost</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>changeAuthenticationType</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>changeDisplayName</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>changeDisplayNumber</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>changePassword</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>changePort</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>changeSharing</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>changeSystemServerAuthentication</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>changeSystemServerPort</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>connectHost</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>installAsService</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>loadUserDefaults</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>openFile</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>openFirewall</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>openGPL</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>openLog</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>openReleaseNotes</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>optionChanged</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>removeService</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>reverseConnection</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>saveUserDefaults</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>setInitialAuthentication</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>startServer</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>stopServer</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>terminateRequest</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>validateInitialAuthentication</key>\n\t\t\t\t<string>id</string>\n\t\t\t</dict>\n\t\t\t<key>CLASS</key>\n\t\t\t<string>VNCController</string>\n\t\t\t<key>LANGUAGE</key>\n\t\t\t<string>ObjC</string>\n\t\t\t<key>OUTLETS</key>\n\t\t\t<dict>\n\t\t\t\t<key>allowDimmingCheckbox</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>allowRendezvousCheckbox</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>allowScreenSaverCheckbox</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>allowSleepCheckbox</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>authenticationType</key>\n\t\t\t\t<string>NSMatrix</string>\n\t\t\t\t<key>connectHost</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>connectPort</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>disableRemoteEventsCheckbox</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>disableRichClipboardCheckbox</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>disableStartupButton</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>displayNameField</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>displayNumText</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>displayNumberField</key>\n\t\t\t\t<string>NSPopUpButton</string>\n\t\t\t\t<key>dontDisconnectCheckbox</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>eventSourcePopup</key>\n\t\t\t\t<string>NSPopUpButton</string>\n\t\t\t\t<key>hostNamesBox</key>\n\t\t\t\t<string>NSBox</string>\n\t\t\t\t<key>hostNamesField</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>initialAuthenticationType</key>\n\t\t\t\t<string>NSMatrix</string>\n\t\t\t\t<key>initialDoneButton</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>initialPasswordText</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>initialWindow</key>\n\t\t\t\t<string>NSWindow</string>\n\t\t\t\t<key>ipAddressesBox</key>\n\t\t\t\t<string>NSBox</string>\n\t\t\t\t<key>ipAddressesView</key>\n\t\t\t\t<string>NSMatrix</string>\n\t\t\t\t<key>keyboardEvents</key>\n\t\t\t\t<string>NSPopUpButton</string>\n\t\t\t\t<key>keyboardLayout</key>\n\t\t\t\t<string>NSPopUpButton</string>\n\t\t\t\t<key>limitToLocalConnections</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>openGLCheckbox</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>optionsTabView</key>\n\t\t\t\t<string>NSTabView</string>\n\t\t\t\t<key>otherArguments</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>passwordField</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>portField</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>portNumText</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>preferenceWindow</key>\n\t\t\t\t<string>NSWindow</string>\n\t\t\t\t<key>preferencesMessageTestField</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>protocolVersion</key>\n\t\t\t\t<string>NSPopUpButton</string>\n\t\t\t\t<key>reverseConnectionMessageField</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>reverseConnectionWindow</key>\n\t\t\t\t<string>NSWindow</string>\n\t\t\t\t<key>serverKeepAliveCheckbox</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>serverMenuItem</key>\n\t\t\t\t<string>NSMenuItem</string>\n\t\t\t\t<key>setStartupButton</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>sharingMatrix</key>\n\t\t\t\t<string>NSMatrix</string>\n\t\t\t\t<key>startServerButton</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>startServerMenuItem</key>\n\t\t\t\t<string>NSMenuItem</string>\n\t\t\t\t<key>startServerOnLaunchCheckbox</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>startupItemStatusMessageField</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>statusMessageField</key>\n\t\t\t\t<string>NSTextView</string>\n\t\t\t\t<key>statusWindow</key>\n\t\t\t\t<string>NSWindow</string>\n\t\t\t\t<key>stopServerButton</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>stopServerMenuItem</key>\n\t\t\t\t<string>NSMenuItem</string>\n\t\t\t\t<key>swapMouseButtonsCheckbox</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>systemServerAuthenticationType</key>\n\t\t\t\t<string>NSMatrix</string>\n\t\t\t\t<key>systemServerDisplayNameField</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>systemServerDisplayNumberField</key>\n\t\t\t\t<string>NSPopUpButton</string>\n\t\t\t\t<key>systemServerLimitToLocalConnections</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>systemServerMenu</key>\n\t\t\t\t<string>NSMenuItem</string>\n\t\t\t\t<key>systemServerPasswordField</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>systemServerPortField</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>systemServerWindow</key>\n\t\t\t\t<string>NSWindow</string>\n\t\t\t\t<key>terminateOnFastUserSwitch</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t</dict>\n\t\t\t<key>SUPERCLASS</key>\n\t\t\t<string>NSObject</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>CLASS</key>\n\t\t\t<string>NSObject</string>\n\t\t\t<key>LANGUAGE</key>\n\t\t\t<string>ObjC</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>ACTIONS</key>\n\t\t\t<dict>\n\t\t\t\t<key></key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>optionChanged</key>\n\t\t\t\t<string>id</string>\n\t\t\t</dict>\n\t\t\t<key>CLASS</key>\n\t\t\t<string>FirstResponder</string>\n\t\t\t<key>LANGUAGE</key>\n\t\t\t<string>ObjC</string>\n\t\t\t<key>SUPERCLASS</key>\n\t\t\t<string>NSObject</string>\n\t\t</dict>\n\t</array>\n\t<key>IBVersion</key>\n\t<string>1</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "English.lproj/MainMenu.nib/info.nib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>IBFramework Version</key>\n\t<string>680</string>\n\t<key>IBLastKnownRelativeProjectPath</key>\n\t<string>../../OSXvnc.xcodeproj</string>\n\t<key>IBOldestOS</key>\n\t<integer>5</integer>\n\t<key>IBOpenObjects</key>\n\t<array>\n\t\t<integer>627</integer>\n\t\t<integer>923</integer>\n\t</array>\n\t<key>IBSystem Version</key>\n\t<string>11D50b</string>\n\t<key>targetFramework</key>\n\t<string>IBCocoaFramework</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "French.lproj/Credits.rtf",
    "content": "{\\rtf1\\mac\\ansicpg10000\\cocoartf824\\cocoasubrtf100\n{\\fonttbl\\f0\\fswiss\\fcharset77 Helvetica;\\f1\\froman\\fcharset77 Times-Roman;}\n{\\colortbl;\\red255\\green255\\blue255;\\red26\\green26\\blue255;\\red0\\green0\\blue255;}\n\\vieww9000\\viewh9000\\viewkind0\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0\\fs24 \\cf0 Pour des informations et de l'aide sur OSXvnc, rendez-vous sur\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f1 \\cf0 \t\n\\f0 \\cf2 \\ul \\ulc2 http://www.redstonesoftware.com/osxvnc\n\\f1 \\cf0 \\ulnone \\\n\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0 \\cf0 Copyright \\'a9 2002-2005 Redstone Software\\\n\tJonathan Gillaspie\\\n\tDoug Simons\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f1 \\cf0 \t\n\\f0 \\cf2 \\ul osxvnc@redstonesoftware.com\n\\f1 \\cf0 \\ulnone \\\n\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0 \\cf0 Copyright \\'a9 2002 Mahmud Haque\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f1 \\cf0 \t\n\\f0 \\cf2 \\ul mahmud@bcm.tmc.edu\n\\f1 \\cf0 \\ulnone \\\n\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0 \\cf0 Copyright \\'a9 2001 Dan McGuirk\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f1 \\cf0 \t\n\\f0 \\cf2 \\ul mcguirk@incompleteness.net\n\\f1 \\cf0 \\ulnone \\\n\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0 \\cf0 Traduction licence GNU GPL\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf2 \\ul       http://www.linux-france.org/article/these\\cf0 \\ulnone      \\\n\\\nRemerciements particuliers pour la fonction \"Server Side Scaling\" \\'88 : \\\n\tNoriaki Yamazaki\\\n\tAdministrator of micro-VNC\\\n\tHitachi System & Service, Ltd.\\\n\\\nRemerciements particuliers pour la fonction \"Reverse Connections\" \\'88 : \\\n\tMark Lentczner\\\n\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 Zlib, ZlibHex and Tight encodings:\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 \tMahmud Haque\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 \\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 Autres Contributeurs:\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f1 \\cf0 \t\n\\f0 David Johnson\n\\f1 \\\n\t\n\\f0 Steven Tamm\\\n\tMihai Parparita\\\n\\\nTraduction fran\\'8daise:\\\n\tPascal Frey\\\n\\\nTraduction Japonaise:\\\n\tAaron Madlon-Kay\n\\f1 \\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0 \\cf0 \\\nIc\\'99nes par Martin Goneau  \\\n\t\\cf2 \\ul http://www.goneau.com\\cf0 \\ulnone \\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf2 \\ul \\ulc3 \\\n\\cf0 \\ulnone ----------------------------------------------------\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 \\\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\\\n\\\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.\\\n\\\nYou should have received a copy of the GNU General Public License along with this program; if not, write to:\\\n\\\nFree Software Foundation, Inc.\\\n59 Temple Place - Suite 330\\\nBoston, MA  02111-1307\\\nUSA\\\n}\n"
  },
  {
    "path": "French.lproj/MainMenu.nib/classes.nib",
    "content": "{\n    IBClasses = (\n        {\n            ACTIONS = {optionChanged = id; };\n            CLASS = FirstResponder;\n            LANGUAGE = ObjC;\n            SUPERCLASS = NSObject;\n        },\n        {\n            ACTIONS = {\n                changeDisplayName = id;\n                changeDisplayNumber = id;\n                changePassword = id;\n                changePort = id;\n                changeSharing = id;\n                connectHost = id;\n                installAsService = id;\n                loadUserDefaults = id;\n                openFile = id;\n                openGPL = id;\n                openLog = id;\n                openReleaseNotes = id;\n                optionChanged = id;\n                removeService = id;\n                saveUserDefaults = id;\n                startServer = id;\n                stopServer = id;\n            };\n            CLASS = VNCController;\n            LANGUAGE = ObjC;\n            OUTLETS = {\n                allowDimmingCheckbox = NSButton;\n                allowKeyboardLoading = NSButton;\n                allowPressModsForKeys = NSButton;\n                allowRendezvousCheckbox = NSButton;\n                allowScreenSaverCheckbox = NSButton;\n                allowSleepCheckbox = NSButton;\n                connectHost = NSTextField;\n                connectPort = NSTextField;\n                disableRemoteEventsCheckbox = NSButton;\n                disableRichClipboardCheckbox = NSButton;\n                disableStartupButton = NSButton;\n                displayNameField = NSTextField;\n                displayNumberField = NSPopUpButton;\n                dontDisconnectCheckbox = NSButton;\n                hostNamesField = NSTextField;\n                hostNamesLabel = NSTextField;\n                ipAddressesField = NSTextField;\n                ipAddressesLabel = NSTextField;\n                limitToLocalConnections = NSButton;\n                optionsTabView = NSTabView;\n                otherArguments = NSTextField;\n                passwordField = NSTextField;\n                portField = NSTextField;\n                protocolVersion = NSPopUpButton;\n                serverKeepAliveCheckbox = NSButton;\n                setStartupButton = NSButton;\n                sharingMatrix = NSMatrix;\n                startServerButton = NSButton;\n                startServerMenuItem = NSMenuItem;\n                startServerOnLaunchCheckbox = NSButton;\n                startupItemStatusMessageField = NSTextField;\n                statusMessageField = NSTextField;\n                stopServerButton = NSButton;\n                stopServerMenuItem = NSMenuItem;\n                swapMouseButtonsCheckbox = NSButton;\n                terminateOnFastUserSwitch = NSButton;\n                window = NSWindow;\n            };\n            SUPERCLASS = NSObject;\n        }\n    );\n    IBVersion = 1;\n}\n"
  },
  {
    "path": "French.lproj/MainMenu.nib/info.nib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>IBDocumentLocation</key>\n\t<string>336 328 356 240 0 0 1920 1178 </string>\n\t<key>IBEditorPositions</key>\n\t<dict>\n\t\t<key>29</key>\n\t\t<string>141 1134 319 44 0 0 1920 1178 </string>\n\t\t<key>404</key>\n\t\t<string>800 835 192 99 0 0 1920 1178 </string>\n\t</dict>\n\t<key>IBFramework Version</key>\n\t<string>446.1</string>\n\t<key>IBOpenObjects</key>\n\t<array>\n\t\t<integer>21</integer>\n\t\t<integer>29</integer>\n\t</array>\n\t<key>IBSystem Version</key>\n\t<string>8L2127</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "German.lproj/Credits.rtf",
    "content": "{\\rtf1\\mac\\ansicpg10000\\cocoartf824\\cocoasubrtf410\n{\\fonttbl\\f0\\fswiss\\fcharset77 Helvetica;\\f1\\froman\\fcharset77 Times-Roman;}\n{\\colortbl;\\red255\\green255\\blue255;\\red26\\green26\\blue255;}\n\\vieww12080\\viewh19640\\viewkind0\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0\\fs24 \\cf0 F\\'9fr Informationen und Hilfe \\'9fber OSXvnc:\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f1 \\cf0 \t\n\\f0 \\cf2 \\ul \\ulc2 http://www.redstonesoftware.com/osxvnc\n\\f1 \\cf0 \\ulnone \\\n\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0 \\cf0 Copyright \\'a9 2002-2005 Redstone Software\\\n\tJonathan Gillaspie\\\n\tDoug Simons\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f1 \\cf0 \t\n\\f0 \\cf2 \\ul osxvnc@redstonesoftware.com\n\\f1 \\cf0 \\ulnone \\\n\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0 \\cf0 Copyright \\'a9 2002 Mahmud Haque\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f1 \\cf0 \t\n\\f0 \\cf2 \\ul mahmud@bcm.tmc.edu\n\\f1 \\cf0 \\ulnone \\\n\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0 \\cf0 Copyright \\'a9 2001 Dan McGuirk\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f1 \\cf0 \t\n\\f0 \\cf2 \\ul mcguirk@incompleteness.net\n\\f1 \\cf0 \\ulnone \\\n\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0 \\cf0 GNU GPL:\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf2 \\ul       http://www.gnu.org/copyleft/gpl.html\\cf0 \\ulnone \\\n\\\nSpezieller Dank f\\'9fr Server basierte Skalierung geht an:\\\n\tNoriaki Yamazaki\\\n\tAdministrator von micro-VNC\\\n\tHitachi System & Service, Ltd.\\\n\t\\\nSpezieller Dank f\\'9fr r\\'9fckw\\'8artige Verbindungen geht an:\\\n\tMark Lentczner\\\n\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 Zlib, ZlibHex and Tight Kodierungen:\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 \tMahmud Haque\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 \\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 Weitere Beteiligungen:\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f1 \\cf0 \t\n\\f0 David Johnson\n\\f1 \\\n\t\n\\f0 Steven Tamm\\\n\tMihai Parparita\\\n\\\nFranz\\'9asische Lokalisierung:\\\n\tPascal Frey\\\n\\\nJapanische Lokalisierung:\\\n\tAaron Madlon-Kay\\\n\\\nDeutsche Lokalisierung und internationale Tastaturlayouts:\\\n\tJ\\'9arg Mehring\\\n\\\nIcons von Martin Goneau  \\\n\t\\cf2 \\ul http://www.goneau.com\\cf0 \\ulnone \\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 \\\n----------------------------------------------------\\\n\\\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\\\n\\\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.\\\n\\\nYou should have received a copy of the GNU General Public License along with this program; if not, write to:\\\n\\\nFree Software Foundation, Inc.\\\n59 Temple Place - Suite 330\\\nBoston, MA  02111-1307\\\nUSA\\\n}\n"
  },
  {
    "path": "German.lproj/MainMenu.nib/classes.nib",
    "content": "{\n    IBClasses = (\n        {\n            ACTIONS = {\"\" = id; optionChanged = id; };\n            CLASS = FirstResponder;\n            LANGUAGE = ObjC;\n            SUPERCLASS = NSObject;\n        },\n        {\n            ACTIONS = {\n                changeDisplayName = id;\n                changeDisplayNumber = id;\n                changePassword = id;\n                changePort = id;\n                changeSharing = id;\n                connectHost = id;\n                installAsService = id;\n                loadUserDefaults = id;\n                openFile = id;\n                openGPL = id;\n                openLog = id;\n                openReleaseNotes = id;\n                optionChanged = id;\n                removeService = id;\n                saveUserDefaults = id;\n                startServer = id;\n                stopServer = id;\n            };\n            CLASS = VNCController;\n            LANGUAGE = ObjC;\n            OUTLETS = {\n                allowDimmingCheckbox = NSButton;\n                allowKeyboardLoading = NSButton;\n                allowPressModsForKeys = NSButton;\n                allowRendezvousCheckbox = NSButton;\n                allowScreenSaverCheckbox = NSButton;\n                allowSleepCheckbox = NSButton;\n                connectHost = NSTextField;\n                connectPort = NSTextField;\n                disableRemoteEventsCheckbox = NSButton;\n                disableStartupButton = NSButton;\n                displayNameField = NSTextField;\n                displayNumberField = NSPopUpButton;\n                dontDisconnectCheckbox = NSButton;\n                hostNamesField = NSTextField;\n                hostNamesLabel = NSTextField;\n                ipAddressesField = NSTextField;\n                ipAddressesLabel = NSTextField;\n                limitToLocalConnections = NSButton;\n                optionsTabView = NSTabView;\n                otherArguments = NSTextField;\n                passwordField = NSTextField;\n                portField = NSTextField;\n                protocolVersion = NSPopUpButton;\n                serverKeepAliveCheckbox = NSButton;\n                setStartupButton = NSButton;\n                sharingMatrix = NSMatrix;\n                startServerButton = NSButton;\n                startServerMenuItem = NSMenuItem;\n                startServerOnLaunchCheckbox = NSButton;\n                startupItemStatusMessageField = NSTextField;\n                statusMessageField = NSTextField;\n                stopServerButton = NSButton;\n                stopServerMenuItem = NSMenuItem;\n                swapMouseButtonsCheckbox = NSButton;\n                terminateOnFastUserSwitch = NSButton;\n                window = NSWindow;\n            };\n            SUPERCLASS = NSObject;\n        }\n    );\n    IBVersion = 1;\n}\n"
  },
  {
    "path": "German.lproj/MainMenu.nib/info.nib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>IBDocumentLocation</key>\n\t<string>116 836 356 240 0 0 1920 1178 </string>\n\t<key>IBEditorPositions</key>\n\t<dict>\n\t\t<key>29</key>\n\t\t<string>117 1133 279 44 0 0 1920 1178 </string>\n\t\t<key>404</key>\n\t\t<string>792 835 114 99 0 0 1920 1178 </string>\n\t</dict>\n\t<key>IBFramework Version</key>\n\t<string>443.0</string>\n\t<key>IBOpenObjects</key>\n\t<array>\n\t\t<integer>21</integer>\n\t\t<integer>404</integer>\n\t\t<integer>29</integer>\n\t</array>\n\t<key>IBSystem Version</key>\n\t<string>8I127</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "Italian.lproj/Copying.rtf",
    "content": "{\\rtf1\\mac\\ansicpg10000\\cocoartf824\\cocoasubrtf110\n{\\fonttbl\\f0\\fswiss\\fcharset77 Helvetica;\\f1\\fswiss\\fcharset77 Arial-BoldItalicMT;\\f2\\fswiss\\fcharset77 ArialMT;\n\\f3\\fswiss\\fcharset77 Helvetica-BoldOblique;}\n{\\colortbl;\\red255\\green255\\blue255;}\n\\margl1440\\margr1440\\vieww14540\\viewh13280\\viewkind0\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\qc\n\n\\f0\\fs24 \\cf0 GNU GENERAL PUBLIC LICENSE\\\nVersion 2, June 1991\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 \\\nCopyright (C) 1989, 1991 \\\nFree Software Foundation, Inc.\\\n59 Temple Place - Suite 330\\\nBoston, MA  02111-1307\\\nUSA.\\\n \\\n\\pard\\tx560\\tx1120\\tx1680\\tx2240\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\qc\n\\cf0 Chiunque pu\\'98 copiare e distribuire copie letterali di questo documento di licenza, ma non ne \\'8f permessa la modifica.\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 \\\n\\pard\\pardeftab708\\sb240\\sa60\\qj\n\n\\f1\\i\\b \\cf0 Preambolo\\\n\\pard\\pardeftab708\\sb240\\qj\n\n\\f2\\i0\\b0\\fs20 \\cf0 Le licenze per la maggioranza dei programmi hanno lo scopo di togliere all'utente la libert\\'88 di condividerlo e di modificarlo. Al contrario, la Licenza Pubblica Generica GNU \\'8f intesa a garantire la libert\\'88 di condividere e modificare il free software, al fine di assicurare che i programmi siano \"liberi\" per tutti i loro utenti. Questa Licenza si applica alla maggioranza dei programmi della Free Software Foundation e ad ogni altro programma i cui autori hanno scelto questa Licenza. Alcuni altri programmi della Free Software Foundation sono invece coperti dalla Licenza Pubblica Generica per Librerie. Chiunque pu\\'98 usare questa Licenza per i propri programmi.\\\nQuando si parla di \"free software\", ci si riferisce alla libert\\'88, non al prezzo. Le nostre Licenze (la GPL e la LGPL) sono progettate per assicurarsi che ciascuno abbia la libert\\'88 di distribuire copie del free software (e farsi pagare per questo, se vuole), che ciascuno riceva il codice sorgente o che lo possa ottenere se lo desidera, che ciascuno possa modificare il programma o usarne delle parti in nuovi programmi \"liberi\" e che ciascuno sappia di potere fare queste cose.\\\nPer proteggere i diritti dell'utente, abbiamo bisogno di creare delle restrizioni che vietino a chiunque di negare questi diritti o di chiedere di rinunciarvi. Queste restrizioni si traducono in certe responsabilit\\'88 per chi distribuisce copie del software e per chi lo modifica.\\\nPer esempio, chi distribuisce copie di un Programma coperto da GPL, sia gratis sia in cambio di un compenso, deve dare ai destinatari tutti i diritti che ha ricevuto. Deve anche assicurarsi che i destinatari ricevano o possano ricevere il codice sorgente. E deve mostrar loro queste condizioni di Licenza, in modo che conoscano i loro diritti.\\\nProteggiamo i diritti dell'utente in due modi: (1) proteggendo il software con un copyright, e (2) offrendo una Licenza che offre il permesso legale di copiare, distribuire e/o modificare il Programma.\\\nInfine, per proteggere ogni autore e noi stessi, vogliamo assicurarci che ognuno capisca che non ci sono garanzie per i programmi coperti da GPL. Se il Programma viene modificato da qualcun altro e ridistribuito, vogliamo che gli acquirenti sappiano che ci\\'98 che hanno non \\'8f l'originale, in modo che ogni problema introdotto da altri non si rifletta sulla reputazione degli autori originari.\\\nInfine, ogni programma libero \\'8f costantemente minacciato dai brevetti sui programmi. Vogliamo evitare il pericolo che chi ridistribuisce un Programma libero ottenga brevetti personali, rendendo perci\\'98 il Programma una cosa di sua propriet\\'88. Per prevenire questo, abbiamo chiarito che ogni prodotto brevettato debba essere distribuito per il libero uso da parte di chiunque, o non distribuito affatto.\\\nSeguono i termini e le condizioni precisi per la copia, la distribuzione e la modifica.\\\n\\pard\\pardeftab708\\sb240\\sa60\\qj\n\n\\f1\\i\\b\\fs24 \\cf0 Licenza pubblica generica GNU. Termini e condizioni per la copia, la distribuzione e la modifica\\\n\\pard\\pardeftab708\\sb240\\qj\n\n\\f2\\i0\\b0\\fs20 \\cf0 0. Questa Licenza si applica a ogni Programma o altra opera che contenga una nota da parte del detentore del copyright che dica che tale opera pu\\'98 distribuita sotto i termini di questa Licenza Pubblica Generica. Il termine \"Programma\" nel seguito indica ognuno di questi programmi o lavori, e l'espressione \"lavoro basato sul Programma\" indica sia il Programma sia ogni opera considerata \"derivata\" in base alla legge sul Copyright: cio\\'8f un lavoro contenente il programma o una porzione di esso, sia letteralmente sia modificato e/o tradotto in un'altra lingua; da qui in avanti, la traduzione \\'8f in ogni caso considerata una \"modifica\". Vengono ora elencati i diritti dei detentori di licenza.\\\nAttivit\\'88 diverse dalla copiatura, distribuzione e modifica non sono coperte da questa Licenza e sono al di fuori della sua influenza. L'atto di eseguire il programma non viene limitato, e l'output del programma \\'8f coperto da questa Licenza solo se il suo contenuto costituisce un lavoro basato sul Programma (indipendentemente dal fatto che sia stato creato eseguendo il Programma). In base alla natura del Programma il suo output pu\\'98 essere o meno coperto da questa Licenza.\\\n1. \\'e9 lecito copiare e distribuire copie letterali del codice sorgente del Programma cosi` come viene ricevuto, con qualsiasi mezzo, a condizione che venga riprodotta chiaramente su ogni copia una appropriata nota di copyright e di assenza di garanzia; che si mantengano intatti tutti i riferimenti a questa Licenza e all'assenza di ogni garanzia; che si dia a ogni altro destinatario del Programma una copia di questa Licenza insieme al Programma.\\\n\\'e9 possibile richiedere un pagamento per il trasferimento fisico di una copia del Programma, \\'8f anche possibile a propria discrezione richiedere un pagamento in cambio di una copertura assicurativa.\\\n2. \\'e9 lecito modificare la propria copia o copie del Programma, o parte di esso, creando perci\\'98 un lavoro basato sul Programma, e copiare o distribuire queste modifiche e questi lavori sotto i termini del precedente punto 1, a patto che anche tutte queste condizioni vengano soddisfatte:\\\na) Bisogna indicare chiaramente nei file che si tratta di  copie modificate e la data di ogni modifica.\\\nb) Bisogna fare in modo che ogni lavoro distribuito o  pubblicato, che in parte o nella sua totalit\\'88 derivi dal  Programma o da parti di esso, sia globalmente utilizzabile da  terze parti secondo le condizioni di questa licenza.\\\nc) Se di solito il programma modificato legge comandi  interattivamente quando eseguito, bisogna fare in modo che  all'inizio dell'esecuzione interattiva usuale, stampi un  messaggio contenente una appropriata nota di copyright e di  assenza di garanzia (oppure che specifichi il tipo di garanzia  che si offre). Il messaggio deve inoltre specificare agli  utenti che possono ridistribuire il programma nelle condizioni  qui descritte e deve indicare come reperire questa licenza.  Se per\\'98 il programma di partenza \\'8f interattivo ma  normalmente non stampa tale messaggio, non occorre che un  lavoro derivato lo stampi.\\\nQuesti requisiti si applicano al lavoro modificato nel suo complesso. Se sussistono parti identificabili del lavoro modificato che non siano derivate dal Programma e che possono essere ragionevolmente considerate lavori indipendenti, allora questa Licenza e i suoi termini non si applicano a queste parti quando vengono distribuite separatamente. Se per\\'98 queste parti vengono distribuite all'interno di un prodotto che \\'8f un lavoro basato sul Programma, la distribuzione di questo prodotto nel suo complesso deve avvenire nei termini di questa Licenza, le cui norme nei confronti di altri utenti si estendono a tutto il prodotto, e quindi ad ogni sua parte, chiunque ne sia l'autore.\\\nSia chiaro che non \\'8f nelle intenzioni di questa sezione accampare diritti su lavori scritti interamente da altri, l'intento \\'8f piuttosto quello di esercitare il diritto di controllare la distribuzione di lavori derivati o dal Programma o contenenti esso.\\\nInoltre, se il Programma o un lavoro derivato da esso viene aggregato ad un altro lavoro non derivato dal Programma su di un mezzo di immagazzinamento o di distribuzione, il lavoro non derivato non deve essere coperto da questa licenza.\\\n3. \\'e9 lecito copiare e distribuire il Programma (o un lavoro basato su di esso, come espresso al punto 2) sotto forma di codice oggetto o eseguibile sotto i termini dei precedenti punti 1 e 2, a patto che si applichi una delle seguenti condizioni:\\\na) Il Programma sia corredato dal codice sorgente completo, in  una forma leggibile dal calcolatore e tale sorgente deve  essere fornito secondo le regole dei precedenti punti 1 e 2 su  di un mezzo comunemente usato per lo scambio di programmi.\\\nb) Il Programma sia accompagnato da un'offerta scritta, valida  per almeno tre anni, di fornire a chiunque ne faccia richiesta  una copia completa del codice sorgente, in una forma leggibile  dal calcolatore, in cambio di un compenso non superiore al  costo del trasferimento fisico di tale copia, che deve essere  fornita secondo le regole dei precedenti punti 1 e 2 su di un  mezzo comunemente usato per lo scambio di programmi.\\\nc) Il Programma sia accompagnato dalle informazioni che sono  state ricevute riguardo alla possibilit\\'88 di avere il codice  sorgente. Questa alternativa \\'8f permessa solo in caso di  distribuzioni non commerciali e solo se il programma \\'8f stato  ricevuto sotto forma di codice oggetto o eseguibile in accordo  al precedente punto B.\\\nPer \"codice sorgente completo\" di un lavoro si intende la forma preferenziale usata per modificare un lavoro. Per un programma eseguibile, \"codice sorgente completo\" significa tutto il codice sorgente di tutti i moduli in esso contenuti, pi\\'9d ogni file associato che definisca le interfacce esterne del programma, pi\\'9d gli script usati per controllare la compilazione e l'installazione dell'eseguibile. In ogni caso non \\'8f necessario che il codice sorgente fornito includa nulla che sia normalmente distribuito (in forma sorgente o in formato binario) con i principali componenti del sistema operativo sotto cui viene eseguito il Programma (compilatore, kernel, e cosi` via), a meno che tali componenti accompagnino l'eseguibile.\\\nSe la distribuzione dell'eseguibile o del codice oggetto \\'8f effettuata indicando un luogo dal quale sia possibile copiarlo, permettere la copia del codice sorgente dallo stesso luogo \\'8f considerata una valida forma di distribuzione del codice sorgente, anche se copiare il sorgente \\'8f facoltativo per l'acquirente.\\\n4. Non \\'8f lecito copiare, modificare, sublicenziare, o distribuire il Programma in modi diversi da quelli espressamente previsti da questa Licenza. Ogni tentativo di copiare, modificare, sublicenziare o distribuire il Programma non \\'8f autorizzato, e far\\'88 terminare automaticamente i diritti garantiti da questa Licenza. D'altra parte ogni acquirente che abbia ricevuto copie, o diritti, coperti da questa Licenza da parte di persone che violano la Licenza come qui indicato non vedranno invalidare la loro Licenza, purch\\'8e si comportino conformemente ad essa.\\\n5. L'acquirente non \\'8f obbligato ad accettare questa Licenza, poich\\'8e non l'ha firmata. D'altra parte nessun altro documento garantisce il permesso di modificare o distribuire il Programma o i lavori derivati da esso. Queste azioni sono proibite dalla legge per chi non accetta questa Licenza; perci\\'98, modificando o distribuendo il Programma o un lavoro basato sul programma, si indica nel fare ci\\'98 l'accettazione di questa Licenza e quindi di tutti i suoi termini e le condizioni poste sulla copia, la distribuzione e la modifica del Programma o di lavori basati su di esso.\\\n6. Ogni volta che il Programma o un lavoro basato su di esso vengono distribuiti, l'acquirente riceve automaticamente una licenza d'uso da parte del licenziatario originale. Tale licenza regola la copia, la distribuzione e la modifica del Programma secondo questi termini e queste condizioni. Non \\'8f lecito imporre restrizioni ulteriori all'acquirente nel suo esercizio dei diritti qui garantiti. Chi distribuisce programmi coperti da questa Licenza non e' comunque responsabile per la conformit\\'88 alla Licenza da parte di terze parti.\\\n7. Se, come conseguenza del giudizio di una corte, o di una imputazione per la violazione di un brevetto o per ogni altra ragione (anche non relativa a questioni di brevetti), vengono imposte condizioni che contraddicono le condizioni di questa licenza, che queste condizioni siano dettate dalla corte, da accordi tra le parti o altro, queste condizioni non esimono nessuno dall'osservazione di questa Licenza. Se non \\'8f possibile distribuire un prodotto in un modo che soddisfi simultaneamente gli obblighi dettati da questa Licenza e altri obblighi pertinenti, il prodotto non pu\\'98 essere affatto distribuito. Per esempio, se un brevetto non permettesse a tutti quelli che lo ricevono di ridistribuire il Programma senza obbligare al pagamento di diritti, allora l'unico modo per soddisfare contemporaneamente il brevetto e questa Licenza e' di non distribuire affatto il Programma.\\\nSe parti di questo punto sono ritenute non valide o inapplicabili per qualsiasi circostanza, deve comunque essere applicata l'idea espressa da questo punto; in ogni altra circostanza invece deve essere applicato il punto 7 nel suo complesso.\\\nNon \\'8f nello scopo di questo punto indurre gli utenti ad infrangere alcun brevetto n\\'8f ogni altra rivendicazione di diritti di propriet\\'88, n\\'8f di contestare la validit\\'88 di alcuna di queste rivendicazioni; lo scopo di questo punto \\'8f solo quello di proteggere l'integrit\\'88 del sistema di distribuzione dei programmi liberi, che viene realizzato tramite l'uso della licenza pubblica. Molte persone hanno contribuito generosamente alla vasta gamma di programmi distribuiti attraverso questo sistema, basandosi sull'applicazione fedele di tale sistema. L'autore/donatore pu\\'98 decidere di sua volont\\'88 se preferisce distribuire il software avvalendosi di altri sistemi, e l'acquirente non pu\\'98 imporre la scelta del sistema di distribuzione.\\\nQuesto punto serve a rendere il pi\\'9d chiaro possibile ci\\'98 che crediamo sia una conseguenza del resto di questa Licenza.\\\n8. Se in alcuni paesi la distribuzione e/o l'uso del Programma sono limitati da brevetto o dall'uso di interfacce coperte da copyright, il detentore del copyright originale che pone il Programma sotto questa Licenza pu\\'98 aggiungere limiti geografici espliciti alla distribuzione, per escludere questi paesi dalla distribuzione stessa, in modo che il programma possa essere distribuito solo nei paesi non esclusi da questa regola. In questo caso i limiti geografici sono inclusi in questa Licenza e ne fanno parte a tutti gli effetti.\\\n9. All'occorrenza la Free Software Foundation pu\\'98 pubblicare revisioni o nuove versioni di questa Licenza Pubblica Generica. Tali nuove versioni saranno simili a questa nello spirito, ma potranno differire nei dettagli al fine di coprire nuovi problemi e nuove situazioni.\\\nAd ogni versione viene dato un numero identificativo. Se il Programma asserisce di essere coperto da una particolare versione di questa Licenza e \"da ogni versione successiva\", l'acquirente pu\\'98 scegliere se seguire le condizioni della versione specificata o di una successiva. Se il Programma non specifica quale versione di questa Licenza deve applicarsi, l'acquirente pu\\'98 scegliere una qualsiasi versione tra quelle pubblicate dalla Free Software Foundation.\\\n10. Se si desidera incorporare parti del Programma in altri programmi liberi le cui condizioni di distribuzione differiscano da queste, \\'8f possibile scrivere all'autore del Programma per chiederne l'autorizzazione. Per il software il cui copyright \\'8f detenuto dalla Free Software Foundation, si scriva alla Free Software Foundation; talvolta facciamo eccezioni alle regole di questa Licenza. La nostra decisione sar\\'88 guidata da due scopi: preservare la libert\\'88 di tutti i prodotti derivati dal nostro free software e promuovere la condivisione e il riutilizzo del software in generale.\\\nNON C'\\'e9 GARANZIA\\\n11. POICH\\'83 IL PROGRAMMA \\'e9 CONCESSO IN USO GRATUITAMENTE, NON C'\\'e9 GARANZIA PER IL PROGRAMMA, NEI LIMITI PERMESSI DALLE VIGENTI LEGGI. SE NON INDICATO DIVERSAMENTE PER ISCRITTO, IL DETENTORE DEL COPYRIGHT E LE ALTRE PARTI FORNISCONO IL PROGRAMMA \"COSI` COM'\\'e9\", SENZA ALCUN TIPO DI GARANZIA, N\\'e9 ESPLICITA N\\'e9 IMPLICITA; CI\\'f1 COMPRENDE, SENZA LIMITARSI A QUESTO, LA GARANZIA IMPLICITA DI COMMERCIABILIT\\'cb E UTILIZZABILIT\\'cb PER UN PARTICOLARE SCOPO. L'INTERO RISCHIO CONCERNENTE LA QUALIT\\'cb E LE PRESTAZIONI DEL PROGRAMMA \\'e9 DELL'ACQUIRENTE. SE IL PROGRAMMA DOVESSE RIVELARSI DIFETTOSO, L'ACQUIRENTE SI ASSUME IL COSTO DI OGNI MANUTENZIONE, RIPARAZIONE O CORREZIONE NECESSARIA.\\\n12. N\\'e9 IL DETENTORE DEL COPYRIGHT N\\'e9 ALTRE PARTI CHE POSSONO MODIFICARE O RIDISTRIBUIRE IL PROGRAMMA COME PERMESSO IN QUESTA LICENZA SONO RESPONSABILI PER DANNI NEI CONFRONTI DELL'ACQUIRENTE, A MENO CHE QUESTO NON SIA RICHIESTO DALLE LEGGI VIGENTI O APPAIA IN UN ACCORDO SCRITTO. SONO INCLUSI DANNI GENERICI, SPECIALI O INCIDENTALI, COME PURE I DANNI CHE CONSEGUONO DALL'USO O DALL'IMPOSSIBILIT\\'cb DI USARE IL PROGRAMMA; CI\\'f1 COMPRENDE, SENZA LIMITARSI A QUESTO, LA PERDITA DI DATI, LA CORRUZIONE DEI DATI, LE PERDITE SOSTENUTE DALL'ACQUIRENTE O DA TERZE PARTI E L'INABILIT\\'cb DEL PROGRAMMA A LAVORARE INSIEME AD ALTRI PROGRAMMI, ANCHE SE IL DETENTORE O ALTRE PARTI SONO STATE AVVISATE DELLA POSSIBILIT\\'cb DI QUESTI DANNI.\\\nFINE DEI TERMINI E DELLE CONDIZIONI\n\\f0\\fs24 \\\n\\pard\\pardeftab708\\sb240\\sa60\\qj\n\n\\f3\\i\\b\\fs22 \\cf0 Appendice: come applicare questi termini ai nuovi programmi\\\n\\pard\\pardeftab708\\sb240\\qj\n\n\\f0\\i0\\b0 \\cf0 Se si sviluppa un nuovo programma e lo si vuole rendere della maggiore utilit\\'88 possibile per il pubblico, la cosa migliore da fare \\'8f rendere tale programma free software, cosicch\\'8e ciascuno possa ridistribuirlo e modificarlo sotto questi termini.\\\nPer fare questo, si inserisca nel programma la seguente nota. La cosa migliore da fare \\'8f mettere la nota all`inizio di ogni file sorgente, per chiarire nel modo pi\\'9d efficiente possibile l'assenza di garanzia; ogni file dovrebbe contenere almeno la nota di copyright e l'indicazione di dove trovare l'intera nota.\\\n\\pard\\pardeftab708\\li567\\sb240\\qj\n\\cf0 <una riga per dire in breve il nome del programma e cosa fa>  Copyright (C) 19aa <nome dell'autore>\\\nQuesto programma \\'8f free software; \\'8f lecito redistribuirlo e/o  modificarlo secondo i termini della Licenza Pubblica Generica GNU  come \\'8f pubblicata dalla Free Software Foundation; o la versione 2  della licenza o (a propria scelta) una versione successiva.\\\nQuesto programma \\'8f distribuito nella speranza che sia utile, ma  SENZA ALCUNA GARANZIA; senza neppure la garanzia implicita di  NEGOZIABILIT\\'cb o di APPLICABILIT\\'cb PER UN PARTICOLARE SCOPO. Si  veda la Licenza Pubblica Generica GNU per avere maggiori dettagli.\\\nOgnuno dovrebbe avere ricevuto una copia della Licenza Pubblica  Generica GNU insieme a questo programma; in caso contrario, si  scriva alla Free Software Foundation, Inc., 675 Mass Ave,  Cambridge, MA 02139, Stati Uniti.\\\n\\pard\\pardeftab708\\sb240\\qj\n\\cf0 Si aggiungano anche informazioni su come si pu\\'98 essere contattati tramite posta elettronica e cartacea.\\\nSe il programma \\'8f interattivo, si faccia in modo che stampi una breve nota simile a questa quando viene usato interattivamente:\\\n\\pard\\pardeftab708\\li567\\sb240\\qj\n\\cf0 Orcaloca versione 69, Copyright (C) 19aa <nome dell'autore>  Orcaloca non ha ALCUNA GARANZIA; per i dettagli si digiti `show g'.  Questo \\'8f free software, e ognuno \\'8f libero di ridistribuirlo sotto  certe condizioni; si digiti `show c' per dettagli.\\\n\\pard\\pardeftab708\\sb240\\qj\n\\cf0 Gli ipotetici comandi \"show g\" e \"show c\" mostreranno le parti appropriate della Licenza Pubblica Generica. Chiaramente, i comandi usati possono essere chiamati diversamente da \"show g\" e \"show c\" e possono anche essere selezionati con il mouse o attraverso un men\\'9d; in qualunque modo pertinente al programma.\\\nSe necessario, si dovrebbe anche far firmare al proprio datore di lavoro (se si lavora come programmatore) o alla propria scuola, se si \\'8f studente, una \"rinuncia al copyright\" per il programma. Ecco un esempio con nomi fittizi:\\\n\\pard\\pardeftab708\\li567\\sb240\\qj\n\\cf0 Yoyodinamica SPA rinuncia con questo documento ad ogni interesse al  copyright del programma `Orcaloca' (che svolge dei passi di  compilazione) scritto da Giovanni Smanettone.\\\n<firma di Primo Tizio>, 1 April 1999  Primo Tizio, Presidente\\\n\\pard\\pardeftab708\\sb240\\qj\n\\cf0 I programmi coperti da questa Licenza Pubblica Generica non possono essere incorporati all'interno di programmi proprietari. Se il proprio programma \\'8f una libreria di funzioni, pu\\'98 essere pi\\'9d utile permettere di collegare applicazioni proprietarie alla libreria. Se si ha questa intenzione consigliamo di usare la Licenza Generica Pubblica GNU per Librerie (LGPL) al posto di questa Licenza.}\n"
  },
  {
    "path": "Italian.lproj/Credits.rtf",
    "content": "{\\rtf1\\mac\\ansicpg10000\\cocoartf102\n{\\fonttbl\\f0\\fswiss\\fcharset77 Helvetica;\\f1\\froman\\fcharset77 Times-Roman;}\n{\\colortbl;\\red255\\green255\\blue255;\\red26\\green26\\blue255;}\n\\vieww7800\\viewh9340\\viewkind0\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0\\fs24 \\cf0 For information and help with OSXvnc:\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f1 \\cf0 \t\n\\f0 \\cf2 \\ul \\ulc2 http://www.redstonesoftware.com/osxvnc\n\\f1 \\cf0 \\ulnone \\\n\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0 \\cf0 Copyright \\'a9 2002-2005 Redstone Software\\\n\tJonathan Gillaspie\\\n\tDoug Simons\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f1 \\cf0 \t\n\\f0 \\cf2 \\ul osxvnc@redstonesoftware.com\n\\f1 \\cf0 \\ulnone \\\n\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0 \\cf0 Copyright \\'a9 2002 Mahmud Haque\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f1 \\cf0 \t\n\\f0 \\cf2 \\ul mahmud@bcm.tmc.edu\n\\f1 \\cf0 \\ulnone \\\n\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0 \\cf0 Copyright \\'a9 2001 Dan McGuirk\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f1 \\cf0 \t\n\\f0 \\cf2 \\ul mcguirk@incompleteness.net\n\\f1 \\cf0 \\ulnone \\\n\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0 \\cf0 GNU GPL:\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf2 \\ul       http://www.gnu.org/copyleft/gpl.html\\cf0 \\ulnone \\\n\\\nSpecial Thanks For Server Side Scaling goes to:\\\n\tNoriaki Yamazaki\\\n\tAdministrator of micro-VNC\\\n\tHitachi System & Service, Ltd.\\\n\t\\\nSpecial Thanks For Reverse Connections goes to:\\\n\tMark Lentczner\\\n\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 Zlib, ZlibHex and Tight encodings:\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 \tMahmud Haque\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 \\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 Other Contributions:\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f1 \\cf0 \t\n\\f0 David Johnson\n\\f1 \\\n\t\n\\f0 Steven Tamm\\\n\tMihai Parparita\\\n\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 French Localization:\\\n\tPascal Frey\\\n\\\nJapanese Localization:\\\n\tAaron Madlon-Kay\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 \\\nIcon Compliments of Martin Goneau  \\\n\t\\cf2 \\ul http://www.goneau.com\\cf0 \\ulnone \\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 \\\n----------------------------------------------------\\\n\\\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\\\n\\\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.\\\n\\\nYou should have received a copy of the GNU General Public License along with this program; if not, write to:\\\n\\\nFree Software Foundation, Inc.\\\n59 Temple Place - Suite 330\\\nBoston, MA  02111-1307\\\nUSA\\\n}\n"
  },
  {
    "path": "Italian.lproj/MainMenu.nib/classes.nib",
    "content": "{\n    IBClasses = (\n        {\n            ACTIONS = {\"\" = id; optionChanged = id; };\n            CLASS = FirstResponder;\n            LANGUAGE = ObjC;\n            SUPERCLASS = NSObject;\n        },\n        {\n            ACTIONS = {\n                changeDisplayName = id;\n                changeDisplayNumber = id;\n                changePassword = id;\n                changePort = id;\n                changeSharing = id;\n                connectHost = id;\n                installAsService = id;\n                loadUserDefaults = id;\n                openFile = id;\n                openGPL = id;\n                openLog = id;\n                openReleaseNotes = id;\n                optionChanged = id;\n                removeService = id;\n                saveUserDefaults = id;\n                startServer = id;\n                stopServer = id;\n            };\n            CLASS = VNCController;\n            LANGUAGE = ObjC;\n            OUTLETS = {\n                allowDimmingCheckbox = NSButton;\n                allowKeyboardLoading = NSButton;\n                allowPressModsForKeys = NSButton;\n                allowRendezvousCheckbox = NSButton;\n                allowScreenSaverCheckbox = NSButton;\n                allowSleepCheckbox = NSButton;\n                connectHost = NSTextField;\n                connectPort = NSTextField;\n                disableRemoteEventsCheckbox = NSButton;\n                disableStartupButton = NSButton;\n                displayNameField = NSTextField;\n                displayNumberField = NSPopUpButton;\n                dontDisconnectCheckbox = NSButton;\n                hostNamesField = NSTextField;\n                hostNamesLabel = NSTextField;\n                ipAddressesField = NSTextField;\n                ipAddressesLabel = NSTextField;\n                limitToLocalConnections = NSButton;\n                optionsTabView = NSTabView;\n                otherArguments = NSTextField;\n                passwordField = NSTextField;\n                portField = NSTextField;\n                protocolVersion = NSPopUpButton;\n                serverKeepAliveCheckbox = NSButton;\n                setStartupButton = NSButton;\n                sharingMatrix = NSMatrix;\n                startServerButton = NSButton;\n                startServerMenuItem = NSMenuItem;\n                startServerOnLaunchCheckbox = NSButton;\n                startupItemStatusMessageField = NSTextField;\n                statusMessageField = NSTextField;\n                stopServerButton = NSButton;\n                stopServerMenuItem = NSMenuItem;\n                swapMouseButtonsCheckbox = NSButton;\n                terminateOnFastUserSwitch = NSButton;\n                window = NSWindow;\n            };\n            SUPERCLASS = NSObject;\n        }\n    );\n    IBVersion = 1;\n}\n"
  },
  {
    "path": "Italian.lproj/MainMenu.nib/info.nib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>IBDocumentLocation</key>\n\t<string>1000 258 356 240 0 0 1440 878 </string>\n\t<key>IBEditorPositions</key>\n\t<dict>\n\t\t<key>29</key>\n\t\t<string>101 636 382 44 0 0 1024 746 </string>\n\t\t<key>404</key>\n\t\t<string>591 584 158 99 0 0 1440 878 </string>\n\t</dict>\n\t<key>IBFramework Version</key>\n\t<string>446.1</string>\n\t<key>IBOpenObjects</key>\n\t<array>\n\t\t<integer>404</integer>\n\t</array>\n\t<key>IBSystem Version</key>\n\t<string>8J2135a</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "Japanese.lproj/Credits.rtf",
    "content": "{\\rtf1\\mac\\ansicpg10000\\cocoartf102\n{\\fonttbl\\f0\\fswiss\\fcharset77 Helvetica;\\f1\\fnil\\fcharset78 HiraKakuPro-W3;\\f2\\froman\\fcharset77 Times-Roman;\n}\n{\\colortbl;\\red255\\green255\\blue255;\\red26\\green26\\blue255;\\red0\\green0\\blue255;}\n\\vieww9000\\viewh9000\\viewkind0\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0\\fs24 \\cf0 OSXvnc\n\\f1  \\'82\\'c9\\'8a\\'d6\\'82\\'b7\\'82\\'e9\\'8f\\'ee\\'95\\'f1\\'82\\'c6\\'83\\'77\\'83\\'8b\\'83\\'76\\'82\\'c9\\'82\\'c2\\'82\\'a2\\'82\\'c4\\'82\\'cd\\'82\\'b1\\'82\\'cc\\'83\\'54\\'83\\'43\\'83\\'67\\'82\\'f0\\'82\\'b2\\'97\\'97\\'89\\'ba\\'82\\'b3\\'82\\'a2\n\\f0  \\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f2 \\cf0 \t\n\\f0 \\cf2 \\ul \\ulc2 http://www.redstonesoftware.com/osxvnc\n\\f2 \\cf0 \\ulnone \\\n\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0 \\cf0 Copyright \\'a9 2002-2005 Redstone Software\\\n\tJonathan Gillaspie\\\n\tDoug Simons\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f2 \\cf0 \t\n\\f0 \\cf2 \\ul osxvnc@redstonesoftware.com\n\\f2 \\cf0 \\ulnone \\\n\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0 \\cf0 Copyright \\'a9 2002 Mahmud Haque\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f2 \\cf0 \t\n\\f0 \\cf2 \\ul mahmud@bcm.tmc.edu\n\\f2 \\cf0 \\ulnone \\\n\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0 \\cf0 Copyright \\'a9 2001 Dan McGuirk\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f2 \\cf0 \t\n\\f0 \\cf2 \\ul mcguirk@incompleteness.net\n\\f2 \\cf0 \\ulnone \\\n\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0 \\cf0 GNU\n\\f1 \\'88\\'ea\\'94\\'ca\\'8c\\'f6\\'8f\\'4f\\'97\\'98\\'97\\'70\\'8b\\'96\\'91\\'f8\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'81\\'46\n\\f0 \\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf2 \\ul       \\cf3 \\ul \\ulc3 http://www.gnu.org/licenses/gpl.ja.html\\cf0 \\ulnone \\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f2 \\cf0 \\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f0 \\cf0 Server Side Scaling\n\\f1 \\'82\\'c9\\'8a\\'d6\\'82\\'b5\\'82\\'c4\\'82\\'cc\\'8e\\'d3\\'8e\\'ab\\'81\\'46\n\\f0 \\\n\tNoriaki Yamazaki\\\n\tAdministrator of micro-VNC\\\n\tHitachi System & Service, Ltd.\\\n\t\\\nReverse Connections\n\\f1 \\'82\\'c9\\'8a\\'d6\\'82\\'b5\\'82\\'c4\\'82\\'cc\\'8e\\'d3\\'8e\\'ab\\'81\\'46\n\\f0 \\\n\tMark Lentczner\\\n\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 Zlib, ZlibHex and Tight encodings:\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 \tMahmud Haque\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 \\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f1 \\cf0 \\'91\\'bc\\'82\\'cc\\'8b\\'a6\\'97\\'cd\\'8e\\'d2\\'81\\'46\n\\f0 \\\n\n\\f2 \t\n\\f0 David Johnson\n\\f2 \\\n\t\n\\f0 Steven Tamm\\\n\tMihai Parparita\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 \\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f1 \\cf0 \\'95\\'a7\\'96\\'f3\\'81\\'46\\\n\t\n\\f0 Pascal Frey\n\\f1 \\\n\\'98\\'61\\'96\\'f3\\'81\\'46\\\n\t\n\\f0 Aaron Madlon-Kay\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 \\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\n\\f1 \\cf0 \\'83\\'41\\'83\\'43\\'83\\'52\\'83\\'93\\'81\\'46\n\\f0 Martin Goneau\\\n\t\\cf2 \\ul http://www.goneau.com\\\n\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 \\ulnone ----------------------------------------------------\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 \\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\ql\\qnatural\n\\cf0 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\\\n\\\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.\\\n\\\nYou should have received a copy of the GNU General Public License along with this program; if not, write to:\\\n\\\nFree Software Foundation, Inc.\\\n59 Temple Place - Suite 330\\\nBoston, MA  02111-1307\\\nUSA\\\n}\n"
  },
  {
    "path": "Japanese.lproj/MainMenu.nib/classes.nib",
    "content": "{\n    IBClasses = (\n        {\n            ACTIONS = {optionChanged = id; };\n            CLASS = FirstResponder;\n            LANGUAGE = ObjC;\n            SUPERCLASS = NSObject;\n        },\n        {\n            ACTIONS = {\n                changeDisplayName = id;\n                changeDisplayNumber = id;\n                changePassword = id;\n                changePort = id;\n                changeSharing = id;\n                connectHost = id;\n                installAsService = id;\n                loadUserDefaults = id;\n                openFile = id;\n                openGPL = id;\n                openLog = id;\n                openReleaseNotes = id;\n                optionChanged = id;\n                removeService = id;\n                saveUserDefaults = id;\n                startServer = id;\n                stopServer = id;\n            };\n            CLASS = VNCController;\n            LANGUAGE = ObjC;\n            OUTLETS = {\n                allowDimmingCheckbox = NSButton;\n                allowKeyboardLoading = NSButton;\n                allowPressModsForKeys = NSButton;\n                allowRendezvousCheckbox = NSButton;\n                allowScreenSaverCheckbox = NSButton;\n                allowSleepCheckbox = NSButton;\n                connectHost = NSTextField;\n                connectPort = NSTextField;\n                disableRemoteEventsCheckbox = NSButton;\n                disableStartupButton = NSButton;\n                displayNameField = NSTextField;\n                displayNumberField = NSPopUpButton;\n                dontDisconnectCheckbox = NSButton;\n                hostNamesField = NSTextField;\n                hostNamesLabel = NSTextField;\n                ipAddressesField = NSTextField;\n                ipAddressesLabel = NSTextField;\n                limitToLocalConnections = NSButton;\n                optionsTabView = NSTabView;\n                otherArguments = NSTextField;\n                passwordField = NSTextField;\n                portField = NSTextField;\n                protocolVersion = NSPopUpButton;\n                serverKeepAliveCheckbox = NSButton;\n                setStartupButton = NSButton;\n                sharingMatrix = NSMatrix;\n                startServerButton = NSButton;\n                startServerMenuItem = NSMenuItem;\n                startServerOnLaunchCheckbox = NSButton;\n                startupItemStatusMessageField = NSTextField;\n                statusMessageField = NSTextField;\n                stopServerButton = NSButton;\n                stopServerMenuItem = NSMenuItem;\n                swapMouseButtonsCheckbox = NSButton;\n                terminateOnFastUserSwitch = NSButton;\n                window = NSWindow;\n            };\n            SUPERCLASS = NSObject;\n        }\n    );\n    IBVersion = 1;\n}\n"
  },
  {
    "path": "Japanese.lproj/MainMenu.nib/info.nib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>IBDocumentLocation</key>\n\t<string>451 77 356 240 0 0 1024 746 </string>\n\t<key>IBEditorPositions</key>\n\t<dict>\n\t\t<key>29</key>\n\t\t<string>102 661 342 44 0 0 1024 746 </string>\n\t\t<key>404</key>\n\t\t<string>400 501 108 99 0 0 1024 746 </string>\n\t</dict>\n\t<key>IBFramework Version</key>\n\t<string>443.0</string>\n\t<key>IBOpenObjects</key>\n\t<array>\n\t\t<integer>29</integer>\n\t\t<integer>21</integer>\n\t</array>\n\t<key>IBSystem Version</key>\n\t<string>8H14</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n"
  },
  {
    "path": "NSAuthorization.h",
    "content": "//\n//  NSAuthorization.h\n//  OSXvnc\n//\n//  Created by Jonathan Gillaspie on Fri Dec 12 2003.\n//  Copyright (c) 2003 __MyCompanyName__. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\n#include <Security/Authorization.h>\n#include <Security/AuthorizationTags.h>\n\n@interface NSAuthorization : NSObject {\n    // Persistent AuthRef\n    AuthorizationRef myAuthorizationRef;\n}\n\n- (instancetype) init;\n- (BOOL) executeCommand:(NSString *) command withArgs: (NSArray *) argumentArray;\n- (BOOL) executeCommand:(NSString *) command withArgs: (NSArray *) argumentArray synchronous: (BOOL) sync;\n\n@end\n"
  },
  {
    "path": "NSAuthorization.m",
    "content": "//\n//  NSAuthorization.m\n//  OSXvnc\n//\n//  Created by Jonathan Gillaspie on Fri Dec 12 2003.\n//  Copyright (c) 2003 __MyCompanyName__. All rights reserved.\n//\n\n#import \"NSAuthorization.h\"\n\n#include \"unistd.h\"\n\n@implementation NSAuthorization\n\n- (instancetype) init {\n    AuthorizationFlags myFlags = kAuthorizationFlagDefaults |\n    kAuthorizationFlagInteractionAllowed |\n    kAuthorizationFlagPreAuthorize |\n    kAuthorizationFlagExtendRights;\n    OSStatus myStatus;\n    AuthorizationItem myItems = {kAuthorizationRightExecute, 0, NULL, 0};\n    AuthorizationRights myRights = {1, &myItems};\n\n    self = [super init];\n\n    myStatus = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, myFlags, &myAuthorizationRef);\n\n    // This will pre-authorize the authentication\n    if (myStatus == errAuthorizationSuccess)\n        myStatus = AuthorizationCopyRights(myAuthorizationRef, &myRights, NULL, myFlags, NULL);\n\n    if (myStatus != errAuthorizationSuccess) {\n        return nil;\n    }\n\n    return self;\n}\n\n- (BOOL) executeCommand:(NSString *) command withArgs: (NSArray *) argumentArray {\n    return [self executeCommand:(NSString *) command withArgs: (NSArray *) argumentArray synchronous:TRUE];\n}\n\n- (BOOL) executeCommand:(NSString *) command withArgs: (NSArray *) argumentArray synchronous: (BOOL) sync {\n    FILE *communicationStream = NULL;\n    int i;\n    OSStatus myStatus;\n    char outputString[1024];\n    time_t startTime = time(NULL);\n\n    char **copyArguments = malloc(sizeof(char *) * (argumentArray.count + 1));\n\n    for (i = 0; i < argumentArray.count; i++) {\n        copyArguments[i] = (char *)[argumentArray[i] UTF8String];\n    }\n    copyArguments[i] = NULL;\n\n    myStatus = AuthorizationExecuteWithPrivileges(myAuthorizationRef,\n                                                  command.UTF8String,\n                                                  kAuthorizationFlagDefaults,\n                                                  copyArguments,\n                                                  (sync ? &communicationStream : NULL)); // FILE HANDLE for I/O\n\n    if (myStatus==errAuthorizationSuccess && sync) {\n        while (!myStatus && !feof(communicationStream) && fgets(outputString, 1024, communicationStream) && time(NULL)-startTime<10) {\n            if (strlen(outputString) > 1)\n                NSLog(@\"NSAuthorization: %s\",outputString);\n        }\n        fclose(communicationStream);\n    }\n\n    free(copyArguments);\n\n    if (myStatus != errAuthorizationSuccess)\n        NSLog(@\"Error: Executing %@ with Authorization: %d\", command, (int)myStatus);\n\n    return (myStatus == errAuthorizationSuccess);\n}\n\n\n- (void) dealloc {\n    AuthorizationFree (myAuthorizationRef, kAuthorizationFlagDefaults);\n\n    [super dealloc];\n}\n\n@end\n"
  },
  {
    "path": "OSXvnc/OSXvnc",
    "content": "#!/bin/sh\n. /etc/rc.common\n\n#\n# OSXvnc\n#\n# The OSXvnc application will OVERWRITE this file if you ask it to Configure the Startup Item\n#\n\nVNCPATH=\"/Library/StartupItems/OSXvnc\"\nVNCARGS=\"-rfbport 5900 -rfbauth $VNCPATH/.osxvncauth -swapButtons -dontdisconnect\"\nVNCLOG=\"/Library/Logs/VineServer.log\"\n\n#\n# Modification Log:\n#\n# 3.0\n# Removed dash from ps -auxwww for 10.5 compatibility\n# Added VNCLOG path, set to /Library/Logs/VineServer.log\n#\n# 1.6\n# Added missing backslashes to the Awk command when stopping OSXvnc-keepalive\n#\n# 1.5\n# Switched VNCPath to /Library/StartupItems/OSXvnc by default, we now copy in the executable\n# Added -f option to log move so it won't hang when started up (when run as authenticated/non-root user)\n# Set the kill operations to use the -KILL flag, seems to help on 10.1.5\n#\n# 1.33\n# Added Resources directory with English.lproj for Localization lookup\n# Modified to handle 'restart' directive\n# Modified to make more better use of the awk command\n#\n# 1.31\n# Modified Startup parameters to work better on some systems\n# Modified so that OSXvnc can live in directories with spaces\n#\n# 1.3\n# Modified so that OSXvnc app can configure\n# Removed Usage\n#\n# 1.2\n# Fixed problem in stop section (missing space)\n# Fixed stop to also kill the server and keep alive\n# Now Uses $VNCPATH for other arguments\n#\n# 1.11\n# Added Usage Info\n# Added keepalive call\n#\n# 1.0/Initial\n# Initial Version, no # and no history\n#\n##\n\nif [ ${1:-noset} == \"stop\" ] || [ ${1:-noset} == \"restart\" ]; then\n    ConsoleMessage \"Stopping OSXvnc KeepAlive\"\n    OSXVNCPID=`/bin/ps auxww | /usr/bin/awk '/[O]SXvnc-keepalive/ {print $2}'`\n    if [ \"${OSXVNCPID:=\"\"}\" ]; then\n        kill -KILL $OSXVNCPID\n        sleep 1\n    fi\n    # make sure it's dead\n    OSXVNCPID=`/bin/ps auxww | /usr/bin/awk '/[O]SXvnc-keepalive/ {print $2}'`\n    if [ \"${OSXVNCPID:=\"\"}\" != \"\" ]; then\n        ConsoleMessage \"OSXvnc $1: problem stopping OSXvnc-keepalive\"\n        exit -1\n    fi\n\n    ConsoleMessage \"Stopping OSXvnc Server\"\n    OSXVNCPID=`/bin/ps auxww | /usr/bin/awk '/Library\\/StartupItems\\/OSXvnc\\/[O]SXvnc-server/ {print $2}'`\n    if [ \"${OSXVNCPID:=\"\"}\" ]; then\n        kill -KILL $OSXVNCPID\n        sleep 1\n    fi\n    # make sure it's dead\n    OSXVNCPID=`/bin/ps auxww | /usr/bin/awk '/Library\\/StartupItems\\/OSXvnc\\/[O]SXvnc-server/ {print $2}'`\n    if [ \"${OSXVNCPID:=\"\"}\" != \"\" ]; then\n        ConsoleMessage \"OSXvnc $1: problem stopping OSXvnc-server $OSXVNCPID\"\n        exit -1\n    fi\n    if [ ${1:-noset} = \"stop\" ]; then\n        exit 0\n    fi\nfi\n\n\nif [ -x \"$VNCPATH\" ]; then\n    ConsoleMessage \"Starting OSXvnc Server\"\n\n    if [ -e \"$VNCLOG\" ]; then\n        /bin/mv -f \"$VNCLOG\" \"$VNCLOG.1\"\n    fi\n\n    $0-keepalive \"$VNCPATH/OSXvnc-server\" $VNCARGS > $VNCLOG 2>&1 &\nelse\n    ConsoleMessage \"Unable to find OSXvnc\"\n    exit -1\nfi\n"
  },
  {
    "path": "OSXvnc/OSXvnc-keepalive",
    "content": "#!/bin/sh\n#\n# OSXvnc-keepalive\n#\n# This little script, as you might imagine, will relaunch OSXvnc-server\n# when a user logs out and the OS kills the process (because it's running an event loop)\n#\n# Modification Log:\n#\n# 2.2\n# Ignore external kills for the purpose of restart count\n#\n# 2.0  Adopted these contributions...\n#\n# 2006-06-07 Marvin Simkin\n# Try to capture a little more detail when it dies\n#\n# 1.71\n# For no documentable reason I can discern the server gets a 137 code when a user logs out\n#\n# 1.7\n# Only restart on items where the first bit is NOT set (less than 128)\n#\n# 1.5\n# Replace spurious ls -l entry with a much more appropriate pwd\n#\n# 1.4\n# Uses proper -lt and checks for less than 200 rather than more than 0 since process only return unsigned shorts\n#\n# 1.33\n# Modified so that keepalive only shuts down on unrecoverable errors\n#\n# 1.31\n# Modified so that OSXvnc can live in directories with spaces\n#\n# 1.11\n# Initial version\n\necho \"`date '+%Y-%m-%d %H:%M:%S'` $0: Starting\"\necho \"`date '+%Y-%m-%d %H:%M:%S'`        pwd: '`pwd`'\"\necho \"`date '+%Y-%m-%d %H:%M:%S'`         id: '`id`'\"\necho \"`date '+%Y-%m-%d %H:%M:%S'`   uname -a: '`uname -a`'\"\necho \"`date '+%Y-%m-%d %H:%M:%S'`     uptime: '`uptime`'\"\n\nRESULT=15\n# OS X will send a SIGINT or SIGTERM to shutdown OSXvnc-server\n# On a high SIGNAL (over 128) we'll stop properly (this is what the server returns internally when an error occurs)\n## this seems to be stopping needlessly when it could recover\n##while [[ \"$RESULT\" -lt \"128\" ]]\nSTOPNOW=0\nwhile [[ \"$STOPNOW\" -lt \"1\" ]]\ndo\n\techo \"`date '+%Y-%m-%d %H:%M:%S'` $0: Starting Server '$1'\"\n\t\"$@\" # Run our parameters\n\tRESULT=$? # Record Result\n\techo \"`date '+%Y-%m-%d %H:%M:%S'` Server exited with result: $RESULT\"\n\techo \"`date '+%Y-%m-%d %H:%M:%S'` Server exited with result: $RESULT\" >> /var/log/osxvnc_exit.log\n\t\n\t# signal code 137 = 9 + 128 corresponds to SIGKILL (kill signal from term)\n\t# this signal is sent when a user logs out\n\t# don't treat recurrence of this code as an error; let the server restart!\n\tif [ \"$RESULT\" -ne \"137\" -o \"$RESULT\" -ne \"134\" ]\n\tthen\n        # check for same problem recurring frequently\n        COUNT=`cut -f1,7 -d' ' < /var/log/osxvnc_exit.log |\n          uniq -c |\n          tail -1 |\n          sed \"s/^  *//\" |\n          cut -f1 -d' '`\n\n        # set the repeated failures limit here\n        if test $COUNT -gt 4\n        then\n          echo \"`date '+%Y-%m-%d %H:%M:%S'` The same error '$RESULT' happened $COUNT times in a row, not restarting!\"\n          echo \"`date '+%Y-%m-%d %H:%M:%S'` The same error '$RESULT' happened $COUNT times in a row, not restarting!\" >> /var/log/osxvnc_exit.log\n          STOPNOW=1\n        fi\n\tfi\n\tsleep 5\ndone\n\necho \"`date '+%Y-%m-%d %H:%M:%S'` $0: Shutdown with exit status \" $RESULT\n"
  },
  {
    "path": "OSXvnc/Resources/English.lproj/Localizable.strings",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist SYSTEM \"file://localhost/System/Library/DTDs/PropertyList.dtd\">\n<plist version=\"0.9\">\n<dict>\n\t<key>Restarting OSXvnc server</key>\n\t<string>Restarting OSXvnc server</string>\n\t<key>Starting OSXvnc server</key>\n\t<string>Starting OSXvnc server</string>\n\t<key>Stopping OSXvnc server</key>\n\t<string>Stopping OSXvnc server</string>\n</dict>\n</plist>\n\n\n"
  },
  {
    "path": "OSXvnc/StartupParameters.plist",
    "content": "{\n  Description     = \"VNC Server\";\n  Provides        = (\"VNC\");\n  Requires        = (\"Resolver\");\n  Uses\t\t\t  = (\"Core Graphics\");\n  OrderPreference = \"None\";\n  Messages =  {\n\trestart = \"Restarting OSXvnc server\";\n\tstart = \"Starting OSXvnc server\";\n\tstop = \"Stopping OSXvnc server\";\n  };\n}"
  },
  {
    "path": "OSXvnc-server/CGS.h",
    "content": "/*\n *  CGS.h\n *  OSXvnc\n *\n *  Created by Mihai Parparita on Sat Jun 15 2002.\n *  Copyright (c) 2002 Mihai Parparita. All rights reserved.\n *\n */\n\n#pragma once\n\n#include <Carbon/Carbon.h>\n\ntypedef int CGSConnectionRef;\n\nextern CGError CGSNewConnection(void* unknown, CGSConnectionRef* newConnection);\nextern CGError CGSReleaseConnection(CGSConnectionRef connection);\n\nextern CGError CGSGetGlobalCursorDataSize(CGSConnectionRef connection, int* size);\nextern CGError CGSGetGlobalCursorData(CGSConnectionRef connection,\n                                      unsigned char* cursorData,\n                                      int* size,\n                                      int* bytesPerRow,\n                                      CGRect* cursorRect,\n                                      CGPoint* hotspot,\n                                      int* depth,\n                                      int* components,\n                                      int* bitsPerComponent);\n\nextern CGError CGSGetCurrentCursorLocation(CGSConnectionRef connection, CGPoint* point);\nextern int CGSCurrentCursorSeed(void);\nextern int CGSHardwareCursorActive(void); // flaky? doesn't seem to work after DM is initialized\n\n#ifndef SAVECOLORS\n#define SAVECOLORS\\\n\tRGBColor\t\toldForeColor, oldBackColor;\\\n\tPenState\t\toldState;\\\n\tGetForeColor(&oldForeColor);\\\n\tGetBackColor(&oldBackColor);\\\n\tGetPenState(&oldState);\\\n\tForeColor(blackColor);\\\n\tBackColor(whiteColor);\n#endif\n\n#ifndef RESTORECOLORS\n#define RESTORECOLORS\\\n\tSetPenState(&oldState);\\\n\tRGBForeColor(&oldForeColor);\\\n\tRGBBackColor(&oldBackColor);\n#endif\n"
  },
  {
    "path": "OSXvnc-server/COPYING",
    "content": "\t\t    GNU GENERAL PUBLIC LICENSE\n\t\t       Version 2, June 1991\n\n Copyright (C) 1989, 1991 Free Software Foundation, Inc.\n                          59 Temple Place - Suite 330, Boston, MA\n                          02111-1307, USA.\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n\t\t\t    Preamble\n\n  The licenses for most software are designed to take away your\nfreedom to share and change it.  By contrast, the GNU General Public\nLicense is intended to guarantee your freedom to share and change free\nsoftware--to make sure the software is free for all its users.  This\nGeneral Public License applies to most of the Free Software\nFoundation's software and to any other program whose authors commit to\nusing it.  (Some other Free Software Foundation software is covered by\nthe GNU Library General Public License instead.)  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthis service if you wish), that you receive source code or can get it\nif you want it, that you can change the software or use pieces of it\nin new free programs; and that you know you can do these things.\n\n  To protect your rights, we need to make restrictions that forbid\nanyone to deny you these rights or to ask you to surrender the rights.\nThese restrictions translate to certain responsibilities for you if you\ndistribute copies of the software, or if you modify it.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must give the recipients all the rights that\nyou have.  You must make sure that they, too, receive or can get the\nsource code.  And you must show them these terms so they know their\nrights.\n\n  We protect your rights with two steps: (1) copyright the software, and\n(2) offer you this license which gives you legal permission to copy,\ndistribute and/or modify the software.\n\n  Also, for each author's protection and ours, we want to make certain\nthat everyone understands that there is no warranty for this free\nsoftware.  If the software is modified by someone else and passed on, we\nwant its recipients to know that what they have is not the original, so\nthat any problems introduced by others will not reflect on the original\nauthors' reputations.\n\n  Finally, any free program is threatened constantly by software\npatents.  We wish to avoid the danger that redistributors of a free\nprogram will individually obtain patent licenses, in effect making the\nprogram proprietary.  To prevent this, we have made it clear that any\npatent must be licensed for everyone's free use or not licensed at all.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\f\n\t\t    GNU GENERAL PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. This License applies to any program or other work which contains\na notice placed by the copyright holder saying it may be distributed\nunder the terms of this General Public License.  The \"Program\", below,\nrefers to any such program or work, and a \"work based on the Program\"\nmeans either the Program or any derivative work under copyright law:\nthat is to say, a work containing the Program or a portion of it,\neither verbatim or with modifications and/or translated into another\nlanguage.  (Hereinafter, translation is included without limitation in\nthe term \"modification\".)  Each licensee is addressed as \"you\".\n\nActivities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope.  The act of\nrunning the Program is not restricted, and the output from the Program\nis covered only if its contents constitute a work based on the\nProgram (independent of having been made by running the Program).\nWhether that is true depends on what the Program does.\n\n  1. You may copy and distribute verbatim copies of the Program's\nsource code as you receive it, in any medium, provided that you\nconspicuously and appropriately publish on each copy an appropriate\ncopyright notice and disclaimer of warranty; keep intact all the\nnotices that refer to this License and to the absence of any warranty;\nand give any other recipients of the Program a copy of this License\nalong with the Program.\n\nYou may charge a fee for the physical act of transferring a copy, and\nyou may at your option offer warranty protection in exchange for a fee.\n\n  2. You may modify your copy or copies of the Program or any portion\nof it, thus forming a work based on the Program, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n    a) You must cause the modified files to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    b) You must cause any work that you distribute or publish, that in\n    whole or in part contains or is derived from the Program or any\n    part thereof, to be licensed as a whole at no charge to all third\n    parties under the terms of this License.\n\n    c) If the modified program normally reads commands interactively\n    when run, you must cause it, when started running for such\n    interactive use in the most ordinary way, to print or display an\n    announcement including an appropriate copyright notice and a\n    notice that there is no warranty (or else, saying that you provide\n    a warranty) and that users may redistribute the program under\n    these conditions, and telling the user how to view a copy of this\n    License.  (Exception: if the Program itself is interactive but\n    does not normally print such an announcement, your work based on\n    the Program is not required to print an announcement.)\n\f\nThese requirements apply to the modified work as a whole.  If\nidentifiable sections of that work are not derived from the Program,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works.  But when you\ndistribute the same sections as part of a whole which is a work based\non the Program, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote it.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Program.\n\nIn addition, mere aggregation of another work not based on the Program\nwith the Program (or with a work based on the Program) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n  3. You may copy and distribute the Program (or a work based on it,\nunder Section 2) in object code or executable form under the terms of\nSections 1 and 2 above provided that you also do one of the following:\n\n    a) Accompany it with the complete corresponding machine-readable\n    source code, which must be distributed under the terms of Sections\n    1 and 2 above on a medium customarily used for software interchange; or,\n\n    b) Accompany it with a written offer, valid for at least three\n    years, to give any third party, for a charge no more than your\n    cost of physically performing source distribution, a complete\n    machine-readable copy of the corresponding source code, to be\n    distributed under the terms of Sections 1 and 2 above on a medium\n    customarily used for software interchange; or,\n\n    c) Accompany it with the information you received as to the offer\n    to distribute corresponding source code.  (This alternative is\n    allowed only for noncommercial distribution and only if you\n    received the program in object code or executable form with such\n    an offer, in accord with Subsection b above.)\n\nThe source code for a work means the preferred form of the work for\nmaking modifications to it.  For an executable work, complete source\ncode means all the source code for all modules it contains, plus any\nassociated interface definition files, plus the scripts used to\ncontrol compilation and installation of the executable.  However, as a\nspecial exception, the source code distributed need not include\nanything that is normally distributed (in either source or binary\nform) with the major components (compiler, kernel, and so on) of the\noperating system on which the executable runs, unless that component\nitself accompanies the executable.\n\nIf distribution of executable or object code is made by offering\naccess to copy from a designated place, then offering equivalent\naccess to copy the source code from the same place counts as\ndistribution of the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\f\n  4. You may not copy, modify, sublicense, or distribute the Program\nexcept as expressly provided under this License.  Any attempt\notherwise to copy, modify, sublicense or distribute the Program is\nvoid, and will automatically terminate your rights under this License.\nHowever, parties who have received copies, or rights, from you under\nthis License will not have their licenses terminated so long as such\nparties remain in full compliance.\n\n  5. You are not required to accept this License, since you have not\nsigned it.  However, nothing else grants you permission to modify or\ndistribute the Program or its derivative works.  These actions are\nprohibited by law if you do not accept this License.  Therefore, by\nmodifying or distributing the Program (or any work based on the\nProgram), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Program or works based on it.\n\n  6. Each time you redistribute the Program (or any work based on the\nProgram), the recipient automatically receives a license from the\noriginal licensor to copy, distribute or modify the Program subject to\nthese terms and conditions.  You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties to\nthis License.\n\n  7. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot\ndistribute so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you\nmay not distribute the Program at all.  For example, if a patent\nlicense would not permit royalty-free redistribution of the Program by\nall those who receive copies directly or indirectly through you, then\nthe only way you could satisfy both it and this License would be to\nrefrain entirely from distribution of the Program.\n\nIf any portion of this section is held invalid or unenforceable under\nany particular circumstance, the balance of the section is intended to\napply and the section as a whole is intended to apply in other\ncircumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system, which is\nimplemented by public license practices.  Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\f\n  8. If the distribution and/or use of the Program is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Program under this License\nmay add an explicit geographical distribution limitation excluding\nthose countries, so that distribution is permitted only in or among\ncountries not thus excluded.  In such case, this License incorporates\nthe limitation as if written in the body of this License.\n\n  9. The Free Software Foundation may publish revised and/or new versions\nof the General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\nEach version is given a distinguishing version number.  If the Program\nspecifies a version number of this License which applies to it and \"any\nlater version\", you have the option of following the terms and conditions\neither of that version or of any later version published by the Free\nSoftware Foundation.  If the Program does not specify a version number of\nthis License, you may choose any version ever published by the Free Software\nFoundation.\n\n  10. If you wish to incorporate parts of the Program into other free\nprograms whose distribution conditions are different, write to the author\nto ask for permission.  For software which is copyrighted by the Free\nSoftware Foundation, write to the Free Software Foundation; we sometimes\nmake exceptions for this.  Our decision will be guided by the two goals\nof preserving the free status of all derivatives of our free software and\nof promoting the sharing and reuse of software generally.\n\n\t\t\t    NO WARRANTY\n\n  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\nFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\nOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\nPROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\nOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\nTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\nPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\nREPAIR OR CORRECTION.\n\n  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\nREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\nINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\nOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\nTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\nYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\nPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGES.\n\n\t\t     END OF TERMS AND CONDITIONS\n\f\n\tAppendix: How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nconvey the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) 19yy  <name of author>\n\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program; if not, write to the Free Software\n    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n\nAlso add information on how to contact you by electronic and paper mail.\n\nIf the program is interactive, make it output a short notice like this\nwhen it starts in an interactive mode:\n\n    Gnomovision version 69, Copyright (C) 19yy name of author\n    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, the commands you use may\nbe called something other than `show w' and `show c'; they could even be\nmouse-clicks or menu items--whatever suits your program.\n\nYou should also get your employer (if you work as a programmer) or your\nschool, if any, to sign a \"copyright disclaimer\" for the program, if\nnecessary.  Here is a sample; alter the names:\n\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n  `Gnomovision' (which makes passes at compilers) written by James Hacker.\n\n  <signature of Ty Coon>, 1 April 1989\n  Ty Coon, President of Vice\n\nThis General Public License does not permit incorporating your program into\nproprietary programs.  If your program is a subroutine library, you may\nconsider it more useful to permit linking proprietary applications with the\nlibrary.  If this is what you want to do, use the GNU Library General\nPublic License instead of this License.\n"
  },
  {
    "path": "OSXvnc-server/Makefile",
    "content": "# Makefile for OSXvnc-server\n\nCC=cc\nCXX=cc\nCFLAGS=-O3 -Wall -Wextra -g\nCXXFLAGS=-O3 -Wall -Wextra -g\nINCLUDES=-Ilibvncauth -Iinclude -Iinclude/X11 -Iinclude/Xserver -I/opt/libjpeg-turbo/include\nVNCAUTHLIB=-Llibvncauth -lvncauth\nSUPPORTLIB=-lz -lturbojpeg\nRDRLIB=-Lrdr -lrdr\nEXTRALIBS=-lstdc++\n\nLIBS=$(VNCAUTHLIB) $(SUPPORTLIB) $(RDRLIB) $(EXTRALIBS) -framework Carbon -framework IOKit -framework Cocoa\n\nSOURCES=main.c rfbserver.c miregion.c kbdptr.c auth.c sockets.c xalloc.c \\\n\tstats.c corre.c hextile.c rre.c translate.c cutpaste.c dimming.c \\\n\ttight.c zlib.c zlibhex.c mousecursor.c zrle.cc\nOBJS=main.o rfbserver.o miregion.o kbdptr.o auth.o sockets.o xalloc.o \\\n\tstats.o corre.o hextile.o rre.o translate.o cutpaste.o dimming.o \\\n\ttight.o zlib.o zlibhex.o mousecursor.o zrle.o VNCServer.o\n\nall: OSXvnc-server storepasswd\n\ninstall:\n\n.m.o:\n\t$(CC) $(CFLAGS) $(INCLUDES) -c $<\n\n.c.o:\n\t$(CC) $(CFLAGS) $(INCLUDES) -c $<\n\n.cc.o:\n\t$(CXX) $(CXXFLAGS) $(INCLUDES) -c $<\n\nOSXvnc-server: $(OBJS) libvncauth/libvncauth.a libjpeg/libjpeg.a rdr/librdr.a\n\t$(CC) -o OSXvnc-server $(OBJS) $(LIBS)\n\nstorepasswd: storepasswd.o libvncauth/libvncauth.a\n\t$(CC) -o storepasswd storepasswd.o $(VNCAUTHLIB)\n\nlibvncauth/libvncauth.a:\n\t(cd libvncauth && make)\n\nlibjpeg/libjpeg.a:\n\t(cd libjpeg; make libjpeg.a)\n\nrdr/librdr.a:\n\t(cd rdr; make librdr.a)\n\nclean:\n\trm -f $(OBJS) *~ core \"#\"* *.bak *.orig *.o\n\t(cd libvncauth && make clean)\n\t(cd libjpeg && make clean)\n\t(cd rdr && make clean)\n\nrealclean: clean\n\trm -f OSXvnc-server storepasswd .depend\n\ndepend:\n\tcc -M $(INCLUDES) $(SOURCES) > .depend\n\n.depend:\n\tcc -M $(INCLUDES) $(SOURCES) > .depend\n\ninclude .depend\n"
  },
  {
    "path": "OSXvnc-server/VNCServer.h",
    "content": "//\n//  VNCServer.h\n//  OSXvnc\n//\n//  Created by Jonathan Gillaspie on Mon Nov 17 2003.\n//  Copyright (c) 2003 __MyCompanyName__. All rights reserved.\n//\n\n// This object is around to receive NSNotfication events, it can then dispatch them into the regular C code\n\n#import <Foundation/Foundation.h>\n#import <Carbon/Carbon.h>\n\n#import \"rfb.h\"\n#import \"rfbserver.h\"\n#import <X11/keysym.h>\n#import \"kbdptr.h\"\n\n\n@interface VNCServer : NSObject {\n\tNSNetService *rfbService;\n\tNSNetService *vncService;\n\tBOOL keyboardLoading;\n\n\tTISInputSourceRef loadedKeyboardRef;\n\tBOOL useIP6;\n\tBOOL listenerFinished;\n\n\trfbserver *theServer;\n\n\tBOOL readyToStartup;\n\tBOOL dynamicKeyboard;\n    // This flag will try to change the modifier key state to the required set for the unicode key that came in\n    BOOL pressModsForKeys;\n\tCGEventSourceRef vncSourceRef;\n\tCGEventTapLocation vncTapLocation;\n\n\tTISInputSourceRef unicodeInputSource;\n\tTISInputSourceRef currentInputSource;\n\n\t// Current Modifiers reflect the \"global\" state of the modifier keys (not a particular VNC connection)\n\t// This only matters for event taps.  Ideally we could detect their values but\n\t// that seems to require an active event loop.\n\tCGEventFlags currentModifiers;\n\n    CGKeyCode keyTable[keyTableSize];\n    unsigned char keyTableMods[keyTableSize]; // 8 Bits for Modifier Keys\n\n    // The Keycodes to various modifiers on the current keyboard\n    CGKeyCode keyCodeShift;\n    CGKeyCode keyCodeOption;\n    CGKeyCode keyCodeControl;\n    CGKeyCode keyCodeCommand;\n\n    NSInteger modifierDelay;\n}\n\n+ sharedServer;\n\n- (void) loadKeyboard: (TISInputSourceRef) keyboardLayoutRef;\n- (void) registerRendezvous;\n\n- (void) setupIPv6: argument;\n\n\n- (void) rfbStartup: (rfbserver *) aServer;\n- (void) rfbUsage;\n- (void) rfbRunning;\n\n- (void) rfbConnect;\n- (void) rfbDisconnect;\n\n- (void) rfbPoll;\n- (void) rfbReceivedClientMessage;\n- (void) rfbShutdown;\n\n- (void) systemServerShouldQuit: (NSNotification *) aNotification;\n- (void) systemServerShouldContinue: (NSNotification *) aNotification;\n\n- (void) loadUnicodeKeyboard;\n\n- (void) handleMouseButtons:(int) buttonMask atPoint:(NSPoint) aPoint forClient: (rfbClientPtr) cl;\n- (void) handleKeyboard:(Bool) down forSym: (KeySym) keySym forClient: (rfbClientPtr) cl;\n- (void) releaseModifiersForClient: (rfbClientPtr) cl;\n\n- (void) setKeyModifiers: (CGEventFlags) modifierFlags;\n- (BOOL) checkModiferState;\n- (void) sendKeyEvent: (CGKeyCode) keyCode down: (BOOL) down modifiers: (CGEventFlags) modifiersToSend;\n\n- (void) userSwitched: (NSNotification *) aNotification;\n- (void) clientConnected: (NSNotification *) aNotification;\n- (void) connectHost: (NSNotification *) aNotification;\n\n\n@end\n\n@interface RendezvousDelegate : NSObject <NSNetServiceDelegate> {\n}\n\n@end\n"
  },
  {
    "path": "OSXvnc-server/VNCServer.m",
    "content": "//\n//  VNCServer.m\n//  OSXvnc\n//\n//  Created by Jonathan Gillaspie on Mon Nov 17 2003.\n//  Copyright (c) 2003 Redstone Software, Inc. All rights reserved.\n//\n\n#import \"VNCServer.h\"\n\n#import \"rfb.h\"\n#import \"keysymdef.h\"\n#import \"kbdptr.h\"\n#import \"rfbserver.h\"\n\n\n#import <ApplicationServices/ApplicationServices.h>\n#import <Cocoa/Cocoa.h>\n#import <Carbon/Carbon.h>\n//#import <Security/AuthSession.h>\n\n\n#include <sys/stat.h>\n#include <sys/types.h>\n#include <sys/socket.h>\n#include <netinet/in.h>\n#include <fcntl.h>\n#include <pthread.h>\n#include <unistd.h>\n#include <signal.h>\n\n\n\n@implementation VNCServer\n\nstatic VNCServer *sharedServer = nil;\n// These correspond to the keycodes of the keys 0-9,A-F\nstatic int unicodeNumbersToKeyCodes[16] = { 29, 18, 19, 20, 21, 23, 22, 26, 28, 25, 0, 11, 8, 2, 14, 3 };\n\n+ sharedServer {\n    if (!sharedServer) {\n        sharedServer = [[self alloc] init];\n    }\n    return sharedServer;\n}\n\n\n- init {\n    self = [super init];\n\n    if (self) {\n        keyboardLoading = FALSE;\n\n        useIP6 = TRUE;\n        listenerFinished = FALSE;\n\n        readyToStartup = TRUE;\n        dynamicKeyboard = FALSE;\n\n        [self loadKeyTable];\n    }\n    return self;\n}\n\n- (void) loadKeyTable {\n    unsigned int i;\n\n    // Initialize them all to 0xFFFF\n    for (i = 0; i < keyTableSize; i++) {\n        keyTable[i] = 0xFFFF;\n        keyTableMods[i] = 0;\n    }\n\n    // This is the old US only keyboard mapping\n    // Map the above key table into a static array so we can just look them up directly\n    // NSLog(@\"Unable To determine key map - Reverting to US mapping\");\n    for (i = 0; i < (sizeof(USKeyCodes) / sizeof(int)); i += 2)\n        keyTable[(unsigned short)USKeyCodes[i]] = (CGKeyCode) USKeyCodes[i+1];\n\n    // This is the old SpecialKeyCodes keyboard mapping\n    // Map the above key table into a static array so we can just look them up directly\n    // NSLog(@\"Loading %d XKeysym special keys\", (sizeof(SpecialKeyCodes) / sizeof(int)));\n    for (i = 0; i < (sizeof(SpecialKeyCodes) / sizeof(int)); i += 2)\n        keyTable[(unsigned short)SpecialKeyCodes[i]] = (CGKeyCode) SpecialKeyCodes[i+1];\n\n\n    if (1) {\n        // Find the right keycodes base on the loaded keyboard\n        keyCodeShift = keyTable[XK_Shift_L];\n        keyCodeOption = keyTable[XK_Meta_L];\n        keyCodeControl = keyTable[XK_Control_L];\n        keyCodeCommand = keyTable[XK_Alt_L];\n    }\n\n\n}\n\n\n// Here are the resources we can think about using for Int'l keyboard support\n\n// http://developer.apple.com/documentation/Carbon/Reference/KeyboardLayoutServices/\n\n// This will let us determine the current keyboard\n// KLGetCurrentKeyboardLayout\n\n// This will set the current keyboard\n// KLSetCurrentKeyboardLayout\n\n// This will get the Properties of a keyboard (like the key code to char tables) but...\n// KLGetKeyboardLayoutProperty\n\n// UCKeyTranslate - This is the opposite of what we need, if you give it a table and some keyCode (key input) it will tell you what Unicode char (or string) you get\n// we need the opposite - we want to know what keys to hit to get a given key (or string)\n\n// This will use the KeyboardLayoutRef to produce a static table of lookups\n// By iterating through all possible KeyCodes\n- (void) loadKeyboard: (TISInputSourceRef) inputSource {\n    int i, j;\n    UCKeyboardLayout *uchrHandle = NULL;\n    CFStringRef keyboardName;\n    static const unsigned modifierKeyStates[] = {\n        0,\n        shiftKey,\n        optionKey,\n        controlKey,\n        optionKey | shiftKey,\n        optionKey | controlKey,\n        controlKey | shiftKey,\n        optionKey | shiftKey | controlKey\n    };\n    NSArray *keyStates = [[NSUserDefaults standardUserDefaults] arrayForKey:@\"KeyStates\"];\n\n    /* modifiers */\n    //cmdKey                        = 1 << cmdKeyBit,\n    //shiftKey                      = 1 << shiftKeyBit,\n    //alphaLock                     = 1 << alphaLockBit,\n    //optionKey                     = 1 << optionKeyBit,\n    //controlKey                    = 1 << controlKeyBit,\n\n    // KLGetKeyboardLayoutProperty is 10.2 only how do I access these resources in early versions?\n    if (inputSource) {\n        keyboardName = (CFStringRef) TISGetInputSourceProperty(inputSource, kTISPropertyLocalizedName);\n        NSLog(@\"Keyboard detected: %@ - loading keys\", keyboardName);\n        uchrHandle = (UCKeyboardLayout *) CFDataGetBytePtr(TISGetInputSourceProperty(inputSource, kTISPropertyUnicodeKeyLayoutData));\n    }\n\n    // Initialize them all to 0xFFFF\n    memset(keyTable, 0xFF, keyTableSize * sizeof(CGKeyCode));\n    memset(keyTableMods, 0xFF, keyTableSize * sizeof(unsigned char));\n\n    if (uchrHandle) {\n        // Ok - we could get the LIST of Modifier Key States out of the Keyboard Layout\n        // some of them are duplicates so we need to compare them, then we'll iterate through them in reverse order\n        // UCKeyModifiersToTableNum = ; EventRecord\n        // This layout gets a little harry\n\n        UInt16 keyCode;\n        UInt32 keyboardType = LMGetKbdType();\n        UniCharCount actualStringLength;\n        UniChar unicodeChar[255];\n\n        // Iterate Over Each Modifier Keyset\n        for (i = 0; i < (sizeof(modifierKeyStates) / sizeof(*modifierKeyStates)); i++) {\n            unsigned modifierKeyState = (modifierKeyStates[i] >> 8) & 0xFF;\n            //NSLog(@\"Loading Keys For Modifer State: %#04x\", modifierKeyState);\n            // Iterate Over Each Key Code\n            for (keyCode = 0; keyCode < 255; keyCode++) {\n                for (j=0; j < keyStates.count; j++) {\n                    int keyActionState = [keyStates[j] intValue];\n                    UInt32 deadKeyState = 0;\n                    OSStatus resultCode = UCKeyTranslate (uchrHandle,\n                                                          keyCode,\n                                                          keyActionState,\n                                                          modifierKeyState,\n                                                          keyboardType,\n                                                          kUCKeyTranslateNoDeadKeysBit,\n                                                          &deadKeyState,\n                                                          255, // Only 1 key allowed due to VNC behavior\n                                                          &actualStringLength,\n                                                          unicodeChar);\n\n                    if (resultCode == noErr) {\n                        if (actualStringLength > 1) {\n                            NSLog(@\"Multiple Characters For %d (%#04x): %S\",\n                                  keyCode, modifierKeyState, (const unichar *)unicodeChar);\n                            //unicodeChar[0] = unicodeChar[actualStringLength-1];\n                        }\n                        else {\n                            //~ NSLog(@\"Loaded %d (%04x)\", keyCode, modifierKeyState);\n                            // We'll use the FIRST keyCode that we find for that UNICODE character\n                            if (keyTable[unicodeChar[0]] == 0xFFFF) {\n                                keyTable[unicodeChar[0]] = keyCode;\n                                keyTableMods[unicodeChar[0]] = modifierKeyState;\n                            }\n                        }\n                    }\n                    else {\n                        NSLog(@\"Error Translating %d (%04x): %@ - %d\",\n                              keyCode, modifierKeyState,\n                              [NSError errorWithDomain:NSOSStatusErrorDomain code:resultCode userInfo:nil],\n                              (int)resultCode);\n                    }\n                }\n            }\n        }\n    }\n    else {\n        // This is the old US only keyboard mapping\n        // Map the above key table into a static array so we can just look them up directly\n        NSLog(@\"Unable To determine key map - reverting to US mapping\");\n        for (i = 0; i < (sizeof(USKeyCodes) / sizeof(int)); i += 2)\n            keyTable[(unsigned short)USKeyCodes[i]] = (CGKeyCode) USKeyCodes[i+1];\n    }\n\n    // This is the old SpecialKeyCodes keyboard mapping\n    // Map the above key table into a static array so we can just look them up directly\n    NSLog(@\"Loading %ld XKeysym special keys\", (sizeof(SpecialKeyCodes) / sizeof(int))/2);\n    for (i = 0; i < (sizeof(SpecialKeyCodes) / sizeof(int)); i += 2) {\n        keyTable[(unsigned short)SpecialKeyCodes[i]] = (CGKeyCode) SpecialKeyCodes[i+1];\n    }\n\n    keyCodeShift = keyTable[XK_Shift_L];\n    keyCodeOption = keyTable[XK_Meta_L];\n    keyCodeControl = keyTable[XK_Control_L];\n    keyCodeCommand = keyTable[XK_Alt_L];\n}\n\nvoid SyncSetKeyboardLayout (TISInputSourceRef inputSource) {\n    // http://developer.apple.com/library/mac/#documentation/TextFonts/Reference/TextInputSourcesReference/Reference/reference.html\n    if (TISSelectInputSource(inputSource) != noErr) {\n        NSLog(@\"Error selecting input source:\");\n    }\n}\n\nstatic bool isConsoleSession(void) {\n    BOOL returnValue = FALSE;\n    CFDictionaryRef sessionInfoDict = CGSessionCopyCurrentDictionary();\n\n    if (sessionInfoDict == NULL)\n        NSLog(@\"Unable to get session dictionary.\");\n    else {\n        CFBooleanRef userIsActive = CFDictionaryGetValue(sessionInfoDict, kCGSessionOnConsoleKey);\n        returnValue = CFBooleanGetValue(userIsActive);\n        CFRelease(sessionInfoDict);\n    }\n\n    //    if (0) {\n    //        // This one succeeds in \"off-screen acounts\" also\n    //        SecuritySessionId mySession;\n    //        SessionAttributeBits sessionInfo;\n    //        OSStatus error = SessionGetInfo(callerSecuritySession, &mySession, &sessionInfo);\n    //\n    //        returnValue = (sessionInfo & sessionHasGraphicAccess);\n    //    }\n    //    else if (0) {\n    //        // There must be a better way but for now this seems to indicate if we are a console session or not\n    //        // at least for logged in users -- it always returns NO for the login window\n    //        CGEventSourceRef testRef = CGEventSourceCreate(kCGEventSourceStatePrivate);\n    //        int pollDelay = 0; // No poll at this time, just look once\n    //\n    //        while (!testRef && pollDelay) {\n    //            usleep(100000);\n    //            pollDelay -= 100000;\n    //            testRef = CGEventSourceCreate(kCGEventSourceStatePrivate);\n    //        }\n    //\n    //        if (testRef != NULL) {\n    //            returnValue = TRUE;\n    //            CFRelease(testRef);\n    //        }\n    //    }\n\n    return returnValue;\n}\n\n- (void) rfbStartup: (rfbserver *) aServer {\n    [[NSUserDefaults standardUserDefaults] registerDefaults:@{@\"UnicodeKeyboard\": @\"NO\", // Load The Unicode Keyboard\n                                                             @\"DynamicKeyboard\": @\"NO\", // Try to set the keyboard \"as we need it\", doesn't work well on Tiger\n                                                             @\"UnicodeKeyboardIdentifier\": @\"-1\", // ID of the Unicode Keyboard resource to use (-1 is Apple's)\n\n                                                             @\"EventSource\": @\"2\", // Always private event source so we don't consolidate with existing keys (however HID for the EventTap always does anyhow)\n                                                             @\"EventTap\": @\"3\", // Default Event Tap (3=HID for Console User and Session For OffScreen Users)\n                                                             @\"ModifierDelay\": @\"5000\", // Delay when shifting modifier keys\n                                                             @\"SystemServer\": @\"NO\",\n                                                             @\"keyboardLoading\": @\"NO\", // allows OSXvnc to look at the users selected keyboard and map keystrokes using it\n                                                             @\"pressModsForKeys\": @\"YES\", // If OSXvnc finds the key you want it will temporarily toggle the modifier keys to produce it\n                                                             @\"KeyStates\": @[@(kUCKeyActionAutoKey)]}];\n\n    theServer = aServer;\n\n    // System Server special behavior\n    if ([[NSUserDefaults standardUserDefaults] boolForKey:@\"SystemServer\"]) {\n        // We need quit if the user switches out (so we can relinquish the port)\n        if (isConsoleSession()) {\n            [[NSWorkspace sharedWorkspace].notificationCenter addObserver:self\n                                                                   selector:@selector(systemServerShouldQuit:)\n                                                                       name: NSWorkspaceSessionDidResignActiveNotification\n                                                                     object:nil];\n        }\n        // We need to be able to \"hold\" if we aren't the console session\n        else {\n            [[NSWorkspace sharedWorkspace].notificationCenter addObserver:self\n                                                                   selector:@selector(systemServerShouldContinue:)\n                                                                       name: NSWorkspaceSessionDidBecomeActiveNotification\n                                                                     object:nil];\n            readyToStartup = NO;\n            // Run Loop\n            NSLog(@\"System Server for non-console session, pausing until we receive console access\");\n            while (!readyToStartup) {\n                OSStatus resultCode = RunCurrentEventLoop(kEventDurationSecond); //EventTimeout\n                if (resultCode != eventLoopTimedOutErr) {\n                    NSLog(@\"Received Result: %d during event loop, Shutting Down\", (int)resultCode);\n                    //rfbShutdown();\n                    exit(0);\n                }\n            }\n        }\n    }\n\n    modifierDelay = [[NSUserDefaults standardUserDefaults] integerForKey:@\"ModifierDelay\"];\n\n    keyboardLoading = [[NSUserDefaults standardUserDefaults] boolForKey:@\"keyboardLoading\"];\n    if (keyboardLoading) {\n        NSLog(@\"Keyboard Loading - Enabled\");\n\n        pressModsForKeys = [[NSUserDefaults standardUserDefaults] boolForKey:@\"pressModsForKeys\"];\n        if (pressModsForKeys)\n            NSLog(@\"Press Modifiers For Keys - Enabled\");\n        else\n            NSLog(@\"Press Modifiers For Keys - Disabled\");\n\n\n        loadedKeyboardRef = TISCopyCurrentKeyboardLayoutInputSource();\n        if (loadedKeyboardRef)\n            [self loadKeyboard:loadedKeyboardRef];\n        else\n            NSLog(@\"Error unable to load current keyboard layout\");\n    }\n\n    if ([[NSProcessInfo processInfo].arguments indexOfObject:@\"-ipv4\"] != NSNotFound) {\n        useIP6 = FALSE;\n    }\n\n    [self loadUnicodeKeyboard];\n}\n\n- (void) systemServerShouldQuit: (NSNotification *) aNotification {\n    NSLog(@\"User Switched Out, Stopping System Server - %@\", aNotification.name);\n    //rfbShutdown();\n    exit(0);\n    return;\n}\n- (void) systemServerShouldContinue: (NSNotification *) aNotification {\n    NSLog(@\"User Switched In, Starting System Server - %@\", aNotification.name);\n    readyToStartup = YES;\n    return;\n}\n\n- (void) rfbRunning {\n    [self registerRendezvous];\n\n    if (useIP6) {\n        [NSThread detachNewThreadSelector:@selector(setupIPv6:) toTarget:self withObject:nil];\n        // Wait for the IP6 to bind, if it binds later it confuses the IPv4 binding into allowing others on the port\n        while (!listenerFinished)\n            usleep(1000);\n    }\n\n    if ([[NSUserDefaults standardUserDefaults] boolForKey:@\"DynamicKeyboard\"])\n        dynamicKeyboard = TRUE;\n\n    // Event Source represents which existing event states should be combined with the incoming events\n    switch ([[NSUserDefaults standardUserDefaults] integerForKey:@\"EventSource\"]) {\n        case 2:\n            // Doesn't combine with any other sources\n            NSLog(@\"Using Private Event Source\");\n            vncSourceRef = CGEventSourceCreate(kCGEventSourceStatePrivate);\n            break;\n        case 1:\n            // Combines only with other User Session Events\n            NSLog(@\"Using Combined Event Source, WARNING: Doesn't work if we FUS off-screen (10.5.1)\");\n            vncSourceRef = CGEventSourceCreate(kCGEventSourceStateCombinedSessionState);\n            break;\n        case 0:\n            // Combines with Physical Keyboard\n            NSLog(@\"Using HID Event Source, WARNING: Doesn't allow keys if we FUS off-screen (10.5.7)\");\n            vncSourceRef = CGEventSourceCreate(kCGEventSourceStateHIDSystemState);\n            break;\n        case 3: // I am pretty sure works similar to the HID\n        default:\n            vncSourceRef = NULL;\n            break;\n    }\n    if (!vncSourceRef)\n        NSLog(@\"No Event Source -- Using 10.3 API\");\n\n    // Event Taps represent at what level of the input manager the events will be interpretted\n    switch ([[NSUserDefaults standardUserDefaults] integerForKey:@\"EventTap\"]) {\n        case 3: {\n            if (isConsoleSession()) {\n                NSLog(@\"Using Smart Event Tap -- HID for console user\");\n                vncTapLocation = kCGHIDEventTap;\n            }\n            else {\n                NSLog(@\"Using Smart Event Tap -- Session for off-screen user\");\n                vncTapLocation = kCGSessionEventTap;\n            }\n\n            [[NSWorkspace sharedWorkspace].notificationCenter addObserver:self\n                                                                   selector:@selector(userSwitchedIn:)\n                                                                       name: NSWorkspaceSessionDidBecomeActiveNotification\n                                                                     object:nil];\n            [[NSWorkspace sharedWorkspace].notificationCenter addObserver:self\n                                                                   selector:@selector(userSwitchedOut:)\n                                                                       name: NSWorkspaceSessionDidResignActiveNotification\n                                                                     object:nil];\n            break;\n        }\n        case 2:\n            NSLog(@\"Using Annotated Session Event Tap\");\n            vncTapLocation = kCGAnnotatedSessionEventTap;\n            break;\n        case 1:\n            // At this level will can passed in modifiers\n            // it will ignore physical keyboard state\n            // it will NOT impact physical keyboard state\n            NSLog(@\"Using Session Event Tap\");\n            vncTapLocation = kCGSessionEventTap;\n            break;\n        case 0:\n        default:\n            // At this level will ignore passed in modifiers\n            // it will combine with the physical keyboard state (CapsLock, etc)\n            // it WILL impact physical keyboard state\n            NSLog(@\"Using HID Event Tap\");\n            vncTapLocation = kCGHIDEventTap;\n            break;\n    }\n}\n\n- (void) loadUnicodeKeyboard {\n    if ([[NSUserDefaults standardUserDefaults] boolForKey:@\"UnicodeKeyboard\"] && unicodeInputSource == NULL) {\n        // Need to figure out a way to lookup the Unicode Keyboard before this will work\n\n        // OSStatus result = KLGetKeyboardLayoutWithIdentifier([[NSUserDefaults standardUserDefaults] integerForKey:@\"UnicodeKeyboardIdentifier\"], &unicodeLayout);\n        //  *    Use TISCreateInputSourceList API to create a list of input\n        //        *    sources that match specified properties, such as the\n        //*    kTISPropertyInputSourceID property.\n\n        // Unicode Keyboard Should load keys from definition\n        pressModsForKeys = YES;\n        [self loadKeyboard:unicodeInputSource];\n    }\n}\n\n\n- (void) userSwitchedIn: (NSNotification *) aNotification {\n    NSLog(@\"User Switched In, Using HID Tap - %@\", aNotification.name);\n    vncTapLocation = kCGHIDEventTap;\n    return;\n}\n- (void) userSwitchedOut: (NSNotification *) aNotification {\n    NSLog(@\"User Switched Out, Using Session Tap - %@\", aNotification.name);\n    vncTapLocation = kCGSessionEventTap;\n    return;\n}\n\n- (void) rfbConnect {\n    if (unicodeInputSource != NULL && !dynamicKeyboard) {\n        currentInputSource = TISCopyCurrentKeyboardInputSource();\n        // Switch to Unicode Keyboard\n        SyncSetKeyboardLayout(unicodeInputSource);\n    }\n}\n\n- (void) rfbDisconnect {\n    if (unicodeInputSource != NULL && !dynamicKeyboard) {\n        // Switch to Old Keyboard\n        SyncSetKeyboardLayout(currentInputSource);\n    }\n}\n\n- (void) rfbUsage {\n    printf(\n            \"-keyboardLoading flag  This feature allows OSXvnc to look at the users selected keyboard\\n\"\n            \"                       and map keystrokes using it. Disabling this returns OSXvnc to\\n\"\n            \"                       standard (U.S. Keyboard) which will work better with dead keys.\\n\"\n            \"                       (default: no)\\n\"\n            \"-pressModsForKeys flag If OSXvnc finds the key you want it will temporarily toggle the modifier keys to produce it.\\n\"\n            \"                       This flag works well if you have different keyboards on the local and remote machines.\\n\"\n            \"                       Only works if -keyboardLoading is on.\\n\"\n            \"                       (default: yes)\\n\"\n            \"-bonjour flag          Allow OSXvnc to advertise VNC server using Bonjour discovery services.\\n\"\n            \"                       'VNC' will enable the service named VNC (For Eggplant & Chicken 2.02b).\\n\"\n            \"                       'Both' or '2' will enable the services named RFB and VNC.\\n\"\n            \"                       (default: RFB:YES VNC:NO)\\n\"\n            \"-ipv4                  Listen for connections on IPv4 only (default: off)\\n\"\n            \"-ipv6                  Listen for connections on IPv6 only (default: off)\\n\"\n    );\n}\n\n- (void) rfbPoll {\n    // Check if keyboardLayoutRef has changed\n    if (keyboardLoading) {\n        TISInputSourceRef currentKeyboardLayoutRef = TISCopyCurrentKeyboardLayoutInputSource();\n\n        if (currentKeyboardLayoutRef != loadedKeyboardRef) {\n            loadedKeyboardRef = currentKeyboardLayoutRef;\n            [self loadKeyboard: loadedKeyboardRef];\n        }\n    }\n\n#if 0\n    if (0 && vncTapLocation == kCGHIDEventTap) {\n        CGEventFlags newModifiers = 0;\n\n        if (CGEventSourceKeyState(kCGEventSourceStateHIDSystemState,keyCodeShift))\n            newModifiers |= kCGEventFlagMaskShift;\n        if (CGEventSourceKeyState(kCGEventSourceStateHIDSystemState,keyCodeOption))\n            newModifiers |= kCGEventFlagMaskAlternate;\n        if (CGEventSourceKeyState(kCGEventSourceStateHIDSystemState,keyCodeControl))\n            newModifiers |= kCGEventFlagMaskControl;\n        if (CGEventSourceKeyState(kCGEventSourceStateHIDSystemState,keyCodeCommand))\n            newModifiers |= kCGEventFlagMaskControl;\n\n        currentModifiers = newModifiers;\n    }\n#endif\n\n    return;\n}\n\n- (void) rfbShutdown {\n    [rfbService stop];\n    [vncService stop];\n}\n\n// Mouse handling code\n\n- (void) handleMouseButtons:(int) buttonMask atPoint:(NSPoint) aPoint forClient: (rfbClientPtr) cl {\n    rfbUndim();\n\n    if (buttonMask & rfbWheelMask) {\n        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];\n        NSUserDefaults *currentUserDefs = [[NSUserDefaults alloc] initWithUser:NSUserName()];\n        int mouseWheelDistance;\n\n        // I would rather cache this data than look it up each time but I don't know how to get notification of a change\n        // A - User changes his setting in SysPrefs\n        // B - Running OSXvnc as root and user swiches\n\n        mouseWheelDistance = 8 * [currentUserDefs floatForKey:@\"com.apple.scrollwheel.scaling\"];\n        [currentUserDefs dealloc];\n        if (!mouseWheelDistance)\n            mouseWheelDistance = 10;\n\n        if (buttonMask & rfbWheelUpMask) {\n            CGEventRef scrollEvent = CGEventCreateScrollWheelEvent(NULL, kCGScrollEventUnitPixel,  1,  mouseWheelDistance);\n            CGEventPost(vncTapLocation, scrollEvent);\n            CFRelease(scrollEvent);\n        }\n\n        if (buttonMask & rfbWheelDownMask) {\n            CGEventRef scrollEvent = CGEventCreateScrollWheelEvent(NULL, kCGScrollEventUnitPixel,  1, -mouseWheelDistance);\n            CGEventPost(vncTapLocation, scrollEvent);\n            CFRelease(scrollEvent);\n        }\n\n        [pool release];\n    }\n    else {\n        cl->clientCursorLocation.x = aPoint.x;\n        cl->clientCursorLocation.y = aPoint.y;\n\n        // Tricky here -- new events need to specify up, down and dragged, not just button state.\n        //CGEventCreateMouseEvent(NULL, NX_OMOUSEDRAGGED, CGPointMake(x,y), kCGMouseButtonCenter)\n\n        if (cl->swapMouseButtons23)\n            CGPostMouseEvent(cl->clientCursorLocation, TRUE, 3,\n                             (buttonMask & rfbButton1Mask) ? TRUE : FALSE,\n                             (buttonMask & rfbButton3Mask) ? TRUE : FALSE,\n                             (buttonMask & rfbButton2Mask) ? TRUE : FALSE);\n        else\n            CGPostMouseEvent(cl->clientCursorLocation, TRUE, 3,\n                             (buttonMask & rfbButton1Mask) ? TRUE : FALSE,\n                             (buttonMask & rfbButton2Mask) ? TRUE : FALSE,\n                             (buttonMask & rfbButton3Mask) ? TRUE : FALSE);\n    }\n}\n\n// Keyboard handling code\n- (void) handleKeyboard:(Bool) down forSym: (KeySym) keySym forClient: (rfbClientPtr) cl {\n    CGKeyCode keyCode = keyTable[(unsigned short)keySym];\n    CGEventFlags modifiersToSend = 0;\n\n    rfbUndim();\n\n    // If we can't locate the keycode then we will use the special OPTION+4 HEX coding that is available on the Unicode HexInput Keyboard\n    if (keyCode == 0xFFFF) {\n        if (down && unicodeInputSource != NULL) {\n            unsigned short mask=0xF000;\n            int rightShift;\n            CGEventFlags oldModifiers = currentModifiers;\n\n            // Switch to Unicode Keyboard\n            if (dynamicKeyboard) {\n                currentInputSource = TISCopyCurrentKeyboardInputSource();\n                SyncSetKeyboardLayout(unicodeInputSource);\n            }\n\n            modifiersToSend = kCGEventFlagMaskAlternate | kCGEventFlagMaskNonCoalesced;\n\n            [self setKeyModifiers: modifiersToSend];\n            for (rightShift = 12; rightShift >= 0; rightShift-=4) {\n                short unidigit = (keySym & mask) >> rightShift;\n\n                [self sendKeyEvent:unicodeNumbersToKeyCodes[unidigit] down:1 modifiers:modifiersToSend];\n                [self sendKeyEvent:unicodeNumbersToKeyCodes[unidigit] down:0 modifiers:modifiersToSend];\n\n                mask >>= 4;\n            }\n            [self setKeyModifiers: oldModifiers];\n\n            // Switch to Old Keyboard\n            if (dynamicKeyboard)\n                SyncSetKeyboardLayout(currentInputSource);\n        }\n    }\n    else {\n        BOOL isModifierKey = (XK_Shift_L <= keySym && keySym <= XK_Hyper_R);\n\n        if (isModifierKey) {\n            // Mark the key state for the client, we'll release down keys later\n            cl->modiferKeys[keyCode] = down;\n\n            // Record them in our \"currentModifiers\"\n            switch (keySym) {\n                case XK_Shift_L:\n                case XK_Shift_R:\n                    if (down)\n                        currentModifiers |= kCGEventFlagMaskShift;\n                    else\n                        currentModifiers &= ~kCGEventFlagMaskShift;\n                    break;\n                case XK_Control_L:\n                case XK_Control_R:\n                    if (down)\n                        currentModifiers |= kCGEventFlagMaskControl;\n                    else\n                        currentModifiers &= ~kCGEventFlagMaskControl;\n                    break;\n                case XK_Meta_L:\n                case XK_Meta_R:\n                    if (down)\n                        currentModifiers |= kCGEventFlagMaskAlternate;\n                    else\n                        currentModifiers &= ~kCGEventFlagMaskAlternate;\n                    break;\n                case XK_Alt_L:\n                case XK_Alt_R:\n                    if (down)\n                        currentModifiers |= kCGEventFlagMaskCommand;\n                    else\n                        currentModifiers &= ~kCGEventFlagMaskCommand;\n                    break;\n            }\n\n            [self sendKeyEvent:keyCode down:down modifiers:currentModifiers];\n        }\n        else {\n            if (pressModsForKeys) {\n                if (keyTableMods[keySym] != 0xFF) {\n                    // Setup the state of the appropriate keys based on the value in the KeyTableMods\n                    CGEventFlags oldModifiers = currentModifiers;\n                    CGEventFlags modifiersToSend = kCGEventFlagMaskNonCoalesced;\n\n                    if ((keyTableMods[keySym] << 8) & shiftKey)\n                        modifiersToSend |= kCGEventFlagMaskShift;\n                    if ((keyTableMods[keySym] << 8) & optionKey)\n                        modifiersToSend |= kCGEventFlagMaskAlternate;\n                    if ((keyTableMods[keySym] << 8) & controlKey)\n                        modifiersToSend |= kCGEventFlagMaskControl;\n\n                    // Treat command key separately (not as part of the generation string)\n                    modifiersToSend |= (currentModifiers & kCGEventFlagMaskCommand);\n\n                    [self setKeyModifiers: modifiersToSend];\n                    [self sendKeyEvent:keyCode down:down modifiers:modifiersToSend];\n                    // Back to current depressed state\n                    [self setKeyModifiers: oldModifiers];\n                }\n                else {\n                    // Not Modified (special keys, other modifiers)\n                    [self sendKeyEvent:keyCode down:down modifiers:currentModifiers];\n                }\n            }\n            else {\n                CGEventFlags oldModifiers = currentModifiers;\n                CGEventFlags modifiersToSend = kCGEventFlagMaskNonCoalesced |\n                (cl->modiferKeys[keyCodeShift] ? kCGEventFlagMaskShift : 0) |\n                (cl->modiferKeys[keyCodeControl] ? kCGEventFlagMaskControl : 0) |\n                (cl->modiferKeys[keyCodeOption] ? kCGEventFlagMaskAlternate : 0) |\n                (cl->modiferKeys[keyCodeCommand] ? kCGEventFlagMaskCommand : 0);\n\n                [self setKeyModifiers: modifiersToSend];\n                [self sendKeyEvent:keyCode down:down modifiers:modifiersToSend];\n                [self setKeyModifiers: oldModifiers];\n            }\n        }\n    }\n}\n\n- (void) releaseModifiersForClient: (rfbClientPtr) cl {\n    [self setKeyModifiers: 0];\n}\n\n\n- (void) setKeyModifiers: (CGEventFlags) modifierFlags {\n    // If it's a session tap (and we have an event source) then we can specify our own modifiers as part of the event (nothing to do here)\n    // Otherwise we will have to explicitly twiddle them at the HID level based on their current state\n    if (vncTapLocation == kCGHIDEventTap || !vncSourceRef) {\n        // Toggle the state of the appropriate keys\n        if ((currentModifiers & kCGEventFlagMaskCommand) != (modifierFlags & kCGEventFlagMaskCommand)) {\n            [self sendKeyEvent:keyCodeCommand down:((modifierFlags & kCGEventFlagMaskCommand) != 0) modifiers:0];\n        }\n        if ((currentModifiers & kCGEventFlagMaskShift) != (modifierFlags & kCGEventFlagMaskShift)) {\n            [self sendKeyEvent:keyCodeShift down:((modifierFlags & kCGEventFlagMaskShift) != 0) modifiers:0];\n        }\n        if ((currentModifiers & kCGEventFlagMaskAlternate) != (modifierFlags & kCGEventFlagMaskAlternate)) {\n            [self sendKeyEvent:keyCodeOption down:((modifierFlags & kCGEventFlagMaskAlternate) != 0) modifiers:0];\n        }\n        if ((currentModifiers & kCGEventFlagMaskControl) != (modifierFlags & kCGEventFlagMaskControl)) {\n            [self sendKeyEvent:keyCodeControl down:((modifierFlags & kCGEventFlagMaskControl) != 0) modifiers:0];\n        }\n\n        if (modifierDelay)\n            usleep(modifierDelay);\n    }\n    currentModifiers = modifierFlags;\n}\n\n- (BOOL) checkModiferState {\n    CGEventFlags actualFlags = CGEventSourceFlagsState(CGEventSourceGetSourceStateID(vncSourceRef));\n    BOOL match = YES;\n\n    if ((actualFlags & kCGEventFlagMaskCommand) != (currentModifiers & kCGEventFlagMaskCommand) ||\n        (actualFlags & kCGEventFlagMaskShift) != (currentModifiers & kCGEventFlagMaskShift) ||\n        (actualFlags & kCGEventFlagMaskAlternate) != (currentModifiers & kCGEventFlagMaskAlternate) ||\n        (actualFlags & kCGEventFlagMaskControl) != (currentModifiers & kCGEventFlagMaskControl)) {\n        match = NO;\n        //NSLog(@\"Actual(%0x) did not match Recorded (%0x)\", actualFlags & 0xffffffff, currentModifiers & 0xffffffff);\n    }\n    return match;\n}\n\n- (void) sendKeyEvent: (CGKeyCode) keyCode down: (BOOL) down modifiers: (CGEventFlags) modifiersToSend {\n    if (!vncSourceRef) {\n        CGEventRef event = CGEventCreateKeyboardEvent(NULL, keyCode, down);\n        CGEventPost(vncTapLocation, event);\n        //CGPostKeyboardEvent(0, keyCode, down);\n        CFRelease(event);\n    }\n    else {\n        CGEventRef event = CGEventCreateKeyboardEvent(vncSourceRef, keyCode, down);\n\n        // The value of this function escapes me (since you still need to specify the keyCode for it to work\n        // CGEventKeyboardSetUnicodeString (event, 1, (const UniChar *) &keySym);\n\n        // If it's a session tap then we can specify our own modifiers as part of the event\n        if (vncTapLocation != kCGHIDEventTap)\n            CGEventSetFlags(event, modifiersToSend);\n\n        CGEventPost(vncTapLocation, event);\n\n        if (vncTapLocation == kCGHIDEventTap) {\n            int maxWait = 250000; // 1/4 second\n\n            // NEED TO WAIT UNTIL MODIFIER FLAGS REFLECT THE EXPECTED STATE\n            while ([self checkModiferState] == NO && maxWait > 0) {\n                maxWait -= 10000;\n                usleep(10000);\n            }\n        }\n\n        CFRelease(event);\n    }\n}\n\n- (void) setupIPv6: argument {\n    int listen_fd6=0, client_fd=0;\n    int value=1;  // Need to pass a ptr to this\n    struct sockaddr_in6 sin6, peer6;\n    unsigned int len6=sizeof(sin6);\n\n    bzero(&sin6, sizeof(sin6));\n    sin6.sin6_len = sizeof(sin6);\n    sin6.sin6_family = AF_INET6;\n    sin6.sin6_port = htons(theServer->rfbPort);\n    if (theServer->rfbLocalhostOnly)\n        sin6.sin6_addr = in6addr_loopback;\n    else\n        sin6.sin6_addr = in6addr_any;\n\n    if ((listen_fd6 = socket(PF_INET6, SOCK_STREAM, 0)) < 0) {\n        NSLog(@\"IPv6: Unable to open socket\");\n    }\n    /*\n     else if (fcntl(listen_fd6, F_SETFL, O_NONBLOCK) < 0) {\n     NSLog(@\"IPv6: fcntl O_NONBLOCK failed\");\n     }\n     */\n    else if (setsockopt(listen_fd6, IPPROTO_IPV6, IPV6_V6ONLY, &value, sizeof(value)) < 0) {\n        NSLog(@\"IPv6: setsockopt IPV6_V6ONLY failed\");\n    }\n    else if (setsockopt(listen_fd6, SOL_SOCKET, SO_REUSEADDR, &value, sizeof(value)) < 0) {\n        NSLog(@\"IPv6: setsockopt SO_REUSEADDR failed\");\n    }\n    else if (bind(listen_fd6, (struct sockaddr *) &sin6, len6) < 0) {\n        NSLog(@\"IPv6: Failed to Bind Socket: Port %d may be in use by another VNC\", theServer->rfbPort);\n    }\n    else if (listen(listen_fd6, 5) < 0) {\n        NSLog(@\"IPv6: Listen failed\");\n    }\n    else {\n        NSLog(@\"Started listener thread on IPv6 port %d\", theServer->rfbPort);\n        listenerFinished = TRUE;\n\n        while ((client_fd = accept(listen_fd6, (struct sockaddr *) &peer6, &len6)) !=-1) {\n            NSAutoreleasePool *pool=[[NSAutoreleasePool alloc] init];\n\n            [[NSNotificationCenter defaultCenter] postNotification:\n             [NSNotification notificationWithName:@\"NewRFBClient\" object:@(client_fd)]];\n\n            // We have to trigger a signal so the event loop will pickup (if no clients are connected)\n            pthread_cond_signal(&(theServer->listenerGotNewClient));\n\n            [pool release];\n        }\n\n        NSLog(@\"IPv6: Accept failed %d\", errno);\n    }\n    listenerFinished = TRUE;\n\n    return;\n}\n\n- (void) registerRendezvous {\n    NSAutoreleasePool *tempPool = [[NSAutoreleasePool alloc] init];\n    BOOL loadRendezvousVNC = NO;\n    BOOL loadRendezvousRFB = YES;\n    NSUInteger argumentIndex = [[NSProcessInfo processInfo].arguments indexOfObject:@\"-rendezvous\"];\n    RendezvousDelegate *rendezvousDelegate = [[RendezvousDelegate alloc] init];\n\n    if (argumentIndex == NSNotFound) {\n        argumentIndex = [[NSProcessInfo processInfo].arguments indexOfObject:@\"-bonjour\"];\n    }\n\n    if (argumentIndex != NSNotFound) {\n        NSString *value = nil;\n\n        if ([NSProcessInfo processInfo].arguments.count > argumentIndex + 1)\n            value = [NSProcessInfo processInfo].arguments[argumentIndex+1];\n\n        if ([value hasPrefix:@\"n\"] || [value hasPrefix:@\"N\"] || [value hasPrefix:@\"0\"]) {\n            loadRendezvousVNC = NO; loadRendezvousRFB = NO;\n        }\n        else if ([value hasPrefix:@\"y\"] || [value hasPrefix:@\"Y\"] || [value hasPrefix:@\"1\"] || [value hasPrefix:@\"rfb\"]) {\n            loadRendezvousVNC = NO; loadRendezvousRFB = YES;\n        }\n        else if ([value hasPrefix:@\"b\"] || [value hasPrefix:@\"B\"] || [value hasPrefix:@\"2\"]) {\n            loadRendezvousVNC = YES; loadRendezvousRFB = YES;\n        }\n        else if ([value hasPrefix:@\"vnc\"]) {\n            loadRendezvousVNC = YES; loadRendezvousRFB = NO;\n        }\n    }\n\n    // Register For Rendezvous\n    if (loadRendezvousRFB) {\n        rfbService = [[NSNetService alloc] initWithDomain:@\"\"\n                                                     type:@\"_rfb._tcp.\"\n                                                     name:@(theServer->desktopName)\n                                                     port:(int) theServer->rfbPort];\n        rfbService.delegate = rendezvousDelegate;\n        [rfbService publish];\n    }\n    //    else\n    //        NSLog(@\"Bonjour (_rfb._tcp) - Disabled\");\n\n    if (loadRendezvousVNC) {\n        vncService = [[NSNetService alloc] initWithDomain:@\"\"\n                                                     type:@\"_vnc._tcp.\"\n                                                     name:@(theServer->desktopName)\n                                                     port:(int) theServer->rfbPort];\n        vncService.delegate = rendezvousDelegate;\n\n        [vncService publish];\n    }\n    //    else\n    //        NSLog(@\"Bonjour (_vnc._tcp) - Disabled\");\n\n    [tempPool release];\n}\n\n- (void) rfbReceivedClientMessage {\n    return;\n}\n\n- (void) userSwitched: (NSNotification *) aNotification {\n    NSLog(@\"User Switched Restarting - %@\", aNotification.name);\n\n    sleep(10);\n    rfbShutdown();\n\n    exit(2);\n}\n\n- (void) clientConnected: (NSNotification *) aNotification {\n    NSLog(@\"New IPv6 Client Notification - %@\", aNotification.name);\n    rfbStartClientWithFD([aNotification.object intValue]);\n}\n\n- (void) connectHost: (NSNotification *) aNotification {\n    NSAutoreleasePool *pool=[[NSAutoreleasePool alloc] init];\n\n    char *reverseHost = (char *)[aNotification.userInfo[@\"ConnectHost\"] UTF8String];\n    int reversePort = [aNotification.userInfo[@\"ConnectPort\"] intValue];\n\n    NSLog(@\"Connecting VNC Client %s(%d)\",reverseHost,reversePort);\n    connectReverseClient(reverseHost,reversePort);\n\n    [pool release];\n}\n\n@end\n\n\n\n\n@implementation RendezvousDelegate\n\n// Sent when the service is about to publish\n\n- (void)netServiceWillPublish:(NSNetService *)netService {\n    NSLog(@\"Registering Bonjour Service(%@) - %@\", netService.type, netService.name);\n}\n\n// Sent if publication fails\n- (void)netService:(NSNetService *)netService didNotPublish:(NSDictionary *)errorDict {\n    NSLog(@\"An error occurred with service %@.%@.%@, error code = %@\",\n          netService.name, netService.type, netService.domain, errorDict[NSNetServicesErrorCode]);\n}\n\n// Sent when the service stops\n- (void)netServiceDidStop:(NSNetService *)netService {\n    NSLog(@\"Disabling Bonjour Service - %@\", netService.name);\n    // You may want to do something here, such as updating a user interfac\n}\n\n\n@end\n"
  },
  {
    "path": "OSXvnc-server/auth.c",
    "content": "/*\n * auth.c - deal with authentication.\n *\n * This file implements the VNC authentication protocol when setting up an RFB\n * connection.\n */\n\n/*\n *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.\n *  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n#import <Cocoa/Cocoa.h>\n\n#include <stdio.h>\n#include <stdlib.h>\n#include \"rfb.h\"\n\nBool allowNoAuth = FALSE;\nNSLock *authClientLock=nil;\nNSMutableDictionary *authClientFailures=nil;\n\nstatic char *storedPass;\nstatic bool suppliedPass;\n\nint rfbMaxLoginAttempts=5;\nchar *rfbAuthPasswdFile = NULL;\n\nvoid rfbAuthInit(void) {\n\tauthClientLock=[[NSLock alloc] init];\n\tauthClientFailures=[[NSMutableDictionary alloc] init];\n}\n\nint failedAttemptsForClient(rfbClientPtr cl) {\n\tNSString *clientHost = [[NSString alloc] initWithCString:cl->host encoding:NSUTF8StringEncoding];\n\tint failedAttempts=0;\n\n\t[authClientLock\tlock];\n\tfailedAttempts = [authClientFailures[clientHost] intValue];\n\t[authClientLock unlock];\n\t[clientHost release];\n\n\treturn failedAttempts;\n}\n\nint incrementFailedAttemptsForClient(rfbClientPtr cl) {\n\tNSString *clientHost = [[NSString alloc] initWithCString:cl->host encoding:NSUTF8StringEncoding];\n\tNSNumber *failedNumber;\n\tint failedAttempts=0;\n\n\t[authClientLock\tlock];\n\tfailedAttempts = [authClientFailures[clientHost] intValue] + 1;\n\tfailedNumber = [[NSNumber alloc] initWithInt:failedAttempts];\n\tauthClientFailures[clientHost] = failedNumber;\n\t[authClientLock unlock];\n\t[failedNumber release];\n\t[clientHost release];\n\n\treturn failedAttempts;\n}\n\nvoid clearFailedAttemptsForClient(rfbClientPtr cl) {\n\tNSString *clientHost = [[NSString alloc] initWithCString:cl->host encoding:NSUTF8StringEncoding];\n\t[authClientLock\tlock];\n\t[authClientFailures removeObjectForKey:clientHost];\n\t[authClientLock\tunlock];\n\t[clientHost release];\n}\n\nvoid rfbSecurityResultMessage(rfbClientPtr cl, int result, char *errorString) {\n\tif (result==rfbVncAuthOK) {\n\t\tCARD32 authResult = Swap32IfLE(result);\n\n\t\tif (WriteExact(cl, (char *)&authResult, 4) < 0) {\n\t\t\trfbLogPerror(\"rfbSecurityResultMessage: write\");\n\t\t\trfbCloseClient(cl);\n\t\t}\n\t}\n\telse {\n\t\tint len=0;\n\t\tchar buf[256]; // For Error Messages\n\n\t\t*(CARD32 *)&buf[len] = Swap32IfLE(result);\n\t\tlen+=4;\n\n\t\tif ((cl->major == 3) && (cl->minor >= 8)) { // Return Error String\n\t\t\tsize_t errorLength = strlen(errorString);\n\t\t\t*(CARD32 *)&buf[len] = Swap32IfLE(errorLength);\n\t\t\tlen+=4;\n\n\t\t\tmemcpy(&buf[len], errorString, errorLength);\n\t\t\tlen+=errorLength;\n\t\t}\n\n\t\trfbLog(errorString);\n\t\tif (WriteExact(cl, buf, len) < 0) {\n\t\t\trfbLogPerror(\"rfbSecurityResultMessage: write\");\n\t\t\trfbCloseClient(cl);\n\t\t}\n\t}\n}\n\n/*\n * rfbAuthNewClient is called when we reach the point of authenticating\n * a new client.  If authentication isn't being used then we simply send\n * rfbNoAuth.  Otherwise we send rfbVncAuth plus the challenge.\n */\n\nvoid rfbAuthNewClient(rfbClientPtr cl) {\n    char buf[4 + CHALLENGESIZE+256];// 256 for error messages\n    int len = 0;\n\n    if (cl->major== 3 && cl->minor >= 7) {\n\t\tif (rfbMaxLoginAttempts && (failedAttemptsForClient(cl) > rfbMaxLoginAttempts)) {\n\t\t\tbuf[0] = 0; // Record Failure\n\t\t\tlen+=1;\n\n\t\t\tchar *errorString = \"Too Many Security Failures\";\n\t\t\tsize_t errorLength = strlen(errorString);\n\t\t\t*(CARD32 *)&buf[len] = Swap32IfLE(errorLength);\n\t\t\tlen+=4;\n\n\t\t\tmemcpy(&buf[len], errorString, errorLength);\n\t\t\tlen+=errorLength;\n\t\t\tif (WriteExact(cl, buf, len) < 0) {\n\t\t\t\trfbLogPerror(\"rfbAuthNewClient: write\");\n\t\t\t}\n\t\t\trfbLog(\"rfbAuthNewClient: authentication failed from %s (too many failures)\", cl->host);\n\t\t\trfbCloseClient(cl);\n\t\t\treturn;\n\t\t}\n\n\t\t// One byte for the # of Auth Types\n\t\tlen++;\n\n\t\t/** JAMF AUTH **/\n\t\tif (0) {\n\t\t\tbuf[len++] = rfbJAMF;\n\t\t\tcl->state = RFB_AUTH_VERSION;\n\t\t}\n\t\telse if (0) {\n\t\t\tbuf[len++] = rfbUltra;\n\t\t\tcl->state = RFB_AUTH_VERSION;\n\t\t}\n        else if ((!cl->reverseConnection && rfbAuthPasswdFile) || suppliedPass) {\n            buf[len++] = rfbVncAuth;\n            cl->state = RFB_AUTH_VERSION;\n        }\n        else if (cl->reverseConnection || allowNoAuth) {\n            buf[len++] = rfbNoAuth;\n            cl->state = RFB_AUTH_VERSION; //RFB_INITIALISATION;\n        }\n\n\t\tbuf[0] = (len-1); // Record How Many Auth Types in the first byte\n\n\t\tif (len == 1) { // if we disable no-auth, for example\n\t\t\tchar *errorString = \"No Supported Security Types\";\n\t\t\tsize_t errorLength = strlen(errorString);\n\t\t\t*(CARD32 *)&buf[len] = Swap32IfLE(errorLength);\n\t\t\tlen+=4;\n\n\t\t\tmemcpy(&buf[len], errorString, errorLength);\n\t\t\tlen+=errorLength;\n\t\t}\n\n        if (WriteExact(cl, buf, len) < 0) {\n            rfbLogPerror(\"rfbAuthNewClient: write\");\n            rfbCloseClient(cl);\n            return;\n        }\n    }\n    else {\n\t\tif (rfbMaxLoginAttempts && (failedAttemptsForClient(cl) > rfbMaxLoginAttempts)) {\n\t\t\tbuf[0] = Swap32IfLE(rfbConnFailed); // Record Failure\n\t\t\tlen+=4;\n\n\t\t\tchar *errorString = \"Too Many Security Failures\";\n\t\t\tsize_t errorLength = strlen(errorString);\n\t\t\t*(CARD32 *)&buf[len] = Swap32IfLE(errorLength);\n\t\t\tlen+=4;\n\n\t\t\tmemcpy(&buf[len], errorString, errorLength);\n\t\t\tlen+=errorLength;\n\t\t\tif (WriteExact(cl, buf, len) < 0) {\n\t\t\t\trfbLogPerror(\"rfbAuthNewClient: write\");\n\t\t\t}\n\t\t\trfbLog(\"rfbAuthNewClient: authentication failed from %s (too many failures)\", cl->host);\n\t\t\trfbCloseClient(cl);\n\t\t\treturn;\n\t\t}\n\n        // If We have a password file specified - Send Challenge Request\n        if ((!cl->reverseConnection && rfbAuthPasswdFile) || suppliedPass) {\n            *(CARD32 *)buf = Swap32IfLE(rfbVncAuth);\n            vncRandomBytes(cl->authChallenge);\n\t\t\tlen+=4;\n            memcpy(&buf[len], cl->authChallenge, CHALLENGESIZE);\n            len+=CHALLENGESIZE;\n\n            cl->state = RFB_AUTHENTICATION;\n        }\n        // Otherwise just send NO auth\n        else if (cl->reverseConnection || allowNoAuth) {\n            *(CARD32 *)buf = Swap32IfLE(rfbNoAuth);\n            len = 4;\n\n            cl->state = RFB_INITIALISATION;\n        }\n\t\telse {\n            rfbLogPerror(\"No Authentication Types Enabled\");\n            rfbCloseClient(cl);\n\t\t\treturn;\n\t\t}\n\n        if (WriteExact(cl, buf, len) < 0) {\n            rfbLogPerror(\"rfbAuthNewClient: write\");\n            rfbCloseClient(cl);\n            return;\n        }\n    }\n}\n\n//init password from commandline\nbool enterSuppliedPassword(char *passIn){\n    NSString *newPass = @(passIn);\n    if (newPass.length > 0) {\n        storedPass = passIn;\n        suppliedPass = true;\n    }\n    return suppliedPass;\n}\n\nvoid rfbProcessAuthVersion(rfbClientPtr cl) {\n    int n;\n    CARD8 securityType;\n\n    if ((n = ReadExact(cl, (char *) &securityType, 1)) <= 0) {\n        if (n != 0)\n            rfbLogPerror(\"rfbProcessAuthVersion: read\");\n        rfbCloseClient(cl);\n        return;\n    }\n\n    switch (securityType) {\n        case rfbVncAuth: {\n            char buf[CHALLENGESIZE];\n            int len = 0;\n\n            vncRandomBytes(cl->authChallenge);\n            memcpy(buf, cl->authChallenge, CHALLENGESIZE);\n            len = CHALLENGESIZE;\n\n            if (WriteExact(cl, buf, len) < 0) {\n                rfbLogPerror(\"rfbProcessAuthVersion: write\");\n                rfbCloseClient(cl);\n                return;\n            }\n\n            cl->state = RFB_AUTHENTICATION;\n            break;\n        }\n        case rfbNoAuth: {\n\t\t\tif (!cl->reverseConnection && rfbAuthPasswdFile) {\n\t\t\t\trfbLog(\"rfbProcessAuthVersion: invalid authorization type from %s\", cl->host);\n\t\t\t\trfbSecurityResultMessage(cl, rfbVncAuthFailed, \"Invalid Security Type\");\n\t\t\t\trfbCloseClient(cl);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ((cl->major == 3) && (cl->minor >= 8))\n\t\t\t\t\trfbSecurityResultMessage(cl, rfbVncAuthOK, NULL);\n\n\t\t\t\tcl->state = RFB_INITIALISATION;\n\t\t\t}\n\n            break;\n        }\n        default:\n\t\t\trfbLog(\"rfbProcessAuthVersion: invalid authorization type from %s\", cl->host);\n\t\t\trfbSecurityResultMessage(cl, rfbVncAuthFailed, \"Invalid Security Type\");\n\t\t\trfbCloseClient(cl);\n\t\t\treturn;\n    }\n}\n\n/*\n * rfbAuthProcessClientMessage is called when the client sends its\n * authentication response.\n */\n\nvoid rfbAuthProcessClientMessage(rfbClientPtr cl) {\n    char *passwd;\n    int i, n;\n    CARD8 response[CHALLENGESIZE];\n\n    if ((n = ReadExact(cl, (char *)response, CHALLENGESIZE)) <= 0) {\n        if (n != 0)\n            rfbLogPerror(\"rfbAuthProcessClientMessage: read\");\n        rfbCloseClient(cl);\n        return;\n    }\n\n    if (!suppliedPass) {\n        passwd = vncDecryptPasswdFromFile(rfbAuthPasswdFile);\n    } else {\n        passwd = storedPass;\n    }\n    if (passwd == NULL) {\n        rfbLog(\"rfbAuthProcessClientMessage: could not access password from %s\", rfbAuthPasswdFile);\n\t\trfbSecurityResultMessage(cl, rfbVncAuthFailed, \"Could not access password file\");\n        rfbCloseClient(cl);\n        return;\n    }\n\n    vncEncryptBytes(cl->authChallenge, passwd);\n\n    /* Lose the password from memory */\n    for (i = 0; passwd[i] != '\\0'; i++) {\n        passwd[i] = '\\0';\n    }\n    if (!suppliedPass)\n        free(passwd);\n\n    if (memcmp(cl->authChallenge, response, CHALLENGESIZE) != 0) {\n\t\tincrementFailedAttemptsForClient(cl);\n        rfbLog(\"rfbAuthProcessClientMessage: authentication failed from %s (incorrect password)\", cl->host);\n\t\trfbSecurityResultMessage(cl, rfbVncAuthFailed, \"Incorrect Password\");\n        rfbCloseClient(cl);\n        return;\n    }\n\n\tclearFailedAttemptsForClient(cl);\n\trfbSecurityResultMessage(cl, rfbVncAuthOK, NULL);\n\n    cl->state = RFB_INITIALISATION;\n}\n"
  },
  {
    "path": "OSXvnc-server/corre.c",
    "content": "/*\n * corre.c\n *\n * Routines to implement Compact Rise-and-Run-length Encoding (CoRRE).  This\n * code is based on krw's original javatel rfbserver.\n */\n\n/*\n *  Copyright (C) 2002 RealVNC Ltd.\n *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>.\n *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.\n *  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n#include <stdio.h>\n#include <stdlib.h>\n#include \"rfb.h\"\n\n/*\n * rreBeforeBuf contains pixel data in the client's format.\n * rreAfterBuf contains the RRE encoded version.  If the RRE encoded version is\n * larger than the raw data or if it exceeds rreAfterBufSize then\n * raw encoding is used instead.\n */\n\nstatic int rreBeforeBufSize = 0;\nstatic char *rreBeforeBuf = NULL;\n\nstatic int rreAfterBufSize = 0;\nstatic char *rreAfterBuf = NULL;\nstatic int rreAfterBufLen;\n\nstatic int subrectEncode8(rfbClientPtr cl, uint8_t *data, int w, int h);\nstatic int subrectEncode16(rfbClientPtr cl, uint16_t *data, int w, int h);\nstatic int subrectEncode32(rfbClientPtr cl, uint32_t *data, int w, int h);\nstatic uint32_t getBgColour(const void *data, size_t size, uint8_t bpp);\nstatic Bool rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl, int x, int y,\n\t\t\t\t\t  int w, int h);\n\n\n/*\n * rfbSendRectEncodingCoRRE - send an arbitrary size rectangle using CoRRE\n * encoding.\n */\n\nBool\nrfbSendRectEncodingCoRRE(rfbClientPtr cl, int x, int y, int w, int h)\n{\n    if (h > cl->correMaxHeight) {\n      return (rfbSendRectEncodingCoRRE(cl, x, y, w, cl->correMaxHeight) &&\n              rfbSendRectEncodingCoRRE(cl, x, y + cl->correMaxHeight, w,\n                                       h - cl->correMaxHeight));\n    }\n\n    if (w > cl->correMaxWidth) {\n      return (rfbSendRectEncodingCoRRE(cl, x, y, cl->correMaxWidth, h) &&\n              rfbSendRectEncodingCoRRE(cl, x + cl->correMaxWidth, y,\n                                       w - cl->correMaxWidth, h));\n    }\n\n    return rfbSendSmallRectEncodingCoRRE(cl, x, y, w, h);\n}\n\n\n\n/*\n * rfbSendSmallRectEncodingCoRRE - send a small (guaranteed < 256x256)\n * rectangle using CoRRE encoding.\n */\n\nstatic Bool\nrfbSendSmallRectEncodingCoRRE(rfbClientPtr cl, int x, int y, int w, int h)\n{\n    rfbFramebufferUpdateRectHeader rect;\n    rfbRREHeader hdr;\n    int nSubrects;\n    int i;\n    char *fbptr = (cl->scalingFrameBuffer + (cl->scalingPaddedWidthInBytes * y)\n                   + (x * (rfbScreen.bitsPerPixel / 8)));\n\n    int maxRawSize = (rfbScreen.width * rfbScreen.height\n\t\t      * (cl->format.bitsPerPixel / 8));\n\n    if (rreBeforeBufSize < maxRawSize) {\n\trreBeforeBufSize = maxRawSize;\n\tif (rreBeforeBuf == NULL)\n\t    rreBeforeBuf = (char *)xalloc(rreBeforeBufSize);\n\telse\n\t    rreBeforeBuf = (char *)xrealloc(rreBeforeBuf, rreBeforeBufSize);\n    }\n\n    if (rreAfterBufSize < maxRawSize) {\n\trreAfterBufSize = maxRawSize;\n\tif (rreAfterBuf == NULL)\n\t    rreAfterBuf = (char *)xalloc(rreAfterBufSize);\n\telse\n\t    rreAfterBuf = (char *)xrealloc(rreAfterBuf, rreAfterBufSize);\n    }\n\n    (*cl->translateFn)(cl->translateLookupTable, &rfbServerFormat,\n\t\t       &cl->format, fbptr, rreBeforeBuf,\n\t\t       cl->scalingPaddedWidthInBytes, w, h);\n\n    switch (cl->format.bitsPerPixel) {\n    case 8:\n        nSubrects = subrectEncode8(cl, (uint8_t *)rreBeforeBuf, w, h);\n        break;\n    case 16:\n        nSubrects = subrectEncode16(cl, (uint16_t *)rreBeforeBuf, w, h);\n        break;\n    case 32:\n        nSubrects = subrectEncode32(cl, (uint32_t *)rreBeforeBuf, w, h);\n        break;\n    default:\n\trfbLog(\"getBgColour: bpp %d?\", cl->format.bitsPerPixel);\n\texit(1);\n    }\n\n    if (nSubrects < 0) {\n\n\t/* RRE encoding was too large, use raw */\n\n\treturn rfbSendRectEncodingRaw(cl, x, y, w, h);\n    }\n\n    cl->rfbRectanglesSent[rfbEncodingCoRRE]++;\n    cl->rfbBytesSent[rfbEncodingCoRRE] += (sz_rfbFramebufferUpdateRectHeader\n\t\t\t\t\t   + sz_rfbRREHeader + rreAfterBufLen);\n\n    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader\n        > UPDATE_BUF_SIZE)\n    {\n\tif (!rfbSendUpdateBuf(cl))\n\t    return FALSE;\n    }\n\n    rect.r.x = Swap16IfLE(x);\n    rect.r.y = Swap16IfLE(y);\n    rect.r.w = Swap16IfLE(w);\n    rect.r.h = Swap16IfLE(h);\n    rect.encoding = Swap32IfLE(rfbEncodingCoRRE);\n\n    memcpy(&cl->updateBuf[cl->ublen], &rect, sz_rfbFramebufferUpdateRectHeader);\n    cl->ublen += sz_rfbFramebufferUpdateRectHeader;\n\n    hdr.nSubrects = Swap32IfLE(nSubrects);\n\n    memcpy(&cl->updateBuf[cl->ublen], &hdr, sz_rfbRREHeader);\n    cl->ublen += sz_rfbRREHeader;\n\n    for (i = 0; i < rreAfterBufLen;) {\n\n        int bytesToCopy = UPDATE_BUF_SIZE - cl->ublen;\n\n\tif (i + bytesToCopy > rreAfterBufLen) {\n\t    bytesToCopy = rreAfterBufLen - i;\n\t}\n\n        memcpy(&cl->updateBuf[cl->ublen], &rreAfterBuf[i], bytesToCopy);\n\n        cl->ublen += bytesToCopy;\n        i += bytesToCopy;\n\n        if (cl->ublen == UPDATE_BUF_SIZE) {\n            if (!rfbSendUpdateBuf(cl))\n                return FALSE;\n        }\n    }\n\n    return TRUE;\n}\n\n\n\n/*\n * subrectEncode() encodes the given multicoloured rectangle as a background\n * colour overwritten by single-coloured rectangles.  It returns the number\n * of subrectangles in the encoded buffer, or -1 if subrect encoding won't\n * fit in the buffer.  It puts the encoded rectangles in rreAfterBuf.  The\n * single-colour rectangle partition is not optimal, but does find the biggest\n * horizontal or vertical rectangle top-left anchored to each consecutive\n * coordinate position.\n *\n * The coding scheme is simply [<bgcolour><subrect><subrect>...] where each\n * <subrect> is [<colour><x><y><w><h>].\n */\n\n#define DEFINE_SUBRECT_ENCODE(bpp)\t\t\t\t\t      \\\nstatic int\t\t\t\t\t\t\t\t      \\\nsubrectEncode##bpp(rfbClientPtr _cl, uint##bpp##_t *data, int w, int h)\t      \\\n{\t\t\t\t\t\t\t\t\t      \\\n    uint##bpp##_t cl;\t\t\t\t\t\t\t      \\\n    rfbCoRRERectangle subrect;\t\t\t\t\t\t      \\\n    int x,y;\t\t\t\t\t\t\t\t      \\\n    int i,j;\t\t\t\t\t\t\t\t      \\\n    int hx=0,hy,vx=0,vy;\t\t\t\t\t\t      \\\n    int hyflag;\t\t\t\t\t\t\t\t      \\\n    uint##bpp##_t *seg;\t\t\t\t\t\t\t      \\\n    uint##bpp##_t *line;\t\t\t\t\t\t\t      \\\n    int hw,hh,vw,vh;\t\t\t\t\t\t\t      \\\n    int thex,they,thew,theh;\t\t\t\t\t\t      \\\n    int numsubs = 0;\t\t\t\t\t\t\t      \\\n    int newLen;\t\t\t\t\t\t\t\t      \\\n    uint##bpp##_t bg = (uint##bpp##_t)getBgColour(data, w * h, bpp);\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n    *((uint##bpp##_t*)rreAfterBuf) = bg;\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n    rreAfterBufLen = (bpp/8);\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n    for (y=0; y<h; y++) {\t\t\t\t\t\t      \\\n      line = data+(y*w);\t\t\t\t\t\t      \\\n      for (x=0; x<w; x++) {\t\t\t\t\t\t      \\\n        if (line[x] != bg) {\t\t\t\t\t\t      \\\n          cl = line[x];\t\t\t\t\t\t\t      \\\n          hy = y-1;\t\t\t\t\t\t\t      \\\n          hyflag = 1;\t\t\t\t\t\t\t      \\\n          for (j=y; j<h; j++) {\t\t\t\t\t\t      \\\n            seg = data+(j*w);\t\t\t\t\t\t      \\\n            if (seg[x] != cl) {break;}\t\t\t\t\t      \\\n            i = x;\t\t\t\t\t\t\t      \\\n            while ((seg[i] == cl) && (i < w)) i += 1;\t\t\t      \\\n            i -= 1;\t\t\t\t\t\t\t      \\\n            if (j == y) vx = hx = i;\t\t\t\t\t      \\\n            if (i < vx) vx = i;\t\t\t\t\t\t      \\\n            if ((hyflag > 0) && (i >= hx)) {hy += 1;} else {hyflag = 0;}      \\\n          }\t\t\t\t\t\t\t\t      \\\n          vy = j-1;\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n          /*  We now have two possible subrects: (x,y,hx,hy) and (x,y,vx,vy)  \\\n           *  We'll choose the bigger of the two.\t\t\t      \\\n           */\t\t\t\t\t\t\t\t      \\\n          hw = hx-x+1;\t\t\t\t\t\t\t      \\\n          hh = hy-y+1;\t\t\t\t\t\t\t      \\\n          vw = vx-x+1;\t\t\t\t\t\t\t      \\\n          vh = vy-y+1;\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n          thex = x;\t\t\t\t\t\t\t      \\\n          they = y;\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n          if ((hw*hh) > (vw*vh)) {\t\t\t\t\t      \\\n            thew = hw;\t\t\t\t\t\t\t      \\\n            theh = hh;\t\t\t\t\t\t\t      \\\n          } else {\t\t\t\t\t\t\t      \\\n            thew = vw;\t\t\t\t\t\t\t      \\\n            theh = vh;\t\t\t\t\t\t\t      \\\n          }\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n          subrect.x = thex;\t\t\t\t\t\t      \\\n          subrect.y = they;\t\t\t\t\t\t      \\\n          subrect.w = thew;\t\t\t\t\t\t      \\\n          subrect.h = theh;\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t  newLen = rreAfterBufLen + (bpp/8) + sz_rfbCoRRERectangle;\t      \\\n          if ((newLen > (w * h * (bpp/8))) || (newLen > rreAfterBufSize))     \\\n\t    return -1;\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t  numsubs += 1;\t\t\t\t\t\t\t      \\\n\t  *((uint##bpp##_t*)(rreAfterBuf + rreAfterBufLen)) = cl;\t\t      \\\n\t  rreAfterBufLen += (bpp/8);\t\t\t\t\t      \\\n\t  memcpy(&rreAfterBuf[rreAfterBufLen],&subrect,sz_rfbCoRRERectangle); \\\n\t  rreAfterBufLen += sz_rfbCoRRERectangle;\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n          /*\t\t\t\t\t\t\t\t      \\\n           * Now mark the subrect as done.\t\t\t\t      \\\n           */\t\t\t\t\t\t\t\t      \\\n          for (j=they; j < (they+theh); j++) {\t\t\t\t      \\\n            for (i=thex; i < (thex+thew); i++) {\t\t\t      \\\n              data[j*w+i] = bg;\t\t\t\t\t\t      \\\n            }\t\t\t\t\t\t\t\t      \\\n          }\t\t\t\t\t\t\t\t      \\\n        }\t\t\t\t\t\t\t\t      \\\n      }\t\t\t\t\t\t\t\t\t      \\\n    }\t\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n    return numsubs;\t\t\t\t\t\t\t      \\\n}\n\nDEFINE_SUBRECT_ENCODE(8)\nDEFINE_SUBRECT_ENCODE(16)\nDEFINE_SUBRECT_ENCODE(32)\n\n\n/*\n * getBgColour() gets the most prevalent colour in a byte array.\n */\nstatic uint32_t\ngetBgColour(const void *data, size_t size, uint8_t bpp)\n{\n  static unsigned counts[256];\n  size_t j;\n\n  unsigned maxcount = 0;\n  uint8_t maxclr = 0;\n\n  if (bpp != 8) {\n    if (bpp == 16) {\n      return ((uint16_t *)data)[0];\n    } else if (bpp == 32) {\n      return ((uint32_t *)data)[0];\n    } else {\n      rfbLog(\"getBgColour: bpp %d?\",bpp);\n      exit(1);\n    }\n  }\n\n  memset(counts, 0, sizeof(counts));\n\n  for (j=0; j<size; j++) {\n    uint8_t k = ((uint8_t *)data)[j];\n    counts[k]++;\n    if (counts[k] > maxcount) {\n      maxcount = counts[k];\n      maxclr = ((uint8_t *)data)[j];\n    }\n  }\n\n  return maxclr;\n}\n"
  },
  {
    "path": "OSXvnc-server/cutpaste.c",
    "content": "/*\n * cutpaste.c - routines to deal with cut & paste buffers / selection.\n */\n\n/*\n *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>.\n *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.\n *  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n#import <Cocoa/Cocoa.h>\n\n#include <stdio.h>\n#include <pthread.h>\n#include \"rfb.h\"\n#include \"getMACAddress.h\"\n\n// This prevents us from asking if this represents a local file\n#define VineRemoteProxy @\"VineRemoteProxy\"\n\n#define CorePasteboardFlavor_furl @\"CorePasteboardFlavorType 0x6675726C\"\n#define CorePasteboardFlavor_icns @\"CorePasteboardFlavorType 0x69636E73\"\n#define CorePasteboardFlavor_ut16 @\"CorePasteboardFlavorType 0x75743136\"\n#define CorePasteboardFlavor_ustl @\"CorePasteboardFlavorType 0x7573746C\"\n#define CorePasteboardFlavor_TEXT @\"CorePasteboardFlavorType 0x54455854\"\n#define CorePasteboardFlavor_styl @\"CorePasteboardFlavorType 0x7374796C\"\n#define CorePasteboardFlavor_fccc @\"CorePasteboardFlavorType 0x66636363\"\n#define CorePasteboardFlavor_flst @\"CorePasteboardFlavorType 0xC46C7374\"\n\n#ifndef NSAppKitVersionNumber10_3\n#define NSAppKitVersionNumber10_3 743\n#endif\n\n@interface NSFileManager (RSFileManagerAdditions)\n\n- (BOOL)ensureDirectoryAtPath:(NSString *)path attributes:(NSDictionary *)attributes;\n\n@end\n\n@implementation NSFileManager (RSFileManagerAdditions)\n\n- (BOOL)ensureDirectoryAtPath:(NSString *)path attributes:(NSDictionary *)attributes {\n\tNSString *parentDirectory;\n\tBOOL isDir = NO;\n\tpath = path.stringByStandardizingPath;\n\tif ([self fileExistsAtPath:path isDirectory:&isDir]) {\n\t\tif (!isDir && [path isEqualToString:@\"/tmp\"]) return YES; // work around craziness\n\t\treturn isDir; // if it's already there, we succeed iff it's a directory\n\t}\n\tparentDirectory = path.stringByDeletingLastPathComponent;\n\tif (parentDirectory && ![parentDirectory isEqualToString:@\"\"]) {\n\t\tBOOL parentExists = [self fileExistsAtPath:parentDirectory isDirectory:&isDir];\n\t\tif (parentExists || [self ensureDirectoryAtPath:parentDirectory attributes:attributes]) {\n\t\t\treturn [self createDirectoryAtPath:path withIntermediateDirectories: NO attributes:attributes error:NULL];\n\t\t} else {\n\t\t\treturn NO; // failed to find or create parent directory\n\t\t}\n\t} else {\n\t\treturn NO; // failed to create parent directory\n\t}\n}\n\n@end\n\n@interface NSData (RSDataAdditions)\n\n- (NSUInteger) locationOfData:(NSData *)target startingAtLocation:(NSUInteger)startLoc;\n- (NSMutableArray *) dataComponentsSeparatedByData:(NSData *)separator;\n\n@end\n\n@implementation NSData (RSDataAdditions)\n\n- (NSUInteger) locationOfData:(NSData *)target startingAtLocation:(NSUInteger)startLoc {\n\tchar *myBytes = (char *)self.bytes;\n\tchar *targetBytes = (char *)target.bytes;\n\tNSUInteger targetLen = target.length;\n\tNSUInteger loc, inner;\n\tfor (loc = startLoc; loc+targetLen < self.length; loc++) {\n\t\tBOOL found = YES; // assume we will match at this loc until disproven\n\t\tfor (inner = 0; found && inner < targetLen; inner++) {\n\t\t\tif (*(myBytes+loc+inner) != *(targetBytes+inner))\n\t\t\t\tfound = NO; // nope\n\t\t}\n\t\tif (found)\n\t\t\treturn loc;\n\t}\n\treturn NSNotFound;\n}\n\n- (NSMutableArray *) dataComponentsSeparatedByData:(NSData *)separator {\n\tNSMutableArray *array = [NSMutableArray array];\n\tNSUInteger prevLoc = 0;\n\tNSUInteger nextLoc = [self locationOfData:separator startingAtLocation:0];\n\twhile (nextLoc != NSNotFound) {\n\t\t[array addObject:[self subdataWithRange:NSMakeRange(prevLoc, nextLoc - prevLoc)]];\n\t\tprevLoc = nextLoc + separator.length;\n\t\tnextLoc = [self locationOfData:separator startingAtLocation:prevLoc];\n\t}\n\tif (prevLoc <= self.length) // add the final section (use '<=' to get an empty data if separator was found at the end)\n\t\t[array addObject:[self subdataWithRange:NSMakeRange(prevLoc, self.length - prevLoc)]];\n\treturn array;\n}\n\n@end\n\n\n@interface NSClipboardProxy : NSObject {\n\trfbClientPtr clientPointer;\n\tNSString *pasteboardName;\n}\n\n- initWithClientPtr: (rfbClientPtr) cl;\n- (void) setPasteboardName: pbName;\n- (void) removeClient;\n- (void) setupTypes: (NSArray *) availableTypes;\n- (void) pasteboard:(NSPasteboard *)thePasteboard provideDataForType:(NSString *)type;\n\n@end\n\n\nstatic BOOL debugPB = NO;\n\n@implementation NSClipboardProxy\n\n- initWithClientPtr: (rfbClientPtr) cl {\n\tif (self = [super init]) {\n\t\tclientPointer = cl;\n\t}\n\treturn self;\n}\n\n- (void) setPasteboardName: pbName {\n\t[pasteboardName release];\n\tpasteboardName = [pbName retain];\n}\n\n- (void) setupTypes:(NSArray *) availableTypes {\n\tNSPasteboard *thePasteboard = [NSPasteboard pasteboardWithName:pasteboardName];\n\tif (debugPB)\n\t\tNSLog(@\"Registering Types With Pasteboard\");\n\tNSInteger newChangeCount = [thePasteboard declareTypes:[availableTypes arrayByAddingObject:VineRemoteProxy] owner:self];\n\t// Don't send it back to the same client via rich clipboards\n\tpthread_mutex_lock(&clientPointer->updateMutex);\n\t((NSMutableDictionary *)clientPointer->richClipboardChangeCounts)[pasteboardName] = @(newChangeCount);\n\tpthread_mutex_unlock(&clientPointer->updateMutex);\n}\n\n// Sent by the PB system when someone requests the data (now time to ask for it)\n// Happens in the main thread, should setup the data to be written, alert client send thread, wait for response and return it\n- (void)pasteboard:(NSPasteboard *)thePasteboard provideDataForType:(NSString *)type {\n\ttime_t startTime=time(NULL);\n\n\tif (!clientPointer)\n\t\treturn;\n\n\tpthread_mutex_lock(&clientPointer->updateMutex);\n\n\t// Notify sending thread of request\n\tclientPointer->richClipboardReceivedName = [thePasteboard.name retain];\n\tclientPointer->richClipboardReceivedType = [type retain];\n\n\tpthread_mutex_unlock(&clientPointer->updateMutex);\n\tpthread_cond_signal(&clientPointer->updateCond);\n\t// which will call rfbSendRichClipboardRequest\n\n\t// Wait for flag indicating returned data\n\twhile (clientPointer && !clientPointer->richClipboardReceivedNSData && (time(NULL) - startTime < 60)) { // 60 second timeout\n\t\tusleep(.10 * 1000000);\n\t}\n\tif (!clientPointer)\n\t\treturn;\n\n\tif (clientPointer->richClipboardReceivedChangeCount >= 0) {\n\t\tNSString *availableType = clientPointer->richClipboardReceivedType;\n\t\tNSData *pasteboardData = clientPointer->richClipboardReceivedNSData;\n\n\t\tif ([availableType hasPrefix:@\"RSFileWrapper:\"]) { // special file data\n\t\t\tavailableType = [availableType substringFromIndex:14];\n\t\t\tif ([availableType isEqualToString:NSFileContentsPboardType]) {\n\t\t\t\t\t\t[thePasteboard setData:pasteboardData forType:availableType];\n\t\t\t\t//clipBoardReceivedChangeCount = lastChangeCount;\n\t\t\t}\n\t\t\telse { // not FileContents\n\t\t\t\tNSFileWrapper *theWrapper = [[NSFileWrapper alloc] initWithSerializedRepresentation:pasteboardData];\n\t\t\t\t// create path to file(s) in /tmp\n\t\t\t\tNSFileManager *fileManager = [NSFileManager defaultManager];\n\t\t\t\tif (!clientPointer->receivedFileTempFolder) {\n\t\t\t\t\tclientPointer->receivedFileTempFolder = [[@\"/tmp/Vine-\" stringByAppendingString:[NSProcessInfo processInfo].globallyUniqueString] retain];\n\t\t\t\t\t[fileManager ensureDirectoryAtPath:clientPointer->receivedFileTempFolder attributes:nil];\n\t\t\t\t}\n\t\t\t\t// write the files\n\t\t\t\tNSString *filename = theWrapper.preferredFilename;\n\t\t\t\tBOOL setOfFiles = [filename isEqualToString:@\"<Redstone set of files>\"];\n\t\t\t\tif (setOfFiles) {\n\t\t\t\t\tfilename = [@\"Files-\" stringByAppendingString:[NSProcessInfo processInfo].globallyUniqueString];\n\t\t\t\t}\n\t\t\t\tfilename = [(NSString *)clientPointer->receivedFileTempFolder stringByAppendingPathComponent:filename]; // get full path\n\t\t\t\t// set pasteboard data to point to the files\n\t\t\t\tif (setOfFiles) {\n\t\t\t\t\t// got a set of files -- put their local names on PB as NSFilenamesPboardType\n\t\t\t\t\tNSMutableArray *filenames = [NSMutableArray array];\n\t\t\t\t\tif (floor(NSAppKitVersionNumber) > floor(NSAppKitVersionNumber10_3)) { // Tiger+\n\t\t\t\t\t\tNSDictionary *filesDict = theWrapper.fileWrappers;\n\t\t\t\t\t\tNSEnumerator *fileEnum = [filesDict keyEnumerator];\n\t\t\t\t\t\tNSString *aFilename;\n\t\t\t\t\t\twhile (aFilename = [fileEnum nextObject]) {\n\t\t\t\t\t\t\t[filenames addObject:[filename stringByAppendingPathComponent:aFilename]];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t[theWrapper writeToFile:filename atomically:NO updateFilenames:NO];\n\t\t\t\t\t\tfilename = filenames[0]; // this is needed for setting the URL later (must be set to one of the files, not the folder)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// for 10.2 and 10.3, can't receive multiple files -- put them in a folder\n\t\t\t\t\t\tstatic int batchCounter = 0;\n\t\t\t\t\t\tfilename = [filename stringByAppendingPathComponent:[NSString stringWithFormat:@\"CopiedFiles_%02d\",++batchCounter]];\n\t\t\t\t\t\t[fileManager ensureDirectoryAtPath:filename attributes:nil];\n\t\t\t\t\t\t[filenames addObject:filename];\n\t\t\t\t\t\t//[theWrapper writeToFile:filename atomically:NO updateFilenames:NO];\n\t\t\t\t\t\t// let's avoid saving the extra .tiff files that seem to get written for each file\n\t\t\t\t\t\tNSDictionary *filesDict = theWrapper.fileWrappers;\n\t\t\t\t\t\tNSEnumerator *fileEnum = [filesDict keyEnumerator];\n\t\t\t\t\t\tNSString *aFilename;\n\t\t\t\t\t\twhile (aFilename = [fileEnum nextObject]) {\n\t\t\t\t\t\t\tNSFileWrapper *singleItemWrapper = filesDict[aFilename];\n\t\t\t\t\t\t\tNSString *singleItemPath = [filename stringByAppendingPathComponent:aFilename];\n\t\t\t\t\t\t\t[singleItemWrapper writeToFile:singleItemPath atomically:NO updateFilenames:NO];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t[thePasteboard setPropertyList:filenames forType:NSFilenamesPboardType];\n\t\t\t\t\t//clipBoardReceivedChangeCount = lastChangeCount;\n\t\t\t\t} else if ([availableType isEqualToString:NSFilenamesPboardType]) { // Filenames type sent, but only got 1 file\n\t\t\t\t\t[theWrapper writeToFile:filename atomically:NO updateFilenames:YES];\n\t\t\t\t\t[thePasteboard setPropertyList:@[filename] forType:NSFilenamesPboardType];\n\t\t\t\t\t//clipBoardReceivedChangeCount = lastChangeCount;\n\t\t\t\t} else {\n\t\t\t\t\t[theWrapper writeToFile:filename atomically:NO updateFilenames:YES];\n\t\t\t\t}\n\t\t\t\tif ([availableType isEqualToString:NSURLPboardType] || [availableType isEqualToString:CorePasteboardFlavor_furl]) {\n\t\t\t\t\t// got a URL type -- so put a URL on the PB, even if we already supplied file names\n\t\t\t\t\tNSURL *theUrl = [NSURL fileURLWithPath:filename];\n\t\t\t\t\t\t//[theUrl writeToPasteboard:thePasteboard];\n\t\t\t\t\t\tNSData *theData = [theUrl.absoluteString dataUsingEncoding:NSUTF8StringEncoding];\n\t\t\t\t\t\t\t\t[thePasteboard setData:theData forType:availableType];\n\t\t\t\t\t\t//clipBoardReceivedChangeCount = lastChangeCount;\n\t\t\t\t\t} else if (![availableType isEqualToString:NSFilenamesPboardType]) {\n\t\t\t\t\t\t// ERROR\n\t\t\t\t\t\tNSLog(@\"Error: received data type: %@\", availableType);\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if (pasteboardData) { // not RSFileWrapper\n\t\t\t[thePasteboard setData:pasteboardData forType:availableType];\n\t\t\t//clipBoardReceivedChangeCount = lastChangeCount;\n\t\t}\n\t}\n\telse { // Error occurred\n\t\tNSString *errorString = [[NSString alloc] initWithData:clientPointer->richClipboardReceivedNSData encoding:NSUTF8StringEncoding];\n\t\tNSLog(@\"%@\", errorString);\n\t\t[errorString release];\n\t};\n\n\tif (clientPointer) {\n\t\tpthread_mutex_lock(&clientPointer->updateMutex);\n\t\t[(id)clientPointer->richClipboardReceivedNSData release];\n\t\tclientPointer->richClipboardReceivedNSData = nil;\n\t\t[(id)clientPointer->richClipboardReceivedType release];\n\t\tclientPointer->richClipboardReceivedType = nil;\n\t\tpthread_mutex_unlock(&clientPointer->updateMutex);\n\t}\n}\n\n- (void) removeClient {\n\tclientPointer = NULL;\n\t// Would be nice to tell our PB that we aren't valid\n}\n\n- (void)pasteboardChangedOwner:(NSPasteboard *)sender {\n\tif (clientPointer) {\n\t\tpthread_mutex_lock(&clientPointer->updateMutex);\n\t\tclientPointer->clipboardProxy = nil;\n\t\tpthread_mutex_unlock(&clientPointer->updateMutex);\n\t}\n\t[self autorelease];\n}\n\n@end\n\n\n// Currently there is a problem when OSXvnc is run PRIOR to the pbs (which starts when a user logs in)\n// the OSXvnc process is NOT connected to the pbs port - this is an OS X security measure which we aren't certain\n// how to work around\n\n// We might be able to register with the port later\n// Restart VNC on login (of course this kills sessions)\n// or spawn a little agent at login -- modify the /etc/ttys and add a -LoginHook process\n// or possibly run with -inetd...hmmm...\n\n// This is the global VNC change count\nNSRecursiveLock *pasteboardLock = nil;\n\n// Used to lock access to pasteboardString, clientCutText and pasteboards array\nNSRecursiveLock *pasteboardVariablesLock = nil;\n\nNSString *pasteboardString = nil;\nNSString *clientCutText = nil;\nNSMutableDictionary *pasteboards = nil;\n\nunsigned long long maxTransferSize = 0x10000000;\n\n// Each Pasteboard has an array with item 0 = the ChangeCount and item 1 = the AvailableTypes Array\nstatic int generalPBLastChangeCount=-1;\nNSStringEncoding pasteboardStringEncoding = NSWindowsCP1252StringEncoding; // RFBProto 003.008\n\nvoid initPasteboard(void) {\n    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];\n\tpasteboardLock = [[NSRecursiveLock alloc] init];\n\tpasteboardVariablesLock = [[NSRecursiveLock alloc] init];\n\n\tif (![NSPasteboard generalPasteboard]) {\n\t\trfbLog(\"Pasteboard Inaccessible - Pasteboard sharing disabled\");\n\n\t\t[pasteboardVariablesLock lock];\n\t\t// Record first in case another event comes in after notifying clients\n\t\tgeneralPBLastChangeCount = 0;\n\t\t[pasteboardString release];\n\t\tpasteboardString = [[NSString alloc] initWithString:@\"\\e<PASTEBOARD INACCESSIBLE>\\e\"];\n\t\t[pasteboardVariablesLock unlock];\n\n\t\trfbDisableRichClipboards = TRUE;\n\t}\n\telse {\n\t\tNSArray *pbNames = @[NSGeneralPboard, NSRulerPboard, NSFontPboard, NSFindPboard, NSDragPboard];\n\t\tNSEnumerator *objEnum = [pbNames objectEnumerator];\n\t\tNSString *aPasteboard = nil;\n\n\t\tpasteboards = [[NSMutableDictionary alloc] init];\n\n\t\twhile (aPasteboard = [objEnum nextObject]) {\n\t\t\t// Each Pasteboard has an array with item 0 = the ChangeCount and item 1 = the AvailableTypes Array\n\t\t\tpasteboards[aPasteboard] = [NSMutableArray arrayWithObjects:@0, [NSArray array], nil];\n\t\t}\n\n\t\t[[NSUserDefaults standardUserDefaults] registerDefaults:\n\t\t\t@{@\"MaxFileTransferSize\": @0x10000000ULL}];\n\n\t\tmaxTransferSize = [[[NSUserDefaults standardUserDefaults] objectForKey:@\"MaxFileTransferSize\"] unsignedLongLongValue];\n\t\tdebugPB = [[NSUserDefaults standardUserDefaults] boolForKey:@\"DebugPB\"];\n\t}\n\n\tif (floor(NSAppKitVersionNumber) <= floor(NSAppKitVersionNumber10_1))\n\t\trfbDisableRichClipboards = TRUE;\n\n    [pool release];\n}\n\n\n\nvoid initPasteboardForClient(rfbClientPtr cl) {\n\tNSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];\n    /* REDSTONE - Have new client keep his PB currently */\n\tcl->generalPBLastChange = -1;\n\tcl->richClipboardChangeCounts = [[NSMutableDictionary alloc] init];\n\tcl->clipboardProxy = nil;\n\tcl->richClipboardName = nil;\n\tcl->richClipboardType = nil;\n\tcl->richClipboardNSData = nil;\n\n\tcl->richClipboardReceivedName = nil;\n\tcl->richClipboardReceivedType = nil;\n\tcl->richClipboardReceivedNSData = nil;\n\tcl->receivedFileTempFolder = nil;\n\n\t[pool release];\n}\n\nvoid freePasteboardForClient(rfbClientPtr cl) {\n\t[(NSClipboardProxy *) cl->clipboardProxy removeClient];\n\t[(NSString *)cl->receivedFileTempFolder release];\n\t[(NSMutableDictionary *)cl->richClipboardChangeCounts release];\n}\n\n// This notifies us that the VNCclient set some new pasteboard\nvoid rfbSetCutText(rfbClientPtr cl, char *str, int len) {\n    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];\n\n\tif (generalPBLastChangeCount != 0) {\n\t\tcl->generalPBLastChange = -1;\n\n\t\t[pasteboardVariablesLock lock];\n\t\t[clientCutText release];\n\t\tclientCutText = [[NSString alloc] initWithData:[NSData dataWithBytes:str length:len] encoding: pasteboardStringEncoding];\n\t\t[pasteboardVariablesLock unlock];\n\n\t\t//  we'll stall until it gets picked up by the main thread\n\t\twhile (clientCutText)\n\t\t\tusleep(10000);\n\t}\n\n    [pool release];\n}\n\nstatic BOOL pasteboardRepresentsExistingFile(NSPasteboard *thePasteboard) {\n\tNSArray *pboardTypes = thePasteboard.types;\n\tif ([pboardTypes containsObject:NSFilenamesPboardType]) {\n\t\tNSArray *fileNames = [thePasteboard propertyListForType:NSFilenamesPboardType];\n\t\tNSFileManager *fileManager = [NSFileManager defaultManager];\n\t\tint index;\n\t\tfor (index = 0; index < fileNames.count; index++) {\n\t\t\tif ([fileManager fileExistsAtPath:fileNames[index]]) {\n\t\t\t\treturn YES; // at least one of the files exists\n\t\t\t}\n\t\t}\n\t}\n\telse if ([pboardTypes containsObject:CorePasteboardFlavor_flst]) {\n\t\treturn YES; // don't try to parse it all here -- just assume it represents actual files\n\t}\n\telse if ([pboardTypes containsObject:VineRemoteProxy]) {\n\t\t// In this case we do NOT want to go to the next test, it can lead to a deadlock...\n\t\t// where the main thread tries to pull the data from client thread\n\t\t// while the client thread waits for the main thread to determine if we have new data\n\t\treturn NO;\n\t}\n\telse if ([pboardTypes containsObject:NSURLPboardType]) {\n\t\tNSURL *theUrl = [NSURL URLFromPasteboard:thePasteboard];\n\t\tif (theUrl.fileURL) {\n\t\t\treturn [[NSFileManager defaultManager] fileExistsAtPath:theUrl.path];\n\t\t}\n\t}\n\treturn NO;\n}\n\nstatic NSArray *arrayFromFlstData(NSData *flstData) {\n\tNSArray *fileArray = [flstData dataComponentsSeparatedByData:[@\"seldtype\" dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES]];\n\tint fileIndex, componentIndex;\n\tNSMutableArray *pathArray = [NSMutableArray array];\n\tBOOL error = NO;\n\tif ([flstData locationOfData:[@\"dle2\" dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES] startingAtLocation:0] != 0) {\n\t\tif (debugPB) NSLog(@\"PROBLEM: flst data doesn't start with 'dle2' !!\");\n\t\terror = YES;\n\t}\n\tfor (fileIndex = 1; !error && fileIndex < fileArray.count; fileIndex++) { // (note: start at 1 -- ignore first chunk)\n\t\tNSArray *componentArray = [fileArray[fileIndex] dataComponentsSeparatedByData: [@\"nameseld\" dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES]];\n\t\tNSString *filePath = @\"/\";\n\t\tfor (componentIndex = 1; componentIndex < componentArray.count; componentIndex++) { // (note: start at 1 -- ignore first chunk)\n\t\t\tNSData *componentData = componentArray[componentIndex];\n\t\t\tif ([componentData locationOfData:[@\"utxt\" dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES] startingAtLocation:0] != 0) {\n\t\t\t\tif (debugPB) NSLog(@\"PROBLEM: flst component doesn't start with 'utxt' !!\");\n\t\t\t\terror = YES;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tunsigned char high, low;\n\t\t\thigh = *(unsigned char *)(componentData.bytes+6);\n\t\t\tlow = *(unsigned char *)(componentData.bytes+7);\n\t\t\tunsigned short len = 256*high + low;\n\t\t\tNSData *subdata = [componentData subdataWithRange:NSMakeRange(8,len)];\n\t\t\tNSString *componentStr = [[NSString alloc] initWithData:subdata encoding:NSUnicodeStringEncoding];\n\t\t\tfilePath = [filePath stringByAppendingPathComponent:componentStr];\n\t\t\t[componentStr release];\n\t\t}\n\t\t[pathArray addObject:filePath];\n\t}\n\treturn pathArray;\n}\n\nstatic NSArray *getListOfFilenamesFromPasteboard(NSPasteboard *thePasteboard) {\n\tNSArray *pboardTypes = thePasteboard.types;\n\tif ([pboardTypes containsObject:CorePasteboardFlavor_flst]) { // 10.2 & 10.3\n\t\tNSData *flstData = [thePasteboard dataForType:CorePasteboardFlavor_flst];\n\t\treturn arrayFromFlstData(flstData); //pathArray;\n\t} else {\n\t\treturn nil;\n\t}\n}\n\n// We call this in the main thread to see if we have a new pasteboard change and should notify clients to do an update\nvoid rfbCheckForPasteboardChange(void) {\n    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];\n\tNSEnumerator *pasteboardsEnum = [pasteboards keyEnumerator];\n\tNSString *pasteboardName = nil;\n\n\t[pasteboardVariablesLock lock]; // Protect references to clientCutText\n\tNS_DURING\n\t\tif (clientCutText) {\n\t\t\tif ([[NSPasteboard generalPasteboard] declareTypes:@[NSStringPboardType] owner:nil]) {\n\t\t\t\t[[NSPasteboard generalPasteboard] setString:clientCutText forType:NSStringPboardType];\n\t\t\t}\n\t\t\t[clientCutText release];\n\t\t\tclientCutText = nil;\n\t\t};\n\tNS_HANDLER\n\t\tNSLog(@\"Problem Writing Cut Text To Pasteboard: %@\", localException);\n\tNS_ENDHANDLER\n\t[pasteboardVariablesLock unlock];\n\n\t// First Let's see if we have new info on the pasteboard - if so we'll send an update to each client\n\tif (generalPBLastChangeCount != [NSPasteboard generalPasteboard].changeCount) {\n\t\trfbClientPtr cl;\n\t\trfbClientIteratorPtr iterator = rfbGetClientIterator();\n\n\t\t// Let's grab a copy of it here in the Main/Event Thread so that the output threads don't have to deal with the PB directly\n\t\tif ([[NSPasteboard generalPasteboard] availableTypeFromArray:@[NSStringPboardType]]) {\n\t\t\t[pasteboardVariablesLock lock];\n\t\t\t// Record first in case another event comes in after notifying clients\n\t\t\tgeneralPBLastChangeCount = (int)[NSPasteboard generalPasteboard].changeCount;\n\t\t\t[pasteboardString release];\n\t\t\tpasteboardString = [[[NSPasteboard generalPasteboard] stringForType:NSStringPboardType] copy];\n\t\t\t[pasteboardVariablesLock unlock];\n\t\t}\n\n\t\t// Notify each client\n\t\twhile ((cl = rfbClientIteratorNext(iterator)) != NULL) {\n\t\t\tif (!cl->richClipboardSupport)\n\t\t\t\tpthread_cond_signal(&cl->updateCond);\n\t\t}\n\t\trfbReleaseClientIterator(iterator);\n\t}\n\n\t// Check EACH pasteboard  by name to see if it has new data\n\twhile (pasteboardName = [pasteboardsEnum nextObject]) {\n\t\tNSMutableArray *pbInfoArray = pasteboards[pasteboardName];\n\t\tNSPasteboard *thePasteboard = [NSPasteboard pasteboardWithName:pasteboardName];\n\n\t\t// Record the change count first in case another event comes in while we are pulling the Types\n\t\tNSInteger pasteboardsChangeCount = thePasteboard.changeCount;\n\n\t\t[pasteboardVariablesLock lock];\n\t\tif ([pbInfoArray[0] intValue] != pasteboardsChangeCount) {\n\t\t\t// Check for special file types (URL for a local file, or NSFilenamesPboardType for an existing file)\n\t\t\tNSArray *pboardTypes = thePasteboard.types;\n\t\t\tpbInfoArray[0] = @(pasteboardsChangeCount);\n\t\t\tif (!pboardTypes.count) {\n\t\t\t\tif (debugPB)\n\t\t\t\t\tNSLog(@\"Warning - Pasteboard with no types, ignored\");\n\t\t\t\t[pasteboardVariablesLock unlock];\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tpboardTypes = [pboardTypes arrayByAddingObject:[NSString stringWithFormat:@\"RSPBID:%@:%@\", NSUserName(), getMACAddressString()]];\n\t\t\tif (![pboardTypes containsObject:NSFileContentsPboardType]) { // no need to check, if file contents is already there\n\t\t\t\tif (pasteboardRepresentsExistingFile(thePasteboard)) {\n\t\t\t\t\tpboardTypes = [pboardTypes arrayByAddingObject:NSFileContentsPboardType];\n\t\t\t\t\tif (![pboardTypes containsObject:CorePasteboardFlavor_fccc]) {\n\t\t\t\t\t\tpboardTypes = [pboardTypes arrayByAddingObject:CorePasteboardFlavor_fccc];\n\t\t\t\t\t}\n\t\t\t\t\tif (![pboardTypes containsObject:NSFilenamesPboardType]) {\n\t\t\t\t\t\tpboardTypes = [pboardTypes arrayByAddingObject:NSFilenamesPboardType];\n\t\t\t\t\t}\n\t\t\t\t\tif (![pboardTypes containsObject:CorePasteboardFlavor_furl]) {\n\t\t\t\t\t\tpboardTypes = [pboardTypes arrayByAddingObject:CorePasteboardFlavor_furl];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tpbInfoArray[1] = pboardTypes;\n\n\t\t\t{\n\t\t\t\trfbClientPtr cl;\n\t\t\t\trfbClientIteratorPtr iterator = rfbGetClientIterator();\n\n\t\t\t\t// Notify each client\n\t\t\t\twhile ((cl = rfbClientIteratorNext(iterator)) != NULL) {\n\t\t\t\t\tif (cl->richClipboardSupport)\n\t\t\t\t\t\tpthread_cond_signal(&cl->updateCond);\n\t\t\t\t}\n\n\t\t\t\trfbReleaseClientIterator(iterator);\n\t\t\t}\n\t\t}\n\t\t[pasteboardVariablesLock unlock];\n\t}\n\n\t[pool release];\n}\n\nstatic void rfbSendRichClipboardAck(rfbClientPtr cl) {\n\tstruct {\n\t\tCARD8 type;                 /* always rfbServerCutText */\n\t\tCARD8 pad1;\n\t\tCARD16 pad2;\n\t\tCARD32 pbChangeCount;\n\t\tCARD32 pbNameLength;\n\t} rfbServerRichPasteboardInfo;\n\n    rfbServerRichPasteboardInfo.type = rfbRichClipboardAvailable;\n    rfbServerRichPasteboardInfo.pbChangeCount = 0;\n    rfbServerRichPasteboardInfo.pbNameLength = 0;\n    if (WriteExact(cl, (char *)&rfbServerRichPasteboardInfo, sizeof(rfbServerRichPasteboardInfo)) < 0) {\n        rfbLogPerror(\"rfbSendRichClipboardAck: write\");\n        rfbCloseClient(cl);\n    }\n}\n\nstatic void rfbSendRichClipboardAvailable(rfbClientPtr cl, NSString *pasteboardNameString, NSArray *pbInfoArray) {\n\tstruct {\n\t\tCARD8 type;\n\t\tCARD8 pad1;\n\t\tCARD16 pad2;\n\t\tint pbChangeCount;\n\t\tCARD32 pbNameLength;\n\t} rfbServerRichPasteboardInfo;\n\tchar *pasteboardName = (char *)pasteboardNameString.UTF8String;\n\tchar *pbTypesListString = (char *)[pbInfoArray[1] componentsJoinedByString:@\"\\t\"].UTF8String;\n\tCARD32 typesArrayLength = Swap32IfLE(strlen(pbTypesListString));\n\n\tif (debugPB)\n\t\tNSLog(@\"Sending CB Available [%s] Types: %@\", pasteboardName, pbInfoArray[1]);\n    rfbServerRichPasteboardInfo.type = rfbRichClipboardAvailable;\n    rfbServerRichPasteboardInfo.pbChangeCount = [pbInfoArray[0] intValue];\n    rfbServerRichPasteboardInfo.pbNameLength = Swap32IfLE(strlen(pasteboardName));\n    if (WriteExact(cl, (char *)&rfbServerRichPasteboardInfo, sizeof(rfbServerRichPasteboardInfo)) < 0) {\n        rfbLogPerror(\"rfbSendServerNewPasteboardInfo: write\");\n        rfbCloseClient(cl);\n    }\n\n\t/* followed by char text[pbNameLength] */\n    if (WriteExact(cl, pasteboardName, strlen(pasteboardName)) < 0) {\n        rfbLogPerror(\"rfbSendServerNewPasteboardInfo: write\");\n        rfbCloseClient(cl);\n    }\n\n\t// Length of pbTypesListString\n    if (WriteExact(cl, (char *)&typesArrayLength, sizeof(typesArrayLength)) < 0) {\n        rfbLogPerror(\"rfbSendServerNewPasteboardInfo: write\");\n        rfbCloseClient(cl);\n    }\n\t/* followed by char text[typesArrayLength] */\n\tif (WriteExact(cl, pbTypesListString, strlen(pbTypesListString)) < 0) {\n        rfbLogPerror(\"rfbSendServerNewPasteboardInfo: write\");\n        rfbCloseClient(cl);\n    }\n}\n\nvoid rfbSendRichClipboardRequest(rfbClientPtr cl) {\n\tNSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];\n\tstruct {\n\t\tchar messageType;\n\t\tchar padding1;\n\t\tchar padding2;\n\t\tchar padding3;\n\t\tint changeCount;\n\t} requestRichClipboardInfo;\n\tconst char *stringToSend;\n\tint stringLength;\n\n\tif (debugPB)\n\t\tNSLog(@\"Sending CB Request [%@] Types: %@\", cl->richClipboardReceivedName, cl->richClipboardReceivedType);\n\trequestRichClipboardInfo.messageType=rfbRichClipboardRequest;\n\trequestRichClipboardInfo.padding1=0;\n\trequestRichClipboardInfo.padding2=0;\n\trequestRichClipboardInfo.padding3=0;\n\trequestRichClipboardInfo.changeCount=htonl(-1); // -1 to indicate we don't care about a specific request\n\tWriteExact(cl, (char *)&requestRichClipboardInfo, sizeof(requestRichClipboardInfo));\n\n\tstringToSend = [(id)cl->richClipboardReceivedName UTF8String];\n\tstringLength = htonl(strlen(stringToSend));\n\tWriteExact(cl, (char *)&stringLength, sizeof(stringLength));\n\tWriteExact(cl, (char *)stringToSend, ntohl(stringLength));\n\n\tstringToSend = [(id)cl->richClipboardReceivedType UTF8String];\n\tstringLength = htonl(strlen(stringToSend));\n\tWriteExact(cl, (char *)&stringLength, sizeof(stringLength));\n\tWriteExact(cl, (char *)stringToSend, ntohl(stringLength));\n\n\t[(id)cl->richClipboardReceivedName release];\n\tcl->richClipboardReceivedName = nil;\n\t[(id)cl->richClipboardReceivedType release];\n\tcl->richClipboardReceivedType = nil;\n\n\t[pool release];\n}\n\nstatic void rfbSendRichClipboardData(rfbClientPtr cl) {\n\tstruct {\n\t\tCARD8 type;                 /* always rfbServerCutText */\n\t\tCARD8 pad1;\n\t\tCARD16 pad2;\n\t\tint pbChangeCount;\n\t\tCARD32 pbNameLength;\n\t} rfbServerRichPasteboardInfo;\n\tCARD32 sendLength;\n\n\tif (debugPB)\n\t\tNSLog(@\"Sending CB Data [%s] Type: %s\", cl->richClipboardName, cl->richClipboardType);\n    rfbServerRichPasteboardInfo.type = rfbRichClipboardData;\n    rfbServerRichPasteboardInfo.pbChangeCount = Swap32IfLE(cl->richClipboardDataChangeCount);\n    rfbServerRichPasteboardInfo.pbNameLength = Swap32IfLE(strlen(cl->richClipboardName));\n    if (WriteExact(cl, (char *)&rfbServerRichPasteboardInfo, sizeof(rfbServerRichPasteboardInfo)) < 0) {\n        rfbLogPerror(\"rfbSendServerNewPasteboardInfo: write\");\n        rfbCloseClient(cl);\n    }\n\n\t/* followed by char text[pbNameLength] */\n    if (WriteExact(cl, cl->richClipboardName, strlen(cl->richClipboardName)) < 0) {\n        rfbLogPerror(\"rfbSendServerNewPasteboardInfo: write\");\n        rfbCloseClient(cl);\n    }\n\n\t// Length of cl->richClipboardName\n\tsendLength = Swap32IfLE(strlen(cl->richClipboardType));\n    if (WriteExact(cl, (char *)&sendLength, sizeof(sendLength)) < 0) {\n        rfbLogPerror(\"rfbSendServerNewPasteboardInfo: write\");\n        rfbCloseClient(cl);\n    }\n\t/* followed by char text[typesArrayLength] */\n\tif (WriteExact(cl, cl->richClipboardType, strlen(cl->richClipboardType)) < 0) {\n        rfbLogPerror(\"rfbSendServerNewPasteboardInfo: write\");\n        rfbCloseClient(cl);\n    }\n\n\t// Length of pasteboard data\n\tsendLength = Swap32IfLE([(NSData *)cl->richClipboardNSData length]);\n    if (WriteExact(cl, (char *)&sendLength, sizeof(sendLength)) < 0) {\n        rfbLogPerror(\"rfbSendServerNewPasteboardInfo: write\");\n        rfbCloseClient(cl);\n    }\n\t/* followed by char text[dataLength] */\n\tif (WriteExact(cl, (char *)((NSData *)cl->richClipboardNSData).bytes, ((NSData *)cl->richClipboardNSData).length) < 0) {\n        rfbLogPerror(\"rfbSendServerNewPasteboardInfo: write\");\n        rfbCloseClient(cl);\n    }\n\n\txfree(cl->richClipboardName);\n\tcl->richClipboardName = NULL;\n\txfree(cl->richClipboardType);\n\tcl->richClipboardType = NULL;\n\t[(NSData *)cl->richClipboardNSData release];\n\tcl->richClipboardNSData = nil;\n}\n\n// Each client output thread will come here to get the PB and send it, we HAVE the updateLock at this time\nvoid rfbClientUpdatePasteboard(rfbClientPtr cl) {\n\t// They must have passed initialization and be in the Normal operational mode\n\tif (cl->state == RFB_NORMAL) {\n\t\tNSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];\n\n\t\tif (cl->richClipboardNSData != NULL)\n\t\t\trfbSendRichClipboardData(cl);\n\n\t\tif (cl->richClipboardReceivedName != NULL)\n\t\t\trfbSendRichClipboardRequest(cl);\n\n\t\t// New clients don't get the latest clipboard, they keep their own\n\t\tif (cl->generalPBLastChange == -1) {\n\t\t\tcl->generalPBLastChange = generalPBLastChangeCount;\n\t\t}\n\t\t// Client Identified that it supports Rich Clipboards\n\t\t// Send the acknowledgement but no clipboard data\n\t\telse if (cl->generalPBLastChange == -3) {\n\t\t\tNSEnumerator *pasteboardsEnum = [pasteboards keyEnumerator];\n\t\t\tNSString *pasteboardName = nil;\n\n\t\t\trfbSendRichClipboardAck(cl);\n\n\t\t\t[pasteboardVariablesLock lock]; // Protect references to pasteboards\n\t\t\tcl->generalPBLastChange = generalPBLastChangeCount;\n\t\t\twhile (pasteboardName = [pasteboardsEnum nextObject]) {\n\t\t\t\tNSMutableArray *pbInfoArray = pasteboards[pasteboardName];\n\n\t\t\t\t((NSMutableDictionary *)cl->richClipboardChangeCounts)[pasteboardName] = pbInfoArray[0];\n\t\t\t}\n\t\t\t[pasteboardVariablesLock unlock]; // Protect references to pasteboards\n\t\t}\n\t\telse {\n\t\t\tif (cl->richClipboardSupport) {\n\t\t\t\tNSEnumerator *pasteboardsEnum = [pasteboards keyEnumerator];\n\t\t\t\tNSString *pasteboardName = nil;\n\n\t\t\t\t[pasteboardVariablesLock lock]; // Protect references to pasteboards\n\t\t\t\twhile (pasteboardName = [pasteboardsEnum nextObject]) {\n\t\t\t\t\tNSMutableArray *pbInfoArray = pasteboards[pasteboardName];\n\t\t\t\t\tint changeCountForPasteboard = [((NSDictionary *)cl->richClipboardChangeCounts)[pasteboardName] intValue];\n\n\t\t\t\t\tif (changeCountForPasteboard < [pbInfoArray[0] intValue]) {\n\t\t\t\t\t\tif (changeCountForPasteboard != -1)\n\t\t\t\t\t\t\trfbSendRichClipboardAvailable(cl, pasteboardName, pbInfoArray);\n\n\t\t\t\t\t\t((NSMutableDictionary *)cl->richClipboardChangeCounts)[pasteboardName] = pbInfoArray[0];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t[pasteboardVariablesLock unlock]; // Protect references to pasteboards\n\t\t\t}\n\t\t\telse {\n\t\t\t\t[pasteboardVariablesLock lock];\n\t\t\t\tNS_DURING\n\t\t\t\t\tif (cl->generalPBLastChange != generalPBLastChangeCount && pasteboardString) {\n\t\t\t\t\t\tNSData *encodedString = [pasteboardString dataUsingEncoding:pasteboardStringEncoding allowLossyConversion:YES];\n\n\t\t\t\t\t\tif (encodedString.length)\n\t\t\t\t\t\t\trfbSendServerCutText(cl, (char *) encodedString.bytes, encodedString.length);\n\n\t\t\t\t\t\tcl->generalPBLastChange = generalPBLastChangeCount;\n\t\t\t\t\t};\n\t\t\t\tNS_HANDLER\n\t\t\t\tNS_ENDHANDLER\n\t\t\t\t[pasteboardVariablesLock unlock];\n\t\t\t}\n\t\t}\n\n\t\t[pool release];\n\t}\n}\n\n// Receive Thread\n\nvoid rfbReceiveRichClipboardAvailable(rfbClientPtr cl) {\n\tNSAutoreleasePool *myPool = [[NSAutoreleasePool alloc] init];\n\tchar *readString;\n\tunsigned int stringLength;\n\tint pbChangeCount;\n\tNSString *pasteboardName = nil;\n\tNSArray *availableTypes = nil;\n\tint returnCheck;\n\n\tReadExact(cl, ((char *)&pbChangeCount), 3);\n\tReadExact(cl, ((char *)&pbChangeCount), 4);\n\t// Right now we don't really care or store this value,\n\t// We if we wanted more explicit tracking of what gets returned\n\tpbChangeCount = Swap32IfLE(pbChangeCount);\n\n\t// Pasteboard Name\n\tReadExact(cl, (char *)&stringLength, 4);\n\tstringLength = Swap32IfLE(stringLength);\n\treadString = (char *) xalloc(stringLength+1);\n\treadString[stringLength] = 0;\n\tReadExact(cl, readString, stringLength);\n\tpasteboardName = @(readString);\n\txfree(readString);\n\n\t// Type String\n\tReadExact(cl, (char *)&stringLength, 4);\n\tstringLength = Swap32IfLE(stringLength);\n\treadString = (char *) xalloc(stringLength+1);\n\treadString[stringLength] = 0;\n\treturnCheck = ReadExact(cl, readString, stringLength);\n\tavailableTypes = [@(readString) componentsSeparatedByString:@\"\\t\"];\n\txfree(readString);\n\n\tif (debugPB)\n\t\tNSLog(@\"Received CB Available [%@] Types: %@\", pasteboardName, availableTypes);\n\n\tif (returnCheck <= 0) {\n\t\tif (returnCheck != 0)\n\t\t\trfbLogPerror(\"rfbReceiveRichClipboardAvailable: read\");\n\t\trfbCloseClient(cl);\n\t}\n\n\tif (!rfbDisableRichClipboards) {\n\t\tif ([availableTypes indexOfObject:[NSString stringWithFormat:@\"RSPBID:%@:%@\", NSUserName(), getMACAddressString()]] != NSNotFound) {\n\t\t\tif (debugPB)\n\t\t\t\tNSLog(@\"Rich clipboard info appears to be from our own account (%@:%@) -- ignored.\", NSUserName(), getMACAddressString());\n\t\t}\n\t\telse /*if (addNewDataToPB)*/ {\n\t\t\tNSClipboardProxy *newProxy = [[NSClipboardProxy alloc] initWithClientPtr:cl];\n\t\t\t[newProxy setPasteboardName: pasteboardName];\n\n\t\t\tpthread_mutex_lock(&cl->updateMutex);\n\t\t\t//We need to remove ourself as the old proxy's owner at this point, so it doesn't try to request data\n\t\t\t[(NSClipboardProxy *)cl->clipboardProxy removeClient];\n\t\t\t// We do NOT free here, the proxy is freed when the pasteboard system is done using it.\n\t\t\t// [(NSClipboardProxy *)cl->clipboardProxy release];\n\t\t\tcl->clipboardProxy = newProxy;\n\t\t\tpthread_mutex_unlock(&cl->updateMutex);\n\n\t\t\t//if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_2) //We're just disabling rich clipboards below 10.2\n\t\t\tNSUInteger flstIndex = [availableTypes indexOfObject:CorePasteboardFlavor_flst];\n\t\t\tif (flstIndex != NSNotFound) {\n\t\t\t\tavailableTypes = [[availableTypes mutableCopy] autorelease];\n\t\t\t\t[(NSMutableArray *)availableTypes removeObjectAtIndex:flstIndex]; // don't declare flst\n\t\t\t}\n\n\t\t\t[newProxy performSelectorOnMainThread:@selector(setupTypes:) withObject:availableTypes waitUntilDone:NO];\n\t\t}\n\t}\n\n\t[myPool release];\n\n\treturn;\n}\n\nvoid checkTotalSize(unsigned long long *totalSize, NSString *path, NSFileManager *fileManager) {\n\tBOOL isDirectory = NO;\n\tif ([fileManager fileExistsAtPath:path isDirectory:&isDirectory]) {\n\t\tif (isDirectory) {\n\t\t\tNSArray *contents = [fileManager contentsOfDirectoryAtPath:path error:NULL];\n\t\t\tint index;\n\t\t\tfor (index=0; index<contents.count; index++) {\n\t\t\t\tcheckTotalSize(totalSize, [path stringByAppendingPathComponent:contents[index]], fileManager);\n\t\t\t}\n\t\t} else { // regular file\n\t\t\tNSDictionary *attributes = [fileManager attributesOfItemAtPath:path.stringByResolvingSymlinksInPath error:NULL];\n\t\t\tunsigned long long size = [attributes[NSFileSize] unsignedLongLongValue];\n\t\t\t*totalSize += size;\n\t\t\tif (*totalSize > maxTransferSize) {\n\t\t\t\t[NSException raise:@\"Maximum Size Exceeded\" format:@\"Total size of files being transferred exceeds the maximum allowed.\"];\n\t\t\t}\n\t\t}\n\t}\n}\n\nvoid rfbReceiveRichClipboardRequest(rfbClientPtr cl) {\n\tNSAutoreleasePool *myPool = [[NSAutoreleasePool alloc] init];\n\tint pbChangeCount;\n\tint readLength;\n\tint returnCheck;\n\tchar *newClipboardName=NULL;\n\tchar *newClipboardType=NULL;\n\tNSData *newClipboardNSData=nil;\n\tNSInteger newClipboardDataChangeCount = 0;\n\n\tReadExact(cl, ((char *)&pbChangeCount), 3);\n\tReadExact(cl, ((char *)&pbChangeCount), 4);\n\tpbChangeCount = Swap32IfLE(pbChangeCount);\n\tReadExact(cl, ((char *)&readLength), 4);\n\treadLength = Swap32IfLE(readLength);\n\n\tnewClipboardName = (char *) xalloc(readLength+1);\n\tnewClipboardName[readLength] = 0;\n\tReadExact(cl, newClipboardName, readLength);\n\n\tReadExact(cl, ((char *)&readLength), sizeof(readLength));\n\treadLength = Swap32IfLE(readLength);\n\n\tnewClipboardType = (char *) xalloc(readLength+1);\n\tnewClipboardType[readLength] = 0;\n\treturnCheck = ReadExact(cl, newClipboardType, readLength);\n\n\tif (debugPB)\n\t\tNSLog(@\"Received CB Request [%s] For type: %s\", newClipboardName, newClipboardType);\n\n\tif (returnCheck > 0) {\n\t\tNSPasteboard *thePasteboard = [NSPasteboard pasteboardWithName:[[[NSString alloc] initWithUTF8String:newClipboardName] autorelease]];\n\t\tNSString *theType = [[[NSString alloc] initWithUTF8String:newClipboardType] autorelease];\n\n\t\t// check whether we need to send file contents in place of another type\n\t\tif (([theType isEqualToString:NSFileContentsPboardType] && ![thePasteboard.types containsObject:NSFileContentsPboardType])\n\t\t\t|| (([theType isEqualToString:NSFilenamesPboardType] || [theType isEqualToString:NSURLPboardType] || [theType isEqualToString:CorePasteboardFlavor_furl]) && pasteboardRepresentsExistingFile(thePasteboard))) {\n\t\t\tNSFileManager *fileManager = [NSFileManager defaultManager];\n\t\t\tNSArray *pboardTypes = thePasteboard.types;\n\t\t\tNSFileWrapper *theWrapper = nil;\n\t\t\tunsigned long long totalSize = 0;\n\n\t\t\tNS_DURING {\n\t\t\t\tif ([pboardTypes containsObject:NSFilenamesPboardType] || [pboardTypes containsObject:CorePasteboardFlavor_flst]) { // unless URL requested, try file names first\n\t\t\t\t\tNSArray *fileNames = [thePasteboard propertyListForType:NSFilenamesPboardType];\n\t\t\t\t\tif (!fileNames) {\n\t\t\t\t\t\tfileNames = getListOfFilenamesFromPasteboard(thePasteboard);\n\t\t\t\t\t\tif (debugPB)\n\t\t\t\t\t\t\tNSLog(@\"flst list to Send CB Data for filenames: %@\", fileNames);\n\t\t\t\t\t}\n\t\t\t\t\tif (fileNames.count == 1) {\n\t\t\t\t\t\tNSString *path = fileNames[0];\n\t\t\t\t\t\tcheckTotalSize(&totalSize, path, fileManager);\n\t\t\t\t\t\ttheWrapper = [[[NSFileWrapper alloc] initWithPath:path] autorelease];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tint index;\n\t\t\t\t\t\tNSMutableDictionary *wrappers = [NSMutableDictionary dictionary];\n\t\t\t\t\t\tfor (index = 0; index < fileNames.count; index++) {\n\t\t\t\t\t\t\tNSString *path = fileNames[index];\n\t\t\t\t\t\t\tif ([fileManager fileExistsAtPath:path]) {\n\t\t\t\t\t\t\t\tNSFileWrapper *wrapper = [[[NSFileWrapper alloc] initWithPath:path] autorelease];\n\t\t\t\t\t\t\t\tcheckTotalSize(&totalSize, path, fileManager);\n\t\t\t\t\t\t\t\tif (wrapper)\n\t\t\t\t\t\t\t\t\twrappers[path] = wrapper;\n\t\t\t\t\t\t\t\telse // Could possibly put a \"dummy file\" in place indicating the error\n\t\t\t\t\t\t\t\t\tNSLog(@\"Error Unable To Read File:%@\", path);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttheWrapper = [[[NSFileWrapper alloc] initDirectoryWithFileWrappers:wrappers] autorelease];\n\t\t\t\t\t\ttheWrapper.filename = @\"<Redstone set of files>\";\n\t\t\t\t\t\ttheWrapper.preferredFilename = @\"<Redstone set of files>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!theWrapper) { // try for a URL next\n\t\t\t\t\tNSURL *theUrl = [NSURL URLFromPasteboard:thePasteboard];\n\t\t\t\t\tif (theUrl.fileURL) { // only do this for file: url's\n\t\t\t\t\t\tNSString *path = theUrl.path;\n\t\t\t\t\t\tif ([fileManager fileExistsAtPath:path]) {\n\t\t\t\t\t\t\tcheckTotalSize(&totalSize, path, fileManager);\n\t\t\t\t\t\t\ttheWrapper = [[[NSFileWrapper alloc] initWithPath:path] autorelease];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (theWrapper) { // finish setting up the wrapper\n\t\t\t\t\ttheType = [@\"RSFileWrapper:\" stringByAppendingString:theType];\n\t\t\t\t\tnewClipboardNSData = [theWrapper.serializedRepresentation retain];\n\t\t\t\t\tnewClipboardDataChangeCount = thePasteboard.changeCount;\n\t\t\t\t\tconst char *newTypeStr = theType.UTF8String;\n\t\t\t\t\txfree(newClipboardType);\n\t\t\t\t\tnewClipboardType = (char *) xalloc(strlen(newTypeStr)+1);\n\t\t\t\t\tstrcpy(newClipboardType, newTypeStr);\n\t\t\t\t}\n\t\t\t};\n\t\t\tNS_HANDLER {\n\t\t\t\tnewClipboardDataChangeCount = -1; // Indicate an Error\n\t\t\t\tnewClipboardNSData = [[[NSString stringWithFormat:@\"Unable to copy files - %@\", localException] dataUsingEncoding:NSUTF8StringEncoding] retain];\n\t\t\t};\n\t\t\tNS_ENDHANDLER\n\n\t\t}\n\n\t\tif (!newClipboardNSData) {\n\t\t\tnewClipboardNSData = [[thePasteboard dataForType:theType] retain];\n\t\t\tnewClipboardDataChangeCount = thePasteboard.changeCount;\n\t\t\tif (!newClipboardNSData && [theType isEqualToString:CorePasteboardFlavor_fccc]) { // 10.3 \"Copy\" Code\n\t\t\t\tnewClipboardNSData = [[@\"copy\" dataUsingEncoding:NSUTF8StringEncoding] retain];\n\t\t\t}\n\t\t}\n\n\t\tif (!newClipboardNSData || pbChangeCount >= 0) {\n\t\t\tnewClipboardDataChangeCount = -1; // Indicate an Error\n\t\t\tnewClipboardNSData = [[@\"Clipboard Data Unavailable\" dataUsingEncoding:NSUTF8StringEncoding] retain];\n\t\t}\n\n\t\t// Wait for the send thread to send pending data out (if the client goes away, so does this thread)\n\t\twhile (cl->richClipboardNSData) {\n\t\t\tusleep(.1*1000000);\n\t\t}\n\n\t\t//Here we protect access to cl->rfbRichClipboard vars\n\t\tpthread_mutex_lock(&cl->updateMutex);\n\n\t\tif (cl->richClipboardName)\n\t\t\txfree(cl->richClipboardName);\n\t\tcl->richClipboardName = newClipboardName;\n\n\t\tif (cl->richClipboardType)\n\t\t\txfree(cl->richClipboardType);\n\t\tcl->richClipboardType = newClipboardType;\n\n\t\t// [(id)cl->richClipboardNSData release];\n\t\tcl->richClipboardNSData = newClipboardNSData;\n\t\tcl->richClipboardDataChangeCount = newClipboardDataChangeCount;\n\n\t\t// Should we note if the ChangeCount is > than our recorded value here?\n\t\tpthread_mutex_unlock(&cl->updateMutex);\n\t\tpthread_cond_signal(&cl->updateCond);\n\t}\n\telse {\n\t\tif (returnCheck != 0)\n\t\t\trfbLogPerror(\"rfbReceiveRichClipboardDataRequest: read\");\n\t\trfbCloseClient(cl);\n\t}\n\n\t[myPool release];\n\n\treturn;\n}\n\nvoid rfbReceiveRichClipboardData(rfbClientPtr cl) {\n\tNSAutoreleasePool *myPool = [[NSAutoreleasePool alloc] init];\n\tint readLength;\n\tint returnCheck;\n\tint changeCount;\n\tchar *readString;\n\n\tReadExact(cl, ((char *)&changeCount), 3); // Padding\n\tReadExact(cl, ((char *)&changeCount), 4); // Change Count\n\n\t// Pasteboard Name\n\tReadExact(cl, ((char *)&readLength), 4);\n\treadLength = Swap32IfLE(readLength);\n\treadString = (char *) xalloc(readLength+1);\n\treadString[readLength] = 0;\n\tReadExact(cl, readString, readLength);\n\txfree(readString);\n\n\t// Pasteboard Type\n\tReadExact(cl, ((char *)&readLength), sizeof(readLength));\n\treadLength = Swap32IfLE(readLength);\n\treadString = (char *) xalloc(readLength+1);\n\treadString[readLength] = 0;\n\tReadExact(cl, readString, readLength);\n\n\t// Read Data\n\tReadExact(cl, ((char *)&readLength), sizeof(readLength));\n\treadLength = Swap32IfLE(readLength);\n\tNSMutableData *data = [[NSMutableData alloc] initWithLength:readLength];\n\treturnCheck = ReadExact(cl, data.mutableBytes, readLength);\n\n\tif (returnCheck > 0) {\n\t\tif (debugPB)\n\t\t\tNSLog(@\"Received CB Data [%@] Type: %s Length: %d bytes\", cl->richClipboardReceivedName, readString, readLength);\n\t\tpthread_mutex_lock(&cl->updateMutex);\n\t\tcl->richClipboardReceivedChangeCount = Swap32IfLE(changeCount);\n\t\tcl->richClipboardReceivedType = [@(readString) retain];\n\t\tcl->richClipboardReceivedNSData = data;\n\t\tpthread_mutex_unlock(&cl->updateMutex);\n\t}\n\telse {\n\t\tif (returnCheck != 0)\n\t\t\trfbLogPerror(\"rfbReceiveRichClipboardDataRequest: read\");\n\t\trfbCloseClient(cl);\n\t}\n\n\txfree(readString);\n\t[myPool release];\n}\n"
  },
  {
    "path": "OSXvnc-server/d3des.c",
    "content": "/*\n * This is D3DES (V5.09) by Richard Outerbridge with the double and\n * triple-length support removed for use in VNC.  Also the bytebit[] array\n * has been reversed so that the most significant bit in each byte of the\n * key is ignored, not the least significant.\n *\n * These changes are:\n *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n */\n\n/* D3DES (V5.09) -\n *\n * A portable, public domain, version of the Data Encryption Standard.\n *\n * Written with Symantec's THINK (Lightspeed) C by Richard Outerbridge.\n * Thanks to: Dan Hoey for his excellent Initial and Inverse permutation\n * code;  Jim Gillogly & Phil Karn for the DES key schedule code; Dennis\n * Ferguson, Eric Young and Dana How for comparing notes; and Ray Lau,\n * for humouring me on.\n *\n * Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge.\n * (GEnie : OUTER; CIS : [71755,204]) Graven Imagery, 1992.\n */\n\n#include \"d3des.h\"\n\nstatic void scrunch(unsigned char *, unsigned long *);\nstatic void unscrun(unsigned long *, unsigned char *);\nstatic void desfunc(unsigned long *, unsigned long *);\nstatic void cookey(unsigned long *);\n\nstatic unsigned long KnL[32] = { 0L };\n\nstatic const unsigned short bytebit[8]\t= {\n\t01, 02, 04, 010, 020, 040, 0100, 0200 };\n\nstatic const unsigned long bigbyte[24] = {\n\t0x800000L,\t0x400000L,\t0x200000L,\t0x100000L,\n\t0x80000L,\t0x40000L,\t0x20000L,\t0x10000L,\n\t0x8000L,\t0x4000L,\t0x2000L,\t0x1000L,\n\t0x800L, \t0x400L, \t0x200L, \t0x100L,\n\t0x80L,\t\t0x40L,\t\t0x20L,\t\t0x10L,\n\t0x8L,\t\t0x4L,\t\t0x2L,\t\t0x1L\t};\n\n/* Use the key schedule specified in the Standard (ANSI X3.92-1981). */\n\nstatic const unsigned char pc1[56] = {\n\t56, 48, 40, 32, 24, 16,  8,\t 0, 57, 49, 41, 33, 25, 17,\n\t 9,  1, 58, 50, 42, 34, 26,\t18, 10,  2, 59, 51, 43, 35,\n\t62, 54, 46, 38, 30, 22, 14,\t 6, 61, 53, 45, 37, 29, 21,\n\t13,  5, 60, 52, 44, 36, 28,\t20, 12,  4, 27, 19, 11,  3 };\n\nstatic const unsigned char totrot[16] = {\n\t1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28 };\n\nstatic const unsigned char pc2[48] = {\n\t13, 16, 10, 23,  0,  4,  2, 27, 14,  5, 20,  9,\n\t22, 18, 11,  3, 25,  7, 15,  6, 26, 19, 12,  1,\n\t40, 51, 30, 36, 46, 54, 29, 39, 50, 44, 32, 47,\n\t43, 48, 38, 55, 33, 52, 45, 41, 49, 35, 28, 31 };\n\nvoid deskey(unsigned char *key, int edf)\n/* Thanks to James Gillogly & Phil Karn! */\n{\n\tregister int i, j, l, m, n;\n\tunsigned char pc1m[56], pcr[56];\n\tunsigned long kn[32];\n\n\tfor ( j = 0; j < 56; j++ ) {\n\t\tl = pc1[j];\n\t\tm = l & 07;\n\t\tpc1m[j] = (key[l >> 3] & bytebit[m]) ? 1 : 0;\n\t\t}\n\tfor( i = 0; i < 16; i++ ) {\n\t\tif( edf == DE1 ) m = (15 - i) << 1;\n\t\telse m = i << 1;\n\t\tn = m + 1;\n\t\tkn[m] = kn[n] = 0L;\n\t\tfor( j = 0; j < 28; j++ ) {\n\t\t\tl = j + totrot[i];\n\t\t\tif( l < 28 ) pcr[j] = pc1m[l];\n\t\t\telse pcr[j] = pc1m[l - 28];\n\t\t\t}\n\t\tfor( j = 28; j < 56; j++ ) {\n\t\t    l = j + totrot[i];\n\t\t    if( l < 56 ) pcr[j] = pc1m[l];\n\t\t    else pcr[j] = pc1m[l - 28];\n\t\t    }\n\t\tfor( j = 0; j < 24; j++ ) {\n\t\t\tif( pcr[pc2[j]] ) kn[m] |= bigbyte[j];\n\t\t\tif( pcr[pc2[j+24]] ) kn[n] |= bigbyte[j];\n\t\t\t}\n\t\t}\n\tcookey(kn);\n\treturn;\n\t}\n\nstatic void cookey(unsigned long *raw1)\n{\n\tregister unsigned long *cook, *raw0;\n\tunsigned long dough[32];\n\tregister int i;\n\n\tcook = dough;\n\tfor( i = 0; i < 16; i++, raw1++ ) {\n\t\traw0 = raw1++;\n\t\t*cook\t = (*raw0 & 0x00fc0000L) << 6;\n\t\t*cook\t|= (*raw0 & 0x00000fc0L) << 10;\n\t\t*cook\t|= (*raw1 & 0x00fc0000L) >> 10;\n\t\t*cook++ |= (*raw1 & 0x00000fc0L) >> 6;\n\t\t*cook\t = (*raw0 & 0x0003f000L) << 12;\n\t\t*cook\t|= (*raw0 & 0x0000003fL) << 16;\n\t\t*cook\t|= (*raw1 & 0x0003f000L) >> 4;\n\t\t*cook++ |= (*raw1 & 0x0000003fL);\n\t\t}\n\tusekey(dough);\n\treturn;\n\t}\n\nvoid cpkey(unsigned long *into)\n{\n    unsigned long *from = KnL;\n    unsigned long *endp = &KnL[32];\n    while (from < endp) {\n        *into++ = *from++;\n    }\n}\n\nvoid usekey(unsigned long *from)\n{\n    unsigned long *to = KnL;\n    unsigned long *endp = &KnL[32];\n\n    while (to < endp) {\n        *to++ = *from++;\n    }\n}\n\nvoid des(unsigned char *inblock, unsigned char *outblock)\n{\n\tunsigned long work[2];\n\n\tscrunch(inblock, work);\n\tdesfunc(work, KnL);\n\tunscrun(work, outblock);\n}\n\nstatic void scrunch(unsigned char *outof, unsigned long *into)\n{\n\t*into\t = (*outof++ & 0xffL) << 24;\n\t*into\t|= (*outof++ & 0xffL) << 16;\n\t*into\t|= (*outof++ & 0xffL) << 8;\n\t*into++ |= (*outof++ & 0xffL);\n\t*into\t = (*outof++ & 0xffL) << 24;\n\t*into\t|= (*outof++ & 0xffL) << 16;\n\t*into\t|= (*outof++ & 0xffL) << 8;\n\t*into\t|= (*outof   & 0xffL);\n\treturn;\n\t}\n\nstatic void unscrun(unsigned long *outof, unsigned char *into)\n{\n\t*into++ = (*outof >> 24) & 0xffL;\n\t*into++ = (*outof >> 16) & 0xffL;\n\t*into++ = (*outof >>  8) & 0xffL;\n\t*into++ =  *outof++\t & 0xffL;\n\t*into++ = (*outof >> 24) & 0xffL;\n\t*into++ = (*outof >> 16) & 0xffL;\n\t*into++ = (*outof >>  8) & 0xffL;\n\t*into\t=  *outof\t & 0xffL;\n\treturn;\n\t}\n\nstatic unsigned long SP1[64] = {\n\t0x01010400L, 0x00000000L, 0x00010000L, 0x01010404L,\n\t0x01010004L, 0x00010404L, 0x00000004L, 0x00010000L,\n\t0x00000400L, 0x01010400L, 0x01010404L, 0x00000400L,\n\t0x01000404L, 0x01010004L, 0x01000000L, 0x00000004L,\n\t0x00000404L, 0x01000400L, 0x01000400L, 0x00010400L,\n\t0x00010400L, 0x01010000L, 0x01010000L, 0x01000404L,\n\t0x00010004L, 0x01000004L, 0x01000004L, 0x00010004L,\n\t0x00000000L, 0x00000404L, 0x00010404L, 0x01000000L,\n\t0x00010000L, 0x01010404L, 0x00000004L, 0x01010000L,\n\t0x01010400L, 0x01000000L, 0x01000000L, 0x00000400L,\n\t0x01010004L, 0x00010000L, 0x00010400L, 0x01000004L,\n\t0x00000400L, 0x00000004L, 0x01000404L, 0x00010404L,\n\t0x01010404L, 0x00010004L, 0x01010000L, 0x01000404L,\n\t0x01000004L, 0x00000404L, 0x00010404L, 0x01010400L,\n\t0x00000404L, 0x01000400L, 0x01000400L, 0x00000000L,\n\t0x00010004L, 0x00010400L, 0x00000000L, 0x01010004L };\n\nstatic unsigned long SP2[64] = {\n\t0x80108020L, 0x80008000L, 0x00008000L, 0x00108020L,\n\t0x00100000L, 0x00000020L, 0x80100020L, 0x80008020L,\n\t0x80000020L, 0x80108020L, 0x80108000L, 0x80000000L,\n\t0x80008000L, 0x00100000L, 0x00000020L, 0x80100020L,\n\t0x00108000L, 0x00100020L, 0x80008020L, 0x00000000L,\n\t0x80000000L, 0x00008000L, 0x00108020L, 0x80100000L,\n\t0x00100020L, 0x80000020L, 0x00000000L, 0x00108000L,\n\t0x00008020L, 0x80108000L, 0x80100000L, 0x00008020L,\n\t0x00000000L, 0x00108020L, 0x80100020L, 0x00100000L,\n\t0x80008020L, 0x80100000L, 0x80108000L, 0x00008000L,\n\t0x80100000L, 0x80008000L, 0x00000020L, 0x80108020L,\n\t0x00108020L, 0x00000020L, 0x00008000L, 0x80000000L,\n\t0x00008020L, 0x80108000L, 0x00100000L, 0x80000020L,\n\t0x00100020L, 0x80008020L, 0x80000020L, 0x00100020L,\n\t0x00108000L, 0x00000000L, 0x80008000L, 0x00008020L,\n\t0x80000000L, 0x80100020L, 0x80108020L, 0x00108000L };\n\nstatic unsigned long SP3[64] = {\n\t0x00000208L, 0x08020200L, 0x00000000L, 0x08020008L,\n\t0x08000200L, 0x00000000L, 0x00020208L, 0x08000200L,\n\t0x00020008L, 0x08000008L, 0x08000008L, 0x00020000L,\n\t0x08020208L, 0x00020008L, 0x08020000L, 0x00000208L,\n\t0x08000000L, 0x00000008L, 0x08020200L, 0x00000200L,\n\t0x00020200L, 0x08020000L, 0x08020008L, 0x00020208L,\n\t0x08000208L, 0x00020200L, 0x00020000L, 0x08000208L,\n\t0x00000008L, 0x08020208L, 0x00000200L, 0x08000000L,\n\t0x08020200L, 0x08000000L, 0x00020008L, 0x00000208L,\n\t0x00020000L, 0x08020200L, 0x08000200L, 0x00000000L,\n\t0x00000200L, 0x00020008L, 0x08020208L, 0x08000200L,\n\t0x08000008L, 0x00000200L, 0x00000000L, 0x08020008L,\n\t0x08000208L, 0x00020000L, 0x08000000L, 0x08020208L,\n\t0x00000008L, 0x00020208L, 0x00020200L, 0x08000008L,\n\t0x08020000L, 0x08000208L, 0x00000208L, 0x08020000L,\n\t0x00020208L, 0x00000008L, 0x08020008L, 0x00020200L };\n\nstatic unsigned long SP4[64] = {\n\t0x00802001L, 0x00002081L, 0x00002081L, 0x00000080L,\n\t0x00802080L, 0x00800081L, 0x00800001L, 0x00002001L,\n\t0x00000000L, 0x00802000L, 0x00802000L, 0x00802081L,\n\t0x00000081L, 0x00000000L, 0x00800080L, 0x00800001L,\n\t0x00000001L, 0x00002000L, 0x00800000L, 0x00802001L,\n\t0x00000080L, 0x00800000L, 0x00002001L, 0x00002080L,\n\t0x00800081L, 0x00000001L, 0x00002080L, 0x00800080L,\n\t0x00002000L, 0x00802080L, 0x00802081L, 0x00000081L,\n\t0x00800080L, 0x00800001L, 0x00802000L, 0x00802081L,\n\t0x00000081L, 0x00000000L, 0x00000000L, 0x00802000L,\n\t0x00002080L, 0x00800080L, 0x00800081L, 0x00000001L,\n\t0x00802001L, 0x00002081L, 0x00002081L, 0x00000080L,\n\t0x00802081L, 0x00000081L, 0x00000001L, 0x00002000L,\n\t0x00800001L, 0x00002001L, 0x00802080L, 0x00800081L,\n\t0x00002001L, 0x00002080L, 0x00800000L, 0x00802001L,\n\t0x00000080L, 0x00800000L, 0x00002000L, 0x00802080L };\n\nstatic unsigned long SP5[64] = {\n\t0x00000100L, 0x02080100L, 0x02080000L, 0x42000100L,\n\t0x00080000L, 0x00000100L, 0x40000000L, 0x02080000L,\n\t0x40080100L, 0x00080000L, 0x02000100L, 0x40080100L,\n\t0x42000100L, 0x42080000L, 0x00080100L, 0x40000000L,\n\t0x02000000L, 0x40080000L, 0x40080000L, 0x00000000L,\n\t0x40000100L, 0x42080100L, 0x42080100L, 0x02000100L,\n\t0x42080000L, 0x40000100L, 0x00000000L, 0x42000000L,\n\t0x02080100L, 0x02000000L, 0x42000000L, 0x00080100L,\n\t0x00080000L, 0x42000100L, 0x00000100L, 0x02000000L,\n\t0x40000000L, 0x02080000L, 0x42000100L, 0x40080100L,\n\t0x02000100L, 0x40000000L, 0x42080000L, 0x02080100L,\n\t0x40080100L, 0x00000100L, 0x02000000L, 0x42080000L,\n\t0x42080100L, 0x00080100L, 0x42000000L, 0x42080100L,\n\t0x02080000L, 0x00000000L, 0x40080000L, 0x42000000L,\n\t0x00080100L, 0x02000100L, 0x40000100L, 0x00080000L,\n\t0x00000000L, 0x40080000L, 0x02080100L, 0x40000100L };\n\nstatic unsigned long SP6[64] = {\n\t0x20000010L, 0x20400000L, 0x00004000L, 0x20404010L,\n\t0x20400000L, 0x00000010L, 0x20404010L, 0x00400000L,\n\t0x20004000L, 0x00404010L, 0x00400000L, 0x20000010L,\n\t0x00400010L, 0x20004000L, 0x20000000L, 0x00004010L,\n\t0x00000000L, 0x00400010L, 0x20004010L, 0x00004000L,\n\t0x00404000L, 0x20004010L, 0x00000010L, 0x20400010L,\n\t0x20400010L, 0x00000000L, 0x00404010L, 0x20404000L,\n\t0x00004010L, 0x00404000L, 0x20404000L, 0x20000000L,\n\t0x20004000L, 0x00000010L, 0x20400010L, 0x00404000L,\n\t0x20404010L, 0x00400000L, 0x00004010L, 0x20000010L,\n\t0x00400000L, 0x20004000L, 0x20000000L, 0x00004010L,\n\t0x20000010L, 0x20404010L, 0x00404000L, 0x20400000L,\n\t0x00404010L, 0x20404000L, 0x00000000L, 0x20400010L,\n\t0x00000010L, 0x00004000L, 0x20400000L, 0x00404010L,\n\t0x00004000L, 0x00400010L, 0x20004010L, 0x00000000L,\n\t0x20404000L, 0x20000000L, 0x00400010L, 0x20004010L };\n\nstatic unsigned long SP7[64] = {\n\t0x00200000L, 0x04200002L, 0x04000802L, 0x00000000L,\n\t0x00000800L, 0x04000802L, 0x00200802L, 0x04200800L,\n\t0x04200802L, 0x00200000L, 0x00000000L, 0x04000002L,\n\t0x00000002L, 0x04000000L, 0x04200002L, 0x00000802L,\n\t0x04000800L, 0x00200802L, 0x00200002L, 0x04000800L,\n\t0x04000002L, 0x04200000L, 0x04200800L, 0x00200002L,\n\t0x04200000L, 0x00000800L, 0x00000802L, 0x04200802L,\n\t0x00200800L, 0x00000002L, 0x04000000L, 0x00200800L,\n\t0x04000000L, 0x00200800L, 0x00200000L, 0x04000802L,\n\t0x04000802L, 0x04200002L, 0x04200002L, 0x00000002L,\n\t0x00200002L, 0x04000000L, 0x04000800L, 0x00200000L,\n\t0x04200800L, 0x00000802L, 0x00200802L, 0x04200800L,\n\t0x00000802L, 0x04000002L, 0x04200802L, 0x04200000L,\n\t0x00200800L, 0x00000000L, 0x00000002L, 0x04200802L,\n\t0x00000000L, 0x00200802L, 0x04200000L, 0x00000800L,\n\t0x04000002L, 0x04000800L, 0x00000800L, 0x00200002L };\n\nstatic unsigned long SP8[64] = {\n\t0x10001040L, 0x00001000L, 0x00040000L, 0x10041040L,\n\t0x10000000L, 0x10001040L, 0x00000040L, 0x10000000L,\n\t0x00040040L, 0x10040000L, 0x10041040L, 0x00041000L,\n\t0x10041000L, 0x00041040L, 0x00001000L, 0x00000040L,\n\t0x10040000L, 0x10000040L, 0x10001000L, 0x00001040L,\n\t0x00041000L, 0x00040040L, 0x10040040L, 0x10041000L,\n\t0x00001040L, 0x00000000L, 0x00000000L, 0x10040040L,\n\t0x10000040L, 0x10001000L, 0x00041040L, 0x00040000L,\n\t0x00041040L, 0x00040000L, 0x10041000L, 0x00001000L,\n\t0x00000040L, 0x10040040L, 0x00001000L, 0x00041040L,\n\t0x10001000L, 0x00000040L, 0x10000040L, 0x10040000L,\n\t0x10040040L, 0x10000000L, 0x00040000L, 0x10001040L,\n\t0x00000000L, 0x10041040L, 0x00040040L, 0x10000040L,\n\t0x10040000L, 0x10001000L, 0x10001040L, 0x00000000L,\n\t0x10041040L, 0x00041000L, 0x00041000L, 0x00001040L,\n\t0x00001040L, 0x00040040L, 0x10000000L, 0x10041000L };\n\nstatic void desfunc(unsigned long *block, unsigned long *keys)\n{\n\tregister unsigned long fval, work, right, leftt;\n\tregister int round;\n\n\tleftt = block[0];\n\tright = block[1];\n\twork = ((leftt >> 4) ^ right) & 0x0f0f0f0fL;\n\tright ^= work;\n\tleftt ^= (work << 4);\n\twork = ((leftt >> 16) ^ right) & 0x0000ffffL;\n\tright ^= work;\n\tleftt ^= (work << 16);\n\twork = ((right >> 2) ^ leftt) & 0x33333333L;\n\tleftt ^= work;\n\tright ^= (work << 2);\n\twork = ((right >> 8) ^ leftt) & 0x00ff00ffL;\n\tleftt ^= work;\n\tright ^= (work << 8);\n\tright = ((right << 1) | ((right >> 31) & 1L)) & 0xffffffffL;\n\twork = (leftt ^ right) & 0xaaaaaaaaL;\n\tleftt ^= work;\n\tright ^= work;\n\tleftt = ((leftt << 1) | ((leftt >> 31) & 1L)) & 0xffffffffL;\n\n\tfor( round = 0; round < 8; round++ ) {\n\t\twork  = (right << 28) | (right >> 4);\n\t\twork ^= *keys++;\n\t\tfval  = SP7[ work\t\t & 0x3fL];\n\t\tfval |= SP5[(work >>  8) & 0x3fL];\n\t\tfval |= SP3[(work >> 16) & 0x3fL];\n\t\tfval |= SP1[(work >> 24) & 0x3fL];\n\t\twork  = right ^ *keys++;\n\t\tfval |= SP8[ work\t\t & 0x3fL];\n\t\tfval |= SP6[(work >>  8) & 0x3fL];\n\t\tfval |= SP4[(work >> 16) & 0x3fL];\n\t\tfval |= SP2[(work >> 24) & 0x3fL];\n\t\tleftt ^= fval;\n\t\twork  = (leftt << 28) | (leftt >> 4);\n\t\twork ^= *keys++;\n\t\tfval  = SP7[ work\t\t & 0x3fL];\n\t\tfval |= SP5[(work >>  8) & 0x3fL];\n\t\tfval |= SP3[(work >> 16) & 0x3fL];\n\t\tfval |= SP1[(work >> 24) & 0x3fL];\n\t\twork  = leftt ^ *keys++;\n\t\tfval |= SP8[ work\t\t & 0x3fL];\n\t\tfval |= SP6[(work >>  8) & 0x3fL];\n\t\tfval |= SP4[(work >> 16) & 0x3fL];\n\t\tfval |= SP2[(work >> 24) & 0x3fL];\n\t\tright ^= fval;\n\t\t}\n\n\tright = (right << 31) | (right >> 1);\n\twork = (leftt ^ right) & 0xaaaaaaaaL;\n\tleftt ^= work;\n\tright ^= work;\n\tleftt = (leftt << 31) | (leftt >> 1);\n\twork = ((leftt >> 8) ^ right) & 0x00ff00ffL;\n\tright ^= work;\n\tleftt ^= (work << 8);\n\twork = ((leftt >> 2) ^ right) & 0x33333333L;\n\tright ^= work;\n\tleftt ^= (work << 2);\n\twork = ((right >> 16) ^ leftt) & 0x0000ffffL;\n\tleftt ^= work;\n\tright ^= (work << 16);\n\twork = ((right >> 4) ^ leftt) & 0x0f0f0f0fL;\n\tleftt ^= work;\n\tright ^= (work << 4);\n\t*block++ = right;\n\t*block = leftt;\n\treturn;\n\t}\n\n/* Validation sets:\n *\n * Single-length key, single-length plaintext -\n * Key\t  : 0123 4567 89ab cdef\n * Plain  : 0123 4567 89ab cde7\n * Cipher : c957 4425 6a5e d31d\n *\n * Double-length key, single-length plaintext -\n * Key\t  : 0123 4567 89ab cdef fedc ba98 7654 3210\n * Plain  : 0123 4567 89ab cde7\n * Cipher : 7f1d 0a77 826b 8aff\n *\n * Double-length key, double-length plaintext -\n * Key\t  : 0123 4567 89ab cdef fedc ba98 7654 3210\n * Plain  : 0123 4567 89ab cdef 0123 4567 89ab cdff\n * Cipher : 27a0 8440 406a df60 278f 47cf 42d6 15d7\n *\n * Triple-length key, single-length plaintext -\n * Key\t  : 0123 4567 89ab cdef fedc ba98 7654 3210 89ab cdef 0123 4567\n * Plain  : 0123 4567 89ab cde7\n * Cipher : de0b 7c06 ae5e 0ed5\n *\n * Triple-length key, double-length plaintext -\n * Key\t  : 0123 4567 89ab cdef fedc ba98 7654 3210 89ab cdef 0123 4567\n * Plain  : 0123 4567 89ab cdef 0123 4567 89ab cdff\n * Cipher : ad0d 1b30 ac17 cf07 0ed1 1c63 81e4 4de5\n *\n * d3des V5.0a rwo 9208.07 18:44 Graven Imagery\n **********************************************************************/\n"
  },
  {
    "path": "OSXvnc-server/d3des.h",
    "content": "/*\n * This is D3DES (V5.09) by Richard Outerbridge with the double and\n * triple-length support removed for use in VNC.\n *\n * These changes are:\n *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n */\n\n/* d3des.h -\n *\n *\tHeaders and defines for d3des.c\n *\tGraven Imagery, 1992.\n *\n * Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge\n *\t(GEnie : OUTER; CIS : [71755,204])\n */\n\n#define EN0\t0\t/* MODE == encrypt */\n#define DE1\t1\t/* MODE == decrypt */\n\nextern void deskey(unsigned char *, int);\n/*\t\t      hexkey[8]     MODE\n * Sets the internal key register according to the hexadecimal\n * key contained in the 8 bytes of hexkey, according to the DES,\n * for encryption or decryption according to MODE.\n */\n\nextern void usekey(unsigned long *);\n/*\t\t    cookedkey[32]\n * Loads the internal key register with the data in cookedkey.\n */\n\nextern void cpkey(unsigned long *);\n/*\t\t   cookedkey[32]\n * Copies the contents of the internal key register into the storage\n * located at &cookedkey[0].\n */\n\nextern void des(unsigned char *, unsigned char *);\n/*\t\t    from[8]\t      to[8]\n * Encrypts/Decrypts (according to the key currently loaded in the\n * internal key register) one block of eight bytes at address 'from'\n * into the block at address 'to'.  They can be the same.\n */\n\n/* d3des.h V5.09 rwo 9208.04 15:06 Graven Imagery\n ********************************************************************/\n"
  },
  {
    "path": "OSXvnc-server/dimming.c",
    "content": "#include <IOKit/pwr_mgt/IOPMLib.h>\n#include <IOKit/pwr_mgt/IOPM.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <signal.h>\n#include <pthread.h>\n\n#include <Carbon/Carbon.h>\n\n#include \"rfb.h\"\n\nBool rfbNoDimming = FALSE;\nBool rfbNoSleep   = TRUE;\nIOPMAssertionID userActivityLastAssertionId;\n\nstatic pthread_mutex_t  dimming_mutex;\nstatic unsigned long    dim_time;\nstatic unsigned long    sleep_time;\nstatic mach_port_t      master_dev_port;\nstatic io_connect_t     power_mgt;\nstatic Bool initialized            = FALSE;\nstatic Bool dim_time_saved         = FALSE;\nstatic Bool sleep_time_saved       = FALSE;\n\n// OSXvnc 0.8 - Disable ScreenSaver\nvoid rfbScreensaverTimer(EventLoopTimerRef timer, void *userData)\n{\n#pragma unused (timer, userData)\n    if (rfbNoSleep && rfbClientsConnected()) {\n        UpdateSystemActivity(IdleActivity);\n        // UpdateSystemActivity's seeming replacement:\n        IOPMAssertionDeclareUserActivity(CFSTR(\"VNC user is logged in\"), kIOPMUserActiveLocal, &userActivityLastAssertionId);\n    }\n}\n\nstatic int\nsaveDimSettings(void)\n{\n    if (IOPMGetAggressiveness(power_mgt,\n                              kPMMinutesToDim,\n                              &dim_time) != kIOReturnSuccess)\n        return -1;\n\n    dim_time_saved = TRUE;\n    return 0;\n}\n\nstatic int\nrestoreDimSettings(void)\n{\n    if (!dim_time_saved)\n        return -1;\n\n    if (IOPMSetAggressiveness(power_mgt,\n                              kPMMinutesToDim,\n                              dim_time) != kIOReturnSuccess)\n        return -1;\n\n    dim_time_saved = FALSE;\n    dim_time = 0;\n    return 0;\n}\n\nstatic int\nsaveSleepSettings(void)\n{\n    if (IOPMGetAggressiveness(power_mgt,\n                              kPMMinutesToSleep,\n                              &sleep_time) != kIOReturnSuccess)\n        return -1;\n\n    sleep_time_saved = TRUE;\n    return 0;\n}\n\nstatic int\nrestoreSleepSettings(void)\n{\n    if (!sleep_time_saved)\n        return -1;\n\n    if (IOPMSetAggressiveness(power_mgt,\n                              kPMMinutesToSleep,\n                              sleep_time) != kIOReturnSuccess)\n        return -1;\n\n    sleep_time_saved = FALSE;\n    sleep_time = 0;\n    return 0;\n}\n\n\nint\nrfbDimmingInit(void)\n{\n    pthread_mutex_init(&dimming_mutex, NULL);\n\n    if (IOMasterPort(bootstrap_port, &master_dev_port) != kIOReturnSuccess)\n        return -1;\n\n    if (!(power_mgt = IOPMFindPowerManagement(master_dev_port)))\n        return -1;\n\n    if (rfbNoDimming) {\n        if (saveDimSettings() < 0)\n            return -1;\n        if (IOPMSetAggressiveness(power_mgt,\n                                  kPMMinutesToDim, 0) != kIOReturnSuccess)\n            return -1;\n    }\n\n    if (rfbNoSleep) {\n        if (saveSleepSettings() < 0)\n            return -1;\n        if (IOPMSetAggressiveness(power_mgt,\n                                  kPMMinutesToSleep, 0) != kIOReturnSuccess)\n            return -1;\n    }\n\n    initialized = TRUE;\n    return 0;\n}\n\n\nint\nrfbUndim(void)\n{\n    int result = -1;\n\n    pthread_mutex_lock(&dimming_mutex);\n\n    if (!initialized)\n        goto DONE;\n\n    if (!rfbNoDimming) {\n        if (saveDimSettings() < 0)\n            goto DONE;\n        if (IOPMSetAggressiveness(power_mgt, kPMMinutesToDim, 0) != kIOReturnSuccess)\n            goto DONE;\n        if (restoreDimSettings() < 0)\n            goto DONE;\n    }\n\n    if (!rfbNoSleep) {\n        if (saveSleepSettings() < 0)\n            goto DONE;\n        if (IOPMSetAggressiveness(power_mgt, kPMMinutesToSleep, 0) != kIOReturnSuccess)\n            goto DONE;\n        if (restoreSleepSettings() < 0)\n            goto DONE;\n    }\n\n    result = 0;\n\n DONE:\n    pthread_mutex_unlock(&dimming_mutex);\n    return result;\n}\n\n\nint\nrfbDimmingShutdown(void)\n{\n    int result = -1;\n\n    if (!initialized)\n        goto DONE;\n\n    pthread_mutex_lock(&dimming_mutex);\n    if (dim_time_saved)\n        if (restoreDimSettings() < 0)\n            goto DONE;\n    if (sleep_time_saved)\n        if (restoreSleepSettings() < 0)\n            goto DONE;\n\n    result = 0;\n\n DONE:\n    pthread_mutex_unlock(&dimming_mutex);\n    return result;\n}\n"
  },
  {
    "path": "OSXvnc-server/getMACAddress.c",
    "content": "/*\n *  getMACAddress.c\n *  Eggplant\n *\n *  Created by Douglas Simons on 11/15/06.\n *  Copyright 2006 Redstone Software, Inc. All rights reserved.\n *\n */\n\n#import \"getMACAddress.h\"\n\n/*\n File:      GetPrimaryMACAddress.c\n\n Description:  This sample application demonstrates how to do retrieve the Ethernet MAC\n address of the built-in Ethernet interface from the I/O Registry on Mac OS X.\n Techniques shown include finding the primary (built-in) Ethernet interface,\n finding the parent Ethernet controller, and retrieving properties from the\n controller's I/O Registry entry.\n\n Copyright:    Copyright 2001-2005 Apple Computer, Inc. All rights reserved.\n\n Disclaimer:    IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc.\n (\"Apple\") in consideration of your agreement to the following terms, and your\n use, installation, modification or redistribution of this Apple software\n constitutes acceptance of these terms.  If you do not agree with these terms,\n please do not use, install, modify or redistribute this Apple software.\n\n In consideration of your agreement to abide by the following terms, and subject\n to these terms, Apple grants you a personal, non-exclusive license, under Apple's\n copyrights in this original Apple software (the \"Apple Software\"), to use,\n reproduce, modify and redistribute the Apple Software, with or without\n modifications, in source and/or binary forms; provided that if you redistribute\n the Apple Software in its entirety and without modifications, you must retain\n this notice and the following text and disclaimers in all such redistributions of\n the Apple Software.  Neither the name, trademarks, service marks or logos of\n Apple Computer, Inc. may be used to endorse or promote products derived from the\n Apple Software without specific prior written permission from Apple.  Except as\n expressly stated in this notice, no other rights or licenses, express or implied,\n are granted by Apple herein, including but not limited to any patent rights that\n may be infringed by your derivative works or by other works in which the Apple\n Software may be incorporated.\n\n The Apple Software is provided by Apple on an \"AS IS\" basis.  APPLE MAKES NO\n WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\n WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN\n COMBINATION WITH YOUR PRODUCTS.\n\n IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\n CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n\t\t\t\t\t\tGOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION\n OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT\n (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN\n ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n Change History (most recent first):\n\n <3>     09/15/05  Updated to produce a universal binary. Use kIOMasterPortDefault\n instead of older IOMasterPort function. Print the MAC address\n to stdout in response to <rdar://problem/4021220>.\n <2>    04/30/02  Fix bug in creating the matching dictionary that caused the\n kIOPrimaryInterface property to be ignored. Clean up comments and add\n additional comments about how IOServiceGetMatchingServices operates.\n <1>     06/07/01  New sample.\n\n */\n\n#include <stdio.h>\n\n#include <CoreFoundation/CoreFoundation.h>\n\n#include <IOKit/IOKitLib.h>\n#include <IOKit/network/IOEthernetInterface.h>\n#include <IOKit/network/IONetworkInterface.h>\n#include <IOKit/network/IOEthernetController.h>\n\nstatic kern_return_t FindEthernetInterfaces(io_iterator_t *matchingServices);\nstatic kern_return_t GetMACAddress(io_iterator_t intfIterator, UInt8 *MACAddress, UInt8 bufferSize);\n\n// Returns an iterator containing the primary (built-in) Ethernet interface. The caller is responsible for\n// releasing the iterator after the caller is done with it.\nstatic kern_return_t FindEthernetInterfaces(io_iterator_t *matchingServices)\n{\n    kern_return_t    kernResult;\n    CFMutableDictionaryRef  matchingDict;\n    CFMutableDictionaryRef  propertyMatchDict;\n\n    // Ethernet interfaces are instances of class kIOEthernetInterfaceClass.\n    // IOServiceMatching is a convenience function to create a dictionary with the key kIOProviderClassKey and\n    // the specified value.\n    matchingDict = IOServiceMatching(kIOEthernetInterfaceClass);\n\n    // Note that another option here would be:\n    // matchingDict = IOBSDMatching(\"en0\");\n\n    if (NULL == matchingDict) {\n        printf(\"IOServiceMatching returned a NULL dictionary.\\n\");\n    }\n    else {\n        // Each IONetworkInterface object has a Boolean property with the key kIOPrimaryInterface. Only the\n        // primary (built-in) interface has this property set to TRUE.\n\n        // IOServiceGetMatchingServices uses the default matching criteria defined by IOService. This considers\n        // only the following properties plus any family-specific matching in this order of precedence\n        // (see IOService::passiveMatch):\n        //\n        // kIOProviderClassKey (IOServiceMatching)\n        // kIONameMatchKey (IOServiceNameMatching)\n        // kIOPropertyMatchKey\n        // kIOPathMatchKey\n        // kIOMatchedServiceCountKey\n        // family-specific matching\n        // kIOBSDNameKey (IOBSDNameMatching)\n        // kIOLocationMatchKey\n\n        // The IONetworkingFamily does not define any family-specific matching. This means that in\n        // order to have IOServiceGetMatchingServices consider the kIOPrimaryInterface property, we must\n        // add that property to a separate dictionary and then add that to our matching dictionary\n        // specifying kIOPropertyMatchKey.\n\n        propertyMatchDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t  &kCFTypeDictionaryKeyCallBacks,\n\t\t\t\t\t\t\t\t\t\t\t\t\t  &kCFTypeDictionaryValueCallBacks);\n\n        if (NULL == propertyMatchDict) {\n            printf(\"CFDictionaryCreateMutable returned a NULL dictionary.\\n\");\n        }\n        else {\n            // Set the value in the dictionary of the property with the given key, or add the key\n            // to the dictionary if it doesn't exist. This call retains the value object passed in.\n            CFDictionarySetValue(propertyMatchDict, CFSTR(kIOPrimaryInterface), kCFBooleanTrue);\n\n            // Now add the dictionary containing the matching value for kIOPrimaryInterface to our main\n            // matching dictionary. This call will retain propertyMatchDict, so we can release our reference\n            // on propertyMatchDict after adding it to matchingDict.\n            CFDictionarySetValue(matchingDict, CFSTR(kIOPropertyMatchKey), propertyMatchDict);\n            CFRelease(propertyMatchDict);\n        }\n    }\n\n    // IOServiceGetMatchingServices retains the returned iterator, so release the iterator when we're done with it.\n    // IOServiceGetMatchingServices also consumes a reference on the matching dictionary so we don't need to release\n    // the dictionary explicitly.\n    kernResult = IOServiceGetMatchingServices(kIOMasterPortDefault, matchingDict, matchingServices);\n    if (KERN_SUCCESS != kernResult) {\n        printf(\"IOServiceGetMatchingServices returned 0x%08x\\n\", kernResult);\n    }\n\n    return kernResult;\n}\n\n// Given an iterator across a set of Ethernet interfaces, return the MAC address of the last one.\n// If no interfaces are found the MAC address is set to an empty string.\n// In this sample the iterator should contain just the primary interface.\nstatic kern_return_t GetMACAddress(io_iterator_t intfIterator, UInt8 *MACAddress, UInt8 bufferSize)\n{\n    io_object_t    intfService;\n    io_object_t    controllerService;\n    kern_return_t  kernResult = KERN_FAILURE;\n\n    // Make sure the caller provided enough buffer space. Protect against buffer overflow problems.\n\tif (bufferSize < kIOEthernetAddressSize) {\n\t\treturn kernResult;\n\t}\n\n\t// Initialize the returned address\n    bzero(MACAddress, bufferSize);\n\n    // IOIteratorNext retains the returned object, so release it when we're done with it.\n    while ((intfService = IOIteratorNext(intfIterator)))\n    {\n        CFTypeRef  MACAddressAsCFData;\n\n        // IONetworkControllers can't be found directly by the IOServiceGetMatchingServices call,\n        // since they are hardware nubs and do not participate in driver matching. In other words,\n        // registerService() is never called on them. So we've found the IONetworkInterface and will\n        // get its parent controller by asking for it specifically.\n\n        // IORegistryEntryGetParentEntry retains the returned object, so release it when we're done with it.\n        kernResult = IORegistryEntryGetParentEntry(intfService,\n\t\t\t\t\t\t\t\t\t\t\t\t   kIOServicePlane,\n\t\t\t\t\t\t\t\t\t\t\t\t   &controllerService);\n\n        if (KERN_SUCCESS != kernResult) {\n            printf(\"IORegistryEntryGetParentEntry returned 0x%08x\\n\", kernResult);\n        }\n        else {\n            // Retrieve the MAC address property from the I/O Registry in the form of a CFData\n            MACAddressAsCFData = IORegistryEntryCreateCFProperty(controllerService,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t CFSTR(kIOMACAddress),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t kCFAllocatorDefault,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 0);\n            if (MACAddressAsCFData) {\n                // CFShow(MACAddressAsCFData); // for display purposes only; output goes to stderr\n\n                // Get the raw bytes of the MAC address from the CFData\n                CFDataGetBytes(MACAddressAsCFData, CFRangeMake(0, kIOEthernetAddressSize), MACAddress);\n                CFRelease(MACAddressAsCFData);\n            }\n\n            // Done with the parent Ethernet controller object so we release it.\n            (void) IOObjectRelease(controllerService);\n        }\n\n        // Done with the Ethernet interface object so we release it.\n        (void) IOObjectRelease(intfService);\n    }\n\n    return kernResult;\n}\n\nNSString *getMACAddressString(void)\n{\n\tstatic NSString *addressString = nil;\n\n\tif (!addressString) {\n\t\tkern_return_t  kernResult = KERN_SUCCESS; // on PowerPC this is an int (4 bytes)\n\t\t/*\n\t\t *  error number layout as follows (see mach/error.h and IOKit/IOReturn.h):\n\t\t *\n\t\t *  hi                lo\n\t\t *  | system(6) | subsystem(12) | code(14) |\n\t\t */\n\n\t\tio_iterator_t  intfIterator;\n\t\tUInt8      MACAddress[kIOEthernetAddressSize];\n\n\t\tkernResult = FindEthernetInterfaces(&intfIterator);\n\n\t\tif (KERN_SUCCESS != kernResult) {\n\t\t\tprintf(\"FindEthernetInterfaces returned 0x%08x\\n\", kernResult);\n\t\t}\n\t\telse {\n\t\t\tkernResult = GetMACAddress(intfIterator, MACAddress, sizeof(MACAddress));\n\n\t\t\tif (KERN_SUCCESS != kernResult) {\n\t\t\t\tprintf(\"GetMACAddress returned 0x%08x\\n\", kernResult);\n\t\t\t}\n\t\t\telse {\n\t\t\t\taddressString = [[NSString alloc] initWithFormat:@\"%02x:%02x:%02x:%02x:%02x:%02x\",\n\t\t\t\t\tMACAddress[0], MACAddress[1], MACAddress[2], MACAddress[3], MACAddress[4], MACAddress[5] ];\n\t\t\t}\n\t\t}\n\n\t\t(void) IOObjectRelease(intfIterator);  // Release the iterator.\n\t}\n\n    return addressString;\n}\n\n"
  },
  {
    "path": "OSXvnc-server/getMACAddress.h",
    "content": "/*\n *  getMACAddress.h\n *  Eggplant\n *\n *  Created by Douglas Simons on 11/15/06.\n *  Copyright 2006 Redstone Software, Inc. All rights reserved.\n *\n */\n\n#import <Foundation/NSString.h>\n\nextern NSString *getMACAddressString(void);\n"
  },
  {
    "path": "OSXvnc-server/hextile.c",
    "content": "/*\n * hextile.c\n *\n * Routines to implement Hextile Encoding\n */\n\n/*\n *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>.\n *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.\n *  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n#include <stdio.h>\n#include \"rfb.h\"\n\nstatic Bool sendHextiles8(rfbClientPtr cl, int x, int y, int w, int h);\nstatic Bool sendHextiles16(rfbClientPtr cl, int x, int y, int w, int h);\nstatic Bool sendHextiles32(rfbClientPtr cl, int x, int y, int w, int h);\n\n\n/*\n * rfbSendRectEncodingHextile - send a rectangle using hextile encoding.\n */\n\nBool\nrfbSendRectEncodingHextile(rfbClientPtr cl, int x, int y, int w, int h)\n{\n    rfbFramebufferUpdateRectHeader rect;\n\n    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader > UPDATE_BUF_SIZE) {\n        if (!rfbSendUpdateBuf(cl))\n            return FALSE;\n    }\n\n    rect.r.x = Swap16IfLE(x);\n    rect.r.y = Swap16IfLE(y);\n    rect.r.w = Swap16IfLE(w);\n    rect.r.h = Swap16IfLE(h);\n    rect.encoding = Swap32IfLE(rfbEncodingHextile);\n\n    memcpy(&cl->updateBuf[cl->ublen], &rect, sz_rfbFramebufferUpdateRectHeader);\n    cl->ublen += sz_rfbFramebufferUpdateRectHeader;\n\n    cl->rfbRectanglesSent[rfbEncodingHextile]++;\n    cl->rfbBytesSent[rfbEncodingHextile] += sz_rfbFramebufferUpdateRectHeader;\n\n    switch (cl->format.bitsPerPixel) {\n    case 8:\n        return sendHextiles8(cl, x, y, w, h);\n    case 16:\n        return sendHextiles16(cl, x, y, w, h);\n    case 32:\n        return sendHextiles32(cl, x, y, w, h);\n    }\n\n    rfbLog(\"rfbSendRectEncodingHextile: bpp %d?\", cl->format.bitsPerPixel);\n    return FALSE;\n}\n\n\n#define PUT_PIXEL8(pix) (cl->updateBuf[cl->ublen++] = (pix))\n\n#define PUT_PIXEL16(pix) (cl->updateBuf[cl->ublen++] = ((char*)&(pix))[0], \\\n                          cl->updateBuf[cl->ublen++] = ((char*)&(pix))[1])\n\n#define PUT_PIXEL32(pix) (cl->updateBuf[cl->ublen++] = ((char*)&(pix))[0], \\\n                          cl->updateBuf[cl->ublen++] = ((char*)&(pix))[1], \\\n                          cl->updateBuf[cl->ublen++] = ((char*)&(pix))[2], \\\n                          cl->updateBuf[cl->ublen++] = ((char*)&(pix))[3])\n\n\n#define DEFINE_SEND_HEXTILES(bpp)                                               \\\n                                                                                \\\n                                                                                \\\nstatic Bool subrectEncode##bpp(rfbClientPtr cli, CARD##bpp *data, int w, int h, \\\n                               CARD##bpp bg, CARD##bpp fg, Bool mono);          \\\nstatic void testColours##bpp(CARD##bpp *data, int size, Bool *mono,             \\\n                             Bool *solid, CARD##bpp *bg, CARD##bpp *fg);        \\\n                                                                                \\\n                                                                                \\\n/*                                                                              \\\n * rfbSendHextiles                                                              \\\n */                                                                             \\\n                                                                                \\\nstatic Bool                                                                     \\\nsendHextiles##bpp(rfbClientPtr cl, int rx, int ry, int rw, int rh)              \\\n{                                                                               \\\n    int x, y, w, h;                                                             \\\n    int startUblen;                                                             \\\n    char *fbptr;                                                                \\\n    CARD##bpp bg = 0, fg = 0, newBg, newFg;                                     \\\n    Bool mono, solid;                                                           \\\n    Bool validBg = FALSE;                                                       \\\n    Bool validFg = FALSE;                                                       \\\n    CARD##bpp clientPixelData[16*16*(bpp/8)];                                   \\\n                                                                                \\\n    for (y = ry; y < ry+rh; y += 16) {                                          \\\n        for (x = rx; x < rx+rw; x += 16) {                                      \\\n            w = h = 16;                                                         \\\n            if (rx+rw - x < 16)                                                 \\\n                w = rx+rw - x;                                                  \\\n            if (ry+rh - y < 16)                                                 \\\n                h = ry+rh - y;                                                  \\\n                                                                                \\\n            if ((cl->ublen + 1 + (2 + 16 * 16) * (bpp/8)) >                     \\\n                UPDATE_BUF_SIZE) {                                              \\\n                if (!rfbSendUpdateBuf(cl))                                      \\\n                    return FALSE;                                               \\\n            }                                                                   \\\n                                                                                \\\n            fbptr = (cl->scalingFrameBuffer + (cl->scalingPaddedWidthInBytes * y)   \\\n                     + (x * (rfbScreen.bitsPerPixel / 8)));                     \\\n                                                                                \\\n            (*cl->translateFn)(cl->translateLookupTable, &rfbServerFormat,      \\\n                               &cl->format, fbptr, (char *)clientPixelData,     \\\n                               cl->scalingPaddedWidthInBytes, w, h);             \\\n                                                                                \\\n            startUblen = cl->ublen;                                             \\\n            cl->updateBuf[startUblen] = 0;                                      \\\n            cl->ublen++;                                                        \\\n                                                                                \\\n            testColours##bpp(clientPixelData, w * h,                            \\\n                             &mono, &solid, &newBg, &newFg);                    \\\n                                                                                \\\n            if (!validBg || (newBg != bg)) {                                    \\\n                validBg = TRUE;                                                 \\\n                bg = newBg;                                                     \\\n                cl->updateBuf[startUblen] |= rfbHextileBackgroundSpecified;     \\\n                PUT_PIXEL##bpp(bg);                                             \\\n            }                                                                   \\\n                                                                                \\\n            if (solid) {                                                        \\\n                cl->rfbBytesSent[rfbEncodingHextile] += cl->ublen - startUblen; \\\n                continue;                                                       \\\n            }                                                                   \\\n                                                                                \\\n            cl->updateBuf[startUblen] |= rfbHextileAnySubrects;                 \\\n                                                                                \\\n            if (mono) {                                                         \\\n                if (!validFg || (newFg != fg)) {                                \\\n                    validFg = TRUE;                                             \\\n                    fg = newFg;                                                 \\\n                    cl->updateBuf[startUblen] |= rfbHextileForegroundSpecified; \\\n                    PUT_PIXEL##bpp(fg);                                         \\\n                }                                                               \\\n            } else {                                                            \\\n                validFg = FALSE;                                                \\\n                cl->updateBuf[startUblen] |= rfbHextileSubrectsColoured;        \\\n            }                                                                   \\\n                                                                                \\\n            if (!subrectEncode##bpp(cl, clientPixelData, w, h, bg, fg, mono)) { \\\n                /* encoding was too large, use raw */                           \\\n                validBg = FALSE;                                                \\\n                validFg = FALSE;                                                \\\n                cl->ublen = startUblen;                                         \\\n                cl->updateBuf[cl->ublen++] = rfbHextileRaw;                     \\\n                (*cl->translateFn)(cl->translateLookupTable,                    \\\n                                   &rfbServerFormat, &cl->format, fbptr,        \\\n                                   (char *)clientPixelData,                     \\\n                                   cl->scalingPaddedWidthInBytes, w, h);        \\\n                                                                                \\\n                memcpy(&cl->updateBuf[cl->ublen], clientPixelData,              \\\n                       w * h * (bpp/8));                                        \\\n                                                                                \\\n                cl->ublen += w * h * (bpp/8);                                   \\\n            }                                                                   \\\n                                                                                \\\n            cl->rfbBytesSent[rfbEncodingHextile] += cl->ublen - startUblen;     \\\n        }                                                                       \\\n    }                                                                           \\\n                                                                                \\\n    return TRUE;                                                                \\\n}                                                                               \\\n                                                                                \\\n                                                                                \\\nstatic Bool                                                                     \\\nsubrectEncode##bpp(rfbClientPtr cl, CARD##bpp *data, int w, int h,              \\\n                   CARD##bpp bg, CARD##bpp fg, Bool mono)                       \\\n{                                                                               \\\n    CARD##bpp cl2;                                                              \\\n    int x,y;                                                                    \\\n    int i,j;                                                                    \\\n    int hx=0,hy,vx=0,vy;                                                        \\\n    int hyflag;                                                                 \\\n    CARD##bpp *seg;                                                             \\\n    CARD##bpp *line;                                                            \\\n    int hw,hh,vw,vh;                                                            \\\n    int thex,they,thew,theh;                                                    \\\n    int numsubs = 0;                                                            \\\n    int newLen;                                                                 \\\n    int nSubrectsUblen;                                                         \\\n                                                                                \\\n    nSubrectsUblen = cl->ublen;                                                 \\\n    cl->ublen++;                                                                \\\n                                                                                \\\n    for (y=0; y<h; y++) {                                                       \\\n        line = data+(y*w);                                                      \\\n        for (x=0; x<w; x++) {                                                   \\\n            if (line[x] != bg) {                                                \\\n                cl2 = line[x];                                                  \\\n                hy = y-1;                                                       \\\n                hyflag = 1;                                                     \\\n                for (j=y; j<h; j++) {                                           \\\n                    seg = data+(j*w);                                           \\\n                    if (seg[x] != cl2) {break;}                                 \\\n                    i = x;                                                      \\\n                    while ((seg[i] == cl2) && (i < w)) i += 1;                  \\\n                    i -= 1;                                                     \\\n                    if (j == y) vx = hx = i;                                    \\\n                    if (i < vx) vx = i;                                         \\\n                    if ((hyflag > 0) && (i >= hx)) {                            \\\n                        hy += 1;                                                \\\n                    } else {                                                    \\\n                        hyflag = 0;                                             \\\n                    }                                                           \\\n                }                                                               \\\n                vy = j-1;                                                       \\\n                                                                                \\\n                /* We now have two possible subrects: (x,y,hx,hy) and           \\\n                 * (x,y,vx,vy).  We'll choose the bigger of the two.            \\\n                 */                                                             \\\n                hw = hx-x+1;                                                    \\\n                hh = hy-y+1;                                                    \\\n                vw = vx-x+1;                                                    \\\n                vh = vy-y+1;                                                    \\\n                                                                                \\\n                thex = x;                                                       \\\n                they = y;                                                       \\\n                                                                                \\\n                if ((hw*hh) > (vw*vh)) {                                        \\\n                    thew = hw;                                                  \\\n                    theh = hh;                                                  \\\n                } else {                                                        \\\n                    thew = vw;                                                  \\\n                    theh = vh;                                                  \\\n                }                                                               \\\n                                                                                \\\n                if (mono) {                                                     \\\n                    newLen = cl->ublen - nSubrectsUblen + 2;                    \\\n                } else {                                                        \\\n                    newLen = cl->ublen - nSubrectsUblen + bpp/8 + 2;            \\\n                }                                                               \\\n                                                                                \\\n                if (newLen > (w * h * (bpp/8)))                                 \\\n                    return FALSE;                                               \\\n                                                                                \\\n                numsubs += 1;                                                   \\\n                                                                                \\\n                if (!mono) PUT_PIXEL##bpp(cl2);                                 \\\n                                                                                \\\n                cl->updateBuf[cl->ublen++] = rfbHextilePackXY(thex,they);       \\\n                cl->updateBuf[cl->ublen++] = rfbHextilePackWH(thew,theh);       \\\n                                                                                \\\n                /*                                                              \\\n                 * Now mark the subrect as done.                                \\\n                 */                                                             \\\n                for (j=they; j < (they+theh); j++) {                            \\\n                    for (i=thex; i < (thex+thew); i++) {                        \\\n                        data[j*w+i] = bg;                                       \\\n                    }                                                           \\\n                }                                                               \\\n            }                                                                   \\\n        }                                                                       \\\n    }                                                                           \\\n                                                                                \\\n    cl->updateBuf[nSubrectsUblen] = numsubs;                                    \\\n                                                                                \\\n    return TRUE;                                                                \\\n}                                                                               \\\n                                                                                \\\n                                                                                \\\n/*                                                                              \\\n * testColours() tests if there are one (solid), two (mono) or more             \\\n * colours in a tile and gets a reasonable guess at the best background         \\\n * pixel, and the foreground pixel for mono.                                    \\\n */                                                                             \\\n                                                                                \\\nstatic void                                                                     \\\ntestColours##bpp(CARD##bpp *data, int size, Bool *mono, Bool *solid, CARD##bpp *bg, CARD##bpp *fg) \\\n{                                                                               \\\n    CARD##bpp colour1 = 0, colour2 = 0;                                         \\\n    int n1 = 0, n2 = 0;                                                         \\\n    *mono = TRUE;                                                               \\\n    *solid = TRUE;                                                              \\\n                                                                                \\\n    for (; size > 0; size--, data++) {                                          \\\n                                                                                \\\n        if (n1 == 0)                                                            \\\n            colour1 = *data;                                                    \\\n                                                                                \\\n        if (*data == colour1) {                                                 \\\n            n1++;                                                               \\\n            continue;                                                           \\\n        }                                                                       \\\n                                                                                \\\n        if (n2 == 0) {                                                          \\\n            *solid = FALSE;                                                     \\\n            colour2 = *data;                                                    \\\n        }                                                                       \\\n                                                                                \\\n        if (*data == colour2) {                                                 \\\n            n2++;                                                               \\\n            continue;                                                           \\\n        }                                                                       \\\n                                                                                \\\n        *mono = FALSE;                                                          \\\n        break;                                                                  \\\n    }                                                                           \\\n                                                                                \\\n    if (n1 > n2) {                                                              \\\n        *bg = colour1;                                                          \\\n        *fg = colour2;                                                          \\\n    } else {                                                                    \\\n        *bg = colour2;                                                          \\\n        *fg = colour1;                                                          \\\n    }                                                                           \\\n}\n\nDEFINE_SEND_HEXTILES(8)\nDEFINE_SEND_HEXTILES(16)\nDEFINE_SEND_HEXTILES(32)\n"
  },
  {
    "path": "OSXvnc-server/include/X11/X.h",
    "content": "/*\n *      $XConsortium: X.h,v 1.69 94/04/17 20:10:48 dpw Exp $\n */\n\n/* Definitions for the X window system likely to be used by applications */\n\n#ifndef X_H\n#define X_H\n\n/***********************************************************\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n******************************************************************/\n#define X_PROTOCOL      11              /* current protocol version */\n#define X_PROTOCOL_REVISION 0           /* current minor version */\n\n/* Resources */\n\n/*\n * _XSERVER64 must ONLY be defined when compiling X server sources on\n * systems where unsigned long is not 32 bits, must NOT be used in\n * client or library code.\n */\n#ifndef _XSERVER64\ntypedef unsigned long XID;\ntypedef unsigned long Mask;\ntypedef unsigned long Atom;\ntypedef unsigned long VisualID;\ntypedef unsigned long Time;\n#else\n#include <X11/Xmd.h>\ntypedef CARD32 XID;\ntypedef CARD32 Mask;\ntypedef CARD32 Atom;\ntypedef CARD32 VisualID;\ntypedef CARD32 Time;\n#endif\n\ntypedef XID Window;\ntypedef XID Drawable;\ntypedef XID Font;\ntypedef XID Pixmap;\ntypedef XID X11Cursor;   /* conflict with CoreGraphics */\ntypedef XID Colormap;\ntypedef XID GContext;\ntypedef XID KeySym;\n\ntypedef unsigned char KeyCode;\n\n/*****************************************************************\n * RESERVED RESOURCE AND CONSTANT DEFINITIONS\n *****************************************************************/\n\n#define None                 0L /* universal null resource or null atom */\n\n#define ParentRelative       1L /* background pixmap in CreateWindow\n                                    and ChangeWindowAttributes */\n\n#define CopyFromParent       0L /* border pixmap in CreateWindow\n                                       and ChangeWindowAttributes\n                                   special VisualID and special window\n                                       class passed to CreateWindow */\n\n#define PointerWindow        0L /* destination window in SendEvent */\n#define InputFocus           1L /* destination window in SendEvent */\n\n#define PointerRoot          1L /* focus window in SetInputFocus */\n\n#define AnyPropertyType      0L /* special Atom, passed to GetProperty */\n\n#define AnyKey               0L /* special Key Code, passed to GrabKey */\n\n#define AnyButton            0L /* special Button Code, passed to GrabButton */\n\n#define AllTemporary         0L /* special Resource ID passed to KillClient */\n\n#define CurrentTime          0L /* special Time */\n\n#define NoSymbol             0L /* special KeySym */\n\n/*****************************************************************\n * EVENT DEFINITIONS\n *****************************************************************/\n\n/* Input Event Masks. Used as event-mask window attribute and as arguments\n   to Grab requests.  Not to be confused with event names.  */\n\n#define NoEventMask                     0L\n#define KeyPressMask                    (1L<<0)\n#define KeyReleaseMask                  (1L<<1)\n#define ButtonPressMask                 (1L<<2)\n#define ButtonReleaseMask               (1L<<3)\n#define EnterWindowMask                 (1L<<4)\n#define LeaveWindowMask                 (1L<<5)\n#define PointerMotionMask               (1L<<6)\n#define PointerMotionHintMask           (1L<<7)\n#define Button1MotionMask               (1L<<8)\n#define Button2MotionMask               (1L<<9)\n#define Button3MotionMask               (1L<<10)\n#define Button4MotionMask               (1L<<11)\n#define Button5MotionMask               (1L<<12)\n#define ButtonMotionMask                (1L<<13)\n#define KeymapStateMask                 (1L<<14)\n#define ExposureMask                    (1L<<15)\n#define VisibilityChangeMask            (1L<<16)\n#define StructureNotifyMask             (1L<<17)\n#define ResizeRedirectMask              (1L<<18)\n#define SubstructureNotifyMask          (1L<<19)\n#define SubstructureRedirectMask        (1L<<20)\n#define FocusChangeMask                 (1L<<21)\n#define PropertyChangeMask              (1L<<22)\n#define ColormapChangeMask              (1L<<23)\n#define OwnerGrabButtonMask             (1L<<24)\n\n/* Event names.  Used in \"type\" field in XEvent structures.  Not to be\nconfused with event masks above.  They start from 2 because 0 and 1\nare reserved in the protocol for errors and replies. */\n\n#define KeyPress                2\n#define KeyRelease              3\n#define ButtonPress             4\n#define ButtonRelease           5\n#define MotionNotify            6\n#define EnterNotify             7\n#define LeaveNotify             8\n#define FocusIn                 9\n#define FocusOut                10\n#define KeymapNotify            11\n#define Expose                  12\n#define GraphicsExpose          13\n#define NoExpose                14\n#define VisibilityNotify        15\n#define CreateNotify            16\n#define DestroyNotify           17\n#define UnmapNotify             18\n#define MapNotify               19\n#define MapRequest              20\n#define ReparentNotify          21\n#define ConfigureNotify         22\n#define ConfigureRequest        23\n#define GravityNotify           24\n#define ResizeRequest           25\n#define CirculateNotify         26\n#define CirculateRequest        27\n#define PropertyNotify          28\n#define SelectionClear          29\n#define SelectionRequest        30\n#define SelectionNotify         31\n#define ColormapNotify          32\n#define ClientMessage           33\n#define MappingNotify           34\n#define LASTEvent               35      /* must be bigger than any event # */\n\n\n/* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,\n   state in various key-, mouse-, and button-related events. */\n\n#define ShiftMask               (1<<0)\n#define LockMask                (1<<1)\n#define ControlMask             (1<<2)\n#define Mod1Mask                (1<<3)\n#define Mod2Mask                (1<<4)\n#define Mod3Mask                (1<<5)\n#define Mod4Mask                (1<<6)\n#define Mod5Mask                (1<<7)\n\n/* modifier names.  Used to build a SetModifierMapping request or\n   to read a GetModifierMapping request.  These correspond to the\n   masks defined above. */\n#define ShiftMapIndex           0\n#define LockMapIndex            1\n#define ControlMapIndex         2\n#define Mod1MapIndex            3\n#define Mod2MapIndex            4\n#define Mod3MapIndex            5\n#define Mod4MapIndex            6\n#define Mod5MapIndex            7\n\n\n/* button masks.  Used in same manner as Key masks above. Not to be confused\n   with button names below. */\n\n#define Button1Mask             (1<<8)\n#define Button2Mask             (1<<9)\n#define Button3Mask             (1<<10)\n#define Button4Mask             (1<<11)\n#define Button5Mask             (1<<12)\n\n#define AnyModifier             (1<<15)  /* used in GrabButton, GrabKey */\n\n\n/* button names. Used as arguments to GrabButton and as detail in ButtonPress\n   and ButtonRelease events.  Not to be confused with button masks above.\n   Note that 0 is already defined above as \"AnyButton\".  */\n\n#define Button1                 1\n#define Button2                 2\n#define Button3                 3\n#define Button4                 4\n#define Button5                 5\n\n/* Notify modes */\n\n#define NotifyNormal            0\n#define NotifyGrab              1\n#define NotifyUngrab            2\n#define NotifyWhileGrabbed      3\n\n#define NotifyHint              1       /* for MotionNotify events */\n\n/* Notify detail */\n\n#define NotifyAncestor          0\n#define NotifyVirtual           1\n#define NotifyInferior          2\n#define NotifyNonlinear         3\n#define NotifyNonlinearVirtual  4\n#define NotifyPointer           5\n#define NotifyPointerRoot       6\n#define NotifyDetailNone        7\n\n/* Visibility notify */\n\n#define VisibilityUnobscured            0\n#define VisibilityPartiallyObscured     1\n#define VisibilityFullyObscured         2\n\n/* Circulation request */\n\n#define PlaceOnTop              0\n#define PlaceOnBottom           1\n\n/* protocol families */\n\n#define FamilyInternet          0\n#define FamilyDECnet            1\n#define FamilyChaos             2\n\n/* Property notification */\n\n#define PropertyNewValue        0\n#define PropertyDelete          1\n\n/* Color Map notification */\n\n#define ColormapUninstalled     0\n#define ColormapInstalled       1\n\n/* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */\n\n#define GrabModeSync            0\n#define GrabModeAsync           1\n\n/* GrabPointer, GrabKeyboard reply status */\n\n#define GrabSuccess             0\n#define AlreadyGrabbed          1\n#define GrabInvalidTime         2\n#define GrabNotViewable         3\n#define GrabFrozen              4\n\n/* AllowEvents modes */\n\n#define AsyncPointer            0\n#define SyncPointer             1\n#define ReplayPointer           2\n#define AsyncKeyboard           3\n#define SyncKeyboard            4\n#define ReplayKeyboard          5\n#define AsyncBoth               6\n#define SyncBoth                7\n\n/* Used in SetInputFocus, GetInputFocus */\n\n#define RevertToNone            (int)None\n#define RevertToPointerRoot     (int)PointerRoot\n#define RevertToParent          2\n\n/*****************************************************************\n * ERROR CODES\n *****************************************************************/\n\n#define Success            0    /* everything's okay */\n#define BadRequest         1    /* bad request code */\n#define BadValue           2    /* int parameter out of range */\n#define BadWindow          3    /* parameter not a Window */\n#define BadPixmap          4    /* parameter not a Pixmap */\n#define BadAtom            5    /* parameter not an Atom */\n#define BadCursor          6    /* parameter not a Cursor */\n#define BadFont            7    /* parameter not a Font */\n#define BadMatch           8    /* parameter mismatch */\n#define BadDrawable        9    /* parameter not a Pixmap or Window */\n#define BadAccess         10    /* depending on context:\n                                 - key/button already grabbed\n                                 - attempt to free an illegal\n                                   cmap entry\n                                - attempt to store into a read-only\n                                   color map entry.\n                                - attempt to modify the access control\n                                   list from other than the local host.\n                                */\n#define BadAlloc          11    /* insufficient resources */\n#define BadColor          12    /* no such colormap */\n#define BadGC             13    /* parameter not a GC */\n#define BadIDChoice       14    /* choice not in range or already used */\n#define BadName           15    /* font or color name doesn't exist */\n#define BadLength         16    /* Request length incorrect */\n#define BadImplementation 17    /* server is defective */\n\n#define FirstExtensionError     128\n#define LastExtensionError      255\n\n/*****************************************************************\n * WINDOW DEFINITIONS\n *****************************************************************/\n\n/* Window classes used by CreateWindow */\n/* Note that CopyFromParent is already defined as 0 above */\n\n#define InputOutput             1\n#define InputOnly               2\n\n/* Window attributes for CreateWindow and ChangeWindowAttributes */\n\n#define CWBackPixmap            (1L<<0)\n#define CWBackPixel             (1L<<1)\n#define CWBorderPixmap          (1L<<2)\n#define CWBorderPixel           (1L<<3)\n#define CWBitGravity            (1L<<4)\n#define CWWinGravity            (1L<<5)\n#define CWBackingStore          (1L<<6)\n#define CWBackingPlanes         (1L<<7)\n#define CWBackingPixel          (1L<<8)\n#define CWOverrideRedirect      (1L<<9)\n#define CWSaveUnder             (1L<<10)\n#define CWEventMask             (1L<<11)\n#define CWDontPropagate         (1L<<12)\n#define CWColormap              (1L<<13)\n#define CWCursor                (1L<<14)\n\n/* ConfigureWindow structure */\n\n#define CWX                     (1<<0)\n#define CWY                     (1<<1)\n#define CWWidth                 (1<<2)\n#define CWHeight                (1<<3)\n#define CWBorderWidth           (1<<4)\n#define CWSibling               (1<<5)\n#define CWStackMode             (1<<6)\n\n\n/* Bit Gravity */\n\n#define ForgetGravity           0\n#define NorthWestGravity        1\n#define NorthGravity            2\n#define NorthEastGravity        3\n#define WestGravity             4\n#define CenterGravity           5\n#define EastGravity             6\n#define SouthWestGravity        7\n#define SouthGravity            8\n#define SouthEastGravity        9\n#define StaticGravity           10\n\n/* Window gravity + bit gravity above */\n\n#define UnmapGravity            0\n\n/* Used in CreateWindow for backing-store hint */\n\n#define NotUseful               0\n#define WhenMapped              1\n#define Always                  2\n\n/* Used in GetWindowAttributes reply */\n\n#define IsUnmapped              0\n#define IsUnviewable            1\n#define IsViewable              2\n\n/* Used in ChangeSaveSet */\n\n#define SetModeInsert           0\n#define SetModeDelete           1\n\n/* Used in ChangeCloseDownMode */\n\n#define DestroyAll              0\n#define RetainPermanent         1\n#define RetainTemporary         2\n\n/* Window stacking method (in configureWindow) */\n\n#define Above                   0\n#define Below                   1\n#define TopIf                   2\n#define BottomIf                3\n#define Opposite                4\n\n/* Circulation direction */\n\n#define RaiseLowest             0\n#define LowerHighest            1\n\n/* Property modes */\n\n#define PropModeReplace         0\n#define PropModePrepend         1\n#define PropModeAppend          2\n\n/*****************************************************************\n * GRAPHICS DEFINITIONS\n *****************************************************************/\n\n/* graphics functions, as in GC.alu */\n\n#define GXclear                 0x0             /* 0 */\n#define GXand                   0x1             /* src AND dst */\n#define GXandReverse            0x2             /* src AND NOT dst */\n#define GXcopy                  0x3             /* src */\n#define GXandInverted           0x4             /* NOT src AND dst */\n#define GXnoop                  0x5             /* dst */\n#define GXxor                   0x6             /* src XOR dst */\n#define GXor                    0x7             /* src OR dst */\n#define GXnor                   0x8             /* NOT src AND NOT dst */\n#define GXequiv                 0x9             /* NOT src XOR dst */\n#define GXinvert                0xa             /* NOT dst */\n#define GXorReverse             0xb             /* src OR NOT dst */\n#define GXcopyInverted          0xc             /* NOT src */\n#define GXorInverted            0xd             /* NOT src OR dst */\n#define GXnand                  0xe             /* NOT src OR NOT dst */\n#define GXset                   0xf             /* 1 */\n\n/* LineStyle */\n\n#define LineSolid               0\n#define LineOnOffDash           1\n#define LineDoubleDash          2\n\n/* capStyle */\n\n#define CapNotLast              0\n#define CapButt                 1\n#define CapRound                2\n#define CapProjecting           3\n\n/* joinStyle */\n\n#define JoinMiter               0\n#define JoinRound               1\n#define JoinBevel               2\n\n/* fillStyle */\n\n#define FillSolid               0\n#define FillTiled               1\n#define FillStippled            2\n#define FillOpaqueStippled      3\n\n/* fillRule */\n\n#define EvenOddRule             0\n#define WindingRule             1\n\n/* subwindow mode */\n\n#define ClipByChildren          0\n#define IncludeInferiors        1\n\n/* SetClipRectangles ordering */\n\n#define Unsorted                0\n#define YSorted                 1\n#define YXSorted                2\n#define YXBanded                3\n\n/* CoordinateMode for drawing routines */\n\n#define CoordModeOrigin         0       /* relative to the origin */\n#define CoordModePrevious       1       /* relative to previous point */\n\n/* Polygon shapes */\n\n#define Complex                 0       /* paths may intersect */\n#define Nonconvex               1       /* no paths intersect, but not convex */\n#define Convex                  2       /* wholly convex */\n\n/* Arc modes for PolyFillArc */\n\n#define ArcChord                0       /* join endpoints of arc */\n#define ArcPieSlice             1       /* join endpoints to center of arc */\n\n/* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into\n   GC.stateChanges */\n\n#define GCFunction              (1L<<0)\n#define GCPlaneMask             (1L<<1)\n#define GCForeground            (1L<<2)\n#define GCBackground            (1L<<3)\n#define GCLineWidth             (1L<<4)\n#define GCLineStyle             (1L<<5)\n#define GCCapStyle              (1L<<6)\n#define GCJoinStyle             (1L<<7)\n#define GCFillStyle             (1L<<8)\n#define GCFillRule              (1L<<9)\n#define GCTile                  (1L<<10)\n#define GCStipple               (1L<<11)\n#define GCTileStipXOrigin       (1L<<12)\n#define GCTileStipYOrigin       (1L<<13)\n#define GCFont                  (1L<<14)\n#define GCSubwindowMode         (1L<<15)\n#define GCGraphicsExposures     (1L<<16)\n#define GCClipXOrigin           (1L<<17)\n#define GCClipYOrigin           (1L<<18)\n#define GCClipMask              (1L<<19)\n#define GCDashOffset            (1L<<20)\n#define GCDashList              (1L<<21)\n#define GCArcMode               (1L<<22)\n\n#define GCLastBit               22\n/*****************************************************************\n * FONTS\n *****************************************************************/\n\n/* used in QueryFont -- draw direction */\n\n#define FontLeftToRight         0\n#define FontRightToLeft         1\n\n#define FontChange              255\n\n/*****************************************************************\n *  IMAGING\n *****************************************************************/\n\n/* ImageFormat -- PutImage, GetImage */\n\n#define XYBitmap                0       /* depth 1, XYFormat */\n#define XYPixmap                1       /* depth == drawable depth */\n#define ZPixmap                 2       /* depth == drawable depth */\n\n/*****************************************************************\n *  COLOR MAP STUFF\n *****************************************************************/\n\n/* For CreateColormap */\n\n#define AllocNone               0       /* create map with no entries */\n#define AllocAll                1       /* allocate entire map writeable */\n\n\n/* Flags used in StoreNamedColor, StoreColors */\n\n#define DoRed                   (1<<0)\n#define DoGreen                 (1<<1)\n#define DoBlue                  (1<<2)\n\n/*****************************************************************\n * CURSOR STUFF\n *****************************************************************/\n\n/* QueryBestSize Class */\n\n#define CursorShape             0       /* largest size that can be displayed */\n#define TileShape               1       /* size tiled fastest */\n#define StippleShape            2       /* size stippled fastest */\n\n/*****************************************************************\n * KEYBOARD/POINTER STUFF\n *****************************************************************/\n\n#define AutoRepeatModeOff       0\n#define AutoRepeatModeOn        1\n#define AutoRepeatModeDefault   2\n\n#define LedModeOff              0\n#define LedModeOn               1\n\n/* masks for ChangeKeyboardControl */\n\n#define KBKeyClickPercent       (1L<<0)\n#define KBBellPercent           (1L<<1)\n#define KBBellPitch             (1L<<2)\n#define KBBellDuration          (1L<<3)\n#define KBLed                   (1L<<4)\n#define KBLedMode               (1L<<5)\n#define KBKey                   (1L<<6)\n#define KBAutoRepeatMode        (1L<<7)\n\n#define MappingSuccess          0\n#define MappingBusy             1\n#define MappingFailed           2\n\n#define MappingModifier         0\n#define MappingKeyboard         1\n#define MappingPointer          2\n\n/*****************************************************************\n * SCREEN SAVER STUFF\n *****************************************************************/\n\n#define DontPreferBlanking      0\n#define PreferBlanking          1\n#define DefaultBlanking         2\n\n#define DisableScreenSaver      0\n#define DisableScreenInterval   0\n\n#define DontAllowExposures      0\n#define AllowExposures          1\n#define DefaultExposures        2\n\n/* for ForceScreenSaver */\n\n#define ScreenSaverReset 0\n#define ScreenSaverActive 1\n\n/*****************************************************************\n * HOSTS AND CONNECTIONS\n *****************************************************************/\n\n/* for ChangeHosts */\n\n#define HostInsert              0\n#define HostDelete              1\n\n/* for ChangeAccessControl */\n\n#define EnableAccess            1\n#define DisableAccess           0\n\n/* Display classes  used in opening the connection\n * Note that the statically allocated ones are even numbered and the\n * dynamically changeable ones are odd numbered */\n\n#define StaticGray              0\n#define GrayScale               1\n#define StaticColor             2\n#define PseudoColor             3\n#define TrueColor               4\n#define DirectColor             5\n\n\n/* Byte order  used in imageByteOrder and bitmapBitOrder */\n\n#define LSBFirst                0\n#define MSBFirst                1\n\n#endif /* X_H */\n"
  },
  {
    "path": "OSXvnc-server/include/X11/Xalloca.h",
    "content": "/* $XConsortium: Xalloca.h /main/6 1996/09/28 16:17:22 rws $ */\n\n/*\n\nCopyright (c) 1995  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR\nOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall\nnot be used in advertising or otherwise to promote the sale, use or\nother dealings in this Software without prior written authorization\nfrom the X Consortium.\n\n*/\n\n/*\n * The purpose of this header is to define the macros ALLOCATE_LOCAL and\n * DEALLOCATE_LOCAL appropriately for the platform being compiled on.\n * These macros are used to make fast, function-local memory allocations.\n * Their characteristics are as follows:\n *\n * void *ALLOCATE_LOCAL(int size)\n *    Returns a pointer to size bytes of memory, or NULL if the allocation\n *    failed.  The memory must be freed with DEALLOCATE_LOCAL before the\n *    function that made the allocation returns.  You should not ask for\n *    large blocks of memory with this function, since on many platforms\n *    the memory comes from the stack, which may have limited size.\n *\n * void DEALLOCATE_LOCAL(void *)\n *    Frees the memory allocated by ALLOCATE_LOCAL.  Omission of this\n *    step may be harmless on some platforms, but will result in\n *    memory leaks or worse on others.\n *\n * Before including this file, you should define two macros,\n * ALLOCATE_LOCAL_FALLBACK and DEALLOCATE_LOCAL_FALLBACK, that have the\n * same characteristics as ALLOCATE_LOCAL and DEALLOCATE_LOCAL.  The\n * header uses the fallbacks if it doesn't know a \"better\" way to define\n * ALLOCATE_LOCAL and DEALLOCATE_LOCAL.  Typical usage would be:\n *\n *    #define ALLOCATE_LOCAL_FALLBACK(_size) malloc(_size)\n *    #define DEALLOCATE_LOCAL_FALLBACK(_ptr) free(_ptr)\n *    #include \"Xalloca.h\"\n */\n\n// Lets skip this on OS X\n#define XALLOCA_H 1\n\n#ifndef XALLOCA_H\n#define XALLOCA_H 1\n\n#ifdef INCLUDE_ALLOCA_H\n#  include <alloca.h>\n#endif\n\n#ifndef NO_ALLOCA\n/*\n * os-dependent definition of local allocation and deallocation\n * If you want something other than (DE)ALLOCATE_LOCAL_FALLBACK\n * for ALLOCATE/DEALLOCATE_LOCAL then you add that in here.\n */\n#  if defined(__HIGHC__)\n#    ifndef NCR\n       extern char *alloca();\n#      if HCVERSION < 21003\n#        define ALLOCATE_LOCAL(size)\talloca((int)(size))\n         pragma on(alloca);\n#      else /* HCVERSION >= 21003 */\n#        define\tALLOCATE_LOCAL(size)\t_Alloca((int)(size))\n#      endif /* HCVERSION < 21003 */\n#    else /* NCR */\n#      define ALLOCATE_LOCAL(size)\talloca(size)\n#    endif\n#  define DEALLOCATE_LOCAL(ptr)  /* as nothing */\n#  endif /* defined(__HIGHC__) */\n\n\n#  ifdef __GNUC__\n#    ifndef alloca\n#      define alloca __builtin_alloca\n#    endif /* !alloca */\n#    define ALLOCATE_LOCAL(size) alloca((int)(size))\n#    define DEALLOCATE_LOCAL(ptr)  /* as nothing */\n#  else /* ! __GNUC__ */\n\n/*\n * warning: old mips alloca (pre 2.10) is unusable, new one is built in\n * Test is easy, the new one is named __builtin_alloca and comes\n * from alloca.h which #defines alloca.\n */\n#    ifndef NCR\n#      if defined(vax) || defined(sun) || defined(apollo) || defined(stellar) || defined(USL) || defined(alloca)\n/*\n * Some System V boxes extract alloca.o from /lib/libPW.a; if you\n * decide that you don't want to use alloca, you might want to fix it here.\n */\n/* alloca might be a macro taking one arg (hi, Sun!), so give it one. */\n#        ifndef __sgi\t\t\t/* IRIX 5/6 has definition */\n#          define __Xnullarg\t\t/* as nothing */\n#          ifndef X_NOT_STDC_ENV\n             extern void *alloca(__Xnullarg);\n#          else\n             extern char *alloca(__Xnullarg);\n#          endif\n#        endif /* __sgi */\n#        define ALLOCATE_LOCAL(size) alloca((int)(size))\n#        define DEALLOCATE_LOCAL(ptr)  /* as nothing */\n#      endif /* who does alloca */\n#    endif /* NCR */\n#  endif /* __GNUC__ */\n\n#endif /* NO_ALLOCA */\n\n#if !defined(ALLOCATE_LOCAL)\n#  if defined(ALLOCATE_LOCAL_FALLBACK) && defined(DEALLOCATE_LOCAL_FALLBACK)\n#    define ALLOCATE_LOCAL(_size)  ALLOCATE_LOCAL_FALLBACK(_size)\n#    define DEALLOCATE_LOCAL(_ptr) DEALLOCATE_LOCAL_FALLBACK(_ptr)\n#  else /* no fallbacks supplied; error */\n#    define ALLOCATE_LOCAL(_size)  ALLOCATE_LOCAL_FALLBACK undefined!\n#    define DEALLOCATE_LOCAL(_ptr) DEALLOCATE_LOCAL_FALLBACK undefined!\n#  endif /* defined(ALLOCATE_LOCAL_FALLBACK && DEALLOCATE_LOCAL_FALLBACK) */\n#endif /* !defined(ALLOCATE_LOCAL) */\n\n#endif /* XALLOCA_H */\n"
  },
  {
    "path": "OSXvnc-server/include/X11/Xfuncproto.h",
    "content": "/* $XConsortium: Xfuncproto.h,v 1.9 95/06/08 23:20:39 gildea Exp $ */\n/*\n *\nCopyright (c) 1989, 1991  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n *\n */\n\n/* Definitions to make function prototypes manageable */\n\n#ifndef _XFUNCPROTO_H_\n#define _XFUNCPROTO_H_\n\n#ifndef NeedFunctionPrototypes\n#if defined(FUNCPROTO) || defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)\n#define NeedFunctionPrototypes 1\n#else\n#define NeedFunctionPrototypes 0\n#endif\n#endif /* NeedFunctionPrototypes */\n\n#ifndef NeedVarargsPrototypes\n#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&2)\n#define NeedVarargsPrototypes 1\n#else\n#define NeedVarargsPrototypes 0\n#endif\n#endif /* NeedVarargsPrototypes */\n\n#if NeedFunctionPrototypes\n\n#ifndef NeedNestedPrototypes\n#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&8)\n#define NeedNestedPrototypes 1\n#else\n#define NeedNestedPrototypes 0\n#endif\n#endif /* NeedNestedPrototypes */\n\n#ifndef _Xconst\n#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&4)\n#define _Xconst const\n#else\n#define _Xconst\n#endif\n#endif /* _Xconst */\n\n#ifndef NeedWidePrototypes\n#ifdef NARROWPROTO\n#define NeedWidePrototypes 0\n#else\n#define NeedWidePrototypes 1\t\t/* default to make interropt. easier */\n#endif\n#endif /* NeedWidePrototypes */\n\n#endif /* NeedFunctionPrototypes */\n\n#ifndef _XFUNCPROTOBEGIN\n#ifdef __cplusplus\t\t\t/* for C++ V2.0 */\n#define _XFUNCPROTOBEGIN extern \"C\" {\t/* do not leave open across includes */\n#define _XFUNCPROTOEND }\n#else\n#define _XFUNCPROTOBEGIN\n#define _XFUNCPROTOEND\n#endif\n#endif /* _XFUNCPROTOBEGIN */\n\n#endif /* _XFUNCPROTO_H_ */\n"
  },
  {
    "path": "OSXvnc-server/include/X11/Xfuncs.h",
    "content": "/*\n * $XConsortium: Xfuncs.h,v 1.16 94/12/01 16:25:53 kaleb Exp $\n * $XFree86: xc/include/Xfuncs.h,v 3.2 1995/01/28 15:42:03 dawes Exp $\n *\n *\nCopyright (c) 1990  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n *\n */\n\n// Lets skip this file\n#define _XFUNCS_H_\n\n#ifndef _XFUNCS_H_\n#define _XFUNCS_H_\n\n#include <X11/Xosdefs.h>\n\n/* the old Xfuncs.h, for pre-R6 */\n\n#ifdef X_USEBFUNCS\nvoid bcopy();\nvoid bzero();\nint bcmp();\n#else\n#if (__STDC__ && !defined(X_NOT_STDC_ENV) && !defined(sun) && !defined(macII) && !defined(apollo)) || defined(SVR4) || defined(hpux) || defined(_IBMR2) || defined(_SEQUENT_)\n#include <string.h>\n#define _XFUNCS_H_INCLUDED_STRING_H\n#define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len))\n#define bzero(b,len) memset(b, 0, (size_t)(len))\n#define bcmp(b1,b2,len) memcmp(b1, b2, (size_t)(len))\n#else\n#ifdef sgi\n#include <bstring.h>\n#else\n#ifdef SYSV\n#include <memory.h>\nvoid bcopy();\n#define bzero(b,len) memset(b, 0, len)\n#define bcmp(b1,b2,len) memcmp(b1, b2, len)\n#else\n#ifdef __EMX__\n#include <strings.h>\n#define _XFUNCS_H_INCLUDED_STRING_H\n/* bcopy, bcmp, bzero declared */\n#else /* bsd */\nvoid bcopy();\nvoid bzero();\nint bcmp();\n#endif\n#endif /* SYSV */\n#endif /* sgi */\n#endif /* __STDC__ and relatives */\n#endif /* X_USEBFUNCS */\n\n\n/* the new Xfuncs.h */\n\n#if !defined(X_NOT_STDC_ENV) && (!defined(sun) || defined(SVR4))\n/* the ANSI C way */\n#ifndef _XFUNCS_H_INCLUDED_STRING_H\n#include <string.h>\n#endif\n#undef bzero\n#define bzero(b,len) memset(b,0,len)\n#else /* else X_NOT_STDC_ENV or SunOS 4 */\n#if defined(SYSV) || defined(luna) || defined(sun) || defined(__sxg__)\n#include <memory.h>\n#define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))\n#if defined(SYSV) && defined(_XBCOPYFUNC)\n#undef memmove\n#define memmove(dst,src,len) _XBCOPYFUNC((char *)(src),(char *)(dst),(int)(len))\n#define _XNEEDBCOPYFUNC\n#endif\n#else /* else vanilla BSD */\n#define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))\n#define memcpy(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))\n#define memcmp(b1,b2,len) bcmp((char *)(b1),(char *)(b2),(int)(len))\n#endif /* SYSV else */\n#endif /* ! X_NOT_STDC_ENV else */\n\n#endif /* _XFUNCS_H_ */\n"
  },
  {
    "path": "OSXvnc-server/include/X11/Xmd.h",
    "content": "/***********************************************************\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n******************************************************************/\n#ifndef XMD_H\n#define XMD_H 1\n\n#if 1\n#include <stdint.h>\n#define B16 :16\n#define B32 :32\ntypedef int8_t INT8;\ntypedef int16_t INT16;\ntypedef int32_t INT32;\n#if !defined(OBJC_BOOL_IS_BOOL)\ntypedef int8_t BOOL;\n#endif\n#ifndef __EMX__\n#endif\ntypedef uint32_t BITS32;\ntypedef uint8_t BYTE;\ntypedef uint8_t CARD8;\ntypedef uint16_t CARD16;\ntypedef uint32_t CARD32;\ntypedef uint64_t CARD64;\n#else\n\n/* $XConsortium: Xmd.h,v 1.49 95/06/08 23:20:39 gildea Exp $ */\n/* $XFree86: xc/include/Xmd.h,v 3.4 1996/12/31 04:15:20 dawes Exp $ */\n/*\n *  Xmd.h: MACHINE DEPENDENT DECLARATIONS.\n */\n\n/*\n * Special per-machine configuration flags.\n */\n#ifdef CRAY\n#define WORD64\t\t\t\t/* 64-bit architecture */\n#endif\n#if defined(__alpha) || defined(__alpha__)\n#define LONG64\t\t\t\t/* 32/64-bit architecture */\n#endif\n#ifdef __sgi\n#if (_MIPS_SZLONG == 64)\n#define LONG64\n#endif\n#endif\n\n/*\n * Stuff to handle large architecture machines; the constants were generated\n * on a 32-bit machine and must coorespond to the protocol.\n */\n#ifdef WORD64\n#define MUSTCOPY\n#endif /* WORD64 */\n\n\n/*\n * Definition of macro used to set constants for size of network structures;\n * machines with preprocessors that can't handle all of the sz_ symbols\n * can define this macro to be sizeof(x) if and only if their compiler doesn't\n * pad out structures (esp. the xTextElt structure which contains only two\n * one-byte fields).  Network structures should always define sz_symbols.\n *\n * The sz_ prefix is used instead of something more descriptive so that the\n * symbols are no more than 32 characters long (which causes problems for some\n * compilers and preprocessors).\n *\n * The extra indirection in the __STDC__ case is to get macro arguments to\n * expand correctly before the concatenation, rather than afterward.\n */\n#if ((defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)) && !defined(UNIXCPP)) || defined(ANSICPP)\n#define _SIZEOF(x) sz_##x\n#define SIZEOF(x) _SIZEOF(x)\n#else\n#define SIZEOF(x) sz_/**/x\n#endif /* if ANSI C compiler else not */\n\n/*\n * Bitfield suffixes for the protocol structure elements, if you\n * need them.  Note that bitfields are not guarranteed to be signed\n * (or even unsigned) according to ANSI C.\n */\n#ifdef WORD64\ntypedef long INT64;\ntypedef unsigned long CARD64;\n#define B32 :32\n#define B16 :16\n#ifdef UNSIGNEDBITFIELDS\ntypedef unsigned int INT32;\ntypedef unsigned int INT16;\n#else\n#ifdef __STDC__\ntypedef signed int INT32;\ntypedef signed int INT16;\n#else\ntypedef int INT32;\ntypedef int INT16;\n#endif\n#endif\n#else\n#define B32\n#define B16\n#ifdef LONG64\ntypedef long INT64;\ntypedef int INT32;\n#else\ntypedef long INT32;\n#endif\ntypedef short INT16;\n#endif\n\n#if defined(__STDC__) || defined(sgi) || defined(AIXV3)\ntypedef signed char    INT8;\n#else\ntypedef char           INT8;\n#endif\n\n#ifdef LONG64\ntypedef unsigned long CARD64;\ntypedef unsigned int CARD32;\n#else\ntypedef unsigned long CARD32;\n#endif\ntypedef unsigned short CARD16;\ntypedef unsigned char  CARD8;\n\ntypedef CARD32\t\tBITS32;\ntypedef CARD16\t\tBITS16;\n\n\n#ifndef __EMX__\ntypedef CARD8\t\tBYTE;\n#ifndef _OBJC_OBJC_H_\ntypedef CARD8           BOOL;\n#endif\n#else\n/*\n * This is bad style, but the central include file <os2.h> declares them\n * as well\n */\n#define BYTE\t\tCARD8\n#ifndef _OBJC_OBJC_H_\n#define BOOL\t\tCARD8\n#endif\n#endif\n\n\n/*\n * definitions for sign-extending bitfields on 64-bit architectures\n */\n#if defined(WORD64) && defined(UNSIGNEDBITFIELDS)\n#define cvtINT8toInt(val)   (((val) & 0x00000080) ? ((val) | 0xffffffffffffff00) : (val))\n#define cvtINT16toInt(val)  (((val) & 0x00008000) ? ((val) | 0xffffffffffff0000) : (val))\n#define cvtINT32toInt(val)  (((val) & 0x80000000) ? ((val) | 0xffffffff00000000) : (val))\n#define cvtINT8toShort(val)  cvtINT8toInt(val)\n#define cvtINT16toShort(val) cvtINT16toInt(val)\n#define cvtINT32toShort(val) cvtINT32toInt(val)\n#define cvtINT8toLong(val)  cvtINT8toInt(val)\n#define cvtINT16toLong(val) cvtINT16toInt(val)\n#define cvtINT32toLong(val) cvtINT32toInt(val)\n#else\n#define cvtINT8toInt(val) (val)\n#define cvtINT16toInt(val) (val)\n#define cvtINT32toInt(val) (val)\n#define cvtINT8toShort(val) (val)\n#define cvtINT16toShort(val) (val)\n#define cvtINT32toShort(val) (val)\n#define cvtINT8toLong(val) (val)\n#define cvtINT16toLong(val) (val)\n#define cvtINT32toLong(val) (val)\n#endif /* WORD64 and UNSIGNEDBITFIELDS */\n\n\n\n#ifdef MUSTCOPY\n/*\n * This macro must not cast or else pointers will get aligned and be wrong\n */\n#define NEXTPTR(p,t)  (((char *) p) + SIZEOF(t))\n#else /* else not MUSTCOPY, this is used for 32-bit machines */\n/*\n * this version should leave result of type (t *), but that should only be\n * used when not in MUSTCOPY\n */\n#define NEXTPTR(p,t) (((t *)(p)) + 1)\n#endif /* MUSTCOPY - used machines whose C structs don't line up with proto */\n\n#endif /* 0 */\n\n#endif /* XMD_H */\n"
  },
  {
    "path": "OSXvnc-server/include/X11/Xos.h",
    "content": "/*\n * $XConsortium: Xos.h /main/70 1996/11/15 16:00:41 kaleb $\n * $XFree86: xc/include/Xos.h,v 3.21.2.1 1998/01/23 12:35:11 dawes Exp $\n *\n *\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n *\n * The X Window System is a Trademark of X Consortium.\n *\n */\n\n/* This is a collection of things to try and minimize system dependencies\n * in a \"significant\" number of source files.\n */\n\n#ifndef _XOS_H_\n#define _XOS_H_\n\n#include <X11/Xosdefs.h>\n\n/*\n * Get major data types (esp. caddr_t)\n */\n\n#ifdef USG\n#ifndef __TYPES__\n#ifdef CRAY\n#define word word_t\n#endif /* CRAY */\n#include <sys/types.h>\t\t\t/* forgot to protect it... */\n#define __TYPES__\n#endif /* __TYPES__ */\n#else /* USG */\n#if defined(_POSIX_SOURCE) && (defined(MOTOROLA) || defined(AMOEBA))\n#undef _POSIX_SOURCE\n#include <sys/types.h>\n#define _POSIX_SOURCE\n#else\n#include <sys/types.h>\n#endif\n#endif /* USG */\n\n\n/*\n * Just about everyone needs the strings routines.  We provide both forms here,\n * index/rindex and strchr/strrchr, so any systems that don't provide them all\n * need to have #defines here.\n *\n * NOTE: The following ISN'T true for this XFree86 version of this file.\n *\n * These macros are defined this way, rather than, e.g.:\n *    #defined index(s,c) strchr(s,c)\n * because someone might be using them as function pointers, and such\n * a change would break compatibility for anyone who's relying on them\n * being the way they currently are. So we're stuck with them this way,\n * which can be really inconvenient. :-(\n */\n\n#ifndef X_NOT_STDC_ENV\n\n#include <string.h>\n#ifdef __STDC__\n#ifndef index\n#define index(s,c) (strchr((s),(c)))\n#endif\n#ifndef rindex\n#define rindex(s,c) (strrchr((s),(c)))\n#endif\n#else\n#ifndef index\n#define index strchr\n#endif\n#ifndef rindex\n#define rindex strrchr\n#endif\n#endif\n\n#else\n\n#ifdef SYSV\n#if defined(clipper) || defined(__clipper__)\n#include <malloc.h>\n#endif\n#include <string.h>\n#define index strchr\n#define rindex strrchr\n#else\n#include <strings.h>\n#define strchr index\n#define strrchr rindex\n#endif\n\n#endif /* X_NOT_STDC_ENV */\n\n/*\n * strerror()\n */\n#if (defined(X_NOT_STDC_ENV) || (defined(sun) && !defined(SVR4)) || defined(macII)) && !defined(__GLIBC__)\n#ifndef strerror\nextern char *sys_errlist[];\nextern int sys_nerr;\n#define strerror(n) \\\n    (((n) >= 0 && (n) < sys_nerr) ? sys_errlist[n] : \"unknown error\")\n#endif\n#endif\n\n/*\n * Get open(2) constants\n */\n#ifdef X_NOT_POSIX\n#include <fcntl.h>\n#if defined(USL) || defined(CRAY) || defined(MOTOROLA) || (defined(i386) && (defined(SYSV) || defined(SVR4))) || defined(__sxg__)\n#include <unistd.h>\n#endif\n#ifdef WIN32\n#include <X11/Xw32defs.h>\n#else\n#include <sys/file.h>\n#endif\n#else /* X_NOT_POSIX */\n#if !defined(_POSIX_SOURCE) && defined(macII)\n#define _POSIX_SOURCE\n#include <fcntl.h>\n#include <unistd.h>\n#undef _POSIX_SOURCE\n#else\n#include <fcntl.h>\n#include <unistd.h>\n#endif\n#endif /* X_NOT_POSIX else */\n\n#ifdef CSRG_BASED\n#include <stdlib.h>\n#include <unistd.h>\n#endif /* CSRG_BASED */\n\n/*\n * Get struct timeval\n */\n\n#ifdef SYSV\n\n#ifndef USL\n#include <sys/time.h>\n#endif\n#include <time.h>\n#ifdef CRAY\n#undef word\n#endif /* CRAY */\n#if defined(USG) && !defined(CRAY) && !defined(MOTOROLA) && !defined(uniosu) && !defined(__sxg__) && !defined(clipper) && !defined(__clipper__)\nstruct timeval {\n    long tv_sec;\n    long tv_usec;\n};\n#ifndef USL_SHARELIB\nstruct timezone {\n    int tz_minuteswest;\n    int tz_dsttime;\n};\n#endif /* USL_SHARELIB */\n#endif /* USG */\n\n#ifdef _SEQUENT_\nstruct timezone {\n    int tz_minuteswest;\n    int tz_dsttime;\n};\n#endif /* _SEQUENT_ */\n\n#else /* not SYSV */\n\n#if defined(_ANSI_SOURCE) && defined(__bsdi__)\n#undef _ANSI_SOURCE\n#include <sys/time.h>\n#define _ANSI_SOURCE\n#endif\n\n#if defined(_POSIX_SOURCE) && defined(SVR4)\n/* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */\n#undef _POSIX_SOURCE\n#include <sys/time.h>\n#define _POSIX_SOURCE\n#else /* defined(_POSIX_SOURCE) && defined(SVR4) */\n#ifdef WIN32\n#include <time.h>\n#if !defined(_WINSOCKAPI_) && !defined(_WILLWINSOCK_)\nstruct timeval {\n    long    tv_sec;         /* seconds */\n    long    tv_usec;        /* and microseconds */\n};\n#endif\n#include <sys/timeb.h>\n#define gettimeofday(t) \\\n{ \\\n    struct _timeb _gtodtmp; \\\n    _ftime (&_gtodtmp); \\\n    (t)->tv_sec = _gtodtmp.time; \\\n    (t)->tv_usec = _gtodtmp.millitm * 1000; \\\n}\n#else /* WIN32 */\n#ifdef _SEQUENT_\n#include <time.h>\n#else /* _SEQUENT_ */\n#ifdef AMOEBA\n#include <time.h>\n#include <sys/time.h>\n#else /* AMOEBA */\n#ifdef MINIX\n#include <time.h>\n#else /* !MINIX */\n#ifndef Lynx\n#include <sys/time.h>\n#else\n#include <time.h>\n#endif /* Lynx */\n#endif /* MINIX */\n#endif /* AMOEBA */\n#endif /* _SEQUENT_ */\n#endif /* WIN32 else */\n#endif /* defined(_POSIX_SOURCE) && defined(SVR4) */\n\n#endif /* SYSV */\n\n/* define X_GETTIMEOFDAY macro, a portable gettimeofday() */\n#if defined(_XOPEN_XPG4) || defined(_XOPEN_UNIX) /* _XOPEN_UNIX is XPG4.2 */\n#define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*)0)\n#else\n#if defined(SVR4) || defined(VMS) || defined(WIN32)\n#define X_GETTIMEOFDAY(t) gettimeofday(t)\n#else\n#define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*)0)\n#endif\n#endif /* XPG4 else */\n\n#ifdef MINIX\n#include <errno.h>\n#include <net/gen/in.h>\n#include <net/gen/socket.h>\n#include <net/gen/udp.h>\n#include <net/gen/udp_hdr.h>\n\nstruct sockaddr\n{\n\tu16_t sa_family;\n\tchar sa_data[14];\n};\n\nstruct sockaddr_in\n{\n\tu16_t sin_family;\n\tu16_t sin_port;\n\tstruct\n\t{\n\t\tipaddr_t s_addr;\n\t} sin_addr;\n\tchar sin_zero[8];\n};\n\nstruct in_addr\n{\n\tipaddr_t s_addr;\n};\n\ntypedef char *caddr_t;\ntypedef unsigned char u_char;\n#endif /* MINIX */\n\n#ifdef __EMX__\ntypedef unsigned long fd_mask;\n#endif\n\n/* use POSIX name for signal */\n#if defined(X_NOT_POSIX) && defined(SYSV) && !defined(SIGCHLD) && !defined(ISC)\n#define SIGCHLD SIGCLD\n#endif\n\n#ifdef ISC\n#include <sys/bsdtypes.h>\n#include <sys/limits.h>\n#define NGROUPS 16\n#endif\n\n#if defined(ISC) || defined(__EMX__)\n/*\n *\tSome OS's may not have this\n */\n\n#define X_NO_SYS_UN 1\n\nstruct sockaddr_un {\n\tshort\tsun_family;\n\tchar\tsun_path[108];\n};\n#endif\n\n#endif /* _XOS_H_ */\n"
  },
  {
    "path": "OSXvnc-server/include/X11/Xosdefs.h",
    "content": "/*\n * O/S-dependent (mis)feature macro definitions\n *\n * $XConsortium: Xosdefs.h /main/16 1996/09/28 16:17:29 rws $\n * $XFree86: xc/include/Xosdefs.h,v 3.11 1996/12/23 05:58:09 dawes Exp $\n *\nCopyright (c) 1991  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n */\n\n#ifndef _XOSDEFS_H_\n#define _XOSDEFS_H_\n\n/*\n * X_NOT_STDC_ENV means does not have ANSI C header files.  Lack of this\n * symbol does NOT mean that the system has stdarg.h.\n *\n * X_NOT_POSIX means does not have POSIX header files.  Lack of this\n * symbol does NOT mean that the POSIX environment is the default.\n * You may still have to define _POSIX_SOURCE to get it.\n */\n\n#ifdef NOSTDHDRS\n#define X_NOT_POSIX\n#define X_NOT_STDC_ENV\n#endif\n\n#ifdef sony\n#if !defined(SYSTYPE_SYSV) && !defined(_SYSTYPE_SYSV)\n#define X_NOT_POSIX\n#endif\n#endif\n\n#ifdef UTEK\n#define X_NOT_POSIX\n#define X_NOT_STDC_ENV\n#endif\n\n#ifdef vax\n#ifndef ultrix\t\t\t/* assume vanilla BSD */\n#define X_NOT_POSIX\n#define X_NOT_STDC_ENV\n#endif\n#endif\n\n#ifdef luna\n#define X_NOT_POSIX\n#define X_NOT_STDC_ENV\n#endif\n\n#ifdef Mips\n#define X_NOT_POSIX\n#define X_NOT_STDC_ENV\n#endif\n\n#ifdef USL\n#ifdef SYSV /* (release 3.2) */\n#define X_NOT_POSIX\n#define X_NOT_STDC_ENV\n#endif\n#endif\n\n#ifdef i386\n#ifdef SYSV\n#if !(defined(ISC) && defined(_POSIX_SOURCE))\n#ifndef SCO\n#ifndef _SCO_DS /* SCO 5.0 has SVR4 header files */\n#define X_NOT_POSIX\n#endif\n#define X_NOT_STDC_ENV\n#endif\n#endif /* !(defined(ISC) && defined(_POSIX_SOURCE)) */\n#endif\n#endif\n\n#ifdef MOTOROLA\n#ifdef SYSV\n#define X_NOT_STDC_ENV\n#endif\n#endif\n\n#ifdef sun\n#ifdef SVR4\n/* define this to whatever it needs to be */\n#define X_POSIX_C_SOURCE 199300L\n#endif\n#endif\n\n#ifdef WIN32\n#ifndef _POSIX_\n#define X_NOT_POSIX\n#endif\n#endif\n\n#if defined(nec_ews_svr2) || defined(SX) || defined(PC_UX)\n#define X_NOT_POSIX\n#define X_NOT_STDC_ENV\n#endif\n\n#ifdef __EMX__\n#define USGISH\n/* EMX claims to be ANSI, so X_NOT_STDC_ENV does not hold */\n/* could have been provided as std flags as well */\n#define X_WCHAR\n#define X_LOCALE\n#endif\n\n#endif /* _XOSDEFS_H_ */\n"
  },
  {
    "path": "OSXvnc-server/include/X11/Xproto.h",
    "content": "/*\n *\t$XConsortium: Xproto.h /main/21 1996/03/20 15:27:51 mor $\n */\n\n/* Definitions for the X window system used by server and c bindings */\n\n/*\n * This packet-construction scheme makes the following assumptions:\n *\n * 1. The compiler is able\n * to generate code which addresses one- and two-byte quantities.\n * In the worst case, this would be done with bit-fields.  If bit-fields\n * are used it may be necessary to reorder the request fields in this file,\n * depending on the order in which the machine assigns bit fields to\n * machine words.  There may also be a problem with sign extension,\n * as K+R specify that bitfields are always unsigned.\n *\n * 2. 2- and 4-byte fields in packet structures must be ordered by hand\n * such that they are naturally-aligned, so that no compiler will ever\n * insert padding bytes.\n *\n * 3. All packets are hand-padded to a multiple of 4 bytes, for\n * the same reason.\n */\n\n#ifndef XPROTO_H\n#define XPROTO_H\n\n/***********************************************************\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n******************************************************************/\n\n#include <X11/Xmd.h>\n#include <X11/Xprotostr.h>\n\n/*\n * Define constants for the sizes of the network packets.  The sz_ prefix is\n * used instead of something more descriptive so that the symbols are no more\n * than 32 characters in length (which causes problems for some compilers).\n */\n#define sz_xSegment 8\n#define sz_xPoint 4\n#define sz_xRectangle 8\n#define sz_xArc 12\n#define sz_xConnClientPrefix 12\n#define sz_xConnSetupPrefix 8\n#define sz_xConnSetup 32\n#define sz_xPixmapFormat 8\n#define sz_xDepth 8\n#define sz_xVisualType 24\n#define sz_xWindowRoot 40\n#define sz_xTimecoord 8\n#define sz_xHostEntry 4\n#define sz_xCharInfo 12\n#define sz_xFontProp 8\n#define sz_xTextElt 2\n#define sz_xColorItem 12\n#define sz_xrgb 8\n#define sz_xGenericReply 32\n#define sz_xGetWindowAttributesReply 44\n#define sz_xGetGeometryReply 32\n#define sz_xQueryTreeReply 32\n#define sz_xInternAtomReply 32\n#define sz_xGetAtomNameReply 32\n#define sz_xGetPropertyReply 32\n#define sz_xListPropertiesReply 32\n#define sz_xGetSelectionOwnerReply 32\n#define sz_xGrabPointerReply 32\n#define sz_xQueryPointerReply 32\n#define sz_xGetMotionEventsReply 32\n#define sz_xTranslateCoordsReply 32\n#define sz_xGetInputFocusReply 32\n#define sz_xQueryKeymapReply 40\n#define sz_xQueryFontReply 60\n#define sz_xQueryTextExtentsReply 32\n#define sz_xListFontsReply 32\n#define sz_xGetFontPathReply 32\n#define sz_xGetImageReply 32\n#define sz_xListInstalledColormapsReply 32\n#define sz_xAllocColorReply 32\n#define sz_xAllocNamedColorReply 32\n#define sz_xAllocColorCellsReply 32\n#define sz_xAllocColorPlanesReply 32\n#define sz_xQueryColorsReply 32\n#define sz_xLookupColorReply 32\n#define sz_xQueryBestSizeReply 32\n#define sz_xQueryExtensionReply 32\n#define sz_xListExtensionsReply 32\n#define sz_xSetMappingReply 32\n#define sz_xGetKeyboardControlReply 52\n#define sz_xGetPointerControlReply 32\n#define sz_xGetScreenSaverReply 32\n#define sz_xListHostsReply 32\n#define sz_xSetModifierMappingReply 32\n#define sz_xError 32\n#define sz_xEvent 32\n#define sz_xKeymapEvent 32\n#define sz_xReq 4\n#define sz_xResourceReq 8\n#define sz_xCreateWindowReq 32\n#define sz_xChangeWindowAttributesReq 12\n#define sz_xChangeSaveSetReq 8\n#define sz_xReparentWindowReq 16\n#define sz_xConfigureWindowReq 12\n#define sz_xCirculateWindowReq 8\n#define sz_xInternAtomReq 8\n#define sz_xChangePropertyReq 24\n#define sz_xDeletePropertyReq 12\n#define sz_xGetPropertyReq 24\n#define sz_xSetSelectionOwnerReq 16\n#define sz_xConvertSelectionReq 24\n#define sz_xSendEventReq 44\n#define sz_xGrabPointerReq 24\n#define sz_xGrabButtonReq 24\n#define sz_xUngrabButtonReq 12\n#define sz_xChangeActivePointerGrabReq 16\n#define sz_xGrabKeyboardReq 16\n#define sz_xGrabKeyReq 16\n#define sz_xUngrabKeyReq 12\n#define sz_xAllowEventsReq 8\n#define sz_xGetMotionEventsReq 16\n#define sz_xTranslateCoordsReq 16\n#define sz_xWarpPointerReq 24\n#define sz_xSetInputFocusReq 12\n#define sz_xOpenFontReq 12\n#define sz_xQueryTextExtentsReq 8\n#define sz_xListFontsReq 8\n#define sz_xSetFontPathReq 8\n#define sz_xCreatePixmapReq 16\n#define sz_xCreateGCReq 16\n#define sz_xChangeGCReq 12\n#define sz_xCopyGCReq 16\n#define sz_xSetDashesReq 12\n#define sz_xSetClipRectanglesReq 12\n#define sz_xCopyAreaReq 28\n#define sz_xCopyPlaneReq 32\n#define sz_xPolyPointReq 12\n#define sz_xPolySegmentReq 12\n#define sz_xFillPolyReq 16\n#define sz_xPutImageReq 24\n#define sz_xGetImageReq 20\n#define sz_xPolyTextReq 16\n#define sz_xImageTextReq 16\n#define sz_xCreateColormapReq 16\n#define sz_xCopyColormapAndFreeReq 12\n#define sz_xAllocColorReq 16\n#define sz_xAllocNamedColorReq 12\n#define sz_xAllocColorCellsReq 12\n#define sz_xAllocColorPlanesReq 16\n#define sz_xFreeColorsReq 12\n#define sz_xStoreColorsReq 8\n#define sz_xStoreNamedColorReq 16\n#define sz_xQueryColorsReq 8\n#define sz_xLookupColorReq 12\n#define sz_xCreateCursorReq 32\n#define sz_xCreateGlyphCursorReq 32\n#define sz_xRecolorCursorReq 20\n#define sz_xQueryBestSizeReq 12\n#define sz_xQueryExtensionReq 8\n#define sz_xChangeKeyboardControlReq 8\n#define sz_xBellReq 4\n#define sz_xChangePointerControlReq 12\n#define sz_xSetScreenSaverReq 12\n#define sz_xChangeHostsReq 8\n#define sz_xListHostsReq 4\n#define sz_xChangeModeReq 4\n#define sz_xRotatePropertiesReq 12\n#define sz_xReply 32\n#define sz_xGrabKeyboardReply 32\n#define sz_xListFontsWithInfoReply 60\n#define sz_xSetPointerMappingReply 32\n#define sz_xGetKeyboardMappingReply 32\n#define sz_xGetPointerMappingReply 32\n#define sz_xGetModifierMappingReply 32\n#define sz_xListFontsWithInfoReq 8\n#define sz_xPolyLineReq 12\n#define sz_xPolyArcReq 12\n#define sz_xPolyRectangleReq 12\n#define sz_xPolyFillRectangleReq 12\n#define sz_xPolyFillArcReq 12\n#define sz_xPolyText8Req 16\n#define sz_xPolyText16Req 16\n#define sz_xImageText8Req 16\n#define sz_xImageText16Req 16\n#define sz_xSetPointerMappingReq 4\n#define sz_xForceScreenSaverReq 4\n#define sz_xSetCloseDownModeReq 4\n#define sz_xClearAreaReq 16\n#define sz_xSetAccessControlReq 4\n#define sz_xGetKeyboardMappingReq 8\n#define sz_xSetModifierMappingReq 4\n#define sz_xPropIconSize 24\n#define sz_xChangeKeyboardMappingReq 8\n\n\n/* For the purpose of the structure definitions in this file,\nwe must redefine the following types in terms of Xmd.h's types, which may\ninclude bit fields.  All of these are #undef'd at the end of this file,\nrestoring the definitions in X.h.  */\n\n#define Window CARD32\n#define Drawable CARD32\n#define Font CARD32\n#define Pixmap CARD32\n#define Cursor CARD32\n#define Colormap CARD32\n#define GContext CARD32\n#define Atom CARD32\n#define VisualID CARD32\n#define Time CARD32\n#define KeyCode CARD8\n#define KeySym CARD32\n\n#define X_TCP_PORT 6000     /* add display number */\n\n#define xTrue        1\n#define xFalse       0\n\n\ntypedef CARD16 KeyButMask;\n\n/*****************\n   connection setup structure.  This is followed by\n   numRoots xWindowRoot structs.\n*****************/\n\ntypedef struct {\n    CARD8\tbyteOrder;\n    BYTE\tpad;\n    CARD16\tmajorVersion B16, minorVersion B16;\n    CARD16\tnbytesAuthProto B16;\t/* Authorization protocol */\n    CARD16\tnbytesAuthString B16;\t/* Authorization string */\n    CARD16\tpad2 B16;\n} xConnClientPrefix;\n\ntypedef struct {\n    CARD8          success;\n    BYTE           lengthReason; /*num bytes in string following if failure */\n    CARD16         majorVersion B16,\n                   minorVersion B16;\n    CARD16         length B16;  /* 1/4 additional bytes in setup info */\n} xConnSetupPrefix;\n\n\ntypedef struct {\n    CARD32         release B32;\n    CARD32         ridBase B32,\n                   ridMask B32;\n    CARD32         motionBufferSize B32;\n    CARD16         nbytesVendor B16;  /* number of bytes in vendor string */\n    CARD16         maxRequestSize B16;\n    CARD8          numRoots;          /* number of roots structs to follow */\n    CARD8          numFormats;        /* number of pixmap formats */\n    CARD8          imageByteOrder;        /* LSBFirst, MSBFirst */\n    CARD8          bitmapBitOrder;        /* LeastSignificant, MostSign...*/\n    CARD8          bitmapScanlineUnit,     /* 8, 16, 32 */\n                   bitmapScanlinePad;     /* 8, 16, 32 */\n    KeyCode\t   minKeyCode, maxKeyCode;\n    CARD32\t   pad2 B32;\n} xConnSetup;\n\ntypedef struct {\n    CARD8          depth;\n    CARD8          bitsPerPixel;\n    CARD8          scanLinePad;\n    CARD8          pad1;\n    CARD32\t   pad2 B32;\n} xPixmapFormat;\n\n/* window root */\n\ntypedef struct {\n    CARD8 \tdepth;\n    CARD8 \tpad1;\n    CARD16\tnVisuals B16;  /* number of xVisualType structures following */\n    CARD32\tpad2 B32;\n    } xDepth;\n\ntypedef struct {\n    VisualID visualID B32;\n#if defined(__cplusplus) || defined(c_plusplus)\n    CARD8 c_class;\n#else\n    CARD8 class;\n#endif\n    CARD8 bitsPerRGB;\n    CARD16 colormapEntries B16;\n    CARD32 redMask B32, greenMask B32, blueMask B32;\n    CARD32 pad B32;\n    } xVisualType;\n\ntypedef struct {\n    Window         windowId B32;\n    Colormap       defaultColormap B32;\n    CARD32         whitePixel B32, blackPixel B32;\n    CARD32         currentInputMask B32;\n    CARD16         pixWidth B16, pixHeight B16;\n    CARD16         mmWidth B16, mmHeight B16;\n    CARD16         minInstalledMaps B16, maxInstalledMaps B16;\n    VisualID       rootVisualID B32;\n    CARD8          backingStore;\n    BOOL           saveUnders;\n    CARD8          rootDepth;\n    CARD8          nDepths;  /* number of xDepth structures following */\n} xWindowRoot;\n\f\n\n/*****************************************************************\n * Structure Defns\n *   Structures needed for replies\n *****************************************************************/\n\n/* Used in GetMotionEvents */\n\ntypedef struct {\n    CARD32 time B32;\n    INT16 x B16, y B16;\n} xTimecoord;\n\ntypedef struct {\n    CARD8 family;\n    BYTE pad;\n    CARD16 length B16;\n} xHostEntry;\n\ntypedef struct {\n    INT16 leftSideBearing B16,\n\t  rightSideBearing B16,\n\t  characterWidth B16,\n\t  ascent B16,\n\t  descent B16;\n    CARD16 attributes B16;\n} xCharInfo;\n\ntypedef struct {\n    Atom name B32;\n    CARD32 value B32;\n} xFontProp;\n\n/*\n * non-aligned big-endian font ID follows this struct\n */\ntypedef struct {           /* followed by string */\n    CARD8 len;\t/* number of *characters* in string, or FontChange (255)\n\t\t   for font change, or 0 if just delta given */\n    INT8 delta;\n} xTextElt;\n\n\ntypedef struct {\n    CARD32 pixel B32;\n    CARD16 red B16, green B16, blue B16;\n    CARD8 flags;  /* DoRed, DoGreen, DoBlue booleans */\n    CARD8 pad;\n} xColorItem;\n\n\ntypedef struct {\n    CARD16 red B16, green B16, blue B16, pad B16;\n} xrgb;\n\ntypedef CARD8 KEYCODE;\n\f\n\n/*****************\n * XRep:\n *    meant to be 32 byte quantity\n *****************/\n\n/* GenericReply is the common format of all replies.  The \"data\" items\n   are specific to each individual reply type. */\n\ntypedef struct {\n    BYTE type;              /* X_Reply */\n    BYTE data1;             /* depends on reply type */\n    CARD16 sequenceNumber B16;  /* of last request received by server */\n    CARD32 length B32;      /* 4 byte quantities beyond size of GenericReply */\n    CARD32 data00 B32;\n    CARD32 data01 B32;\n    CARD32 data02 B32;\n    CARD32 data03 B32;\n    CARD32 data04 B32;\n    CARD32 data05 B32;\n    } xGenericReply;\n\n/* Individual reply formats. */\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    CARD8 backingStore;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;\t/* NOT 0; this is an extra-large reply */\n    VisualID visualID B32;\n#if defined(__cplusplus) || defined(c_plusplus)\n    CARD16 c_class B16;\n#else\n    CARD16 class B16;\n#endif\n    CARD8 bitGravity;\n    CARD8 winGravity;\n    CARD32 backingBitPlanes B32;\n    CARD32 backingPixel B32;\n    BOOL saveUnder;\n    BOOL mapInstalled;\n    CARD8 mapState;\n    BOOL override;\n    Colormap colormap B32;\n    CARD32 allEventMasks B32;\n    CARD32 yourEventMask B32;\n    CARD16 doNotPropagateMask B16;\n    CARD16 pad B16;\n    } xGetWindowAttributesReply;\n\ntypedef struct {\n    BYTE type;   /* X_Reply */\n    CARD8 depth;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;  /* 0 */\n    Window root B32;\n    INT16 x B16, y B16;\n    CARD16 width B16, height B16;\n    CARD16 borderWidth B16;\n    CARD16 pad1 B16;\n    CARD32 pad2 B32;\n    CARD32 pad3 B32;\n    } xGetGeometryReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;\n    Window root B32, parent B32;\n    CARD16 nChildren B16;\n    CARD16 pad2 B16;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    } xQueryTreeReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32; /* 0 */\n    Atom atom B32;\n    CARD32 pad2 B32;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    } xInternAtomReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;  /* of additional bytes */\n    CARD16 nameLength B16;  /* # of characters in name */\n    CARD16 pad2 B16;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    CARD32 pad7 B32;\n    } xGetAtomNameReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    CARD8 format;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32; /* of additional bytes */\n    Atom propertyType B32;\n    CARD32 bytesAfter B32;\n    CARD32 nItems B32; /* # of 8, 16, or 32-bit entities in reply */\n    CARD32 pad1 B32;\n    CARD32 pad2 B32;\n    CARD32 pad3 B32;\n    } xGetPropertyReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;\n    CARD16 nProperties B16;\n    CARD16 pad2 B16;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    CARD32 pad7 B32;\n    } xListPropertiesReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;  /* 0 */\n    Window owner B32;\n    CARD32 pad2 B32;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    } xGetSelectionOwnerReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BYTE status;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;  /* 0 */\n    CARD32 pad1 B32;\n    CARD32 pad2 B32;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    } xGrabPointerReply;\n\ntypedef xGrabPointerReply xGrabKeyboardReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BOOL sameScreen;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;  /* 0 */\n    Window root B32, child B32;\n    INT16 rootX B16, rootY B16, winX B16, winY B16;\n    CARD16 mask B16;\n    CARD16 pad1 B16;\n    CARD32 pad B32;\n    } xQueryPointerReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;\n    CARD32 nEvents B32;\n    CARD32 pad2 B32;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    } xGetMotionEventsReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BOOL sameScreen;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32; /* 0 */\n    Window child B32;\n    INT16 dstX B16, dstY B16;\n    CARD32 pad2 B32;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    } xTranslateCoordsReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    CARD8 revertTo;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;  /* 0 */\n    Window focus B32;\n    CARD32 pad1 B32;\n    CARD32 pad2 B32;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    } xGetInputFocusReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;  /* 2, NOT 0; this is an extra-large reply */\n    BYTE map[32];\n    } xQueryKeymapReply;\n\n/* Warning: this MUST match (up to component renaming) xListFontsWithInfoReply */\ntypedef struct _xQueryFontReply {\n    BYTE type;  /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;  /* definitely > 0, even if \"nCharInfos\" is 0 */\n    xCharInfo minBounds;\n#ifndef WORD64\n    CARD32 walign1 B32;\n#endif\n    xCharInfo maxBounds;\n#ifndef WORD64\n    CARD32 walign2 B32;\n#endif\n    CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;\n    CARD16 defaultChar B16;\n    CARD16 nFontProps B16;  /* followed by this many xFontProp structures */\n    CARD8 drawDirection;\n    CARD8 minByte1, maxByte1;\n    BOOL allCharsExist;\n    INT16 fontAscent B16, fontDescent B16;\n    CARD32 nCharInfos B32; /* followed by this many xCharInfo structures */\n} xQueryFontReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    CARD8 drawDirection;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;  /* 0 */\n    INT16 fontAscent B16, fontDescent B16;\n    INT16 overallAscent B16, overallDescent B16;\n    INT32 overallWidth B32, overallLeft B32, overallRight B32;\n    CARD32 pad B32;\n    } xQueryTextExtentsReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;\n    CARD16 nFonts B16;\n    CARD16 pad2 B16;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    CARD32 pad7 B32;\n    } xListFontsReply;\n\n/* Warning: this MUST match (up to component renaming) xQueryFontReply */\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    CARD8 nameLength;  /* 0 indicates end-of-reply-sequence */\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;  /* definitely > 0, even if \"nameLength\" is 0 */\n    xCharInfo minBounds;\n#ifndef WORD64\n    CARD32 walign1 B32;\n#endif\n    xCharInfo maxBounds;\n#ifndef WORD64\n    CARD32 walign2 B32;\n#endif\n    CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;\n    CARD16 defaultChar B16;\n    CARD16 nFontProps B16;  /* followed by this many xFontProp structures */\n    CARD8 drawDirection;\n    CARD8 minByte1, maxByte1;\n    BOOL allCharsExist;\n    INT16 fontAscent B16, fontDescent B16;\n    CARD32 nReplies B32;   /* hint as to how many more replies might be coming */\n} xListFontsWithInfoReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;\n    CARD16 nPaths B16;\n    CARD16 pad2 B16;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    CARD32 pad7 B32;\n    } xGetFontPathReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    CARD8 depth;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;\n    VisualID visual B32;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    CARD32 pad7 B32;\n    } xGetImageReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;\n    CARD16 nColormaps B16;\n    CARD16 pad2 B16;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    CARD32 pad7 B32;\n    } xListInstalledColormapsReply;\n\ntypedef struct {\n    BYTE type; /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;   /* 0 */\n    CARD16 red B16, green B16, blue B16;\n    CARD16 pad2 B16;\n    CARD32 pixel B32;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    } xAllocColorReply;\n\ntypedef struct {\n    BYTE type; /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;  /* 0 */\n    CARD32 pixel B32;\n    CARD16 exactRed B16, exactGreen B16, exactBlue B16;\n    CARD16 screenRed B16, screenGreen B16, screenBlue B16;\n    CARD32 pad2 B32;\n    CARD32 pad3 B32;\n    } xAllocNamedColorReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;\n    CARD16 nPixels B16, nMasks B16;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    CARD32 pad7 B32;\n    } xAllocColorCellsReply;\n\ntypedef struct {\n    BYTE type; /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;\n    CARD16 nPixels B16;\n    CARD16 pad2 B16;\n    CARD32 redMask B32, greenMask B32, blueMask B32;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    } xAllocColorPlanesReply;\n\ntypedef struct {\n    BYTE type; /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;\n    CARD16 nColors B16;\n    CARD16 pad2 B16;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    CARD32 pad7 B32;\n    } xQueryColorsReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;  /* 0 */\n    CARD16 exactRed B16, exactGreen B16, exactBlue B16;\n    CARD16 screenRed B16, screenGreen B16, screenBlue B16;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    } xLookupColorReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;  /* 0 */\n    CARD16 width B16, height B16;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    CARD32 pad7 B32;\n    } xQueryBestSizeReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32; /* 0 */\n    BOOL  present;\n    CARD8 major_opcode;\n    CARD8 first_event;\n    CARD8 first_error;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    CARD32 pad7 B32;\n    } xQueryExtensionReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    CARD8 nExtensions;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;\n    CARD32 pad2 B32;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    CARD32 pad7 B32;\n    } xListExtensionsReply;\n\n\ntypedef struct {\n    BYTE   type;  /* X_Reply */\n    CARD8  success;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;\n    CARD32 pad2 B32;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    CARD32 pad7 B32;\n    } xSetMappingReply;\ntypedef xSetMappingReply xSetPointerMappingReply;\ntypedef xSetMappingReply xSetModifierMappingReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    CARD8 nElts;  /* how many elements does the map have */\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;\n    CARD32 pad2 B32;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    CARD32 pad7 B32;\n    } xGetPointerMappingReply;\n\ntypedef struct {\n    BYTE type;\n    CARD8 keySymsPerKeyCode;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;\n    CARD32 pad2 B32;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    CARD32 pad7 B32;\n} xGetKeyboardMappingReply;\n\ntypedef struct {\n    BYTE type;\n    CARD8 numKeyPerModifier;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;\n    CARD32 pad1 B32;\n    CARD32 pad2 B32;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n} xGetModifierMappingReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BOOL globalAutoRepeat;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;  /* 5 */\n    CARD32 ledMask B32;\n    CARD8 keyClickPercent, bellPercent;\n    CARD16 bellPitch B16, bellDuration B16;\n    CARD16 pad B16;\n    BYTE map[32];  /* bit masks start here */\n    } xGetKeyboardControlReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;  /* 0 */\n    CARD16 accelNumerator B16, accelDenominator B16;\n    CARD16 threshold B16;\n    CARD16 pad2 B16;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    } xGetPointerControlReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BYTE pad1;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;  /* 0 */\n    CARD16 timeout B16, interval B16;\n    BOOL preferBlanking;\n    BOOL allowExposures;\n    CARD16 pad2 B16;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    } xGetScreenSaverReply;\n\ntypedef struct {\n    BYTE type;  /* X_Reply */\n    BOOL enabled;\n    CARD16 sequenceNumber B16;\n    CARD32 length B32;\n    CARD16 nHosts B16;\n    CARD16 pad1 B16;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    CARD32 pad7 B32;\n    } xListHostsReply;\n\n\f\n\n\n/*****************************************************************\n * Xerror\n *    All errors  are 32 bytes\n *****************************************************************/\n\ntypedef struct {\n    BYTE type;                  /* X_Error */\n    BYTE errorCode;\n    CARD16 sequenceNumber B16;       /* the nth request from this client */\n    CARD32 resourceID B32;\n    CARD16 minorCode B16;\n    CARD8 majorCode;\n    BYTE pad1;\n    CARD32 pad3 B32;\n    CARD32 pad4 B32;\n    CARD32 pad5 B32;\n    CARD32 pad6 B32;\n    CARD32 pad7 B32;\n} xError;\n\n/*****************************************************************\n * xEvent\n *    All events are 32 bytes\n *****************************************************************/\n\ntypedef struct _xEvent {\n    union {\n\tstruct {\n\t    BYTE type;\n\t    BYTE detail;\n\t    CARD16 sequenceNumber B16;\n\t    } u;\n\tstruct {\n            CARD32 pad00 B32;\n\t    Time time B32;\n\t    Window root B32, event B32, child B32;\n\t    INT16 rootX B16, rootY B16, eventX B16, eventY B16;\n\t    KeyButMask state B16;\n\t    BOOL sameScreen;\n\t    BYTE pad1;\n\t} keyButtonPointer;\n\tstruct {\n            CARD32 pad00 B32;\n            Time time B32;\n\t    Window root B32, event B32, child B32;\n\t    INT16 rootX B16, rootY B16, eventX B16, eventY B16;\n\t    KeyButMask state B16;\n\t    BYTE mode; \t\t\t/* really XMode */\n\t    BYTE flags;\t\t/* sameScreen and focus booleans, packed together */\n#define ELFlagFocus        (1<<0)\n#define ELFlagSameScreen   (1<<1)\n\t} enterLeave;\n\tstruct {\n            CARD32 pad00 B32;\n\t    Window window B32;\n\t    BYTE mode; \t\t\t/* really XMode */\n\t    BYTE pad1, pad2, pad3;\n\t} focus;\n\tstruct {\n            CARD32 pad00 B32;\n\t    Window window B32;\n\t    CARD16 x B16, y B16, width B16, height B16;\n\t    CARD16 count B16;\n\t    CARD16 pad2 B16;\n\t} expose;\n\tstruct {\n            CARD32 pad00 B32;\n\t    Drawable drawable B32;\n\t    CARD16 x B16, y B16, width B16, height B16;\n\t    CARD16 minorEvent B16;\n\t    CARD16 count B16;\n\t    BYTE majorEvent;\n\t    BYTE pad1, pad2, pad3;\n\t} graphicsExposure;\n\tstruct {\n            CARD32 pad00 B32;\n\t    Drawable drawable B32;\n\t    CARD16 minorEvent B16;\n\t    BYTE majorEvent;\n\t    BYTE bpad;\n\t} noExposure;\n\tstruct {\n            CARD32 pad00 B32;\n\t    Window window B32;\n\t    CARD8 state;\n\t    BYTE pad1, pad2, pad3;\n\t} visibility;\n\tstruct {\n            CARD32 pad00 B32;\n\t    Window parent B32, window B32;\n\t    INT16 x B16, y B16;\n\t    CARD16 width B16, height B16, borderWidth B16;\n\t    BOOL override;\n\t    BYTE bpad;\n        } createNotify;\n/*\n * The event feilds in the structures for DestroyNotify, UnmapNotify,\n * MapNotify, ReparentNotify, ConfigureNotify, CirclulateNotify, GravityNotify,\n * must be at the same offset because server internal code is depending upon\n * this to patch up the events before they are delivered.\n * Also note that MapRequest, ConfigureRequest and CirculateRequest have\n * the same offset for the event window.\n */\n\tstruct {\n            CARD32 pad00 B32;\n\t    Window event B32, window B32;\n\t} destroyNotify;\n\tstruct {\n            CARD32 pad00 B32;\n\t    Window event B32, window B32;\n\t    BOOL fromConfigure;\n\t    BYTE pad1, pad2, pad3;\n        } unmapNotify;\n\tstruct {\n            CARD32 pad00 B32;\n\t    Window event B32, window B32;\n\t    BOOL override;\n\t    BYTE pad1, pad2, pad3;\n        } mapNotify;\n\tstruct {\n            CARD32 pad00 B32;\n\t    Window parent B32, window B32;\n        } mapRequest;\n\tstruct {\n            CARD32 pad00 B32;\n\t    Window event B32, window B32, parent B32;\n\t    INT16 x B16, y B16;\n\t    BOOL override;\n\t    BYTE pad1, pad2, pad3;\n\t} reparent;\n\tstruct {\n            CARD32 pad00 B32;\n\t    Window event B32, window B32, aboveSibling B32;\n\t    INT16 x B16, y B16;\n\t    CARD16 width B16, height B16, borderWidth B16;\n\t    BOOL override;\n\t    BYTE bpad;\n\t} configureNotify;\n\tstruct {\n            CARD32 pad00 B32;\n\t    Window parent B32, window B32, sibling B32;\n\t    INT16 x B16, y B16;\n\t    CARD16 width B16, height B16, borderWidth B16;\n\t    CARD16 valueMask B16;\n\t    CARD32 pad1 B32;\n\t} configureRequest;\n\tstruct {\n            CARD32 pad00 B32;\n\t    Window event B32, window B32;\n\t    INT16 x B16, y B16;\n\t    CARD32 pad1 B32, pad2 B32, pad3 B32, pad4 B32;\n\t} gravity;\n\tstruct {\n            CARD32 pad00 B32;\n\t    Window window B32;\n\t    CARD16 width B16, height B16;\n\t} resizeRequest;\n\tstruct {\n/* The event field in the circulate record is really the parent when this\n   is used as a CirculateRequest insteaad of a CircluateNotify */\n            CARD32 pad00 B32;\n\t    Window event B32, window B32, parent B32;\n\t    BYTE place;\t\t\t/* Top or Bottom */\n\t    BYTE pad1, pad2, pad3;\n\t} circulate;\n\tstruct {\n            CARD32 pad00 B32;\n\t    Window window B32;\n\t    Atom atom B32;\n\t    Time time B32;\n\t    BYTE state;\t\t\t/* NewValue or Deleted */\n\t    BYTE pad1;\n\t    CARD16 pad2 B16;\n\t} property;\n\tstruct {\n            CARD32 pad00 B32;\n            Time time B32;\n\t    Window window B32;\n\t    Atom atom B32;\n\t} selectionClear;\n\tstruct {\n            CARD32 pad00 B32;\n            Time time B32;\n\t    Window owner B32, requestor B32;\n\t    Atom selection B32, target B32, property B32;\n\t} selectionRequest;\n\tstruct {\n            CARD32 pad00 B32;\n            Time time B32;\n\t    Window requestor B32;\n\t    Atom selection B32, target B32, property B32;\n\t} selectionNotify;\n\tstruct {\n            CARD32 pad00 B32;\n\t    Window window B32;\n\t    Colormap colormap B32;\n#if defined(__cplusplus) || defined(c_plusplus)\n\t    BOOL c_new;\n#else\n\t    BOOL new;\n#endif\n\t    BYTE state;\t\t\t/* Installed or UnInstalled */\n\t    BYTE pad1, pad2;\n\t} colormap;\n\tstruct {\n\t    CARD32 pad00 B32;\n\t    CARD8 request;\n\t    KeyCode firstKeyCode;\n\t    CARD8 count;\n\t    BYTE pad1;\n\t} mappingNotify;\n\tstruct {\n            CARD32 pad00 B32;\n\t    Window window B32;\n\t    union {\n\t\tstruct {\n\t\t    Atom type B32;\n\t\t    INT32 longs0 B32;\n\t\t    INT32 longs1 B32;\n\t\t    INT32 longs2 B32;\n\t\t    INT32 longs3 B32;\n\t\t    INT32 longs4 B32;\n\t\t} l;\n\t\tstruct {\n\t\t    Atom type B32;\n\t\t    INT16 shorts0 B16;\n\t\t    INT16 shorts1 B16;\n\t\t    INT16 shorts2 B16;\n\t\t    INT16 shorts3 B16;\n\t\t    INT16 shorts4 B16;\n\t\t    INT16 shorts5 B16;\n\t\t    INT16 shorts6 B16;\n\t\t    INT16 shorts7 B16;\n\t\t    INT16 shorts8 B16;\n\t\t    INT16 shorts9 B16;\n\t\t} s;\n\t\tstruct {\n\t\t    Atom type B32;\n\t\t    INT8 bytes[20];\n\t\t} b;\n\t    } u;\n\t} clientMessage;\n    } u;\n} xEvent;\n\n/* KeymapNotify events are not included in the above union because they\n   are different from all other events: they do not have a \"detail\"\n   or \"sequenceNumber\", so there is room for a 248-bit key mask. */\n\ntypedef struct {\n    BYTE type;\n    BYTE map[31];\n    } xKeymapEvent;\n\n#define XEventSize (sizeof(xEvent))\n\n/* XReply is the union of all the replies above whose \"fixed part\"\nfits in 32 bytes.  It does NOT include GetWindowAttributesReply,\nQueryFontReply, QueryKeymapReply, or GetKeyboardControlReply\nListFontsWithInfoReply */\n\ntypedef union {\n    xGenericReply generic;\n    xGetGeometryReply geom;\n    xQueryTreeReply tree;\n    xInternAtomReply atom;\n    xGetAtomNameReply atomName;\n    xGetPropertyReply property;\n    xListPropertiesReply listProperties;\n    xGetSelectionOwnerReply selection;\n    xGrabPointerReply grabPointer;\n    xGrabKeyboardReply grabKeyboard;\n    xQueryPointerReply pointer;\n    xGetMotionEventsReply motionEvents;\n    xTranslateCoordsReply coords;\n    xGetInputFocusReply inputFocus;\n    xQueryTextExtentsReply textExtents;\n    xListFontsReply fonts;\n    xGetFontPathReply fontPath;\n    xGetImageReply image;\n    xListInstalledColormapsReply colormaps;\n    xAllocColorReply allocColor;\n    xAllocNamedColorReply allocNamedColor;\n    xAllocColorCellsReply colorCells;\n    xAllocColorPlanesReply colorPlanes;\n    xQueryColorsReply colors;\n    xLookupColorReply lookupColor;\n    xQueryBestSizeReply bestSize;\n    xQueryExtensionReply extension;\n    xListExtensionsReply extensions;\n    xSetModifierMappingReply setModifierMapping;\n    xGetModifierMappingReply getModifierMapping;\n    xSetPointerMappingReply setPointerMapping;\n    xGetKeyboardMappingReply getKeyboardMapping;\n    xGetPointerMappingReply getPointerMapping;\n    xGetPointerControlReply pointerControl;\n    xGetScreenSaverReply screenSaver;\n    xListHostsReply hosts;\n    xError error;\n    xEvent event;\n} xReply;\n\n\f\n\n/*****************************************************************\n * REQUESTS\n *****************************************************************/\n\n\n/* Request structure */\n\ntypedef struct _xReq {\n\tCARD8 reqType;\n\tCARD8 data;            /* meaning depends on request type */\n\tCARD16 length B16;         /* length in 4 bytes quantities\n\t\t\t\t  of whole request, including this header */\n} xReq;\n\n/*****************************************************************\n *  structures that follow request.\n *****************************************************************/\n\n/* ResourceReq is used for any request which has a resource ID\n   (or Atom or Time) as its one and only argument.  */\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    CARD32 id B32;  /* a Window, Drawable, Font, GContext, Pixmap, etc. */\n    } xResourceReq;\n\ntypedef struct {\n    CARD8 reqType;\n    CARD8 depth;\n    CARD16 length B16;\n    Window wid B32, parent B32;\n    INT16 x B16, y B16;\n    CARD16 width B16, height B16, borderWidth B16;\n#if defined(__cplusplus) || defined(c_plusplus)\n    CARD16 c_class B16;\n#else\n    CARD16 class B16;\n#endif\n    VisualID visual B32;\n    CARD32 mask B32;\n} xCreateWindowReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Window window B32;\n    CARD32 valueMask B32;\n} xChangeWindowAttributesReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE mode;\n    CARD16 length B16;\n    Window window B32;\n} xChangeSaveSetReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Window window B32, parent B32;\n    INT16 x B16, y B16;\n} xReparentWindowReq;\n\ntypedef struct {\n    CARD8 reqType;\n    CARD8 pad;\n    CARD16 length B16;\n    Window window B32;\n    CARD16 mask B16;\n    CARD16 pad2 B16;\n} xConfigureWindowReq;\n\ntypedef struct {\n    CARD8 reqType;\n    CARD8 direction;\n    CARD16 length B16;\n    Window window B32;\n} xCirculateWindowReq;\n\ntypedef struct {    /* followed by padded string */\n    CARD8 reqType;\n    BOOL onlyIfExists;\n    CARD16 length B16;\n    CARD16 nbytes  B16;    /* number of bytes in string */\n    CARD16 pad B16;\n} xInternAtomReq;\n\ntypedef struct {\n    CARD8 reqType;\n    CARD8 mode;\n    CARD16 length B16;\n    Window window B32;\n    Atom property B32, type B32;\n    CARD8 format;\n    BYTE pad[3];\n    CARD32 nUnits B32;     /* length of stuff following, depends on format */\n} xChangePropertyReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Window window B32;\n    Atom property B32;\n} xDeletePropertyReq;\n\ntypedef struct {\n    CARD8 reqType;\n#if defined(__cplusplus) || defined(c_plusplus)\n    BOOL c_delete;\n#else\n    BOOL delete;\n#endif\n    CARD16 length B16;\n    Window window B32;\n    Atom property B32, type B32;\n    CARD32 longOffset B32;\n    CARD32 longLength B32;\n} xGetPropertyReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Window window B32;\n    Atom selection B32;\n    Time time B32;\n} xSetSelectionOwnerReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Window requestor B32;\n    Atom selection B32, target B32, property B32;\n    Time time B32;\n    } xConvertSelectionReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BOOL propagate;\n    CARD16 length B16;\n    Window destination B32;\n    CARD32 eventMask B32;\n#ifdef WORD64\n    /* the structure should have been quad-aligned */\n    BYTE eventdata[SIZEOF(xEvent)];\n#else\n    xEvent event;\n#endif /* WORD64 */\n} xSendEventReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BOOL ownerEvents;\n    CARD16 length B16;\n    Window grabWindow B32;\n    CARD16 eventMask B16;\n    BYTE pointerMode, keyboardMode;\n    Window confineTo B32;\n    Cursor cursor B32;\n    Time time B32;\n} xGrabPointerReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BOOL ownerEvents;\n    CARD16 length B16;\n    Window grabWindow B32;\n    CARD16 eventMask B16;\n    BYTE pointerMode, keyboardMode;\n    Window confineTo B32;\n    Cursor cursor B32;\n    CARD8 button;\n    BYTE pad;\n    CARD16 modifiers B16;\n} xGrabButtonReq;\n\ntypedef struct {\n    CARD8 reqType;\n    CARD8 button;\n    CARD16 length B16;\n    Window grabWindow B32;\n    CARD16 modifiers B16;\n    CARD16 pad B16;\n} xUngrabButtonReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Cursor cursor B32;\n    Time time B32;\n    CARD16 eventMask B16;\n    CARD16 pad2 B16;\n} xChangeActivePointerGrabReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BOOL ownerEvents;\n    CARD16 length B16;\n    Window grabWindow B32;\n    Time time B32;\n    BYTE pointerMode, keyboardMode;\n    CARD16 pad B16;\n} xGrabKeyboardReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BOOL ownerEvents;\n    CARD16 length B16;\n    Window grabWindow B32;\n    CARD16 modifiers B16;\n    CARD8 key;\n    BYTE pointerMode, keyboardMode;\n    BYTE pad1, pad2, pad3;\n} xGrabKeyReq;\n\ntypedef struct {\n    CARD8 reqType;\n    CARD8 key;\n    CARD16 length B16;\n    Window grabWindow B32;\n    CARD16 modifiers B16;\n    CARD16 pad B16;\n} xUngrabKeyReq;\n\ntypedef struct {\n    CARD8 reqType;\n    CARD8 mode;\n    CARD16 length B16;\n    Time time B32;\n} xAllowEventsReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Window window B32;\n    Time start B32, stop B32;\n} xGetMotionEventsReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Window srcWid B32, dstWid B32;\n    INT16 srcX B16, srcY B16;\n} xTranslateCoordsReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Window srcWid B32, dstWid B32;\n    INT16 srcX B16, srcY B16;\n    CARD16 srcWidth B16, srcHeight B16;\n    INT16 dstX B16, dstY B16;\n} xWarpPointerReq;\n\ntypedef struct {\n    CARD8 reqType;\n    CARD8 revertTo;\n    CARD16 length B16;\n    Window focus B32;\n    Time time B32;\n} xSetInputFocusReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Font fid B32;\n    CARD16 nbytes B16;\n    BYTE pad1, pad2;\t/* string follows on word boundary */\n} xOpenFontReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BOOL oddLength;\n    CARD16 length B16;\n    Font fid B32;\n    } xQueryTextExtentsReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    CARD16 maxNames B16;\n    CARD16 nbytes B16;  /* followed immediately by string bytes */\n} xListFontsReq;\n\ntypedef xListFontsReq xListFontsWithInfoReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    CARD16 nFonts B16;\n    BYTE pad1, pad2;\t/* LISTofSTRING8 follows on word boundary */\n} xSetFontPathReq;\n\ntypedef struct {\n    CARD8 reqType;\n    CARD8 depth;\n    CARD16 length B16;\n    Pixmap pid B32;\n    Drawable drawable B32;\n    CARD16 width B16, height B16;\n} xCreatePixmapReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    GContext gc B32;\n    Drawable drawable B32;\n    CARD32 mask B32;\n} xCreateGCReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    GContext gc B32;\n    CARD32 mask B32;\n} xChangeGCReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    GContext srcGC B32, dstGC B32;\n    CARD32 mask B32;\n} xCopyGCReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    GContext gc B32;\n    CARD16 dashOffset B16;\n    CARD16 nDashes B16;        /* length LISTofCARD8 of values following */\n} xSetDashesReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE ordering;\n    CARD16 length B16;\n    GContext gc B32;\n    INT16 xOrigin B16, yOrigin B16;\n} xSetClipRectanglesReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BOOL exposures;\n    CARD16 length B16;\n    Window window B32;\n    INT16 x B16, y B16;\n    CARD16 width B16, height B16;\n} xClearAreaReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Drawable srcDrawable B32, dstDrawable B32;\n    GContext gc B32;\n    INT16 srcX B16, srcY B16, dstX B16, dstY B16;\n    CARD16 width B16, height B16;\n} xCopyAreaReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Drawable srcDrawable B32, dstDrawable B32;\n    GContext gc B32;\n    INT16 srcX B16, srcY B16, dstX B16, dstY B16;\n    CARD16 width B16, height B16;\n    CARD32 bitPlane B32;\n} xCopyPlaneReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE coordMode;\n    CARD16 length B16;\n    Drawable drawable B32;\n    GContext gc B32;\n} xPolyPointReq;\n\ntypedef xPolyPointReq xPolyLineReq;  /* same request structure */\n\n/* The following used for PolySegment, PolyRectangle, PolyArc, PolyFillRectangle, PolyFillArc */\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Drawable drawable B32;\n    GContext gc B32;\n} xPolySegmentReq;\n\ntypedef xPolySegmentReq xPolyArcReq;\ntypedef xPolySegmentReq xPolyRectangleReq;\ntypedef xPolySegmentReq xPolyFillRectangleReq;\ntypedef xPolySegmentReq xPolyFillArcReq;\n\ntypedef struct _FillPolyReq {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Drawable drawable B32;\n    GContext gc B32;\n    BYTE shape;\n    BYTE coordMode;\n    CARD16 pad1 B16;\n} xFillPolyReq;\n\n\ntypedef struct _PutImageReq {\n    CARD8 reqType;\n    CARD8 format;\n    CARD16 length B16;\n    Drawable drawable B32;\n    GContext gc B32;\n    CARD16 width B16, height B16;\n    INT16 dstX B16, dstY B16;\n    CARD8 leftPad;\n    CARD8 depth;\n    CARD16 pad B16;\n} xPutImageReq;\n\ntypedef struct {\n    CARD8 reqType;\n    CARD8 format;\n    CARD16 length B16;\n    Drawable drawable B32;\n    INT16 x B16, y B16;\n    CARD16 width B16, height B16;\n    CARD32 planeMask B32;\n} xGetImageReq;\n\n/* the folloiwng used by PolyText8 and PolyText16 */\n\ntypedef struct {\n    CARD8 reqType;\n    CARD8 pad;\n    CARD16 length B16;\n    Drawable drawable B32;\n    GContext gc B32;\n    INT16 x B16, y B16;\t\t/* items (xTextElt) start after struct */\n} xPolyTextReq;\n\ntypedef xPolyTextReq xPolyText8Req;\ntypedef xPolyTextReq xPolyText16Req;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE nChars;\n    CARD16 length B16;\n    Drawable drawable B32;\n    GContext gc B32;\n    INT16 x B16, y B16;\n} xImageTextReq;\n\ntypedef xImageTextReq xImageText8Req;\ntypedef xImageTextReq xImageText16Req;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE alloc;\n    CARD16 length B16;\n    Colormap mid B32;\n    Window window B32;\n    VisualID visual B32;\n} xCreateColormapReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Colormap mid B32;\n    Colormap srcCmap B32;\n} xCopyColormapAndFreeReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Colormap cmap B32;\n    CARD16 red B16, green B16, blue B16;\n    CARD16 pad2 B16;\n} xAllocColorReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Colormap cmap B32;\n    CARD16 nbytes B16;  /* followed by structure */\n    BYTE pad1, pad2;\n} xAllocNamedColorReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BOOL contiguous;\n    CARD16 length B16;\n    Colormap cmap B32;\n    CARD16 colors B16, planes B16;\n} xAllocColorCellsReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BOOL contiguous;\n    CARD16 length B16;\n    Colormap cmap B32;\n    CARD16 colors B16, red B16, green B16, blue B16;\n} xAllocColorPlanesReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Colormap cmap B32;\n    CARD32 planeMask B32;\n} xFreeColorsReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Colormap cmap B32;\n} xStoreColorsReq;\n\ntypedef struct {\n    CARD8 reqType;\n    CARD8 flags;   /* DoRed, DoGreen, DoBlue, as in xColorItem */\n    CARD16 length B16;\n    Colormap cmap B32;\n    CARD32 pixel B32;\n    CARD16 nbytes B16;  /* number of name string bytes following structure */\n    BYTE pad1, pad2;\n    } xStoreNamedColorReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Colormap cmap B32;\n} xQueryColorsReq;\n\ntypedef struct {    /* followed  by string of length len */\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Colormap cmap B32;\n    CARD16 nbytes B16;  /* number of string bytes following structure*/\n    BYTE pad1, pad2;\n} xLookupColorReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Cursor cid B32;\n    Pixmap source B32, mask B32;\n    CARD16 foreRed B16, foreGreen B16, foreBlue B16;\n    CARD16 backRed B16, backGreen B16, backBlue B16;\n    CARD16 x B16, y B16;\n} xCreateCursorReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Cursor cid B32;\n    Font source B32, mask B32;\n    CARD16 sourceChar B16, maskChar B16;\n    CARD16 foreRed B16, foreGreen B16, foreBlue B16;\n    CARD16 backRed B16, backGreen B16, backBlue B16;\n} xCreateGlyphCursorReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Cursor cursor B32;\n    CARD16 foreRed B16, foreGreen B16, foreBlue B16;\n    CARD16 backRed B16, backGreen B16, backBlue B16;\n} xRecolorCursorReq;\n\ntypedef struct {\n    CARD8 reqType;\n#if defined(__cplusplus) || defined(c_plusplus)\n    CARD8 c_class;\n#else\n    CARD8 class;\n#endif\n    CARD16 length B16;\n    Drawable drawable B32;\n    CARD16 width B16, height B16;\n} xQueryBestSizeReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    CARD16 nbytes B16;  /* number of string bytes following structure */\n    BYTE pad1, pad2;\n} xQueryExtensionReq;\n\ntypedef struct {\n    CARD8   reqType;\n    CARD8   numKeyPerModifier;\n    CARD16  length B16;\n} xSetModifierMappingReq;\n\ntypedef struct {\n    CARD8 reqType;\n    CARD8 nElts;  /* how many elements in the map */\n    CARD16 length B16;\n} xSetPointerMappingReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    KeyCode firstKeyCode;\n    CARD8 count;\n    CARD16 pad1 B16;\n} xGetKeyboardMappingReq;\n\ntypedef struct {\n    CARD8 reqType;\n    CARD8 keyCodes;\n    CARD16 length B16;\n    KeyCode firstKeyCode;\n    CARD8 keySymsPerKeyCode;\n    CARD16 pad1 B16;\n} xChangeKeyboardMappingReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    CARD32 mask B32;\n} xChangeKeyboardControlReq;\n\ntypedef struct {\n    CARD8 reqType;\n    INT8 percent;  /* -100 to 100 */\n    CARD16 length B16;\n} xBellReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    INT16 accelNum B16, accelDenum B16;\n    INT16 threshold B16;\n    BOOL doAccel, doThresh;\n} xChangePointerControlReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    INT16 timeout B16, interval B16;\n    BYTE preferBlank, allowExpose;\n    CARD16 pad2 B16;\n} xSetScreenSaverReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE mode;\n    CARD16 length B16;\n    CARD8 hostFamily;\n    BYTE pad;\n    CARD16 hostLength B16;\n} xChangeHostsReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    } xListHostsReq;\n\ntypedef struct {\n    CARD8 reqType;\n    BYTE mode;\n    CARD16 length B16;\n    } xChangeModeReq;\n\ntypedef xChangeModeReq xSetAccessControlReq;\ntypedef xChangeModeReq xSetCloseDownModeReq;\ntypedef xChangeModeReq xForceScreenSaverReq;\n\ntypedef struct { /* followed by LIST of ATOM */\n    CARD8 reqType;\n    BYTE pad;\n    CARD16 length B16;\n    Window window B32;\n    CARD16 nAtoms B16;\n    INT16 nPositions B16;\n    } xRotatePropertiesReq;\n\n\f\n\n/* Reply codes */\n\n#define X_Reply\t\t1\t\t/* Normal reply */\n#define X_Error\t\t0\t\t/* Error */\n\n/* Request codes */\n\n#define X_CreateWindow                  1\n#define X_ChangeWindowAttributes        2\n#define X_GetWindowAttributes           3\n#define X_DestroyWindow                 4\n#define X_DestroySubwindows             5\n#define X_ChangeSaveSet                 6\n#define X_ReparentWindow                7\n#define X_MapWindow                     8\n#define X_MapSubwindows                 9\n#define X_UnmapWindow                  10\n#define X_UnmapSubwindows              11\n#define X_ConfigureWindow              12\n#define X_CirculateWindow              13\n#define X_GetGeometry                  14\n#define X_QueryTree                    15\n#define X_InternAtom                   16\n#define X_GetAtomName                  17\n#define X_ChangeProperty               18\n#define X_DeleteProperty               19\n#define X_GetProperty                  20\n#define X_ListProperties               21\n#define X_SetSelectionOwner            22\n#define X_GetSelectionOwner            23\n#define X_ConvertSelection             24\n#define X_SendEvent                    25\n#define X_GrabPointer                  26\n#define X_UngrabPointer                27\n#define X_GrabButton                   28\n#define X_UngrabButton                 29\n#define X_ChangeActivePointerGrab      30\n#define X_GrabKeyboard                 31\n#define X_UngrabKeyboard               32\n#define X_GrabKey                      33\n#define X_UngrabKey                    34\n#define X_AllowEvents                  35\n#define X_GrabServer                   36\n#define X_UngrabServer                 37\n#define X_QueryPointer                 38\n#define X_GetMotionEvents              39\n#define X_TranslateCoords              40\n#define X_WarpPointer                  41\n#define X_SetInputFocus                42\n#define X_GetInputFocus                43\n#define X_QueryKeymap                  44\n#define X_OpenFont                     45\n#define X_CloseFont                    46\n#define X_QueryFont                    47\n#define X_QueryTextExtents             48\n#define X_ListFonts                    49\n#define X_ListFontsWithInfo    \t       50\n#define X_SetFontPath                  51\n#define X_GetFontPath                  52\n#define X_CreatePixmap                 53\n#define X_FreePixmap                   54\n#define X_CreateGC                     55\n#define X_ChangeGC                     56\n#define X_CopyGC                       57\n#define X_SetDashes                    58\n#define X_SetClipRectangles            59\n#define X_FreeGC                       60\n#define X_ClearArea                    61\n#define X_CopyArea                     62\n#define X_CopyPlane                    63\n#define X_PolyPoint                    64\n#define X_PolyLine                     65\n#define X_PolySegment                  66\n#define X_PolyRectangle                67\n#define X_PolyArc                      68\n#define X_FillPoly                     69\n#define X_PolyFillRectangle            70\n#define X_PolyFillArc                  71\n#define X_PutImage                     72\n#define X_GetImage                     73\n#define X_PolyText8                    74\n#define X_PolyText16                   75\n#define X_ImageText8                   76\n#define X_ImageText16                  77\n#define X_CreateColormap               78\n#define X_FreeColormap                 79\n#define X_CopyColormapAndFree          80\n#define X_InstallColormap              81\n#define X_UninstallColormap            82\n#define X_ListInstalledColormaps       83\n#define X_AllocColor                   84\n#define X_AllocNamedColor              85\n#define X_AllocColorCells              86\n#define X_AllocColorPlanes             87\n#define X_FreeColors                   88\n#define X_StoreColors                  89\n#define X_StoreNamedColor              90\n#define X_QueryColors                  91\n#define X_LookupColor                  92\n#define X_CreateCursor                 93\n#define X_CreateGlyphCursor            94\n#define X_FreeCursor                   95\n#define X_RecolorCursor                96\n#define X_QueryBestSize                97\n#define X_QueryExtension               98\n#define X_ListExtensions               99\n#define X_ChangeKeyboardMapping        100\n#define X_GetKeyboardMapping           101\n#define X_ChangeKeyboardControl        102\n#define X_GetKeyboardControl           103\n#define X_Bell                         104\n#define X_ChangePointerControl         105\n#define X_GetPointerControl            106\n#define X_SetScreenSaver               107\n#define X_GetScreenSaver               108\n#define X_ChangeHosts                  109\n#define X_ListHosts                    110\n#define X_SetAccessControl             111\n#define X_SetCloseDownMode             112\n#define X_KillClient                   113\n#define X_RotateProperties\t       114\n#define X_ForceScreenSaver\t       115\n#define X_SetPointerMapping            116\n#define X_GetPointerMapping            117\n#define X_SetModifierMapping\t       118\n#define X_GetModifierMapping\t       119\n#define X_NoOperation                  127\n\n/* restore these definitions back to the typedefs in X.h */\n#undef Window\n#undef Drawable\n#undef Font\n#undef Pixmap\n#undef Cursor\n#undef Colormap\n#undef GContext\n#undef Atom\n#undef VisualID\n#undef Time\n#undef KeyCode\n#undef KeySym\n\n#endif /* XPROTO_H */\n"
  },
  {
    "path": "OSXvnc-server/include/X11/Xprotostr.h",
    "content": "/* $XConsortium: Xprotostr.h,v 1.5 94/04/17 20:10:53 rws Exp $ */\n#ifndef XPROTOSTRUCTS_H\n#define XPROTOSTRUCTS_H\n\n/***********************************************************\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n******************************************************************/\n#include <X11/Xmd.h>\n\n/* Used by PolySegment */\n\ntypedef struct _xSegment {\n    INT16 x1 B16, y1 B16, x2 B16, y2 B16;\n} xSegment;\n\n/* POINT */\n\ntypedef struct _xPoint {\n\tINT16\t\tx B16, y B16;\n} xPoint;\n\ntypedef struct _xRectangle {\n    INT16 x B16, y B16;\n    CARD16  width B16, height B16;\n} xRectangle;\n\n/*  ARC  */\n\ntypedef struct _xArc {\n    INT16 x B16, y B16;\n    CARD16   width B16, height B16;\n    INT16   angle1 B16, angle2 B16;\n} xArc;\n\n#endif /* XPROTOSTRUCTS_H */\n"
  },
  {
    "path": "OSXvnc-server/include/X11/keysym.h",
    "content": "/* $XConsortium: keysym.h,v 1.15 94/04/17 20:10:55 rws Exp $ */\n\n/***********************************************************\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n******************************************************************/\n\n/* default keysyms */\n#define XK_MISCELLANY\n#define XK_XKB_KEYS\n#define XK_LATIN1\n#define XK_LATIN2\n#define XK_LATIN3\n#define XK_LATIN4\n#define XK_GREEK\n\n#include <X11/keysymdef.h>\n"
  },
  {
    "path": "OSXvnc-server/include/X11/keysymdef.h",
    "content": "/* $TOG: keysymdef.h /main/25 1997/06/21 10:54:51 kaleb $ */\n\n/***********************************************************\nCopyright (c) 1987, 1994  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR\nOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall\nnot be used in advertising or otherwise to promote the sale, use or\nother dealings in this Software without prior written authorization\nfrom the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS// // #ifdef ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n******************************************************************/\n\n#define XK_VoidSymbol\t\t0xFFFFFF\t/* void symbol */\n\n// #ifdef XK_MISCELLANY\n/*\n * TTY Functions, cleverly chosen to map to ascii, for convenience of\n * programming, but could have been arbitrary (at the cost of lookup\n * tables in client code.\n */\n\n#define XK_BackSpace\t\t0xFF08\t/* back space, back char */\n#define XK_Tab\t\t\t0xFF09\n#define XK_Linefeed\t\t0xFF0A\t/* Linefeed, LF */\n#define XK_Clear\t\t0xFF0B\n#define XK_Return\t\t0xFF0D\t/* Return, enter */\n#define XK_Pause\t\t0xFF13\t/* Pause, hold */\n#define XK_Scroll_Lock\t\t0xFF14\n#define XK_Sys_Req\t\t0xFF15\n#define XK_Escape\t\t0xFF1B\n#define XK_Delete\t\t0xFFFF\t/* Delete, rubout */\n\n\n\n/* International & multi-key character composition */\n\n#define XK_Multi_key\t\t0xFF20  /* Multi-key character compose */\n#define XK_SingleCandidate\t0xFF3C\n#define XK_MultipleCandidate\t0xFF3D\n#define XK_PreviousCandidate\t0xFF3E\n\n/* Japanese keyboard support */\n\n#define XK_Kanji\t\t0xFF21\t/* Kanji, Kanji convert */\n#define XK_Muhenkan\t\t0xFF22  /* Cancel Conversion */\n#define XK_Henkan_Mode\t\t0xFF23  /* Start/Stop Conversion */\n#define XK_Henkan\t\t0xFF23  /* Alias for Henkan_Mode */\n#define XK_Romaji\t\t0xFF24  /* to Romaji */\n#define XK_Hiragana\t\t0xFF25  /* to Hiragana */\n#define XK_Katakana\t\t0xFF26  /* to Katakana */\n#define XK_Hiragana_Katakana\t0xFF27  /* Hiragana/Katakana toggle */\n#define XK_Zenkaku\t\t0xFF28  /* to Zenkaku */\n#define XK_Hankaku\t\t0xFF29  /* to Hankaku */\n#define XK_Zenkaku_Hankaku\t0xFF2A  /* Zenkaku/Hankaku toggle */\n#define XK_Touroku\t\t0xFF2B  /* Add to Dictionary */\n#define XK_Massyo\t\t0xFF2C  /* Delete from Dictionary */\n#define XK_Kana_Lock\t\t0xFF2D  /* Kana Lock */\n#define XK_Kana_Shift\t\t0xFF2E  /* Kana Shift */\n#define XK_Eisu_Shift\t\t0xFF2F  /* Alphanumeric Shift */\n#define XK_Eisu_toggle\t\t0xFF30  /* Alphanumeric toggle */\n#define XK_Zen_Koho\t\t0xFF3D\t/* Multiple/All Candidate(s) */\n#define XK_Mae_Koho\t\t0xFF3E\t/* Previous Candidate */\n\n/* 0xFF31 through 0xFF3F are under XK_KOREAN */\n\n/* Cursor control & motion */\n\n#define XK_Home\t\t\t0xFF50\n#define XK_Left\t\t\t0xFF51\t/* Move left, left arrow */\n#define XK_Up\t\t\t0xFF52\t/* Move up, up arrow */\n#define XK_Right\t\t0xFF53\t/* Move right, right arrow */\n#define XK_Down\t\t\t0xFF54\t/* Move down, down arrow */\n#define XK_Prior\t\t0xFF55\t/* Prior, previous */\n#define XK_Page_Up\t\t0xFF55\n#define XK_Next\t\t\t0xFF56\t/* Next */\n#define XK_Page_Down\t\t0xFF56\n#define XK_End\t\t\t0xFF57\t/* EOL */\n#define XK_Begin\t\t0xFF58\t/* BOL */\n\n\n/* Misc Functions */\n\n#define XK_Select\t\t0xFF60\t/* Select, mark */\n#define XK_Print\t\t0xFF61\n#define XK_Execute\t\t0xFF62\t/* Execute, run, do */\n#define XK_Insert\t\t0xFF63\t/* Insert, insert here */\n#define XK_Undo\t\t\t0xFF65\t/* Undo, oops */\n#define XK_Redo\t\t\t0xFF66\t/* redo, again */\n#define XK_Menu\t\t\t0xFF67\n#define XK_Find\t\t\t0xFF68\t/* Find, search */\n#define XK_Cancel\t\t0xFF69\t/* Cancel, stop, abort, exit */\n#define XK_Help\t\t\t0xFF6A\t/* Help */\n#define XK_Break\t\t0xFF6B\n#define XK_Mode_switch\t\t0xFF7E\t/* Character set switch */\n#define XK_script_switch        0xFF7E  /* Alias for mode_switch */\n#define XK_Num_Lock\t\t0xFF7F\n\n/* Keypad Functions, keypad numbers cleverly chosen to map to ascii */\n\n#define XK_KP_Space\t\t0xFF80\t/* space */\n#define XK_KP_Tab\t\t0xFF89\n#define XK_KP_Enter\t\t0xFF8D\t/* enter */\n#define XK_KP_F1\t\t0xFF91\t/* PF1, KP_A, ... */\n#define XK_KP_F2\t\t0xFF92\n#define XK_KP_F3\t\t0xFF93\n#define XK_KP_F4\t\t0xFF94\n#define XK_KP_Home\t\t0xFF95\n#define XK_KP_Left\t\t0xFF96\n#define XK_KP_Up\t\t0xFF97\n#define XK_KP_Right\t\t0xFF98\n#define XK_KP_Down\t\t0xFF99\n#define XK_KP_Prior\t\t0xFF9A\n#define XK_KP_Page_Up\t\t0xFF9A\n#define XK_KP_Next\t\t0xFF9B\n#define XK_KP_Page_Down\t\t0xFF9B\n#define XK_KP_End\t\t0xFF9C\n#define XK_KP_Begin\t\t0xFF9D\n#define XK_KP_Insert\t\t0xFF9E\n#define XK_KP_Delete\t\t0xFF9F\n#define XK_KP_Equal\t\t0xFFBD\t/* equals */\n#define XK_KP_Multiply\t\t0xFFAA\n#define XK_KP_Add\t\t0xFFAB\n#define XK_KP_Separator\t\t0xFFAC\t/* separator, often comma */\n#define XK_KP_Subtract\t\t0xFFAD\n#define XK_KP_Decimal\t\t0xFFAE\n#define XK_KP_Divide\t\t0xFFAF\n\n#define XK_KP_0\t\t\t0xFFB0\n#define XK_KP_1\t\t\t0xFFB1\n#define XK_KP_2\t\t\t0xFFB2\n#define XK_KP_3\t\t\t0xFFB3\n#define XK_KP_4\t\t\t0xFFB4\n#define XK_KP_5\t\t\t0xFFB5\n#define XK_KP_6\t\t\t0xFFB6\n#define XK_KP_7\t\t\t0xFFB7\n#define XK_KP_8\t\t\t0xFFB8\n#define XK_KP_9\t\t\t0xFFB9\n\n\n\n/*\n * Auxiliary Functions; note the duplicate definitions for left and right\n * function keys;  Sun keyboards and a few other manufactures have such\n * function key groups on the left and/or right sides of the keyboard.\n * We've not found a keyboard with more than 35 function keys total.\n */\n\n#define XK_F1\t\t\t0xFFBE\n#define XK_F2\t\t\t0xFFBF\n#define XK_F3\t\t\t0xFFC0\n#define XK_F4\t\t\t0xFFC1\n#define XK_F5\t\t\t0xFFC2\n#define XK_F6\t\t\t0xFFC3\n#define XK_F7\t\t\t0xFFC4\n#define XK_F8\t\t\t0xFFC5\n#define XK_F9\t\t\t0xFFC6\n#define XK_F10\t\t\t0xFFC7\n#define XK_F11\t\t\t0xFFC8\n#define XK_L1\t\t\t0xFFC8\n#define XK_F12\t\t\t0xFFC9\n#define XK_L2\t\t\t0xFFC9\n#define XK_F13\t\t\t0xFFCA\n#define XK_L3\t\t\t0xFFCA\n#define XK_F14\t\t\t0xFFCB\n#define XK_L4\t\t\t0xFFCB\n#define XK_F15\t\t\t0xFFCC\n#define XK_L5\t\t\t0xFFCC\n#define XK_F16\t\t\t0xFFCD\n#define XK_L6\t\t\t0xFFCD\n#define XK_F17\t\t\t0xFFCE\n#define XK_L7\t\t\t0xFFCE\n#define XK_F18\t\t\t0xFFCF\n#define XK_L8\t\t\t0xFFCF\n#define XK_F19\t\t\t0xFFD0\n#define XK_L9\t\t\t0xFFD0\n#define XK_F20\t\t\t0xFFD1\n#define XK_L10\t\t\t0xFFD1\n#define XK_F21\t\t\t0xFFD2\n#define XK_R1\t\t\t0xFFD2\n#define XK_F22\t\t\t0xFFD3\n#define XK_R2\t\t\t0xFFD3\n#define XK_F23\t\t\t0xFFD4\n#define XK_R3\t\t\t0xFFD4\n#define XK_F24\t\t\t0xFFD5\n#define XK_R4\t\t\t0xFFD5\n#define XK_F25\t\t\t0xFFD6\n#define XK_R5\t\t\t0xFFD6\n#define XK_F26\t\t\t0xFFD7\n#define XK_R6\t\t\t0xFFD7\n#define XK_F27\t\t\t0xFFD8\n#define XK_R7\t\t\t0xFFD8\n#define XK_F28\t\t\t0xFFD9\n#define XK_R8\t\t\t0xFFD9\n#define XK_F29\t\t\t0xFFDA\n#define XK_R9\t\t\t0xFFDA\n#define XK_F30\t\t\t0xFFDB\n#define XK_R10\t\t\t0xFFDB\n#define XK_F31\t\t\t0xFFDC\n#define XK_R11\t\t\t0xFFDC\n#define XK_F32\t\t\t0xFFDD\n#define XK_R12\t\t\t0xFFDD\n#define XK_F33\t\t\t0xFFDE\n#define XK_R13\t\t\t0xFFDE\n#define XK_F34\t\t\t0xFFDF\n#define XK_R14\t\t\t0xFFDF\n#define XK_F35\t\t\t0xFFE0\n#define XK_R15\t\t\t0xFFE0\n\n/* Modifiers */\n\n#define XK_Shift_L\t\t0xFFE1\t/* Left shift */\n#define XK_Shift_R\t\t0xFFE2\t/* Right shift */\n#define XK_Control_L\t\t0xFFE3\t/* Left control */\n#define XK_Control_R\t\t0xFFE4\t/* Right control */\n#define XK_Caps_Lock\t\t0xFFE5\t/* Caps lock */\n#define XK_Shift_Lock\t\t0xFFE6\t/* Shift lock */\n\n#define XK_Meta_L\t\t0xFFE7\t/* Left meta */\n#define XK_Meta_R\t\t0xFFE8\t/* Right meta */\n#define XK_Alt_L\t\t0xFFE9\t/* Left alt */\n#define XK_Alt_R\t\t0xFFEA\t/* Right alt */\n#define XK_Super_L\t\t0xFFEB\t/* Left super */\n#define XK_Super_R\t\t0xFFEC\t/* Right super */\n#define XK_Hyper_L\t\t0xFFED\t/* Left hyper */\n#define XK_Hyper_R\t\t0xFFEE\t/* Right hyper */\n// #endif /* XK_MISCELLANY */\n\n/*\n * ISO 9995 Function and Modifier Keys\n * Byte 3 = 0xFE\n */\n\n// #ifdef XK_XKB_KEYS\n#define\tXK_ISO_Lock\t\t\t\t\t0xFE01\n#define\tXK_ISO_Level2_Latch\t\t\t\t0xFE02\n#define\tXK_ISO_Level3_Shift\t\t\t\t0xFE03\n#define\tXK_ISO_Level3_Latch\t\t\t\t0xFE04\n#define\tXK_ISO_Level3_Lock\t\t\t\t0xFE05\n#define\tXK_ISO_Group_Shift\t\t0xFF7E\t/* Alias for mode_switch */\n#define\tXK_ISO_Group_Latch\t\t\t\t0xFE06\n#define\tXK_ISO_Group_Lock\t\t\t\t0xFE07\n#define\tXK_ISO_Next_Group\t\t\t\t0xFE08\n#define\tXK_ISO_Next_Group_Lock\t\t\t\t0xFE09\n#define\tXK_ISO_Prev_Group\t\t\t\t0xFE0A\n#define\tXK_ISO_Prev_Group_Lock\t\t\t\t0xFE0B\n#define\tXK_ISO_First_Group\t\t\t\t0xFE0C\n#define\tXK_ISO_First_Group_Lock\t\t\t\t0xFE0D\n#define\tXK_ISO_Last_Group\t\t\t\t0xFE0E\n#define\tXK_ISO_Last_Group_Lock\t\t\t\t0xFE0F\n\n#define\tXK_ISO_Left_Tab\t\t\t\t\t0xFE20\n#define\tXK_ISO_Move_Line_Up\t\t\t\t0xFE21\n#define\tXK_ISO_Move_Line_Down\t\t\t\t0xFE22\n#define\tXK_ISO_Partial_Line_Up\t\t\t\t0xFE23\n#define\tXK_ISO_Partial_Line_Down\t\t\t0xFE24\n#define\tXK_ISO_Partial_Space_Left\t\t\t0xFE25\n#define\tXK_ISO_Partial_Space_Right\t\t\t0xFE26\n#define\tXK_ISO_Set_Margin_Left\t\t\t\t0xFE27\n#define\tXK_ISO_Set_Margin_Right\t\t\t\t0xFE28\n#define\tXK_ISO_Release_Margin_Left\t\t\t0xFE29\n#define\tXK_ISO_Release_Margin_Right\t\t\t0xFE2A\n#define\tXK_ISO_Release_Both_Margins\t\t\t0xFE2B\n#define\tXK_ISO_Fast_Cursor_Left\t\t\t\t0xFE2C\n#define\tXK_ISO_Fast_Cursor_Right\t\t\t0xFE2D\n#define\tXK_ISO_Fast_Cursor_Up\t\t\t\t0xFE2E\n#define\tXK_ISO_Fast_Cursor_Down\t\t\t\t0xFE2F\n#define\tXK_ISO_Continuous_Underline\t\t\t0xFE30\n#define\tXK_ISO_Discontinuous_Underline\t\t\t0xFE31\n#define\tXK_ISO_Emphasize\t\t\t\t0xFE32\n#define\tXK_ISO_Center_Object\t\t\t\t0xFE33\n#define\tXK_ISO_Enter\t\t\t\t\t0xFE34\n\n#define\tXK_dead_grave\t\t\t\t\t0xFE50\n#define\tXK_dead_acute\t\t\t\t\t0xFE51\n#define\tXK_dead_circumflex\t\t\t\t0xFE52\n#define\tXK_dead_tilde\t\t\t\t\t0xFE53\n#define\tXK_dead_macron\t\t\t\t\t0xFE54\n#define\tXK_dead_breve\t\t\t\t\t0xFE55\n#define\tXK_dead_abovedot\t\t\t\t0xFE56\n#define\tXK_dead_diaeresis\t\t\t\t0xFE57\n#define\tXK_dead_abovering\t\t\t\t0xFE58\n#define\tXK_dead_doubleacute\t\t\t\t0xFE59\n#define\tXK_dead_caron\t\t\t\t\t0xFE5A\n#define\tXK_dead_cedilla\t\t\t\t\t0xFE5B\n#define\tXK_dead_ogonek\t\t\t\t\t0xFE5C\n#define\tXK_dead_iota\t\t\t\t\t0xFE5D\n#define\tXK_dead_voiced_sound\t\t\t\t0xFE5E\n#define\tXK_dead_semivoiced_sound\t\t\t0xFE5F\n#define\tXK_dead_belowdot\t\t\t\t0xFE60\n\n#define\tXK_First_Virtual_Screen\t\t\t\t0xFED0\n#define\tXK_Prev_Virtual_Screen\t\t\t\t0xFED1\n#define\tXK_Next_Virtual_Screen\t\t\t\t0xFED2\n#define\tXK_Last_Virtual_Screen\t\t\t\t0xFED4\n#define\tXK_Terminate_Server\t\t\t\t0xFED5\n\n#define\tXK_AccessX_Enable\t\t\t\t0xFE70\n#define\tXK_AccessX_Feedback_Enable\t\t\t0xFE71\n#define\tXK_RepeatKeys_Enable\t\t\t\t0xFE72\n#define\tXK_SlowKeys_Enable\t\t\t\t0xFE73\n#define\tXK_BounceKeys_Enable\t\t\t\t0xFE74\n#define\tXK_StickyKeys_Enable\t\t\t\t0xFE75\n#define\tXK_MouseKeys_Enable\t\t\t\t0xFE76\n#define\tXK_MouseKeys_Accel_Enable\t\t\t0xFE77\n#define\tXK_Overlay1_Enable\t\t\t\t0xFE78\n#define\tXK_Overlay2_Enable\t\t\t\t0xFE79\n#define\tXK_AudibleBell_Enable\t\t\t\t0xFE7A\n\n#define\tXK_Pointer_Left\t\t\t\t\t0xFEE0\n#define\tXK_Pointer_Right\t\t\t\t0xFEE1\n#define\tXK_Pointer_Up\t\t\t\t\t0xFEE2\n#define\tXK_Pointer_Down\t\t\t\t\t0xFEE3\n#define\tXK_Pointer_UpLeft\t\t\t\t0xFEE4\n#define\tXK_Pointer_UpRight\t\t\t\t0xFEE5\n#define\tXK_Pointer_DownLeft\t\t\t\t0xFEE6\n#define\tXK_Pointer_DownRight\t\t\t\t0xFEE7\n#define\tXK_Pointer_Button_Dflt\t\t\t\t0xFEE8\n#define\tXK_Pointer_Button1\t\t\t\t0xFEE9\n#define\tXK_Pointer_Button2\t\t\t\t0xFEEA\n#define\tXK_Pointer_Button3\t\t\t\t0xFEEB\n#define\tXK_Pointer_Button4\t\t\t\t0xFEEC\n#define\tXK_Pointer_Button5\t\t\t\t0xFEED\n#define\tXK_Pointer_DblClick_Dflt\t\t\t0xFEEE\n#define\tXK_Pointer_DblClick1\t\t\t\t0xFEEF\n#define\tXK_Pointer_DblClick2\t\t\t\t0xFEF0\n#define\tXK_Pointer_DblClick3\t\t\t\t0xFEF1\n#define\tXK_Pointer_DblClick4\t\t\t\t0xFEF2\n#define\tXK_Pointer_DblClick5\t\t\t\t0xFEF3\n#define\tXK_Pointer_Drag_Dflt\t\t\t\t0xFEF4\n#define\tXK_Pointer_Drag1\t\t\t\t0xFEF5\n#define\tXK_Pointer_Drag2\t\t\t\t0xFEF6\n#define\tXK_Pointer_Drag3\t\t\t\t0xFEF7\n#define\tXK_Pointer_Drag4\t\t\t\t0xFEF8\n#define\tXK_Pointer_Drag5\t\t\t\t0xFEFD\n\n#define\tXK_Pointer_EnableKeys\t\t\t\t0xFEF9\n#define\tXK_Pointer_Accelerate\t\t\t\t0xFEFA\n#define\tXK_Pointer_DfltBtnNext\t\t\t\t0xFEFB\n#define\tXK_Pointer_DfltBtnPrev\t\t\t\t0xFEFC\n\n// #endif\n\n/*\n * 3270 Terminal Keys\n * Byte 3 = 0xFD\n */\n\n// #ifdef XK_3270\n#define XK_3270_Duplicate      0xFD01\n#define XK_3270_FieldMark      0xFD02\n#define XK_3270_Right2         0xFD03\n#define XK_3270_Left2          0xFD04\n#define XK_3270_BackTab        0xFD05\n#define XK_3270_EraseEOF       0xFD06\n#define XK_3270_EraseInput     0xFD07\n#define XK_3270_Reset          0xFD08\n#define XK_3270_Quit           0xFD09\n#define XK_3270_PA1            0xFD0A\n#define XK_3270_PA2            0xFD0B\n#define XK_3270_PA3            0xFD0C\n#define XK_3270_Test           0xFD0D\n#define XK_3270_Attn           0xFD0E\n#define XK_3270_CursorBlink    0xFD0F\n#define XK_3270_AltCursor      0xFD10\n#define XK_3270_KeyClick       0xFD11\n#define XK_3270_Jump           0xFD12\n#define XK_3270_Ident          0xFD13\n#define XK_3270_Rule           0xFD14\n#define XK_3270_Copy           0xFD15\n#define XK_3270_Play           0xFD16\n#define XK_3270_Setup          0xFD17\n#define XK_3270_Record         0xFD18\n#define XK_3270_ChangeScreen   0xFD19\n#define XK_3270_DeleteWord     0xFD1A\n#define XK_3270_ExSelect       0xFD1B\n#define XK_3270_CursorSelect   0xFD1C\n#define XK_3270_PrintScreen    0xFD1D\n#define XK_3270_Enter          0xFD1E\n// #endif\n\n/*\n *  Latin 1\n *  Byte 3 = 0\n */\n// #ifdef XK_LATIN1\n#define XK_space               0x020\n#define XK_exclam              0x021\n#define XK_quotedbl            0x022\n#define XK_numbersign          0x023\n#define XK_dollar              0x024\n#define XK_percent             0x025\n#define XK_ampersand           0x026\n#define XK_apostrophe          0x027\n#define XK_quoteright          0x027\t/* deprecated */\n#define XK_parenleft           0x028\n#define XK_parenright          0x029\n#define XK_asterisk            0x02a\n#define XK_plus                0x02b\n#define XK_comma               0x02c\n#define XK_minus               0x02d\n#define XK_period              0x02e\n#define XK_slash               0x02f\n#define XK_0                   0x030\n#define XK_1                   0x031\n#define XK_2                   0x032\n#define XK_3                   0x033\n#define XK_4                   0x034\n#define XK_5                   0x035\n#define XK_6                   0x036\n#define XK_7                   0x037\n#define XK_8                   0x038\n#define XK_9                   0x039\n#define XK_colon               0x03a\n#define XK_semicolon           0x03b\n#define XK_less                0x03c\n#define XK_equal               0x03d\n#define XK_greater             0x03e\n#define XK_question            0x03f\n#define XK_at                  0x040\n#define XK_A                   0x041\n#define XK_B                   0x042\n#define XK_C                   0x043\n#define XK_D                   0x044\n#define XK_E                   0x045\n#define XK_F                   0x046\n#define XK_G                   0x047\n#define XK_H                   0x048\n#define XK_I                   0x049\n#define XK_J                   0x04a\n#define XK_K                   0x04b\n#define XK_L                   0x04c\n#define XK_M                   0x04d\n#define XK_N                   0x04e\n#define XK_O                   0x04f\n#define XK_P                   0x050\n#define XK_Q                   0x051\n#define XK_R                   0x052\n#define XK_S                   0x053\n#define XK_T                   0x054\n#define XK_U                   0x055\n#define XK_V                   0x056\n#define XK_W                   0x057\n#define XK_X                   0x058\n#define XK_Y                   0x059\n#define XK_Z                   0x05a\n#define XK_bracketleft         0x05b\n#define XK_backslash           0x05c\n#define XK_bracketright        0x05d\n#define XK_asciicircum         0x05e\n#define XK_underscore          0x05f\n#define XK_grave               0x060\n#define XK_quoteleft           0x060\t/* deprecated */\n#define XK_a                   0x061\n#define XK_b                   0x062\n#define XK_c                   0x063\n#define XK_d                   0x064\n#define XK_e                   0x065\n#define XK_f                   0x066\n#define XK_g                   0x067\n#define XK_h                   0x068\n#define XK_i                   0x069\n#define XK_j                   0x06a\n#define XK_k                   0x06b\n#define XK_l                   0x06c\n#define XK_m                   0x06d\n#define XK_n                   0x06e\n#define XK_o                   0x06f\n#define XK_p                   0x070\n#define XK_q                   0x071\n#define XK_r                   0x072\n#define XK_s                   0x073\n#define XK_t                   0x074\n#define XK_u                   0x075\n#define XK_v                   0x076\n#define XK_w                   0x077\n#define XK_x                   0x078\n#define XK_y                   0x079\n#define XK_z                   0x07a\n#define XK_braceleft           0x07b\n#define XK_bar                 0x07c\n#define XK_braceright          0x07d\n#define XK_asciitilde          0x07e\n\n#define XK_nobreakspace        0x0a0\n#define XK_exclamdown          0x0a1\n#define XK_cent        \t       0x0a2\n#define XK_sterling            0x0a3\n#define XK_currency            0x0a4\n#define XK_yen                 0x0a5\n#define XK_brokenbar           0x0a6\n#define XK_section             0x0a7\n#define XK_diaeresis           0x0a8\n#define XK_copyright           0x0a9\n#define XK_ordfeminine         0x0aa\n#define XK_guillemotleft       0x0ab\t/* left angle quotation mark */\n#define XK_notsign             0x0ac\n#define XK_hyphen              0x0ad\n#define XK_registered          0x0ae\n#define XK_macron              0x0af\n#define XK_degree              0x0b0\n#define XK_plusminus           0x0b1\n#define XK_twosuperior         0x0b2\n#define XK_threesuperior       0x0b3\n#define XK_acute               0x0b4\n#define XK_mu                  0x0b5\n#define XK_paragraph           0x0b6\n#define XK_periodcentered      0x0b7\n#define XK_cedilla             0x0b8\n#define XK_onesuperior         0x0b9\n#define XK_masculine           0x0ba\n#define XK_guillemotright      0x0bb\t/* right angle quotation mark */\n#define XK_onequarter          0x0bc\n#define XK_onehalf             0x0bd\n#define XK_threequarters       0x0be\n#define XK_questiondown        0x0bf\n#define XK_Agrave              0x0c0\n#define XK_Aacute              0x0c1\n#define XK_Acircumflex         0x0c2\n#define XK_Atilde              0x0c3\n#define XK_Adiaeresis          0x0c4\n#define XK_Aring               0x0c5\n#define XK_AE                  0x0c6\n#define XK_Ccedilla            0x0c7\n#define XK_Egrave              0x0c8\n#define XK_Eacute              0x0c9\n#define XK_Ecircumflex         0x0ca\n#define XK_Ediaeresis          0x0cb\n#define XK_Igrave              0x0cc\n#define XK_Iacute              0x0cd\n#define XK_Icircumflex         0x0ce\n#define XK_Idiaeresis          0x0cf\n#define XK_ETH                 0x0d0\n#define XK_Eth                 0x0d0\t/* deprecated */\n#define XK_Ntilde              0x0d1\n#define XK_Ograve              0x0d2\n#define XK_Oacute              0x0d3\n#define XK_Ocircumflex         0x0d4\n#define XK_Otilde              0x0d5\n#define XK_Odiaeresis          0x0d6\n#define XK_multiply            0x0d7\n#define XK_Ooblique            0x0d8\n#define XK_Ugrave              0x0d9\n#define XK_Uacute              0x0da\n#define XK_Ucircumflex         0x0db\n#define XK_Udiaeresis          0x0dc\n#define XK_Yacute              0x0dd\n#define XK_THORN               0x0de\n#define XK_Thorn               0x0de\t/* deprecated */\n#define XK_ssharp              0x0df\n#define XK_agrave              0x0e0\n#define XK_aacute              0x0e1\n#define XK_acircumflex         0x0e2\n#define XK_atilde              0x0e3\n#define XK_adiaeresis          0x0e4\n#define XK_aring               0x0e5\n#define XK_ae                  0x0e6\n#define XK_ccedilla            0x0e7\n#define XK_egrave              0x0e8\n#define XK_eacute              0x0e9\n#define XK_ecircumflex         0x0ea\n#define XK_ediaeresis          0x0eb\n#define XK_igrave              0x0ec\n#define XK_iacute              0x0ed\n#define XK_icircumflex         0x0ee\n#define XK_idiaeresis          0x0ef\n#define XK_eth                 0x0f0\n#define XK_ntilde              0x0f1\n#define XK_ograve              0x0f2\n#define XK_oacute              0x0f3\n#define XK_ocircumflex         0x0f4\n#define XK_otilde              0x0f5\n#define XK_odiaeresis          0x0f6\n#define XK_division            0x0f7\n#define XK_oslash              0x0f8\n#define XK_ugrave              0x0f9\n#define XK_uacute              0x0fa\n#define XK_ucircumflex         0x0fb\n#define XK_udiaeresis          0x0fc\n#define XK_yacute              0x0fd\n#define XK_thorn               0x0fe\n#define XK_ydiaeresis          0x0ff\n// #endif /* XK_LATIN1 */\n\n/*\n *   Latin 2\n *   Byte 3 = 1\n */\n\n// #ifdef XK_LATIN2\n#define XK_Aogonek             0x1a1\n#define XK_breve               0x1a2\n#define XK_Lstroke             0x1a3\n#define XK_Lcaron              0x1a5\n#define XK_Sacute              0x1a6\n#define XK_Scaron              0x1a9\n#define XK_Scedilla            0x1aa\n#define XK_Tcaron              0x1ab\n#define XK_Zacute              0x1ac\n#define XK_Zcaron              0x1ae\n#define XK_Zabovedot           0x1af\n#define XK_aogonek             0x1b1\n#define XK_ogonek              0x1b2\n#define XK_lstroke             0x1b3\n#define XK_lcaron              0x1b5\n#define XK_sacute              0x1b6\n#define XK_caron               0x1b7\n#define XK_scaron              0x1b9\n#define XK_scedilla            0x1ba\n#define XK_tcaron              0x1bb\n#define XK_zacute              0x1bc\n#define XK_doubleacute         0x1bd\n#define XK_zcaron              0x1be\n#define XK_zabovedot           0x1bf\n#define XK_Racute              0x1c0\n#define XK_Abreve              0x1c3\n#define XK_Lacute              0x1c5\n#define XK_Cacute              0x1c6\n#define XK_Ccaron              0x1c8\n#define XK_Eogonek             0x1ca\n#define XK_Ecaron              0x1cc\n#define XK_Dcaron              0x1cf\n#define XK_Dstroke             0x1d0\n#define XK_Nacute              0x1d1\n#define XK_Ncaron              0x1d2\n#define XK_Odoubleacute        0x1d5\n#define XK_Rcaron              0x1d8\n#define XK_Uring               0x1d9\n#define XK_Udoubleacute        0x1db\n#define XK_Tcedilla            0x1de\n#define XK_racute              0x1e0\n#define XK_abreve              0x1e3\n#define XK_lacute              0x1e5\n#define XK_cacute              0x1e6\n#define XK_ccaron              0x1e8\n#define XK_eogonek             0x1ea\n#define XK_ecaron              0x1ec\n#define XK_dcaron              0x1ef\n#define XK_dstroke             0x1f0\n#define XK_nacute              0x1f1\n#define XK_ncaron              0x1f2\n#define XK_odoubleacute        0x1f5\n#define XK_udoubleacute        0x1fb\n#define XK_rcaron              0x1f8\n#define XK_uring               0x1f9\n#define XK_tcedilla            0x1fe\n#define XK_abovedot            0x1ff\n// #endif /* XK_LATIN2 */\n\n/*\n *   Latin 3\n *   Byte 3 = 2\n */\n\n// #ifdef XK_LATIN3\n#define XK_Hstroke             0x2a1\n#define XK_Hcircumflex         0x2a6\n#define XK_Iabovedot           0x2a9\n#define XK_Gbreve              0x2ab\n#define XK_Jcircumflex         0x2ac\n#define XK_hstroke             0x2b1\n#define XK_hcircumflex         0x2b6\n#define XK_idotless            0x2b9\n#define XK_gbreve              0x2bb\n#define XK_jcircumflex         0x2bc\n#define XK_Cabovedot           0x2c5\n#define XK_Ccircumflex         0x2c6\n#define XK_Gabovedot           0x2d5\n#define XK_Gcircumflex         0x2d8\n#define XK_Ubreve              0x2dd\n#define XK_Scircumflex         0x2de\n#define XK_cabovedot           0x2e5\n#define XK_ccircumflex         0x2e6\n#define XK_gabovedot           0x2f5\n#define XK_gcircumflex         0x2f8\n#define XK_ubreve              0x2fd\n#define XK_scircumflex         0x2fe\n// #endif /* XK_LATIN3 */\n\n\n/*\n *   Latin 4\n *   Byte 3 = 3\n */\n\n// #ifdef XK_LATIN4\n#define XK_kra                 0x3a2\n#define XK_kappa               0x3a2\t/* deprecated */\n#define XK_Rcedilla            0x3a3\n#define XK_Itilde              0x3a5\n#define XK_Lcedilla            0x3a6\n#define XK_Emacron             0x3aa\n#define XK_Gcedilla            0x3ab\n#define XK_Tslash              0x3ac\n#define XK_rcedilla            0x3b3\n#define XK_itilde              0x3b5\n#define XK_lcedilla            0x3b6\n#define XK_emacron             0x3ba\n#define XK_gcedilla            0x3bb\n#define XK_tslash              0x3bc\n#define XK_ENG                 0x3bd\n#define XK_eng                 0x3bf\n#define XK_Amacron             0x3c0\n#define XK_Iogonek             0x3c7\n#define XK_Eabovedot           0x3cc\n#define XK_Imacron             0x3cf\n#define XK_Ncedilla            0x3d1\n#define XK_Omacron             0x3d2\n#define XK_Kcedilla            0x3d3\n#define XK_Uogonek             0x3d9\n#define XK_Utilde              0x3dd\n#define XK_Umacron             0x3de\n#define XK_amacron             0x3e0\n#define XK_iogonek             0x3e7\n#define XK_eabovedot           0x3ec\n#define XK_imacron             0x3ef\n#define XK_ncedilla            0x3f1\n#define XK_omacron             0x3f2\n#define XK_kcedilla            0x3f3\n#define XK_uogonek             0x3f9\n#define XK_utilde              0x3fd\n#define XK_umacron             0x3fe\n// #endif /* XK_LATIN4 */\n\n/*\n * Katakana\n * Byte 3 = 4\n */\n\n// #ifdef XK_KATAKANA\n#define XK_overline\t\t\t\t       0x47e\n#define XK_kana_fullstop                               0x4a1\n#define XK_kana_openingbracket                         0x4a2\n#define XK_kana_closingbracket                         0x4a3\n#define XK_kana_comma                                  0x4a4\n#define XK_kana_conjunctive                            0x4a5\n#define XK_kana_middledot                              0x4a5  /* deprecated */\n#define XK_kana_WO                                     0x4a6\n#define XK_kana_a                                      0x4a7\n#define XK_kana_i                                      0x4a8\n#define XK_kana_u                                      0x4a9\n#define XK_kana_e                                      0x4aa\n#define XK_kana_o                                      0x4ab\n#define XK_kana_ya                                     0x4ac\n#define XK_kana_yu                                     0x4ad\n#define XK_kana_yo                                     0x4ae\n#define XK_kana_tsu                                    0x4af\n#define XK_kana_tu                                     0x4af  /* deprecated */\n#define XK_prolongedsound                              0x4b0\n#define XK_kana_A                                      0x4b1\n#define XK_kana_I                                      0x4b2\n#define XK_kana_U                                      0x4b3\n#define XK_kana_E                                      0x4b4\n#define XK_kana_O                                      0x4b5\n#define XK_kana_KA                                     0x4b6\n#define XK_kana_KI                                     0x4b7\n#define XK_kana_KU                                     0x4b8\n#define XK_kana_KE                                     0x4b9\n#define XK_kana_KO                                     0x4ba\n#define XK_kana_SA                                     0x4bb\n#define XK_kana_SHI                                    0x4bc\n#define XK_kana_SU                                     0x4bd\n#define XK_kana_SE                                     0x4be\n#define XK_kana_SO                                     0x4bf\n#define XK_kana_TA                                     0x4c0\n#define XK_kana_CHI                                    0x4c1\n#define XK_kana_TI                                     0x4c1  /* deprecated */\n#define XK_kana_TSU                                    0x4c2\n#define XK_kana_TU                                     0x4c2  /* deprecated */\n#define XK_kana_TE                                     0x4c3\n#define XK_kana_TO                                     0x4c4\n#define XK_kana_NA                                     0x4c5\n#define XK_kana_NI                                     0x4c6\n#define XK_kana_NU                                     0x4c7\n#define XK_kana_NE                                     0x4c8\n#define XK_kana_NO                                     0x4c9\n#define XK_kana_HA                                     0x4ca\n#define XK_kana_HI                                     0x4cb\n#define XK_kana_FU                                     0x4cc\n#define XK_kana_HU                                     0x4cc  /* deprecated */\n#define XK_kana_HE                                     0x4cd\n#define XK_kana_HO                                     0x4ce\n#define XK_kana_MA                                     0x4cf\n#define XK_kana_MI                                     0x4d0\n#define XK_kana_MU                                     0x4d1\n#define XK_kana_ME                                     0x4d2\n#define XK_kana_MO                                     0x4d3\n#define XK_kana_YA                                     0x4d4\n#define XK_kana_YU                                     0x4d5\n#define XK_kana_YO                                     0x4d6\n#define XK_kana_RA                                     0x4d7\n#define XK_kana_RI                                     0x4d8\n#define XK_kana_RU                                     0x4d9\n#define XK_kana_RE                                     0x4da\n#define XK_kana_RO                                     0x4db\n#define XK_kana_WA                                     0x4dc\n#define XK_kana_N                                      0x4dd\n#define XK_voicedsound                                 0x4de\n#define XK_semivoicedsound                             0x4df\n#define XK_kana_switch          0xFF7E  /* Alias for mode_switch */\n// #endif /* XK_KATAKANA */\n\n/*\n *  Arabic\n *  Byte 3 = 5\n */\n\n// #ifdef XK_ARABIC\n#define XK_Arabic_comma                                0x5ac\n#define XK_Arabic_semicolon                            0x5bb\n#define XK_Arabic_question_mark                        0x5bf\n#define XK_Arabic_hamza                                0x5c1\n#define XK_Arabic_maddaonalef                          0x5c2\n#define XK_Arabic_hamzaonalef                          0x5c3\n#define XK_Arabic_hamzaonwaw                           0x5c4\n#define XK_Arabic_hamzaunderalef                       0x5c5\n#define XK_Arabic_hamzaonyeh                           0x5c6\n#define XK_Arabic_alef                                 0x5c7\n#define XK_Arabic_beh                                  0x5c8\n#define XK_Arabic_tehmarbuta                           0x5c9\n#define XK_Arabic_teh                                  0x5ca\n#define XK_Arabic_theh                                 0x5cb\n#define XK_Arabic_jeem                                 0x5cc\n#define XK_Arabic_hah                                  0x5cd\n#define XK_Arabic_khah                                 0x5ce\n#define XK_Arabic_dal                                  0x5cf\n#define XK_Arabic_thal                                 0x5d0\n#define XK_Arabic_ra                                   0x5d1\n#define XK_Arabic_zain                                 0x5d2\n#define XK_Arabic_seen                                 0x5d3\n#define XK_Arabic_sheen                                0x5d4\n#define XK_Arabic_sad                                  0x5d5\n#define XK_Arabic_dad                                  0x5d6\n#define XK_Arabic_tah                                  0x5d7\n#define XK_Arabic_zah                                  0x5d8\n#define XK_Arabic_ain                                  0x5d9\n#define XK_Arabic_ghain                                0x5da\n#define XK_Arabic_tatweel                              0x5e0\n#define XK_Arabic_feh                                  0x5e1\n#define XK_Arabic_qaf                                  0x5e2\n#define XK_Arabic_kaf                                  0x5e3\n#define XK_Arabic_lam                                  0x5e4\n#define XK_Arabic_meem                                 0x5e5\n#define XK_Arabic_noon                                 0x5e6\n#define XK_Arabic_ha                                   0x5e7\n#define XK_Arabic_heh                                  0x5e7  /* deprecated */\n#define XK_Arabic_waw                                  0x5e8\n#define XK_Arabic_alefmaksura                          0x5e9\n#define XK_Arabic_yeh                                  0x5ea\n#define XK_Arabic_fathatan                             0x5eb\n#define XK_Arabic_dammatan                             0x5ec\n#define XK_Arabic_kasratan                             0x5ed\n#define XK_Arabic_fatha                                0x5ee\n#define XK_Arabic_damma                                0x5ef\n#define XK_Arabic_kasra                                0x5f0\n#define XK_Arabic_shadda                               0x5f1\n#define XK_Arabic_sukun                                0x5f2\n#define XK_Arabic_switch        0xFF7E  /* Alias for mode_switch */\n// #endif /* XK_ARABIC */\n\n/*\n * Cyrillic\n * Byte 3 = 6\n */\n// #ifdef XK_CYRILLIC\n#define XK_Serbian_dje                                 0x6a1\n#define XK_Macedonia_gje                               0x6a2\n#define XK_Cyrillic_io                                 0x6a3\n#define XK_Ukrainian_ie                                0x6a4\n#define XK_Ukranian_je                                 0x6a4  /* deprecated */\n#define XK_Macedonia_dse                               0x6a5\n#define XK_Ukrainian_i                                 0x6a6\n#define XK_Ukranian_i                                  0x6a6  /* deprecated */\n#define XK_Ukrainian_yi                                0x6a7\n#define XK_Ukranian_yi                                 0x6a7  /* deprecated */\n#define XK_Cyrillic_je                                 0x6a8\n#define XK_Serbian_je                                  0x6a8  /* deprecated */\n#define XK_Cyrillic_lje                                0x6a9\n#define XK_Serbian_lje                                 0x6a9  /* deprecated */\n#define XK_Cyrillic_nje                                0x6aa\n#define XK_Serbian_nje                                 0x6aa  /* deprecated */\n#define XK_Serbian_tshe                                0x6ab\n#define XK_Macedonia_kje                               0x6ac\n#define XK_Byelorussian_shortu                         0x6ae\n#define XK_Cyrillic_dzhe                               0x6af\n#define XK_Serbian_dze                                 0x6af  /* deprecated */\n#define XK_numerosign                                  0x6b0\n#define XK_Serbian_DJE                                 0x6b1\n#define XK_Macedonia_GJE                               0x6b2\n#define XK_Cyrillic_IO                                 0x6b3\n#define XK_Ukrainian_IE                                0x6b4\n#define XK_Ukranian_JE                                 0x6b4  /* deprecated */\n#define XK_Macedonia_DSE                               0x6b5\n#define XK_Ukrainian_I                                 0x6b6\n#define XK_Ukranian_I                                  0x6b6  /* deprecated */\n#define XK_Ukrainian_YI                                0x6b7\n#define XK_Ukranian_YI                                 0x6b7  /* deprecated */\n#define XK_Cyrillic_JE                                 0x6b8\n#define XK_Serbian_JE                                  0x6b8  /* deprecated */\n#define XK_Cyrillic_LJE                                0x6b9\n#define XK_Serbian_LJE                                 0x6b9  /* deprecated */\n#define XK_Cyrillic_NJE                                0x6ba\n#define XK_Serbian_NJE                                 0x6ba  /* deprecated */\n#define XK_Serbian_TSHE                                0x6bb\n#define XK_Macedonia_KJE                               0x6bc\n#define XK_Byelorussian_SHORTU                         0x6be\n#define XK_Cyrillic_DZHE                               0x6bf\n#define XK_Serbian_DZE                                 0x6bf  /* deprecated */\n#define XK_Cyrillic_yu                                 0x6c0\n#define XK_Cyrillic_a                                  0x6c1\n#define XK_Cyrillic_be                                 0x6c2\n#define XK_Cyrillic_tse                                0x6c3\n#define XK_Cyrillic_de                                 0x6c4\n#define XK_Cyrillic_ie                                 0x6c5\n#define XK_Cyrillic_ef                                 0x6c6\n#define XK_Cyrillic_ghe                                0x6c7\n#define XK_Cyrillic_ha                                 0x6c8\n#define XK_Cyrillic_i                                  0x6c9\n#define XK_Cyrillic_shorti                             0x6ca\n#define XK_Cyrillic_ka                                 0x6cb\n#define XK_Cyrillic_el                                 0x6cc\n#define XK_Cyrillic_em                                 0x6cd\n#define XK_Cyrillic_en                                 0x6ce\n#define XK_Cyrillic_o                                  0x6cf\n#define XK_Cyrillic_pe                                 0x6d0\n#define XK_Cyrillic_ya                                 0x6d1\n#define XK_Cyrillic_er                                 0x6d2\n#define XK_Cyrillic_es                                 0x6d3\n#define XK_Cyrillic_te                                 0x6d4\n#define XK_Cyrillic_u                                  0x6d5\n#define XK_Cyrillic_zhe                                0x6d6\n#define XK_Cyrillic_ve                                 0x6d7\n#define XK_Cyrillic_softsign                           0x6d8\n#define XK_Cyrillic_yeru                               0x6d9\n#define XK_Cyrillic_ze                                 0x6da\n#define XK_Cyrillic_sha                                0x6db\n#define XK_Cyrillic_e                                  0x6dc\n#define XK_Cyrillic_shcha                              0x6dd\n#define XK_Cyrillic_che                                0x6de\n#define XK_Cyrillic_hardsign                           0x6df\n#define XK_Cyrillic_YU                                 0x6e0\n#define XK_Cyrillic_A                                  0x6e1\n#define XK_Cyrillic_BE                                 0x6e2\n#define XK_Cyrillic_TSE                                0x6e3\n#define XK_Cyrillic_DE                                 0x6e4\n#define XK_Cyrillic_IE                                 0x6e5\n#define XK_Cyrillic_EF                                 0x6e6\n#define XK_Cyrillic_GHE                                0x6e7\n#define XK_Cyrillic_HA                                 0x6e8\n#define XK_Cyrillic_I                                  0x6e9\n#define XK_Cyrillic_SHORTI                             0x6ea\n#define XK_Cyrillic_KA                                 0x6eb\n#define XK_Cyrillic_EL                                 0x6ec\n#define XK_Cyrillic_EM                                 0x6ed\n#define XK_Cyrillic_EN                                 0x6ee\n#define XK_Cyrillic_O                                  0x6ef\n#define XK_Cyrillic_PE                                 0x6f0\n#define XK_Cyrillic_YA                                 0x6f1\n#define XK_Cyrillic_ER                                 0x6f2\n#define XK_Cyrillic_ES                                 0x6f3\n#define XK_Cyrillic_TE                                 0x6f4\n#define XK_Cyrillic_U                                  0x6f5\n#define XK_Cyrillic_ZHE                                0x6f6\n#define XK_Cyrillic_VE                                 0x6f7\n#define XK_Cyrillic_SOFTSIGN                           0x6f8\n#define XK_Cyrillic_YERU                               0x6f9\n#define XK_Cyrillic_ZE                                 0x6fa\n#define XK_Cyrillic_SHA                                0x6fb\n#define XK_Cyrillic_E                                  0x6fc\n#define XK_Cyrillic_SHCHA                              0x6fd\n#define XK_Cyrillic_CHE                                0x6fe\n#define XK_Cyrillic_HARDSIGN                           0x6ff\n// #endif /* XK_CYRILLIC */\n\n/*\n * Greek\n * Byte 3 = 7\n */\n\n// #ifdef XK_GREEK\n#define XK_Greek_ALPHAaccent                           0x7a1\n#define XK_Greek_EPSILONaccent                         0x7a2\n#define XK_Greek_ETAaccent                             0x7a3\n#define XK_Greek_IOTAaccent                            0x7a4\n#define XK_Greek_IOTAdiaeresis                         0x7a5\n#define XK_Greek_OMICRONaccent                         0x7a7\n#define XK_Greek_UPSILONaccent                         0x7a8\n#define XK_Greek_UPSILONdieresis                       0x7a9\n#define XK_Greek_OMEGAaccent                           0x7ab\n#define XK_Greek_accentdieresis                        0x7ae\n#define XK_Greek_horizbar                              0x7af\n#define XK_Greek_alphaaccent                           0x7b1\n#define XK_Greek_epsilonaccent                         0x7b2\n#define XK_Greek_etaaccent                             0x7b3\n#define XK_Greek_iotaaccent                            0x7b4\n#define XK_Greek_iotadieresis                          0x7b5\n#define XK_Greek_iotaaccentdieresis                    0x7b6\n#define XK_Greek_omicronaccent                         0x7b7\n#define XK_Greek_upsilonaccent                         0x7b8\n#define XK_Greek_upsilondieresis                       0x7b9\n#define XK_Greek_upsilonaccentdieresis                 0x7ba\n#define XK_Greek_omegaaccent                           0x7bb\n#define XK_Greek_ALPHA                                 0x7c1\n#define XK_Greek_BETA                                  0x7c2\n#define XK_Greek_GAMMA                                 0x7c3\n#define XK_Greek_DELTA                                 0x7c4\n#define XK_Greek_EPSILON                               0x7c5\n#define XK_Greek_ZETA                                  0x7c6\n#define XK_Greek_ETA                                   0x7c7\n#define XK_Greek_THETA                                 0x7c8\n#define XK_Greek_IOTA                                  0x7c9\n#define XK_Greek_KAPPA                                 0x7ca\n#define XK_Greek_LAMDA                                 0x7cb\n#define XK_Greek_LAMBDA                                0x7cb\n#define XK_Greek_MU                                    0x7cc\n#define XK_Greek_NU                                    0x7cd\n#define XK_Greek_XI                                    0x7ce\n#define XK_Greek_OMICRON                               0x7cf\n#define XK_Greek_PI                                    0x7d0\n#define XK_Greek_RHO                                   0x7d1\n#define XK_Greek_SIGMA                                 0x7d2\n#define XK_Greek_TAU                                   0x7d4\n#define XK_Greek_UPSILON                               0x7d5\n#define XK_Greek_PHI                                   0x7d6\n#define XK_Greek_CHI                                   0x7d7\n#define XK_Greek_PSI                                   0x7d8\n#define XK_Greek_OMEGA                                 0x7d9\n#define XK_Greek_alpha                                 0x7e1\n#define XK_Greek_beta                                  0x7e2\n#define XK_Greek_gamma                                 0x7e3\n#define XK_Greek_delta                                 0x7e4\n#define XK_Greek_epsilon                               0x7e5\n#define XK_Greek_zeta                                  0x7e6\n#define XK_Greek_eta                                   0x7e7\n#define XK_Greek_theta                                 0x7e8\n#define XK_Greek_iota                                  0x7e9\n#define XK_Greek_kappa                                 0x7ea\n#define XK_Greek_lamda                                 0x7eb\n#define XK_Greek_lambda                                0x7eb\n#define XK_Greek_mu                                    0x7ec\n#define XK_Greek_nu                                    0x7ed\n#define XK_Greek_xi                                    0x7ee\n#define XK_Greek_omicron                               0x7ef\n#define XK_Greek_pi                                    0x7f0\n#define XK_Greek_rho                                   0x7f1\n#define XK_Greek_sigma                                 0x7f2\n#define XK_Greek_finalsmallsigma                       0x7f3\n#define XK_Greek_tau                                   0x7f4\n#define XK_Greek_upsilon                               0x7f5\n#define XK_Greek_phi                                   0x7f6\n#define XK_Greek_chi                                   0x7f7\n#define XK_Greek_psi                                   0x7f8\n#define XK_Greek_omega                                 0x7f9\n#define XK_Greek_switch         0xFF7E  /* Alias for mode_switch */\n// #endif /* XK_GREEK */\n\n/*\n * Technical\n * Byte 3 = 8\n */\n\n// #ifdef XK_TECHNICAL\n#define XK_leftradical                                 0x8a1\n#define XK_topleftradical                              0x8a2\n#define XK_horizconnector                              0x8a3\n#define XK_topintegral                                 0x8a4\n#define XK_botintegral                                 0x8a5\n#define XK_vertconnector                               0x8a6\n#define XK_topleftsqbracket                            0x8a7\n#define XK_botleftsqbracket                            0x8a8\n#define XK_toprightsqbracket                           0x8a9\n#define XK_botrightsqbracket                           0x8aa\n#define XK_topleftparens                               0x8ab\n#define XK_botleftparens                               0x8ac\n#define XK_toprightparens                              0x8ad\n#define XK_botrightparens                              0x8ae\n#define XK_leftmiddlecurlybrace                        0x8af\n#define XK_rightmiddlecurlybrace                       0x8b0\n#define XK_topleftsummation                            0x8b1\n#define XK_botleftsummation                            0x8b2\n#define XK_topvertsummationconnector                   0x8b3\n#define XK_botvertsummationconnector                   0x8b4\n#define XK_toprightsummation                           0x8b5\n#define XK_botrightsummation                           0x8b6\n#define XK_rightmiddlesummation                        0x8b7\n#define XK_lessthanequal                               0x8bc\n#define XK_notequal                                    0x8bd\n#define XK_greaterthanequal                            0x8be\n#define XK_integral                                    0x8bf\n#define XK_therefore                                   0x8c0\n#define XK_variation                                   0x8c1\n#define XK_infinity                                    0x8c2\n#define XK_nabla                                       0x8c5\n#define XK_approximate                                 0x8c8\n#define XK_similarequal                                0x8c9\n#define XK_ifonlyif                                    0x8cd\n#define XK_implies                                     0x8ce\n#define XK_identical                                   0x8cf\n#define XK_radical                                     0x8d6\n#define XK_includedin                                  0x8da\n#define XK_includes                                    0x8db\n#define XK_intersection                                0x8dc\n#define XK_union                                       0x8dd\n#define XK_logicaland                                  0x8de\n#define XK_logicalor                                   0x8df\n#define XK_partialderivative                           0x8ef\n#define XK_function                                    0x8f6\n#define XK_leftarrow                                   0x8fb\n#define XK_uparrow                                     0x8fc\n#define XK_rightarrow                                  0x8fd\n#define XK_downarrow                                   0x8fe\n// #endif /* XK_TECHNICAL */\n\n/*\n *  Special\n *  Byte 3 = 9\n */\n\n// #ifdef XK_SPECIAL\n#define XK_blank                                       0x9df\n#define XK_soliddiamond                                0x9e0\n#define XK_checkerboard                                0x9e1\n#define XK_ht                                          0x9e2\n#define XK_ff                                          0x9e3\n#define XK_cr                                          0x9e4\n#define XK_lf                                          0x9e5\n#define XK_nl                                          0x9e8\n#define XK_vt                                          0x9e9\n#define XK_lowrightcorner                              0x9ea\n#define XK_uprightcorner                               0x9eb\n#define XK_upleftcorner                                0x9ec\n#define XK_lowleftcorner                               0x9ed\n#define XK_crossinglines                               0x9ee\n#define XK_horizlinescan1                              0x9ef\n#define XK_horizlinescan3                              0x9f0\n#define XK_horizlinescan5                              0x9f1\n#define XK_horizlinescan7                              0x9f2\n#define XK_horizlinescan9                              0x9f3\n#define XK_leftt                                       0x9f4\n#define XK_rightt                                      0x9f5\n#define XK_bott                                        0x9f6\n#define XK_topt                                        0x9f7\n#define XK_vertbar                                     0x9f8\n// #endif /* XK_SPECIAL */\n\n/*\n *  Publishing\n *  Byte 3 = a\n */\n\n// #ifdef XK_PUBLISHING\n#define XK_emspace                                     0xaa1\n#define XK_enspace                                     0xaa2\n#define XK_em3space                                    0xaa3\n#define XK_em4space                                    0xaa4\n#define XK_digitspace                                  0xaa5\n#define XK_punctspace                                  0xaa6\n#define XK_thinspace                                   0xaa7\n#define XK_hairspace                                   0xaa8\n#define XK_emdash                                      0xaa9\n#define XK_endash                                      0xaaa\n#define XK_signifblank                                 0xaac\n#define XK_ellipsis                                    0xaae\n#define XK_doubbaselinedot                             0xaaf\n#define XK_onethird                                    0xab0\n#define XK_twothirds                                   0xab1\n#define XK_onefifth                                    0xab2\n#define XK_twofifths                                   0xab3\n#define XK_threefifths                                 0xab4\n#define XK_fourfifths                                  0xab5\n#define XK_onesixth                                    0xab6\n#define XK_fivesixths                                  0xab7\n#define XK_careof                                      0xab8\n#define XK_figdash                                     0xabb\n#define XK_leftanglebracket                            0xabc\n#define XK_decimalpoint                                0xabd\n#define XK_rightanglebracket                           0xabe\n#define XK_marker                                      0xabf\n#define XK_oneeighth                                   0xac3\n#define XK_threeeighths                                0xac4\n#define XK_fiveeighths                                 0xac5\n#define XK_seveneighths                                0xac6\n#define XK_trademark                                   0xac9\n#define XK_signaturemark                               0xaca\n#define XK_trademarkincircle                           0xacb\n#define XK_leftopentriangle                            0xacc\n#define XK_rightopentriangle                           0xacd\n#define XK_emopencircle                                0xace\n#define XK_emopenrectangle                             0xacf\n#define XK_leftsinglequotemark                         0xad0\n#define XK_rightsinglequotemark                        0xad1\n#define XK_leftdoublequotemark                         0xad2\n#define XK_rightdoublequotemark                        0xad3\n#define XK_prescription                                0xad4\n#define XK_minutes                                     0xad6\n#define XK_seconds                                     0xad7\n#define XK_latincross                                  0xad9\n#define XK_hexagram                                    0xada\n#define XK_filledrectbullet                            0xadb\n#define XK_filledlefttribullet                         0xadc\n#define XK_filledrighttribullet                        0xadd\n#define XK_emfilledcircle                              0xade\n#define XK_emfilledrect                                0xadf\n#define XK_enopencircbullet                            0xae0\n#define XK_enopensquarebullet                          0xae1\n#define XK_openrectbullet                              0xae2\n#define XK_opentribulletup                             0xae3\n#define XK_opentribulletdown                           0xae4\n#define XK_openstar                                    0xae5\n#define XK_enfilledcircbullet                          0xae6\n#define XK_enfilledsqbullet                            0xae7\n#define XK_filledtribulletup                           0xae8\n#define XK_filledtribulletdown                         0xae9\n#define XK_leftpointer                                 0xaea\n#define XK_rightpointer                                0xaeb\n#define XK_club                                        0xaec\n#define XK_diamond                                     0xaed\n#define XK_heart                                       0xaee\n#define XK_maltesecross                                0xaf0\n#define XK_dagger                                      0xaf1\n#define XK_doubledagger                                0xaf2\n#define XK_checkmark                                   0xaf3\n#define XK_ballotcross                                 0xaf4\n#define XK_musicalsharp                                0xaf5\n#define XK_musicalflat                                 0xaf6\n#define XK_malesymbol                                  0xaf7\n#define XK_femalesymbol                                0xaf8\n#define XK_telephone                                   0xaf9\n#define XK_telephonerecorder                           0xafa\n#define XK_phonographcopyright                         0xafb\n#define XK_caret                                       0xafc\n#define XK_singlelowquotemark                          0xafd\n#define XK_doublelowquotemark                          0xafe\n#define XK_cursor                                      0xaff\n// #endif /* XK_PUBLISHING */\n\n/*\n *  APL\n *  Byte 3 = b\n */\n\n// #ifdef XK_APL\n#define XK_leftcaret                                   0xba3\n#define XK_rightcaret                                  0xba6\n#define XK_downcaret                                   0xba8\n#define XK_upcaret                                     0xba9\n#define XK_overbar                                     0xbc0\n#define XK_downtack                                    0xbc2\n#define XK_upshoe                                      0xbc3\n#define XK_downstile                                   0xbc4\n#define XK_underbar                                    0xbc6\n#define XK_jot                                         0xbca\n#define XK_quad                                        0xbcc\n#define XK_uptack                                      0xbce\n#define XK_circle                                      0xbcf\n#define XK_upstile                                     0xbd3\n#define XK_downshoe                                    0xbd6\n#define XK_rightshoe                                   0xbd8\n#define XK_leftshoe                                    0xbda\n#define XK_lefttack                                    0xbdc\n#define XK_righttack                                   0xbfc\n// #endif /* XK_APL */\n\n/*\n * Hebrew\n * Byte 3 = c\n */\n\n// #ifdef XK_HEBREW\n#define XK_hebrew_doublelowline                        0xcdf\n#define XK_hebrew_aleph                                0xce0\n#define XK_hebrew_bet                                  0xce1\n#define XK_hebrew_beth                                 0xce1  /* deprecated */\n#define XK_hebrew_gimel                                0xce2\n#define XK_hebrew_gimmel                               0xce2  /* deprecated */\n#define XK_hebrew_dalet                                0xce3\n#define XK_hebrew_daleth                               0xce3  /* deprecated */\n#define XK_hebrew_he                                   0xce4\n#define XK_hebrew_waw                                  0xce5\n#define XK_hebrew_zain                                 0xce6\n#define XK_hebrew_zayin                                0xce6  /* deprecated */\n#define XK_hebrew_chet                                 0xce7\n#define XK_hebrew_het                                  0xce7  /* deprecated */\n#define XK_hebrew_tet                                  0xce8\n#define XK_hebrew_teth                                 0xce8  /* deprecated */\n#define XK_hebrew_yod                                  0xce9\n#define XK_hebrew_finalkaph                            0xcea\n#define XK_hebrew_kaph                                 0xceb\n#define XK_hebrew_lamed                                0xcec\n#define XK_hebrew_finalmem                             0xced\n#define XK_hebrew_mem                                  0xcee\n#define XK_hebrew_finalnun                             0xcef\n#define XK_hebrew_nun                                  0xcf0\n#define XK_hebrew_samech                               0xcf1\n#define XK_hebrew_samekh                               0xcf1  /* deprecated */\n#define XK_hebrew_ayin                                 0xcf2\n#define XK_hebrew_finalpe                              0xcf3\n#define XK_hebrew_pe                                   0xcf4\n#define XK_hebrew_finalzade                            0xcf5\n#define XK_hebrew_finalzadi                            0xcf5  /* deprecated */\n#define XK_hebrew_zade                                 0xcf6\n#define XK_hebrew_zadi                                 0xcf6  /* deprecated */\n#define XK_hebrew_qoph                                 0xcf7\n#define XK_hebrew_kuf                                  0xcf7  /* deprecated */\n#define XK_hebrew_resh                                 0xcf8\n#define XK_hebrew_shin                                 0xcf9\n#define XK_hebrew_taw                                  0xcfa\n#define XK_hebrew_taf                                  0xcfa  /* deprecated */\n#define XK_Hebrew_switch        0xFF7E  /* Alias for mode_switch */\n// #endif /* XK_HEBREW */\n\n/*\n * Thai\n * Byte 3 = d\n */\n\n// #ifdef XK_THAI\n#define XK_Thai_kokai\t\t\t\t\t0xda1\n#define XK_Thai_khokhai\t\t\t\t\t0xda2\n#define XK_Thai_khokhuat\t\t\t\t0xda3\n#define XK_Thai_khokhwai\t\t\t\t0xda4\n#define XK_Thai_khokhon\t\t\t\t\t0xda5\n#define XK_Thai_khorakhang\t\t\t        0xda6\n#define XK_Thai_ngongu\t\t\t\t\t0xda7\n#define XK_Thai_chochan\t\t\t\t\t0xda8\n#define XK_Thai_choching\t\t\t\t0xda9\n#define XK_Thai_chochang\t\t\t\t0xdaa\n#define XK_Thai_soso\t\t\t\t\t0xdab\n#define XK_Thai_chochoe\t\t\t\t\t0xdac\n#define XK_Thai_yoying\t\t\t\t\t0xdad\n#define XK_Thai_dochada\t\t\t\t\t0xdae\n#define XK_Thai_topatak\t\t\t\t\t0xdaf\n#define XK_Thai_thothan\t\t\t\t\t0xdb0\n#define XK_Thai_thonangmontho\t\t\t        0xdb1\n#define XK_Thai_thophuthao\t\t\t        0xdb2\n#define XK_Thai_nonen\t\t\t\t\t0xdb3\n#define XK_Thai_dodek\t\t\t\t\t0xdb4\n#define XK_Thai_totao\t\t\t\t\t0xdb5\n#define XK_Thai_thothung\t\t\t\t0xdb6\n#define XK_Thai_thothahan\t\t\t\t0xdb7\n#define XK_Thai_thothong\t \t\t\t0xdb8\n#define XK_Thai_nonu\t\t\t\t\t0xdb9\n#define XK_Thai_bobaimai\t\t\t\t0xdba\n#define XK_Thai_popla\t\t\t\t\t0xdbb\n#define XK_Thai_phophung\t\t\t\t0xdbc\n#define XK_Thai_fofa\t\t\t\t\t0xdbd\n#define XK_Thai_phophan\t\t\t\t\t0xdbe\n#define XK_Thai_fofan\t\t\t\t\t0xdbf\n#define XK_Thai_phosamphao\t\t\t        0xdc0\n#define XK_Thai_moma\t\t\t\t\t0xdc1\n#define XK_Thai_yoyak\t\t\t\t\t0xdc2\n#define XK_Thai_rorua\t\t\t\t\t0xdc3\n#define XK_Thai_ru\t\t\t\t\t0xdc4\n#define XK_Thai_loling\t\t\t\t\t0xdc5\n#define XK_Thai_lu\t\t\t\t\t0xdc6\n#define XK_Thai_wowaen\t\t\t\t\t0xdc7\n#define XK_Thai_sosala\t\t\t\t\t0xdc8\n#define XK_Thai_sorusi\t\t\t\t\t0xdc9\n#define XK_Thai_sosua\t\t\t\t\t0xdca\n#define XK_Thai_hohip\t\t\t\t\t0xdcb\n#define XK_Thai_lochula\t\t\t\t\t0xdcc\n#define XK_Thai_oang\t\t\t\t\t0xdcd\n#define XK_Thai_honokhuk\t\t\t\t0xdce\n#define XK_Thai_paiyannoi\t\t\t\t0xdcf\n#define XK_Thai_saraa\t\t\t\t\t0xdd0\n#define XK_Thai_maihanakat\t\t\t\t0xdd1\n#define XK_Thai_saraaa\t\t\t\t\t0xdd2\n#define XK_Thai_saraam\t\t\t\t\t0xdd3\n#define XK_Thai_sarai\t\t\t\t\t0xdd4\n#define XK_Thai_saraii\t\t\t\t\t0xdd5\n#define XK_Thai_saraue\t\t\t\t\t0xdd6\n#define XK_Thai_sarauee\t\t\t\t\t0xdd7\n#define XK_Thai_sarau\t\t\t\t\t0xdd8\n#define XK_Thai_sarauu\t\t\t\t\t0xdd9\n#define XK_Thai_phinthu\t\t\t\t\t0xdda\n#define XK_Thai_maihanakat_maitho   \t\t\t0xdde\n#define XK_Thai_baht\t\t\t\t\t0xddf\n#define XK_Thai_sarae\t\t\t\t\t0xde0\n#define XK_Thai_saraae\t\t\t\t\t0xde1\n#define XK_Thai_sarao\t\t\t\t\t0xde2\n#define XK_Thai_saraaimaimuan\t\t\t\t0xde3\n#define XK_Thai_saraaimaimalai\t\t\t\t0xde4\n#define XK_Thai_lakkhangyao\t\t\t\t0xde5\n#define XK_Thai_maiyamok\t\t\t\t0xde6\n#define XK_Thai_maitaikhu\t\t\t\t0xde7\n#define XK_Thai_maiek\t\t\t\t\t0xde8\n#define XK_Thai_maitho\t\t\t\t\t0xde9\n#define XK_Thai_maitri\t\t\t\t\t0xdea\n#define XK_Thai_maichattawa\t\t\t\t0xdeb\n#define XK_Thai_thanthakhat\t\t\t\t0xdec\n#define XK_Thai_nikhahit\t\t\t\t0xded\n#define XK_Thai_leksun\t\t\t\t\t0xdf0\n#define XK_Thai_leknung\t\t\t\t\t0xdf1\n#define XK_Thai_leksong\t\t\t\t\t0xdf2\n#define XK_Thai_leksam\t\t\t\t\t0xdf3\n#define XK_Thai_leksi\t\t\t\t\t0xdf4\n#define XK_Thai_lekha\t\t\t\t\t0xdf5\n#define XK_Thai_lekhok\t\t\t\t\t0xdf6\n#define XK_Thai_lekchet\t\t\t\t\t0xdf7\n#define XK_Thai_lekpaet\t\t\t\t\t0xdf8\n#define XK_Thai_lekkao\t\t\t\t\t0xdf9\n// #endif /* XK_THAI */\n\n/*\n *   Korean\n *   Byte 3 = e\n */\n\n// #ifdef XK_KOREAN\n\n#define XK_Hangul\t\t0xff31    /* Hangul start/stop(toggle) */\n#define XK_Hangul_Start\t\t0xff32    /* Hangul start */\n#define XK_Hangul_End\t\t0xff33    /* Hangul end, English start */\n#define XK_Hangul_Hanja\t\t0xff34    /* Start Hangul->Hanja Conversion */\n#define XK_Hangul_Jamo\t\t0xff35    /* Hangul Jamo mode */\n#define XK_Hangul_Romaja\t0xff36    /* Hangul Romaja mode */\n#define XK_Hangul_Codeinput\t0xff37    /* Hangul code input mode */\n#define XK_Hangul_Jeonja\t0xff38    /* Jeonja mode */\n#define XK_Hangul_Banja\t\t0xff39    /* Banja mode */\n#define XK_Hangul_PreHanja\t0xff3a    /* Pre Hanja conversion */\n#define XK_Hangul_PostHanja\t0xff3b    /* Post Hanja conversion */\n#define XK_Hangul_SingleCandidate\t0xff3c    /* Single candidate */\n#define XK_Hangul_MultipleCandidate\t0xff3d    /* Multiple candidate */\n#define XK_Hangul_PreviousCandidate\t0xff3e    /* Previous candidate */\n#define XK_Hangul_Special\t0xff3f    /* Special symbols */\n#define XK_Hangul_switch\t0xFF7E    /* Alias for mode_switch */\n\n/* Hangul Consonant Characters */\n#define XK_Hangul_Kiyeog\t\t\t\t0xea1\n#define XK_Hangul_SsangKiyeog\t\t\t\t0xea2\n#define XK_Hangul_KiyeogSios\t\t\t\t0xea3\n#define XK_Hangul_Nieun\t\t\t\t\t0xea4\n#define XK_Hangul_NieunJieuj\t\t\t\t0xea5\n#define XK_Hangul_NieunHieuh\t\t\t\t0xea6\n#define XK_Hangul_Dikeud\t\t\t\t0xea7\n#define XK_Hangul_SsangDikeud\t\t\t\t0xea8\n#define XK_Hangul_Rieul\t\t\t\t\t0xea9\n#define XK_Hangul_RieulKiyeog\t\t\t\t0xeaa\n#define XK_Hangul_RieulMieum\t\t\t\t0xeab\n#define XK_Hangul_RieulPieub\t\t\t\t0xeac\n#define XK_Hangul_RieulSios\t\t\t\t0xead\n#define XK_Hangul_RieulTieut\t\t\t\t0xeae\n#define XK_Hangul_RieulPhieuf\t\t\t\t0xeaf\n#define XK_Hangul_RieulHieuh\t\t\t\t0xeb0\n#define XK_Hangul_Mieum\t\t\t\t\t0xeb1\n#define XK_Hangul_Pieub\t\t\t\t\t0xeb2\n#define XK_Hangul_SsangPieub\t\t\t\t0xeb3\n#define XK_Hangul_PieubSios\t\t\t\t0xeb4\n#define XK_Hangul_Sios\t\t\t\t\t0xeb5\n#define XK_Hangul_SsangSios\t\t\t\t0xeb6\n#define XK_Hangul_Ieung\t\t\t\t\t0xeb7\n#define XK_Hangul_Jieuj\t\t\t\t\t0xeb8\n#define XK_Hangul_SsangJieuj\t\t\t\t0xeb9\n#define XK_Hangul_Cieuc\t\t\t\t\t0xeba\n#define XK_Hangul_Khieuq\t\t\t\t0xebb\n#define XK_Hangul_Tieut\t\t\t\t\t0xebc\n#define XK_Hangul_Phieuf\t\t\t\t0xebd\n#define XK_Hangul_Hieuh\t\t\t\t\t0xebe\n\n/* Hangul Vowel Characters */\n#define XK_Hangul_A\t\t\t\t\t0xebf\n#define XK_Hangul_AE\t\t\t\t\t0xec0\n#define XK_Hangul_YA\t\t\t\t\t0xec1\n#define XK_Hangul_YAE\t\t\t\t\t0xec2\n#define XK_Hangul_EO\t\t\t\t\t0xec3\n#define XK_Hangul_E\t\t\t\t\t0xec4\n#define XK_Hangul_YEO\t\t\t\t\t0xec5\n#define XK_Hangul_YE\t\t\t\t\t0xec6\n#define XK_Hangul_O\t\t\t\t\t0xec7\n#define XK_Hangul_WA\t\t\t\t\t0xec8\n#define XK_Hangul_WAE\t\t\t\t\t0xec9\n#define XK_Hangul_OE\t\t\t\t\t0xeca\n#define XK_Hangul_YO\t\t\t\t\t0xecb\n#define XK_Hangul_U\t\t\t\t\t0xecc\n#define XK_Hangul_WEO\t\t\t\t\t0xecd\n#define XK_Hangul_WE\t\t\t\t\t0xece\n#define XK_Hangul_WI\t\t\t\t\t0xecf\n#define XK_Hangul_YU\t\t\t\t\t0xed0\n#define XK_Hangul_EU\t\t\t\t\t0xed1\n#define XK_Hangul_YI\t\t\t\t\t0xed2\n#define XK_Hangul_I\t\t\t\t\t0xed3\n\n/* Hangul syllable-final (JongSeong) Characters */\n#define XK_Hangul_J_Kiyeog\t\t\t\t0xed4\n#define XK_Hangul_J_SsangKiyeog\t\t\t\t0xed5\n#define XK_Hangul_J_KiyeogSios\t\t\t\t0xed6\n#define XK_Hangul_J_Nieun\t\t\t\t0xed7\n#define XK_Hangul_J_NieunJieuj\t\t\t\t0xed8\n#define XK_Hangul_J_NieunHieuh\t\t\t\t0xed9\n#define XK_Hangul_J_Dikeud\t\t\t\t0xeda\n#define XK_Hangul_J_Rieul\t\t\t\t0xedb\n#define XK_Hangul_J_RieulKiyeog\t\t\t\t0xedc\n#define XK_Hangul_J_RieulMieum\t\t\t\t0xedd\n#define XK_Hangul_J_RieulPieub\t\t\t\t0xede\n#define XK_Hangul_J_RieulSios\t\t\t\t0xedf\n#define XK_Hangul_J_RieulTieut\t\t\t\t0xee0\n#define XK_Hangul_J_RieulPhieuf\t\t\t\t0xee1\n#define XK_Hangul_J_RieulHieuh\t\t\t\t0xee2\n#define XK_Hangul_J_Mieum\t\t\t\t0xee3\n#define XK_Hangul_J_Pieub\t\t\t\t0xee4\n#define XK_Hangul_J_PieubSios\t\t\t\t0xee5\n#define XK_Hangul_J_Sios\t\t\t\t0xee6\n#define XK_Hangul_J_SsangSios\t\t\t\t0xee7\n#define XK_Hangul_J_Ieung\t\t\t\t0xee8\n#define XK_Hangul_J_Jieuj\t\t\t\t0xee9\n#define XK_Hangul_J_Cieuc\t\t\t\t0xeea\n#define XK_Hangul_J_Khieuq\t\t\t\t0xeeb\n#define XK_Hangul_J_Tieut\t\t\t\t0xeec\n#define XK_Hangul_J_Phieuf\t\t\t\t0xeed\n#define XK_Hangul_J_Hieuh\t\t\t\t0xeee\n\n/* Ancient Hangul Consonant Characters */\n#define XK_Hangul_RieulYeorinHieuh\t\t\t0xeef\n#define XK_Hangul_SunkyeongeumMieum\t\t\t0xef0\n#define XK_Hangul_SunkyeongeumPieub\t\t\t0xef1\n#define XK_Hangul_PanSios\t\t\t\t0xef2\n#define XK_Hangul_KkogjiDalrinIeung\t\t\t0xef3\n#define XK_Hangul_SunkyeongeumPhieuf\t\t\t0xef4\n#define XK_Hangul_YeorinHieuh\t\t\t\t0xef5\n\n/* Ancient Hangul Vowel Characters */\n#define XK_Hangul_AraeA\t\t\t\t\t0xef6\n#define XK_Hangul_AraeAE\t\t\t\t0xef7\n\n/* Ancient Hangul syllable-final (JongSeong) Characters */\n#define XK_Hangul_J_PanSios\t\t\t\t0xef8\n#define XK_Hangul_J_KkogjiDalrinIeung\t\t\t0xef9\n#define XK_Hangul_J_YeorinHieuh\t\t\t\t0xefa\n\n/* Korean currency symbol */\n#define XK_Korean_Won\t\t\t\t\t0xeff\n\n// #endif /* XK_KOREAN */\n"
  },
  {
    "path": "OSXvnc-server/include/Xserver/colormap.h",
    "content": "/*\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n*/\n/* $XConsortium: colormap.h,v 1.28 94/04/17 20:25:32 dpw Exp $ */\n\n\n\n\n/* $XFree86: xc/programs/Xserver/include/colormap.h,v 1.2 1997/01/14 22:22:38 dawes Exp $ */\n#ifndef CMAP_H\n#define CMAP_H 1\n\n#include \"X11/Xproto.h\"\n#include \"screenint.h\"\n#include \"window.h\"\n\n/* these follow X.h's AllocNone and AllocAll */\n#define CM_PSCREEN 2\n#define CM_PWIN    3\n/* Passed internally in colormap.c */\n#define REDMAP 0\n#define GREENMAP 1\n#define BLUEMAP 2\n#define PSEUDOMAP 3\n#define AllocPrivate (-1)\n#define AllocTemporary (-2)\n#define DynamicClass  1\n\n/* Values for the flags field of a colormap. These should have 1 bit set\n * and not overlap */\n#define IsDefault 1\n#define AllAllocated 2\n#define BeingCreated 4\n\n\ntypedef CARD32 Pixel;\ntypedef struct _CMEntry *EntryPtr;\n/* moved to screenint.h: typedef struct _ColormapRec *ColormapPtr */\ntypedef struct _colorResource *colorResourcePtr;\n\nextern int CreateColormap(\n    Colormap /*mid*/,\n    ScreenPtr /*pScreen*/,\n    VisualPtr /*pVisual*/,\n    ColormapPtr* /*ppcmap*/,\n    int /*alloc*/,\n    int /*client*/\n);\n\nextern int FreeColormap(\n    pointer /*pmap*/,\n    XID /*mid*/\n);\n\nextern int TellLostMap(\n    X11WindowPtr /*pwin*/,\n    pointer /* Colormap *pmid */\n);\n\nextern int TellGainedMap(\n    X11WindowPtr /*pwin*/,\n    pointer /* Colormap *pmid */\n);\n\nextern int CopyColormapAndFree(\n    Colormap /*mid*/,\n    ColormapPtr /*pSrc*/,\n    int /*client*/\n);\n\nextern int AllocColor(\n    ColormapPtr /*pmap*/,\n    unsigned short* /*pred*/,\n    unsigned short* /*pgreen*/,\n    unsigned short* /*pblue*/,\n    Pixel* /*pPix*/,\n    int /*client*/\n);\n\nextern void FakeAllocColor(\n    ColormapPtr /*pmap*/,\n    xColorItem * /*item*/\n);\n\nextern void FakeFreeColor(\n    ColormapPtr /*pmap*/,\n    Pixel /*pixel*/\n);\n\ntypedef int (*ColorCompareProcPtr)(\n    EntryPtr /*pent*/,\n    xrgb * /*prgb*/\n);\n\nextern int FindColor(\n    ColormapPtr /*pmap*/,\n    EntryPtr /*pentFirst*/,\n    int /*size*/,\n    xrgb* /*prgb*/,\n    Pixel* /*pPixel*/,\n    int /*channel*/,\n    int /*client*/,\n    ColorCompareProcPtr /*comp*/\n);\n\nextern int QueryColors(\n    ColormapPtr /*pmap*/,\n    int /*count*/,\n    Pixel* /*ppixIn*/,\n    xrgb* /*prgbList*/\n);\n\nextern int FreeClientPixels(\n    pointer /*pcr*/,\n    XID /*fakeid*/\n);\n\nextern int AllocColorCells(\n    int /*client*/,\n    ColormapPtr /*pmap*/,\n    int /*colors*/,\n    int /*planes*/,\n    Bool /*contig*/,\n    Pixel* /*ppix*/,\n    Pixel* /*masks*/\n);\n\nextern int AllocColorPlanes(\n    int /*client*/,\n    ColormapPtr /*pmap*/,\n    int /*colors*/,\n    int /*r*/,\n    int /*g*/,\n    int /*b*/,\n    Bool /*contig*/,\n    Pixel* /*pixels*/,\n    Pixel* /*prmask*/,\n    Pixel* /*pgmask*/,\n    Pixel* /*pbmask*/\n);\n\nextern int FreeColors(\n    ColormapPtr /*pmap*/,\n    int /*client*/,\n    int /*count*/,\n    Pixel* /*pixels*/,\n    Pixel /*mask*/\n);\n\nextern int StoreColors(\n    ColormapPtr /*pmap*/,\n    int /*count*/,\n    xColorItem* /*defs*/\n);\n\nextern int IsMapInstalled(\n    Colormap /*map*/,\n    X11WindowPtr /*pWin*/\n);\n\n#endif /* CMAP_H */\n"
  },
  {
    "path": "OSXvnc-server/include/Xserver/cursor.h",
    "content": "/***********************************************************\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n******************************************************************/\n/* $XConsortium: cursor.h,v 1.22 94/04/17 20:25:34 dpw Exp $ */\n#ifndef CURSOR_H\n#define CURSOR_H\n\n#include \"misc.h\"\n#include \"screenint.h\"\n#include \"window.h\"\n\n#define NullCursor ((CursorPtr)NULL)\n\ntypedef struct _Cursor *CursorPtr;\ntypedef struct _CursorMetric *CursorMetricPtr;\n\nextern CursorPtr rootCursor;\n\nextern int FreeCursor(\n    pointer /*pCurs*/,\n    XID /*cid*/\n);\n\nextern CursorPtr X11AllocCursor(\n    unsigned char* /*psrcbits*/,\n    unsigned char* /*pmaskbits*/,\n    CursorMetricPtr /*cm*/,\n    unsigned /*foreRed*/,\n    unsigned /*foreGreen*/,\n    unsigned /*foreBlue*/,\n    unsigned /*backRed*/,\n    unsigned /*backGreen*/,\n    unsigned /*backBlue*/\n);\n\nextern int AllocGlyphCursor(\n    Font /*source*/,\n    unsigned int /*sourceChar*/,\n    Font /*mask*/,\n    unsigned int /*maskChar*/,\n    unsigned /*foreRed*/,\n    unsigned /*foreGreen*/,\n    unsigned /*foreBlue*/,\n    unsigned /*backRed*/,\n    unsigned /*backGreen*/,\n    unsigned /*backBlue*/,\n    CursorPtr* /*ppCurs*/,\n    ClientPtr /*client*/\n);\n\nextern CursorPtr CreateRootCursor(\n    char* /*pfilename*/,\n    unsigned int /*glyph*/\n);\n\nextern int ServerBitsFromGlyph(\n    FontPtr /*pfont*/,\n    unsigned int /*ch*/,\n    register CursorMetricPtr /*cm*/,\n    unsigned char ** /*ppbits*/\n);\n\nextern Bool CursorMetricsFromGlyph(\n    FontPtr /*pfont*/,\n    unsigned /*ch*/,\n    CursorMetricPtr /*cm*/\n);\n\nextern void CheckCursorConfinement(\n    X11WindowPtr /*pWin*/\n);\n\nextern void NewCurrentScreen(\n    ScreenPtr /*newScreen*/,\n    int /*x*/,\n    int /*y*/\n);\n\nextern Bool PointerConfinedToScreen(\n    void\n);\n\nextern void GetSpritePosition(\n    int * /*px*/,\n    int * /*py*/\n);\n\n#endif /* CURSOR_H */\n"
  },
  {
    "path": "OSXvnc-server/include/Xserver/dix.h",
    "content": "/***********************************************************\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n******************************************************************/\n/* $XConsortium: dix.h /main/44 1996/12/15 21:24:57 rws $ */\n/* $XFree86: xc/programs/Xserver/include/dix.h,v 3.7 1996/12/31 04:17:46 dawes Exp $ */\n\n#ifndef DIX_H\n#define DIX_H\n\n#include \"gc.h\"\n#include \"window.h\"\n#include \"input.h\"\n\n#define EARLIER -1\n#define SAMETIME 0\n#define LATER 1\n\n#define NullClient ((ClientPtr) 0)\n#define REQUEST(type) \\\n        register type *stuff = (type *)client->requestBuffer\n\n\n#define REQUEST_SIZE_MATCH(req)\\\n    if ((sizeof(req) >> 2) != client->req_len)\\\n         return(BadLength)\n\n#define REQUEST_AT_LEAST_SIZE(req) \\\n    if ((sizeof(req) >> 2) > client->req_len )\\\n         return(BadLength)\n\n#define REQUEST_FIXED_SIZE(req, n)\\\n    if (((sizeof(req) >> 2) > client->req_len) || \\\n        (((sizeof(req) + (n) + 3) >> 2) != client->req_len)) \\\n         return(BadLength)\n\n#define LEGAL_NEW_RESOURCE(id,client)\\\n    if (!LegalNewID(id,client)) \\\n    {\\\n        client->errorValue = id;\\\n        return(BadIDChoice);\\\n    }\n\n/* XXX if you are using this macro, you are probably not generating Match\n * errors where appropriate */\n#define LOOKUP_DRAWABLE(did, client)\\\n    ((client->lastDrawableID == did) ? \\\n     client->lastDrawable : (DrawablePtr)LookupDrawable(did, client))\n\n#ifdef XCSECURITY\n\n#define SECURITY_VERIFY_DRAWABLE(pDraw, did, client, mode)\\\n    if (client->lastDrawableID == did && !client->trustLevel)\\\n        pDraw = client->lastDrawable;\\\n    else \\\n    {\\\n        pDraw = (DrawablePtr) SecurityLookupIDByClass(client, did, \\\n                                                      RC_DRAWABLE, mode);\\\n        if (!pDraw) \\\n        {\\\n            client->errorValue = did; \\\n            return BadDrawable;\\\n        }\\\n        if (pDraw->type == UNDRAWABLE_WINDOW)\\\n            return BadMatch;\\\n    }\n\n#define SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, mode)\\\n    if (client->lastDrawableID == did && !client->trustLevel)\\\n        pDraw = client->lastDrawable;\\\n    else \\\n    {\\\n        pDraw = (DrawablePtr) SecurityLookupIDByClass(client, did, \\\n                                                      RC_DRAWABLE, mode);\\\n        if (!pDraw) \\\n        {\\\n            client->errorValue = did; \\\n            return BadDrawable;\\\n        }\\\n    }\n\n#define SECURITY_VERIFY_GC(pGC, rid, client, mode)\\\n    if (client->lastGCID == rid && !client->trustLevel)\\\n        pGC = client->lastGC;\\\n    else\\\n        pGC = (GC *) SecurityLookupIDByType(client, rid, RT_GC, mode);\\\n    if (!pGC)\\\n    {\\\n        client->errorValue = rid;\\\n        return (BadGC);\\\n    }\n\n#define VERIFY_DRAWABLE(pDraw, did, client)\\\n        SECURITY_VERIFY_DRAWABLE(pDraw, did, client, SecurityUnknownAccess)\n\n#define VERIFY_GEOMETRABLE(pDraw, did, client)\\\n        SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, SecurityUnknownAccess)\n\n#define VERIFY_GC(pGC, rid, client)\\\n        SECURITY_VERIFY_GC(pGC, rid, client, SecurityUnknownAccess)\n\n#else /* not XCSECURITY */\n\n#define VERIFY_DRAWABLE(pDraw, did, client)\\\n    if (client->lastDrawableID == did)\\\n        pDraw = client->lastDrawable;\\\n    else \\\n    {\\\n        pDraw = (DrawablePtr) LookupIDByClass(did, RC_DRAWABLE);\\\n        if (!pDraw) \\\n        {\\\n            client->errorValue = did; \\\n            return BadDrawable;\\\n        }\\\n        if (pDraw->type == UNDRAWABLE_WINDOW)\\\n            return BadMatch;\\\n    }\n\n#define VERIFY_GEOMETRABLE(pDraw, did, client)\\\n    if (client->lastDrawableID == did)\\\n        pDraw = client->lastDrawable;\\\n    else \\\n    {\\\n        pDraw = (DrawablePtr) LookupIDByClass(did, RC_DRAWABLE);\\\n        if (!pDraw) \\\n        {\\\n            client->errorValue = did; \\\n            return BadDrawable;\\\n        }\\\n    }\n\n#define VERIFY_GC(pGC, rid, client)\\\n    if (client->lastGCID == rid)\\\n        pGC = client->lastGC;\\\n    else\\\n        pGC = (GC *)LookupIDByType(rid, RT_GC);\\\n    if (!pGC)\\\n    {\\\n        client->errorValue = rid;\\\n        return (BadGC);\\\n    }\n\n#define SECURITY_VERIFY_DRAWABLE(pDraw, did, client, mode)\\\n        VERIFY_DRAWABLE(pDraw, did, client)\n\n#define SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, mode)\\\n        VERIFY_GEOMETRABLE(pDraw, did, client)\n\n#define SECURITY_VERIFY_GC(pGC, rid, client, mode)\\\n        VERIFY_GC(pGC, rid, client)\n\n#endif /* XCSECURITY */\n\n/*\n * We think that most hardware implementations of DBE will want\n * LookupID*(dbe_back_buffer_id) to return the window structure that the\n * id is a back buffer for.  Since both front and back buffers will\n * return the same structure, you need to be able to distinguish\n * somewhere what kind of buffer (front/back) was being asked for, so\n * that ddx can render to the right place.  That's the problem that the\n * following code solves.  Note: we couldn't embed this in the LookupID*\n * functions because the VALIDATE_DRAWABLE_AND_GC macro often circumvents\n * those functions by checking a one-element cache.  That's why we're\n * mucking with VALIDATE_DRAWABLE_AND_GC.\n *\n * If you put -DNEED_DBE_BUF_BITS into PervasiveDBEDefines, the window\n * structure will have two additional bits defined, srcBuffer and\n * dstBuffer, and their values will be maintained via the macros\n * SET_DBE_DSTBUF and SET_DBE_SRCBUF (below).  If you also\n * put -DNEED_DBE_BUF_VALIDATE into PervasiveDBEDefines, the function\n * DbeValidateBuffer will be called any time the bits change to give you\n * a chance to do some setup.  See the DBE code for more details on this\n * function.  We put in these levels of conditionality so that you can do\n * just what you need to do, and no more.  If neither of these defines\n * are used, the bits won't be there, and VALIDATE_DRAWABLE_AND_GC will\n * be unchanged.        dpw\n */\n\n#if defined(NEED_DBE_BUF_BITS)\n#define SET_DBE_DSTBUF(_pDraw, _drawID) \\\n        SET_DBE_BUF(_pDraw, _drawID, dstBuffer, TRUE)\n#define SET_DBE_SRCBUF(_pDraw, _drawID) \\\n        SET_DBE_BUF(_pDraw, _drawID, srcBuffer, FALSE)\n#if defined (NEED_DBE_BUF_VALIDATE)\n#define SET_DBE_BUF(_pDraw, _drawID, _whichBuffer, _dstbuf) \\\n    if (_pDraw->type == DRAWABLE_WINDOW)\\\n    {\\\n        int thisbuf = (_pDraw->id == _drawID);\\\n        if (thisbuf != ((X11WindowPtr)_pDraw)->_whichBuffer)\\\n        {\\\n             ((X11WindowPtr)_pDraw)->_whichBuffer = thisbuf;\\\n             DbeValidateBuffer((X11WindowPtr)_pDraw, _drawID, _dstbuf);\\\n        }\\\n     }\n#else /* want buffer bits, but don't need to call DbeValidateBuffer */\n#define SET_DBE_BUF(_pDraw, _drawID, _whichBuffer, _dstbuf) \\\n    if (_pDraw->type == DRAWABLE_WINDOW)\\\n    {\\\n        ((X11WindowPtr)_pDraw)->_whichBuffer = (_pDraw->id == _drawID);\\\n    }\n#endif /* NEED_DBE_BUF_VALIDATE */\n#else /* don't want buffer bits in window */\n#define SET_DBE_DSTBUF(_pDraw, _drawID) /**/\n#define SET_DBE_SRCBUF(_pDraw, _drawID) /**/\n#endif /* NEED_DBE_BUF_BITS */\n\n#define VALIDATE_DRAWABLE_AND_GC(drawID, pDraw, pGC, client)\\\n    if ((stuff->gc == INVALID) || (client->lastGCID != stuff->gc) ||\\\n        (client->lastDrawableID != drawID))\\\n    {\\\n        SECURITY_VERIFY_GEOMETRABLE(pDraw, drawID, client, SecurityWriteAccess);\\\n        SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityReadAccess);\\\n        if ((pGC->depth != pDraw->depth) ||\\\n            (pGC->pScreen != pDraw->pScreen))\\\n            return (BadMatch);\\\n        client->lastDrawable = pDraw;\\\n        client->lastDrawableID = drawID;\\\n        client->lastGC = pGC;\\\n        client->lastGCID = stuff->gc;\\\n    }\\\n    else\\\n    {\\\n        pGC = client->lastGC;\\\n        pDraw = client->lastDrawable;\\\n    }\\\n    SET_DBE_DSTBUF(pDraw, drawID);\\\n    if (pGC->serialNumber != pDraw->serialNumber)\\\n        ValidateGC(pDraw, pGC);\n\n\n#define WriteReplyToClient(pClient, size, pReply) \\\n   if ((pClient)->swapped) \\\n      (*ReplySwapVector[((xReq *)(pClient)->requestBuffer)->reqType]) \\\n           (pClient, (int)(size), pReply); \\\n      else (void) WriteToClient(pClient, (int)(size), (char *)(pReply));\n\n#define WriteSwappedDataToClient(pClient, size, pbuf) \\\n   if ((pClient)->swapped) \\\n      (*(pClient)->pSwapReplyFunc)(pClient, (int)(size), pbuf); \\\n   else (void) WriteToClient (pClient, (int)(size), (char *)(pbuf));\n\ntypedef struct _TimeStamp *TimeStampPtr;\n\n#ifndef _XTYPEDEF_CLIENTPTR\ntypedef struct _Client *ClientPtr; /* also in misc.h */\n#define _XTYPEDEF_CLIENTPTR\n#endif\n\ntypedef struct _WorkQueue       *WorkQueuePtr;\n\nextern ClientPtr requestingClient;\nextern ClientPtr *clients;\nextern ClientPtr serverClient;\nextern int currentMaxClients;\n\n#if !(defined(__alpha) || defined(__alpha__))\ntypedef long HWEventQueueType;\n#else\ntypedef int HWEventQueueType;\n#endif\ntypedef HWEventQueueType* HWEventQueuePtr;\n\nextern HWEventQueuePtr checkForInput[2];\n\ntypedef struct _TimeStamp {\n    CARD32 months;      /* really ~49.7 days */\n    CARD32 milliseconds;\n}           TimeStamp;\n\n/* dispatch.c */\n\nextern void SetInputCheck(\n#if NeedFunctionPrototypes\n    HWEventQueuePtr /*c0*/,\n    HWEventQueuePtr /*c1*/\n#endif\n);\n\nextern void CloseDownClient(\n#if NeedFunctionPrototypes\n    ClientPtr /*client*/\n#endif\n);\n\nextern void UpdateCurrentTime(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern void UpdateCurrentTimeIf(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern void InitSelections(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern void FlushClientCaches(\n#if NeedFunctionPrototypes\n    XID /*id*/\n#endif\n);\n\nextern int dixDestroyPixmap(\n#if NeedFunctionPrototypes\n    pointer /*value*/,\n    XID /*pid*/\n#endif\n);\n\nextern void CloseDownRetainedResources(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern void InitClient(\n#if NeedFunctionPrototypes\n    ClientPtr /*client*/,\n    int /*i*/,\n    pointer /*ospriv*/\n#endif\n);\n\nextern ClientPtr NextAvailableClient(\n#if NeedFunctionPrototypes\n    pointer /*ospriv*/\n#endif\n);\n\nextern void SendErrorToClient(\n#if NeedFunctionPrototypes\n    ClientPtr /*client*/,\n    unsigned int /*majorCode*/,\n    unsigned int /*minorCode*/,\n    XID /*resId*/,\n    int /*errorCode*/\n#endif\n);\n\nextern void DeleteWindowFromAnySelections(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/\n#endif\n);\n\nextern void MarkClientException(\n#if NeedFunctionPrototypes\n    ClientPtr /*client*/\n#endif\n);\n\nextern int GetGeometry(\n#if NeedFunctionPrototypes\n    ClientPtr /*client*/,\n    xGetGeometryReply* /* wa */\n#endif\n);\n\n/* dixutils.c */\n\nextern void CopyISOLatin1Lowered(\n#if NeedFunctionPrototypes\n    unsigned char * /*dest*/,\n    unsigned char * /*source*/,\n    int /*length*/\n#endif\n);\n\n#ifdef XCSECURITY\n\nextern X11WindowPtr SecurityLookupWindow(\n#if NeedFunctionPrototypes\n    XID /*rid*/,\n    ClientPtr /*client*/,\n    Mask /*access_mode*/\n#endif\n);\n\nextern pointer SecurityLookupDrawable(\n#if NeedFunctionPrototypes\n    XID /*rid*/,\n    ClientPtr /*client*/,\n    Mask /*access_mode*/\n#endif\n);\n\nextern X11WindowPtr LookupWindow(\n#if NeedFunctionPrototypes\n    XID /*rid*/,\n    ClientPtr /*client*/\n#endif\n);\n\nextern pointer LookupDrawable(\n#if NeedFunctionPrototypes\n    XID /*rid*/,\n    ClientPtr /*client*/\n#endif\n);\n\n#else\n\nextern X11WindowPtr LookupWindow(\n#if NeedFunctionPrototypes\n    XID /*rid*/,\n    ClientPtr /*client*/\n#endif\n);\n\nextern pointer LookupDrawable(\n#if NeedFunctionPrototypes\n    XID /*rid*/,\n    ClientPtr /*client*/\n#endif\n);\n\n#define SecurityLookupWindow(rid, client, access_mode) \\\n        LookupWindow(rid, client)\n\n#define SecurityLookupDrawable(rid, client, access_mode) \\\n        LookupDrawable(rid, client)\n\n#endif /* XCSECURITY */\n\nextern ClientPtr LookupClient(\n#if NeedFunctionPrototypes\n    XID /*rid*/,\n    ClientPtr /*client*/\n#endif\n);\n\nextern void NoopDDA(\n#if NeedVarargsPrototypes\n    void *,\n    ...\n#endif\n);\n\nextern int AlterSaveSetForClient(\n#if NeedFunctionPrototypes\n    ClientPtr /*client*/,\n    X11WindowPtr /*pWin*/,\n    unsigned /*mode*/\n#endif\n);\n\nextern void DeleteWindowFromAnySaveSet(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/\n#endif\n);\n\nextern void BlockHandler(\n#if NeedFunctionPrototypes\n    pointer /*pTimeout*/,\n    pointer /*pReadmask*/\n#endif\n);\n\nextern void WakeupHandler(\n#if NeedFunctionPrototypes\n    int /*result*/,\n    pointer /*pReadmask*/\n#endif\n);\n\ntypedef struct timeval ** OSTimePtr;\n\ntypedef void (* BlockHandlerProcPtr)(\n#if NeedNestedPrototypes\n    pointer /* blockData */,\n    OSTimePtr /* pTimeout */,\n    pointer /* pReadmask */\n#endif\n);\n\ntypedef void (* WakeupHandlerProcPtr)(\n#if NeedNestedPrototypes\n    pointer /* blockData */,\n    int /* result */,\n    pointer /* pReadmask */\n#endif\n);\n\nextern Bool RegisterBlockAndWakeupHandlers(\n#if NeedFunctionPrototypes\n    BlockHandlerProcPtr /*blockHandler*/,\n    WakeupHandlerProcPtr /*wakeupHandler*/,\n    pointer /*blockData*/\n#endif\n);\n\nextern void RemoveBlockAndWakeupHandlers(\n#if NeedFunctionPrototypes\n    BlockHandlerProcPtr /*blockHandler*/,\n    WakeupHandlerProcPtr /*wakeupHandler*/,\n    pointer /*blockData*/\n#endif\n);\n\nextern void InitBlockAndWakeupHandlers(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern void ProcessWorkQueue(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern Bool QueueWorkProc(\n#if NeedFunctionPrototypes\n    Bool (* /*function*/)(\n#if NeedNestedPrototypes\n        ClientPtr /*clientUnused*/,\n        pointer /*closure*/\n#endif\n        ),\n    ClientPtr /*client*/,\n    pointer /*closure*/\n#endif\n);\n\ntypedef Bool (* ClientSleepProcPtr)(\n#if NeedFunctionPrototypes\n    ClientPtr /*client*/,\n    pointer /*closure*/\n#endif\n);\n\nextern Bool ClientSleep(\n    ClientPtr /*client*/,\n    ClientSleepProcPtr /* function */,\n    pointer /*closure*/\n);\n\nextern Bool ClientSignal(\n    ClientPtr /*client*/\n);\n\nextern void ClientWakeup(\n    ClientPtr /*client*/\n);\n\nextern Bool ClientIsAsleep(\n    ClientPtr /*client*/\n);\n\n/* atom.c */\n\nextern Atom MakeAtom(\n    char * /*string*/,\n    unsigned /*len*/,\n    Bool /*makeit*/\n);\n\nextern Bool ValidAtom(\n    Atom /*atom*/\n);\n\nextern char *NameForAtom(\n    Atom /*atom*/\n);\n\nextern void AtomError(\n    void\n);\n\nextern void FreeAllAtoms(\n    void\n);\n\nextern void InitAtoms(\n    void\n);\n\n/* events.c */\n\nextern void SetMaskForEvent(\n    Mask /* mask */,\n    int /* event */\n);\n\nextern Bool PointerConfinedToScreen(\n    void\n);\n\nextern Bool IsParent(\n    X11WindowPtr /* maybeparent */,\n    X11WindowPtr /* child */\n);\n\nextern X11WindowPtr GetCurrentRootWindow(\n    void\n);\n\nextern X11WindowPtr GetSpriteWindow(\n    void\n);\n\nextern void GetSpritePosition(\n    int * /* px */,\n    int * /* py */\n);\n\nextern void NoticeEventTime(\n    xEventPtr /* xE */\n);\n\nextern void EnqueueEvent(\n    xEventPtr /* xE */,\n    DeviceIntPtr /* device */,\n    int /* count */\n);\n\nextern void ComputeFreezes(\n    void\n);\n\nextern void CheckGrabForSyncs(\n    DeviceIntPtr /* dev */,\n    Bool /* thisMode */,\n    Bool /* otherMode */\n);\n\nextern void ActivatePointerGrab(\n    DeviceIntPtr /* mouse */,\n    GrabPtr /* grab */,\n    TimeStamp /* time */,\n    Bool /* autoGrab */\n);\n\nextern void DeactivatePointerGrab(\n    DeviceIntPtr /* mouse */\n);\n\nextern void ActivateKeyboardGrab(\n    DeviceIntPtr /* keybd */,\n    GrabPtr /* grab */,\n    TimeStamp /* time */,\n    Bool /* passive */\n);\n\nextern void DeactivateKeyboardGrab(\n    DeviceIntPtr /* keybd */\n);\n\nextern void AllowSome(\n    ClientPtr   /* client */,\n    TimeStamp /* time */,\n    DeviceIntPtr /* thisDev */,\n    int /* newState */\n);\n\nextern void ReleaseActiveGrabs(\nClientPtr client\n);\n\nextern int DeliverEventsToWindow(\n    X11WindowPtr /* pWin */,\n    xEventPtr /* pEvents */,\n    int /* count */,\n    Mask /* filter */,\n    GrabPtr /* grab */,\n    int /* mskidx */\n);\n\nextern int DeliverDeviceEvents(\n    X11WindowPtr /* pWin */,\n    xEventPtr /* xE */,\n    GrabPtr /* grab */,\n    X11WindowPtr /* stopAt */,\n    DeviceIntPtr /* dev */,\n    int /* count */\n);\n\nextern void DefineInitialRootWindow(\n    X11WindowPtr /* win */\n);\n\nextern void WindowHasNewCursor(\n    X11WindowPtr /* pWin */\n);\n\nextern Bool CheckDeviceGrabs(\n    DeviceIntPtr /* device */,\n    xEventPtr /* xE */,\n    int /* checkFirst */,\n    int /* count */\n);\n\nextern void DeliverFocusedEvent(\n    DeviceIntPtr /* keybd */,\n    xEventPtr /* xE */,\n    X11WindowPtr /* window */,\n    int /* count */\n);\n\nextern void DeliverGrabbedEvent(\n    xEventPtr /* xE */,\n    DeviceIntPtr /* thisDev */,\n    Bool /* deactivateGrab */,\n    int /* count */\n);\n\nextern void RecalculateDeliverableEvents(\n    X11WindowPtr /* pWin */\n);\n\nextern int OtherClientGone(\n    pointer /* value */,\n    XID /* id */\n);\n\nextern void DoFocusEvents(\n    DeviceIntPtr /* dev */,\n    X11WindowPtr /* fromWin */,\n    X11WindowPtr /* toWin */,\n    int /* mode */\n);\n\nextern int SetInputFocus(\n    ClientPtr /* client */,\n    DeviceIntPtr /* dev */,\n    Window /* focusID */,\n    CARD8 /* revertTo */,\n    Time /* ctime */,\n    Bool /* followOK */\n);\n\nextern int GrabDevice(\n    ClientPtr /* client */,\n    DeviceIntPtr /* dev */,\n    unsigned /* this_mode */,\n    unsigned /* other_mode */,\n    Window /* grabWindow */,\n    unsigned /* ownerEvents */,\n    Time /* ctime */,\n    Mask /* mask */,\n    CARD8 * /* status */\n);\n\nextern void InitEvents(\n    void\n);\n\nextern void DeleteWindowFromAnyEvents(\n    X11WindowPtr        /* pWin */,\n    Bool /* freeResources */\n);\n\nextern void CheckCursorConfinement(\n    X11WindowPtr /* pWin */\n);\n\nextern Mask EventMaskForClient(\n    X11WindowPtr /* pWin */,\n    ClientPtr /* client */\n);\n\n\n\nextern int DeliverEvents(\n    X11WindowPtr /*pWin*/,\n    xEventPtr /*xE*/,\n    int /*count*/,\n    X11WindowPtr /*otherParent*/\n);\n\nextern void WriteEventsToClient(\n    ClientPtr /*pClient*/,\n    int      /*count*/,\n    xEventPtr /*events*/\n);\n\nextern int TryClientEvents(\n    ClientPtr /*client*/,\n    xEventPtr /*pEvents*/,\n    int /*count*/,\n    Mask /*mask*/,\n    Mask /*filter*/,\n    GrabPtr /*grab*/\n);\n\nextern int EventSelectForWindow(\n    X11WindowPtr /*pWin*/,\n    ClientPtr /*client*/,\n    Mask /*mask*/\n);\n\nextern int EventSuppressForWindow(\n    X11WindowPtr /*pWin*/,\n    ClientPtr /*client*/,\n    Mask /*mask*/,\n    Bool * /*checkOptional*/\n);\n\nextern int MaybeDeliverEventsToClient(\n    X11WindowPtr /*pWin*/,\n    xEventPtr /*pEvents*/,\n    int /*count*/,\n    Mask /*filter*/,\n    ClientPtr /*dontClient*/\n);\n\nextern void WindowsRestructured(\n    void\n);\n\nextern void ResetClientPrivates(\n    void\n);\n\nextern int AllocateClientPrivateIndex(\n    void\n);\n\nextern Bool AllocateClientPrivate(\n    int /*index*/,\n    unsigned /*amount*/\n);\n\n/*\n *  callback manager stuff\n */\n\n#ifndef _XTYPEDEF_CALLBACKLISTPTR\ntypedef struct _CallbackList *CallbackListPtr; /* also in misc.h */\n#define _XTYPEDEF_CALLBACKLISTPTR\n#endif\n\ntypedef void (*CallbackProcPtr) (\n    CallbackListPtr *, pointer, pointer\n);\n\ntypedef Bool (*AddCallbackProcPtr) (\n    CallbackListPtr *, CallbackProcPtr, pointer\n);\n\ntypedef Bool (*DeleteCallbackProcPtr) (\n    CallbackListPtr *, CallbackProcPtr, pointer\n);\n\ntypedef void (*CallCallbacksProcPtr) (\n    CallbackListPtr *, pointer\n);\n\ntypedef void (*DeleteCallbackListProcPtr) (\n    CallbackListPtr *\n);\n\ntypedef struct _CallbackProcs {\n    AddCallbackProcPtr          AddCallback;\n    DeleteCallbackProcPtr       DeleteCallback;\n    CallCallbacksProcPtr        CallCallbacks;\n    DeleteCallbackListProcPtr   DeleteCallbackList;\n} CallbackFuncsRec, *CallbackFuncsPtr;\n\nextern Bool CreateCallbackList(\n    CallbackListPtr * /*pcbl*/,\n    CallbackFuncsPtr /*cbfuncs*/\n);\n\nextern Bool AddCallback(\n    CallbackListPtr * /*pcbl*/,\n    CallbackProcPtr /*callback*/,\n    pointer /*data*/\n);\n\nextern Bool DeleteCallback(\n    CallbackListPtr * /*pcbl*/,\n    CallbackProcPtr /*callback*/,\n    pointer /*data*/\n);\n\nextern void CallCallbacks(\n    CallbackListPtr * /*pcbl*/,\n    pointer /*call_data*/\n);\n\nextern void DeleteCallbackList(\n    CallbackListPtr * /*pcbl*/\n);\n\nextern void InitCallbackManager(\n    void\n);\n\n/*\n *  ServerGrabCallback stuff\n */\n\nextern CallbackListPtr ServerGrabCallback;\n\ntypedef enum {SERVER_GRABBED, SERVER_UNGRABBED,\n              CLIENT_PERVIOUS, CLIENT_IMPERVIOUS } ServerGrabState;\n\ntypedef struct {\n    ClientPtr client;\n    ServerGrabState grabstate;\n} ServerGrabInfoRec;\n\n/*\n *  EventCallback stuff\n */\n\nextern CallbackListPtr EventCallback;\n\ntypedef struct {\n    ClientPtr client;\n    xEventPtr events;\n    int count;\n} EventInfoRec;\n\n/*\n *  DeviceEventCallback stuff\n */\n\nextern CallbackListPtr DeviceEventCallback;\n\ntypedef struct {\n    xEventPtr events;\n    int count;\n} DeviceEventInfoRec;\n\n#endif /* DIX_H */\n"
  },
  {
    "path": "OSXvnc-server/include/Xserver/gc.h",
    "content": "/***********************************************************\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n******************************************************************/\n/* $XConsortium: gc.h /main/16 1996/08/01 19:18:17 dpw $ */\n\n#ifndef GC_H\n#define GC_H\n\n#include \"misc.h\"\t/* for Bool */\n#include \"X11/X.h\"\t/* for GContext, Mask */\n#include \"X11/Xproto.h\"\n#include \"screenint.h\"\t/* for ScreenPtr */\n#include \"pixmap.h\"\t/* for DrawablePtr */\n\n/* clientClipType field in GC */\n#define CT_NONE\t\t\t0\n#define CT_PIXMAP\t\t1\n#define CT_REGION\t\t2\n#define CT_UNSORTED\t\t6\n#define CT_YSORTED\t\t10\n#define CT_YXSORTED\t\t14\n#define CT_YXBANDED\t\t18\n\n#define GCQREASON_VALIDATE\t1\n#define GCQREASON_CHANGE\t2\n#define GCQREASON_COPY_SRC\t3\n#define GCQREASON_COPY_DST\t4\n#define GCQREASON_DESTROY\t5\n\n#define GC_CHANGE_SERIAL_BIT        (((unsigned long)1)<<31)\n#define GC_CALL_VALIDATE_BIT        (1L<<30)\n#define GCExtensionInterest   (1L<<29)\n\n#define DRAWABLE_SERIAL_BITS        (~(GC_CHANGE_SERIAL_BIT))\n\n#define MAX_SERIAL_NUM     (1L<<28)\n\n#define NEXT_SERIAL_NUMBER ((++globalSerialNumber) > MAX_SERIAL_NUM ? \\\n\t    (globalSerialNumber  = 1): globalSerialNumber)\n\ntypedef struct _GCInterest *GCInterestPtr;\ntypedef struct _GC    *GCPtr;\ntypedef struct _GCOps *GCOpsPtr;\n\nextern void ValidateGC(\n    DrawablePtr /*pDraw*/,\n    GCPtr /*pGC*/\n);\n\nextern int ChangeGC(\n    GCPtr/*pGC*/,\n    BITS32 /*mask*/,\n    XID* /*pval*/\n);\n\nextern int DoChangeGC(\n    GCPtr/*pGC*/,\n    BITS32 /*mask*/,\n    XID* /*pval*/,\n    int /*fPointer*/\n);\n\ntypedef union {\n    CARD32 val;\n    pointer ptr;\n} ChangeGCVal, *ChangeGCValPtr;\n\nextern int dixChangeGC(\n    ClientPtr /*client*/,\n    GCPtr /*pGC*/,\n    BITS32 /*mask*/,\n    CARD32 * /*pval*/,\n    ChangeGCValPtr /*pCGCV*/\n);\n\nextern GCPtr CreateGC(\n    DrawablePtr /*pDrawable*/,\n    BITS32 /*mask*/,\n    XID* /*pval*/,\n    int* /*pStatus*/\n);\n\nextern int CopyGC(\n    GCPtr/*pgcSrc*/,\n    GCPtr/*pgcDst*/,\n    BITS32 /*mask*/\n);\n\nextern int FreeGC(\n    pointer /*pGC*/,\n    XID /*gid*/\n);\n\nextern void SetGCMask(\n    GCPtr /*pGC*/,\n    Mask /*selectMask*/,\n    Mask /*newDataMask*/\n);\n\nextern GCPtr CreateScratchGC(\n    ScreenPtr /*pScreen*/,\n    unsigned /*depth*/\n);\n\nextern void FreeGCperDepth(\n    int /*screenNum*/\n);\n\nextern Bool CreateGCperDepth(\n    int /*screenNum*/\n);\n\nextern Bool CreateDefaultStipple(\n    int /*screenNum*/\n);\n\nextern void FreeDefaultStipple(\n    int /*screenNum*/\n);\n\nextern int SetDashes(\n    GCPtr /*pGC*/,\n    unsigned /*offset*/,\n    unsigned /*ndash*/,\n    unsigned char* /*pdash*/\n);\n\nextern int VerifyRectOrder(\n    int /*nrects*/,\n    xRectangle* /*prects*/,\n    int /*ordering*/\n);\n\nextern int SetClipRects(\n    GCPtr /*pGC*/,\n    int /*xOrigin*/,\n    int /*yOrigin*/,\n    int /*nrects*/,\n    xRectangle* /*prects*/,\n    int /*ordering*/\n);\n\nextern GCPtr GetScratchGC(\n    unsigned /*depth*/,\n    ScreenPtr /*pScreen*/\n);\n\nextern void FreeScratchGC(\n    GCPtr /*pGC*/\n);\n\n#endif /* GC_H */\n"
  },
  {
    "path": "OSXvnc-server/include/Xserver/input.h",
    "content": "/* $XConsortium: input.h /main/22 1996/09/25 00:50:39 dpw $ */\n/* $XFree86: xc/programs/Xserver/include/input.h,v 3.4 1996/12/23 07:09:28 dawes Exp $ */\n/************************************************************\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n********************************************************/\n#ifndef INPUT_H\n#define INPUT_H\n\n#include \"misc.h\"\n#include \"screenint.h\"\n#include \"X11/Xmd.h\"\n#include \"X11/Xproto.h\"\n#include \"window.h\"     /* for WindowPtr */\n\n#define DEVICE_INIT\t0\n#define DEVICE_ON\t1\n#define DEVICE_OFF\t2\n#define DEVICE_CLOSE\t3\n\n#define MAP_LENGTH\t256\n#define DOWN_LENGTH\t32\t/* 256/8 => number of bytes to hold 256 bits */\n#define NullGrab ((GrabPtr)NULL)\n#define PointerRootWin ((WindowPtr)PointerRoot)\n#define NoneWin ((WindowPtr)None)\n#define NullDevice ((DevicePtr)NULL)\n\n#ifndef FollowKeyboard\n#define FollowKeyboard \t\t3\n#endif\n#ifndef FollowKeyboardWin\n#define FollowKeyboardWin  ((WindowPtr) FollowKeyboard)\n#endif\n#ifndef RevertToFollowKeyboard\n#define RevertToFollowKeyboard\t3\n#endif\n\ntypedef unsigned long Leds;\ntypedef struct _OtherClients *OtherClientsPtr;\ntypedef struct _InputClients *InputClientsPtr;\ntypedef struct _DeviceIntRec *DeviceIntPtr;\n\ntypedef int (*DeviceProc)(\n#if NeedNestedPrototypes\n    DeviceIntPtr /*device*/,\n    int /*what*/\n#endif\n);\n\ntypedef void (*ProcessInputProc)(\n#if NeedNestedPrototypes\n    xEventPtr /*events*/,\n    DeviceIntPtr /*device*/,\n    int /*count*/\n#endif\n);\n\ntypedef struct _DeviceRec {\n    pointer\tdevicePrivate;\n    ProcessInputProc processInputProc;\t/* current */\n    ProcessInputProc realInputProc;\t/* deliver */\n    ProcessInputProc enqueueInputProc;\t/* enqueue */\n    Bool\ton;\t\t\t/* used by DDX to keep state */\n} DeviceRec, *DevicePtr;\n\ntypedef struct {\n    int\t\t\tclick, bell, bell_pitch, bell_duration;\n    Bool\t\tautoRepeat;\n    unsigned char\tautoRepeats[32];\n    Leds\t\tleds;\n    unsigned char\tid;\n} KeybdCtrl;\n\ntypedef struct {\n    KeySym  *map;\n    KeyCode minKeyCode,\n\t    maxKeyCode;\n    int     mapWidth;\n} KeySymsRec, *KeySymsPtr;\n\ntypedef struct {\n    int\t\tnum, den, threshold;\n    unsigned char id;\n} PtrCtrl;\n\ntypedef struct {\n    int         resolution, min_value, max_value;\n    int         integer_displayed;\n    unsigned char id;\n} IntegerCtrl;\n\ntypedef struct {\n    int         max_symbols, num_symbols_supported;\n    int         num_symbols_displayed;\n    KeySym      *symbols_supported;\n    KeySym      *symbols_displayed;\n    unsigned char id;\n} StringCtrl;\n\ntypedef struct {\n    int         percent, pitch, duration;\n    unsigned char id;\n} BellCtrl;\n\ntypedef struct {\n    Leds        led_values;\n    Mask        led_mask;\n    unsigned char id;\n} LedCtrl;\n\nextern KeybdCtrl\tdefaultKeyboardControl;\nextern PtrCtrl\t\tdefaultPointerControl;\n\n#undef  AddInputDevice\nextern DevicePtr AddInputDevice(\n#if NeedFunctionPrototypes\n    DeviceProc /*deviceProc*/,\n    Bool /*autoStart*/\n#endif\n);\n\n#define AddInputDevice(deviceProc, autoStart) \\\n       _AddInputDevice(deviceProc, autoStart)\n\nextern DeviceIntPtr _AddInputDevice(\n#if NeedFunctionPrototypes\n    DeviceProc /*deviceProc*/,\n    Bool /*autoStart*/\n#endif\n);\n\nextern Bool EnableDevice(\n#if NeedFunctionPrototypes\n    DeviceIntPtr /*device*/\n#endif\n);\n\nextern Bool DisableDevice(\n#if NeedFunctionPrototypes\n    DeviceIntPtr /*device*/\n#endif\n);\n\nextern int InitAndStartDevices(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern void CloseDownDevices(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern void RemoveDevice(\n#if NeedFunctionPrototypes\n    DeviceIntPtr /*dev*/\n#endif\n);\n\nextern int NumMotionEvents(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\n#undef  RegisterPointerDevice\nextern void RegisterPointerDevice(\n#if NeedFunctionPrototypes\n    DevicePtr /*device*/\n#endif\n);\n\n#define RegisterPointerDevice(device) \\\n       _RegisterPointerDevice(device)\n\nextern void _RegisterPointerDevice(\n#if NeedFunctionPrototypes\n    DeviceIntPtr /*device*/\n#endif\n);\n\n#undef  RegisterKeyboardDevice\nextern void RegisterKeyboardDevice(\n#if NeedFunctionPrototypes\n    DevicePtr /*device*/\n#endif\n);\n\n#define RegisterKeyboardDevice(device) \\\n       _RegisterKeyboardDevice(device)\n\nextern void _RegisterKeyboardDevice(\n#if NeedFunctionPrototypes\n    DeviceIntPtr /*device*/\n#endif\n);\n\nextern DevicePtr LookupKeyboardDevice(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern DevicePtr LookupPointerDevice(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern DevicePtr LookupDevice(\n#if NeedFunctionPrototypes\n    int /* id */\n#endif\n);\n\nextern void QueryMinMaxKeyCodes(\n#if NeedFunctionPrototypes\n    KeyCode* /*minCode*/,\n    KeyCode* /*maxCode*/\n#endif\n);\n\nextern Bool SetKeySymsMap(\n#if NeedFunctionPrototypes\n    KeySymsPtr /*dst*/,\n    KeySymsPtr /*src*/\n#endif\n);\n\nextern Bool InitKeyClassDeviceStruct(\n#if NeedFunctionPrototypes\n    DeviceIntPtr /*device*/,\n    KeySymsPtr /*pKeySyms*/,\n    CARD8 /*pModifiers*/[]\n#endif\n);\n\nextern Bool InitButtonClassDeviceStruct(\n#if NeedFunctionPrototypes\n    DeviceIntPtr /*device*/,\n    int /*numButtons*/,\n    CARD8* /*map*/\n#endif\n);\n\ntypedef int (*ValuatorMotionProcPtr)(\n#if NeedNestedPrototypes\n\t\tDeviceIntPtr /*pdevice*/,\n\t\txTimecoord * /*coords*/,\n\t\tunsigned long /*start*/,\n\t\tunsigned long /*stop*/,\n\t\tScreenPtr /*pScreen*/\n#endif\n);\n\nextern Bool InitValuatorClassDeviceStruct(\n#if NeedFunctionPrototypes\n    DeviceIntPtr /*device*/,\n    int /*numAxes*/,\n    ValuatorMotionProcPtr /* motionProc */,\n    int /*numMotionEvents*/,\n    int /*mode*/\n#endif\n);\n\nextern Bool InitFocusClassDeviceStruct(\n#if NeedFunctionPrototypes\n    DeviceIntPtr /*device*/\n#endif\n);\n\ntypedef void (*BellProcPtr)(\n#if NeedNestedPrototypes\n    int /*percent*/,\n    DeviceIntPtr /*device*/,\n    pointer /*ctrl*/,\n    int\n#endif\n);\n\ntypedef void (*KbdCtrlProcPtr)(\n#if NeedNestedPrototypes\n    DeviceIntPtr /*device*/,\n    KeybdCtrl * /*ctrl*/\n#endif\n);\n\nextern Bool InitKbdFeedbackClassDeviceStruct(\n#if NeedFunctionPrototypes\n    DeviceIntPtr /*device*/,\n    BellProcPtr /*bellProc*/,\n    KbdCtrlProcPtr /*controlProc*/\n#endif\n);\n\ntypedef void (*PtrCtrlProcPtr)(\n#if NeedNestedPrototypes\n    DeviceIntPtr /*device*/,\n    PtrCtrl * /*ctrl*/\n#endif\n);\n\nextern Bool InitPtrFeedbackClassDeviceStruct(\n#if NeedFunctionPrototypes\n    DeviceIntPtr /*device*/,\n    PtrCtrlProcPtr /*controlProc*/\n#endif\n);\n\ntypedef void (*StringCtrlProcPtr)(\n#if NeedNestedPrototypes\n    DeviceIntPtr /*device*/,\n    StringCtrl * /*ctrl*/\n#endif\n);\n\nextern Bool InitStringFeedbackClassDeviceStruct(\n#if NeedFunctionPrototypes\n    DeviceIntPtr /*device*/,\n    StringCtrlProcPtr /*controlProc*/,\n    int /*max_symbols*/,\n    int /*num_symbols_supported*/,\n    KeySym* /*symbols*/\n#endif\n);\n\ntypedef void (*BellCtrlProcPtr)(\n#if NeedNestedPrototypes\n    DeviceIntPtr /*device*/,\n    BellCtrl * /*ctrl*/\n#endif\n);\n\nextern Bool InitBellFeedbackClassDeviceStruct(\n#if NeedFunctionPrototypes\n    DeviceIntPtr /*device*/,\n    BellProcPtr /*bellProc*/,\n    BellCtrlProcPtr /*controlProc*/\n#endif\n);\n\ntypedef void (*LedCtrlProcPtr)(\n#if NeedNestedPrototypes\n    DeviceIntPtr /*device*/,\n    LedCtrl * /*ctrl*/\n#endif\n);\n\nextern Bool InitLedFeedbackClassDeviceStruct(\n#if NeedFunctionPrototypes\n    DeviceIntPtr /*device*/,\n    LedCtrlProcPtr /*controlProc*/\n#endif\n);\n\ntypedef void (*IntegerCtrlProcPtr)(\n#if NeedNestedPrototypes\n    DeviceIntPtr /*device*/,\n    IntegerCtrl * /*ctrl*/\n#endif\n);\n\n\nextern Bool InitIntegerFeedbackClassDeviceStruct(\n#if NeedFunctionPrototypes\n    DeviceIntPtr /*device*/,\n    IntegerCtrlProcPtr /*controlProc*/\n#endif\n);\n\nextern Bool InitPointerDeviceStruct(\n#if NeedFunctionPrototypes\n    DevicePtr /*device*/,\n    CARD8* /*map*/,\n    int /*numButtons*/,\n    ValuatorMotionProcPtr /*motionProc*/,\n    PtrCtrlProcPtr /*controlProc*/,\n    int /*numMotionEvents*/\n#endif\n);\n\nextern Bool InitKeyboardDeviceStruct(\n#if NeedFunctionPrototypes\n    DevicePtr /*device*/,\n    KeySymsPtr /*pKeySyms*/,\n    CARD8 /*pModifiers*/[],\n    BellProcPtr /*bellProc*/,\n    KbdCtrlProcPtr /*controlProc*/\n#endif\n);\n\nextern void SendMappingNotify(\n#if NeedFunctionPrototypes\n    unsigned int /*request*/,\n    unsigned int /*firstKeyCode*/,\n    unsigned int /*count*/,\n    ClientPtr\t/* client */\n#endif\n);\n\nextern Bool BadDeviceMap(\n#if NeedFunctionPrototypes\n    BYTE* /*buff*/,\n    int /*length*/,\n    unsigned /*low*/,\n    unsigned /*high*/,\n    XID* /*errval*/\n#endif\n);\n\nextern Bool AllModifierKeysAreUp(\n#if NeedFunctionPrototypes\n    DeviceIntPtr /*device*/,\n    CARD8* /*map1*/,\n    int /*per1*/,\n    CARD8* /*map2*/,\n    int /*per2*/\n#endif\n);\n\nextern void NoteLedState(\n#if NeedFunctionPrototypes\n    DeviceIntPtr /*keybd*/,\n    int /*led*/,\n    Bool /*on*/\n#endif\n);\n\nextern void MaybeStopHint(\n#if NeedFunctionPrototypes\n    DeviceIntPtr /*device*/,\n    ClientPtr /*client*/\n#endif\n);\n\nextern void ProcessPointerEvent(\n#if NeedFunctionPrototypes\n    xEventPtr /*xE*/,\n    DeviceIntPtr /*mouse*/,\n    int /*count*/\n#endif\n);\n\nextern void ProcessKeyboardEvent(\n#if NeedFunctionPrototypes\n    xEventPtr /*xE*/,\n    DeviceIntPtr /*keybd*/,\n    int /*count*/\n#endif\n);\n\n#ifdef XKB\nextern void CoreProcessPointerEvent(\n#if NeedFunctionPrototypes\n    xEventPtr /*xE*/,\n    DeviceIntPtr /*mouse*/,\n    int /*count*/\n#endif\n);\n\nextern void CoreProcessKeyboardEvent(\n#if NeedFunctionPrototypes\n    xEventPtr /*xE*/,\n    DeviceIntPtr /*keybd*/,\n    int /*count*/\n#endif\n);\n#endif\n\nextern Bool LegalModifier(\n#if NeedFunctionPrototypes\n    unsigned int /*key*/,\n    DevicePtr /*pDev*/\n#endif\n);\n\nextern void ProcessInputEvents(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern void InitInput(\n#if NeedFunctionPrototypes\n    int  /*argc*/,\n    char ** /*argv*/\n#endif\n);\n\n#endif /* INPUT_H */\n"
  },
  {
    "path": "OSXvnc-server/include/Xserver/misc.h",
    "content": "/***********************************************************\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\nCopyright 1992, 1993 Data General Corporation;\nCopyright 1992, 1993 OMRON Corporation\n\nPermission to use, copy, modify, distribute, and sell this software and its\ndocumentation for any purpose is hereby granted without fee, provided that the\nabove copyright notice appear in all copies and that both that copyright\nnotice and this permission notice appear in supporting documentation, and that\nneither the name OMRON or DATA GENERAL be used in advertising or publicity\npertaining to distribution of the software without specific, written prior\npermission of the party whose name is to be used.  Neither OMRON or\nDATA GENERAL make any representation about the suitability of this software\nfor any purpose.  It is provided \"as is\" without express or implied warranty.\n\nOMRON AND DATA GENERAL EACH DISCLAIM ALL WARRANTIES WITH REGARD TO THIS\nSOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,\nIN NO EVENT SHALL OMRON OR DATA GENERAL BE LIABLE FOR ANY SPECIAL, INDIRECT\nOR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,\nDATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\nTORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE\nOF THIS SOFTWARE.\n\n******************************************************************/\n/* $XConsortium: misc.h /main/28 1996/12/02 10:22:01 lehors $ */\n/* $XFree86: xc/programs/Xserver/include/misc.h,v 3.5 1996/12/23 07:09:29 dawes Exp $ */\n#ifndef MISC_H\n#define MISC_H 1\n/*\n *  X internal definitions\n *\n */\n\nextern unsigned long globalSerialNumber;\nextern unsigned long serverGeneration;\n\n#include <X11/Xosdefs.h>\n#include <X11/Xfuncproto.h>\n#include <X11/Xmd.h>\n#include <X11/X.h>\n\n#ifndef MAXSCREENS\n#define MAXSCREENS\t3\n#endif\n#define MAXCLIENTS\t128\n#define MAXDITS\t\t1\n#define MAXEXTENSIONS\t128\n#define MAXFORMATS\t8\n#define MAXVISUALS_PER_SCREEN 50\n\ntypedef void *pointer;\ntypedef int Bool;\ntypedef unsigned long PIXEL;\ntypedef unsigned long ATOM;\n\n#ifndef TRUE\n#define TRUE 1\n#define FALSE 0\n#endif\n\n#ifndef _XTYPEDEF_FONTPTR\ntypedef struct _Font *FontPtr; /* also in fonts/include/font.h */\n#define _XTYPEDEF_FONTPTR\n#endif\n\n#ifndef _XTYPEDEF_CLIENTPTR\ntypedef struct _Client *ClientPtr; /* also in dix.h */\n#define _XTYPEDEF_CLIENTPTR\n#endif\n\n#ifndef _XTYPEDEF_CALLBACKLISTPTR\ntypedef struct _CallbackList *CallbackListPtr; /* also in dix.h */\n#define _XTYPEDEF_CALLBACKLISTPTR\n#endif\n\ntypedef struct _xReq *xReqPtr;\n\n#include \"os.h\" \t/* for ALLOCATE_LOCAL and DEALLOCATE_LOCAL */\n#include <X11/Xfuncs.h> /* for bcopy, bzero, and bcmp */\n\n#define NullBox ((BoxPtr)0)\n#define MILLI_PER_MIN (1000 * 60)\n#define MILLI_PER_SECOND (1000)\n\n    /* this next is used with None and ParentRelative to tell\n       PaintWin() what to use to paint the background. Also used\n       in the macro IS_VALID_PIXMAP */\n\n#define USE_BACKGROUND_PIXEL 3\n#define USE_BORDER_PIXEL 3\n\n\n/* byte swap a 32-bit literal */\n#define lswapl(x) ((((x) & 0xff) << 24) |\\\n\t\t   (((x) & 0xff00) << 8) |\\\n\t\t   (((x) & 0xff0000) >> 8) |\\\n\t\t   (((x) >> 24) & 0xff))\n\n/* byte swap a short literal */\n#define lswaps(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff))\n\n#define min(a, b) (((a) < (b)) ? (a) : (b))\n#define max(a, b) (((a) > (b)) ? (a) : (b))\n/* abs() is a function, not a macro; include the file declaring\n * it in case we haven't done that yet.\n */\n#include <stdlib.h>\n\n#define sign(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0))\n/* this assumes b > 0 */\n#define modulus(a, b, d)    if (((d) = (a) % (b)) < 0) (d) += (b)\n/*\n * return the least significant bit in x which is set\n *\n * This works on 1's complement and 2's complement machines.\n * If you care about the extra instruction on 2's complement\n * machines, change to ((x) & (-(x)))\n */\n#define lowbit(x) ((x) & (~(x) + 1))\n\n#ifndef MAXSHORT\n#define MAXSHORT 32767\n#endif\n#ifndef MINSHORT\n#define MINSHORT -MAXSHORT\n#endif\n\n\n/* some macros to help swap requests, replies, and events */\n\n#define LengthRestB(stuff) \\\n    ((client->req_len << 2) - sizeof(*stuff))\n\n#define LengthRestS(stuff) \\\n    ((client->req_len << 1) - (sizeof(*stuff) >> 1))\n\n#define LengthRestL(stuff) \\\n    (client->req_len - (sizeof(*stuff) >> 2))\n\n#define SwapRestS(stuff) \\\n    SwapShorts((short *)(stuff + 1), LengthRestS(stuff))\n\n#define SwapRestL(stuff) \\\n    SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff))\n\n/* byte swap a 32-bit value */\n#define swapl(x, n) { \\\n\t\t n = ((char *) (x))[0];\\\n\t\t ((char *) (x))[0] = ((char *) (x))[3];\\\n\t\t ((char *) (x))[3] = n;\\\n\t\t n = ((char *) (x))[1];\\\n\t\t ((char *) (x))[1] = ((char *) (x))[2];\\\n\t\t ((char *) (x))[2] = n; }\n\n/* byte swap a short */\n#define swaps(x, n) { \\\n\t\t n = ((char *) (x))[0];\\\n\t\t ((char *) (x))[0] = ((char *) (x))[1];\\\n\t\t ((char *) (x))[1] = n; }\n\n/* copy 32-bit value from src to dst byteswapping on the way */\n#define cpswapl(src, dst) { \\\n                 ((char *)&(dst))[0] = ((char *) &(src))[3];\\\n                 ((char *)&(dst))[1] = ((char *) &(src))[2];\\\n                 ((char *)&(dst))[2] = ((char *) &(src))[1];\\\n                 ((char *)&(dst))[3] = ((char *) &(src))[0]; }\n\n/* copy short from src to dst byteswapping on the way */\n#define cpswaps(src, dst) { \\\n\t\t ((char *) &(dst))[0] = ((char *) &(src))[1];\\\n\t\t ((char *) &(dst))[1] = ((char *) &(src))[0]; }\n\nextern void SwapLongs(\n    CARD32 *list,\n    unsigned long count\n);\n\nextern void SwapShorts(\n    short *list,\n    unsigned long count\n);\n\nextern void MakePredeclaredAtoms(\n    void\n);\n\nextern int Ones(\n    unsigned long /*mask*/\n);\n\ntypedef struct _xPoint *DDXPointPtr;\ntypedef struct _Box *BoxPtr;\ntypedef struct _xEvent *xEventPtr;\ntypedef struct _xRectangle *xRectanglePtr;\ntypedef struct _GrabRec *GrabPtr;\n\n/*  typedefs from other places - duplicated here to minimize the amount\n *  of unnecessary junk that one would normally have to include to get\n *  these symbols defined\n */\n\n#ifndef _XTYPEDEF_CHARINFOPTR\ntypedef struct _CharInfo *CharInfoPtr; /* also in fonts/include/font.h */\n#define _XTYPEDEF_CHARINFOPTR\n#endif\n\n#endif /* MISC_H */\n"
  },
  {
    "path": "OSXvnc-server/include/Xserver/miscstruct.h",
    "content": "/* $XConsortium: miscstruct.h,v 5.5 94/04/17 20:25:50 dpw Exp $ */\n/* $XFree86: xc/programs/Xserver/include/miscstruct.h,v 3.0 1996/02/18 03:45:10 dawes Exp $ */\n/***********************************************************\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n******************************************************************/\n#ifndef MISCSTRUCT_H\n#define MISCSTRUCT_H 1\n\n#include \"misc.h\"\n#include \"X11/Xprotostr.h\"\n\ntypedef xPoint DDXPointRec;\n\ntypedef struct _Box {\n    short x1, y1, x2, y2;\n} BoxRec;\n\ntypedef union _DevUnion {\n    pointer\t\tptr;\n    long\t\tval;\n    unsigned long\tuval;\n    pointer\t\t(*fptr)(\n                        void\n                        );\n} DevUnion;\n\n#endif /* MISCSTRUCT_H */\n"
  },
  {
    "path": "OSXvnc-server/include/Xserver/opaque.h",
    "content": "/* $XConsortium: opaque.h,v 1.19 94/04/17 20:25:51 dpw Exp $ */\n/*\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR\nOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall\nnot be used in advertising or otherwise to promote the sale, use or\nother dealings in this Software without prior written authorization\nfrom the X Consortium.\n\n*/\n/* $XFree86: xc/programs/Xserver/include/opaque.h,v 1.2.2.1 1997/06/01 12:33:43 dawes Exp $ */\n\n#ifndef OPAQUE_H\n#define OPAQUE_H\n\n#include <X11/Xmd.h>\n\nextern char *defaultFontPath;\nextern char *defaultTextFont;\nextern char *defaultCursorFont;\nextern char *rgbPath;\nextern int MaxClients;\nextern char isItTimeToYield;\nextern char dispatchException;\n\n/* bit values for dispatchException */\n#define DE_RESET     1\n#define DE_TERMINATE 2\n#define DE_PRIORITYCHANGE 4  /* set when a client's priority changes */\n\nextern CARD32 TimeOutValue;\nextern CARD32 ScreenSaverTime;\nextern CARD32 ScreenSaverInterval;\nextern int  ScreenSaverBlanking;\nextern int  ScreenSaverAllowExposures;\nextern int argcGlobal;\nextern char **argvGlobal;\n\n#if DPMSExtension\nextern CARD32 defaultDPMSStandbyTime;\nextern CARD32 defaultDPMSSuspendTime;\nextern CARD32 defaultDPMSOffTime;\nextern CARD32 DPMSStandbyTime;\nextern CARD32 DPMSSuspendTime;\nextern CARD32 DPMSOffTime;\nextern CARD16 DPMSPowerLevel;\nextern Bool defaultDPMSEnabled;\nextern Bool DPMSEnabled;\nextern Bool DPMSEnabledSwitch;\nextern Bool DPMSDisabledSwitch;\nextern Bool DPMSCapableFlag;\n#endif\n\n#endif /* OPAQUE_H */\n"
  },
  {
    "path": "OSXvnc-server/include/Xserver/os.h",
    "content": "/***********************************************************\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n******************************************************************/\n\n/* $XConsortium: os.h /main/60 1996/12/15 21:25:13 rws $ */\n/* $XFree86: xc/programs/Xserver/include/os.h,v 3.16.2.1 1998/01/22 10:47:13 dawes Exp $ */\n\n#ifndef OS_H\n#define OS_H\n#include \"misc.h\"\n#define ALLOCATE_LOCAL_FALLBACK(_size) Xalloc((unsigned long)(_size))\n#define DEALLOCATE_LOCAL_FALLBACK(_ptr) Xfree((pointer)(_ptr))\n#include \"Xalloca.h\"\n\n#define NullFID ((FID) 0)\n\n#define SCREEN_SAVER_ON   0\n#define SCREEN_SAVER_OFF  1\n#define SCREEN_SAVER_FORCER 2\n#define SCREEN_SAVER_CYCLE  3\n\n#ifndef MAX_REQUEST_SIZE\n#define MAX_REQUEST_SIZE 65535\n#endif\n#ifndef MAX_BIG_REQUEST_SIZE\n#define MAX_BIG_REQUEST_SIZE 1048575\n#endif\n\ntypedef pointer\tFID;\ntypedef struct _FontPathRec *FontPathPtr;\ntypedef struct _NewClientRec *NewClientPtr;\n\n#define xnfalloc(size) XNFalloc((unsigned long)(size))\n#define xnfrealloc(ptr, size) XNFrealloc((pointer)(ptr), (unsigned long)(size))\n\n#define xalloc(size) Xalloc((unsigned long)(size))\n#define xnfalloc(size) XNFalloc((unsigned long)(size))\n#define xcalloc(_num, _size) Xcalloc((unsigned long)(_num)*(unsigned long)(_size))\n#define xrealloc(ptr, size) Xrealloc((pointer)(ptr), (unsigned long)(size))\n#define xnfrealloc(ptr, size) XNFrealloc((pointer)(ptr), (unsigned long)(size))\n#define xfree(ptr) Xfree((pointer)(ptr))\n\n#ifdef SCO\n#include <stdio.h>\n#endif\n#ifndef X_NOT_STDC_ENV\n#include <string.h>\n#else\n#ifdef SYSV\n#include <string.h>\n#else\n#include <strings.h>\n#endif\n#endif\n\n/* have to put $(SIGNAL_DEFINES) in DEFINES in Imakefile to get this right */\n#ifdef SIGNALRETURNSINT\n#define SIGVAL int\n#else\n#define SIGVAL void\n#endif\n\nextern Bool OsDelayInitColors;\n\nextern int WaitForSomething(\n    int* /*pClientsReady*/\n);\n\n#ifdef LBX\n#define ReadRequestFromClient(client)   ((client)->readRequest(client))\nextern int StandardReadRequestFromClient(\n#if NeedFunctionPrototypes\n    ClientPtr /*client*/\n#endif\n);\n#else\nextern int ReadRequestFromClient(\n    ClientPtr /*client*/\n);\n#endif /* LBX */\n\nextern Bool InsertFakeRequest(\n    ClientPtr /*client*/,\n    char* /*data*/,\n    int /*count*/\n);\n\nextern int ResetCurrentRequest(\n    ClientPtr /*client*/\n);\n\nextern void FlushAllOutput(\n    void\n);\n\nextern void FlushIfCriticalOutputPending(\n    void\n);\n\nextern void SetCriticalOutputPending(\n    void\n);\n\nextern int WriteToClient(\n    ClientPtr /*who*/,\n    int /*count*/,\n    char* /*buf*/\n);\n\nextern void ResetOsBuffers(\n    void\n);\n\nextern void CreateWellKnownSockets(\n    void\n);\n\nextern void ResetWellKnownSockets(\n    void\n);\n\nextern XID\nAuthorizationIDOfClient(\n    ClientPtr /*client*/\n);\n\nextern char *ClientAuthorized(\n    ClientPtr /*client*/,\n    unsigned int /*proto_n*/,\n    char* /*auth_proto*/,\n    unsigned int /*string_n*/,\n    char* /*auth_string*/\n);\n\nextern Bool EstablishNewConnections(\n    ClientPtr /*clientUnused*/,\n    pointer /*closure*/\n);\n\nextern void CheckConnections(\n    void\n);\n\nextern void CloseDownConnection(\n    ClientPtr /*client*/\n);\n\nextern int AddEnabledDevice(\n    int /*fd*/\n);\n\nextern int RemoveEnabledDevice(\n    int /*fd*/\n);\n\nextern int OnlyListenToOneClient(\n    ClientPtr /*client*/\n);\n\nextern int ListenToAllClients(\n    void\n);\n\nextern int IgnoreClient(\n    ClientPtr /*client*/\n);\n\nextern int AttendClient(\n    ClientPtr /*client*/\n);\n\nextern int MakeClientGrabImpervious(\n    ClientPtr /*client*/\n);\n\nextern int MakeClientGrabPervious(\n    ClientPtr /*client*/\n);\n\nextern void Error(\n    char* /*str*/\n);\n\nextern CARD32 GetTimeInMillis(\n    void\n);\n\nextern int AdjustWaitForDelay(\n    pointer /*waitTime*/,\n    unsigned long /*newdelay*/\n);\n\ntypedef\tstruct _OsTimerRec *OsTimerPtr;\n\ntypedef CARD32 (*OsTimerCallback)(\n    OsTimerPtr /* timer */,\n    CARD32 /* time */,\n    pointer /* arg */\n);\n\nextern void TimerInit(\n    void\n);\n\nextern Bool TimerForce(\n    OsTimerPtr /* timer */\n);\n\n#define TimerAbsolute (1<<0)\n#define TimerForceOld (1<<1)\n\nextern OsTimerPtr TimerSet(\n    OsTimerPtr /* timer */,\n    int /* flags */,\n    CARD32 /* millis */,\n    OsTimerCallback /* func */,\n    pointer /* arg */\n);\n\nextern void TimerCheck(\n    void\n);\n\nextern void TimerCancel(\n    OsTimerPtr /* pTimer */\n);\n\nextern void TimerFree(\n    OsTimerPtr /* pTimer */\n);\n\nextern SIGVAL AutoResetServer(\n    int /*sig*/\n);\n\nextern SIGVAL GiveUp(\n    int /*sig*/\n);\n\nextern void UseMsg(\n    void\n);\n\nextern void ProcessCommandLine(\n    int /*argc*/,\n    char* /*argv*/[]\n);\n\nextern unsigned long *Xalloc(\n    unsigned long /*amount*/\n);\n\nextern unsigned long *XNFalloc(\n    unsigned long /*amount*/\n);\n\nextern unsigned long *Xcalloc(\n    unsigned long /*amount*/\n);\n\nextern unsigned long *Xrealloc(\n    pointer /*ptr*/,\n    unsigned long /*amount*/\n);\n\nextern unsigned long *XNFrealloc(\n    pointer /*ptr*/,\n    unsigned long /*amount*/\n);\n\nextern void Xfree(\n    pointer /*ptr*/\n);\n\nextern void OsInitAllocator(\n    void\n);\n\ntypedef SIGVAL (*OsSigHandlerPtr)(\n    int /* sig */\n);\n\nextern OsSigHandlerPtr OsSignal(\n    int /* sig */,\n    OsSigHandlerPtr /* handler */\n);\n\nextern int auditTrailLevel;\n\nextern void AuditF(\n    char* /*f*/,\n    ...\n);\n\nextern void FatalError(\n#if NeedVarargsPrototypes\n    char* /*f*/,\n    ...\n#endif\n)\n#if __GNUC__ == 2 && __GNUC_MINOR__ > 4\n__attribute((noreturn))\n#endif\n;\n\nextern void ErrorF(\n#if NeedVarargsPrototypes\n    char* /*f*/,\n    ...\n#endif\n);\n\n#ifdef SERVER_LOCK\nextern void LockServer(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern void UnlockServer(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n#endif\n\nextern int OsLookupColor(\n#if NeedFunctionPrototypes\n    int\t/*screen*/,\n    char * /*name*/,\n    unsigned /*len*/,\n    unsigned short * /*pred*/,\n    unsigned short * /*pgreen*/,\n    unsigned short * /*pblue*/\n#endif\n);\n\nextern void OsInit(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern void OsCleanup(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern void OsVendorFatalError(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern void OsVendorInit(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern int OsInitColors(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\n#if !defined(WIN32) && !defined(__EMX__)\nextern int System(\n#if NeedFunctionPrototypes\n    char *\n#endif\n);\n\nextern pointer Popen(\n#if NeedFunctionPrototypes\n    char *,\n    char *\n#endif\n);\n\nextern int Pclose(\n#if NeedFunctionPrototypes\n    pointer\n#endif\n);\n#else\n#define System(a) system(a)\n#define Popen(a,b) popen(a,b)\n#define Pclose(a) pclose(a)\n#endif\n\nextern int AddHost(\n#if NeedFunctionPrototypes\n    ClientPtr\t/*client*/,\n    int         /*family*/,\n    unsigned    /*length*/,\n    pointer     /*pAddr*/\n#endif\n);\n\nextern Bool ForEachHostInFamily (\n#if NeedFunctionPrototypes\n    int\t    /*family*/,\n    Bool    (* /*func*/ )(\n#if NeedNestedPrototypes\n            unsigned char * /* addr */,\n            short           /* len */,\n            pointer         /* closure */\n#endif\n            ),\n    pointer /*closure*/\n#endif\n);\n\nextern int RemoveHost(\n#if NeedFunctionPrototypes\n    ClientPtr\t/*client*/,\n    int         /*family*/,\n    unsigned    /*length*/,\n    pointer     /*pAddr*/\n#endif\n);\n\nextern int GetHosts(\n#if NeedFunctionPrototypes\n    pointer * /*data*/,\n    int\t    * /*pnHosts*/,\n    int\t    * /*pLen*/,\n    BOOL    * /*pEnabled*/\n#endif\n);\n\ntypedef struct sockaddr * sockaddrPtr;\n\nextern int InvalidHost(\n#if NeedFunctionPrototypes\n    sockaddrPtr /*saddr*/,\n    int\t\t/*len*/\n#endif\n);\n\nextern int LocalClient(\n#if NeedFunctionPrototypes\n    ClientPtr /* client */\n#endif\n);\n\nextern int ChangeAccessControl(\n#if NeedFunctionPrototypes\n    ClientPtr /*client*/,\n    int /*fEnabled*/\n#endif\n);\n\nextern int GetAccessControl(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\n\nextern void AddLocalHosts(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern void ResetHosts(\n#if NeedFunctionPrototypes\n    char *display\n#endif\n);\n\nextern void EnableLocalHost(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern void DisableLocalHost(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern void AccessUsingXdmcp(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern void DefineSelf(\n#if NeedFunctionPrototypes\n    int /*fd*/\n#endif\n);\n\nextern void AugmentSelf(\n#if NeedFunctionPrototypes\n    pointer /*from*/,\n    int /*len*/\n#endif\n);\n\nextern void InitAuthorization(\n#if NeedFunctionPrototypes\n    char * /*filename*/\n#endif\n);\n\nextern int LoadAuthorization(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern void RegisterAuthorizations(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern XID CheckAuthorization(\n#if NeedFunctionPrototypes\n    unsigned int /*namelength*/,\n    char * /*name*/,\n    unsigned int /*datalength*/,\n    char * /*data*/,\n    ClientPtr /*client*/,\n    char ** /*reason*/\n#endif\n);\n\nextern void ResetAuthorization(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern int AddAuthorization(\n#if NeedFunctionPrototypes\n    unsigned int /*name_length*/,\n    char * /*name*/,\n    unsigned int /*data_length*/,\n    char * /*data*/\n#endif\n);\n\nextern XID GenerateAuthorization(\n#if NeedFunctionPrototypes\n    unsigned int   /* name_length */,\n    char\t*  /* name */,\n    unsigned int   /* data_length */,\n    char\t*  /* data */,\n    unsigned int * /* data_length_return */,\n    char\t** /* data_return */\n#endif\n);\n\nextern void ExpandCommandLine(\n#if NeedFunctionPrototypes\n    int * /*pargc*/,\n    char *** /*pargv*/\n#endif\n);\n\nextern int ddxProcessArgument(\n#if NeedFunctionPrototypes\n    int /*argc*/,\n    char * /*argv*/ [],\n    int /*i*/\n#endif\n);\n\n/*\n *  idiom processing stuff\n */\n\nxReqPtr PeekNextRequest(\n#if NeedFunctionPrototypes\n    xReqPtr req, ClientPtr client, Bool readmore\n#endif\n);\n\nvoid SkipRequests(\n#if NeedFunctionPrototypes\n    xReqPtr req, ClientPtr client, int numskipped\n#endif\n);\n\n/* int ReqLen(xReq *req, ClientPtr client)\n * Given a pointer to a *complete* request, return its length in bytes.\n * Note that if the request is a big request (as defined in the Big\n * Requests extension), the macro lies by returning 4 less than the\n * length that it actually occupies in the request buffer.  This is so you\n * can blindly compare the length with the various sz_<request> constants\n * in Xproto.h without having to know/care about big requests.\n */\n#define ReqLen(_pxReq, _client) \\\n ((_pxReq->length ? \\\n     (_client->swapped ? lswaps(_pxReq->length) : _pxReq->length) \\\n  : ((_client->swapped ? \\\n\tlswapl(((CARD32*)_pxReq)[1]) : ((CARD32*)_pxReq)[1])-1) \\\n  ) << 2)\n\n/* otherReqTypePtr CastxReq(xReq *req, otherReqTypePtr)\n * Cast the given request to one of type otherReqTypePtr to access\n * fields beyond the length field.\n */\n#define CastxReq(_pxReq, otherReqTypePtr) \\\n    (_pxReq->length ? (otherReqTypePtr)_pxReq \\\n\t\t    : (otherReqTypePtr)(((CARD32*)_pxReq)+1))\n\n/* stuff for SkippedRequestsCallback */\nextern CallbackListPtr SkippedRequestsCallback;\ntypedef struct {\n    xReqPtr req;\n    ClientPtr client;\n    int numskipped;\n} SkippedRequestInfoRec;\n\n/* stuff for ReplyCallback */\nextern CallbackListPtr ReplyCallback;\ntypedef struct {\n    ClientPtr client;\n    pointer replyData;\n    unsigned long dataLenBytes;\n    unsigned long bytesRemaining;\n    Bool startOfReply;\n} ReplyInfoRec;\n\n/* stuff for FlushCallback */\nextern CallbackListPtr FlushCallback;\n\n#endif /* OS_H */\n"
  },
  {
    "path": "OSXvnc-server/include/Xserver/pixmap.h",
    "content": "/* $XConsortium: pixmap.h,v 5.6 94/04/17 20:25:53 dpw Exp $ */\n/***********************************************************\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n******************************************************************/\n#ifndef PIXMAP_H\n#define PIXMAP_H\n\n#include \"misc.h\"\n#include \"screenint.h\"\n\n/* types for Drawable */\n#define DRAWABLE_WINDOW 0\n#define DRAWABLE_PIXMAP 1\n#define UNDRAWABLE_WINDOW 2\n#define DRAWABLE_BUFFER 3\n\n/* flags to PaintWindow() */\n#define PW_BACKGROUND 0\n#define PW_BORDER 1\n\n#define NullPixmap ((PixmapPtr)0)\n\ntypedef struct _Drawable *DrawablePtr;\ntypedef struct _Pixmap *PixmapPtr;\n\ntypedef union _PixUnion {\n    PixmapPtr\t\tpixmap;\n    unsigned long\tpixel;\n} PixUnion;\n\n#define SamePixUnion(a,b,isPixel)\\\n    ((isPixel) ? (a).pixel == (b).pixel : (a).pixmap == (b).pixmap)\n\n#define EqualPixUnion(as, a, bs, b)\t\t\t\t\\\n    ((as) == (bs) && (SamePixUnion (a, b, as)))\n\n#define OnScreenDrawable(type) \\\n\t((type == DRAWABLE_WINDOW) || (type == DRAWABLE_BUFFER))\n\n#define WindowDrawable(type) \\\n\t((type == DRAWABLE_WINDOW) || (type == UNDRAWABLE_WINDOW))\n\nextern PixmapPtr GetScratchPixmapHeader(\n#if NeedFunctionPrototypes\n    ScreenPtr /*pScreen*/,\n    int /*width*/,\n    int /*height*/,\n    int /*depth*/,\n    int /*bitsPerPixel*/,\n    int /*devKind*/,\n    pointer /*pPixData*/\n#endif\n);\n\nextern void FreeScratchPixmapHeader(\n#if NeedFunctionPrototypes\n    PixmapPtr /*pPixmap*/\n#endif\n);\n\nextern Bool CreateScratchPixmapsForScreen(\n#if NeedFunctionPrototypes\n    int /*scrnum*/\n#endif\n);\n\nextern void FreeScratchPixmapsForScreen(\n#if NeedFunctionPrototypes\n    int /*scrnum*/\n#endif\n);\n\nextern PixmapPtr AllocatePixmap(\n#if NeedFunctionPrototypes\n    ScreenPtr /*pScreen*/,\n    int /*pixDataSize*/\n#endif\n);\n\n#endif /* PIXMAP_H */\n"
  },
  {
    "path": "OSXvnc-server/include/Xserver/region.h",
    "content": "/* $XConsortium: region.h,v 1.5 94/04/17 20:25:59 dpw Exp $ */\n/***********************************************************\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n******************************************************************/\n#ifndef REGION_H\n#define REGION_H\n\n#include \"regionstr.h\"\n\n#endif /* REGION_H */\n"
  },
  {
    "path": "OSXvnc-server/include/Xserver/regionstr.h",
    "content": "/* $XConsortium: regionstr.h,v 1.8 94/04/17 20:26:01 dpw Exp $ */\n/***********************************************************\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n******************************************************************/\n#ifndef REGIONSTRUCT_H\n#define REGIONSTRUCT_H\n\n#include \"miscstruct.h\"\n\n/* Return values from RectIn() */\n\n#define rgnOUT 0\n#define rgnIN  1\n#define rgnPART 2\n\n#define NullRegion ((RegionPtr)0)\n\n/*\n *   clip region\n */\n\ntypedef struct _RegData {\n    long\tsize;\n    long \tnumRects;\n/*  BoxRec\trects[size];   in memory but not explicitly declared */\n} RegDataRec, *RegDataPtr;\n\ntypedef struct _Region {\n    BoxRec \textents;\n    RegDataPtr\tdata;\n} RegionRec, *RegionPtr;\n\nextern BoxRec miEmptyBox;\nextern RegDataRec miEmptyData;\n\n#define REGION_NIL(reg) ((reg)->data && !(reg)->data->numRects)\n#define REGION_NUM_RECTS(reg) ((reg)->data ? (reg)->data->numRects : 1)\n#define REGION_SIZE(reg) ((reg)->data ? (reg)->data->size : 0)\n#define REGION_RECTS(reg) ((reg)->data ? (BoxPtr)((reg)->data + 1) \\\n\t\t\t               : &(reg)->extents)\n#define REGION_BOXPTR(reg) ((BoxPtr)((reg)->data + 1))\n#define REGION_BOX(reg,i) (&REGION_BOXPTR(reg)[i])\n#define REGION_TOP(reg) REGION_BOX(reg, (reg)->data->numRects)\n#define REGION_END(reg) REGION_BOX(reg, (reg)->data->numRects - 1)\n#define REGION_SZOF(n) (sizeof(RegDataRec) + ((n) * sizeof(BoxRec)))\n\n#ifdef NEED_SCREEN_REGIONS\n\n#define REGION_CREATE(_pScreen, _rect, _size) \\\n    (*(_pScreen)->RegionCreate)(_rect, _size)\n\n#define REGION_INIT(_pScreen, _pReg, _rect, _size) \\\n    (*(_pScreen)->RegionInit)(_pReg, _rect, _size)\n\n#define REGION_COPY(_pScreen, dst, src) \\\n    (*(_pScreen)->RegionCopy)(dst, src)\n\n#define REGION_DESTROY(_pScreen, _pReg) \\\n    (*(_pScreen)->RegionDestroy)(_pReg)\n\n#define REGION_UNINIT(_pScreen, _pReg) \\\n    (*(_pScreen)->RegionUninit)(_pReg)\n\n#define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \\\n    (*(_pScreen)->Intersect)(newReg, reg1, reg2)\n\n#define REGION_UNION(_pScreen, newReg, reg1, reg2) \\\n    (*(_pScreen)->Union)(newReg, reg1, reg2)\n\n#define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \\\n    (*(_pScreen)->Subtract)(newReg, reg1, reg2)\n\n#define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \\\n    (*(_pScreen)->Inverse)(newReg, reg1, invRect)\n\n#define REGION_RESET(_pScreen, _pReg, _pBox) \\\n    (*(_pScreen)->RegionReset)(_pReg, _pBox)\n\n#define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \\\n    (*(_pScreen)->TranslateRegion)(_pReg, _x, _y)\n\n#define RECT_IN_REGION(_pScreen, _pReg, prect) \\\n    (*(_pScreen)->RectIn)(_pReg, prect)\n\n#define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \\\n    (*(_pScreen)->PointInRegion)(_pReg, _x, _y, prect)\n\n#define REGION_NOTEMPTY(_pScreen, _pReg) \\\n    (*(_pScreen)->RegionNotEmpty)(_pReg)\n\n#define REGION_EMPTY(_pScreen, _pReg) \\\n    (*(_pScreen)->RegionEmpty)(_pReg)\n\n#define REGION_EXTENTS(_pScreen, _pReg) \\\n    (*(_pScreen)->RegionExtents)(_pReg)\n\n#define REGION_APPEND(_pScreen, dstrgn, rgn) \\\n    (*(_pScreen)->RegionAppend)(dstrgn, rgn)\n\n#define REGION_VALIDATE(_pScreen, badreg, pOverlap) \\\n    (*(_pScreen)->RegionValidate)(badreg, pOverlap)\n\n#define BITMAP_TO_REGION(_pScreen, pPix) \\\n    (*(_pScreen)->BitmapToRegion)(pPix)\n\n#define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \\\n    (*(_pScreen)->RectsToRegion)(nrects, prect, ctype)\n\n#else /* !NEED_SCREEN_REGIONS */\n\n#define REGION_CREATE(_pScreen, _rect, _size) \\\n    miRegionCreate(_rect, _size)\n\n#define REGION_COPY(_pScreen, dst, src) \\\n    miRegionCopy(dst, src)\n\n#define REGION_DESTROY(_pScreen, _pReg) \\\n    miRegionDestroy(_pReg)\n\n#define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \\\n    miIntersect(newReg, reg1, reg2)\n\n#define REGION_UNION(_pScreen, newReg, reg1, reg2) \\\n    miUnion(newReg, reg1, reg2)\n\n#define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \\\n    miSubtract(newReg, reg1, reg2)\n\n#define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \\\n    miInverse(newReg, reg1, invRect)\n\n#define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \\\n    miTranslateRegion(_pReg, _x, _y)\n\n#define RECT_IN_REGION(_pScreen, _pReg, prect) \\\n    miRectIn(_pReg, prect)\n\n#define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \\\n    miPointInRegion(_pReg, _x, _y, prect)\n\n#define REGION_APPEND(_pScreen, dstrgn, rgn) \\\n    miRegionAppend(dstrgn, rgn)\n\n#define REGION_VALIDATE(_pScreen, badreg, pOverlap) \\\n    miRegionValidate(badreg, pOverlap)\n\n#define BITMAP_TO_REGION(_pScreen, pPix) \\\n    (*(_pScreen)->BitmapToRegion)(pPix) /* no mi version?! */\n\n#define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \\\n    miRectsToRegion(nrects, prect, ctype)\n\n#ifdef DONT_INLINE_REGION_OPS\n\n#define REGION_INIT(_pScreen, _pReg, _rect, _size) \\\n    miRegionInit(_pReg, _rect, _size)\n\n#define REGION_UNINIT(_pScreen, _pReg) \\\n    miRegionUninit(_pReg)\n\n#define REGION_RESET(_pScreen, _pReg, _pBox) \\\n    miRegionReset(_pReg, _pBox)\n\n#define REGION_NOTEMPTY(_pScreen, _pReg) \\\n    miRegionNotEmpty(_pReg)\n\n#define REGION_EMPTY(_pScreen, _pReg) \\\n    miRegionEmpty(_pReg)\n\n#define REGION_EXTENTS(_pScreen, _pReg) \\\n    miRegionExtents(_pReg)\n\n#else /* inline certain simple region ops for performance */\n\n#define REGION_INIT(_pScreen, _pReg, _rect, _size) \\\n{ \\\n    if (_rect) \\\n    { \\\n\t(_pReg)->extents = *(_rect); \\\n\t(_pReg)->data = (RegDataPtr)NULL; \\\n    } \\\n    else \\\n    { \\\n\t(_pReg)->extents = miEmptyBox; \\\n\tif (((_size) > 1) && ((_pReg)->data = \\\n\t\t\t     (RegDataPtr)xalloc(REGION_SZOF(_size)))) \\\n\t{ \\\n\t    (_pReg)->data->size = (_size); \\\n\t    (_pReg)->data->numRects = 0; \\\n\t} \\\n\telse \\\n\t    (_pReg)->data = &miEmptyData; \\\n    } \\\n}\n\n#define REGION_UNINIT(_pScreen, _pReg) \\\n{ \\\n    if ((_pReg)->data && (_pReg)->data->size) xfree((_pReg)->data); \\\n}\n\n#define REGION_RESET(_pScreen, _pReg, _pBox) \\\n{ \\\n    (_pReg)->extents = *(_pBox); \\\n    REGION_UNINIT(_pScreen, _pReg); \\\n    (_pReg)->data = (RegDataPtr)NULL; \\\n}\n\n#define REGION_NOTEMPTY(_pScreen, _pReg) \\\n    !REGION_NIL(_pReg)\n\n#define REGION_EMPTY(_pScreen, _pReg) \\\n{ \\\n    REGION_UNINIT(_pScreen, _pReg); \\\n    (_pReg)->extents.x2 = (_pReg)->extents.x1; \\\n    (_pReg)->extents.y2 = (_pReg)->extents.y1; \\\n    (_pReg)->data = &miEmptyData; \\\n}\n\n#define REGION_EXTENTS(_pScreen, _pReg) \\\n    &(_pReg)->extents\n\n#endif /* DONT_INLINE_REGION_OPS */\n\n#endif /* NEED_SCREEN_REGIONS */\n\n/* moved from mi.h */\n\nextern RegionPtr miRegionCreate(\n#if NeedFunctionPrototypes\n    BoxPtr /*rect*/,\n    int /*size*/\n#endif\n);\n\nextern void miRegionInit(\n#if NeedFunctionPrototypes\n    RegionPtr /*pReg*/,\n    BoxPtr /*rect*/,\n    int /*size*/\n#endif\n);\n\nextern void miRegionDestroy(\n#if NeedFunctionPrototypes\n    RegionPtr /*pReg*/\n#endif\n);\n\nextern void miRegionUninit(\n#if NeedFunctionPrototypes\n    RegionPtr /*pReg*/\n#endif\n);\n\nextern Bool miRegionCopy(\n#if NeedFunctionPrototypes\n    RegionPtr /*dst*/,\n    RegionPtr /*src*/\n#endif\n);\n\nextern Bool miIntersect(\n#if NeedFunctionPrototypes\n    RegionPtr /*newReg*/,\n    RegionPtr /*reg1*/,\n    RegionPtr /*reg2*/\n#endif\n);\n\nextern Bool miUnion(\n#if NeedFunctionPrototypes\n    RegionPtr /*newReg*/,\n    RegionPtr /*reg1*/,\n    RegionPtr /*reg2*/\n#endif\n);\n\nextern Bool miRegionAppend(\n#if NeedFunctionPrototypes\n    RegionPtr /*dstrgn*/,\n    RegionPtr /*rgn*/\n#endif\n);\n\nextern Bool miRegionValidate(\n#if NeedFunctionPrototypes\n    RegionPtr /*badreg*/,\n    Bool * /*pOverlap*/\n#endif\n);\n\nextern RegionPtr miRectsToRegion(\n#if NeedFunctionPrototypes\n    int /*nrects*/,\n    xRectanglePtr /*prect*/,\n    int /*ctype*/\n#endif\n);\n\nextern Bool miSubtract(\n#if NeedFunctionPrototypes\n    RegionPtr /*regD*/,\n    RegionPtr /*regM*/,\n    RegionPtr /*regS*/\n#endif\n);\n\nextern Bool miInverse(\n#if NeedFunctionPrototypes\n    RegionPtr /*newReg*/,\n    RegionPtr /*reg1*/,\n    BoxPtr /*invRect*/\n#endif\n);\n\nextern int miRectIn(\n#if NeedFunctionPrototypes\n    RegionPtr /*region*/,\n    BoxPtr /*prect*/\n#endif\n);\n\nextern void miTranslateRegion(\n#if NeedFunctionPrototypes\n    RegionPtr /*pReg*/,\n    int /*x*/,\n    int /*y*/\n#endif\n);\n\nextern void miRegionReset(\n#if NeedFunctionPrototypes\n    RegionPtr /*pReg*/,\n    BoxPtr /*pBox*/\n#endif\n);\n\nextern Bool miPointInRegion(\n#if NeedFunctionPrototypes\n    RegionPtr /*pReg*/,\n    int /*x*/,\n    int /*y*/,\n    BoxPtr /*box*/\n#endif\n);\n\nextern Bool miRegionNotEmpty(\n#if NeedFunctionPrototypes\n    RegionPtr /*pReg*/\n#endif\n);\n\nextern void miRegionEmpty(\n#if NeedFunctionPrototypes\n    RegionPtr /*pReg*/\n#endif\n);\n\nextern BoxPtr miRegionExtents(\n#if NeedFunctionPrototypes\n    RegionPtr /*pReg*/\n#endif\n);\n\n#endif /* REGIONSTRUCT_H */\n"
  },
  {
    "path": "OSXvnc-server/include/Xserver/screenint.h",
    "content": "/* $XConsortium: screenint.h /main/6 1996/06/17 10:55:15 mor $ */\n/***********************************************************\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n******************************************************************/\n/* $XFree86: xc/programs/Xserver/include/screenint.h,v 1.2 1997/01/14 22:22:40 dawes Exp $ */\n#ifndef SCREENINT_H\n#define SCREENINT_H\n\n#include \"misc.h\"\n\ntypedef struct _PixmapFormat *PixmapFormatPtr;\ntypedef struct _Visual *VisualPtr;\ntypedef struct _Depth  *DepthPtr;\ntypedef struct _Screen *ScreenPtr;\n\nextern void ResetScreenPrivates(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern int AllocateScreenPrivateIndex(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern void ResetWindowPrivates(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern int AllocateWindowPrivateIndex(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern Bool AllocateWindowPrivate(\n#if NeedFunctionPrototypes\n    ScreenPtr /* pScreen */,\n    int /* index */,\n    unsigned /* amount */\n#endif\n);\n\nextern void ResetGCPrivates(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern int AllocateGCPrivateIndex(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern Bool AllocateGCPrivate(\n#if NeedFunctionPrototypes\n    ScreenPtr /* pScreen */,\n    int /* index */,\n    unsigned /* amount */\n#endif\n);\n\nextern int AddScreen(\n#if NeedFunctionPrototypes\n    Bool (* /*pfnInit*/)(\n#if NeedNestedPrototypes\n\tint /*index*/,\n\tScreenPtr /*pScreen*/,\n\tint /*argc*/,\n\tchar ** /*argv*/\n#endif\n    ),\n    int /*argc*/,\n    char** /*argv*/\n#endif\n);\n\n#ifdef PIXPRIV\n\nextern void ResetPixmapPrivates(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern int AllocatePixmapPrivateIndex(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\nextern Bool AllocatePixmapPrivate(\n#if NeedFunctionPrototypes\n    ScreenPtr /* pScreen */,\n    int /* index */,\n    unsigned /* amount */\n#endif\n);\n\n#endif /* PIXPRIV */\n\nextern void ResetColormapPrivates(\n#if NeedFunctionPrototypes\n    void\n#endif\n);\n\n\ntypedef struct _ColormapRec *ColormapPtr;\ntypedef int (*InitCmapPrivFunc)(\n#if NeedNestedPrototypes\n\tColormapPtr\n#endif\n);\n\nextern int AllocateColormapPrivateIndex(\n#if NeedFunctionPrototypes\n    InitCmapPrivFunc /* initPrivFunc */\n#endif\n);\n\n#endif /* SCREENINT_H */\n"
  },
  {
    "path": "OSXvnc-server/include/Xserver/scrnintstr.h",
    "content": "/* $XConsortium: scrnintstr.h /main/32 1996/09/28 17:14:32 rws $ */\n/***********************************************************\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n******************************************************************/\n#ifndef SCREENINTSTRUCT_H\n#define SCREENINTSTRUCT_H\n\n#include \"screenint.h\"\n#include \"miscstruct.h\"\n#include \"region.h\"\n#include \"pixmap.h\"\n#include \"gc.h\"\n#include \"colormap.h\"\n#include \"cursor.h\"\n#include \"validate.h\"\n#include \"window.h\"\n#include \"X11/Xproto.h\"\n#include \"dix.h\"\n\ntypedef struct _PixmapFormat {\n    unsigned char       depth;\n    unsigned char       bitsPerPixel;\n    unsigned char       scanlinePad;\n    } PixmapFormatRec;\n\ntypedef struct _Visual {\n    VisualID            vid;\n    short               clazz;\n    short               bitsPerRGBValue;\n    short               ColormapEntries;\n    short               nplanes;/* = log2 (ColormapEntries). This does not\n                                 * imply that the screen has this many planes.\n                                 * it may have more or fewer */\n    unsigned long       redMask, greenMask, blueMask;\n    int                 offsetRed, offsetGreen, offsetBlue;\n  } VisualRec;\n\ntypedef struct _Depth {\n    unsigned char       depth;\n    short               numVids;\n    VisualID            *vids;    /* block of visual ids for this depth */\n  } DepthRec;\n\n\n/*\n *  There is a typedef for each screen function pointer so that code that\n *  needs to declare a screen function pointer (e.g. in a screen private\n *  or as a local variable) can easily do so and retain full type checking.\n */\n\ntypedef    Bool (* CloseScreenProcPtr)(\n#if NeedNestedPrototypes\n        int /*index*/,\n        ScreenPtr /*pScreen*/\n#endif\n);\n\ntypedef    void (* QueryBestSizeProcPtr)(\n#if NeedNestedPrototypes\n        int /*class*/,\n        unsigned short * /*pwidth*/,\n        unsigned short * /*pheight*/,\n        ScreenPtr /*pScreen*/\n#endif\n);\n\ntypedef    Bool (* SaveScreenProcPtr)(\n#if NeedNestedPrototypes\n         ScreenPtr /*pScreen*/,\n         int /*on*/\n#endif\n);\n\ntypedef    void (* GetImageProcPtr)(\n#if NeedNestedPrototypes\n        DrawablePtr /*pDrawable*/,\n        int /*sx*/,\n        int /*sy*/,\n        int /*w*/,\n        int /*h*/,\n        unsigned int /*format*/,\n        unsigned long /*planeMask*/,\n        char * /*pdstLine*/\n#endif\n);\n\ntypedef    void (* GetSpansProcPtr)(\n#if NeedNestedPrototypes\n        DrawablePtr /*pDrawable*/,\n        int /*wMax*/,\n        DDXPointPtr /*ppt*/,\n        int* /*pwidth*/,\n        int /*nspans*/,\n        char * /*pdstStart*/\n#endif\n);\n\ntypedef    void (* PointerNonInterestBoxProcPtr)(\n#if NeedNestedPrototypes\n        ScreenPtr /*pScreen*/,\n        BoxPtr /*pBox*/\n#endif\n);\n\ntypedef    void (* SourceValidateProcPtr)(\n#if NeedNestedPrototypes\n        DrawablePtr /*pDrawable*/,\n        int /*x*/,\n        int /*y*/,\n        int /*width*/,\n        int /*height*/\n#endif\n);\n\ntypedef    Bool (* CreateWindowProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pWindow*/\n#endif\n);\n\ntypedef    Bool (* DestroyWindowProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pWindow*/\n#endif\n);\n\ntypedef    Bool (* PositionWindowProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pWindow*/,\n        int /*x*/,\n        int /*y*/\n#endif\n);\n\ntypedef    Bool (* ChangeWindowAttributesProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pWindow*/,\n        unsigned long /*mask*/\n#endif\n);\n\ntypedef    Bool (* RealizeWindowProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pWindow*/\n#endif\n);\n\ntypedef    Bool (* UnrealizeWindowProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pWindow*/\n#endif\n);\n\ntypedef    int  (* ValidateTreeProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pParent*/,\n        X11WindowPtr /*pChild*/,\n        VTKind /*kind*/\n#endif\n);\n\ntypedef    void (* PostValidateTreeProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pParent*/,\n        X11WindowPtr /*pChild*/,\n        VTKind /*kind*/\n#endif\n);\n\ntypedef    void (* WindowExposuresProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pWindow*/,\n        RegionPtr /*prgn*/,\n        RegionPtr /*other_exposed*/\n#endif\n);\n\ntypedef    void (* PaintWindowBackgroundProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pWindow*/,\n        RegionPtr /*pRegion*/,\n        int /*what*/\n#endif\n);\n\ntypedef    void (* PaintWindowBorderProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pWindow*/,\n        RegionPtr /*pRegion*/,\n        int /*what*/\n#endif\n);\n\ntypedef    void (* CopyWindowProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pWindow*/,\n        DDXPointRec /*ptOldOrg*/,\n        RegionPtr /*prgnSrc*/\n#endif\n);\n\ntypedef    void (* ClearToBackgroundProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pWindow*/,\n        int /*x*/,\n        int /*y*/,\n        int /*w*/,\n        int /*h*/,\n        Bool /*generateExposures*/\n#endif\n);\n\ntypedef    void (* ClipNotifyProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pWindow*/,\n        int /*dx*/,\n        int /*dy*/\n#endif\n);\n\ntypedef    PixmapPtr (* CreatePixmapProcPtr)(\n#if NeedNestedPrototypes\n        ScreenPtr /*pScreen*/,\n        int /*width*/,\n        int /*height*/,\n        int /*depth*/\n#endif\n);\n\ntypedef    Bool (* DestroyPixmapProcPtr)(\n#if NeedNestedPrototypes\n        PixmapPtr /*pPixmap*/\n#endif\n);\n\ntypedef    void (* SaveDoomedAreasProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pWindow*/,\n        RegionPtr /*prgnSave*/,\n        int /*xorg*/,\n        int /*yorg*/\n#endif\n);\n\ntypedef    RegionPtr (* RestoreAreasProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pWindow*/,\n        RegionPtr /*prgnRestore*/\n#endif\n);\n\ntypedef    void (* ExposeCopyProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pSrc*/,\n        DrawablePtr /*pDst*/,\n        GCPtr /*pGC*/,\n        RegionPtr /*prgnExposed*/,\n        int /*srcx*/,\n        int /*srcy*/,\n        int /*dstx*/,\n        int /*dsty*/,\n        unsigned long /*plane*/\n#endif\n);\n\ntypedef    RegionPtr (* TranslateBackingStoreProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pWindow*/,\n        int /*windx*/,\n        int /*windy*/,\n        RegionPtr /*oldClip*/,\n        int /*oldx*/,\n        int /*oldy*/\n#endif\n);\n\ntypedef    RegionPtr (* ClearBackingStoreProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pWindow*/,\n        int /*x*/,\n        int /*y*/,\n        int /*w*/,\n        int /*h*/,\n        Bool /*generateExposures*/\n#endif\n);\n\ntypedef    void (* DrawGuaranteeProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pWindow*/,\n        GCPtr /*pGC*/,\n        int /*guarantee*/\n#endif\n);\n\ntypedef    Bool (* RealizeFontProcPtr)(\n#if NeedNestedPrototypes\n        ScreenPtr /*pScreen*/,\n        FontPtr /*pFont*/\n#endif\n);\n\ntypedef    Bool (* UnrealizeFontProcPtr)(\n#if NeedNestedPrototypes\n        ScreenPtr /*pScreen*/,\n        FontPtr /*pFont*/\n#endif\n);\n\ntypedef    void (* ConstrainCursorProcPtr)(\n#if NeedNestedPrototypes\n        ScreenPtr /*pScreen*/,\n        BoxPtr /*pBox*/\n#endif\n);\n\ntypedef    void (* CursorLimitsProcPtr)(\n#if NeedNestedPrototypes\n        ScreenPtr /*pScreen*/,\n        CursorPtr /*pCursor*/,\n        BoxPtr /*pHotBox*/,\n        BoxPtr /*pTopLeftBox*/\n#endif\n);\n\ntypedef    Bool (* DisplayCursorProcPtr)(\n#if NeedNestedPrototypes\n        ScreenPtr /*pScreen*/,\n        CursorPtr /*pCursor*/\n#endif\n);\n\ntypedef    Bool (* RealizeCursorProcPtr)(\n#if NeedNestedPrototypes\n        ScreenPtr /*pScreen*/,\n        CursorPtr /*pCursor*/\n#endif\n);\n\ntypedef    Bool (* UnrealizeCursorProcPtr)(\n#if NeedNestedPrototypes\n        ScreenPtr /*pScreen*/,\n        CursorPtr /*pCursor*/\n#endif\n);\n\ntypedef    void (* RecolorCursorProcPtr)(\n#if NeedNestedPrototypes\n        ScreenPtr /*pScreen*/,\n        CursorPtr /*pCursor*/,\n        Bool /*displayed*/\n#endif\n);\n\ntypedef    Bool (* SetCursorPositionProcPtr)(\n#if NeedNestedPrototypes\n        ScreenPtr /*pScreen*/,\n        int /*x*/,\n        int /*y*/,\n        Bool /*generateEvent*/\n#endif\n);\n\ntypedef    Bool (* CreateGCProcPtr)(\n#if NeedNestedPrototypes\n        GCPtr /*pGC*/\n#endif\n);\n\ntypedef    Bool (* CreateColormapProcPtr)(\n#if NeedNestedPrototypes\n        ColormapPtr /*pColormap*/\n#endif\n);\n\ntypedef    void (* DestroyColormapProcPtr)(\n#if NeedNestedPrototypes\n        ColormapPtr /*pColormap*/\n#endif\n);\n\ntypedef    void (* InstallColormapProcPtr)(\n#if NeedNestedPrototypes\n        ColormapPtr /*pColormap*/\n#endif\n);\n\ntypedef    void (* UninstallColormapProcPtr)(\n#if NeedNestedPrototypes\n        ColormapPtr /*pColormap*/\n#endif\n);\n\ntypedef    int (* ListInstalledColormapsProcPtr) (\n#if NeedNestedPrototypes\n        ScreenPtr /*pScreen*/,\n        XID* /*pmaps */\n#endif\n);\n\ntypedef    void (* StoreColorsProcPtr)(\n#if NeedNestedPrototypes\n        ColormapPtr /*pColormap*/,\n        int /*ndef*/,\n        xColorItem * /*pdef*/\n#endif\n);\n\ntypedef    void (* ResolveColorProcPtr)(\n#if NeedNestedPrototypes\n        unsigned short* /*pred*/,\n        unsigned short* /*pgreen*/,\n        unsigned short* /*pblue*/,\n        VisualPtr /*pVisual*/\n#endif\n);\n\ntypedef    RegionPtr (* RegionCreateProcPtr)(\n#if NeedNestedPrototypes\n        BoxPtr /*rect*/,\n        int /*size*/\n#endif\n);\n\ntypedef    void (* RegionInitProcPtr)(\n#if NeedNestedPrototypes\n        RegionPtr /*pReg*/,\n        BoxPtr /*rect*/,\n        int /*size*/\n#endif\n);\n\ntypedef    Bool (* RegionCopyProcPtr)(\n#if NeedNestedPrototypes\n        RegionPtr /*dst*/,\n        RegionPtr /*src*/\n#endif\n);\n\ntypedef    void (* RegionDestroyProcPtr)(\n#if NeedNestedPrototypes\n        RegionPtr /*pReg*/\n#endif\n);\n\ntypedef    void (* RegionUninitProcPtr)(\n#if NeedNestedPrototypes\n        RegionPtr /*pReg*/\n#endif\n);\n\ntypedef    Bool (* IntersectProcPtr)(\n#if NeedNestedPrototypes\n        RegionPtr /*newReg*/,\n        RegionPtr /*reg1*/,\n        RegionPtr /*reg2*/\n#endif\n);\n\ntypedef    Bool (* UnionProcPtr)(\n#if NeedNestedPrototypes\n        RegionPtr /*newReg*/,\n        RegionPtr /*reg1*/,\n        RegionPtr /*reg2*/\n#endif\n);\n\ntypedef    Bool (* SubtractProcPtr)(\n#if NeedNestedPrototypes\n        RegionPtr /*regD*/,\n        RegionPtr /*regM*/,\n        RegionPtr /*regS*/\n#endif\n);\n\ntypedef    Bool (* InverseProcPtr)(\n#if NeedNestedPrototypes\n        RegionPtr /*newReg*/,\n        RegionPtr /*reg1*/,\n        BoxPtr /*invRect*/\n#endif\n);\n\ntypedef    void (* RegionResetProcPtr)(\n#if NeedNestedPrototypes\n        RegionPtr /*pReg*/,\n        BoxPtr /*pBox*/\n#endif\n);\n\ntypedef    void (* TranslateRegionProcPtr)(\n#if NeedNestedPrototypes\n        RegionPtr /*pReg*/,\n        int /*x*/,\n        int /*y*/\n#endif\n);\n\ntypedef    int (* RectInProcPtr)(\n#if NeedNestedPrototypes\n        RegionPtr /*region*/,\n        BoxPtr /*prect*/\n#endif\n);\n\ntypedef    Bool (* PointInRegionProcPtr)(\n#if NeedNestedPrototypes\n        RegionPtr /*pReg*/,\n        int /*x*/,\n        int /*y*/,\n        BoxPtr /*box*/\n#endif\n);\n\ntypedef    Bool (* RegionNotEmptyProcPtr)(\n#if NeedNestedPrototypes\n        RegionPtr /*pReg*/\n#endif\n);\n\ntypedef    void (* RegionEmptyProcPtr)(\n#if NeedNestedPrototypes\n        RegionPtr /*pReg*/\n#endif\n);\n\ntypedef    BoxPtr (* RegionExtentsProcPtr)(\n#if NeedNestedPrototypes\n        RegionPtr /*pReg*/\n#endif\n);\n\ntypedef    Bool (* RegionAppendProcPtr)(\n#if NeedNestedPrototypes\n        RegionPtr /*dstrgn*/,\n        RegionPtr /*rgn*/\n#endif\n);\n\ntypedef    Bool (* RegionValidateProcPtr)(\n#if NeedNestedPrototypes\n        RegionPtr /*badreg*/,\n        Bool* /*pOverlap*/\n#endif\n);\n\ntypedef    RegionPtr (* BitmapToRegionProcPtr)(\n#if NeedNestedPrototypes\n        PixmapPtr /*pPix*/\n#endif\n);\n\ntypedef    RegionPtr (* RectsToRegionProcPtr)(\n#if NeedNestedPrototypes\n        int /*nrects*/,\n        xRectangle* /*prect*/,\n        int /*ctype*/\n#endif\n);\n\ntypedef    void (* SendGraphicsExposeProcPtr)(\n#if NeedNestedPrototypes\n        ClientPtr /*client*/,\n        RegionPtr /*pRgn*/,\n        XID /*drawable*/,\n        int /*major*/,\n        int /*minor*/\n#endif\n);\n\ntypedef    void (* ScreenBlockHandlerProcPtr)(\n#if NeedNestedPrototypes\n        int /*screenNum*/,\n        pointer /*blockData*/,\n        struct timeval ** /*pTimeout*/,\n        pointer /*pReadmask*/\n#endif\n);\n\ntypedef    void (* ScreenWakeupHandlerProcPtr)(\n#if NeedNestedPrototypes\n         int /*screenNum*/,\n         pointer /*wakeupData*/,\n         unsigned long /*result*/,\n         pointer /*pReadMask*/\n#endif\n);\n\ntypedef    Bool (* CreateScreenResourcesProcPtr)(\n#if NeedNestedPrototypes\n        ScreenPtr /*pScreen*/\n#endif\n);\n\ntypedef    Bool (* ModifyPixmapHeaderProcPtr)(\n#if NeedNestedPrototypes\n        PixmapPtr /*pPixmap*/,\n        int /*width*/,\n        int /*height*/,\n        int /*depth*/,\n        int /*bitsPerPixel*/,\n        int /*devKind*/,\n        pointer /*pPixData*/\n#endif\n);\n\ntypedef    void (* MarkWindowProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pWin*/\n#endif\n);\n\ntypedef    Bool (* MarkOverlappedWindowsProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*parent*/,\n        X11WindowPtr /*firstChild*/,\n        X11WindowPtr * /*pLayerWin*/\n#endif\n);\n\ntypedef    Bool (* ChangeSaveUnderProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pLayerWin*/,\n        X11WindowPtr /*firstChild*/\n#endif\n);\n\ntypedef    void (* PostChangeSaveUnderProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pLayerWin*/,\n        X11WindowPtr /*firstChild*/\n#endif\n);\n\ntypedef    void (* MoveWindowProcPtr)(\n#if NeedNestedPrototypes\n        X11WindowPtr /*pWin*/,\n        int /*x*/,\n        int /*y*/,\n        X11WindowPtr /*pSib*/,\n        VTKind /*kind*/\n#endif\n);\n\ntypedef    void (* ResizeWindowProcPtr)(\n#if NeedNestedPrototypes\n    X11WindowPtr /*pWin*/,\n    int /*x*/,\n    int /*y*/,\n    unsigned int /*w*/,\n    unsigned int /*h*/,\n    X11WindowPtr /*pSib*/\n#endif\n);\n\ntypedef    X11WindowPtr (* GetLayerWindowProcPtr)(\n#if NeedNestedPrototypes\n    X11WindowPtr /*pWin*/\n#endif\n);\n\ntypedef    void (* HandleExposuresProcPtr)(\n#if NeedNestedPrototypes\n    X11WindowPtr /*pWin*/\n#endif\n);\n\ntypedef    void (* ReparentWindowProcPtr)(\n#if NeedNestedPrototypes\n    X11WindowPtr /*pWin*/,\n    X11WindowPtr /*pPriorParent*/\n#endif\n);\n\n#ifdef SHAPE\ntypedef    void (* SetShapeProcPtr)(\n#if NeedFunctionPrototypes\n        X11WindowPtr /*pWin*/\n#endif\n);\n#endif /* SHAPE */\n\ntypedef    void (* ChangeBorderWidthProcPtr)(\n#if NeedFunctionPrototypes\n        X11WindowPtr /*pWin*/,\n        unsigned int /*width*/\n#endif\n);\n\ntypedef    void (* MarkUnrealizedWindowProcPtr)(\n#if NeedFunctionPrototypes\n        X11WindowPtr /*pChild*/,\n        X11WindowPtr /*pWin*/,\n        Bool /*fromConfigure*/\n#endif\n);\n\ntypedef struct _Screen {\n    int                 myNum;  /* index of this instance in Screens[] */\n    ATOM                id;\n    short               width, height;\n    short               mmWidth, mmHeight;\n    short               numDepths;\n    unsigned char       rootDepth;\n    DepthPtr            allowedDepths;\n    unsigned long       rootVisual;\n    unsigned long       defColormap;\n    short               minInstalledCmaps, maxInstalledCmaps;\n    char                backingStoreSupport, saveUnderSupport;\n    unsigned long       whitePixel, blackPixel;\n    unsigned long       rgf;    /* array of flags; she's -- HUNGARIAN */\n    GCPtr               GCperDepth[MAXFORMATS+1];\n                        /* next field is a stipple to use as default in\n                           a GC.  we don't build default tiles of all depths\n                           because they are likely to be of a color\n                           different from the default fg pixel, so\n                           we don't win anything by building\n                           a standard one.\n                        */\n    PixmapPtr           PixmapPerDepth[1];\n    pointer             devPrivate;\n    short               numVisuals;\n    VisualPtr           visuals;\n    int                 WindowPrivateLen;\n    unsigned            *WindowPrivateSizes;\n    unsigned            totalWindowSize;\n    int                 GCPrivateLen;\n    unsigned            *GCPrivateSizes;\n    unsigned            totalGCSize;\n\n    /* Random screen procedures */\n\n    CloseScreenProcPtr          CloseScreen;\n    QueryBestSizeProcPtr        QueryBestSize;\n    SaveScreenProcPtr           SaveScreen;\n    GetImageProcPtr             GetImage;\n    GetSpansProcPtr             GetSpans;\n    PointerNonInterestBoxProcPtr PointerNonInterestBox;\n    SourceValidateProcPtr       SourceValidate;\n\n    /* Window Procedures */\n\n    CreateWindowProcPtr         CreateWindow;\n    DestroyWindowProcPtr        DestroyWindow;\n    PositionWindowProcPtr       PositionWindow;\n    ChangeWindowAttributesProcPtr ChangeWindowAttributes;\n    RealizeWindowProcPtr        RealizeWindow;\n    UnrealizeWindowProcPtr      UnrealizeWindow;\n    ValidateTreeProcPtr         ValidateTree;\n    PostValidateTreeProcPtr     PostValidateTree;\n    WindowExposuresProcPtr      WindowExposures;\n    PaintWindowBackgroundProcPtr PaintWindowBackground;\n    PaintWindowBorderProcPtr    PaintWindowBorder;\n    CopyWindowProcPtr           CopyWindow;\n    ClearToBackgroundProcPtr    ClearToBackground;\n    ClipNotifyProcPtr           ClipNotify;\n\n    /* Pixmap procedures */\n\n    CreatePixmapProcPtr         CreatePixmap;\n    DestroyPixmapProcPtr        DestroyPixmap;\n\n    /* Backing store procedures */\n\n    SaveDoomedAreasProcPtr      SaveDoomedAreas;\n    RestoreAreasProcPtr         RestoreAreas;\n    ExposeCopyProcPtr           ExposeCopy;\n    TranslateBackingStoreProcPtr TranslateBackingStore;\n    ClearBackingStoreProcPtr    ClearBackingStore;\n    DrawGuaranteeProcPtr        DrawGuarantee;\n\n    /* Font procedures */\n\n    RealizeFontProcPtr          RealizeFont;\n    UnrealizeFontProcPtr        UnrealizeFont;\n\n    /* Cursor Procedures */\n\n    ConstrainCursorProcPtr      ConstrainCursor;\n    CursorLimitsProcPtr         CursorLimits;\n    DisplayCursorProcPtr        DisplayCursor;\n    RealizeCursorProcPtr        RealizeCursor;\n    UnrealizeCursorProcPtr      UnrealizeCursor;\n    RecolorCursorProcPtr        RecolorCursor;\n    SetCursorPositionProcPtr    SetCursorPosition;\n\n    /* GC procedures */\n\n    CreateGCProcPtr             CreateGC;\n\n    /* Colormap procedures */\n\n    CreateColormapProcPtr       CreateColormap;\n    DestroyColormapProcPtr      DestroyColormap;\n    InstallColormapProcPtr      InstallColormap;\n    UninstallColormapProcPtr    UninstallColormap;\n    ListInstalledColormapsProcPtr ListInstalledColormaps;\n    StoreColorsProcPtr          StoreColors;\n    ResolveColorProcPtr         ResolveColor;\n\n    /* Region procedures */\n\n    RegionCreateProcPtr         RegionCreate;\n    RegionInitProcPtr           RegionInit;\n    RegionCopyProcPtr           RegionCopy;\n    RegionDestroyProcPtr        RegionDestroy;\n    RegionUninitProcPtr         RegionUninit;\n    IntersectProcPtr            Intersect;\n    UnionProcPtr                Union;\n    SubtractProcPtr             Subtract;\n    InverseProcPtr              Inverse;\n    RegionResetProcPtr          RegionReset;\n    TranslateRegionProcPtr      TranslateRegion;\n    RectInProcPtr               RectIn;\n    PointInRegionProcPtr        PointInRegion;\n    RegionNotEmptyProcPtr       RegionNotEmpty;\n    RegionEmptyProcPtr          RegionEmpty;\n    RegionExtentsProcPtr        RegionExtents;\n    RegionAppendProcPtr         RegionAppend;\n    RegionValidateProcPtr       RegionValidate;\n    BitmapToRegionProcPtr       BitmapToRegion;\n    RectsToRegionProcPtr        RectsToRegion;\n    SendGraphicsExposeProcPtr   SendGraphicsExpose;\n\n    /* os layer procedures */\n\n    ScreenBlockHandlerProcPtr   BlockHandler;\n    ScreenWakeupHandlerProcPtr  WakeupHandler;\n\n    pointer blockData;\n    pointer wakeupData;\n\n    /* anybody can get a piece of this array */\n    DevUnion    *devPrivates;\n\n    CreateScreenResourcesProcPtr CreateScreenResources;\n    ModifyPixmapHeaderProcPtr   ModifyPixmapHeader;\n\n    PixmapPtr pScratchPixmap;           /* scratch pixmap \"pool\" */\n\n#ifdef PIXPRIV\n    int                 PixmapPrivateLen;\n    unsigned            *PixmapPrivateSizes;\n    unsigned            totalPixmapSize;\n#endif\n\n    MarkWindowProcPtr           MarkWindow;\n    MarkOverlappedWindowsProcPtr MarkOverlappedWindows;\n    ChangeSaveUnderProcPtr      ChangeSaveUnder;\n    PostChangeSaveUnderProcPtr  PostChangeSaveUnder;\n    MoveWindowProcPtr           MoveWindow;\n    ResizeWindowProcPtr         ResizeWindow;\n    GetLayerWindowProcPtr       GetLayerWindow;\n    HandleExposuresProcPtr      HandleExposures;\n    ReparentWindowProcPtr       ReparentWindow;\n\n#ifdef SHAPE\n    SetShapeProcPtr             SetShape;\n#endif /* SHAPE */\n\n    ChangeBorderWidthProcPtr    ChangeBorderWidth;\n    MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;\n\n} ScreenRec;\n\ntypedef struct _ScreenInfo {\n    int         imageByteOrder;\n    int         bitmapScanlineUnit;\n    int         bitmapScanlinePad;\n    int         bitmapBitOrder;\n    int         numPixmapFormats;\n    PixmapFormatRec\n                formats[MAXFORMATS];\n    int         arraySize;\n    int         numScreens;\n    ScreenPtr   screens[MAXSCREENS];\n    int         numVideoScreens;\n} ScreenInfo;\n\nextern ScreenInfo screenInfo;\n\nextern void InitOutput(\n#if NeedFunctionPrototypes\n    ScreenInfo  * /*pScreenInfo*/,\n    int         /*argc*/,\n    char        ** /*argv*/\n#endif\n);\n\n#endif /* SCREENINTSTRUCT_H */\n"
  },
  {
    "path": "OSXvnc-server/include/Xserver/validate.h",
    "content": "/* $XConsortium: validate.h,v 5.4 94/04/17 20:26:11 dpw Exp $ */\n\n/*\n\nCopyright (c) 1989  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n*/\n\n#ifndef VALIDATE_H\n#define VALIDATE_H\n\n#include \"miscstruct.h\"\n#include \"regionstr.h\"\n\ntypedef enum { VTOther, VTStack, VTMove, VTUnmap, VTMap } VTKind;\n\n/* union _Validate is now device dependent; see mivalidate.h for an example */\ntypedef union _Validate *ValidatePtr;\n\n#define UnmapValData ((ValidatePtr)1)\n\n#endif /* VALIDATE_H */\n"
  },
  {
    "path": "OSXvnc-server/include/Xserver/window.h",
    "content": "/* $XConsortium: window.h /main/8 1996/03/21 13:35:33 mor $ */\n/***********************************************************\n\nCopyright (c) 1987  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n******************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include \"misc.h\"\n#include \"region.h\"\n#include \"screenint.h\"\n#include \"X11/Xproto.h\"\n\n#define TOTALLY_OBSCURED 0\n#define UNOBSCURED 1\n#define OBSCURED 2\n\n#define VisibilityNotViewable   3\n\n/* return values for tree-walking callback procedures */\n#define WT_STOPWALKING          0\n#define WT_WALKCHILDREN         1\n#define WT_DONTWALKCHILDREN     2\n#define WT_NOMATCH 3\n#define NullWindow ((X11WindowPtr) 0)\n\ntypedef struct _BackingStore *BackingStorePtr;\ntypedef struct _Window *X11WindowPtr;   /* conflict with CoreGraphics */\n\ntypedef int (*VisitWindowProcPtr)(\n#if NeedNestedPrototypes\n    X11WindowPtr /*pWin*/,\n    pointer /*data*/\n#endif\n);\n\nextern int TraverseTree(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/,\n    VisitWindowProcPtr /*func*/,\n    pointer /*data*/\n#endif\n);\n\nextern int WalkTree(\n#if NeedFunctionPrototypes\n    ScreenPtr /*pScreen*/,\n    VisitWindowProcPtr /*func*/,\n    pointer /*data*/\n#endif\n);\n\nextern X11WindowPtr AllocateWindow(\n#if NeedFunctionPrototypes\n    ScreenPtr /*pScreen*/\n#endif\n);\n\nextern Bool CreateRootWindow(\n#if NeedFunctionPrototypes\n    ScreenPtr /*pScreen*/\n#endif\n);\n\nextern void InitRootWindow(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/\n#endif\n);\n\nextern void ClippedRegionFromBox(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/,\n    RegionPtr /*Rgn*/,\n    int /*x*/,\n    int /*y*/,\n    int /*w*/,\n    int /*h*/\n#endif\n);\n\nextern X11WindowPtr RealChildHead(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/\n#endif\n);\n\nextern X11WindowPtr CreateWindow(\n#if NeedFunctionPrototypes\n    Window /*wid*/,\n    X11WindowPtr /*pParent*/,\n    int /*x*/,\n    int /*y*/,\n    unsigned int /*w*/,\n    unsigned int /*h*/,\n    unsigned int /*bw*/,\n    unsigned int /*class*/,\n    Mask /*vmask*/,\n    XID* /*vlist*/,\n    int /*depth*/,\n    ClientPtr /*client*/,\n    VisualID /*visual*/,\n    int* /*error*/\n#endif\n);\n\nextern int DeleteWindow(\n#if NeedFunctionPrototypes\n    pointer /*pWin*/,\n    XID /*wid*/\n#endif\n);\n\nextern void DestroySubwindows(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/,\n    ClientPtr /*client*/\n#endif\n);\n\nextern int X11ChangeWindowAttributes(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/,\n    Mask /*vmask*/,\n    XID* /*vlist*/,\n    ClientPtr /*client*/\n#endif\n);\n\nextern void X11GetWindowAttributes(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/,\n    ClientPtr /*client*/,\n    xGetWindowAttributesReply* /* wa */\n#endif\n);\n\nextern RegionPtr CreateUnclippedWinSize(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/\n#endif\n);\n\nextern void GravityTranslate(\n#if NeedFunctionPrototypes\n    int /*x*/,\n    int /*y*/,\n    int /*oldx*/,\n    int /*oldy*/,\n    int /*dw*/,\n    int /*dh*/,\n    unsigned /*gravity*/,\n    int* /*destx*/,\n    int* /*desty*/\n#endif\n);\n\nextern int ConfigureWindow(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/,\n    Mask /*mask*/,\n    XID* /*vlist*/,\n    ClientPtr /*client*/\n#endif\n);\n\nextern int CirculateWindow(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pParent*/,\n    int /*direction*/,\n    ClientPtr /*client*/\n#endif\n);\n\nextern int ReparentWindow(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/,\n    X11WindowPtr /*pParent*/,\n    int /*x*/,\n    int /*y*/,\n    ClientPtr /*client*/\n#endif\n);\n\nextern int MapWindow(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/,\n    ClientPtr /*client*/\n#endif\n);\n\nextern void MapSubwindows(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pParent*/,\n    ClientPtr /*client*/\n#endif\n);\n\nextern int UnmapWindow(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/,\n    Bool /*fromConfigure*/\n#endif\n);\n\nextern void UnmapSubwindows(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/\n#endif\n);\n\nextern void HandleSaveSet(\n#if NeedFunctionPrototypes\n    ClientPtr /*client*/\n#endif\n);\n\nextern Bool VisibleBoundingBoxFromPoint(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/,\n    int /*x*/,\n    int /*y*/,\n    BoxPtr /*box*/\n#endif\n);\n\nextern Bool PointInWindowIsVisible(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/,\n    int /*x*/,\n    int /*y*/\n#endif\n);\n\nextern RegionPtr NotClippedByChildren(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/\n#endif\n);\n\nextern void SendVisibilityNotify(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/\n#endif\n);\n\nextern void SaveScreens(\n#if NeedFunctionPrototypes\n    int /*on*/,\n    int /*mode*/\n#endif\n);\n\nextern X11WindowPtr FindWindowWithOptional(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*w*/\n#endif\n);\n\nextern void CheckWindowOptionalNeed(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*w*/\n#endif\n);\n\nextern Bool MakeWindowOptional(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/\n#endif\n);\n\nextern void DisposeWindowOptional(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/\n#endif\n);\n\nextern X11WindowPtr MoveWindowInStack(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/,\n    X11WindowPtr /*pNextSib*/\n#endif\n);\n\nvoid SetWinSize(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/\n#endif\n);\n\nvoid SetBorderSize(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/\n#endif\n);\n\nvoid ResizeChildrenWinSize(\n#if NeedFunctionPrototypes\n    X11WindowPtr /*pWin*/,\n    int /*dx*/,\n    int /*dy*/,\n    int /*dw*/,\n    int /*dh*/\n#endif\n);\n\n#endif /* WINDOW_H */\n"
  },
  {
    "path": "OSXvnc-server/kbdptr.c",
    "content": "/*\n * kbdptr.c - deal with keyboard and pointer device over TCP & UDP.\n *\n *\n */\n\n/*\n *  OSXvnc Copyright (C) 2001 Dan McGuirk\n *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.\n *  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n#import <Cocoa/Cocoa.h>\n#import <Carbon/Carbon.h>\n\n#import <stdio.h>\n#import <ApplicationServices/ApplicationServices.h>\n\n#import \"VNCServer.h\"\n\n#import <X11/keysym.h>\n#import \"rfb.h\"\n\n#import \"kbdptr.h\"\n\n\nvoid KbdAddEvent(Bool down, KeySym keySym, rfbClientPtr cl) {\n    [[VNCServer sharedServer] handleKeyboard:(Bool) down forSym: (KeySym) keySym forClient: (rfbClientPtr) cl];\n}\n\nvoid keyboardReleaseKeysForClient(rfbClientPtr cl) {\n    [[VNCServer sharedServer] releaseModifiersForClient: (rfbClientPtr) cl];\n}\n\nvoid PtrAddEvent(int buttonMask, int x, int y, rfbClientPtr cl) {\n    [[VNCServer sharedServer] handleMouseButtons:buttonMask atPoint:NSMakePoint(x, y) forClient: (rfbClientPtr) cl];\n}\n"
  },
  {
    "path": "OSXvnc-server/kbdptr.h",
    "content": "\n// This list has an entry for the X keySym followed by the corresponding\n// Mac US Keyboard's KeyCode\n// Would prefer to Get this from the official file/state\n// but it isn't quite that simple.\n\n#define keyTableSize 0xFFFF\n\nstatic int USKeyCodes[] = {\n    /* The alphabet */\n    XK_A,                  0,      /* A */\n    XK_B,                 11,      /* B */\n    XK_C,                  8,      /* C */\n    XK_D,                  2,      /* D */\n    XK_E,                 14,      /* E */\n    XK_F,                  3,      /* F */\n    XK_G,                  5,      /* G */\n    XK_H,                  4,      /* H */\n    XK_I,                 34,      /* I */\n    XK_J,                 38,      /* J */\n    XK_K,                 40,      /* K */\n    XK_L,                 37,      /* L */\n    XK_M,                 46,      /* M */\n    XK_N,                 45,      /* N */\n    XK_O,                 31,      /* O */\n    XK_P,                 35,      /* P */\n    XK_Q,                 12,      /* Q */\n    XK_R,                 15,      /* R */\n    XK_S,                  1,      /* S */\n    XK_T,                 17,      /* T */\n    XK_U,                 32,      /* U */\n    XK_V,                  9,      /* V */\n    XK_W,                 13,      /* W */\n    XK_X,                  7,      /* X */\n    XK_Y,                 16,      /* Y */\n    XK_Z,                  6,      /* Z */\n    XK_a,                  0,      /* a */\n    XK_b,                 11,      /* b */\n    XK_c,                  8,      /* c */\n    XK_d,                  2,      /* d */\n    XK_e,                 14,      /* e */\n    XK_f,                  3,      /* f */\n    XK_g,                  5,      /* g */\n    XK_h,                  4,      /* h */\n    XK_i,                 34,      /* i */\n    XK_j,                 38,      /* j */\n    XK_k,                 40,      /* k */\n    XK_l,                 37,      /* l */\n    XK_m,                 46,      /* m */\n    XK_n,                 45,      /* n */\n    XK_o,                 31,      /* o */\n    XK_p,                 35,      /* p */\n    XK_q,                 12,      /* q */\n    XK_r,                 15,      /* r */\n    XK_s,                  1,      /* s */\n    XK_t,                 17,      /* t */\n    XK_u,                 32,      /* u */\n    XK_v,                  9,      /* v */\n    XK_w,                 13,      /* w */\n    XK_x,                  7,      /* x */\n    XK_y,                 16,      /* y */\n    XK_z,                  6,      /* z */\n\n    /* Numbers */\n    XK_0,                 29,      /* 0 */\n    XK_1,                 18,      /* 1 */\n    XK_2,                 19,      /* 2 */\n    XK_3,                 20,      /* 3 */\n    XK_4,                 21,      /* 4 */\n    XK_5,                 23,      /* 5 */\n    XK_6,                 22,      /* 6 */\n    XK_7,                 26,      /* 7 */\n    XK_8,                 28,      /* 8 */\n    XK_9,                 25,      /* 9 */\n\n    /* Symbols */\n    XK_exclam,            18,      /* ! */\n    XK_at,                19,      /* @ */\n    XK_numbersign,        20,      /* # */\n    XK_dollar,            21,      /* $ */\n    XK_percent,           23,      /* % */\n    XK_asciicircum,       22,      /* ^ */\n    XK_ampersand,         26,      /* & */\n    XK_asterisk,          28,      /* * */\n    XK_parenleft,         25,      /* ( */\n    XK_parenright,        29,      /* ) */\n    XK_minus,             27,      /* - */\n    XK_underscore,        27,      /* _ */\n    XK_equal,             24,      /* = */\n    XK_plus,              24,      /* + */\n    XK_grave,             50,      /* ` */  /* XXX ? */\n    XK_asciitilde,        50,      /* ~ */\n    XK_bracketleft,       33,      /* [ */\n    XK_braceleft,         33,      /* { */\n    XK_bracketright,      30,      /* ] */\n    XK_braceright,        30,      /* } */\n    XK_semicolon,         41,      /* ; */\n    XK_colon,             41,      /* : */\n    XK_apostrophe,        39,      /* ' */\n    XK_quotedbl,          39,      /* \" */\n    XK_comma,             43,      /* , */\n    XK_less,              43,      /* < */\n    XK_period,            47,      /* . */\n    XK_greater,           47,      /* > */\n    XK_slash,             44,      /* / */\n    XK_question,          44,      /* ? */\n    XK_backslash,         42,      /* \\ */\n    XK_bar,               42,      /* | */\n    // OS X Sends this (END OF MEDIUM) for Shift-Tab (with US Keyboard)\n    0x0019,               48,      /* Tab */\n    XK_space,             49,      /* Space */\n};\n\nstatic int SpecialKeyCodes[] = {\n    /* \"Special\" keys */\n    XK_Return,            36,      /* Return */\n    XK_Delete,           117,      /* Delete */\n    XK_Tab,               48,      /* Tab */\n    XK_Escape,            53,      /* Esc */\n    XK_Caps_Lock,         57,      /* Caps Lock */\n    XK_Num_Lock,          71,      /* Num Lock */\n    XK_Scroll_Lock,      107,      /* Scroll Lock */\n    XK_Pause,            113,      /* Pause */\n    XK_BackSpace,         51,      /* Backspace */\n    XK_Insert,           114,      /* Insert */\n\n    /* Cursor movement */\n    XK_Up,               126,      /* Cursor Up */\n    XK_Down,             125,      /* Cursor Down */\n    XK_Left,             123,      /* Cursor Left */\n    XK_Right,            124,      /* Cursor Right */\n    XK_Page_Up,          116,      /* Page Up */\n    XK_Page_Down,        121,      /* Page Down */\n    XK_Home,             115,      /* Home */\n    XK_End,              119,      /* End */\n\n    /* Numeric keypad */\n    XK_KP_0,              82,      /* KP 0 */\n    XK_KP_1,              83,      /* KP 1 */\n    XK_KP_2,              84,      /* KP 2 */\n    XK_KP_3,              85,      /* KP 3 */\n    XK_KP_4,              86,      /* KP 4 */\n    XK_KP_5,              87,      /* KP 5 */\n    XK_KP_6,              88,      /* KP 6 */\n    XK_KP_7,              89,      /* KP 7 */\n    XK_KP_8,              91,      /* KP 8 */\n    XK_KP_9,              92,      /* KP 9 */\n    XK_KP_Enter,          76,      /* KP Enter */\n    XK_KP_Decimal,        65,      /* KP . */\n    XK_KP_Add,            69,      /* KP + */\n    XK_KP_Subtract,       78,      /* KP - */\n    XK_KP_Multiply,       67,      /* KP * */\n    XK_KP_Divide,         75,      /* KP / */\n\tXK_KP_Equal,\t\t  81,      /* KP = */\n\n    /* Function keys */\n    XK_F1,               122,      /* F1 */\n    XK_F2,               120,      /* F2 */\n    XK_F3,                99,      /* F3 */\n    XK_F4,               118,      /* F4 */\n    XK_F5,                96,      /* F5 */\n    XK_F6,                97,      /* F6 */\n    XK_F7,                98,      /* F7 */\n    XK_F8,               100,      /* F8 */\n    XK_F9,               101,      /* F9 */\n    XK_F10,              109,      /* F10 */\n    XK_F11,              103,      /* F11 */\n    XK_F12,              111,      /* F12 */\n    XK_F13,              105,      /* F12 */\n    XK_F14,              107,      /* F12 */\n    XK_F15,              113,      /* F12 */\n    XK_F16,              106,      /* F12 */\n    XK_F17,              64,      /* F12 */\n    XK_F18,              79,      /* F12 */\n    XK_F19,              80,      /* F12 */\n    XK_F20,              90,      /* F12 */\n\n    /* Modifier keys */\n    XK_Alt_L,             55,      /* Alt Left (-> Command) */\n    XK_Alt_R,             55,      /* Alt Right (-> Command) */\n    XK_Shift_L,           56,      /* Shift Left */\n    XK_Shift_R,           56,      /* Shift Right */\n    XK_Meta_L,            58,      /* Option Left (-> Option) */\n    XK_Meta_R,            58,      /* Option Right (-> Option) */\n    XK_Super_L,            58,      /* Option Left (-> Option) */\n    XK_Super_R,            58,      /* Option Right (-> Option) */\n    XK_Control_L,         59,      /* Ctrl Left */\n    XK_Control_R,         59,      /* Ctrl Right */\n};\n\n"
  },
  {
    "path": "OSXvnc-server/libvncauth/Makefile",
    "content": "# Dummy Makefile for OSXvnc-server\n\n.PHONY: all clean\n\nall:\n\t@echo Nothing to be done\n\nclean:\n\t@echo Nothing to be done\n"
  },
  {
    "path": "OSXvnc-server/main.c",
    "content": "/*\n *  OSXvnc Copyright (C) 2002-2004 Redstone Software osxvnc@redstonesoftware.com\n *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.\n *  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n#include <ApplicationServices/ApplicationServices.h>\n#include <Cocoa/Cocoa.h>\n#include <Carbon/Carbon.h>\n\n#include <sys/stat.h>\n#include <sys/types.h>\n#include <sys/socket.h>\n#include <netinet/in.h>\n#include <netinet/tcp.h>\n#include <fcntl.h>\n#include <pthread.h>\n#include <unistd.h>\n#include <signal.h>\n\n#include <sys/sysctl.h>\n\n#include \"rfb.h\"\n\n#include \"rfbserver.h\"\n#import \"VNCServer.h\"\n\nstatic ScreenRec hackScreen;\nrfbScreenInfo rfbScreen;\n\nunsigned rfbProtocolMajorVersion = 3;\nunsigned rfbProtocolMinorVersion = 8;\n\nchar desktopName[256];\n\nBOOL keepRunning = TRUE;\n\nBOOL littleEndian = FALSE;\nunsigned rfbPort = 0; //5900;\nint  rfbMaxBitDepth = 0;\nBool rfbAlwaysShared = FALSE;\nBool rfbNeverShared = FALSE;\nBool rfbDontDisconnect = FALSE;\nBool rfbLocalhostOnly = FALSE;\nBool rfbInhibitEvents = FALSE;\nBool rfbReverseMods = FALSE;\n\nBool rfbSwapButtons = TRUE;\nBool rfbDisableRemote = FALSE;\nBool rfbDisableRichClipboards = FALSE;\nBool rfbRemapShortcuts = FALSE;\nBOOL rfbShouldSendUpdates = TRUE;\nBOOL registered = FALSE;\nBOOL restartOnUserSwitch = FALSE;\nBOOL useIP4 = TRUE;\nBOOL unregisterWhenNoConnections = FALSE;\nBOOL nonBlocking = FALSE;\nBOOL logEnable = TRUE;\n\nstatic BOOL didSupplyPass;\nstatic CGFloat displayScale;\n\n// OSXvnc 0.8 This flag will use a local buffer which will allow us to display the mouse cursor\n// Bool rfbLocalBuffer = FALSE;\n\nstatic pthread_mutex_t logMutex;\npthread_mutex_t listenerAccepting;\npthread_cond_t listenerGotNewClient;\npthread_t listener_thread;\n\n/* OSXvnc 0.8 for screensaver .... */\n// setup screen saver disabling timer\n// Not sure we want or need this...\nstatic EventLoopTimerUPP  screensaverTimerUPP;\nstatic EventLoopTimerRef screensaverTimer;\nBool rfbDisableScreenSaver = FALSE;\n\n// Display ID of main display\nstatic CGDirectDisplayID displayID;\n\n// Deprecated in 10.6 but required since the new api doesn't work for off-screen sessions\nsize_t CGDisplayBytesPerRow ( CGDirectDisplayID display );\nvoid * CGDisplayBaseAddress ( CGDirectDisplayID display );\n\nextern void rfbScreensaverTimer(EventLoopTimerRef timer, void *userData);\n\nint rfbDeferUpdateTime = 40; /* in ms */\n\nstatic char reverseHost[256] = \"\";\nstatic int reversePort = 5500;\n\nCGDisplayErr displayErr;\n\n// Server Data\nrfbserver thisServer;\n\nVNCServer *vncServerObject = nil;\n\nstatic bool rfbScreenInit(void);\n\n/*\n * rfbLog prints a time-stamped message to the log file (stderr).\n */\n\nvoid rfbLog(char *format, ...) {\n    if (logEnable && format != NULL) {\n        va_list args;\n        NSString *nsFormat = [[NSString alloc] initWithUTF8String:format];\n        pthread_mutex_lock(&logMutex);\n        NS_DURING {\n            va_start(args, format);\n            NSLogv(nsFormat, args);\n            va_end(args);\n        };\n        NS_HANDLER\n        NS_ENDHANDLER\n        pthread_mutex_unlock(&logMutex);\n        [nsFormat release];\n    }\n}\n\nvoid rfbDebugLog(char *format, ...) {\n#ifdef __DEBUGGING__\n    va_list args;\n    NSString *nsFormat = [[NSString alloc] initWithUTF8String:format];\n\n    pthread_mutex_lock(&logMutex);\n    va_start(args, format);\n    NSLogv(nsFormat, args);\n    va_end(args);\n\n    [nsFormat release];\n    pthread_mutex_unlock(&logMutex);\n#endif\n}\n\n\nvoid rfbLogPerror(char *str) {\n    rfbLog(\"%s: %s\", str, strerror(errno));\n}\n\n// Some calls fail under older OS X'es so we will do some detected loading\nvoid loadDynamicBundles(BOOL startup) {\n    NSAutoreleasePool *startPool = [[NSAutoreleasePool alloc] init];\n\n    // Setup thisServer structure\n    thisServer.vncServer = vncServerObject;\n    thisServer.desktopName = desktopName;\n    thisServer.rfbPort = rfbPort;\n    thisServer.rfbLocalhostOnly = rfbLocalhostOnly;\n    thisServer.listenerAccepting = listenerAccepting;\n    thisServer.listenerGotNewClient = listenerGotNewClient;\n\n    [[VNCServer sharedServer] rfbStartup: &thisServer];\n\n    [startPool release];\n}\n\nvoid refreshCallback(CGRectCount count, const CGRect *rectArray, void *ignore) {\n    BoxRec box;\n    RegionRec region;\n    rfbClientIteratorPtr iterator;\n    rfbClientPtr cl;\n    int i;\n\n    for (i = 0; i < count; i++) {\n        box.x1 = rectArray[i].origin.x;\n        box.y1 = rectArray[i].origin.y;\n        box.x2 = box.x1 + rectArray[i].size.width;\n        box.y2 = box.y1 + rectArray[i].size.height;\n\n        SAFE_REGION_INIT(&hackScreen, &region, &box, 0);\n\n        iterator = rfbGetClientIterator();\n        while ((cl = rfbClientIteratorNext(iterator)) != NULL) {\n            pthread_mutex_lock(&cl->updateMutex);\n            REGION_UNION(&hackScreen,&cl->modifiedRegion,&cl->modifiedRegion,&region);\n            pthread_mutex_unlock(&cl->updateMutex);\n            pthread_cond_signal(&cl->updateCond);\n        }\n        rfbReleaseClientIterator(iterator);\n\n        REGION_UNINIT(&hackScreen, &region);\n    }\n}\n\n//CGError screenUpdateMoveCallback(CGScreenUpdateMoveDelta delta, CGRectCount count, const CGRect * rectArray, void * userParameter) {\n//    //NSLog(@\"Moved Callback\");\n//    return 0;\n//}\n\nstatic int bitsPerPixelForDisplay(CGDirectDisplayID dispID) {\n    int bitsPerPixel = 0;\n    CGDisplayModeRef mode = CGDisplayCopyDisplayMode(dispID);\n    CFStringRef pixelEncoding = CGDisplayModeCopyPixelEncoding(mode);\n\n    if (!pixelEncoding) {\n        // When off-screen the BPP is not accessible -- 32 is default and works.\n        bitsPerPixel = 32;\n    } else if (CFStringCompare(pixelEncoding, CFSTR(IO32BitDirectPixels),\n                               kCFCompareCaseInsensitive) == kCFCompareEqualTo) {\n        bitsPerPixel = 32;\n    } else if (CFStringCompare(pixelEncoding, CFSTR(IO16BitDirectPixels),\n                               kCFCompareCaseInsensitive) == kCFCompareEqualTo) {\n        bitsPerPixel = 16;\n    } else if (CFStringCompare(pixelEncoding, CFSTR(IO8BitIndexedPixels),\n                               kCFCompareCaseInsensitive) == kCFCompareEqualTo) {\n        bitsPerPixel = 8;\n    }\n    [(id)pixelEncoding release];\n    CGDisplayModeRelease(mode);\n    return bitsPerPixel;\n}\n\nstatic CGFloat scalingFactor(void)\n{\n    CGFloat scale = 1.0;\n    NSScreen *myScreen = [NSScreen mainScreen];\n    if ([myScreen respondsToSelector:@selector(backingScaleFactor)]) {\n        scale = myScreen.backingScaleFactor;\n    }\n    return scale;\n}\n\nstatic void rfbCheckForScreenResolutionChange(void) {\n    BOOL sizeChange = (rfbScreen.width != CGDisplayPixelsWide(displayID) ||\n                       rfbScreen.height != CGDisplayPixelsHigh(displayID));\n    BOOL colorChange = (bitsPerPixelForDisplay(displayID) > 0 && rfbScreen.bitsPerPixel != bitsPerPixelForDisplay(displayID));\n\n    // See if screen changed\n    if (sizeChange || colorChange) {\n        rfbClientIteratorPtr iterator;\n        rfbClientPtr cl = NULL;\n        BOOL screenOK = TRUE;\n        int maxTries = 12;\n\n        // Block listener from accepting new connections while we restart\n        pthread_mutex_lock(&listenerAccepting);\n\n        iterator = rfbGetClientIterator();\n        // Disconnect Existing Clients\n        while ((cl = rfbClientIteratorNext(iterator))) {\n            pthread_mutex_lock(&cl->updateMutex);\n            // Keep locked until after screen change\n        }\n        rfbReleaseClientIterator(iterator);\n\n        do {\n            screenOK = rfbScreenInit();\n        } while (!screenOK && maxTries-- && usleep(2000000)==0);\n        if (!screenOK)\n            exit(1);\n\n        rfbLog(\"Screen geometry changed - (%d,%d) depth: %d\",\n               CGDisplayPixelsWide(displayID),\n               CGDisplayPixelsHigh(displayID),\n               bitsPerPixelForDisplay(displayID));\n\n\n        iterator = rfbGetClientIterator();\n        while ((cl = rfbClientIteratorNext(iterator))) {\n            // Only need to notify them on a SIZE change - other changes just make us re-init\n            if (sizeChange) {\n                if (cl->desktopSizeUpdate) {\n                    BoxRec box;\n                    rfbFramebufferUpdateMsg *fu = (rfbFramebufferUpdateMsg *)cl->updateBuf;\n                    fu->type = rfbFramebufferUpdate;\n                    fu->nRects = Swap16IfLE(1);\n                    cl->ublen = sz_rfbFramebufferUpdateMsg;\n\n                    rfbSendScreenUpdateEncoding(cl);\n\n                    cl->screenBuffer = rfbGetFramebuffer();\n                    if (cl->scalingFactor == 1) {\n                        cl->scalingFrameBuffer = cl->screenBuffer;\n                        cl->scalingPaddedWidthInBytes = rfbScreen.paddedWidthInBytes;\n                    }\n                    else {\n                        const unsigned long csh = (rfbScreen.height+cl->scalingFactor-1)/ cl->scalingFactor;\n                        const unsigned long csw = (rfbScreen.width +cl->scalingFactor-1)/ cl->scalingFactor;\n\n                        // Reset Frame Buffer\n                        free(cl->scalingFrameBuffer);\n                        cl->scalingFrameBuffer = malloc( csw*csh*rfbScreen.bitsPerPixel/8 );\n                        cl->scalingPaddedWidthInBytes = csw * rfbScreen.bitsPerPixel/8;\n                    }\n\n                    box.x1 = box.y1 = 0;\n                    box.x2 = rfbScreen.width;\n                    box.y2 = rfbScreen.height;\n                    REGION_INIT(pScreen,&cl->modifiedRegion,&box,0);\n                    //cl->needNewScreenSize = TRUE;\n                }\n                else\n                    rfbCloseClient(cl);\n            }\n            else {\n                // In theory we shouldn't need to disconnect them but some state in the cl record seems to cause a problem\n                rfbCloseClient(cl);\n                rfbSetTranslateFunction(cl);\n            }\n\n            sleep(2); // We may detect the new depth before OS X has quite finished getting everything ready for it.\n            pthread_mutex_unlock(&cl->updateMutex);\n            pthread_cond_signal(&cl->updateCond);\n        }\n        rfbReleaseClientIterator(iterator);\n\n        // Accept new connections again\n        pthread_mutex_unlock(&listenerAccepting);\n    }\n}\n\nstatic void *clientOutput(void *data) {\n    rfbClientPtr cl = (rfbClientPtr)data;\n    RegionRec updateRegion;\n    Bool haveUpdate = false;\n\n    while (1) {\n        haveUpdate = false;\n\n        pthread_mutex_lock(&cl->updateMutex);\n        while (!haveUpdate) {\n            if (cl->sock == -1) {\n                /* Client has disconnected. */\n                pthread_mutex_unlock(&cl->updateMutex);\n                return NULL;\n            }\n\n            // Check for (and send immediately) pending PB changes\n            rfbClientUpdatePasteboard(cl);\n\n            // Only do checks if we HAVE an outstanding request\n            if (REGION_NOTEMPTY(&hackScreen, &cl->requestedRegion)) {\n                /* REDSTONE */\n                if (rfbDeferUpdateTime > 0 && !cl->immediateUpdate) {\n                    // Compare Request with Update Area\n                    REGION_INIT(&hackScreen, &updateRegion, NullBox, 0);\n                    REGION_INTERSECT(&hackScreen, &updateRegion, &cl->modifiedRegion, &cl->requestedRegion);\n                    haveUpdate = REGION_NOTEMPTY(&hackScreen, &updateRegion);\n\n                    REGION_UNINIT(&hackScreen, &updateRegion);\n                }\n                else {\n                    /*  If we've turned off deferred updating\n                    We are going to send an update as soon as we have a requested,\n                    regardless of if we have a \"change\" intersection */\n                    haveUpdate = TRUE;\n                }\n\n                if (rfbShouldSendNewCursor(cl))\n                    haveUpdate = TRUE;\n                else if (rfbShouldSendNewPosition(cl))\n                    // Could Compare with the request area but for now just always send it\n                    haveUpdate = TRUE;\n                else if (cl->needNewScreenSize)\n                    haveUpdate = TRUE;\n            }\n\n            if (!haveUpdate)\n                pthread_cond_wait(&cl->updateCond, &cl->updateMutex);\n        }\n\n        // OK, now, to save bandwidth, wait a little while for more updates to come along.\n        /* REDSTONE - Lets send it right away if no rfbDeferUpdateTime */\n        if (rfbDeferUpdateTime > 0 && !cl->immediateUpdate && !cl->needNewScreenSize) {\n            pthread_mutex_unlock(&cl->updateMutex);\n            usleep(rfbDeferUpdateTime * 1000);\n            pthread_mutex_lock(&cl->updateMutex);\n        }\n\n        /* Now, get the region we're going to update, and remove\n            it from cl->modifiedRegion _before_ we send the update.\n            That way, if anything that overlaps the region we're sending\n            is updated, we'll be sure to do another update later. */\n        REGION_INIT(&hackScreen, &updateRegion, NullBox, 0);\n        REGION_INTERSECT(&hackScreen, &updateRegion, &cl->modifiedRegion, &cl->requestedRegion);\n        REGION_SUBTRACT(&hackScreen, &cl->modifiedRegion, &cl->modifiedRegion, &updateRegion);\n        /* REDSTONE - We also want to clear out the requested region, so we don't process\n            graphic updates in previously requested regions */\n        REGION_UNINIT(&hackScreen, &cl->requestedRegion);\n        REGION_INIT(&hackScreen, &cl->requestedRegion,NullBox,0);\n\n        /*  This does happen but it's asynchronous (and slow to occur)\n            what we really want to happen is to just temporarily hide the cursor (while sending to the remote screen)\n            -- It's not even usually there (as it's handled by the display driver - but under certain occasions it does appear\n         displayErr = CGDisplayHideCursor(displayID);\n         if (displayErr != 0)\n         rfbLog(\"Error Hiding Cursor %d\", displayErr);\n         CGDisplayMoveCursorToPoint(displayID, CGPointZero);\n                                            */\n\n        /* Now actually send the update. */\n        rfbSendFramebufferUpdate(cl, updateRegion);\n        /* If we were hiding it before make it reappear now\n            displayErr = CGDisplayShowCursor(displayID);\n        if (displayErr != 0)\n            rfbLog(\"Error Showing Cursor %d\", displayErr);\n        */\n\n        REGION_UNINIT(&hackScreen, &updateRegion);\n        pthread_mutex_unlock(&cl->updateMutex);\n    }\n\n    return NULL;\n}\n\nvoid *clientInput(void *data) {\n    rfbClientPtr cl = (rfbClientPtr)data;\n    pthread_t output_thread;\n\n    pthread_create(&output_thread, NULL, clientOutput, cl);\n\n    while (1) {\n        [[VNCServer sharedServer] rfbReceivedClientMessage];\n        rfbProcessClientMessage(cl);\n\n        // Some people will connect but not request screen updates - just send events, this will delay registering the CG callback until then\n        if (rfbShouldSendUpdates && REGION_NOTEMPTY(&hackScreen, &cl->requestedRegion)) {\n            @synchronized([VNCServer sharedServer]) { // Registering twice sometimes prevents getting notice on 10.6\n                if (!registered) {\n                    CGError result = CGRegisterScreenRefreshCallback(refreshCallback, NULL);\n                    if (result == kCGErrorSuccess) {\n                        rfbLog(\"Client connected - registering screen update notification\");\n                        [[VNCServer sharedServer] rfbConnect];\n                        //CGScreenRegisterMoveCallback(screenUpdateMoveCallback, NULL);\n                        registered = TRUE;\n                    }\n                    else {\n                        NSLog(@\"Error (%d) registering for Screen Update Notification\", result);\n                    }\n                }\n            }\n        }\n\n        if (cl->sock == -1) {\n            /* Client has disconnected. */\n            break;\n        }\n    }\n\n    /* Get rid of the output thread. */\n    //pthread_mutex_lock(&cl->updateMutex);\n    pthread_cond_signal(&cl->updateCond);\n    //pthread_mutex_unlock(&cl->updateMutex);\n    pthread_join(output_thread, NULL);\n\n    rfbClientConnectionGone(cl);\n\n    return NULL;\n}\n\nvoid rfbStartClientWithFD(int client_fd) {\n    rfbClientPtr cl;\n    pthread_t client_thread;\n    int one=1;\n\n    if (!rfbClientsConnected())\n        rfbCheckForScreenResolutionChange();\n\n    pthread_mutex_lock(&listenerAccepting);\n\n    if (setsockopt(client_fd, IPPROTO_TCP, TCP_NODELAY, (void *)&one, sizeof(one)) < 0)\n        rfbLogPerror(\"setsockopt TCP_NODELAY failed\");\n\n    rfbUndim();\n    cl = rfbNewClient(client_fd);\n\n    pthread_create(&client_thread, NULL, clientInput, (void *)cl);\n\n    pthread_mutex_unlock(&listenerAccepting);\n    pthread_cond_signal(&listenerGotNewClient);\n}\n\nstatic void *listenerRun(void *ignore) {\n    int listen_fd4=0, client_fd=0;\n    int value=1;  // Need to pass a ptr to this\n    struct sockaddr_in sin4, peer4;\n    unsigned int len4=sizeof(sin4);\n\n    // Must register IPv6 first otherwise it seems to clear our unique binding for IPv4 portNum\n    [[VNCServer sharedServer] rfbRunning];\n\n    // Ok, we are leaving IPv4 binding on even with IPv6 on so that OSXvnc will bind up the port regardless\n    // When both are enabled you can't have another VNC server \"steal\" the IPv4 port\n    if (useIP4) {\n        bzero(&sin4, sizeof(sin4));\n        sin4.sin_len = sizeof(sin4);\n        sin4.sin_family = AF_INET;\n        sin4.sin_port = htons(rfbPort);\n        if (rfbLocalhostOnly)\n            sin4.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n        else\n            sin4.sin_addr.s_addr = htonl(INADDR_ANY);\n\n        if ((listen_fd4 = socket(PF_INET, SOCK_STREAM, 0)) < 0) {\n            rfbLogPerror(\"Unable to open socket\");\n        }\n        else if (nonBlocking && (fcntl(listen_fd4, F_SETFL, O_NONBLOCK) < 0)) {\n            rfbLogPerror(\"fcntl O_NONBLOCK failed\");\n        }\n        else if (setsockopt(listen_fd4, SOL_SOCKET, SO_REUSEADDR, &value, sizeof(value)) < 0) {\n            rfbLogPerror(\"setsockopt SO_REUSEADDR failed\");\n        }\n        else if (bind(listen_fd4, (struct sockaddr *) &sin4, len4) < 0) {\n            rfbLog(\"Failed to bind socket: port %d maybe in use by another VNC\", rfbPort);\n        }\n        else if (listen(listen_fd4, 5) < 0) {\n            rfbLogPerror(\"Listen failed\");\n        }\n        else {\n            rfbLog(\"Started listener thread on IPv4 port %d\", rfbPort);\n\n            // Thread stays here forever unless something goes wrong\n            while (keepRunning) {\n                client_fd = accept(listen_fd4, (struct sockaddr *) &peer4, &len4);\n                if (client_fd != -1)\n                    rfbStartClientWithFD(client_fd);\n                else {\n                    if (errno == EWOULDBLOCK) {\n                        usleep(100000);\n                    }\n                    else {\n                        rfbLog(\"Accept failed %d\", errno);\n                        exit(1);\n                    }\n                }\n            }\n\n            rfbLog(\"Listener thread exiting\");\n            return NULL;\n        }\n\n        if (reverseHost[0] != '\\0') {\n            rfbLog(\"Listener disabled\");\n        }\n        else {\n            exit(250);\n        }\n    }\n    return NULL;\n}\n\nvoid connectReverseClient(char *hostName, int portNum) {\n    pthread_t client_thread;\n    rfbClientPtr cl;\n\n    pthread_mutex_lock(&listenerAccepting);\n    rfbUndim();\n    cl = rfbReverseConnection(hostName, portNum);\n    if (cl) {\n        pthread_create(&client_thread, NULL, clientInput, (void *)cl);\n        pthread_mutex_unlock(&listenerAccepting);\n        pthread_cond_signal(&listenerGotNewClient);\n    }\n    else {\n        pthread_mutex_unlock(&listenerAccepting);\n    }\n}\n\nstatic NSMutableData *frameBufferData;\nstatic size_t frameBufferBytesPerRow;\nstatic size_t frameBufferBitsPerPixel;\n\nchar *rfbGetFramebuffer(void) {\n    if (floor(NSAppKitVersionNumber) > floor(NSAppKitVersionNumber10_6)) {\n        if (!frameBufferData) {\n            CGImageRef imageRef;\n            if (displayScale > 1.0) {\n                // Retina display.\n                size_t width = rfbScreen.width;\n                size_t height = rfbScreen.height;\n                CGImageRef image = CGDisplayCreateImage(displayID);\n                CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);\n                CGContextRef context = CGBitmapContextCreate(NULL, width, height,\n                                                             CGImageGetBitsPerComponent(image),\n                                                             CGImageGetBytesPerRow(image),\n                                                             colorspace,\n                                                             kCGImageAlphaNoneSkipLast);\n\n                CGColorSpaceRelease(colorspace);\n                if (context == NULL) {\n                    CGImageRelease(image);\n                    rfbLog(\"There was an error getting screen shot\");\n                    return nil;\n                }\n                CGContextDrawImage(context, CGRectMake(0, 0, width, height), image);\n                imageRef = CGBitmapContextCreateImage(context);\n                CGContextRelease(context);\n                CGImageRelease(image);\n            } else {\n                imageRef = CGDisplayCreateImage(displayID);\n            }\n            CGDataProviderRef dataProvider = CGImageGetDataProvider (imageRef);\n            CFDataRef dataRef = CGDataProviderCopyData(dataProvider);\n            frameBufferBytesPerRow = CGImageGetBytesPerRow(imageRef);\n            frameBufferBitsPerPixel = CGImageGetBitsPerPixel(imageRef);\n            frameBufferData = [(NSData *)dataRef mutableCopy];\n            CFRelease(dataRef);\n\n            if (imageRef != NULL)\n                CGImageRelease(imageRef);\n        }\n        return frameBufferData.mutableBytes;\n    }\n    else { // Old API is required for off screen user sessions\n        int maxWait =   5000000;\n        int retryWait =  500000;\n\n        char *returnValue = (char *)CGDisplayBaseAddress(displayID);\n        while (!returnValue && maxWait > 0) {\n            NSLog(@\"Unable to obtain base address\");\n            usleep(retryWait); // Buffer goes away while screen is \"switching\", it'll be back\n            maxWait -= retryWait;\n            returnValue = (char *)CGDisplayBaseAddress(displayID);\n        }\n        if (!returnValue) {\n            NSLog(@\"Unable to obtain base address -- Giving up\");\n            exit(1);\n        }\n\n        return returnValue;\n    }\n}\n\n// Called to get record updates of the requested region into our framebuffer\nvoid rfbGetFramebufferUpdateInRect(int x, int y, int w, int h) {\n    if (frameBufferData) {\n        CGRect rect = CGRectMake (x,y,w,h);\n        CGImageRef imageRef;\n        if (displayScale > 1.0) {\n            // Retina display.\n            CGImageRef image = CGDisplayCreateImageForRect(displayID, rect);\n            CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();\n            CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipFirst;\n            CGContextRef context = CGBitmapContextCreate(NULL, w, h, 8, w * 4,colorspace, bitmapInfo);\n            CGColorSpaceRelease(colorspace);\n            if (context == NULL) {\n                CGImageRelease(image);\n                rfbLog(\"There was an error getting scaled images\");\n                return;\n            }\n            CGContextDrawImage(context, CGRectMake(0, 0, w, h), image);\n            CGImageRelease(image);\n            imageRef = CGBitmapContextCreateImage(context);\n            CGContextRelease(context);\n            \n        } else {\n            imageRef = CGDisplayCreateImageForRect(displayID, rect);\n        }\n        CGDataProviderRef dataProvider = CGImageGetDataProvider (imageRef);\n        CFDataRef dataRef = CGDataProviderCopyData(dataProvider);\n        size_t imgBytesPerRow = CGImageGetBytesPerRow(imageRef);\n        size_t imgBitsPerPixel = CGImageGetBitsPerPixel(imageRef);\n        if (imgBitsPerPixel != frameBufferBitsPerPixel)\n            NSLog(@\"BitsPerPixel MISMATCH: frameBuffer %zu, rect image %zu\", frameBufferBitsPerPixel, imgBitsPerPixel);\n\n        char *dest = (char *)frameBufferData.mutableBytes + frameBufferBytesPerRow * y + x * (frameBufferBitsPerPixel/8);\n        const char *source = ((NSData *)dataRef).bytes;\n\n        while (h--) {\n            memcpy(dest, source, w*(imgBitsPerPixel/8));\n            dest += frameBufferBytesPerRow;\n            source += imgBytesPerRow;\n        }\n\n        if (imageRef != NULL)\n            CGImageRelease(imageRef);\n        [(id)dataRef release];\n    }\n}\n\nstatic bool rfbScreenInit(void) {\n    /* Note: As of 10.7 there doesn't appear to be an easy way to get the bitsPerSample or samplesPerPixel of the screen buffer. It looks like that information may be in the bitsPerComponent and componentCount elements of the IOPixelInformation structure. But we'd have to get into poorly-documented IOKit functions to get it. It seems very unlikely that it will be anything other than 8 bits and 3 samples, and in any case we're not really prepared to handle anything else, so the best we could do is die gracefully. Now we are likely to die ungracefully (or maybe just produce garbage) if the screen buffer is in a different format.\n     */\n    int bitsPerSample = 8; // Let's presume 8 bits x 3 samples and hope for the best.....\n    int samplesPerPixel = 3;\n\n    [frameBufferData release]; // release previous screen buffer, if any\n    frameBufferData = nil;\n\n    if (displayID == 0) {\n        // The display was not selected up to now, so choose the main display.\n        displayID = CGMainDisplayID();\n    }\n\n    if (samplesPerPixel != 3) {\n        rfbLog(\"screen format not supported\");\n        return FALSE;\n    }\n\n    displayScale = scalingFactor();\n    if (displayScale > 1.0) {\n        // Retina display.\n        rfbLog(\"Detected HiDPI Display with scaling factor of %f\", displayScale);\n    }\n\n    rfbScreen.width = CGDisplayPixelsWide(displayID);\n    rfbScreen.height = CGDisplayPixelsHigh(displayID);\n    rfbScreen.bitsPerPixel = bitsPerPixelForDisplay(displayID);\n    rfbScreen.depth = samplesPerPixel * bitsPerSample;\n    //Fix for Yosemite and above\n    if (floor(NSAppKitVersionNumber) > floor(NSAppKitVersionNumber10_6)) {\n        CGImageRef imageRef;\n        // Check to see if retina display.\n        if (displayScale > 1.0) {\n            size_t width = rfbScreen.width;\n            size_t height = rfbScreen.height;\n            CGImageRef image = CGDisplayCreateImage(displayID);\n            CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);\n            CGContextRef context = CGBitmapContextCreate(NULL, width, height,\n                                                         CGImageGetBitsPerComponent(image),\n                                                         CGImageGetBytesPerRow(image),\n                                                         colorspace,\n                                                         kCGImageAlphaNoneSkipLast);\n\n            CGColorSpaceRelease(colorspace);\n            if (context == NULL) {\n                CGImageRelease(image);\n                rfbLog(\"There was an error getting screen shot\");\n                return nil;\n            }\n            CGContextDrawImage(context, CGRectMake(0, 0, width, height), image);\n            CGImageRelease(image);\n            imageRef = CGBitmapContextCreateImage(context);\n            CGContextRelease(context);\n            \n        } else {\n            imageRef = CGDisplayCreateImage(displayID);\n        }\n        rfbScreen.paddedWidthInBytes = CGImageGetBytesPerRow(imageRef);\n        if (imageRef != NULL)\n            CGImageRelease(imageRef);\n    }\n    else {\n        rfbScreen.paddedWidthInBytes = CGDisplayBytesPerRow(displayID);\n    }\n    rfbServerFormat.bitsPerPixel = rfbScreen.bitsPerPixel;\n    rfbServerFormat.depth = rfbScreen.depth;\n    rfbServerFormat.trueColour = TRUE;\n\n    rfbServerFormat.redMax = (1 << bitsPerSample) - 1;\n    rfbServerFormat.greenMax = (1 << bitsPerSample) - 1;\n    rfbServerFormat.blueMax = (1 << bitsPerSample) - 1;\n\n    if (littleEndian)\n        rfbLog(\"Running in Little Endian\");\n    else\n        rfbLog(\"Running in Big Endian\");\n\n    rfbServerFormat.bigEndian = !littleEndian;\n    rfbServerFormat.redShift = bitsPerSample * 2;\n    rfbServerFormat.greenShift = bitsPerSample * 1;\n    rfbServerFormat.blueShift = bitsPerSample * 0;\n\n    /* We want to use the X11 REGION_* macros without having an actual\n        X11 ScreenPtr, so we do this.  Pretty ugly, but at least it lets us\n        avoid hacking up regionstr.h, or changing every call to REGION_* */\n    hackScreen.RegionCreate = miRegionCreate;\n    hackScreen.RegionInit = miRegionInit;\n    hackScreen.RegionCopy = miRegionCopy;\n    hackScreen.RegionDestroy = miRegionDestroy;\n    hackScreen.RegionUninit = miRegionUninit;\n    hackScreen.Intersect = miIntersect;\n    hackScreen.Union = miUnion;\n    hackScreen.Subtract = miSubtract;\n    hackScreen.Inverse = miInverse;\n    hackScreen.RegionReset = miRegionReset;\n    hackScreen.TranslateRegion = miTranslateRegion;\n    hackScreen.RectIn = miRectIn;\n    hackScreen.PointInRegion = miPointInRegion;\n    hackScreen.RegionNotEmpty = miRegionNotEmpty;\n    hackScreen.RegionEmpty = miRegionEmpty;\n    hackScreen.RegionExtents = miRegionExtents;\n    hackScreen.RegionAppend = miRegionAppend;\n    hackScreen.RegionValidate = miRegionValidate;\n\n    return TRUE;\n}\n\nstatic void usage(void) {\n    printf(\n        \"\\nAvailable options:\\n\\n\"\n\n        \"-rfbport port          TCP port for RFB protocol (0=autodetect first open port 5900-5909)\\n\"\n        \"-rfbwait time          Maximum time in ms to wait for RFB client\\n\"\n        \"-rfbnoauth             Run the server without password protection\\n\"\n        \"-rfbauth passwordFile  Use this password file for VNC authentication\\n\"\n        \"                       (use 'storepasswd' to create a password file)\\n\"\n        \"-rfbpass               Supply a password directly to the server\\n\"\n        \"-maxauthattempts num   Maximum number of auth tries before disabling access from a host\\n\"\n        \"                       (default: 5), zero disables\\n\"\n        \"-deferupdate time      Time in ms to defer updates (default %d)\\n\"\n        \"-desktop name          VNC desktop name (default: host name)\\n\"\n        \"-alwaysshared          Always treat new clients as shared\\n\"\n        \"-nevershared           Never treat new clients as shared\\n\"\n        \"-dontdisconnect        Don't disconnect existing clients when a new non-shared\\n\"\n        \"                       connection comes in (refuse new connection instead)\\n\"\n        \"-nodimming             Never allow the display to dim\\n\"\n        \"                       (default: display can dim, input undims)\\n\"\n        \"-maxdepth bits         Maximum allowed bit depth for connecting clients (32, 16, 8).\\n\"\n        \"                       (default: bit depth of display)\\n\"\n#if 0\n        \"-reversemods           reverse the interpretation of control\\n\"\n        \"                       and command (for windows clients)\\n\"\n#endif\n        \"-allowsleep            Allow machine to sleep\\n\"\n        \"                       (default: sleep is disabled)\\n\"\n        \"-disableScreenSaver    Disable screen saver while users are connected\\n\"\n        \"                       (default: no, allow screen saver to engage)\\n\"\n        \"-swapButtons           Swap mouse buttons 2 & 3\\n\"\n        \"                       (default: yes)\\n\"\n        \"-dontswapButtons       Disable swap mouse buttons 2 & 3\\n\"\n        \"                       (default: no)\\n\"\n        \"-disableRemoteEvents   Ignore remote keyboard, pointer, and clipboard event\\n\"\n        \"                       (default: no, process them)\\n\"\n        \"-disableRichClipboards Don't share rich clipboard events\\n\"\n        \"                       (default: no, process them)\\n\"\n        \"-connectHost host      Host name or IP of listening client to establish a reverse connect\\n\"\n        \"-connectPort port      TCP port of listening client to establish a reverse connect\\n\"\n        \"                       (default: 5500)\\n\"\n        \"-noupdates             Prevent registering for screen updates, for use with x2vnc or win2vnc\\n\"\n        \"-protocol protocol     Force a particular RFB protocol version (eg 3.3)\\n\"\n        \"                       (default: %u.%u)\\n\"\n        \"-bigEndian             Force big-endian mode (PPC)\\n\"\n        \"                       (default: detect)\\n\"\n        \"-littleEndian          Force little-endian mode (INTEL)\\n\"\n        \"                       (default: detect)\\n\"\n\n        \"-display DisplayID     displayID to indicate which display to serve\\n\",\n        rfbDeferUpdateTime,\n        rfbProtocolMajorVersion, rfbProtocolMinorVersion\n    );\n    {\n        CGDisplayCount displayCount;\n        CGDirectDisplayID activeDisplays[100];\n        int index;\n\n        CGGetActiveDisplayList(100, activeDisplays, &displayCount);\n\n        for (index = 0; index < displayCount; index++) {\n            printf(\"                       %d = (%zu, %zu)\\n\",\n                   index,\n                   CGDisplayPixelsWide(activeDisplays[index]),\n                   CGDisplayPixelsHigh(activeDisplays[index]));\n        }\n    }\n\n    printf(\n        \"-localhost             Only allow connections from the same machine,\\n\"\n        \"                       literally localhost (127.0.0.1)\\n\"\n        \"                       If you use SSH and want to stop non-SSH connections from any other hosts\\n\"\n        \"                       (default: no, allow remote connections)\\n\"\n        \"-restartonuserswitch flag\\n\"\n        \"                       For use on Panther 10.3 systems, this will cause the\\n\"\n        \"                       server to restart when a fast user switch occurs\\n\"\n        \"                       (default: no)\\n\"\n        \"-disableLog            Don't log anything in console\\n\"\n    );\n    [[VNCServer sharedServer] rfbUsage];\n    printf(\"\\n\");\n\n    exit(255);\n}\n\nstatic void checkForUsage(int argc, char *argv[]) {\n    int i;\n\n    for (i = 1; i < argc; i++) {\n        if (strncmp(argv[i], \"-h\", 2) == 0 ||\n            strncmp(argv[i], \"-H\", 2) == 0 ||\n            strncmp(argv[i], \"--h\", 3) == 0 ||\n            strncmp(argv[i], \"--H\", 3) == 0 ||\n            strncmp(argv[i], \"-usage\", 6) == 0 ||\n            strncmp(argv[i], \"--usage\", 7) == 0 ||\n            strcmp(argv[i], \"-?\") == 0) {\n            loadDynamicBundles(FALSE);\n            usage();\n        }\n    }\n}\n\nstatic void processArguments(int argc, char *argv[]) {\n    char argString[1024] = \"Arguments:\";\n    int i, j;\n\n    for (i = 1; i < argc; i++) {\n        strcat(argString, \" \");\n        strcat(argString, argv[i]);\n    }\n    rfbLog(argString);\n\n    for (i = 1; i < argc; i++) {\n        // Lowercase it\n        for (j=0;j<strlen(argv[i]);j++)\n            argv[i][j] = tolower(argv[i][j]);\n\n        if (strcmp(argv[i], \"-rfbport\") == 0) { // -rfbport port\n            if (i + 1 >= argc) usage();\n            rfbPort = atoi(argv[++i]);\n        } else if (strcmp(argv[i], \"-protocol\") == 0) { // -rfbport port\n            double protocol;\n            if (i + 1 >= argc) usage();\n            protocol = atof(argv[++i]);\n            rfbProtocolMajorVersion = MIN(rfbProtocolMajorVersion, floor(protocol));\n            protocol = protocol-floor(protocol); // Now just the fractional part\n                                                 // Ok some folks think of it as 3.3 others as 003.003, so let's repeat...\n            while (protocol > 0 && protocol < 1)\n                protocol *= 10;\n            rfbProtocolMinorVersion = MIN(rfbProtocolMinorVersion, rint(protocol));\n            rfbLog(\"Forcing: %u.%u\",\n                   rfbProtocolMajorVersion, rfbProtocolMinorVersion);\n        } else if (strcmp(argv[i], \"-rfbwait\") == 0) {  // -rfbwait ms\n            if (i + 1 >= argc) usage();\n            rfbMaxClientWait = atoi(argv[++i]);\n        } else if (strcmp(argv[i], \"-rfbnoauth\") == 0) {\n            allowNoAuth = TRUE;\n            rfbLog(\"Warning: No Auth specified, running with no password protection\");\n        } else if (strcmp(argv[i], \"-rfbauth\") == 0) {  // -rfbauth passwd-file\n            if (i + 1 >= argc) usage();\n            rfbAuthPasswdFile = argv[++i];\n        } else if (strcmp(argv[i], \"-rfbpass\") == 0) {  // -rfbauth passwd-file\n            if (i + 1 >= argc) usage();\n            if (!enterSuppliedPassword(argv[++i])) {\n                rfbLog(\"ERROR: The supplied password failed to initialize.  Now exiting!!\");\n                exit (255);\n            }else{\n                didSupplyPass=TRUE;\n            }\n        } else if (strcmp(argv[i], \"-maxauthattempts\") == 0) {\n            if (i + 1 >= argc) usage();\n            rfbMaxLoginAttempts = atoi(argv[++i]);\n        } else if (strcmp(argv[i], \"-connecthost\") == 0) {  // -connect host\n            if (i + 1 >= argc) usage();\n            strncpy(reverseHost, argv[++i], 255);\n            if (reverseHost[0] == '\\0') usage();\n        } else if (strcmp(argv[i], \"-connectport\") == 0) {  // -connect host\n            if (i + 1 >= argc) usage();\n            reversePort = atoi(argv[++i]);\n        } else if (strcmp(argv[i], \"-deferupdate\") == 0) {  // -deferupdate ms\n            if (i + 1 >= argc) usage();\n            rfbDeferUpdateTime = atoi(argv[++i]);\n        } else if (strcmp(argv[i], \"-maxdepth\") == 0) {  // -maxdepth\n            if (i + 1 >= argc) usage();\n            rfbMaxBitDepth = atoi(argv[++i]);\n            switch (rfbMaxBitDepth) {\n                case 24:\n                    rfbMaxBitDepth = 32;\n                    break;\n                case 32:\n                case 16:\n                case 8:\n                    break;\n                default:\n                    rfbLog(\"Invalid maxDepth\");\n                    exit(-1);\n                    break;\n            }\n        } else if (strcmp(argv[i], \"-desktop\") == 0) {  // -desktop desktop-name\n            if (i + 1 >= argc) usage();\n            strncpy(desktopName, argv[++i], 255);\n        } else if (strcmp(argv[i], \"-display\") == 0) {  // -display DisplayID\n            CGDisplayCount displayCount;\n            CGDirectDisplayID activeDisplays[100];\n\n            CGGetActiveDisplayList(100, activeDisplays, &displayCount);\n\n            if (i + 1 >= argc || atoi(argv[i+1]) >= displayCount)\n                usage();\n\n            displayID = activeDisplays[atoi(argv[++i])];\n        } else if (strcmp(argv[i], \"-alwaysshared\") == 0) {\n            rfbAlwaysShared = TRUE;\n        } else if (strcmp(argv[i], \"-nevershared\") == 0) {\n            rfbNeverShared = TRUE;\n        } else if (strcmp(argv[i], \"-dontdisconnect\") == 0) {\n            rfbDontDisconnect = TRUE;\n        } else if (strcmp(argv[i], \"-nodimming\") == 0) {\n            rfbNoDimming = TRUE;\n        } else if (strcmp(argv[i], \"-allowsleep\") == 0) {\n            rfbNoSleep = FALSE;\n        } else if (strcmp(argv[i], \"-reversemods\") == 0) {\n            rfbReverseMods = TRUE;\n        } else if (strcmp(argv[i], \"-disablescreensaver\") == 0) {\n            rfbDisableScreenSaver = TRUE;\n        } else if (strcmp(argv[i], \"-swapbuttons\") == 0) {\n            rfbSwapButtons = TRUE;\n        } else if (strcmp(argv[i], \"-dontswapbuttons\") == 0) {\n            rfbSwapButtons = FALSE;\n        } else if (strcmp(argv[i], \"-disableremoteevents\") == 0) {\n            rfbDisableRemote = TRUE;\n        } else if (strcmp(argv[i], \"-disablerichclipboards\") == 0) {\n            rfbDisableRichClipboards = TRUE;\n        } else if (strcmp(argv[i], \"-localhost\") == 0) {\n            rfbLocalhostOnly = TRUE;\n        } else if (strcmp(argv[i], \"-inhibitevents\") == 0) {\n            rfbInhibitEvents = TRUE;\n        } else if (strcmp(argv[i], \"-noupdates\") == 0) {\n            rfbShouldSendUpdates = FALSE;\n        } else if (strcmp(argv[i], \"-littleendian\") == 0) {\n            littleEndian = TRUE;\n        } else if (strcmp(argv[i], \"-bigendian\") == 0) {\n            littleEndian = FALSE;\n        } else if (strcmp(argv[i], \"-ipv6\") == 0) { // Ok so the code to enable is in the Bundle, but this disables 4\n            useIP4 = FALSE;\n        } else if (strcmp(argv[i], \"-keepregistration\") == 0) {\n            unregisterWhenNoConnections = FALSE;\n        } else if (strcmp(argv[i], \"-dontkeepregistration\") == 0) {\n            unregisterWhenNoConnections = TRUE;\n        } else if (strcmp(argv[i], \"-restartonuserswitch\") == 0) {\n            if (i + 1 >= argc)\n                usage();\n            else {\n                char *argument = argv[++i];\n                restartOnUserSwitch = (argument[0] == 'y' || argument[0] == 'Y' || argument[0] == 't' || argument[0] == 'T' || atoi(argument));\n            }\n        } else if (strcmp(argv[i], \"-disablelog\") == 0) {\n            logEnable = FALSE;\n        } else if (strcmp(argv[i], \"-useopengl\") == 0) {\n            rfbLog(\"OpenGL no longer supported\");\n        }\n    }\n\n    if (!rfbAuthPasswdFile && !allowNoAuth && reverseHost[0] == '\\0' && !didSupplyPass) {\n        rfbLog(\"ERROR: No authentication specified, use -rfbauth passwordfile OR -rfbnoauth\");\n        exit (255);\n    }\n}\n\nvoid rfbShutdown(void) {\n    [[VNCServer sharedServer] rfbShutdown];\n\n    CGUnregisterScreenRefreshCallback(refreshCallback, NULL);\n    //CGDisplayShowCursor(displayID);\n    rfbDimmingShutdown();\n\n    rfbDebugLog(\"Removing Observers\");\n    [[NSWorkspace sharedWorkspace].notificationCenter removeObserver: vncServerObject];\n    [[NSNotificationCenter defaultCenter] removeObserver:vncServerObject];\n    [[NSDistributedNotificationCenter defaultCenter] removeObserver:vncServerObject];\n\n    if (rfbDisableScreenSaver) {\n        /* remove the screensaver timer */\n        RemoveEventLoopTimer(screensaverTimer);\n        DisposeEventLoopTimerUPP(screensaverTimerUPP);\n    }\n\n    if (nonBlocking) {\n        keepRunning = NO;\n        pthread_join(listener_thread,NULL);\n    }\n\n    rfbDebugLog(\"RFB shutdown complete\");\n}\n\nstatic void executeEventLoop (int signal) {\n    pthread_cond_signal(&listenerGotNewClient);\n}\n\nstatic void rfbShutdownOnSignal(int signal) {\n    rfbLog(\"OSXvnc-server received signal: %d\", signal);\n    rfbShutdown();\n\n    if (signal == SIGTERM)\n        exit (0);\n    else\n        exit (signal);\n}\n\nvoid daemonize( void ) {\n    int i;\n\n    // Fork New Process\n    if ( fork() != 0 )\n        exit( 0 );\n\n    // Become session leader\n    setsid();\n\n    // Ignore signals here\n    signal(SIGHUP, SIG_IGN);\n    signal(SIGPIPE, SIG_IGN);\n    // Shutdown on these\n    signal(SIGTERM, rfbShutdownOnSignal);\n    signal(SIGINT, rfbShutdownOnSignal);\n    signal(SIGQUIT, rfbShutdownOnSignal);\n\n    // Fork a second new process\n    if ( fork( ) != 0 )\n        exit( 0 );\n\n    // chdir ( \"/\" );\n    umask( 0 );\n\n    // Close open FDs\n    for ( i = getdtablesize( ) - 1; i > STDERR_FILENO; i-- )\n        close( i );\n\n    /* from this point on we should only send output to server log or syslog */\n}\n\nstatic int scanForOpenPort(void) {\n    int tryPort = 5900;\n    int listen_fd4=0;\n    int value=1;\n    struct sockaddr_in sin4;\n\n    bzero(&sin4, sizeof(sin4));\n    sin4.sin_len = sizeof(sin4);\n    sin4.sin_family = AF_INET;\n\n//    if ([[NSUserDefaults standardUserDefaults] boolForKey:@\"localhostOnly\"])\n//        sin4.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n//    else\n    sin4.sin_addr.s_addr = htonl(INADDR_ANY);\n\n    while (tryPort < 5910) {\n        sin4.sin_port = htons(tryPort);\n\n        if ((listen_fd4 = socket(PF_INET, SOCK_STREAM, 0)) < 0) {\n            //NSLog(@\"Socket init failed %d\", tryPort);\n        }\n        else if (fcntl(listen_fd4, F_SETFL, O_NONBLOCK) < 0) {\n            //rfbLogPerror(\"fcntl O_NONBLOCK failed\");\n        }\n        else if (setsockopt(listen_fd4, SOL_SOCKET, SO_REUSEADDR, &value, sizeof(value)) < 0) {\n            //NSLog(@\"setsockopt SO_REUSEADDR failed %d\", tryPort);\n        }\n        else if (bind(listen_fd4, (struct sockaddr *) &sin4, sizeof(sin4)) < 0) {\n            //NSLog(@\"Failed to bind socket: port %d may be in use by another VNC\", tryPort);\n        }\n        else if (listen(listen_fd4, 5) < 0) {\n            //NSLog(@\"Listen failed %d\", tryPort);\n        }\n        else {\n            close(listen_fd4);\n\n            return tryPort;\n        }\n        close(listen_fd4);\n\n        tryPort++;\n    }\n\n    rfbLog(\"Unable to find open port 5900-5909\");\n\n    return 0;\n}\n\nBOOL runningLittleEndian ( void ) {\n    return (CFByteOrderGetCurrent() == CFByteOrderLittleEndian);\n    /*\n     // rosetta is so complete that it obsucres even CFByteOrderGetCurrent\n    int hasMMX = 0;\n    size_t length = sizeof(hasMMX);\n     // No Error and it does have MMX\n     return (!sysctlbyname(\"hw.optional.mmx\", &hasMMX, &length, NULL, 0) && hasMMX);\n     */\n}\n\nint main(int argc, char *argv[]) {\n    NSAutoreleasePool *tempPool = [[NSAutoreleasePool alloc] init];\n    vncServerObject = [[VNCServer alloc] init];\n    littleEndian = runningLittleEndian();\n    checkForUsage(argc,argv);\n\n    // The bug with unregistering from user updates may have been fixed in 10.4 Tiger\n    if (floor(NSAppKitVersionNumber) > floor(NSAppKitVersionNumber10_3))\n        unregisterWhenNoConnections = TRUE;\n\n    // This guarantees separating us from any terminal -\n    // Right now this causes problems with the keep-alive script and the GUI app (since it causes the process to return right away)\n    // it allows you to survive when launched in SSH, etc but doesn't solves the problem of being killed on GUI logout.\n    // It also doesn't help with any of the pasteboard security issues, those requires secure sessionID's, see:\n    // http://developer.apple.com/documentation/MacOSX/Conceptual/BPMultipleUsers/index.html\n    //\n    // daemonize();\n\n    // Let's not shutdown on a SIGHUP at some point perhaps we can use that to reload configuration\n    signal(SIGHUP, SIG_IGN);\n    signal(SIGPIPE, SIG_IGN);\n    signal(SIGCONT, executeEventLoop);\n    signal(SIGTERM, rfbShutdownOnSignal);\n    signal(SIGINT, rfbShutdownOnSignal);\n    signal(SIGQUIT, rfbShutdownOnSignal);\n\n    pthread_mutex_init(&logMutex, NULL);\n    pthread_mutex_init(&listenerAccepting, NULL);\n    pthread_cond_init(&listenerGotNewClient, NULL);\n\n    [[NSUserDefaults standardUserDefaults] addSuiteNamed:@\"com.redstonesoftware.VineServer\"];\n\n    processArguments(argc, argv);\n\n    if (rfbPort == 0)\n        rfbPort = scanForOpenPort();\n\n    loadDynamicBundles(TRUE);\n\n    // If no desktop name is provided try to get it.\n    if (desktopName[0] == '\\0') {\n        gethostname(desktopName, 256);\n    }\n\n    if (!rfbScreenInit())\n        exit(1);\n\n    rfbClientListInit();\n    rfbDimmingInit();\n    rfbAuthInit();\n    initPasteboard();\n\n    // Register for User Switch Notification\n    // This works on pre-Panther systems since the notification just won't get called.\n    if (restartOnUserSwitch) {\n        [[NSWorkspace sharedWorkspace].notificationCenter addObserver:vncServerObject\n                                                               selector:@selector(userSwitched:)\n                                                                   name: NSWorkspaceSessionDidBecomeActiveNotification\n                                                                 object:nil];\n        [[NSWorkspace sharedWorkspace].notificationCenter addObserver:vncServerObject\n                                                               selector:@selector(userSwitched:)\n                                                                   name: NSWorkspaceSessionDidResignActiveNotification\n                                                                 object:nil];\n    }\n\n    {\n        // Setup Notifications so other Bundles can post user connect\n        [[NSNotificationCenter defaultCenter] addObserver:vncServerObject\n                                                 selector:@selector(clientConnected:)\n                                                     name:@\"NewRFBClient\"\n                                                   object:nil];\n\n        // Setup Notifications so we can add listening hosts\n        [[NSDistributedNotificationCenter defaultCenter] addObserver:vncServerObject\n                                                            selector:@selector(connectHost:)\n                                                                name:@\"VNCConnectHost\"\n                                                              object:[NSString stringWithFormat:@\"OSXvnc%d\", rfbPort]];\n    }\n\n    // Does this need to be in 10.1 and greater (does any of this stuff work in 10.0?)\n    if (!rfbInhibitEvents) {\n        //NSLog(@\"Core Graphics - Event Suppression Turned Off\");\n        // This seems to actually sometimes inhibit REMOTE events as well, but all the same let's let everything pass through for now\n        //        CGSetLocalEventsFilterDuringSupressionState(kCGEventFilterMaskPermitAllEvents, kCGEventSupressionStateSupressionInterval);\n        //        CGSetLocalEventsFilterDuringSupressionState(kCGEventFilterMaskPermitAllEvents, kCGEventSupressionStateRemoteMouseDrag);\n    }\n    // Better to handle this at the event level, see kbdptr.c\n    //CGEnableEventStateCombining(FALSE);\n\n    if (rfbDisableScreenSaver) {\n        /* setup screen saver disabling timer */\n        screensaverTimerUPP = NewEventLoopTimerUPP(rfbScreensaverTimer);\n        InstallEventLoopTimer(GetMainEventLoop(),\n                              kEventDurationSecond * 30,\n                              kEventDurationSecond * 30,\n                              screensaverTimerUPP,\n                              NULL,\n                              &screensaverTimer);\n    }\n\n    nonBlocking = [[NSUserDefaults standardUserDefaults] boolForKey:@\"NonBlocking\"];\n    pthread_create(&listener_thread, NULL, listenerRun, NULL);\n\n    if (reverseHost[0] != '\\0')\n        connectReverseClient(reverseHost, reversePort);\n\n    // This segment is what is responsible for causing the server to shutdown when a user logs out\n    // The problem being that OS X sends it first a SIGTERM and then a SIGKILL (un-trappable)\n    // Presumable because it's running a Carbon Event loop\n    if (1) {\n        OSStatus resultCode = 0;\n\n        while (keepRunning) {\n            // No Clients - go into hibernation\n            if (!rfbClientsConnected()) {\n                pthread_mutex_lock(&listenerAccepting);\n\n                // You would think that there is no point in getting screen updates with no clients connected\n                // But it seems that unregistering but keeping the process (or event loop) around can cause a stuttering behavior in OS X.\n                if (registered && unregisterWhenNoConnections) {\n                    rfbLog(\"UnRegistering screen update notification - waiting for clients\");\n                    CGUnregisterScreenRefreshCallback(refreshCallback, NULL);\n                    [[VNCServer sharedServer] rfbDisconnect];\n                    registered = NO;\n                }\n                else\n                    rfbLog(\"Waiting for clients\");\n\n                pthread_cond_wait(&listenerGotNewClient, &listenerAccepting);\n                pthread_mutex_unlock(&listenerAccepting);\n            }\n            [[VNCServer sharedServer] rfbPoll];\n\n            rfbCheckForPasteboardChange();\n            rfbCheckForCursorChange();\n            rfbCheckForScreenResolutionChange();\n            // Run The Event loop a moment to see if we have a screen update or NSNotification\n            // No better luck with RunApplicationEventLoop() avoiding the shutdown on logout problem\n            resultCode = RunCurrentEventLoop(kEventDurationSecond/30); //EventTimeout\n            if (resultCode != eventLoopTimedOutErr) {\n                rfbLog(\"Received Result: %d during event loop, Shutting Down\", resultCode);\n                keepRunning = NO;\n            }\n        }\n    }\n#if 0\n    else while (1) {\n        // So this looks like it should fix it but I get no response on the CGWaitForScreenRefreshRect....\n        // It doesn't seem to get called at all when not running an event loop\n        CGRectCount rectCount;\n        CGRect *rectArray;\n        CGEventErr result;\n\n        result = CGWaitForScreenRefreshRects( &rectArray, &rectCount );\n        refreshCallback(rectCount, rectArray, NULL);\n        CGReleaseScreenRefreshRects( rectArray );\n    }\n#endif\n\n    [tempPool release];\n\n    rfbShutdown();\n\n    return 0;\n}\n"
  },
  {
    "path": "OSXvnc-server/miregion.c",
    "content": "/***********************************************************\n\nCopyright (c) 1987, 1988, 1989  X Consortium\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of the X Consortium shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from the X Consortium.\n\n\nCopyright 1987, 1988, 1989 by\nDigital Equipment Corporation, Maynard, Massachusetts.\n\n                        All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of Digital not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING\nALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL\nDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR\nANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n******************************************************************/\n/* $XConsortium: miregion.c,v 1.60 94/04/17 20:27:49 dpw Exp $ */\n\n#include <stdio.h>\n#include <stdlib.h>\n#include \"miscstruct.h\"\n#include \"regionstr.h\"\n#include \"Xprotostr.h\"\n#include \"gc.h\"\n\n#if defined (__GNUC__) && !defined (NO_INLINES)\n#define INLINE  __inline\n#else\n#define INLINE\n#endif\n\n/*\n * hack until callers of these functions can deal with out-of-memory\n */\n\nextern Bool Must_have_memory;\n\n#ifdef DEBUG\n#define assert(expr) {if (!(expr)) \\\n                FatalError(\"Assertion failed file %s, line %d: expr\\n\", \\\n                        __FILE__, __LINE__); }\n#else\n#define assert(expr)\n#endif\n\n#define good(reg) assert(miValidRegion(reg))\n\n/*\n * The functions in this file implement the Region abstraction used extensively\n * throughout the X11 sample server. A Region is simply a set of disjoint\n * (non-overlapping) rectangles, plus an \"extent\" rectangle which is the\n * smallest single rectangle that contains all the non-overlapping rectangles.\n *\n * A Region is implemented as a \"y-x-banded\" array of rectangles.  This array\n * imposes two degrees of order.  First, all rectangles are sorted by top side\n * y coordinate first (y1), and then by left side x coordinate (x1).\n *\n * Furthermore, the rectangles are grouped into \"bands\".  Each rectangle in a\n * band has the same top y coordinate (y1), and each has the same bottom y\n * coordinate (y2).  Thus all rectangles in a band differ only in their left\n * and right side (x1 and x2).  Bands are implicit in the array of rectangles:\n * there is no separate list of band start pointers.\n *\n * The y-x band representation does not minimize rectangles.  In particular,\n * if a rectangle vertically crosses a band (the rectangle has scanlines in\n * the y1 to y2 area spanned by the band), then the rectangle may be broken\n * down into two or more smaller rectangles stacked one atop the other.\n *\n *  -----------                             -----------\n *  |         |                             |         |             band 0\n *  |         |  --------                   -----------  --------\n *  |         |  |      |  in y-x banded    |         |  |      |   band 1\n *  |         |  |      |  form is          |         |  |      |\n *  -----------  |      |                   -----------  --------\n *               |      |                                |      |   band 2\n *               --------                                --------\n *\n * An added constraint on the rectangles is that they must cover as much\n * horizontal area as possible: no two rectangles within a band are allowed\n * to touch.\n *\n * Whenever possible, bands will be merged together to cover a greater vertical\n * distance (and thus reduce the number of rectangles). Two bands can be merged\n * only if the bottom of one touches the top of the other and they have\n * rectangles in the same places (of the same width, of course).\n *\n * Adam de Boor wrote most of the original region code.  Joel McCormack\n * substantially modified or rewrote most of the core arithmetic routines,\n * and added miRegionValidate in order to support several speed improvements\n * to miValidateTree.  Bob Scheifler changed the representation to be more\n * compact when empty or a single rectangle, and did a bunch of gratuitous\n * reformatting.\n */\n\n/*  true iff two Boxes overlap */\n#define EXTENTCHECK(r1,r2) \\\n      (!( ((r1)->x2 <= (r2)->x1)  || \\\n          ((r1)->x1 >= (r2)->x2)  || \\\n          ((r1)->y2 <= (r2)->y1)  || \\\n          ((r1)->y1 >= (r2)->y2) ) )\n\n/* true iff (x,y) is in Box */\n#define INBOX(r,x,y) \\\n      ( ((r)->x2 >  x) && \\\n        ((r)->x1 <= x) && \\\n        ((r)->y2 >  y) && \\\n        ((r)->y1 <= y) )\n\n/* true iff Box r1 contains Box r2 */\n#define SUBSUMES(r1,r2) \\\n      ( ((r1)->x1 <= (r2)->x1) && \\\n        ((r1)->x2 >= (r2)->x2) && \\\n        ((r1)->y1 <= (r2)->y1) && \\\n        ((r1)->y2 >= (r2)->y2) )\n\n#define xallocData(n) (RegDataPtr)xalloc(REGION_SZOF(n))\n#define xfreeData(reg) if ((reg)->data && (reg)->data->size) xfree((reg)->data)\n\n#define RECTALLOC(pReg,n) \\\nif (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \\\n    miRectAlloc(pReg, n)\n\n#define ADDRECT(pNextRect,nx1,ny1,nx2,ny2)      \\\n{                                               \\\n    pNextRect->x1 = nx1;                        \\\n    pNextRect->y1 = ny1;                        \\\n    pNextRect->x2 = nx2;                        \\\n    pNextRect->y2 = ny2;                        \\\n    pNextRect++;                                \\\n}\n\n#define NEWRECT(pReg,pNextRect,nx1,ny1,nx2,ny2)                 \\\n{                                                                       \\\n    if (!(pReg)->data || ((pReg)->data->numRects == (pReg)->data->size))\\\n    {                                                                   \\\n        miRectAlloc(pReg, 1);                                           \\\n        pNextRect = REGION_TOP(pReg);                                   \\\n    }                                                                   \\\n    ADDRECT(pNextRect,nx1,ny1,nx2,ny2);                                 \\\n    pReg->data->numRects++;                                             \\\n    assert(pReg->data->numRects<=pReg->data->size);                     \\\n}\n\n\n#define DOWNSIZE(reg,numRects)                                           \\\nif (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \\\n{                                                                        \\\n    RegDataPtr NewData;                                                  \\\n    NewData = (RegDataPtr)xrealloc((reg)->data, REGION_SZOF(numRects));  \\\n    if (NewData)                                                         \\\n    {                                                                    \\\n        NewData->size = (numRects);                                      \\\n        (reg)->data = NewData;                                           \\\n    }                                                                    \\\n}\n\n\nBoxRec miEmptyBox = {0, 0, 0, 0};\nRegDataRec miEmptyData = {0, 0};\n\n#ifdef DEBUG\nint\nmiPrintRegion(rgn)\n    RegionPtr rgn;\n{\n    int num, size;\n    register int i;\n    BoxPtr rects;\n\n    num = REGION_NUM_RECTS(rgn);\n    size = REGION_SIZE(rgn);\n    rects = REGION_RECTS(rgn);\n    ErrorF(\"num: %d size: %d\\n\", num, size);\n    ErrorF(\"extents: %d %d %d %d\\n\",\n           rgn->extents.x1, rgn->extents.y1, rgn->extents.x2, rgn->extents.y2);\n    for (i = 0; i < num; i++)\n      ErrorF(\"%d %d %d %d\\n\",\n             rects[i].x1, rects[i].y1, rects[i].x2, rects[i].y2);\n    ErrorF(\"\\n\");\n    return(num);\n}\n\n\nBool\nmiRegionsEqual(reg1, reg2)\n    RegionPtr reg1;\n    RegionPtr reg2;\n{\n    int i;\n    BoxPtr rects1, rects2;\n\n    if (reg1->extents.x1 != reg2->extents.x1) return FALSE;\n    if (reg1->extents.x2 != reg2->extents.x2) return FALSE;\n    if (reg1->extents.y1 != reg2->extents.y1) return FALSE;\n    if (reg1->extents.y2 != reg2->extents.y2) return FALSE;\n    if (REGION_NUM_RECTS(reg1) != REGION_NUM_RECTS(reg2)) return FALSE;\n\n    rects1 = REGION_RECTS(reg1);\n    rects2 = REGION_RECTS(reg2);\n    for (i = 0; i != REGION_NUM_RECTS(reg1); i++) {\n        if (rects1[i].x1 != rects2[i].x1) return FALSE;\n        if (rects1[i].x2 != rects2[i].x2) return FALSE;\n        if (rects1[i].y1 != rects2[i].y1) return FALSE;\n        if (rects1[i].y2 != rects2[i].y2) return FALSE;\n    }\n    return TRUE;\n}\n\nBool\nmiValidRegion(reg)\n    RegionPtr reg;\n{\n    register int i, numRects;\n\n    if ((reg->extents.x1 > reg->extents.x2) ||\n        (reg->extents.y1 > reg->extents.y2))\n        return FALSE;\n    numRects = REGION_NUM_RECTS(reg);\n    if (!numRects)\n        return ((reg->extents.x1 == reg->extents.x2) &&\n                (reg->extents.y1 == reg->extents.y2) &&\n                (reg->data->size || (reg->data == &miEmptyData)));\n    else if (numRects == 1)\n        return (!reg->data);\n    else\n    {\n        register BoxPtr pboxP, pboxN;\n        BoxRec box;\n\n        pboxP = REGION_RECTS(reg);\n        box = *pboxP;\n        box.y2 = pboxP[numRects-1].y2;\n        pboxN = pboxP + 1;\n        for (i = numRects; --i > 0; pboxP++, pboxN++)\n        {\n            if ((pboxN->x1 >= pboxN->x2) ||\n                (pboxN->y1 >= pboxN->y2))\n                return FALSE;\n            if (pboxN->x1 < box.x1)\n                box.x1 = pboxN->x1;\n            if (pboxN->x2 > box.x2)\n                box.x2 = pboxN->x2;\n            if ((pboxN->y1 < pboxP->y1) ||\n                ((pboxN->y1 == pboxP->y1) &&\n                 ((pboxN->x1 < pboxP->x2) || (pboxN->y2 != pboxP->y2))))\n                return FALSE;\n        }\n        return ((box.x1 == reg->extents.x1) &&\n                (box.x2 == reg->extents.x2) &&\n                (box.y1 == reg->extents.y1) &&\n                (box.y2 == reg->extents.y2));\n    }\n}\n\n#endif /* DEBUG */\n\n\n/*****************************************************************\n *   RegionCreate(rect, size)\n *     This routine does a simple malloc to make a structure of\n *     REGION of \"size\" number of rectangles.\n *****************************************************************/\n\nRegionPtr\nmiRegionCreate(BoxPtr rect, int size)\n{\n    register RegionPtr pReg;\n\n    Must_have_memory = TRUE; /* XXX */\n    pReg = (RegionPtr)xalloc(sizeof(RegionRec));\n    Must_have_memory = FALSE; /* XXX */\n    if (rect)\n    {\n        pReg->extents = *rect;\n        pReg->data = (RegDataPtr)NULL;\n    }\n    else\n    {\n        pReg->extents = miEmptyBox;\n        if ((size > 1) && (pReg->data = xallocData(size)))\n        {\n            pReg->data->size = size;\n            pReg->data->numRects = 0;\n        }\n        else\n            pReg->data = &miEmptyData;\n    }\n    return(pReg);\n}\n\n/*****************************************************************\n *   RegionInit(pReg, rect, size)\n *     Outer region rect is statically allocated.\n *****************************************************************/\n\nvoid\nmiRegionInit(RegionPtr pReg, BoxPtr rect, int size)\n{\n    if (rect)\n    {\n        pReg->extents = *rect;\n        pReg->data = (RegDataPtr)NULL;\n    }\n    else\n    {\n        pReg->extents = miEmptyBox;\n        if ((size > 1) && (pReg->data = xallocData(size)))\n        {\n            pReg->data->size = size;\n            pReg->data->numRects = 0;\n        }\n        else\n            pReg->data = &miEmptyData;\n    }\n}\n\nvoid\nmiRegionDestroy(RegionPtr pReg)\n{\n    good(pReg);\n    xfreeData(pReg);\n    xfree(pReg);\n}\n\nvoid miRegionUninit(RegionPtr pReg)\n{\n    good(pReg);\n    xfreeData(pReg);\n}\n\nBool miRectAlloc(RegionPtr pRgn, int n)\n{\n    Must_have_memory = TRUE; /* XXX */\n    if (!pRgn->data)\n    {\n        n++;\n        pRgn->data = xallocData(n);\n        pRgn->data->numRects = 1;\n        *REGION_BOXPTR(pRgn) = pRgn->extents;\n    }\n    else if (!pRgn->data->size)\n    {\n        pRgn->data = xallocData(n);\n        pRgn->data->numRects = 0;\n    }\n    else\n    {\n        if (n == 1)\n        {\n            n = pRgn->data->numRects;\n            if (n > 500) /* XXX pick numbers out of a hat */\n                n = 250;\n        }\n        n += pRgn->data->numRects;\n        pRgn->data = (RegDataPtr)xrealloc(pRgn->data, REGION_SZOF(n));\n    }\n    Must_have_memory = FALSE; /* XXX */\n    pRgn->data->size = n;\n    return TRUE;\n}\n\nBool\nmiRegionCopy(RegionPtr dst, RegionPtr src)\n{\n    good(dst);\n    good(src);\n    if (dst == src)\n        return TRUE;\n    dst->extents = src->extents;\n    if (!src->data || !src->data->size)\n    {\n        xfreeData(dst);\n        dst->data = src->data;\n        return TRUE;\n    }\n    if (!dst->data || (dst->data->size < src->data->numRects))\n    {\n        xfreeData(dst);\n        Must_have_memory = TRUE; /* XXX */\n        dst->data = xallocData(src->data->numRects);\n        Must_have_memory = FALSE; /* XXX */\n        dst->data->size = src->data->numRects;\n    }\n    dst->data->numRects = src->data->numRects;\n    memmove((char *)REGION_BOXPTR(dst),(char *)REGION_BOXPTR(src),\n          dst->data->numRects * sizeof(BoxRec));\n    return TRUE;\n}\n\n\n/*======================================================================\n *          Generic Region Operator\n *====================================================================*/\n\n/*-\n *-----------------------------------------------------------------------\n * miCoalesce --\n *      Attempt to merge the boxes in the current band with those in the\n *      previous one.  We are guaranteed that the current band extends to\n *      the end of the rects array.  Used only by miRegionOp.\n *\n * Results:\n *      The new index for the previous band.\n *\n * Side Effects:\n *      If coalescing takes place:\n *          - rectangles in the previous band will have their y2 fields\n *            altered.\n *          - pReg->data->numRects will be decreased.\n *\n *-----------------------------------------------------------------------\n */\nINLINE static int\nmiCoalesce (\n    RegionPtr pReg,          /* Region to coalesce                */\n    int       prevStart,     /* Index of start of previous band   */\n    int       curStart       /* Index of start of current band    */\n)\n{\n    register BoxPtr     pPrevBox;       /* Current box in previous band      */\n    register BoxPtr     pCurBox;        /* Current box in current band       */\n    register int        numRects;       /* Number rectangles in both bands   */\n    register int        y2;             /* Bottom of current band            */\n    /*\n     * Figure out how many rectangles are in the band.\n     */\n    numRects = curStart - prevStart;\n    assert(numRects == pReg->data->numRects - curStart);\n\n    if (!numRects) return curStart;\n\n    /*\n     * The bands may only be coalesced if the bottom of the previous\n     * matches the top scanline of the current.\n     */\n    pPrevBox = REGION_BOX(pReg, prevStart);\n    pCurBox = REGION_BOX(pReg, curStart);\n    if (pPrevBox->y2 != pCurBox->y1) return curStart;\n\n    /*\n     * Make sure the bands have boxes in the same places. This\n     * assumes that boxes have been added in such a way that they\n     * cover the most area possible. I.e. two boxes in a band must\n     * have some horizontal space between them.\n     */\n    y2 = pCurBox->y2;\n\n    do {\n        if ((pPrevBox->x1 != pCurBox->x1) || (pPrevBox->x2 != pCurBox->x2)) {\n            return (curStart);\n        }\n        pPrevBox++;\n        pCurBox++;\n        numRects--;\n    } while (numRects);\n\n    /*\n     * The bands may be merged, so set the bottom y of each box\n     * in the previous band to the bottom y of the current band.\n     */\n    numRects = curStart - prevStart;\n    pReg->data->numRects -= numRects;\n    do {\n        pPrevBox--;\n        pPrevBox->y2 = y2;\n        numRects--;\n    } while (numRects);\n    return prevStart;\n}\n\n\n/* Quicky macro to avoid trivial reject procedure calls to miCoalesce */\n\n#define Coalesce(newReg, prevBand, curBand)                             \\\n    if (curBand - prevBand == newReg->data->numRects - curBand) {       \\\n        prevBand = miCoalesce(newReg, prevBand, curBand);               \\\n    } else {                                                            \\\n        prevBand = curBand;                                             \\\n    }\n\n/*-\n *-----------------------------------------------------------------------\n * miAppendNonO --\n *      Handle a non-overlapping band for the union and subtract operations.\n *      Just adds the (top/bottom-clipped) rectangles into the region.\n *      Doesn't have to check for subsumption or anything.\n *\n * Results:\n *      None.\n *\n * Side Effects:\n *      pReg->data->numRects is incremented and the rectangles overwritten\n *      with the rectangles we're passed.\n *\n *-----------------------------------------------------------------------\n */\n\nINLINE static Bool\nmiAppendNonO (RegionPtr pReg, BoxPtr r, BoxPtr rEnd, int y1, int y2)\n{\n    register BoxPtr     pNextRect;\n    ssize_t newRects = rEnd - r;\n\n    assert(y1 < y2);\n    assert(newRects != 0);\n\n    /* Make sure we have enough space for all rectangles to be added */\n    RECTALLOC(pReg, newRects);\n    pNextRect = REGION_TOP(pReg);\n    pReg->data->numRects += newRects;\n    do {\n        assert(r->x1 < r->x2);\n        ADDRECT(pNextRect, r->x1, y1, r->x2, y2);\n        r++;\n    } while (r != rEnd);\n\n    return TRUE;\n}\n\n#define FindBand(r, rBandEnd, rEnd, ry1)                    \\\n{                                                           \\\n    ry1 = r->y1;                                            \\\n    rBandEnd = r+1;                                         \\\n    while ((rBandEnd != rEnd) && (rBandEnd->y1 == ry1)) {   \\\n        rBandEnd++;                                         \\\n    }                                                       \\\n}\n\n#define AppendRegions(newReg, r, rEnd)                                  \\\n{                                                                       \\\n    int newRects;                                                       \\\n    if ((newRects = rEnd - r)) {                                        \\\n        RECTALLOC(newReg, newRects);                                    \\\n        memmove((char *)REGION_TOP(newReg),(char *)r,                   \\\n              newRects * sizeof(BoxRec));                               \\\n        newReg->data->numRects += newRects;                             \\\n    }                                                                   \\\n}\n\n/*-\n *-----------------------------------------------------------------------\n * miRegionOp --\n *      Apply an operation to two regions. Called by miUnion, miInverse,\n *      miSubtract, miIntersect....  Both regions MUST have at least one\n *      rectangle, and cannot be the same object.\n *\n * Results:\n *      TRUE if successful.\n *\n * Side Effects:\n *      The new region is overwritten.\n *      pOverlap set to TRUE if overlapFunc ever returns TRUE.\n *\n * Notes:\n *      The idea behind this function is to view the two regions as sets.\n *      Together they cover a rectangle of area that this function divides\n *      into horizontal bands where points are covered only by one region\n *      or by both. For the first case, the nonOverlapFunc is called with\n *      each the band and the band's upper and lower extents. For the\n *      second, the overlapFunc is called to process the entire band. It\n *      is responsible for clipping the rectangles in the band, though\n *      this function provides the boundaries.\n *      At the end of each band, the new region is coalesced, if possible,\n *      to reduce the number of rectangles in the region.\n *\n *-----------------------------------------------------------------------\n */\nstatic Bool miRegionOp(RegionPtr newReg,           /* Place to store result         */\n                       RegionPtr reg1,             /* First region in operation     */\n                       RegionPtr reg2,             /* 2d region in operation        */\n                       Bool (*overlapFunc)(RegionPtr pReg, BoxPtr r1, BoxPtr r1End,\n                                           BoxPtr r2, BoxPtr r2End,\n                                           short y1, short y2,\n                                           Bool *pOverlap),\n                                                   /* Function to call for over-\n                                                    * lapping bands                 */\n                       Bool appendNon1,            /* Append non-overlapping bands  */\n                                                   /* in region 1 ? */\n                       Bool appendNon2,            /* Append non-overlapping bands  */\n                                                   /* in region 2 ? */\n                       Bool *pOverlap)\n{\n    register BoxPtr r1;                     /* Pointer into first region     */\n    register BoxPtr r2;                     /* Pointer into 2d region        */\n    BoxPtr          r1End;                  /* End of 1st region             */\n    BoxPtr          r2End;                  /* End of 2d region              */\n    short           ybot;                   /* Bottom of intersection        */\n    short           ytop;                   /* Top of intersection           */\n    RegDataPtr      oldData;                /* Old data for newReg           */\n    int             prevBand;               /* Index of start of\n                                             * previous band in newReg       */\n    int             curBand;                /* Index of start of current\n                                             * band in newReg                */\n    register BoxPtr r1BandEnd;              /* End of current band in r1     */\n    register BoxPtr r2BandEnd;              /* End of current band in r2     */\n    short           top;                    /* Top of non-overlapping band   */\n    short           bot;                    /* Bottom of non-overlapping band*/\n    register int    r1y1;                   /* Temps for r1->y1 and r2->y1   */\n    register int    r2y1;\n\n    /*\n     * Initialization:\n     *  set r1, r2, r1End and r2End appropriately, save the rectangles\n     * of the destination region until the end in case it's one of\n     * the two source regions, then mark the \"new\" region empty, allocating\n     * another array of rectangles for it to use.\n     */\n\n    r1 = REGION_RECTS(reg1);\n    int newSize = REGION_NUM_RECTS(reg1);\n    r1End = r1 + newSize;\n    int numRects = REGION_NUM_RECTS(reg2);\n    r2 = REGION_RECTS(reg2);\n    r2End = r2 + numRects;\n    assert(r1 != r1End);\n    assert(r2 != r2End);\n\n    oldData = (RegDataPtr)NULL;\n    if (((newReg == reg1) && (newSize > 1)) ||\n        ((newReg == reg2) && (numRects > 1)))\n    {\n        oldData = newReg->data;\n        newReg->data = &miEmptyData;\n    }\n    /* guess at new size */\n    if (numRects > newSize)\n        newSize = numRects;\n    newSize <<= 1;\n    if (!newReg->data)\n        newReg->data = &miEmptyData;\n    else if (newReg->data->size)\n        newReg->data->numRects = 0;\n    if (newSize > newReg->data->size)\n        miRectAlloc(newReg, newSize);\n\n    /*\n     * Initialize ybot.\n     * In the upcoming loop, ybot and ytop serve different functions depending\n     * on whether the band being handled is an overlapping or non-overlapping\n     * band.\n     *  In the case of a non-overlapping band (only one of the regions\n     * has points in the band), ybot is the bottom of the most recent\n     * intersection and thus clips the top of the rectangles in that band.\n     * ytop is the top of the next intersection between the two regions and\n     * serves to clip the bottom of the rectangles in the current band.\n     *  For an overlapping band (where the two regions intersect), ytop clips\n     * the top of the rectangles of both regions and ybot clips the bottoms.\n     */\n\n    ybot = min(r1->y1, r2->y1);\n\n    /*\n     * prevBand serves to mark the start of the previous band so rectangles\n     * can be coalesced into larger rectangles. qv. miCoalesce, above.\n     * In the beginning, there is no previous band, so prevBand == curBand\n     * (curBand is set later on, of course, but the first band will always\n     * start at index 0). prevBand and curBand must be indices because of\n     * the possible expansion, and resultant moving, of the new region's\n     * array of rectangles.\n     */\n    prevBand = 0;\n\n    do {\n        /*\n         * This algorithm proceeds one source-band (as opposed to a\n         * destination band, which is determined by where the two regions\n         * intersect) at a time. r1BandEnd and r2BandEnd serve to mark the\n         * rectangle after the last one in the current band for their\n         * respective regions.\n         */\n        assert(r1 != r1End);\n        assert(r2 != r2End);\n\n        FindBand(r1, r1BandEnd, r1End, r1y1);\n        FindBand(r2, r2BandEnd, r2End, r2y1);\n\n        /*\n         * First handle the band that doesn't intersect, if any.\n         *\n         * Note that attention is restricted to one band in the\n         * non-intersecting region at once, so if a region has n\n         * bands between the current position and the next place it overlaps\n         * the other, this entire loop will be passed through n times.\n         */\n        if (r1y1 < r2y1) {\n            if (appendNon1) {\n                top = max(r1y1, ybot);\n                bot = min(r1->y2, r2y1);\n                if (top != bot) {\n                    curBand = newReg->data->numRects;\n                    miAppendNonO(newReg, r1, r1BandEnd, top, bot);\n                    Coalesce(newReg, prevBand, curBand);\n                }\n            }\n            ytop = r2y1;\n        } else if (r2y1 < r1y1) {\n            if (appendNon2) {\n                top = max(r2y1, ybot);\n                bot = min(r2->y2, r1y1);\n                if (top != bot) {\n                    curBand = newReg->data->numRects;\n                    miAppendNonO(newReg, r2, r2BandEnd, top, bot);\n                    Coalesce(newReg, prevBand, curBand);\n                }\n            }\n            ytop = r1y1;\n        } else {\n            ytop = r1y1;\n        }\n\n        /*\n         * Now see if we've hit an intersecting band. The two bands only\n         * intersect if ybot > ytop\n         */\n        ybot = min(r1->y2, r2->y2);\n        if (ybot > ytop) {\n            curBand = newReg->data->numRects;\n            (* overlapFunc)(newReg, r1, r1BandEnd, r2, r2BandEnd, ytop, ybot,\n                            pOverlap);\n            Coalesce(newReg, prevBand, curBand);\n        }\n\n        /*\n         * If we've finished with a band (y2 == ybot) we skip forward\n         * in the region to the next band.\n         */\n        if (r1->y2 == ybot) r1 = r1BandEnd;\n        if (r2->y2 == ybot) r2 = r2BandEnd;\n\n    } while (r1 != r1End && r2 != r2End);\n\n    /*\n     * Deal with whichever region (if any) still has rectangles left.\n     *\n     * We only need to worry about banding and coalescing for the very first\n     * band left.  After that, we can just group all remaining boxes,\n     * regardless of how many bands, into one final append to the list.\n     */\n\n    if ((r1 != r1End) && appendNon1) {\n        /* Do first nonOverlap1Func call, which may be able to coalesce */\n        FindBand(r1, r1BandEnd, r1End, r1y1);\n        curBand = newReg->data->numRects;\n        miAppendNonO(newReg, r1, r1BandEnd, max(r1y1, ybot), r1->y2);\n        Coalesce(newReg, prevBand, curBand);\n        /* Just append the rest of the boxes  */\n        AppendRegions(newReg, r1BandEnd, r1End);\n\n    } else if ((r2 != r2End) && appendNon2) {\n        /* Do first nonOverlap2Func call, which may be able to coalesce */\n        FindBand(r2, r2BandEnd, r2End, r2y1);\n        curBand = newReg->data->numRects;\n        miAppendNonO(newReg, r2, r2BandEnd, max(r2y1, ybot), r2->y2);\n        Coalesce(newReg, prevBand, curBand);\n        /* Append rest of boxes */\n        AppendRegions(newReg, r2BandEnd, r2End);\n    }\n\n    if (oldData)\n        xfree(oldData);\n\n    if (!(numRects = newReg->data->numRects))\n    {\n        xfreeData(newReg);\n        newReg->data = &miEmptyData;\n    }\n    else if (numRects == 1)\n    {\n        newReg->extents = *REGION_BOXPTR(newReg);\n        xfreeData(newReg);\n        newReg->data = (RegDataPtr)NULL;\n    }\n    else\n    {\n        DOWNSIZE(newReg, numRects);\n    }\n\n    return TRUE;\n}\n\n/*-\n *-----------------------------------------------------------------------\n * miSetExtents --\n *      Reset the extents of a region to what they should be. Called by\n *      miSubtract and miIntersect as they can't figure it out along the\n *      way or do so easily, as miUnion can.\n *\n * Results:\n *      None.\n *\n * Side Effects:\n *      The region's 'extents' structure is overwritten.\n *\n *-----------------------------------------------------------------------\n */\nvoid miSetExtents(RegionPtr pReg)\n{\n    register BoxPtr pBox, pBoxEnd;\n\n    if (!pReg->data)\n        return;\n    if (!pReg->data->size)\n    {\n        pReg->extents.x2 = pReg->extents.x1;\n        pReg->extents.y2 = pReg->extents.y1;\n        return;\n    }\n\n    pBox = REGION_BOXPTR(pReg);\n    pBoxEnd = REGION_END(pReg);\n\n    /*\n     * Since pBox is the first rectangle in the region, it must have the\n     * smallest y1 and since pBoxEnd is the last rectangle in the region,\n     * it must have the largest y2, because of banding. Initialize x1 and\n     * x2 from  pBox and pBoxEnd, resp., as good things to initialize them\n     * to...\n     */\n    pReg->extents.x1 = pBox->x1;\n    pReg->extents.y1 = pBox->y1;\n    pReg->extents.x2 = pBoxEnd->x2;\n    pReg->extents.y2 = pBoxEnd->y2;\n\n    assert(pReg->extents.y1 < pReg->extents.y2);\n    while (pBox <= pBoxEnd) {\n        if (pBox->x1 < pReg->extents.x1)\n            pReg->extents.x1 = pBox->x1;\n        if (pBox->x2 > pReg->extents.x2)\n            pReg->extents.x2 = pBox->x2;\n        pBox++;\n    };\n\n    assert(pReg->extents.x1 < pReg->extents.x2);\n}\n\n/*======================================================================\n *          Region Intersection\n *====================================================================*/\n/*-\n *-----------------------------------------------------------------------\n * miIntersectO --\n *      Handle an overlapping band for miIntersect.\n *\n * Results:\n *      TRUE if successful.\n *\n * Side Effects:\n *      Rectangles may be added to the region.\n *\n *-----------------------------------------------------------------------\n */\n/*ARGSUSED*/\nstatic Bool miIntersectO(RegionPtr pReg, BoxPtr r1, BoxPtr r1End, BoxPtr r2, BoxPtr r2End, short y1, short y2, Bool *pOverlap)\n{\n    register int        x1;\n    register int        x2;\n    register BoxPtr     pNextRect;\n\n    pNextRect = REGION_TOP(pReg);\n\n    assert(y1 < y2);\n    assert(r1 != r1End && r2 != r2End);\n\n    do {\n        x1 = max(r1->x1, r2->x1);\n        x2 = min(r1->x2, r2->x2);\n\n        /*\n         * If there's any overlap between the two rectangles, add that\n         * overlap to the new region.\n         */\n        if (x1 < x2)\n            NEWRECT(pReg, pNextRect, x1, y1, x2, y2);\n\n        /*\n         * Advance the pointer(s) with the leftmost right side, since the next\n         * rectangle on that list may still overlap the other region's\n         * current rectangle.\n         */\n        if (r1->x2 == x2) {\n            r1++;\n        }\n        if (r2->x2 == x2) {\n            r2++;\n        }\n    } while ((r1 != r1End) && (r2 != r2End));\n\n    return TRUE;\n}\n\n\nBool\nmiIntersect(\n    RegionPtr newReg, /* destination Region */\n    RegionPtr reg1,\n    RegionPtr reg2    /* source regions     */\n)\n{\n    good(reg1);\n    good(reg2);\n    good(newReg);\n   /* check for trivial reject */\n    if (REGION_NIL(reg1)  || REGION_NIL(reg2) ||\n        !EXTENTCHECK(&reg1->extents, &reg2->extents))\n    {\n        /* Covers about 20% of all cases */\n        xfreeData(newReg);\n        newReg->extents.x2 = newReg->extents.x1;\n        newReg->extents.y2 = newReg->extents.y1;\n        newReg->data = &miEmptyData;\n    }\n    else if (!reg1->data && !reg2->data)\n    {\n        /* Covers about 80% of cases that aren't trivially rejected */\n        newReg->extents.x1 = max(reg1->extents.x1, reg2->extents.x1);\n        newReg->extents.y1 = max(reg1->extents.y1, reg2->extents.y1);\n        newReg->extents.x2 = min(reg1->extents.x2, reg2->extents.x2);\n        newReg->extents.y2 = min(reg1->extents.y2, reg2->extents.y2);\n        xfreeData(newReg);\n        newReg->data = (RegDataPtr)NULL;\n    }\n    else if (!reg2->data && SUBSUMES(&reg2->extents, &reg1->extents))\n    {\n        return miRegionCopy(newReg, reg1);\n    }\n    else if (!reg1->data && SUBSUMES(&reg1->extents, &reg2->extents))\n    {\n        return miRegionCopy(newReg, reg2);\n    }\n    else if (reg1 == reg2)\n    {\n        return miRegionCopy(newReg, reg1);\n    }\n    else\n    {\n        /* General purpose intersection */\n        Bool overlap; /* result ignored */\n        if (!miRegionOp(newReg, reg1, reg2, miIntersectO, FALSE, FALSE,\n                        &overlap))\n            return FALSE;\n        miSetExtents(newReg);\n    }\n\n    good(newReg);\n    return(TRUE);\n}\n\n#define MERGERECT(r)                                            \\\n{                                                               \\\n    if (r->x1 <= x2) {                                          \\\n        /* Merge with current rectangle */                      \\\n        if (r->x1 < x2) *pOverlap = TRUE;                               \\\n        if (x2 < r->x2) x2 = r->x2;                             \\\n    } else {                                                    \\\n        /* Add current rectangle, start new one */              \\\n        NEWRECT(pReg, pNextRect, x1, y1, x2, y2);               \\\n        x1 = r->x1;                                             \\\n        x2 = r->x2;                                             \\\n    }                                                           \\\n    r++;                                                        \\\n}\n\n/*======================================================================\n *          Region Union\n *====================================================================*/\n\n/*-\n *-----------------------------------------------------------------------\n * miUnionO --\n *      Handle an overlapping band for the union operation. Picks the\n *      left-most rectangle each time and merges it into the region.\n *\n * Results:\n *      TRUE if successful.\n *\n * Side Effects:\n *      pReg is overwritten.\n *      pOverlap is set to TRUE if any boxes overlap.\n *\n *-----------------------------------------------------------------------\n */\nstatic Bool\nmiUnionO(RegionPtr pReg, BoxPtr r1, BoxPtr r1End,\n         BoxPtr r2, BoxPtr r2End, short y1, short y2, Bool *pOverlap)\n{\n    register BoxPtr     pNextRect;\n    register int        x1;     /* left and right side of current union */\n    register int        x2;\n\n    assert (y1 < y2);\n    assert(r1 != r1End && r2 != r2End);\n\n    pNextRect = REGION_TOP(pReg);\n\n    /* Start off current rectangle */\n    if (r1->x1 < r2->x1)\n    {\n        x1 = r1->x1;\n        x2 = r1->x2;\n        r1++;\n    }\n    else\n    {\n        x1 = r2->x1;\n        x2 = r2->x2;\n        r2++;\n    }\n    while (r1 != r1End && r2 != r2End)\n    {\n        if (r1->x1 < r2->x1) MERGERECT(r1) else MERGERECT(r2);\n    }\n\n    /* Finish off whoever (if any) is left */\n    if (r1 != r1End)\n    {\n        do\n        {\n            MERGERECT(r1);\n        } while (r1 != r1End);\n    }\n    else if (r2 != r2End)\n    {\n        do\n        {\n            MERGERECT(r2);\n        } while (r2 != r2End);\n    }\n\n    /* Add current rectangle */\n    NEWRECT(pReg, pNextRect, x1, y1, x2, y2);\n\n    return TRUE;\n}\n\nBool\nmiUnion(\n    RegionPtr newReg, /* destination Region */\n    RegionPtr reg1,\n    RegionPtr reg2    /* source regions     */\n)\n{\n    Bool overlap; /* result ignored */\n\n    /* Return TRUE if some overlap between reg1, reg2 */\n    good(reg1);\n    good(reg2);\n    good(newReg);\n    /*  checks all the simple cases */\n\n    /*\n     * Region 1 and 2 are the same\n     */\n    if (reg1 == reg2)\n    {\n        return miRegionCopy(newReg, reg1);\n    }\n\n    /*\n     * Region 1 is empty\n     */\n    if (REGION_NIL(reg1))\n    {\n        if (newReg != reg2)\n            return miRegionCopy(newReg, reg2);\n        return TRUE;\n    }\n\n    /*\n     * Region 2 is empty\n     */\n    if (REGION_NIL(reg2))\n    {\n        if (newReg != reg1)\n            return miRegionCopy(newReg, reg1);\n        return TRUE;\n    }\n\n    /*\n     * Region 1 completely subsumes region 2\n     */\n    if (!reg1->data && SUBSUMES(&reg1->extents, &reg2->extents))\n    {\n        if (newReg != reg1)\n            return miRegionCopy(newReg, reg1);\n        return TRUE;\n    }\n\n    /*\n     * Region 2 completely subsumes region 1\n     */\n    if (!reg2->data && SUBSUMES(&reg2->extents, &reg1->extents))\n    {\n        if (newReg != reg2)\n            return miRegionCopy(newReg, reg2);\n        return TRUE;\n    }\n\n    if (!miRegionOp(newReg, reg1, reg2, miUnionO, TRUE, TRUE, &overlap))\n        return FALSE;\n\n    newReg->extents.x1 = min(reg1->extents.x1, reg2->extents.x1);\n    newReg->extents.y1 = min(reg1->extents.y1, reg2->extents.y1);\n    newReg->extents.x2 = max(reg1->extents.x2, reg2->extents.x2);\n    newReg->extents.y2 = max(reg1->extents.y2, reg2->extents.y2);\n    good(newReg);\n    return TRUE;\n}\n\n\n/*======================================================================\n *          Batch Rectangle Union\n *====================================================================*/\n\n/*-\n *-----------------------------------------------------------------------\n * miRegionAppend --\n *\n *      \"Append\" the rgn rectangles onto the end of dstrgn, maintaining\n *      knowledge of YX-banding when it's easy.  Otherwise, dstrgn just\n *      becomes a non-y-x-banded random collection of rectangles, and not\n *      yet a true region.  After a sequence of appends, the caller must\n *      call miRegionValidate to ensure that a valid region is constructed.\n *\n * Results:\n *      TRUE if successful.\n *\n * Side Effects:\n *      dstrgn is modified if rgn has rectangles.\n *\n */\nBool\nmiRegionAppend(RegionPtr dstrgn, RegionPtr rgn)\n{\n    int numRects, dnumRects, size;\n    BoxPtr new, old;\n    Bool prepend;\n\n    if (!rgn->data && (dstrgn->data == &miEmptyData))\n    {\n        dstrgn->extents = rgn->extents;\n        dstrgn->data = (RegDataPtr)NULL;\n        return TRUE;\n    }\n\n    numRects = REGION_NUM_RECTS(rgn);\n    if (!numRects)\n        return TRUE;\n    prepend = FALSE;\n    size = numRects;\n    dnumRects = REGION_NUM_RECTS(dstrgn);\n    if (!dnumRects && (size < 200))\n        size = 200; /* XXX pick numbers out of a hat */\n    RECTALLOC(dstrgn, size);\n    old = REGION_RECTS(rgn);\n    if (!dnumRects)\n        dstrgn->extents = rgn->extents;\n    else if (dstrgn->extents.x2 > dstrgn->extents.x1)\n    {\n        register BoxPtr first, last;\n\n        first = old;\n        last = REGION_BOXPTR(dstrgn) + (dnumRects - 1);\n        if ((first->y1 > last->y2) ||\n            ((first->y1 == last->y1) && (first->y2 == last->y2) &&\n             (first->x1 > last->x2)))\n        {\n            if (rgn->extents.x1 < dstrgn->extents.x1)\n                dstrgn->extents.x1 = rgn->extents.x1;\n            if (rgn->extents.x2 > dstrgn->extents.x2)\n                dstrgn->extents.x2 = rgn->extents.x2;\n            dstrgn->extents.y2 = rgn->extents.y2;\n        }\n        else\n        {\n            first = REGION_BOXPTR(dstrgn);\n            last = old + (numRects - 1);\n            if ((first->y1 > last->y2) ||\n                ((first->y1 == last->y1) && (first->y2 == last->y2) &&\n                 (first->x1 > last->x2)))\n            {\n                prepend = TRUE;\n                if (rgn->extents.x1 < dstrgn->extents.x1)\n                    dstrgn->extents.x1 = rgn->extents.x1;\n                if (rgn->extents.x2 > dstrgn->extents.x2)\n                    dstrgn->extents.x2 = rgn->extents.x2;\n                dstrgn->extents.y1 = rgn->extents.y1;\n            }\n            else\n                dstrgn->extents.x2 = dstrgn->extents.x1;\n        }\n    }\n    if (prepend)\n    {\n        new = REGION_BOX(dstrgn, numRects);\n        if (dnumRects == 1)\n            *new = *REGION_BOXPTR(dstrgn);\n        else\n            memmove((char *)new,(char *)REGION_BOXPTR(dstrgn),\n                  dnumRects * sizeof(BoxRec));\n        new = REGION_BOXPTR(dstrgn);\n    }\n    else\n        new = REGION_BOXPTR(dstrgn) + dnumRects;\n    if (numRects == 1)\n        *new = *old;\n    else\n        memmove((char *)new, (char *)old, numRects * sizeof(BoxRec));\n    dstrgn->data->numRects += numRects;\n    return TRUE;\n}\n\n\n#define ExchangeRects(a, b) \\\n{                           \\\n    BoxRec     t;           \\\n    t = rects[a];           \\\n    rects[a] = rects[b];    \\\n    rects[b] = t;           \\\n}\n\nstatic void\nQuickSortRects(BoxRec rects[], int numRects)\n{\n    register int        y1;\n    register int        x1;\n    register int        i, j;\n    register BoxPtr     r;\n\n    /* Always called with numRects > 1 */\n\n    do\n    {\n        if (numRects == 2)\n        {\n            if (rects[0].y1 > rects[1].y1 ||\n                    (rects[0].y1 == rects[1].y1 && rects[0].x1 > rects[1].x1))\n                ExchangeRects(0, 1);\n            return;\n        }\n\n        /* Choose partition element, stick in location 0 */\n        ExchangeRects(0, numRects >> 1);\n        y1 = rects[0].y1;\n        x1 = rects[0].x1;\n\n        /* Partition array */\n        i = 0;\n        j = numRects;\n        do\n        {\n            r = &(rects[i]);\n            do\n            {\n                r++;\n                i++;\n            } while (i != numRects &&\n                     (r->y1 < y1 || (r->y1 == y1 && r->x1 < x1)));\n            r = &(rects[j]);\n            do\n            {\n                r--;\n                j--;\n            } while (y1 < r->y1 || (y1 == r->y1 && x1 < r->x1));\n            if (i < j)\n                ExchangeRects(i, j);\n        } while (i < j);\n\n        /* Move partition element back to middle */\n        ExchangeRects(0, j);\n\n        /* Recurse */\n        if (numRects-j-1 > 1)\n            QuickSortRects(&rects[j+1], numRects-j-1);\n        numRects = j;\n    } while (numRects > 1);\n}\n\n/*-\n *-----------------------------------------------------------------------\n * miRegionValidate --\n *\n *      Take a ``region'' which is a non-y-x-banded random collection of\n *      rectangles, and compute a nice region which is the union of all the\n *      rectangles.\n *\n * Results:\n *      TRUE if successful.\n *\n * Side Effects:\n *      The passed-in ``region'' may be modified.\n *      pOverlap set to TRUE if any retangles overlapped, else FALSE;\n *\n * Strategy:\n *      Step 1. Sort the rectangles into ascending order with primary key y1\n *              and secondary key x1.\n *\n *      Step 2. Split the rectangles into the minimum number of proper y-x\n *              banded regions.  This may require horizontally merging\n *              rectangles, and vertically coalescing bands.  With any luck,\n *              this step in an identity tranformation (ala the Box widget),\n *              or a coalescing into 1 box (ala Menus).\n *\n *      Step 3. Merge the separate regions down to a single region by calling\n *              miUnion.  Maximize the work each miUnion call does by using\n *              a binary merge.\n *\n *-----------------------------------------------------------------------\n */\n\nBool\nmiRegionValidate(RegionPtr badreg, Bool *pOverlap)\n{\n    /* Descriptor for regions under construction  in Step 2. */\n    typedef struct {\n        RegionRec   reg;\n        int         prevBand;\n        int         curBand;\n    } RegionInfo;\n\n             int        numRects;   /* Original numRects for badreg         */\n             RegionInfo *ri;        /* Array of current regions             */\n             int        numRI;      /* Number of entries used in ri         */\n             int        sizeRI;     /* Number of entries available in ri    */\n             int        i;          /* Index into rects                     */\n    register int        j;          /* Index into ri                        */\n    register RegionInfo *rit;       /* &ri[j]                               */\n    register RegionPtr  reg;        /* ri[j].reg                            */\n    register BoxPtr     box;        /* Current box in rects                 */\n    register BoxPtr     riBox;      /* Last box in ri[j].reg                */\n    register RegionPtr  hreg;       /* ri[j_half].reg                       */\n\n    *pOverlap = FALSE;\n    if (!badreg->data)\n    {\n        good(badreg);\n        return TRUE;\n    }\n    numRects = badreg->data->numRects;\n    if (!numRects)\n    {\n        good(badreg);\n        return TRUE;\n    }\n    if (badreg->extents.x1 < badreg->extents.x2)\n    {\n        if ((numRects) == 1)\n        {\n            xfreeData(badreg);\n            badreg->data = (RegDataPtr) NULL;\n        }\n        else\n        {\n            DOWNSIZE(badreg, numRects);\n        }\n        good(badreg);\n        return TRUE;\n    }\n\n    /* Step 1: Sort the rects array into ascending (y1, x1) order */\n    QuickSortRects(REGION_BOXPTR(badreg), numRects);\n\n    /* Step 2: Scatter the sorted array into the minimum number of regions */\n\n    /* Set up the first region to be the first rectangle in badreg */\n    /* Note that step 2 code will never overflow the ri[0].reg rects array */\n    Must_have_memory = TRUE; /* XXX */\n    ri = (RegionInfo *) xalloc(4 * sizeof(RegionInfo));\n    Must_have_memory = FALSE; /* XXX */\n    sizeRI = 4;\n    numRI = 1;\n    ri[0].prevBand = 0;\n    ri[0].curBand = 0;\n    ri[0].reg = *badreg;\n    box = REGION_BOXPTR(&ri[0].reg);\n    ri[0].reg.extents = *box;\n    ri[0].reg.data->numRects = 1;\n\n    /* Now scatter rectangles into the minimum set of valid regions.  If the\n       next rectangle to be added to a region would force an existing rectangle\n       in the region to be split up in order to maintain y-x banding, just\n       forget it.  Try the next region.  If it doesn't fit cleanly into any\n       region, make a new one. */\n\n    for (i = numRects; --i > 0;)\n    {\n        box++;\n        /* Look for a region to append box to */\n        for (j = numRI, rit = ri; --j >= 0; rit++)\n        {\n            reg = &rit->reg;\n            riBox = REGION_END(reg);\n\n            if (box->y1 == riBox->y1 && box->y2 == riBox->y2)\n            {\n                /* box is in same band as riBox.  Merge or append it */\n                if (box->x1 <= riBox->x2)\n                {\n                    /* Merge it with riBox */\n                    if (box->x1 < riBox->x2) *pOverlap = TRUE;\n                    if (box->x2 > riBox->x2) riBox->x2 = box->x2;\n                }\n                else\n                {\n                    RECTALLOC(reg, 1);\n                    *REGION_TOP(reg) = *box;\n                    reg->data->numRects++;\n                }\n                goto NextRect;   /* So sue me */\n            }\n            else if (box->y1 >= riBox->y2)\n            {\n                /* Put box into new band */\n                if (reg->extents.x2 < riBox->x2) reg->extents.x2 = riBox->x2;\n                if (reg->extents.x1 > box->x1)   reg->extents.x1 = box->x1;\n                Coalesce(reg, rit->prevBand, rit->curBand);\n                rit->curBand = reg->data->numRects;\n                RECTALLOC(reg, 1);\n                *REGION_TOP(reg) = *box;\n                reg->data->numRects++;\n                goto NextRect;\n            }\n            /* Well, this region was inappropriate.  Try the next one. */\n        } /* for j */\n\n        /* Uh-oh.  No regions were appropriate.  Create a new one. */\n        if (sizeRI == numRI)\n        {\n            /* Oops, allocate space for new region information */\n            sizeRI <<= 1;\n            Must_have_memory = TRUE; /* XXX */\n            ri = (RegionInfo *) xrealloc(ri, sizeRI * sizeof(RegionInfo));\n            Must_have_memory = FALSE; /* XXX */\n            rit = &ri[numRI];\n        }\n        numRI++;\n        rit->prevBand = 0;\n        rit->curBand = 0;\n        rit->reg.extents = *box;\n        rit->reg.data = (RegDataPtr)NULL;\n        miRectAlloc(&rit->reg, (i+numRI) / numRI); /* MUST force allocation */\nNextRect: ;\n    } /* for i */\n\n    /* Make a final pass over each region in order to Coalesce and set\n       extents.x2 and extents.y2 */\n\n    for (j = numRI, rit = ri; --j >= 0; rit++)\n    {\n        reg = &rit->reg;\n        riBox = REGION_END(reg);\n        reg->extents.y2 = riBox->y2;\n        if (reg->extents.x2 < riBox->x2) reg->extents.x2 = riBox->x2;\n        Coalesce(reg, rit->prevBand, rit->curBand);\n        if (reg->data->numRects == 1) /* keep unions happy below */\n        {\n            xfreeData(reg);\n            reg->data = (RegDataPtr)NULL;\n        }\n    }\n\n    /* Step 3: Union all regions into a single region */\n    while (numRI > 1)\n    {\n        int half = numRI/2;\n        for (j = numRI & 1; j < (half + (numRI & 1)); j++)\n        {\n            reg = &ri[j].reg;\n            hreg = &ri[j+half].reg;\n            miRegionOp(reg, reg, hreg, miUnionO, TRUE, TRUE, pOverlap);\n            if (hreg->extents.x1 < reg->extents.x1)\n                reg->extents.x1 = hreg->extents.x1;\n            if (hreg->extents.y1 < reg->extents.y1)\n                reg->extents.y1 = hreg->extents.y1;\n            if (hreg->extents.x2 > reg->extents.x2)\n                reg->extents.x2 = hreg->extents.x2;\n            if (hreg->extents.y2 > reg->extents.y2)\n                reg->extents.y2 = hreg->extents.y2;\n            xfreeData(hreg);\n        }\n        numRI -= half;\n    }\n    *badreg = ri[0].reg;\n    xfree(ri);\n    good(badreg);\n    return TRUE;\n}\n\nRegionPtr\nmiRectsToRegion(int nrects, xRectangle *prect, int ctype)\n{\n    register RegionPtr  pRgn;\n    register RegDataPtr pData;\n    register BoxPtr     pBox;\n    register int        i;\n    int                 x1, y1, x2, y2;\n\n    pRgn = miRegionCreate(NullBox, 0);\n    if (!nrects)\n        return pRgn;\n    if (nrects == 1)\n    {\n        x1 = prect->x;\n        y1 = prect->y;\n        if ((x2 = x1 + (int) prect->width) > MAXSHORT)\n            x2 = MAXSHORT;\n        if ((y2 = y1 + (int) prect->height) > MAXSHORT)\n            y2 = MAXSHORT;\n        if (x1 != x2 && y1 != y2)\n        {\n            pRgn->extents.x1 = x1;\n            pRgn->extents.y1 = y1;\n            pRgn->extents.x2 = x2;\n            pRgn->extents.y2 = y2;\n            pRgn->data = (RegDataPtr)NULL;\n        }\n        return pRgn;\n    }\n    Must_have_memory = TRUE; /* XXX */\n    pData = xallocData(nrects);\n    pBox = (BoxPtr) (pData + 1);\n    Must_have_memory = FALSE; /* XXX */\n    for (i = nrects; --i >= 0; prect++)\n    {\n        x1 = prect->x;\n        y1 = prect->y;\n        if ((x2 = x1 + (int) prect->width) > MAXSHORT)\n            x2 = MAXSHORT;\n        if ((y2 = y1 + (int) prect->height) > MAXSHORT)\n            y2 = MAXSHORT;\n        if (x1 != x2 && y1 != y2)\n        {\n            pBox->x1 = x1;\n            pBox->y1 = y1;\n            pBox->x2 = x2;\n            pBox->y2 = y2;\n            pBox++;\n        }\n    }\n    if (pBox != (BoxPtr) (pData + 1))\n    {\n        pData->size = nrects;\n        pData->numRects = pBox - (BoxPtr) (pData + 1);\n        pRgn->data = pData;\n        if (ctype != CT_YXBANDED)\n        {\n            Bool overlap; /* result ignored */\n            pRgn->extents.x1 = pRgn->extents.x2 = 0;\n            miRegionValidate(pRgn, &overlap);\n        }\n        else\n            miSetExtents(pRgn);\n        good(pRgn);\n    }\n    else\n    {\n        xfree (pData);\n    }\n    return pRgn;\n}\n\n/*======================================================================\n *                Region Subtraction\n *====================================================================*/\n\n\n/*-\n *-----------------------------------------------------------------------\n * miSubtractO --\n *      Overlapping band subtraction. x1 is the left-most point not yet\n *      checked.\n *\n * Results:\n *      TRUE if successful.\n *\n * Side Effects:\n *      pReg may have rectangles added to it.\n *\n *-----------------------------------------------------------------------\n */\n/*ARGSUSED*/\nstatic Bool\nmiSubtractO (RegionPtr pReg, BoxPtr r1, BoxPtr r1End,\n             BoxPtr r2, BoxPtr r2End, short y1, short y2, Bool *pOverlap)\n{\n    register BoxPtr     pNextRect;\n    register int        x1;\n\n    x1 = r1->x1;\n\n    assert(y1<y2);\n    assert(r1 != r1End && r2 != r2End);\n\n    pNextRect = REGION_TOP(pReg);\n\n    do\n    {\n        if (r2->x2 <= x1)\n        {\n            /*\n             * Subtrahend entirely to left of minuend: go to next subtrahend.\n             */\n            r2++;\n        }\n        else if (r2->x1 <= x1)\n        {\n            /*\n             * Subtrahend precedes minuend: nuke left edge of minuend.\n             */\n            x1 = r2->x2;\n            if (x1 >= r1->x2)\n            {\n                /*\n                 * Minuend completely covered: advance to next minuend and\n                 * reset left fence to edge of new minuend.\n                 */\n                r1++;\n                if (r1 != r1End)\n                    x1 = r1->x1;\n            }\n            else\n            {\n                /*\n                 * Subtrahend now used up since it doesn't extend beyond\n                 * minuend\n                 */\n                r2++;\n            }\n        }\n        else if (r2->x1 < r1->x2)\n        {\n            /*\n             * Left part of subtrahend covers part of minuend: add uncovered\n             * part of minuend to region and skip to next subtrahend.\n             */\n            assert(x1<r2->x1);\n            NEWRECT(pReg, pNextRect, x1, y1, r2->x1, y2);\n\n            x1 = r2->x2;\n            if (x1 >= r1->x2)\n            {\n                /*\n                 * Minuend used up: advance to new...\n                 */\n                r1++;\n                if (r1 != r1End)\n                    x1 = r1->x1;\n            }\n            else\n            {\n                /*\n                 * Subtrahend used up\n                 */\n                r2++;\n            }\n        }\n        else\n        {\n            /*\n             * Minuend used up: add any remaining piece before advancing.\n             */\n            if (r1->x2 > x1)\n                NEWRECT(pReg, pNextRect, x1, y1, r1->x2, y2);\n            r1++;\n            if (r1 != r1End)\n                x1 = r1->x1;\n        }\n    } while ((r1 != r1End) && (r2 != r2End));\n\n\n    /*\n     * Add remaining minuend rectangles to region.\n     */\n    while (r1 != r1End)\n    {\n        assert(x1<r1->x2);\n        NEWRECT(pReg, pNextRect, x1, y1, r1->x2, y2);\n        r1++;\n        if (r1 != r1End)\n            x1 = r1->x1;\n    }\n    return TRUE;\n}\n\n/*-\n *-----------------------------------------------------------------------\n * miSubtract --\n *      Subtract regS from regM and leave the result in regD.\n *      S stands for subtrahend, M for minuend and D for difference.\n *\n * Results:\n *      TRUE if successful.\n *\n * Side Effects:\n *      regD is overwritten.\n *\n *-----------------------------------------------------------------------\n */\nBool\nmiSubtract(RegionPtr regD, RegionPtr regM, RegionPtr regS)\n{\n    Bool overlap; /* result ignored */\n\n    good(regM);\n    good(regS);\n    good(regD);\n   /* check for trivial rejects */\n    if (REGION_NIL(regM) || REGION_NIL(regS) ||\n        !EXTENTCHECK(&regM->extents, &regS->extents))\n    {\n        return miRegionCopy(regD, regM);\n    }\n    else if (regM == regS)\n    {\n        xfreeData(regD);\n        regD->extents.x2 = regD->extents.x1;\n        regD->extents.y2 = regD->extents.y1;\n        regD->data = &miEmptyData;\n        return TRUE;\n    }\n\n    /* Add those rectangles in region 1 that aren't in region 2,\n       do yucky subtraction for overlaps, and\n       just throw away rectangles in region 2 that aren't in region 1 */\n    if (!miRegionOp(regD, regM, regS, miSubtractO, TRUE, FALSE, &overlap))\n        return FALSE;\n\n    /*\n     * Can't alter RegD's extents before we call miRegionOp because\n     * it might be one of the source regions and miRegionOp depends\n     * on the extents of those regions being unaltered. Besides, this\n     * way there's no checking against rectangles that will be nuked\n     * due to coalescing, so we have to examine fewer rectangles.\n     */\n    miSetExtents(regD);\n    good(regD);\n    return TRUE;\n}\n\n/*======================================================================\n *          Region Inversion\n *====================================================================*/\n\n/*-\n *-----------------------------------------------------------------------\n * miInverse --\n *      Take a region and a box and return a region that is everything\n *      in the box but not in the region. The careful reader will note\n *      that this is the same as subtracting the region from the box...\n *\n * Results:\n *      TRUE.\n *\n * Side Effects:\n *      newReg is overwritten.\n *\n *-----------------------------------------------------------------------\n */\nBool\nmiInverse(\n    RegionPtr     newReg,       /* Destination region */\n    RegionPtr     reg1,         /* Region to invert */\n    BoxPtr        invRect       /* Bounding box for inversion */\n)\n{\n    RegionRec     invReg;       /* Quick and dirty region made from the\n                                 * bounding box */\n    Bool          overlap;      /* result ignored */\n\n    good(reg1);\n    good(newReg);\n   /* check for trivial rejects */\n    if (REGION_NIL(reg1) || !EXTENTCHECK(invRect, &reg1->extents))\n    {\n        newReg->extents = *invRect;\n        xfreeData(newReg);\n        newReg->data = (RegDataPtr)NULL;\n        return TRUE;\n    }\n\n    /* Add those rectangles in region 1 that aren't in region 2,\n       do yucky subtraction for overlaps, and\n       just throw away rectangles in region 2 that aren't in region 1 */\n    invReg.extents = *invRect;\n    invReg.data = (RegDataPtr)NULL;\n    if (!miRegionOp(newReg, &invReg, reg1, miSubtractO, TRUE, FALSE, &overlap))\n        return FALSE;\n\n    /*\n     * Can't alter newReg's extents before we call miRegionOp because\n     * it might be one of the source regions and miRegionOp depends\n     * on the extents of those regions being unaltered. Besides, this\n     * way there's no checking against rectangles that will be nuked\n     * due to coalescing, so we have to examine fewer rectangles.\n     */\n    miSetExtents(newReg);\n    good(newReg);\n    return TRUE;\n}\n\n/*\n *   RectIn(region, rect)\n *   This routine takes a pointer to a region and a pointer to a box\n *   and determines if the box is outside/inside/partly inside the region.\n *\n *   The idea is to travel through the list of rectangles trying to cover the\n *   passed box with them. Anytime a piece of the rectangle isn't covered\n *   by a band of rectangles, partOut is set TRUE. Any time a rectangle in\n *   the region covers part of the box, partIn is set TRUE. The process ends\n *   when either the box has been completely covered (we reached a band that\n *   doesn't overlap the box, partIn is TRUE and partOut is false), the\n *   box has been partially covered (partIn == partOut == TRUE -- because of\n *   the banding, the first time this is true we know the box is only\n *   partially in the region) or is outside the region (we reached a band\n *   that doesn't overlap the box at all and partIn is false)\n */\n\nint\nmiRectIn(RegionPtr region, BoxPtr prect)\n{\n    register int        x;\n    register int        y;\n    register BoxPtr     pbox;\n    register BoxPtr     pboxEnd;\n    int                 partIn, partOut;\n    int                 numRects;\n\n    good(region);\n    numRects = REGION_NUM_RECTS(region);\n    /* useful optimization */\n    if (!numRects || !EXTENTCHECK(&region->extents, prect))\n        return(rgnOUT);\n\n    if (numRects == 1)\n    {\n        /* We know that it must be rgnIN or rgnPART */\n        if (SUBSUMES(&region->extents, prect))\n            return(rgnIN);\n        else\n            return(rgnPART);\n    }\n\n    partOut = FALSE;\n    partIn = FALSE;\n\n    /* (x,y) starts at upper left of rect, moving to the right and down */\n    x = prect->x1;\n    y = prect->y1;\n\n    /* can stop when both partOut and partIn are TRUE, or we reach prect->y2 */\n    for (pbox = REGION_BOXPTR(region), pboxEnd = pbox + numRects;\n         pbox != pboxEnd;\n         pbox++)\n    {\n\n        if (pbox->y2 <= y)\n           continue;    /* getting up to speed or skipping remainder of band */\n\n        if (pbox->y1 > y)\n        {\n           if (partIn || (pbox->y1 >= prect->y2))\n              break;\n           partOut = TRUE;      /* missed part of rectangle above */\n           y = pbox->y1;        /* x guaranteed to be == prect->x1 */\n        }\n\n        if (pbox->x2 <= x)\n           continue;            /* not far enough over yet */\n\n        if (pbox->x1 > x)\n        {\n           if (partIn)\n              break;\n           partOut = TRUE;      /* missed part of rectangle to left */\n        }\n\n        if (pbox->x1 < prect->x2)\n        {\n            partIn = TRUE;      /* definitely overlap */\n            if (partOut)\n               break;\n        }\n\n        if (pbox->x2 >= prect->x2)\n        {\n           y = pbox->y2;        /* finished with this band */\n           if (y >= prect->y2)\n              break;\n           x = prect->x1;       /* reset x out to left again */\n        }\n        else\n        {\n            /*\n             * Because boxes in a band are maximal width, if the first box\n             * to overlap the rectangle doesn't completely cover it in that\n             * band, the rectangle must be partially out, since some of it\n             * will be uncovered in that band. partIn will have been set true\n             * by now...\n             */\n            break;\n        }\n    }\n\n    return(partIn ? ((y < prect->y2) ? rgnPART : rgnIN) : rgnOUT);\n}\n\n/* TranslateRegion(pReg, x, y)\n   translates in place\n*/\n\nvoid\nmiTranslateRegion(RegionPtr pReg, int x, int y)\n{\n    int x1, x2, y1, y2;\n    register int nbox;\n    register BoxPtr pbox;\n\n    good(pReg);\n    pReg->extents.x1 = x1 = pReg->extents.x1 + x;\n    pReg->extents.y1 = y1 = pReg->extents.y1 + y;\n    pReg->extents.x2 = x2 = pReg->extents.x2 + x;\n    pReg->extents.y2 = y2 = pReg->extents.y2 + y;\n    if (((x1 - MINSHORT)|(y1 - MINSHORT)|(MAXSHORT - x2)|(MAXSHORT - y2)) >= 0)\n    {\n        if (pReg->data && (nbox = pReg->data->numRects))\n        {\n            for (pbox = REGION_BOXPTR(pReg); nbox--; pbox++)\n            {\n                pbox->x1 += x;\n                pbox->y1 += y;\n                pbox->x2 += x;\n                pbox->y2 += y;\n            }\n        }\n        return;\n    }\n    if (((x2 - MINSHORT)|(y2 - MINSHORT)|(MAXSHORT - x1)|(MAXSHORT - y1)) <= 0)\n    {\n        pReg->extents.x2 = pReg->extents.x1;\n        pReg->extents.y2 = pReg->extents.y1;\n        xfreeData(pReg);\n        pReg->data = &miEmptyData;\n        return;\n    }\n    if (x1 < MINSHORT)\n        pReg->extents.x1 = MINSHORT;\n    else if (x2 > MAXSHORT)\n        pReg->extents.x2 = MAXSHORT;\n    if (y1 < MINSHORT)\n        pReg->extents.y1 = MINSHORT;\n    else if (y2 > MAXSHORT)\n        pReg->extents.y2 = MAXSHORT;\n    if (pReg->data && (nbox = pReg->data->numRects))\n    {\n        register BoxPtr pboxout;\n\n        for (pboxout = pbox = REGION_BOXPTR(pReg); nbox--; pbox++)\n        {\n            pboxout->x1 = x1 = pbox->x1 + x;\n            pboxout->y1 = y1 = pbox->y1 + y;\n            pboxout->x2 = x2 = pbox->x2 + x;\n            pboxout->y2 = y2 = pbox->y2 + y;\n            if (((x2 - MINSHORT)|(y2 - MINSHORT)|\n                 (MAXSHORT - x1)|(MAXSHORT - y1)) <= 0)\n            {\n                pReg->data->numRects--;\n                continue;\n            }\n            if (x1 < MINSHORT)\n                pboxout->x1 = MINSHORT;\n            else if (x2 > MAXSHORT)\n                pboxout->x2 = MAXSHORT;\n            if (y1 < MINSHORT)\n                pboxout->y1 = MINSHORT;\n            else if (y2 > MAXSHORT)\n                pboxout->y2 = MAXSHORT;\n            pboxout++;\n        }\n        if (pboxout != pbox)\n        {\n            if (pReg->data->numRects == 1)\n            {\n                pReg->extents = *REGION_BOXPTR(pReg);\n                xfreeData(pReg);\n                pReg->data = (RegDataPtr)NULL;\n            }\n            else\n                miSetExtents(pReg);\n        }\n    }\n}\n\nvoid\nmiRegionReset(RegionPtr pReg, BoxPtr pBox)\n{\n    good(pReg);\n    assert(pBox->x1<=pBox->x2);\n    assert(pBox->y1<=pBox->y2);\n    pReg->extents = *pBox;\n    xfreeData(pReg);\n    pReg->data = (RegDataPtr)NULL;\n}\n\nBool\nmiPointInRegion(RegionPtr pReg, int x, int y, BoxPtr box)\n    /* box \"return\" value */\n{\n    register BoxPtr pbox, pboxEnd;\n    long numRects;\n\n    good(pReg);\n    numRects = REGION_NUM_RECTS(pReg);\n    if (!numRects || !INBOX(&pReg->extents, x, y))\n        return(FALSE);\n    if (numRects == 1)\n    {\n        *box = pReg->extents;\n        return(TRUE);\n    }\n    for (pbox = REGION_BOXPTR(pReg), pboxEnd = pbox + numRects;\n         pbox != pboxEnd;\n         pbox++)\n    {\n        if (y >= pbox->y2)\n           continue;            /* not there yet */\n        if ((y < pbox->y1) || (x < pbox->x1))\n           break;               /* missed it */\n        if (x >= pbox->x2)\n           continue;            /* not there yet */\n        *box = *pbox;\n        return(TRUE);\n    }\n    return(FALSE);\n}\n\nBool\nmiRegionNotEmpty(RegionPtr pReg)\n{\n    good(pReg);\n    return(!REGION_NIL(pReg));\n}\n\n\nvoid\nmiRegionEmpty(RegionPtr pReg)\n{\n    good(pReg);\n    xfreeData(pReg);\n    pReg->extents.x2 = pReg->extents.x1;\n    pReg->extents.y2 = pReg->extents.y1;\n    pReg->data = &miEmptyData;\n}\n\nBoxPtr\nmiRegionExtents(RegionPtr pReg)\n{\n    good(pReg);\n    return(&pReg->extents);\n}\n\n#define ExchangeSpans(a, b)                                 \\\n{                                                           \\\n    DDXPointRec     tpt;                                    \\\n    register int    tw;                                     \\\n                                                            \\\n    tpt = spans[a]; spans[a] = spans[b]; spans[b] = tpt;    \\\n    tw = widths[a]; widths[a] = widths[b]; widths[b] = tw;  \\\n}\n\n/* ||| I should apply the merge sort code to rectangle sorting above, and see\n   if mapping time can be improved.  But right now I've been at work 12 hours,\n   so forget it.\n*/\n\nstatic void QuickSortSpans(DDXPointRec spans[], int widths[], int numSpans)\n{\n    register int            y;\n    register int            i, j, m;\n    register DDXPointPtr    r;\n\n    /* Always called with numSpans > 1 */\n    /* Sorts only by y, doesn't bother to sort by x */\n\n    do\n    {\n        if (numSpans < 9)\n        {\n            /* Do insertion sort */\n            register int yprev;\n\n            yprev = spans[0].y;\n            i = 1;\n            do\n            { /* while i != numSpans */\n                y = spans[i].y;\n                if (yprev > y)\n                {\n                    /* spans[i] is out of order.  Move into proper location. */\n                    DDXPointRec tpt;\n                    int     tw, k;\n\n                    for (j = 0; y >= spans[j].y; j++) {}\n                    tpt = spans[i];\n                    tw  = widths[i];\n                    for (k = i; k != j; k--)\n                    {\n                        spans[k] = spans[k-1];\n                        widths[k] = widths[k-1];\n                    }\n                    spans[j] = tpt;\n                    widths[j] = tw;\n                    y = spans[i].y;\n                } /* if out of order */\n                yprev = y;\n                i++;\n            } while (i != numSpans);\n            return;\n        }\n\n        /* Choose partition element, stick in location 0 */\n        m = numSpans / 2;\n        if (spans[m].y > spans[0].y)            ExchangeSpans(m, 0);\n        if (spans[m].y > spans[numSpans-1].y)   ExchangeSpans(m, numSpans-1);\n        if (spans[m].y > spans[0].y)            ExchangeSpans(m, 0);\n        y = spans[0].y;\n\n        /* Partition array */\n        i = 0;\n        j = numSpans;\n        do\n        {\n            r = &(spans[i]);\n            do\n            {\n                r++;\n                i++;\n            } while (i != numSpans && r->y < y);\n            r = &(spans[j]);\n            do\n            {\n                r--;\n                j--;\n            } while (y < r->y);\n            if (i < j)\n                ExchangeSpans(i, j);\n        } while (i < j);\n\n        /* Move partition element back to middle */\n        ExchangeSpans(0, j);\n\n        /* Recurse */\n        if (numSpans-j-1 > 1)\n            QuickSortSpans(&spans[j+1], &widths[j+1], numSpans-j-1);\n        numSpans = j;\n    } while (numSpans > 1);\n}\n\n#define NextBand()                                                  \\\n{                                                                   \\\n    clipy1 = pboxBandStart->y1;                                     \\\n    clipy2 = pboxBandStart->y2;                                     \\\n    pboxBandEnd = pboxBandStart + 1;                                \\\n    while (pboxBandEnd != pboxLast && pboxBandEnd->y1 == clipy1) {  \\\n        pboxBandEnd++;                                              \\\n    }                                                               \\\n    for (; ppt != pptLast && ppt->y < clipy1; ppt++, pwidth++) {} \\\n}\n\n/*\n    Clip a list of scanlines to a region.  The caller has allocated the\n    space.  FSorted is non-zero if the scanline origins are in ascending\n    order.\n    returns the number of new, clipped scanlines.\n*/\n\nint miClipSpans(RegionPtr prgnDst, DDXPointPtr ppt,\n                int *pwidth, int nspans,\n                DDXPointPtr pptNew, int *pwidthNew, int fSorted)\n{\n    register DDXPointPtr pptLast;\n    int                 *pwidthNewStart;        /* the vengeance of Xerox! */\n    register int        y, x1, x2;\n    register int        numRects;\n\n    good(prgnDst);\n    pptLast = ppt + nspans;\n    pwidthNewStart = pwidthNew;\n\n    if (!prgnDst->data)\n    {\n        /* Do special fast code with clip boundaries in registers(?) */\n        /* It doesn't pay much to make use of fSorted in this case,\n           so we lump everything together. */\n\n        register    int clipx1, clipx2, clipy1, clipy2;\n\n        clipx1 = prgnDst->extents.x1;\n        clipy1 = prgnDst->extents.y1;\n        clipx2 = prgnDst->extents.x2;\n        clipy2 = prgnDst->extents.y2;\n\n        for (; ppt != pptLast; ppt++, pwidth++)\n        {\n            y = ppt->y;\n            x1 = ppt->x;\n            if (clipy1 <= y && y < clipy2)\n            {\n                x2 = x1 + *pwidth;\n                if (x1 < clipx1)    x1 = clipx1;\n                if (x2 > clipx2)    x2 = clipx2;\n                if (x1 < x2)\n                {\n                    /* part of span in clip rectangle */\n                    pptNew->x = x1;\n                    pptNew->y = y;\n                    *pwidthNew = x2 - x1;\n                    pptNew++;\n                    pwidthNew++;\n                }\n            }\n        } /* end for */\n\n    }\n    else if ((numRects = prgnDst->data->numRects))\n    {\n        /* Have to clip against many boxes */\n        BoxPtr          pboxBandStart, pboxBandEnd;\n        register BoxPtr pbox;\n        register BoxPtr pboxLast;\n        register int    clipy1, clipy2;\n\n        /* In this case, taking advantage of sorted spans gains more than\n           the sorting costs. */\n        if ((! fSorted) && (nspans > 1))\n            QuickSortSpans(ppt, pwidth, nspans);\n\n        pboxBandStart = REGION_BOXPTR(prgnDst);\n        pboxLast = pboxBandStart + numRects;\n\n        NextBand();\n\n        for (; ppt != pptLast; )\n        {\n            y = ppt->y;\n            if (y < clipy2)\n            {\n                /* span is in the current band */\n                pbox = pboxBandStart;\n                x1 = ppt->x;\n                x2 = x1 + *pwidth;\n                do\n                { /* For each box in band */\n                    register int    newx1, newx2;\n\n                    newx1 = x1;\n                    newx2 = x2;\n                    if (newx1 < pbox->x1)   newx1 = pbox->x1;\n                    if (newx2 > pbox->x2)   newx2 = pbox->x2;\n                    if (newx1 < newx2)\n                    {\n                        /* Part of span in clip rectangle */\n                        pptNew->x = newx1;\n                        pptNew->y = y;\n                        *pwidthNew = newx2 - newx1;\n                        pptNew++;\n                        pwidthNew++;\n                    }\n                    pbox++;\n                } while (pbox != pboxBandEnd);\n                ppt++;\n                pwidth++;\n            }\n            else\n            {\n                /* Move to next band, adjust ppt as needed */\n                pboxBandStart = pboxBandEnd;\n                if (pboxBandStart == pboxLast)\n                    break; /* We're completely done */\n                NextBand();\n            }\n        }\n    }\n    return (pwidthNew - pwidthNewStart);\n}\n\n/* find the band in a region with the most rectangles */\nint miFindMaxBand(RegionPtr prgn)\n{\n    register int nbox;\n    register BoxPtr pbox;\n    register int nThisBand;\n    register int nMaxBand = 0;\n    short yThisBand;\n\n    good(prgn);\n    nbox = REGION_NUM_RECTS(prgn);\n    pbox = REGION_RECTS(prgn);\n\n    while(nbox > 0)\n    {\n        yThisBand = pbox->y1;\n        nThisBand = 0;\n        while((nbox > 0) && (pbox->y1 == yThisBand))\n        {\n            nbox--;\n            pbox++;\n            nThisBand++;\n        }\n        if (nThisBand > nMaxBand)\n            nMaxBand = nThisBand;\n    }\n    return (nMaxBand);\n}\n"
  },
  {
    "path": "OSXvnc-server/mousecursor.c",
    "content": "/*\n *  mousecursor.c\n *  OSXvnc\n *\n *  Created by Jonathan Gillaspie on Wed Nov 20 2002.\n *  Copyright (c) 2002 Redstone Software. All rights reserved.\n *\n */\n\n#include <ApplicationServices/ApplicationServices.h>\n#include <Carbon/Carbon.h>\n\n#include <netinet/in.h>\n#include <unistd.h>\n\n#include \"rfb.h\"\n//#import \"rfbproto.h\"\n#include \"pthread.h\"\n\n#include \"CGS.h\"\n\nstatic int lastCursorSeed = 0;\nstatic int maxFailsRemaining = 8;\nstatic CGPoint lastCursorPosition;\n\n// Cursor Info\nstatic unsigned char *cursorData=NULL;\nstatic unsigned char *cursorMaskData=NULL;\nstatic int cursorRowBytes;\nstatic int cursorDataSize; // Size to be sent to client\nstatic int cursorMaskSize; // Mask Size to be sent to client\nstatic int cursorDepth;\nstatic int cursorBitsPerComponent;\nstatic CGPoint hotspot;\nstatic CGRect cursorRect;\nstatic int components; // Cursor Components\nstatic rfbPixelFormat cursorFormat;\n\nstatic pthread_mutex_t cursorMutex;\n\n\n// We are only going to access cursor data from the main thread now\nstatic CGSConnectionRef sharedConnection = 0;\n\ninline CGSConnectionRef getConnection(void) {\n    if (!sharedConnection && maxFailsRemaining > 0) {\n\t\tCGError result = CGSNewConnection(NULL, &sharedConnection);\n        if (result != kCGErrorSuccess)\n            rfbLog(\"Error obtaining CGSConnection (%u)%s\", result, (--maxFailsRemaining ? \"\" : \" -- giving up\"));\n\t\telse {\n\t\t\tmaxFailsRemaining = 8;\n\t\t\tpthread_mutex_init(&cursorMutex, NULL);\n\t\t}\n    }\n\n\treturn sharedConnection;\n}\n\nstatic CGPoint currentCursorLoc(void) {\n    CGPoint cursorLoc={0.0, 0.0};\n\tCGSConnectionRef connection = getConnection();\n\n    if (connection) {\n\t\tif (CGSGetCurrentCursorLocation(connection, &cursorLoc) != kCGErrorSuccess)\n\t\t\trfbLog(\"Error obtaining cursor location\");\n    }\n\n    return cursorLoc;\n}\n\nstatic void loadCurrentCursorData(void) {\n    CGError err;\n    CGSConnectionRef connection = getConnection();\n\n\tif (!connection) {\n\t\tif (!maxFailsRemaining)\n\t\t\treturn;\n\t}\n\n    if (CGSGetGlobalCursorDataSize(connection, &cursorDataSize) != kCGErrorSuccess) {\n        rfbLog(\"Error obtaining cursor data - cursor not sent\");\n        return;\n    }\n\n\tif (cursorData)\n\t\tfree(cursorData);\n    cursorData = (unsigned char*)malloc(sizeof(unsigned char) * cursorDataSize);\n    err = CGSGetGlobalCursorData(connection,\n                                 cursorData,\n                                 &cursorDataSize,\n                                 &cursorRowBytes,\n                                 &cursorRect,\n                                 &hotspot,\n                                 &cursorDepth,\n                                 &components,\n                                 &cursorBitsPerComponent);\n\n    //CGSReleaseConnection(connection);\n    if (err != kCGErrorSuccess) {\n\t\tfree(cursorData);\n\t\tcursorData = NULL;\n        rfbLog(\"Error obtaining cursor data - cursor not sent\");\n        return;\n    }\n\n    cursorFormat.depth = (cursorDepth == 32 ? 24 : cursorDepth);\n    cursorFormat.bitsPerPixel = cursorDepth;\n    cursorFormat.bigEndian = TRUE;\n    cursorFormat.trueColour = TRUE;\n    cursorFormat.redMax = cursorFormat.greenMax = cursorFormat.blueMax = (unsigned short) ((1<<cursorBitsPerComponent) - 1);\n\tcursorFormat.bigEndian = !littleEndian;\n\tcursorFormat.redShift   = (unsigned char) (cursorBitsPerComponent * 2);\n\tcursorFormat.greenShift = (unsigned char) (cursorBitsPerComponent * 1);\n\tcursorFormat.blueShift  = (unsigned char) (cursorBitsPerComponent * 0);\n\n    cursorMaskSize = floor((cursorRect.size.width+7)/8) * cursorRect.size.height;\n\n\tif (cursorMaskData)\n\t\tfree(cursorMaskData);\n\tcursorMaskData = (unsigned char*)malloc(sizeof(unsigned char) * cursorMaskSize);\n\n\t// Apple Cursors can use a full Alpha channel.\n    // Since we can only send a bit mask - to get closer we will compose the full color with a white\n\n    // For starters we'll set mask to OFF (transparent) everywhere)\n    memset(cursorMaskData, 0, cursorMaskSize);\n    // This algorithm assumes the Alpha channel is the first component\n    {\n\t\tunsigned char *maskPointer = cursorMaskData;\n        unsigned char *cursorRowData = cursorData;\n        unsigned int cursorBytesPerPixel = (cursorDepth/8);\n        unsigned char mask = 0;\n\t\tunsigned int alphaShift = (8 - cursorBitsPerComponent);\n        unsigned char fullOn = (0xFF) >> alphaShift;\n        unsigned char alphaThreshold = (0x60) >> alphaShift; // Only include the pixel if it's coverage is greater than this\n        int dataX, dataY, componentIndex;\n\n        for (dataY = 0; dataY < cursorRect.size.height; dataY++) {\n            unsigned char *cursorColumnData = cursorRowData;\n            for (dataX = 0; dataX < cursorRect.size.width; dataX++) {\n\t\t\t\tif (littleEndian)\n\t\t\t\t\tmask = (unsigned char)(*(cursorColumnData+(cursorBytesPerPixel-1))) >> alphaShift;\n\t\t\t\telse\n\t\t\t\t\tmask = (unsigned char)(*cursorColumnData) >> alphaShift;\n                if (mask > alphaThreshold) {\n                    // Write the Bit For The Mask to be ON (opaque)\n\t\t\t\t\tmaskPointer[(dataX/8)] |= (0x0080 >> (dataX % 8));\n                    // Composite Alpha into the cursors other channels - only for 32 bit\n                    if (cursorDepth == 32 && mask != fullOn) {\n                        for (componentIndex = 0; componentIndex < components; componentIndex++) {\n                            *cursorColumnData = (unsigned char) (fullOn - mask + ((*cursorColumnData * mask)/fullOn)) & 0xFF;\n                            cursorColumnData++;\n                        }\n                    }\n                    else\n                        cursorColumnData += cursorBytesPerPixel;\n                }\n                else\n                    cursorColumnData += cursorBytesPerPixel;\n            }\n\n            maskPointer += (int) floor(((int)cursorRect.size.width+7)/8);\n            cursorRowData += cursorRowBytes;\n        }\n    }\n}\n\n// Just for logging\n#if 0 // unused\nvoid GetCursorInfo(void) {\n\tCGSConnectionRef connection = getConnection();\n    CGError err = noErr;\n    int cursorDataSize, depth, components, bitsPerComponent, cursorRowSize;\n    unsigned char*\t\tcursorData;\n    CGPoint\t\t\t\tlocation, hotspot;\n    CGRect\t\t\t\tcursorRect;\n    int i, j;\n\n    err = CGSGetCurrentCursorLocation(connection, &location);\n    printf(\"location (err %d) = %d, %d\\n\", err, (int)location.x, (int)location.y);\n\n    err = CGSGetGlobalCursorDataSize(connection, &cursorDataSize);\n    printf(\"data size (err %d) = %d\\n\", err, cursorDataSize);\n\n    cursorData = (unsigned char*)calloc(cursorDataSize, sizeof(unsigned char));\n\n    err = CGSGetGlobalCursorData(connection,\n                                 cursorData,\n                                 &cursorDataSize,\n                                 &cursorRowSize,\n                                 &cursorRect,\n                                 &hotspot,\n                                 &depth,\n                                 &components,\n                                 &bitsPerComponent);\n\n    printf(\"rect origin (%g, %g), dimensions (%g, %g)\\n\", cursorRect.origin.x, cursorRect.origin.y, cursorRect.size.width, cursorRect.size.height);\n\n    printf(\"hotspot (%g, %g)\\n\", hotspot.x, hotspot.y);\n\n    printf(\"depth: %d\\n\", depth);\n\n    printf(\"components: %d\\n\", components);\n\n    printf(\"bits per component: %d\\n\", bitsPerComponent);\n\n    printf(\"Bytes Per Row: %d\\n\", cursorRowSize);\n\n\n    printf(\"Components (err %d):\\n\", err);\n\n    // Print Colors\n    for (j=0; j < components; j++) {\n        printf(\"\\n\");\n        for (i=0; i < cursorDataSize; i++) {\n            if (i % cursorRowSize == 0)\n                printf(\"\\n\");\n            if (i % components == j)\n                printf(\"%02x\", (int)cursorData[i]);\n        }\n    }\n\n    printf(\"released connection (err %d)\\n\", CGSReleaseConnection(connection));\n}\n#endif\n\n// We call this to see if we have a new cursor and should notify clients to do an update\n// Or if cursor has moved\nvoid rfbCheckForCursorChange(void) {\n\tBool sendNotice = FALSE;\n    CGPoint cursorLoc = currentCursorLoc();\n\tint currentSeed = CGSCurrentCursorSeed();\n\n\tpthread_mutex_lock(&cursorMutex);\n\tif (!CGPointEqualToPoint(lastCursorPosition, cursorLoc)) {\n\t\tlastCursorPosition = cursorLoc;\n\t\tsendNotice = TRUE;\n\t}\n\tif (lastCursorSeed != currentSeed) {\n        // Record first in case another change occurs after notifying clients\n        lastCursorSeed = currentSeed;\n\t\tloadCurrentCursorData();\n\t\tsendNotice = TRUE;\n\t}\n\tpthread_mutex_unlock(&cursorMutex);\n\n    //rfbLog(\"Check For Cursor Change\");\n    if (sendNotice) {\n        rfbClientIteratorPtr iterator = rfbGetClientIterator();\n        rfbClientPtr cl;\n\n        // Notify each client\n        while ((cl = rfbClientIteratorNext(iterator)) != NULL) {\n            if (rfbShouldSendNewCursor(cl) || (rfbShouldSendNewPosition(cl)))\n                pthread_cond_signal(&cl->updateCond);\n        }\n        rfbReleaseClientIterator(iterator);\n    }\n}\n\n#pragma mark -\n#pragma mark VNCClientOutput\n\nBool rfbShouldSendNewCursor(rfbClientPtr cl) {\n    if (!cl->useRichCursorEncoding)\n        return FALSE;\n    else\n        return (cl->currentCursorSeed != lastCursorSeed);\n}\n\nBool rfbShouldSendNewPosition(rfbClientPtr cl) {\n    if (!cl->enableCursorPosUpdates)\n        return FALSE;\n    else {\n        return (!CGPointEqualToPoint(cl->clientCursorLocation,lastCursorPosition));\n    }\n}\n\nBool rfbSendCursorPos(rfbClientPtr cl) {\n    rfbFramebufferUpdateRectHeader rect;\n\n    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader > UPDATE_BUF_SIZE) {\n        if (!rfbSendUpdateBuf(cl))\n            return FALSE;\n    }\n\n    cl->clientCursorLocation = lastCursorPosition;\n\n    rect.encoding = Swap32IfLE(rfbEncodingPointerPos);\n    rect.r.x = Swap16IfLE((CARD16)cl->clientCursorLocation.x);\n    rect.r.y = Swap16IfLE((CARD16)cl->clientCursorLocation.y);\n    rect.r.w = 0;\n    rect.r.h = 0;\n\n    memcpy(&cl->updateBuf[cl->ublen], &rect, sz_rfbFramebufferUpdateRectHeader);\n    cl->ublen += sz_rfbFramebufferUpdateRectHeader;\n\n    cl->rfbRectanglesSent[rfbStatsCursorPosition]++;\n    cl->rfbBytesSent[rfbStatsCursorPosition] += sz_rfbFramebufferUpdateRectHeader;\n\n    if (!rfbSendUpdateBuf(cl))\n        return FALSE;\n\n    return TRUE;\n}\n\n/* Still To Do\n\nProblems with occasional artifacts - turning off the cursor didn't seem to help\n    Perhaps if we resend the area where the cursor just was..\n\n// QDGetCursorData\n*/\n\nBool rfbSendRichCursorUpdate(rfbClientPtr cl) {\n    BOOL cursorIsDifferentFormat = TRUE;\n    BOOL returnValue = TRUE;\n\tint cursorSize = 0;\n\n\tpthread_mutex_lock(&cursorMutex);\n\n\tcursorIsDifferentFormat = !(PF_EQ(cursorFormat,rfbServerFormat));\n\tcursorSize = (cursorRect.size.width * cursorRect.size.height * (cl->format.bitsPerPixel / 8));\n\n\tif (!cursorData || cursorRect.size.height > 128 || cursorRect.size.width > 128) {\n\t\t// Wow That's one big cursor! We don't handle cursors this big\n\t\t// (they are probably cursors with lots of states and that doesn't work so good for VNC.\n\t\t// For now just ignore them\n\t\tcl->currentCursorSeed = lastCursorSeed;\n\t\treturnValue = FALSE;\n\t}\n\n    // Make Sure we have space on the buffer (otherwise push the data out now)\n\n    if (returnValue &&\n\t\tcl->ublen + sz_rfbFramebufferUpdateRectHeader + cursorSize + cursorMaskSize > UPDATE_BUF_SIZE) {\n        if (!rfbSendUpdateBuf(cl))\n            returnValue = FALSE;\n    }\n\n\tif (returnValue) {\n\t\trfbFramebufferUpdateRectHeader rect;\n\n\t\t// Send The Header\n\t\trect.r.x = Swap16IfLE((short) hotspot.x);\n\t\trect.r.y = Swap16IfLE((short) hotspot.y);\n\t\trect.r.w = Swap16IfLE((short) cursorRect.size.width);\n\t\trect.r.h = Swap16IfLE((short) cursorRect.size.height);\n\t\trect.encoding = Swap32IfLE(rfbEncodingRichCursor);\n\n\t\tmemcpy(&cl->updateBuf[cl->ublen], &rect, sz_rfbFramebufferUpdateRectHeader);\n\t\tcl->ublen += sz_rfbFramebufferUpdateRectHeader;\n\n\t\t// Temporarily set it to the cursor format\n\t\tif (cursorIsDifferentFormat)\n\t\t\trfbSetTranslateFunctionUsingFormat(cl, cursorFormat);\n\n\t\t// Now Send The Cursor\n\t\t(*cl->translateFn)(cl->translateLookupTable, // The Lookup Table\n\t\t\t\t\t\t   &cursorFormat, // Our Cursor format\n\t\t\t\t\t\t   &cl->format, // Client Format\n\t\t\t\t\t\t   (char *)cursorData, // Data we're sending\n\t\t\t\t\t\t   &cl->updateBuf[cl->ublen], // where to write it\n\t\t\t\t\t\t   cursorRowBytes, // bytesBetweenInputLines\n\t\t\t\t\t\t   cursorRect.size.width,\n\t\t\t\t\t\t   cursorRect.size.height);\n\t\tcl->ublen += cursorSize;\n\n\t\tif (cursorIsDifferentFormat)\n\t\t\trfbSetTranslateFunctionUsingFormat(cl, rfbServerFormat);\n\n\t\t// Now Send The Cursor Bitmap (1 for on, 0 for clear)\n\t\tmemcpy(&cl->updateBuf[cl->ublen], cursorMaskData, cursorMaskSize);\n\t\tcl->ublen += cursorMaskSize;\n\n\t\t// Update Stats\n\t\tcl->rfbRectanglesSent[rfbStatsRichCursor]++;\n\t\tcl->rfbBytesSent[rfbStatsRichCursor] += sz_rfbFramebufferUpdateRectHeader + cursorSize + cursorMaskSize;\n\t\tcl->currentCursorSeed = lastCursorSeed;\n\t}\n\n\tpthread_mutex_unlock(&cursorMutex);\n\n\treturn returnValue;\n}\n"
  },
  {
    "path": "OSXvnc-server/rdr/Exception.h",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n\n#ifndef __RDR_EXCEPTION_H__\n#define __RDR_EXCEPTION_H__\n\n#include <stdio.h>\n#include <string.h>\n\nnamespace rdr {\n\n  struct Exception {\n    enum { len = 256 };\n    char str_[len];\n    Exception(const char* s=0, const char* e=\"rdr::Exception\") {\n      str_[0] = 0;\n      strncat(str_, e, len-1);\n      if (s) {\n        strncat(str_, \": \", len-1-strlen(str_));\n        strncat(str_, s, len-1-strlen(str_));\n      }\n    }\n    virtual const char* str() const { return str_; }\n  };\n\n  struct SystemException : public Exception {\n    int err;\n    SystemException(const char* s, int err_) : err(err_) {\n      str_[0] = 0;\n      strncat(str_, \"rdr::SystemException: \", len-1);\n      strncat(str_, s, len-1-strlen(str_));\n      strncat(str_, \": \", len-1-strlen(str_));\n      strncat(str_, strerror(err), len-1-strlen(str_));\n      strncat(str_, \" (\", len-1-strlen(str_));\n      char buf[20];\n      snprintf(buf, sizeof(buf), \"%d\", err);\n      strncat(str_, buf, len-1-strlen(str_));\n      strncat(str_, \")\", len-1-strlen(str_));\n    }\n  };\n\n  struct TimedOut : public Exception {\n    TimedOut(const char* s=0) : Exception(s,\"rdr::TimedOut\") {}\n  };\n\n  struct EndOfStream : public Exception {\n    EndOfStream(const char* s=0) : Exception(s,\"rdr::EndOfStream\") {}\n  };\n\n  struct FrameException : public Exception {\n    FrameException(const char* s=0) : Exception(s,\"rdr::FrameException\") {}\n  };\n\n}\n\n#endif\n"
  },
  {
    "path": "OSXvnc-server/rdr/FdInStream.cxx",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n\n#include <stdio.h>\n#include <string.h>\n#include <errno.h>\n#include <sys/types.h>\n#ifdef _WIN32\n#include <winsock.h>\n#include <sys/timeb.h>\n#define read(s,b,l) recv(s,(char*)b,l,0)\n#undef errno\n#define errno WSAGetLastError()\n#else\n#include <unistd.h>\n#include <sys/time.h>\n#endif\n\n// XXX should use autoconf HAVE_SYS_SELECT_H\n#ifdef _AIX\n#include <sys/select.h>\n#endif\n\n#include <rdr/FdInStream.h>\n#include <rdr/Exception.h>\n\nusing namespace rdr;\n\nenum { DEFAULT_BUF_SIZE = 8192,\n       MIN_BULK_SIZE = 1024 };\n\nFdInStream::FdInStream(int fd_, int timeout_, int bufSize_)\n  : fd(fd_), timeout(timeout_), blockCallback(0), blockCallbackArg(0),\n    timing(false), timeWaitedIn100us(5), timedKbits(0),\n    bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0)\n{\n  ptr = end = start = new U8[bufSize];\n}\n\nFdInStream::FdInStream(int fd_, void (*blockCallback_)(void*),\n                       void* blockCallbackArg_, int bufSize_)\n  : fd(fd_), timeout(0), blockCallback(blockCallback_),\n    blockCallbackArg(blockCallbackArg_),\n    timing(false), timeWaitedIn100us(5), timedKbits(0),\n    bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0)\n{\n  ptr = end = start = new U8[bufSize];\n}\n\nFdInStream::~FdInStream()\n{\n  delete [] start;\n}\n\n\nsize_t FdInStream::pos()\n{\n  return offset + ptr - start;\n}\n\nvoid FdInStream::readBytes(void* data, int length)\n{\n  if (length < MIN_BULK_SIZE) {\n    InStream::readBytes(data, length);\n    return;\n  }\n\n  U8* dataPtr = (U8*)data;\n\n  size_t n = end - ptr;\n  if (n > length) n = length;\n\n  memcpy(dataPtr, ptr, n);\n  dataPtr += n;\n  length -= n;\n  ptr += n;\n\n  while (length > 0) {\n    n = readWithTimeoutOrCallback(dataPtr, length);\n    dataPtr += n;\n    length -= n;\n    offset += n;\n  }\n}\n\n\nsize_t FdInStream::overrun(size_t itemSize, size_t nItems)\n{\n  if (itemSize > bufSize)\n    throw Exception(\"FdInStream overrun: max itemSize exceeded\");\n\n  if (end - ptr != 0)\n    memmove(start, ptr, end - ptr);\n\n  offset += ptr - start;\n  end -= ptr - start;\n  ptr = start;\n\n  while (end < start + itemSize) {\n    ssize_t n = readWithTimeoutOrCallback((U8*)end, start + bufSize - end);\n    end += n;\n  }\n\n  if (itemSize * nItems > end - ptr)\n    nItems = (end - ptr) / itemSize;\n\n  return nItems;\n}\n\nint FdInStream::checkReadable(int fd, int timeout)\n{\n  while (true) {\n    fd_set rfds;\n    struct timeval tv;\n\n    tv.tv_sec = timeout / 1000;\n    tv.tv_usec = (timeout % 1000) * 1000;\n\n    FD_ZERO(&rfds);\n    FD_SET(fd, &rfds);\n    int n = select(fd+1, &rfds, 0, 0, &tv);\n    if (n != -1 || errno != EINTR)\n      return n;\n    fprintf(stderr,\"select returned EINTR\\n\");\n  }\n}\n\n#ifdef _WIN32\nstatic void gettimeofday(struct timeval* tv, void*)\n{\n  LARGE_INTEGER counts, countsPerSec;\n  static double usecPerCount = 0.0;\n\n  if (QueryPerformanceCounter(&counts)) {\n    if (usecPerCount == 0.0) {\n      QueryPerformanceFrequency(&countsPerSec);\n      usecPerCount = 1000000.0 / countsPerSec.QuadPart;\n    }\n\n    LONGLONG usecs = (LONGLONG)(counts.QuadPart * usecPerCount);\n    tv->tv_usec = (long)(usecs % 1000000);\n    tv->tv_sec = (long)(usecs / 1000000);\n\n  } else {\n    struct timeb tb;\n    ftime(&tb);\n    tv->tv_sec = tb.time;\n    tv->tv_usec = tb.millitm * 1000;\n  }\n}\n#endif\n\nssize_t FdInStream::readWithTimeoutOrCallback(void* buf, size_t len)\n{\n  struct timeval before = {0, 0};\n  if (timing)\n    gettimeofday(&before, 0);\n\n  ssize_t n = checkReadable(fd, timeout);\n\n  if (n < 0) throw SystemException(\"select\",errno);\n\n  if (n == 0) {\n    if (timeout) throw TimedOut();\n    if (blockCallback) (*blockCallback)(blockCallbackArg);\n  }\n\n  while (true) {\n    n = ::read(fd, buf, len);\n    if (n != -1 || errno != EINTR)\n      break;\n    fprintf(stderr,\"read returned EINTR\\n\");\n  }\n\n  if (n < 0) throw SystemException(\"read\",errno);\n  if (n == 0) throw EndOfStream();\n\n  if (before.tv_sec != 0) {\n    struct timeval after;\n    gettimeofday(&after, 0);\n//      fprintf(stderr,\"%d.%06d\\n\",(after.tv_sec - before.tv_sec),\n//              (after.tv_usec - before.tv_usec));\n    time_t newTimeWaited = ((after.tv_sec - before.tv_sec) * 10000 +\n                         (after.tv_usec - before.tv_usec) / 100);\n    size_t newKbits = n * 8 / 1000;\n\n//      if (newTimeWaited == 0) {\n//        fprintf(stderr,\"new kbps infinite t %d k %d\\n\",\n//                newTimeWaited, newKbits);\n//      } else {\n//        fprintf(stderr,\"new kbps %d t %d k %d\\n\",\n//                newKbits * 10000 / newTimeWaited, newTimeWaited, newKbits);\n//      }\n\n    // limit rate to between 10kbit/s and 40Mbit/s\n\n    if (newTimeWaited > newKbits*1000) newTimeWaited = newKbits*1000;\n    if (newTimeWaited < newKbits/4)    newTimeWaited = newKbits/4;\n\n    timeWaitedIn100us += newTimeWaited;\n    timedKbits += newKbits;\n  }\n\n  return n;\n}\n\nvoid FdInStream::startTiming()\n{\n  timing = true;\n\n  // Carry over up to 1s worth of previous rate for smoothing.\n\n  if (timeWaitedIn100us > 10000) {\n    timedKbits = timedKbits * 10000 / timeWaitedIn100us;\n    timeWaitedIn100us = 10000;\n  }\n}\n\nvoid FdInStream::stopTiming()\n{\n  timing = false;\n  if (timeWaitedIn100us < timedKbits/2)\n    timeWaitedIn100us = timedKbits/2; // upper limit 20Mbit/s\n}\n\nunsigned int FdInStream::kbitsPerSecond()\n{\n  // The following calculation will overflow 32-bit arithmetic if we have\n  // received more than about 50Mbytes (400Mbits) since we started timing, so\n  // it should be OK for a single RFB update.\n\n  return timedKbits * 10000 / timeWaitedIn100us;\n}\n"
  },
  {
    "path": "OSXvnc-server/rdr/FdInStream.h",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n\n//\n// FdInStream streams from a file descriptor.\n//\n\n#ifndef __RDR_FDINSTREAM_H__\n#define __RDR_FDINSTREAM_H__\n\n#include <rdr/InStream.h>\n\nnamespace rdr {\n\n  class FdInStream : public InStream {\n\n  public:\n\n    FdInStream(int fd, int timeout=0, int bufSize=0);\n    FdInStream(int fd, void (*blockCallback)(void*), void* blockCallbackArg=0,\n\t\t  int bufSize=0);\n    virtual ~FdInStream();\n\n    int getFd() { return fd; }\n    size_t pos();\n    void readBytes(void* data, int length);\n    size_t bytesInBuf() { return end - ptr; }\n\n    void startTiming();\n    void stopTiming();\n    unsigned int kbitsPerSecond();\n    unsigned int timeWaited() { return timeWaitedIn100us; }\n\n  protected:\n    size_t overrun(size_t itemSize, size_t nItems);\n\n  private:\n    int checkReadable(int fd, int timeout);\n    ssize_t readWithTimeoutOrCallback(void* buf, size_t len);\n\n    int fd;\n    int timeout;\n    void (*blockCallback)(void*);\n    void* blockCallbackArg;\n\n    bool timing;\n    unsigned int timeWaitedIn100us;\n    unsigned int timedKbits;\n\n    int bufSize;\n    int offset;\n    U8* start;\n  };\n\n} // end of namespace rdr\n\n#endif\n"
  },
  {
    "path": "OSXvnc-server/rdr/FdOutStream.cxx",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n\n#include <stdio.h>\n#include <string.h>\n#include <errno.h>\n#include <sys/types.h>\n#ifdef _WIN32\n#include <winsock.h>\n#define write(s,b,l) send(s,(const char*)b,l,0)\n#undef errno\n#define errno WSAGetLastError()\n#else\n#include <unistd.h>\n#include <sys/time.h>\n#endif\n\n#include <rdr/FdOutStream.h>\n#include <rdr/Exception.h>\n\n\nusing namespace rdr;\n\nenum { DEFAULT_BUF_SIZE = 16384,\n       MIN_BULK_SIZE = 1024 };\n\nFdOutStream::FdOutStream(int fd_, int bufSize_)\n  : fd(fd_), bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0)\n{\n  ptr = start = new U8[bufSize];\n  end = start + bufSize;\n}\n\nFdOutStream::~FdOutStream()\n{\n  try {\n    flush();\n  } catch (Exception&) {\n  }\n  delete [] start;\n}\n\n\nvoid FdOutStream::writeBytes(const void* data, size_t length)\n{\n  if (length < MIN_BULK_SIZE) {\n    OutStream::writeBytes(data, length);\n    return;\n  }\n\n  const U8* dataPtr = (const U8*)data;\n\n  flush();\n\n  while (length > 0) {\n    ssize_t n = write(fd, dataPtr, length);\n\n    if (n < 0) throw SystemException(\"write\",errno);\n\n    length -= n;\n    dataPtr += n;\n    offset += n;\n  }\n}\n\nsize_t FdOutStream::length()\n{\n  return offset + ptr - start;\n}\n\nvoid FdOutStream::flush()\n{\n  U8* sentUpTo = start;\n  while (sentUpTo < ptr) {\n    ssize_t n = write(fd, (const void*) sentUpTo, ptr - sentUpTo);\n\n    if (n < 0) throw SystemException(\"write\",errno);\n\n    sentUpTo += n;\n    offset += n;\n  }\n\n  ptr = start;\n}\n\n\nsize_t FdOutStream::overrun(size_t itemSize, size_t nItems)\n{\n  if (itemSize > bufSize)\n    throw Exception(\"FdOutStream overrun: max itemSize exceeded\");\n\n  flush();\n\n  if (itemSize * nItems > end - ptr)\n    nItems = (end - ptr) / itemSize;\n\n  return nItems;\n}\n"
  },
  {
    "path": "OSXvnc-server/rdr/FdOutStream.h",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n\n//\n// FdOutStream streams to a file descriptor.\n//\n\n#ifndef __RDR_FDOUTSTREAM_H__\n#define __RDR_FDOUTSTREAM_H__\n\n#include <rdr/OutStream.h>\n\nnamespace rdr {\n\n  class FdOutStream : public OutStream {\n\n  public:\n\n    FdOutStream(int fd, int bufSize=0);\n    virtual ~FdOutStream();\n\n    int getFd() { return fd; }\n\n    void flush();\n    size_t length();\n    void writeBytes(const void* data, size_t length);\n\n  private:\n    size_t overrun(size_t itemSize, size_t nItems);\n    int fd;\n    int bufSize;\n    int offset;\n    U8* start;\n  };\n\n}\n\n#endif\n"
  },
  {
    "path": "OSXvnc-server/rdr/FixedMemOutStream.h",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n\n//\n// A FixedMemOutStream writes to a buffer of a fixed length.\n//\n\n#ifndef __RDR_FIXEDMEMOUTSTREAM_H__\n#define __RDR_FIXEDMEMOUTSTREAM_H__\n\n#include <rdr/OutStream.h>\n#include <rdr/Exception.h>\n\nnamespace rdr {\n\n  class FixedMemOutStream : public OutStream {\n\n  public:\n\n    FixedMemOutStream(void* buf, int len) {\n      ptr = start = (U8*)buf;\n      end = start + len;\n    }\n\n    int length() { return ptr - start; }\n    void reposition(int pos) { ptr = start + pos; }\n    const void* data() { return (const void*)start; }\n\n  private:\n\n    size_t overrun(size_t itemSize, size_t nItems) { throw EndOfStream(); }\n    U8* start;\n  };\n\n}\n\n#endif\n"
  },
  {
    "path": "OSXvnc-server/rdr/InStream.cxx",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n\n#include <rdr/InStream.h>\n#include <rdr/Exception.h>\n\nusing namespace rdr;\n\nU32 InStream::maxStringLength = 65535;\n\nchar* InStream::readString()\n{\n  U32 len = readU32();\n  if (len > maxStringLength)\n    throw Exception(\"InStream max string length exceeded\");\n  char* str = new char[len+1];\n  readBytes(str, len);\n  str[len] = 0;\n  return str;\n}\n"
  },
  {
    "path": "OSXvnc-server/rdr/InStream.h",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n\n//\n// rdr::InStream marshalls data from a buffer stored in RDR (RFB Data\n// Representation).\n//\n\n#ifndef __RDR_INSTREAM_H__\n#define __RDR_INSTREAM_H__\n\n#include <rdr/types.h>\n#include <string.h> // for memcpy\n\nnamespace rdr {\n\n  class InStream {\n\n  public:\n\n    virtual ~InStream() {}\n\n    // check() ensures there is buffer data for at least one item of size\n    // itemSize bytes.  Returns the number of items in the buffer (up to a\n    // maximum of nItems).\n\n    inline size_t check(size_t itemSize, size_t nItems = 1)\n    {\n      if (ptr + itemSize * nItems > end) {\n        if (ptr + itemSize > end)\n          return overrun(itemSize, nItems);\n\n        nItems = (end - ptr) / itemSize;\n      }\n      return nItems;\n    }\n\n    // readU/SN() methods read unsigned and signed N-bit integers.\n\n    inline U8  readU8()  { check(1); return *ptr++; }\n    inline U16 readU16() { check(2); int b0 = *ptr++; int b1 = *ptr++;\n                           return b0 << 8 | b1; }\n    inline U32 readU32() { check(4); int b0 = *ptr++; int b1 = *ptr++;\n                                     int b2 = *ptr++; int b3 = *ptr++;\n                           return b0 << 24 | b1 << 16 | b2 << 8 | b3; }\n\n    inline S8  readS8()  { return (S8) readU8();  }\n    inline S16 readS16() { return (S16)readU16(); }\n    inline S32 readS32() { return (S32)readU32(); }\n\n    // readString() reads a string - a U32 length followed by the data.\n    // Returns a null-terminated string - the caller should delete[] it\n    // afterwards.\n\n    char* readString();\n\n    // maxStringLength protects against allocating a huge buffer.  Set it\n    // higher if you need longer strings.\n\n    static U32 maxStringLength;\n\n    inline void skip(size_t bytes) {\n      while (bytes > 0) {\n        size_t n = check(1, bytes);\n        ptr += n;\n        bytes -= n;\n      }\n    }\n\n    // readBytes() reads an exact number of bytes.\n\n    virtual void readBytes(void* data, int length) {\n      U8* dataPtr = (U8*)data;\n      U8* dataEnd = dataPtr + length;\n      while (dataPtr < dataEnd) {\n        size_t n = check(1, dataEnd - dataPtr);\n        memcpy(dataPtr, ptr, n);\n        ptr += n;\n        dataPtr += n;\n      }\n    }\n\n    // readOpaqueN() reads a quantity without byte-swapping.\n\n    inline U8  readOpaque8()  { return readU8(); }\n    inline U16 readOpaque16() { check(2); U16 r; ((U8*)&r)[0] = *ptr++;\n                                ((U8*)&r)[1] = *ptr++; return r; }\n    inline U32 readOpaque32() { check(4); U32 r; ((U8*)&r)[0] = *ptr++;\n                                ((U8*)&r)[1] = *ptr++; ((U8*)&r)[2] = *ptr++;\n                                ((U8*)&r)[3] = *ptr++; return r; }\n    inline U32 readOpaque24A() { check(3); U32 r=0; ((U8*)&r)[0] = *ptr++;\n                                 ((U8*)&r)[1] = *ptr++; ((U8*)&r)[2] = *ptr++;\n                                 return r; }\n    inline U32 readOpaque24B() { check(3); U32 r=0; ((U8*)&r)[1] = *ptr++;\n                                 ((U8*)&r)[2] = *ptr++; ((U8*)&r)[3] = *ptr++;\n                                 return r; }\n\n    // pos() returns the position in the stream.\n\n    virtual size_t pos() = 0;\n\n    // getptr(), getend() and setptr() are \"dirty\" methods which allow you to\n    // manipulate the buffer directly.  This is useful for a stream which is a\n    // wrapper around an underlying stream.\n\n    inline const U8* getptr() const { return ptr; }\n    inline const U8* getend() const { return end; }\n    inline void setptr(const U8* p) { ptr = p; }\n\n  private:\n\n    // overrun() is implemented by a derived class to cope with buffer overrun.\n    // It ensures there are at least itemSize bytes of buffer data.  Returns\n    // the number of items in the buffer (up to a maximum of nItems).  itemSize\n    // is supposed to be \"small\" (a few bytes).\n\n    virtual size_t overrun(size_t itemSize, size_t nItems) = 0;\n\n  protected:\n\n    InStream() {}\n    const U8* ptr;\n    const U8* end;\n  };\n\n}\n\n#endif\n"
  },
  {
    "path": "OSXvnc-server/rdr/Makefile",
    "content": "\nSRCS = FdInStream.cxx FdOutStream.cxx InStream.cxx NullOutStream.cxx \\\n       ZlibInStream.cxx ZlibOutStream.cxx\n\nOBJS = $(SRCS:.cxx=.o)\n\nDIR_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/zlib\n\nlibrary = librdr.a\n\nall:: $(library)\n\n$(library): $(OBJS)\n\trm -f $(library)\n\t$(AR) $(library) $(OBJS)\n\t$(RANLIB) $(library)\n\n# followed by boilerplate.mk\n\nall::\n\t@subdirs=\"$(SUBDIRS)\"; for d in $$subdirs; do (cd $$d; $(MAKE) $@) || exit 1; done\n\nclean::\n\t@subdirs=\"$(SUBDIRS)\"; for d in $$subdirs; do (cd $$d; $(MAKE) $@) || exit 1; done\n\nclean::\n\trm -f $(program) $(library) *.o\n\nSHELL = /bin/sh\ntop_srcdir = ..\n\nCC = gcc\nCFLAGS = -O2 -Wall -no-cpp-precomp $(DIR_CFLAGS)\nCCLD = $(CC)\nCXX = g++\nCXXFLAGS = -O2 -Wall\nCXXLD = $(CXX)\nCPPFLAGS =\nDEFS =\nALL_CPPFLAGS = $(CPPFLAGS) $(DEFS) $(DIR_CPPFLAGS)\nLIBS =\nLDFLAGS =\nRANLIB = ranlib\nAR = ar cq\n\n.SUFFIXES:\n.SUFFIXES: .cxx .c .o\n\n.c.o:\n\t$(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c $<\n\n.cxx.o:\n\t$(CXX) $(ALL_CPPFLAGS) $(CXXFLAGS) -c $<\n"
  },
  {
    "path": "OSXvnc-server/rdr/Makefile.in",
    "content": "\nSRCS = FdInStream.cxx FdOutStream.cxx InStream.cxx NullOutStream.cxx \\\n       ZlibInStream.cxx ZlibOutStream.cxx\n\nOBJS = $(SRCS:.cxx=.o)\n\nDIR_CPPFLAGS = -I$(top_srcdir) @ZLIB_INCLUDE@\n\nlibrary = librdr.a\n\nall:: $(library)\n\n$(library): $(OBJS)\n\trm -f $(library)\n\t$(AR) $(library) $(OBJS)\n\t$(RANLIB) $(library)\n\n# followed by boilerplate.mk\n"
  },
  {
    "path": "OSXvnc-server/rdr/MemInStream.h",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n\n#ifndef __RDR_MEMINSTREAM_H__\n#define __RDR_MEMINSTREAM_H__\n\n#include <rdr/InStream.h>\n#include <rdr/Exception.h>\n\nnamespace rdr {\n\n  class MemInStream : public InStream {\n\n  public:\n\n    MemInStream(const void* data, int len) {\n      ptr = start = (const U8*)data;\n      end = start + len;\n    }\n\n    size_t pos() { return ptr - start; }\n    void reposition(int pos) { ptr = start + pos; }\n\n  private:\n\n    size_t overrun(size_t itemSize, size_t nItems) { throw EndOfStream(); }\n    const U8* start;\n  };\n\n}\n\n#endif\n"
  },
  {
    "path": "OSXvnc-server/rdr/MemOutStream.h",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n\n//\n// A MemOutStream grows as needed when data is written to it.\n//\n\n#ifndef __RDR_MEMOUTSTREAM_H__\n#define __RDR_MEMOUTSTREAM_H__\n\n#include <rdr/OutStream.h>\n\nnamespace rdr {\n\n  class MemOutStream : public OutStream {\n\n  public:\n\n    MemOutStream(int len=1024) {\n      start = ptr = new U8[len];\n      end = start + len;\n    }\n\n    virtual ~MemOutStream() {\n      delete [] start;\n    }\n\n    void writeBytes(const void* data, size_t length) {\n      check(length);\n      memcpy(ptr, data, length);\n      ptr += length;\n    }\n\n    size_t length() { return ptr - start; }\n    void clear() { ptr = start; };\n    void reposition(int pos) { ptr = start + pos; }\n\n    // data() returns a pointer to the buffer.\n\n    const void* data() { return (const void*)start; }\n\n  private:\n\n    // overrun() either doubles the buffer or adds enough space for nItems of\n    // size itemSize bytes.\n\n    size_t overrun(size_t itemSize, size_t nItems) {\n      ssize_t len = ptr - start + itemSize * nItems;\n      if (len < (end - start) * 2)\n        len = (end - start) * 2;\n\n      U8* newStart = new U8[len];\n      memcpy(newStart, start, ptr - start);\n      ptr = newStart + (ptr - start);\n      delete [] start;\n      start = newStart;\n      end = newStart + len;\n\n      return nItems;\n    }\n\n    U8* start;\n  };\n\n}\n\n#endif\n"
  },
  {
    "path": "OSXvnc-server/rdr/NullOutStream.cxx",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n\n#include <rdr/NullOutStream.h>\n#include <rdr/Exception.h>\n\nusing namespace rdr;\n\nstatic const int bufferSize = 1024;\n\nNullOutStream::NullOutStream()\n  : offset(0)\n{\n  start = ptr = new U8[bufferSize];\n  end = start + bufferSize;\n}\n\nNullOutStream::~NullOutStream()\n{\n  delete [] start;\n}\n\nsize_t NullOutStream::length()\n{\n  return offset + ptr - start;\n}\n\nvoid NullOutStream::writeBytes(const void* data, size_t length)\n{\n  offset += length;\n}\n\nsize_t NullOutStream::overrun(size_t itemSize, size_t nItems)\n{\n  if (itemSize > bufferSize)\n    throw Exception(\"NullOutStream overrun: max itemSize exceeded\");\n\n  offset += ptr - start;\n  ptr = start;\n\n  if (itemSize * nItems > end - ptr)\n    nItems = (end - ptr) / itemSize;\n\n  return nItems;\n}\n"
  },
  {
    "path": "OSXvnc-server/rdr/NullOutStream.h",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n\n#ifndef __RDR_NULLOUTSTREAM_H__\n#define __RDR_NULLOUTSTREAM_H__\n\n#include <rdr/OutStream.h>\n\nnamespace rdr {\n\n  class NullOutStream : public OutStream {\n\n  public:\n    NullOutStream();\n    virtual ~NullOutStream();\n    size_t length();\n    void writeBytes(const void* data, size_t length);\n\n  private:\n    size_t overrun(size_t itemSize, size_t nItems);\n    int offset;\n    U8* start;\n  };\n\n}\n\n#endif\n"
  },
  {
    "path": "OSXvnc-server/rdr/OutStream.h",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n\n//\n// rdr::OutStream marshalls data into a buffer stored in RDR (RFB Data\n// Representation).\n//\n\n#ifndef __RDR_OUTSTREAM_H__\n#define __RDR_OUTSTREAM_H__\n\n#include <rdr/types.h>\n#include <string.h> // for memcpy\n\nnamespace rdr {\n\n  class OutStream {\n\n  protected:\n\n    OutStream() {}\n\n  public:\n\n    virtual ~OutStream() {}\n\n    // check() ensures there is buffer space for at least one item of size\n    // itemSize bytes.  Returns the number of items which fit (up to a maximum\n    // of nItems).\n\n    inline size_t check(size_t itemSize, size_t nItems = 1)\n    {\n      if (ptr + itemSize * nItems > end) {\n        if (ptr + itemSize > end)\n          return overrun(itemSize, nItems);\n\n        nItems = (end - ptr) / itemSize;\n      }\n      return nItems;\n    }\n\n    // writeU/SN() methods write unsigned and signed N-bit integers.\n\n    inline void writeU8( U8  u) { check(1); *ptr++ = u; }\n    inline void writeU16(U16 u) { check(2); *ptr++ = u >> 8; *ptr++ = (U8)u; }\n    inline void writeU32(U32 u) { check(4); *ptr++ = u >> 24; *ptr++ = u >> 16;\n                                            *ptr++ = u >> 8; *ptr++ = u; }\n\n    inline void writeS8( S8  s) { writeU8((U8)s); }\n    inline void writeS16(S16 s) { writeU16((U16)s); }\n    inline void writeS32(S32 s) { writeU32((U32)s); }\n\n    // writeString() writes a string - a U32 length followed by the data.  The\n    // given string should be null-terminated (but the terminating null is not\n    // written to the stream).\n\n    inline void writeString(const char* str) {\n      size_t len = strlen(str);\n      writeU32((U32)len);\n      writeBytes(str, len);\n    }\n\n    inline void pad(int bytes) {\n      while (bytes-- > 0) writeU8(0);\n    }\n\n    inline void skip(int bytes) {\n      while (bytes > 0) {\n        size_t n = check(1, bytes);\n        ptr += n;\n        bytes -= n;\n      }\n    }\n\n    // writeBytes() writes an exact number of bytes.\n\n    virtual void writeBytes(const void* data, size_t length) {\n      const U8* dataPtr = (const U8*)data;\n      const U8* dataEnd = dataPtr + length;\n      while (dataPtr < dataEnd) {\n        size_t n = check(1, dataEnd - dataPtr);\n        memcpy(ptr, dataPtr, n);\n        ptr += n;\n        dataPtr += n;\n      }\n    }\n\n    // writeOpaqueN() writes a quantity without byte-swapping.\n\n    inline void writeOpaque8( U8  u) { writeU8(u); }\n    inline void writeOpaque16(U16 u) { check(2); *ptr++ = ((U8*)&u)[0];\n                                       *ptr++ = ((U8*)&u)[1]; }\n    inline void writeOpaque32(U32 u) { check(4); *ptr++ = ((U8*)&u)[0];\n                                       *ptr++ = ((U8*)&u)[1];\n                                       *ptr++ = ((U8*)&u)[2];\n                                       *ptr++ = ((U8*)&u)[3]; }\n    inline void writeOpaque24A(U32 u) { check(3); *ptr++ = ((U8*)&u)[0];\n                                        *ptr++ = ((U8*)&u)[1];\n                                        *ptr++ = ((U8*)&u)[2]; }\n    inline void writeOpaque24B(U32 u) { check(3); *ptr++ = ((U8*)&u)[1];\n                                        *ptr++ = ((U8*)&u)[2];\n                                        *ptr++ = ((U8*)&u)[3]; }\n\n    // length() returns the length of the stream.\n\n    virtual size_t length() = 0;\n\n    // flush() requests that the stream be flushed.\n\n    virtual void flush() {}\n\n    // getptr(), getend() and setptr() are \"dirty\" methods which allow you to\n    // manipulate the buffer directly.  This is useful for a stream which is a\n    // wrapper around an underlying stream.\n\n    inline U8* getptr() { return ptr; }\n    inline U8* getend() { return end; }\n    inline void setptr(U8* p) { ptr = p; }\n\n  private:\n\n    // overrun() is implemented by a derived class to cope with buffer overrun.\n    // It ensures there are at least itemSize bytes of buffer space.  Returns\n    // the number of items which fit (up to a maximum of nItems).  itemSize is\n    // supposed to be \"small\" (a few bytes).\n\n    virtual size_t overrun(size_t itemSize, size_t nItems) = 0;\n\n  protected:\n\n    U8* ptr;\n    U8* end;\n  };\n\n}\n\n#endif\n"
  },
  {
    "path": "OSXvnc-server/rdr/ZlibInStream.cxx",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n\n#include <rdr/ZlibInStream.h>\n#include <rdr/Exception.h>\n#include <zlib.h>\n\nusing namespace rdr;\n\nenum { DEFAULT_BUF_SIZE = 16384 };\n\nZlibInStream::ZlibInStream(int bufSize_)\n  : underlying(0), bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0),\n    bytesIn(0)\n{\n  zs = new z_stream;\n  zs->zalloc    = Z_NULL;\n  zs->zfree     = Z_NULL;\n  zs->opaque    = Z_NULL;\n  zs->next_in   = Z_NULL;\n  zs->avail_in  = 0;\n  if (inflateInit(zs) != Z_OK) {\n    delete zs;\n    throw Exception(\"ZlibInStream: inflateInit failed\");\n  }\n  ptr = end = start = new U8[bufSize];\n}\n\nZlibInStream::~ZlibInStream()\n{\n  delete [] start;\n  inflateEnd(zs);\n  delete zs;\n}\n\nvoid ZlibInStream::setUnderlying(InStream* is, int bytesIn_)\n{\n  underlying = is;\n  bytesIn = bytesIn_;\n  ptr = end = start;\n}\n\nsize_t ZlibInStream::pos()\n{\n  return offset + ptr - start;\n}\n\nvoid ZlibInStream::reset()\n{\n  ptr = end = start;\n  if (!underlying) return;\n\n  while (bytesIn > 0) {\n    decompress();\n    end = start; // throw away any data\n  }\n  underlying = 0;\n}\n\nsize_t ZlibInStream::overrun(size_t itemSize, size_t nItems)\n{\n  if (itemSize > bufSize)\n    throw Exception(\"ZlibInStream overrun: max itemSize exceeded\");\n  if (!underlying)\n    throw Exception(\"ZlibInStream overrun: no underlying stream\");\n\n  if (end - ptr != 0)\n    memmove(start, ptr, end - ptr);\n\n  offset += ptr - start;\n  end -= ptr - start;\n  ptr = start;\n\n  while (end - ptr < itemSize) {\n    decompress();\n  }\n\n  if (itemSize * nItems > end - ptr)\n    nItems = (end - ptr) / itemSize;\n\n  return nItems;\n}\n\n// decompress() calls the decompressor once.  Note that this won't necessarily\n// generate any output data - it may just consume some input data.\n\nvoid ZlibInStream::decompress()\n{\n  zs->next_out = (U8*)end;\n  zs->avail_out = unsigned(start + bufSize - end);\n\n  underlying->check(1);\n  zs->next_in = (U8*)underlying->getptr();\n  zs->avail_in = unsigned(underlying->getend() - underlying->getptr());\n  if ((int)zs->avail_in > bytesIn)\n    zs->avail_in = bytesIn;\n\n  int rc = inflate(zs, Z_SYNC_FLUSH);\n  if (rc != Z_OK) {\n    throw Exception(\"ZlibInStream: inflate failed\");\n  }\n\n  bytesIn -= zs->next_in - underlying->getptr();\n  end = zs->next_out;\n  underlying->setptr(zs->next_in);\n}\n"
  },
  {
    "path": "OSXvnc-server/rdr/ZlibInStream.h",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n\n//\n// ZlibInStream streams from a compressed data stream (\"underlying\"),\n// decompressing with zlib on the fly.\n//\n\n#ifndef __RDR_ZLIBINSTREAM_H__\n#define __RDR_ZLIBINSTREAM_H__\n\n#include <rdr/InStream.h>\n\nstruct z_stream_s;\n\nnamespace rdr {\n\n  class ZlibInStream : public InStream {\n\n  public:\n\n    ZlibInStream(int bufSize=0);\n    virtual ~ZlibInStream();\n\n    void setUnderlying(InStream* is, int bytesIn);\n    void reset();\n    size_t pos();\n\n  private:\n\n    size_t overrun(size_t itemSize, size_t nItems);\n    void decompress();\n\n    InStream* underlying;\n    int bufSize;\n    int offset;\n    z_stream_s* zs;\n    int bytesIn;\n    U8* start;\n  };\n\n} // end of namespace rdr\n\n#endif\n"
  },
  {
    "path": "OSXvnc-server/rdr/ZlibOutStream.cxx",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n\n#include <rdr/ZlibOutStream.h>\n#include <rdr/Exception.h>\n#include <zlib.h>\n\nusing namespace rdr;\n\nenum { DEFAULT_BUF_SIZE = 16384 };\n\nZlibOutStream::ZlibOutStream(OutStream* os, int bufSize_)\n  : underlying(os), bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0)\n{\n  zs = new z_stream;\n  zs->zalloc    = Z_NULL;\n  zs->zfree     = Z_NULL;\n  zs->opaque    = Z_NULL;\n  if (deflateInit(zs, Z_DEFAULT_COMPRESSION) != Z_OK) {\n    delete zs;\n    throw Exception(\"ZlibOutStream: deflateInit failed\");\n  }\n  ptr = start = new U8[bufSize];\n  end = start + bufSize;\n}\n\nZlibOutStream::~ZlibOutStream()\n{\n  try {\n    flush();\n  } catch (Exception&) {\n  }\n  delete [] start;\n  deflateEnd(zs);\n  delete zs;\n}\n\nvoid ZlibOutStream::setUnderlying(OutStream* os)\n{\n  underlying = os;\n}\n\nsize_t ZlibOutStream::length()\n{\n  return offset + ptr - start;\n}\n\nvoid ZlibOutStream::flush()\n{\n  zs->next_in = start;\n  zs->avail_in = unsigned(ptr - start);\n\n//    fprintf(stderr,\"zos flush: avail_in %d\\n\",zs->avail_in);\n\n  while (zs->avail_in != 0) {\n\n    do {\n      underlying->check(1);\n      zs->next_out = underlying->getptr();\n      zs->avail_out = unsigned(underlying->getend() - underlying->getptr());\n\n//        fprintf(stderr,\"zos flush: calling deflate, avail_in %d, avail_out %d\\n\",\n//                zs->avail_in,zs->avail_out);\n      int rc = deflate(zs, Z_SYNC_FLUSH);\n      if (rc != Z_OK) throw Exception(\"ZlibOutStream: deflate failed\");\n\n//        fprintf(stderr,\"zos flush: after deflate: %d bytes\\n\",\n//                zs->next_out-underlying->getptr());\n\n      underlying->setptr(zs->next_out);\n    } while (zs->avail_out == 0);\n  }\n\n  offset += ptr - start;\n  ptr = start;\n}\n\nsize_t ZlibOutStream::overrun(size_t itemSize, size_t nItems)\n{\n//    fprintf(stderr,\"ZlibOutStream overrun\\n\");\n\n  if (itemSize > bufSize)\n    throw Exception(\"ZlibOutStream overrun: max itemSize exceeded\");\n\n  while (end - ptr < itemSize) {\n    zs->next_in = start;\n    zs->avail_in = unsigned(ptr - start);\n\n    do {\n      underlying->check(1);\n      zs->next_out = underlying->getptr();\n      zs->avail_out = unsigned(underlying->getend() - underlying->getptr());\n\n//        fprintf(stderr,\"zos overrun: calling deflate, avail_in %d, avail_out %d\\n\",\n//                zs->avail_in,zs->avail_out);\n\n      int rc = deflate(zs, 0);\n      if (rc != Z_OK) throw Exception(\"ZlibOutStream: deflate failed\");\n\n//        fprintf(stderr,\"zos overrun: after deflate: %d bytes\\n\",\n//                zs->next_out-underlying->getptr());\n\n      underlying->setptr(zs->next_out);\n    } while (zs->avail_out == 0);\n\n    // output buffer not full\n\n    if (zs->avail_in == 0) {\n      offset += ptr - start;\n      ptr = start;\n    } else {\n      // but didn't consume all the data?  try shifting what's left to the\n      // start of the buffer.\n      fprintf(stderr,\"z out buf not full, but in data not consumed\\n\");\n      memmove(start, zs->next_in, ptr - zs->next_in);\n      offset += zs->next_in - start;\n      ptr -= zs->next_in - start;\n    }\n  }\n\n  if (itemSize * nItems > end - ptr)\n    nItems = (end - ptr) / itemSize;\n\n  return nItems;\n}\n"
  },
  {
    "path": "OSXvnc-server/rdr/ZlibOutStream.h",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n\n//\n// ZlibOutStream streams to a compressed data stream (underlying), compressing\n// with zlib on the fly.\n//\n\n#ifndef __RDR_ZLIBOUTSTREAM_H__\n#define __RDR_ZLIBOUTSTREAM_H__\n\n#include <rdr/OutStream.h>\n\nstruct z_stream_s;\n\nnamespace rdr {\n\n  class ZlibOutStream : public OutStream {\n\n  public:\n\n    ZlibOutStream(OutStream* os=0, int bufSize=0);\n    virtual ~ZlibOutStream();\n\n    void setUnderlying(OutStream* os);\n    void flush();\n    size_t length();\n\n  private:\n\n    size_t overrun(size_t itemSize, size_t nItems);\n\n    OutStream* underlying;\n    int bufSize;\n    int offset;\n    z_stream_s* zs;\n    U8* start;\n  };\n\n} // end of namespace rdr\n\n#endif\n"
  },
  {
    "path": "OSXvnc-server/rdr/types.h",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n\n#ifndef __RDR_TYPES_H__\n#define __RDR_TYPES_H__\n\nnamespace rdr {\n  typedef unsigned char U8;\n  typedef unsigned short U16;\n  typedef unsigned int U32;\n  typedef signed char S8;\n  typedef signed short S16;\n  typedef signed int S32;\n}; // end of namespace rdr\n\n#endif\n"
  },
  {
    "path": "OSXvnc-server/rfb.h",
    "content": "/*\n * rfb.h - header file for RFB DDX implementation.\n */\n\n/*\n *  OSXvnc Copyright (C) 2001  *  OSXvnc Copyright (C) 2002-2004 Redstone Software osxvnc@redstonesoftware.comGuirk <mcguirk@incompleteness.net>.\n *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.\n *  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n#include \"scrnintstr.h\"\n\n/* trying to replace the above with some more minimal set of includes */\n#include \"misc.h\"\n#include \"Xmd.h\"\n#include \"regionstr.h\"\n\n#include <pthread.h>\n#include <machine/types.h>\n#include <rfbproto.h>\n#include <vncauth.h>\n#include <zlib.h>\n#include \"tight.h\"\n\n#import \"screencapture.h\"\n\n//#include \"Keyboards.h\"\n//#import <Carbon/Carbon.h>\n//#include <ApplicationServices/ApplicationServices.h>\n\n#include \"CoreGraphics/CGGeometry.h\"\n\n#include <IOKit/pwr_mgt/IOPMLib.h>\n\n#define MAX_ENCODINGS 17\n\n/*\n * Per-screen (framebuffer) structure.  There is only one of these, since we\n * don't allow the X server to have multiple screens.\n */\n\ntypedef struct\n{\n    int width;\n    int paddedWidthInBytes;\n    int height;\n    int depth;\n    int bitsPerPixel;\n    int sizeInBytes;\n} rfbScreenInfo, *rfbScreenInfoPtr;\n\n\n/*\n * rfbTranslateFnType is the type of translation functions.\n */\n\nstruct rfbClientRec;\ntypedef void (*rfbTranslateFnType)(char *table,\n                                   rfbPixelFormat *in,\n                                   rfbPixelFormat *out,\n                                   char *iptr,\n                                   char *optr,\n                                   int bytesBetweenInputLines,\n                                   int width,\n                                   int height);\n\n\n/*\n * Per-client structure.\n */\n\nenum client_state {\n\tRFB_PROTOCOL_VERSION,   /* establishing protocol version */\n\tRFB_AUTH_VERSION,       /* establishing authentication version (3.7) */\n\tRFB_AUTHENTICATION,     /* authenticating */\n\tRFB_INITIALISATION,     /* sending initialisation messages */\n\tRFB_NORMAL              /* normal protocol messages */\n} ;\n\ntypedef struct rfbClientRec {\n\n    int sock;\n    char *host;\n    // Version\n    int major, minor;\n\n    pthread_mutex_t outputMutex;\n\n                                /* Possible client states: */\n    enum client_state state;\n\n    int correMaxWidth, correMaxHeight;\n    void* zrleData;\n    void* mosData;\n\n    /* The following member is only used during VNC authentication */\n\n    CARD8 authChallenge[CHALLENGESIZE];\n\n    /* The following members represent the update needed to get the client's\n       framebuffer from its present state to the current state of our\n       framebuffer.\n\n       The update is simply represented as the region of the screen\n       which has been modified (modifiedRegion).  CopyRect is not\n       supported, because there's no way I can get the OS to tell me\n       something has been copied.\n\n       updateMutex should be held, and updateCond signalled, whenever\n       either modifiedRegion or requestedRegion is changed (as either\n       of these may trigger sending an update out to the client). */\n\n    pthread_mutex_t updateMutex;\n    pthread_cond_t updateCond;\n\n    RegionRec modifiedRegion;\n\n    /* As part of the FramebufferUpdateRequest, a client can express interest\n       in a subrectangle of the whole framebuffer.  This is stored in the\n       requestedRegion member.  In the normal case this is the whole\n       framebuffer if the client is ready, empty if it's not. */\n\n    RegionRec requestedRegion;\n\n    /* translateFn points to the translation function which is used to copy\n       and translate a rectangle from the framebuffer to an output buffer. */\n\n    rfbTranslateFnType translateFn;\n\n    char *translateLookupTable;\n\n    rfbPixelFormat format;\n\n    /* SERVER SCALING EXTENSIONS */\n    int\t  scalingFactor;\n\tchar* screenBuffer;\n    char* scalingFrameBuffer;\n    int   scalingPaddedWidthInBytes;\n\n    /* statistics */\n\n    int rfbBytesSent[MAX_ENCODINGS];\n    int rfbRectanglesSent[MAX_ENCODINGS];\n    int rfbLastRectMarkersSent;\n    int rfbLastRectBytesSent;\n    int rfbFramebufferUpdateMessagesSent;\n    int rfbRawBytesEquivalent;\n    int rfbKeyEventsRcvd;\n    int rfbPointerEventsRcvd;\n\n  /* zlib encoding -- necessary compression state info per client */\n\n    struct z_stream_s compStream;\n    Bool compStreamInited;\n\n    CARD32 zlibCompressLevel;\n\n    struct z_stream_s compStreamRaw;\n    struct z_stream_s compStreamHex;\n\n    /*\n     * zlibBeforeBuf contains pixel data in the client's format.\n     * zlibAfterBuf contains the zlib (deflated) encoding version.\n     * If the zlib compressed/encoded version is\n     * larger than the raw data or if it exceeds zlibAfterBufSize then\n     * raw encoding is used instead.\n     */\n\n    int client_zlibBeforeBufSize;\n    char *client_zlibBeforeBuf;\n\n    int client_zlibAfterBufSize;\n    char *client_zlibAfterBuf;\n    int client_zlibAfterBufLen;\n\n    // These defines will \"hopefully\" allow us to keep the rest of the code looking roughly the same\n    // but reference them out of the client record pointer, where they need to be, instead of as globals\n#define zlibBeforeBufSize cl->client_zlibBeforeBufSize\n#define zlibBeforeBuf     cl->client_zlibBeforeBuf\n\n#define zlibAfterBufSize  cl->client_zlibAfterBufSize\n#define zlibAfterBuf      cl->client_zlibAfterBuf\n#define zlibAfterBufLen   cl->client_zlibAfterBufLen\n\n    /* tight encoding -- preserve zlib streams' state for each client */\n\n    z_stream zsStruct[4];\n    Bool zsActive[4];\n    int zsLevel[4];\n    int tightCompressLevel;\n    int tightQualityLevel;\n\n    Bool enableLastRectEncoding;   /* client supports LastRect encoding */\n    Bool enableXCursorShapeUpdates; /* client supports XCursor shape updates - Tight */\n    Bool useRichCursorEncoding;    /* rfbEncodingRichCursor is preferred : Tight and RFB - 3.7 */\n    Bool enableCursorPosUpdates;   /* client supports PointerPos updates - Tight */\n    Bool desktopSizeUpdate;        /* client supports dynamic desktop updates - Tight and RFB 3.7 */\n\n    Bool reverseConnection;\n    Bool readyForSetColourMapEntries;\n    Bool useCopyRect;\n\n    int preferredEncoding;\n\n    /* tight encoding -- This variable is set on every rfbSendRectEncodingTight() call. */\n    Bool usePixelFormat24;\n\n    /* tight encoding -- Compression level stuff. */\n\n    int compressLevel;\n    int qualityLevel;\n\n    /* tight encoding -- Stuff dealing with palettes. */\n\n    int paletteNumColors, paletteMaxColors;\n    CARD32 monoBackground, monoForeground;\n    PALETTE palette;\n\n    /* tight encoding -- Pointers to dynamically-allocated buffers. */\n\n    int tightBeforeBufSize;\n    char *tightBeforeBuf;\n\n    int tightAfterBufSize;\n    char *tightAfterBuf;\n\n    int *prevRowBuf;\n\n    /* tight encoding -- JPEG compression stuff. */\n\n    struct jpeg_destination_mgr jpegDstManager;\n    Bool jpegError;\n    int jpegDstDataLen;\n\n    j_compress_ptr cinfo;  /* tight encoding -- GetClient() uses this to map cinfos to client records */\n\n    // These defines will \"hopefully\" allow us to keep the rest of the code looking roughly the same\n    // but reference them out of the client record pointer, where they need to be, instead of as globals\n#define usePixelFormat24   cl->usePixelFormat24\n\n#define compressLevel      cl->compressLevel\n#define qualityLevel       cl->qualityLevel\n\n#define paletteNumColors   cl->paletteNumColors\n#define paletteMaxColors   cl->paletteMaxColors\n#define monoBackground     cl->monoBackground\n#define monoForeground     cl->monoForeground\n\n#define tightBeforeBufSize cl->tightBeforeBufSize\n#define tightBeforeBuf     cl->tightBeforeBuf\n#define tightAfterBufSize  cl->tightAfterBufSize\n#define tightAfterBuf      cl->tightAfterBuf\n#define prevRowBuf         cl->prevRowBuf\n\n#define jpegDstManager     cl->jpegDstManager\n#define jpegError          cl->jpegError\n#define jpegDstDataLen     cl->jpegDstDataLen\n\n    /* ZRLE -- Zlib Run Length Encoding Variable Space */\n\n    char client_zrleBeforeBuf[rfbZRLETileWidth * rfbZRLETileHeight * 4 + 4];\n\n    /* REDSTONE - Adding some features */\n\n    Bool disableRemoteEvents;      // Ignore PB, Keyboard and Mouse events\n    Bool swapMouseButtons23;       // How to interpret mouse buttons 2 & 3\n    Bool immediateUpdate;          // To request that we get immediate updates (even 0 rects)\n\n\tBool richClipboardSupport;     // Client has indicated they support rich clipboards\n\tvoid *richClipboardChangeCounts; // Dictionary of local ChangeCount NSNumbers stored by PB Name\n\n\t/* These store temporary values during a rich clipboard transfer (one at a time per client) */\n\tvoid *clipboardProxy;\n\tchar *richClipboardName;\n\tchar *richClipboardType;\n\tvoid *richClipboardNSData;\n\tint   richClipboardDataChangeCount;\n\n\tvoid *richClipboardReceivedName;\n\tvoid *richClipboardReceivedType;\n\tvoid *richClipboardReceivedNSData;\n\tvoid *receivedFileTempFolder;\n\tint   richClipboardReceivedChangeCount;\n\n\n    int generalPBLastChange;      // Used to see if we need to send the latest general PB\n\n\t// Cursor Info\n\n    int currentCursorSeed;         // Used to see if we need to send a new cursor\n    CGPoint clientCursorLocation;  // The last location the client left the mouse at\n\n    BOOL needNewScreenSize;        // Flag to indicate we must send a new screen resolution\n    BOOL modiferKeys[256];         // BOOL Array to record which keys THIS user has down, if they disconnect we will release those keys\n\n    /* REDSTONE - These (updateBuf, ublen) need to be in the CL, not global, for multiple clients */\n\tscreen_data_t * p_data;\n\n    /*\n     * UPDATE_BUF_SIZE must be big enough to send at least one whole line of the\n     * framebuffer.  So for a max screen width of say 2K with 32-bit pixels this\n     * means 8K minimum.\n     */\n\n#define UPDATE_BUF_SIZE 30000\n    char updateBuf[UPDATE_BUF_SIZE];\n    uint32_t ublen;\n\n    struct rfbClientRec *prev;\n    struct rfbClientRec *next;\n} rfbClientRec, *rfbClientPtr;\n\n\n/*\n * This macro creates an empty region (ie. a region with no areas) if it is\n * given a rectangle with a width or height of zero. It appears that\n * REGION_INTERSECT does not quite do the right thing with zero-width\n * rectangles, but it should with completely empty regions.\n */\n\n#define SAFE_REGION_INIT(pscreen, preg, rect, size)          \\\n{                                                            \\\n      if ( ( (rect) ) &&                                     \\\n           ( ( (rect)->x2 == (rect)->x1 ) ||                 \\\n             ( (rect)->y2 == (rect)->y1 ) ) ) {              \\\n          REGION_INIT( (pscreen), (preg), NullBox, 0 );      \\\n      } else {                                               \\\n          REGION_INIT( (pscreen), (preg), (rect), (size) );  \\\n      }                                                      \\\n}\n\n\n/*\n * Macros for endian swapping.\n */\n\n#define Swap16(s) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff))\n\n#define Swap32(l) (((l) >> 24) | \\\n                   (((l) & 0x00ff0000) >> 8)  | \\\n                   (((l) & 0x0000ff00) << 8)  | \\\n                   ((l) << 24))\n\n\n// NSByteOrder.h\n// kCGBitmapByteOrder32Host __i386__ __ppc__\n// kCGBitmapByteOrder16Big AC_C_BIGENDIAN\n// #define rfbEndianTest (0)\n\n#include <arpa/inet.h>\n\n#define Swap16IfLE(s) htons(s)\n#define Swap32IfLE(l) htonl(l)\n\n/* main.c */\n\nextern unsigned rfbProtocolMajorVersion;\nextern unsigned rfbProtocolMinorVersion;\n\nextern unsigned rfbPort;\n\nextern char *rfbGetFramebuffer(void);\nextern void rfbGetFramebufferUpdateInRect(int x, int y, int w, int h);\n\nextern void rfbStartClientWithFD(int client_fd);\nextern void connectReverseClient(char *hostName, int portNum);\n\nextern rfbScreenInfo rfbScreen;\n\nextern char desktopName[256];\n\nextern BOOL littleEndian;\nextern int  rfbMaxBitDepth;\nextern Bool rfbAlwaysShared;\nextern Bool rfbNeverShared;\nextern Bool rfbDontDisconnect;\nextern Bool rfbReverseMods;\n\nextern Bool rfbSwapButtons;\nextern Bool rfbDisableRemote;\nextern Bool rfbDisableRichClipboards;\n\nextern Bool rfbLocalBuffer;\n\nextern void rfbLog(char *format, ...);\nextern void rfbDebugLog(char *format, ...);\nextern void rfbLogPerror(char *str);\n\nextern void rfbShutdown(void);\n\n/* sockets.c */\n\nextern int rfbMaxClientWait;\n\nextern void rfbCloseClient(rfbClientPtr cl);\nextern int ReadExact(rfbClientPtr cl, void *buf, size_t len);\nextern int WriteExact(rfbClientPtr cl, const void *buf, size_t len);\n\n/* cutpaste.c */\n\nextern void initPasteboard(void);\nextern void initPasteboardForClient(rfbClientPtr cl);\nextern void freePasteboardForClient(rfbClientPtr cl);\n\nextern void rfbSetCutText(rfbClientPtr cl, char *str, int len);\nextern void rfbCheckForPasteboardChange(void);\nextern void rfbClientUpdatePasteboard(rfbClientPtr cl);\n\nextern void rfbReceiveRichClipboardAvailable(rfbClientPtr cl);\nextern void rfbReceiveRichClipboardRequest(rfbClientPtr cl);\nextern void rfbReceiveRichClipboardData(rfbClientPtr cl);\n\n/* kbdptr.c */\n\nextern void PtrAddEvent(int buttonMask, int x, int y, rfbClientPtr cl);\nextern void KbdAddEvent(Bool down, KeySym keySym, rfbClientPtr cl);\nextern void keyboardReleaseKeysForClient(rfbClientPtr cl);\n\n/* rfbserver.c */\n\n//extern char updateBuf[UPDATE_BUF_SIZE];\n//extern int ublen;\n\nextern rfbClientPtr pointerClient;\n\nextern rfbClientPtr rfbClientHead;  /* tight encoding -- GetClient() in tight.c accesses this list, so make it global */\n\nextern void rfbProcessClientProtocolVersion(rfbClientPtr cl);\nextern void rfbProcessClientNormalMessage(rfbClientPtr cl);\nextern void rfbProcessClientInitMessage(rfbClientPtr cl);\nextern Bool rfbSendScreenUpdateEncoding(rfbClientPtr cl);\nextern Bool rfbSendLastRectMarker(rfbClientPtr cl);\n\n\n/* Routines to iterate over the client list in a thread-safe way.\n   Only a single iterator can be in use at a time process-wide. */\ntypedef struct rfbClientIterator *rfbClientIteratorPtr;\n\nextern void rfbClientListInit(void);\nextern rfbClientIteratorPtr rfbGetClientIterator(void);\nextern rfbClientPtr rfbClientIteratorNext(rfbClientIteratorPtr iterator);\nextern void rfbReleaseClientIterator(rfbClientIteratorPtr iterator);\nextern Bool rfbClientsConnected(void);\n\nextern void rfbNewClientConnection(int sock);\nextern rfbClientPtr rfbNewClient(int sock);\nextern rfbClientPtr rfbReverseConnection(char *host, int port);\nextern void rfbClientConnectionGone(rfbClientPtr cl);\nextern void rfbProcessClientMessage(rfbClientPtr cl);\nextern void rfbClientConnFailed(rfbClientPtr cl, char *reason);\nextern void rfbNewUDPConnection(int sock);\nextern void rfbProcessUDPInput(int sock);\nextern Bool rfbSendFramebufferUpdate(rfbClientPtr cl, RegionRec updateRegion);\nextern Bool rfbSendRectEncodingRaw(rfbClientPtr cl, int x,int y,int w,int h);\nextern Bool rfbSendUpdateBuf(rfbClientPtr cl);\nextern void rfbSendServerCutText(rfbClientPtr cl, char *str, size_t len);\n\nextern void setScaling (rfbClientPtr cl);\n\n/* translate.c */\n\n/*\n * Macro to compare pixel formats.\n */\n\n#define PF_EQ(x,y)                                                  \\\n((x.bitsPerPixel == y.bitsPerPixel) &&                          \\\n (x.depth == y.depth) &&                                        \\\n ((x.bigEndian == y.bigEndian) || (x.bitsPerPixel == 8)) &&     \\\n (x.trueColour == y.trueColour) &&                              \\\n (!x.trueColour || ((x.redMax == y.redMax) &&                   \\\n                    (x.greenMax == y.greenMax) &&               \\\n                    (x.blueMax == y.blueMax) &&                 \\\n                    (x.redShift == y.redShift) &&               \\\n                    (x.greenShift == y.greenShift) &&           \\\n                    (x.blueShift == y.blueShift))))\n\n\n\nextern Bool rfbEconomicTranslate;\nextern rfbPixelFormat rfbServerFormat;\n\nextern void rfbTranslateNone(char *table, rfbPixelFormat *in,\n                             rfbPixelFormat *out,\n                             char *iptr, char *optr,\n                             int bytesBetweenInputLines,\n                             int width, int height);\nextern Bool rfbSetTranslateFunction(rfbClientPtr cl);\nextern Bool rfbSetTranslateFunctionUsingFormat(rfbClientPtr cl, rfbPixelFormat inFormat);\nextern void PrintPixelFormat(rfbPixelFormat *pf);\n\n\n/* httpd.c */\n\nextern int httpPort;\nextern char *httpDir;\n\nextern void httpInitSockets(void);\nextern void httpCheckFds(void);\n\n\n\n/* auth.c */\n\nextern Bool allowNoAuth;\nextern char *rfbAuthPasswdFile;\nextern Bool rfbAuthenticating;\nextern int rfbMaxLoginAttempts;\n\nextern void rfbAuthInit(void);\nextern void rfbAuthNewClient(rfbClientPtr cl);\nextern void rfbProcessAuthVersion(rfbClientPtr cl);\nextern void rfbAuthProcessClientMessage(rfbClientPtr cl);\n\nextern bool enterSuppliedPassword(char *passIn);\n\n/* rre.c */\n\nextern Bool rfbSendRectEncodingRRE(rfbClientPtr cl, int x,int y,int w,int h);\n\n\n/* corre.c */\n\nextern Bool rfbSendRectEncodingCoRRE(rfbClientPtr cl, int x,int y,int w,int h);\n\n\n/* hextile.c */\n\nextern Bool rfbSendRectEncodingHextile(rfbClientPtr cl, int x, int y, int w,\n                                       int h);\n\n/* zlib.c */\n\n/* Minimum zlib rectangle size in bytes.  Anything smaller will\n * not compress well due to overhead.\n */\n#define VNC_ENCODE_ZLIB_MIN_COMP_SIZE (17)\n\n/* Set maximum zlib rectangle size in pixels.  Always allow at least\n * two scan lines.\n */\n#define ZLIB_MAX_RECT_SIZE (128*256)\n#define ZLIB_MAX_SIZE(min) ((( min * 2 ) > ZLIB_MAX_RECT_SIZE ) ? \\\n                            ( min * 2 ) : ZLIB_MAX_RECT_SIZE )\n\nextern Bool rfbSendRectEncodingZlib(rfbClientPtr cl, int x, int y, int w,\n                                    int h);\n\n/* tight.c */\n\n#define TIGHT_DEFAULT_COMPRESSION  6\n\nextern Bool rfbTightDisableGradient;\n\nextern int rfbNumCodedRectsTight(rfbClientPtr cl, int x,int y,int w,int h);\nextern Bool rfbSendRectEncodingTight(rfbClientPtr cl, int x,int y,int w,int h);\n\n\n/* zlibhex.c */\n\n/* Minimum zlibhex tile size in bytes.  Anything smaller will\n * not compress well due to overhead.\n */\n#define VNC_ENCODE_ZLIBHEX_MIN_COMP_SIZE (17)\n\n/* Compressor state uninitialized value.  Changed after one time\n * initialization.\n */\n#define ZLIBHEX_COMP_UNINITED (-1)\n\nextern Bool rfbSendRectEncodingZlibHex(rfbClientPtr cl, int x, int y, int w,\n                                          int h);\n\n/* zrle.c */\n\nextern Bool rfbSendRectEncodingZRLE(rfbClientPtr cl, int x, int y, int w,\n                                    int h);\nextern void FreeZrleData(rfbClientPtr cl);\n\n/* stats.c */\n\nextern char* encNames[];\n\nextern void rfbResetStats(rfbClientPtr cl);\nextern void rfbPrintStats(rfbClientPtr cl);\n\n\n/* dimming.c */\n\nextern Bool rfbNoDimming;\nextern Bool rfbNoSleep;\nextern IOPMAssertionID userActivityLastAssertionId;\n\nextern int rfbDimmingInit(void);\nextern int rfbUndim(void);\nextern int rfbDimmingShutdown(void);\n\n/* mousecursor.c */\n\nextern void GetCursorInfo(void);\nextern void rfbCheckForCursorChange(void);\nextern Bool rfbShouldSendNewCursor(rfbClientPtr cl);\nextern Bool rfbShouldSendNewPosition(rfbClientPtr cl);\n\nextern Bool rfbSendRichCursorUpdate(rfbClientPtr cl);\nextern Bool rfbSendCursorPos(rfbClientPtr cl);\n\n/* screencapture.c */\n\nscreen_data_t *screen_InitCapture(void);\nextern char *screen_Capture (screen_data_t *p_data);\nextern void screen_CloseCapture (screen_data_t *p_data);\n\n"
  },
  {
    "path": "OSXvnc-server/rfbproto.h",
    "content": "/*\n *  Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n/*\n * rfbproto.h - header file for the RFB protocol version 3.3\n *\n * Uses types CARD<n> for an n-bit unsigned integer, INT<n> for an n-bit signed\n * integer (for n = 8, 16 and 32).\n *\n * All multiple byte integers are in big endian (network) order (most\n * significant byte first).  Unless noted otherwise there is no special\n * alignment of protocol structures.\n *\n *\n * Once the initial handshaking is done, all messages start with a type byte,\n * (usually) followed by message-specific data.  The order of definitions in\n * this file is as follows:\n *\n *  (1) Structures used in several types of message.\n *  (2) Structures used in the initial handshaking.\n *  (3) Message types.\n *  (4) Encoding types.\n *  (5) For each message type, the form of the data following the type byte.\n *      Sometimes this is defined by a single structure but the more complex\n *      messages have to be explained by comments.\n */\n\n/*****************************************************************************\n *\n * Structures used in several messages\n *\n *****************************************************************************/\n\n/*-----------------------------------------------------------------------------\n * Structure used to specify a rectangle.  This structure is a multiple of 4\n * bytes so that it can be interspersed with 32-bit pixel data without\n * affecting alignment.\n */\n\ntypedef struct {\n    CARD16 x;\n    CARD16 y;\n    CARD16 w;\n    CARD16 h;\n} rfbRectangle;\n\n#define sz_rfbRectangle 8\n\n\n/*-----------------------------------------------------------------------------\n * Structure used to specify pixel format.\n */\n\ntypedef struct {\n\n    CARD8 bitsPerPixel;         /* 8,16,32 only */\n\n    CARD8 depth;                /* 8 to 32 */\n\n    CARD8 bigEndian;            /* True if multi-byte pixels are interpreted\n                                   as big endian, or if single-bit-per-pixel\n                                   has most significant bit of the byte\n                                   corresponding to first (leftmost) pixel. Of\n                                   course this is meaningless for 8 bits/pix */\n\n    CARD8 trueColour;           /* If false then we need a \"colour map\" to\n                                   convert pixels to RGB.  If true, xxxMax and\n                                   xxxShift specify bits used for red, green\n                                   and blue */\n\n    /* the following fields are only meaningful if trueColour is true */\n\n    CARD16 redMax;              /* maximum red value (= 2^n - 1 where n is the\n                                   number of bits used for red). Note this\n                                   value is always in big endian order. */\n\n    CARD16 greenMax;            /* similar for green */\n\n    CARD16 blueMax;             /* and blue */\n\n    CARD8 redShift;             /* number of shifts needed to get the red\n                                   value in a pixel to the least significant\n                                   bit. To find the red value from a given\n                                   pixel, do the following:\n                                   1) Swap pixel value according to bigEndian\n                                      (e.g. if bigEndian is false and host byte\n                                      order is big endian, then swap).\n                                   2) Shift right by redShift.\n                                   3) AND with redMax (in host byte order).\n                                   4) You now have the red value between 0 and\n                                      redMax. */\n\n    CARD8 greenShift;           /* similar for green */\n\n    CARD8 blueShift;            /* and blue */\n\n    CARD8 pad1;\n    CARD16 pad2;\n\n} rfbPixelFormat;\n\n#define sz_rfbPixelFormat 16\n\n\n\n/*****************************************************************************\n *\n * Initial handshaking messages\n *\n *****************************************************************************/\n\n/*-----------------------------------------------------------------------------\n * Protocol Version\n *\n * The server always sends 12 bytes to start which identifies the latest RFB\n * protocol version number which it supports.  These bytes are interpreted\n * as a string of 12 ASCII characters in the format \"RFB xxx.yyy\\n\" where\n * xxx and yyy are the major and minor version numbers (for version 3.3\n * this is \"RFB 003.003\\n\").\n *\n * The client then replies with a similar 12-byte message giving the version\n * number of the protocol which should actually be used (which may be different\n * to that quoted by the server).\n *\n * It is intended that both clients and servers may provide some level of\n * backwards compatibility by this mechanism.  Servers in particular should\n * attempt to provide backwards compatibility, and even forwards compatibility\n * to some extent.  For example if a client demands version 3.1 of the\n * protocol, a 3.0 server can probably assume that by ignoring requests for\n * encoding types it doesn't understand, everything will still work OK.  This\n * will probably not be the case for changes in the major version number.\n *\n * The format string below can be used in sprintf or sscanf to generate or\n * decode the version string respectively.\n */\n\n#define rfbProtocolVersionFormat \"RFB %03d.%03d\\n\"\n\ntypedef char rfbProtocolVersionMsg[13]; /* allow extra byte for null */\n\n#define sz_rfbProtocolVersionMsg 12\n\n\n/*-----------------------------------------------------------------------------\n * Authentication\n *\n * Once the protocol version has been decided, the server then sends a 32-bit\n * word indicating whether any authentication is needed on the connection.\n * The value of this word determines the authentication scheme in use.  For\n * version 3.0 of the protocol this may have one of the following values:\n */\n\n#define rfbConnFailed 0\n#define rfbNoAuth 1\n#define rfbVncAuth 2\n\n// Defined (but unsupported Authentication Protocols)\n#define rfbRA2     5\n#define rfbRA2ne   6\n#define rfbTight   16\n#define rfbUltra   17\n#define rfbTLS     18\n\n#define rfbJAMF    32\n\n/*\n * rfbConnFailed:       For some reason the connection failed (e.g. the server\n *                      cannot support the desired protocol version).  This is\n *                      followed by a string describing the reason (where a\n *                      string is specified as a 32-bit length followed by that\n *                      many ASCII characters).\n *\n * rfbNoAuth:           No authentication is needed.\n *\n * rfbVncAuth:          The VNC authentication scheme is to be used.  A 16-byte\n *                      challenge follows, which the client encrypts as\n *                      appropriate using the password and sends the resulting\n *                      16-byte response.  If the response is correct, the\n *                      server sends the 32-bit word rfbVncAuthOK.  If a simple\n *                      failure happens, the server sends rfbVncAuthFailed and\n *                      closes the connection. If the server decides that too\n *                      many failures have occurred, it sends rfbVncAuthTooMany\n *                      and closes the connection.  In the latter case, the\n *                      server should not allow an immediate reconnection by\n *                      the client.\n */\n\n#define rfbVncAuthOK 0\n#define rfbVncAuthFailed 1\n#define rfbVncAuthTooMany 2\n\n\n/*-----------------------------------------------------------------------------\n * Client Initialisation Message\n *\n * Once the client and server are sure that they're happy to talk to one\n * another, the client sends an initialisation message.  At present this\n * message only consists of a boolean indicating whether the server should try\n * to share the desktop by leaving other clients connected, or give exclusive\n * access to this client by disconnecting all other clients.\n */\n\ntypedef struct {\n    CARD8 shared;\n} rfbClientInitMsg;\n\n#define sz_rfbClientInitMsg 1\n\n\n/*-----------------------------------------------------------------------------\n * Server Initialisation Message\n *\n * After the client initialisation message, the server sends one of its own.\n * This tells the client the width and height of the server's framebuffer,\n * its pixel format and the name associated with the desktop.\n */\n\ntypedef struct {\n    CARD16 framebufferWidth;\n    CARD16 framebufferHeight;\n    rfbPixelFormat format;      /* the server's preferred pixel format */\n    CARD32 nameLength;\n    /* followed by char name[nameLength] */\n} rfbServerInitMsg;\n\n#define sz_rfbServerInitMsg (8 + sz_rfbPixelFormat)\n\n\n/*\n * Following the server initialisation message it's up to the client to send\n * whichever protocol messages it wants.  Typically it will send a\n * SetPixelFormat message and a SetEncodings message, followed by a\n * FramebufferUpdateRequest.  From then on the server will send\n * FramebufferUpdate messages in response to the client's\n * FramebufferUpdateRequest messages.  The client should send\n * FramebufferUpdateRequest messages with incremental set to true when it has\n * finished processing one FramebufferUpdate and is ready to process another.\n * With a fast client, the rate at which FramebufferUpdateRequests are sent\n * should be regulated to avoid hogging the network.\n */\n\n\n\n/*****************************************************************************\n *\n * Message types\n *\n *****************************************************************************/\n\n/* server -> client */\n\n#define rfbFramebufferUpdate 0\n#define rfbSetColourMapEntries 1\n#define rfbBell 2\n#define rfbServerCutText 3\n#define rfbReSizeFrameBuffer 0xF\n\n/* client -> server */\n\n#define rfbSetPixelFormat 0\n#define rfbFixColourMapEntries 1        /* not currently supported */\n#define rfbSetEncodings 2\n#define rfbFramebufferUpdateRequest 3\n#define rfbKeyEvent 4\n#define rfbPointerEvent 5\n#define rfbClientCutText 6\n\n#define rfbSetScaleFactorULTRA 8\n#define rfbSetScaleFactor 0xF\n\n#define rfbRichClipboardAvailable   0x83\n#define rfbRichClipboardRequest     0x84\n#define rfbRichClipboardData        0x85\n\n\n/*****************************************************************************\n *\n * Encoding types\n *\n *****************************************************************************/\n\n#define rfbEncodingRaw 0\n#define rfbEncodingCopyRect 1\n#define rfbEncodingRRE 2\n#define rfbEncodingCoRRE 4\n#define rfbEncodingHextile 5\n#define rfbEncodingZlib 6\n#define rfbEncodingTight 7\n#define rfbEncodingZlibHex 8\n#define rfbEncodingUltra 9\n\n#define rfbStatsRichCursor         10\n#define rfbStatsCursorPosition     11\n#define rfbStatsDesktopResize      12\n\n#define rfbEncodingZRLE 16\n\n/* Redstone Software\n\n   Special Encodings\n\n   rfbImmediateUpdate\n    Sending this encoding asks the server to respond immediately\n    upon seeing a FBU request and not wait to consolidate events\n    and not to wait for an update to occur\n   rfbPasteboardError\n    Asks that OSXvnc should send an error message (in the form of a cut message)\n    if the pasteboard is not accessible.\n\n*/\n#define rfbImmediateUpdate   0x80000000\n#define rfbPasteboardRequest 0x80010000\n#define rfbRichPasteboard    0x80010001\n\n\n/* TightVNC\n *\n * Special encoding numbers:\n *   0xFFFFFF00 .. 0xFFFFFF0F -- encoding-specific compression levels;\n *   0xFFFFFF10 .. 0xFFFFFF1F -- mouse cursor shape data;\n *   0xFFFFFF20 .. 0xFFFFFF2F -- various protocol extensions;\n *   0xFFFFFF30 .. 0xFFFFFFDF -- not allocated yet;\n *   0xFFFFFFE0 .. 0xFFFFFFEF -- quality level for JPEG compressor;\n *   0xFFFFFFF0 .. 0xFFFFFFFF -- cross-encoding compression levels.\n */\n\n#define rfbEncodingCompressLevel0  0xFFFFFF00\n#define rfbEncodingCompressLevel1  0xFFFFFF01\n#define rfbEncodingCompressLevel2  0xFFFFFF02\n#define rfbEncodingCompressLevel3  0xFFFFFF03\n#define rfbEncodingCompressLevel4  0xFFFFFF04\n#define rfbEncodingCompressLevel5  0xFFFFFF05\n#define rfbEncodingCompressLevel6  0xFFFFFF06\n#define rfbEncodingCompressLevel7  0xFFFFFF07\n#define rfbEncodingCompressLevel8  0xFFFFFF08\n#define rfbEncodingCompressLevel9  0xFFFFFF09\n\n#define rfbEncodingXCursor         0xFFFFFF10\n#define rfbEncodingRichCursor      0xFFFFFF11\n#define rfbEncodingPointerPos      0xFFFFFF18\n\n#define rfbEncodingLastRect        0xFFFFFF20\n#define rfbEncodingDesktopResize   0xFFFFFF21\n\n#define rfbEncodingQualityLevel0   0xFFFFFFE0\n#define rfbEncodingQualityLevel1   0xFFFFFFE1\n#define rfbEncodingQualityLevel2   0xFFFFFFE2\n#define rfbEncodingQualityLevel3   0xFFFFFFE3\n#define rfbEncodingQualityLevel4   0xFFFFFFE4\n#define rfbEncodingQualityLevel5   0xFFFFFFE5\n#define rfbEncodingQualityLevel6   0xFFFFFFE6\n#define rfbEncodingQualityLevel7   0xFFFFFFE7\n#define rfbEncodingQualityLevel8   0xFFFFFFE8\n#define rfbEncodingQualityLevel9   0xFFFFFFE9\n\n\n\n/*****************************************************************************\n *\n * Server -> client message definitions\n *\n *****************************************************************************/\n\n\n/*-----------------------------------------------------------------------------\n * FramebufferUpdate - a block of rectangles to be copied to the framebuffer.\n *\n * This message consists of a header giving the number of rectangles of pixel\n * data followed by the rectangles themselves.  The header is padded so that\n * together with the type byte it is an exact multiple of 4 bytes (to help\n * with alignment of 32-bit pixels):\n */\n\ntypedef struct {\n    CARD8 type;                 /* always rfbFramebufferUpdate */\n    CARD8 pad;\n    CARD16 nRects;\n    /* followed by nRects rectangles */\n} rfbFramebufferUpdateMsg;\n\n#define sz_rfbFramebufferUpdateMsg 4\n\n/*\n * Each rectangle of pixel data consists of a header describing the position\n * and size of the rectangle and a type word describing the encoding of the\n * pixel data, followed finally by the pixel data.  Note that if the client has\n * not sent a SetEncodings message then it will only receive raw pixel data.\n * Also note again that this structure is a multiple of 4 bytes.\n */\n\ntypedef struct {\n    rfbRectangle r;\n    CARD32 encoding;    /* one of the encoding types rfbEncoding... */\n} rfbFramebufferUpdateRectHeader;\n\n#define sz_rfbFramebufferUpdateRectHeader (sz_rfbRectangle + 4)\n\n\n/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n * Raw Encoding.  Pixels are sent in top-to-bottom scanline order,\n * left-to-right within a scanline with no padding in between.\n */\n\n\n/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n * CopyRect Encoding.  The pixels are specified simply by the x and y position\n * of the source rectangle.\n */\n\ntypedef struct {\n    CARD16 srcX;\n    CARD16 srcY;\n} rfbCopyRect;\n\n#define sz_rfbCopyRect 4\n\n\n/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n * RRE - Rise-and-Run-length Encoding.  We have an rfbRREHeader structure\n * giving the number of subrectangles following.  Finally the data follows in\n * the form [<bgpixel><subrect><subrect>...] where each <subrect> is\n * [<pixel><rfbRectangle>].\n */\n\ntypedef struct {\n    CARD32 nSubrects;\n} rfbRREHeader;\n\n#define sz_rfbRREHeader 4\n\n\n/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n * CoRRE - Compact RRE Encoding.  We have an rfbRREHeader structure giving\n * the number of subrectangles following.  Finally the data follows in the form\n * [<bgpixel><subrect><subrect>...] where each <subrect> is\n * [<pixel><rfbCoRRERectangle>].  This means that\n * the whole rectangle must be at most 255x255 pixels.\n */\n\ntypedef struct {\n    CARD8 x;\n    CARD8 y;\n    CARD8 w;\n    CARD8 h;\n} rfbCoRRERectangle;\n\n#define sz_rfbCoRRERectangle 4\n\n\n/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n * Hextile Encoding.  The rectangle is divided up into \"tiles\" of 16x16 pixels,\n * starting at the top left going in left-to-right, top-to-bottom order.  If\n * the width of the rectangle is not an exact multiple of 16 then the width of\n * the last tile in each row will be correspondingly smaller.  Similarly if the\n * height is not an exact multiple of 16 then the height of each tile in the\n * final row will also be smaller.  Each tile begins with a \"subencoding\" type\n * byte, which is a mask made up of a number of bits.  If the Raw bit is set\n * then the other bits are irrelevant; w*h pixel values follow (where w and h\n * are the width and height of the tile).  Otherwise the tile is encoded in a\n * similar way to RRE, except that the position and size of each subrectangle\n * can be specified in just two bytes.  The other bits in the mask are as\n * follows:\n *\n * BackgroundSpecified - if set, a pixel value follows which specifies\n *    the background colour for this tile.  The first non-raw tile in a\n *    rectangle must have this bit set.  If this bit isn't set then the\n *    background is the same as the last tile.\n *\n * ForegroundSpecified - if set, a pixel value follows which specifies\n *    the foreground colour to be used for all subrectangles in this tile.\n *    If this bit is set then the SubrectsColoured bit must be zero.\n *\n * AnySubrects - if set, a single byte follows giving the number of\n *    subrectangles following.  If not set, there are no subrectangles (i.e.\n *    the whole tile is just solid background colour).\n *\n * SubrectsColoured - if set then each subrectangle is preceded by a pixel\n *    value giving the colour of that subrectangle.  If not set, all\n *    subrectangles are the same colour, the foreground colour;  if the\n *    ForegroundSpecified bit wasn't set then the foreground is the same as\n *    the last tile.\n *\n * The position and size of each subrectangle is specified in two bytes.  The\n * Pack macros below can be used to generate the two bytes from x, y, w, h,\n * and the Extract macros can be used to extract the x, y, w, h values from\n * the two bytes.\n */\n\n#define rfbHextileRaw                   (1 << 0)\n#define rfbHextileBackgroundSpecified   (1 << 1)\n#define rfbHextileForegroundSpecified   (1 << 2)\n#define rfbHextileAnySubrects           (1 << 3)\n#define rfbHextileSubrectsColoured      (1 << 4)\n#define rfbHextileZlibRaw               (1 << 5)\n#define rfbHextileZlibHex               (1 << 6)\n\n#define rfbHextilePackXY(x,y) (((x) << 4) | (y))\n#define rfbHextilePackWH(w,h) ((((w)-1) << 4) | ((h)-1))\n#define rfbHextileExtractX(byte) ((byte) >> 4)\n#define rfbHextileExtractY(byte) ((byte) & 0xf)\n#define rfbHextileExtractW(byte) (((byte) >> 4) + 1)\n#define rfbHextileExtractH(byte) (((byte) & 0xf) + 1)\n\n\n/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n * zlib - zlib compressed Encoding.  We have an rfbZlibHeader structure\n * giving the number of bytes following.  Finally the data follows is\n * zlib compressed version of the raw pixel data as negotiated.\n */\n\ntypedef struct {\n    CARD32 nBytes;\n} rfbZlibHeader;\n\n#define sz_rfbZlibHeader 4\n\n/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n * ZRLE - encoding combining Zlib compression, tiling, palettisation and\n * run-length encoding.\n */\n\ntypedef struct {\n    CARD32 length;\n} rfbZRLEHeader;\n\n#define sz_rfbZRLEHeader 4\n\n#define rfbZRLETileWidth 64\n#define rfbZRLETileHeight 64\n\n/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n * Tight Encoding.  FIXME: Add more documentation.\n */\n\n#define rfbTightExplicitFilter         0x04\n#define rfbTightFill                   0x08\n#define rfbTightJpeg                   0x09\n#define rfbTightMaxSubencoding         0x09\n\n/* Filters to improve compression efficiency */\n#define rfbTightFilterCopy             0x00\n#define rfbTightFilterPalette          0x01\n#define rfbTightFilterGradient         0x02\n\n\n/*-----------------------------------------------------------------------------\n * SetColourMapEntries - these messages are only sent if the pixel\n * format uses a \"colour map\" (i.e. trueColour false) and the client has not\n * fixed the entire colour map using FixColourMapEntries.  In addition they\n * will only start being sent after the client has sent its first\n * FramebufferUpdateRequest.  So if the client always tells the server to use\n * trueColour then it never needs to process this type of message.\n */\n\ntypedef struct {\n    CARD8 type;                 /* always rfbSetColourMapEntries */\n    CARD8 pad;\n    CARD16 firstColour;\n    CARD16 nColours;\n\n    /* Followed by nColours * 3 * CARD16\n       r1, g1, b1, r2, g2, b2, r3, g3, b3, ..., rn, bn, gn */\n\n} rfbSetColourMapEntriesMsg;\n\n#define sz_rfbSetColourMapEntriesMsg 6\n\n\n\n/*-----------------------------------------------------------------------------\n * Bell - ring a bell on the client if it has one.\n */\n\ntypedef struct {\n    CARD8 type;                 /* always rfbBell */\n} rfbBellMsg;\n\n#define sz_rfbBellMsg 1\n\n\n\n/*-----------------------------------------------------------------------------\n * ServerCutText - the server has new text in its cut buffer.\n */\n\ntypedef struct {\n    CARD8 type;                 /* always rfbServerCutText */\n    CARD8 pad1;\n    CARD16 pad2;\n    CARD32 length;\n    /* followed by char text[length] */\n} rfbServerCutTextMsg;\n\n#define sz_rfbServerCutTextMsg 8\n\n/*-----------------------------------------------------------------------------\n * ReSizeFrameBuffer - tell the RFB client to alter its framebuffer, either\n * due to a resize of the server desktop or a client-requested scaling factor.\n * The pixel format remains unchanged.\n */\n\ntypedef struct {\n    CARD8 type;\t\t\t/* always rfbReSizeFrameBuffer */\n\tCARD8 pad1;\n\tCARD16 desktop_w;\t/* Desktop width */\n\tCARD16 desktop_h;\t/* Desktop height */\n\tCARD16 buffer_w;\t/* FrameBuffer width */\n\tCARD16 buffer_h;\t/* Framebuffer height */\n    CARD16 pad2;\n\n} rfbReSizeFrameBufferMsg;\n\n#define sz_rfbReSizeFrameBufferMsg (12)\n\n\n/*-----------------------------------------------------------------------------\n * Union of all server->client messages.\n */\n\ntypedef union {\n    CARD8 type;\n    rfbFramebufferUpdateMsg fu;\n    rfbSetColourMapEntriesMsg scme;\n    rfbBellMsg b;\n    rfbServerCutTextMsg sct;\n    rfbReSizeFrameBufferMsg rsfb;\n} rfbServerToClientMsg;\n\n\n\n/*****************************************************************************\n *\n * Message definitions (client -> server)\n *\n *****************************************************************************/\n\n\n/*-----------------------------------------------------------------------------\n * SetPixelFormat - tell the RFB server the format in which the client wants\n * pixels sent.\n */\n\ntypedef struct {\n    CARD8 type;                 /* always rfbSetPixelFormat */\n    CARD8 pad1;\n    CARD16 pad2;\n    rfbPixelFormat format;\n} rfbSetPixelFormatMsg;\n\n#define sz_rfbSetPixelFormatMsg (sz_rfbPixelFormat + 4)\n\n\n/*-----------------------------------------------------------------------------\n * FixColourMapEntries - when the pixel format uses a \"colour map\", fix\n * read-only colour map entries.\n *\n *    ***************** NOT CURRENTLY SUPPORTED *****************\n */\n\ntypedef struct {\n    CARD8 type;                 /* always rfbFixColourMapEntries */\n    CARD8 pad;\n    CARD16 firstColour;\n    CARD16 nColours;\n\n    /* Followed by nColours * 3 * CARD16\n       r1, g1, b1, r2, g2, b2, r3, g3, b3, ..., rn, bn, gn */\n\n} rfbFixColourMapEntriesMsg;\n\n#define sz_rfbFixColourMapEntriesMsg 6\n\n\n/*-----------------------------------------------------------------------------\n * SetEncodings - tell the RFB server which encoding types we accept.  Put them\n * in order of preference, if we have any.  We may always receive raw\n * encoding, even if we don't specify it here.\n */\n\ntypedef struct {\n    CARD8 type;                 /* always rfbSetEncodings */\n    CARD8 pad;\n    CARD16 nEncodings;\n    /* followed by nEncodings * CARD32 encoding types */\n} rfbSetEncodingsMsg;\n\n#define sz_rfbSetEncodingsMsg 4\n\n/*-----------------------------------------------------------------------------\n * SetScaleFactor - tell the RFB server to alter the scale factor for the\n * client buffer.\n */\n\ntypedef struct {\n    CARD8 type;\t\t\t/* always rfbSetScaleFactor */\n    CARD8 scale;\t\t/* Scale factor (positive non-zero integer) */\n    CARD16 pad2;\n} rfbSetScaleFactorMsg;\n\n#define sz_rfbSetScaleFactorMsg (4)\n\n/*-----------------------------------------------------------------------------\n * FramebufferUpdateRequest - request for a framebuffer update.  If incremental\n * is true then the client just wants the changes since the last update.  If\n * false then it wants the whole of the specified rectangle.\n */\n\ntypedef struct {\n    CARD8 type;                 /* always rfbFramebufferUpdateRequest */\n    CARD8 incremental;\n    CARD16 x;\n    CARD16 y;\n    CARD16 w;\n    CARD16 h;\n} rfbFramebufferUpdateRequestMsg;\n\n#define sz_rfbFramebufferUpdateRequestMsg 10\n\n\n/*-----------------------------------------------------------------------------\n * KeyEvent - key press or release\n *\n * Keys are specified using the \"keysym\" values defined by the X Window System.\n * For most ordinary keys, the keysym is the same as the corresponding ASCII\n * value.  Other common keys are:\n *\n * BackSpace            0xff08\n * Tab                  0xff09\n * Return or Enter      0xff0d\n * Escape               0xff1b\n * Insert               0xff63\n * Delete               0xffff\n * Home                 0xff50\n * End                  0xff57\n * Page Up              0xff55\n * Page Down            0xff56\n * Left                 0xff51\n * Up                   0xff52\n * Right                0xff53\n * Down                 0xff54\n * F1                   0xffbe\n * F2                   0xffbf\n * ...                  ...\n * F12                  0xffc9\n * Shift                0xffe1\n * Control              0xffe3\n * Meta                 0xffe7\n * Alt                  0xffe9\n */\n\ntypedef struct {\n    CARD8 type;                 /* always rfbKeyEvent */\n    CARD8 down;                 /* true if down (press), false if up */\n    CARD16 pad;\n    CARD32 key;                 /* key is specified as an X keysym */\n} rfbKeyEventMsg;\n\n#define sz_rfbKeyEventMsg 8\n\n\n/*-----------------------------------------------------------------------------\n * PointerEvent - mouse/pen move and/or button press.\n */\n\ntypedef struct {\n    CARD8 type;                 /* always rfbPointerEvent */\n    CARD8 buttonMask;           /* bits 0-7 are buttons 1-8, 0=up, 1=down */\n    CARD16 x;\n    CARD16 y;\n} rfbPointerEventMsg;\n\n#define rfbButton1Mask 1\n#define rfbButton2Mask 2\n#define rfbButton3Mask 4\n#define rfbButton4Mask 8\n#define rfbButton5Mask 16\n#define rfbWheelUpMask rfbButton4Mask\n#define rfbWheelDownMask rfbButton5Mask\n#define rfbWheelMask (rfbWheelUpMask | rfbWheelDownMask)\n\n#define sz_rfbPointerEventMsg 6\n\n\n\n/*-----------------------------------------------------------------------------\n * ClientCutText - the client has new text in its cut buffer.\n */\n\ntypedef struct {\n    CARD8 type;                 /* always rfbClientCutText */\n    CARD8 pad1;\n    CARD16 pad2;\n    CARD32 length;\n    /* followed by char text[length] */\n} rfbClientCutTextMsg;\n\n#define sz_rfbClientCutTextMsg 8\n\n\n\n/*-----------------------------------------------------------------------------\n * Union of all client->server messages.\n */\n\ntypedef union {\n    CARD8 type;\n    rfbSetPixelFormatMsg spf;\n    rfbSetScaleFactorMsg ssf;\n    rfbFixColourMapEntriesMsg fcme;\n    rfbSetEncodingsMsg se;\n    rfbFramebufferUpdateRequestMsg fur;\n    rfbKeyEventMsg ke;\n    rfbPointerEventMsg pe;\n    rfbClientCutTextMsg cct;\n} rfbClientToServerMsg;\n"
  },
  {
    "path": "OSXvnc-server/rfbserver.c",
    "content": "/*\n * rfbserver.c - deal with server-side of the RFB protocol.\n */\n\n/*\n *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>.\n *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.\n *  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n#include <Cocoa/Cocoa.h>\n#include <Carbon/Carbon.h>\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <unistd.h>\n#include <errno.h>\n#include <pwd.h>\n#include <sys/types.h>\n#include <sys/socket.h>\n#include <netinet/in.h>\n#include <arpa/inet.h>\n#include <pthread.h>\n\n#include <netdb.h>\n\n#include \"rfb.h\"\n\n//char updateBuf[UPDATE_BUF_SIZE];\n//int ublen;\n\nrfbClientPtr pointerClient = NULL;  /* Mutex for pointer events with buttons down*/\n\nrfbClientPtr rfbClientHead;  /* tight encoding -- GetClient() in tight.c accesses this list, so make it global */\n\nstruct rfbClientIterator {\n    rfbClientPtr next;\n};\n\nstatic pthread_mutex_t rfbClientListMutex;\nstatic struct rfbClientIterator rfbClientIteratorInstance;\n\nstatic void CopyScalingRect(rfbClientPtr cl,\n                            uint32_t* x, uint32_t* y, uint32_t* w, uint32_t* h,\n                            bool bDoScaling);\n\nvoid\nrfbClientListInit(void)\n{\n    rfbClientHead = NULL;\n    pthread_mutex_init(&rfbClientListMutex, NULL);\n}\n\nrfbClientIteratorPtr\nrfbGetClientIterator(void)\n{\n    pthread_mutex_lock(&rfbClientListMutex);\n    rfbClientIteratorInstance.next = rfbClientHead;\n\n    return &rfbClientIteratorInstance;\n}\n\nrfbClientPtr\nrfbClientIteratorNext(rfbClientIteratorPtr iterator)\n{\n    rfbClientPtr result = iterator->next;\n    if (result)\n        iterator->next = result->next;\n    return result;\n}\n\nvoid\nrfbReleaseClientIterator(rfbClientIteratorPtr iterator)\n{\n    pthread_mutex_unlock(&rfbClientListMutex);\n}\n\nBool rfbClientsConnected(void)\n{\n    return (rfbClientHead != NULL);\n}\n\nstatic void rfbSendClientList(void) {\n    pthread_mutex_lock(&rfbClientListMutex);\n\n    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];\n    NSMutableArray *clientList = [[NSMutableArray alloc] init];\n    rfbClientPtr myClient = rfbClientHead;\n\n    while (myClient != NULL) {\n        [clientList addObject:@{@\"clientIP\": @(myClient->host)}];\n        myClient = myClient->next;\n    }\n\n    [[NSDistributedNotificationCenter defaultCenter] postNotificationName:@\"VNCConnections\"\n                                                                   object:[NSString stringWithFormat:@\"OSXvnc%d\",rfbPort]\n                                                                 userInfo:@{@\"clientList\": clientList}];\n\n    [pool release];\n\n    pthread_mutex_unlock(&rfbClientListMutex);\n}\n\n/*\n * rfbNewClientConnection is called from sockets.c when a new connection\n * comes in.\n */\n\nvoid rfbNewClientConnection(int sock) {\n    rfbNewClient(sock);\n}\n\n\n/*\n * rfbReverseConnection is called to make an outward\n * connection to a \"listening\" RFB client.\n */\nrfbClientPtr rfbReverseConnection(char *host, int port) {\n    int sock= -1;\n    struct addrinfo *res, *res0, hint;\n    int errCode;\n    rfbClientPtr cl;\n\n    {\n        // Old IPV4 stuff\n        struct sockaddr_in sin;\n        bzero(&sin, sizeof(sin));\n        sin.sin_len = sizeof(sin);\n        sin.sin_family = AF_INET;\n        sin.sin_addr.s_addr = inet_addr(host);\n        sin.sin_port = htons(port);\n        if ((int)sin.sin_addr.s_addr == -1) {\n            struct hostent *hostinfo = gethostbyname(host);\n            if (hostinfo && hostinfo->h_addr) {\n                sin.sin_addr.s_addr = ((struct in_addr *)hostinfo->h_addr)->s_addr;\n            }\n            else {\n                rfbLog(\"Error resolving reverse host %s\", host);\n                return NULL;\n            }\n        }\n\n        if ((sock = socket(PF_INET, SOCK_STREAM, 0)) < 0) {\n            rfbLog(\"Error creating reverse socket\");\n        }\n        if (connect(sock, (struct sockaddr *)&sin, sizeof(sin)) != 0) {\n            rfbLog(\"Error connecting to reverse host %s:%d\", host, port);\n            sock = -1;\n        }\n    }\n\n    if (sock == -1) {\n        hint.ai_family = PF_UNSPEC;\n        hint.ai_socktype = SOCK_STREAM;\n        if ((errCode = getaddrinfo(host, NULL, &hint, &res0)) != 0) {\n            rfbLog(\"Error resolving reverse host %s: %s\", host, gai_strerror(errCode));\n        }\n\n        // Iterate over all the resources looking for one we can connect with with.\n        for(res=res0; res && (sock < 0); res = res->ai_next) {\n            if (res->ai_family == PF_INET6)\n                ((struct sockaddr_in6 *)(res->ai_addr))->sin6_port = port;\n            else if (res->ai_family == PF_INET)\n                ((struct sockaddr_in *)(res->ai_addr))->sin_port = port;\n            else {\n                rfbLog(\"Error creating reverse socket: unrecognized protocol family %d\", res->ai_family);\n                continue;\n            }\n\n            if ((sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) < 0) {\n                rfbLog(\"Error creating reverse socket: %s\", strerror(errno));\n            } else if (connect(sock, res->ai_addr, res->ai_addrlen) != 0) {\n                rfbLog(\"Error connecting to reverse host %s:%d: %s\", host, port, strerror(errno));\n                sock = -1;\n            }\n        }\n        freeaddrinfo(res0);\n    }\n\n    if (sock < 0)\n        return NULL;\n\n    cl = rfbNewClient(sock);\n    if (cl) {\n        cl->reverseConnection = TRUE;\n    }\n\n    return cl;\n}\n\n/*\n * rfbNewClient is called when a new connection has been made by whatever\n * means.\n */\n\nrfbClientPtr rfbNewClient(int sock) {\n    rfbProtocolVersionMsg pv;\n    rfbClientPtr cl;\n    BoxRec box;\n    int i;\n    unsigned int addrlen;\n    int bitsPerSample;\n\n    /*\n     {\n         rfbClientIteratorPtr iterator;\n\n         rfbLog(\"syncing other clients:\");\n         iterator = rfbGetClientIterator();\n         while ((cl = rfbClientIteratorNext(iterator)) != NULL) {\n             rfbLog(\"     %s\",cl->host);\n         }\n         rfbReleaseClientIterator(iterator);\n     }\n     */\n\n    cl = (rfbClientPtr)xalloc(sizeof(rfbClientRec));\n    memset(cl, 0, sizeof(rfbClientRec));\n\n    cl->sock = sock;\n    if (floor(NSAppKitVersionNumber) > floor(NSAppKitVersionNumber10_1)) {\n        struct sockaddr_in6 addr;\n        char host[NI_MAXHOST];\n\n        addrlen = sizeof(struct sockaddr_in6);\n\n        host[0] = 0;\n        getnameinfo((struct sockaddr *)&addr, addrlen, host, sizeof(host), NULL, 0, NI_NUMERICHOST); // Not available on 10.1\n        cl->host = strdup(host);\n    }\n    if (!strlen(cl->host)) {\n        struct sockaddr_in addr;\n        addrlen = sizeof(struct sockaddr_in);\n        getpeername(sock, (struct sockaddr *)&addr, &addrlen);\n        cl->host = strdup(inet_ntoa(addr.sin_addr));\n    }\n\n    pthread_mutex_init(&cl->outputMutex, NULL);\n\n    cl->state = RFB_PROTOCOL_VERSION;\n\n    /* REDSTONE - Adding some features\n        In theory these need not be global, but could be set per client\n        */\n    cl->disableRemoteEvents = rfbDisableRemote;      // Ignore PB, Keyboard and Mouse events\n    cl->swapMouseButtons23 = rfbSwapButtons;         // How to interpret mouse buttons 2 & 3\n\n    cl->needNewScreenSize = NO;\n    initPasteboardForClient(cl);\n\n    cl->reverseConnection = FALSE;\n    cl->preferredEncoding = rfbEncodingRaw;\n    cl->correMaxWidth = 48;\n    cl->correMaxHeight = 48;\n    cl->zrleData = 0;\n    cl->mosData = 0;\n\n    for (i = 0; i < 256; i++)\n        cl->modiferKeys[i] = 0;\n\n    box.x1 = box.y1 = 0;\n    box.x2 = rfbScreen.width;\n    box.y2 = rfbScreen.height;\n    REGION_INIT(pScreen,&cl->modifiedRegion,&box,0);\n\n    pthread_mutex_init(&cl->updateMutex, NULL);\n    pthread_cond_init(&cl->updateCond, NULL);\n\n    REGION_INIT(pScreen,&cl->requestedRegion,NullBox,0);\n\n    switch (rfbMaxBitDepth) {\n        case 32:\n        case 16:\n        case 8:\n            cl->format.bitsPerPixel = max(rfbMaxBitDepth, rfbScreen.bitsPerPixel);\n            bitsPerSample = cl->format.bitsPerPixel << 2;\n            cl->format.depth = bitsPerSample*3;\n            cl->format.bigEndian = !littleEndian;\n            cl->format.trueColour = TRUE;\n\n            cl->format.redMax = (1 << bitsPerSample) - 1;\n            cl->format.greenMax = (1 << bitsPerSample) - 1;\n            cl->format.blueMax = (1 << bitsPerSample) - 1;\n\n            cl->format.redShift = bitsPerSample * 2;\n            cl->format.greenShift = bitsPerSample * 1;\n            cl->format.blueShift = bitsPerSample * 0;\n            break;\n        case 0:\n        default:\n            cl->format = rfbServerFormat;\n            break;\n    }\n    // This will\n    rfbSetTranslateFunctionUsingFormat(cl, rfbServerFormat);\n\n    /* SERVER SCALING EXTENSIONS -- Server Scaling is off by default */\n    cl->scalingFactor = 1;\n    cl->screenBuffer = rfbGetFramebuffer();\n    cl->scalingFrameBuffer = cl->screenBuffer;\n    cl->scalingPaddedWidthInBytes = rfbScreen.paddedWidthInBytes;\n\n    cl->tightCompressLevel = TIGHT_DEFAULT_COMPRESSION;\n    cl->tightQualityLevel = -1;\n    for (i = 0; i < 4; i++)\n        cl->zsActive[i] = FALSE;\n\n    cl->enableLastRectEncoding = FALSE;\n    cl->enableXCursorShapeUpdates = FALSE;\n    cl->useRichCursorEncoding = FALSE;\n    cl->enableCursorPosUpdates = FALSE;\n    cl->desktopSizeUpdate = FALSE;\n    cl->immediateUpdate = FALSE;\n\n    pthread_mutex_lock(&rfbClientListMutex);\n    cl->next = rfbClientHead;\n    cl->prev = NULL;\n    if (rfbClientHead)\n        rfbClientHead->prev = cl;\n\n    rfbClientHead = cl;\n    pthread_mutex_unlock(&rfbClientListMutex);\n\n    rfbResetStats(cl);\n\n    cl->compStreamInited = FALSE;\n    cl->compStream.total_in = 0;\n    cl->compStream.total_out = 0;\n    cl->compStream.zalloc = Z_NULL;\n    cl->compStream.zfree = Z_NULL;\n    cl->compStream.opaque = Z_NULL;\n\n    cl->zlibCompressLevel = 5;\n\n    cl->compStreamRaw.total_in = ZLIBHEX_COMP_UNINITED;\n    cl->compStreamHex.total_in = ZLIBHEX_COMP_UNINITED;\n\n    cl->client_zlibBeforeBufSize = 0;\n    cl->client_zlibBeforeBuf = NULL;\n\n    cl->client_zlibAfterBufSize = 0;\n    cl->client_zlibAfterBuf = NULL;\n    cl->client_zlibAfterBufLen = 0;\n\n    snprintf(pv, sizeof(pv), rfbProtocolVersionFormat, rfbProtocolMajorVersion, rfbProtocolMinorVersion);\n\n    if (WriteExact(cl, pv, sz_rfbProtocolVersionMsg) < 0) {\n        rfbLogPerror(\"rfbNewClient: write\");\n        rfbCloseClient(cl);\n        return NULL;\n    }\n    \n    // wake up screen in case monitor off (avoid blank VNC screen):\n    IOPMAssertionDeclareUserActivity(CFSTR(\"VNC user is logged in\"),\n        kIOPMUserActiveLocal, &userActivityLastAssertionId);\n\n    return cl;\n}\n\n\n/*\n * rfbClientConnectionGone is called from sockets.c just after a connection\n * has gone away.\n */\n\nvoid rfbClientConnectionGone(rfbClientPtr cl) {\n    int i;\n\n    // RedstoneOSX - Track and release depressed modifier keys whenever the client disconnects\n    keyboardReleaseKeysForClient(cl);\n\n    freePasteboardForClient(cl);\n\n    pthread_mutex_lock(&rfbClientListMutex);\n\n    /* Release the compression state structures if any. */\n    if ( cl->compStreamInited == TRUE ) {\n        deflateEnd( &(cl->compStream) );\n    }\n\n    for (i = 0; i < 4; i++) {\n        if (cl->zsActive[i])\n            deflateEnd(&cl->zsStruct[i]);\n    }\n\n    if (pointerClient == cl)\n        pointerClient = NULL;\n\n    if (cl->prev)\n        cl->prev->next = cl->next;\n    else\n        rfbClientHead = cl->next;\n    if (cl->next)\n        cl->next->prev = cl->prev;\n\n    pthread_mutex_unlock(&rfbClientListMutex);\n\n    REGION_UNINIT(pScreen,&cl->modifiedRegion);\n\n    if (cl->major && cl->minor) {\n        // If it didn't get so far as to send a protocol then let's just ignore\n        // For Clients with no activity just return with no log\n        rfbLog(\"Client %s disconnected\", cl->host);\n        rfbSendClientList();\n        rfbPrintStats(cl);\n    }\n\n    FreeZrleData(cl);\n\n    free(cl->host);\n\n    if (cl->translateLookupTable)\n        free(cl->translateLookupTable);\n\n    /* SERVER SCALING EXTENSIONS */\n    if( cl->scalingFactor != 1 ){\n        free(cl->scalingFrameBuffer);\n    }\n\n    pthread_cond_destroy(&cl->updateCond);\n    pthread_mutex_destroy(&cl->updateMutex);\n    pthread_mutex_destroy(&cl->outputMutex);\n\n    xfree(cl);\n    // Not sure why but this log message seems to prevent a crash\n    // rfbLog(\"Client gone\");\n}\n\n\n/*\n * rfbProcessClientMessage is called when there is data to read from a client.\n */\n\nvoid rfbProcessClientMessage(rfbClientPtr cl) {\n    switch (cl->state) {\n        case RFB_PROTOCOL_VERSION:\n            rfbProcessClientProtocolVersion(cl);\n            return;\n        case RFB_AUTH_VERSION:\n            rfbProcessAuthVersion(cl);\n            return;\n        case RFB_AUTHENTICATION:\n            rfbAuthProcessClientMessage(cl);\n            return;\n        case RFB_INITIALISATION:\n            rfbProcessClientInitMessage(cl);\n            return;\n        default:\n            rfbProcessClientNormalMessage(cl);\n            return;\n    }\n}\n\n\n/*\n * rfbProcessClientProtocolVersion is called when the client sends its\n * protocol version.\n */\n\nvoid rfbProcessClientProtocolVersion(rfbClientPtr cl) {\n    rfbProtocolVersionMsg pv;\n    int n;\n    char failureReason[256];\n\n    if ((n = ReadExact(cl, pv, sz_rfbProtocolVersionMsg)) <= 0) {\n        if (n == 0)\n            rfbLog(\"rfbProcessClientProtocolVersion: client gone\");\n        else\n            rfbLogPerror(\"rfbProcessClientProtocolVersion: read\");\n        rfbCloseClient(cl);\n        return;\n    }\n\n    pv[sz_rfbProtocolVersionMsg] = 0;\n    if (sscanf(pv, rfbProtocolVersionFormat, &cl->major, &cl->minor) != 2) {\n        if (strncmp(pv,\"GET\",3)) // Don't log if it was a browser\n            rfbLog(\"rfbProcessClientProtocolVersion: not a valid RFB client\");\n        rfbCloseClient(cl);\n        return;\n    }\n    rfbLog(\"Protocol version %d.%d\", cl->major, cl->minor);\n\n    if (cl->major != rfbProtocolMajorVersion) {\n        /* Major version mismatch - send a ConnFailed message */\n        rfbLog(\"Major version mismatch\");\n        snprintf(failureReason, sizeof(failureReason),\n                \"RFB protocol version mismatch - server %d.%d, client %d.%d\",\n                rfbProtocolMajorVersion,rfbProtocolMinorVersion,cl->major,cl->minor);\n        rfbClientConnFailed(cl, failureReason);\n        return;\n    }\n\n    if (cl->minor != rfbProtocolMinorVersion) {\n        /* Minor version mismatch - warn but try to continue */\n        rfbLog(\"Ignoring minor version mismatch\");\n    }\n\n    rfbSendClientList();\n\n    rfbAuthNewClient(cl);\n}\n\n\n/*\n * rfbClientConnFailed is called when a client connection has failed either\n * because it talks the wrong protocol or it has failed authentication.\n */\n\nvoid rfbClientConnFailed(rfbClientPtr cl, char *reason) {\n    char *buf;\n    size_t len = strlen(reason);\n\n    buf = (char *)xalloc(8 + len);\n    ((CARD32 *)buf)[0] = Swap32IfLE(rfbConnFailed);\n    ((CARD32 *)buf)[1] = Swap32IfLE(len);\n    memcpy(buf + 8, reason, len);\n\n    if (WriteExact(cl, buf, 8 + len) < 0)\n        rfbLogPerror(\"rfbClientConnFailed: write\");\n    xfree(buf);\n    rfbCloseClient(cl);\n}\n\n\n/*\n * rfbProcessClientInitMessage is called when the client sends its\n * initialisation message.\n */\n\nvoid rfbProcessClientInitMessage(rfbClientPtr cl) {\n    rfbClientInitMsg ci;\n    char buf[256];\n    rfbServerInitMsg *si = (rfbServerInitMsg *)buf;\n    int n;\n    size_t len;\n    rfbClientIteratorPtr iterator;\n    rfbClientPtr otherCl;\n\n    if ((n = ReadExact(cl, (char *)&ci,sz_rfbClientInitMsg)) <= 0) {\n        if (n == 0)\n            rfbLog(\"rfbProcessClientInitMessage: client gone\");\n        else\n            rfbLogPerror(\"rfbProcessClientInitMessage: read\");\n        rfbCloseClient(cl);\n        return;\n    }\n\n    si->framebufferWidth = Swap16IfLE(rfbScreen.width);\n    si->framebufferHeight = Swap16IfLE(rfbScreen.height);\n    si->format = rfbServerFormat;\n    si->format.redMax = Swap16IfLE(si->format.redMax);\n    si->format.greenMax = Swap16IfLE(si->format.greenMax);\n    si->format.blueMax = Swap16IfLE(si->format.blueMax);\n\n    if (strlen(desktopName) > 128)      /* sanity check on desktop name len */\n        desktopName[128] = 0;\n\n    strcpy(buf + sz_rfbServerInitMsg, desktopName);\n    len = strlen(buf + sz_rfbServerInitMsg);\n    si->nameLength = Swap32IfLE(len);\n\n    if (WriteExact(cl, buf, sz_rfbServerInitMsg + len) < 0) {\n        rfbLogPerror(\"rfbProcessClientInitMessage: write\");\n        rfbCloseClient(cl);\n        return;\n    }\n\n    cl->state = RFB_NORMAL;\n\n    if (!cl->reverseConnection &&\n        (rfbNeverShared || (!rfbAlwaysShared && !ci.shared))) {\n\n        if (rfbDontDisconnect) {\n            iterator = rfbGetClientIterator();\n            while ((otherCl = rfbClientIteratorNext(iterator)) != NULL) {\n                if ((otherCl != cl) && (otherCl->state == RFB_NORMAL)) {\n                    rfbLog(\"-dontdisconnect: Not shared & existing client\");\n                    rfbLog(\"  refusing new client %s\", cl->host);\n                    rfbCloseClient(cl);\n                    rfbReleaseClientIterator(iterator);\n                    return;\n                }\n            }\n            rfbReleaseClientIterator(iterator);\n        } else {\n            iterator = rfbGetClientIterator();\n            while ((otherCl = rfbClientIteratorNext(iterator)) != NULL) {\n                if ((otherCl != cl) && (otherCl->state == RFB_NORMAL)) {\n                    rfbLog(\"Not shared - closing connection to client %s\",\n                           otherCl->host);\n                    rfbCloseClient(otherCl);\n                }\n            }\n            rfbReleaseClientIterator(iterator);\n        }\n    }\n}\n\n\n/*\n * rfbProcessClientNormalMessage is called when the client has sent a normal\n * protocol message.\n */\n\nvoid rfbProcessClientNormalMessage(rfbClientPtr cl) {\n    int n;\n    rfbClientToServerMsg msg;\n    char *str;\n\n    if ((n = ReadExact(cl, (char *)&msg, 1)) <= 0) {\n        if (n != 0)\n            rfbLogPerror(\"rfbProcessClientNormalMessage: read\");\n        rfbCloseClient(cl);\n        return;\n    }\n\n    switch (msg.type) {\n\n        case rfbSetPixelFormat:\n        {\n            if ((n = ReadExact(cl, ((char *)&msg) + 1,\n                               sz_rfbSetPixelFormatMsg - 1)) <= 0) {\n                if (n != 0)\n                    rfbLogPerror(\"rfbProcessClientNormalMessage: read\");\n                rfbCloseClient(cl);\n                return;\n            }\n\n            if (!rfbMaxBitDepth || msg.spf.format.bitsPerPixel <= rfbMaxBitDepth) {\n                cl->format.bitsPerPixel = msg.spf.format.bitsPerPixel;\n                cl->format.depth = msg.spf.format.depth;\n                cl->format.bigEndian = (msg.spf.format.bigEndian ? 1 : 0);\n                cl->format.trueColour = (msg.spf.format.trueColour ? 1 : 0);\n                cl->format.redMax = Swap16IfLE(msg.spf.format.redMax);\n                cl->format.greenMax = Swap16IfLE(msg.spf.format.greenMax);\n                cl->format.blueMax = Swap16IfLE(msg.spf.format.blueMax);\n                cl->format.redShift = msg.spf.format.redShift;\n                cl->format.greenShift = msg.spf.format.greenShift;\n                cl->format.blueShift = msg.spf.format.blueShift;\n                rfbSetTranslateFunction(cl);\n            }\n            else\n                rfbLog(\"rfbProcessClientNormalMessage: Unable to set requested bit depth %d to greater than MaxBitDepth (%d)\", msg.spf.format.bitsPerPixel, rfbMaxBitDepth);\n\n            return;\n        }\n\n        case rfbFixColourMapEntries:\n        {\n            if ((n = ReadExact(cl, ((char *)&msg) + 1,\n                               sz_rfbFixColourMapEntriesMsg - 1)) <= 0) {\n                if (n != 0)\n                    rfbLogPerror(\"rfbProcessClientNormalMessage: read\");\n                rfbCloseClient(cl);\n                return;\n            }\n            rfbLog(\"rfbProcessClientNormalMessage: %s\",\n                   \"FixColourMapEntries unsupported\\n\");\n            rfbCloseClient(cl);\n            return;\n        }\n\n        case rfbSetEncodings: {\n            int i;\n            CARD32 enc;\n\n            if ((n = ReadExact(cl, ((char *)&msg) + 1,\n                               sz_rfbSetEncodingsMsg - 1)) <= 0) {\n                if (n != 0)\n                    rfbLogPerror(\"rfbProcessClientNormalMessage: read\");\n                rfbCloseClient(cl);\n                return;\n            }\n\n            msg.se.nEncodings = Swap16IfLE(msg.se.nEncodings);\n\n            pthread_mutex_lock(&cl->updateMutex);\n\n            // Since there is not protocol to \"clear\" these extensions we always clear them and expect them to be re-sent if\n            // the client continues to support those options\n            cl->preferredEncoding = -1;\n            cl->enableLastRectEncoding = FALSE;\n            cl->enableXCursorShapeUpdates = FALSE;\n            cl->useRichCursorEncoding = FALSE;\n            cl->enableCursorPosUpdates = FALSE;\n            cl->desktopSizeUpdate = FALSE;\n            cl->immediateUpdate = FALSE;\n\n            for (i = 0; i < msg.se.nEncodings; i++) {\n                if ((n = ReadExact(cl, (char *)&enc, 4)) <= 0) {\n                    if (n != 0)\n                        rfbLogPerror(\"rfbProcessClientNormalMessage: read\");\n                    rfbCloseClient(cl);\n                    return;\n                }\n                enc = Swap32IfLE(enc);\n\n                switch (enc) {\n                    case rfbEncodingCopyRect:\n                        break;\n                    case rfbEncodingRaw:\n                    case rfbEncodingRRE:\n                    case rfbEncodingCoRRE:\n                    case rfbEncodingHextile:\n                    case rfbEncodingZlib:\n                    case rfbEncodingTight:\n                    case rfbEncodingZlibHex:\n                    case rfbEncodingZRLE:\n                        if (cl->preferredEncoding == -1) {\n                            cl->preferredEncoding = enc;\n                            rfbLog(\"ENCODING: %s for client %s\", encNames[cl->preferredEncoding], cl->host);\n                        }\n                        break;\n                    case rfbEncodingUltra:\n                        rfbLog(\"\\tULTRA Encoding not supported(ignored): %u (%X)\", (int)enc, (int)enc);\n                        break;\n                        /* PSEUDO_ENCODINGS */\n                    case rfbEncodingLastRect:\n                        rfbLog(\"\\tEnabling LastRect protocol extension for client %s\", cl->host);\n                        cl->enableLastRectEncoding = TRUE;\n                        break;\n                    case rfbEncodingXCursor:\n                        //rfbLog(\"Enabling XCursor protocol extension for client %s\", cl->host);\n                        cl->enableXCursorShapeUpdates = TRUE;\n                        break;\n                    case rfbEncodingRichCursor:\n                        rfbLog(\"\\tEnabling Cursor Shape protocol extension for client %s\", cl->host);\n                        cl->useRichCursorEncoding = TRUE;\n                        cl->currentCursorSeed = 0;\n                        break;\n                    case rfbEncodingPointerPos:\n                        rfbLog(\"\\tEnabling Cursor Position protocol extension for client %s\", cl->host);\n                        cl->enableCursorPosUpdates = TRUE;\n                        cl->clientCursorLocation = CGPointMake(-1.0, -1.0);\n                        break;\n                    case rfbEncodingDesktopResize:\n                        rfbLog(\"\\tEnabling Dynamic Desktop Sizing for client %s\", cl->host);\n                        cl->desktopSizeUpdate = TRUE;\n                        break;\n                    case rfbImmediateUpdate:\n                        rfbLog(\"\\tEnabling Immediate updates for client \" \"%s\", cl->host);\n                        cl->immediateUpdate = TRUE;\n                        break;\n                    case rfbPasteboardRequest:\n                        rfbLog(\"\\tEnabling pasteboard request \" \"%s\", cl->host);\n                        cl->generalPBLastChange = -2; // This will cause it to send a single update that shows the current PB\n                        break;\n                    case rfbRichPasteboard:\n                        if (!rfbDisableRichClipboards) {\n                            rfbLog(\"\\tEnabling rich pasteboard \" \"%s\", cl->host);\n                            cl->richClipboardSupport = TRUE;\n                            // The -2 will already trigger force sending the PB, so we don't need to send the ack.\n                            if (cl->generalPBLastChange != -2)\n                                cl->generalPBLastChange = -3;\n                        }\n                        break;\n\n                        // Tight encoding options\n                    default:\n                        if ( enc >= (CARD32)rfbEncodingCompressLevel0 &&\n                             enc <= (CARD32)rfbEncodingCompressLevel9 ) {\n                            cl->zlibCompressLevel = enc & 0x0F;\n                            cl->tightCompressLevel = enc & 0x0F;\n                            rfbLog(\"\\tUsing compression level %d for client %s\",\n                                   cl->tightCompressLevel, cl->host);\n                        }\n                        else if ( enc >= (CARD32)rfbEncodingQualityLevel0 &&\n                                    enc <= (CARD32)rfbEncodingQualityLevel9 ) {\n                            cl->tightQualityLevel = enc & 0x0F;\n                            rfbLog(\"\\tUsing jpeg image quality level %d for client %s\",\n                                   cl->tightQualityLevel, cl->host);\n                        }\n                        else {\n                            rfbLog(\"\\tUnknown Encoding Type(ignored): %u (%X)\", (int)enc, (int)enc);\n                        }\n                }\n            }\n\n            if (cl->preferredEncoding == -1) {\n                cl->preferredEncoding = rfbEncodingRaw;\n            }\n\n            pthread_mutex_unlock(&cl->updateMutex);\n\n            // Force a new update to the client\n            if (rfbShouldSendNewCursor(cl) || (rfbShouldSendNewPosition(cl)))\n                pthread_cond_signal(&cl->updateCond);\n\n            return;\n        }\n\n\n        case rfbFramebufferUpdateRequest:\n        {\n            RegionRec tmpRegion;\n            BoxRec box;\n\n            if ((n = ReadExact(cl, ((char *)&msg) + 1,\n                               sz_rfbFramebufferUpdateRequestMsg-1)) <= 0) {\n                if (n != 0)\n                    rfbLogPerror(\"rfbProcessClientNormalMessage: read\");\n                rfbCloseClient(cl);\n                return;\n            }\n\n            //rfbLog(\"FUR: %d (%d,%d x %d,%d)\", msg.fur.incremental, msg.fur.x, msg.fur.y,  msg.fur.w, msg.fur.h);\n\n            box.x1 = Swap16IfLE(msg.fur.x)*cl->scalingFactor;\n            box.y1 = Swap16IfLE(msg.fur.y)*cl->scalingFactor;\n            box.x2 = (box.x1 + Swap16IfLE(msg.fur.w))*cl->scalingFactor;\n            box.y2 = (box.y1 + Swap16IfLE(msg.fur.h))*cl->scalingFactor;\n            SAFE_REGION_INIT(pScreen,&tmpRegion,&box,0);\n\n            pthread_mutex_lock(&cl->updateMutex);\n            REGION_UNION(pScreen, &cl->requestedRegion, &cl->requestedRegion,\n                         &tmpRegion);\n            if (!msg.fur.incremental) {\n                REGION_UNION(pScreen,&cl->modifiedRegion,&cl->modifiedRegion,\n                             &tmpRegion);\n            }\n            pthread_mutex_unlock(&cl->updateMutex);\n            pthread_cond_signal(&cl->updateCond);\n            REGION_UNINIT(pScreen,&tmpRegion);\n\n            return;\n        }\n\n        case rfbKeyEvent:\n        {\n            if (!cl->disableRemoteEvents)\n                cl->rfbKeyEventsRcvd++;\n\n            if ((n = ReadExact(cl, ((char *)&msg) + 1,\n                               sz_rfbKeyEventMsg - 1)) <= 0) {\n                if (n != 0)\n                    rfbLogPerror(\"rfbProcessClientNormalMessage: read\");\n                rfbCloseClient(cl);\n                return;\n            }\n\n                if (!cl->disableRemoteEvents)\n                    KbdAddEvent(msg.ke.down, (KeySym)Swap32IfLE(msg.ke.key), cl);\n\n                return;\n        }\n        case rfbPointerEvent: {\n            if (!cl->disableRemoteEvents)\n                cl->rfbPointerEventsRcvd++;\n\n            if ((n = ReadExact(cl, ((char *)&msg) + 1, sz_rfbPointerEventMsg - 1)) <= 0) {\n                if (n != 0)\n                    rfbLogPerror(\"rfbProcessClientNormalMessage: read\");\n                rfbCloseClient(cl);\n                return;\n            }\n\n            if (cl->disableRemoteEvents || (pointerClient && (pointerClient != cl)))\n                return;\n\n            if (msg.pe.buttonMask == 0)\n                pointerClient = NULL;\n            else\n                pointerClient = cl;\n\n            PtrAddEvent(msg.pe.buttonMask,\n                (Swap16IfLE(msg.pe.x)+cl->scalingFactor-1)*cl->scalingFactor,\n                (Swap16IfLE(msg.pe.y)+cl->scalingFactor-1)*cl->scalingFactor,\n                cl);\n\n            return;\n        }\n        case rfbClientCutText: {\n\n            if ((n = ReadExact(cl, ((char *)&msg) + 1,\n                               sz_rfbClientCutTextMsg - 1)) <= 0) {\n                if (n != 0)\n                    rfbLogPerror(\"rfbProcessClientNormalMessage: read\");\n                rfbCloseClient(cl);\n                return;\n            }\n\n            msg.cct.length = Swap32IfLE(msg.cct.length);\n\n            str = (char *)xalloc(msg.cct.length);\n\n            if ((n = ReadExact(cl, str, msg.cct.length)) <= 0) {\n                if (n != 0)\n                    rfbLogPerror(\"rfbProcessClientNormalMessage: read\");\n                xfree(str);\n                rfbCloseClient(cl);\n                return;\n            }\n\n            if (!cl->disableRemoteEvents) {\n                rfbSetCutText(cl, str, msg.cct.length);\n            }\n\n            xfree(str);\n            return;\n        }\n\n        /* SERVER SCALING EXTENSIONS */\n        case rfbSetScaleFactorULTRA:\n        case rfbSetScaleFactor:\n        {\n            rfbReSizeFrameBufferMsg rsfb;\n            if ((n = ReadExact(cl, ((char *)&msg) + 1,\n                               sz_rfbSetScaleFactorMsg-1)) <= 0) {\n                if (n != 0)\n                    rfbLogPerror(\"rfbProcessClientNormalMessage: read\");\n                rfbCloseClient(cl);\n                return;\n            }\n\n            if( cl->scalingFactor != msg.ssf.scale ){\n                const unsigned long csh = (rfbScreen.height+msg.ssf.scale-1) / msg.ssf.scale;\n                const unsigned long csw = (rfbScreen.width +msg.ssf.scale-1) / msg.ssf.scale;\n\n                if (cl->scalingFactor != 1)\n                    free(cl->scalingFrameBuffer);\n\n                cl->scalingFactor = msg.ssf.scale;\n\n                rfbLog(\"Server Side Scaling: %d for client %s\", msg.ssf.scale, cl->host);\n\n                if (cl->scalingFactor == 1) {\n                    cl->scalingFrameBuffer = cl->screenBuffer;\n                    cl->scalingPaddedWidthInBytes = rfbScreen.paddedWidthInBytes;\n                }\n                else {\n                    cl->scalingFrameBuffer = malloc( csw*csh*rfbScreen.bitsPerPixel/8 );\n                    cl->scalingPaddedWidthInBytes = csw * rfbScreen.bitsPerPixel/8;\n                }\n\n                /* Now notify the client of the new desktop area */\n                if (msg.type == rfbSetScaleFactor) {\n                    rsfb.type = rfbReSizeFrameBuffer;\n                    rsfb.desktop_w = Swap16IfLE(rfbScreen.width);\n                    rsfb.desktop_h = Swap16IfLE(rfbScreen.height);\n                    rsfb.buffer_w = Swap16IfLE(csw);\n                    rsfb.buffer_h = Swap16IfLE(csh);\n\n                    if (WriteExact(cl, (char *)&rsfb, sizeof(rsfb)) < 0) {\n                        rfbLogPerror(\"rfbProcessClientNormalMessage: write\");\n                        rfbCloseClient(cl);\n                        return;\n                    }\n                }\n                else {\n                    // What does UltraVNC expect here probably just a resize event\n                    rfbFramebufferUpdateMsg *fu = (rfbFramebufferUpdateMsg *)cl->updateBuf;\n                    fu->type = rfbFramebufferUpdate;\n                    fu->nRects = Swap16IfLE(1);\n                    cl->ublen = sz_rfbFramebufferUpdateMsg;\n\n                    rfbSendScreenUpdateEncoding(cl);\n                }\n            }\n\n            return;\n        }\n\n        case rfbRichClipboardAvailable:\n            rfbReceiveRichClipboardAvailable(cl);\n            return;\n\n        case rfbRichClipboardRequest:\n            rfbReceiveRichClipboardRequest(cl);\n            return;\n\n        case rfbRichClipboardData:\n            rfbReceiveRichClipboardData(cl);\n            return;\n\n        default:\n        {\n            rfbLog(\"ERROR: Client Sent Message: unknown message type %d\", msg.type);\n            rfbLog(\"...... Closing connection to client %s\", cl->host);\n            rfbCloseClient(cl);\n            return;\n        }\n    }\n}\n\n/*\n * rfbSendFramebufferUpdate - send the currently pending framebuffer update to\n * the RFB client.\n */\n\nBool rfbSendFramebufferUpdate(rfbClientPtr cl, RegionRec updateRegion) {\n    int i;\n    uint32_t nUpdateRegionRects = 0;\n    Bool sendRichCursorEncoding = FALSE;\n    Bool sendCursorPositionEncoding = FALSE;\n\n    rfbFramebufferUpdateMsg *fu = (rfbFramebufferUpdateMsg *)cl->updateBuf;\n\n    /* Now send the update */\n\n    cl->rfbFramebufferUpdateMessagesSent++;\n\n    if (cl->preferredEncoding == rfbEncodingCoRRE) {\n        for (i = 0; i < REGION_NUM_RECTS(&updateRegion); i++) {\n            int x = REGION_RECTS(&updateRegion)[i].x1;\n            int y = REGION_RECTS(&updateRegion)[i].y1;\n            int w = REGION_RECTS(&updateRegion)[i].x2 - x;\n            int h = REGION_RECTS(&updateRegion)[i].y2 - y;\n            nUpdateRegionRects += (((w-1) / cl->correMaxWidth + 1)\n                                   * ((h-1) / cl->correMaxHeight + 1));\n        }\n    } else if (cl->preferredEncoding == rfbEncodingZlib) {\n        for (i = 0; i < REGION_NUM_RECTS(&updateRegion); i++) {\n            int x = REGION_RECTS(&updateRegion)[i].x1;\n            int y = REGION_RECTS(&updateRegion)[i].y1;\n            int w = REGION_RECTS(&updateRegion)[i].x2 - x;\n            int h = REGION_RECTS(&updateRegion)[i].y2 - y;\n            nUpdateRegionRects += (((h-1) / (ZLIB_MAX_SIZE( w ) / w)) + 1);\n        }\n    } else if (cl->preferredEncoding == rfbEncodingTight) {\n        for (i = 0; i < REGION_NUM_RECTS(&updateRegion); i++) {\n            int x = REGION_RECTS(&updateRegion)[i].x1;\n            int y = REGION_RECTS(&updateRegion)[i].y1;\n            int w = REGION_RECTS(&updateRegion)[i].x2 - x;\n            int h = REGION_RECTS(&updateRegion)[i].y2 - y;\n            int n = rfbNumCodedRectsTight(cl, x, y, w, h);\n            if (n == 0) {\n                nUpdateRegionRects = 0xFFFF;\n                break;\n            }\n            nUpdateRegionRects += n;\n        }\n    } else {\n        nUpdateRegionRects = REGION_NUM_RECTS(&updateRegion);\n    }\n\n    // Sometimes send the mouse cursor update also\n\n    if (nUpdateRegionRects != 0xFFFF) {\n        if (rfbShouldSendNewCursor(cl)) {\n            sendRichCursorEncoding = TRUE;\n            nUpdateRegionRects++;\n        }\n        if (rfbShouldSendNewPosition(cl)) {\n            sendCursorPositionEncoding = TRUE;\n            nUpdateRegionRects++;\n        }\n        if (cl->needNewScreenSize) {\n            nUpdateRegionRects++;\n        }\n    }\n\n    fu->type = rfbFramebufferUpdate;\n    fu->nRects = Swap16IfLE(nUpdateRegionRects);\n    cl->ublen = sz_rfbFramebufferUpdateMsg;\n\n    // Sometimes send the mouse cursor update (this can fail with big cursors so we'll try it first\n    if (sendRichCursorEncoding) {\n        if (!rfbSendRichCursorUpdate(cl)) {\n            // rfbLog(\"Error Sending Cursor\"); // We'll log at the lower level if it fails and only fail a few times\n            // return FALSE;  Since this is the first update we can \"skip the cursor update\" instead of failing the whole thing\n            --nUpdateRegionRects;\n            fu->nRects = Swap16IfLE(nUpdateRegionRects);\n        }\n    }\n    if (sendCursorPositionEncoding) {\n        if (!rfbSendCursorPos(cl)) {\n            rfbLog(\"Error Sending Cursor Position\");\n            return FALSE;\n        }\n\n    }\n    if (cl->needNewScreenSize) {\n        if (rfbSendScreenUpdateEncoding(cl)) {\n            cl->needNewScreenSize = FALSE;\n        }\n        else {\n            rfbLog(\"Error Sending New Screen Size\");\n            return FALSE;\n        }\n    }\n\n    cl->screenBuffer = rfbGetFramebuffer();\n\n    for (i = 0; i < REGION_NUM_RECTS(&updateRegion); i++) {\n        uint32_t x = REGION_RECTS(&updateRegion)[i].x1;\n        uint32_t y = REGION_RECTS(&updateRegion)[i].y1;\n        uint32_t w = REGION_RECTS(&updateRegion)[i].x2 - x;\n        uint32_t h = REGION_RECTS(&updateRegion)[i].y2 - y;\n\n        rfbGetFramebufferUpdateInRect(x,y,w,h);\n\n\n        // Refresh with latest pointer (should be \"read-locked\" throughout here with CG but I don't see that option)\n        if (cl->scalingFactor != 1)\n            CopyScalingRect( cl, &x, &y, &w, &h, TRUE);\n        else\n            cl->scalingFrameBuffer = cl->screenBuffer;\n\n        cl->rfbRawBytesEquivalent += (sz_rfbFramebufferUpdateRectHeader\n                                      + w * (cl->format.bitsPerPixel / 8) * h);\n\n        switch (cl->preferredEncoding) {\n            case rfbEncodingRaw:\n                if (!rfbSendRectEncodingRaw(cl, x, y, w, h)) {\n                    return FALSE;\n                }\n                break;\n            case rfbEncodingRRE:\n                if (!rfbSendRectEncodingRRE(cl, x, y, w, h)) {\n                    return FALSE;\n                }\n                break;\n            case rfbEncodingCoRRE:\n                if (!rfbSendRectEncodingCoRRE(cl, x, y, w, h)) {\n                    return FALSE;\n                }\n                break;\n            case rfbEncodingHextile:\n                if (!rfbSendRectEncodingHextile(cl, x, y, w, h)) {\n                    return FALSE;\n                }\n                break;\n            case rfbEncodingZlib:\n                if (!rfbSendRectEncodingZlib(cl, x, y, w, h)) {\n                    return FALSE;\n                }\n                break;\n            case rfbEncodingTight:\n                if (!rfbSendRectEncodingTight(cl, x, y, w, h)) {\n                    return FALSE;\n                }\n                break;\n            case rfbEncodingZlibHex:\n                if (!rfbSendRectEncodingZlibHex(cl, x, y, w, h)) {\n                    return FALSE;\n                }\n                break;\n            case rfbEncodingZRLE:\n                if (!rfbSendRectEncodingZRLE(cl, x, y, w, h)) {\n                    return FALSE;\n                }\n                break;\n        }\n    }\n\n    if (nUpdateRegionRects == 0xFFFF && !rfbSendLastRectMarker(cl))\n        return FALSE;\n\n    if (!rfbSendUpdateBuf(cl))\n        return FALSE;\n\n    return TRUE;\n}\n\nBool rfbSendScreenUpdateEncoding(rfbClientPtr cl) {\n    rfbFramebufferUpdateRectHeader rect;\n\n    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader > UPDATE_BUF_SIZE) {\n        if (!rfbSendUpdateBuf(cl))\n            return FALSE;\n    }\n\n    rect.r.x = 0;\n    rect.r.y = 0;\n    rect.r.w = Swap16IfLE((rfbScreen.width +cl->scalingFactor-1) / cl->scalingFactor);\n    rect.r.h = Swap16IfLE((rfbScreen.height+cl->scalingFactor-1) / cl->scalingFactor);\n    rect.encoding = Swap32IfLE(rfbEncodingDesktopResize);\n\n    memcpy(&cl->updateBuf[cl->ublen], &rect, sz_rfbFramebufferUpdateRectHeader);\n    cl->ublen += sz_rfbFramebufferUpdateRectHeader;\n\n    cl->rfbRectanglesSent[rfbStatsDesktopResize]++;\n    cl->rfbBytesSent[rfbStatsDesktopResize] += sz_rfbFramebufferUpdateRectHeader;\n\n    // Let's push this out right away\n    return rfbSendUpdateBuf(cl);\n}\n\n/*\n * Send a given rectangle in raw encoding (rfbEncodingRaw).\n */\n\nBool rfbSendRectEncodingRaw(rfbClientPtr cl, int x, int y, int w, int h) {\n    rfbFramebufferUpdateRectHeader rect;\n    int nlines;\n    int bytesPerLine = w * (cl->format.bitsPerPixel / 8);\n    char *fbptr = (cl->scalingFrameBuffer + (cl->scalingPaddedWidthInBytes * y)\n                   + (x * (rfbScreen.bitsPerPixel / 8)));\n\n    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader > UPDATE_BUF_SIZE) {\n        if (!rfbSendUpdateBuf(cl))\n            return FALSE;\n    }\n\n    rect.r.x = Swap16IfLE(x);\n    rect.r.y = Swap16IfLE(y);\n    rect.r.w = Swap16IfLE(w);\n    rect.r.h = Swap16IfLE(h);\n    rect.encoding = Swap32IfLE(rfbEncodingRaw);\n\n    memcpy(&cl->updateBuf[cl->ublen], &rect, sz_rfbFramebufferUpdateRectHeader);\n    cl->ublen += sz_rfbFramebufferUpdateRectHeader;\n\n    cl->rfbRectanglesSent[rfbEncodingRaw]++;\n    cl->rfbBytesSent[rfbEncodingRaw] += sz_rfbFramebufferUpdateRectHeader + bytesPerLine * h;\n\n    nlines = (UPDATE_BUF_SIZE - cl->ublen) / bytesPerLine;\n\n    while (TRUE) {\n        if (nlines > h)\n            nlines = h;\n\n        (*cl->translateFn)(cl->translateLookupTable, &rfbServerFormat,\n                           &cl->format, fbptr, &cl->updateBuf[cl->ublen],\n                           cl->scalingPaddedWidthInBytes, w, nlines);\n\n        cl->ublen += nlines * bytesPerLine;\n        h -= nlines;\n\n        if (h == 0)     /* rect fitted in buffer, do next one */\n            return TRUE;\n\n        /* buffer full - flush partial rect and do another nlines */\n\n        if (!rfbSendUpdateBuf(cl))\n            return FALSE;\n\n        fbptr += (cl->scalingPaddedWidthInBytes * nlines);\n\n        nlines = (UPDATE_BUF_SIZE - cl->ublen) / bytesPerLine;\n        if (nlines == 0) {\n            rfbLog(\"rfbSendRectEncodingRaw: send buffer too small for %d \"\n                   \"bytes per line\\n\", bytesPerLine);\n            rfbCloseClient(cl);\n            return FALSE;\n        }\n    }\n}\n\n\n\n/*\n * Send an empty rectangle with encoding field set to value of\n * rfbEncodingLastRect to notify client that this is the last\n * rectangle in framebuffer update (\"LastRect\" extension of RFB\n                                    * protocol).\n */\n\nBool rfbSendLastRectMarker(rfbClientPtr cl) {\n    rfbFramebufferUpdateRectHeader rect;\n\n    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader > UPDATE_BUF_SIZE) {\n        if (!rfbSendUpdateBuf(cl))\n            return FALSE;\n    }\n\n    rect.encoding = Swap32IfLE(rfbEncodingLastRect);\n    rect.r.x = 0;\n    rect.r.y = 0;\n    rect.r.w = 0;\n    rect.r.h = 0;\n\n    memcpy(&cl->updateBuf[cl->ublen], &rect, sz_rfbFramebufferUpdateRectHeader);\n    cl->ublen += sz_rfbFramebufferUpdateRectHeader;\n\n    cl->rfbLastRectMarkersSent++;\n    cl->rfbLastRectBytesSent += sz_rfbFramebufferUpdateRectHeader;\n\n    return TRUE;\n}\n\n\n/*\n * Send the contents of updateBuf.  Returns 1 if successful, -1 if\n * not (errno should be set).\n */\n\nBool rfbSendUpdateBuf(rfbClientPtr cl) {\n    /*\n     int i;\n     for (i = 0; i < cl->ublen; i++) {\n         fprintf(stderr,\"%02x \",((unsigned char *)cl->updateBuf)[i]);\n     }\n     fprintf(stderr,\"\\n\");\n     */\n\n    if (WriteExact(cl, cl->updateBuf, cl->ublen) < 0) {\n        rfbLogPerror(\"rfbSendUpdateBuf: write\");\n        rfbCloseClient(cl);\n        return FALSE;\n    }\n\n    cl->ublen = 0;\n    return TRUE;\n}\n\n\n/*\n * rfbSendServerCutText sends a ServerCutText message to all the clients.\n */\n\nvoid rfbSendServerCutText(rfbClientPtr cl, char *str, size_t len) {\n    rfbServerCutTextMsg sct;\n\n    sct.type = rfbServerCutText;\n    sct.length = Swap32IfLE(len);\n\n    if (WriteExact(cl, (char *)&sct, sz_rfbServerCutTextMsg) < 0) {\n        rfbLogPerror(\"rfbSendServerCutText: write\");\n        rfbCloseClient(cl);\n    }\n\n    if (WriteExact(cl, str, len) < 0) {\n        rfbLogPerror(\"rfbSendServerCutText: write\");\n        rfbCloseClient(cl);\n    }\n}\n/*\n void\n rfbSendServerCutText(char *str, int len)\n {\n     rfbClientPtr cl;\n     rfbServerCutTextMsg sct;\n     rfbClientIteratorPtr iterator;\n\n     // XXX bad-- writing with client list lock held\n     iterator = rfbGetClientIterator();\n     while ((cl = rfbClientIteratorNext(iterator)) != NULL) {\n         sct.type = rfbServerCutText;\n         sct.length = Swap32IfLE(len);\n         if (WriteExact(cl, (char *)&sct,\n                        sz_rfbServerCutTextMsg) < 0) {\n             rfbLogPerror(\"rfbSendServerCutText: write\");\n             rfbCloseClient(cl);\n             continue;\n         }\n         if (WriteExact(cl, str, len) < 0) {\n             rfbLogPerror(\"rfbSendServerCutText: write\");\n             rfbCloseClient(cl);\n         }\n     }\n     rfbReleaseClientIterator(iterator);\n }\n */\n\n/* SERVER SCALING EXTENSIONS */\nstatic void CopyScalingRect(rfbClientPtr cl,\n                            uint32_t* x, uint32_t* y, uint32_t* w, uint32_t* h,\n                            bool bDoScaling)\n{\n    uint32_t cx, cy, cw, ch;\n    unsigned char* srcptr;\n    unsigned char* dstptr;\n    unsigned char* tmpptr;\n    unsigned long pixel_value=0, red, green, blue;\n    unsigned long xx, yy, u, v;\n    const unsigned long bytesPerPixel = rfbScreen.bitsPerPixel/8;\n    const uint32_t csh = (rfbScreen.height+cl->scalingFactor-1)/ cl->scalingFactor;\n    const uint32_t csw = (rfbScreen.width +cl->scalingFactor-1)/ cl->scalingFactor;\n\n    cy = (*y) / cl->scalingFactor;\n    ch = (*h+cl->scalingFactor-1) / cl->scalingFactor+1;\n    cx = (*x) / cl->scalingFactor;\n    cw = (*w+cl->scalingFactor-1) / cl->scalingFactor+1;\n\n    if( cy > csh ){\n        cy = csh;\n    }\n    if( cy + ch > csh ){\n        ch = csh - cy;\n    }\n    if( cx > csw ){\n        cx = csw;\n    }\n    if( cx + cw > csw ){\n        cw = csw - cx;\n    }\n\n    if( bDoScaling ){\n        uint32_t rx = cx * cl->scalingFactor;\n        uint32_t ry = cy * cl->scalingFactor;\n#if 0\n        uint32_t rh = ch * cl->scalingFactor;\n        uint32_t rw = cw * cl->scalingFactor;\n#endif\n\n        /* Copy and scale data from screen buffer to scaling buffer */\n        srcptr = (unsigned char*)cl->screenBuffer + (ry * rfbScreen.paddedWidthInBytes ) + (rx * bytesPerPixel);\n        dstptr = (unsigned char*)cl->scalingFrameBuffer+ (cy * cl->scalingPaddedWidthInBytes) + (cx * bytesPerPixel);\n\n        if( cl->format.trueColour ) { /* Blend neighbouring pixels together */\n            for( yy=0; yy < ch; yy++ ){\n                for( xx=0; xx < cw; xx++ ){\n                    red = green = blue = 0;\n                    for( v = 0; v < (unsigned long)cl->scalingFactor; v++ ){\n                        tmpptr = srcptr;\n                        for( u = 0; u < (unsigned long)cl->scalingFactor; u++ ){\n                            switch( bytesPerPixel ){\n                            case 1:\n                                pixel_value = (unsigned long)*(unsigned char* )tmpptr;\n                                break;\n                            case 2:\n                                pixel_value = (unsigned long)*(unsigned short*)tmpptr;\n                                break;\n                            case 3:    /* 24bpp may cause bus error? */\n                            case 4:\n                                pixel_value = (unsigned long)*(unsigned long* )tmpptr;\n                                break;\n                            }\n                            red   += (pixel_value >> rfbServerFormat.redShift  )& rfbServerFormat.redMax;\n                            green += (pixel_value >> rfbServerFormat.greenShift)& rfbServerFormat.greenMax;\n                            blue  += (pixel_value >> rfbServerFormat.blueShift )& rfbServerFormat.blueMax;\n                            tmpptr  += rfbScreen.paddedWidthInBytes;\n                        }\n                        srcptr  += bytesPerPixel;\n                    }\n                    red   /= cl->scalingFactor * cl->scalingFactor;\n                    green /= cl->scalingFactor * cl->scalingFactor;\n                    blue  /= cl->scalingFactor * cl->scalingFactor;\n\n                    pixel_value = (red   << rfbServerFormat.redShift)\n                                + (green << rfbServerFormat.greenShift)\n                                + (blue  << rfbServerFormat.blueShift);\n\n                    switch( bytesPerPixel ){\n                    case 1:\n                        *(unsigned char* )dstptr = (unsigned char )pixel_value;\n                        break;\n                    case 2:\n                        *(unsigned short*)dstptr = (unsigned short)pixel_value;\n                        break;\n                    case 3:    /* 24bpp may cause bus error? */\n                    case 4:\n                        *(unsigned long* )dstptr = (unsigned long )pixel_value;\n                        break;\n                    }\n                    dstptr += bytesPerPixel;\n                }\n                srcptr += (rfbScreen.paddedWidthInBytes - cw * bytesPerPixel)* cl->scalingFactor;\n                dstptr += cl->scalingPaddedWidthInBytes - cw * bytesPerPixel;\n            }\n        }else{ /* Not truecolour, so we can't blend. Just use the top-left pixel instead */\n            for( yy=0; yy < ch; yy++ ){\n                for( xx=0; xx < cw; xx++ ){\n                    memcpy( dstptr, srcptr, bytesPerPixel);\n                    srcptr += bytesPerPixel * cl->scalingFactor;\n                    dstptr += bytesPerPixel;\n                }\n                srcptr += (rfbScreen.paddedWidthInBytes - cw * bytesPerPixel)* cl->scalingFactor;\n                dstptr += cl->scalingPaddedWidthInBytes - cw * bytesPerPixel;\n            }\n        }\n    }\n\n    *y = cy;\n    *h = ch;\n    *x = cx;\n    *w = cw;\n}\n"
  },
  {
    "path": "OSXvnc-server/rfbserver.h",
    "content": "// This structure represents the entire state of the RFB server\n// We use it for passing off to the bundles\n\ntypedef struct rfbserver {\n\tid vncServer;\n\n\tchar *desktopName;\n\tint rfbPort;\n\tBOOL rfbLocalhostOnly;\n\n\tpthread_mutex_t listenerAccepting;\n\tpthread_cond_t listenerGotNewClient;\n} rfbserver;\n"
  },
  {
    "path": "OSXvnc-server/rre.c",
    "content": "/*\n * rre.c\n *\n * Routines to implement Rise-and-Run-length Encoding (RRE).  This\n * code is based on krw's original javatel rfbserver.\n */\n\n/*\n *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>.\n *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.\n *  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n#include <stdlib.h>\n#include <stdio.h>\n#include \"rfb.h\"\n\n/*\n * rreBeforeBuf contains pixel data in the client's format.\n * rreAfterBuf contains the RRE encoded version.  If the RRE encoded version is\n * larger than the raw data or if it exceeds rreAfterBufSize then\n * raw encoding is used instead.\n */\n\nstatic int rreBeforeBufSize = 0;\nstatic char *rreBeforeBuf = NULL;\n\nstatic int rreAfterBufSize = 0;\nstatic char *rreAfterBuf = NULL;\nstatic int rreAfterBufLen;\n\nstatic int subrectEncode8(CARD8 *data, int w, int h);\nstatic int subrectEncode16(CARD16 *data, int w, int h);\nstatic int subrectEncode32(CARD32 *data, int w, int h);\nstatic CARD32 getBgColour(char *data, int size, int bpp);\n\n\n/*\n * rfbSendRectEncodingRRE - send a given rectangle using RRE encoding.\n */\n\nBool\nrfbSendRectEncodingRRE(rfbClientPtr cl, int x, int y, int w, int h)\n{\n    rfbFramebufferUpdateRectHeader rect;\n    rfbRREHeader hdr;\n    int nSubrects;\n    int i;\n    char *fbptr = (cl->scalingFrameBuffer + (cl->scalingPaddedWidthInBytes * y)\n                   + (x * (rfbScreen.bitsPerPixel / 8)));\n\n    int maxRawSize = (rfbScreen.width * rfbScreen.height\n                      * (cl->format.bitsPerPixel / 8));\n\n    if (rreBeforeBufSize < maxRawSize) {\n        rreBeforeBufSize = maxRawSize;\n        if (rreBeforeBuf == NULL)\n            rreBeforeBuf = (char *)xalloc(rreBeforeBufSize);\n        else\n            rreBeforeBuf = (char *)xrealloc(rreBeforeBuf, rreBeforeBufSize);\n    }\n\n    if (rreAfterBufSize < maxRawSize) {\n        rreAfterBufSize = maxRawSize;\n        if (rreAfterBuf == NULL)\n            rreAfterBuf = (char *)xalloc(rreAfterBufSize);\n        else\n            rreAfterBuf = (char *)xrealloc(rreAfterBuf, rreAfterBufSize);\n    }\n\n    (*cl->translateFn)(cl->translateLookupTable, &rfbServerFormat,\n                       &cl->format, fbptr, rreBeforeBuf,\n                       cl->scalingPaddedWidthInBytes, w, h);\n\n    switch (cl->format.bitsPerPixel) {\n    case 8:\n        nSubrects = subrectEncode8((CARD8 *)rreBeforeBuf, w, h);\n        break;\n    case 16:\n        nSubrects = subrectEncode16((CARD16 *)rreBeforeBuf, w, h);\n        break;\n    case 32:\n        nSubrects = subrectEncode32((CARD32 *)rreBeforeBuf, w, h);\n        break;\n    default:\n        rfbLog(\"getBgColour: bpp %d?\",cl->format.bitsPerPixel);\n        exit(1);\n    }\n\n    if (nSubrects < 0) {\n\n        /* RRE encoding was too large, use raw */\n\n        return rfbSendRectEncodingRaw(cl, x, y, w, h);\n    }\n\n    cl->rfbRectanglesSent[rfbEncodingRRE]++;\n    cl->rfbBytesSent[rfbEncodingRRE] += (sz_rfbFramebufferUpdateRectHeader\n                                         + sz_rfbRREHeader + rreAfterBufLen);\n\n    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader\n        > UPDATE_BUF_SIZE)\n    {\n        if (!rfbSendUpdateBuf(cl))\n            return FALSE;\n    }\n\n    rect.r.x = Swap16IfLE(x);\n    rect.r.y = Swap16IfLE(y);\n    rect.r.w = Swap16IfLE(w);\n    rect.r.h = Swap16IfLE(h);\n    rect.encoding = Swap32IfLE(rfbEncodingRRE);\n\n    memcpy(&cl->updateBuf[cl->ublen], &rect, sz_rfbFramebufferUpdateRectHeader);\n    cl->ublen += sz_rfbFramebufferUpdateRectHeader;\n\n    hdr.nSubrects = Swap32IfLE(nSubrects);\n\n    memcpy(&cl->updateBuf[cl->ublen], &hdr, sz_rfbRREHeader);\n    cl->ublen += sz_rfbRREHeader;\n\n    for (i = 0; i < rreAfterBufLen;) {\n\n        int bytesToCopy = UPDATE_BUF_SIZE - cl->ublen;\n\n        if (i + bytesToCopy > rreAfterBufLen) {\n            bytesToCopy = rreAfterBufLen - i;\n        }\n\n        memcpy(&cl->updateBuf[cl->ublen], &rreAfterBuf[i], bytesToCopy);\n\n        cl->ublen += bytesToCopy;\n        i += bytesToCopy;\n\n        if (cl->ublen == UPDATE_BUF_SIZE) {\n            if (!rfbSendUpdateBuf(cl))\n                return FALSE;\n        }\n    }\n\n    return TRUE;\n}\n\n\n\n/*\n * subrectEncode() encodes the given multicoloured rectangle as a background\n * colour overwritten by single-coloured rectangles.  It returns the number\n * of subrectangles in the encoded buffer, or -1 if subrect encoding won't\n * fit in the buffer.  It puts the encoded rectangles in rreAfterBuf.  The\n * single-colour rectangle partition is not optimal, but does find the biggest\n * horizontal or vertical rectangle top-left anchored to each consecutive\n * coordinate position.\n *\n * The coding scheme is simply [<bgcolour><subrect><subrect>...] where each\n * <subrect> is [<colour><x><y><w><h>].\n */\n\n#define DEFINE_SUBRECT_ENCODE(bpp)                                            \\\nstatic int                                                                    \\\nsubrectEncode##bpp(CARD##bpp *data, int w,int h)                              \\\n{                                                                             \\\n    CARD##bpp cl;                                                             \\\n    rfbRectangle subrect;                                                     \\\n    int x,y;                                                                  \\\n    int i,j;                                                                  \\\n    int hx=0,hy,vx=0,vy;                                                      \\\n    int hyflag;                                                               \\\n    CARD##bpp *seg;                                                           \\\n    CARD##bpp *line;                                                          \\\n    int hw,hh,vw,vh;                                                          \\\n    int thex,they,thew,theh;                                                  \\\n    int numsubs = 0;                                                          \\\n    int newLen;                                                               \\\n    CARD##bpp bg = (CARD##bpp)getBgColour((char*)data,w*h,bpp);               \\\n                                                                              \\\n    *((CARD##bpp*)rreAfterBuf) = bg;                                          \\\n                                                                              \\\n    rreAfterBufLen = (bpp/8);                                                 \\\n                                                                              \\\n    for (y=0; y<h; y++) {                                                     \\\n      line = data+(y*w);                                                      \\\n      for (x=0; x<w; x++) {                                                   \\\n        if (line[x] != bg) {                                                  \\\n          cl = line[x];                                                       \\\n          hy = y-1;                                                           \\\n          hyflag = 1;                                                         \\\n          for (j=y; j<h; j++) {                                               \\\n            seg = data+(j*w);                                                 \\\n            if (seg[x] != cl) {break;}                                        \\\n            i = x;                                                            \\\n            while ((seg[i] == cl) && (i < w)) i += 1;                         \\\n            i -= 1;                                                           \\\n            if (j == y) vx = hx = i;                                          \\\n            if (i < vx) vx = i;                                               \\\n            if ((hyflag > 0) && (i >= hx)) {hy += 1;} else {hyflag = 0;}      \\\n          }                                                                   \\\n          vy = j-1;                                                           \\\n                                                                              \\\n          /*  We now have two possible subrects: (x,y,hx,hy) and (x,y,vx,vy)  \\\n           *  We'll choose the bigger of the two.                             \\\n           */                                                                 \\\n          hw = hx-x+1;                                                        \\\n          hh = hy-y+1;                                                        \\\n          vw = vx-x+1;                                                        \\\n          vh = vy-y+1;                                                        \\\n                                                                              \\\n          thex = x;                                                           \\\n          they = y;                                                           \\\n                                                                              \\\n          if ((hw*hh) > (vw*vh)) {                                            \\\n            thew = hw;                                                        \\\n            theh = hh;                                                        \\\n          } else {                                                            \\\n            thew = vw;                                                        \\\n            theh = vh;                                                        \\\n          }                                                                   \\\n                                                                              \\\n          subrect.x = Swap16IfLE(thex);                                       \\\n          subrect.y = Swap16IfLE(they);                                       \\\n          subrect.w = Swap16IfLE(thew);                                       \\\n          subrect.h = Swap16IfLE(theh);                                       \\\n                                                                              \\\n          newLen = rreAfterBufLen + (bpp/8) + sz_rfbRectangle;                \\\n          if ((newLen > (w * h * (bpp/8))) || (newLen > rreAfterBufSize))     \\\n            return -1;                                                        \\\n                                                                              \\\n          numsubs += 1;                                                       \\\n          *((CARD##bpp*)(rreAfterBuf + rreAfterBufLen)) = cl;                 \\\n          rreAfterBufLen += (bpp/8);                                          \\\n          memcpy(&rreAfterBuf[rreAfterBufLen], &subrect, sz_rfbRectangle);    \\\n          rreAfterBufLen += sz_rfbRectangle;                                  \\\n                                                                              \\\n          /*                                                                  \\\n           * Now mark the subrect as done.                                    \\\n           */                                                                 \\\n          for (j=they; j < (they+theh); j++) {                                \\\n            for (i=thex; i < (thex+thew); i++) {                              \\\n              data[j*w+i] = bg;                                               \\\n            }                                                                 \\\n          }                                                                   \\\n        }                                                                     \\\n      }                                                                       \\\n    }                                                                         \\\n                                                                              \\\n    return numsubs;                                                           \\\n}\n\nDEFINE_SUBRECT_ENCODE(8)\nDEFINE_SUBRECT_ENCODE(16)\nDEFINE_SUBRECT_ENCODE(32)\n\n\n/*\n * getBgColour() gets the most prevalent colour in a byte array.\n */\nstatic CARD32\ngetBgColour(char *data, int size, int bpp)\n{\n\n#define NUMCLRS 256\n\n  static int counts[NUMCLRS];\n  int i,j,k;\n\n  int maxcount = 0;\n  CARD8 maxclr = 0;\n\n  if (bpp != 8) {\n    if (bpp == 16) {\n      return ((CARD16 *)data)[0];\n    } else if (bpp == 32) {\n      return ((CARD32 *)data)[0];\n    } else {\n      rfbLog(\"getBgColour: bpp %d?\",bpp);\n      exit(1);\n    }\n  }\n\n  for (i=0; i<NUMCLRS; i++) {\n    counts[i] = 0;\n  }\n\n  for (j=0; j<size; j++) {\n    k = (int)(((CARD8 *)data)[j]);\n    if (k >= NUMCLRS) {\n      rfbLog(\"getBgColour: unusual colour = %d\", k);\n      exit(1);\n    }\n    counts[k] += 1;\n    if (counts[k] > maxcount) {\n      maxcount = counts[k];\n      maxclr = ((CARD8 *)data)[j];\n    }\n  }\n\n  return maxclr;\n}\n"
  },
  {
    "path": "OSXvnc-server/screencapture.c",
    "content": "/*****************************************************************************\n * mac.c: Screen capture module for the Mac.\n *****************************************************************************\n * Copyright (C) 2004, 2008 the VideoLAN team\n * $Id: screencapture.c,v 1.1 2009/09/10 14:37:18 jonathanosx Exp $\n *\n * Authors: Derk-Jan Hartman <hartman at videolan dot org>\n *          arai <arai_a@mac.com>\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 2 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.\n *****************************************************************************/\n\n/*****************************************************************************\n * Preamble\n *****************************************************************************/\n#import <stdlib.h>\n#import \"screencapture.h\"\n\n// This function has to be called before doing any screen capture\nscreen_data_t *screen_InitCapture()\n{\n    CGLPixelFormatAttribute attribs[4];\n    CGLPixelFormatObj pix, pix2;\n    GLint npix;\n    GLint viewport[4];\n    screen_data_t * p_data = ( screen_data_t * ) malloc( sizeof( screen_data_t ) );\n\n    attribs[0] = kCGLPFAFullScreen;\n    attribs[1] = kCGLPFADisplayMask;\n    attribs[2] = CGDisplayIDToOpenGLDisplayMask( CGMainDisplayID() );\n    attribs[3] = 0;\n\n\t// Create a fullscreen context\n    CGLChoosePixelFormat( attribs, &pix, &npix );\n    CGLCreateContext( pix, NULL, &( p_data->screen ) );\n    CGLDestroyPixelFormat( pix );\n\n    CGLSetCurrentContext( p_data->screen );\n    CGLSetFullScreen( p_data->screen );\n\n\t// Get the screen size\n    glGetIntegerv( GL_VIEWPORT, viewport );\n    p_data->screen_width = viewport[2];\n    p_data->screen_height = viewport[3];\n\n\tp_data->offscreen_width = 2;\n\tp_data->offscreen_height = 2;\n\twhile (p_data->offscreen_width < p_data->screen_width) p_data->offscreen_width *= 2;\n\twhile (p_data->offscreen_height < p_data->screen_height) p_data->offscreen_height *= 2;\n\n\t// Save screen size\n    attribs [0] = kCGLPFAOffScreen;\n    attribs [1] = kCGLPFAColorSize;\n    attribs [2] = 32;\n    attribs [3] = 0;\n\n\t// Create an offscreen context\n    CGLChoosePixelFormat( attribs, &pix2, &npix );\n    CGLCreateContext( pix2, NULL, &( p_data->scaled ) );\n    CGLDestroyPixelFormat( pix2 );\n\n    CGLSetCurrentContext( p_data->scaled );\n    p_data->scaled_image = ( char * )malloc( p_data->screen_width\n\t\t\t\t\t\t\t\t\t\t\t* p_data->screen_height * 4 );\n    CGLSetOffScreen( p_data->scaled, p_data->screen_width, p_data->screen_height,\n\t\t\t\t\tp_data->screen_width * 4, p_data->scaled_image );\n\n    glGenTextures( 1, &( p_data->texture ) );\n    glBindTexture( GL_TEXTURE_2D, p_data->texture );\n\n    p_data->texture_image = ( char * )malloc( p_data->offscreen_width * p_data->offscreen_height * 4 );\n\n\t// Parameters for textures\n    glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );\n    glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );\n    glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );\n    glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );\n\n\t// Allocate memory for the screen capture (only one time)\n\tp_data->data_return = (unsigned char *) malloc( p_data->screen_width * p_data->screen_height * 4 );\n\n\treturn p_data;\n}\n\n// This function takes a screen capture using opengl\nchar * screen_Capture(screen_data_t * p_data)\n{\n\t// Check if we called screen_InitCapure() (the p_data should be allocated)\n\tif (p_data == NULL) return NULL;\n\n\t// TODO: Search for the right pixel format\n\t//if (bitPerPixel == 16) pixelFormat = GL_UNSIGNED_SHORT_1_5_5_5_REV;\n\tint pixelFormat = GL_UNSIGNED_INT_8_8_8_8_REV;\n\n\t// Change the current context to the desktop context\n    CGLSetCurrentContext( p_data->screen );\n\n\tglPixelStorei(GL_PACK_ROW_LENGTH, p_data->offscreen_width);\n\n\t// Take a screenshot of the screen\n    glReadPixels(0,\n\t\t\t\t 0,\n\t\t\t\t p_data->screen_width,\n\t\t\t\t p_data->screen_height,\n\t\t\t\t GL_BGRA, pixelFormat,\n\t\t\t\t p_data->texture_image );\n\n\t//return p_data->texture_image;\n\n\tglPixelStorei(GL_PACK_ROW_LENGTH, 0);\n\n\t// Change to our own context\n    CGLSetCurrentContext( p_data->scaled );\n\n\t// Enable textures\n    glEnable( GL_TEXTURE_2D );\n    glBindTexture( GL_TEXTURE_2D, p_data->texture );\n\n\t// Change the texture with the screen capture made before\n    glTexImage2D( GL_TEXTURE_2D, 0,\n\t\t\t\t GL_RGBA, p_data->offscreen_width, p_data->offscreen_height, 0,\n\t\t\t\t GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, p_data->texture_image );\n\n\t// Clear our context\n    glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );\n    glClear( GL_COLOR_BUFFER_BIT );\n\n\tfloat max_width = p_data->screen_width/(double)p_data->offscreen_width;\n\tfloat max_height = p_data->screen_height/(double)p_data->offscreen_height;\n\n\t// Draw the screen capture (and we also flip it horizontally)\n    glColor3f( 1.0f, 1.0f, 1.0f );\n    glEnable( GL_TEXTURE_2D );\n    glBindTexture( GL_TEXTURE_2D, p_data->texture );\n    glBegin( GL_POLYGON );\n    glTexCoord2f( 0.0      , max_height ); glVertex2f( -1.0, -1.0 );\n    glTexCoord2f( max_width, max_height ); glVertex2f( 1.0, -1.0 );\n    glTexCoord2f( max_width, 0.0        ); glVertex2f( 1.0, 1.0 );\n    glTexCoord2f( 0.0      , 0.0        ); glVertex2f( -1.0, 1.0 );\n    glEnd();\n    glDisable( GL_TEXTURE_2D );\n\n\t// Get the pixels after transformation\n    glReadPixels( 0, 0,\n\t\t\t\t p_data->screen_width,\n\t\t\t\t p_data->screen_height,\n\t\t\t\t GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV,\n\t\t\t\t p_data->data_return );\n\n    return (char *) p_data->data_return;\n}\n\nvoid screen_CloseCapture(screen_data_t * p_data)\n{\n\t// Free data\n\tif (p_data != NULL) {\n\t\tCGLSetCurrentContext( NULL );\n\t\tCGLClearDrawable( p_data->screen );\n\t\tCGLDestroyContext( p_data->screen );\n\n\t\tif (p_data->data_return != NULL) {\n\t\t\tfree(p_data->data_return);\n\t\t}\n\t\tfree(p_data);\n\t}\n}\n\n"
  },
  {
    "path": "OSXvnc-server/screencapture.h",
    "content": "/*\n *  screencapture.h\n *  OSXvnc\n *\n *  Created by Jonathan Gillaspie on 6/1/09.\n *  Copyright 2009 __MyCompanyName__. All rights reserved.\n *\n */\n\n#import <OpenGL/OpenGL.h>\n#import <OpenGL/gl.h>\n\ntypedef struct screen_data_t\n{\n\tCGLContextObj screen;\n\n\tCGLContextObj scaled;\n\tchar *scaled_image;\n\n\tGLuint texture;\n\tchar *texture_image;\n\n\t// Data capture from screen\n\tunsigned char * data_return;\n\n\tint screen_width;\n\tint screen_height;\n\n\tint offscreen_width;\n\tint offscreen_height;\n} screen_data_t;\n\n"
  },
  {
    "path": "OSXvnc-server/sockets.c",
    "content": "/*\n * sockets.c - deal with TCP & UDP sockets.\n *\n * This code should be independent of any changes in the RFB protocol.  It just\n * deals with the X server scheduling stuff, calling rfbNewClientConnection and\n * rfbProcessClientMessage to actually deal with the protocol.  If a socket\n * needs to be closed for any reason then rfbCloseClient should be called, and\n * this in turn will call rfbClientConnectionGone.  To make an active\n * connection out, call rfbConnect - note that this does _not_ call\n * rfbNewClientConnection.\n *\n * This file is divided into two types of function.  Those beginning with\n * \"rfb\" are specific to sockets using the RFB protocol.  Those without the\n * \"rfb\" prefix are more general socket routines (which are used by the http\n * code).\n *\n * Thanks to Karl Hakimian for pointing out that some platforms return EAGAIN\n * not EWOULDBLOCK.\n */\n\n/*\n *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>.\n *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.\n *  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <sys/types.h>\n#include <sys/time.h>\n#include <sys/socket.h>\n#include <netinet/in.h>\n//#include <netinet/tcp.h> -- This conflicts with Carbon\n#include <netdb.h>\n#include <fcntl.h>\n#include <errno.h>\n#include <unistd.h>\n#include <pthread.h>\n\n#include \"rfb.h\"\n\nint rfbMaxClientWait = 20000;   /* time (ms) after which we decide client has\n                                   gone away - needed to stop us hanging */\n\n\nvoid\nrfbCloseClient(rfbClientPtr cl)\n{\n    close(cl->sock);\n    cl->sock = -1;\n}\n\n\n/*\n * ReadExact reads an exact number of bytes from a client.  Returns 1 if\n * those bytes have been read, 0 if the other end has closed, or -1 if an error\n * occurred (errno is set to ETIMEDOUT if it timed out).\n */\n\nint\nReadExact(rfbClientPtr cl, void *data, size_t len)\n{\n    char *buf = data;\n    int sock = cl->sock;\n    fd_set fds;\n    struct timeval tv;\n\n    while (len > 0) {\n        ssize_t n = read(sock, buf, len);\n\n        if (n > 0) {\n\n            buf += n;\n            len -= n;\n\n        } else if (n == 0) {\n\n            return 0;\n\n        } else {\n            if (errno != EWOULDBLOCK && errno != EAGAIN) {\n                return -1;\n            }\n\n            FD_ZERO(&fds);\n            FD_SET(sock, &fds);\n            tv.tv_sec = rfbMaxClientWait / 1000;\n            tv.tv_usec = (rfbMaxClientWait % 1000) * 1000;\n            n = select(sock+1, &fds, NULL, NULL, &tv);\n            if (n < 0) {\n                rfbLogPerror(\"ReadExact: select\");\n                return -1;\n            }\n            if (n == 0) {\n                errno = ETIMEDOUT;\n                return -1;\n            }\n        }\n    }\n    return 1;\n}\n\n\n\n/*\n * WriteExact writes an exact number of bytes to a client.  Returns 1 if\n * those bytes have been written, or -1 if an error occurred (errno is set to\n * ETIMEDOUT if it timed out).\n */\n\nint\nWriteExact(rfbClientPtr cl, const void *data, size_t len)\n{\n    const char *buf = data;\n    int sock = cl->sock;\n    fd_set fds;\n    struct timeval tv;\n    int totalTimeWaited = 0;\n\n\n\t//    pthread_mutex_lock(&cl->outputMutex);\n    while (len > 0) {\n        ssize_t n = write(sock, buf, len);\n\n        if (n > 0) {\n\n            buf += n;\n            len -= n;\n\n        } else if (n == 0) {\n\n            rfbLog(\"WriteExact: write returned 0?\");\n            exit(1);\n\n        } else {\n            if (errno != EWOULDBLOCK && errno != EAGAIN) {\n                //pthread_mutex_unlock(&cl->outputMutex);\n                return -1;\n            }\n\n            /* Retry every 5 seconds until we exceed rfbMaxClientWait.  We\n               need to do this because select doesn't necessarily return\n               immediately when the other end has gone away */\n\n            FD_ZERO(&fds);\n            FD_SET(sock, &fds);\n            tv.tv_sec = 5;\n            tv.tv_usec = 0;\n            n = select(sock+1, NULL, &fds, NULL, &tv);\n            if (n < 0) {\n                rfbLogPerror(\"WriteExact: select\");\n                //pthread_mutex_unlock(&cl->outputMutex);\n                return -1;\n            }\n            if (n == 0) {\n                totalTimeWaited += 5000;\n                if (totalTimeWaited >= rfbMaxClientWait) {\n                    errno = ETIMEDOUT;\n                    //pthread_mutex_unlock(&cl->outputMutex);\n                    return -1;\n                }\n            } else {\n                totalTimeWaited = 0;\n            }\n        }\n    }\n    //pthread_mutex_unlock(&cl->outputMutex);\n    return 1;\n}\n"
  },
  {
    "path": "OSXvnc-server/stats.c",
    "content": "/*\n * stats.c\n */\n\n/*\n *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>.\n *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.\n *  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n#include <stdio.h>\n#include <stdlib.h>\n#include \"rfb.h\"\n\nchar* encNames[] = {\n    \"Raw\", \"CopyRect\", \"RRE\", \"[encoding 3]\", \"CoRRE\", \"Hextile\",\n    \"Zlib\", \"Tight\", \"ZlibHextile\", \"[encoding 9]\",\n    \"Cursor Shape Updates\", \"Cursor Position Updates\", \"Screen Resize\",\n    NULL, NULL, NULL, \"ZRLE\"\n};\n\nvoid rfbResetStats(rfbClientPtr cl) {\n    int i;\n    for (i = 0; i < MAX_ENCODINGS; i++) {\n        cl->rfbBytesSent[i] = 0;\n        cl->rfbRectanglesSent[i] = 0;\n    }\n    cl->rfbLastRectMarkersSent = 0;\n    cl->rfbLastRectBytesSent = 0;\n    cl->rfbFramebufferUpdateMessagesSent = 0;\n    cl->rfbRawBytesEquivalent = 0;\n    cl->rfbKeyEventsRcvd = 0;\n    cl->rfbPointerEventsRcvd = 0;\n}\n\nvoid\nrfbPrintStats(rfbClientPtr cl)\n{\n    int i;\n    int totalRectanglesSent = 0;\n    int totalBytesSent = 0;\n\n    rfbLog(\"Statistics:\");\n\n    if ((cl->rfbKeyEventsRcvd != 0) || (cl->rfbPointerEventsRcvd != 0))\n        rfbLog(\"  key events received %d, pointer events %d\",\n                cl->rfbKeyEventsRcvd, cl->rfbPointerEventsRcvd);\n\n    for (i = 0; i < MAX_ENCODINGS; i++) {\n        totalRectanglesSent += cl->rfbRectanglesSent[i];\n        totalBytesSent += cl->rfbBytesSent[i];\n    }\n    totalRectanglesSent += cl->rfbLastRectMarkersSent;\n    totalBytesSent += cl->rfbLastRectBytesSent;\n\n    rfbLog(\"  framebuffer updates %d, rectangles %d, bytes %d\",\n            cl->rfbFramebufferUpdateMessagesSent, totalRectanglesSent,\n            totalBytesSent);\n\n    if (cl->rfbLastRectMarkersSent != 0)\n        rfbLog(\"    LastRect markers %d, bytes %d\",\n                cl->rfbLastRectMarkersSent, cl->rfbLastRectBytesSent);\n\n    for (i = 0; i < MAX_ENCODINGS; i++) {\n        if (cl->rfbRectanglesSent[i] != 0)\n            rfbLog(\"    %s rectangles %d, bytes %d\",\n                   encNames[i], cl->rfbRectanglesSent[i], cl->rfbBytesSent[i]);\n    }\n\n    if ((totalBytesSent - cl->rfbBytesSent[rfbEncodingCopyRect]) != 0) {\n        rfbLog(\"  raw bytes equivalent %d, compression ratio %f\",\n                cl->rfbRawBytesEquivalent,\n                (double)cl->rfbRawBytesEquivalent\n                / (double)(totalBytesSent -\n                           cl->rfbBytesSent[rfbEncodingCopyRect] -\n                           cl->rfbLastRectBytesSent));\n    }\n}\n"
  },
  {
    "path": "OSXvnc-server/storepasswd.c",
    "content": "/*\n *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>.\n *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.\n *  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n#include <stdlib.h>\n#include <stdio.h>\n#include \"vncauth.h\"\n\nvoid usage(void)\n{\n    printf(\"\\nusage:  storepasswd <password> <filename>\\n\\n\");\n\n    printf(\"Stores a password in encrypted format.\\n\");\n    printf(\"The resulting file can be used with the -rfbauth argument to OSXvnc.\\n\\n\");\n    exit(1);\n}\n\nint main(int argc, char *argv[])\n{\n    if (argc != 3)\n        usage();\n\n    if (vncEncryptAndStorePasswd(argv[1], argv[2]) != 0) {\n        printf(\"storing password failed.\\n\");\n        return 1;\n    } else {\n        printf(\"storing password succeeded.\\n\");\n        return 0;\n    }\n}\n"
  },
  {
    "path": "OSXvnc-server/tableinitcmtemplate.c",
    "content": "/*\n * tableinitcmtemplate.c - template for initialising lookup tables for\n * translation from a colour map to true colour.\n *\n * This file shouldn't be compiled.  It is included multiple times by\n * translate.c, each time with a different definition of the macro OUT.\n * For each value of OUT, this file defines a function which allocates an\n * appropriately sized lookup table and initialises it.\n *\n * I know this code isn't nice to read because of all the macros, but\n * efficiency is important here.\n */\n\n/*\n *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>.\n *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.\n *  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n#if !defined(OUT)\n#error \"This file shouldn't be compiled.\"\n#error \"It is included as part of translate.c\"\n#endif\n\n#define OUT_T CONCAT2E(CARD,OUT)\n#define SwapOUT(x) CONCAT2E(Swap,OUT(x))\n#define rfbInitColourMapSingleTableOUT \\\n                                CONCAT2E(rfbInitColourMapSingleTable,OUT)\n\nstatic void\nrfbInitColourMapSingleTableOUT (char **table, rfbPixelFormat *in,\n                                rfbPixelFormat *out)\n{\n    int i, r, g, b;\n    OUT_T *t;\n    EntryPtr pent;\n    int nEntries = 1 << in->bitsPerPixel;\n\n    if (*table) free(*table);\n    *table = (char *)malloc(nEntries * sizeof(OUT_T));\n    t = (OUT_T *)*table;\n\n    pent = (EntryPtr)&rfbInstalledColormap->red[0];\n\n    for (i = 0; i < nEntries; i++) {\n        if (pent->fShared) {\n            r = pent->co.shco.red->color;\n            g = pent->co.shco.green->color;\n            b = pent->co.shco.blue->color;\n        } else {\n            r = pent->co.local.red;\n            g = pent->co.local.green;\n            b = pent->co.local.blue;\n        }\n        t[i] = ((((r * out->redMax + 32767) / 65535) << out->redShift) |\n                (((g * out->greenMax + 32767) / 65535) << out->greenShift) |\n                (((b * out->blueMax + 32767) / 65535) << out->blueShift));\n#if (OUT != 8)\n        if (out->bigEndian != in->bigEndian) {\n            t[i] = SwapOUT(t[i]);\n        }\n#endif\n        pent++;\n    }\n}\n\n#undef OUT_T\n#undef SwapOUT\n#undef rfbInitColourMapSingleTableOUT\n"
  },
  {
    "path": "OSXvnc-server/tableinittctemplate.c",
    "content": "/*\n * tableinittctemplate.c - template for initialising lookup tables for\n * truecolour to truecolour translation.\n *\n * This file shouldn't be compiled.  It is included multiple times by\n * translate.c, each time with a different definition of the macro OUT.\n * For each value of OUT, this file defines two functions for initialising\n * lookup tables.  One is for truecolour translation using a single lookup\n * table, the other is for truecolour translation using three separate\n * lookup tables for the red, green and blue values.\n *\n * I know this code isn't nice to read because of all the macros, but\n * efficiency is important here.\n */\n\n/*\n *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>.\n *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.\n *  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n#if !defined(OUT)\n#error \"This file shouldn't be compiled.\"\n#error \"It is included as part of translate.c\"\n#endif\n\n#define OUT_T CONCAT2E(CARD,OUT)\n#define SwapOUT(x) CONCAT2E(Swap,OUT(x))\n#define rfbInitTrueColourSingleTableOUT \\\n                                CONCAT2E(rfbInitTrueColourSingleTable,OUT)\n#define rfbInitTrueColourRGBTablesOUT CONCAT2E(rfbInitTrueColourRGBTables,OUT)\n#define rfbInitOneRGBTableOUT CONCAT2E(rfbInitOneRGBTable,OUT)\n\nstatic void\nrfbInitOneRGBTableOUT (OUT_T *table, int inMax, int outMax, int outShift,\n                       int swap);\n\n\n/*\n * rfbInitTrueColourSingleTable sets up a single lookup table for truecolour\n * translation.\n */\n\nstatic void\nrfbInitTrueColourSingleTableOUT (char **table, rfbPixelFormat *in,\n                                 rfbPixelFormat *out)\n{\n    int i;\n    int inRed, inGreen, inBlue, outRed, outGreen, outBlue;\n    OUT_T *t;\n    int nEntries = 1 << in->bitsPerPixel;\n\n    if (*table) free(*table);\n    *table = (char *)xalloc(nEntries * sizeof(OUT_T));\n    t = (OUT_T *)*table;\n\n    for (i = 0; i < nEntries; i++) {\n        inRed   = (i >> in->redShift)   & in->redMax;\n        inGreen = (i >> in->greenShift) & in->greenMax;\n        inBlue  = (i >> in->blueShift)  & in->blueMax;\n\n        outRed   = (inRed   * out->redMax   + in->redMax / 2)   / in->redMax;\n        outGreen = (inGreen * out->greenMax + in->greenMax / 2) / in->greenMax;\n        outBlue  = (inBlue  * out->blueMax  + in->blueMax / 2)  / in->blueMax;\n\n        t[i] = ((outRed   << out->redShift)   |\n                (outGreen << out->greenShift) |\n                (outBlue  << out->blueShift));\n#if (OUT != 8)\n        if (out->bigEndian != in->bigEndian) {\n            t[i] = SwapOUT(t[i]);\n        }\n#endif\n    }\n}\n\n\n/*\n * rfbInitTrueColourRGBTables sets up three separate lookup tables for the\n * red, green and blue values.\n */\n\nstatic void\nrfbInitTrueColourRGBTablesOUT (char **table, rfbPixelFormat *in,\n                               rfbPixelFormat *out)\n{\n    OUT_T *redTable;\n    OUT_T *greenTable;\n    OUT_T *blueTable;\n\n    if (*table) free(*table);\n    *table = (char *)xalloc((in->redMax + in->greenMax + in->blueMax + 3)\n                            * sizeof(OUT_T));\n    redTable = (OUT_T *)*table;\n    greenTable = redTable + in->redMax + 1;\n    blueTable = greenTable + in->greenMax + 1;\n\n    rfbInitOneRGBTableOUT (redTable, in->redMax, out->redMax,\n                           out->redShift, (out->bigEndian != in->bigEndian));\n    rfbInitOneRGBTableOUT (greenTable, in->greenMax, out->greenMax,\n                           out->greenShift, (out->bigEndian != in->bigEndian));\n    rfbInitOneRGBTableOUT (blueTable, in->blueMax, out->blueMax,\n                           out->blueShift, (out->bigEndian != in->bigEndian));\n}\n\nstatic void\nrfbInitOneRGBTableOUT (OUT_T *table, int inMax, int outMax, int outShift,\n                       int swap)\n{\n    int i;\n    int nEntries = inMax + 1;\n\n    for (i = 0; i < nEntries; i++) {\n        table[i] = ((i * outMax + inMax / 2) / inMax) << outShift;\n#if (OUT != 8)\n        if (swap) {\n            table[i] = SwapOUT(table[i]);\n        }\n#endif\n    }\n}\n\n#undef OUT_T\n#undef SwapOUT\n#undef rfbInitTrueColourSingleTableOUT\n#undef rfbInitTrueColourRGBTablesOUT\n#undef rfbInitOneRGBTableOUT\n"
  },
  {
    "path": "OSXvnc-server/tabletranstemplate.c",
    "content": "/*\n * tabletranstemplate.c - template for translation using lookup tables.\n *\n * This file shouldn't be compiled.  It is included multiple times by\n * translate.c, each time with different definitions of the macros IN and OUT.\n *\n * For each pair of values IN and OUT, this file defines two functions for\n * translating a given rectangle of pixel data.  One uses a single lookup\n * table, and the other uses three separate lookup tables for the red, green\n * and blue values.\n *\n * I know this code isn't nice to read because of all the macros, but\n * efficiency is important here.\n */\n\n/*\n *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>.\n *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.\n *  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n#if !defined(IN) || !defined(OUT)\n#error \"This file shouldn't be compiled.\"\n#error \"It is included as part of translate.c\"\n#endif\n\n#define IN_T CONCAT2E(CARD,IN)\n#define OUT_T CONCAT2E(CARD,OUT)\n#define rfbTranslateWithSingleTableINtoOUT \\\n                                CONCAT4E(rfbTranslateWithSingleTable,IN,to,OUT)\n#define rfbTranslateWithRGBTablesINtoOUT \\\n                                CONCAT4E(rfbTranslateWithRGBTables,IN,to,OUT)\n\n/*\n * rfbTranslateWithSingleTableINtoOUT translates a rectangle of pixel data\n * using a single lookup table.\n */\n\nstatic void\nrfbTranslateWithSingleTableINtoOUT (char *table, rfbPixelFormat *in,\n                                    rfbPixelFormat *out,\n                                    char *iptr, char *optr,\n                                    int bytesBetweenInputLines,\n                                    int width, int height)\n{\n    IN_T *ip = (IN_T *)iptr;\n    OUT_T *op = (OUT_T *)optr;\n    int ipextra = bytesBetweenInputLines / sizeof(IN_T) - width;\n    OUT_T *opLineEnd;\n    OUT_T *t = (OUT_T *)table;\n\n    while (height > 0) {\n        opLineEnd = op + width;\n\n        while (op < opLineEnd) {\n            *(op++) = t[*(ip++)];\n        }\n\n        ip += ipextra;\n        height--;\n    }\n}\n\n\n/*\n * rfbTranslateWithRGBTablesINtoOUT translates a rectangle of pixel data\n * using three separate lookup tables for the red, green and blue values.\n */\n\nstatic void\nrfbTranslateWithRGBTablesINtoOUT (char *table, rfbPixelFormat *in,\n                                  rfbPixelFormat *out,\n                                  char *iptr, char *optr,\n                                  int bytesBetweenInputLines,\n                                  int width, int height)\n{\n    IN_T *ip = (IN_T *)iptr;\n    OUT_T *op = (OUT_T *)optr;\n    int ipextra = bytesBetweenInputLines / sizeof(IN_T) - width;\n    OUT_T *opLineEnd;\n    OUT_T *redTable = (OUT_T *)table;\n    OUT_T *greenTable = redTable + in->redMax + 1;\n    OUT_T *blueTable = greenTable + in->greenMax + 1;\n\n    while (height > 0) {\n        opLineEnd = op + width;\n\n        while (op < opLineEnd) {\n            *(op++) = (redTable[(*ip >> in->redShift) & in->redMax] |\n                       greenTable[(*ip >> in->greenShift) & in->greenMax] |\n                       blueTable[(*ip >> in->blueShift) & in->blueMax]);\n            ip++;\n        }\n        ip += ipextra;\n        height--;\n    }\n}\n\n#undef IN_T\n#undef OUT_T\n#undef rfbTranslateWithSingleTableINtoOUT\n#undef rfbTranslateWithRGBTablesINtoOUT\n"
  },
  {
    "path": "OSXvnc-server/tight.c",
    "content": "/*\n * tight.c\n *\n * Routines to implement Tight Encoding\n */\n\n/*\n *  Copyright (C) 2000, 2001 Const Kaplinsky.  All Rights Reserved.\n *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n#include <stdio.h>\n#include <pthread.h>\n#include \"rfb.h\"\n#include \"tight.h\"\n\n\n/* Note: The following constant should not be changed. */\n#define TIGHT_MIN_TO_COMPRESS 12\n\n/* The parameters below may be adjusted. */\n#define MIN_SPLIT_RECT_SIZE     4096\n#define MIN_SOLID_SUBRECT_SIZE  2048\n#define MAX_SPLIT_TILE_SIZE       16\n\n/* May be set to TRUE with \"-lazytight\" Xvnc option. */\nBool rfbTightDisableGradient = FALSE;\n\n\n/* Compression level stuff. The following array contains various\n   encoder parameters for each of 10 compression levels (0..9).\n   Last three parameters correspond to JPEG quality levels (0..9). */\n\ntypedef struct TIGHT_CONF_s {\n    int maxRectSize, maxRectWidth;\n    int monoMinRectSize, gradientMinRectSize;\n    int idxZlibLevel, monoZlibLevel, rawZlibLevel, gradientZlibLevel;\n    int gradientThreshold, gradientThreshold24;\n    int idxMaxColorsDivisor;\n    int jpegQuality, jpegThreshold, jpegThreshold24;\n} TIGHT_CONF;\n\nstatic TIGHT_CONF tightConf[10] = {\n    {   512,   32,   6, 65536, 0, 0, 0, 0,   0,   0,   4, 20, 10000, 23000 },\n    {  2048,  128,   6, 65536, 1, 1, 1, 0,   0,   0,   8, 30,  8000, 18000 },\n    {  6144,  256,   8, 65536, 3, 3, 2, 0,   0,   0,  24, 40,  6500, 15000 },\n    { 10240, 1024,  12, 65536, 5, 5, 3, 0,   0,   0,  32, 50,  5000, 12000 },\n    { 16384, 2048,  12, 65536, 6, 6, 4, 0,   0,   0,  32, 55,  4000, 10000 },\n    { 32768, 2048,  12,  4096, 7, 7, 5, 4, 150, 380,  32, 60,  3000,  8000 },\n    { 65536, 2048,  16,  4096, 7, 7, 6, 4, 170, 420,  48, 65,  2000,  5000 },\n    { 65536, 2048,  16,  4096, 8, 8, 7, 5, 180, 450,  64, 70,  1000,  2500 },\n    { 65536, 2048,  32,  8192, 9, 9, 8, 6, 190, 475,  64, 75,   500,  1200 },\n    { 65536, 2048,  32,  8192, 9, 9, 9, 6, 200, 500,  96, 80,   200,   500 }\n};\n\n\n/* Prototypes for static functions. */\n\nstatic void FindBestSolidArea (rfbClientPtr cl, int x, int y, int w, int h,\n                               CARD32 colorValue, int *w_ptr, int *h_ptr);\nstatic void ExtendSolidArea   (rfbClientPtr cl, int x, int y, int w, int h,\n                               CARD32 colorValue,\n                               int *x_ptr, int *y_ptr, int *w_ptr, int *h_ptr);\nstatic Bool CheckSolidTile    (rfbClientPtr cl, int x, int y, int w, int h,\n                               CARD32 *colorPtr, Bool needSameColor);\nstatic Bool CheckSolidTile8   (rfbClientPtr cl, int x, int y, int w, int h,\n                               CARD32 *colorPtr, Bool needSameColor);\nstatic Bool CheckSolidTile16  (rfbClientPtr cl, int x, int y, int w, int h,\n                               CARD32 *colorPtr, Bool needSameColor);\nstatic Bool CheckSolidTile32  (rfbClientPtr cl, int x, int y, int w, int h,\n                               CARD32 *colorPtr, Bool needSameColor);\n\nstatic Bool SendRectSimple    (rfbClientPtr cl, int x, int y, int w, int h);\nstatic Bool SendSubrect       (rfbClientPtr cl, int x, int y, int w, int h);\nstatic Bool SendTightHeader   (rfbClientPtr cl, int x, int y, int w, int h);\n\nstatic Bool SendSolidRect     (rfbClientPtr cl);\nstatic Bool SendMonoRect      (rfbClientPtr cl, int w, int h);\nstatic Bool SendIndexedRect   (rfbClientPtr cl, int w, int h);\nstatic Bool SendFullColorRect (rfbClientPtr cl, int w, int h);\nstatic Bool SendGradientRect  (rfbClientPtr cl, int w, int h);\n\nstatic Bool CompressData(rfbClientPtr cl, int streamId, int dataLen,\n                         int zlibLevel, int zlibStrategy);\nstatic Bool SendCompressedData(rfbClientPtr cl, int compressedLen);\n\nstatic void FillPalette8(rfbClientPtr cl, int count);\nstatic void FillPalette16(rfbClientPtr cl, int count);\nstatic void FillPalette32(rfbClientPtr cl, int count);\n\nstatic void PaletteReset(rfbClientPtr cl);\nstatic int PaletteInsert(rfbClientPtr cl, CARD32 rgb, int numPixels, int bpp);\n\nstatic void Pack24(char *buf, rfbPixelFormat *fmt, int count);\n\nstatic void EncodeIndexedRect16(rfbClientPtr cl, CARD8 *buf, int count);\nstatic void EncodeIndexedRect32(rfbClientPtr cl, CARD8 *buf, int count);\n\nstatic void EncodeMonoRect8(rfbClientPtr cl, CARD8 *buf, int w, int h);\nstatic void EncodeMonoRect16(rfbClientPtr cl, CARD8 *buf, int w, int h);\nstatic void EncodeMonoRect32(rfbClientPtr cl, CARD8 *buf, int w, int h);\n\nstatic void FilterGradient24(rfbClientPtr cl, char *buf, rfbPixelFormat *fmt, int w, int h);\nstatic void FilterGradient16(rfbClientPtr cl, CARD16 *buf, rfbPixelFormat *fmt, int w, int h);\nstatic void FilterGradient32(rfbClientPtr cl, CARD32 *buf, rfbPixelFormat *fmt, int w, int h);\n\nstatic int DetectSmoothImage(rfbClientPtr cl, rfbPixelFormat *fmt, int w, int h);\nstatic unsigned long DetectSmoothImage24(rfbClientPtr cl, rfbPixelFormat *fmt, int w, int h);\nstatic unsigned long DetectSmoothImage16(rfbClientPtr cl, rfbPixelFormat *fmt, int w, int h);\nstatic unsigned long DetectSmoothImage32(rfbClientPtr cl, rfbPixelFormat *fmt, int w, int h);\n\nstatic Bool SendJpegRect(rfbClientPtr cl, int x, int y, int w, int h,\n                         int quality);\nstatic void PrepareRowForJpeg(rfbClientPtr cl, CARD8 *dst, int x, int y, int count);\nstatic void PrepareRowForJpeg16(rfbClientPtr cl, CARD8 *dst, int x, int y, int count);\nstatic void PrepareRowForJpeg24(rfbClientPtr cl, CARD8 *dst, int x, int y, int count);\nstatic void PrepareRowForJpeg32(rfbClientPtr cl, CARD8 *dst, int x, int y, int count);\n\nstatic void JpegInitDestination(j_compress_ptr cinfo);\nstatic boolean JpegEmptyOutputBuffer(j_compress_ptr cinfo);\nstatic void JpegTermDestination(j_compress_ptr cinfo);\nstatic void JpegSetDstManager(rfbClientPtr cl, j_compress_ptr cinfo);\n\n// These defines will \"hopefully\" allow us to keep the rest of the code looking roughly the same\n// but call them with the client record pointer, instead of without it\n#define FillPalette8(x)              FillPalette8(cl, x)\n#define FillPalette16(x)             FillPalette16(cl, x)\n#define FillPalette32(x)             FillPalette32(cl, x)\n\n#define PaletteReset()               PaletteReset(cl)\n#define PaletteInsert(x, y, z)       PaletteInsert(cl, x, y, z)\n\n#define EncodeIndexedRect16(x, y)    EncodeIndexedRect16(cl, x, y)\n#define EncodeIndexedRect32(x, y)    EncodeIndexedRect32(cl, x, y)\n\n#define EncodeMonoRect8(x, y, z)     EncodeMonoRect8(cl, x, y, z)\n#define EncodeMonoRect16(x, y, z)    EncodeMonoRect16(cl, x, y, z)\n#define EncodeMonoRect32(x, y, z)    EncodeMonoRect32(cl, x, y, z)\n\n#define FilterGradient24(w, x, y, z) FilterGradient24(cl, w, x, y, z)\n#define FilterGradient16(w, x, y, z) FilterGradient16(cl, w, x, y, z)\n#define FilterGradient32(w, x, y, z) FilterGradient32(cl, w, x, y, z)\n\n#define DetectSmoothImage(x, y, z)   DetectSmoothImage(cl, x, y, z)\n#define DetectSmoothImage24(x, y, z) DetectSmoothImage24(cl, x, y, z)\n#define DetectSmoothImage16(x, y, z) DetectSmoothImage16(cl, x, y, z)\n#define DetectSmoothImage32(x, y, z) DetectSmoothImage32(cl, x, y, z)\n\n#define JpegSetDstManager(x)         JpegSetDstManager(cl, x)\n\n#define palette cl->palette\n\n\n/*\n * Tight encoding implementation.\n */\n\nint\nrfbNumCodedRectsTight(rfbClientPtr cl, int x, int y, int w, int h)\n{\n    int maxRectSize, maxRectWidth;\n    int subrectMaxWidth, subrectMaxHeight;\n\n    /* No matter how many rectangles we will send if LastRect markers\n       are used to terminate rectangle stream. */\n    if (cl->enableLastRectEncoding && w * h >= MIN_SPLIT_RECT_SIZE)\n      return 0;\n\n    maxRectSize = tightConf[cl->tightCompressLevel].maxRectSize;\n    maxRectWidth = tightConf[cl->tightCompressLevel].maxRectWidth;\n\n    if (w > maxRectWidth || w * h > maxRectSize) {\n        subrectMaxWidth = (w > maxRectWidth) ? maxRectWidth : w;\n        subrectMaxHeight = maxRectSize / subrectMaxWidth;\n        return (((w - 1) / maxRectWidth + 1) *\n                ((h - 1) / subrectMaxHeight + 1));\n    } else {\n        return 1;\n    }\n}\n\nBool\nrfbSendRectEncodingTight(rfbClientPtr cl, int x, int y, int w, int h)\n{\n    int nMaxRows;\n    CARD32 colorValue;\n    int dx, dy, dw, dh;\n    int x_best, y_best, w_best, h_best;\n    char *fbptr;\n\n    compressLevel = cl->tightCompressLevel;\n    qualityLevel = cl->tightQualityLevel;\n\n    if ( cl->format.depth == 24 && cl->format.redMax == 0xFF &&\n         cl->format.greenMax == 0xFF && cl->format.blueMax == 0xFF ) {\n        usePixelFormat24 = TRUE;\n    } else {\n        usePixelFormat24 = FALSE;\n    }\n\n    if (!cl->enableLastRectEncoding || w * h < MIN_SPLIT_RECT_SIZE)\n        return SendRectSimple(cl, x, y, w, h);\n\n    /* Make sure we can write at least one pixel into tightBeforeBuf. */\n\n    if (tightBeforeBufSize < 4) {\n        tightBeforeBufSize = 4;\n        if (tightBeforeBuf == NULL)\n            tightBeforeBuf = (char *)xalloc(tightBeforeBufSize);\n        else\n            tightBeforeBuf = (char *)xrealloc(tightBeforeBuf,\n                                              tightBeforeBufSize);\n    }\n\n    /* Calculate maximum number of rows in one non-solid rectangle. */\n\n    {\n        int maxRectSize, maxRectWidth, nMaxWidth;\n\n        maxRectSize = tightConf[compressLevel].maxRectSize;\n        maxRectWidth = tightConf[compressLevel].maxRectWidth;\n        nMaxWidth = (w > maxRectWidth) ? maxRectWidth : w;\n        nMaxRows = maxRectSize / nMaxWidth;\n    }\n\n    /* Try to find large solid-color areas and send them separately. */\n\n    for (dy = y; dy < y + h; dy += MAX_SPLIT_TILE_SIZE) {\n\n        /* If a rectangle becomes too large, send its upper part now. */\n\n        if (dy - y >= nMaxRows) {\n            if (!SendRectSimple(cl, x, y, w, nMaxRows))\n                return 0;\n            y += nMaxRows;\n            h -= nMaxRows;\n        }\n\n        dh = (dy + MAX_SPLIT_TILE_SIZE <= y + h) ?\n            MAX_SPLIT_TILE_SIZE : (y + h - dy);\n\n        for (dx = x; dx < x + w; dx += MAX_SPLIT_TILE_SIZE) {\n\n            dw = (dx + MAX_SPLIT_TILE_SIZE <= x + w) ?\n                MAX_SPLIT_TILE_SIZE : (x + w - dx);\n\n            if (CheckSolidTile(cl, dx, dy, dw, dh, &colorValue, FALSE)) {\n\n                /* Get dimensions of solid-color area. */\n\n                FindBestSolidArea(cl, dx, dy, w - (dx - x), h - (dy - y),\n\t\t\t\t  colorValue, &w_best, &h_best);\n\n                /* Make sure a solid rectangle is large enough\n                   (or the whole rectangle is of the same color). */\n\n                if ( w_best * h_best != w * h &&\n                     w_best * h_best < MIN_SOLID_SUBRECT_SIZE )\n                    continue;\n\n                /* Try to extend solid rectangle to maximum size. */\n\n                x_best = dx; y_best = dy;\n                ExtendSolidArea(cl, x, y, w, h, colorValue,\n                                &x_best, &y_best, &w_best, &h_best);\n\n                /* Send rectangles at top and left to solid-color area. */\n\n                if ( y_best != y &&\n                     !SendRectSimple(cl, x, y, w, y_best-y) )\n                    return FALSE;\n                if ( x_best != x &&\n                     !rfbSendRectEncodingTight(cl, x, y_best,\n                                               x_best-x, h_best) )\n                    return FALSE;\n\n                /* Send solid-color rectangle. */\n\n                if (!SendTightHeader(cl, x_best, y_best, w_best, h_best))\n                    return FALSE;\n\n                fbptr = (cl->scalingFrameBuffer +\n                         (cl->scalingPaddedWidthInBytes * y_best) +\n                         (x_best * (rfbScreen.bitsPerPixel / 8)));\n\n                (*cl->translateFn)(cl->translateLookupTable, &rfbServerFormat,\n                                   &cl->format, fbptr, tightBeforeBuf,\n                                   cl->scalingPaddedWidthInBytes, 1, 1);\n\n                if (!SendSolidRect(cl))\n                    return FALSE;\n\n                /* Send remaining rectangles (at right and bottom). */\n\n                if ( x_best + w_best != x + w &&\n                     !rfbSendRectEncodingTight(cl, x_best+w_best, y_best,\n                                               w-(x_best-x)-w_best, h_best) )\n                    return FALSE;\n                if ( y_best + h_best != y + h &&\n                     !rfbSendRectEncodingTight(cl, x, y_best+h_best,\n                                               w, h-(y_best-y)-h_best) )\n                    return FALSE;\n\n                /* Return after all recursive calls are done. */\n\n                return TRUE;\n            }\n\n        }\n\n    }\n\n    /* No suitable solid-color rectangles found. */\n\n    return SendRectSimple(cl, x, y, w, h);\n}\n\nstatic void\nFindBestSolidArea(rfbClientPtr cl, int x, int y, int w, int h, CARD32 colorValue, int *w_ptr, int *h_ptr)\n{\n    int dx, dy, dw, dh;\n    int w_prev;\n    int w_best = 0, h_best = 0;\n\n    w_prev = w;\n\n    for (dy = y; dy < y + h; dy += MAX_SPLIT_TILE_SIZE) {\n\n        dh = (dy + MAX_SPLIT_TILE_SIZE <= y + h) ?\n            MAX_SPLIT_TILE_SIZE : (y + h - dy);\n        dw = (w_prev > MAX_SPLIT_TILE_SIZE) ?\n            MAX_SPLIT_TILE_SIZE : w_prev;\n\n        if (!CheckSolidTile(cl, x, dy, dw, dh, &colorValue, TRUE))\n            break;\n\n        for (dx = x + dw; dx < x + w_prev;) {\n            dw = (dx + MAX_SPLIT_TILE_SIZE <= x + w_prev) ?\n                MAX_SPLIT_TILE_SIZE : (x + w_prev - dx);\n            if (!CheckSolidTile(cl, dx, dy, dw, dh, &colorValue, TRUE))\n                break;\n\t    dx += dw;\n        }\n\n        w_prev = dx - x;\n        if (w_prev * (dy + dh - y) > w_best * h_best) {\n            w_best = w_prev;\n            h_best = dy + dh - y;\n        }\n    }\n\n    *w_ptr = w_best;\n    *h_ptr = h_best;\n}\n\nstatic void\nExtendSolidArea(rfbClientPtr cl, int x, int y, int w, int h,\n                CARD32 colorValue, int *x_ptr, int *y_ptr, int *w_ptr, int *h_ptr)\n{\n    int cx, cy;\n\n    /* Try to extend the area upwards. */\n    for ( cy = *y_ptr - 1;\n          cy >= y && CheckSolidTile(cl, *x_ptr, cy, *w_ptr, 1, &colorValue, TRUE);\n          cy-- );\n    *h_ptr += *y_ptr - (cy + 1);\n    *y_ptr = cy + 1;\n\n    /* ... downwards. */\n    for ( cy = *y_ptr + *h_ptr;\n          cy < y + h &&\n              CheckSolidTile(cl, *x_ptr, cy, *w_ptr, 1, &colorValue, TRUE);\n          cy++ );\n    *h_ptr += cy - (*y_ptr + *h_ptr);\n\n    /* ... to the left. */\n    for ( cx = *x_ptr - 1;\n          cx >= x && CheckSolidTile(cl, cx, *y_ptr, 1, *h_ptr, &colorValue, TRUE);\n          cx-- );\n    *w_ptr += *x_ptr - (cx + 1);\n    *x_ptr = cx + 1;\n\n    /* ... to the right. */\n    for ( cx = *x_ptr + *w_ptr;\n          cx < x + w &&\n              CheckSolidTile(cl, cx, *y_ptr, 1, *h_ptr, &colorValue, TRUE);\n          cx++ );\n    *w_ptr += cx - (*x_ptr + *w_ptr);\n}\n\nstatic Bool\nCheckSolidTile(rfbClientPtr cl, int x, int y, int w, int h, CARD32 *colorPtr, Bool needSameColor)\n{\n    switch(rfbServerFormat.bitsPerPixel) {\n    case 32:\n        return CheckSolidTile32(cl, x, y, w, h, colorPtr, needSameColor);\n    case 16:\n        return CheckSolidTile16(cl, x, y, w, h, colorPtr, needSameColor);\n    default:\n        return CheckSolidTile8(cl, x, y, w, h, colorPtr, needSameColor);\n    }\n}\n\n#define DEFINE_CHECK_SOLID_FUNCTION(bpp)                                      \\\n                                                                              \\\nstatic Bool                                                                   \\\nCheckSolidTile##bpp(rfbClientPtr cl, int x, int y, int w, int h, CARD32 *colorPtr, Bool needSameColor) \\\n{                                                                             \\\n    CARD##bpp *fbptr;                                                         \\\n    CARD##bpp colorValue;                                                     \\\n    int dx, dy;                                                               \\\n                                                                              \\\n    fbptr = (CARD##bpp *)                                                     \\\n        &cl->scalingFrameBuffer[y * cl->scalingPaddedWidthInBytes + x * (bpp/8)]; \\\n                                                                              \\\n    colorValue = *fbptr;                                                      \\\n    if (needSameColor && (CARD32)colorValue != *colorPtr)                     \\\n        return FALSE;                                                         \\\n                                                                              \\\n    for (dy = 0; dy < h; dy++) {                                              \\\n        for (dx = 0; dx < w; dx++) {                                          \\\n            if (colorValue != fbptr[dx])                                      \\\n                return FALSE;                                                 \\\n        }                                                                     \\\n        fbptr = (CARD##bpp *)((CARD8 *)fbptr + cl->scalingPaddedWidthInBytes); \\\n    }                                                                         \\\n                                                                              \\\n    *colorPtr = (CARD32)colorValue;                                           \\\n    return TRUE;                                                              \\\n}\n\nDEFINE_CHECK_SOLID_FUNCTION(8)\nDEFINE_CHECK_SOLID_FUNCTION(16)\nDEFINE_CHECK_SOLID_FUNCTION(32)\n\nstatic Bool\nSendRectSimple(rfbClientPtr cl, int x, int y, int w, int h)\n{\n    int maxBeforeSize, maxAfterSize;\n    int maxRectSize, maxRectWidth;\n    int subrectMaxWidth, subrectMaxHeight;\n    int dx, dy;\n    int rw, rh;\n\n    maxRectSize = tightConf[compressLevel].maxRectSize;\n    maxRectWidth = tightConf[compressLevel].maxRectWidth;\n\n    maxBeforeSize = maxRectSize * (cl->format.bitsPerPixel / 8);\n    maxAfterSize = maxBeforeSize + (maxBeforeSize + 99) / 100 + 12;\n\n    if (tightBeforeBufSize < maxBeforeSize) {\n        tightBeforeBufSize = maxBeforeSize;\n        if (tightBeforeBuf == NULL)\n            tightBeforeBuf = (char *)xalloc(tightBeforeBufSize);\n        else\n            tightBeforeBuf = (char *)xrealloc(tightBeforeBuf,\n                                              tightBeforeBufSize);\n    }\n\n    if (tightAfterBufSize < maxAfterSize) {\n        tightAfterBufSize = maxAfterSize;\n        if (tightAfterBuf == NULL)\n            tightAfterBuf = (char *)xalloc(tightAfterBufSize);\n        else\n            tightAfterBuf = (char *)xrealloc(tightAfterBuf,\n                                             tightAfterBufSize);\n    }\n\n    if (w > maxRectWidth || w * h > maxRectSize) {\n        subrectMaxWidth = (w > maxRectWidth) ? maxRectWidth : w;\n        subrectMaxHeight = maxRectSize / subrectMaxWidth;\n\n        for (dy = 0; dy < h; dy += subrectMaxHeight) {\n            for (dx = 0; dx < w; dx += maxRectWidth) {\n                rw = (dx + maxRectWidth < w) ? maxRectWidth : w - dx;\n                rh = (dy + subrectMaxHeight < h) ? subrectMaxHeight : h - dy;\n                if (!SendSubrect(cl, x+dx, y+dy, rw, rh))\n                    return FALSE;\n            }\n        }\n    } else {\n        if (!SendSubrect(cl, x, y, w, h))\n            return FALSE;\n    }\n\n    return TRUE;\n}\n\nstatic Bool\nSendSubrect(rfbClientPtr cl, int x, int y, int w, int h)\n{\n    char *fbptr;\n    Bool success = FALSE;\n\n    /* Send pending data if there is more than 128 bytes. */\n    if (cl->ublen > 128) {\n        if (!rfbSendUpdateBuf(cl))\n            return FALSE;\n    }\n\n    if (!SendTightHeader(cl, x, y, w, h))\n        return FALSE;\n\n    fbptr = (cl->scalingFrameBuffer + (cl->scalingPaddedWidthInBytes * y)\n             + (x * (rfbScreen.bitsPerPixel / 8)));\n\n    (*cl->translateFn)(cl->translateLookupTable, &rfbServerFormat,\n                       &cl->format, fbptr, tightBeforeBuf,\n                       cl->scalingPaddedWidthInBytes, w, h);\n\n    paletteMaxColors = w * h / tightConf[compressLevel].idxMaxColorsDivisor;\n    if ( paletteMaxColors < 2 &&\n         w * h >= tightConf[compressLevel].monoMinRectSize ) {\n        paletteMaxColors = 2;\n    }\n    switch (cl->format.bitsPerPixel) {\n    case 8:\n        FillPalette8(w * h);\n        break;\n    case 16:\n        FillPalette16(w * h);\n        break;\n    default:\n        FillPalette32(w * h);\n    }\n\n    switch (paletteNumColors) {\n    case 0:\n        /* Truecolor image */\n        if (DetectSmoothImage(&cl->format, w, h)) {\n            if (qualityLevel != -1) {\n                success = SendJpegRect(cl, x, y, w, h,\n                                       tightConf[qualityLevel].jpegQuality);\n            } else {\n                success = SendGradientRect(cl, w, h);\n            }\n        } else {\n            success = SendFullColorRect(cl, w, h);\n        }\n        break;\n    case 1:\n        /* Solid rectangle */\n        success = SendSolidRect(cl);\n        break;\n    case 2:\n        /* Two-color rectangle */\n        success = SendMonoRect(cl, w, h);\n        break;\n    default:\n        /* Up to 256 different colors */\n        if ( paletteNumColors > 96 &&\n             qualityLevel != -1 && qualityLevel <= 3 &&\n             DetectSmoothImage(&cl->format, w, h) ) {\n            success = SendJpegRect(cl, x, y, w, h,\n                                   tightConf[qualityLevel].jpegQuality);\n        } else {\n            success = SendIndexedRect(cl, w, h);\n        }\n    }\n    return success;\n}\n\nstatic Bool\nSendTightHeader(rfbClientPtr cl, int x, int y, int w, int h)\n{\n    rfbFramebufferUpdateRectHeader rect;\n\n    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader > UPDATE_BUF_SIZE) {\n        if (!rfbSendUpdateBuf(cl))\n            return FALSE;\n    }\n\n    rect.r.x = Swap16IfLE(x);\n    rect.r.y = Swap16IfLE(y);\n    rect.r.w = Swap16IfLE(w);\n    rect.r.h = Swap16IfLE(h);\n    rect.encoding = Swap32IfLE(rfbEncodingTight);\n\n    memcpy(&cl->updateBuf[cl->ublen], &rect, sz_rfbFramebufferUpdateRectHeader);\n    cl->ublen += sz_rfbFramebufferUpdateRectHeader;\n\n    cl->rfbRectanglesSent[rfbEncodingTight]++;\n    cl->rfbBytesSent[rfbEncodingTight] += sz_rfbFramebufferUpdateRectHeader;\n\n    return TRUE;\n}\n\n/*\n * Subencoding implementations.\n */\n\nstatic Bool\nSendSolidRect(rfbClientPtr cl)\n{\n    int len;\n\n    if (usePixelFormat24) {\n        Pack24(tightBeforeBuf, &cl->format, 1);\n        len = 3;\n    } else\n        len = cl->format.bitsPerPixel / 8;\n\n    if (cl->ublen + 1 + len > UPDATE_BUF_SIZE) {\n        if (!rfbSendUpdateBuf(cl))\n            return FALSE;\n    }\n\n    cl->updateBuf[cl->ublen++] = (char)(rfbTightFill << 4);\n    memcpy (&cl->updateBuf[cl->ublen], tightBeforeBuf, len);\n    cl->ublen += len;\n\n    cl->rfbBytesSent[rfbEncodingTight] += len + 1;\n\n    return TRUE;\n}\n\nstatic Bool\nSendMonoRect(rfbClientPtr cl, int w, int h)\n{\n    int streamId = 1;\n    int paletteLen, dataLen;\n\n    if ( (cl->ublen + TIGHT_MIN_TO_COMPRESS + 6 +\n          2 * cl->format.bitsPerPixel / 8) > UPDATE_BUF_SIZE ) {\n        if (!rfbSendUpdateBuf(cl))\n            return FALSE;\n    }\n\n    /* Prepare tight encoding header. */\n    dataLen = (w + 7) / 8;\n    dataLen *= h;\n\n    cl->updateBuf[cl->ublen++] = (streamId | rfbTightExplicitFilter) << 4;\n    cl->updateBuf[cl->ublen++] = rfbTightFilterPalette;\n    cl->updateBuf[cl->ublen++] = 1;\n\n    /* Prepare palette, convert image. */\n    switch (cl->format.bitsPerPixel) {\n\n    case 32:\n        EncodeMonoRect32((CARD8 *)tightBeforeBuf, w, h);\n\n        ((CARD32 *)tightAfterBuf)[0] = monoBackground;\n        ((CARD32 *)tightAfterBuf)[1] = monoForeground;\n        if (usePixelFormat24) {\n            Pack24(tightAfterBuf, &cl->format, 2);\n            paletteLen = 6;\n        } else\n            paletteLen = 8;\n\n        memcpy(&cl->updateBuf[cl->ublen], tightAfterBuf, paletteLen);\n        cl->ublen += paletteLen;\n        cl->rfbBytesSent[rfbEncodingTight] += 3 + paletteLen;\n        break;\n\n    case 16:\n        EncodeMonoRect16((CARD8 *)tightBeforeBuf, w, h);\n\n        ((CARD16 *)tightAfterBuf)[0] = (CARD16)monoBackground;\n        ((CARD16 *)tightAfterBuf)[1] = (CARD16)monoForeground;\n\n        memcpy(&cl->updateBuf[cl->ublen], tightAfterBuf, 4);\n        cl->ublen += 4;\n        cl->rfbBytesSent[rfbEncodingTight] += 7;\n        break;\n\n    default:\n        EncodeMonoRect8((CARD8 *)tightBeforeBuf, w, h);\n\n        cl->updateBuf[cl->ublen++] = (char)monoBackground;\n        cl->updateBuf[cl->ublen++] = (char)monoForeground;\n        cl->rfbBytesSent[rfbEncodingTight] += 5;\n    }\n\n    return CompressData(cl, streamId, dataLen,\n                        tightConf[compressLevel].monoZlibLevel,\n                        Z_DEFAULT_STRATEGY);\n}\n\nstatic Bool\nSendIndexedRect(rfbClientPtr cl, int w, int h)\n{\n    int streamId = 2;\n    int i, entryLen;\n\n    if ( (cl->ublen + TIGHT_MIN_TO_COMPRESS + 6 +\n          paletteNumColors * cl->format.bitsPerPixel / 8) > UPDATE_BUF_SIZE ) {\n        if (!rfbSendUpdateBuf(cl))\n            return FALSE;\n    }\n\n    /* Prepare tight encoding header. */\n    cl->updateBuf[cl->ublen++] = (streamId | rfbTightExplicitFilter) << 4;\n    cl->updateBuf[cl->ublen++] = rfbTightFilterPalette;\n    cl->updateBuf[cl->ublen++] = (char)(paletteNumColors - 1);\n\n    /* Prepare palette, convert image. */\n    switch (cl->format.bitsPerPixel) {\n\n    case 32:\n        EncodeIndexedRect32((CARD8 *)tightBeforeBuf, w * h);\n\n        for (i = 0; i < paletteNumColors; i++) {\n            ((CARD32 *)tightAfterBuf)[i] =\n                palette.entry[i].listNode->rgb;\n        }\n        if (usePixelFormat24) {\n            Pack24(tightAfterBuf, &cl->format, paletteNumColors);\n            entryLen = 3;\n        } else\n            entryLen = 4;\n\n        memcpy(&cl->updateBuf[cl->ublen], tightAfterBuf, paletteNumColors * entryLen);\n        cl->ublen += paletteNumColors * entryLen;\n        cl->rfbBytesSent[rfbEncodingTight] += 3 + paletteNumColors * entryLen;\n        break;\n\n    case 16:\n        EncodeIndexedRect16((CARD8 *)tightBeforeBuf, w * h);\n\n        for (i = 0; i < paletteNumColors; i++) {\n            ((CARD16 *)tightAfterBuf)[i] =\n                (CARD16)palette.entry[i].listNode->rgb;\n        }\n\n        memcpy(&cl->updateBuf[cl->ublen], tightAfterBuf, paletteNumColors * 2);\n        cl->ublen += paletteNumColors * 2;\n        cl->rfbBytesSent[rfbEncodingTight] += 3 + paletteNumColors * 2;\n        break;\n\n    default:\n        return FALSE;           /* Should never happen. */\n    }\n\n    return CompressData(cl, streamId, w * h,\n                        tightConf[compressLevel].idxZlibLevel,\n                        Z_DEFAULT_STRATEGY);\n}\n\nstatic Bool\nSendFullColorRect(rfbClientPtr cl, int w, int h)\n{\n    int streamId = 0;\n    int len;\n\n    if (cl->ublen + TIGHT_MIN_TO_COMPRESS + 1 > UPDATE_BUF_SIZE) {\n        if (!rfbSendUpdateBuf(cl))\n            return FALSE;\n    }\n\n    cl->updateBuf[cl->ublen++] = 0x00;  /* stream id = 0, no flushing, no filter */\n    cl->rfbBytesSent[rfbEncodingTight]++;\n\n    if (usePixelFormat24) {\n        Pack24(tightBeforeBuf, &cl->format, w * h);\n        len = 3;\n    } else\n        len = cl->format.bitsPerPixel / 8;\n\n    return CompressData(cl, streamId, w * h * len,\n                        tightConf[compressLevel].rawZlibLevel,\n                        Z_DEFAULT_STRATEGY);\n}\n\nstatic Bool\nSendGradientRect(rfbClientPtr cl, int w, int h)\n{\n    int streamId = 3;\n    int len;\n\n    if (cl->format.bitsPerPixel == 8)\n        return SendFullColorRect(cl, w, h);\n\n    if (cl->ublen + TIGHT_MIN_TO_COMPRESS + 2 > UPDATE_BUF_SIZE) {\n        if (!rfbSendUpdateBuf(cl))\n            return FALSE;\n    }\n\n    if (prevRowBuf == NULL)\n        prevRowBuf = (int *)xalloc(2048 * 3 * sizeof(int));\n\n    cl->updateBuf[cl->ublen++] = (streamId | rfbTightExplicitFilter) << 4;\n    cl->updateBuf[cl->ublen++] = rfbTightFilterGradient;\n    cl->rfbBytesSent[rfbEncodingTight] += 2;\n\n    if (usePixelFormat24) {\n        FilterGradient24(tightBeforeBuf, &cl->format, w, h);\n        len = 3;\n    } else if (cl->format.bitsPerPixel == 32) {\n        FilterGradient32((CARD32 *)tightBeforeBuf, &cl->format, w, h);\n        len = 4;\n    } else {\n        FilterGradient16((CARD16 *)tightBeforeBuf, &cl->format, w, h);\n        len = 2;\n    }\n\n    return CompressData(cl, streamId, w * h * len,\n                        tightConf[compressLevel].gradientZlibLevel,\n                        Z_FILTERED);\n}\n\nstatic Bool\nCompressData(rfbClientPtr cl, int streamId, int dataLen, int zlibLevel, int zlibStrategy)\n{\n    z_streamp pz;\n    int err;\n\n    if (dataLen < TIGHT_MIN_TO_COMPRESS) {\n        memcpy(&cl->updateBuf[cl->ublen], tightBeforeBuf, dataLen);\n        cl->ublen += dataLen;\n        cl->rfbBytesSent[rfbEncodingTight] += dataLen;\n        return TRUE;\n    }\n\n    pz = &cl->zsStruct[streamId];\n\n    /* Initialize compression stream if needed. */\n    if (!cl->zsActive[streamId]) {\n        pz->zalloc = Z_NULL;\n        pz->zfree = Z_NULL;\n        pz->opaque = Z_NULL;\n\n        err = deflateInit2 (pz, zlibLevel, Z_DEFLATED, MAX_WBITS,\n                            MAX_MEM_LEVEL, zlibStrategy);\n        if (err != Z_OK)\n            return FALSE;\n\n        cl->zsActive[streamId] = TRUE;\n        cl->zsLevel[streamId] = zlibLevel;\n    }\n\n    /* Prepare buffer pointers. */\n    pz->next_in = (Bytef *)tightBeforeBuf;\n    pz->avail_in = dataLen;\n    pz->next_out = (Bytef *)tightAfterBuf;\n    pz->avail_out = tightAfterBufSize;\n\n    /* Change compression parameters if needed. */\n    if (zlibLevel != cl->zsLevel[streamId]) {\n        if (deflateParams (pz, zlibLevel, zlibStrategy) != Z_OK) {\n            return FALSE;\n        }\n        cl->zsLevel[streamId] = zlibLevel;\n    }\n\n    /* Actual compression. */\n    if ( deflate (pz, Z_SYNC_FLUSH) != Z_OK ||\n         pz->avail_in != 0 || pz->avail_out == 0 ) {\n        return FALSE;\n    }\n\n    return SendCompressedData(cl, tightAfterBufSize - pz->avail_out);\n}\n\nstatic Bool SendCompressedData(rfbClientPtr cl, int compressedLen)\n{\n    int i, portionLen;\n\n    cl->updateBuf[cl->ublen++] = compressedLen & 0x7F;\n    cl->rfbBytesSent[rfbEncodingTight]++;\n    if (compressedLen > 0x7F) {\n        cl->updateBuf[cl->ublen-1] |= 0x80;\n        cl->updateBuf[cl->ublen++] = compressedLen >> 7 & 0x7F;\n        cl->rfbBytesSent[rfbEncodingTight]++;\n        if (compressedLen > 0x3FFF) {\n            cl->updateBuf[cl->ublen-1] |= 0x80;\n            cl->updateBuf[cl->ublen++] = compressedLen >> 14 & 0xFF;\n            cl->rfbBytesSent[rfbEncodingTight]++;\n        }\n    }\n\n    portionLen = UPDATE_BUF_SIZE;\n    for (i = 0; i < compressedLen; i += portionLen) {\n        if (i + portionLen > compressedLen) {\n            portionLen = compressedLen - i;\n        }\n        if (cl->ublen + portionLen > UPDATE_BUF_SIZE) {\n            if (!rfbSendUpdateBuf(cl))\n                return FALSE;\n        }\n        memcpy(&cl->updateBuf[cl->ublen], &tightAfterBuf[i], portionLen);\n        cl->ublen += portionLen;\n    }\n    cl->rfbBytesSent[rfbEncodingTight] += compressedLen;\n    return TRUE;\n}\n\n/*\n * Code to determine how many different colors used in rectangle.\n */\n\n#undef FillPalette8\nstatic void\nFillPalette8(rfbClientPtr cl, int count)\n{\n    CARD8 *data = (CARD8 *)tightBeforeBuf;\n    CARD8 c0, c1;\n    int i, n0, n1;\n\n    paletteNumColors = 0;\n\n    c0 = data[0];\n    for (i = 1; i < count && data[i] == c0; i++);\n    if (i == count) {\n        paletteNumColors = 1;\n        return;                 /* Solid rectangle */\n    }\n\n    if (paletteMaxColors < 2)\n        return;\n\n    n0 = i;\n    c1 = data[i];\n    n1 = 0;\n    for (i++; i < count; i++) {\n        if (data[i] == c0) {\n            n0++;\n        } else if (data[i] == c1) {\n            n1++;\n        } else\n            break;\n    }\n    if (i == count) {\n        if (n0 > n1) {\n            monoBackground = (CARD32)c0;\n            monoForeground = (CARD32)c1;\n        } else {\n            monoBackground = (CARD32)c1;\n            monoForeground = (CARD32)c0;\n        }\n        paletteNumColors = 2;   /* Two colors */\n    }\n}\n#define FillPalette8(x)              FillPalette8(cl, x)\n\n#undef FillPalette16\n#undef FillPalette32\n#define DEFINE_FILL_PALETTE_FUNCTION(bpp)                               \\\n                                                                        \\\nstatic void                                                             \\\nFillPalette##bpp(rfbClientPtr cl, int count)                            \\\n{                                                                       \\\n    CARD##bpp *data = (CARD##bpp *)tightBeforeBuf;                      \\\n    CARD##bpp c0, c1, ci = 0;                                           \\\n    int i, n0, n1, ni;                                                  \\\n                                                                        \\\n    c0 = data[0];                                                       \\\n    for (i = 1; i < count && data[i] == c0; i++);                       \\\n    if (i >= count) {                                                   \\\n        paletteNumColors = 1;   /* Solid rectangle */                   \\\n        return;                                                         \\\n    }                                                                   \\\n                                                                        \\\n    if (paletteMaxColors < 2) {                                         \\\n        paletteNumColors = 0;   /* Full-color encoding preferred */     \\\n        return;                                                         \\\n    }                                                                   \\\n                                                                        \\\n    n0 = i;                                                             \\\n    c1 = data[i];                                                       \\\n    n1 = 0;                                                             \\\n    for (i++; i < count; i++) {                                         \\\n        ci = data[i];                                                   \\\n        if (ci == c0) {                                                 \\\n            n0++;                                                       \\\n        } else if (ci == c1) {                                          \\\n            n1++;                                                       \\\n        } else                                                          \\\n            break;                                                      \\\n    }                                                                   \\\n    if (i >= count) {                                                   \\\n        if (n0 > n1) {                                                  \\\n            monoBackground = (CARD32)c0;                                \\\n            monoForeground = (CARD32)c1;                                \\\n        } else {                                                        \\\n            monoBackground = (CARD32)c1;                                \\\n            monoForeground = (CARD32)c0;                                \\\n        }                                                               \\\n        paletteNumColors = 2;   /* Two colors */                        \\\n        return;                                                         \\\n    }                                                                   \\\n                                                                        \\\n    PaletteReset();                                                     \\\n    PaletteInsert (c0, (CARD32)n0, bpp);                                \\\n    PaletteInsert (c1, (CARD32)n1, bpp);                                \\\n                                                                        \\\n    ni = 1;                                                             \\\n    for (i++; i < count; i++) {                                         \\\n        if (data[i] == ci) {                                            \\\n            ni++;                                                       \\\n        } else {                                                        \\\n            if (!PaletteInsert (ci, (CARD32)ni, bpp))                   \\\n                return;                                                 \\\n            ci = data[i];                                               \\\n            ni = 1;                                                     \\\n        }                                                               \\\n    }                                                                   \\\n    PaletteInsert (ci, (CARD32)ni, bpp);                                \\\n}\n\nDEFINE_FILL_PALETTE_FUNCTION(16)\nDEFINE_FILL_PALETTE_FUNCTION(32)\n#define FillPalette16(x)             FillPalette16(cl, x)\n#define FillPalette32(x)             FillPalette32(cl, x)\n\n\n/*\n * Functions to operate with palette structures.\n */\n\n#define HASH_FUNC16(rgb) ((int)((((rgb) >> 8) + (rgb)) & 0xFF))\n#define HASH_FUNC32(rgb) ((int)((((rgb) >> 16) + ((rgb) >> 8)) & 0xFF))\n\n#undef PaletteReset\nstatic void\nPaletteReset(rfbClientPtr cl)\n{\n    paletteNumColors = 0;\n    memset(palette.hash, 0, 256 * sizeof(COLOR_LIST *));\n}\n#define PaletteReset()               PaletteReset(cl)\n\n#undef PaletteInsert\nstatic int\nPaletteInsert(rfbClientPtr cl, CARD32 rgb, int numPixels, int bpp)\n{\n    COLOR_LIST *pnode;\n    COLOR_LIST *prev_pnode = NULL;\n    int hash_key, idx, new_idx, count;\n\n    hash_key = (bpp == 16) ? HASH_FUNC16(rgb) : HASH_FUNC32(rgb);\n\n    pnode = palette.hash[hash_key];\n\n    while (pnode != NULL) {\n        if (pnode->rgb == rgb) {\n            /* Such palette entry already exists. */\n            new_idx = idx = pnode->idx;\n            count = palette.entry[idx].numPixels + numPixels;\n            if (new_idx && palette.entry[new_idx-1].numPixels < count) {\n                do {\n                    palette.entry[new_idx] = palette.entry[new_idx-1];\n                    palette.entry[new_idx].listNode->idx = new_idx;\n                    new_idx--;\n                }\n                while (new_idx && palette.entry[new_idx-1].numPixels < count);\n                palette.entry[new_idx].listNode = pnode;\n                pnode->idx = new_idx;\n            }\n            palette.entry[new_idx].numPixels = count;\n            return paletteNumColors;\n        }\n        prev_pnode = pnode;\n        pnode = pnode->next;\n    }\n\n    /* Check if palette is full. */\n    if (paletteNumColors == 256 || paletteNumColors == paletteMaxColors) {\n        paletteNumColors = 0;\n        return 0;\n    }\n\n    /* Move palette entries with lesser pixel counts. */\n    for ( idx = paletteNumColors;\n          idx > 0 && palette.entry[idx-1].numPixels < numPixels;\n          idx-- ) {\n        palette.entry[idx] = palette.entry[idx-1];\n        palette.entry[idx].listNode->idx = idx;\n    }\n\n    /* Add new palette entry into the freed slot. */\n    pnode = &palette.list[paletteNumColors];\n    if (prev_pnode != NULL) {\n        prev_pnode->next = pnode;\n    } else {\n        palette.hash[hash_key] = pnode;\n    }\n    pnode->next = NULL;\n    pnode->idx = idx;\n    pnode->rgb = rgb;\n    palette.entry[idx].listNode = pnode;\n    palette.entry[idx].numPixels = numPixels;\n\n    return (++paletteNumColors);\n}\n#define PaletteInsert(x, y, z)       PaletteInsert(cl, x, y, z)\n\n\n/*\n * Converting 32-bit color samples into 24-bit colors.\n * Should be called only when redMax, greenMax and blueMax are 255.\n * Color components assumed to be byte-aligned.\n */\n\nstatic void Pack24(char *buf, rfbPixelFormat *fmt, int count)\n{\n    CARD32 *buf32;\n    CARD32 pix;\n    int r_shift, g_shift, b_shift;\n\n    buf32 = (CARD32 *)buf;\n\n    if (!rfbServerFormat.bigEndian == !fmt->bigEndian) {\n        r_shift = fmt->redShift;\n        g_shift = fmt->greenShift;\n        b_shift = fmt->blueShift;\n    } else {\n        r_shift = 24 - fmt->redShift;\n        g_shift = 24 - fmt->greenShift;\n        b_shift = 24 - fmt->blueShift;\n    }\n\n    while (count--) {\n        pix = *buf32++;\n        *buf++ = (char)(pix >> r_shift);\n        *buf++ = (char)(pix >> g_shift);\n        *buf++ = (char)(pix >> b_shift);\n    }\n}\n\n\n/*\n * Converting truecolor samples into palette indices.\n */\n\n#undef EncodeIndexedRect16\n#undef EncodeIndexedRect32\n#define DEFINE_IDX_ENCODE_FUNCTION(bpp)                                 \\\n                                                                        \\\nstatic void                                                             \\\nEncodeIndexedRect##bpp(rfbClientPtr cl, CARD8 *buf, int count)          \\\n{                                                                       \\\n    COLOR_LIST *pnode;                                                  \\\n    CARD##bpp *src;                                                     \\\n    CARD##bpp rgb;                                                      \\\n    int rep = 0;                                                        \\\n                                                                        \\\n    src = (CARD##bpp *) buf;                                            \\\n                                                                        \\\n    while (count--) {                                                   \\\n        rgb = *src++;                                                   \\\n        while (count && *src == rgb) {                                  \\\n            rep++, src++, count--;                                      \\\n        }                                                               \\\n        pnode = palette.hash[HASH_FUNC##bpp(rgb)];                      \\\n        while (pnode != NULL) {                                         \\\n            if ((CARD##bpp)pnode->rgb == rgb) {                         \\\n                *buf++ = (CARD8)pnode->idx;                             \\\n                while (rep) {                                           \\\n                    *buf++ = (CARD8)pnode->idx;                         \\\n                    rep--;                                              \\\n                }                                                       \\\n                break;                                                  \\\n            }                                                           \\\n            pnode = pnode->next;                                        \\\n        }                                                               \\\n    }                                                                   \\\n}\n\nDEFINE_IDX_ENCODE_FUNCTION(16)\nDEFINE_IDX_ENCODE_FUNCTION(32)\n#define EncodeIndexedRect16(x, y)    EncodeIndexedRect16(cl, x, y)\n#define EncodeIndexedRect32(x, y)    EncodeIndexedRect32(cl, x, y)\n\n#undef EncodeMonoRect8\n#undef EncodeMonoRect16\n#undef EncodeMonoRect32\n#define DEFINE_MONO_ENCODE_FUNCTION(bpp)                                \\\n                                                                        \\\nstatic void                                                             \\\nEncodeMonoRect##bpp(rfbClientPtr cl, CARD8 *buf, int w, int h)          \\\n{                                                                       \\\n    CARD##bpp *ptr;                                                     \\\n    CARD##bpp bg;                                                       \\\n    unsigned int value, mask;                                           \\\n    int aligned_width;                                                  \\\n    int x, y, bg_bits;                                                  \\\n                                                                        \\\n    ptr = (CARD##bpp *) buf;                                            \\\n    bg = (CARD##bpp) monoBackground;                                    \\\n    aligned_width = w - w % 8;                                          \\\n                                                                        \\\n    for (y = 0; y < h; y++) {                                           \\\n        for (x = 0; x < aligned_width; x += 8) {                        \\\n            for (bg_bits = 0; bg_bits < 8; bg_bits++) {                 \\\n                if (*ptr++ != bg)                                       \\\n                    break;                                              \\\n            }                                                           \\\n            if (bg_bits == 8) {                                         \\\n                *buf++ = 0;                                             \\\n                continue;                                               \\\n            }                                                           \\\n            mask = 0x80 >> bg_bits;                                     \\\n            value = mask;                                               \\\n            for (bg_bits++; bg_bits < 8; bg_bits++) {                   \\\n                mask >>= 1;                                             \\\n                if (*ptr++ != bg) {                                     \\\n                    value |= mask;                                      \\\n                }                                                       \\\n            }                                                           \\\n            *buf++ = (CARD8)value;                                      \\\n        }                                                               \\\n                                                                        \\\n        mask = 0x80;                                                    \\\n        value = 0;                                                      \\\n        if (x >= w)                                                     \\\n            continue;                                                   \\\n                                                                        \\\n        for (; x < w; x++) {                                            \\\n            if (*ptr++ != bg) {                                         \\\n                value |= mask;                                          \\\n            }                                                           \\\n            mask >>= 1;                                                 \\\n        }                                                               \\\n        *buf++ = (CARD8)value;                                          \\\n    }                                                                   \\\n}\n\nDEFINE_MONO_ENCODE_FUNCTION(8)\nDEFINE_MONO_ENCODE_FUNCTION(16)\nDEFINE_MONO_ENCODE_FUNCTION(32)\n#define EncodeMonoRect8(x, y, z)     EncodeMonoRect8(cl, x, y, z)\n#define EncodeMonoRect16(x, y, z)    EncodeMonoRect16(cl, x, y, z)\n#define EncodeMonoRect32(x, y, z)    EncodeMonoRect32(cl, x, y, z)\n\n\n/*\n * ``Gradient'' filter for 24-bit color samples.\n * Should be called only when redMax, greenMax and blueMax are 255.\n * Color components assumed to be byte-aligned.\n */\n\n#undef FilterGradient24\nstatic void\nFilterGradient24(rfbClientPtr cl, char *buf, rfbPixelFormat *fmt, int w, int h)\n{\n    CARD32 *buf32;\n    CARD32 pix32;\n    int *prevRowPtr;\n    int shiftBits[3];\n    int pixHere[3], pixUpper[3], pixLeft[3], pixUpperLeft[3];\n    int prediction;\n    int x, y, c;\n\n    buf32 = (CARD32 *)buf;\n    memset (prevRowBuf, 0, w * 3 * sizeof(int));\n\n    if (!rfbServerFormat.bigEndian == !fmt->bigEndian) {\n        shiftBits[0] = fmt->redShift;\n        shiftBits[1] = fmt->greenShift;\n        shiftBits[2] = fmt->blueShift;\n    } else {\n        shiftBits[0] = 24 - fmt->redShift;\n        shiftBits[1] = 24 - fmt->greenShift;\n        shiftBits[2] = 24 - fmt->blueShift;\n    }\n\n    for (y = 0; y < h; y++) {\n        for (c = 0; c < 3; c++) {\n            pixUpper[c] = 0;\n            pixHere[c] = 0;\n        }\n        prevRowPtr = prevRowBuf;\n        for (x = 0; x < w; x++) {\n            pix32 = *buf32++;\n            for (c = 0; c < 3; c++) {\n                pixUpperLeft[c] = pixUpper[c];\n                pixLeft[c] = pixHere[c];\n                pixUpper[c] = *prevRowPtr;\n                pixHere[c] = (int)(pix32 >> shiftBits[c] & 0xFF);\n                *prevRowPtr++ = pixHere[c];\n\n                prediction = pixLeft[c] + pixUpper[c] - pixUpperLeft[c];\n                if (prediction < 0) {\n                    prediction = 0;\n                } else if (prediction > 0xFF) {\n                    prediction = 0xFF;\n                }\n                *buf++ = (char)(pixHere[c] - prediction);\n            }\n        }\n    }\n}\n#define FilterGradient24(w, x, y, z) FilterGradient24(cl, w, x, y, z)\n\n\n/*\n * ``Gradient'' filter for other color depths.\n */\n\n#undef FilterGradient16\n#undef FilterGradient32\n#define DEFINE_GRADIENT_FILTER_FUNCTION(bpp)                             \\\n                                                                         \\\nstatic void                                                              \\\nFilterGradient##bpp(rfbClientPtr cl, CARD##bpp *buf, rfbPixelFormat *fmt, int w, int h) \\\n{                                                                        \\\n    CARD##bpp pix, diff;                                                 \\\n    Bool endianMismatch;                                                 \\\n    int *prevRowPtr;                                                     \\\n    int maxColor[3], shiftBits[3];                                       \\\n    int pixHere[3], pixUpper[3], pixLeft[3], pixUpperLeft[3];            \\\n    int prediction;                                                      \\\n    int x, y, c;                                                         \\\n                                                                         \\\n    memset (prevRowBuf, 0, w * 3 * sizeof(int));                         \\\n                                                                         \\\n    endianMismatch = (!rfbServerFormat.bigEndian != !fmt->bigEndian);    \\\n                                                                         \\\n    maxColor[0] = fmt->redMax;                                           \\\n    maxColor[1] = fmt->greenMax;                                         \\\n    maxColor[2] = fmt->blueMax;                                          \\\n    shiftBits[0] = fmt->redShift;                                        \\\n    shiftBits[1] = fmt->greenShift;                                      \\\n    shiftBits[2] = fmt->blueShift;                                       \\\n                                                                         \\\n    for (y = 0; y < h; y++) {                                            \\\n        for (c = 0; c < 3; c++) {                                        \\\n            pixUpper[c] = 0;                                             \\\n            pixHere[c] = 0;                                              \\\n        }                                                                \\\n        prevRowPtr = prevRowBuf;                                         \\\n        for (x = 0; x < w; x++) {                                        \\\n            pix = *buf;                                                  \\\n            if (endianMismatch) {                                        \\\n                pix = Swap##bpp(pix);                                    \\\n            }                                                            \\\n            diff = 0;                                                    \\\n            for (c = 0; c < 3; c++) {                                    \\\n                pixUpperLeft[c] = pixUpper[c];                           \\\n                pixLeft[c] = pixHere[c];                                 \\\n                pixUpper[c] = *prevRowPtr;                               \\\n                pixHere[c] = (int)(pix >> shiftBits[c] & maxColor[c]);   \\\n                *prevRowPtr++ = pixHere[c];                              \\\n                                                                         \\\n                prediction = pixLeft[c] + pixUpper[c] - pixUpperLeft[c]; \\\n                if (prediction < 0) {                                    \\\n                    prediction = 0;                                      \\\n                } else if (prediction > maxColor[c]) {                   \\\n                    prediction = maxColor[c];                            \\\n                }                                                        \\\n                diff |= ((pixHere[c] - prediction) & maxColor[c])        \\\n                    << shiftBits[c];                                     \\\n            }                                                            \\\n            if (endianMismatch) {                                        \\\n                diff = Swap##bpp(diff);                                  \\\n            }                                                            \\\n            *buf++ = diff;                                               \\\n        }                                                                \\\n    }                                                                    \\\n}\n\nDEFINE_GRADIENT_FILTER_FUNCTION(16)\nDEFINE_GRADIENT_FILTER_FUNCTION(32)\n#define FilterGradient16(w, x, y, z) FilterGradient16(cl, w, x, y, z)\n#define FilterGradient32(w, x, y, z) FilterGradient32(cl, w, x, y, z)\n\n\n/*\n * Code to guess if given rectangle is suitable for smooth image\n * compression (by applying \"gradient\" filter or JPEG coder).\n */\n\n#define JPEG_MIN_RECT_SIZE  4096\n\n#define DETECT_SUBROW_WIDTH    7\n#define DETECT_MIN_WIDTH       8\n#define DETECT_MIN_HEIGHT      8\n\n#undef DetectSmoothImage\nstatic int\nDetectSmoothImage (rfbClientPtr cl, rfbPixelFormat *fmt, int w, int h)\n{\n    unsigned long avgError;\n\n    if ( rfbServerFormat.bitsPerPixel == 8 || fmt->bitsPerPixel == 8 ||\n         w < DETECT_MIN_WIDTH || h < DETECT_MIN_HEIGHT ) {\n        return 0;\n    }\n\n    if (qualityLevel != -1) {\n        if (w * h < JPEG_MIN_RECT_SIZE) {\n            return 0;\n        }\n    } else {\n        if ( rfbTightDisableGradient ||\n             w * h < tightConf[compressLevel].gradientMinRectSize ) {\n            return 0;\n        }\n    }\n\n    if (fmt->bitsPerPixel == 32) {\n        if (usePixelFormat24) {\n            avgError = DetectSmoothImage24(fmt, w, h);\n            if (qualityLevel != -1) {\n                return (avgError < tightConf[qualityLevel].jpegThreshold24);\n            }\n            return (avgError < tightConf[compressLevel].gradientThreshold24);\n        } else {\n            avgError = DetectSmoothImage32(fmt, w, h);\n        }\n    } else {\n        avgError = DetectSmoothImage16(fmt, w, h);\n    }\n    if (qualityLevel != -1) {\n        return (avgError < tightConf[qualityLevel].jpegThreshold);\n    }\n    return (avgError < tightConf[compressLevel].gradientThreshold);\n}\n#define DetectSmoothImage(x, y, z)   DetectSmoothImage(cl, x, y, z)\n\n#undef DetectSmoothImage24\nstatic unsigned long\nDetectSmoothImage24 (rfbClientPtr cl, rfbPixelFormat *fmt, int w, int h)\n{\n    int off;\n    int d, dx, c;\n    int diffStat[256];\n    int pixelCount = 0;\n    int pix, left[3];\n    unsigned long avgError;\n\n    /* If client is big-endian, color samples begin from the second\n       byte (offset 1) of a 32-bit pixel value. */\n    off = (fmt->bigEndian != 0);\n\n    memset(diffStat, 0, 256*sizeof(int));\n\n    int x = 0;\n    int y = 0;\n    while (y < h && x < w) {\n        for (d = 0; d < h - y && d < w - x - DETECT_SUBROW_WIDTH; d++) {\n            for (c = 0; c < 3; c++) {\n                left[c] = (int)tightBeforeBuf[((y+d)*w+x+d)*4+off+c] & 0xFF;\n            }\n            for (dx = 1; dx <= DETECT_SUBROW_WIDTH; dx++) {\n                for (c = 0; c < 3; c++) {\n                    pix = (int)tightBeforeBuf[((y+d)*w+x+d+dx)*4+off+c] & 0xFF;\n                    diffStat[abs(pix - left[c])]++;\n                    left[c] = pix;\n                }\n                pixelCount++;\n            }\n        }\n        if (w > h) {\n            x += h;\n            y = 0;\n        } else {\n            x = 0;\n            y += w;\n        }\n    }\n\n    if (pixelCount == 0 || diffStat[0] * 33 / pixelCount >= 95)\n        return 0;\n\n    avgError = 0;\n    for (c = 1; c < 8; c++) {\n        avgError += (unsigned long)diffStat[c] * (unsigned long)(c * c);\n        if (diffStat[c] == 0 || diffStat[c] > diffStat[c-1] * 2)\n            return 0;\n    }\n    for (; c < 256; c++) {\n        avgError += (unsigned long)diffStat[c] * (unsigned long)(c * c);\n    }\n    avgError /= (pixelCount * 3 - diffStat[0]);\n\n    return avgError;\n}\n#define DetectSmoothImage24(x, y, z) DetectSmoothImage24(cl, x, y, z)\n\n#undef DetectSmoothImage16\n#undef DetectSmoothImage32\n#define DEFINE_DETECT_FUNCTION(bpp)                                          \\\n                                                                             \\\nstatic unsigned long                                                         \\\nDetectSmoothImage##bpp (rfbClientPtr cl, rfbPixelFormat *fmt, int w, int h)  \\\n{                                                                            \\\n    Bool endianMismatch;                                                     \\\n    CARD##bpp pix;                                                           \\\n    int maxColor[3], shiftBits[3];                                           \\\n    int x, y, d, dx, c;                                                      \\\n    int diffStat[256];                                                       \\\n    int pixelCount = 0;                                                      \\\n    int sample, sum, left[3];                                                \\\n    unsigned long avgError;                                                  \\\n                                                                             \\\n    endianMismatch = (!rfbServerFormat.bigEndian != !fmt->bigEndian);        \\\n                                                                             \\\n    maxColor[0] = fmt->redMax;                                               \\\n    maxColor[1] = fmt->greenMax;                                             \\\n    maxColor[2] = fmt->blueMax;                                              \\\n    shiftBits[0] = fmt->redShift;                                            \\\n    shiftBits[1] = fmt->greenShift;                                          \\\n    shiftBits[2] = fmt->blueShift;                                           \\\n                                                                             \\\n    memset(diffStat, 0, 256*sizeof(int));                                    \\\n                                                                             \\\n    y = 0, x = 0;                                                            \\\n    while (y < h && x < w) {                                                 \\\n        for (d = 0; d < h - y && d < w - x - DETECT_SUBROW_WIDTH; d++) {     \\\n            pix = ((CARD##bpp *)tightBeforeBuf)[(y+d)*w+x+d];                \\\n            if (endianMismatch) {                                            \\\n                pix = Swap##bpp(pix);                                        \\\n            }                                                                \\\n            for (c = 0; c < 3; c++) {                                        \\\n                left[c] = (int)(pix >> shiftBits[c] & maxColor[c]);          \\\n            }                                                                \\\n            for (dx = 1; dx <= DETECT_SUBROW_WIDTH; dx++) {                  \\\n                pix = ((CARD##bpp *)tightBeforeBuf)[(y+d)*w+x+d+dx];         \\\n                if (endianMismatch) {                                        \\\n                    pix = Swap##bpp(pix);                                    \\\n                }                                                            \\\n                sum = 0;                                                     \\\n                for (c = 0; c < 3; c++) {                                    \\\n                    sample = (int)(pix >> shiftBits[c] & maxColor[c]);       \\\n                    sum += abs(sample - left[c]);                            \\\n                    left[c] = sample;                                        \\\n                }                                                            \\\n                if (sum > 255)                                               \\\n                    sum = 255;                                               \\\n                diffStat[sum]++;                                             \\\n                pixelCount++;                                                \\\n            }                                                                \\\n        }                                                                    \\\n        if (w > h) {                                                         \\\n            x += h;                                                          \\\n            y = 0;                                                           \\\n        } else {                                                             \\\n            x = 0;                                                           \\\n            y += w;                                                          \\\n        }                                                                    \\\n    }                                                                        \\\n                                                                             \\\n    if (pixelCount == 0)                                                     \\\n        return 0;                                                            \\\n                                                                             \\\n    if ((diffStat[0] + diffStat[1]) * 100 / pixelCount >= 90)                \\\n        return 0;                                                            \\\n                                                                             \\\n    avgError = 0;                                                            \\\n    for (c = 1; c < 8; c++) {                                                \\\n        avgError += (unsigned long)diffStat[c] * (unsigned long)(c * c);     \\\n        if (diffStat[c] == 0 || diffStat[c] > diffStat[c-1] * 2)             \\\n            return 0;                                                        \\\n    }                                                                        \\\n    for (; c < 256; c++) {                                                   \\\n        avgError += (unsigned long)diffStat[c] * (unsigned long)(c * c);     \\\n    }                                                                        \\\n    avgError /= (pixelCount - diffStat[0]);                                  \\\n                                                                             \\\n    return avgError;                                                         \\\n}\n\nDEFINE_DETECT_FUNCTION(16)\nDEFINE_DETECT_FUNCTION(32)\n#define DetectSmoothImage16(x, y, z) DetectSmoothImage16(cl, x, y, z)\n#define DetectSmoothImage32(x, y, z) DetectSmoothImage32(cl, x, y, z)\n\n\n/*\n * JPEG compression stuff.\n */\n\nstatic Bool\nSendJpegRect(rfbClientPtr cl, int x, int y, int w, int h, int quality)\n{\n    struct jpeg_compress_struct cinfo;\n    struct jpeg_error_mgr jerr;\n    CARD8 *srcBuf;\n    JSAMPROW rowPointer[1];\n    int dy;\n\n    cl->cinfo = &cinfo;  /* tight encoding -- GetClient() uses this to map cinfos to client records */\n\n    if (rfbServerFormat.bitsPerPixel == 8)\n        return SendFullColorRect(cl, w, h);\n\n    srcBuf = (CARD8 *)xalloc(w * 3);\n    if (srcBuf == NULL) {\n        return SendFullColorRect(cl, w, h);\n    }\n    rowPointer[0] = srcBuf;\n\n    cinfo.err = jpeg_std_error(&jerr);\n    jpeg_create_compress(&cinfo);\n\n    cinfo.image_width = w;\n    cinfo.image_height = h;\n    cinfo.input_components = 3;\n    cinfo.in_color_space = JCS_RGB;\n\n    jpeg_set_defaults(&cinfo);\n    jpeg_set_quality(&cinfo, quality, TRUE);\n\n    JpegSetDstManager (&cinfo);\n\n    jpeg_start_compress(&cinfo, TRUE);\n\n    for (dy = 0; dy < h; dy++) {\n        PrepareRowForJpeg(cl, srcBuf, x, y + dy, w);\n        jpeg_write_scanlines(&cinfo, rowPointer, 1);\n        if (jpegError)\n            break;\n    }\n\n    if (!jpegError)\n        jpeg_finish_compress(&cinfo);\n\n    jpeg_destroy_compress(&cinfo);\n    xfree((char *)srcBuf);\n\n    if (jpegError)\n        return SendFullColorRect(cl, w, h);\n\n    if (cl->ublen + TIGHT_MIN_TO_COMPRESS + 1 > UPDATE_BUF_SIZE) {\n        if (!rfbSendUpdateBuf(cl))\n            return FALSE;\n    }\n\n    cl->updateBuf[cl->ublen++] = (char)(rfbTightJpeg << 4);\n    cl->rfbBytesSent[rfbEncodingTight]++;\n\n    return SendCompressedData(cl, jpegDstDataLen);\n}\n\nstatic void\nPrepareRowForJpeg(rfbClientPtr cl, CARD8 *dst, int x, int y, int count)\n{\n    if (rfbServerFormat.bitsPerPixel == 32) {\n        if ( rfbServerFormat.redMax == 0xFF &&\n             rfbServerFormat.greenMax == 0xFF &&\n             rfbServerFormat.blueMax == 0xFF ) {\n            PrepareRowForJpeg24(cl, dst, x, y, count);\n        } else {\n            PrepareRowForJpeg32(cl, dst, x, y, count);\n        }\n    } else {\n        /* 16 bpp assumed. */\n        PrepareRowForJpeg16(cl, dst, x, y, count);\n    }\n}\n\nstatic void\nPrepareRowForJpeg24(rfbClientPtr cl, CARD8 *dst, int x, int y, int count)\n{\n    CARD32 *fbptr;\n    CARD32 pix;\n\n    fbptr = (CARD32 *)\n        &cl->scalingFrameBuffer[y * cl->scalingPaddedWidthInBytes + x * 4];\n\n    while (count--) {\n        pix = *fbptr++;\n        *dst++ = (CARD8)(pix >> rfbServerFormat.redShift);\n        *dst++ = (CARD8)(pix >> rfbServerFormat.greenShift);\n        *dst++ = (CARD8)(pix >> rfbServerFormat.blueShift);\n    }\n}\n\n#define DEFINE_JPEG_GET_ROW_FUNCTION(bpp)                                   \\\n                                                                            \\\nstatic void                                                                 \\\nPrepareRowForJpeg##bpp(rfbClientPtr cl, CARD8 *dst, int x, int y, int count) \\\n{                                                                           \\\n    CARD##bpp *fbptr;                                                       \\\n    CARD##bpp pix;                                                          \\\n    int inRed, inGreen, inBlue;                                             \\\n                                                                            \\\n    fbptr = (CARD##bpp *)                                                   \\\n        &cl->scalingFrameBuffer[y * cl->scalingPaddedWidthInBytes +             \\\n                             x * (bpp / 8)];                                \\\n                                                                            \\\n    while (count--) {                                                       \\\n        pix = *fbptr++;                                                     \\\n                                                                            \\\n        inRed = (int)                                                       \\\n            (pix >> rfbServerFormat.redShift   & rfbServerFormat.redMax);   \\\n        inGreen = (int)                                                     \\\n            (pix >> rfbServerFormat.greenShift & rfbServerFormat.greenMax); \\\n        inBlue  = (int)                                                     \\\n            (pix >> rfbServerFormat.blueShift  & rfbServerFormat.blueMax);  \\\n                                                                            \\\n\t*dst++ = (CARD8)((inRed   * 255 + rfbServerFormat.redMax / 2) /     \\\n                         rfbServerFormat.redMax);                           \\\n\t*dst++ = (CARD8)((inGreen * 255 + rfbServerFormat.greenMax / 2) /   \\\n                         rfbServerFormat.greenMax);                         \\\n\t*dst++ = (CARD8)((inBlue  * 255 + rfbServerFormat.blueMax / 2) /    \\\n                         rfbServerFormat.blueMax);                          \\\n    }                                                                       \\\n}\n\nDEFINE_JPEG_GET_ROW_FUNCTION(16)\nDEFINE_JPEG_GET_ROW_FUNCTION(32)\n\n/*\n * Destination manager implementation for JPEG library.\n */\n\n/* tight encoding -- Map cinfo to client record */\n#define GetClient(cl, cinfo)                     \\\n    for ( cl = rfbClientHead;; cl = cl->next ) { \\\n        if (cl == NULL)                          \\\n            pthread_exit(NULL);                  \\\n                                                 \\\n        if (cl->cinfo == cinfo)                  \\\n            break;                               \\\n    }\n\nstatic void\nJpegInitDestination(j_compress_ptr cinfo)\n{\n    rfbClientPtr cl;\n\n    GetClient(cl, cinfo);\n    jpegError = FALSE;\n    jpegDstManager.next_output_byte = (JOCTET *)tightAfterBuf;\n    jpegDstManager.free_in_buffer = (size_t)tightAfterBufSize;\n}\n\nstatic boolean\nJpegEmptyOutputBuffer(j_compress_ptr cinfo)\n{\n    rfbClientPtr cl;\n\n    GetClient(cl, cinfo);\n    jpegError = TRUE;\n    jpegDstManager.next_output_byte = (JOCTET *)tightAfterBuf;\n    jpegDstManager.free_in_buffer = (size_t)tightAfterBufSize;\n\n    return TRUE;\n}\n\nstatic void\nJpegTermDestination(j_compress_ptr cinfo)\n{\n    rfbClientPtr cl;\n\n    GetClient(cl, cinfo);\n    jpegDstDataLen = tightAfterBufSize - jpegDstManager.free_in_buffer;\n}\n\n#undef JpegSetDstManager\nstatic void\nJpegSetDstManager(rfbClientPtr cl, j_compress_ptr cinfo)\n{\n    jpegDstManager.init_destination = JpegInitDestination;\n    jpegDstManager.empty_output_buffer = JpegEmptyOutputBuffer;\n    jpegDstManager.term_destination = JpegTermDestination;\n    cinfo->dest = &jpegDstManager;\n}\n\n"
  },
  {
    "path": "OSXvnc-server/tight.h",
    "content": "/*\n * tight.h - header file for Tight Encoding\n */\n\n/*\n *  Copyright (C) 2000, 2001 Const Kaplinsky.  All Rights Reserved.\n *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n#ifndef __TIGHT_H__\n#define __TIGHT_H__\n#include <jpeglib.h>\n\n\n/* Stuff dealing with palettes. */\n\ntypedef struct COLOR_LIST_s {\n    struct COLOR_LIST_s *next;\n    int idx;\n    CARD32 rgb;\n} COLOR_LIST;\n\ntypedef struct PALETTE_ENTRY_s {\n    COLOR_LIST *listNode;\n    int numPixels;\n} PALETTE_ENTRY;\n\ntypedef struct PALETTE_s {\n    PALETTE_ENTRY entry[256];\n    COLOR_LIST *hash[256];\n    COLOR_LIST list[256];\n} PALETTE;\n#endif\n"
  },
  {
    "path": "OSXvnc-server/translate.c",
    "content": "/*\n * translate.c - translate between different pixel formats\n */\n\n/*\n *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>.\n *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.\n *  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n#include <stdio.h>\n#include <stdlib.h>\n#include \"rfb.h\"\n\nstatic Bool rfbSetClientColourMapBGR233(rfbClientPtr cl);\n\nBool rfbEconomicTranslate = FALSE;\n\n/*\n * Structure representing pixel format for RFB server (i.e. us).\n */\n\nrfbPixelFormat rfbServerFormat;\n\n\n/*\n * Some standard pixel formats.\n */\n\nstatic const rfbPixelFormat BGR233Format = {\n    8, 8, 0, 1, 7, 7, 3, 0, 3, 6\n};\n\n#define CONCAT2(a,b) a##b\n#define CONCAT2E(a,b) CONCAT2(a,b)\n#define CONCAT4(a,b,c,d) a##b##c##d\n#define CONCAT4E(a,b,c,d) CONCAT4(a,b,c,d)\n\n#define OUT 8\n#include \"tableinittctemplate.c\"\n#define IN 8\n#include \"tabletranstemplate.c\"\n#undef IN\n#define IN 16\n#include \"tabletranstemplate.c\"\n#undef IN\n#define IN 32\n#include \"tabletranstemplate.c\"\n#undef IN\n#undef OUT\n\n#define OUT 16\n#include \"tableinittctemplate.c\"\n#define IN 8\n#include \"tabletranstemplate.c\"\n#undef IN\n#define IN 16\n#include \"tabletranstemplate.c\"\n#undef IN\n#define IN 32\n#include \"tabletranstemplate.c\"\n#undef IN\n#undef OUT\n\n#define OUT 32\n#include \"tableinittctemplate.c\"\n#define IN 8\n#include \"tabletranstemplate.c\"\n#undef IN\n#define IN 16\n#include \"tabletranstemplate.c\"\n#undef IN\n#define IN 32\n#include \"tabletranstemplate.c\"\n#undef IN\n#undef OUT\n\ntypedef void (*rfbInitTableFnType)(char **table, rfbPixelFormat *in,\n                                   rfbPixelFormat *out);\n\nrfbInitTableFnType rfbInitTrueColourSingleTableFns[3] = {\n    rfbInitTrueColourSingleTable8,\n    rfbInitTrueColourSingleTable16,\n    rfbInitTrueColourSingleTable32\n};\n\nrfbInitTableFnType rfbInitTrueColourRGBTablesFns[3] = {\n    rfbInitTrueColourRGBTables8,\n    rfbInitTrueColourRGBTables16,\n    rfbInitTrueColourRGBTables32\n};\n\nrfbTranslateFnType rfbTranslateWithSingleTableFns[3][3] = {\n    { rfbTranslateWithSingleTable8to8,\n      rfbTranslateWithSingleTable8to16,\n      rfbTranslateWithSingleTable8to32 },\n    { rfbTranslateWithSingleTable16to8,\n      rfbTranslateWithSingleTable16to16,\n      rfbTranslateWithSingleTable16to32 },\n    { rfbTranslateWithSingleTable32to8,\n      rfbTranslateWithSingleTable32to16,\n      rfbTranslateWithSingleTable32to32 }\n};\n\nrfbTranslateFnType rfbTranslateWithRGBTablesFns[3][3] = {\n    { rfbTranslateWithRGBTables8to8,\n      rfbTranslateWithRGBTables8to16,\n      rfbTranslateWithRGBTables8to32 },\n    { rfbTranslateWithRGBTables16to8,\n      rfbTranslateWithRGBTables16to16,\n      rfbTranslateWithRGBTables16to32 },\n    { rfbTranslateWithRGBTables32to8,\n      rfbTranslateWithRGBTables32to16,\n      rfbTranslateWithRGBTables32to32 }\n};\n\n\n/*\n * rfbTranslateNone is used when no translation is required.\n */\n\nvoid\nrfbTranslateNone(char *table, rfbPixelFormat *in, rfbPixelFormat *out,\n                 char *iptr, char *optr, int bytesBetweenInputLines,\n                 int width, int height)\n{\n    int bytesPerOutputLine = width * (out->bitsPerPixel / 8);\n\n    while (height > 0) {\n        memcpy(optr, iptr, bytesPerOutputLine);\n        iptr += bytesBetweenInputLines;\n        optr += bytesPerOutputLine;\n        height--;\n    }\n}\n\n/*\n * rfbSetTranslateFunction sets the translation function.\n */\n\nBool rfbSetTranslateFunction(rfbClientPtr cl) {\n    rfbLog(\"Pixel format for client %s:\",cl->host);\n    PrintPixelFormat(&cl->format);\n    //cl->format = rfbServerFormat;\n    cl->translateFn = rfbTranslateNone;\n    cl->translateLookupTable = NULL;\n\n    return rfbSetTranslateFunctionUsingFormat(cl, rfbServerFormat);\n}\n\nBool rfbSetTranslateFunctionUsingFormat(rfbClientPtr cl, rfbPixelFormat inFormat) {\n    /*\n     * Check that bits per pixel values are valid\n     */\n\n    if ((inFormat.bitsPerPixel != 8) &&\n        (inFormat.bitsPerPixel != 16) &&\n        (inFormat.bitsPerPixel != 32))\n    {\n        rfbLog(\"%s: server bits per pixel not 8, 16 or 32\",\n                \"rfbSetTranslateFunction\");\n        rfbCloseClient(cl);\n        return FALSE;\n    }\n\n    if ((cl->format.bitsPerPixel != 8) &&\n        (cl->format.bitsPerPixel != 16) &&\n        (cl->format.bitsPerPixel != 32))\n    {\n        rfbLog(\"%s: client bits per pixel not 8, 16 or 32\",\n                \"rfbSetTranslateFunction\");\n        rfbCloseClient(cl);\n        return FALSE;\n    }\n\n    if (!cl->format.trueColour && (cl->format.bitsPerPixel != 8)) {\n        rfbLog(\"rfbSetTranslateFunction: client has colour map \"\n                \"but %d-bit - can only cope with 8-bit colour maps\\n\",\n                cl->format.bitsPerPixel);\n        rfbCloseClient(cl);\n        return FALSE;\n    }\n\n    /*\n     * bpp is valid, now work out how to translate\n     */\n\n    if (!cl->format.trueColour) {\n        /*\n         * truecolour -> colour map\n         *\n         * Set client's colour map to BGR233, then effectively it's\n         * truecolour as well\n         */\n\n        rfbLog(\"setting the client's color map to BGR233\");\n\n        if (!rfbSetClientColourMapBGR233(cl))\n            return FALSE;\n\n        cl->format = BGR233Format;\n    }\n\n    /* truecolour -> truecolour */\n\n    if (PF_EQ(cl->format,inFormat)) {\n\n        /* client & server the same */\n\n        //rfbLog(\"no translation needed\");\n        cl->translateFn = rfbTranslateNone;\n\t\tcl->translateLookupTable = NULL;\n        return TRUE;\n    }\n\n    if ((inFormat.bitsPerPixel < 16) ||\n        (!rfbEconomicTranslate && (inFormat.bitsPerPixel == 16))) {\n\n        /* we can use a single lookup table for <= 16 bpp */\n\n        //rfbLog(\"single lookup table translation, function [%d][%d]\", inFormat.bitsPerPixel / 16, cl->format.bitsPerPixel / 16);\n\n        cl->translateFn = rfbTranslateWithSingleTableFns\n                              [inFormat.bitsPerPixel / 16]\n                                  [cl->format.bitsPerPixel / 16];\n\n        (*rfbInitTrueColourSingleTableFns\n            [cl->format.bitsPerPixel / 16]) (&cl->translateLookupTable,\n                                             &inFormat, &cl->format);\n\n    }\n    else {\n        //rfbLog(\"three tables for R, G, B\");\n\n        /* otherwise we use three separate tables for red, green and blue */\n\n        cl->translateFn = rfbTranslateWithRGBTablesFns\n                              [inFormat.bitsPerPixel / 16]\n                                  [cl->format.bitsPerPixel / 16];\n\n        (*rfbInitTrueColourRGBTablesFns\n            [cl->format.bitsPerPixel / 16]) (&cl->translateLookupTable,\n                                             &inFormat, &cl->format);\n    }\n\n    return TRUE;\n}\n\n\n\n/*\n * rfbSetClientColourMapBGR233 sets the client's colour map so that it's\n * just like an 8-bit BGR233 true colour client.\n */\n\nstatic Bool rfbSetClientColourMapBGR233(rfbClientPtr cl)\n{\n    char buf[sz_rfbSetColourMapEntriesMsg + 256 * 3 * 2];\n    rfbSetColourMapEntriesMsg *scme = (rfbSetColourMapEntriesMsg *)buf;\n    CARD16 *rgb = (CARD16 *)(&buf[sz_rfbSetColourMapEntriesMsg]);\n    int i, len;\n    int r, g, b;\n\n    if (cl->format.bitsPerPixel != 8) {\n        rfbLog(\"%s: client not 8 bits per pixel\",\n                \"rfbSetClientColourMapBGR233\");\n        rfbCloseClient(cl);\n        return FALSE;\n    }\n\n    scme->type = rfbSetColourMapEntries;\n\n    scme->firstColour = Swap16IfLE(0);\n    scme->nColours = Swap16IfLE(256);\n\n    len = sz_rfbSetColourMapEntriesMsg;\n\n    i = 0;\n\n    for (b = 0; b < 4; b++) {\n        for (g = 0; g < 8; g++) {\n            for (r = 0; r < 8; r++) {\n                rgb[i++] = Swap16IfLE(r * 65535 / 7);\n                rgb[i++] = Swap16IfLE(g * 65535 / 7);\n                rgb[i++] = Swap16IfLE(b * 65535 / 3);\n            }\n        }\n    }\n\n    len += 256 * 3 * 2;\n\n    if (WriteExact(cl, buf, len) < 0) {\n        rfbLogPerror(\"rfbSetClientColourMapBGR233: write\");\n        rfbCloseClient(cl);\n        return FALSE;\n    }\n    return TRUE;\n}\n\n\nvoid PrintPixelFormat(rfbPixelFormat *pf) {\n    if (pf->bitsPerPixel == 1) {\n        rfbLog(\"  1 bpp, %s sig bit in each byte is leftmost on the screen.\",\n               (pf->bigEndian ? \"most\" : \"least\"));\n    } else {\n        rfbLog(\"  %d bpp, depth %d%s\", pf->bitsPerPixel, pf->depth,\n               ((pf->bitsPerPixel == 8) ? \"\"\n                : (pf->bigEndian ? \", big endian\" : \", little endian\")));\n        if (pf->trueColour) {\n            rfbLog(\"  true colour: max r %d g %d b %d, shift r %d g %d b %d\",\n                   pf->redMax, pf->greenMax, pf->blueMax,\n                   pf->redShift, pf->greenShift, pf->blueShift);\n        } else {\n            rfbLog(\"  uses a colour map (not true colour).\");\n        }\n    }\n}\n"
  },
  {
    "path": "OSXvnc-server/vncauth.c",
    "content": "/*\n *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this program; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n/*\n * vncauth.c - Functions for VNC password management and authentication.\n */\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <time.h>\n#include \"vncauth.h\"\n#include \"d3des.h\"\n\n\n\n/*\n * We use a fixed key to store passwords, since we assume that our local\n * file system is secure but nonetheless don't want to store passwords\n * as plaintext.\n */\n\nunsigned char fixedkey[8] = {23,82,107,6,35,78,88,7};\n\n\nchar *vncEncryptPasswd(const char *passwd) {\n\tunsigned char encryptedPasswd[8];\n\tchar *returnPass;\n\n\t// Handles copying 0's into extra space\n\tstrncpy((char *)encryptedPasswd, passwd, 8);\n\n    /* Do encryption in-place - this way we overwrite our copy of the plaintext password */\n    deskey(fixedkey, EN0);\n    des(encryptedPasswd, encryptedPasswd);\n\n\treturnPass = malloc(8);\n\tstrncpy(returnPass, (const char *) encryptedPasswd, 8);\n\n    return (char *)returnPass;\n}\n\n/*\n * Encrypt a password and store it in a file.  Returns 0 if successful,\n * 1 if the file could not be written.\n */\n\nint\nvncEncryptAndStorePasswd(char *passwd, char *fname)\n{\n    FILE *fp;\n    int i;\n    unsigned char encryptedPasswd[8];\n\n    if ((fp = fopen(fname,\"w\")) == NULL) return 1;\n\n    chmod(fname, S_IRUSR|S_IWUSR);\n\n    /* pad password with nulls */\n\n    for (i = 0; i < 8; i++) {\n\tif (i < strlen(passwd)) {\n\t    encryptedPasswd[i] = passwd[i];\n\t} else {\n\t    encryptedPasswd[i] = 0;\n\t}\n    }\n\n    /* Do encryption in-place - this way we overwrite our copy of the plaintext\n       password */\n\n    deskey(fixedkey, EN0);\n    des(encryptedPasswd, encryptedPasswd);\n\n    for (i = 0; i < 8; i++) {\n\tputc(encryptedPasswd[i], fp);\n    }\n\n    fclose(fp);\n    return 0;\n}\n\n\n/*\n * Decrypt a password from a file.  Returns a pointer to a newly allocated\n * string containing the password or a null pointer if the password could\n * not be retrieved for some reason.\n */\n\nchar *\nvncDecryptPasswdFromFile(char *fname)\n{\n    FILE *fp;\n    int i, ch;\n    unsigned char *passwd;\n\n    if ((fp = fopen(fname,\"r\")) == NULL) return NULL;\n\n    passwd = (unsigned char *)malloc(9);\n    if (passwd != NULL) {\n        for (i = 0; i < 8; i++) {\n            ch = getc(fp);\n            if (ch == EOF) {\n                free(passwd);\n                fclose(fp);\n                return NULL;\n            }\n            passwd[i] = ch;\n        }\n\n        deskey(fixedkey, DE1);\n        des(passwd, passwd);\n\n        passwd[8] = 0;\n    }\n\n    fclose(fp);\n\n    return (char *)passwd;\n}\n\n\n/*\n * Generate CHALLENGESIZE random bytes for use in challenge-response\n * authentication.\n */\n\nvoid\nvncRandomBytes(unsigned char *bytes)\n{\n    int i;\n    unsigned int seed = (unsigned int) time(0);\n\n    srandom(seed);\n    for (i = 0; i < CHALLENGESIZE; i++) {\n\tbytes[i] = (unsigned char)(random() & 255);\n    }\n}\n\n\n/*\n * Encrypt CHALLENGESIZE bytes in memory using a password.\n */\n\nvoid\nvncEncryptBytes(unsigned char *bytes, char *passwd)\n{\n    unsigned char key[8];\n    int i;\n\n    /* key is simply password padded with nulls */\n\n    for (i = 0; i < 8; i++) {\n\tif (i < strlen(passwd)) {\n\t    key[i] = passwd[i];\n\t} else {\n\t    key[i] = 0;\n\t}\n    }\n\n    deskey(key, EN0);\n\n    for (i = 0; i < CHALLENGESIZE; i += 8) {\n\tdes(bytes+i, bytes+i);\n    }\n}\n"
  },
  {
    "path": "OSXvnc-server/vncauth.h",
    "content": "/*\n *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n/*\n * vncauth.h - describes the functions provided by the vncauth library.\n */\n\n#define MAXPWLEN 8\n#define CHALLENGESIZE 16\n\nextern char *vncEncryptPasswd(const char *passwd);\nextern int vncEncryptAndStorePasswd(char *passwd, char *fname);\nextern char *vncDecryptPasswdFromFile(char *fname);\nextern void vncRandomBytes(unsigned char *bytes);\nextern void vncEncryptBytes(unsigned char *bytes, char *passwd);\n"
  },
  {
    "path": "OSXvnc-server/xalloc.c",
    "content": "/* XALLOC -- X's internal memory allocator.  Why does it return unsigned\n * long * instead of the more common char *?  Well, if you read K&R you'll\n * see they say that alloc must return a pointer \"suitable for conversion\"\n * to whatever type you really want.  In a full-blown generic allocator\n * there's no way to solve the alignment problems without potentially\n * wasting lots of space.  But we have a more limited problem. We know\n * we're only ever returning pointers to structures which will have to\n * be long word aligned.  So we are making a stronger guarantee.  It might\n * have made sense to make Xalloc return char * to conform with people's\n * expectations of malloc, but this makes lint happier.\n */\n\n#ifdef WIN32\n#include <X11/Xwinsock.h>\n#endif\n#include \"Xos.h\"\n#include <stdlib.h>\n#include <stdio.h>\n#include \"misc.h\"\n#include \"X.h\"\n#include \"input.h\"\n#include \"opaque.h\"\n#ifdef X_POSIX_C_SOURCE\n#define _POSIX_C_SOURCE X_POSIX_C_SOURCE\n#include <signal.h>\n#undef _POSIX_C_SOURCE\n#else\n#if defined(X_NOT_POSIX) || defined(_POSIX_SOURCE)\n#include <signal.h>\n#else\n#define _POSIX_SOURCE\n#include <signal.h>\n#undef _POSIX_SOURCE\n#endif\n#endif\n#if !defined(SYSV) && !defined(AMOEBA) && !defined(_MINIX) && !defined(WIN32) && !defined(Lynx)\n#include <sys/resource.h>\n#endif\n#include <time.h>\n#include <sys/stat.h>\n#include <ctype.h>    /* for isspace */\n#if NeedVarargsPrototypes\n#include <stdarg.h>\n#endif\n\n#ifndef INTERNAL_MALLOC\n\nBool Must_have_memory = FALSE;\n\nunsigned long *\nXalloc (unsigned long amount)\n{\n#if !defined(__STDC__) && !defined(AMOEBA)\n    char                *malloc();\n#endif\n    register pointer  ptr;\n\n    if ((long)amount <= 0) {\n        return (unsigned long *)NULL;\n    }\n    /* aligned extra on long word boundary */\n    amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1);\n#ifdef MEMBUG\n    if (!Must_have_memory && Memory_fail &&\n        ((random() % MEM_FAIL_SCALE) < Memory_fail))\n        return (unsigned long *)NULL;\n#endif\n    if ((ptr = (pointer)malloc(amount))) {\n        return (unsigned long *)ptr;\n    }\n    if (Must_have_memory)\n        FatalError(\"Out of memory\");\n    return (unsigned long *)NULL;\n}\n\n/*****************\n * XNFalloc\n * \"no failure\" realloc, alternate interface to Xalloc w/o Must_have_memory\n *****************/\n\nunsigned long *\nXNFalloc (unsigned long amount)\n{\n#if !defined(__STDC__) && !defined(AMOEBA)\n    char             *malloc();\n#endif\n    register pointer ptr;\n\n    if ((long)amount <= 0)\n    {\n        return (unsigned long *)NULL;\n    }\n    /* aligned extra on long word boundary */\n    amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1);\n    ptr = (pointer)malloc(amount);\n    if (!ptr)\n    {\n        FatalError(\"Out of memory\");\n    }\n    return ((unsigned long *)ptr);\n}\n\n/*****************\n * Xcalloc\n *****************/\n\nunsigned long *\nXcalloc (unsigned long amount)\n{\n    unsigned long   *ret;\n\n    ret = Xalloc (amount);\n    if (ret)\n        bzero ((char *) ret, (int) amount);\n    return ret;\n}\n\n/*****************\n * Xrealloc\n *****************/\n\nunsigned long *\nXrealloc (pointer ptr, unsigned long amount)\n{\n#if !defined(__STDC__) && !defined(AMOEBA)\n    char *malloc();\n    char *realloc();\n#endif\n\n#ifdef MEMBUG\n    if (!Must_have_memory && Memory_fail &&\n        ((random() % MEM_FAIL_SCALE) < Memory_fail))\n        return (unsigned long *)NULL;\n#endif\n    if ((long)amount <= 0)\n    {\n        if (ptr && !amount)\n            free(ptr);\n        return (unsigned long *)NULL;\n    }\n    amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1);\n    if (ptr)\n        ptr = (pointer)realloc((char *)ptr, amount);\n    else\n        ptr = (pointer)malloc(amount);\n    if (ptr)\n        return (unsigned long *)ptr;\n    if (Must_have_memory)\n        FatalError(\"Out of memory\");\n    return (unsigned long *)NULL;\n}\n\n/*****************\n * XNFrealloc\n * \"no failure\" realloc, alternate interface to Xrealloc w/o Must_have_memory\n *****************/\n\nunsigned long *\nXNFrealloc (pointer ptr, unsigned long amount)\n{\n    if (( ptr = (pointer)Xrealloc( ptr, amount ) ) == NULL)\n    {\n        FatalError( \"Out of memory\" );\n    }\n    return ((unsigned long *)ptr);\n}\n\n/*****************\n *  Xfree\n *    calls free\n *****************/\n\nvoid\nXfree(pointer ptr)\n{\n    if (ptr)\n        free((char *)ptr);\n}\n\nvoid\nFatalError(char *f, ...)\n{\n    va_list args;\n\n    fprintf(stderr, \"\\nFatal server error:\\n\");\n    va_start(args, f);\n    vfprintf(stderr, f, args);\n    va_end(args);\n    fprintf(stderr, \"\\n\");\n\n    exit(1);\n}\n\n#endif\n"
  },
  {
    "path": "OSXvnc-server/zlib.c",
    "content": "/*\n * zlib.c\n *\n * Routines to implement zlib based encoding (deflate).\n */\n\n/*\n *  Copyright (C) 2000 Tridia Corporation.  All Rights Reserved.\n *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n *\n * For the latest source code, please check:\n *\n * http://www.developVNC.org/\n *\n * or send email to feedback@developvnc.org.\n */\n\n#include <stdio.h>\n#include \"rfb.h\"\n\n/*\n * rfbSendOneRectEncodingZlib - send a given rectangle using one Zlib\n *                              rectangle encoding.\n */\n\nBool rfbSendOneRectEncodingZlib(rfbClientPtr cl, int x, int y, int w, int h)\n{\n    rfbFramebufferUpdateRectHeader rect;\n    rfbZlibHeader hdr;\n    int deflateResult;\n    int i;\n    char *fbptr = (cl->scalingFrameBuffer + (cl->scalingPaddedWidthInBytes * y)\n    \t   + (x * (rfbScreen.bitsPerPixel / 8)));\n\n    int maxRawSize;\n    int maxCompSize;\n\n    maxRawSize = (rfbScreen.width * rfbScreen.height\n                  * (cl->format.bitsPerPixel / 8));\n\n    if (zlibBeforeBufSize < maxRawSize) {\n\tzlibBeforeBufSize = maxRawSize;\n\tif (zlibBeforeBuf == NULL)\n\t    zlibBeforeBuf = (char *)xalloc(zlibBeforeBufSize);\n\telse\n\t    zlibBeforeBuf = (char *)xrealloc(zlibBeforeBuf, zlibBeforeBufSize);\n    }\n\n    /* zlib compression is not useful for very small data sets.\n     * So, we just send these raw without any compression.\n     */\n    if (( w * h * (rfbScreen.bitsPerPixel / 8)) <\n          VNC_ENCODE_ZLIB_MIN_COMP_SIZE ) {\n\n        int result;\n\n        /* The translation function (used also by the in raw encoding)\n         * requires 4/2/1 byte alignment in the output buffer (which is\n         * cl->updateBuf for the raw encoding) based on the bitsPerPixel of\n         * the viewer/client.  This prevents SIGBUS errors on some\n         * architectures like SPARC, PARISC...\n         */\n        if (( cl->format.bitsPerPixel > 8 ) &&\n            ( cl->ublen % ( cl->format.bitsPerPixel / 8 )) != 0 ) {\n            if (!rfbSendUpdateBuf(cl))\n                return FALSE;\n        }\n\n        result = rfbSendRectEncodingRaw(cl, x, y, w, h);\n\n        return result;\n\n    }\n\n    /*\n     * zlib requires output buffer to be slightly larger than the input\n     * buffer, in the worst case.\n     */\n    maxCompSize = maxRawSize + (( maxRawSize + 99 ) / 100 ) + 12;\n\n    if (zlibAfterBufSize < maxCompSize) {\n\tzlibAfterBufSize = maxCompSize;\n\tif (zlibAfterBuf == NULL)\n\t    zlibAfterBuf = (char *)xalloc(zlibAfterBufSize);\n\telse\n\t    zlibAfterBuf = (char *)xrealloc(zlibAfterBuf, zlibAfterBufSize);\n    }\n\n    /*\n     * Convert pixel data to client format.\n     */\n    (*cl->translateFn)(cl->translateLookupTable, &rfbServerFormat,\n\t\t       &cl->format, fbptr, zlibBeforeBuf,\n\t\t       cl->scalingPaddedWidthInBytes, w, h);\n\n    cl->compStream.next_in = ( Bytef * )zlibBeforeBuf;\n    cl->compStream.avail_in = w * h * (cl->format.bitsPerPixel / 8);\n    cl->compStream.next_out = ( Bytef * )zlibAfterBuf;\n    cl->compStream.avail_out = maxCompSize;\n    cl->compStream.data_type = Z_BINARY;\n\n    /* Initialize the deflation state. */\n    if ( cl->compStreamInited == FALSE ) {\n\n        cl->compStream.total_in = 0;\n        cl->compStream.total_out = 0;\n        cl->compStream.zalloc = Z_NULL;\n        cl->compStream.zfree = Z_NULL;\n        cl->compStream.opaque = Z_NULL;\n\n        deflateInit2( &(cl->compStream),\n                        cl->zlibCompressLevel,\n                        Z_DEFLATED,\n                        MAX_WBITS,\n                        MAX_MEM_LEVEL,\n                        Z_DEFAULT_STRATEGY );\n        /* deflateInit( &(cl->compStream), Z_BEST_COMPRESSION ); */\n        /* deflateInit( &(cl->compStream), Z_BEST_SPEED ); */\n        cl->compStreamInited = TRUE;\n\n    }\n\n    size_t previousOut = cl->compStream.total_out;\n\n    /* Perform the compression here. */\n    deflateResult = deflate( &(cl->compStream), Z_SYNC_FLUSH );\n\n    /* Find the total size of the resulting compressed data. */\n    zlibAfterBufLen = cl->compStream.total_out - previousOut;\n\n    if ( deflateResult != Z_OK ) {\n        rfbLog(\"zlib deflation error: %s\", cl->compStream.msg);\n        return FALSE;\n    }\n\n    /* Note that it is not possible to switch zlib parameters based on\n     * the results of the compression pass.  The reason is\n     * that we rely on the compressor and decompressor states being\n     * in sync.  Compressing and then discarding the results would\n     * cause lose of synchronization.\n     */\n\n    /* Update statics */\n    cl->rfbRectanglesSent[rfbEncodingZlib]++;\n    cl->rfbBytesSent[rfbEncodingZlib] += (sz_rfbFramebufferUpdateRectHeader\n\t\t\t\t\t + sz_rfbZlibHeader + zlibAfterBufLen);\n\n    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbZlibHeader\n\t> UPDATE_BUF_SIZE)\n    {\n\tif (!rfbSendUpdateBuf(cl))\n\t    return FALSE;\n    }\n\n    rect.r.x = Swap16IfLE(x);\n    rect.r.y = Swap16IfLE(y);\n    rect.r.w = Swap16IfLE(w);\n    rect.r.h = Swap16IfLE(h);\n    rect.encoding = Swap32IfLE(rfbEncodingZlib);\n\n    memcpy(&cl->updateBuf[cl->ublen], &rect, sz_rfbFramebufferUpdateRectHeader);\n    cl->ublen += sz_rfbFramebufferUpdateRectHeader;\n\n    hdr.nBytes = Swap32IfLE(zlibAfterBufLen);\n\n    memcpy(&cl->updateBuf[cl->ublen], &hdr, sz_rfbZlibHeader);\n    cl->ublen += sz_rfbZlibHeader;\n\n    for (i = 0; i < zlibAfterBufLen;) {\n\n\tint bytesToCopy = UPDATE_BUF_SIZE - cl->ublen;\n\n\tif (i + bytesToCopy > zlibAfterBufLen) {\n\t    bytesToCopy = zlibAfterBufLen - i;\n\t}\n\n\tmemcpy(&cl->updateBuf[cl->ublen], &zlibAfterBuf[i], bytesToCopy);\n\n\tcl->ublen += bytesToCopy;\n\ti += bytesToCopy;\n\n\tif (cl->ublen == UPDATE_BUF_SIZE) {\n\t    if (!rfbSendUpdateBuf(cl))\n\t\treturn FALSE;\n\t}\n    }\n\n    return TRUE;\n\n}\n\n\n/*\n * rfbSendRectEncodingZlib - send a given rectangle using one or more\n *                           Zlib encoding rectangles.\n */\n\nBool\nrfbSendRectEncodingZlib(rfbClientPtr cl, int x, int y, int w, int h)\n{\n    int  maxLines;\n    int  linesRemaining;\n    rfbRectangle partialRect;\n\n    partialRect.x = x;\n    partialRect.y = y;\n    partialRect.w = w;\n    partialRect.h = h;\n\n    /* Determine maximum pixel/scan lines allowed per rectangle. */\n    maxLines = ( ZLIB_MAX_SIZE(w) / w );\n\n    /* Initialize number of scan lines left to do. */\n    linesRemaining = h;\n\n    /* Loop until all work is done. */\n    while ( linesRemaining > 0 ) {\n\n        int linesToComp;\n\n        if ( maxLines < linesRemaining )\n            linesToComp = maxLines;\n        else\n            linesToComp = linesRemaining;\n\n        partialRect.h = linesToComp;\n\n        /* Encode (compress) and send the next rectangle. */\n        if ( ! rfbSendOneRectEncodingZlib( cl,\n                                           partialRect.x,\n                                           partialRect.y,\n                                           partialRect.w,\n                                           partialRect.h )) {\n\n            return FALSE;\n        }\n\n        /* Technically, flushing the buffer here is not extremely\n         * efficient.  However, this improves the overall throughput\n         * of the system over very slow networks.  By flushing\n         * the buffer with every maximum size zlib rectangle, we\n         * improve the pipelining usage of the server CPU, network,\n         * and viewer CPU components.  Insuring that these components\n         * are working in parallel actually improves the performance\n         * seen by the user.\n         * Since, zlib is most useful for slow networks, this flush\n         * is appropriate for the desired behavior of the zlib encoding.\n         */\n        if (( cl->ublen > 0 ) &&\n            ( linesToComp == maxLines )) {\n            if (!rfbSendUpdateBuf(cl)) {\n\n                return FALSE;\n            }\n        }\n\n        /* Update remaining and incremental rectangle location. */\n        linesRemaining -= linesToComp;\n        partialRect.y += linesToComp;\n\n    }\n\n    return TRUE;\n\n}\n\n\n"
  },
  {
    "path": "OSXvnc-server/zlibhex.c",
    "content": "/*\n * zlibhex.c\n *\n * Routines to implement ZlibHex Encoding\n */\n\n/*\n *  Copyright (C) 2000 Tridia Corporation.  All Rights Reserved.\n *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n *\n * For the latest source code, please check:\n *\n * http://www.developVNC.org/\n *\n * or send email to feedback@developvnc.org.\n */\n\n#include <stdio.h>\n#include \"rfb.h\"\n\nstatic Bool sendZlibHex8(rfbClientPtr cl, int x, int y, int w, int h);\nstatic Bool sendZlibHex16(rfbClientPtr cl, int x, int y, int w, int h);\nstatic Bool sendZlibHex32(rfbClientPtr cl, int x, int y, int w, int h);\n\n\n/*\n * rfbSendRectEncodingZlibHex - send a rectangle using zlibhex encoding.\n */\n\nBool\nrfbSendRectEncodingZlibHex(rfbClientPtr cl, int x, int y, int w, int h)\n{\n    rfbFramebufferUpdateRectHeader rect;\n\n    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader > UPDATE_BUF_SIZE) {\n\tif (!rfbSendUpdateBuf(cl))\n\t    return FALSE;\n    }\n\n    rect.r.x = Swap16IfLE(x);\n    rect.r.y = Swap16IfLE(y);\n    rect.r.w = Swap16IfLE(w);\n    rect.r.h = Swap16IfLE(h);\n    rect.encoding = Swap32IfLE(rfbEncodingZlibHex);\n\n    memcpy(&cl->updateBuf[cl->ublen], &rect, sz_rfbFramebufferUpdateRectHeader);\n    cl->ublen += sz_rfbFramebufferUpdateRectHeader;\n\n    cl->rfbRectanglesSent[rfbEncodingZlibHex]++;\n    cl->rfbBytesSent[rfbEncodingZlibHex] += sz_rfbFramebufferUpdateRectHeader;\n\n    switch (cl->format.bitsPerPixel) {\n    case 8:\n\treturn sendZlibHex8(cl, x, y, w, h);\n    case 16:\n\treturn sendZlibHex16(cl, x, y, w, h);\n    case 32:\n\treturn sendZlibHex32(cl, x, y, w, h);\n    }\n\n    rfbLog(\"rfbSendRectEncodingZlibHex: bpp %d?\", cl->format.bitsPerPixel);\n    return FALSE;\n}\n\nint\nzlibCompress( BYTE *from_buf,\n              BYTE *to_buf,\n              unsigned int length,\n              unsigned int size,\n              rfbClientPtr cl,\n              struct z_stream_s *compressor )\n{\n    int deflateResult;\n\n    /* Initialize input/output buffer assignment for compressor state. */\n    compressor->avail_in = length;\n    compressor->next_in = from_buf;\n    compressor->avail_out = size;\n    compressor->next_out = to_buf;\n    compressor->data_type = Z_BINARY;\n\n    /* If necessary, the first time, initialize the compressor state. */\n    if ( compressor->total_in == ZLIBHEX_COMP_UNINITED )\n    {\n\n        compressor->total_in = 0;\n        compressor->total_out = 0;\n        compressor->zalloc = Z_NULL;\n        compressor->zfree = Z_NULL;\n        compressor->opaque = Z_NULL;\n\n        deflateResult = deflateInit2( compressor,\n\t\t\t              cl->zlibCompressLevel,\n\t\t\t\t      Z_DEFLATED,\n\t\t\t\t      MAX_WBITS,\n\t\t\t\t      MAX_MEM_LEVEL,\n\t\t\t\t      Z_DEFAULT_STRATEGY );\n        if ( deflateResult != Z_OK )\n        {\n            rfbLog( \"deflateInit2 returned error:%d:%s\",\n                    deflateResult,\n                    compressor->msg );\n            return -1;\n        }\n\n    }\n\n    /* Record previous total output size. */\n    size_t previousTotalOut = compressor->total_out;\n\n    /* Compress the raw data into the result buffer. */\n    deflateResult = deflate( compressor, Z_SYNC_FLUSH );\n\n    if ( deflateResult != Z_OK )\n    {\n        rfbLog( \"deflate returned error:%d:%s\",\n                deflateResult,\n                compressor->msg);\n        return -1;\n    }\n\n    return compressor->total_out - previousTotalOut;\n}\n\n#define PUT_PIXEL8(pix) (cl->updateBuf[cl->ublen++] = (pix))\n\n#define PUT_PIXEL16(pix) (cl->updateBuf[cl->ublen++] = ((char*)&(pix))[0], \\\n\t\t\t  cl->updateBuf[cl->ublen++] = ((char*)&(pix))[1])\n\n#define PUT_PIXEL32(pix) (cl->updateBuf[cl->ublen++] = ((char*)&(pix))[0], \\\n\t\t\t  cl->updateBuf[cl->ublen++] = ((char*)&(pix))[1], \\\n\t\t\t  cl->updateBuf[cl->ublen++] = ((char*)&(pix))[2], \\\n\t\t\t  cl->updateBuf[cl->ublen++] = ((char*)&(pix))[3])\n\n\n#define DEFINE_SEND_ZLIBHEX(bpp)\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\nstatic Bool subrectEncode##bpp(CARD##bpp *data, int w, int h, CARD##bpp bg,   \\\n\t\t\t       CARD##bpp fg, Bool mono, rfbClientPtr cl);     \\\nstatic void testColours##bpp(CARD##bpp *data, int size, Bool *mono,\t      \\\n\t\t\t     Bool *solid, CARD##bpp *bg, CARD##bpp *fg,       \\\n                             rfbClientPtr cl);                                \\\n\t\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n/*\t\t\t\t\t\t\t\t\t      \\\n * rfbSendZlibHex\t\t\t\t\t\t\t      \\\n */\t\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\nstatic Bool\t\t\t\t\t\t\t\t      \\\nsendZlibHex##bpp(rfbClientPtr cl, int rx, int ry, int rw, int rh) \\\n{\t\t\t\t\t\t\t\t\t      \\\n    int x, y, w, h;\t\t\t\t\t\t\t      \\\n    int startUblen;\t\t\t\t\t\t\t      \\\n    char *fbptr;\t\t\t\t\t\t\t      \\\n    CARD##bpp bg = 0, fg = 0, newBg = 0, newFg = 0;\t\t\t      \\\n    Bool mono, solid;\t\t\t\t\t\t\t      \\\n    Bool validBg = FALSE;\t\t\t\t\t\t      \\\n    Bool validFg = FALSE;\t\t\t\t\t\t      \\\n    CARD##bpp clientPixelData[(16*16+2)*(bpp/8)];\t\t\t      \\\n    int encodedBytes;\t\t\t\t\t\t\t      \\\n    int compressedSize;\t\t\t\t\t\t\t      \\\n    CARD16 *card16ptr;\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n    for (y = ry; y < ry+rh; y += 16) {\t\t\t\t\t      \\\n\tfor (x = rx; x < rx+rw; x += 16) {\t\t\t\t      \\\n\t    w = h = 16;\t\t\t\t\t\t\t      \\\n\t    if (rx+rw - x < 16)\t\t\t\t\t\t      \\\n\t\tw = rx+rw - x;\t\t\t\t\t\t      \\\n\t    if (ry+rh - y < 16)\t\t\t\t\t\t      \\\n\t\th = ry+rh - y;\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t    if ((cl->ublen + 1 + (2 + 16*16)*(bpp/8) + 22) > UPDATE_BUF_SIZE) {   \\\n\t\tif (!rfbSendUpdateBuf(cl))\t\t\t\t      \\\n\t\t    return FALSE;\t\t\t\t\t      \\\n\t    }\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t    fbptr = (cl->scalingFrameBuffer + (cl->scalingPaddedWidthInBytes * y) \\\n\t\t     + (x * (rfbScreen.bitsPerPixel / 8)));\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t    (*cl->translateFn)(cl->translateLookupTable, &rfbServerFormat,    \\\n\t\t\t       &cl->format, fbptr, (char *)clientPixelData,   \\\n\t\t\t       cl->scalingPaddedWidthInBytes, w, h);\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t    startUblen = cl->ublen;\t\t\t\t\t\t      \\\n\t    cl->updateBuf[startUblen] = 0;\t\t\t\t\t      \\\n\t    cl->ublen++;\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t    testColours##bpp(clientPixelData, w * h,\t\t\t      \\\n\t\t\t     &mono, &solid, &newBg, &newFg, cl);\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t    if (!validBg || (newBg != bg)) {\t\t\t\t      \\\n\t\tvalidBg = TRUE;\t\t\t\t\t\t      \\\n\t\tbg = newBg;\t\t\t\t\t\t      \\\n\t\tcl->updateBuf[startUblen] |= rfbHextileBackgroundSpecified;\t      \\\n\t\tPUT_PIXEL##bpp(bg);\t\t\t\t\t      \\\n\t    }\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t    if (solid) {\t\t\t\t\t\t      \\\n\t\tcl->rfbBytesSent[rfbEncodingZlibHex] += cl->ublen - startUblen;   \\\n\t\tcontinue;\t\t\t\t\t\t      \\\n\t    }\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t    cl->updateBuf[startUblen] |= rfbHextileAnySubrects;\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t    if (mono) {\t\t\t\t\t\t\t      \\\n\t\tif (!validFg || (newFg != fg)) {\t\t\t      \\\n\t\t    validFg = TRUE;\t\t\t\t\t      \\\n\t\t    fg = newFg;\t\t\t\t\t\t      \\\n\t\t    cl->updateBuf[startUblen] |= rfbHextileForegroundSpecified;   \\\n\t\t    PUT_PIXEL##bpp(fg);\t\t\t\t\t      \\\n\t\t}\t\t\t\t\t\t\t      \\\n\t    } else {\t\t\t\t\t\t\t      \\\n\t\tvalidFg = FALSE;\t\t\t\t\t      \\\n\t\tcl->updateBuf[startUblen] |= rfbHextileSubrectsColoured;\t      \\\n\t    }\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t    if (!subrectEncode##bpp(clientPixelData, w, h, bg, fg, mono, cl)) {   \\\n\t\tencodedBytes = -1;\t\t\t\t\t      \\\n\t    }\t\t\t\t\t\t\t\t      \\\n\t    else {\t\t\t\t\t\t\t      \\\n\t\tencodedBytes = cl->ublen - startUblen - 1;\t\t\t      \\\n\t    }\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t    if ( encodedBytes == -1 ) {\t\t\t\t\t      \\\n\t\t/* straight hextile failed, deal with raw data */\t      \\\n\t\tif ( w * h * (bpp/8) > VNC_ENCODE_ZLIBHEX_MIN_COMP_SIZE ) {   \\\n\t\t   /* rectangle large enough, zlib raw data */\t\t      \\\n\t\t   validBg = FALSE;\t\t\t\t\t      \\\n\t\t   validFg = FALSE;\t\t\t\t\t      \\\n\t\t   cl->ublen = startUblen;\t\t\t\t\t      \\\n\t\t   cl->updateBuf[cl->ublen++] = rfbHextileZlibRaw;\t\t      \\\n\t\t   (*cl->translateFn)(cl->translateLookupTable,\t\t      \\\n\t\t\t\t\t&rfbServerFormat, &cl->format, fbptr, \\\n\t\t\t\t\t(char *)clientPixelData,\t      \\\n\t\t\t\t\tcl->scalingPaddedWidthInBytes, w, h);  \\\n\t\t\t\t\t\t\t\t\t      \\\n\t\t   compressedSize = zlibCompress( (BYTE*) clientPixelData,    \\\n\t\t\t\t\t\t  (BYTE*) &cl->updateBuf[cl->ublen+2], \\\n\t\t\t\t\t\t  w * h * (bpp/8),\t      \\\n\t\t\t\t\t\t  (16*16+2)*(bpp/8)+20,\t      \\\n\t\t\t\t\t\t  cl,\t\t\t      \\\n\t\t\t\t\t\t  &(cl->compStreamRaw));      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t\t    card16ptr = (CARD16*) (&cl->updateBuf[cl->ublen]);\t\t      \\\n\t\t    *card16ptr = Swap16IfLE(compressedSize);\t\t      \\\n\t\t    cl->ublen += compressedSize + 2;\t\t\t      \\\n\t    \t}\t\t\t\t\t\t\t      \\\n\t\telse {\t\t\t\t\t\t\t      \\\n\t\t   /* rectangle was too small, use raw */\t\t      \\\n\t\t   validBg = FALSE;\t\t\t\t\t      \\\n\t\t   validFg = FALSE;\t\t\t\t\t      \\\n\t\t   cl->ublen = startUblen;\t\t\t\t\t      \\\n\t\t   cl->updateBuf[cl->ublen++] = rfbHextileRaw;\t\t\t      \\\n\t\t   (*cl->translateFn)(cl->translateLookupTable,\t\t      \\\n\t\t\t\t\t&rfbServerFormat, &cl->format, fbptr, \\\n\t\t\t\t\t(char *)clientPixelData,\t      \\\n\t\t\t\t\tcl->scalingPaddedWidthInBytes, w, h);  \\\n\t\t\t\t\t\t\t\t\t      \\\n\t\t    /* Extra copy protects against bus errors on RISC. */     \\\n\t\t    memcpy(&cl->updateBuf[cl->ublen], clientPixelData,\t      \\\n\t\t\t    w * h * (bpp/8));\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t\t    cl->ublen += w * h * (bpp/8);\t\t\t\t      \\\n\t    \t}\t\t\t\t\t\t\t      \\\n\t    }\t\t\t\t\t\t\t\t      \\\n\t    else {\t\t\t\t\t\t\t      \\\n\t\t/* straight hextile worked, deal with hextiled data */\t      \\\n\t\tif ( encodedBytes > (VNC_ENCODE_ZLIBHEX_MIN_COMP_SIZE * 2)) { \\\n\t\t   /* hex data large enough, zlib hex data */\t\t      \\\n\t\t   cl->ublen = startUblen;\t\t\t\t\t      \\\n\t\t   cl->updateBuf[cl->ublen++] |= rfbHextileZlibHex;\t\t      \\\n\t\t   memcpy( clientPixelData, &cl->updateBuf[cl->ublen], encodedBytes); \\\n\t\t\t\t\t\t\t\t\t      \\\n\t\t   compressedSize = zlibCompress( (BYTE*) clientPixelData,    \\\n\t\t\t\t\t\t  (BYTE*) &cl->updateBuf[cl->ublen+2], \\\n\t\t\t\t\t\t  encodedBytes,\t\t      \\\n\t\t\t\t\t\t  (16*16+2)*(bpp/8)+20,\t      \\\n\t\t\t\t\t\t  cl,\t\t\t      \\\n\t\t\t\t\t\t  &(cl->compStreamHex));      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t\t    card16ptr = (CARD16*) (&cl->updateBuf[cl->ublen]);\t\t      \\\n\t\t    *card16ptr = Swap16IfLE(compressedSize);\t\t      \\\n\t\t    cl->ublen += compressedSize + 2;\t\t\t      \\\n\t    \t}\t\t\t\t\t\t\t      \\\n\t\t   /* hex data too small, use as is */\t\t\t      \\\n\t    }\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t    cl->rfbBytesSent[rfbEncodingZlibHex] += cl->ublen - startUblen;\t      \\\n\t}\t\t\t\t\t\t\t\t      \\\n    }\t\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n    return TRUE;\t\t\t\t\t\t\t      \\\n}\n\n#define DEFINE_SUBRECT_ENCODE(bpp)\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\nstatic Bool\t\t\t\t\t\t\t\t      \\\nsubrectEncode##bpp(CARD##bpp *data, int w, int h, CARD##bpp bg,\t\t      \\\n\t\t   CARD##bpp fg, Bool mono, rfbClientPtr cl)\t\t      \\\n{\t\t\t\t\t\t\t\t\t      \\\n    CARD##bpp singleCL;\t\t\t\t\t\t\t      \\\n    int x,y;\t\t\t\t\t\t\t\t      \\\n    int i,j;\t\t\t\t\t\t\t\t      \\\n    int hx=0,hy,vx=0,vy;\t\t\t\t\t\t      \\\n    int hyflag;\t\t\t\t\t\t\t\t      \\\n    CARD##bpp *seg;\t\t\t\t\t\t\t      \\\n    CARD##bpp *line;\t\t\t\t\t\t\t      \\\n    int hw,hh,vw,vh;\t\t\t\t\t\t\t      \\\n    int thex,they,thew,theh;\t\t\t\t\t\t      \\\n    int numsubs = 0;\t\t\t\t\t\t\t      \\\n    int newLen;\t\t\t\t\t\t\t\t      \\\n    int nSubrectsUblen;\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n    nSubrectsUblen = cl->ublen;\t\t\t\t\t\t      \\\n    cl->ublen++;\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n    for (y=0; y<h; y++) {\t\t\t\t\t\t      \\\n\tline = data+(y*w);\t\t\t\t\t\t      \\\n\tfor (x=0; x<w; x++) {\t\t\t\t\t\t      \\\n\t    if (line[x] != bg) {\t\t\t\t\t      \\\n\t\tsingleCL = line[x];\t\t\t\t\t\t      \\\n\t\thy = y-1;\t\t\t\t\t\t      \\\n\t\thyflag = 1;\t\t\t\t\t\t      \\\n\t\tfor (j=y; j<h; j++) {\t\t\t\t\t      \\\n\t\t    seg = data+(j*w);\t\t\t\t\t      \\\n\t\t    if (seg[x] != singleCL) {break;}\t\t\t\t      \\\n\t\t    i = x;\t\t\t\t\t\t      \\\n\t\t    while ((seg[i] == singleCL) && (i < w)) i += 1;\t\t      \\\n\t\t    i -= 1;\t\t\t\t\t\t      \\\n\t\t    if (j == y) vx = hx = i;\t\t\t\t      \\\n\t\t    if (i < vx) vx = i;\t\t\t\t\t      \\\n\t\t    if ((hyflag > 0) && (i >= hx)) {\t\t\t      \\\n\t\t\thy += 1;\t\t\t\t\t      \\\n\t\t    } else {\t\t\t\t\t\t      \\\n\t\t\thyflag = 0;\t\t\t\t\t      \\\n\t\t    }\t\t\t\t\t\t\t      \\\n\t\t}\t\t\t\t\t\t\t      \\\n\t\tvy = j-1;\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t\t/* We now have two possible subrects: (x,y,hx,hy) and\t      \\\n\t\t * (x,y,vx,vy).  We'll choose the bigger of the two.\t      \\\n\t\t */\t\t\t\t\t\t\t      \\\n\t\thw = hx-x+1;\t\t\t\t\t\t      \\\n\t\thh = hy-y+1;\t\t\t\t\t\t      \\\n\t\tvw = vx-x+1;\t\t\t\t\t\t      \\\n\t\tvh = vy-y+1;\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t\tthex = x;\t\t\t\t\t\t      \\\n\t\tthey = y;\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t\tif ((hw*hh) > (vw*vh)) {\t\t\t\t      \\\n\t\t    thew = hw;\t\t\t\t\t\t      \\\n\t\t    theh = hh;\t\t\t\t\t\t      \\\n\t\t} else {\t\t\t\t\t\t      \\\n\t\t    thew = vw;\t\t\t\t\t\t      \\\n\t\t    theh = vh;\t\t\t\t\t\t      \\\n\t\t}\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t\tif (mono) {\t\t\t\t\t\t      \\\n\t\t    newLen = cl->ublen - nSubrectsUblen + 2;\t\t      \\\n\t\t} else {\t\t\t\t\t\t      \\\n\t\t    newLen = cl->ublen - nSubrectsUblen + bpp/8 + 2;\t      \\\n\t\t}\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t\tif (newLen > (w * h * (bpp/8)))\t\t\t\t      \\\n\t\t    return FALSE;\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t\tnumsubs += 1;\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t\tif (!mono) PUT_PIXEL##bpp(singleCL);\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t\tcl->updateBuf[cl->ublen++] = rfbHextilePackXY(thex,they);\t      \\\n\t\tcl->updateBuf[cl->ublen++] = rfbHextilePackWH(thew,theh);\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t\t/*\t\t\t\t\t\t\t      \\\n\t\t * Now mark the subrect as done.\t\t\t      \\\n\t\t */\t\t\t\t\t\t\t      \\\n\t\tfor (j=they; j < (they+theh); j++) {\t\t\t      \\\n\t\t    for (i=thex; i < (thex+thew); i++) {\t\t      \\\n\t\t\tdata[j*w+i] = bg;\t\t\t\t      \\\n\t\t    }\t\t\t\t\t\t\t      \\\n\t\t}\t\t\t\t\t\t\t      \\\n\t    }\t\t\t\t\t\t\t\t      \\\n\t}\t\t\t\t\t\t\t\t      \\\n    }\t\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n    cl->updateBuf[nSubrectsUblen] = numsubs;\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n    return TRUE;\t\t\t\t\t\t\t      \\\n}\n\n#define DEFINE_TEST_COLOURS(bpp)\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n/*\t\t\t\t\t\t\t\t\t      \\\n * testColours() tests if there are one (solid), two (mono) or more\t      \\\n * colours in a tile and gets a reasonable guess at the best background\t      \\\n * pixel, and the foreground pixel for mono.\t\t\t\t      \\\n */\t\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\nstatic void\t\t\t\t\t\t\t\t      \\\ntestColours##bpp(CARD##bpp *data, int size, Bool *mono, Bool *solid, CARD##bpp *bg, CARD##bpp *fg, rfbClientPtr cl) \\\n{\t\t\t\t\t\t\t\t\t      \\\n    CARD##bpp colour1 = 0, colour2 = 0;\t\t\t\t              \\\n    int n1 = 0, n2 = 0;\t\t\t\t\t\t\t      \\\n    *mono = TRUE;\t\t\t\t\t\t\t      \\\n    *solid = TRUE;\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n    for (; size > 0; size--, data++) {\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\tif (n1 == 0)\t\t\t\t\t\t\t      \\\n\t    colour1 = *data;\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\tif (*data == colour1) {\t\t\t\t\t\t      \\\n\t    n1++;\t\t\t\t\t\t\t      \\\n\t    continue;\t\t\t\t\t\t\t      \\\n\t}\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\tif (n2 == 0) {\t\t\t\t\t\t\t      \\\n\t    *solid = FALSE;\t\t\t\t\t\t      \\\n\t    colour2 = *data;\t\t\t\t\t\t      \\\n\t}\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\tif (*data == colour2) {\t\t\t\t\t\t      \\\n\t    n2++;\t\t\t\t\t\t\t      \\\n\t    continue;\t\t\t\t\t\t\t      \\\n\t}\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n\t*mono = FALSE;\t\t\t\t\t\t\t      \\\n\tbreak;\t\t\t\t\t\t\t\t      \\\n    }\t\t\t\t\t\t\t\t\t      \\\n\t\t\t\t\t\t\t\t\t      \\\n    if (n1 > n2) {\t\t\t\t\t\t\t      \\\n\t*bg = colour1;\t\t\t\t\t\t\t      \\\n\t*fg = colour2;\t\t\t\t\t\t\t      \\\n    } else {\t\t\t\t\t\t\t\t      \\\n\t*bg = colour2;\t\t\t\t\t\t\t      \\\n\t*fg = colour1;\t\t\t\t\t\t\t      \\\n    }\t\t\t\t\t\t\t\t\t      \\\n}\n\nDEFINE_SEND_ZLIBHEX(8)\nDEFINE_SUBRECT_ENCODE(8)\nDEFINE_TEST_COLOURS(8)\nDEFINE_SEND_ZLIBHEX(16)\nDEFINE_SUBRECT_ENCODE(16)\nDEFINE_TEST_COLOURS(16)\nDEFINE_SEND_ZLIBHEX(32)\nDEFINE_SUBRECT_ENCODE(32)\nDEFINE_TEST_COLOURS(32)\n"
  },
  {
    "path": "OSXvnc-server/zrle.cc",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n//\n\n//\n// zrle.cc\n//\n// Routines to implement Zlib Run-length Encoding (ZRLE).\n//\n\n#include <stdlib.h>\n#include <stdio.h>\nextern \"C\" {\n#include \"rfb.h\"\n}\n#include <rdr/MemOutStream.h>\n#include <rdr/ZlibOutStream.h>\n\n\n#define GET_IMAGE_INTO_BUF(tx,ty,tw,th,buf)                                \\\n  char *fbptr = (cl->scalingFrameBuffer + (cl->scalingPaddedWidthInBytes * ty) \\\n                 + (tx * (rfbScreen.bitsPerPixel / 8)));                   \\\n                                                                           \\\n  (*cl->translateFn)(cl->translateLookupTable, &rfbServerFormat,           \\\n                     &cl->format, fbptr, (char*)buf,                       \\\n                     cl->scalingPaddedWidthInBytes, tw, th);\n\n#define EXTRA_ARGS , rfbClientPtr cl\n\n#define BPP 8\n#include <zrleEncode.h>\n#undef BPP\n#define BPP 16\n#include <zrleEncode.h>\n#undef BPP\n#define BPP 32\n#include <zrleEncode.h>\n#define CPIXEL 24A\n#include <zrleEncode.h>\n#undef CPIXEL\n#define CPIXEL 24B\n#include <zrleEncode.h>\n#undef CPIXEL\n#undef BPP\n\n\n/*\n * rfbSendRectEncodingZRLE - send a given rectangle using ZRLE encoding.\n */\n\n/*\n * zrleBeforeBuf contains pixel data in the client's format.  It must be at\n * least one pixel bigger than the largest tile of pixel data, since the\n * ZRLE encoding algorithm writes to the position one past the end of the pixel\n * data.\n */\n\n/* These things must be inside the client record to be thread safe in OSXvnc\nWe #define them to minimize differences from the original source\n*/\n#define zrleBeforeBuf cl->client_zrleBeforeBuf\n#define ublen cl->ublen\n#define updateBuf cl->updateBuf\n\nBool rfbSendRectEncodingZRLE(rfbClientPtr cl, int x, int y, int w, int h)\n{\n    if (!cl->zrleData) {\n        cl->zrleData = new rdr::ZlibOutStream;\n        cl->mosData = new rdr::MemOutStream(2048);\n    }\nrdr::ZlibOutStream* zos = (rdr::ZlibOutStream*)cl->zrleData;\nrdr::MemOutStream* mos = (rdr::MemOutStream*)cl->mosData;\n    mos->clear();\n\n  switch (cl->format.bitsPerPixel) {\n\n  case 8:\n    zrleEncode8( x, y, w, h, mos, zos, zrleBeforeBuf, cl);\n    break;\n\n  case 16:\n    zrleEncode16(x, y, w, h, mos, zos, zrleBeforeBuf, cl);\n    break;\n\n  case 32:\n    bool fitsInLS3Bytes\n      = ((cl->format.redMax   << cl->format.redShift)   < (1<<24) &&\n         (cl->format.greenMax << cl->format.greenShift) < (1<<24) &&\n         (cl->format.blueMax  << cl->format.blueShift)  < (1<<24));\n\n    bool fitsInMS3Bytes = (cl->format.redShift   > 7  &&\n                           cl->format.greenShift > 7  &&\n                           cl->format.blueShift  > 7);\n\n    if ((fitsInLS3Bytes && !cl->format.bigEndian) ||\n        (fitsInMS3Bytes && cl->format.bigEndian))\n    {\n      zrleEncode24A(x, y, w, h, mos, zos, zrleBeforeBuf, cl);\n    }\n    else if ((fitsInLS3Bytes && cl->format.bigEndian) ||\n             (fitsInMS3Bytes && !cl->format.bigEndian))\n    {\n      zrleEncode24B(x, y, w, h, mos, zos, zrleBeforeBuf, cl);\n    }\n    else\n    {\n      zrleEncode32(x, y, w, h, mos, zos, zrleBeforeBuf, cl);\n    }\n    break;\n  }\n\n  cl->rfbRectanglesSent[rfbEncodingZRLE]++;\n  cl->rfbBytesSent[rfbEncodingZRLE] += (sz_rfbFramebufferUpdateRectHeader\n                                        + sz_rfbZRLEHeader + mos->length());\n\n  if (ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbZRLEHeader\n      > UPDATE_BUF_SIZE)\n    {\n      if (!rfbSendUpdateBuf(cl))\n        return FALSE;\n    }\n\n  rfbFramebufferUpdateRectHeader rect;\n  rect.r.x = Swap16IfLE(x);\n  rect.r.y = Swap16IfLE(y);\n  rect.r.w = Swap16IfLE(w);\n  rect.r.h = Swap16IfLE(h);\n  rect.encoding = Swap32IfLE(rfbEncodingZRLE);\n\n  memcpy(&updateBuf[ublen], &rect, sz_rfbFramebufferUpdateRectHeader);\n  ublen += sz_rfbFramebufferUpdateRectHeader;\n\n  rfbZRLEHeader hdr;\n\n  hdr.length = Swap32IfLE(mos->length());\n\n  memcpy(&updateBuf[ublen], &hdr, sz_rfbZRLEHeader);\n  ublen += sz_rfbZRLEHeader;\n\n  // copy into updateBuf and send from there.  Maybe should send directly?\n\n  for (int i = 0; i < mos->length();) {\n\n    size_t bytesToCopy = UPDATE_BUF_SIZE - ublen;\n\n    if (i + bytesToCopy > mos->length()) {\n      bytesToCopy = mos->length() - i;\n    }\n\n    memcpy(&updateBuf[ublen], (CARD8*)mos->data() + i, bytesToCopy);\n\n    ublen += bytesToCopy;\n    i += bytesToCopy;\n\n    if (ublen == UPDATE_BUF_SIZE) {\n      if (!rfbSendUpdateBuf(cl))\n        return FALSE;\n    }\n  }\n\n  return TRUE;\n}\n\n\nvoid FreeZrleData(rfbClientPtr cl)\n{\n    if (cl->zrleData) {\n        delete (rdr::ZlibOutStream*)cl->zrleData;\n        cl->zrleData = NULL;\n    }\n    if (cl->mosData) {\n        delete (rdr::MemOutStream*)cl->mosData;\n        cl->mosData = NULL;\n    }\n}\n\n"
  },
  {
    "path": "OSXvnc-server/zrleEncode.h",
    "content": "//\n// Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.\n//\n// This is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This software is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this software; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n// USA.\n\n//\n// zrleEncode.h - zrle encoding function.\n//\n// Before including this file, you must define a number of CPP macros.\n//\n// BPP should be 8, 16 or 32 depending on the bits per pixel.\n// GET_IMAGE_INTO_BUF should be some code which gets a rectangle of pixel data\n// into the given buffer.  EXTRA_ARGS can be defined to pass any other\n// arguments needed by GET_IMAGE_INTO_BUF.\n//\n// Note that the buf argument to ZRLE_ENCODE needs to be at least one pixel\n// bigger than the largest tile of pixel data, since the ZRLE encoding\n// algorithm writes to the position one past the end of the pixel data.\n//\n\n#include <rdr/OutStream.h>\n#include <assert.h>\n\nusing namespace rdr;\n\n/* __RFB_CONCAT2 concatenates its two arguments.  __RFB_CONCAT2E does the same\n   but also expands its arguments if they are macros */\n\n#ifndef __RFB_CONCAT2E\n#define __RFB_CONCAT2(a,b) a##b\n#define __RFB_CONCAT2E(a,b) __RFB_CONCAT2(a,b)\n#endif\n\n#ifdef CPIXEL\n#define PIXEL_T __RFB_CONCAT2E(rdr::U,BPP)\n#define WRITE_PIXEL __RFB_CONCAT2E(writeOpaque,CPIXEL)\n#define ZRLE_ENCODE __RFB_CONCAT2E(zrleEncode,CPIXEL)\n#define ZRLE_ENCODE_TILE __RFB_CONCAT2E(zrleEncodeTile,CPIXEL)\n#define BPPOUT 24\n#else\n#define PIXEL_T __RFB_CONCAT2E(rdr::U,BPP)\n#define WRITE_PIXEL __RFB_CONCAT2E(writeOpaque,BPP)\n#define ZRLE_ENCODE __RFB_CONCAT2E(zrleEncode,BPP)\n#define ZRLE_ENCODE_TILE __RFB_CONCAT2E(zrleEncodeTile,BPP)\n#define BPPOUT BPP\n#endif\n\n#ifndef ZRLE_ONCE\n#define ZRLE_ONCE\nstatic const int bitsPerPackedPixel[] = {\n  0, 1, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4\n};\n\n// The PaletteHelper class helps us build up the palette from pixel data by\n// storing a reverse index using a simple hash-table\n\nclass PaletteHelper {\npublic:\n  enum { MAX_SIZE = 127 };\n\n  PaletteHelper()\n  {\n    memset(index, 255, sizeof(index));\n    size = 0;\n  }\n\n  inline int hash(rdr::U32 pix)\n  {\n    return (pix ^ (pix >> 17)) & 4095;\n  }\n\n  inline void insert(rdr::U32 pix)\n  {\n    if (size < MAX_SIZE) {\n      int i = hash(pix);\n      while (index[i] != 255 && key[i] != pix)\n        i++;\n      if (index[i] != 255) return;\n\n      index[i] = size;\n      key[i] = pix;\n      palette[size] = pix;\n    }\n    size++;\n  }\n\n  inline int lookup(rdr::U32 pix)\n  {\n    assert(size <= MAX_SIZE);\n    int i = hash(pix);\n    while (index[i] != 255 && key[i] != pix)\n      i++;\n    if (index[i] != 255) return index[i];\n    return -1;\n  }\n\n  rdr::U32 palette[MAX_SIZE];\n  rdr::U8 index[4096+MAX_SIZE];\n  rdr::U32 key[4096+MAX_SIZE];\n  int size;\n};\n#endif\n\nvoid ZRLE_ENCODE_TILE (PIXEL_T* data, int w, int h, rdr::OutStream* os);\n\nvoid ZRLE_ENCODE (int x, int y, int w, int h, rdr::OutStream* os,\n                  rdr::ZlibOutStream* zos, void* buf\n                  EXTRA_ARGS\n                  )\n{\n  zos->setUnderlying(os);\n\n  for (int ty = y; ty < y+h; ty += rfbZRLETileHeight) {\n    int th = rfbZRLETileHeight;\n    if (th > y+h-ty) th = y+h-ty;\n    for (int tx = x; tx < x+w; tx += rfbZRLETileWidth) {\n      int tw = rfbZRLETileWidth;\n      if (tw > x+w-tx) tw = x+w-tx;\n\n      GET_IMAGE_INTO_BUF(tx,ty,tw,th,buf);\n\n      ZRLE_ENCODE_TILE((PIXEL_T*)buf, tw, th, zos);\n    }\n  }\n  zos->flush();\n}\n\n\nvoid ZRLE_ENCODE_TILE (PIXEL_T* data, int w, int h, rdr::OutStream* os)\n{\n  // First find the palette and the number of runs\n\n  PaletteHelper ph;\n\n  int runs = 0;\n  int singlePixels = 0;\n\n  PIXEL_T* ptr = data;\n  PIXEL_T* end = ptr + h * w;\n  *end = ~*(end-1); // one past the end is different so the while loop ends\n\n  while (ptr < end) {\n    PIXEL_T pix = *ptr;\n    if (*++ptr != pix) {\n      singlePixels++;\n    } else {\n      while (*++ptr == pix) ;\n      runs++;\n    }\n    ph.insert(pix);\n  }\n\n  //fprintf(stderr,\"runs %d, single pixels %d, paletteSize %d\\n\",\n  //        runs, singlePixels, ph.size);\n\n  // Solid tile is a special case\n\n  if (ph.size == 1) {\n    os->writeU8(1);\n    os->WRITE_PIXEL(ph.palette[0]);\n    return;\n  }\n\n  // Try to work out whether to use RLE and/or a palette.  We do this by\n  // estimating the number of bytes which will be generated and picking the\n  // method which results in the fewest bytes.  Of course this may not result\n  // in the fewest bytes after compression...\n\n  bool useRle = false;\n  bool usePalette = false;\n\n  int estimatedBytes = w * h * (BPPOUT/8); // start assuming raw\n\n  int plainRleBytes = ((BPPOUT/8)+1) * (runs + singlePixels);\n\n  if (plainRleBytes < estimatedBytes) {\n    useRle = true;\n    estimatedBytes = plainRleBytes;\n  }\n\n  if (ph.size < 128) {\n    int paletteRleBytes = (BPPOUT/8) * ph.size + 2 * runs + singlePixels;\n\n    if (paletteRleBytes < estimatedBytes) {\n      useRle = true;\n      usePalette = true;\n      estimatedBytes = paletteRleBytes;\n    }\n\n    if (ph.size < 17) {\n      int packedBytes = ((BPPOUT/8) * ph.size +\n                         w * h * bitsPerPackedPixel[ph.size-1] / 8);\n\n      if (packedBytes < estimatedBytes) {\n        useRle = false;\n        usePalette = true;\n        estimatedBytes = packedBytes;\n      }\n    }\n  }\n\n  if (!usePalette) ph.size = 0;\n\n  os->writeU8((useRle ? 128 : 0) | ph.size);\n\n  for (int i = 0; i < ph.size; i++) {\n    os->WRITE_PIXEL(ph.palette[i]);\n  }\n\n  if (useRle) {\n\n    PIXEL_T* ptr = data;\n    PIXEL_T* end = ptr + w * h;\n    PIXEL_T* runStart;\n    PIXEL_T pix;\n    while (ptr < end) {\n      runStart = ptr;\n      pix = *ptr++;\n      while (*ptr == pix && ptr < end)\n        ptr++;\n      ssize_t len = ptr - runStart;\n      if (len <= 2 && usePalette) {\n        int index = ph.lookup(pix);\n        if (len == 2)\n          os->writeU8(index);\n        os->writeU8(index);\n        continue;\n      }\n      if (usePalette) {\n        int index = ph.lookup(pix);\n        os->writeU8(index | 128);\n      } else {\n        os->WRITE_PIXEL(pix);\n      }\n      len -= 1;\n      while (len >= 255) {\n        os->writeU8(255);\n        len -= 255;\n      }\n      os->writeU8(len);\n    }\n\n  } else {\n\n    // no RLE\n\n    if (usePalette) {\n\n      // packed pixels\n\n      assert (ph.size < 17);\n\n      int bppp = bitsPerPackedPixel[ph.size-1];\n\n      PIXEL_T* ptr = data;\n\n      for (int i = 0; i < h; i++) {\n        U8 nbits = 0;\n        U8 byte = 0;\n\n        PIXEL_T* eol = ptr + w;\n\n        while (ptr < eol) {\n          PIXEL_T pix = *ptr++;\n          U8 index = ph.lookup(pix);\n          byte = (byte << bppp) | index;\n          nbits += bppp;\n          if (nbits >= 8) {\n            os->writeU8(byte);\n            nbits = 0;\n          }\n        }\n        if (nbits > 0) {\n          byte <<= 8 - nbits;\n          os->writeU8(byte);\n        }\n      }\n    } else {\n\n      // raw\n\n#ifdef CPIXEL\n      for (PIXEL_T* ptr = data; ptr < data+w*h; ptr++) {\n        os->WRITE_PIXEL(*ptr);\n      }\n#else\n      os->writeBytes(data, w*h*(BPP/8));\n#endif\n    }\n  }\n}\n\n#undef PIXEL_T\n#undef WRITE_PIXEL\n#undef ZRLE_ENCODE\n#undef ZRLE_ENCODE_TILE\n#undef BPPOUT\n"
  },
  {
    "path": "OSXvnc.html",
    "content": "<!DOCTYPE HTML>\n\n<html lang=\"en\">\n<head>\n<title>OSXvnc FAQ</title>\n<meta name=title content=\"OSXvnc FAQ\">\n<meta name=Keywords content=\"OSX vnc OSXvnc FAQ\">\n<meta http-equiv=Content-Type content=\"text/html; charset=utf-8\">\n\n<style>\n\n.content {\n\tfont-family: Verdana, Arial, Helvetica, sans-serif;\n\tfont-size: 11px;\n\tfont-style: normal;\n\tline-height: 14pt;\n\tcolor: #333333;\n}\n.headline {\n\tfont-family: Verdana, Arial, Helvetica, sans-serif;\n\tfont-size: 12pt;\n\tfont-style: normal;\n\tline-height: 18pt;\n\tcolor: #333333;\n}\n\ncode {\n\tfont-family:Courier\n\tfont-size: 11px;\n\tfont-style: normal;\n\tline-height: 14pt;\n}\n\na:link {color: #ff6600;}\na:visited {color: #669900;}\na:hover {color: #cc3300;}\n\n</style>\n</head>\n\n<body style='tab-interval:.5in'>\n\n<div class=Section1>\n\n<p style='text-align:center'>&nbsp;</p>\n\n<div>\n\n<table style='margin-left:auto; margin-right:auto;\n border-collapse:collapse; mso-padding-alt:0in 5.4pt 0in 5.4pt'>\n <tr style='height:64.75pt'>\n  <td style='width:113.45pt;padding:0in 5.4pt 0in 5.4pt;\n  height:64.75pt'>\n  <img alt=\"OSXvnc icon\" width=96 height=95 src=\"OSXvnc.jpg\">\n  </td>\n  <td style='padding:0in 5.4pt 0in 5.4pt; height:64.75pt'>\n  <p style='text-align:center'><span\n  style='font-size:22.0pt'>OSXvnc 1.71</span></p>\n\n  <p style='text-align:center;font-size:12.0pt'>Frequently Asked Questions</p>\n  <p style='text-align:center'>(Last Modified: 26 January 2006)</p>\n  </td>\n </tr>\n</table>\n\n</div>\n\n<div style='border:solid windowtext .5pt;padding:1.0pt 31.0pt 1.0pt 31.0pt'>\n\n<p><span style='font-size:12.0pt;font-family:\"Times New Roman\";color:black'>\nOSXvnc is provided by Redstone Software for use with <span style=\"color:#9f81bd\"><B>Eggplant: The solution for cross-platform automation and testing</B></span><br>\nFor the latest information on\nOSXvnc, including the latest FAQ, please visit: </span><span style='font-size:14.0pt;font-family:\"Times New Roman\";\ncolor:#3366CC'><u><a href=\"http://www.redstonesoftware.com/osxvnc\">http://www.redstonesoftware.com/osxvnc</a></u></span><BR><BR>\nFor additional information not covered in this FAQ please visit: <a href=\"http://faq.gotomyvnc.com\">http://faq.gotomyvnc.com</a>\n</p>\n\n<p><b><A id=VNC>Q: What is VNC?</a></b></p>\n<p><b>A: </b>\nVNC stands for Virtual Network Computing. It is remote control software which allows you to view and interact with one computer (the \"server\") using a simple program (the \"viewer\") on another computer anywhere on the Internet. The two computers don't even have to be the same type, so for example you can use VNC to view and control a MacOS X machine at home on your Windows machine at the office. VNC is freely and publicly available and is in widespread active use by millions.<BR></P>\n\n<p><b><A id=Why>Q: What is <span style=\"color:#9f81bd\"><B>Eggplant</B></span>? Why does Redstone Software provide OSXvnc?</a></b></p>\n<p><b>A: </b>\nIf you've ever thought that it would be convenient to generate scripts that could interact with a remote VNC machine through the interface exactly the way a user can - then that's what Eggplant is!  It's a powerful tool for cross-platform automation and testing.  If you are interested in learning more about it, please visit <a href=http://www.redstonesoftware.com/technology.html>Redstone Software</a>.</p>\n\n<p><b><A id=Clients>Q: OSXvnc only contains a server, where's the client to connect to my machine?</a></b></p>\n<p><b>A: </b>That's right - OSXvnc is only a server.  There are a number of VNC Clients available for OS X, we recommend these:\n<BR><a href=\"http://cotvnc.sourceforge.net/\" target=\"_blank\">Chicken Of The VNC</a>\n<BR><a href=\"http://www.mdimension.com/cgi-bin/WebObjects/MDTWebsite.woa/1/wa/viewPage?pageName=Software\" target=\"_blank\">VNCDimension</a>\n<BR><a href=\"http://www.redstonesoftware.com/Download/VNCThing2.2.sit\" target=\"_blank\">VNCThing (also supports MacOS 8/9)</a>\n</p>\n\n<p><b><A id=Firewall>Q: OSXvnc is running but I can't connect to it/How do I configure my Firewall to allow OSXvnc?</a></b></p>\n\n<p><b>A: </b>If you don't see anything in the OSXvnc log then your network isn't allowing the connection.  The most likely cause of this is that your MaxOS X machine is running the built-in firewall.  You can configure the firewall to allow port 5900 (or whichever port VNC is running on). Using the System Preferences application go to Sharing and then Firewall. On that panel, \"Add..\" another service for port 5900 and call it VNC</p>\n\n<p><b><A id=External>Q: How can I connect to my home machine from outside my home/across the internet?</a></b></p>\n\n<p><b>A: </b>First, if your machine is behind a device that does NAT like a Firewall, Router or Cable/DSL modem then please read the following FAQ.  If not, then you need to get the IP address of your computer.  It will be shown in the System Preferences application under Network and will consist of four numbers with dots between them.  In your VNC client just use this number to connect to your computer from an external network.  You can also go to this handy link from the machine running OSXvnc to verify the IP address: <a href=http://www.gotomyvnc.com/ target=_blank>http://www.gotomyvnc.com</a><BR>\n</p>\n\n<p><b><A id=NAT>Q: How can I connect to a machine that is behind a Cable/DSL Modem or NAT Firewall?</a></b></p>\n\n<p><b>A: </b>When working through a network address translation (NAT) device like a Cable/DSL Modem, Router, or Firewall you will need to setup \"Port Forwarding\" on the device to forward the VNC port (5900 by default) from that device to the internal IP address of the machine running OSXvnc (the internal IP will look like 192.168.X.X, 10.X.X.X, or 127.0.0.X). For further details on setting up port forwarding please read your device's documentation or refer to the following helpful website: <a href=http://www.portforward.com/ target=_blank>http://www.portforward.com</a>.<BR><BR>\nNot all devices offer port forwarding, for those that do not, you can set your Mac to be the designated DMZ host for the NAT but this has the effect of forwarding ALL ports from the internet to your Macintosh.  If you need to go this route we highly recommend you <a href=#Firewall>enable the Firewall on your MacOS X machine and ONLY allow port 5900 to pass through</a>.<BR><BR>\nOnce the port for VNC has been directed toward your Macintosh you should be able to connect via an external VNC client to your Network's External (or WAN) IP address.  This number will be substantially different from the internal IP of your computer and can usually be found by looking at the modem configuration information or else by visiting this handy page from the machine running OSXvnc to get your IP and check your VNC access: <a href=http://www.gotomyvnc.com/ target=_blank>http://www.gotomyvnc.com</a>\n</p>\n\n<p><b><A id=MultipleSessions>Q: Can I setup OSXvnc to allow a remote user to work in his own desktop without disrupting the user at the machine(like X-Windows)?</A></b></p>\n\n<p><b>A: </b>Yes, if you are using MacOS 10.4 (TIGER).  Please read this separate guide on <a href=http://www.redstonesoftware.com/multidesktop.html>Multiple Desktop Sessions on MacOS 10.4 - TIGER</A>.</p>\n\n<p><b><A id=IncompatibleVersion>Q: Why am I getting an \"Incompatible Version\" error message when I attempt to connect to OSXvnc?</a></b></p>\n\n<p><b>A: </b>The problem is that you aren't connecting to OSXvnc but instead are connecting to the Apple Remote Desktop agent, which also runs on port 5900.<BR>\n<BR>\nWe recommend that you disable ARD by unchecking it in the System Preferences -> Sharing -> Services panel.  Alternatively, you can connect to OSXvnc on a different port.  It is probably running on port 5901 if it found a conflict on port 5900.\n</p>\n\n<p><b><A id=APE>Q: The OSXvnc application launches fine the first time but after that it just bounces in the Dock and never launches?</A></b></p>\n\n<p><b>A: </b>This is most likely because you are running APE from unsanity.org.  In some situations APE can corrupt the OSXvnc bundle to the point where it can no longer function.  Try adding the OSXvnc application to the \"exclude\" list in the Ape Manager preference pane and re-installing OSXvnc. If that does not solve your problem please contact support at <a href=mailto:urgent@unsanity.org>urgent@unsanity.org</A>.\n</p>\n\n<p><b><A id=BindSocket>Q: When I start OSXvnc it stops immediately with the error: \"Unable to Bind Socket\"?</a></b></p>\n\n<p><b>A: </b>This means that OSXvnc can't listen on the specified port, this is almost always because another VNC is already listening, often because OSXvnc has already been set as a startup item.  You can check to see with the following Terminal command:<BR>\n<code>ps -auxwww | grep -i '[v]nc'</code><BR>\nIf this reports anything then vnc is probably already running, if it's another instance of OSXvnc read the FAQ <I>\"I've setup OSXvnc as a Startup item, how can I turn it off\"</I> for instructions on how to stop it.<BR>\nKeep in mind that if you are running Apple Remote Desktop 2.0 that it WILL use port 5900 and prevent OSXvnc from using that port, please choose a different port for OSXvnc.</p>\n\n<p><b><A id=International>Q: I am using an\nInternational keyboard (or keyboard layout) and the characters don't come up\nappropriately.</a></b></p>\n\n<p><b>A: </b>Currently OSXvnc doesn't handle this as well as we\nwould like. Part of the problem is that if both the remote and local users are\nusing an international keyboard layout the keystrokes actually get\ndouble-corrected, thus producing the standard US keys. Try setting one of the\nkeyboards back to US; this works a bit better.</p>\n\n\n<p><b><A id=Uninstall>Q: How do I uninstall OSXvnc?</A></b></p>\n\n<p><b>A: </b>Normally you can just move the entire OSXvnc application into your trash.<BR>\nHowever, if you've configured OSXvnc as a Startup Item (so that it launches at boot time) we recommend that you use the \"Disable Startup Item\" button on the Startup Tab for OSXvnc first.  Alternatively, you can remove the /Library/StartupItems/OSXvnc folder in addition to the OSXvnc application and then reboot.\n</p>\n\n<p><b><A id=Performance>Q: I'm connecting to a system using VNC and it's not very fast, how can I improve the refresh rate/performance of OSXvnc?</a></b></p>\n\n<p><b>A: </b>One thing you can do is look at your selected encoding, you don't always want to choose the strongest one, it takes more CPU time on the VNC server and VNC client machine.  We've found that for a LAN you are actually better off with Hextile, Zlib (Raw) or Zlib (Hextile) than the stronger compressions ZRLE and Tight (which are better over low bandwidth).  This can very based on your machines as well, if they are G5's go ahead with the stronger encodings. G3's are very slow machines at this point for both clients and servers and so VNC is pretty slow on these no matter what you do, in a LAN environment you might even consider going with RAW (no encoding) for these machines.\n<BR><BR>\nAlso, keep in mind that MacOS X uses a LOT of colors, more than some operating systems, there is shading and coloring going on in places you wouldn't even notice, but it's there.  As just an example, if you have font smoothing set for a flat panel monitor your \"Black\" letters actually have red on one side and blue on the other(<a href=http://www.redstonesoftware.com/osxvnc/AAExample.jpg target=\"_blank\">illustrated here</A>), this is much harder on VNC than just two pixel colors. You can improve this by launching System Preferences, going to the \"Appearance\" tab and setting your font smoothing to Standard.\n<BR><BR>\nAnother factor which many people ignore is the desktop background,  Apple ships with a number of lovely backgrounds but they have millions of colors, so each time your desktop is exposed VNC has to resend that part of the intensive image.  Instead set your background to the monotone white, grey or black, which is fast for VNC to send.\n</p>\n\n<!--\n<p><b><A id=Clients>Q: I just download OSXvnc 1.61 and it's using up all my CPU cycles!<a></b></p>\n\n<p><b>A: </b>Unfortunately, the original file of OSXvnc 1.61 uploaded to Sourceforge on 8/9/05 was corrupt in that it will consume spare CPU cycles while it is running.  We greatly regret this error and apologize for any inconvenience it may have caused.<BR><BR>\nYou may use this link to be sure to get a clean build that does not cause this problem:<BR>\n<a href=http://prdownloads.sourceforge.net/osxvnc/OSXvnc1.6.1.dmg?download>http://prdownloads.sourceforge.net/osxvnc/OSXvnc1.6.1.dmg?download</A><BR>\n<BR>\n</p>\n-->\n\n<p><b><A id=TIGER>Q: I've configured OSXvnc as a Startup using the latest 10.4 TIGER and it isn't starting up?</a></b></p>\n\n<p><b>A: </b>It's a permissions problem that is addressed in version 1.5 of OSXvnc.  We rcommend updating to the latest OSXvnc.<BR></p>\n\n<p><b><A id=CLI>Q: How can I start up OSXvnc from a command line?</A></b></p>\n\n<p><b>A: </b> To startup OSXvnc from command line, go inside the Application\ndirectory(OSXvnc.app) and launch the OSXvnc-server process.<span\nstyle=\"mso-spacerun: yes\">&nbsp; </span>To change parameters you will need to\ngive it arguments (-rfbport to set port, -vncauth to specify a password file,\netc).<span style=\"mso-spacerun: yes\">&nbsp; </span>For usage run the command\nwith -help. For example:<BR>\n<code>\n/Applications/OSXvnc.app/osxvnc-server -rfbport 5901\n</code>\n</p>\n\n<p><b><A id=FUS>Q: I'm using 10.3 (Panther) and when I do a Fast User Switch I'm no longer able to control the remote machine.</A></b></p>\n\n<p><b>A: </b>This is a known bug in Apple's control API.  It was probably designed with security in mind and attempts to work past it by allowing authentication, etc have not been successful.  We hope to discuss this problem with Apple and have a good solution in the future.  In the meantime, you must switch back to the original user or else launch a new server, perhaps via command line, to connect to.</p>\n\n<p><b><A id=encodings>Q: What encodings does OSXvnc support?</a></b></p>\n\n<p class=MsoNormal style='border:none;mso-border-alt:solid windowtext .5pt;\npadding:0in;mso-padding-alt:1.0pt 31.0pt 1.0pt 31.0pt'><b>A: </b><span\nstyle='font-weight:normal'>As far as we are aware OSXvnc supports all known encodings for VNC except ULTRA.  This includes Raw, RRE, CoRRE, Hextile, Zlib (Full), Zlib (Hextile), ZRLE, and Tight (with optional JPEG).  If you have a problem with any of these encodings or know of other encodings that we should support please send us an email.</span></p>\n\n<p><b><A id=OS9>Q: OSXvnc is only for MacOS X, what about MacOS 9?</A></b></p>\n\n<p><b>A: </b>\nFor a MacOS 9 VNC client please use, <a href=\"http://www.redstonesoftware.com/Download/VNCThing2.2.sit\" target=\"_blank\">VNCThing</a>.<BR>For a MacOS 9 VNC server Redstone Software also offers OS9vnc, it can be downloaded here:<BR><a href=\"http://www.redstonesoftware.com/Download/OS9vnc.sit\" target=\"_blank\">http://www.redstonesoftware.com/Download/OS9vnc.sit</a><BR>\nNOTE: At this time closing the OS9vnc log window will shutdown the server - please leave the log window running.<BR></p>\n\n<p><b><A id=NoDisplay>Q: When trying to launch OSXvnc command line it fails with the error \"kCGErrorIllegalArgument : initCGDisplayState: cannot map display interlocks\" (MacOS 10.1 and 10.2) or it fails with the error \"kCGErrorRangeCheck : Window Server communications from outside of session allowed for root and console user only\" (MacOS 10.3 and MacOS 10.4)</A>.</b></p>\n\n<p><b>A: </b>This happens if you try to launch as an unprivileged user. A privileged user is either the user who is currently logged into the GUI or the ROOT user.  Try launching the server using the sudo command (or configuring the application to autostart using the system startup item).</p>\n\n<p><b><A id=Browser_WebServer>Q: How can I connect to OSXvnc using a web browser?<BR>Q: Is there a Web Server with OSXvnc or a Java applet integrated into OSXvnc?</A></b></p>\n\n<p><b>A: </b>The way this works is that you connect to a webserver which then serves the Java Applet to your browser, allowing you to connect without a stand-alone client.  This isn't available directly within OSXvnc.  Instead you can perform the following steps:</p>\n<OL>\n<LI>Downloading a VNC Client Java applet. We didn't port the Java applet, but a copy of it can be <a href=\"http://www.redstonesoftware.com/osxvnc/vncjava.tgz\">downloaded here</a>.</LI>\n<LI>Put that directory it in your user's \"Sites\" directory.</LI>\n<LI>Note: You may need to modify the vncjava/index.html file to match the port number and other configurable settings.</li>\n<LI>Enable web serving on your machine (System Preferences->Sharing, check \"Personal Web Sharing\").</LI>\n<LI>Access the Java applet using a URL like http://MACHINE'S_IP/~USERNAME/vncjava/</LI>\n</OL>\n\n<p><b><A id=x2vnc>Q: I'm using x2vnc or win2vnc and it seems slow.  Is there a way to run OSXvnc without the slowdown from having the screen updates sent?</A></b></p>\n\n<p><b>A: </b>Version 1.61 and above should be better with *2vnc type clients.  We also highly recommend using <a href=http://www.enigmarelle.com/broadbandoptimizer.py target=_blank>Broadband Optimizer</a> to optimize your network traffic.<BR>\nAdditionally, we have had good luck running OSXvnc with <a href=http://www.opendarwin.org/projects/osx2x/ target=_blank>osx2x</a> running against OSXvnc 1.5 on a 10.3 machine.</p>\n\n<p><b><A id=SSH>Q: How can I have my\nconnection to OSXvnc tunnel through SSH?</A></b></p>\n\n<p><b>A: </b>Since MacOS X ships with SSH support built in this is\npretty easy.<span style=\"mso-spacerun: yes\">&nbsp; </span>First you will want\nto make sure your VNC machine has SSH running. You can turn this on in the\nSystem Preferences -&gt; Sharing Panel by checking the box for &quot;Remote\nLogin&quot;.<span style=\"mso-spacerun: yes\">&nbsp; </span>Then you need an SSH\nclient on the machine you want to connect from (again, it's there by default on\nMacOS X). For the rest of the instructions read the VNC page <a\nhref=\"http://www.cl.cam.ac.uk/Research/DTG/attarchive/vnc/sshvnc.html\">http://www.cl.cam.ac.uk/Research/DTG/attarchive/vnc/sshvnc.html</a><b>.\n</b><span style='font-weight:normal'><BR>If you use the \"-localhost\" option in\nOSXvnc you will need to literally specify \"127.0.0.1\" when you make your ssh\nport forwarding call, like this example:<br>\n<code>\nssh -L 5905:127.0.0.1:5900 mydomain.com\n</code><BR>\nNOTE: In MacOS 10.3 (Panther) and above localhost is defined as it's IPv6 version - this doesn't work for VNC so specify 127.0.0.1\n</span><b></b></p>\n\n<p><b><A id=MultipleMonitors>Q: Does OSXvnc support multiple displays?</A></b></p>\n\n<p><b>A: </b>Officially OSXvnc does not support multiple monitors at this time, it is on our list of future enhancements.<BR>We do have a BETA feature for view only on displays besides the primary display.   This feature is available only from command line.  If you launch OSXvnc with the arguments<BR><code>\"-disableRemoteEvents -display\" #displayNumber#<BR></code> then that VNC server will serve the display associated with that number, starting at 0 for the primary display.  Unfortunately you must disable events because the event translation logic has not yet been added.</p>\n\n<p><b><A id=Headless>Q: I'm running a headless MacOS X machine and OSXvnc doesn't work.</A></b></p>\n\n<p><b>A: </b>When MacOS X starts up on older systems it will disable certain video functions when no monitor is plugged in. We are looking at ways to solve this in OSXvnc, but for the time being you can\npurchase a dongle that makes the MacOS X machine think that a monitor is plugged\nin.&nbsp;&nbsp;<BR><a href=\"http://www.drbott.com/prod/db.lasso?code=0101-GHED\">Dr\nBott has one called gHEAD available here</a>.</p>\n\n<p><b><A id=StartupItem>Q: How can I setup\nOSXvnc as a boot-time Startup Itme without needing a user logged in?</A></b></p>\n\n<p><b>A: </b>OSXvnc 1.3 and above can setup this mode for you.  Please go to the \"Startup\" panel and press the \"Setup Startup Item\" button.  You will need to authenticate as a user with privilege to administer the machine.  Once you have, OSXvnc will set itself to start up the next time your machine boots.  In this mode you don't need to launch the GUI application, the server will be running all the time.<BR>\nIf you want to do it by hand you will need to copy the OSXvnc.app/Contents/Resources/OSXvnc folder into /Library/StartupItems and then modify the OSXvnc file by hand.<BR>\n<B>NOTE:</B> Due to Apple security restrictions VNC clients will NOT have access to the pasteboard (Cut&Paste) of the MacOS X machine.\n</p>\n\n<p><b><a id=DisableStartup>Q: I've setup OSXvnc as a Startup item, how can I turn it off?</A></b></p>\n\n<p><b>A: </b>Starting with 1.32 the GUI can do this for you on the Startup tab.  If you want to turn it off temporarily but have it continue to startup then you want to issue the following command:<BR>\n<code>sudo /Library/StartupItems/OSXvnc/OSXvnc stop</code><BR>\nIf you want to stop OSXvnc from starting up automatically any longer you can also remove the startup directory.  This command will do that:<BR>\n<code>sudo rm -rf /Library/StartupItems/OSXvnc</code><BR>\n</p>\n\n<p><b><A id=Executables>Q: Where are the storepasswd and OSXvnc-server executables?</A></b></p>\n\n<p><b>A: </b> The OSXvnc-server and storepasswd executables are\nnow stored in the /Contents/MacOS directory. This\nprevents the GUI from launching a second dock icon when they are executed.</p>\n\n<p><b><A id=Logout>Q: I've set up OSXvnc as a boot-time Startup Item but when a user logs out it breaks the server.</A></b></p>\n\n<p><b>A: </b>This should be fixed with the 1.11 version of the startup\nscript so that at least the server restarts.<span style=\"mso-spacerun: yes\">&nbsp; </span>This is a workaround for a behavior in MacOS X that kills all user processes when a user logs out.</p>\n\n<p><b><A id=Source>Q: OSXvnc is open source, so....where's the source?</A></b></p>\n\n<p><b>A: </b>Our source code is available at Sourceforge via CVS. Please try it at: <a\nhref=\"http://sourceforge.net/projects/osxvnc/\">http://sourceforge.net/projects/osxvnc</a><b>.</b></p>\n\n<p><b><A id=Future>Q: What are you looking at adding for future versions?</A></b></p>\n\n<p><b>A: </b>Outside of bugs fixes, on our list at the moment (in some rough approximation of order) are...</p>\n<UL>\n<LI>Adding an indicator when users are connected</LI>\n<LI>Improving International Keyboard support</LI>\n<LI>Adding support for Multiple Monitor Support</LI>\n<LI>Improving Startup Item (System Prefs Pane, fixing Pasteboards, and the shutdown on logout thing)</LI>\n</UL>\n\n<p><b><A id=Developer>Q: I'm a developer and would like to help with OSXvnc.</A></b></p>\n\n<p><b>A: </b>Great!&nbsp;Please send email to <a href=\"mailto:%20osxvnc@redstonesoftware.com\">osxvnc@redstonesoftware.com</a>.</p>\n\n</div>\n\n</div>\n\n</body>\n\n</html>\n"
  },
  {
    "path": "OSXvnc.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 47;\n\tobjects = {\n\n/* Begin PBXAggregateTarget section */\n\t\tABA30D3D15BEE7310001BAE5 /* Vine Server Package */ = {\n\t\t\tisa = PBXAggregateTarget;\n\t\t\tbuildConfigurationList = ABA30D4215BEE7670001BAE5 /* Build configuration list for PBXAggregateTarget \"Vine Server Package\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tABA30D3C15BEE7310001BAE5 /* Build DMG */,\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\tABA30D4115BEE7490001BAE5 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"Vine Server Package\";\n\t\t\tproductName = \"Vine Server Package\";\n\t\t};\n/* End PBXAggregateTarget section */\n\n/* Begin PBXBuildFile section */\n\t\t9199995B0B1135FF0099EA7A /* getMACAddress.c in Sources */ = {isa = PBXBuildFile; fileRef = 919999430B11348E0099EA7A /* getMACAddress.c */; };\n\t\tAB25D81F08686B520065843D /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = F57BB467027E036F014B5D3F /* Credits.rtf */; };\n\t\tAB25D82008686B520065843D /* Vine Server Release Notes.rtf in Resources */ = {isa = PBXBuildFile; fileRef = AB541C2907A0264F00B63668 /* Vine Server Release Notes.rtf */; };\n\t\tAB25D82108686B520065843D /* Copying.rtf in Resources */ = {isa = PBXBuildFile; fileRef = AB541C3B07A0273500B63668 /* Copying.rtf */; };\n\t\tAB25D82208686B520065843D /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = ABD7FE7E07AFF8B4004D0B81 /* Localizable.strings */; };\n\t\tAB25D82608686B520065843D /* OSXvnc in Resources */ = {isa = PBXBuildFile; fileRef = ABCCC8B203D9C60A00A80117 /* OSXvnc */; };\n\t\tAB25D82A08686B520065843D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };\n\t\tAB25D82B08686B520065843D /* VNCController.m in Sources */ = {isa = PBXBuildFile; fileRef = F5456A2802FAD08901A80117 /* VNCController.m */; };\n\t\tAB25D82E08686B520065843D /* NSAuthorization.m in Sources */ = {isa = PBXBuildFile; fileRef = ABD8EC08058A0BD600C84739 /* NSAuthorization.m */; };\n\t\tAB25D83008686B520065843D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };\n\t\tAB25D83108686B520065843D /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABEE28F804C8745B00A80117 /* Security.framework */; };\n\t\tAB25D895086870420065843D /* auth.c in Sources */ = {isa = PBXBuildFile; fileRef = F538E01002F9812901A80186 /* auth.c */; };\n\t\tAB25D896086870430065843D /* corre.c in Sources */ = {isa = PBXBuildFile; fileRef = F538E01302F9812901A80186 /* corre.c */; };\n\t\tAB25D897086870430065843D /* cutpaste.c in Sources */ = {isa = PBXBuildFile; fileRef = F538E01402F9812901A80186 /* cutpaste.c */; };\n\t\tAB25D898086870440065843D /* dimming.c in Sources */ = {isa = PBXBuildFile; fileRef = F538E01502F9812901A80186 /* dimming.c */; };\n\t\tAB25D899086870460065843D /* VNCServer.m in Sources */ = {isa = PBXBuildFile; fileRef = F58DDDE8056A861001A8015E /* VNCServer.m */; };\n\t\tAB25D89A086870490065843D /* mousecursor.c in Sources */ = {isa = PBXBuildFile; fileRef = F5C9A8F1038C6F5D01A80117 /* mousecursor.c */; };\n\t\tAB25D89B0868704A0065843D /* hextile.c in Sources */ = {isa = PBXBuildFile; fileRef = F538E01602F9812901A80186 /* hextile.c */; };\n\t\tAB25D89C0868704B0065843D /* kbdptr.c in Sources */ = {isa = PBXBuildFile; fileRef = F538E03502F9812901A80186 /* kbdptr.c */; };\n\t\tAB25D89E0868704C0065843D /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = F538E10E02F9812C01A80186 /* main.c */; };\n\t\tAB25D89F0868704C0065843D /* miregion.c in Sources */ = {isa = PBXBuildFile; fileRef = F538E11002F9812C01A80186 /* miregion.c */; };\n\t\tAB25D8A00868704D0065843D /* rfbserver.c in Sources */ = {isa = PBXBuildFile; fileRef = F538E11502F9812C01A80186 /* rfbserver.c */; };\n\t\tAB25D8A10868704E0065843D /* rre.c in Sources */ = {isa = PBXBuildFile; fileRef = F538E11602F9812C01A80186 /* rre.c */; };\n\t\tAB25D8A20868704E0065843D /* sockets.c in Sources */ = {isa = PBXBuildFile; fileRef = F538E11702F9812C01A80186 /* sockets.c */; };\n\t\tAB25D8A30868704F0065843D /* stats.c in Sources */ = {isa = PBXBuildFile; fileRef = F538E11802F9812C01A80186 /* stats.c */; };\n\t\tAB25D8A5086870530065843D /* tight.c in Sources */ = {isa = PBXBuildFile; fileRef = F538E11D02F9812C01A80186 /* tight.c */; };\n\t\tAB25D8A6086870540065843D /* translate.c in Sources */ = {isa = PBXBuildFile; fileRef = F538E11F02F9812C01A80186 /* translate.c */; };\n\t\tAB25D8A7086870540065843D /* xalloc.c in Sources */ = {isa = PBXBuildFile; fileRef = F538E12002F9812C01A80186 /* xalloc.c */; };\n\t\tAB25D8A8086870550065843D /* zlib.c in Sources */ = {isa = PBXBuildFile; fileRef = F538E12102F9812C01A80186 /* zlib.c */; };\n\t\tAB25D8A9086870550065843D /* zlibhex.c in Sources */ = {isa = PBXBuildFile; fileRef = F538E12202F9812C01A80186 /* zlibhex.c */; };\n\t\tAB25D8AA086870560065843D /* zrle.cc in Sources */ = {isa = PBXBuildFile; fileRef = F5C9B02C038DA64501A80117 /* zrle.cc */; };\n\t\tAB25D8AC0868707C0065843D /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABF191B704E447A400A80117 /* Carbon.framework */; };\n\t\tAB25D9400868707E0065843D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };\n\t\tAB25D992086877000065843D /* storepasswd.c in Sources */ = {isa = PBXBuildFile; fileRef = F538E11902F9812C01A80186 /* storepasswd.c */; };\n\t\tAB25DA3B0868842E0065843D /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB25DA3A0868842E0065843D /* IOKit.framework */; };\n\t\tAB25DA3D086884420065843D /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = AB25DA3C086884420065843D /* libz.dylib */; };\n\t\tAB3E27F80AF947FB004AF567 /* Vine Server.pdf in Resources */ = {isa = PBXBuildFile; fileRef = AB3E27F70AF947FB004AF567 /* Vine Server.pdf */; };\n\t\tAB82605A08689AC00010AB63 /* storepasswd in CopyFiles */ = {isa = PBXBuildFile; fileRef = AB82605708689AC00010AB63 /* storepasswd */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };\n\t\tAB82605E08689AC00010AB63 /* OSXvnc-server in CopyFiles */ = {isa = PBXBuildFile; fileRef = AB82605B08689AC00010AB63 /* OSXvnc-server */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };\n\t\tAB95E3EE0FD4AA3800D063EC /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB95E3ED0FD4AA3700D063EC /* OpenGL.framework */; };\n\t\tABA7B3D60948CB5D00CD7499 /* d3des.c in Sources */ = {isa = PBXBuildFile; fileRef = ABA7B3D10948CB5D00CD7499 /* d3des.c */; };\n\t\tABA7B3D70948CB5D00CD7499 /* vncauth.c in Sources */ = {isa = PBXBuildFile; fileRef = ABA7B3D30948CB5D00CD7499 /* vncauth.c */; };\n\t\tABA7B5150949EB7E00CD7499 /* d3des.c in Sources */ = {isa = PBXBuildFile; fileRef = ABA7B3D10948CB5D00CD7499 /* d3des.c */; };\n\t\tABA7B51F0949EBBC00CD7499 /* vncauth.c in Sources */ = {isa = PBXBuildFile; fileRef = ABA7B3D30948CB5D00CD7499 /* vncauth.c */; };\n\t\tABA7B53F094A05BE00CD7499 /* FdInStream.cxx in Sources */ = {isa = PBXBuildFile; fileRef = F5C9B030038DA99401A80117 /* FdInStream.cxx */; };\n\t\tABA7B540094A05BF00CD7499 /* FdOutStream.cxx in Sources */ = {isa = PBXBuildFile; fileRef = F5C9B032038DA99401A80117 /* FdOutStream.cxx */; };\n\t\tABA7B543094A05C700CD7499 /* InStream.cxx in Sources */ = {isa = PBXBuildFile; fileRef = F5C9B035038DA99401A80117 /* InStream.cxx */; };\n\t\tABA7B544094A05C900CD7499 /* NullOutStream.cxx in Sources */ = {isa = PBXBuildFile; fileRef = F5C9B03A038DA99401A80117 /* NullOutStream.cxx */; };\n\t\tABA7B547094A05DE00CD7499 /* ZlibInStream.cxx in Sources */ = {isa = PBXBuildFile; fileRef = F5C9B03F038DA99401A80117 /* ZlibInStream.cxx */; };\n\t\tABA7B548094A05DF00CD7499 /* ZlibOutStream.cxx in Sources */ = {isa = PBXBuildFile; fileRef = F5C9B041038DA99401A80117 /* ZlibOutStream.cxx */; };\n\t\tABA7B560094A080200CD7499 /* librdr.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ABA7B52D094A053000CD7499 /* librdr.a */; };\n\t\tABA7B6D0094A170E00CD7499 /* vncauth.c in Sources */ = {isa = PBXBuildFile; fileRef = ABA7B3D30948CB5D00CD7499 /* vncauth.c */; };\n\t\tABA7B6D6094A171A00CD7499 /* d3des.c in Sources */ = {isa = PBXBuildFile; fileRef = ABA7B3D10948CB5D00CD7499 /* d3des.c */; };\n\t\tABDBE34715BA2A9D00558229 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = ABDBE34515BA2A9D00558229 /* MainMenu.xib */; };\n\t\tABFC222C0AF08CBA00BCE727 /* VineServer.icns in Resources */ = {isa = PBXBuildFile; fileRef = ABFC222B0AF08CBA00BCE727 /* VineServer.icns */; };\n\t\tCA00814E121CA18D008B29B7 /* FdInStream.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C9B031038DA99401A80117 /* FdInStream.h */; };\n\t\tCA008151121CA1C5008B29B7 /* Exception.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C9B02F038DA99401A80117 /* Exception.h */; };\n\t\tCA008152121CA1D8008B29B7 /* FdOutStream.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C9B033038DA99401A80117 /* FdOutStream.h */; };\n\t\tCA008153121CA1E1008B29B7 /* FixedMemOutStream.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C9B034038DA99401A80117 /* FixedMemOutStream.h */; };\n\t\tCA008154121CA1E8008B29B7 /* InStream.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C9B036038DA99401A80117 /* InStream.h */; };\n\t\tCA008155121CA1F3008B29B7 /* MemInStream.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C9B038038DA99401A80117 /* MemInStream.h */; };\n\t\tCA008156121CA1F7008B29B7 /* MemOutStream.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C9B039038DA99401A80117 /* MemOutStream.h */; };\n\t\tCA008157121CA1FC008B29B7 /* NullOutStream.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C9B03B038DA99401A80117 /* NullOutStream.h */; };\n\t\tCA008158121CA200008B29B7 /* OutStream.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C9B03C038DA99401A80117 /* OutStream.h */; };\n\t\tCA008159121CA204008B29B7 /* types.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C9B03E038DA99401A80117 /* types.h */; };\n\t\tCA00815A121CA207008B29B7 /* ZlibInStream.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C9B040038DA99401A80117 /* ZlibInStream.h */; };\n\t\tCA00815B121CA20A008B29B7 /* ZlibOutStream.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C9B042038DA99401A80117 /* ZlibOutStream.h */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\tAB25DA5C08688EE80065843D /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = AB25D98F086876B80065843D;\n\t\t\tremoteInfo = storepasswd;\n\t\t};\n\t\tAB52324608689C02003F66AC /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = AB25D88E08686FC40065843D;\n\t\t\tremoteInfo = \"OSXvnc-server\";\n\t\t};\n\t\tABA30D4015BEE7490001BAE5 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = AB25D81508686B520065843D;\n\t\t\tremoteInfo = \"Vine Server\";\n\t\t};\n\t\tABA7B55A094A07AE00CD7499 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = ABA7B52C094A053000CD7499;\n\t\t\tremoteInfo = rdr;\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\tAB25D83208686B520065843D /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 12;\n\t\t\tdstPath = \"\";\n\t\t\tdstSubfolderSpec = 6;\n\t\t\tfiles = (\n\t\t\t\tAB82605A08689AC00010AB63 /* storepasswd in CopyFiles */,\n\t\t\t\tAB82605E08689AC00010AB63 /* OSXvnc-server in CopyFiles */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t096B69DC0097995A7F000001 /* OSXvnc.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; path = OSXvnc.html; sourceTree = \"<group>\"; };\n\t\t1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = \"<absolute>\"; };\n\t\t29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = \"<group>\"; };\n\t\t919999420B11348C0099EA7A /* getMACAddress.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = getMACAddress.h; sourceTree = \"<group>\"; };\n\t\t919999430B11348E0099EA7A /* getMACAddress.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 30; path = getMACAddress.c; sourceTree = \"<group>\"; };\n\t\tAB25D83708686B520065843D /* VineServer-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = \"VineServer-Info.plist\"; sourceTree = \"<group>\"; };\n\t\tAB25D83808686B520065843D /* Vine Server.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"Vine Server.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tAB25DA3A0868842E0065843D /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = \"<absolute>\"; };\n\t\tAB25DA3C086884420065843D /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = \"compiled.mach-o.dylib\"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = \"<absolute>\"; };\n\t\tAB3E27F70AF947FB004AF567 /* Vine Server.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = \"Vine Server.pdf\"; sourceTree = \"<group>\"; };\n\t\tAB41881F04C5986E00A80117 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = \"<absolute>\"; };\n\t\tAB82605708689AC00010AB63 /* storepasswd */ = {isa = PBXFileReference; explicitFileType = \"compiled.mach-o.executable\"; includeInIndex = 0; path = storepasswd; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tAB82605B08689AC00010AB63 /* OSXvnc-server */ = {isa = PBXFileReference; explicitFileType = \"compiled.mach-o.executable\"; includeInIndex = 0; path = \"OSXvnc-server\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tAB82E81904FA629800A80117 /* kbdptr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kbdptr.h; sourceTree = \"<group>\"; };\n\t\tAB82E81D04FA6D0A00A80117 /* rfbserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rfbserver.h; sourceTree = \"<group>\"; };\n\t\tAB83C53A12724F8B0096F6A7 /* Version.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Version.txt; sourceTree = \"<group>\"; };\n\t\tAB95E3650FD497F600D063EC /* screencapture.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = screencapture.c; sourceTree = \"<group>\"; };\n\t\tAB95E3B20FD4A68800D063EC /* screencapture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = screencapture.h; sourceTree = \"<group>\"; };\n\t\tAB95E3ED0FD4AA3700D063EC /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = \"<absolute>\"; };\n\t\tABA7B3D10948CB5D00CD7499 /* d3des.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = d3des.c; sourceTree = \"<group>\"; };\n\t\tABA7B3D20948CB5D00CD7499 /* d3des.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = d3des.h; sourceTree = \"<group>\"; };\n\t\tABA7B3D30948CB5D00CD7499 /* vncauth.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = vncauth.c; sourceTree = \"<group>\"; };\n\t\tABA7B3D40948CB5D00CD7499 /* vncauth.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = vncauth.h; sourceTree = \"<group>\"; };\n\t\tABA7B3D50948CB5D00CD7499 /* zrleEncode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = zrleEncode.h; sourceTree = \"<group>\"; };\n\t\tABA7B52D094A053000CD7499 /* librdr.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = librdr.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tABCCC8B203D9C60A00A80117 /* OSXvnc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = folder; path = OSXvnc; sourceTree = \"<group>\"; };\n\t\tABD8EC07058A0BD600C84739 /* NSAuthorization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSAuthorization.h; sourceTree = \"<group>\"; };\n\t\tABD8EC08058A0BD600C84739 /* NSAuthorization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSAuthorization.m; sourceTree = \"<group>\"; };\n\t\tABEE28F804C8745B00A80117 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = \"<absolute>\"; };\n\t\tABF191B704E447A400A80117 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = \"<absolute>\"; };\n\t\tABFC222B0AF08CBA00BCE727 /* VineServer.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = VineServer.icns; sourceTree = \"<group>\"; };\n\t\tF538E01002F9812901A80186 /* auth.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 30; path = auth.c; sourceTree = \"<group>\"; };\n\t\tF538E01302F9812901A80186 /* corre.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = corre.c; sourceTree = \"<group>\"; };\n\t\tF538E01402F9812901A80186 /* cutpaste.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 30; path = cutpaste.c; sourceTree = \"<group>\"; };\n\t\tF538E01502F9812901A80186 /* dimming.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = dimming.c; sourceTree = \"<group>\"; };\n\t\tF538E01602F9812901A80186 /* hextile.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 30; path = hextile.c; sourceTree = \"<group>\"; };\n\t\tF538E01902F9812901A80186 /* keysym.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = keysym.h; sourceTree = \"<group>\"; };\n\t\tF538E01A02F9812901A80186 /* keysymdef.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = keysymdef.h; sourceTree = \"<group>\"; };\n\t\tF538E01B02F9812901A80186 /* X.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = X.h; sourceTree = \"<group>\"; };\n\t\tF538E01C02F9812901A80186 /* Xalloca.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Xalloca.h; sourceTree = \"<group>\"; };\n\t\tF538E01D02F9812901A80186 /* Xfuncproto.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Xfuncproto.h; sourceTree = \"<group>\"; };\n\t\tF538E01E02F9812901A80186 /* Xfuncs.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Xfuncs.h; sourceTree = \"<group>\"; };\n\t\tF538E01F02F9812901A80186 /* Xmd.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Xmd.h; sourceTree = \"<group>\"; };\n\t\tF538E02002F9812901A80186 /* Xos.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Xos.h; sourceTree = \"<group>\"; };\n\t\tF538E02102F9812901A80186 /* Xosdefs.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Xosdefs.h; sourceTree = \"<group>\"; };\n\t\tF538E02202F9812901A80186 /* Xproto.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Xproto.h; sourceTree = \"<group>\"; };\n\t\tF538E02302F9812901A80186 /* Xprotostr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Xprotostr.h; sourceTree = \"<group>\"; };\n\t\tF538E02502F9812901A80186 /* colormap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = colormap.h; sourceTree = \"<group>\"; };\n\t\tF538E02602F9812901A80186 /* cursor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cursor.h; sourceTree = \"<group>\"; };\n\t\tF538E02702F9812901A80186 /* dix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dix.h; sourceTree = \"<group>\"; };\n\t\tF538E02802F9812901A80186 /* gc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = gc.h; sourceTree = \"<group>\"; };\n\t\tF538E02902F9812901A80186 /* input.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = input.h; sourceTree = \"<group>\"; };\n\t\tF538E02A02F9812901A80186 /* misc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = misc.h; sourceTree = \"<group>\"; };\n\t\tF538E02B02F9812901A80186 /* miscstruct.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = miscstruct.h; sourceTree = \"<group>\"; };\n\t\tF538E02C02F9812901A80186 /* opaque.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = opaque.h; sourceTree = \"<group>\"; };\n\t\tF538E02D02F9812901A80186 /* os.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = os.h; sourceTree = \"<group>\"; };\n\t\tF538E02E02F9812901A80186 /* pixmap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = pixmap.h; sourceTree = \"<group>\"; };\n\t\tF538E02F02F9812901A80186 /* region.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = region.h; sourceTree = \"<group>\"; };\n\t\tF538E03002F9812901A80186 /* regionstr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = regionstr.h; sourceTree = \"<group>\"; };\n\t\tF538E03102F9812901A80186 /* screenint.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = screenint.h; sourceTree = \"<group>\"; };\n\t\tF538E03202F9812901A80186 /* scrnintstr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = scrnintstr.h; sourceTree = \"<group>\"; };\n\t\tF538E03302F9812901A80186 /* validate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = validate.h; sourceTree = \"<group>\"; };\n\t\tF538E03402F9812901A80186 /* window.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = window.h; sourceTree = \"<group>\"; };\n\t\tF538E03502F9812901A80186 /* kbdptr.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 30; path = kbdptr.c; sourceTree = \"<group>\"; };\n\t\tF538E10E02F9812C01A80186 /* main.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 30; path = main.c; sourceTree = \"<group>\"; };\n\t\tF538E10F02F9812C01A80186 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = \"<group>\"; };\n\t\tF538E11002F9812C01A80186 /* miregion.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = miregion.c; sourceTree = \"<group>\"; };\n\t\tF538E11302F9812C01A80186 /* rfb.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = rfb.h; sourceTree = \"<group>\"; };\n\t\tF538E11402F9812C01A80186 /* rfbproto.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = rfbproto.h; sourceTree = \"<group>\"; };\n\t\tF538E11502F9812C01A80186 /* rfbserver.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 30; lineEnding = 0; path = rfbserver.c; sourceTree = \"<group>\"; };\n\t\tF538E11602F9812C01A80186 /* rre.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = rre.c; sourceTree = \"<group>\"; };\n\t\tF538E11702F9812C01A80186 /* sockets.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = sockets.c; sourceTree = \"<group>\"; };\n\t\tF538E11802F9812C01A80186 /* stats.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = stats.c; sourceTree = \"<group>\"; };\n\t\tF538E11902F9812C01A80186 /* storepasswd.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = storepasswd.c; sourceTree = \"<group>\"; };\n\t\tF538E11A02F9812C01A80186 /* tableinitcmtemplate.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = tableinitcmtemplate.c; sourceTree = \"<group>\"; };\n\t\tF538E11B02F9812C01A80186 /* tableinittctemplate.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = tableinittctemplate.c; sourceTree = \"<group>\"; };\n\t\tF538E11C02F9812C01A80186 /* tabletranstemplate.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = tabletranstemplate.c; sourceTree = \"<group>\"; };\n\t\tF538E11D02F9812C01A80186 /* tight.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = tight.c; sourceTree = \"<group>\"; };\n\t\tF538E11F02F9812C01A80186 /* translate.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = translate.c; sourceTree = \"<group>\"; };\n\t\tF538E12002F9812C01A80186 /* xalloc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = xalloc.c; sourceTree = \"<group>\"; };\n\t\tF538E12102F9812C01A80186 /* zlib.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = zlib.c; sourceTree = \"<group>\"; };\n\t\tF538E12202F9812C01A80186 /* zlibhex.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = zlibhex.c; sourceTree = \"<group>\"; };\n\t\tF5456A2802FAD08901A80117 /* VNCController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = VNCController.m; sourceTree = \"<group>\"; };\n\t\tF5456A2902FAD08901A80117 /* VNCController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = VNCController.h; sourceTree = \"<group>\"; };\n\t\tF54B48D8038C32FA01A80117 /* OSXvnc.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = OSXvnc.tiff; sourceTree = \"<group>\"; };\n\t\tF570ED1002F9DA7601A80186 /* OSXvnc.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = OSXvnc.icns; sourceTree = SOURCE_ROOT; };\n\t\tF58DDDE7056A861001A8015E /* VNCServer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VNCServer.h; sourceTree = \"<group>\"; };\n\t\tF58DDDE8056A861001A8015E /* VNCServer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VNCServer.m; sourceTree = \"<group>\"; };\n\t\tF5C9A8F1038C6F5D01A80117 /* mousecursor.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = mousecursor.c; sourceTree = \"<group>\"; };\n\t\tF5C9A8F6038C74D301A80117 /* CGS.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CGS.h; sourceTree = \"<group>\"; };\n\t\tF5C9B02C038DA64501A80117 /* zrle.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = zrle.cc; sourceTree = \"<group>\"; };\n\t\tF5C9B02F038DA99401A80117 /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Exception.h; sourceTree = \"<group>\"; };\n\t\tF5C9B030038DA99401A80117 /* FdInStream.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FdInStream.cxx; sourceTree = \"<group>\"; };\n\t\tF5C9B031038DA99401A80117 /* FdInStream.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FdInStream.h; sourceTree = \"<group>\"; };\n\t\tF5C9B032038DA99401A80117 /* FdOutStream.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FdOutStream.cxx; sourceTree = \"<group>\"; };\n\t\tF5C9B033038DA99401A80117 /* FdOutStream.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FdOutStream.h; sourceTree = \"<group>\"; };\n\t\tF5C9B034038DA99401A80117 /* FixedMemOutStream.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FixedMemOutStream.h; sourceTree = \"<group>\"; };\n\t\tF5C9B035038DA99401A80117 /* InStream.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = InStream.cxx; sourceTree = \"<group>\"; };\n\t\tF5C9B036038DA99401A80117 /* InStream.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InStream.h; sourceTree = \"<group>\"; };\n\t\tF5C9B038038DA99401A80117 /* MemInStream.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MemInStream.h; sourceTree = \"<group>\"; };\n\t\tF5C9B039038DA99401A80117 /* MemOutStream.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MemOutStream.h; sourceTree = \"<group>\"; };\n\t\tF5C9B03A038DA99401A80117 /* NullOutStream.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = NullOutStream.cxx; sourceTree = \"<group>\"; };\n\t\tF5C9B03B038DA99401A80117 /* NullOutStream.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NullOutStream.h; sourceTree = \"<group>\"; };\n\t\tF5C9B03C038DA99401A80117 /* OutStream.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = OutStream.h; sourceTree = \"<group>\"; };\n\t\tF5C9B03E038DA99401A80117 /* types.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = types.h; sourceTree = \"<group>\"; };\n\t\tF5C9B03F038DA99401A80117 /* ZlibInStream.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ZlibInStream.cxx; sourceTree = \"<group>\"; };\n\t\tF5C9B040038DA99401A80117 /* ZlibInStream.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ZlibInStream.h; sourceTree = \"<group>\"; };\n\t\tF5C9B041038DA99401A80117 /* ZlibOutStream.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ZlibOutStream.cxx; sourceTree = \"<group>\"; };\n\t\tF5C9B042038DA99401A80117 /* ZlibOutStream.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ZlibOutStream.h; sourceTree = \"<group>\"; };\n\t\tF5F3A78903B395AA01A80117 /* OSXvnc.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = OSXvnc.jpg; sourceTree = \"<group>\"; };\n\t\tF89837A525B78CE3003BFE25 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = fr; path = fr.lproj/Copying.rtf; sourceTree = \"<group>\"; };\n\t\tF89837A625B78CE3003BFE25 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = \"<group>\"; };\n\t\tF89837A825B78CFB003BFE25 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Copying.rtf; sourceTree = \"<group>\"; };\n\t\tF89837A925B78CFB003BFE25 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = \"<group>\"; };\n\t\tF89837AA25B78CFB003BFE25 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = \"<group>\"; };\n\t\tF89837AB25B78CFB003BFE25 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = \"en.lproj/Vine Server Release Notes.rtf\"; sourceTree = \"<group>\"; };\n\t\tF89837AC25B78D00003BFE25 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = de; path = de.lproj/Copying.rtf; sourceTree = \"<group>\"; };\n\t\tF89837AD25B78D00003BFE25 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = \"<group>\"; };\n\t\tF89837AE25B78D05003BFE25 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = ja; path = ja.lproj/Copying.rtf; sourceTree = \"<group>\"; };\n\t\tF89837AF25B78D05003BFE25 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = \"<group>\"; };\n\t\tF89837B025B78D09003BFE25 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = \"<group>\"; };\n\t\tF89837B125B78D15003BFE25 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\tAB25D82F08686B520065843D /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tAB25D83008686B520065843D /* Cocoa.framework in Frameworks */,\n\t\t\t\tAB25D83108686B520065843D /* Security.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tAB25D88D08686FC40065843D /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tAB25D8AC0868707C0065843D /* Carbon.framework in Frameworks */,\n\t\t\t\tAB25D9400868707E0065843D /* Cocoa.framework in Frameworks */,\n\t\t\t\tAB25DA3B0868842E0065843D /* IOKit.framework in Frameworks */,\n\t\t\t\tAB95E3EE0FD4AA3800D063EC /* OpenGL.framework in Frameworks */,\n\t\t\t\tABA7B560094A080200CD7499 /* librdr.a in Frameworks */,\n\t\t\t\tAB25DA3D086884420065843D /* libz.dylib in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t19C28FACFE9D520D11CA2CBB /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tAB25D83808686B520065843D /* Vine Server.app */,\n\t\t\t\tAB82605708689AC00010AB63 /* storepasswd */,\n\t\t\t\tAB82605B08689AC00010AB63 /* OSXvnc-server */,\n\t\t\t\tABA7B52D094A053000CD7499 /* librdr.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t29B97314FDCFA39411CA2CEA /* OSXvnc */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tBCFF37981DEB1F6300D4F43D /* VineServer */,\n\t\t\t\tF538E00B02F9812901A80186 /* OSXvnc-server */,\n\t\t\t\t29B97323FDCFA39411CA2CEA /* Frameworks */,\n\t\t\t\t19C28FACFE9D520D11CA2CBB /* Products */,\n\t\t\t);\n\t\t\tname = OSXvnc;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t29B97315FDCFA39411CA2CEA /* Other Sources */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t29B97316FDCFA39411CA2CEA /* main.m */,\n\t\t\t);\n\t\t\tname = \"Other Sources\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t29B97317FDCFA39411CA2CEA /* Resources */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tAB3E27F70AF947FB004AF567 /* Vine Server.pdf */,\n\t\t\t\tAB541C2907A0264F00B63668 /* Vine Server Release Notes.rtf */,\n\t\t\t\t096B69DC0097995A7F000001 /* OSXvnc.html */,\n\t\t\t\tABCCC8B203D9C60A00A80117 /* OSXvnc */,\n\t\t\t\tABD7FE7E07AFF8B4004D0B81 /* Localizable.strings */,\n\t\t\t\tAB541C3B07A0273500B63668 /* Copying.rtf */,\n\t\t\t\tF57BB467027E036F014B5D3F /* Credits.rtf */,\n\t\t\t\tABFC222B0AF08CBA00BCE727 /* VineServer.icns */,\n\t\t\t\tF5F3A78903B395AA01A80117 /* OSXvnc.jpg */,\n\t\t\t\tF570ED1002F9DA7601A80186 /* OSXvnc.icns */,\n\t\t\t\tF54B48D8038C32FA01A80117 /* OSXvnc.tiff */,\n\t\t\t\tAB83C53A12724F8B0096F6A7 /* Version.txt */,\n\t\t\t);\n\t\t\tname = Resources;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t29B97323FDCFA39411CA2CEA /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tAB25DA3C086884420065843D /* libz.dylib */,\n\t\t\t\tAB25DA3A0868842E0065843D /* IOKit.framework */,\n\t\t\t\tABF191B704E447A400A80117 /* Carbon.framework */,\n\t\t\t\tAB95E3ED0FD4AA3700D063EC /* OpenGL.framework */,\n\t\t\t\t1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,\n\t\t\t\tABEE28F804C8745B00A80117 /* Security.framework */,\n\t\t\t\tAB41881F04C5986E00A80117 /* ApplicationServices.framework */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tBCFF37981DEB1F6300D4F43D /* VineServer */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t29B97315FDCFA39411CA2CEA /* Other Sources */,\n\t\t\t\t29B97317FDCFA39411CA2CEA /* Resources */,\n\t\t\t\tABDBE34515BA2A9D00558229 /* MainMenu.xib */,\n\t\t\t\tABD8EC07058A0BD600C84739 /* NSAuthorization.h */,\n\t\t\t\tABD8EC08058A0BD600C84739 /* NSAuthorization.m */,\n\t\t\t\tF5456A2902FAD08901A80117 /* VNCController.h */,\n\t\t\t\tF5456A2802FAD08901A80117 /* VNCController.m */,\n\t\t\t\tAB25D83708686B520065843D /* VineServer-Info.plist */,\n\t\t\t);\n\t\t\tname = VineServer;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tF538E00B02F9812901A80186 /* OSXvnc-server */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tF538E10F02F9812C01A80186 /* Makefile */,\n\t\t\t\tF58DDDE7056A861001A8015E /* VNCServer.h */,\n\t\t\t\tF58DDDE8056A861001A8015E /* VNCServer.m */,\n\t\t\t\tABA7B3D10948CB5D00CD7499 /* d3des.c */,\n\t\t\t\tABA7B3D20948CB5D00CD7499 /* d3des.h */,\n\t\t\t\tABA7B3D30948CB5D00CD7499 /* vncauth.c */,\n\t\t\t\tABA7B3D40948CB5D00CD7499 /* vncauth.h */,\n\t\t\t\tF5C9A8F6038C74D301A80117 /* CGS.h */,\n\t\t\t\tF538E11302F9812C01A80186 /* rfb.h */,\n\t\t\t\tF538E11402F9812C01A80186 /* rfbproto.h */,\n\t\t\t\tF538E01002F9812901A80186 /* auth.c */,\n\t\t\t\tF538E01302F9812901A80186 /* corre.c */,\n\t\t\t\t919999420B11348C0099EA7A /* getMACAddress.h */,\n\t\t\t\t919999430B11348E0099EA7A /* getMACAddress.c */,\n\t\t\t\tF538E01402F9812901A80186 /* cutpaste.c */,\n\t\t\t\tF538E01502F9812901A80186 /* dimming.c */,\n\t\t\t\tF5C9A8F1038C6F5D01A80117 /* mousecursor.c */,\n\t\t\t\tF538E01602F9812901A80186 /* hextile.c */,\n\t\t\t\tAB82E81904FA629800A80117 /* kbdptr.h */,\n\t\t\t\tF538E03502F9812901A80186 /* kbdptr.c */,\n\t\t\t\tF538E10E02F9812C01A80186 /* main.c */,\n\t\t\t\tF538E11002F9812C01A80186 /* miregion.c */,\n\t\t\t\tAB82E81D04FA6D0A00A80117 /* rfbserver.h */,\n\t\t\t\tF538E11502F9812C01A80186 /* rfbserver.c */,\n\t\t\t\tF538E11602F9812C01A80186 /* rre.c */,\n\t\t\t\tAB95E3650FD497F600D063EC /* screencapture.c */,\n\t\t\t\tAB95E3B20FD4A68800D063EC /* screencapture.h */,\n\t\t\t\tF538E11702F9812C01A80186 /* sockets.c */,\n\t\t\t\tF538E11802F9812C01A80186 /* stats.c */,\n\t\t\t\tF538E11902F9812C01A80186 /* storepasswd.c */,\n\t\t\t\tF538E11A02F9812C01A80186 /* tableinitcmtemplate.c */,\n\t\t\t\tF538E11B02F9812C01A80186 /* tableinittctemplate.c */,\n\t\t\t\tF538E11C02F9812C01A80186 /* tabletranstemplate.c */,\n\t\t\t\tF538E11D02F9812C01A80186 /* tight.c */,\n\t\t\t\tF538E11F02F9812C01A80186 /* translate.c */,\n\t\t\t\tF538E12002F9812C01A80186 /* xalloc.c */,\n\t\t\t\tF538E12102F9812C01A80186 /* zlib.c */,\n\t\t\t\tF538E12202F9812C01A80186 /* zlibhex.c */,\n\t\t\t\tF5C9B02C038DA64501A80117 /* zrle.cc */,\n\t\t\t\tABA7B3D50948CB5D00CD7499 /* zrleEncode.h */,\n\t\t\t\tF5C9B02E038DA99401A80117 /* rdr */,\n\t\t\t\tF538E01702F9812901A80186 /* include */,\n\t\t\t);\n\t\t\tpath = \"OSXvnc-server\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tF538E01702F9812901A80186 /* include */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tF538E01802F9812901A80186 /* X11 */,\n\t\t\t\tF538E02402F9812901A80186 /* Xserver */,\n\t\t\t);\n\t\t\tpath = include;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tF538E01802F9812901A80186 /* X11 */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tF538E01902F9812901A80186 /* keysym.h */,\n\t\t\t\tF538E01A02F9812901A80186 /* keysymdef.h */,\n\t\t\t\tF538E01B02F9812901A80186 /* X.h */,\n\t\t\t\tF538E01C02F9812901A80186 /* Xalloca.h */,\n\t\t\t\tF538E01D02F9812901A80186 /* Xfuncproto.h */,\n\t\t\t\tF538E01E02F9812901A80186 /* Xfuncs.h */,\n\t\t\t\tF538E01F02F9812901A80186 /* Xmd.h */,\n\t\t\t\tF538E02002F9812901A80186 /* Xos.h */,\n\t\t\t\tF538E02102F9812901A80186 /* Xosdefs.h */,\n\t\t\t\tF538E02202F9812901A80186 /* Xproto.h */,\n\t\t\t\tF538E02302F9812901A80186 /* Xprotostr.h */,\n\t\t\t);\n\t\t\tpath = X11;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tF538E02402F9812901A80186 /* Xserver */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tF538E02502F9812901A80186 /* colormap.h */,\n\t\t\t\tF538E02602F9812901A80186 /* cursor.h */,\n\t\t\t\tF538E02702F9812901A80186 /* dix.h */,\n\t\t\t\tF538E02802F9812901A80186 /* gc.h */,\n\t\t\t\tF538E02902F9812901A80186 /* input.h */,\n\t\t\t\tF538E02A02F9812901A80186 /* misc.h */,\n\t\t\t\tF538E02B02F9812901A80186 /* miscstruct.h */,\n\t\t\t\tF538E02C02F9812901A80186 /* opaque.h */,\n\t\t\t\tF538E02D02F9812901A80186 /* os.h */,\n\t\t\t\tF538E02E02F9812901A80186 /* pixmap.h */,\n\t\t\t\tF538E02F02F9812901A80186 /* region.h */,\n\t\t\t\tF538E03002F9812901A80186 /* regionstr.h */,\n\t\t\t\tF538E03102F9812901A80186 /* screenint.h */,\n\t\t\t\tF538E03202F9812901A80186 /* scrnintstr.h */,\n\t\t\t\tF538E03302F9812901A80186 /* validate.h */,\n\t\t\t\tF538E03402F9812901A80186 /* window.h */,\n\t\t\t);\n\t\t\tpath = Xserver;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tF5C9B02E038DA99401A80117 /* rdr */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tF5C9B02F038DA99401A80117 /* Exception.h */,\n\t\t\t\tF5C9B030038DA99401A80117 /* FdInStream.cxx */,\n\t\t\t\tF5C9B031038DA99401A80117 /* FdInStream.h */,\n\t\t\t\tF5C9B032038DA99401A80117 /* FdOutStream.cxx */,\n\t\t\t\tF5C9B033038DA99401A80117 /* FdOutStream.h */,\n\t\t\t\tF5C9B034038DA99401A80117 /* FixedMemOutStream.h */,\n\t\t\t\tF5C9B035038DA99401A80117 /* InStream.cxx */,\n\t\t\t\tF5C9B036038DA99401A80117 /* InStream.h */,\n\t\t\t\tF5C9B038038DA99401A80117 /* MemInStream.h */,\n\t\t\t\tF5C9B039038DA99401A80117 /* MemOutStream.h */,\n\t\t\t\tF5C9B03A038DA99401A80117 /* NullOutStream.cxx */,\n\t\t\t\tF5C9B03B038DA99401A80117 /* NullOutStream.h */,\n\t\t\t\tF5C9B03C038DA99401A80117 /* OutStream.h */,\n\t\t\t\tF5C9B03E038DA99401A80117 /* types.h */,\n\t\t\t\tF5C9B03F038DA99401A80117 /* ZlibInStream.cxx */,\n\t\t\t\tF5C9B040038DA99401A80117 /* ZlibInStream.h */,\n\t\t\t\tF5C9B041038DA99401A80117 /* ZlibOutStream.cxx */,\n\t\t\t\tF5C9B042038DA99401A80117 /* ZlibOutStream.h */,\n\t\t\t);\n\t\t\tpath = rdr;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXHeadersBuildPhase section */\n\t\tABA7B529094A053000CD7499 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tCA008152121CA1D8008B29B7 /* FdOutStream.h in Headers */,\n\t\t\t\tCA008154121CA1E8008B29B7 /* InStream.h in Headers */,\n\t\t\t\tCA008158121CA200008B29B7 /* OutStream.h in Headers */,\n\t\t\t\tCA008159121CA204008B29B7 /* types.h in Headers */,\n\t\t\t\tCA008156121CA1F7008B29B7 /* MemOutStream.h in Headers */,\n\t\t\t\tCA00815A121CA207008B29B7 /* ZlibInStream.h in Headers */,\n\t\t\t\tCA00815B121CA20A008B29B7 /* ZlibOutStream.h in Headers */,\n\t\t\t\tCA008157121CA1FC008B29B7 /* NullOutStream.h in Headers */,\n\t\t\t\tCA008153121CA1E1008B29B7 /* FixedMemOutStream.h in Headers */,\n\t\t\t\tCA008155121CA1F3008B29B7 /* MemInStream.h in Headers */,\n\t\t\t\tCA008151121CA1C5008B29B7 /* Exception.h in Headers */,\n\t\t\t\tCA00814E121CA18D008B29B7 /* FdInStream.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXHeadersBuildPhase section */\n\n/* Begin PBXNativeTarget section */\n\t\tAB25D81508686B520065843D /* Vine Server */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = ABECD3EA08E46414009C84A0 /* Build configuration list for PBXNativeTarget \"Vine Server\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tAB25D81D08686B520065843D /* Resources */,\n\t\t\t\tAB25D82908686B520065843D /* Sources */,\n\t\t\t\tAB25D82F08686B520065843D /* Frameworks */,\n\t\t\t\tAB25D83208686B520065843D /* CopyFiles */,\n\t\t\t\tAB139E5C0CEA05C200EE873A /* Record our Version */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\tAB52324708689C02003F66AC /* PBXTargetDependency */,\n\t\t\t\tAB25DA5D08688EE80065843D /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"Vine Server\";\n\t\t\tproductInstallPath = /OSXvnc/;\n\t\t\tproductName = OSXvnc;\n\t\t\tproductReference = AB25D83808686B520065843D /* Vine Server.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\tAB25D88E08686FC40065843D /* OSXvnc-server */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = ABECD3DE08E46414009C84A0 /* Build configuration list for PBXNativeTarget \"OSXvnc-server\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tAB25D88C08686FC40065843D /* Sources */,\n\t\t\t\tAB25D88D08686FC40065843D /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\tABA7B55B094A07AE00CD7499 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"OSXvnc-server\";\n\t\t\tproductName = \"OSXvnc-server\";\n\t\t\tproductReference = AB82605B08689AC00010AB63 /* OSXvnc-server */;\n\t\t\tproductType = \"com.apple.product-type.tool\";\n\t\t};\n\t\tAB25D98F086876B80065843D /* storepasswd */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = ABECD3E208E46414009C84A0 /* Build configuration list for PBXNativeTarget \"storepasswd\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tAB25D98D086876B80065843D /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = storepasswd;\n\t\t\tproductName = storepasswd;\n\t\t\tproductReference = AB82605708689AC00010AB63 /* storepasswd */;\n\t\t\tproductType = \"com.apple.product-type.tool\";\n\t\t};\n\t\tABA7B52C094A053000CD7499 /* rdr */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = ABA7B537094A054A00CD7499 /* Build configuration list for PBXNativeTarget \"rdr\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tABA7B529094A053000CD7499 /* Headers */,\n\t\t\t\tABA7B52A094A053000CD7499 /* Sources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = rdr;\n\t\t\tproductName = rdr;\n\t\t\tproductReference = ABA7B52D094A053000CD7499 /* librdr.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t29B97313FDCFA39411CA2CEA /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 1230;\n\t\t\t};\n\t\t\tbuildConfigurationList = ABECD3EE08E46414009C84A0 /* Build configuration list for PBXProject \"OSXvnc\" */;\n\t\t\tcompatibilityVersion = \"Xcode 6.3\";\n\t\t\tdevelopmentRegion = en;\n\t\t\thasScannedForEncodings = 1;\n\t\t\tknownRegions = (\n\t\t\t\tfr,\n\t\t\t\ten,\n\t\t\t\tde,\n\t\t\t\tja,\n\t\t\t\tit,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 29B97314FDCFA39411CA2CEA /* OSXvnc */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\tABA30D3D15BEE7310001BAE5 /* Vine Server Package */,\n\t\t\t\tAB25D81508686B520065843D /* Vine Server */,\n\t\t\t\tAB25D88E08686FC40065843D /* OSXvnc-server */,\n\t\t\t\tAB25D98F086876B80065843D /* storepasswd */,\n\t\t\t\tABA7B52C094A053000CD7499 /* rdr */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\tAB25D81D08686B520065843D /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tAB25D82108686B520065843D /* Copying.rtf in Resources */,\n\t\t\t\tAB25D81F08686B520065843D /* Credits.rtf in Resources */,\n\t\t\t\tAB25D82208686B520065843D /* Localizable.strings in Resources */,\n\t\t\t\tAB25D82008686B520065843D /* Vine Server Release Notes.rtf in Resources */,\n\t\t\t\tAB25D82608686B520065843D /* OSXvnc in Resources */,\n\t\t\t\tABFC222C0AF08CBA00BCE727 /* VineServer.icns in Resources */,\n\t\t\t\tAB3E27F80AF947FB004AF567 /* Vine Server.pdf in Resources */,\n\t\t\t\tABDBE34715BA2A9D00558229 /* MainMenu.xib in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXShellScriptBuildPhase section */\n\t\tAB139E5C0CEA05C200EE873A /* Record our Version */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Record our Version\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"#Write our current AGV version number into the Info.plist\\ntypeset CURRENT_PRODUCT_VERSION=`cat Version.txt`\\ntypeset CURRENT_BUILD_VERSION=`date +%y%m%d%H%M`\\ntypeset CURRENT_YEAR=`date +%Y`\\necho Version: $CURRENT_PRODUCT_VERSION Build Number: $CURRENT_BUILD_VERSION\\npushd \\\"$TARGET_BUILD_DIR/$PRODUCT_NAME.$WRAPPER_EXTENSION/Contents\\\"\\nsed -i \\\"\\\" s/__PRODUCT_VERSION__/$CURRENT_PRODUCT_VERSION/ ./Info.plist\\nsed -i \\\"\\\" s/__BUILD_VERSION__/$CURRENT_BUILD_VERSION/ ./Info.plist\\nsed -i \\\"\\\" s/__YEAR__/$CURRENT_YEAR/ ./Info.plist\\npopd\\n\";\n\t\t};\n\t\tABA30D3C15BEE7310001BAE5 /* Build DMG */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Build DMG\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"# Create a UDIF DMG\\nset -e\\nset -x\\nPACKAGE_FOLDER=\\\"/tmp/VineServer\\\"\\nrm -rf \\\"$PACKAGE_FOLDER\\\"\\nmkdir -p \\\"$PACKAGE_FOLDER\\\"\\ncp -r \\\"$BUILT_PRODUCTS_DIR/Vine Server.app\\\" \\\"$PACKAGE_FOLDER\\\"\\nhdiutil create -fs HFS+ -ov -format UDZO -imagekey zlib-level=9 -srcfolder \\\"$PACKAGE_FOLDER\\\" \\\"/tmp/VineServer.dmg\\\"\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n/* End PBXShellScriptBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\tAB25D82908686B520065843D /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tAB25D82A08686B520065843D /* main.m in Sources */,\n\t\t\t\tAB25D82B08686B520065843D /* VNCController.m in Sources */,\n\t\t\t\tAB25D82E08686B520065843D /* NSAuthorization.m in Sources */,\n\t\t\t\tABA7B6D0094A170E00CD7499 /* vncauth.c in Sources */,\n\t\t\t\tABA7B6D6094A171A00CD7499 /* d3des.c in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tAB25D88C08686FC40065843D /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tAB25D895086870420065843D /* auth.c in Sources */,\n\t\t\t\tAB25D896086870430065843D /* corre.c in Sources */,\n\t\t\t\tAB25D897086870430065843D /* cutpaste.c in Sources */,\n\t\t\t\tAB25D898086870440065843D /* dimming.c in Sources */,\n\t\t\t\tAB25D899086870460065843D /* VNCServer.m in Sources */,\n\t\t\t\tAB25D89A086870490065843D /* mousecursor.c in Sources */,\n\t\t\t\tAB25D89B0868704A0065843D /* hextile.c in Sources */,\n\t\t\t\tAB25D89C0868704B0065843D /* kbdptr.c in Sources */,\n\t\t\t\tAB25D89E0868704C0065843D /* main.c in Sources */,\n\t\t\t\tAB25D89F0868704C0065843D /* miregion.c in Sources */,\n\t\t\t\tAB25D8A00868704D0065843D /* rfbserver.c in Sources */,\n\t\t\t\tAB25D8A10868704E0065843D /* rre.c in Sources */,\n\t\t\t\tAB25D8A20868704E0065843D /* sockets.c in Sources */,\n\t\t\t\tAB25D8A30868704F0065843D /* stats.c in Sources */,\n\t\t\t\tAB25D8A5086870530065843D /* tight.c in Sources */,\n\t\t\t\tAB25D8A6086870540065843D /* translate.c in Sources */,\n\t\t\t\tAB25D8A7086870540065843D /* xalloc.c in Sources */,\n\t\t\t\tAB25D8A8086870550065843D /* zlib.c in Sources */,\n\t\t\t\tAB25D8A9086870550065843D /* zlibhex.c in Sources */,\n\t\t\t\tAB25D8AA086870560065843D /* zrle.cc in Sources */,\n\t\t\t\tABA7B3D60948CB5D00CD7499 /* d3des.c in Sources */,\n\t\t\t\tABA7B3D70948CB5D00CD7499 /* vncauth.c in Sources */,\n\t\t\t\t9199995B0B1135FF0099EA7A /* getMACAddress.c in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tAB25D98D086876B80065843D /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tAB25D992086877000065843D /* storepasswd.c in Sources */,\n\t\t\t\tABA7B5150949EB7E00CD7499 /* d3des.c in Sources */,\n\t\t\t\tABA7B51F0949EBBC00CD7499 /* vncauth.c in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tABA7B52A094A053000CD7499 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tABA7B53F094A05BE00CD7499 /* FdInStream.cxx in Sources */,\n\t\t\t\tABA7B540094A05BF00CD7499 /* FdOutStream.cxx in Sources */,\n\t\t\t\tABA7B543094A05C700CD7499 /* InStream.cxx in Sources */,\n\t\t\t\tABA7B544094A05C900CD7499 /* NullOutStream.cxx in Sources */,\n\t\t\t\tABA7B547094A05DE00CD7499 /* ZlibInStream.cxx in Sources */,\n\t\t\t\tABA7B548094A05DF00CD7499 /* ZlibOutStream.cxx in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\tAB25DA5D08688EE80065843D /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = AB25D98F086876B80065843D /* storepasswd */;\n\t\t\ttargetProxy = AB25DA5C08688EE80065843D /* PBXContainerItemProxy */;\n\t\t};\n\t\tAB52324708689C02003F66AC /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = AB25D88E08686FC40065843D /* OSXvnc-server */;\n\t\t\ttargetProxy = AB52324608689C02003F66AC /* PBXContainerItemProxy */;\n\t\t};\n\t\tABA30D4115BEE7490001BAE5 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = AB25D81508686B520065843D /* Vine Server */;\n\t\t\ttargetProxy = ABA30D4015BEE7490001BAE5 /* PBXContainerItemProxy */;\n\t\t};\n\t\tABA7B55B094A07AE00CD7499 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = ABA7B52C094A053000CD7499 /* rdr */;\n\t\t\ttargetProxy = ABA7B55A094A07AE00CD7499 /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin PBXVariantGroup section */\n\t\tAB541C2907A0264F00B63668 /* Vine Server Release Notes.rtf */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\tF89837AB25B78CFB003BFE25 /* en */,\n\t\t\t);\n\t\t\tname = \"Vine Server Release Notes.rtf\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tAB541C3B07A0273500B63668 /* Copying.rtf */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\tF89837A525B78CE3003BFE25 /* fr */,\n\t\t\t\tF89837A825B78CFB003BFE25 /* en */,\n\t\t\t\tF89837AC25B78D00003BFE25 /* de */,\n\t\t\t\tF89837AE25B78D05003BFE25 /* ja */,\n\t\t\t);\n\t\t\tname = Copying.rtf;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tABD7FE7E07AFF8B4004D0B81 /* Localizable.strings */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\tF89837A625B78CE3003BFE25 /* fr */,\n\t\t\t\tF89837AA25B78CFB003BFE25 /* en */,\n\t\t\t\tF89837AD25B78D00003BFE25 /* de */,\n\t\t\t\tF89837AF25B78D05003BFE25 /* ja */,\n\t\t\t\tF89837B025B78D09003BFE25 /* it */,\n\t\t\t);\n\t\t\tname = Localizable.strings;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tABDBE34515BA2A9D00558229 /* MainMenu.xib */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\tF89837B125B78D15003BFE25 /* Base */,\n\t\t\t);\n\t\t\tname = MainMenu.xib;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tF57BB467027E036F014B5D3F /* Credits.rtf */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\tF89837A925B78CFB003BFE25 /* en */,\n\t\t\t);\n\t\t\tname = Credits.rtf;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\tABA30D3E15BEE7310001BAE5 /* Development */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"\";\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tPRODUCT_NAME = \"Vine Server Package\";\n\t\t\t\tSDKROOT = macosx;\n\t\t\t};\n\t\t\tname = Development;\n\t\t};\n\t\tABA30D3F15BEE7310001BAE5 /* Deployment */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"\";\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tPRODUCT_NAME = \"Vine Server Package\";\n\t\t\t\tSDKROOT = macosx;\n\t\t\t};\n\t\t\tname = Deployment;\n\t\t};\n\t\tABA7B538094A054A00CD7499 /* Development */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_GENERATE_DEBUGGING_SYMBOLS = YES;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = YES;\n\t\t\t\tHEADER_SEARCH_PATHS = \"osxvnc-server\";\n\t\t\t\tINSTALL_PATH = /usr/local/lib;\n\t\t\t\tPRODUCT_NAME = rdr;\n\t\t\t};\n\t\t\tname = Development;\n\t\t};\n\t\tABA7B539094A054A00CD7499 /* Deployment */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tCXX = \"g++-3.3 \";\n\t\t\t\tDEPLOYMENT_POSTPROCESSING = NO;\n\t\t\t\tGCC_INPUT_FILETYPE = sourcecode.cpp.cpp;\n\t\t\t\tHEADER_SEARCH_PATHS = \"osxvnc-server\";\n\t\t\t\tPRODUCT_NAME = rdr;\n\t\t\t\tSEPARATE_STRIP = NO;\n\t\t\t\tSTRIP_INSTALLED_PRODUCT = NO;\n\t\t\t};\n\t\t\tname = Deployment;\n\t\t};\n\t\tABECD3DF08E46414009C84A0 /* Development */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"-\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"OSXvnc-server\",\n\t\t\t\t\t\"OSXvnc-server/include\",\n\t\t\t\t\t\"libjpeg-turbo\",\n\t\t\t\t);\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"\";\n\t\t\t\t\"OTHER_LDFLAGS[arch=arm64]\" = (\n\t\t\t\t\t\"-sectcreate\",\n\t\t\t\t\t__CGPreLoginApp,\n\t\t\t\t\t__cgpreloginapp,\n\t\t\t\t\t/dev/null,\n\t\t\t\t\t\"libjpeg-turbo/macosarmv8/libturbojpeg.a\",\n\t\t\t\t);\n\t\t\t\t\"OTHER_LDFLAGS[arch=x86_64]\" = (\n\t\t\t\t\t\"-sectcreate\",\n\t\t\t\t\t__CGPreLoginApp,\n\t\t\t\t\t__cgpreloginapp,\n\t\t\t\t\t/dev/null,\n\t\t\t\t\t\"libjpeg-turbo/macosx8664/libturbojpeg.a\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_NAME = \"OSXvnc-server\";\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t};\n\t\t\tname = Development;\n\t\t};\n\t\tABECD3E008E46414009C84A0 /* Deployment */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"-\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEPLOYMENT_POSTPROCESSING = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 3;\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"OSXvnc-server\",\n\t\t\t\t\t\"OSXvnc-server/include\",\n\t\t\t\t\t\"libjpeg-turbo\",\n\t\t\t\t);\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"\";\n\t\t\t\tMACH_O_TYPE = mh_execute;\n\t\t\t\t\"OTHER_LDFLAGS[arch=arm64]\" = (\n\t\t\t\t\t\"-sectcreate\",\n\t\t\t\t\t__CGPreLoginApp,\n\t\t\t\t\t__cgpreloginapp,\n\t\t\t\t\t/dev/null,\n\t\t\t\t\t\"libjpeg-turbo/macosarmv8/libturbojpeg.a\",\n\t\t\t\t);\n\t\t\t\t\"OTHER_LDFLAGS[arch=x86_64]\" = (\n\t\t\t\t\t\"-sectcreate\",\n\t\t\t\t\t__CGPreLoginApp,\n\t\t\t\t\t__cgpreloginapp,\n\t\t\t\t\t/dev/null,\n\t\t\t\t\t\"libjpeg-turbo/macosx8664/libturbojpeg.a\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_NAME = \"OSXvnc-server\";\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSTRIP_INSTALLED_PRODUCT = NO;\n\t\t\t};\n\t\t\tname = Deployment;\n\t\t};\n\t\tABECD3E308E46414009C84A0 /* Development */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"-\";\n\t\t\t\tPRODUCT_NAME = storepasswd;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t};\n\t\t\tname = Development;\n\t\t};\n\t\tABECD3E408E46414009C84A0 /* Deployment */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"-\";\n\t\t\t\tPRODUCT_NAME = storepasswd;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t};\n\t\t\tname = Deployment;\n\t\t};\n\t\tABECD3EB08E46414009C84A0 /* Development */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"-\";\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tDSTROOT = \"\";\n\t\t\t\tINFOPLIST_FILE = \"VineServer-Info.plist\";\n\t\t\t\tINSTALL_PATH = \"\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"de.uni-mannheim.VineServer\";\n\t\t\t\tPRODUCT_NAME = \"Vine Server\";\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tWRAPPER_EXTENSION = app;\n\t\t\t};\n\t\t\tname = Development;\n\t\t};\n\t\tABECD3EC08E46414009C84A0 /* Deployment */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"-\";\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tDEPLOYMENT_LOCATION = YES;\n\t\t\t\tDEPLOYMENT_POSTPROCESSING = YES;\n\t\t\t\tDSTROOT = \"\";\n\t\t\t\tINFOPLIST_FILE = \"VineServer-Info.plist\";\n\t\t\t\tINSTALL_PATH = \"\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"de.uni-mannheim.VineServer\";\n\t\t\t\tPRODUCT_NAME = \"Vine Server\";\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tWRAPPER_EXTENSION = app;\n\t\t\t};\n\t\t\tname = Deployment;\n\t\t};\n\t\tABECD3EF08E46414009C84A0 /* Development */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"\";\n\t\t\t\tDSTROOT = \"\";\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tINSTALL_PATH = \"\";\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = \"$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)\";\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSTRIP_INSTALLED_PRODUCT = NO;\n\t\t\t\t\"USER_HEADER_SEARCH_PATHS[arch=*]\" = \"\";\n\t\t\t};\n\t\t\tname = Development;\n\t\t};\n\t\tABECD3F008E46414009C84A0 /* Deployment */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"\";\n\t\t\t\tDEPLOYMENT_POSTPROCESSING = YES;\n\t\t\t\tDSTROOT = \"\";\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tINSTALL_PATH = \"\";\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = \"$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)\";\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSTRIP_INSTALLED_PRODUCT = NO;\n\t\t\t\t\"USER_HEADER_SEARCH_PATHS[arch=*]\" = \"\";\n\t\t\t};\n\t\t\tname = Deployment;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\tABA30D4215BEE7670001BAE5 /* Build configuration list for PBXAggregateTarget \"Vine Server Package\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tABA30D3E15BEE7310001BAE5 /* Development */,\n\t\t\t\tABA30D3F15BEE7310001BAE5 /* Deployment */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Deployment;\n\t\t};\n\t\tABA7B537094A054A00CD7499 /* Build configuration list for PBXNativeTarget \"rdr\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tABA7B538094A054A00CD7499 /* Development */,\n\t\t\t\tABA7B539094A054A00CD7499 /* Deployment */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Deployment;\n\t\t};\n\t\tABECD3DE08E46414009C84A0 /* Build configuration list for PBXNativeTarget \"OSXvnc-server\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tABECD3DF08E46414009C84A0 /* Development */,\n\t\t\t\tABECD3E008E46414009C84A0 /* Deployment */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Deployment;\n\t\t};\n\t\tABECD3E208E46414009C84A0 /* Build configuration list for PBXNativeTarget \"storepasswd\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tABECD3E308E46414009C84A0 /* Development */,\n\t\t\t\tABECD3E408E46414009C84A0 /* Deployment */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Deployment;\n\t\t};\n\t\tABECD3EA08E46414009C84A0 /* Build configuration list for PBXNativeTarget \"Vine Server\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tABECD3EB08E46414009C84A0 /* Development */,\n\t\t\t\tABECD3EC08E46414009C84A0 /* Deployment */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Deployment;\n\t\t};\n\t\tABECD3EE08E46414009C84A0 /* Build configuration list for PBXProject \"OSXvnc\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tABECD3EF08E46414009C84A0 /* Development */,\n\t\t\t\tABECD3F008E46414009C84A0 /* Deployment */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Deployment;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 29B97313FDCFA39411CA2CEA /* Project object */;\n}\n"
  },
  {
    "path": "README.md",
    "content": "[![Build Status](https://travis-ci.org/stweil/OSXvnc.svg?branch=master)](https://travis-ci.org/stweil/OSXvnc)\n\nVine VNC Server (OSXvnc)\n========================\n\nThe code in this Git repository is based on the CVS repository at\nhttp://osxvnc.cvs.sourceforge.net/viewvc/osxvnc/.\nIt was created using this command:\n\n    git cvsimport -d :pserver:anonymous@osxvnc.cvs.sourceforge.net:/cvsroot/osxvnc OSXvnc\n\nVine was developed at Redstone Software which was acquired by TestPlant.\n\nThis is a modified private copy of the original software.\n\nNews\n----\n\n### 2021-01-29\n\nlibjpeg-turbo is now included as a git submodule\nand built using local build rules.\n\nThe build rules build now a universal app which\nsupports both Intel and Arm64 Macs.\n\n### 2017-12-15\n\nlibjpeg-turbo now is only needed for building.\nIt is no longer required for running the server.\n\nThe software license was updated from GPL 2 to GPL 3.\n\n### 2016-11-20\n\nBuilds now require https://sourceforge.net/projects/libjpeg-turbo/\nor a compatible libjpeg.\n\n### 2015-10-10\n\nVine VNC server now also works with high resolution (retina) displays\n(thanks to Tom Sealy who wrote the new code).\n\nBuilding\n--------\n\nVine VNC server requires Xcode to build a distributable packet from sources.\n\nIn addition, it uses the JPEG library [libjpeg-turbo](https://libjpeg-turbo.org/).\nThe source code for that library is included as a Git submodule.\n\n### Building from Xcode\n\nBuild the libjpeg-turbo library first by running `./build-libjpeg-turbo.sh`.\nThen open `OSXvnc.xcodeproj` in Xcode and build the \"Vine Server Package\".\n\nYou will find the distributable at /tmp/VineServer.dmg\n\n### Building from the command line\n\nRun these commands from the command line:\n\n    ./build-libjpeg-turbo.sh\n    xcodebuild -configuration Deployment\n\nAgain you will find the distributable at /tmp/VineServer.dmg\n\nLicense\n-------\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see <https://www.gnu.org/licenses/>\nor the file LICENSE in the distribution.\n\nLinks\n-----\n\nCVS repository at Sourceforge:\n* http://osxvnc.cvs.sourceforge.net/viewvc/osxvnc/\n\nOther Git clones of the CVS code:\n* https://github.com/aaronbrethorst/OSXVnc\n* https://github.com/browserstack/OSXVNC\n* https://github.com/eventials/OSXVnc\n* https://github.com/wingify/vnc\n\nDocumentation at TestPlant.com:\n* http://docs.testplant.com/?q=content/installing-vnc-server\n\nRFB Standard:\n* https://tools.ietf.org/html/rfc6143\n"
  },
  {
    "path": "VNCController.h",
    "content": "//\n//  VNCController.h\n//  OSXvnc\n//\n//  Created by Jonathan Gillaspie on Fri Aug 02 2002.\n//  Copyright (c) 2002 Redstone Software, Inc. All rights reserved.\n//\n\n#import <Cocoa/Cocoa.h>\n\n#import \"NSAuthorization.h\"\n\n@interface VNCController : NSObject {\n    IBOutlet NSMenuItem *startServerMenuItem;\n    IBOutlet NSMenuItem *stopServerMenuItem;\n\n    IBOutlet NSMenuItem *serverMenuItem;\n\n    IBOutlet NSWindow *statusWindow;\n    IBOutlet NSWindow *preferenceWindow;\n    IBOutlet NSWindow *reverseConnectionWindow;\n\n    // System Server UI\n    IBOutlet NSMenuItem *systemServerMenu;\n    IBOutlet NSWindow *systemServerWindow;\n\n    IBOutlet NSTextField *systemServerDisplayNameField;\n    IBOutlet NSPopUpButton *systemServerDisplayNumberField;\n    IBOutlet NSTextField *systemServerPortField;\n\n    IBOutlet NSMatrix *systemServerAuthenticationType;\n    IBOutlet NSTextField *systemServerPasswordField;\n    IBOutlet NSButton *systemServerLimitToLocalConnections;\n\n    IBOutlet NSButton *disableStartupButton;\n    IBOutlet NSButton *setStartupButton;\n\n    IBOutlet NSTextField *startupItemStatusMessageField;\n\n    // Control Panel\n    IBOutlet NSBox *hostNamesBox;\n    IBOutlet NSTextField *hostNamesField;\n    IBOutlet NSBox *ipAddressesBox;\n    IBOutlet NSMatrix *ipAddressesView;\n    IBOutlet NSTextField *displayNumText;\n    IBOutlet NSTextField *portNumText;\n\n    IBOutlet NSTextView *statusMessageField;\n    IBOutlet NSButton *startServerButton;\n    IBOutlet NSButton *stopServerButton;\n\n    // Preferences Interface\n    IBOutlet NSTabView *optionsTabView;\n    IBOutlet NSTextField *preferencesMessageTestField;\n\n    // Connection\n    IBOutlet NSTextField *displayNameField;\n    IBOutlet NSPopUpButton *displayNumberField;\n    IBOutlet NSTextField *portField;\n\n    IBOutlet NSMatrix *authenticationType;\n    IBOutlet NSTextField *passwordField;\n\n    IBOutlet NSButton *limitToLocalConnections;\n\n    // Device\n    IBOutlet NSButton *allowSleepCheckbox;\n    IBOutlet NSButton *allowDimmingCheckbox;\n    IBOutlet NSButton *allowScreenSaverCheckbox;\n\n    IBOutlet NSPopUpButton *keyboardLayout;\n\n    IBOutlet NSButton *swapMouseButtonsCheckbox;\n\n    // Advanced\n    IBOutlet NSPopUpButton *protocolVersion;\n    IBOutlet NSTextField *otherArguments;\n\n    IBOutlet NSButton *openGLCheckbox;\n    IBOutlet NSPopUpButton *keyboardEvents;\n    IBOutlet NSPopUpButton *eventSourcePopup;\n\n    // Sharing\n    IBOutlet NSMatrix *sharingMatrix;\n    IBOutlet NSButton *dontDisconnectCheckbox;\n    IBOutlet NSButton *disableRemoteEventsCheckbox;\n    IBOutlet NSButton *disableRichClipboardCheckbox;\n    IBOutlet NSButton *allowRendezvousCheckbox;\n\n    // Startup\n    IBOutlet NSButton *startServerOnLaunchCheckbox;\n    IBOutlet NSButton *terminateOnFastUserSwitch;\n    IBOutlet NSButton *serverKeepAliveCheckbox;\n\n\n    // Reverse Connections UI\n    IBOutlet NSTextField *connectHost;\n    IBOutlet NSTextField *connectPort;\n    IBOutlet NSTextField *reverseConnectionMessageField;\n\n    // Initial Settings UI\n    IBOutlet NSWindow *initialWindow;\n    IBOutlet NSTextField *initialPasswordText;\n    IBOutlet NSMatrix *initialAuthenticationType;\n    IBOutlet NSButton *initialDoneButton;\n\n    //int port;\n    BOOL systemServerIsConfigured;\n\n    BOOL alwaysShared;\n    BOOL neverShared;\n    BOOL userStopped;\n    BOOL relaunchServer;\n    BOOL doNotLoadProxy;\n\n    BOOL waitingForHostInfo;\n\n    NSTask *controller;\n    NSFileHandle *serverOutput;\n\n    NSString *passwordFile;\n    NSString *logFile;\n\n    NSAuthorization *myAuthorization;\n\n    NSDate *lastLaunchTime;\n    NSMutableArray *bundleArray;\n\n    NSArray *clientList;\n\n    NSString *hostName;\n\n    NSString *automaticReverseHost;\n    NSString *automaticReversePort;\n}\n\n- (instancetype) init;\n\n@property (NS_NONATOMIC_IOSONLY, readonly, strong) NSWindow *window;\n@property (NS_NONATOMIC_IOSONLY, readonly) int runningPortNum;\n\n- (void) awakeFromNib;\n\n- (void) loadUIForSystemServer;\n- (void) loadUIForPort: (NSInteger) port;\n\n- (void) loadUserDefaults: sender;\n- (void) saveUserDefaults: sender;\n\n- (IBAction) validateInitialAuthentication: sender;\n- (IBAction) setInitialAuthentication: sender;\n\n- (NSMutableArray *) formCommandLineForSystemServer: (BOOL) isSystemServer;\n\n- (IBAction) startServer: sender;\n- (IBAction) stopServer: sender;\n- (void) serverStopped: (NSNotification *) aNotification;\n\n- (IBAction) changeDisplayNumber: sender;\n- (IBAction) changePort: sender;\n- (IBAction) changeSharing: sender;\n- (IBAction) changeAuthenticationType: sender;\n- (IBAction) changePassword: sender;\n- (IBAction) changeDisplayName: sender;\n- (IBAction) optionChanged: sender;\n\n- (IBAction) changeSystemServerPort: sender;\n- (IBAction) changeSystemServerAuthentication: sender;\n\n- (IBAction) reverseConnection: sender;\n- (IBAction) cancelConnectHost: sender;\n- (IBAction) connectHost: sender;\n\n- (void) checkForRestart;\n\n- (void) applicationWillTerminate: (NSNotification *) notification;\n\n- (BOOL) validateMenuItem: (NSMenuItem *) menuItem ;\n\n// Menu Items\n- (IBAction) openFirewall:(id) sender;\n- (IBAction) openLog:(id) sender;\n- (IBAction) openGPL:(id) sender;\n- (IBAction) openReleaseNotes:(id) sender;\n- (IBAction) openFile:(id) sender;\n\n- (IBAction) installAsService: sender;\n- (IBAction) removeService: sender;\n\n- (IBAction) terminateRequest: sender;\n\n@end\n"
  },
  {
    "path": "VNCController.m",
    "content": "/*\n *  VNCController.m\n *  OSXvnc\n *\n *  Created by Jonathan Gillaspie on Fri Aug 02 2002.  osxvnc@redstonesoftware.com\n *  Copyright (c) 2002-2005 Redstone Software Inc. All rights reserved.\n *\n *  All Rights Reserved.\n *\n *  This is free software; you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation; either version 2 of the License, or\n *  (at your option) any later version.\n *\n *  This software is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this software; if not, write to the Free Software\n *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n *  USA.\n */\n\n#import \"VNCController.h\"\n\n#import \"OSXvnc-server/vncauth.h\"\n#import <signal.h>\n#import <unistd.h>\n#import <sys/socket.h>\n#import <netinet/in.h>\n#import <fcntl.h>\n#import <sys/types.h>\n#import <ifaddrs.h>\n#import <netdb.h>\n\n#define PasswordProxy @\"********\"\n\n#define LocalizedString(X)      [[NSBundle mainBundle] localizedStringForKey:(X) value:nil table:nil]\n\n@interface NSString (VNCExtensions)\n@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *string;\n@end\n@implementation NSString (VNCExtensions)\n- (NSString *) string {\n    return self;\n}\n@end\n@interface NSTextView (VNCExtensions)\n- (void) setStringValue: (NSString *) newString;\n@end\n@implementation NSTextView (VNCExtensions)\n- (void) setStringValue: (NSString *) newString {\n    self.string = newString;\n}\n@end\n\n@interface NSFileManager (VNCExtensions)\n- (BOOL) directoryExistsAtPath: (NSString *) path;\n- (BOOL) createFullDirectoryAtPath:(NSString *)path attributes:(NSDictionary *)attributes;\n- (BOOL) canWriteToFile: (NSString *) path;\n@end\n\n@implementation NSFileManager (VNCExtensions)\n\n- (BOOL) directoryExistsAtPath: (NSString *) path {\n    BOOL isDirectory = NO;\n\n    return ([self fileExistsAtPath:path isDirectory: &isDirectory] && isDirectory);\n}\n\n- (BOOL) createFullDirectoryAtPath:(NSString *)path attributes:(NSDictionary *)attributes {\n    return [self createDirectoryAtPath:path withIntermediateDirectories:YES attributes:attributes error:NULL];\n}\n\n- (BOOL) canWriteToFile: (NSString *) path {\n    if ([[NSFileManager defaultManager] fileExistsAtPath:path])\n        return [[NSFileManager defaultManager] isWritableFileAtPath:path];\n    else {\n        [[NSFileManager defaultManager] createFullDirectoryAtPath:path.stringByDeletingLastPathComponent attributes:nil];\n        return [[NSFileManager defaultManager] isWritableFileAtPath:path.stringByDeletingLastPathComponent];\n    }\n}\n\n@end\n\n\n@implementation VNCController\n\nstatic int shutdownSignal = 0;\nstatic NSColor *successColor;\nstatic NSColor *failureColor;\n\nstatic void terminateOnSignal(int signal) {\n    shutdownSignal = signal;\n    NSLog(@\"Trapped Signal %d -- Terminating\", shutdownSignal);\n    [NSApp terminate:NSApp];\n}\n\nstatic NSMutableString *hostNameString(void) {\n    char hostName[256];\n    gethostname(hostName, 256);\n\n    NSMutableString *hostNameString = [NSMutableString stringWithUTF8String:hostName];\n    if ([hostNameString hasSuffix:@\".local\"])\n        [hostNameString deleteCharactersInRange:NSMakeRange(hostNameString.length - 6, 6)];\n\n    return hostNameString;\n}\n\nstatic NSMutableArray *localIPAddresses(void) {\n    NSMutableArray *returnArray = [NSMutableArray array];\n    struct ifaddrs *ifa = NULL, *ifp = NULL;\n\n    if (getifaddrs (&ifp) < 0) {\n        return nil;\n    }\n\n    for (ifa = ifp; ifa; ifa = ifa->ifa_next) {\n        char ipString[256];\n        socklen_t salen;\n\n        if (ifa->ifa_addr->sa_family == AF_INET)\n            salen = sizeof (struct sockaddr_in);\n        else if (ifa->ifa_addr->sa_family == AF_INET6)\n            salen = sizeof (struct sockaddr_in6);\n        else\n            continue;\n\n        if (getnameinfo (ifa->ifa_addr, salen, ipString, sizeof (ipString), NULL, 0, NI_NUMERICHOST) == 0) {\n            [returnArray addObject:@(ipString)];\n        }\n    }\n\n    freeifaddrs (ifp);\n    return returnArray;\n}\n\n- (instancetype) init {\n    self = [super init];\n\n    // Transform the GUI into a \"ForegroundApp\" with Dock Icon and Menu\n    // This is so the server can run without a UI\n    // 10.3+ only\n    // ProcessSerialNumber psn = { 0, kCurrentProcess };\n    // OSStatus returnCode = TransformProcessType(& psn, kProcessTransformToForegroundApplication);\n    // if (returnCode != 0) {\n    //     NSLog(@\"Could not transform process type. Error %d\", returnCode);\n    // }\n    //\n    // if (![[NSUserDefaults standardUserDefaults] boolForKey:@\"autolaunch\"])\n    //     SetFrontProcess(& psn );\n    hostName = [hostNameString() retain];\n\n    successColor = [[NSColor colorWithDeviceRed:0.0 green:0.4 blue:0.0 alpha:1.0] retain];\n    failureColor = [[NSColor colorWithDeviceRed:0.6 green:0.0 blue:0.0 alpha:1.0] retain];\n\n    [[NSUserDefaults standardUserDefaults] registerDefaults: @{\n                                                               @\"PasswordFile\": @\"\",\n                                                               @\"LogFile\": @\"\",\n                                                               @\"desktopName\": [NSString stringWithFormat:@\"%@ (%@)\", hostName, NSUserName()],\n\n                                                               @\"portNumberSystemServer\": @\"5900\",\n                                                               @\"desktopNameSystemServer\": hostName,\n\n                                                               @\"allowSleep\": @\"NO\",\n                                                               @\"allowDimming\": @\"YES\",\n                                                               @\"allowScreenSaver\": @\"YES\",\n                                                               @\"swapButtons\": @\"YES\",\n                                                               @\"keyboardLayout\": @0,\n                                                               @\"keyboardEvents\": @3,\n                                                               @\"eventSource\": @2,\n\n                                                               @\"disableRemoteEvents\": @\"NO\",\n                                                               @\"disableRichClipboard\": @\"NO\",\n                                                               @\"allowRendezvous\": @\"YES\",\n                                                               @\"dontDisconnectClients\": @\"NO\",\n\n                                                               @\"startServerOnLaunch\": @\"NO\",\n                                                               @\"terminateOnFastUserSwitch\": @\"NO\",\n                                                               @\"serverKeepAlive\": @\"YES\",\n\n                                                               @\"protocolVersion\": @\"Default\",\n                                                               @\"otherArguments\": @\"\",\n\n                                                               @\"localhostOnly\": @\"NO\",\n                                                               @\"localhostOnlySystemServer\": @\"NO\",\n\n#if defined(WITH_EXTERNAL_IP)\n                                                               @\"externalIPURL\": @\"http://automation.whatismyip.com/n09230945.asp\",\n#endif\n\n                                                               @\"startupItemLocation\": @\"/Library/StartupItems/OSXvnc\",\n                                                               @\"launchdItemLocation\": @\"/Library/LaunchAgents/com.redstonesoftware.VineServer.plist\"\n                                                               }];\n\n    alwaysShared = FALSE;\n    neverShared = FALSE;\n    userStopped = FALSE;\n\n    automaticReverseHost = [[NSBundle mainBundle].infoDictionary[@\"ReverseHost\"] copy];\n    automaticReversePort  = [[NSBundle mainBundle].infoDictionary[@\"ReversePort\"] copy];\n\n    signal(SIGHUP, SIG_IGN);\n    signal(SIGABRT, terminateOnSignal);\n    signal(SIGINT, terminateOnSignal);\n    signal(SIGQUIT, terminateOnSignal);\n    signal(SIGBUS, terminateOnSignal);\n    signal(SIGSEGV, terminateOnSignal);\n    signal(SIGTERM, terminateOnSignal);\n    signal(SIGTSTP, terminateOnSignal);\n\n    return self;\n}\n\n- (IBAction) terminateRequest: sender {\n    if (clientList.count && !shutdownSignal)\n        NSBeginAlertSheet(LocalizedString(@\"Quit Vine Server\"),\n                          LocalizedString(@\"Cancel\"),\n                          LocalizedString(@\"Quit\"),\n                          nil, statusWindow, self, @selector(terminateSheetDidEnd:returnCode:contextInfo:), NULL, NULL,\n                          LocalizedString(@\"Disconnect %lu clients and quit Vine Server?\"), (unsigned long)clientList.count);\n    else\n        [NSApp terminate: self];\n}\n\n- (void) terminateSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void  *)contextInfo {\n    if (returnCode == NSAlertAlternateReturn) {\n        [sheet orderOut:self];\n        [NSApp terminate: self];\n    }\n}\n\n- (BOOL) authenticationIsValid {\n    return (automaticReverseHost.length || [[NSUserDefaults standardUserDefaults] dataForKey:@\"vncauth\"].length || [[NSUserDefaults standardUserDefaults] integerForKey:@\"AuthenticationType\"] > 1);\n}\n\n- (void) updateHostInfo {\n    // These commands can sometimes take a little while, so we have a dedicated thread for them\n    if (!waitingForHostInfo) {\n        waitingForHostInfo = TRUE;\n        [NSThread detachNewThreadSelector:@selector(dedicatedUpdateHostInfoThread) toTarget:self withObject:nil];\n    }\n}\n\n// Since this can block for a long time in certain DNS situations we will put this in a separate thread\n- (void) dedicatedUpdateHostInfoThread {\n    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];\n    NS_DURING {\n        // flushHostCache is no longer needed since OS X 10.6.\n#if 0\n        [NSHost flushHostCache];\n#endif\n\n        NSHost *currentHost = [NSHost currentHost];\n        NSMutableArray *commonHostNames = [currentHost.names mutableCopy];\n        NSMutableArray *commonIPAddresses = [currentHost.addresses mutableCopy];\n        NSMutableArray *displayIPAddresses = [NSMutableArray array];\n\n#if defined(WITH_EXTERNAL_IP)\n        NSURL *externalIP = [NSURL URLWithString:[[NSUserDefaults standardUserDefaults] stringForKey:@\"externalIPURL\"]];\n        NSData *externalIPData = [NSData dataWithContentsOfURL:externalIP];\n        NSString *externalIPString = (externalIPData.length ? [NSString stringWithUTF8String: externalIPData.bytes] : @\"\" );\n#endif\n\n        NSEnumerator *ipEnum = nil;\n        NSString *anIP = nil;\n        BOOL anyConnections = TRUE; // Sadly it looks like the local IP's bypass the firewall anyhow\n\n#if defined(WITH_EXTERNAL_IP)\n        if (externalIPString.length && [commonIPAddresses indexOfObject:externalIPString] == NSNotFound)\n            [commonIPAddresses insertObject:externalIPString atIndex:0];\n#endif\n\n        ipEnum = [commonIPAddresses objectEnumerator];\n        while (anIP = [ipEnum nextObject]) {\n#if defined(WITH_EXTERNAL_IP)\n            BOOL isExternal = [externalIPString isEqualToString:anIP];\n#else\n            bool isExternal = false;\n#endif\n            NSMutableAttributedString *ipString = [[[NSMutableAttributedString alloc] initWithString: anIP] autorelease];\n\n            if ([anIP hasPrefix:@\"127.0.0.1\"] || // localhost entries\n                [anIP rangeOfString:@\"::\"].location != NSNotFound) {\n                continue;\n            }\n            if (isExternal) {\n                [ipString replaceCharactersInRange:NSMakeRange(ipString.length,0) withString:@\"\\tExternal\"];\n            } else {\n                [ipString replaceCharactersInRange:NSMakeRange(ipString.length,0) withString:@\"\\tInternal\"];\n            }\n\n            if (controller && !limitToLocalConnections.state) { // Colorize and add tooltip\n\n                NSURL *testURL = [NSURL URLWithString:[NSString stringWithFormat:@\"http://%@:%d\",\n                                                       anIP, self.runningPortNum]];\n                NSData *testData = [NSData dataWithContentsOfURL:testURL];\n                NSString *testString = (testData.length\n                                        ? [NSString stringWithUTF8String: testData.bytes] : @\"\");\n\n                if ([testString hasPrefix:@\"RFB\"]) {\n                    [ipString replaceCharactersInRange:NSMakeRange(ipString.length,0) withString:@\"\\tNetwork is configured to allow connections to this IP\"];\n                    [ipString addAttribute:NSForegroundColorAttributeName value:successColor range:NSMakeRange(0,ipString.length)];\n                    anyConnections = TRUE;\n                }\n                else {\n                    [ipString replaceCharactersInRange:NSMakeRange(ipString.length,0) withString:@\"\\tNetwork is NOT configured to allow connections to this IP\"];\n                    [ipString addAttribute:NSForegroundColorAttributeName value:failureColor range:NSMakeRange(0,ipString.length)];\n                }\n            }\n            else // We don't want to warn about the firewall if we don't actually do the detection\n                anyConnections = TRUE;\n\n            [displayIPAddresses addObject: ipString];\n        }\n\n        if (!anyConnections)\n            [self performSelectorOnMainThread:@selector(addStatusMessage:) withObject: @\"\\n(It appears that your firewall is not permitting VNC connections)\" waitUntilDone:NO];\n\n        [self performSelectorOnMainThread:@selector(updateHostNames:) withObject: commonHostNames waitUntilDone:NO];\n        [self performSelectorOnMainThread:@selector(updateIPAddresses:) withObject: displayIPAddresses waitUntilDone:NO];\n\n        waitingForHostInfo = FALSE;\n    }\n    NS_HANDLER\n    NSLog(@\"Exception in updateHostInfo: %@\", localException);\n    NS_ENDHANDLER\n    [pool release];\n}\n\n// Display Host Names\n- (void) updateHostNames: (NSArray *) newHostNames {\n    NSMutableArray *commonHostNames = [[newHostNames mutableCopy] autorelease];\n    [commonHostNames removeObject:@\"localhost\"];\n\n    if (commonHostNames.count > 1) {\n        [hostNamesBox setTitle:LocalizedString(@\"Host Names\")];\n        hostNamesField.stringValue = [commonHostNames componentsJoinedByString:@\"\\n\"];\n    }\n    else if (commonHostNames.count == 1) {\n        [hostNamesBox setTitle:LocalizedString(@\"Host Name\")];\n        hostNamesField.stringValue = [commonHostNames componentsJoinedByString:@\"\\n\"];\n    }\n    else {\n        [hostNamesBox setTitle:LocalizedString(@\"Host Name\")];\n        hostNamesField.stringValue = @\"\";\n    }\n}\n\n// Display IP Info\n- (void) updateIPAddresses: (NSArray *) commonIPAddresses {\n    [ipAddressesView renewRows:0 columns:2];\n\n    id ipAddressEnum = [commonIPAddresses objectEnumerator];\n    id ipAddress = nil;\n    int i = 0;\n\n    while (ipAddress = [ipAddressEnum nextObject]) {\n        NSString *anIP = [ipAddress string];\n        if ([anIP hasPrefix:@\"127.0.0.1\"] || // localhost entries\n            [anIP rangeOfString:@\"::\"].location != NSNotFound) {\n            ;//[commonIPAddresses removeObject:anIP];\n        } else {\n            NSRange endOfIP = [anIP rangeOfString:@\"\\t\"];\n            NSAttributedString *ipString = ipAddress;\n            NSAttributedString *noteString = nil;\n            NSString *tooltipString = @\"\";\n\n            if (endOfIP.location != NSNotFound && [ipAddress isKindOfClass:[NSAttributedString class]]) {\n                ipString = [ipAddress attributedSubstringFromRange: NSMakeRange(0,endOfIP.location)];\n                noteString = [ipAddress attributedSubstringFromRange: NSMakeRange(endOfIP.location+1,[ipAddress length]-(endOfIP.location+1))];\n                endOfIP = [noteString.string rangeOfString:@\"\\t\"];\n                if (endOfIP.location != NSNotFound) {\n                    tooltipString = [noteString.string substringFromIndex:endOfIP.location+1];\n                    noteString = [noteString attributedSubstringFromRange: NSMakeRange(0,endOfIP.location)];\n                }\n            }\n\n            [ipAddressesView addRow];\n            [ipAddressesView cellAtRow:i column:0].attributedStringValue = ipString;\n            [ipAddressesView setToolTip:tooltipString forCell:[ipAddressesView cellAtRow:i column:0]];\n            [ipAddressesView cellAtRow:i column:1].attributedStringValue = noteString;\n            [ipAddressesView setToolTip:tooltipString forCell:[ipAddressesView cellAtRow:i column:1]];\n            i++;\n        }\n    }\n    [ipAddressesView sizeToCells];\n\n    if (commonIPAddresses.count > 1) {\n        [ipAddressesBox setTitle:LocalizedString(@\"IP Addresses\")];\n        //[ipAddressesField setStringValue:[commonIPAddresses componentsJoinedByString:@\"\\n\"]];\n    }\n    else {\n        [ipAddressesBox setTitle:LocalizedString(@\"IP Address\")];\n        //[ipAddressesField setStringValue:@\"\"];\n    }\n}\n\n- (void) addStatusMessage: message {\n    if ([message isKindOfClass:[NSAttributedString class]])\n        [statusMessageField.textStorage appendAttributedString:message];\n    else if ([message isKindOfClass:[NSString class]])\n        [statusMessageField.textStorage appendAttributedString:[[[NSAttributedString alloc] initWithString:message] autorelease]];\n}\n\n- (NSWindow *) window {\n    return preferenceWindow;\n}\n\n- (void) determinePasswordLocation {\n    NSArray *passwordFiles = @[[[NSUserDefaults standardUserDefaults] stringForKey:@\"PasswordFile\"],\n                               @\"~/.vinevncauth\",\n                               [[NSBundle mainBundle].bundlePath stringByAppendingPathComponent:@\".vinevncauth\"],\n                               @\"/tmp/.vinevncauth\"];\n    NSEnumerator *passwordEnumerators = [passwordFiles objectEnumerator];\n\n    [passwordFile release];\n    passwordFile = nil;\n    // Find first writable location for the password file\n    while (passwordFile = [passwordEnumerators nextObject]) {\n        passwordFile = passwordFile.stringByStandardizingPath;\n        if (passwordFile.length && [[NSFileManager defaultManager] canWriteToFile:passwordFile]) {\n            [passwordFile retain];\n            break;\n        }\n    }\n}\n\n- (void) determineLogLocation {\n    NSArray *logFiles = @[[[NSUserDefaults standardUserDefaults] stringForKey:@\"LogFile\"],\n                          @\"~/Library/Logs/VineServer.log\",\n                          @\"/var/log/VineServer.log\",\n                          @\"/tmp/VineServer.log\",\n                          [[NSBundle mainBundle].bundlePath stringByAppendingPathComponent:@\"VineServer.log\"]];\n    NSEnumerator *logEnumerators = [logFiles objectEnumerator];\n\n    [logFile release];\n    logFile = nil;\n    // Find first writable location for the log file\n    while (logFile = [logEnumerators nextObject]) {\n        logFile = logFile.stringByStandardizingPath;\n        if (logFile.length && [[NSFileManager defaultManager] canWriteToFile:logFile]) {\n            [logFile retain];\n            break;\n        }\n    }\n}\n\n- (void) awakeFromNib {\n    id infoDictionary = [NSBundle mainBundle].infoDictionary;\n\n    [self determinePasswordLocation];\n    [self determineLogLocation];\n\n    connectPort.stringValue = @\"\";\n    [connectPort.cell performSelector:@selector(setPlaceholderString:) withObject:@\"5500\"];\n\n    // Copy over old preferences found in OSXvnc\n    NSDictionary *oldPrefs = [[NSUserDefaults standardUserDefaults] persistentDomainForName:@\"OSXvnc\"];\n\n    if (!oldPrefs[@\"Converted\"]) {\n        [[NSUserDefaults standardUserDefaults] registerDefaults:oldPrefs];\n        [self loadUserDefaults: self];\n        [self saveUserDefaults: self];\n        oldPrefs = [oldPrefs mutableCopy];\n        ((NSMutableDictionary *)oldPrefs)[@\"Converted\"] = [NSNumber numberWithBool:TRUE]; // Record that we've converted\n        [[NSUserDefaults standardUserDefaults] setPersistentDomain:oldPrefs\n                                                           forName:@\"OSXvnc\"]; // write it back\n    }\n    else\n        [self loadUserDefaults: self];\n\n    statusWindow.title = [NSString stringWithFormat:@\"%@: %@\",\n                          infoDictionary[@\"CFBundleName\"],\n                          displayNameField.stringValue];\n\n    [optionsTabView selectTabViewItemAtIndex:0];\n\n    systemServerIsConfigured = ([[NSFileManager defaultManager] fileExistsAtPath:[[NSUserDefaults standardUserDefaults] stringForKey:@\"startupItemLocation\"]] ||\n                                [[NSFileManager defaultManager] fileExistsAtPath:[[NSUserDefaults standardUserDefaults] stringForKey:@\"launchdItemLocation\"]]);\n    [self loadUIForSystemServer];\n\n    stopServerButton.keyEquivalent = @\"\";\n    startServerButton.keyEquivalent = @\"\\r\";\n\n    preferencesMessageTestField.stringValue = @\"\";\n\n    // First we'll update with the quick-lookup information that doesn't hang\n    [self updateHostNames:@[hostName]];\n    [self updateIPAddresses: localIPAddresses()];\n\n    [self updateHostInfo];\n}\n\n- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {\n    if (startServerOnLaunchCheckbox.state)// && [self authenticationIsValid])\n        [self startServer: self];\n    if (!NSApp.hidden)\n        [statusWindow makeMainWindow];\n}\n\n- (void)applicationDidBecomeActive:(NSNotification *)aNotification {\n    if (!statusWindow.visible)\n        [statusWindow makeKeyAndOrderFront:self];\n    [self updateHostInfo];\n}\n\n// This is sent when the server's screen params change,\n// the server can't handle this right now so we'll restart.\n- (void)applicationDidChangeScreenParameters:(NSNotification *)aNotification {\n    [self addStatusMessage:@\"\\n\"];\n    [self addStatusMessage:LocalizedString(@\"Screen Resolution changed - Server Reinitialized\")];\n}\n\n- (void) updateUIForConnectionList: (NSArray *) connectionList {\n    NSMutableString *statusMessage = [NSMutableString string];\n\n    [clientList autorelease];\n    clientList = [connectionList copy];\n\n    NSUInteger activeConnectionsCount = clientList.count;\n\n    if (!passwordField.stringValue.length)\n        [statusMessage appendFormat:@\"%@(%@)\", LocalizedString(@\"Server Running\"),\n         LocalizedString(@\"No Authentication\")];\n    else\n        [statusMessage appendString: LocalizedString(@\"Server Running\")];\n\n    [statusMessage appendString:@\"\\n\"];\n\n    if (activeConnectionsCount == 0)\n        [statusMessage appendString: LocalizedString(@\"No Clients Connected\")];\n    else if (activeConnectionsCount == 1) {\n        [statusMessage appendFormat: @\"%d \", 1];\n        [statusMessage appendString: LocalizedString(@\"Client Connected: \")];\n        [statusMessage appendString: [clientList[0] valueForKey:@\"clientIP\"]];\n    }\n    else if (activeConnectionsCount > 1) {\n        [statusMessage appendFormat: @\"%lu \", (unsigned long)activeConnectionsCount];\n        [statusMessage appendString: LocalizedString(@\"Clients Connected: \")];\n        [statusMessage appendString:\n         [[clientList valueForKey:@\"clientIP\"] componentsJoinedByString:@\", \"]];\n    }\n    [statusMessageField setStringValue: statusMessage];\n\n    if (activeConnectionsCount == 0) {\n        [[NSApp performSelector:@selector(dockTile)]\n         performSelector:@selector(setBadgeLabel:) withObject:@\"\"];\n    } else {\n        [[NSApp performSelector:@selector(dockTile)]\n         performSelector:@selector(setBadgeLabel:) withObject:[NSString stringWithFormat:@\"%lu\",\n                                                               (unsigned long)activeConnectionsCount]];\n    }\n}\n\n- (void)activeConnections: (NSNotification *) aNotification {\n    [self updateUIForConnectionList: aNotification.userInfo[@\"clientList\"]];\n}\n\n- (int) scanForOpenPort: (int) tryPort {\n    int listen_fd4=0;\n    int value=1;\n    struct sockaddr_in sin4;\n    bzero(&sin4, sizeof(sin4));\n    sin4.sin_len = sizeof(sin4);\n    sin4.sin_family = AF_INET;\n    sin4.sin_addr.s_addr = htonl(INADDR_ANY);\n\n    // I'm going to only scan on IPv4 since our OSXvnc is going to register in both spaces\n    //  struct sockaddr_in6 sin6;\n    //  int listen_fd6=0;\n\n    //  bzero(&sin6, sizeof(sin6));\n    //  sin6.sin6_len = sizeof(sin6);\n    //  sin6.sin6_family = AF_INET6;\n    //  sin6.sin6_addr = in6addr_any;\n\n    while (tryPort < 5910) {\n        sin4.sin_port = htons(tryPort);\n        //sin6.sin6_port = htons(tryPort);\n\n        if ((listen_fd4 = socket(PF_INET, SOCK_STREAM, 0)) < 0) {\n            //NSLog(@\"Socket init failed %d\", tryPort);\n        }\n        else if (fcntl(listen_fd4, F_SETFL, O_NONBLOCK) < 0) {\n            //rfbLogPerror(\"fcntl O_NONBLOCK failed\");\n        }\n        else if (setsockopt(listen_fd4, SOL_SOCKET, SO_REUSEADDR, &value, sizeof(value)) < 0) {\n            //NSLog(@\"setsockopt SO_REUSEADDR failed %d\", tryPort);\n        }\n        else if (bind(listen_fd4, (struct sockaddr *) &sin4, sizeof(sin4)) < 0) {\n            //NSLog(@\"Failed to bind socket: port %d may be in use by another VNC\", tryPort);\n        }\n        else if (listen(listen_fd4, 5) < 0) {\n            //NSLog(@\"Listen failed %d\", tryPort);\n        }\n        /*\n         else if ((listen_fd6 = socket(PF_INET6, SOCK_STREAM, 0)) < 0) {\n         // NSLog(@\"Socket init 6 failed %d\", tryPort);\n         }\n         else if (fcntl(listen_fd6, F_SETFL, O_NONBLOCK) < 0) {\n         // rfbLogPerror(\"IPv6: fcntl O_NONBLOCK failed\");\n         }\n         else if (setsockopt(listen_fd6, SOL_SOCKET, SO_REUSEADDR, &value, sizeof(value)) < 0) {\n         //NSLog(@\"setsockopt 6 SO_REUSEADDR failed %d\", tryPort);\n         }\n         else if (bind(listen_fd6, (struct sockaddr *) &sin6, sizeof(sin6)) < 0) {\n         //NSLog(@\"Failed to bind socket: port %d may be in use by another VNC\", tryPort);\n         }\n         else if (listen(listen_fd6, 5) < 0) {\n         //NSLog(@\"Listen failed %d\", tryPort);\n         }\n         */\n        else {\n            close(listen_fd4);\n            //close(listen_fd6);\n\n            return tryPort;\n        }\n        close(listen_fd4);\n        //close(listen_fd6);\n\n        tryPort++;\n    }\n\n    [statusMessageField setStringValue:LocalizedString(@\"Unable to find open port 5900-5909\")];\n\n    return 0;\n}\n\n\n- (int) runningPortNum {\n    return portNumText.intValue;\n}\n\n- (void) loadUIForSystemServer {\n    if (systemServerIsConfigured) {\n        startupItemStatusMessageField.textColor = successColor;\n        [startupItemStatusMessageField setStringValue:LocalizedString(@\"Startup Item Configured (Started)\")];\n    }\n    else {\n        startupItemStatusMessageField.textColor = failureColor;\n        [startupItemStatusMessageField setStringValue:LocalizedString(@\"Startup Item Disabled (Stopped)\")];\n    }\n\n    disableStartupButton.enabled = systemServerIsConfigured;\n    systemServerMenu.state = (systemServerIsConfigured ? NSOnState : NSOffState);\n    setStartupButton.title = (systemServerIsConfigured ? LocalizedString(@\"Restart System Server\") : LocalizedString(@\"Start System Server\"));\n}\n\n- (void) loadAuthenticationUI {\n    NSUInteger authType = [[NSUserDefaults standardUserDefaults] integerForKey:@\"AuthenticationType\"];\n\n    if ([[NSUserDefaults standardUserDefaults] dataForKey:@\"vncauth\"].length) {\n        [passwordField setStringValue:PasswordProxy];\n        [authenticationType selectCellWithTag:1];\n    }\n    else if (authType == 2) {\n        [authenticationType selectCellWithTag: 2];\n    }\n\n    limitToLocalConnections.state = [[NSUserDefaults standardUserDefaults] boolForKey:@\"localhostOnly\"];\n}\n\n- (void) loadSystemServerAuthenticationUI {\n    if ([[NSUserDefaults standardUserDefaults] dataForKey:@\"vncauthSystemServer\"].length) {\n        [systemServerPasswordField setStringValue:PasswordProxy];\n        [systemServerAuthenticationType selectCellWithTag:1];\n    }\n    else { // if (authType == 2) {\n        [systemServerAuthenticationType selectCellWithTag: 2];\n    }\n\n    systemServerLimitToLocalConnections.state = [[NSUserDefaults standardUserDefaults] boolForKey:@\"localhostOnlySystemServer\"];\n}\n\n- (void) loadUIForPort: (NSInteger) port {\n    if (port) {\n        if (port < 5900 || port > 5909)\n            [displayNumberField selectItemWithTitle:@\"--\"];\n        else\n            [displayNumberField selectItemWithTitle:[NSString stringWithFormat:@\"%d\", (int)(port - 5900)]];\n        portField.stringValue = [NSString stringWithFormat:@\"%u\", (unsigned)port];\n        displayNumText.stringValue = displayNumberField.title;\n        portNumText.stringValue = [NSString stringWithFormat:@\"%u\", (unsigned)port];\n    } else {\n        [displayNumberField selectItemWithTitle:@\"Auto\"];\n        port = [self scanForOpenPort:5900];\n\n        if (port) {\n            portField.stringValue = @\"\";\n            [portField.cell performSelector:@selector(setPlaceholderString:)\n                                 withObject:[NSString stringWithFormat:@\"%u\", (unsigned)port]];\n            displayNumText.intValue = (int)(port - 5900);\n            portNumText.stringValue = [NSString stringWithFormat:@\"%u\", (unsigned)port];\n        }\n    }\n}\n\n- (void) loadUIForSystemServerPort: (NSInteger) port {\n    if (port) {\n        if (port < 5900 || port > 5909)\n            [systemServerDisplayNumberField selectItemWithTitle:@\"--\"];\n        else\n            [systemServerDisplayNumberField selectItemWithTitle:[NSString stringWithFormat:@\"%d\",\n                                                                 (int)(port - 5900)]];\n        systemServerPortField.stringValue = [NSString stringWithFormat:@\"%u\", (unsigned)port];\n    }\n    else {\n        [systemServerDisplayNumberField selectItemWithTitle:@\"Auto\"];\n        port = [self scanForOpenPort:5900];\n\n        if (port) {\n            systemServerPortField.stringValue = @\"\";\n            [systemServerPortField.cell performSelector:@selector(setPlaceholderString:)\n                                             withObject:[NSString stringWithFormat:@\"%u\",\n                                                         (unsigned)port]];\n        }\n    }\n}\n\n- (void) loadUserDefaults: sender {\n    [self loadAuthenticationUI];\n    [self loadSystemServerAuthenticationUI];\n\n    [self loadUIForPort: [[NSUserDefaults standardUserDefaults] integerForKey:@\"portNumber\"]];\n    [self loadUIForSystemServerPort: [[NSUserDefaults standardUserDefaults] integerForKey:@\"portNumberSystemServer\"]];\n\n    displayNameField.stringValue = [[NSUserDefaults standardUserDefaults] stringForKey:@\"desktopName\"];\n    systemServerDisplayNameField.stringValue = [[NSUserDefaults standardUserDefaults] stringForKey:@\"desktopNameSystemServer\"];\n\n    allowSleepCheckbox.state = [[NSUserDefaults standardUserDefaults] boolForKey:@\"allowSleep\"];\n    allowDimmingCheckbox.state = [[NSUserDefaults standardUserDefaults] boolForKey:@\"allowDimming\"];\n    allowScreenSaverCheckbox.state = [[NSUserDefaults standardUserDefaults] boolForKey:@\"allowScreenSaver\"];\n    swapMouseButtonsCheckbox.state = [[NSUserDefaults standardUserDefaults] boolForKey:@\"swapButtons\"];\n    [keyboardLayout selectItemAtIndex:[keyboardLayout indexOfItemWithTag:[[NSUserDefaults standardUserDefaults] integerForKey:@\"keyboardLayout\"]]];\n    [keyboardEvents selectItemAtIndex:[keyboardEvents indexOfItemWithTag:[[NSUserDefaults standardUserDefaults] integerForKey:@\"keyboardEvents\"]]];\n    [eventSourcePopup selectItemAtIndex:[eventSourcePopup indexOfItemWithTag:[[NSUserDefaults standardUserDefaults] integerForKey:@\"eventSource\"]]];\n\n    disableRemoteEventsCheckbox.state = [[NSUserDefaults standardUserDefaults] boolForKey:@\"disableRemoteEvents\"];\n    disableRichClipboardCheckbox.state = [[NSUserDefaults standardUserDefaults] boolForKey:@\"disableRichClipboard\"];\n    allowRendezvousCheckbox.state = [[NSUserDefaults standardUserDefaults] boolForKey:@\"allowRendezvous\"];\n\n    [sharingMatrix selectCellWithTag: [[NSUserDefaults standardUserDefaults] integerForKey:@\"sharingMode\"]];\n    dontDisconnectCheckbox.state = [[NSUserDefaults standardUserDefaults] boolForKey:@\"dontDisconnectClients\"];\n    [self changeSharing:self];\n\n    if ([[NSUserDefaults standardUserDefaults] floatForKey:@\"protocolVersion\"] > 0.0)\n        [protocolVersion selectItemWithTitle:[[NSUserDefaults standardUserDefaults] stringForKey:@\"protocolVersion\"]];\n    otherArguments.stringValue = [[NSUserDefaults standardUserDefaults] stringForKey:@\"otherArguments\"];\n\n    startServerOnLaunchCheckbox.state = [[NSUserDefaults standardUserDefaults] boolForKey:@\"startServerOnLaunch\"];\n    terminateOnFastUserSwitch.state = [[NSUserDefaults standardUserDefaults] boolForKey:@\"terminateOnFastUserSwitch\"];\n    serverKeepAliveCheckbox.state = [[NSUserDefaults standardUserDefaults] boolForKey:@\"serverKeepAlive\"];\n}\n\n- (void) saveUserDefaults: sender {\n    if (displayNameField.stringValue.length)\n        [[NSUserDefaults standardUserDefaults] setObject:displayNameField.stringValue forKey:@\"desktopName\"];\n\n    if (displayNumberField.selectedItem.tag == 0)\n        [[NSUserDefaults standardUserDefaults] setInteger:0 forKey:@\"portNumber\"];\n    else\n        [[NSUserDefaults standardUserDefaults] setInteger:portField.intValue forKey:@\"portNumber\"];\n\n    [[NSUserDefaults standardUserDefaults] setInteger:(authenticationType.selectedCell).tag forKey:@\"AuthenticationType\"];\n\n    // System Server\n    {\n        if (systemServerDisplayNameField.stringValue.length)\n            [[NSUserDefaults standardUserDefaults] setObject:systemServerDisplayNameField.stringValue forKey:@\"desktopNameSystemServer\"];\n\n        if (systemServerDisplayNumberField.selectedItem.tag == 0)\n            [[NSUserDefaults standardUserDefaults] setInteger:0 forKey:@\"portNumberSystemServer\"];\n        else\n            [[NSUserDefaults standardUserDefaults] setInteger:systemServerPortField.intValue forKey:@\"portNumberSystemServer\"];\n\n        [[NSUserDefaults standardUserDefaults] setInteger:(systemServerAuthenticationType.selectedCell).tag forKey:@\"AuthenticationTypeSystemServer\"];\n        [[NSUserDefaults standardUserDefaults] setBool:systemServerLimitToLocalConnections.state forKey:@\"localhostOnlySystemServer\"];\n    }\n\n    [[NSUserDefaults standardUserDefaults] setBool:swapMouseButtonsCheckbox.state forKey:@\"swapButtons\"];\n\n    [[NSUserDefaults standardUserDefaults] setInteger:(sharingMatrix.selectedCell).tag forKey:@\"sharingMode\"];\n    [[NSUserDefaults standardUserDefaults] setBool:dontDisconnectCheckbox.state forKey:@\"dontDisconnectClients\"];\n    [[NSUserDefaults standardUserDefaults] setBool:disableRemoteEventsCheckbox.state forKey:@\"disableRemoteEvents\"];\n    [[NSUserDefaults standardUserDefaults] setBool:disableRichClipboardCheckbox.state forKey:@\"disableRichClipboard\"];\n\n    [[NSUserDefaults standardUserDefaults] setBool:limitToLocalConnections.state forKey:@\"localhostOnly\"];\n    [[NSUserDefaults standardUserDefaults] setBool:allowRendezvousCheckbox.state forKey:@\"allowRendezvous\"];\n\n    [[NSUserDefaults standardUserDefaults] setBool:startServerOnLaunchCheckbox.state forKey:@\"startServerOnLaunch\"];\n    [[NSUserDefaults standardUserDefaults] setBool:terminateOnFastUserSwitch.state forKey:@\"terminateOnFastUserSwitch\"];\n    [[NSUserDefaults standardUserDefaults] setBool:serverKeepAliveCheckbox.state forKey:@\"serverKeepAlive\"];\n\n    [[NSUserDefaults standardUserDefaults] setBool:allowSleepCheckbox.state forKey:@\"allowSleep\"];\n    [[NSUserDefaults standardUserDefaults] setBool:allowDimmingCheckbox.state forKey:@\"allowDimming\"];\n    [[NSUserDefaults standardUserDefaults] setBool:allowScreenSaverCheckbox.state forKey:@\"allowScreenSaver\"];\n\n    [[NSUserDefaults standardUserDefaults] setInteger:keyboardLayout.selectedItem.tag forKey:@\"keyboardLayout\"];\n    [[NSUserDefaults standardUserDefaults] setInteger:keyboardEvents.selectedItem.tag forKey:@\"keyboardEvents\"];\n    [[NSUserDefaults standardUserDefaults] setInteger:eventSourcePopup.selectedItem.tag forKey:@\"eventSource\"];\n\n    if (protocolVersion.titleOfSelectedItem.floatValue > 0.0)\n        [[NSUserDefaults standardUserDefaults] setFloat:protocolVersion.titleOfSelectedItem.floatValue forKey:@\"protocolVersion\"];\n    else\n        [[NSUserDefaults standardUserDefaults] removeObjectForKey:@\"protocolVersion\"];\n\n    [[NSUserDefaults standardUserDefaults] setObject:otherArguments.stringValue\n                                              forKey:@\"otherArguments\"];\n\n    [[NSUserDefaults standardUserDefaults] synchronize];\n}\n\n- (void) startServer: sender {\n    NSArray *argv;\n\n    if (controller) {\n        // Set to relaunch and then try to shut-down\n        relaunchServer = TRUE;\n        [self stopServer: self];\n        return;\n    }\n    if (![preferenceWindow makeFirstResponder:preferenceWindow]) {\n        [preferenceWindow endEditingFor:nil];\n    }\n    if (![statusWindow makeFirstResponder:statusWindow]) {\n        [statusWindow endEditingFor:nil];\n    }\n    if (displayNumberField.selectedItem.tag == 0) {\n        [self loadUIForPort:0];  // To update the UI on the likely port that we will get\n    }\n\n\n    if (![self authenticationIsValid]) {\n        [NSApp beginSheet: initialWindow modalForWindow:statusWindow modalDelegate:nil didEndSelector: NULL contextInfo: NULL];\n        return;\n    }\n    if ([[NSUserDefaults standardUserDefaults] dataForKey:@\"vncauth\"] && ![[[NSUserDefaults standardUserDefaults] dataForKey:@\"vncauth\"] writeToFile: passwordFile atomically:NO]) {\n        [self addStatusMessage:@\"Unable to start - problem writing vnc password file\"];\n        return;\n    }\n\n    if ((argv = [self formCommandLineForSystemServer: NO])) {\n        NSDictionary *infoDictionary = [NSBundle mainBundle].infoDictionary;\n\n        NSString *executionPath = [[NSBundle mainBundle].bundlePath\n                                   stringByAppendingPathComponent: @\"Contents/MacOS/OSXvnc-server\"];\n        NSString *noteStartup = [NSString stringWithFormat:@\"%@\\tStarting %@ %@(%@)\\n\",\n                                 [NSDate date], [NSProcessInfo processInfo].processName,\n                                 [infoDictionary valueForKey:@\"CFBundleShortVersion\"],\n                                 [infoDictionary valueForKey:@\"CFBundleVersion\"]];\n\n        [self determineLogLocation];\n        if (![[NSFileManager defaultManager] fileExistsAtPath:logFile]) {\n            [[NSFileManager defaultManager] createFileAtPath:logFile contents:nil attributes:nil];\n        }\n        else { // Clear it\n            serverOutput = [NSFileHandle fileHandleForUpdatingAtPath:logFile];\n            [serverOutput truncateFileAtOffset:0];\n            [serverOutput closeFile];\n        }\n        serverOutput = [[NSFileHandle fileHandleForUpdatingAtPath:logFile] retain];\n        [serverOutput writeData:[noteStartup dataUsingEncoding: NSUTF8StringEncoding]];\n        [serverOutput writeData:[[argv componentsJoinedByString:@\" \"] dataUsingEncoding: NSUTF8StringEncoding]];\n        [serverOutput writeData:[@\"\\n\\n\" dataUsingEncoding: NSUTF8StringEncoding]];\n\n        controller = [[NSTask alloc] init];\n        controller.launchPath = executionPath;\n        controller.arguments = argv;\n        controller.standardOutput = serverOutput;\n        controller.standardError = serverOutput;\n\n        [[NSDistributedNotificationCenter defaultCenter] addObserver:self\n                                                            selector:@selector(activeConnections:)\n                                                                name:@\"VNCConnections\"\n                                                              object:[NSString stringWithFormat:@\"OSXvnc%d\", self.runningPortNum]\n                                                  suspensionBehavior:NSNotificationSuspensionBehaviorDeliverImmediately];\n\n        [controller launch];\n\n        [lastLaunchTime release];\n        lastLaunchTime = [[NSDate date] retain];\n\n        [[NSNotificationCenter defaultCenter] addObserver: self\n                                                 selector: NSSelectorFromString(@\"serverStopped:\")\n                                                     name: NSTaskDidTerminateNotification\n                                                   object: controller];\n\n        if (!passwordField.stringValue.length)\n            [statusMessageField setStringValue:[NSString stringWithFormat:@\"%@ - %@\", LocalizedString(@\"Server Running\"), LocalizedString(@\"No Authentication\")]];\n        else\n            [statusMessageField setStringValue:LocalizedString(@\"Server Running\")];\n        //[startServerButton setEnabled:FALSE];\n        [startServerButton setTitle:LocalizedString(@\"Restart Server\")];\n        [startServerMenuItem setTitle:LocalizedString(@\"Restart Server\")];\n        [stopServerButton setEnabled:TRUE];\n        serverMenuItem.state = NSOnState;\n        // We really don't want people to accidentally stop the server\n        //[startServerButton setKeyEquivalent:@\"\"];\n        //[stopServerButton setKeyEquivalent:@\"\\r\"];\n        userStopped = FALSE;\n\n        /* Only auto-connect the very first time ??; */\n        if (automaticReverseHost.length) {\n            [self addStatusMessage:[NSString stringWithFormat:@\"\\n%@: %@\", LocalizedString(@\"Initiating Reverse Connection To Host\"), automaticReverseHost]];\n            //  [automaticReverseHost release];\n            //  automaticReverseHost = nil;\n            //  [automaticReversePort release];\n            //  automaticReversePort = nil;\n        }\n\n        // Give the server a second to launch\n        [self performSelector:@selector(updateHostInfo) withObject:nil afterDelay:1.0];\n    }\n}\n\n- (void) stopServer: sender {\n    [self updateHostInfo];\n\n    if (controller != nil) {\n        userStopped = TRUE;\n        [controller terminate];\n    }\n    else {\n        [statusMessageField setStringValue:LocalizedString(@\"The server is stopped.\")];\n    }\n}\n\n- (void) serverStopped: (NSNotification *) aNotification {\n    // If we don't get the notification soon enough, we may have already restarted\n    if (controller.running) {\n        return;\n    }\n\n    [[NSDistributedNotificationCenter defaultCenter] removeObserver:self\n                                                               name:@\"VNCConnections\"\n                                                             object:[NSString stringWithFormat:@\"OSXvnc%d\", self.runningPortNum]];\n\n    [[NSNotificationCenter defaultCenter] removeObserver: self\n                                                    name: NSTaskDidTerminateNotification\n                                                  object: controller];\n\n    [self updateUIForConnectionList:[NSArray array]];\n\n    preferencesMessageTestField.stringValue = @\"\";\n    [startServerButton setTitle:LocalizedString(@\"Start Server\")];\n    [startServerMenuItem setTitle:LocalizedString(@\"Start Server\")];\n    //[startServerButton setEnabled:TRUE];\n    [stopServerButton setEnabled:FALSE];\n    serverMenuItem.state = NSOffState;\n    //[stopServerButton setKeyEquivalent:@\"\"];\n    //[startServerButton setKeyEquivalent:@\"\\r\"];\n\n    if (userStopped)\n        [statusMessageField setStringValue:LocalizedString(@\"The server is stopped.\")];\n    else if (controller.terminationStatus==250) {\n        NSMutableString *messageString = [NSMutableString stringWithFormat: LocalizedString(@\"Vine Server can't listen on the specified port (%d).\"), self.runningPortNum];\n        [messageString appendString:@\"\\n\"];\n        if (systemServerIsConfigured)\n            [messageString appendString:LocalizedString(@\"Probably because the VNC server is already running as a Startup Item.\")];\n        else\n            [messageString appendString:LocalizedString(@\"Probably because another VNC is already using this port.\")];\n        [statusMessageField setStringValue:messageString];\n    }\n    else if (controller.terminationStatus) {\n        [statusMessageField setStringValue:[NSString stringWithFormat:LocalizedString(@\"The server has stopped running. See Log (%d)\\n\"), controller.terminationStatus]];\n    }\n    else\n        [statusMessageField setStringValue:LocalizedString(@\"The server has stopped running\")];\n\n    if (!userStopped &&\n        serverKeepAliveCheckbox.state &&\n        controller.terminationStatus >= 0 &&\n        controller.terminationStatus <= 64 &&\n        -lastLaunchTime.timeIntervalSinceNow > 1.0)\n        relaunchServer = YES;\n\n    [controller release];\n    controller = nil;\n    [serverOutput closeFile];\n    [serverOutput release];\n    serverOutput = nil;\n\n    // If it crashes in less than a second it probably can't launch\n    if (relaunchServer) {\n        relaunchServer = NO;\n        [self startServer:self];\n    }\n}\n\n- (NSMutableArray *) formCommandLineForSystemServer: (BOOL) isSystemServer {\n    NSMutableArray *argv = [NSMutableArray array];\n\n    if (isSystemServer) {\n        [argv addObject:@\"-rfbport\"];\n        if (systemServerDisplayNumberField.selectedItem.tag == 0)\n            [argv addObject:@\"0\"];\n        else\n            [argv addObject:[NSString stringWithFormat:@\"%d\", systemServerPortField.intValue]];\n\n        if (systemServerDisplayNameField.stringValue.length) {\n            [argv addObject:@\"-desktop\"];\n            [argv addObject:systemServerDisplayNameField.stringValue];\n        }\n\n        switch ((systemServerAuthenticationType.selectedCell).tag) {\n            case 2:\n                [argv addObject:@\"-rfbnoauth\"];\n                break;\n            case 1:\n            default:\n                if (passwordFile && [[NSFileManager defaultManager] fileExistsAtPath:passwordFile]) {\n                    [argv addObject:@\"-rfbauth\"];\n                    [argv addObject:passwordFile];\n                }\n                else {\n                    [startupItemStatusMessageField setStringValue:LocalizedString(@\"Error: Valid VNC password required to start server\")];\n                    return nil;\n                }\n                break;\n        }\n\n        if (systemServerLimitToLocalConnections.state)\n            [argv addObject:@\"-localhost\"];\n\n        [argv addObject:@\"-SystemServer\"];\n        [argv addObject:@\"1\"];\n    }\n    else {\n        [argv addObject:@\"-rfbport\"];\n        if (displayNumberField.selectedItem.tag == 0)\n            [argv addObject:@\"0\"];\n        else\n            [argv addObject:[NSString stringWithFormat:@\"%d\", portField.intValue]];\n\n        if (displayNameField.stringValue.length) {\n            [argv addObject:@\"-desktop\"];\n            [argv addObject:displayNameField.stringValue];\n        }\n\n        [argv addObject:@\"-donotloadproxy\"];\n\n        switch ((authenticationType.selectedCell).tag) {\n            case 2:\n                [argv addObject:@\"-rfbnoauth\"];\n                break;\n            case 1:\n            default:\n                if (passwordFile && [[NSFileManager defaultManager] fileExistsAtPath:passwordFile]) {\n                    [argv addObject:@\"-rfbauth\"];\n                    [argv addObject:passwordFile];\n                }\n                else {\n                    [self addStatusMessage:[NSString stringWithFormat:@\"\\n%@\", LocalizedString(@\"Valid VNC password required to start server\")]];\n                    return nil;\n                }\n                break;\n        }\n\n        if (automaticReverseHost.length) {\n            [argv addObject:@\"-connectHost\"];\n            [argv addObject:automaticReverseHost];\n\n            if (automaticReversePort.intValue) {\n                [argv addObject:@\"-connectPort\"];\n                [argv addObject: automaticReversePort];\n            }\n        }\n\n        if (limitToLocalConnections.state)\n            [argv addObject:@\"-localhost\"];\n    }\n\n    if (alwaysShared)\n        [argv addObject:@\"-alwaysshared\"];\n    if (neverShared)\n        [argv addObject:@\"-nevershared\"];\n    if (dontDisconnectCheckbox.state && !alwaysShared)\n        [argv addObject:@\"-dontdisconnect\"];\n\n    if (allowSleepCheckbox.state)\n        [argv addObject:@\"-allowsleep\"];\n    if (!allowDimmingCheckbox.state)\n        [argv addObject:@\"-nodimming\"];\n    if (!allowScreenSaverCheckbox.state)\n        [argv addObject:@\"-disableScreenSaver\"];\n\n    if (protocolVersion.titleOfSelectedItem.floatValue > 0.0) {\n        [argv addObject:@\"-protocol\"];\n        [argv addObject:protocolVersion.titleOfSelectedItem];\n    }\n\n    [argv addObject:@\"-restartonuserswitch\"];\n    [argv addObject:(terminateOnFastUserSwitch.state ? @\"Y\" : @\"N\")];\n\n    switch (keyboardLayout.selectedItem.tag) {\n        case 2:\n            [argv addObject:@\"-UnicodeKeyboard\"];\n            [argv addObject:@\"1\"];\n            [argv addObject:@\"-keyboardLoading\"];\n            [argv addObject:@\"N\"];\n            [argv addObject:@\"-pressModsForKeys\"];\n            [argv addObject:@\"Y\"];\n            break;\n        case 1:\n            [argv addObject:@\"-UnicodeKeyboard\"];\n            [argv addObject:@\"0\"];\n            [argv addObject:@\"-keyboardLoading\"];\n            [argv addObject:@\"Y\"];\n            [argv addObject:@\"-pressModsForKeys\"];\n            [argv addObject:@\"Y\"];\n            break;\n        case 0:\n        default:\n            [argv addObject:@\"-UnicodeKeyboard\"];\n            [argv addObject:@\"0\"];\n            [argv addObject:@\"-keyboardLoading\"];\n            [argv addObject:@\"N\"];\n            [argv addObject:@\"-pressModsForKeys\"];\n            [argv addObject:@\"N\"];\n            break;\n    }\n    [argv addObject:@\"-EventTap\"];\n    [argv addObject:[NSString stringWithFormat:@\"%ld\", keyboardEvents.selectedItem.tag]];\n    [argv addObject:@\"-EventSource\"];\n    [argv addObject:[NSString stringWithFormat:@\"%ld\", eventSourcePopup.selectedItem.tag]];\n\n\n    if (swapMouseButtonsCheckbox.state)\n        [argv addObject:@\"-swapButtons\"];\n    if (disableRemoteEventsCheckbox.state)\n        [argv addObject:@\"-disableRemoteEvents\"];\n    if (disableRichClipboardCheckbox.state)\n        [argv addObject:@\"-disableRichClipboards\"];\n\n    [argv addObject:@\"-rendezvous\"];\n    [argv addObject:(allowRendezvousCheckbox.state ? @\"Y\" : @\"N\")];\n\n    if ([[NSUserDefaults standardUserDefaults] objectForKey:@\"rfbDeferUpdateTime\"]) {\n        [argv addObject:@\"-deferupdate\"];\n        [argv addObject:[[NSUserDefaults standardUserDefaults] stringForKey:@\"rfbDeferUpdateTime\"]];\n    }\n\n    if (otherArguments.stringValue.length)\n        [argv addObjectsFromArray:[otherArguments.stringValue componentsSeparatedByString:@\" \"]];\n\n    return argv;\n}\n\n- (void)controlTextDidChange:(NSNotification *)aNotification {\n    if ([aNotification.object isKindOfClass:[NSControl class]]) {\n        if ([aNotification.object target] && ([aNotification.object action] != NULL)) {\n            [[aNotification.object target] performSelector: [aNotification.object action] withObject: aNotification.object];\n        }\n    }\n}\n\n- (IBAction) validateInitialAuthentication: sender {\n    NSString *passwordString = initialPasswordText.stringValue;\n\n    if (sender == initialPasswordText && passwordString.length) {\n        [initialAuthenticationType selectCellWithTag:1];\n        [initialDoneButton setEnabled: TRUE];\n    }\n    else if (sender == initialAuthenticationType) {\n        long newAuth = (initialAuthenticationType.selectedCell).tag;\n        if (newAuth == 1) {\n            initialPasswordText.stringValue = @\"\";\n            [initialDoneButton setEnabled: FALSE];\n            [initialPasswordText.window makeFirstResponder: initialPasswordText];\n        }\n        // No Auth\n        else { //if (newAuth == 2) {\n            initialPasswordText.stringValue = @\"\";\n            [initialPasswordText.window makeFirstResponder: nil];\n            [initialDoneButton setEnabled: TRUE];\n        }\n    }\n    else {\n        [initialDoneButton setEnabled: FALSE];\n    }\n}\n\n- (IBAction) setInitialAuthentication: sender {\n    NSString *passwordString = initialPasswordText.stringValue;\n    long newAuth = (initialAuthenticationType.selectedCell).tag;\n\n    // VNC Password\n    if (newAuth == 1) {\n        [[NSUserDefaults standardUserDefaults] setObject:[NSData dataWithBytes:(const void *)vncEncryptPasswd(passwordString.UTF8String) length:8] forKey:@\"vncauth\"];\n    }\n    // No Auth\n    else if (newAuth == 2) {\n        [[NSFileManager defaultManager] removeItemAtPath:passwordFile error:NULL];\n        [[NSUserDefaults standardUserDefaults] removeObjectForKey:@\"vncauth\"];\n        passwordField.stringValue = @\"\";\n    }\n    [[NSUserDefaults standardUserDefaults] setInteger:(initialAuthenticationType.selectedCell).tag forKey:@\"AuthenticationType\"];\n\n    [self loadAuthenticationUI];\n\n    [initialWindow orderOut:self];\n    [NSApp endSheet: initialWindow];\n\n    if (startServerOnLaunchCheckbox.state)\n        [self startServer: self];\n}\n\n- (void) changeDisplayNumber: sender {\n    [self loadUIForPort: displayNumberField.selectedItem.tag];\n\n    if (sender != self) {\n        [self saveUserDefaults: self];\n        [self checkForRestart];\n    }\n}\n\n- (void) changePort: sender {\n    [self loadUIForPort: portField.intValue];\n\n    if (sender != self) {\n        [self saveUserDefaults: self];\n        [self checkForRestart];\n    }\n}\n\n- (void) changeSharing: sender {\n    long selected = (sharingMatrix.selectedCell).tag;\n    if (selected == 1) {\n        // Always shared.\n        alwaysShared = TRUE;\n        neverShared = FALSE;\n        [dontDisconnectCheckbox setEnabled:NO];\n    } else if (selected == 2) {\n        // Never shared.\n        alwaysShared = FALSE;\n        neverShared = TRUE;\n        [dontDisconnectCheckbox setEnabled:YES];\n    } else {\n        // Not always or never shared.\n        alwaysShared = FALSE;\n        neverShared = FALSE;\n        [dontDisconnectCheckbox setEnabled:YES];\n    }\n\n    if (sender != self) {\n        [self saveUserDefaults: self];\n        [self checkForRestart];\n    }\n}\n\n- (IBAction) changeAuthenticationType: sender {\n    long newAuth = (authenticationType.selectedCell).tag;\n\n    if (newAuth != [[NSUserDefaults standardUserDefaults] integerForKey:@\"AuthenticationType\"]) {\n        // VNC Password\n        if (newAuth == 1) {\n            passwordField.stringValue = @\"\";\n            [preferenceWindow makeFirstResponder: passwordField];\n        }\n        // No Auth\n        else if (newAuth == 2) {\n            [[NSFileManager defaultManager] removeItemAtPath:passwordFile error:NULL];\n            [[NSUserDefaults standardUserDefaults] removeObjectForKey:@\"vncauth\"];\n            passwordField.stringValue = @\"\";\n            [preferenceWindow makeFirstResponder: nil];\n        }\n\n        if (sender != self) {\n            [self saveUserDefaults: self];\n            [self checkForRestart];\n        }\n    }\n}\n\n- (void) changePassword: sender {\n    NSString *passwordString = [sender stringValue];\n\n    if (passwordString.length && ![passwordString isEqualToString:PasswordProxy]) {\n        [authenticationType selectCellWithTag:1];\n        [[NSUserDefaults standardUserDefaults] setObject:[NSData dataWithBytes:(const void *)vncEncryptPasswd(passwordString.UTF8String) length:8] forKey:@\"vncauth\"];\n\n        if (sender != self) {\n            [self saveUserDefaults: self];\n            [self checkForRestart];\n        }\n    }\n}\n\n- (IBAction) changeDisplayName: sender {\n    if (![displayNameField.stringValue isEqualToString:[[NSUserDefaults standardUserDefaults] objectForKey:@\"desktopName\"]] && sender != self) {\n        [self saveUserDefaults: self];\n        statusWindow.title = [NSString stringWithFormat:@\"%@: %@\",\n                              [NSBundle mainBundle].infoDictionary[@\"CFBundleName\"],\n                              displayNameField.stringValue];\n        [self checkForRestart];\n    }\n}\n\n- (IBAction) optionChanged: sender {\n    if (sender != self) {\n        [self saveUserDefaults: sender];\n        [self checkForRestart];\n    }\n}\n\n- (void) changeSystemServerPort: sender {\n    if (sender == systemServerPortField)\n        [self loadUIForSystemServerPort: systemServerPortField.intValue];\n    else\n        [self loadUIForSystemServerPort: systemServerDisplayNumberField.selectedItem.tag];\n\n    [self saveUserDefaults: self];\n}\n\n- (IBAction) changeSystemServerAuthentication: sender {\n    NSString *passwordString = systemServerPasswordField.stringValue;\n    long sysServerAuthType = (systemServerAuthenticationType.selectedCell).tag;\n\n    if (sender == systemServerPasswordField && passwordString.length && ![passwordString isEqualToString:PasswordProxy]) {\n        char *encPassword = vncEncryptPasswd(passwordString.UTF8String);\n\n        [systemServerAuthenticationType selectCellWithTag:1];\n        [[NSUserDefaults standardUserDefaults] setObject:[NSData dataWithBytes:(const void *)encPassword length:8] forKey:@\"vncauthSystemServer\"];\n    }\n\n    if (sender == systemServerAuthenticationType &&\n        sysServerAuthType != [[NSUserDefaults standardUserDefaults] integerForKey:@\"AuthenticationTypeSystemServer\"]) {\n        // VNC Password\n        [[NSUserDefaults standardUserDefaults] setInteger:sysServerAuthType forKey:@\"AuthenticationTypeSystemServer\"];\n        if (sysServerAuthType == 1) {\n            systemServerPasswordField.stringValue = @\"\";\n            [systemServerWindow makeFirstResponder: systemServerPasswordField];\n        }\n        // No Auth\n        else if (sysServerAuthType == 2) {\n            [[NSUserDefaults standardUserDefaults] removeObjectForKey:@\"vncauthSystemServer\"];\n            systemServerPasswordField.stringValue = @\"\";\n            [systemServerWindow makeFirstResponder: nil];\n        }\n    }\n}\n\n// Bring up the Reverse Connection Window In A Sheet...\n- (IBAction) reverseConnection: sender {\n    reverseConnectionMessageField.stringValue = @\"\";\n    [NSApp beginSheet:reverseConnectionWindow modalForWindow:statusWindow modalDelegate:self didEndSelector:NULL contextInfo:NULL];\n}\n\n- (IBAction) cancelConnectHost: sender {\n    [NSApp endSheet: reverseConnectionWindow];\n    [reverseConnectionWindow orderOut:self];\n}\n\n// This will issue a Distributed Notification to add a VNC client\n- (IBAction) connectHost: sender {\n    NSMutableDictionary *argumentsDict = [NSMutableDictionary dictionaryWithObjectsAndKeys:connectHost.stringValue,@\"ConnectHost\",connectPort.stringValue,@\"ConnectPort\",nil];\n\n    if (!connectHost.stringValue.length) {\n        [reverseConnectionMessageField setStringValue:LocalizedString(@\"Please specify a Connect Host to establish a connection\")];\n        return;\n    }\n    if (!connectPort.intValue) {\n        argumentsDict[@\"ConnectPort\"] = @\"5500\";\n    }\n\n    if (!controller) {\n        [self startServer: self];\n        usleep(500000); // Give that server time to start\n    }\n\n    [[NSDistributedNotificationCenter defaultCenter] postNotificationName:@\"VNCConnectHost\"\n                                                                   object:[NSString stringWithFormat:@\"OSXvnc%d\", self.runningPortNum]\n                                                                 userInfo:argumentsDict\n                                                       deliverImmediately:YES];\n\n    usleep(500000); // Give notification time to post\n\n    if (kill(controller.processIdentifier, SIGCONT) == 0) {\n        [self addStatusMessage: @\"\\n\"];\n        [self addStatusMessage: LocalizedString(@\"Connection invitation sent to Connect Host\")];\n    }\n    else {\n        [self addStatusMessage: @\"\\n\"];\n        [self addStatusMessage:[NSString stringWithFormat:LocalizedString(@\"Error sending invitation: %s\"), strerror(errno)]];\n    }\n\n    if (statusWindow.attachedSheet == reverseConnectionWindow) {\n        [NSApp endSheet: reverseConnectionWindow];\n        [reverseConnectionWindow orderOut:self];\n    }\n}\n\n- (void) checkForRestart {\n    if (controller) {\n        if (![statusMessageField.textStorage.string hasSuffix: LocalizedString(@\"Option Change Requires a Restart\")]) {\n            [self addStatusMessage: @\"\\n\"];\n            [self addStatusMessage: LocalizedString(@\"Option Change Requires a Restart\")];\n        }\n\n        [preferencesMessageTestField setStringValue:LocalizedString(@\"Option Change Requires a Restart\")];\n    }\n}\n\n- (void) applicationWillTerminate: (NSNotification *) notification {\n    [self stopServer: self];\n    [preferenceWindow endEditingFor: nil];\n    [statusWindow endEditingFor: nil];\n\n    [self saveUserDefaults:self];\n}\n\n- (BOOL) validateMenuItem: (NSMenuItem *) menuItem {\n    // Disable the 'start server' menu item when the server is already started.\n    // Disable the 'stop server' menu item when the server is not running.\n    //    if ((menuItem == startServerMenuItem) && controller) {\n    //        return FALSE;\n    //    }\n    if ((menuItem == stopServerMenuItem) && (!controller)) {\n        return FALSE;\n    }\n\n    return TRUE;\n}\n\n- (IBAction) openFirewall:(id) sender {\n    [[NSWorkspace sharedWorkspace] openFile: @\"/System/Library/PreferencePanes/Security.prefPane\"];\n}\n\n- (IBAction) openLog:(id) sender {\n    [[NSWorkspace sharedWorkspace] openFile:logFile];\n}\n\n- (IBAction) openGPL:(id) sender {\n    NSString *openPath = [[NSBundle mainBundle] pathForResource:@\"Copying\" ofType:@\"rtf\"];\n\n    [[NSWorkspace sharedWorkspace] openFile:openPath];\n}\n\n- (IBAction) openReleaseNotes:(id) sender {\n    NSString *openPath = [[NSBundle mainBundle] pathForResource:@\"Vine Server Release Notes\" ofType:@\"rtf\"];\n\n    [[NSWorkspace sharedWorkspace] openFile:openPath];\n}\n\n- (IBAction) openFile:(id) sender {\n    NSString *openPath = [[NSBundle mainBundle] pathForResource:[sender title] ofType:@\"rtf\"];\n\n    if (!openPath) {\n        openPath = [[NSBundle mainBundle] pathForResource:[sender title] ofType:@\"pdf\"];\n    }\n    if (!openPath) {\n        openPath = [[NSBundle mainBundle] pathForResource:[sender title] ofType:@\"txt\"];\n    }\n    if (!openPath) {\n        openPath = [[NSBundle mainBundle] pathForResource:[sender title] ofType:nil];\n    }\n\n    [[NSWorkspace sharedWorkspace] openFile:openPath];\n}\n\n- (BOOL) installLaunchd {\n    BOOL success = TRUE;\n    NSMutableDictionary *launchdDictionary = [NSMutableDictionary dictionary];\n    NSString *launchdPath = [[NSUserDefaults standardUserDefaults] stringForKey:@\"launchdItemLocation\"];\n    NSString *logLocation = @\"/Library/Logs/VineServer.log\";\n    NSString *oldPasswordFile = passwordFile;\n    NSData *vncauth = [[NSUserDefaults standardUserDefaults] dataForKey:@\"vncauthSystemServer\"];\n\n    NSString *launchdResources = @\"/Library/Application Support/VineServer\";\n\n    // If VineServer resources directory doesn't exist then create it\n    if (![[NSFileManager defaultManager] fileExistsAtPath:launchdResources]) {\n        success &= [myAuthorization executeCommand:@\"/bin/mkdir\"\n                                          withArgs:@[@\"-p\", launchdResources]];\n        success &= [myAuthorization executeCommand:@\"/usr/sbin/chown\"\n                                          withArgs:@[@\"-R\", @\"root:wheel\", launchdResources]];\n        if (!success) {\n            [startupItemStatusMessageField setStringValue:LocalizedString(@\"Error: Unable to setup VineServer folder\")];\n            success = FALSE;\n        }\n    }\n\n    if (vncauth.length) {\n        passwordFile = [launchdResources stringByAppendingPathComponent: @\".vinevncauth\"];\n        [vncauth writeToFile:@\"/tmp/.vinevncauth\" atomically:YES];\n        if (![myAuthorization executeCommand:@\"/bin/mv\"\n                                    withArgs:@[@\"-f\", @\"/tmp/.vinevncauth\", passwordFile]]) {\n            [startupItemStatusMessageField setStringValue:LocalizedString(@\"Error: Unable To Setup Password File\")];\n            success = FALSE;\n        }\n    }\n    NSMutableArray *argv = [self formCommandLineForSystemServer: YES];\n    passwordFile = oldPasswordFile;\n\n    if (success && argv) {\n        NSMutableArray *copyArgsArray = [NSMutableArray array];\n        NSString *executionPath = [[NSBundle mainBundle].bundlePath\n                                   stringByAppendingPathComponent: @\"Contents/MacOS/OSXvnc-server\"];\n\n        // Copy Server Executable\n        [copyArgsArray removeAllObjects];\n        [copyArgsArray addObject:@\"-R\"]; // Recursive\n        [copyArgsArray addObject:@\"-f\"]; // Force Copy (overwrite existing)\n        [copyArgsArray addObject:executionPath];\n        [copyArgsArray addObject:launchdResources];\n\n        if (![myAuthorization executeCommand:@\"/bin/cp\" withArgs:copyArgsArray]) {\n            [startupItemStatusMessageField setStringValue:LocalizedString(@\"Error: Unable to copy OSXvnc-server executable\")];\n            return FALSE;\n        }\n\n        // Copy All Bundles\n        NSEnumerator *bundleEnum = [[NSBundle pathsForResourcesOfType:@\"bundle\" inDirectory:[NSBundle mainBundle].resourcePath] objectEnumerator];\n        NSString *bundlePath = nil;\n\n        while (bundlePath = [bundleEnum nextObject]) {\n            [copyArgsArray removeAllObjects];\n            [copyArgsArray addObject:@\"-R\"]; // Recursive\n            [copyArgsArray addObject:@\"-f\"]; // Force Copy (overwrite existing)\n            [copyArgsArray addObject:bundlePath];\n            [copyArgsArray addObject:[launchdResources stringByAppendingPathComponent:@\"Resources\"]];\n\n            if (![myAuthorization executeCommand:@\"/bin/cp\" withArgs:copyArgsArray]) {\n                startupItemStatusMessageField.stringValue = [NSString stringWithFormat:@\"Error: Unable to copy bundle:%@\", bundlePath.lastPathComponent];\n                return FALSE;\n            }\n        }\n        success &= [myAuthorization executeCommand:@\"/bin/chmod\"\n                                          withArgs:@[@\"-R\", @\"755\", launchdResources]];\n\n        // Configure PLIST\n        launchdDictionary[@\"Label\"] = @\"VineServer\";\n        [argv insertObject:[launchdResources stringByAppendingPathComponent:@\"OSXvnc-server\"] atIndex:0];\n        launchdDictionary[@\"ProgramArguments\"] = argv;\n\n        launchdDictionary[@\"KeepAlive\"] = [NSNumber numberWithBool:TRUE];\n        launchdDictionary[@\"RunAtLoad\"] = [NSNumber numberWithBool:TRUE];\n        //[launchdDictionary setObject:[NSNumber numberWithInt:1] forKey:@\"ExitTimeOut\"]; // Send a KILL signal after 1 second\n        launchdDictionary[@\"StandardOutPath\"] = logLocation;\n        launchdDictionary[@\"StandardErrorPath\"] = logLocation;\n        launchdDictionary[@\"LimitLoadToSessionType\"] = @[@\"Aqua\",@\"LoginWindow\"];\n\n        // Write to file\n        NSString *tempPath = [@\"/tmp\" stringByAppendingPathComponent:launchdPath.lastPathComponent];\n        [launchdDictionary writeToFile:tempPath atomically:NO];\n        success &= [myAuthorization executeCommand:@\"/usr/sbin/chown\"\n                                          withArgs:@[@\"-R\", @\"root:wheel\", tempPath]];\n        success &= [myAuthorization executeCommand:@\"/bin/chmod\"\n                                          withArgs:@[@\"-R\", @\"744\", tempPath]];\n        // Install to launchdPath\n        success &= [myAuthorization executeCommand:@\"/bin/mv\"\n                                          withArgs:@[@\"-f\", tempPath, launchdPath]];\n\n        //Setup Log File (for multiple user access)\n        success &= [myAuthorization executeCommand:@\"/usr/bin/touch\"\n                                          withArgs:@[logLocation]];\n        success &= [myAuthorization executeCommand:@\"/usr/sbin/chown\"\n                                          withArgs:@[@\"-R\", @\"root:wheel\", logLocation]];\n        success &= [myAuthorization executeCommand:@\"/bin/chmod\"\n                                          withArgs:@[@\"-R\", @\"666\", logLocation]];\n\n\n        // Launch Using launchctl\n        success &= [myAuthorization executeCommand:@\"/bin/launchctl\"\n                                          withArgs:@[@\"load\", @\"-S\", @\"Aqua\", launchdPath]];\n\n        if (!success) {\n            [startupItemStatusMessageField setStringValue:LocalizedString(@\"Error: Unable To Setup Vine Server using launchd\")];\n        }\n    }\n\n    return success;\n}\n\n- (void) installAsService {\n    if (!myAuthorization)\n        myAuthorization = [[NSAuthorization alloc] init];\n\n    if (!myAuthorization) {\n        [startupItemStatusMessageField setStringValue:LocalizedString(@\"Error: No Authorization\")];\n        return;\n    }\n\n    // Remove Old SystemServer\n    [self removeService: self];\n    systemServerIsConfigured = [self installLaunchd];\n\n    [self loadUIForSystemServer];\n\n    [myAuthorization release];\n    myAuthorization = nil;\n}\n\n- (IBAction) installAsService: sender {\n    // No password, so double check\n    if (!passwordField.stringValue.length) {\n        NSBeginAlertSheet(LocalizedString(@\"System Server\"),\n                          LocalizedString(@\"Cancel\"),\n                          LocalizedString(@\"Start Server\"),\n                          nil, systemServerWindow, self, @selector(serviceSheetDidEnd:returnCode:contextInfo:),\n                          NULL, NULL, @\"%@\",\n                          LocalizedString(@\"No password has been specified for the System Server.  The System Server will automatic launch every time your machine is restarted.  Are you sure that you want to install a System Server with no password\"));\n    }\n    else {\n        [self installAsService];\n    }\n}\n\n- (void) serviceSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void  *)contextInfo {\n    if (returnCode==NSAlertDefaultReturn)\n        return;\n    else\n        [self installAsService];\n}\n\n- (IBAction) removeService: sender {\n    BOOL success = TRUE;\n    NSString *startupPath = [[NSUserDefaults standardUserDefaults] stringForKey:@\"startupItemLocation\"];\n    NSString *launchdPath = [[NSUserDefaults standardUserDefaults] stringForKey:@\"launchdItemLocation\"];\n\n    if (!myAuthorization)\n        myAuthorization = [[NSAuthorization alloc] init];\n\n    if (!myAuthorization) {\n        [startupItemStatusMessageField setStringValue:LocalizedString(@\"Error: No Authorization\")];\n        return;\n    }\n\n    if ([[NSFileManager defaultManager] fileExistsAtPath: startupPath]) {\n        // Kill any running system servers, necessary since old OSXvnc scripts don't work on Leopard\n        success &= [myAuthorization executeCommand:[NSString stringWithFormat:@\"%@/OSXvnc/OSXvnc\", [NSBundle mainBundle].resourcePath]\n                                          withArgs:@[@\"stop\"]];\n        success &= [myAuthorization executeCommand:@\"/bin/rm\"\n                                          withArgs:@[@\"-r\", @\"-f\", startupPath]];\n    }\n    if ([[NSFileManager defaultManager] fileExistsAtPath:launchdPath]) {\n        success &= [myAuthorization executeCommand:@\"/bin/launchctl\"\n                                          withArgs:@[@\"unload\", @\"-S\", @\"Aqua\", launchdPath]];\n        success &= [myAuthorization executeCommand:@\"/bin/rm\"\n                                          withArgs:@[@\"-r\", @\"-f\", launchdPath]];\n    }\n\n    if (success) {\n        systemServerIsConfigured = FALSE;\n        [self loadUIForSystemServer];\n    }\n    else {\n        [startupItemStatusMessageField setStringValue:LocalizedString(@\"Error: Unabled to remove startup item\")];\n    }\n\n    if (sender != self) {\n        [myAuthorization release];\n        myAuthorization = nil;\n    }\n}\n\n- (void) dealloc {\n    [passwordFile release];\n    [logFile release];\n    [myAuthorization release];\n    myAuthorization = nil;\n    [bundleArray release];\n    bundleArray = nil;\n\n    [super dealloc];\n}\n\n@end\n"
  },
  {
    "path": "Version.txt",
    "content": "5.3.1\n"
  },
  {
    "path": "VineServer-Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>English</string>\n\t<key>CFBundleExecutable</key>\n\t<string>${EXECUTABLE_NAME}</string>\n\t<key>CFBundleGetInfoString</key>\n\t<string>__PRODUCT_VERSION__ - (C) 2013 TestPlant, Inc., (C) __YEAR__ Stefan Weil </string>\n\t<key>CFBundleIconFile</key>\n\t<string>VineServer.icns</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>Vine Server</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersion</key>\n\t<string>__PRODUCT_VERSION__</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>__PRODUCT_VERSION__</string>\n\t<key>CFBundleSignature</key>\n\t<string>vncS</string>\n\t<key>CFBundleVersion</key>\n\t<string>__BUILD_VERSION__</string>\n\t<key>LSApplicationCategoryType</key>\n\t<string>public.app-category.utilities</string>\n\t<key>NSHelpFile</key>\n\t<string>Vine Server.pdf</string>\n\t<key>NSHighResolutionCapable</key>\n\t<true/>\n\t<key>NSHumanReadableCopyright</key>\n\t<string>© __YEAR__ Stefan Weil</string>\n\t<key>NSMainNibFile</key>\n\t<string>MainMenu</string>\n\t<key>NSPrincipalClass</key>\n\t<string>NSApplication</string>\n\t<key>ReverseHost</key>\n\t<string></string>\n\t<key>ReversePort</key>\n\t<string></string>\n</dict>\n</plist>\n"
  },
  {
    "path": "build-libjpeg-turbo.sh",
    "content": "#!/bin/sh\n\nset -e\n\nexport CFLAGS=\"-mmacosx-version-min=10.11 -Wall\"\n\nCMAKE_BUILD_TYPE=Release\nNUMCPUS=$(sysctl -n hw.ncpu)\n\nMACOSX_DEPLOYMENT_TARGET=10.11\nexport MACOSX_DEPLOYMENT_TARGET\n\n# Get submodule libjepg-turbo.\ngit submodule update --init libjpeg-turbo\n\ncd libjpeg-turbo\n\nmkdir -p macosarmv8\npushd macosarmv8\ncmake .. -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_OSX_ARCHITECTURES=arm64\nmake -j $NUMCPUS\npopd\n\nmkdir -p macosx8664\npushd macosx8664\ncmake .. -DARMV8_BUILD=../macosarmv8 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_OSX_ARCHITECTURES=x86_64\nmake -j $NUMCPUS\npopd\n\nln -sf macosarmv8/jconfig.h .\n"
  },
  {
    "path": "de.lproj/Copying.rtf",
    "content": "{\\rtf1\\mac\\ansicpg10000\\cocoartf824\\cocoasubrtf410\n{\\fonttbl\\f0\\fswiss\\fcharset77 Helvetica;\\f1\\froman\\fcharset77 Times-Roman;\\f2\\fmodern\\fcharset77 Courier;\n\\f3\\fnil\\fcharset77 LucidaGrande;}\n{\\colortbl;\\red255\\green255\\blue255;}\n\\paperw11900\\paperh16840\\margl1440\\margr1440\\vieww16260\\viewh17880\\viewkind0\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\qc\n\n\\f0\\fs24 \\cf0 GNU GENERAL PUBLIC LICENSE\\\n(Deutsche \\'86bersetzung)\\\n\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\n\n\\f1 \\cf0 Urspr\\'9fnglich erstellt im Auftrag der S.u.S.E.\\'caGmbH \\'d0\n\\f2 http://www.suse.de\n\\f3\n\\f1 von Katja Lachmann \\'86bersetzungen,\n\\f3 \\uc0\\u8232\n\\f1 \\'9fberarbeitet von {\\field{\\*\\fldinst{HYPERLINK \"http://www.peter.gerwinski.de/\"}}{\\fldrslt Peter Gerwinski}}, G-N-U GmbH \\'d0\n\\f2 http://www.g-n-u.de\n\\f3\n\\f1 (31.\\'caOktober 1996, 4.\\'caJuni 2000)\\\n\\pard\\tx566\\tx1133\\tx1700\\tx2267\\tx2834\\tx3401\\tx3968\\tx4535\\tx5102\\tx5669\\tx6236\\tx6803\\pardirnatural\n\n\\f2 \\cf0 \\\n\\pard\\tx566\\tx1133\\tx1700\\tx2267\\tx2834\\tx3401\\tx3968\\tx4535\\tx5102\\tx5669\\tx6236\\tx6803\\ql\\qnatural\\pardirnatural\n\n\\f1 \\cf0 Diese \\'86bersetzung wird mit der Absicht angeboten, das Verst\\'8andnis der GNU General Public License (GNU GPL) zu erleichtern. Es handelt sich jedoch nicht um eine offizielle oder im rechtlichen Sinne anerkannte \\'86bersetzung.\\\nDie Free Software Foundation (FSF) ist nicht der Herausgeber dieser \\'86bersetzung, und sie hat diese \\'86bersetzung auch nicht als rechtskr\\'8aftigen Ersatz f\\'9fr die Original-GNU-GPL anerkannt. Da die \\'86bersetzung nicht sorgf\\'8altig von Anw\\'8alten \\'9fberpr\\'9fft wurde, k\\'9annen die \\'86bersetzer nicht garantieren, da\\'a7 die \\'86bersetzung die rechtlichen Aussagen der GNU GPL exakt wiedergibt. Wenn Sie sichergehen wollen, da\\'a7 von Ihnen geplante Aktivit\\'8aten im Sinne der GNU GPL gestattet sind, halten Sie sich bitte an die {\\field{\\*\\fldinst{HYPERLINK \"http://www.gnu.org/licenses/gpl.html\"}}{\\fldrslt englischsprachige Originalversion}}.\\\nDie \\'86bersetzer und die Free Software Foundation m\\'9achten Sie darum bitten, diese \\'86bersetzung nicht als offizielle Lizenzbedingungen f\\'9fr von Ihnen geschriebene Programme zu verwenden. Bitte benutzen Sie hierf\\'9fr stattdessen die von der Free Software Foundation herausgegebene {\\field{\\*\\fldinst{HYPERLINK \"http://www.gnu.org/licenses/gpl.html\"}}{\\fldrslt englischsprachige Originalversion}}.\\\n\n\\f2 \\\n\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\qc\n\n\\f0 \\cf0 GNU GENERAL PUBLIC LICENSE\\\n\\pard\\tx566\\tx1133\\tx1700\\tx2267\\tx2834\\tx3401\\tx3968\\tx4535\\tx5102\\tx5669\\tx6236\\tx6803\\qc\\pardirnatural\n\n\\f1 \\cf0 Deutsche \\'86bersetzung der Version 2, Juni 1991\\\n\\pard\\tx566\\tx1133\\tx1700\\tx2267\\tx2834\\tx3401\\tx3968\\tx4535\\tx5102\\tx5669\\tx6236\\tx6803\\ql\\qnatural\\pardirnatural\n\\cf0 \\\nCopyright \\'a9 1989, 1991\\\nFree Software Foundation, Inc.\n\\f3 \\uc0\\u8232\n\\f1 51 Franklin St, Fifth Floor, Boston, MA 02110, USA\\\n\\\nEs ist jedermann gestattet, diese Lizenzurkunde zu vervielf\\'8altigen und unver\\'8anderte Kopien zu verbreiten; \\'80nderungen sind jedoch nicht erlaubt.\\\nDiese \\'86bersetzung ist kein rechtskr\\'8aftiger Ersatz f\\'9fr die {\\field{\\*\\fldinst{HYPERLINK \"http://www.gnu.org/licenses/gpl.html\"}}{\\fldrslt englischsprachige Originalversion}}!\\\n\\\n\\pard\\tx566\\tx1133\\tx1700\\tx2267\\tx2834\\tx3401\\tx3968\\tx4535\\tx5102\\tx5669\\tx6236\\tx6803\\qc\\pardirnatural\n\\cf0 Vorwort\\\n\\\n\\pard\\tx566\\tx1133\\tx1700\\tx2267\\tx2834\\tx3401\\tx3968\\tx4535\\tx5102\\tx5669\\tx6236\\tx6803\\pardirnatural\n\\cf0 Die meisten Softwarelizenzen sind daraufhin entworfen worden, Ihnen die Freiheit zu nehmen, die Software weiterzugeben und zu ver\\'8andern. Im Gegensatz dazu soll Ihnen die GNU General Public License, die Allgemeine \\'85ffentliche GNU-Lizenz, ebendiese Freiheit garantieren. Sie soll sicherstellen, da\\'a7 die Software f\\'9fr alle Benutzer frei ist. Diese Lizenz gilt f\\'9fr den Gro\\'a7teil der von der Free Software Foundation herausgegebenen Software und f\\'9fr alle anderen Programme, deren Autoren ihr Datenwerk dieser Lizenz unterstellt haben. Auch Sie k\\'9annen diese M\\'9aglichkeit der Lizenzierung f\\'9fr Ihre Programme anwenden. (Ein anderer Teil der Software der Free Software Foundation unterliegt stattdessen der GNU Library General Public License, der Allgemeinen \\'85ffentlichen GNU-Lizenz f\\'9fr Bibliotheken.) [Mittlerweile wurde die GNU Library Public License von der GNU Lesser Public License abgel\\'9ast \\'d0 Anmerkung des \\'86bersetzers.]\\\n\\pard\\tx566\\tx1133\\tx1700\\tx2267\\tx2834\\tx3401\\tx3968\\tx4535\\tx5102\\tx5669\\tx6236\\tx6803\\ql\\qnatural\\pardirnatural\n\\cf0 Die Bezeichnung \\'e3freie\\'d2 Software bezieht sich auf Freiheit, nicht auf den Preis. Unsere Lizenzen sollen Ihnen die Freiheit garantieren, Kopien freier Software zu verbreiten (und etwas f\\'9fr diesen Service zu berechnen, wenn Sie m\\'9achten), die M\\'9aglichkeit, die Software im Quelltext zu erhalten oder den Quelltext auf Wunsch zu bekommen. Die Lizenzen sollen garantieren, da\\'a7 Sie die Software \\'8andern oder Teile davon in neuen freien Programmen verwenden d\\'9frfen \\'d0 und da\\'a7 Sie wissen, da\\'a7 Sie dies alles tun d\\'9frfen.\\\nUm Ihre Rechte zu sch\\'9ftzen, m\\'9fssen wir Einschr\\'8ankungen machen, die es jedem verbieten, Ihnen diese Rechte zu verweigern oder Sie aufzufordern, auf diese Rechte zu verzichten. Aus diesen Einschr\\'8ankungen folgen bestimmte Verantwortlichkeiten f\\'9fr Sie, wenn Sie Kopien der Software verbreiten oder sie ver\\'8andern.\\\nBeispielsweise m\\'9fssen Sie den Empf\\'8angern alle Rechte gew\\'8ahren, die Sie selbst haben, wenn Sie \\'d0 kostenlos oder gegen Bezahlung \\'d0 Kopien eines solchen Programms verbreiten. Sie m\\'9fssen sicherstellen, da\\'a7 auch die Empf\\'8anger den Quelltext erhalten bzw.\\'caerhalten k\\'9annen. Und Sie m\\'9fssen ihnen diese Bedingungen zeigen, damit sie ihre Rechte kennen.\\\nWir sch\\'9ftzen Ihre Rechte in zwei Schritten: (1) Wir stellen die Software unter ein Urheberrecht (Copyright), und (2) wir bieten Ihnen diese Lizenz an, die Ihnen das Recht gibt, die Software zu vervielf\\'8altigen, zu verbreiten und/oder zu ver\\'8andern.\\\nUm die Autoren und uns zu sch\\'9ftzen, wollen wir dar\\'9fberhinaus sicherstellen, da\\'a7 jeder erf\\'8ahrt, da\\'a7 f\\'9fr diese freie Software keinerlei Garantie besteht. Wenn die Software von jemand anderem modifiziert und weitergegeben wird, m\\'9achten wir, da\\'a7 die Empf\\'8anger wissen, da\\'a7 sie nicht das Original erhalten haben, damit irgendwelche von anderen verursachte Probleme nicht den Ruf des urspr\\'9fnglichen Autors sch\\'8adigen.\\\nSchlie\\'a7lich und endlich ist jedes freie Programm permanent durch Software-Patente bedroht. Wir m\\'9achten die Gefahr ausschlie\\'a7en, da\\'a7 Distributoren eines freien Programms individuell Patente lizensieren \\'d0 mit dem Ergebnis, da\\'a7 das Programm propriet\\'8ar w\\'9frde. Um dies zu verhindern, haben wir klargestellt, da\\'a7 jedes Patent entweder f\\'9fr freie Benutzung durch jedermann lizenziert werden mu\\'a7 oder \\'9fberhaupt nicht lizenziert werden darf.\\\nEs folgen die genauen Bedingungen f\\'9fr die Vervielf\\'8altigung, Verbreitung und Bearbeitung:\\\n\\pard\\tx566\\tx1133\\tx1700\\tx2267\\tx2834\\tx3401\\tx3968\\tx4535\\tx5102\\tx5669\\tx6236\\tx6803\\qc\\pardirnatural\n\\cf0 \\\nAllgemeine \\'85ffentliche GNU-Lizenz\n\\f3 \\uc0\\u8232\n\\f1 Bedingungen f\\'9fr die Vervielf\\'8altigung,\n\\f3 \\uc0\\u8232\n\\f1 Verbreitung und Bearbeitung\\\n\\\n\\pard\\tx566\\tx1133\\tx1700\\tx2267\\tx2834\\tx3401\\tx3968\\tx4535\\tx5102\\tx5669\\tx6236\\tx6803\\ql\\qnatural\\pardirnatural\n\\cf0 \\'a40. Diese Lizenz gilt f\\'9fr jedes Programm und jedes andere Datenwerk, in dem ein entsprechender Vermerk des Copyright-Inhabers darauf hinweist, da\\'a7 das Datenwerk unter den Bestimmungen dieser General Public License verbreitet werden darf. Im folgenden wird jedes derartige Programm oder Datenwerk als \\'e3das Programm\\'d2 bezeichnet; die Formulierung \\'e3auf dem Programm basierendes Datenwerk\\'d2 bezeichnet das Programm sowie jegliche Bearbeitung des Programms im urheberrechtlichen Sinne, also ein Datenwerk, welches das Programm, auch auszugsweise, sei es unver\\'8andert oder ver\\'8andert und/oder in eine andere Sprache \\'9fbersetzt, enth\\'8alt. (Im folgenden wird die \\'86bersetzung ohne Einschr\\'8ankung als \\'e3Bearbeitung\\'d2 eingestuft.) Jeder Lizenznehmer wird im folgenden als \\'e3Sie\\'d2 angesprochen.\\\nAndere Handlungen als Vervielf\\'8altigung, Verbreitung und Bearbeitung werden von dieser Lizenz nicht ber\\'9fhrt; sie fallen nicht in ihren Anwendungsbereich. Der Vorgang der Ausf\\'9fhrung des Programms wird nicht eingeschr\\'8ankt, und die Ausgaben des Programms unterliegen dieser Lizenz nur, wenn der Inhalt ein auf dem Programm basierendes Datenwerk darstellt (unabh\\'8angig davon, da\\'a7 die Ausgabe durch die Ausf\\'9fhrung des Programmes erfolgte). Ob dies zutrifft, h\\'8angt von den Funktionen des Programms ab.\\\n\\'a41. Sie d\\'9frfen auf beliebigen Medien unver\\'8anderte Kopien des Quelltextes des Programms, wie sie ihn erhalten haben, anfertigen und verbreiten. Voraussetzung hierf\\'9fr ist, da\\'a7 Sie mit jeder Kopie einen entsprechenden Copyright-Vermerk sowie einen Haftungsausschlu\\'a7 ver\\'9affentlichen, alle Vermerke, die sich auf diese Lizenz und das Fehlen einer Garantie beziehen, unver\\'8andert lassen und desweiteren allen anderen Empf\\'8angern des Programms zusammen mit dem Programm eine Kopie dieser Lizenz zukommen lassen.\\\nSie d\\'9frfen f\\'9fr den eigentlichen Kopiervorgang eine Geb\\'9fhr verlangen. Wenn Sie es w\\'9fnschen, d\\'9frfen Sie auch gegen Entgelt eine Garantie f\\'9fr das Programm anbieten.\\\n\\'a42. Sie d\\'9frfen Ihre Kopie(n) des Programms oder eines Teils davon ver\\'8andern, wodurch ein auf dem Programm basierendes Datenwerk entsteht; Sie d\\'9frfen derartige Bearbeitungen unter den Bestimmungen von Paragraph 1 vervielf\\'8altigen und verbreiten, vorausgesetzt, da\\'a7 zus\\'8atzlich alle im folgenden genannten Bedingungen erf\\'9fllt werden:\\\n\t1.\tSie m\\'9fssen die ver\\'8anderten Dateien mit einem auff\\'8alligen Vermerk versehen, der auf die von Ihnen vorgenommene Modifizierung und das Datum jeder \\'80nderung hinweist.\\\n\t2.\tSie m\\'9fssen daf\\'9fr sorgen, da\\'a7 jede von Ihnen verbreitete oder ver\\'9affentlichte Arbeit, die ganz oder teilweise von dem Programm oder Teilen davon abgeleitet ist, Dritten gegen\\'9fber als Ganzes unter den Bedingungen dieser Lizenz ohne Lizenzgeb\\'9fhren zur Verf\\'9fgung gestellt wird.\\\n\t3.\tWenn das ver\\'8anderte Programm normalerweise bei der Ausf\\'9fhrung interaktiv Kommandos einliest, m\\'9fssen Sie daf\\'9fr sorgen, da\\'a7 es, wenn es auf dem \\'9fblichsten Wege f\\'9fr solche interaktive Nutzung gestartet wird, eine Meldung ausgibt oder ausdruckt, die einen geeigneten Copyright-Vermerk enth\\'8alt sowie einen Hinweis, da\\'a7 es keine Gew\\'8ahrleistung gibt (oder anderenfalls, da\\'a7 Sie Garantie leisten), und da\\'a7 die Benutzer das Programm unter diesen Bedingungen weiter verbreiten d\\'9frfen. Auch mu\\'a7 der Benutzer darauf hingewiesen werden, wie er eine Kopie dieser Lizenz ansehen kann. (Ausnahme: Wenn das Programm selbst interaktiv arbeitet, aber normalerweise keine derartige Meldung ausgibt, mu\\'a7 Ihr auf dem Programm basierendes Datenwerk auch keine solche Meldung ausgeben).\\\nDiese Anforderungen gelten f\\'9fr das bearbeitete Datenwerk als Ganzes. Wenn identifizierbare Teile des Datenwerkes nicht von dem Programm abgeleitet sind und vern\\'9fnftigerweise als unabh\\'8angige und eigenst\\'8andige Datenwerke f\\'9fr sich selbst zu betrachten sind, dann gelten diese Lizenz und ihre Bedingungen nicht f\\'9fr die betroffenen Teile, wenn Sie diese als eigenst\\'8andige Datenwerke weitergeben. Wenn Sie jedoch dieselben Abschnitte als Teil eines Ganzen weitergeben, das ein auf dem Programm basierendes Datenwerk darstellt, dann mu\\'a7 die Weitergabe des Ganzen nach den Bedingungen dieser Lizenz erfolgen, deren Bedingungen f\\'9fr weitere Lizenznehmer somit auf das gesamte Ganze ausgedehnt werden \\'d0 und somit auf jeden einzelnen Teil, unabh\\'8angig vom jeweiligen Autor.\\\nSomit ist es nicht die Absicht dieses Abschnittes, Rechte f\\'9fr Datenwerke in Anspruch zu nehmen oder Ihnen die Rechte f\\'9fr Datenwerke streitig zu machen, die komplett von Ihnen geschrieben wurden; vielmehr ist es die Absicht, die Rechte zur Kontrolle der Verbreitung von Datenwerken, die auf dem Programm basieren oder unter seiner auszugsweisen Verwendung zusammengestellt worden sind, auszu\\'9fben.\\\nFerner bringt auch das einfache Zusammenlegen eines anderen Datenwerkes, das nicht auf dem Programm basiert, mit dem Programm oder einem auf dem Programm basierenden Datenwerk auf ein- und demselben Speicher- oder Vertriebsmedium dieses andere Datenwerk nicht in den Anwendungsbereich dieser Lizenz.\\\n\\'a43. Sie d\\'9frfen das Programm (oder ein darauf basierendes Datenwerk gem\\'8a\\'a7 Paragraph 2) als Objectcode oder in ausf\\'9fhrbarer Form unter den Bedingungen der Paragraphen 1 und 2 kopieren und weitergeben \\'d0 vorausgesetzt, da\\'a7 Sie au\\'a7erdem eine der folgenden Leistungen erbringen:\\\n\t1.\tLiefern Sie das Programm zusammen mit dem vollst\\'8andigen zugeh\\'9arigen maschinenlesbaren Quelltext auf einem f\\'9fr den Datenaustausch \\'9fblichen Medium aus, wobei die Verteilung unter den Bedingungen der Paragraphen 1 und 2 erfolgen mu\\'a7. Oder:\\\n\t2.\tLiefern Sie das Programm zusammen mit einem mindestens drei Jahre lang g\\'9fltigen schriftlichen Angebot aus, jedem Dritten eine vollst\\'8andige maschinenlesbare Kopie des Quelltextes zur Verf\\'9fgung zu stellen \\'d0 zu nicht h\\'9aheren Kosten als denen, die durch den physikalischen Kopiervorgang anfallen \\'d0, wobei der Quelltext unter den Bedingungen der Paragraphen 1 und 2 auf einem f\\'9fr den Datenaustausch \\'9fblichen Medium weitergegeben wird. Oder:\\\n\t3.\tLiefern Sie das Programm zusammen mit dem schriftlichen Angebot der Zurverf\\'9fgungstellung des Quelltextes aus, das Sie selbst erhalten haben. (Diese Alternative ist nur f\\'9fr nicht-kommerzielle Verbreitung zul\\'8assig und nur, wenn Sie das Programm als Objectcode oder in ausf\\'9fhrbarer Form mit einem entsprechenden Angebot gem\\'8a\\'a7 Absatz b erhalten haben.)\\\nUnter dem Quelltext eines Datenwerkes wird diejenige Form des Datenwerkes verstanden, die f\\'9fr Bearbeitungen vorzugsweise verwendet wird. F\\'9fr ein ausf\\'9fhrbares Programm bedeutet \\'e3der komplette Quelltext\\'d2: Der Quelltext aller im Programm enthaltenen Module einschlie\\'a7lich aller zugeh\\'9arigen Modulschnittstellen-Definitionsdateien sowie der zur Compilation und Installation verwendeten Skripte. Als besondere Ausnahme jedoch braucht der verteilte Quelltext nichts von dem zu enthalten, was \\'9fblicherweise (entweder als Quelltext oder in bin\\'8arer Form) zusammen mit den Hauptkomponenten des Betriebssystems (Kernel, Compiler usw.) geliefert wird, unter dem das Programm l\\'8auft \\'d0 es sei denn, diese Komponente selbst geh\\'9art zum ausf\\'9fhrbaren Programm.\\\nWenn die Verbreitung eines ausf\\'9fhrbaren Programms oder von Objectcode dadurch erfolgt, da\\'a7 der Kopierzugriff auf eine daf\\'9fr vorgesehene Stelle gew\\'8ahrt wird, so gilt die Gew\\'8ahrung eines gleichwertigen Zugriffs auf den Quelltext als Verbreitung des Quelltextes, auch wenn Dritte nicht dazu gezwungen sind, den Quelltext zusammen mit dem Objectcode zu kopieren.\\\n\\'a44. Sie d\\'9frfen das Programm nicht vervielf\\'8altigen, ver\\'8andern, weiter lizenzieren oder verbreiten, sofern es nicht durch diese Lizenz ausdr\\'9fcklich gestattet ist. Jeder anderweitige Versuch der Vervielf\\'8altigung, Modifizierung, Weiterlizenzierung und Verbreitung ist nichtig und beendet automatisch Ihre Rechte unter dieser Lizenz. Jedoch werden die Lizenzen Dritter, die von Ihnen Kopien oder Rechte unter dieser Lizenz erhalten haben, nicht beendet, solange diese die Lizenz voll anerkennen und befolgen.\\\n\\'a45. Sie sind nicht verpflichtet, diese Lizenz anzunehmen, da Sie sie nicht unterzeichnet haben. Jedoch gibt Ihnen nichts anderes die Erlaubnis, das Programm oder von ihm abgeleitete Datenwerke zu ver\\'8andern oder zu verbreiten. Diese Handlungen sind gesetzlich verboten, wenn Sie diese Lizenz nicht anerkennen. Indem Sie das Programm (oder ein darauf basierendes Datenwerk) ver\\'8andern oder verbreiten, erkl\\'8aren Sie Ihr Einverst\\'8andnis mit dieser Lizenz und mit allen ihren Bedingungen bez\\'9fglich der Vervielf\\'8altigung, Verbreitung und Ver\\'8anderung des Programms oder eines darauf basierenden Datenwerks.\\\n\\'a46. Jedesmal, wenn Sie das Programm (oder ein auf dem Programm basierendes Datenwerk) weitergeben, erh\\'8alt der Empf\\'8anger automatisch vom urspr\\'9fnglichen Lizenzgeber die Lizenz, das Programm entsprechend den hier festgelegten Bestimmungen zu vervielf\\'8altigen, zu verbreiten und zu ver\\'8andern. Sie d\\'9frfen keine weiteren Einschr\\'8ankungen der Durchsetzung der hierin zugestandenen Rechte des Empf\\'8angers vornehmen. Sie sind nicht daf\\'9fr verantwortlich, die Einhaltung dieser Lizenz durch Dritte durchzusetzen.\\\n\\'a47. Sollten Ihnen infolge eines Gerichtsurteils, des Vorwurfs einer Patentverletzung oder aus einem anderen Grunde (nicht auf Patentfragen begrenzt) Bedingungen (durch Gerichtsbeschlu\\'a7, Vergleich oder anderweitig) auferlegt werden, die den Bedingungen dieser Lizenz widersprechen, so befreien Sie diese Umst\\'8ande nicht von den Bestimmungen dieser Lizenz. Wenn es Ihnen nicht m\\'9aglich ist, das Programm unter gleichzeitiger Beachtung der Bedingungen in dieser Lizenz und Ihrer anderweitigen Verpflichtungen zu verbreiten, dann d\\'9frfen Sie als Folge das Programm \\'9fberhaupt nicht verbreiten. Wenn zum Beispiel ein Patent nicht die geb\\'9fhrenfreie Weiterverbreitung des Programms durch diejenigen erlaubt, die das Programm direkt oder indirekt von Ihnen erhalten haben, dann besteht der einzige Weg, sowohl das Patentrecht als auch diese Lizenz zu befolgen, darin, ganz auf die Verbreitung des Programms zu verzichten.\\\nSollte sich ein Teil dieses Paragraphen als ung\\'9fltig oder unter bestimmten Umst\\'8anden nicht durchsetzbar erweisen, so soll dieser Paragraph seinem Sinne nach angewandt werden; im \\'9fbrigen soll dieser Paragraph als Ganzes gelten.\\\nZweck dieses Paragraphen ist nicht, Sie dazu zu bringen, irgendwelche Patente oder andere Eigentumsanspr\\'9fche zu verletzen oder die G\\'9fltigkeit solcher Anspr\\'9fche zu bestreiten; dieser Paragraph hat einzig den Zweck, die Integrit\\'8at des Verbreitungssystems der freien Software zu sch\\'9ftzen, das durch die Praxis \\'9affentlicher Lizenzen verwirklicht wird. Viele Leute haben gro\\'a7z\\'9fgige Beitr\\'8age zu dem gro\\'a7en Angebot der mit diesem System verbreiteten Software im Vertrauen auf die konsistente Anwendung dieses Systems geleistet; es liegt am Autor/Geber, zu entscheiden, ob er die Software mittels irgendeines anderen Systems verbreiten will; ein Lizenznehmer hat auf diese Entscheidung keinen Einflu\\'a7.\\\nDieser Paragraph ist dazu gedacht, deutlich klarzustellen, was als Konsequenz aus dem Rest dieser Lizenz betrachtet wird.\\\n\\'a48. Wenn die Verbreitung und/oder die Benutzung des Programms in bestimmten Staaten entweder durch Patente oder durch urheberrechtlich gesch\\'9ftzte Schnittstellen eingeschr\\'8ankt ist, kann der Urheberrechtsinhaber, der das Programm unter diese Lizenz gestellt hat, eine explizite geographische Begrenzung der Verbreitung angeben, in der diese Staaten ausgeschlossen werden, so da\\'a7 die Verbreitung nur innerhalb und zwischen den Staaten erlaubt ist, die nicht ausgeschlossen sind. In einem solchen Fall beinhaltet diese Lizenz die Beschr\\'8ankung, als w\\'8are sie in diesem Text niedergeschrieben.\\\n\\'a49. Die Free Software Foundation kann von Zeit zu Zeit \\'9fberarbeitete und/oder neue Versionen der General Public License ver\\'9affentlichen. Solche neuen Versionen werden vom Grundprinzip her der gegenw\\'8artigen entsprechen, k\\'9annen aber im Detail abweichen, um neuen Problemen und Anforderungen gerecht zu werden.\\\nJede Version dieser Lizenz hat eine eindeutige Versionsnummer. Wenn in einem Programm angegeben wird, da\\'a7 es dieser Lizenz in einer bestimmten Versionsnummer oder \\'e3jeder sp\\'8ateren Version\\'d2 (\\'d2any later version\\'d3) unterliegt, so haben Sie die Wahl, entweder den Bestimmungen der genannten Version zu folgen oder denen jeder beliebigen sp\\'8ateren Version, die von der Free Software Foundation ver\\'9affentlicht wurde. Wenn das Programm keine Versionsnummer angibt, k\\'9annen Sie eine beliebige Version w\\'8ahlen, die je von der Free Software Foundation ver\\'9affentlicht wurde.\\\n\\'a410. Wenn Sie den Wunsch haben, Teile des Programms in anderen freien Programmen zu verwenden, deren Bedingungen f\\'9fr die Verbreitung anders sind, schreiben Sie an den Autor, um ihn um die Erlaubnis zu bitten. F\\'9fr Software, die unter dem Copyright der Free Software Foundation steht, schreiben Sie an die Free Software Foundation; wir machen zu diesem Zweck gelegentlich Ausnahmen. Unsere Entscheidung wird von den beiden Zielen geleitet werden, zum einen den freien Status aller von unserer freien Software abgeleiteten Datenwerke zu erhalten und zum anderen das gemeinschaftliche Nutzen und Wiederverwenden von Software im allgemeinen zu f\\'9ardern.\\\nKeine Gew\\'8ahrleistung\\\n\\'a411. Da das Programm ohne jegliche Kosten lizenziert wird, besteht keinerlei Gew\\'8ahrleistung f\\'9fr das Programm, soweit dies gesetzlich zul\\'8assig ist. Sofern nicht anderweitig schriftlich best\\'8atigt, stellen die Copyright-Inhaber und/oder Dritte das Programm so zur Verf\\'9fgung, \\'e3wie es ist\\'d2, ohne irgendeine Gew\\'8ahrleistung, weder ausdr\\'9fcklich noch implizit, einschlie\\'a7lich \\'d0 aber nicht begrenzt auf \\'d0 Marktreife oder Verwendbarkeit f\\'9fr einen bestimmten Zweck. Das volle Risiko bez\\'9fglich Qualit\\'8at und Leistungsf\\'8ahigkeit des Programms liegt bei Ihnen. Sollte sich das Programm als fehlerhaft herausstellen, liegen die Kosten f\\'9fr notwendigen Service, Reparatur oder Korrektur bei Ihnen.\\\n\\'a412. In keinem Fall, au\\'a7er wenn durch geltendes Recht gefordert oder schriftlich zugesichert, ist irgendein Copyright-Inhaber oder irgendein Dritter, der das Programm wie oben erlaubt modifiziert oder verbreitet hat, Ihnen gegen\\'9fber f\\'9fr irgendwelche Sch\\'8aden haftbar, einschlie\\'a7lich jeglicher allgemeiner oder spezieller Sch\\'8aden, Sch\\'8aden durch Seiteneffekte (Nebenwirkungen) oder Folgesch\\'8aden, die aus der Benutzung des Programms oder der Unbenutzbarkeit des Programms folgen (einschlie\\'a7lich \\'d0 aber nicht beschr\\'8ankt auf \\'d0 Datenverluste, fehlerhafte Verarbeitung von Daten, Verluste, die von Ihnen oder anderen getragen werden m\\'9fssen, oder dem Unverm\\'9agen des Programms, mit irgendeinem anderen Programm zusammenzuarbeiten), selbst wenn ein Copyright-Inhaber oder Dritter \\'9fber die M\\'9aglichkeit solcher Sch\\'8aden unterrichtet worden war.\\\nEnde der Bedingungen\\\nAnhang: Wie Sie diese Bedingungen auf Ihre eigenen,\n\\f3\n\\f1 neuen Programme anwenden k\\'9annen\\\nWenn Sie ein neues Programm entwickeln und wollen, da\\'a7 es vom gr\\'9a\\'a7tm\\'9aglichen Nutzen f\\'9fr die Allgemeinheit ist, dann erreichen Sie das am besten, indem Sie es zu freier Software machen, die jeder unter diesen Bestimmungen weiterverbreiten und ver\\'8andern kann.\\\nUm dies zu erreichen, f\\'9fgen Sie die folgenden Vermerke zu Ihrem Programm hinzu. Am sichersten ist es, sie an den Anfang einer jeden Quelldatei zu stellen, um den Gew\\'8ahrleistungsausschlu\\'a7 m\\'9aglichst deutlich darzustellen; zumindest aber sollte jede Datei eine Copyright-Zeile besitzen sowie einen kurzen Hinweis darauf, wo die vollst\\'8andigen Vermerke zu finden sind.\\\n\n\\f2 [eine Zeile mit dem Programmnamen und einer kurzen Beschreibung]\n\\f3 \\uc0\\u8232\n\\f2 Copyright (C) [Jahr]\\'ca\\'ca[Name des Autors]\n\\f1 \\\n\n\\f2 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\\f1 \\\n\n\\f2 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\\f1 \\\n\n\\f2 You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA\n\\f1 \\\nAuf Deutsch:\\\n\n\\f2 [eine Zeile mit dem Programmnamen und einer kurzen Beschreibung]\n\\f3 \\uc0\\u8232\n\\f2 Copyright (C) [Jahr]\\'ca\\'ca[Name des Autors]\n\\f1 \\\n\n\\f2 Dieses Programm ist freie Software. Sie k\\'9annen es unter den Bedingungen der GNU General Public License, wie von der Free Software Foundation ver\\'9affentlicht, weitergeben und/oder modifizieren, entweder gem\\'8a\\'a7 Version 2 der Lizenz oder (nach Ihrer Option) jeder sp\\'8ateren Version.\n\\f1 \\\n\n\\f2 Die Ver\\'9affentlichung dieses Programms erfolgt in der Hoffnung, da\\'a7 es Ihnen von Nutzen sein wird, aber OHNE IRGENDEINE GARANTIE, sogar ohne die implizite Garantie der MARKTREIFE oder der VERWENDBARKEIT F\\'86R EINEN BESTIMMTEN ZWECK. Details finden Sie in der GNU General Public License.\n\\f1 \\\n\n\\f2 Sie sollten ein Exemplar der GNU General Public License zusammen mit diesem Programm erhalten haben. Falls nicht, schreiben Sie an die Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA.\n\\f1 \\\nF\\'9fgen Sie auch einen kurzen Hinweis hinzu, wie Sie elektronisch und per Brief erreichbar sind.\\\nWenn Ihr Programm interaktiv ist, sorgen Sie daf\\'9fr, da\\'a7 es nach dem Start einen kurzen Vermerk ausgibt:\\\n\n\\f2 version 69, Copyright (C) [Jahr]\\'ca\\'ca[Name des Autors]\n\\f3 \\uc0\\u8232\n\\f2 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.\n\\f1 \\\nAuf Deutsch:\\\n\n\\f2 Version 69, Copyright (C) [Jahr]\\'ca\\'ca[Name des Autors] F\\'9fr Gnomovision besteht KEINERLEI GARANTIE; geben Sie `show w' f\\'9fr Details ein. Gnonovision ist freie Software, die Sie unter bestimmten Bedingungen weitergeben d\\'9frfen; geben Sie `show c' f\\'9fr Details ein.\n\\f1 \\\nDie hypothetischen Kommandos\n\\f2 `show w'\n\\f1  und\n\\f2 `show c'\n\\f1  sollten die entsprechenden Teile der GNU-GPL anzeigen. Nat\\'9frlich k\\'9annen die von Ihnen verwendeten Kommandos anders hei\\'a7en als\n\\f2 `show w'\n\\f1  und\n\\f2 `show c'\n\\f1 ; es k\\'9annten auch Mausklicks oder Men\\'9fpunkte sein \\'d0 was immer am besten in Ihr Programm pa\\'a7t.\\\nSoweit vorhanden, sollten Sie auch Ihren Arbeitgeber (wenn Sie als Programmierer arbeiten) oder Ihre Schule einen Copyright-Verzicht f\\'9fr das Programm unterschreiben lassen. Hier ein Beispiel. Die Namen m\\'9fssen Sie nat\\'9frlich \\'8andern.\\\n\n\\f2 Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.\n\\f1 \\\n\n\\f2 [Unterschrift von Ty Coon], 1 April 1989\n\\f3 \\uc0\\u8232\n\\f2 Ty Coon, President of Vice\n\\f1 \\\nAuf Deutsch:\\\n\n\\f2 Die Yoyodyne GmbH erhebt keinen urheberrechtlichen Anspruch auf das von James Hacker geschriebene Programm ,Gnomovision` (einem Schrittmacher f\\'9fr Compiler).\n\\f1 \\\n\n\\f2 [Unterschrift von Ty Coon], 1. April 1989\n\\f3 \\uc0\\u8232\n\\f2 Ty Coon, Vizepr\\'8asident\n\\f1 \\\nDiese General Public License gestattet nicht die Einbindung des Programms in propriet\\'8are Programme. Ist Ihr Programm eine Funktionsbibliothek, so kann es sinnvoller sein, das Binden propriet\\'8arer Programme mit dieser Bibliothek zu gestatten. Wenn Sie dies tun wollen, sollten Sie die GNU Library General Public License anstelle dieser Lizenz verwenden.}\n"
  },
  {
    "path": "de.lproj/Localizable.strings",
    "content": "{\n\"Host Name\" = \"Host-Name\";\n\"Host Names\" = \"Host-Namen\";\n\"IP Address\" = \"IP-Adresse\";\n\"IP Addresses\" = \"IP-Adressen\";\n\"Screen Resolution changed - Server Reinitialized\" = \"Bildschirmauflösung geändert - Server-Reinitialisierung\";\n\"Server Running\" = \"Der Server wurde aktiviert\";\n\"The server is not running.\" = \"Der Server läuft nicht.\";\n\"Start Server\" = \"Server starten\";\n\"Restart Server\" = \"Server-Neustart\";\n\"The server is stopped.\" = \"Der Server wurde angehalten.\";\n\"Probably because the OSXvnc server is already running as a Startup Item.\" = \"Eventuell läuft der OSXvnc-Server bereits als Startobjekt.\";\n\"Probably because another VNC is already using this port.\" = \"Eventuell benutzt ein anderer VNC-Server bereits diesen Port.\";\n\"The server has stopped running. See Log (%d)\\n\" = \"Der Server wurde beendet. Siehe Protokoll (%d)\\n\";\n\"The server has stopped running.\" = \"Der Server wurde beendet.\";\n\"Need a valid Port or Display Number\" = \"Benötigt eine gültige Port- oder Displaynummer\";\n\"Problem - Unable to store password to %@\" = \"Problem - Das Passwort kann nicht in %@ gespeichert werden\";\n\"Option Change Requires a Restart\" = \"Einstellungsänderung erfordert einen Neustart\";\n\"Error: No Authorization\" = \"Fehler: Fehlende Authorisierung\";\n\"Error: Unable To Setup Password File\" = \"Fehler: Kann die Passwortdatei nicht ändern\";\n\"Error: Unable To Write out Temporary Script File\" = \"Fehler: Kann die temporäre Skriptdatei nicht schreiben\";\n\"Startup Item Configured (Started)\" = \"Startup-Item konfiguriert (gestartet)\";\n\"Startup Item Disabled (Stopped)\" = \"Startup-Item deaktiviert (gestoppt)\";\n\"Error: Unabled to remove startup item\" = \"Fehler: Kann das Startup-Item nicht entfernen\";\n\"Please specify a Connect Host to establish a connection\" = \"Bitte einen Zielhost angeben, um eine Verbindung aufbauen zu können\";\n\"Connection invitation sent to Connect Host\" = \"Verbindungsanforderung an den Zielhost gesendet\";\n}\n"
  },
  {
    "path": "en.lproj/Copying.rtf",
    "content": "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0 \\fswiss Helvetica;}{\\f1 Courier;}}\n{\\colortbl;\\red255\\green0\\blue0;\\red0\\green0\\blue255;}\n\\widowctrl\\hyphauto\n\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs28 GNU GENERAL PUBLIC LICENSE\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Version 3, 29 June 2007\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Copyright \\u169? 2007 Free Software Foundation, Inc. <{\\field{\\*\\fldinst{HYPERLINK \"http://fsf.org/\"}}{\\fldrslt{\\ul\nhttp://fsf.org/\n}}}\n>\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs28 Preamble\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 The GNU General Public License is a free, copyleft license for software and other kinds of works.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 The precise terms and conditions for copying, distribution and modification follow.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs28 TERMS AND CONDITIONS\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs24 0. Definitions.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\u8220\"This License\\u8221\" refers to version 3 of the GNU General Public License.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\u8220\"Copyright\\u8221\" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\u8220\"The Program\\u8221\" refers to any copyrightable work licensed under this License. Each licensee is addressed as \\u8220\"you\\u8221\". \\u8220\"Licensees\\u8221\" and \\u8220\"recipients\\u8221\" may be individuals or organizations.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 To \\u8220\"modify\\u8221\" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a \\u8220\"modified version\\u8221\" of the earlier work or a work \\u8220\"based on\\u8221\" the earlier work.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 A \\u8220\"covered work\\u8221\" means either the unmodified Program or a work based on the Program.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 To \\u8220\"propagate\\u8221\" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 To \\u8220\"convey\\u8221\" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 An interactive user interface displays \\u8220\"Appropriate Legal Notices\\u8221\" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs24 1. Source Code.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 The \\u8220\"source code\\u8221\" for a work means the preferred form of the work for making modifications to it. \\u8220\"Object code\\u8221\" means any non-source form of a work.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 A \\u8220\"Standard Interface\\u8221\" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 The \\u8220\"System Libraries\\u8221\" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A \\u8220\"Major Component\\u8221\", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 The \\u8220\"Corresponding Source\\u8221\" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 The Corresponding Source for a work in source code form is that same work.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs24 2. Basic Permissions.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs24 3. Protecting Users' Legal Rights From Anti-Circumvention Law.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs24 4. Conveying Verbatim Copies.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs24 5. Conveying Modified Source Versions.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab a) The work must carry prominent notices stating that you modified it, and giving a relevant date.\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to \\u8220\"keep intact all notices\\u8221\".\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an \\u8220\"aggregate\\u8221\" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs24 6. Conveying Non-Source Forms.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 A \\u8220\"User Product\\u8221\" is either (1) a \\u8220\"consumer product\\u8221\", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, \\u8220\"normally used\\u8221\" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\u8220\"Installation Information\\u8221\" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs24 7. Additional Terms.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\u8220\"Additional permissions\\u8221\" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab d) Limiting the use for publicity purposes of names of licensors or authors of the material; or\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 All other non-permissive additional terms are considered \\u8220\"further restrictions\\u8221\" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs24 8. Termination.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs24 9. Acceptance Not Required for Having Copies.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs24 10. Automatic Licensing of Downstream Recipients.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 An \\u8220\"entity transaction\\u8221\" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs24 11. Patents.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 A \\u8220\"contributor\\u8221\" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's \\u8220\"contributor version\\u8221\".\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 A contributor's \\u8220\"essential patent claims\\u8221\" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, \\u8220\"control\\u8221\" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 In the following three paragraphs, a \\u8220\"patent license\\u8221\" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To \\u8220\"grant\\u8221\" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. \\u8220\"Knowingly relying\\u8221\" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 A patent license is \\u8220\"discriminatory\\u8221\" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs24 12. No Surrender of Others' Freedom.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs24 13. Use with the GNU Affero General Public License.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs24 14. Revised Versions of this License.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License \\u8220\"or any later version\\u8221\" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs24 15. Disclaimer of Warranty.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \\u8220\"AS IS\\u8221\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs24 16. Limitation of Liability.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs24 17. Interpretation of Sections 15 and 16.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 END OF TERMS AND CONDITIONS\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\b \\fs28 How to Apply These Terms to Your New Programs\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the \\u8220\"copyright\\u8221\" line and a pointer to where the full notice is found.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\f1     <one line to give the program's name and a brief idea of what it does.>\\line\n    Copyright (C) <year>  <name of author>\\line\n\\line\n    This program is free software: you can redistribute it and/or modify\\line\n    it under the terms of the GNU General Public License as published by\\line\n    the Free Software Foundation, either version 3 of the License, or\\line\n    (at your option) any later version.\\line\n\\line\n    This program is distributed in the hope that it will be useful,\\line\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\line\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\line\n    GNU General Public License for more details.\\line\n\\line\n    You should have received a copy of the GNU General Public License\\line\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Also add information on how to contact you by electronic and paper mail.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\f1     <program>  Copyright (C) <year>  <name of author>\\line\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\\line\n    This is free software, and you are welcome to redistribute it\\line\n    under certain conditions; type `show c' for details.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an \\u8220\"about box\\u8221\".\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 You should also get your employer (if you work as a programmer) or school, if any, to sign a \\u8220\"copyright disclaimer\\u8221\" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <{\\field{\\*\\fldinst{HYPERLINK \"http://www.gnu.org/licenses/\"}}{\\fldrslt{\\ul\nhttp://www.gnu.org/licenses/\n}}}\n>.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <{\\field{\\*\\fldinst{HYPERLINK \"http://www.gnu.org/philosophy/why-not-lgpl.html\"}}{\\fldrslt{\\ul\nhttp://www.gnu.org/philosophy/why-not-lgpl.html\n}}}\n>.\\par}\n}\n"
  },
  {
    "path": "en.lproj/Credits.rtf",
    "content": "{\\rtf1\\ansi\\ansicpg1252\\cocoartf1504\\cocoasubrtf600\n{\\fonttbl\\f0\\fswiss\\fcharset0 Helvetica;\\f1\\froman\\fcharset0 Times-Roman;}\n{\\colortbl;\\red255\\green255\\blue255;\\red26\\green26\\blue255;}\n{\\*\\expandedcolortbl;\\csgray\\c100000;\\csgenericrgb\\c10196\\c10196\\c100000;}\n\\paperw12240\\paperh15840\\vieww9000\\viewh8400\\viewkind0\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\f0\\fs24 \\cf0 This is an improved version of Vine VNC:\\\n\t{\\field{\\*\\fldinst{HYPERLINK \"https://github.com/stweil/OSXvnc.git\"}}{\\fldrslt https://github.com/stweil/OSXvnc.git}}\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\f1 \\cf0 \\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\f0 \\cf0 Copyright \\'a9 2015\\'962017 Stefan Weil\\\n\\\nCopyright \\'a9 2002\\'962012 TestPlant Software\\\n\tJonathan Gillaspie\\\n\tDoug Simons\\\n\\\nGNU GPL:\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\\cf2 \\ul \\ulc2       http://www.gnu.org/copyleft/gpl.html\\cf0 \\ulnone \\\n\\\nThanks for Vine Server manual:\\\n\tPamela Moncavage\\\n\\\nThanks For 10.8 Fixes:\\\n\tJohn Turnipseed\\\n\\\nThanks For Server Side Scaling:\\\n\tNoriaki Yamazaki\\\n\tAdministrator of micro-VNC\\\n\tHitachi System & Service, Ltd.\\\n\\\nThanks For Reverse Connections:\\\n\tMark Lentczner\\\n\\\nThanks for corrections for multiple Tight clients:\\\n\tSolletica\\\n\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\\cf0 Zlib, ZlibHex and Tight encodings:\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\\cf0 \tMahmud Haque\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\\cf0 \\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\\cf0 Other Contributions:\\\n\\pard\\tx360\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\f1 \\cf0 \t\n\\f0 David Johnson\n\\f1 \\\n\t\n\\f0 Steven Tamm\\\n\tMihai Parparita\\\n\tMarvin Simkin\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\\cf0 \\\n----------------------------------------------------\\\n\\\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.\\\n\\\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.\\\n\\\nYou should have received a copy of the GNU General Public License along with this program; if not, write to:\\\n\\\nFree Software Foundation, Inc.\\\n59 Temple Place - Suite 330\\\nBoston, MA  02111-1307\\\nUSA\\\n}\n"
  },
  {
    "path": "en.lproj/Localizable.strings",
    "content": "{\n\"The server is stopped.\"=\"The server is not running.\";\n\"No Authentication\"=\"no password protection\";\n\"Startup Item Configured (Started)\"=\"The System Server is running\";\n\"Startup Item Disabled (Stopped)\"=\"The System Server is not running\";\n\"Vine Server can't listen on the specified port (%d).\"=\"The port you chose (%d) is not available.\";\n\"Probably because the OSXvnc server is already running as a Startup Item.\" = \"(You may already be running a System Server on this port)\";\n\"Probably because another VNC is already using this port.\" = \"(There is already a VNC server running on this port)\";\n\"Option Change Requires a Restart\" = \"Restart Server to Affect Changes\";\n\"No password has been specified for the System Server.  The System Server will automatically launch every time your machine is restarted.  Are you sure that you want to install a System Server with no password\"=\"This server is not password-protected, and will start automatically whenever your computer is turned on. Do you want to proceed with no password protection?\";\n}\n"
  },
  {
    "path": "en.lproj/Vine Server Release Notes.rtf",
    "content": "{\\rtf1\\ansi\\ansicpg1252\\cocoartf1504\\cocoasubrtf600\n{\\fonttbl\\f0\\fswiss\\fcharset0 Helvetica;\\f1\\froman\\fcharset0 Times-Roman;\\f2\\fnil\\fcharset0 Monaco;\n\\f3\\fnil\\fcharset0 Geneva;}\n{\\colortbl;\\red255\\green255\\blue255;\\red137\\green19\\blue21;\\red25\\green35\\blue255;}\n{\\*\\expandedcolortbl;\\csgray\\c100000;\\csgenericrgb\\c53725\\c7451\\c8235;\\csgenericrgb\\c9804\\c13725\\c100000;}\n\\paperw12240\\paperh15840\\vieww15020\\viewh14560\\viewkind0\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\qc\\partightenfactor0\n\n\\f0\\b\\fs36 \\cf0 Vine Server 5.0\\\nRelease Notes\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b0\\fs24 \\cf0 \\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 Version 5.1 Released 20-November-2016:\\\n\\pard\\tx480\\tx960\\tx1440\\tx1920\\tx2400\\tx2880\\tx3360\\tx3840\\tx4320\\tx4800\\tx5280\\tx5760\\tx6240\\tx6720\\tx7200\\tx7680\\tx8160\\tx8640\\tx9120\\tx9600\\tx10080\\tx10560\\tx11040\\tx11520\\tx12000\\tx12480\\tx12960\\tx13440\\tx13920\\tx14400\\tx14880\\tx15360\\tx15840\\tx16320\\tx16800\\tx17280\\tx17760\\tx18240\\tx18720\\tx19200\\tx19680\\tx20160\\tx20640\\tx21120\\tx21600\\tx22080\\tx22560\\tx23040\\tx23520\\tx24000\\tx24480\\tx24960\\tx25440\\tx25920\\tx26400\\tx26880\\tx27360\\tx27840\\tx28320\\tx28800\\tx29280\\tx29760\\tx30240\\tx30720\\tx31200\\tx31680\\tx32160\\tx32640\\tx33120\\tx33600\\tx34080\\tx34560\\tx35040\\tx35520\\tx36000\\tx36480\\tx36960\\tx37440\\tx37920\\tx38400\\tx38880\\tx39360\\tx39840\\tx40320\\tx40800\\tx41280\\tx41760\\tx42240\\tx42720\\tx43200\\tx43680\\tx44160\\tx44640\\tx45120\\tx45600\\tx46080\\tx46560\\tx47040\\tx47520\\tx48000\\pardirnatural\\partightenfactor0\n\\cf0 \tModified by Stefan Weil\n\\b0 \\\n\t\t\n\\b Note: This release supports 10.7 and above, Intel-Only\n\\b0 \\\n\\\n\t\tReplaced libvnc by libjpeg-turbo. This might result in improved performance.\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 \\\n\\\nVersion 5.0 Released 10-November-2016:\\\n\\pard\\tx480\\tx960\\tx1440\\tx1920\\tx2400\\tx2880\\tx3360\\tx3840\\tx4320\\tx4800\\tx5280\\tx5760\\tx6240\\tx6720\\tx7200\\tx7680\\tx8160\\tx8640\\tx9120\\tx9600\\tx10080\\tx10560\\tx11040\\tx11520\\tx12000\\tx12480\\tx12960\\tx13440\\tx13920\\tx14400\\tx14880\\tx15360\\tx15840\\tx16320\\tx16800\\tx17280\\tx17760\\tx18240\\tx18720\\tx19200\\tx19680\\tx20160\\tx20640\\tx21120\\tx21600\\tx22080\\tx22560\\tx23040\\tx23520\\tx24000\\tx24480\\tx24960\\tx25440\\tx25920\\tx26400\\tx26880\\tx27360\\tx27840\\tx28320\\tx28800\\tx29280\\tx29760\\tx30240\\tx30720\\tx31200\\tx31680\\tx32160\\tx32640\\tx33120\\tx33600\\tx34080\\tx34560\\tx35040\\tx35520\\tx36000\\tx36480\\tx36960\\tx37440\\tx37920\\tx38400\\tx38880\\tx39360\\tx39840\\tx40320\\tx40800\\tx41280\\tx41760\\tx42240\\tx42720\\tx43200\\tx43680\\tx44160\\tx44640\\tx45120\\tx45600\\tx46080\\tx46560\\tx47040\\tx47520\\tx48000\\pardirnatural\\partightenfactor0\n\\cf0 \tModified by Stefan Weil\n\\b0 \\\n\t\t\n\\b Note: This release supports 10.6 and above, Intel-Only\n\\b0 \\\n\\\n\t\tIncludes lots of bug fixes and updates.\\\n\t\tSupports Retina displays.\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 \\\n\\\nVersion 4.01 Released 28-September-2012:\\\n\\pard\\tx480\\tx960\\tx1440\\tx1920\\tx2400\\tx2880\\tx3360\\tx3840\\tx4320\\tx4800\\tx5280\\tx5760\\tx6240\\tx6720\\tx7200\\tx7680\\tx8160\\tx8640\\tx9120\\tx9600\\tx10080\\tx10560\\tx11040\\tx11520\\tx12000\\tx12480\\tx12960\\tx13440\\tx13920\\tx14400\\tx14880\\tx15360\\tx15840\\tx16320\\tx16800\\tx17280\\tx17760\\tx18240\\tx18720\\tx19200\\tx19680\\tx20160\\tx20640\\tx21120\\tx21600\\tx22080\\tx22560\\tx23040\\tx23520\\tx24000\\tx24480\\tx24960\\tx25440\\tx25920\\tx26400\\tx26880\\tx27360\\tx27840\\tx28320\\tx28800\\tx29280\\tx29760\\tx30240\\tx30720\\tx31200\\tx31680\\tx32160\\tx32640\\tx33120\\tx33600\\tx34080\\tx34560\\tx35040\\tx35520\\tx36000\\tx36480\\tx36960\\tx37440\\tx37920\\tx38400\\tx38880\\tx39360\\tx39840\\tx40320\\tx40800\\tx41280\\tx41760\\tx42240\\tx42720\\tx43200\\tx43680\\tx44160\\tx44640\\tx45120\\tx45600\\tx46080\\tx46560\\tx47040\\tx47520\\tx48000\\pardirnatural\\partightenfactor0\n\\cf0 \tModified by Jonathan Gillaspie with TestPlant, Inc.\n\\b0 \\\n\t\t\n\\b Note: This release supports 10.6 and above, Intel-Only\n\\b0 \\\n\\\n\t\tFixed a bug where new connections could have invalid starting states and produce clipboard errors. \\\n\t\tFixes a problem loading keyboard data for non US keyboards.\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 \\\n\\\nVersion 4.0 Released 20-July-2012:\\\n\\pard\\tx480\\tx960\\tx1440\\tx1920\\tx2400\\tx2880\\tx3360\\tx3840\\tx4320\\tx4800\\tx5280\\tx5760\\tx6240\\tx6720\\tx7200\\tx7680\\tx8160\\tx8640\\tx9120\\tx9600\\tx10080\\tx10560\\tx11040\\tx11520\\tx12000\\tx12480\\tx12960\\tx13440\\tx13920\\tx14400\\tx14880\\tx15360\\tx15840\\tx16320\\tx16800\\tx17280\\tx17760\\tx18240\\tx18720\\tx19200\\tx19680\\tx20160\\tx20640\\tx21120\\tx21600\\tx22080\\tx22560\\tx23040\\tx23520\\tx24000\\tx24480\\tx24960\\tx25440\\tx25920\\tx26400\\tx26880\\tx27360\\tx27840\\tx28320\\tx28800\\tx29280\\tx29760\\tx30240\\tx30720\\tx31200\\tx31680\\tx32160\\tx32640\\tx33120\\tx33600\\tx34080\\tx34560\\tx35040\\tx35520\\tx36000\\tx36480\\tx36960\\tx37440\\tx37920\\tx38400\\tx38880\\tx39360\\tx39840\\tx40320\\tx40800\\tx41280\\tx41760\\tx42240\\tx42720\\tx43200\\tx43680\\tx44160\\tx44640\\tx45120\\tx45600\\tx46080\\tx46560\\tx47040\\tx47520\\tx48000\\pardirnatural\\partightenfactor0\n\\cf0 \tModified by Jonathan Gillaspie with TestPlant, Inc.\n\\b0 \\\n\t\t\n\\b Note: This release supports 10.6 and above, Intel-Only\n\\b0 \\\n\\\n\t\tUses newer API for improved performance and reliability.\\\n\n\\b \\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\\cf0 \\\nVersion 3.12 Released 22-October-2010:\\\n\\pard\\tx480\\tx960\\tx1440\\tx1920\\tx2400\\tx2880\\tx3360\\tx3840\\tx4320\\tx4800\\tx5280\\tx5760\\tx6240\\tx6720\\tx7200\\tx7680\\tx8160\\tx8640\\tx9120\\tx9600\\tx10080\\tx10560\\tx11040\\tx11520\\tx12000\\tx12480\\tx12960\\tx13440\\tx13920\\tx14400\\tx14880\\tx15360\\tx15840\\tx16320\\tx16800\\tx17280\\tx17760\\tx18240\\tx18720\\tx19200\\tx19680\\tx20160\\tx20640\\tx21120\\tx21600\\tx22080\\tx22560\\tx23040\\tx23520\\tx24000\\tx24480\\tx24960\\tx25440\\tx25920\\tx26400\\tx26880\\tx27360\\tx27840\\tx28320\\tx28800\\tx29280\\tx29760\\tx30240\\tx30720\\tx31200\\tx31680\\tx32160\\tx32640\\tx33120\\tx33600\\tx34080\\tx34560\\tx35040\\tx35520\\tx36000\\tx36480\\tx36960\\tx37440\\tx37920\\tx38400\\tx38880\\tx39360\\tx39840\\tx40320\\tx40800\\tx41280\\tx41760\\tx42240\\tx42720\\tx43200\\tx43680\\tx44160\\tx44640\\tx45120\\tx45600\\tx46080\\tx46560\\tx47040\\tx47520\\tx48000\\pardirnatural\\partightenfactor0\n\\cf0 \tModified by Jonathan Gillaspie with TestPlant, Inc.\n\\b0 \\\n\t\t\n\\b Note: This release supports 10.4 and above, PPC and Intel\n\\b0 \\\n\\\n\t\tFixed a bug on startup that could crash on some systems \\\n\t\tFixes to prevent a Rich Clipboard deadlock problem.\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 \\\n\\pard\\tx480\\tx960\\tx1440\\tx1920\\tx2400\\tx2880\\tx3360\\tx3840\\tx4320\\tx4800\\tx5280\\tx5760\\tx6240\\tx6720\\tx7200\\tx7680\\tx8160\\tx8640\\tx9120\\tx9600\\tx10080\\tx10560\\tx11040\\tx11520\\tx12000\\tx12480\\tx12960\\tx13440\\tx13920\\tx14400\\tx14880\\tx15360\\tx15840\\tx16320\\tx16800\\tx17280\\tx17760\\tx18240\\tx18720\\tx19200\\tx19680\\tx20160\\tx20640\\tx21120\\tx21600\\tx22080\\tx22560\\tx23040\\tx23520\\tx24000\\tx24480\\tx24960\\tx25440\\tx25920\\tx26400\\tx26880\\tx27360\\tx27840\\tx28320\\tx28800\\tx29280\\tx29760\\tx30240\\tx30720\\tx31200\\tx31680\\tx32160\\tx32640\\tx33120\\tx33600\\tx34080\\tx34560\\tx35040\\tx35520\\tx36000\\tx36480\\tx36960\\tx37440\\tx37920\\tx38400\\tx38880\\tx39360\\tx39840\\tx40320\\tx40800\\tx41280\\tx41760\\tx42240\\tx42720\\tx43200\\tx43680\\tx44160\\tx44640\\tx45120\\tx45600\\tx46080\\tx46560\\tx47040\\tx47520\\tx48000\\pardirnatural\\partightenfactor0\n\n\\b0 \\cf0 \t\tFixes to project for XCode 3.2 and Mac OS X 10.6.\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 \\\n\\\nVersion 3.11 Released 12-October-2009:\\\n\\pard\\tx480\\tx960\\tx1440\\tx1920\\tx2400\\tx2880\\tx3360\\tx3840\\tx4320\\tx4800\\tx5280\\tx5760\\tx6240\\tx6720\\tx7200\\tx7680\\tx8160\\tx8640\\tx9120\\tx9600\\tx10080\\tx10560\\tx11040\\tx11520\\tx12000\\tx12480\\tx12960\\tx13440\\tx13920\\tx14400\\tx14880\\tx15360\\tx15840\\tx16320\\tx16800\\tx17280\\tx17760\\tx18240\\tx18720\\tx19200\\tx19680\\tx20160\\tx20640\\tx21120\\tx21600\\tx22080\\tx22560\\tx23040\\tx23520\\tx24000\\tx24480\\tx24960\\tx25440\\tx25920\\tx26400\\tx26880\\tx27360\\tx27840\\tx28320\\tx28800\\tx29280\\tx29760\\tx30240\\tx30720\\tx31200\\tx31680\\tx32160\\tx32640\\tx33120\\tx33600\\tx34080\\tx34560\\tx35040\\tx35520\\tx36000\\tx36480\\tx36960\\tx37440\\tx37920\\tx38400\\tx38880\\tx39360\\tx39840\\tx40320\\tx40800\\tx41280\\tx41760\\tx42240\\tx42720\\tx43200\\tx43680\\tx44160\\tx44640\\tx45120\\tx45600\\tx46080\\tx46560\\tx47040\\tx47520\\tx48000\\pardirnatural\\partightenfactor0\n\\cf0 \tModified by Jonathan Gillaspie with TestPlant, Inc.\n\\b0 \\\n\t\t\n\\b Note: This release supports 10.3.9 and above, PPC and Intel\n\\b0 \\\n\\\n\t\tFixed a number of international keyboards that had a small number of keys not mapped (like i and ; in French.)\\\n\t\t\\\n\t\tFixed a compile level problem that caused a crash when using ZRLE encoding\\\n\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 \\\nVersion 3.1 Released 01-June-2009:\\\n\\pard\\tx480\\tx960\\tx1440\\tx1920\\tx2400\\tx2880\\tx3360\\tx3840\\tx4320\\tx4800\\tx5280\\tx5760\\tx6240\\tx6720\\tx7200\\tx7680\\tx8160\\tx8640\\tx9120\\tx9600\\tx10080\\tx10560\\tx11040\\tx11520\\tx12000\\tx12480\\tx12960\\tx13440\\tx13920\\tx14400\\tx14880\\tx15360\\tx15840\\tx16320\\tx16800\\tx17280\\tx17760\\tx18240\\tx18720\\tx19200\\tx19680\\tx20160\\tx20640\\tx21120\\tx21600\\tx22080\\tx22560\\tx23040\\tx23520\\tx24000\\tx24480\\tx24960\\tx25440\\tx25920\\tx26400\\tx26880\\tx27360\\tx27840\\tx28320\\tx28800\\tx29280\\tx29760\\tx30240\\tx30720\\tx31200\\tx31680\\tx32160\\tx32640\\tx33120\\tx33600\\tx34080\\tx34560\\tx35040\\tx35520\\tx36000\\tx36480\\tx36960\\tx37440\\tx37920\\tx38400\\tx38880\\tx39360\\tx39840\\tx40320\\tx40800\\tx41280\\tx41760\\tx42240\\tx42720\\tx43200\\tx43680\\tx44160\\tx44640\\tx45120\\tx45600\\tx46080\\tx46560\\tx47040\\tx47520\\tx48000\\pardirnatural\\partightenfactor0\n\\cf0 \tModified by Jonathan Gillaspie with TestPlant, Inc.\n\\b0 \\\n\t\t\n\\b Note: This release supports 10.3.9 and above, PPC and Intel\n\\b0 \\\n\\\n\t\tAdded an advanced preference to specify which event source Vine Server should register with (10.4+)\\\n\t\tAdded an advanced preference to use OpenGL to capture the display, best on newer Intel hardware (10.4+)\\\n\t\tMoved Keyboard Events selector to Advanced Settings.\\\n\\\n\t\tFixed a problem running on 10.3.9\\\n\t\tFixed a problem auto launching the server from GUI when Vine Server was set to Auto-Hide\\\n\t\tFixed a problem not honoring the selection to disable Bonjour.\\\n\t\tFixed a problem with Require SSH not being stored correctly for System Server.\\\n\t\tFixed a problem with server shutting down after a logout.\\\n\\\n\t\tFixed a number of international keyboards that had a small number of keys not mapped (like i in Belgian, o in Swiss, etc.)\\\n\t\tFixed an occasional problem sending rich cursors to the remote system.\\\n\\\n\t\tFixed an occasional problem not sending the right information on a copy/cut.\\\n\\\n\t\tFixed a problem with Echoware bundle loaded twice.\\\n\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 \\\nVersion 3.0, Released 17-Dec-2007:\\\n\\pard\\tx480\\tx960\\tx1440\\tx1920\\tx2400\\tx2880\\tx3360\\tx3840\\tx4320\\tx4800\\tx5280\\tx5760\\tx6240\\tx6720\\tx7200\\tx7680\\tx8160\\tx8640\\tx9120\\tx9600\\tx10080\\tx10560\\tx11040\\tx11520\\tx12000\\tx12480\\tx12960\\tx13440\\tx13920\\tx14400\\tx14880\\tx15360\\tx15840\\tx16320\\tx16800\\tx17280\\tx17760\\tx18240\\tx18720\\tx19200\\tx19680\\tx20160\\tx20640\\tx21120\\tx21600\\tx22080\\tx22560\\tx23040\\tx23520\\tx24000\\tx24480\\tx24960\\tx25440\\tx25920\\tx26400\\tx26880\\tx27360\\tx27840\\tx28320\\tx28800\\tx29280\\tx29760\\tx30240\\tx30720\\tx31200\\tx31680\\tx32160\\tx32640\\tx33120\\tx33600\\tx34080\\tx34560\\tx35040\\tx35520\\tx36000\\tx36480\\tx36960\\tx37440\\tx37920\\tx38400\\tx38880\\tx39360\\tx39840\\tx40320\\tx40800\\tx41280\\tx41760\\tx42240\\tx42720\\tx43200\\tx43680\\tx44160\\tx44640\\tx45120\\tx45600\\tx46080\\tx46560\\tx47040\\tx47520\\tx48000\\pardirnatural\\partightenfactor0\n\\cf0 \tModified by Jonathan Gillaspie with Redstone Software, Inc.\n\\b0 \\\n\t\t\n\\b Note: This release supports 10.3.9 and above, PPC and Intel\n\\b0 \\\n\\\n\t\tInternational Interfaces haven't been converted to the new interface, as they become available we will post them.\\\n\\\n\n\\b \t\tAdded support for Leopard System Servers\\\n\n\\b0 \\\n\n\\b \t\tInterface:\\\n\n\\b0 \t\t\tCleaned up interface by introducing a basic control panel and moving settings to dedicate Preference Pane.\\\n\t\t\tMoved \"View Log\" and \"Reverse Connection\" to menus\\\n\t\t\tAdded Reporting for Client Connection List (and icon badging in Leopard)\\\n\t\t\tAdded external IP lookup and ability to verify access to your VNC server from detected IPs\\\n\t\t\tAlways allow a server restart from the UI\\\n\t\t\tPanel to prevent accidentally quitting Vine Server when users are connected\\\n\\\n\n\\b \t\tStartup:\\\n\n\\b0 \t\t\tBetter IP and DNS resolution so that initial startup is not delayed (as can happen on Leopard)\\\n\t\t\tAdded LaunchD support for the System Server on 10.5\\\n\t\t\tFixed a Leopard issue with displaying an extra icon\\\n\t\t\tAdded better versioning (AVS)\\\n\t\\\n\n\\b \t\tVNC Server:\\\n\t\t\t\n\\b0 Added support for Unicode keyboard (10.4+)\\\n\t\t\tAdded support to detect keyboard type (10.4+)\\\n\t\t\tAdded support to control where events enter the system (Event Taps) (10.4+)\n\\b \\\n\n\\b0 \\\n\t\t\tFixed a bug auto-detecting the proper port when SSH-only was checked.\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\\cf0 \tFixed a lockup problem in the OSXvnc-server process that could occur with Rich Clipboard Support enabled.\\\n\tFixed a problem repeatedly trying to send an empty clipboard buffer.\\\n\tFixed a bug with restoring otherArguments from defaults\\\n\\\n\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 Version 2.2, Released 1-August-2007:\\\n\\pard\\tx480\\tx960\\tx1440\\tx1920\\tx2400\\tx2880\\tx3360\\tx3840\\tx4320\\tx4800\\tx5280\\tx5760\\tx6240\\tx6720\\tx7200\\tx7680\\tx8160\\tx8640\\tx9120\\tx9600\\tx10080\\tx10560\\tx11040\\tx11520\\tx12000\\tx12480\\tx12960\\tx13440\\tx13920\\tx14400\\tx14880\\tx15360\\tx15840\\tx16320\\tx16800\\tx17280\\tx17760\\tx18240\\tx18720\\tx19200\\tx19680\\tx20160\\tx20640\\tx21120\\tx21600\\tx22080\\tx22560\\tx23040\\tx23520\\tx24000\\tx24480\\tx24960\\tx25440\\tx25920\\tx26400\\tx26880\\tx27360\\tx27840\\tx28320\\tx28800\\tx29280\\tx29760\\tx30240\\tx30720\\tx31200\\tx31680\\tx32160\\tx32640\\tx33120\\tx33600\\tx34080\\tx34560\\tx35040\\tx35520\\tx36000\\tx36480\\tx36960\\tx37440\\tx37920\\tx38400\\tx38880\\tx39360\\tx39840\\tx40320\\tx40800\\tx41280\\tx41760\\tx42240\\tx42720\\tx43200\\tx43680\\tx44160\\tx44640\\tx45120\\tx45600\\tx46080\\tx46560\\tx47040\\tx47520\\tx48000\\pardirnatural\\partightenfactor0\n\\cf0 \tModified by Jonathan Gillaspie with Redstone Software, Inc.\n\\b0 \\\n\\\n\t\t\tAdded warnings when launching or setting a system server with no password set.\\\n\t\t\tAdded a new -maxdepth argument to limit incoming connections..\\\n\t\t\tAdded a new -maxauths to limit brute force VNC server attacks.\\\n\\\n\t\t\tFixed a problem with keyboard events being impacted by local modifer keys (like CapsLock and Command).\\\n\t\t\tFixed a problem detecting \"self connection loops\" where we are providing our own Pasteboard Data.\\\n\t\t\tFixed a problem with multiple users launching the same copy of Vine Server.\\\n\t\t\tFixed a problem with launching Vine Server when our own Host Name can't be determined.\\\n\\\n\t\t\tHost name is retrieved in a separate thread to prevent hanging the app when DNS isn't setup.\\\n\t\t\tImprovements to performance when accessing clipboard data.\\\n\t\t\tRemoved spurious log messages when accessing clipboard dat.\\\n\t\t\tChanged install permissions to 755 for increased security.\\\n\t\t\tDefaults to storing the .osxvncauth files to the users home directory.\n\\b \\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\\cf0 \\\n\\\nVersion 2.1, Released 5 December 2006:\\\n\\pard\\tx480\\tx960\\tx1440\\tx1920\\tx2400\\tx2880\\tx3360\\tx3840\\tx4320\\tx4800\\tx5280\\tx5760\\tx6240\\tx6720\\tx7200\\tx7680\\tx8160\\tx8640\\tx9120\\tx9600\\tx10080\\tx10560\\tx11040\\tx11520\\tx12000\\tx12480\\tx12960\\tx13440\\tx13920\\tx14400\\tx14880\\tx15360\\tx15840\\tx16320\\tx16800\\tx17280\\tx17760\\tx18240\\tx18720\\tx19200\\tx19680\\tx20160\\tx20640\\tx21120\\tx21600\\tx22080\\tx22560\\tx23040\\tx23520\\tx24000\\tx24480\\tx24960\\tx25440\\tx25920\\tx26400\\tx26880\\tx27360\\tx27840\\tx28320\\tx28800\\tx29280\\tx29760\\tx30240\\tx30720\\tx31200\\tx31680\\tx32160\\tx32640\\tx33120\\tx33600\\tx34080\\tx34560\\tx35040\\tx35520\\tx36000\\tx36480\\tx36960\\tx37440\\tx37920\\tx38400\\tx38880\\tx39360\\tx39840\\tx40320\\tx40800\\tx41280\\tx41760\\tx42240\\tx42720\\tx43200\\tx43680\\tx44160\\tx44640\\tx45120\\tx45600\\tx46080\\tx46560\\tx47040\\tx47520\\tx48000\\pardirnatural\\partightenfactor0\n\\cf0 \tModified by Jonathan Gillaspie & Doug Simons with Redstone Software, Inc.\n\\b0 \\\n\t\t\t\\\n\t\t\tFixed a problem with Host Name Lookups when doing Reverse Connections\\\n\t\t\tFixes to move all clipboard interaction through main thread (required for 10.2 support and better all around behavior).\\\n\t\t\tFix to improper behavior when changing the display number to Auto.\\\n\t\t\tImproved support for 10.1 and below by adding a dynamically loadable call to the CGMainDisplay() function..\\\n\\\n\t\t\tMuch improved Rich Pasteboard support for 10.2, 10.3 and for interactions with those versions and 10.4.\\\n\t\t\tFixed a crash when multiple threads accessed the pasteboard variables\\\n\t\t\tFixed a crash accessing client pasteboard data after it's been cleared.\\\n\t\t\tFix to not retaining the \"COPY\" string when it's put to the pasteboard.\\\n\t\t\tFix for one of many pasteboard files when we can't read the file.\\\n\t\t\tImprovements to detecting \"self connection loops\" where we are providing our own Pasteboard Data.\\\n\n\\b \\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\\cf0 \\\nVersion 2.0, Released 1 November 2006:\\\n\\pard\\tx480\\tx960\\tx1440\\tx1920\\tx2400\\tx2880\\tx3360\\tx3840\\tx4320\\tx4800\\tx5280\\tx5760\\tx6240\\tx6720\\tx7200\\tx7680\\tx8160\\tx8640\\tx9120\\tx9600\\tx10080\\tx10560\\tx11040\\tx11520\\tx12000\\tx12480\\tx12960\\tx13440\\tx13920\\tx14400\\tx14880\\tx15360\\tx15840\\tx16320\\tx16800\\tx17280\\tx17760\\tx18240\\tx18720\\tx19200\\tx19680\\tx20160\\tx20640\\tx21120\\tx21600\\tx22080\\tx22560\\tx23040\\tx23520\\tx24000\\tx24480\\tx24960\\tx25440\\tx25920\\tx26400\\tx26880\\tx27360\\tx27840\\tx28320\\tx28800\\tx29280\\tx29760\\tx30240\\tx30720\\tx31200\\tx31680\\tx32160\\tx32640\\tx33120\\tx33600\\tx34080\\tx34560\\tx35040\\tx35520\\tx36000\\tx36480\\tx36960\\tx37440\\tx37920\\tx38400\\tx38880\\tx39360\\tx39840\\tx40320\\tx40800\\tx41280\\tx41760\\tx42240\\tx42720\\tx43200\\tx43680\\tx44160\\tx44640\\tx45120\\tx45600\\tx46080\\tx46560\\tx47040\\tx47520\\tx48000\\pardirnatural\\partightenfactor0\n\\cf0 \tModified by Jonathan Gillaspie with Redstone Software, Inc.\t\\\n\\\n\t\t\t\n\\b0 Renamed the server wrapper to correspond to its companion - Vine Viewer!\\\n\t\t\t\thttp://www.redstonesoftware.com/products/vine for more information\\\n\n\\b \\\n\t\t\t\n\\b0 Added Rich Clipboard Support for Mac OS X\\\n\\\n\t\t\tVine Server now includes a User Manual\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\\cf0 \t\tThanks to Pamela Gillaspie\\\n\t\\\n\tIncorporated a much better keep-alive script for the System Server\\\n\t\tThanks to Marvin Simkin\n\\b \\\n\\pard\\tx480\\tx960\\tx1440\\tx1920\\tx2400\\tx2880\\tx3360\\tx3840\\tx4320\\tx4800\\tx5280\\tx5760\\tx6240\\tx6720\\tx7200\\tx7680\\tx8160\\tx8640\\tx9120\\tx9600\\tx10080\\tx10560\\tx11040\\tx11520\\tx12000\\tx12480\\tx12960\\tx13440\\tx13920\\tx14400\\tx14880\\tx15360\\tx15840\\tx16320\\tx16800\\tx17280\\tx17760\\tx18240\\tx18720\\tx19200\\tx19680\\tx20160\\tx20640\\tx21120\\tx21600\\tx22080\\tx22560\\tx23040\\tx23520\\tx24000\\tx24480\\tx24960\\tx25440\\tx25920\\tx26400\\tx26880\\tx27360\\tx27840\\tx28320\\tx28800\\tx29280\\tx29760\\tx30240\\tx30720\\tx31200\\tx31680\\tx32160\\tx32640\\tx33120\\tx33600\\tx34080\\tx34560\\tx35040\\tx35520\\tx36000\\tx36480\\tx36960\\tx37440\\tx37920\\tx38400\\tx38880\\tx39360\\tx39840\\tx40320\\tx40800\\tx41280\\tx41760\\tx42240\\tx42720\\tx43200\\tx43680\\tx44160\\tx44640\\tx45120\\tx45600\\tx46080\\tx46560\\tx47040\\tx47520\\tx48000\\pardirnatural\\partightenfactor0\n\\cf0 \\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b0 \\cf0 \tImproved Performance on 10.4+ systems by un-registering for notifications when server has no clients connected\n\\b \\\n\\\n\t\n\\b0 Fixed a compatibility problem running on 10.1.5\n\\b \\\n\t\n\\b0 Fixed InfoPlist encoding\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 \\\n\t\n\\b0 Removed Host Name/IP Address Display when none are found\n\\b \\\n\t\t\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b0 \\cf0 \tAdded German Localization\\\n\t\tThanks To J\\'f6rg Mehring\\\n\tAdded Italian Localization\\\n\t\tThanks to Claudio and Creative Shield ( http://shieldnet.tk/ )\\\n\tImproved Some Japanese Localized Strings\\\n\t\tThanks to Hiroshi Saito\\\n\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 Version 1.71, Released 01/26/2006:\\\n\\pard\\tx480\\tx960\\tx1440\\tx1920\\tx2400\\tx2880\\tx3360\\tx3840\\tx4320\\tx4800\\tx5280\\tx5760\\tx6240\\tx6720\\tx7200\\tx7680\\tx8160\\tx8640\\tx9120\\tx9600\\tx10080\\tx10560\\tx11040\\tx11520\\tx12000\\tx12480\\tx12960\\tx13440\\tx13920\\tx14400\\tx14880\\tx15360\\tx15840\\tx16320\\tx16800\\tx17280\\tx17760\\tx18240\\tx18720\\tx19200\\tx19680\\tx20160\\tx20640\\tx21120\\tx21600\\tx22080\\tx22560\\tx23040\\tx23520\\tx24000\\tx24480\\tx24960\\tx25440\\tx25920\\tx26400\\tx26880\\tx27360\\tx27840\\tx28320\\tx28800\\tx29280\\tx29760\\tx30240\\tx30720\\tx31200\\tx31680\\tx32160\\tx32640\\tx33120\\tx33600\\tx34080\\tx34560\\tx35040\\tx35520\\tx36000\\tx36480\\tx36960\\tx37440\\tx37920\\tx38400\\tx38880\\tx39360\\tx39840\\tx40320\\tx40800\\tx41280\\tx41760\\tx42240\\tx42720\\tx43200\\tx43680\\tx44160\\tx44640\\tx45120\\tx45600\\tx46080\\tx46560\\tx47040\\tx47520\\tx48000\\pardirnatural\\partightenfactor0\n\\cf0 \tModified by Jonathan Gillaspie with Redstone Software, Inc.\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\\cf0 \tosxvnc@redstonesoftware.com\n\\b0 \\\n\\\n\tAdded support for ISO Latin Clipboards as per RFB Spec 3.8 (Compatible with TightVNC)\\\n\\\n\tFixed a problem with the Startup Item Shutting down after a user-logout\\\n\tFixed a problem for Startup Item with spaces in the Display Name\\\n\tFixed a problem reporting default DeferUpdate timer value\\\n\t\\\n\tFixed problems compiling for Intel Macs on PPC Macs\\\n\\\n\\\n\n\\b Version 1.7, Released 01/06/2006:\\\n\tModified by Jonathan Gillaspie with Redstone Software, Inc.\\\n\tosxvnc@redstonesoftware.com\n\\b0 \\\n\\\n\\pard\\pardeftab720\\partightenfactor0\n\\cf0 \t\tAdded GUI Support to Establish Reverse Connections to listening VNC Viewers:\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\\cf0 \t\tYou can now add as many listening hosts as you want directly from the GUI.\\\n\\\n\tConverted OSXvnc to a full Universal Binary For Improved Intel performance.\\\n\\\n\tAdded a mode to force backward compatibility to older protocol versions (3.3).\\\n\tAdded a flag to disable the screen saver while clients are connected.\\\n\\\n\tFixed a problem with screen updates on INTEL Prerelease 10.4.2 and above.\\\n\tFixed a problem with Jaguar Extensions(Bonjour) when first \"Configuring the Startup Item\", worked on subsequent boots.\\\n\\\n\tFixed a problem with the \"ConnectHost\" option when specifying IPv4 addresses or host names which resolved to IPv4.\\\n\tFixed a problem where the application could user CPU cycles even when no user was connected.\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\pardeftab720\\partightenfactor0\n\\cf0 \tFixed a problem with IPv6 host names not showing up\\\n\tFixed a problem with repeated crashes not exiting the keep-alive script\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\\cf0 \\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 Version 1.61, Released 8/3/2005:\\\n\tModified by Jonathan Gillaspie with Redstone Software, Inc.\\\n\tosxvnc@redstonesoftware.com\n\\b0 \\\n\\\n\tNew With Tiger! Multiple Mac OS X Desktops:\n\\f1 \\\n\\pard\\tx1440\\tx2160\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\partightenfactor0\n\n\\f0 \\cf0 \t\tPlease read this separate guide to {\\field{\\*\\fldinst{HYPERLINK \"http://www.redstonesoftware.com/multidesktop.html\"}}{\\fldrslt Multiple Desktop Sessions on Mac OS 10.4 - TIGER}}.\\\n\t\tImproved default preferences to work best for Multiple Mac OS X Desktops. \\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\\cf0 \\\n\tFixed color mapping problems for Intel Macs.\\\n\tFixed a problem with the startup script being unable to kill running Startup Items.\\\n\tFixed a problem with the startup item not supporting Rendezvous.\\\n\tFixed a problem where changing only the bit depth on the local machine resulted in bad data being sent to client.\\\n\tFixed a crashing/disconnect bug with certain animated cursors.\\\n\\\n\tAdded \"Auto\" to display number/port selection (0 from command line), this will find the first open port 5900-5909.\\\n\tAdded support to update the IP and Host Name sections when network changes (10.4+ Only)\\\n\tAdded RFB support for protocol version 003.008\\\n\tAdded IPv6 Support (10.2+ Only)\\\n\t\tSpecial Thanks To Jens-Uwe Mager for the patch.\\\n\\\n\tAdded\n\\f2\\fs20 \\CocoaLigature0 TCP_NODELAY\n\\f0\\fs24 \\CocoaLigature1 on socket to improve performance, particularly with\n\\f3 *\n\\f0 2vnc type applications.\\\n\\\n\tAdded a backwards compatibility flag (-rendezvous VNC) for old rendezvous service name.\n\\b \\\n\\\n\n\\b0 \tAdded Japanese Localization\\\n\\pard\\tx1440\\tx2160\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\partightenfactor0\n\\cf0 \t\tSpecial Thanks to Aaron Madlon-Kay\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 \\\n\\\nVersion 1.5, Released 2/1/2005:\\\n\tModified by Jonathan Gillaspie with Redstone Software, Inc.\\\n\tosxvnc@redstonesoftware.com\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b0 \\cf0 \\\n\tAdded support for Server Side Scaling (Both PalmVNC and UltraVNC style)\\\n\\pard\\tx1440\\tx2160\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\partightenfactor0\n\\cf0 \t\tSpecial Thanks To Noriaki Yamazaki\\\n\t\tAdministrator of micro-VNC\\\n\t\tHitachi System & Service, Ltd.\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\\cf0 \\\n\tAdded command-line support for Reverse connections.\\\n\\pard\\tx1440\\tx2160\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\partightenfactor0\n\\cf0 \t\tSpecial Thanks to Mark Lentczner\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\\cf0 \\\n\tAdded French Localization\\\n\\pard\\tx1440\\tx2160\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\partightenfactor0\n\\cf0 \t\tSpecial Thanks to Pascal Frey\\\n\t\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\\cf0 \tSwitch Rendezvous (zero-conf) support to use _rfb._tcp for compatibility with other servers.\\\n\tTurned KeyboardLoading OFF by default since it is currently detrimental for international keyboard users.\\\n\tFixed a problem doing startup on OSX 10.1.5.\\\n\tFixed a problem doing startup on OSX 10.4 (TIGER).\\\n\tFixed a crashing bug with pasteboard access when multiple clients are connected.\\\n\tAdded special pseudo-encoding so OSXvnc can report when its clipboard is inaccessible.\\\n\\\n\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 \\\nVersion 1.4, Released 8/17/2004:\\\n\tModified by Jonathan Gillaspie with Redstone Software, Inc.\\\n\tosxvnc@redstonesoftware.com\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b0 \\cf0 \\\n\tAdded Rendezvous (zero-conf) support using _vnc._tcp.\\\n\tVNC Discovery will work with\n\\b Chicken of The VNC\n\\b0  and\n\\b Eggplant\n\\b0 \\\n\tFixed a problem where the \"Never Share Connection\" option was being ignored from the GUI\\\n\tFixed a problem where a spurious 0 file was created when running the startup script\\\n\tFixed a problem where the keep-alive script wouldn't shutdown properly on unrecoverable errors\\\n\t\\\n\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 Version 1.33, Released 3/18/2004:\\\n\tModified by Jonathan Gillaspie with Redstone Software, Inc.\\\n\tosxvnc@redstonesoftware.com\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b0 \\cf0 \\\n\tAdded support for pressing Keypad keys.\\\n\tFixed a small problem with depth being reported as 32 for 24 bit screens.\\\n\tAdded a -noupdates flag for users of x2vnc or win2vnc.\\\n\tFixed a password problem with startup item which sometimes used /tmp/.osxvncauth, now this file is written with the startup item.\\\n\tFixed a problem with with the auto restart script on 10.2.8\\\n\tServer now returns a negative number for unrecoverable errors (to tell the restart script to not try to restart it).\\\n\tImproved timing of Startup Item creation so that all authorized calls finish before we proceed.\\\n\tImproved scripts to use AWK more efficiently.\\\n\tFixed permissions on Startup Item.\\\n\tAdded a\n\\b restart\n\\b0  directive to the startup item.\\\n\tAdded the\n\\b PasswordFile\n\\f2\\b0\\fs20 \\cf2 \\CocoaLigature0\n\\f0\\fs24 \\cf0 \\CocoaLigature1 default to override where password file is stored (for GUI).\\\n\tAdded the\n\\b LogFile\n\\f2\\b0\\fs20 \\cf2 \\CocoaLigature0\n\\f0\\fs24 \\cf0 \\CocoaLigature1 default to override where password file is stored (for GUI).\\\n\\\n\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 Version 1.32, Released 12/12/2003:\\\n\tModified by Jonathan Gillaspie with Redstone Software, Inc.\\\n\tosxvnc@redstonesoftware.com\\\n\\\n\t\n\\b0 Fixed problem with Idle clients being disconnected\\\n\tAdded Host Names and IP Addresses to the General Tab\\\n\tAdded a remove Startup Item button\\\n\tAdded GUI support to terminate connections after a Fast User Switch (still working on better reconnect behavior)\\\n\tAuthentications now persist in OSXvnc GUI\\\n\tMoved to XCode and fixed some compile problems and backwards compatibility issues\\\n\tFixed a problem with -restartonuserswitch Flag not recognizing yes/Yes\\\n\tAdded defaults to override log and password file locations of GUI (LogFile and PasswordFile, respectively)\\\n\n\\b \\\n\\\nVersion 1.31, Released 12/02/2003:\\\n\tModified by Jonathan Gillaspie with Redstone Software, Inc.\\\n\tosxvnc@redstonesoftware.com\\\n        \\\n\t\n\\b0 Fixed problem with Startup Scripts not able to handle spaces in path\n\\b \\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b0 \\cf0         \tFixed problem with StartupItem not starting up on some systems due to incorrect StartupItem.plist\\\n                \tFixed problem with connecting to some clients when running on 10.1.5 (Unknown Auth Type)\\\n                        Fixed crashing bug when a non-ZRLE client disconnected\\\n                        Fixed problem with GUI autorestart flag not always restarting\\\n\tClarify Screen Resolution changed message.\\\n\tAdded a -restartonuserswitch command line flag to quit the server (and allow it to be restarted) on a user switch\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 \t\n\\b0 Improved performance with respect to registering for local screen updates (Win2VNC and X2VNC)\\\n\tChange to help with Mac OS stuttering when no clients are connected\\\n\n\\b \\\n\\\nVersion 1.3, Released 9/17/2003:\\\n\tModified by Jonathan Gillaspie with Redstone Software, Inc.\\\n\tosxvnc@redstonesoftware.com\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b0 \\cf0 \\\n\tOSXvnc GUI has been broken out to allow for more options and to match Preference Panes more closely.\\\n\tAdded GUI controls to set for System Startup Up (Including Authentication)\\\n\t\tWARNING: OSXvnc run at StartUp Does NOT have pasteboard synchronization\\\n\tAdded Mac OS X Cursor Support\\\n\t\tAdded RichCursorSupport (RFB 3.7 + Tight) \\\n\t\tAdded CursorPositionUpdate Support (Tight)\\\n\tSupports Dynamic Screen Sizing (Clients need no longer reconnect after a screen size change - RFB 3.7)\\\n\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 \t\n\\b0 Fixed crashing bug where certain unknown keys would crash OSXvnc\n\\b \\\n\t\n\\b0 Fixed problem with Shift-Tab (sent from OS X) being ignored as an End Of Medium character, when it didn't crash the whole server\n\\b \\\n\t\n\\b0 Fixed problem with OSXvnc causing machine interruptions when no clients connected by disabling poll for ScreenUpdates (Bug-770661)\\\n\tNow Attempting to pass the CGCharCode, reports that this improves stability (no crashing during key events like Return).\\\n\tAdded Bundle Loading to hopefully allow OSXvnc to run on 10.0 and use 10.2 and 10.3 specific enhancements\\\n\tFixed an occasional problem sending a rectangle without having accounted for it\\\n\tFixed a rare bug where it was occasionally possible for clients to miss a copy event which occurred on the server.\n\\b \\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b0 \\cf0 \tFixed so that scroll wheel events don't leak by adding NSAutoreleasePool (Bug-760383)\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 \t\n\\b0 Fixed some pasteboard problems with non text put to pasteboard\\\n\n\\b \t\n\\b0 Minor Performance improvements for delay between thread notifications\\\n\\\n\\\n\n\\b Version 1.2, Released 5/7/2003:\\\n\tModified by Jonathan Gillaspie with Redstone Software, Inc.\\\n\tosxvnc@redstonesoftware.com\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b0 \\cf0 \tImprovements to StartupItems script for Startup on System Boot\\\n\tFixed so that client keys which are being held down by a client will be released when the client disconnects\\\n\tFixed pasteboard bug where Server Cut Text event was being sent only in response to screen updates and sometimes within an RFB\\\n\tFixed problem where server sometimes says it needs to restart when nothing changed\\\n\tFixed an occasional Crash on Disconnect in 10.1\\\n\tFixed a problem with lossy conversion to CStrings for clipboard contents with non-roman characters.\\\n\tSetup run-loop to only poll screen when clients are connected, for improved performance.\\\n\tChange to place temporary files in /tmp if the application package is not writable. (10.2 only)\\\n\t\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 \\\nVersion 1.11, Released 1/18/2003:\\\n\tModified by Jonathan Gillaspie with Redstone Software, Inc.\\\n\tosxvnc@redstonesoftware.com\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b0 \\cf0         \t* Contributions from (OSXvncPlus) by Steven Tamm\\\n                \t* Contributions from (OSXvnc 0.8) by Mihai Parparita\\\n                \t* Cool Icon Contributed by Martin Goneau ( http://www.goneau.com )\\\n\tIncluded StarupItems folder for Startup on System Boot\\\n\tVersion 1.11 of StarupItems Script will relaunch after a user logout\\\n\tGUI will now offer Server Restart when appropriate\\\n                        OSXvnc now supports Scroll Wheel Mice (compliant with RealVNC 3.3.5+)\\\n                        OSXvnc now supports zRLE encoding (compliant with RealVNC 3.3.4+)\\\n        \t8-Bit color now works\\\n                \tCan optionally set to allow only local connections (useful with SSH)\\\n                        Updated FAQ with lots of useful information\\\n\tEnhanced Keyboard Mapping Performance\\\n                        Now compatible with all versions of Chicken of the VNC\\\n        \tFixed which caused pointer events to be locked out and occasionally not recognized\\\n                        Fixed to a problem when multiple clients were using encodings that use Zlib compression\\\n                        Fixed to a problem where changing screen resolution didn't work if launched command line\\\n                        Fixed to the Zero Size Rect\\\n\tFixed to the default keymapping for ~ and ` keys\\\n\\\n\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 Version 1.0, Released 9/26/2002;\\\n\tModified by Jonathan Gillaspie & Doug Simons with Redstone Software, Inc.\n\\b0 \t\n\\b osxvnc@redstonesoftware.com\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b0 \\cf0 \tVNC Server will restart if the screen resolution Changes\\\n\tNow sends updates on request as per protocol\\\n                \tNow Handles Pasteboard events\\\n\tNow correctly handles multiple connections\\\n\tNow stores setting in preferences\\\n\tNow pulls host name for default display\\\n\tNow defaults to display numer 0 = Port 5900\t\\\n\tDoesn't launch second icon to dock\\\n\tNow able to swap mouse #2/#3 for Right Clicks\\\n        \tAllows Disabling Remote Keyboard and Mouse\\\n\tAllows Autostart server on launch\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\i\\b \\cf3 \\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\i0\\b0 \\cf0 \\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 Version 0.7, Released 4/23/2002:\\\n\tModified by Mahmud Haque mahmud@bcm.tmc.edu\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b0 \\cf0 \tAdd support for zlib and tight encoding ( codes from Tightvnc source).\\\n\tAdd support for zlibhex encoding ( codes from Tridia source).\\\n\t\\\n\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 Version 0.6, Released 5/14/2001:\t\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b0 \\cf0 \tAdd support for controlling display dimming and sleep based on\\\n\tpatch submitted by Jed Davis <jldavis@cs.oberlin.edu>.  A dimmed\\\n\tdisplay now wakes up when there is VNC input.\\\n\tVarious minor UI fixes: remove console debugging output; add\\\n\t0 to the list of display numbers; change default display name\\\n\tto \"Mac OS X\"; don't leave the UI disabled when the server dies\\\n\tunexpectedly.\\\n\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 Version 0.5, released 4/25/2001:\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b0 \\cf0 \tInitial release.\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 \\\n\\\n\\\nThings To Do:\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b0 \\cf0 \\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b \\cf0 Still to do:\\\n\\pard\\tx1440\\tx2880\\tx4320\\tx5760\\tx7200\\partightenfactor0\n\n\\b0 \\cf0 \\\nBundles performance optimization\\\n\\\nMove Disable Logic To Puma Bundle - Necessary for 10.0?\\\n\\\nMouse Cursor:\\\n\tOccasional cursor artifacts (disabling cursor display didn't seem to help)\\\n\tProblem with partial transparency on cursors - displayed using threshold\\\n\\\nFix so that server doesn't die when user logs out \\\n\tTried using demonize, didn't seem to fix it, I think it needs to be the run loop which shuts down\\\n\\\nOption to set background to Black on Connect\\\n\t(\n\\f2\\fs20 /System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background -module \"\" &)\\\n\n\\f0\\fs24 \\\nDisable the screen-blanking/screen-saver while people are connected\\\n\tIt does some of this, must verify\\\n\\\nFix bug when running with local screen in 256 Color Mode\\\n\\\nFix bug in CoRRE\\\n\\\nSupport For Multiple Physical Displays\\\n\tHave some basics in but haven't resolved dealing with the multiple screens as part of a larger screen area (need to translate events, etc.)\\\n\\\nReplace -localhost\n\\f2\\fs20 \\cf2 \\CocoaLigature0\n\\f0\\fs24 \\cf0 \\CocoaLigature1 with full -vncauth file\\\n\\\nAdd inetd/xinetd support\\\n\tSo OSXvnc will startup when a request comes in\\\n\tLook  in RealVNC 4.0 for example\\\n\\\nAdd \"Send Full Screen\" Mode - Useful for things like Keynote which bypasses CGRemoteOperations API\\\n\tPossibly Detect when machine enters such a mode - ie starts running Keynote\\\n\\\nPaint in Local Mouse Cursor Option\\\n\tTry using the rfbLocalBuffer logic - BUT instead of running the whole screen through that \\\n\tJust send an update for cursor position when cursor moves. Or when other updates go out.\\\n}\n"
  },
  {
    "path": "fr.lproj/Copying.rtf",
    "content": "{\\rtf1\\mac\\ansicpg10000\\cocoartf102\n\\readonlydoc1{\\fonttbl\\f0\\fswiss\\fcharset77 Helvetica-Bold;\\f1\\fswiss\\fcharset77 Helvetica;\\f2\\fswiss\\fcharset77 Helvetica-Oblique;\n}\n{\\colortbl;\\red255\\green255\\blue255;\\red255\\green0\\blue0;}\n\\paperw11900\\paperh16840\\margl1440\\margr1440\\vieww11720\\viewh14400\\viewkind0\n\\pard\\tx560\\tx1120\\tx1680\\tx2240\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\qc\n\n\\f0\\b\\fs36 \\cf0 Licence Publique G\\'8en\\'8erale GNU Version 2, Juin 1991\\\n\\pard\\tx560\\tx1120\\tx1680\\tx2240\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\qc\n\n\\f1\\b0\\fs24 \\cf0 \\\n\\pard\\tx560\\tx1120\\tx1680\\tx2240\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\ql\\qnatural\n\\cf0 Free Software Foundation\\\n199106\\\n\\\n\n\\f2\\i \\cf2 This is an unofficial translation of the GNU General Public License into French. It was not published by the Free Software Foundation, and does not legally state the distribution terms for software that uses the GNU GPL--only the original English text of the GNU GPL does that. However, we hope that this translation will help French speakers understand the GNU GPL better. \\\n\\\nVoici (http://www.linux-france.org/article/these/gpl.html) une adaptation non officielle de la Licence Publique G\\'8en\\'8erale du projet GNU. Elle n'a pas \\'8et\\'8e publi\\'8ee par la Free Software Foundation et son contenu n'a aucune port\\'8ee l\\'8egale car seule la version anglaise de ce document d\\'8etaille le mode de distribution des logiciels sous GNU GPL. Nous esp\\'8erons cependant qu'elle permettra aux francophones de mieux comprendre la GPL.\n\\f1\\i0 \\cf0 \\\n\\\n\\\n\n\\f0\\b\\fs30 \\ul 1. Copyright\n\\f1\\b0\\fs24 \\ulnone \\\n\\\nCopyright \\'a9 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 \\'83tats-Unis, 1989, 1991.\\\n\\\nLa copie et la distribution de copies exactes de ce document sont autoris\\'8ees, mais aucune modification n'est permise.\\\n\\\n\\\n\n\\f0\\b\\fs32 \\ul 2. Pr\\'8eambule\n\\f1\\b0\\fs24 \\ulnone \\\n\\\nLes licences d'utilisation de la plupart des programmes sont d\\'8efinies pour limiter ou supprimer toute libert\\'8e \\'88 l'utilisateur. \\'cb l'inverse, la Licence Publique G\\'8en\\'8erale (General Public License) est destin\\'8ee \\'88 vous garantir la libert\\'8e de partager et de modifier les logiciels libres, et de s'assurer que ces logiciels sont effectivement accessibles \\'88 tout utilisateur.\\\n\\\nCette Licence Publique G\\'8en\\'8erale s'applique \\'88 la plupart des programmes de la Free Software Foundation, comme \\'88 tout autre programme dont l'auteur l'aura d\\'8ecid\\'8e (d'autres logiciels de la FSF sont couverts pour leur part par la Licence Publique G\\'8en\\'8erale pour Biblioth\\'8fques GNU (LGPL)). Vous pouvez aussi appliquer les termes de cette Licence \\'88 vos propres programmes, si vous le d\\'8esirez.\\\n\\\nLibert\\'8e des logiciels ne signifie pas n\\'8ecessairement gratuit\\'8e. Notre Licence est con\\'8due pour vous assurer la libert\\'8e de distribuer des copies des programmes, gratuitement ou non, de recevoir le code source ou de pouvoir l'obtenir, de modifier les programmes ou d'en utiliser des \\'8el\\'8ements dans de nouveaux programmes libres, en sachant que vous y \\'90tes autoris\\'8e.\\\n\\\nAfin de garantir ces droits, nous avons d\\'9e introduire des restrictions interdisant \\'88 quiconque de vous les refuser ou de vous demander d'y renoncer. Ces restrictions vous imposent en retour certaines obligations si vous distribuez ou modifiez des copies de programmes prot\\'8eg\\'8es par la Licence. En d'autre termes, il vous incombera en ce cas de:\\\n\\\n    * transmettre aux destinataires tous les droits que vous poss\\'8edez,\\\n    * exp\\'8edier aux destinataires le code source ou bien tenir celui-ci \\'88 leur disposition,\\\n    * leur remettre cette Licence afin qu'ils prennent connaissance de leurs droits.\\\n\\\nNous prot\\'8egeons vos droits de deux fa\\'8dons: d'abord par le copyright du logiciel, ensuite par la remise de cette Licence qui vous autorise l\\'8egalement \\'88 copier, distribuer et/ou modifier le logiciel.\\\n\\\nEn outre, pour prot\\'8eger chaque auteur ainsi que la FSF, nous affirmons solennellement que le programme concern\\'8e ne fait l'objet d'aucune garantie. Si un tiers le modifie puis le redistribue, tous ceux qui en recevront une copie doivent savoir qu'il ne s'agit pas de l'original afin qu'une copie d\\'8efectueuse n'entache pas la r\\'8eputation de l'auteur du logiciel.\\\n\\\nEnfin, tout programme libre est sans cesse menac\\'8e par des d\\'8ep\\'99ts de brevets. Nous souhaitons \\'88 tout prix \\'8eviter que des distributeurs puissent d\\'8eposer des brevets sur les Logiciels Libres pour leur propre compte. Pour \\'8eviter cela, nous stipulons bien que tout d\\'8ep\\'99t \\'8eventuel de brevet doit accorder express\\'8ement \\'88 tout un chacun le libre usage du produit.\\\n\\\nLes dispositions pr\\'8ecises et les conditions de copie, de distribution et de modification de nos logiciels sont les suivantes:\\\n\\\n\\\n\n\\f0\\b\\fs32 \\ul 3. Stipulations et conditions relatives \\'88 la copie, la distribution et la modification\n\\f1\\b0\\fs24 \\ulnone \\\n\\\n\n\\f0\\b * Article 0.\n\\f1\\b0  La pr\\'8esente Licence s'applique \\'88 tout Programme (ou autre travail) o\\'9d figure une note, plac\\'8ee par le d\\'8etenteur des droits, stipulant que ledit Programme ou travail peut \\'90tre distribu\\'8e selon les termes de la pr\\'8esente Licence. Le terme Programme d\\'8esigne aussi bien le Programme lui-m\\'90me que tout travail qui en est d\\'8eriv\\'8e selon la loi, c'est-\\'88-dire tout ouvrage reproduisant le Programme ou une partie de celui-ci, \\'88 l'identique ou bien modifi\\'8e, et/ou traduit dans une autre langue (la traduction est consid\\'8er\\'8ee comme une modification). Chaque personne concern\\'8ee par la Licence Publique G\\'8en\\'8erale sera d\\'8esign\\'8ee par le terme Vous. Les activit\\'8es autres que copie, distribution et modification ne sont pas couvertes par la pr\\'8esente Licence et sortent de son cadre. Rien ne restreint l'utilisation du Programme et les donn\\'8ees issues de celui-ci ne sont couvertes que si leur contenu constitue un travail bas\\'8e sur le logiciel (ind\\'8ependemment du fait d'avoir \\'8et\\'8e r\\'8ealis\\'8e en lan\\'8dant le Programme). Tout d\\'8epend de ce que le Programme est cens\\'8e produire.\\\n\\\n\n\\f0\\b * Article 1.\n\\f1\\b0  Vous pouvez copier et distribuer des copies conformes du code source du Programme, tel que Vous l'avez re\\'8du, sur n'importe quel support, \\'88 condition de placer sur chaque copie un copyright appropri\\'8e et une restriction de garantie, de ne pas modifier ou omettre toutes les stipulations se r\\'8ef\\'8erant \\'88 la pr\\'8esente Licence et \\'88 la limitation de garantie, et de fournir avec toute copie du Programme un exemplaire de la Licence. Vous pouvez demander une r\\'8etribution financi\\'8fre pour la r\\'8ealisation de la copie et demeurez libre de proposer une garantie assur\\'8ee par vos soins, moyennant finances.\\\n\\\n\n\\f0\\b  * Article 2.\n\\f1\\b0  Vous pouvez modifier votre copie ou vos copies du Programme ou partie de celui-ci, ou d'un travail bas\\'8e sur ce Programme, et copier et distribuer ces modifications selon les termes de l'article 1, \\'88 condition de Vous conformer \\'8egalement aux conditions suivantes:\\\n          o a) Ajouter aux fichiers modifi\\'8es l'indication tr\\'8fs claire des modifications effectu\\'8ees, ainsi que la date de chaque changement.\\\n          o b) Distribuer sous les termes de la Licence Publique G\\'8en\\'8erale l'ensemble de toute r\\'8ealisation contenant tout ou partie du Programme, avec ou sans modifications.\\\n          o c) Si le Programme modifi\\'8e lit des commandes de mani\\'8fre interactive lors de son ex\\'8ecution, faire en sorte qu'il affiche, lors d'une invocation ordinaire, le copyright appropri\\'8e en indiquant clairement la limitation de garantie (ou la garantie que Vous Vous engagez \\'88 fournir Vous-m\\'90me), qu'il stipule que tout utilisateur peut librement redistribuer le Programme selon les conditions de la Licence Publique G\\'8en\\'8erale GNU, et qu'il montre \\'88 tout utilisateur comment lire une copie de celle-ci (exception: si le Programme original est interactif mais n'affiche pas un tel message en temps normal, tout travail d\\'8eriv\\'8e de ce Programme ne sera pas non plus contraint de l'afficher).\\\n      Toutes ces conditions s'appliquent \\'88 l'ensemble des modifications. Si des \\'8el\\'8ements identifiables de ce travail ne sont pas d\\'8eriv\\'8es du Programme et peuvent \\'90tre raisonnablement consid\\'8er\\'8es comme ind\\'8ependants, la pr\\'8esente Licence ne s'applique pas \\'88 ces \\'8el\\'8ements lorsque Vous les distribuez seuls. Mais, si Vous distribuez ces m\\'90mes \\'8el\\'8ements comme partie d'un ensemble coh\\'8erent dont le reste est bas\\'8e sur un Programme soumis \\'88 la Licence, ils lui sont \\'8egalement soumis, et la Licence s'\\'8etend ainsi \\'88 l'ensemble du produit, quel qu'en soit l'auteur. Cet article n'a pas pour but de s'approprier ou de contester vos droits sur un travail enti\\'8frement r\\'8ealis\\'8e par Vous, mais plut\\'99t d'ouvrir droit \\'88 un contr\\'99le de la libre distribution de tout travail d\\'8eriv\\'8e ou collectif bas\\'8e sur le Programme. En outre, toute fusion d'un autre travail, non bas\\'8e sur le Programme, avec le Programme (ou avec un travail d\\'8eriv\\'8e de ce dernier), effectu\\'8ee sur un support de stockage ou de distribution, ne fait pas tomber cet autre travail sous le contr\\'99le de la Licence.\\\n\\\n\n\\f0\\b * Article 3.\n\\f1\\b0  Vous pouvez copier et distribuer le Programme (ou tout travail d\\'8eriv\\'8e selon les conditions \\'8enonc\\'8ees dans l'article 1) sous forme de code objet ou ex\\'8ecutable, selon les termes des articles 0 et 1, \\'88 condition de respecter une des clauses suivantes:\\\n          o a) Fournir le code source complet du Programme, sous une forme lisible par un ordinateur et selon les termes des articles 0 et 1, sur un support habituellement utilis\\'8e pour l'\\'8echange de donn\\'8ees; ou,\\\n          o b) Faire une offre \\'8ecrite, valable pendant au moins trois ans, pr\\'8evoyant de donner \\'88 tout tiers qui en fera la demande une copie, sous forme lisible par un ordinateur, du code source correspondant, pour un tarif n'exc\\'8edant pas le co\\'9et de la copie, selon les termes des articles 0 et 1, sur un support couramment utilis\\'8e pour l'\\'8echange de donn\\'8ees informatiques; ou,\\\n          o c) Informer le destinataire de l'endroit o\\'9d le code source peut \\'90tre obtenu (cette solution n'est recevable que dans le cas d'une distribution non commerciale, et uniquement si Vous avez re\\'8du le Programme sous forme de code objet ou ex\\'8ecutable avec l'offre pr\\'8evue \\'88 l'alin\\'8ea b ci-dessus).\\\n      Le code source d'un travail d\\'8esigne la forme de cet ouvrage sous laquelle les modifications sont les plus ais\\'8ees. Sont ainsi d\\'8esign\\'8es la totalit\\'8e du code source de tous les modules composant un Programme ex\\'8ecutable, de m\\'90me que tout fichier de d\\'8efinition associ\\'8e, ainsi que les scripts utilis\\'8es pour effectuer la compilation et l'installation du Programme ex\\'8ecutable. Toutefois, l'environnement standard de d\\'8eveloppement du syst\\'8fme d'exploitation mis en oeuvre (source ou binaire) -- compilateurs, biblioth\\'8fques, noyau, etc. -- constitue une exception, sauf si ces \\'8el\\'8ements sont diffus\\'8es en m\\'90me temps que le Programme ex\\'8ecutable. Si la distribution de l'ex\\'8ecutable ou du code objet consiste \\'88 offrir un acc\\'8fs permettant de copier le Programme depuis un endroit particulier, l'offre d'un acc\\'8fs \\'8equivalent pour se procurer le code source au m\\'90me endroit est consid\\'8er\\'8e comme une distribution de ce code source, m\\'90me si l'utilisateur choisit de ne pas profiter de cette offre.\\\n\\\n\n\\f0\\b * Article 4.\n\\f1\\b0  Vous ne pouvez pas copier, modifier, c\\'8eder, d\\'8eposer ou distribuer le Programme d'une autre mani\\'8fre que l'autorise la Licence Publique G\\'8en\\'8erale. Toute tentative de ce type annule imm\\'8ediatement vos droits d'utilisation du Programme sous cette Licence. Toutefois, les tiers ayant re\\'8du de Vous des copies du Programme ou le droit d'utiliser ces copies continueront \\'88 b\\'8en\\'8eficier de leur droit d'utilisation tant qu'ils respecteront pleinement les conditions de la Licence.\\\n\\\n\n\\f0\\b * Article 5.\n\\f1\\b0  Ne l'ayant pas sign\\'8ee, Vous n'\\'90tes pas oblig\\'8e d'accepter cette Licence. Cependant, rien d'autre ne Vous autorise \\'88 modifier ou distribuer le Programme ou quelque travaux d\\'8eriv\\'8es: la loi l'interdit tant que Vous n'acceptez pas les termes de cette Licence. En cons\\'8equence, en modifiant ou en distribuant le Programme (ou tout travail bas\\'8e sur lui), Vous acceptez implicitement tous les termes et conditions de cette Licence.\\\n\\\n\n\\f0\\b  * Article 6.\n\\f1\\b0  La diffusion d'un Programme (ou de tout travail d\\'8eriv\\'8e) suppose l'envoi simultan\\'8e d'une licence autorisant la copie, la distribution ou la modification du Programme, aux termes et conditions de la Licence. Vous n'avez pas le droit d'imposer de restrictions suppl\\'8ementaires aux droits transmis au destinataire. Vous n'\\'90tes pas responsable du respect de la Licence par un tiers.\\\n\\\n\n\\f0\\b * Article 7.\n\\f1\\b0  Si, \\'88 la suite d'une d\\'8ecision de Justice, d'une plainte en contrefa\\'8don ou pour toute autre raison (li\\'8ee ou non \\'88 la contrefa\\'8don), des conditions Vous sont impos\\'8ees (que ce soit par ordonnance, accord amiable ou autre) qui se r\\'8ev\\'8flent incompatibles avec les termes de la pr\\'8esente Licence, Vous n'\\'90tes pas pour autant d\\'8egag\\'8e des obligations li\\'8ees \\'88 celle-ci: si Vous ne pouvez concilier vos obligations l\\'8egales ou autres avec les conditions de cette Licence, Vous ne devez pas distribuer le Programme. Si une partie quelconque de cet article est invalid\\'8ee ou inapplicable pour quelque raison que ce soit, le reste de l'article continue de s'appliquer et l'int\\'8egralit\\'8e de l'article s'appliquera en toute autre circonstance. Le pr\\'8esent article n'a pas pour but de Vous pousser \\'88 enfreindre des droits ou des dispositions l\\'8egales ni en contester la validit\\'8e; son seul objectif est de prot\\'8eger l'int\\'8egrit\\'8e du syst\\'8fme de distribution du Logiciel Libre. De nombreuses personnes ont g\\'8en\\'8ereusement contribu\\'8e \\'88 la large gamme de Programmes distribu\\'8ee de cette fa\\'8don en toute confiance; il appartient \\'88 chaque auteur/donateur de d\\'8ecider de diffuser ses Programmes selon les crit\\'8fres de son choix.\\\n\\\n\n\\f0\\b * Article 8.\n\\f1\\b0  Si la distribution et/ou l'utilisation du Programme est limit\\'8ee dans certains pays par des brevets ou des droits sur des interfaces, le d\\'8etenteur original des droits qui place le Programme sous la Licence Publique G\\'8en\\'8erale peut ajouter explicitement une clause de limitation g\\'8eographique excluant ces pays. Dans ce cas, cette clause devient une partie int\\'8egrante de la Licence.\\\n\\\n\n\\f0\\b * Article 9.\n\\f1\\b0  La Free Software Foundation se r\\'8eserve le droit de publier p\\'8eriodiquement des mises \\'88 jour ou de nouvelles versions de la Licence. R\\'8edig\\'8ees dans le m\\'90me esprit que la pr\\'8esente version, elles seront cependant susceptibles d'en modifier certains d\\'8etails \\'88 mesure que de nouveaux probl\\'8fmes se font jour. Chaque version poss\\'8fde un num\\'8ero distinct. Si le Programme pr\\'8ecise un num\\'8ero de version de cette Licence et \\'c7toute version ult\\'8erieure\\'c8, Vous avez le choix de suivre les termes et conditions de cette version ou de toute autre version plus r\\'8ecente publi\\'8ee par la Free Software Foundation. Si le Programme ne sp\\'8ecifie aucun num\\'8ero de version, Vous pouvez alors choisir l'une quelconque des versions publi\\'8ees par la Free Software Foundation.\\\n\\\n\n\\f0\\b  * Article 10.\n\\f1\\b0 Si Vous d\\'8esirez incorporer des \\'8el\\'8ements du Programme dans d'autres Programmes libres dont les conditions de distribution diff\\'8frent, Vous devez \\'8ecrire \\'88 l'auteur pour lui en demander la permission. Pour ce qui est des Programmes directement d\\'8epos\\'8es par la Free Software Foundation, \\'8ecrivez-nous: une exception est toujours envisageable. Notre d\\'8ecision sera bas\\'8ee sur notre volont\\'8e de pr\\'8eserver la libert\\'8e de notre Programme ou de ses d\\'8eriv\\'8es et celle de promouvoir le partage et la r\\'8eutilisation du logiciel en g\\'8en\\'8eral. \\\n\\\n\n\\f0\\b LIMITATION DE GARANTIE\n\\f1\\b0 \\\n\n\\f0\\b  * Article 11.\n\\f1\\b0  Parce que l'utilisation de ce Programme est libre et gratuite, aucune garantie n'est fournie, comme le permet la loi. Sauf mention \\'8ecrite, les d\\'8etenteurs du copyright et/ou les tiers fournissent le Programme en l'\\'8etat, sans aucune sorte de garantie explicite ou implicite, y compris les garanties de commercialisation ou d'adaptation dans un but particulier. Vous assumez tous les risques quant \\'88 la qualit\\'8e et aux effets du Programme. Si le Programme est d\\'8efectueux, Vous assumez le co\\'9et de tous les services, corrections ou r\\'8eparations n\\'8ecessaires.\\\n\n\\f0\\b * Article 12.\n\\f1\\b0  Sauf lorsqu'explicitement pr\\'8evu par la Loi ou accept\\'8e par \\'8ecrit, ni le d\\'8etenteur des droits, ni quiconque autoris\\'8e \\'88 modifier et/ou redistribuer le Programme comme il est permis ci-dessus ne pourra \\'90tre tenu pour responsable de tout dommage direct, indirect, secondaire ou accessoire (pertes financi\\'8fres dues au manque \\'88 gagner, \\'88 l'interruption d'activit\\'8es ou \\'88 la perte de donn\\'8ees, etc., d\\'8ecoulant de l'utilisation du Programme ou de l'impossibilit\\'8e d'utiliser celui-ci).\\\n\\\n\n\\f0\\b\\fs28 FIN DES TERMES ET CONDITIONS\\\n\\\n\n\\f1\\b0\\fs24 \\\n\n\\f0\\b\\fs32 \\ul 4. Comment appliquer ces directives \\'88 vos nouveaux programmes\n\\f1\\b0\\fs24 \\ulnone \\\n\\\nSi vous d\\'8eveloppez un nouveau programme et d\\'8esirez en faire b\\'8en\\'8eficier tout un chacun, la meilleure m\\'8ethode est d'en faire un Logiciel Libre que tout le monde pourra redistribuer et modifier selon les termes de la Licence Publique G\\'8en\\'8erale.\\\n\\\nPour cela, ins\\'8erez les indications suivantes dans votre programme (il est pr\\'8ef\\'8erable et plus s\\'9er de les faire figurer au d\\'8ebut de chaque fichier source; dans tous les cas, chaque module source devra comporter au minimum la ligne de \\'c7copyright\\'c8 et indiquer o\\'9d r\\'8esident toutes les autres indications):\\\n\\\n((une ligne pour donner le nom du programme et donner une id\\'8ee de sa finalit\\'8e))\\\n\\\nCopyright (C) 19xx ((nom de l'auteur))\\\n\\\nCe programme est libre, vous pouvez le redistribuer et/ou le modifier selon les termes de la Licence Publique G\\'8en\\'8erale GNU publi\\'8ee par la Free Software Foundation (version 2 ou bien toute autre version ult\\'8erieure choisie par vous).\\\n\\\nCe programme est distribu\\'8e car potentiellement utile, mais SANS AUCUNE GARANTIE, ni explicite ni implicite, y compris les garanties de commercialisation ou d'adaptation dans un but sp\\'8ecifique. Reportez-vous \\'88 la Licence Publique G\\'8en\\'8erale GNU pour plus de d\\'8etails.\\\n\\\nVous devez avoir re\\'8du une copie de la Licence Publique G\\'8en\\'8erale GNU en m\\'90me temps que ce programme; si ce n'est pas le cas, \\'8ecrivez \\'88 la Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, \\'83tats-Unis.\\\n\\\nAjoutez \\'8egalement votre adresse \\'8electronique, le cas \\'8ech\\'8eant, ainsi que votre adresse postale.\\\n\\\nSi le programme est interactif, faites-lui afficher un court avertissement du type de celui-ci \\'88 chaque invocation:\\\n\\\n...(nom du programme) version 69, Copyright (C) 19aa nom de l'auteur\\\n\\\n...(nom du programme) est fourni sans AUCUNE GARANTIE. Pour plus de d\\'8etails, tapez `g'.\\\n\\\nCe programme est libre et vous \\'90tes encourag\\'8e \\'88 le redistribuer sous certaines conditions; tapez `c' pour plus de d\\'8etails.\\\n\\\nLes commandes hypoth\\'8etiques `g' et `c' doivent afficher les sections appropri\\'8ees de la Licence Publique G\\'8en\\'8erale GNU. Bien entendu, vous pouvez implanter ces commandes comme bon vous semble: options dans un menu, ou bien accessibles d'un clic de souris, etc., tout d\\'8epend de votre programme.\\\n\\\nSi vous officiez en tant que programmeur, n'omettez pas de demander \\'88 votre employeur, votre \\'8etablissement scolaire ou autres de signer une d\\'8echarge stipulant leur renoncement aux droits qu'ils pourraient avoir sur le programme:\\\n\\\n...((employeur, \\'8ecole...)) d\\'8eclare par la pr\\'8esente ne pas revendiquer de droits sur le programme \\'c7(nom du programme)\\'c8 r\\'8ealis\\'8e par ...((nom de l'auteur)).\\\n\\\n((signature du responsable)), ...((date)), ...((nom et qualit\\'8e du responsable)).\\\n\\\nLa Licence Publique G\\'8en\\'8erale ne permet pas d'inclure votre programme dans des logiciels sous licence commerciale sp\\'8ecifique. Si votre programme est une fonction de biblioth\\'8fque, vous jugerez probablement plus judicieux de le faire relever de la Licence G\\'8en\\'8erale de Biblioth\\'8fque GNU (LGPL) plut\\'99t que de la pr\\'8esente.\\\n}\n"
  },
  {
    "path": "fr.lproj/Localizable.strings",
    "content": "﻿{\n\"Host Name\" = \"Nom du poste\";\n\"Host Names\" = \"Noms du poste\";\n\"IP Address\" = \"Address IP\";\n\"IP Addresses\" = \"Addresses IP\";\n\"Screen Resolution changed - Server Reinitialized\" = \"Résolution d'affichage modifiée - Serveur réinitialisé\";\n\"Server Running\" = \"Le serveur est activé\";\n\"The server is not running.\" = \"Le serveur est arrêté.\";\n\"Start Server\" = \"Démarrer\";\n\"Restart Server\" = \"Redémarrer\";\n\"The server is stopped.\" = \"Le serveur est arrêté.\";\n\"Probably because the OSXvnc server is already running as a Startup Item.\" = \"Probablement car Vine serveur est déjà lançé comme service de démarrage\";\n\"Probably because another VNC is already using this port.\" = \"Probablement car une autre instance de VNC utilise déjà ce port.\";\n\"The server has stopped running. See Log (%d)\\n\" = \"Le serveur s'est arrêté. Consultez le fichier Log (%d)\\n\";\n\"The server has stopped running.\" = \"Le serveur est arrêté.\";\n\"Need a valid Port or Display Number\" = \"Numéro de port / d'affichage non valide\";\n\"Problem - Unable to store password to %@\" = \"Problème - Impossible d'enregistrer le mot de passe dans %@\";\n\"Option Change Requires a Restart\" = \"Redémarrer le serveur pour enregistrer les changements\";\n\"Error: No Authorization\" = \"Erreur: Pas d'autorisation\";\n\"Error: Unable To Setup Password File\" = \"Erreur: Impossible d'initialiser le fichier de mot de passe\";\n\"Error: Unable To Write out Temporary Script File\" = \"Erreur: Impossible d'écrire le fichier script temporaire\";\n\"Startup Item Configured (Started)\" = \"Service de démarrage configuré (Démarrer)\";\n\"Startup Item Disabled (Stopped)\" = \"Service de démarrage désactivé (Arrêté)\";\n\"Error: Unabled to remove startup item\" = \"Erreur: Impossible de supprimer le service de démarrage\";\n\"Please specify a Connect Host to establish a connection\" = \"Veuillez spécifier un hôte cible vers lequel établir une connexion\";\n\"Connection invitation sent to Connect Host\" = \"Invitation de connexion envoyée à l'hôte cible\";\n}\n\n"
  },
  {
    "path": "it.lproj/Localizable.strings",
    "content": "{\n\"Host Name\" = \"Nome dell'Host\";\n\"Host Names\" = \"Nomi degli Host\";\n\"IP Address\" = \"Indirizzo IP\";\n\"IP Addresses\" = \"Indirizzi IP\";\n\"Screen Resolution changed - Server Reinitialized\" = \"Risoluzione schermo cambiata - Server Reinizializzato\";\n\"Server Running\" = \"Il server è in esecuzione\";\n\"The server is not running.\" = \"Il server non è in esecuzione.\";\n\"Start Server\" = \"Avvia Server\";\n\"Restart Server\" = \"Riavvia il Server\";\n\"The server is stopped.\" = \"Il server è fermo.\";\n\"Probably because the OSXvnc server is already running as a Startup Item.\" = \"Probabilmente perché il server Vine è già avviato all'avvio del Mac\";\n\"Probably because another VNC is already using this port.\" = \"Probabilmente perché un altro VNC sta usando questa porta.\";\n\"The server has stopped running. See Log (%d)\\n\" = \"Il server si è fermato. Consulta il resoconto (%d)\\n\";\n\"The server has stopped running.\" = \"Il server si è fermato.\";\n\"Need a valid Port or Display Number\" = \"Numero di porta / Numero Visore non corretto\";\n\"Problem - Unable to store password to %@\" = \"Problema - Impossibile registrare la parola chiave in %@\";\n\"Option Change Requires a Restart\" = \"Riavvia il server per rendere effettivi i cambiamenti\";\n\"Error: No Authorization\" = \"Errore: Nessuna Autorizzazione\";\n\"Error: Unable To Setup Password File\" = \"Errore: Impossibile impostare la parola chiave\";\n\"Error: Unable To Write out Temporary Script File\" = \"Errore: Impossibile scrivere lo script temporaneo\";\n\"Startup Item Configured (Started)\" = \"Elemento di avvio configurato (Avviato)\";\n\"Startup Item Disabled (Stopped)\" = \"Elemento di avvio disattivato (Fermato)\";\n\"Error: Unabled to remove startup item\" = \"Errore: Impossibile rimuovere l'elemento di avvio\";\n\"Please specify a Connect Host to establish a connection\" = \"Per favore specifica un'host di connessione per stabilire un collegamento\";\n\"Connection invitation sent to Connect Host\" = \"Invito alla connessione inviato all'host\";\n}\n\n"
  },
  {
    "path": "ja.lproj/Copying.rtf",
    "content": "{\\rtf1\\mac\\ansicpg10000\\cocoartf102\n\\readonlydoc1{\\fonttbl\\f0\\fswiss\\fcharset77 Helvetica;\\f1\\fnil\\fcharset78 HiraKakuPro-W3;}\n{\\colortbl;\\red255\\green255\\blue255;}\n\\paperw11900\\paperh16840\\margl1440\\margr1440\\vieww9000\\viewh9000\\viewkind0\n\\pard\\tx565\\tx1133\\tx1700\\tx2266\\tx2833\\tx3401\\tx3967\\tx4535\\tx5102\\tx5669\\tx6235\\tx6802\\ql\\qnatural\n\n\\f0\\fs24 \\cf0                     GNU\n\\f1 \\'88\\'ea\\'94\\'ca\\'8c\\'f6\\'8f\\'4f\\'97\\'98\\'97\\'70\\'8b\\'96\\'91\\'f8\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\\n\n\\f0\n\\f1 \\'83\\'6f\\'81\\'5b\\'83\\'57\\'83\\'87\\'83\\'93\n\\f0 2\n\\f1 \\'81\\'41\n\\f0 1991\n\\f1 \\'94\\'4e\n\\f0 6\n\\f1 \\'8c\\'8e\\\n\n\\f0\n\\f1 \\'93\\'fa\\'96\\'7b\\'8c\\'ea\\'96\\'f3\\'81\\'41\n\\f0 2002\n\\f1 \\'94\\'4e\n\\f0 5\n\\f1 \\'8c\\'8e\n\\f0 20\n\\f1 \\'93\\'fa\\\n\\\n\n\\f0  Copyright (C) 1989, 1991 Free Software Foundation, Inc.\\\n                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\\\n\n\\f1 \\'82\\'b1\\'82\\'cc\\'97\\'98\\'97\\'70\\'8b\\'96\\'91\\'f8\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'f0\\'81\\'41\\'88\\'ea\\'8e\\'9a\\'88\\'ea\\'8b\\'e5\\'82\\'bb\\'82\\'cc\\'82\\'dc\\'82\\'dc\\'82\\'c9\\'95\\'a1\\'90\\'bb\\'82\\'b5\\'94\\'d0\\'95\\'7a\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'cd\\'8b\\'96\\'89\\'c2\\'82\\'b7\\'82\\'e9\\'81\\'42\\\n\n\\f0\n\\f1 \\'82\\'b5\\'82\\'a9\\'82\\'b5\\'95\\'cf\\'8d\\'58\\'82\\'cd\\'94\\'46\\'82\\'df\\'82\\'c8\\'82\\'a2\\'81\\'42\\\n\\\n\n\\f0  This is an unofficial translation of the GNU General Public License\\\n into Japanese.  It was not published by the Free Software Foundation,\\\n and does not legally state the distribution terms for software that\\\n uses the GNU GPL--only the original English text of the GNU GPL does\\\n that. However, we hope that this translation will help Japanese\\\n speakers understand the GNU GPL better.\\\n\\\n (\n\\f1 \\'96\\'f3\n\\f0 :\n\\f1 \\'88\\'c8\\'89\\'ba\\'82\\'cd\n\\f0 GNU General Public License\n\\f1 \\'82\\'cc\\'94\\'f1\\'8c\\'f6\\'8e\\'ae\\'82\\'c8\\'93\\'fa\\'96\\'7b\\'8c\\'ea\\'96\\'f3\\'82\\'c5\\'82\\'b7\\'81\\'42\\'82\\'b1\\'82\\'ea\\'82\\'cd\\'83\\'74\\\n\n\\f0\n\\f1 \\'83\\'8a\\'81\\'5b\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'8d\\'e0\\'92\\'63\n\\f0 (the Free Software Foundataion)\n\\f1 \\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'94\\'ad\\'95\\'5c\\'82\\'b3\\'82\\'ea\\'82\\'bd\\\n\n\\f0\n\\f1 \\'82\\'e0\\'82\\'cc\\'82\\'c5\\'82\\'cd\\'82\\'c8\\'82\\'ad\\'81\\'41\n\\f0 GNU GPL\n\\f1 \\'82\\'f0\\'93\\'4b\\'97\\'70\\'82\\'b5\\'82\\'bd\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'cc\\'94\\'d0\\'95\\'7a\\'8f\\'f0\\'8c\\'8f\\'82\\'f0\\'96\\'40\\'93\\'49\\'82\\'c9\\'97\\'4c\\'8c\\'f8\\'82\\'c8\\'8c\\'60\\\n\n\\f0\n\\f1 \\'82\\'c5\\'8f\\'71\\'82\\'d7\\'82\\'bd\\'82\\'e0\\'82\\'cc\\'82\\'c5\\'82\\'cd\\'82\\'a0\\'82\\'e8\\'82\\'dc\\'82\\'b9\\'82\\'f1\\'81\\'42\\'94\\'d0\\'95\\'7a\\'8f\\'f0\\'8c\\'8f\\'82\\'c6\\'82\\'b5\\'82\\'c4\\'82\\'cd\n\\f0 GNU GPL\n\\f1 \\'82\\'cc\\'89\\'70\\'8c\\'ea\\'94\\'c5\\'83\\'65\\'83\\'4c\\'83\\'58\\'83\\'67\\'82\\'c5\\\n\n\\f0\n\\f1 \\'8e\\'77\\'92\\'e8\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'e9\\'82\\'e0\\'82\\'cc\\'82\\'cc\\'82\\'dd\\'82\\'aa\\'97\\'4c\\'8c\\'f8\\'82\\'c5\\'82\\'b7\\'81\\'42\\'82\\'b5\\'82\\'a9\\'82\\'b5\\'82\\'c8\\'82\\'aa\\'82\\'e7\\'81\\'41\\'8e\\'84\\'82\\'bd\\'82\\'bf\\'82\\'cd\\'82\\'b1\\'82\\'cc\\'96\\'7c\\'96\\'f3\\'82\\'aa\\'81\\'41\\\n\n\\f0\n\\f1 \\'93\\'fa\\'96\\'7b\\'8c\\'ea\\'82\\'f0\\'8e\\'67\\'97\\'70\\'82\\'b7\\'82\\'e9\\'90\\'6c\\'81\\'58\\'82\\'c9\\'82\\'c6\\'82\\'c1\\'82\\'c4\n\\f0 GNU GPL\n\\f1 \\'82\\'f0\\'82\\'e6\\'82\\'e8\\'97\\'c7\\'82\\'ad\\'97\\'9d\\'89\\'f0\\'82\\'b7\\'82\\'e9\\'8f\\'95\\'82\\'af\\'82\\'c6\\'82\\'c8\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'f0\\\n\n\\f0\n\\f1 \\'96\\'5d\\'82\\'f1\\'82\\'c5\\'82\\'a2\\'82\\'dc\\'82\\'b7\\'81\\'42\n\\f0 )\\\n\\\n\n\\f1 \\'96\\'7c\\'96\\'f3\\'82\\'cd\n\\f0\n\\f1 \\'94\\'aa\\'93\\'63\\'90\\'5e\\'8d\\'73\n\\f0 <mhatta@gnu.org>\n\\f1 \\'82\\'aa\\'8d\\'73\\'82\\'c1\\'82\\'bd\\'81\\'42\\'8c\\'b4\\'95\\'b6\\'82\\'cd\\\n\n\\f0  http://www.gnu.org/licenses/gpl.txt\n\\f1 \\'82\\'c5\\'82\\'a0\\'82\\'e9\\'81\\'42\\'8c\\'eb\\'96\\'f3\\'82\\'cc\\'8e\\'77\\'93\\'45\\'82\\'e2\\'89\\'fc\\'91\\'50\\'88\\'c4\\'82\\'f0\\'8a\\'bd\\'8c\\'7d\\'82\\'b7\\\n\n\\f0\n\\f1 \\'82\\'e9\\'81\\'42\\\n\n\\f0\n\\f1 \\'82\\'cd\\'82\\'b6\\'82\\'df\\'82\\'c9\\\n\\\n\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'8c\\'fc\\'82\\'af\\'83\\'89\\'83\\'43\\'83\\'5a\\'83\\'93\\'83\\'58\\'82\\'cc\\'91\\'e5\\'94\\'bc\\'82\\'cd\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'aa\\'82\\'bb\\'82\\'cc\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'f0\\'8b\\'a4\\'97\\'4c\\'82\\'b5\\'82\\'bd\\\n\\'82\\'e8\\'95\\'cf\\'8d\\'58\\'82\\'b5\\'82\\'bd\\'82\\'e8\\'82\\'b7\\'82\\'e9\\'8e\\'a9\\'97\\'52\\'82\\'f0\\'92\\'44\\'82\\'a4\\'82\\'e6\\'82\\'a4\\'82\\'c9\\'90\\'dd\\'8c\\'76\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'dc\\'82\\'b7\\'81\\'42\\'91\\'ce\\'8f\\'c6\\'93\\'49\\'82\\'c9\\'81\\'41\n\\f0 GNU\n\\f1 \\'88\\'ea\\'94\\'ca\\'8c\\'f6\\\n\\'8f\\'4f\\'97\\'98\\'97\\'70\\'8b\\'96\\'91\\'f8\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'cd\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'aa\\'83\\'74\\'83\\'8a\\'81\\'5b\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'f0\\'8b\\'a4\\'97\\'4c\\'82\\'b5\\'82\\'bd\\'82\\'e8\\'95\\'cf\\'8d\\'58\\'82\\'b5\\'82\\'bd\\'82\\'e8\\'82\\'b7\\\n\\'82\\'e9\\'8e\\'a9\\'97\\'52\\'82\\'f0\\'95\\'db\\'8f\\'d8\\'82\\'b7\\'82\\'e9\n\\f0 --\n\\f1 \\'82\\'b7\\'82\\'c8\\'82\\'ed\\'82\\'bf\\'81\\'41\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'aa\\'82\\'bb\\'82\\'cc\\'83\\'86\\'81\\'5b\\'83\\'55\\'82\\'b7\\'82\\'d7\\'82\\'c4\\'82\\'c9\\'82\\'c6\\'82\\'c1\\'82\\'c4\\'83\\'74\\'83\\'8a\\'81\\'5b\\\n\\'82\\'c5\\'82\\'a0\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'f0\\'95\\'db\\'8f\\'d8\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'f0\\'96\\'da\\'93\\'49\\'82\\'c6\\'82\\'b5\\'82\\'c4\\'82\\'a2\\'82\\'dc\\'82\\'b7\\'81\\'42\\'82\\'b1\\'82\\'cc\\'88\\'ea\\'94\\'ca\\'8c\\'f6\\'8f\\'4f\\'97\\'98\\'97\\'70\\'8b\\'96\\'91\\'f8\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\\n\\'82\\'cd\\'83\\'74\\'83\\'8a\\'81\\'5b\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'8d\\'e0\\'92\\'63\\'82\\'cc\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'cc\\'82\\'d9\\'82\\'c6\\'82\\'f1\\'82\\'c7\\'82\\'c9\\'93\\'4b\\'97\\'70\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a8\\'82\\'e8\\'81\\'41\\'82\\'dc\\'82\\'bd\\\n\n\\f0 GNU GPL\n\\f1 \\'82\\'f0\\'93\\'4b\\'97\\'70\\'82\\'b7\\'82\\'e9\\'82\\'c6\\'8c\\'88\\'82\\'df\\'82\\'bd\\'83\\'74\\'83\\'8a\\'81\\'5b\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'8d\\'e0\\'92\\'63\\'88\\'c8\\'8a\\'4f\\'82\\'cc\\'8d\\'ec\\'8e\\'d2\\'82\\'c9\\'82\\'e6\\'82\\'e9\\'83\\'76\\'83\\'8d\\'83\\'4f\\\n\\'83\\'89\\'83\\'80\\'82\\'c9\\'82\\'e0\\'93\\'4b\\'97\\'70\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'dc\\'82\\'b7\n\\f0 (\n\\f1 \\'82\\'a2\\'82\\'ad\\'82\\'c2\\'82\\'a9\\'82\\'cc\\'83\\'74\\'83\\'8a\\'81\\'5b\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'8d\\'e0\\'92\\'63\\'82\\'cc\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\\n\\'83\\'41\\'82\\'c9\\'82\\'cd\\'81\\'41\n\\f0 GNU GPL\n\\f1 \\'82\\'c5\\'82\\'cd\\'82\\'c8\\'82\\'ad\n\\f0 GNU\n\\f1 \\'83\\'89\\'83\\'43\\'83\\'75\\'83\\'89\\'83\\'8a\\'88\\'ea\\'94\\'ca\\'8c\\'f6\\'8f\\'4f\\'97\\'98\\'97\\'70\\'8b\\'96\\'91\\'f8\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'aa\\'93\\'4b\\'97\\'70\\'82\\'b3\\'82\\'ea\\\n\\'82\\'c4\\'82\\'a2\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'e0\\'82\\'a0\\'82\\'e8\\'82\\'dc\\'82\\'b7\n\\f0 )\n\\f1 \\'81\\'42\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'e0\\'82\\'dc\\'82\\'bd\\'81\\'41\\'82\\'b2\\'8e\\'a9\\'95\\'aa\\'82\\'cc\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'c9\n\\f0 GNU GPL\n\\f1 \\'82\\'f0\\'93\\'4b\\'97\\'70\\\n\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'aa\\'89\\'c2\\'94\\'5c\\'82\\'c5\\'82\\'b7\\'81\\'42\\\n\\\n\\'8e\\'84\\'82\\'bd\\'82\\'bf\\'82\\'aa\\'83\\'74\\'83\\'8a\\'81\\'5b\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'c6\\'8c\\'be\\'82\\'a4\\'82\\'c6\\'82\\'ab\\'81\\'41\\'82\\'bb\\'82\\'ea\\'82\\'cd\\'97\\'98\\'97\\'70\\'82\\'cc\\'8e\\'a9\\'97\\'52\\'82\\'c9\\'82\\'c2\\'82\\'a2\\'82\\'c4\\'8c\\'be\\'8b\\'79\\'82\\'b5\\'82\\'c4\\\n\\'82\\'a2\\'82\\'e9\\'82\\'cc\\'82\\'c5\\'82\\'a0\\'82\\'c1\\'82\\'c4\\'81\\'41\\'89\\'bf\\'8a\\'69\\'82\\'cd\\'96\\'e2\\'91\\'e8\\'82\\'c9\\'82\\'b5\\'82\\'c4\\'82\\'a2\\'82\\'dc\\'82\\'b9\\'82\\'f1\\'81\\'42\\'8e\\'84\\'82\\'bd\\'82\\'bf\\'82\\'cc\\'88\\'ea\\'94\\'ca\\'8c\\'f6\\'8f\\'4f\\'97\\'98\\'97\\'70\\'8b\\'96\\'91\\'f8\\'8c\\'5f\\'96\\'f1\\\n\\'8f\\'91\\'82\\'cd\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'aa\\'83\\'74\\'83\\'8a\\'81\\'5b\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'cc\\'95\\'a1\\'90\\'bb\\'95\\'a8\\'82\\'f0\\'94\\'d0\\'95\\'7a\\'82\\'b7\\'82\\'e9\\'8e\\'a9\\'97\\'52\\'82\\'f0\\'95\\'db\\'8f\\'d8\\'82\\'b7\\'82\\'e9\\'82\\'e6\\'82\\'a4\\'90\\'dd\\\n\\'8c\\'76\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'dc\\'82\\'b7\n\\f0 (\n\\f1 \\'8a\\'f3\\'96\\'5d\\'82\\'c9\\'89\\'9e\\'82\\'b6\\'82\\'c4\\'82\\'bb\\'82\\'cc\\'8e\\'ed\\'82\\'cc\\'83\\'54\\'81\\'5b\\'83\\'72\\'83\\'58\\'82\\'c9\\'8e\\'e8\\'90\\'94\\'97\\'bf\\'82\\'f0\\'89\\'db\\'82\\'b7\\'8e\\'a9\\'97\\'52\\'82\\'e0\\'95\\'db\\'8f\\'d8\\'82\\'b3\\\n\\'82\\'ea\\'82\\'dc\\'82\\'b7\n\\f0 )\n\\f1 \\'81\\'42\\'82\\'dc\\'82\\'bd\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'aa\\'83\\'5c\\'81\\'5b\\'83\\'58\\'83\\'52\\'81\\'5b\\'83\\'68\\'82\\'f0\\'8e\\'f3\\'82\\'af\\'8e\\'e6\\'82\\'e9\\'82\\'a9\\'81\\'41\\'82\\'a0\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'96\\'5d\\'82\\'df\\'82\\'ce\\'82\\'bb\\'82\\'ea\\'82\\'f0\\\n\\'93\\'fc\\'8e\\'e8\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'aa\\'89\\'c2\\'94\\'5c\\'82\\'c5\\'82\\'a0\\'82\\'e9\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'82\\'b1\\'82\\'c6\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'aa\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'f0\\'95\\'cf\\'8d\\'58\\'82\\'b5\\'81\\'41\\'82\\'bb\\'82\\'cc\\\n\\'88\\'ea\\'95\\'94\\'82\\'f0\\'90\\'56\\'82\\'bd\\'82\\'c8\\'83\\'74\\'83\\'8a\\'81\\'5b\\'82\\'cc\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'c5\\'97\\'98\\'97\\'70\\'82\\'c5\\'82\\'ab\\'82\\'e9\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'82\\'b1\\'82\\'c6\\'81\\'41\\'82\\'bb\\'82\\'b5\\'82\\'c4\\'81\\'41\\'88\\'c8\\'8f\\'e3\\'82\\'c5\\'8f\\'71\\\n\\'82\\'d7\\'82\\'bd\\'82\\'e6\\'82\\'a4\\'82\\'c8\\'82\\'b1\\'82\\'c6\\'82\\'aa\\'82\\'c5\\'82\\'ab\\'82\\'e9\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'82\\'b1\\'82\\'c6\\'82\\'aa\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'c9\\'92\\'6d\\'82\\'e7\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'82\\'b1\\'82\\'c6\\'82\\'e0\\'95\\'db\\'8f\\'d8\\'82\\'b3\\\n\\'82\\'ea\\'82\\'dc\\'82\\'b7\\'81\\'42\\\n\\\n\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cc\\'8c\\'a0\\'97\\'98\\'82\\'f0\\'8e\\'e7\\'82\\'e9\\'82\\'bd\\'82\\'df\\'81\\'41\\'8e\\'84\\'82\\'bd\\'82\\'bf\\'82\\'cd\\'92\\'4e\\'82\\'a9\\'82\\'aa\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cc\\'97\\'4c\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'ea\\'82\\'e7\\'82\\'cc\\'8c\\'a0\\'97\\'98\\'82\\'f0\\'94\\'db\\'92\\'e8\\\n\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'e2\\'81\\'41\\'82\\'b1\\'82\\'ea\\'82\\'e7\\'82\\'cc\\'8c\\'a0\\'97\\'98\\'82\\'f0\\'95\\'fa\\'8a\\'fc\\'82\\'b7\\'82\\'e9\\'82\\'e6\\'82\\'a4\\'97\\'76\\'8b\\'81\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'f0\\'8b\\'d6\\'8e\\'7e\\'82\\'b7\\'82\\'e9\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'90\\'a7\\'8c\\'c0\\\n\\'82\\'f0\\'89\\'c1\\'82\\'a6\\'82\\'e9\\'95\\'4b\\'97\\'76\\'82\\'aa\\'82\\'a0\\'82\\'e8\\'82\\'dc\\'82\\'b7\\'81\\'42\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'aa\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'cc\\'95\\'a1\\'90\\'bb\\'95\\'a8\\'82\\'f0\\'94\\'d0\\'95\\'7a\\'82\\'b5\\'82\\'bd\\\n\\'82\\'e8\\'82\\'bb\\'82\\'ea\\'82\\'f0\\'95\\'cf\\'8d\\'58\\'82\\'b5\\'82\\'bd\\'82\\'e8\\'82\\'b7\\'82\\'e9\\'8f\\'ea\\'8d\\'87\\'82\\'c9\\'82\\'cd\\'81\\'41\\'82\\'b1\\'82\\'ea\\'82\\'e7\\'82\\'cc\\'90\\'a7\\'8c\\'c0\\'82\\'cc\\'82\\'bd\\'82\\'df\\'82\\'c9\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'c9\\'82\\'a0\\'82\\'e9\\'8e\\'ed\\'82\\'cc\\'90\\'d3\\\n\\'94\\'43\\'82\\'aa\\'94\\'ad\\'90\\'b6\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'c9\\'82\\'c8\\'82\\'e8\\'82\\'dc\\'82\\'b7\\'81\\'42\\\n\\\n\\'97\\'e1\\'82\\'a6\\'82\\'ce\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'aa\\'83\\'74\\'83\\'8a\\'81\\'5b\\'82\\'c8\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'cc\\'95\\'a1\\'90\\'bb\\'95\\'a8\\'82\\'f0\\'94\\'d0\\'95\\'7a\\'82\\'b7\\'82\\'e9\\'8f\\'ea\\'8d\\'87\\'81\\'41\\'97\\'4c\\'97\\'bf\\'82\\'a9\\'96\\'b3\\'97\\'bf\\'82\\'c9\\\n\\'8a\\'d6\\'82\\'ed\\'82\\'e7\\'82\\'b8\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cd\\'8e\\'a9\\'95\\'aa\\'82\\'aa\\'97\\'4c\\'82\\'b7\\'82\\'e9\\'8c\\'a0\\'97\\'98\\'82\\'f0\\'91\\'53\\'82\\'c4\\'8e\\'f3\\'97\\'cc\\'8e\\'d2\\'82\\'c9\\'97\\'5e\\'82\\'a6\\'82\\'c8\\'82\\'af\\'82\\'ea\\'82\\'ce\\'82\\'c8\\'82\\'e8\\'82\\'dc\\'82\\'b9\\'82\\'f1\\'81\\'42\\\n\\'82\\'dc\\'82\\'bd\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cd\\'94\\'de\\'82\\'e7\\'82\\'e0\\'83\\'5c\\'81\\'5b\\'83\\'58\\'83\\'52\\'81\\'5b\\'83\\'68\\'82\\'f0\\'8e\\'f3\\'82\\'af\\'8e\\'e6\\'82\\'e9\\'82\\'a9\\'8e\\'e8\\'82\\'c9\\'93\\'fc\\'82\\'ea\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'aa\\'82\\'c5\\'82\\'ab\\'82\\'e9\\'82\\'e6\\'82\\'a4\\\n\\'95\\'db\\'8f\\'d8\\'82\\'b5\\'82\\'c8\\'82\\'af\\'82\\'ea\\'82\\'ce\\'82\\'c8\\'82\\'e8\\'82\\'dc\\'82\\'b9\\'82\\'f1\\'81\\'42\\'82\\'bb\\'82\\'b5\\'82\\'c4\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cd\\'94\\'de\\'82\\'e7\\'82\\'c9\\'91\\'ce\\'82\\'b5\\'82\\'c4\\'88\\'c8\\'89\\'ba\\'82\\'c5\\'8f\\'71\\'82\\'d7\\'82\\'e9\\'8f\\'f0\\'8c\\'8f\\\n\\'82\\'f0\\'8e\\'a6\\'82\\'b5\\'81\\'41\\'94\\'de\\'82\\'e7\\'82\\'c9\\'8e\\'a9\\'82\\'e7\\'82\\'cc\\'8e\\'9d\\'82\\'c2\\'8c\\'a0\\'97\\'98\\'82\\'c9\\'82\\'c2\\'82\\'a2\\'82\\'c4\\'92\\'6d\\'82\\'e7\\'82\\'b5\\'82\\'df\\'82\\'e9\\'82\\'e6\\'82\\'a4\\'82\\'c9\\'82\\'b5\\'82\\'c8\\'82\\'af\\'82\\'ea\\'82\\'ce\\'82\\'c8\\'82\\'e8\\'82\\'dc\\'82\\'b9\\\n\\'82\\'f1\\'81\\'42\\\n\\\n\\'8e\\'84\\'82\\'bd\\'82\\'bf\\'82\\'cd\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cc\\'8c\\'a0\\'97\\'98\\'82\\'f0\\'93\\'f1\\'92\\'69\\'8a\\'4b\\'82\\'cc\\'8e\\'e8\\'8f\\'87\\'82\\'f0\\'93\\'a5\\'82\\'f1\\'82\\'c5\\'95\\'db\\'8c\\'ec\\'82\\'b5\\'82\\'dc\\'82\\'b7\\'81\\'42\n\\f0 (1)\n\\f1 \\'82\\'dc\\'82\\'b8\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\\n\\'83\\'41\\'82\\'c9\\'91\\'ce\\'82\\'b5\\'82\\'c4\\'92\\'98\\'8d\\'ec\\'8c\\'a0\\'82\\'f0\\'8e\\'e5\\'92\\'a3\\'82\\'b5\\'81\\'41\\'82\\'bb\\'82\\'b5\\'82\\'c4\n\\f0  (2)\n\\f1 \\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'c9\\'91\\'ce\\'82\\'b5\\'82\\'c4\\'81\\'41\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'cc\\'95\\'a1\\\n\\'90\\'bb\\'82\\'e2\\'94\\'d0\\'95\\'7a\\'82\\'dc\\'82\\'bd\\'82\\'cd\\'89\\'fc\\'95\\'cf\\'82\\'c9\\'82\\'c2\\'82\\'a2\\'82\\'c4\\'82\\'cc\\'96\\'40\\'93\\'49\\'82\\'c8\\'8b\\'96\\'89\\'c2\\'82\\'f0\\'97\\'5e\\'82\\'a6\\'82\\'e9\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'f0\\'92\\'f1\\'8e\\'a6\\'82\\'b5\\'82\\'dc\\'82\\'b7\\'81\\'42\\\n\\\n\\'82\\'dc\\'82\\'bd\\'81\\'41\\'8a\\'65\\'8d\\'ec\\'8e\\'d2\\'82\\'e2\\'8e\\'84\\'82\\'bd\\'82\\'bf\\'82\\'f0\\'95\\'db\\'8c\\'ec\\'82\\'b7\\'82\\'e9\\'82\\'bd\\'82\\'df\\'81\\'41\\'8e\\'84\\'82\\'bd\\'82\\'bf\\'82\\'cd\\'82\\'b1\\'82\\'cc\\'83\\'74\\'83\\'8a\\'81\\'5b\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'c9\\'82\\'cd\\\n\\'89\\'bd\\'82\\'cc\\'95\\'db\\'8f\\'d8\\'82\\'e0\\'96\\'b3\\'82\\'a2\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'82\\'b1\\'82\\'c6\\'82\\'f0\\'92\\'4e\\'82\\'e0\\'82\\'aa\\'8a\\'6d\\'8e\\'c0\\'82\\'c9\\'97\\'9d\\'89\\'f0\\'82\\'b7\\'82\\'e9\\'82\\'e6\\'82\\'a4\\'82\\'c9\\'82\\'b5\\'81\\'41\\'82\\'dc\\'82\\'bd\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\\n\\'83\\'41\\'82\\'aa\\'92\\'4e\\'82\\'a9\\'91\\'bc\\'90\\'6c\\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'89\\'fc\\'95\\'cf\\'82\\'b3\\'82\\'ea\\'81\\'41\\'82\\'bb\\'82\\'ea\\'82\\'aa\\'8e\\'9f\\'81\\'58\\'82\\'c6\\'94\\'d0\\'95\\'7a\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'c1\\'82\\'bd\\'82\\'c6\\'82\\'b5\\'82\\'c4\\'82\\'e0\\'81\\'41\\'82\\'bb\\\n\\'82\\'cc\\'8e\\'f3\\'97\\'cc\\'8e\\'d2\\'82\\'cd\\'94\\'de\\'82\\'e7\\'82\\'aa\\'8e\\'e8\\'82\\'c9\\'93\\'fc\\'82\\'ea\\'82\\'bd\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'aa\\'83\\'49\\'83\\'8a\\'83\\'57\\'83\\'69\\'83\\'8b\\'82\\'cc\\'83\\'6f\\'81\\'5b\\'83\\'57\\'83\\'87\\'83\\'93\\'82\\'c5\\'82\\'cd\\'96\\'b3\\'82\\'a2\\\n\\'82\\'b1\\'82\\'c6\\'81\\'41\\'82\\'bb\\'82\\'b5\\'82\\'c4\\'8c\\'b4\\'8d\\'ec\\'8e\\'d2\\'82\\'cc\\'96\\'bc\\'90\\'ba\\'82\\'cd\\'91\\'bc\\'90\\'6c\\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'8e\\'9d\\'82\\'bf\\'8d\\'9e\\'82\\'dc\\'82\\'ea\\'82\\'bd\\'89\\'c2\\'94\\'5c\\'90\\'ab\\'82\\'cc\\'82\\'a0\\'82\\'e9\\'96\\'e2\\'91\\'e8\\'82\\'c9\\'82\\'e6\\'82\\'c1\\\n\\'82\\'c4\\'89\\'65\\'8b\\'bf\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'aa\\'82\\'c8\\'82\\'a2\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'82\\'b1\\'82\\'c6\\'82\\'f0\\'8e\\'fc\\'92\\'6d\\'82\\'b3\\'82\\'b9\\'82\\'bd\\'82\\'a2\\'82\\'c6\\'8e\\'76\\'82\\'a2\\'82\\'dc\\'82\\'b7\\'81\\'42\\\n\\\n\\'8d\\'c5\\'8c\\'e3\\'82\\'c9\\'81\\'41\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'93\\'c1\\'8b\\'96\\'82\\'aa\\'82\\'a2\\'82\\'a9\\'82\\'c8\\'82\\'e9\\'83\\'74\\'83\\'8a\\'81\\'5b\\'82\\'cc\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'cc\\'91\\'b6\\'8d\\'dd\\'82\\'c9\\'82\\'e0\\'95\\'73\\'92\\'66\\'82\\'cc\\'8b\\'ba\\\n\\'88\\'d0\\'82\\'f0\\'93\\'8a\\'82\\'b0\\'82\\'a9\\'82\\'af\\'82\\'c4\\'82\\'a2\\'82\\'dc\\'82\\'b7\\'82\\'aa\\'81\\'41\\'8e\\'84\\'82\\'bd\\'82\\'bf\\'82\\'cd\\'81\\'41\\'83\\'74\\'83\\'8a\\'81\\'5b\\'82\\'c8\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'cc\\'8d\\'c4\\'94\\'d0\\'95\\'7a\\'8e\\'d2\\'82\\'aa\\'8c\\'c2\\'81\\'58\\'82\\'c9\\\n\\'93\\'c1\\'8b\\'96\\'83\\'89\\'83\\'43\\'83\\'5a\\'83\\'93\\'83\\'58\\'82\\'f0\\'8e\\'e6\\'93\\'be\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'81\\'41\\'8e\\'96\\'8e\\'c0\\'8f\\'e3\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'f0\\'93\\'c6\\'90\\'e8\\'93\\'49\\'82\\'c9\\'82\\'b5\\'82\\'c4\\'82\\'b5\\\n\\'82\\'dc\\'82\\'a4\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'8a\\'eb\\'8c\\'af\\'82\\'f0\\'94\\'f0\\'82\\'af\\'82\\'bd\\'82\\'a2\\'82\\'c6\\'8e\\'76\\'82\\'a2\\'82\\'dc\\'82\\'b7\\'81\\'42\\'82\\'b1\\'82\\'a4\\'82\\'a2\\'82\\'c1\\'82\\'bd\\'8e\\'96\\'91\\'d4\\'82\\'f0\\'97\\'5c\\'96\\'68\\'82\\'b7\\'82\\'e9\\'82\\'bd\\'82\\'df\\'81\\'41\\'8e\\'84\\'82\\'bd\\\n\\'82\\'bf\\'82\\'cd\\'82\\'a2\\'82\\'a9\\'82\\'c8\\'82\\'e9\\'93\\'c1\\'8b\\'96\\'82\\'e0\\'92\\'4e\\'82\\'e0\\'82\\'aa\\'8e\\'a9\\'97\\'52\\'82\\'c9\\'97\\'98\\'97\\'70\\'82\\'c5\\'82\\'ab\\'82\\'e9\\'82\\'e6\\'82\\'a4\\'83\\'89\\'83\\'43\\'83\\'5a\\'83\\'93\\'83\\'58\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'82\\'a9\\'81\\'41\\'91\\'53\\'82\\'ad\\'83\\'89\\\n\\'83\\'43\\'83\\'5a\\'83\\'93\\'83\\'58\\'82\\'b3\\'82\\'ea\\'82\\'c8\\'82\\'a2\\'82\\'a9\\'82\\'cc\\'82\\'c7\\'82\\'bf\\'82\\'e7\\'82\\'a9\\'82\\'c5\\'82\\'c8\\'82\\'af\\'82\\'ea\\'82\\'ce\\'82\\'c8\\'82\\'e7\\'82\\'c8\\'82\\'a2\\'82\\'b1\\'82\\'c6\\'82\\'f0\\'96\\'be\\'8a\\'6d\\'82\\'c9\\'82\\'b5\\'82\\'dc\\'82\\'b5\\'82\\'bd\\'81\\'42\\\n\\\n\n\\f0 (\n\\f1 \\'96\\'f3\\'92\\'8d\n\\f0 :\n\\f1 \\'96\\'7b\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'c5\\'81\\'75\\'93\\'c6\\'90\\'e8\\'93\\'49\n\\f0 (proprietary)\n\\f1 \\'81\\'76\\'82\\'c6\\'82\\'cd\\'81\\'41\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'cc\\'97\\'98\\'97\\'70\\'82\\'e2\\'8d\\'c4\\'94\\'d0\\\n\\'95\\'7a\\'81\\'41\\'89\\'fc\\'95\\'cf\\'82\\'aa\\'8b\\'d6\\'8e\\'7e\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'e9\\'82\\'a9\\'81\\'41\\'8b\\'96\\'89\\'c2\\'82\\'f0\\'93\\'be\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'aa\\'95\\'4b\\'97\\'76\\'82\\'c6\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'e9\\'82\\'a9\\'81\\'41\\'82\\'a0\\'82\\'e9\\'82\\'a2\\\n\\'82\\'cd\\'8c\\'b5\\'82\\'b5\\'82\\'a2\\'90\\'a7\\'8c\\'c0\\'82\\'aa\\'89\\'db\\'82\\'b9\\'82\\'e7\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'c4\\'8e\\'a9\\'97\\'52\\'82\\'c9\\'82\\'bb\\'82\\'a4\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'aa\\'8e\\'96\\'8e\\'c0\\'8f\\'e3\\'82\\'c5\\'82\\'ab\\'82\\'c8\\'82\\'ad\\'82\\'c8\\'82\\'c1\\'82\\'c4\\'82\\'a2\\\n\\'82\\'e9\\'8f\\'f3\\'91\\'d4\\'82\\'cc\\'82\\'b1\\'82\\'c6\\'82\\'f0\\'8e\\'77\\'82\\'b7\\'81\\'42\\'8f\\'da\\'82\\'b5\\'82\\'ad\\'82\\'cd\\\n\n\\f0 http://www.gnu.org/philosophy/categories.ja.html#ProprietarySoftware\n\\f1 \\'82\\'f0\\\n\\'8e\\'51\\'8f\\'c6\\'82\\'b9\\'82\\'e6\\'81\\'42\n\\f0 )\\\n\\\n\n\\f1 \\'95\\'a1\\'90\\'bb\\'82\\'e2\\'94\\'d0\\'95\\'7a\\'81\\'41\\'89\\'fc\\'95\\'cf\\'82\\'c9\\'82\\'c2\\'82\\'a2\\'82\\'c4\\'82\\'cc\\'90\\'b3\\'8a\\'6d\\'82\\'c8\\'8f\\'f0\\'8c\\'8f\\'82\\'c6\\'90\\'a7\\'96\\'f1\\'82\\'f0\\'88\\'c8\\'89\\'ba\\'82\\'c5\\'8f\\'71\\'82\\'d7\\'82\\'c4\\'82\\'a2\\'82\\'ab\\'82\\'dc\\'82\\'b7\\'81\\'42\\\n\\\n\\\n\\page \\\n\n\\f0                     GNU\n\\f1 \\'88\\'ea\\'94\\'ca\\'8c\\'f6\\'8f\\'4f\\'97\\'98\\'97\\'70\\'8b\\'96\\'91\\'f8\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\\n\n\\f0\n\\f1 \\'95\\'a1\\'90\\'bb\\'81\\'41\\'94\\'d0\\'95\\'7a\\'81\\'41\\'89\\'fc\\'95\\'cf\\'82\\'c9\\'8a\\'d6\\'82\\'b7\\'82\\'e9\\'8f\\'f0\\'8c\\'8f\\'82\\'c6\\'90\\'a7\\'96\\'f1\\\n\\\n\n\\f0 0.\n\\f1 \\'82\\'b1\\'82\\'cc\\'97\\'98\\'97\\'70\\'8b\\'96\\'91\\'f8\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'cd\\'81\\'41\\'82\\'bb\\'82\\'cc\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\n\\f0 (\n\\f1 \\'82\\'dc\\'82\\'bd\\'82\\'cd\\'82\\'bb\\'82\\'cc\\'91\\'bc\\'82\\'cc\\'92\\'98\\'8d\\'ec\\'95\\'a8\n\\f0 )\n\\f1 \\'82\\'f0\\'82\\'b1\\'82\\'cc\\'88\\'ea\\\n\\'94\\'ca\\'8c\\'f6\\'8f\\'4f\\'97\\'98\\'97\\'70\\'8b\\'96\\'91\\'f8\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'cc\\'92\\'e8\\'82\\'df\\'82\\'e9\\'8f\\'f0\\'8c\\'8f\\'82\\'cc\\'89\\'ba\\'82\\'c5\\'94\\'d0\\'95\\'7a\\'82\\'c5\\'82\\'ab\\'82\\'e9\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'8d\\'90\\'92\\'6d\\'82\\'aa\\'92\\'98\\'8d\\'ec\\'8c\\'a0\\'8e\\'d2\\'82\\'c9\\\n\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'8b\\'4c\\'8d\\'da\\'82\\'b3\\'82\\'ea\\'82\\'bd\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'dc\\'82\\'bd\\'82\\'cd\\'82\\'bb\\'82\\'cc\\'91\\'bc\\'82\\'cc\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'91\\'53\\'94\\'ca\\'82\\'c9\\'93\\'4b\\'97\\'70\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'81\\'42\\'88\\'c8\\'89\\'ba\\'82\\'c5\\\n\\'82\\'cd\\'81\\'41\\'81\\'75\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'81\\'76\\'82\\'c6\\'82\\'cd\\'82\\'bb\\'82\\'cc\\'82\\'e6\\'82\\'a4\\'82\\'c9\\'82\\'b5\\'82\\'c4\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'aa\\'93\\'4b\\'97\\'70\\'82\\'b3\\'82\\'ea\\'82\\'bd\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\\n\\'83\\'80\\'82\\'e2\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'91\\'53\\'94\\'ca\\'82\\'f0\\'88\\'d3\\'96\\'a1\\'82\\'b5\\'81\\'41\\'82\\'dc\\'82\\'bd\\'81\\'75\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'f0\\'8a\\'ee\\'82\\'c9\\'82\\'b5\\'82\\'bd\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'81\\'76\\'82\\'c6\\'82\\'cd\\'81\\'77\\'83\\'76\\\n\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'e2\\'82\\'bb\\'82\\'cc\\'91\\'bc\\'92\\'98\\'8d\\'ec\\'8c\\'a0\\'96\\'40\\'82\\'cc\\'89\\'ba\\'82\\'c5\\'94\\'68\\'90\\'b6\\'95\\'a8\\'82\\'c6\\'8c\\'a9\\'82\\'c8\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'82\\'e0\\'82\\'cc\\'91\\'53\\'94\\'ca\\'82\\'f0\\'8e\\'77\\'82\\'b7\\'81\\'42\\'82\\'b7\\'82\\'c8\\\n\\'82\\'ed\\'82\\'bf\\'81\\'41\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'a9\\'82\\'bb\\'82\\'cc\\'88\\'ea\\'95\\'94\\'82\\'f0\\'81\\'41\\'91\\'53\\'82\\'ad\\'93\\'af\\'88\\'ea\\'82\\'cc\\'82\\'dc\\'82\\'dc\\'82\\'a9\\'81\\'41\\'89\\'fc\\'95\\'cf\\'82\\'f0\\'89\\'c1\\'82\\'a6\\'82\\'bd\\'82\\'a9\\'81\\'41\\'82\\'a0\\\n\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'91\\'bc\\'82\\'cc\\'8c\\'be\\'8c\\'ea\\'82\\'c9\\'96\\'7c\\'96\\'f3\\'82\\'b3\\'82\\'ea\\'82\\'bd\\'8c\\'60\\'82\\'c5\\'8a\\'dc\\'82\\'de\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'cc\\'82\\'b1\\'82\\'c6\\'82\\'c5\\'82\\'a0\\'82\\'e9\n\\f0 (\n\\f1 \\'81\\'75\\'89\\'fc\\'95\\'cf\\'81\\'76\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'8c\\'ea\\\n\\'82\\'cc\\'96\\'7b\\'97\\'88\\'82\\'cc\\'88\\'d3\\'96\\'a1\\'82\\'a9\\'82\\'e7\\'82\\'cd\\'82\\'b8\\'82\\'ea\\'82\\'e9\\'82\\'aa\\'81\\'41\\'88\\'c8\\'89\\'ba\\'82\\'c5\\'82\\'cd\\'96\\'7c\\'96\\'f3\\'82\\'e0\\'89\\'fc\\'95\\'cf\\'82\\'cc\\'88\\'ea\\'8e\\'ed\\'82\\'c6\\'8c\\'a9\\'82\\'c8\\'82\\'b7\n\\f0 )\n\\f1 \\'81\\'42\\'82\\'bb\\'82\\'ea\\'82\\'bc\\\n\\'82\\'ea\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8e\\'d2\\'82\\'cd\\'81\\'75\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'81\\'76\\'82\\'c6\\'95\\'5c\\'8c\\'bb\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'81\\'42\\\n\\\n\\'95\\'a1\\'90\\'bb\\'82\\'e2\\'94\\'d0\\'95\\'7a\\'81\\'41\\'89\\'fc\\'95\\'cf\\'88\\'c8\\'8a\\'4f\\'82\\'cc\\'8a\\'88\\'93\\'ae\\'82\\'cd\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'c5\\'82\\'cd\\'83\\'4a\\'83\\'6f\\'81\\'5b\\'82\\'b3\\'82\\'ea\\'82\\'c8\\'82\\'a2\\'81\\'42\\'82\\'bb\\'82\\'ea\\'82\\'e7\\'82\\'cd\\'82\\'b1\\'82\\'cc\\\n\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'cc\\'91\\'ce\\'8f\\'db\\'8a\\'4f\\'82\\'c5\\'82\\'a0\\'82\\'e9\\'81\\'42\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'f0\\'8e\\'c0\\'8d\\'73\\'82\\'b7\\'82\\'e9\\'8d\\'73\\'88\\'d7\\'8e\\'a9\\'91\\'cc\\'82\\'c9\\'90\\'a7\\'8c\\'c0\\'82\\'cd\\'82\\'c8\\'82\\'a2\\'81\\'42\\'82\\'dc\\\n\\'82\\'bd\\'81\\'41\\'82\\'bb\\'82\\'cc\\'82\\'e6\\'82\\'a4\\'82\\'c8\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'cc\\'8f\\'6f\\'97\\'cd\\'8c\\'8b\\'89\\'ca\\'82\\'cd\\'81\\'41\\'82\\'bb\\'82\\'cc\\'93\\'e0\\'97\\'65\\'82\\'aa\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'f0\\'8a\\'ee\\\n\\'82\\'c9\\'82\\'b5\\'82\\'bd\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'f0\\'8d\\'5c\\'90\\'ac\\'82\\'b7\\'82\\'e9\\'8f\\'ea\\'8d\\'87\\'82\\'cc\\'82\\'dd\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'95\\'db\\'8c\\'ec\\'82\\'b3\\'82\\'ea\\'82\\'e9\n\\f0 (\n\\f1 \\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\\n\\'83\\'80\\'81\\'78\\'82\\'f0\\'8e\\'c0\\'8d\\'73\\'82\\'b5\\'82\\'bd\\'82\\'b1\\'82\\'c6\\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'8d\\'ec\\'90\\'ac\\'82\\'b3\\'82\\'ea\\'82\\'bd\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'82\\'b1\\'82\\'c6\\'82\\'c6\\'82\\'cd\\'96\\'b3\\'8a\\'d6\\'8c\\'57\\'82\\'c5\\'82\\'a0\\'82\\'e9\n\\f0 )\n\\f1 \\'81\\'42\\'82\\'b1\\'82\\'cc\\\n\\'82\\'e6\\'82\\'a4\\'82\\'c8\\'90\\'fc\\'88\\'f8\\'82\\'ab\\'82\\'cc\\'91\\'c3\\'93\\'96\\'90\\'ab\\'82\\'cd\\'81\\'41\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'aa\\'89\\'bd\\'82\\'f0\\'82\\'b7\\'82\\'e9\\'82\\'cc\\'82\\'a9\\'82\\'c9\\'88\\'cb\\'91\\'b6\\'82\\'b7\\'82\\'e9\\'81\\'42\\\n\\\n\n\\f0 1.\n\\f1 \\'82\\'bb\\'82\\'ea\\'82\\'bc\\'82\\'ea\\'82\\'cc\\'95\\'a1\\'90\\'bb\\'95\\'a8\\'82\\'c9\\'82\\'a8\\'82\\'a2\\'82\\'c4\\'93\\'4b\\'90\\'d8\\'82\\'c8\\'92\\'98\\'8d\\'ec\\'8c\\'a0\\'95\\'5c\\'8e\\'a6\\'82\\'c6\\'95\\'db\\'8f\\'d8\\'82\\'cc\\'94\\'db\\'94\\'46\\'90\\'ba\\'96\\'be\n\\f0 (disclaimer\\\nof warranty)\n\\f1 \\'82\\'f0\\'96\\'da\\'97\\'a7\\'82\\'c2\\'82\\'e6\\'82\\'a4\\'93\\'4b\\'90\\'d8\\'82\\'c9\\'8c\\'66\\'8d\\'da\\'82\\'b5\\'81\\'41\\'82\\'dc\\'82\\'bd\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'a8\\'82\\'e6\\'82\\'d1\\'88\\'ea\\'90\\'d8\\'82\\'cc\\'95\\'db\\'8f\\'d8\\'82\\'cc\\\n\\'95\\'73\\'8d\\'dd\\'82\\'c9\\'90\\'47\\'82\\'ea\\'82\\'bd\\'8d\\'90\\'92\\'6d\\'82\\'b7\\'82\\'d7\\'82\\'c4\\'82\\'f0\\'82\\'bb\\'82\\'cc\\'82\\'dc\\'82\\'dc\\'8e\\'63\\'82\\'b5\\'81\\'41\\'82\\'bb\\'82\\'b5\\'82\\'c4\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'cc\\'95\\'a1\\'90\\'bb\\'95\\'a8\\'82\\'f0\\'81\\'77\\'83\\'76\\'83\\'8d\\\n\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'cc\\'82\\'a2\\'82\\'a9\\'82\\'c8\\'82\\'e9\\'8e\\'f3\\'97\\'cc\\'8e\\'d2\\'82\\'c9\\'82\\'e0\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'c6\\'8b\\'a4\\'82\\'c9\\'94\\'d0\\'95\\'7a\\'82\\'b7\\'82\\'e9\\'8c\\'c0\\'82\\'e8\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cd\\\n\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'cc\\'83\\'5c\\'81\\'5b\\'83\\'58\\'83\\'52\\'81\\'5b\\'83\\'68\\'82\\'cc\\'95\\'a1\\'90\\'bb\\'95\\'a8\\'82\\'f0\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'aa\\'8e\\'f3\\'82\\'af\\'8e\\'e6\\'82\\'c1\\'82\\'bd\\'92\\'ca\\'82\\'e8\\'82\\'cc\\'8c\\'60\\'82\\'c5\\'95\\'a1\\\n\\'90\\'bb\\'82\\'dc\\'82\\'bd\\'82\\'cd\\'94\\'d0\\'95\\'7a\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'aa\\'82\\'c5\\'82\\'ab\\'82\\'e9\\'81\\'42\\'94\\'7d\\'91\\'cc\\'82\\'cd\\'96\\'e2\\'82\\'ed\\'82\\'c8\\'82\\'a2\\'81\\'42\\\n\\\n\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cd\\'81\\'41\\'95\\'a8\\'97\\'9d\\'93\\'49\\'82\\'c9\\'95\\'a1\\'90\\'bb\\'95\\'a8\\'82\\'f0\\'8f\\'f7\\'93\\'6e\\'82\\'b7\\'82\\'e9\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'8d\\'73\\'88\\'d7\\'82\\'c9\\'8a\\'d6\\'82\\'b5\\'82\\'c4\\'8e\\'e8\\'90\\'94\\'97\\'bf\\'82\\'f0\\'89\\'db\\'82\\'b5\\'82\\'c4\\'82\\'e0\\'97\\'c7\\\n\\'82\\'a2\\'82\\'b5\\'81\\'41\\'8a\\'f3\\'96\\'5d\\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'82\\'cd\\'8e\\'e8\\'90\\'94\\'97\\'bf\\'82\\'f0\\'8e\\'e6\\'82\\'c1\\'82\\'c4\\'8c\\'f0\\'8a\\'b7\\'82\\'c9\\'82\\'a8\\'82\\'af\\'82\\'e9\\'95\\'db\\'8c\\'ec\\'82\\'cc\\'95\\'db\\'8f\\'d8\\'82\\'f0\\'92\\'f1\\'8b\\'9f\\'82\\'b5\\'82\\'c4\\'82\\'e0\\'97\\'c7\\\n\\'82\\'a2\\'81\\'42\\\n\\\n\n\\f0 2.\n\\f1 \\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cd\\'8e\\'a9\\'95\\'aa\\'82\\'cc\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'cc\\'95\\'a1\\'90\\'bb\\'95\\'a8\\'82\\'a9\\'82\\'bb\\'82\\'cc\\'88\\'ea\\'95\\'94\\'82\\'f0\\'89\\'fc\\'95\\'cf\\'82\\'b5\\'82\\'c4\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\\n\\'83\\'80\\'81\\'78\\'82\\'f0\\'8a\\'ee\\'82\\'c9\\'82\\'b5\\'82\\'bd\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'f0\\'8c\\'60\\'90\\'ac\\'82\\'b5\\'81\\'41\\'82\\'bb\\'82\\'cc\\'82\\'e6\\'82\\'a4\\'82\\'c8\\'89\\'fc\\'95\\'cf\\'93\\'5f\\'82\\'e2\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'f0\\'8f\\'e3\\'8b\\'4c\\'91\\'e6\n\\f0 1\n\\f1 \\'90\\'df\\'82\\'cc\\'92\\'e8\\\n\\'82\\'df\\'82\\'e9\\'8f\\'f0\\'8c\\'8f\\'82\\'cc\\'89\\'ba\\'82\\'c5\\'95\\'a1\\'90\\'bb\\'82\\'dc\\'82\\'bd\\'82\\'cd\\'94\\'d0\\'95\\'7a\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'aa\\'82\\'c5\\'82\\'ab\\'82\\'e9\\'81\\'42\\'82\\'bd\\'82\\'be\\'82\\'b5\\'81\\'41\\'82\\'bb\\'82\\'cc\\'82\\'bd\\'82\\'df\\'82\\'c9\\'82\\'cd\\'88\\'c8\\'89\\'ba\\\n\\'82\\'cc\\'8f\\'f0\\'8c\\'8f\\'82\\'b7\\'82\\'d7\\'82\\'c4\\'82\\'f0\\'96\\'9e\\'82\\'bd\\'82\\'b5\\'82\\'c4\\'82\\'a2\\'82\\'c8\\'82\\'af\\'82\\'ea\\'82\\'ce\\'82\\'c8\\'82\\'e7\\'82\\'c8\\'82\\'a2\n\\f0 :\\\n\\\n    a)\n\\f1 \\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'aa\\'82\\'bb\\'82\\'ea\\'82\\'e7\\'82\\'cc\\'83\\'74\\'83\\'40\\'83\\'43\\'83\\'8b\\'82\\'f0\\'95\\'cf\\'8d\\'58\\'82\\'b5\\'82\\'bd\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'82\\'b1\\'82\\'c6\\'82\\'c6\\'95\\'cf\\'8d\\'58\\'82\\'b5\\'82\\'bd\\'93\\'fa\\'8e\\'9e\\'82\\'aa\\'97\\'c7\\\n\n\\f0\n\\f1 \\'82\\'ad\\'95\\'aa\\'82\\'a9\\'82\\'e9\\'82\\'e6\\'82\\'a4\\'81\\'41\\'89\\'fc\\'95\\'cf\\'82\\'b3\\'82\\'ea\\'82\\'bd\\'83\\'74\\'83\\'40\\'83\\'43\\'83\\'8b\\'82\\'c9\\'8d\\'90\\'8e\\'a6\\'82\\'b5\\'82\\'c8\\'82\\'af\\'82\\'ea\\'82\\'ce\\'82\\'c8\\'82\\'e7\\'82\\'c8\\'82\\'a2\\'81\\'42\\\n\\\n\n\\f0     b)\n\\f1 \\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'dc\\'82\\'bd\\'82\\'cd\\'82\\'bb\\'82\\'cc\\'88\\'ea\\'95\\'94\\'82\\'f0\\'8a\\'dc\\'82\\'de\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'81\\'41\\'82\\'a0\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\\n\n\\f0\n\\f1 \\'82\\'a9\\'82\\'bb\\'82\\'cc\\'88\\'ea\\'95\\'94\\'82\\'a9\\'82\\'e7\\'94\\'68\\'90\\'b6\\'82\\'b5\\'82\\'bd\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'f0\\'94\\'d0\\'95\\'7a\\'82\\'a0\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'94\\'ad\\'95\\'5c\\'82\\'b7\\'82\\'e9\\'8f\\'ea\\'8d\\'87\\'82\\'c9\\'82\\'cd\\'81\\'41\\'82\\'bb\\'82\\'cc\\'91\\'53\\\n\n\\f0\n\\f1 \\'91\\'cc\\'82\\'f0\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'cc\\'8f\\'f0\\'8c\\'8f\\'82\\'c9\\'8f\\'5d\\'82\\'c1\\'82\\'c4\\'91\\'e6\\'8e\\'4f\\'8e\\'d2\\'82\\'d6\\'96\\'b3\\'8f\\'9e\\'82\\'c5\\'97\\'98\\'97\\'70\\'8b\\'96\\'91\\'f8\\'82\\'b5\\'82\\'c8\\'82\\'af\\'82\\'ea\\'82\\'ce\\'82\\'c8\\'82\\'e7\\'82\\'c8\\\n\n\\f0\n\\f1 \\'82\\'a2\\'81\\'42\\\n\\\n\n\\f0     c)\n\\f1 \\'89\\'fc\\'95\\'cf\\'82\\'b3\\'82\\'ea\\'82\\'bd\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'aa\\'81\\'41\\'92\\'ca\\'8f\\'ed\\'8e\\'c0\\'8d\\'73\\'82\\'b7\\'82\\'e9\\'8d\\'db\\'82\\'c9\\'91\\'ce\\'98\\'62\\'93\\'49\\'82\\'c9\\'83\\'52\\'83\\'7d\\'83\\'93\\'83\\'68\\'82\\'f0\\'93\\'c7\\'82\\'de\\\n\n\\f0\n\\f1 \\'82\\'e6\\'82\\'a4\\'82\\'c9\\'82\\'c8\\'82\\'c1\\'82\\'c4\\'82\\'a2\\'82\\'e9\\'82\\'c8\\'82\\'e7\\'82\\'ce\\'81\\'41\\'82\\'bb\\'82\\'cc\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'f0\\'8d\\'c5\\'82\\'e0\\'88\\'ea\\'94\\'ca\\'93\\'49\\'82\\'c8\\'95\\'fb\\'96\\'40\\'82\\'c5\\'91\\'ce\\'98\\'62\\'93\\'49\\'82\\'c9\\\n\n\\f0\n\\f1 \\'8e\\'c0\\'8d\\'73\\'82\\'b7\\'82\\'e9\\'8d\\'db\\'81\\'41\\'93\\'4b\\'90\\'d8\\'82\\'c8\\'92\\'98\\'8d\\'ec\\'8c\\'a0\\'95\\'5c\\'8e\\'a6\\'81\\'41\\'96\\'b3\\'95\\'db\\'8f\\'d8\\'82\\'c5\\'82\\'a0\\'82\\'e9\\'82\\'b1\\'82\\'c6\n\\f0 (\n\\f1 \\'82\\'a0\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'aa\\'95\\'db\\\n\n\\f0\n\\f1 \\'8f\\'d8\\'82\\'f0\\'92\\'f1\\'8b\\'9f\\'82\\'b7\\'82\\'e9\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'82\\'b1\\'82\\'c6\n\\f0 )\n\\f1 \\'81\\'41\\'83\\'86\\'81\\'5b\\'83\\'55\\'82\\'aa\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'f0\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'c5\\'8f\\'71\\'82\\'d7\\'82\\'bd\\'8f\\'f0\\\n\n\\f0\n\\f1 \\'8c\\'8f\\'82\\'cc\\'89\\'ba\\'82\\'c5\\'94\\'d0\\'95\\'7a\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'aa\\'82\\'c5\\'82\\'ab\\'82\\'e9\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'82\\'b1\\'82\\'c6\\'81\\'41\\'82\\'bb\\'82\\'b5\\'82\\'c4\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'cc\\'95\\'a1\\'90\\'bb\\'95\\'a8\\'82\\'f0\\\n\n\\f0\n\\f1 \\'89\\'7b\\'97\\'97\\'82\\'b7\\'82\\'e9\\'82\\'c9\\'82\\'cd\\'82\\'c7\\'82\\'a4\\'82\\'b5\\'82\\'bd\\'82\\'e7\\'82\\'e6\\'82\\'a2\\'82\\'a9\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'83\\'86\\'81\\'5b\\'83\\'55\\'82\\'d6\\'82\\'cc\\'90\\'e0\\'96\\'be\\'82\\'f0\\'8a\\'dc\\'82\\'de\\'8d\\'90\\'92\\'6d\\'82\\'aa\\'88\\'f3\\'8d\\'fc\\'82\\'b3\\\n\n\\f0\n\\f1 \\'82\\'ea\\'82\\'e9\\'82\\'a9\\'81\\'41\\'82\\'a0\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'89\\'e6\\'96\\'ca\\'82\\'c9\\'95\\'5c\\'8e\\'a6\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'82\\'e6\\'82\\'a4\\'82\\'c9\\'82\\'b5\\'82\\'c8\\'82\\'af\\'82\\'ea\\'82\\'ce\\'82\\'c8\\'82\\'e7\\'82\\'c8\\'82\\'a2\n\\f0 (\n\\f1 \\'97\\'e1\\'8a\\'4f\\'82\\'c6\\'82\\'b5\\\n\n\\f0\n\\f1 \\'82\\'c4\\'81\\'41\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'bb\\'82\\'cc\\'82\\'e0\\'82\\'cc\\'82\\'cd\\'91\\'ce\\'98\\'62\\'93\\'49\\'82\\'c5\\'82\\'a0\\'82\\'c1\\'82\\'c4\\'82\\'e0\\'92\\'ca\\'8f\\'ed\\'82\\'bb\\'82\\'cc\\'82\\'e6\\'82\\'a4\\'82\\'c8\\'8d\\'90\\'92\\'6d\\'82\\'f0\\'88\\'f3\\\n\n\\f0\n\\f1 \\'8d\\'fc\\'82\\'b5\\'82\\'c8\\'82\\'a2\\'8f\\'ea\\'8d\\'87\\'82\\'c9\\'82\\'cd\\'81\\'41\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'f0\\'8a\\'ee\\'82\\'c9\\'82\\'b5\\'82\\'bd\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cc\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'c9\\'82\\'bb\\'82\\'cc\\'82\\'e6\\'82\\'a4\\\n\n\\f0\n\\f1 \\'82\\'c8\\'8d\\'90\\'92\\'6d\\'82\\'f0\\'88\\'f3\\'8d\\'fc\\'82\\'b3\\'82\\'b9\\'82\\'e9\\'95\\'4b\\'97\\'76\\'82\\'cd\\'82\\'c8\\'82\\'a2\n\\f0 )\n\\f1 \\'81\\'42\\\n\\\n\\\n\\page \\\n\\'88\\'c8\\'8f\\'e3\\'82\\'cc\\'95\\'4b\\'97\\'76\\'8f\\'f0\\'8c\\'8f\\'82\\'cd\\'91\\'53\\'91\\'cc\\'82\\'c6\\'82\\'b5\\'82\\'c4\\'82\\'cc\\'89\\'fc\\'95\\'cf\\'82\\'b3\\'82\\'ea\\'82\\'bd\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'c9\\'93\\'4b\\'97\\'70\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'81\\'42\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'cc\\'88\\'ea\\'95\\'94\\\n\\'82\\'aa\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'a9\\'82\\'e7\\'94\\'68\\'90\\'b6\\'82\\'b5\\'82\\'bd\\'82\\'e0\\'82\\'cc\\'82\\'c5\\'82\\'cd\\'82\\'c8\\'82\\'a2\\'82\\'c6\\'8a\\'6d\\'94\\'46\\'82\\'c5\\'82\\'ab\\'81\\'41\\'82\\'bb\\'82\\'ea\\'82\\'e7\\'8e\\'a9\\'90\\'67\\'95\\'ca\\'82\\'cc\\'93\\'c6\\'97\\'a7\\\n\\'82\\'b5\\'82\\'bd\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'c5\\'82\\'a0\\'82\\'e9\\'82\\'c6\\'8d\\'87\\'97\\'9d\\'93\\'49\\'82\\'c9\\'8d\\'6c\\'82\\'a6\\'82\\'e7\\'82\\'ea\\'82\\'e9\\'82\\'c8\\'82\\'e7\\'82\\'ce\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'aa\\'82\\'bb\\'82\\'ea\\'82\\'e7\\'82\\'f0\\'95\\'ca\\'82\\'cc\\'92\\'98\\'8d\\'ec\\'95\\'a8\\\n\\'82\\'c6\\'82\\'b5\\'82\\'c4\\'95\\'aa\\'82\\'af\\'82\\'c4\\'94\\'d0\\'95\\'7a\\'82\\'b7\\'82\\'e9\\'8f\\'ea\\'8d\\'87\\'81\\'41\\'82\\'bb\\'82\\'a4\\'82\\'a2\\'82\\'c1\\'82\\'bd\\'95\\'94\\'95\\'aa\\'82\\'c9\\'82\\'cd\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'c6\\'82\\'bb\\'82\\'cc\\'8f\\'f0\\'8c\\'8f\\'82\\'cd\\\n\\'93\\'4b\\'97\\'70\\'82\\'b3\\'82\\'ea\\'82\\'c8\\'82\\'a2\\'81\\'42\\'82\\'b5\\'82\\'a9\\'82\\'b5\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'aa\\'93\\'af\\'82\\'b6\\'95\\'94\\'95\\'aa\\'82\\'f0\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'f0\\'8a\\'ee\\'82\\'c9\\'82\\'b5\\'82\\'bd\\'92\\'98\\'8d\\'ec\\'95\\'a8\\\n\\'91\\'53\\'91\\'cc\\'82\\'cc\\'88\\'ea\\'95\\'94\\'82\\'c6\\'82\\'b5\\'82\\'c4\\'94\\'d0\\'95\\'7a\\'82\\'b7\\'82\\'e9\\'82\\'c8\\'82\\'e7\\'82\\'ce\\'81\\'41\\'91\\'53\\'91\\'cc\\'82\\'c6\\'82\\'b5\\'82\\'c4\\'82\\'cc\\'94\\'d0\\'95\\'7a\\'95\\'a8\\'82\\'cd\\'81\\'41\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'aa\\\n\\'89\\'db\\'82\\'b7\\'8f\\'f0\\'8c\\'8f\\'82\\'c9\\'8f\\'5d\\'82\\'ed\\'82\\'c8\\'82\\'af\\'82\\'ea\\'82\\'ce\\'82\\'c8\\'82\\'e7\\'82\\'c8\\'82\\'a2\\'81\\'42\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'82\\'cc\\'82\\'cd\\'81\\'41\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'aa\\'91\\'bc\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8e\\'d2\\\n\\'82\\'c9\\'97\\'5e\\'82\\'a6\\'82\\'e9\\'8b\\'96\\'89\\'c2\\'82\\'cd\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'8a\\'db\\'82\\'b2\\'82\\'c6\\'91\\'53\\'91\\'cc\\'82\\'c9\\'8b\\'79\\'82\\'d1\\'81\\'41\\'92\\'4e\\'82\\'aa\\'8f\\'91\\'82\\'a2\\'82\\'bd\\'82\\'a9\\'82\\'cd\\'8a\\'d6\\'8c\\'57\\'82\\'c8\\'82\\'ad\\'8a\\'65\\\n\\'95\\'94\\'95\\'aa\\'82\\'cc\\'82\\'b7\\'82\\'d7\\'82\\'c4\\'82\\'f0\\'95\\'db\\'8c\\'ec\\'82\\'b7\\'82\\'e9\\'82\\'a9\\'82\\'e7\\'82\\'c5\\'82\\'a0\\'82\\'e9\\'81\\'42\\\n\\\n\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'81\\'41\\'82\\'b7\\'82\\'d7\\'82\\'c4\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'8f\\'91\\'82\\'a9\\'82\\'ea\\'82\\'bd\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'c9\\'91\\'ce\\'82\\'b5\\'81\\'41\\'8c\\'a0\\'97\\'98\\'82\\'f0\\'8e\\'e5\\'92\\'a3\\'82\\'b5\\'82\\'bd\\'82\\'e8\\'82\\'a0\\'82\\'c8\\\n\\'82\\'bd\\'82\\'cc\\'8c\\'a0\\'97\\'98\\'82\\'c9\\'88\\'d9\\'8b\\'63\\'82\\'f0\\'90\\'5c\\'82\\'b5\\'97\\'a7\\'82\\'c4\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'cd\\'82\\'b1\\'82\\'cc\\'90\\'df\\'82\\'cc\\'88\\'d3\\'90\\'7d\\'82\\'b7\\'82\\'e9\\'82\\'c6\\'82\\'b1\\'82\\'eb\\'82\\'c5\\'82\\'cd\\'82\\'c8\\'82\\'a2\\'81\\'42\\'82\\'de\\'82\\'b5\\'82\\'eb\\'81\\'41\\\n\\'82\\'bb\\'82\\'cc\\'8e\\'ef\\'8e\\'7c\\'82\\'cd\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'f0\\'8a\\'ee\\'82\\'c9\\'82\\'b5\\'82\\'bd\\'94\\'68\\'90\\'b6\\'95\\'a8\\'82\\'c8\\'82\\'a2\\'82\\'b5\\'8f\\'57\\'8d\\'87\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'cc\\'94\\'d0\\'95\\'7a\\'82\\'f0\\'8a\\'c7\\'97\\'9d\\'82\\'b7\\\n\\'82\\'e9\\'8c\\'a0\\'97\\'98\\'82\\'f0\\'8d\\'73\\'8e\\'67\\'82\\'b7\\'82\\'e9\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'82\\'b1\\'82\\'c6\\'82\\'c9\\'82\\'a0\\'82\\'e9\\'81\\'42\\\n\\\n\\'82\\'dc\\'82\\'bd\\'81\\'41\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'f0\\'8a\\'ee\\'82\\'c9\\'82\\'b5\\'82\\'c4\\'82\\'a2\\'82\\'c8\\'82\\'a2\\'82\\'bb\\'82\\'cc\\'91\\'bc\\'82\\'cc\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'f0\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\n\\f0 (\n\\f1 \\'82\\'a0\\\n\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'f0\\'8a\\'ee\\'82\\'c9\\'82\\'b5\\'82\\'bd\\'92\\'98\\'8d\\'ec\\'95\\'a8\n\\f0 )\n\\f1 \\'82\\'c6\\'88\\'ea\\'8f\\'8f\\'82\\'c9\\'8f\\'57\\'82\\'df\\'82\\'bd\\'82\\'be\\'82\\'af\\'82\\'cc\\'82\\'e0\\'82\\'cc\\'82\\'f0\\'88\\'ea\\'8a\\'aa\\'82\\'cc\\\n\\'95\\'db\\'8a\\'c7\\'91\\'95\\'92\\'75\\'82\\'c8\\'82\\'a2\\'82\\'b5\\'94\\'d0\\'95\\'7a\\'94\\'7d\\'91\\'cc\\'82\\'c9\\'8e\\'fb\\'82\\'df\\'82\\'c4\\'82\\'e0\\'81\\'41\\'82\\'bb\\'82\\'cc\\'91\\'bc\\'82\\'cc\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'dc\\'82\\'c5\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'aa\\'95\\'db\\\n\\'8c\\'ec\\'82\\'b7\\'82\\'e9\\'91\\'ce\\'8f\\'db\\'82\\'c9\\'82\\'c8\\'82\\'e9\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'82\\'b1\\'82\\'c6\\'82\\'c9\\'82\\'cd\\'82\\'c8\\'82\\'e7\\'82\\'c8\\'82\\'a2\\'81\\'42\\\n\\\n\n\\f0 3.\n\\f1 \\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cd\\'8f\\'e3\\'8b\\'4c\\'91\\'e6\n\\f0 1\n\\f1 \\'90\\'df\\'82\\'a8\\'82\\'e6\\'82\\'d1\n\\f0 2\n\\f1 \\'90\\'df\\'82\\'cc\\'8f\\'f0\\'8c\\'8f\\'82\\'c9\\'8f\\'5d\\'82\\'a2\\'81\\'41\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\n\\f0 (\n\\f1 \\'82\\'a0\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'91\\'e6\n\\f0 2\\\n\n\\f1 \\'90\\'df\\'82\\'c9\\'82\\'a8\\'82\\'af\\'82\\'e9\\'94\\'68\\'90\\'b6\\'95\\'a8\n\\f0 )\n\\f1 \\'82\\'f0\\'83\\'49\\'83\\'75\\'83\\'57\\'83\\'46\\'83\\'4e\\'83\\'67\\'83\\'52\\'81\\'5b\\'83\\'68\\'82\\'c8\\'82\\'a2\\'82\\'b5\\'8e\\'c0\\'8d\\'73\\'8c\\'60\\'8e\\'ae\\'82\\'c5\\'95\\'a1\\'90\\'bb\\'82\\'dc\\'82\\'bd\\'82\\'cd\\'94\\'d0\\'95\\'7a\\'82\\'b7\\\n\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'aa\\'82\\'c5\\'82\\'ab\\'82\\'e9\\'81\\'42\\'82\\'bd\\'82\\'be\\'82\\'b5\\'81\\'41\\'82\\'bb\\'82\\'cc\\'8f\\'ea\\'8d\\'87\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cd\\'88\\'c8\\'89\\'ba\\'82\\'cc\\'82\\'a4\\'82\\'bf\\'82\\'c7\\'82\\'ea\\'82\\'a9\\'88\\'ea\\'82\\'c2\\'82\\'f0\\'8e\\'c0\\'8e\\'7b\\'82\\'b5\\'82\\'c8\\\n\\'82\\'af\\'82\\'ea\\'82\\'ce\\'82\\'c8\\'82\\'e7\\'82\\'c8\\'82\\'a2\n\\f0 :\\\n\\\n    a)\n\\f1 \\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'c9\\'81\\'41\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'c9\\'91\\'ce\\'89\\'9e\\'82\\'b5\\'82\\'bd\\'8a\\'ae\\'91\\'53\\'82\\'a9\\'82\\'c2\\'8b\\'40\\'8a\\'42\\'82\\'c5\\'93\\'c7\\'82\\'dd\\'8e\\'e6\\'82\\'e8\\'89\\'c2\\'94\\'5c\\'82\\'c8\\\n\n\\f0\n\\f1 \\'83\\'5c\\'81\\'5b\\'83\\'58\\'83\\'52\\'81\\'5b\\'83\\'68\\'82\\'f0\\'93\\'59\\'95\\'74\\'82\\'b7\\'82\\'e9\\'81\\'42\\'82\\'bd\\'82\\'be\\'82\\'b5\\'81\\'41\\'83\\'5c\\'81\\'5b\\'83\\'58\\'83\\'52\\'81\\'5b\\'83\\'68\\'82\\'cd\\'8f\\'e3\\'8b\\'4c\\'91\\'e6\n\\f0 1\n\\f1 \\'90\\'df\\'82\\'a8\\'82\\'e6\\'82\\'d1\n\\f0 2\n\\f1 \\'90\\'df\\'82\\'cc\\\n\n\\f0\n\\f1 \\'8f\\'f0\\'8c\\'8f\\'82\\'c9\\'8f\\'5d\\'82\\'a2\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'cc\\'8c\\'f0\\'8a\\'b7\\'82\\'c5\\'8f\\'4b\\'8a\\'b5\\'93\\'49\\'82\\'c9\\'8e\\'67\\'82\\'ed\\'82\\'ea\\'82\\'e9\\'94\\'7d\\'91\\'cc\\'82\\'c5\\'94\\'d0\\'95\\'7a\\'82\\'b5\\'82\\'c8\\'82\\'af\\'82\\'ea\\'82\\'ce\\\n\n\\f0\n\\f1 \\'82\\'c8\\'82\\'e7\\'82\\'c8\\'82\\'a2\\'81\\'42\\'82\\'a0\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'81\\'41\\\n\\\n\n\\f0     b)\n\\f1 \\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'c9\\'81\\'41\\'82\\'a2\\'82\\'a9\\'82\\'c8\\'82\\'e9\\'91\\'e6\\'8e\\'4f\\'8e\\'d2\\'82\\'c9\\'91\\'ce\\'82\\'b5\\'82\\'c4\\'82\\'e0\\'81\\'41\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'c9\\'91\\'ce\\'89\\'9e\\'82\\'b5\\'82\\'bd\\'8a\\'ae\\\n\n\\f0\n\\f1 \\'91\\'53\\'82\\'a9\\'82\\'c2\\'8b\\'40\\'8a\\'42\\'82\\'c5\\'93\\'c7\\'82\\'dd\\'8e\\'e6\\'82\\'e8\\'89\\'c2\\'94\\'5c\\'82\\'c8\\'83\\'5c\\'81\\'5b\\'83\\'58\\'83\\'52\\'81\\'5b\\'83\\'68\\'82\\'f0\\'81\\'41\\'94\\'d0\\'95\\'7a\\'82\\'c9\\'97\\'76\\'82\\'b7\\'82\\'e9\\'95\\'a8\\'97\\'9d\\'93\\'49\\'83\\'52\\'83\\'58\\'83\\'67\\\n\n\\f0\n\\f1 \\'82\\'f0\\'8f\\'e3\\'89\\'f1\\'82\\'e7\\'82\\'c8\\'82\\'a2\\'92\\'f6\\'93\\'78\\'82\\'cc\\'8e\\'e8\\'90\\'94\\'97\\'bf\\'82\\'c6\\'88\\'f8\\'82\\'ab\\'8a\\'b7\\'82\\'a6\\'82\\'c9\\'92\\'f1\\'8b\\'9f\\'82\\'b7\\'82\\'e9\\'8e\\'7c\\'8f\\'71\\'82\\'d7\\'82\\'bd\\'8f\\'ad\\'82\\'c8\\'82\\'ad\\'82\\'c6\\'82\\'e0\n\\f0 3\n\\f1 \\'94\\'4e\\\n\n\\f0\n\\f1 \\'8a\\'d4\\'82\\'cd\\'97\\'4c\\'8c\\'f8\\'82\\'c8\\'8f\\'91\\'96\\'ca\\'82\\'c9\\'82\\'c8\\'82\\'c1\\'82\\'bd\\'90\\'5c\\'82\\'b5\\'8f\\'6f\\'82\\'f0\\'93\\'59\\'82\\'a6\\'82\\'e9\\'81\\'42\\'82\\'bd\\'82\\'be\\'82\\'b5\\'81\\'41\\'83\\'5c\\'81\\'5b\\'83\\'58\\'83\\'52\\'81\\'5b\\'83\\'68\\'82\\'cd\\'8f\\'e3\\'8b\\'4c\\'91\\'e6\\\n\n\\f0     1\n\\f1 \\'90\\'df\\'82\\'a8\\'82\\'e6\\'82\\'d1\n\\f0 2\n\\f1 \\'90\\'df\\'82\\'cc\\'8f\\'f0\\'8c\\'8f\\'82\\'c9\\'8f\\'5d\\'82\\'a2\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'cc\\'8c\\'f0\\'8a\\'b7\\'82\\'c5\\'8f\\'4b\\'8a\\'b5\\'93\\'49\\'82\\'c9\\'8e\\'67\\'82\\'ed\\'82\\'ea\\'82\\'e9\\'94\\'7d\\'91\\'cc\\'82\\'c5\\\n\n\\f0\n\\f1 \\'94\\'d0\\'95\\'7a\\'82\\'b5\\'82\\'c8\\'82\\'af\\'82\\'ea\\'82\\'ce\\'82\\'c8\\'82\\'e7\\'82\\'c8\\'82\\'a2\\'81\\'42\\'82\\'a0\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'81\\'41\\\n\\\n\n\\f0     c)\n\\f1 \\'91\\'ce\\'89\\'9e\\'82\\'b7\\'82\\'e9\\'83\\'5c\\'81\\'5b\\'83\\'58\\'83\\'52\\'81\\'5b\\'83\\'68\\'94\\'d0\\'95\\'7a\\'82\\'cc\\'90\\'5c\\'82\\'b5\\'8f\\'6f\\'82\\'c9\\'8d\\'db\\'82\\'b5\\'82\\'c4\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'aa\\'93\\'be\\'82\\'bd\\'8f\\'ee\\'95\\'f1\\'82\\'f0\\'88\\'ea\\\n\n\\f0\n\\f1 \\'8f\\'8f\\'82\\'c9\\'88\\'f8\\'82\\'ab\\'93\\'6e\\'82\\'b7\n\\f0 (\n\\f1 \\'82\\'b1\\'82\\'cc\\'91\\'49\\'91\\'f0\\'8e\\'88\\'82\\'cd\\'81\\'41\\'89\\'63\\'97\\'98\\'82\\'f0\\'96\\'da\\'93\\'49\\'82\\'c6\\'82\\'b5\\'82\\'c8\\'82\\'a2\\'94\\'d0\\'95\\'7a\\'82\\'c5\\'82\\'a0\\'82\\'c1\\'82\\'c4\\'81\\'41\\'82\\'a9\\'82\\'c2\\'82\\'a0\\\n\n\\f0\n\\f1 \\'82\\'c8\\'82\\'bd\\'82\\'aa\\'8f\\'e3\\'8b\\'4c\\'8f\\'ac\\'90\\'df\n\\f0 b\n\\f1 \\'82\\'c5\\'8e\\'77\\'92\\'e8\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'e9\\'82\\'e6\\'82\\'a4\\'82\\'c8\\'90\\'5c\\'82\\'b5\\'8f\\'6f\\'82\\'c6\\'8b\\'a4\\'82\\'c9\\'83\\'49\\'83\\'75\\'83\\'57\\'83\\'46\\'83\\'4e\\'83\\'67\\'83\\'52\\'81\\'5b\\\n\n\\f0\n\\f1 \\'83\\'68\\'82\\'a0\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'8e\\'c0\\'8d\\'73\\'8c\\'60\\'8e\\'ae\\'82\\'cc\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'b5\\'82\\'a9\\'93\\'fc\\'8e\\'e8\\'82\\'b5\\'82\\'c4\\'82\\'a2\\'82\\'c8\\'82\\'a2\\'8f\\'ea\\'8d\\'87\\'82\\'c9\\'8c\\'c0\\'82\\'e8\\'8b\\'96\\'89\\'c2\\'82\\'b3\\'82\\'ea\\\n\n\\f0\n\\f1 \\'82\\'e9\n\\f0 )\n\\f1 \\'81\\'42\\\n\\\n\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'cc\\'83\\'5c\\'81\\'5b\\'83\\'58\\'83\\'52\\'81\\'5b\\'83\\'68\\'82\\'c6\\'82\\'cd\\'81\\'41\\'82\\'bb\\'82\\'ea\\'82\\'c9\\'91\\'ce\\'82\\'b5\\'82\\'c4\\'89\\'fc\\'95\\'cf\\'82\\'f0\\'89\\'c1\\'82\\'a6\\'82\\'e9\\'8f\\'e3\\'82\\'c5\\'8d\\'44\\'82\\'dc\\'82\\'b5\\'82\\'a2\\'82\\'c6\\'82\\'b3\\'82\\'ea\\'82\\'e9\\\n\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'cc\\'8c\\'60\\'8e\\'ae\\'82\\'f0\\'88\\'d3\\'96\\'a1\\'82\\'b7\\'82\\'e9\\'81\\'42\\'82\\'a0\\'82\\'e9\\'8e\\'c0\\'8d\\'73\\'8c\\'60\\'8e\\'ae\\'82\\'cc\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'c9\\'82\\'c6\\'82\\'c1\\'82\\'c4\\'8a\\'ae\\'91\\'53\\'82\\'c8\\'83\\'5c\\'81\\'5b\\'83\\'58\\'83\\'52\\'81\\'5b\\'83\\'68\\\n\\'82\\'c6\\'82\\'cd\\'81\\'41\\'82\\'bb\\'82\\'ea\\'82\\'aa\\'8a\\'dc\\'82\\'de\\'83\\'82\\'83\\'57\\'83\\'85\\'81\\'5b\\'83\\'8b\\'82\\'b7\\'82\\'d7\\'82\\'c4\\'82\\'cc\\'83\\'5c\\'81\\'5b\\'83\\'58\\'83\\'52\\'81\\'5b\\'83\\'68\\'91\\'53\\'95\\'94\\'82\\'c9\\'89\\'c1\\'82\\'a6\\'81\\'41\\'8a\\'d6\\'98\\'41\\'82\\'b7\\'82\\'e9\\'83\\'43\\'83\\'93\\\n\\'83\\'5e\\'81\\'5b\\'83\\'74\\'83\\'46\\'81\\'5b\\'83\\'58\\'92\\'e8\\'8b\\'60\\'83\\'74\\'83\\'40\\'83\\'43\\'83\\'8b\\'82\\'cc\\'82\\'b7\\'82\\'d7\\'82\\'c4\\'82\\'c6\\'83\\'89\\'83\\'43\\'83\\'75\\'83\\'89\\'83\\'8a\\'82\\'cc\\'83\\'52\\'83\\'93\\'83\\'70\\'83\\'43\\'83\\'8b\\'82\\'e2\\'83\\'43\\'83\\'93\\'83\\'58\\'83\\'67\\'81\\'5b\\'83\\'8b\\\n\\'82\\'f0\\'90\\'a7\\'8c\\'e4\\'82\\'b7\\'82\\'e9\\'82\\'bd\\'82\\'df\\'82\\'c9\\'8e\\'67\\'82\\'ed\\'82\\'ea\\'82\\'e9\\'83\\'58\\'83\\'4e\\'83\\'8a\\'83\\'76\\'83\\'67\\'82\\'f0\\'82\\'e0\\'89\\'c1\\'82\\'a6\\'82\\'bd\\'82\\'e0\\'82\\'cc\\'82\\'f0\\'88\\'d3\\'96\\'a1\\'82\\'b7\\'82\\'e9\\'81\\'42\\'82\\'b5\\'82\\'a9\\'82\\'b5\\'93\\'c1\\'95\\'ca\\\n\\'82\\'c8\\'97\\'e1\\'8a\\'4f\\'82\\'c6\\'82\\'b5\\'82\\'c4\\'81\\'41\\'82\\'bb\\'82\\'cc\\'83\\'52\\'83\\'93\\'83\\'7c\\'81\\'5b\\'83\\'6c\\'83\\'93\\'83\\'67\\'8e\\'a9\\'91\\'cc\\'82\\'aa\\'8e\\'c0\\'8d\\'73\\'8c\\'60\\'8e\\'ae\\'82\\'c9\\'95\\'74\\'90\\'8f\\'82\\'b7\\'82\\'e9\\'82\\'cc\\'82\\'c5\\'82\\'cd\\'96\\'b3\\'82\\'a2\\'8c\\'c0\\'82\\'e8\\'81\\'41\\\n\\'94\\'d0\\'95\\'7a\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'82\\'e0\\'82\\'cc\\'82\\'cc\\'92\\'86\\'82\\'c9\\'81\\'41\\'8e\\'c0\\'8d\\'73\\'8c\\'60\\'8e\\'ae\\'82\\'aa\\'8e\\'c0\\'8d\\'73\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'83\\'49\\'83\\'79\\'83\\'8c\\'81\\'5b\\'83\\'65\\'83\\'42\\'83\\'93\\'83\\'4f\\'83\\'56\\'83\\'58\\'83\\'65\\'83\\'80\\'82\\'cc\\'8e\\'e5\\\n\\'97\\'76\\'82\\'c8\\'83\\'52\\'83\\'93\\'83\\'7c\\'81\\'5b\\'83\\'6c\\'83\\'93\\'83\\'67\n\\f0 (\n\\f1 \\'83\\'52\\'83\\'93\\'83\\'70\\'83\\'43\\'83\\'89\\'82\\'e2\\'83\\'4a\\'81\\'5b\\'83\\'6c\\'83\\'8b\\'93\\'99\n\\f0 )\n\\f1 \\'82\\'c6\\'92\\'ca\\'8f\\'ed\\'88\\'ea\\'8f\\'8f\\'82\\'c9\n\\f0 (\n\\f1 \\'83\\'5c\\'81\\'5b\\'83\\'58\\'82\\'a9\\'83\\'6f\\'83\\'43\\'83\\'69\\\n\\'83\\'8a\\'8c\\'60\\'8e\\'ae\\'82\\'cc\\'82\\'c7\\'82\\'bf\\'82\\'e7\\'82\\'a9\\'82\\'c5\n\\f0 )\n\\f1 \\'94\\'d0\\'95\\'7a\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'82\\'e0\\'82\\'cc\\'82\\'f0\\'8a\\'dc\\'82\\'f1\\'82\\'c5\\'82\\'a2\\'82\\'e9\\'95\\'4b\\'97\\'76\\'82\\'cd\\'82\\'c8\\'82\\'a2\\'82\\'c6\\'82\\'b7\\'82\\'e9\\'81\\'42\\\n\\\n\\'8e\\'c0\\'8d\\'73\\'8c\\'60\\'8e\\'ae\\'82\\'dc\\'82\\'bd\\'82\\'cd\\'83\\'49\\'83\\'75\\'83\\'57\\'83\\'46\\'83\\'4e\\'83\\'67\\'83\\'52\\'81\\'5b\\'83\\'68\\'82\\'cc\\'94\\'d0\\'95\\'7a\\'82\\'aa\\'81\\'41\\'8e\\'77\\'92\\'e8\\'82\\'b3\\'82\\'ea\\'82\\'bd\\'8f\\'ea\\'8f\\'8a\\'82\\'a9\\'82\\'e7\\'83\\'52\\'83\\'73\\'81\\'5b\\'82\\'b7\\'82\\'e9\\\n\\'82\\'bd\\'82\\'df\\'82\\'cc\\'83\\'41\\'83\\'4e\\'83\\'5a\\'83\\'58\\'8e\\'e8\\'92\\'69\\'82\\'f0\\'92\\'f1\\'8b\\'9f\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'c5\\'88\\'d7\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'82\\'c6\\'82\\'b5\\'82\\'c4\\'81\\'41\\'82\\'bb\\'82\\'cc\\'8f\\'e3\\'82\\'c5\\'83\\'5c\\'81\\'5b\\'83\\'58\\'83\\'52\\'81\\'5b\\'83\\'68\\\n\\'82\\'e0\\'93\\'af\\'93\\'99\\'82\\'cc\\'83\\'41\\'83\\'4e\\'83\\'5a\\'83\\'58\\'8e\\'e8\\'92\\'69\\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'93\\'af\\'82\\'b6\\'8f\\'ea\\'8f\\'8a\\'82\\'a9\\'82\\'e7\\'83\\'52\\'83\\'73\\'81\\'5b\\'82\\'c5\\'82\\'ab\\'82\\'e9\\'82\\'e6\\'82\\'a4\\'82\\'c9\\'82\\'c8\\'82\\'c1\\'82\\'c4\\'82\\'a2\\'82\\'e9\\'82\\'c8\\\n\\'82\\'e7\\'82\\'ce\\'81\\'41\\'91\\'e6\\'8e\\'4f\\'8e\\'d2\\'82\\'aa\\'83\\'49\\'83\\'75\\'83\\'57\\'83\\'46\\'83\\'4e\\'83\\'67\\'83\\'52\\'81\\'5b\\'83\\'68\\'82\\'c6\\'88\\'ea\\'8f\\'8f\\'82\\'c9\\'83\\'5c\\'81\\'5b\\'83\\'58\\'82\\'e0\\'8b\\'ad\\'90\\'a7\\'93\\'49\\'82\\'c9\\'83\\'52\\'83\\'73\\'81\\'5b\\'82\\'b3\\'82\\'b9\\'82\\'e7\\'82\\'ea\\\n\\'82\\'e9\\'82\\'e6\\'82\\'a4\\'82\\'c9\\'82\\'c8\\'82\\'c1\\'82\\'c4\\'82\\'a2\\'82\\'c8\\'82\\'ad\\'82\\'c4\\'82\\'e0\\'83\\'5c\\'81\\'5b\\'83\\'58\\'83\\'52\\'81\\'5b\\'83\\'68\\'94\\'d0\\'95\\'7a\\'82\\'cc\\'8f\\'f0\\'8c\\'8f\\'82\\'f0\\'96\\'9e\\'82\\'bd\\'82\\'b5\\'82\\'c4\\'82\\'a2\\'82\\'e9\\'82\\'e0\\'82\\'cc\\'82\\'c6\\'82\\'b7\\'82\\'e9\\'81\\'42\\\n\\\n\\\n\\page \\\n\n\\f0 4.\n\\f1 \\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cd\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'f0\\'81\\'41\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'c9\\'82\\'a8\\'82\\'a2\\'82\\'c4\\'96\\'be\\'8a\\'6d\\'82\\'c9\\'92\\'f1\\'8e\\'a6\\'82\\'b3\\'82\\'ea\\'82\\'bd\\'8d\\'73\\\n\\'88\\'d7\\'82\\'f0\\'8f\\'9c\\'82\\'ab\\'95\\'a1\\'90\\'bb\\'82\\'e2\\'89\\'fc\\'95\\'cf\\'81\\'41\\'83\\'54\\'83\\'75\\'83\\'89\\'83\\'43\\'83\\'5a\\'83\\'93\\'83\\'58\\'81\\'41\\'82\\'a0\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'94\\'d0\\'95\\'7a\\'82\\'b5\\'82\\'c4\\'82\\'cd\\'82\\'c8\\'82\\'e7\\'82\\'c8\\'82\\'a2\\'81\\'42\\'91\\'bc\\'82\\'c9\\\n\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'f0\\'95\\'a1\\'90\\'bb\\'82\\'e2\\'89\\'fc\\'95\\'cf\\'81\\'41\\'83\\'54\\'83\\'75\\'83\\'89\\'83\\'43\\'83\\'5a\\'83\\'93\\'83\\'58\\'81\\'41\\'82\\'a0\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'94\\'d0\\'95\\'7a\\'82\\'b7\\'82\\'e9\\'8a\\'e9\\'82\\'c4\\'82\\'cd\\'82\\'b7\\'82\\'d7\\\n\\'82\\'c4\\'96\\'b3\\'8c\\'f8\\'82\\'c5\\'82\\'a0\\'82\\'e8\\'81\\'41\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'cc\\'89\\'ba\\'82\\'c5\\'82\\'cc\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cc\\'8c\\'a0\\'97\\'98\\'82\\'f0\\'8e\\'a9\\'93\\'ae\\'93\\'49\\'82\\'c9\\'8f\\'49\\'8c\\'8b\\'82\\'b3\\'82\\'b9\\'82\\'e9\\'82\\'b1\\\n\\'82\\'c6\\'82\\'c9\\'82\\'c8\\'82\\'eb\\'82\\'a4\\'81\\'42\\'82\\'b5\\'82\\'a9\\'82\\'b5\\'81\\'41\\'95\\'a1\\'90\\'bb\\'95\\'a8\\'82\\'e2\\'8c\\'a0\\'97\\'98\\'82\\'f0\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'c9\\'8f\\'5d\\'82\\'c1\\'82\\'c4\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'a9\\'82\\'e7\\'93\\'be\\'82\\'bd\\\n\\'90\\'6c\\'81\\'58\\'82\\'c9\\'8a\\'d6\\'82\\'b5\\'82\\'c4\\'82\\'cd\\'81\\'41\\'82\\'bb\\'82\\'cc\\'82\\'e6\\'82\\'a4\\'82\\'c8\\'90\\'6c\\'81\\'58\\'82\\'aa\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'c9\\'8a\\'ae\\'91\\'53\\'82\\'c9\\'8f\\'5d\\'82\\'c1\\'82\\'c4\\'82\\'a2\\'82\\'e9\\'8c\\'c0\\'82\\'e8\\'94\\'de\\\n\\'82\\'e7\\'82\\'cc\\'83\\'89\\'83\\'43\\'83\\'5a\\'83\\'93\\'83\\'58\\'82\\'dc\\'82\\'c5\\'8f\\'49\\'8c\\'8b\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'cd\\'82\\'c8\\'82\\'a2\\'81\\'42\\\n\\\n\n\\f0 5.\n\\f1 \\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cd\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'f0\\'8e\\'f3\\'91\\'f8\\'82\\'b7\\'82\\'e9\\'95\\'4b\\'97\\'76\\'82\\'cd\\'96\\'b3\\'82\\'a2\\'81\\'42\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'82\\'cc\\'82\\'cd\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cd\\'82\\'b1\\\n\\'82\\'ea\\'82\\'c9\\'8f\\'90\\'96\\'bc\\'82\\'b5\\'82\\'c4\\'82\\'a2\\'82\\'c8\\'82\\'a2\\'82\\'a9\\'82\\'e7\\'82\\'c5\\'82\\'a0\\'82\\'e9\\'81\\'42\\'82\\'b5\\'82\\'a9\\'82\\'b5\\'81\\'41\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'88\\'c8\\'8a\\'4f\\'82\\'c9\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'c9\\'91\\'ce\\'82\\'b5\\\n\\'82\\'c4\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'e2\\'82\\'bb\\'82\\'cc\\'94\\'68\\'90\\'b6\\'95\\'a8\\'82\\'f0\\'95\\'cf\\'8d\\'58\\'81\\'41\\'94\\'d0\\'95\\'7a\\'82\\'b7\\'82\\'e9\\'8b\\'96\\'89\\'c2\\'82\\'f0\\'97\\'5e\\'82\\'a6\\'82\\'e9\\'82\\'e0\\'82\\'cc\\'82\\'cd\\'91\\'b6\\'8d\\'dd\\'82\\'b5\\'82\\'c8\\\n\\'82\\'a2\\'81\\'42\\'82\\'b1\\'82\\'ea\\'82\\'e7\\'82\\'cc\\'8d\\'73\\'88\\'d7\\'82\\'cd\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'aa\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'f0\\'8e\\'f3\\'82\\'af\\'93\\'fc\\'82\\'ea\\'82\\'c8\\'82\\'a2\\'8c\\'c0\\'82\\'e8\\'96\\'40\\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\\n\\'8b\\'d6\\'82\\'b6\\'82\\'e7\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'e9\\'81\\'42\\'82\\'bb\\'82\\'b1\\'82\\'c5\\'81\\'41\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\n\\f0 (\n\\f1 \\'82\\'a0\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'f0\\'8a\\'ee\\'82\\'c9\\'82\\'b5\\\n\\'82\\'bd\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'cc\\'82\\'b7\\'82\\'d7\\'82\\'c4\n\\f0 )\n\\f1 \\'82\\'f0\\'89\\'fc\\'95\\'cf\\'82\\'c8\\'82\\'a2\\'82\\'b5\\'94\\'d0\\'95\\'7a\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'c9\\'82\\'e6\\'82\\'e8\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cd\\'8e\\'a9\\'95\\'aa\\'82\\'aa\\'82\\'bb\\'82\\'cc\\'82\\'e6\\\n\\'82\\'a4\\'82\\'c8\\'8d\\'73\\'88\\'d7\\'82\\'f0\\'8d\\'73\\'82\\'a4\\'82\\'bd\\'82\\'df\\'82\\'c9\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'f0\\'8e\\'f3\\'91\\'f8\\'82\\'b5\\'82\\'bd\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'82\\'b1\\'82\\'c6\\'81\\'41\\'82\\'bb\\'82\\'b5\\'82\\'c4\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\\n\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'c6\\'82\\'bb\\'82\\'ea\\'82\\'c9\\'8a\\'ee\\'82\\'c3\\'82\\'ad\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'82\\'cc\\'95\\'a1\\'90\\'bb\\'82\\'e2\\'94\\'d0\\'95\\'7a\\'81\\'41\\'89\\'fc\\'95\\'cf\\'82\\'c9\\'82\\'c2\\'82\\'a2\\'82\\'c4\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'aa\\'89\\'db\\\n\\'82\\'b7\\'90\\'a7\\'96\\'f1\\'82\\'c6\\'8f\\'f0\\'8c\\'8f\\'82\\'f0\\'82\\'b7\\'82\\'d7\\'82\\'c4\\'8e\\'f3\\'82\\'af\\'93\\'fc\\'82\\'ea\\'82\\'bd\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'82\\'b1\\'82\\'c6\\'82\\'f0\\'8e\\'a6\\'82\\'b5\\'82\\'bd\\'82\\'e0\\'82\\'cc\\'82\\'c6\\'8c\\'a9\\'82\\'c8\\'82\\'b7\\'81\\'42\\\n\\\n\n\\f0 6.\n\\f1 \\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'aa\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\n\\f0 (\n\\f1 \\'82\\'dc\\'82\\'bd\\'82\\'cd\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'f0\\'8a\\'ee\\'82\\'c9\\'82\\'b5\\'82\\'bd\\'92\\'98\\'8d\\'ec\\'95\\'a8\\'91\\'53\\'94\\'ca\n\\f0 )\n\\f1 \\'82\\'f0\\\n\\'8d\\'c4\\'94\\'d0\\'95\\'7a\\'82\\'b7\\'82\\'e9\\'82\\'bd\\'82\\'d1\\'82\\'c9\\'81\\'41\\'82\\'bb\\'82\\'cc\\'8e\\'f3\\'97\\'cc\\'8e\\'d2\\'82\\'cd\\'8c\\'b3\\'81\\'58\\'82\\'cc\\'83\\'89\\'83\\'43\\'83\\'5a\\'83\\'93\\'83\\'58\\'8b\\'96\\'89\\'c2\\'8e\\'d2\\'82\\'a9\\'82\\'e7\\'81\\'41\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'c5\\\n\\'8e\\'77\\'92\\'e8\\'82\\'b3\\'82\\'ea\\'82\\'bd\\'8f\\'f0\\'8c\\'8f\\'82\\'c6\\'90\\'a7\\'96\\'f1\\'82\\'cc\\'89\\'ba\\'82\\'c5\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'f0\\'95\\'a1\\'90\\'bb\\'82\\'e2\\'94\\'d0\\'95\\'7a\\'81\\'41\\'82\\'a0\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'89\\'fc\\'95\\'cf\\'82\\'b7\\'82\\'e9\\\n\\'8b\\'96\\'89\\'c2\\'82\\'f0\\'8e\\'a9\\'93\\'ae\\'93\\'49\\'82\\'c9\\'93\\'be\\'82\\'e9\\'82\\'e0\\'82\\'cc\\'82\\'c6\\'82\\'b7\\'82\\'e9\\'81\\'42\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cd\\'81\\'41\\'8e\\'f3\\'97\\'cc\\'8e\\'d2\\'82\\'aa\\'82\\'b1\\'82\\'b1\\'82\\'c5\\'94\\'46\\'82\\'df\\'82\\'e7\\'82\\'ea\\'82\\'bd\\'8c\\'a0\\'97\\'98\\'82\\'f0\\\n\\'8d\\'73\\'8e\\'67\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'c9\\'8a\\'d6\\'82\\'b5\\'82\\'c4\\'82\\'b1\\'82\\'ea\\'88\\'c8\\'8f\\'e3\\'91\\'bc\\'82\\'cc\\'82\\'a2\\'82\\'a9\\'82\\'c8\\'82\\'e9\\'90\\'a7\\'8c\\'c0\\'82\\'e0\\'89\\'db\\'82\\'b7\\'82\\'b1\\'82\\'c6\\'82\\'aa\\'82\\'c5\\'82\\'ab\\'82\\'c8\\'82\\'a2\\'81\\'42\\'82\\'a0\\'82\\'c8\\\n\\'82\\'bd\\'82\\'c9\\'82\\'cd\\'81\\'41\\'91\\'e6\\'8e\\'4f\\'8e\\'d2\\'82\\'aa\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'c9\\'8f\\'5d\\'82\\'a4\\'82\\'b1\\'82\\'c6\\'82\\'f0\\'8b\\'ad\\'90\\'a7\\'82\\'b7\\'82\\'e9\\'90\\'d3\\'94\\'43\\'82\\'cd\\'82\\'c8\\'82\\'a2\\'81\\'42\\\n\\\n\n\\f0 7.\n\\f1 \\'93\\'c1\\'8b\\'96\\'90\\'4e\\'8a\\'51\\'82\\'a0\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'82\\'bb\\'82\\'cc\\'91\\'bc\\'82\\'cc\\'97\\'9d\\'97\\'52\n\\f0 (\n\\f1 \\'93\\'c1\\'8b\\'96\\'8a\\'d6\\'8c\\'57\\'82\\'c9\\'8c\\'c0\\'82\\'e7\\'82\\'c8\\'82\\'a2\n\\f0 )\n\\f1 \\'82\\'a9\\'82\\'e7\\'81\\'41\\'8d\\'d9\\'94\\'bb\\'8f\\'8a\\'82\\'cc\\'94\\'bb\\'8c\\'88\\\n\\'82\\'a0\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'90\\'5c\\'82\\'b5\\'97\\'a7\\'82\\'c4\\'82\\'cc\\'8c\\'8b\\'89\\'ca\\'82\\'c6\\'82\\'b5\\'82\\'c4\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'c9\n\\f0 (\n\\f1 \\'8d\\'d9\\'94\\'bb\\'8f\\'8a\\'96\\'bd\\'97\\'df\\'82\\'e2\\'8c\\'5f\\'96\\'f1\\'82\\'c8\\'82\\'c7\\'82\\'c9\\'82\\'e6\\'82\\'e8\n\\f0 )\n\\f1 \\'82\\'b1\\'82\\'cc\\'8c\\'5f\\\n\\'96\\'f1\\'8f\\'91\\'82\\'cc\\'8f\\'f0\\'8c\\'8f\\'82\\'c6\\'96\\'b5\\'8f\\'82\\'82\\'b7\\'82\\'e9\\'90\\'a7\\'96\\'f1\\'82\\'aa\\'89\\'db\\'82\\'b3\\'82\\'ea\\'82\\'bd\\'8f\\'ea\\'8d\\'87\\'82\\'c5\\'82\\'e0\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'aa\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'cc\\'8f\\'f0\\'8c\\'8f\\'82\\'f0\\\n\\'96\\'c6\\'8f\\'9c\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'82\\'ed\\'82\\'af\\'82\\'c5\\'82\\'cd\\'82\\'c8\\'82\\'a2\\'81\\'42\\'82\\'e0\\'82\\'b5\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'cc\\'89\\'ba\\'82\\'c5\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'c9\\'89\\'db\\'82\\'b9\\'82\\'e7\\'82\\'ea\\'82\\'bd\\'90\\'d3\\'94\\'43\\'82\\'c6\\'91\\'bc\\\n\\'82\\'cc\\'8a\\'d6\\'98\\'41\\'82\\'b7\\'82\\'e9\\'90\\'d3\\'94\\'43\\'82\\'f0\\'93\\'af\\'8e\\'9e\\'82\\'c9\\'96\\'9e\\'82\\'bd\\'82\\'b7\\'82\\'e6\\'82\\'a4\\'82\\'c8\\'8c\\'60\\'82\\'c5\\'94\\'d0\\'95\\'7a\\'82\\'c5\\'82\\'ab\\'82\\'c8\\'82\\'a2\\'82\\'c8\\'82\\'e7\\'82\\'ce\\'81\\'41\\'8c\\'8b\\'89\\'ca\\'82\\'c6\\'82\\'b5\\'82\\'c4\\'82\\'a0\\\n\\'82\\'c8\\'82\\'bd\\'82\\'cd\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'f0\\'94\\'d0\\'95\\'7a\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'aa\\'91\\'53\\'82\\'ad\\'82\\'c5\\'82\\'ab\\'82\\'c8\\'82\\'a2\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'82\\'b1\\'82\\'c6\\'82\\'c5\\'82\\'a0\\'82\\'e9\\'81\\'42\\'97\\'e1\\'82\\'a6\\\n\\'82\\'ce\\'93\\'c1\\'8b\\'96\\'83\\'89\\'83\\'43\\'83\\'5a\\'83\\'93\\'83\\'58\\'82\\'aa\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'a9\\'82\\'e7\\'92\\'bc\\'90\\'da\\'8a\\'d4\\'90\\'da\\'82\\'f0\\'96\\'e2\\'82\\'ed\\'82\\'b8\\'83\\'52\\'83\\'73\\'81\\'5b\\'82\\'f0\\'8e\\'f3\\'82\\'af\\'8e\\'e6\\'82\\'c1\\'82\\'bd\\'90\\'6c\\'82\\'aa\\'92\\'4e\\\n\\'82\\'c5\\'82\\'e0\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'f0\\'8e\\'67\\'97\\'70\\'97\\'bf\\'96\\'b3\\'97\\'bf\\'82\\'c5\\'8d\\'c4\\'94\\'d0\\'95\\'7a\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'f0\\'94\\'46\\'82\\'df\\'82\\'c4\\'82\\'a2\\'82\\'c8\\'82\\'a2\\'8f\\'ea\\'8d\\'87\\'81\\'41\\'82\\'a0\\'82\\'c8\\\n\\'82\\'bd\\'82\\'aa\\'82\\'bb\\'82\\'cc\\'90\\'a7\\'96\\'f1\\'82\\'c6\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'f0\\'97\\'bc\\'95\\'fb\\'82\\'c6\\'82\\'e0\\'96\\'9e\\'82\\'bd\\'82\\'b7\\'82\\'c9\\'82\\'cd\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'cc\\'94\\'d0\\'95\\'7a\\'82\\'f0\\'8a\\'ae\\'91\\'53\\\n\\'82\\'c9\\'92\\'86\\'8e\\'7e\\'82\\'b7\\'82\\'e9\\'82\\'b5\\'82\\'a9\\'82\\'c8\\'82\\'a2\\'82\\'be\\'82\\'eb\\'82\\'a4\\'81\\'42\\\n\\\n\\'82\\'b1\\'82\\'cc\\'90\\'df\\'82\\'cc\\'88\\'ea\\'95\\'94\\'95\\'aa\\'82\\'aa\\'93\\'c1\\'92\\'e8\\'82\\'cc\\'8f\\'f3\\'8b\\'b5\\'82\\'cc\\'89\\'ba\\'82\\'c5\\'96\\'b3\\'8c\\'f8\\'82\\'c8\\'82\\'a2\\'82\\'b5\\'8e\\'c0\\'8e\\'7b\\'95\\'73\\'89\\'c2\\'94\\'5c\\'82\\'c8\\'8f\\'ea\\'8d\\'87\\'82\\'c5\\'82\\'e0\\'81\\'41\\'90\\'df\\'82\\'cc\\'8e\\'63\\\n\\'82\\'e8\\'82\\'cc\\'95\\'94\\'95\\'aa\\'82\\'cd\\'93\\'4b\\'97\\'70\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'82\\'e6\\'82\\'a4\\'88\\'d3\\'90\\'7d\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'e9\\'81\\'42\\'82\\'bb\\'82\\'cc\\'91\\'bc\\'82\\'cc\\'8f\\'f3\\'8b\\'b5\\'82\\'c5\\'82\\'cd\\'90\\'df\\'82\\'aa\\'91\\'53\\'91\\'cc\\'82\\'c6\\'82\\'b5\\'82\\'c4\\\n\\'93\\'4b\\'97\\'70\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'82\\'e6\\'82\\'a4\\'88\\'d3\\'90\\'7d\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'e9\\'81\\'42\\\n\\\n\\'93\\'c1\\'8b\\'96\\'82\\'e2\\'82\\'bb\\'82\\'cc\\'91\\'bc\\'82\\'cc\\'8d\\'e0\\'8e\\'59\\'8c\\'a0\\'82\\'f0\\'90\\'4e\\'8a\\'51\\'82\\'b5\\'82\\'bd\\'82\\'e8\\'81\\'41\\'82\\'bb\\'82\\'cc\\'82\\'e6\\'82\\'a4\\'82\\'c8\\'8c\\'a0\\'97\\'98\\'82\\'cc\\'8e\\'e5\\'92\\'a3\\'82\\'cc\\'8c\\'f8\\'97\\'cd\\'82\\'c9\\'88\\'d9\\'8b\\'63\\'82\\'f0\\'8f\\'a5\\\n\\'82\\'a6\\'82\\'bd\\'82\\'e8\\'82\\'b7\\'82\\'e9\\'82\\'e6\\'82\\'a4\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'f0\\'97\\'55\\'98\\'66\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'aa\\'82\\'b1\\'82\\'cc\\'90\\'df\\'82\\'cc\\'96\\'da\\'93\\'49\\'82\\'c5\\'82\\'cd\\'82\\'c8\\'82\\'a2\\'81\\'42\\'82\\'b1\\'82\\'cc\\'90\\'df\\'82\\'c9\\'82\\'cd\\'81\\'41\\\n\\'90\\'6c\\'81\\'58\\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'83\\'89\\'83\\'43\\'83\\'5a\\'83\\'93\\'83\\'58\\'8a\\'b5\\'8d\\'73\\'82\\'c6\\'82\\'b5\\'82\\'c4\\'8e\\'c0\\'8c\\'bb\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'ab\\'82\\'bd\\'81\\'41\\'83\\'74\\'83\\'8a\\'81\\'5b\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'94\\'d0\\'95\\'7a\\\n\\'82\\'cc\\'83\\'56\\'83\\'58\\'83\\'65\\'83\\'80\\'82\\'cc\\'8a\\'ae\\'91\\'53\\'90\\'ab\\'82\\'f0\\'8c\\'ec\\'82\\'e9\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'96\\'da\\'93\\'49\\'82\\'b5\\'82\\'a9\\'82\\'c8\\'82\\'a2\\'81\\'42\\'91\\'bd\\'82\\'ad\\'82\\'cc\\'90\\'6c\\'81\\'58\\'82\\'aa\\'81\\'41\\'83\\'74\\'83\\'8a\\'81\\'5b\\'83\\'5c\\'83\\'74\\'83\\'67\\\n\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'cc\\'94\\'d0\\'95\\'7a\\'83\\'56\\'83\\'58\\'83\\'65\\'83\\'80\\'82\\'aa\\'8e\\'f1\\'94\\'f6\\'88\\'ea\\'8a\\'d1\\'82\\'b5\\'82\\'c4\\'93\\'4b\\'97\\'70\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'e9\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'90\\'4d\\'97\\'8a\\'82\\'c9\\'8a\\'ee\\'82\\'c3\\'82\\'ab\\'81\\'41\\'82\\'b1\\\n\\'82\\'cc\\'83\\'56\\'83\\'58\\'83\\'65\\'83\\'80\\'82\\'f0\\'92\\'ca\\'82\\'b6\\'82\\'c4\\'94\\'d0\\'95\\'7a\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'91\\'bd\\'97\\'6c\\'82\\'c8\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'c9\\'8a\\'b0\\'91\\'e5\\'82\\'c8\\'8d\\'76\\'8c\\'a3\\'82\\'f0\\'82\\'b5\\'82\\'c4\\'82\\'ab\\'82\\'bd\\'82\\'cc\\\n\\'82\\'cd\\'8e\\'96\\'8e\\'c0\\'82\\'c5\\'82\\'a0\\'82\\'e9\\'82\\'aa\\'81\\'41\\'90\\'6c\\'82\\'aa\\'82\\'c7\\'82\\'cc\\'82\\'e6\\'82\\'a4\\'82\\'c8\\'83\\'56\\'83\\'58\\'83\\'65\\'83\\'80\\'82\\'f0\\'92\\'ca\\'82\\'b6\\'82\\'c4\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'f0\\'94\\'d0\\'95\\'7a\\'82\\'b5\\'82\\'bd\\'82\\'a2\\\n\\'82\\'c6\\'8e\\'76\\'82\\'a4\\'82\\'a9\\'82\\'cd\\'82\\'a0\\'82\\'ad\\'82\\'dc\\'82\\'c5\\'82\\'e0\\'8d\\'ec\\'8e\\'d2\n\\f0 /\n\\f1 \\'8a\\'f1\\'97\\'5e\\'8e\\'d2\\'8e\\'9f\\'91\\'e6\\'82\\'c5\\'82\\'a0\\'82\\'e8\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'aa\\'91\\'49\\'91\\'f0\\'82\\'f0\\'89\\'9f\\'82\\'b5\\'82\\'c2\\'82\\'af\\'82\\'e9\\'82\\'b1\\\n\\'82\\'c6\\'82\\'cd\\'82\\'c5\\'82\\'ab\\'82\\'c8\\'82\\'a2\\'81\\'42\\\n\\\n\\'82\\'b1\\'82\\'cc\\'90\\'df\\'82\\'cd\\'81\\'41\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'cc\\'82\\'b1\\'82\\'cc\\'90\\'df\\'88\\'c8\\'8a\\'4f\\'82\\'cc\\'95\\'94\\'95\\'aa\\'82\\'cc\\'88\\'ea\\'8b\\'41\\'8c\\'8b\\'82\\'c9\\'82\\'c8\\'82\\'e9\\'82\\'c6\\'8d\\'6c\\'82\\'a6\\'82\\'e7\\'82\\'ea\\'82\\'e9\\'83\\'50\\'81\\'5b\\\n\\'83\\'58\\'82\\'f0\\'93\\'4f\\'92\\'ea\\'93\\'49\\'82\\'c9\\'96\\'be\\'82\\'e7\\'82\\'a9\\'82\\'c9\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'f0\\'96\\'da\\'93\\'49\\'82\\'c6\\'82\\'b5\\'82\\'c4\\'82\\'a2\\'82\\'e9\\'81\\'42\\\n\\\n\\\n\\page \\\n\n\\f0 8.\n\\f1 \\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'cc\\'94\\'d0\\'95\\'7a\\'82\\'e2\\'97\\'98\\'97\\'70\\'82\\'aa\\'81\\'41\\'82\\'a0\\'82\\'e9\\'8d\\'91\\'82\\'c9\\'82\\'a8\\'82\\'a2\\'82\\'c4\\'82\\'cd\\'93\\'c1\\'8b\\'96\\'82\\'dc\\'82\\'bd\\'82\\'cd\\'92\\'98\\'8d\\'ec\\'8c\\'a0\\'82\\'aa\\'8e\\'e5\\\n\\'92\\'a3\\'82\\'b3\\'82\\'ea\\'82\\'bd\\'83\\'43\\'83\\'93\\'83\\'5e\\'81\\'5b\\'83\\'74\\'83\\'46\\'81\\'5b\\'83\\'58\\'82\\'cc\\'82\\'a2\\'82\\'b8\\'82\\'ea\\'82\\'a9\\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'90\\'a7\\'8c\\'c0\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'e9\\'8f\\'ea\\'8d\\'87\\'81\\'41\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\\n\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'c9\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'f0\\'93\\'4b\\'97\\'70\\'82\\'b5\\'82\\'bd\\'8c\\'b3\\'82\\'cc\\'92\\'98\\'8d\\'ec\\'8c\\'a0\\'8e\\'d2\\'82\\'cd\\'81\\'41\\'82\\'bb\\'82\\'a4\\'82\\'a2\\'82\\'c1\\'82\\'bd\\'8d\\'91\\'81\\'58\\'82\\'f0\\'94\\'72\\'8f\\'9c\\'82\\'b5\\\n\\'82\\'bd\\'96\\'be\\'8a\\'6d\\'82\\'c8\\'92\\'6e\\'97\\'9d\\'93\\'49\\'94\\'d0\\'95\\'7a\\'90\\'a7\\'8c\\'c0\\'82\\'f0\\'89\\'c1\\'82\\'a6\\'81\\'41\\'82\\'bb\\'82\\'b1\\'82\\'c5\\'94\\'72\\'8f\\'9c\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'c8\\'82\\'a2\\'8d\\'91\\'82\\'cc\\'92\\'86\\'82\\'e2\\'82\\'bb\\'82\\'ea\\'82\\'e7\\'82\\'cc\\'8d\\'91\\'81\\'58\\\n\\'82\\'cc\\'8a\\'d4\\'82\\'c5\\'82\\'cc\\'82\\'dd\\'94\\'d0\\'95\\'7a\\'82\\'aa\\'8b\\'96\\'89\\'c2\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'82\\'e6\\'82\\'a4\\'82\\'c9\\'82\\'b5\\'82\\'c4\\'82\\'e0\\'8d\\'5c\\'82\\'ed\\'82\\'c8\\'82\\'a2\\'81\\'42\\'82\\'bb\\'82\\'cc\\'8f\\'ea\\'8d\\'87\\'81\\'41\\'82\\'bb\\'82\\'cc\\'82\\'e6\\'82\\'a4\\'82\\'c8\\'90\\'a7\\\n\\'8c\\'c0\\'82\\'cd\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'96\\'7b\\'95\\'b6\\'82\\'c5\\'8f\\'91\\'82\\'a9\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'e9\\'82\\'cc\\'82\\'c6\\'93\\'af\\'97\\'6c\\'82\\'c9\\'8c\\'a9\\'82\\'c8\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'81\\'42\\\n\\\n\n\\f0 9.\n\\f1 \\'83\\'74\\'83\\'8a\\'81\\'5b\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'8d\\'e0\\'92\\'63\\'82\\'cd\\'81\\'41\\'8e\\'9e\\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'89\\'fc\\'92\\'f9\\'82\\'dc\\'82\\'bd\\'82\\'cd\\'90\\'56\\'94\\'c5\\'82\\'cc\\'88\\'ea\\'94\\'ca\\'8c\\'f6\\'8f\\'4f\\'97\\'98\\'97\\'70\\'8b\\'96\\\n\\'91\\'f8\\'8f\\'91\\'82\\'f0\\'94\\'ad\\'95\\'5c\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'aa\\'82\\'c5\\'82\\'ab\\'82\\'e9\\'81\\'42\\'82\\'bb\\'82\\'cc\\'82\\'e6\\'82\\'a4\\'82\\'c8\\'90\\'56\\'94\\'c5\\'82\\'cd\\'8c\\'bb\\'8d\\'dd\\'82\\'cc\\'83\\'6f\\'81\\'5b\\'83\\'57\\'83\\'87\\'83\\'93\\'82\\'c6\\'82\\'bb\\'82\\'cc\\'90\\'b8\\'90\\'5f\\\n\\'82\\'c9\\'82\\'a8\\'82\\'a2\\'82\\'c4\\'82\\'cd\\'8e\\'97\\'82\\'bd\\'82\\'e0\\'82\\'cc\\'82\\'c9\\'82\\'c8\\'82\\'e9\\'82\\'be\\'82\\'eb\\'82\\'a4\\'82\\'aa\\'81\\'41\\'90\\'56\\'82\\'bd\\'82\\'c8\\'96\\'e2\\'91\\'e8\\'82\\'e2\\'8c\\'9c\\'94\\'4f\\'82\\'f0\\'89\\'f0\\'8c\\'88\\'82\\'b7\\'82\\'e9\\'82\\'bd\\'82\\'df\\'8d\\'d7\\'95\\'94\\'82\\'c5\\\n\\'82\\'cd\\'88\\'d9\\'82\\'c8\\'82\\'e9\\'89\\'c2\\'94\\'5c\\'90\\'ab\\'82\\'aa\\'82\\'a0\\'82\\'e9\\'81\\'42\\\n\\\n\\'82\\'bb\\'82\\'ea\\'82\\'bc\\'82\\'ea\\'82\\'cc\\'83\\'6f\\'81\\'5b\\'83\\'57\\'83\\'87\\'83\\'93\\'82\\'c9\\'82\\'cd\\'81\\'41\\'8c\\'a9\\'95\\'aa\\'82\\'af\\'82\\'aa\\'95\\'74\\'82\\'ad\\'82\\'e6\\'82\\'a4\\'82\\'c9\\'83\\'6f\\'81\\'5b\\'83\\'57\\'83\\'87\\'83\\'93\\'94\\'d4\\'8d\\'86\\'82\\'aa\\'90\\'55\\'82\\'e7\\'82\\'ea\\'82\\'c4\\'82\\'a2\\\n\\'82\\'e9\\'81\\'42\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'c9\\'82\\'a8\\'82\\'a2\\'82\\'c4\\'82\\'bb\\'82\\'ea\\'82\\'c9\\'93\\'4b\\'97\\'70\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'cc\\'83\\'6f\\'81\\'5b\\'83\\'57\\'83\\'87\\'83\\'93\\'94\\'d4\\'8d\\'86\\'82\\'aa\\\n\\'8e\\'77\\'92\\'e8\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'c4\\'81\\'41\\'8d\\'58\\'82\\'c9\\'81\\'75\\'82\\'bb\\'82\\'ea\\'88\\'c8\\'8d\\'7e\\'82\\'cc\\'82\\'a2\\'82\\'a9\\'82\\'c8\\'82\\'e9\\'83\\'6f\\'81\\'5b\\'83\\'57\\'83\\'87\\'83\\'93\\'81\\'76\\'82\\'e0\\'93\\'4b\\'97\\'70\\'82\\'b5\\'82\\'c4\\'97\\'c7\\'82\\'a2\\'82\\'c6\\'82\\'c8\\'82\\'c1\\\n\\'82\\'c4\\'82\\'a2\\'82\\'bd\\'8f\\'ea\\'8d\\'87\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cd\\'8f\\'5d\\'82\\'a4\\'8f\\'f0\\'8c\\'8f\\'82\\'c6\\'90\\'a7\\'96\\'f1\\'82\\'c6\\'82\\'b5\\'82\\'c4\\'81\\'41\\'8e\\'77\\'92\\'e8\\'82\\'cc\\'83\\'6f\\'81\\'5b\\'83\\'57\\'83\\'87\\'83\\'93\\'82\\'a9\\'81\\'41\\'83\\'74\\'83\\'8a\\'81\\'5b\\'83\\'5c\\\n\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'8d\\'e0\\'92\\'63\\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'94\\'ad\\'8d\\'73\\'82\\'b3\\'82\\'ea\\'82\\'bd\\'8e\\'77\\'92\\'e8\\'82\\'cc\\'83\\'6f\\'81\\'5b\\'83\\'57\\'83\\'87\\'83\\'93\\'88\\'c8\\'8d\\'7e\\'82\\'cc\\'94\\'c5\\'82\\'cc\\'82\\'c7\\'82\\'ea\\'82\\'a9\\'88\\'ea\\'82\\'c2\\'82\\'cc\\\n\\'82\\'c7\\'82\\'bf\\'82\\'e7\\'82\\'a9\\'82\\'f0\\'91\\'49\\'82\\'d4\\'82\\'b1\\'82\\'c6\\'82\\'aa\\'8f\\'6f\\'97\\'88\\'82\\'e9\\'81\\'42\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'c5\\'83\\'89\\'83\\'43\\'83\\'5a\\'83\\'93\\'83\\'58\\'82\\'cc\\'83\\'6f\\'81\\'5b\\'83\\'57\\'83\\'87\\'83\\'93\\'94\\'d4\\'8d\\'86\\\n\\'82\\'aa\\'8e\\'77\\'92\\'e8\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'c8\\'82\\'a2\\'82\\'c8\\'82\\'e7\\'82\\'ce\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cd\\'8d\\'a1\\'82\\'dc\\'82\\'c5\\'82\\'c9\\'83\\'74\\'83\\'8a\\'81\\'5b\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'8d\\'e0\\'92\\'63\\'82\\'a9\\'82\\'e7\\'94\\'ad\\\n\\'8d\\'73\\'82\\'b3\\'82\\'ea\\'82\\'bd\\'83\\'6f\\'81\\'5b\\'83\\'57\\'83\\'87\\'83\\'93\\'82\\'cc\\'92\\'86\\'82\\'a9\\'82\\'e7\\'8d\\'44\\'82\\'ab\\'82\\'c9\\'91\\'49\\'82\\'f1\\'82\\'c5\\'8d\\'5c\\'82\\'ed\\'82\\'c8\\'82\\'a2\\'81\\'42\\\n\\\n\n\\f0 10.\n\\f1 \\'82\\'e0\\'82\\'b5\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'aa\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'cc\\'88\\'ea\\'95\\'94\\'82\\'f0\\'81\\'41\\'82\\'bb\\'82\\'cc\\'94\\'d0\\'95\\'7a\\'8f\\'f0\\'8c\\'8f\\'82\\'aa\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'c6\\\n\\'88\\'d9\\'82\\'c8\\'82\\'e9\\'91\\'bc\\'82\\'cc\\'83\\'74\\'83\\'8a\\'81\\'5b\\'82\\'c8\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'c6\\'93\\'9d\\'8d\\'87\\'82\\'b5\\'82\\'bd\\'82\\'a2\\'82\\'c8\\'82\\'e7\\'82\\'ce\\'81\\'41\\'8d\\'ec\\'8e\\'d2\\'82\\'c9\\'98\\'41\\'97\\'8d\\'82\\'b5\\'82\\'c4\\'8b\\'96\\'89\\'c2\\'82\\'f0\\'8b\\'81\\\n\\'82\\'df\\'82\\'e6\\'81\\'42\\'83\\'74\\'83\\'8a\\'81\\'5b\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'8d\\'e0\\'92\\'63\\'82\\'aa\\'92\\'98\\'8d\\'ec\\'8c\\'a0\\'82\\'f0\\'95\\'db\\'97\\'4c\\'82\\'b7\\'82\\'e9\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'c9\\'82\\'c2\\'82\\'a2\\'82\\'c4\\'82\\'cd\\'81\\'41\\\n\\'83\\'74\\'83\\'8a\\'81\\'5b\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'8d\\'e0\\'92\\'63\\'82\\'c9\\'98\\'41\\'97\\'8d\\'82\\'b9\\'82\\'e6\\'81\\'42\\'8e\\'84\\'82\\'bd\\'82\\'bf\\'82\\'cd\\'81\\'41\\'82\\'b1\\'82\\'cc\\'82\\'e6\\'82\\'a4\\'82\\'c8\\'8f\\'ea\\'8d\\'87\\'82\\'cc\\'82\\'bd\\'82\\'df\\'82\\'c9\\'93\\'c1\\'95\\'ca\\\n\\'82\\'c8\\'97\\'e1\\'8a\\'4f\\'82\\'f0\\'90\\'dd\\'82\\'af\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'e0\\'82\\'a0\\'82\\'e9\\'81\\'42\\'8e\\'84\\'82\\'bd\\'82\\'bf\\'82\\'aa\\'8c\\'88\\'92\\'e8\\'82\\'f0\\'89\\'ba\\'82\\'b7\\'82\\'c9\\'82\\'a0\\'82\\'bd\\'82\\'c1\\'82\\'c4\\'82\\'cd\\'81\\'41\\'8e\\'84\\'82\\'bd\\'82\\'bf\\'82\\'cc\\'83\\'74\\'83\\'8a\\'81\\'5b\\\n\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'cc\\'94\\'68\\'90\\'b6\\'95\\'a8\\'82\\'b7\\'82\\'d7\\'82\\'c4\\'82\\'aa\\'83\\'74\\'83\\'8a\\'81\\'5b\\'82\\'c8\\'8f\\'f3\\'91\\'d4\\'82\\'c9\\'95\\'db\\'82\\'bd\\'82\\'ea\\'82\\'e9\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'82\\'b1\\'82\\'c6\\'82\\'c6\\'81\\'41\\'88\\'ea\\'94\\'ca\\'93\\'49\\\n\\'82\\'c9\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'cc\\'8b\\'a4\\'97\\'4c\\'82\\'c6\\'8d\\'c4\\'97\\'98\\'97\\'70\\'82\\'f0\\'91\\'a3\\'90\\'69\\'82\\'b7\\'82\\'e9\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'93\\'f1\\'82\\'c2\\'82\\'cc\\'96\\'da\\'95\\'57\\'82\\'f0\\'8b\\'4b\\'8f\\'80\\'82\\'c9\\'8c\\'9f\\'93\\'a2\\'82\\'b3\\'82\\'ea\\\n\\'82\\'e9\\'82\\'c5\\'82\\'a0\\'82\\'eb\\'82\\'a4\\'81\\'42\\\n\n\\f0\n\\f1 \\'96\\'b3\\'95\\'db\\'8f\\'d8\\'82\\'c9\\'82\\'c2\\'82\\'a2\\'82\\'c4\\\n\\\n\n\\f0 11.\n\\f1 \\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'cd\\'91\\'e3\\'89\\'bf\\'96\\'b3\\'82\\'b5\\'82\\'c9\\'97\\'98\\'97\\'70\\'82\\'aa\\'8b\\'96\\'89\\'c2\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'82\\'cc\\'82\\'c5\\'81\\'41\\'93\\'4b\\'90\\'d8\\'82\\'c8\\'96\\'40\\'82\\'aa\\'94\\'46\\'82\\'df\\'82\\'e9\\'8c\\'c0\\\n\\'82\\'e8\\'82\\'c9\\'82\\'a8\\'82\\'a2\\'82\\'c4\\'81\\'41\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'c9\\'8a\\'d6\\'82\\'b7\\'82\\'e9\\'82\\'a2\\'82\\'a9\\'82\\'c8\\'82\\'e9\\'95\\'db\\'8f\\'d8\\'82\\'e0\\'91\\'b6\\'8d\\'dd\\'82\\'b5\\'82\\'c8\\'82\\'a2\\'81\\'42\\'8f\\'91\\'96\\'ca\\'82\\'c5\\'95\\'ca\\'82\\'c9\\\n\\'8f\\'71\\'82\\'d7\\'82\\'e9\\'8f\\'ea\\'8d\\'87\\'82\\'f0\\'8f\\'9c\\'82\\'a2\\'82\\'c4\\'81\\'41\\'92\\'98\\'8d\\'ec\\'8c\\'a0\\'8e\\'d2\\'81\\'41\\'82\\'dc\\'82\\'bd\\'82\\'cd\\'82\\'bb\\'82\\'cc\\'91\\'bc\\'82\\'cc\\'92\\'63\\'91\\'cc\\'82\\'cd\\'81\\'41\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'f0\\'81\\'41\\\n\\'95\\'5c\\'96\\'be\\'82\\'b3\\'82\\'ea\\'82\\'bd\\'82\\'a9\\'8c\\'be\\'8a\\'4f\\'82\\'c9\\'82\\'a9\\'82\\'cd\\'96\\'e2\\'82\\'ed\\'82\\'b8\\'81\\'41\\'8f\\'a4\\'8b\\'c6\\'93\\'49\\'93\\'4b\\'90\\'ab\\'82\\'f0\\'95\\'db\\'8f\\'d8\\'82\\'b7\\'82\\'e9\\'82\\'d9\\'82\\'cc\\'82\\'df\\'82\\'a9\\'82\\'b5\\'82\\'e2\\'82\\'a0\\'82\\'e9\\'93\\'c1\\'92\\'e8\\\n\\'82\\'cc\\'96\\'da\\'93\\'49\\'82\\'d6\\'82\\'cc\\'93\\'4b\\'8d\\'87\\'90\\'ab\n\\f0 (\n\\f1 \\'82\\'c9\\'8c\\'c0\\'82\\'e7\\'82\\'ea\\'82\\'c8\\'82\\'a2\n\\f0 )\n\\f1 \\'82\\'f0\\'8a\\'dc\\'82\\'de\\'88\\'ea\\'90\\'d8\\'82\\'cc\\'95\\'db\\'8f\\'d8\\'96\\'b3\\'82\\'b5\\'82\\'c9\\'81\\'75\\'82\\'a0\\'82\\'e9\\'82\\'aa\\'82\\'dc\\'82\\'dc\\'81\\'76\\'82\\'c5\\'92\\'f1\\\n\\'8b\\'9f\\'82\\'b7\\'82\\'e9\\'81\\'42\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'cc\\'8e\\'bf\\'82\\'c6\\'90\\'ab\\'94\\'5c\\'82\\'c9\\'8a\\'d6\\'82\\'b7\\'82\\'e9\\'83\\'8a\\'83\\'58\\'83\\'4e\\'82\\'cc\\'82\\'b7\\'82\\'d7\\'82\\'c4\\'82\\'cd\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'c9\\'8b\\'41\\'91\\'ae\\'82\\'b7\\\n\\'82\\'e9\\'81\\'42\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'c9\\'8c\\'87\\'8a\\'d7\\'82\\'aa\\'82\\'a0\\'82\\'e9\\'82\\'c6\\'94\\'bb\\'96\\'be\\'82\\'b5\\'82\\'bd\\'8f\\'ea\\'8d\\'87\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cd\\'95\\'4b\\'97\\'76\\'82\\'c8\\'95\\'db\\'8e\\'e7\\'93\\'5f\\'8c\\'9f\\'82\\'e2\\\n\\'95\\'e2\\'8f\\'43\\'81\\'41\\'8f\\'43\\'90\\'b3\\'82\\'c9\\'97\\'76\\'82\\'b7\\'82\\'e9\\'83\\'52\\'83\\'58\\'83\\'67\\'82\\'cc\\'82\\'b7\\'82\\'d7\\'82\\'c4\\'82\\'f0\\'88\\'f8\\'82\\'ab\\'8e\\'f3\\'82\\'af\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'c9\\'82\\'c8\\'82\\'e9\\'81\\'42\\\n\\\n\n\\f0 12.\n\\f1 \\'93\\'4b\\'90\\'d8\\'82\\'c8\\'96\\'40\\'82\\'a9\\'8f\\'91\\'96\\'ca\\'82\\'c5\\'82\\'cc\\'93\\'af\\'88\\'d3\\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'96\\'bd\\'82\\'ba\\'82\\'e7\\'82\\'ea\\'82\\'c8\\'82\\'a2\\'8c\\'c0\\'82\\'e8\\'81\\'41\\'92\\'98\\'8d\\'ec\\'8c\\'a0\\'8e\\'d2\\'81\\'41\\'82\\'dc\\'82\\'bd\\'82\\'cd\\'8f\\'e3\\\n\\'8b\\'4c\\'82\\'c5\\'8b\\'96\\'89\\'c2\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'e9\\'92\\'ca\\'82\\'e8\\'82\\'c9\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'f0\\'89\\'fc\\'95\\'cf\\'82\\'dc\\'82\\'bd\\'82\\'cd\\'8d\\'c4\\'94\\'d0\\'95\\'7a\\'82\\'b5\\'82\\'bd\\'82\\'bb\\'82\\'cc\\'91\\'bc\\'82\\'cc\\'92\\'63\\\n\\'91\\'cc\\'82\\'cd\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'c9\\'91\\'ce\\'82\\'b5\\'82\\'c4\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'cc\\'97\\'98\\'97\\'70\\'82\\'c8\\'82\\'a2\\'82\\'b5\\'97\\'98\\'97\\'70\\'95\\'73\\'94\\'5c\\'82\\'c5\\'90\\'b6\\'82\\'b6\\'82\\'bd\\'88\\'ea\\'94\\'ca\\'93\\'49\\'81\\'41\\\n\\'93\\'c1\\'95\\'ca\\'93\\'49\\'81\\'41\\'8b\\'f4\\'91\\'52\\'93\\'49\\'81\\'41\\'95\\'4b\\'91\\'52\\'93\\'49\\'82\\'c8\\'91\\'b9\\'8a\\'51\n\\f0 (\n\\f1 \\'83\\'66\\'81\\'5b\\'83\\'5e\\'82\\'cc\\'8f\\'c1\\'8e\\'b8\\'82\\'e2\\'95\\'73\\'90\\'b3\\'8a\\'6d\\'82\\'c8\\'8f\\'88\\'97\\'9d\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'a9\\'91\\'e6\\'8e\\'4f\\\n\\'8e\\'d2\\'82\\'aa\\'94\\'ed\\'82\\'c1\\'82\\'bd\\'91\\'b9\\'8e\\'b8\\'81\\'41\\'82\\'a0\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'81\\'77\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'81\\'78\\'82\\'aa\\'91\\'bc\\'82\\'cc\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'c6\\'88\\'ea\\'8f\\'8f\\'82\\'c9\\'93\\'ae\\'8d\\'ec\\'82\\'b5\\\n\\'82\\'c8\\'82\\'a2\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'95\\'73\\'8b\\'ef\\'8d\\'87\\'82\\'c8\\'82\\'c7\\'82\\'f0\\'8a\\'dc\\'82\\'de\\'82\\'aa\\'82\\'bb\\'82\\'ea\\'82\\'e7\\'82\\'c9\\'8c\\'c0\\'82\\'e7\\'82\\'c8\\'82\\'a2\n\\f0 )\n\\f1 \\'82\\'c9\\'88\\'ea\\'90\\'d8\\'82\\'cc\\'90\\'d3\\'94\\'43\\'82\\'f0\\'95\\'89\\'82\\'ed\\'82\\'c8\\'82\\'a2\\'81\\'42\\\n\\'82\\'bb\\'82\\'cc\\'82\\'e6\\'82\\'a4\\'82\\'c8\\'91\\'b9\\'8a\\'51\\'82\\'aa\\'90\\'b6\\'82\\'b8\\'82\\'e9\\'89\\'c2\\'94\\'5c\\'90\\'ab\\'82\\'c9\\'82\\'c2\\'82\\'a2\\'82\\'c4\\'94\\'de\\'82\\'e7\\'82\\'aa\\'92\\'89\\'8d\\'90\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'bd\\'82\\'c6\\'82\\'b5\\'82\\'c4\\'82\\'e0\\'93\\'af\\'97\\'6c\\'82\\'c5\\\n\\'82\\'a0\\'82\\'e9\\'81\\'42\\\n\\\n\n\\f0\n\\f1 \\'8f\\'f0\\'8c\\'8f\\'82\\'c6\\'90\\'a7\\'96\\'f1\\'8f\\'49\\'82\\'ed\\'82\\'e8\\\n\\\n\\\n\\page \\\n\n\\f0\n\\f1 \\'88\\'c8\\'8f\\'e3\\'82\\'cc\\'8f\\'f0\\'8d\\'80\\'82\\'f0\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cc\\'90\\'56\\'82\\'b5\\'82\\'a2\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'c9\\'93\\'4b\\'97\\'70\\'82\\'b7\\'82\\'e9\\'95\\'fb\\'96\\'40\\\n\\\n\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'aa\\'90\\'56\\'82\\'b5\\'82\\'a2\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'f0\\'8a\\'4a\\'94\\'ad\\'82\\'b5\\'82\\'bd\\'82\\'c6\\'82\\'b5\\'82\\'c4\\'81\\'41\\'8c\\'f6\\'8f\\'4f\\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'82\\'bb\\'82\\'ea\\'82\\'aa\\'97\\'98\\'97\\'70\\'82\\'b3\\'82\\'ea\\'82\\'e9\\\n\\'89\\'c2\\'94\\'5c\\'90\\'ab\\'82\\'f0\\'8d\\'c5\\'91\\'e5\\'82\\'c9\\'82\\'b5\\'82\\'bd\\'82\\'a2\\'82\\'c8\\'82\\'e7\\'81\\'41\\'82\\'bb\\'82\\'cc\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'f0\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'cc\\'8f\\'f0\\'8d\\'80\\'82\\'c9\\'8f\\'5d\\'82\\'c1\\'82\\'c4\\\n\\'92\\'4e\\'82\\'c5\\'82\\'e0\\'8d\\'c4\\'94\\'d0\\'95\\'7a\\'82\\'a0\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'95\\'cf\\'8d\\'58\\'82\\'c5\\'82\\'ab\\'82\\'e9\\'82\\'e6\\'82\\'a4\\'83\\'74\\'83\\'8a\\'81\\'5b\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'c9\\'82\\'b7\\'82\\'e9\\'82\\'cc\\'82\\'aa\\'8d\\'c5\\'91\\'50\\'82\\'c5\\'82\\'b7\\'81\\'42\\\n\\\n\\'82\\'bb\\'82\\'cc\\'82\\'bd\\'82\\'df\\'82\\'c9\\'82\\'cd\\'81\\'41\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'c9\\'88\\'c8\\'89\\'ba\\'82\\'cc\\'82\\'e6\\'82\\'a4\\'82\\'c8\\'95\\'5c\\'8e\\'a6\\'82\\'f0\\'93\\'59\\'95\\'74\\'82\\'b5\\'82\\'c4\\'82\\'ad\\'82\\'be\\'82\\'b3\\'82\\'a2\\'81\\'42\\'82\\'bb\\'82\\'cc\\'8f\\'ea\\'8d\\'87\\'81\\'41\\\n\\'95\\'db\\'8f\\'d8\\'82\\'aa\\'94\\'72\\'8f\\'9c\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'e9\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'82\\'b1\\'82\\'c6\\'82\\'f0\\'8d\\'c5\\'82\\'e0\\'8c\\'f8\\'89\\'ca\\'93\\'49\\'82\\'c9\\'93\\'60\\'82\\'a6\\'82\\'e9\\'82\\'bd\\'82\\'df\\'82\\'c9\\'81\\'41\\'82\\'bb\\'82\\'ea\\'82\\'bc\\'82\\'ea\\'82\\'cc\\'83\\'5c\\'81\\'5b\\\n\\'83\\'58\\'83\\'74\\'83\\'40\\'83\\'43\\'83\\'8b\\'82\\'cc\\'96\\'60\\'93\\'aa\\'82\\'c9\\'95\\'5c\\'8e\\'a6\\'82\\'f0\\'93\\'59\\'95\\'74\\'82\\'b7\\'82\\'ea\\'82\\'ce\\'8d\\'c5\\'82\\'e0\\'88\\'c0\\'91\\'53\\'82\\'c5\\'82\\'b7\\'81\\'42\\'8f\\'ad\\'82\\'c8\\'82\\'ad\\'82\\'c6\\'82\\'e0\\'81\\'41\\'81\\'75\\'92\\'98\\'8d\\'ec\\'8c\\'a0\\'95\\'5c\\\n\\'8e\\'a6\\'81\\'76\\'82\\'c6\\'82\\'a2\\'82\\'a4\\'8d\\'73\\'82\\'c6\\'91\\'53\\'95\\'b6\\'82\\'aa\\'82\\'a0\\'82\\'e9\\'8f\\'ea\\'8f\\'8a\\'82\\'d6\\'82\\'cc\\'83\\'7c\\'83\\'43\\'83\\'93\\'83\\'5e\\'82\\'be\\'82\\'af\\'82\\'cd\\'8a\\'65\\'83\\'74\\'83\\'40\\'83\\'43\\'83\\'8b\\'82\\'c9\\'8a\\'dc\\'82\\'df\\'82\\'c4\\'92\\'75\\'82\\'a2\\'82\\'c4\\\n\\'82\\'ad\\'82\\'be\\'82\\'b3\\'82\\'a2\\'81\\'42\\\n\\\n\n\\f0     <one line to give the program's name and a brief idea of what it does.>\\\n    Copyright (C) <year>  <name of author>\\\n\\\n    This program is free software; you can redistribute it and/or modify\\\n    it under the terms of the GNU General Public License as published by\\\n    the Free Software Foundation; either version 2 of the License, or\\\n    (at your option) any later version.\\\n\\\n    This program is distributed in the hope that it will be useful,\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\n    GNU General Public License for more details.\\\n\\\n    You should have received a copy of the GNU General Public License\\\n    along with this program; if not, write to the Free Software\\\n    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\\\n\\\n    (\n\\f1 \\'96\\'f3\n\\f0 :\\\n\\\n    <\n\\f1 \\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'cc\\'96\\'bc\\'91\\'4f\\'82\\'c6\\'81\\'41\\'82\\'bb\\'82\\'ea\\'82\\'aa\\'89\\'bd\\'82\\'f0\\'82\\'b7\\'82\\'e9\\'82\\'a9\\'82\\'c9\\'82\\'c2\\'82\\'a2\\'82\\'c4\\'82\\'cc\\'8a\\'c8\\'92\\'50\\'82\\'c8\\'90\\'e0\\'96\\'be\\'81\\'42\n\\f0 >\\\n    Copyright (C) <\n\\f1 \\'90\\'bc\\'97\\'ef\\'94\\'4e\n\\f0 >  <\n\\f1 \\'8d\\'ec\\'8e\\'d2\\'82\\'cc\\'96\\'bc\\'91\\'4f\n\\f0 >\\\n\\\n\n\\f1 \\'82\\'b1\\'82\\'cc\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'cd\\'83\\'74\\'83\\'8a\\'81\\'5b\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'c5\\'82\\'b7\\'81\\'42\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cd\\'82\\'b1\\'82\\'ea\\'82\\'f0\\'81\\'41\\'83\\'74\\'83\\'8a\\'81\\'5b\\'83\\'5c\\'83\\'74\\\n\n\\f0\n\\f1 \\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'8d\\'e0\\'92\\'63\\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'94\\'ad\\'8d\\'73\\'82\\'b3\\'82\\'ea\\'82\\'bd\n\\f0  GNU\n\\f1 \\'88\\'ea\\'94\\'ca\\'8c\\'f6\\'8f\\'4f\\'97\\'98\\'97\\'70\\'8b\\'96\\'91\\'f8\\'8c\\'5f\\'96\\'f1\\'8f\\'91\n\\f0 (\n\\f1 \\'83\\'6f\\'81\\'5b\\'83\\'57\\'83\\'87\\\n\n\\f0\n\\f1 \\'83\\'93\n\\f0 2\n\\f1 \\'82\\'a9\\'81\\'41\\'8a\\'f3\\'96\\'5d\\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'82\\'cd\\'82\\'bb\\'82\\'ea\\'88\\'c8\\'8d\\'7e\\'82\\'cc\\'83\\'6f\\'81\\'5b\\'83\\'57\\'83\\'87\\'83\\'93\\'82\\'cc\\'82\\'a4\\'82\\'bf\\'82\\'c7\\'82\\'ea\\'82\\'a9\n\\f0 )\n\\f1 \\'82\\'cc\\'92\\'e8\\'82\\'df\\'82\\'e9\\'8f\\'f0\\'8c\\'8f\\\n\n\\f0\n\\f1 \\'82\\'cc\\'89\\'ba\\'82\\'c5\\'8d\\'c4\\'94\\'d0\\'95\\'7a\\'82\\'dc\\'82\\'bd\\'82\\'cd\\'89\\'fc\\'95\\'cf\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'aa\\'82\\'c5\\'82\\'ab\\'82\\'dc\\'82\\'b7\\'81\\'42\\\n\\\n\n\\f0\n\\f1 \\'82\\'b1\\'82\\'cc\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'cd\\'97\\'4c\\'97\\'70\\'82\\'c5\\'82\\'a0\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'f0\\'8a\\'e8\\'82\\'c1\\'82\\'c4\\'94\\'d0\\'95\\'7a\\'82\\'b3\\'82\\'ea\\'82\\'dc\\'82\\'b7\\'82\\'aa\\'81\\'41\n\\f0 *\n\\f1 \\'91\\'53\\'82\\'ad\\'82\\'cc\\'96\\'b3\\'95\\'db\\\n\n\\f0\n\\f1 \\'8f\\'d8\n\\f0 *\n\\f1 \\'82\\'c5\\'82\\'b7\\'81\\'42\\'8f\\'a4\\'8b\\'c6\\'89\\'c2\\'94\\'5c\\'90\\'ab\\'82\\'cc\\'95\\'db\\'8f\\'d8\\'82\\'e2\\'93\\'c1\\'92\\'e8\\'82\\'cc\\'96\\'da\\'93\\'49\\'82\\'d6\\'82\\'cc\\'93\\'4b\\'8d\\'87\\'90\\'ab\\'82\\'cd\\'81\\'41\\'8c\\'be\\'8a\\'4f\\'82\\'c9\\'8e\\'a6\\'82\\'b3\\'82\\'ea\\'82\\'bd\\\n\n\\f0\n\\f1 \\'82\\'e0\\'82\\'cc\\'82\\'e0\\'8a\\'dc\\'82\\'df\\'91\\'53\\'82\\'ad\\'91\\'b6\\'8d\\'dd\\'82\\'b5\\'82\\'dc\\'82\\'b9\\'82\\'f1\\'81\\'42\\'8f\\'da\\'82\\'b5\\'82\\'ad\\'82\\'cd\n\\f0 GNU\n\\f1 \\'88\\'ea\\'94\\'ca\\'8c\\'f6\\'8f\\'4f\\'97\\'98\\'97\\'70\\'8b\\'96\\'91\\'f8\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'f0\\'82\\'b2\\\n\n\\f0\n\\f1 \\'97\\'97\\'82\\'ad\\'82\\'be\\'82\\'b3\\'82\\'a2\\'81\\'42\\\n\\\n\n\\f0\n\\f1 \\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cd\\'82\\'b1\\'82\\'cc\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'c6\\'8b\\'a4\\'82\\'c9\\'81\\'41\n\\f0 GNU\n\\f1 \\'88\\'ea\\'94\\'ca\\'8c\\'f6\\'8f\\'4f\\'97\\'98\\'97\\'70\\'8b\\'96\\'91\\'f8\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'cc\\'95\\'a1\\'90\\'bb\\'95\\'a8\\'82\\'f0\\\n\n\\f0\n\\f1 \\'88\\'ea\\'95\\'94\\'8e\\'f3\\'82\\'af\\'8e\\'e6\\'82\\'c1\\'82\\'bd\\'82\\'cd\\'82\\'b8\\'82\\'c5\\'82\\'b7\\'81\\'42\\'82\\'e0\\'82\\'b5\\'8e\\'f3\\'82\\'af\\'8e\\'e6\\'82\\'c1\\'82\\'c4\\'82\\'a2\\'82\\'c8\\'82\\'af\\'82\\'ea\\'82\\'ce\\'81\\'41\\'83\\'74\\'83\\'8a\\'81\\'5b\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\\n\n\\f0\n\\f1 \\'83\\'41\\'8d\\'e0\\'92\\'63\\'82\\'dc\\'82\\'c5\\'90\\'bf\\'8b\\'81\\'82\\'b5\\'82\\'c4\\'82\\'ad\\'82\\'be\\'82\\'b3\\'82\\'a2\n\\f0 (\n\\f1 \\'88\\'b6\\'90\\'e6\\'82\\'cd\n\\f0  the Free Software Foundation,\\\n    Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA)\n\\f1 \\'81\\'42\\\n\\\n\n\\f0     )\\\n\\\n\n\\f1 \\'93\\'64\\'8e\\'71\\'82\\'c8\\'82\\'a2\\'82\\'b5\\'8e\\'86\\'82\\'cc\\'83\\'81\\'81\\'5b\\'83\\'8b\\'82\\'c5\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'c9\\'96\\'e2\\'82\\'a2\\'8d\\'87\\'82\\'ed\\'82\\'b9\\'82\\'e9\\'95\\'fb\\'96\\'40\\'82\\'c9\\'82\\'c2\\'82\\'a2\\'82\\'c4\\'82\\'cc\\'8f\\'ee\\'95\\'f1\\'82\\'e0\\'8f\\'91\\'82\\'ab\\'89\\'c1\\'82\\'a6\\\n\\'82\\'dc\\'82\\'b5\\'82\\'e5\\'82\\'a4\\'81\\'42\\\n\\\n\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'aa\\'91\\'ce\\'98\\'62\\'93\\'49\\'82\\'c8\\'82\\'e0\\'82\\'cc\\'82\\'c8\\'82\\'e7\\'82\\'ce\\'81\\'41\\'91\\'ce\\'98\\'62\\'83\\'82\\'81\\'5b\\'83\\'68\\'82\\'c5\\'8b\\'4e\\'93\\'ae\\'82\\'b5\\'82\\'bd\\'8d\\'db\\'82\\'c9\\'8f\\'6f\\'97\\'cd\\'82\\'c6\\'82\\'b5\\'82\\'c4\\'88\\'c8\\'89\\'ba\\\n\\'82\\'cc\\'82\\'e6\\'82\\'a4\\'82\\'c8\\'92\\'5a\\'82\\'a2\\'8d\\'90\\'92\\'6d\\'82\\'aa\\'95\\'5c\\'8e\\'a6\\'82\\'b3\\'82\\'ea\\'82\\'e9\\'82\\'e6\\'82\\'a4\\'82\\'c9\\'82\\'b5\\'82\\'c4\\'82\\'ad\\'82\\'be\\'82\\'b3\\'82\\'a2\n\\f0 :\\\n\\\n    Gnomovision version 69, Copyright (C) year name of author\\\n    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\\\n    This is free software, and you are welcome to redistribute it\\\n    under certain conditions; type `show c' for details.\\\n\\\n    (\n\\f1 \\'96\\'f3\n\\f0 :\\\n\\\n    Gnomovision\n\\f1 \\'83\\'6f\\'81\\'5b\\'83\\'57\\'83\\'87\\'83\\'93\n\\f0  69, Copyright (C)\n\\f1 \\'94\\'4e\n\\f0\n\\f1 \\'8d\\'ec\\'8e\\'d2\\'82\\'cc\\'96\\'bc\\'91\\'4f\\\n\n\\f0     Gnomovision\n\\f1 \\'82\\'cd\n\\f0 *\n\\f1 \\'91\\'53\\'82\\'ad\\'82\\'cc\\'96\\'b3\\'95\\'db\\'8f\\'d8\n\\f0 *\n\\f1 \\'82\\'c5\\'92\\'f1\\'8b\\'9f\\'82\\'b3\\'82\\'ea\\'82\\'dc\\'82\\'b7\\'81\\'42\\'8f\\'da\\'82\\'b5\\'82\\'ad\\'82\\'cd\\'81\\'75\n\\f0 show w\n\\f1 \\'81\\'76\\\n\n\\f0\n\\f1 \\'82\\'c6\\'83\\'5e\\'83\\'43\\'83\\'76\\'82\\'b5\\'82\\'c4\\'89\\'ba\\'82\\'b3\\'82\\'a2\\'81\\'42\\'82\\'b1\\'82\\'ea\\'82\\'cd\\'83\\'74\\'83\\'8a\\'81\\'5b\\'83\\'5c\\'83\\'74\\'83\\'67\\'83\\'45\\'83\\'46\\'83\\'41\\'82\\'c5\\'82\\'a0\\'82\\'e8\\'81\\'41\\'82\\'a0\\'82\\'e9\\'8f\\'f0\\'8c\\'8f\\'82\\'cc\\'89\\'ba\\'82\\'c5\\\n\n\\f0\n\\f1 \\'8d\\'c4\\'94\\'d0\\'95\\'7a\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'aa\\'8f\\'a7\\'97\\'e3\\'82\\'b3\\'82\\'ea\\'82\\'c4\\'82\\'a2\\'82\\'dc\\'82\\'b7\\'81\\'42\\'8f\\'da\\'82\\'b5\\'82\\'ad\\'82\\'cd\\'81\\'75\n\\f0 show c\n\\f1 \\'81\\'76\\'82\\'c6\\'83\\'5e\\'83\\'43\\'83\\'76\\'82\\'b5\\'82\\'c4\\'89\\'ba\\\n\n\\f0\n\\f1 \\'82\\'b3\\'82\\'a2\\'81\\'42\\\n\\\n\n\\f0     )\\\n\\\n\n\\f1 \\'82\\'b1\\'82\\'b1\\'82\\'c5\\'81\\'41\\'89\\'bc\\'91\\'7a\\'93\\'49\\'82\\'c8\\'83\\'52\\'83\\'7d\\'83\\'93\\'83\\'68\\'81\\'75\n\\f0 show w\n\\f1 \\'81\\'76\\'82\\'c6\\'81\\'75\n\\f0 show c\n\\f1 \\'81\\'76\\'82\\'cd\\'88\\'ea\\'94\\'ca\\'8c\\'f6\\'8f\\'4f\\'97\\'98\\'97\\'70\\'8b\\'96\\'91\\'f8\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\\n\\'82\\'cc\\'93\\'4b\\'90\\'d8\\'82\\'c8\\'95\\'94\\'95\\'aa\\'82\\'f0\\'95\\'5c\\'8e\\'a6\\'82\\'b7\\'82\\'e9\\'82\\'e6\\'82\\'a4\\'82\\'c9\\'82\\'c8\\'82\\'c1\\'82\\'c4\\'82\\'a2\\'82\\'c8\\'82\\'af\\'82\\'ea\\'82\\'ce\\'82\\'c8\\'82\\'e8\\'82\\'dc\\'82\\'b9\\'82\\'f1\\'81\\'42\\'82\\'e0\\'82\\'bf\\'82\\'eb\\'82\\'f1\\'81\\'41\\'82\\'a0\\'82\\'c8\\\n\\'82\\'bd\\'82\\'aa\\'8e\\'67\\'82\\'a4\\'83\\'52\\'83\\'7d\\'83\\'93\\'83\\'68\\'82\\'f0\\'81\\'75\n\\f0 show w\n\\f1 \\'81\\'76\\'82\\'e2\\'81\\'75\n\\f0 show c\n\\f1 \\'81\\'76\\'82\\'c6\\'8c\\'c4\\'82\\'d4\\'95\\'4b\\'91\\'52\\'90\\'ab\\'82\\'cd\\'82\\'a0\\'82\\'e8\\'82\\'dc\\'82\\'b9\\'82\\'f1\\'82\\'cc\\'82\\'c5\\'81\\'41\\\n\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cc\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'c9\\'8d\\'87\\'82\\'ed\\'82\\'b9\\'82\\'c4\\'83\\'7d\\'83\\'45\\'83\\'58\\'82\\'cc\\'83\\'4e\\'83\\'8a\\'83\\'62\\'83\\'4e\\'82\\'e2\\'83\\'81\\'83\\'6a\\'83\\'85\\'81\\'5b\\'82\\'cc\\'83\\'41\\'83\\'43\\'83\\'65\\'83\\'80\\'82\\'c9\\'82\\'b5\\'82\\'c4\\\n\\'82\\'e0\\'8c\\'8b\\'8d\\'5c\\'82\\'c5\\'82\\'b7\\'81\\'42\\\n\\\n\\'82\\'dc\\'82\\'bd\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cd\\'81\\'41\\'95\\'4b\\'97\\'76\\'82\\'c8\\'82\\'e7\\'82\\'ce\n\\f0 (\n\\f1 \\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'7d\\'81\\'5b\\'82\\'c6\\'82\\'b5\\'82\\'c4\\'93\\'ad\\'82\\'a2\\'82\\'c4\\'82\\'a2\\'82\\'bd\\'82\\'e7\n\\f0 )\n\\f1 \\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cc\\'8c\\'d9\\'97\\'70\\'8e\\'e5\\'81\\'41\\\n\\'82\\'a0\\'82\\'e9\\'82\\'a2\\'82\\'cd\\'8f\\'ea\\'8d\\'87\\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'82\\'cd\\'8a\\'77\\'8d\\'5a\\'82\\'a9\\'82\\'e7\\'81\\'41\\'82\\'bb\\'82\\'cc\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'c9\\'8a\\'d6\\'82\\'b7\\'82\\'e9\\'81\\'75\\'92\\'98\\'8d\\'ec\\'8c\\'a0\\'95\\'fa\\'8a\\'fc\\'90\\'ba\\'96\\'be\\\n\n\\f0 (copyright disclaimer)\n\\f1 \\'81\\'76\\'82\\'c9\\'8f\\'90\\'96\\'bc\\'82\\'b5\\'82\\'c4\\'82\\'e0\\'82\\'e7\\'82\\'a4\\'82\\'d7\\'82\\'ab\\'82\\'c5\\'82\\'b7\\'81\\'42\\'88\\'c8\\'89\\'ba\\'82\\'cd\\'97\\'e1\\'82\\'c5\\'82\\'b7\\'82\\'cc\\'82\\'c5\\'81\\'41\\'96\\'bc\\\n\\'91\\'4f\\'82\\'f0\\'95\\'cf\\'82\\'a6\\'82\\'c4\\'82\\'ad\\'82\\'be\\'82\\'b3\\'82\\'a2\n\\f0 :\\\n\\\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the program\\\n  `Gnomovision' (which makes passes at compilers) written by James Hacker.\\\n\\\n  <signature of Ty Coon>, 1 April 1989\\\n  Ty Coon, President of Vice\\\n\\\n  (\n\\f1 \\'96\\'f3\n\\f0 :\\\n\\\n  Yoyodyne\n\\f1 \\'8e\\'d0\\'82\\'cd\\'82\\'b1\\'82\\'b1\\'82\\'c9\\'81\\'41\n\\f0 James Hacker\n\\f1 \\'82\\'c9\\'82\\'e6\\'82\\'c1\\'82\\'c4\\'8f\\'91\\'82\\'a9\\'82\\'ea\\'82\\'bd\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\\n\n\\f0\n\\f1 \\'81\\'75\n\\f0 Gnomovision\n\\f1 \\'81\\'76\n\\f0 (\n\\f1 \\'83\\'52\\'83\\'93\\'83\\'70\\'83\\'43\\'83\\'89\\'82\\'d6\\'92\\'ca\\'82\\'b7\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\n\\f0 )\n\\f1 \\'82\\'c9\\'8a\\'d6\\'82\\'b7\\'82\\'e9\\'88\\'ea\\'90\\'d8\\'82\\'cc\\'92\\'98\\'8d\\'ec\\'8c\\'a0\\'82\\'cc\\'97\\'98\\\n\n\\f0\n\\f1 \\'89\\'76\\'82\\'f0\\'95\\'fa\\'8a\\'fc\\'82\\'b5\\'82\\'dc\\'82\\'b7\\'81\\'42\\\n\\\n\n\\f0    <Ty Coon\n\\f1 \\'8e\\'81\\'82\\'cc\\'8f\\'90\\'96\\'bc\n\\f0 >\n\\f1 \\'81\\'41\n\\f0 1989\n\\f1 \\'94\\'4e\n\\f0 4\n\\f1 \\'8c\\'8e\n\\f0 1\n\\f1 \\'93\\'fa\\\n\n\\f0    Ty Coon\n\\f1 \\'81\\'41\\'95\\'9b\\'8e\\'d0\\'92\\'b7\\\n\\\n\n\\f0   )\\\n\\\n\n\\f1 \\'82\\'b1\\'82\\'cc\\'88\\'ea\\'94\\'ca\\'8c\\'f6\\'8f\\'4f\\'97\\'98\\'97\\'70\\'8b\\'96\\'91\\'f8\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'c5\\'82\\'cd\\'81\\'41\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cc\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'f0\\'93\\'c6\\'90\\'e8\\'93\\'49\\'82\\'c8\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\\n\\'82\\'c9\\'93\\'9d\\'8d\\'87\\'82\\'b7\\'82\\'e9\\'82\\'b1\\'82\\'c6\\'82\\'f0\\'94\\'46\\'82\\'df\\'82\\'c4\\'82\\'a2\\'82\\'dc\\'82\\'b9\\'82\\'f1\\'81\\'42\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cc\\'83\\'76\\'83\\'8d\\'83\\'4f\\'83\\'89\\'83\\'80\\'82\\'aa\\'83\\'54\\'83\\'75\\'83\\'8b\\'81\\'5b\\'83\\'60\\'83\\'93\\'83\\'89\\'83\\'43\\'83\\'75\\\n\\'83\\'89\\'83\\'8a\\'82\\'c8\\'82\\'e7\\'82\\'ce\\'81\\'41\\'93\\'c6\\'90\\'e8\\'93\\'49\\'82\\'c8\\'83\\'41\\'83\\'76\\'83\\'8a\\'83\\'50\\'81\\'5b\\'83\\'56\\'83\\'87\\'83\\'93\\'82\\'c6\\'82\\'a0\\'82\\'c8\\'82\\'bd\\'82\\'cc\\'83\\'89\\'83\\'43\\'83\\'75\\'83\\'89\\'83\\'8a\\'82\\'f0\\'83\\'8a\\'83\\'93\\'83\\'4e\\'82\\'b7\\'82\\'e9\\'82\\'b1\\\n\\'82\\'c6\\'82\\'f0\\'8b\\'96\\'89\\'c2\\'82\\'b5\\'82\\'bd\\'82\\'d9\\'82\\'a4\\'82\\'aa\\'82\\'e6\\'82\\'e8\\'95\\'d6\\'97\\'98\\'82\\'c5\\'82\\'a0\\'82\\'e9\\'82\\'c6\\'8d\\'6c\\'82\\'a6\\'82\\'e9\\'82\\'a9\\'82\\'e0\\'82\\'b5\\'82\\'ea\\'82\\'dc\\'82\\'b9\\'82\\'f1\\'81\\'42\\'82\\'e0\\'82\\'b5\\'82\\'b1\\'82\\'ea\\'82\\'aa\\'82\\'a0\\'82\\'c8\\\n\\'82\\'bd\\'82\\'cc\\'96\\'5d\\'82\\'de\\'82\\'b1\\'82\\'c6\\'82\\'c8\\'82\\'e7\\'82\\'ce\\'81\\'41\\'82\\'b1\\'82\\'cc\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'cc\\'91\\'e3\\'82\\'ed\\'82\\'e8\\'82\\'c9\n\\f0 GNU\n\\f1 \\'83\\'89\\'83\\'43\\'83\\'75\\'83\\'89\\'83\\'8a\\'88\\'ea\\'94\\'ca\\'8c\\'f6\\'8f\\'4f\\'97\\'98\\'97\\'70\\'8b\\'96\\'91\\'f8\\\n\\'8c\\'5f\\'96\\'f1\\'8f\\'91\\'82\\'f0\\'93\\'4b\\'97\\'70\\'82\\'b5\\'82\\'c4\\'82\\'ad\\'82\\'be\\'82\\'b3\\'82\\'a2\\'81\\'42\\\n}\n"
  },
  {
    "path": "ja.lproj/Localizable.strings",
    "content": "{\n\"Host Name\" = \"ホスト名\";\n\"Host Names\" = \"ホスト名\";\n\"IP Address\" = \"IP アドレス\";\n\"IP Addresses\" = \"IP アドレス\";\n\"Screen Resolution changed - Server Reinitialized\" = \"画面の解像度が変更 - サーバを再初期化しました。\";\n\"Server Running\" = \"サーバは動作中。\";\n\"The server is not running.\" = \"サーバは動作していません。\";\n\"Start Server\" = \"サーバを起動\";\n\"Restart Server\" = \"サーバを再起動\";\n\"The server is stopped.\" = \"サーバは停止しています。\";\n\"Probably because the OSXvnc server is already running as a Startup Item.\" = \"Vine サーバが既に起動項目として起動している可能性があります。\";\n\"Probably because another VNC is already using this port.\" = \"このポートは既にほかの VNC によって使用されている可能性があります。\";\n\"The server has stopped running. See Log (%d)\\n\" = \"サーバが停止しました。詳細はログ (%d) を参照してください。\\n\";\n\"The server has stopped running.\" = \"サーバが停止しました。\";\n\"Need a valid Port or Display Number\" = \"有効なポートまたはディスプレイ名が必要です。\";\n\"Problem - Unable to store password to %@\" = \"パスワードを '%@' へ保存できません。\";\n\"Option Change Requires a Restart\" = \"設定変更には再起動が必要です。\";\n//\"Error: No Authorization\" = \"エラー：認証が必要です。\";\n//\"Error: Unable To Setup Password File\" = \"エラー：パスワードファイルを設定できません。\";\n//\"Error: Unable To Write out Temporary Script File\" = \"エラー：一時スクリプトファイルを書き込めません。\";\n\"Startup Item Configured (Started)\" = \"起動項目として設定されました。（開始）\";\n\"Startup Item Disabled (Stopped)\" = \"起動項目を無効にしました。（停止）\";\n//\"Error: Unabled to remove startup item\" = \"エラー：起動項目を削除できない\";\n\"Please specify a Connect Host to establish a connection\" = \"「接続ホスト」を指定して下さい。\";\n\"Connection invitation sent to Connect Host\" = \"接続依頼を「接続ホスト」へ送信しました。\";\n}\n\n"
  },
  {
    "path": "main.m",
    "content": "#import <Cocoa/Cocoa.h>\n\nint main(int argc, const char *argv[])\n{\n    return NSApplicationMain(argc, argv);\n}\n"
  }
]