pax_global_header00006660000000000000000000000064140412727750014523gustar00rootroot0000000000000052 comment=7fb40fb5f2369fb1f99eee01f9d70314cda03d43 conky-1.12.2/000077500000000000000000000000001404127277500127315ustar00rootroot00000000000000conky-1.12.2/.clang-format000066400000000000000000000076401404127277500153130ustar00rootroot00000000000000--- Language: Cpp # BasedOnStyle: Google AccessModifierOffset: -1 AlignAfterOpenBracket: Align AlignConsecutiveAssignments: false AlignConsecutiveDeclarations: false AlignEscapedNewlines: Left AlignOperands: true AlignTrailingComments: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: true AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: All AllowShortIfStatementsOnASingleLine: true AllowShortLoopsOnASingleLine: true AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: true AlwaysBreakTemplateDeclarations: Yes BinPackArguments: true BinPackParameters: true BraceWrapping: AfterClass: false AfterControlStatement: false AfterEnum: false AfterFunction: false AfterNamespace: false AfterObjCDeclaration: false AfterStruct: false AfterUnion: false AfterExternBlock: false BeforeCatch: false BeforeElse: false IndentBraces: false SplitEmptyFunction: true SplitEmptyRecord: true SplitEmptyNamespace: true BreakBeforeBinaryOperators: None BreakBeforeBraces: Attach BreakBeforeInheritanceComma: false BreakInheritanceList: BeforeColon BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: false BreakConstructorInitializers: BeforeColon BreakAfterJavaFieldAnnotations: false BreakStringLiterals: true ColumnLimit: 80 CommentPragmas: '^ IWYU pragma:' CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: true ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 Cpp11BracedListStyle: true DerivePointerAlignment: true DisableFormat: false ExperimentalAutoDetectBinPacking: false FixNamespaceComments: true ForEachMacros: - foreach - Q_FOREACH - BOOST_FOREACH IncludeBlocks: Preserve IncludeCategories: - Regex: '^' Priority: 2 - Regex: '^<.*\.h>' Priority: 1 - Regex: '^<.*' Priority: 2 - Regex: '.*' Priority: 3 IncludeIsMainRegex: '([-_](test|unittest))?$' IndentCaseLabels: true IndentPPDirectives: None IndentWidth: 2 IndentWrappedFunctionNames: false JavaScriptQuotes: Leave JavaScriptWrapImports: true KeepEmptyLinesAtTheStartOfBlocks: false MacroBlockBegin: '' MacroBlockEnd: '' MaxEmptyLinesToKeep: 1 NamespaceIndentation: None ObjCBinPackProtocolList: Never ObjCBlockIndentWidth: 2 ObjCSpaceAfterProperty: false ObjCSpaceBeforeProtocolList: false PenaltyBreakAssignment: 2 PenaltyBreakBeforeFirstCallParameter: 1 PenaltyBreakComment: 300 PenaltyBreakFirstLessLess: 120 PenaltyBreakString: 1000 PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 200 PointerAlignment: Left RawStringFormats: - Language: Cpp Delimiters: - cc - CC - cpp - Cpp - CPP - 'c++' - 'C++' CanonicalDelimiter: '' BasedOnStyle: google - Language: TextProto Delimiters: - pb - PB - proto - PROTO EnclosingFunctions: - EqualsProto - EquivToProto - PARSE_PARTIAL_TEXT_PROTO - PARSE_TEST_PROTO - PARSE_TEXT_PROTO - ParseTextOrDie - ParseTextProtoOrDie CanonicalDelimiter: '' BasedOnStyle: google ReflowComments: true SortIncludes: true SortUsingDeclarations: true SpaceAfterCStyleCast: false SpaceAfterTemplateKeyword: true SpaceBeforeAssignmentOperators: true SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true SpaceBeforeInheritanceColon: true SpaceBeforeParens: ControlStatements SpaceBeforeRangeBasedForLoopColon: true SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 2 SpacesInAngles: false SpacesInContainerLiterals: true SpacesInCStyleCastParentheses: false SpacesInParentheses: false SpacesInSquareBrackets: false Standard: Auto TabWidth: 8 UseTab: Never ... conky-1.12.2/.clang-tidy000066400000000000000000000042371404127277500147730ustar00rootroot00000000000000--- Checks: 'clang-diagnostic-*,clang-analyzer-*,google-*' WarningsAsErrors: '' HeaderFilterRegex: '' AnalyzeTemporaryDtors: false FormatStyle: none User: brenden CheckOptions: - key: google-build-namespaces.HeaderFileExtensions value: ',h,hh,hpp,hxx' - key: google-global-names-in-headers.HeaderFileExtensions value: ',h,hh,hpp,hxx' - key: google-readability-braces-around-statements.ShortStatementLines value: '1' - key: google-readability-function-size.BranchThreshold value: '4294967295' - key: google-readability-function-size.LineThreshold value: '4294967295' - key: google-readability-function-size.NestingThreshold value: '4294967295' - key: google-readability-function-size.ParameterThreshold value: '4294967295' - key: google-readability-function-size.StatementThreshold value: '800' - key: google-readability-function-size.VariableThreshold value: '4294967295' - key: google-readability-namespace-comments.ShortNamespaceLines value: '10' - key: google-readability-namespace-comments.SpacesBeforeComments value: '2' - key: google-runtime-int.SignedTypePrefix value: int - key: google-runtime-int.TypeSuffix value: '' - key: google-runtime-int.UnsignedTypePrefix value: uint - key: google-runtime-references.WhiteListTypes value: '' - key: modernize-loop-convert.MaxCopySize value: '16' - key: modernize-loop-convert.MinConfidence value: reasonable - key: modernize-loop-convert.NamingStyle value: CamelCase - key: modernize-pass-by-value.IncludeStyle value: llvm - key: modernize-replace-auto-ptr.IncludeStyle value: llvm - key: modernize-use-nullptr.NullMacros value: 'NULL' ... conky-1.12.2/.dockerignore000066400000000000000000000005701404127277500154070ustar00rootroot00000000000000Dockerfile .dockerignore # Ignore SCM/CI related stuff .github/ .git/ .gitlab-ci.yml .DS_Store *~ .*.swp Doxyfile patches/ doc/conky.1 README build*/ doc/*.html Makefile CMakeCache.txt CMakeFiles data/convertconf.h data/defconfig.h lua/libcairo-orig.c lua/libcairo.c lua/libimlib2.c *.so *.a /config.h # Ignore vscode stuff .vscode *.code-workspace # Ignore tests tests/ conky-1.12.2/.editorconfig000066400000000000000000000001431404127277500154040ustar00rootroot00000000000000root = true [*] end_of_line = lf insert_final_newline = true indent_style = space indent_size = 2 conky-1.12.2/.github/000077500000000000000000000000001404127277500142715ustar00rootroot00000000000000conky-1.12.2/.github/FUNDING.yml000066400000000000000000000001031404127277500161000ustar00rootroot00000000000000# These are supported funding model platforms github: brndnmtthws conky-1.12.2/.github/ISSUE_TEMPLATE.md000066400000000000000000000022261404127277500170000ustar00rootroot00000000000000**Issue** Verify the issue you want to report is not a duplicate. If not, please explain your bug or issue here. [DELETE ME] **Information** Do we require your OS and/or Conky version? If not, delete this part. Otherwise, please report them here. [DELETE ME] Do we require your config? If no, delete this part. Otherwise, place your config inside `lua` triple backticks. [DELETE ME] ```lua conky.config = { out_to_x = false, out_to_console = true, }; conky.text = [[ Hello, World! ]]; ``` If you want to report a crash, please try again with `gdb`. ```bash # Start 'conky' $ gdb conky # Run 'conky' with a config. (gdb) run -c ~/.your_conky.conf # Wait for a crash to occur, then run this. (gdb) bt full # Backtrace. ``` We want that backtrace inside `gdb` triple backticks. ```gdb $ gdb conky GNU gdb (GDB) 8.2 Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. ... ``` Please delete all descriptions, unused headers, notes, sections, etc too. Thank you. conky-1.12.2/.github/PULL_REQUEST_TEMPLATE.md000066400000000000000000000022101404127277500200650ustar00rootroot00000000000000**Descriptions** * Describe the changes, why they were necessary, etc * Describe how the changes will affect existing behaviour. * Describe how you tested and validated your changes. * Include any relevant screenshots/evidence demonstrating that the changes work and have been tested. **Licenses** * Any new source files should include a GPLv3 license header. * Any contributed code must be GPLv3 licensed. **Notes** * Make sure your code is clean and if you have added a new features, some comments may be appreciated. Make sure your commit messages are clear/information enough. * If you added or altered settings and/or variables, make sure to update the documentation. Do not forget to mention default values or required build flags if this applies to your change. * If you added a build flag, make sure to update the `static void print_version(void)` function with your new flag. If you added a new console command, make sure to update the `static void print_help(const char *prog_name)` function with your new command. * Add tests for the code, where appropriate. Please delete all descriptions, headers, notes, sections, etc too. Thank you. conky-1.12.2/.github/workflows/000077500000000000000000000000001404127277500163265ustar00rootroot00000000000000conky-1.12.2/.github/workflows/build-and-test-linux.yaml000066400000000000000000000075171404127277500231750ustar00rootroot00000000000000name: Build and test on Linux on: [push, pull_request] jobs: build: strategy: matrix: os: - ubuntu-18.04 - ubuntu-20.04 x11: [ON, OFF] compiler: - clang - gcc compiler_version: - 7 - 9 - 10 - 11 exclude: - os: ubuntu-20.04 compiler: gcc compiler_version: 7 - compiler: gcc compiler_version: 11 - compiler: clang compiler_version: 7 - os: ubuntu-18.04 compiler: clang compiler_version: 7 - os: ubuntu-18.04 compiler: clang compiler_version: 10 - os: ubuntu-18.04 compiler: clang compiler_version: 11 runs-on: ${{ matrix.os }} steps: - run: sudo apt-get -qq update - name: Install dependencies run: | sudo apt-get install -yqq --no-install-recommends \ audacious-dev \ cmake \ docbook2x \ gawk \ lcov \ libaudclient-dev \ libc++-${{ matrix.compiler_version }}-dev \ libc++abi-${{ matrix.compiler_version }}-dev \ libcairo2-dev \ libcurl4-gnutls-dev \ libcurl4-gnutls-dev \ libglib2.0-dev \ libical-dev \ libimlib2-dev \ libircclient-dev \ libiw-dev \ liblua5.3-dev \ libmicrohttpd-dev \ libmysqlclient-dev \ libpulse-dev \ librsvg2-dev \ libsystemd-dev \ libx11-dev \ libxdamage-dev \ libxext-dev \ libxft-dev \ libxinerama-dev \ libxml2-dev \ libxmmsclient-dev \ libxnvctrl-dev \ ncurses-dev - name: Checkout uses: actions/checkout@v2 - name: Configure with CMake run: | [[ "${{ matrix.compiler }}" == "clang"* ]] && CC=clang-${{ matrix.compiler_version }} [[ "${{ matrix.compiler }}" == "clang"* ]] && CXX=clang++-${{ matrix.compiler_version }} [[ "${{ matrix.compiler }}" == "gcc"* ]] && CC=gcc-${{ matrix.compiler_version }} [[ "${{ matrix.compiler }}" == "gcc"* ]] && CXX=g++-${{ matrix.compiler_version }} # Enable librsvg by default, disable for older versions of Ubuntu # because we need librsvg>=2.46 RSVG_ENABLED=ON [[ "${{ matrix.os }}" == "ubuntu-18.04"* ]] && RSVG_ENABLED=OFF mkdir build cd build cmake .. \ -DBUILD_AUDACIOUS=ON \ -DBUILD_HTTP=ON \ -DBUILD_ICAL=ON \ -DBUILD_ICONV=ON \ -DBUILD_IRC=ON \ -DBUILD_IRC=ON \ -DBUILD_JOURNAL=ON \ -DBUILD_LUA_CAIRO=ON \ -DBUILD_LUA_IMLIB2=ON \ -DBUILD_LUA_RSVG=${RSVG_ENABLED} \ -DBUILD_MYSQL=ON \ -DBUILD_NVIDIA=ON \ -DBUILD_PULSEAUDIO=ON \ -DBUILD_RSS=ON \ -DBUILD_TESTS=ON \ -DBUILD_WLAN=ON \ -DBUILD_X11=${{ matrix.x11 }} \ -DBUILD_XMMS2=ON \ -DCMAKE_C_COMPILER=$CC \ -DCMAKE_CXX_COMPILER=$CXX \ -DMAINTAINER_MODE=ON - name: Compile working-directory: build run: make -j5 - name: Test working-directory: build run: make test conky-1.12.2/.github/workflows/build-and-test-macos.yaml000066400000000000000000000016041404127277500231270ustar00rootroot00000000000000name: Build and test on macOS on: [push, pull_request] jobs: build: strategy: matrix: os: - macos-10.15 # - macos-11.0 runs-on: ${{ matrix.os }} steps: - name: Install dependencies run: | brew install \ docbook2x \ freetype \ gettext \ imlib2 \ lcov \ librsvg \ libxft \ libxinerama \ lua - name: Checkout uses: actions/checkout@v2 - name: Configure with CMake run: | mkdir build cd build cmake .. \ -DMAINTAINER_MODE=ON \ -DBUILD_TESTS=ON - name: Compile working-directory: build run: make -j5 - name: Test working-directory: build run: make test conky-1.12.2/.github/workflows/docker.yaml000066400000000000000000000031171404127277500204630ustar00rootroot00000000000000name: Docker on: push: # Publish `main` as Docker `latest` image. branches: - main # Publish `v1.2.3` tags as releases. tags: - v* env: IMAGE_NAME: conky DOCKERHUB_ACCOUNT: brndnmtthws DOCKER_BUILDKIT: 1 jobs: buildx: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v1 - name: Log into Dockerhub registry run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u $DOCKERHUB_ACCOUNT --password-stdin - name: Build run: | DOCKERHUB_IMAGE_ID=$DOCKERHUB_ACCOUNT/$IMAGE_NAME # Change all uppercase to lowercase DOCKERHUB_IMAGE_ID=$(echo $DOCKERHUB_IMAGE_ID | tr '[A-Z]' '[a-z]') # Strip git ref prefix from version VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') # Strip "v" prefix from tag name [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') # Use Docker `latest` tag convention [ "$VERSION" == "main" ] && VERSION=latest docker buildx build \ --push \ --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ --cache-from=type=registry,ref=$DOCKERHUB_ACCOUNT/$IMAGE_NAME:buildcache \ --cache-to=type=registry,ref=$DOCKERHUB_ACCOUNT/$IMAGE_NAME:buildcache,mode=max \ --tag $DOCKERHUB_IMAGE_ID:$VERSION \ . conky-1.12.2/.github/workflows/publish-appimage.yml000066400000000000000000000057271404127277500223130ustar00rootroot00000000000000name: Build AppImage on: push: branches: - main tags: - v* jobs: build: runs-on: ubuntu-20.04 steps: - run: sudo apt-get -qq update - name: Install dependencies run: | sudo apt-get install -yqq --no-install-recommends \ audacious-dev \ cmake \ docbook2x \ gawk \ lcov \ libaudclient-dev \ libcairo2-dev \ libcurl4-gnutls-dev \ libglib2.0-dev \ libical-dev \ libimlib2-dev \ libircclient-dev \ libiw-dev \ liblua5.3-dev \ libmicrohttpd-dev \ libmysqlclient-dev \ libpulse-dev \ librsvg2-dev \ libsystemd-dev \ libx11-dev \ libxdamage-dev \ libxext-dev \ libxft-dev \ libxinerama-dev \ libxml2-dev \ libxmmsclient-dev \ libxnvctrl-dev \ ncurses-dev - name: Checkout uses: actions/checkout@v2 - name: Import GPG Deploy Key run: | echo "${{ secrets.GPG_DEPLOY_KEY }}" > appimage/secret.gpg gpg --import appimage/secret.gpg - name: Build AppImage run: ./appimage/build.sh - name: Archive AppImage uses: actions/upload-artifact@v2 with: name: conky-appimage path: conky*.AppImage - name: Get Name of Artifact run: | ARTIFACT_PATHNAME=$(ls conky*.AppImage | head -n 1) ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME) echo "ARTIFACT_PATHNAME=${ARTIFACT_PATHNAME}" >> $GITHUB_ENV echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV - name: Print Name of Artifact run: | echo ARTIFACT_PATHNAME=${{ env.ARTIFACT_PATHNAME }} echo ARTIFACT_NAME=${{ env.ARTIFACT_NAME }} - name: Create Conky Release id: create_release uses: actions/create-release@v1 if: startsWith(github.ref, 'refs/tags/v') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref }} release_name: Conky ${{ github.ref }} draft: false prerelease: false - name: Upload Conky Release Asset id: upload-release-asset uses: actions/upload-release-asset@v1 if: startsWith(github.ref, 'refs/tags/v') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path: ${{ env.ARTIFACT_PATHNAME }} asset_name: ${{ env.ARTIFACT_NAME }} asset_content_type: application/x-executable conky-1.12.2/.gitignore000066400000000000000000000004221404127277500147170ustar00rootroot00000000000000.DS_Store *~ .*.swp Doxyfile patches/ doc/conky.1 README build*/ doc/*.html Makefile CMakeCache.txt CMakeFiles data/convertconf.h data/defconfig.h lua/libcairo-orig.c lua/libcairo.c lua/libimlib2.c *.so *.a /config.h # Ignore vscode stuff .vscode *.code-workspace .idea/ conky-1.12.2/.gitlab-ci.yml000066400000000000000000000251731404127277500153750ustar00rootroot00000000000000--- stages: - base - dependencies - build - test - check variables: DOCKER_DRIVER: overlay2 DOCKER_BUILDKIT: 1 .docker_base_builder: &docker_base_builder retry: max: 2 when: - runner_system_failure - stuck_or_timeout_failure - unknown_failure - api_failure stage: base image: docker:stable only: changes: - tests/dockerfiles/* services: - docker:dind before_script: - set -- $CI_JOB_NAME - export DISTRO=$2 - "echo \"Distro: ${DISTRO}\nDocker base: ${DOCKER_BASE_IMAGE}\"" - export DOCKER_HOST="${DOCKER_HOST:-tcp://localhost:2375/}" - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY script: - cd tests/dockerfiles - > docker build . -f Dockerfile.$DISTRO-base --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from $CI_REGISTRY_IMAGE/builder/$DISTRO-base:latest --tag $CI_REGISTRY_IMAGE/builder/$DISTRO-base:latest - docker push $CI_REGISTRY_IMAGE/builder/$DISTRO-base:latest builder ubuntu base: <<: *docker_base_builder variables: DOCKER_BASE_IMAGE: ubuntu:focal builder fedora-31 base: <<: *docker_base_builder variables: DOCKER_BASE_IMAGE: fedora:31 builder fedora-32 base: <<: *docker_base_builder variables: DOCKER_BASE_IMAGE: fedora:32 builder fedora-33 base: <<: *docker_base_builder variables: DOCKER_BASE_IMAGE: fedora:33 builder archlinux base: <<: *docker_base_builder variables: DOCKER_BASE_IMAGE: archlinux:base builder alpine base: <<: *docker_base_builder variables: DOCKER_BASE_IMAGE: alpine:latest .docker_builder: &docker_builder <<: *docker_base_builder stage: dependencies script: - set -- $CI_JOB_NAME - export DISTRO=$2 - export COMPILER=$3 - "echo \"Distro: ${DISTRO}\nCompiler: ${COMPILER}\"" - cd tests/dockerfiles - > docker build . -f Dockerfile.$DISTRO-$COMPILER --build-arg IMAGE=$CI_REGISTRY_IMAGE --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from $CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:latest --tag $CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:latest - docker push ${CI_REGISTRY_IMAGE}/builder/$DISTRO-$COMPILER:latest builder ubuntu clang-9: *docker_builder builder ubuntu clang-10: *docker_builder builder ubuntu clang-11: *docker_builder builder ubuntu gcc-7: *docker_builder builder ubuntu gcc-8: *docker_builder builder ubuntu gcc-9: *docker_builder builder ubuntu gcc-10: *docker_builder builder fedora-31 clang-8: *docker_builder builder fedora-32 clang-10: *docker_builder builder fedora-33 clang-11: *docker_builder builder archlinux clang: *docker_builder builder archlinux gcc: *docker_builder builder alpine gcc: *docker_builder # builder alpine clang: *docker_builder .build_stages: &build_stages retry: max: 2 when: - runner_system_failure - stuck_or_timeout_failure - unknown_failure - api_failure image: $CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:latest stage: build script: - "echo \"Distro: ${DISTRO}\nCompiler: ${COMPILER}\nCC: $CC\nCXX: $CXX\"" - mkdir -p build - cd build - > cmake -DBUILD_AUDACIOUS=$BUILD_AUDACIOUS -DBUILD_HTTP=ON -DBUILD_ICAL=$BUILD_ICAL -DBUILD_ICONV=ON -DBUILD_IRC=$BUILD_IRC -DBUILD_JOURNAL=$BUILD_JOURNAL -DBUILD_LUA_CAIRO=$BUILD_LUA_CAIRO -DBUILD_LUA_IMLIB2=ON -DBUILD_LUA_RSVG=$BUILD_LUA_RSVG -DBUILD_MYSQL=$BUILD_MYSQL -DBUILD_NVIDIA=$BUILD_NVIDIA -DBUILD_PULSEAUDIO=$BUILD_PULSEAUDIO -DBUILD_RSS=$BUILD_RSS -DBUILD_XMMS2=$BUILD_XMMS2 -DCMAKE_EXE_LINKER_FLAGS=$LINKER_FLAGS -DMAINTAINER_MODE=ON .. - make -j4 .build_variables: &build_variables BUILD_AUDACIOUS: "ON" BUILD_ICAL: "ON" BUILD_IRC: "ON" BUILD_JOURNAL: "ON" BUILD_LUA_CAIRO: "ON" BUILD_LUA_RSVG: "ON" BUILD_MYSQL: "ON" BUILD_NVIDIA: "ON" BUILD_PULSEAUDIO: "ON" BUILD_RSS: "ON" BUILD_XMMS2: "ON" LINKER_FLAGS: "" ubuntu clang-9: <<: *build_stages variables: <<: *build_variables DISTRO: ubuntu COMPILER: clang-9 CC: clang-9 CXX: clang++-9 ubuntu clang-10: <<: *build_stages variables: <<: *build_variables DISTRO: ubuntu COMPILER: clang-10 CC: clang-10 CXX: clang++-10 ubuntu clang-11: <<: *build_stages variables: <<: *build_variables DISTRO: ubuntu COMPILER: clang-11 CC: clang-11 CXX: clang++-11 ubuntu gcc-7: <<: *build_stages variables: <<: *build_variables DISTRO: ubuntu COMPILER: gcc-7 CC: gcc-7 CXX: g++-7 ubuntu gcc-8: <<: *build_stages variables: <<: *build_variables DISTRO: ubuntu COMPILER: gcc-8 CC: gcc-8 CXX: g++-8 ubuntu gcc-9: <<: *build_stages variables: <<: *build_variables DISTRO: ubuntu COMPILER: gcc-9 CC: gcc-9 CXX: g++-9 ubuntu gcc-10: <<: *build_stages variables: <<: *build_variables DISTRO: ubuntu COMPILER: gcc-10 CC: gcc-10 CXX: g++-10 fedora-31 clang-8: <<: *build_stages variables: <<: *build_variables DISTRO: fedora-31 COMPILER: clang-8 CC: clang CXX: clang++ BUILD_AUDACIOUS: "OFF" fedora-32 clang-10: <<: *build_stages variables: <<: *build_variables DISTRO: fedora-32 COMPILER: clang-10 CC: clang CXX: clang++ BUILD_AUDACIOUS: "OFF" fedora-33 clang-11: <<: *build_stages variables: <<: *build_variables DISTRO: fedora-33 COMPILER: clang-11 CC: clang CXX: clang++ BUILD_AUDACIOUS: "OFF" archlinux clang: <<: *build_stages variables: <<: *build_variables DISTRO: archlinux COMPILER: clang CC: clang CXX: clang++ BUILD_AUDACIOUS: "OFF" BUILD_XMMS2: "OFF" archlinux gcc: <<: *build_stages variables: <<: *build_variables DISTRO: archlinux COMPILER: gcc CC: gcc CXX: g++ BUILD_AUDACIOUS: "OFF" BUILD_XMMS2: "OFF" alpine gcc: <<: *build_stages variables: <<: *build_variables DISTRO: alpine COMPILER: gcc CC: gcc CXX: g++ BUILD_AUDACIOUS: "OFF" BUILD_ICAL: "OFF" BUILD_IRC: "OFF" BUILD_JOURNAL: "OFF" BUILD_LUA_CAIRO: "OFF" BUILD_LUA_RSVG: "OFF" BUILD_MYSQL: "OFF" BUILD_NVIDIA: "OFF" BUILD_PULSEAUDIO: "OFF" BUILD_RSS: "OFF" BUILD_XMMS2: "OFF" # alpine clang: # <<: *build_stages # variables: # <<: *build_variables # DISTRO: alpine # COMPILER: clang # CC: clang # CXX: clang++ # BUILD_AUDACIOUS: "OFF" # BUILD_ICAL: "OFF" # BUILD_IRC: "OFF" # BUILD_JOURNAL: "OFF" # BUILD_LUA_CAIRO: "OFF" # BUILD_LUA_RSVG: "OFF" # BUILD_MYSQL: "OFF" # BUILD_NVIDIA: "OFF" # BUILD_PULSEAUDIO: "OFF" # BUILD_RSS: "OFF" # BUILD_XMMS2: "OFF" .test_stages: &test_stages retry: max: 2 when: - runner_system_failure - stuck_or_timeout_failure - unknown_failure - api_failure image: $CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:latest stage: test .test_run: &test_run script: - "echo \"Distro: ${DISTRO}\nCompiler: ${COMPILER}\nCC: $CC\nCXX: $CXX\"" - mkdir -p build - cd build - | cmake \ -DBUILD_TESTS=ON \ -DMAINTAINER_MODE=ON \ .. - make -j4 - make -j4 test - if [ "$COMPILER" == "clang-11" ] ; then make -j4 test-conky-coverage-txt ; fi - if [ "$COMPILER" == "clang-11" ] ; then make -j4 test-conky-coverage-html ; fi - if [ "$COMPILER" == "clang-11" ] ; then lcov-summary test-conky-coverage-html.info.cleaned ; fi - make -j4 - make -j4 install - conky -v - find . -iname '*.gcda' -delete - | cmake \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DRELEASE=ON \ .. - make -j4 - make -j4 install - conky -v coverage: '/Total Coverage:\s+(\d+\.\d+)%/' artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-coverage-report" paths: - build/test-conky-coverage-html/ test ubuntu clang-9: <<: *test_stages <<: *test_run variables: DISTRO: ubuntu COMPILER: clang-9 CC: clang-9 CXX: clang++-9 test ubuntu clang-10: <<: *test_stages <<: *test_run variables: DISTRO: ubuntu COMPILER: clang-10 CC: clang-10 CXX: clang++-10 test ubuntu clang-11: <<: *test_stages <<: *test_run variables: DISTRO: ubuntu COMPILER: clang-11 CC: clang-11 CXX: clang++-11 test ubuntu gcc-7: <<: *test_stages <<: *test_run variables: DISTRO: ubuntu COMPILER: gcc-7 CC: gcc-7 CXX: g++-7 test ubuntu gcc-8: <<: *test_stages <<: *test_run variables: DISTRO: ubuntu COMPILER: gcc-8 CC: gcc-8 CXX: g++-8 test ubuntu gcc-9: <<: *test_stages <<: *test_run variables: DISTRO: ubuntu COMPILER: gcc-9 CC: gcc-9 CXX: g++-9 test ubuntu gcc-10: <<: *test_stages <<: *test_run variables: DISTRO: ubuntu COMPILER: gcc-10 CC: gcc-10 CXX: g++-10 test fedora-31 clang-8: <<: *test_stages <<: *test_run variables: DISTRO: fedora-31 COMPILER: clang-8 CC: clang CXX: clang++ test fedora-32 clang-10: <<: *test_stages <<: *test_run variables: DISTRO: fedora-32 COMPILER: clang-10 CC: clang CXX: clang++ test fedora-33 clang-11: <<: *test_stages <<: *test_run variables: DISTRO: fedora-33 COMPILER: clang-11 CC: clang CXX: clang++ test archlinux clang: <<: *test_stages <<: *test_run variables: DISTRO: archlinux COMPILER: clang CC: clang CXX: clang++ test archlinux gcc: <<: *test_stages <<: *test_run variables: DISTRO: archlinux COMPILER: gcc CC: gcc CXX: g++ test alpine gcc: <<: *test_stages <<: *test_run variables: DISTRO: alpine COMPILER: gcc CC: gcc CXX: g++ # test alpine clang: # <<: *test_stages # <<: *test_run # variables: # DISTRO: alpine # COMPILER: clang # CC: clang # CXX: clang++ .check_stages: &check_stages retry: max: 2 when: - runner_system_failure - stuck_or_timeout_failure - unknown_failure - api_failure image: $CI_REGISTRY_IMAGE/builder/$DISTRO-$COMPILER:latest stage: check check clang-tidy: <<: *check_stages variables: COMPILER: clang-11 DISTRO: ubuntu CC: clang-11 CXX: clang++-11 script: - mkdir -p build - cd build - > cmake -DMAINTAINER_MODE=ON -DCHECK_CODE_QUALITY=ON .. - make -j4 - make -j4 check-clang-tidy check clang-format: <<: *check_stages variables: COMPILER: clang-11 DISTRO: ubuntu CC: clang-11 CXX: clang++-11 script: - mkdir -p build - cd build - > cmake -DMAINTAINER_MODE=ON -DCHECK_CODE_QUALITY=ON .. - make -j4 check-clang-format conky-1.12.2/3rdparty/000077500000000000000000000000001404127277500145015ustar00rootroot00000000000000conky-1.12.2/3rdparty/toluapp/000077500000000000000000000000001404127277500161655ustar00rootroot00000000000000conky-1.12.2/3rdparty/toluapp/.gitignore000066400000000000000000000000071404127277500201520ustar00rootroot00000000000000build/ conky-1.12.2/3rdparty/toluapp/.travis.yml000066400000000000000000000046231404127277500203030ustar00rootroot00000000000000language: cpp cache: ccache dist: xenial matrix: include: - os: linux addons: apt: sources: - ubuntu-toolchain-r-test packages: - g++-5 - liblua5.3-dev env: - MATRIX_EVAL="CC=gcc-5 && CXX=g++-5" - os: linux addons: apt: sources: - ubuntu-toolchain-r-test packages: - g++-6 - liblua5.3-dev env: - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6" - os: linux addons: apt: sources: - ubuntu-toolchain-r-test packages: - g++-7 - liblua5.3-dev env: - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" - os: linux addons: apt: sources: - ubuntu-toolchain-r-test packages: - g++-8 - liblua5.3-dev env: - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" - os: linux addons: apt: sources: - llvm-toolchain-xenial-6.0 packages: - clang-6.0 - liblua5.3-dev env: - MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0" - os: linux addons: apt: sources: - llvm-toolchain-xenial-7 packages: - clang-7 - liblua5.3-dev env: - MATRIX_EVAL="CC=clang-7 && CXX=clang++-7" - os: osx osx_image: xcode9.4 - os: osx osx_image: xcode10 - os: osx osx_image: xcode10.1 before_install: - | if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then HOMEBREW_NO_AUTO_UPDATE=1 brew install lua ccache; export PATH="/usr/local/opt/ccache/libexec:$PATH"; fi - eval "${MATRIX_EVAL}" # Combine global build options with OS/compiler-dependent options - export CMAKE_OPTIONS="${CMAKE_OPTIONS} ${ENV_CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" - export CXX_FLAGS="${CXX_FLAGS} ${ENV_CXX_FLAGS} -Wall -Werror -Wextra -Wunused -pedantic" - export C_FLAGS="${C_FLAGS} ${ENV_C_FLAGS} -Wall -Werror -Wextra -Wunused -pedantic -std=c99" install: - echo ${PATH} - echo ${CXX} - ${CXX} --version - ${CXX} -v script: - mkdir -p build - cd build - cmake ${CMAKE_OPTIONS} -DCMAKE_C_FLAGS=${C_FLAGS} -DCMAKE_CXX_FLAGS=${CXX_FLAGS} .. - make -j4 # Only watch the master branch branches: only: - master conky-1.12.2/3rdparty/toluapp/CMakeLists.txt000066400000000000000000000030401404127277500207220ustar00rootroot00000000000000# Copyright (C) 2007-2012 LuaDist. # Created by Peter Kapec # Redistribution and use of this file is allowed according to the terms of the MIT license. # For details see the COPYRIGHT file distributed with LuaDist. # Please note that the package source code is licensed under its own license. project ( toluapp C ) cmake_minimum_required ( VERSION 3.4 ) # Disable dist stuff, we're not installing this as a lib # include ( cmake/dist.cmake ) include(FindPkgConfig) pkg_search_module(LUA REQUIRED lua>=5.3 lua5.3 lua-5.3 lua53 lua5.2 lua-5.2 lua52) include_directories ( include src/lib ${LUA_INCLUDE_DIRS} ) # Build lib file ( GLOB SRC_LIBTOLUAPP src/lib/*.c ) if ( MSVC ) set ( DEF_FILE libtoluapp.def ) endif ( ) # add_library ( toluapp_lib SHARED ${SRC_LIBTOLUAPP} ${DEF_FILE} ) add_library ( toluapp_lib_static STATIC ${SRC_LIBTOLUAPP} ${DEF_FILE} ) target_link_libraries ( toluapp_lib_static ${LUA_LIBRARIES} ) set_target_properties ( toluapp_lib_static PROPERTIES COMPILE_FLAGS -fPIC) # -fPIC required for static linking set_target_properties ( toluapp_lib_static PROPERTIES OUTPUT_NAME toluapp CLEAN_DIRECT_OUTPUT 1 ) # Build app include_directories ( src/bin ) set ( SRC_TOLUA src/bin/tolua.c src/bin/toluabind.c ) add_executable ( toluapp ${SRC_TOLUA} ) target_link_libraries ( toluapp toluapp_lib_static ${LUA_LIBRARIES} ) # Disable installation, we don't need these at runtime for Conky # Install #install_library ( toluapp_lib ) #install_executable ( toluapp ) #install_header ( include/ ) #install_data ( README INSTALL ) #install_doc ( doc/ ) conky-1.12.2/3rdparty/toluapp/COPYRIGHT000066400000000000000000000027701404127277500174660ustar00rootroot00000000000000tolua++ License --------------- tolua++ is based on toLua (www.tecgraf.puc-rio.br/~celes/tolua), and it's licensed under the terms of the MIT license reproduced below. This means that Lua is free software and can be used for both academic and commercial purposes at absolutely no cost. =============================================================================== Copyright (C) 2009 Ariel Manzur. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. =============================================================================== (end of COPYRIGHT) conky-1.12.2/3rdparty/toluapp/INSTALL000066400000000000000000000032531404127277500172210ustar00rootroot00000000000000This version of tolua++ uses SCons to compile (http://www.scons.org). SCons uses pythin. If you don't want to install python, check "Installation without scons" below. * Installation 1. Edit the "config" file for your platform to suit your environment, if at all necessary (for cygwin, mingw, BSD and mac OSX use 'config_posix') 2. Then, type "scons". You can use 'scons -h' to see a list of available command line options. * What you get If "scons" succeeds, you get: * an executable to generate binding code in ./bin; * the C library to be linked in your application in ./lib; * the include file needed to compile your application in ./include. These are the only directories you need for development, besides Lua. You can use 'scons install' to install the files, see the 'prefix' option. * Installation without scons The instructions for building tolua++ without scons depend on the particular compiler you are using. The simplest way is to create a folder with all .c and .h files except 'toluabind_default.c', and then create a project for the executable and the library, as follows: tolua.exe: all *.c *.h in src/bin (except toluabind_default.c) tolua.lib: all *.c *.h in src/lib. * Installation with Microsoft Visual Studio The directory 'win32' contains project files for Microsoft Visual Studio 7 (contributed by Makoto Hamanaka). The project has 4 different build options: withLua50_Release, withLua51_Release, withLua50_Debug and withLua51_Debug. They all expect the lua library names used by the LuaBinaries packages (http://luabinaries.luaforge.net/). The resulting files are built on /lib and /bin (for the library and tolua++.exe). conky-1.12.2/3rdparty/toluapp/Makefile000066400000000000000000000002011404127277500176160ustar00rootroot00000000000000# makefile for tolua hierarchy all: @echo "Makefile is deprecated ;)" @echo "see INSTALL for details on how to build tolua++" conky-1.12.2/3rdparty/toluapp/README-5.1000077500000000000000000000031141404127277500173500ustar00rootroot00000000000000Compiling for lua 5.1 --------------------- Starting from version 1.0.8pre1, tolua++ can be compiled with both lua 5.0 and 5.1. Both versions will output the same code, and the C API (tolua++.h) is the same. The build system is not yet ready to detect/decide when to compile for 5.1, the easiest way right now is to add a file called 'custom.py' on the root of the package, with the following: ## BEGIN custom.py CCFLAGS = ['-I/usr/local/include/lua5.1', '-O2', '-ansi'] LIBPATH = ['/usr/local/lib'] LIBS = ['lua5.1', 'dl', 'm'] tolua_bin = 'tolua++5.1' tolua_lib = 'tolua++5.1' TOLUAPP = 'tolua++5.1' ## END custom.py This will build the binary as 'tolua++5.1' and the library as 'libtolua++5.1.a' (taken from tolua_bin and tolua_lib), and take the lua headers and libraries from /usr/local/include/lua5.1 and /usr/local/lib. It will also link with '-llua5.1'. Modify the parameters acording to your system. Compatibility ------------- There are a couple of things to keep in mind when running code inside tolua using the -L option: * `...' and arg: you can still use 'arg' on 5.1, this is done automatically by adding the 'arg' declaration to functions on files loaded with dofile. For example, the line: function foo( ... ) becomes function foo( ... ) local arg = {n=select('#', ...), ...}; This lets you use the same code on both versions without having to make any modifications. * keep in mind that there are slight differences on the way string.gsub works, and the original version of the function is always kept, so it will behave diffently depending on which version of lua you're using. conky-1.12.2/3rdparty/toluapp/README.md000066400000000000000000000021651404127277500174500ustar00rootroot00000000000000[![Build Status](https://travis-ci.org/brndnmtthws/toluapp.svg?branch=master)](https://travis-ci.org/brndnmtthws/toluapp) # tolua++ ## What is tolua++? tolua++ is an extension of toLua, a tool to integrate C/C++ code with Lua. tolua++ includes new features oriented to c++, such as class templates. tolua is a tool that greatly simplifies the integration of C/C++ code with Lua. Based on a "cleaned" header file, tolua automatically generates the binding code to access C/C++ features from Lua. Using Lua-5.0 API and metamethod facilities, the current version automatically maps C/C++ constants, external variables, functions, namespace, classes, and methods to Lua. It also provides facilities to create Lua modules. ## Availability tolua++ is freely available for both academic and commercial purposes. See COPYRIGHT for details. tolua++ can be downloaded from the sites below: http://www.codenix.com/~tolua/ ## Installation See INSTALL. Contacting the author tolua has been designed and implemented by Waldemar Celes. tolua++ is maintained by Ariel Manzur. Send your comments, bug reports and anything else to tolua@codenix.com conky-1.12.2/3rdparty/toluapp/SConstruct000066400000000000000000000115151404127277500202220ustar00rootroot00000000000000import sys; import os tools = ['default'] if os.name == 'nt': tools = ['mingw'] env = Environment(tools = tools) options_file = None if sys.platform == 'linux2': options_file = "linux" elif 'msvc' in env['TOOLS']: options_file = "msvc" else: options_file = "posix" opts = Options(["config_"+options_file+".py", "custom.py", "custom_"+options_file+".py"], ARGUMENTS) opts.Add('CC', 'The C compiler.') opts.Add('CXX', 'The C++ compiler (for the tests)') opts.Add('CCFLAGS', 'Flags for the compiler.', ['-O2', '-Wall']) opts.Add('LINK', 'The linker.') opts.Add('LINKFLAGS', 'Linker flags.', []) opts.Add('no_cygwin', 'Use -mno-cygwin to build using the mingw compiler on cygwin', 0) opts.Add('LIBS', 'libraries', []) opts.Add('LIBPATH', 'library path', []) opts.Add('tolua_bin', 'the resulting binary', 'tolua++') opts.Add('tolua_lib', 'the resulting library', 'tolua++') opts.Add('TOLUAPP', 'the name of the tolua++ binary (to use with built_dev=1)', 'tolua++') opts.Add('prefix', 'The installation prefix') opts.Add('build_dev', 'Build for development (uses tolua to rebuild toluabind.c with the embeded scripts', 0) opts.Add('build_failsafe', "Build using 'factory default' toluabind file (in case build_dev fails)", 0) opts.Add('ENV', 'The environment variables') opts.Add('shared', 'Build a shared object', False) opts.Update(env) Help(opts.GenerateHelpText(env)) def save_config(target, source, env): opts.Save('custom.py', env) cust = env.Command('custom.py', [], save_config) env.Alias('configure', [cust]) env['TOLUAPP_BOOTSTRAP'] = env['tolua_bin']+"_bootstrap"+env['PROGSUFFIX'] env['build_dev'] = int(env['build_dev']) ## detecting the install directory on win32 if 'msvc' in env['TOOLS'] and not (env.has_key('prefix') or env['prefix']): if env['MSVS'].has_key('PLATFORMSDKDIR'): env['prefix'] = env['MSVS']['PLATFORMSDKDIR'] SConscriptChdir(0) ############ helper builders def pkg_scan_dep(self, target, source): import re ## TODO: detectar si el archivo existe antes de abrirlo asi nomas pkg = open(source, "rt") for linea in pkg.xreadlines(): dep = re.search("^[\t\w]*\$[cphl]file\s*\"([^\"]+)\"", linea) if dep: self.Depends(target, '#' + dep.groups()[0]); if dep.groups()[0][-4:] == '.pkg': # recursividad self.pkg_scan_dep(target, dep.groups()[0]) def make_tolua_code(self, target, source, pkgname = None, bootstrap = False, use_own = False, use_typeid=None): ptarget = Dir('.').path + '/' + target psource = Dir('.').path + '/' + source header = target[:-2] + '.h' pheader = Dir('.').path + '/' + header print("Generating ", target, " from ", source) tolua = "" if bootstrap: if os.name == 'nt': tolua = 'bin\\'+self['TOLUAPP_BOOTSTRAP'] else: tolua = 'bin/'+self['TOLUAPP_BOOTSTRAP'] print("********* tolua is ", tolua) else: if use_own: if 'msvc' in self['TOOLS']: tolua = 'bin\\$tolua_bin' else: tolua = 'bin/$tolua_bin' else: tolua = "$TOLUAPP" if pkgname: pkgname = ' -n '+pkgname else: pkgname = '' if use_typeid: tolua = tolua+' -t' comando = tolua + ' -C -H ' + pheader + ' -o ' + ptarget + pkgname + ' ' + psource command = self.Command(target, source, comando) self.SideEffect(header, target) self.Depends(target, source) self.pkg_scan_dep(target, psource) if bootstrap: self.Depends(target, "#/bin/$TOLUAPP_BOOTSTRAP") if use_own: self.Depends(target, "#/bin/$tolua_bin") return command env.__class__.LuaBinding = make_tolua_code; env.__class__.pkg_scan_dep = pkg_scan_dep; def print_install_error(target, source, env): msg = """Error: no install prefix was specified, or detected. you can use the 'prefix' option on command line to specify one. Examples: scons prefix=/usr/local install or on Windows: scons "prefix=c:\\program files\\visual basic" install Files will be installed on /bin, /lib and /include """ import SCons.Errors raise SCons.Errors.UserError(msg) ########### end of helper builders env['CPPPATH'] = '#/include' env['LIBPATH'] = ['#/lib'] + env['LIBPATH'] if env['no_cygwin']: env['CCFLAGS'] += ['-mno-cygwin'] env['LINKFLAGS'] += ['-mno-cygwin'] import string Export('env') SConscript('src/lib/SCsub') SConscript('src/bin/SCsub') #SConscript('src/lib/SCsub') SConscript('src/tests/SCsub') env.Alias('all', [env.bin_target, env.lib_target]) env.Alias('test', env.test_targets) Default('all') if env['prefix']: env.Install(env['prefix']+'/bin', env.bin_target) env.Install(env['prefix']+'/lib', env.lib_target) env.Install(env['prefix']+'/include', '#include/tolua++.h') env.Alias('install', [env['prefix']+'/bin', env['prefix']+'/include', env['prefix']+'/lib']) else: env.Command('install', [], print_install_error) env.Depends('install', 'all') env.Command('deb', [], 'dpkg-buildpackage -I.svn -Icustom.py -Itoluabind_dev.c -Itoluabind_dev.h -Itoluabind_default.o -Icustom.lua -I.sconsign', ENV=os.environ) conky-1.12.2/3rdparty/toluapp/cmake/000077500000000000000000000000001404127277500172455ustar00rootroot00000000000000conky-1.12.2/3rdparty/toluapp/cmake/dist.cmake000066400000000000000000000310071404127277500212130ustar00rootroot00000000000000# LuaDist CMake utility library. # Provides sane project defaults and macros common to LuaDist CMake builds. # # Copyright (C) 2007-2012 LuaDist. # by David Manura, Peter Drahoš # Redistribution and use of this file is allowed according to the terms of the MIT license. # For details see the COPYRIGHT file distributed with LuaDist. # Please note that the package source code is licensed under its own license. ## Extract information from dist.info if ( NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/dist.info ) message ( FATAL_ERROR "Missing dist.info file (${CMAKE_CURRENT_SOURCE_DIR}/dist.info)." ) endif () file ( READ ${CMAKE_CURRENT_SOURCE_DIR}/dist.info DIST_INFO ) if ( "${DIST_INFO}" STREQUAL "" ) message ( FATAL_ERROR "Failed to load dist.info." ) endif () # Reads field `name` from dist.info string `DIST_INFO` into variable `var`. macro ( _parse_dist_field name var ) string ( REGEX REPLACE ".*${name}[ \t]?=[ \t]?[\"']([^\"']+)[\"'].*" "\\1" ${var} "${DIST_INFO}" ) if ( ${var} STREQUAL DIST_INFO ) message ( FATAL_ERROR "Failed to extract \"${var}\" from dist.info" ) endif () endmacro () # _parse_dist_field ( name DIST_NAME ) _parse_dist_field ( version DIST_VERSION ) _parse_dist_field ( license DIST_LICENSE ) _parse_dist_field ( author DIST_AUTHOR ) _parse_dist_field ( maintainer DIST_MAINTAINER ) _parse_dist_field ( url DIST_URL ) _parse_dist_field ( desc DIST_DESC ) message ( "DIST_NAME: ${DIST_NAME}") message ( "DIST_VERSION: ${DIST_VERSION}") message ( "DIST_LICENSE: ${DIST_LICENSE}") message ( "DIST_AUTHOR: ${DIST_AUTHOR}") message ( "DIST_MAINTAINER: ${DIST_MAINTAINER}") message ( "DIST_URL: ${DIST_URL}") message ( "DIST_DESC: ${DIST_DESC}") string ( REGEX REPLACE ".*depends[ \t]?=[ \t]?[\"']([^\"']+)[\"'].*" "\\1" DIST_DEPENDS ${DIST_INFO} ) if ( DIST_DEPENDS STREQUAL DIST_INFO ) set ( DIST_DEPENDS "" ) endif () message ( "DIST_DEPENDS: ${DIST_DEPENDS}") ## 2DO: Parse DIST_DEPENDS and try to install Dependencies with automatically using externalproject_add ## INSTALL DEFAULTS (Relative to CMAKE_INSTALL_PREFIX) # Primary paths set ( INSTALL_BIN bin CACHE PATH "Where to install binaries to." ) set ( INSTALL_LIB lib CACHE PATH "Where to install libraries to." ) set ( INSTALL_INC include CACHE PATH "Where to install headers to." ) set ( INSTALL_ETC etc CACHE PATH "Where to store configuration files" ) set ( INSTALL_SHARE share CACHE PATH "Directory for shared data." ) # Secondary paths option ( INSTALL_VERSION "Install runtime libraries and executables with version information." OFF) set ( INSTALL_DATA ${INSTALL_SHARE}/${DIST_NAME} CACHE PATH "Directory the package can store documentation, tests or other data in.") set ( INSTALL_DOC ${INSTALL_DATA}/doc CACHE PATH "Recommended directory to install documentation into.") set ( INSTALL_EXAMPLE ${INSTALL_DATA}/example CACHE PATH "Recommended directory to install examples into.") set ( INSTALL_TEST ${INSTALL_DATA}/test CACHE PATH "Recommended directory to install tests into.") set ( INSTALL_FOO ${INSTALL_DATA}/etc CACHE PATH "Where to install additional files") # Tweaks and other defaults # Setting CMAKE to use loose block and search for find modules in source directory set ( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true ) set ( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH} ) option ( BUILD_SHARED_LIBS "Build shared libraries" ON ) # In MSVC, prevent warnings that can occur when using standard libraries. if ( MSVC ) add_definitions ( -D_CRT_SECURE_NO_WARNINGS ) endif () ## MACROS # Parser macro macro ( parse_arguments prefix arg_names option_names) set ( DEFAULT_ARGS ) foreach ( arg_name ${arg_names} ) set ( ${prefix}_${arg_name} ) endforeach () foreach ( option ${option_names} ) set ( ${prefix}_${option} FALSE ) endforeach () set ( current_arg_name DEFAULT_ARGS ) set ( current_arg_list ) foreach ( arg ${ARGN} ) set ( larg_names ${arg_names} ) list ( FIND larg_names "${arg}" is_arg_name ) if ( is_arg_name GREATER -1 ) set ( ${prefix}_${current_arg_name} ${current_arg_list} ) set ( current_arg_name ${arg} ) set ( current_arg_list ) else () set ( loption_names ${option_names} ) list ( FIND loption_names "${arg}" is_option ) if ( is_option GREATER -1 ) set ( ${prefix}_${arg} TRUE ) else () set ( current_arg_list ${current_arg_list} ${arg} ) endif () endif () endforeach () set ( ${prefix}_${current_arg_name} ${current_arg_list} ) endmacro () # install_executable ( executable_targets ) # Installs any executables generated using "add_executable". # USE: install_executable ( lua ) # NOTE: subdirectories are NOT supported set ( CPACK_COMPONENT_RUNTIME_DISPLAY_NAME "${DIST_NAME} Runtime" ) set ( CPACK_COMPONENT_RUNTIME_DESCRIPTION "Executables and runtime libraries. Installed into ${INSTALL_BIN}." ) macro ( install_executable ) foreach ( _file ${ARGN} ) if ( INSTALL_VERSION ) set_target_properties ( ${_file} PROPERTIES VERSION ${DIST_VERSION} SOVERSION ${DIST_VERSION} ) endif () install ( TARGETS ${_file} RUNTIME DESTINATION ${INSTALL_BIN} COMPONENT Runtime ) endforeach() endmacro () # install_library ( library_targets ) # Installs any libraries generated using "add_library" into apropriate places. # USE: install_library ( libexpat ) # NOTE: subdirectories are NOT supported set ( CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "${DIST_NAME} Development Libraries" ) set ( CPACK_COMPONENT_LIBRARY_DESCRIPTION "Static and import libraries needed for development. Installed into ${INSTALL_LIB} or ${INSTALL_BIN}." ) macro ( install_library ) foreach ( _file ${ARGN} ) if ( INSTALL_VERSION ) set_target_properties ( ${_file} PROPERTIES VERSION ${DIST_VERSION} SOVERSION ${DIST_VERSION} ) endif () install ( TARGETS ${_file} RUNTIME DESTINATION ${INSTALL_BIN} COMPONENT Runtime LIBRARY DESTINATION ${INSTALL_LIB} COMPONENT Runtime ARCHIVE DESTINATION ${INSTALL_LIB} COMPONENT Library ) endforeach() endmacro () # helper function for various install_* functions, for PATTERN/REGEX args. macro ( _complete_install_args ) if ( NOT("${_ARG_PATTERN}" STREQUAL "") ) set ( _ARG_PATTERN PATTERN ${_ARG_PATTERN} ) endif () if ( NOT("${_ARG_REGEX}" STREQUAL "") ) set ( _ARG_REGEX REGEX ${_ARG_REGEX} ) endif () endmacro () # install_header ( files/directories [INTO destination] ) # Install a directories or files into header destination. # USE: install_header ( lua.h luaconf.h ) or install_header ( GL ) # USE: install_header ( mylib.h INTO mylib ) # For directories, supports optional PATTERN/REGEX arguments like install(). set ( CPACK_COMPONENT_HEADER_DISPLAY_NAME "${DIST_NAME} Development Headers" ) set ( CPACK_COMPONENT_HEADER_DESCRIPTION "Headers needed for development. Installed into ${INSTALL_INC}." ) macro ( install_header ) parse_arguments ( _ARG "INTO;PATTERN;REGEX" "" ${ARGN} ) _complete_install_args() foreach ( _file ${_ARG_DEFAULT_ARGS} ) if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" ) install ( DIRECTORY ${_file} DESTINATION ${INSTALL_INC}/${_ARG_INTO} COMPONENT Header ${_ARG_PATTERN} ${_ARG_REGEX} ) else () install ( FILES ${_file} DESTINATION ${INSTALL_INC}/${_ARG_INTO} COMPONENT Header ) endif () endforeach() endmacro () # install_data ( files/directories [INTO destination] ) # This installs additional data files or directories. # USE: install_data ( extra data.dat ) # USE: install_data ( image1.png image2.png INTO images ) # For directories, supports optional PATTERN/REGEX arguments like install(). set ( CPACK_COMPONENT_DATA_DISPLAY_NAME "${DIST_NAME} Data" ) set ( CPACK_COMPONENT_DATA_DESCRIPTION "Application data. Installed into ${INSTALL_DATA}." ) macro ( install_data ) parse_arguments ( _ARG "INTO;PATTERN;REGEX" "" ${ARGN} ) _complete_install_args() foreach ( _file ${_ARG_DEFAULT_ARGS} ) if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" ) install ( DIRECTORY ${_file} DESTINATION ${INSTALL_DATA}/${_ARG_INTO} COMPONENT Data ${_ARG_PATTERN} ${_ARG_REGEX} ) else () install ( FILES ${_file} DESTINATION ${INSTALL_DATA}/${_ARG_INTO} COMPONENT Data ) endif () endforeach() endmacro () # INSTALL_DOC ( files/directories [INTO destination] ) # This installs documentation content # USE: install_doc ( doc/ doc.pdf ) # USE: install_doc ( index.html INTO html ) # For directories, supports optional PATTERN/REGEX arguments like install(). set ( CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME "${DIST_NAME} Documentation" ) set ( CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION "Application documentation. Installed into ${INSTALL_DOC}." ) macro ( install_doc ) parse_arguments ( _ARG "INTO;PATTERN;REGEX" "" ${ARGN} ) _complete_install_args() foreach ( _file ${_ARG_DEFAULT_ARGS} ) if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" ) install ( DIRECTORY ${_file} DESTINATION ${INSTALL_DOC}/${_ARG_INTO} COMPONENT Documentation ${_ARG_PATTERN} ${_ARG_REGEX} ) else () install ( FILES ${_file} DESTINATION ${INSTALL_DOC}/${_ARG_INTO} COMPONENT Documentation ) endif () endforeach() endmacro () # install_example ( files/directories [INTO destination] ) # This installs additional examples # USE: install_example ( examples/ exampleA ) # USE: install_example ( super_example super_data INTO super) # For directories, supports optional PATTERN/REGEX argument like install(). set ( CPACK_COMPONENT_EXAMPLE_DISPLAY_NAME "${DIST_NAME} Examples" ) set ( CPACK_COMPONENT_EXAMPLE_DESCRIPTION "Examples and their associated data. Installed into ${INSTALL_EXAMPLE}." ) macro ( install_example ) parse_arguments ( _ARG "INTO;PATTERN;REGEX" "" ${ARGN} ) _complete_install_args() foreach ( _file ${_ARG_DEFAULT_ARGS} ) if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" ) install ( DIRECTORY ${_file} DESTINATION ${INSTALL_EXAMPLE}/${_ARG_INTO} COMPONENT Example ${_ARG_PATTERN} ${_ARG_REGEX} ) else () install ( FILES ${_file} DESTINATION ${INSTALL_EXAMPLE}/${_ARG_INTO} COMPONENT Example ) endif () endforeach() endmacro () # install_test ( files/directories [INTO destination] ) # This installs tests and test files, DOES NOT EXECUTE TESTS # USE: install_test ( my_test data.sql ) # USE: install_test ( feature_x_test INTO x ) # For directories, supports optional PATTERN/REGEX argument like install(). set ( CPACK_COMPONENT_TEST_DISPLAY_NAME "${DIST_NAME} Tests" ) set ( CPACK_COMPONENT_TEST_DESCRIPTION "Tests and associated data. Installed into ${INSTALL_TEST}." ) macro ( install_test ) parse_arguments ( _ARG "INTO;PATTERN;REGEX" "" ${ARGN} ) _complete_install_args() foreach ( _file ${_ARG_DEFAULT_ARGS} ) if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" ) install ( DIRECTORY ${_file} DESTINATION ${INSTALL_TEST}/${_ARG_INTO} COMPONENT Test ${_ARG_PATTERN} ${_ARG_REGEX} ) else () install ( FILES ${_file} DESTINATION ${INSTALL_TEST}/${_ARG_INTO} COMPONENT Test ) endif () endforeach() endmacro () # install_foo ( files/directories [INTO destination] ) # This installs optional or otherwise unneeded content # USE: install_foo ( etc/ example.doc ) # USE: install_foo ( icon.png logo.png INTO icons) # For directories, supports optional PATTERN/REGEX argument like install(). set ( CPACK_COMPONENT_OTHER_DISPLAY_NAME "${DIST_NAME} Unspecified Content" ) set ( CPACK_COMPONENT_OTHER_DESCRIPTION "Other unspecified content. Installed into ${INSTALL_FOO}." ) macro ( install_foo ) parse_arguments ( _ARG "INTO;PATTERN;REGEX" "" ${ARGN} ) _complete_install_args() foreach ( _file ${_ARG_DEFAULT_ARGS} ) if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" ) install ( DIRECTORY ${_file} DESTINATION ${INSTALL_FOO}/${_ARG_INTO} COMPONENT Other ${_ARG_PATTERN} ${_ARG_REGEX} ) else () install ( FILES ${_file} DESTINATION ${INSTALL_FOO}/${_ARG_INTO} COMPONENT Other ) endif () endforeach() endmacro () ## CTest defaults ## CPack defaults set ( CPACK_GENERATOR "ZIP" ) set ( CPACK_STRIP_FILES TRUE ) set ( CPACK_PACKAGE_NAME "${DIST_NAME}" ) set ( CPACK_PACKAGE_VERSION "${DIST_VERSION}") set ( CPACK_PACKAGE_VENDOR "LuaDist" ) set ( CPACK_COMPONENTS_ALL Runtime Library Header Data Documentation Example Other ) include ( CPack ) conky-1.12.2/3rdparty/toluapp/cmake/lua.cmake000066400000000000000000000266271404127277500210450ustar00rootroot00000000000000# LuaDist CMake utility library for Lua. # # Copyright (C) 2007-2012 LuaDist. # by David Manura, Peter Drahos # Redistribution and use of this file is allowed according to the terms of the MIT license. # For details see the COPYRIGHT file distributed with LuaDist. # Please note that the package source code is licensed under its own license. set ( INSTALL_LMOD ${INSTALL_LIB}/lua CACHE PATH "Directory to install Lua modules." ) set ( INSTALL_CMOD ${INSTALL_LIB}/lua CACHE PATH "Directory to install Lua binary modules." ) option ( SKIP_LUA_WRAPPER "Do not build and install Lua executable wrappers." OFF) # List of (Lua module name, file path) pairs. # Used internally by add_lua_test. Built by add_lua_module. set ( _lua_modules ) # utility function: appends path `path` to path `basepath`, properly # handling cases when `path` may be relative or absolute. macro ( _append_path basepath path result ) if ( IS_ABSOLUTE "${path}" ) set ( ${result} "${path}" ) else () set ( ${result} "${basepath}/${path}" ) endif () endmacro () # install_lua_executable ( target source ) # Automatically generate a binary if srlua package is available # The application or its source will be placed into /bin # If the application source did not have .lua suffix then it will be added # USE: lua_executable ( sputnik src/sputnik.lua ) macro ( install_lua_executable _name _source ) get_filename_component ( _source_name ${_source} NAME_WE ) # Find srlua and glue find_program( SRLUA_EXECUTABLE NAMES srlua ) find_program( GLUE_EXECUTABLE NAMES glue ) # Executable output set ( _exe ${CMAKE_CURRENT_BINARY_DIR}/${_name}${CMAKE_EXECUTABLE_SUFFIX} ) if ( NOT SKIP_LUA_WRAPPER AND SRLUA_EXECUTABLE AND GLUE_EXECUTABLE ) # Generate binary gluing the lua code to srlua, this is a robuust approach for most systems add_custom_command( OUTPUT ${_exe} COMMAND ${GLUE_EXECUTABLE} ARGS ${SRLUA_EXECUTABLE} ${_source} ${_exe} DEPENDS ${_source} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} VERBATIM ) # Make sure we have a target associated with the binary add_custom_target(${_name} ALL DEPENDS ${_exe} ) # Install with run permissions install ( PROGRAMS ${_exe} DESTINATION ${INSTALL_BIN} COMPONENT Runtime) # Also install source as optional resurce install ( FILES ${_source} DESTINATION ${INSTALL_FOO} COMPONENT Other ) else() # Install into bin as is but without the lua suffix, we assume the executable uses UNIX shebang/hash-bang magic install ( PROGRAMS ${_source} DESTINATION ${INSTALL_BIN} RENAME ${_source_name} COMPONENT Runtime ) endif() endmacro () macro ( _lua_module_helper is_install _name ) parse_arguments ( _MODULE "LINK;ALL_IN_ONE" "" ${ARGN} ) # _target is CMake-compatible target name for module (e.g. socket_core). # _module is relative path of target (e.g. socket/core), # without extension (e.g. .lua/.so/.dll). # _MODULE_SRC is list of module source files (e.g. .lua and .c files). # _MODULE_NAMES is list of module names (e.g. socket.core). if ( _MODULE_ALL_IN_ONE ) string ( REGEX REPLACE "\\..*" "" _target "${_name}" ) string ( REGEX REPLACE "\\..*" "" _module "${_name}" ) set ( _target "${_target}_all_in_one") set ( _MODULE_SRC ${_MODULE_ALL_IN_ONE} ) set ( _MODULE_NAMES ${_name} ${_MODULE_DEFAULT_ARGS} ) else () string ( REPLACE "." "_" _target "${_name}" ) string ( REPLACE "." "/" _module "${_name}" ) set ( _MODULE_SRC ${_MODULE_DEFAULT_ARGS} ) set ( _MODULE_NAMES ${_name} ) endif () if ( NOT _MODULE_SRC ) message ( FATAL_ERROR "no module sources specified" ) endif () list ( GET _MODULE_SRC 0 _first_source ) get_filename_component ( _ext ${_first_source} EXT ) if ( _ext STREQUAL ".lua" ) # Lua source module list ( LENGTH _MODULE_SRC _len ) if ( _len GREATER 1 ) message ( FATAL_ERROR "more than one source file specified" ) endif () set ( _module "${_module}.lua" ) get_filename_component ( _module_dir ${_module} PATH ) get_filename_component ( _module_filename ${_module} NAME ) _append_path ( "${CMAKE_CURRENT_SOURCE_DIR}" "${_first_source}" _module_path ) list ( APPEND _lua_modules "${_name}" "${_module_path}" ) if ( ${is_install} ) install ( FILES ${_first_source} DESTINATION ${INSTALL_LMOD}/${_module_dir} RENAME ${_module_filename} COMPONENT Runtime ) endif () else () # Lua C binary module enable_language ( C ) find_package ( Lua REQUIRED ) include_directories ( ${LUA_INCLUDE_DIR} ) set ( _module "${_module}${CMAKE_SHARED_MODULE_SUFFIX}" ) get_filename_component ( _module_dir ${_module} PATH ) get_filename_component ( _module_filenamebase ${_module} NAME_WE ) foreach ( _thisname ${_MODULE_NAMES} ) list ( APPEND _lua_modules "${_thisname}" "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_CFG_INTDIR}/${_module}" ) endforeach () add_library( ${_target} MODULE ${_MODULE_SRC}) target_link_libraries ( ${_target} ${LUA_LIBRARY} ${_MODULE_LINK} ) set_target_properties ( ${_target} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${_module_dir}" PREFIX "" OUTPUT_NAME "${_module_filenamebase}" ) if ( ${is_install} ) install ( TARGETS ${_target} DESTINATION ${INSTALL_CMOD}/${_module_dir} COMPONENT Runtime) endif () endif () endmacro () # add_lua_module # Builds a Lua source module into a destination locatable by Lua # require syntax. # Binary modules are also supported where this function takes sources and # libraries to compile separated by LINK keyword. # USE: add_lua_module ( socket.http src/http.lua ) # USE2: add_lua_module ( mime.core src/mime.c ) # USE3: add_lua_module ( socket.core ${SRC_SOCKET} LINK ${LIB_SOCKET} ) # USE4: add_lua_module ( ssl.context ssl.core ALL_IN_ONE src/context.c src/ssl.c ) # This form builds an "all-in-one" module (e.g. ssl.so or ssl.dll containing # both modules ssl.context and ssl.core). The CMake target name will be # ssl_all_in_one. # Also sets variable _module_path (relative path where module typically # would be installed). macro ( add_lua_module ) _lua_module_helper ( 0 ${ARGN} ) endmacro () # install_lua_module # This is the same as `add_lua_module` but also installs the module. # USE: install_lua_module ( socket.http src/http.lua ) # USE2: install_lua_module ( mime.core src/mime.c ) # USE3: install_lua_module ( socket.core ${SRC_SOCKET} LINK ${LIB_SOCKET} ) macro ( install_lua_module ) _lua_module_helper ( 1 ${ARGN} ) endmacro () # Builds string representing Lua table mapping Lua modules names to file # paths. Used internally. macro ( _make_module_table _outvar ) set ( ${_outvar} ) list ( LENGTH _lua_modules _n ) if ( ${_n} GREATER 0 ) # avoids cmake complaint foreach ( _i RANGE 1 ${_n} 2 ) list ( GET _lua_modules ${_i} _path ) math ( EXPR _ii ${_i}-1 ) list ( GET _lua_modules ${_ii} _name ) set ( ${_outvar} "${_table} ['${_name}'] = '${_path}'\;\n") endforeach () endif () set ( ${_outvar} "local modules = { ${_table}}" ) endmacro () # add_lua_test ( _testfile [ WORKING_DIRECTORY _working_dir ] ) # Runs Lua script `_testfile` under CTest tester. # Optional named argument `WORKING_DIRECTORY` is current working directory to # run test under (defaults to ${CMAKE_CURRENT_BINARY_DIR}). # Both paths, if relative, are relative to ${CMAKE_CURRENT_SOURCE_DIR}. # Any modules previously defined with install_lua_module are automatically # preloaded (via package.preload) prior to running the test script. # Under LuaDist, set test=true in config.lua to enable testing. # USE: add_lua_test ( test/test1.lua [args...] [WORKING_DIRECTORY dir]) macro ( add_lua_test _testfile ) if ( NOT SKIP_TESTING ) parse_arguments ( _ARG "WORKING_DIRECTORY" "" ${ARGN} ) include ( CTest ) find_program ( LUA NAMES lua lua.bat ) get_filename_component ( TESTFILEABS ${_testfile} ABSOLUTE ) get_filename_component ( TESTFILENAME ${_testfile} NAME ) get_filename_component ( TESTFILEBASE ${_testfile} NAME_WE ) # Write wrapper script. # Note: One simple way to allow the script to find modules is # to just put them in package.preload. set ( TESTWRAPPER ${CMAKE_CURRENT_BINARY_DIR}/${TESTFILENAME} ) _make_module_table ( _table ) set ( TESTWRAPPERSOURCE "local CMAKE_CFG_INTDIR = ... or '.' ${_table} local function preload_modules(modules) for name, path in pairs(modules) do if path:match'%.lua' then package.preload[name] = assert(loadfile(path)) else local name = name:gsub('.*%-', '') -- remove any hyphen prefix local symbol = 'luaopen_' .. name:gsub('%.', '_') --improve: generalize to support all-in-one loader? local path = path:gsub('%$%{CMAKE_CFG_INTDIR%}', CMAKE_CFG_INTDIR) package.preload[name] = assert(package.loadlib(path, symbol)) end end end preload_modules(modules) arg[0] = '${TESTFILEABS}' table.remove(arg, 1) return assert(loadfile '${TESTFILEABS}')(unpack(arg)) " ) if ( _ARG_WORKING_DIRECTORY ) get_filename_component ( TESTCURRENTDIRABS ${_ARG_WORKING_DIRECTORY} ABSOLUTE ) # note: CMake 2.6 (unlike 2.8) lacks WORKING_DIRECTORY parameter. set ( _pre ${CMAKE_COMMAND} -E chdir "${TESTCURRENTDIRABS}" ) endif () file ( WRITE ${TESTWRAPPER} ${TESTWRAPPERSOURCE}) add_test ( NAME ${TESTFILEBASE} COMMAND ${_pre} ${LUA} ${TESTWRAPPER} "${CMAKE_CFG_INTDIR}" ${_ARG_DEFAULT_ARGS} ) endif () # see also http://gdcm.svn.sourceforge.net/viewvc/gdcm/Sandbox/CMakeModules/UsePythonTest.cmake # Note: ${CMAKE_CFG_INTDIR} is a command-line argument to allow proper # expansion by the native build tool. endmacro () # Converts Lua source file `_source` to binary string embedded in C source # file `_target`. Optionally compiles Lua source to byte code (not available # under LuaJIT2, which doesn't have a bytecode loader). Additionally, Lua # versions of bin2c [1] and luac [2] may be passed respectively as additional # arguments. # # [1] http://lua-users.org/wiki/BinToCee # [2] http://lua-users.org/wiki/LuaCompilerInLua function ( add_lua_bin2c _target _source ) find_program ( LUA NAMES lua lua.bat ) execute_process ( COMMAND ${LUA} -e "string.dump(function()end)" RESULT_VARIABLE _LUA_DUMP_RESULT ERROR_QUIET ) if ( NOT ${_LUA_DUMP_RESULT} ) SET ( HAVE_LUA_DUMP true ) endif () message ( "-- string.dump=${HAVE_LUA_DUMP}" ) if ( ARGV2 ) get_filename_component ( BIN2C ${ARGV2} ABSOLUTE ) set ( BIN2C ${LUA} ${BIN2C} ) else () find_program ( BIN2C NAMES bin2c bin2c.bat ) endif () if ( HAVE_LUA_DUMP ) if ( ARGV3 ) get_filename_component ( LUAC ${ARGV3} ABSOLUTE ) set ( LUAC ${LUA} ${LUAC} ) else () find_program ( LUAC NAMES luac luac.bat ) endif () endif ( HAVE_LUA_DUMP ) message ( "-- bin2c=${BIN2C}" ) message ( "-- luac=${LUAC}" ) get_filename_component ( SOURCEABS ${_source} ABSOLUTE ) if ( HAVE_LUA_DUMP ) get_filename_component ( SOURCEBASE ${_source} NAME_WE ) add_custom_command ( OUTPUT ${_target} DEPENDS ${_source} COMMAND ${LUAC} -o ${CMAKE_CURRENT_BINARY_DIR}/${SOURCEBASE}.lo ${SOURCEABS} COMMAND ${BIN2C} ${CMAKE_CURRENT_BINARY_DIR}/${SOURCEBASE}.lo ">${_target}" ) else () add_custom_command ( OUTPUT ${_target} DEPENDS ${SOURCEABS} COMMAND ${BIN2C} ${_source} ">${_target}" ) endif () endfunction() conky-1.12.2/3rdparty/toluapp/config_linux.py000066400000000000000000000012571404127277500212300ustar00rootroot00000000000000 ## This is the linux configuration file # use 'scons -h' to see the list of command line options available # Compiler flags (based on Debian's installation of lua) #LINKFLAGS = ['-g'] CCFLAGS = ['-O2', '-ansi', '-Wall'] #CCFLAGS = ['-I/usr/include/lua50', '-g'] # this is the default directory for installation. Files will be installed on # /bin, /lib and /include when you run 'scons install' # # You can also specify this directory on the command line with the 'prefix' # option # # You can see more 'generic' options for POSIX systems on config_posix.py prefix = '/usr/local' # libraries (based on Debian's installation of lua) LIBS = ['lua', 'dl', 'm'] conky-1.12.2/3rdparty/toluapp/config_msvc.py000066400000000000000000000014051404127277500210340ustar00rootroot00000000000000 ## This is the MSVC configuration file # use 'scons -h' to see the list of command line options available # flags for the compiler CCFLAGS = ['/nologo'] # this is the default directory for installation. Files will be installed on # /bin, /lib and /include when you run 'scons install' # # You can also specify this directory on the command line with the 'prefix' # option # # If you leave it as 'None', we'll try to auto-detect it (as 'PLATFORMSDKDIR' # detected by SCons). prefix = None # (it's a string) # the libraries LIBS = ['lua', 'lualib'] # linkflags LINKFLAGS = ['/nologo'] ## We need to specifiy the environment for the PATH and LIB and all those # parameters cl tales from it import os ENV = os.environ conky-1.12.2/3rdparty/toluapp/config_posix.py000066400000000000000000000011001404127277500212160ustar00rootroot00000000000000 ## This is the POSIX configuration file (will be included for cygwin, mingw # and possibly mac OSX and BSDs) # use 'scons -h' to see the list of command line options available # flags for the compiler #CCFLAGS = [] CCFLAGS = ['-O2', '-ansi', '-Wall'] # this is the default directory for installation. Files will be installed on # /bin, /lib and /include when you run 'scons install' # # You can also specify this directory on the command line with the 'prefix' # option prefix = '/usr/local' # libraries LIBS = ['lua', 'lualib', 'm'] import os conky-1.12.2/3rdparty/toluapp/custom-5.1.py000066400000000000000000000003301404127277500203460ustar00rootroot00000000000000CCFLAGS = ['-I/usr/include/lua5.1', '-O2', '-ansi'] #LIBPATH = ['/usr/local/lib'] LIBS = ['lua5.1', 'dl', 'm'] prefix = '/mingw' #build_dev=1 tolua_bin = 'tolua++5.1' tolua_lib = 'tolua++5.1' TOLUAPP = 'tolua++5.1' conky-1.12.2/3rdparty/toluapp/debian/000077500000000000000000000000001404127277500174075ustar00rootroot00000000000000conky-1.12.2/3rdparty/toluapp/debian/README000066400000000000000000000002321404127277500202640ustar00rootroot00000000000000The Debian Package tolua++ ---------------------------- Comments regarding the Package Ariel Manzur , Thu, 30 Dec 2004 11:59:14 -0300 conky-1.12.2/3rdparty/toluapp/debian/README.Debian000066400000000000000000000002611404127277500214470ustar00rootroot00000000000000tolua++ for Debian ------------------ -- Ariel Manzur , Thu, 30 Dec 2004 11:59:14 -0300 conky-1.12.2/3rdparty/toluapp/debian/changelog000066400000000000000000000062031404127277500212620ustar00rootroot00000000000000tolua++ (1.0.92pre1-1) unstable; urgency=low * fixed array bound check bug * moved parsing of 'extern' keyword to the parser * fixed bug in module name generation from package filename * added -E command line option -- Ariel Manzur Mon, 13 Mar 2006 19:28:14 -0300 tolua++ (1.0.8pre3-1) unstable; urgency=low * changed tolua_touserdata * fixed bugs -- Ariel Manzur Tue, 13 Dec 2005 01:46:33 +0100 tolua++ (1.0.7-1) unstable; urgency=low * added -C flag * added object access * added parser_hook * merged Mildred's patch (sorry, no last name): code on open function is nested, embedded lua chunks have better names -- Ariel Manzur Tue, 18 Oct 2005 22:51:04 -0300 tolua++ (1.0.6-1) unstable; urgency=low * fixed parser bugs * added tolua_property * added TOLUA_PROTECTED_DESTRUCTOR * added inheritance from C objects by lua objects * fixed class constructor bug (calling the class name directly works) -- Ariel Manzur Sat, 6 Aug 2005 09:24:10 -0300 tolua++ (1.0.6pre3-1) unstable; urgency=low * fixed tolua_tocppstring -- Ariel Manzur Sun, 26 Jun 2005 21:01:50 -0300 tolua++ (1.0.6pre2-1) unstable; urgency=low * fixed c compilation bug * added -D flag * fixed tolua.releaseownership? -- Ariel Manzur Mon, 2 May 2005 20:56:04 -0300 tolua++ (1.0.6pre1-1) unstable; urgency=low * something -- Ariel Manzur Wed, 27 Apr 2005 00:09:41 -0300 tolua++ (1.0.5-1) unstable; urgency=low * fixed missed inheritance bug. * ready for 1.0.5 -- Ariel Manzur Fri, 8 Apr 2005 23:15:19 -0300 tolua++ (1.0.5~pre6-1) unstable; urgency=low * fixed bug in tolua.cast (introduced on previous version) -- Ariel Manzur Sat, 2 Apr 2005 00:36:45 -0300 tolua++ (1.0.5~pre5-1) unstable; urgency=low * fixed bug in tolua.cast -- Ariel Manzur Fri, 18 Mar 2005 01:13:55 -0300 tolua++ (1.0.5~pre4-1) unstable; urgency=low * fixed support for overloading methods across multiple class definitions -- Ariel Manzur Thu, 3 Mar 2005 19:03:04 -0300 tolua++ (1.0.5~pre3-1) unstable; urgency=low * fixed bugs in parser -- Ariel Manzur Sun, 20 Feb 2005 19:56:32 -0300 tolua++ (1.0.5~pre2-1) unstable; urgency=low * added tolua_outside -- Ariel Manzur Fri, 11 Feb 2005 02:50:45 -0300 tolua++ (1.0.5~pre1-1) unstable; urgency=low * fixed bug in type detection * fixed bug in code output for static variables -- Ariel Manzur Thu, 3 Feb 2005 02:05:43 -0300 tolua++ (1.0.4-3) unstable; urgency=low * jumped the gun on the previous release -- Ariel Manzur Thu, 20 Jan 2005 23:20:17 -0300 tolua++ (1.0.4-2) unstable; urgency=low * added optimize flags for binary package -- Ariel Manzur Fri, 14 Jan 2005 00:43:09 -0300 tolua++ (1.0.4-1) unstable; urgency=low * Initial Release. -- Ariel Manzur Thu, 30 Dec 2004 11:59:14 -0300 Local variables: mode: debian-changelog End: conky-1.12.2/3rdparty/toluapp/debian/compat000066400000000000000000000000021404127277500206050ustar00rootroot000000000000004 conky-1.12.2/3rdparty/toluapp/debian/conffiles.ex000066400000000000000000000003221404127277500217120ustar00rootroot00000000000000# # If you want to use this conffile, remove all comments and put files that # you want dpkg to process here using their absolute pathnames. # See the policy manual # # for example: # /etc/tolua++/tolua++.conf conky-1.12.2/3rdparty/toluapp/debian/control000066400000000000000000000007121404127277500210120ustar00rootroot00000000000000Source: tolua++ Section: unknown Priority: optional Maintainer: Ariel Manzur Build-Depends: debhelper (>= 4.0.0), scons, liblua50-dev, liblualib50-dev Standards-Version: 3.6.1 Package: tolua++ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, liblua50-dev, liblualib50-dev Description: tolua++ tolua++ is an extended version of tolua, a tool to integrate C/C++ code with Lua. tolua++ includes new features oriented to c++. conky-1.12.2/3rdparty/toluapp/debian/copyright000066400000000000000000000010601404127277500213370ustar00rootroot00000000000000This package is maintained by Ariel Manzur on Sat, 08 Jan 2005 06:11:22 -0300 Latest version can be found on http://www.codenix.com/~tolua/ Upstream Author(s): Waldemar Celes , Ariel Manzur Copyright: Quoted from the README file accompanying tolua: 'tolua is freely available; you can redistribute it and/or modify it. The software provided hereunder is on an "as is" basis, and the author has no obligation to provide maintenance, support, updates, enhancements, or modifications.' conky-1.12.2/3rdparty/toluapp/debian/cron.d.ex000066400000000000000000000001231404127277500211240ustar00rootroot00000000000000# # Regular cron jobs for the tolua++ package # 0 4 * * * root tolua++_maintenance conky-1.12.2/3rdparty/toluapp/debian/dirs000066400000000000000000000000351404127277500202710ustar00rootroot00000000000000usr/bin usr/lib usr/include conky-1.12.2/3rdparty/toluapp/debian/docs000066400000000000000000000000071404127277500202570ustar00rootroot00000000000000README conky-1.12.2/3rdparty/toluapp/debian/emacsen-install.ex000066400000000000000000000023231404127277500230240ustar00rootroot00000000000000#! /bin/sh -e # /usr/lib/emacsen-common/packages/install/tolua++ # Written by Jim Van Zandt , borrowing heavily # from the install scripts for gettext by Santiago Vila # and octave by Dirk Eddelbuettel . FLAVOR=$1 PACKAGE=tolua++ if [ ${FLAVOR} = emacs ]; then exit 0; fi echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR} #FLAVORTEST=`echo $FLAVOR | cut -c-6` #if [ ${FLAVORTEST} = xemacs ] ; then # SITEFLAG="-no-site-file" #else # SITEFLAG="--no-site-file" #fi FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile" ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} # Install-info-altdir does not actually exist. # Maybe somebody will write it. if test -x /usr/sbin/install-info-altdir; then echo install/${PACKAGE}: install Info links for ${FLAVOR} install-info-altdir --quiet --section "" "" --dirname=${FLAVOR} /usr/info/${PACKAGE}.info.gz fi install -m 755 -d ${ELCDIR} cd ${ELDIR} FILES=`echo *.el` cp ${FILES} ${ELCDIR} cd ${ELCDIR} cat << EOF > path.el (setq load-path (cons "." load-path) byte-compile-warnings nil) EOF ${FLAVOR} ${FLAGS} ${FILES} rm -f *.el path.el exit 0 conky-1.12.2/3rdparty/toluapp/debian/emacsen-remove.ex000066400000000000000000000007211404127277500226530ustar00rootroot00000000000000#!/bin/sh -e # /usr/lib/emacsen-common/packages/remove/tolua++ FLAVOR=$1 PACKAGE=tolua++ if [ ${FLAVOR} != emacs ]; then if test -x /usr/sbin/install-info-altdir; then echo remove/${PACKAGE}: removing Info links for ${FLAVOR} install-info-altdir --quiet --remove --dirname=${FLAVOR} /usr/info/tolua++.info.gz fi echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR} rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE} fi conky-1.12.2/3rdparty/toluapp/debian/emacsen-startup.ex000066400000000000000000000014521404127277500230620ustar00rootroot00000000000000;; -*-emacs-lisp-*- ;; ;; Emacs startup file for the Debian tolua++ package ;; ;; Originally contributed by Nils Naumann ;; Modified by Dirk Eddelbuettel ;; Adapted for dh-make by Jim Van Zandt ;; The tolua++ package follows the Debian/GNU Linux 'emacsen' policy and ;; byte-compiles its elisp files for each 'emacs flavor' (emacs19, ;; xemacs19, emacs20, xemacs20...). The compiled code is then ;; installed in a subdirectory of the respective site-lisp directory. ;; We have to add this to the load-path: (let ((package-dir (concat "/usr/share/" (symbol-name flavor) "/site-lisp/tolua++"))) (when (file-directory-p package-dir) (setq load-path (cons package-dir load-path)))) conky-1.12.2/3rdparty/toluapp/debian/init.d.ex000066400000000000000000000035261404127277500211400ustar00rootroot00000000000000#! /bin/sh # # skeleton example file to build /etc/init.d/ scripts. # This file should be used to construct scripts for /etc/init.d. # # Written by Miquel van Smoorenburg . # Modified for Debian # by Ian Murdock . # # Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl # PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/tolua++ NAME=tolua++ DESC=tolua++ test -x $DAEMON || exit 0 # Include tolua++ defaults if available if [ -f /etc/default/tolua++ ] ; then . /etc/default/tolua++ fi set -e case "$1" in start) echo -n "Starting $DESC: " start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON -- $DAEMON_OPTS echo "$NAME." ;; stop) echo -n "Stopping $DESC: " start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON echo "$NAME." ;; #reload) # # If the daemon can reload its config files on the fly # for example by sending it SIGHUP, do it here. # # If the daemon responds to changes in its config file # directly anyway, make this a do-nothing entry. # # echo "Reloading $DESC configuration files." # start-stop-daemon --stop --signal 1 --quiet --pidfile \ # /var/run/$NAME.pid --exec $DAEMON #;; restart|force-reload) # # If the "reload" option is implemented, move the "force-reload" # option to the "reload" entry above. If not, "force-reload" is # just the same as "restart". # echo -n "Restarting $DESC: " start-stop-daemon --stop --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON sleep 1 start-stop-daemon --start --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS echo "$NAME." ;; *) N=/etc/init.d/$NAME # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 echo "Usage: $N {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0 conky-1.12.2/3rdparty/toluapp/debian/manpage.1.ex000066400000000000000000000033251404127277500215170ustar00rootroot00000000000000.\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH TOLUA++ SECTION "December 30, 2004" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME tolua++ \- program to do something .SH SYNOPSIS .B tolua++ .RI [ options ] " files" ... .br .B bar .RI [ options ] " files" ... .SH DESCRIPTION This manual page documents briefly the .B tolua++ and .B bar commands. .PP .\" TeX users may be more comfortable with the \fB\fP and .\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. \fBtolua++\fP is a program that... .SH OPTIONS These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. For a complete description, see the Info files. .TP .B \-h, \-\-help Show summary of options. .TP .B \-v, \-\-version Show version of program. .SH SEE ALSO .BR bar (1), .BR baz (1). .br The programs are documented fully by .IR "The Rise and Fall of a Fooish Bar" , available via the Info system. .SH AUTHOR tolua++ was written by . .PP This manual page was written by Ariel Manzur , for the Debian project (but may be used by others). conky-1.12.2/3rdparty/toluapp/debian/manpage.sgml.ex000066400000000000000000000110461404127277500223200ustar00rootroot00000000000000 manpage.1'. You may view the manual page with: `docbook-to-man manpage.sgml | nroff -man | less'. A typical entry in a Makefile or Makefile.am is: manpage.1: manpage.sgml docbook-to-man $< > $@ The docbook-to-man binary is found in the docbook-to-man package. Please remember that if you create the nroff version in one of the debian/rules file targets (such as build), you will need to include docbook-to-man in your Build-Depends control field. --> FIRSTNAME"> SURNAME"> December 30, 2004"> SECTION"> puntob@gmail.com"> TOLUA++"> Debian"> GNU"> GPL"> ]>
&dhemail;
&dhfirstname; &dhsurname; 2003 &dhusername; &dhdate;
&dhucpackage; &dhsection; &dhpackage; program to do something &dhpackage; DESCRIPTION This manual page documents briefly the &dhpackage; and bar commands. This manual page was written for the &debian; distribution because the original program does not have a manual page. Instead, it has documentation in the &gnu; Info format; see below. &dhpackage; is a program that... OPTIONS These programs follow the usual &gnu; command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. For a complete description, see the Info files. Show summary of options. Show version of program. SEE ALSO bar (1), baz (1). The programs are documented fully by The Rise and Fall of a Fooish Bar available via the Info system. AUTHOR This manual page was written by &dhusername; &dhemail; for the &debian; system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the &gnu; General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.
conky-1.12.2/3rdparty/toluapp/debian/manpage.xml.ex000066400000000000000000000107731404127277500221640ustar00rootroot00000000000000 .
will be generated. You may view the manual page with: nroff -man .
| less'. A typical entry in a Makefile or Makefile.am is: DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/\ manpages/docbook.xsl XP=xsltproc -''-nonet manpage.1: manpage.dbk $(XP) $(DB2MAN) $< The xsltproc binary is found in the xsltproc package. The XSL files are in docbook-xsl. Please remember that if you create the nroff version in one of the debian/rules file targets (such as build), you will need to include xsltproc and docbook-xsl in your Build-Depends control field. --> FIRSTNAME"> SURNAME"> December 30, 2004"> SECTION"> puntob@gmail.com"> TOLUA++"> Debian"> GNU"> GPL"> ]>
&dhemail;
&dhfirstname; &dhsurname; 2003 &dhusername; &dhdate;
&dhucpackage; &dhsection; &dhpackage; program to do something &dhpackage; DESCRIPTION This manual page documents briefly the &dhpackage; and bar commands. This manual page was written for the &debian; distribution because the original program does not have a manual page. Instead, it has documentation in the &gnu; Info format; see below. &dhpackage; is a program that... OPTIONS These programs follow the usual &gnu; command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. For a complete description, see the Info files. Show summary of options. Show version of program. SEE ALSO bar (1), baz (1). The programs are documented fully by The Rise and Fall of a Fooish Bar available via the Info system. AUTHOR This manual page was written by &dhusername; &dhemail; for the &debian; system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the &gnu; General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.
conky-1.12.2/3rdparty/toluapp/debian/menu.ex000066400000000000000000000001661404127277500207140ustar00rootroot00000000000000?package(tolua++):needs="X11|text|vc|wm" section="Apps/see-menu-manual"\ title="tolua++" command="/usr/bin/tolua++" conky-1.12.2/3rdparty/toluapp/debian/postinst.ex000066400000000000000000000016361404127277500216360ustar00rootroot00000000000000#! /bin/sh # postinst script for tolua++ # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package # case "$1" in configure) ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 conky-1.12.2/3rdparty/toluapp/debian/postrm.ex000066400000000000000000000016261404127277500212760ustar00rootroot00000000000000#! /bin/sh # postrm script for tolua++ # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' overwrit>r> # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 conky-1.12.2/3rdparty/toluapp/debian/preinst.ex000066400000000000000000000016351404127277500214360ustar00rootroot00000000000000#! /bin/sh # preinst script for tolua++ # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `install' # * `install' # * `upgrade' # * `abort-upgrade' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in install|upgrade) # if [ "$1" = "upgrade" ] # then # start-stop-daemon --stop --quiet --oknodo \ # --pidfile /var/run/tolua++.pid \ # --exec /usr/sbin/tolua++ 2>/dev/null || true # fi ;; abort-upgrade) ;; *) echo "preinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 conky-1.12.2/3rdparty/toluapp/debian/prerm.ex000066400000000000000000000016661404127277500211030ustar00rootroot00000000000000#! /bin/sh # prerm script for tolua++ # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `upgrade' # * `failed-upgrade' # * `remove' `in-favour' # * `deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in remove|upgrade|deconfigure) # install-info --quiet --remove /usr/info/tolua++.info.gz ;; failed-upgrade) ;; *) echo "prerm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 conky-1.12.2/3rdparty/toluapp/debian/rules000077500000000000000000000037761404127277500205040ustar00rootroot00000000000000#!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif configure: configure-stamp configure-stamp: dh_testdir # Add here commands to configure the package. scons build_dev=0 prefix=$(CURDIR)/debian/tolua++/usr configure touch configure-stamp build: build-stamp build-stamp: configure-stamp dh_testdir # Add here commands to compile the package. #$(MAKE) scons all #docbook-to-man debian/tolua++.sgml > tolua++.1 touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp # Add here commands to clean up after the build process. #-$(MAKE) clean scons -c build_dev=0 all configure dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/tolua++. #$(MAKE) install DESTDIR=$(CURDIR)/debian/tolua++ scons install # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installexamples # dh_install # dh_installmenu # dh_installdebconf # dh_installlogrotate # dh_installemacsen # dh_installpam # dh_installmime # dh_installinit # dh_installcron # dh_installinfo dh_installman dh_link dh_strip dh_compress dh_fixperms # dh_perl # dh_python # dh_makeshlibs dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure conky-1.12.2/3rdparty/toluapp/debian/tolua++-default.ex000066400000000000000000000003531404127277500226420ustar00rootroot00000000000000# Defaults for tolua++ initscript # sourced by /etc/init.d/tolua++ # installed at /etc/default/tolua++ by the maintainer scripts # # This is a POSIX shell fragment # # Additional options that are passed to the Daemon. DAEMON_OPTS="" conky-1.12.2/3rdparty/toluapp/debian/tolua++.doc-base.EX000066400000000000000000000010071404127277500225710ustar00rootroot00000000000000Document: tolua++ Title: Debian tolua++ Manual Author: Abstract: This manual describes what tolua++ is and how it can be used to manage online manuals on Debian systems. Section: unknown Format: debiandoc-sgml Files: /usr/share/doc/tolua++/tolua++.sgml.gz Format: postscript Files: /usr/share/doc/tolua++/tolua++.ps.gz Format: text Files: /usr/share/doc/tolua++/tolua++.text.gz Format: HTML Index: /usr/share/doc/tolua++/html/index.html Files: /usr/share/doc/tolua++/html/*.html conky-1.12.2/3rdparty/toluapp/debian/watch.ex000066400000000000000000000004271404127277500210560ustar00rootroot00000000000000# Example watch control file for uscan # Rename this file to "watch" and then you can run the "uscan" command # to check for upstream updates and more. # Site Directory Pattern Version Script version=2 sunsite.unc.edu /pub/Linux/Incoming tolua++-(.*)\.tar\.gz debian uupdate conky-1.12.2/3rdparty/toluapp/dist.info000066400000000000000000000004741404127277500200120ustar00rootroot00000000000000--- This file is part of LuaDist project name = "toluapp" version = "1.0.93" desc = "tolua++ is an extension of toLua, a tool to integrate C/Cpp code with Lua." author = "Waldemar Celes, Ariel Manzur" license = "as-is" url = "http://www.codenix.com/~tolua/" maintainer = "Peter Kapec" depends = { "lua ~> 5.1" } conky-1.12.2/3rdparty/toluapp/doc/000077500000000000000000000000001404127277500167325ustar00rootroot00000000000000conky-1.12.2/3rdparty/toluapp/doc/index.html000066400000000000000000000225111404127277500207300ustar00rootroot00000000000000 toLua++ - binding c/c++ code to lua

tolua++ - Home

news - download - documentation - installing - contact - lua_qt - Codenix


tolua++ is an extended version of tolua, a tool to integrate C/C++ code with Lua. tolua++ includes new features oriented to c++ such as:

As well as other features and bugfixes.


News:

15/02/09: Version 1.0.93 released. Some bugfixes and new features:

  • Build process bootstraps.
  • Added hooks to handle custom types.
  • Added hooks to handle exceptions.
  • Fixed issues with newer GCC compilers.
  • Changed to MIT license. See COPYRIGHT file for details.
27/04/06: Version 1.0.92 released. Some bugfixes and new features:

  • Fixed garbage collector bug for C objects.
  • Fixed problems with C compilers (including microsoft's)
  • Added a .proj file to build with Visual Studio 7 (contributed by Makoto Hamanaka).
  • New command line option: -E to define extra values
  • New command line option: -t to associate C++ types with their lua names (see the manual for details)
25/02/06: Version 1.0.91 released. This version contains a small garbage collection bugfix for 1.0.90 (thanks to Rolf E. Thorup for the report), everyone should upgrade.

18/02/06: Version 1.0.90 released. Some bugfixes and new features:

  • lua 5.1 support (see README-5.1)
  • Support for casting operators (for example operator const char();)
  • New utility functions, tolua.setpeer and tolua.getpeer, for easier (and faster) inheritance from C/C++ objects (only for lua 5.1)
  • Some small API changes (see the compatibility section of the manual)

18/10/05: Version 1.0.7 released. Some bugfixes and new features:

  • New command line option: -C, to disable the cleanup of included lua code (for easier debugging).
  • Merged Mildred's patch: embedded lua chunks have better names, code on package initializer function is nested.
  • New hook: parser_hook, allows modifications to the behavior of the main parser.
  • Objects can be private (or protected). This doesn't affect the normal usage (everything is public by default), but it's useful to declare types that don't export any code, but serve as 'support' for other declarations.
  • Misc bugfixes.

01/9/05: Version 1.0.6 released. Several bugfixes and new features:

  • Classes can have properties, using the 'tolua_property' keyboard. Property types are customizable.
  • Added a command line flag -D, to disable automatic generation of destructors for all classes with constructors (for compatibility with tolua5)
  • Classes with protected or private destructors can be tagged individually using the "TOLUA_PROTECTED_DESTRUCTOR" macro.
  • Added utility function "tolua.inherit", to allow a lua table to "inherit" from an instance of a C/C++ class
  • Fixed class constructor bug (it is now possible to use 'ClassName()' to create a lua-owned instance of the class without problems)
  • Misc bugfixes.

10/4/05: Version 1.0.5 released. This version contains some minor bugfixes and a new feature, the tolua_outside keyword, used to specify regular functions as methods of classes or structs. This release is also paired with lua_qt version 0.0.1a.

1/2/05: version 1.0.4 released. This version contains some bugfixes and new features:

  • Ability to customize tolua++'s behaviour to add functionality.
  • Basic support for multiple inheritance.
  • Several bugfixes on the parser.
  • Debian package available for download.

Most of the changes on this version were added for lua_qt, a package to bind the Qt toolkit to lua.

20/9/04: version 1.0.3 released. This version contains major bugfixes:

  • Fixed bugs in object tracking (the 'memory address' bug; there's still some work left, but people should be able to use unions with no problems)
  • Fixed parser bugs, functions with template parameters should work, also functions with default parameters that call constructos and with commas on them should work.
  • Added a __call method for class names, to replace new_local to create instances owned by lua.
  • Fixed other minor bugs.
  • Removed the link to win32 binaries, since I aparently don't know what the hell I'm doing with a microsoft compiler ;-)

Everyone should upgrade.

23/10/03: version 1.0.2 released. This version contains major bugfixes:

  • Fixed bugs in gargabe collection (thanks to Christian Vogler for doing all the work :-)
  • namespaces and nested types are now fully supported.
  • Fixed other minor bugs.

Everyone should upgrade.


Downloading

The latest development version of the code is available through SVN from tolua++'s BerliOS project page. You can checkout using: svn checkout svn://svn.berlios.de/toluapp/trunk The tolua++ source is freely available by http. The software provided under the terms of the MIT license. See the COPYRIGHT file distributed with the source.

Current version is 1.0.93, older versions:

  • tolua++-1.0.93.tar.bz2
  • tolua++-1.0.92.tar.bz2
  • tolua++-1.0.91.tar.bz2
  • tolua++_1.0.7-1.tar.gz [deb]
  • tolua++_1.0.6-1.tar.gz [deb]
  • tolua++_1.0.5-1.tar.gz [deb]
  • tolua++-1.0.4.tar.bz2 [deb]
  • tolua++-1.0.3.tar.bz2
  • tolua++-1.0.2.tar.bz2
  • tolua++-1.0.tar.bz2

    Documentation

    You can find the manual here or under the doc/ directory on the distribution.

    I'll also be adding interesting addons/examples to my page on the lua-users wiki.


    Instalation

    tolua++ uses SCons to build. SCons is based on python, you can get a stand-alone version on their website. After you have SCons, follow this simple instructions:

  • Type 'scons all' to compile.
  • Type 'scons install'. The default install prefix is /usr/local, so if you are on a POSIX system, it should work. On other systems, you can change it with the 'prefix' option on command line.

    scons prefix=/usr install

    or on windows

    scons "prefix=c:\Program Files\Visual C" install

    Use scons -h to see a list of available command line options.

    The files you need (in case you want to do a manual install) are:

    • bin/tolua++[.exe] - the main binary
    • include/tolua++.h - the header file
    • lib/libtolua++.a or lib/tolua++.lib - the library
  • See INSTALL for instructions on how to install without SCons. There are also instructions on how to build without scons at the lua-users wiki (if you know the author of this, contact me)
  • For lua 5.1, see README-5.1
    tolua++ and this website are maintained by Ariel Manzur.
    Contact us with any bugs, fixes, suggestions, or questions about this package.
    conky-1.12.2/3rdparty/toluapp/doc/tolua++.html000066400000000000000000002156411404127277500211030ustar00rootroot00000000000000 tolua++ reference manual

    tolua++ - Reference Manual

    by Waldemar Celes, Ariel Manzur.


    tolua++ is an extended version of tolua, a tool to integrate C/C++ code with Lua. tolua++ includes new features oriented to c++ such as:

    As well as other features and bugfixes.

    tolua is a tool that greatly simplifies the integration of C/C++ code with Lua. Based on a cleaned header file (or extracts from real header files), tolua automatically generates the binding code to access C/C++ features from Lua. Using Lua API and tag method facilities, tolua maps C/C++ constants, external variables, functions, classes, and methods to Lua.

    This manual is for tolua++ version 1.0 and is implemented upon Lua 5.0 and based on tolua 5.0. See Compatibility for details on switching from older versions.

    The sections below describe how to use tolua. Please contact us with bug reports, suggestions, and comments.


    How tolua works

    To use tolua, we create a package file, a C/C++ cleaned header file, listing the constants, variables, functions, classes, and methods we want to export to the Lua environment. Then tolua parses this file and creates a C/C++ file that automatically binds the C/C++ code to Lua. If we link the created file with our application, the specified C/C++ code can be accessed from Lua.
    A package file can also include regular header files, other package files, or lua files.

    Let's start with some examples. If we specify as input the following C-like header file to tolua:

    #define FALSE 0
    #define TRUE 1
    
    enum { 
     POINT = 100, 
     LINE, 
     POLYGON
    }
    Object* createObejct (int type);
    void drawObject (Object* obj, double red, double green, double blue);
    int isSelected (Object* obj);
    A C file that binds such a code to Lua is automatically generated. Therefore, in Lua code, we can access the C code, writing, for instance:
    ...
    myLine = createObject(LINE)
    ...
    if isSelected(myLine) == TRUE then
      drawObject(myLine, 1.0, 0.0, 0.0);
    else
      drawObject(myLine, 1.0, 1.0, 1.0);
    end
    ...
    Also, consider a C++-like header file:
    #define FALSE 0
    #define TRUE 1
    class Shape
    {
      void draw (void);
      void draw (double red, double green, double blue);
      int isSelected (void);
    };
    class Line : public Shape
    {
     Line (double x1, double y1, double x2, double y2);
     ~Line (void);
    };
    If this file is used as input to tolua, a C++ file is automatically generated proving access to such a code from Lua. Therefore, it would be valid to write Lua statements like:
    ...
    myLine = Line:new (0,0,1,1)
    ...
    if myLine:isSelected() == TRUE then
     myLine:draw(1.0,0.0,0.0)
    else
     myLine:draw()
    end
    ...
    myLine:delete()
    ...
    The package file (usually with extension .pkg) passed to tolua is not the real C/C++ header file, but a cleaned version of it. tolua does not implement a complete parse to interpret C/C++ code, but it understands a few declarations that are used to describe the features that are to be exported to Lua. Regular header files can be included into packages files; tolua will extract the code specified by the user to parse from the header (see Basic Concepts).

    How to use toLua

    tolua is composed by two pieces of code: an executable and a library. The executable represents the parser that reads a package file and output a C/C++ code that implements the binding to access the C/C++ features from Lua. If the package file is a C++ like code (i.e., includes class definitions), a C++ code is generated. If the cleaned header file is a C like code (i.e., without classes), a C code is generated. tolua accepts a set of options. Running "tolua -h" displays the current accepted options. For instance, to parse a file called myfile.pkg generating the binding code in myfile.c, we do:

    tolua -o myfile.c myfile.pkg

    The generated code must be compiled and linked with the application to provide the desired access from Lua. Each parsed file represents a package being exported to Lua. By default, the package name is the input file root name (myfile in the example). The user can specify a different name for the package:

    tolua -n pkgname -o myfile.c myfile.pkg

    The package should also be explicitly initialized. To initialize the package from our C/C++ code, we must declare and call the initialization function. The initialization function is defined as

    int tolua_pkgname_open (lua_State*);

    where pkgname represents the name of the package being bound. If we are using C++, we can opt for automatic initialization:

    tolua -a -n pkgname -o myfile.c myfile.pkg

    In that case, the initialization function is automatically called. However, if we are planning to use multiple Lua states, automatic initialization does not work, because the order static variables are initialized in C++ is not defined.

    Optionally, the prototype of the open function can be outputted to a header file, which name is given by the -H option.

    The binding code generated by tolua uses a set of functions defined in the tolua library. Thus, this library also has to be linked with the application. The file tolua.h is also necessary to compile the generated code.

    An application can use tolua object oriented framework (see exported utility functions) without binding any package. In that case, the application must call tolua initialization function (this function is called by any package file initialization function):

    int tolua_open (void);

    Basic Concepts

    The first step in using tolua is to create the package file. Starting with the real header files, we clean them by declaring the features we want to access from Lua in a format that tolua can understand. The format tolua understands is simple C/C++ declarations as described below.

    Including files

    A package file may include other package file. The general format to do that is:

    $pfile "include_file"

    A package file may also include regular C/C++ header files, using the hfile or cfile directive:

    $cfile "example.h"

    In which case, tolua will extract the code enclosed between tolua_begin and tolua_end, or or tolua_export for a single line. Consider this C++ header as example:

    
    #ifndef EXAMPLE_H
    #define EXAMPLE_H
    
    class Example { // tolua_export
    
    private:
    
    	string name;
    	int number;
    
    public:
    
    	void set_number(int number);
    
    	//tolua_begin
    
    	string get_name();
    	int get_number();
    };
    // tolua_end
    
    #endif
    

    In this case, the code that's not supported by tolua (the private part of the class), along with the function set_number is left outside of the package that includes this header.

    Finally, lua files can be included on a package file, using $lfile:

    $lfile "example.lua"

    New on tolua++: an extra way to include source files is available since version 1.0.4 of tolua++, using ifile:

    $ifile "filename"

    ifile also takes extra optional parameters after the filename, for example:

    $ifile "widget.h", GUI
    $ifile "vector.h", math, 3d

    ifile's default behaviour is to include the whole file, untouched. However, the contents of the file and the extra parameters are put through the include_file_hook function before being included into the package (see Customizing tolua++ for more details).

    Basic types

    tolua automatically maps C/C++ basic types to Lua basic types. Thus, char, int, float, and double are mapped to the Lua type number; char* is mapped to string; and void* is mapped to userdata. Types may be preceded by modifiers (unsigned, static, short, const, etc.); however, be aware that tolua ignores the modifier const if applied to basic types. Thus, if we pass a constant basic type to Lua and then pass it back to C/C++ code where a non constant is expected, the constant to non constant conversion will be silently done.

    Functions in C/C++ can also manipulate Lua objects explicitly. Thus lua_Object is also considered a basic type. In this case, any Lua value matches it.

    New on tolua++: The C++ type string is also considered a basic type, and is passed as a value to lua (using the c_str() method). This feature can be turned off with the command line option -S.

    User defined types

    All other types that appear in the package file being processed are considered user defined types. These are mapped to tagged userdata type in Lua. Lua can only store pointers to user defined types; although, tolua automatically makes the necessary arrangement to deal with references and values. For instance, if a function or method returns a value of user defined type, tolua allocates a clone object when returning it to Lua and sets the garbage collection tag method to automatically free the allocated object when no longer in use by Lua.

    For user defined types, constness is preserved. Thus passing a non constant user defined type to a function that expects constant type generates an type mismatching error.

    NULL and nil

    C/C++ NULL or 0 pointers are mapped to Lua nil type; conversely, nil may be specified wherever a C/C++ pointer is expected. This is valid for any type: char*, void*, and pointers to user defined types.

    Typedefs

    tolua also accepts simple typedef's inside the package files. Any occurrence of a type after its definition is mapped by tolua to the base type. They are useful because several packages redefine the basic C/C++ types to their own types. For instance, one can define the type real to represent a double. In that case, real can be used to specify the variable types inside the package file interpreted by tolua, but only if we include the following definition before any use of the type real.

    typedef double real;

    Otherwise, real would be interpreted as a user defined type and would not be mapped to Lua numbers.

    Including real header files

    In the package file, we must specify which are the real header files that should be included so that the generated code can access the constants, variables, functions, and classes we are binding. Any line in the package file beginning with a $ (except $[hclp]file, $[ , and $] lines) is inserted into the generated binding C/C++ code without any change, but the elimination of the $ itself. We use this feature to include the real header files. So, our package files will usually start with a set of $ beginning lines specifying the files that must be included, that is, the files the package file is based on.
    /* specify the files to be included */
    $#include "header1.h"                 // include first header
    $#include "header2.h"                 // include second header
    As illustrated, tolua also accepts comments, using C or C++ convention, inside the package file. Nested C-like comments can also be used.

    Also note that files included with $cfile or $hfile don't need to be included using this method, this is done automatically by tolua.

    In the following sections, we describe how to specify the C/C++ code we want to bind to Lua. The formats are simplified valid C/C++ statements.

    Binding constants

    To bind constants, tolua accepts both define's and enum's. For define's the general format is:
    #define NAME [ VALUE ]
    The value, as showed above, is optional. If such a code is inserted inside the file being processed, tolua generates a code that allows the use of NAME as a Lua global variable that has the corresponding C/C++ constant value. Only numeric constants are accepted.

    New on tolua++: All other preprocessor directives are ignored.

    For enum's, the general format is:

    enum {
      NAME1 [ = VALUE1 ] ,
      NAME2 [ = VALUE2 ] ,
      ...
      NAMEn [ = VALUEn ]
    };
    Similarly, tolua creates a set of global variables, named NAMEi, with their corresponding values.

    Binding external variables

    Global extern variables can also be exported. In the cleaned header file they are specified as:
    [extern] type var;
    tolua binds such declarations to Lua global variables. Thus, in Lua, we can access the C/C++ variable naturally. If the variable is non constant, we can also assign the variable a new value from Lua. Global variables that represent arrays of value can also be bound to Lua. Arrays can be of any type. The corresponding Lua objects for arrays are Lua tables indexed with numeric values; however, be aware that index 1 in Lua is mapped to index 0 in an C/C++ array. Arrays must be pre dimensioned. For instance:

    double v[10];

    New on tolua++: External variables can use the tolua_readonly modifier (see Additional Features)

    Binding functions

    Functions are also specified as conventional C/C++ declarations:
    type funcname (type1 par1[, type2 par2[,...typeN parN]]);
    The returned type can be void, meaning no value is returned. A function can also have no parameter. In that case, void may be specified in the place of the list of parameters. The parameter types must follow the rules already posted. tolua creates a Lua function binding the C/C++ function. When calling a function from Lua, the parameter types must match the corresponding C/C++ types, otherwise, tolua generates an error and reports which parameter is wrongly specified. If a parameter name is omitted, tolua names it automatically, but its type should be a basic type or user type previously used.

    Arrays

    tolua also deals with function or method parameters that represent arrays of values. The nice thing about arrays is that the corresponding Lua tables have their values updated if the C/C++ function changes the array contents.

    The arrays must be pre dimensioned. For instance:

    void func (double a[3]);

    is a valid function declaration for tolua and calling this function from Lua would be done by, for instance:

    p = {1.0,1.5,8.6}
    func (p)

    The array dimension need not be a constant expression; the dimension can also be specified by any expression that can be evaluated in run time. For instance:

    void func (int n, int m, double image[n*m]);

    is also valid since the expression n*m is valid in the binding function scope. However, be aware that tolua uses dynamic allocation for binding this function, what can degrade the performance.

    Despite the dimension specification, it is important to know that all arrays passed to the actual C/C++ function are in the local scope of the binding function. So, if the C/C++ function being called needs to hold the array pointer for later use, the binding code will not work properly.

    Overloaded functions

    Overloaded functions are accepted. Remember that the distinction between two functions with the same name is made based on the parameter types that are mapped to Lua. So, although

    void func (int a);
    void func (double a);

    represent two different functions in C++, they are the same function for tolua, because both int and double are mapped to the same Lua type: number.

    Another tricky situation occurs when expecting pointers. Suppose:

    void func (char* s);
    void func (void* p);
    void func (Object1* ptr);
    void func (Object2* prt);
    Although these four functions represent different functions in C++, a Lua statement like:
    func(nil)
    matches all of them.

    It is important to know that tolua decides which function will be called in run-time, trying to match each provided function. tolua first tries to call the last specified function; if it fails, tolua then tries the previous one. This process is repeated until one function matches the calling code or the first function is reached. For that reason, the mismatching error message, when it occurs, is based on the first function specification. When performance is important, we can specify the most used function as the last one, because it will be tried first.

    tolua allows the use of overloaded functions in C, see Renaming for details.

    Default parameter values

    The last function parameters can have associated default values. In that case, if the function is called with fewer parameters, the default values are assumed. The format to specify the default values is the same as the one used in C++ code:

    type funcname (..., typeN-1 parN-1 [= valueN-1], typeN parN [= valueN]);

    toLua implements this feature without using any C++ mechanism; so, it can be used also to bind C functions.

    We can also specify default values for the elements of an array (there is no way to specify a default value for the array itself, though). For instance:

    void func (int a[5]=0);

    sets the default element values to zero, thus the function can be called from Lua with an uninitialized table.

    For Lua object types (lua_Object), tolua defines a constant that can be used to specify nil as default value:

    void func (lua_Object lo = TOLUA_NIL);

    New on tolua++: C++ class constructors are valid as default parameters. For example:

    void set_color(const Color& color = Color(0,0,0));

    Multiple returned values

    In Lua, a function may return any number of values. tolua uses this feature to simulate values passed by reference. If a function parameter is specified as a pointer to or reference of a basic type or a pointer to or reference of a pointer to an user defined type, tolua accepts the corresponding type as input and returns, besides the conventional function returned value, if any, the updated parameter value.

    For instance, consider a C function that swaps two values:

    void swap (double* x, double* y);

    or

    void swap (double& x, double& y);

    If such a function is declared in the package file, tolua binds it as a function receiving two numbers as input and returning two numbers. So, a valid Lua code would be:

    x,y = swap(x,y)

    If the input values are not used, the use of default parameter value allows calling the function from Lua without specifying them:

    void getBox (double* xmin=0, double* xmax=0, double* ymin=0, double* ymax=0);

    In Lua:

    xmin, xmax, ymin, ymax = getBox()

    With user defined types, we would have for instance:

    void update (Point** p);

    or

    void update (Point*& p);

    Binding struct fields

    User defined types are nicely bound by tolua. For each variable or function type that does not correspond to a basic type, tolua automatically creates a tagged userdata to represent the C/C++ type. If the type corresponds to a struct, the struct fields can be directly accessed from Lua, indexing a variable that holds an object of such a type. In C code, these types are commonly defined using typedef's:
    typedef struct [name] {
       type1 fieldname1;
       type2 fieldname2;
       ...
       typeN fieldnameN;
    } typename;
    If such a code is inserted in the package file being processed, tolua allows any variable that holds an object of type typename to access any listed field indexing the variable by the field name. For instance, if var holds a such object, var.fieldnamei accesses the field named fieldnamei.

    Fields that represent arrays of values can also be mapped:

    typedef struct {
      int x[10];
      int y[10];
    } Example;
     

    Binding classes and methods

    C++ class definitions are also supported by tolua. Actually, the tolua deals with single inheritance and polymorphism in a natural way. The subsections below describe what can be exported by a class definition.

    Specifying inheritance

    If var is a Lua variable that holds an object of a derived class, var can be used wherever its base class type is expected and var can access any method of its base class. For this mechanism to take effect, we must indicate that the derived class actually inherits the base class. This is done in the conventional way:
    class classname : public basename
    {
     /* class definition */
    };

    In this case, the definition of basename needs to appear before classname if the inheritance properties are to be taken advantage of from lua.

    Multiple inheritance

    tolua++ (starting from version 1.0.4) supports multiple inheritance by allowing you to access the extra parents 'manually'.

    For example, consider the following class:

    class Slider : public Widget, public Range {
    	...
    };
    

    An object of type 'Slider' will fully retain its inheritance with Widget, and will contain a 'member' of type Range, which will return the object cast to the correct base type.

    For example:

    slider = Slider:new()
    slider:show() -- a Widget method
    
    slider:set_range(0, 100) -- this won't work, because
                             -- set_range is a method from Range
    
    slider.__Range__:set_range(0, 100) -- this is the correct way
    

    This is an experimental feature.

    Specifying exported members and methods

    As for struct fields, class fields, static or not, can be exported. Class methods and class static methods can also be exported. Of course, they must be declared as public in the actual C++ code (the public:keyword may appear in the package files, it will be ignored by tolua).

    For each bound class, tolua creates a Lua table and stores it at a variable which name is the name of the C++ class. This tables may contain other tables that represent other tables, the way C++ classes may contain other classes and structs. Static exported fields are accessed by indexing this table with the field names (similar to struct fields). Static methods are also called using this table, with a colon. Non static exported fields are accessed by indexing the variable that holds the object. Class methods follow the format of the function declaration showed above. They can be accessed from Lua code using the conventional way Lua uses to call methods, applied of course to a variable that holds the appropriate object or to the class table, for static methods.

    There are a few special methods that are also supported by tolua. Constructors are called as static methods, named new, new_local (on tolua++), or calling the class name directly (also on tolua++, see below for the difference betwheen these methods). Destructors are called as a conventional method called delete.

    Note that tolua does support overload. This applies even for constructors. Also note that the virtual keyword has no effect in the package file.

    The following code exemplifies class definitions that can be interpreted by tolua.

    class Point {
       static int n;    // represents the total number of created Points
       static int get_n();    // static method
    
       double x;        // represents the x coordinate
       double y;        // represents the y coordinate
       static char* className (void);   // returns the name of the class
       Point (void);                          // constructor 1
       Point (double px, double py);          // constructor 2
       ~Point (void);                         // destructor
       Point add (Point& other);              // add points, returning another one
    };
    class ColorPoint : public Color {
       int red;      // red color component [0 - 255]
       int green;    // green color component [0 - 255]
       int blue;     // blue color component [0 - 255]
       ColorPoint (double px, double py, int r, int g, int b);
    };
    If this segment of code is processed by tolua, we would be able to write the following Lua statements:
    p1 = Point:new(0.0,1.0)
    p2 = ColorPoint:new(1.5,2.2,0,0,255)
    print(Point.n)                     -- would print 2
    print(Point:get_n())               -- would also print 2
    p3 = p1:add(p2)
    local p4 = ColorPoint()
    print(p3.x,p3.y)                   -- would print 1.5 and 3.2
    print(p2.red,p2.green,p2.blue)     -- would print 0, 0, and 255
    p1:delete()                        -- call destructor
    p2:delete()                        -- call destructor
    Note that we can only explicitly delete objects that we explicitly create. In the example above, the point p3 will be garbage-collected by tolua automatically; we cannot delete it.

    New on tolua++: Also note that p4 is created by calling the class name directly (ColorPoint()); this has the same effect as calling new_local, which leaves the object to be deleted by the garbaje collector, and it should not be deleted using delete. For each constructor on the pkg, one new, new_local and .call callback for the class is created.

    Of course, we need to specify only the methods and members we want to access from Lua. Sometimes, it will be necessary to declare a class with no member or method just for the sake of not breaking a chain of inheritances.

    Using Regular functions as class methods

    tolua++ (starting from version 1.0.5) uses the keyword tolua_outside to specify regular functions as methods and static methods of a class or struct. For example:

    
    /////////////// position.h:
    
    typedef struct {
    
    	int x;
    	int y;
    } Position;
    
    Position* position_create();
    void position_set(Position* pos, int x, int y);
    
    /////////////// position.pkg:
    
    struct Position {
    
    	int x;
    	int y;
    
    	static tolua_outside Position* position_create @ create();
    	tolua_outside void position_set @ set(int x, int y);
    };
    
    --------------- position.lua
    
    local pos = Position:create()
    
    pos:set(10, 10)
    
    
    Note that the position_set method takes a pointer to Position as its first parameter, this is ommited on the tolua_outside declaration. Also note that we cannot name our methods new or new_local, or as overloaded operators (see next section), this will result in undefined behaviour.

    Overloaded operators

    tolua automatically binds the following binary operators:
      operator+   operator-   operator*   operator/ 
      operator<   operator>=  operator==  operator[]
    For the relational operators, toLua also automatically converts a returned 0 value into nil, so false in C becomes false in Lua.

    As an example, suppose that in the code above, instead of having:

       Point add (Point& other);              // add points, returning another one
    we had:
       Point operator+ (Point& other);        // add points, returning another one
    In that case, in Lua, we could simply write:
    p3 = p1 + p2
    The indexing operator (operator[]) when receiving a numeric parameter can also be exported to Lua. In this case, tolua accepts reference as returned value, even for basic types. Then if a reference is returned, from Lua, the programmer can either get or set the value. If the returned value is not a reference, the programmer can only get the value. An example may clarify: suppose we have a vector class and bind the following operator:
       double& operator[] (int index);
    In this case, in Lua, we would be able to write: value = myVector[i] and also myVector[i] = value, which updates the C++ object. However, if the bound operator was:
       double operator[] (int index);
    we would only be able to write: value = myVector[i].

    Free functions (i.e., not class members) that overload operators are not supported.

    Cast operators

    New on tolua++ (versions 1.0.90 and up): casting operators are also supported. For example:
    /////////////// node.h
    
    // a class that holds a value that can be of type int, double, string or Object*
    class Node { // tolua_export
    
    private:
    	union {
    		int int_value;
    		double double_value;
    		string string_value;
    		Object* object_value;
    	};
    
    // tolua_begin
    public:
    
    	enum Type {
    		T_INT,
    		T_DOUBLE,
    		T_STRING,
    		T_OBJECT,
    		T_MAX,
    	};
    
    	Type get_type();
    
    	operator int();
    	operator double();
    	operator string();
    	operator Object*();
    };
    // tolua_end
    
    tolua++ will produce code that calls the operators by casting the object Node (using C++ static_cast), and register them inside the class as ".typename". For example:
    -- node.lua
    
    local node = list.get_node("some_node") -- returns a Node object
    
    if node.get_type() == Node.T_STRING then
    
    	print("node is "..node[".string"]())
    
    elseif node.get_type() == Node.T_OBJECT then
    
    	local object = node[".Object*"]()
    	object:method()
    end
    
    

    Binding Properties

    tolua++ (starting from version 1.0.6) supports declaration of class propeties, using the tolua_property keyword. A property will look like a 'field' of the class, but it's value will be retrieved using class methods. For example:
    /////////////// label.h
    
    class Label {
    
    public:
    
    	string get_name();
    	void set_name(string p_name);
    
    	Widget* get_parent();
    };
    
    /////////////// label.pkg
    class Label {
    
    	tolua_property string name;
    
    	tolua_readonly tolua_property Widget* parent;
    };
    
    --------------- label.lua
    
    local label = Label()
    
    label.name = "hello"
    print(label.name)
    
    label.parent:show()
    
    

    Property types

    A property can have differt types, which determine how it's value will be set and retrieved. tolua++ comes with 3 different built-in types:

  • default will use 'get_name' and 'set_name' methods to access a property called 'name'
  • qt will use 'name' and 'setName'
  • overload will use 'name' and 'name' (as in 'string name(void);' to get and 'void name(string);' to set)

    The property type can be appended at the end of the 'tolua_property' keyword on the declaration:

      tolua_property__qt string name;
    When no type is specified, default will be used, but this can be changed (see below).

    Changing the default property type

    The default property type can be changed using the 'TOLUA_PROPERTY_TYPE' macro. This will change the default type from the point of its invocation, until the end of the block that contains it. For example:

    
    TOLUA_PROPERTY_TYPE(default); // default type for the 'global' scope
    
    namespace GUI {
    
    	class Point {
    
    		tolua_property int x; // will use get_x/set_x
    		tolua_property int y; // will use get_y/set_y
    	};
    
    	TOLUA_PROPERTY_TYPE(qt); // changes default type to 'qt' for the rest of the 'GUI' namespace
    
    	class Label {
    
    		tolua_property string name; // will use name/setName
    	};
    };
    
    class Sprite {
    
    	tolua_property GUI::Point position; // will use get_position/set_position
    
    	tolua_property__overload string name; // will use name/name
    };
    
    

    Adding custom property types

    Custom property types can be added by redefining the function "get_property_methods_hook" (see Customizing tolua++ for more details). The functions takes the property type and the name, and returns the setter and getter function names. For example:

    
    /////////////// custom.lua
    
    function get_property_methods_hook(ptype, name)
    
    	if ptype == "hungarian_string" then
    
    		return "sGet"..name, "Set"..name
    	end
    
    	if ptype == "hungarian_int" then
    
    		return "iGet"..name, "Set"..name
    	end
    	-- etc
    end
    
    /////////////// label.pkg
    class Label {
    
    	tolua_property__hungarian_string string Name; // uses 'sGetName' and 'SetName'
    
    	tolua_property__hungarian_int string Type; // uses 'iGetType' and 'SetType'
    };
    
    

    Class Templates

    One of the additional features of tolua++ is the support for class templates, by using the TOLUA_TEMPLATE_BIND directive. For example:
    class vector {
    
    	TOLUA_TEMPLATE_BIND(T, int, string, Vector3D, double)
    
    	void clear();
    	int size() const;
    
    	const T& operator[](int index) const;
    	T& operator[](int index);
    	void push_back(T val);
    
    	vector();
    	~vector();
    };
    
    The TOLUA_TEMPLATE_BIND directive has to be the first thing on the class declaration, otherwise it will be ignored. This code will create 4 versions of the class vector, one for each type specified on the TOLUA_TEMPLATE_BIND parameters, each replacing the macro T (specified as the first argument of TOLUA_TEMPLATE_BIND). Thus, the functions operator[], &operator[] and push_back will have different signatures on each version of the object. The objects will be recognized as vector<type> on further declarations, and the name of the table on Lua will be vector_type_. Thus, the following Lua code could be used:
    string_vector = vector_string_:new_local()
    string_vector:push_back("hello")
    string_vector:push_back("world")
    print(string_vector[0].." "..string_vector[1])
    
    Similarily, a template with more than 1 macro could be bound, and it could also inherit from another template:
    class hash_map : public map<K,V> {
    
    	TOLUA_TEMPLATE_BIND(K V, int string, string vector<double>)
    
    	V get_element(K key);
    	void set_element(K key, V value);
    
    	hash_map();
    	~hash_map();
    };
    
    In this example, one of the objects has another template as one of its types, so it will be recognized as hash_map<string,vector<double> > while its constructor will be on the Lua table hash_map_string_vector_double___ (see Type Renaming for a better way to access these objects).

    Note that due to the complexity in the definition of some templates, you should be careful on how you declare them. For example, if you create an object with type hash_map<string,vector<double> > and then declare a variable with type hash_map<string, vector<double> > (note the space between string and vector), the type of the variable will not be recognized. The safest way is to declare a typedef, and use that to use each type (this is also a common practice on C++ programming). For example, using the previous declaration of vector:

    typedef vector VectorInt;
    
    VectorInt variable;
    
    TOLUA_TEMPLATE_BIND can be used with more than one parenthesis to open and close, in order to be valid as a macro inside a regular .h file. The TOLUA_TEMPLATE_BIND macro is declared on tolua.h as:

    #define TOLUA_TEMPLATE_BIND(x)

    Also, the parameters can have double quotes. Thus, the following uses are valid:

    TOLUA_TEMPLATE_BIND((T, int, float)) // to be used inside a real header file
    TOLUA_TEMPLATE_BIND("K V", "string string", int double)
    
    Function templates are not supported on this version.

    Module definition

    tolua allows us to group constants, variables, and functions in a module. The module itself is mapped to a table in Lua, and its constants, variables, and functions are mapped to fields in that table. The general format to specify a module is:

    module name
    {
          ... // constant, variable, and function declarations
    }

    Thus, if we bound the following module declaration:

    module mod
    {
     #define N
     extern int var;
     int func (...):
    }

    In Lua we would be able to access such features by indexing the module: mod.N, mod.var, mod.func.

    Renaming constants, variables and functions

    When exporting constants, variable, and functions (members of a class or not), we can rename them, such that they will be bound with a different name from their C/C++ counterparts. To do that, we write the name they will be referenced in Lua after the character @. For instance:

    extern int cvar @ lvar;

    #define CNAME @ LNAME

    enum {
      CITEM1 @ LITEM1,
      CITEM2 @ LITEM2,
      ...
    };

    void cfunc @ lfunc (...);

    class T
    {
       double cfield @ lfield;
       void cmeth @ lmeth (...);
       ...
    };

    In such a case, the global variable cvar would be identified in Lua by lvar, the constant CNAME by LNAME, and so on. Note that class cannot be renamed, because they represent types in C.

    This renaming feature allows function overload in C, because we can choose to export two different C functions with a same Lua name:

    void glVertex3d @ glVertex (double x, double y, double z=0.0);
    void glVertexdv @ glVertex (double v[3]=0.0);

    Renaming Types

    Types can be renamed using the $renaming directive on pkg files, using the format:

    $renaming real_name @ new_name

    The parameters to renaming can be Lua patterns. For example:

    $renaming ^_+ @
    $renaming hash_map<string,vector<double> > @ StringHash
    
    The first example will remove all underscores at the beginning of all types, the second will rename the template type hash_map<string,vector<double> > to StringHash. Once renamed, the Lua table for each type can be accessed only by their new name, for example: StringHash:new()

    Storing additional fields

    Finally, it is important to know that even though the variables that hold C/C++ objects are actually tagged userdata for Lua, tolua creates a mechanism that allows us to store any additional field attached to these objects. That is, these objects can be seen as conventional Lua tables.
    obj = ClassName:new()
    obj.myfield = 1  -- even though "myfield" does not represent a field of ClassName
    Such a construction is possible because, if needed, tolua automatically creates a Lua table and associates it with the object. So that, the object can store additional fields not mapped to C/C++, but actually stored in the conjugate table. The Lua programmer accesses the C/C++ features and these additional fields in an uniform way. Note that, in fact, these additional fields overwrite C/C++ fields or methods when the names are the same.

    Additional features on tolua++

    Multiple variable declarations

    Multiple variables of the same type can be declared at the same time, for example:

    float x,y,z;

    will create 3 different variables of type float. Make sure you don't leave any spaces between the commas, as that will raise a parse error.

    tolua_readonly

    Any variable declaration can use the tolua_readonly modifier, to ensure that the variable is read-only, even when its type is not const. Example:
    class Widget {
    
    	tolua_readonly string name;
    };
    
    This feature could be used to 'hack' the support for other unsupported things like operator->. Consider this example pkg file:
    $hfile "node.h"
    $#define __operator_arrow operator->()
    $#define __get_name get_name()
    
    And on the file node.h:
    template class<T>
    class Node { // tolua_export
    
    private:
    	string name;
    	T* value;
    
    public:
    
    	T* operator->() {return value;};
    	string get_name() {return name;};
    
    	// tolua_begin
    
    	#if 0
    	TOLUA_TEMPLATE_BIND(T, Vector3D)
    
    	tolua_readonly __operator_arrow @ p;
    	tolua_readonly __get_name @ name;
    	#endif
    
    
    	Node* next;
    	Node* prev;
    
    	void set_name(string p_name) {name = p_name;};
    
    	Node();
    };
    // tolua_end
    
    While not a pretty thing to do to a header file, this accomplishes a number of things:

  • The method operator->() can be used from Lua by calling the variable p on the object.
  • The method get_name() can be using from Lua by calling the variable name on the boject.
  • Example lua usage:
    node = Node_Vector3D_:new_local()
    -- do something with the node here --
    print("node name is "..node.name)
    print("node value is ".. node.p.x ..", ".. node.p.y ..", ".. node.p.z)
    
    Since tolua++ ignores all preprocessor directives (except for #define), node.h remains a valid C++ header file, and also a valid source for tolua++, eliminating the need to maintain 2 different files, even for objects with unusual features such as these ones.

    The ability to rename functions as variables might be expanded on future versions.

    Defining values on command line

    Starting from version 1.0.92, the command line option -E allows you to introduce values into to the luastate where tolua++ runs, similar to GCC's -D. For example:

    $ tolua++ -E VERSION=5.1 -E HAVE_ZLIB package.pkg > package_bind.cpp

    This will add 2 fields to the global table _extra_parameters: "VERSION", with the string value "5.1", and "HAVE_ZLIB" with the boolean value true. For the moment, there is no way to 'use' these values, except in custom scripts defined by the user (see customizing tolua++ for details).

    Using C++ typeid

    Starting from version 1.0.92, the command line option -t is available, which generates a list of calls to the empty macro Mtolua_typeid, with its C++ type_info object, and the name used by tolua++ to identify the type. For example, if you have a package that binds 2 classes, Foo and Bar, using -t will produce the following output:
    #ifndef Mtolua_typeid
    #define Mtolua_typeid(L,TI,T)
    #endif
     Mtolua_typeid(tolua_S,typeid(Foo), "Foo");
     Mtolua_typeid(tolua_S,typeid(Bar), "Bar");
    
    The implementation of Mtolua_typename is left as an exercise to the user.

    Exported utility functions

    tolua uses itself to export some utility functions to Lua, including its object-oriented framework. The package file used by tolua is shown below:

    module tolua
    {
     char* tolua_bnd_type @ type (lua_Object lo);
     void tolua_bnd_takeownership @ takeownership (lua_Object lo);
     void tolua_bnd_releaseownership @ releaseownership (lua_Object lo);
     lua_Object tolua_bnd_cast @ cast (lua_Object lo, char* type);
     void tolua_bnd_inherit @ inherit (lua_Object table, lua_Object instance);

    /* for lua 5.1 */
     void tolua_bnd_setpeer @ setpeer (lua_Object object, lua_Object peer_table);
     void tolua_bnd_getpeer @ getpeer (lua_Object object);
    }

    tolua.type (var)

    Returns a string representing the object type. For instance, tolua.type(tolua) returns the string table and tolua.type(tolua.type) returns cfunction. Similarly, if var is a variable holding a user defined type T, tolua.type(var) would return const T or T, depending whether it is a constant reference.

    tolua.takeownership (var)

    Takes ownership of the object referenced var. This means that when all references to that object are lost, the objects itself will be deleted by lua.

    tolua.releaseownership (var)

    Releases ownership of the object referenced by var.

    tolua.cast (var, type)

    Changes the metatable of var in order to make it of type type. type needs to be a string with the complete C type of the object (including namespaces, etc).

    tolua.inherit (table, var)

    (new on tolua++) Causes tolua++ to recognise table as an object with the same type as var, and to use var when necesary. For example, consider this method:

      void set_parent(Widget* p_parent);

    A lua object could be used like this:

    local w = Widget()
    local lua_widget = {}
    tolua.inherit(lua_widget, w)
    
    set_parent(lua_widget);
    
    
    Remember that this will only cause the table to be recognised as type 'Widget' when necesary. To be able to access Widget's methods, you'll have to implement your own object system. A simple example:

    
    lua_widget.show = Widget.show
    
    lua_widget:show() -- this will call the 'show' method from 'Widget', using the lua
                      -- table as 'self'. Since lua_widget inherits from a widget instance,
                      -- tolua++ will recognise 'self' as a 'Widget', and call the method
    
    

    Of course a better way would be to add a __index metamethod for the lua object.

    Similarily, to implement virtual functions, you'll need to create a c++ object that inherits from the desired type, implement its virtual functions, and use that to inherit from lua. The object would have a reference to the lua table, and call its methods from the c++ virtual methods.

    Note: the current implementation (as of version 1.0.6) stores the C instance inside the lua table on the field ".c_instance", and looks that up when necesary. This might change in the future, so it is recommended to use an alternative way to store the C instance to use with your own object system.

    tolua.setpeer (object, peer_table) (lua 5.1 only)

    Sets the table as the object's peer table (can be nil). The peer table is where all the custom lua fields for the object are stored. When compiled with lua 5.1, tolua++ stores the peer as the object's envirnment table, and uses uses lua_gettable/settable (instead of lua_rawget/set for lua 5.0) to retrieve and store fields on it. This allows us to implement our own object system on our table (using metatables), and use it as a way to inherit from the userdata object. Consider an alternative to the previous example:
    -- a 'LuaWidget' class
    LuaWidget = {}
    LuaWidget.__index = LuaWidget
    
    function LuaWidget:add_button(caption)
    
    	-- add a button to our widget here. 'self' will be the userdata Widget
    end
    
    
    local w = Widget()
    local t = {}
    setmetatable(t, LuaWidget) -- make 't' an instance of LuaWidget
    
    tolua.setpeer(w, t) -- make 't' the peer table of 'w'
    
    set_parent(w) -- we use 'w' as the object now
    
    w:show() -- a method from 'Widget'
    w:add_button("Quit") -- a method from LuaWidget (but we still use 'w' to call it)
    
    When indexing our object, the peer table (if present) will be consulted first, so we don't need to implement our own __index metamethod to call the C++ functions.

    tolua.getpeer (object) (lua 5.1 only)

    Retrieves the peer table from the object (can be nil).

    Embedded Lua code

    tolua allows us to embed Lua code in the C/C++ generated code. To do that, it compiles the specified Lua code and creates a C constant string, storing the corresponding bytecodes, in the generated code.  When the package is opened, such a string is executed. The format to embed Lua code is:

    $[

    embedded Lua code
    ...

    $]

    As an example consider the following .pkg excerpt:

    /* Bind a Point class */
    class Point
    {
     Point (int x, int y);
     ~Point ();
     void print ();
     ...
    } CPoint;

    $[

    -- Create a Point constructor
    function Point (self)
     local cobj = CPoint:new(self.x or 0, self.y or 0)
     tolua.takeownership(cobj)
     return cobj
    end

    $]

    Binding such a code would allow us to write the following Lua code:

    p = Point{ x=2, y=3 }
    p:print()
    ...
     

    Customizing tolua++

    tolua++ calls empty functions at specific points of its execution. This functions can be redefined on a separate lua file (and included using the -L command line option) and be used to control the way tolua++ behaves. This is the list of functions (taken from basic.lua on the tolua++ source):

    
    -- called right after processing the $[ichl]file directives,
    -- right before processing anything else
    -- takes the package object as the parameter
    function preprocess_hook(p)
    	-- p.code has all the input code from the pkg
    end
    
    
    -- called for every $ifile directive
    -- takes a table with a string called 'code' inside, the filename, and any extra arguments
    -- passed to $ifile. no return value
    function include_file_hook(t, filename, ...)
    
    end
    
    -- called after processing anything that's not code (like '$renaming', comments, etc)
    -- and right before parsing the actual code.
    -- takes the Package object with all the code on the 'code' key. no return value
    function preparse_hook(package)
    
    end
    
    
    -- called after writing all the output.
    -- takes the Package object
    function post_output_hook(package)
    
    end
    
    -- called at the beginning of the main parser function, with the code being parsed as a parameter
    -- it can return nil if nothing was foind, or the contents of 'code', modified by the function
    -- Usually a parser hook will search the beginning of the string for a token, and if it finds
    -- anything, return the string without that token (after doing whatever it has to do with the token).
    function parser_hook(code)
    
    end
    
    
    -- called from classFunction:supcode, before the call to the function is output
    -- the classFunction object is passed.
    function pre_call_hook(f)
    
    end
    
    -- called from classFunction:supcode, after the call to the function is output
    -- the classFunction object is passed.
    function post_call_hook(f)
    
    end
    
    -- called before the register code is output
    function pre_register_hook(package)
    
    end
    
    -- called to output an error message
    function output_error_hook(...)
    	return string.format(...)
    end
    
    
    

    Handling custom types

    Starting from version 1.0.93, it is possible to specify custom functions to handle certain types. There are 3 types of functions: a 'push function', used to push the C value onto the Lua stack, a 'to function', used to retrieve the value from the Lua stack, and return it as a C value, and an 'is function', used to check if the value on the stack is valid (or convertible to a C value by the to function). These functions are modelled upon tolua_pushusertype, tolua_tousertype and tolua_isusertype, declared in tolua++.h.

    A number of arrays found in basic.lua are used to specify these functions:

    -- for specific types
    _push_functions = {}
    _is_functions = {}
    _to_functions = {}
    
    -- for base types
    _base_push_functions = {}
    _base_is_functions = {}
    _base_to_functions = {}
    
    Example (using the -L command line option):

    _is_functions['Vector3'] = 'custom_is_vector3' -- checks for a 3d vector
                                                   -- (either userdata, or a table with 3 values)
    _to_functions['Vector3'] = 'custom_to_vector3' -- convertes the eventual table to a Vector3
    
    _base_push_functions['Widget'] = 'custom_push_widget' -- pushes anything that inherits from Widget
    
    The _base tables are used to lookup functions for types that are up in the inheritance chain.

    Access

    Starting from version 1.0.7, all objects have a an access flag, which determines the object's access inside its container. Container objects also have a member called curr_member_access, which determines the access of each child object at the moment of its addition to the container. If the access flag has the value nil (default), false or 0, the object is public. Otherwise, the object is not public, and tolua++ will not export any code for that object (and any objects it may contain).

    Another 'interesting' function is extract_code, defined on basic.lua, which extracs the code from files included with $cfile and $hfile (by looking for tolua_begin/end and tolua_export).

    Compatibility with older versions.

    tolua++ <1.0.90

    Version 1.0.90 of tolua++ introduces 2 small API changes the might be incompatible with older versions on some cases:

    TEMPLATE_BIND

    TEMPLATE_BIND is deprecated. Use TOLUA_TEMPLATE_BIND instead. Also, when declaring a template, the TOLUA_TEMPLATE_BIND statement has to be the first thing inside the class declaration, otherwise it will be ignored. This fixes a possible problem with nested template declarations.

    Retrieving Objects

    When passing a full userdata to a function that accepts light userdata parameters (void*), the tolua++ library function tolua_touserdata will detect the full userdata and dereference the void** pointer if necesary. This is a change on the function's behaviour (which used to return the pointer as-is). This allows us to pass pointers to objects to a function that accepts void* pointers. Note that this was a problem when switching from toLua version 4 to version 5 (and tolua++ versions < 1.0.90).

    toLua 4

    Retrieving Objects

    Users switching from tolua v4 should know that tolua++ stores the objects as void** on Lua, so when retrieving an object from the luastate using lua_touserdata, the pointer should be dereferenced. The library function tolua_tousertype should work as expected. Example:

    lua_pushglobal(lua_state, "get_Object");
    lua_call(lua_state, 0, 1);  // calling a function that returns an Object
    
    Object *new_object = (Object*)(*lua_touserdata(lua_state, -1));
    or
    Object *new_object = (Object*)tolua_tousertype(lua_state, -1, NULL);
    
    C++ Strings

    tolua++ binds the c++ type std::string as a basic type, passing it to Lua as a regular string (using the method c_str()). This feature can be turned off with the command line option -S.

    Operators

    The list of supported operators has changed, see Binding classes and methods for more information.

    toLua 5

    Class destructors.

    With every class constructor, tolua++ exports a 'local' constructor, to create an instance of the class that is owned by the lua state. To implement this, tolua++ will also export a function that will delete the class. There are 2 options to prevent this:

    Using the -D command line option will turn this off completely. Destructor functions will only be exported when a destructor for the class is explicitly declared, or when there is a function or method that returns an object of the type by value (this is compatible with tolua's behaviour).

    Using the TOLUA_PROTECTED_DESTRUCTOR directive inside the class declaration, to specify that the class has a private or protected destructor. In this case, no destructor will be exported for that class.

    operator[] index

    Users switching from tolua v5 should know that tolua 5 substracts 1 from the index on operator[] functions, for compatibility with lua's method for indexing arrays (1 is the first element). This feature is turned off by default on tolua++ (making it compatible with tolua 4). It can be turned back on with the command line option -1

    C++ Strings

    (see c++ strings on tolua 4 below)

    Changes since v. 3.0

    • Support for binding arrays as variables and struct/class fields;
    • Support for embedding Lua code into the generated binding code;
    • New utility functions: cast and takeownership;
    • Option to create the corresponding header file of the binding code;
    • New "close" package function;
    • Fixed bug on cloning objects in C++;
    • Fixed bug on enum and struct parsing;

    Changes since v. 2.0

    • There is a new executable parser;
    • Support for multiple Lua states is provided;
    • Support for module definition is provided;
    • Global variables is now directly bound to Lua global variables;
    • Constness of user defined types is preserved in Lua;
    • Support for multiple returned values from C/C++ is provided (simulating parameters passed by reference);
    • Constants, variables, and functions bound to Lua can have different names from their C/C++ counterparts;
    • Object-oriented framework (and other utility functions) used in tolua is now exported for Lua programmers;
    • Incompatibilities

      Lua code based on tolua v2.* should run with no change on tolua v3.0. Although, it may be necessary to change the .pkg file in order to get the same behavior. The following incompatibilities exist:
      • Parameters defined as pointer to basic types are no longer converted to arrays of dimension one; they are now considered parameters passed by reference.
      • Automatic initialization for C++ code must be explicitly requested when using the new parser;
      • Global variables are no longer mapped to a table; the definition of a module including the global variables may be used to simulate the old behavior;
      • The initialization function is no longer toLua_package_open but tolua_package_open, without the capital letter (sorry!).

    Changes since v. 1.*

    • The binding code should run much faster;
    • The cleaned header file extension should now be .pkg instead of .L;
    • Type modifiers is now accepted (though the current version ignores const's);
    • Returning object by value is accepted and memory allocation is controlled by Lua garbage collection;
    • Overloaded functions/methods are accepted;
    • Parameters with default values are accepted;
    • Some overloaded operators are automatically bound.

    Credits

    Luiz Henrique de Figueiredo had the idea of creating a tool to automatically bind C code to Lua. L.H.F. wrote the very first version of such a tool (that bound C functions, variables, and constants) in awk. At that time, Waldemar Celes (now the main author) was only responsible for the C code that supported the generated binding code.

    While working at NGD Studios, Ariel Manzur made some changes to tolua4 for their game engine. After the release of tolua5, having left NGD, enough changes were made to tolua to justify a separate release (with Waldemar's blessing :-)
     

    Availability

    tolua++ is freely available by http. The software provided hereunder is on an "as is" basis, and the author has no obligation to provide maintenance, support, updates, enhancements, or modifications.


    This document was created by Waldemar Celes With modifications by Ariel Manzur/
    Last update: Sept 2003 conky-1.12.2/3rdparty/toluapp/doc/toluapp.gif000066400000000000000000000134651404127277500211160ustar00rootroot00000000000000GIF89aPPõ+ 0888@S`pqUUUUUjUU{llr‚œ88ˆ88¨UU–UUµll½qqÁ¢¿¥¥¨¦¦¸Í¥¥Ç¦¥Ö¾½Á¾½àÆÆÈÆÆÛÙØÜÆÆæÙØëââéââòûûü!ù+,PPþÀÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­€«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZW«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«Õjµ®V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«Õj\­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕþjµZ­V«ÕjµZ­V«ÕjµZ­V«Õ ¸Z­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«pµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V+àjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­VÀÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­€«ÕjµZ­V«ÕjµþZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZW«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«Õjµ®V«ÕjµZ­V«ÕjµZ­VY­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«Õj\­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V+¬V«ÕjµZ­V«ÕjµZ­V«Õ ¸Z­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­þV«@€pµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V+àjµZ­V«Õj@ `µZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­VÀÕjµZ­V«ÕjµZ­V«ÕjµZ­V«Õjµ‚@ °Z­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­€«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V+@ @ «ÕjµZW«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«þÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«B @ ÈjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«Õj\­V«ÕjµZ­V«Õj@ @ X­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«Õ ¸Z­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«Õjµ‚@ @ ¬V«ÕjµZ­V«pµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V@ þ«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«@ @ ÕjµZ­VÀÕjµZ­V«€@ €ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V@€@ ¬V«ÕjµZ­V«ÕjµZA X­V«ÕjµZ­V«ÕjµZ­V«ÕjµZW«ÕjµZ­ @ @ @ ÈjµZ­V«ÕjµZ­ ¬V«Õjµ®V«ÕjµZ­V«ÕjµZ­V«ÕjµZA @ þ@ @ Y­V«Õj\­V+«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZA @ @ @ @ «ÕjµZ­V«Õj€ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«Õjµ‚@ @ @ @ @ dµZ­V«ÕjµÀjµZ­V«ÕjµZ­V+àjµZ­V«ÕjµZA @ @ @ @ Y­V«ÕjµZ­VÀÕjµZ­V«ÕjµZ­Vþ«ÕjµZ­V«ÕjµZA @ @ @ @€@ «ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZA @ !@ äò|.@ ÈjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«Õjµ® @ @ @ òQ©T@ ²Z­V«ÕjµZ­V«Õj\­V«ÕjµZ­V«ÕjµZ­ @ @ @ ù¨TªNþ@ @V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­ @ @ @ @@©”Š@ @ ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­ @  @ @ @ "JÕ @ dµZ­V«ÕjµZ­V«ÕjµZ­VÀÕjµZ­V+@ @ @ ò@¢’J¥*:@ ²Z­€«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V+þ@ @ @ Q¥T(•J…RQ*UJ¥‚@ @V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V+@ @ B @T*J…R©T(•J¥B@ ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«„@ @ @ @  O‡*©TªRˆÃáp@ ÈjµZ­V«Õ ¸Z­V«ÕjµZ­V«Õ @ @ @ @ „T©T€@þ Y­V«ÕjµZ­V«ÕjµZ­V«Õj@ @ @ @  •JÅ @@ ¬V«ÕjµZ­V«ÕjµZ­V«Õjµ‚@ @ @@ @ @ O ¥â@ @V«ÕjµZ­V«ÕjµZ­€«ÕjµZA @ @ @ @ H•Rq@ !ÈjµZ­V«ÕjµZ­V«ÕjµZ­ @ @ þ@ @ äòv8@@ @ dµZ­V«ÕjµZ­V«ÕjµZ­V@ @ „@ @ @€ @ @ ²Z­V«ÕjµZ­V«ÕjµZ­V@ @ @ @ @ € €@ @ ¬V«pµZ­V«ÕjµZ­V«@ @ @ @ @ @  @ @ «ÕjþµZ­V«ÕjµZ­V«Õ @ @ @ @ @@ @ @ @ ÕjµZ­V«ÕjµZ­V«Õj@ @€@ @ @ @ @ @ ÈjµZ­V«ÕjµZW«ÕjµZA @ @ @ @ @ @ B ²Z­V«ÕjµZ­V«ÕjµZ­ @ @ @ þ@ „@ @ @ Y­V«ÕjµZ­V«ÕjµZ­V@ @ @ @ @ @ @ ¬V«ÕjµZ­V«ÕjµZ­V+@ @ @ @ @ @ @ @V+àjµZ­V«ÕjµZ­V«Õ @ @ @ @ @ @ @@ @ ÕjµZ­V«ÕjµZ­Vþ«Õj@ @ @ @€@ @ @ @ ÈjµZ­V«ÕjµZ­V«Õjµ‚@ !@ @ @ @ @ @ dµZ­V«Õjµ®V«ÕjµZ­ @ @ @ @ @ @ „@ Y­V«ÕjµZ­V«ÕjµZ­V@ @ @ ˆ@ @ þ@ @ ¬V«ÕjµZ­V«ÕjµZ­V+@ @ @ D¥²@ @ @ @ @V«ÕjµZ­V«ÕjµZ­V+à @ „bRA @ ¢R5 @ @ @ @ ÀÕjµZ­V«ÕjµZ­V«Õjµ‚@ DâQ©,±X,Q©P,b±H€Db±X @ ÕjµZ­V«ÕjµZ­V«ÕjµZA bþQ©T*bQ©T*•Uª@ ¨T$¥R©T) @ ÈjµZ­V«ÕjµZ­V«ÕjµZ­ B,*€¨¨THE¥²@ *Õ€€@ ‘ „H@Tª â‘@"'Õ@ dµZ­V«Õj\­V«ÕjµZ­V«@ • ŒTQ•j@@ HÕ *Õ€€@Ž È $ ²Z­V«ÕjµZ­V«ÕjµZ­V«Õ @ ‹J@Tª €°¨T„Jµ RuˆJµ( •J¥êþäY­V«ÕjµZ­V«ÕjµZ­V«Õj@ ˆE¥ * Š0@,*` R-©:D¥Z**•ÇbRu¬V«ÕjµZ­V«ÕjµZ­VÀÕjµZ­ bQ©ˆI•  P©€TÁ¢R-(Aà¨8@€«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V¡¨T Ä¢R””ª¨T™EÅb¡@<*ÕB£RU ÀG•PªQ€@ «ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«@@*• ±¨T*þ•Êb*•J¥R©@IJ¥BYTª@‘R©P&•ŠC€@ «ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«Õj„@ Èd±@@ ˆÅ¢I‹e±hT*DÒX•…€4Ç„Q@ ÕjµZ­V«Õ ¸Z­V«ÕjµZ­V«ÕjµZA B€y€@@ÈjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V$A A  H@ ÄA È€@ˆÃjµZ­V«ÕjþµZ­V«ÕjµZ­V«ÕjµZ­V«@ @@ @ @ @ @ ÈjµZ­V«ÕjµZ­V«ÕjµZ­€«ÕjµZ­V«Õjµ‚@ @ @ @ @ @ ÈjµZW«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­ @ @ @ B @ dµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V+@ „@ þ@ @ @ dµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«Õ ¸Z­V«Õj@ @ @ @ @ dµZ­V«ÕjµZ­V«pµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZA @ @ @ @  ²Z­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V+@ @ @@ @ dµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­Vþ«ÕjµZ­V«ÕjµZ­€«Õj@ @ @ @ dµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZW«ÕjµZ­V«ÕjµZ­V«ÕjµZ­ @ @ @ ÈjµZ­V«Õjµ®V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«Õ @ @ „@ ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«Õ ¸Z­V@ @V«ÕhjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«pµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V«ÕjµZ­V+àjµZ­V«ÕjµZ­VA;conky-1.12.2/3rdparty/toluapp/include/000077500000000000000000000000001404127277500176105ustar00rootroot00000000000000conky-1.12.2/3rdparty/toluapp/include/tolua++.h000066400000000000000000000160361404127277500212410ustar00rootroot00000000000000/* tolua ** Support code for Lua bindings. ** Written by Waldemar Celes ** TeCGraf/PUC-Rio ** Apr 2003 ** $Id: $ */ /* This code is free software; you can redistribute it and/or modify it. ** The software provided hereunder is on an "as is" basis, and ** the author has no obligation to provide maintenance, support, updates, ** enhancements, or modifications. */ #ifndef TOLUA_H #define TOLUA_H #ifndef TOLUA_API #define TOLUA_API extern #endif #define TOLUA_VERSION "tolua++-1.0.92" #ifdef __cplusplus extern "C" { #endif #define tolua_pushcppstring(x,y) tolua_pushstring(x,y.c_str()) #define tolua_iscppstring tolua_isstring #define tolua_iscppstringarray tolua_isstringarray #define tolua_pushfieldcppstring(L,lo,idx,s) tolua_pushfieldstring(L, lo, idx, s.c_str()) #ifndef TEMPLATE_BIND #define TEMPLATE_BIND(p) #endif #define TOLUA_TEMPLATE_BIND(p) #define TOLUA_PROTECTED_DESTRUCTOR #define TOLUA_PROPERTY_TYPE(p) typedef int lua_Object; #include #include struct tolua_Error { int index; int array; const char* type; }; typedef struct tolua_Error tolua_Error; #define TOLUA_NOPEER LUA_REGISTRYINDEX /* for lua 5.1 */ TOLUA_API const char* tolua_typename (lua_State* L, int lo); TOLUA_API void tolua_error (lua_State* L, const char* msg, tolua_Error* err); TOLUA_API int tolua_isnoobj (lua_State* L, int lo, tolua_Error* err); TOLUA_API int tolua_isvalue (lua_State* L, int lo, int def, tolua_Error* err); TOLUA_API int tolua_isvaluenil (lua_State* L, int lo, tolua_Error* err); TOLUA_API int tolua_isboolean (lua_State* L, int lo, int def, tolua_Error* err); TOLUA_API int tolua_isnumber (lua_State* L, int lo, int def, tolua_Error* err); TOLUA_API int tolua_isstring (lua_State* L, int lo, int def, tolua_Error* err); TOLUA_API int tolua_istable (lua_State* L, int lo, int def, tolua_Error* err); TOLUA_API int tolua_isusertable (lua_State* L, int lo, const char* type, int def, tolua_Error* err); TOLUA_API int tolua_isuserdata (lua_State* L, int lo, int def, tolua_Error* err); TOLUA_API int tolua_isusertype (lua_State* L, int lo, const char* type, int def, tolua_Error* err); TOLUA_API int tolua_isvaluearray (lua_State* L, int lo, int dim, int def, tolua_Error* err); TOLUA_API int tolua_isbooleanarray (lua_State* L, int lo, int dim, int def, tolua_Error* err); TOLUA_API int tolua_isnumberarray (lua_State* L, int lo, int dim, int def, tolua_Error* err); TOLUA_API int tolua_isstringarray (lua_State* L, int lo, int dim, int def, tolua_Error* err); TOLUA_API int tolua_istablearray (lua_State* L, int lo, int dim, int def, tolua_Error* err); TOLUA_API int tolua_isuserdataarray (lua_State* L, int lo, int dim, int def, tolua_Error* err); TOLUA_API int tolua_isusertypearray (lua_State* L, int lo, const char* type, int dim, int def, tolua_Error* err); TOLUA_API void tolua_open (lua_State* L); TOLUA_API void* tolua_copy (lua_State* L, void* value, unsigned int size); TOLUA_API int tolua_register_gc (lua_State* L, int lo); TOLUA_API int tolua_default_collect (lua_State* tolua_S); TOLUA_API void tolua_usertype (lua_State* L, const char* type); TOLUA_API void tolua_beginmodule (lua_State* L, const char* name); TOLUA_API void tolua_endmodule (lua_State* L); TOLUA_API void tolua_module (lua_State* L, const char* name, int hasvar); TOLUA_API void tolua_class (lua_State* L, const char* name, const char* base); TOLUA_API void tolua_cclass (lua_State* L, const char* lname, const char* name, const char* base, lua_CFunction col); TOLUA_API void tolua_function (lua_State* L, const char* name, lua_CFunction func); TOLUA_API void tolua_constant (lua_State* L, const char* name, lua_Number value); TOLUA_API void tolua_variable (lua_State* L, const char* name, lua_CFunction get, lua_CFunction set); TOLUA_API void tolua_array (lua_State* L,const char* name, lua_CFunction get, lua_CFunction set); /* TOLUA_API void tolua_set_call_event(lua_State* L, lua_CFunction func, char* type); */ /* TOLUA_API void tolua_addbase(lua_State* L, char* name, char* base); */ TOLUA_API void tolua_pushvalue (lua_State* L, int lo); TOLUA_API void tolua_pushboolean (lua_State* L, int value); TOLUA_API void tolua_pushnumber (lua_State* L, lua_Number value); TOLUA_API void tolua_pushstring (lua_State* L, const char* value); TOLUA_API void tolua_pushuserdata (lua_State* L, void* value); TOLUA_API void tolua_pushusertype (lua_State* L, void* value, const char* type); TOLUA_API void tolua_pushusertype_and_takeownership(lua_State* L, void* value, const char* type); TOLUA_API void tolua_pushfieldvalue (lua_State* L, int lo, int index, int v); TOLUA_API void tolua_pushfieldboolean (lua_State* L, int lo, int index, int v); TOLUA_API void tolua_pushfieldnumber (lua_State* L, int lo, int index, lua_Number v); TOLUA_API void tolua_pushfieldstring (lua_State* L, int lo, int index, const char* v); TOLUA_API void tolua_pushfielduserdata (lua_State* L, int lo, int index, void* v); TOLUA_API void tolua_pushfieldusertype (lua_State* L, int lo, int index, void* v, const char* type); TOLUA_API void tolua_pushfieldusertype_and_takeownership (lua_State* L, int lo, int index, void* v, const char* type); TOLUA_API lua_Number tolua_tonumber (lua_State* L, int narg, lua_Number def); TOLUA_API const char* tolua_tostring (lua_State* L, int narg, const char* def); TOLUA_API void* tolua_touserdata (lua_State* L, int narg, void* def); TOLUA_API void* tolua_tousertype (lua_State* L, int narg, void* def); TOLUA_API int tolua_tovalue (lua_State* L, int narg, int def); TOLUA_API int tolua_toboolean (lua_State* L, int narg, int def); TOLUA_API lua_Number tolua_tofieldnumber (lua_State* L, int lo, int index, lua_Number def); TOLUA_API const char* tolua_tofieldstring (lua_State* L, int lo, int index, const char* def); TOLUA_API void* tolua_tofielduserdata (lua_State* L, int lo, int index, void* def); TOLUA_API void* tolua_tofieldusertype (lua_State* L, int lo, int index, void* def); TOLUA_API int tolua_tofieldvalue (lua_State* L, int lo, int index, int def); TOLUA_API int tolua_getfieldboolean (lua_State* L, int lo, int index, int def); TOLUA_API void tolua_dobuffer(lua_State* L, char* B, unsigned int size, const char* name); TOLUA_API int class_gc_event (lua_State* L); #ifdef __cplusplus static inline const char* tolua_tocppstring (lua_State* L, int narg, const char* def) { const char* s = tolua_tostring(L, narg, def); return s?s:""; } static inline const char* tolua_tofieldcppstring (lua_State* L, int lo, int index, const char* def) { const char* s = tolua_tofieldstring(L, lo, index, def); return s?s:""; } #else #define tolua_tocppstring tolua_tostring #define tolua_tofieldcppstring tolua_tofieldstring #endif TOLUA_API int tolua_fast_isa(lua_State *L, int mt_indexa, int mt_indexb, int super_index); #ifndef Mtolua_new #define Mtolua_new(EXP) new EXP #endif #ifndef Mtolua_delete #define Mtolua_delete(EXP) delete EXP #endif #ifndef Mtolua_new_dim #define Mtolua_new_dim(EXP, len) new EXP[len] #endif #ifndef Mtolua_delete_dim #define Mtolua_delete_dim(EXP) delete [] EXP #endif #ifndef tolua_outside #define tolua_outside #endif #ifndef tolua_owned #define tolua_owned #endif #ifdef __cplusplus } #endif #endif conky-1.12.2/3rdparty/toluapp/libtoluapp.def000066400000000000000000000023331404127277500210210ustar00rootroot00000000000000EXPORTS class_gc_event push_table_instance tolua_array tolua_beginmodule tolua_cclass tolua_classevents tolua_constant tolua_copy tolua_default_collect tolua_dobuffer tolua_endmodule tolua_error tolua_fast_isa tolua_function tolua_getfieldboolean tolua_isboolean tolua_isbooleanarray tolua_ismodulemetatable tolua_isnoobj tolua_isnumber tolua_isnumberarray tolua_isstring tolua_isstringarray tolua_istable tolua_istablearray tolua_isuserdata tolua_isuserdataarray tolua_isusertable tolua_isusertype tolua_isusertypearray tolua_isvalue tolua_isvaluearray tolua_module tolua_moduleevents tolua_open tolua_pushboolean tolua_pushfieldboolean tolua_pushfieldnumber tolua_pushfieldstring tolua_pushfielduserdata tolua_pushfieldusertype tolua_pushfieldusertype_and_takeownership tolua_pushfieldvalue tolua_pushnumber tolua_pushstring tolua_pushuserdata tolua_pushusertype tolua_pushusertype_and_takeownership tolua_pushvalue tolua_register_gc tolua_toboolean tolua_tofieldnumber tolua_tofieldstring tolua_tofielduserdata tolua_tofieldusertype tolua_tofieldvalue tolua_tonumber tolua_tostring tolua_touserdata tolua_tousertype tolua_tovalue tolua_typename tolua_usertype tolua_variable conky-1.12.2/3rdparty/toluapp/src/000077500000000000000000000000001404127277500167545ustar00rootroot00000000000000conky-1.12.2/3rdparty/toluapp/src/bin/000077500000000000000000000000001404127277500175245ustar00rootroot00000000000000conky-1.12.2/3rdparty/toluapp/src/bin/SCsub000066400000000000000000000006011404127277500204630ustar00rootroot00000000000000Import('env') src = [ env.Object('tolua.c'), ] #toluabind = env.LuaBinding('toluabind.c', 'tolua_scons.pkg', 'tolua', bootstrap = True) env.bin_target = env.Program('#/bin/'+env['tolua_bin'], src, LIBS = ['$tolua_lib'] + env['LIBS']) env.bootstrap_target = env.Program('#/bin/'+env['TOLUAPP_BOOTSTRAP'], src + ['toluabind_default.c', env.lib_target_static], LIBS = env['LIBS']) conky-1.12.2/3rdparty/toluapp/src/bin/lua/000077500000000000000000000000001404127277500203055ustar00rootroot00000000000000conky-1.12.2/3rdparty/toluapp/src/bin/lua/all.lua000066400000000000000000000015041404127277500215600ustar00rootroot00000000000000dofile(path.."compat-5.1.lua") dofile(path.."compat.lua") dofile(path.."feature.lua") dofile(path.."verbatim.lua") dofile(path.."basic.lua") dofile(path.."code.lua") dofile(path.."typedef.lua") dofile(path.."container.lua") dofile(path.."package.lua") dofile(path.."module.lua") dofile(path.."namespace.lua") dofile(path.."define.lua") dofile(path.."enumerate.lua") dofile(path.."declaration.lua") dofile(path.."variable.lua") dofile(path.."array.lua") dofile(path.."function.lua") dofile(path.."operator.lua") dofile(path.."template_class.lua") dofile(path.."class.lua") dofile(path.."clean.lua") --dofile(path.."custom.lua") dofile(path.."doit.lua") local err,msg = xpcall(doit, debug.traceback) if not err then --print("**** msg is "..tostring(msg)) local _,_,label,msg = strfind(msg,"(.-:.-:%s*)(.*)") tolua_error(msg,label) end conky-1.12.2/3rdparty/toluapp/src/bin/lua/array.lua000066400000000000000000000146271404127277500221400ustar00rootroot00000000000000-- tolua: array class -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 1999 -- $Id: array.lua,v 1.1 2000/11/06 22:03:57 celes Exp $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. -- Array class -- Represents a extern array variable or a public member of a class. -- Stores all fields present in a declaration. classArray = { } classArray.__index = classArray setmetatable(classArray,classDeclaration) -- Print method function classArray:print (ident,close) print(ident.."Array{") print(ident.." mod = '"..self.mod.."',") print(ident.." type = '"..self.type.."',") print(ident.." ptr = '"..self.ptr.."',") print(ident.." name = '"..self.name.."',") print(ident.." def = '"..self.def.."',") print(ident.." dim = '"..self.dim.."',") print(ident.." ret = '"..self.ret.."',") print(ident.."}"..close) end -- check if it is a variable function classArray:isvariable () return true end -- get variable value function classArray:getvalue (class,static) if class and static then return class..'::'..self.name..'[tolua_index]' elseif class then return 'self->'..self.name..'[tolua_index]' else return self.name..'[tolua_index]' end end -- Write binding functions function classArray:supcode () local class = self:inclass() -- get function ------------------------------------------------ if class then output("/* get function:",self.name," of class ",class," */") else output("/* get function:",self.name," */") end self.cgetname = self:cfuncname("tolua_get") output("#ifndef TOLUA_DISABLE_"..self.cgetname) output("\nstatic int",self.cgetname,"(lua_State* tolua_S)") output("{") output(" int tolua_index;") -- declare self, if the case local _,_,static = strfind(self.mod,'^%s*(static)') if class and static==nil then output(' ',self.parent.type,'*','self;') output(' lua_pushstring(tolua_S,".self");') output(' lua_rawget(tolua_S,1);') output(' self = ') output('(',self.parent.type,'*) ') output('lua_touserdata(tolua_S,-1);') elseif static then _,_,self.mod = strfind(self.mod,'^%s*static%s%s*(.*)') end -- check index output('#ifndef TOLUA_RELEASE\n') output(' {') output(' tolua_Error tolua_err;') output(' if (!tolua_isnumber(tolua_S,2,0,&tolua_err))') output(' tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err);') output(' }') output('#endif\n') if flags['1'] then -- for compatibility with tolua5 ? output(' tolua_index = (int)tolua_tonumber(tolua_S,2,0)-1;') else output(' tolua_index = (int)tolua_tonumber(tolua_S,2,0);') end output('#ifndef TOLUA_RELEASE\n') if self.dim and self.dim ~= '' then output(' if (tolua_index<0 || tolua_index>='..self.dim..')') else output(' if (tolua_index<0)') end output(' tolua_error(tolua_S,"array indexing out of range.",NULL);') output('#endif\n') -- return value local t,ct = isbasic(self.type) local push_func = get_push_function(t) if t then output(' tolua_push'..t..'(tolua_S,(',ct,')'..self:getvalue(class,static)..');') else t = self.type if self.ptr == '&' or self.ptr == '' then output(' ',push_func,'(tolua_S,(void*)&'..self:getvalue(class,static)..',"',t,'");') else output(' ',push_func,'(tolua_S,(void*)'..self:getvalue(class,static)..',"',t,'");') end end output(' return 1;') output('}') output('#endif //#ifndef TOLUA_DISABLE\n') output('\n') -- set function ------------------------------------------------ if not strfind(self.type,'const') then if class then output("/* set function:",self.name," of class ",class," */") else output("/* set function:",self.name," */") end self.csetname = self:cfuncname("tolua_set") output("#ifndef TOLUA_DISABLE_"..self.csetname) output("\nstatic int",self.csetname,"(lua_State* tolua_S)") output("{") -- declare index output(' int tolua_index;') -- declare self, if the case local _,_,static = strfind(self.mod,'^%s*(static)') if class and static==nil then output(' ',self.parent.type,'*','self;') output(' lua_pushstring(tolua_S,".self");') output(' lua_rawget(tolua_S,1);') output(' self = ') output('(',self.parent.type,'*) ') output('lua_touserdata(tolua_S,-1);') elseif static then _,_,self.mod = strfind(self.mod,'^%s*static%s%s*(.*)') end -- check index output('#ifndef TOLUA_RELEASE\n') output(' {') output(' tolua_Error tolua_err;') output(' if (!tolua_isnumber(tolua_S,2,0,&tolua_err))') output(' tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err);') output(' }') output('#endif\n') if flags['1'] then -- for compatibility with tolua5 ? output(' tolua_index = (int)tolua_tonumber(tolua_S,2,0)-1;') else output(' tolua_index = (int)tolua_tonumber(tolua_S,2,0);') end output('#ifndef TOLUA_RELEASE\n') if self.dim and self.dim ~= '' then output(' if (tolua_index<0 || tolua_index>='..self.dim..')') else output(' if (tolua_index<0)') end output(' tolua_error(tolua_S,"array indexing out of range.",NULL);') output('#endif\n') -- assign value local ptr = '' if self.ptr~='' then ptr = '*' end output(' ') if class and static then output(class..'::'..self.name..'[tolua_index]') elseif class then output('self->'..self.name..'[tolua_index]') else output(self.name..'[tolua_index]') end local t = isbasic(self.type) output(' = ') if not t and ptr=='' then output('*') end output('((',self.mod,self.type) if not t then output('*') end output(') ') local def = 0 if self.def ~= '' then def = self.def end if t then output('tolua_to'..t,'(tolua_S,3,',def,'));') else local to_func = get_to_function(self.type) output(to_func,'(tolua_S,3,',def,'));') end output(' return 0;') output('}') output('#endif //#ifndef TOLUA_DISABLE\n') output('\n') end end function classArray:register (pre) if not self:check_public_access() then return end pre = pre or '' if self.csetname then output(pre..'tolua_array(tolua_S,"'..self.lname..'",'..self.cgetname..','..self.csetname..');') else output(pre..'tolua_array(tolua_S,"'..self.lname..'",'..self.cgetname..',NULL);') end end -- Internal constructor function _Array (t) setmetatable(t,classArray) append(t) return t end -- Constructor -- Expects a string representing the variable declaration. function Array (s) return _Array (Declaration(s,'var')) end conky-1.12.2/3rdparty/toluapp/src/bin/lua/basic.lua000066400000000000000000000213531404127277500220750ustar00rootroot00000000000000-- tolua: basic utility functions -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 1998 -- Last update: Apr 2003 -- $Id: $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. -- Basic C types and their corresponding Lua types -- All occurrences of "char*" will be replaced by "_cstring", -- and all occurrences of "void*" will be replaced by "_userdata" _basic = { ['void'] = '', ['char'] = 'number', ['int'] = 'number', ['short'] = 'number', ['long'] = 'number', ['unsigned'] = 'number', ['float'] = 'number', ['double'] = 'number', ['_cstring'] = 'string', ['_userdata'] = 'userdata', ['char*'] = 'string', ['void*'] = 'userdata', ['bool'] = 'boolean', ['lua_Object'] = 'value', ['LUA_VALUE'] = 'value', -- for compatibility with tolua 4.0 ['lua_State*'] = 'state', ['_lstate'] = 'state', ['lua_Function'] = 'value', } _basic_ctype = { number = "lua_Number", string = "const char*", userdata = "void*", boolean = "bool", value = "int", state = "lua_State*", } -- functions the are used to do a 'raw push' of basic types _basic_raw_push = {} -- List of user defined types -- Each type corresponds to a variable name that stores its tag value. _usertype = {} -- List of types that have to be collected _collect = {} -- List of types _global_types = {n=0} _global_types_hash = {} -- list of classes _global_classes = {} -- List of enum constants _global_enums = {} -- List of auto renaming _renaming = {} function appendrenaming (s) local b,e,old,new = strfind(s,"%s*(.-)%s*@%s*(.-)%s*$") if not b then error("#Invalid renaming syntax; it should be of the form: pattern@pattern") end tinsert(_renaming,{old=old, new=new}) end function applyrenaming (s) for i,v in ipairs(_renaming) do local m,n = gsub(s,v.old,v.new) if n ~= 0 then return m end end return nil end -- Error handler function tolua_error (s,f) if _curr_code then print("***curr code for error is "..tostring(_curr_code)) print(debug.traceback()) end local out = _OUTPUT _OUTPUT = _STDERR if strsub(s,1,1) == '#' then write("\n** tolua: "..strsub(s,2)..".\n\n") if _curr_code then local _,_,s = strfind(_curr_code,"^%s*(.-\n)") -- extract first line if s==nil then s = _curr_code end s = gsub(s,"_userdata","void*") -- return with 'void*' s = gsub(s,"_cstring","char*") -- return with 'char*' s = gsub(s,"_lstate","lua_State*") -- return with 'lua_State*' write("Code being processed:\n"..s.."\n") end else if not f then f = "(f is nil)" end print("\n** tolua internal error: "..f..s..".\n\n") return end _OUTPUT = out end function warning (msg) if flags.q then return end local out = _OUTPUT _OUTPUT = _STDERR write("\n** tolua warning: "..msg..".\n\n") _OUTPUT = out end -- register an user defined type: returns full type function regtype (t) --if isbasic(t) then -- return t --end local ft = findtype(t) if not _usertype[ft] then return appendusertype(t) end return ft end -- return type name: returns full type function typevar(type) if type == '' or type == 'void' then return type else local ft = findtype(type) if ft then return ft end _usertype[type] = type return type end end -- check if basic type function isbasic (type) local t = gsub(type,'const ','') local m,t = applytypedef('', t) local b = _basic[t] if b then return b,_basic_ctype[b] end return nil end -- split string using a token function split (s,t) local l = {n=0} local f = function (s) l.n = l.n + 1 l[l.n] = s return "" end local p = "%s*(.-)%s*"..t.."%s*" s = gsub(s,"^%s+","") s = gsub(s,"%s+$","") s = gsub(s,p,f) l.n = l.n + 1 l[l.n] = gsub(s,"(%s%s*)$","") return l end -- splits a string using a pattern, considering the spacial cases of C code (templates, function parameters, etc) -- pattern can't contain the '^' (as used to identify the begining of the line) -- also strips whitespace function split_c_tokens(s, pat) s = string.gsub(s, "^%s*", "") s = string.gsub(s, "%s*$", "") local token_begin = 1 local token_end = 1 local ofs = 1 local ret = {n=0} function add_token(ofs) local t = string.sub(s, token_begin, ofs) t = string.gsub(t, "^%s*", "") t = string.gsub(t, "%s*$", "") ret.n = ret.n + 1 ret[ret.n] = t end while ofs <= string.len(s) do local sub = string.sub(s, ofs, -1) local b,e = string.find(sub, "^"..pat) if b then add_token(ofs-1) ofs = ofs+e token_begin = ofs else local char = string.sub(s, ofs, ofs) if char == "(" or char == "<" then local block if char == "(" then block = "^%b()" end if char == "<" then block = "^%b<>" end b,e = string.find(sub, block) if not b then -- unterminated block? ofs = ofs+1 else ofs = ofs + e end else ofs = ofs+1 end end end add_token(ofs) --if ret.n == 0 then -- ret.n=1 -- ret[1] = "" --end return ret end -- concatenate strings of a table function concat (t,f,l,jstr) jstr = jstr or " " local s = '' local i=f while i<=l do s = s..t[i] i = i+1 if i <= l then s = s..jstr end end return s end -- concatenate all parameters, following output rules function concatparam (line, ...) local i=1 local arg={...} while i<=#arg do if _cont and not strfind(_cont,'[%(,"]') and strfind(arg[i],"^[%a_~]") then line = line .. ' ' end line = line .. arg[i] if arg[i] ~= '' then _cont = strsub(arg[i],-1,-1) end i = i+1 end if strfind(arg[#arg],"[%/%)%;%{%}]$") then _cont=nil line = line .. '\n' end return line end -- output line function output (...) local i=1 local arg = {...} while i<=#arg do if _cont and not strfind(_cont,'[%(,"]') and strfind(arg[i],"^[%a_~]") then write(' ') end write(arg[i]) if arg[i] ~= '' then _cont = strsub(arg[i],-1,-1) end i = i+1 end if strfind(arg[#arg],"[%/%)%;%{%}]$") then _cont=nil write('\n') end end function get_property_methods(ptype, name) if get_property_methods_hook and get_property_methods_hook(ptype,name) then return get_property_methods_hook(ptype, name) end if ptype == "default" then -- get_name, set_name return "get_"..name, "set_"..name end if ptype == "qt" then -- name, setName return name, "set"..string.upper(string.sub(name, 1, 1))..string.sub(name, 2, -1) end if ptype == "overload" then -- name, name return name,name end return nil end -------------- the hooks -- called right after processing the $[ichl]file directives, -- right before processing anything else -- takes the package object as the parameter function preprocess_hook(p) -- p.code has all the input code from the pkg end -- called for every $ifile directive -- takes a table with a string called 'code' inside, the filename, and any extra arguments -- passed to $ifile. no return value function include_file_hook(t, filename, ...) end -- called after processing anything that's not code (like '$renaming', comments, etc) -- and right before parsing the actual code. -- takes the Package object with all the code on the 'code' key. no return value function preparse_hook(package) end -- called before starting output function pre_output_hook(package) end -- called after writing all the output. -- takes the Package object function post_output_hook(package) end -- called from 'get_property_methods' to get the methods to retrieve a property -- according to its type function get_property_methods_hook(property_type, name) end -- called from ClassContainer:doparse with the string being parsed -- return nil, or a substring function parser_hook(s) return nil end -- called from classFunction:supcode, before the call to the function is output function pre_call_hook(f) end -- called from classFunction:supcode, after the call to the function is output function post_call_hook(f) end -- called before the register code is output function pre_register_hook(package) end -- called to output an error message function output_error_hook(...) return string.format(table.unpack{...}) end -- custom pushers _push_functions = {} _is_functions = {} _to_functions = {} _base_push_functions = {} _base_is_functions = {} _base_to_functions = {} local function search_base(t, funcs) local class = _global_classes[t] while class do if funcs[class.type] then return funcs[class.type] end class = _global_classes[class.btype] end return nil end function get_push_function(t) return _push_functions[t] or search_base(t, _base_push_functions) or "tolua_pushusertype" end function get_to_function(t) return _to_functions[t] or search_base(t, _base_to_functions) or "tolua_tousertype" end function get_is_function(t) return _is_functions[t] or search_base(t, _base_is_functions) or "tolua_isusertype" end conky-1.12.2/3rdparty/toluapp/src/bin/lua/class.lua000066400000000000000000000115041404127277500221160ustar00rootroot00000000000000-- tolua: class class -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 1998 -- $Id: $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. -- Class class -- Represents a class definition. -- Stores the following fields: -- name = class name -- base = class base, if any (only single inheritance is supported) -- {i} = list of members classClass = { classtype = 'class', name = '', base = '', type = '', btype = '', ctype = '', } classClass.__index = classClass setmetatable(classClass,classContainer) -- register class function classClass:register (pre) if not self:check_public_access() then return end pre = pre or '' push(self) if _collect[self.type] then output(pre,'#ifdef __cplusplus\n') output(pre..'tolua_cclass(tolua_S,"'..self.lname..'","'..self.type..'","'..self.btype..'",'.._collect[self.type]..');') output(pre,'#else\n') output(pre..'tolua_cclass(tolua_S,"'..self.lname..'","'..self.type..'","'..self.btype..'",NULL);') output(pre,'#endif\n') else output(pre..'tolua_cclass(tolua_S,"'..self.lname..'","'..self.type..'","'..self.btype..'",NULL);') end if self.extra_bases then for k,base in ipairs(self.extra_bases) do -- not now --output(pre..' tolua_addbase(tolua_S, "'..self.type..'", "'..base..'");') end end output(pre..'tolua_beginmodule(tolua_S,"'..self.lname..'");') local i=1 while self[i] do self[i]:register(pre..' ') i = i+1 end output(pre..'tolua_endmodule(tolua_S);') pop() end -- return collection requirement function classClass:requirecollection (t) if self.flags.protected_destructor or (not self:check_public_access()) then return false end push(self) local r = false local i=1 while self[i] do r = self[i]:requirecollection(t) or r i = i+1 end pop() -- only class that exports destructor can be appropriately collected -- classes that export constructors need to have a collector (overrided by -D flag on command line) if self._delete or ((not flags['D']) and self._new) then --t[self.type] = "tolua_collect_" .. gsub(self.type,"::","_") t[self.type] = "tolua_collect_" .. clean_template(self.type) r = true end return r end -- output tags function classClass:decltype () push(self) self.type = regtype(self.original_name or self.name) self.btype = typevar(self.base) self.ctype = 'const '..self.type if self.extra_bases then for i=1,#self.extra_bases do self.extra_bases[i] = typevar(self.extra_bases[i]) end end local i=1 while self[i] do self[i]:decltype() i = i+1 end pop() end -- Print method function classClass:print (ident,close) print(ident.."Class{") print(ident.." name = '"..self.name.."',") print(ident.." base = '"..self.base.."';") print(ident.." lname = '"..self.lname.."',") print(ident.." type = '"..self.type.."',") print(ident.." btype = '"..self.btype.."',") print(ident.." ctype = '"..self.ctype.."',") local i=1 while self[i] do self[i]:print(ident.." ",",") i = i+1 end print(ident.."}"..close) end function classClass:set_protected_destructor(p) self.flags.protected_destructor = self.flags.protected_destructor or p end -- Internal constructor function _Class (t) setmetatable(t,classClass) t:buildnames() append(t) return t end -- Constructor -- Expects the name, the base (array) and the body of the class. function Class (n,p,b) if #p > 1 then b = string.sub(b, 1, -2) for i=2,#p,1 do b = b.."\n tolua_inherits "..p[i].." __"..p[i].."__;\n" end b = b.."\n}" end -- check for template b = string.gsub(b, "^{%s*TEMPLATE_BIND", "{\nTOLUA_TEMPLATE_BIND") local t,_,T,I = string.find(b, '^{%s*TOLUA_TEMPLATE_BIND%s*%(+%s*\"?([^\",]*)\"?%s*,%s*([^%)]*)%s*%)+') if t then -- remove quotes I = string.gsub(I, "\"", "") T = string.gsub(T, "\"", "") -- get type list local types = split_c_tokens(I, ",") -- remove TEMPLATE_BIND line local bs = string.gsub(b, "^{%s*TOLUA_TEMPLATE_BIND[^\n]*\n", "{\n") local Tl = split(T, " ") local tc = TemplateClass(n, p, bs, Tl) tc:throw(types, true) --for i=1,types.n do -- tc:throw(split_c_tokens(types[i], " "), true) --end return end local mbase if p then mbase = table.remove(p, 1) if not p[1] then p = nil end end mbase = mbase and resolve_template_types(mbase) local c local oname = string.gsub(n, "@.*$", "") oname = getnamespace(classContainer.curr)..oname if _global_classes[oname] then c = _global_classes[oname] if mbase and ((not c.base) or c.base == "") then c.base = mbase end else c = _Class(_Container{name=n, base=mbase, extra_bases=p}) local ft = getnamespace(c.parent)..c.original_name append_global_type(ft, c) end push(c) c:parse(strsub(b,2,strlen(b)-1)) -- eliminate braces pop() end conky-1.12.2/3rdparty/toluapp/src/bin/lua/clean.lua000066400000000000000000000024561404127277500221010ustar00rootroot00000000000000-- mark up comments and strings STR1 = "\001" STR2 = "\002" STR3 = "\003" STR4 = "\004" REM = "\005" ANY = "([\001-\005])" ESC1 = "\006" ESC2 = "\007" MASK = { -- the substitution order is important {ESC1, "\\'"}, {ESC2, '\\"'}, {STR1, "'"}, {STR2, '"'}, {STR3, "%[%["}, {STR4, "%]%]"}, {REM , "%-%-"}, } function mask (s) for i = 1,#MASK do s = gsub(s,MASK[i][2],MASK[i][1]) end return s end function unmask (s) for i = 1,#MASK do s = gsub(s,MASK[i][1],MASK[i][2]) end return s end function clean (s) -- check for compilation error local code = "return function ()\n" .. s .. "\n end" if not dostring(code) then return nil end if flags['C'] then return s end local S = "" -- saved string s = mask(s) -- remove blanks and comments while 1 do local b,e,d = strfind(s,ANY) if b then S = S..strsub(s,1,b-1) s = strsub(s,b+1) if d==STR1 or d==STR2 then e = strfind(s,d) S = S ..d..strsub(s,1,e) s = strsub(s,e+1) elseif d==STR3 then e = strfind(s,STR4) S = S..d..strsub(s,1,e) s = strsub(s,e+1) elseif d==REM then s = gsub(s,"[^\n]*(\n?)","%1",1) end else S = S..s break end end -- eliminate unecessary spaces S = gsub(S,"[ \t]+"," ") S = gsub(S,"[ \t]*\n[ \t]*","\n") S = gsub(S,"\n+","\n") S = unmask(S) return S end conky-1.12.2/3rdparty/toluapp/src/bin/lua/code.lua000066400000000000000000000047301404127277500217260ustar00rootroot00000000000000-- tolua: code class -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 1999 -- $Id: $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. -- global code_n = 1 -- Code class -- Represents Lua code to be compiled and included -- in the initialization function. -- The following fields are stored: -- text = text code classCode = { text = '', } classCode.__index = classCode setmetatable(classCode,classFeature) -- register code function classCode:register (pre) pre = pre or '' -- clean Lua code local s = clean(self.text) if not s then --print(self.text) error("parser error in embedded code") end -- get first line local _, _, first_line=string.find(self.text, "^([^\n\r]*)") if string.find(first_line, "^%s*%-%-") then if string.find(first_line, "^%-%-##") then first_line = string.gsub(first_line, "^%-%-##", "") if flags['C'] then s = string.gsub(s, "^%-%-##[^\n\r]*\n", "") end end else first_line = "" end -- pad to 16 bytes local npad = 16 - (#s % 16) local spad = "" for i=1,npad do spad = spad .. "-" end s = s..spad -- convert to C output('\n'..pre..'{ /* begin embedded lua code */\n') output(pre..' int top = lua_gettop(tolua_S);') output(pre..' static const unsigned char B[] = {\n ') local t={n=0} local b = gsub(s,'(.)',function (c) local e = '' t.n=t.n+1 if t.n==15 then t.n=0 e='\n'..pre..' ' end return format('%3u,%s',strbyte(c),e) end ) output(b..strbyte(" ")) output('\n'..pre..' };\n') if first_line and first_line ~= "" then output(pre..' tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: '..first_line..'");') else output(pre..' tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code '..code_n..'");') end output(pre..' lua_settop(tolua_S, top);') output(pre..'} /* end of embedded lua code */\n\n') code_n = code_n +1 end -- Print method function classCode:print (ident,close) print(ident.."Code{") print(ident.." text = [["..self.text.."]],") print(ident.."}"..close) end -- Internal constructor function _Code (t) setmetatable(t,classCode) append(t) return t end -- Constructor -- Expects a string representing the code text function Code (l) return _Code { text = l } end conky-1.12.2/3rdparty/toluapp/src/bin/lua/compat-5.1.lua000077500000000000000000000017061404127277500226030ustar00rootroot00000000000000if string.find(_VERSION, "5%.0") then return end -- "loadfile" local function pp_dofile(path) local loaded = false local getfile = function() if loaded then return else local file,err = io.open(path) if not file then error("error loading file "..path..": "..err) end local ret = file:read("*a") file:close() ret = string.gsub(ret, "%.%.%.%s*%)", "...) local arg = {n=select('#', ...), ...};") loaded = true return ret end end local f = load(getfile, path) if not f then error("error loading file "..path ..": " .. errmsg) end return f() end old_dofile = dofile dofile = pp_dofile -- string.gsub --[[ local ogsub = string.gsub local function compgsub(a,b,c,d) if type(c) == "function" then local oc = c c = function (...) return oc(...) or '' end end return ogsub(a,b,c,d) end string.repl = ogsub --]] --string.gsub = compgsub conky-1.12.2/3rdparty/toluapp/src/bin/lua/compat.lua000066400000000000000000000100651404127277500222750ustar00rootroot00000000000000------------------------------------------------------------------- -- Real globals -- _ALERT -- _ERRORMESSAGE -- _VERSION -- _G -- assert -- error -- metatable -- next -- print -- require -- tonumber -- tostring -- type -- unpack ------------------------------------------------------------------- -- collectgarbage -- gcinfo -- globals -- call -> protect(f, err) -- loadfile -- loadstring -- rawget -- rawset -- getargs = Main.getargs ?? rawtype = type function do_ (f, err) if not f then print(err); return end local a,b = pcall(f) if not a then print(b); return nil else return b or true end end function dostring(s) return do_(load(s)) end -- function dofile(s) return do_(loadfile(s)) end ------------------------------------------------------------------- -- Table library local tab = table getn = function (tab) return #tab end tinsert = tab.insert tremove = tab.remove sort = tab.sort ------------------------------------------------------------------- -- Debug library local dbg = debug getinfo = dbg.getinfo getlocal = dbg.getlocal setcallhook = function () error"`setcallhook' is deprecated" end setlinehook = function () error"`setlinehook' is deprecated" end setlocal = dbg.setlocal ------------------------------------------------------------------- -- math library local math = math abs = math.abs acos = function (x) return math.deg(math.acos(x)) end asin = function (x) return math.deg(math.asin(x)) end atan = function (x) return math.deg(math.atan(x)) end atan2 = function (x,y) return math.deg(math.atan2(x,y)) end ceil = math.ceil cos = function (x) return math.cos(math.rad(x)) end deg = math.deg exp = math.exp floor = math.floor frexp = math.frexp ldexp = math.ldexp log = math.log log10 = function(val) return math.log(10, val) end max = math.max min = math.min mod = math.mod PI = math.pi --??? pow = math.pow rad = math.rad random = math.random randomseed = math.randomseed sin = function (x) return math.sin(math.rad(x)) end sqrt = math.sqrt tan = function (x) return math.tan(math.rad(x)) end ------------------------------------------------------------------- -- string library local str = string strbyte = str.byte strchar = str.char strfind = str.find format = str.format gsub = str.gsub strlen = str.len strlower = str.lower strrep = str.rep strsub = str.sub strupper = str.upper ------------------------------------------------------------------- -- os library clock = os.clock date = os.date difftime = os.difftime execute = os.execute --? exit = os.exit getenv = os.getenv remove = os.remove rename = os.rename setlocale = os.setlocale time = os.time tmpname = os.tmpname ------------------------------------------------------------------- -- compatibility only getglobal = function (n) return _G[n] end setglobal = function (n,v) _G[n] = v end ------------------------------------------------------------------- local io, tab = io, table -- IO library (files) _STDIN = io.stdin _STDERR = io.stderr _STDOUT = io.stdout _INPUT = io.stdin _OUTPUT = io.stdout seek = io.stdin.seek -- sick ;-) tmpfile = io.tmpfile closefile = io.close openfile = io.open function flush (f) if f then f:flush() else _OUTPUT:flush() end end function readfrom (name) if name == nil then local f, err, cod = io.close(_INPUT) _INPUT = io.stdin return f, err, cod else local f, err, cod = io.open(name, "r") _INPUT = f or _INPUT return f, err, cod end end function writeto (name) if name == nil then local f, err, cod = io.close(_OUTPUT) _OUTPUT = io.stdout return f, err, cod else local f, err, cod = io.open(name, "w") _OUTPUT = f or _OUTPUT return f, err, cod end end function appendto (name) local f, err, cod = io.open(name, "a") _OUTPUT = f or _OUTPUT return f, err, cod end function read (...) local f = _INPUT local arg = {...} if rawtype(arg[1]) == 'userdata' then f = tab.remove(arg, 1) end return f:read(table.unpack(arg)) end function write (...) local f = _OUTPUT local arg = {...} if rawtype(arg[1]) == 'userdata' then f = tab.remove(arg, 1) end return f:write(table.unpack(arg)) end conky-1.12.2/3rdparty/toluapp/src/bin/lua/container.lua000066400000000000000000000420061404127277500227740ustar00rootroot00000000000000-- tolua: container abstract class -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 1998 -- $Id: $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. -- table to store namespaced typedefs/enums in global scope global_typedefs = {} global_enums = {} -- Container class -- Represents a container of features to be bound -- to lua. classContainer = { curr = nil, } classContainer.__index = classContainer setmetatable(classContainer,classFeature) -- output tags function classContainer:decltype () push(self) local i=1 while self[i] do self[i]:decltype() i = i+1 end pop() end -- write support code function classContainer:supcode () if not self:check_public_access() then return end push(self) local i=1 while self[i] do if self[i]:check_public_access() then self[i]:supcode() end i = i+1 end pop() end function classContainer:hasvar () local i=1 while self[i] do if self[i]:isvariable() then return 1 end i = i+1 end return 0 end -- Internal container constructor function _Container (self) setmetatable(self,classContainer) self.n = 0 self.typedefs = {tolua_n=0} self.usertypes = {} self.enums = {tolua_n=0} self.lnames = {} return self end -- push container function push (t) t.prox = classContainer.curr classContainer.curr = t end -- pop container function pop () --print("name",classContainer.curr.name) --foreach(classContainer.curr.usertypes,print) --print("______________") classContainer.curr = classContainer.curr.prox end -- get current namespace function getcurrnamespace () return getnamespace(classContainer.curr) end -- append to current container function append (t) return classContainer.curr:append(t) end -- append typedef to current container function appendtypedef (t) return classContainer.curr:appendtypedef(t) end -- append usertype to current container function appendusertype (t) return classContainer.curr:appendusertype(t) end -- append enum to current container function appendenum (t) return classContainer.curr:appendenum(t) end -- substitute typedef function applytypedef (mod,type) return classContainer.curr:applytypedef(mod,type) end -- check if is type function findtype (type) local t = classContainer.curr:findtype(type) return t end -- check if is typedef function istypedef (type) return classContainer.curr:istypedef(type) end -- get fulltype (with namespace) function fulltype (t) local curr = classContainer.curr while curr do if curr then if curr.typedefs and curr.typedefs[t] then return curr.typedefs[t] elseif curr.usertypes and curr.usertypes[t] then return curr.usertypes[t] end end curr = curr.prox end return t end -- checks if it requires collection function classContainer:requirecollection (t) push(self) local i=1 local r = false while self[i] do r = self[i]:requirecollection(t) or r i = i+1 end pop() return r end -- get namesapce function getnamespace (curr) local namespace = '' while curr do if curr and ( curr.classtype == 'class' or curr.classtype == 'namespace') then namespace = (curr.original_name or curr.name) .. '::' .. namespace --namespace = curr.name .. '::' .. namespace end curr = curr.prox end return namespace end -- get namespace (only namespace) function getonlynamespace () local curr = classContainer.curr local namespace = '' while curr do if curr.classtype == 'class' then return namespace elseif curr.classtype == 'namespace' then namespace = curr.name .. '::' .. namespace end curr = curr.prox end return namespace end -- check if is enum function isenum (type) return classContainer.curr:isenum(type) end -- append feature to container function classContainer:append (t) self.n = self.n + 1 self[self.n] = t t.parent = self end -- append typedef function classContainer:appendtypedef (t) local namespace = getnamespace(classContainer.curr) self.typedefs.tolua_n = self.typedefs.tolua_n + 1 self.typedefs[self.typedefs.tolua_n] = t self.typedefs[t.utype] = namespace .. t.utype global_typedefs[namespace..t.utype] = t t.ftype = findtype(t.type) or t.type --print("appending typedef "..t.utype.." as "..namespace..t.utype.." with ftype "..t.ftype) append_global_type(namespace..t.utype) if t.ftype and isenum(t.ftype) then global_enums[namespace..t.utype] = true end end -- append usertype: return full type function classContainer:appendusertype (t) local container if t == (self.original_name or self.name) then container = self.prox else container = self end local ft = getnamespace(container) .. t container.usertypes[t] = ft _usertype[ft] = ft return ft end -- append enum function classContainer:appendenum (t) local namespace = getnamespace(classContainer.curr) self.enums.tolua_n = self.enums.tolua_n + 1 self.enums[self.enums.tolua_n] = t global_enums[namespace..t.name] = t end -- determine lua function name overload function classContainer:overload (lname) if not self.lnames[lname] then self.lnames[lname] = 0 else self.lnames[lname] = self.lnames[lname] + 1 end return format("%02d",self.lnames[lname]) end -- applies typedef: returns the 'the facto' modifier and type function classContainer:applytypedef (mod,type) if global_typedefs[type] then --print("found typedef "..global_typedefs[type].type) local mod1, type1 = global_typedefs[type].mod, global_typedefs[type].ftype local mod2, type2 = applytypedef(mod.." "..mod1, type1) --return mod2 .. ' ' .. mod1, type2 return mod2, type2 end do return mod,type end end -- check if it is a typedef function classContainer:istypedef (type) local env = self while env do if env.typedefs then local i=1 while env.typedefs[i] do if env.typedefs[i].utype == type then return type end i = i+1 end end env = env.parent end return nil end function find_enum_var(var) if tonumber(var) then return var end local c = classContainer.curr while c do local ns = getnamespace(c) for k,v in pairs(_global_enums) do if match_type(var, v, ns) then return v end end if c.base and c.base ~= '' then c = _global_classes[c:findtype(c.base)] else c = nil end end return var end -- check if is a registered type: return full type or nil function classContainer:findtype (t) t = string.gsub(t, "=.*", "") if _basic[t] then return t end local _,_,em = string.find(t, "([&%*])%s*$") t = string.gsub(t, "%s*([&%*])%s*$", "") p = self while p and type(p)=='table' do local st = getnamespace(p) for i=_global_types.n,1,-1 do -- in reverse order if match_type(t, _global_types[i], st) then return _global_types[i]..(em or "") end end if p.base and p.base ~= '' and p.base ~= t then --print("type is "..t..", p is "..p.base.." self.type is "..self.type.." self.name is "..self.name) p = _global_classes[p:findtype(p.base)] else p = nil end end return nil end function append_global_type(t, class) _global_types.n = _global_types.n +1 _global_types[_global_types.n] = t _global_types_hash[t] = 1 if class then append_class_type(t, class) end end function append_class_type(t,class) if _global_classes[t] then class.flags = _global_classes[t].flags class.lnames = _global_classes[t].lnames if _global_classes[t].base and (_global_classes[t].base ~= '') then class.base = _global_classes[t].base or class.base end end _global_classes[t] = class class.flags = class.flags or {} end function match_type(childtype, regtype, st) --print("findtype "..childtype..", "..regtype..", "..st) local b,e = string.find(regtype, childtype, -string.len(childtype), true) if b then if e == string.len(regtype) and (b == 1 or (string.sub(regtype, b-1, b-1) == ':' and string.sub(regtype, 1, b-1) == string.sub(st, 1, b-1))) then return true end end return false end function findtype_on_childs(self, t) local tchild if self.classtype == 'class' or self.classtype == 'namespace' then for k,v in ipairs(self) do if v.classtype == 'class' or v.classtype == 'namespace' then if v.typedefs and v.typedefs[t] then return v.typedefs[t] elseif v.usertypes and v.usertypes[t] then return v.usertypes[t] end tchild = findtype_on_childs(v, t) if tchild then return tchild end end end end return nil end function classContainer:isenum (type) if global_enums[type] then return type else return false end local basetype = gsub(type,"^.*::","") local env = self while env do if env.enums then local i=1 while env.enums[i] do if env.enums[i].name == basetype then return true end i = i+1 end end env = env.parent end return false end methodisvirtual = false -- a global -- parse chunk function classContainer:doparse (s) --print ("parse "..s) -- try the parser hook do local sub = parser_hook(s) if sub then return sub end end -- try the null statement do local b,e,code = string.find(s, "^%s*;") if b then return strsub(s,e+1) end end -- try empty verbatim line do local b,e,code = string.find(s, "^%s*$\n") if b then return strsub(s,e+1) end end -- try Lua code do local b,e,code = strfind(s,"^%s*(%b\1\2)") if b then Code(strsub(code,2,-2)) return strsub(s,e+1) end end -- try C code do local b,e,code = strfind(s,"^%s*(%b\3\4)") if b then code = '{'..strsub(code,2,-2)..'\n}\n' Verbatim(code,'r') -- verbatim code for 'r'egister fragment return strsub(s,e+1) end end -- try C code for preamble section do local b,e,code = string.find(s, "^%s*(%b\5\6)") if b then code = string.sub(code, 2, -2).."\n" Verbatim(code, '') return string.sub(s, e+1) end end -- try default_property directive do local b,e,ptype = strfind(s, "^%s*TOLUA_PROPERTY_TYPE%s*%(+%s*([^%)%s]*)%s*%)+%s*;?") if b then if not ptype or ptype == "" then ptype = "default" end self:set_property_type(ptype) return strsub(s, e+1) end end -- try protected_destructor directive do local b,e = string.find(s, "^%s*TOLUA_PROTECTED_DESTRUCTOR%s*;?") if b then if self.set_protected_destructor then self:set_protected_destructor(true) end return strsub(s, e+1) end end -- try 'extern' keyword do local b,e = string.find(s, "^%s*extern%s+") if b then -- do nothing return strsub(s, e+1) end end -- try 'virtual' keyworkd do local b,e = string.find(s, "^%s*virtual%s+") if b then methodisvirtual = true return strsub(s, e+1) end end -- try labels (public, private, etc) do local b,e = string.find(s, "^%s*%w*%s*:[^:]") if b then return strsub(s, e) -- preserve the [^:] end end -- try module do local b,e,name,body = strfind(s,"^%s*module%s%s*([_%w][_%w]*)%s*(%b{})%s*") if b then _curr_code = strsub(s,b,e) Module(name,body) return strsub(s,e+1) end end -- try namesapce do local b,e,name,body = strfind(s,"^%s*namespace%s%s*([_%w][_%w]*)%s*(%b{})%s*;?") if b then _curr_code = strsub(s,b,e) Namespace(name,body) return strsub(s,e+1) end end -- try define do local b,e,name = strfind(s,"^%s*#define%s%s*([^%s]*)[^\n]*\n%s*") if b then _curr_code = strsub(s,b,e) Define(name) return strsub(s,e+1) end end -- try enumerates do local b,e,name,body,varname = strfind(s,"^%s*enum%s+(%S*)%s*(%b{})%s*([^%s;]*)%s*;?%s*") if b then --error("#Sorry, declaration of enums and variables on the same statement is not supported.\nDeclare your variable separately (example: '"..name.." "..varname..";')") _curr_code = strsub(s,b,e) Enumerate(name,body,varname) return strsub(s,e+1) end end -- do -- local b,e,name,body = strfind(s,"^%s*enum%s+(%S*)%s*(%b{})%s*;?%s*") -- if b then -- _curr_code = strsub(s,b,e) -- Enumerate(name,body) -- return strsub(s,e+1) -- end -- end do local b,e,body,name = strfind(s,"^%s*typedef%s+enum[^{]*(%b{})%s*([%w_][^%s]*)%s*;%s*") if b then _curr_code = strsub(s,b,e) Enumerate(name,body) return strsub(s,e+1) end end -- try operator do local b,e,decl,kind,arg,const = strfind(s,"^%s*([_%w][_%w%s%*&:<>,]-%s+operator)%s*([^%s][^%s]*)%s*(%b())%s*(c?o?n?s?t?)%s*;%s*") if not b then -- try inline b,e,decl,kind,arg,const = strfind(s,"^%s*([_%w][_%w%s%*&:<>,]-%s+operator)%s*([^%s][^%s]*)%s*(%b())%s*(c?o?n?s?t?)[%s\n]*%b{}%s*;?%s*") end if not b then -- try cast operator b,e,decl,kind,arg,const = strfind(s, "^%s*(operator)%s+([%w_:%d<>%*%&%s]+)%s*(%b())%s*(c?o?n?s?t?)"); if b then local _,ie = string.find(s, "^%s*%b{}", e+1) if ie then e = ie end end end if b then _curr_code = strsub(s,b,e) Operator(decl,kind,arg,const) return strsub(s,e+1) end end -- try function do --local b,e,decl,arg,const = strfind(s,"^%s*([~_%w][_@%w%s%*&:<>]*[_%w])%s*(%b())%s*(c?o?n?s?t?)%s*=?%s*0?%s*;%s*") local b,e,decl,arg,const,virt = strfind(s,"^%s*([^%(\n]+)%s*(%b())%s*(c?o?n?s?t?)%s*(=?%s*0?)%s*;%s*") if not b then -- try function with template b,e,decl,arg,const = strfind(s,"^%s*([~_%w][_@%w%s%*&:<>]*[_%w]%b<>)%s*(%b())%s*(c?o?n?s?t?)%s*=?%s*0?%s*;%s*") end if not b then -- try a single letter function name b,e,decl,arg,const = strfind(s,"^%s*([_%w])%s*(%b())%s*(c?o?n?s?t?)%s*;%s*") end if not b then -- try function pointer b,e,decl,arg,const = strfind(s,"^%s*([^%(;\n]+%b())%s*(%b())%s*;%s*") if b then decl = string.gsub(decl, "%(%s*%*([^%)]*)%s*%)", " %1 ") end end if b then if virt and string.find(virt, "[=0]") then if self.flags then self.flags.pure_virtual = true end end _curr_code = strsub(s,b,e) Function(decl,arg,const) return strsub(s,e+1) end end -- try inline function do local b,e,decl,arg,const = strfind(s,"^%s*([^%(\n]+)%s*(%b())%s*(c?o?n?s?t?)[^;{]*%b{}%s*;?%s*") --local b,e,decl,arg,const = strfind(s,"^%s*([~_%w][_@%w%s%*&:<>]*[_%w>])%s*(%b())%s*(c?o?n?s?t?)[^;]*%b{}%s*;?%s*") if not b then -- try a single letter function name b,e,decl,arg,const = strfind(s,"^%s*([_%w])%s*(%b())%s*(c?o?n?s?t?).-%b{}%s*;?%s*") end if b then _curr_code = strsub(s,b,e) Function(decl,arg,const) return strsub(s,e+1) end end -- try class do local b,e,name,base,body base = '' body = '' b,e,name = strfind(s,"^%s*class%s*([_%w][_%w@]*)%s*;") -- dummy class local dummy = false if not b then b,e,name = strfind(s,"^%s*struct%s*([_%w][_%w@]*)%s*;") -- dummy struct if not b then b,e,name,base,body = strfind(s,"^%s*class%s*([_%w][_%w@]*)%s*([^{]-)%s*(%b{})%s*") if not b then b,e,name,base,body = strfind(s,"^%s*struct%s+([_%w][_%w@]*)%s*([^{]-)%s*(%b{})%s*") if not b then b,e,name,base,body = strfind(s,"^%s*union%s*([_%w][_%w@]*)%s*([^{]-)%s*(%b{})%s*") if not b then base = '' b,e,body,name = strfind(s,"^%s*typedef%s%s*struct%s%s*[_%w]*%s*(%b{})%s*([_%w][_%w@]*)%s*;") end end end else dummy = 1 end else dummy = 1 end if b then if base ~= '' then base = string.gsub(base, "^%s*:%s*", "") base = string.gsub(base, "%s*public%s*", "") base = split(base, ",") --local b,e --b,e,base = strfind(base,".-([_%w][_%w<>,:]*)$") else base = {} end _curr_code = strsub(s,b,e) Class(name,base,body) if not dummy then varb,vare,varname = string.find(s, "^%s*([_%w]+)%s*;", e+1) if varb then Variable(name.." "..varname) e = vare end end return strsub(s,e+1) end end -- try typedef do local b,e,types = strfind(s,"^%s*typedef%s%s*(.-)%s*;%s*") if b then _curr_code = strsub(s,b,e) Typedef(types) return strsub(s,e+1) end end -- try variable do local b,e,decl = strfind(s,"^%s*([_%w][_@%s%w%d%*&:<>,]*[_%w%d])%s*;%s*") if b then _curr_code = strsub(s,b,e) local list = split_c_tokens(decl, ",") Variable(list[1]) if list.n > 1 then local _,_,type = strfind(list[1], "(.-)%s+([^%s]*)$"); local i =2; while list[i] do Variable(type.." "..list[i]) i=i+1 end end --Variable(decl) return strsub(s,e+1) end end -- try string do local b,e,decl = strfind(s,"^%s*([_%w]?[_%s%w%d]-char%s+[_@%w%d]*%s*%[%s*%S+%s*%])%s*;%s*") if b then _curr_code = strsub(s,b,e) Variable(decl) return strsub(s,e+1) end end -- try array do local b,e,decl = strfind(s,"^%s*([_%w][][_@%s%w%d%*&:<>]*[]_%w%d])%s*;%s*") if b then _curr_code = strsub(s,b,e) Array(decl) return strsub(s,e+1) end end -- no matching if gsub(s,"%s%s*","") ~= "" then _curr_code = s error("#parse error") else return "" end end function classContainer:parse (s) --self.curr_member_access = nil while s ~= '' do s = self:doparse(s) methodisvirtual = false end end -- property types function get_property_type() return classContainer.curr:get_property_type() end function classContainer:set_property_type(ptype) ptype = string.gsub(ptype, "^%s*", "") ptype = string.gsub(ptype, "%s*$", "") self.property_type = ptype end function classContainer:get_property_type() return self.property_type or (self.parent and self.parent:get_property_type()) or "default" end conky-1.12.2/3rdparty/toluapp/src/bin/lua/custom.lua000066400000000000000000000025541404127277500223300ustar00rootroot00000000000000 function extract_code(fn,s) local code = "" if fn then code = '\n$#include "'..fn..'"\n' end s= "\n" .. s .. "\n" -- add blank lines as sentinels local _,e,c,t = strfind(s, "\n([^\n]-)SCRIPT_([%w_]*)[^\n]*\n") while e do t = strlower(t) if t == "bind_begin" then _,e,c = strfind(s,"(.-)\n[^\n]*SCRIPT_BIND_END[^\n]*\n",e) if not e then tolua_error("Unbalanced 'SCRIPT_BIND_BEGIN' directive in header file") end end if t == "bind_class" or t == "bind_block" then local b _,e,c,b = string.find(s, "([^{]-)(%b{})", e) c = c..'{\n'..extract_code(nil, b)..'\n};\n' end code = code .. c .. "\n" _,e,c,t = strfind(s, "\n([^\n]-)SCRIPT_([%w_]*)[^\n]*\n",e) end return code end function preprocess_hook(p) end function preparse_hook(p) end function include_file_hook(p, filename) do return end --print("FILENAME is "..filename) p.code = string.gsub(p.code, "\n%s*SigC::Signal", "\n\ttolua_readonly SigC::Signal") p.code = string.gsub(p.code, "#ifdef __cplusplus\nextern \"C\" {\n#endif", "") p.code = string.gsub(p.code, "#ifdef __cplusplus\n};?\n#endif", "") p.code = string.gsub(p.code, "DECLSPEC", "") p.code = string.gsub(p.code, "SDLCALL", "") p.code = string.gsub(p.code, "DLLINTERFACE", "") p.code = string.gsub(p.code, "#define[^\n]*_[hH]_?%s*\n", "\n") --print("code is "..p.code) end conky-1.12.2/3rdparty/toluapp/src/bin/lua/declaration.lua000066400000000000000000000352451404127277500233060ustar00rootroot00000000000000-- tolua: declaration class -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 1998 -- $Id: $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. -- Declaration class -- Represents variable, function, or argument declaration. -- Stores the following fields: -- mod = type modifiers -- type = type -- ptr = "*" or "&", if representing a pointer or a reference -- name = name -- dim = dimension, if a vector -- def = default value, if any (only for arguments) -- ret = "*" or "&", if value is to be returned (only for arguments) classDeclaration = { mod = '', type = '', ptr = '', name = '', dim = '', ret = '', def = '' } classDeclaration.__index = classDeclaration setmetatable(classDeclaration,classFeature) -- Create an unique variable name function create_varname () if not _varnumber then _varnumber = 0 end _varnumber = _varnumber + 1 return "tolua_var_".._varnumber end -- Check declaration name -- It also identifies default values function classDeclaration:checkname () if strsub(self.name,1,1) == '[' and not findtype(self.type) then self.name = self.type..self.name local m = split(self.mod,'%s%s*') self.type = m[m.n] self.mod = concat(m,1,m.n-1) end local t = split(self.name,'=') if t.n==2 then self.name = t[1] self.def = find_enum_var(t[t.n]) end local b,e,d = strfind(self.name,"%[(.-)%]") if b then self.name = strsub(self.name,1,b-1) self.dim = find_enum_var(d) end if self.type ~= '' and self.type ~= 'void' and self.name == '' then self.name = create_varname() elseif self.kind=='var' then if self.type=='' and self.name~='' then self.type = self.type..self.name self.name = create_varname() elseif findtype(self.name) then if self.type=='' then self.type = self.name else self.type = self.type..' '..self.name end self.name = create_varname() end end -- adjust type of string if self.type == 'char' and self.dim ~= '' then self.type = 'char*' end if self.kind and self.kind == 'var' then self.name = string.gsub(self.name, ":.*$", "") -- ??? end end -- Check declaration type -- Substitutes typedef's. function classDeclaration:checktype () -- check if there is a pointer to basic type local basic = isbasic(self.type) if self.kind == 'func' and basic=='number' and string.find(self.ptr, "%*") then self.type = '_userdata' self.ptr = "" end if basic and self.ptr~='' then self.ret = self.ptr self.ptr = nil if isbasic(self.type) == 'number' then self.return_userdata = true end end -- check if there is array to be returned if self.dim~='' and self.ret~='' then error('#invalid parameter: cannot return an array of values') end -- restore 'void*' and 'string*' if self.type == '_userdata' then self.type = 'void*' elseif self.type == '_cstring' then self.type = 'char*' elseif self.type == '_lstate' then self.type = 'lua_State*' end -- resolve types inside the templates if self.type then self.type = resolve_template_types(self.type) end -- -- -- if returning value, automatically set default value -- if self.ret ~= '' and self.def == '' then -- self.def = '0' -- end -- end function resolve_template_types(type) if isbasic(type) then return type end local b,_,m = string.find(type, "(%b<>)") if b then m = split_c_tokens(string.sub(m, 2, -2), ",") for i=1, #m do m[i] = string.gsub(m[i],"%s*([%*&])", "%1") if not isbasic(m[i]) then if not isenum(m[i]) then _, m[i] = applytypedef("", m[i]) end m[i] = findtype(m[i]) or m[i] m[i] = resolve_template_types(m[i]) end end local b,i type,b,i = break_template(type) --print("concat is ",concat(m, 1, m.n)) local template_part = "<"..concat(m, 1, m.n, ",")..">" type = rebuild_template(type, b, template_part) type = string.gsub(type, ">>", "> >") end return type end function break_template(s) local b,e,timpl = string.find(s, "(%b<>)") if timpl then s = string.gsub(s, "%b<>", "") return s, b, timpl else return s, 0, nil end end function rebuild_template(s, b, timpl) if b == 0 then return s end return string.sub(s, 1, b-1)..timpl..string.sub(s, b, -1) end -- Print method function classDeclaration:print (ident,close) print(ident.."Declaration{") print(ident.." mod = '"..self.mod.."',") print(ident.." type = '"..self.type.."',") print(ident.." ptr = '"..self.ptr.."',") print(ident.." name = '"..self.name.."',") print(ident.." dim = '"..self.dim.."',") print(ident.." def = '"..self.def.."',") print(ident.." ret = '"..self.ret.."',") print(ident.."}"..close) end -- check if array of values are returned to Lua function classDeclaration:requirecollection (t) if self.mod ~= 'const' and self.dim and self.dim ~= '' and not isbasic(self.type) and self.ptr == '' and self:check_public_access() then local type = gsub(self.type,"%s*const%s+","") t[type] = "tolua_collect_" .. clean_template(type) return true end return false end -- declare tag function classDeclaration:decltype () self.type = typevar(self.type) if strfind(self.mod,'const') then self.type = 'const '..self.type self.mod = gsub(self.mod,'const%s*','') end end -- output type checking function classDeclaration:outchecktype (narg) local def local t = isbasic(self.type) if self.def~='' then def = 1 else def = 0 end if self.dim ~= '' then --if t=='string' then -- return 'tolua_isstringarray(tolua_S,'..narg..','..def..',&tolua_err)' --else return '!tolua_istable(tolua_S,'..narg..',0,&tolua_err)' --end elseif t then return '!tolua_is'..t..'(tolua_S,'..narg..','..def..',&tolua_err)' else local is_func = get_is_function(self.type) if self.ptr == '&' or self.ptr == '' then return '(tolua_isvaluenil(tolua_S,'..narg..',&tolua_err) || !'..is_func..'(tolua_S,'..narg..',"'..self.type..'",'..def..',&tolua_err))' else return '!'..is_func..'(tolua_S,'..narg..',"'..self.type..'",'..def..',&tolua_err)' end end end function classDeclaration:builddeclaration (narg, cplusplus) local array = self.dim ~= '' and tonumber(self.dim)==nil local line = "" local ptr = '' local mod local type = self.type local nctype = gsub(self.type,'const%s+','') if self.dim ~= '' then type = gsub(self.type,'const%s+','') -- eliminates const modifier for arrays end if self.ptr~='' and not isbasic(type) then ptr = '*' end line = concatparam(line," ",self.mod,type,ptr) if array then line = concatparam(line,'*') end line = concatparam(line,self.name) if self.dim ~= '' then if tonumber(self.dim)~=nil then line = concatparam(line,'[',self.dim,'];') else if cplusplus then line = concatparam(line,' = Mtolua_new_dim(',type,ptr,', '..self.dim..');') else line = concatparam(line,' = (',type,ptr,'*)', 'malloc((',self.dim,')*sizeof(',type,ptr,'));') end end else local t = isbasic(type) line = concatparam(line,' = ') if t == 'state' then line = concatparam(line, 'tolua_S;') else --print("t is "..tostring(t)..", ptr is "..tostring(self.ptr)) if t == 'number' and string.find(self.ptr, "%*") then t = 'userdata' end if not t and ptr=='' then line = concatparam(line,'*') end line = concatparam(line,'((',self.mod,type) if not t then line = concatparam(line,'*') end line = concatparam(line,') ') if isenum(nctype) then line = concatparam(line,'(int) ') end local def = 0 if self.def ~= '' then def = self.def if (ptr == '' or self.ptr == '&') and not t then def = "(void*)&(const "..type..")"..def end end if t then line = concatparam(line,'tolua_to'..t,'(tolua_S,',narg,',',def,'));') else local to_func = get_to_function(type) line = concatparam(line,to_func..'(tolua_S,',narg,',',def,'));') end end end return line end -- Declare variable function classDeclaration:declare (narg) if self.dim ~= '' and tonumber(self.dim)==nil then output('#ifdef __cplusplus\n') output(self:builddeclaration(narg,true)) output('#else\n') output(self:builddeclaration(narg,false)) output('#endif\n') else output(self:builddeclaration(narg,false)) end end -- Get parameter value function classDeclaration:getarray (narg) if self.dim ~= '' then local type = gsub(self.type,'const ','') output(' {') output('#ifndef TOLUA_RELEASE\n') local def; if self.def~='' then def=1 else def=0 end local t = isbasic(type) if (t) then output(' if (!tolua_is'..t..'array(tolua_S,',narg,',',self.dim,',',def,',&tolua_err))') else output(' if (!tolua_isusertypearray(tolua_S,',narg,',"',type,'",',self.dim,',',def,',&tolua_err))') end output(' goto tolua_lerror;') output(' else\n') output('#endif\n') output(' {') output(' int i;') output(' for(i=0; i<'..self.dim..';i++)') local t = isbasic(type) local ptr = '' if self.ptr~='' then ptr = '*' end output(' ',self.name..'[i] = ') if not t and ptr=='' then output('*') end output('((',type) if not t then output('*') end output(') ') local def = 0 if self.def ~= '' then def = self.def end if t then output('tolua_tofield'..t..'(tolua_S,',narg,',i+1,',def,'));') else output('tolua_tofieldusertype(tolua_S,',narg,',i+1,',def,'));') end output(' }') output(' }') end end -- Get parameter value function classDeclaration:setarray (narg) if not strfind(self.type,'const%s+') and self.dim ~= '' then local type = gsub(self.type,'const ','') output(' {') output(' int i;') output(' for(i=0; i<'..self.dim..';i++)') local t,ct = isbasic(type) if t then output(' tolua_pushfield'..t..'(tolua_S,',narg,',i+1,(',ct,')',self.name,'[i]);') else if self.ptr == '' then output(' {') output('#ifdef __cplusplus\n') output(' void* tolua_obj = Mtolua_new((',type,')(',self.name,'[i]));') output(' tolua_pushfieldusertype_and_takeownership(tolua_S,',narg,',i+1,tolua_obj,"',type,'");') output('#else\n') output(' void* tolua_obj = tolua_copy(tolua_S,(void*)&',self.name,'[i],sizeof(',type,'));') output(' tolua_pushfieldusertype(tolua_S,',narg,',i+1,tolua_obj,"',type,'");') output('#endif\n') output(' }') else output(' tolua_pushfieldusertype(tolua_S,',narg,',i+1,(void*)',self.name,'[i],"',type,'");') end end output(' }') end end -- Free dynamically allocated array function classDeclaration:freearray () if self.dim ~= '' and tonumber(self.dim)==nil then output('#ifdef __cplusplus\n') output(' Mtolua_delete_dim(',self.name,');') output('#else\n') output(' free(',self.name,');') output('#endif\n') end end -- Pass parameter function classDeclaration:passpar () if self.ptr=='&' and not isbasic(self.type) then output('*'..self.name) elseif self.ret=='*' then output('&'..self.name) else output(self.name) end end -- Return parameter value function classDeclaration:retvalue () if self.ret ~= '' then local t,ct = isbasic(self.type) if t and t~='' then output(' tolua_push'..t..'(tolua_S,(',ct,')'..self.name..');') else local push_func = get_push_function(self.type) output(' ',push_func,'(tolua_S,(void*)'..self.name..',"',self.type,'");') end return 1 end return 0 end -- Internal constructor function _Declaration (t) setmetatable(t,classDeclaration) t:buildnames() t:checkname() t:checktype() local ft = findtype(t.type) or t.type if not isenum(ft) then t.mod, t.type = applytypedef(t.mod, ft) end if t.kind=="var" and (string.find(t.mod, "tolua_property%s") or string.find(t.mod, "tolua_property$")) then t.mod = string.gsub(t.mod, "tolua_property", "tolua_property__"..get_property_type()) end return t end -- Constructor -- Expects the string declaration. -- The kind of declaration can be "var" or "func". function Declaration (s,kind,is_parameter) -- eliminate spaces if default value is provided s = gsub(s,"%s*=%s*","=") s = gsub(s, "%s*<", "<") local defb,tmpdef defb,_,tmpdef = string.find(s, "(=.*)$") if defb then s = string.gsub(s, "=.*$", "") else tmpdef = '' end if kind == "var" then -- check the form: void if s == '' or s == 'void' then return _Declaration{type = 'void', kind = kind, is_parameter = is_parameter} end end -- check the form: mod type*& name local t = split_c_tokens(s,'%*%s*&') if t.n == 2 then if kind == 'func' then error("#invalid function return type: "..s) end --local m = split(t[1],'%s%s*') local m = split_c_tokens(t[1],'%s+') return _Declaration{ name = t[2]..tmpdef, ptr = '*', ret = '&', --type = rebuild_template(m[m.n], tb, timpl), type = m[m.n], mod = concat(m,1,m.n-1), is_parameter = is_parameter, kind = kind } end -- check the form: mod type** name t = split_c_tokens(s,'%*%s*%*') if t.n == 2 then if kind == 'func' then error("#invalid function return type: "..s) end --local m = split(t[1],'%s%s*') local m = split_c_tokens(t[1],'%s+') return _Declaration{ name = t[2]..tmpdef, ptr = '*', ret = '*', --type = rebuild_template(m[m.n], tb, timpl), type = m[m.n], mod = concat(m,1,m.n-1), is_parameter = is_parameter, kind = kind } end -- check the form: mod type& name t = split_c_tokens(s,'&') if t.n == 2 then --local m = split(t[1],'%s%s*') local m = split_c_tokens(t[1],'%s+') return _Declaration{ name = t[2]..tmpdef, ptr = '&', --type = rebuild_template(m[m.n], tb, timpl), type = m[m.n], mod = concat(m,1,m.n-1), is_parameter = is_parameter, kind = kind } end -- check the form: mod type* name local s1 = gsub(s,"(%b%[%])",function (n) return gsub(n,'%*','\1') end) t = split_c_tokens(s1,'%*') if t.n == 2 then t[2] = gsub(t[2],'\1','%*') -- restore * in dimension expression --local m = split(t[1],'%s%s*') local m = split_c_tokens(t[1],'%s+') return _Declaration{ name = t[2]..tmpdef, ptr = '*', type = m[m.n], --type = rebuild_template(m[m.n], tb, timpl), mod = concat(m,1,m.n-1) , is_parameter = is_parameter, kind = kind } end if kind == 'var' then -- check the form: mod type name --t = split(s,'%s%s*') t = split_c_tokens(s,'%s+') local v if findtype(t[t.n]) then v = create_varname() else v = t[t.n]; t.n = t.n-1 end return _Declaration{ name = v..tmpdef, --type = rebuild_template(t[t.n], tb, timpl), type = t[t.n], mod = concat(t,1,t.n-1), is_parameter = is_parameter, kind = kind } else -- kind == "func" -- check the form: mod type name --t = split(s,'%s%s*') t = split_c_tokens(s,'%s+') local v = t[t.n] -- last word is the function name local tp,md if t.n>1 then tp = t[t.n-1] md = concat(t,1,t.n-2) end --if tp then tp = rebuild_template(tp, tb, timpl) end return _Declaration{ name = v, type = tp, mod = md, is_parameter = is_parameter, kind = kind } end end conky-1.12.2/3rdparty/toluapp/src/bin/lua/define.lua000066400000000000000000000024451404127277500222470ustar00rootroot00000000000000-- tolua: define class -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 1998 -- $Id: define.lua,v 1.2 1999/07/28 22:21:08 celes Exp $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. -- Define class -- Represents a numeric const definition -- The following filds are stored: -- name = constant name classDefine = { name = '', } classDefine.__index = classDefine setmetatable(classDefine,classFeature) -- register define function classDefine:register (pre) if not self:check_public_access() then return end pre = pre or '' output(pre..'tolua_constant(tolua_S,"'..self.lname..'",'..self.name..');') end -- Print method function classDefine:print (ident,close) print(ident.."Define{") print(ident.." name = '"..self.name.."',") print(ident.." lname = '"..self.lname.."',") print(ident.."}"..close) end -- Internal constructor function _Define (t) setmetatable(t,classDefine) t:buildnames() if t.name == '' then error("#invalid define") end append(t) return t end -- Constructor -- Expects a string representing the constant name function Define (n) return _Define{ name = n } end conky-1.12.2/3rdparty/toluapp/src/bin/lua/doit.lua000066400000000000000000000034241404127277500217520ustar00rootroot00000000000000-- Generate binding code -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 1998 -- Last update: Apr 2003 -- $Id: $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. function parse_extra() for k,v in ipairs(_extra_parameters or {}) do local b,e,name,value = string.find(v, "^([^=]*)=(.*)$") if b then _extra_parameters[name] = value else _extra_parameters[v] = true end end end function doit () -- define package name, if not provided if not flags.n then if flags.f then flags.n = gsub(flags.f,"%..*$","") _,_,flags.n = string.find(flags.n, "([^/\\]*)$") else error("#no package name nor input file provided") end end -- parse table with extra paramters parse_extra() -- do this after setting the package name if flags['L'] then dofile(flags['L']) end -- add cppstring if not flags['S'] then _basic['string'] = 'cppstring' _basic['std::string'] = 'cppstring' _basic_ctype.cppstring = 'const char*' end -- proccess package local p = Package(flags.n,flags.f) if flags.p then return -- only parse end if flags.o then local st,msg = writeto(flags.o) if not st then error('#'..msg) end end p:decltype() if flags.P then p:print() else push(p) pre_output_hook(p) pop() p:preamble() p:supcode() push(p) pre_register_hook(p) pop() p:register() push(p) post_output_hook(p) pop() end if flags.o then writeto() end -- write header file if not flags.P then if flags.H then local st,msg = writeto(flags.H) if not st then error('#'..msg) end p:header() writeto() end end end conky-1.12.2/3rdparty/toluapp/src/bin/lua/enumerate.lua000066400000000000000000000047361404127277500230070ustar00rootroot00000000000000-- tolua: enumerate class -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 1998 -- $Id: enumerate.lua,v 1.3 2000/01/24 20:41:15 celes Exp $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. -- Enumerate class -- Represents enumeration -- The following fields are stored: -- {i} = list of constant names classEnumerate = { } classEnumerate.__index = classEnumerate setmetatable(classEnumerate,classFeature) -- register enumeration function classEnumerate:register (pre) if not self:check_public_access() then return end pre = pre or '' local nspace = getnamespace(classContainer.curr) local i=1 while self[i] do if self.lnames[i] and self.lnames[i] ~= "" then output(pre..'tolua_constant(tolua_S,"'..self.lnames[i]..'",'..nspace..self[i]..');') end i = i+1 end end -- Print method function classEnumerate:print (ident,close) print(ident.."Enumerate{") print(ident.." name = "..self.name) local i=1 while self[i] do print(ident.." '"..self[i].."'("..self.lnames[i].."),") i = i+1 end print(ident.."}"..close) end -- Internal constructor function _Enumerate (t,varname) setmetatable(t,classEnumerate) append(t) appendenum(t) if varname and varname ~= "" then if t.name ~= "" then Variable(t.name.." "..varname) else local ns = getcurrnamespace() warning("Variable "..ns..varname.." of type is declared as read-only") Variable("tolua_readonly int "..varname) end end local parent = classContainer.curr if parent then t.access = parent.curr_member_access t.global_access = t:check_public_access() end return t end -- Constructor -- Expects a string representing the enumerate body function Enumerate (n,b,varname) b = string.gsub(b, ",[%s\n]*}", "\n}") -- eliminate last ',' local t = split(strsub(b,2,-2),',') -- eliminate braces local i = 1 local e = {n=0} while t[i] do local tt = split(t[i],'=') -- discard initial value e.n = e.n + 1 e[e.n] = tt[1] i = i+1 end -- set lua names i = 1 e.lnames = {} local ns = getcurrnamespace() while e[i] do local t = split(e[i],'@') e[i] = t[1] if not t[2] then t[2] = applyrenaming(t[1]) end e.lnames[i] = t[2] or t[1] _global_enums[ ns..e[i] ] = (ns..e[i]) i = i+1 end e.name = n if n ~= "" then Typedef("int "..n) end return _Enumerate(e, varname) end conky-1.12.2/3rdparty/toluapp/src/bin/lua/feature.lua000066400000000000000000000055031404127277500224460ustar00rootroot00000000000000-- tolua: abstract feature class -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 1998 -- $Id: $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. -- Feature class -- Represents the base class of all mapped feature. classFeature = { } classFeature.__index = classFeature -- write support code function classFeature:supcode () end -- output tag function classFeature:decltype () end -- register feature function classFeature:register (pre) end -- translate verbatim function classFeature:preamble () end -- check if it is a variable function classFeature:isvariable () return false end -- check if it requires collection function classFeature:requirecollection (t) return false end -- build names function classFeature:buildnames () if self.name and self.name~='' then local n = split(self.name,'@') self.name = n[1] self.name = string.gsub(self.name, ":%d*$", "") if not n[2] then n[2] = applyrenaming(n[1]) end self.lname = n[2] or gsub(n[1],"%[.-%]","") self.lname = string.gsub(self.lname, ":%d*$", "") self.original_name = self.name self.lname = clean_template(self.lname) end if not self.is_parameter then self.name = getonlynamespace() .. self.name end local parent = classContainer.curr if parent then self.access = parent.curr_member_access self.global_access = self:check_public_access() else end end function classFeature:check_public_access() if type(self.global_access) == "boolean" then return self.global_access end if self.access and self.access ~= 0 then return false end local parent = classContainer.curr while parent do if parent.access and parent.access ~= 0 then return false end parent = parent.prox end return true end function clean_template(t) return string.gsub(t, "[<>:, %*]", "_") end -- check if feature is inside a container definition -- it returns the container class name or nil. function classFeature:incontainer (which) if self.parent then local parent = self.parent while parent do if parent.classtype == which then return parent.name end parent = parent.parent end end return nil end function classFeature:inclass () return self:incontainer('class') end function classFeature:inmodule () return self:incontainer('module') end function classFeature:innamespace () return self:incontainer('namespace') end -- return C binding function name based on name -- the client specifies a prefix function classFeature:cfuncname (n) if self.parent then n = self.parent:cfuncname(n) end local fname = self.lname if not fname or fname == '' then fname = self.name end n = string.gsub(n..'_'.. (fname), "[<>:, \\.%*&]", "_") return n end conky-1.12.2/3rdparty/toluapp/src/bin/lua/function.lua000066400000000000000000000336561404127277500226520ustar00rootroot00000000000000-- tolua: function class -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 1998 -- $Id: $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. -- Function class -- Represents a function or a class method. -- The following fields are stored: -- mod = type modifiers -- type = type -- ptr = "*" or "&", if representing a pointer or a reference -- name = name -- lname = lua name -- args = list of argument declarations -- const = if it is a method receiving a const "this". classFunction = { mod = '', type = '', ptr = '', name = '', args = {n=0}, const = '', } classFunction.__index = classFunction setmetatable(classFunction,classFeature) -- declare tags function classFunction:decltype () self.type = typevar(self.type) if strfind(self.mod,'const') then self.type = 'const '..self.type self.mod = gsub(self.mod,'const','') end local i=1 while self.args[i] do self.args[i]:decltype() i = i+1 end end -- Write binding function -- Outputs C/C++ binding function. function classFunction:supcode (local_constructor) local overload = strsub(self.cname,-2,-1) - 1 -- indicate overloaded func local nret = 0 -- number of returned values local class = self:inclass() local _,_,static = strfind(self.mod,'^%s*(static)') if class then if self.name == 'new' and self.parent.flags.pure_virtual then -- no constructor for classes with pure virtual methods return end if local_constructor then output("/* method: new_local of class ",class," */") else output("/* method:",self.name," of class ",class," */") end else output("/* function:",self.name," */") end if local_constructor then output("#ifndef TOLUA_DISABLE_"..self.cname.."_local") output("\nstatic int",self.cname.."_local","(lua_State* tolua_S)") else output("#ifndef TOLUA_DISABLE_"..self.cname) output("\nstatic int",self.cname,"(lua_State* tolua_S)") end output("{") -- check types if overload < 0 then output('#ifndef TOLUA_RELEASE\n') end output(' tolua_Error tolua_err;') output(' if (\n') -- check self local narg if class then narg=2 else narg=1 end if class then local func = get_is_function(self.parent.type) local type = self.parent.type if self.name=='new' or static~=nil then func = 'tolua_isusertable' type = self.parent.type end if self.const ~= '' then type = "const "..type end output(' !'..func..'(tolua_S,1,"'..type..'",0,&tolua_err) ||\n') end -- check args if self.args[1].type ~= 'void' then local i=1 while self.args[i] do local btype = isbasic(self.args[i].type) if btype ~= 'value' and btype ~= 'state' then output(' '..self.args[i]:outchecktype(narg)..' ||\n') end if btype ~= 'state' then narg = narg+1 end i = i+1 end end -- check end of list output(' !tolua_isnoobj(tolua_S,'..narg..',&tolua_err)\n )') output(' goto tolua_lerror;') output(' else\n') if overload < 0 then output('#endif\n') end output(' {') -- declare self, if the case local narg if class then narg=2 else narg=1 end if class and self.name~='new' and static==nil then output(' ',self.const,self.parent.type,'*','self = ') output('(',self.const,self.parent.type,'*) ') local to_func = get_to_function(self.parent.type) output(to_func,'(tolua_S,1,0);') elseif static then _,_,self.mod = strfind(self.mod,'^%s*static%s%s*(.*)') end -- declare parameters if self.args[1].type ~= 'void' then local i=1 while self.args[i] do self.args[i]:declare(narg) if isbasic(self.args[i].type) ~= "state" then narg = narg+1 end i = i+1 end end -- check self if class and self.name~='new' and static==nil then output('#ifndef TOLUA_RELEASE\n') output(' if (!self) tolua_error(tolua_S,"'..output_error_hook("invalid \'self\' in function \'%s\'", self.name)..'", NULL);'); output('#endif\n') end -- get array element values if class then narg=2 else narg=1 end if self.args[1].type ~= 'void' then local i=1 while self.args[i] do self.args[i]:getarray(narg) narg = narg+1 i = i+1 end end pre_call_hook(self) local out = string.find(self.mod, "tolua_outside") -- call function if class and self.name=='delete' then output(' Mtolua_delete(self);') elseif class and self.name == 'operator&[]' then if flags['1'] then -- for compatibility with tolua5 ? output(' self->operator[](',self.args[1].name,'-1) = ',self.args[2].name,';') else output(' self->operator[](',self.args[1].name,') = ',self.args[2].name,';') end else output(' {') if self.type ~= '' and self.type ~= 'void' then output(' ',self.mod,self.type,self.ptr,'tolua_ret = ') output('(',self.mod,self.type,self.ptr,') ') else output(' ') end if class and self.name=='new' then output('Mtolua_new((',self.type,')(') elseif class and static then if out then output(self.name,'(') else output(class..'::'..self.name,'(') end elseif class then if out then output(self.name,'(') else if self.cast_operator then --output('static_cast<',self.mod,self.type,self.ptr,' >(*self') output('self->operator ',self.mod,self.type,'(') else output('self->'..self.name,'(') end end else output(self.name,'(') end if out and not static then output('self') if self.args[1] and self.args[1].name ~= '' then output(',') end end -- write parameters local i=1 while self.args[i] do self.args[i]:passpar() i = i+1 if self.args[i] then output(',') end end if class and self.name == 'operator[]' and flags['1'] then output('-1);') else if class and self.name=='new' then output('));') -- close Mtolua_new( else output(');') end end -- return values if self.type ~= '' and self.type ~= 'void' then nret = nret + 1 local t,ct = isbasic(self.type) if t and self.name ~= "new" then if self.cast_operator and _basic_raw_push[t] then output(' ',_basic_raw_push[t],'(tolua_S,(',ct,')tolua_ret);') else output(' tolua_push'..t..'(tolua_S,(',ct,')tolua_ret);') end else t = self.type new_t = string.gsub(t, "const%s+", "") local owned = false if string.find(self.mod, "tolua_owned") then owned = true end local push_func = get_push_function(t) if self.ptr == '' then output(' {') output('#ifdef __cplusplus\n') output(' void* tolua_obj = Mtolua_new((',new_t,')(tolua_ret));') output(' ',push_func,'(tolua_S,tolua_obj,"',t,'");') output(' tolua_register_gc(tolua_S,lua_gettop(tolua_S));') output('#else\n') output(' void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(',t,'));') output(' ',push_func,'(tolua_S,tolua_obj,"',t,'");') output(' tolua_register_gc(tolua_S,lua_gettop(tolua_S));') output('#endif\n') output(' }') elseif self.ptr == '&' then output(' ',push_func,'(tolua_S,(void*)&tolua_ret,"',t,'");') else output(' ',push_func,'(tolua_S,(void*)tolua_ret,"',t,'");') if owned or local_constructor then output(' tolua_register_gc(tolua_S,lua_gettop(tolua_S));') end end end end local i=1 while self.args[i] do nret = nret + self.args[i]:retvalue() i = i+1 end output(' }') -- set array element values if class then narg=2 else narg=1 end if self.args[1].type ~= 'void' then local i=1 while self.args[i] do self.args[i]:setarray(narg) narg = narg+1 i = i+1 end end -- free dynamically allocated array if self.args[1].type ~= 'void' then local i=1 while self.args[i] do self.args[i]:freearray() i = i+1 end end end post_call_hook(self) output(' }') output(' return '..nret..';') -- call overloaded function or generate error if overload < 0 then output('#ifndef TOLUA_RELEASE\n') output('tolua_lerror:\n') output(' tolua_error(tolua_S,"'..output_error_hook("#ferror in function \'%s\'.", self.lname)..'",&tolua_err);') output(' return 0;') output('#endif\n') else local _local = "" if local_constructor then _local = "_local" end output('tolua_lerror:\n') output(' return '..strsub(self.cname,1,-3)..format("%02d",overload).._local..'(tolua_S);') end output('}') output('#endif //#ifndef TOLUA_DISABLE\n') output('\n') -- recursive call to write local constructor if class and self.name=='new' and not local_constructor then self:supcode(1) end end -- register function function classFunction:register (pre) if not self:check_public_access() then return end if self.name == 'new' and self.parent.flags.pure_virtual then -- no constructor for classes with pure virtual methods return end output(pre..'tolua_function(tolua_S,"'..self.lname..'",'..self.cname..');') if self.name == 'new' then output(pre..'tolua_function(tolua_S,"new_local",'..self.cname..'_local);') output(pre..'tolua_function(tolua_S,".call",'..self.cname..'_local);') --output(' tolua_set_call_event(tolua_S,'..self.cname..'_local, "'..self.parent.type..'");') end end -- Print method function classFunction:print (ident,close) print(ident.."Function{") print(ident.." mod = '"..self.mod.."',") print(ident.." type = '"..self.type.."',") print(ident.." ptr = '"..self.ptr.."',") print(ident.." name = '"..self.name.."',") print(ident.." lname = '"..self.lname.."',") print(ident.." const = '"..self.const.."',") print(ident.." cname = '"..self.cname.."',") print(ident.." lname = '"..self.lname.."',") print(ident.." args = {") local i=1 while self.args[i] do self.args[i]:print(ident.." ",",") i = i+1 end print(ident.." }") print(ident.."}"..close) end -- check if it returns an object by value function classFunction:requirecollection (t) local r = false if self.type ~= '' and not isbasic(self.type) and self.ptr=='' then local type = gsub(self.type,"%s*const%s+","") t[type] = "tolua_collect_" .. clean_template(type) r = true end local i=1 while self.args[i] do r = self.args[i]:requirecollection(t) or r i = i+1 end return r end -- determine lua function name overload function classFunction:overload () return self.parent:overload(self.lname) end function param_object(par) -- returns true if the parameter has an object as its default value if not string.find(par, '=') then return false end -- it has no default value local _,_,def = string.find(par, "=(.*)$") if string.find(par, "|") then -- a list of flags return true end if string.find(par, "%*") then -- it's a pointer with a default value if string.find(par, '=%s*new') or string.find(par, "%(") then -- it's a pointer with an instance as default parameter.. is that valid? return true end return false -- default value is 'NULL' or something end if string.find(par, "[%(&]") then return true end -- default value is a constructor call (most likely for a const reference) --if string.find(par, "&") then -- if string.find(def, ":") or string.find(def, "^%s*new%s+") then -- -- it's a reference with default to something like Class::member, or 'new Class' -- return true -- end --end return false -- ? end function strip_last_arg(all_args, last_arg) -- strips the default value from the last argument local _,_,s_arg = string.find(last_arg, "^([^=]+)") last_arg = string.gsub(last_arg, "([%%%(%)])", "%%%1"); all_args = string.gsub(all_args, "%s*,%s*"..last_arg.."%s*%)%s*$", ")") return all_args, s_arg end -- Internal constructor function _Function (t) setmetatable(t,classFunction) if t.const ~= 'const' and t.const ~= '' then error("#invalid 'const' specification") end append(t) if t:inclass() then --print ('t.name is '..t.name..', parent.name is '..t.parent.name) if string.gsub(t.name, "%b<>", "") == string.gsub(t.parent.original_name or t.parent.name, "%b<>", "") then t.name = 'new' t.lname = 'new' t.parent._new = true t.type = t.parent.name t.ptr = '*' elseif string.gsub(t.name, "%b<>", "") == '~'..string.gsub(t.parent.original_name or t.parent.name, "%b<>", "") then t.name = 'delete' t.lname = 'delete' t.parent._delete = true end end t.cname = t:cfuncname("tolua")..t:overload(t) return t end -- Constructor -- Expects three strings: one representing the function declaration, -- another representing the argument list, and the third representing -- the "const" or empty string. function Function (d,a,c) --local t = split(strsub(a,2,-2),',') -- eliminate braces --local t = split_params(strsub(a,2,-2)) if not flags['W'] and string.find(a, "%.%.%.%s*%)") then warning("Functions with variable arguments (`...') are not supported. Ignoring "..d..a..c) return nil end local i=1 local l = {n=0} a = string.gsub(a, "%s*([%(%)])%s*", "%1") local t,strip,last = strip_pars(strsub(a,2,-2)); if strip then --local ns = string.sub(strsub(a,1,-2), 1, -(string.len(last)+1)) local ns = join(t, ",", 1, last-1) ns = "("..string.gsub(ns, "%s*,%s*$", "")..')' --ns = strip_defaults(ns) local f = Function(d, ns, c) for i=1,last do t[i] = string.gsub(t[i], "=.*$", "") end end while t[i] do l.n = l.n+1 l[l.n] = Declaration(t[i],'var',true) i = i+1 end local f = Declaration(d,'func') f.args = l f.const = c return _Function(f) end function join(t, sep, first, last) first = first or 1 last = last or #t local lsep = "" local ret = "" local loop = false for i = first,last do ret = ret..lsep..t[i] lsep = sep loop = true end if not loop then return "" end return ret end function strip_pars(s) local t = split_c_tokens(s, ',') local strip = false local last for i=t.n,1,-1 do if not strip and param_object(t[i]) then last = i strip = true end --if strip then -- t[i] = string.gsub(t[i], "=.*$", "") --end end return t,strip,last end function strip_defaults(s) s = string.gsub(s, "^%(", "") s = string.gsub(s, "%)$", "") local t = split_c_tokens(s, ",") local sep, ret = "","" for i=1,t.n do t[i] = string.gsub(t[i], "=.*$", "") ret = ret..sep..t[i] sep = "," end return "("..ret..")" end conky-1.12.2/3rdparty/toluapp/src/bin/lua/module.lua000066400000000000000000000027071404127277500223030ustar00rootroot00000000000000-- tolua: module class -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 1998 -- $Id: $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. -- Module class -- Represents module. -- The following fields are stored: -- {i} = list of objects in the module. classModule = { classtype = 'module' } classModule.__index = classModule setmetatable(classModule,classContainer) -- register module function classModule:register (pre) pre = pre or '' push(self) output(pre..'tolua_module(tolua_S,"'..self.name..'",',self:hasvar(),');') output(pre..'tolua_beginmodule(tolua_S,"'..self.name..'");') local i=1 while self[i] do self[i]:register(pre..' ') i = i+1 end output(pre..'tolua_endmodule(tolua_S);') pop() end -- Print method function classModule:print (ident,close) print(ident.."Module{") print(ident.." name = '"..self.name.."';") local i=1 while self[i] do self[i]:print(ident.." ",",") i = i+1 end print(ident.."}"..close) end -- Internal constructor function _Module (t) setmetatable(t,classModule) append(t) return t end -- Constructor -- Expects two string representing the module name and body. function Module (n,b) local t = _Module(_Container{name=n}) push(t) t:parse(strsub(b,2,strlen(b)-1)) -- eliminate braces pop() return t end conky-1.12.2/3rdparty/toluapp/src/bin/lua/namespace.lua000066400000000000000000000022341404127277500227450ustar00rootroot00000000000000-- tolua: namespace class -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 2003 -- $Id: $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. -- Namespace class -- Represents a namesapce definition. -- Stores the following fields: -- name = class name -- {i} = list of members classNamespace = { classtype = 'namespace', name = '', } classNamespace.__index = classNamespace setmetatable(classNamespace,classModule) -- Print method function classNamespace:print (ident,close) print(ident.."Namespace{") print(ident.." name = '"..self.name.."',") local i=1 while self[i] do self[i]:print(ident.." ",",") i = i+1 end print(ident.."}"..close) end -- Internal constructor function _Namespace (t) setmetatable(t,classNamespace) append(t) return t end -- Constructor -- Expects the name and the body of the namespace. function Namespace (n,b) local c = _Namespace(_Container{name=n}) push(c) c:parse(strsub(b,2,strlen(b)-1)) -- eliminate braces pop() end conky-1.12.2/3rdparty/toluapp/src/bin/lua/operator.lua000066400000000000000000000136331404127277500226510ustar00rootroot00000000000000-- tolua: operator class -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 1998 -- $Id: $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. -- Operator class -- Represents an operator function or a class operator method. -- It stores the same fields as functions do plus: -- kind = set of character representing the operator (as it appers in C++ code) classOperator = { kind = '', } classOperator.__index = classOperator setmetatable(classOperator,classFunction) -- table to transform operator kind into the appropriate tag method name _TM = {['+'] = 'add', ['-'] = 'sub', ['*'] = 'mul', ['/'] = 'div', ['<'] = 'lt', ['<='] = 'le', ['=='] = 'eq', ['[]'] = 'geti', ['&[]'] = 'seti', --['->'] = 'flechita', } -- Print method function classOperator:print (ident,close) print(ident.."Operator{") print(ident.." kind = '"..self.kind.."',") print(ident.." mod = '"..self.mod.."',") print(ident.." type = '"..self.type.."',") print(ident.." ptr = '"..self.ptr.."',") print(ident.." name = '"..self.name.."',") print(ident.." const = '"..self.const.."',") print(ident.." cname = '"..self.cname.."',") print(ident.." lname = '"..self.lname.."',") print(ident.." args = {") local i=1 while self.args[i] do self.args[i]:print(ident.." ",",") i = i+1 end print(ident.." }") print(ident.."}"..close) end function classOperator:supcode_tmp() if not _TM[self.kind] then return classFunction.supcode(self) end -- no overload, no parameters, always inclass output("/* method:",self.name," of class ",self:inclass()," */") output("#ifndef TOLUA_DISABLE_"..self.cname) output("\nstatic int",self.cname,"(lua_State* tolua_S)") if overload < 0 then output('#ifndef TOLUA_RELEASE\n') end output(' tolua_Error tolua_err;') output(' if (\n') -- check self local is_func = get_is_function(self.parent.type) output(' !'..is_func..'(tolua_S,1,"'..self.parent.type..'",0,&tolua_err) ||\n') output(' !tolua_isnoobj(tolua_S,2,&tolua_err)\n )') output(' goto tolua_lerror;') output(' else\n') output('#endif\n') -- tolua_release output(' {') -- declare self output(' ',self.const,self.parent.type,'*','self = ') output('(',self.const,self.parent.type,'*) ') local to_func = get_to_func(self.parent.type) output(to_func,'(tolua_S,1,0);') -- check self output('#ifndef TOLUA_RELEASE\n') output(' if (!self) tolua_error(tolua_S,"'..output_error_hook("invalid \'self\' in function \'%s\'", self.name)..'",NULL);'); output('#endif\n') -- cast self output(' ',self.mod,self.type,self.ptr,'tolua_ret = ') output('(',self.mod,self.type,self.ptr,')(*self);') -- return value local t,ct = isbasic(self.type) if t then output(' tolua_push'..t..'(tolua_S,(',ct,')tolua_ret);') else t = self.type local push_func = get_push_function(t) new_t = string.gsub(t, "const%s+", "") if self.ptr == '' then output(' {') output('#ifdef __cplusplus\n') output(' void* tolua_obj = Mtolua_new((',new_t,')(tolua_ret));') output(' ',push_func,'(tolua_S,tolua_obj,"',t,'");') output(' tolua_register_gc(tolua_S,lua_gettop(tolua_S));') output('#else\n') output(' void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(',t,'));') output(' ',push_func,'(tolua_S,tolua_obj,"',t,'");') output(' tolua_register_gc(tolua_S,lua_gettop(tolua_S));') output('#endif\n') output(' }') elseif self.ptr == '&' then output(' ',push_func,'(tolua_S,(void*)&tolua_ret,"',t,'");') else if local_constructor then output(' ',push_func,'(tolua_S,(void *)tolua_ret,"',t,'");') output(' tolua_register_gc(tolua_S,lua_gettop(tolua_S));') else output(' ',push_func,'(tolua_S,(void*)tolua_ret,"',t,'");') end end end output(' }') output(' return 1;') output('#ifndef TOLUA_RELEASE\n') output('tolua_lerror:\n') output(' tolua_error(tolua_S,"'..output_error_hook("#ferror in function \'%s\'.", self.lname)..'",&tolua_err);') output(' return 0;') output('#endif\n') output('}') output('#endif //#ifndef TOLUA_DISABLE\n') output('\n') end -- Internal constructor function _Operator (t) setmetatable(t,classOperator) if t.const ~= 'const' and t.const ~= '' then error("#invalid 'const' specification") end append(t) if not t:inclass() then error("#operator can only be defined as class member") end --t.name = t.name .. "_" .. (_TM[t.kind] or t.kind) t.cname = t:cfuncname("tolua")..t:overload(t) t.name = "operator" .. t.kind -- set appropriate calling name return t end -- Constructor function Operator (d,k,a,c) local op_k = string.gsub(k, "^%s*", "") op_k = string.gsub(k, "%s*$", "") --if string.find(k, "^[%w_:%d<>%*%&]+$") then if d == "operator" and k ~= '' then d = k.." operator" elseif not _TM[op_k] then if flags['W'] then error("tolua: no support for operator" .. f.kind) else warning("No support for operator "..op_k..", ignoring") return nil end end local ref = '' local t = split_c_tokens(strsub(a,2,strlen(a)-1),',') -- eliminate braces local i=1 local l = {n=0} while t[i] do l.n = l.n+1 l[l.n] = Declaration(t[i],'var') i = i+1 end if k == '[]' then local _ _, _, ref = strfind(d,'(&)') d = gsub(d,'&','') elseif k=='&[]' then l.n = l.n+1 l[l.n] = Declaration(d,'var') l[l.n].name = 'tolua_value' end local f = Declaration(d,'func') if k == '[]' and (l[1]==nil or isbasic(l[1].type)~='number') then error('operator[] can only be defined for numeric index.') end f.args = l f.const = c f.kind = op_k f.lname = "."..(_TM[f.kind] or f.kind) if not _TM[f.kind] then f.cast_operator = true end if f.kind == '[]' and ref=='&' and f.const~='const' then Operator(d,'&'..k,a,c) -- create correspoding set operator end return _Operator(f) end conky-1.12.2/3rdparty/toluapp/src/bin/lua/package.lua000066400000000000000000000246101404127277500224060ustar00rootroot00000000000000-- tolua: package class -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 1998 -- $Id: $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. -- Package class -- Represents the whole package being bound. -- The following fields are stored: -- {i} = list of objects in the package. classPackage = { classtype = 'package' } classPackage.__index = classPackage setmetatable(classPackage,classContainer) -- Print method function classPackage:print () print("Package: "..self.name) local i=1 while self[i] do self[i]:print("","") i = i+1 end end function classPackage:preprocess () -- avoid preprocessing embedded Lua code local L = {} self.code = gsub(self.code,"\n%s*%$%[","\1") -- deal with embedded lua code self.code = gsub(self.code,"\n%s*%$%]","\2") self.code = gsub(self.code,"(%b\1\2)", function (c) tinsert(L,c) return "\n#[".. #L .."]#" end) -- avoid preprocessing embedded C code local C = {} self.code = gsub(self.code,"\n%s*%$%<","\3") -- deal with embedded C code self.code = gsub(self.code,"\n%s*%$%>","\4") self.code = gsub(self.code,"(%b\3\4)", function (c) tinsert(C,c) return "\n#<".. #C ..">#" end) -- avoid preprocessing embedded C code self.code = gsub(self.code,"\n%s*%$%{","\5") -- deal with embedded C code self.code = gsub(self.code,"\n%s*%$%}","\6") self.code = gsub(self.code,"(%b\5\6)", function (c) tinsert(C,c) return "\n#<".. #C..">#" end) --self.code = gsub(self.code,"\n%s*#[^d][^\n]*\n", "\n\n") -- eliminate preprocessor directives that don't start with 'd' self.code = gsub(self.code,"\n[ \t]*#[ \t]*[^d%<%[]", "\n//") -- eliminate preprocessor directives that don't start with 'd' -- avoid preprocessing verbatim lines local V = {} self.code = gsub(self.code,"\n(%s*%$[^%[%]][^\n]*)",function (v) tinsert(V,v) return "\n#".. #V .."#" end) -- perform global substitution self.code = gsub(self.code,"(//[^\n]*)","") -- eliminate C++ comments self.code = gsub(self.code,"/%*","\1") self.code = gsub(self.code,"%*/","\2") self.code = gsub(self.code,"%b\1\2","") self.code = gsub(self.code,"\1","/%*") self.code = gsub(self.code,"\2","%*/") self.code = gsub(self.code,"%s*@%s*","@") -- eliminate spaces beside @ self.code = gsub(self.code,"%s?inline(%s)","%1") -- eliminate 'inline' keyword --self.code = gsub(self.code,"%s?extern(%s)","%1") -- eliminate 'extern' keyword --self.code = gsub(self.code,"%s?virtual(%s)","%1") -- eliminate 'virtual' keyword --self.code = gsub(self.code,"public:","") -- eliminate 'public:' keyword self.code = gsub(self.code,"([^%w_])void%s*%*","%1_userdata ") -- substitute 'void*' self.code = gsub(self.code,"([^%w_])void%s*%*","%1_userdata ") -- substitute 'void*' self.code = gsub(self.code,"([^%w_])char%s*%*","%1_cstring ") -- substitute 'char*' self.code = gsub(self.code,"([^%w_])lua_State%s*%*","%1_lstate ") -- substitute 'lua_State*' -- restore embedded Lua code self.code = gsub(self.code,"%#%[(%d+)%]%#",function (n) return L[tonumber(n)] end) -- restore embedded C code self.code = gsub(self.code,"%#%<(%d+)%>%#",function (n) return C[tonumber(n)] end) -- restore verbatim lines self.code = gsub(self.code,"%#(%d+)%#",function (n) return V[tonumber(n)] end) self.code = string.gsub(self.code, "\n%s*%$([^\n]+)", function (l) Verbatim(l.."\n") return "\n" end) end -- translate verbatim function classPackage:preamble () output('/*\n') output('** Lua binding: '..self.name..'\n') output('** Generated automatically by '..TOLUA_VERSION..' on '..date()..'.\n') output('*/\n\n') output('#ifndef __cplusplus\n') output('#include "stdlib.h"\n') output('#endif\n') output('#include "string.h"\n\n') output('#include "tolua++.h"\n\n') if not flags.h then output('/* Exported function */') output('TOLUA_API int tolua_'..self.name..'_open (lua_State* tolua_S);') output('\n') end local i=1 while self[i] do self[i]:preamble() i = i+1 end if self:requirecollection(_collect) then output('\n') output('/* function to release collected object via destructor */') output('#ifdef __cplusplus\n') for i,v in pairs(_collect) do output('\nstatic int '..v..' (lua_State* tolua_S)') output('{') output(' '..i..'* self = ('..i..'*) tolua_tousertype(tolua_S,1,0);') output(' Mtolua_delete(self);') output(' return 0;') output('}') end output('#endif\n\n') end output('\n') output('/* function to register type */') output('static void tolua_reg_types (lua_State* tolua_S)') output('{') if flags.t then output("#ifndef Mtolua_typeid\n#define Mtolua_typeid(L,TI,T)\n#endif\n") end for n,v in pairs(_usertype) do if (not _global_classes[v]) or _global_classes[v]:check_public_access() then output(' tolua_usertype(tolua_S,"',v,'");') if flags.t then output(' Mtolua_typeid(tolua_S,typeid(',v,'), "',v,'");') end end end output('}') output('\n') end -- register package -- write package open function function classPackage:register (pre) pre = pre or '' push(self) output(pre.."/* Open function */") output(pre.."TOLUA_API int tolua_"..self.name.."_open (lua_State* tolua_S)") output(pre.."{") output(pre.." tolua_open(tolua_S);") output(pre.." tolua_reg_types(tolua_S);") output(pre.." tolua_module(tolua_S,NULL,",self:hasvar(),");") output(pre.." tolua_beginmodule(tolua_S,NULL);") local i=1 while self[i] do self[i]:register(pre.." ") i = i+1 end output(pre.." tolua_endmodule(tolua_S);") output(pre.." return 1;") output(pre.."}") output("\n\n") output("#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501\n"); output(pre.."TOLUA_API int luaopen_"..self.name.." (lua_State* tolua_S) {") output(pre.." return tolua_"..self.name.."_open(tolua_S);") output(pre.."}") output("#endif\n\n") pop() end -- write header file function classPackage:header () output('/*\n') output('** Lua binding: '..self.name..'\n') output('** Generated automatically by '..TOLUA_VERSION..' on '..date()..'.\n') output('*/\n\n') if not flags.h then output('/* Exported function */') output('TOLUA_API int tolua_'..self.name..'_open (lua_State* tolua_S);') output('\n') end end -- Internal constructor function _Package (self) setmetatable(self,classPackage) return self end -- Parse C header file with tolua directives -- *** Thanks to Ariel Manzur for fixing bugs in nested directives *** function extract_code(fn,s) local code = '\n$#include "'..fn..'"\n' s= "\n" .. s .. "\n" -- add blank lines as sentinels local _,e,c,t = strfind(s, "\n([^\n]-)[Tt][Oo][Ll][Uu][Aa]_([^%s]*)[^\n]*\n") while e do t = strlower(t) if t == "begin" then _,e,c = strfind(s,"(.-)\n[^\n]*[Tt][Oo][Ll][Uu][Aa]_[Ee][Nn][Dd][^\n]*\n",e) if not e then tolua_error("Unbalanced 'tolua_begin' directive in header file") end end code = code .. c .. "\n" _,e,c,t = strfind(s, "\n([^\n]-)[Tt][Oo][Ll][Uu][Aa]_([^%s]*)[^\n]*\n",e) end return code end -- Constructor -- Expects the package name, the file extension, and the file text. function Package (name,fn) local ext = "pkg" -- open input file, if any local st,msg if fn then st, msg = readfrom(flags.f) if not st then error('#'..msg) end local _; _, _, ext = strfind(fn,".*%.(.*)$") end local code if ext == 'pkg' then code = prep(st) else code = "\n" .. read('*a') if ext == 'h' or ext == 'hpp' then code = extract_code(fn,code) end end -- close file if fn then readfrom() end -- deal with include directive local nsubst repeat code,nsubst = gsub(code,'\n%s*%$(.)file%s*"(.-)"([^\n]*)\n', function (kind,fn,extra) local _, _, ext = strfind(fn,".*%.(.*)$") local fp,msg = openfile(fn,'r') if not fp then error('#'..msg..': '..fn) end if kind == 'p' then local s = prep(fp) closefile(fp) return s end local s = read(fp,'*a') closefile(fp) if kind == 'c' or kind == 'h' then return extract_code(fn,s) elseif kind == 'l' then return "\n$[--##"..fn.."\n" .. s .. "\n$]\n" elseif kind == 'i' then local t = {code=s} extra = string.gsub(extra, "^%s*,%s*", "") local pars = split_c_tokens(extra, ",") include_file_hook(t, fn, table.unpack(pars)) return "\n\n" .. t.code else error('#Invalid include directive (use $cfile, $pfile, $lfile or $ifile)') end end) until nsubst==0 -- deal with renaming directive repeat -- I don't know why this is necesary code,nsubst = gsub(code,'\n%s*%$renaming%s*(.-)%s*\n', function (r) appendrenaming(r) return "\n" end) until nsubst == 0 local t = _Package(_Container{name=name, code=code}) push(t) preprocess_hook(t) t:preprocess() preparse_hook(t) t:parse(t.code) pop() return t end setmetatable(_extra_parameters, { __index = _G }) function prep(file) local chunk = {'local __ret = {"\\n"}\n'} for line in file:lines() do if string.find(line, "^##") then table.insert(chunk, string.sub(line, 3) .. "\n") else local last = 1 for text, expr, index in string.gmatch(line, "(.-)$(%b())()") do last = index if text ~= "" then table.insert(chunk, string.format('table.insert(__ret, %q )', text)) end table.insert(chunk, string.format('table.insert(__ret, %s )', expr)) end table.insert(chunk, string.format('table.insert(__ret, %q)\n', string.sub(line, last).."\n")) end end table.insert(chunk, '\nreturn table.concat(__ret)\n') local f,e = load(table.concat(chunk), nil, "t", _extra_parameters) if e then error("#"..e) end return f() end conky-1.12.2/3rdparty/toluapp/src/bin/lua/template_class.lua000066400000000000000000000033561404127277500240170ustar00rootroot00000000000000 _global_templates = {} classTemplateClass = { name = '', body = '', parents = {}, args = {}, -- the template arguments } classTemplateClass.__index = classTemplateClass function classTemplateClass:throw(types, local_scope) --if table.getn(types) ~= table.getn(self.args) then -- error("#invalid parameter count") --end -- replace for i =1 , types.n do local Il = split_c_tokens(types[i], " ") if #Il ~= #self.args then error("#invalid parameter count for "..types[i]) end local bI = self.body local pI = {} for j = 1,self.args.n do --Tl[j] = findtype(Tl[j]) or Tl[j] bI = string.gsub(bI, "([^_%w])"..self.args[j].."([^_%w])", "%1"..Il[j].."%2") if self.parents then for i=1,#self.parents do pI[i] = string.gsub(self.parents[i], "([^_%w]?)"..self.args[j].."([^_%w]?)", "%1"..Il[j].."%2") end end end --local append = "<"..string.gsub(types[i], "%s+", ",")..">" local append = "<"..concat(Il, 1, #Il, ",")..">" append = string.gsub(append, "%s*,%s*", ",") append = string.gsub(append, ">>", "> >") for i=1,#pI do --pI[i] = string.gsub(pI[i], ">>", "> >") pI[i] = resolve_template_types(pI[i]) end bI = string.gsub(bI, ">>", "> >") local n = self.name if local_scope then n = self.local_name end Class(n..append, pI, bI) end end function TemplateClass(name, parents, body, parameters) local o = { parents = parents, body = body, args = parameters, } local oname = string.gsub(name, "@.*$", "") oname = getnamespace(classContainer.curr)..oname o.name = oname o.local_name = name setmetatable(o, classTemplateClass) if _global_templates[oname] then warning("Duplicate declaration of template "..oname) else _global_templates[oname] = o end return o end conky-1.12.2/3rdparty/toluapp/src/bin/lua/typedef.lua000066400000000000000000000032401404127277500224470ustar00rootroot00000000000000-- tolua: typedef class -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 1998 -- $Id: $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. -- Typedef class -- Represents a type synonym. -- The 'de facto' type replaces the typedef before the -- remaining code is parsed. -- The following fields are stored: -- utype = typedef name -- type = 'the facto' type -- mod = modifiers to the 'de facto' type classTypedef = { utype = '', mod = '', type = '' } classTypedef.__index = classTypedef -- Print method function classTypedef:print (ident,close) print(ident.."Typedef{") print(ident.." utype = '"..self.utype.."',") print(ident.." mod = '"..self.mod.."',") print(ident.." type = '"..self.type.."',") print(ident.."}"..close) end -- Return it's not a variable function classTypedef:isvariable () return false end -- Internal constructor function _Typedef (t) setmetatable(t,classTypedef) t.type = resolve_template_types(t.type) appendtypedef(t) return t end -- Constructor -- Expects one string representing the type definition. function Typedef (s) if strfind(string.gsub(s, '%b<>', ''),'[%*&]') then tolua_error("#invalid typedef: pointers (and references) are not supported") end local o = {mod = ''} if string.find(s, "[<>]") then _,_,o.type,o.utype = string.find(s, "^%s*([^<>]+%b<>[^%s]*)%s+(.-)$") else local t = split(gsub(s,"%s%s*"," ")," ") o = { utype = t[t.n], type = t[t.n-1], mod = concat(t,1,t.n-2), } end return _Typedef(o) end conky-1.12.2/3rdparty/toluapp/src/bin/lua/variable.lua000066400000000000000000000176051404127277500226060ustar00rootroot00000000000000-- tolua: variable class -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 1998 -- $Id: $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. -- Variable class -- Represents a extern variable or a public member of a class. -- Stores all fields present in a declaration. classVariable = { _get = {}, -- mapped get functions _set = {}, -- mapped set functions } classVariable.__index = classVariable setmetatable(classVariable,classDeclaration) -- Print method function classVariable:print (ident,close) print(ident.."Variable{") print(ident.." mod = '"..self.mod.."',") print(ident.." type = '"..self.type.."',") print(ident.." ptr = '"..self.ptr.."',") print(ident.." name = '"..self.name.."',") if self.dim then print(ident.." dim = '"..self.dim.."',") end print(ident.." def = '"..self.def.."',") print(ident.." ret = '"..self.ret.."',") print(ident.."}"..close) end -- Generates C function name function classVariable:cfuncname (prefix) local parent = "" local unsigned = "" local ptr = "" local p = self:inmodule() or self:innamespace() or self:inclass() if p then if self.parent.classtype == 'class' then parent = "_" .. self.parent.type else parent = "_" .. p end end if strfind(self.mod,"(unsigned)") then unsigned = "_unsigned" end if self.ptr == "*" then ptr = "_ptr" elseif self.ptr == "&" then ptr = "_ref" end local name = prefix .. parent .. unsigned .. "_" .. gsub(self.lname or self.name,".*::","") .. ptr name = clean_template(name) return name end -- check if it is a variable function classVariable:isvariable () return true end -- get variable value function classVariable:getvalue (class,static, prop_get) local name if prop_get then name = prop_get.."()" else name = self.name end if class and static then return self.parent.type..'::'..name elseif class then return 'self->'..name else return name end end -- get variable pointer value function classVariable:getpointervalue (class,static) if class and static then return class..'::p' elseif class then return 'self->p' else return 'p' end end -- Write binding functions function classVariable:supcode () local class = self:inclass() local prop_get,prop_set if string.find(self.mod, 'tolua_property') then local _,_,type = string.find(self.mod, "tolua_property__([^%s]*)") type = type or "default" prop_get,prop_set = get_property_methods(type, self.name) self.mod = string.gsub(self.mod, "tolua_property[^%s]*", "") end -- get function ------------------------------------------------ if class then output("/* get function:",self.name," of class ",class," */") else output("/* get function:",self.name," */") end self.cgetname = self:cfuncname("tolua_get") output("#ifndef TOLUA_DISABLE_"..self.cgetname) output("\nstatic int",self.cgetname,"(lua_State* tolua_S)") output("{") -- declare self, if the case local _,_,static = strfind(self.mod,'^%s*(static)') if class and static==nil then output(' ',self.parent.type,'*','self = ') output('(',self.parent.type,'*) ') local to_func = get_to_function(self.parent.type) output(to_func,'(tolua_S,1,0);') elseif static then _,_,self.mod = strfind(self.mod,'^%s*static%s%s*(.*)') end -- check self value if class and static==nil then output('#ifndef TOLUA_RELEASE\n') output(' if (!self) tolua_error(tolua_S,"'..output_error_hook("invalid \'self\' in accessing variable \'%s\'", self.name)..'",NULL);'); output('#endif\n') end -- return value if string.find(self.mod, 'tolua_inherits') then local push_func = get_push_function(self.type) output('#ifdef __cplusplus\n') output(' ',push_func,'(tolua_S,(void*)static_cast<'..self.type..'*>(self), "',self.type,'");') output('#else\n') output(' ',push_func,'(tolua_S,(void*)(('..self.type..'*)self), "',self.type,'");') output('#endif\n') else local t,ct = isbasic(self.type) if t then output(' tolua_push'..t..'(tolua_S,(',ct,')'..self:getvalue(class,static,prop_get)..');') else local push_func = get_push_function(self.type) t = self.type if self.ptr == '&' or self.ptr == '' then output(' ',push_func,'(tolua_S,(void*)&'..self:getvalue(class,static,prop_get)..',"',t,'");') else output(' ',push_func,'(tolua_S,(void*)'..self:getvalue(class,static,prop_get)..',"',t,'");') end end end output(' return 1;') output('}') output('#endif //#ifndef TOLUA_DISABLE\n') output('\n') -- set function ------------------------------------------------ if not (strfind(self.type,'const%s+') or string.find(self.mod, 'tolua_readonly') or string.find(self.mod, 'tolua_inherits')) then if class then output("/* set function:",self.name," of class ",class," */") else output("/* set function:",self.name," */") end self.csetname = self:cfuncname("tolua_set") output("#ifndef TOLUA_DISABLE_"..self.csetname) output("\nstatic int",self.csetname,"(lua_State* tolua_S)") output("{") -- declare self, if the case if class and static==nil then output(' ',self.parent.type,'*','self = ') output('(',self.parent.type,'*) ') local to_func = get_to_function(self.parent.type) output(to_func,'(tolua_S,1,0);') -- check self value end -- check types output('#ifndef TOLUA_RELEASE\n') output(' tolua_Error tolua_err;') if class and static==nil then output(' if (!self) tolua_error(tolua_S,"'..output_error_hook("invalid \'self\' in accessing variable \'%s\'", self.name)..'",NULL);'); elseif static then _,_,self.mod = strfind(self.mod,'^%s*static%s%s*(.*)') end -- check variable type output(' if ('..self:outchecktype(2)..')') output(' tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);') output('#endif\n') -- assign value local def = 0 if self.def ~= '' then def = self.def end if self.type == 'char*' and self.dim ~= '' then -- is string output(' strncpy((char*)') if class and static then output(self.parent.type..'::'..self.name) elseif class then output('self->'..self.name) else output(self.name) end output(',(const char*)tolua_tostring(tolua_S,2,',def,'),',self.dim,'-1);') else local ptr = '' if self.ptr~='' then ptr = '*' end output(' ') local name = prop_set or self.name if class and static then output(self.parent.type..'::'..name) elseif class then output('self->'..name) else output(name) end local t = isbasic(self.type) if prop_set then output('(') else output(' = ') end if not t and ptr=='' then output('*') end output('((',self.mod,self.type) if not t then output('*') end output(') ') if t then if isenum(self.type) then output('(int) ') end output('tolua_to'..t,'(tolua_S,2,',def,'))') else local to_func = get_to_function(self.type) output(to_func,'(tolua_S,2,',def,'))') end if prop_set then output(")") end output(";") end output(' return 0;') output('}') output('#endif //#ifndef TOLUA_DISABLE\n') output('\n') end end function classVariable:register (pre) if not self:check_public_access() then return end pre = pre or '' local parent = self:inmodule() or self:innamespace() or self:inclass() if not parent then if classVariable._warning==nil then warning("Mapping variable to global may degrade performance") classVariable._warning = 1 end end if self.csetname then output(pre..'tolua_variable(tolua_S,"'..self.lname..'",'..self.cgetname..','..self.csetname..');') else output(pre..'tolua_variable(tolua_S,"'..self.lname..'",'..self.cgetname..',NULL);') end end -- Internal constructor function _Variable (t) setmetatable(t,classVariable) append(t) return t end -- Constructor -- Expects a string representing the variable declaration. function Variable (s) return _Variable (Declaration(s,'var')) end conky-1.12.2/3rdparty/toluapp/src/bin/lua/verbatim.lua000066400000000000000000000032031404127277500226170ustar00rootroot00000000000000-- tolua: verbatim class -- Written by Waldemar Celes -- TeCGraf/PUC-Rio -- Jul 1998 -- $Id: verbatim.lua,v 1.3 2000/01/24 20:41:16 celes Exp $ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, -- enhancements, or modifications. -- Verbatim class -- Represents a line translated directed to the binding file. -- The following filds are stored: -- line = line text classVerbatim = { line = '', cond = nil, -- condition: where to generate the code (s=suport, r=register) } classVerbatim.__index = classVerbatim setmetatable(classVerbatim,classFeature) -- preamble verbatim function classVerbatim:preamble () if self.cond == '' then write(self.line) end end -- support code function classVerbatim:supcode () if strfind(self.cond,'s') then write(self.line) write('\n') end end -- register code function classVerbatim:register (pre) if strfind(self.cond,'r') then write(self.line) end end -- Print method function classVerbatim:print (ident,close) print(ident.."Verbatim{") print(ident.." line = '"..self.line.."',") print(ident.."}"..close) end -- Internal constructor function _Verbatim (t) setmetatable(t,classVerbatim) append(t) return t end -- Constructor -- Expects a string representing the text line function Verbatim (l,cond) if strsub(l,1,1) == "'" then l = strsub(l,2) elseif strsub(l,1,1) == '$' then cond = 'sr' -- generates in both suport and register fragments l = strsub(l,2) end return _Verbatim { line = l, cond = cond or '', } end conky-1.12.2/3rdparty/toluapp/src/bin/tolua.c000066400000000000000000000127611404127277500210230ustar00rootroot00000000000000/* tolua ** Support code for Lua bindings. ** Written by Waldemar Celes ** TeCGraf/PUC-Rio ** Aug 2003 ** $Id:$ */ /* This code is free software; you can redistribute it and/or modify it. ** The software provided hereunder is on an "as is" basis, and ** the author has no obligation to provide maintenance, support, updates, ** enhancements, or modifications. */ #include "tolua++.h" #include "lauxlib.h" #include "lua.h" #include "lualib.h" #include #include #include static void help(void) { fprintf( stderr, "\n" "usage: tolua++ [options] input_file\n" "\n" "Command line options are:\n" " -v : print version information.\n" " -o file : set output file; default is stdout.\n" " -H file : create include file.\n" " -n name : set package name; default is input file root name.\n" " -p : parse only.\n" " -P : parse and print structure information (for debug).\n" " -S : disable support for c++ strings.\n" " -1 : substract 1 to operator[] index (for compatibility with " "tolua5).\n" " -L file : run lua file (with dofile()) before doing anything.\n" " -D : disable automatic exporting of destructors for classes " "that have\n" " constructors (for compatibility with tolua5)\n" " -W : disable warnings for unsupported features (for " "compatibility\n" " with tolua5)\n" " -C : disable cleanup of included lua code (for easier " "debugging)\n" " -E value[=value] : add extra values to the luastate\n" " -t : export a list of types asociates with the C++ typeid name\n" " -q : don't print warnings to the console\n" " -h : print this message.\n" "Should the input file be omitted, stdin is assumed;\n" "in that case, the package name must be explicitly set.\n\n"); } static void version(void) { fprintf(stderr, "%s (written by W. Celes, A. Manzur)\n", TOLUA_VERSION); } static void setfield(lua_State *L, int table, const char *f, const char *v) { lua_pushstring(L, f); lua_pushstring(L, v); lua_settable(L, table); } static void add_extra(lua_State *L, const char *value) { int len; lua_getglobal(L, "_extra_parameters"); #if LUA_VERSION_NUM > 501 len = lua_rawlen(L, -1); #else len = luaL_getn(L, -1); #endif lua_pushstring(L, value); lua_rawseti(L, -2, len + 1); lua_pop(L, 1); } static void error(char *o) __attribute__((noreturn)); static void error(char *o) { fprintf(stderr, "tolua: unknown option '%s'\n", o); help(); exit(1); } int main(int argc, char *argv[]) { #ifdef LUA_VERSION_NUM /* lua 5.1 */ lua_State *L = luaL_newstate(); luaL_openlibs(L); #else lua_State *L = lua_open(); luaopen_base(L); luaopen_io(L); luaopen_string(L); luaopen_table(L); luaopen_math(L); luaopen_debug(L); #endif lua_pushstring(L, TOLUA_VERSION); lua_setglobal(L, "TOLUA_VERSION"); lua_pushstring(L, LUA_VERSION); lua_setglobal(L, "TOLUA_LUA_VERSION"); if (argc == 1) { help(); return 0; } else { int i, t; lua_newtable(L); lua_setglobal(L, "_extra_parameters"); lua_newtable(L); lua_pushvalue(L, -1); lua_setglobal(L, "flags"); t = lua_gettop(L); // Ignore the last arg in the arg list. for (i = 1; i < argc - 1; ++i) { if (*argv[i] == '-') { switch (argv[i][1]) { case 'v': version(); return 0; case 'h': help(); return 0; case 'p': setfield(L, t, "p", ""); break; case 'P': setfield(L, t, "P", ""); break; case 'o': setfield(L, t, "o", argv[++i]); break; case 'n': setfield(L, t, "n", argv[++i]); break; case 'H': setfield(L, t, "H", argv[++i]); break; case 'S': setfield(L, t, "S", ""); break; case '1': setfield(L, t, "1", ""); break; case 'L': setfield(L, t, "L", argv[++i]); break; case 'D': setfield(L, t, "D", ""); break; case 'W': setfield(L, t, "W", ""); break; case 'C': setfield(L, t, "C", ""); break; case 'E': add_extra(L, argv[++i]); break; case 't': setfield(L, t, "t", ""); break; case 'q': setfield(L, t, "q", ""); break; default: error(argv[i]); break; } } else { setfield(L, t, "f", argv[i]); break; } } lua_pop(L, 1); } #define TOLUA_SCRIPT_RUN #ifndef TOLUA_SCRIPT_RUN { int tolua_tolua_open(lua_State * L); tolua_tolua_open(L); } #else { // Take the path to the Lua sources from the last arg. char *pkg_path = argv[argc - 1]; char full_path[1024]; strcpy(full_path, pkg_path); strcat(full_path, "all.lua"); lua_pushstring(L, pkg_path); lua_setglobal(L, "path"); if (luaL_loadfile(L, full_path) != 0) { fprintf(stderr, "luaL_loadfile failed\n"); return 1; } if (lua_pcall(L, 0, 0, 0) != 0) { const char *errmsg = lua_tostring(L, -1); fprintf(stderr, "lua_pcall failed: %s\n", errmsg); lua_pop(L, 1); return 1; } } #endif return 0; } conky-1.12.2/3rdparty/toluapp/src/bin/tolua_scons.pkg000066400000000000000000000015741404127277500225670ustar00rootroot00000000000000$lfile "src/bin/lua/compat-5.1.lua" $lfile "src/bin/lua/compat.lua" $lfile "src/bin/lua/basic.lua" $lfile "src/bin/lua/feature.lua" $lfile "src/bin/lua/verbatim.lua" $lfile "src/bin/lua/code.lua" $lfile "src/bin/lua/typedef.lua" $lfile "src/bin/lua/container.lua" $lfile "src/bin/lua/package.lua" $lfile "src/bin/lua/module.lua" $lfile "src/bin/lua/namespace.lua" $lfile "src/bin/lua/define.lua" $lfile "src/bin/lua/enumerate.lua" $lfile "src/bin/lua/declaration.lua" $lfile "src/bin/lua/variable.lua" $lfile "src/bin/lua/array.lua" $lfile "src/bin/lua/function.lua" $lfile "src/bin/lua/operator.lua" $lfile "src/bin/lua/template_class.lua" $lfile "src/bin/lua/class.lua" $lfile "src/bin/lua/clean.lua" $lfile "src/bin/lua/doit.lua" $[ local err,msg = pcall(doit) if not err then local _,_,label,msg = strfind(msg,"(.-:.-:%s*)(.*)") tolua_error(msg,label) print(debug.traceback()) end $] conky-1.12.2/3rdparty/toluapp/src/bin/toluabind.c000066400000000000000000017556451404127277500217000ustar00rootroot00000000000000/* ** Lua binding: tolua ** Generated automatically by tolua++-1.0.92 on Sun Feb 15 22:29:47 2009. */ #ifndef __cplusplus #include "stdlib.h" #endif #include "string.h" #include "tolua++.h" /* Exported function */ TOLUA_API int tolua_tolua_open (lua_State* tolua_S); /* function to register type */ static void tolua_reg_types (lua_State* tolua_S) { (void)tolua_S; } /* Open function */ TOLUA_API int tolua_tolua_open (lua_State* tolua_S) { tolua_open(tolua_S); tolua_reg_types(tolua_S); tolua_module(tolua_S,NULL,0); tolua_beginmodule(tolua_S,NULL); { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 105,102, 32,115,116,114,105,110,103, 46,102,105,110,100, 40, 95, 86, 69, 82, 83, 73, 79, 78, 44, 32, 34, 53, 37, 46, 48, 34, 41, 32,116,104,101,110, 13, 10, 9,114,101,116,117,114, 110, 13, 10,101,110,100, 13, 10, 13, 10, 45, 45, 32, 34,108, 111, 97,100,102,105,108,101, 34, 13, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,112,112, 95,100,111, 102,105,108,101, 40,112, 97,116,104, 41, 13, 10, 13, 10, 9, 108,111, 99, 97,108, 32,108,111, 97,100,101,100, 32, 61, 32, 102, 97,108,115,101, 13, 10, 9,108,111, 99, 97,108, 32,103, 101,116,102,105,108,101, 32, 61, 32,102,117,110, 99,116,105, 111,110, 40, 41, 13, 10, 13, 10, 9, 9,105,102, 32,108,111, 97,100,101,100, 32,116,104,101,110, 13, 10, 9, 9, 9,114, 101,116,117,114,110, 13, 10, 9, 9,101,108,115,101, 13, 10, 9, 9, 9,108,111, 99, 97,108, 32,102,105,108,101, 44,101, 114,114, 32, 61, 32,105,111, 46,111,112,101,110, 40,112, 97, 116,104, 41, 13, 10, 9, 9, 9,105,102, 32,110,111,116, 32, 102,105,108,101, 32,116,104,101,110, 13, 10, 9, 9, 9, 9, 101,114,114,111,114, 40, 34,101,114,114,111,114, 32,108,111, 97,100,105,110,103, 32,102,105,108,101, 32, 34, 46, 46,112, 97,116,104, 46, 46, 34, 58, 32, 34, 46, 46,101,114,114, 41, 13, 10, 9, 9, 9,101,110,100, 13, 10, 9, 9, 9,108,111, 99, 97,108, 32,114,101,116, 32, 61, 32,102,105,108,101, 58, 114,101, 97,100, 40, 34, 42, 97, 34, 41, 13, 10, 9, 9, 9, 102,105,108,101, 58, 99,108,111,115,101, 40, 41, 13, 10, 13, 10, 9, 9, 9,114,101,116, 32, 61, 32,115,116,114,105,110, 103, 46,103,115,117, 98, 40,114,101,116, 44, 32, 34, 37, 46, 37, 46, 37, 46, 37,115, 42, 37, 41, 34, 44, 32, 34, 46, 46, 46, 41, 32,108,111, 99, 97,108, 32, 97,114,103, 32, 61, 32, 123,110, 61,115,101,108,101, 99,116, 40, 39, 35, 39, 44, 32, 46, 46, 46, 41, 44, 32, 46, 46, 46,125, 59, 34, 41, 13, 10, 13, 10, 9, 9, 9,108,111, 97,100,101,100, 32, 61, 32,116, 114,117,101, 13, 10, 9, 9, 9,114,101,116,117,114,110, 32, 114,101,116, 13, 10, 9, 9,101,110,100, 13, 10, 9,101,110, 100, 13, 10, 13, 10, 9,108,111, 99, 97,108, 32,102, 32, 61, 32,108,111, 97,100, 40,103,101,116,102,105,108,101, 44, 32, 112, 97,116,104, 41, 13, 10, 9,105,102, 32,110,111,116, 32, 102, 32,116,104,101,110, 13, 10, 9, 13, 10, 9, 9,101,114, 114,111,114, 40, 34,101,114,114,111,114, 32,108,111, 97,100, 105,110,103, 32,102,105,108,101, 32, 34, 46, 46,112, 97,116, 104, 41, 13, 10, 9,101,110,100, 13, 10, 9,114,101,116,117, 114,110, 32,102, 40, 41, 13, 10,101,110,100, 13, 10, 13, 10, 111,108,100, 95,100,111,102,105,108,101, 32, 61, 32,100,111, 102,105,108,101, 13, 10,100,111,102,105,108,101, 32, 61, 32, 112,112, 95,100,111,102,105,108,101, 13, 10, 13, 10, 13, 10, 45, 45, 32,115,116,114,105,110,103, 46,103,115,117, 98, 13, 10, 45, 45, 91, 91, 13, 10,108,111, 99, 97,108, 32,111,103, 115,117, 98, 32, 61, 32,115,116,114,105,110,103, 46,103,115, 117, 98, 13, 10,108,111, 99, 97,108, 32,102,117,110, 99,116, 105,111,110, 32, 99,111,109,112,103,115,117, 98, 40, 97, 44, 98, 44, 99, 44,100, 41, 13, 10, 32, 32,105,102, 32,116,121, 112,101, 40, 99, 41, 32, 61, 61, 32, 34,102,117,110, 99,116, 105,111,110, 34, 32,116,104,101,110, 13, 10, 32, 32, 32, 32, 108,111, 99, 97,108, 32,111, 99, 32, 61, 32, 99, 13, 10, 32, 32, 32, 32, 99, 32, 61, 32,102,117,110, 99,116,105,111,110, 32, 40, 46, 46, 46, 41, 32,114,101,116,117,114,110, 32,111, 99, 40, 46, 46, 46, 41, 32,111,114, 32, 39, 39, 32,101,110, 100, 13, 10, 32, 32,101,110,100, 13, 10, 32, 32,114,101,116, 117,114,110, 32,111,103,115,117, 98, 40, 97, 44, 98, 44, 99, 44,100, 41, 13, 10,101,110,100, 13, 10,115,116,114,105,110, 103, 46,114,101,112,108, 32, 61, 32,111,103,115,117, 98, 13, 10, 45, 45, 93, 93, 13, 10, 13, 10, 45, 45,115,116,114,105, 110,103, 46,103,115,117, 98, 32, 61, 32, 99,111,109,112,103, 115,117, 98, 13,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/compat-5.1.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 82,101, 97,108, 32,103,108,111, 98, 97,108,115, 10, 45, 45, 32, 95, 65, 76, 69, 82, 84, 10, 45, 45, 32, 95, 69, 82, 82, 79, 82, 77, 69, 83, 83, 65, 71, 69, 10, 45, 45, 32, 95, 86, 69, 82, 83, 73, 79, 78, 10, 45, 45, 32, 95, 71, 10, 45, 45, 32, 97,115,115, 101,114,116, 10, 45, 45, 32,101,114,114,111,114, 10, 45, 45, 32,109,101,116, 97,116, 97, 98,108,101, 10, 45, 45, 32,110, 101,120,116, 10, 45, 45, 32,112,114,105,110,116, 10, 45, 45, 32,114,101,113,117,105,114,101, 10, 45, 45, 32,116,111,110, 117,109, 98,101,114, 10, 45, 45, 32,116,111,115,116,114,105, 110,103, 10, 45, 45, 32,116,121,112,101, 10, 45, 45, 32,117, 110,112, 97, 99,107, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 99,111,108,108,101, 99,116,103, 97,114, 98, 97, 103,101, 10, 45, 45, 32,103, 99,105,110,102,111, 10, 10, 45, 45, 32,103,108,111, 98, 97,108,115, 10, 10, 45, 45, 32, 99, 97,108,108, 32, 32, 32, 45, 62, 32,112,114,111,116,101, 99, 116, 40,102, 44, 32,101,114,114, 41, 10, 45, 45, 32,108,111, 97,100,102,105,108,101, 10, 45, 45, 32,108,111, 97,100,115, 116,114,105,110,103, 10, 10, 45, 45, 32,114, 97,119,103,101, 116, 10, 45, 45, 32,114, 97,119,115,101,116, 10, 10, 45, 45, 32,103,101,116, 97,114,103,115, 32, 61, 32, 77, 97,105,110, 46,103,101,116, 97,114,103,115, 32, 63, 63, 10, 10,114, 97, 119,116,121,112,101, 32, 61, 32,116,121,112,101, 10, 10,102, 117,110, 99,116,105,111,110, 32,100,111, 95, 32, 40,102, 44, 32,101,114,114, 41, 10, 32, 32,105,102, 32,110,111,116, 32, 102, 32,116,104,101,110, 32,112,114,105,110,116, 40,101,114, 114, 41, 59, 32,114,101,116,117,114,110, 32,101,110,100, 10, 32, 32,108,111, 99, 97,108, 32, 97, 44, 98, 32, 61, 32,112, 99, 97,108,108, 40,102, 41, 10, 32, 32,105,102, 32,110,111, 116, 32, 97, 32,116,104,101,110, 32,112,114,105,110,116, 40, 98, 41, 59, 32,114,101,116,117,114,110, 32,110,105,108, 10, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32, 98, 32,111,114, 32,116,114,117,101, 10, 32, 32,101,110,100, 10, 101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,100, 111,115,116,114,105,110,103, 40,115, 41, 32,114,101,116,117, 114,110, 32,100,111, 95, 40,108,111, 97,100,115,116,114,105, 110,103, 40,115, 41, 41, 32,101,110,100, 10, 45, 45, 32,102, 117,110, 99,116,105,111,110, 32,100,111,102,105,108,101, 40, 115, 41, 32,114,101,116,117,114,110, 32,100,111, 95, 40,108, 111, 97,100,102,105,108,101, 40,115, 41, 41, 32,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 84, 97, 98,108,101, 32,108,105, 98,114, 97,114,121, 10,108,111, 99, 97,108, 32,116, 97, 98, 32, 61, 32,116, 97, 98,108,101, 10, 102,111,114,101, 97, 99,104, 32, 61, 32,116, 97, 98, 46,102, 111,114,101, 97, 99,104, 10,102,111,114,101, 97, 99,104,105, 32, 61, 32,116, 97, 98, 46,102,111,114,101, 97, 99,104,105, 10,103,101,116,110, 32, 61, 32,116, 97, 98, 46,103,101,116, 110, 10,116,105,110,115,101,114,116, 32, 61, 32,116, 97, 98, 46,105,110,115,101,114,116, 10,116,114,101,109,111,118,101, 32, 61, 32,116, 97, 98, 46,114,101,109,111,118,101, 10,115, 111,114,116, 32, 61, 32,116, 97, 98, 46,115,111,114,116, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 98, 117,103, 32,108,105, 98,114, 97,114,121, 10,108,111, 99, 97, 108, 32,100, 98,103, 32, 61, 32,100,101, 98,117,103, 10,103, 101,116,105,110,102,111, 32, 61, 32,100, 98,103, 46,103,101, 116,105,110,102,111, 10,103,101,116,108,111, 99, 97,108, 32, 61, 32,100, 98,103, 46,103,101,116,108,111, 99, 97,108, 10, 115,101,116, 99, 97,108,108,104,111,111,107, 32, 61, 32,102, 117,110, 99,116,105,111,110, 32, 40, 41, 32,101,114,114,111, 114, 34, 96,115,101,116, 99, 97,108,108,104,111,111,107, 39, 32,105,115, 32,100,101,112,114,101, 99, 97,116,101,100, 34, 32,101,110,100, 10,115,101,116,108,105,110,101,104,111,111, 107, 32, 61, 32,102,117,110, 99,116,105,111,110, 32, 40, 41, 32,101,114,114,111,114, 34, 96,115,101,116,108,105,110,101, 104,111,111,107, 39, 32,105,115, 32,100,101,112,114,101, 99, 97,116,101,100, 34, 32,101,110,100, 10,115,101,116,108,111, 99, 97,108, 32, 61, 32,100, 98,103, 46,115,101,116,108,111, 99, 97,108, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32,109, 97,116,104, 32,108,105, 98,114, 97,114,121, 10,108, 111, 99, 97,108, 32,109, 97,116,104, 32, 61, 32,109, 97,116, 104, 10, 97, 98,115, 32, 61, 32,109, 97,116,104, 46, 97, 98, 115, 10, 97, 99,111,115, 32, 61, 32,102,117,110, 99,116,105, 111,110, 32, 40,120, 41, 32,114,101,116,117,114,110, 32,109, 97,116,104, 46,100,101,103, 40,109, 97,116,104, 46, 97, 99, 111,115, 40,120, 41, 41, 32,101,110,100, 10, 97,115,105,110, 32, 61, 32,102,117,110, 99,116,105,111,110, 32, 40,120, 41, 32,114,101,116,117,114,110, 32,109, 97,116,104, 46,100,101, 103, 40,109, 97,116,104, 46, 97,115,105,110, 40,120, 41, 41, 32,101,110,100, 10, 97,116, 97,110, 32, 61, 32,102,117,110, 99,116,105,111,110, 32, 40,120, 41, 32,114,101,116,117,114, 110, 32,109, 97,116,104, 46,100,101,103, 40,109, 97,116,104, 46, 97,116, 97,110, 40,120, 41, 41, 32,101,110,100, 10, 97, 116, 97,110, 50, 32, 61, 32,102,117,110, 99,116,105,111,110, 32, 40,120, 44,121, 41, 32,114,101,116,117,114,110, 32,109, 97,116,104, 46,100,101,103, 40,109, 97,116,104, 46, 97,116, 97,110, 50, 40,120, 44,121, 41, 41, 32,101,110,100, 10, 99, 101,105,108, 32, 61, 32,109, 97,116,104, 46, 99,101,105,108, 10, 99,111,115, 32, 61, 32,102,117,110, 99,116,105,111,110, 32, 40,120, 41, 32,114,101,116,117,114,110, 32,109, 97,116, 104, 46, 99,111,115, 40,109, 97,116,104, 46,114, 97,100, 40, 120, 41, 41, 32,101,110,100, 10,100,101,103, 32, 61, 32,109, 97,116,104, 46,100,101,103, 10,101,120,112, 32, 61, 32,109, 97,116,104, 46,101,120,112, 10,102,108,111,111,114, 32, 61, 32,109, 97,116,104, 46,102,108,111,111,114, 10,102,114,101, 120,112, 32, 61, 32,109, 97,116,104, 46,102,114,101,120,112, 10,108,100,101,120,112, 32, 61, 32,109, 97,116,104, 46,108, 100,101,120,112, 10,108,111,103, 32, 61, 32,109, 97,116,104, 46,108,111,103, 10,108,111,103, 49, 48, 32, 61, 32,109, 97, 116,104, 46,108,111,103, 49, 48, 10,109, 97,120, 32, 61, 32, 109, 97,116,104, 46,109, 97,120, 10,109,105,110, 32, 61, 32, 109, 97,116,104, 46,109,105,110, 10,109,111,100, 32, 61, 32, 109, 97,116,104, 46,109,111,100, 10, 80, 73, 32, 61, 32,109, 97,116,104, 46,112,105, 10, 45, 45, 63, 63, 63, 32,112,111, 119, 32, 61, 32,109, 97,116,104, 46,112,111,119, 32, 32, 10, 114, 97,100, 32, 61, 32,109, 97,116,104, 46,114, 97,100, 10, 114, 97,110,100,111,109, 32, 61, 32,109, 97,116,104, 46,114, 97,110,100,111,109, 10,114, 97,110,100,111,109,115,101,101, 100, 32, 61, 32,109, 97,116,104, 46,114, 97,110,100,111,109, 115,101,101,100, 10,115,105,110, 32, 61, 32,102,117,110, 99, 116,105,111,110, 32, 40,120, 41, 32,114,101,116,117,114,110, 32,109, 97,116,104, 46,115,105,110, 40,109, 97,116,104, 46, 114, 97,100, 40,120, 41, 41, 32,101,110,100, 10,115,113,114, 116, 32, 61, 32,109, 97,116,104, 46,115,113,114,116, 10,116, 97,110, 32, 61, 32,102,117,110, 99,116,105,111,110, 32, 40, 120, 41, 32,114,101,116,117,114,110, 32,109, 97,116,104, 46, 116, 97,110, 40,109, 97,116,104, 46,114, 97,100, 40,120, 41, 41, 32,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32,115,116,114,105,110,103, 32,108,105, 98,114, 97, 114,121, 10,108,111, 99, 97,108, 32,115,116,114, 32, 61, 32, 115,116,114,105,110,103, 10,115,116,114, 98,121,116,101, 32, 61, 32,115,116,114, 46, 98,121,116,101, 10,115,116,114, 99, 104, 97,114, 32, 61, 32,115,116,114, 46, 99,104, 97,114, 10, 115,116,114,102,105,110,100, 32, 61, 32,115,116,114, 46,102, 105,110,100, 10,102,111,114,109, 97,116, 32, 61, 32,115,116, 114, 46,102,111,114,109, 97,116, 10,103,115,117, 98, 32, 61, 32,115,116,114, 46,103,115,117, 98, 10,115,116,114,108,101, 110, 32, 61, 32,115,116,114, 46,108,101,110, 10,115,116,114, 108,111,119,101,114, 32, 61, 32,115,116,114, 46,108,111,119, 101,114, 10,115,116,114,114,101,112, 32, 61, 32,115,116,114, 46,114,101,112, 10,115,116,114,115,117, 98, 32, 61, 32,115, 116,114, 46,115,117, 98, 10,115,116,114,117,112,112,101,114, 32, 61, 32,115,116,114, 46,117,112,112,101,114, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32,111,115, 32,108,105, 98,114, 97,114,121, 10, 99,108,111, 99,107, 32, 61, 32,111, 115, 46, 99,108,111, 99,107, 10,100, 97,116,101, 32, 61, 32, 111,115, 46,100, 97,116,101, 10,100,105,102,102,116,105,109, 101, 32, 61, 32,111,115, 46,100,105,102,102,116,105,109,101, 10,101,120,101, 99,117,116,101, 32, 61, 32,111,115, 46,101, 120,101, 99,117,116,101, 32, 45, 45, 63, 10,101,120,105,116, 32, 61, 32,111,115, 46,101,120,105,116, 10,103,101,116,101, 110,118, 32, 61, 32,111,115, 46,103,101,116,101,110,118, 10, 114,101,109,111,118,101, 32, 61, 32,111,115, 46,114,101,109, 111,118,101, 10,114,101,110, 97,109,101, 32, 61, 32,111,115, 46,114,101,110, 97,109,101, 10,115,101,116,108,111, 99, 97, 108,101, 32, 61, 32,111,115, 46,115,101,116,108,111, 99, 97, 108,101, 10,116,105,109,101, 32, 61, 32,111,115, 46,116,105, 109,101, 10,116,109,112,110, 97,109,101, 32, 61, 32,111,115, 46,116,109,112,110, 97,109,101, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 99,111,109,112, 97,116,105, 98,105, 108,105,116,121, 32,111,110,108,121, 10,103,101,116,103,108, 111, 98, 97,108, 32, 61, 32,102,117,110, 99,116,105,111,110, 32, 40,110, 41, 32,114,101,116,117,114,110, 32, 95, 71, 91, 110, 93, 32,101,110,100, 10,115,101,116,103,108,111, 98, 97, 108, 32, 61, 32,102,117,110, 99,116,105,111,110, 32, 40,110, 44,118, 41, 32, 95, 71, 91,110, 93, 32, 61, 32,118, 32,101, 110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10,108,111, 99, 97,108, 32,105,111, 44, 32,116, 97, 98, 32, 61, 32,105, 111, 44, 32,116, 97, 98,108,101, 10, 10, 45, 45, 32, 73, 79, 32,108,105, 98,114, 97,114,121, 32, 40,102,105,108,101,115, 41, 10, 95, 83, 84, 68, 73, 78, 32, 61, 32,105,111, 46,115, 116,100,105,110, 10, 95, 83, 84, 68, 69, 82, 82, 32, 61, 32, 105,111, 46,115,116,100,101,114,114, 10, 95, 83, 84, 68, 79, 85, 84, 32, 61, 32,105,111, 46,115,116,100,111,117,116, 10, 95, 73, 78, 80, 85, 84, 32, 61, 32,105,111, 46,115,116,100, 105,110, 10, 95, 79, 85, 84, 80, 85, 84, 32, 61, 32,105,111, 46,115,116,100,111,117,116, 10,115,101,101,107, 32, 61, 32, 105,111, 46,115,116,100,105,110, 46,115,101,101,107, 32, 32, 32, 45, 45, 32,115,105, 99,107, 32, 59, 45, 41, 10,116,109, 112,102,105,108,101, 32, 61, 32,105,111, 46,116,109,112,102, 105,108,101, 10, 99,108,111,115,101,102,105,108,101, 32, 61, 32,105,111, 46, 99,108,111,115,101, 10,111,112,101,110,102, 105,108,101, 32, 61, 32,105,111, 46,111,112,101,110, 10, 10, 102,117,110, 99,116,105,111,110, 32,102,108,117,115,104, 32, 40,102, 41, 10, 32, 32,105,102, 32,102, 32,116,104,101,110, 32,102, 58,102,108,117,115,104, 40, 41, 10, 32, 32,101,108, 115,101, 32, 95, 79, 85, 84, 80, 85, 84, 58,102,108,117,115, 104, 40, 41, 10, 32, 32,101,110,100, 10,101,110,100, 10, 10, 102,117,110, 99,116,105,111,110, 32,114,101, 97,100,102,114, 111,109, 32, 40,110, 97,109,101, 41, 10, 32, 32,105,102, 32, 110, 97,109,101, 32, 61, 61, 32,110,105,108, 32,116,104,101, 110, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,102, 44, 32, 101,114,114, 44, 32, 99,111,100, 32, 61, 32,105,111, 46, 99, 108,111,115,101, 40, 95, 73, 78, 80, 85, 84, 41, 10, 32, 32, 32, 32, 95, 73, 78, 80, 85, 84, 32, 61, 32,105,111, 46,115, 116,100,105,110, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102, 44, 32,101,114,114, 44, 32, 99,111,100, 10, 32, 32, 101,108,115,101, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 102, 44, 32,101,114,114, 44, 32, 99,111,100, 32, 61, 32,105, 111, 46,111,112,101,110, 40,110, 97,109,101, 44, 32, 34,114, 34, 41, 10, 32, 32, 32, 32, 95, 73, 78, 80, 85, 84, 32, 61, 32,102, 32,111,114, 32, 95, 73, 78, 80, 85, 84, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102, 44, 32,101,114,114, 44, 32, 99,111,100, 10, 32, 32,101,110,100, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,119,114,105,116, 101,116,111, 32, 40,110, 97,109,101, 41, 10, 32, 32,105,102, 32,110, 97,109,101, 32, 61, 61, 32,110,105,108, 32,116,104, 101,110, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,102, 44, 32,101,114,114, 44, 32, 99,111,100, 32, 61, 32,105,111, 46, 99,108,111,115,101, 40, 95, 79, 85, 84, 80, 85, 84, 41, 10, 32, 32, 32, 32, 95, 79, 85, 84, 80, 85, 84, 32, 61, 32,105, 111, 46,115,116,100,111,117,116, 10, 32, 32, 32, 32,114,101, 116,117,114,110, 32,102, 44, 32,101,114,114, 44, 32, 99,111, 100, 10, 32, 32,101,108,115,101, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,102, 44, 32,101,114,114, 44, 32, 99,111,100, 32, 61, 32,105,111, 46,111,112,101,110, 40,110, 97,109,101, 44, 32, 34,119, 34, 41, 10, 32, 32, 32, 32, 95, 79, 85, 84, 80, 85, 84, 32, 61, 32,102, 32,111,114, 32, 95, 79, 85, 84, 80, 85, 84, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 102, 44, 32,101,114,114, 44, 32, 99,111,100, 10, 32, 32,101, 110,100, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111, 110, 32, 97,112,112,101,110,100,116,111, 32, 40,110, 97,109, 101, 41, 10, 32, 32,108,111, 99, 97,108, 32,102, 44, 32,101, 114,114, 44, 32, 99,111,100, 32, 61, 32,105,111, 46,111,112, 101,110, 40,110, 97,109,101, 44, 32, 34, 97, 34, 41, 10, 32, 32, 95, 79, 85, 84, 80, 85, 84, 32, 61, 32,102, 32,111,114, 32, 95, 79, 85, 84, 80, 85, 84, 10, 32, 32,114,101,116,117, 114,110, 32,102, 44, 32,101,114,114, 44, 32, 99,111,100, 10, 101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,114, 101, 97,100, 32, 40, 46, 46, 46, 41, 10, 32, 32,108,111, 99, 97,108, 32,102, 32, 61, 32, 95, 73, 78, 80, 85, 84, 10, 32, 32,105,102, 32,114, 97,119,116,121,112,101, 40, 97,114,103, 91, 49, 93, 41, 32, 61, 61, 32, 39,117,115,101,114,100, 97, 116, 97, 39, 32,116,104,101,110, 10, 32, 32, 32, 32,102, 32, 61, 32,116, 97, 98, 46,114,101,109,111,118,101, 40, 97,114, 103, 44, 32, 49, 41, 10, 32, 32,101,110,100, 10, 32, 32,114, 101,116,117,114,110, 32,102, 58,114,101, 97,100, 40,117,110, 112, 97, 99,107, 40, 97,114,103, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,119,114,105,116,101, 32, 40, 46, 46, 46, 41, 10, 32, 32,108,111, 99, 97,108, 32, 102, 32, 61, 32, 95, 79, 85, 84, 80, 85, 84, 10, 32, 32,105, 102, 32,114, 97,119,116,121,112,101, 40, 97,114,103, 91, 49, 93, 41, 32, 61, 61, 32, 39,117,115,101,114,100, 97,116, 97, 39, 32,116,104,101,110, 10, 32, 32, 32, 32,102, 32, 61, 32, 116, 97, 98, 46,114,101,109,111,118,101, 40, 97,114,103, 44, 32, 49, 41, 10, 32, 32,101,110,100, 10, 32, 32,114,101,116, 117,114,110, 32,102, 58,119,114,105,116,101, 40,117,110,112, 97, 99,107, 40, 97,114,103, 41, 41, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/compat.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32, 98, 97,115,105, 99, 32,117,116,105,108,105,116,121, 32,102,117,110, 99,116,105, 111,110,115, 10, 45, 45, 32, 87,114,105,116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108, 101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 76, 97,115,116, 32,117,112,100, 97,116,101, 58, 32, 65,112,114, 32, 50, 48, 48, 51, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104, 105,115, 32, 99,111,100,101, 32,105,115, 32,102,114,101,101, 32,115,111,102,116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101,100,105,115,116,114,105, 98,117,116, 101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100, 105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32, 115,111,102,116,119, 97,114,101, 32,112,114,111,118,105,100, 101,100, 32,104,101,114,101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116, 104,101, 32, 97,117,116,104,111,114, 32,104, 97,115, 32,110, 111, 32,111, 98,108,105,103, 97,116,105,111,110, 32,116,111, 32,112,114,111,118,105,100,101, 32,109, 97,105,110,116,101, 110, 97,110, 99,101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110, 104, 97,110, 99,101,109,101,110,116,115, 44, 32,111,114, 32, 109,111,100,105,102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 45, 45, 32, 66, 97,115,105, 99, 32, 67, 32,116,121, 112,101,115, 32, 97,110,100, 32,116,104,101,105,114, 32, 99, 111,114,114,101,115,112,111,110,100,105,110,103, 32, 76,117, 97, 32,116,121,112,101,115, 10, 45, 45, 32, 65,108,108, 32, 111, 99, 99,117,114,114,101,110, 99,101,115, 32,111,102, 32, 34, 99,104, 97,114, 42, 34, 32,119,105,108,108, 32, 98,101, 32,114,101,112,108, 97, 99,101,100, 32, 98,121, 32, 34, 95, 99,115,116,114,105,110,103, 34, 44, 10, 45, 45, 32, 97,110, 100, 32, 97,108,108, 32,111, 99, 99,117,114,114,101,110, 99, 101,115, 32,111,102, 32, 34,118,111,105,100, 42, 34, 32,119, 105,108,108, 32, 98,101, 32,114,101,112,108, 97, 99,101,100, 32, 98,121, 32, 34, 95,117,115,101,114,100, 97,116, 97, 34, 10, 95, 98, 97,115,105, 99, 32, 61, 32,123, 10, 32, 91, 39, 118,111,105,100, 39, 93, 32, 61, 32, 39, 39, 44, 10, 32, 91, 39, 99,104, 97,114, 39, 93, 32, 61, 32, 39,110,117,109, 98, 101,114, 39, 44, 10, 32, 91, 39,105,110,116, 39, 93, 32, 61, 32, 39,110,117,109, 98,101,114, 39, 44, 10, 32, 91, 39,115, 104,111,114,116, 39, 93, 32, 61, 32, 39,110,117,109, 98,101, 114, 39, 44, 10, 32, 91, 39,108,111,110,103, 39, 93, 32, 61, 32, 39,110,117,109, 98,101,114, 39, 44, 10, 32, 91, 39,117, 110,115,105,103,110,101,100, 39, 93, 32, 61, 32, 39,110,117, 109, 98,101,114, 39, 44, 10, 32, 91, 39,102,108,111, 97,116, 39, 93, 32, 61, 32, 39,110,117,109, 98,101,114, 39, 44, 10, 32, 91, 39,100,111,117, 98,108,101, 39, 93, 32, 61, 32, 39, 110,117,109, 98,101,114, 39, 44, 10, 32, 91, 39, 95, 99,115, 116,114,105,110,103, 39, 93, 32, 61, 32, 39,115,116,114,105, 110,103, 39, 44, 10, 32, 91, 39, 95,117,115,101,114,100, 97, 116, 97, 39, 93, 32, 61, 32, 39,117,115,101,114,100, 97,116, 97, 39, 44, 10, 32, 91, 39, 99,104, 97,114, 42, 39, 93, 32, 61, 32, 39,115,116,114,105,110,103, 39, 44, 10, 32, 91, 39, 118,111,105,100, 42, 39, 93, 32, 61, 32, 39,117,115,101,114, 100, 97,116, 97, 39, 44, 10, 32, 91, 39, 98,111,111,108, 39, 93, 32, 61, 32, 39, 98,111,111,108,101, 97,110, 39, 44, 10, 32, 91, 39,108,117, 97, 95, 79, 98,106,101, 99,116, 39, 93, 32, 61, 32, 39,118, 97,108,117,101, 39, 44, 10, 32, 91, 39, 76, 85, 65, 95, 86, 65, 76, 85, 69, 39, 93, 32, 61, 32, 39, 118, 97,108,117,101, 39, 44, 32, 32, 32, 32, 45, 45, 32,102, 111,114, 32, 99,111,109,112, 97,116,105, 98,105,108,105,116, 121, 32,119,105,116,104, 32,116,111,108,117, 97, 32, 52, 46, 48, 10, 32, 91, 39,108,117, 97, 95, 83,116, 97,116,101, 42, 39, 93, 32, 61, 32, 39,115,116, 97,116,101, 39, 44, 10, 32, 91, 39, 95,108,115,116, 97,116,101, 39, 93, 32, 61, 32, 39, 115,116, 97,116,101, 39, 44, 10, 32, 91, 39,108,117, 97, 95, 70,117,110, 99,116,105,111,110, 39, 93, 32, 61, 32, 39,118, 97,108,117,101, 39, 44, 10,125, 10, 10, 95, 98, 97,115,105, 99, 95, 99,116,121,112,101, 32, 61, 32,123, 10, 32,110,117, 109, 98,101,114, 32, 61, 32, 34,108,117, 97, 95, 78,117,109, 98,101,114, 34, 44, 10, 32,115,116,114,105,110,103, 32, 61, 32, 34, 99,111,110,115,116, 32, 99,104, 97,114, 42, 34, 44, 10, 32,117,115,101,114,100, 97,116, 97, 32, 61, 32, 34,118, 111,105,100, 42, 34, 44, 10, 32, 98,111,111,108,101, 97,110, 32, 61, 32, 34, 98,111,111,108, 34, 44, 10, 32,118, 97,108, 117,101, 32, 61, 32, 34,105,110,116, 34, 44, 10, 32,115,116, 97,116,101, 32, 61, 32, 34,108,117, 97, 95, 83,116, 97,116, 101, 42, 34, 44, 10,125, 10, 10, 45, 45, 32,102,117,110, 99, 116,105,111,110,115, 32,116,104,101, 32, 97,114,101, 32,117, 115,101,100, 32,116,111, 32,100,111, 32, 97, 32, 39,114, 97, 119, 32,112,117,115,104, 39, 32,111,102, 32, 98, 97,115,105, 99, 32,116,121,112,101,115, 10, 95, 98, 97,115,105, 99, 95, 114, 97,119, 95,112,117,115,104, 32, 61, 32,123,125, 10, 10, 45, 45, 32, 76,105,115,116, 32,111,102, 32,117,115,101,114, 32,100,101,102,105,110,101,100, 32,116,121,112,101,115, 10, 45, 45, 32, 69, 97, 99,104, 32,116,121,112,101, 32, 99,111, 114,114,101,115,112,111,110,100,115, 32,116,111, 32, 97, 32, 118, 97,114,105, 97, 98,108,101, 32,110, 97,109,101, 32,116, 104, 97,116, 32,115,116,111,114,101,115, 32,105,116,115, 32, 116, 97,103, 32,118, 97,108,117,101, 46, 10, 95,117,115,101, 114,116,121,112,101, 32, 61, 32,123,125, 10, 10, 45, 45, 32, 76,105,115,116, 32,111,102, 32,116,121,112,101,115, 32,116, 104, 97,116, 32,104, 97,118,101, 32,116,111, 32, 98,101, 32, 99,111,108,108,101, 99,116,101,100, 10, 95, 99,111,108,108, 101, 99,116, 32, 61, 32,123,125, 10, 10, 45, 45, 32, 76,105, 115,116, 32,111,102, 32,116,121,112,101,115, 10, 95,103,108, 111, 98, 97,108, 95,116,121,112,101,115, 32, 61, 32,123,110, 61, 48,125, 10, 95,103,108,111, 98, 97,108, 95,116,121,112, 101,115, 95,104, 97,115,104, 32, 61, 32,123,125, 10, 10, 45, 45, 32,108,105,115,116, 32,111,102, 32, 99,108, 97,115,115, 101,115, 10, 95,103,108,111, 98, 97,108, 95, 99,108, 97,115, 115,101,115, 32, 61, 32,123,125, 10, 10, 45, 45, 32, 76,105, 115,116, 32,111,102, 32,101,110,117,109, 32, 99,111,110,115, 116, 97,110,116,115, 10, 95,103,108,111, 98, 97,108, 95,101, 110,117,109,115, 32, 61, 32,123,125, 10, 10, 45, 45, 32, 76, 105,115,116, 32,111,102, 32, 97,117,116,111, 32,114,101,110, 97,109,105,110,103, 10, 95,114,101,110, 97,109,105,110,103, 32, 61, 32,123,125, 10,102,117,110, 99,116,105,111,110, 32, 97,112,112,101,110,100,114,101,110, 97,109,105,110,103, 32, 40,115, 41, 10, 32,108,111, 99, 97,108, 32, 98, 44,101, 44, 111,108,100, 44,110,101,119, 32, 61, 32,115,116,114,102,105, 110,100, 40,115, 44, 34, 37,115, 42, 40, 46, 45, 41, 37,115, 42, 64, 37,115, 42, 40, 46, 45, 41, 37,115, 42, 36, 34, 41, 10, 9,105,102, 32,110,111,116, 32, 98, 32,116,104,101,110, 10, 9, 32,101,114,114,111,114, 40, 34, 35, 73,110,118, 97, 108,105,100, 32,114,101,110, 97,109,105,110,103, 32,115,121, 110,116, 97,120, 59, 32,105,116, 32,115,104,111,117,108,100, 32, 98,101, 32,111,102, 32,116,104,101, 32,102,111,114,109, 58, 32,112, 97,116,116,101,114,110, 64,112, 97,116,116,101, 114,110, 34, 41, 10, 9,101,110,100, 10, 9,116,105,110,115, 101,114,116, 40, 95,114,101,110, 97,109,105,110,103, 44,123, 111,108,100, 61,111,108,100, 44, 32,110,101,119, 61,110,101, 119,125, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105, 111,110, 32, 97,112,112,108,121,114,101,110, 97,109,105,110, 103, 32, 40,115, 41, 10, 9,102,111,114, 32,105, 61, 49, 44, 103,101,116,110, 40, 95,114,101,110, 97,109,105,110,103, 41, 32,100,111, 10, 9, 32,108,111, 99, 97,108, 32,109, 44,110, 32, 61, 32,103,115,117, 98, 40,115, 44, 95,114,101,110, 97, 109,105,110,103, 91,105, 93, 46,111,108,100, 44, 95,114,101, 110, 97,109,105,110,103, 91,105, 93, 46,110,101,119, 41, 10, 9, 9,105,102, 32,110, 32,126, 61, 32, 48, 32,116,104,101, 110, 10, 9, 9, 32,114,101,116,117,114,110, 32,109, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10, 9,114,101,116,117, 114,110, 32,110,105,108, 10,101,110,100, 10, 10, 45, 45, 32, 69,114,114,111,114, 32,104, 97,110,100,108,101,114, 10,102, 117,110, 99,116,105,111,110, 32,116,111,108,117, 97, 95,101, 114,114,111,114, 32, 40,115, 44,102, 41, 10,105,102, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32,116,104,101,110, 10, 9,112,114,105,110,116, 40, 34, 42, 42, 42, 99,117,114,114, 32, 99,111,100,101, 32,102,111,114, 32,101,114,114,111,114, 32,105,115, 32, 34, 46, 46,116,111,115,116,114,105,110,103, 40, 95, 99,117,114,114, 95, 99,111,100,101, 41, 41, 10, 9, 112,114,105,110,116, 40,100,101, 98,117,103, 46,116,114, 97, 99,101, 98, 97, 99,107, 40, 41, 41, 10,101,110,100, 10, 32, 108,111, 99, 97,108, 32,111,117,116, 32, 61, 32, 95, 79, 85, 84, 80, 85, 84, 10, 32, 95, 79, 85, 84, 80, 85, 84, 32, 61, 32, 95, 83, 84, 68, 69, 82, 82, 10, 32,105,102, 32,115,116, 114,115,117, 98, 40,115, 44, 49, 44, 49, 41, 32, 61, 61, 32, 39, 35, 39, 32,116,104,101,110, 10, 32, 32,119,114,105,116, 101, 40, 34, 92,110, 42, 42, 32,116,111,108,117, 97, 58, 32, 34, 46, 46,115,116,114,115,117, 98, 40,115, 44, 50, 41, 46, 46, 34, 46, 92,110, 92,110, 34, 41, 10, 32, 32,105,102, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32,116,104,101,110, 10, 32, 32, 32,108,111, 99, 97,108, 32, 95, 44, 95, 44,115, 32, 61, 32,115,116,114,102,105,110,100, 40, 95, 99,117,114, 114, 95, 99,111,100,101, 44, 34, 94, 37,115, 42, 40, 46, 45, 92,110, 41, 34, 41, 32, 45, 45, 32,101,120,116,114, 97, 99, 116, 32,102,105,114,115,116, 32,108,105,110,101, 10, 32, 32, 32,105,102, 32,115, 61, 61,110,105,108, 32,116,104,101,110, 32,115, 32, 61, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32,101,110,100, 10, 32, 32, 32,115, 32, 61, 32,103,115,117, 98, 40,115, 44, 34, 95,117,115,101,114,100, 97,116, 97, 34, 44, 34,118,111,105,100, 42, 34, 41, 32, 45, 45, 32,114,101, 116,117,114,110, 32,119,105,116,104, 32, 39,118,111,105,100, 42, 39, 10, 32, 32, 32,115, 32, 61, 32,103,115,117, 98, 40, 115, 44, 34, 95, 99,115,116,114,105,110,103, 34, 44, 34, 99, 104, 97,114, 42, 34, 41, 32, 32, 45, 45, 32,114,101,116,117, 114,110, 32,119,105,116,104, 32, 39, 99,104, 97,114, 42, 39, 10, 32, 32, 32,115, 32, 61, 32,103,115,117, 98, 40,115, 44, 34, 95,108,115,116, 97,116,101, 34, 44, 34,108,117, 97, 95, 83,116, 97,116,101, 42, 34, 41, 32, 32, 45, 45, 32,114,101, 116,117,114,110, 32,119,105,116,104, 32, 39,108,117, 97, 95, 83,116, 97,116,101, 42, 39, 10, 32, 32, 32,119,114,105,116, 101, 40, 34, 67,111,100,101, 32, 98,101,105,110,103, 32,112, 114,111, 99,101,115,115,101,100, 58, 92,110, 34, 46, 46,115, 46, 46, 34, 92,110, 34, 41, 10, 32, 32,101,110,100, 10, 32, 101,108,115,101, 10, 32,105,102, 32,110,111,116, 32,102, 32, 116,104,101,110, 32,102, 32, 61, 32, 34, 40,102, 32,105,115, 32,110,105,108, 41, 34, 32,101,110,100, 10, 32, 32,112,114, 105,110,116, 40, 34, 92,110, 42, 42, 32,116,111,108,117, 97, 32,105,110,116,101,114,110, 97,108, 32,101,114,114,111,114, 58, 32, 34, 46, 46,102, 46, 46,115, 46, 46, 34, 46, 92,110, 92,110, 34, 41, 10, 32, 32,114,101,116,117,114,110, 10, 32, 101,110,100, 10, 32, 95, 79, 85, 84, 80, 85, 84, 32, 61, 32, 111,117,116, 10,101,110,100, 10, 10,102,117,110, 99,116,105, 111,110, 32,119, 97,114,110,105,110,103, 32, 40,109,115,103, 41, 10, 32,105,102, 32,102,108, 97,103,115, 46,113, 32,116, 104,101,110, 32,114,101,116,117,114,110, 32,101,110,100, 10, 32,108,111, 99, 97,108, 32,111,117,116, 32, 61, 32, 95, 79, 85, 84, 80, 85, 84, 10, 32, 95, 79, 85, 84, 80, 85, 84, 32, 61, 32, 95, 83, 84, 68, 69, 82, 82, 10, 32,119,114,105,116, 101, 40, 34, 92,110, 42, 42, 32,116,111,108,117, 97, 32,119, 97,114,110,105,110,103, 58, 32, 34, 46, 46,109,115,103, 46, 46, 34, 46, 92,110, 92,110, 34, 41, 10, 32, 95, 79, 85, 84, 80, 85, 84, 32, 61, 32,111,117,116, 10,101,110,100, 10, 10, 45, 45, 32,114,101,103,105,115,116,101,114, 32, 97,110, 32, 117,115,101,114, 32,100,101,102,105,110,101,100, 32,116,121, 112,101, 58, 32,114,101,116,117,114,110,115, 32,102,117,108, 108, 32,116,121,112,101, 10,102,117,110, 99,116,105,111,110, 32,114,101,103,116,121,112,101, 32, 40,116, 41, 10, 9, 45, 45,105,102, 32,105,115, 98, 97,115,105, 99, 40,116, 41, 32, 116,104,101,110, 10, 9, 45, 45, 9,114,101,116,117,114,110, 32,116, 10, 9, 45, 45,101,110,100, 10, 9,108,111, 99, 97, 108, 32,102,116, 32, 61, 32,102,105,110,100,116,121,112,101, 40,116, 41, 10, 10, 9,105,102, 32,110,111,116, 32, 95,117, 115,101,114,116,121,112,101, 91,102,116, 93, 32,116,104,101, 110, 10, 9, 9,114,101,116,117,114,110, 32, 97,112,112,101, 110,100,117,115,101,114,116,121,112,101, 40,116, 41, 10, 9, 101,110,100, 10, 9,114,101,116,117,114,110, 32,102,116, 10, 101,110,100, 10, 10, 45, 45, 32,114,101,116,117,114,110, 32, 116,121,112,101, 32,110, 97,109,101, 58, 32,114,101,116,117, 114,110,115, 32,102,117,108,108, 32,116,121,112,101, 10,102, 117,110, 99,116,105,111,110, 32,116,121,112,101,118, 97,114, 40,116,121,112,101, 41, 10, 9,105,102, 32,116,121,112,101, 32, 61, 61, 32, 39, 39, 32,111,114, 32,116,121,112,101, 32, 61, 61, 32, 39,118,111,105,100, 39, 32,116,104,101,110, 10, 9, 9,114,101,116,117,114,110, 32,116,121,112,101, 10, 9, 101,108,115,101, 10, 9, 9,108,111, 99, 97,108, 32,102,116, 32, 61, 32,102,105,110,100,116,121,112,101, 40,116,121,112, 101, 41, 10, 9, 9,105,102, 32,102,116, 32,116,104,101,110, 10, 9, 9, 9,114,101,116,117,114,110, 32,102,116, 10, 9, 9,101,110,100, 10, 9, 9, 95,117,115,101,114,116,121,112, 101, 91,116,121,112,101, 93, 32, 61, 32,116,121,112,101, 10, 9, 9,114,101,116,117,114,110, 32,116,121,112,101, 10, 9, 101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32, 98, 97,115,105, 99, 32,116,121,112, 101, 10,102,117,110, 99,116,105,111,110, 32,105,115, 98, 97, 115,105, 99, 32, 40,116,121,112,101, 41, 10, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,103,115,117, 98, 40,116,121,112, 101, 44, 39, 99,111,110,115,116, 32, 39, 44, 39, 39, 41, 10, 32,108,111, 99, 97,108, 32,109, 44,116, 32, 61, 32, 97,112, 112,108,121,116,121,112,101,100,101,102, 40, 39, 39, 44, 32, 116, 41, 10, 32,108,111, 99, 97,108, 32, 98, 32, 61, 32, 95, 98, 97,115,105, 99, 91,116, 93, 10, 32,105,102, 32, 98, 32, 116,104,101,110, 10, 32, 32,114,101,116,117,114,110, 32, 98, 44, 95, 98, 97,115,105, 99, 95, 99,116,121,112,101, 91, 98, 93, 10, 32,101,110,100, 10, 32,114,101,116,117,114,110, 32, 110,105,108, 10,101,110,100, 10, 10, 45, 45, 32,115,112,108, 105,116, 32,115,116,114,105,110,103, 32,117,115,105,110,103, 32, 97, 32,116,111,107,101,110, 10,102,117,110, 99,116,105, 111,110, 32,115,112,108,105,116, 32, 40,115, 44,116, 41, 10, 32,108,111, 99, 97,108, 32,108, 32, 61, 32,123,110, 61, 48, 125, 10, 32,108,111, 99, 97,108, 32,102, 32, 61, 32,102,117, 110, 99,116,105,111,110, 32, 40,115, 41, 10, 32, 32,108, 46, 110, 32, 61, 32,108, 46,110, 32, 43, 32, 49, 10, 32, 32,108, 91,108, 46,110, 93, 32, 61, 32,115, 10, 32, 32,114,101,116, 117,114,110, 32, 34, 34, 10, 32,101,110,100, 10, 32,108,111, 99, 97,108, 32,112, 32, 61, 32, 34, 37,115, 42, 40, 46, 45, 41, 37,115, 42, 34, 46, 46,116, 46, 46, 34, 37,115, 42, 34, 10, 32,115, 32, 61, 32,103,115,117, 98, 40,115, 44, 34, 94, 37,115, 43, 34, 44, 34, 34, 41, 10, 32,115, 32, 61, 32,103, 115,117, 98, 40,115, 44, 34, 37,115, 43, 36, 34, 44, 34, 34, 41, 10, 32,115, 32, 61, 32,103,115,117, 98, 40,115, 44,112, 44,102, 41, 10, 32,108, 46,110, 32, 61, 32,108, 46,110, 32, 43, 32, 49, 10, 32,108, 91,108, 46,110, 93, 32, 61, 32,103, 115,117, 98, 40,115, 44, 34, 40, 37,115, 37,115, 42, 41, 36, 34, 44, 34, 34, 41, 10, 32,114,101,116,117,114,110, 32,108, 10,101,110,100, 10, 10, 45, 45, 32,115,112,108,105,116,115, 32, 97, 32,115,116,114,105,110,103, 32,117,115,105,110,103, 32, 97, 32,112, 97,116,116,101,114,110, 44, 32, 99,111,110, 115,105,100,101,114,105,110,103, 32,116,104,101, 32,115,112, 97, 99,105, 97,108, 32, 99, 97,115,101,115, 32,111,102, 32, 67, 32, 99,111,100,101, 32, 40,116,101,109,112,108, 97,116, 101,115, 44, 32,102,117,110, 99,116,105,111,110, 32,112, 97, 114, 97,109,101,116,101,114,115, 44, 32,101,116, 99, 41, 10, 45, 45, 32,112, 97,116,116,101,114,110, 32, 99, 97,110, 39, 116, 32, 99,111,110,116, 97,105,110, 32,116,104,101, 32, 39, 94, 39, 32, 40, 97,115, 32,117,115,101,100, 32,116,111, 32, 105,100,101,110,116,105,102,121, 32,116,104,101, 32, 98,101, 103,105,110,105,110,103, 32,111,102, 32,116,104,101, 32,108, 105,110,101, 41, 10, 45, 45, 32, 97,108,115,111, 32,115,116, 114,105,112,115, 32,119,104,105,116,101,115,112, 97, 99,101, 10,102,117,110, 99,116,105,111,110, 32,115,112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40,115, 44, 32,112, 97, 116, 41, 10, 10, 9,115, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,115, 44, 32, 34, 94, 37,115, 42, 34, 44, 32, 34, 34, 41, 10, 9,115, 32, 61, 32,115,116,114,105, 110,103, 46,103,115,117, 98, 40,115, 44, 32, 34, 37,115, 42, 36, 34, 44, 32, 34, 34, 41, 10, 10, 9,108,111, 99, 97,108, 32,116,111,107,101,110, 95, 98,101,103,105,110, 32, 61, 32, 49, 10, 9,108,111, 99, 97,108, 32,116,111,107,101,110, 95, 101,110,100, 32, 61, 32, 49, 10, 9,108,111, 99, 97,108, 32, 111,102,115, 32, 61, 32, 49, 10, 9,108,111, 99, 97,108, 32, 114,101,116, 32, 61, 32,123,110, 61, 48,125, 10, 10, 9,102, 117,110, 99,116,105,111,110, 32, 97,100,100, 95,116,111,107, 101,110, 40,111,102,115, 41, 10, 10, 9, 9,108,111, 99, 97, 108, 32,116, 32, 61, 32,115,116,114,105,110,103, 46,115,117, 98, 40,115, 44, 32,116,111,107,101,110, 95, 98,101,103,105, 110, 44, 32,111,102,115, 41, 10, 9, 9,116, 32, 61, 32,115, 116,114,105,110,103, 46,103,115,117, 98, 40,116, 44, 32, 34, 94, 37,115, 42, 34, 44, 32, 34, 34, 41, 10, 9, 9,116, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,116, 44, 32, 34, 37,115, 42, 36, 34, 44, 32, 34, 34, 41, 10, 9, 9,114,101,116, 46,110, 32, 61, 32,114,101,116, 46,110, 32, 43, 32, 49, 10, 9, 9,114,101,116, 91,114,101,116, 46,110, 93, 32, 61, 32,116, 10, 9,101,110,100, 10, 10, 9,119,104, 105,108,101, 32,111,102,115, 32, 60, 61, 32,115,116,114,105, 110,103, 46,108,101,110, 40,115, 41, 32,100,111, 10, 10, 9, 9,108,111, 99, 97,108, 32,115,117, 98, 32, 61, 32,115,116, 114,105,110,103, 46,115,117, 98, 40,115, 44, 32,111,102,115, 44, 32, 45, 49, 41, 10, 9, 9,108,111, 99, 97,108, 32, 98, 44,101, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110, 100, 40,115,117, 98, 44, 32, 34, 94, 34, 46, 46,112, 97,116, 41, 10, 9, 9,105,102, 32, 98, 32,116,104,101,110, 10, 9, 9, 9, 97,100,100, 95,116,111,107,101,110, 40,111,102,115, 45, 49, 41, 10, 9, 9, 9,111,102,115, 32, 61, 32,111,102, 115, 43,101, 10, 9, 9, 9,116,111,107,101,110, 95, 98,101, 103,105,110, 32, 61, 32,111,102,115, 10, 9, 9,101,108,115, 101, 10, 9, 9, 9,108,111, 99, 97,108, 32, 99,104, 97,114, 32, 61, 32,115,116,114,105,110,103, 46,115,117, 98, 40,115, 44, 32,111,102,115, 44, 32,111,102,115, 41, 10, 9, 9, 9, 105,102, 32, 99,104, 97,114, 32, 61, 61, 32, 34, 40, 34, 32, 111,114, 32, 99,104, 97,114, 32, 61, 61, 32, 34, 60, 34, 32, 116,104,101,110, 10, 10, 9, 9, 9, 9,108,111, 99, 97,108, 32, 98,108,111, 99,107, 10, 9, 9, 9, 9,105,102, 32, 99, 104, 97,114, 32, 61, 61, 32, 34, 40, 34, 32,116,104,101,110, 32, 98,108,111, 99,107, 32, 61, 32, 34, 94, 37, 98, 40, 41, 34, 32,101,110,100, 10, 9, 9, 9, 9,105,102, 32, 99,104, 97,114, 32, 61, 61, 32, 34, 60, 34, 32,116,104,101,110, 32, 98,108,111, 99,107, 32, 61, 32, 34, 94, 37, 98, 60, 62, 34, 32,101,110,100, 10, 10, 9, 9, 9, 9, 98, 44,101, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,115,117, 98, 44, 32, 98,108,111, 99,107, 41, 10, 9, 9, 9, 9,105, 102, 32,110,111,116, 32, 98, 32,116,104,101,110, 10, 9, 9, 9, 9, 9, 45, 45, 32,117,110,116,101,114,109,105,110, 97, 116,101,100, 32, 98,108,111, 99,107, 63, 10, 9, 9, 9, 9, 9,111,102,115, 32, 61, 32,111,102,115, 43, 49, 10, 9, 9, 9, 9,101,108,115,101, 10, 9, 9, 9, 9, 9,111,102,115, 32, 61, 32,111,102,115, 32, 43, 32,101, 10, 9, 9, 9, 9, 101,110,100, 10, 10, 9, 9, 9,101,108,115,101, 10, 9, 9, 9, 9,111,102,115, 32, 61, 32,111,102,115, 43, 49, 10, 9, 9, 9,101,110,100, 10, 9, 9,101,110,100, 10, 10, 9,101, 110,100, 10, 9, 97,100,100, 95,116,111,107,101,110, 40,111, 102,115, 41, 10, 9, 45, 45,105,102, 32,114,101,116, 46,110, 32, 61, 61, 32, 48, 32,116,104,101,110, 10, 10, 9, 45, 45, 9,114,101,116, 46,110, 61, 49, 10, 9, 45, 45, 9,114,101, 116, 91, 49, 93, 32, 61, 32, 34, 34, 10, 9, 45, 45,101,110, 100, 10, 10, 9,114,101,116,117,114,110, 32,114,101,116, 10, 10,101,110,100, 10, 10, 45, 45, 32, 99,111,110, 99, 97,116, 101,110, 97,116,101, 32,115,116,114,105,110,103,115, 32,111, 102, 32, 97, 32,116, 97, 98,108,101, 10,102,117,110, 99,116, 105,111,110, 32, 99,111,110, 99, 97,116, 32, 40,116, 44,102, 44,108, 44,106,115,116,114, 41, 10, 9,106,115,116,114, 32, 61, 32,106,115,116,114, 32,111,114, 32, 34, 32, 34, 10, 32, 108,111, 99, 97,108, 32,115, 32, 61, 32, 39, 39, 10, 32,108, 111, 99, 97,108, 32,105, 61,102, 10, 32,119,104,105,108,101, 32,105, 60, 61,108, 32,100,111, 10, 32, 32,115, 32, 61, 32, 115, 46, 46,116, 91,105, 93, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32, 32,105,102, 32,105, 32, 60, 61, 32,108, 32, 116,104,101,110, 32,115, 32, 61, 32,115, 46, 46,106,115,116, 114, 32,101,110,100, 10, 32,101,110,100, 10, 32,114,101,116, 117,114,110, 32,115, 10,101,110,100, 10, 10, 45, 45, 32, 99, 111,110, 99, 97,116,101,110, 97,116,101, 32, 97,108,108, 32, 112, 97,114, 97,109,101,116,101,114,115, 44, 32,102,111,108, 108,111,119,105,110,103, 32,111,117,116,112,117,116, 32,114, 117,108,101,115, 10,102,117,110, 99,116,105,111,110, 32, 99, 111,110, 99, 97,116,112, 97,114, 97,109, 32, 40,108,105,110, 101, 44, 32, 46, 46, 46, 41, 10, 32,108,111, 99, 97,108, 32, 105, 61, 49, 10, 32,119,104,105,108,101, 32,105, 60, 61, 97, 114,103, 46,110, 32,100,111, 10, 32, 32,105,102, 32, 95, 99, 111,110,116, 32, 97,110,100, 32,110,111,116, 32,115,116,114, 102,105,110,100, 40, 95, 99,111,110,116, 44, 39, 91, 37, 40, 44, 34, 93, 39, 41, 32, 97,110,100, 10, 32, 32, 32, 32, 32, 115,116,114,102,105,110,100, 40, 97,114,103, 91,105, 93, 44, 34, 94, 91, 37, 97, 95,126, 93, 34, 41, 32,116,104,101,110, 10, 9, 32, 32, 32, 32,108,105,110,101, 32, 61, 32,108,105, 110,101, 32, 46, 46, 32, 39, 32, 39, 10, 32, 32,101,110,100, 10, 32, 32,108,105,110,101, 32, 61, 32,108,105,110,101, 32, 46, 46, 32, 97,114,103, 91,105, 93, 10, 32, 32,105,102, 32, 97,114,103, 91,105, 93, 32,126, 61, 32, 39, 39, 32,116,104, 101,110, 10, 32, 32, 32, 95, 99,111,110,116, 32, 61, 32,115, 116,114,115,117, 98, 40, 97,114,103, 91,105, 93, 44, 45, 49, 44, 45, 49, 41, 10, 32, 32,101,110,100, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,105,102, 32, 115,116,114,102,105,110,100, 40, 97,114,103, 91, 97,114,103, 46,110, 93, 44, 34, 91, 37, 47, 37, 41, 37, 59, 37,123, 37, 125, 93, 36, 34, 41, 32,116,104,101,110, 10, 32, 32, 95, 99, 111,110,116, 61,110,105,108, 32,108,105,110,101, 32, 61, 32, 108,105,110,101, 32, 46, 46, 32, 39, 92,110, 39, 10, 32,101, 110,100, 10, 9,114,101,116,117,114,110, 32,108,105,110,101, 10,101,110,100, 10, 10, 45, 45, 32,111,117,116,112,117,116, 32,108,105,110,101, 10,102,117,110, 99,116,105,111,110, 32, 111,117,116,112,117,116, 32, 40, 46, 46, 46, 41, 10, 32,108, 111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108,101, 32,105, 60, 61, 97,114,103, 46,110, 32,100,111, 10, 32, 32, 105,102, 32, 95, 99,111,110,116, 32, 97,110,100, 32,110,111, 116, 32,115,116,114,102,105,110,100, 40, 95, 99,111,110,116, 44, 39, 91, 37, 40, 44, 34, 93, 39, 41, 32, 97,110,100, 10, 32, 32, 32, 32, 32,115,116,114,102,105,110,100, 40, 97,114, 103, 91,105, 93, 44, 34, 94, 91, 37, 97, 95,126, 93, 34, 41, 32,116,104,101,110, 10, 9, 32, 32, 32, 32,119,114,105,116, 101, 40, 39, 32, 39, 41, 10, 32, 32,101,110,100, 10, 32, 32, 119,114,105,116,101, 40, 97,114,103, 91,105, 93, 41, 10, 32, 32,105,102, 32, 97,114,103, 91,105, 93, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 32, 32, 95, 99,111,110,116, 32, 61, 32,115,116,114,115,117, 98, 40, 97,114,103, 91,105, 93, 44, 45, 49, 44, 45, 49, 41, 10, 32, 32,101,110,100, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,105,102, 32,115,116,114,102,105,110,100, 40, 97,114,103, 91, 97,114,103, 46,110, 93, 44, 34, 91, 37, 47, 37, 41, 37, 59, 37,123, 37,125, 93, 36, 34, 41, 32,116,104,101,110, 10, 32, 32, 95, 99,111,110,116, 61,110,105,108, 32,119,114,105, 116,101, 40, 39, 92,110, 39, 41, 10, 32,101,110,100, 10,101, 110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,103,101, 116, 95,112,114,111,112,101,114,116,121, 95,109,101,116,104, 111,100,115, 40,112,116,121,112,101, 44, 32,110, 97,109,101, 41, 10, 10, 9,105,102, 32,103,101,116, 95,112,114,111,112, 101,114,116,121, 95,109,101,116,104,111,100,115, 95,104,111, 111,107, 32, 97,110,100, 32,103,101,116, 95,112,114,111,112, 101,114,116,121, 95,109,101,116,104,111,100,115, 95,104,111, 111,107, 40,112,116,121,112,101, 44,110, 97,109,101, 41, 32, 116,104,101,110, 10, 9, 9,114,101,116,117,114,110, 32,103, 101,116, 95,112,114,111,112,101,114,116,121, 95,109,101,116, 104,111,100,115, 95,104,111,111,107, 40,112,116,121,112,101, 44, 32,110, 97,109,101, 41, 10, 9,101,110,100, 10, 10, 9, 105,102, 32,112,116,121,112,101, 32, 61, 61, 32, 34,100,101, 102, 97,117,108,116, 34, 32,116,104,101,110, 32, 45, 45, 32, 103,101,116, 95,110, 97,109,101, 44, 32,115,101,116, 95,110, 97,109,101, 10, 9, 9,114,101,116,117,114,110, 32, 34,103, 101,116, 95, 34, 46, 46,110, 97,109,101, 44, 32, 34,115,101, 116, 95, 34, 46, 46,110, 97,109,101, 10, 9,101,110,100, 10, 10, 9,105,102, 32,112,116,121,112,101, 32, 61, 61, 32, 34, 113,116, 34, 32,116,104,101,110, 32, 45, 45, 32,110, 97,109, 101, 44, 32,115,101,116, 78, 97,109,101, 10, 9, 9,114,101, 116,117,114,110, 32,110, 97,109,101, 44, 32, 34,115,101,116, 34, 46, 46,115,116,114,105,110,103, 46,117,112,112,101,114, 40,115,116,114,105,110,103, 46,115,117, 98, 40,110, 97,109, 101, 44, 32, 49, 44, 32, 49, 41, 41, 46, 46,115,116,114,105, 110,103, 46,115,117, 98, 40,110, 97,109,101, 44, 32, 50, 44, 32, 45, 49, 41, 10, 9,101,110,100, 10, 10, 9,105,102, 32, 112,116,121,112,101, 32, 61, 61, 32, 34,111,118,101,114,108, 111, 97,100, 34, 32,116,104,101,110, 32, 45, 45, 32,110, 97, 109,101, 44, 32,110, 97,109,101, 10, 9, 9,114,101,116,117, 114,110, 32,110, 97,109,101, 44,110, 97,109,101, 10, 9,101, 110,100, 10, 10, 9,114,101,116,117,114,110, 32,110,105,108, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 32,116,104,101, 32,104,111,111,107,115, 10, 10, 45, 45, 32, 99, 97,108,108,101,100, 32,114,105,103, 104,116, 32, 97,102,116,101,114, 32,112,114,111, 99,101,115, 115,105,110,103, 32,116,104,101, 32, 36, 91,105, 99,104,108, 93,102,105,108,101, 32,100,105,114,101, 99,116,105,118,101, 115, 44, 10, 45, 45, 32,114,105,103,104,116, 32, 98,101,102, 111,114,101, 32,112,114,111, 99,101,115,115,105,110,103, 32, 97,110,121,116,104,105,110,103, 32,101,108,115,101, 10, 45, 45, 32,116, 97,107,101,115, 32,116,104,101, 32,112, 97, 99, 107, 97,103,101, 32,111, 98,106,101, 99,116, 32, 97,115, 32, 116,104,101, 32,112, 97,114, 97,109,101,116,101,114, 10,102, 117,110, 99,116,105,111,110, 32,112,114,101,112,114,111, 99, 101,115,115, 95,104,111,111,107, 40,112, 41, 10, 9, 45, 45, 32,112, 46, 99,111,100,101, 32,104, 97,115, 32, 97,108,108, 32,116,104,101, 32,105,110,112,117,116, 32, 99,111,100,101, 32,102,114,111,109, 32,116,104,101, 32,112,107,103, 10,101, 110,100, 10, 10, 10, 45, 45, 32, 99, 97,108,108,101,100, 32, 102,111,114, 32,101,118,101,114,121, 32, 36,105,102,105,108, 101, 32,100,105,114,101, 99,116,105,118,101, 10, 45, 45, 32, 116, 97,107,101,115, 32, 97, 32,116, 97, 98,108,101, 32,119, 105,116,104, 32, 97, 32,115,116,114,105,110,103, 32, 99, 97, 108,108,101,100, 32, 39, 99,111,100,101, 39, 32,105,110,115, 105,100,101, 44, 32,116,104,101, 32,102,105,108,101,110, 97, 109,101, 44, 32, 97,110,100, 32, 97,110,121, 32,101,120,116, 114, 97, 32, 97,114,103,117,109,101,110,116,115, 10, 45, 45, 32,112, 97,115,115,101,100, 32,116,111, 32, 36,105,102,105, 108,101, 46, 32,110,111, 32,114,101,116,117,114,110, 32,118, 97,108,117,101, 10,102,117,110, 99,116,105,111,110, 32,105, 110, 99,108,117,100,101, 95,102,105,108,101, 95,104,111,111, 107, 40,116, 44, 32,102,105,108,101,110, 97,109,101, 44, 32, 46, 46, 46, 41, 10, 10,101,110,100, 10, 10, 45, 45, 32, 99, 97,108,108,101,100, 32, 97,102,116,101,114, 32,112,114,111, 99,101,115,115,105,110,103, 32, 97,110,121,116,104,105,110, 103, 32,116,104, 97,116, 39,115, 32,110,111,116, 32, 99,111, 100,101, 32, 40,108,105,107,101, 32, 39, 36,114,101,110, 97, 109,105,110,103, 39, 44, 32, 99,111,109,109,101,110,116,115, 44, 32,101,116, 99, 41, 10, 45, 45, 32, 97,110,100, 32,114, 105,103,104,116, 32, 98,101,102,111,114,101, 32,112, 97,114, 115,105,110,103, 32,116,104,101, 32, 97, 99,116,117, 97,108, 32, 99,111,100,101, 46, 10, 45, 45, 32,116, 97,107,101,115, 32,116,104,101, 32, 80, 97, 99,107, 97,103,101, 32,111, 98, 106,101, 99,116, 32,119,105,116,104, 32, 97,108,108, 32,116, 104,101, 32, 99,111,100,101, 32,111,110, 32,116,104,101, 32, 39, 99,111,100,101, 39, 32,107,101,121, 46, 32,110,111, 32, 114,101,116,117,114,110, 32,118, 97,108,117,101, 10,102,117, 110, 99,116,105,111,110, 32,112,114,101,112, 97,114,115,101, 95,104,111,111,107, 40,112, 97, 99,107, 97,103,101, 41, 10, 10,101,110,100, 10, 10, 45, 45, 32, 99, 97,108,108,101,100, 32, 98,101,102,111,114,101, 32,115,116, 97,114,116,105,110, 103, 32,111,117,116,112,117,116, 10,102,117,110, 99,116,105, 111,110, 32,112,114,101, 95,111,117,116,112,117,116, 95,104, 111,111,107, 40,112, 97, 99,107, 97,103,101, 41, 10, 10,101, 110,100, 10, 10, 45, 45, 32, 99, 97,108,108,101,100, 32, 97, 102,116,101,114, 32,119,114,105,116,105,110,103, 32, 97,108, 108, 32,116,104,101, 32,111,117,116,112,117,116, 46, 10, 45, 45, 32,116, 97,107,101,115, 32,116,104,101, 32, 80, 97, 99, 107, 97,103,101, 32,111, 98,106,101, 99,116, 10,102,117,110, 99,116,105,111,110, 32,112,111,115,116, 95,111,117,116,112, 117,116, 95,104,111,111,107, 40,112, 97, 99,107, 97,103,101, 41, 10, 10,101,110,100, 10, 10, 10, 45, 45, 32, 99, 97,108, 108,101,100, 32,102,114,111,109, 32, 39,103,101,116, 95,112, 114,111,112,101,114,116,121, 95,109,101,116,104,111,100,115, 39, 32,116,111, 32,103,101,116, 32,116,104,101, 32,109,101, 116,104,111,100,115, 32,116,111, 32,114,101,116,114,105,101, 118,101, 32, 97, 32,112,114,111,112,101,114,116,121, 10, 45, 45, 32, 97, 99, 99,111,114,100,105,110,103, 32,116,111, 32, 105,116,115, 32,116,121,112,101, 10,102,117,110, 99,116,105, 111,110, 32,103,101,116, 95,112,114,111,112,101,114,116,121, 95,109,101,116,104,111,100,115, 95,104,111,111,107, 40,112, 114,111,112,101,114,116,121, 95,116,121,112,101, 44, 32,110, 97,109,101, 41, 10, 10,101,110,100, 10, 10, 45, 45, 32, 99, 97,108,108,101,100, 32,102,114,111,109, 32, 67,108, 97,115, 115, 67,111,110,116, 97,105,110,101,114, 58,100,111,112, 97, 114,115,101, 32,119,105,116,104, 32,116,104,101, 32,115,116, 114,105,110,103, 32, 98,101,105,110,103, 32,112, 97,114,115, 101,100, 10, 45, 45, 32,114,101,116,117,114,110, 32,110,105, 108, 44, 32,111,114, 32, 97, 32,115,117, 98,115,116,114,105, 110,103, 10,102,117,110, 99,116,105,111,110, 32,112, 97,114, 115,101,114, 95,104,111,111,107, 40,115, 41, 10, 10, 9,114, 101,116,117,114,110, 32,110,105,108, 10,101,110,100, 10, 10, 45, 45, 32, 99, 97,108,108,101,100, 32,102,114,111,109, 32, 99,108, 97,115,115, 70,117,110, 99,116,105,111,110, 58,115, 117,112, 99,111,100,101, 44, 32, 98,101,102,111,114,101, 32, 116,104,101, 32, 99, 97,108,108, 32,116,111, 32,116,104,101, 32,102,117,110, 99,116,105,111,110, 32,105,115, 32,111,117, 116,112,117,116, 10,102,117,110, 99,116,105,111,110, 32,112, 114,101, 95, 99, 97,108,108, 95,104,111,111,107, 40,102, 41, 10, 10,101,110,100, 10, 10, 45, 45, 32, 99, 97,108,108,101, 100, 32,102,114,111,109, 32, 99,108, 97,115,115, 70,117,110, 99,116,105,111,110, 58,115,117,112, 99,111,100,101, 44, 32, 97,102,116,101,114, 32,116,104,101, 32, 99, 97,108,108, 32, 116,111, 32,116,104,101, 32,102,117,110, 99,116,105,111,110, 32,105,115, 32,111,117,116,112,117,116, 10,102,117,110, 99, 116,105,111,110, 32,112,111,115,116, 95, 99, 97,108,108, 95, 104,111,111,107, 40,102, 41, 10, 10,101,110,100, 10, 10, 45, 45, 32, 99, 97,108,108,101,100, 32, 98,101,102,111,114,101, 32,116,104,101, 32,114,101,103,105,115,116,101,114, 32, 99, 111,100,101, 32,105,115, 32,111,117,116,112,117,116, 10,102, 117,110, 99,116,105,111,110, 32,112,114,101, 95,114,101,103, 105,115,116,101,114, 95,104,111,111,107, 40,112, 97, 99,107, 97,103,101, 41, 10, 10,101,110,100, 10, 10, 45, 45, 32, 99, 97,108,108,101,100, 32,116,111, 32,111,117,116,112,117,116, 32, 97,110, 32,101,114,114,111,114, 32,109,101,115,115, 97, 103,101, 10,102,117,110, 99,116,105,111,110, 32,111,117,116, 112,117,116, 95,101,114,114,111,114, 95,104,111,111,107, 40, 46, 46, 46, 41, 10, 9,114,101,116,117,114,110, 32,115,116, 114,105,110,103, 46,102,111,114,109, 97,116, 40, 46, 46, 46, 41, 10,101,110,100, 10, 10, 45, 45, 32, 99,117,115,116,111, 109, 32,112,117,115,104,101,114,115, 10, 10, 95,112,117,115, 104, 95,102,117,110, 99,116,105,111,110,115, 32, 61, 32,123, 125, 10, 95,105,115, 95,102,117,110, 99,116,105,111,110,115, 32, 61, 32,123,125, 10, 95,116,111, 95,102,117,110, 99,116, 105,111,110,115, 32, 61, 32,123,125, 10, 10, 95, 98, 97,115, 101, 95,112,117,115,104, 95,102,117,110, 99,116,105,111,110, 115, 32, 61, 32,123,125, 10, 95, 98, 97,115,101, 95,105,115, 95,102,117,110, 99,116,105,111,110,115, 32, 61, 32,123,125, 10, 95, 98, 97,115,101, 95,116,111, 95,102,117,110, 99,116, 105,111,110,115, 32, 61, 32,123,125, 10, 10,108,111, 99, 97, 108, 32,102,117,110, 99,116,105,111,110, 32,115,101, 97,114, 99,104, 95, 98, 97,115,101, 40,116, 44, 32,102,117,110, 99, 115, 41, 10, 10, 9,108,111, 99, 97,108, 32, 99,108, 97,115, 115, 32, 61, 32, 95,103,108,111, 98, 97,108, 95, 99,108, 97, 115,115,101,115, 91,116, 93, 10, 10, 9,119,104,105,108,101, 32, 99,108, 97,115,115, 32,100,111, 10, 9, 9,105,102, 32, 102,117,110, 99,115, 91, 99,108, 97,115,115, 46,116,121,112, 101, 93, 32,116,104,101,110, 10, 9, 9, 9,114,101,116,117, 114,110, 32,102,117,110, 99,115, 91, 99,108, 97,115,115, 46, 116,121,112,101, 93, 10, 9, 9,101,110,100, 10, 9, 9, 99, 108, 97,115,115, 32, 61, 32, 95,103,108,111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91, 99,108, 97,115,115, 46, 98, 116,121,112,101, 93, 10, 9,101,110,100, 10, 9,114,101,116, 117,114,110, 32,110,105,108, 10,101,110,100, 10, 10,102,117, 110, 99,116,105,111,110, 32,103,101,116, 95,112,117,115,104, 95,102,117,110, 99,116,105,111,110, 40,116, 41, 10, 9,114, 101,116,117,114,110, 32, 95,112,117,115,104, 95,102,117,110, 99,116,105,111,110,115, 91,116, 93, 32,111,114, 32,115,101, 97,114, 99,104, 95, 98, 97,115,101, 40,116, 44, 32, 95, 98, 97,115,101, 95,112,117,115,104, 95,102,117,110, 99,116,105, 111,110,115, 41, 32,111,114, 32, 34,116,111,108,117, 97, 95, 112,117,115,104,117,115,101,114,116,121,112,101, 34, 10,101, 110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,103,101, 116, 95,116,111, 95,102,117,110, 99,116,105,111,110, 40,116, 41, 10, 9,114,101,116,117,114,110, 32, 95,116,111, 95,102, 117,110, 99,116,105,111,110,115, 91,116, 93, 32,111,114, 32, 115,101, 97,114, 99,104, 95, 98, 97,115,101, 40,116, 44, 32, 95, 98, 97,115,101, 95,116,111, 95,102,117,110, 99,116,105, 111,110,115, 41, 32,111,114, 32, 34,116,111,108,117, 97, 95, 116,111,117,115,101,114,116,121,112,101, 34, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,103,101,116, 95, 105,115, 95,102,117,110, 99,116,105,111,110, 40,116, 41, 10, 9,114,101,116,117,114,110, 32, 95,105,115, 95,102,117,110, 99,116,105,111,110,115, 91,116, 93, 32,111,114, 32,115,101, 97,114, 99,104, 95, 98, 97,115,101, 40,116, 44, 32, 95, 98, 97,115,101, 95,105,115, 95,102,117,110, 99,116,105,111,110, 115, 41, 32,111,114, 32, 34,116,111,108,117, 97, 95,105,115, 117,115,101,114,116,121,112,101, 34, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/basic.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32, 97, 98,115,116,114, 97, 99,116, 32,102,101, 97,116,117,114,101, 32, 99,108, 97, 115,115, 10, 45, 45, 32, 87,114,105,116,116,101,110, 32, 98, 121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101, 115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111,100,101, 32,105,115, 32, 102,114,101,101, 32,115,111,102,116,119, 97,114,101, 59, 32, 121,111,117, 32, 99, 97,110, 32,114,101,100,105,115,116,114, 105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116,119, 97,114,101, 32,112,114, 111,118,105,100,101,100, 32,104,101,114,101,117,110,100,101, 114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32, 105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97,117,116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105,103, 97,116,105,111, 110, 32,116,111, 32,112,114,111,118,105,100,101, 32,109, 97, 105,110,116,101,110, 97,110, 99,101, 44, 32,115,117,112,112, 111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101,109,101,110,116,115, 44, 32,111,114, 32,109,111,100,105,102,105, 99, 97,116,105,111, 110,115, 46, 10, 10, 10, 45, 45, 32, 70,101, 97,116,117,114, 101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114, 101,115,101,110,116,115, 32,116,104,101, 32, 98, 97,115,101, 32, 99,108, 97,115,115, 32,111,102, 32, 97,108,108, 32,109, 97,112,112,101,100, 32,102,101, 97,116,117,114,101, 46, 10, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 32, 61, 32, 123, 10,125, 10, 99,108, 97,115,115, 70,101, 97,116,117,114, 101, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97, 115,115, 70,101, 97,116,117,114,101, 10, 10, 45, 45, 32,119, 114,105,116,101, 32,115,117,112,112,111,114,116, 32, 99,111, 100,101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97, 115,115, 70,101, 97,116,117,114,101, 58,115,117,112, 99,111, 100,101, 32, 40, 41, 10,101,110,100, 10, 10, 45, 45, 32,111, 117,116,112,117,116, 32,116, 97,103, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 70,101, 97,116,117,114, 101, 58,100,101, 99,108,116,121,112,101, 32, 40, 41, 10,101, 110,100, 10, 10, 45, 45, 32,114,101,103,105,115,116,101,114, 32,102,101, 97,116,117,114,101, 10,102,117,110, 99,116,105, 111,110, 32, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 58,114,101,103,105,115,116,101,114, 32, 40,112,114,101, 41, 10,101,110,100, 10, 10, 45, 45, 32,116,114, 97,110,115,108, 97,116,101, 32,118,101,114, 98, 97,116,105,109, 10,102,117, 110, 99,116,105,111,110, 32, 99,108, 97,115,115, 70,101, 97, 116,117,114,101, 58,112,114,101, 97,109, 98,108,101, 32, 40, 41, 10,101,110,100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32,105,116, 32,105,115, 32, 97, 32,118, 97,114, 105, 97, 98,108,101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 58,105,115, 118, 97,114,105, 97, 98,108,101, 32, 40, 41, 10, 32,114,101, 116,117,114,110, 32,102, 97,108,115,101, 10,101,110,100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32,105,116, 32,114,101,113,117,105,114,101,115, 32, 99,111,108,108,101, 99,116,105,111,110, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 58,114,101, 113,117,105,114,101, 99,111,108,108,101, 99,116,105,111,110, 32, 40,116, 41, 10, 32,114,101,116,117,114,110, 32,102, 97, 108,115,101, 10,101,110,100, 10, 10, 45, 45, 32, 98,117,105, 108,100, 32,110, 97,109,101,115, 10,102,117,110, 99,116,105, 111,110, 32, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 58, 98,117,105,108,100,110, 97,109,101,115, 32, 40, 41, 10, 32,105,102, 32,115,101,108,102, 46,110, 97,109,101, 32, 97, 110,100, 32,115,101,108,102, 46,110, 97,109,101,126, 61, 39, 39, 32,116,104,101,110, 10, 32, 32,108,111, 99, 97,108, 32, 110, 32, 61, 32,115,112,108,105,116, 40,115,101,108,102, 46, 110, 97,109,101, 44, 39, 64, 39, 41, 10, 32, 32,115,101,108, 102, 46,110, 97,109,101, 32, 61, 32,110, 91, 49, 93, 10, 32, 32,115,101,108,102, 46,110, 97,109,101, 32, 61, 32,115,116, 114,105,110,103, 46,103,115,117, 98, 40,115,101,108,102, 46, 110, 97,109,101, 44, 32, 34, 58, 37,100, 42, 36, 34, 44, 32, 34, 34, 41, 10, 32, 32,105,102, 32,110,111,116, 32,110, 91, 50, 93, 32,116,104,101,110, 10, 32, 32, 32,110, 91, 50, 93, 32, 61, 32, 97,112,112,108,121,114,101,110, 97,109,105,110, 103, 40,110, 91, 49, 93, 41, 10, 32, 32,101,110,100, 10, 32, 32,115,101,108,102, 46,108,110, 97,109,101, 32, 61, 32,110, 91, 50, 93, 32,111,114, 32,103,115,117, 98, 40,110, 91, 49, 93, 44, 34, 37, 91, 46, 45, 37, 93, 34, 44, 34, 34, 41, 10, 32, 32,115,101,108,102, 46,108,110, 97,109,101, 32, 61, 32, 115,116,114,105,110,103, 46,103,115,117, 98, 40,115,101,108, 102, 46,108,110, 97,109,101, 44, 32, 34, 58, 37,100, 42, 36, 34, 44, 32, 34, 34, 41, 10, 32, 32,115,101,108,102, 46,111, 114,105,103,105,110, 97,108, 95,110, 97,109,101, 32, 61, 32, 115,101,108,102, 46,110, 97,109,101, 10, 32, 32,115,101,108, 102, 46,108,110, 97,109,101, 32, 61, 32, 99,108,101, 97,110, 95,116,101,109,112,108, 97,116,101, 40,115,101,108,102, 46, 108,110, 97,109,101, 41, 10, 32,101,110,100, 10, 32,105,102, 32,110,111,116, 32,115,101,108,102, 46,105,115, 95,112, 97, 114, 97,109,101,116,101,114, 32,116,104,101,110, 10, 9, 32, 115,101,108,102, 46,110, 97,109,101, 32, 61, 32,103,101,116, 111,110,108,121,110, 97,109,101,115,112, 97, 99,101, 40, 41, 32, 46, 46, 32,115,101,108,102, 46,110, 97,109,101, 10, 32, 101,110,100, 10, 10, 32,108,111, 99, 97,108, 32,112, 97,114, 101,110,116, 32, 61, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 10, 32,105,102, 32, 112, 97,114,101,110,116, 32,116,104,101,110, 10, 32, 9,115, 101,108,102, 46, 97, 99, 99,101,115,115, 32, 61, 32,112, 97, 114,101,110,116, 46, 99,117,114,114, 95,109,101,109, 98,101, 114, 95, 97, 99, 99,101,115,115, 10, 9,115,101,108,102, 46, 103,108,111, 98, 97,108, 95, 97, 99, 99,101,115,115, 32, 61, 32,115,101,108,102, 58, 99,104,101, 99,107, 95,112,117, 98, 108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 10, 32,101, 108,115,101, 10, 32,101,110,100, 10,101,110,100, 10, 10,102, 117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 58, 99,104,101, 99,107, 95,112,117, 98, 108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 10, 10, 9, 105,102, 32,116,121,112,101, 40,115,101,108,102, 46,103,108, 111, 98, 97,108, 95, 97, 99, 99,101,115,115, 41, 32, 61, 61, 32, 34, 98,111,111,108,101, 97,110, 34, 32,116,104,101,110, 10, 9, 9,114,101,116,117,114,110, 32,115,101,108,102, 46, 103,108,111, 98, 97,108, 95, 97, 99, 99,101,115,115, 10, 9, 101,110,100, 10, 10, 9,105,102, 32,115,101,108,102, 46, 97, 99, 99,101,115,115, 32, 97,110,100, 32,115,101,108,102, 46, 97, 99, 99,101,115,115, 32,126, 61, 32, 48, 32,116,104,101, 110, 10, 9, 9,114,101,116,117,114,110, 32,102, 97,108,115, 101, 10, 9,101,110,100, 10, 10, 9,108,111, 99, 97,108, 32, 112, 97,114,101,110,116, 32, 61, 32, 99,108, 97,115,115, 67, 111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 10, 9, 119,104,105,108,101, 32,112, 97,114,101,110,116, 32,100,111, 10, 9, 9,105,102, 32,112, 97,114,101,110,116, 46, 97, 99, 99,101,115,115, 32, 97,110,100, 32,112, 97,114,101,110,116, 46, 97, 99, 99,101,115,115, 32,126, 61, 32, 48, 32,116,104, 101,110, 10, 9, 9, 9,114,101,116,117,114,110, 32,102, 97, 108,115,101, 10, 9, 9,101,110,100, 10, 9, 9,112, 97,114, 101,110,116, 32, 61, 32,112, 97,114,101,110,116, 46,112,114, 111,120, 10, 9,101,110,100, 10, 9,114,101,116,117,114,110, 32,116,114,117,101, 10,101,110,100, 10, 10,102,117,110, 99, 116,105,111,110, 32, 99,108,101, 97,110, 95,116,101,109,112, 108, 97,116,101, 40,116, 41, 10, 10, 9,114,101,116,117,114, 110, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,116, 44, 32, 34, 91, 60, 62, 58, 44, 32, 37, 42, 93, 34, 44, 32, 34, 95, 34, 41, 10,101,110,100, 10, 10, 45, 45, 32, 99,104, 101, 99,107, 32,105,102, 32,102,101, 97,116,117,114,101, 32, 105,115, 32,105,110,115,105,100,101, 32, 97, 32, 99,111,110, 116, 97,105,110,101,114, 32,100,101,102,105,110,105,116,105, 111,110, 10, 45, 45, 32,105,116, 32,114,101,116,117,114,110, 115, 32,116,104,101, 32, 99,111,110,116, 97,105,110,101,114, 32, 99,108, 97,115,115, 32,110, 97,109,101, 32,111,114, 32, 110,105,108, 46, 10,102,117,110, 99,116,105,111,110, 32, 99, 108, 97,115,115, 70,101, 97,116,117,114,101, 58,105,110, 99, 111,110,116, 97,105,110,101,114, 32, 40,119,104,105, 99,104, 41, 10, 32,105,102, 32,115,101,108,102, 46,112, 97,114,101, 110,116, 32,116,104,101,110, 10, 32, 32,108,111, 99, 97,108, 32,112, 97,114,101,110,116, 32, 61, 32,115,101,108,102, 46, 112, 97,114,101,110,116, 10, 32, 32,119,104,105,108,101, 32, 112, 97,114,101,110,116, 32,100,111, 10, 32, 32, 32,105,102, 32,112, 97,114,101,110,116, 46, 99,108, 97,115,115,116,121, 112,101, 32, 61, 61, 32,119,104,105, 99,104, 32,116,104,101, 110, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,112, 97, 114,101,110,116, 46,110, 97,109,101, 10, 32, 32, 32,101,110, 100, 10, 32, 32, 32,112, 97,114,101,110,116, 32, 61, 32,112, 97,114,101,110,116, 46,112, 97,114,101,110,116, 10, 32, 32, 101,110,100, 10, 32,101,110,100, 10, 32,114,101,116,117,114, 110, 32,110,105,108, 10,101,110,100, 10, 10,102,117,110, 99, 116,105,111,110, 32, 99,108, 97,115,115, 70,101, 97,116,117, 114,101, 58,105,110, 99,108, 97,115,115, 32, 40, 41, 10, 32, 114,101,116,117,114,110, 32,115,101,108,102, 58,105,110, 99, 111,110,116, 97,105,110,101,114, 40, 39, 99,108, 97,115,115, 39, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 58, 105,110,109,111,100,117,108,101, 32, 40, 41, 10, 32,114,101, 116,117,114,110, 32,115,101,108,102, 58,105,110, 99,111,110, 116, 97,105,110,101,114, 40, 39,109,111,100,117,108,101, 39, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 58,105, 110,110, 97,109,101,115,112, 97, 99,101, 32, 40, 41, 10, 32, 114,101,116,117,114,110, 32,115,101,108,102, 58,105,110, 99, 111,110,116, 97,105,110,101,114, 40, 39,110, 97,109,101,115, 112, 97, 99,101, 39, 41, 10,101,110,100, 10, 10, 45, 45, 32, 114,101,116,117,114,110, 32, 67, 32, 98,105,110,100,105,110, 103, 32,102,117,110, 99,116,105,111,110, 32,110, 97,109,101, 32, 98, 97,115,101,100, 32,111,110, 32,110, 97,109,101, 10, 45, 45, 32,116,104,101, 32, 99,108,105,101,110,116, 32,115, 112,101, 99,105,102,105,101,115, 32, 97, 32,112,114,101,102, 105,120, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97, 115,115, 70,101, 97,116,117,114,101, 58, 99,102,117,110, 99, 110, 97,109,101, 32, 40,110, 41, 10, 10, 32,105,102, 32,115, 101,108,102, 46,112, 97,114,101,110,116, 32,116,104,101,110, 10, 32, 32,110, 32, 61, 32,115,101,108,102, 46,112, 97,114, 101,110,116, 58, 99,102,117,110, 99,110, 97,109,101, 40,110, 41, 10, 32,101,110,100, 10, 10, 32,108,111, 99, 97,108, 32, 102,110, 97,109,101, 32, 61, 32,115,101,108,102, 46,108,110, 97,109,101, 10, 32,105,102, 32,110,111,116, 32,102,110, 97, 109,101, 32,111,114, 32,102,110, 97,109,101, 32, 61, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 9,102,110, 97,109,101, 32, 61, 32,115,101,108,102, 46,110, 97,109,101, 10, 32,101, 110,100, 10, 32, 32,110, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,110, 46, 46, 39, 95, 39, 46, 46, 32, 40,102,110, 97,109,101, 41, 44, 32, 34, 91, 60, 62, 58, 44, 32, 92, 46, 37, 42, 38, 93, 34, 44, 32, 34, 95, 34, 41, 10, 10, 32, 32,114,101,116,117,114,110, 32,110, 10,101,110,100, 32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/feature.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,118,101,114, 98, 97, 116,105,109, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114, 105,116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73, 100, 58, 32,118,101,114, 98, 97,116,105,109, 46,108,117, 97, 44,118, 32, 49, 46, 51, 32, 50, 48, 48, 48, 47, 48, 49, 47, 50, 52, 32, 50, 48, 58, 52, 49, 58, 49, 54, 32, 99,101,108, 101,115, 32, 69,120,112, 32, 36, 10, 10, 45, 45, 32, 84,104, 105,115, 32, 99,111,100,101, 32,105,115, 32,102,114,101,101, 32,115,111,102,116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101,100,105,115,116,114,105, 98,117,116, 101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100, 105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32, 115,111,102,116,119, 97,114,101, 32,112,114,111,118,105,100, 101,100, 32,104,101,114,101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116, 104,101, 32, 97,117,116,104,111,114, 32,104, 97,115, 32,110, 111, 32,111, 98,108,105,103, 97,116,105,111,110, 32,116,111, 32,112,114,111,118,105,100,101, 32,109, 97,105,110,116,101, 110, 97,110, 99,101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110, 104, 97,110, 99,101,109,101,110,116,115, 44, 32,111,114, 32, 109,111,100,105,102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 10, 45, 45, 32, 86,101,114, 98, 97,116,105,109, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101,115, 101,110,116,115, 32, 97, 32,108,105,110,101, 32,116,114, 97, 110,115,108, 97,116,101,100, 32,100,105,114,101, 99,116,101, 100, 32,116,111, 32,116,104,101, 32, 98,105,110,100,105,110, 103, 32,102,105,108,101, 46, 10, 45, 45, 32, 84,104,101, 32, 102,111,108,108,111,119,105,110,103, 32,102,105,108,100,115, 32, 97,114,101, 32,115,116,111,114,101,100, 58, 10, 45, 45, 32, 32, 32,108,105,110,101, 32, 61, 32,108,105,110,101, 32, 116,101,120,116, 10, 99,108, 97,115,115, 86,101,114, 98, 97, 116,105,109, 32, 61, 32,123, 10, 32,108,105,110,101, 32, 61, 32, 39, 39, 44, 10, 9, 99,111,110,100, 32, 61, 32,110,105, 108, 44, 32, 32, 32, 32, 45, 45, 32, 99,111,110,100,105,116, 105,111,110, 58, 32,119,104,101,114,101, 32,116,111, 32,103, 101,110,101,114, 97,116,101, 32,116,104,101, 32, 99,111,100, 101, 32, 40,115, 61,115,117,112,111,114,116, 44, 32,114, 61, 114,101,103,105,115,116,101,114, 41, 10,125, 10, 99,108, 97, 115,115, 86,101,114, 98, 97,116,105,109, 46, 95, 95,105,110, 100,101,120, 32, 61, 32, 99,108, 97,115,115, 86,101,114, 98, 97,116,105,109, 10,115,101,116,109,101,116, 97,116, 97, 98, 108,101, 40, 99,108, 97,115,115, 86,101,114, 98, 97,116,105, 109, 44, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 41, 10, 10, 45, 45, 32,112,114,101, 97,109, 98,108,101, 32,118, 101,114, 98, 97,116,105,109, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 86,101,114, 98, 97,116,105,109, 58,112,114,101, 97,109, 98,108,101, 32, 40, 41, 10, 32,105, 102, 32,115,101,108,102, 46, 99,111,110,100, 32, 61, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 32,119,114,105,116,101, 40,115,101,108,102, 46,108,105,110,101, 41, 10, 32,101,110, 100, 10,101,110,100, 10, 10, 45, 45, 32,115,117,112,112,111, 114,116, 32, 99,111,100,101, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 86,101,114, 98, 97,116,105,109, 58,115,117,112, 99,111,100,101, 32, 40, 41, 10, 32,105,102, 32,115,116,114,102,105,110,100, 40,115,101,108,102, 46, 99, 111,110,100, 44, 39,115, 39, 41, 32,116,104,101,110, 10, 32, 32,119,114,105,116,101, 40,115,101,108,102, 46,108,105,110, 101, 41, 10, 32, 32,119,114,105,116,101, 40, 39, 92,110, 39, 41, 10, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 114,101,103,105,115,116,101,114, 32, 99,111,100,101, 10,102, 117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 86,101, 114, 98, 97,116,105,109, 58,114,101,103,105,115,116,101,114, 32, 40,112,114,101, 41, 10, 32,105,102, 32,115,116,114,102, 105,110,100, 40,115,101,108,102, 46, 99,111,110,100, 44, 39, 114, 39, 41, 32,116,104,101,110, 10, 32, 32,119,114,105,116, 101, 40,115,101,108,102, 46,108,105,110,101, 41, 10, 32,101, 110,100, 10,101,110,100, 10, 10, 10, 45, 45, 32, 80,114,105, 110,116, 32,109,101,116,104,111,100, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 86,101,114, 98, 97,116, 105,109, 58,112,114,105,110,116, 32, 40,105,100,101,110,116, 44, 99,108,111,115,101, 41, 10, 32,112,114,105,110,116, 40, 105,100,101,110,116, 46, 46, 34, 86,101,114, 98, 97,116,105, 109,123, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101, 110,116, 46, 46, 34, 32,108,105,110,101, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,108,105,110,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110, 116, 46, 46, 34,125, 34, 46, 46, 99,108,111,115,101, 41, 10, 101,110,100, 10, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99,111,110,115,116,114,117, 99,116,111,114, 10, 102,117,110, 99,116,105,111,110, 32, 95, 86,101,114, 98, 97, 116,105,109, 32, 40,116, 41, 10, 32,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40,116, 44, 99,108, 97,115,115, 86, 101,114, 98, 97,116,105,109, 41, 10, 32, 97,112,112,101,110, 100, 40,116, 41, 10, 32,114,101,116,117,114,110, 32,116, 10, 101,110,100, 10, 10, 45, 45, 32, 67,111,110,115,116,114,117, 99,116,111,114, 10, 45, 45, 32, 69,120,112,101, 99,116,115, 32, 97, 32,115,116,114,105,110,103, 32,114,101,112,114,101, 115,101,110,116,105,110,103, 32,116,104,101, 32,116,101,120, 116, 32,108,105,110,101, 10,102,117,110, 99,116,105,111,110, 32, 86,101,114, 98, 97,116,105,109, 32, 40,108, 44, 99,111, 110,100, 41, 10, 32,105,102, 32,115,116,114,115,117, 98, 40, 108, 44, 49, 44, 49, 41, 32, 61, 61, 32, 34, 39, 34, 32,116, 104,101,110, 10, 32, 32,108, 32, 61, 32,115,116,114,115,117, 98, 40,108, 44, 50, 41, 10, 32,101,108,115,101,105,102, 32, 115,116,114,115,117, 98, 40,108, 44, 49, 44, 49, 41, 32, 61, 61, 32, 39, 36, 39, 32,116,104,101,110, 10, 32, 32, 99,111, 110,100, 32, 61, 32, 39,115,114, 39, 32, 32, 32, 32, 32, 32, 32, 45, 45, 32,103,101,110,101,114, 97,116,101,115, 32,105, 110, 32, 98,111,116,104, 32,115,117,112,111,114,116, 32, 97, 110,100, 32,114,101,103,105,115,116,101,114, 32,102,114, 97, 103,109,101,110,116,115, 10, 32, 32,108, 32, 61, 32,115,116, 114,115,117, 98, 40,108, 44, 50, 41, 10, 32,101,110,100, 10, 32,114,101,116,117,114,110, 32, 95, 86,101,114, 98, 97,116, 105,109, 32,123, 10, 32, 32,108,105,110,101, 32, 61, 32,108, 44, 10, 32, 32, 99,111,110,100, 32, 61, 32, 99,111,110,100, 32,111,114, 32, 39, 39, 44, 10, 32,125, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/verbatim.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32, 99,111,100,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114,105,116,116,101, 110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67, 101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 57, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111,100,101, 32, 105,115, 32,102,114,101,101, 32,115,111,102,116,119, 97,114, 101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101,100,105, 115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116,119, 97,114,101, 32,112,114,111,118,105,100,101,100, 32,104,101,114,101,117, 110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97, 110,100, 10, 45, 45, 32,116,104,101, 32, 97,117,116,104,111, 114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105,103, 97, 116,105,111,110, 32,116,111, 32,112,114,111,118,105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32,115, 117,112,112,111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101,109,101,110, 116,115, 44, 32,111,114, 32,109,111,100,105,102,105, 99, 97, 116,105,111,110,115, 46, 10, 10, 45, 45, 32,103,108,111, 98, 97,108, 10, 99,111,100,101, 95,110, 32, 61, 32, 49, 10, 10, 45, 45, 32, 67,111,100,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101,115,101,110,116,115, 32, 76,117, 97, 32, 99,111,100,101, 32,116,111, 32, 98,101, 32, 99,111, 109,112,105,108,101,100, 32, 97,110,100, 32,105,110, 99,108, 117,100,101,100, 10, 45, 45, 32,105,110, 32,116,104,101, 32, 105,110,105,116,105, 97,108,105,122, 97,116,105,111,110, 32, 102,117,110, 99,116,105,111,110, 46, 10, 45, 45, 32, 84,104, 101, 32,102,111,108,108,111,119,105,110,103, 32,102,105,101, 108,100,115, 32, 97,114,101, 32,115,116,111,114,101,100, 58, 10, 45, 45, 32, 32, 32,116,101,120,116, 32, 61, 32,116,101, 120,116, 32, 99,111,100,101, 10, 99,108, 97,115,115, 67,111, 100,101, 32, 61, 32,123, 10, 32,116,101,120,116, 32, 61, 32, 39, 39, 44, 10,125, 10, 99,108, 97,115,115, 67,111,100,101, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97,115, 115, 67,111,100,101, 10,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40, 99,108, 97,115,115, 67,111,100,101, 44, 99, 108, 97,115,115, 70,101, 97,116,117,114,101, 41, 10, 10, 45, 45, 32,114,101,103,105,115,116,101,114, 32, 99,111,100,101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67,111,100,101, 58,114,101,103,105,115,116,101,114, 32, 40, 112,114,101, 41, 10, 32,112,114,101, 32, 61, 32,112,114,101, 32,111,114, 32, 39, 39, 10, 32, 45, 45, 32, 99,108,101, 97, 110, 32, 76,117, 97, 32, 99,111,100,101, 10, 32,108,111, 99, 97,108, 32,115, 32, 61, 32, 99,108,101, 97,110, 40,115,101, 108,102, 46,116,101,120,116, 41, 10, 32,105,102, 32,110,111, 116, 32,115, 32,116,104,101,110, 10, 32, 32, 45, 45,112,114, 105,110,116, 40,115,101,108,102, 46,116,101,120,116, 41, 10, 32, 32,101,114,114,111,114, 40, 34,112, 97,114,115,101,114, 32,101,114,114,111,114, 32,105,110, 32,101,109, 98,101,100, 100,101,100, 32, 99,111,100,101, 34, 41, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,103,101,116, 32,102,105,114,115,116, 32,108,105,110,101, 10, 32,108,111, 99, 97,108, 32, 95, 44, 32, 95, 44, 32,102,105,114,115,116, 95,108,105,110,101, 61, 115,116,114,105,110,103, 46,102,105,110,100, 40,115,101,108, 102, 46,116,101,120,116, 44, 32, 34, 94, 40, 91, 94, 92,110, 92,114, 93, 42, 41, 34, 41, 10, 32,105,102, 32,115,116,114, 105,110,103, 46,102,105,110,100, 40,102,105,114,115,116, 95, 108,105,110,101, 44, 32, 34, 94, 37,115, 42, 37, 45, 37, 45, 34, 41, 32,116,104,101,110, 10, 9, 32,105,102, 32,115,116, 114,105,110,103, 46,102,105,110,100, 40,102,105,114,115,116, 95,108,105,110,101, 44, 32, 34, 94, 37, 45, 37, 45, 35, 35, 34, 41, 32,116,104,101,110, 10, 9, 9,102,105,114,115,116, 95,108,105,110,101, 32, 61, 32,115,116,114,105,110,103, 46, 103,115,117, 98, 40,102,105,114,115,116, 95,108,105,110,101, 44, 32, 34, 94, 37, 45, 37, 45, 35, 35, 34, 44, 32, 34, 34, 41, 10, 9, 9,105,102, 32,102,108, 97,103,115, 91, 39, 67, 39, 93, 32,116,104,101,110, 10, 9, 9, 9,115, 32, 61, 32, 115,116,114,105,110,103, 46,103,115,117, 98, 40,115, 44, 32, 34, 94, 37, 45, 37, 45, 35, 35, 91, 94, 92,110, 92,114, 93, 42, 92,110, 34, 44, 32, 34, 34, 41, 10, 9, 9,101,110,100, 10, 9, 32,101,110,100, 10, 32,101,108,115,101, 10, 32, 9, 102,105,114,115,116, 95,108,105,110,101, 32, 61, 32, 34, 34, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,112, 97,100, 32, 116,111, 32, 49, 54, 32, 98,121,116,101,115, 10, 32,108,111, 99, 97,108, 32,110,112, 97,100, 32, 61, 32, 49, 54, 32, 45, 32, 40, 35,115, 32, 37, 32, 49, 54, 41, 10, 32,108,111, 99, 97,108, 32,115,112, 97,100, 32, 61, 32, 34, 34, 10, 32,102, 111,114, 32,105, 61, 49, 44,110,112, 97,100, 32,100,111, 10, 32, 9,115,112, 97,100, 32, 61, 32,115,112, 97,100, 32, 46, 46, 32, 34, 45, 34, 10, 32,101,110,100, 10, 32,115, 32, 61, 32,115, 46, 46,115,112, 97,100, 10, 32, 10, 32, 45, 45, 32, 99,111,110,118,101,114,116, 32,116,111, 32, 67, 10, 32,111, 117,116,112,117,116, 40, 39, 92,110, 39, 46, 46,112,114,101, 46, 46, 39,123, 32, 47, 42, 32, 98,101,103,105,110, 32,101, 109, 98,101,100,100,101,100, 32,108,117, 97, 32, 99,111,100, 101, 32, 42, 47, 92,110, 39, 41, 10, 32,111,117,116,112,117, 116, 40,112,114,101, 46, 46, 39, 32,105,110,116, 32,116,111, 112, 32, 61, 32,108,117, 97, 95,103,101,116,116,111,112, 40, 116,111,108,117, 97, 95, 83, 41, 59, 39, 41, 10, 32,111,117, 116,112,117,116, 40,112,114,101, 46, 46, 39, 32,115,116, 97, 116,105, 99, 32, 99,111,110,115,116, 32,117,110,115,105,103, 110,101,100, 32, 99,104, 97,114, 32, 66, 91, 93, 32, 61, 32, 123, 92,110, 32, 32, 32, 39, 41, 10, 32,108,111, 99, 97,108, 32,116, 61,123,110, 61, 48,125, 10, 10, 32,108,111, 99, 97, 108, 32, 98, 32, 61, 32,103,115,117, 98, 40,115, 44, 39, 40, 46, 41, 39, 44,102,117,110, 99,116,105,111,110, 32, 40, 99, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,101, 32, 61, 32, 39, 39, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,116, 46,110, 61,116, 46,110, 43, 49, 32, 105,102, 32,116, 46,110, 61, 61, 49, 53, 32,116,104,101,110, 32,116, 46,110, 61, 48, 32,101, 61, 39, 92,110, 39, 46, 46, 112,114,101, 46, 46, 39, 32, 32, 39, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,111,114,109, 97,116, 40, 39, 37, 51,117, 44, 37,115, 39, 44,115,116,114, 98,121,116,101, 40, 99, 41, 44,101, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 41, 10, 32,111,117,116,112,117,116, 40, 98, 46, 46,115,116,114, 98,121,116,101, 40, 34, 32, 34, 41, 41, 10, 32,111,117,116, 112,117,116, 40, 39, 92,110, 39, 46, 46,112,114,101, 46, 46, 39, 32,125, 59, 92,110, 39, 41, 10, 32,105,102, 32,102,105, 114,115,116, 95,108,105,110,101, 32, 97,110,100, 32,102,105, 114,115,116, 95,108,105,110,101, 32,126, 61, 32, 34, 34, 32, 116,104,101,110, 10, 32, 9,111,117,116,112,117,116, 40,112, 114,101, 46, 46, 39, 32,116,111,108,117, 97, 95,100,111, 98, 117,102,102,101,114, 40,116,111,108,117, 97, 95, 83, 44, 40, 99,104, 97,114, 42, 41, 66, 44,115,105,122,101,111,102, 40, 66, 41, 44, 34,116,111,108,117, 97, 32,101,109, 98,101,100, 100,101,100, 58, 32, 39, 46, 46,102,105,114,115,116, 95,108, 105,110,101, 46, 46, 39, 34, 41, 59, 39, 41, 10, 32,101,108, 115,101, 10, 32, 9,111,117,116,112,117,116, 40,112,114,101, 46, 46, 39, 32,116,111,108,117, 97, 95,100,111, 98,117,102, 102,101,114, 40,116,111,108,117, 97, 95, 83, 44, 40, 99,104, 97,114, 42, 41, 66, 44,115,105,122,101,111,102, 40, 66, 41, 44, 34,116,111,108,117, 97, 58, 32,101,109, 98,101,100,100, 101,100, 32, 76,117, 97, 32, 99,111,100,101, 32, 39, 46, 46, 99,111,100,101, 95,110, 46, 46, 39, 34, 41, 59, 39, 41, 10, 32,101,110,100, 10, 32,111,117,116,112,117,116, 40,112,114, 101, 46, 46, 39, 32,108,117, 97, 95,115,101,116,116,111,112, 40,116,111,108,117, 97, 95, 83, 44, 32,116,111,112, 41, 59, 39, 41, 10, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 39,125, 32, 47, 42, 32,101,110,100, 32,111,102, 32,101, 109, 98,101,100,100,101,100, 32,108,117, 97, 32, 99,111,100, 101, 32, 42, 47, 92,110, 92,110, 39, 41, 10, 32, 99,111,100, 101, 95,110, 32, 61, 32, 99,111,100,101, 95,110, 32, 43, 49, 10,101,110,100, 10, 10, 10, 45, 45, 32, 80,114,105,110,116, 32,109,101,116,104,111,100, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 67,111,100,101, 58,112,114,105, 110,116, 32, 40,105,100,101,110,116, 44, 99,108,111,115,101, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 67,111,100,101,123, 34, 41, 10, 32,112,114,105,110, 116, 40,105,100,101,110,116, 46, 46, 34, 32,116,101,120,116, 32, 61, 32, 91, 91, 34, 46, 46,115,101,108,102, 46,116,101, 120,116, 46, 46, 34, 93, 93, 44, 34, 41, 10, 32,112,114,105, 110,116, 40,105,100,101,110,116, 46, 46, 34,125, 34, 46, 46, 99,108,111,115,101, 41, 10,101,110,100, 10, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99,111,110,115,116, 114,117, 99,116,111,114, 10,102,117,110, 99,116,105,111,110, 32, 95, 67,111,100,101, 32, 40,116, 41, 10, 32,115,101,116, 109,101,116, 97,116, 97, 98,108,101, 40,116, 44, 99,108, 97, 115,115, 67,111,100,101, 41, 10, 32, 97,112,112,101,110,100, 40,116, 41, 10, 32,114,101,116,117,114,110, 32,116, 10,101, 110,100, 10, 10, 45, 45, 32, 67,111,110,115,116,114,117, 99, 116,111,114, 10, 45, 45, 32, 69,120,112,101, 99,116,115, 32, 97, 32,115,116,114,105,110,103, 32,114,101,112,114,101,115, 101,110,116,105,110,103, 32,116,104,101, 32, 99,111,100,101, 32,116,101,120,116, 10,102,117,110, 99,116,105,111,110, 32, 67,111,100,101, 32, 40,108, 41, 10, 32,114,101,116,117,114, 110, 32, 95, 67,111,100,101, 32,123, 10, 32, 32,116,101,120, 116, 32, 61, 32,108, 10, 32,125, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/code.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,116,121,112,101,100, 101,102, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114,105, 116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97, 114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71, 114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111, 100,101, 32,105,115, 32,102,114,101,101, 32,115,111,102,116, 119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114, 101,100,105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32,105, 116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116,119, 97,114,101, 32,112,114,111,118,105,100,101,100, 32,104,101, 114,101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97, 110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97,117, 116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108, 105,103, 97,116,105,111,110, 32,116,111, 32,112,114,111,118, 105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97, 116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101, 109,101,110,116,115, 44, 32,111,114, 32,109,111,100,105,102, 105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 10, 45, 45, 32, 84,121,112,101,100,101,102, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101,115,101,110,116,115, 32, 97, 32,116,121,112,101, 32,115,121,110,111,110,121,109, 46, 10, 45, 45, 32, 84,104,101, 32, 39,100,101, 32,102, 97, 99,116, 111, 39, 32,116,121,112,101, 32,114,101,112,108, 97, 99,101, 115, 32,116,104,101, 32,116,121,112,101,100,101,102, 32, 98, 101,102,111,114,101, 32,116,104,101, 10, 45, 45, 32,114,101, 109, 97,105,110,105,110,103, 32, 99,111,100,101, 32,105,115, 32,112, 97,114,115,101,100, 46, 10, 45, 45, 32, 84,104,101, 32,102,111,108,108,111,119,105,110,103, 32,102,105,101,108, 100,115, 32, 97,114,101, 32,115,116,111,114,101,100, 58, 10, 45, 45, 32, 32, 32,117,116,121,112,101, 32, 61, 32,116,121, 112,101,100,101,102, 32,110, 97,109,101, 10, 45, 45, 32, 32, 32,116,121,112,101, 32, 61, 32, 39,116,104,101, 32,102, 97, 99,116,111, 39, 32,116,121,112,101, 10, 45, 45, 32, 32, 32, 109,111,100, 32, 61, 32,109,111,100,105,102,105,101,114,115, 32,116,111, 32,116,104,101, 32, 39,100,101, 32,102, 97, 99, 116,111, 39, 32,116,121,112,101, 10, 99,108, 97,115,115, 84, 121,112,101,100,101,102, 32, 61, 32,123, 10, 32,117,116,121, 112,101, 32, 61, 32, 39, 39, 44, 10, 32,109,111,100, 32, 61, 32, 39, 39, 44, 10, 32,116,121,112,101, 32, 61, 32, 39, 39, 10,125, 10, 99,108, 97,115,115, 84,121,112,101,100,101,102, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97,115, 115, 84,121,112,101,100,101,102, 10, 10, 45, 45, 32, 80,114, 105,110,116, 32,109,101,116,104,111,100, 10,102,117,110, 99, 116,105,111,110, 32, 99,108, 97,115,115, 84,121,112,101,100, 101,102, 58,112,114,105,110,116, 32, 40,105,100,101,110,116, 44, 99,108,111,115,101, 41, 10, 32,112,114,105,110,116, 40, 105,100,101,110,116, 46, 46, 34, 84,121,112,101,100,101,102, 123, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110, 116, 46, 46, 34, 32,117,116,121,112,101, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,117,116,121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101, 110,116, 46, 46, 34, 32,109,111,100, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,109,111,100, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,116,121,112,101, 32, 61, 32, 39, 34, 46, 46,115, 101,108,102, 46,116,121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34,125, 34, 46, 46, 99,108,111,115,101, 41, 10,101,110,100, 10, 10, 45, 45, 32, 82,101,116,117,114,110, 32,105,116, 39, 115, 32,110,111,116, 32, 97, 32,118, 97,114,105, 97, 98,108, 101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115, 115, 84,121,112,101,100,101,102, 58,105,115,118, 97,114,105, 97, 98,108,101, 32, 40, 41, 10, 32,114,101,116,117,114,110, 32,102, 97,108,115,101, 10,101,110,100, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99,111,110,115,116,114, 117, 99,116,111,114, 10,102,117,110, 99,116,105,111,110, 32, 95, 84,121,112,101,100,101,102, 32, 40,116, 41, 10, 32,115, 101,116,109,101,116, 97,116, 97, 98,108,101, 40,116, 44, 99, 108, 97,115,115, 84,121,112,101,100,101,102, 41, 10, 32,116, 46,116,121,112,101, 32, 61, 32,114,101,115,111,108,118,101, 95,116,101,109,112,108, 97,116,101, 95,116,121,112,101,115, 40,116, 46,116,121,112,101, 41, 10, 32, 97,112,112,101,110, 100,116,121,112,101,100,101,102, 40,116, 41, 10, 32,114,101, 116,117,114,110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110,115,116,114,117, 99,116,111,114, 10, 45, 45, 32, 69,120,112,101, 99,116,115, 32,111,110,101, 32,115,116,114, 105,110,103, 32,114,101,112,114,101,115,101,110,116,105,110, 103, 32,116,104,101, 32,116,121,112,101, 32,100,101,102,105, 110,105,116,105,111,110, 46, 10,102,117,110, 99,116,105,111, 110, 32, 84,121,112,101,100,101,102, 32, 40,115, 41, 10, 32, 105,102, 32,115,116,114,102,105,110,100, 40,115,116,114,105, 110,103, 46,103,115,117, 98, 40,115, 44, 32, 39, 37, 98, 60, 62, 39, 44, 32, 39, 39, 41, 44, 39, 91, 37, 42, 38, 93, 39, 41, 32,116,104,101,110, 10, 32, 32,116,111,108,117, 97, 95, 101,114,114,111,114, 40, 34, 35,105,110,118, 97,108,105,100, 32,116,121,112,101,100,101,102, 58, 32,112,111,105,110,116, 101,114,115, 32, 40, 97,110,100, 32,114,101,102,101,114,101, 110, 99,101,115, 41, 32, 97,114,101, 32,110,111,116, 32,115, 117,112,112,111,114,116,101,100, 34, 41, 10, 32,101,110,100, 10, 32,108,111, 99, 97,108, 32,111, 32, 61, 32,123,109,111, 100, 32, 61, 32, 39, 39,125, 10, 32,105,102, 32,115,116,114, 105,110,103, 46,102,105,110,100, 40,115, 44, 32, 34, 91, 60, 62, 93, 34, 41, 32,116,104,101,110, 10, 32, 9, 95, 44, 95, 44,111, 46,116,121,112,101, 44,111, 46,117,116,121,112,101, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110,100, 40, 115, 44, 32, 34, 94, 37,115, 42, 40, 91, 94, 60, 62, 93, 43, 37, 98, 60, 62, 91, 94, 37,115, 93, 42, 41, 37,115, 43, 40, 46, 45, 41, 36, 34, 41, 10, 32,101,108,115,101, 10, 32, 9, 108,111, 99, 97,108, 32,116, 32, 61, 32,115,112,108,105,116, 40,103,115,117, 98, 40,115, 44, 34, 37,115, 37,115, 42, 34, 44, 34, 32, 34, 41, 44, 34, 32, 34, 41, 10, 32, 9,111, 32, 61, 32,123, 10, 9, 32, 32,117,116,121,112,101, 32, 61, 32, 116, 91,116, 46,110, 93, 44, 10, 9, 32, 32,116,121,112,101, 32, 61, 32,116, 91,116, 46,110, 45, 49, 93, 44, 10, 9, 32, 32,109,111,100, 32, 61, 32, 99,111,110, 99, 97,116, 40,116, 44, 49, 44,116, 46,110, 45, 50, 41, 44, 10, 9, 32,125, 10, 32,101,110,100, 10, 32,114,101,116,117,114,110, 32, 95, 84, 121,112,101,100,101,102, 40,111, 41, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/typedef.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32, 99,111,110,116, 97, 105,110,101,114, 32, 97, 98,115,116,114, 97, 99,116, 32, 99, 108, 97,115,115, 10, 45, 45, 32, 87,114,105,116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101, 108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111,100,101, 32,105, 115, 32,102,114,101,101, 32,115,111,102,116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101,100,105,115, 116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47, 111,114, 32,109,111,100,105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116,119, 97,114,101, 32, 112,114,111,118,105,100,101,100, 32,104,101,114,101,117,110, 100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97, 115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110, 100, 10, 45, 45, 32,116,104,101, 32, 97,117,116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105,103, 97,116, 105,111,110, 32,116,111, 32,112,114,111,118,105,100,101, 32, 109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32,115,117, 112,112,111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101,109,101,110,116, 115, 44, 32,111,114, 32,109,111,100,105,102,105, 99, 97,116, 105,111,110,115, 46, 10, 10, 45, 45, 32,116, 97, 98,108,101, 32,116,111, 32,115,116,111,114,101, 32,110, 97,109,101,115, 112, 97, 99,101,100, 32,116,121,112,101,100,101,102,115, 47, 101,110,117,109,115, 32,105,110, 32,103,108,111, 98, 97,108, 32,115, 99,111,112,101, 10,103,108,111, 98, 97,108, 95,116, 121,112,101,100,101,102,115, 32, 61, 32,123,125, 10,103,108, 111, 98, 97,108, 95,101,110,117,109,115, 32, 61, 32,123,125, 10, 10, 45, 45, 32, 67,111,110,116, 97,105,110,101,114, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101,115, 101,110,116,115, 32, 97, 32, 99,111,110,116, 97,105,110,101, 114, 32,111,102, 32,102,101, 97,116,117,114,101,115, 32,116, 111, 32, 98,101, 32, 98,111,117,110,100, 10, 45, 45, 32,116, 111, 32,108,117, 97, 46, 10, 99,108, 97,115,115, 67,111,110, 116, 97,105,110,101,114, 32, 61, 10,123, 10, 32, 99,117,114, 114, 32, 61, 32,110,105,108, 44, 10,125, 10, 99,108, 97,115, 115, 67,111,110,116, 97,105,110,101,114, 46, 95, 95,105,110, 100,101,120, 32, 61, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 10,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40, 99,108, 97,115,115, 67,111,110,116, 97,105, 110,101,114, 44, 99,108, 97,115,115, 70,101, 97,116,117,114, 101, 41, 10, 10, 45, 45, 32,111,117,116,112,117,116, 32,116, 97,103,115, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 58,100,101, 99,108,116,121,112,101, 32, 40, 41, 10, 32,112,117,115,104, 40,115,101,108,102, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108,101, 32,115,101,108,102, 91, 105, 93, 32,100,111, 10, 32, 32,115,101,108,102, 91,105, 93, 58,100,101, 99,108,116,121,112,101, 40, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,112,111, 112, 40, 41, 10,101,110,100, 10, 10, 10, 45, 45, 32,119,114, 105,116,101, 32,115,117,112,112,111,114,116, 32, 99,111,100, 101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115, 115, 67,111,110,116, 97,105,110,101,114, 58,115,117,112, 99, 111,100,101, 32, 40, 41, 10, 10, 9,105,102, 32,110,111,116, 32,115,101,108,102, 58, 99,104,101, 99,107, 95,112,117, 98, 108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 32,116,104, 101,110, 10, 9, 9,114,101,116,117,114,110, 10, 9,101,110, 100, 10, 10, 32,112,117,115,104, 40,115,101,108,102, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105, 108,101, 32,115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32,105,102, 32,115,101,108,102, 91,105, 93, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115, 115, 40, 41, 32,116,104,101,110, 10, 32, 32, 9,115,101,108, 102, 91,105, 93, 58,115,117,112, 99,111,100,101, 40, 41, 10, 32, 32,101,110,100, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,112,111,112, 40, 41, 10,101,110, 100, 10, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97, 115,115, 67,111,110,116, 97,105,110,101,114, 58,104, 97,115, 118, 97,114, 32, 40, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108,101, 32,115,101,108,102, 91, 105, 93, 32,100,111, 10, 32, 32,105,102, 32,115,101,108,102, 91,105, 93, 58,105,115,118, 97,114,105, 97, 98,108,101, 40, 41, 32,116,104,101,110, 10, 9, 9, 32,114,101,116,117,114, 110, 32, 49, 10, 9, 9,101,110,100, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 9,114,101,116,117, 114,110, 32, 48, 10,101,110,100, 10, 10, 45, 45, 32, 73,110, 116,101,114,110, 97,108, 32, 99,111,110,116, 97,105,110,101, 114, 32, 99,111,110,115,116,114,117, 99,116,111,114, 10,102, 117,110, 99,116,105,111,110, 32, 95, 67,111,110,116, 97,105, 110,101,114, 32, 40,115,101,108,102, 41, 10, 32,115,101,116, 109,101,116, 97,116, 97, 98,108,101, 40,115,101,108,102, 44, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 41, 10, 32,115,101,108,102, 46,110, 32, 61, 32, 48, 10, 32,115, 101,108,102, 46,116,121,112,101,100,101,102,115, 32, 61, 32, 123,116,111,108,117, 97, 95,110, 61, 48,125, 10, 32,115,101, 108,102, 46,117,115,101,114,116,121,112,101,115, 32, 61, 32, 123,125, 10, 32,115,101,108,102, 46,101,110,117,109,115, 32, 61, 32,123,116,111,108,117, 97, 95,110, 61, 48,125, 10, 32, 115,101,108,102, 46,108,110, 97,109,101,115, 32, 61, 32,123, 125, 10, 32,114,101,116,117,114,110, 32,115,101,108,102, 10, 101,110,100, 10, 10, 45, 45, 32,112,117,115,104, 32, 99,111, 110,116, 97,105,110,101,114, 10,102,117,110, 99,116,105,111, 110, 32,112,117,115,104, 32, 40,116, 41, 10, 9,116, 46,112, 114,111,120, 32, 61, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 10, 32, 99,108, 97, 115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114, 114, 32, 61, 32,116, 10,101,110,100, 10, 10, 45, 45, 32,112, 111,112, 32, 99,111,110,116, 97,105,110,101,114, 10,102,117, 110, 99,116,105,111,110, 32,112,111,112, 32, 40, 41, 10, 45, 45,112,114,105,110,116, 40, 34,110, 97,109,101, 34, 44, 99, 108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99, 117,114,114, 46,110, 97,109,101, 41, 10, 45, 45,102,111,114, 101, 97, 99,104, 40, 99,108, 97,115,115, 67,111,110,116, 97, 105,110,101,114, 46, 99,117,114,114, 46,117,115,101,114,116, 121,112,101,115, 44,112,114,105,110,116, 41, 10, 45, 45,112, 114,105,110,116, 40, 34, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 34, 41, 10, 32, 99,108, 97,115,115, 67, 111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 32, 61, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 46,112,114,111,120, 10,101,110,100, 10, 10, 45, 45, 32,103,101,116, 32, 99,117,114,114,101,110,116, 32,110, 97,109,101,115,112, 97, 99,101, 10,102,117,110, 99, 116,105,111,110, 32,103,101,116, 99,117,114,114,110, 97,109, 101,115,112, 97, 99,101, 32, 40, 41, 10, 9,114,101,116,117, 114,110, 32,103,101,116,110, 97,109,101,115,112, 97, 99,101, 40, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 41, 10,101,110,100, 10, 10, 45, 45, 32, 97,112,112,101,110,100, 32,116,111, 32, 99,117,114,114,101, 110,116, 32, 99,111,110,116, 97,105,110,101,114, 10,102,117, 110, 99,116,105,111,110, 32, 97,112,112,101,110,100, 32, 40, 116, 41, 10, 32,114,101,116,117,114,110, 32, 99,108, 97,115, 115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 58, 97,112,112,101,110,100, 40,116, 41, 10,101,110,100, 10, 10, 45, 45, 32, 97,112,112,101,110,100, 32,116,121,112,101, 100,101,102, 32,116,111, 32, 99,117,114,114,101,110,116, 32, 99,111,110,116, 97,105,110,101,114, 10,102,117,110, 99,116, 105,111,110, 32, 97,112,112,101,110,100,116,121,112,101,100, 101,102, 32, 40,116, 41, 10, 32,114,101,116,117,114,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 58, 97,112,112,101,110,100,116,121,112,101, 100,101,102, 40,116, 41, 10,101,110,100, 10, 10, 45, 45, 32, 97,112,112,101,110,100, 32,117,115,101,114,116,121,112,101, 32,116,111, 32, 99,117,114,114,101,110,116, 32, 99,111,110, 116, 97,105,110,101,114, 10,102,117,110, 99,116,105,111,110, 32, 97,112,112,101,110,100,117,115,101,114,116,121,112,101, 32, 40,116, 41, 10, 32,114,101,116,117,114,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117, 114,114, 58, 97,112,112,101,110,100,117,115,101,114,116,121, 112,101, 40,116, 41, 10,101,110,100, 10, 10, 45, 45, 32, 97, 112,112,101,110,100, 32,101,110,117,109, 32,116,111, 32, 99, 117,114,114,101,110,116, 32, 99,111,110,116, 97,105,110,101, 114, 10,102,117,110, 99,116,105,111,110, 32, 97,112,112,101, 110,100,101,110,117,109, 32, 40,116, 41, 10, 32,114,101,116, 117,114,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105, 110,101,114, 46, 99,117,114,114, 58, 97,112,112,101,110,100, 101,110,117,109, 40,116, 41, 10,101,110,100, 10, 10, 45, 45, 32,115,117, 98,115,116,105,116,117,116,101, 32,116,121,112, 101,100,101,102, 10,102,117,110, 99,116,105,111,110, 32, 97, 112,112,108,121,116,121,112,101,100,101,102, 32, 40,109,111, 100, 44,116,121,112,101, 41, 10, 32,114,101,116,117,114,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 58, 97,112,112,108,121,116,121,112,101, 100,101,102, 40,109,111,100, 44,116,121,112,101, 41, 10,101, 110,100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32,105,115, 32,116,121,112,101, 10,102,117,110, 99,116,105, 111,110, 32,102,105,110,100,116,121,112,101, 32, 40,116,121, 112,101, 41, 10, 32,108,111, 99, 97,108, 32,116, 32, 61, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 58,102,105,110,100,116,121,112,101, 40,116, 121,112,101, 41, 10, 9,114,101,116,117,114,110, 32,116, 10, 101,110,100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32,105, 102, 32,105,115, 32,116,121,112,101,100,101,102, 10,102,117, 110, 99,116,105,111,110, 32,105,115,116,121,112,101,100,101, 102, 32, 40,116,121,112,101, 41, 10, 32,114,101,116,117,114, 110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101, 114, 46, 99,117,114,114, 58,105,115,116,121,112,101,100,101, 102, 40,116,121,112,101, 41, 10,101,110,100, 10, 10, 45, 45, 32,103,101,116, 32,102,117,108,108,116,121,112,101, 32, 40, 119,105,116,104, 32,110, 97,109,101,115,112, 97, 99,101, 41, 10,102,117,110, 99,116,105,111,110, 32,102,117,108,108,116, 121,112,101, 32, 40,116, 41, 10, 32,108,111, 99, 97,108, 32, 99,117,114,114, 32, 61, 32, 32, 99,108, 97,115,115, 67,111, 110,116, 97,105,110,101,114, 46, 99,117,114,114, 10, 9,119, 104,105,108,101, 32, 99,117,114,114, 32,100,111, 10, 9, 32, 105,102, 32, 99,117,114,114, 32,116,104,101,110, 10, 9, 9, 32,105,102, 32, 99,117,114,114, 46,116,121,112,101,100,101, 102,115, 32, 97,110,100, 32, 99,117,114,114, 46,116,121,112, 101,100,101,102,115, 91,116, 93, 32,116,104,101,110, 10, 9, 9, 32, 32,114,101,116,117,114,110, 32, 99,117,114,114, 46, 116,121,112,101,100,101,102,115, 91,116, 93, 10, 9, 9, 32, 101,108,115,101,105,102, 32, 99,117,114,114, 46,117,115,101, 114,116,121,112,101,115, 32, 97,110,100, 32, 99,117,114,114, 46,117,115,101,114,116,121,112,101,115, 91,116, 93, 32,116, 104,101,110, 10, 9, 9, 32, 32,114,101,116,117,114,110, 32, 99,117,114,114, 46,117,115,101,114,116,121,112,101,115, 91, 116, 93, 10, 9, 9, 9,101,110,100, 10, 9, 9,101,110,100, 10, 9, 32, 99,117,114,114, 32, 61, 32, 99,117,114,114, 46, 112,114,111,120, 10, 9,101,110,100, 10, 9,114,101,116,117, 114,110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 99,104, 101, 99,107,115, 32,105,102, 32,105,116, 32,114,101,113,117, 105,114,101,115, 32, 99,111,108,108,101, 99,116,105,111,110, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 58,114,101,113,117,105, 114,101, 99,111,108,108,101, 99,116,105,111,110, 32, 40,116, 41, 10, 32,112,117,115,104, 40,115,101,108,102, 41, 10, 32, 108,111, 99, 97,108, 32,105, 61, 49, 10, 9,108,111, 99, 97, 108, 32,114, 32, 61, 32,102, 97,108,115,101, 10, 32,119,104, 105,108,101, 32,115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32,114, 32, 61, 32,115,101,108,102, 91,105, 93, 58,114, 101,113,117,105,114,101, 99,111,108,108,101, 99,116,105,111, 110, 40,116, 41, 32,111,114, 32,114, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 9,112,111,112, 40, 41, 10, 9,114,101,116,117,114,110, 32,114, 10,101,110,100, 10, 10, 10, 45, 45, 32,103,101,116, 32,110, 97,109,101,115, 97,112, 99,101, 10,102,117,110, 99,116,105,111,110, 32,103, 101,116,110, 97,109,101,115,112, 97, 99,101, 32, 40, 99,117, 114,114, 41, 10, 9,108,111, 99, 97,108, 32,110, 97,109,101, 115,112, 97, 99,101, 32, 61, 32, 39, 39, 10, 9,119,104,105, 108,101, 32, 99,117,114,114, 32,100,111, 10, 9, 32,105,102, 32, 99,117,114,114, 32, 97,110,100, 10, 9, 9, 32, 32, 32, 40, 32, 99,117,114,114, 46, 99,108, 97,115,115,116,121,112, 101, 32, 61, 61, 32, 39, 99,108, 97,115,115, 39, 32,111,114, 32, 99,117,114,114, 46, 99,108, 97,115,115,116,121,112,101, 32, 61, 61, 32, 39,110, 97,109,101,115,112, 97, 99,101, 39, 41, 10, 9, 9,116,104,101,110, 10, 9, 9, 32,110, 97,109, 101,115,112, 97, 99,101, 32, 61, 32, 40, 99,117,114,114, 46, 111,114,105,103,105,110, 97,108, 95,110, 97,109,101, 32,111, 114, 32, 99,117,114,114, 46,110, 97,109,101, 41, 32, 46, 46, 32, 39, 58, 58, 39, 32, 46, 46, 32,110, 97,109,101,115,112, 97, 99,101, 10, 9, 9, 32, 45, 45,110, 97,109,101,115,112, 97, 99,101, 32, 61, 32, 99,117,114,114, 46,110, 97,109,101, 32, 46, 46, 32, 39, 58, 58, 39, 32, 46, 46, 32,110, 97,109, 101,115,112, 97, 99,101, 10, 9, 9,101,110,100, 10, 9, 32, 99,117,114,114, 32, 61, 32, 99,117,114,114, 46,112,114,111, 120, 10, 9,101,110,100, 10, 9,114,101,116,117,114,110, 32, 110, 97,109,101,115,112, 97, 99,101, 10,101,110,100, 10, 10, 45, 45, 32,103,101,116, 32,110, 97,109,101,115,112, 97, 99, 101, 32, 40,111,110,108,121, 32,110, 97,109,101,115,112, 97, 99,101, 41, 10,102,117,110, 99,116,105,111,110, 32,103,101, 116,111,110,108,121,110, 97,109,101,115,112, 97, 99,101, 32, 40, 41, 10, 32,108,111, 99, 97,108, 32, 99,117,114,114, 32, 61, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101, 114, 46, 99,117,114,114, 10, 9,108,111, 99, 97,108, 32,110, 97,109,101,115,112, 97, 99,101, 32, 61, 32, 39, 39, 10, 9, 119,104,105,108,101, 32, 99,117,114,114, 32,100,111, 10, 9, 9,105,102, 32, 99,117,114,114, 46, 99,108, 97,115,115,116, 121,112,101, 32, 61, 61, 32, 39, 99,108, 97,115,115, 39, 32, 116,104,101,110, 10, 9, 9, 32,114,101,116,117,114,110, 32, 110, 97,109,101,115,112, 97, 99,101, 10, 9, 9,101,108,115, 101,105,102, 32, 99,117,114,114, 46, 99,108, 97,115,115,116, 121,112,101, 32, 61, 61, 32, 39,110, 97,109,101,115,112, 97, 99,101, 39, 32,116,104,101,110, 10, 9, 9, 32,110, 97,109, 101,115,112, 97, 99,101, 32, 61, 32, 99,117,114,114, 46,110, 97,109,101, 32, 46, 46, 32, 39, 58, 58, 39, 32, 46, 46, 32, 110, 97,109,101,115,112, 97, 99,101, 10, 9, 9,101,110,100, 10, 9, 32, 99,117,114,114, 32, 61, 32, 99,117,114,114, 46, 112,114,111,120, 10, 9,101,110,100, 10, 9,114,101,116,117, 114,110, 32,110, 97,109,101,115,112, 97, 99,101, 10,101,110, 100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32, 105,115, 32,101,110,117,109, 10,102,117,110, 99,116,105,111, 110, 32,105,115,101,110,117,109, 32, 40,116,121,112,101, 41, 10, 32,114,101,116,117,114,110, 32, 99,108, 97,115,115, 67, 111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 58,105, 115,101,110,117,109, 40,116,121,112,101, 41, 10,101,110,100, 10, 10, 45, 45, 32, 97,112,112,101,110,100, 32,102,101, 97, 116,117,114,101, 32,116,111, 32, 99,111,110,116, 97,105,110, 101,114, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97, 115,115, 67,111,110,116, 97,105,110,101,114, 58, 97,112,112, 101,110,100, 32, 40,116, 41, 10, 32,115,101,108,102, 46,110, 32, 61, 32,115,101,108,102, 46,110, 32, 43, 32, 49, 10, 32, 115,101,108,102, 91,115,101,108,102, 46,110, 93, 32, 61, 32, 116, 10, 32,116, 46,112, 97,114,101,110,116, 32, 61, 32,115, 101,108,102, 10,101,110,100, 10, 10, 45, 45, 32, 97,112,112, 101,110,100, 32,116,121,112,101,100,101,102, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 58, 97,112,112,101,110,100,116,121,112, 101,100,101,102, 32, 40,116, 41, 10, 32,108,111, 99, 97,108, 32,110, 97,109,101,115,112, 97, 99,101, 32, 61, 32,103,101, 116,110, 97,109,101,115,112, 97, 99,101, 40, 99,108, 97,115, 115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 41, 10, 32,115,101,108,102, 46,116,121,112,101,100,101,102, 115, 46,116,111,108,117, 97, 95,110, 32, 61, 32,115,101,108, 102, 46,116,121,112,101,100,101,102,115, 46,116,111,108,117, 97, 95,110, 32, 43, 32, 49, 10, 32,115,101,108,102, 46,116, 121,112,101,100,101,102,115, 91,115,101,108,102, 46,116,121, 112,101,100,101,102,115, 46,116,111,108,117, 97, 95,110, 93, 32, 61, 32,116, 10, 9,115,101,108,102, 46,116,121,112,101, 100,101,102,115, 91,116, 46,117,116,121,112,101, 93, 32, 61, 32,110, 97,109,101,115,112, 97, 99,101, 32, 46, 46, 32,116, 46,117,116,121,112,101, 10, 9,103,108,111, 98, 97,108, 95, 116,121,112,101,100,101,102,115, 91,110, 97,109,101,115,112, 97, 99,101, 46, 46,116, 46,117,116,121,112,101, 93, 32, 61, 32,116, 10, 9,116, 46,102,116,121,112,101, 32, 61, 32,102, 105,110,100,116,121,112,101, 40,116, 46,116,121,112,101, 41, 32,111,114, 32,116, 46,116,121,112,101, 10, 9, 45, 45,112, 114,105,110,116, 40, 34, 97,112,112,101,110,100,105,110,103, 32,116,121,112,101,100,101,102, 32, 34, 46, 46,116, 46,117, 116,121,112,101, 46, 46, 34, 32, 97,115, 32, 34, 46, 46,110, 97,109,101,115,112, 97, 99,101, 46, 46,116, 46,117,116,121, 112,101, 46, 46, 34, 32,119,105,116,104, 32,102,116,121,112, 101, 32, 34, 46, 46,116, 46,102,116,121,112,101, 41, 10, 9, 97,112,112,101,110,100, 95,103,108,111, 98, 97,108, 95,116, 121,112,101, 40,110, 97,109,101,115,112, 97, 99,101, 46, 46, 116, 46,117,116,121,112,101, 41, 10, 9,105,102, 32,116, 46, 102,116,121,112,101, 32, 97,110,100, 32,105,115,101,110,117, 109, 40,116, 46,102,116,121,112,101, 41, 32,116,104,101,110, 10, 10, 9, 9,103,108,111, 98, 97,108, 95,101,110,117,109, 115, 91,110, 97,109,101,115,112, 97, 99,101, 46, 46,116, 46, 117,116,121,112,101, 93, 32, 61, 32,116,114,117,101, 10, 9, 101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 97,112,112, 101,110,100, 32,117,115,101,114,116,121,112,101, 58, 32,114, 101,116,117,114,110, 32,102,117,108,108, 32,116,121,112,101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 58, 97,112,112,101,110, 100,117,115,101,114,116,121,112,101, 32, 40,116, 41, 10, 9, 108,111, 99, 97,108, 32, 99,111,110,116, 97,105,110,101,114, 10, 9,105,102, 32,116, 32, 61, 61, 32, 40,115,101,108,102, 46,111,114,105,103,105,110, 97,108, 95,110, 97,109,101, 32, 111,114, 32,115,101,108,102, 46,110, 97,109,101, 41, 32,116, 104,101,110, 10, 9, 9, 99,111,110,116, 97,105,110,101,114, 32, 61, 32,115,101,108,102, 46,112,114,111,120, 10, 9,101, 108,115,101, 10, 9, 9, 99,111,110,116, 97,105,110,101,114, 32, 61, 32,115,101,108,102, 10, 9,101,110,100, 10, 9,108, 111, 99, 97,108, 32,102,116, 32, 61, 32,103,101,116,110, 97, 109,101,115,112, 97, 99,101, 40, 99,111,110,116, 97,105,110, 101,114, 41, 32, 46, 46, 32,116, 10, 9, 99,111,110,116, 97, 105,110,101,114, 46,117,115,101,114,116,121,112,101,115, 91, 116, 93, 32, 61, 32,102,116, 10, 9, 95,117,115,101,114,116, 121,112,101, 91,102,116, 93, 32, 61, 32,102,116, 10, 9,114, 101,116,117,114,110, 32,102,116, 10,101,110,100, 10, 10, 45, 45, 32, 97,112,112,101,110,100, 32,101,110,117,109, 10,102, 117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67,111, 110,116, 97,105,110,101,114, 58, 97,112,112,101,110,100,101, 110,117,109, 32, 40,116, 41, 10, 32,108,111, 99, 97,108, 32, 110, 97,109,101,115,112, 97, 99,101, 32, 61, 32,103,101,116, 110, 97,109,101,115,112, 97, 99,101, 40, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 41, 10, 32,115,101,108,102, 46,101,110,117,109,115, 46,116,111, 108,117, 97, 95,110, 32, 61, 32,115,101,108,102, 46,101,110, 117,109,115, 46,116,111,108,117, 97, 95,110, 32, 43, 32, 49, 10, 32,115,101,108,102, 46,101,110,117,109,115, 91,115,101, 108,102, 46,101,110,117,109,115, 46,116,111,108,117, 97, 95, 110, 93, 32, 61, 32,116, 10, 9,103,108,111, 98, 97,108, 95, 101,110,117,109,115, 91,110, 97,109,101,115,112, 97, 99,101, 46, 46,116, 46,110, 97,109,101, 93, 32, 61, 32,116, 10,101, 110,100, 10, 10, 45, 45, 32,100,101,116,101,114,109,105,110, 101, 32,108,117, 97, 32,102,117,110, 99,116,105,111,110, 32, 110, 97,109,101, 32,111,118,101,114,108,111, 97,100, 10,102, 117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67,111, 110,116, 97,105,110,101,114, 58,111,118,101,114,108,111, 97, 100, 32, 40,108,110, 97,109,101, 41, 10, 32,105,102, 32,110, 111,116, 32,115,101,108,102, 46,108,110, 97,109,101,115, 91, 108,110, 97,109,101, 93, 32,116,104,101,110, 10, 32, 32,115, 101,108,102, 46,108,110, 97,109,101,115, 91,108,110, 97,109, 101, 93, 32, 61, 32, 48, 10, 32,101,108,115,101, 10, 32, 32, 115,101,108,102, 46,108,110, 97,109,101,115, 91,108,110, 97, 109,101, 93, 32, 61, 32,115,101,108,102, 46,108,110, 97,109, 101,115, 91,108,110, 97,109,101, 93, 32, 43, 32, 49, 10, 32, 101,110,100, 10, 32,114,101,116,117,114,110, 32,102,111,114, 109, 97,116, 40, 34, 37, 48, 50,100, 34, 44,115,101,108,102, 46,108,110, 97,109,101,115, 91,108,110, 97,109,101, 93, 41, 10,101,110,100, 10, 10, 45, 45, 32, 97,112,112,108,105,101, 115, 32,116,121,112,101,100,101,102, 58, 32,114,101,116,117, 114,110,115, 32,116,104,101, 32, 39,116,104,101, 32,102, 97, 99,116,111, 39, 32,109,111,100,105,102,105,101,114, 32, 97, 110,100, 32,116,121,112,101, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101, 114, 58, 97,112,112,108,121,116,121,112,101,100,101,102, 32, 40,109,111,100, 44,116,121,112,101, 41, 10, 9,105,102, 32, 103,108,111, 98, 97,108, 95,116,121,112,101,100,101,102,115, 91,116,121,112,101, 93, 32,116,104,101,110, 10, 9, 9, 45, 45,112,114,105,110,116, 40, 34,102,111,117,110,100, 32,116, 121,112,101,100,101,102, 32, 34, 46, 46,103,108,111, 98, 97, 108, 95,116,121,112,101,100,101,102,115, 91,116,121,112,101, 93, 46,116,121,112,101, 41, 10, 9, 9,108,111, 99, 97,108, 32,109,111,100, 49, 44, 32,116,121,112,101, 49, 32, 61, 32, 103,108,111, 98, 97,108, 95,116,121,112,101,100,101,102,115, 91,116,121,112,101, 93, 46,109,111,100, 44, 32,103,108,111, 98, 97,108, 95,116,121,112,101,100,101,102,115, 91,116,121, 112,101, 93, 46,102,116,121,112,101, 10, 9, 9,108,111, 99, 97,108, 32,109,111,100, 50, 44, 32,116,121,112,101, 50, 32, 61, 32, 97,112,112,108,121,116,121,112,101,100,101,102, 40, 109,111,100, 46, 46, 34, 32, 34, 46, 46,109,111,100, 49, 44, 32,116,121,112,101, 49, 41, 10, 9, 9, 45, 45,114,101,116, 117,114,110, 32,109,111,100, 50, 32, 46, 46, 32, 39, 32, 39, 32, 46, 46, 32,109,111,100, 49, 44, 32,116,121,112,101, 50, 10, 9, 9,114,101,116,117,114,110, 32,109,111,100, 50, 44, 32,116,121,112,101, 50, 10, 9,101,110,100, 10, 9,100,111, 32,114,101,116,117,114,110, 32,109,111,100, 44,116,121,112, 101, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 99, 104,101, 99,107, 32,105,102, 32,105,116, 32,105,115, 32, 97, 32,116,121,112,101,100,101,102, 10,102,117,110, 99,116,105, 111,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110, 101,114, 58,105,115,116,121,112,101,100,101,102, 32, 40,116, 121,112,101, 41, 10, 32,108,111, 99, 97,108, 32,101,110,118, 32, 61, 32,115,101,108,102, 10, 32,119,104,105,108,101, 32, 101,110,118, 32,100,111, 10, 32, 32,105,102, 32,101,110,118, 46,116,121,112,101,100,101,102,115, 32,116,104,101,110, 10, 32, 32, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32, 32, 32,119,104,105,108,101, 32,101,110,118, 46,116,121,112,101, 100,101,102,115, 91,105, 93, 32,100,111, 10, 32, 32, 32, 32, 105,102, 32,101,110,118, 46,116,121,112,101,100,101,102,115, 91,105, 93, 46,117,116,121,112,101, 32, 61, 61, 32,116,121, 112,101, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,116,121,112,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32, 32, 32, 101,110,100, 10, 32, 32,101,110,100, 10, 32, 32,101,110,118, 32, 61, 32,101,110,118, 46,112, 97,114,101,110,116, 10, 32, 101,110,100, 10, 32,114,101,116,117,114,110, 32,110,105,108, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, 102,105,110,100, 95,101,110,117,109, 95,118, 97,114, 40,118, 97,114, 41, 10, 10, 9,105,102, 32,116,111,110,117,109, 98, 101,114, 40,118, 97,114, 41, 32,116,104,101,110, 32,114,101, 116,117,114,110, 32,118, 97,114, 32,101,110,100, 10, 10, 9, 108,111, 99, 97,108, 32, 99, 32, 61, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 10, 9,119,104,105,108,101, 32, 99, 32,100,111, 10, 9, 9,108, 111, 99, 97,108, 32,110,115, 32, 61, 32,103,101,116,110, 97, 109,101,115,112, 97, 99,101, 40, 99, 41, 10, 9, 9,102,111, 114, 32,107, 44,118, 32,105,110, 32,112, 97,105,114,115, 40, 95,103,108,111, 98, 97,108, 95,101,110,117,109,115, 41, 32, 100,111, 10, 9, 9, 9,105,102, 32,109, 97,116, 99,104, 95, 116,121,112,101, 40,118, 97,114, 44, 32,118, 44, 32,110,115, 41, 32,116,104,101,110, 10, 9, 9, 9, 9,114,101,116,117, 114,110, 32,118, 10, 9, 9, 9,101,110,100, 10, 9, 9,101, 110,100, 10, 9, 9,105,102, 32, 99, 46, 98, 97,115,101, 32, 97,110,100, 32, 99, 46, 98, 97,115,101, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 9, 9, 9, 99, 32, 61, 32, 95, 103,108,111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91, 99, 58,102,105,110,100,116,121,112,101, 40, 99, 46, 98, 97, 115,101, 41, 93, 10, 9, 9,101,108,115,101, 10, 9, 9, 9, 99, 32, 61, 32,110,105,108, 10, 9, 9,101,110,100, 10, 9, 101,110,100, 10, 10, 9,114,101,116,117,114,110, 32,118, 97, 114, 10,101,110,100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32,105,115, 32, 97, 32,114,101,103,105,115,116, 101,114,101,100, 32,116,121,112,101, 58, 32,114,101,116,117, 114,110, 32,102,117,108,108, 32,116,121,112,101, 32,111,114, 32,110,105,108, 10,102,117,110, 99,116,105,111,110, 32, 99, 108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 58,102, 105,110,100,116,121,112,101, 32, 40,116, 41, 10, 10, 9,116, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 116, 44, 32, 34, 61, 46, 42, 34, 44, 32, 34, 34, 41, 10, 9, 105,102, 32, 95, 98, 97,115,105, 99, 91,116, 93, 32,116,104, 101,110, 10, 9, 32,114,101,116,117,114,110, 32,116, 10, 9, 101,110,100, 10, 10, 9,108,111, 99, 97,108, 32, 95, 44, 95, 44,101,109, 32, 61, 32,115,116,114,105,110,103, 46,102,105, 110,100, 40,116, 44, 32, 34, 40, 91, 38, 37, 42, 93, 41, 37, 115, 42, 36, 34, 41, 10, 9,116, 32, 61, 32,115,116,114,105, 110,103, 46,103,115,117, 98, 40,116, 44, 32, 34, 37,115, 42, 40, 91, 38, 37, 42, 93, 41, 37,115, 42, 36, 34, 44, 32, 34, 34, 41, 10, 9,112, 32, 61, 32,115,101,108,102, 10, 9,119, 104,105,108,101, 32,112, 32, 97,110,100, 32,116,121,112,101, 40,112, 41, 61, 61, 39,116, 97, 98,108,101, 39, 32,100,111, 10, 9, 9,108,111, 99, 97,108, 32,115,116, 32, 61, 32,103, 101,116,110, 97,109,101,115,112, 97, 99,101, 40,112, 41, 10, 10, 9, 9,102,111,114, 32,105, 61, 95,103,108,111, 98, 97, 108, 95,116,121,112,101,115, 46,110, 44, 49, 44, 45, 49, 32, 100,111, 32, 45, 45, 32,105,110, 32,114,101,118,101,114,115, 101, 32,111,114,100,101,114, 10, 10, 9, 9, 9,105,102, 32, 109, 97,116, 99,104, 95,116,121,112,101, 40,116, 44, 32, 95, 103,108,111, 98, 97,108, 95,116,121,112,101,115, 91,105, 93, 44, 32,115,116, 41, 32,116,104,101,110, 10, 9, 9, 9, 9, 114,101,116,117,114,110, 32, 95,103,108,111, 98, 97,108, 95, 116,121,112,101,115, 91,105, 93, 46, 46, 40,101,109, 32,111, 114, 32, 34, 34, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9, 101,110,100, 10, 9, 9,105,102, 32,112, 46, 98, 97,115,101, 32, 97,110,100, 32,112, 46, 98, 97,115,101, 32,126, 61, 32, 39, 39, 32, 97,110,100, 32,112, 46, 98, 97,115,101, 32,126, 61, 32,116, 32,116,104,101,110, 10, 9, 9, 9, 45, 45,112, 114,105,110,116, 40, 34,116,121,112,101, 32,105,115, 32, 34, 46, 46,116, 46, 46, 34, 44, 32,112, 32,105,115, 32, 34, 46, 46,112, 46, 98, 97,115,101, 46, 46, 34, 32,115,101,108,102, 46,116,121,112,101, 32,105,115, 32, 34, 46, 46,115,101,108, 102, 46,116,121,112,101, 46, 46, 34, 32,115,101,108,102, 46, 110, 97,109,101, 32,105,115, 32, 34, 46, 46,115,101,108,102, 46,110, 97,109,101, 41, 10, 9, 9, 9,112, 32, 61, 32, 95, 103,108,111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91, 112, 58,102,105,110,100,116,121,112,101, 40,112, 46, 98, 97, 115,101, 41, 93, 10, 9, 9,101,108,115,101, 10, 9, 9, 9, 112, 32, 61, 32,110,105,108, 10, 9, 9,101,110,100, 10, 9, 101,110,100, 10, 10, 9,114,101,116,117,114,110, 32,110,105, 108, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, 97,112,112,101,110,100, 95,103,108,111, 98, 97,108, 95, 116,121,112,101, 40,116, 44, 32, 99,108, 97,115,115, 41, 10, 9, 95,103,108,111, 98, 97,108, 95,116,121,112,101,115, 46, 110, 32, 61, 32, 95,103,108,111, 98, 97,108, 95,116,121,112, 101,115, 46,110, 32, 43, 49, 10, 9, 95,103,108,111, 98, 97, 108, 95,116,121,112,101,115, 91, 95,103,108,111, 98, 97,108, 95,116,121,112,101,115, 46,110, 93, 32, 61, 32,116, 10, 9, 95,103,108,111, 98, 97,108, 95,116,121,112,101,115, 95,104, 97,115,104, 91,116, 93, 32, 61, 32, 49, 10, 9,105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 32, 97,112,112,101, 110,100, 95, 99,108, 97,115,115, 95,116,121,112,101, 40,116, 44, 32, 99,108, 97,115,115, 41, 32,101,110,100, 10,101,110, 100, 10, 10,102,117,110, 99,116,105,111,110, 32, 97,112,112, 101,110,100, 95, 99,108, 97,115,115, 95,116,121,112,101, 40, 116, 44, 99,108, 97,115,115, 41, 10, 9,105,102, 32, 95,103, 108,111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91,116, 93, 32,116,104,101,110, 10, 9, 9, 99,108, 97,115,115, 46, 102,108, 97,103,115, 32, 61, 32, 95,103,108,111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91,116, 93, 46,102,108, 97, 103,115, 10, 9, 9, 99,108, 97,115,115, 46,108,110, 97,109, 101,115, 32, 61, 32, 95,103,108,111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91,116, 93, 46,108,110, 97,109,101,115, 10, 9, 9,105,102, 32, 95,103,108,111, 98, 97,108, 95, 99, 108, 97,115,115,101,115, 91,116, 93, 46, 98, 97,115,101, 32, 97,110,100, 32, 40, 95,103,108,111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91,116, 93, 46, 98, 97,115,101, 32,126, 61, 32, 39, 39, 41, 32,116,104,101,110, 10, 9, 9, 9, 99, 108, 97,115,115, 46, 98, 97,115,101, 32, 61, 32, 95,103,108, 111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91,116, 93, 46, 98, 97,115,101, 32,111,114, 32, 99,108, 97,115,115, 46, 98, 97,115,101, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10, 9, 95,103,108,111, 98, 97,108, 95, 99,108, 97,115,115, 101,115, 91,116, 93, 32, 61, 32, 99,108, 97,115,115, 10, 9, 99,108, 97,115,115, 46,102,108, 97,103,115, 32, 61, 32, 99, 108, 97,115,115, 46,102,108, 97,103,115, 32,111,114, 32,123, 125, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109, 97,116, 99,104, 95,116,121,112,101, 40, 99,104,105, 108,100,116,121,112,101, 44, 32,114,101,103,116,121,112,101, 44, 32,115,116, 41, 10, 45, 45,112,114,105,110,116, 40, 34, 102,105,110,100,116,121,112,101, 32, 34, 46, 46, 99,104,105, 108,100,116,121,112,101, 46, 46, 34, 44, 32, 34, 46, 46,114, 101,103,116,121,112,101, 46, 46, 34, 44, 32, 34, 46, 46,115, 116, 41, 10, 9,108,111, 99, 97,108, 32, 98, 44,101, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,114,101, 103,116,121,112,101, 44, 32, 99,104,105,108,100,116,121,112, 101, 44, 32, 45,115,116,114,105,110,103, 46,108,101,110, 40, 99,104,105,108,100,116,121,112,101, 41, 44, 32,116,114,117, 101, 41, 10, 9,105,102, 32, 98, 32,116,104,101,110, 10, 10, 9, 9,105,102, 32,101, 32, 61, 61, 32,115,116,114,105,110, 103, 46,108,101,110, 40,114,101,103,116,121,112,101, 41, 32, 97,110,100, 10, 9, 9, 9, 9, 40, 98, 32, 61, 61, 32, 49, 32,111,114, 32, 40,115,116,114,105,110,103, 46,115,117, 98, 40,114,101,103,116,121,112,101, 44, 32, 98, 45, 49, 44, 32, 98, 45, 49, 41, 32, 61, 61, 32, 39, 58, 39, 32, 97,110,100, 10, 9, 9, 9, 9,115,116,114,105,110,103, 46,115,117, 98, 40,114,101,103,116,121,112,101, 44, 32, 49, 44, 32, 98, 45, 49, 41, 32, 61, 61, 32,115,116,114,105,110,103, 46,115,117, 98, 40,115,116, 44, 32, 49, 44, 32, 98, 45, 49, 41, 41, 41, 32,116,104,101,110, 10, 9, 9, 9,114,101,116,117,114,110, 32,116,114,117,101, 10, 9, 9,101,110,100, 10, 9,101,110, 100, 10, 10, 9,114,101,116,117,114,110, 32,102, 97,108,115, 101, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,102,105,110,100,116,121,112,101, 95,111,110, 95, 99,104, 105,108,100,115, 40,115,101,108,102, 44, 32,116, 41, 10, 10, 9,108,111, 99, 97,108, 32,116, 99,104,105,108,100, 10, 9, 105,102, 32,115,101,108,102, 46, 99,108, 97,115,115,116,121, 112,101, 32, 61, 61, 32, 39, 99,108, 97,115,115, 39, 32,111, 114, 32,115,101,108,102, 46, 99,108, 97,115,115,116,121,112, 101, 32, 61, 61, 32, 39,110, 97,109,101,115,112, 97, 99,101, 39, 32,116,104,101,110, 10, 9, 9,102,111,114, 32,107, 44, 118, 32,105,110, 32,105,112, 97,105,114,115, 40,115,101,108, 102, 41, 32,100,111, 10, 9, 9, 9,105,102, 32,118, 46, 99, 108, 97,115,115,116,121,112,101, 32, 61, 61, 32, 39, 99,108, 97,115,115, 39, 32,111,114, 32,118, 46, 99,108, 97,115,115, 116,121,112,101, 32, 61, 61, 32, 39,110, 97,109,101,115,112, 97, 99,101, 39, 32,116,104,101,110, 10, 9, 9, 9, 9,105, 102, 32,118, 46,116,121,112,101,100,101,102,115, 32, 97,110, 100, 32,118, 46,116,121,112,101,100,101,102,115, 91,116, 93, 32,116,104,101,110, 10, 9, 9, 9, 9, 32,114,101,116,117, 114,110, 32,118, 46,116,121,112,101,100,101,102,115, 91,116, 93, 10, 9, 9, 9, 9,101,108,115,101,105,102, 32,118, 46, 117,115,101,114,116,121,112,101,115, 32, 97,110,100, 32,118, 46,117,115,101,114,116,121,112,101,115, 91,116, 93, 32,116, 104,101,110, 10, 9, 9, 9, 9, 32,114,101,116,117,114,110, 32,118, 46,117,115,101,114,116,121,112,101,115, 91,116, 93, 10, 9, 9, 9, 9,101,110,100, 10, 9, 9, 9, 9,116, 99, 104,105,108,100, 32, 61, 32,102,105,110,100,116,121,112,101, 95,111,110, 95, 99,104,105,108,100,115, 40,118, 44, 32,116, 41, 10, 9, 9, 9, 9,105,102, 32,116, 99,104,105,108,100, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,116, 99, 104,105,108,100, 32,101,110,100, 10, 9, 9, 9,101,110,100, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10, 9,114,101, 116,117,114,110, 32,110,105,108, 10, 10,101,110,100, 10, 10, 102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67, 111,110,116, 97,105,110,101,114, 58,105,115,101,110,117,109, 32, 40,116,121,112,101, 41, 10, 32,105,102, 32,103,108,111, 98, 97,108, 95,101,110,117,109,115, 91,116,121,112,101, 93, 32,116,104,101,110, 10, 9,114,101,116,117,114,110, 32,116, 121,112,101, 10, 32,101,108,115,101, 10, 32, 9,114,101,116, 117,114,110, 32,102, 97,108,115,101, 10, 32,101,110,100, 10, 10, 32,108,111, 99, 97,108, 32, 98, 97,115,101,116,121,112, 101, 32, 61, 32,103,115,117, 98, 40,116,121,112,101, 44, 34, 94, 46, 42, 58, 58, 34, 44, 34, 34, 41, 10, 32,108,111, 99, 97,108, 32,101,110,118, 32, 61, 32,115,101,108,102, 10, 32, 119,104,105,108,101, 32,101,110,118, 32,100,111, 10, 32, 32, 105,102, 32,101,110,118, 46,101,110,117,109,115, 32,116,104, 101,110, 10, 32, 32, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32, 32, 32,119,104,105,108,101, 32,101,110,118, 46,101, 110,117,109,115, 91,105, 93, 32,100,111, 10, 32, 32, 32, 32, 105,102, 32,101,110,118, 46,101,110,117,109,115, 91,105, 93, 46,110, 97,109,101, 32, 61, 61, 32, 98, 97,115,101,116,121, 112,101, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,116,114,117,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32, 32, 32, 101,110,100, 10, 32, 32,101,110,100, 10, 32, 32,101,110,118, 32, 61, 32,101,110,118, 46,112, 97,114,101,110,116, 10, 32, 101,110,100, 10, 32,114,101,116,117,114,110, 32,102, 97,108, 115,101, 10,101,110,100, 10, 10,109,101,116,104,111,100,105, 115,118,105,114,116,117, 97,108, 32, 61, 32,102, 97,108,115, 101, 32, 45, 45, 32, 97, 32,103,108,111, 98, 97,108, 10, 10, 45, 45, 32,112, 97,114,115,101, 32, 99,104,117,110,107, 10, 102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67, 111,110,116, 97,105,110,101,114, 58,100,111,112, 97,114,115, 101, 32, 40,115, 41, 10, 45, 45,112,114,105,110,116, 32, 40, 34,112, 97,114,115,101, 32, 34, 46, 46,115, 41, 10, 10, 32, 45, 45, 32,116,114,121, 32,116,104,101, 32,112, 97,114,115, 101,114, 32,104,111,111,107, 10, 32,100,111, 10, 32, 9,108, 111, 99, 97,108, 32,115,117, 98, 32, 61, 32,112, 97,114,115, 101,114, 95,104,111,111,107, 40,115, 41, 10, 32, 9,105,102, 32,115,117, 98, 32,116,104,101,110, 10, 32, 9, 9,114,101, 116,117,114,110, 32,115,117, 98, 10, 32, 9,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,116, 104,101, 32,110,117,108,108, 32,115,116, 97,116,101,109,101, 110,116, 10, 32,100,111, 10, 32, 9,108,111, 99, 97,108, 32, 98, 44,101, 44, 99,111,100,101, 32, 61, 32,115,116,114,105, 110,103, 46,102,105,110,100, 40,115, 44, 32, 34, 94, 37,115, 42, 59, 34, 41, 10, 32, 9,105,102, 32, 98, 32,116,104,101, 110, 10, 32, 9, 9,114,101,116,117,114,110, 32,115,116,114, 115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 9,101,110, 100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,101,109,112,116,121, 32,118,101,114, 98, 97,116,105,109, 32,108,105,110,101, 10, 32,100,111, 10, 32, 9,108,111, 99, 97,108, 32, 98, 44,101, 44, 99,111,100,101, 32, 61, 32,115, 116,114,105,110,103, 46,102,105,110,100, 40,115, 44, 32, 34, 94, 37,115, 42, 36, 92,110, 34, 41, 10, 32, 9,105,102, 32, 98, 32,116,104,101,110, 10, 32, 9, 9,114,101,116,117,114, 110, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 9,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32, 76,117, 97, 32, 99,111,100,101, 10, 32,100,111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44, 99,111,100,101, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 37, 98, 92, 49, 92, 50, 41, 34, 41, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 67,111,100,101, 40,115,116,114,115,117, 98, 40, 99,111,100,101, 44, 50, 44, 45, 50, 41, 41, 10, 32, 32, 32,114,101,116,117,114,110, 32,115,116,114,115,117, 98, 40, 115, 44,101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32,101, 110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32, 67, 32, 99, 111,100,101, 10, 32,100,111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44, 99,111,100,101, 32, 61, 32,115,116,114, 102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 37, 98, 92, 51, 92, 52, 41, 34, 41, 10, 32, 32,105,102, 32, 98, 32, 116,104,101,110, 10, 9, 99,111,100,101, 32, 61, 32, 39,123, 39, 46, 46,115,116,114,115,117, 98, 40, 99,111,100,101, 44, 50, 44, 45, 50, 41, 46, 46, 39, 92,110,125, 92,110, 39, 10, 9, 86,101,114, 98, 97,116,105,109, 40, 99,111,100,101, 44, 39,114, 39, 41, 32, 32, 32, 32, 32, 32, 32, 32, 45, 45, 32, 118,101,114, 98, 97,116,105,109, 32, 99,111,100,101, 32,102, 111,114, 32, 39,114, 39,101,103,105,115,116,101,114, 32,102, 114, 97,103,109,101,110,116, 10, 9,114,101,116,117,114,110, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32, 67, 32, 99,111,100,101, 32,102,111,114, 32,112,114,101, 97,109, 98,108,101, 32,115,101, 99,116,105, 111,110, 10, 32,100,111, 10, 32, 9,108,111, 99, 97,108, 32, 98, 44,101, 44, 99,111,100,101, 32, 61, 32,115,116,114,105, 110,103, 46,102,105,110,100, 40,115, 44, 32, 34, 94, 37,115, 42, 40, 37, 98, 92, 53, 92, 54, 41, 34, 41, 10, 32, 9,105, 102, 32, 98, 32,116,104,101,110, 10, 32, 9, 9, 99,111,100, 101, 32, 61, 32,115,116,114,105,110,103, 46,115,117, 98, 40, 99,111,100,101, 44, 32, 50, 44, 32, 45, 50, 41, 46, 46, 34, 92,110, 34, 10, 9, 9, 86,101,114, 98, 97,116,105,109, 40, 99,111,100,101, 44, 32, 39, 39, 41, 10, 9, 9,114,101,116, 117,114,110, 32,115,116,114,105,110,103, 46,115,117, 98, 40, 115, 44, 32,101, 43, 49, 41, 10, 32, 9,101,110,100, 10, 32, 101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,100,101, 102, 97,117,108,116, 95,112,114,111,112,101,114,116,121, 32, 100,105,114,101, 99,116,105,118,101, 10, 32,100,111, 10, 32, 9,108,111, 99, 97,108, 32, 98, 44,101, 44,112,116,121,112, 101, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 32, 34, 94, 37,115, 42, 84, 79, 76, 85, 65, 95, 80, 82, 79, 80, 69, 82, 84, 89, 95, 84, 89, 80, 69, 37,115, 42, 37, 40, 43, 37,115, 42, 40, 91, 94, 37, 41, 37,115, 93, 42, 41, 37,115, 42, 37, 41, 43, 37,115, 42, 59, 63, 34, 41, 10, 32, 9,105, 102, 32, 98, 32,116,104,101,110, 10, 32, 9, 9,105,102, 32, 110,111,116, 32,112,116,121,112,101, 32,111,114, 32,112,116, 121,112,101, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, 9, 9, 9,112,116,121,112,101, 32, 61, 32, 34,100,101, 102, 97,117,108,116, 34, 10, 32, 9, 9,101,110,100, 10, 32, 9, 9,115,101,108,102, 58,115,101,116, 95,112,114,111,112, 101,114,116,121, 95,116,121,112,101, 40,112,116,121,112,101, 41, 10, 9, 32, 9,114,101,116,117,114,110, 32,115,116,114, 115,117, 98, 40,115, 44, 32,101, 43, 49, 41, 10, 32, 9,101, 110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114, 121, 32,112,114,111,116,101, 99,116,101,100, 95,100,101,115, 116,114,117, 99,116,111,114, 32,100,105,114,101, 99,116,105, 118,101, 10, 32,100,111, 10, 32, 9,108,111, 99, 97,108, 32, 98, 44,101, 32, 61, 32,115,116,114,105,110,103, 46,102,105, 110,100, 40,115, 44, 32, 34, 94, 37,115, 42, 84, 79, 76, 85, 65, 95, 80, 82, 79, 84, 69, 67, 84, 69, 68, 95, 68, 69, 83, 84, 82, 85, 67, 84, 79, 82, 37,115, 42, 59, 63, 34, 41, 10, 9,105,102, 32, 98, 32,116,104,101,110, 10, 9, 9,105,102, 32,115,101,108,102, 46,115,101,116, 95,112,114,111,116,101, 99,116,101,100, 95,100,101,115,116,114,117, 99,116,111,114, 32,116,104,101,110, 10, 9, 32, 9, 9,115,101,108,102, 58, 115,101,116, 95,112,114,111,116,101, 99,116,101,100, 95,100, 101,115,116,114,117, 99,116,111,114, 40,116,114,117,101, 41, 10, 9, 32, 9,101,110,100, 10, 32, 9, 9,114,101,116,117, 114,110, 32,115,116,114,115,117, 98, 40,115, 44, 32,101, 43, 49, 41, 10, 32, 9,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32, 39,101,120,116,101,114,110, 39, 32,107,101,121,119,111,114,100, 10, 32,100,111, 10, 32, 9,108,111, 99, 97,108, 32, 98, 44,101, 32, 61, 32,115,116, 114,105,110,103, 46,102,105,110,100, 40,115, 44, 32, 34, 94, 37,115, 42,101,120,116,101,114,110, 37,115, 43, 34, 41, 10, 32, 9,105,102, 32, 98, 32,116,104,101,110, 10, 9, 9, 45, 45, 32,100,111, 32,110,111,116,104,105,110,103, 10, 32, 9, 9,114,101,116,117,114,110, 32,115,116,114,115,117, 98, 40, 115, 44, 32,101, 43, 49, 41, 10, 32, 9,101,110,100, 10, 32, 101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32, 39,118, 105,114,116,117, 97,108, 39, 32,107,101,121,119,111,114,107, 100, 10, 32,100,111, 10, 32, 9,108,111, 99, 97,108, 32, 98, 44,101, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110, 100, 40,115, 44, 32, 34, 94, 37,115, 42,118,105,114,116,117, 97,108, 37,115, 43, 34, 41, 10, 32, 9,105,102, 32, 98, 32, 116,104,101,110, 10, 32, 9, 9,109,101,116,104,111,100,105, 115,118,105,114,116,117, 97,108, 32, 61, 32,116,114,117,101, 10, 32, 9, 9,114,101,116,117,114,110, 32,115,116,114,115, 117, 98, 40,115, 44, 32,101, 43, 49, 41, 10, 32, 9,101,110, 100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,108, 97, 98,101,108,115, 32, 40,112,117, 98,108,105, 99, 44, 32,112,114,105,118, 97,116,101, 44, 32,101,116, 99, 41, 10, 32,100,111, 10, 32, 9,108,111, 99, 97,108, 32, 98, 44, 101, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,115, 44, 32, 34, 94, 37,115, 42, 37,119, 42, 37,115, 42, 58, 91, 94, 58, 93, 34, 41, 10, 32, 9,105,102, 32, 98, 32, 116,104,101,110, 10, 32, 9, 9,114,101,116,117,114,110, 32, 115,116,114,115,117, 98, 40,115, 44, 32,101, 41, 32, 45, 45, 32,112,114,101,115,101,114,118,101, 32,116,104,101, 32, 91, 94, 58, 93, 10, 32, 9,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,109,111,100,117,108,101, 10, 32,100,111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44, 101, 44,110, 97,109,101, 44, 98,111,100,121, 32, 61, 32,115, 116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42,109, 111,100,117,108,101, 37,115, 37,115, 42, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 93, 42, 41, 37,115, 42, 40, 37, 98,123, 125, 41, 37,115, 42, 34, 41, 10, 32, 32,105,102, 32, 98, 32, 116,104,101,110, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99, 111,100,101, 32, 61, 32,115,116,114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 32, 32, 32, 77,111,100,117,108,101, 40, 110, 97,109,101, 44, 98,111,100,121, 41, 10, 32, 32, 32,114, 101,116,117,114,110, 32,115,116,114,115,117, 98, 40,115, 44, 101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,110, 97,109,101,115, 97,112, 99,101, 10, 32,100,111, 10, 32, 32,108,111, 99, 97, 108, 32, 98, 44,101, 44,110, 97,109,101, 44, 98,111,100,121, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42,110, 97,109,101,115,112, 97, 99,101, 37,115, 37, 115, 42, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 93, 42, 41, 37,115, 42, 40, 37, 98,123,125, 41, 37,115, 42, 59, 63, 34, 41, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32, 115,116,114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 32, 32, 32, 78, 97,109,101,115,112, 97, 99,101, 40,110, 97,109, 101, 44, 98,111,100,121, 41, 10, 32, 32, 32,114,101,116,117, 114,110, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,100,101,102,105,110,101, 10, 32, 100,111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44, 110, 97,109,101, 32, 61, 32,115,116,114,102,105,110,100, 40, 115, 44, 34, 94, 37,115, 42, 35,100,101,102,105,110,101, 37, 115, 37,115, 42, 40, 91, 94, 37,115, 93, 42, 41, 91, 94, 92, 110, 93, 42, 92,110, 37,115, 42, 34, 41, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 95, 99,117,114, 114, 95, 99,111,100,101, 32, 61, 32,115,116,114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 32, 32, 32, 68,101,102,105, 110,101, 40,110, 97,109,101, 41, 10, 32, 32, 32,114,101,116, 117,114,110, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,101,110,117,109,101,114, 97, 116,101,115, 10, 10, 32,100,111, 10, 32, 32,108,111, 99, 97, 108, 32, 98, 44,101, 44,110, 97,109,101, 44, 98,111,100,121, 44,118, 97,114,110, 97,109,101, 32, 61, 32,115,116,114,102, 105,110,100, 40,115, 44, 34, 94, 37,115, 42,101,110,117,109, 37,115, 43, 40, 37, 83, 42, 41, 37,115, 42, 40, 37, 98,123, 125, 41, 37,115, 42, 40, 91, 94, 37,115, 59, 93, 42, 41, 37, 115, 42, 59, 63, 37,115, 42, 34, 41, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 45, 45,101,114,114, 111,114, 40, 34, 35, 83,111,114,114,121, 44, 32,100,101, 99, 108, 97,114, 97,116,105,111,110, 32,111,102, 32,101,110,117, 109,115, 32, 97,110,100, 32,118, 97,114,105, 97, 98,108,101, 115, 32,111,110, 32,116,104,101, 32,115, 97,109,101, 32,115, 116, 97,116,101,109,101,110,116, 32,105,115, 32,110,111,116, 32,115,117,112,112,111,114,116,101,100, 46, 92,110, 68,101, 99,108, 97,114,101, 32,121,111,117,114, 32,118, 97,114,105, 97, 98,108,101, 32,115,101,112, 97,114, 97,116,101,108,121, 32, 40,101,120, 97,109,112,108,101, 58, 32, 39, 34, 46, 46, 110, 97,109,101, 46, 46, 34, 32, 34, 46, 46,118, 97,114,110, 97,109,101, 46, 46, 34, 59, 39, 41, 34, 41, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32,115,116, 114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 32, 32, 32, 69,110,117,109,101,114, 97,116,101, 40,110, 97,109,101, 44, 98,111,100,121, 44,118, 97,114,110, 97,109,101, 41, 10, 32, 32, 32,114,101,116,117,114,110, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32, 101,110,100, 10, 10, 45, 45, 32,100,111, 10, 45, 45, 32, 32, 108,111, 99, 97,108, 32, 98, 44,101, 44,110, 97,109,101, 44, 98,111,100,121, 32, 61, 32,115,116,114,102,105,110,100, 40, 115, 44, 34, 94, 37,115, 42,101,110,117,109, 37,115, 43, 40, 37, 83, 42, 41, 37,115, 42, 40, 37, 98,123,125, 41, 37,115, 42, 59, 63, 37,115, 42, 34, 41, 10, 45, 45, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 45, 45, 32, 32, 32, 95, 99, 117,114,114, 95, 99,111,100,101, 32, 61, 32,115,116,114,115, 117, 98, 40,115, 44, 98, 44,101, 41, 10, 45, 45, 32, 32, 32, 69,110,117,109,101,114, 97,116,101, 40,110, 97,109,101, 44, 98,111,100,121, 41, 10, 45, 45, 32, 32,114,101,116,117,114, 110, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 45, 45, 32, 32,101,110,100, 10, 45, 45, 32,101,110,100, 10, 10, 32,100,111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44, 98,111,100,121, 44,110, 97,109,101, 32, 61, 32, 115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 116,121,112,101,100,101,102, 37,115, 43,101,110,117,109, 91, 94,123, 93, 42, 40, 37, 98,123,125, 41, 37,115, 42, 40, 91, 37,119, 95, 93, 91, 94, 37,115, 93, 42, 41, 37,115, 42, 59, 37,115, 42, 34, 41, 10, 32, 32,105,102, 32, 98, 32,116,104, 101,110, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99,111,100, 101, 32, 61, 32,115,116,114,115,117, 98, 40,115, 44, 98, 44, 101, 41, 10, 32, 32, 32, 69,110,117,109,101,114, 97,116,101, 40,110, 97,109,101, 44, 98,111,100,121, 41, 10, 32, 32, 32, 114,101,116,117,114,110, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32,101,110, 100, 10, 10, 32, 45, 45, 32,116,114,121, 32,111,112,101,114, 97,116,111,114, 10, 32,100,111, 10, 32, 32,108,111, 99, 97, 108, 32, 98, 44,101, 44,100,101, 99,108, 44,107,105,110,100, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116, 114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 37,115, 37, 42, 38, 58, 60, 62, 44, 93, 45, 37,115, 43,111,112,101,114, 97,116,111,114, 41, 37,115, 42, 40, 91, 94, 37,115, 93, 91, 94, 37,115, 93, 42, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63,111, 63,110, 63,115, 63,116, 63, 41, 37,115, 42, 59, 37,115, 42, 34, 41, 10, 32, 32,105,102, 32,110,111,116, 32, 98, 32,116,104,101,110, 10, 9, 9, 32, 45, 45, 32,116,114, 121, 32,105,110,108,105,110,101, 10, 32, 32, 32, 98, 44,101, 44,100,101, 99,108, 44,107,105,110,100, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 37,115, 37, 42, 38, 58, 60, 62, 44, 93, 45, 37, 115, 43,111,112,101,114, 97,116,111,114, 41, 37,115, 42, 40, 91, 94, 37,115, 93, 91, 94, 37,115, 93, 42, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63,111, 63,110, 63,115, 63,116, 63, 41, 91, 37,115, 92,110, 93, 42, 37, 98, 123,125, 37,115, 42, 59, 63, 37,115, 42, 34, 41, 10, 32, 32, 101,110,100, 10, 32, 32,105,102, 32,110,111,116, 32, 98, 32, 116,104,101,110, 10, 32, 32, 9, 45, 45, 32,116,114,121, 32, 99, 97,115,116, 32,111,112,101,114, 97,116,111,114, 10, 32, 32, 9, 98, 44,101, 44,100,101, 99,108, 44,107,105,110,100, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116, 114,102,105,110,100, 40,115, 44, 32, 34, 94, 37,115, 42, 40, 111,112,101,114, 97,116,111,114, 41, 37,115, 43, 40, 91, 37, 119, 95, 58, 37,100, 60, 62, 37, 42, 37, 38, 37,115, 93, 43, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63,111, 63,110, 63,115, 63,116, 63, 41, 34, 41, 59, 10, 32, 32, 9,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 9, 9,108,111, 99, 97,108, 32, 95, 44,105,101, 32, 61, 32,115, 116,114,105,110,103, 46,102,105,110,100, 40,115, 44, 32, 34, 94, 37,115, 42, 37, 98,123,125, 34, 44, 32,101, 43, 49, 41, 10, 32, 32, 9, 9,105,102, 32,105,101, 32,116,104,101,110, 10, 32, 32, 9, 9, 9,101, 32, 61, 32,105,101, 10, 32, 32, 9, 9,101,110,100, 10, 32, 32, 9,101,110,100, 10, 32, 32, 101,110,100, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32,115,116,114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 32, 32, 32, 79,112,101,114, 97,116,111,114, 40,100,101, 99,108, 44,107,105,110,100, 44, 97,114,103, 44, 99,111,110, 115,116, 41, 10, 32, 32, 32,114,101,116,117,114,110, 32,115, 116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32, 101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116, 114,121, 32,102,117,110, 99,116,105,111,110, 10, 32,100,111, 10, 32, 32, 45, 45,108,111, 99, 97,108, 32, 98, 44,101, 44, 100,101, 99,108, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37, 115, 42, 40, 91,126, 95, 37,119, 93, 91, 95, 64, 37,119, 37, 115, 37, 42, 38, 58, 60, 62, 93, 42, 91, 95, 37,119, 93, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63, 111, 63,110, 63,115, 63,116, 63, 41, 37,115, 42, 61, 63, 37, 115, 42, 48, 63, 37,115, 42, 59, 37,115, 42, 34, 41, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44,100,101, 99,108, 44, 97,114,103, 44, 99,111,110,115,116, 44,118,105,114,116, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 91, 94, 37, 40, 92,110, 93, 43, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63,111, 63, 110, 63,115, 63,116, 63, 41, 37,115, 42, 40, 61, 63, 37,115, 42, 48, 63, 41, 37,115, 42, 59, 37,115, 42, 34, 41, 10, 32, 32,105,102, 32,110,111,116, 32, 98, 32,116,104,101,110, 10, 32, 32, 9, 45, 45, 32,116,114,121, 32,102,117,110, 99,116, 105,111,110, 32,119,105,116,104, 32,116,101,109,112,108, 97, 116,101, 10, 32, 32, 9, 98, 44,101, 44,100,101, 99,108, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116,114, 102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 91,126, 95, 37,119, 93, 91, 95, 64, 37,119, 37,115, 37, 42, 38, 58, 60, 62, 93, 42, 91, 95, 37,119, 93, 37, 98, 60, 62, 41, 37, 115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63,111, 63,110, 63,115, 63,116, 63, 41, 37,115, 42, 61, 63, 37,115, 42, 48, 63, 37,115, 42, 59, 37,115, 42, 34, 41, 10, 32, 32, 101,110,100, 10, 32, 32,105,102, 32,110,111,116, 32, 98, 32, 116,104,101,110, 10, 32, 32, 32, 45, 45, 32,116,114,121, 32, 97, 32,115,105,110,103,108,101, 32,108,101,116,116,101,114, 32,102,117,110, 99,116,105,111,110, 32,110, 97,109,101, 10, 32, 32, 32, 98, 44,101, 44,100,101, 99,108, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116,114,102,105,110, 100, 40,115, 44, 34, 94, 37,115, 42, 40, 91, 95, 37,119, 93, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63,111, 63,110, 63,115, 63,116, 63, 41, 37,115, 42, 59, 37, 115, 42, 34, 41, 10, 32, 32,101,110,100, 10, 32, 32,105,102, 32,110,111,116, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 45, 45, 32,116,114,121, 32,102,117,110, 99,116,105,111,110, 32,112,111,105,110,116,101,114, 10, 32, 32, 32, 98, 44,101, 44,100,101, 99,108, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 91, 94, 37, 40, 59, 92,110, 93, 43, 37, 98, 40, 41, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 59, 37,115, 42, 34, 41, 10, 32, 32, 32,105,102, 32, 98, 32, 116,104,101,110, 10, 32, 32, 32, 32,100,101, 99,108, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,100,101, 99,108, 44, 32, 34, 37, 40, 37,115, 42, 37, 42, 40, 91, 94, 37, 41, 93, 42, 41, 37,115, 42, 37, 41, 34, 44, 32, 34, 32, 37, 49, 32, 34, 41, 10, 32, 32, 32,101,110,100, 10, 32, 32, 101,110,100, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 9,105,102, 32,118,105,114,116, 32, 97,110,100, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,118,105, 114,116, 44, 32, 34, 91, 61, 48, 93, 34, 41, 32,116,104,101, 110, 10, 32, 32, 9, 9,105,102, 32,115,101,108,102, 46,102, 108, 97,103,115, 32,116,104,101,110, 10, 32, 32, 9, 9, 9, 115,101,108,102, 46,102,108, 97,103,115, 46,112,117,114,101, 95,118,105,114,116,117, 97,108, 32, 61, 32,116,114,117,101, 10, 32, 32, 9, 9,101,110,100, 10, 32, 32, 9,101,110,100, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32,115,116,114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 32, 32, 32, 70,117,110, 99,116,105,111,110, 40,100,101, 99,108, 44, 97,114,103, 44, 99,111,110,115,116, 41, 10, 32, 32, 32,114,101,116,117,114,110, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32, 101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,105,110, 108,105,110,101, 32,102,117,110, 99,116,105,111,110, 10, 32, 100,111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44, 100,101, 99,108, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37, 115, 42, 40, 91, 94, 37, 40, 92,110, 93, 43, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63,111, 63,110, 63,115, 63,116, 63, 41, 91, 94, 59,123, 93, 42, 37, 98,123, 125, 37,115, 42, 59, 63, 37,115, 42, 34, 41, 10, 32, 32, 45, 45,108,111, 99, 97,108, 32, 98, 44,101, 44,100,101, 99,108, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116, 114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 91, 126, 95, 37,119, 93, 91, 95, 64, 37,119, 37,115, 37, 42, 38, 58, 60, 62, 93, 42, 91, 95, 37,119, 62, 93, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63,111, 63,110, 63,115, 63,116, 63, 41, 91, 94, 59, 93, 42, 37, 98,123,125, 37,115, 42, 59, 63, 37,115, 42, 34, 41, 10, 32, 32,105,102, 32,110,111,116, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 45, 45, 32,116,114,121, 32, 97, 32,115,105,110,103,108,101, 32,108,101,116,116,101,114, 32,102,117,110, 99,116,105,111, 110, 32,110, 97,109,101, 10, 32, 32, 32, 98, 44,101, 44,100, 101, 99,108, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 91, 95, 37,119, 93, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63,111, 63,110, 63,115, 63,116, 63, 41, 46, 45, 37, 98,123,125, 37,115, 42, 59, 63, 37,115, 42, 34, 41, 10, 32, 32,101,110,100, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32,115,116,114,115,117, 98, 40, 115, 44, 98, 44,101, 41, 10, 32, 32, 32, 70,117,110, 99,116, 105,111,110, 40,100,101, 99,108, 44, 97,114,103, 44, 99,111, 110,115,116, 41, 10, 32, 32, 32,114,101,116,117,114,110, 32, 115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 116,114,121, 32, 99,108, 97,115,115, 10, 32,100,111, 10, 9, 32,108,111, 99, 97,108, 32, 98, 44,101, 44,110, 97,109,101, 44, 98, 97,115,101, 44, 98,111,100,121, 10, 9, 9, 98, 97, 115,101, 32, 61, 32, 39, 39, 32, 98,111,100,121, 32, 61, 32, 39, 39, 10, 9, 9, 98, 44,101, 44,110, 97,109,101, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 99,108, 97,115,115, 37,115, 42, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 64, 93, 42, 41, 37,115, 42, 59, 34, 41, 32, 32, 45, 45, 32,100,117,109,109,121, 32, 99,108, 97,115,115, 10, 9, 9,108,111, 99, 97,108, 32,100,117,109,109,121, 32, 61, 32,102, 97,108,115,101, 10, 9, 9,105,102, 32,110,111, 116, 32, 98, 32,116,104,101,110, 10, 9, 9, 9, 98, 44,101, 44,110, 97,109,101, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42,115,116,114,117, 99,116, 37, 115, 42, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 64, 93, 42, 41, 37,115, 42, 59, 34, 41, 32, 32, 32, 32, 45, 45, 32,100, 117,109,109,121, 32,115,116,114,117, 99,116, 10, 9, 9, 9, 105,102, 32,110,111,116, 32, 98, 32,116,104,101,110, 10, 9, 9, 9, 9, 98, 44,101, 44,110, 97,109,101, 44, 98, 97,115, 101, 44, 98,111,100,121, 32, 61, 32,115,116,114,102,105,110, 100, 40,115, 44, 34, 94, 37,115, 42, 99,108, 97,115,115, 37, 115, 42, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 64, 93, 42, 41, 37,115, 42, 40, 91, 94,123, 93, 45, 41, 37,115, 42, 40, 37, 98,123,125, 41, 37,115, 42, 34, 41, 10, 9, 9, 9, 9, 105,102, 32,110,111,116, 32, 98, 32,116,104,101,110, 10, 9, 9, 9, 9, 9, 98, 44,101, 44,110, 97,109,101, 44, 98, 97, 115,101, 44, 98,111,100,121, 32, 61, 32,115,116,114,102,105, 110,100, 40,115, 44, 34, 94, 37,115, 42,115,116,114,117, 99, 116, 37,115, 43, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 64, 93, 42, 41, 37,115, 42, 40, 91, 94,123, 93, 45, 41, 37,115, 42, 40, 37, 98,123,125, 41, 37,115, 42, 34, 41, 10, 9, 9, 9, 9, 9,105,102, 32,110,111,116, 32, 98, 32,116,104,101, 110, 10, 9, 9, 9, 9, 9, 9, 98, 44,101, 44,110, 97,109, 101, 44, 98, 97,115,101, 44, 98,111,100,121, 32, 61, 32,115, 116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42,117, 110,105,111,110, 37,115, 42, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 64, 93, 42, 41, 37,115, 42, 40, 91, 94,123, 93, 45, 41, 37,115, 42, 40, 37, 98,123,125, 41, 37,115, 42, 34, 41, 10, 9, 9, 9, 9, 9, 9,105,102, 32,110,111,116, 32, 98, 32,116,104,101,110, 10, 9, 9, 9, 9, 9, 9, 9, 98, 97, 115,101, 32, 61, 32, 39, 39, 10, 9, 9, 9, 9, 9, 9, 9, 98, 44,101, 44, 98,111,100,121, 44,110, 97,109,101, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42,116,121,112,101,100,101,102, 37,115, 37,115, 42,115,116, 114,117, 99,116, 37,115, 37,115, 42, 91, 95, 37,119, 93, 42, 37,115, 42, 40, 37, 98,123,125, 41, 37,115, 42, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 64, 93, 42, 41, 37,115, 42, 59, 34, 41, 10, 9, 9, 9, 9, 9, 9,101,110,100, 10, 9, 9, 9, 9, 9,101,110,100, 10, 9, 9, 9, 9,101,110,100, 10, 9, 9, 9,101,108,115,101, 32,100,117,109,109,121, 32, 61, 32, 49, 32,101,110,100, 10, 9, 9,101,108,115,101, 32,100, 117,109,109,121, 32, 61, 32, 49, 32,101,110,100, 10, 9, 9, 105,102, 32, 98, 32,116,104,101,110, 10, 9, 9, 9,105,102, 32, 98, 97,115,101, 32,126, 61, 32, 39, 39, 32,116,104,101, 110, 10, 9, 9, 9, 9, 98, 97,115,101, 32, 61, 32,115,116, 114,105,110,103, 46,103,115,117, 98, 40, 98, 97,115,101, 44, 32, 34, 94, 37,115, 42, 58, 37,115, 42, 34, 44, 32, 34, 34, 41, 10, 9, 9, 9, 9, 98, 97,115,101, 32, 61, 32,115,116, 114,105,110,103, 46,103,115,117, 98, 40, 98, 97,115,101, 44, 32, 34, 37,115, 42,112,117, 98,108,105, 99, 37,115, 42, 34, 44, 32, 34, 34, 41, 10, 9, 9, 9, 9, 98, 97,115,101, 32, 61, 32,115,112,108,105,116, 40, 98, 97,115,101, 44, 32, 34, 44, 34, 41, 10, 9, 9, 9, 9, 45, 45,108,111, 99, 97,108, 32, 98, 44,101, 10, 9, 9, 9, 9, 45, 45, 98, 44,101, 44, 98, 97,115,101, 32, 61, 32,115,116,114,102,105,110,100, 40, 98, 97,115,101, 44, 34, 46, 45, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 60, 62, 44, 58, 93, 42, 41, 36, 34, 41, 10, 9, 9, 9,101,108,115,101, 10, 9, 9, 9, 9, 98, 97,115,101, 32, 61, 32,123,125, 10, 9, 9, 9,101,110,100, 10, 9, 9, 9, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32,115, 116,114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 9, 9, 9, 67,108, 97,115,115, 40,110, 97,109,101, 44, 98, 97,115, 101, 44, 98,111,100,121, 41, 10, 9, 9, 9,105,102, 32,110, 111,116, 32,100,117,109,109,121, 32,116,104,101,110, 10, 9, 9, 9, 9,118, 97,114, 98, 44,118, 97,114,101, 44,118, 97, 114,110, 97,109,101, 32, 61, 32,115,116,114,105,110,103, 46, 102,105,110,100, 40,115, 44, 32, 34, 94, 37,115, 42, 40, 91, 95, 37,119, 93, 43, 41, 37,115, 42, 59, 34, 44, 32,101, 43, 49, 41, 10, 9, 9, 9, 9,105,102, 32,118, 97,114, 98, 32, 116,104,101,110, 10, 9, 9, 9, 9, 9, 86, 97,114,105, 97, 98,108,101, 40,110, 97,109,101, 46, 46, 34, 32, 34, 46, 46, 118, 97,114,110, 97,109,101, 41, 10, 9, 9, 9, 9, 9,101, 32, 61, 32,118, 97,114,101, 10, 9, 9, 9, 9,101,110,100, 10, 9, 9, 9,101,110,100, 10, 9, 9, 9,114,101,116,117, 114,110, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,116,121,112,101,100,101,102, 10, 32,100,111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44,116,121,112,101,115, 32, 61, 32,115,116,114,102,105,110, 100, 40,115, 44, 34, 94, 37,115, 42,116,121,112,101,100,101, 102, 37,115, 37,115, 42, 40, 46, 45, 41, 37,115, 42, 59, 37, 115, 42, 34, 41, 10, 32, 32,105,102, 32, 98, 32,116,104,101, 110, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32,115,116,114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 32, 32, 32, 84,121,112,101,100,101,102, 40,116,121, 112,101,115, 41, 10, 32, 32, 32,114,101,116,117,114,110, 32, 115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 116,114,121, 32,118, 97,114,105, 97, 98,108,101, 10, 32,100, 111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44,100, 101, 99,108, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 91, 95, 37,119, 93, 91, 95, 64, 37,115, 37,119, 37,100, 37, 42, 38, 58, 60, 62, 44, 93, 42, 91, 95, 37,119, 37,100, 93, 41, 37,115, 42, 59, 37,115, 42, 34, 41, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32,115,116,114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 10, 9,108,111, 99, 97,108, 32,108,105,115,116, 32, 61, 32, 115,112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40, 100,101, 99,108, 44, 32, 34, 44, 34, 41, 10, 9, 86, 97,114, 105, 97, 98,108,101, 40,108,105,115,116, 91, 49, 93, 41, 10, 9,105,102, 32,108,105,115,116, 46,110, 32, 62, 32, 49, 32, 116,104,101,110, 10, 9, 9,108,111, 99, 97,108, 32, 95, 44, 95, 44,116,121,112,101, 32, 61, 32,115,116,114,102,105,110, 100, 40,108,105,115,116, 91, 49, 93, 44, 32, 34, 40, 46, 45, 41, 37,115, 43, 40, 91, 94, 37,115, 93, 42, 41, 36, 34, 41, 59, 10, 10, 9, 9,108,111, 99, 97,108, 32,105, 32, 61, 50, 59, 10, 9, 9,119,104,105,108,101, 32,108,105,115,116, 91, 105, 93, 32,100,111, 10, 9, 9, 9, 86, 97,114,105, 97, 98, 108,101, 40,116,121,112,101, 46, 46, 34, 32, 34, 46, 46,108, 105,115,116, 91,105, 93, 41, 10, 9, 9, 9,105, 61,105, 43, 49, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10, 32, 32, 32, 45, 45, 86, 97,114,105, 97, 98,108,101, 40,100,101, 99, 108, 41, 10, 32, 32, 32,114,101,116,117,114,110, 32,115,116, 114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101, 110,100, 10, 32,101,110,100, 10, 10, 9, 45, 45, 32,116,114, 121, 32,115,116,114,105,110,103, 10, 32,100,111, 10, 32, 32, 108,111, 99, 97,108, 32, 98, 44,101, 44,100,101, 99,108, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37, 115, 42, 40, 91, 95, 37,119, 93, 63, 91, 95, 37,115, 37,119, 37,100, 93, 45, 99,104, 97,114, 37,115, 43, 91, 95, 64, 37, 119, 37,100, 93, 42, 37,115, 42, 37, 91, 37,115, 42, 37, 83, 43, 37,115, 42, 37, 93, 41, 37,115, 42, 59, 37,115, 42, 34, 41, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32, 115,116,114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 32, 32, 32, 86, 97,114,105, 97, 98,108,101, 40,100,101, 99,108, 41, 10, 32, 32, 32,114,101,116,117,114,110, 32,115,116,114, 115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101,110, 100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32, 97,114,114, 97,121, 10, 32,100,111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44,100,101, 99,108, 32, 61, 32, 115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 91, 95, 37,119, 93, 91, 93, 91, 95, 64, 37,115, 37,119, 37,100, 37, 42, 38, 58, 60, 62, 93, 42, 91, 93, 95, 37,119, 37,100, 93, 41, 37,115, 42, 59, 37,115, 42, 34, 41, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32,115,116,114, 115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 32, 32, 32, 65, 114,114, 97,121, 40,100,101, 99,108, 41, 10, 32, 32, 32,114, 101,116,117,114,110, 32,115,116,114,115,117, 98, 40,115, 44, 101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,110,111, 32,109, 97,116, 99,104,105, 110,103, 10, 32,105,102, 32,103,115,117, 98, 40,115, 44, 34, 37,115, 37,115, 42, 34, 44, 34, 34, 41, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32,115, 10, 32, 32,101,114,114,111, 114, 40, 34, 35,112, 97,114,115,101, 32,101,114,114,111,114, 34, 41, 10, 32,101,108,115,101, 10, 32, 32,114,101,116,117, 114,110, 32, 34, 34, 10, 32,101,110,100, 10, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115, 115, 67,111,110,116, 97,105,110,101,114, 58,112, 97,114,115, 101, 32, 40,115, 41, 10, 10, 9, 45, 45,115,101,108,102, 46, 99,117,114,114, 95,109,101,109, 98,101,114, 95, 97, 99, 99, 101,115,115, 32, 61, 32,110,105,108, 10, 10, 32,119,104,105, 108,101, 32,115, 32,126, 61, 32, 39, 39, 32,100,111, 10, 32, 32,115, 32, 61, 32,115,101,108,102, 58,100,111,112, 97,114, 115,101, 40,115, 41, 10, 32, 32,109,101,116,104,111,100,105, 115,118,105,114,116,117, 97,108, 32, 61, 32,102, 97,108,115, 101, 10, 32,101,110,100, 10,101,110,100, 10, 10, 10, 45, 45, 32,112,114,111,112,101,114,116,121, 32,116,121,112,101,115, 10, 10,102,117,110, 99,116,105,111,110, 32,103,101,116, 95, 112,114,111,112,101,114,116,121, 95,116,121,112,101, 40, 41, 10, 10, 9,114,101,116,117,114,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 58, 103,101,116, 95,112,114,111,112,101,114,116,121, 95,116,121, 112,101, 40, 41, 10,101,110,100, 10, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105, 110,101,114, 58,115,101,116, 95,112,114,111,112,101,114,116, 121, 95,116,121,112,101, 40,112,116,121,112,101, 41, 10, 9, 112,116,121,112,101, 32, 61, 32,115,116,114,105,110,103, 46, 103,115,117, 98, 40,112,116,121,112,101, 44, 32, 34, 94, 37, 115, 42, 34, 44, 32, 34, 34, 41, 10, 9,112,116,121,112,101, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 112,116,121,112,101, 44, 32, 34, 37,115, 42, 36, 34, 44, 32, 34, 34, 41, 10, 10, 9,115,101,108,102, 46,112,114,111,112, 101,114,116,121, 95,116,121,112,101, 32, 61, 32,112,116,121, 112,101, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101, 114, 58,103,101,116, 95,112,114,111,112,101,114,116,121, 95, 116,121,112,101, 40, 41, 10, 9,114,101,116,117,114,110, 32, 115,101,108,102, 46,112,114,111,112,101,114,116,121, 95,116, 121,112,101, 32,111,114, 32, 40,115,101,108,102, 46,112, 97, 114,101,110,116, 32, 97,110,100, 32,115,101,108,102, 46,112, 97,114,101,110,116, 58,103,101,116, 95,112,114,111,112,101, 114,116,121, 95,116,121,112,101, 40, 41, 41, 32,111,114, 32, 34,100,101,102, 97,117,108,116, 34, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/container.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,112, 97, 99,107, 97, 103,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114,105, 116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97, 114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71, 114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111, 100,101, 32,105,115, 32,102,114,101,101, 32,115,111,102,116, 119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114, 101,100,105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32,105, 116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116,119, 97,114,101, 32,112,114,111,118,105,100,101,100, 32,104,101, 114,101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97, 110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97,117, 116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108, 105,103, 97,116,105,111,110, 32,116,111, 32,112,114,111,118, 105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97, 116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101, 109,101,110,116,115, 44, 32,111,114, 32,109,111,100,105,102, 105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 10, 45, 45, 32, 80, 97, 99,107, 97,103,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101,115,101,110,116,115, 32,116, 104,101, 32,119,104,111,108,101, 32,112, 97, 99,107, 97,103, 101, 32, 98,101,105,110,103, 32, 98,111,117,110,100, 46, 10, 45, 45, 32, 84,104,101, 32,102,111,108,108,111,119,105,110, 103, 32,102,105,101,108,100,115, 32, 97,114,101, 32,115,116, 111,114,101,100, 58, 10, 45, 45, 32, 32, 32, 32,123,105,125, 32, 61, 32,108,105,115,116, 32,111,102, 32,111, 98,106,101, 99,116,115, 32,105,110, 32,116,104,101, 32,112, 97, 99,107, 97,103,101, 46, 10, 99,108, 97,115,115, 80, 97, 99,107, 97, 103,101, 32, 61, 32,123, 10, 32, 99,108, 97,115,115,116,121, 112,101, 32, 61, 32, 39,112, 97, 99,107, 97,103,101, 39, 10, 125, 10, 99,108, 97,115,115, 80, 97, 99,107, 97,103,101, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97,115,115, 80, 97, 99,107, 97,103,101, 10,115,101,116,109,101,116, 97, 116, 97, 98,108,101, 40, 99,108, 97,115,115, 80, 97, 99,107, 97,103,101, 44, 99,108, 97,115,115, 67,111,110,116, 97,105, 110,101,114, 41, 10, 10, 45, 45, 32, 80,114,105,110,116, 32, 109,101,116,104,111,100, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 80, 97, 99,107, 97,103,101, 58,112, 114,105,110,116, 32, 40, 41, 10, 32,112,114,105,110,116, 40, 34, 80, 97, 99,107, 97,103,101, 58, 32, 34, 46, 46,115,101, 108,102, 46,110, 97,109,101, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108,101, 32,115,101,108, 102, 91,105, 93, 32,100,111, 10, 32, 32,115,101,108,102, 91, 105, 93, 58,112,114,105,110,116, 40, 34, 34, 44, 34, 34, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 80, 97, 99,107, 97,103,101, 58,112,114, 101,112,114,111, 99,101,115,115, 32, 40, 41, 10, 10, 32, 45, 45, 32, 97,118,111,105,100, 32,112,114,101,112,114,111, 99, 101,115,115,105,110,103, 32,101,109, 98,101,100,100,101,100, 32, 76,117, 97, 32, 99,111,100,101, 10, 32,108,111, 99, 97, 108, 32, 76, 32, 61, 32,123,125, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108, 102, 46, 99,111,100,101, 44, 34, 92,110, 37,115, 42, 37, 36, 37, 91, 34, 44, 34, 92, 49, 34, 41, 32, 45, 45, 32,100,101, 97,108, 32,119,105,116,104, 32,101,109, 98,101,100,100,101, 100, 32,108,117, 97, 32, 99,111,100,101, 10, 32,115,101,108, 102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115, 101,108,102, 46, 99,111,100,101, 44, 34, 92,110, 37,115, 42, 37, 36, 37, 93, 34, 44, 34, 92, 50, 34, 41, 10, 32,115,101, 108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40, 115,101,108,102, 46, 99,111,100,101, 44, 34, 40, 37, 98, 92, 49, 92, 50, 41, 34, 44, 32, 32, 32, 32, 32, 32, 32,102,117, 110, 99,116,105,111,110, 32, 40, 99, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,116,105, 110,115,101,114,116, 40, 76, 44, 99, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101, 116,117,114,110, 32, 34, 92,110, 35, 91, 34, 46, 46,103,101, 116,110, 40, 76, 41, 46, 46, 34, 93, 35, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110, 100, 41, 10, 32, 45, 45, 32, 97,118,111,105,100, 32,112,114, 101,112,114,111, 99,101,115,115,105,110,103, 32,101,109, 98, 101,100,100,101,100, 32, 67, 32, 99,111,100,101, 10, 32,108, 111, 99, 97,108, 32, 67, 32, 61, 32,123,125, 10, 32,115,101, 108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40, 115,101,108,102, 46, 99,111,100,101, 44, 34, 92,110, 37,115, 42, 37, 36, 37, 60, 34, 44, 34, 92, 51, 34, 41, 32, 45, 45, 32,100,101, 97,108, 32,119,105,116,104, 32,101,109, 98,101, 100,100,101,100, 32, 67, 32, 99,111,100,101, 10, 32,115,101, 108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40, 115,101,108,102, 46, 99,111,100,101, 44, 34, 92,110, 37,115, 42, 37, 36, 37, 62, 34, 44, 34, 92, 52, 34, 41, 10, 32,115, 101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 40, 37, 98, 92, 51, 92, 52, 41, 34, 44, 32, 32, 32, 32, 32, 32, 32,102, 117,110, 99,116,105,111,110, 32, 40, 99, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,116, 105,110,115,101,114,116, 40, 67, 44, 99, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114, 101,116,117,114,110, 32, 34, 92,110, 35, 60, 34, 46, 46,103, 101,116,110, 40, 67, 41, 46, 46, 34, 62, 35, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101, 110,100, 41, 10, 32, 45, 45, 32, 97,118,111,105,100, 32,112, 114,101,112,114,111, 99,101,115,115,105,110,103, 32,101,109, 98,101,100,100,101,100, 32, 67, 32, 99,111,100,101, 10, 32, 115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 92,110, 37,115, 42, 37, 36, 37,123, 34, 44, 34, 92, 53, 34, 41, 32, 45, 45, 32,100,101, 97,108, 32,119,105,116,104, 32,101,109, 98,101,100,100,101,100, 32, 67, 32, 99,111,100,101, 10, 32, 115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 92,110, 37,115, 42, 37, 36, 37,125, 34, 44, 34, 92, 54, 34, 41, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115, 117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 40, 37, 98, 92, 53, 92, 54, 41, 34, 44, 32, 32, 32, 32, 32, 32, 32,102,117,110, 99,116,105,111,110, 32, 40, 99, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,116,105,110,115,101,114,116, 40, 67, 44, 99, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, 34, 92,110, 35, 60, 34, 46, 46,103,101,116,110, 40, 67, 41, 46, 46, 34, 62, 35, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 41, 10, 10, 32, 45, 45,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108, 102, 46, 99,111,100,101, 44, 34, 92,110, 37,115, 42, 35, 91, 94,100, 93, 91, 94, 92,110, 93, 42, 92,110, 34, 44, 32, 34, 92,110, 92,110, 34, 41, 32, 45, 45, 32,101,108,105,109,105, 110, 97,116,101, 32,112,114,101,112,114,111, 99,101,115,115, 111,114, 32,100,105,114,101, 99,116,105,118,101,115, 32,116, 104, 97,116, 32,100,111,110, 39,116, 32,115,116, 97,114,116, 32,119,105,116,104, 32, 39,100, 39, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101, 108,102, 46, 99,111,100,101, 44, 34, 92,110, 91, 32, 92,116, 93, 42, 35, 91, 32, 92,116, 93, 42, 91, 94,100, 37, 60, 37, 91, 93, 34, 44, 32, 34, 92,110, 47, 47, 34, 41, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101, 32,112,114,101,112, 114,111, 99,101,115,115,111,114, 32,100,105,114,101, 99,116, 105,118,101,115, 32,116,104, 97,116, 32,100,111,110, 39,116, 32,115,116, 97,114,116, 32,119,105,116,104, 32, 39,100, 39, 10, 10, 32, 45, 45, 32, 97,118,111,105,100, 32,112,114,101, 112,114,111, 99,101,115,115,105,110,103, 32,118,101,114, 98, 97,116,105,109, 32,108,105,110,101,115, 10, 32,108,111, 99, 97,108, 32, 86, 32, 61, 32,123,125, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101, 108,102, 46, 99,111,100,101, 44, 34, 92,110, 40, 37,115, 42, 37, 36, 91, 94, 37, 91, 37, 93, 93, 91, 94, 92,110, 93, 42, 41, 34, 44,102,117,110, 99,116,105,111,110, 32, 40,118, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,116,105,110,115,101,114,116, 40, 86, 44,118, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, 34, 92,110, 35, 34, 46, 46,103,101,116,110, 40, 86, 41, 46, 46, 34, 35, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 41, 10, 10, 32, 45, 45, 32,112,101,114,102, 111,114,109, 32,103,108,111, 98, 97,108, 32,115,117, 98,115, 116,105,116,117,116,105,111,110, 10, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101, 108,102, 46, 99,111,100,101, 44, 34, 40, 47, 47, 91, 94, 92, 110, 93, 42, 41, 34, 44, 34, 34, 41, 32, 32, 32, 32, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101, 32, 67, 43, 43, 32, 99,111,109,109,101,110,116,115, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101, 108,102, 46, 99,111,100,101, 44, 34, 47, 37, 42, 34, 44, 34, 92, 49, 34, 41, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111, 100,101, 44, 34, 37, 42, 47, 34, 44, 34, 92, 50, 34, 41, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115, 117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 37, 98, 92, 49, 92, 50, 34, 44, 34, 34, 41, 10, 32,115,101,108, 102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115, 101,108,102, 46, 99,111,100,101, 44, 34, 92, 49, 34, 44, 34, 47, 37, 42, 34, 41, 10, 32,115,101,108,102, 46, 99,111,100, 101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99, 111,100,101, 44, 34, 92, 50, 34, 44, 34, 37, 42, 47, 34, 41, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103, 115,117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 37,115, 42, 64, 37,115, 42, 34, 44, 34, 64, 34, 41, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101, 32,115,112, 97, 99,101,115, 32, 98,101,115,105,100,101, 32, 64, 10, 32,115, 101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 37,115, 63, 105,110,108,105,110,101, 40, 37,115, 41, 34, 44, 34, 37, 49, 34, 41, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101, 32, 39,105,110,108,105,110,101, 39, 32,107,101,121,119,111, 114,100, 10, 32, 45, 45,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111, 100,101, 44, 34, 37,115, 63,101,120,116,101,114,110, 40, 37, 115, 41, 34, 44, 34, 37, 49, 34, 41, 32, 45, 45, 32,101,108, 105,109,105,110, 97,116,101, 32, 39,101,120,116,101,114,110, 39, 32,107,101,121,119,111,114,100, 10, 32, 45, 45,115,101, 108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40, 115,101,108,102, 46, 99,111,100,101, 44, 34, 37,115, 63,118, 105,114,116,117, 97,108, 40, 37,115, 41, 34, 44, 34, 37, 49, 34, 41, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101, 32, 39,118,105,114,116,117, 97,108, 39, 32,107,101,121,119, 111,114,100, 10, 32, 45, 45,115,101,108,102, 46, 99,111,100, 101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99, 111,100,101, 44, 34,112,117, 98,108,105, 99, 58, 34, 44, 34, 34, 41, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101, 32, 39,112,117, 98,108,105, 99, 58, 39, 32,107,101,121,119, 111,114,100, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111,100, 101, 44, 34, 40, 91, 94, 37,119, 95, 93, 41,118,111,105,100, 37,115, 42, 37, 42, 34, 44, 34, 37, 49, 95,117,115,101,114, 100, 97,116, 97, 32, 34, 41, 32, 45, 45, 32,115,117, 98,115, 116,105,116,117,116,101, 32, 39,118,111,105,100, 42, 39, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115, 117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 40, 91, 94, 37,119, 95, 93, 41,118,111,105,100, 37,115, 42, 37, 42, 34, 44, 34, 37, 49, 95,117,115,101,114,100, 97,116, 97, 32, 34, 41, 32, 45, 45, 32,115,117, 98,115,116,105,116,117, 116,101, 32, 39,118,111,105,100, 42, 39, 10, 32,115,101,108, 102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115, 101,108,102, 46, 99,111,100,101, 44, 34, 40, 91, 94, 37,119, 95, 93, 41, 99,104, 97,114, 37,115, 42, 37, 42, 34, 44, 34, 37, 49, 95, 99,115,116,114,105,110,103, 32, 34, 41, 32, 32, 45, 45, 32,115,117, 98,115,116,105,116,117,116,101, 32, 39, 99,104, 97,114, 42, 39, 10, 32,115,101,108,102, 46, 99,111, 100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 40, 91, 94, 37,119, 95, 93, 41,108, 117, 97, 95, 83,116, 97,116,101, 37,115, 42, 37, 42, 34, 44, 34, 37, 49, 95,108,115,116, 97,116,101, 32, 34, 41, 32, 32, 45, 45, 32,115,117, 98,115,116,105,116,117,116,101, 32, 39, 108,117, 97, 95, 83,116, 97,116,101, 42, 39, 10, 10, 32, 45, 45, 32,114,101,115,116,111,114,101, 32,101,109, 98,101,100, 100,101,100, 32, 76,117, 97, 32, 99,111,100,101, 10, 32,115, 101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 37, 35, 37, 91, 40, 37,100, 43, 41, 37, 93, 37, 35, 34, 44,102,117,110, 99,116,105,111,110, 32, 40,110, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117, 114,110, 32, 76, 91,116,111,110,117,109, 98,101,114, 40,110, 41, 93, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 41, 10, 32, 45, 45, 32,114,101,115,116, 111,114,101, 32,101,109, 98,101,100,100,101,100, 32, 67, 32, 99,111,100,101, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111, 100,101, 44, 34, 37, 35, 37, 60, 40, 37,100, 43, 41, 37, 62, 37, 35, 34, 44,102,117,110, 99,116,105,111,110, 32, 40,110, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, 67, 91,116,111,110,117, 109, 98,101,114, 40,110, 41, 93, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 41, 10, 32, 45, 45, 32,114,101,115,116,111,114,101, 32,118,101,114, 98, 97, 116,105,109, 32,108,105,110,101,115, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101, 108,102, 46, 99,111,100,101, 44, 34, 37, 35, 40, 37,100, 43, 41, 37, 35, 34, 44,102,117,110, 99,116,105,111,110, 32, 40, 110, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114, 101,116,117,114,110, 32, 86, 91,116,111,110,117,109, 98,101, 114, 40,110, 41, 93, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 41, 10, 10, 32,115,101,108,102, 46, 99,111, 100,101, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 32, 34, 92, 110, 37,115, 42, 37, 36, 40, 91, 94, 92,110, 93, 43, 41, 34, 44, 32,102,117,110, 99,116,105,111,110, 32, 40,108, 41, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 86,101,114, 98, 97,116,105,109, 40,108, 46, 46, 34, 92,110, 34, 41, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,114,101,116,117,114, 110, 32, 34, 92,110, 34, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 32, 32,101,110,100, 41, 10,101,110,100, 10, 10, 45, 45, 32,116,114, 97,110,115,108, 97,116,101, 32,118,101,114, 98, 97,116,105,109, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 80, 97, 99,107, 97,103,101, 58,112,114, 101, 97,109, 98,108,101, 32, 40, 41, 10, 32,111,117,116,112, 117,116, 40, 39, 47, 42, 92,110, 39, 41, 10, 32,111,117,116, 112,117,116, 40, 39, 42, 42, 32, 76,117, 97, 32, 98,105,110, 100,105,110,103, 58, 32, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 92,110, 39, 41, 10, 32,111,117,116, 112,117,116, 40, 39, 42, 42, 32, 71,101,110,101,114, 97,116, 101,100, 32, 97,117,116,111,109, 97,116,105, 99, 97,108,108, 121, 32, 98,121, 32, 39, 46, 46, 84, 79, 76, 85, 65, 95, 86, 69, 82, 83, 73, 79, 78, 46, 46, 39, 32,111,110, 32, 39, 46, 46,100, 97,116,101, 40, 41, 46, 46, 39, 46, 92,110, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 42, 47, 92,110, 92, 110, 39, 41, 10, 10, 9,111,117,116,112,117,116, 40, 39, 35, 105,102,110,100,101,102, 32, 95, 95, 99,112,108,117,115,112, 108,117,115, 92,110, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 35,105,110, 99,108,117,100,101, 32, 34,115,116,100, 108,105, 98, 46,104, 34, 92,110, 39, 41, 10, 9,111,117,116, 112,117,116, 40, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 35,105,110, 99,108, 117,100,101, 32, 34,115,116,114,105,110,103, 46,104, 34, 92, 110, 92,110, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 35,105,110, 99,108,117,100,101, 32, 34,116,111,108,117, 97, 43, 43, 46,104, 34, 92,110, 92,110, 39, 41, 10, 10, 32,105, 102, 32,110,111,116, 32,102,108, 97,103,115, 46,104, 32,116, 104,101,110, 10, 32, 32,111,117,116,112,117,116, 40, 39, 47, 42, 32, 69,120,112,111,114,116,101,100, 32,102,117,110, 99, 116,105,111,110, 32, 42, 47, 39, 41, 10, 32, 32,111,117,116, 112,117,116, 40, 39, 84, 79, 76, 85, 65, 95, 65, 80, 73, 32, 105,110,116, 32, 32,116,111,108,117, 97, 95, 39, 46, 46,115, 101,108,102, 46,110, 97,109,101, 46, 46, 39, 95,111,112,101, 110, 32, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32,116, 111,108,117, 97, 95, 83, 41, 59, 39, 41, 10, 32, 32,111,117, 116,112,117,116, 40, 39, 92,110, 39, 41, 10, 32,101,110,100, 10, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119, 104,105,108,101, 32,115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32,115,101,108,102, 91,105, 93, 58,112,114,101, 97, 109, 98,108,101, 40, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 10, 9,105,102, 32,115,101,108, 102, 58,114,101,113,117,105,114,101, 99,111,108,108,101, 99, 116,105,111,110, 40, 95, 99,111,108,108,101, 99,116, 41, 32, 116,104,101,110, 10, 9, 9,111,117,116,112,117,116, 40, 39, 92,110, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39, 47, 42, 32,102,117,110, 99,116,105,111,110, 32,116,111, 32, 114,101,108,101, 97,115,101, 32, 99,111,108,108,101, 99,116, 101,100, 32,111, 98,106,101, 99,116, 32,118,105, 97, 32,100, 101,115,116,114,117, 99,116,111,114, 32, 42, 47, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39, 35,105,102,100,101, 102, 32, 95, 95, 99,112,108,117,115,112,108,117,115, 92,110, 39, 41, 10, 9, 9,102,111,114, 32,105, 44,118, 32,105,110, 32,112, 97,105,114,115, 40, 95, 99,111,108,108,101, 99,116, 41, 32,100,111, 10, 9, 9, 32,111,117,116,112,117,116, 40, 39, 92,110,115,116, 97,116,105, 99, 32,105,110,116, 32, 39, 46, 46,118, 46, 46, 39, 32, 40,108,117, 97, 95, 83,116, 97, 116,101, 42, 32,116,111,108,117, 97, 95, 83, 41, 39, 41, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39,123, 39, 41, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 39, 46, 46, 105, 46, 46, 39, 42, 32,115,101,108,102, 32, 61, 32, 40, 39, 46, 46,105, 46, 46, 39, 42, 41, 32,116,111,108,117, 97, 95, 116,111,117,115,101,114,116,121,112,101, 40,116,111,108,117, 97, 95, 83, 44, 49, 44, 48, 41, 59, 39, 41, 10, 9, 9, 9, 111,117,116,112,117,116, 40, 39, 9, 77,116,111,108,117, 97, 95,100,101,108,101,116,101, 40,115,101,108,102, 41, 59, 39, 41, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 9,114, 101,116,117,114,110, 32, 48, 59, 39, 41, 10, 9, 9, 9,111, 117,116,112,117,116, 40, 39,125, 39, 41, 10, 9, 9,101,110, 100, 10, 9, 9,111,117,116,112,117,116, 40, 39, 35,101,110, 100,105,102, 92,110, 92,110, 39, 41, 10, 9,101,110,100, 10, 10, 32,111,117,116,112,117,116, 40, 39, 92,110, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 47, 42, 32,102,117,110, 99,116,105,111,110, 32,116,111, 32,114,101,103,105,115,116, 101,114, 32,116,121,112,101, 32, 42, 47, 39, 41, 10, 32,111, 117,116,112,117,116, 40, 39,115,116, 97,116,105, 99, 32,118, 111,105,100, 32,116,111,108,117, 97, 95,114,101,103, 95,116, 121,112,101,115, 32, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32,116,111,108,117, 97, 95, 83, 41, 39, 41, 10, 32,111, 117,116,112,117,116, 40, 39,123, 39, 41, 10, 10, 9,105,102, 32,102,108, 97,103,115, 46,116, 32,116,104,101,110, 10, 9, 9,111,117,116,112,117,116, 40, 34, 35,105,102,110,100,101, 102, 32, 77,116,111,108,117, 97, 95,116,121,112,101,105,100, 92,110, 35,100,101,102,105,110,101, 32, 77,116,111,108,117, 97, 95,116,121,112,101,105,100, 40, 76, 44, 84, 73, 44, 84, 41, 92,110, 35,101,110,100,105,102, 92,110, 34, 41, 10, 9, 101,110,100, 10, 9,102,111,114,101, 97, 99,104, 40, 95,117, 115,101,114,116,121,112,101, 44,102,117,110, 99,116,105,111, 110, 40,110, 44,118, 41, 10, 9, 9,105,102, 32, 40,110,111, 116, 32, 95,103,108,111, 98, 97,108, 95, 99,108, 97,115,115, 101,115, 91,118, 93, 41, 32,111,114, 32, 95,103,108,111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91,118, 93, 58, 99, 104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99, 101,115,115, 40, 41, 32,116,104,101,110, 10, 9, 9, 9,111, 117,116,112,117,116, 40, 39, 32,116,111,108,117, 97, 95,117, 115,101,114,116,121,112,101, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 44,118, 44, 39, 34, 41, 59, 39, 41, 10, 9, 9, 9,105,102, 32,102,108, 97,103,115, 46,116, 32,116,104,101, 110, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 77,116,111,108,117, 97, 95,116,121,112,101,105,100, 40,116, 111,108,117, 97, 95, 83, 44,116,121,112,101,105,100, 40, 39, 44,118, 44, 39, 41, 44, 32, 34, 39, 44,118, 44, 39, 34, 41, 59, 39, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9,101,110, 100, 10, 9, 32,101,110,100, 41, 10, 32,111,117,116,112,117, 116, 40, 39,125, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 92,110, 39, 41, 10,101,110,100, 10, 10, 45, 45, 32,114, 101,103,105,115,116,101,114, 32,112, 97, 99,107, 97,103,101, 10, 45, 45, 32,119,114,105,116,101, 32,112, 97, 99,107, 97, 103,101, 32,111,112,101,110, 32,102,117,110, 99,116,105,111, 110, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115, 115, 80, 97, 99,107, 97,103,101, 58,114,101,103,105,115,116, 101,114, 32, 40,112,114,101, 41, 10, 32,112,114,101, 32, 61, 32,112,114,101, 32,111,114, 32, 39, 39, 10, 32,112,117,115, 104, 40,115,101,108,102, 41, 10, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 34, 47, 42, 32, 79,112,101,110, 32, 102,117,110, 99,116,105,111,110, 32, 42, 47, 34, 41, 10, 32, 111,117,116,112,117,116, 40,112,114,101, 46, 46, 34, 84, 79, 76, 85, 65, 95, 65, 80, 73, 32,105,110,116, 32,116,111,108, 117, 97, 95, 34, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 34, 95,111,112,101,110, 32, 40,108,117, 97, 95, 83, 116, 97,116,101, 42, 32,116,111,108,117, 97, 95, 83, 41, 34, 41, 10, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 34,123, 34, 41, 10, 32,111,117,116,112,117,116, 40,112,114, 101, 46, 46, 34, 32,116,111,108,117, 97, 95,111,112,101,110, 40,116,111,108,117, 97, 95, 83, 41, 59, 34, 41, 10, 32,111, 117,116,112,117,116, 40,112,114,101, 46, 46, 34, 32,116,111, 108,117, 97, 95,114,101,103, 95,116,121,112,101,115, 40,116, 111,108,117, 97, 95, 83, 41, 59, 34, 41, 10, 32,111,117,116, 112,117,116, 40,112,114,101, 46, 46, 34, 32,116,111,108,117, 97, 95,109,111,100,117,108,101, 40,116,111,108,117, 97, 95, 83, 44, 78, 85, 76, 76, 44, 34, 44,115,101,108,102, 58,104, 97,115,118, 97,114, 40, 41, 44, 34, 41, 59, 34, 41, 10, 32, 111,117,116,112,117,116, 40,112,114,101, 46, 46, 34, 32,116, 111,108,117, 97, 95, 98,101,103,105,110,109,111,100,117,108, 101, 40,116,111,108,117, 97, 95, 83, 44, 78, 85, 76, 76, 41, 59, 34, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108,101, 32,115,101,108,102, 91,105, 93, 32, 100,111, 10, 32, 32,115,101,108,102, 91,105, 93, 58,114,101, 103,105,115,116,101,114, 40,112,114,101, 46, 46, 34, 32, 32, 34, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101, 110,100, 10, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 34, 32,116,111,108,117, 97, 95,101,110,100,109,111,100, 117,108,101, 40,116,111,108,117, 97, 95, 83, 41, 59, 34, 41, 10, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 34, 32,114,101,116,117,114,110, 32, 49, 59, 34, 41, 10, 32,111, 117,116,112,117,116, 40,112,114,101, 46, 46, 34,125, 34, 41, 10, 10, 32,111,117,116,112,117,116, 40, 34, 92,110, 92,110, 34, 41, 10, 32,111,117,116,112,117,116, 40, 34, 35,105,102, 32,100,101,102,105,110,101,100, 40, 76, 85, 65, 95, 86, 69, 82, 83, 73, 79, 78, 95, 78, 85, 77, 41, 32, 38, 38, 32, 76, 85, 65, 95, 86, 69, 82, 83, 73, 79, 78, 95, 78, 85, 77, 32, 62, 61, 32, 53, 48, 49, 92,110, 34, 41, 59, 10, 32,111,117, 116,112,117,116, 40,112,114,101, 46, 46, 34, 84, 79, 76, 85, 65, 95, 65, 80, 73, 32,105,110,116, 32,108,117, 97,111,112, 101,110, 95, 34, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 34, 32, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32,116,111,108,117, 97, 95, 83, 41, 32,123, 34, 41, 10, 32, 111,117,116,112,117,116, 40,112,114,101, 46, 46, 34, 32,114, 101,116,117,114,110, 32,116,111,108,117, 97, 95, 34, 46, 46, 115,101,108,102, 46,110, 97,109,101, 46, 46, 34, 95,111,112, 101,110, 40,116,111,108,117, 97, 95, 83, 41, 59, 34, 41, 10, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 34,125, 59, 34, 41, 10, 32,111,117,116,112,117,116, 40, 34, 35,101, 110,100,105,102, 92,110, 92,110, 34, 41, 10, 10, 9,112,111, 112, 40, 41, 10,101,110,100, 10, 10, 45, 45, 32,119,114,105, 116,101, 32,104,101, 97,100,101,114, 32,102,105,108,101, 10, 102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 80, 97, 99,107, 97,103,101, 58,104,101, 97,100,101,114, 32, 40, 41, 10, 32,111,117,116,112,117,116, 40, 39, 47, 42, 92,110, 39, 41, 32,111,117,116,112,117,116, 40, 39, 42, 42, 32, 76, 117, 97, 32, 98,105,110,100,105,110,103, 58, 32, 39, 46, 46, 115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 92,110, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 42, 42, 32, 71, 101,110,101,114, 97,116,101,100, 32, 97,117,116,111,109, 97, 116,105, 99, 97,108,108,121, 32, 98,121, 32, 39, 46, 46, 84, 79, 76, 85, 65, 95, 86, 69, 82, 83, 73, 79, 78, 46, 46, 39, 32,111,110, 32, 39, 46, 46,100, 97,116,101, 40, 41, 46, 46, 39, 46, 92,110, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 42, 47, 92,110, 92,110, 39, 41, 10, 10, 32,105,102, 32, 110,111,116, 32,102,108, 97,103,115, 46,104, 32,116,104,101, 110, 10, 32, 32,111,117,116,112,117,116, 40, 39, 47, 42, 32, 69,120,112,111,114,116,101,100, 32,102,117,110, 99,116,105, 111,110, 32, 42, 47, 39, 41, 10, 32, 32,111,117,116,112,117, 116, 40, 39, 84, 79, 76, 85, 65, 95, 65, 80, 73, 32,105,110, 116, 32, 32,116,111,108,117, 97, 95, 39, 46, 46,115,101,108, 102, 46,110, 97,109,101, 46, 46, 39, 95,111,112,101,110, 32, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32,116,111,108, 117, 97, 95, 83, 41, 59, 39, 41, 10, 32, 32,111,117,116,112, 117,116, 40, 39, 92,110, 39, 41, 10, 32,101,110,100, 10,101, 110,100, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99,111,110,115,116,114,117, 99,116,111,114, 10,102,117, 110, 99,116,105,111,110, 32, 95, 80, 97, 99,107, 97,103,101, 32, 40,115,101,108,102, 41, 10, 32,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40,115,101,108,102, 44, 99,108, 97, 115,115, 80, 97, 99,107, 97,103,101, 41, 10, 32,114,101,116, 117,114,110, 32,115,101,108,102, 10,101,110,100, 10, 10, 45, 45, 32, 80, 97,114,115,101, 32, 67, 32,104,101, 97,100,101, 114, 32,102,105,108,101, 32,119,105,116,104, 32,116,111,108, 117, 97, 32,100,105,114,101, 99,116,105,118,101,115, 10, 45, 45, 32, 42, 42, 42, 32, 84,104, 97,110,107,115, 32,116,111, 32, 65,114,105,101,108, 32, 77, 97,110,122,117,114, 32,102, 111,114, 32,102,105,120,105,110,103, 32, 98,117,103,115, 32, 105,110, 32,110,101,115,116,101,100, 32,100,105,114,101, 99, 116,105,118,101,115, 32, 42, 42, 42, 10,102,117,110, 99,116, 105,111,110, 32,101,120,116,114, 97, 99,116, 95, 99,111,100, 101, 40,102,110, 44,115, 41, 10, 9,108,111, 99, 97,108, 32, 99,111,100,101, 32, 61, 32, 39, 92,110, 36, 35,105,110, 99, 108,117,100,101, 32, 34, 39, 46, 46,102,110, 46, 46, 39, 34, 92,110, 39, 10, 9,115, 61, 32, 34, 92,110, 34, 32, 46, 46, 32,115, 32, 46, 46, 32, 34, 92,110, 34, 32, 45, 45, 32, 97, 100,100, 32, 98,108, 97,110,107, 32,108,105,110,101,115, 32, 97,115, 32,115,101,110,116,105,110,101,108,115, 10, 9,108, 111, 99, 97,108, 32, 95, 44,101, 44, 99, 44,116, 32, 61, 32, 115,116,114,102,105,110,100, 40,115, 44, 32, 34, 92,110, 40, 91, 94, 92,110, 93, 45, 41, 91, 84,116, 93, 91, 79,111, 93, 91, 76,108, 93, 91, 85,117, 93, 91, 65, 97, 93, 95, 40, 91, 94, 37,115, 93, 42, 41, 91, 94, 92,110, 93, 42, 92,110, 34, 41, 10, 9,119,104,105,108,101, 32,101, 32,100,111, 10, 9, 9,116, 32, 61, 32,115,116,114,108,111,119,101,114, 40,116, 41, 10, 9, 9,105,102, 32,116, 32, 61, 61, 32, 34, 98,101, 103,105,110, 34, 32,116,104,101,110, 10, 9, 9, 9, 95, 44, 101, 44, 99, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 40, 46, 45, 41, 92,110, 91, 94, 92,110, 93, 42, 91, 84,116, 93, 91, 79,111, 93, 91, 76,108, 93, 91, 85,117, 93, 91, 65, 97, 93, 95, 91, 69,101, 93, 91, 78,110, 93, 91, 68, 100, 93, 91, 94, 92,110, 93, 42, 92,110, 34, 44,101, 41, 10, 9, 9, 9,105,102, 32,110,111,116, 32,101, 32,116,104,101, 110, 10, 9, 9, 9, 32,116,111,108,117, 97, 95,101,114,114, 111,114, 40, 34, 85,110, 98, 97,108, 97,110, 99,101,100, 32, 39,116,111,108,117, 97, 95, 98,101,103,105,110, 39, 32,100, 105,114,101, 99,116,105,118,101, 32,105,110, 32,104,101, 97, 100,101,114, 32,102,105,108,101, 34, 41, 10, 9, 9, 9,101, 110,100, 10, 9, 9,101,110,100, 10, 9, 9, 99,111,100,101, 32, 61, 32, 99,111,100,101, 32, 46, 46, 32, 99, 32, 46, 46, 32, 34, 92,110, 34, 10, 9, 32, 95, 44,101, 44, 99, 44,116, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 32, 34, 92,110, 40, 91, 94, 92,110, 93, 45, 41, 91, 84,116, 93, 91, 79,111, 93, 91, 76,108, 93, 91, 85,117, 93, 91, 65, 97, 93, 95, 40, 91, 94, 37,115, 93, 42, 41, 91, 94, 92,110, 93, 42, 92,110, 34, 44,101, 41, 10, 9,101,110,100, 10, 9,114,101, 116,117,114,110, 32, 99,111,100,101, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110,115,116,114,117, 99,116,111,114, 10, 45, 45, 32, 69,120,112,101, 99,116,115, 32,116,104,101, 32, 112, 97, 99,107, 97,103,101, 32,110, 97,109,101, 44, 32,116, 104,101, 32,102,105,108,101, 32,101,120,116,101,110,115,105, 111,110, 44, 32, 97,110,100, 32,116,104,101, 32,102,105,108, 101, 32,116,101,120,116, 46, 10,102,117,110, 99,116,105,111, 110, 32, 80, 97, 99,107, 97,103,101, 32, 40,110, 97,109,101, 44,102,110, 41, 10, 32,108,111, 99, 97,108, 32,101,120,116, 32, 61, 32, 34,112,107,103, 34, 10, 10, 32, 45, 45, 32,111, 112,101,110, 32,105,110,112,117,116, 32,102,105,108,101, 44, 32,105,102, 32, 97,110,121, 10, 32,108,111, 99, 97,108, 32, 115,116, 44,109,115,103, 10, 32,105,102, 32,102,110, 32,116, 104,101,110, 10, 32, 32,115,116, 44, 32,109,115,103, 32, 61, 32,114,101, 97,100,102,114,111,109, 40,102,108, 97,103,115, 46,102, 41, 10, 32, 32,105,102, 32,110,111,116, 32,115,116, 32,116,104,101,110, 10, 32, 32, 32,101,114,114,111,114, 40, 39, 35, 39, 46, 46,109,115,103, 41, 10, 32, 32,101,110,100, 10, 32, 32,108,111, 99, 97,108, 32, 95, 59, 32, 95, 44, 32, 95, 44, 32,101,120,116, 32, 61, 32,115,116,114,102,105,110, 100, 40,102,110, 44, 34, 46, 42, 37, 46, 40, 46, 42, 41, 36, 34, 41, 10, 32,101,110,100, 10, 32,108,111, 99, 97,108, 32, 99,111,100,101, 10, 32,105,102, 32,101,120,116, 32, 61, 61, 32, 39,112,107,103, 39, 32,116,104,101,110, 10, 32, 32, 99, 111,100,101, 32, 61, 32,112,114,101,112, 40,115,116, 41, 10, 32,101,108,115,101, 10, 32, 32, 99,111,100,101, 32, 61, 32, 34, 92,110, 34, 32, 46, 46, 32,114,101, 97,100, 40, 39, 42, 97, 39, 41, 10, 32, 32,105,102, 32,101,120,116, 32, 61, 61, 32, 39,104, 39, 32,111,114, 32,101,120,116, 32, 61, 61, 32, 39,104,112,112, 39, 32,116,104,101,110, 10, 32, 32, 32, 99, 111,100,101, 32, 61, 32,101,120,116,114, 97, 99,116, 95, 99, 111,100,101, 40,102,110, 44, 99,111,100,101, 41, 10, 32, 32, 101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 99, 108,111,115,101, 32,102,105,108,101, 10, 32,105,102, 32,102, 110, 32,116,104,101,110, 10, 32, 32,114,101, 97,100,102,114, 111,109, 40, 41, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 100,101, 97,108, 32,119,105,116,104, 32,105,110, 99,108,117, 100,101, 32,100,105,114,101, 99,116,105,118,101, 10, 32,108, 111, 99, 97,108, 32,110,115,117, 98,115,116, 10, 32,114,101, 112,101, 97,116, 10, 32, 32, 99,111,100,101, 44,110,115,117, 98,115,116, 32, 61, 32,103,115,117, 98, 40, 99,111,100,101, 44, 39, 92,110, 37,115, 42, 37, 36, 40, 46, 41,102,105,108, 101, 37,115, 42, 34, 40, 46, 45, 41, 34, 40, 91, 94, 92,110, 93, 42, 41, 92,110, 39, 44, 10, 9, 9,102,117,110, 99,116, 105,111,110, 32, 40,107,105,110,100, 44,102,110, 44,101,120, 116,114, 97, 41, 10, 9, 9, 9,108,111, 99, 97,108, 32, 95, 44, 32, 95, 44, 32,101,120,116, 32, 61, 32,115,116,114,102, 105,110,100, 40,102,110, 44, 34, 46, 42, 37, 46, 40, 46, 42, 41, 36, 34, 41, 10, 9, 9, 9,108,111, 99, 97,108, 32,102, 112, 44,109,115,103, 32, 61, 32,111,112,101,110,102,105,108, 101, 40,102,110, 44, 39,114, 39, 41, 10, 9, 9, 9,105,102, 32,110,111,116, 32,102,112, 32,116,104,101,110, 10, 9, 9, 9, 9,101,114,114,111,114, 40, 39, 35, 39, 46, 46,109,115, 103, 46, 46, 39, 58, 32, 39, 46, 46,102,110, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9, 9,105,102, 32,107,105,110,100, 32, 61, 61, 32, 39,112, 39, 32,116,104,101,110, 10, 9, 9, 9, 9,108,111, 99, 97,108, 32,115, 32, 61, 32,112,114,101, 112, 40,102,112, 41, 10, 9, 9, 9, 9, 99,108,111,115,101, 102,105,108,101, 40,102,112, 41, 10, 9, 9, 9, 9,114,101, 116,117,114,110, 32,115, 10, 9, 9, 9,101,110,100, 10, 9, 9, 9,108,111, 99, 97,108, 32,115, 32, 61, 32,114,101, 97, 100, 40,102,112, 44, 39, 42, 97, 39, 41, 10, 9, 9, 9, 99, 108,111,115,101,102,105,108,101, 40,102,112, 41, 10, 9, 9, 9,105,102, 32,107,105,110,100, 32, 61, 61, 32, 39, 99, 39, 32,111,114, 32,107,105,110,100, 32, 61, 61, 32, 39,104, 39, 32,116,104,101,110, 10, 9, 9, 9, 9,114,101,116,117,114, 110, 32,101,120,116,114, 97, 99,116, 95, 99,111,100,101, 40, 102,110, 44,115, 41, 10, 9, 9, 9,101,108,115,101,105,102, 32,107,105,110,100, 32, 61, 61, 32, 39,108, 39, 32,116,104, 101,110, 10, 9, 9, 9, 9,114,101,116,117,114,110, 32, 34, 92,110, 36, 91, 45, 45, 35, 35, 34, 46, 46,102,110, 46, 46, 34, 92,110, 34, 32, 46, 46, 32,115, 32, 46, 46, 32, 34, 92, 110, 36, 93, 92,110, 34, 10, 9, 9, 9,101,108,115,101,105, 102, 32,107,105,110,100, 32, 61, 61, 32, 39,105, 39, 32,116, 104,101,110, 10, 9, 9, 9, 9,108,111, 99, 97,108, 32,116, 32, 61, 32,123, 99,111,100,101, 61,115,125, 10, 9, 9, 9, 9,101,120,116,114, 97, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,101,120,116,114, 97, 44, 32, 34, 94, 37,115, 42, 44, 37,115, 42, 34, 44, 32, 34, 34, 41, 10, 9, 9, 9, 9,108,111, 99, 97,108, 32,112, 97,114,115, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40,101,120,116,114, 97, 44, 32, 34, 44, 34, 41, 10, 9, 9, 9, 9,105,110, 99,108,117,100,101, 95,102,105,108,101, 95, 104,111,111,107, 40,116, 44, 32,102,110, 44, 32,117,110,112, 97, 99,107, 40,112, 97,114,115, 41, 41, 10, 9, 9, 9, 9, 114,101,116,117,114,110, 32, 34, 92,110, 92,110, 34, 32, 46, 46, 32,116, 46, 99,111,100,101, 10, 9, 9, 9,101,108,115, 101, 10, 9, 9, 9, 9,101,114,114,111,114, 40, 39, 35, 73, 110,118, 97,108,105,100, 32,105,110, 99,108,117,100,101, 32, 100,105,114,101, 99,116,105,118,101, 32, 40,117,115,101, 32, 36, 99,102,105,108,101, 44, 32, 36,112,102,105,108,101, 44, 32, 36,108,102,105,108,101, 32,111,114, 32, 36,105,102,105, 108,101, 41, 39, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9, 101,110,100, 41, 10, 32,117,110,116,105,108, 32,110,115,117, 98,115,116, 61, 61, 48, 10, 10, 32, 45, 45, 32,100,101, 97, 108, 32,119,105,116,104, 32,114,101,110, 97,109,105,110,103, 32,100,105,114,101, 99,116,105,118,101, 10, 32,114,101,112, 101, 97,116, 32, 45, 45, 32, 73, 32,100,111,110, 39,116, 32, 107,110,111,119, 32,119,104,121, 32,116,104,105,115, 32,105, 115, 32,110,101, 99,101,115, 97,114,121, 10, 9, 99,111,100, 101, 44,110,115,117, 98,115,116, 32, 61, 32,103,115,117, 98, 40, 99,111,100,101, 44, 39, 92,110, 37,115, 42, 37, 36,114, 101,110, 97,109,105,110,103, 37,115, 42, 40, 46, 45, 41, 37, 115, 42, 92,110, 39, 44, 32,102,117,110, 99,116,105,111,110, 32, 40,114, 41, 32, 97,112,112,101,110,100,114,101,110, 97, 109,105,110,103, 40,114, 41, 32,114,101,116,117,114,110, 32, 34, 92,110, 34, 32,101,110,100, 41, 10, 32,117,110,116,105, 108, 32,110,115,117, 98,115,116, 32, 61, 61, 32, 48, 10, 10, 32,108,111, 99, 97,108, 32,116, 32, 61, 32, 95, 80, 97, 99, 107, 97,103,101, 40, 95, 67,111,110,116, 97,105,110,101,114, 123,110, 97,109,101, 61,110, 97,109,101, 44, 32, 99,111,100, 101, 61, 99,111,100,101,125, 41, 10, 32,112,117,115,104, 40, 116, 41, 10, 32,112,114,101,112,114,111, 99,101,115,115, 95, 104,111,111,107, 40,116, 41, 10, 32,116, 58,112,114,101,112, 114,111, 99,101,115,115, 40, 41, 10, 32,112,114,101,112, 97, 114,115,101, 95,104,111,111,107, 40,116, 41, 10, 32,116, 58, 112, 97,114,115,101, 40,116, 46, 99,111,100,101, 41, 10, 32, 112,111,112, 40, 41, 10, 32,114,101,116,117,114,110, 32,116, 10,101,110,100, 10, 10, 10,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40, 95,101,120,116,114, 97, 95,112, 97,114, 97,109,101,116,101,114,115, 44, 32,123, 32, 95, 95,105,110, 100,101,120, 32, 61, 32, 95, 71, 32,125, 41, 10, 10,102,117, 110, 99,116,105,111,110, 32,112,114,101,112, 40,102,105,108, 101, 41, 10, 10, 32, 32,108,111, 99, 97,108, 32, 99,104,117, 110,107, 32, 61, 32,123, 39,108,111, 99, 97,108, 32, 95, 95, 114,101,116, 32, 61, 32,123, 34, 92, 92,110, 34,125, 92,110, 39,125, 10, 32, 32,102,111,114, 32,108,105,110,101, 32,105, 110, 32,102,105,108,101, 58,108,105,110,101,115, 40, 41, 32, 100,111, 10, 32, 32, 32, 32, 32,105,102, 32,115,116,114,105, 110,103, 46,102,105,110,100, 40,108,105,110,101, 44, 32, 34, 94, 35, 35, 34, 41, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32,116, 97, 98,108,101, 46,105,110,115,101,114,116, 40, 99,104,117,110,107, 44, 32,115,116,114,105,110,103, 46,115, 117, 98, 40,108,105,110,101, 44, 32, 51, 41, 32, 46, 46, 32, 34, 92,110, 34, 41, 10, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,108, 97, 115,116, 32, 61, 32, 49, 10, 32, 32, 32, 32, 32, 32,102,111, 114, 32,116,101,120,116, 44, 32,101,120,112,114, 44, 32,105, 110,100,101,120, 32,105,110, 32,115,116,114,105,110,103, 46, 103,102,105,110,100, 40,108,105,110,101, 44, 32, 34, 40, 46, 45, 41, 36, 40, 37, 98, 40, 41, 41, 40, 41, 34, 41, 32,100, 111, 32, 10, 32, 32, 32, 32, 32, 32, 32, 32,108, 97,115,116, 32, 61, 32,105,110,100,101,120, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,116,101,120,116, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,116, 97, 98,108,101, 46,105,110,115,101,114,116, 40, 99, 104,117,110,107, 44, 32,115,116,114,105,110,103, 46,102,111, 114,109, 97,116, 40, 39,116, 97, 98,108,101, 46,105,110,115, 101,114,116, 40, 95, 95,114,101,116, 44, 32, 37,113, 32, 41, 39, 44, 32,116,101,120,116, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 116, 97, 98,108,101, 46,105,110,115,101,114,116, 40, 99,104, 117,110,107, 44, 32,115,116,114,105,110,103, 46,102,111,114, 109, 97,116, 40, 39,116, 97, 98,108,101, 46,105,110,115,101, 114,116, 40, 95, 95,114,101,116, 44, 32, 37,115, 32, 41, 39, 44, 32,101,120,112,114, 41, 41, 10, 32, 32, 32, 32, 32, 32, 101,110,100, 10, 32, 32, 32, 32, 32, 32,116, 97, 98,108,101, 46,105,110,115,101,114,116, 40, 99,104,117,110,107, 44, 32, 115,116,114,105,110,103, 46,102,111,114,109, 97,116, 40, 39, 116, 97, 98,108,101, 46,105,110,115,101,114,116, 40, 95, 95, 114,101,116, 44, 32, 37,113, 41, 92,110, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,116,114,105,110,103, 46,115,117, 98, 40,108,105,110,101, 44, 32,108, 97,115,116, 41, 46, 46, 34, 92,110, 34, 41, 41, 10, 32, 32, 32, 32,101, 110,100, 10, 32, 32,101,110,100, 10, 32, 32,116, 97, 98,108, 101, 46,105,110,115,101,114,116, 40, 99,104,117,110,107, 44, 32, 39, 92,110,114,101,116,117,114,110, 32,116, 97, 98,108, 101, 46, 99,111,110, 99, 97,116, 40, 95, 95,114,101,116, 41, 92,110, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,102, 44, 101, 32, 61, 32,108,111, 97,100,115,116,114,105,110,103, 40, 116, 97, 98,108,101, 46, 99,111,110, 99, 97,116, 40, 99,104, 117,110,107, 41, 41, 10, 32, 32,105,102, 32,101, 32,116,104, 101,110, 10, 32, 32, 9,101,114,114,111,114, 40, 34, 35, 34, 46, 46,101, 41, 10, 32, 32,101,110,100, 10, 32, 32,115,101, 116,102,101,110,118, 40,102, 44, 32, 95,101,120,116,114, 97, 95,112, 97,114, 97,109,101,116,101,114,115, 41, 10, 32, 32, 114,101,116,117,114,110, 32,102, 40, 41, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/package.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,109,111,100,117,108, 101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114,105,116, 116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74, 117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111,100, 101, 32,105,115, 32,102,114,101,101, 32,115,111,102,116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101, 100,105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97, 110,100, 47,111,114, 32,109,111,100,105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116,119, 97, 114,101, 32,112,114,111,118,105,100,101,100, 32,104,101,114, 101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97,117,116, 104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105, 103, 97,116,105,111,110, 32,116,111, 32,112,114,111,118,105, 100,101, 32,109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97,116, 101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101,109, 101,110,116,115, 44, 32,111,114, 32,109,111,100,105,102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 10, 45, 45, 32, 77,111,100,117,108,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101,115,101,110,116,115, 32,109,111,100, 117,108,101, 46, 10, 45, 45, 32, 84,104,101, 32,102,111,108, 108,111,119,105,110,103, 32,102,105,101,108,100,115, 32, 97, 114,101, 32,115,116,111,114,101,100, 58, 10, 45, 45, 32, 32, 32, 32,123,105,125, 32, 61, 32,108,105,115,116, 32,111,102, 32,111, 98,106,101, 99,116,115, 32,105,110, 32,116,104,101, 32,109,111,100,117,108,101, 46, 10, 99,108, 97,115,115, 77, 111,100,117,108,101, 32, 61, 32,123, 10, 32, 99,108, 97,115, 115,116,121,112,101, 32, 61, 32, 39,109,111,100,117,108,101, 39, 10,125, 10, 99,108, 97,115,115, 77,111,100,117,108,101, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97,115, 115, 77,111,100,117,108,101, 10,115,101,116,109,101,116, 97, 116, 97, 98,108,101, 40, 99,108, 97,115,115, 77,111,100,117, 108,101, 44, 99,108, 97,115,115, 67,111,110,116, 97,105,110, 101,114, 41, 10, 10, 45, 45, 32,114,101,103,105,115,116,101, 114, 32,109,111,100,117,108,101, 10,102,117,110, 99,116,105, 111,110, 32, 99,108, 97,115,115, 77,111,100,117,108,101, 58, 114,101,103,105,115,116,101,114, 32, 40,112,114,101, 41, 10, 32,112,114,101, 32, 61, 32,112,114,101, 32,111,114, 32, 39, 39, 10, 32,112,117,115,104, 40,115,101,108,102, 41, 10, 32, 111,117,116,112,117,116, 40,112,114,101, 46, 46, 39,116,111, 108,117, 97, 95,109,111,100,117,108,101, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101,108,102, 46,110, 97, 109,101, 46, 46, 39, 34, 44, 39, 44,115,101,108,102, 58,104, 97,115,118, 97,114, 40, 41, 44, 39, 41, 59, 39, 41, 10, 32, 111,117,116,112,117,116, 40,112,114,101, 46, 46, 39,116,111, 108,117, 97, 95, 98,101,103,105,110,109,111,100,117,108,101, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101, 108,102, 46,110, 97,109,101, 46, 46, 39, 34, 41, 59, 39, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104, 105,108,101, 32,115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32,115,101,108,102, 91,105, 93, 58,114,101,103,105,115, 116,101,114, 40,112,114,101, 46, 46, 39, 32, 39, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32, 111,117,116,112,117,116, 40,112,114,101, 46, 46, 39,116,111, 108,117, 97, 95,101,110,100,109,111,100,117,108,101, 40,116, 111,108,117, 97, 95, 83, 41, 59, 39, 41, 10, 9,112,111,112, 40, 41, 10,101,110,100, 10, 10, 45, 45, 32, 80,114,105,110, 116, 32,109,101,116,104,111,100, 10,102,117,110, 99,116,105, 111,110, 32, 99,108, 97,115,115, 77,111,100,117,108,101, 58, 112,114,105,110,116, 32, 40,105,100,101,110,116, 44, 99,108, 111,115,101, 41, 10, 32,112,114,105,110,116, 40,105,100,101, 110,116, 46, 46, 34, 77,111,100,117,108,101,123, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46,110, 97,109,101, 46, 46, 34, 39, 59, 34, 41, 10, 32, 108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108, 101, 32,115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32, 115,101,108,102, 91,105, 93, 58,112,114,105,110,116, 40,105, 100,101,110,116, 46, 46, 34, 32, 34, 44, 34, 44, 34, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 125, 34, 46, 46, 99,108,111,115,101, 41, 10,101,110,100, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99,111, 110,115,116,114,117, 99,116,111,114, 10,102,117,110, 99,116, 105,111,110, 32, 95, 77,111,100,117,108,101, 32, 40,116, 41, 10, 32,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40, 116, 44, 99,108, 97,115,115, 77,111,100,117,108,101, 41, 10, 32, 97,112,112,101,110,100, 40,116, 41, 10, 32,114,101,116, 117,114,110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67, 111,110,115,116,114,117, 99,116,111,114, 10, 45, 45, 32, 69, 120,112,101, 99,116,115, 32,116,119,111, 32,115,116,114,105, 110,103, 32,114,101,112,114,101,115,101,110,116,105,110,103, 32,116,104,101, 32,109,111,100,117,108,101, 32,110, 97,109, 101, 32, 97,110,100, 32, 98,111,100,121, 46, 10,102,117,110, 99,116,105,111,110, 32, 77,111,100,117,108,101, 32, 40,110, 44, 98, 41, 10, 32,108,111, 99, 97,108, 32,116, 32, 61, 32, 95, 77,111,100,117,108,101, 40, 95, 67,111,110,116, 97,105, 110,101,114,123,110, 97,109,101, 61,110,125, 41, 10, 32,112, 117,115,104, 40,116, 41, 10, 32,116, 58,112, 97,114,115,101, 40,115,116,114,115,117, 98, 40, 98, 44, 50, 44,115,116,114, 108,101,110, 40, 98, 41, 45, 49, 41, 41, 32, 45, 45, 32,101, 108,105,109,105,110, 97,116,101, 32, 98,114, 97, 99,101,115, 10, 32,112,111,112, 40, 41, 10, 32,114,101,116,117,114,110, 32,116, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/module.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,110, 97,109,101,115, 112, 97, 99,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87, 114,105,116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101, 109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 50, 48, 48, 51, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111,100,101, 32,105,115, 32,102,114,101,101, 32,115,111, 102,116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101,100,105,115,116,114,105, 98,117,116,101, 32,105, 116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102, 116,119, 97,114,101, 32,112,114,111,118,105,100,101,100, 32, 104,101,114,101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115, 105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97,117,116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105,103, 97,116,105,111,110, 32,116,111, 32,112,114, 111,118,105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112, 100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101,109,101,110,116,115, 44, 32,111,114, 32,109,111,100, 105,102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 45, 45, 32, 78, 97,109,101,115,112, 97, 99,101, 32, 99,108, 97, 115,115, 10, 45, 45, 32, 82,101,112,114,101,115,101,110,116, 115, 32, 97, 32,110, 97,109,101,115, 97,112, 99,101, 32,100, 101,102,105,110,105,116,105,111,110, 46, 10, 45, 45, 32, 83, 116,111,114,101,115, 32,116,104,101, 32,102,111,108,108,111, 119,105,110,103, 32,102,105,101,108,100,115, 58, 10, 45, 45, 32, 32, 32, 32,110, 97,109,101, 32, 61, 32, 99,108, 97,115, 115, 32,110, 97,109,101, 10, 45, 45, 32, 32, 32, 32,123,105, 125, 32, 32, 61, 32,108,105,115,116, 32,111,102, 32,109,101, 109, 98,101,114,115, 10, 99,108, 97,115,115, 78, 97,109,101, 115,112, 97, 99,101, 32, 61, 32,123, 10, 32, 99,108, 97,115, 115,116,121,112,101, 32, 61, 32, 39,110, 97,109,101,115,112, 97, 99,101, 39, 44, 10, 32,110, 97,109,101, 32, 61, 32, 39, 39, 44, 10,125, 10, 99,108, 97,115,115, 78, 97,109,101,115, 112, 97, 99,101, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97,115,115, 78, 97,109,101,115,112, 97, 99,101, 10, 115,101,116,109,101,116, 97,116, 97, 98,108,101, 40, 99,108, 97,115,115, 78, 97,109,101,115,112, 97, 99,101, 44, 99,108, 97,115,115, 77,111,100,117,108,101, 41, 10, 10, 45, 45, 32, 80,114,105,110,116, 32,109,101,116,104,111,100, 10,102,117, 110, 99,116,105,111,110, 32, 99,108, 97,115,115, 78, 97,109, 101,115,112, 97, 99,101, 58,112,114,105,110,116, 32, 40,105, 100,101,110,116, 44, 99,108,111,115,101, 41, 10, 32,112,114, 105,110,116, 40,105,100,101,110,116, 46, 46, 34, 78, 97,109, 101,115,112, 97, 99,101,123, 34, 41, 10, 32,112,114,105,110, 116, 40,105,100,101,110,116, 46, 46, 34, 32,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,110, 97,109, 101, 46, 46, 34, 39, 44, 34, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108,101, 32,115,101,108, 102, 91,105, 93, 32,100,111, 10, 32, 32,115,101,108,102, 91, 105, 93, 58,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 34, 44, 34, 44, 34, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,112,114,105,110, 116, 40,105,100,101,110,116, 46, 46, 34,125, 34, 46, 46, 99, 108,111,115,101, 41, 10,101,110,100, 10, 10, 45, 45, 32, 73, 110,116,101,114,110, 97,108, 32, 99,111,110,115,116,114,117, 99,116,111,114, 10,102,117,110, 99,116,105,111,110, 32, 95, 78, 97,109,101,115,112, 97, 99,101, 32, 40,116, 41, 10, 32, 115,101,116,109,101,116, 97,116, 97, 98,108,101, 40,116, 44, 99,108, 97,115,115, 78, 97,109,101,115,112, 97, 99,101, 41, 10, 32, 97,112,112,101,110,100, 40,116, 41, 10, 32,114,101, 116,117,114,110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110,115,116,114,117, 99,116,111,114, 10, 45, 45, 32, 69,120,112,101, 99,116,115, 32,116,104,101, 32,110, 97,109, 101, 32, 97,110,100, 32,116,104,101, 32, 98,111,100,121, 32, 111,102, 32,116,104,101, 32,110, 97,109,101,115,112, 97, 99, 101, 46, 10,102,117,110, 99,116,105,111,110, 32, 78, 97,109, 101,115,112, 97, 99,101, 32, 40,110, 44, 98, 41, 10, 32,108, 111, 99, 97,108, 32, 99, 32, 61, 32, 95, 78, 97,109,101,115, 112, 97, 99,101, 40, 95, 67,111,110,116, 97,105,110,101,114, 123,110, 97,109,101, 61,110,125, 41, 10, 32,112,117,115,104, 40, 99, 41, 10, 32, 99, 58,112, 97,114,115,101, 40,115,116, 114,115,117, 98, 40, 98, 44, 50, 44,115,116,114,108,101,110, 40, 98, 41, 45, 49, 41, 41, 32, 45, 45, 32,101,108,105,109, 105,110, 97,116,101, 32, 98,114, 97, 99,101,115, 10, 32,112, 111,112, 40, 41, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/namespace.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,100,101,102,105,110, 101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114,105,116, 116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74, 117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73,100, 58, 32,100,101,102,105,110,101, 46,108,117, 97, 44,118, 32, 49, 46, 50, 32, 49, 57, 57, 57, 47, 48, 55, 47, 50, 56, 32, 50, 50, 58, 50, 49, 58, 48, 56, 32, 99,101,108,101,115, 32, 69, 120,112, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99, 111,100,101, 32,105,115, 32,102,114,101,101, 32,115,111,102, 116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32, 114,101,100,105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32, 105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116, 119, 97,114,101, 32,112,114,111,118,105,100,101,100, 32,104, 101,114,101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105, 115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97, 117,116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98, 108,105,103, 97,116,105,111,110, 32,116,111, 32,112,114,111, 118,105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99, 101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99, 101,109,101,110,116,115, 44, 32,111,114, 32,109,111,100,105, 102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 45, 45, 32, 68,101,102,105,110,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101,115,101,110,116,115, 32, 97, 32, 110,117,109,101,114,105, 99, 32, 99,111,110,115,116, 32,100, 101,102,105,110,105,116,105,111,110, 10, 45, 45, 32, 84,104, 101, 32,102,111,108,108,111,119,105,110,103, 32,102,105,108, 100,115, 32, 97,114,101, 32,115,116,111,114,101,100, 58, 10, 45, 45, 32, 32, 32,110, 97,109,101, 32, 61, 32, 99,111,110, 115,116, 97,110,116, 32,110, 97,109,101, 10, 99,108, 97,115, 115, 68,101,102,105,110,101, 32, 61, 32,123, 10, 32,110, 97, 109,101, 32, 61, 32, 39, 39, 44, 10,125, 10, 99,108, 97,115, 115, 68,101,102,105,110,101, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97,115,115, 68,101,102,105,110,101, 10, 115,101,116,109,101,116, 97,116, 97, 98,108,101, 40, 99,108, 97,115,115, 68,101,102,105,110,101, 44, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 41, 10, 10, 45, 45, 32,114,101, 103,105,115,116,101,114, 32,100,101,102,105,110,101, 10,102, 117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 68,101, 102,105,110,101, 58,114,101,103,105,115,116,101,114, 32, 40, 112,114,101, 41, 10, 9,105,102, 32,110,111,116, 32,115,101, 108,102, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 32,116,104,101,110, 10, 9, 9,114,101,116,117,114,110, 10, 9,101,110,100, 10, 10, 32,112,114,101, 32, 61, 32,112,114,101, 32,111,114, 32, 39, 39, 10, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 39,116,111,108,117, 97, 95, 99,111,110,115,116, 97,110,116, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101, 108,102, 46,108,110, 97,109,101, 46, 46, 39, 34, 44, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 41, 59, 39, 41, 10,101,110,100, 10, 10, 45, 45, 32, 80,114,105,110, 116, 32,109,101,116,104,111,100, 10,102,117,110, 99,116,105, 111,110, 32, 99,108, 97,115,115, 68,101,102,105,110,101, 58, 112,114,105,110,116, 32, 40,105,100,101,110,116, 44, 99,108, 111,115,101, 41, 10, 32,112,114,105,110,116, 40,105,100,101, 110,116, 46, 46, 34, 68,101,102,105,110,101,123, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32, 112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 108,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46,108,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 125, 34, 46, 46, 99,108,111,115,101, 41, 10,101,110,100, 10, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99, 111,110,115,116,114,117, 99,116,111,114, 10,102,117,110, 99, 116,105,111,110, 32, 95, 68,101,102,105,110,101, 32, 40,116, 41, 10, 32,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40,116, 44, 99,108, 97,115,115, 68,101,102,105,110,101, 41, 10, 32,116, 58, 98,117,105,108,100,110, 97,109,101,115, 40, 41, 10, 10, 32,105,102, 32,116, 46,110, 97,109,101, 32, 61, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 32,101,114,114, 111,114, 40, 34, 35,105,110,118, 97,108,105,100, 32,100,101, 102,105,110,101, 34, 41, 10, 32,101,110,100, 10, 10, 32, 97, 112,112,101,110,100, 40,116, 41, 10, 32,114,101,116,117,114, 110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110, 115,116,114,117, 99,116,111,114, 10, 45, 45, 32, 69,120,112, 101, 99,116,115, 32, 97, 32,115,116,114,105,110,103, 32,114, 101,112,114,101,115,101,110,116,105,110,103, 32,116,104,101, 32, 99,111,110,115,116, 97,110,116, 32,110, 97,109,101, 10, 102,117,110, 99,116,105,111,110, 32, 68,101,102,105,110,101, 32, 40,110, 41, 10, 32,114,101,116,117,114,110, 32, 95, 68, 101,102,105,110,101,123, 10, 32, 32,110, 97,109,101, 32, 61, 32,110, 10, 32,125, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/define.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,101,110,117,109,101, 114, 97,116,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87, 114,105,116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101, 109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73,100, 58, 32,101,110,117,109,101,114, 97,116,101, 46,108, 117, 97, 44,118, 32, 49, 46, 51, 32, 50, 48, 48, 48, 47, 48, 49, 47, 50, 52, 32, 50, 48, 58, 52, 49, 58, 49, 53, 32, 99, 101,108,101,115, 32, 69,120,112, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111,100,101, 32,105,115, 32,102,114, 101,101, 32,115,111,102,116,119, 97,114,101, 59, 32,121,111, 117, 32, 99, 97,110, 32,114,101,100,105,115,116,114,105, 98, 117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109, 111,100,105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104, 101, 32,115,111,102,116,119, 97,114,101, 32,112,114,111,118, 105,100,101,100, 32,104,101,114,101,117,110,100,101,114, 32, 105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97,117,116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105,103, 97,116,105,111,110, 32, 116,111, 32,112,114,111,118,105,100,101, 32,109, 97,105,110, 116,101,110, 97,110, 99,101, 44, 32,115,117,112,112,111,114, 116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32, 101,110,104, 97,110, 99,101,109,101,110,116,115, 44, 32,111, 114, 32,109,111,100,105,102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 45, 45, 32, 69,110,117,109,101,114, 97,116, 101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114, 101,115,101,110,116,115, 32,101,110,117,109,101,114, 97,116, 105,111,110, 10, 45, 45, 32, 84,104,101, 32,102,111,108,108, 111,119,105,110,103, 32,102,105,101,108,100,115, 32, 97,114, 101, 32,115,116,111,114,101,100, 58, 10, 45, 45, 32, 32, 32, 32,123,105,125, 32, 61, 32,108,105,115,116, 32,111,102, 32, 99,111,110,115,116, 97,110,116, 32,110, 97,109,101,115, 10, 99,108, 97,115,115, 69,110,117,109,101,114, 97,116,101, 32, 61, 32,123, 10,125, 10, 99,108, 97,115,115, 69,110,117,109, 101,114, 97,116,101, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97,115,115, 69,110,117,109,101,114, 97,116,101, 10,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40, 99, 108, 97,115,115, 69,110,117,109,101,114, 97,116,101, 44, 99, 108, 97,115,115, 70,101, 97,116,117,114,101, 41, 10, 10, 45, 45, 32,114,101,103,105,115,116,101,114, 32,101,110,117,109, 101,114, 97,116,105,111,110, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 69,110,117,109,101,114, 97,116, 101, 58,114,101,103,105,115,116,101,114, 32, 40,112,114,101, 41, 10, 9,105,102, 32,110,111,116, 32,115,101,108,102, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 32,116,104,101,110, 10, 9, 9,114, 101,116,117,114,110, 10, 9,101,110,100, 10, 32,112,114,101, 32, 61, 32,112,114,101, 32,111,114, 32, 39, 39, 10, 32,108, 111, 99, 97,108, 32,110,115,112, 97, 99,101, 32, 61, 32,103, 101,116,110, 97,109,101,115,112, 97, 99,101, 40, 99,108, 97, 115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114, 114, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32, 119,104,105,108,101, 32,115,101,108,102, 91,105, 93, 32,100, 111, 10, 32, 9,105,102, 32,115,101,108,102, 46,108,110, 97, 109,101,115, 91,105, 93, 32, 97,110,100, 32,115,101,108,102, 46,108,110, 97,109,101,115, 91,105, 93, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 10, 9, 10, 9, 9,111,117,116,112, 117,116, 40,112,114,101, 46, 46, 39,116,111,108,117, 97, 95, 99,111,110,115,116, 97,110,116, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101,108,102, 46,108,110, 97,109, 101,115, 91,105, 93, 46, 46, 39, 34, 44, 39, 46, 46,110,115, 112, 97, 99,101, 46, 46,115,101,108,102, 91,105, 93, 46, 46, 39, 41, 59, 39, 41, 10, 9,101,110,100, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 80,114,105,110,116, 32,109,101,116,104,111, 100, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115, 115, 69,110,117,109,101,114, 97,116,101, 58,112,114,105,110, 116, 32, 40,105,100,101,110,116, 44, 99,108,111,115,101, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 69,110,117,109,101,114, 97,116,101,123, 34, 41, 10, 32, 112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 110, 97,109,101, 32, 61, 32, 34, 46, 46,115,101,108,102, 46, 110, 97,109,101, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108,101, 32,115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32,112,114,105,110,116, 40,105,100, 101,110,116, 46, 46, 34, 32, 39, 34, 46, 46,115,101,108,102, 91,105, 93, 46, 46, 34, 39, 40, 34, 46, 46,115,101,108,102, 46,108,110, 97,109,101,115, 91,105, 93, 46, 46, 34, 41, 44, 34, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101, 110,100, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34,125, 34, 46, 46, 99,108,111,115,101, 41, 10,101, 110,100, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99,111,110,115,116,114,117, 99,116,111,114, 10,102,117, 110, 99,116,105,111,110, 32, 95, 69,110,117,109,101,114, 97, 116,101, 32, 40,116, 44,118, 97,114,110, 97,109,101, 41, 10, 32,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40,116, 44, 99,108, 97,115,115, 69,110,117,109,101,114, 97,116,101, 41, 10, 32, 97,112,112,101,110,100, 40,116, 41, 10, 32, 97, 112,112,101,110,100,101,110,117,109, 40,116, 41, 10, 9, 32, 105,102, 32,118, 97,114,110, 97,109,101, 32, 97,110,100, 32, 118, 97,114,110, 97,109,101, 32,126, 61, 32, 34, 34, 32,116, 104,101,110, 10, 9, 9,105,102, 32,116, 46,110, 97,109,101, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 10, 9, 9, 9, 86, 97,114,105, 97, 98,108,101, 40,116, 46,110, 97,109,101, 46, 46, 34, 32, 34, 46, 46,118, 97,114,110, 97,109,101, 41, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,108,111, 99, 97, 108, 32,110,115, 32, 61, 32,103,101,116, 99,117,114,114,110, 97,109,101,115,112, 97, 99,101, 40, 41, 10, 9, 9, 9,119, 97,114,110,105,110,103, 40, 34, 86, 97,114,105, 97, 98,108, 101, 32, 34, 46, 46,110,115, 46, 46,118, 97,114,110, 97,109, 101, 46, 46, 34, 32,111,102, 32,116,121,112,101, 32, 60, 97, 110,111,110,121,109,111,117,115, 32,101,110,117,109, 62, 32, 105,115, 32,100,101, 99,108, 97,114,101,100, 32, 97,115, 32, 114,101, 97,100, 45,111,110,108,121, 34, 41, 10, 9, 9, 9, 86, 97,114,105, 97, 98,108,101, 40, 34,116,111,108,117, 97, 95,114,101, 97,100,111,110,108,121, 32,105,110,116, 32, 34, 46, 46,118, 97,114,110, 97,109,101, 41, 10, 9, 9,101,110, 100, 10, 9,101,110,100, 10, 9, 32,108,111, 99, 97,108, 32, 112, 97,114,101,110,116, 32, 61, 32, 99,108, 97,115,115, 67, 111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 10, 9, 32,105,102, 32,112, 97,114,101,110,116, 32,116,104,101,110, 10, 9, 9,116, 46, 97, 99, 99,101,115,115, 32, 61, 32,112, 97,114,101,110,116, 46, 99,117,114,114, 95,109,101,109, 98, 101,114, 95, 97, 99, 99,101,115,115, 10, 9, 9,116, 46,103, 108,111, 98, 97,108, 95, 97, 99, 99,101,115,115, 32, 61, 32, 116, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 10, 9, 32,101,110,100, 10, 114,101,116,117,114,110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110,115,116,114,117, 99,116,111,114, 10, 45, 45, 32, 69,120,112,101, 99,116,115, 32, 97, 32,115,116,114, 105,110,103, 32,114,101,112,114,101,115,101,110,116,105,110, 103, 32,116,104,101, 32,101,110,117,109,101,114, 97,116,101, 32, 98,111,100,121, 10,102,117,110, 99,116,105,111,110, 32, 69,110,117,109,101,114, 97,116,101, 32, 40,110, 44, 98, 44, 118, 97,114,110, 97,109,101, 41, 10, 9, 98, 32, 61, 32,115, 116,114,105,110,103, 46,103,115,117, 98, 40, 98, 44, 32, 34, 44, 91, 37,115, 92,110, 93, 42,125, 34, 44, 32, 34, 92,110, 125, 34, 41, 32, 45, 45, 32,101,108,105,109,105,110, 97,116, 101, 32,108, 97,115,116, 32, 39, 44, 39, 10, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,115,112,108,105,116, 40,115,116, 114,115,117, 98, 40, 98, 44, 50, 44, 45, 50, 41, 44, 39, 44, 39, 41, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101, 32, 98,114, 97, 99,101,115, 10, 32,108,111, 99, 97,108, 32, 105, 32, 61, 32, 49, 10, 32,108,111, 99, 97,108, 32,101, 32, 61, 32,123,110, 61, 48,125, 10, 32,119,104,105,108,101, 32, 116, 91,105, 93, 32,100,111, 10, 32, 32,108,111, 99, 97,108, 32,116,116, 32, 61, 32,115,112,108,105,116, 40,116, 91,105, 93, 44, 39, 61, 39, 41, 32, 32, 45, 45, 32,100,105,115, 99, 97,114,100, 32,105,110,105,116,105, 97,108, 32,118, 97,108, 117,101, 10, 32, 32,101, 46,110, 32, 61, 32,101, 46,110, 32, 43, 32, 49, 10, 32, 32,101, 91,101, 46,110, 93, 32, 61, 32, 116,116, 91, 49, 93, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32, 45, 45, 32,115,101,116, 32,108, 117, 97, 32,110, 97,109,101,115, 10, 32,105, 32, 32, 61, 32, 49, 10, 32,101, 46,108,110, 97,109,101,115, 32, 61, 32,123, 125, 10, 32,108,111, 99, 97,108, 32,110,115, 32, 61, 32,103, 101,116, 99,117,114,114,110, 97,109,101,115,112, 97, 99,101, 40, 41, 10, 32,119,104,105,108,101, 32,101, 91,105, 93, 32, 100,111, 10, 32, 32,108,111, 99, 97,108, 32,116, 32, 61, 32, 115,112,108,105,116, 40,101, 91,105, 93, 44, 39, 64, 39, 41, 10, 32, 32,101, 91,105, 93, 32, 61, 32,116, 91, 49, 93, 10, 9, 9,105,102, 32,110,111,116, 32,116, 91, 50, 93, 32,116, 104,101,110, 10, 9, 9, 32,116, 91, 50, 93, 32, 61, 32, 97, 112,112,108,121,114,101,110, 97,109,105,110,103, 40,116, 91, 49, 93, 41, 10, 9, 9,101,110,100, 10, 32, 32,101, 46,108, 110, 97,109,101,115, 91,105, 93, 32, 61, 32,116, 91, 50, 93, 32,111,114, 32,116, 91, 49, 93, 10, 32, 32, 95,103,108,111, 98, 97,108, 95,101,110,117,109,115, 91, 32,110,115, 46, 46, 101, 91,105, 93, 32, 93, 32, 61, 32, 40,110,115, 46, 46,101, 91,105, 93, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 9,101, 46,110, 97,109,101, 32, 61, 32, 110, 10, 9,105,102, 32,110, 32,126, 61, 32, 34, 34, 32,116, 104,101,110, 10, 9, 9, 84,121,112,101,100,101,102, 40, 34, 105,110,116, 32, 34, 46, 46,110, 41, 10, 9,101,110,100, 10, 32,114,101,116,117,114,110, 32, 95, 69,110,117,109,101,114, 97,116,101, 40,101, 44, 32,118, 97,114,110, 97,109,101, 41, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/enumerate.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,100,101, 99,108, 97, 114, 97,116,105,111,110, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114,105,116,116,101,110, 32, 98,121, 32, 87, 97,108, 100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105, 115, 32, 99,111,100,101, 32,105,115, 32,102,114,101,101, 32, 115,111,102,116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101,100,105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105, 102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115, 111,102,116,119, 97,114,101, 32,112,114,111,118,105,100,101, 100, 32,104,101,114,101,117,110,100,101,114, 32,105,115, 32, 111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104, 101, 32, 97,117,116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105,103, 97,116,105,111,110, 32,116,111, 32, 112,114,111,118,105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32,115,117,112,112,111,114,116, 44, 32, 117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101,109,101,110,116,115, 44, 32,111,114, 32,109, 111,100,105,102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 45, 45, 32, 68,101, 99,108, 97,114, 97,116,105,111,110, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101, 115,101,110,116,115, 32,118, 97,114,105, 97, 98,108,101, 44, 32,102,117,110, 99,116,105,111,110, 44, 32,111,114, 32, 97, 114,103,117,109,101,110,116, 32,100,101, 99,108, 97,114, 97, 116,105,111,110, 46, 10, 45, 45, 32, 83,116,111,114,101,115, 32,116,104,101, 32,102,111,108,108,111,119,105,110,103, 32, 102,105,101,108,100,115, 58, 10, 45, 45, 32, 32,109,111,100, 32, 32, 61, 32,116,121,112,101, 32,109,111,100,105,102,105, 101,114,115, 10, 45, 45, 32, 32,116,121,112,101, 32, 61, 32, 116,121,112,101, 10, 45, 45, 32, 32,112,116,114, 32, 32, 61, 32, 34, 42, 34, 32,111,114, 32, 34, 38, 34, 44, 32,105,102, 32,114,101,112,114,101,115,101,110,116,105,110,103, 32, 97, 32,112,111,105,110,116,101,114, 32,111,114, 32, 97, 32,114, 101,102,101,114,101,110, 99,101, 10, 45, 45, 32, 32,110, 97, 109,101, 32, 61, 32,110, 97,109,101, 10, 45, 45, 32, 32,100, 105,109, 32, 32, 61, 32,100,105,109,101,110,115,105,111,110, 44, 32,105,102, 32, 97, 32,118,101, 99,116,111,114, 10, 45, 45, 32, 32,100,101,102, 32, 32, 61, 32,100,101,102, 97,117, 108,116, 32,118, 97,108,117,101, 44, 32,105,102, 32, 97,110, 121, 32, 40,111,110,108,121, 32,102,111,114, 32, 97,114,103, 117,109,101,110,116,115, 41, 10, 45, 45, 32, 32,114,101,116, 32, 32, 61, 32, 34, 42, 34, 32,111,114, 32, 34, 38, 34, 44, 32,105,102, 32,118, 97,108,117,101, 32,105,115, 32,116,111, 32, 98,101, 32,114,101,116,117,114,110,101,100, 32, 40,111, 110,108,121, 32,102,111,114, 32, 97,114,103,117,109,101,110, 116,115, 41, 10, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 32, 61, 32,123, 10, 32,109,111,100, 32, 61, 32, 39, 39, 44, 10, 32,116,121,112,101, 32, 61, 32, 39, 39, 44, 10, 32,112,116,114, 32, 61, 32, 39, 39, 44, 10, 32, 110, 97,109,101, 32, 61, 32, 39, 39, 44, 10, 32,100,105,109, 32, 61, 32, 39, 39, 44, 10, 32,114,101,116, 32, 61, 32, 39, 39, 44, 10, 32,100,101,102, 32, 61, 32, 39, 39, 10,125, 10, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105,111, 110, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97, 115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 10,115, 101,116,109,101,116, 97,116, 97, 98,108,101, 40, 99,108, 97, 115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 44, 99, 108, 97,115,115, 70,101, 97,116,117,114,101, 41, 10, 10, 45, 45, 32, 67,114,101, 97,116,101, 32, 97,110, 32,117,110,105, 113,117,101, 32,118, 97,114,105, 97, 98,108,101, 32,110, 97, 109,101, 10,102,117,110, 99,116,105,111,110, 32, 99,114,101, 97,116,101, 95,118, 97,114,110, 97,109,101, 32, 40, 41, 10, 32,105,102, 32,110,111,116, 32, 95,118, 97,114,110,117,109, 98,101,114, 32,116,104,101,110, 32, 95,118, 97,114,110,117, 109, 98,101,114, 32, 61, 32, 48, 32,101,110,100, 10, 32, 95, 118, 97,114,110,117,109, 98,101,114, 32, 61, 32, 95,118, 97, 114,110,117,109, 98,101,114, 32, 43, 32, 49, 10, 32,114,101, 116,117,114,110, 32, 34,116,111,108,117, 97, 95,118, 97,114, 95, 34, 46, 46, 95,118, 97,114,110,117,109, 98,101,114, 10, 101,110,100, 10, 10, 45, 45, 32, 67,104,101, 99,107, 32,100, 101, 99,108, 97,114, 97,116,105,111,110, 32,110, 97,109,101, 10, 45, 45, 32, 73,116, 32, 97,108,115,111, 32,105,100,101, 110,116,105,102,105,101,115, 32,100,101,102, 97,117,108,116, 32,118, 97,108,117,101,115, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116, 105,111,110, 58, 99,104,101, 99,107,110, 97,109,101, 32, 40, 41, 10, 10, 32,105,102, 32,115,116,114,115,117, 98, 40,115, 101,108,102, 46,110, 97,109,101, 44, 49, 44, 49, 41, 32, 61, 61, 32, 39, 91, 39, 32, 97,110,100, 32,110,111,116, 32,102, 105,110,100,116,121,112,101, 40,115,101,108,102, 46,116,121, 112,101, 41, 32,116,104,101,110, 10, 32, 32,115,101,108,102, 46,110, 97,109,101, 32, 61, 32,115,101,108,102, 46,116,121, 112,101, 46, 46,115,101,108,102, 46,110, 97,109,101, 10, 32, 32,108,111, 99, 97,108, 32,109, 32, 61, 32,115,112,108,105, 116, 40,115,101,108,102, 46,109,111,100, 44, 39, 37,115, 37, 115, 42, 39, 41, 10, 32, 32,115,101,108,102, 46,116,121,112, 101, 32, 61, 32,109, 91,109, 46,110, 93, 10, 32, 32,115,101, 108,102, 46,109,111,100, 32, 61, 32, 99,111,110, 99, 97,116, 40,109, 44, 49, 44,109, 46,110, 45, 49, 41, 10, 32,101,110, 100, 10, 10, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,115, 112,108,105,116, 40,115,101,108,102, 46,110, 97,109,101, 44, 39, 61, 39, 41, 10, 32,105,102, 32,116, 46,110, 61, 61, 50, 32,116,104,101,110, 10, 32, 32,115,101,108,102, 46,110, 97, 109,101, 32, 61, 32,116, 91, 49, 93, 10, 32, 32,115,101,108, 102, 46,100,101,102, 32, 61, 32,102,105,110,100, 95,101,110, 117,109, 95,118, 97,114, 40,116, 91,116, 46,110, 93, 41, 10, 32,101,110,100, 10, 10, 32,108,111, 99, 97,108, 32, 98, 44, 101, 44,100, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 101,108,102, 46,110, 97,109,101, 44, 34, 37, 91, 40, 46, 45, 41, 37, 93, 34, 41, 10, 32,105,102, 32, 98, 32,116,104,101, 110, 10, 32, 32,115,101,108,102, 46,110, 97,109,101, 32, 61, 32,115,116,114,115,117, 98, 40,115,101,108,102, 46,110, 97, 109,101, 44, 49, 44, 98, 45, 49, 41, 10, 32, 32,115,101,108, 102, 46,100,105,109, 32, 61, 32,102,105,110,100, 95,101,110, 117,109, 95,118, 97,114, 40,100, 41, 10, 32,101,110,100, 10, 10, 10, 32,105,102, 32,115,101,108,102, 46,116,121,112,101, 32,126, 61, 32, 39, 39, 32, 97,110,100, 32,115,101,108,102, 46,116,121,112,101, 32,126, 61, 32, 39,118,111,105,100, 39, 32, 97,110,100, 32,115,101,108,102, 46,110, 97,109,101, 32, 61, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 32,115,101, 108,102, 46,110, 97,109,101, 32, 61, 32, 99,114,101, 97,116, 101, 95,118, 97,114,110, 97,109,101, 40, 41, 10, 32,101,108, 115,101,105,102, 32,115,101,108,102, 46,107,105,110,100, 61, 61, 39,118, 97,114, 39, 32,116,104,101,110, 10, 32, 32,105, 102, 32,115,101,108,102, 46,116,121,112,101, 61, 61, 39, 39, 32, 97,110,100, 32,115,101,108,102, 46,110, 97,109,101,126, 61, 39, 39, 32,116,104,101,110, 10, 32, 32, 32,115,101,108, 102, 46,116,121,112,101, 32, 61, 32,115,101,108,102, 46,116, 121,112,101, 46, 46,115,101,108,102, 46,110, 97,109,101, 10, 32, 32, 32,115,101,108,102, 46,110, 97,109,101, 32, 61, 32, 99,114,101, 97,116,101, 95,118, 97,114,110, 97,109,101, 40, 41, 10, 32, 32,101,108,115,101,105,102, 32,102,105,110,100, 116,121,112,101, 40,115,101,108,102, 46,110, 97,109,101, 41, 32,116,104,101,110, 10, 32, 32, 32,105,102, 32,115,101,108, 102, 46,116,121,112,101, 61, 61, 39, 39, 32,116,104,101,110, 32,115,101,108,102, 46,116,121,112,101, 32, 61, 32,115,101, 108,102, 46,110, 97,109,101, 10, 32, 32, 32,101,108,115,101, 32,115,101,108,102, 46,116,121,112,101, 32, 61, 32,115,101, 108,102, 46,116,121,112,101, 46, 46, 39, 32, 39, 46, 46,115, 101,108,102, 46,110, 97,109,101, 32,101,110,100, 10, 32, 32, 32,115,101,108,102, 46,110, 97,109,101, 32, 61, 32, 99,114, 101, 97,116,101, 95,118, 97,114,110, 97,109,101, 40, 41, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 97,100,106,117,115,116, 32,116,121,112,101, 32,111,102, 32,115,116,114,105,110,103, 10, 32,105,102, 32,115,101,108, 102, 46,116,121,112,101, 32, 61, 61, 32, 39, 99,104, 97,114, 39, 32, 97,110,100, 32,115,101,108,102, 46,100,105,109, 32, 126, 61, 32, 39, 39, 32,116,104,101,110, 10, 9, 32,115,101, 108,102, 46,116,121,112,101, 32, 61, 32, 39, 99,104, 97,114, 42, 39, 10, 32,101,110,100, 10, 10, 9,105,102, 32,115,101, 108,102, 46,107,105,110,100, 32, 97,110,100, 32,115,101,108, 102, 46,107,105,110,100, 32, 61, 61, 32, 39,118, 97,114, 39, 32,116,104,101,110, 10, 9, 9,115,101,108,102, 46,110, 97, 109,101, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,115,101,108,102, 46,110, 97,109,101, 44, 32, 34, 58, 46, 42, 36, 34, 44, 32, 34, 34, 41, 32, 45, 45, 32, 63, 63, 63, 10, 9,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 67,104,101, 99,107, 32,100,101, 99,108, 97,114, 97,116,105, 111,110, 32,116,121,112,101, 10, 45, 45, 32, 83,117, 98,115, 116,105,116,117,116,101,115, 32,116,121,112,101,100,101,102, 39,115, 46, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 58, 99,104,101, 99,107,116,121,112,101, 32, 40, 41, 10, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32,116,104,101, 114,101, 32,105,115, 32, 97, 32,112,111,105,110,116,101,114, 32,116,111, 32, 98, 97,115,105, 99, 32,116,121,112,101, 10, 32,108,111, 99, 97,108, 32, 98, 97,115,105, 99, 32, 61, 32, 105,115, 98, 97,115,105, 99, 40,115,101,108,102, 46,116,121, 112,101, 41, 10, 32,105,102, 32,115,101,108,102, 46,107,105, 110,100, 32, 61, 61, 32, 39,102,117,110, 99, 39, 32, 97,110, 100, 32, 98, 97,115,105, 99, 61, 61, 39,110,117,109, 98,101, 114, 39, 32, 97,110,100, 32,115,116,114,105,110,103, 46,102, 105,110,100, 40,115,101,108,102, 46,112,116,114, 44, 32, 34, 37, 42, 34, 41, 32,116,104,101,110, 10, 32, 9,115,101,108, 102, 46,116,121,112,101, 32, 61, 32, 39, 95,117,115,101,114, 100, 97,116, 97, 39, 10, 32, 9,115,101,108,102, 46,112,116, 114, 32, 61, 32, 34, 34, 10, 32,101,110,100, 10, 32,105,102, 32, 98, 97,115,105, 99, 32, 97,110,100, 32,115,101,108,102, 46,112,116,114,126, 61, 39, 39, 32,116,104,101,110, 10, 32, 32,115,101,108,102, 46,114,101,116, 32, 61, 32,115,101,108, 102, 46,112,116,114, 10, 32, 32,115,101,108,102, 46,112,116, 114, 32, 61, 32,110,105,108, 10, 32, 32,105,102, 32,105,115, 98, 97,115,105, 99, 40,115,101,108,102, 46,116,121,112,101, 41, 32, 61, 61, 32, 39,110,117,109, 98,101,114, 39, 32,116, 104,101,110, 10, 32, 32, 9,115,101,108,102, 46,114,101,116, 117,114,110, 95,117,115,101,114,100, 97,116, 97, 32, 61, 32, 116,114,117,101, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32, 116,104,101,114,101, 32,105,115, 32, 97,114,114, 97,121, 32, 116,111, 32, 98,101, 32,114,101,116,117,114,110,101,100, 10, 32,105,102, 32,115,101,108,102, 46,100,105,109,126, 61, 39, 39, 32, 97,110,100, 32,115,101,108,102, 46,114,101,116,126, 61, 39, 39, 32,116,104,101,110, 10, 32, 32, 32,101,114,114, 111,114, 40, 39, 35,105,110,118, 97,108,105,100, 32,112, 97, 114, 97,109,101,116,101,114, 58, 32, 99, 97,110,110,111,116, 32,114,101,116,117,114,110, 32, 97,110, 32, 97,114,114, 97, 121, 32,111,102, 32,118, 97,108,117,101,115, 39, 41, 10, 32, 101,110,100, 10, 32, 45, 45, 32,114,101,115,116,111,114,101, 32, 39,118,111,105,100, 42, 39, 32, 97,110,100, 32, 39,115, 116,114,105,110,103, 42, 39, 10, 32,105,102, 32,115,101,108, 102, 46,116,121,112,101, 32, 61, 61, 32, 39, 95,117,115,101, 114,100, 97,116, 97, 39, 32,116,104,101,110, 32,115,101,108, 102, 46,116,121,112,101, 32, 61, 32, 39,118,111,105,100, 42, 39, 10, 32,101,108,115,101,105,102, 32,115,101,108,102, 46, 116,121,112,101, 32, 61, 61, 32, 39, 95, 99,115,116,114,105, 110,103, 39, 32,116,104,101,110, 32,115,101,108,102, 46,116, 121,112,101, 32, 61, 32, 39, 99,104, 97,114, 42, 39, 10, 32, 101,108,115,101,105,102, 32,115,101,108,102, 46,116,121,112, 101, 32, 61, 61, 32, 39, 95,108,115,116, 97,116,101, 39, 32, 116,104,101,110, 32,115,101,108,102, 46,116,121,112,101, 32, 61, 32, 39,108,117, 97, 95, 83,116, 97,116,101, 42, 39, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,114,101,115,111,108, 118,101, 32,116,121,112,101,115, 32,105,110,115,105,100,101, 32,116,104,101, 32,116,101,109,112,108, 97,116,101,115, 10, 32,105,102, 32,115,101,108,102, 46,116,121,112,101, 32,116, 104,101,110, 10, 9, 32,115,101,108,102, 46,116,121,112,101, 32, 61, 32,114,101,115,111,108,118,101, 95,116,101,109,112, 108, 97,116,101, 95,116,121,112,101,115, 40,115,101,108,102, 46,116,121,112,101, 41, 10, 32,101,110,100, 10, 10, 45, 45, 10, 45, 45, 32, 45, 45, 32,105,102, 32,114,101,116,117,114, 110,105,110,103, 32,118, 97,108,117,101, 44, 32, 97,117,116, 111,109, 97,116,105, 99, 97,108,108,121, 32,115,101,116, 32, 100,101,102, 97,117,108,116, 32,118, 97,108,117,101, 10, 45, 45, 32,105,102, 32,115,101,108,102, 46,114,101,116, 32,126, 61, 32, 39, 39, 32, 97,110,100, 32,115,101,108,102, 46,100, 101,102, 32, 61, 61, 32, 39, 39, 32,116,104,101,110, 10, 45, 45, 32, 32,115,101,108,102, 46,100,101,102, 32, 61, 32, 39, 48, 39, 10, 45, 45, 32,101,110,100, 10, 45, 45, 10, 10,101, 110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,114,101, 115,111,108,118,101, 95,116,101,109,112,108, 97,116,101, 95, 116,121,112,101,115, 40,116,121,112,101, 41, 10, 10, 9,105, 102, 32,105,115, 98, 97,115,105, 99, 40,116,121,112,101, 41, 32,116,104,101,110, 10, 9, 9,114,101,116,117,114,110, 32, 116,121,112,101, 10, 9,101,110,100, 10, 9,108,111, 99, 97, 108, 32, 98, 44, 95, 44,109, 32, 61, 32,115,116,114,105,110, 103, 46,102,105,110,100, 40,116,121,112,101, 44, 32, 34, 40, 37, 98, 60, 62, 41, 34, 41, 10, 9,105,102, 32, 98, 32,116, 104,101,110, 10, 10, 9, 9,109, 32, 61, 32,115,112,108,105, 116, 95, 99, 95,116,111,107,101,110,115, 40,115,116,114,105, 110,103, 46,115,117, 98, 40,109, 44, 32, 50, 44, 32, 45, 50, 41, 44, 32, 34, 44, 34, 41, 10, 9, 9,102,111,114, 32,105, 61, 49, 44, 32,116, 97, 98,108,101, 46,103,101,116,110, 40, 109, 41, 32,100,111, 10, 9, 9, 9,109, 91,105, 93, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,109, 91, 105, 93, 44, 34, 37,115, 42, 40, 91, 37, 42, 38, 93, 41, 34, 44, 32, 34, 37, 49, 34, 41, 10, 9, 9, 9,105,102, 32,110, 111,116, 32,105,115, 98, 97,115,105, 99, 40,109, 91,105, 93, 41, 32,116,104,101,110, 10, 9, 9, 9, 9,105,102, 32,110, 111,116, 32,105,115,101,110,117,109, 40,109, 91,105, 93, 41, 32,116,104,101,110, 32, 95, 44, 32,109, 91,105, 93, 32, 61, 32, 97,112,112,108,121,116,121,112,101,100,101,102, 40, 34, 34, 44, 32,109, 91,105, 93, 41, 32,101,110,100, 10, 9, 9, 9, 9,109, 91,105, 93, 32, 61, 32,102,105,110,100,116,121, 112,101, 40,109, 91,105, 93, 41, 32,111,114, 32,109, 91,105, 93, 10, 9, 9, 9, 9,109, 91,105, 93, 32, 61, 32,114,101, 115,111,108,118,101, 95,116,101,109,112,108, 97,116,101, 95, 116,121,112,101,115, 40,109, 91,105, 93, 41, 10, 9, 9, 9, 101,110,100, 10, 9, 9,101,110,100, 10, 10, 9, 9,108,111, 99, 97,108, 32, 98, 44,105, 10, 9, 9,116,121,112,101, 44, 98, 44,105, 32, 61, 32, 98,114,101, 97,107, 95,116,101,109, 112,108, 97,116,101, 40,116,121,112,101, 41, 10, 45, 45,112, 114,105,110,116, 40, 34, 99,111,110, 99, 97,116, 32,105,115, 32, 34, 44, 99,111,110, 99, 97,116, 40,109, 44, 32, 49, 44, 32,109, 46,110, 41, 41, 10, 9, 9,108,111, 99, 97,108, 32, 116,101,109,112,108, 97,116,101, 95,112, 97,114,116, 32, 61, 32, 34, 60, 34, 46, 46, 99,111,110, 99, 97,116, 40,109, 44, 32, 49, 44, 32,109, 46,110, 44, 32, 34, 44, 34, 41, 46, 46, 34, 62, 34, 10, 9, 9,116,121,112,101, 32, 61, 32,114,101, 98,117,105,108,100, 95,116,101,109,112,108, 97,116,101, 40, 116,121,112,101, 44, 32, 98, 44, 32,116,101,109,112,108, 97, 116,101, 95,112, 97,114,116, 41, 10, 9, 9,116,121,112,101, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 116,121,112,101, 44, 32, 34, 62, 62, 34, 44, 32, 34, 62, 32, 62, 34, 41, 10, 9,101,110,100, 10, 9,114,101,116,117,114, 110, 32,116,121,112,101, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, 98,114,101, 97,107, 95,116,101,109, 112,108, 97,116,101, 40,115, 41, 10, 9,108,111, 99, 97,108, 32, 98, 44,101, 44,116,105,109,112,108, 32, 61, 32,115,116, 114,105,110,103, 46,102,105,110,100, 40,115, 44, 32, 34, 40, 37, 98, 60, 62, 41, 34, 41, 10, 9,105,102, 32,116,105,109, 112,108, 32,116,104,101,110, 10, 9, 9,115, 32, 61, 32,115, 116,114,105,110,103, 46,103,115,117, 98, 40,115, 44, 32, 34, 37, 98, 60, 62, 34, 44, 32, 34, 34, 41, 10, 9, 9,114,101, 116,117,114,110, 32,115, 44, 32, 98, 44, 32,116,105,109,112, 108, 10, 9,101,108,115,101, 10, 9, 9,114,101,116,117,114, 110, 32,115, 44, 32, 48, 44, 32,110,105,108, 10, 9,101,110, 100, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,114,101, 98,117,105,108,100, 95,116,101,109,112,108, 97, 116,101, 40,115, 44, 32, 98, 44, 32,116,105,109,112,108, 41, 10, 10, 9,105,102, 32, 98, 32, 61, 61, 32, 48, 32,116,104, 101,110, 10, 9, 9,114,101,116,117,114,110, 32,115, 10, 9, 101,110,100, 10, 10, 9,114,101,116,117,114,110, 32,115,116, 114,105,110,103, 46,115,117, 98, 40,115, 44, 32, 49, 44, 32, 98, 45, 49, 41, 46, 46,116,105,109,112,108, 46, 46,115,116, 114,105,110,103, 46,115,117, 98, 40,115, 44, 32, 98, 44, 32, 45, 49, 41, 10,101,110,100, 10, 10, 45, 45, 32, 80,114,105, 110,116, 32,109,101,116,104,111,100, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 58,112,114,105,110,116, 32, 40,105,100, 101,110,116, 44, 99,108,111,115,101, 41, 10, 32,112,114,105, 110,116, 40,105,100,101,110,116, 46, 46, 34, 68,101, 99,108, 97,114, 97,116,105,111,110,123, 34, 41, 10, 32,112,114,105, 110,116, 40,105,100,101,110,116, 46, 46, 34, 32,109,111,100, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,109,111, 100, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,116,121,112,101, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,116,121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40, 105,100,101,110,116, 46, 46, 34, 32,112,116,114, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,112,116,114, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100, 101,110,116, 46, 46, 34, 32,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101, 110,116, 46, 46, 34, 32,100,105,109, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,100,105,109, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,100,101,102, 32, 32, 61, 32, 39, 34, 46, 46, 115,101,108,102, 46,100,101,102, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,114,101,116, 32, 32, 61, 32, 39, 34, 46, 46,115,101, 108,102, 46,114,101,116, 46, 46, 34, 39, 44, 34, 41, 10, 32, 112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34,125, 34, 46, 46, 99,108,111,115,101, 41, 10,101,110,100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32, 97,114,114, 97,121, 32,111,102, 32,118, 97,108,117,101,115, 32, 97,114, 101, 32,114,101,116,117,114,110,101,100, 32,116,111, 32, 76, 117, 97, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97, 115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 58,114, 101,113,117,105,114,101, 99,111,108,108,101, 99,116,105,111, 110, 32, 40,116, 41, 10, 32,105,102, 32,115,101,108,102, 46, 109,111,100, 32,126, 61, 32, 39, 99,111,110,115,116, 39, 32, 97,110,100, 10, 9, 32, 32, 32, 32,115,101,108,102, 46,100, 105,109, 32, 97,110,100, 32,115,101,108,102, 46,100,105,109, 32,126, 61, 32, 39, 39, 32, 97,110,100, 10, 9, 9, 9, 9, 32,110,111,116, 32,105,115, 98, 97,115,105, 99, 40,115,101, 108,102, 46,116,121,112,101, 41, 32, 97,110,100, 10, 9, 9, 9, 9, 32,115,101,108,102, 46,112,116,114, 32, 61, 61, 32, 39, 39, 32, 97,110,100, 32,115,101,108,102, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115, 115, 40, 41, 32,116,104,101,110, 10, 9, 9,108,111, 99, 97, 108, 32,116,121,112,101, 32, 61, 32,103,115,117, 98, 40,115, 101,108,102, 46,116,121,112,101, 44, 34, 37,115, 42, 99,111, 110,115,116, 37,115, 43, 34, 44, 34, 34, 41, 10, 9, 9,116, 91,116,121,112,101, 93, 32, 61, 32, 34,116,111,108,117, 97, 95, 99,111,108,108,101, 99,116, 95, 34, 32, 46, 46, 32, 99, 108,101, 97,110, 95,116,101,109,112,108, 97,116,101, 40,116, 121,112,101, 41, 10, 9, 9,114,101,116,117,114,110, 32,116, 114,117,101, 10, 9,101,110,100, 10, 9,114,101,116,117,114, 110, 32,102, 97,108,115,101, 10,101,110,100, 10, 10, 45, 45, 32,100,101, 99,108, 97,114,101, 32,116, 97,103, 10,102,117, 110, 99,116,105,111,110, 32, 99,108, 97,115,115, 68,101, 99, 108, 97,114, 97,116,105,111,110, 58,100,101, 99,108,116,121, 112,101, 32, 40, 41, 10, 10, 9,115,101,108,102, 46,116,121, 112,101, 32, 61, 32,116,121,112,101,118, 97,114, 40,115,101, 108,102, 46,116,121,112,101, 41, 10, 9,105,102, 32,115,116, 114,102,105,110,100, 40,115,101,108,102, 46,109,111,100, 44, 39, 99,111,110,115,116, 39, 41, 32,116,104,101,110, 10, 9, 9,115,101,108,102, 46,116,121,112,101, 32, 61, 32, 39, 99, 111,110,115,116, 32, 39, 46, 46,115,101,108,102, 46,116,121, 112,101, 10, 9, 9,115,101,108,102, 46,109,111,100, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46,109,111,100, 44, 39, 99,111,110,115,116, 37,115, 42, 39, 44, 39, 39, 41, 10, 9,101,110,100, 10,101,110,100, 10, 10, 10, 45, 45, 32,111, 117,116,112,117,116, 32,116,121,112,101, 32, 99,104,101, 99, 107,105,110,103, 10,102,117,110, 99,116,105,111,110, 32, 99, 108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 58,111,117,116, 99,104,101, 99,107,116,121,112,101, 32, 40, 110, 97,114,103, 41, 10, 32,108,111, 99, 97,108, 32,100,101, 102, 10, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,105,115, 98, 97,115,105, 99, 40,115,101,108,102, 46,116,121,112,101, 41, 10, 32,105,102, 32,115,101,108,102, 46,100,101,102,126, 61, 39, 39, 32,116,104,101,110, 10, 32, 32,100,101,102, 32, 61, 32, 49, 10, 32,101,108,115,101, 10, 32, 32,100,101,102, 32, 61, 32, 48, 10, 32,101,110,100, 10, 32,105,102, 32,115, 101,108,102, 46,100,105,109, 32,126, 61, 32, 39, 39, 32,116, 104,101,110, 10, 9, 45, 45,105,102, 32,116, 61, 61, 39,115, 116,114,105,110,103, 39, 32,116,104,101,110, 10, 9, 45, 45, 9,114,101,116,117,114,110, 32, 39,116,111,108,117, 97, 95, 105,115,115,116,114,105,110,103, 97,114,114, 97,121, 40,116, 111,108,117, 97, 95, 83, 44, 39, 46, 46,110, 97,114,103, 46, 46, 39, 44, 39, 46, 46,100,101,102, 46, 46, 39, 44, 38,116, 111,108,117, 97, 95,101,114,114, 41, 39, 10, 9, 45, 45,101, 108,115,101, 10, 9,114,101,116,117,114,110, 32, 39, 33,116, 111,108,117, 97, 95,105,115,116, 97, 98,108,101, 40,116,111, 108,117, 97, 95, 83, 44, 39, 46, 46,110, 97,114,103, 46, 46, 39, 44, 48, 44, 38,116,111,108,117, 97, 95,101,114,114, 41, 39, 10, 32, 9, 45, 45,101,110,100, 10, 32,101,108,115,101, 105,102, 32,116, 32,116,104,101,110, 10, 9,114,101,116,117, 114,110, 32, 39, 33,116,111,108,117, 97, 95,105,115, 39, 46, 46,116, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 39, 46, 46,110, 97,114,103, 46, 46, 39, 44, 39, 46, 46,100,101, 102, 46, 46, 39, 44, 38,116,111,108,117, 97, 95,101,114,114, 41, 39, 10, 32,101,108,115,101, 10, 32, 32,108,111, 99, 97, 108, 32,105,115, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95,105,115, 95,102,117,110, 99,116,105,111,110, 40,115,101, 108,102, 46,116,121,112,101, 41, 10, 32, 32,105,102, 32,115, 101,108,102, 46,112,116,114, 32, 61, 61, 32, 39, 38, 39, 32, 111,114, 32,115,101,108,102, 46,112,116,114, 32, 61, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 32, 9,114,101,116,117, 114,110, 32, 39, 40,116,111,108,117, 97, 95,105,115,118, 97, 108,117,101,110,105,108, 40,116,111,108,117, 97, 95, 83, 44, 39, 46, 46,110, 97,114,103, 46, 46, 39, 44, 38,116,111,108, 117, 97, 95,101,114,114, 41, 32,124,124, 32, 33, 39, 46, 46, 105,115, 95,102,117,110, 99, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 39, 46, 46,110, 97,114,103, 46, 46, 39, 44, 34, 39, 46, 46,115,101,108,102, 46,116,121,112,101, 46, 46, 39, 34, 44, 39, 46, 46,100,101,102, 46, 46, 39, 44, 38,116, 111,108,117, 97, 95,101,114,114, 41, 41, 39, 10, 32, 32,101, 108,115,101, 10, 9,114,101,116,117,114,110, 32, 39, 33, 39, 46, 46,105,115, 95,102,117,110, 99, 46, 46, 39, 40,116,111, 108,117, 97, 95, 83, 44, 39, 46, 46,110, 97,114,103, 46, 46, 39, 44, 34, 39, 46, 46,115,101,108,102, 46,116,121,112,101, 46, 46, 39, 34, 44, 39, 46, 46,100,101,102, 46, 46, 39, 44, 38,116,111,108,117, 97, 95,101,114,114, 41, 39, 10, 32, 32, 101,110,100, 10, 32,101,110,100, 10,101,110,100, 10, 10,102, 117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 58, 98,117,105,108,100, 100,101, 99,108, 97,114, 97,116,105,111,110, 32, 40,110, 97, 114,103, 44, 32, 99,112,108,117,115,112,108,117,115, 41, 10, 32,108,111, 99, 97,108, 32, 97,114,114, 97,121, 32, 61, 32, 115,101,108,102, 46,100,105,109, 32,126, 61, 32, 39, 39, 32, 97,110,100, 32,116,111,110,117,109, 98,101,114, 40,115,101, 108,102, 46,100,105,109, 41, 61, 61,110,105,108, 10, 9,108, 111, 99, 97,108, 32,108,105,110,101, 32, 61, 32, 34, 34, 10, 32,108,111, 99, 97,108, 32,112,116,114, 32, 61, 32, 39, 39, 10, 32,108,111, 99, 97,108, 32,109,111,100, 10, 32,108,111, 99, 97,108, 32,116,121,112,101, 32, 61, 32,115,101,108,102, 46,116,121,112,101, 10, 32,108,111, 99, 97,108, 32,110, 99, 116,121,112,101, 32, 61, 32,103,115,117, 98, 40,115,101,108, 102, 46,116,121,112,101, 44, 39, 99,111,110,115,116, 37,115, 43, 39, 44, 39, 39, 41, 10, 32,105,102, 32,115,101,108,102, 46,100,105,109, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 9, 32,116,121,112,101, 32, 61, 32,103,115,117, 98, 40, 115,101,108,102, 46,116,121,112,101, 44, 39, 99,111,110,115, 116, 37,115, 43, 39, 44, 39, 39, 41, 32, 32, 45, 45, 32,101, 108,105,109,105,110, 97,116,101,115, 32, 99,111,110,115,116, 32,109,111,100,105,102,105,101,114, 32,102,111,114, 32, 97, 114,114, 97,121,115, 10, 32,101,110,100, 10, 32,105,102, 32, 115,101,108,102, 46,112,116,114,126, 61, 39, 39, 32, 97,110, 100, 32,110,111,116, 32,105,115, 98, 97,115,105, 99, 40,116, 121,112,101, 41, 32,116,104,101,110, 32,112,116,114, 32, 61, 32, 39, 42, 39, 32,101,110,100, 10, 32,108,105,110,101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97,114, 97,109, 40,108, 105,110,101, 44, 34, 32, 34, 44,115,101,108,102, 46,109,111, 100, 44,116,121,112,101, 44,112,116,114, 41, 10, 32,105,102, 32, 97,114,114, 97,121, 32,116,104,101,110, 10, 32, 32,108, 105,110,101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97,114, 97,109, 40,108,105,110,101, 44, 39, 42, 39, 41, 10, 32,101, 110,100, 10, 32,108,105,110,101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97,114, 97,109, 40,108,105,110,101, 44,115,101, 108,102, 46,110, 97,109,101, 41, 10, 32,105,102, 32,115,101, 108,102, 46,100,105,109, 32,126, 61, 32, 39, 39, 32,116,104, 101,110, 10, 32, 32,105,102, 32,116,111,110,117,109, 98,101, 114, 40,115,101,108,102, 46,100,105,109, 41,126, 61,110,105, 108, 32,116,104,101,110, 10, 32, 32, 32,108,105,110,101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97,114, 97,109, 40,108, 105,110,101, 44, 39, 91, 39, 44,115,101,108,102, 46,100,105, 109, 44, 39, 93, 59, 39, 41, 10, 32, 32,101,108,115,101, 10, 9,105,102, 32, 99,112,108,117,115,112,108,117,115, 32,116, 104,101,110, 10, 9, 9,108,105,110,101, 32, 61, 32, 99,111, 110, 99, 97,116,112, 97,114, 97,109, 40,108,105,110,101, 44, 39, 32, 61, 32, 77,116,111,108,117, 97, 95,110,101,119, 95, 100,105,109, 40, 39, 44,116,121,112,101, 44,112,116,114, 44, 39, 44, 32, 39, 46, 46,115,101,108,102, 46,100,105,109, 46, 46, 39, 41, 59, 39, 41, 10, 9,101,108,115,101, 10, 9, 9, 108,105,110,101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97, 114, 97,109, 40,108,105,110,101, 44, 39, 32, 61, 32, 40, 39, 44,116,121,112,101, 44,112,116,114, 44, 39, 42, 41, 39, 44, 10, 9, 9, 39,109, 97,108,108,111, 99, 40, 40, 39, 44,115, 101,108,102, 46,100,105,109, 44, 39, 41, 42,115,105,122,101, 111,102, 40, 39, 44,116,121,112,101, 44,112,116,114, 44, 39, 41, 41, 59, 39, 41, 10, 9,101,110,100, 10, 32, 32,101,110, 100, 10, 32,101,108,115,101, 10, 32, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,105,115, 98, 97,115,105, 99, 40,116,121, 112,101, 41, 10, 32, 32,108,105,110,101, 32, 61, 32, 99,111, 110, 99, 97,116,112, 97,114, 97,109, 40,108,105,110,101, 44, 39, 32, 61, 32, 39, 41, 10, 32, 32,105,102, 32,116, 32, 61, 61, 32, 39,115,116, 97,116,101, 39, 32,116,104,101,110, 10, 32, 32, 9,108,105,110,101, 32, 61, 32, 99,111,110, 99, 97, 116,112, 97,114, 97,109, 40,108,105,110,101, 44, 32, 39,116, 111,108,117, 97, 95, 83, 59, 39, 41, 10, 32, 32,101,108,115, 101, 10, 32, 32, 9, 45, 45,112,114,105,110,116, 40, 34,116, 32,105,115, 32, 34, 46, 46,116,111,115,116,114,105,110,103, 40,116, 41, 46, 46, 34, 44, 32,112,116,114, 32,105,115, 32, 34, 46, 46,116,111,115,116,114,105,110,103, 40,115,101,108, 102, 46,112,116,114, 41, 41, 10, 32, 32, 9,105,102, 32,116, 32, 61, 61, 32, 39,110,117,109, 98,101,114, 39, 32, 97,110, 100, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,115, 101,108,102, 46,112,116,114, 44, 32, 34, 37, 42, 34, 41, 32, 116,104,101,110, 10, 32, 32, 9, 9,116, 32, 61, 32, 39,117, 115,101,114,100, 97,116, 97, 39, 10, 32, 32, 9,101,110,100, 10, 9,105,102, 32,110,111,116, 32,116, 32, 97,110,100, 32, 112,116,114, 61, 61, 39, 39, 32,116,104,101,110, 32,108,105, 110,101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97,114, 97, 109, 40,108,105,110,101, 44, 39, 42, 39, 41, 32,101,110,100, 10, 9,108,105,110,101, 32, 61, 32, 99,111,110, 99, 97,116, 112, 97,114, 97,109, 40,108,105,110,101, 44, 39, 40, 40, 39, 44,115,101,108,102, 46,109,111,100, 44,116,121,112,101, 41, 10, 9,105,102, 32,110,111,116, 32,116, 32,116,104,101,110, 10, 9, 9,108,105,110,101, 32, 61, 32, 99,111,110, 99, 97, 116,112, 97,114, 97,109, 40,108,105,110,101, 44, 39, 42, 39, 41, 10, 9,101,110,100, 10, 9,108,105,110,101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97,114, 97,109, 40,108,105,110, 101, 44, 39, 41, 32, 39, 41, 10, 9,105,102, 32,105,115,101, 110,117,109, 40,110, 99,116,121,112,101, 41, 32,116,104,101, 110, 10, 9, 9,108,105,110,101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97,114, 97,109, 40,108,105,110,101, 44, 39, 40, 105,110,116, 41, 32, 39, 41, 10, 9,101,110,100, 10, 9,108, 111, 99, 97,108, 32,100,101,102, 32, 61, 32, 48, 10, 9,105, 102, 32,115,101,108,102, 46,100,101,102, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 9, 9,100,101,102, 32, 61, 32, 115,101,108,102, 46,100,101,102, 10, 9, 9,105,102, 32, 40, 112,116,114, 32, 61, 61, 32, 39, 39, 32,111,114, 32,115,101, 108,102, 46,112,116,114, 32, 61, 61, 32, 39, 38, 39, 41, 32, 97,110,100, 32,110,111,116, 32,116, 32,116,104,101,110, 10, 9, 9, 9,100,101,102, 32, 61, 32, 34, 40,118,111,105,100, 42, 41, 38, 40, 99,111,110,115,116, 32, 34, 46, 46,116,121, 112,101, 46, 46, 34, 41, 34, 46, 46,100,101,102, 10, 9, 9, 101,110,100, 10, 9,101,110,100, 10, 9,105,102, 32,116, 32, 116,104,101,110, 10, 9, 9,108,105,110,101, 32, 61, 32, 99, 111,110, 99, 97,116,112, 97,114, 97,109, 40,108,105,110,101, 44, 39,116,111,108,117, 97, 95,116,111, 39, 46, 46,116, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 39, 44,110, 97,114, 103, 44, 39, 44, 39, 44,100,101,102, 44, 39, 41, 41, 59, 39, 41, 10, 9,101,108,115,101, 10, 9, 9,108,111, 99, 97,108, 32,116,111, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95, 116,111, 95,102,117,110, 99,116,105,111,110, 40,116,121,112, 101, 41, 10, 9, 9,108,105,110,101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97,114, 97,109, 40,108,105,110,101, 44,116, 111, 95,102,117,110, 99, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 39, 44,110, 97,114,103, 44, 39, 44, 39, 44,100, 101,102, 44, 39, 41, 41, 59, 39, 41, 10, 9,101,110,100, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 9,114,101,116, 117,114,110, 32,108,105,110,101, 10,101,110,100, 10, 10, 45, 45, 32, 68,101, 99,108, 97,114,101, 32,118, 97,114,105, 97, 98,108,101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 58, 100,101, 99,108, 97,114,101, 32, 40,110, 97,114,103, 41, 10, 32,105,102, 32,115,101,108,102, 46,100,105,109, 32,126, 61, 32, 39, 39, 32, 97,110,100, 32,116,111,110,117,109, 98,101, 114, 40,115,101,108,102, 46,100,105,109, 41, 61, 61,110,105, 108, 32,116,104,101,110, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35,105,102,100,101,102, 32, 95, 95, 99,112,108,117, 115,112,108,117,115, 92,110, 39, 41, 10, 9, 9,111,117,116, 112,117,116, 40,115,101,108,102, 58, 98,117,105,108,100,100, 101, 99,108, 97,114, 97,116,105,111,110, 40,110, 97,114,103, 44,116,114,117,101, 41, 41, 10, 9, 9,111,117,116,112,117, 116, 40, 39, 35,101,108,115,101, 92,110, 39, 41, 10, 9, 9, 111,117,116,112,117,116, 40,115,101,108,102, 58, 98,117,105, 108,100,100,101, 99,108, 97,114, 97,116,105,111,110, 40,110, 97,114,103, 44,102, 97,108,115,101, 41, 41, 10, 9, 32,111, 117,116,112,117,116, 40, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,112, 117,116, 40,115,101,108,102, 58, 98,117,105,108,100,100,101, 99,108, 97,114, 97,116,105,111,110, 40,110, 97,114,103, 44, 102, 97,108,115,101, 41, 41, 10, 9,101,110,100, 10,101,110, 100, 10, 10, 45, 45, 32, 71,101,116, 32,112, 97,114, 97,109, 101,116,101,114, 32,118, 97,108,117,101, 10,102,117,110, 99, 116,105,111,110, 32, 99,108, 97,115,115, 68,101, 99,108, 97, 114, 97,116,105,111,110, 58,103,101,116, 97,114,114, 97,121, 32, 40,110, 97,114,103, 41, 10, 32,105,102, 32,115,101,108, 102, 46,100,105,109, 32,126, 61, 32, 39, 39, 32,116,104,101, 110, 10, 9, 32,108,111, 99, 97,108, 32,116,121,112,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46,116,121,112, 101, 44, 39, 99,111,110,115,116, 32, 39, 44, 39, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32,123, 39, 41, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35,105,102,110, 100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32, 100,101,102, 59, 32,105,102, 32,115,101,108,102, 46,100,101, 102,126, 61, 39, 39, 32,116,104,101,110, 32,100,101,102, 61, 49, 32,101,108,115,101, 32,100,101,102, 61, 48, 32,101,110, 100, 10, 9, 9,108,111, 99, 97,108, 32,116, 32, 61, 32,105, 115, 98, 97,115,105, 99, 40,116,121,112,101, 41, 10, 9, 9, 105,102, 32, 40,116, 41, 32,116,104,101,110, 10, 9, 9, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,105,102, 32, 40, 33,116,111,108,117, 97, 95,105,115, 39, 46, 46,116, 46, 46, 39, 97,114,114, 97,121, 40,116,111,108,117, 97, 95, 83, 44, 39, 44,110, 97,114,103, 44, 39, 44, 39, 44,115,101, 108,102, 46,100,105,109, 44, 39, 44, 39, 44,100,101,102, 44, 39, 44, 38,116,111,108,117, 97, 95,101,114,114, 41, 41, 39, 41, 10, 9, 9,101,108,115,101, 10, 9, 9, 32, 32, 32,111, 117,116,112,117,116, 40, 39, 32, 32, 32,105,102, 32, 40, 33, 116,111,108,117, 97, 95,105,115,117,115,101,114,116,121,112, 101, 97,114,114, 97,121, 40,116,111,108,117, 97, 95, 83, 44, 39, 44,110, 97,114,103, 44, 39, 44, 34, 39, 44,116,121,112, 101, 44, 39, 34, 44, 39, 44,115,101,108,102, 46,100,105,109, 44, 39, 44, 39, 44,100,101,102, 44, 39, 44, 38,116,111,108, 117, 97, 95,101,114,114, 41, 41, 39, 41, 10, 9, 9,101,110, 100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,103,111,116,111, 32,116,111,108,117, 97, 95,108,101,114, 114,111,114, 59, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,101,108,115,101, 92,110, 39, 41, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,123, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,105,110,116, 32,105, 59, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,102, 111,114, 40,105, 61, 48, 59, 32,105, 60, 39, 46, 46,115,101, 108,102, 46,100,105,109, 46, 46, 39, 59,105, 43, 43, 41, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,105, 115, 98, 97,115,105, 99, 40,116,121,112,101, 41, 10, 32, 32, 108,111, 99, 97,108, 32,112,116,114, 32, 61, 32, 39, 39, 10, 32, 32,105,102, 32,115,101,108,102, 46,112,116,114,126, 61, 39, 39, 32,116,104,101,110, 32,112,116,114, 32, 61, 32, 39, 42, 39, 32,101,110,100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 39, 44,115,101,108,102, 46,110, 97,109, 101, 46, 46, 39, 91,105, 93, 32, 61, 32, 39, 41, 10, 32, 32, 105,102, 32,110,111,116, 32,116, 32, 97,110,100, 32,112,116, 114, 61, 61, 39, 39, 32,116,104,101,110, 32,111,117,116,112, 117,116, 40, 39, 42, 39, 41, 32,101,110,100, 10, 32, 32,111, 117,116,112,117,116, 40, 39, 40, 40, 39, 44,116,121,112,101, 41, 10, 32, 32,105,102, 32,110,111,116, 32,116, 32,116,104, 101,110, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 42, 39, 41, 10, 32, 32,101,110,100, 10, 32, 32,111,117,116,112, 117,116, 40, 39, 41, 32, 39, 41, 10, 32, 32,108,111, 99, 97, 108, 32,100,101,102, 32, 61, 32, 48, 10, 32, 32,105,102, 32, 115,101,108,102, 46,100,101,102, 32,126, 61, 32, 39, 39, 32, 116,104,101,110, 32,100,101,102, 32, 61, 32,115,101,108,102, 46,100,101,102, 32,101,110,100, 10, 32, 32,105,102, 32,116, 32,116,104,101,110, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39,116,111,108,117, 97, 95,116,111,102,105,101,108,100, 39, 46, 46,116, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 39, 44,110, 97,114,103, 44, 39, 44,105, 43, 49, 44, 39, 44,100,101,102, 44, 39, 41, 41, 59, 39, 41, 10, 32, 32,101, 108,115,101, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 116,111,108,117, 97, 95,116,111,102,105,101,108,100,117,115, 101,114,116,121,112,101, 40,116,111,108,117, 97, 95, 83, 44, 39, 44,110, 97,114,103, 44, 39, 44,105, 43, 49, 44, 39, 44, 100,101,102, 44, 39, 41, 41, 59, 39, 41, 10, 32, 32,101,110, 100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 125, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32,125, 39, 41, 10, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 71,101,116, 32,112, 97,114, 97,109,101,116,101, 114, 32,118, 97,108,117,101, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116, 105,111,110, 58,115,101,116, 97,114,114, 97,121, 32, 40,110, 97,114,103, 41, 10, 32,105,102, 32,110,111,116, 32,115,116, 114,102,105,110,100, 40,115,101,108,102, 46,116,121,112,101, 44, 39, 99,111,110,115,116, 37,115, 43, 39, 41, 32, 97,110, 100, 32,115,101,108,102, 46,100,105,109, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 9, 32,108,111, 99, 97,108, 32, 116,121,112,101, 32, 61, 32,103,115,117, 98, 40,115,101,108, 102, 46,116,121,112,101, 44, 39, 99,111,110,115,116, 32, 39, 44, 39, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32,123, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,105,110,116, 32,105, 59, 39, 41, 10, 32, 32, 111,117,116,112,117,116, 40, 39, 32, 32, 32,102,111,114, 40, 105, 61, 48, 59, 32,105, 60, 39, 46, 46,115,101,108,102, 46, 100,105,109, 46, 46, 39, 59,105, 43, 43, 41, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,116, 44, 99,116, 32, 61, 32,105, 115, 98, 97,115,105, 99, 40,116,121,112,101, 41, 10, 32, 32, 105,102, 32,116, 32,116,104,101,110, 10, 32, 32, 32,111,117, 116,112,117,116, 40, 39, 32, 32, 32, 32,116,111,108,117, 97, 95,112,117,115,104,102,105,101,108,100, 39, 46, 46,116, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 39, 44,110, 97, 114,103, 44, 39, 44,105, 43, 49, 44, 40, 39, 44, 99,116, 44, 39, 41, 39, 44,115,101,108,102, 46,110, 97,109,101, 44, 39, 91,105, 93, 41, 59, 39, 41, 10, 32, 32,101,108,115,101, 10, 32, 32, 32,105,102, 32,115,101,108,102, 46,112,116,114, 32, 61, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,123, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 35, 105,102,100,101,102, 32, 95, 95, 99,112,108,117,115,112,108, 117,115, 92,110, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116, 112,117,116, 40, 39, 32, 32, 32, 32,118,111,105,100, 42, 32, 116,111,108,117, 97, 95,111, 98,106, 32, 61, 32, 77,116,111, 108,117, 97, 95,110,101,119, 40, 40, 39, 44,116,121,112,101, 44, 39, 41, 40, 39, 44,115,101,108,102, 46,110, 97,109,101, 44, 39, 91,105, 93, 41, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,116,111, 108,117, 97, 95,112,117,115,104,102,105,101,108,100,117,115, 101,114,116,121,112,101, 95, 97,110,100, 95,116, 97,107,101, 111,119,110,101,114,115,104,105,112, 40,116,111,108,117, 97, 95, 83, 44, 39, 44,110, 97,114,103, 44, 39, 44,105, 43, 49, 44,116,111,108,117, 97, 95,111, 98,106, 44, 34, 39, 44,116, 121,112,101, 44, 39, 34, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 35,101,108,115,101, 92, 110, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,118,111,105,100, 42, 32,116,111,108, 117, 97, 95,111, 98,106, 32, 61, 32,116,111,108,117, 97, 95, 99,111,112,121, 40,116,111,108,117, 97, 95, 83, 44, 40,118, 111,105,100, 42, 41, 38, 39, 44,115,101,108,102, 46,110, 97, 109,101, 44, 39, 91,105, 93, 44,115,105,122,101,111,102, 40, 39, 44,116,121,112,101, 44, 39, 41, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,116,111,108,117, 97, 95,112,117,115,104,102,105,101,108, 100,117,115,101,114,116,121,112,101, 40,116,111,108,117, 97, 95, 83, 44, 39, 44,110, 97,114,103, 44, 39, 44,105, 43, 49, 44,116,111,108,117, 97, 95,111, 98,106, 44, 34, 39, 44,116, 121,112,101, 44, 39, 34, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117, 116, 40, 39, 32, 32, 32,125, 39, 41, 10, 32, 32, 32,101,108, 115,101, 10, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,116,111,108,117, 97, 95,112,117,115,104,102,105, 101,108,100,117,115,101,114,116,121,112,101, 40,116,111,108, 117, 97, 95, 83, 44, 39, 44,110, 97,114,103, 44, 39, 44,105, 43, 49, 44, 40,118,111,105,100, 42, 41, 39, 44,115,101,108, 102, 46,110, 97,109,101, 44, 39, 91,105, 93, 44, 34, 39, 44, 116,121,112,101, 44, 39, 34, 41, 59, 39, 41, 10, 32, 32, 32, 101,110,100, 10, 32, 32,101,110,100, 10, 32, 32,111,117,116, 112,117,116, 40, 39, 32, 32,125, 39, 41, 10, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 70,114,101,101, 32,100, 121,110, 97,109,105, 99, 97,108,108,121, 32, 97,108,108,111, 99, 97,116,101,100, 32, 97,114,114, 97,121, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 58,102,114,101,101, 97,114,114, 97,121, 32, 40, 41, 10, 32,105,102, 32,115,101,108,102, 46, 100,105,109, 32,126, 61, 32, 39, 39, 32, 97,110,100, 32,116, 111,110,117,109, 98,101,114, 40,115,101,108,102, 46,100,105, 109, 41, 61, 61,110,105,108, 32,116,104,101,110, 10, 9, 32, 111,117,116,112,117,116, 40, 39, 35,105,102,100,101,102, 32, 95, 95, 99,112,108,117,115,112,108,117,115, 92,110, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 77,116, 111,108,117, 97, 95,100,101,108,101,116,101, 95,100,105,109, 40, 39, 44,115,101,108,102, 46,110, 97,109,101, 44, 39, 41, 59, 39, 41, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35, 101,108,115,101, 92,110, 39, 41, 10, 32, 32,111,117,116,112, 117,116, 40, 39, 32, 32,102,114,101,101, 40, 39, 44,115,101, 108,102, 46,110, 97,109,101, 44, 39, 41, 59, 39, 41, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 80, 97,115,115, 32,112, 97,114, 97,109,101,116, 101,114, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97, 115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 58,112, 97,115,115,112, 97,114, 32, 40, 41, 10, 32,105,102, 32,115, 101,108,102, 46,112,116,114, 61, 61, 39, 38, 39, 32, 97,110, 100, 32,110,111,116, 32,105,115, 98, 97,115,105, 99, 40,115, 101,108,102, 46,116,121,112,101, 41, 32,116,104,101,110, 10, 32, 32,111,117,116,112,117,116, 40, 39, 42, 39, 46, 46,115, 101,108,102, 46,110, 97,109,101, 41, 10, 32,101,108,115,101, 105,102, 32,115,101,108,102, 46,114,101,116, 61, 61, 39, 42, 39, 32,116,104,101,110, 10, 32, 32,111,117,116,112,117,116, 40, 39, 38, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 41, 10, 32,101,108,115,101, 10, 32, 32,111,117,116,112,117, 116, 40,115,101,108,102, 46,110, 97,109,101, 41, 10, 32,101, 110,100, 10,101,110,100, 10, 10, 45, 45, 32, 82,101,116,117, 114,110, 32,112, 97,114, 97,109,101,116,101,114, 32,118, 97, 108,117,101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 58, 114,101,116,118, 97,108,117,101, 32, 40, 41, 10, 32,105,102, 32,115,101,108,102, 46,114,101,116, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 32,108,111, 99, 97,108, 32,116, 44, 99,116, 32, 61, 32,105,115, 98, 97,115,105, 99, 40,115, 101,108,102, 46,116,121,112,101, 41, 10, 32, 32,105,102, 32, 116, 32, 97,110,100, 32,116,126, 61, 39, 39, 32,116,104,101, 110, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,116,111,108,117, 97, 95,112,117,115,104, 39, 46, 46,116, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 40, 39, 44, 99,116, 44, 39, 41, 39, 46, 46,115,101,108,102, 46,110, 97, 109,101, 46, 46, 39, 41, 59, 39, 41, 10, 32, 32,101,108,115, 101, 10, 32, 32, 32,108,111, 99, 97,108, 32,112,117,115,104, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95,112,117,115, 104, 95,102,117,110, 99,116,105,111,110, 40,115,101,108,102, 46,116,121,112,101, 41, 10, 32, 32, 32,111,117,116,112,117, 116, 40, 39, 32, 32, 32, 39, 44,112,117,115,104, 95,102,117, 110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40,118, 111,105,100, 42, 41, 39, 46, 46,115,101,108,102, 46,110, 97, 109,101, 46, 46, 39, 44, 34, 39, 44,115,101,108,102, 46,116, 121,112,101, 44, 39, 34, 41, 59, 39, 41, 10, 32, 32,101,110, 100, 10, 32, 32,114,101,116,117,114,110, 32, 49, 10, 32,101, 110,100, 10, 32,114,101,116,117,114,110, 32, 48, 10,101,110, 100, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99,111,110,115,116,114,117, 99,116,111,114, 10,102,117,110, 99,116,105,111,110, 32, 95, 68,101, 99,108, 97,114, 97,116, 105,111,110, 32, 40,116, 41, 10, 10, 32,115,101,116,109,101, 116, 97,116, 97, 98,108,101, 40,116, 44, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 41, 10, 32,116, 58, 98,117,105,108,100,110, 97,109,101,115, 40, 41, 10, 32, 116, 58, 99,104,101, 99,107,110, 97,109,101, 40, 41, 10, 32, 116, 58, 99,104,101, 99,107,116,121,112,101, 40, 41, 10, 32, 108,111, 99, 97,108, 32,102,116, 32, 61, 32,102,105,110,100, 116,121,112,101, 40,116, 46,116,121,112,101, 41, 32,111,114, 32,116, 46,116,121,112,101, 10, 32,105,102, 32,110,111,116, 32,105,115,101,110,117,109, 40,102,116, 41, 32,116,104,101, 110, 10, 9,116, 46,109,111,100, 44, 32,116, 46,116,121,112, 101, 32, 61, 32, 97,112,112,108,121,116,121,112,101,100,101, 102, 40,116, 46,109,111,100, 44, 32,102,116, 41, 10, 32,101, 110,100, 10, 10, 32,105,102, 32,116, 46,107,105,110,100, 61, 61, 34,118, 97,114, 34, 32, 97,110,100, 32, 40,115,116,114, 105,110,103, 46,102,105,110,100, 40,116, 46,109,111,100, 44, 32, 34,116,111,108,117, 97, 95,112,114,111,112,101,114,116, 121, 37,115, 34, 41, 32,111,114, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,116, 46,109,111,100, 44, 32, 34,116, 111,108,117, 97, 95,112,114,111,112,101,114,116,121, 36, 34, 41, 41, 32,116,104,101,110, 10, 32, 9,116, 46,109,111,100, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 116, 46,109,111,100, 44, 32, 34,116,111,108,117, 97, 95,112, 114,111,112,101,114,116,121, 34, 44, 32, 34,116,111,108,117, 97, 95,112,114,111,112,101,114,116,121, 95, 95, 34, 46, 46, 103,101,116, 95,112,114,111,112,101,114,116,121, 95,116,121, 112,101, 40, 41, 41, 10, 32,101,110,100, 10, 10, 32,114,101, 116,117,114,110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110,115,116,114,117, 99,116,111,114, 10, 45, 45, 32, 69,120,112,101, 99,116,115, 32,116,104,101, 32,115,116,114, 105,110,103, 32,100,101, 99,108, 97,114, 97,116,105,111,110, 46, 10, 45, 45, 32, 84,104,101, 32,107,105,110,100, 32,111, 102, 32,100,101, 99,108, 97,114, 97,116,105,111,110, 32, 99, 97,110, 32, 98,101, 32, 34,118, 97,114, 34, 32,111,114, 32, 34,102,117,110, 99, 34, 46, 10,102,117,110, 99,116,105,111, 110, 32, 68,101, 99,108, 97,114, 97,116,105,111,110, 32, 40, 115, 44,107,105,110,100, 44,105,115, 95,112, 97,114, 97,109, 101,116,101,114, 41, 10, 10, 32, 45, 45, 32,101,108,105,109, 105,110, 97,116,101, 32,115,112, 97, 99,101,115, 32,105,102, 32,100,101,102, 97,117,108,116, 32,118, 97,108,117,101, 32, 105,115, 32,112,114,111,118,105,100,101,100, 10, 32,115, 32, 61, 32,103,115,117, 98, 40,115, 44, 34, 37,115, 42, 61, 37, 115, 42, 34, 44, 34, 61, 34, 41, 10, 32,115, 32, 61, 32,103, 115,117, 98, 40,115, 44, 32, 34, 37,115, 42, 60, 34, 44, 32, 34, 60, 34, 41, 10, 10, 32,108,111, 99, 97,108, 32,100,101, 102, 98, 44,116,109,112,100,101,102, 10, 32,100,101,102, 98, 44, 95, 44,116,109,112,100,101,102, 32, 61, 32,115,116,114, 105,110,103, 46,102,105,110,100, 40,115, 44, 32, 34, 40, 61, 46, 42, 41, 36, 34, 41, 10, 32,105,102, 32,100,101,102, 98, 32,116,104,101,110, 10, 32, 9,115, 32, 61, 32,115,116,114, 105,110,103, 46,103,115,117, 98, 40,115, 44, 32, 34, 61, 46, 42, 36, 34, 44, 32, 34, 34, 41, 10, 32,101,108,115,101, 10, 32, 9,116,109,112,100,101,102, 32, 61, 32, 39, 39, 10, 32, 101,110,100, 10, 32,105,102, 32,107,105,110,100, 32, 61, 61, 32, 34,118, 97,114, 34, 32,116,104,101,110, 10, 32, 32, 45, 45, 32, 99,104,101, 99,107, 32,116,104,101, 32,102,111,114, 109, 58, 32,118,111,105,100, 10, 32, 32,105,102, 32,115, 32, 61, 61, 32, 39, 39, 32,111,114, 32,115, 32, 61, 61, 32, 39, 118,111,105,100, 39, 32,116,104,101,110, 10, 32, 32, 32,114, 101,116,117,114,110, 32, 95, 68,101, 99,108, 97,114, 97,116, 105,111,110,123,116,121,112,101, 32, 61, 32, 39,118,111,105, 100, 39, 44, 32,107,105,110,100, 32, 61, 32,107,105,110,100, 44, 32,105,115, 95,112, 97,114, 97,109,101,116,101,114, 32, 61, 32,105,115, 95,112, 97,114, 97,109,101,116,101,114,125, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,116,104,101, 32,102,111,114, 109, 58, 32,109,111,100, 32,116,121,112,101, 42, 38, 32,110, 97,109,101, 10, 32,108,111, 99, 97,108, 32,116, 32, 61, 32, 115,112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40, 115, 44, 39, 37, 42, 37,115, 42, 38, 39, 41, 10, 32,105,102, 32,116, 46,110, 32, 61, 61, 32, 50, 32,116,104,101,110, 10, 32, 32,105,102, 32,107,105,110,100, 32, 61, 61, 32, 39,102, 117,110, 99, 39, 32,116,104,101,110, 10, 32, 32, 32,101,114, 114,111,114, 40, 34, 35,105,110,118, 97,108,105,100, 32,102, 117,110, 99,116,105,111,110, 32,114,101,116,117,114,110, 32, 116,121,112,101, 58, 32, 34, 46, 46,115, 41, 10, 32, 32,101, 110,100, 10, 32, 32, 45, 45,108,111, 99, 97,108, 32,109, 32, 61, 32,115,112,108,105,116, 40,116, 91, 49, 93, 44, 39, 37, 115, 37,115, 42, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32, 109, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116,111,107, 101,110,115, 40,116, 91, 49, 93, 44, 39, 37,115, 43, 39, 41, 10, 32, 32,114,101,116,117,114,110, 32, 95, 68,101, 99,108, 97,114, 97,116,105,111,110,123, 10, 32, 32, 32,110, 97,109, 101, 32, 61, 32,116, 91, 50, 93, 46, 46,116,109,112,100,101, 102, 44, 10, 32, 32, 32,112,116,114, 32, 61, 32, 39, 42, 39, 44, 10, 32, 32, 32,114,101,116, 32, 61, 32, 39, 38, 39, 44, 10, 32, 32, 32, 45, 45,116,121,112,101, 32, 61, 32,114,101, 98,117,105,108,100, 95,116,101,109,112,108, 97,116,101, 40, 109, 91,109, 46,110, 93, 44, 32,116, 98, 44, 32,116,105,109, 112,108, 41, 44, 10, 32, 32, 32,116,121,112,101, 32, 61, 32, 109, 91,109, 46,110, 93, 44, 10, 32, 32, 32,109,111,100, 32, 61, 32, 99,111,110, 99, 97,116, 40,109, 44, 49, 44,109, 46, 110, 45, 49, 41, 44, 10, 32, 32, 32,105,115, 95,112, 97,114, 97,109,101,116,101,114, 32, 61, 32,105,115, 95,112, 97,114, 97,109,101,116,101,114, 44, 10, 32, 32, 32,107,105,110,100, 32, 61, 32,107,105,110,100, 10, 32, 32,125, 10, 32,101,110, 100, 10, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,116,104, 101, 32,102,111,114,109, 58, 32,109,111,100, 32,116,121,112, 101, 42, 42, 32,110, 97,109,101, 10, 32,116, 32, 61, 32,115, 112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40,115, 44, 39, 37, 42, 37,115, 42, 37, 42, 39, 41, 10, 32,105,102, 32,116, 46,110, 32, 61, 61, 32, 50, 32,116,104,101,110, 10, 32, 32,105,102, 32,107,105,110,100, 32, 61, 61, 32, 39,102, 117,110, 99, 39, 32,116,104,101,110, 10, 32, 32, 32,101,114, 114,111,114, 40, 34, 35,105,110,118, 97,108,105,100, 32,102, 117,110, 99,116,105,111,110, 32,114,101,116,117,114,110, 32, 116,121,112,101, 58, 32, 34, 46, 46,115, 41, 10, 32, 32,101, 110,100, 10, 32, 32, 45, 45,108,111, 99, 97,108, 32,109, 32, 61, 32,115,112,108,105,116, 40,116, 91, 49, 93, 44, 39, 37, 115, 37,115, 42, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32, 109, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116,111,107, 101,110,115, 40,116, 91, 49, 93, 44, 39, 37,115, 43, 39, 41, 10, 32, 32,114,101,116,117,114,110, 32, 95, 68,101, 99,108, 97,114, 97,116,105,111,110,123, 10, 32, 32, 32,110, 97,109, 101, 32, 61, 32,116, 91, 50, 93, 46, 46,116,109,112,100,101, 102, 44, 10, 32, 32, 32,112,116,114, 32, 61, 32, 39, 42, 39, 44, 10, 32, 32, 32,114,101,116, 32, 61, 32, 39, 42, 39, 44, 10, 32, 32, 32, 45, 45,116,121,112,101, 32, 61, 32,114,101, 98,117,105,108,100, 95,116,101,109,112,108, 97,116,101, 40, 109, 91,109, 46,110, 93, 44, 32,116, 98, 44, 32,116,105,109, 112,108, 41, 44, 10, 32, 32, 32,116,121,112,101, 32, 61, 32, 109, 91,109, 46,110, 93, 44, 10, 32, 32, 32,109,111,100, 32, 61, 32, 99,111,110, 99, 97,116, 40,109, 44, 49, 44,109, 46, 110, 45, 49, 41, 44, 10, 32, 32, 32,105,115, 95,112, 97,114, 97,109,101,116,101,114, 32, 61, 32,105,115, 95,112, 97,114, 97,109,101,116,101,114, 44, 10, 32, 32, 32,107,105,110,100, 32, 61, 32,107,105,110,100, 10, 32, 32,125, 10, 32,101,110, 100, 10, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,116,104, 101, 32,102,111,114,109, 58, 32,109,111,100, 32,116,121,112, 101, 38, 32,110, 97,109,101, 10, 32,116, 32, 61, 32,115,112, 108,105,116, 95, 99, 95,116,111,107,101,110,115, 40,115, 44, 39, 38, 39, 41, 10, 32,105,102, 32,116, 46,110, 32, 61, 61, 32, 50, 32,116,104,101,110, 10, 32, 32, 45, 45,108,111, 99, 97,108, 32,109, 32, 61, 32,115,112,108,105,116, 40,116, 91, 49, 93, 44, 39, 37,115, 37,115, 42, 39, 41, 10, 32, 32,108, 111, 99, 97,108, 32,109, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40,116, 91, 49, 93, 44, 39, 37,115, 43, 39, 41, 10, 32, 32,114,101,116,117,114,110, 32, 95, 68,101, 99,108, 97,114, 97,116,105,111,110,123, 10, 32, 32, 32,110, 97,109,101, 32, 61, 32,116, 91, 50, 93, 46, 46, 116,109,112,100,101,102, 44, 10, 32, 32, 32,112,116,114, 32, 61, 32, 39, 38, 39, 44, 10, 32, 32, 32, 45, 45,116,121,112, 101, 32, 61, 32,114,101, 98,117,105,108,100, 95,116,101,109, 112,108, 97,116,101, 40,109, 91,109, 46,110, 93, 44, 32,116, 98, 44, 32,116,105,109,112,108, 41, 44, 10, 32, 32, 32,116, 121,112,101, 32, 61, 32,109, 91,109, 46,110, 93, 44, 10, 32, 32, 32,109,111,100, 32, 61, 32, 99,111,110, 99, 97,116, 40, 109, 44, 49, 44,109, 46,110, 45, 49, 41, 44, 10, 32, 32, 32, 105,115, 95,112, 97,114, 97,109,101,116,101,114, 32, 61, 32, 105,115, 95,112, 97,114, 97,109,101,116,101,114, 44, 10, 32, 32, 32,107,105,110,100, 32, 61, 32,107,105,110,100, 10, 32, 32,125, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 99,104, 101, 99,107, 32,116,104,101, 32,102,111,114,109, 58, 32,109, 111,100, 32,116,121,112,101, 42, 32,110, 97,109,101, 10, 32, 108,111, 99, 97,108, 32,115, 49, 32, 61, 32,103,115,117, 98, 40,115, 44, 34, 40, 37, 98, 92, 91, 92, 93, 41, 34, 44,102, 117,110, 99,116,105,111,110, 32, 40,110, 41, 32,114,101,116, 117,114,110, 32,103,115,117, 98, 40,110, 44, 39, 37, 42, 39, 44, 39, 92, 49, 39, 41, 32,101,110,100, 41, 10, 32,116, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116,111,107,101,110, 115, 40,115, 49, 44, 39, 37, 42, 39, 41, 10, 32,105,102, 32, 116, 46,110, 32, 61, 61, 32, 50, 32,116,104,101,110, 10, 32, 32,116, 91, 50, 93, 32, 61, 32,103,115,117, 98, 40,116, 91, 50, 93, 44, 39, 92, 49, 39, 44, 39, 37, 42, 39, 41, 32, 45, 45, 32,114,101,115,116,111,114,101, 32, 42, 32,105,110, 32, 100,105,109,101,110,115,105,111,110, 32,101,120,112,114,101, 115,115,105,111,110, 10, 32, 32, 45, 45,108,111, 99, 97,108, 32,109, 32, 61, 32,115,112,108,105,116, 40,116, 91, 49, 93, 44, 39, 37,115, 37,115, 42, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,109, 32, 61, 32,115,112,108,105,116, 95, 99, 95, 116,111,107,101,110,115, 40,116, 91, 49, 93, 44, 39, 37,115, 43, 39, 41, 10, 32, 32,114,101,116,117,114,110, 32, 95, 68, 101, 99,108, 97,114, 97,116,105,111,110,123, 10, 32, 32, 32, 110, 97,109,101, 32, 61, 32,116, 91, 50, 93, 46, 46,116,109, 112,100,101,102, 44, 10, 32, 32, 32,112,116,114, 32, 61, 32, 39, 42, 39, 44, 10, 32, 32, 32,116,121,112,101, 32, 61, 32, 109, 91,109, 46,110, 93, 44, 10, 32, 32, 32, 45, 45,116,121, 112,101, 32, 61, 32,114,101, 98,117,105,108,100, 95,116,101, 109,112,108, 97,116,101, 40,109, 91,109, 46,110, 93, 44, 32, 116, 98, 44, 32,116,105,109,112,108, 41, 44, 10, 32, 32, 32, 109,111,100, 32, 61, 32, 99,111,110, 99, 97,116, 40,109, 44, 49, 44,109, 46,110, 45, 49, 41, 32, 32, 32, 44, 10, 32, 32, 32,105,115, 95,112, 97,114, 97,109,101,116,101,114, 32, 61, 32,105,115, 95,112, 97,114, 97,109,101,116,101,114, 44, 10, 32, 32, 32,107,105,110,100, 32, 61, 32,107,105,110,100, 10, 32, 32,125, 10, 32,101,110,100, 10, 10, 32,105,102, 32,107, 105,110,100, 32, 61, 61, 32, 39,118, 97,114, 39, 32,116,104, 101,110, 10, 32, 32, 45, 45, 32, 99,104,101, 99,107, 32,116, 104,101, 32,102,111,114,109, 58, 32,109,111,100, 32,116,121, 112,101, 32,110, 97,109,101, 10, 32, 32, 45, 45,116, 32, 61, 32,115,112,108,105,116, 40,115, 44, 39, 37,115, 37,115, 42, 39, 41, 10, 32, 32,116, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40,115, 44, 39, 37,115, 43, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,118, 10, 32, 32, 105,102, 32,102,105,110,100,116,121,112,101, 40,116, 91,116, 46,110, 93, 41, 32,116,104,101,110, 32,118, 32, 61, 32, 99, 114,101, 97,116,101, 95,118, 97,114,110, 97,109,101, 40, 41, 32,101,108,115,101, 32,118, 32, 61, 32,116, 91,116, 46,110, 93, 59, 32,116, 46,110, 32, 61, 32,116, 46,110, 45, 49, 32, 101,110,100, 10, 32, 32,114,101,116,117,114,110, 32, 95, 68, 101, 99,108, 97,114, 97,116,105,111,110,123, 10, 32, 32, 32, 110, 97,109,101, 32, 61, 32,118, 46, 46,116,109,112,100,101, 102, 44, 10, 32, 32, 32, 45, 45,116,121,112,101, 32, 61, 32, 114,101, 98,117,105,108,100, 95,116,101,109,112,108, 97,116, 101, 40,116, 91,116, 46,110, 93, 44, 32,116, 98, 44, 32,116, 105,109,112,108, 41, 44, 10, 32, 32, 32,116,121,112,101, 32, 61, 32,116, 91,116, 46,110, 93, 44, 10, 32, 32, 32,109,111, 100, 32, 61, 32, 99,111,110, 99, 97,116, 40,116, 44, 49, 44, 116, 46,110, 45, 49, 41, 44, 10, 32, 32, 32,105,115, 95,112, 97,114, 97,109,101,116,101,114, 32, 61, 32,105,115, 95,112, 97,114, 97,109,101,116,101,114, 44, 10, 32, 32, 32,107,105, 110,100, 32, 61, 32,107,105,110,100, 10, 32, 32,125, 10, 10, 32,101,108,115,101, 32, 45, 45, 32,107,105,110,100, 32, 61, 61, 32, 34,102,117,110, 99, 34, 10, 10, 32, 32, 45, 45, 32, 99,104,101, 99,107, 32,116,104,101, 32,102,111,114,109, 58, 32,109,111,100, 32,116,121,112,101, 32,110, 97,109,101, 10, 32, 32, 45, 45,116, 32, 61, 32,115,112,108,105,116, 40,115, 44, 39, 37,115, 37,115, 42, 39, 41, 10, 32, 32,116, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40,115, 44, 39, 37,115, 43, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,118, 32, 61, 32,116, 91,116, 46,110, 93, 32, 32, 45, 45, 32,108, 97,115,116, 32,119,111,114,100, 32,105,115, 32,116,104,101, 32,102,117,110, 99,116,105,111,110, 32,110, 97,109,101, 10, 32, 32,108,111, 99, 97,108, 32,116,112, 44, 109,100, 10, 32, 32,105,102, 32,116, 46,110, 62, 49, 32,116, 104,101,110, 10, 32, 32, 32,116,112, 32, 61, 32,116, 91,116, 46,110, 45, 49, 93, 10, 32, 32, 32,109,100, 32, 61, 32, 99, 111,110, 99, 97,116, 40,116, 44, 49, 44,116, 46,110, 45, 50, 41, 10, 32, 32,101,110,100, 10, 32, 32, 45, 45,105,102, 32, 116,112, 32,116,104,101,110, 32,116,112, 32, 61, 32,114,101, 98,117,105,108,100, 95,116,101,109,112,108, 97,116,101, 40, 116,112, 44, 32,116, 98, 44, 32,116,105,109,112,108, 41, 32, 101,110,100, 10, 32, 32,114,101,116,117,114,110, 32, 95, 68, 101, 99,108, 97,114, 97,116,105,111,110,123, 10, 32, 32, 32, 110, 97,109,101, 32, 61, 32,118, 44, 10, 32, 32, 32,116,121, 112,101, 32, 61, 32,116,112, 44, 10, 32, 32, 32,109,111,100, 32, 61, 32,109,100, 44, 10, 32, 32, 32,105,115, 95,112, 97, 114, 97,109,101,116,101,114, 32, 61, 32,105,115, 95,112, 97, 114, 97,109,101,116,101,114, 44, 10, 32, 32, 32,107,105,110, 100, 32, 61, 32,107,105,110,100, 10, 32, 32,125, 10, 32,101, 110,100, 10, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/declaration.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,118, 97,114,105, 97, 98,108,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114, 105,116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73, 100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99, 111,100,101, 32,105,115, 32,102,114,101,101, 32,115,111,102, 116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32, 114,101,100,105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32, 105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116, 119, 97,114,101, 32,112,114,111,118,105,100,101,100, 32,104, 101,114,101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105, 115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97, 117,116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98, 108,105,103, 97,116,105,111,110, 32,116,111, 32,112,114,111, 118,105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99, 101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99, 101,109,101,110,116,115, 44, 32,111,114, 32,109,111,100,105, 102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 45, 45, 32, 86, 97,114,105, 97, 98,108,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101,115,101,110,116,115, 32, 97, 32,101,120,116,101,114,110, 32,118, 97,114,105, 97, 98, 108,101, 32,111,114, 32, 97, 32,112,117, 98,108,105, 99, 32, 109,101,109, 98,101,114, 32,111,102, 32, 97, 32, 99,108, 97, 115,115, 46, 10, 45, 45, 32, 83,116,111,114,101,115, 32, 97, 108,108, 32,102,105,101,108,100,115, 32,112,114,101,115,101, 110,116, 32,105,110, 32, 97, 32,100,101, 99,108, 97,114, 97, 116,105,111,110, 46, 10, 99,108, 97,115,115, 86, 97,114,105, 97, 98,108,101, 32, 61, 32,123, 10, 32, 95,103,101,116, 32, 61, 32,123,125, 44, 32, 32, 32, 45, 45, 32,109, 97,112,112, 101,100, 32,103,101,116, 32,102,117,110, 99,116,105,111,110, 115, 10, 32, 95,115,101,116, 32, 61, 32,123,125, 44, 32, 32, 32, 45, 45, 32,109, 97,112,112,101,100, 32,115,101,116, 32, 102,117,110, 99,116,105,111,110,115, 10,125, 10, 99,108, 97, 115,115, 86, 97,114,105, 97, 98,108,101, 46, 95, 95,105,110, 100,101,120, 32, 61, 32, 99,108, 97,115,115, 86, 97,114,105, 97, 98,108,101, 10,115,101,116,109,101,116, 97,116, 97, 98, 108,101, 40, 99,108, 97,115,115, 86, 97,114,105, 97, 98,108, 101, 44, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116, 105,111,110, 41, 10, 10, 45, 45, 32, 80,114,105,110,116, 32, 109,101,116,104,111,100, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 86, 97,114,105, 97, 98,108,101, 58, 112,114,105,110,116, 32, 40,105,100,101,110,116, 44, 99,108, 111,115,101, 41, 10, 32,112,114,105,110,116, 40,105,100,101, 110,116, 46, 46, 34, 86, 97,114,105, 97, 98,108,101,123, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,109,111,100, 32, 32, 61, 32, 39, 34, 46, 46,115, 101,108,102, 46,109,111,100, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,116,121,112,101, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46,116,121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32, 112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 112,116,114, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,112,116,114, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114, 105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,110, 97, 109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,105,102, 32, 115,101,108,102, 46,100,105,109, 32,116,104,101,110, 32,112, 114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,100, 105,109, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,100, 105,109, 46, 46, 34, 39, 44, 34, 41, 32,101,110,100, 10, 32, 112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 100,101,102, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,100,101,102, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114, 105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,114,101, 116, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,114, 101,116, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110, 116, 40,105,100,101,110,116, 46, 46, 34,125, 34, 46, 46, 99, 108,111,115,101, 41, 10,101,110,100, 10, 10, 45, 45, 32, 71, 101,110,101,114, 97,116,101,115, 32, 67, 32,102,117,110, 99, 116,105,111,110, 32,110, 97,109,101, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 86, 97,114,105, 97, 98, 108,101, 58, 99,102,117,110, 99,110, 97,109,101, 32, 40,112, 114,101,102,105,120, 41, 10, 32,108,111, 99, 97,108, 32,112, 97,114,101,110,116, 32, 61, 32, 34, 34, 10, 32,108,111, 99, 97,108, 32,117,110,115,105,103,110,101,100, 32, 61, 32, 34, 34, 10, 32,108,111, 99, 97,108, 32,112,116,114, 32, 61, 32, 34, 34, 10, 10, 32,108,111, 99, 97,108, 32,112, 32, 61, 32, 115,101,108,102, 58,105,110,109,111,100,117,108,101, 40, 41, 32,111,114, 32,115,101,108,102, 58,105,110,110, 97,109,101, 115,112, 97, 99,101, 40, 41, 32,111,114, 32,115,101,108,102, 58,105,110, 99,108, 97,115,115, 40, 41, 10, 10, 32,105,102, 32,112, 32,116,104,101,110, 10, 32, 9,105,102, 32,115,101, 108,102, 46,112, 97,114,101,110,116, 46, 99,108, 97,115,115, 116,121,112,101, 32, 61, 61, 32, 39, 99,108, 97,115,115, 39, 32,116,104,101,110, 10, 9, 9,112, 97,114,101,110,116, 32, 61, 32, 34, 95, 34, 32, 46, 46, 32,115,101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 10, 9,101,108,115, 101, 10, 9, 32, 32,112, 97,114,101,110,116, 32, 61, 32, 34, 95, 34, 32, 46, 46, 32,112, 10, 9,101,110,100, 10, 32,101, 110,100, 10, 10, 32,105,102, 32,115,116,114,102,105,110,100, 40,115,101,108,102, 46,109,111,100, 44, 34, 40,117,110,115, 105,103,110,101,100, 41, 34, 41, 32,116,104,101,110, 10, 32, 32,117,110,115,105,103,110,101,100, 32, 61, 32, 34, 95,117, 110,115,105,103,110,101,100, 34, 10, 32,101,110,100, 10, 10, 32,105,102, 32,115,101,108,102, 46,112,116,114, 32, 61, 61, 32, 34, 42, 34, 32,116,104,101,110, 32,112,116,114, 32, 61, 32, 34, 95,112,116,114, 34, 10, 32,101,108,115,101,105,102, 32,115,101,108,102, 46,112,116,114, 32, 61, 61, 32, 34, 38, 34, 32,116,104,101,110, 32,112,116,114, 32, 61, 32, 34, 95, 114,101,102, 34, 10, 32,101,110,100, 10, 10, 32,108,111, 99, 97,108, 32,110, 97,109,101, 32, 61, 32, 32,112,114,101,102, 105,120, 32, 46, 46, 32,112, 97,114,101,110,116, 32, 46, 46, 32,117,110,115,105,103,110,101,100, 32, 46, 46, 32, 34, 95, 34, 32, 46, 46, 32,103,115,117, 98, 40,115,101,108,102, 46, 108,110, 97,109,101, 32,111,114, 32,115,101,108,102, 46,110, 97,109,101, 44, 34, 46, 42, 58, 58, 34, 44, 34, 34, 41, 32, 46, 46, 32,112,116,114, 10, 10, 9,110, 97,109,101, 32, 61, 32, 99,108,101, 97,110, 95,116,101,109,112,108, 97,116,101, 40,110, 97,109,101, 41, 10, 32,114,101,116,117,114,110, 32, 110, 97,109,101, 10, 10,101,110,100, 10, 10, 45, 45, 32, 99, 104,101, 99,107, 32,105,102, 32,105,116, 32,105,115, 32, 97, 32,118, 97,114,105, 97, 98,108,101, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 86, 97,114,105, 97, 98, 108,101, 58,105,115,118, 97,114,105, 97, 98,108,101, 32, 40, 41, 10, 32,114,101,116,117,114,110, 32,116,114,117,101, 10, 101,110,100, 10, 10, 45, 45, 32,103,101,116, 32,118, 97,114, 105, 97, 98,108,101, 32,118, 97,108,117,101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 86, 97,114,105, 97, 98,108,101, 58,103,101,116,118, 97,108,117,101, 32, 40, 99,108, 97,115,115, 44,115,116, 97,116,105, 99, 44, 32,112, 114,111,112, 95,103,101,116, 41, 10, 10, 9,108,111, 99, 97, 108, 32,110, 97,109,101, 10, 9,105,102, 32,112,114,111,112, 95,103,101,116, 32,116,104,101,110, 10, 10, 9, 9,110, 97, 109,101, 32, 61, 32,112,114,111,112, 95,103,101,116, 46, 46, 34, 40, 41, 34, 10, 9,101,108,115,101, 10, 9, 9,110, 97, 109,101, 32, 61, 32,115,101,108,102, 46,110, 97,109,101, 10, 9,101,110,100, 10, 10, 9,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,116, 97,116,105, 99, 32,116,104,101, 110, 10, 9, 32,114,101,116,117,114,110, 32,115,101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 46, 46, 39, 58, 58, 39, 46, 46,110, 97,109,101, 10, 9,101,108,115,101, 105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 10, 9, 32,114,101,116,117,114,110, 32, 39,115,101,108,102, 45, 62, 39, 46, 46,110, 97,109,101, 10, 9,101,108,115,101, 10, 9, 32,114,101,116,117,114,110, 32,110, 97,109,101, 10, 9,101, 110,100, 10,101,110,100, 10, 10, 45, 45, 32,103,101,116, 32, 118, 97,114,105, 97, 98,108,101, 32,112,111,105,110,116,101, 114, 32,118, 97,108,117,101, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 86, 97,114,105, 97, 98,108,101, 58,103,101,116,112,111,105,110,116,101,114,118, 97,108,117, 101, 32, 40, 99,108, 97,115,115, 44,115,116, 97,116,105, 99, 41, 10, 32,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,116, 97,116,105, 99, 32,116,104,101,110, 10, 32, 32, 114,101,116,117,114,110, 32, 99,108, 97,115,115, 46, 46, 39, 58, 58,112, 39, 10, 32,101,108,115,101,105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 10, 32, 32,114,101,116,117, 114,110, 32, 39,115,101,108,102, 45, 62,112, 39, 10, 32,101, 108,115,101, 10, 32, 32,114,101,116,117,114,110, 32, 39,112, 39, 10, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 87,114,105,116,101, 32, 98,105,110,100,105,110,103, 32,102, 117,110, 99,116,105,111,110,115, 10,102,117,110, 99,116,105, 111,110, 32, 99,108, 97,115,115, 86, 97,114,105, 97, 98,108, 101, 58,115,117,112, 99,111,100,101, 32, 40, 41, 10, 10, 32, 108,111, 99, 97,108, 32, 99,108, 97,115,115, 32, 61, 32,115, 101,108,102, 58,105,110, 99,108, 97,115,115, 40, 41, 10, 10, 9,108,111, 99, 97,108, 32,112,114,111,112, 95,103,101,116, 44,112,114,111,112, 95,115,101,116, 10, 9,105,102, 32,115, 116,114,105,110,103, 46,102,105,110,100, 40,115,101,108,102, 46,109,111,100, 44, 32, 39,116,111,108,117, 97, 95,112,114, 111,112,101,114,116,121, 39, 41, 32,116,104,101,110, 10, 10, 9, 9,108,111, 99, 97,108, 32, 95, 44, 95, 44,116,121,112, 101, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,115,101,108,102, 46,109,111,100, 44, 32, 34,116,111,108, 117, 97, 95,112,114,111,112,101,114,116,121, 95, 95, 40, 91, 94, 37,115, 93, 42, 41, 34, 41, 10, 9, 9,116,121,112,101, 32, 61, 32,116,121,112,101, 32,111,114, 32, 34,100,101,102, 97,117,108,116, 34, 10, 9, 9,112,114,111,112, 95,103,101, 116, 44,112,114,111,112, 95,115,101,116, 32, 61, 32,103,101, 116, 95,112,114,111,112,101,114,116,121, 95,109,101,116,104, 111,100,115, 40,116,121,112,101, 44, 32,115,101,108,102, 46, 110, 97,109,101, 41, 10, 9, 9,115,101,108,102, 46,109,111, 100, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,115,101,108,102, 46,109,111,100, 44, 32, 34,116,111,108, 117, 97, 95,112,114,111,112,101,114,116,121, 91, 94, 37,115, 93, 42, 34, 44, 32, 34, 34, 41, 10, 9,101,110,100, 10, 10, 32, 45, 45, 32,103,101,116, 32,102,117,110, 99,116,105,111, 110, 32, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 32,105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 10, 32, 32,111,117,116,112,117,116, 40, 34, 47, 42, 32,103,101,116, 32,102,117,110, 99,116,105,111, 110, 58, 34, 44,115,101,108,102, 46,110, 97,109,101, 44, 34, 32,111,102, 32, 99,108, 97,115,115, 32, 34, 44, 99,108, 97, 115,115, 44, 34, 32, 42, 47, 34, 41, 10, 32,101,108,115,101, 10, 32, 32,111,117,116,112,117,116, 40, 34, 47, 42, 32,103, 101,116, 32,102,117,110, 99,116,105,111,110, 58, 34, 44,115, 101,108,102, 46,110, 97,109,101, 44, 34, 32, 42, 47, 34, 41, 10, 32,101,110,100, 10, 32,115,101,108,102, 46, 99,103,101, 116,110, 97,109,101, 32, 61, 32,115,101,108,102, 58, 99,102, 117,110, 99,110, 97,109,101, 40, 34,116,111,108,117, 97, 95, 103,101,116, 34, 41, 10, 32,111,117,116,112,117,116, 40, 34, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 95, 34, 46, 46,115,101,108,102, 46, 99,103,101,116,110, 97,109,101, 41, 10, 32,111,117,116,112, 117,116, 40, 34, 92,110,115,116, 97,116,105, 99, 32,105,110, 116, 34, 44,115,101,108,102, 46, 99,103,101,116,110, 97,109, 101, 44, 34, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32, 116,111,108,117, 97, 95, 83, 41, 34, 41, 10, 32,111,117,116, 112,117,116, 40, 34,123, 34, 41, 10, 10, 32, 45, 45, 32,100, 101, 99,108, 97,114,101, 32,115,101,108,102, 44, 32,105,102, 32,116,104,101, 32, 99, 97,115,101, 10, 32,108,111, 99, 97, 108, 32, 95, 44, 95, 44,115,116, 97,116,105, 99, 32, 61, 32, 115,116,114,102,105,110,100, 40,115,101,108,102, 46,109,111, 100, 44, 39, 94, 37,115, 42, 40,115,116, 97,116,105, 99, 41, 39, 41, 10, 32,105,102, 32, 99,108, 97,115,115, 32, 97,110, 100, 32,115,116, 97,116,105, 99, 61, 61,110,105,108, 32,116, 104,101,110, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 39, 44,115,101,108,102, 46,112, 97,114,101,110,116, 46,116, 121,112,101, 44, 39, 42, 39, 44, 39,115,101,108,102, 32, 61, 32, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 40, 39, 44,115,101,108,102, 46,112, 97,114,101,110,116, 46,116, 121,112,101, 44, 39, 42, 41, 32, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,116,111, 95,102,117,110, 99, 32, 61, 32,103, 101,116, 95,116,111, 95,102,117,110, 99,116,105,111,110, 40, 115,101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112, 101, 41, 10, 32, 32,111,117,116,112,117,116, 40,116,111, 95, 102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 49, 44, 48, 41, 59, 39, 41, 10, 32,101,108,115,101,105,102, 32,115,116, 97,116,105, 99, 32,116,104,101,110, 10, 32, 32, 95, 44, 95, 44,115,101,108,102, 46,109,111,100, 32, 61, 32, 115,116,114,102,105,110,100, 40,115,101,108,102, 46,109,111, 100, 44, 39, 94, 37,115, 42,115,116, 97,116,105, 99, 37,115, 37,115, 42, 40, 46, 42, 41, 39, 41, 10, 32,101,110,100, 10, 10, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,115,101,108, 102, 32,118, 97,108,117,101, 10, 32,105,102, 32, 99,108, 97, 115,115, 32, 97,110,100, 32,115,116, 97,116,105, 99, 61, 61, 110,105,108, 32,116,104,101,110, 10, 9, 32,111,117,116,112, 117,116, 40, 39, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32,105,102, 32, 40, 33,115,101,108,102, 41, 32,116,111,108,117, 97, 95,101, 114,114,111,114, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,111,117,116,112,117,116, 95,101,114,114,111,114, 95, 104,111,111,107, 40, 34,105,110,118, 97,108,105,100, 32, 92, 39,115,101,108,102, 92, 39, 32,105,110, 32, 97, 99, 99,101, 115,115,105,110,103, 32,118, 97,114,105, 97, 98,108,101, 32, 92, 39, 37,115, 92, 39, 34, 44, 32,115,101,108,102, 46,110, 97,109,101, 41, 46, 46, 39, 34, 44, 78, 85, 76, 76, 41, 59, 39, 41, 59, 10, 9, 9,111,117,116,112,117,116, 40, 39, 35, 101,110,100,105,102, 92,110, 39, 41, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,114,101,116,117,114,110, 32,118, 97,108, 117,101, 10, 32,105,102, 32,115,116,114,105,110,103, 46,102, 105,110,100, 40,115,101,108,102, 46,109,111,100, 44, 32, 39, 116,111,108,117, 97, 95,105,110,104,101,114,105,116,115, 39, 41, 32,116,104,101,110, 10, 9,108,111, 99, 97,108, 32,112, 117,115,104, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95, 112,117,115,104, 95,102,117,110, 99,116,105,111,110, 40,115, 101,108,102, 46,116,121,112,101, 41, 10, 32, 9,111,117,116, 112,117,116, 40, 39, 35,105,102,100,101,102, 32, 95, 95, 99, 112,108,117,115,112,108,117,115, 92,110, 39, 41, 10, 9,111, 117,116,112,117,116, 40, 39, 32, 32, 39, 44,112,117,115,104, 95,102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41,115,116, 97,116,105, 99, 95, 99, 97,115,116, 60, 39, 46, 46,115,101,108,102, 46,116,121, 112,101, 46, 46, 39, 42, 62, 40,115,101,108,102, 41, 44, 32, 34, 39, 44,115,101,108,102, 46,116,121,112,101, 44, 39, 34, 41, 59, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 35, 101,108,115,101, 92,110, 39, 41, 10, 9,111,117,116,112,117, 116, 40, 39, 32, 32, 39, 44,112,117,115,104, 95,102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40,118,111, 105,100, 42, 41, 40, 40, 39, 46, 46,115,101,108,102, 46,116, 121,112,101, 46, 46, 39, 42, 41,115,101,108,102, 41, 44, 32, 34, 39, 44,115,101,108,102, 46,116,121,112,101, 44, 39, 34, 41, 59, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 35, 101,110,100,105,102, 92,110, 39, 41, 10, 32,101,108,115,101, 10, 9,108,111, 99, 97,108, 32,116, 44, 99,116, 32, 61, 32, 105,115, 98, 97,115,105, 99, 40,115,101,108,102, 46,116,121, 112,101, 41, 10, 9,105,102, 32,116, 32,116,104,101,110, 10, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32,116,111,108, 117, 97, 95,112,117,115,104, 39, 46, 46,116, 46, 46, 39, 40, 116,111,108,117, 97, 95, 83, 44, 40, 39, 44, 99,116, 44, 39, 41, 39, 46, 46,115,101,108,102, 58,103,101,116,118, 97,108, 117,101, 40, 99,108, 97,115,115, 44,115,116, 97,116,105, 99, 44,112,114,111,112, 95,103,101,116, 41, 46, 46, 39, 41, 59, 39, 41, 10, 9,101,108,115,101, 10, 9, 9,108,111, 99, 97, 108, 32,112,117,115,104, 95,102,117,110, 99, 32, 61, 32,103, 101,116, 95,112,117,115,104, 95,102,117,110, 99,116,105,111, 110, 40,115,101,108,102, 46,116,121,112,101, 41, 10, 9, 9, 116, 32, 61, 32,115,101,108,102, 46,116,121,112,101, 10, 9, 9,105,102, 32,115,101,108,102, 46,112,116,114, 32, 61, 61, 32, 39, 38, 39, 32,111,114, 32,115,101,108,102, 46,112,116, 114, 32, 61, 61, 32, 39, 39, 32,116,104,101,110, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 39, 44,112,117, 115,104, 95,102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41, 38, 39, 46, 46,115, 101,108,102, 58,103,101,116,118, 97,108,117,101, 40, 99,108, 97,115,115, 44,115,116, 97,116,105, 99, 44,112,114,111,112, 95,103,101,116, 41, 46, 46, 39, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 39, 44,112,117, 115,104, 95,102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41, 39, 46, 46,115,101, 108,102, 58,103,101,116,118, 97,108,117,101, 40, 99,108, 97, 115,115, 44,115,116, 97,116,105, 99, 44,112,114,111,112, 95, 103,101,116, 41, 46, 46, 39, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10, 32,101,110,100, 10, 32,111,117,116,112,117,116, 40, 39, 32,114,101,116,117,114,110, 32, 49, 59, 39, 41, 10, 32,111, 117,116,112,117,116, 40, 39,125, 39, 41, 10, 32,111,117,116, 112,117,116, 40, 39, 35,101,110,100,105,102, 32, 47, 47, 35, 105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 92,110, 39, 41, 10, 32,111,117,116,112, 117,116, 40, 39, 92,110, 39, 41, 10, 10, 32, 45, 45, 32,115, 101,116, 32,102,117,110, 99,116,105,111,110, 32, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 32,105,102, 32,110,111,116, 32, 40,115,116,114,102,105, 110,100, 40,115,101,108,102, 46,116,121,112,101, 44, 39, 99, 111,110,115,116, 37,115, 43, 39, 41, 32,111,114, 32,115,116, 114,105,110,103, 46,102,105,110,100, 40,115,101,108,102, 46, 109,111,100, 44, 32, 39,116,111,108,117, 97, 95,114,101, 97, 100,111,110,108,121, 39, 41, 32,111,114, 32,115,116,114,105, 110,103, 46,102,105,110,100, 40,115,101,108,102, 46,109,111, 100, 44, 32, 39,116,111,108,117, 97, 95,105,110,104,101,114, 105,116,115, 39, 41, 41, 32, 32,116,104,101,110, 10, 32, 32, 105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 10, 32, 32, 32,111,117,116,112,117,116, 40, 34, 47, 42, 32,115,101, 116, 32,102,117,110, 99,116,105,111,110, 58, 34, 44,115,101, 108,102, 46,110, 97,109,101, 44, 34, 32,111,102, 32, 99,108, 97,115,115, 32, 34, 44, 99,108, 97,115,115, 44, 34, 32, 42, 47, 34, 41, 10, 32, 32,101,108,115,101, 10, 32, 32, 32,111, 117,116,112,117,116, 40, 34, 47, 42, 32,115,101,116, 32,102, 117,110, 99,116,105,111,110, 58, 34, 44,115,101,108,102, 46, 110, 97,109,101, 44, 34, 32, 42, 47, 34, 41, 10, 32, 32,101, 110,100, 10, 32, 32,115,101,108,102, 46, 99,115,101,116,110, 97,109,101, 32, 61, 32,115,101,108,102, 58, 99,102,117,110, 99,110, 97,109,101, 40, 34,116,111,108,117, 97, 95,115,101, 116, 34, 41, 10, 32, 32,111,117,116,112,117,116, 40, 34, 35, 105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 95, 34, 46, 46,115,101,108,102, 46, 99, 115,101,116,110, 97,109,101, 41, 10, 32, 32,111,117,116,112, 117,116, 40, 34, 92,110,115,116, 97,116,105, 99, 32,105,110, 116, 34, 44,115,101,108,102, 46, 99,115,101,116,110, 97,109, 101, 44, 34, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32, 116,111,108,117, 97, 95, 83, 41, 34, 41, 10, 32, 32,111,117, 116,112,117,116, 40, 34,123, 34, 41, 10, 10, 32, 32, 45, 45, 32,100,101, 99,108, 97,114,101, 32,115,101,108,102, 44, 32, 105,102, 32,116,104,101, 32, 99, 97,115,101, 10, 32, 32,105, 102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,116, 97, 116,105, 99, 61, 61,110,105,108, 32,116,104,101,110, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 39, 44,115,101, 108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 44, 39, 42, 39, 44, 39,115,101,108,102, 32, 61, 32, 39, 41, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 40, 39, 44,115, 101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 44, 39, 42, 41, 32, 39, 41, 10, 32, 32, 32,108,111, 99, 97, 108, 32,116,111, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95,116,111, 95,102,117,110, 99,116,105,111,110, 40,115,101, 108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 41, 10, 32, 32, 32,111,117,116,112,117,116, 40,116,111, 95,102, 117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 49, 44, 48, 41, 59, 39, 41, 10, 32, 32, 32, 45, 45, 32, 99,104, 101, 99,107, 32,115,101,108,102, 32,118, 97,108,117,101, 10, 9, 9,101,110,100, 10, 32, 32, 45, 45, 32, 99,104,101, 99, 107, 32,116,121,112,101,115, 10, 9, 9,111,117,116,112,117, 116, 40, 39, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32,116,111,108,117, 97, 95, 69,114,114,111,114, 32,116,111,108,117, 97, 95,101, 114,114, 59, 39, 41, 10, 32, 32,105,102, 32, 99,108, 97,115, 115, 32, 97,110,100, 32,115,116, 97,116,105, 99, 61, 61,110, 105,108, 32,116,104,101,110, 10, 32, 32, 32,111,117,116,112, 117,116, 40, 39, 32, 32,105,102, 32, 40, 33,115,101,108,102, 41, 32,116,111,108,117, 97, 95,101,114,114,111,114, 40,116, 111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,111,117,116,112, 117,116, 95,101,114,114,111,114, 95,104,111,111,107, 40, 34, 105,110,118, 97,108,105,100, 32, 92, 39,115,101,108,102, 92, 39, 32,105,110, 32, 97, 99, 99,101,115,115,105,110,103, 32, 118, 97,114,105, 97, 98,108,101, 32, 92, 39, 37,115, 92, 39, 34, 44, 32,115,101,108,102, 46,110, 97,109,101, 41, 46, 46, 39, 34, 44, 78, 85, 76, 76, 41, 59, 39, 41, 59, 10, 32, 32, 101,108,115,101,105,102, 32,115,116, 97,116,105, 99, 32,116, 104,101,110, 10, 32, 32, 32, 95, 44, 95, 44,115,101,108,102, 46,109,111,100, 32, 61, 32,115,116,114,102,105,110,100, 40, 115,101,108,102, 46,109,111,100, 44, 39, 94, 37,115, 42,115, 116, 97,116,105, 99, 37,115, 37,115, 42, 40, 46, 42, 41, 39, 41, 10, 32, 32,101,110,100, 10, 10, 32, 32, 45, 45, 32, 99, 104,101, 99,107, 32,118, 97,114,105, 97, 98,108,101, 32,116, 121,112,101, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32,105,102, 32, 40, 39, 46, 46,115,101,108,102, 58,111,117, 116, 99,104,101, 99,107,116,121,112,101, 40, 50, 41, 46, 46, 39, 41, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,116,111,108,117, 97, 95,101,114,114,111,114, 40, 116,111,108,117, 97, 95, 83, 44, 34, 35,118,105,110,118, 97, 108,105,100, 32,116,121,112,101, 32,105,110, 32,118, 97,114, 105, 97, 98,108,101, 32, 97,115,115,105,103,110,109,101,110, 116, 46, 34, 44, 38,116,111,108,117, 97, 95,101,114,114, 41, 59, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39, 35, 101,110,100,105,102, 92,110, 39, 41, 10, 10, 32, 32, 45, 45, 32, 97,115,115,105,103,110, 32,118, 97,108,117,101, 10, 9, 9,108,111, 99, 97,108, 32,100,101,102, 32, 61, 32, 48, 10, 9, 9,105,102, 32,115,101,108,102, 46,100,101,102, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 32,100,101,102, 32, 61, 32,115,101,108,102, 46,100,101,102, 32,101,110,100, 10, 9, 9,105,102, 32,115,101,108,102, 46,116,121,112,101, 32, 61, 61, 32, 39, 99,104, 97,114, 42, 39, 32, 97,110,100, 32,115, 101,108,102, 46,100,105,109, 32,126, 61, 32, 39, 39, 32,116, 104,101,110, 32, 45, 45, 32,105,115, 32,115,116,114,105,110, 103, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32,115, 116,114,110, 99,112,121, 40, 40, 99,104, 97,114, 42, 41, 39, 41, 10, 9, 9, 9,105,102, 32, 99,108, 97,115,115, 32, 97, 110,100, 32,115,116, 97,116,105, 99, 32,116,104,101,110, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40,115,101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 46, 46, 39, 58, 58, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 41, 10, 9, 9, 9,101,108,115,101,105,102, 32, 99,108, 97,115, 115, 32,116,104,101,110, 10, 9, 9, 9, 9,111,117,116,112, 117,116, 40, 39,115,101,108,102, 45, 62, 39, 46, 46,115,101, 108,102, 46,110, 97,109,101, 41, 10, 9, 9, 9,101,108,115, 101, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40,115,101, 108,102, 46,110, 97,109,101, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 44, 40, 99, 111,110,115,116, 32, 99,104, 97,114, 42, 41,116,111,108,117, 97, 95,116,111,115,116,114,105,110,103, 40,116,111,108,117, 97, 95, 83, 44, 50, 44, 39, 44,100,101,102, 44, 39, 41, 44, 39, 44,115,101,108,102, 46,100,105,109, 44, 39, 45, 49, 41, 59, 39, 41, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,108, 111, 99, 97,108, 32,112,116,114, 32, 61, 32, 39, 39, 10, 9, 9, 9,105,102, 32,115,101,108,102, 46,112,116,114,126, 61, 39, 39, 32,116,104,101,110, 32,112,116,114, 32, 61, 32, 39, 42, 39, 32,101,110,100, 10, 9, 9, 9,111,117,116,112,117, 116, 40, 39, 32, 39, 41, 10, 9, 9, 9,108,111, 99, 97,108, 32,110, 97,109,101, 32, 61, 32,112,114,111,112, 95,115,101, 116, 32,111,114, 32,115,101,108,102, 46,110, 97,109,101, 10, 9, 9, 9,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,116, 97,116,105, 99, 32,116,104,101,110, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40,115,101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 46, 46, 39, 58, 58, 39, 46, 46,110, 97,109,101, 41, 10, 9, 9, 9,101,108,115, 101,105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40, 39,115,101,108, 102, 45, 62, 39, 46, 46,110, 97,109,101, 41, 10, 9, 9, 9, 101,108,115,101, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40,110, 97,109,101, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9, 9,108,111, 99, 97,108, 32,116, 32, 61, 32,105,115, 98, 97,115,105, 99, 40,115,101,108,102, 46,116,121,112,101, 41, 10, 9, 9, 9,105,102, 32,112,114,111,112, 95,115,101,116, 32,116,104,101,110, 10, 9, 9, 9, 9,111,117,116,112,117, 116, 40, 39, 40, 39, 41, 10, 9, 9, 9,101,108,115,101, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 61, 32, 39, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9, 9,105,102, 32,110,111,116, 32,116, 32, 97,110,100, 32,112,116,114, 61, 61, 39, 39, 32,116,104,101,110, 32,111,117,116,112,117,116, 40, 39, 42, 39, 41, 32,101,110,100, 10, 9, 9, 9,111,117, 116,112,117,116, 40, 39, 40, 40, 39, 44,115,101,108,102, 46, 109,111,100, 44,115,101,108,102, 46,116,121,112,101, 41, 10, 9, 9, 9,105,102, 32,110,111,116, 32,116, 32,116,104,101, 110, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40, 39, 42, 39, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9, 9,111,117, 116,112,117,116, 40, 39, 41, 32, 39, 41, 10, 9, 9, 9,105, 102, 32,116, 32,116,104,101,110, 10, 9, 9, 9, 9,105,102, 32,105,115,101,110,117,109, 40,115,101,108,102, 46,116,121, 112,101, 41, 32,116,104,101,110, 10, 9, 9, 9, 9, 9,111, 117,116,112,117,116, 40, 39, 40,105,110,116, 41, 32, 39, 41, 10, 9, 9, 9, 9,101,110,100, 10, 9, 9, 9, 9,111,117, 116,112,117,116, 40, 39,116,111,108,117, 97, 95,116,111, 39, 46, 46,116, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 50, 44, 39, 44,100,101,102, 44, 39, 41, 41, 39, 41, 10, 9, 9, 9,101,108,115,101, 10, 9, 9, 9, 9,108,111, 99, 97,108, 32,116,111, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95, 116,111, 95,102,117,110, 99,116,105,111,110, 40,115,101,108, 102, 46,116,121,112,101, 41, 10, 9, 9, 9, 9,111,117,116, 112,117,116, 40,116,111, 95,102,117,110, 99, 44, 39, 40,116, 111,108,117, 97, 95, 83, 44, 50, 44, 39, 44,100,101,102, 44, 39, 41, 41, 39, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9, 9,105,102, 32,112,114,111,112, 95,115,101,116, 32,116,104, 101,110, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40, 34, 41, 34, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9, 9,111, 117,116,112,117,116, 40, 34, 59, 34, 41, 10, 9, 9,101,110, 100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32,114,101, 116,117,114,110, 32, 48, 59, 39, 41, 10, 32, 32,111,117,116, 112,117,116, 40, 39,125, 39, 41, 10, 32, 32,111,117,116,112, 117,116, 40, 39, 35,101,110,100,105,102, 32, 47, 47, 35,105, 102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 92,110, 39, 41, 10, 32, 32,111,117,116,112, 117,116, 40, 39, 92,110, 39, 41, 10, 32,101,110,100, 10, 10, 101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, 99, 108, 97,115,115, 86, 97,114,105, 97, 98,108,101, 58,114,101, 103,105,115,116,101,114, 32, 40,112,114,101, 41, 10, 10, 9, 105,102, 32,110,111,116, 32,115,101,108,102, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115, 115, 40, 41, 32,116,104,101,110, 10, 9, 9,114,101,116,117, 114,110, 10, 9,101,110,100, 10, 32,112,114,101, 32, 61, 32, 112,114,101, 32,111,114, 32, 39, 39, 10, 32,108,111, 99, 97, 108, 32,112, 97,114,101,110,116, 32, 61, 32,115,101,108,102, 58,105,110,109,111,100,117,108,101, 40, 41, 32,111,114, 32, 115,101,108,102, 58,105,110,110, 97,109,101,115,112, 97, 99, 101, 40, 41, 32,111,114, 32,115,101,108,102, 58,105,110, 99, 108, 97,115,115, 40, 41, 10, 32,105,102, 32,110,111,116, 32, 112, 97,114,101,110,116, 32,116,104,101,110, 10, 32, 32,105, 102, 32, 99,108, 97,115,115, 86, 97,114,105, 97, 98,108,101, 46, 95,119, 97,114,110,105,110,103, 61, 61,110,105,108, 32, 116,104,101,110, 10, 32, 32, 32,119, 97,114,110,105,110,103, 40, 34, 77, 97,112,112,105,110,103, 32,118, 97,114,105, 97, 98,108,101, 32,116,111, 32,103,108,111, 98, 97,108, 32,109, 97,121, 32,100,101,103,114, 97,100,101, 32,112,101,114,102, 111,114,109, 97,110, 99,101, 34, 41, 10, 32, 32, 32, 99,108, 97,115,115, 86, 97,114,105, 97, 98,108,101, 46, 95,119, 97, 114,110,105,110,103, 32, 61, 32, 49, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 32,105,102, 32,115,101,108,102, 46, 99,115,101,116,110, 97,109,101, 32,116,104,101,110, 10, 32, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 39,116, 111,108,117, 97, 95,118, 97,114,105, 97, 98,108,101, 40,116, 111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101,108,102, 46,108,110, 97,109,101, 46, 46, 39, 34, 44, 39, 46, 46,115, 101,108,102, 46, 99,103,101,116,110, 97,109,101, 46, 46, 39, 44, 39, 46, 46,115,101,108,102, 46, 99,115,101,116,110, 97, 109,101, 46, 46, 39, 41, 59, 39, 41, 10, 32,101,108,115,101, 10, 32, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 39,116,111,108,117, 97, 95,118, 97,114,105, 97, 98,108,101, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101, 108,102, 46,108,110, 97,109,101, 46, 46, 39, 34, 44, 39, 46, 46,115,101,108,102, 46, 99,103,101,116,110, 97,109,101, 46, 46, 39, 44, 78, 85, 76, 76, 41, 59, 39, 41, 10, 32,101,110, 100, 10,101,110,100, 10, 10, 45, 45, 32, 73,110,116,101,114, 110, 97,108, 32, 99,111,110,115,116,114,117, 99,116,111,114, 10,102,117,110, 99,116,105,111,110, 32, 95, 86, 97,114,105, 97, 98,108,101, 32, 40,116, 41, 10, 32,115,101,116,109,101, 116, 97,116, 97, 98,108,101, 40,116, 44, 99,108, 97,115,115, 86, 97,114,105, 97, 98,108,101, 41, 10, 32, 97,112,112,101, 110,100, 40,116, 41, 10, 32,114,101,116,117,114,110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110,115,116,114, 117, 99,116,111,114, 10, 45, 45, 32, 69,120,112,101, 99,116, 115, 32, 97, 32,115,116,114,105,110,103, 32,114,101,112,114, 101,115,101,110,116,105,110,103, 32,116,104,101, 32,118, 97, 114,105, 97, 98,108,101, 32,100,101, 99,108, 97,114, 97,116, 105,111,110, 46, 10,102,117,110, 99,116,105,111,110, 32, 86, 97,114,105, 97, 98,108,101, 32, 40,115, 41, 10, 32,114,101, 116,117,114,110, 32, 95, 86, 97,114,105, 97, 98,108,101, 32, 40, 68,101, 99,108, 97,114, 97,116,105,111,110, 40,115, 44, 39,118, 97,114, 39, 41, 41, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/variable.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32, 97,114,114, 97,121, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114,105,116,116, 101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97, 102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117, 108, 32, 49, 57, 57, 57, 10, 45, 45, 32, 36, 73,100, 58, 32, 97,114,114, 97,121, 46,108,117, 97, 44,118, 32, 49, 46, 49, 32, 50, 48, 48, 48, 47, 49, 49, 47, 48, 54, 32, 50, 50, 58, 48, 51, 58, 53, 55, 32, 99,101,108,101,115, 32, 69,120,112, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111,100, 101, 32,105,115, 32,102,114,101,101, 32,115,111,102,116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101, 100,105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97, 110,100, 47,111,114, 32,109,111,100,105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116,119, 97, 114,101, 32,112,114,111,118,105,100,101,100, 32,104,101,114, 101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97,117,116, 104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105, 103, 97,116,105,111,110, 32,116,111, 32,112,114,111,118,105, 100,101, 32,109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97,116, 101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101,109, 101,110,116,115, 44, 32,111,114, 32,109,111,100,105,102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 45, 45, 32, 65, 114,114, 97,121, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82, 101,112,114,101,115,101,110,116,115, 32, 97, 32,101,120,116, 101,114,110, 32, 97,114,114, 97,121, 32,118, 97,114,105, 97, 98,108,101, 32,111,114, 32, 97, 32,112,117, 98,108,105, 99, 32,109,101,109, 98,101,114, 32,111,102, 32, 97, 32, 99,108, 97,115,115, 46, 10, 45, 45, 32, 83,116,111,114,101,115, 32, 97,108,108, 32,102,105,101,108,100,115, 32,112,114,101,115, 101,110,116, 32,105,110, 32, 97, 32,100,101, 99,108, 97,114, 97,116,105,111,110, 46, 10, 99,108, 97,115,115, 65,114,114, 97,121, 32, 61, 32,123, 10,125, 10, 99,108, 97,115,115, 65, 114,114, 97,121, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97,115,115, 65,114,114, 97,121, 10,115,101,116,109, 101,116, 97,116, 97, 98,108,101, 40, 99,108, 97,115,115, 65, 114,114, 97,121, 44, 99,108, 97,115,115, 68,101, 99,108, 97, 114, 97,116,105,111,110, 41, 10, 10, 45, 45, 32, 80,114,105, 110,116, 32,109,101,116,104,111,100, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 65,114,114, 97,121, 58, 112,114,105,110,116, 32, 40,105,100,101,110,116, 44, 99,108, 111,115,101, 41, 10, 32,112,114,105,110,116, 40,105,100,101, 110,116, 46, 46, 34, 65,114,114, 97,121,123, 34, 41, 10, 32, 112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 109,111,100, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,109,111,100, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114, 105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,116,121, 112,101, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,116, 121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105, 110,116, 40,105,100,101,110,116, 46, 46, 34, 32,112,116,114, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,112,116, 114, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40, 105,100,101,110,116, 46, 46, 34, 32,100,101,102, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,100,101,102, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100, 101,110,116, 46, 46, 34, 32,100,105,109, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,100,105,109, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110, 116, 46, 46, 34, 32,114,101,116, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,114,101,116, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34,125, 34, 46, 46, 99,108,111,115,101, 41, 10,101,110, 100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32, 105,116, 32,105,115, 32, 97, 32,118, 97,114,105, 97, 98,108, 101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115, 115, 65,114,114, 97,121, 58,105,115,118, 97,114,105, 97, 98, 108,101, 32, 40, 41, 10, 32,114,101,116,117,114,110, 32,116, 114,117,101, 10,101,110,100, 10, 10, 10, 45, 45, 32,103,101, 116, 32,118, 97,114,105, 97, 98,108,101, 32,118, 97,108,117, 101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115, 115, 65,114,114, 97,121, 58,103,101,116,118, 97,108,117,101, 32, 40, 99,108, 97,115,115, 44,115,116, 97,116,105, 99, 41, 10, 32,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32, 115,116, 97,116,105, 99, 32,116,104,101,110, 10, 32, 32,114, 101,116,117,114,110, 32, 99,108, 97,115,115, 46, 46, 39, 58, 58, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 91,116,111,108,117, 97, 95,105,110,100,101,120, 93, 39, 10, 32,101,108,115,101,105,102, 32, 99,108, 97,115,115, 32, 116,104,101,110, 10, 32, 32,114,101,116,117,114,110, 32, 39, 115,101,108,102, 45, 62, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 91,116,111,108,117, 97, 95,105,110, 100,101,120, 93, 39, 10, 32,101,108,115,101, 10, 32, 32,114, 101,116,117,114,110, 32,115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 91,116,111,108,117, 97, 95,105,110,100,101,120, 93, 39, 10, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 87,114,105,116,101, 32, 98,105,110,100,105,110,103, 32, 102,117,110, 99,116,105,111,110,115, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 65,114,114, 97,121, 58, 115,117,112, 99,111,100,101, 32, 40, 41, 10, 32,108,111, 99, 97,108, 32, 99,108, 97,115,115, 32, 61, 32,115,101,108,102, 58,105,110, 99,108, 97,115,115, 40, 41, 10, 10, 32, 45, 45, 32,103,101,116, 32,102,117,110, 99,116,105,111,110, 32, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 32,105,102, 32, 99,108, 97,115,115, 32,116,104, 101,110, 10, 32, 32,111,117,116,112,117,116, 40, 34, 47, 42, 32,103,101,116, 32,102,117,110, 99,116,105,111,110, 58, 34, 44,115,101,108,102, 46,110, 97,109,101, 44, 34, 32,111,102, 32, 99,108, 97,115,115, 32, 34, 44, 99,108, 97,115,115, 44, 34, 32, 42, 47, 34, 41, 10, 32,101,108,115,101, 10, 32, 32, 111,117,116,112,117,116, 40, 34, 47, 42, 32,103,101,116, 32, 102,117,110, 99,116,105,111,110, 58, 34, 44,115,101,108,102, 46,110, 97,109,101, 44, 34, 32, 42, 47, 34, 41, 10, 32,101, 110,100, 10, 32,115,101,108,102, 46, 99,103,101,116,110, 97, 109,101, 32, 61, 32,115,101,108,102, 58, 99,102,117,110, 99, 110, 97,109,101, 40, 34,116,111,108,117, 97, 95,103,101,116, 34, 41, 10, 32,111,117,116,112,117,116, 40, 34, 35,105,102, 110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 95, 34, 46, 46,115,101,108,102, 46, 99,103,101, 116,110, 97,109,101, 41, 10, 32,111,117,116,112,117,116, 40, 34, 92,110,115,116, 97,116,105, 99, 32,105,110,116, 34, 44, 115,101,108,102, 46, 99,103,101,116,110, 97,109,101, 44, 34, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32,116,111,108, 117, 97, 95, 83, 41, 34, 41, 10, 32,111,117,116,112,117,116, 40, 34,123, 34, 41, 10, 32,111,117,116,112,117,116, 40, 34, 32,105,110,116, 32,116,111,108,117, 97, 95,105,110,100,101, 120, 59, 34, 41, 10, 10, 32, 45, 45, 32,100,101, 99,108, 97, 114,101, 32,115,101,108,102, 44, 32,105,102, 32,116,104,101, 32, 99, 97,115,101, 10, 32,108,111, 99, 97,108, 32, 95, 44, 95, 44,115,116, 97,116,105, 99, 32, 61, 32,115,116,114,102, 105,110,100, 40,115,101,108,102, 46,109,111,100, 44, 39, 94, 37,115, 42, 40,115,116, 97,116,105, 99, 41, 39, 41, 10, 32, 105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,116, 97,116,105, 99, 61, 61,110,105,108, 32,116,104,101,110, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 39, 44,115,101, 108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 44, 39, 42, 39, 44, 39,115,101,108,102, 59, 39, 41, 10, 32, 32, 111,117,116,112,117,116, 40, 39, 32,108,117, 97, 95,112,117, 115,104,115,116,114,105,110,103, 40,116,111,108,117, 97, 95, 83, 44, 34, 46,115,101,108,102, 34, 41, 59, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32,108,117, 97, 95,114, 97,119,103,101,116, 40,116,111,108,117, 97, 95, 83, 44, 49, 41, 59, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32,115,101,108,102, 32, 61, 32, 39, 41, 10, 32, 32,111,117, 116,112,117,116, 40, 39, 40, 39, 44,115,101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 44, 39, 42, 41, 32, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39,108,117, 97, 95,116,111,117,115,101,114,100, 97,116, 97, 40,116,111, 108,117, 97, 95, 83, 44, 45, 49, 41, 59, 39, 41, 10, 32,101, 108,115,101,105,102, 32,115,116, 97,116,105, 99, 32,116,104, 101,110, 10, 32, 32, 95, 44, 95, 44,115,101,108,102, 46,109, 111,100, 32, 61, 32,115,116,114,102,105,110,100, 40,115,101, 108,102, 46,109,111,100, 44, 39, 94, 37,115, 42,115,116, 97, 116,105, 99, 37,115, 37,115, 42, 40, 46, 42, 41, 39, 41, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,105,110,100,101,120, 10, 9,111,117,116,112,117,116, 40, 39, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9,111,117, 116,112,117,116, 40, 39, 32,123, 39, 41, 10, 9,111,117,116, 112,117,116, 40, 39, 32, 32,116,111,108,117, 97, 95, 69,114, 114,111,114, 32,116,111,108,117, 97, 95,101,114,114, 59, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 32, 32,105,102, 32, 40, 33,116,111,108,117, 97, 95,105,115,110,117,109, 98, 101,114, 40,116,111,108,117, 97, 95, 83, 44, 50, 44, 48, 44, 38,116,111,108,117, 97, 95,101,114,114, 41, 41, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,116,111,108, 117, 97, 95,101,114,114,111,114, 40,116,111,108,117, 97, 95, 83, 44, 34, 35,118,105,110,118, 97,108,105,100, 32,116,121, 112,101, 32,105,110, 32, 97,114,114, 97,121, 32,105,110,100, 101,120,105,110,103, 46, 34, 44, 38,116,111,108,117, 97, 95, 101,114,114, 41, 59, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 32,125, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 9,105,102, 32,102,108, 97,103,115, 91, 39, 49, 39, 93, 32,116,104,101, 110, 32, 45, 45, 32,102,111,114, 32, 99,111,109,112, 97,116, 105, 98,105,108,105,116,121, 32,119,105,116,104, 32,116,111, 108,117, 97, 53, 32, 63, 10, 9, 9,111,117,116,112,117,116, 40, 39, 32,116,111,108,117, 97, 95,105,110,100,101,120, 32, 61, 32, 40,105,110,116, 41,116,111,108,117, 97, 95,116,111, 110,117,109, 98,101,114, 40,116,111,108,117, 97, 95, 83, 44, 50, 44, 48, 41, 45, 49, 59, 39, 41, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,112,117,116, 40, 39, 32,116,111,108, 117, 97, 95,105,110,100,101,120, 32, 61, 32, 40,105,110,116, 41,116,111,108,117, 97, 95,116,111,110,117,109, 98,101,114, 40,116,111,108,117, 97, 95, 83, 44, 50, 44, 48, 41, 59, 39, 41, 10, 9,101,110,100, 10, 9,111,117,116,112,117,116, 40, 39, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9,105,102, 32,115,101,108,102, 46,100,105,109, 32, 97,110,100, 32,115, 101,108,102, 46,100,105,109, 32,126, 61, 32, 39, 39, 32,116, 104,101,110, 10, 9, 32, 32,111,117,116,112,117,116, 40, 39, 32,105,102, 32, 40,116,111,108,117, 97, 95,105,110,100,101, 120, 60, 48, 32,124,124, 32,116,111,108,117, 97, 95,105,110, 100,101,120, 62, 61, 39, 46, 46,115,101,108,102, 46,100,105, 109, 46, 46, 39, 41, 39, 41, 10, 9,101,108,115,101, 10, 9, 32, 32,111,117,116,112,117,116, 40, 39, 32,105,102, 32, 40, 116,111,108,117, 97, 95,105,110,100,101,120, 60, 48, 41, 39, 41, 10, 9,101,110,100, 10, 32,111,117,116,112,117,116, 40, 39, 32, 32,116,111,108,117, 97, 95,101,114,114,111,114, 40, 116,111,108,117, 97, 95, 83, 44, 34, 97,114,114, 97,121, 32, 105,110,100,101,120,105,110,103, 32,111,117,116, 32,111,102, 32,114, 97,110,103,101, 46, 34, 44, 78, 85, 76, 76, 41, 59, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 35,101,110, 100,105,102, 92,110, 39, 41, 10, 10, 32, 45, 45, 32,114,101, 116,117,114,110, 32,118, 97,108,117,101, 10, 32,108,111, 99, 97,108, 32,116, 44, 99,116, 32, 61, 32,105,115, 98, 97,115, 105, 99, 40,115,101,108,102, 46,116,121,112,101, 41, 10, 32, 108,111, 99, 97,108, 32,112,117,115,104, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95,112,117,115,104, 95,102,117,110, 99,116,105,111,110, 40,116, 41, 10, 32,105,102, 32,116, 32, 116,104,101,110, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32,116,111,108,117, 97, 95,112,117,115,104, 39, 46, 46,116, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 40, 39, 44, 99,116, 44, 39, 41, 39, 46, 46,115,101,108,102, 58,103,101, 116,118, 97,108,117,101, 40, 99,108, 97,115,115, 44,115,116, 97,116,105, 99, 41, 46, 46, 39, 41, 59, 39, 41, 10, 32,101, 108,115,101, 10, 9, 9,116, 32, 61, 32,115,101,108,102, 46, 116,121,112,101, 10, 32, 32,105,102, 32,115,101,108,102, 46, 112,116,114, 32, 61, 61, 32, 39, 38, 39, 32,111,114, 32,115, 101,108,102, 46,112,116,114, 32, 61, 61, 32, 39, 39, 32,116, 104,101,110, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 39, 44,112,117,115,104, 95,102,117,110, 99, 44, 39, 40, 116,111,108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41, 38, 39, 46, 46,115,101,108,102, 58,103,101,116,118, 97,108, 117,101, 40, 99,108, 97,115,115, 44,115,116, 97,116,105, 99, 41, 46, 46, 39, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 32, 32,101,108,115,101, 10, 32, 32, 32,111,117,116, 112,117,116, 40, 39, 32, 39, 44,112,117,115,104, 95,102,117, 110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40,118, 111,105,100, 42, 41, 39, 46, 46,115,101,108,102, 58,103,101, 116,118, 97,108,117,101, 40, 99,108, 97,115,115, 44,115,116, 97,116,105, 99, 41, 46, 46, 39, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 32, 32,101,110,100, 10, 32,101,110, 100, 10, 32,111,117,116,112,117,116, 40, 39, 32,114,101,116, 117,114,110, 32, 49, 59, 39, 41, 10, 32,111,117,116,112,117, 116, 40, 39,125, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 35,101,110,100,105,102, 32, 47, 47, 35,105,102,110,100, 101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 92,110, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 92,110, 39, 41, 10, 10, 32, 45, 45, 32,115,101,116, 32,102, 117,110, 99,116,105,111,110, 32, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 32,105,102, 32,110,111,116, 32,115,116,114,102,105,110,100, 40,115,101, 108,102, 46,116,121,112,101, 44, 39, 99,111,110,115,116, 39, 41, 32,116,104,101,110, 10, 32, 32,105,102, 32, 99,108, 97, 115,115, 32,116,104,101,110, 10, 32, 32, 32,111,117,116,112, 117,116, 40, 34, 47, 42, 32,115,101,116, 32,102,117,110, 99, 116,105,111,110, 58, 34, 44,115,101,108,102, 46,110, 97,109, 101, 44, 34, 32,111,102, 32, 99,108, 97,115,115, 32, 34, 44, 99,108, 97,115,115, 44, 34, 32, 42, 47, 34, 41, 10, 32, 32, 101,108,115,101, 10, 32, 32, 32,111,117,116,112,117,116, 40, 34, 47, 42, 32,115,101,116, 32,102,117,110, 99,116,105,111, 110, 58, 34, 44,115,101,108,102, 46,110, 97,109,101, 44, 34, 32, 42, 47, 34, 41, 10, 32, 32,101,110,100, 10, 32, 32,115, 101,108,102, 46, 99,115,101,116,110, 97,109,101, 32, 61, 32, 115,101,108,102, 58, 99,102,117,110, 99,110, 97,109,101, 40, 34,116,111,108,117, 97, 95,115,101,116, 34, 41, 10, 32, 32, 111,117,116,112,117,116, 40, 34, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 95, 34, 46, 46,115,101,108,102, 46, 99,115,101,116,110, 97,109, 101, 41, 10, 32, 32,111,117,116,112,117,116, 40, 34, 92,110, 115,116, 97,116,105, 99, 32,105,110,116, 34, 44,115,101,108, 102, 46, 99,115,101,116,110, 97,109,101, 44, 34, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32,116,111,108,117, 97, 95, 83, 41, 34, 41, 10, 32, 32,111,117,116,112,117,116, 40, 34, 123, 34, 41, 10, 10, 32, 32, 45, 45, 32,100,101, 99,108, 97, 114,101, 32,105,110,100,101,120, 10, 32, 32,111,117,116,112, 117,116, 40, 39, 32,105,110,116, 32,116,111,108,117, 97, 95, 105,110,100,101,120, 59, 39, 41, 10, 10, 32, 32, 45, 45, 32, 100,101, 99,108, 97,114,101, 32,115,101,108,102, 44, 32,105, 102, 32,116,104,101, 32, 99, 97,115,101, 10, 32, 32,108,111, 99, 97,108, 32, 95, 44, 95, 44,115,116, 97,116,105, 99, 32, 61, 32,115,116,114,102,105,110,100, 40,115,101,108,102, 46, 109,111,100, 44, 39, 94, 37,115, 42, 40,115,116, 97,116,105, 99, 41, 39, 41, 10, 32, 32,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,116, 97,116,105, 99, 61, 61,110,105, 108, 32,116,104,101,110, 10, 32, 32, 32,111,117,116,112,117, 116, 40, 39, 32, 39, 44,115,101,108,102, 46,112, 97,114,101, 110,116, 46,116,121,112,101, 44, 39, 42, 39, 44, 39,115,101, 108,102, 59, 39, 41, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32,108,117, 97, 95,112,117,115,104,115,116,114,105, 110,103, 40,116,111,108,117, 97, 95, 83, 44, 34, 46,115,101, 108,102, 34, 41, 59, 39, 41, 10, 32, 32, 32,111,117,116,112, 117,116, 40, 39, 32,108,117, 97, 95,114, 97,119,103,101,116, 40,116,111,108,117, 97, 95, 83, 44, 49, 41, 59, 39, 41, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32,115,101,108, 102, 32, 61, 32, 39, 41, 10, 32, 32, 32,111,117,116,112,117, 116, 40, 39, 40, 39, 44,115,101,108,102, 46,112, 97,114,101, 110,116, 46,116,121,112,101, 44, 39, 42, 41, 32, 39, 41, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39,108,117, 97, 95, 116,111,117,115,101,114,100, 97,116, 97, 40,116,111,108,117, 97, 95, 83, 44, 45, 49, 41, 59, 39, 41, 10, 32, 32,101,108, 115,101,105,102, 32,115,116, 97,116,105, 99, 32,116,104,101, 110, 10, 32, 32, 32, 95, 44, 95, 44,115,101,108,102, 46,109, 111,100, 32, 61, 32,115,116,114,102,105,110,100, 40,115,101, 108,102, 46,109,111,100, 44, 39, 94, 37,115, 42,115,116, 97, 116,105, 99, 37,115, 37,115, 42, 40, 46, 42, 41, 39, 41, 10, 32, 32,101,110,100, 10, 10, 32, 32, 45, 45, 32, 99,104,101, 99,107, 32,105,110,100,101,120, 10, 9, 32,111,117,116,112, 117,116, 40, 39, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9, 32,111,117,116,112,117,116, 40, 39, 32,123, 39, 41, 10, 9, 32,111,117,116,112,117,116, 40, 39, 32, 32,116,111,108, 117, 97, 95, 69,114,114,111,114, 32,116,111,108,117, 97, 95, 101,114,114, 59, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32,105,102, 32, 40, 33,116,111,108,117, 97, 95, 105,115,110,117,109, 98,101,114, 40,116,111,108,117, 97, 95, 83, 44, 50, 44, 48, 44, 38,116,111,108,117, 97, 95,101,114, 114, 41, 41, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,116,111,108,117, 97, 95,101,114,114,111,114, 40,116,111,108,117, 97, 95, 83, 44, 34, 35,118,105,110,118, 97,108,105,100, 32,116,121,112,101, 32,105,110, 32, 97,114, 114, 97,121, 32,105,110,100,101,120,105,110,103, 46, 34, 44, 38,116,111,108,117, 97, 95,101,114,114, 41, 59, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39, 32,125, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39, 35,101,110,100,105, 102, 92,110, 39, 41, 10, 10, 9,105,102, 32,102,108, 97,103, 115, 91, 39, 49, 39, 93, 32,116,104,101,110, 32, 45, 45, 32, 102,111,114, 32, 99,111,109,112, 97,116,105, 98,105,108,105, 116,121, 32,119,105,116,104, 32,116,111,108,117, 97, 53, 32, 63, 10, 9, 9,111,117,116,112,117,116, 40, 39, 32,116,111, 108,117, 97, 95,105,110,100,101,120, 32, 61, 32, 40,105,110, 116, 41,116,111,108,117, 97, 95,116,111,110,117,109, 98,101, 114, 40,116,111,108,117, 97, 95, 83, 44, 50, 44, 48, 41, 45, 49, 59, 39, 41, 10, 9,101,108,115,101, 10, 9, 9,111,117, 116,112,117,116, 40, 39, 32,116,111,108,117, 97, 95,105,110, 100,101,120, 32, 61, 32, 40,105,110,116, 41,116,111,108,117, 97, 95,116,111,110,117,109, 98,101,114, 40,116,111,108,117, 97, 95, 83, 44, 50, 44, 48, 41, 59, 39, 41, 10, 9,101,110, 100, 10, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35,105, 102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9,105,102, 32,115,101, 108,102, 46,100,105,109, 32, 97,110,100, 32,115,101,108,102, 46,100,105,109, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 9, 32, 32,111,117,116,112,117,116, 40, 39, 32,105,102, 32, 40,116,111,108,117, 97, 95,105,110,100,101,120, 60, 48, 32,124,124, 32,116,111,108,117, 97, 95,105,110,100,101,120, 62, 61, 39, 46, 46,115,101,108,102, 46,100,105,109, 46, 46, 39, 41, 39, 41, 10, 9,101,108,115,101, 10, 9, 32, 32,111, 117,116,112,117,116, 40, 39, 32,105,102, 32, 40,116,111,108, 117, 97, 95,105,110,100,101,120, 60, 48, 41, 39, 41, 10, 9, 101,110,100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32,116,111,108,117, 97, 95,101,114,114,111,114, 40,116,111, 108,117, 97, 95, 83, 44, 34, 97,114,114, 97,121, 32,105,110, 100,101,120,105,110,103, 32,111,117,116, 32,111,102, 32,114, 97,110,103,101, 46, 34, 44, 78, 85, 76, 76, 41, 59, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39, 35,101,110,100, 105,102, 92,110, 39, 41, 10, 10, 32, 32, 45, 45, 32, 97,115, 115,105,103,110, 32,118, 97,108,117,101, 10, 32, 32,108,111, 99, 97,108, 32,112,116,114, 32, 61, 32, 39, 39, 10, 32, 32, 105,102, 32,115,101,108,102, 46,112,116,114,126, 61, 39, 39, 32,116,104,101,110, 32,112,116,114, 32, 61, 32, 39, 42, 39, 32,101,110,100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 39, 41, 10, 32, 32,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,116, 97,116,105, 99, 32,116,104,101,110, 10, 32, 32, 32,111,117,116,112,117,116, 40, 99,108, 97,115, 115, 46, 46, 39, 58, 58, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 91,116,111,108,117, 97, 95,105,110, 100,101,120, 93, 39, 41, 10, 32, 32,101,108,115,101,105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 10, 32, 32, 32, 111,117,116,112,117,116, 40, 39,115,101,108,102, 45, 62, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 91, 116,111,108,117, 97, 95,105,110,100,101,120, 93, 39, 41, 10, 32, 32,101,108,115,101, 10, 32, 32, 32,111,117,116,112,117, 116, 40,115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 91, 116,111,108,117, 97, 95,105,110,100,101,120, 93, 39, 41, 10, 32, 32,101,110,100, 10, 32, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,105,115, 98, 97,115,105, 99, 40,115,101,108,102, 46,116,121,112,101, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 61, 32, 39, 41, 10, 32, 32,105,102, 32,110,111, 116, 32,116, 32, 97,110,100, 32,112,116,114, 61, 61, 39, 39, 32,116,104,101,110, 32,111,117,116,112,117,116, 40, 39, 42, 39, 41, 32,101,110,100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 40, 40, 39, 44,115,101,108,102, 46,109,111,100, 44, 115,101,108,102, 46,116,121,112,101, 41, 10, 32, 32,105,102, 32,110,111,116, 32,116, 32,116,104,101,110, 10, 32, 32, 32, 111,117,116,112,117,116, 40, 39, 42, 39, 41, 10, 32, 32,101, 110,100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 41, 32, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,100,101,102, 32, 61, 32, 48, 10, 32, 32,105,102, 32,115,101,108,102, 46,100, 101,102, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 32,100, 101,102, 32, 61, 32,115,101,108,102, 46,100,101,102, 32,101, 110,100, 10, 32, 32,105,102, 32,116, 32,116,104,101,110, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39,116,111,108,117, 97, 95,116,111, 39, 46, 46,116, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 51, 44, 39, 44,100,101,102, 44, 39, 41, 41, 59, 39, 41, 10, 32, 32,101,108,115,101, 10, 32, 32, 32,108, 111, 99, 97,108, 32,116,111, 95,102,117,110, 99, 32, 61, 32, 103,101,116, 95,116,111, 95,102,117,110, 99,116,105,111,110, 40,115,101,108,102, 46,116,121,112,101, 41, 10, 32, 32, 32, 111,117,116,112,117,116, 40,116,111, 95,102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 51, 44, 39, 44,100, 101,102, 44, 39, 41, 41, 59, 39, 41, 10, 32, 32,101,110,100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32,114,101,116, 117,114,110, 32, 48, 59, 39, 41, 10, 32, 32,111,117,116,112, 117,116, 40, 39,125, 39, 41, 10, 32, 32,111,117,116,112,117, 116, 40, 39, 35,101,110,100,105,102, 32, 47, 47, 35,105,102, 110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 92,110, 39, 41, 10, 32, 32,111,117,116,112,117, 116, 40, 39, 92,110, 39, 41, 10, 32,101,110,100, 10, 10,101, 110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 65,114,114, 97,121, 58,114,101,103,105,115,116, 101,114, 32, 40,112,114,101, 41, 10, 9,105,102, 32,110,111, 116, 32,115,101,108,102, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 32,116, 104,101,110, 10, 9, 9,114,101,116,117,114,110, 10, 9,101, 110,100, 10, 10, 32,112,114,101, 32, 61, 32,112,114,101, 32, 111,114, 32, 39, 39, 10, 32,105,102, 32,115,101,108,102, 46, 99,115,101,116,110, 97,109,101, 32,116,104,101,110, 10, 32, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 39,116, 111,108,117, 97, 95, 97,114,114, 97,121, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101,108,102, 46,108,110, 97,109,101, 46, 46, 39, 34, 44, 39, 46, 46,115,101,108,102, 46, 99,103,101,116,110, 97,109,101, 46, 46, 39, 44, 39, 46, 46,115,101,108,102, 46, 99,115,101,116,110, 97,109,101, 46, 46, 39, 41, 59, 39, 41, 10, 32,101,108,115,101, 10, 32, 32, 111,117,116,112,117,116, 40,112,114,101, 46, 46, 39,116,111, 108,117, 97, 95, 97,114,114, 97,121, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101,108,102, 46,108,110, 97, 109,101, 46, 46, 39, 34, 44, 39, 46, 46,115,101,108,102, 46, 99,103,101,116,110, 97,109,101, 46, 46, 39, 44, 78, 85, 76, 76, 41, 59, 39, 41, 10, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99,111, 110,115,116,114,117, 99,116,111,114, 10,102,117,110, 99,116, 105,111,110, 32, 95, 65,114,114, 97,121, 32, 40,116, 41, 10, 32,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40,116, 44, 99,108, 97,115,115, 65,114,114, 97,121, 41, 10, 32, 97, 112,112,101,110,100, 40,116, 41, 10, 32,114,101,116,117,114, 110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110, 115,116,114,117, 99,116,111,114, 10, 45, 45, 32, 69,120,112, 101, 99,116,115, 32, 97, 32,115,116,114,105,110,103, 32,114, 101,112,114,101,115,101,110,116,105,110,103, 32,116,104,101, 32,118, 97,114,105, 97, 98,108,101, 32,100,101, 99,108, 97, 114, 97,116,105,111,110, 46, 10,102,117,110, 99,116,105,111, 110, 32, 65,114,114, 97,121, 32, 40,115, 41, 10, 32,114,101, 116,117,114,110, 32, 95, 65,114,114, 97,121, 32, 40, 68,101, 99,108, 97,114, 97,116,105,111,110, 40,115, 44, 39,118, 97, 114, 39, 41, 41, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/array.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114, 105,116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73, 100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99, 111,100,101, 32,105,115, 32,102,114,101,101, 32,115,111,102, 116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32, 114,101,100,105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32, 105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116, 119, 97,114,101, 32,112,114,111,118,105,100,101,100, 32,104, 101,114,101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105, 115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97, 117,116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98, 108,105,103, 97,116,105,111,110, 32,116,111, 32,112,114,111, 118,105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99, 101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99, 101,109,101,110,116,115, 44, 32,111,114, 32,109,111,100,105, 102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 10, 45, 45, 32, 70,117,110, 99,116,105,111,110, 32, 99,108, 97,115, 115, 10, 45, 45, 32, 82,101,112,114,101,115,101,110,116,115, 32, 97, 32,102,117,110, 99,116,105,111,110, 32,111,114, 32, 97, 32, 99,108, 97,115,115, 32,109,101,116,104,111,100, 46, 10, 45, 45, 32, 84,104,101, 32,102,111,108,108,111,119,105, 110,103, 32,102,105,101,108,100,115, 32, 97,114,101, 32,115, 116,111,114,101,100, 58, 10, 45, 45, 32, 32,109,111,100, 32, 32, 61, 32,116,121,112,101, 32,109,111,100,105,102,105,101, 114,115, 10, 45, 45, 32, 32,116,121,112,101, 32, 61, 32,116, 121,112,101, 10, 45, 45, 32, 32,112,116,114, 32, 32, 61, 32, 34, 42, 34, 32,111,114, 32, 34, 38, 34, 44, 32,105,102, 32, 114,101,112,114,101,115,101,110,116,105,110,103, 32, 97, 32, 112,111,105,110,116,101,114, 32,111,114, 32, 97, 32,114,101, 102,101,114,101,110, 99,101, 10, 45, 45, 32, 32,110, 97,109, 101, 32, 61, 32,110, 97,109,101, 10, 45, 45, 32, 32,108,110, 97,109,101, 32, 61, 32,108,117, 97, 32,110, 97,109,101, 10, 45, 45, 32, 32, 97,114,103,115, 32, 32, 61, 32,108,105,115, 116, 32,111,102, 32, 97,114,103,117,109,101,110,116, 32,100, 101, 99,108, 97,114, 97,116,105,111,110,115, 10, 45, 45, 32, 32, 99,111,110,115,116, 32, 61, 32,105,102, 32,105,116, 32, 105,115, 32, 97, 32,109,101,116,104,111,100, 32,114,101, 99, 101,105,118,105,110,103, 32, 97, 32, 99,111,110,115,116, 32, 34,116,104,105,115, 34, 46, 10, 99,108, 97,115,115, 70,117, 110, 99,116,105,111,110, 32, 61, 32,123, 10, 32,109,111,100, 32, 61, 32, 39, 39, 44, 10, 32,116,121,112,101, 32, 61, 32, 39, 39, 44, 10, 32,112,116,114, 32, 61, 32, 39, 39, 44, 10, 32,110, 97,109,101, 32, 61, 32, 39, 39, 44, 10, 32, 97,114, 103,115, 32, 61, 32,123,110, 61, 48,125, 44, 10, 32, 99,111, 110,115,116, 32, 61, 32, 39, 39, 44, 10,125, 10, 99,108, 97, 115,115, 70,117,110, 99,116,105,111,110, 46, 95, 95,105,110, 100,101,120, 32, 61, 32, 99,108, 97,115,115, 70,117,110, 99, 116,105,111,110, 10,115,101,116,109,101,116, 97,116, 97, 98, 108,101, 40, 99,108, 97,115,115, 70,117,110, 99,116,105,111, 110, 44, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 41, 10, 10, 45, 45, 32,100,101, 99,108, 97,114,101, 32,116, 97, 103,115, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97, 115,115, 70,117,110, 99,116,105,111,110, 58,100,101, 99,108, 116,121,112,101, 32, 40, 41, 10, 32,115,101,108,102, 46,116, 121,112,101, 32, 61, 32,116,121,112,101,118, 97,114, 40,115, 101,108,102, 46,116,121,112,101, 41, 10, 32,105,102, 32,115, 116,114,102,105,110,100, 40,115,101,108,102, 46,109,111,100, 44, 39, 99,111,110,115,116, 39, 41, 32,116,104,101,110, 10, 9, 32,115,101,108,102, 46,116,121,112,101, 32, 61, 32, 39, 99,111,110,115,116, 32, 39, 46, 46,115,101,108,102, 46,116, 121,112,101, 10, 9, 9,115,101,108,102, 46,109,111,100, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46,109,111,100, 44, 39, 99,111,110,115,116, 39, 44, 39, 39, 41, 10, 9,101, 110,100, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32, 119,104,105,108,101, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 32,100,111, 10, 32, 32,115,101,108,102, 46, 97, 114,103,115, 91,105, 93, 58,100,101, 99,108,116,121,112,101, 40, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101, 110,100, 10,101,110,100, 10, 10, 10, 45, 45, 32, 87,114,105, 116,101, 32, 98,105,110,100,105,110,103, 32,102,117,110, 99, 116,105,111,110, 10, 45, 45, 32, 79,117,116,112,117,116,115, 32, 67, 47, 67, 43, 43, 32, 98,105,110,100,105,110,103, 32, 102,117,110, 99,116,105,111,110, 46, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 70,117,110, 99,116,105, 111,110, 58,115,117,112, 99,111,100,101, 32, 40,108,111, 99, 97,108, 95, 99,111,110,115,116,114,117, 99,116,111,114, 41, 10, 10, 32,108,111, 99, 97,108, 32,111,118,101,114,108,111, 97,100, 32, 61, 32,115,116,114,115,117, 98, 40,115,101,108, 102, 46, 99,110, 97,109,101, 44, 45, 50, 44, 45, 49, 41, 32, 45, 32, 49, 32, 32, 45, 45, 32,105,110,100,105, 99, 97,116, 101, 32,111,118,101,114,108,111, 97,100,101,100, 32,102,117, 110, 99, 10, 32,108,111, 99, 97,108, 32,110,114,101,116, 32, 61, 32, 48, 32, 32, 32, 32, 32, 32, 45, 45, 32,110,117,109, 98,101,114, 32,111,102, 32,114,101,116,117,114,110,101,100, 32,118, 97,108,117,101,115, 10, 32,108,111, 99, 97,108, 32, 99,108, 97,115,115, 32, 61, 32,115,101,108,102, 58,105,110, 99,108, 97,115,115, 40, 41, 10, 32,108,111, 99, 97,108, 32, 95, 44, 95, 44,115,116, 97,116,105, 99, 32, 61, 32,115,116, 114,102,105,110,100, 40,115,101,108,102, 46,109,111,100, 44, 39, 94, 37,115, 42, 40,115,116, 97,116,105, 99, 41, 39, 41, 10, 32,105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 10, 10, 32, 9,105,102, 32,115,101,108,102, 46,110, 97,109, 101, 32, 61, 61, 32, 39,110,101,119, 39, 32, 97,110,100, 32, 115,101,108,102, 46,112, 97,114,101,110,116, 46,102,108, 97, 103,115, 46,112,117,114,101, 95,118,105,114,116,117, 97,108, 32,116,104,101,110, 10, 32, 9, 9, 45, 45, 32,110,111, 32, 99,111,110,115,116,114,117, 99,116,111,114, 32,102,111,114, 32, 99,108, 97,115,115,101,115, 32,119,105,116,104, 32,112, 117,114,101, 32,118,105,114,116,117, 97,108, 32,109,101,116, 104,111,100,115, 10, 32, 9, 9,114,101,116,117,114,110, 10, 32, 9,101,110,100, 10, 10, 32, 9,105,102, 32,108,111, 99, 97,108, 95, 99,111,110,115,116,114,117, 99,116,111,114, 32, 116,104,101,110, 10, 9, 9,111,117,116,112,117,116, 40, 34, 47, 42, 32,109,101,116,104,111,100, 58, 32,110,101,119, 95, 108,111, 99, 97,108, 32,111,102, 32, 99,108, 97,115,115, 32, 34, 44, 99,108, 97,115,115, 44, 34, 32, 42, 47, 34, 41, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,112,117,116, 40, 34, 47, 42, 32,109,101,116,104,111,100, 58, 34, 44,115,101, 108,102, 46,110, 97,109,101, 44, 34, 32,111,102, 32, 99,108, 97,115,115, 32, 34, 44, 99,108, 97,115,115, 44, 34, 32, 42, 47, 34, 41, 10, 9,101,110,100, 10, 32,101,108,115,101, 10, 32, 32,111,117,116,112,117,116, 40, 34, 47, 42, 32,102,117, 110, 99,116,105,111,110, 58, 34, 44,115,101,108,102, 46,110, 97,109,101, 44, 34, 32, 42, 47, 34, 41, 10, 32,101,110,100, 10, 10, 32,105,102, 32,108,111, 99, 97,108, 95, 99,111,110, 115,116,114,117, 99,116,111,114, 32,116,104,101,110, 10, 32, 32,111,117,116,112,117,116, 40, 34, 35,105,102,110,100,101, 102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 95, 34, 46, 46,115,101,108,102, 46, 99,110, 97,109,101, 46, 46, 34, 95,108,111, 99, 97,108, 34, 41, 10, 32, 32,111,117, 116,112,117,116, 40, 34, 92,110,115,116, 97,116,105, 99, 32, 105,110,116, 34, 44,115,101,108,102, 46, 99,110, 97,109,101, 46, 46, 34, 95,108,111, 99, 97,108, 34, 44, 34, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32,116,111,108,117, 97, 95, 83, 41, 34, 41, 10, 32,101,108,115,101, 10, 32, 32,111,117, 116,112,117,116, 40, 34, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 95, 34, 46, 46,115,101,108,102, 46, 99,110, 97,109,101, 41, 10, 32, 32, 111,117,116,112,117,116, 40, 34, 92,110,115,116, 97,116,105, 99, 32,105,110,116, 34, 44,115,101,108,102, 46, 99,110, 97, 109,101, 44, 34, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32,116,111,108,117, 97, 95, 83, 41, 34, 41, 10, 32,101,110, 100, 10, 32,111,117,116,112,117,116, 40, 34,123, 34, 41, 10, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,116,121,112,101, 115, 10, 9,105,102, 32,111,118,101,114,108,111, 97,100, 32, 60, 32, 48, 32,116,104,101,110, 10, 9, 32,111,117,116,112, 117,116, 40, 39, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9,101,110,100, 10, 9,111,117,116,112,117,116, 40, 39, 32, 116,111,108,117, 97, 95, 69,114,114,111,114, 32,116,111,108, 117, 97, 95,101,114,114, 59, 39, 41, 10, 32,111,117,116,112, 117,116, 40, 39, 32,105,102, 32, 40, 92,110, 39, 41, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,115,101,108,102, 10, 32, 108,111, 99, 97,108, 32,110, 97,114,103, 10, 32,105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 32,110, 97,114,103, 61, 50, 32,101,108,115,101, 32,110, 97,114,103, 61, 49, 32, 101,110,100, 10, 32,105,102, 32, 99,108, 97,115,115, 32,116, 104,101,110, 10, 9, 9,108,111, 99, 97,108, 32,102,117,110, 99, 32, 61, 32,103,101,116, 95,105,115, 95,102,117,110, 99, 116,105,111,110, 40,115,101,108,102, 46,112, 97,114,101,110, 116, 46,116,121,112,101, 41, 10, 9, 9,108,111, 99, 97,108, 32,116,121,112,101, 32, 61, 32,115,101,108,102, 46,112, 97, 114,101,110,116, 46,116,121,112,101, 10, 9, 9,105,102, 32, 115,101,108,102, 46,110, 97,109,101, 61, 61, 39,110,101,119, 39, 32,111,114, 32,115,116, 97,116,105, 99,126, 61,110,105, 108, 32,116,104,101,110, 10, 9, 9, 9,102,117,110, 99, 32, 61, 32, 39,116,111,108,117, 97, 95,105,115,117,115,101,114, 116, 97, 98,108,101, 39, 10, 9, 9, 9,116,121,112,101, 32, 61, 32,115,101,108,102, 46,112, 97,114,101,110,116, 46,116, 121,112,101, 10, 9, 9,101,110,100, 10, 9, 9,105,102, 32, 115,101,108,102, 46, 99,111,110,115,116, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 9, 9, 9,116,121,112,101, 32, 61, 32, 34, 99,111,110,115,116, 32, 34, 46, 46,116,121,112, 101, 10, 9, 9,101,110,100, 10, 9, 9,111,117,116,112,117, 116, 40, 39, 32, 32, 32, 32, 32, 33, 39, 46, 46,102,117,110, 99, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 49, 44, 34, 39, 46, 46,116,121,112,101, 46, 46, 39, 34, 44, 48, 44, 38,116,111,108,117, 97, 95,101,114,114, 41, 32,124,124, 92, 110, 39, 41, 10, 32,101,110,100, 10, 32, 45, 45, 32, 99,104, 101, 99,107, 32, 97,114,103,115, 10, 32,105,102, 32,115,101, 108,102, 46, 97,114,103,115, 91, 49, 93, 46,116,121,112,101, 32,126, 61, 32, 39,118,111,105,100, 39, 32,116,104,101,110, 10, 32, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32, 32, 119,104,105,108,101, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 32,100,111, 10, 32, 32, 32,108,111, 99, 97,108, 32, 98,116,121,112,101, 32, 61, 32,105,115, 98, 97,115,105, 99, 40,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 46, 116,121,112,101, 41, 10, 32, 32, 32,105,102, 32, 98,116,121, 112,101, 32,126, 61, 32, 39,118, 97,108,117,101, 39, 32, 97, 110,100, 32, 98,116,121,112,101, 32,126, 61, 32, 39,115,116, 97,116,101, 39, 32,116,104,101,110, 10, 32, 32, 32, 32,111, 117,116,112,117,116, 40, 39, 32, 32, 32, 32, 32, 39, 46, 46, 115,101,108,102, 46, 97,114,103,115, 91,105, 93, 58,111,117, 116, 99,104,101, 99,107,116,121,112,101, 40,110, 97,114,103, 41, 46, 46, 39, 32,124,124, 92,110, 39, 41, 10, 32, 32, 32, 101,110,100, 10, 32, 32, 32,105,102, 32, 98,116,121,112,101, 32,126, 61, 32, 39,115,116, 97,116,101, 39, 32,116,104,101, 110, 10, 9, 32, 32, 32,110, 97,114,103, 32, 61, 32,110, 97, 114,103, 43, 49, 10, 32, 32, 32,101,110,100, 10, 32, 32, 32, 105, 32, 61, 32,105, 43, 49, 10, 32, 32,101,110,100, 10, 32, 101,110,100, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,101, 110,100, 32,111,102, 32,108,105,115,116, 10, 32,111,117,116, 112,117,116, 40, 39, 32, 32, 32, 32, 32, 33,116,111,108,117, 97, 95,105,115,110,111,111, 98,106, 40,116,111,108,117, 97, 95, 83, 44, 39, 46, 46,110, 97,114,103, 46, 46, 39, 44, 38, 116,111,108,117, 97, 95,101,114,114, 41, 92,110, 32, 41, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 32, 32,103,111, 116,111, 32,116,111,108,117, 97, 95,108,101,114,114,111,114, 59, 39, 41, 10, 10, 32,111,117,116,112,117,116, 40, 39, 32, 101,108,115,101, 92,110, 39, 41, 10, 9,105,102, 32,111,118, 101,114,108,111, 97,100, 32, 60, 32, 48, 32,116,104,101,110, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35,101,110,100, 105,102, 92,110, 39, 41, 10, 9,101,110,100, 10, 9,111,117, 116,112,117,116, 40, 39, 32,123, 39, 41, 10, 10, 32, 45, 45, 32,100,101, 99,108, 97,114,101, 32,115,101,108,102, 44, 32, 105,102, 32,116,104,101, 32, 99, 97,115,101, 10, 32,108,111, 99, 97,108, 32,110, 97,114,103, 10, 32,105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 32,110, 97,114,103, 61, 50, 32,101,108,115,101, 32,110, 97,114,103, 61, 49, 32,101,110, 100, 10, 32,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,101,108,102, 46,110, 97,109,101,126, 61, 39,110,101, 119, 39, 32, 97,110,100, 32,115,116, 97,116,105, 99, 61, 61, 110,105,108, 32,116,104,101,110, 10, 32, 32,111,117,116,112, 117,116, 40, 39, 32, 39, 44,115,101,108,102, 46, 99,111,110, 115,116, 44,115,101,108,102, 46,112, 97,114,101,110,116, 46, 116,121,112,101, 44, 39, 42, 39, 44, 39,115,101,108,102, 32, 61, 32, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 40, 39, 44,115,101,108,102, 46, 99,111,110,115,116, 44,115, 101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 44, 39, 42, 41, 32, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,116,111, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95, 116,111, 95,102,117,110, 99,116,105,111,110, 40,115,101,108, 102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 41, 10, 32, 32,111,117,116,112,117,116, 40,116,111, 95,102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 49, 44, 48, 41, 59, 39, 41, 10, 32,101,108,115,101,105,102, 32,115,116, 97,116,105, 99, 32,116,104,101,110, 10, 32, 32, 95, 44, 95, 44,115,101,108,102, 46,109,111,100, 32, 61, 32,115,116,114, 102,105,110,100, 40,115,101,108,102, 46,109,111,100, 44, 39, 94, 37,115, 42,115,116, 97,116,105, 99, 37,115, 37,115, 42, 40, 46, 42, 41, 39, 41, 10, 32,101,110,100, 10, 32, 45, 45, 32,100,101, 99,108, 97,114,101, 32,112, 97,114, 97,109,101, 116,101,114,115, 10, 32,105,102, 32,115,101,108,102, 46, 97, 114,103,115, 91, 49, 93, 46,116,121,112,101, 32,126, 61, 32, 39,118,111,105,100, 39, 32,116,104,101,110, 10, 32, 32,108, 111, 99, 97,108, 32,105, 61, 49, 10, 32, 32,119,104,105,108, 101, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 32, 100,111, 10, 32, 32, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 58,100,101, 99,108, 97,114,101, 40,110, 97,114, 103, 41, 10, 32, 32, 32,105,102, 32,105,115, 98, 97,115,105, 99, 40,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 46, 116,121,112,101, 41, 32,126, 61, 32, 34,115,116, 97,116,101, 34, 32,116,104,101,110, 10, 9, 32, 32, 32,110, 97,114,103, 32, 61, 32,110, 97,114,103, 43, 49, 10, 32, 32, 32,101,110, 100, 10, 32, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32, 32, 101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 99, 104,101, 99,107, 32,115,101,108,102, 10, 32,105,102, 32, 99, 108, 97,115,115, 32, 97,110,100, 32,115,101,108,102, 46,110, 97,109,101,126, 61, 39,110,101,119, 39, 32, 97,110,100, 32, 115,116, 97,116,105, 99, 61, 61,110,105,108, 32,116,104,101, 110, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35,105,102, 110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9, 32,111,117,116,112,117, 116, 40, 39, 32, 32,105,102, 32, 40, 33,115,101,108,102, 41, 32,116,111,108,117, 97, 95,101,114,114,111,114, 40,116,111, 108,117, 97, 95, 83, 44, 34, 39, 46, 46,111,117,116,112,117, 116, 95,101,114,114,111,114, 95,104,111,111,107, 40, 34,105, 110,118, 97,108,105,100, 32, 92, 39,115,101,108,102, 92, 39, 32,105,110, 32,102,117,110, 99,116,105,111,110, 32, 92, 39, 37,115, 92, 39, 34, 44, 32,115,101,108,102, 46,110, 97,109, 101, 41, 46, 46, 39, 34, 44, 32, 78, 85, 76, 76, 41, 59, 39, 41, 59, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35,101, 110,100,105,102, 92,110, 39, 41, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,103,101,116, 32, 97,114,114, 97,121, 32,101, 108,101,109,101,110,116, 32,118, 97,108,117,101,115, 10, 32, 105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 32,110, 97,114,103, 61, 50, 32,101,108,115,101, 32,110, 97,114,103, 61, 49, 32,101,110,100, 10, 32,105,102, 32,115,101,108,102, 46, 97,114,103,115, 91, 49, 93, 46,116,121,112,101, 32,126, 61, 32, 39,118,111,105,100, 39, 32,116,104,101,110, 10, 32, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32, 32,119,104, 105,108,101, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 32,100,111, 10, 32, 32, 32,115,101,108,102, 46, 97,114, 103,115, 91,105, 93, 58,103,101,116, 97,114,114, 97,121, 40, 110, 97,114,103, 41, 10, 32, 32, 32,110, 97,114,103, 32, 61, 32,110, 97,114,103, 43, 49, 10, 32, 32, 32,105, 32, 61, 32, 105, 43, 49, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32,112,114,101, 95, 99, 97,108,108, 95,104,111,111,107, 40,115,101,108,102, 41, 10, 10, 32,108,111, 99, 97,108, 32, 111,117,116, 32, 61, 32,115,116,114,105,110,103, 46,102,105, 110,100, 40,115,101,108,102, 46,109,111,100, 44, 32, 34,116, 111,108,117, 97, 95,111,117,116,115,105,100,101, 34, 41, 10, 32, 45, 45, 32, 99, 97,108,108, 32,102,117,110, 99,116,105, 111,110, 10, 32,105,102, 32, 99,108, 97,115,115, 32, 97,110, 100, 32,115,101,108,102, 46,110, 97,109,101, 61, 61, 39,100, 101,108,101,116,101, 39, 32,116,104,101,110, 10, 32, 32,111, 117,116,112,117,116, 40, 39, 32, 32, 77,116,111,108,117, 97, 95,100,101,108,101,116,101, 40,115,101,108,102, 41, 59, 39, 41, 10, 32,101,108,115,101,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,101,108,102, 46,110, 97,109,101, 32, 61, 61, 32, 39,111,112,101,114, 97,116,111,114, 38, 91, 93, 39, 32,116,104,101,110, 10, 32, 32,105,102, 32,102,108, 97, 103,115, 91, 39, 49, 39, 93, 32,116,104,101,110, 32, 45, 45, 32,102,111,114, 32, 99,111,109,112, 97,116,105, 98,105,108, 105,116,121, 32,119,105,116,104, 32,116,111,108,117, 97, 53, 32, 63, 10, 9,111,117,116,112,117,116, 40, 39, 32, 32,115, 101,108,102, 45, 62,111,112,101,114, 97,116,111,114, 91, 93, 40, 39, 44,115,101,108,102, 46, 97,114,103,115, 91, 49, 93, 46,110, 97,109,101, 44, 39, 45, 49, 41, 32, 61, 32, 39, 44, 115,101,108,102, 46, 97,114,103,115, 91, 50, 93, 46,110, 97, 109,101, 44, 39, 59, 39, 41, 10, 32, 32,101,108,115,101, 10, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32,115, 101,108,102, 45, 62,111,112,101,114, 97,116,111,114, 91, 93, 40, 39, 44,115,101,108,102, 46, 97,114,103,115, 91, 49, 93, 46,110, 97,109,101, 44, 39, 41, 32, 61, 32, 39, 44,115,101, 108,102, 46, 97,114,103,115, 91, 50, 93, 46,110, 97,109,101, 44, 39, 59, 39, 41, 10, 32, 32,101,110,100, 10, 32,101,108, 115,101, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 123, 39, 41, 10, 32, 32,105,102, 32,115,101,108,102, 46,116, 121,112,101, 32,126, 61, 32, 39, 39, 32, 97,110,100, 32,115, 101,108,102, 46,116,121,112,101, 32,126, 61, 32, 39,118,111, 105,100, 39, 32,116,104,101,110, 10, 32, 32, 32,111,117,116, 112,117,116, 40, 39, 32, 32, 39, 44,115,101,108,102, 46,109, 111,100, 44,115,101,108,102, 46,116,121,112,101, 44,115,101, 108,102, 46,112,116,114, 44, 39,116,111,108,117, 97, 95,114, 101,116, 32, 61, 32, 39, 41, 10, 32, 32, 32,111,117,116,112, 117,116, 40, 39, 40, 39, 44,115,101,108,102, 46,109,111,100, 44,115,101,108,102, 46,116,121,112,101, 44,115,101,108,102, 46,112,116,114, 44, 39, 41, 32, 39, 41, 10, 32, 32,101,108, 115,101, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 39, 41, 10, 32, 32,101,110,100, 10, 32, 32,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,101,108,102, 46, 110, 97,109,101, 61, 61, 39,110,101,119, 39, 32,116,104,101, 110, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 77,116, 111,108,117, 97, 95,110,101,119, 40, 40, 39, 44,115,101,108, 102, 46,116,121,112,101, 44, 39, 41, 40, 39, 41, 10, 32, 32, 101,108,115,101,105,102, 32, 99,108, 97,115,115, 32, 97,110, 100, 32,115,116, 97,116,105, 99, 32,116,104,101,110, 10, 9, 105,102, 32,111,117,116, 32,116,104,101,110, 10, 9, 9,111, 117,116,112,117,116, 40,115,101,108,102, 46,110, 97,109,101, 44, 39, 40, 39, 41, 10, 9,101,108,115,101, 10, 9, 9,111, 117,116,112,117,116, 40, 99,108, 97,115,115, 46, 46, 39, 58, 58, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 44, 39, 40, 39, 41, 10, 9,101,110,100, 10, 32, 32,101,108,115,101, 105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 10, 9, 105,102, 32,111,117,116, 32,116,104,101,110, 10, 9, 9,111, 117,116,112,117,116, 40,115,101,108,102, 46,110, 97,109,101, 44, 39, 40, 39, 41, 10, 9,101,108,115,101, 10, 9, 32, 32, 105,102, 32,115,101,108,102, 46, 99, 97,115,116, 95,111,112, 101,114, 97,116,111,114, 32,116,104,101,110, 10, 9, 32, 32, 9, 45, 45,111,117,116,112,117,116, 40, 39,115,116, 97,116, 105, 99, 95, 99, 97,115,116, 60, 39, 44,115,101,108,102, 46, 109,111,100, 44,115,101,108,102, 46,116,121,112,101, 44,115, 101,108,102, 46,112,116,114, 44, 39, 32, 62, 40, 42,115,101, 108,102, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39, 115,101,108,102, 45, 62,111,112,101,114, 97,116,111,114, 32, 39, 44,115,101,108,102, 46,109,111,100, 44,115,101,108,102, 46,116,121,112,101, 44, 39, 40, 39, 41, 10, 9, 32, 32,101, 108,115,101, 10, 9, 9,111,117,116,112,117,116, 40, 39,115, 101,108,102, 45, 62, 39, 46, 46,115,101,108,102, 46,110, 97, 109,101, 44, 39, 40, 39, 41, 10, 9, 32, 32,101,110,100, 10, 9,101,110,100, 10, 32, 32,101,108,115,101, 10, 32, 32, 32, 111,117,116,112,117,116, 40,115,101,108,102, 46,110, 97,109, 101, 44, 39, 40, 39, 41, 10, 32, 32,101,110,100, 10, 10, 32, 32,105,102, 32,111,117,116, 32, 97,110,100, 32,110,111,116, 32,115,116, 97,116,105, 99, 32,116,104,101,110, 10, 32, 32, 9,111,117,116,112,117,116, 40, 39,115,101,108,102, 39, 41, 10, 9,105,102, 32,115,101,108,102, 46, 97,114,103,115, 91, 49, 93, 32, 97,110,100, 32,115,101,108,102, 46, 97,114,103, 115, 91, 49, 93, 46,110, 97,109,101, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 9, 9,111,117,116,112,117,116, 40, 39, 44, 39, 41, 10, 9,101,110,100, 10, 32, 32,101,110,100, 10, 32, 32, 45, 45, 32,119,114,105,116,101, 32,112, 97,114, 97,109,101,116,101,114,115, 10, 32, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32, 32,119,104,105,108,101, 32,115,101, 108,102, 46, 97,114,103,115, 91,105, 93, 32,100,111, 10, 32, 32, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 58, 112, 97,115,115,112, 97,114, 40, 41, 10, 32, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32, 32, 32,105,102, 32,115,101,108, 102, 46, 97,114,103,115, 91,105, 93, 32,116,104,101,110, 10, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 44, 39, 41, 10, 32, 32, 32,101,110,100, 10, 32, 32,101,110,100, 10, 10, 32, 32,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32, 115,101,108,102, 46,110, 97,109,101, 32, 61, 61, 32, 39,111, 112,101,114, 97,116,111,114, 91, 93, 39, 32, 97,110,100, 32, 102,108, 97,103,115, 91, 39, 49, 39, 93, 32,116,104,101,110, 10, 9,111,117,116,112,117,116, 40, 39, 45, 49, 41, 59, 39, 41, 10, 32, 32,101,108,115,101, 10, 9,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,101,108,102, 46,110, 97, 109,101, 61, 61, 39,110,101,119, 39, 32,116,104,101,110, 10, 9, 9,111,117,116,112,117,116, 40, 39, 41, 41, 59, 39, 41, 32, 45, 45, 32, 99,108,111,115,101, 32, 77,116,111,108,117, 97, 95,110,101,119, 40, 10, 9,101,108,115,101, 10, 9, 9, 111,117,116,112,117,116, 40, 39, 41, 59, 39, 41, 10, 9,101, 110,100, 10, 32, 32,101,110,100, 10, 10, 32, 32, 45, 45, 32, 114,101,116,117,114,110, 32,118, 97,108,117,101,115, 10, 32, 32,105,102, 32,115,101,108,102, 46,116,121,112,101, 32,126, 61, 32, 39, 39, 32, 97,110,100, 32,115,101,108,102, 46,116, 121,112,101, 32,126, 61, 32, 39,118,111,105,100, 39, 32,116, 104,101,110, 10, 32, 32, 32,110,114,101,116, 32, 61, 32,110, 114,101,116, 32, 43, 32, 49, 10, 32, 32, 32,108,111, 99, 97, 108, 32,116, 44, 99,116, 32, 61, 32,105,115, 98, 97,115,105, 99, 40,115,101,108,102, 46,116,121,112,101, 41, 10, 32, 32, 32,105,102, 32,116, 32, 97,110,100, 32,115,101,108,102, 46, 110, 97,109,101, 32,126, 61, 32, 34,110,101,119, 34, 32,116, 104,101,110, 10, 32, 32, 32, 9,105,102, 32,115,101,108,102, 46, 99, 97,115,116, 95,111,112,101,114, 97,116,111,114, 32, 97,110,100, 32, 95, 98, 97,115,105, 99, 95,114, 97,119, 95, 112,117,115,104, 91,116, 93, 32,116,104,101,110, 10, 9, 9, 111,117,116,112,117,116, 40, 39, 32, 32, 32, 39, 44, 95, 98, 97,115,105, 99, 95,114, 97,119, 95,112,117,115,104, 91,116, 93, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40, 39, 44, 99,116, 44, 39, 41,116,111,108,117, 97, 95,114,101,116, 41, 59, 39, 41, 10, 32, 32, 32, 9,101,108,115,101, 10, 9, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,116, 111,108,117, 97, 95,112,117,115,104, 39, 46, 46,116, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 40, 39, 44, 99,116, 44, 39, 41,116,111,108,117, 97, 95,114,101,116, 41, 59, 39, 41, 10, 9,101,110,100, 10, 32, 32, 32,101,108,115,101, 10, 9,116, 32, 61, 32,115,101,108,102, 46,116,121,112,101, 10, 9,110,101,119, 95,116, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,116, 44, 32, 34, 99,111,110,115,116, 37,115, 43, 34, 44, 32, 34, 34, 41, 10, 9,108,111, 99, 97, 108, 32,111,119,110,101,100, 32, 61, 32,102, 97,108,115,101, 10, 9,105,102, 32,115,116,114,105,110,103, 46,102,105,110, 100, 40,115,101,108,102, 46,109,111,100, 44, 32, 34,116,111, 108,117, 97, 95,111,119,110,101,100, 34, 41, 32,116,104,101, 110, 10, 9, 9,111,119,110,101,100, 32, 61, 32,116,114,117, 101, 10, 9,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97, 108, 32,112,117,115,104, 95,102,117,110, 99, 32, 61, 32,103, 101,116, 95,112,117,115,104, 95,102,117,110, 99,116,105,111, 110, 40,116, 41, 10, 32, 32, 32, 32,105,102, 32,115,101,108, 102, 46,112,116,114, 32, 61, 61, 32, 39, 39, 32,116,104,101, 110, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,123, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116, 112,117,116, 40, 39, 35,105,102,100,101,102, 32, 95, 95, 99, 112,108,117,115,112,108,117,115, 92,110, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32, 118,111,105,100, 42, 32,116,111,108,117, 97, 95,111, 98,106, 32, 61, 32, 77,116,111,108,117, 97, 95,110,101,119, 40, 40, 39, 44,110,101,119, 95,116, 44, 39, 41, 40,116,111,108,117, 97, 95,114,101,116, 41, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32, 39, 44, 112,117,115,104, 95,102,117,110, 99, 44, 39, 40,116,111,108, 117, 97, 95, 83, 44,116,111,108,117, 97, 95,111, 98,106, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,116, 111,108,117, 97, 95,114,101,103,105,115,116,101,114, 95,103, 99, 40,116,111,108,117, 97, 95, 83, 44,108,117, 97, 95,103, 101,116,116,111,112, 40,116,111,108,117, 97, 95, 83, 41, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 35,101,108,115,101, 92,110, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,118, 111,105,100, 42, 32,116,111,108,117, 97, 95,111, 98,106, 32, 61, 32,116,111,108,117, 97, 95, 99,111,112,121, 40,116,111, 108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41, 38,116, 111,108,117, 97, 95,114,101,116, 44,115,105,122,101,111,102, 40, 39, 44,116, 44, 39, 41, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32, 39, 44,112,117,115,104, 95,102,117,110, 99, 44, 39, 40,116,111, 108,117, 97, 95, 83, 44,116,111,108,117, 97, 95,111, 98,106, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32, 116,111,108,117, 97, 95,114,101,103,105,115,116,101,114, 95, 103, 99, 40,116,111,108,117, 97, 95, 83, 44,108,117, 97, 95, 103,101,116,116,111,112, 40,116,111,108,117, 97, 95, 83, 41, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117, 116, 40, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 125, 39, 41, 10, 32, 32, 32, 32,101,108,115,101,105,102, 32, 115,101,108,102, 46,112,116,114, 32, 61, 61, 32, 39, 38, 39, 32,116,104,101,110, 10, 32, 32, 32, 32, 32,111,117,116,112, 117,116, 40, 39, 32, 32, 32, 39, 44,112,117,115,104, 95,102, 117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40, 118,111,105,100, 42, 41, 38,116,111,108,117, 97, 95,114,101, 116, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 32, 32, 32, 32,101,108,115,101, 10, 9, 32,111,117,116,112,117, 116, 40, 39, 32, 32, 32, 39, 44,112,117,115,104, 95,102,117, 110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40,118, 111,105,100, 42, 41,116,111,108,117, 97, 95,114,101,116, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 9, 32,105, 102, 32,111,119,110,101,100, 32,111,114, 32,108,111, 99, 97, 108, 95, 99,111,110,115,116,114,117, 99,116,111,114, 32,116, 104,101,110, 10, 32, 32, 32, 32, 32, 32,111,117,116,112,117, 116, 40, 39, 32, 32, 32, 32,116,111,108,117, 97, 95,114,101, 103,105,115,116,101,114, 95,103, 99, 40,116,111,108,117, 97, 95, 83, 44,108,117, 97, 95,103,101,116,116,111,112, 40,116, 111,108,117, 97, 95, 83, 41, 41, 59, 39, 41, 10, 9, 32,101, 110,100, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32,101, 110,100, 10, 32, 32,101,110,100, 10, 32, 32,108,111, 99, 97, 108, 32,105, 61, 49, 10, 32, 32,119,104,105,108,101, 32,115, 101,108,102, 46, 97,114,103,115, 91,105, 93, 32,100,111, 10, 32, 32, 32,110,114,101,116, 32, 61, 32,110,114,101,116, 32, 43, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 58, 114,101,116,118, 97,108,117,101, 40, 41, 10, 32, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32, 32,101,110,100, 10, 32, 32, 111,117,116,112,117,116, 40, 39, 32, 32,125, 39, 41, 10, 10, 32, 32, 45, 45, 32,115,101,116, 32, 97,114,114, 97,121, 32, 101,108,101,109,101,110,116, 32,118, 97,108,117,101,115, 10, 32, 32,105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 32,110, 97,114,103, 61, 50, 32,101,108,115,101, 32,110, 97, 114,103, 61, 49, 32,101,110,100, 10, 32, 32,105,102, 32,115, 101,108,102, 46, 97,114,103,115, 91, 49, 93, 46,116,121,112, 101, 32,126, 61, 32, 39,118,111,105,100, 39, 32,116,104,101, 110, 10, 32, 32, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32, 32, 32,119,104,105,108,101, 32,115,101,108,102, 46, 97, 114,103,115, 91,105, 93, 32,100,111, 10, 32, 32, 32, 32,115, 101,108,102, 46, 97,114,103,115, 91,105, 93, 58,115,101,116, 97,114,114, 97,121, 40,110, 97,114,103, 41, 10, 32, 32, 32, 32,110, 97,114,103, 32, 61, 32,110, 97,114,103, 43, 49, 10, 32, 32, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32, 32, 32, 101,110,100, 10, 32, 32,101,110,100, 10, 10, 32, 32, 45, 45, 32,102,114,101,101, 32,100,121,110, 97,109,105, 99, 97,108, 108,121, 32, 97,108,108,111, 99, 97,116,101,100, 32, 97,114, 114, 97,121, 10, 32, 32,105,102, 32,115,101,108,102, 46, 97, 114,103,115, 91, 49, 93, 46,116,121,112,101, 32,126, 61, 32, 39,118,111,105,100, 39, 32,116,104,101,110, 10, 32, 32, 32, 108,111, 99, 97,108, 32,105, 61, 49, 10, 32, 32, 32,119,104, 105,108,101, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 32,100,111, 10, 32, 32, 32, 32,115,101,108,102, 46, 97, 114,103,115, 91,105, 93, 58,102,114,101,101, 97,114,114, 97, 121, 40, 41, 10, 32, 32, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32, 32, 32,101,110,100, 10, 32, 32,101,110,100, 10, 32, 101,110,100, 10, 10, 32,112,111,115,116, 95, 99, 97,108,108, 95,104,111,111,107, 40,115,101,108,102, 41, 10, 10, 32,111, 117,116,112,117,116, 40, 39, 32,125, 39, 41, 10, 32,111,117, 116,112,117,116, 40, 39, 32,114,101,116,117,114,110, 32, 39, 46, 46,110,114,101,116, 46, 46, 39, 59, 39, 41, 10, 10, 32, 45, 45, 32, 99, 97,108,108, 32,111,118,101,114,108,111, 97, 100,101,100, 32,102,117,110, 99,116,105,111,110, 32,111,114, 32,103,101,110,101,114, 97,116,101, 32,101,114,114,111,114, 10, 9,105,102, 32,111,118,101,114,108,111, 97,100, 32, 60, 32, 48, 32,116,104,101,110, 10, 10, 9, 9,111,117,116,112, 117,116, 40, 39, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39,116,111,108,117, 97, 95,108,101,114,114,111,114, 58, 92,110, 39, 41, 10, 9, 9, 111,117,116,112,117,116, 40, 39, 32,116,111,108,117, 97, 95, 101,114,114,111,114, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,111,117,116,112,117,116, 95,101,114,114,111,114, 95,104,111,111,107, 40, 34, 35,102,101,114,114,111,114, 32, 105,110, 32,102,117,110, 99,116,105,111,110, 32, 92, 39, 37, 115, 92, 39, 46, 34, 44, 32,115,101,108,102, 46,108,110, 97, 109,101, 41, 46, 46, 39, 34, 44, 38,116,111,108,117, 97, 95, 101,114,114, 41, 59, 39, 41, 10, 9, 9,111,117,116,112,117, 116, 40, 39, 32,114,101,116,117,114,110, 32, 48, 59, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39, 35,101,110,100, 105,102, 92,110, 39, 41, 10, 9,101,108,115,101, 10, 9, 9, 108,111, 99, 97,108, 32, 95,108,111, 99, 97,108, 32, 61, 32, 34, 34, 10, 9, 9,105,102, 32,108,111, 99, 97,108, 95, 99, 111,110,115,116,114,117, 99,116,111,114, 32,116,104,101,110, 10, 9, 9, 9, 95,108,111, 99, 97,108, 32, 61, 32, 34, 95, 108,111, 99, 97,108, 34, 10, 9, 9,101,110,100, 10, 9, 9, 111,117,116,112,117,116, 40, 39,116,111,108,117, 97, 95,108, 101,114,114,111,114, 58, 92,110, 39, 41, 10, 9, 9,111,117, 116,112,117,116, 40, 39, 32,114,101,116,117,114,110, 32, 39, 46, 46,115,116,114,115,117, 98, 40,115,101,108,102, 46, 99, 110, 97,109,101, 44, 49, 44, 45, 51, 41, 46, 46,102,111,114, 109, 97,116, 40, 34, 37, 48, 50,100, 34, 44,111,118,101,114, 108,111, 97,100, 41, 46, 46, 95,108,111, 99, 97,108, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 41, 59, 39, 41, 10, 9, 101,110,100, 10, 32,111,117,116,112,117,116, 40, 39,125, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 35,101,110,100, 105,102, 32, 47, 47, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 92,110, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 92,110, 39, 41, 10, 10, 9, 45, 45, 32,114,101, 99,117,114,115,105,118,101, 32, 99, 97,108,108, 32,116,111, 32,119,114,105,116,101, 32,108, 111, 99, 97,108, 32, 99,111,110,115,116,114,117, 99,116,111, 114, 10, 9,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,101,108,102, 46,110, 97,109,101, 61, 61, 39,110,101, 119, 39, 32, 97,110,100, 32,110,111,116, 32,108,111, 99, 97, 108, 95, 99,111,110,115,116,114,117, 99,116,111,114, 32,116, 104,101,110, 10, 10, 9, 9,115,101,108,102, 58,115,117,112, 99,111,100,101, 40, 49, 41, 10, 9,101,110,100, 10, 10,101, 110,100, 10, 10, 10, 45, 45, 32,114,101,103,105,115,116,101, 114, 32,102,117,110, 99,116,105,111,110, 10,102,117,110, 99, 116,105,111,110, 32, 99,108, 97,115,115, 70,117,110, 99,116, 105,111,110, 58,114,101,103,105,115,116,101,114, 32, 40,112, 114,101, 41, 10, 10, 9,105,102, 32,110,111,116, 32,115,101, 108,102, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 32,116,104,101,110, 10, 9, 9,114,101,116,117,114,110, 10, 9,101,110,100, 10, 10, 32, 9,105,102, 32,115,101,108,102, 46,110, 97,109,101, 32, 61, 61, 32, 39,110,101,119, 39, 32, 97,110,100, 32,115,101, 108,102, 46,112, 97,114,101,110,116, 46,102,108, 97,103,115, 46,112,117,114,101, 95,118,105,114,116,117, 97,108, 32,116, 104,101,110, 10, 32, 9, 9, 45, 45, 32,110,111, 32, 99,111, 110,115,116,114,117, 99,116,111,114, 32,102,111,114, 32, 99, 108, 97,115,115,101,115, 32,119,105,116,104, 32,112,117,114, 101, 32,118,105,114,116,117, 97,108, 32,109,101,116,104,111, 100,115, 10, 32, 9, 9,114,101,116,117,114,110, 10, 32, 9, 101,110,100, 10, 10, 32,111,117,116,112,117,116, 40,112,114, 101, 46, 46, 39,116,111,108,117, 97, 95,102,117,110, 99,116, 105,111,110, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101,108,102, 46,108,110, 97,109,101, 46, 46, 39, 34, 44, 39, 46, 46,115,101,108,102, 46, 99,110, 97,109,101, 46, 46, 39, 41, 59, 39, 41, 10, 32, 32,105,102, 32,115,101,108, 102, 46,110, 97,109,101, 32, 61, 61, 32, 39,110,101,119, 39, 32,116,104,101,110, 10, 9, 32, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 39,116,111,108,117, 97, 95,102,117, 110, 99,116,105,111,110, 40,116,111,108,117, 97, 95, 83, 44, 34,110,101,119, 95,108,111, 99, 97,108, 34, 44, 39, 46, 46, 115,101,108,102, 46, 99,110, 97,109,101, 46, 46, 39, 95,108, 111, 99, 97,108, 41, 59, 39, 41, 10, 9, 32, 32,111,117,116, 112,117,116, 40,112,114,101, 46, 46, 39,116,111,108,117, 97, 95,102,117,110, 99,116,105,111,110, 40,116,111,108,117, 97, 95, 83, 44, 34, 46, 99, 97,108,108, 34, 44, 39, 46, 46,115, 101,108,102, 46, 99,110, 97,109,101, 46, 46, 39, 95,108,111, 99, 97,108, 41, 59, 39, 41, 10, 9, 32, 32, 45, 45,111,117, 116,112,117,116, 40, 39, 32,116,111,108,117, 97, 95,115,101, 116, 95, 99, 97,108,108, 95,101,118,101,110,116, 40,116,111, 108,117, 97, 95, 83, 44, 39, 46, 46,115,101,108,102, 46, 99, 110, 97,109,101, 46, 46, 39, 95,108,111, 99, 97,108, 44, 32, 34, 39, 46, 46,115,101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 46, 46, 39, 34, 41, 59, 39, 41, 10, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 80,114, 105,110,116, 32,109,101,116,104,111,100, 10,102,117,110, 99, 116,105,111,110, 32, 99,108, 97,115,115, 70,117,110, 99,116, 105,111,110, 58,112,114,105,110,116, 32, 40,105,100,101,110, 116, 44, 99,108,111,115,101, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 70,117,110, 99,116,105, 111,110,123, 34, 41, 10, 32,112,114,105,110,116, 40,105,100, 101,110,116, 46, 46, 34, 32,109,111,100, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,109,111,100, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110, 116, 46, 46, 34, 32,116,121,112,101, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,116,121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,112,116,114, 32, 32, 61, 32, 39, 34, 46, 46, 115,101,108,102, 46,112,116,114, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101, 108,102, 46,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,108,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101, 108,102, 46,108,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 99,111,110,115,116, 32, 61, 32, 39, 34, 46, 46,115, 101,108,102, 46, 99,111,110,115,116, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 99,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46, 115,101,108,102, 46, 99,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,108,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,108,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110, 116, 46, 46, 34, 32, 97,114,103,115, 32, 61, 32,123, 34, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104, 105,108,101, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 32,100,111, 10, 32, 32,115,101,108,102, 46, 97,114,103, 115, 91,105, 93, 58,112,114,105,110,116, 40,105,100,101,110, 116, 46, 46, 34, 32, 32, 34, 44, 34, 44, 34, 41, 10, 32, 32, 105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,112, 114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,125, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34,125, 34, 46, 46, 99,108,111,115,101, 41, 10,101, 110,100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32,105,116, 32,114,101,116,117,114,110,115, 32, 97,110, 32, 111, 98,106,101, 99,116, 32, 98,121, 32,118, 97,108,117,101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 70,117,110, 99,116,105,111,110, 58,114,101,113,117,105,114, 101, 99,111,108,108,101, 99,116,105,111,110, 32, 40,116, 41, 10, 9,108,111, 99, 97,108, 32,114, 32, 61, 32,102, 97,108, 115,101, 10, 9,105,102, 32,115,101,108,102, 46,116,121,112, 101, 32,126, 61, 32, 39, 39, 32, 97,110,100, 32,110,111,116, 32,105,115, 98, 97,115,105, 99, 40,115,101,108,102, 46,116, 121,112,101, 41, 32, 97,110,100, 32,115,101,108,102, 46,112, 116,114, 61, 61, 39, 39, 32,116,104,101,110, 10, 9, 9,108, 111, 99, 97,108, 32,116,121,112,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46,116,121,112,101, 44, 34, 37,115, 42, 99,111,110,115,116, 37,115, 43, 34, 44, 34, 34, 41, 10, 9, 32,116, 91,116,121,112,101, 93, 32, 61, 32, 34,116,111, 108,117, 97, 95, 99,111,108,108,101, 99,116, 95, 34, 32, 46, 46, 32, 99,108,101, 97,110, 95,116,101,109,112,108, 97,116, 101, 40,116,121,112,101, 41, 10, 9, 32,114, 32, 61, 32,116, 114,117,101, 10, 9,101,110,100, 10, 9,108,111, 99, 97,108, 32,105, 61, 49, 10, 9,119,104,105,108,101, 32,115,101,108, 102, 46, 97,114,103,115, 91,105, 93, 32,100,111, 10, 9, 9, 114, 32, 61, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 58,114,101,113,117,105,114,101, 99,111,108,108,101, 99, 116,105,111,110, 40,116, 41, 32,111,114, 32,114, 10, 9, 9, 105, 32, 61, 32,105, 43, 49, 10, 9,101,110,100, 10, 9,114, 101,116,117,114,110, 32,114, 10,101,110,100, 10, 10, 45, 45, 32,100,101,116,101,114,109,105,110,101, 32,108,117, 97, 32, 102,117,110, 99,116,105,111,110, 32,110, 97,109,101, 32,111, 118,101,114,108,111, 97,100, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 70,117,110, 99,116,105,111,110, 58,111,118,101,114,108,111, 97,100, 32, 40, 41, 10, 32,114, 101,116,117,114,110, 32,115,101,108,102, 46,112, 97,114,101, 110,116, 58,111,118,101,114,108,111, 97,100, 40,115,101,108, 102, 46,108,110, 97,109,101, 41, 10,101,110,100, 10, 10, 10, 102,117,110, 99,116,105,111,110, 32,112, 97,114, 97,109, 95, 111, 98,106,101, 99,116, 40,112, 97,114, 41, 32, 45, 45, 32, 114,101,116,117,114,110,115, 32,116,114,117,101, 32,105,102, 32,116,104,101, 32,112, 97,114, 97,109,101,116,101,114, 32, 104, 97,115, 32, 97,110, 32,111, 98,106,101, 99,116, 32, 97, 115, 32,105,116,115, 32,100,101,102, 97,117,108,116, 32,118, 97,108,117,101, 10, 10, 9,105,102, 32,110,111,116, 32,115, 116,114,105,110,103, 46,102,105,110,100, 40,112, 97,114, 44, 32, 39, 61, 39, 41, 32,116,104,101,110, 32,114,101,116,117, 114,110, 32,102, 97,108,115,101, 32,101,110,100, 32, 45, 45, 32,105,116, 32,104, 97,115, 32,110,111, 32,100,101,102, 97, 117,108,116, 32,118, 97,108,117,101, 10, 10, 9,108,111, 99, 97,108, 32, 95, 44, 95, 44,100,101,102, 32, 61, 32,115,116, 114,105,110,103, 46,102,105,110,100, 40,112, 97,114, 44, 32, 34, 61, 40, 46, 42, 41, 36, 34, 41, 10, 10, 9,105,102, 32, 115,116,114,105,110,103, 46,102,105,110,100, 40,112, 97,114, 44, 32, 34,124, 34, 41, 32,116,104,101,110, 32, 45, 45, 32, 97, 32,108,105,115,116, 32,111,102, 32,102,108, 97,103,115, 10, 10, 9, 9,114,101,116,117,114,110, 32,116,114,117,101, 10, 9,101,110,100, 10, 10, 9,105,102, 32,115,116,114,105, 110,103, 46,102,105,110,100, 40,112, 97,114, 44, 32, 34, 37, 42, 34, 41, 32,116,104,101,110, 32, 45, 45, 32,105,116, 39, 115, 32, 97, 32,112,111,105,110,116,101,114, 32,119,105,116, 104, 32, 97, 32,100,101,102, 97,117,108,116, 32,118, 97,108, 117,101, 10, 10, 9, 9,105,102, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,112, 97,114, 44, 32, 39, 61, 37,115, 42,110,101,119, 39, 41, 32,111,114, 32,115,116,114,105,110, 103, 46,102,105,110,100, 40,112, 97,114, 44, 32, 34, 37, 40, 34, 41, 32,116,104,101,110, 32, 45, 45, 32,105,116, 39,115, 32, 97, 32,112,111,105,110,116,101,114, 32,119,105,116,104, 32, 97,110, 32,105,110,115,116, 97,110, 99,101, 32, 97,115, 32,100,101,102, 97,117,108,116, 32,112, 97,114, 97,109,101, 116,101,114, 46, 46, 32,105,115, 32,116,104, 97,116, 32,118, 97,108,105,100, 63, 10, 9, 9, 9,114,101,116,117,114,110, 32,116,114,117,101, 10, 9, 9,101,110,100, 10, 9, 9,114, 101,116,117,114,110, 32,102, 97,108,115,101, 32, 45, 45, 32, 100,101,102, 97,117,108,116, 32,118, 97,108,117,101, 32,105, 115, 32, 39, 78, 85, 76, 76, 39, 32,111,114, 32,115,111,109, 101,116,104,105,110,103, 10, 9,101,110,100, 10, 10, 10, 9, 105,102, 32,115,116,114,105,110,103, 46,102,105,110,100, 40, 112, 97,114, 44, 32, 34, 91, 37, 40, 38, 93, 34, 41, 32,116, 104,101,110, 10, 9, 9,114,101,116,117,114,110, 32,116,114, 117,101, 10, 9,101,110,100, 32, 45, 45, 32,100,101,102, 97, 117,108,116, 32,118, 97,108,117,101, 32,105,115, 32, 97, 32, 99,111,110,115,116,114,117, 99,116,111,114, 32, 99, 97,108, 108, 32, 40,109,111,115,116, 32,108,105,107,101,108,121, 32, 102,111,114, 32, 97, 32, 99,111,110,115,116, 32,114,101,102, 101,114,101,110, 99,101, 41, 10, 10, 9, 45, 45,105,102, 32, 115,116,114,105,110,103, 46,102,105,110,100, 40,112, 97,114, 44, 32, 34, 38, 34, 41, 32,116,104,101,110, 10, 10, 9, 45, 45, 9,105,102, 32,115,116,114,105,110,103, 46,102,105,110, 100, 40,100,101,102, 44, 32, 34, 58, 34, 41, 32,111,114, 32, 115,116,114,105,110,103, 46,102,105,110,100, 40,100,101,102, 44, 32, 34, 94, 37,115, 42,110,101,119, 37,115, 43, 34, 41, 32,116,104,101,110, 10, 10, 9, 45, 45, 9, 9, 45, 45, 32, 105,116, 39,115, 32, 97, 32,114,101,102,101,114,101,110, 99, 101, 32,119,105,116,104, 32,100,101,102, 97,117,108,116, 32, 116,111, 32,115,111,109,101,116,104,105,110,103, 32,108,105, 107,101, 32, 67,108, 97,115,115, 58, 58,109,101,109, 98,101, 114, 44, 32,111,114, 32, 39,110,101,119, 32, 67,108, 97,115, 115, 39, 10, 9, 45, 45, 9, 9,114,101,116,117,114,110, 32, 116,114,117,101, 10, 9, 45, 45, 9,101,110,100, 10, 9, 45, 45,101,110,100, 10, 10, 9,114,101,116,117,114,110, 32,102, 97,108,115,101, 32, 45, 45, 32, 63, 10,101,110,100, 10, 10, 102,117,110, 99,116,105,111,110, 32,115,116,114,105,112, 95, 108, 97,115,116, 95, 97,114,103, 40, 97,108,108, 95, 97,114, 103,115, 44, 32,108, 97,115,116, 95, 97,114,103, 41, 32, 45, 45, 32,115,116,114,105,112,115, 32,116,104,101, 32,100,101, 102, 97,117,108,116, 32,118, 97,108,117,101, 32,102,114,111, 109, 32,116,104,101, 32,108, 97,115,116, 32, 97,114,103,117, 109,101,110,116, 10, 10, 9,108,111, 99, 97,108, 32, 95, 44, 95, 44,115, 95, 97,114,103, 32, 61, 32,115,116,114,105,110, 103, 46,102,105,110,100, 40,108, 97,115,116, 95, 97,114,103, 44, 32, 34, 94, 40, 91, 94, 61, 93, 43, 41, 34, 41, 10, 9, 108, 97,115,116, 95, 97,114,103, 32, 61, 32,115,116,114,105, 110,103, 46,103,115,117, 98, 40,108, 97,115,116, 95, 97,114, 103, 44, 32, 34, 40, 91, 37, 37, 37, 40, 37, 41, 93, 41, 34, 44, 32, 34, 37, 37, 37, 49, 34, 41, 59, 10, 9, 97,108,108, 95, 97,114,103,115, 32, 61, 32,115,116,114,105,110,103, 46, 103,115,117, 98, 40, 97,108,108, 95, 97,114,103,115, 44, 32, 34, 37,115, 42, 44, 37,115, 42, 34, 46, 46,108, 97,115,116, 95, 97,114,103, 46, 46, 34, 37,115, 42, 37, 41, 37,115, 42, 36, 34, 44, 32, 34, 41, 34, 41, 10, 9,114,101,116,117,114, 110, 32, 97,108,108, 95, 97,114,103,115, 44, 32,115, 95, 97, 114,103, 10,101,110,100, 10, 10, 10, 10, 45, 45, 32, 73,110, 116,101,114,110, 97,108, 32, 99,111,110,115,116,114,117, 99, 116,111,114, 10,102,117,110, 99,116,105,111,110, 32, 95, 70, 117,110, 99,116,105,111,110, 32, 40,116, 41, 10, 32,115,101, 116,109,101,116, 97,116, 97, 98,108,101, 40,116, 44, 99,108, 97,115,115, 70,117,110, 99,116,105,111,110, 41, 10, 10, 32, 105,102, 32,116, 46, 99,111,110,115,116, 32,126, 61, 32, 39, 99,111,110,115,116, 39, 32, 97,110,100, 32,116, 46, 99,111, 110,115,116, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 32,101,114,114,111,114, 40, 34, 35,105,110,118, 97,108, 105,100, 32, 39, 99,111,110,115,116, 39, 32,115,112,101, 99, 105,102,105, 99, 97,116,105,111,110, 34, 41, 10, 32,101,110, 100, 10, 10, 32, 97,112,112,101,110,100, 40,116, 41, 10, 32, 105,102, 32,116, 58,105,110, 99,108, 97,115,115, 40, 41, 32, 116,104,101,110, 10, 32, 45, 45,112,114,105,110,116, 32, 40, 39,116, 46,110, 97,109,101, 32,105,115, 32, 39, 46, 46,116, 46,110, 97,109,101, 46, 46, 39, 44, 32,112, 97,114,101,110, 116, 46,110, 97,109,101, 32,105,115, 32, 39, 46, 46,116, 46, 112, 97,114,101,110,116, 46,110, 97,109,101, 41, 10, 32, 32, 105,102, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 116, 46,110, 97,109,101, 44, 32, 34, 37, 98, 60, 62, 34, 44, 32, 34, 34, 41, 32, 61, 61, 32,115,116,114,105,110,103, 46, 103,115,117, 98, 40,116, 46,112, 97,114,101,110,116, 46,111, 114,105,103,105,110, 97,108, 95,110, 97,109,101, 32,111,114, 32,116, 46,112, 97,114,101,110,116, 46,110, 97,109,101, 44, 32, 34, 37, 98, 60, 62, 34, 44, 32, 34, 34, 41, 32,116,104, 101,110, 10, 32, 32, 32,116, 46,110, 97,109,101, 32, 61, 32, 39,110,101,119, 39, 10, 32, 32, 32,116, 46,108,110, 97,109, 101, 32, 61, 32, 39,110,101,119, 39, 10, 32, 32, 32,116, 46, 112, 97,114,101,110,116, 46, 95,110,101,119, 32, 61, 32,116, 114,117,101, 10, 32, 32, 32,116, 46,116,121,112,101, 32, 61, 32,116, 46,112, 97,114,101,110,116, 46,110, 97,109,101, 10, 32, 32, 32,116, 46,112,116,114, 32, 61, 32, 39, 42, 39, 10, 32, 32,101,108,115,101,105,102, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,116, 46,110, 97,109,101, 44, 32, 34, 37, 98, 60, 62, 34, 44, 32, 34, 34, 41, 32, 61, 61, 32, 39, 126, 39, 46, 46,115,116,114,105,110,103, 46,103,115,117, 98, 40,116, 46,112, 97,114,101,110,116, 46,111,114,105,103,105, 110, 97,108, 95,110, 97,109,101, 32,111,114, 32,116, 46,112, 97,114,101,110,116, 46,110, 97,109,101, 44, 32, 34, 37, 98, 60, 62, 34, 44, 32, 34, 34, 41, 32,116,104,101,110, 10, 32, 32, 32,116, 46,110, 97,109,101, 32, 61, 32, 39,100,101,108, 101,116,101, 39, 10, 32, 32, 32,116, 46,108,110, 97,109,101, 32, 61, 32, 39,100,101,108,101,116,101, 39, 10, 32, 32, 32, 116, 46,112, 97,114,101,110,116, 46, 95,100,101,108,101,116, 101, 32, 61, 32,116,114,117,101, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 32,116, 46, 99,110, 97,109,101, 32, 61, 32,116, 58, 99,102,117,110, 99,110, 97,109,101, 40, 34,116, 111,108,117, 97, 34, 41, 46, 46,116, 58,111,118,101,114,108, 111, 97,100, 40,116, 41, 10, 32,114,101,116,117,114,110, 32, 116, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110,115,116, 114,117, 99,116,111,114, 10, 45, 45, 32, 69,120,112,101, 99, 116,115, 32,116,104,114,101,101, 32,115,116,114,105,110,103, 115, 58, 32,111,110,101, 32,114,101,112,114,101,115,101,110, 116,105,110,103, 32,116,104,101, 32,102,117,110, 99,116,105, 111,110, 32,100,101, 99,108, 97,114, 97,116,105,111,110, 44, 10, 45, 45, 32, 97,110,111,116,104,101,114, 32,114,101,112, 114,101,115,101,110,116,105,110,103, 32,116,104,101, 32, 97, 114,103,117,109,101,110,116, 32,108,105,115,116, 44, 32, 97, 110,100, 32,116,104,101, 32,116,104,105,114,100, 32,114,101, 112,114,101,115,101,110,116,105,110,103, 10, 45, 45, 32,116, 104,101, 32, 34, 99,111,110,115,116, 34, 32,111,114, 32,101, 109,112,116,121, 32,115,116,114,105,110,103, 46, 10,102,117, 110, 99,116,105,111,110, 32, 70,117,110, 99,116,105,111,110, 32, 40,100, 44, 97, 44, 99, 41, 10, 32, 45, 45,108,111, 99, 97,108, 32,116, 32, 61, 32,115,112,108,105,116, 40,115,116, 114,115,117, 98, 40, 97, 44, 50, 44, 45, 50, 41, 44, 39, 44, 39, 41, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101, 32, 98,114, 97, 99,101,115, 10, 32, 45, 45,108,111, 99, 97, 108, 32,116, 32, 61, 32,115,112,108,105,116, 95,112, 97,114, 97,109,115, 40,115,116,114,115,117, 98, 40, 97, 44, 50, 44, 45, 50, 41, 41, 10, 10, 9,105,102, 32,110,111,116, 32,102, 108, 97,103,115, 91, 39, 87, 39, 93, 32, 97,110,100, 32,115, 116,114,105,110,103, 46,102,105,110,100, 40, 97, 44, 32, 34, 37, 46, 37, 46, 37, 46, 37,115, 42, 37, 41, 34, 41, 32,116, 104,101,110, 10, 10, 9, 9,119, 97,114,110,105,110,103, 40, 34, 70,117,110, 99,116,105,111,110,115, 32,119,105,116,104, 32,118, 97,114,105, 97, 98,108,101, 32, 97,114,103,117,109, 101,110,116,115, 32, 40, 96, 46, 46, 46, 39, 41, 32, 97,114, 101, 32,110,111,116, 32,115,117,112,112,111,114,116,101,100, 46, 32, 73,103,110,111,114,105,110,103, 32, 34, 46, 46,100, 46, 46, 97, 46, 46, 99, 41, 10, 9, 9,114,101,116,117,114, 110, 32,110,105,108, 10, 9,101,110,100, 10, 10, 10, 32,108, 111, 99, 97,108, 32,105, 61, 49, 10, 32,108,111, 99, 97,108, 32,108, 32, 61, 32,123,110, 61, 48,125, 10, 10, 32, 9, 97, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 97, 44, 32, 34, 37,115, 42, 40, 91, 37, 40, 37, 41, 93, 41, 37,115, 42, 34, 44, 32, 34, 37, 49, 34, 41, 10, 9,108,111, 99, 97,108, 32,116, 44,115,116,114,105,112, 44,108, 97,115, 116, 32, 61, 32,115,116,114,105,112, 95,112, 97,114,115, 40, 115,116,114,115,117, 98, 40, 97, 44, 50, 44, 45, 50, 41, 41, 59, 10, 9,105,102, 32,115,116,114,105,112, 32,116,104,101, 110, 10, 9, 9, 45, 45,108,111, 99, 97,108, 32,110,115, 32, 61, 32,115,116,114,105,110,103, 46,115,117, 98, 40,115,116, 114,115,117, 98, 40, 97, 44, 49, 44, 45, 50, 41, 44, 32, 49, 44, 32, 45, 40,115,116,114,105,110,103, 46,108,101,110, 40, 108, 97,115,116, 41, 43, 49, 41, 41, 10, 9, 9,108,111, 99, 97,108, 32,110,115, 32, 61, 32,106,111,105,110, 40,116, 44, 32, 34, 44, 34, 44, 32, 49, 44, 32,108, 97,115,116, 45, 49, 41, 10, 10, 9, 9,110,115, 32, 61, 32, 34, 40, 34, 46, 46, 115,116,114,105,110,103, 46,103,115,117, 98, 40,110,115, 44, 32, 34, 37,115, 42, 44, 37,115, 42, 36, 34, 44, 32, 34, 34, 41, 46, 46, 39, 41, 39, 10, 9, 9, 45, 45,110,115, 32, 61, 32,115,116,114,105,112, 95,100,101,102, 97,117,108,116,115, 40,110,115, 41, 10, 10, 9, 9,108,111, 99, 97,108, 32,102, 32, 61, 32, 70,117,110, 99,116,105,111,110, 40,100, 44, 32, 110,115, 44, 32, 99, 41, 10, 9, 9,102,111,114, 32,105, 61, 49, 44,108, 97,115,116, 32,100,111, 10, 9, 9, 9,116, 91, 105, 93, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,116, 91,105, 93, 44, 32, 34, 61, 46, 42, 36, 34, 44, 32, 34, 34, 41, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10, 10, 32,119,104,105,108,101, 32,116, 91,105, 93, 32,100, 111, 10, 32, 32,108, 46,110, 32, 61, 32,108, 46,110, 43, 49, 10, 32, 32,108, 91,108, 46,110, 93, 32, 61, 32, 68,101, 99, 108, 97,114, 97,116,105,111,110, 40,116, 91,105, 93, 44, 39, 118, 97,114, 39, 44,116,114,117,101, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,108,111, 99, 97,108, 32,102, 32, 61, 32, 68,101, 99,108, 97,114, 97,116, 105,111,110, 40,100, 44, 39,102,117,110, 99, 39, 41, 10, 32, 102, 46, 97,114,103,115, 32, 61, 32,108, 10, 32,102, 46, 99, 111,110,115,116, 32, 61, 32, 99, 10, 32,114,101,116,117,114, 110, 32, 95, 70,117,110, 99,116,105,111,110, 40,102, 41, 10, 101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,106, 111,105,110, 40,116, 44, 32,115,101,112, 44, 32,102,105,114, 115,116, 44, 32,108, 97,115,116, 41, 10, 10, 9,102,105,114, 115,116, 32, 61, 32,102,105,114,115,116, 32,111,114, 32, 49, 10, 9,108, 97,115,116, 32, 61, 32,108, 97,115,116, 32,111, 114, 32,116, 97, 98,108,101, 46,103,101,116,110, 40,116, 41, 10, 9,108,111, 99, 97,108, 32,108,115,101,112, 32, 61, 32, 34, 34, 10, 9,108,111, 99, 97,108, 32,114,101,116, 32, 61, 32, 34, 34, 10, 9,108,111, 99, 97,108, 32,108,111,111,112, 32, 61, 32,102, 97,108,115,101, 10, 9,102,111,114, 32,105, 32, 61, 32,102,105,114,115,116, 44,108, 97,115,116, 32,100, 111, 10, 10, 9, 9,114,101,116, 32, 61, 32,114,101,116, 46, 46,108,115,101,112, 46, 46,116, 91,105, 93, 10, 9, 9,108, 115,101,112, 32, 61, 32,115,101,112, 10, 9, 9,108,111,111, 112, 32, 61, 32,116,114,117,101, 10, 9,101,110,100, 10, 9, 105,102, 32,110,111,116, 32,108,111,111,112, 32,116,104,101, 110, 10, 9, 9,114,101,116,117,114,110, 32, 34, 34, 10, 9, 101,110,100, 10, 10, 9,114,101,116,117,114,110, 32,114,101, 116, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,115,116,114,105,112, 95,112, 97,114,115, 40,115, 41, 10, 10, 9,108,111, 99, 97,108, 32,116, 32, 61, 32,115,112,108, 105,116, 95, 99, 95,116,111,107,101,110,115, 40,115, 44, 32, 39, 44, 39, 41, 10, 9,108,111, 99, 97,108, 32,115,116,114, 105,112, 32, 61, 32,102, 97,108,115,101, 10, 9,108,111, 99, 97,108, 32,108, 97,115,116, 10, 10, 9,102,111,114, 32,105, 61,116, 46,110, 44, 49, 44, 45, 49, 32,100,111, 10, 10, 9, 9,105,102, 32,110,111,116, 32,115,116,114,105,112, 32, 97, 110,100, 32,112, 97,114, 97,109, 95,111, 98,106,101, 99,116, 40,116, 91,105, 93, 41, 32,116,104,101,110, 10, 9, 9, 9, 108, 97,115,116, 32, 61, 32,105, 10, 9, 9, 9,115,116,114, 105,112, 32, 61, 32,116,114,117,101, 10, 9, 9,101,110,100, 10, 9, 9, 45, 45,105,102, 32,115,116,114,105,112, 32,116, 104,101,110, 10, 9, 9, 45, 45, 9,116, 91,105, 93, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,116, 91, 105, 93, 44, 32, 34, 61, 46, 42, 36, 34, 44, 32, 34, 34, 41, 10, 9, 9, 45, 45,101,110,100, 10, 9,101,110,100, 10, 10, 9,114,101,116,117,114,110, 32,116, 44,115,116,114,105,112, 44,108, 97,115,116, 10, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,115,116,114,105,112, 95,100,101,102, 97,117,108,116,115, 40,115, 41, 10, 10, 9,115, 32, 61, 32, 115,116,114,105,110,103, 46,103,115,117, 98, 40,115, 44, 32, 34, 94, 37, 40, 34, 44, 32, 34, 34, 41, 10, 9,115, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,115, 44, 32, 34, 37, 41, 36, 34, 44, 32, 34, 34, 41, 10, 10, 9,108, 111, 99, 97,108, 32,116, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40,115, 44, 32, 34, 44, 34, 41, 10, 9,108,111, 99, 97,108, 32,115,101,112, 44, 32,114, 101,116, 32, 61, 32, 34, 34, 44, 34, 34, 10, 9,102,111,114, 32,105, 61, 49, 44,116, 46,110, 32,100,111, 10, 9, 9,116, 91,105, 93, 32, 61, 32,115,116,114,105,110,103, 46,103,115, 117, 98, 40,116, 91,105, 93, 44, 32, 34, 61, 46, 42, 36, 34, 44, 32, 34, 34, 41, 10, 9, 9,114,101,116, 32, 61, 32,114, 101,116, 46, 46,115,101,112, 46, 46,116, 91,105, 93, 10, 9, 9,115,101,112, 32, 61, 32, 34, 44, 34, 10, 9,101,110,100, 10, 10, 9,114,101,116,117,114,110, 32, 34, 40, 34, 46, 46, 114,101,116, 46, 46, 34, 41, 34, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/function.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,111,112,101,114, 97, 116,111,114, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114, 105,116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73, 100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99, 111,100,101, 32,105,115, 32,102,114,101,101, 32,115,111,102, 116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32, 114,101,100,105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32, 105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116, 119, 97,114,101, 32,112,114,111,118,105,100,101,100, 32,104, 101,114,101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105, 115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97, 117,116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98, 108,105,103, 97,116,105,111,110, 32,116,111, 32,112,114,111, 118,105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99, 101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99, 101,109,101,110,116,115, 44, 32,111,114, 32,109,111,100,105, 102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 45, 45, 32, 79,112,101,114, 97,116,111,114, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101,115,101,110,116,115, 32, 97,110, 32,111,112,101,114, 97,116,111,114, 32,102,117,110, 99,116,105,111,110, 32,111,114, 32, 97, 32, 99,108, 97,115, 115, 32,111,112,101,114, 97,116,111,114, 32,109,101,116,104, 111,100, 46, 10, 45, 45, 32, 73,116, 32,115,116,111,114,101, 115, 32,116,104,101, 32,115, 97,109,101, 32,102,105,101,108, 100,115, 32, 97,115, 32,102,117,110, 99,116,105,111,110,115, 32,100,111, 32,112,108,117,115, 58, 10, 45, 45, 32, 32,107, 105,110,100, 32, 61, 32,115,101,116, 32,111,102, 32, 99,104, 97,114, 97, 99,116,101,114, 32,114,101,112,114,101,115,101, 110,116,105,110,103, 32,116,104,101, 32,111,112,101,114, 97, 116,111,114, 32, 40, 97,115, 32,105,116, 32, 97,112,112,101, 114,115, 32,105,110, 32, 67, 43, 43, 32, 99,111,100,101, 41, 10, 99,108, 97,115,115, 79,112,101,114, 97,116,111,114, 32, 61, 32,123, 10, 32,107,105,110,100, 32, 61, 32, 39, 39, 44, 10,125, 10, 99,108, 97,115,115, 79,112,101,114, 97,116,111, 114, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97, 115,115, 79,112,101,114, 97,116,111,114, 10,115,101,116,109, 101,116, 97,116, 97, 98,108,101, 40, 99,108, 97,115,115, 79, 112,101,114, 97,116,111,114, 44, 99,108, 97,115,115, 70,117, 110, 99,116,105,111,110, 41, 10, 10, 45, 45, 32,116, 97, 98, 108,101, 32,116,111, 32,116,114, 97,110,115,102,111,114,109, 32,111,112,101,114, 97,116,111,114, 32,107,105,110,100, 32, 105,110,116,111, 32,116,104,101, 32, 97,112,112,114,111,112, 114,105, 97,116,101, 32,116, 97,103, 32,109,101,116,104,111, 100, 32,110, 97,109,101, 10, 95, 84, 77, 32, 61, 32,123, 91, 39, 43, 39, 93, 32, 61, 32, 39, 97,100,100, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 91, 39, 45, 39, 93, 32, 61, 32, 39, 115,117, 98, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 91, 39, 42, 39, 93, 32, 61, 32, 39,109,117,108, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 91, 39, 47, 39, 93, 32, 61, 32, 39,100, 105,118, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 91, 39, 60, 39, 93, 32, 61, 32, 39,108,116, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 91, 39, 60, 61, 39, 93, 32, 61, 32, 39,108,101, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 91, 39, 61, 61, 39, 93, 32, 61, 32, 39,101,113, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 91, 39, 91, 93, 39, 93, 32, 61, 32, 39,103,101,116, 105, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 91, 39, 38, 91, 93, 39, 93, 32, 61, 32, 39,115,101,116,105, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 45, 45, 91, 39, 45, 62, 39, 93, 32, 61, 32, 39,102,108,101, 99,104,105,116, 97, 39, 44, 10, 32, 32, 32, 32, 32, 32,125, 10, 10, 10, 45, 45, 32, 80,114,105, 110,116, 32,109,101,116,104,111,100, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 79,112,101,114, 97,116, 111,114, 58,112,114,105,110,116, 32, 40,105,100,101,110,116, 44, 99,108,111,115,101, 41, 10, 32,112,114,105,110,116, 40, 105,100,101,110,116, 46, 46, 34, 79,112,101,114, 97,116,111, 114,123, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101, 110,116, 46, 46, 34, 32,107,105,110,100, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,107,105,110,100, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101, 110,116, 46, 46, 34, 32,109,111,100, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,109,111,100, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,116,121,112,101, 32, 61, 32, 39, 34, 46, 46, 115,101,108,102, 46,116,121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,112,116,114, 32, 32, 61, 32, 39, 34, 46, 46,115, 101,108,102, 46,112,116,114, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32, 112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 99,111,110,115,116, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46, 99,111,110,115,116, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 99,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101, 108,102, 46, 99,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,108,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115, 101,108,102, 46,108,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 97,114,103,115, 32, 61, 32,123, 34, 41, 10, 32, 108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108, 101, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 32, 100,111, 10, 32, 32,115,101,108,102, 46, 97,114,103,115, 91, 105, 93, 58,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 32, 34, 44, 34, 44, 34, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,112,114,105, 110,116, 40,105,100,101,110,116, 46, 46, 34, 32,125, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34,125, 34, 46, 46, 99,108,111,115,101, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115, 115, 79,112,101,114, 97,116,111,114, 58,115,117,112, 99,111, 100,101, 95,116,109,112, 40, 41, 10, 10, 9,105,102, 32,110, 111,116, 32, 95, 84, 77, 91,115,101,108,102, 46,107,105,110, 100, 93, 32,116,104,101,110, 10, 9, 9,114,101,116,117,114, 110, 32, 99,108, 97,115,115, 70,117,110, 99,116,105,111,110, 46,115,117,112, 99,111,100,101, 40,115,101,108,102, 41, 10, 9,101,110,100, 10, 10, 9, 45, 45, 32,110,111, 32,111,118, 101,114,108,111, 97,100, 44, 32,110,111, 32,112, 97,114, 97, 109,101,116,101,114,115, 44, 32, 97,108,119, 97,121,115, 32, 105,110, 99,108, 97,115,115, 10, 9,111,117,116,112,117,116, 40, 34, 47, 42, 32,109,101,116,104,111,100, 58, 34, 44,115, 101,108,102, 46,110, 97,109,101, 44, 34, 32,111,102, 32, 99, 108, 97,115,115, 32, 34, 44,115,101,108,102, 58,105,110, 99, 108, 97,115,115, 40, 41, 44, 34, 32, 42, 47, 34, 41, 10, 10, 9,111,117,116,112,117,116, 40, 34, 35,105,102,110,100,101, 102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 95, 34, 46, 46,115,101,108,102, 46, 99,110, 97,109,101, 41, 10, 9,111,117,116,112,117,116, 40, 34, 92,110,115,116, 97, 116,105, 99, 32,105,110,116, 34, 44,115,101,108,102, 46, 99, 110, 97,109,101, 44, 34, 40,108,117, 97, 95, 83,116, 97,116, 101, 42, 32,116,111,108,117, 97, 95, 83, 41, 34, 41, 10, 10, 9,105,102, 32,111,118,101,114,108,111, 97,100, 32, 60, 32, 48, 32,116,104,101,110, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9,101, 110,100, 10, 9,111,117,116,112,117,116, 40, 39, 32,116,111, 108,117, 97, 95, 69,114,114,111,114, 32,116,111,108,117, 97, 95,101,114,114, 59, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 32,105,102, 32, 40, 92,110, 39, 41, 10, 9, 45, 45, 32, 99,104,101, 99,107, 32,115,101,108,102, 10, 9,108,111, 99, 97,108, 32,105,115, 95,102,117,110, 99, 32, 61, 32,103, 101,116, 95,105,115, 95,102,117,110, 99,116,105,111,110, 40, 115,101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112, 101, 41, 10, 9,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32, 32, 33, 39, 46, 46,105,115, 95,102,117,110, 99, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 49, 44, 34, 39, 46, 46,115,101,108,102, 46,112, 97,114,101,110,116, 46,116,121, 112,101, 46, 46, 39, 34, 44, 48, 44, 38,116,111,108,117, 97, 95,101,114,114, 41, 32,124,124, 92,110, 39, 41, 10, 9,111, 117,116,112,117,116, 40, 39, 32, 32, 32, 32, 32, 33,116,111, 108,117, 97, 95,105,115,110,111,111, 98,106, 40,116,111,108, 117, 97, 95, 83, 44, 50, 44, 38,116,111,108,117, 97, 95,101, 114,114, 41, 92,110, 32, 41, 39, 41, 10, 9,111,117,116,112, 117,116, 40, 39, 32, 32,103,111,116,111, 32,116,111,108,117, 97, 95,108,101,114,114,111,114, 59, 39, 41, 10, 10, 9,111, 117,116,112,117,116, 40, 39, 32,101,108,115,101, 92,110, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 35,101,110,100, 105,102, 92,110, 39, 41, 32, 45, 45, 32,116,111,108,117, 97, 95,114,101,108,101, 97,115,101, 10, 9,111,117,116,112,117, 116, 40, 39, 32,123, 39, 41, 10, 10, 9, 45, 45, 32,100,101, 99,108, 97,114,101, 32,115,101,108,102, 10, 9,111,117,116, 112,117,116, 40, 39, 32, 39, 44,115,101,108,102, 46, 99,111, 110,115,116, 44,115,101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 44, 39, 42, 39, 44, 39,115,101,108,102, 32, 61, 32, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 40, 39, 44,115,101,108,102, 46, 99,111,110,115,116, 44,115, 101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 44, 39, 42, 41, 32, 39, 41, 10, 9,108,111, 99, 97,108, 32, 116,111, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95,116, 111, 95,102,117,110, 99, 40,115,101,108,102, 46,112, 97,114, 101,110,116, 46,116,121,112,101, 41, 10, 9,111,117,116,112, 117,116, 40,116,111, 95,102,117,110, 99, 44, 39, 40,116,111, 108,117, 97, 95, 83, 44, 49, 44, 48, 41, 59, 39, 41, 10, 10, 9, 45, 45, 32, 99,104,101, 99,107, 32,115,101,108,102, 10, 9,111,117,116,112,117,116, 40, 39, 35,105,102,110,100,101, 102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 32, 32,105,102, 32, 40, 33,115,101,108,102, 41, 32,116,111,108, 117, 97, 95,101,114,114,111,114, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,111,117,116,112,117,116, 95,101,114, 114,111,114, 95,104,111,111,107, 40, 34,105,110,118, 97,108, 105,100, 32, 92, 39,115,101,108,102, 92, 39, 32,105,110, 32, 102,117,110, 99,116,105,111,110, 32, 92, 39, 37,115, 92, 39, 34, 44, 32,115,101,108,102, 46,110, 97,109,101, 41, 46, 46, 39, 34, 44, 78, 85, 76, 76, 41, 59, 39, 41, 59, 10, 9,111, 117,116,112,117,116, 40, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 10, 9, 45, 45, 32, 99, 97,115,116, 32,115,101, 108,102, 10, 9,111,117,116,112,117,116, 40, 39, 32, 32, 39, 44,115,101,108,102, 46,109,111,100, 44,115,101,108,102, 46, 116,121,112,101, 44,115,101,108,102, 46,112,116,114, 44, 39, 116,111,108,117, 97, 95,114,101,116, 32, 61, 32, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 40, 39, 44,115,101,108, 102, 46,109,111,100, 44,115,101,108,102, 46,116,121,112,101, 44,115,101,108,102, 46,112,116,114, 44, 39, 41, 40, 42,115, 101,108,102, 41, 59, 39, 41, 10, 10, 9, 45, 45, 32,114,101, 116,117,114,110, 32,118, 97,108,117,101, 10, 9,108,111, 99, 97,108, 32,116, 44, 99,116, 32, 61, 32,105,115, 98, 97,115, 105, 99, 40,115,101,108,102, 46,116,121,112,101, 41, 10, 9, 105,102, 32,116, 32,116,104,101,110, 10, 9, 9,111,117,116, 112,117,116, 40, 39, 32, 32, 32,116,111,108,117, 97, 95,112, 117,115,104, 39, 46, 46,116, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 40, 39, 44, 99,116, 44, 39, 41,116,111,108, 117, 97, 95,114,101,116, 41, 59, 39, 41, 10, 9,101,108,115, 101, 10, 9, 9,116, 32, 61, 32,115,101,108,102, 46,116,121, 112,101, 10, 9, 9,108,111, 99, 97,108, 32,112,117,115,104, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95,112,117,115, 104, 95,102,117,110, 99,116,105,111,110, 40,116, 41, 10, 9, 9,110,101,119, 95,116, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,116, 44, 32, 34, 99,111,110,115,116, 37,115, 43, 34, 44, 32, 34, 34, 41, 10, 9, 9,105,102, 32, 115,101,108,102, 46,112,116,114, 32, 61, 61, 32, 39, 39, 32, 116,104,101,110, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 32,123, 39, 41, 10, 9, 9, 9,111,117,116,112, 117,116, 40, 39, 35,105,102,100,101,102, 32, 95, 95, 99,112, 108,117,115,112,108,117,115, 92,110, 39, 41, 10, 9, 9, 9, 111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,118,111,105, 100, 42, 32,116,111,108,117, 97, 95,111, 98,106, 32, 61, 32, 77,116,111,108,117, 97, 95,110,101,119, 40, 40, 39, 44,110, 101,119, 95,116, 44, 39, 41, 40,116,111,108,117, 97, 95,114, 101,116, 41, 41, 59, 39, 41, 10, 9, 9, 9,111,117,116,112, 117,116, 40, 39, 32, 32, 32, 32, 39, 44,112,117,115,104, 95, 102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 116,111,108,117, 97, 95,111, 98,106, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 9, 9, 9,111,117,116,112,117, 116, 40, 39, 32, 32, 32, 32,116,111,108,117, 97, 95,114,101, 103,105,115,116,101,114, 95,103, 99, 40,116,111,108,117, 97, 95, 83, 44,108,117, 97, 95,103,101,116,116,111,112, 40,116, 111,108,117, 97, 95, 83, 41, 41, 59, 39, 41, 10, 9, 9, 9, 111,117,116,112,117,116, 40, 39, 35,101,108,115,101, 92,110, 39, 41, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,118,111,105,100, 42, 32,116,111,108,117, 97, 95, 111, 98,106, 32, 61, 32,116,111,108,117, 97, 95, 99,111,112, 121, 40,116,111,108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41, 38,116,111,108,117, 97, 95,114,101,116, 44,115,105, 122,101,111,102, 40, 39, 44,116, 44, 39, 41, 41, 59, 39, 41, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32, 39, 44,112,117,115,104, 95,102,117,110, 99, 44, 39, 40, 116,111,108,117, 97, 95, 83, 44,116,111,108,117, 97, 95,111, 98,106, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32, 116,111,108,117, 97, 95,114,101,103,105,115,116,101,114, 95, 103, 99, 40,116,111,108,117, 97, 95, 83, 44,108,117, 97, 95, 103,101,116,116,111,112, 40,116,111,108,117, 97, 95, 83, 41, 41, 59, 39, 41, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 9, 9, 9, 111,117,116,112,117,116, 40, 39, 32, 32, 32,125, 39, 41, 10, 9, 9,101,108,115,101,105,102, 32,115,101,108,102, 46,112, 116,114, 32, 61, 61, 32, 39, 38, 39, 32,116,104,101,110, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 32, 39, 44,112,117,115,104, 95,102,117,110, 99, 44, 39, 40,116,111, 108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41, 38,116, 111,108,117, 97, 95,114,101,116, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,105,102, 32,108,111, 99, 97,108, 95, 99,111,110,115,116, 114,117, 99,116,111,114, 32,116,104,101,110, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 32, 39, 44,112, 117,115,104, 95,102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40,118,111,105,100, 32, 42, 41,116,111,108, 117, 97, 95,114,101,116, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,116,111,108,117, 97, 95,114,101,103,105, 115,116,101,114, 95,103, 99, 40,116,111,108,117, 97, 95, 83, 44,108,117, 97, 95,103,101,116,116,111,112, 40,116,111,108, 117, 97, 95, 83, 41, 41, 59, 39, 41, 10, 9, 9, 9,101,108, 115,101, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 32, 39, 44,112,117,115,104, 95,102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41,116,111,108,117, 97, 95,114,101,116, 44, 34, 39, 44, 116, 44, 39, 34, 41, 59, 39, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10, 10, 9,111, 117,116,112,117,116, 40, 39, 32, 32,125, 39, 41, 10, 9,111, 117,116,112,117,116, 40, 39, 32,114,101,116,117,114,110, 32, 49, 59, 39, 41, 10, 10, 9,111,117,116,112,117,116, 40, 39, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9,111,117,116, 112,117,116, 40, 39,116,111,108,117, 97, 95,108,101,114,114, 111,114, 58, 92,110, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 32,116,111,108,117, 97, 95,101,114,114,111,114, 40, 116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,111,117,116, 112,117,116, 95,101,114,114,111,114, 95,104,111,111,107, 40, 34, 35,102,101,114,114,111,114, 32,105,110, 32,102,117,110, 99,116,105,111,110, 32, 92, 39, 37,115, 92, 39, 46, 34, 44, 32,115,101,108,102, 46,108,110, 97,109,101, 41, 46, 46, 39, 34, 44, 38,116,111,108,117, 97, 95,101,114,114, 41, 59, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 32,114,101,116, 117,114,110, 32, 48, 59, 39, 41, 10, 9,111,117,116,112,117, 116, 40, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 10, 10, 9,111,117,116,112,117,116, 40, 39,125, 39, 41, 10, 9, 111,117,116,112,117,116, 40, 39, 35,101,110,100,105,102, 32, 47, 47, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 92,110, 39, 41, 10, 9,111, 117,116,112,117,116, 40, 39, 92,110, 39, 41, 10,101,110,100, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99, 111,110,115,116,114,117, 99,116,111,114, 10,102,117,110, 99, 116,105,111,110, 32, 95, 79,112,101,114, 97,116,111,114, 32, 40,116, 41, 10, 32,115,101,116,109,101,116, 97,116, 97, 98, 108,101, 40,116, 44, 99,108, 97,115,115, 79,112,101,114, 97, 116,111,114, 41, 10, 10, 32,105,102, 32,116, 46, 99,111,110, 115,116, 32,126, 61, 32, 39, 99,111,110,115,116, 39, 32, 97, 110,100, 32,116, 46, 99,111,110,115,116, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 32,101,114,114,111,114, 40, 34, 35,105,110,118, 97,108,105,100, 32, 39, 99,111,110,115, 116, 39, 32,115,112,101, 99,105,102,105, 99, 97,116,105,111, 110, 34, 41, 10, 32,101,110,100, 10, 10, 32, 97,112,112,101, 110,100, 40,116, 41, 10, 32,105,102, 32,110,111,116, 32,116, 58,105,110, 99,108, 97,115,115, 40, 41, 32,116,104,101,110, 10, 32, 32,101,114,114,111,114, 40, 34, 35,111,112,101,114, 97,116,111,114, 32, 99, 97,110, 32,111,110,108,121, 32, 98, 101, 32,100,101,102,105,110,101,100, 32, 97,115, 32, 99,108, 97,115,115, 32,109,101,109, 98,101,114, 34, 41, 10, 32,101, 110,100, 10, 10, 32, 45, 45,116, 46,110, 97,109,101, 32, 61, 32,116, 46,110, 97,109,101, 32, 46, 46, 32, 34, 95, 34, 32, 46, 46, 32, 40, 95, 84, 77, 91,116, 46,107,105,110,100, 93, 32,111,114, 32,116, 46,107,105,110,100, 41, 10, 32,116, 46, 99,110, 97,109,101, 32, 61, 32,116, 58, 99,102,117,110, 99, 110, 97,109,101, 40, 34,116,111,108,117, 97, 34, 41, 46, 46, 116, 58,111,118,101,114,108,111, 97,100, 40,116, 41, 10, 32, 116, 46,110, 97,109,101, 32, 61, 32, 34,111,112,101,114, 97, 116,111,114, 34, 32, 46, 46, 32,116, 46,107,105,110,100, 32, 32, 45, 45, 32,115,101,116, 32, 97,112,112,114,111,112,114, 105, 97,116,101, 32, 99, 97,108,108,105,110,103, 32,110, 97, 109,101, 10, 32,114,101,116,117,114,110, 32,116, 10,101,110, 100, 10, 10, 45, 45, 32, 67,111,110,115,116,114,117, 99,116, 111,114, 10,102,117,110, 99,116,105,111,110, 32, 79,112,101, 114, 97,116,111,114, 32, 40,100, 44,107, 44, 97, 44, 99, 41, 10, 10, 9,108,111, 99, 97,108, 32,111,112, 95,107, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,107, 44, 32, 34, 94, 37,115, 42, 34, 44, 32, 34, 34, 41, 10, 9,111, 112, 95,107, 32, 61, 32,115,116,114,105,110,103, 46,103,115, 117, 98, 40,107, 44, 32, 34, 37,115, 42, 36, 34, 44, 32, 34, 34, 41, 10, 9, 45, 45,105,102, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,107, 44, 32, 34, 94, 91, 37,119, 95, 58, 37,100, 60, 62, 37, 42, 37, 38, 93, 43, 36, 34, 41, 32, 116,104,101,110, 10, 9,105,102, 32,100, 32, 61, 61, 32, 34, 111,112,101,114, 97,116,111,114, 34, 32, 97,110,100, 32,107, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 10, 9, 9, 100, 32, 61, 32,107, 46, 46, 34, 32,111,112,101,114, 97,116, 111,114, 34, 10, 9,101,108,115,101,105,102, 32,110,111,116, 32, 95, 84, 77, 91,111,112, 95,107, 93, 32,116,104,101,110, 10, 10, 9, 9,105,102, 32,102,108, 97,103,115, 91, 39, 87, 39, 93, 32,116,104,101,110, 10, 9, 9, 9,101,114,114,111, 114, 40, 34,116,111,108,117, 97, 58, 32,110,111, 32,115,117, 112,112,111,114,116, 32,102,111,114, 32,111,112,101,114, 97, 116,111,114, 34, 32, 46, 46, 32,102, 46,107,105,110,100, 41, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,119, 97,114,110, 105,110,103, 40, 34, 78,111, 32,115,117,112,112,111,114,116, 32,102,111,114, 32,111,112,101,114, 97,116,111,114, 32, 34, 46, 46,111,112, 95,107, 46, 46, 34, 44, 32,105,103,110,111, 114,105,110,103, 34, 41, 10, 9, 9, 9,114,101,116,117,114, 110, 32,110,105,108, 10, 9, 9,101,110,100, 10, 9,101,110, 100, 10, 10, 9,108,111, 99, 97,108, 32,114,101,102, 32, 61, 32, 39, 39, 10, 32,108,111, 99, 97,108, 32,116, 32, 61, 32, 115,112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40, 115,116,114,115,117, 98, 40, 97, 44, 50, 44,115,116,114,108, 101,110, 40, 97, 41, 45, 49, 41, 44, 39, 44, 39, 41, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101, 32, 98,114, 97, 99,101,115, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,108,111, 99, 97,108, 32,108, 32, 61, 32,123,110, 61, 48, 125, 10, 32,119,104,105,108,101, 32,116, 91,105, 93, 32,100, 111, 10, 32, 32,108, 46,110, 32, 61, 32,108, 46,110, 43, 49, 10, 32, 32,108, 91,108, 46,110, 93, 32, 61, 32, 68,101, 99, 108, 97,114, 97,116,105,111,110, 40,116, 91,105, 93, 44, 39, 118, 97,114, 39, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,105,102, 32,107, 32, 61, 61, 32, 39, 91, 93, 39, 32,116,104,101,110, 10, 9, 32,108,111, 99, 97,108, 32, 95, 10, 9, 32, 95, 44, 32, 95, 44, 32,114,101, 102, 32, 61, 32,115,116,114,102,105,110,100, 40,100, 44, 39, 40, 38, 41, 39, 41, 10, 32, 32,100, 32, 61, 32,103,115,117, 98, 40,100, 44, 39, 38, 39, 44, 39, 39, 41, 10, 32,101,108, 115,101,105,102, 32,107, 61, 61, 39, 38, 91, 93, 39, 32,116, 104,101,110, 10, 32, 32,108, 46,110, 32, 61, 32,108, 46,110, 43, 49, 10, 32, 32,108, 91,108, 46,110, 93, 32, 61, 32, 68, 101, 99,108, 97,114, 97,116,105,111,110, 40,100, 44, 39,118, 97,114, 39, 41, 10, 32, 32,108, 91,108, 46,110, 93, 46,110, 97,109,101, 32, 61, 32, 39,116,111,108,117, 97, 95,118, 97, 108,117,101, 39, 10, 32,101,110,100, 10, 32,108,111, 99, 97, 108, 32,102, 32, 61, 32, 68,101, 99,108, 97,114, 97,116,105, 111,110, 40,100, 44, 39,102,117,110, 99, 39, 41, 10, 32,105, 102, 32,107, 32, 61, 61, 32, 39, 91, 93, 39, 32, 97,110,100, 32, 40,108, 91, 49, 93, 61, 61,110,105,108, 32,111,114, 32, 105,115, 98, 97,115,105, 99, 40,108, 91, 49, 93, 46,116,121, 112,101, 41,126, 61, 39,110,117,109, 98,101,114, 39, 41, 32, 116,104,101,110, 10, 32, 32,101,114,114,111,114, 40, 39,111, 112,101,114, 97,116,111,114, 91, 93, 32, 99, 97,110, 32,111, 110,108,121, 32, 98,101, 32,100,101,102,105,110,101,100, 32, 102,111,114, 32,110,117,109,101,114,105, 99, 32,105,110,100, 101,120, 46, 39, 41, 10, 32,101,110,100, 10, 32,102, 46, 97, 114,103,115, 32, 61, 32,108, 10, 32,102, 46, 99,111,110,115, 116, 32, 61, 32, 99, 10, 32,102, 46,107,105,110,100, 32, 61, 32,111,112, 95,107, 10, 32,102, 46,108,110, 97,109,101, 32, 61, 32, 34, 46, 34, 46, 46, 40, 95, 84, 77, 91,102, 46,107, 105,110,100, 93, 32,111,114, 32,102, 46,107,105,110,100, 41, 10, 32,105,102, 32,110,111,116, 32, 95, 84, 77, 91,102, 46, 107,105,110,100, 93, 32,116,104,101,110, 10, 32, 9,102, 46, 99, 97,115,116, 95,111,112,101,114, 97,116,111,114, 32, 61, 32,116,114,117,101, 10, 32,101,110,100, 10, 32,105,102, 32, 102, 46,107,105,110,100, 32, 61, 61, 32, 39, 91, 93, 39, 32, 97,110,100, 32,114,101,102, 61, 61, 39, 38, 39, 32, 97,110, 100, 32,102, 46, 99,111,110,115,116,126, 61, 39, 99,111,110, 115,116, 39, 32,116,104,101,110, 10, 32, 32, 79,112,101,114, 97,116,111,114, 40,100, 44, 39, 38, 39, 46, 46,107, 44, 97, 44, 99, 41, 32, 9, 45, 45, 32, 99,114,101, 97,116,101, 32, 99,111,114,114,101,115,112,111,100,105,110,103, 32,115,101, 116, 32,111,112,101,114, 97,116,111,114, 10, 32,101,110,100, 10, 32,114,101,116,117,114,110, 32, 95, 79,112,101,114, 97, 116,111,114, 40,102, 41, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/operator.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 10, 95,103,108,111, 98, 97,108, 95,116,101,109,112,108, 97, 116,101,115, 32, 61, 32,123,125, 10, 10, 99,108, 97,115,115, 84,101,109,112,108, 97,116,101, 67,108, 97,115,115, 32, 61, 32,123, 10, 10, 9,110, 97,109,101, 32, 61, 32, 39, 39, 44, 10, 9, 98,111,100,121, 32, 61, 32, 39, 39, 44, 10, 9,112, 97,114,101,110,116,115, 32, 61, 32,123,125, 44, 10, 9, 97, 114,103,115, 32, 61, 32,123,125, 44, 32, 45, 45, 32,116,104, 101, 32,116,101,109,112,108, 97,116,101, 32, 97,114,103,117, 109,101,110,116,115, 10,125, 10, 10, 99,108, 97,115,115, 84, 101,109,112,108, 97,116,101, 67,108, 97,115,115, 46, 95, 95, 105,110,100,101,120, 32, 61, 32, 99,108, 97,115,115, 84,101, 109,112,108, 97,116,101, 67,108, 97,115,115, 10, 10, 10,102, 117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 84,101, 109,112,108, 97,116,101, 67,108, 97,115,115, 58,116,104,114, 111,119, 40,116,121,112,101,115, 44, 32,108,111, 99, 97,108, 95,115, 99,111,112,101, 41, 10, 10, 9, 45, 45,105,102, 32, 116, 97, 98,108,101, 46,103,101,116,110, 40,116,121,112,101, 115, 41, 32,126, 61, 32,116, 97, 98,108,101, 46,103,101,116, 110, 40,115,101,108,102, 46, 97,114,103,115, 41, 32,116,104, 101,110, 10, 9, 45, 45, 9,101,114,114,111,114, 40, 34, 35, 105,110,118, 97,108,105,100, 32,112, 97,114, 97,109,101,116, 101,114, 32, 99,111,117,110,116, 34, 41, 10, 9, 45, 45,101, 110,100, 10, 10, 9, 45, 45, 32,114,101,112,108, 97, 99,101, 10, 9,102,111,114, 32,105, 32, 61, 49, 32, 44, 32,116,121, 112,101,115, 46,110, 32,100,111, 10, 10, 9, 9,108,111, 99, 97,108, 32, 73,108, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40,116,121,112,101,115, 91,105, 93, 44, 32, 34, 32, 34, 41, 10, 9, 9,105,102, 32,116, 97, 98,108,101, 46,103,101,116,110, 40, 73,108, 41, 32,126, 61, 32,116, 97, 98,108,101, 46,103,101,116,110, 40,115,101,108, 102, 46, 97,114,103,115, 41, 32,116,104,101,110, 10, 9, 9, 9,101,114,114,111,114, 40, 34, 35,105,110,118, 97,108,105, 100, 32,112, 97,114, 97,109,101,116,101,114, 32, 99,111,117, 110,116, 32,102,111,114, 32, 34, 46, 46,116,121,112,101,115, 91,105, 93, 41, 10, 9, 9,101,110,100, 10, 9, 9,108,111, 99, 97,108, 32, 98, 73, 32, 61, 32,115,101,108,102, 46, 98, 111,100,121, 10, 9, 9,108,111, 99, 97,108, 32,112, 73, 32, 61, 32,123,125, 10, 9, 9,102,111,114, 32,106, 32, 61, 32, 49, 44,115,101,108,102, 46, 97,114,103,115, 46,110, 32,100, 111, 10, 9, 9, 9, 45, 45, 84,108, 91,106, 93, 32, 61, 32, 102,105,110,100,116,121,112,101, 40, 84,108, 91,106, 93, 41, 32,111,114, 32, 84,108, 91,106, 93, 10, 9, 9, 9, 98, 73, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 98, 73, 44, 32, 34, 40, 91, 94, 95, 37,119, 93, 41, 34, 46, 46,115,101,108,102, 46, 97,114,103,115, 91,106, 93, 46, 46, 34, 40, 91, 94, 95, 37,119, 93, 41, 34, 44, 32, 34, 37, 49, 34, 46, 46, 73,108, 91,106, 93, 46, 46, 34, 37, 50, 34, 41, 10, 9, 9, 9,105,102, 32,115,101,108,102, 46,112, 97,114, 101,110,116,115, 32,116,104,101,110, 10, 9, 9, 9, 9,102, 111,114, 32,105, 61, 49, 44,116, 97, 98,108,101, 46,103,101, 116,110, 40,115,101,108,102, 46,112, 97,114,101,110,116,115, 41, 32,100,111, 10, 9, 9, 9, 9, 9,112, 73, 91,105, 93, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 115,101,108,102, 46,112, 97,114,101,110,116,115, 91,105, 93, 44, 32, 34, 40, 91, 94, 95, 37,119, 93, 63, 41, 34, 46, 46, 115,101,108,102, 46, 97,114,103,115, 91,106, 93, 46, 46, 34, 40, 91, 94, 95, 37,119, 93, 63, 41, 34, 44, 32, 34, 37, 49, 34, 46, 46, 73,108, 91,106, 93, 46, 46, 34, 37, 50, 34, 41, 10, 9, 9, 9, 9,101,110,100, 10, 9, 9, 9,101,110,100, 10, 9, 9,101,110,100, 10, 9, 9, 45, 45,108,111, 99, 97, 108, 32, 97,112,112,101,110,100, 32, 61, 32, 34, 60, 34, 46, 46,115,116,114,105,110,103, 46,103,115,117, 98, 40,116,121, 112,101,115, 91,105, 93, 44, 32, 34, 37,115, 43, 34, 44, 32, 34, 44, 34, 41, 46, 46, 34, 62, 34, 10, 9, 9,108,111, 99, 97,108, 32, 97,112,112,101,110,100, 32, 61, 32, 34, 60, 34, 46, 46, 99,111,110, 99, 97,116, 40, 73,108, 44, 32, 49, 44, 32,116, 97, 98,108,101, 46,103,101,116,110, 40, 73,108, 41, 44, 32, 34, 44, 34, 41, 46, 46, 34, 62, 34, 10, 9, 9, 97, 112,112,101,110,100, 32, 61, 32,115,116,114,105,110,103, 46, 103,115,117, 98, 40, 97,112,112,101,110,100, 44, 32, 34, 37, 115, 42, 44, 37,115, 42, 34, 44, 32, 34, 44, 34, 41, 10, 9, 9, 97,112,112,101,110,100, 32, 61, 32,115,116,114,105,110, 103, 46,103,115,117, 98, 40, 97,112,112,101,110,100, 44, 32, 34, 62, 62, 34, 44, 32, 34, 62, 32, 62, 34, 41, 10, 9, 9, 102,111,114, 32,105, 61, 49, 44,116, 97, 98,108,101, 46,103, 101,116,110, 40,112, 73, 41, 32,100,111, 10, 9, 9, 9, 45, 45,112, 73, 91,105, 93, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,112, 73, 91,105, 93, 44, 32, 34, 62, 62, 34, 44, 32, 34, 62, 32, 62, 34, 41, 10, 9, 9, 9,112, 73, 91,105, 93, 32, 61, 32,114,101,115,111,108,118,101, 95, 116,101,109,112,108, 97,116,101, 95,116,121,112,101,115, 40, 112, 73, 91,105, 93, 41, 10, 9, 9,101,110,100, 10, 9, 9, 98, 73, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 98, 73, 44, 32, 34, 62, 62, 34, 44, 32, 34, 62, 32, 62, 34, 41, 10, 9, 9,108,111, 99, 97,108, 32,110, 32, 61, 32,115,101,108,102, 46,110, 97,109,101, 10, 9, 9,105,102, 32,108,111, 99, 97,108, 95,115, 99,111,112,101, 32,116,104, 101,110, 10, 9, 9, 9,110, 32, 61, 32,115,101,108,102, 46, 108,111, 99, 97,108, 95,110, 97,109,101, 10, 9, 9,101,110, 100, 10, 10, 9, 9, 67,108, 97,115,115, 40,110, 46, 46, 97, 112,112,101,110,100, 44, 32,112, 73, 44, 32, 98, 73, 41, 10, 9,101,110,100, 10,101,110,100, 10, 10, 10,102,117,110, 99, 116,105,111,110, 32, 84,101,109,112,108, 97,116,101, 67,108, 97,115,115, 40,110, 97,109,101, 44, 32,112, 97,114,101,110, 116,115, 44, 32, 98,111,100,121, 44, 32,112, 97,114, 97,109, 101,116,101,114,115, 41, 10, 10, 9,108,111, 99, 97,108, 32, 111, 32, 61, 32,123, 10, 9, 10, 9, 9,112, 97,114,101,110, 116,115, 32, 61, 32,112, 97,114,101,110,116,115, 44, 10, 9, 9, 98,111,100,121, 32, 61, 32, 98,111,100,121, 44, 10, 9, 9, 97,114,103,115, 32, 61, 32,112, 97,114, 97,109,101,116, 101,114,115, 44, 10, 9,125, 10, 9, 10, 9,108,111, 99, 97, 108, 32,111,110, 97,109,101, 32, 61, 32,115,116,114,105,110, 103, 46,103,115,117, 98, 40,110, 97,109,101, 44, 32, 34, 64, 46, 42, 36, 34, 44, 32, 34, 34, 41, 10, 9,111,110, 97,109, 101, 32, 61, 32,103,101,116,110, 97,109,101,115,112, 97, 99, 101, 40, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101, 114, 46, 99,117,114,114, 41, 46, 46,111,110, 97,109,101, 10, 9,111, 46,110, 97,109,101, 32, 61, 32,111,110, 97,109,101, 10, 10, 9,111, 46,108,111, 99, 97,108, 95,110, 97,109,101, 32, 61, 32,110, 97,109,101, 10, 9, 10, 9,115,101,116,109, 101,116, 97,116, 97, 98,108,101, 40,111, 44, 32, 99,108, 97, 115,115, 84,101,109,112,108, 97,116,101, 67,108, 97,115,115, 41, 10, 10, 9,105,102, 32, 95,103,108,111, 98, 97,108, 95, 116,101,109,112,108, 97,116,101,115, 91,111,110, 97,109,101, 93, 32,116,104,101,110, 10, 9, 9,119, 97,114,110,105,110, 103, 40, 34, 68,117,112,108,105, 99, 97,116,101, 32,100,101, 99,108, 97,114, 97,116,105,111,110, 32,111,102, 32,116,101, 109,112,108, 97,116,101, 32, 34, 46, 46,111,110, 97,109,101, 41, 10, 9,101,108,115,101, 10, 9, 9, 95,103,108,111, 98, 97,108, 95,116,101,109,112,108, 97,116,101,115, 91,111,110, 97,109,101, 93, 32, 61, 32,111, 10, 9,101,110,100, 10, 10, 9,114,101,116,117,114,110, 32,111, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/template_class.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32, 99,108, 97,115,115, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114,105,116,116, 101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97, 102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117, 108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111,100,101, 32,105,115, 32,102,114,101,101, 32,115,111,102,116,119, 97, 114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101,100, 105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110, 100, 47,111,114, 32,109,111,100,105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116,119, 97,114, 101, 32,112,114,111,118,105,100,101,100, 32,104,101,114,101, 117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97,117,116,104, 111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105,103, 97,116,105,111,110, 32,116,111, 32,112,114,111,118,105,100, 101, 32,109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32, 115,117,112,112,111,114,116, 44, 32,117,112,100, 97,116,101, 115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101,109,101, 110,116,115, 44, 32,111,114, 32,109,111,100,105,102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 45, 45, 32, 67,108, 97,115,115, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101, 112,114,101,115,101,110,116,115, 32, 97, 32, 99,108, 97,115, 115, 32,100,101,102,105,110,105,116,105,111,110, 46, 10, 45, 45, 32, 83,116,111,114,101,115, 32,116,104,101, 32,102,111, 108,108,111,119,105,110,103, 32,102,105,101,108,100,115, 58, 10, 45, 45, 32, 32, 32, 32,110, 97,109,101, 32, 61, 32, 99, 108, 97,115,115, 32,110, 97,109,101, 10, 45, 45, 32, 32, 32, 32, 98, 97,115,101, 32, 61, 32, 99,108, 97,115,115, 32, 98, 97,115,101, 44, 32,105,102, 32, 97,110,121, 32, 40,111,110, 108,121, 32,115,105,110,103,108,101, 32,105,110,104,101,114, 105,116, 97,110, 99,101, 32,105,115, 32,115,117,112,112,111, 114,116,101,100, 41, 10, 45, 45, 32, 32, 32, 32,123,105,125, 32, 32, 61, 32,108,105,115,116, 32,111,102, 32,109,101,109, 98,101,114,115, 10, 99,108, 97,115,115, 67,108, 97,115,115, 32, 61, 32,123, 10, 32, 99,108, 97,115,115,116,121,112,101, 32, 61, 32, 39, 99,108, 97,115,115, 39, 44, 10, 32,110, 97, 109,101, 32, 61, 32, 39, 39, 44, 10, 32, 98, 97,115,101, 32, 61, 32, 39, 39, 44, 10, 32,116,121,112,101, 32, 61, 32, 39, 39, 44, 10, 32, 98,116,121,112,101, 32, 61, 32, 39, 39, 44, 10, 32, 99,116,121,112,101, 32, 61, 32, 39, 39, 44, 10,125, 10, 99,108, 97,115,115, 67,108, 97,115,115, 46, 95, 95,105, 110,100,101,120, 32, 61, 32, 99,108, 97,115,115, 67,108, 97, 115,115, 10,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40, 99,108, 97,115,115, 67,108, 97,115,115, 44, 99,108, 97, 115,115, 67,111,110,116, 97,105,110,101,114, 41, 10, 10, 10, 45, 45, 32,114,101,103,105,115,116,101,114, 32, 99,108, 97, 115,115, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97, 115,115, 67,108, 97,115,115, 58,114,101,103,105,115,116,101, 114, 32, 40,112,114,101, 41, 10, 10, 9,105,102, 32,110,111, 116, 32,115,101,108,102, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 32,116, 104,101,110, 10, 9, 9,114,101,116,117,114,110, 10, 9,101, 110,100, 10, 10, 32,112,114,101, 32, 61, 32,112,114,101, 32, 111,114, 32, 39, 39, 10, 32,112,117,115,104, 40,115,101,108, 102, 41, 10, 9,105,102, 32, 95, 99,111,108,108,101, 99,116, 91,115,101,108,102, 46,116,121,112,101, 93, 32,116,104,101, 110, 10, 9, 9,111,117,116,112,117,116, 40,112,114,101, 44, 39, 35,105,102,100,101,102, 32, 95, 95, 99,112,108,117,115, 112,108,117,115, 92,110, 39, 41, 10, 32, 32,111,117,116,112, 117,116, 40,112,114,101, 46, 46, 39,116,111,108,117, 97, 95, 99, 99,108, 97,115,115, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101,108,102, 46,108,110, 97,109,101, 46, 46, 39, 34, 44, 34, 39, 46, 46,115,101,108,102, 46,116,121, 112,101, 46, 46, 39, 34, 44, 34, 39, 46, 46,115,101,108,102, 46, 98,116,121,112,101, 46, 46, 39, 34, 44, 39, 46, 46, 95, 99,111,108,108,101, 99,116, 91,115,101,108,102, 46,116,121, 112,101, 93, 46, 46, 39, 41, 59, 39, 41, 10, 9, 9,111,117, 116,112,117,116, 40,112,114,101, 44, 39, 35,101,108,115,101, 92,110, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40,112, 114,101, 46, 46, 39,116,111,108,117, 97, 95, 99, 99,108, 97, 115,115, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46, 115,101,108,102, 46,108,110, 97,109,101, 46, 46, 39, 34, 44, 34, 39, 46, 46,115,101,108,102, 46,116,121,112,101, 46, 46, 39, 34, 44, 34, 39, 46, 46,115,101,108,102, 46, 98,116,121, 112,101, 46, 46, 39, 34, 44, 78, 85, 76, 76, 41, 59, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40,112,114,101, 44, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 9,101,108,115, 101, 10, 32, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 39,116,111,108,117, 97, 95, 99, 99,108, 97,115,115, 40, 116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101,108, 102, 46,108,110, 97,109,101, 46, 46, 39, 34, 44, 34, 39, 46, 46,115,101,108,102, 46,116,121,112,101, 46, 46, 39, 34, 44, 34, 39, 46, 46,115,101,108,102, 46, 98,116,121,112,101, 46, 46, 39, 34, 44, 78, 85, 76, 76, 41, 59, 39, 41, 10, 9,101, 110,100, 10, 9,105,102, 32,115,101,108,102, 46,101,120,116, 114, 97, 95, 98, 97,115,101,115, 32,116,104,101,110, 10, 9, 9,102,111,114, 32,107, 44, 98, 97,115,101, 32,105,110, 32, 105,112, 97,105,114,115, 40,115,101,108,102, 46,101,120,116, 114, 97, 95, 98, 97,115,101,115, 41, 32,100,111, 10, 9, 9, 9, 45, 45, 32,110,111,116, 32,110,111,119, 10, 32, 32, 32, 45, 45,111,117,116,112,117,116, 40,112,114,101, 46, 46, 39, 32,116,111,108,117, 97, 95, 97,100,100, 98, 97,115,101, 40, 116,111,108,117, 97, 95, 83, 44, 32, 34, 39, 46, 46,115,101, 108,102, 46,116,121,112,101, 46, 46, 39, 34, 44, 32, 34, 39, 46, 46, 98, 97,115,101, 46, 46, 39, 34, 41, 59, 39, 41, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10, 32,111,117,116, 112,117,116, 40,112,114,101, 46, 46, 39,116,111,108,117, 97, 95, 98,101,103,105,110,109,111,100,117,108,101, 40,116,111, 108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101,108,102, 46, 108,110, 97,109,101, 46, 46, 39, 34, 41, 59, 39, 41, 10, 32, 108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108, 101, 32,115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32, 115,101,108,102, 91,105, 93, 58,114,101,103,105,115,116,101, 114, 40,112,114,101, 46, 46, 39, 32, 39, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,111,117, 116,112,117,116, 40,112,114,101, 46, 46, 39,116,111,108,117, 97, 95,101,110,100,109,111,100,117,108,101, 40,116,111,108, 117, 97, 95, 83, 41, 59, 39, 41, 10, 9,112,111,112, 40, 41, 10,101,110,100, 10, 10, 45, 45, 32,114,101,116,117,114,110, 32, 99,111,108,108,101, 99,116,105,111,110, 32,114,101,113, 117,105,114,101,109,101,110,116, 10,102,117,110, 99,116,105, 111,110, 32, 99,108, 97,115,115, 67,108, 97,115,115, 58,114, 101,113,117,105,114,101, 99,111,108,108,101, 99,116,105,111, 110, 32, 40,116, 41, 10, 9,105,102, 32,115,101,108,102, 46, 102,108, 97,103,115, 46,112,114,111,116,101, 99,116,101,100, 95,100,101,115,116,114,117, 99,116,111,114, 32,111,114, 32, 40,110,111,116, 32,115,101,108,102, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 41, 32,116,104,101,110, 10, 9, 9,114,101,116,117,114, 110, 32,102, 97,108,115,101, 10, 9,101,110,100, 10, 32,112, 117,115,104, 40,115,101,108,102, 41, 10, 9,108,111, 99, 97, 108, 32,114, 32, 61, 32,102, 97,108,115,101, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108,101, 32, 115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32,114, 32, 61, 32,115,101,108,102, 91,105, 93, 58,114,101,113,117,105, 114,101, 99,111,108,108,101, 99,116,105,111,110, 40,116, 41, 32,111,114, 32,114, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 9,112,111,112, 40, 41, 10, 9, 45, 45, 32,111,110,108,121, 32, 99,108, 97,115,115, 32,116,104, 97,116, 32,101,120,112,111,114,116,115, 32,100,101,115,116, 114,117, 99,116,111,114, 32, 99, 97,110, 32, 98,101, 32, 97, 112,112,114,111,112,114,105, 97,116,101,108,121, 32, 99,111, 108,108,101, 99,116,101,100, 10, 9, 45, 45, 32, 99,108, 97, 115,115,101,115, 32,116,104, 97,116, 32,101,120,112,111,114, 116, 32, 99,111,110,115,116,114,117, 99,116,111,114,115, 32, 110,101,101,100, 32,116,111, 32,104, 97,118,101, 32, 97, 32, 99,111,108,108,101, 99,116,111,114, 32, 40,111,118,101,114, 114,105,100,101,100, 32, 98,121, 32, 45, 68, 32,102,108, 97, 103, 32,111,110, 32, 99,111,109,109, 97,110,100, 32,108,105, 110,101, 41, 10, 9,105,102, 32,115,101,108,102, 46, 95,100, 101,108,101,116,101, 32,111,114, 32, 40, 40,110,111,116, 32, 102,108, 97,103,115, 91, 39, 68, 39, 93, 41, 32, 97,110,100, 32,115,101,108,102, 46, 95,110,101,119, 41, 32,116,104,101, 110, 10, 9, 9, 45, 45,116, 91,115,101,108,102, 46,116,121, 112,101, 93, 32, 61, 32, 34,116,111,108,117, 97, 95, 99,111, 108,108,101, 99,116, 95, 34, 32, 46, 46, 32,103,115,117, 98, 40,115,101,108,102, 46,116,121,112,101, 44, 34, 58, 58, 34, 44, 34, 95, 34, 41, 10, 9, 9,116, 91,115,101,108,102, 46, 116,121,112,101, 93, 32, 61, 32, 34,116,111,108,117, 97, 95, 99,111,108,108,101, 99,116, 95, 34, 32, 46, 46, 32, 99,108, 101, 97,110, 95,116,101,109,112,108, 97,116,101, 40,115,101, 108,102, 46,116,121,112,101, 41, 10, 9, 9,114, 32, 61, 32, 116,114,117,101, 10, 9,101,110,100, 10, 32,114,101,116,117, 114,110, 32,114, 10,101,110,100, 10, 10, 45, 45, 32,111,117, 116,112,117,116, 32,116, 97,103,115, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 67,108, 97,115,115, 58, 100,101, 99,108,116,121,112,101, 32, 40, 41, 10, 32,112,117, 115,104, 40,115,101,108,102, 41, 10, 9,115,101,108,102, 46, 116,121,112,101, 32, 61, 32,114,101,103,116,121,112,101, 40, 115,101,108,102, 46,111,114,105,103,105,110, 97,108, 95,110, 97,109,101, 32,111,114, 32,115,101,108,102, 46,110, 97,109, 101, 41, 10, 9,115,101,108,102, 46, 98,116,121,112,101, 32, 61, 32,116,121,112,101,118, 97,114, 40,115,101,108,102, 46, 98, 97,115,101, 41, 10, 9,115,101,108,102, 46, 99,116,121, 112,101, 32, 61, 32, 39, 99,111,110,115,116, 32, 39, 46, 46, 115,101,108,102, 46,116,121,112,101, 10, 9,105,102, 32,115, 101,108,102, 46,101,120,116,114, 97, 95, 98, 97,115,101,115, 32,116,104,101,110, 10, 9, 9,102,111,114, 32,105, 61, 49, 44,116, 97, 98,108,101, 46,103,101,116,110, 40,115,101,108, 102, 46,101,120,116,114, 97, 95, 98, 97,115,101,115, 41, 32, 100,111, 10, 9, 9, 9,115,101,108,102, 46,101,120,116,114, 97, 95, 98, 97,115,101,115, 91,105, 93, 32, 61, 32,116,121, 112,101,118, 97,114, 40,115,101,108,102, 46,101,120,116,114, 97, 95, 98, 97,115,101,115, 91,105, 93, 41, 10, 9, 9,101, 110,100, 10, 9,101,110,100, 10, 32,108,111, 99, 97,108, 32, 105, 61, 49, 10, 32,119,104,105,108,101, 32,115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32,115,101,108,102, 91,105, 93, 58,100,101, 99,108,116,121,112,101, 40, 41, 10, 32, 32, 105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 9,112, 111,112, 40, 41, 10,101,110,100, 10, 10, 10, 45, 45, 32, 80, 114,105,110,116, 32,109,101,116,104,111,100, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67,108, 97,115, 115, 58,112,114,105,110,116, 32, 40,105,100,101,110,116, 44, 99,108,111,115,101, 41, 10, 32,112,114,105,110,116, 40,105, 100,101,110,116, 46, 46, 34, 67,108, 97,115,115,123, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101, 108,102, 46,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 98, 97,115,101, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46, 98, 97,115,101, 46, 46, 34, 39, 59, 34, 41, 10, 32, 112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 108,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46,108,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,116,121,112,101, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46,116,121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32, 112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 98,116,121,112,101, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46, 98,116,121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 99,116,121,112,101, 32, 61, 32, 39, 34, 46, 46,115,101, 108,102, 46, 99,116,121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104, 105,108,101, 32,115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32,115,101,108,102, 91,105, 93, 58,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 34, 44, 34, 44, 34, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110, 100, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34,125, 34, 46, 46, 99,108,111,115,101, 41, 10,101,110, 100, 10, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97, 115,115, 67,108, 97,115,115, 58,115,101,116, 95,112,114,111, 116,101, 99,116,101,100, 95,100,101,115,116,114,117, 99,116, 111,114, 40,112, 41, 10, 9,115,101,108,102, 46,102,108, 97, 103,115, 46,112,114,111,116,101, 99,116,101,100, 95,100,101, 115,116,114,117, 99,116,111,114, 32, 61, 32,115,101,108,102, 46,102,108, 97,103,115, 46,112,114,111,116,101, 99,116,101, 100, 95,100,101,115,116,114,117, 99,116,111,114, 32,111,114, 32,112, 10,101,110,100, 10, 10, 45, 45, 32, 73,110,116,101, 114,110, 97,108, 32, 99,111,110,115,116,114,117, 99,116,111, 114, 10,102,117,110, 99,116,105,111,110, 32, 95, 67,108, 97, 115,115, 32, 40,116, 41, 10, 32,115,101,116,109,101,116, 97, 116, 97, 98,108,101, 40,116, 44, 99,108, 97,115,115, 67,108, 97,115,115, 41, 10, 32,116, 58, 98,117,105,108,100,110, 97, 109,101,115, 40, 41, 10, 32, 97,112,112,101,110,100, 40,116, 41, 10, 32,114,101,116,117,114,110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110,115,116,114,117, 99,116,111, 114, 10, 45, 45, 32, 69,120,112,101, 99,116,115, 32,116,104, 101, 32,110, 97,109,101, 44, 32,116,104,101, 32, 98, 97,115, 101, 32, 40, 97,114,114, 97,121, 41, 32, 97,110,100, 32,116, 104,101, 32, 98,111,100,121, 32,111,102, 32,116,104,101, 32, 99,108, 97,115,115, 46, 10,102,117,110, 99,116,105,111,110, 32, 67,108, 97,115,115, 32, 40,110, 44,112, 44, 98, 41, 10, 10, 9,105,102, 32,116, 97, 98,108,101, 46,103,101,116,110, 40,112, 41, 32, 62, 32, 49, 32,116,104,101,110, 10, 9, 9, 98, 32, 61, 32,115,116,114,105,110,103, 46,115,117, 98, 40, 98, 44, 32, 49, 44, 32, 45, 50, 41, 10, 9, 9,102,111,114, 32,105, 61, 50, 44,116, 97, 98,108,101, 46,103,101,116,110, 40,112, 41, 44, 49, 32,100,111, 10, 9, 9, 9, 98, 32, 61, 32, 98, 46, 46, 34, 92,110, 32,116,111,108,117, 97, 95,105, 110,104,101,114,105,116,115, 32, 34, 46, 46,112, 91,105, 93, 46, 46, 34, 32, 95, 95, 34, 46, 46,112, 91,105, 93, 46, 46, 34, 95, 95, 59, 92,110, 34, 10, 9, 9,101,110,100, 10, 9, 9, 98, 32, 61, 32, 98, 46, 46, 34, 92,110,125, 34, 10, 9, 101,110,100, 10, 10, 9, 45, 45, 32, 99,104,101, 99,107, 32, 102,111,114, 32,116,101,109,112,108, 97,116,101, 10, 9, 98, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 98, 44, 32, 34, 94,123, 37,115, 42, 84, 69, 77, 80, 76, 65, 84, 69, 95, 66, 73, 78, 68, 34, 44, 32, 34,123, 92,110, 84, 79, 76, 85, 65, 95, 84, 69, 77, 80, 76, 65, 84, 69, 95, 66, 73, 78, 68, 34, 41, 10, 9,108,111, 99, 97,108, 32,116, 44, 95, 44, 84, 44, 73, 32, 61, 32,115,116,114,105,110,103, 46, 102,105,110,100, 40, 98, 44, 32, 39, 94,123, 37,115, 42, 84, 79, 76, 85, 65, 95, 84, 69, 77, 80, 76, 65, 84, 69, 95, 66, 73, 78, 68, 37,115, 42, 37, 40, 43, 37,115, 42, 92, 34, 63, 40, 91, 94, 92, 34, 44, 93, 42, 41, 92, 34, 63, 37,115, 42, 44, 37,115, 42, 40, 91, 94, 37, 41, 93, 42, 41, 37,115, 42, 37, 41, 43, 39, 41, 10, 9,105,102, 32,116, 32,116,104,101, 110, 10, 10, 9, 9, 45, 45, 32,114,101,109,111,118,101, 32, 113,117,111,116,101,115, 10, 9, 9, 73, 32, 61, 32,115,116, 114,105,110,103, 46,103,115,117, 98, 40, 73, 44, 32, 34, 92, 34, 34, 44, 32, 34, 34, 41, 10, 9, 9, 84, 32, 61, 32,115, 116,114,105,110,103, 46,103,115,117, 98, 40, 84, 44, 32, 34, 92, 34, 34, 44, 32, 34, 34, 41, 10, 9, 9, 45, 45, 32,103, 101,116, 32,116,121,112,101, 32,108,105,115,116, 10, 9, 9, 108,111, 99, 97,108, 32,116,121,112,101,115, 32, 61, 32,115, 112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40, 73, 44, 32, 34, 44, 34, 41, 10, 9, 9, 45, 45, 32,114,101,109, 111,118,101, 32, 84, 69, 77, 80, 76, 65, 84, 69, 95, 66, 73, 78, 68, 32,108,105,110,101, 10, 9, 9,108,111, 99, 97,108, 32, 98,115, 32, 61, 32,115,116,114,105,110,103, 46,103,115, 117, 98, 40, 98, 44, 32, 34, 94,123, 37,115, 42, 84, 79, 76, 85, 65, 95, 84, 69, 77, 80, 76, 65, 84, 69, 95, 66, 73, 78, 68, 91, 94, 92,110, 93, 42, 92,110, 34, 44, 32, 34,123, 92, 110, 34, 41, 10, 9, 9, 9, 10, 9, 9,108,111, 99, 97,108, 32, 84,108, 32, 61, 32,115,112,108,105,116, 40, 84, 44, 32, 34, 32, 34, 41, 10, 9, 9,108,111, 99, 97,108, 32,116, 99, 32, 61, 32, 84,101,109,112,108, 97,116,101, 67,108, 97,115, 115, 40,110, 44, 32,112, 44, 32, 98,115, 44, 32, 84,108, 41, 10, 10, 9, 9, 10, 9, 9,116, 99, 58,116,104,114,111,119, 40,116,121,112,101,115, 44, 32,116,114,117,101, 41, 10, 9, 9, 45, 45,102,111,114, 32,105, 61, 49, 44,116,121,112,101, 115, 46,110, 32,100,111, 10, 9, 9, 45, 45, 9,116, 99, 58, 116,104,114,111,119, 40,115,112,108,105,116, 95, 99, 95,116, 111,107,101,110,115, 40,116,121,112,101,115, 91,105, 93, 44, 32, 34, 32, 34, 41, 44, 32,116,114,117,101, 41, 10, 9, 9, 45, 45,101,110,100, 10, 9, 9,114,101,116,117,114,110, 10, 9,101,110,100, 10, 9, 10, 9,108,111, 99, 97,108, 32,109, 98, 97,115,101, 10, 10, 9,105,102, 32,112, 32,116,104,101, 110, 10, 9, 9,109, 98, 97,115,101, 32, 61, 32,116, 97, 98, 108,101, 46,114,101,109,111,118,101, 40,112, 44, 32, 49, 41, 10, 9, 9,105,102, 32,110,111,116, 32,112, 91, 49, 93, 32, 116,104,101,110, 32,112, 32, 61, 32,110,105,108, 32,101,110, 100, 10, 9,101,110,100, 10, 10, 9,109, 98, 97,115,101, 32, 61, 32,109, 98, 97,115,101, 32, 97,110,100, 32,114,101,115, 111,108,118,101, 95,116,101,109,112,108, 97,116,101, 95,116, 121,112,101,115, 40,109, 98, 97,115,101, 41, 10, 10, 9,108, 111, 99, 97,108, 32, 99, 10, 9,108,111, 99, 97,108, 32,111, 110, 97,109,101, 32, 61, 32,115,116,114,105,110,103, 46,103, 115,117, 98, 40,110, 44, 32, 34, 64, 46, 42, 36, 34, 44, 32, 34, 34, 41, 10, 9,111,110, 97,109,101, 32, 61, 32,103,101, 116,110, 97,109,101,115,112, 97, 99,101, 40, 99,108, 97,115, 115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 41, 46, 46,111,110, 97,109,101, 10, 10, 9,105,102, 32, 95, 103,108,111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91, 111,110, 97,109,101, 93, 32,116,104,101,110, 10, 9, 9, 99, 32, 61, 32, 95,103,108,111, 98, 97,108, 95, 99,108, 97,115, 115,101,115, 91,111,110, 97,109,101, 93, 10, 9, 9,105,102, 32,109, 98, 97,115,101, 32, 97,110,100, 32, 40, 40,110,111, 116, 32, 99, 46, 98, 97,115,101, 41, 32,111,114, 32, 99, 46, 98, 97,115,101, 32, 61, 61, 32, 34, 34, 41, 32,116,104,101, 110, 10, 9, 9, 9, 99, 46, 98, 97,115,101, 32, 61, 32,109, 98, 97,115,101, 10, 9, 9,101,110,100, 10, 9,101,108,115, 101, 10, 9, 9, 99, 32, 61, 32, 95, 67,108, 97,115,115, 40, 95, 67,111,110,116, 97,105,110,101,114,123,110, 97,109,101, 61,110, 44, 32, 98, 97,115,101, 61,109, 98, 97,115,101, 44, 32,101,120,116,114, 97, 95, 98, 97,115,101,115, 61,112,125, 41, 10, 10, 9, 9,108,111, 99, 97,108, 32,102,116, 32, 61, 32,103,101,116,110, 97,109,101,115,112, 97, 99,101, 40, 99, 46,112, 97,114,101,110,116, 41, 46, 46, 99, 46,111,114,105, 103,105,110, 97,108, 95,110, 97,109,101, 10, 9, 9, 97,112, 112,101,110,100, 95,103,108,111, 98, 97,108, 95,116,121,112, 101, 40,102,116, 44, 32, 99, 41, 10, 9,101,110,100, 10, 10, 9,112,117,115,104, 40, 99, 41, 10, 9, 99, 58,112, 97,114, 115,101, 40,115,116,114,115,117, 98, 40, 98, 44, 50, 44,115, 116,114,108,101,110, 40, 98, 41, 45, 49, 41, 41, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101, 32, 98,114, 97, 99, 101,115, 10, 9,112,111,112, 40, 41, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/class.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,109, 97,114,107, 32,117,112, 32, 99,111,109,109, 101,110,116,115, 32, 97,110,100, 32,115,116,114,105,110,103, 115, 10, 83, 84, 82, 49, 32, 61, 32, 34, 92, 48, 48, 49, 34, 10, 83, 84, 82, 50, 32, 61, 32, 34, 92, 48, 48, 50, 34, 10, 83, 84, 82, 51, 32, 61, 32, 34, 92, 48, 48, 51, 34, 10, 83, 84, 82, 52, 32, 61, 32, 34, 92, 48, 48, 52, 34, 10, 82, 69, 77, 32, 32, 61, 32, 34, 92, 48, 48, 53, 34, 10, 65, 78, 89, 32, 32, 61, 32, 34, 40, 91, 92, 48, 48, 49, 45, 92, 48, 48, 53, 93, 41, 34, 10, 69, 83, 67, 49, 32, 61, 32, 34, 92, 48, 48, 54, 34, 10, 69, 83, 67, 50, 32, 61, 32, 34, 92, 48, 48, 55, 34, 10, 10, 77, 65, 83, 75, 32, 61, 32,123, 32, 45, 45, 32,116,104,101, 32,115,117, 98,115,116,105,116,117,116,105, 111,110, 32,111,114,100,101,114, 32,105,115, 32,105,109,112, 111,114,116, 97,110,116, 10, 32,123, 69, 83, 67, 49, 44, 32, 34, 92, 92, 39, 34,125, 44, 10, 32,123, 69, 83, 67, 50, 44, 32, 39, 92, 92, 34, 39,125, 44, 10, 32,123, 83, 84, 82, 49, 44, 32, 34, 39, 34,125, 44, 10, 32,123, 83, 84, 82, 50, 44, 32, 39, 34, 39,125, 44, 10, 32,123, 83, 84, 82, 51, 44, 32, 34, 37, 91, 37, 91, 34,125, 44, 10, 32,123, 83, 84, 82, 52, 44, 32, 34, 37, 93, 37, 93, 34,125, 44, 10, 32,123, 82, 69, 77, 32, 44, 32, 34, 37, 45, 37, 45, 34,125, 44, 10,125, 10, 10,102,117,110, 99,116,105,111,110, 32,109, 97,115,107, 32, 40,115, 41, 10, 32,102,111,114, 32,105, 32, 61, 32, 49, 44, 103,101,116,110, 40, 77, 65, 83, 75, 41, 32, 32,100,111, 10, 32, 32,115, 32, 61, 32,103,115,117, 98, 40,115, 44, 77, 65, 83, 75, 91,105, 93, 91, 50, 93, 44, 77, 65, 83, 75, 91,105, 93, 91, 49, 93, 41, 10, 32,101,110,100, 10, 32,114,101,116, 117,114,110, 32,115, 10,101,110,100, 10, 10,102,117,110, 99, 116,105,111,110, 32,117,110,109, 97,115,107, 32, 40,115, 41, 10, 32,102,111,114, 32,105, 32, 61, 32, 49, 44,103,101,116, 110, 40, 77, 65, 83, 75, 41, 32, 32,100,111, 10, 32, 32,115, 32, 61, 32,103,115,117, 98, 40,115, 44, 77, 65, 83, 75, 91, 105, 93, 91, 49, 93, 44, 77, 65, 83, 75, 91,105, 93, 91, 50, 93, 41, 10, 32,101,110,100, 10, 32,114,101,116,117,114,110, 32,115, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111, 110, 32, 99,108,101, 97,110, 32, 40,115, 41, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,102,111,114, 32, 99,111,109,112, 105,108, 97,116,105,111,110, 32,101,114,114,111,114, 10, 32, 108,111, 99, 97,108, 32, 99,111,100,101, 32, 61, 32, 34,114, 101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 32, 40, 41, 92,110, 34, 32, 46, 46, 32,115, 32, 46, 46, 32, 34, 92,110, 32,101,110,100, 34, 10, 32,105,102, 32,110,111,116, 32,100,111,115,116,114,105,110,103, 40, 99,111,100,101, 41, 32,116,104,101,110, 10, 32, 32,114,101,116,117,114,110, 32, 110,105,108, 10, 32,101,110,100, 10, 10, 32,105,102, 32,102, 108, 97,103,115, 91, 39, 67, 39, 93, 32,116,104,101,110, 10, 32, 9,114,101,116,117,114,110, 32,115, 10, 32,101,110,100, 10, 10, 32,108,111, 99, 97,108, 32, 83, 32, 61, 32, 34, 34, 32, 45, 45, 32,115, 97,118,101,100, 32,115,116,114,105,110, 103, 10, 10, 32,115, 32, 61, 32,109, 97,115,107, 40,115, 41, 10, 10, 32, 45, 45, 32,114,101,109,111,118,101, 32, 98,108, 97,110,107,115, 32, 97,110,100, 32, 99,111,109,109,101,110, 116,115, 10, 32,119,104,105,108,101, 32, 49, 32,100,111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44,100, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 65, 78, 89, 41, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 83, 32, 61, 32, 83, 46, 46,115,116,114,115,117, 98, 40, 115, 44, 49, 44, 98, 45, 49, 41, 10, 32, 32, 32,115, 32, 61, 32,115,116,114,115,117, 98, 40,115, 44, 98, 43, 49, 41, 10, 32, 32, 32,105,102, 32,100, 61, 61, 83, 84, 82, 49, 32,111, 114, 32,100, 61, 61, 83, 84, 82, 50, 32,116,104,101,110, 10, 32, 32, 32, 32,101, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44,100, 41, 10, 32, 32, 32, 32, 83, 32, 61, 32, 83, 32, 46, 46,100, 46, 46,115,116,114,115,117, 98, 40,115, 44, 49, 44,101, 41, 10, 32, 32, 32, 32,115, 32, 61, 32,115,116, 114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32, 32, 101,108,115,101,105,102, 32,100, 61, 61, 83, 84, 82, 51, 32, 116,104,101,110, 10, 32, 32, 32, 32,101, 32, 61, 32,115,116, 114,102,105,110,100, 40,115, 44, 83, 84, 82, 52, 41, 10, 32, 32, 32, 32, 83, 32, 61, 32, 83, 46, 46,100, 46, 46,115,116, 114,115,117, 98, 40,115, 44, 49, 44,101, 41, 10, 32, 32, 32, 32,115, 32, 61, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32, 32,101,108,115,101,105,102, 32,100, 61, 61, 82, 69, 77, 32,116,104,101,110, 10, 32, 32, 32, 32, 115, 32, 61, 32,103,115,117, 98, 40,115, 44, 34, 91, 94, 92, 110, 93, 42, 40, 92,110, 63, 41, 34, 44, 34, 37, 49, 34, 44, 49, 41, 10, 32, 32, 32,101,110,100, 10, 32, 32,101,108,115, 101, 10, 32, 32, 32, 83, 32, 61, 32, 83, 46, 46,115, 10, 32, 32, 32, 98,114,101, 97,107, 10, 32, 32,101,110,100, 10, 32, 101,110,100, 10, 32, 45, 45, 32,101,108,105,109,105,110, 97, 116,101, 32,117,110,101, 99,101,115,115, 97,114,121, 32,115, 112, 97, 99,101,115, 10, 32, 83, 32, 61, 32,103,115,117, 98, 40, 83, 44, 34, 91, 32, 92,116, 93, 43, 34, 44, 34, 32, 34, 41, 10, 32, 83, 32, 61, 32,103,115,117, 98, 40, 83, 44, 34, 91, 32, 92,116, 93, 42, 92,110, 91, 32, 92,116, 93, 42, 34, 44, 34, 92,110, 34, 41, 10, 9, 83, 32, 61, 32,103,115,117, 98, 40, 83, 44, 34, 92,110, 43, 34, 44, 34, 92,110, 34, 41, 10, 32, 83, 32, 61, 32,117,110,109, 97,115,107, 40, 83, 41, 10, 32,114,101,116,117,114,110, 32, 83, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/clean.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32, 71,101,110,101,114, 97,116,101, 32, 98,105,110, 100,105,110,103, 32, 99,111,100,101, 10, 45, 45, 32, 87,114, 105,116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 76, 97, 115,116, 32,117,112,100, 97,116,101, 58, 32, 65,112,114, 32, 50, 48, 48, 51, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111,100,101, 32, 105,115, 32,102,114,101,101, 32,115,111,102,116,119, 97,114, 101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101,100,105, 115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116,119, 97,114,101, 32,112,114,111,118,105,100,101,100, 32,104,101,114,101,117, 110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97, 110,100, 10, 45, 45, 32,116,104,101, 32, 97,117,116,104,111, 114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105,103, 97, 116,105,111,110, 32,116,111, 32,112,114,111,118,105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32,115, 117,112,112,111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101,109,101,110, 116,115, 44, 32,111,114, 32,109,111,100,105,102,105, 99, 97, 116,105,111,110,115, 46, 10, 10,102,117,110, 99,116,105,111, 110, 32,112, 97,114,115,101, 95,101,120,116,114, 97, 40, 41, 10, 10, 9,102,111,114, 32,107, 44,118, 32,105,110, 32,105, 112, 97,105,114,115, 40, 95,101,120,116,114, 97, 95,112, 97, 114, 97,109,101,116,101,114,115, 32,111,114, 32,123,125, 41, 32,100,111, 10, 9, 9, 10, 9, 9,108,111, 99, 97,108, 32, 98, 44,101, 44,110, 97,109,101, 44,118, 97,108,117,101, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,118, 44, 32, 34, 94, 40, 91, 94, 61, 93, 42, 41, 61, 40, 46, 42, 41, 36, 34, 41, 10, 9, 9,105,102, 32, 98, 32,116,104,101, 110, 10, 9, 9, 9, 95,101,120,116,114, 97, 95,112, 97,114, 97,109,101,116,101,114,115, 91,110, 97,109,101, 93, 32, 61, 32,118, 97,108,117,101, 10, 9, 9,101,108,115,101, 10, 9, 9, 9, 95,101,120,116,114, 97, 95,112, 97,114, 97,109,101, 116,101,114,115, 91,118, 93, 32, 61, 32,116,114,117,101, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,100,111,105,116, 32, 40, 41, 10, 9, 45, 45, 32,100,101,102,105,110,101, 32,112, 97, 99,107, 97,103,101, 32,110, 97,109,101, 44, 32,105,102, 32,110,111,116, 32,112,114,111,118,105,100,101,100, 10, 9, 105,102, 32,110,111,116, 32,102,108, 97,103,115, 46,110, 32, 116,104,101,110, 10, 9, 9,105,102, 32,102,108, 97,103,115, 46,102, 32,116,104,101,110, 10, 9, 9, 9,102,108, 97,103, 115, 46,110, 32, 61, 32,103,115,117, 98, 40,102,108, 97,103, 115, 46,102, 44, 34, 37, 46, 46, 42, 36, 34, 44, 34, 34, 41, 10, 9, 9, 9, 95, 44, 95, 44,102,108, 97,103,115, 46,110, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110,100, 40, 102,108, 97,103,115, 46,110, 44, 32, 34, 40, 91, 94, 47, 92, 92, 93, 42, 41, 36, 34, 41, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,101,114,114,111,114, 40, 34, 35,110,111, 32,112, 97, 99,107, 97,103,101, 32,110, 97,109,101, 32,110,111,114, 32,105,110,112,117,116, 32,102,105,108,101, 32,112,114,111, 118,105,100,101,100, 34, 41, 10, 9, 9,101,110,100, 10, 9, 101,110,100, 10, 10, 9, 45, 45, 32,112, 97,114,115,101, 32, 116, 97, 98,108,101, 32,119,105,116,104, 32,101,120,116,114, 97, 32,112, 97,114, 97,109,116,101,114,115, 10, 9,112, 97, 114,115,101, 95,101,120,116,114, 97, 40, 41, 10, 10, 9, 45, 45, 32,100,111, 32,116,104,105,115, 32, 97,102,116,101,114, 32,115,101,116,116,105,110,103, 32,116,104,101, 32,112, 97, 99,107, 97,103,101, 32,110, 97,109,101, 10, 9,105,102, 32, 102,108, 97,103,115, 91, 39, 76, 39, 93, 32,116,104,101,110, 10, 9, 9,100,111,102,105,108,101, 40,102,108, 97,103,115, 91, 39, 76, 39, 93, 41, 10, 9,101,110,100, 10, 10, 9, 45, 45, 32, 97,100,100, 32, 99,112,112,115,116,114,105,110,103, 10, 9,105,102, 32,110,111,116, 32,102,108, 97,103,115, 91, 39, 83, 39, 93, 32,116,104,101,110, 10, 9, 9, 95, 98, 97, 115,105, 99, 91, 39,115,116,114,105,110,103, 39, 93, 32, 61, 32, 39, 99,112,112,115,116,114,105,110,103, 39, 10, 9, 9, 95, 98, 97,115,105, 99, 91, 39,115,116,100, 58, 58,115,116, 114,105,110,103, 39, 93, 32, 61, 32, 39, 99,112,112,115,116, 114,105,110,103, 39, 10, 9, 9, 95, 98, 97,115,105, 99, 95, 99,116,121,112,101, 46, 99,112,112,115,116,114,105,110,103, 32, 61, 32, 39, 99,111,110,115,116, 32, 99,104, 97,114, 42, 39, 10, 9,101,110,100, 10, 10, 9, 45, 45, 32,112,114,111, 99, 99,101,115,115, 32,112, 97, 99,107, 97,103,101, 10, 9, 108,111, 99, 97,108, 32,112, 32, 32, 61, 32, 80, 97, 99,107, 97,103,101, 40,102,108, 97,103,115, 46,110, 44,102,108, 97, 103,115, 46,102, 41, 10, 10, 9,105,102, 32,102,108, 97,103, 115, 46,112, 32,116,104,101,110, 10, 9, 9,114,101,116,117, 114,110, 32, 32, 32, 32, 32, 32, 32, 32, 45, 45, 32,111,110, 108,121, 32,112, 97,114,115,101, 10, 9,101,110,100, 10, 10, 9,105,102, 32,102,108, 97,103,115, 46,111, 32,116,104,101, 110, 10, 9, 9,108,111, 99, 97,108, 32,115,116, 44,109,115, 103, 32, 61, 32,119,114,105,116,101,116,111, 40,102,108, 97, 103,115, 46,111, 41, 10, 9, 9,105,102, 32,110,111,116, 32, 115,116, 32,116,104,101,110, 10, 9, 9, 9,101,114,114,111, 114, 40, 39, 35, 39, 46, 46,109,115,103, 41, 10, 9, 9,101, 110,100, 10, 9,101,110,100, 10, 10, 9,112, 58,100,101, 99, 108,116,121,112,101, 40, 41, 10, 9,105,102, 32,102,108, 97, 103,115, 46, 80, 32,116,104,101,110, 10, 9, 9,112, 58,112, 114,105,110,116, 40, 41, 10, 9,101,108,115,101, 10, 9, 9, 112,117,115,104, 40,112, 41, 10, 9, 9,112,114,101, 95,111, 117,116,112,117,116, 95,104,111,111,107, 40,112, 41, 10, 9, 9,112,111,112, 40, 41, 10, 9, 9,112, 58,112,114,101, 97, 109, 98,108,101, 40, 41, 10, 9, 9,112, 58,115,117,112, 99, 111,100,101, 40, 41, 10, 9, 9,112,117,115,104, 40,112, 41, 10, 9, 9,112,114,101, 95,114,101,103,105,115,116,101,114, 95,104,111,111,107, 40,112, 41, 10, 9, 9,112,111,112, 40, 41, 10, 9, 9,112, 58,114,101,103,105,115,116,101,114, 40, 41, 10, 9, 9,112,117,115,104, 40,112, 41, 10, 9, 9,112, 111,115,116, 95,111,117,116,112,117,116, 95,104,111,111,107, 40,112, 41, 10, 9, 9,112,111,112, 40, 41, 10, 9,101,110, 100, 10, 10, 9,105,102, 32,102,108, 97,103,115, 46,111, 32, 116,104,101,110, 10, 9, 9,119,114,105,116,101,116,111, 40, 41, 10, 9,101,110,100, 10, 10, 9, 45, 45, 32,119,114,105, 116,101, 32,104,101, 97,100,101,114, 32,102,105,108,101, 10, 9,105,102, 32,110,111,116, 32,102,108, 97,103,115, 46, 80, 32,116,104,101,110, 10, 9, 9,105,102, 32,102,108, 97,103, 115, 46, 72, 32,116,104,101,110, 10, 9, 9, 9,108,111, 99, 97,108, 32,115,116, 44,109,115,103, 32, 61, 32,119,114,105, 116,101,116,111, 40,102,108, 97,103,115, 46, 72, 41, 10, 9, 9, 9,105,102, 32,110,111,116, 32,115,116, 32,116,104,101, 110, 10, 9, 9, 9, 9,101,114,114,111,114, 40, 39, 35, 39, 46, 46,109,115,103, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9, 9,112, 58,104,101, 97,100,101,114, 40, 41, 10, 9, 9, 9,119,114,105,116,101,116,111, 40, 41, 10, 9, 9,101,110, 100, 10, 9,101,110,100, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: src/bin/lua/doit.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 10,108,111, 99, 97,108, 32,101,114,114, 44,109,115,103, 32, 61, 32,112, 99, 97,108,108, 40,100,111,105,116, 41, 10,105, 102, 32,110,111,116, 32,101,114,114, 32,116,104,101,110, 10, 32,108,111, 99, 97,108, 32, 95, 44, 95, 44,108, 97, 98,101, 108, 44,109,115,103, 32, 61, 32,115,116,114,102,105,110,100, 40,109,115,103, 44, 34, 40, 46, 45, 58, 46, 45, 58, 37,115, 42, 41, 40, 46, 42, 41, 34, 41, 10, 32,116,111,108,117, 97, 95,101,114,114,111,114, 40,109,115,103, 44,108, 97, 98,101, 108, 41, 10, 32,112,114,105,110,116, 40,100,101, 98,117,103, 46,116,114, 97, 99,101, 98, 97, 99,107, 40, 41, 41, 10,101, 110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code 23"); lua_settop(tolua_S, top); } /* end of embedded lua code */ tolua_endmodule(tolua_S); return 1; } #if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501 TOLUA_API int luaopen_tolua (lua_State* tolua_S) { return tolua_tolua_open(tolua_S); } #endif conky-1.12.2/3rdparty/toluapp/src/bin/toluabind.h000066400000000000000000000002661404127277500216620ustar00rootroot00000000000000/* ** Lua binding: tolua ** Generated automatically by tolua++-1.0.92 on Sun Feb 15 22:29:48 2009. */ /* Exported function */ TOLUA_API int tolua_tolua_open (lua_State* tolua_S); conky-1.12.2/3rdparty/toluapp/src/bin/toluabind_default.c000066400000000000000000017457621404127277500234030ustar00rootroot00000000000000/* ** Lua binding: tolua ** Generated automatically by tolua++-1.0.92 on Fri Dec 28 21:37:36 2007. */ #ifndef __cplusplus #include "stdlib.h" #endif #include "string.h" #include "tolua++.h" /* Exported function */ TOLUA_API int tolua_tolua_open (lua_State* tolua_S); /* function to register type */ static void tolua_reg_types (lua_State* tolua_S) { } /* Open function */ TOLUA_API int tolua_tolua_open (lua_State* tolua_S) { tolua_open(tolua_S); tolua_reg_types(tolua_S); tolua_module(tolua_S,NULL,0); tolua_beginmodule(tolua_S,NULL); { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 105,102, 32,115,116,114,105,110,103, 46,102,105,110,100, 40, 95, 86, 69, 82, 83, 73, 79, 78, 44, 32, 34, 53, 37, 46, 48, 34, 41, 32,116,104,101,110, 13, 10, 9,114,101,116,117,114, 110, 13, 10,101,110,100, 13, 10, 13, 10, 45, 45, 32, 34,108, 111, 97,100,102,105,108,101, 34, 13, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,112,112, 95,100,111, 102,105,108,101, 40,112, 97,116,104, 41, 13, 10, 13, 10, 9, 108,111, 99, 97,108, 32,108,111, 97,100,101,100, 32, 61, 32, 102, 97,108,115,101, 13, 10, 9,108,111, 99, 97,108, 32,103, 101,116,102,105,108,101, 32, 61, 32,102,117,110, 99,116,105, 111,110, 40, 41, 13, 10, 13, 10, 9, 9,105,102, 32,108,111, 97,100,101,100, 32,116,104,101,110, 13, 10, 9, 9, 9,114, 101,116,117,114,110, 13, 10, 9, 9,101,108,115,101, 13, 10, 9, 9, 9,108,111, 99, 97,108, 32,102,105,108,101, 44,101, 114,114, 32, 61, 32,105,111, 46,111,112,101,110, 40,112, 97, 116,104, 41, 13, 10, 9, 9, 9,105,102, 32,110,111,116, 32, 102,105,108,101, 32,116,104,101,110, 13, 10, 9, 9, 9, 9, 101,114,114,111,114, 40, 34,101,114,114,111,114, 32,108,111, 97,100,105,110,103, 32,102,105,108,101, 32, 34, 46, 46,112, 97,116,104, 46, 46, 34, 58, 32, 34, 46, 46,101,114,114, 41, 13, 10, 9, 9, 9,101,110,100, 13, 10, 9, 9, 9,108,111, 99, 97,108, 32,114,101,116, 32, 61, 32,102,105,108,101, 58, 114,101, 97,100, 40, 34, 42, 97, 34, 41, 13, 10, 9, 9, 9, 102,105,108,101, 58, 99,108,111,115,101, 40, 41, 13, 10, 13, 10, 9, 9, 9,114,101,116, 32, 61, 32,115,116,114,105,110, 103, 46,103,115,117, 98, 40,114,101,116, 44, 32, 34, 37, 46, 37, 46, 37, 46, 37,115, 42, 37, 41, 34, 44, 32, 34, 46, 46, 46, 41, 32,108,111, 99, 97,108, 32, 97,114,103, 32, 61, 32, 123,110, 61,115,101,108,101, 99,116, 40, 39, 35, 39, 44, 32, 46, 46, 46, 41, 44, 32, 46, 46, 46,125, 59, 34, 41, 13, 10, 13, 10, 9, 9, 9,108,111, 97,100,101,100, 32, 61, 32,116, 114,117,101, 13, 10, 9, 9, 9,114,101,116,117,114,110, 32, 114,101,116, 13, 10, 9, 9,101,110,100, 13, 10, 9,101,110, 100, 13, 10, 13, 10, 9,108,111, 99, 97,108, 32,102, 32, 61, 32,108,111, 97,100, 40,103,101,116,102,105,108,101, 44, 32, 112, 97,116,104, 41, 13, 10, 9,105,102, 32,110,111,116, 32, 102, 32,116,104,101,110, 13, 10, 9, 13, 10, 9, 9,101,114, 114,111,114, 40, 34,101,114,114,111,114, 32,108,111, 97,100, 105,110,103, 32,102,105,108,101, 32, 34, 46, 46,112, 97,116, 104, 41, 13, 10, 9,101,110,100, 13, 10, 9,114,101,116,117, 114,110, 32,102, 40, 41, 13, 10,101,110,100, 13, 10, 13, 10, 111,108,100, 95,100,111,102,105,108,101, 32, 61, 32,100,111, 102,105,108,101, 13, 10,100,111,102,105,108,101, 32, 61, 32, 112,112, 95,100,111,102,105,108,101, 13, 10, 13, 10, 13, 10, 45, 45, 32,115,116,114,105,110,103, 46,103,115,117, 98, 13, 10, 45, 45, 91, 91, 13, 10,108,111, 99, 97,108, 32,111,103, 115,117, 98, 32, 61, 32,115,116,114,105,110,103, 46,103,115, 117, 98, 13, 10,108,111, 99, 97,108, 32,102,117,110, 99,116, 105,111,110, 32, 99,111,109,112,103,115,117, 98, 40, 97, 44, 98, 44, 99, 44,100, 41, 13, 10, 32, 32,105,102, 32,116,121, 112,101, 40, 99, 41, 32, 61, 61, 32, 34,102,117,110, 99,116, 105,111,110, 34, 32,116,104,101,110, 13, 10, 32, 32, 32, 32, 108,111, 99, 97,108, 32,111, 99, 32, 61, 32, 99, 13, 10, 32, 32, 32, 32, 99, 32, 61, 32,102,117,110, 99,116,105,111,110, 32, 40, 46, 46, 46, 41, 32,114,101,116,117,114,110, 32,111, 99, 40, 46, 46, 46, 41, 32,111,114, 32, 39, 39, 32,101,110, 100, 13, 10, 32, 32,101,110,100, 13, 10, 32, 32,114,101,116, 117,114,110, 32,111,103,115,117, 98, 40, 97, 44, 98, 44, 99, 44,100, 41, 13, 10,101,110,100, 13, 10,115,116,114,105,110, 103, 46,114,101,112,108, 32, 61, 32,111,103,115,117, 98, 13, 10, 45, 45, 93, 93, 13, 10, 13, 10, 45, 45,115,116,114,105, 110,103, 46,103,115,117, 98, 32, 61, 32, 99,111,109,112,103, 115,117, 98, 13,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/compat-5.1.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 82,101, 97,108, 32,103,108,111, 98, 97,108,115, 10, 45, 45, 32, 95, 65, 76, 69, 82, 84, 10, 45, 45, 32, 95, 69, 82, 82, 79, 82, 77, 69, 83, 83, 65, 71, 69, 10, 45, 45, 32, 95, 86, 69, 82, 83, 73, 79, 78, 10, 45, 45, 32, 95, 71, 10, 45, 45, 32, 97,115,115, 101,114,116, 10, 45, 45, 32,101,114,114,111,114, 10, 45, 45, 32,109,101,116, 97,116, 97, 98,108,101, 10, 45, 45, 32,110, 101,120,116, 10, 45, 45, 32,112,114,105,110,116, 10, 45, 45, 32,114,101,113,117,105,114,101, 10, 45, 45, 32,116,111,110, 117,109, 98,101,114, 10, 45, 45, 32,116,111,115,116,114,105, 110,103, 10, 45, 45, 32,116,121,112,101, 10, 45, 45, 32,117, 110,112, 97, 99,107, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 99,111,108,108,101, 99,116,103, 97,114, 98, 97, 103,101, 10, 45, 45, 32,103, 99,105,110,102,111, 10, 10, 45, 45, 32,103,108,111, 98, 97,108,115, 10, 10, 45, 45, 32, 99, 97,108,108, 32, 32, 32, 45, 62, 32,112,114,111,116,101, 99, 116, 40,102, 44, 32,101,114,114, 41, 10, 45, 45, 32,108,111, 97,100,102,105,108,101, 10, 45, 45, 32,108,111, 97,100,115, 116,114,105,110,103, 10, 10, 45, 45, 32,114, 97,119,103,101, 116, 10, 45, 45, 32,114, 97,119,115,101,116, 10, 10, 45, 45, 32,103,101,116, 97,114,103,115, 32, 61, 32, 77, 97,105,110, 46,103,101,116, 97,114,103,115, 32, 63, 63, 10, 10,114, 97, 119,116,121,112,101, 32, 61, 32,116,121,112,101, 10, 10,102, 117,110, 99,116,105,111,110, 32,100,111, 95, 32, 40,102, 44, 32,101,114,114, 41, 10, 32, 32,105,102, 32,110,111,116, 32, 102, 32,116,104,101,110, 32,112,114,105,110,116, 40,101,114, 114, 41, 59, 32,114,101,116,117,114,110, 32,101,110,100, 10, 32, 32,108,111, 99, 97,108, 32, 97, 44, 98, 32, 61, 32,112, 99, 97,108,108, 40,102, 41, 10, 32, 32,105,102, 32,110,111, 116, 32, 97, 32,116,104,101,110, 32,112,114,105,110,116, 40, 98, 41, 59, 32,114,101,116,117,114,110, 32,110,105,108, 10, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32, 98, 32,111,114, 32,116,114,117,101, 10, 32, 32,101,110,100, 10, 101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,100, 111,115,116,114,105,110,103, 40,115, 41, 32,114,101,116,117, 114,110, 32,100,111, 95, 40,108,111, 97,100,115,116,114,105, 110,103, 40,115, 41, 41, 32,101,110,100, 10, 45, 45, 32,102, 117,110, 99,116,105,111,110, 32,100,111,102,105,108,101, 40, 115, 41, 32,114,101,116,117,114,110, 32,100,111, 95, 40,108, 111, 97,100,102,105,108,101, 40,115, 41, 41, 32,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 84, 97, 98,108,101, 32,108,105, 98,114, 97,114,121, 10,108,111, 99, 97,108, 32,116, 97, 98, 32, 61, 32,116, 97, 98,108,101, 10, 102,111,114,101, 97, 99,104, 32, 61, 32,116, 97, 98, 46,102, 111,114,101, 97, 99,104, 10,102,111,114,101, 97, 99,104,105, 32, 61, 32,116, 97, 98, 46,102,111,114,101, 97, 99,104,105, 10,103,101,116,110, 32, 61, 32,116, 97, 98, 46,103,101,116, 110, 10,116,105,110,115,101,114,116, 32, 61, 32,116, 97, 98, 46,105,110,115,101,114,116, 10,116,114,101,109,111,118,101, 32, 61, 32,116, 97, 98, 46,114,101,109,111,118,101, 10,115, 111,114,116, 32, 61, 32,116, 97, 98, 46,115,111,114,116, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 98, 117,103, 32,108,105, 98,114, 97,114,121, 10,108,111, 99, 97, 108, 32,100, 98,103, 32, 61, 32,100,101, 98,117,103, 10,103, 101,116,105,110,102,111, 32, 61, 32,100, 98,103, 46,103,101, 116,105,110,102,111, 10,103,101,116,108,111, 99, 97,108, 32, 61, 32,100, 98,103, 46,103,101,116,108,111, 99, 97,108, 10, 115,101,116, 99, 97,108,108,104,111,111,107, 32, 61, 32,102, 117,110, 99,116,105,111,110, 32, 40, 41, 32,101,114,114,111, 114, 34, 96,115,101,116, 99, 97,108,108,104,111,111,107, 39, 32,105,115, 32,100,101,112,114,101, 99, 97,116,101,100, 34, 32,101,110,100, 10,115,101,116,108,105,110,101,104,111,111, 107, 32, 61, 32,102,117,110, 99,116,105,111,110, 32, 40, 41, 32,101,114,114,111,114, 34, 96,115,101,116,108,105,110,101, 104,111,111,107, 39, 32,105,115, 32,100,101,112,114,101, 99, 97,116,101,100, 34, 32,101,110,100, 10,115,101,116,108,111, 99, 97,108, 32, 61, 32,100, 98,103, 46,115,101,116,108,111, 99, 97,108, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32,109, 97,116,104, 32,108,105, 98,114, 97,114,121, 10,108, 111, 99, 97,108, 32,109, 97,116,104, 32, 61, 32,109, 97,116, 104, 10, 97, 98,115, 32, 61, 32,109, 97,116,104, 46, 97, 98, 115, 10, 97, 99,111,115, 32, 61, 32,102,117,110, 99,116,105, 111,110, 32, 40,120, 41, 32,114,101,116,117,114,110, 32,109, 97,116,104, 46,100,101,103, 40,109, 97,116,104, 46, 97, 99, 111,115, 40,120, 41, 41, 32,101,110,100, 10, 97,115,105,110, 32, 61, 32,102,117,110, 99,116,105,111,110, 32, 40,120, 41, 32,114,101,116,117,114,110, 32,109, 97,116,104, 46,100,101, 103, 40,109, 97,116,104, 46, 97,115,105,110, 40,120, 41, 41, 32,101,110,100, 10, 97,116, 97,110, 32, 61, 32,102,117,110, 99,116,105,111,110, 32, 40,120, 41, 32,114,101,116,117,114, 110, 32,109, 97,116,104, 46,100,101,103, 40,109, 97,116,104, 46, 97,116, 97,110, 40,120, 41, 41, 32,101,110,100, 10, 97, 116, 97,110, 50, 32, 61, 32,102,117,110, 99,116,105,111,110, 32, 40,120, 44,121, 41, 32,114,101,116,117,114,110, 32,109, 97,116,104, 46,100,101,103, 40,109, 97,116,104, 46, 97,116, 97,110, 50, 40,120, 44,121, 41, 41, 32,101,110,100, 10, 99, 101,105,108, 32, 61, 32,109, 97,116,104, 46, 99,101,105,108, 10, 99,111,115, 32, 61, 32,102,117,110, 99,116,105,111,110, 32, 40,120, 41, 32,114,101,116,117,114,110, 32,109, 97,116, 104, 46, 99,111,115, 40,109, 97,116,104, 46,114, 97,100, 40, 120, 41, 41, 32,101,110,100, 10,100,101,103, 32, 61, 32,109, 97,116,104, 46,100,101,103, 10,101,120,112, 32, 61, 32,109, 97,116,104, 46,101,120,112, 10,102,108,111,111,114, 32, 61, 32,109, 97,116,104, 46,102,108,111,111,114, 10,102,114,101, 120,112, 32, 61, 32,109, 97,116,104, 46,102,114,101,120,112, 10,108,100,101,120,112, 32, 61, 32,109, 97,116,104, 46,108, 100,101,120,112, 10,108,111,103, 32, 61, 32,109, 97,116,104, 46,108,111,103, 10,108,111,103, 49, 48, 32, 61, 32,109, 97, 116,104, 46,108,111,103, 49, 48, 10,109, 97,120, 32, 61, 32, 109, 97,116,104, 46,109, 97,120, 10,109,105,110, 32, 61, 32, 109, 97,116,104, 46,109,105,110, 10,109,111,100, 32, 61, 32, 109, 97,116,104, 46,109,111,100, 10, 80, 73, 32, 61, 32,109, 97,116,104, 46,112,105, 10, 45, 45, 63, 63, 63, 32,112,111, 119, 32, 61, 32,109, 97,116,104, 46,112,111,119, 32, 32, 10, 114, 97,100, 32, 61, 32,109, 97,116,104, 46,114, 97,100, 10, 114, 97,110,100,111,109, 32, 61, 32,109, 97,116,104, 46,114, 97,110,100,111,109, 10,114, 97,110,100,111,109,115,101,101, 100, 32, 61, 32,109, 97,116,104, 46,114, 97,110,100,111,109, 115,101,101,100, 10,115,105,110, 32, 61, 32,102,117,110, 99, 116,105,111,110, 32, 40,120, 41, 32,114,101,116,117,114,110, 32,109, 97,116,104, 46,115,105,110, 40,109, 97,116,104, 46, 114, 97,100, 40,120, 41, 41, 32,101,110,100, 10,115,113,114, 116, 32, 61, 32,109, 97,116,104, 46,115,113,114,116, 10,116, 97,110, 32, 61, 32,102,117,110, 99,116,105,111,110, 32, 40, 120, 41, 32,114,101,116,117,114,110, 32,109, 97,116,104, 46, 116, 97,110, 40,109, 97,116,104, 46,114, 97,100, 40,120, 41, 41, 32,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32,115,116,114,105,110,103, 32,108,105, 98,114, 97, 114,121, 10,108,111, 99, 97,108, 32,115,116,114, 32, 61, 32, 115,116,114,105,110,103, 10,115,116,114, 98,121,116,101, 32, 61, 32,115,116,114, 46, 98,121,116,101, 10,115,116,114, 99, 104, 97,114, 32, 61, 32,115,116,114, 46, 99,104, 97,114, 10, 115,116,114,102,105,110,100, 32, 61, 32,115,116,114, 46,102, 105,110,100, 10,102,111,114,109, 97,116, 32, 61, 32,115,116, 114, 46,102,111,114,109, 97,116, 10,103,115,117, 98, 32, 61, 32,115,116,114, 46,103,115,117, 98, 10,115,116,114,108,101, 110, 32, 61, 32,115,116,114, 46,108,101,110, 10,115,116,114, 108,111,119,101,114, 32, 61, 32,115,116,114, 46,108,111,119, 101,114, 10,115,116,114,114,101,112, 32, 61, 32,115,116,114, 46,114,101,112, 10,115,116,114,115,117, 98, 32, 61, 32,115, 116,114, 46,115,117, 98, 10,115,116,114,117,112,112,101,114, 32, 61, 32,115,116,114, 46,117,112,112,101,114, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32,111,115, 32,108,105, 98,114, 97,114,121, 10, 99,108,111, 99,107, 32, 61, 32,111, 115, 46, 99,108,111, 99,107, 10,100, 97,116,101, 32, 61, 32, 111,115, 46,100, 97,116,101, 10,100,105,102,102,116,105,109, 101, 32, 61, 32,111,115, 46,100,105,102,102,116,105,109,101, 10,101,120,101, 99,117,116,101, 32, 61, 32,111,115, 46,101, 120,101, 99,117,116,101, 32, 45, 45, 63, 10,101,120,105,116, 32, 61, 32,111,115, 46,101,120,105,116, 10,103,101,116,101, 110,118, 32, 61, 32,111,115, 46,103,101,116,101,110,118, 10, 114,101,109,111,118,101, 32, 61, 32,111,115, 46,114,101,109, 111,118,101, 10,114,101,110, 97,109,101, 32, 61, 32,111,115, 46,114,101,110, 97,109,101, 10,115,101,116,108,111, 99, 97, 108,101, 32, 61, 32,111,115, 46,115,101,116,108,111, 99, 97, 108,101, 10,116,105,109,101, 32, 61, 32,111,115, 46,116,105, 109,101, 10,116,109,112,110, 97,109,101, 32, 61, 32,111,115, 46,116,109,112,110, 97,109,101, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 99,111,109,112, 97,116,105, 98,105, 108,105,116,121, 32,111,110,108,121, 10,103,101,116,103,108, 111, 98, 97,108, 32, 61, 32,102,117,110, 99,116,105,111,110, 32, 40,110, 41, 32,114,101,116,117,114,110, 32, 95, 71, 91, 110, 93, 32,101,110,100, 10,115,101,116,103,108,111, 98, 97, 108, 32, 61, 32,102,117,110, 99,116,105,111,110, 32, 40,110, 44,118, 41, 32, 95, 71, 91,110, 93, 32, 61, 32,118, 32,101, 110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10,108,111, 99, 97,108, 32,105,111, 44, 32,116, 97, 98, 32, 61, 32,105, 111, 44, 32,116, 97, 98,108,101, 10, 10, 45, 45, 32, 73, 79, 32,108,105, 98,114, 97,114,121, 32, 40,102,105,108,101,115, 41, 10, 95, 83, 84, 68, 73, 78, 32, 61, 32,105,111, 46,115, 116,100,105,110, 10, 95, 83, 84, 68, 69, 82, 82, 32, 61, 32, 105,111, 46,115,116,100,101,114,114, 10, 95, 83, 84, 68, 79, 85, 84, 32, 61, 32,105,111, 46,115,116,100,111,117,116, 10, 95, 73, 78, 80, 85, 84, 32, 61, 32,105,111, 46,115,116,100, 105,110, 10, 95, 79, 85, 84, 80, 85, 84, 32, 61, 32,105,111, 46,115,116,100,111,117,116, 10,115,101,101,107, 32, 61, 32, 105,111, 46,115,116,100,105,110, 46,115,101,101,107, 32, 32, 32, 45, 45, 32,115,105, 99,107, 32, 59, 45, 41, 10,116,109, 112,102,105,108,101, 32, 61, 32,105,111, 46,116,109,112,102, 105,108,101, 10, 99,108,111,115,101,102,105,108,101, 32, 61, 32,105,111, 46, 99,108,111,115,101, 10,111,112,101,110,102, 105,108,101, 32, 61, 32,105,111, 46,111,112,101,110, 10, 10, 102,117,110, 99,116,105,111,110, 32,102,108,117,115,104, 32, 40,102, 41, 10, 32, 32,105,102, 32,102, 32,116,104,101,110, 32,102, 58,102,108,117,115,104, 40, 41, 10, 32, 32,101,108, 115,101, 32, 95, 79, 85, 84, 80, 85, 84, 58,102,108,117,115, 104, 40, 41, 10, 32, 32,101,110,100, 10,101,110,100, 10, 10, 102,117,110, 99,116,105,111,110, 32,114,101, 97,100,102,114, 111,109, 32, 40,110, 97,109,101, 41, 10, 32, 32,105,102, 32, 110, 97,109,101, 32, 61, 61, 32,110,105,108, 32,116,104,101, 110, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,102, 44, 32, 101,114,114, 44, 32, 99,111,100, 32, 61, 32,105,111, 46, 99, 108,111,115,101, 40, 95, 73, 78, 80, 85, 84, 41, 10, 32, 32, 32, 32, 95, 73, 78, 80, 85, 84, 32, 61, 32,105,111, 46,115, 116,100,105,110, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102, 44, 32,101,114,114, 44, 32, 99,111,100, 10, 32, 32, 101,108,115,101, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 102, 44, 32,101,114,114, 44, 32, 99,111,100, 32, 61, 32,105, 111, 46,111,112,101,110, 40,110, 97,109,101, 44, 32, 34,114, 34, 41, 10, 32, 32, 32, 32, 95, 73, 78, 80, 85, 84, 32, 61, 32,102, 32,111,114, 32, 95, 73, 78, 80, 85, 84, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102, 44, 32,101,114,114, 44, 32, 99,111,100, 10, 32, 32,101,110,100, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,119,114,105,116, 101,116,111, 32, 40,110, 97,109,101, 41, 10, 32, 32,105,102, 32,110, 97,109,101, 32, 61, 61, 32,110,105,108, 32,116,104, 101,110, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,102, 44, 32,101,114,114, 44, 32, 99,111,100, 32, 61, 32,105,111, 46, 99,108,111,115,101, 40, 95, 79, 85, 84, 80, 85, 84, 41, 10, 32, 32, 32, 32, 95, 79, 85, 84, 80, 85, 84, 32, 61, 32,105, 111, 46,115,116,100,111,117,116, 10, 32, 32, 32, 32,114,101, 116,117,114,110, 32,102, 44, 32,101,114,114, 44, 32, 99,111, 100, 10, 32, 32,101,108,115,101, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,102, 44, 32,101,114,114, 44, 32, 99,111,100, 32, 61, 32,105,111, 46,111,112,101,110, 40,110, 97,109,101, 44, 32, 34,119, 34, 41, 10, 32, 32, 32, 32, 95, 79, 85, 84, 80, 85, 84, 32, 61, 32,102, 32,111,114, 32, 95, 79, 85, 84, 80, 85, 84, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 102, 44, 32,101,114,114, 44, 32, 99,111,100, 10, 32, 32,101, 110,100, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111, 110, 32, 97,112,112,101,110,100,116,111, 32, 40,110, 97,109, 101, 41, 10, 32, 32,108,111, 99, 97,108, 32,102, 44, 32,101, 114,114, 44, 32, 99,111,100, 32, 61, 32,105,111, 46,111,112, 101,110, 40,110, 97,109,101, 44, 32, 34, 97, 34, 41, 10, 32, 32, 95, 79, 85, 84, 80, 85, 84, 32, 61, 32,102, 32,111,114, 32, 95, 79, 85, 84, 80, 85, 84, 10, 32, 32,114,101,116,117, 114,110, 32,102, 44, 32,101,114,114, 44, 32, 99,111,100, 10, 101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,114, 101, 97,100, 32, 40, 46, 46, 46, 41, 10, 32, 32,108,111, 99, 97,108, 32,102, 32, 61, 32, 95, 73, 78, 80, 85, 84, 10, 32, 32,105,102, 32,114, 97,119,116,121,112,101, 40, 97,114,103, 91, 49, 93, 41, 32, 61, 61, 32, 39,117,115,101,114,100, 97, 116, 97, 39, 32,116,104,101,110, 10, 32, 32, 32, 32,102, 32, 61, 32,116, 97, 98, 46,114,101,109,111,118,101, 40, 97,114, 103, 44, 32, 49, 41, 10, 32, 32,101,110,100, 10, 32, 32,114, 101,116,117,114,110, 32,102, 58,114,101, 97,100, 40,117,110, 112, 97, 99,107, 40, 97,114,103, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,119,114,105,116,101, 32, 40, 46, 46, 46, 41, 10, 32, 32,108,111, 99, 97,108, 32, 102, 32, 61, 32, 95, 79, 85, 84, 80, 85, 84, 10, 32, 32,105, 102, 32,114, 97,119,116,121,112,101, 40, 97,114,103, 91, 49, 93, 41, 32, 61, 61, 32, 39,117,115,101,114,100, 97,116, 97, 39, 32,116,104,101,110, 10, 32, 32, 32, 32,102, 32, 61, 32, 116, 97, 98, 46,114,101,109,111,118,101, 40, 97,114,103, 44, 32, 49, 41, 10, 32, 32,101,110,100, 10, 32, 32,114,101,116, 117,114,110, 32,102, 58,119,114,105,116,101, 40,117,110,112, 97, 99,107, 40, 97,114,103, 41, 41, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/compat.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32, 98, 97,115,105, 99, 32,117,116,105,108,105,116,121, 32,102,117,110, 99,116,105, 111,110,115, 10, 45, 45, 32, 87,114,105,116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108, 101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 76, 97,115,116, 32,117,112,100, 97,116,101, 58, 32, 65,112,114, 32, 50, 48, 48, 51, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104, 105,115, 32, 99,111,100,101, 32,105,115, 32,102,114,101,101, 32,115,111,102,116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101,100,105,115,116,114,105, 98,117,116, 101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100, 105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32, 115,111,102,116,119, 97,114,101, 32,112,114,111,118,105,100, 101,100, 32,104,101,114,101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116, 104,101, 32, 97,117,116,104,111,114, 32,104, 97,115, 32,110, 111, 32,111, 98,108,105,103, 97,116,105,111,110, 32,116,111, 32,112,114,111,118,105,100,101, 32,109, 97,105,110,116,101, 110, 97,110, 99,101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110, 104, 97,110, 99,101,109,101,110,116,115, 44, 32,111,114, 32, 109,111,100,105,102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 45, 45, 32, 66, 97,115,105, 99, 32, 67, 32,116,121, 112,101,115, 32, 97,110,100, 32,116,104,101,105,114, 32, 99, 111,114,114,101,115,112,111,110,100,105,110,103, 32, 76,117, 97, 32,116,121,112,101,115, 10, 45, 45, 32, 65,108,108, 32, 111, 99, 99,117,114,114,101,110, 99,101,115, 32,111,102, 32, 34, 99,104, 97,114, 42, 34, 32,119,105,108,108, 32, 98,101, 32,114,101,112,108, 97, 99,101,100, 32, 98,121, 32, 34, 95, 99,115,116,114,105,110,103, 34, 44, 10, 45, 45, 32, 97,110, 100, 32, 97,108,108, 32,111, 99, 99,117,114,114,101,110, 99, 101,115, 32,111,102, 32, 34,118,111,105,100, 42, 34, 32,119, 105,108,108, 32, 98,101, 32,114,101,112,108, 97, 99,101,100, 32, 98,121, 32, 34, 95,117,115,101,114,100, 97,116, 97, 34, 10, 95, 98, 97,115,105, 99, 32, 61, 32,123, 10, 32, 91, 39, 118,111,105,100, 39, 93, 32, 61, 32, 39, 39, 44, 10, 32, 91, 39, 99,104, 97,114, 39, 93, 32, 61, 32, 39,110,117,109, 98, 101,114, 39, 44, 10, 32, 91, 39,105,110,116, 39, 93, 32, 61, 32, 39,110,117,109, 98,101,114, 39, 44, 10, 32, 91, 39,115, 104,111,114,116, 39, 93, 32, 61, 32, 39,110,117,109, 98,101, 114, 39, 44, 10, 32, 91, 39,108,111,110,103, 39, 93, 32, 61, 32, 39,110,117,109, 98,101,114, 39, 44, 10, 32, 91, 39,117, 110,115,105,103,110,101,100, 39, 93, 32, 61, 32, 39,110,117, 109, 98,101,114, 39, 44, 10, 32, 91, 39,102,108,111, 97,116, 39, 93, 32, 61, 32, 39,110,117,109, 98,101,114, 39, 44, 10, 32, 91, 39,100,111,117, 98,108,101, 39, 93, 32, 61, 32, 39, 110,117,109, 98,101,114, 39, 44, 10, 32, 91, 39, 95, 99,115, 116,114,105,110,103, 39, 93, 32, 61, 32, 39,115,116,114,105, 110,103, 39, 44, 10, 32, 91, 39, 95,117,115,101,114,100, 97, 116, 97, 39, 93, 32, 61, 32, 39,117,115,101,114,100, 97,116, 97, 39, 44, 10, 32, 91, 39, 99,104, 97,114, 42, 39, 93, 32, 61, 32, 39,115,116,114,105,110,103, 39, 44, 10, 32, 91, 39, 118,111,105,100, 42, 39, 93, 32, 61, 32, 39,117,115,101,114, 100, 97,116, 97, 39, 44, 10, 32, 91, 39, 98,111,111,108, 39, 93, 32, 61, 32, 39, 98,111,111,108,101, 97,110, 39, 44, 10, 32, 91, 39,108,117, 97, 95, 79, 98,106,101, 99,116, 39, 93, 32, 61, 32, 39,118, 97,108,117,101, 39, 44, 10, 32, 91, 39, 76, 85, 65, 95, 86, 65, 76, 85, 69, 39, 93, 32, 61, 32, 39, 118, 97,108,117,101, 39, 44, 32, 32, 32, 32, 45, 45, 32,102, 111,114, 32, 99,111,109,112, 97,116,105, 98,105,108,105,116, 121, 32,119,105,116,104, 32,116,111,108,117, 97, 32, 52, 46, 48, 10, 32, 91, 39,108,117, 97, 95, 83,116, 97,116,101, 42, 39, 93, 32, 61, 32, 39,115,116, 97,116,101, 39, 44, 10, 32, 91, 39, 95,108,115,116, 97,116,101, 39, 93, 32, 61, 32, 39, 115,116, 97,116,101, 39, 44, 10, 32, 91, 39,108,117, 97, 95, 70,117,110, 99,116,105,111,110, 39, 93, 32, 61, 32, 39,118, 97,108,117,101, 39, 44, 10,125, 10, 10, 95, 98, 97,115,105, 99, 95, 99,116,121,112,101, 32, 61, 32,123, 10, 32,110,117, 109, 98,101,114, 32, 61, 32, 34,108,117, 97, 95, 78,117,109, 98,101,114, 34, 44, 10, 32,115,116,114,105,110,103, 32, 61, 32, 34, 99,111,110,115,116, 32, 99,104, 97,114, 42, 34, 44, 10, 32,117,115,101,114,100, 97,116, 97, 32, 61, 32, 34,118, 111,105,100, 42, 34, 44, 10, 32, 98,111,111,108,101, 97,110, 32, 61, 32, 34, 98,111,111,108, 34, 44, 10, 32,118, 97,108, 117,101, 32, 61, 32, 34,105,110,116, 34, 44, 10, 32,115,116, 97,116,101, 32, 61, 32, 34,108,117, 97, 95, 83,116, 97,116, 101, 42, 34, 44, 10,125, 10, 10, 45, 45, 32,102,117,110, 99, 116,105,111,110,115, 32,116,104,101, 32, 97,114,101, 32,117, 115,101,100, 32,116,111, 32,100,111, 32, 97, 32, 39,114, 97, 119, 32,112,117,115,104, 39, 32,111,102, 32, 98, 97,115,105, 99, 32,116,121,112,101,115, 10, 95, 98, 97,115,105, 99, 95, 114, 97,119, 95,112,117,115,104, 32, 61, 32,123,125, 10, 10, 45, 45, 32, 76,105,115,116, 32,111,102, 32,117,115,101,114, 32,100,101,102,105,110,101,100, 32,116,121,112,101,115, 10, 45, 45, 32, 69, 97, 99,104, 32,116,121,112,101, 32, 99,111, 114,114,101,115,112,111,110,100,115, 32,116,111, 32, 97, 32, 118, 97,114,105, 97, 98,108,101, 32,110, 97,109,101, 32,116, 104, 97,116, 32,115,116,111,114,101,115, 32,105,116,115, 32, 116, 97,103, 32,118, 97,108,117,101, 46, 10, 95,117,115,101, 114,116,121,112,101, 32, 61, 32,123,125, 10, 10, 45, 45, 32, 76,105,115,116, 32,111,102, 32,116,121,112,101,115, 32,116, 104, 97,116, 32,104, 97,118,101, 32,116,111, 32, 98,101, 32, 99,111,108,108,101, 99,116,101,100, 10, 95, 99,111,108,108, 101, 99,116, 32, 61, 32,123,125, 10, 10, 45, 45, 32, 76,105, 115,116, 32,111,102, 32,116,121,112,101,115, 10, 95,103,108, 111, 98, 97,108, 95,116,121,112,101,115, 32, 61, 32,123,110, 61, 48,125, 10, 95,103,108,111, 98, 97,108, 95,116,121,112, 101,115, 95,104, 97,115,104, 32, 61, 32,123,125, 10, 10, 45, 45, 32,108,105,115,116, 32,111,102, 32, 99,108, 97,115,115, 101,115, 10, 95,103,108,111, 98, 97,108, 95, 99,108, 97,115, 115,101,115, 32, 61, 32,123,125, 10, 10, 45, 45, 32, 76,105, 115,116, 32,111,102, 32,101,110,117,109, 32, 99,111,110,115, 116, 97,110,116,115, 10, 95,103,108,111, 98, 97,108, 95,101, 110,117,109,115, 32, 61, 32,123,125, 10, 10, 45, 45, 32, 76, 105,115,116, 32,111,102, 32, 97,117,116,111, 32,114,101,110, 97,109,105,110,103, 10, 95,114,101,110, 97,109,105,110,103, 32, 61, 32,123,125, 10,102,117,110, 99,116,105,111,110, 32, 97,112,112,101,110,100,114,101,110, 97,109,105,110,103, 32, 40,115, 41, 10, 32,108,111, 99, 97,108, 32, 98, 44,101, 44, 111,108,100, 44,110,101,119, 32, 61, 32,115,116,114,102,105, 110,100, 40,115, 44, 34, 37,115, 42, 40, 46, 45, 41, 37,115, 42, 64, 37,115, 42, 40, 46, 45, 41, 37,115, 42, 36, 34, 41, 10, 9,105,102, 32,110,111,116, 32, 98, 32,116,104,101,110, 10, 9, 32,101,114,114,111,114, 40, 34, 35, 73,110,118, 97, 108,105,100, 32,114,101,110, 97,109,105,110,103, 32,115,121, 110,116, 97,120, 59, 32,105,116, 32,115,104,111,117,108,100, 32, 98,101, 32,111,102, 32,116,104,101, 32,102,111,114,109, 58, 32,112, 97,116,116,101,114,110, 64,112, 97,116,116,101, 114,110, 34, 41, 10, 9,101,110,100, 10, 9,116,105,110,115, 101,114,116, 40, 95,114,101,110, 97,109,105,110,103, 44,123, 111,108,100, 61,111,108,100, 44, 32,110,101,119, 61,110,101, 119,125, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105, 111,110, 32, 97,112,112,108,121,114,101,110, 97,109,105,110, 103, 32, 40,115, 41, 10, 9,102,111,114, 32,105, 61, 49, 44, 103,101,116,110, 40, 95,114,101,110, 97,109,105,110,103, 41, 32,100,111, 10, 9, 32,108,111, 99, 97,108, 32,109, 44,110, 32, 61, 32,103,115,117, 98, 40,115, 44, 95,114,101,110, 97, 109,105,110,103, 91,105, 93, 46,111,108,100, 44, 95,114,101, 110, 97,109,105,110,103, 91,105, 93, 46,110,101,119, 41, 10, 9, 9,105,102, 32,110, 32,126, 61, 32, 48, 32,116,104,101, 110, 10, 9, 9, 32,114,101,116,117,114,110, 32,109, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10, 9,114,101,116,117, 114,110, 32,110,105,108, 10,101,110,100, 10, 10, 45, 45, 32, 69,114,114,111,114, 32,104, 97,110,100,108,101,114, 10,102, 117,110, 99,116,105,111,110, 32,116,111,108,117, 97, 95,101, 114,114,111,114, 32, 40,115, 44,102, 41, 10,105,102, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32,116,104,101,110, 10, 9,112,114,105,110,116, 40, 34, 42, 42, 42, 99,117,114,114, 32, 99,111,100,101, 32,102,111,114, 32,101,114,114,111,114, 32,105,115, 32, 34, 46, 46,116,111,115,116,114,105,110,103, 40, 95, 99,117,114,114, 95, 99,111,100,101, 41, 41, 10, 9, 112,114,105,110,116, 40,100,101, 98,117,103, 46,116,114, 97, 99,101, 98, 97, 99,107, 40, 41, 41, 10,101,110,100, 10, 32, 108,111, 99, 97,108, 32,111,117,116, 32, 61, 32, 95, 79, 85, 84, 80, 85, 84, 10, 32, 95, 79, 85, 84, 80, 85, 84, 32, 61, 32, 95, 83, 84, 68, 69, 82, 82, 10, 32,105,102, 32,115,116, 114,115,117, 98, 40,115, 44, 49, 44, 49, 41, 32, 61, 61, 32, 39, 35, 39, 32,116,104,101,110, 10, 32, 32,119,114,105,116, 101, 40, 34, 92,110, 42, 42, 32,116,111,108,117, 97, 58, 32, 34, 46, 46,115,116,114,115,117, 98, 40,115, 44, 50, 41, 46, 46, 34, 46, 92,110, 92,110, 34, 41, 10, 32, 32,105,102, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32,116,104,101,110, 10, 32, 32, 32,108,111, 99, 97,108, 32, 95, 44, 95, 44,115, 32, 61, 32,115,116,114,102,105,110,100, 40, 95, 99,117,114, 114, 95, 99,111,100,101, 44, 34, 94, 37,115, 42, 40, 46, 45, 92,110, 41, 34, 41, 32, 45, 45, 32,101,120,116,114, 97, 99, 116, 32,102,105,114,115,116, 32,108,105,110,101, 10, 32, 32, 32,105,102, 32,115, 61, 61,110,105,108, 32,116,104,101,110, 32,115, 32, 61, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32,101,110,100, 10, 32, 32, 32,115, 32, 61, 32,103,115,117, 98, 40,115, 44, 34, 95,117,115,101,114,100, 97,116, 97, 34, 44, 34,118,111,105,100, 42, 34, 41, 32, 45, 45, 32,114,101, 116,117,114,110, 32,119,105,116,104, 32, 39,118,111,105,100, 42, 39, 10, 32, 32, 32,115, 32, 61, 32,103,115,117, 98, 40, 115, 44, 34, 95, 99,115,116,114,105,110,103, 34, 44, 34, 99, 104, 97,114, 42, 34, 41, 32, 32, 45, 45, 32,114,101,116,117, 114,110, 32,119,105,116,104, 32, 39, 99,104, 97,114, 42, 39, 10, 32, 32, 32,115, 32, 61, 32,103,115,117, 98, 40,115, 44, 34, 95,108,115,116, 97,116,101, 34, 44, 34,108,117, 97, 95, 83,116, 97,116,101, 42, 34, 41, 32, 32, 45, 45, 32,114,101, 116,117,114,110, 32,119,105,116,104, 32, 39,108,117, 97, 95, 83,116, 97,116,101, 42, 39, 10, 32, 32, 32,119,114,105,116, 101, 40, 34, 67,111,100,101, 32, 98,101,105,110,103, 32,112, 114,111, 99,101,115,115,101,100, 58, 92,110, 34, 46, 46,115, 46, 46, 34, 92,110, 34, 41, 10, 32, 32,101,110,100, 10, 32, 101,108,115,101, 10, 32,105,102, 32,110,111,116, 32,102, 32, 116,104,101,110, 32,102, 32, 61, 32, 34, 40,102, 32,105,115, 32,110,105,108, 41, 34, 32,101,110,100, 10, 32, 32,112,114, 105,110,116, 40, 34, 92,110, 42, 42, 32,116,111,108,117, 97, 32,105,110,116,101,114,110, 97,108, 32,101,114,114,111,114, 58, 32, 34, 46, 46,102, 46, 46,115, 46, 46, 34, 46, 92,110, 92,110, 34, 41, 10, 32, 32,114,101,116,117,114,110, 10, 32, 101,110,100, 10, 32, 95, 79, 85, 84, 80, 85, 84, 32, 61, 32, 111,117,116, 10,101,110,100, 10, 10,102,117,110, 99,116,105, 111,110, 32,119, 97,114,110,105,110,103, 32, 40,109,115,103, 41, 10, 32,105,102, 32,102,108, 97,103,115, 46,113, 32,116, 104,101,110, 32,114,101,116,117,114,110, 32,101,110,100, 10, 32,108,111, 99, 97,108, 32,111,117,116, 32, 61, 32, 95, 79, 85, 84, 80, 85, 84, 10, 32, 95, 79, 85, 84, 80, 85, 84, 32, 61, 32, 95, 83, 84, 68, 69, 82, 82, 10, 32,119,114,105,116, 101, 40, 34, 92,110, 42, 42, 32,116,111,108,117, 97, 32,119, 97,114,110,105,110,103, 58, 32, 34, 46, 46,109,115,103, 46, 46, 34, 46, 92,110, 92,110, 34, 41, 10, 32, 95, 79, 85, 84, 80, 85, 84, 32, 61, 32,111,117,116, 10,101,110,100, 10, 10, 45, 45, 32,114,101,103,105,115,116,101,114, 32, 97,110, 32, 117,115,101,114, 32,100,101,102,105,110,101,100, 32,116,121, 112,101, 58, 32,114,101,116,117,114,110,115, 32,102,117,108, 108, 32,116,121,112,101, 10,102,117,110, 99,116,105,111,110, 32,114,101,103,116,121,112,101, 32, 40,116, 41, 10, 9, 45, 45,105,102, 32,105,115, 98, 97,115,105, 99, 40,116, 41, 32, 116,104,101,110, 10, 9, 45, 45, 9,114,101,116,117,114,110, 32,116, 10, 9, 45, 45,101,110,100, 10, 9,108,111, 99, 97, 108, 32,102,116, 32, 61, 32,102,105,110,100,116,121,112,101, 40,116, 41, 10, 10, 9,105,102, 32,110,111,116, 32, 95,117, 115,101,114,116,121,112,101, 91,102,116, 93, 32,116,104,101, 110, 10, 9, 9,114,101,116,117,114,110, 32, 97,112,112,101, 110,100,117,115,101,114,116,121,112,101, 40,116, 41, 10, 9, 101,110,100, 10, 9,114,101,116,117,114,110, 32,102,116, 10, 101,110,100, 10, 10, 45, 45, 32,114,101,116,117,114,110, 32, 116,121,112,101, 32,110, 97,109,101, 58, 32,114,101,116,117, 114,110,115, 32,102,117,108,108, 32,116,121,112,101, 10,102, 117,110, 99,116,105,111,110, 32,116,121,112,101,118, 97,114, 40,116,121,112,101, 41, 10, 9,105,102, 32,116,121,112,101, 32, 61, 61, 32, 39, 39, 32,111,114, 32,116,121,112,101, 32, 61, 61, 32, 39,118,111,105,100, 39, 32,116,104,101,110, 10, 9, 9,114,101,116,117,114,110, 32,116,121,112,101, 10, 9, 101,108,115,101, 10, 9, 9,108,111, 99, 97,108, 32,102,116, 32, 61, 32,102,105,110,100,116,121,112,101, 40,116,121,112, 101, 41, 10, 9, 9,105,102, 32,102,116, 32,116,104,101,110, 10, 9, 9, 9,114,101,116,117,114,110, 32,102,116, 10, 9, 9,101,110,100, 10, 9, 9, 95,117,115,101,114,116,121,112, 101, 91,116,121,112,101, 93, 32, 61, 32,116,121,112,101, 10, 9, 9,114,101,116,117,114,110, 32,116,121,112,101, 10, 9, 101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32, 98, 97,115,105, 99, 32,116,121,112, 101, 10,102,117,110, 99,116,105,111,110, 32,105,115, 98, 97, 115,105, 99, 32, 40,116,121,112,101, 41, 10, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,103,115,117, 98, 40,116,121,112, 101, 44, 39, 99,111,110,115,116, 32, 39, 44, 39, 39, 41, 10, 32,108,111, 99, 97,108, 32,109, 44,116, 32, 61, 32, 97,112, 112,108,121,116,121,112,101,100,101,102, 40, 39, 39, 44, 32, 116, 41, 10, 32,108,111, 99, 97,108, 32, 98, 32, 61, 32, 95, 98, 97,115,105, 99, 91,116, 93, 10, 32,105,102, 32, 98, 32, 116,104,101,110, 10, 32, 32,114,101,116,117,114,110, 32, 98, 44, 95, 98, 97,115,105, 99, 95, 99,116,121,112,101, 91, 98, 93, 10, 32,101,110,100, 10, 32,114,101,116,117,114,110, 32, 110,105,108, 10,101,110,100, 10, 10, 45, 45, 32,115,112,108, 105,116, 32,115,116,114,105,110,103, 32,117,115,105,110,103, 32, 97, 32,116,111,107,101,110, 10,102,117,110, 99,116,105, 111,110, 32,115,112,108,105,116, 32, 40,115, 44,116, 41, 10, 32,108,111, 99, 97,108, 32,108, 32, 61, 32,123,110, 61, 48, 125, 10, 32,108,111, 99, 97,108, 32,102, 32, 61, 32,102,117, 110, 99,116,105,111,110, 32, 40,115, 41, 10, 32, 32,108, 46, 110, 32, 61, 32,108, 46,110, 32, 43, 32, 49, 10, 32, 32,108, 91,108, 46,110, 93, 32, 61, 32,115, 10, 32, 32,114,101,116, 117,114,110, 32, 34, 34, 10, 32,101,110,100, 10, 32,108,111, 99, 97,108, 32,112, 32, 61, 32, 34, 37,115, 42, 40, 46, 45, 41, 37,115, 42, 34, 46, 46,116, 46, 46, 34, 37,115, 42, 34, 10, 32,115, 32, 61, 32,103,115,117, 98, 40,115, 44, 34, 94, 37,115, 43, 34, 44, 34, 34, 41, 10, 32,115, 32, 61, 32,103, 115,117, 98, 40,115, 44, 34, 37,115, 43, 36, 34, 44, 34, 34, 41, 10, 32,115, 32, 61, 32,103,115,117, 98, 40,115, 44,112, 44,102, 41, 10, 32,108, 46,110, 32, 61, 32,108, 46,110, 32, 43, 32, 49, 10, 32,108, 91,108, 46,110, 93, 32, 61, 32,103, 115,117, 98, 40,115, 44, 34, 40, 37,115, 37,115, 42, 41, 36, 34, 44, 34, 34, 41, 10, 32,114,101,116,117,114,110, 32,108, 10,101,110,100, 10, 10, 45, 45, 32,115,112,108,105,116,115, 32, 97, 32,115,116,114,105,110,103, 32,117,115,105,110,103, 32, 97, 32,112, 97,116,116,101,114,110, 44, 32, 99,111,110, 115,105,100,101,114,105,110,103, 32,116,104,101, 32,115,112, 97, 99,105, 97,108, 32, 99, 97,115,101,115, 32,111,102, 32, 67, 32, 99,111,100,101, 32, 40,116,101,109,112,108, 97,116, 101,115, 44, 32,102,117,110, 99,116,105,111,110, 32,112, 97, 114, 97,109,101,116,101,114,115, 44, 32,101,116, 99, 41, 10, 45, 45, 32,112, 97,116,116,101,114,110, 32, 99, 97,110, 39, 116, 32, 99,111,110,116, 97,105,110, 32,116,104,101, 32, 39, 94, 39, 32, 40, 97,115, 32,117,115,101,100, 32,116,111, 32, 105,100,101,110,116,105,102,121, 32,116,104,101, 32, 98,101, 103,105,110,105,110,103, 32,111,102, 32,116,104,101, 32,108, 105,110,101, 41, 10, 45, 45, 32, 97,108,115,111, 32,115,116, 114,105,112,115, 32,119,104,105,116,101,115,112, 97, 99,101, 10,102,117,110, 99,116,105,111,110, 32,115,112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40,115, 44, 32,112, 97, 116, 41, 10, 10, 9,115, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,115, 44, 32, 34, 94, 37,115, 42, 34, 44, 32, 34, 34, 41, 10, 9,115, 32, 61, 32,115,116,114,105, 110,103, 46,103,115,117, 98, 40,115, 44, 32, 34, 37,115, 42, 36, 34, 44, 32, 34, 34, 41, 10, 10, 9,108,111, 99, 97,108, 32,116,111,107,101,110, 95, 98,101,103,105,110, 32, 61, 32, 49, 10, 9,108,111, 99, 97,108, 32,116,111,107,101,110, 95, 101,110,100, 32, 61, 32, 49, 10, 9,108,111, 99, 97,108, 32, 111,102,115, 32, 61, 32, 49, 10, 9,108,111, 99, 97,108, 32, 114,101,116, 32, 61, 32,123,110, 61, 48,125, 10, 10, 9,102, 117,110, 99,116,105,111,110, 32, 97,100,100, 95,116,111,107, 101,110, 40,111,102,115, 41, 10, 10, 9, 9,108,111, 99, 97, 108, 32,116, 32, 61, 32,115,116,114,105,110,103, 46,115,117, 98, 40,115, 44, 32,116,111,107,101,110, 95, 98,101,103,105, 110, 44, 32,111,102,115, 41, 10, 9, 9,116, 32, 61, 32,115, 116,114,105,110,103, 46,103,115,117, 98, 40,116, 44, 32, 34, 94, 37,115, 42, 34, 44, 32, 34, 34, 41, 10, 9, 9,116, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,116, 44, 32, 34, 37,115, 42, 36, 34, 44, 32, 34, 34, 41, 10, 9, 9,114,101,116, 46,110, 32, 61, 32,114,101,116, 46,110, 32, 43, 32, 49, 10, 9, 9,114,101,116, 91,114,101,116, 46,110, 93, 32, 61, 32,116, 10, 9,101,110,100, 10, 10, 9,119,104, 105,108,101, 32,111,102,115, 32, 60, 61, 32,115,116,114,105, 110,103, 46,108,101,110, 40,115, 41, 32,100,111, 10, 10, 9, 9,108,111, 99, 97,108, 32,115,117, 98, 32, 61, 32,115,116, 114,105,110,103, 46,115,117, 98, 40,115, 44, 32,111,102,115, 44, 32, 45, 49, 41, 10, 9, 9,108,111, 99, 97,108, 32, 98, 44,101, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110, 100, 40,115,117, 98, 44, 32, 34, 94, 34, 46, 46,112, 97,116, 41, 10, 9, 9,105,102, 32, 98, 32,116,104,101,110, 10, 9, 9, 9, 97,100,100, 95,116,111,107,101,110, 40,111,102,115, 45, 49, 41, 10, 9, 9, 9,111,102,115, 32, 61, 32,111,102, 115, 43,101, 10, 9, 9, 9,116,111,107,101,110, 95, 98,101, 103,105,110, 32, 61, 32,111,102,115, 10, 9, 9,101,108,115, 101, 10, 9, 9, 9,108,111, 99, 97,108, 32, 99,104, 97,114, 32, 61, 32,115,116,114,105,110,103, 46,115,117, 98, 40,115, 44, 32,111,102,115, 44, 32,111,102,115, 41, 10, 9, 9, 9, 105,102, 32, 99,104, 97,114, 32, 61, 61, 32, 34, 40, 34, 32, 111,114, 32, 99,104, 97,114, 32, 61, 61, 32, 34, 60, 34, 32, 116,104,101,110, 10, 10, 9, 9, 9, 9,108,111, 99, 97,108, 32, 98,108,111, 99,107, 10, 9, 9, 9, 9,105,102, 32, 99, 104, 97,114, 32, 61, 61, 32, 34, 40, 34, 32,116,104,101,110, 32, 98,108,111, 99,107, 32, 61, 32, 34, 94, 37, 98, 40, 41, 34, 32,101,110,100, 10, 9, 9, 9, 9,105,102, 32, 99,104, 97,114, 32, 61, 61, 32, 34, 60, 34, 32,116,104,101,110, 32, 98,108,111, 99,107, 32, 61, 32, 34, 94, 37, 98, 60, 62, 34, 32,101,110,100, 10, 10, 9, 9, 9, 9, 98, 44,101, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,115,117, 98, 44, 32, 98,108,111, 99,107, 41, 10, 9, 9, 9, 9,105, 102, 32,110,111,116, 32, 98, 32,116,104,101,110, 10, 9, 9, 9, 9, 9, 45, 45, 32,117,110,116,101,114,109,105,110, 97, 116,101,100, 32, 98,108,111, 99,107, 63, 10, 9, 9, 9, 9, 9,111,102,115, 32, 61, 32,111,102,115, 43, 49, 10, 9, 9, 9, 9,101,108,115,101, 10, 9, 9, 9, 9, 9,111,102,115, 32, 61, 32,111,102,115, 32, 43, 32,101, 10, 9, 9, 9, 9, 101,110,100, 10, 10, 9, 9, 9,101,108,115,101, 10, 9, 9, 9, 9,111,102,115, 32, 61, 32,111,102,115, 43, 49, 10, 9, 9, 9,101,110,100, 10, 9, 9,101,110,100, 10, 10, 9,101, 110,100, 10, 9, 97,100,100, 95,116,111,107,101,110, 40,111, 102,115, 41, 10, 9, 45, 45,105,102, 32,114,101,116, 46,110, 32, 61, 61, 32, 48, 32,116,104,101,110, 10, 10, 9, 45, 45, 9,114,101,116, 46,110, 61, 49, 10, 9, 45, 45, 9,114,101, 116, 91, 49, 93, 32, 61, 32, 34, 34, 10, 9, 45, 45,101,110, 100, 10, 10, 9,114,101,116,117,114,110, 32,114,101,116, 10, 10,101,110,100, 10, 10, 45, 45, 32, 99,111,110, 99, 97,116, 101,110, 97,116,101, 32,115,116,114,105,110,103,115, 32,111, 102, 32, 97, 32,116, 97, 98,108,101, 10,102,117,110, 99,116, 105,111,110, 32, 99,111,110, 99, 97,116, 32, 40,116, 44,102, 44,108, 44,106,115,116,114, 41, 10, 9,106,115,116,114, 32, 61, 32,106,115,116,114, 32,111,114, 32, 34, 32, 34, 10, 32, 108,111, 99, 97,108, 32,115, 32, 61, 32, 39, 39, 10, 32,108, 111, 99, 97,108, 32,105, 61,102, 10, 32,119,104,105,108,101, 32,105, 60, 61,108, 32,100,111, 10, 32, 32,115, 32, 61, 32, 115, 46, 46,116, 91,105, 93, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32, 32,105,102, 32,105, 32, 60, 61, 32,108, 32, 116,104,101,110, 32,115, 32, 61, 32,115, 46, 46,106,115,116, 114, 32,101,110,100, 10, 32,101,110,100, 10, 32,114,101,116, 117,114,110, 32,115, 10,101,110,100, 10, 10, 45, 45, 32, 99, 111,110, 99, 97,116,101,110, 97,116,101, 32, 97,108,108, 32, 112, 97,114, 97,109,101,116,101,114,115, 44, 32,102,111,108, 108,111,119,105,110,103, 32,111,117,116,112,117,116, 32,114, 117,108,101,115, 10,102,117,110, 99,116,105,111,110, 32, 99, 111,110, 99, 97,116,112, 97,114, 97,109, 32, 40,108,105,110, 101, 44, 32, 46, 46, 46, 41, 10, 32,108,111, 99, 97,108, 32, 105, 61, 49, 10, 32,119,104,105,108,101, 32,105, 60, 61, 97, 114,103, 46,110, 32,100,111, 10, 32, 32,105,102, 32, 95, 99, 111,110,116, 32, 97,110,100, 32,110,111,116, 32,115,116,114, 102,105,110,100, 40, 95, 99,111,110,116, 44, 39, 91, 37, 40, 44, 34, 93, 39, 41, 32, 97,110,100, 10, 32, 32, 32, 32, 32, 115,116,114,102,105,110,100, 40, 97,114,103, 91,105, 93, 44, 34, 94, 91, 37, 97, 95,126, 93, 34, 41, 32,116,104,101,110, 10, 9, 32, 32, 32, 32,108,105,110,101, 32, 61, 32,108,105, 110,101, 32, 46, 46, 32, 39, 32, 39, 10, 32, 32,101,110,100, 10, 32, 32,108,105,110,101, 32, 61, 32,108,105,110,101, 32, 46, 46, 32, 97,114,103, 91,105, 93, 10, 32, 32,105,102, 32, 97,114,103, 91,105, 93, 32,126, 61, 32, 39, 39, 32,116,104, 101,110, 10, 32, 32, 32, 95, 99,111,110,116, 32, 61, 32,115, 116,114,115,117, 98, 40, 97,114,103, 91,105, 93, 44, 45, 49, 44, 45, 49, 41, 10, 32, 32,101,110,100, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,105,102, 32, 115,116,114,102,105,110,100, 40, 97,114,103, 91, 97,114,103, 46,110, 93, 44, 34, 91, 37, 47, 37, 41, 37, 59, 37,123, 37, 125, 93, 36, 34, 41, 32,116,104,101,110, 10, 32, 32, 95, 99, 111,110,116, 61,110,105,108, 32,108,105,110,101, 32, 61, 32, 108,105,110,101, 32, 46, 46, 32, 39, 92,110, 39, 10, 32,101, 110,100, 10, 9,114,101,116,117,114,110, 32,108,105,110,101, 10,101,110,100, 10, 10, 45, 45, 32,111,117,116,112,117,116, 32,108,105,110,101, 10,102,117,110, 99,116,105,111,110, 32, 111,117,116,112,117,116, 32, 40, 46, 46, 46, 41, 10, 32,108, 111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108,101, 32,105, 60, 61, 97,114,103, 46,110, 32,100,111, 10, 32, 32, 105,102, 32, 95, 99,111,110,116, 32, 97,110,100, 32,110,111, 116, 32,115,116,114,102,105,110,100, 40, 95, 99,111,110,116, 44, 39, 91, 37, 40, 44, 34, 93, 39, 41, 32, 97,110,100, 10, 32, 32, 32, 32, 32,115,116,114,102,105,110,100, 40, 97,114, 103, 91,105, 93, 44, 34, 94, 91, 37, 97, 95,126, 93, 34, 41, 32,116,104,101,110, 10, 9, 32, 32, 32, 32,119,114,105,116, 101, 40, 39, 32, 39, 41, 10, 32, 32,101,110,100, 10, 32, 32, 119,114,105,116,101, 40, 97,114,103, 91,105, 93, 41, 10, 32, 32,105,102, 32, 97,114,103, 91,105, 93, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 32, 32, 95, 99,111,110,116, 32, 61, 32,115,116,114,115,117, 98, 40, 97,114,103, 91,105, 93, 44, 45, 49, 44, 45, 49, 41, 10, 32, 32,101,110,100, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,105,102, 32,115,116,114,102,105,110,100, 40, 97,114,103, 91, 97,114,103, 46,110, 93, 44, 34, 91, 37, 47, 37, 41, 37, 59, 37,123, 37,125, 93, 36, 34, 41, 32,116,104,101,110, 10, 32, 32, 95, 99,111,110,116, 61,110,105,108, 32,119,114,105, 116,101, 40, 39, 92,110, 39, 41, 10, 32,101,110,100, 10,101, 110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,103,101, 116, 95,112,114,111,112,101,114,116,121, 95,109,101,116,104, 111,100,115, 40,112,116,121,112,101, 44, 32,110, 97,109,101, 41, 10, 10, 9,105,102, 32,103,101,116, 95,112,114,111,112, 101,114,116,121, 95,109,101,116,104,111,100,115, 95,104,111, 111,107, 32, 97,110,100, 32,103,101,116, 95,112,114,111,112, 101,114,116,121, 95,109,101,116,104,111,100,115, 95,104,111, 111,107, 40,112,116,121,112,101, 44,110, 97,109,101, 41, 32, 116,104,101,110, 10, 9, 9,114,101,116,117,114,110, 32,103, 101,116, 95,112,114,111,112,101,114,116,121, 95,109,101,116, 104,111,100,115, 95,104,111,111,107, 40,112,116,121,112,101, 44, 32,110, 97,109,101, 41, 10, 9,101,110,100, 10, 10, 9, 105,102, 32,112,116,121,112,101, 32, 61, 61, 32, 34,100,101, 102, 97,117,108,116, 34, 32,116,104,101,110, 32, 45, 45, 32, 103,101,116, 95,110, 97,109,101, 44, 32,115,101,116, 95,110, 97,109,101, 10, 9, 9,114,101,116,117,114,110, 32, 34,103, 101,116, 95, 34, 46, 46,110, 97,109,101, 44, 32, 34,115,101, 116, 95, 34, 46, 46,110, 97,109,101, 10, 9,101,110,100, 10, 10, 9,105,102, 32,112,116,121,112,101, 32, 61, 61, 32, 34, 113,116, 34, 32,116,104,101,110, 32, 45, 45, 32,110, 97,109, 101, 44, 32,115,101,116, 78, 97,109,101, 10, 9, 9,114,101, 116,117,114,110, 32,110, 97,109,101, 44, 32, 34,115,101,116, 34, 46, 46,115,116,114,105,110,103, 46,117,112,112,101,114, 40,115,116,114,105,110,103, 46,115,117, 98, 40,110, 97,109, 101, 44, 32, 49, 44, 32, 49, 41, 41, 46, 46,115,116,114,105, 110,103, 46,115,117, 98, 40,110, 97,109,101, 44, 32, 50, 44, 32, 45, 49, 41, 10, 9,101,110,100, 10, 10, 9,105,102, 32, 112,116,121,112,101, 32, 61, 61, 32, 34,111,118,101,114,108, 111, 97,100, 34, 32,116,104,101,110, 32, 45, 45, 32,110, 97, 109,101, 44, 32,110, 97,109,101, 10, 9, 9,114,101,116,117, 114,110, 32,110, 97,109,101, 44,110, 97,109,101, 10, 9,101, 110,100, 10, 10, 9,114,101,116,117,114,110, 32,110,105,108, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 32,116,104,101, 32,104,111,111,107,115, 10, 10, 45, 45, 32, 99, 97,108,108,101,100, 32,114,105,103, 104,116, 32, 97,102,116,101,114, 32,112,114,111, 99,101,115, 115,105,110,103, 32,116,104,101, 32, 36, 91,105, 99,104,108, 93,102,105,108,101, 32,100,105,114,101, 99,116,105,118,101, 115, 44, 10, 45, 45, 32,114,105,103,104,116, 32, 98,101,102, 111,114,101, 32,112,114,111, 99,101,115,115,105,110,103, 32, 97,110,121,116,104,105,110,103, 32,101,108,115,101, 10, 45, 45, 32,116, 97,107,101,115, 32,116,104,101, 32,112, 97, 99, 107, 97,103,101, 32,111, 98,106,101, 99,116, 32, 97,115, 32, 116,104,101, 32,112, 97,114, 97,109,101,116,101,114, 10,102, 117,110, 99,116,105,111,110, 32,112,114,101,112,114,111, 99, 101,115,115, 95,104,111,111,107, 40,112, 41, 10, 9, 45, 45, 32,112, 46, 99,111,100,101, 32,104, 97,115, 32, 97,108,108, 32,116,104,101, 32,105,110,112,117,116, 32, 99,111,100,101, 32,102,114,111,109, 32,116,104,101, 32,112,107,103, 10,101, 110,100, 10, 10, 10, 45, 45, 32, 99, 97,108,108,101,100, 32, 102,111,114, 32,101,118,101,114,121, 32, 36,105,102,105,108, 101, 32,100,105,114,101, 99,116,105,118,101, 10, 45, 45, 32, 116, 97,107,101,115, 32, 97, 32,116, 97, 98,108,101, 32,119, 105,116,104, 32, 97, 32,115,116,114,105,110,103, 32, 99, 97, 108,108,101,100, 32, 39, 99,111,100,101, 39, 32,105,110,115, 105,100,101, 44, 32,116,104,101, 32,102,105,108,101,110, 97, 109,101, 44, 32, 97,110,100, 32, 97,110,121, 32,101,120,116, 114, 97, 32, 97,114,103,117,109,101,110,116,115, 10, 45, 45, 32,112, 97,115,115,101,100, 32,116,111, 32, 36,105,102,105, 108,101, 46, 32,110,111, 32,114,101,116,117,114,110, 32,118, 97,108,117,101, 10,102,117,110, 99,116,105,111,110, 32,105, 110, 99,108,117,100,101, 95,102,105,108,101, 95,104,111,111, 107, 40,116, 44, 32,102,105,108,101,110, 97,109,101, 44, 32, 46, 46, 46, 41, 10, 10,101,110,100, 10, 10, 45, 45, 32, 99, 97,108,108,101,100, 32, 97,102,116,101,114, 32,112,114,111, 99,101,115,115,105,110,103, 32, 97,110,121,116,104,105,110, 103, 32,116,104, 97,116, 39,115, 32,110,111,116, 32, 99,111, 100,101, 32, 40,108,105,107,101, 32, 39, 36,114,101,110, 97, 109,105,110,103, 39, 44, 32, 99,111,109,109,101,110,116,115, 44, 32,101,116, 99, 41, 10, 45, 45, 32, 97,110,100, 32,114, 105,103,104,116, 32, 98,101,102,111,114,101, 32,112, 97,114, 115,105,110,103, 32,116,104,101, 32, 97, 99,116,117, 97,108, 32, 99,111,100,101, 46, 10, 45, 45, 32,116, 97,107,101,115, 32,116,104,101, 32, 80, 97, 99,107, 97,103,101, 32,111, 98, 106,101, 99,116, 32,119,105,116,104, 32, 97,108,108, 32,116, 104,101, 32, 99,111,100,101, 32,111,110, 32,116,104,101, 32, 39, 99,111,100,101, 39, 32,107,101,121, 46, 32,110,111, 32, 114,101,116,117,114,110, 32,118, 97,108,117,101, 10,102,117, 110, 99,116,105,111,110, 32,112,114,101,112, 97,114,115,101, 95,104,111,111,107, 40,112, 97, 99,107, 97,103,101, 41, 10, 10,101,110,100, 10, 10, 10, 45, 45, 32, 99, 97,108,108,101, 100, 32, 97,102,116,101,114, 32,119,114,105,116,105,110,103, 32, 97,108,108, 32,116,104,101, 32,111,117,116,112,117,116, 46, 10, 45, 45, 32,116, 97,107,101,115, 32,116,104,101, 32, 80, 97, 99,107, 97,103,101, 32,111, 98,106,101, 99,116, 10, 102,117,110, 99,116,105,111,110, 32,112,111,115,116, 95,111, 117,116,112,117,116, 95,104,111,111,107, 40,112, 97, 99,107, 97,103,101, 41, 10, 10,101,110,100, 10, 10, 10, 45, 45, 32, 99, 97,108,108,101,100, 32,102,114,111,109, 32, 39,103,101, 116, 95,112,114,111,112,101,114,116,121, 95,109,101,116,104, 111,100,115, 39, 32,116,111, 32,103,101,116, 32,116,104,101, 32,109,101,116,104,111,100,115, 32,116,111, 32,114,101,116, 114,105,101,118,101, 32, 97, 32,112,114,111,112,101,114,116, 121, 10, 45, 45, 32, 97, 99, 99,111,114,100,105,110,103, 32, 116,111, 32,105,116,115, 32,116,121,112,101, 10,102,117,110, 99,116,105,111,110, 32,103,101,116, 95,112,114,111,112,101, 114,116,121, 95,109,101,116,104,111,100,115, 95,104,111,111, 107, 40,112,114,111,112,101,114,116,121, 95,116,121,112,101, 44, 32,110, 97,109,101, 41, 10, 10,101,110,100, 10, 10, 45, 45, 32, 99, 97,108,108,101,100, 32,102,114,111,109, 32, 67, 108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 58,100, 111,112, 97,114,115,101, 32,119,105,116,104, 32,116,104,101, 32,115,116,114,105,110,103, 32, 98,101,105,110,103, 32,112, 97,114,115,101,100, 10, 45, 45, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,111,114, 32, 97, 32,115,117, 98,115, 116,114,105,110,103, 10,102,117,110, 99,116,105,111,110, 32, 112, 97,114,115,101,114, 95,104,111,111,107, 40,115, 41, 10, 10, 9,114,101,116,117,114,110, 32,110,105,108, 10,101,110, 100, 10, 10, 45, 45, 32, 99,117,115,116,111,109, 32,112,117, 115,104,101,114,115, 10, 10, 95,112,117,115,104, 95,102,117, 110, 99,116,105,111,110,115, 32, 61, 32,123,125, 10, 95,105, 115, 95,102,117,110, 99,116,105,111,110,115, 32, 61, 32,123, 125, 10, 95,116,111, 95,102,117,110, 99,116,105,111,110,115, 32, 61, 32,123,125, 10, 10, 95, 98, 97,115,101, 95,112,117, 115,104, 95,102,117,110, 99,116,105,111,110,115, 32, 61, 32, 123,125, 10, 95, 98, 97,115,101, 95,105,115, 95,102,117,110, 99,116,105,111,110,115, 32, 61, 32,123,125, 10, 95, 98, 97, 115,101, 95,116,111, 95,102,117,110, 99,116,105,111,110,115, 32, 61, 32,123,125, 10, 10,108,111, 99, 97,108, 32,102,117, 110, 99,116,105,111,110, 32,115,101, 97,114, 99,104, 95, 98, 97,115,101, 40,116, 44, 32,102,117,110, 99,115, 41, 10, 10, 9,108,111, 99, 97,108, 32, 99,108, 97,115,115, 32, 61, 32, 95,103,108,111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91,116, 93, 10, 10, 9,119,104,105,108,101, 32, 99,108, 97, 115,115, 32,100,111, 10, 9, 9,105,102, 32,102,117,110, 99, 115, 91, 99,108, 97,115,115, 46,116,121,112,101, 93, 32,116, 104,101,110, 10, 9, 9, 9,114,101,116,117,114,110, 32,102, 117,110, 99,115, 91, 99,108, 97,115,115, 46,116,121,112,101, 93, 10, 9, 9,101,110,100, 10, 9, 9, 99,108, 97,115,115, 32, 61, 32, 95,103,108,111, 98, 97,108, 95, 99,108, 97,115, 115,101,115, 91, 99,108, 97,115,115, 46, 98,116,121,112,101, 93, 10, 9,101,110,100, 10, 9,114,101,116,117,114,110, 32, 110,105,108, 10,101,110,100, 10, 10,102,117,110, 99,116,105, 111,110, 32,103,101,116, 95,112,117,115,104, 95,102,117,110, 99,116,105,111,110, 40,116, 41, 10, 9,114,101,116,117,114, 110, 32, 95,112,117,115,104, 95,102,117,110, 99,116,105,111, 110,115, 91,116, 93, 32,111,114, 32,115,101, 97,114, 99,104, 95, 98, 97,115,101, 40,116, 44, 32, 95, 98, 97,115,101, 95, 112,117,115,104, 95,102,117,110, 99,116,105,111,110,115, 41, 32,111,114, 32, 34,116,111,108,117, 97, 95,112,117,115,104, 117,115,101,114,116,121,112,101, 34, 10,101,110,100, 10, 10, 102,117,110, 99,116,105,111,110, 32,103,101,116, 95,116,111, 95,102,117,110, 99,116,105,111,110, 40,116, 41, 10, 9,114, 101,116,117,114,110, 32, 95,116,111, 95,102,117,110, 99,116, 105,111,110,115, 91,116, 93, 32,111,114, 32,115,101, 97,114, 99,104, 95, 98, 97,115,101, 40,116, 44, 32, 95, 98, 97,115, 101, 95,116,111, 95,102,117,110, 99,116,105,111,110,115, 41, 32,111,114, 32, 34,116,111,108,117, 97, 95,116,111,117,115, 101,114,116,121,112,101, 34, 10,101,110,100, 10, 10,102,117, 110, 99,116,105,111,110, 32,103,101,116, 95,105,115, 95,102, 117,110, 99,116,105,111,110, 40,116, 41, 10, 9,114,101,116, 117,114,110, 32, 95,105,115, 95,102,117,110, 99,116,105,111, 110,115, 91,116, 93, 32,111,114, 32,115,101, 97,114, 99,104, 95, 98, 97,115,101, 40,116, 44, 32, 95, 98, 97,115,101, 95, 105,115, 95,102,117,110, 99,116,105,111,110,115, 41, 32,111, 114, 32, 34,116,111,108,117, 97, 95,105,115,117,115,101,114, 116,121,112,101, 34, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/basic.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32, 97, 98,115,116,114, 97, 99,116, 32,102,101, 97,116,117,114,101, 32, 99,108, 97, 115,115, 10, 45, 45, 32, 87,114,105,116,116,101,110, 32, 98, 121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101, 115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111,100,101, 32,105,115, 32, 102,114,101,101, 32,115,111,102,116,119, 97,114,101, 59, 32, 121,111,117, 32, 99, 97,110, 32,114,101,100,105,115,116,114, 105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116,119, 97,114,101, 32,112,114, 111,118,105,100,101,100, 32,104,101,114,101,117,110,100,101, 114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32, 105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97,117,116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105,103, 97,116,105,111, 110, 32,116,111, 32,112,114,111,118,105,100,101, 32,109, 97, 105,110,116,101,110, 97,110, 99,101, 44, 32,115,117,112,112, 111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101,109,101,110,116,115, 44, 32,111,114, 32,109,111,100,105,102,105, 99, 97,116,105,111, 110,115, 46, 10, 10, 10, 45, 45, 32, 70,101, 97,116,117,114, 101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114, 101,115,101,110,116,115, 32,116,104,101, 32, 98, 97,115,101, 32, 99,108, 97,115,115, 32,111,102, 32, 97,108,108, 32,109, 97,112,112,101,100, 32,102,101, 97,116,117,114,101, 46, 10, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 32, 61, 32, 123, 10,125, 10, 99,108, 97,115,115, 70,101, 97,116,117,114, 101, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97, 115,115, 70,101, 97,116,117,114,101, 10, 10, 45, 45, 32,119, 114,105,116,101, 32,115,117,112,112,111,114,116, 32, 99,111, 100,101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97, 115,115, 70,101, 97,116,117,114,101, 58,115,117,112, 99,111, 100,101, 32, 40, 41, 10,101,110,100, 10, 10, 45, 45, 32,111, 117,116,112,117,116, 32,116, 97,103, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 70,101, 97,116,117,114, 101, 58,100,101, 99,108,116,121,112,101, 32, 40, 41, 10,101, 110,100, 10, 10, 45, 45, 32,114,101,103,105,115,116,101,114, 32,102,101, 97,116,117,114,101, 10,102,117,110, 99,116,105, 111,110, 32, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 58,114,101,103,105,115,116,101,114, 32, 40,112,114,101, 41, 10,101,110,100, 10, 10, 45, 45, 32,116,114, 97,110,115,108, 97,116,101, 32,118,101,114, 98, 97,116,105,109, 10,102,117, 110, 99,116,105,111,110, 32, 99,108, 97,115,115, 70,101, 97, 116,117,114,101, 58,112,114,101, 97,109, 98,108,101, 32, 40, 41, 10,101,110,100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32,105,116, 32,105,115, 32, 97, 32,118, 97,114, 105, 97, 98,108,101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 58,105,115, 118, 97,114,105, 97, 98,108,101, 32, 40, 41, 10, 32,114,101, 116,117,114,110, 32,102, 97,108,115,101, 10,101,110,100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32,105,116, 32,114,101,113,117,105,114,101,115, 32, 99,111,108,108,101, 99,116,105,111,110, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 58,114,101, 113,117,105,114,101, 99,111,108,108,101, 99,116,105,111,110, 32, 40,116, 41, 10, 32,114,101,116,117,114,110, 32,102, 97, 108,115,101, 10,101,110,100, 10, 10, 45, 45, 32, 98,117,105, 108,100, 32,110, 97,109,101,115, 10,102,117,110, 99,116,105, 111,110, 32, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 58, 98,117,105,108,100,110, 97,109,101,115, 32, 40, 41, 10, 32,105,102, 32,115,101,108,102, 46,110, 97,109,101, 32, 97, 110,100, 32,115,101,108,102, 46,110, 97,109,101,126, 61, 39, 39, 32,116,104,101,110, 10, 32, 32,108,111, 99, 97,108, 32, 110, 32, 61, 32,115,112,108,105,116, 40,115,101,108,102, 46, 110, 97,109,101, 44, 39, 64, 39, 41, 10, 32, 32,115,101,108, 102, 46,110, 97,109,101, 32, 61, 32,110, 91, 49, 93, 10, 32, 32,115,101,108,102, 46,110, 97,109,101, 32, 61, 32,115,116, 114,105,110,103, 46,103,115,117, 98, 40,115,101,108,102, 46, 110, 97,109,101, 44, 32, 34, 58, 37,100, 42, 36, 34, 44, 32, 34, 34, 41, 10, 32, 32,105,102, 32,110,111,116, 32,110, 91, 50, 93, 32,116,104,101,110, 10, 32, 32, 32,110, 91, 50, 93, 32, 61, 32, 97,112,112,108,121,114,101,110, 97,109,105,110, 103, 40,110, 91, 49, 93, 41, 10, 32, 32,101,110,100, 10, 32, 32,115,101,108,102, 46,108,110, 97,109,101, 32, 61, 32,110, 91, 50, 93, 32,111,114, 32,103,115,117, 98, 40,110, 91, 49, 93, 44, 34, 37, 91, 46, 45, 37, 93, 34, 44, 34, 34, 41, 10, 32, 32,115,101,108,102, 46,108,110, 97,109,101, 32, 61, 32, 115,116,114,105,110,103, 46,103,115,117, 98, 40,115,101,108, 102, 46,108,110, 97,109,101, 44, 32, 34, 58, 37,100, 42, 36, 34, 44, 32, 34, 34, 41, 10, 32, 32,115,101,108,102, 46,111, 114,105,103,105,110, 97,108, 95,110, 97,109,101, 32, 61, 32, 115,101,108,102, 46,110, 97,109,101, 10, 32, 32,115,101,108, 102, 46,108,110, 97,109,101, 32, 61, 32, 99,108,101, 97,110, 95,116,101,109,112,108, 97,116,101, 40,115,101,108,102, 46, 108,110, 97,109,101, 41, 10, 32,101,110,100, 10, 32,105,102, 32,110,111,116, 32,115,101,108,102, 46,105,115, 95,112, 97, 114, 97,109,101,116,101,114, 32,116,104,101,110, 10, 9, 32, 115,101,108,102, 46,110, 97,109,101, 32, 61, 32,103,101,116, 111,110,108,121,110, 97,109,101,115,112, 97, 99,101, 40, 41, 32, 46, 46, 32,115,101,108,102, 46,110, 97,109,101, 10, 32, 101,110,100, 10, 10, 32,108,111, 99, 97,108, 32,112, 97,114, 101,110,116, 32, 61, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 10, 32,105,102, 32, 112, 97,114,101,110,116, 32,116,104,101,110, 10, 32, 9,115, 101,108,102, 46, 97, 99, 99,101,115,115, 32, 61, 32,112, 97, 114,101,110,116, 46, 99,117,114,114, 95,109,101,109, 98,101, 114, 95, 97, 99, 99,101,115,115, 10, 9,115,101,108,102, 46, 103,108,111, 98, 97,108, 95, 97, 99, 99,101,115,115, 32, 61, 32,115,101,108,102, 58, 99,104,101, 99,107, 95,112,117, 98, 108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 10, 32,101, 108,115,101, 10, 32,101,110,100, 10,101,110,100, 10, 10,102, 117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 58, 99,104,101, 99,107, 95,112,117, 98, 108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 10, 10, 9, 105,102, 32,116,121,112,101, 40,115,101,108,102, 46,103,108, 111, 98, 97,108, 95, 97, 99, 99,101,115,115, 41, 32, 61, 61, 32, 34, 98,111,111,108,101, 97,110, 34, 32,116,104,101,110, 10, 9, 9,114,101,116,117,114,110, 32,115,101,108,102, 46, 103,108,111, 98, 97,108, 95, 97, 99, 99,101,115,115, 10, 9, 101,110,100, 10, 10, 9,105,102, 32,115,101,108,102, 46, 97, 99, 99,101,115,115, 32, 97,110,100, 32,115,101,108,102, 46, 97, 99, 99,101,115,115, 32,126, 61, 32, 48, 32,116,104,101, 110, 10, 9, 9,114,101,116,117,114,110, 32,102, 97,108,115, 101, 10, 9,101,110,100, 10, 10, 9,108,111, 99, 97,108, 32, 112, 97,114,101,110,116, 32, 61, 32, 99,108, 97,115,115, 67, 111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 10, 9, 119,104,105,108,101, 32,112, 97,114,101,110,116, 32,100,111, 10, 9, 9,105,102, 32,112, 97,114,101,110,116, 46, 97, 99, 99,101,115,115, 32, 97,110,100, 32,112, 97,114,101,110,116, 46, 97, 99, 99,101,115,115, 32,126, 61, 32, 48, 32,116,104, 101,110, 10, 9, 9, 9,114,101,116,117,114,110, 32,102, 97, 108,115,101, 10, 9, 9,101,110,100, 10, 9, 9,112, 97,114, 101,110,116, 32, 61, 32,112, 97,114,101,110,116, 46,112,114, 111,120, 10, 9,101,110,100, 10, 9,114,101,116,117,114,110, 32,116,114,117,101, 10,101,110,100, 10, 10,102,117,110, 99, 116,105,111,110, 32, 99,108,101, 97,110, 95,116,101,109,112, 108, 97,116,101, 40,116, 41, 10, 10, 9,114,101,116,117,114, 110, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,116, 44, 32, 34, 91, 60, 62, 58, 44, 32, 37, 42, 93, 34, 44, 32, 34, 95, 34, 41, 10,101,110,100, 10, 10, 45, 45, 32, 99,104, 101, 99,107, 32,105,102, 32,102,101, 97,116,117,114,101, 32, 105,115, 32,105,110,115,105,100,101, 32, 97, 32, 99,111,110, 116, 97,105,110,101,114, 32,100,101,102,105,110,105,116,105, 111,110, 10, 45, 45, 32,105,116, 32,114,101,116,117,114,110, 115, 32,116,104,101, 32, 99,111,110,116, 97,105,110,101,114, 32, 99,108, 97,115,115, 32,110, 97,109,101, 32,111,114, 32, 110,105,108, 46, 10,102,117,110, 99,116,105,111,110, 32, 99, 108, 97,115,115, 70,101, 97,116,117,114,101, 58,105,110, 99, 111,110,116, 97,105,110,101,114, 32, 40,119,104,105, 99,104, 41, 10, 32,105,102, 32,115,101,108,102, 46,112, 97,114,101, 110,116, 32,116,104,101,110, 10, 32, 32,108,111, 99, 97,108, 32,112, 97,114,101,110,116, 32, 61, 32,115,101,108,102, 46, 112, 97,114,101,110,116, 10, 32, 32,119,104,105,108,101, 32, 112, 97,114,101,110,116, 32,100,111, 10, 32, 32, 32,105,102, 32,112, 97,114,101,110,116, 46, 99,108, 97,115,115,116,121, 112,101, 32, 61, 61, 32,119,104,105, 99,104, 32,116,104,101, 110, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,112, 97, 114,101,110,116, 46,110, 97,109,101, 10, 32, 32, 32,101,110, 100, 10, 32, 32, 32,112, 97,114,101,110,116, 32, 61, 32,112, 97,114,101,110,116, 46,112, 97,114,101,110,116, 10, 32, 32, 101,110,100, 10, 32,101,110,100, 10, 32,114,101,116,117,114, 110, 32,110,105,108, 10,101,110,100, 10, 10,102,117,110, 99, 116,105,111,110, 32, 99,108, 97,115,115, 70,101, 97,116,117, 114,101, 58,105,110, 99,108, 97,115,115, 32, 40, 41, 10, 32, 114,101,116,117,114,110, 32,115,101,108,102, 58,105,110, 99, 111,110,116, 97,105,110,101,114, 40, 39, 99,108, 97,115,115, 39, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 58, 105,110,109,111,100,117,108,101, 32, 40, 41, 10, 32,114,101, 116,117,114,110, 32,115,101,108,102, 58,105,110, 99,111,110, 116, 97,105,110,101,114, 40, 39,109,111,100,117,108,101, 39, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 58,105, 110,110, 97,109,101,115,112, 97, 99,101, 32, 40, 41, 10, 32, 114,101,116,117,114,110, 32,115,101,108,102, 58,105,110, 99, 111,110,116, 97,105,110,101,114, 40, 39,110, 97,109,101,115, 112, 97, 99,101, 39, 41, 10,101,110,100, 10, 10, 45, 45, 32, 114,101,116,117,114,110, 32, 67, 32, 98,105,110,100,105,110, 103, 32,102,117,110, 99,116,105,111,110, 32,110, 97,109,101, 32, 98, 97,115,101,100, 32,111,110, 32,110, 97,109,101, 10, 45, 45, 32,116,104,101, 32, 99,108,105,101,110,116, 32,115, 112,101, 99,105,102,105,101,115, 32, 97, 32,112,114,101,102, 105,120, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97, 115,115, 70,101, 97,116,117,114,101, 58, 99,102,117,110, 99, 110, 97,109,101, 32, 40,110, 41, 10, 10, 32,105,102, 32,115, 101,108,102, 46,112, 97,114,101,110,116, 32,116,104,101,110, 10, 32, 32,110, 32, 61, 32,115,101,108,102, 46,112, 97,114, 101,110,116, 58, 99,102,117,110, 99,110, 97,109,101, 40,110, 41, 10, 32,101,110,100, 10, 10, 32,108,111, 99, 97,108, 32, 102,110, 97,109,101, 32, 61, 32,115,101,108,102, 46,108,110, 97,109,101, 10, 32,105,102, 32,110,111,116, 32,102,110, 97, 109,101, 32,111,114, 32,102,110, 97,109,101, 32, 61, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 9,102,110, 97,109,101, 32, 61, 32,115,101,108,102, 46,110, 97,109,101, 10, 32,101, 110,100, 10, 32, 32,110, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,110, 46, 46, 39, 95, 39, 46, 46, 32, 40,102,110, 97,109,101, 41, 44, 32, 34, 91, 60, 62, 58, 44, 32, 92, 46, 37, 42, 38, 93, 34, 44, 32, 34, 95, 34, 41, 10, 10, 32, 32,114,101,116,117,114,110, 32,110, 10,101,110,100, 32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/feature.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,118,101,114, 98, 97, 116,105,109, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114, 105,116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73, 100, 58, 32,118,101,114, 98, 97,116,105,109, 46,108,117, 97, 44,118, 32, 49, 46, 51, 32, 50, 48, 48, 48, 47, 48, 49, 47, 50, 52, 32, 50, 48, 58, 52, 49, 58, 49, 54, 32, 99,101,108, 101,115, 32, 69,120,112, 32, 36, 10, 10, 45, 45, 32, 84,104, 105,115, 32, 99,111,100,101, 32,105,115, 32,102,114,101,101, 32,115,111,102,116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101,100,105,115,116,114,105, 98,117,116, 101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100, 105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32, 115,111,102,116,119, 97,114,101, 32,112,114,111,118,105,100, 101,100, 32,104,101,114,101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116, 104,101, 32, 97,117,116,104,111,114, 32,104, 97,115, 32,110, 111, 32,111, 98,108,105,103, 97,116,105,111,110, 32,116,111, 32,112,114,111,118,105,100,101, 32,109, 97,105,110,116,101, 110, 97,110, 99,101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110, 104, 97,110, 99,101,109,101,110,116,115, 44, 32,111,114, 32, 109,111,100,105,102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 10, 45, 45, 32, 86,101,114, 98, 97,116,105,109, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101,115, 101,110,116,115, 32, 97, 32,108,105,110,101, 32,116,114, 97, 110,115,108, 97,116,101,100, 32,100,105,114,101, 99,116,101, 100, 32,116,111, 32,116,104,101, 32, 98,105,110,100,105,110, 103, 32,102,105,108,101, 46, 10, 45, 45, 32, 84,104,101, 32, 102,111,108,108,111,119,105,110,103, 32,102,105,108,100,115, 32, 97,114,101, 32,115,116,111,114,101,100, 58, 10, 45, 45, 32, 32, 32,108,105,110,101, 32, 61, 32,108,105,110,101, 32, 116,101,120,116, 10, 99,108, 97,115,115, 86,101,114, 98, 97, 116,105,109, 32, 61, 32,123, 10, 32,108,105,110,101, 32, 61, 32, 39, 39, 44, 10, 9, 99,111,110,100, 32, 61, 32,110,105, 108, 44, 32, 32, 32, 32, 45, 45, 32, 99,111,110,100,105,116, 105,111,110, 58, 32,119,104,101,114,101, 32,116,111, 32,103, 101,110,101,114, 97,116,101, 32,116,104,101, 32, 99,111,100, 101, 32, 40,115, 61,115,117,112,111,114,116, 44, 32,114, 61, 114,101,103,105,115,116,101,114, 41, 10,125, 10, 99,108, 97, 115,115, 86,101,114, 98, 97,116,105,109, 46, 95, 95,105,110, 100,101,120, 32, 61, 32, 99,108, 97,115,115, 86,101,114, 98, 97,116,105,109, 10,115,101,116,109,101,116, 97,116, 97, 98, 108,101, 40, 99,108, 97,115,115, 86,101,114, 98, 97,116,105, 109, 44, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 41, 10, 10, 45, 45, 32,112,114,101, 97,109, 98,108,101, 32,118, 101,114, 98, 97,116,105,109, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 86,101,114, 98, 97,116,105,109, 58,112,114,101, 97,109, 98,108,101, 32, 40, 41, 10, 32,105, 102, 32,115,101,108,102, 46, 99,111,110,100, 32, 61, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 32,119,114,105,116,101, 40,115,101,108,102, 46,108,105,110,101, 41, 10, 32,101,110, 100, 10,101,110,100, 10, 10, 45, 45, 32,115,117,112,112,111, 114,116, 32, 99,111,100,101, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 86,101,114, 98, 97,116,105,109, 58,115,117,112, 99,111,100,101, 32, 40, 41, 10, 32,105,102, 32,115,116,114,102,105,110,100, 40,115,101,108,102, 46, 99, 111,110,100, 44, 39,115, 39, 41, 32,116,104,101,110, 10, 32, 32,119,114,105,116,101, 40,115,101,108,102, 46,108,105,110, 101, 41, 10, 32, 32,119,114,105,116,101, 40, 39, 92,110, 39, 41, 10, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 114,101,103,105,115,116,101,114, 32, 99,111,100,101, 10,102, 117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 86,101, 114, 98, 97,116,105,109, 58,114,101,103,105,115,116,101,114, 32, 40,112,114,101, 41, 10, 32,105,102, 32,115,116,114,102, 105,110,100, 40,115,101,108,102, 46, 99,111,110,100, 44, 39, 114, 39, 41, 32,116,104,101,110, 10, 32, 32,119,114,105,116, 101, 40,115,101,108,102, 46,108,105,110,101, 41, 10, 32,101, 110,100, 10,101,110,100, 10, 10, 10, 45, 45, 32, 80,114,105, 110,116, 32,109,101,116,104,111,100, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 86,101,114, 98, 97,116, 105,109, 58,112,114,105,110,116, 32, 40,105,100,101,110,116, 44, 99,108,111,115,101, 41, 10, 32,112,114,105,110,116, 40, 105,100,101,110,116, 46, 46, 34, 86,101,114, 98, 97,116,105, 109,123, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101, 110,116, 46, 46, 34, 32,108,105,110,101, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,108,105,110,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110, 116, 46, 46, 34,125, 34, 46, 46, 99,108,111,115,101, 41, 10, 101,110,100, 10, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99,111,110,115,116,114,117, 99,116,111,114, 10, 102,117,110, 99,116,105,111,110, 32, 95, 86,101,114, 98, 97, 116,105,109, 32, 40,116, 41, 10, 32,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40,116, 44, 99,108, 97,115,115, 86, 101,114, 98, 97,116,105,109, 41, 10, 32, 97,112,112,101,110, 100, 40,116, 41, 10, 32,114,101,116,117,114,110, 32,116, 10, 101,110,100, 10, 10, 45, 45, 32, 67,111,110,115,116,114,117, 99,116,111,114, 10, 45, 45, 32, 69,120,112,101, 99,116,115, 32, 97, 32,115,116,114,105,110,103, 32,114,101,112,114,101, 115,101,110,116,105,110,103, 32,116,104,101, 32,116,101,120, 116, 32,108,105,110,101, 10,102,117,110, 99,116,105,111,110, 32, 86,101,114, 98, 97,116,105,109, 32, 40,108, 44, 99,111, 110,100, 41, 10, 32,105,102, 32,115,116,114,115,117, 98, 40, 108, 44, 49, 44, 49, 41, 32, 61, 61, 32, 34, 39, 34, 32,116, 104,101,110, 10, 32, 32,108, 32, 61, 32,115,116,114,115,117, 98, 40,108, 44, 50, 41, 10, 32,101,108,115,101,105,102, 32, 115,116,114,115,117, 98, 40,108, 44, 49, 44, 49, 41, 32, 61, 61, 32, 39, 36, 39, 32,116,104,101,110, 10, 32, 32, 99,111, 110,100, 32, 61, 32, 39,115,114, 39, 32, 32, 32, 32, 32, 32, 32, 45, 45, 32,103,101,110,101,114, 97,116,101,115, 32,105, 110, 32, 98,111,116,104, 32,115,117,112,111,114,116, 32, 97, 110,100, 32,114,101,103,105,115,116,101,114, 32,102,114, 97, 103,109,101,110,116,115, 10, 32, 32,108, 32, 61, 32,115,116, 114,115,117, 98, 40,108, 44, 50, 41, 10, 32,101,110,100, 10, 32,114,101,116,117,114,110, 32, 95, 86,101,114, 98, 97,116, 105,109, 32,123, 10, 32, 32,108,105,110,101, 32, 61, 32,108, 44, 10, 32, 32, 99,111,110,100, 32, 61, 32, 99,111,110,100, 32,111,114, 32, 39, 39, 44, 10, 32,125, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/verbatim.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32, 99,111,100,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114,105,116,116,101, 110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67, 101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 57, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111,100,101, 32, 105,115, 32,102,114,101,101, 32,115,111,102,116,119, 97,114, 101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101,100,105, 115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116,119, 97,114,101, 32,112,114,111,118,105,100,101,100, 32,104,101,114,101,117, 110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97, 110,100, 10, 45, 45, 32,116,104,101, 32, 97,117,116,104,111, 114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105,103, 97, 116,105,111,110, 32,116,111, 32,112,114,111,118,105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32,115, 117,112,112,111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101,109,101,110, 116,115, 44, 32,111,114, 32,109,111,100,105,102,105, 99, 97, 116,105,111,110,115, 46, 10, 10, 45, 45, 32,103,108,111, 98, 97,108, 10, 99,111,100,101, 95,110, 32, 61, 32, 49, 10, 10, 45, 45, 32, 67,111,100,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101,115,101,110,116,115, 32, 76,117, 97, 32, 99,111,100,101, 32,116,111, 32, 98,101, 32, 99,111, 109,112,105,108,101,100, 32, 97,110,100, 32,105,110, 99,108, 117,100,101,100, 10, 45, 45, 32,105,110, 32,116,104,101, 32, 105,110,105,116,105, 97,108,105,122, 97,116,105,111,110, 32, 102,117,110, 99,116,105,111,110, 46, 10, 45, 45, 32, 84,104, 101, 32,102,111,108,108,111,119,105,110,103, 32,102,105,101, 108,100,115, 32, 97,114,101, 32,115,116,111,114,101,100, 58, 10, 45, 45, 32, 32, 32,116,101,120,116, 32, 61, 32,116,101, 120,116, 32, 99,111,100,101, 10, 99,108, 97,115,115, 67,111, 100,101, 32, 61, 32,123, 10, 32,116,101,120,116, 32, 61, 32, 39, 39, 44, 10,125, 10, 99,108, 97,115,115, 67,111,100,101, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97,115, 115, 67,111,100,101, 10,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40, 99,108, 97,115,115, 67,111,100,101, 44, 99, 108, 97,115,115, 70,101, 97,116,117,114,101, 41, 10, 10, 45, 45, 32,114,101,103,105,115,116,101,114, 32, 99,111,100,101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67,111,100,101, 58,114,101,103,105,115,116,101,114, 32, 40, 112,114,101, 41, 10, 32,112,114,101, 32, 61, 32,112,114,101, 32,111,114, 32, 39, 39, 10, 32, 45, 45, 32, 99,108,101, 97, 110, 32, 76,117, 97, 32, 99,111,100,101, 10, 32,108,111, 99, 97,108, 32,115, 32, 61, 32, 99,108,101, 97,110, 40,115,101, 108,102, 46,116,101,120,116, 41, 10, 32,105,102, 32,110,111, 116, 32,115, 32,116,104,101,110, 10, 32, 32, 45, 45,112,114, 105,110,116, 40,115,101,108,102, 46,116,101,120,116, 41, 10, 32, 32,101,114,114,111,114, 40, 34,112, 97,114,115,101,114, 32,101,114,114,111,114, 32,105,110, 32,101,109, 98,101,100, 100,101,100, 32, 99,111,100,101, 34, 41, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,103,101,116, 32,102,105,114,115,116, 32,108,105,110,101, 10, 32,108,111, 99, 97,108, 32, 95, 44, 32, 95, 44, 32,102,105,114,115,116, 95,108,105,110,101, 61, 115,116,114,105,110,103, 46,102,105,110,100, 40,115,101,108, 102, 46,116,101,120,116, 44, 32, 34, 94, 40, 91, 94, 92,110, 92,114, 93, 42, 41, 34, 41, 10, 32,105,102, 32,115,116,114, 105,110,103, 46,102,105,110,100, 40,102,105,114,115,116, 95, 108,105,110,101, 44, 32, 34, 94, 37,115, 42, 37, 45, 37, 45, 34, 41, 32,116,104,101,110, 10, 9, 32,105,102, 32,115,116, 114,105,110,103, 46,102,105,110,100, 40,102,105,114,115,116, 95,108,105,110,101, 44, 32, 34, 94, 37, 45, 37, 45, 35, 35, 34, 41, 32,116,104,101,110, 10, 9, 9,102,105,114,115,116, 95,108,105,110,101, 32, 61, 32,115,116,114,105,110,103, 46, 103,115,117, 98, 40,102,105,114,115,116, 95,108,105,110,101, 44, 32, 34, 94, 37, 45, 37, 45, 35, 35, 34, 44, 32, 34, 34, 41, 10, 9, 9,105,102, 32,102,108, 97,103,115, 91, 39, 67, 39, 93, 32,116,104,101,110, 10, 9, 9, 9,115, 32, 61, 32, 115,116,114,105,110,103, 46,103,115,117, 98, 40,115, 44, 32, 34, 94, 37, 45, 37, 45, 35, 35, 91, 94, 92,110, 92,114, 93, 42, 92,110, 34, 44, 32, 34, 34, 41, 10, 9, 9,101,110,100, 10, 9, 32,101,110,100, 10, 32,101,108,115,101, 10, 32, 9, 102,105,114,115,116, 95,108,105,110,101, 32, 61, 32, 34, 34, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 99,111,110,118, 101,114,116, 32,116,111, 32, 67, 10, 32,111,117,116,112,117, 116, 40, 39, 92,110, 39, 46, 46,112,114,101, 46, 46, 39,123, 32, 47, 42, 32, 98,101,103,105,110, 32,101,109, 98,101,100, 100,101,100, 32,108,117, 97, 32, 99,111,100,101, 32, 42, 47, 92,110, 39, 41, 10, 32,111,117,116,112,117,116, 40,112,114, 101, 46, 46, 39, 32,105,110,116, 32,116,111,112, 32, 61, 32, 108,117, 97, 95,103,101,116,116,111,112, 40,116,111,108,117, 97, 95, 83, 41, 59, 39, 41, 10, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 39, 32,115,116, 97,116,105, 99, 32, 117,110,115,105,103,110,101,100, 32, 99,104, 97,114, 32, 66, 91, 93, 32, 61, 32,123, 92,110, 32, 32, 32, 39, 41, 10, 32, 108,111, 99, 97,108, 32,116, 61,123,110, 61, 48,125, 10, 32, 108,111, 99, 97,108, 32, 98, 32, 61, 32,103,115,117, 98, 40, 115, 44, 39, 40, 46, 41, 39, 44,102,117,110, 99,116,105,111, 110, 32, 40, 99, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,101, 32, 61, 32, 39, 39, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,116, 46,110, 61,116, 46, 110, 43, 49, 32,105,102, 32,116, 46,110, 61, 61, 49, 53, 32, 116,104,101,110, 32,116, 46,110, 61, 48, 32,101, 61, 39, 92, 110, 39, 46, 46,112,114,101, 46, 46, 39, 32, 32, 39, 32,101, 110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101, 116,117,114,110, 32,102,111,114,109, 97,116, 40, 39, 37, 51, 117, 44, 37,115, 39, 44,115,116,114, 98,121,116,101, 40, 99, 41, 44,101, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101, 110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 41, 10, 32,111,117,116,112,117,116, 40, 98, 46, 46,115,116,114, 98,121,116,101, 40, 34, 32, 34, 41, 41, 10, 32,111,117,116,112,117,116, 40, 39, 92,110, 39, 46, 46,112, 114,101, 46, 46, 39, 32,125, 59, 92,110, 39, 41, 10, 32,105, 102, 32,102,105,114,115,116, 95,108,105,110,101, 32, 97,110, 100, 32,102,105,114,115,116, 95,108,105,110,101, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, 9,111,117,116,112, 117,116, 40,112,114,101, 46, 46, 39, 32,116,111,108,117, 97, 95,100,111, 98,117,102,102,101,114, 40,116,111,108,117, 97, 95, 83, 44, 40, 99,104, 97,114, 42, 41, 66, 44,115,105,122, 101,111,102, 40, 66, 41, 44, 34,116,111,108,117, 97, 32,101, 109, 98,101,100,100,101,100, 58, 32, 39, 46, 46,102,105,114, 115,116, 95,108,105,110,101, 46, 46, 39, 34, 41, 59, 39, 41, 10, 32,101,108,115,101, 10, 32, 9,111,117,116,112,117,116, 40,112,114,101, 46, 46, 39, 32,116,111,108,117, 97, 95,100, 111, 98,117,102,102,101,114, 40,116,111,108,117, 97, 95, 83, 44, 40, 99,104, 97,114, 42, 41, 66, 44,115,105,122,101,111, 102, 40, 66, 41, 44, 34,116,111,108,117, 97, 58, 32,101,109, 98,101,100,100,101,100, 32, 76,117, 97, 32, 99,111,100,101, 32, 39, 46, 46, 99,111,100,101, 95,110, 46, 46, 39, 34, 41, 59, 39, 41, 10, 32,101,110,100, 10, 32,111,117,116,112,117, 116, 40,112,114,101, 46, 46, 39, 32,108,117, 97, 95,115,101, 116,116,111,112, 40,116,111,108,117, 97, 95, 83, 44, 32,116, 111,112, 41, 59, 39, 41, 10, 32,111,117,116,112,117,116, 40, 112,114,101, 46, 46, 39,125, 32, 47, 42, 32,101,110,100, 32, 111,102, 32,101,109, 98,101,100,100,101,100, 32,108,117, 97, 32, 99,111,100,101, 32, 42, 47, 92,110, 92,110, 39, 41, 10, 32, 99,111,100,101, 95,110, 32, 61, 32, 99,111,100,101, 95, 110, 32, 43, 49, 10,101,110,100, 10, 10, 10, 45, 45, 32, 80, 114,105,110,116, 32,109,101,116,104,111,100, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67,111,100,101, 58,112,114,105,110,116, 32, 40,105,100,101,110,116, 44, 99, 108,111,115,101, 41, 10, 32,112,114,105,110,116, 40,105,100, 101,110,116, 46, 46, 34, 67,111,100,101,123, 34, 41, 10, 32, 112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 116,101,120,116, 32, 61, 32, 91, 91, 34, 46, 46,115,101,108, 102, 46,116,101,120,116, 46, 46, 34, 93, 93, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 125, 34, 46, 46, 99,108,111,115,101, 41, 10,101,110,100, 10, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99, 111,110,115,116,114,117, 99,116,111,114, 10,102,117,110, 99, 116,105,111,110, 32, 95, 67,111,100,101, 32, 40,116, 41, 10, 32,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40,116, 44, 99,108, 97,115,115, 67,111,100,101, 41, 10, 32, 97,112, 112,101,110,100, 40,116, 41, 10, 32,114,101,116,117,114,110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110,115, 116,114,117, 99,116,111,114, 10, 45, 45, 32, 69,120,112,101, 99,116,115, 32, 97, 32,115,116,114,105,110,103, 32,114,101, 112,114,101,115,101,110,116,105,110,103, 32,116,104,101, 32, 99,111,100,101, 32,116,101,120,116, 10,102,117,110, 99,116, 105,111,110, 32, 67,111,100,101, 32, 40,108, 41, 10, 32,114, 101,116,117,114,110, 32, 95, 67,111,100,101, 32,123, 10, 32, 32,116,101,120,116, 32, 61, 32,108, 10, 32,125, 10,101,110, 100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/code.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,116,121,112,101,100, 101,102, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114,105, 116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97, 114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71, 114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111, 100,101, 32,105,115, 32,102,114,101,101, 32,115,111,102,116, 119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114, 101,100,105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32,105, 116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116,119, 97,114,101, 32,112,114,111,118,105,100,101,100, 32,104,101, 114,101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97, 110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97,117, 116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108, 105,103, 97,116,105,111,110, 32,116,111, 32,112,114,111,118, 105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97, 116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101, 109,101,110,116,115, 44, 32,111,114, 32,109,111,100,105,102, 105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 10, 45, 45, 32, 84,121,112,101,100,101,102, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101,115,101,110,116,115, 32, 97, 32,116,121,112,101, 32,115,121,110,111,110,121,109, 46, 10, 45, 45, 32, 84,104,101, 32, 39,100,101, 32,102, 97, 99,116, 111, 39, 32,116,121,112,101, 32,114,101,112,108, 97, 99,101, 115, 32,116,104,101, 32,116,121,112,101,100,101,102, 32, 98, 101,102,111,114,101, 32,116,104,101, 10, 45, 45, 32,114,101, 109, 97,105,110,105,110,103, 32, 99,111,100,101, 32,105,115, 32,112, 97,114,115,101,100, 46, 10, 45, 45, 32, 84,104,101, 32,102,111,108,108,111,119,105,110,103, 32,102,105,101,108, 100,115, 32, 97,114,101, 32,115,116,111,114,101,100, 58, 10, 45, 45, 32, 32, 32,117,116,121,112,101, 32, 61, 32,116,121, 112,101,100,101,102, 32,110, 97,109,101, 10, 45, 45, 32, 32, 32,116,121,112,101, 32, 61, 32, 39,116,104,101, 32,102, 97, 99,116,111, 39, 32,116,121,112,101, 10, 45, 45, 32, 32, 32, 109,111,100, 32, 61, 32,109,111,100,105,102,105,101,114,115, 32,116,111, 32,116,104,101, 32, 39,100,101, 32,102, 97, 99, 116,111, 39, 32,116,121,112,101, 10, 99,108, 97,115,115, 84, 121,112,101,100,101,102, 32, 61, 32,123, 10, 32,117,116,121, 112,101, 32, 61, 32, 39, 39, 44, 10, 32,109,111,100, 32, 61, 32, 39, 39, 44, 10, 32,116,121,112,101, 32, 61, 32, 39, 39, 10,125, 10, 99,108, 97,115,115, 84,121,112,101,100,101,102, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97,115, 115, 84,121,112,101,100,101,102, 10, 10, 45, 45, 32, 80,114, 105,110,116, 32,109,101,116,104,111,100, 10,102,117,110, 99, 116,105,111,110, 32, 99,108, 97,115,115, 84,121,112,101,100, 101,102, 58,112,114,105,110,116, 32, 40,105,100,101,110,116, 44, 99,108,111,115,101, 41, 10, 32,112,114,105,110,116, 40, 105,100,101,110,116, 46, 46, 34, 84,121,112,101,100,101,102, 123, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110, 116, 46, 46, 34, 32,117,116,121,112,101, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,117,116,121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101, 110,116, 46, 46, 34, 32,109,111,100, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,109,111,100, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,116,121,112,101, 32, 61, 32, 39, 34, 46, 46,115, 101,108,102, 46,116,121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34,125, 34, 46, 46, 99,108,111,115,101, 41, 10,101,110,100, 10, 10, 45, 45, 32, 82,101,116,117,114,110, 32,105,116, 39, 115, 32,110,111,116, 32, 97, 32,118, 97,114,105, 97, 98,108, 101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115, 115, 84,121,112,101,100,101,102, 58,105,115,118, 97,114,105, 97, 98,108,101, 32, 40, 41, 10, 32,114,101,116,117,114,110, 32,102, 97,108,115,101, 10,101,110,100, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99,111,110,115,116,114, 117, 99,116,111,114, 10,102,117,110, 99,116,105,111,110, 32, 95, 84,121,112,101,100,101,102, 32, 40,116, 41, 10, 32,115, 101,116,109,101,116, 97,116, 97, 98,108,101, 40,116, 44, 99, 108, 97,115,115, 84,121,112,101,100,101,102, 41, 10, 32,116, 46,116,121,112,101, 32, 61, 32,114,101,115,111,108,118,101, 95,116,101,109,112,108, 97,116,101, 95,116,121,112,101,115, 40,116, 46,116,121,112,101, 41, 10, 32, 97,112,112,101,110, 100,116,121,112,101,100,101,102, 40,116, 41, 10, 32,114,101, 116,117,114,110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110,115,116,114,117, 99,116,111,114, 10, 45, 45, 32, 69,120,112,101, 99,116,115, 32,111,110,101, 32,115,116,114, 105,110,103, 32,114,101,112,114,101,115,101,110,116,105,110, 103, 32,116,104,101, 32,116,121,112,101, 32,100,101,102,105, 110,105,116,105,111,110, 46, 10,102,117,110, 99,116,105,111, 110, 32, 84,121,112,101,100,101,102, 32, 40,115, 41, 10, 32, 105,102, 32,115,116,114,102,105,110,100, 40,115,116,114,105, 110,103, 46,103,115,117, 98, 40,115, 44, 32, 39, 37, 98, 60, 62, 39, 44, 32, 39, 39, 41, 44, 39, 91, 37, 42, 38, 93, 39, 41, 32,116,104,101,110, 10, 32, 32,116,111,108,117, 97, 95, 101,114,114,111,114, 40, 34, 35,105,110,118, 97,108,105,100, 32,116,121,112,101,100,101,102, 58, 32,112,111,105,110,116, 101,114,115, 32, 40, 97,110,100, 32,114,101,102,101,114,101, 110, 99,101,115, 41, 32, 97,114,101, 32,110,111,116, 32,115, 117,112,112,111,114,116,101,100, 34, 41, 10, 32,101,110,100, 10, 32,108,111, 99, 97,108, 32,111, 32, 61, 32,123,109,111, 100, 32, 61, 32, 39, 39,125, 10, 32,105,102, 32,115,116,114, 105,110,103, 46,102,105,110,100, 40,115, 44, 32, 34, 91, 60, 62, 93, 34, 41, 32,116,104,101,110, 10, 32, 9, 95, 44, 95, 44,111, 46,116,121,112,101, 44,111, 46,117,116,121,112,101, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110,100, 40, 115, 44, 32, 34, 94, 37,115, 42, 40, 91, 94, 60, 62, 93, 43, 37, 98, 60, 62, 91, 94, 37,115, 93, 42, 41, 37,115, 43, 40, 46, 45, 41, 36, 34, 41, 10, 32,101,108,115,101, 10, 32, 9, 108,111, 99, 97,108, 32,116, 32, 61, 32,115,112,108,105,116, 40,103,115,117, 98, 40,115, 44, 34, 37,115, 37,115, 42, 34, 44, 34, 32, 34, 41, 44, 34, 32, 34, 41, 10, 32, 9,111, 32, 61, 32,123, 10, 9, 32, 32,117,116,121,112,101, 32, 61, 32, 116, 91,116, 46,110, 93, 44, 10, 9, 32, 32,116,121,112,101, 32, 61, 32,116, 91,116, 46,110, 45, 49, 93, 44, 10, 9, 32, 32,109,111,100, 32, 61, 32, 99,111,110, 99, 97,116, 40,116, 44, 49, 44,116, 46,110, 45, 50, 41, 44, 10, 9, 32,125, 10, 32,101,110,100, 10, 32,114,101,116,117,114,110, 32, 95, 84, 121,112,101,100,101,102, 40,111, 41, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/typedef.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32, 99,111,110,116, 97, 105,110,101,114, 32, 97, 98,115,116,114, 97, 99,116, 32, 99, 108, 97,115,115, 10, 45, 45, 32, 87,114,105,116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101, 108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111,100,101, 32,105, 115, 32,102,114,101,101, 32,115,111,102,116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101,100,105,115, 116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47, 111,114, 32,109,111,100,105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116,119, 97,114,101, 32, 112,114,111,118,105,100,101,100, 32,104,101,114,101,117,110, 100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97, 115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110, 100, 10, 45, 45, 32,116,104,101, 32, 97,117,116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105,103, 97,116, 105,111,110, 32,116,111, 32,112,114,111,118,105,100,101, 32, 109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32,115,117, 112,112,111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101,109,101,110,116, 115, 44, 32,111,114, 32,109,111,100,105,102,105, 99, 97,116, 105,111,110,115, 46, 10, 10, 45, 45, 32,116, 97, 98,108,101, 32,116,111, 32,115,116,111,114,101, 32,110, 97,109,101,115, 112, 97, 99,101,100, 32,116,121,112,101,100,101,102,115, 47, 101,110,117,109,115, 32,105,110, 32,103,108,111, 98, 97,108, 32,115, 99,111,112,101, 10,103,108,111, 98, 97,108, 95,116, 121,112,101,100,101,102,115, 32, 61, 32,123,125, 10,103,108, 111, 98, 97,108, 95,101,110,117,109,115, 32, 61, 32,123,125, 10, 10, 45, 45, 32, 67,111,110,116, 97,105,110,101,114, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101,115, 101,110,116,115, 32, 97, 32, 99,111,110,116, 97,105,110,101, 114, 32,111,102, 32,102,101, 97,116,117,114,101,115, 32,116, 111, 32, 98,101, 32, 98,111,117,110,100, 10, 45, 45, 32,116, 111, 32,108,117, 97, 46, 10, 99,108, 97,115,115, 67,111,110, 116, 97,105,110,101,114, 32, 61, 10,123, 10, 32, 99,117,114, 114, 32, 61, 32,110,105,108, 44, 10,125, 10, 99,108, 97,115, 115, 67,111,110,116, 97,105,110,101,114, 46, 95, 95,105,110, 100,101,120, 32, 61, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 10,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40, 99,108, 97,115,115, 67,111,110,116, 97,105, 110,101,114, 44, 99,108, 97,115,115, 70,101, 97,116,117,114, 101, 41, 10, 10, 45, 45, 32,111,117,116,112,117,116, 32,116, 97,103,115, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 58,100,101, 99,108,116,121,112,101, 32, 40, 41, 10, 32,112,117,115,104, 40,115,101,108,102, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108,101, 32,115,101,108,102, 91, 105, 93, 32,100,111, 10, 32, 32,115,101,108,102, 91,105, 93, 58,100,101, 99,108,116,121,112,101, 40, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,112,111, 112, 40, 41, 10,101,110,100, 10, 10, 10, 45, 45, 32,119,114, 105,116,101, 32,115,117,112,112,111,114,116, 32, 99,111,100, 101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115, 115, 67,111,110,116, 97,105,110,101,114, 58,115,117,112, 99, 111,100,101, 32, 40, 41, 10, 10, 9,105,102, 32,110,111,116, 32,115,101,108,102, 58, 99,104,101, 99,107, 95,112,117, 98, 108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 32,116,104, 101,110, 10, 9, 9,114,101,116,117,114,110, 10, 9,101,110, 100, 10, 10, 32,112,117,115,104, 40,115,101,108,102, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105, 108,101, 32,115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32,105,102, 32,115,101,108,102, 91,105, 93, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115, 115, 40, 41, 32,116,104,101,110, 10, 32, 32, 9,115,101,108, 102, 91,105, 93, 58,115,117,112, 99,111,100,101, 40, 41, 10, 32, 32,101,110,100, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,112,111,112, 40, 41, 10,101,110, 100, 10, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97, 115,115, 67,111,110,116, 97,105,110,101,114, 58,104, 97,115, 118, 97,114, 32, 40, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108,101, 32,115,101,108,102, 91, 105, 93, 32,100,111, 10, 32, 32,105,102, 32,115,101,108,102, 91,105, 93, 58,105,115,118, 97,114,105, 97, 98,108,101, 40, 41, 32,116,104,101,110, 10, 9, 9, 32,114,101,116,117,114, 110, 32, 49, 10, 9, 9,101,110,100, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 9,114,101,116,117, 114,110, 32, 48, 10,101,110,100, 10, 10, 45, 45, 32, 73,110, 116,101,114,110, 97,108, 32, 99,111,110,116, 97,105,110,101, 114, 32, 99,111,110,115,116,114,117, 99,116,111,114, 10,102, 117,110, 99,116,105,111,110, 32, 95, 67,111,110,116, 97,105, 110,101,114, 32, 40,115,101,108,102, 41, 10, 32,115,101,116, 109,101,116, 97,116, 97, 98,108,101, 40,115,101,108,102, 44, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 41, 10, 32,115,101,108,102, 46,110, 32, 61, 32, 48, 10, 32,115, 101,108,102, 46,116,121,112,101,100,101,102,115, 32, 61, 32, 123,116,111,108,117, 97, 95,110, 61, 48,125, 10, 32,115,101, 108,102, 46,117,115,101,114,116,121,112,101,115, 32, 61, 32, 123,125, 10, 32,115,101,108,102, 46,101,110,117,109,115, 32, 61, 32,123,116,111,108,117, 97, 95,110, 61, 48,125, 10, 32, 115,101,108,102, 46,108,110, 97,109,101,115, 32, 61, 32,123, 125, 10, 32,114,101,116,117,114,110, 32,115,101,108,102, 10, 101,110,100, 10, 10, 45, 45, 32,112,117,115,104, 32, 99,111, 110,116, 97,105,110,101,114, 10,102,117,110, 99,116,105,111, 110, 32,112,117,115,104, 32, 40,116, 41, 10, 9,116, 46,112, 114,111,120, 32, 61, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 10, 32, 99,108, 97, 115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114, 114, 32, 61, 32,116, 10,101,110,100, 10, 10, 45, 45, 32,112, 111,112, 32, 99,111,110,116, 97,105,110,101,114, 10,102,117, 110, 99,116,105,111,110, 32,112,111,112, 32, 40, 41, 10, 45, 45,112,114,105,110,116, 40, 34,110, 97,109,101, 34, 44, 99, 108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99, 117,114,114, 46,110, 97,109,101, 41, 10, 45, 45,102,111,114, 101, 97, 99,104, 40, 99,108, 97,115,115, 67,111,110,116, 97, 105,110,101,114, 46, 99,117,114,114, 46,117,115,101,114,116, 121,112,101,115, 44,112,114,105,110,116, 41, 10, 45, 45,112, 114,105,110,116, 40, 34, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 34, 41, 10, 32, 99,108, 97,115,115, 67, 111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 32, 61, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 46,112,114,111,120, 10,101,110,100, 10, 10, 45, 45, 32,103,101,116, 32, 99,117,114,114,101,110,116, 32,110, 97,109,101,115,112, 97, 99,101, 10,102,117,110, 99, 116,105,111,110, 32,103,101,116, 99,117,114,114,110, 97,109, 101,115,112, 97, 99,101, 32, 40, 41, 10, 9,114,101,116,117, 114,110, 32,103,101,116,110, 97,109,101,115,112, 97, 99,101, 40, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 41, 10,101,110,100, 10, 10, 45, 45, 32, 97,112,112,101,110,100, 32,116,111, 32, 99,117,114,114,101, 110,116, 32, 99,111,110,116, 97,105,110,101,114, 10,102,117, 110, 99,116,105,111,110, 32, 97,112,112,101,110,100, 32, 40, 116, 41, 10, 32,114,101,116,117,114,110, 32, 99,108, 97,115, 115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 58, 97,112,112,101,110,100, 40,116, 41, 10,101,110,100, 10, 10, 45, 45, 32, 97,112,112,101,110,100, 32,116,121,112,101, 100,101,102, 32,116,111, 32, 99,117,114,114,101,110,116, 32, 99,111,110,116, 97,105,110,101,114, 10,102,117,110, 99,116, 105,111,110, 32, 97,112,112,101,110,100,116,121,112,101,100, 101,102, 32, 40,116, 41, 10, 32,114,101,116,117,114,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 58, 97,112,112,101,110,100,116,121,112,101, 100,101,102, 40,116, 41, 10,101,110,100, 10, 10, 45, 45, 32, 97,112,112,101,110,100, 32,117,115,101,114,116,121,112,101, 32,116,111, 32, 99,117,114,114,101,110,116, 32, 99,111,110, 116, 97,105,110,101,114, 10,102,117,110, 99,116,105,111,110, 32, 97,112,112,101,110,100,117,115,101,114,116,121,112,101, 32, 40,116, 41, 10, 32,114,101,116,117,114,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117, 114,114, 58, 97,112,112,101,110,100,117,115,101,114,116,121, 112,101, 40,116, 41, 10,101,110,100, 10, 10, 45, 45, 32, 97, 112,112,101,110,100, 32,101,110,117,109, 32,116,111, 32, 99, 117,114,114,101,110,116, 32, 99,111,110,116, 97,105,110,101, 114, 10,102,117,110, 99,116,105,111,110, 32, 97,112,112,101, 110,100,101,110,117,109, 32, 40,116, 41, 10, 32,114,101,116, 117,114,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105, 110,101,114, 46, 99,117,114,114, 58, 97,112,112,101,110,100, 101,110,117,109, 40,116, 41, 10,101,110,100, 10, 10, 45, 45, 32,115,117, 98,115,116,105,116,117,116,101, 32,116,121,112, 101,100,101,102, 10,102,117,110, 99,116,105,111,110, 32, 97, 112,112,108,121,116,121,112,101,100,101,102, 32, 40,109,111, 100, 44,116,121,112,101, 41, 10, 32,114,101,116,117,114,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 58, 97,112,112,108,121,116,121,112,101, 100,101,102, 40,109,111,100, 44,116,121,112,101, 41, 10,101, 110,100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32,105,115, 32,116,121,112,101, 10,102,117,110, 99,116,105, 111,110, 32,102,105,110,100,116,121,112,101, 32, 40,116,121, 112,101, 41, 10, 32,108,111, 99, 97,108, 32,116, 32, 61, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 58,102,105,110,100,116,121,112,101, 40,116, 121,112,101, 41, 10, 9,114,101,116,117,114,110, 32,116, 10, 101,110,100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32,105, 102, 32,105,115, 32,116,121,112,101,100,101,102, 10,102,117, 110, 99,116,105,111,110, 32,105,115,116,121,112,101,100,101, 102, 32, 40,116,121,112,101, 41, 10, 32,114,101,116,117,114, 110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101, 114, 46, 99,117,114,114, 58,105,115,116,121,112,101,100,101, 102, 40,116,121,112,101, 41, 10,101,110,100, 10, 10, 45, 45, 32,103,101,116, 32,102,117,108,108,116,121,112,101, 32, 40, 119,105,116,104, 32,110, 97,109,101,115,112, 97, 99,101, 41, 10,102,117,110, 99,116,105,111,110, 32,102,117,108,108,116, 121,112,101, 32, 40,116, 41, 10, 32,108,111, 99, 97,108, 32, 99,117,114,114, 32, 61, 32, 32, 99,108, 97,115,115, 67,111, 110,116, 97,105,110,101,114, 46, 99,117,114,114, 10, 9,119, 104,105,108,101, 32, 99,117,114,114, 32,100,111, 10, 9, 32, 105,102, 32, 99,117,114,114, 32,116,104,101,110, 10, 9, 9, 32,105,102, 32, 99,117,114,114, 46,116,121,112,101,100,101, 102,115, 32, 97,110,100, 32, 99,117,114,114, 46,116,121,112, 101,100,101,102,115, 91,116, 93, 32,116,104,101,110, 10, 9, 9, 32, 32,114,101,116,117,114,110, 32, 99,117,114,114, 46, 116,121,112,101,100,101,102,115, 91,116, 93, 10, 9, 9, 32, 101,108,115,101,105,102, 32, 99,117,114,114, 46,117,115,101, 114,116,121,112,101,115, 32, 97,110,100, 32, 99,117,114,114, 46,117,115,101,114,116,121,112,101,115, 91,116, 93, 32,116, 104,101,110, 10, 9, 9, 32, 32,114,101,116,117,114,110, 32, 99,117,114,114, 46,117,115,101,114,116,121,112,101,115, 91, 116, 93, 10, 9, 9, 9,101,110,100, 10, 9, 9,101,110,100, 10, 9, 32, 99,117,114,114, 32, 61, 32, 99,117,114,114, 46, 112,114,111,120, 10, 9,101,110,100, 10, 9,114,101,116,117, 114,110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 99,104, 101, 99,107,115, 32,105,102, 32,105,116, 32,114,101,113,117, 105,114,101,115, 32, 99,111,108,108,101, 99,116,105,111,110, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 58,114,101,113,117,105, 114,101, 99,111,108,108,101, 99,116,105,111,110, 32, 40,116, 41, 10, 32,112,117,115,104, 40,115,101,108,102, 41, 10, 32, 108,111, 99, 97,108, 32,105, 61, 49, 10, 9,108,111, 99, 97, 108, 32,114, 32, 61, 32,102, 97,108,115,101, 10, 32,119,104, 105,108,101, 32,115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32,114, 32, 61, 32,115,101,108,102, 91,105, 93, 58,114, 101,113,117,105,114,101, 99,111,108,108,101, 99,116,105,111, 110, 40,116, 41, 32,111,114, 32,114, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 9,112,111,112, 40, 41, 10, 9,114,101,116,117,114,110, 32,114, 10,101,110,100, 10, 10, 10, 45, 45, 32,103,101,116, 32,110, 97,109,101,115, 97,112, 99,101, 10,102,117,110, 99,116,105,111,110, 32,103, 101,116,110, 97,109,101,115,112, 97, 99,101, 32, 40, 99,117, 114,114, 41, 10, 9,108,111, 99, 97,108, 32,110, 97,109,101, 115,112, 97, 99,101, 32, 61, 32, 39, 39, 10, 9,119,104,105, 108,101, 32, 99,117,114,114, 32,100,111, 10, 9, 32,105,102, 32, 99,117,114,114, 32, 97,110,100, 10, 9, 9, 32, 32, 32, 40, 32, 99,117,114,114, 46, 99,108, 97,115,115,116,121,112, 101, 32, 61, 61, 32, 39, 99,108, 97,115,115, 39, 32,111,114, 32, 99,117,114,114, 46, 99,108, 97,115,115,116,121,112,101, 32, 61, 61, 32, 39,110, 97,109,101,115,112, 97, 99,101, 39, 41, 10, 9, 9,116,104,101,110, 10, 9, 9, 32,110, 97,109, 101,115,112, 97, 99,101, 32, 61, 32, 40, 99,117,114,114, 46, 111,114,105,103,105,110, 97,108, 95,110, 97,109,101, 32,111, 114, 32, 99,117,114,114, 46,110, 97,109,101, 41, 32, 46, 46, 32, 39, 58, 58, 39, 32, 46, 46, 32,110, 97,109,101,115,112, 97, 99,101, 10, 9, 9, 32, 45, 45,110, 97,109,101,115,112, 97, 99,101, 32, 61, 32, 99,117,114,114, 46,110, 97,109,101, 32, 46, 46, 32, 39, 58, 58, 39, 32, 46, 46, 32,110, 97,109, 101,115,112, 97, 99,101, 10, 9, 9,101,110,100, 10, 9, 32, 99,117,114,114, 32, 61, 32, 99,117,114,114, 46,112,114,111, 120, 10, 9,101,110,100, 10, 9,114,101,116,117,114,110, 32, 110, 97,109,101,115,112, 97, 99,101, 10,101,110,100, 10, 10, 45, 45, 32,103,101,116, 32,110, 97,109,101,115,112, 97, 99, 101, 32, 40,111,110,108,121, 32,110, 97,109,101,115,112, 97, 99,101, 41, 10,102,117,110, 99,116,105,111,110, 32,103,101, 116,111,110,108,121,110, 97,109,101,115,112, 97, 99,101, 32, 40, 41, 10, 32,108,111, 99, 97,108, 32, 99,117,114,114, 32, 61, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101, 114, 46, 99,117,114,114, 10, 9,108,111, 99, 97,108, 32,110, 97,109,101,115,112, 97, 99,101, 32, 61, 32, 39, 39, 10, 9, 119,104,105,108,101, 32, 99,117,114,114, 32,100,111, 10, 9, 9,105,102, 32, 99,117,114,114, 46, 99,108, 97,115,115,116, 121,112,101, 32, 61, 61, 32, 39, 99,108, 97,115,115, 39, 32, 116,104,101,110, 10, 9, 9, 32,114,101,116,117,114,110, 32, 110, 97,109,101,115,112, 97, 99,101, 10, 9, 9,101,108,115, 101,105,102, 32, 99,117,114,114, 46, 99,108, 97,115,115,116, 121,112,101, 32, 61, 61, 32, 39,110, 97,109,101,115,112, 97, 99,101, 39, 32,116,104,101,110, 10, 9, 9, 32,110, 97,109, 101,115,112, 97, 99,101, 32, 61, 32, 99,117,114,114, 46,110, 97,109,101, 32, 46, 46, 32, 39, 58, 58, 39, 32, 46, 46, 32, 110, 97,109,101,115,112, 97, 99,101, 10, 9, 9,101,110,100, 10, 9, 32, 99,117,114,114, 32, 61, 32, 99,117,114,114, 46, 112,114,111,120, 10, 9,101,110,100, 10, 9,114,101,116,117, 114,110, 32,110, 97,109,101,115,112, 97, 99,101, 10,101,110, 100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32, 105,115, 32,101,110,117,109, 10,102,117,110, 99,116,105,111, 110, 32,105,115,101,110,117,109, 32, 40,116,121,112,101, 41, 10, 32,114,101,116,117,114,110, 32, 99,108, 97,115,115, 67, 111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 58,105, 115,101,110,117,109, 40,116,121,112,101, 41, 10,101,110,100, 10, 10, 45, 45, 32, 97,112,112,101,110,100, 32,102,101, 97, 116,117,114,101, 32,116,111, 32, 99,111,110,116, 97,105,110, 101,114, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97, 115,115, 67,111,110,116, 97,105,110,101,114, 58, 97,112,112, 101,110,100, 32, 40,116, 41, 10, 32,115,101,108,102, 46,110, 32, 61, 32,115,101,108,102, 46,110, 32, 43, 32, 49, 10, 32, 115,101,108,102, 91,115,101,108,102, 46,110, 93, 32, 61, 32, 116, 10, 32,116, 46,112, 97,114,101,110,116, 32, 61, 32,115, 101,108,102, 10,101,110,100, 10, 10, 45, 45, 32, 97,112,112, 101,110,100, 32,116,121,112,101,100,101,102, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 58, 97,112,112,101,110,100,116,121,112, 101,100,101,102, 32, 40,116, 41, 10, 32,108,111, 99, 97,108, 32,110, 97,109,101,115,112, 97, 99,101, 32, 61, 32,103,101, 116,110, 97,109,101,115,112, 97, 99,101, 40, 99,108, 97,115, 115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 41, 10, 32,115,101,108,102, 46,116,121,112,101,100,101,102, 115, 46,116,111,108,117, 97, 95,110, 32, 61, 32,115,101,108, 102, 46,116,121,112,101,100,101,102,115, 46,116,111,108,117, 97, 95,110, 32, 43, 32, 49, 10, 32,115,101,108,102, 46,116, 121,112,101,100,101,102,115, 91,115,101,108,102, 46,116,121, 112,101,100,101,102,115, 46,116,111,108,117, 97, 95,110, 93, 32, 61, 32,116, 10, 9,115,101,108,102, 46,116,121,112,101, 100,101,102,115, 91,116, 46,117,116,121,112,101, 93, 32, 61, 32,110, 97,109,101,115,112, 97, 99,101, 32, 46, 46, 32,116, 46,117,116,121,112,101, 10, 9,103,108,111, 98, 97,108, 95, 116,121,112,101,100,101,102,115, 91,110, 97,109,101,115,112, 97, 99,101, 46, 46,116, 46,117,116,121,112,101, 93, 32, 61, 32,116, 10, 9,116, 46,102,116,121,112,101, 32, 61, 32,102, 105,110,100,116,121,112,101, 40,116, 46,116,121,112,101, 41, 32,111,114, 32,116, 46,116,121,112,101, 10, 9, 45, 45,112, 114,105,110,116, 40, 34, 97,112,112,101,110,100,105,110,103, 32,116,121,112,101,100,101,102, 32, 34, 46, 46,116, 46,117, 116,121,112,101, 46, 46, 34, 32, 97,115, 32, 34, 46, 46,110, 97,109,101,115,112, 97, 99,101, 46, 46,116, 46,117,116,121, 112,101, 46, 46, 34, 32,119,105,116,104, 32,102,116,121,112, 101, 32, 34, 46, 46,116, 46,102,116,121,112,101, 41, 10, 9, 97,112,112,101,110,100, 95,103,108,111, 98, 97,108, 95,116, 121,112,101, 40,110, 97,109,101,115,112, 97, 99,101, 46, 46, 116, 46,117,116,121,112,101, 41, 10, 9,105,102, 32,116, 46, 102,116,121,112,101, 32, 97,110,100, 32,105,115,101,110,117, 109, 40,116, 46,102,116,121,112,101, 41, 32,116,104,101,110, 10, 10, 9, 9,103,108,111, 98, 97,108, 95,101,110,117,109, 115, 91,110, 97,109,101,115,112, 97, 99,101, 46, 46,116, 46, 117,116,121,112,101, 93, 32, 61, 32,116,114,117,101, 10, 9, 101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 97,112,112, 101,110,100, 32,117,115,101,114,116,121,112,101, 58, 32,114, 101,116,117,114,110, 32,102,117,108,108, 32,116,121,112,101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 58, 97,112,112,101,110, 100,117,115,101,114,116,121,112,101, 32, 40,116, 41, 10, 9, 108,111, 99, 97,108, 32, 99,111,110,116, 97,105,110,101,114, 10, 9,105,102, 32,116, 32, 61, 61, 32, 40,115,101,108,102, 46,111,114,105,103,105,110, 97,108, 95,110, 97,109,101, 32, 111,114, 32,115,101,108,102, 46,110, 97,109,101, 41, 32,116, 104,101,110, 10, 9, 9, 99,111,110,116, 97,105,110,101,114, 32, 61, 32,115,101,108,102, 46,112,114,111,120, 10, 9,101, 108,115,101, 10, 9, 9, 99,111,110,116, 97,105,110,101,114, 32, 61, 32,115,101,108,102, 10, 9,101,110,100, 10, 9,108, 111, 99, 97,108, 32,102,116, 32, 61, 32,103,101,116,110, 97, 109,101,115,112, 97, 99,101, 40, 99,111,110,116, 97,105,110, 101,114, 41, 32, 46, 46, 32,116, 10, 9, 99,111,110,116, 97, 105,110,101,114, 46,117,115,101,114,116,121,112,101,115, 91, 116, 93, 32, 61, 32,102,116, 10, 9, 95,117,115,101,114,116, 121,112,101, 91,102,116, 93, 32, 61, 32,102,116, 10, 9,114, 101,116,117,114,110, 32,102,116, 10,101,110,100, 10, 10, 45, 45, 32, 97,112,112,101,110,100, 32,101,110,117,109, 10,102, 117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67,111, 110,116, 97,105,110,101,114, 58, 97,112,112,101,110,100,101, 110,117,109, 32, 40,116, 41, 10, 32,108,111, 99, 97,108, 32, 110, 97,109,101,115,112, 97, 99,101, 32, 61, 32,103,101,116, 110, 97,109,101,115,112, 97, 99,101, 40, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 41, 10, 32,115,101,108,102, 46,101,110,117,109,115, 46,116,111, 108,117, 97, 95,110, 32, 61, 32,115,101,108,102, 46,101,110, 117,109,115, 46,116,111,108,117, 97, 95,110, 32, 43, 32, 49, 10, 32,115,101,108,102, 46,101,110,117,109,115, 91,115,101, 108,102, 46,101,110,117,109,115, 46,116,111,108,117, 97, 95, 110, 93, 32, 61, 32,116, 10, 9,103,108,111, 98, 97,108, 95, 101,110,117,109,115, 91,110, 97,109,101,115,112, 97, 99,101, 46, 46,116, 46,110, 97,109,101, 93, 32, 61, 32,116, 10,101, 110,100, 10, 10, 45, 45, 32,100,101,116,101,114,109,105,110, 101, 32,108,117, 97, 32,102,117,110, 99,116,105,111,110, 32, 110, 97,109,101, 32,111,118,101,114,108,111, 97,100, 10,102, 117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67,111, 110,116, 97,105,110,101,114, 58,111,118,101,114,108,111, 97, 100, 32, 40,108,110, 97,109,101, 41, 10, 32,105,102, 32,110, 111,116, 32,115,101,108,102, 46,108,110, 97,109,101,115, 91, 108,110, 97,109,101, 93, 32,116,104,101,110, 10, 32, 32,115, 101,108,102, 46,108,110, 97,109,101,115, 91,108,110, 97,109, 101, 93, 32, 61, 32, 48, 10, 32,101,108,115,101, 10, 32, 32, 115,101,108,102, 46,108,110, 97,109,101,115, 91,108,110, 97, 109,101, 93, 32, 61, 32,115,101,108,102, 46,108,110, 97,109, 101,115, 91,108,110, 97,109,101, 93, 32, 43, 32, 49, 10, 32, 101,110,100, 10, 32,114,101,116,117,114,110, 32,102,111,114, 109, 97,116, 40, 34, 37, 48, 50,100, 34, 44,115,101,108,102, 46,108,110, 97,109,101,115, 91,108,110, 97,109,101, 93, 41, 10,101,110,100, 10, 10, 45, 45, 32, 97,112,112,108,105,101, 115, 32,116,121,112,101,100,101,102, 58, 32,114,101,116,117, 114,110,115, 32,116,104,101, 32, 39,116,104,101, 32,102, 97, 99,116,111, 39, 32,109,111,100,105,102,105,101,114, 32, 97, 110,100, 32,116,121,112,101, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101, 114, 58, 97,112,112,108,121,116,121,112,101,100,101,102, 32, 40,109,111,100, 44,116,121,112,101, 41, 10, 9,105,102, 32, 103,108,111, 98, 97,108, 95,116,121,112,101,100,101,102,115, 91,116,121,112,101, 93, 32,116,104,101,110, 10, 9, 9, 45, 45,112,114,105,110,116, 40, 34,102,111,117,110,100, 32,116, 121,112,101,100,101,102, 32, 34, 46, 46,103,108,111, 98, 97, 108, 95,116,121,112,101,100,101,102,115, 91,116,121,112,101, 93, 46,116,121,112,101, 41, 10, 9, 9,108,111, 99, 97,108, 32,109,111,100, 49, 44, 32,116,121,112,101, 49, 32, 61, 32, 103,108,111, 98, 97,108, 95,116,121,112,101,100,101,102,115, 91,116,121,112,101, 93, 46,109,111,100, 44, 32,103,108,111, 98, 97,108, 95,116,121,112,101,100,101,102,115, 91,116,121, 112,101, 93, 46,102,116,121,112,101, 10, 9, 9,108,111, 99, 97,108, 32,109,111,100, 50, 44, 32,116,121,112,101, 50, 32, 61, 32, 97,112,112,108,121,116,121,112,101,100,101,102, 40, 109,111,100, 46, 46, 34, 32, 34, 46, 46,109,111,100, 49, 44, 32,116,121,112,101, 49, 41, 10, 9, 9, 45, 45,114,101,116, 117,114,110, 32,109,111,100, 50, 32, 46, 46, 32, 39, 32, 39, 32, 46, 46, 32,109,111,100, 49, 44, 32,116,121,112,101, 50, 10, 9, 9,114,101,116,117,114,110, 32,109,111,100, 50, 44, 32,116,121,112,101, 50, 10, 9,101,110,100, 10, 9,100,111, 32,114,101,116,117,114,110, 32,109,111,100, 44,116,121,112, 101, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 99, 104,101, 99,107, 32,105,102, 32,105,116, 32,105,115, 32, 97, 32,116,121,112,101,100,101,102, 10,102,117,110, 99,116,105, 111,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110, 101,114, 58,105,115,116,121,112,101,100,101,102, 32, 40,116, 121,112,101, 41, 10, 32,108,111, 99, 97,108, 32,101,110,118, 32, 61, 32,115,101,108,102, 10, 32,119,104,105,108,101, 32, 101,110,118, 32,100,111, 10, 32, 32,105,102, 32,101,110,118, 46,116,121,112,101,100,101,102,115, 32,116,104,101,110, 10, 32, 32, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32, 32, 32,119,104,105,108,101, 32,101,110,118, 46,116,121,112,101, 100,101,102,115, 91,105, 93, 32,100,111, 10, 32, 32, 32, 32, 105,102, 32,101,110,118, 46,116,121,112,101,100,101,102,115, 91,105, 93, 46,117,116,121,112,101, 32, 61, 61, 32,116,121, 112,101, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,116,121,112,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32, 32, 32, 101,110,100, 10, 32, 32,101,110,100, 10, 32, 32,101,110,118, 32, 61, 32,101,110,118, 46,112, 97,114,101,110,116, 10, 32, 101,110,100, 10, 32,114,101,116,117,114,110, 32,110,105,108, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, 102,105,110,100, 95,101,110,117,109, 95,118, 97,114, 40,118, 97,114, 41, 10, 10, 9,105,102, 32,116,111,110,117,109, 98, 101,114, 40,118, 97,114, 41, 32,116,104,101,110, 32,114,101, 116,117,114,110, 32,118, 97,114, 32,101,110,100, 10, 10, 9, 108,111, 99, 97,108, 32, 99, 32, 61, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 10, 9,119,104,105,108,101, 32, 99, 32,100,111, 10, 9, 9,108, 111, 99, 97,108, 32,110,115, 32, 61, 32,103,101,116,110, 97, 109,101,115,112, 97, 99,101, 40, 99, 41, 10, 9, 9,102,111, 114, 32,107, 44,118, 32,105,110, 32,112, 97,105,114,115, 40, 95,103,108,111, 98, 97,108, 95,101,110,117,109,115, 41, 32, 100,111, 10, 9, 9, 9,105,102, 32,109, 97,116, 99,104, 95, 116,121,112,101, 40,118, 97,114, 44, 32,118, 44, 32,110,115, 41, 32,116,104,101,110, 10, 9, 9, 9, 9,114,101,116,117, 114,110, 32,118, 10, 9, 9, 9,101,110,100, 10, 9, 9,101, 110,100, 10, 9, 9,105,102, 32, 99, 46, 98, 97,115,101, 32, 97,110,100, 32, 99, 46, 98, 97,115,101, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 9, 9, 9, 99, 32, 61, 32, 95, 103,108,111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91, 99, 58,102,105,110,100,116,121,112,101, 40, 99, 46, 98, 97, 115,101, 41, 93, 10, 9, 9,101,108,115,101, 10, 9, 9, 9, 99, 32, 61, 32,110,105,108, 10, 9, 9,101,110,100, 10, 9, 101,110,100, 10, 10, 9,114,101,116,117,114,110, 32,118, 97, 114, 10,101,110,100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32,105,115, 32, 97, 32,114,101,103,105,115,116, 101,114,101,100, 32,116,121,112,101, 58, 32,114,101,116,117, 114,110, 32,102,117,108,108, 32,116,121,112,101, 32,111,114, 32,110,105,108, 10,102,117,110, 99,116,105,111,110, 32, 99, 108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 58,102, 105,110,100,116,121,112,101, 32, 40,116, 41, 10, 10, 9,116, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 116, 44, 32, 34, 61, 46, 42, 34, 44, 32, 34, 34, 41, 10, 9, 105,102, 32, 95, 98, 97,115,105, 99, 91,116, 93, 32,116,104, 101,110, 10, 9, 32,114,101,116,117,114,110, 32,116, 10, 9, 101,110,100, 10, 10, 9,108,111, 99, 97,108, 32, 95, 44, 95, 44,101,109, 32, 61, 32,115,116,114,105,110,103, 46,102,105, 110,100, 40,116, 44, 32, 34, 40, 91, 38, 37, 42, 93, 41, 37, 115, 42, 36, 34, 41, 10, 9,116, 32, 61, 32,115,116,114,105, 110,103, 46,103,115,117, 98, 40,116, 44, 32, 34, 37,115, 42, 40, 91, 38, 37, 42, 93, 41, 37,115, 42, 36, 34, 44, 32, 34, 34, 41, 10, 9,112, 32, 61, 32,115,101,108,102, 10, 9,119, 104,105,108,101, 32,112, 32, 97,110,100, 32,116,121,112,101, 40,112, 41, 61, 61, 39,116, 97, 98,108,101, 39, 32,100,111, 10, 9, 9,108,111, 99, 97,108, 32,115,116, 32, 61, 32,103, 101,116,110, 97,109,101,115,112, 97, 99,101, 40,112, 41, 10, 10, 9, 9,102,111,114, 32,105, 61, 95,103,108,111, 98, 97, 108, 95,116,121,112,101,115, 46,110, 44, 49, 44, 45, 49, 32, 100,111, 32, 45, 45, 32,105,110, 32,114,101,118,101,114,115, 101, 32,111,114,100,101,114, 10, 10, 9, 9, 9,105,102, 32, 109, 97,116, 99,104, 95,116,121,112,101, 40,116, 44, 32, 95, 103,108,111, 98, 97,108, 95,116,121,112,101,115, 91,105, 93, 44, 32,115,116, 41, 32,116,104,101,110, 10, 9, 9, 9, 9, 114,101,116,117,114,110, 32, 95,103,108,111, 98, 97,108, 95, 116,121,112,101,115, 91,105, 93, 46, 46, 40,101,109, 32,111, 114, 32, 34, 34, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9, 101,110,100, 10, 9, 9,105,102, 32,112, 46, 98, 97,115,101, 32, 97,110,100, 32,112, 46, 98, 97,115,101, 32,126, 61, 32, 39, 39, 32, 97,110,100, 32,112, 46, 98, 97,115,101, 32,126, 61, 32,116, 32,116,104,101,110, 10, 9, 9, 9, 45, 45,112, 114,105,110,116, 40, 34,116,121,112,101, 32,105,115, 32, 34, 46, 46,116, 46, 46, 34, 44, 32,112, 32,105,115, 32, 34, 46, 46,112, 46, 98, 97,115,101, 46, 46, 34, 32,115,101,108,102, 46,116,121,112,101, 32,105,115, 32, 34, 46, 46,115,101,108, 102, 46,116,121,112,101, 46, 46, 34, 32,115,101,108,102, 46, 110, 97,109,101, 32,105,115, 32, 34, 46, 46,115,101,108,102, 46,110, 97,109,101, 41, 10, 9, 9, 9,112, 32, 61, 32, 95, 103,108,111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91, 112, 58,102,105,110,100,116,121,112,101, 40,112, 46, 98, 97, 115,101, 41, 93, 10, 9, 9,101,108,115,101, 10, 9, 9, 9, 112, 32, 61, 32,110,105,108, 10, 9, 9,101,110,100, 10, 9, 101,110,100, 10, 10, 9,114,101,116,117,114,110, 32,110,105, 108, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, 97,112,112,101,110,100, 95,103,108,111, 98, 97,108, 95, 116,121,112,101, 40,116, 44, 32, 99,108, 97,115,115, 41, 10, 9, 95,103,108,111, 98, 97,108, 95,116,121,112,101,115, 46, 110, 32, 61, 32, 95,103,108,111, 98, 97,108, 95,116,121,112, 101,115, 46,110, 32, 43, 49, 10, 9, 95,103,108,111, 98, 97, 108, 95,116,121,112,101,115, 91, 95,103,108,111, 98, 97,108, 95,116,121,112,101,115, 46,110, 93, 32, 61, 32,116, 10, 9, 95,103,108,111, 98, 97,108, 95,116,121,112,101,115, 95,104, 97,115,104, 91,116, 93, 32, 61, 32, 49, 10, 9,105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 32, 97,112,112,101, 110,100, 95, 99,108, 97,115,115, 95,116,121,112,101, 40,116, 44, 32, 99,108, 97,115,115, 41, 32,101,110,100, 10,101,110, 100, 10, 10,102,117,110, 99,116,105,111,110, 32, 97,112,112, 101,110,100, 95, 99,108, 97,115,115, 95,116,121,112,101, 40, 116, 44, 99,108, 97,115,115, 41, 10, 9,105,102, 32, 95,103, 108,111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91,116, 93, 32,116,104,101,110, 10, 9, 9, 99,108, 97,115,115, 46, 102,108, 97,103,115, 32, 61, 32, 95,103,108,111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91,116, 93, 46,102,108, 97, 103,115, 10, 9, 9, 99,108, 97,115,115, 46,108,110, 97,109, 101,115, 32, 61, 32, 95,103,108,111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91,116, 93, 46,108,110, 97,109,101,115, 10, 9, 9,105,102, 32, 95,103,108,111, 98, 97,108, 95, 99, 108, 97,115,115,101,115, 91,116, 93, 46, 98, 97,115,101, 32, 97,110,100, 32, 40, 95,103,108,111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91,116, 93, 46, 98, 97,115,101, 32,126, 61, 32, 39, 39, 41, 32,116,104,101,110, 10, 9, 9, 9, 99, 108, 97,115,115, 46, 98, 97,115,101, 32, 61, 32, 95,103,108, 111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91,116, 93, 46, 98, 97,115,101, 32,111,114, 32, 99,108, 97,115,115, 46, 98, 97,115,101, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10, 9, 95,103,108,111, 98, 97,108, 95, 99,108, 97,115,115, 101,115, 91,116, 93, 32, 61, 32, 99,108, 97,115,115, 10, 9, 99,108, 97,115,115, 46,102,108, 97,103,115, 32, 61, 32, 99, 108, 97,115,115, 46,102,108, 97,103,115, 32,111,114, 32,123, 125, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109, 97,116, 99,104, 95,116,121,112,101, 40, 99,104,105, 108,100,116,121,112,101, 44, 32,114,101,103,116,121,112,101, 44, 32,115,116, 41, 10, 45, 45,112,114,105,110,116, 40, 34, 102,105,110,100,116,121,112,101, 32, 34, 46, 46, 99,104,105, 108,100,116,121,112,101, 46, 46, 34, 44, 32, 34, 46, 46,114, 101,103,116,121,112,101, 46, 46, 34, 44, 32, 34, 46, 46,115, 116, 41, 10, 9,108,111, 99, 97,108, 32, 98, 44,101, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,114,101, 103,116,121,112,101, 44, 32, 99,104,105,108,100,116,121,112, 101, 44, 32, 45,115,116,114,105,110,103, 46,108,101,110, 40, 99,104,105,108,100,116,121,112,101, 41, 44, 32,116,114,117, 101, 41, 10, 9,105,102, 32, 98, 32,116,104,101,110, 10, 10, 9, 9,105,102, 32,101, 32, 61, 61, 32,115,116,114,105,110, 103, 46,108,101,110, 40,114,101,103,116,121,112,101, 41, 32, 97,110,100, 10, 9, 9, 9, 9, 40, 98, 32, 61, 61, 32, 49, 32,111,114, 32, 40,115,116,114,105,110,103, 46,115,117, 98, 40,114,101,103,116,121,112,101, 44, 32, 98, 45, 49, 44, 32, 98, 45, 49, 41, 32, 61, 61, 32, 39, 58, 39, 32, 97,110,100, 10, 9, 9, 9, 9,115,116,114,105,110,103, 46,115,117, 98, 40,114,101,103,116,121,112,101, 44, 32, 49, 44, 32, 98, 45, 49, 41, 32, 61, 61, 32,115,116,114,105,110,103, 46,115,117, 98, 40,115,116, 44, 32, 49, 44, 32, 98, 45, 49, 41, 41, 41, 32,116,104,101,110, 10, 9, 9, 9,114,101,116,117,114,110, 32,116,114,117,101, 10, 9, 9,101,110,100, 10, 9,101,110, 100, 10, 10, 9,114,101,116,117,114,110, 32,102, 97,108,115, 101, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,102,105,110,100,116,121,112,101, 95,111,110, 95, 99,104, 105,108,100,115, 40,115,101,108,102, 44, 32,116, 41, 10, 10, 9,108,111, 99, 97,108, 32,116, 99,104,105,108,100, 10, 9, 105,102, 32,115,101,108,102, 46, 99,108, 97,115,115,116,121, 112,101, 32, 61, 61, 32, 39, 99,108, 97,115,115, 39, 32,111, 114, 32,115,101,108,102, 46, 99,108, 97,115,115,116,121,112, 101, 32, 61, 61, 32, 39,110, 97,109,101,115,112, 97, 99,101, 39, 32,116,104,101,110, 10, 9, 9,102,111,114, 32,107, 44, 118, 32,105,110, 32,105,112, 97,105,114,115, 40,115,101,108, 102, 41, 32,100,111, 10, 9, 9, 9,105,102, 32,118, 46, 99, 108, 97,115,115,116,121,112,101, 32, 61, 61, 32, 39, 99,108, 97,115,115, 39, 32,111,114, 32,118, 46, 99,108, 97,115,115, 116,121,112,101, 32, 61, 61, 32, 39,110, 97,109,101,115,112, 97, 99,101, 39, 32,116,104,101,110, 10, 9, 9, 9, 9,105, 102, 32,118, 46,116,121,112,101,100,101,102,115, 32, 97,110, 100, 32,118, 46,116,121,112,101,100,101,102,115, 91,116, 93, 32,116,104,101,110, 10, 9, 9, 9, 9, 32,114,101,116,117, 114,110, 32,118, 46,116,121,112,101,100,101,102,115, 91,116, 93, 10, 9, 9, 9, 9,101,108,115,101,105,102, 32,118, 46, 117,115,101,114,116,121,112,101,115, 32, 97,110,100, 32,118, 46,117,115,101,114,116,121,112,101,115, 91,116, 93, 32,116, 104,101,110, 10, 9, 9, 9, 9, 32,114,101,116,117,114,110, 32,118, 46,117,115,101,114,116,121,112,101,115, 91,116, 93, 10, 9, 9, 9, 9,101,110,100, 10, 9, 9, 9, 9,116, 99, 104,105,108,100, 32, 61, 32,102,105,110,100,116,121,112,101, 95,111,110, 95, 99,104,105,108,100,115, 40,118, 44, 32,116, 41, 10, 9, 9, 9, 9,105,102, 32,116, 99,104,105,108,100, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,116, 99, 104,105,108,100, 32,101,110,100, 10, 9, 9, 9,101,110,100, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10, 9,114,101, 116,117,114,110, 32,110,105,108, 10, 10,101,110,100, 10, 10, 102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67, 111,110,116, 97,105,110,101,114, 58,105,115,101,110,117,109, 32, 40,116,121,112,101, 41, 10, 32,105,102, 32,103,108,111, 98, 97,108, 95,101,110,117,109,115, 91,116,121,112,101, 93, 32,116,104,101,110, 10, 9,114,101,116,117,114,110, 32,116, 121,112,101, 10, 32,101,108,115,101, 10, 32, 9,114,101,116, 117,114,110, 32,102, 97,108,115,101, 10, 32,101,110,100, 10, 10, 32,108,111, 99, 97,108, 32, 98, 97,115,101,116,121,112, 101, 32, 61, 32,103,115,117, 98, 40,116,121,112,101, 44, 34, 94, 46, 42, 58, 58, 34, 44, 34, 34, 41, 10, 32,108,111, 99, 97,108, 32,101,110,118, 32, 61, 32,115,101,108,102, 10, 32, 119,104,105,108,101, 32,101,110,118, 32,100,111, 10, 32, 32, 105,102, 32,101,110,118, 46,101,110,117,109,115, 32,116,104, 101,110, 10, 32, 32, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32, 32, 32,119,104,105,108,101, 32,101,110,118, 46,101, 110,117,109,115, 91,105, 93, 32,100,111, 10, 32, 32, 32, 32, 105,102, 32,101,110,118, 46,101,110,117,109,115, 91,105, 93, 46,110, 97,109,101, 32, 61, 61, 32, 98, 97,115,101,116,121, 112,101, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,116,114,117,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32, 32, 32, 101,110,100, 10, 32, 32,101,110,100, 10, 32, 32,101,110,118, 32, 61, 32,101,110,118, 46,112, 97,114,101,110,116, 10, 32, 101,110,100, 10, 32,114,101,116,117,114,110, 32,102, 97,108, 115,101, 10,101,110,100, 10, 10,109,101,116,104,111,100,105, 115,118,105,114,116,117, 97,108, 32, 61, 32,102, 97,108,115, 101, 32, 45, 45, 32, 97, 32,103,108,111, 98, 97,108, 10, 10, 45, 45, 32,112, 97,114,115,101, 32, 99,104,117,110,107, 10, 102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67, 111,110,116, 97,105,110,101,114, 58,100,111,112, 97,114,115, 101, 32, 40,115, 41, 10, 45, 45,112,114,105,110,116, 32, 40, 34,112, 97,114,115,101, 32, 34, 46, 46,115, 41, 10, 10, 32, 45, 45, 32,116,114,121, 32,116,104,101, 32,112, 97,114,115, 101,114, 32,104,111,111,107, 10, 32,100,111, 10, 32, 9,108, 111, 99, 97,108, 32,115,117, 98, 32, 61, 32,112, 97,114,115, 101,114, 95,104,111,111,107, 40,115, 41, 10, 32, 9,105,102, 32,115,117, 98, 32,116,104,101,110, 10, 32, 9, 9,114,101, 116,117,114,110, 32,115,117, 98, 10, 32, 9,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,116, 104,101, 32,110,117,108,108, 32,115,116, 97,116,101,109,101, 110,116, 10, 32,100,111, 10, 32, 9,108,111, 99, 97,108, 32, 98, 44,101, 44, 99,111,100,101, 32, 61, 32,115,116,114,105, 110,103, 46,102,105,110,100, 40,115, 44, 32, 34, 94, 37,115, 42, 59, 34, 41, 10, 32, 9,105,102, 32, 98, 32,116,104,101, 110, 10, 32, 9, 9,114,101,116,117,114,110, 32,115,116,114, 115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 9,101,110, 100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,101,109,112,116,121, 32,118,101,114, 98, 97,116,105,109, 32,108,105,110,101, 10, 32,100,111, 10, 32, 9,108,111, 99, 97,108, 32, 98, 44,101, 44, 99,111,100,101, 32, 61, 32,115, 116,114,105,110,103, 46,102,105,110,100, 40,115, 44, 32, 34, 94, 37,115, 42, 36, 92,110, 34, 41, 10, 32, 9,105,102, 32, 98, 32,116,104,101,110, 10, 32, 9, 9,114,101,116,117,114, 110, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 9,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32, 76,117, 97, 32, 99,111,100,101, 10, 32,100,111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44, 99,111,100,101, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 37, 98, 92, 49, 92, 50, 41, 34, 41, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 67,111,100,101, 40,115,116,114,115,117, 98, 40, 99,111,100,101, 44, 50, 44, 45, 50, 41, 41, 10, 32, 32, 32,114,101,116,117,114,110, 32,115,116,114,115,117, 98, 40, 115, 44,101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32,101, 110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32, 67, 32, 99, 111,100,101, 10, 32,100,111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44, 99,111,100,101, 32, 61, 32,115,116,114, 102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 37, 98, 92, 51, 92, 52, 41, 34, 41, 10, 32, 32,105,102, 32, 98, 32, 116,104,101,110, 10, 9, 99,111,100,101, 32, 61, 32, 39,123, 39, 46, 46,115,116,114,115,117, 98, 40, 99,111,100,101, 44, 50, 44, 45, 50, 41, 46, 46, 39, 92,110,125, 92,110, 39, 10, 9, 86,101,114, 98, 97,116,105,109, 40, 99,111,100,101, 44, 39,114, 39, 41, 32, 32, 32, 32, 32, 32, 32, 32, 45, 45, 32, 118,101,114, 98, 97,116,105,109, 32, 99,111,100,101, 32,102, 111,114, 32, 39,114, 39,101,103,105,115,116,101,114, 32,102, 114, 97,103,109,101,110,116, 10, 9,114,101,116,117,114,110, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32, 67, 32, 99,111,100,101, 32,102,111,114, 32,112,114,101, 97,109, 98,108,101, 32,115,101, 99,116,105, 111,110, 10, 32,100,111, 10, 32, 9,108,111, 99, 97,108, 32, 98, 44,101, 44, 99,111,100,101, 32, 61, 32,115,116,114,105, 110,103, 46,102,105,110,100, 40,115, 44, 32, 34, 94, 37,115, 42, 40, 37, 98, 92, 53, 92, 54, 41, 34, 41, 10, 32, 9,105, 102, 32, 98, 32,116,104,101,110, 10, 32, 9, 9, 99,111,100, 101, 32, 61, 32,115,116,114,105,110,103, 46,115,117, 98, 40, 99,111,100,101, 44, 32, 50, 44, 32, 45, 50, 41, 46, 46, 34, 92,110, 34, 10, 9, 9, 86,101,114, 98, 97,116,105,109, 40, 99,111,100,101, 44, 32, 39, 39, 41, 10, 9, 9,114,101,116, 117,114,110, 32,115,116,114,105,110,103, 46,115,117, 98, 40, 115, 44, 32,101, 43, 49, 41, 10, 32, 9,101,110,100, 10, 32, 101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,100,101, 102, 97,117,108,116, 95,112,114,111,112,101,114,116,121, 32, 100,105,114,101, 99,116,105,118,101, 10, 32,100,111, 10, 32, 9,108,111, 99, 97,108, 32, 98, 44,101, 44,112,116,121,112, 101, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 32, 34, 94, 37,115, 42, 84, 79, 76, 85, 65, 95, 80, 82, 79, 80, 69, 82, 84, 89, 95, 84, 89, 80, 69, 37,115, 42, 37, 40, 43, 37,115, 42, 40, 91, 94, 37, 41, 37,115, 93, 42, 41, 37,115, 42, 37, 41, 43, 37,115, 42, 59, 63, 34, 41, 10, 32, 9,105, 102, 32, 98, 32,116,104,101,110, 10, 32, 9, 9,105,102, 32, 110,111,116, 32,112,116,121,112,101, 32,111,114, 32,112,116, 121,112,101, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, 9, 9, 9,112,116,121,112,101, 32, 61, 32, 34,100,101, 102, 97,117,108,116, 34, 10, 32, 9, 9,101,110,100, 10, 32, 9, 9,115,101,108,102, 58,115,101,116, 95,112,114,111,112, 101,114,116,121, 95,116,121,112,101, 40,112,116,121,112,101, 41, 10, 9, 32, 9,114,101,116,117,114,110, 32,115,116,114, 115,117, 98, 40,115, 44, 32,101, 43, 49, 41, 10, 32, 9,101, 110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114, 121, 32,112,114,111,116,101, 99,116,101,100, 95,100,101,115, 116,114,117, 99,116,111,114, 32,100,105,114,101, 99,116,105, 118,101, 10, 32,100,111, 10, 32, 9,108,111, 99, 97,108, 32, 98, 44,101, 32, 61, 32,115,116,114,105,110,103, 46,102,105, 110,100, 40,115, 44, 32, 34, 94, 37,115, 42, 84, 79, 76, 85, 65, 95, 80, 82, 79, 84, 69, 67, 84, 69, 68, 95, 68, 69, 83, 84, 82, 85, 67, 84, 79, 82, 37,115, 42, 59, 63, 34, 41, 10, 9,105,102, 32, 98, 32,116,104,101,110, 10, 9, 9,105,102, 32,115,101,108,102, 46,115,101,116, 95,112,114,111,116,101, 99,116,101,100, 95,100,101,115,116,114,117, 99,116,111,114, 32,116,104,101,110, 10, 9, 32, 9, 9,115,101,108,102, 58, 115,101,116, 95,112,114,111,116,101, 99,116,101,100, 95,100, 101,115,116,114,117, 99,116,111,114, 40,116,114,117,101, 41, 10, 9, 32, 9,101,110,100, 10, 32, 9, 9,114,101,116,117, 114,110, 32,115,116,114,115,117, 98, 40,115, 44, 32,101, 43, 49, 41, 10, 32, 9,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32, 39,101,120,116,101,114,110, 39, 32,107,101,121,119,111,114,100, 10, 32,100,111, 10, 32, 9,108,111, 99, 97,108, 32, 98, 44,101, 32, 61, 32,115,116, 114,105,110,103, 46,102,105,110,100, 40,115, 44, 32, 34, 94, 37,115, 42,101,120,116,101,114,110, 37,115, 43, 34, 41, 10, 32, 9,105,102, 32, 98, 32,116,104,101,110, 10, 9, 9, 45, 45, 32,100,111, 32,110,111,116,104,105,110,103, 10, 32, 9, 9,114,101,116,117,114,110, 32,115,116,114,115,117, 98, 40, 115, 44, 32,101, 43, 49, 41, 10, 32, 9,101,110,100, 10, 32, 101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32, 39,118, 105,114,116,117, 97,108, 39, 32,107,101,121,119,111,114,107, 100, 10, 32,100,111, 10, 32, 9,108,111, 99, 97,108, 32, 98, 44,101, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110, 100, 40,115, 44, 32, 34, 94, 37,115, 42,118,105,114,116,117, 97,108, 37,115, 43, 34, 41, 10, 32, 9,105,102, 32, 98, 32, 116,104,101,110, 10, 32, 9, 9,109,101,116,104,111,100,105, 115,118,105,114,116,117, 97,108, 32, 61, 32,116,114,117,101, 10, 32, 9, 9,114,101,116,117,114,110, 32,115,116,114,115, 117, 98, 40,115, 44, 32,101, 43, 49, 41, 10, 32, 9,101,110, 100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,108, 97, 98,101,108,115, 32, 40,112,117, 98,108,105, 99, 44, 32,112,114,105,118, 97,116,101, 44, 32,101,116, 99, 41, 10, 32,100,111, 10, 32, 9,108,111, 99, 97,108, 32, 98, 44, 101, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,115, 44, 32, 34, 94, 37,115, 42, 37,119, 42, 37,115, 42, 58, 91, 94, 58, 93, 34, 41, 10, 32, 9,105,102, 32, 98, 32, 116,104,101,110, 10, 32, 9, 9,114,101,116,117,114,110, 32, 115,116,114,115,117, 98, 40,115, 44, 32,101, 41, 32, 45, 45, 32,112,114,101,115,101,114,118,101, 32,116,104,101, 32, 91, 94, 58, 93, 10, 32, 9,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,109,111,100,117,108,101, 10, 32,100,111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44, 101, 44,110, 97,109,101, 44, 98,111,100,121, 32, 61, 32,115, 116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42,109, 111,100,117,108,101, 37,115, 37,115, 42, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 93, 42, 41, 37,115, 42, 40, 37, 98,123, 125, 41, 37,115, 42, 34, 41, 10, 32, 32,105,102, 32, 98, 32, 116,104,101,110, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99, 111,100,101, 32, 61, 32,115,116,114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 32, 32, 32, 77,111,100,117,108,101, 40, 110, 97,109,101, 44, 98,111,100,121, 41, 10, 32, 32, 32,114, 101,116,117,114,110, 32,115,116,114,115,117, 98, 40,115, 44, 101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,110, 97,109,101,115, 97,112, 99,101, 10, 32,100,111, 10, 32, 32,108,111, 99, 97, 108, 32, 98, 44,101, 44,110, 97,109,101, 44, 98,111,100,121, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42,110, 97,109,101,115,112, 97, 99,101, 37,115, 37, 115, 42, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 93, 42, 41, 37,115, 42, 40, 37, 98,123,125, 41, 37,115, 42, 59, 63, 34, 41, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32, 115,116,114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 32, 32, 32, 78, 97,109,101,115,112, 97, 99,101, 40,110, 97,109, 101, 44, 98,111,100,121, 41, 10, 32, 32, 32,114,101,116,117, 114,110, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,100,101,102,105,110,101, 10, 32, 100,111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44, 110, 97,109,101, 32, 61, 32,115,116,114,102,105,110,100, 40, 115, 44, 34, 94, 37,115, 42, 35,100,101,102,105,110,101, 37, 115, 37,115, 42, 40, 91, 94, 37,115, 93, 42, 41, 91, 94, 92, 110, 93, 42, 92,110, 37,115, 42, 34, 41, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 95, 99,117,114, 114, 95, 99,111,100,101, 32, 61, 32,115,116,114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 32, 32, 32, 68,101,102,105, 110,101, 40,110, 97,109,101, 41, 10, 32, 32, 32,114,101,116, 117,114,110, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,101,110,117,109,101,114, 97, 116,101,115, 10, 10, 32,100,111, 10, 32, 32,108,111, 99, 97, 108, 32, 98, 44,101, 44,110, 97,109,101, 44, 98,111,100,121, 44,118, 97,114,110, 97,109,101, 32, 61, 32,115,116,114,102, 105,110,100, 40,115, 44, 34, 94, 37,115, 42,101,110,117,109, 37,115, 43, 40, 37, 83, 42, 41, 37,115, 42, 40, 37, 98,123, 125, 41, 37,115, 42, 40, 91, 94, 37,115, 59, 93, 42, 41, 37, 115, 42, 59, 63, 37,115, 42, 34, 41, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 45, 45,101,114,114, 111,114, 40, 34, 35, 83,111,114,114,121, 44, 32,100,101, 99, 108, 97,114, 97,116,105,111,110, 32,111,102, 32,101,110,117, 109,115, 32, 97,110,100, 32,118, 97,114,105, 97, 98,108,101, 115, 32,111,110, 32,116,104,101, 32,115, 97,109,101, 32,115, 116, 97,116,101,109,101,110,116, 32,105,115, 32,110,111,116, 32,115,117,112,112,111,114,116,101,100, 46, 92,110, 68,101, 99,108, 97,114,101, 32,121,111,117,114, 32,118, 97,114,105, 97, 98,108,101, 32,115,101,112, 97,114, 97,116,101,108,121, 32, 40,101,120, 97,109,112,108,101, 58, 32, 39, 34, 46, 46, 110, 97,109,101, 46, 46, 34, 32, 34, 46, 46,118, 97,114,110, 97,109,101, 46, 46, 34, 59, 39, 41, 34, 41, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32,115,116, 114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 32, 32, 32, 69,110,117,109,101,114, 97,116,101, 40,110, 97,109,101, 44, 98,111,100,121, 44,118, 97,114,110, 97,109,101, 41, 10, 32, 32, 32,114,101,116,117,114,110, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32, 101,110,100, 10, 10, 45, 45, 32,100,111, 10, 45, 45, 32, 32, 108,111, 99, 97,108, 32, 98, 44,101, 44,110, 97,109,101, 44, 98,111,100,121, 32, 61, 32,115,116,114,102,105,110,100, 40, 115, 44, 34, 94, 37,115, 42,101,110,117,109, 37,115, 43, 40, 37, 83, 42, 41, 37,115, 42, 40, 37, 98,123,125, 41, 37,115, 42, 59, 63, 37,115, 42, 34, 41, 10, 45, 45, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 45, 45, 32, 32, 32, 95, 99, 117,114,114, 95, 99,111,100,101, 32, 61, 32,115,116,114,115, 117, 98, 40,115, 44, 98, 44,101, 41, 10, 45, 45, 32, 32, 32, 69,110,117,109,101,114, 97,116,101, 40,110, 97,109,101, 44, 98,111,100,121, 41, 10, 45, 45, 32, 32,114,101,116,117,114, 110, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 45, 45, 32, 32,101,110,100, 10, 45, 45, 32,101,110,100, 10, 10, 32,100,111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44, 98,111,100,121, 44,110, 97,109,101, 32, 61, 32, 115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 116,121,112,101,100,101,102, 37,115, 43,101,110,117,109, 91, 94,123, 93, 42, 40, 37, 98,123,125, 41, 37,115, 42, 40, 91, 37,119, 95, 93, 91, 94, 37,115, 93, 42, 41, 37,115, 42, 59, 37,115, 42, 34, 41, 10, 32, 32,105,102, 32, 98, 32,116,104, 101,110, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99,111,100, 101, 32, 61, 32,115,116,114,115,117, 98, 40,115, 44, 98, 44, 101, 41, 10, 32, 32, 32, 69,110,117,109,101,114, 97,116,101, 40,110, 97,109,101, 44, 98,111,100,121, 41, 10, 32, 32, 32, 114,101,116,117,114,110, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32,101,110, 100, 10, 10, 32, 45, 45, 32,116,114,121, 32,111,112,101,114, 97,116,111,114, 10, 32,100,111, 10, 32, 32,108,111, 99, 97, 108, 32, 98, 44,101, 44,100,101, 99,108, 44,107,105,110,100, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116, 114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 37,115, 37, 42, 38, 58, 60, 62, 44, 93, 45, 37,115, 43,111,112,101,114, 97,116,111,114, 41, 37,115, 42, 40, 91, 94, 37,115, 93, 91, 94, 37,115, 93, 42, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63,111, 63,110, 63,115, 63,116, 63, 41, 37,115, 42, 59, 37,115, 42, 34, 41, 10, 32, 32,105,102, 32,110,111,116, 32, 98, 32,116,104,101,110, 10, 9, 9, 32, 45, 45, 32,116,114, 121, 32,105,110,108,105,110,101, 10, 32, 32, 32, 98, 44,101, 44,100,101, 99,108, 44,107,105,110,100, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 37,115, 37, 42, 38, 58, 60, 62, 44, 93, 45, 37, 115, 43,111,112,101,114, 97,116,111,114, 41, 37,115, 42, 40, 91, 94, 37,115, 93, 91, 94, 37,115, 93, 42, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63,111, 63,110, 63,115, 63,116, 63, 41, 91, 37,115, 92,110, 93, 42, 37, 98, 123,125, 37,115, 42, 59, 63, 37,115, 42, 34, 41, 10, 32, 32, 101,110,100, 10, 32, 32,105,102, 32,110,111,116, 32, 98, 32, 116,104,101,110, 10, 32, 32, 9, 45, 45, 32,116,114,121, 32, 99, 97,115,116, 32,111,112,101,114, 97,116,111,114, 10, 32, 32, 9, 98, 44,101, 44,100,101, 99,108, 44,107,105,110,100, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116, 114,102,105,110,100, 40,115, 44, 32, 34, 94, 37,115, 42, 40, 111,112,101,114, 97,116,111,114, 41, 37,115, 43, 40, 91, 37, 119, 95, 58, 37,100, 60, 62, 37, 42, 37, 38, 37,115, 93, 43, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63,111, 63,110, 63,115, 63,116, 63, 41, 34, 41, 59, 10, 32, 32, 9,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 9, 9,108,111, 99, 97,108, 32, 95, 44,105,101, 32, 61, 32,115, 116,114,105,110,103, 46,102,105,110,100, 40,115, 44, 32, 34, 94, 37,115, 42, 37, 98,123,125, 34, 44, 32,101, 43, 49, 41, 10, 32, 32, 9, 9,105,102, 32,105,101, 32,116,104,101,110, 10, 32, 32, 9, 9, 9,101, 32, 61, 32,105,101, 10, 32, 32, 9, 9,101,110,100, 10, 32, 32, 9,101,110,100, 10, 32, 32, 101,110,100, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32,115,116,114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 32, 32, 32, 79,112,101,114, 97,116,111,114, 40,100,101, 99,108, 44,107,105,110,100, 44, 97,114,103, 44, 99,111,110, 115,116, 41, 10, 32, 32, 32,114,101,116,117,114,110, 32,115, 116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32, 101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116, 114,121, 32,102,117,110, 99,116,105,111,110, 10, 32,100,111, 10, 32, 32, 45, 45,108,111, 99, 97,108, 32, 98, 44,101, 44, 100,101, 99,108, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37, 115, 42, 40, 91,126, 95, 37,119, 93, 91, 95, 64, 37,119, 37, 115, 37, 42, 38, 58, 60, 62, 93, 42, 91, 95, 37,119, 93, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63, 111, 63,110, 63,115, 63,116, 63, 41, 37,115, 42, 61, 63, 37, 115, 42, 48, 63, 37,115, 42, 59, 37,115, 42, 34, 41, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44,100,101, 99,108, 44, 97,114,103, 44, 99,111,110,115,116, 44,118,105,114,116, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 91, 94, 37, 40, 92,110, 93, 43, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63,111, 63, 110, 63,115, 63,116, 63, 41, 37,115, 42, 40, 61, 63, 37,115, 42, 48, 63, 41, 37,115, 42, 59, 37,115, 42, 34, 41, 10, 32, 32,105,102, 32,110,111,116, 32, 98, 32,116,104,101,110, 10, 32, 32, 9, 45, 45, 32,116,114,121, 32,102,117,110, 99,116, 105,111,110, 32,119,105,116,104, 32,116,101,109,112,108, 97, 116,101, 10, 32, 32, 9, 98, 44,101, 44,100,101, 99,108, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116,114, 102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 91,126, 95, 37,119, 93, 91, 95, 64, 37,119, 37,115, 37, 42, 38, 58, 60, 62, 93, 42, 91, 95, 37,119, 93, 37, 98, 60, 62, 41, 37, 115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63,111, 63,110, 63,115, 63,116, 63, 41, 37,115, 42, 61, 63, 37,115, 42, 48, 63, 37,115, 42, 59, 37,115, 42, 34, 41, 10, 32, 32, 101,110,100, 10, 32, 32,105,102, 32,110,111,116, 32, 98, 32, 116,104,101,110, 10, 32, 32, 32, 45, 45, 32,116,114,121, 32, 97, 32,115,105,110,103,108,101, 32,108,101,116,116,101,114, 32,102,117,110, 99,116,105,111,110, 32,110, 97,109,101, 10, 32, 32, 32, 98, 44,101, 44,100,101, 99,108, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116,114,102,105,110, 100, 40,115, 44, 34, 94, 37,115, 42, 40, 91, 95, 37,119, 93, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63,111, 63,110, 63,115, 63,116, 63, 41, 37,115, 42, 59, 37, 115, 42, 34, 41, 10, 32, 32,101,110,100, 10, 32, 32,105,102, 32,110,111,116, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 45, 45, 32,116,114,121, 32,102,117,110, 99,116,105,111,110, 32,112,111,105,110,116,101,114, 10, 32, 32, 32, 98, 44,101, 44,100,101, 99,108, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 91, 94, 37, 40, 59, 92,110, 93, 43, 37, 98, 40, 41, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 59, 37,115, 42, 34, 41, 10, 32, 32, 32,105,102, 32, 98, 32, 116,104,101,110, 10, 32, 32, 32, 32,100,101, 99,108, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,100,101, 99,108, 44, 32, 34, 37, 40, 37,115, 42, 37, 42, 40, 91, 94, 37, 41, 93, 42, 41, 37,115, 42, 37, 41, 34, 44, 32, 34, 32, 37, 49, 32, 34, 41, 10, 32, 32, 32,101,110,100, 10, 32, 32, 101,110,100, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 9,105,102, 32,118,105,114,116, 32, 97,110,100, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,118,105, 114,116, 44, 32, 34, 91, 61, 48, 93, 34, 41, 32,116,104,101, 110, 10, 32, 32, 9, 9,105,102, 32,115,101,108,102, 46,102, 108, 97,103,115, 32,116,104,101,110, 10, 32, 32, 9, 9, 9, 115,101,108,102, 46,102,108, 97,103,115, 46,112,117,114,101, 95,118,105,114,116,117, 97,108, 32, 61, 32,116,114,117,101, 10, 32, 32, 9, 9,101,110,100, 10, 32, 32, 9,101,110,100, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32,115,116,114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 32, 32, 32, 70,117,110, 99,116,105,111,110, 40,100,101, 99,108, 44, 97,114,103, 44, 99,111,110,115,116, 41, 10, 32, 32, 32,114,101,116,117,114,110, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32, 101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,105,110, 108,105,110,101, 32,102,117,110, 99,116,105,111,110, 10, 32, 100,111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44, 100,101, 99,108, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37, 115, 42, 40, 91, 94, 37, 40, 92,110, 93, 43, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63,111, 63,110, 63,115, 63,116, 63, 41, 91, 94, 59,123, 93, 42, 37, 98,123, 125, 37,115, 42, 59, 63, 37,115, 42, 34, 41, 10, 32, 32, 45, 45,108,111, 99, 97,108, 32, 98, 44,101, 44,100,101, 99,108, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116, 114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 91, 126, 95, 37,119, 93, 91, 95, 64, 37,119, 37,115, 37, 42, 38, 58, 60, 62, 93, 42, 91, 95, 37,119, 62, 93, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63,111, 63,110, 63,115, 63,116, 63, 41, 91, 94, 59, 93, 42, 37, 98,123,125, 37,115, 42, 59, 63, 37,115, 42, 34, 41, 10, 32, 32,105,102, 32,110,111,116, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 45, 45, 32,116,114,121, 32, 97, 32,115,105,110,103,108,101, 32,108,101,116,116,101,114, 32,102,117,110, 99,116,105,111, 110, 32,110, 97,109,101, 10, 32, 32, 32, 98, 44,101, 44,100, 101, 99,108, 44, 97,114,103, 44, 99,111,110,115,116, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 91, 95, 37,119, 93, 41, 37,115, 42, 40, 37, 98, 40, 41, 41, 37,115, 42, 40, 99, 63,111, 63,110, 63,115, 63,116, 63, 41, 46, 45, 37, 98,123,125, 37,115, 42, 59, 63, 37,115, 42, 34, 41, 10, 32, 32,101,110,100, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32,115,116,114,115,117, 98, 40, 115, 44, 98, 44,101, 41, 10, 32, 32, 32, 70,117,110, 99,116, 105,111,110, 40,100,101, 99,108, 44, 97,114,103, 44, 99,111, 110,115,116, 41, 10, 32, 32, 32,114,101,116,117,114,110, 32, 115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 116,114,121, 32, 99,108, 97,115,115, 10, 32,100,111, 10, 9, 32,108,111, 99, 97,108, 32, 98, 44,101, 44,110, 97,109,101, 44, 98, 97,115,101, 44, 98,111,100,121, 10, 9, 9, 98, 97, 115,101, 32, 61, 32, 39, 39, 32, 98,111,100,121, 32, 61, 32, 39, 39, 10, 9, 9, 98, 44,101, 44,110, 97,109,101, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 99,108, 97,115,115, 37,115, 42, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 64, 93, 42, 41, 37,115, 42, 59, 34, 41, 32, 32, 45, 45, 32,100,117,109,109,121, 32, 99,108, 97,115,115, 10, 9, 9,108,111, 99, 97,108, 32,100,117,109,109,121, 32, 61, 32,102, 97,108,115,101, 10, 9, 9,105,102, 32,110,111, 116, 32, 98, 32,116,104,101,110, 10, 9, 9, 9, 98, 44,101, 44,110, 97,109,101, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42,115,116,114,117, 99,116, 37, 115, 42, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 64, 93, 42, 41, 37,115, 42, 59, 34, 41, 32, 32, 32, 32, 45, 45, 32,100, 117,109,109,121, 32,115,116,114,117, 99,116, 10, 9, 9, 9, 105,102, 32,110,111,116, 32, 98, 32,116,104,101,110, 10, 9, 9, 9, 9, 98, 44,101, 44,110, 97,109,101, 44, 98, 97,115, 101, 44, 98,111,100,121, 32, 61, 32,115,116,114,102,105,110, 100, 40,115, 44, 34, 94, 37,115, 42, 99,108, 97,115,115, 37, 115, 42, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 64, 93, 42, 41, 37,115, 42, 40, 91, 94,123, 93, 45, 41, 37,115, 42, 40, 37, 98,123,125, 41, 37,115, 42, 34, 41, 10, 9, 9, 9, 9, 105,102, 32,110,111,116, 32, 98, 32,116,104,101,110, 10, 9, 9, 9, 9, 9, 98, 44,101, 44,110, 97,109,101, 44, 98, 97, 115,101, 44, 98,111,100,121, 32, 61, 32,115,116,114,102,105, 110,100, 40,115, 44, 34, 94, 37,115, 42,115,116,114,117, 99, 116, 37,115, 43, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 64, 93, 42, 41, 37,115, 42, 40, 91, 94,123, 93, 45, 41, 37,115, 42, 40, 37, 98,123,125, 41, 37,115, 42, 34, 41, 10, 9, 9, 9, 9, 9,105,102, 32,110,111,116, 32, 98, 32,116,104,101, 110, 10, 9, 9, 9, 9, 9, 9, 98, 44,101, 44,110, 97,109, 101, 44, 98, 97,115,101, 44, 98,111,100,121, 32, 61, 32,115, 116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42,117, 110,105,111,110, 37,115, 42, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 64, 93, 42, 41, 37,115, 42, 40, 91, 94,123, 93, 45, 41, 37,115, 42, 40, 37, 98,123,125, 41, 37,115, 42, 34, 41, 10, 9, 9, 9, 9, 9, 9,105,102, 32,110,111,116, 32, 98, 32,116,104,101,110, 10, 9, 9, 9, 9, 9, 9, 9, 98, 97, 115,101, 32, 61, 32, 39, 39, 10, 9, 9, 9, 9, 9, 9, 9, 98, 44,101, 44, 98,111,100,121, 44,110, 97,109,101, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42,116,121,112,101,100,101,102, 37,115, 37,115, 42,115,116, 114,117, 99,116, 37,115, 37,115, 42, 91, 95, 37,119, 93, 42, 37,115, 42, 40, 37, 98,123,125, 41, 37,115, 42, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 64, 93, 42, 41, 37,115, 42, 59, 34, 41, 10, 9, 9, 9, 9, 9, 9,101,110,100, 10, 9, 9, 9, 9, 9,101,110,100, 10, 9, 9, 9, 9,101,110,100, 10, 9, 9, 9,101,108,115,101, 32,100,117,109,109,121, 32, 61, 32, 49, 32,101,110,100, 10, 9, 9,101,108,115,101, 32,100, 117,109,109,121, 32, 61, 32, 49, 32,101,110,100, 10, 9, 9, 105,102, 32, 98, 32,116,104,101,110, 10, 9, 9, 9,105,102, 32, 98, 97,115,101, 32,126, 61, 32, 39, 39, 32,116,104,101, 110, 10, 9, 9, 9, 9, 98, 97,115,101, 32, 61, 32,115,116, 114,105,110,103, 46,103,115,117, 98, 40, 98, 97,115,101, 44, 32, 34, 94, 37,115, 42, 58, 37,115, 42, 34, 44, 32, 34, 34, 41, 10, 9, 9, 9, 9, 98, 97,115,101, 32, 61, 32,115,116, 114,105,110,103, 46,103,115,117, 98, 40, 98, 97,115,101, 44, 32, 34, 37,115, 42,112,117, 98,108,105, 99, 37,115, 42, 34, 44, 32, 34, 34, 41, 10, 9, 9, 9, 9, 98, 97,115,101, 32, 61, 32,115,112,108,105,116, 40, 98, 97,115,101, 44, 32, 34, 44, 34, 41, 10, 9, 9, 9, 9, 45, 45,108,111, 99, 97,108, 32, 98, 44,101, 10, 9, 9, 9, 9, 45, 45, 98, 44,101, 44, 98, 97,115,101, 32, 61, 32,115,116,114,102,105,110,100, 40, 98, 97,115,101, 44, 34, 46, 45, 40, 91, 95, 37,119, 93, 91, 95, 37,119, 60, 62, 44, 58, 93, 42, 41, 36, 34, 41, 10, 9, 9, 9,101,108,115,101, 10, 9, 9, 9, 9, 98, 97,115,101, 32, 61, 32,123,125, 10, 9, 9, 9,101,110,100, 10, 9, 9, 9, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32,115, 116,114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 9, 9, 9, 67,108, 97,115,115, 40,110, 97,109,101, 44, 98, 97,115, 101, 44, 98,111,100,121, 41, 10, 9, 9, 9,105,102, 32,110, 111,116, 32,100,117,109,109,121, 32,116,104,101,110, 10, 9, 9, 9, 9,118, 97,114, 98, 44,118, 97,114,101, 44,118, 97, 114,110, 97,109,101, 32, 61, 32,115,116,114,105,110,103, 46, 102,105,110,100, 40,115, 44, 32, 34, 94, 37,115, 42, 40, 91, 95, 37,119, 93, 43, 41, 37,115, 42, 59, 34, 44, 32,101, 43, 49, 41, 10, 9, 9, 9, 9,105,102, 32,118, 97,114, 98, 32, 116,104,101,110, 10, 9, 9, 9, 9, 9, 86, 97,114,105, 97, 98,108,101, 40,110, 97,109,101, 46, 46, 34, 32, 34, 46, 46, 118, 97,114,110, 97,109,101, 41, 10, 9, 9, 9, 9, 9,101, 32, 61, 32,118, 97,114,101, 10, 9, 9, 9, 9,101,110,100, 10, 9, 9, 9,101,110,100, 10, 9, 9, 9,114,101,116,117, 114,110, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32,116,121,112,101,100,101,102, 10, 32,100,111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44,116,121,112,101,115, 32, 61, 32,115,116,114,102,105,110, 100, 40,115, 44, 34, 94, 37,115, 42,116,121,112,101,100,101, 102, 37,115, 37,115, 42, 40, 46, 45, 41, 37,115, 42, 59, 37, 115, 42, 34, 41, 10, 32, 32,105,102, 32, 98, 32,116,104,101, 110, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32,115,116,114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 32, 32, 32, 84,121,112,101,100,101,102, 40,116,121, 112,101,115, 41, 10, 32, 32, 32,114,101,116,117,114,110, 32, 115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 116,114,121, 32,118, 97,114,105, 97, 98,108,101, 10, 32,100, 111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44,100, 101, 99,108, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 91, 95, 37,119, 93, 91, 95, 64, 37,115, 37,119, 37,100, 37, 42, 38, 58, 60, 62, 44, 93, 42, 91, 95, 37,119, 37,100, 93, 41, 37,115, 42, 59, 37,115, 42, 34, 41, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32,115,116,114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 10, 9,108,111, 99, 97,108, 32,108,105,115,116, 32, 61, 32, 115,112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40, 100,101, 99,108, 44, 32, 34, 44, 34, 41, 10, 9, 86, 97,114, 105, 97, 98,108,101, 40,108,105,115,116, 91, 49, 93, 41, 10, 9,105,102, 32,108,105,115,116, 46,110, 32, 62, 32, 49, 32, 116,104,101,110, 10, 9, 9,108,111, 99, 97,108, 32, 95, 44, 95, 44,116,121,112,101, 32, 61, 32,115,116,114,102,105,110, 100, 40,108,105,115,116, 91, 49, 93, 44, 32, 34, 40, 46, 45, 41, 37,115, 43, 40, 91, 94, 37,115, 93, 42, 41, 36, 34, 41, 59, 10, 10, 9, 9,108,111, 99, 97,108, 32,105, 32, 61, 50, 59, 10, 9, 9,119,104,105,108,101, 32,108,105,115,116, 91, 105, 93, 32,100,111, 10, 9, 9, 9, 86, 97,114,105, 97, 98, 108,101, 40,116,121,112,101, 46, 46, 34, 32, 34, 46, 46,108, 105,115,116, 91,105, 93, 41, 10, 9, 9, 9,105, 61,105, 43, 49, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10, 32, 32, 32, 45, 45, 86, 97,114,105, 97, 98,108,101, 40,100,101, 99, 108, 41, 10, 32, 32, 32,114,101,116,117,114,110, 32,115,116, 114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101, 110,100, 10, 32,101,110,100, 10, 10, 9, 45, 45, 32,116,114, 121, 32,115,116,114,105,110,103, 10, 32,100,111, 10, 32, 32, 108,111, 99, 97,108, 32, 98, 44,101, 44,100,101, 99,108, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37, 115, 42, 40, 91, 95, 37,119, 93, 63, 91, 95, 37,115, 37,119, 37,100, 93, 45, 99,104, 97,114, 37,115, 43, 91, 95, 64, 37, 119, 37,100, 93, 42, 37,115, 42, 37, 91, 37,115, 42, 37, 83, 43, 37,115, 42, 37, 93, 41, 37,115, 42, 59, 37,115, 42, 34, 41, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 95, 99,117,114,114, 95, 99,111,100,101, 32, 61, 32, 115,116,114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 32, 32, 32, 86, 97,114,105, 97, 98,108,101, 40,100,101, 99,108, 41, 10, 32, 32, 32,114,101,116,117,114,110, 32,115,116,114, 115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101,110, 100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,116,114,121, 32, 97,114,114, 97,121, 10, 32,100,111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44,100,101, 99,108, 32, 61, 32, 115,116,114,102,105,110,100, 40,115, 44, 34, 94, 37,115, 42, 40, 91, 95, 37,119, 93, 91, 93, 91, 95, 64, 37,115, 37,119, 37,100, 37, 42, 38, 58, 93, 42, 91, 93, 95, 37,119, 37,100, 93, 41, 37,115, 42, 59, 37,115, 42, 34, 41, 10, 32, 32,105, 102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 95, 99,117, 114,114, 95, 99,111,100,101, 32, 61, 32,115,116,114,115,117, 98, 40,115, 44, 98, 44,101, 41, 10, 32, 32, 32, 65,114,114, 97,121, 40,100,101, 99,108, 41, 10, 32, 32, 32,114,101,116, 117,114,110, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,110,111, 32,109, 97,116, 99,104,105,110,103, 10, 32,105,102, 32,103,115,117, 98, 40,115, 44, 34, 37,115, 37,115, 42, 34, 44, 34, 34, 41, 32,126, 61, 32, 34, 34, 32, 116,104,101,110, 10, 32, 32, 95, 99,117,114,114, 95, 99,111, 100,101, 32, 61, 32,115, 10, 32, 32,101,114,114,111,114, 40, 34, 35,112, 97,114,115,101, 32,101,114,114,111,114, 34, 41, 10, 32,101,108,115,101, 10, 32, 32,114,101,116,117,114,110, 32, 34, 34, 10, 32,101,110,100, 10, 10,101,110,100, 10, 10, 102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67, 111,110,116, 97,105,110,101,114, 58,112, 97,114,115,101, 32, 40,115, 41, 10, 10, 9, 45, 45,115,101,108,102, 46, 99,117, 114,114, 95,109,101,109, 98,101,114, 95, 97, 99, 99,101,115, 115, 32, 61, 32,110,105,108, 10, 10, 32,119,104,105,108,101, 32,115, 32,126, 61, 32, 39, 39, 32,100,111, 10, 32, 32,115, 32, 61, 32,115,101,108,102, 58,100,111,112, 97,114,115,101, 40,115, 41, 10, 32, 32,109,101,116,104,111,100,105,115,118, 105,114,116,117, 97,108, 32, 61, 32,102, 97,108,115,101, 10, 32,101,110,100, 10,101,110,100, 10, 10, 10, 45, 45, 32,112, 114,111,112,101,114,116,121, 32,116,121,112,101,115, 10, 10, 102,117,110, 99,116,105,111,110, 32,103,101,116, 95,112,114, 111,112,101,114,116,121, 95,116,121,112,101, 40, 41, 10, 10, 9,114,101,116,117,114,110, 32, 99,108, 97,115,115, 67,111, 110,116, 97,105,110,101,114, 46, 99,117,114,114, 58,103,101, 116, 95,112,114,111,112,101,114,116,121, 95,116,121,112,101, 40, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101, 114, 58,115,101,116, 95,112,114,111,112,101,114,116,121, 95, 116,121,112,101, 40,112,116,121,112,101, 41, 10, 9,112,116, 121,112,101, 32, 61, 32,115,116,114,105,110,103, 46,103,115, 117, 98, 40,112,116,121,112,101, 44, 32, 34, 94, 37,115, 42, 34, 44, 32, 34, 34, 41, 10, 9,112,116,121,112,101, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,112,116, 121,112,101, 44, 32, 34, 37,115, 42, 36, 34, 44, 32, 34, 34, 41, 10, 10, 9,115,101,108,102, 46,112,114,111,112,101,114, 116,121, 95,116,121,112,101, 32, 61, 32,112,116,121,112,101, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101,114, 58, 103,101,116, 95,112,114,111,112,101,114,116,121, 95,116,121, 112,101, 40, 41, 10, 9,114,101,116,117,114,110, 32,115,101, 108,102, 46,112,114,111,112,101,114,116,121, 95,116,121,112, 101, 32,111,114, 32, 40,115,101,108,102, 46,112, 97,114,101, 110,116, 32, 97,110,100, 32,115,101,108,102, 46,112, 97,114, 101,110,116, 58,103,101,116, 95,112,114,111,112,101,114,116, 121, 95,116,121,112,101, 40, 41, 41, 32,111,114, 32, 34,100, 101,102, 97,117,108,116, 34, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/container.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,112, 97, 99,107, 97, 103,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114,105, 116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97, 114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71, 114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111, 100,101, 32,105,115, 32,102,114,101,101, 32,115,111,102,116, 119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114, 101,100,105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32,105, 116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116,119, 97,114,101, 32,112,114,111,118,105,100,101,100, 32,104,101, 114,101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97, 110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97,117, 116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108, 105,103, 97,116,105,111,110, 32,116,111, 32,112,114,111,118, 105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97, 116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101, 109,101,110,116,115, 44, 32,111,114, 32,109,111,100,105,102, 105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 10, 45, 45, 32, 80, 97, 99,107, 97,103,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101,115,101,110,116,115, 32,116, 104,101, 32,119,104,111,108,101, 32,112, 97, 99,107, 97,103, 101, 32, 98,101,105,110,103, 32, 98,111,117,110,100, 46, 10, 45, 45, 32, 84,104,101, 32,102,111,108,108,111,119,105,110, 103, 32,102,105,101,108,100,115, 32, 97,114,101, 32,115,116, 111,114,101,100, 58, 10, 45, 45, 32, 32, 32, 32,123,105,125, 32, 61, 32,108,105,115,116, 32,111,102, 32,111, 98,106,101, 99,116,115, 32,105,110, 32,116,104,101, 32,112, 97, 99,107, 97,103,101, 46, 10, 99,108, 97,115,115, 80, 97, 99,107, 97, 103,101, 32, 61, 32,123, 10, 32, 99,108, 97,115,115,116,121, 112,101, 32, 61, 32, 39,112, 97, 99,107, 97,103,101, 39, 10, 125, 10, 99,108, 97,115,115, 80, 97, 99,107, 97,103,101, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97,115,115, 80, 97, 99,107, 97,103,101, 10,115,101,116,109,101,116, 97, 116, 97, 98,108,101, 40, 99,108, 97,115,115, 80, 97, 99,107, 97,103,101, 44, 99,108, 97,115,115, 67,111,110,116, 97,105, 110,101,114, 41, 10, 10, 45, 45, 32, 80,114,105,110,116, 32, 109,101,116,104,111,100, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 80, 97, 99,107, 97,103,101, 58,112, 114,105,110,116, 32, 40, 41, 10, 32,112,114,105,110,116, 40, 34, 80, 97, 99,107, 97,103,101, 58, 32, 34, 46, 46,115,101, 108,102, 46,110, 97,109,101, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108,101, 32,115,101,108, 102, 91,105, 93, 32,100,111, 10, 32, 32,115,101,108,102, 91, 105, 93, 58,112,114,105,110,116, 40, 34, 34, 44, 34, 34, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 80, 97, 99,107, 97,103,101, 58,112,114, 101,112,114,111, 99,101,115,115, 32, 40, 41, 10, 10, 32, 45, 45, 32, 97,118,111,105,100, 32,112,114,101,112,114,111, 99, 101,115,115,105,110,103, 32,101,109, 98,101,100,100,101,100, 32, 76,117, 97, 32, 99,111,100,101, 10, 32,108,111, 99, 97, 108, 32, 76, 32, 61, 32,123,125, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108, 102, 46, 99,111,100,101, 44, 34, 92,110, 37,115, 42, 37, 36, 37, 91, 34, 44, 34, 92, 49, 34, 41, 32, 45, 45, 32,100,101, 97,108, 32,119,105,116,104, 32,101,109, 98,101,100,100,101, 100, 32,108,117, 97, 32, 99,111,100,101, 10, 32,115,101,108, 102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115, 101,108,102, 46, 99,111,100,101, 44, 34, 92,110, 37,115, 42, 37, 36, 37, 93, 34, 44, 34, 92, 50, 34, 41, 10, 32,115,101, 108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40, 115,101,108,102, 46, 99,111,100,101, 44, 34, 40, 37, 98, 92, 49, 92, 50, 41, 34, 44, 32, 32, 32, 32, 32, 32, 32,102,117, 110, 99,116,105,111,110, 32, 40, 99, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,116,105, 110,115,101,114,116, 40, 76, 44, 99, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101, 116,117,114,110, 32, 34, 92,110, 35, 91, 34, 46, 46,103,101, 116,110, 40, 76, 41, 46, 46, 34, 93, 35, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110, 100, 41, 10, 32, 45, 45, 32, 97,118,111,105,100, 32,112,114, 101,112,114,111, 99,101,115,115,105,110,103, 32,101,109, 98, 101,100,100,101,100, 32, 67, 32, 99,111,100,101, 10, 32,108, 111, 99, 97,108, 32, 67, 32, 61, 32,123,125, 10, 32,115,101, 108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40, 115,101,108,102, 46, 99,111,100,101, 44, 34, 92,110, 37,115, 42, 37, 36, 37, 60, 34, 44, 34, 92, 51, 34, 41, 32, 45, 45, 32,100,101, 97,108, 32,119,105,116,104, 32,101,109, 98,101, 100,100,101,100, 32, 67, 32, 99,111,100,101, 10, 32,115,101, 108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40, 115,101,108,102, 46, 99,111,100,101, 44, 34, 92,110, 37,115, 42, 37, 36, 37, 62, 34, 44, 34, 92, 52, 34, 41, 10, 32,115, 101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 40, 37, 98, 92, 51, 92, 52, 41, 34, 44, 32, 32, 32, 32, 32, 32, 32,102, 117,110, 99,116,105,111,110, 32, 40, 99, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,116, 105,110,115,101,114,116, 40, 67, 44, 99, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114, 101,116,117,114,110, 32, 34, 92,110, 35, 60, 34, 46, 46,103, 101,116,110, 40, 67, 41, 46, 46, 34, 62, 35, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101, 110,100, 41, 10, 32, 45, 45, 32, 97,118,111,105,100, 32,112, 114,101,112,114,111, 99,101,115,115,105,110,103, 32,101,109, 98,101,100,100,101,100, 32, 67, 32, 99,111,100,101, 10, 32, 115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 92,110, 37,115, 42, 37, 36, 37,123, 34, 44, 34, 92, 53, 34, 41, 32, 45, 45, 32,100,101, 97,108, 32,119,105,116,104, 32,101,109, 98,101,100,100,101,100, 32, 67, 32, 99,111,100,101, 10, 32, 115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 92,110, 37,115, 42, 37, 36, 37,125, 34, 44, 34, 92, 54, 34, 41, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115, 117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 40, 37, 98, 92, 53, 92, 54, 41, 34, 44, 32, 32, 32, 32, 32, 32, 32,102,117,110, 99,116,105,111,110, 32, 40, 99, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,116,105,110,115,101,114,116, 40, 67, 44, 99, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, 34, 92,110, 35, 60, 34, 46, 46,103,101,116,110, 40, 67, 41, 46, 46, 34, 62, 35, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 41, 10, 10, 32, 45, 45,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108, 102, 46, 99,111,100,101, 44, 34, 92,110, 37,115, 42, 35, 91, 94,100, 93, 91, 94, 92,110, 93, 42, 92,110, 34, 44, 32, 34, 92,110, 92,110, 34, 41, 32, 45, 45, 32,101,108,105,109,105, 110, 97,116,101, 32,112,114,101,112,114,111, 99,101,115,115, 111,114, 32,100,105,114,101, 99,116,105,118,101,115, 32,116, 104, 97,116, 32,100,111,110, 39,116, 32,115,116, 97,114,116, 32,119,105,116,104, 32, 39,100, 39, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101, 108,102, 46, 99,111,100,101, 44, 34, 92,110, 91, 32, 92,116, 93, 42, 35, 91, 32, 92,116, 93, 42, 91, 94,100, 37, 60, 37, 91, 93, 34, 44, 32, 34, 92,110, 47, 47, 34, 41, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101, 32,112,114,101,112, 114,111, 99,101,115,115,111,114, 32,100,105,114,101, 99,116, 105,118,101,115, 32,116,104, 97,116, 32,100,111,110, 39,116, 32,115,116, 97,114,116, 32,119,105,116,104, 32, 39,100, 39, 10, 10, 32, 45, 45, 32, 97,118,111,105,100, 32,112,114,101, 112,114,111, 99,101,115,115,105,110,103, 32,118,101,114, 98, 97,116,105,109, 32,108,105,110,101,115, 10, 32,108,111, 99, 97,108, 32, 86, 32, 61, 32,123,125, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101, 108,102, 46, 99,111,100,101, 44, 34, 92,110, 40, 37,115, 42, 37, 36, 91, 94, 37, 91, 37, 93, 93, 91, 94, 92,110, 93, 42, 41, 34, 44,102,117,110, 99,116,105,111,110, 32, 40,118, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,116,105,110,115,101,114,116, 40, 86, 44,118, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, 34, 92,110, 35, 34, 46, 46,103,101,116,110, 40, 86, 41, 46, 46, 34, 35, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 41, 10, 10, 32, 45, 45, 32,112,101,114,102, 111,114,109, 32,103,108,111, 98, 97,108, 32,115,117, 98,115, 116,105,116,117,116,105,111,110, 10, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101, 108,102, 46, 99,111,100,101, 44, 34, 40, 47, 47, 91, 94, 92, 110, 93, 42, 41, 34, 44, 34, 34, 41, 32, 32, 32, 32, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101, 32, 67, 43, 43, 32, 99,111,109,109,101,110,116,115, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101, 108,102, 46, 99,111,100,101, 44, 34, 47, 37, 42, 34, 44, 34, 92, 49, 34, 41, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111, 100,101, 44, 34, 37, 42, 47, 34, 44, 34, 92, 50, 34, 41, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115, 117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 37, 98, 92, 49, 92, 50, 34, 44, 34, 34, 41, 10, 32,115,101,108, 102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115, 101,108,102, 46, 99,111,100,101, 44, 34, 92, 49, 34, 44, 34, 47, 37, 42, 34, 41, 10, 32,115,101,108,102, 46, 99,111,100, 101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99, 111,100,101, 44, 34, 92, 50, 34, 44, 34, 37, 42, 47, 34, 41, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103, 115,117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 37,115, 42, 64, 37,115, 42, 34, 44, 34, 64, 34, 41, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101, 32,115,112, 97, 99,101,115, 32, 98,101,115,105,100,101, 32, 64, 10, 32,115, 101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 37,115, 63, 105,110,108,105,110,101, 40, 37,115, 41, 34, 44, 34, 37, 49, 34, 41, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101, 32, 39,105,110,108,105,110,101, 39, 32,107,101,121,119,111, 114,100, 10, 32, 45, 45,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111, 100,101, 44, 34, 37,115, 63,101,120,116,101,114,110, 40, 37, 115, 41, 34, 44, 34, 37, 49, 34, 41, 32, 45, 45, 32,101,108, 105,109,105,110, 97,116,101, 32, 39,101,120,116,101,114,110, 39, 32,107,101,121,119,111,114,100, 10, 32, 45, 45,115,101, 108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40, 115,101,108,102, 46, 99,111,100,101, 44, 34, 37,115, 63,118, 105,114,116,117, 97,108, 40, 37,115, 41, 34, 44, 34, 37, 49, 34, 41, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101, 32, 39,118,105,114,116,117, 97,108, 39, 32,107,101,121,119, 111,114,100, 10, 32, 45, 45,115,101,108,102, 46, 99,111,100, 101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99, 111,100,101, 44, 34,112,117, 98,108,105, 99, 58, 34, 44, 34, 34, 41, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101, 32, 39,112,117, 98,108,105, 99, 58, 39, 32,107,101,121,119, 111,114,100, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111,100, 101, 44, 34, 40, 91, 94, 37,119, 95, 93, 41,118,111,105,100, 37,115, 42, 37, 42, 34, 44, 34, 37, 49, 95,117,115,101,114, 100, 97,116, 97, 32, 34, 41, 32, 45, 45, 32,115,117, 98,115, 116,105,116,117,116,101, 32, 39,118,111,105,100, 42, 39, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115, 117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 40, 91, 94, 37,119, 95, 93, 41,118,111,105,100, 37,115, 42, 37, 42, 34, 44, 34, 37, 49, 95,117,115,101,114,100, 97,116, 97, 32, 34, 41, 32, 45, 45, 32,115,117, 98,115,116,105,116,117, 116,101, 32, 39,118,111,105,100, 42, 39, 10, 32,115,101,108, 102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115, 101,108,102, 46, 99,111,100,101, 44, 34, 40, 91, 94, 37,119, 95, 93, 41, 99,104, 97,114, 37,115, 42, 37, 42, 34, 44, 34, 37, 49, 95, 99,115,116,114,105,110,103, 32, 34, 41, 32, 32, 45, 45, 32,115,117, 98,115,116,105,116,117,116,101, 32, 39, 99,104, 97,114, 42, 39, 10, 32,115,101,108,102, 46, 99,111, 100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 40, 91, 94, 37,119, 95, 93, 41,108, 117, 97, 95, 83,116, 97,116,101, 37,115, 42, 37, 42, 34, 44, 34, 37, 49, 95,108,115,116, 97,116,101, 32, 34, 41, 32, 32, 45, 45, 32,115,117, 98,115,116,105,116,117,116,101, 32, 39, 108,117, 97, 95, 83,116, 97,116,101, 42, 39, 10, 10, 32, 45, 45, 32,114,101,115,116,111,114,101, 32,101,109, 98,101,100, 100,101,100, 32, 76,117, 97, 32, 99,111,100,101, 10, 32,115, 101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 34, 37, 35, 37, 91, 40, 37,100, 43, 41, 37, 93, 37, 35, 34, 44,102,117,110, 99,116,105,111,110, 32, 40,110, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117, 114,110, 32, 76, 91,116,111,110,117,109, 98,101,114, 40,110, 41, 93, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 41, 10, 32, 45, 45, 32,114,101,115,116, 111,114,101, 32,101,109, 98,101,100,100,101,100, 32, 67, 32, 99,111,100,101, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46, 99,111, 100,101, 44, 34, 37, 35, 37, 60, 40, 37,100, 43, 41, 37, 62, 37, 35, 34, 44,102,117,110, 99,116,105,111,110, 32, 40,110, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, 67, 91,116,111,110,117, 109, 98,101,114, 40,110, 41, 93, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 41, 10, 32, 45, 45, 32,114,101,115,116,111,114,101, 32,118,101,114, 98, 97, 116,105,109, 32,108,105,110,101,115, 10, 32,115,101,108,102, 46, 99,111,100,101, 32, 61, 32,103,115,117, 98, 40,115,101, 108,102, 46, 99,111,100,101, 44, 34, 37, 35, 40, 37,100, 43, 41, 37, 35, 34, 44,102,117,110, 99,116,105,111,110, 32, 40, 110, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114, 101,116,117,114,110, 32, 86, 91,116,111,110,117,109, 98,101, 114, 40,110, 41, 93, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 41, 10, 10, 32,115,101,108,102, 46, 99,111, 100,101, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,115,101,108,102, 46, 99,111,100,101, 44, 32, 34, 92, 110, 37,115, 42, 37, 36, 40, 91, 94, 92,110, 93, 43, 41, 34, 44, 32,102,117,110, 99,116,105,111,110, 32, 40,108, 41, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 86,101,114, 98, 97,116,105,109, 40,108, 46, 46, 34, 92,110, 34, 41, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,114,101,116,117,114, 110, 32, 34, 92,110, 34, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 32, 32,101,110,100, 41, 10,101,110,100, 10, 10, 45, 45, 32,116,114, 97,110,115,108, 97,116,101, 32,118,101,114, 98, 97,116,105,109, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 80, 97, 99,107, 97,103,101, 58,112,114, 101, 97,109, 98,108,101, 32, 40, 41, 10, 32,111,117,116,112, 117,116, 40, 39, 47, 42, 92,110, 39, 41, 10, 32,111,117,116, 112,117,116, 40, 39, 42, 42, 32, 76,117, 97, 32, 98,105,110, 100,105,110,103, 58, 32, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 92,110, 39, 41, 10, 32,111,117,116, 112,117,116, 40, 39, 42, 42, 32, 71,101,110,101,114, 97,116, 101,100, 32, 97,117,116,111,109, 97,116,105, 99, 97,108,108, 121, 32, 98,121, 32, 39, 46, 46, 84, 79, 76, 85, 65, 95, 86, 69, 82, 83, 73, 79, 78, 46, 46, 39, 32,111,110, 32, 39, 46, 46,100, 97,116,101, 40, 41, 46, 46, 39, 46, 92,110, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 42, 47, 92,110, 92, 110, 39, 41, 10, 10, 9,111,117,116,112,117,116, 40, 39, 35, 105,102,110,100,101,102, 32, 95, 95, 99,112,108,117,115,112, 108,117,115, 92,110, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 35,105,110, 99,108,117,100,101, 32, 34,115,116,100, 108,105, 98, 46,104, 34, 92,110, 39, 41, 10, 9,111,117,116, 112,117,116, 40, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 35,105,110, 99,108, 117,100,101, 32, 34,115,116,114,105,110,103, 46,104, 34, 92, 110, 92,110, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 35,105,110, 99,108,117,100,101, 32, 34,116,111,108,117, 97, 43, 43, 46,104, 34, 92,110, 92,110, 39, 41, 10, 10, 32,105, 102, 32,110,111,116, 32,102,108, 97,103,115, 46,104, 32,116, 104,101,110, 10, 32, 32,111,117,116,112,117,116, 40, 39, 47, 42, 32, 69,120,112,111,114,116,101,100, 32,102,117,110, 99, 116,105,111,110, 32, 42, 47, 39, 41, 10, 32, 32,111,117,116, 112,117,116, 40, 39, 84, 79, 76, 85, 65, 95, 65, 80, 73, 32, 105,110,116, 32, 32,116,111,108,117, 97, 95, 39, 46, 46,115, 101,108,102, 46,110, 97,109,101, 46, 46, 39, 95,111,112,101, 110, 32, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32,116, 111,108,117, 97, 95, 83, 41, 59, 39, 41, 10, 32, 32,111,117, 116,112,117,116, 40, 39, 92,110, 39, 41, 10, 32,101,110,100, 10, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119, 104,105,108,101, 32,115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32,115,101,108,102, 91,105, 93, 58,112,114,101, 97, 109, 98,108,101, 40, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 10, 9,105,102, 32,115,101,108, 102, 58,114,101,113,117,105,114,101, 99,111,108,108,101, 99, 116,105,111,110, 40, 95, 99,111,108,108,101, 99,116, 41, 32, 116,104,101,110, 10, 9, 9,111,117,116,112,117,116, 40, 39, 92,110, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39, 47, 42, 32,102,117,110, 99,116,105,111,110, 32,116,111, 32, 114,101,108,101, 97,115,101, 32, 99,111,108,108,101, 99,116, 101,100, 32,111, 98,106,101, 99,116, 32,118,105, 97, 32,100, 101,115,116,114,117, 99,116,111,114, 32, 42, 47, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39, 35,105,102,100,101, 102, 32, 95, 95, 99,112,108,117,115,112,108,117,115, 92,110, 39, 41, 10, 9, 9,102,111,114, 32,105, 44,118, 32,105,110, 32,112, 97,105,114,115, 40, 95, 99,111,108,108,101, 99,116, 41, 32,100,111, 10, 9, 9, 32,111,117,116,112,117,116, 40, 39, 92,110,115,116, 97,116,105, 99, 32,105,110,116, 32, 39, 46, 46,118, 46, 46, 39, 32, 40,108,117, 97, 95, 83,116, 97, 116,101, 42, 32,116,111,108,117, 97, 95, 83, 41, 39, 41, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39,123, 39, 41, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 39, 46, 46, 105, 46, 46, 39, 42, 32,115,101,108,102, 32, 61, 32, 40, 39, 46, 46,105, 46, 46, 39, 42, 41, 32,116,111,108,117, 97, 95, 116,111,117,115,101,114,116,121,112,101, 40,116,111,108,117, 97, 95, 83, 44, 49, 44, 48, 41, 59, 39, 41, 10, 9, 9, 9, 111,117,116,112,117,116, 40, 39, 9, 77,116,111,108,117, 97, 95,100,101,108,101,116,101, 40,115,101,108,102, 41, 59, 39, 41, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 9,114, 101,116,117,114,110, 32, 48, 59, 39, 41, 10, 9, 9, 9,111, 117,116,112,117,116, 40, 39,125, 39, 41, 10, 9, 9,101,110, 100, 10, 9, 9,111,117,116,112,117,116, 40, 39, 35,101,110, 100,105,102, 92,110, 92,110, 39, 41, 10, 9,101,110,100, 10, 10, 32,111,117,116,112,117,116, 40, 39, 92,110, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 47, 42, 32,102,117,110, 99,116,105,111,110, 32,116,111, 32,114,101,103,105,115,116, 101,114, 32,116,121,112,101, 32, 42, 47, 39, 41, 10, 32,111, 117,116,112,117,116, 40, 39,115,116, 97,116,105, 99, 32,118, 111,105,100, 32,116,111,108,117, 97, 95,114,101,103, 95,116, 121,112,101,115, 32, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32,116,111,108,117, 97, 95, 83, 41, 39, 41, 10, 32,111, 117,116,112,117,116, 40, 39,123, 39, 41, 10, 10, 9,105,102, 32,102,108, 97,103,115, 46,116, 32,116,104,101,110, 10, 9, 9,111,117,116,112,117,116, 40, 34, 35,105,102,110,100,101, 102, 32, 77,116,111,108,117, 97, 95,116,121,112,101,105,100, 92,110, 35,100,101,102,105,110,101, 32, 77,116,111,108,117, 97, 95,116,121,112,101,105,100, 40, 76, 44, 84, 73, 44, 84, 41, 92,110, 35,101,110,100,105,102, 92,110, 34, 41, 10, 9, 101,110,100, 10, 9,102,111,114,101, 97, 99,104, 40, 95,117, 115,101,114,116,121,112,101, 44,102,117,110, 99,116,105,111, 110, 40,110, 44,118, 41, 10, 9, 9,105,102, 32, 40,110,111, 116, 32, 95,103,108,111, 98, 97,108, 95, 99,108, 97,115,115, 101,115, 91,118, 93, 41, 32,111,114, 32, 95,103,108,111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91,118, 93, 58, 99, 104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99, 101,115,115, 40, 41, 32,116,104,101,110, 10, 9, 9, 9,111, 117,116,112,117,116, 40, 39, 32,116,111,108,117, 97, 95,117, 115,101,114,116,121,112,101, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 44,118, 44, 39, 34, 41, 59, 39, 41, 10, 9, 9, 9,105,102, 32,102,108, 97,103,115, 46,116, 32,116,104,101, 110, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 77,116,111,108,117, 97, 95,116,121,112,101,105,100, 40,116, 111,108,117, 97, 95, 83, 44,116,121,112,101,105,100, 40, 39, 44,118, 44, 39, 41, 44, 32, 34, 39, 44,118, 44, 39, 34, 41, 59, 39, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9,101,110, 100, 10, 9, 32,101,110,100, 41, 10, 32,111,117,116,112,117, 116, 40, 39,125, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 92,110, 39, 41, 10,101,110,100, 10, 10, 45, 45, 32,114, 101,103,105,115,116,101,114, 32,112, 97, 99,107, 97,103,101, 10, 45, 45, 32,119,114,105,116,101, 32,112, 97, 99,107, 97, 103,101, 32,111,112,101,110, 32,102,117,110, 99,116,105,111, 110, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115, 115, 80, 97, 99,107, 97,103,101, 58,114,101,103,105,115,116, 101,114, 32, 40,112,114,101, 41, 10, 32,112,114,101, 32, 61, 32,112,114,101, 32,111,114, 32, 39, 39, 10, 32,112,117,115, 104, 40,115,101,108,102, 41, 10, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 34, 47, 42, 32, 79,112,101,110, 32, 102,117,110, 99,116,105,111,110, 32, 42, 47, 34, 41, 10, 32, 111,117,116,112,117,116, 40,112,114,101, 46, 46, 34, 84, 79, 76, 85, 65, 95, 65, 80, 73, 32,105,110,116, 32,116,111,108, 117, 97, 95, 34, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 34, 95,111,112,101,110, 32, 40,108,117, 97, 95, 83, 116, 97,116,101, 42, 32,116,111,108,117, 97, 95, 83, 41, 34, 41, 10, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 34,123, 34, 41, 10, 32,111,117,116,112,117,116, 40,112,114, 101, 46, 46, 34, 32,116,111,108,117, 97, 95,111,112,101,110, 40,116,111,108,117, 97, 95, 83, 41, 59, 34, 41, 10, 32,111, 117,116,112,117,116, 40,112,114,101, 46, 46, 34, 32,116,111, 108,117, 97, 95,114,101,103, 95,116,121,112,101,115, 40,116, 111,108,117, 97, 95, 83, 41, 59, 34, 41, 10, 32,111,117,116, 112,117,116, 40,112,114,101, 46, 46, 34, 32,116,111,108,117, 97, 95,109,111,100,117,108,101, 40,116,111,108,117, 97, 95, 83, 44, 78, 85, 76, 76, 44, 34, 44,115,101,108,102, 58,104, 97,115,118, 97,114, 40, 41, 44, 34, 41, 59, 34, 41, 10, 32, 111,117,116,112,117,116, 40,112,114,101, 46, 46, 34, 32,116, 111,108,117, 97, 95, 98,101,103,105,110,109,111,100,117,108, 101, 40,116,111,108,117, 97, 95, 83, 44, 78, 85, 76, 76, 41, 59, 34, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108,101, 32,115,101,108,102, 91,105, 93, 32, 100,111, 10, 32, 32,115,101,108,102, 91,105, 93, 58,114,101, 103,105,115,116,101,114, 40,112,114,101, 46, 46, 34, 32, 32, 34, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101, 110,100, 10, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 34, 32,116,111,108,117, 97, 95,101,110,100,109,111,100, 117,108,101, 40,116,111,108,117, 97, 95, 83, 41, 59, 34, 41, 10, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 34, 32,114,101,116,117,114,110, 32, 49, 59, 34, 41, 10, 32,111, 117,116,112,117,116, 40,112,114,101, 46, 46, 34,125, 34, 41, 10, 10, 32,111,117,116,112,117,116, 40, 34, 92,110, 92,110, 34, 41, 10, 32,111,117,116,112,117,116, 40, 34, 35,105,102, 32,100,101,102,105,110,101,100, 40, 76, 85, 65, 95, 86, 69, 82, 83, 73, 79, 78, 95, 78, 85, 77, 41, 32, 38, 38, 32, 76, 85, 65, 95, 86, 69, 82, 83, 73, 79, 78, 95, 78, 85, 77, 32, 62, 61, 32, 53, 48, 49, 92,110, 34, 41, 59, 10, 32,111,117, 116,112,117,116, 40,112,114,101, 46, 46, 34, 84, 79, 76, 85, 65, 95, 65, 80, 73, 32,105,110,116, 32,108,117, 97,111,112, 101,110, 95, 34, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 34, 32, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32,116,111,108,117, 97, 95, 83, 41, 32,123, 34, 41, 10, 32, 111,117,116,112,117,116, 40,112,114,101, 46, 46, 34, 32,114, 101,116,117,114,110, 32,116,111,108,117, 97, 95, 34, 46, 46, 115,101,108,102, 46,110, 97,109,101, 46, 46, 34, 95,111,112, 101,110, 40,116,111,108,117, 97, 95, 83, 41, 59, 34, 41, 10, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 34,125, 59, 34, 41, 10, 32,111,117,116,112,117,116, 40, 34, 35,101, 110,100,105,102, 92,110, 92,110, 34, 41, 10, 10, 9,112,111, 112, 40, 41, 10,101,110,100, 10, 10, 45, 45, 32,119,114,105, 116,101, 32,104,101, 97,100,101,114, 32,102,105,108,101, 10, 102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 80, 97, 99,107, 97,103,101, 58,104,101, 97,100,101,114, 32, 40, 41, 10, 32,111,117,116,112,117,116, 40, 39, 47, 42, 92,110, 39, 41, 32,111,117,116,112,117,116, 40, 39, 42, 42, 32, 76, 117, 97, 32, 98,105,110,100,105,110,103, 58, 32, 39, 46, 46, 115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 92,110, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 42, 42, 32, 71, 101,110,101,114, 97,116,101,100, 32, 97,117,116,111,109, 97, 116,105, 99, 97,108,108,121, 32, 98,121, 32, 39, 46, 46, 84, 79, 76, 85, 65, 95, 86, 69, 82, 83, 73, 79, 78, 46, 46, 39, 32,111,110, 32, 39, 46, 46,100, 97,116,101, 40, 41, 46, 46, 39, 46, 92,110, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 42, 47, 92,110, 92,110, 39, 41, 10, 10, 32,105,102, 32, 110,111,116, 32,102,108, 97,103,115, 46,104, 32,116,104,101, 110, 10, 32, 32,111,117,116,112,117,116, 40, 39, 47, 42, 32, 69,120,112,111,114,116,101,100, 32,102,117,110, 99,116,105, 111,110, 32, 42, 47, 39, 41, 10, 32, 32,111,117,116,112,117, 116, 40, 39, 84, 79, 76, 85, 65, 95, 65, 80, 73, 32,105,110, 116, 32, 32,116,111,108,117, 97, 95, 39, 46, 46,115,101,108, 102, 46,110, 97,109,101, 46, 46, 39, 95,111,112,101,110, 32, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32,116,111,108, 117, 97, 95, 83, 41, 59, 39, 41, 10, 32, 32,111,117,116,112, 117,116, 40, 39, 92,110, 39, 41, 10, 32,101,110,100, 10,101, 110,100, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99,111,110,115,116,114,117, 99,116,111,114, 10,102,117, 110, 99,116,105,111,110, 32, 95, 80, 97, 99,107, 97,103,101, 32, 40,115,101,108,102, 41, 10, 32,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40,115,101,108,102, 44, 99,108, 97, 115,115, 80, 97, 99,107, 97,103,101, 41, 10, 32,114,101,116, 117,114,110, 32,115,101,108,102, 10,101,110,100, 10, 10, 45, 45, 32, 80, 97,114,115,101, 32, 67, 32,104,101, 97,100,101, 114, 32,102,105,108,101, 32,119,105,116,104, 32,116,111,108, 117, 97, 32,100,105,114,101, 99,116,105,118,101,115, 10, 45, 45, 32, 42, 42, 42, 32, 84,104, 97,110,107,115, 32,116,111, 32, 65,114,105,101,108, 32, 77, 97,110,122,117,114, 32,102, 111,114, 32,102,105,120,105,110,103, 32, 98,117,103,115, 32, 105,110, 32,110,101,115,116,101,100, 32,100,105,114,101, 99, 116,105,118,101,115, 32, 42, 42, 42, 10,102,117,110, 99,116, 105,111,110, 32,101,120,116,114, 97, 99,116, 95, 99,111,100, 101, 40,102,110, 44,115, 41, 10, 9,108,111, 99, 97,108, 32, 99,111,100,101, 32, 61, 32, 39, 92,110, 36, 35,105,110, 99, 108,117,100,101, 32, 34, 39, 46, 46,102,110, 46, 46, 39, 34, 92,110, 39, 10, 9,115, 61, 32, 34, 92,110, 34, 32, 46, 46, 32,115, 32, 46, 46, 32, 34, 92,110, 34, 32, 45, 45, 32, 97, 100,100, 32, 98,108, 97,110,107, 32,108,105,110,101,115, 32, 97,115, 32,115,101,110,116,105,110,101,108,115, 10, 9,108, 111, 99, 97,108, 32, 95, 44,101, 44, 99, 44,116, 32, 61, 32, 115,116,114,102,105,110,100, 40,115, 44, 32, 34, 92,110, 40, 91, 94, 92,110, 93, 45, 41, 91, 84,116, 93, 91, 79,111, 93, 91, 76,108, 93, 91, 85,117, 93, 91, 65, 97, 93, 95, 40, 91, 94, 37,115, 93, 42, 41, 91, 94, 92,110, 93, 42, 92,110, 34, 41, 10, 9,119,104,105,108,101, 32,101, 32,100,111, 10, 9, 9,116, 32, 61, 32,115,116,114,108,111,119,101,114, 40,116, 41, 10, 9, 9,105,102, 32,116, 32, 61, 61, 32, 34, 98,101, 103,105,110, 34, 32,116,104,101,110, 10, 9, 9, 9, 95, 44, 101, 44, 99, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 34, 40, 46, 45, 41, 92,110, 91, 94, 92,110, 93, 42, 91, 84,116, 93, 91, 79,111, 93, 91, 76,108, 93, 91, 85,117, 93, 91, 65, 97, 93, 95, 91, 69,101, 93, 91, 78,110, 93, 91, 68, 100, 93, 91, 94, 92,110, 93, 42, 92,110, 34, 44,101, 41, 10, 9, 9, 9,105,102, 32,110,111,116, 32,101, 32,116,104,101, 110, 10, 9, 9, 9, 32,116,111,108,117, 97, 95,101,114,114, 111,114, 40, 34, 85,110, 98, 97,108, 97,110, 99,101,100, 32, 39,116,111,108,117, 97, 95, 98,101,103,105,110, 39, 32,100, 105,114,101, 99,116,105,118,101, 32,105,110, 32,104,101, 97, 100,101,114, 32,102,105,108,101, 34, 41, 10, 9, 9, 9,101, 110,100, 10, 9, 9,101,110,100, 10, 9, 9, 99,111,100,101, 32, 61, 32, 99,111,100,101, 32, 46, 46, 32, 99, 32, 46, 46, 32, 34, 92,110, 34, 10, 9, 32, 95, 44,101, 44, 99, 44,116, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 32, 34, 92,110, 40, 91, 94, 92,110, 93, 45, 41, 91, 84,116, 93, 91, 79,111, 93, 91, 76,108, 93, 91, 85,117, 93, 91, 65, 97, 93, 95, 40, 91, 94, 37,115, 93, 42, 41, 91, 94, 92,110, 93, 42, 92,110, 34, 44,101, 41, 10, 9,101,110,100, 10, 9,114,101, 116,117,114,110, 32, 99,111,100,101, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110,115,116,114,117, 99,116,111,114, 10, 45, 45, 32, 69,120,112,101, 99,116,115, 32,116,104,101, 32, 112, 97, 99,107, 97,103,101, 32,110, 97,109,101, 44, 32,116, 104,101, 32,102,105,108,101, 32,101,120,116,101,110,115,105, 111,110, 44, 32, 97,110,100, 32,116,104,101, 32,102,105,108, 101, 32,116,101,120,116, 46, 10,102,117,110, 99,116,105,111, 110, 32, 80, 97, 99,107, 97,103,101, 32, 40,110, 97,109,101, 44,102,110, 41, 10, 32,108,111, 99, 97,108, 32,101,120,116, 32, 61, 32, 34,112,107,103, 34, 10, 10, 32, 45, 45, 32,111, 112,101,110, 32,105,110,112,117,116, 32,102,105,108,101, 44, 32,105,102, 32, 97,110,121, 10, 32,108,111, 99, 97,108, 32, 115,116, 44,109,115,103, 10, 32,105,102, 32,102,110, 32,116, 104,101,110, 10, 32, 32,115,116, 44, 32,109,115,103, 32, 61, 32,114,101, 97,100,102,114,111,109, 40,102,108, 97,103,115, 46,102, 41, 10, 32, 32,105,102, 32,110,111,116, 32,115,116, 32,116,104,101,110, 10, 32, 32, 32,101,114,114,111,114, 40, 39, 35, 39, 46, 46,109,115,103, 41, 10, 32, 32,101,110,100, 10, 32, 32,108,111, 99, 97,108, 32, 95, 59, 32, 95, 44, 32, 95, 44, 32,101,120,116, 32, 61, 32,115,116,114,102,105,110, 100, 40,102,110, 44, 34, 46, 42, 37, 46, 40, 46, 42, 41, 36, 34, 41, 10, 32,101,110,100, 10, 32,108,111, 99, 97,108, 32, 99,111,100,101, 10, 32,105,102, 32,101,120,116, 32, 61, 61, 32, 39,112,107,103, 39, 32,116,104,101,110, 10, 32, 32, 99, 111,100,101, 32, 61, 32,112,114,101,112, 40,115,116, 41, 10, 32,101,108,115,101, 10, 32, 32, 99,111,100,101, 32, 61, 32, 34, 92,110, 34, 32, 46, 46, 32,114,101, 97,100, 40, 39, 42, 97, 39, 41, 10, 32, 32,105,102, 32,101,120,116, 32, 61, 61, 32, 39,104, 39, 32,111,114, 32,101,120,116, 32, 61, 61, 32, 39,104,112,112, 39, 32,116,104,101,110, 10, 32, 32, 32, 99, 111,100,101, 32, 61, 32,101,120,116,114, 97, 99,116, 95, 99, 111,100,101, 40,102,110, 44, 99,111,100,101, 41, 10, 32, 32, 101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 99, 108,111,115,101, 32,102,105,108,101, 10, 32,105,102, 32,102, 110, 32,116,104,101,110, 10, 32, 32,114,101, 97,100,102,114, 111,109, 40, 41, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 100,101, 97,108, 32,119,105,116,104, 32,105,110, 99,108,117, 100,101, 32,100,105,114,101, 99,116,105,118,101, 10, 32,108, 111, 99, 97,108, 32,110,115,117, 98,115,116, 10, 32,114,101, 112,101, 97,116, 10, 32, 32, 99,111,100,101, 44,110,115,117, 98,115,116, 32, 61, 32,103,115,117, 98, 40, 99,111,100,101, 44, 39, 92,110, 37,115, 42, 37, 36, 40, 46, 41,102,105,108, 101, 37,115, 42, 34, 40, 46, 45, 41, 34, 40, 91, 94, 92,110, 93, 42, 41, 92,110, 39, 44, 10, 9, 9,102,117,110, 99,116, 105,111,110, 32, 40,107,105,110,100, 44,102,110, 44,101,120, 116,114, 97, 41, 10, 9, 9, 9,108,111, 99, 97,108, 32, 95, 44, 32, 95, 44, 32,101,120,116, 32, 61, 32,115,116,114,102, 105,110,100, 40,102,110, 44, 34, 46, 42, 37, 46, 40, 46, 42, 41, 36, 34, 41, 10, 9, 9, 9,108,111, 99, 97,108, 32,102, 112, 44,109,115,103, 32, 61, 32,111,112,101,110,102,105,108, 101, 40,102,110, 44, 39,114, 39, 41, 10, 9, 9, 9,105,102, 32,110,111,116, 32,102,112, 32,116,104,101,110, 10, 9, 9, 9, 9,101,114,114,111,114, 40, 39, 35, 39, 46, 46,109,115, 103, 46, 46, 39, 58, 32, 39, 46, 46,102,110, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9, 9,105,102, 32,107,105,110,100, 32, 61, 61, 32, 39,112, 39, 32,116,104,101,110, 10, 9, 9, 9, 9,108,111, 99, 97,108, 32,115, 32, 61, 32,112,114,101, 112, 40,102,112, 41, 10, 9, 9, 9, 9, 99,108,111,115,101, 102,105,108,101, 40,102,112, 41, 10, 9, 9, 9, 9,114,101, 116,117,114,110, 32,115, 10, 9, 9, 9,101,110,100, 10, 9, 9, 9,108,111, 99, 97,108, 32,115, 32, 61, 32,114,101, 97, 100, 40,102,112, 44, 39, 42, 97, 39, 41, 10, 9, 9, 9, 99, 108,111,115,101,102,105,108,101, 40,102,112, 41, 10, 9, 9, 9,105,102, 32,107,105,110,100, 32, 61, 61, 32, 39, 99, 39, 32,111,114, 32,107,105,110,100, 32, 61, 61, 32, 39,104, 39, 32,116,104,101,110, 10, 9, 9, 9, 9,114,101,116,117,114, 110, 32,101,120,116,114, 97, 99,116, 95, 99,111,100,101, 40, 102,110, 44,115, 41, 10, 9, 9, 9,101,108,115,101,105,102, 32,107,105,110,100, 32, 61, 61, 32, 39,108, 39, 32,116,104, 101,110, 10, 9, 9, 9, 9,114,101,116,117,114,110, 32, 34, 92,110, 36, 91, 45, 45, 35, 35, 34, 46, 46,102,110, 46, 46, 34, 92,110, 34, 32, 46, 46, 32,115, 32, 46, 46, 32, 34, 92, 110, 36, 93, 92,110, 34, 10, 9, 9, 9,101,108,115,101,105, 102, 32,107,105,110,100, 32, 61, 61, 32, 39,105, 39, 32,116, 104,101,110, 10, 9, 9, 9, 9,108,111, 99, 97,108, 32,116, 32, 61, 32,123, 99,111,100,101, 61,115,125, 10, 9, 9, 9, 9,101,120,116,114, 97, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,101,120,116,114, 97, 44, 32, 34, 94, 37,115, 42, 44, 37,115, 42, 34, 44, 32, 34, 34, 41, 10, 9, 9, 9, 9,108,111, 99, 97,108, 32,112, 97,114,115, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40,101,120,116,114, 97, 44, 32, 34, 44, 34, 41, 10, 9, 9, 9, 9,105,110, 99,108,117,100,101, 95,102,105,108,101, 95, 104,111,111,107, 40,116, 44, 32,102,110, 44, 32,117,110,112, 97, 99,107, 40,112, 97,114,115, 41, 41, 10, 9, 9, 9, 9, 114,101,116,117,114,110, 32, 34, 92,110, 92,110, 34, 32, 46, 46, 32,116, 46, 99,111,100,101, 10, 9, 9, 9,101,108,115, 101, 10, 9, 9, 9, 9,101,114,114,111,114, 40, 39, 35, 73, 110,118, 97,108,105,100, 32,105,110, 99,108,117,100,101, 32, 100,105,114,101, 99,116,105,118,101, 32, 40,117,115,101, 32, 36, 99,102,105,108,101, 44, 32, 36,112,102,105,108,101, 44, 32, 36,108,102,105,108,101, 32,111,114, 32, 36,105,102,105, 108,101, 41, 39, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9, 101,110,100, 41, 10, 32,117,110,116,105,108, 32,110,115,117, 98,115,116, 61, 61, 48, 10, 10, 32, 45, 45, 32,100,101, 97, 108, 32,119,105,116,104, 32,114,101,110, 97,109,105,110,103, 32,100,105,114,101, 99,116,105,118,101, 10, 32,114,101,112, 101, 97,116, 32, 45, 45, 32, 73, 32,100,111,110, 39,116, 32, 107,110,111,119, 32,119,104,121, 32,116,104,105,115, 32,105, 115, 32,110,101, 99,101,115, 97,114,121, 10, 9, 99,111,100, 101, 44,110,115,117, 98,115,116, 32, 61, 32,103,115,117, 98, 40, 99,111,100,101, 44, 39, 92,110, 37,115, 42, 37, 36,114, 101,110, 97,109,105,110,103, 37,115, 42, 40, 46, 45, 41, 37, 115, 42, 92,110, 39, 44, 32,102,117,110, 99,116,105,111,110, 32, 40,114, 41, 32, 97,112,112,101,110,100,114,101,110, 97, 109,105,110,103, 40,114, 41, 32,114,101,116,117,114,110, 32, 34, 92,110, 34, 32,101,110,100, 41, 10, 32,117,110,116,105, 108, 32,110,115,117, 98,115,116, 32, 61, 61, 32, 48, 10, 10, 32,108,111, 99, 97,108, 32,116, 32, 61, 32, 95, 80, 97, 99, 107, 97,103,101, 40, 95, 67,111,110,116, 97,105,110,101,114, 123,110, 97,109,101, 61,110, 97,109,101, 44, 32, 99,111,100, 101, 61, 99,111,100,101,125, 41, 10, 32,112,117,115,104, 40, 116, 41, 10, 32,112,114,101,112,114,111, 99,101,115,115, 95, 104,111,111,107, 40,116, 41, 10, 32,116, 58,112,114,101,112, 114,111, 99,101,115,115, 40, 41, 10, 32,112,114,101,112, 97, 114,115,101, 95,104,111,111,107, 40,116, 41, 10, 32,116, 58, 112, 97,114,115,101, 40,116, 46, 99,111,100,101, 41, 10, 32, 112,111,112, 40, 41, 10, 32,114,101,116,117,114,110, 32,116, 10,101,110,100, 10, 10, 10,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40, 95,101,120,116,114, 97, 95,112, 97,114, 97,109,101,116,101,114,115, 44, 32,123, 32, 95, 95,105,110, 100,101,120, 32, 61, 32, 95, 71, 32,125, 41, 10, 10,102,117, 110, 99,116,105,111,110, 32,112,114,101,112, 40,102,105,108, 101, 41, 10, 10, 32, 32,108,111, 99, 97,108, 32, 99,104,117, 110,107, 32, 61, 32,123, 39,108,111, 99, 97,108, 32, 95, 95, 114,101,116, 32, 61, 32,123, 34, 92, 92,110, 34,125, 92,110, 39,125, 10, 32, 32,102,111,114, 32,108,105,110,101, 32,105, 110, 32,102,105,108,101, 58,108,105,110,101,115, 40, 41, 32, 100,111, 10, 32, 32, 32, 32, 32,105,102, 32,115,116,114,105, 110,103, 46,102,105,110,100, 40,108,105,110,101, 44, 32, 34, 94, 35, 35, 34, 41, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32,116, 97, 98,108,101, 46,105,110,115,101,114,116, 40, 99,104,117,110,107, 44, 32,115,116,114,105,110,103, 46,115, 117, 98, 40,108,105,110,101, 44, 32, 51, 41, 32, 46, 46, 32, 34, 92,110, 34, 41, 10, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,108, 97, 115,116, 32, 61, 32, 49, 10, 32, 32, 32, 32, 32, 32,102,111, 114, 32,116,101,120,116, 44, 32,101,120,112,114, 44, 32,105, 110,100,101,120, 32,105,110, 32,115,116,114,105,110,103, 46, 103,102,105,110,100, 40,108,105,110,101, 44, 32, 34, 40, 46, 45, 41, 36, 40, 37, 98, 40, 41, 41, 40, 41, 34, 41, 32,100, 111, 32, 10, 32, 32, 32, 32, 32, 32, 32, 32,108, 97,115,116, 32, 61, 32,105,110,100,101,120, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,116,101,120,116, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,116, 97, 98,108,101, 46,105,110,115,101,114,116, 40, 99, 104,117,110,107, 44, 32,115,116,114,105,110,103, 46,102,111, 114,109, 97,116, 40, 39,116, 97, 98,108,101, 46,105,110,115, 101,114,116, 40, 95, 95,114,101,116, 44, 32, 37,113, 32, 41, 39, 44, 32,116,101,120,116, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 116, 97, 98,108,101, 46,105,110,115,101,114,116, 40, 99,104, 117,110,107, 44, 32,115,116,114,105,110,103, 46,102,111,114, 109, 97,116, 40, 39,116, 97, 98,108,101, 46,105,110,115,101, 114,116, 40, 95, 95,114,101,116, 44, 32, 37,115, 32, 41, 39, 44, 32,101,120,112,114, 41, 41, 10, 32, 32, 32, 32, 32, 32, 101,110,100, 10, 32, 32, 32, 32, 32, 32,116, 97, 98,108,101, 46,105,110,115,101,114,116, 40, 99,104,117,110,107, 44, 32, 115,116,114,105,110,103, 46,102,111,114,109, 97,116, 40, 39, 116, 97, 98,108,101, 46,105,110,115,101,114,116, 40, 95, 95, 114,101,116, 44, 32, 37,113, 41, 92,110, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,116,114,105,110,103, 46,115,117, 98, 40,108,105,110,101, 44, 32,108, 97,115,116, 41, 46, 46, 34, 92,110, 34, 41, 41, 10, 32, 32, 32, 32,101, 110,100, 10, 32, 32,101,110,100, 10, 32, 32,116, 97, 98,108, 101, 46,105,110,115,101,114,116, 40, 99,104,117,110,107, 44, 32, 39, 92,110,114,101,116,117,114,110, 32,116, 97, 98,108, 101, 46, 99,111,110, 99, 97,116, 40, 95, 95,114,101,116, 41, 92,110, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,102, 44, 101, 32, 61, 32,108,111, 97,100,115,116,114,105,110,103, 40, 116, 97, 98,108,101, 46, 99,111,110, 99, 97,116, 40, 99,104, 117,110,107, 41, 41, 10, 32, 32,105,102, 32,101, 32,116,104, 101,110, 10, 32, 32, 9,101,114,114,111,114, 40, 34, 35, 34, 46, 46,101, 41, 10, 32, 32,101,110,100, 10, 32, 32,115,101, 116,102,101,110,118, 40,102, 44, 32, 95,101,120,116,114, 97, 95,112, 97,114, 97,109,101,116,101,114,115, 41, 10, 32, 32, 114,101,116,117,114,110, 32,102, 40, 41, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/package.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,109,111,100,117,108, 101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114,105,116, 116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74, 117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111,100, 101, 32,105,115, 32,102,114,101,101, 32,115,111,102,116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101, 100,105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97, 110,100, 47,111,114, 32,109,111,100,105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116,119, 97, 114,101, 32,112,114,111,118,105,100,101,100, 32,104,101,114, 101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97,117,116, 104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105, 103, 97,116,105,111,110, 32,116,111, 32,112,114,111,118,105, 100,101, 32,109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97,116, 101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101,109, 101,110,116,115, 44, 32,111,114, 32,109,111,100,105,102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 10, 45, 45, 32, 77,111,100,117,108,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101,115,101,110,116,115, 32,109,111,100, 117,108,101, 46, 10, 45, 45, 32, 84,104,101, 32,102,111,108, 108,111,119,105,110,103, 32,102,105,101,108,100,115, 32, 97, 114,101, 32,115,116,111,114,101,100, 58, 10, 45, 45, 32, 32, 32, 32,123,105,125, 32, 61, 32,108,105,115,116, 32,111,102, 32,111, 98,106,101, 99,116,115, 32,105,110, 32,116,104,101, 32,109,111,100,117,108,101, 46, 10, 99,108, 97,115,115, 77, 111,100,117,108,101, 32, 61, 32,123, 10, 32, 99,108, 97,115, 115,116,121,112,101, 32, 61, 32, 39,109,111,100,117,108,101, 39, 10,125, 10, 99,108, 97,115,115, 77,111,100,117,108,101, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97,115, 115, 77,111,100,117,108,101, 10,115,101,116,109,101,116, 97, 116, 97, 98,108,101, 40, 99,108, 97,115,115, 77,111,100,117, 108,101, 44, 99,108, 97,115,115, 67,111,110,116, 97,105,110, 101,114, 41, 10, 10, 45, 45, 32,114,101,103,105,115,116,101, 114, 32,109,111,100,117,108,101, 10,102,117,110, 99,116,105, 111,110, 32, 99,108, 97,115,115, 77,111,100,117,108,101, 58, 114,101,103,105,115,116,101,114, 32, 40,112,114,101, 41, 10, 32,112,114,101, 32, 61, 32,112,114,101, 32,111,114, 32, 39, 39, 10, 32,112,117,115,104, 40,115,101,108,102, 41, 10, 32, 111,117,116,112,117,116, 40,112,114,101, 46, 46, 39,116,111, 108,117, 97, 95,109,111,100,117,108,101, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101,108,102, 46,110, 97, 109,101, 46, 46, 39, 34, 44, 39, 44,115,101,108,102, 58,104, 97,115,118, 97,114, 40, 41, 44, 39, 41, 59, 39, 41, 10, 32, 111,117,116,112,117,116, 40,112,114,101, 46, 46, 39,116,111, 108,117, 97, 95, 98,101,103,105,110,109,111,100,117,108,101, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101, 108,102, 46,110, 97,109,101, 46, 46, 39, 34, 41, 59, 39, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104, 105,108,101, 32,115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32,115,101,108,102, 91,105, 93, 58,114,101,103,105,115, 116,101,114, 40,112,114,101, 46, 46, 39, 32, 39, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32, 111,117,116,112,117,116, 40,112,114,101, 46, 46, 39,116,111, 108,117, 97, 95,101,110,100,109,111,100,117,108,101, 40,116, 111,108,117, 97, 95, 83, 41, 59, 39, 41, 10, 9,112,111,112, 40, 41, 10,101,110,100, 10, 10, 45, 45, 32, 80,114,105,110, 116, 32,109,101,116,104,111,100, 10,102,117,110, 99,116,105, 111,110, 32, 99,108, 97,115,115, 77,111,100,117,108,101, 58, 112,114,105,110,116, 32, 40,105,100,101,110,116, 44, 99,108, 111,115,101, 41, 10, 32,112,114,105,110,116, 40,105,100,101, 110,116, 46, 46, 34, 77,111,100,117,108,101,123, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46,110, 97,109,101, 46, 46, 34, 39, 59, 34, 41, 10, 32, 108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108, 101, 32,115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32, 115,101,108,102, 91,105, 93, 58,112,114,105,110,116, 40,105, 100,101,110,116, 46, 46, 34, 32, 34, 44, 34, 44, 34, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 125, 34, 46, 46, 99,108,111,115,101, 41, 10,101,110,100, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99,111, 110,115,116,114,117, 99,116,111,114, 10,102,117,110, 99,116, 105,111,110, 32, 95, 77,111,100,117,108,101, 32, 40,116, 41, 10, 32,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40, 116, 44, 99,108, 97,115,115, 77,111,100,117,108,101, 41, 10, 32, 97,112,112,101,110,100, 40,116, 41, 10, 32,114,101,116, 117,114,110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67, 111,110,115,116,114,117, 99,116,111,114, 10, 45, 45, 32, 69, 120,112,101, 99,116,115, 32,116,119,111, 32,115,116,114,105, 110,103, 32,114,101,112,114,101,115,101,110,116,105,110,103, 32,116,104,101, 32,109,111,100,117,108,101, 32,110, 97,109, 101, 32, 97,110,100, 32, 98,111,100,121, 46, 10,102,117,110, 99,116,105,111,110, 32, 77,111,100,117,108,101, 32, 40,110, 44, 98, 41, 10, 32,108,111, 99, 97,108, 32,116, 32, 61, 32, 95, 77,111,100,117,108,101, 40, 95, 67,111,110,116, 97,105, 110,101,114,123,110, 97,109,101, 61,110,125, 41, 10, 32,112, 117,115,104, 40,116, 41, 10, 32,116, 58,112, 97,114,115,101, 40,115,116,114,115,117, 98, 40, 98, 44, 50, 44,115,116,114, 108,101,110, 40, 98, 41, 45, 49, 41, 41, 32, 45, 45, 32,101, 108,105,109,105,110, 97,116,101, 32, 98,114, 97, 99,101,115, 10, 32,112,111,112, 40, 41, 10, 32,114,101,116,117,114,110, 32,116, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/module.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,110, 97,109,101,115, 112, 97, 99,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87, 114,105,116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101, 109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 50, 48, 48, 51, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111,100,101, 32,105,115, 32,102,114,101,101, 32,115,111, 102,116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101,100,105,115,116,114,105, 98,117,116,101, 32,105, 116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102, 116,119, 97,114,101, 32,112,114,111,118,105,100,101,100, 32, 104,101,114,101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115, 105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97,117,116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105,103, 97,116,105,111,110, 32,116,111, 32,112,114, 111,118,105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112, 100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101,109,101,110,116,115, 44, 32,111,114, 32,109,111,100, 105,102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 45, 45, 32, 78, 97,109,101,115,112, 97, 99,101, 32, 99,108, 97, 115,115, 10, 45, 45, 32, 82,101,112,114,101,115,101,110,116, 115, 32, 97, 32,110, 97,109,101,115, 97,112, 99,101, 32,100, 101,102,105,110,105,116,105,111,110, 46, 10, 45, 45, 32, 83, 116,111,114,101,115, 32,116,104,101, 32,102,111,108,108,111, 119,105,110,103, 32,102,105,101,108,100,115, 58, 10, 45, 45, 32, 32, 32, 32,110, 97,109,101, 32, 61, 32, 99,108, 97,115, 115, 32,110, 97,109,101, 10, 45, 45, 32, 32, 32, 32,123,105, 125, 32, 32, 61, 32,108,105,115,116, 32,111,102, 32,109,101, 109, 98,101,114,115, 10, 99,108, 97,115,115, 78, 97,109,101, 115,112, 97, 99,101, 32, 61, 32,123, 10, 32, 99,108, 97,115, 115,116,121,112,101, 32, 61, 32, 39,110, 97,109,101,115,112, 97, 99,101, 39, 44, 10, 32,110, 97,109,101, 32, 61, 32, 39, 39, 44, 10,125, 10, 99,108, 97,115,115, 78, 97,109,101,115, 112, 97, 99,101, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97,115,115, 78, 97,109,101,115,112, 97, 99,101, 10, 115,101,116,109,101,116, 97,116, 97, 98,108,101, 40, 99,108, 97,115,115, 78, 97,109,101,115,112, 97, 99,101, 44, 99,108, 97,115,115, 77,111,100,117,108,101, 41, 10, 10, 45, 45, 32, 80,114,105,110,116, 32,109,101,116,104,111,100, 10,102,117, 110, 99,116,105,111,110, 32, 99,108, 97,115,115, 78, 97,109, 101,115,112, 97, 99,101, 58,112,114,105,110,116, 32, 40,105, 100,101,110,116, 44, 99,108,111,115,101, 41, 10, 32,112,114, 105,110,116, 40,105,100,101,110,116, 46, 46, 34, 78, 97,109, 101,115,112, 97, 99,101,123, 34, 41, 10, 32,112,114,105,110, 116, 40,105,100,101,110,116, 46, 46, 34, 32,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,110, 97,109, 101, 46, 46, 34, 39, 44, 34, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108,101, 32,115,101,108, 102, 91,105, 93, 32,100,111, 10, 32, 32,115,101,108,102, 91, 105, 93, 58,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 34, 44, 34, 44, 34, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,112,114,105,110, 116, 40,105,100,101,110,116, 46, 46, 34,125, 34, 46, 46, 99, 108,111,115,101, 41, 10,101,110,100, 10, 10, 45, 45, 32, 73, 110,116,101,114,110, 97,108, 32, 99,111,110,115,116,114,117, 99,116,111,114, 10,102,117,110, 99,116,105,111,110, 32, 95, 78, 97,109,101,115,112, 97, 99,101, 32, 40,116, 41, 10, 32, 115,101,116,109,101,116, 97,116, 97, 98,108,101, 40,116, 44, 99,108, 97,115,115, 78, 97,109,101,115,112, 97, 99,101, 41, 10, 32, 97,112,112,101,110,100, 40,116, 41, 10, 32,114,101, 116,117,114,110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110,115,116,114,117, 99,116,111,114, 10, 45, 45, 32, 69,120,112,101, 99,116,115, 32,116,104,101, 32,110, 97,109, 101, 32, 97,110,100, 32,116,104,101, 32, 98,111,100,121, 32, 111,102, 32,116,104,101, 32,110, 97,109,101,115,112, 97, 99, 101, 46, 10,102,117,110, 99,116,105,111,110, 32, 78, 97,109, 101,115,112, 97, 99,101, 32, 40,110, 44, 98, 41, 10, 32,108, 111, 99, 97,108, 32, 99, 32, 61, 32, 95, 78, 97,109,101,115, 112, 97, 99,101, 40, 95, 67,111,110,116, 97,105,110,101,114, 123,110, 97,109,101, 61,110,125, 41, 10, 32,112,117,115,104, 40, 99, 41, 10, 32, 99, 58,112, 97,114,115,101, 40,115,116, 114,115,117, 98, 40, 98, 44, 50, 44,115,116,114,108,101,110, 40, 98, 41, 45, 49, 41, 41, 32, 45, 45, 32,101,108,105,109, 105,110, 97,116,101, 32, 98,114, 97, 99,101,115, 10, 32,112, 111,112, 40, 41, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/namespace.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,100,101,102,105,110, 101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114,105,116, 116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74, 117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73,100, 58, 32,100,101,102,105,110,101, 46,108,117, 97, 44,118, 32, 49, 46, 50, 32, 49, 57, 57, 57, 47, 48, 55, 47, 50, 56, 32, 50, 50, 58, 50, 49, 58, 48, 56, 32, 99,101,108,101,115, 32, 69, 120,112, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99, 111,100,101, 32,105,115, 32,102,114,101,101, 32,115,111,102, 116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32, 114,101,100,105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32, 105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116, 119, 97,114,101, 32,112,114,111,118,105,100,101,100, 32,104, 101,114,101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105, 115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97, 117,116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98, 108,105,103, 97,116,105,111,110, 32,116,111, 32,112,114,111, 118,105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99, 101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99, 101,109,101,110,116,115, 44, 32,111,114, 32,109,111,100,105, 102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 45, 45, 32, 68,101,102,105,110,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101,115,101,110,116,115, 32, 97, 32, 110,117,109,101,114,105, 99, 32, 99,111,110,115,116, 32,100, 101,102,105,110,105,116,105,111,110, 10, 45, 45, 32, 84,104, 101, 32,102,111,108,108,111,119,105,110,103, 32,102,105,108, 100,115, 32, 97,114,101, 32,115,116,111,114,101,100, 58, 10, 45, 45, 32, 32, 32,110, 97,109,101, 32, 61, 32, 99,111,110, 115,116, 97,110,116, 32,110, 97,109,101, 10, 99,108, 97,115, 115, 68,101,102,105,110,101, 32, 61, 32,123, 10, 32,110, 97, 109,101, 32, 61, 32, 39, 39, 44, 10,125, 10, 99,108, 97,115, 115, 68,101,102,105,110,101, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97,115,115, 68,101,102,105,110,101, 10, 115,101,116,109,101,116, 97,116, 97, 98,108,101, 40, 99,108, 97,115,115, 68,101,102,105,110,101, 44, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 41, 10, 10, 45, 45, 32,114,101, 103,105,115,116,101,114, 32,100,101,102,105,110,101, 10,102, 117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 68,101, 102,105,110,101, 58,114,101,103,105,115,116,101,114, 32, 40, 112,114,101, 41, 10, 9,105,102, 32,110,111,116, 32,115,101, 108,102, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 32,116,104,101,110, 10, 9, 9,114,101,116,117,114,110, 10, 9,101,110,100, 10, 10, 32,112,114,101, 32, 61, 32,112,114,101, 32,111,114, 32, 39, 39, 10, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 39,116,111,108,117, 97, 95, 99,111,110,115,116, 97,110,116, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101, 108,102, 46,108,110, 97,109,101, 46, 46, 39, 34, 44, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 41, 59, 39, 41, 10,101,110,100, 10, 10, 45, 45, 32, 80,114,105,110, 116, 32,109,101,116,104,111,100, 10,102,117,110, 99,116,105, 111,110, 32, 99,108, 97,115,115, 68,101,102,105,110,101, 58, 112,114,105,110,116, 32, 40,105,100,101,110,116, 44, 99,108, 111,115,101, 41, 10, 32,112,114,105,110,116, 40,105,100,101, 110,116, 46, 46, 34, 68,101,102,105,110,101,123, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32, 112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 108,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46,108,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 125, 34, 46, 46, 99,108,111,115,101, 41, 10,101,110,100, 10, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99, 111,110,115,116,114,117, 99,116,111,114, 10,102,117,110, 99, 116,105,111,110, 32, 95, 68,101,102,105,110,101, 32, 40,116, 41, 10, 32,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40,116, 44, 99,108, 97,115,115, 68,101,102,105,110,101, 41, 10, 32,116, 58, 98,117,105,108,100,110, 97,109,101,115, 40, 41, 10, 10, 32,105,102, 32,116, 46,110, 97,109,101, 32, 61, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 32,101,114,114, 111,114, 40, 34, 35,105,110,118, 97,108,105,100, 32,100,101, 102,105,110,101, 34, 41, 10, 32,101,110,100, 10, 10, 32, 97, 112,112,101,110,100, 40,116, 41, 10, 32,114,101,116,117,114, 110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110, 115,116,114,117, 99,116,111,114, 10, 45, 45, 32, 69,120,112, 101, 99,116,115, 32, 97, 32,115,116,114,105,110,103, 32,114, 101,112,114,101,115,101,110,116,105,110,103, 32,116,104,101, 32, 99,111,110,115,116, 97,110,116, 32,110, 97,109,101, 10, 102,117,110, 99,116,105,111,110, 32, 68,101,102,105,110,101, 32, 40,110, 41, 10, 32,114,101,116,117,114,110, 32, 95, 68, 101,102,105,110,101,123, 10, 32, 32,110, 97,109,101, 32, 61, 32,110, 10, 32,125, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/define.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,101,110,117,109,101, 114, 97,116,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87, 114,105,116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101, 109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73,100, 58, 32,101,110,117,109,101,114, 97,116,101, 46,108, 117, 97, 44,118, 32, 49, 46, 51, 32, 50, 48, 48, 48, 47, 48, 49, 47, 50, 52, 32, 50, 48, 58, 52, 49, 58, 49, 53, 32, 99, 101,108,101,115, 32, 69,120,112, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111,100,101, 32,105,115, 32,102,114, 101,101, 32,115,111,102,116,119, 97,114,101, 59, 32,121,111, 117, 32, 99, 97,110, 32,114,101,100,105,115,116,114,105, 98, 117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109, 111,100,105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104, 101, 32,115,111,102,116,119, 97,114,101, 32,112,114,111,118, 105,100,101,100, 32,104,101,114,101,117,110,100,101,114, 32, 105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97,117,116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105,103, 97,116,105,111,110, 32, 116,111, 32,112,114,111,118,105,100,101, 32,109, 97,105,110, 116,101,110, 97,110, 99,101, 44, 32,115,117,112,112,111,114, 116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32, 101,110,104, 97,110, 99,101,109,101,110,116,115, 44, 32,111, 114, 32,109,111,100,105,102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 45, 45, 32, 69,110,117,109,101,114, 97,116, 101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114, 101,115,101,110,116,115, 32,101,110,117,109,101,114, 97,116, 105,111,110, 10, 45, 45, 32, 84,104,101, 32,102,111,108,108, 111,119,105,110,103, 32,102,105,101,108,100,115, 32, 97,114, 101, 32,115,116,111,114,101,100, 58, 10, 45, 45, 32, 32, 32, 32,123,105,125, 32, 61, 32,108,105,115,116, 32,111,102, 32, 99,111,110,115,116, 97,110,116, 32,110, 97,109,101,115, 10, 99,108, 97,115,115, 69,110,117,109,101,114, 97,116,101, 32, 61, 32,123, 10,125, 10, 99,108, 97,115,115, 69,110,117,109, 101,114, 97,116,101, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97,115,115, 69,110,117,109,101,114, 97,116,101, 10,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40, 99, 108, 97,115,115, 69,110,117,109,101,114, 97,116,101, 44, 99, 108, 97,115,115, 70,101, 97,116,117,114,101, 41, 10, 10, 45, 45, 32,114,101,103,105,115,116,101,114, 32,101,110,117,109, 101,114, 97,116,105,111,110, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 69,110,117,109,101,114, 97,116, 101, 58,114,101,103,105,115,116,101,114, 32, 40,112,114,101, 41, 10, 9,105,102, 32,110,111,116, 32,115,101,108,102, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 32,116,104,101,110, 10, 9, 9,114, 101,116,117,114,110, 10, 9,101,110,100, 10, 32,112,114,101, 32, 61, 32,112,114,101, 32,111,114, 32, 39, 39, 10, 32,108, 111, 99, 97,108, 32,110,115,112, 97, 99,101, 32, 61, 32,103, 101,116,110, 97,109,101,115,112, 97, 99,101, 40, 99,108, 97, 115,115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114, 114, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32, 119,104,105,108,101, 32,115,101,108,102, 91,105, 93, 32,100, 111, 10, 32, 9,105,102, 32,115,101,108,102, 46,108,110, 97, 109,101,115, 91,105, 93, 32, 97,110,100, 32,115,101,108,102, 46,108,110, 97,109,101,115, 91,105, 93, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 10, 9, 10, 9, 9,111,117,116,112, 117,116, 40,112,114,101, 46, 46, 39,116,111,108,117, 97, 95, 99,111,110,115,116, 97,110,116, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101,108,102, 46,108,110, 97,109, 101,115, 91,105, 93, 46, 46, 39, 34, 44, 39, 46, 46,110,115, 112, 97, 99,101, 46, 46,115,101,108,102, 91,105, 93, 46, 46, 39, 41, 59, 39, 41, 10, 9,101,110,100, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 80,114,105,110,116, 32,109,101,116,104,111, 100, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115, 115, 69,110,117,109,101,114, 97,116,101, 58,112,114,105,110, 116, 32, 40,105,100,101,110,116, 44, 99,108,111,115,101, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 69,110,117,109,101,114, 97,116,101,123, 34, 41, 10, 32, 112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 110, 97,109,101, 32, 61, 32, 34, 46, 46,115,101,108,102, 46, 110, 97,109,101, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108,101, 32,115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32,112,114,105,110,116, 40,105,100, 101,110,116, 46, 46, 34, 32, 39, 34, 46, 46,115,101,108,102, 91,105, 93, 46, 46, 34, 39, 40, 34, 46, 46,115,101,108,102, 46,108,110, 97,109,101,115, 91,105, 93, 46, 46, 34, 41, 44, 34, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101, 110,100, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34,125, 34, 46, 46, 99,108,111,115,101, 41, 10,101, 110,100, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99,111,110,115,116,114,117, 99,116,111,114, 10,102,117, 110, 99,116,105,111,110, 32, 95, 69,110,117,109,101,114, 97, 116,101, 32, 40,116, 44,118, 97,114,110, 97,109,101, 41, 10, 32,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40,116, 44, 99,108, 97,115,115, 69,110,117,109,101,114, 97,116,101, 41, 10, 32, 97,112,112,101,110,100, 40,116, 41, 10, 32, 97, 112,112,101,110,100,101,110,117,109, 40,116, 41, 10, 9, 32, 105,102, 32,118, 97,114,110, 97,109,101, 32, 97,110,100, 32, 118, 97,114,110, 97,109,101, 32,126, 61, 32, 34, 34, 32,116, 104,101,110, 10, 9, 9,105,102, 32,116, 46,110, 97,109,101, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 10, 9, 9, 9, 86, 97,114,105, 97, 98,108,101, 40,116, 46,110, 97,109,101, 46, 46, 34, 32, 34, 46, 46,118, 97,114,110, 97,109,101, 41, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,108,111, 99, 97, 108, 32,110,115, 32, 61, 32,103,101,116, 99,117,114,114,110, 97,109,101,115,112, 97, 99,101, 40, 41, 10, 9, 9, 9,119, 97,114,110,105,110,103, 40, 34, 86, 97,114,105, 97, 98,108, 101, 32, 34, 46, 46,110,115, 46, 46,118, 97,114,110, 97,109, 101, 46, 46, 34, 32,111,102, 32,116,121,112,101, 32, 60, 97, 110,111,110,121,109,111,117,115, 32,101,110,117,109, 62, 32, 105,115, 32,100,101, 99,108, 97,114,101,100, 32, 97,115, 32, 114,101, 97,100, 45,111,110,108,121, 34, 41, 10, 9, 9, 9, 86, 97,114,105, 97, 98,108,101, 40, 34,116,111,108,117, 97, 95,114,101, 97,100,111,110,108,121, 32,105,110,116, 32, 34, 46, 46,118, 97,114,110, 97,109,101, 41, 10, 9, 9,101,110, 100, 10, 9,101,110,100, 10, 9, 32,108,111, 99, 97,108, 32, 112, 97,114,101,110,116, 32, 61, 32, 99,108, 97,115,115, 67, 111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 10, 9, 32,105,102, 32,112, 97,114,101,110,116, 32,116,104,101,110, 10, 9, 9,116, 46, 97, 99, 99,101,115,115, 32, 61, 32,112, 97,114,101,110,116, 46, 99,117,114,114, 95,109,101,109, 98, 101,114, 95, 97, 99, 99,101,115,115, 10, 9, 9,116, 46,103, 108,111, 98, 97,108, 95, 97, 99, 99,101,115,115, 32, 61, 32, 116, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 10, 9, 32,101,110,100, 10, 114,101,116,117,114,110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110,115,116,114,117, 99,116,111,114, 10, 45, 45, 32, 69,120,112,101, 99,116,115, 32, 97, 32,115,116,114, 105,110,103, 32,114,101,112,114,101,115,101,110,116,105,110, 103, 32,116,104,101, 32,101,110,117,109,101,114, 97,116,101, 32, 98,111,100,121, 10,102,117,110, 99,116,105,111,110, 32, 69,110,117,109,101,114, 97,116,101, 32, 40,110, 44, 98, 44, 118, 97,114,110, 97,109,101, 41, 10, 9, 98, 32, 61, 32,115, 116,114,105,110,103, 46,103,115,117, 98, 40, 98, 44, 32, 34, 44, 91, 37,115, 92,110, 93, 42,125, 34, 44, 32, 34, 92,110, 125, 34, 41, 32, 45, 45, 32,101,108,105,109,105,110, 97,116, 101, 32,108, 97,115,116, 32, 39, 44, 39, 10, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,115,112,108,105,116, 40,115,116, 114,115,117, 98, 40, 98, 44, 50, 44, 45, 50, 41, 44, 39, 44, 39, 41, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101, 32, 98,114, 97, 99,101,115, 10, 32,108,111, 99, 97,108, 32, 105, 32, 61, 32, 49, 10, 32,108,111, 99, 97,108, 32,101, 32, 61, 32,123,110, 61, 48,125, 10, 32,119,104,105,108,101, 32, 116, 91,105, 93, 32,100,111, 10, 32, 32,108,111, 99, 97,108, 32,116,116, 32, 61, 32,115,112,108,105,116, 40,116, 91,105, 93, 44, 39, 61, 39, 41, 32, 32, 45, 45, 32,100,105,115, 99, 97,114,100, 32,105,110,105,116,105, 97,108, 32,118, 97,108, 117,101, 10, 32, 32,101, 46,110, 32, 61, 32,101, 46,110, 32, 43, 32, 49, 10, 32, 32,101, 91,101, 46,110, 93, 32, 61, 32, 116,116, 91, 49, 93, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32, 45, 45, 32,115,101,116, 32,108, 117, 97, 32,110, 97,109,101,115, 10, 32,105, 32, 32, 61, 32, 49, 10, 32,101, 46,108,110, 97,109,101,115, 32, 61, 32,123, 125, 10, 32,108,111, 99, 97,108, 32,110,115, 32, 61, 32,103, 101,116, 99,117,114,114,110, 97,109,101,115,112, 97, 99,101, 40, 41, 10, 32,119,104,105,108,101, 32,101, 91,105, 93, 32, 100,111, 10, 32, 32,108,111, 99, 97,108, 32,116, 32, 61, 32, 115,112,108,105,116, 40,101, 91,105, 93, 44, 39, 64, 39, 41, 10, 32, 32,101, 91,105, 93, 32, 61, 32,116, 91, 49, 93, 10, 9, 9,105,102, 32,110,111,116, 32,116, 91, 50, 93, 32,116, 104,101,110, 10, 9, 9, 32,116, 91, 50, 93, 32, 61, 32, 97, 112,112,108,121,114,101,110, 97,109,105,110,103, 40,116, 91, 49, 93, 41, 10, 9, 9,101,110,100, 10, 32, 32,101, 46,108, 110, 97,109,101,115, 91,105, 93, 32, 61, 32,116, 91, 50, 93, 32,111,114, 32,116, 91, 49, 93, 10, 32, 32, 95,103,108,111, 98, 97,108, 95,101,110,117,109,115, 91, 32,110,115, 46, 46, 101, 91,105, 93, 32, 93, 32, 61, 32, 40,110,115, 46, 46,101, 91,105, 93, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 9,101, 46,110, 97,109,101, 32, 61, 32, 110, 10, 9,105,102, 32,110, 32,126, 61, 32, 34, 34, 32,116, 104,101,110, 10, 9, 9, 84,121,112,101,100,101,102, 40, 34, 105,110,116, 32, 34, 46, 46,110, 41, 10, 9,101,110,100, 10, 32,114,101,116,117,114,110, 32, 95, 69,110,117,109,101,114, 97,116,101, 40,101, 44, 32,118, 97,114,110, 97,109,101, 41, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/enumerate.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,100,101, 99,108, 97, 114, 97,116,105,111,110, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114,105,116,116,101,110, 32, 98,121, 32, 87, 97,108, 100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105, 115, 32, 99,111,100,101, 32,105,115, 32,102,114,101,101, 32, 115,111,102,116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101,100,105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105, 102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115, 111,102,116,119, 97,114,101, 32,112,114,111,118,105,100,101, 100, 32,104,101,114,101,117,110,100,101,114, 32,105,115, 32, 111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104, 101, 32, 97,117,116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105,103, 97,116,105,111,110, 32,116,111, 32, 112,114,111,118,105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32,115,117,112,112,111,114,116, 44, 32, 117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101,109,101,110,116,115, 44, 32,111,114, 32,109, 111,100,105,102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 45, 45, 32, 68,101, 99,108, 97,114, 97,116,105,111,110, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101, 115,101,110,116,115, 32,118, 97,114,105, 97, 98,108,101, 44, 32,102,117,110, 99,116,105,111,110, 44, 32,111,114, 32, 97, 114,103,117,109,101,110,116, 32,100,101, 99,108, 97,114, 97, 116,105,111,110, 46, 10, 45, 45, 32, 83,116,111,114,101,115, 32,116,104,101, 32,102,111,108,108,111,119,105,110,103, 32, 102,105,101,108,100,115, 58, 10, 45, 45, 32, 32,109,111,100, 32, 32, 61, 32,116,121,112,101, 32,109,111,100,105,102,105, 101,114,115, 10, 45, 45, 32, 32,116,121,112,101, 32, 61, 32, 116,121,112,101, 10, 45, 45, 32, 32,112,116,114, 32, 32, 61, 32, 34, 42, 34, 32,111,114, 32, 34, 38, 34, 44, 32,105,102, 32,114,101,112,114,101,115,101,110,116,105,110,103, 32, 97, 32,112,111,105,110,116,101,114, 32,111,114, 32, 97, 32,114, 101,102,101,114,101,110, 99,101, 10, 45, 45, 32, 32,110, 97, 109,101, 32, 61, 32,110, 97,109,101, 10, 45, 45, 32, 32,100, 105,109, 32, 32, 61, 32,100,105,109,101,110,115,105,111,110, 44, 32,105,102, 32, 97, 32,118,101, 99,116,111,114, 10, 45, 45, 32, 32,100,101,102, 32, 32, 61, 32,100,101,102, 97,117, 108,116, 32,118, 97,108,117,101, 44, 32,105,102, 32, 97,110, 121, 32, 40,111,110,108,121, 32,102,111,114, 32, 97,114,103, 117,109,101,110,116,115, 41, 10, 45, 45, 32, 32,114,101,116, 32, 32, 61, 32, 34, 42, 34, 32,111,114, 32, 34, 38, 34, 44, 32,105,102, 32,118, 97,108,117,101, 32,105,115, 32,116,111, 32, 98,101, 32,114,101,116,117,114,110,101,100, 32, 40,111, 110,108,121, 32,102,111,114, 32, 97,114,103,117,109,101,110, 116,115, 41, 10, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 32, 61, 32,123, 10, 32,109,111,100, 32, 61, 32, 39, 39, 44, 10, 32,116,121,112,101, 32, 61, 32, 39, 39, 44, 10, 32,112,116,114, 32, 61, 32, 39, 39, 44, 10, 32, 110, 97,109,101, 32, 61, 32, 39, 39, 44, 10, 32,100,105,109, 32, 61, 32, 39, 39, 44, 10, 32,114,101,116, 32, 61, 32, 39, 39, 44, 10, 32,100,101,102, 32, 61, 32, 39, 39, 10,125, 10, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105,111, 110, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97, 115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 10,115, 101,116,109,101,116, 97,116, 97, 98,108,101, 40, 99,108, 97, 115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 44, 99, 108, 97,115,115, 70,101, 97,116,117,114,101, 41, 10, 10, 45, 45, 32, 67,114,101, 97,116,101, 32, 97,110, 32,117,110,105, 113,117,101, 32,118, 97,114,105, 97, 98,108,101, 32,110, 97, 109,101, 10,102,117,110, 99,116,105,111,110, 32, 99,114,101, 97,116,101, 95,118, 97,114,110, 97,109,101, 32, 40, 41, 10, 32,105,102, 32,110,111,116, 32, 95,118, 97,114,110,117,109, 98,101,114, 32,116,104,101,110, 32, 95,118, 97,114,110,117, 109, 98,101,114, 32, 61, 32, 48, 32,101,110,100, 10, 32, 95, 118, 97,114,110,117,109, 98,101,114, 32, 61, 32, 95,118, 97, 114,110,117,109, 98,101,114, 32, 43, 32, 49, 10, 32,114,101, 116,117,114,110, 32, 34,116,111,108,117, 97, 95,118, 97,114, 95, 34, 46, 46, 95,118, 97,114,110,117,109, 98,101,114, 10, 101,110,100, 10, 10, 45, 45, 32, 67,104,101, 99,107, 32,100, 101, 99,108, 97,114, 97,116,105,111,110, 32,110, 97,109,101, 10, 45, 45, 32, 73,116, 32, 97,108,115,111, 32,105,100,101, 110,116,105,102,105,101,115, 32,100,101,102, 97,117,108,116, 32,118, 97,108,117,101,115, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116, 105,111,110, 58, 99,104,101, 99,107,110, 97,109,101, 32, 40, 41, 10, 10, 32,105,102, 32,115,116,114,115,117, 98, 40,115, 101,108,102, 46,110, 97,109,101, 44, 49, 44, 49, 41, 32, 61, 61, 32, 39, 91, 39, 32, 97,110,100, 32,110,111,116, 32,102, 105,110,100,116,121,112,101, 40,115,101,108,102, 46,116,121, 112,101, 41, 32,116,104,101,110, 10, 32, 32,115,101,108,102, 46,110, 97,109,101, 32, 61, 32,115,101,108,102, 46,116,121, 112,101, 46, 46,115,101,108,102, 46,110, 97,109,101, 10, 32, 32,108,111, 99, 97,108, 32,109, 32, 61, 32,115,112,108,105, 116, 40,115,101,108,102, 46,109,111,100, 44, 39, 37,115, 37, 115, 42, 39, 41, 10, 32, 32,115,101,108,102, 46,116,121,112, 101, 32, 61, 32,109, 91,109, 46,110, 93, 10, 32, 32,115,101, 108,102, 46,109,111,100, 32, 61, 32, 99,111,110, 99, 97,116, 40,109, 44, 49, 44,109, 46,110, 45, 49, 41, 10, 32,101,110, 100, 10, 10, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,115, 112,108,105,116, 40,115,101,108,102, 46,110, 97,109,101, 44, 39, 61, 39, 41, 10, 32,105,102, 32,116, 46,110, 61, 61, 50, 32,116,104,101,110, 10, 32, 32,115,101,108,102, 46,110, 97, 109,101, 32, 61, 32,116, 91, 49, 93, 10, 32, 32,115,101,108, 102, 46,100,101,102, 32, 61, 32,102,105,110,100, 95,101,110, 117,109, 95,118, 97,114, 40,116, 91,116, 46,110, 93, 41, 10, 32,101,110,100, 10, 10, 32,108,111, 99, 97,108, 32, 98, 44, 101, 44,100, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 101,108,102, 46,110, 97,109,101, 44, 34, 37, 91, 40, 46, 45, 41, 37, 93, 34, 41, 10, 32,105,102, 32, 98, 32,116,104,101, 110, 10, 32, 32,115,101,108,102, 46,110, 97,109,101, 32, 61, 32,115,116,114,115,117, 98, 40,115,101,108,102, 46,110, 97, 109,101, 44, 49, 44, 98, 45, 49, 41, 10, 32, 32,115,101,108, 102, 46,100,105,109, 32, 61, 32,102,105,110,100, 95,101,110, 117,109, 95,118, 97,114, 40,100, 41, 10, 32,101,110,100, 10, 10, 10, 32,105,102, 32,115,101,108,102, 46,116,121,112,101, 32,126, 61, 32, 39, 39, 32, 97,110,100, 32,115,101,108,102, 46,116,121,112,101, 32,126, 61, 32, 39,118,111,105,100, 39, 32, 97,110,100, 32,115,101,108,102, 46,110, 97,109,101, 32, 61, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 32,115,101, 108,102, 46,110, 97,109,101, 32, 61, 32, 99,114,101, 97,116, 101, 95,118, 97,114,110, 97,109,101, 40, 41, 10, 32,101,108, 115,101,105,102, 32,115,101,108,102, 46,107,105,110,100, 61, 61, 39,118, 97,114, 39, 32,116,104,101,110, 10, 32, 32,105, 102, 32,115,101,108,102, 46,116,121,112,101, 61, 61, 39, 39, 32, 97,110,100, 32,115,101,108,102, 46,110, 97,109,101,126, 61, 39, 39, 32,116,104,101,110, 10, 32, 32, 32,115,101,108, 102, 46,116,121,112,101, 32, 61, 32,115,101,108,102, 46,116, 121,112,101, 46, 46,115,101,108,102, 46,110, 97,109,101, 10, 32, 32, 32,115,101,108,102, 46,110, 97,109,101, 32, 61, 32, 99,114,101, 97,116,101, 95,118, 97,114,110, 97,109,101, 40, 41, 10, 32, 32,101,108,115,101,105,102, 32,102,105,110,100, 116,121,112,101, 40,115,101,108,102, 46,110, 97,109,101, 41, 32,116,104,101,110, 10, 32, 32, 32,105,102, 32,115,101,108, 102, 46,116,121,112,101, 61, 61, 39, 39, 32,116,104,101,110, 32,115,101,108,102, 46,116,121,112,101, 32, 61, 32,115,101, 108,102, 46,110, 97,109,101, 10, 32, 32, 32,101,108,115,101, 32,115,101,108,102, 46,116,121,112,101, 32, 61, 32,115,101, 108,102, 46,116,121,112,101, 46, 46, 39, 32, 39, 46, 46,115, 101,108,102, 46,110, 97,109,101, 32,101,110,100, 10, 32, 32, 32,115,101,108,102, 46,110, 97,109,101, 32, 61, 32, 99,114, 101, 97,116,101, 95,118, 97,114,110, 97,109,101, 40, 41, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 97,100,106,117,115,116, 32,116,121,112,101, 32,111,102, 32,115,116,114,105,110,103, 10, 32,105,102, 32,115,101,108, 102, 46,116,121,112,101, 32, 61, 61, 32, 39, 99,104, 97,114, 39, 32, 97,110,100, 32,115,101,108,102, 46,100,105,109, 32, 126, 61, 32, 39, 39, 32,116,104,101,110, 10, 9, 32,115,101, 108,102, 46,116,121,112,101, 32, 61, 32, 39, 99,104, 97,114, 42, 39, 10, 32,101,110,100, 10, 10, 9,105,102, 32,115,101, 108,102, 46,107,105,110,100, 32, 97,110,100, 32,115,101,108, 102, 46,107,105,110,100, 32, 61, 61, 32, 39,118, 97,114, 39, 32,116,104,101,110, 10, 9, 9,115,101,108,102, 46,110, 97, 109,101, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,115,101,108,102, 46,110, 97,109,101, 44, 32, 34, 58, 46, 42, 36, 34, 44, 32, 34, 34, 41, 32, 45, 45, 32, 63, 63, 63, 10, 9,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 67,104,101, 99,107, 32,100,101, 99,108, 97,114, 97,116,105, 111,110, 32,116,121,112,101, 10, 45, 45, 32, 83,117, 98,115, 116,105,116,117,116,101,115, 32,116,121,112,101,100,101,102, 39,115, 46, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 58, 99,104,101, 99,107,116,121,112,101, 32, 40, 41, 10, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32,116,104,101, 114,101, 32,105,115, 32, 97, 32,112,111,105,110,116,101,114, 32,116,111, 32, 98, 97,115,105, 99, 32,116,121,112,101, 10, 32,108,111, 99, 97,108, 32, 98, 97,115,105, 99, 32, 61, 32, 105,115, 98, 97,115,105, 99, 40,115,101,108,102, 46,116,121, 112,101, 41, 10, 32,105,102, 32,115,101,108,102, 46,107,105, 110,100, 32, 61, 61, 32, 39,102,117,110, 99, 39, 32, 97,110, 100, 32, 98, 97,115,105, 99, 61, 61, 39,110,117,109, 98,101, 114, 39, 32, 97,110,100, 32,115,116,114,105,110,103, 46,102, 105,110,100, 40,115,101,108,102, 46,112,116,114, 44, 32, 34, 37, 42, 34, 41, 32,116,104,101,110, 10, 32, 9,115,101,108, 102, 46,116,121,112,101, 32, 61, 32, 39, 95,117,115,101,114, 100, 97,116, 97, 39, 10, 32, 9,115,101,108,102, 46,112,116, 114, 32, 61, 32, 34, 34, 10, 32,101,110,100, 10, 32,105,102, 32, 98, 97,115,105, 99, 32, 97,110,100, 32,115,101,108,102, 46,112,116,114,126, 61, 39, 39, 32,116,104,101,110, 10, 32, 32,115,101,108,102, 46,114,101,116, 32, 61, 32,115,101,108, 102, 46,112,116,114, 10, 32, 32,115,101,108,102, 46,112,116, 114, 32, 61, 32,110,105,108, 10, 32, 32,105,102, 32,105,115, 98, 97,115,105, 99, 40,115,101,108,102, 46,116,121,112,101, 41, 32, 61, 61, 32, 39,110,117,109, 98,101,114, 39, 32,116, 104,101,110, 10, 32, 32, 9,115,101,108,102, 46,114,101,116, 117,114,110, 95,117,115,101,114,100, 97,116, 97, 32, 61, 32, 116,114,117,101, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32, 116,104,101,114,101, 32,105,115, 32, 97,114,114, 97,121, 32, 116,111, 32, 98,101, 32,114,101,116,117,114,110,101,100, 10, 32,105,102, 32,115,101,108,102, 46,100,105,109,126, 61, 39, 39, 32, 97,110,100, 32,115,101,108,102, 46,114,101,116,126, 61, 39, 39, 32,116,104,101,110, 10, 32, 32, 32,101,114,114, 111,114, 40, 39, 35,105,110,118, 97,108,105,100, 32,112, 97, 114, 97,109,101,116,101,114, 58, 32, 99, 97,110,110,111,116, 32,114,101,116,117,114,110, 32, 97,110, 32, 97,114,114, 97, 121, 32,111,102, 32,118, 97,108,117,101,115, 39, 41, 10, 32, 101,110,100, 10, 32, 45, 45, 32,114,101,115,116,111,114,101, 32, 39,118,111,105,100, 42, 39, 32, 97,110,100, 32, 39,115, 116,114,105,110,103, 42, 39, 10, 32,105,102, 32,115,101,108, 102, 46,116,121,112,101, 32, 61, 61, 32, 39, 95,117,115,101, 114,100, 97,116, 97, 39, 32,116,104,101,110, 32,115,101,108, 102, 46,116,121,112,101, 32, 61, 32, 39,118,111,105,100, 42, 39, 10, 32,101,108,115,101,105,102, 32,115,101,108,102, 46, 116,121,112,101, 32, 61, 61, 32, 39, 95, 99,115,116,114,105, 110,103, 39, 32,116,104,101,110, 32,115,101,108,102, 46,116, 121,112,101, 32, 61, 32, 39, 99,104, 97,114, 42, 39, 10, 32, 101,108,115,101,105,102, 32,115,101,108,102, 46,116,121,112, 101, 32, 61, 61, 32, 39, 95,108,115,116, 97,116,101, 39, 32, 116,104,101,110, 32,115,101,108,102, 46,116,121,112,101, 32, 61, 32, 39,108,117, 97, 95, 83,116, 97,116,101, 42, 39, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,114,101,115,111,108, 118,101, 32,116,121,112,101,115, 32,105,110,115,105,100,101, 32,116,104,101, 32,116,101,109,112,108, 97,116,101,115, 10, 32,105,102, 32,115,101,108,102, 46,116,121,112,101, 32,116, 104,101,110, 10, 9, 32,115,101,108,102, 46,116,121,112,101, 32, 61, 32,114,101,115,111,108,118,101, 95,116,101,109,112, 108, 97,116,101, 95,116,121,112,101,115, 40,115,101,108,102, 46,116,121,112,101, 41, 10, 32,101,110,100, 10, 10, 45, 45, 10, 45, 45, 32, 45, 45, 32,105,102, 32,114,101,116,117,114, 110,105,110,103, 32,118, 97,108,117,101, 44, 32, 97,117,116, 111,109, 97,116,105, 99, 97,108,108,121, 32,115,101,116, 32, 100,101,102, 97,117,108,116, 32,118, 97,108,117,101, 10, 45, 45, 32,105,102, 32,115,101,108,102, 46,114,101,116, 32,126, 61, 32, 39, 39, 32, 97,110,100, 32,115,101,108,102, 46,100, 101,102, 32, 61, 61, 32, 39, 39, 32,116,104,101,110, 10, 45, 45, 32, 32,115,101,108,102, 46,100,101,102, 32, 61, 32, 39, 48, 39, 10, 45, 45, 32,101,110,100, 10, 45, 45, 10, 10,101, 110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,114,101, 115,111,108,118,101, 95,116,101,109,112,108, 97,116,101, 95, 116,121,112,101,115, 40,116,121,112,101, 41, 10, 10, 9,105, 102, 32,105,115, 98, 97,115,105, 99, 40,116,121,112,101, 41, 32,116,104,101,110, 10, 9, 9,114,101,116,117,114,110, 32, 116,121,112,101, 10, 9,101,110,100, 10, 9,108,111, 99, 97, 108, 32, 98, 44, 95, 44,109, 32, 61, 32,115,116,114,105,110, 103, 46,102,105,110,100, 40,116,121,112,101, 44, 32, 34, 40, 37, 98, 60, 62, 41, 34, 41, 10, 9,105,102, 32, 98, 32,116, 104,101,110, 10, 10, 9, 9,109, 32, 61, 32,115,112,108,105, 116, 95, 99, 95,116,111,107,101,110,115, 40,115,116,114,105, 110,103, 46,115,117, 98, 40,109, 44, 32, 50, 44, 32, 45, 50, 41, 44, 32, 34, 44, 34, 41, 10, 9, 9,102,111,114, 32,105, 61, 49, 44, 32,116, 97, 98,108,101, 46,103,101,116,110, 40, 109, 41, 32,100,111, 10, 9, 9, 9,109, 91,105, 93, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,109, 91, 105, 93, 44, 34, 37,115, 42, 40, 91, 37, 42, 38, 93, 41, 34, 44, 32, 34, 37, 49, 34, 41, 10, 9, 9, 9,105,102, 32,110, 111,116, 32,105,115,101,110,117,109, 40,109, 91,105, 93, 41, 32,116,104,101,110, 32, 95, 44, 32,109, 91,105, 93, 32, 61, 32, 97,112,112,108,121,116,121,112,101,100,101,102, 40, 34, 34, 44, 32,109, 91,105, 93, 41, 32,101,110,100, 10, 9, 9, 9,109, 91,105, 93, 32, 61, 32,102,105,110,100,116,121,112, 101, 40,109, 91,105, 93, 41, 32,111,114, 32,109, 91,105, 93, 10, 9, 9, 9,109, 91,105, 93, 32, 61, 32,114,101,115,111, 108,118,101, 95,116,101,109,112,108, 97,116,101, 95,116,121, 112,101,115, 40,109, 91,105, 93, 41, 10, 9, 9,101,110,100, 10, 10, 9, 9,108,111, 99, 97,108, 32, 98, 44,105, 10, 9, 9,116,121,112,101, 44, 98, 44,105, 32, 61, 32, 98,114,101, 97,107, 95,116,101,109,112,108, 97,116,101, 40,116,121,112, 101, 41, 10, 45, 45,112,114,105,110,116, 40, 34, 99,111,110, 99, 97,116, 32,105,115, 32, 34, 44, 99,111,110, 99, 97,116, 40,109, 44, 32, 49, 44, 32,109, 46,110, 41, 41, 10, 9, 9, 108,111, 99, 97,108, 32,116,101,109,112,108, 97,116,101, 95, 112, 97,114,116, 32, 61, 32, 34, 60, 34, 46, 46, 99,111,110, 99, 97,116, 40,109, 44, 32, 49, 44, 32,109, 46,110, 44, 32, 34, 44, 34, 41, 46, 46, 34, 62, 34, 10, 9, 9,116,121,112, 101, 32, 61, 32,114,101, 98,117,105,108,100, 95,116,101,109, 112,108, 97,116,101, 40,116,121,112,101, 44, 32, 98, 44, 32, 116,101,109,112,108, 97,116,101, 95,112, 97,114,116, 41, 10, 9, 9,116,121,112,101, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,116,121,112,101, 44, 32, 34, 62, 62, 34, 44, 32, 34, 62, 32, 62, 34, 41, 10, 9,101,110,100, 10, 9,114,101,116,117,114,110, 32,116,121,112,101, 10,101,110, 100, 10, 10,102,117,110, 99,116,105,111,110, 32, 98,114,101, 97,107, 95,116,101,109,112,108, 97,116,101, 40,115, 41, 10, 9,108,111, 99, 97,108, 32, 98, 44,101, 44,116,105,109,112, 108, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,115, 44, 32, 34, 40, 37, 98, 60, 62, 41, 34, 41, 10, 9, 105,102, 32,116,105,109,112,108, 32,116,104,101,110, 10, 9, 9,115, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,115, 44, 32, 34, 37, 98, 60, 62, 34, 44, 32, 34, 34, 41, 10, 9, 9,114,101,116,117,114,110, 32,115, 44, 32, 98, 44, 32,116,105,109,112,108, 10, 9,101,108,115,101, 10, 9, 9,114,101,116,117,114,110, 32,115, 44, 32, 48, 44, 32,110, 105,108, 10, 9,101,110,100, 10,101,110,100, 10, 10,102,117, 110, 99,116,105,111,110, 32,114,101, 98,117,105,108,100, 95, 116,101,109,112,108, 97,116,101, 40,115, 44, 32, 98, 44, 32, 116,105,109,112,108, 41, 10, 10, 9,105,102, 32, 98, 32, 61, 61, 32, 48, 32,116,104,101,110, 10, 9, 9,114,101,116,117, 114,110, 32,115, 10, 9,101,110,100, 10, 10, 9,114,101,116, 117,114,110, 32,115,116,114,105,110,103, 46,115,117, 98, 40, 115, 44, 32, 49, 44, 32, 98, 45, 49, 41, 46, 46,116,105,109, 112,108, 46, 46,115,116,114,105,110,103, 46,115,117, 98, 40, 115, 44, 32, 98, 44, 32, 45, 49, 41, 10,101,110,100, 10, 10, 45, 45, 32, 80,114,105,110,116, 32,109,101,116,104,111,100, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 58,112,114,105, 110,116, 32, 40,105,100,101,110,116, 44, 99,108,111,115,101, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 68,101, 99,108, 97,114, 97,116,105,111,110,123, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,109,111,100, 32, 32, 61, 32, 39, 34, 46, 46,115, 101,108,102, 46,109,111,100, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,116,121,112,101, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46,116,121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32, 112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 112,116,114, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,112,116,114, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114, 105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,110, 97, 109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105, 110,116, 40,105,100,101,110,116, 46, 46, 34, 32,100,105,109, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,100,105, 109, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,100,101,102, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,100,101,102, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105, 100,101,110,116, 46, 46, 34, 32,114,101,116, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,114,101,116, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101, 110,116, 46, 46, 34,125, 34, 46, 46, 99,108,111,115,101, 41, 10,101,110,100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32, 105,102, 32, 97,114,114, 97,121, 32,111,102, 32,118, 97,108, 117,101,115, 32, 97,114,101, 32,114,101,116,117,114,110,101, 100, 32,116,111, 32, 76,117, 97, 10,102,117,110, 99,116,105, 111,110, 32, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97, 116,105,111,110, 58,114,101,113,117,105,114,101, 99,111,108, 108,101, 99,116,105,111,110, 32, 40,116, 41, 10, 32,105,102, 32,115,101,108,102, 46,109,111,100, 32,126, 61, 32, 39, 99, 111,110,115,116, 39, 32, 97,110,100, 10, 9, 32, 32, 32, 32, 115,101,108,102, 46,100,105,109, 32, 97,110,100, 32,115,101, 108,102, 46,100,105,109, 32,126, 61, 32, 39, 39, 32, 97,110, 100, 10, 9, 9, 9, 9, 32,110,111,116, 32,105,115, 98, 97, 115,105, 99, 40,115,101,108,102, 46,116,121,112,101, 41, 32, 97,110,100, 10, 9, 9, 9, 9, 32,115,101,108,102, 46,112, 116,114, 32, 61, 61, 32, 39, 39, 32, 97,110,100, 32,115,101, 108,102, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 32,116,104,101,110, 10, 9, 9,108,111, 99, 97,108, 32,116,121,112,101, 32, 61, 32, 103,115,117, 98, 40,115,101,108,102, 46,116,121,112,101, 44, 34, 37,115, 42, 99,111,110,115,116, 37,115, 43, 34, 44, 34, 34, 41, 10, 9, 9,116, 91,116,121,112,101, 93, 32, 61, 32, 34,116,111,108,117, 97, 95, 99,111,108,108,101, 99,116, 95, 34, 32, 46, 46, 32, 99,108,101, 97,110, 95,116,101,109,112, 108, 97,116,101, 40,116,121,112,101, 41, 10, 9, 9,114,101, 116,117,114,110, 32,116,114,117,101, 10, 9,101,110,100, 10, 9,114,101,116,117,114,110, 32,102, 97,108,115,101, 10,101, 110,100, 10, 10, 45, 45, 32,100,101, 99,108, 97,114,101, 32, 116, 97,103, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 58, 100,101, 99,108,116,121,112,101, 32, 40, 41, 10, 10, 9,115, 101,108,102, 46,116,121,112,101, 32, 61, 32,116,121,112,101, 118, 97,114, 40,115,101,108,102, 46,116,121,112,101, 41, 10, 9,105,102, 32,115,116,114,102,105,110,100, 40,115,101,108, 102, 46,109,111,100, 44, 39, 99,111,110,115,116, 39, 41, 32, 116,104,101,110, 10, 9, 9,115,101,108,102, 46,116,121,112, 101, 32, 61, 32, 39, 99,111,110,115,116, 32, 39, 46, 46,115, 101,108,102, 46,116,121,112,101, 10, 9, 9,115,101,108,102, 46,109,111,100, 32, 61, 32,103,115,117, 98, 40,115,101,108, 102, 46,109,111,100, 44, 39, 99,111,110,115,116, 37,115, 42, 39, 44, 39, 39, 41, 10, 9,101,110,100, 10,101,110,100, 10, 10, 10, 45, 45, 32,111,117,116,112,117,116, 32,116,121,112, 101, 32, 99,104,101, 99,107,105,110,103, 10,102,117,110, 99, 116,105,111,110, 32, 99,108, 97,115,115, 68,101, 99,108, 97, 114, 97,116,105,111,110, 58,111,117,116, 99,104,101, 99,107, 116,121,112,101, 32, 40,110, 97,114,103, 41, 10, 32,108,111, 99, 97,108, 32,100,101,102, 10, 32,108,111, 99, 97,108, 32, 116, 32, 61, 32,105,115, 98, 97,115,105, 99, 40,115,101,108, 102, 46,116,121,112,101, 41, 10, 32,105,102, 32,115,101,108, 102, 46,100,101,102,126, 61, 39, 39, 32,116,104,101,110, 10, 32, 32,100,101,102, 32, 61, 32, 49, 10, 32,101,108,115,101, 10, 32, 32,100,101,102, 32, 61, 32, 48, 10, 32,101,110,100, 10, 32,105,102, 32,115,101,108,102, 46,100,105,109, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 9, 45, 45,105,102, 32,116, 61, 61, 39,115,116,114,105,110,103, 39, 32,116,104, 101,110, 10, 9, 45, 45, 9,114,101,116,117,114,110, 32, 39, 116,111,108,117, 97, 95,105,115,115,116,114,105,110,103, 97, 114,114, 97,121, 40,116,111,108,117, 97, 95, 83, 44, 39, 46, 46,110, 97,114,103, 46, 46, 39, 44, 39, 46, 46,100,101,102, 46, 46, 39, 44, 38,116,111,108,117, 97, 95,101,114,114, 41, 39, 10, 9, 45, 45,101,108,115,101, 10, 9,114,101,116,117, 114,110, 32, 39, 33,116,111,108,117, 97, 95,105,115,116, 97, 98,108,101, 40,116,111,108,117, 97, 95, 83, 44, 39, 46, 46, 110, 97,114,103, 46, 46, 39, 44, 48, 44, 38,116,111,108,117, 97, 95,101,114,114, 41, 39, 10, 32, 9, 45, 45,101,110,100, 10, 32,101,108,115,101,105,102, 32,116, 32,116,104,101,110, 10, 9,114,101,116,117,114,110, 32, 39, 33,116,111,108,117, 97, 95,105,115, 39, 46, 46,116, 46, 46, 39, 40,116,111,108, 117, 97, 95, 83, 44, 39, 46, 46,110, 97,114,103, 46, 46, 39, 44, 39, 46, 46,100,101,102, 46, 46, 39, 44, 38,116,111,108, 117, 97, 95,101,114,114, 41, 39, 10, 32,101,108,115,101, 10, 32, 32,108,111, 99, 97,108, 32,105,115, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95,105,115, 95,102,117,110, 99,116, 105,111,110, 40,115,101,108,102, 46,116,121,112,101, 41, 10, 32, 32,105,102, 32,115,101,108,102, 46,112,116,114, 32, 61, 61, 32, 39, 38, 39, 32,111,114, 32,115,101,108,102, 46,112, 116,114, 32, 61, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 32, 9,114,101,116,117,114,110, 32, 39, 40,116,111,108,117, 97, 95,105,115,118, 97,108,117,101,110,105,108, 40,116,111, 108,117, 97, 95, 83, 44, 39, 46, 46,110, 97,114,103, 46, 46, 39, 44, 38,116,111,108,117, 97, 95,101,114,114, 41, 32,124, 124, 32, 33, 39, 46, 46,105,115, 95,102,117,110, 99, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 39, 46, 46,110, 97, 114,103, 46, 46, 39, 44, 34, 39, 46, 46,115,101,108,102, 46, 116,121,112,101, 46, 46, 39, 34, 44, 39, 46, 46,100,101,102, 46, 46, 39, 44, 38,116,111,108,117, 97, 95,101,114,114, 41, 41, 39, 10, 32, 32,101,108,115,101, 10, 9,114,101,116,117, 114,110, 32, 39, 33, 39, 46, 46,105,115, 95,102,117,110, 99, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 39, 46, 46, 110, 97,114,103, 46, 46, 39, 44, 34, 39, 46, 46,115,101,108, 102, 46,116,121,112,101, 46, 46, 39, 34, 44, 39, 46, 46,100, 101,102, 46, 46, 39, 44, 38,116,111,108,117, 97, 95,101,114, 114, 41, 39, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, 99, 108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 58, 98,117,105,108,100,100,101, 99,108, 97,114, 97,116,105, 111,110, 32, 40,110, 97,114,103, 44, 32, 99,112,108,117,115, 112,108,117,115, 41, 10, 32,108,111, 99, 97,108, 32, 97,114, 114, 97,121, 32, 61, 32,115,101,108,102, 46,100,105,109, 32, 126, 61, 32, 39, 39, 32, 97,110,100, 32,116,111,110,117,109, 98,101,114, 40,115,101,108,102, 46,100,105,109, 41, 61, 61, 110,105,108, 10, 9,108,111, 99, 97,108, 32,108,105,110,101, 32, 61, 32, 34, 34, 10, 32,108,111, 99, 97,108, 32,112,116, 114, 32, 61, 32, 39, 39, 10, 32,108,111, 99, 97,108, 32,109, 111,100, 10, 32,108,111, 99, 97,108, 32,116,121,112,101, 32, 61, 32,115,101,108,102, 46,116,121,112,101, 10, 32,108,111, 99, 97,108, 32,110, 99,116,121,112,101, 32, 61, 32,103,115, 117, 98, 40,115,101,108,102, 46,116,121,112,101, 44, 39, 99, 111,110,115,116, 37,115, 43, 39, 44, 39, 39, 41, 10, 32,105, 102, 32,115,101,108,102, 46,100,105,109, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 9, 32,116,121,112,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46,116,121,112,101, 44, 39, 99,111,110,115,116, 37,115, 43, 39, 44, 39, 39, 41, 32, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101,115, 32, 99,111,110,115,116, 32,109,111,100,105,102,105,101,114, 32,102,111,114, 32, 97,114,114, 97,121,115, 10, 32,101,110, 100, 10, 32,105,102, 32,115,101,108,102, 46,112,116,114,126, 61, 39, 39, 32, 97,110,100, 32,110,111,116, 32,105,115, 98, 97,115,105, 99, 40,116,121,112,101, 41, 32,116,104,101,110, 32,112,116,114, 32, 61, 32, 39, 42, 39, 32,101,110,100, 10, 32,108,105,110,101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97,114, 97,109, 40,108,105,110,101, 44, 34, 32, 34, 44,115, 101,108,102, 46,109,111,100, 44,116,121,112,101, 44,112,116, 114, 41, 10, 32,105,102, 32, 97,114,114, 97,121, 32,116,104, 101,110, 10, 32, 32,108,105,110,101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97,114, 97,109, 40,108,105,110,101, 44, 39, 42, 39, 41, 10, 32,101,110,100, 10, 32,108,105,110,101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97,114, 97,109, 40,108, 105,110,101, 44,115,101,108,102, 46,110, 97,109,101, 41, 10, 32,105,102, 32,115,101,108,102, 46,100,105,109, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 32,105,102, 32,116, 111,110,117,109, 98,101,114, 40,115,101,108,102, 46,100,105, 109, 41,126, 61,110,105,108, 32,116,104,101,110, 10, 32, 32, 32,108,105,110,101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97,114, 97,109, 40,108,105,110,101, 44, 39, 91, 39, 44,115, 101,108,102, 46,100,105,109, 44, 39, 93, 59, 39, 41, 10, 32, 32,101,108,115,101, 10, 9,105,102, 32, 99,112,108,117,115, 112,108,117,115, 32,116,104,101,110, 10, 9, 9,108,105,110, 101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97,114, 97,109, 40,108,105,110,101, 44, 39, 32, 61, 32, 77,116,111,108,117, 97, 95,110,101,119, 40, 40, 39, 44,116,121,112,101, 44,112, 116,114, 44, 39, 41, 91, 39, 46, 46,115,101,108,102, 46,100, 105,109, 46, 46, 39, 93, 41, 59, 39, 41, 10, 9,101,108,115, 101, 10, 9, 9,108,105,110,101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97,114, 97,109, 40,108,105,110,101, 44, 39, 32, 61, 32, 40, 39, 44,116,121,112,101, 44,112,116,114, 44, 39, 42, 41, 39, 44, 10, 9, 9, 39,109, 97,108,108,111, 99, 40, 40, 39, 44,115,101,108,102, 46,100,105,109, 44, 39, 41, 42, 115,105,122,101,111,102, 40, 39, 44,116,121,112,101, 44,112, 116,114, 44, 39, 41, 41, 59, 39, 41, 10, 9,101,110,100, 10, 32, 32,101,110,100, 10, 32,101,108,115,101, 10, 32, 32,108, 111, 99, 97,108, 32,116, 32, 61, 32,105,115, 98, 97,115,105, 99, 40,116,121,112,101, 41, 10, 32, 32,108,105,110,101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97,114, 97,109, 40,108, 105,110,101, 44, 39, 32, 61, 32, 39, 41, 10, 32, 32,105,102, 32,116, 32, 61, 61, 32, 39,115,116, 97,116,101, 39, 32,116, 104,101,110, 10, 32, 32, 9,108,105,110,101, 32, 61, 32, 99, 111,110, 99, 97,116,112, 97,114, 97,109, 40,108,105,110,101, 44, 32, 39,116,111,108,117, 97, 95, 83, 59, 39, 41, 10, 32, 32,101,108,115,101, 10, 32, 32, 9, 45, 45,112,114,105,110, 116, 40, 34,116, 32,105,115, 32, 34, 46, 46,116,111,115,116, 114,105,110,103, 40,116, 41, 46, 46, 34, 44, 32,112,116,114, 32,105,115, 32, 34, 46, 46,116,111,115,116,114,105,110,103, 40,115,101,108,102, 46,112,116,114, 41, 41, 10, 32, 32, 9, 105,102, 32,116, 32, 61, 61, 32, 39,110,117,109, 98,101,114, 39, 32, 97,110,100, 32,115,116,114,105,110,103, 46,102,105, 110,100, 40,115,101,108,102, 46,112,116,114, 44, 32, 34, 37, 42, 34, 41, 32,116,104,101,110, 10, 32, 32, 9, 9,116, 32, 61, 32, 39,117,115,101,114,100, 97,116, 97, 39, 10, 32, 32, 9,101,110,100, 10, 9,105,102, 32,110,111,116, 32,116, 32, 97,110,100, 32,112,116,114, 61, 61, 39, 39, 32,116,104,101, 110, 32,108,105,110,101, 32, 61, 32, 99,111,110, 99, 97,116, 112, 97,114, 97,109, 40,108,105,110,101, 44, 39, 42, 39, 41, 32,101,110,100, 10, 9,108,105,110,101, 32, 61, 32, 99,111, 110, 99, 97,116,112, 97,114, 97,109, 40,108,105,110,101, 44, 39, 40, 40, 39, 44,115,101,108,102, 46,109,111,100, 44,116, 121,112,101, 41, 10, 9,105,102, 32,110,111,116, 32,116, 32, 116,104,101,110, 10, 9, 9,108,105,110,101, 32, 61, 32, 99, 111,110, 99, 97,116,112, 97,114, 97,109, 40,108,105,110,101, 44, 39, 42, 39, 41, 10, 9,101,110,100, 10, 9,108,105,110, 101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97,114, 97,109, 40,108,105,110,101, 44, 39, 41, 32, 39, 41, 10, 9,105,102, 32,105,115,101,110,117,109, 40,110, 99,116,121,112,101, 41, 32,116,104,101,110, 10, 9, 9,108,105,110,101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97,114, 97,109, 40,108,105,110, 101, 44, 39, 40,105,110,116, 41, 32, 39, 41, 10, 9,101,110, 100, 10, 9,108,111, 99, 97,108, 32,100,101,102, 32, 61, 32, 48, 10, 9,105,102, 32,115,101,108,102, 46,100,101,102, 32, 126, 61, 32, 39, 39, 32,116,104,101,110, 10, 9, 9,100,101, 102, 32, 61, 32,115,101,108,102, 46,100,101,102, 10, 9, 9, 105,102, 32, 40,112,116,114, 32, 61, 61, 32, 39, 39, 32,111, 114, 32,115,101,108,102, 46,112,116,114, 32, 61, 61, 32, 39, 38, 39, 41, 32, 97,110,100, 32,110,111,116, 32,116, 32,116, 104,101,110, 10, 9, 9, 9,100,101,102, 32, 61, 32, 34, 40, 118,111,105,100, 42, 41, 38, 40, 99,111,110,115,116, 32, 34, 46, 46,116,121,112,101, 46, 46, 34, 41, 34, 46, 46,100,101, 102, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10, 9,105, 102, 32,116, 32,116,104,101,110, 10, 9, 9,108,105,110,101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97,114, 97,109, 40, 108,105,110,101, 44, 39,116,111,108,117, 97, 95,116,111, 39, 46, 46,116, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 39, 44,110, 97,114,103, 44, 39, 44, 39, 44,100,101,102, 44, 39, 41, 41, 59, 39, 41, 10, 9,101,108,115,101, 10, 9, 9,108, 111, 99, 97,108, 32,116,111, 95,102,117,110, 99, 32, 61, 32, 103,101,116, 95,116,111, 95,102,117,110, 99,116,105,111,110, 40,116,121,112,101, 41, 10, 9, 9,108,105,110,101, 32, 61, 32, 99,111,110, 99, 97,116,112, 97,114, 97,109, 40,108,105, 110,101, 44,116,111, 95,102,117,110, 99, 46, 46, 39, 40,116, 111,108,117, 97, 95, 83, 44, 39, 44,110, 97,114,103, 44, 39, 44, 39, 44,100,101,102, 44, 39, 41, 41, 59, 39, 41, 10, 9, 101,110,100, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 9,114,101,116,117,114,110, 32,108,105,110,101, 10,101,110, 100, 10, 10, 45, 45, 32, 68,101, 99,108, 97,114,101, 32,118, 97,114,105, 97, 98,108,101, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116, 105,111,110, 58,100,101, 99,108, 97,114,101, 32, 40,110, 97, 114,103, 41, 10, 32,105,102, 32,115,101,108,102, 46,100,105, 109, 32,126, 61, 32, 39, 39, 32, 97,110,100, 32,116,111,110, 117,109, 98,101,114, 40,115,101,108,102, 46,100,105,109, 41, 61, 61,110,105,108, 32,116,104,101,110, 10, 9, 32,111,117, 116,112,117,116, 40, 39, 35,105,102,100,101,102, 32, 95, 95, 99,112,108,117,115,112,108,117,115, 92,110, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40,115,101,108,102, 58, 98,117, 105,108,100,100,101, 99,108, 97,114, 97,116,105,111,110, 40, 110, 97,114,103, 44,116,114,117,101, 41, 41, 10, 9, 9,111, 117,116,112,117,116, 40, 39, 35,101,108,115,101, 92,110, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40,115,101,108,102, 58, 98,117,105,108,100,100,101, 99,108, 97,114, 97,116,105, 111,110, 40,110, 97,114,103, 44,102, 97,108,115,101, 41, 41, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35,101,110,100, 105,102, 92,110, 39, 41, 10, 9,101,108,115,101, 10, 9, 9, 111,117,116,112,117,116, 40,115,101,108,102, 58, 98,117,105, 108,100,100,101, 99,108, 97,114, 97,116,105,111,110, 40,110, 97,114,103, 44,102, 97,108,115,101, 41, 41, 10, 9,101,110, 100, 10,101,110,100, 10, 10, 45, 45, 32, 71,101,116, 32,112, 97,114, 97,109,101,116,101,114, 32,118, 97,108,117,101, 10, 102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 68, 101, 99,108, 97,114, 97,116,105,111,110, 58,103,101,116, 97, 114,114, 97,121, 32, 40,110, 97,114,103, 41, 10, 32,105,102, 32,115,101,108,102, 46,100,105,109, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 9, 32,108,111, 99, 97,108, 32,116, 121,112,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46,116,121,112,101, 44, 39, 99,111,110,115,116, 32, 39, 44, 39, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32,123, 39, 41, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,100,101,102, 59, 32,105,102, 32,115,101,108, 102, 46,100,101,102,126, 61, 39, 39, 32,116,104,101,110, 32, 100,101,102, 61, 49, 32,101,108,115,101, 32,100,101,102, 61, 48, 32,101,110,100, 10, 9, 9,108,111, 99, 97,108, 32,116, 32, 61, 32,105,115, 98, 97,115,105, 99, 40,116,121,112,101, 41, 10, 9, 9,105,102, 32, 40,116, 41, 32,116,104,101,110, 10, 9, 9, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,105,102, 32, 40, 33,116,111,108,117, 97, 95,105,115, 39, 46, 46,116, 46, 46, 39, 97,114,114, 97,121, 40,116,111, 108,117, 97, 95, 83, 44, 39, 44,110, 97,114,103, 44, 39, 44, 39, 44,115,101,108,102, 46,100,105,109, 44, 39, 44, 39, 44, 100,101,102, 44, 39, 44, 38,116,111,108,117, 97, 95,101,114, 114, 41, 41, 39, 41, 10, 9, 9,101,108,115,101, 10, 9, 9, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,105, 102, 32, 40, 33,116,111,108,117, 97, 95,105,115,117,115,101, 114,116,121,112,101, 97,114,114, 97,121, 40,116,111,108,117, 97, 95, 83, 44, 39, 44,110, 97,114,103, 44, 39, 44, 34, 39, 44,116,121,112,101, 44, 39, 34, 44, 39, 44,115,101,108,102, 46,100,105,109, 44, 39, 44, 39, 44,100,101,102, 44, 39, 44, 38,116,111,108,117, 97, 95,101,114,114, 41, 41, 39, 41, 10, 9, 9,101,110,100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,103,111,116,111, 32,116,111,108,117, 97, 95,108,101,114,114,111,114, 59, 39, 41, 10, 32, 32,111,117, 116,112,117,116, 40, 39, 32, 32, 32,101,108,115,101, 92,110, 39, 41, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35,101, 110,100,105,102, 92,110, 39, 41, 10, 32, 32,111,117,116,112, 117,116, 40, 39, 32, 32, 32,123, 39, 41, 10, 32, 32,111,117, 116,112,117,116, 40, 39, 32, 32, 32, 32,105,110,116, 32,105, 59, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,102,111,114, 40,105, 61, 48, 59, 32,105, 60, 39, 46, 46,115,101,108,102, 46,100,105,109, 46, 46, 39, 59,105, 43, 43, 41, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,105,115, 98, 97,115,105, 99, 40,116,121,112,101, 41, 10, 32, 32,108,111, 99, 97,108, 32,112,116,114, 32, 61, 32, 39, 39, 10, 32, 32,105,102, 32,115,101,108,102, 46,112, 116,114,126, 61, 39, 39, 32,116,104,101,110, 32,112,116,114, 32, 61, 32, 39, 42, 39, 32,101,110,100, 10, 32, 32,111,117, 116,112,117,116, 40, 39, 32, 32, 32, 39, 44,115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 91,105, 93, 32, 61, 32, 39, 41, 10, 32, 32,105,102, 32,110,111,116, 32,116, 32, 97,110, 100, 32,112,116,114, 61, 61, 39, 39, 32,116,104,101,110, 32, 111,117,116,112,117,116, 40, 39, 42, 39, 41, 32,101,110,100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 40, 40, 39, 44, 116,121,112,101, 41, 10, 32, 32,105,102, 32,110,111,116, 32, 116, 32,116,104,101,110, 10, 32, 32, 32,111,117,116,112,117, 116, 40, 39, 42, 39, 41, 10, 32, 32,101,110,100, 10, 32, 32, 111,117,116,112,117,116, 40, 39, 41, 32, 39, 41, 10, 32, 32, 108,111, 99, 97,108, 32,100,101,102, 32, 61, 32, 48, 10, 32, 32,105,102, 32,115,101,108,102, 46,100,101,102, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 32,100,101,102, 32, 61, 32, 115,101,108,102, 46,100,101,102, 32,101,110,100, 10, 32, 32, 105,102, 32,116, 32,116,104,101,110, 10, 32, 32, 32,111,117, 116,112,117,116, 40, 39,116,111,108,117, 97, 95,116,111,102, 105,101,108,100, 39, 46, 46,116, 46, 46, 39, 40,116,111,108, 117, 97, 95, 83, 44, 39, 44,110, 97,114,103, 44, 39, 44,105, 43, 49, 44, 39, 44,100,101,102, 44, 39, 41, 41, 59, 39, 41, 10, 32, 32,101,108,115,101, 10, 32, 32, 32,111,117,116,112, 117,116, 40, 39,116,111,108,117, 97, 95,116,111,102,105,101, 108,100,117,115,101,114,116,121,112,101, 40,116,111,108,117, 97, 95, 83, 44, 39, 44,110, 97,114,103, 44, 39, 44,105, 43, 49, 44, 39, 44,100,101,102, 44, 39, 41, 41, 59, 39, 41, 10, 32, 32,101,110,100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,125, 39, 41, 10, 32, 32,111,117,116,112,117, 116, 40, 39, 32, 32,125, 39, 41, 10, 32,101,110,100, 10,101, 110,100, 10, 10, 45, 45, 32, 71,101,116, 32,112, 97,114, 97, 109,101,116,101,114, 32,118, 97,108,117,101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 58,115,101,116, 97,114,114, 97, 121, 32, 40,110, 97,114,103, 41, 10, 32,105,102, 32,110,111, 116, 32,115,116,114,102,105,110,100, 40,115,101,108,102, 46, 116,121,112,101, 44, 39, 99,111,110,115,116, 37,115, 43, 39, 41, 32, 97,110,100, 32,115,101,108,102, 46,100,105,109, 32, 126, 61, 32, 39, 39, 32,116,104,101,110, 10, 9, 32,108,111, 99, 97,108, 32,116,121,112,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46,116,121,112,101, 44, 39, 99,111,110, 115,116, 32, 39, 44, 39, 39, 41, 10, 32, 32,111,117,116,112, 117,116, 40, 39, 32, 32,123, 39, 41, 10, 32, 32,111,117,116, 112,117,116, 40, 39, 32, 32, 32,105,110,116, 32,105, 59, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 102,111,114, 40,105, 61, 48, 59, 32,105, 60, 39, 46, 46,115, 101,108,102, 46,100,105,109, 46, 46, 39, 59,105, 43, 43, 41, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,116, 44, 99,116, 32, 61, 32,105,115, 98, 97,115,105, 99, 40,116,121,112,101, 41, 10, 32, 32,105,102, 32,116, 32,116,104,101,110, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,116, 111,108,117, 97, 95,112,117,115,104,102,105,101,108,100, 39, 46, 46,116, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 39, 44,110, 97,114,103, 44, 39, 44,105, 43, 49, 44, 40, 39, 44, 99,116, 44, 39, 41, 39, 44,115,101,108,102, 46,110, 97, 109,101, 44, 39, 91,105, 93, 41, 59, 39, 41, 10, 32, 32,101, 108,115,101, 10, 32, 32, 32,105,102, 32,115,101,108,102, 46, 112,116,114, 32, 61, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,123, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117, 116, 40, 39, 35,105,102,100,101,102, 32, 95, 95, 99,112,108, 117,115,112,108,117,115, 92,110, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,118,111, 105,100, 42, 32,116,111,108,117, 97, 95,111, 98,106, 32, 61, 32, 77,116,111,108,117, 97, 95,110,101,119, 40, 40, 39, 44, 116,121,112,101, 44, 39, 41, 40, 39, 44,115,101,108,102, 46, 110, 97,109,101, 44, 39, 91,105, 93, 41, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,116,111,108,117, 97, 95,112,117,115,104,102,105,101, 108,100,117,115,101,114,116,121,112,101, 95, 97,110,100, 95, 116, 97,107,101,111,119,110,101,114,115,104,105,112, 40,116, 111,108,117, 97, 95, 83, 44, 39, 44,110, 97,114,103, 44, 39, 44,105, 43, 49, 44,116,111,108,117, 97, 95,111, 98,106, 44, 34, 39, 44,116,121,112,101, 44, 39, 34, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 35,101, 108,115,101, 92,110, 39, 41, 10, 32, 32, 32, 32, 32,111,117, 116,112,117,116, 40, 39, 32, 32, 32, 32,118,111,105,100, 42, 32,116,111,108,117, 97, 95,111, 98,106, 32, 61, 32,116,111, 108,117, 97, 95, 99,111,112,121, 40,116,111,108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41, 38, 39, 44,115,101,108, 102, 46,110, 97,109,101, 44, 39, 91,105, 93, 44,115,105,122, 101,111,102, 40, 39, 44,116,121,112,101, 44, 39, 41, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,116,111,108,117, 97, 95,112,117,115,104, 102,105,101,108,100,117,115,101,114,116,121,112,101, 40,116, 111,108,117, 97, 95, 83, 44, 39, 44,110, 97,114,103, 44, 39, 44,105, 43, 49, 44,116,111,108,117, 97, 95,111, 98,106, 44, 34, 39, 44,116,121,112,101, 44, 39, 34, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 35,101, 110,100,105,102, 92,110, 39, 41, 10, 32, 32, 32, 32, 32,111, 117,116,112,117,116, 40, 39, 32, 32, 32,125, 39, 41, 10, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32,111,117,116,112, 117,116, 40, 39, 32, 32, 32,116,111,108,117, 97, 95,112,117, 115,104,102,105,101,108,100,117,115,101,114,116,121,112,101, 40,116,111,108,117, 97, 95, 83, 44, 39, 44,110, 97,114,103, 44, 39, 44,105, 43, 49, 44, 40,118,111,105,100, 42, 41, 39, 44,115,101,108,102, 46,110, 97,109,101, 44, 39, 91,105, 93, 44, 34, 39, 44,116,121,112,101, 44, 39, 34, 41, 59, 39, 41, 10, 32, 32, 32,101,110,100, 10, 32, 32,101,110,100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32,125, 39, 41, 10, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 70,114, 101,101, 32,100,121,110, 97,109,105, 99, 97,108,108,121, 32, 97,108,108,111, 99, 97,116,101,100, 32, 97,114,114, 97,121, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 58,102,114,101, 101, 97,114,114, 97,121, 32, 40, 41, 10, 32,105,102, 32,115, 101,108,102, 46,100,105,109, 32,126, 61, 32, 39, 39, 32, 97, 110,100, 32,116,111,110,117,109, 98,101,114, 40,115,101,108, 102, 46,100,105,109, 41, 61, 61,110,105,108, 32,116,104,101, 110, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35,105,102, 100,101,102, 32, 95, 95, 99,112,108,117,115,112,108,117,115, 92,110, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 77,116,111,108,117, 97, 95,100,101,108,101,116,101, 95,100,105,109, 40, 39, 44,115,101,108,102, 46,110, 97,109, 101, 44, 39, 41, 59, 39, 41, 10, 9, 32,111,117,116,112,117, 116, 40, 39, 35,101,108,115,101, 92,110, 39, 41, 10, 32, 32, 111,117,116,112,117,116, 40, 39, 32, 32,102,114,101,101, 40, 39, 44,115,101,108,102, 46,110, 97,109,101, 44, 39, 41, 59, 39, 41, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35,101, 110,100,105,102, 92,110, 39, 41, 10, 32,101,110,100, 10,101, 110,100, 10, 10, 45, 45, 32, 80, 97,115,115, 32,112, 97,114, 97,109,101,116,101,114, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105, 111,110, 58,112, 97,115,115,112, 97,114, 32, 40, 41, 10, 32, 105,102, 32,115,101,108,102, 46,112,116,114, 61, 61, 39, 38, 39, 32, 97,110,100, 32,110,111,116, 32,105,115, 98, 97,115, 105, 99, 40,115,101,108,102, 46,116,121,112,101, 41, 32,116, 104,101,110, 10, 32, 32,111,117,116,112,117,116, 40, 39, 42, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 41, 10, 32, 101,108,115,101,105,102, 32,115,101,108,102, 46,114,101,116, 61, 61, 39, 42, 39, 32,116,104,101,110, 10, 32, 32,111,117, 116,112,117,116, 40, 39, 38, 39, 46, 46,115,101,108,102, 46, 110, 97,109,101, 41, 10, 32,101,108,115,101, 10, 32, 32,111, 117,116,112,117,116, 40,115,101,108,102, 46,110, 97,109,101, 41, 10, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 82,101,116,117,114,110, 32,112, 97,114, 97,109,101,116,101, 114, 32,118, 97,108,117,101, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116, 105,111,110, 58,114,101,116,118, 97,108,117,101, 32, 40, 41, 10, 32,105,102, 32,115,101,108,102, 46,114,101,116, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 32,108,111, 99, 97,108, 32,116, 44, 99,116, 32, 61, 32,105,115, 98, 97,115, 105, 99, 40,115,101,108,102, 46,116,121,112,101, 41, 10, 32, 32,105,102, 32,116, 32, 97,110,100, 32,116,126, 61, 39, 39, 32,116,104,101,110, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,116,111,108,117, 97, 95,112,117,115,104, 39, 46, 46,116, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 40, 39, 44, 99,116, 44, 39, 41, 39, 46, 46,115,101,108, 102, 46,110, 97,109,101, 46, 46, 39, 41, 59, 39, 41, 10, 32, 32,101,108,115,101, 10, 32, 32, 32,108,111, 99, 97,108, 32, 112,117,115,104, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95,112,117,115,104, 95,102,117,110, 99,116,105,111,110, 40, 115,101,108,102, 46,116,121,112,101, 41, 10, 32, 32, 32,111, 117,116,112,117,116, 40, 39, 32, 32, 32, 39, 44,112,117,115, 104, 95,102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41, 39, 46, 46,115,101,108, 102, 46,110, 97,109,101, 46, 46, 39, 44, 34, 39, 44,115,101, 108,102, 46,116,121,112,101, 44, 39, 34, 41, 59, 39, 41, 10, 32, 32,101,110,100, 10, 32, 32,114,101,116,117,114,110, 32, 49, 10, 32,101,110,100, 10, 32,114,101,116,117,114,110, 32, 48, 10,101,110,100, 10, 10, 45, 45, 32, 73,110,116,101,114, 110, 97,108, 32, 99,111,110,115,116,114,117, 99,116,111,114, 10,102,117,110, 99,116,105,111,110, 32, 95, 68,101, 99,108, 97,114, 97,116,105,111,110, 32, 40,116, 41, 10, 10, 32,115, 101,116,109,101,116, 97,116, 97, 98,108,101, 40,116, 44, 99, 108, 97,115,115, 68,101, 99,108, 97,114, 97,116,105,111,110, 41, 10, 32,116, 58, 98,117,105,108,100,110, 97,109,101,115, 40, 41, 10, 32,116, 58, 99,104,101, 99,107,110, 97,109,101, 40, 41, 10, 32,116, 58, 99,104,101, 99,107,116,121,112,101, 40, 41, 10, 32,108,111, 99, 97,108, 32,102,116, 32, 61, 32, 102,105,110,100,116,121,112,101, 40,116, 46,116,121,112,101, 41, 32,111,114, 32,116, 46,116,121,112,101, 10, 32,105,102, 32,110,111,116, 32,105,115,101,110,117,109, 40,102,116, 41, 32,116,104,101,110, 10, 9,116, 46,109,111,100, 44, 32,116, 46,116,121,112,101, 32, 61, 32, 97,112,112,108,121,116,121, 112,101,100,101,102, 40,116, 46,109,111,100, 44, 32,102,116, 41, 10, 32,101,110,100, 10, 10, 32,105,102, 32,116, 46,107, 105,110,100, 61, 61, 34,118, 97,114, 34, 32, 97,110,100, 32, 40,115,116,114,105,110,103, 46,102,105,110,100, 40,116, 46, 109,111,100, 44, 32, 34,116,111,108,117, 97, 95,112,114,111, 112,101,114,116,121, 37,115, 34, 41, 32,111,114, 32,115,116, 114,105,110,103, 46,102,105,110,100, 40,116, 46,109,111,100, 44, 32, 34,116,111,108,117, 97, 95,112,114,111,112,101,114, 116,121, 36, 34, 41, 41, 32,116,104,101,110, 10, 32, 9,116, 46,109,111,100, 32, 61, 32,115,116,114,105,110,103, 46,103, 115,117, 98, 40,116, 46,109,111,100, 44, 32, 34,116,111,108, 117, 97, 95,112,114,111,112,101,114,116,121, 34, 44, 32, 34, 116,111,108,117, 97, 95,112,114,111,112,101,114,116,121, 95, 95, 34, 46, 46,103,101,116, 95,112,114,111,112,101,114,116, 121, 95,116,121,112,101, 40, 41, 41, 10, 32,101,110,100, 10, 10, 32,114,101,116,117,114,110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110,115,116,114,117, 99,116,111,114, 10, 45, 45, 32, 69,120,112,101, 99,116,115, 32,116,104,101, 32,115,116,114,105,110,103, 32,100,101, 99,108, 97,114, 97, 116,105,111,110, 46, 10, 45, 45, 32, 84,104,101, 32,107,105, 110,100, 32,111,102, 32,100,101, 99,108, 97,114, 97,116,105, 111,110, 32, 99, 97,110, 32, 98,101, 32, 34,118, 97,114, 34, 32,111,114, 32, 34,102,117,110, 99, 34, 46, 10,102,117,110, 99,116,105,111,110, 32, 68,101, 99,108, 97,114, 97,116,105, 111,110, 32, 40,115, 44,107,105,110,100, 44,105,115, 95,112, 97,114, 97,109,101,116,101,114, 41, 10, 10, 32, 45, 45, 32, 101,108,105,109,105,110, 97,116,101, 32,115,112, 97, 99,101, 115, 32,105,102, 32,100,101,102, 97,117,108,116, 32,118, 97, 108,117,101, 32,105,115, 32,112,114,111,118,105,100,101,100, 10, 32,115, 32, 61, 32,103,115,117, 98, 40,115, 44, 34, 37, 115, 42, 61, 37,115, 42, 34, 44, 34, 61, 34, 41, 10, 32,115, 32, 61, 32,103,115,117, 98, 40,115, 44, 32, 34, 37,115, 42, 60, 34, 44, 32, 34, 60, 34, 41, 10, 10, 32,108,111, 99, 97, 108, 32,100,101,102, 98, 44,116,109,112,100,101,102, 10, 32, 100,101,102, 98, 44, 95, 44,116,109,112,100,101,102, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,115, 44, 32, 34, 40, 61, 46, 42, 41, 36, 34, 41, 10, 32,105,102, 32, 100,101,102, 98, 32,116,104,101,110, 10, 32, 9,115, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,115, 44, 32, 34, 61, 46, 42, 36, 34, 44, 32, 34, 34, 41, 10, 32,101, 108,115,101, 10, 32, 9,116,109,112,100,101,102, 32, 61, 32, 39, 39, 10, 32,101,110,100, 10, 32,105,102, 32,107,105,110, 100, 32, 61, 61, 32, 34,118, 97,114, 34, 32,116,104,101,110, 10, 32, 32, 45, 45, 32, 99,104,101, 99,107, 32,116,104,101, 32,102,111,114,109, 58, 32,118,111,105,100, 10, 32, 32,105, 102, 32,115, 32, 61, 61, 32, 39, 39, 32,111,114, 32,115, 32, 61, 61, 32, 39,118,111,105,100, 39, 32,116,104,101,110, 10, 32, 32, 32,114,101,116,117,114,110, 32, 95, 68,101, 99,108, 97,114, 97,116,105,111,110,123,116,121,112,101, 32, 61, 32, 39,118,111,105,100, 39, 44, 32,107,105,110,100, 32, 61, 32, 107,105,110,100, 44, 32,105,115, 95,112, 97,114, 97,109,101, 116,101,114, 32, 61, 32,105,115, 95,112, 97,114, 97,109,101, 116,101,114,125, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,116,104,101, 32,102,111,114,109, 58, 32,109,111,100, 32,116,121,112,101, 42, 38, 32,110, 97,109,101, 10, 32,108,111, 99, 97,108, 32, 116, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116,111,107, 101,110,115, 40,115, 44, 39, 37, 42, 37,115, 42, 38, 39, 41, 10, 32,105,102, 32,116, 46,110, 32, 61, 61, 32, 50, 32,116, 104,101,110, 10, 32, 32,105,102, 32,107,105,110,100, 32, 61, 61, 32, 39,102,117,110, 99, 39, 32,116,104,101,110, 10, 32, 32, 32,101,114,114,111,114, 40, 34, 35,105,110,118, 97,108, 105,100, 32,102,117,110, 99,116,105,111,110, 32,114,101,116, 117,114,110, 32,116,121,112,101, 58, 32, 34, 46, 46,115, 41, 10, 32, 32,101,110,100, 10, 32, 32, 45, 45,108,111, 99, 97, 108, 32,109, 32, 61, 32,115,112,108,105,116, 40,116, 91, 49, 93, 44, 39, 37,115, 37,115, 42, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,109, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40,116, 91, 49, 93, 44, 39, 37, 115, 43, 39, 41, 10, 32, 32,114,101,116,117,114,110, 32, 95, 68,101, 99,108, 97,114, 97,116,105,111,110,123, 10, 32, 32, 32,110, 97,109,101, 32, 61, 32,116, 91, 50, 93, 46, 46,116, 109,112,100,101,102, 44, 10, 32, 32, 32,112,116,114, 32, 61, 32, 39, 42, 39, 44, 10, 32, 32, 32,114,101,116, 32, 61, 32, 39, 38, 39, 44, 10, 32, 32, 32, 45, 45,116,121,112,101, 32, 61, 32,114,101, 98,117,105,108,100, 95,116,101,109,112,108, 97,116,101, 40,109, 91,109, 46,110, 93, 44, 32,116, 98, 44, 32,116,105,109,112,108, 41, 44, 10, 32, 32, 32,116,121,112, 101, 32, 61, 32,109, 91,109, 46,110, 93, 44, 10, 32, 32, 32, 109,111,100, 32, 61, 32, 99,111,110, 99, 97,116, 40,109, 44, 49, 44,109, 46,110, 45, 49, 41, 44, 10, 32, 32, 32,105,115, 95,112, 97,114, 97,109,101,116,101,114, 32, 61, 32,105,115, 95,112, 97,114, 97,109,101,116,101,114, 44, 10, 32, 32, 32, 107,105,110,100, 32, 61, 32,107,105,110,100, 10, 32, 32,125, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 99,104,101, 99, 107, 32,116,104,101, 32,102,111,114,109, 58, 32,109,111,100, 32,116,121,112,101, 42, 42, 32,110, 97,109,101, 10, 32,116, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116,111,107,101, 110,115, 40,115, 44, 39, 37, 42, 37,115, 42, 37, 42, 39, 41, 10, 32,105,102, 32,116, 46,110, 32, 61, 61, 32, 50, 32,116, 104,101,110, 10, 32, 32,105,102, 32,107,105,110,100, 32, 61, 61, 32, 39,102,117,110, 99, 39, 32,116,104,101,110, 10, 32, 32, 32,101,114,114,111,114, 40, 34, 35,105,110,118, 97,108, 105,100, 32,102,117,110, 99,116,105,111,110, 32,114,101,116, 117,114,110, 32,116,121,112,101, 58, 32, 34, 46, 46,115, 41, 10, 32, 32,101,110,100, 10, 32, 32, 45, 45,108,111, 99, 97, 108, 32,109, 32, 61, 32,115,112,108,105,116, 40,116, 91, 49, 93, 44, 39, 37,115, 37,115, 42, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,109, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40,116, 91, 49, 93, 44, 39, 37, 115, 43, 39, 41, 10, 32, 32,114,101,116,117,114,110, 32, 95, 68,101, 99,108, 97,114, 97,116,105,111,110,123, 10, 32, 32, 32,110, 97,109,101, 32, 61, 32,116, 91, 50, 93, 46, 46,116, 109,112,100,101,102, 44, 10, 32, 32, 32,112,116,114, 32, 61, 32, 39, 42, 39, 44, 10, 32, 32, 32,114,101,116, 32, 61, 32, 39, 42, 39, 44, 10, 32, 32, 32, 45, 45,116,121,112,101, 32, 61, 32,114,101, 98,117,105,108,100, 95,116,101,109,112,108, 97,116,101, 40,109, 91,109, 46,110, 93, 44, 32,116, 98, 44, 32,116,105,109,112,108, 41, 44, 10, 32, 32, 32,116,121,112, 101, 32, 61, 32,109, 91,109, 46,110, 93, 44, 10, 32, 32, 32, 109,111,100, 32, 61, 32, 99,111,110, 99, 97,116, 40,109, 44, 49, 44,109, 46,110, 45, 49, 41, 44, 10, 32, 32, 32,105,115, 95,112, 97,114, 97,109,101,116,101,114, 32, 61, 32,105,115, 95,112, 97,114, 97,109,101,116,101,114, 44, 10, 32, 32, 32, 107,105,110,100, 32, 61, 32,107,105,110,100, 10, 32, 32,125, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 99,104,101, 99, 107, 32,116,104,101, 32,102,111,114,109, 58, 32,109,111,100, 32,116,121,112,101, 38, 32,110, 97,109,101, 10, 32,116, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116,111,107,101,110, 115, 40,115, 44, 39, 38, 39, 41, 10, 32,105,102, 32,116, 46, 110, 32, 61, 61, 32, 50, 32,116,104,101,110, 10, 32, 32, 45, 45,108,111, 99, 97,108, 32,109, 32, 61, 32,115,112,108,105, 116, 40,116, 91, 49, 93, 44, 39, 37,115, 37,115, 42, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,109, 32, 61, 32,115,112, 108,105,116, 95, 99, 95,116,111,107,101,110,115, 40,116, 91, 49, 93, 44, 39, 37,115, 43, 39, 41, 10, 32, 32,114,101,116, 117,114,110, 32, 95, 68,101, 99,108, 97,114, 97,116,105,111, 110,123, 10, 32, 32, 32,110, 97,109,101, 32, 61, 32,116, 91, 50, 93, 46, 46,116,109,112,100,101,102, 44, 10, 32, 32, 32, 112,116,114, 32, 61, 32, 39, 38, 39, 44, 10, 32, 32, 32, 45, 45,116,121,112,101, 32, 61, 32,114,101, 98,117,105,108,100, 95,116,101,109,112,108, 97,116,101, 40,109, 91,109, 46,110, 93, 44, 32,116, 98, 44, 32,116,105,109,112,108, 41, 44, 10, 32, 32, 32,116,121,112,101, 32, 61, 32,109, 91,109, 46,110, 93, 44, 10, 32, 32, 32,109,111,100, 32, 61, 32, 99,111,110, 99, 97,116, 40,109, 44, 49, 44,109, 46,110, 45, 49, 41, 44, 10, 32, 32, 32,105,115, 95,112, 97,114, 97,109,101,116,101, 114, 32, 61, 32,105,115, 95,112, 97,114, 97,109,101,116,101, 114, 44, 10, 32, 32, 32,107,105,110,100, 32, 61, 32,107,105, 110,100, 10, 32, 32,125, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,116,104,101, 32,102,111,114, 109, 58, 32,109,111,100, 32,116,121,112,101, 42, 32,110, 97, 109,101, 10, 32,108,111, 99, 97,108, 32,115, 49, 32, 61, 32, 103,115,117, 98, 40,115, 44, 34, 40, 37, 98, 92, 91, 92, 93, 41, 34, 44,102,117,110, 99,116,105,111,110, 32, 40,110, 41, 32,114,101,116,117,114,110, 32,103,115,117, 98, 40,110, 44, 39, 37, 42, 39, 44, 39, 92, 49, 39, 41, 32,101,110,100, 41, 10, 32,116, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116, 111,107,101,110,115, 40,115, 49, 44, 39, 37, 42, 39, 41, 10, 32,105,102, 32,116, 46,110, 32, 61, 61, 32, 50, 32,116,104, 101,110, 10, 32, 32,116, 91, 50, 93, 32, 61, 32,103,115,117, 98, 40,116, 91, 50, 93, 44, 39, 92, 49, 39, 44, 39, 37, 42, 39, 41, 32, 45, 45, 32,114,101,115,116,111,114,101, 32, 42, 32,105,110, 32,100,105,109,101,110,115,105,111,110, 32,101, 120,112,114,101,115,115,105,111,110, 10, 32, 32, 45, 45,108, 111, 99, 97,108, 32,109, 32, 61, 32,115,112,108,105,116, 40, 116, 91, 49, 93, 44, 39, 37,115, 37,115, 42, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,109, 32, 61, 32,115,112,108,105, 116, 95, 99, 95,116,111,107,101,110,115, 40,116, 91, 49, 93, 44, 39, 37,115, 43, 39, 41, 10, 32, 32,114,101,116,117,114, 110, 32, 95, 68,101, 99,108, 97,114, 97,116,105,111,110,123, 10, 32, 32, 32,110, 97,109,101, 32, 61, 32,116, 91, 50, 93, 46, 46,116,109,112,100,101,102, 44, 10, 32, 32, 32,112,116, 114, 32, 61, 32, 39, 42, 39, 44, 10, 32, 32, 32,116,121,112, 101, 32, 61, 32,109, 91,109, 46,110, 93, 44, 10, 32, 32, 32, 45, 45,116,121,112,101, 32, 61, 32,114,101, 98,117,105,108, 100, 95,116,101,109,112,108, 97,116,101, 40,109, 91,109, 46, 110, 93, 44, 32,116, 98, 44, 32,116,105,109,112,108, 41, 44, 10, 32, 32, 32,109,111,100, 32, 61, 32, 99,111,110, 99, 97, 116, 40,109, 44, 49, 44,109, 46,110, 45, 49, 41, 32, 32, 32, 44, 10, 32, 32, 32,105,115, 95,112, 97,114, 97,109,101,116, 101,114, 32, 61, 32,105,115, 95,112, 97,114, 97,109,101,116, 101,114, 44, 10, 32, 32, 32,107,105,110,100, 32, 61, 32,107, 105,110,100, 10, 32, 32,125, 10, 32,101,110,100, 10, 10, 32, 105,102, 32,107,105,110,100, 32, 61, 61, 32, 39,118, 97,114, 39, 32,116,104,101,110, 10, 32, 32, 45, 45, 32, 99,104,101, 99,107, 32,116,104,101, 32,102,111,114,109, 58, 32,109,111, 100, 32,116,121,112,101, 32,110, 97,109,101, 10, 32, 32, 45, 45,116, 32, 61, 32,115,112,108,105,116, 40,115, 44, 39, 37, 115, 37,115, 42, 39, 41, 10, 32, 32,116, 32, 61, 32,115,112, 108,105,116, 95, 99, 95,116,111,107,101,110,115, 40,115, 44, 39, 37,115, 43, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32, 118, 10, 32, 32,105,102, 32,102,105,110,100,116,121,112,101, 40,116, 91,116, 46,110, 93, 41, 32,116,104,101,110, 32,118, 32, 61, 32, 99,114,101, 97,116,101, 95,118, 97,114,110, 97, 109,101, 40, 41, 32,101,108,115,101, 32,118, 32, 61, 32,116, 91,116, 46,110, 93, 59, 32,116, 46,110, 32, 61, 32,116, 46, 110, 45, 49, 32,101,110,100, 10, 32, 32,114,101,116,117,114, 110, 32, 95, 68,101, 99,108, 97,114, 97,116,105,111,110,123, 10, 32, 32, 32,110, 97,109,101, 32, 61, 32,118, 46, 46,116, 109,112,100,101,102, 44, 10, 32, 32, 32, 45, 45,116,121,112, 101, 32, 61, 32,114,101, 98,117,105,108,100, 95,116,101,109, 112,108, 97,116,101, 40,116, 91,116, 46,110, 93, 44, 32,116, 98, 44, 32,116,105,109,112,108, 41, 44, 10, 32, 32, 32,116, 121,112,101, 32, 61, 32,116, 91,116, 46,110, 93, 44, 10, 32, 32, 32,109,111,100, 32, 61, 32, 99,111,110, 99, 97,116, 40, 116, 44, 49, 44,116, 46,110, 45, 49, 41, 44, 10, 32, 32, 32, 105,115, 95,112, 97,114, 97,109,101,116,101,114, 32, 61, 32, 105,115, 95,112, 97,114, 97,109,101,116,101,114, 44, 10, 32, 32, 32,107,105,110,100, 32, 61, 32,107,105,110,100, 10, 32, 32,125, 10, 10, 32,101,108,115,101, 32, 45, 45, 32,107,105, 110,100, 32, 61, 61, 32, 34,102,117,110, 99, 34, 10, 10, 32, 32, 45, 45, 32, 99,104,101, 99,107, 32,116,104,101, 32,102, 111,114,109, 58, 32,109,111,100, 32,116,121,112,101, 32,110, 97,109,101, 10, 32, 32, 45, 45,116, 32, 61, 32,115,112,108, 105,116, 40,115, 44, 39, 37,115, 37,115, 42, 39, 41, 10, 32, 32,116, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116,111, 107,101,110,115, 40,115, 44, 39, 37,115, 43, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,118, 32, 61, 32,116, 91,116, 46, 110, 93, 32, 32, 45, 45, 32,108, 97,115,116, 32,119,111,114, 100, 32,105,115, 32,116,104,101, 32,102,117,110, 99,116,105, 111,110, 32,110, 97,109,101, 10, 32, 32,108,111, 99, 97,108, 32,116,112, 44,109,100, 10, 32, 32,105,102, 32,116, 46,110, 62, 49, 32,116,104,101,110, 10, 32, 32, 32,116,112, 32, 61, 32,116, 91,116, 46,110, 45, 49, 93, 10, 32, 32, 32,109,100, 32, 61, 32, 99,111,110, 99, 97,116, 40,116, 44, 49, 44,116, 46,110, 45, 50, 41, 10, 32, 32,101,110,100, 10, 32, 32, 45, 45,105,102, 32,116,112, 32,116,104,101,110, 32,116,112, 32, 61, 32,114,101, 98,117,105,108,100, 95,116,101,109,112,108, 97,116,101, 40,116,112, 44, 32,116, 98, 44, 32,116,105,109, 112,108, 41, 32,101,110,100, 10, 32, 32,114,101,116,117,114, 110, 32, 95, 68,101, 99,108, 97,114, 97,116,105,111,110,123, 10, 32, 32, 32,110, 97,109,101, 32, 61, 32,118, 44, 10, 32, 32, 32,116,121,112,101, 32, 61, 32,116,112, 44, 10, 32, 32, 32,109,111,100, 32, 61, 32,109,100, 44, 10, 32, 32, 32,105, 115, 95,112, 97,114, 97,109,101,116,101,114, 32, 61, 32,105, 115, 95,112, 97,114, 97,109,101,116,101,114, 44, 10, 32, 32, 32,107,105,110,100, 32, 61, 32,107,105,110,100, 10, 32, 32, 125, 10, 32,101,110,100, 10, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/declaration.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,118, 97,114,105, 97, 98,108,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114, 105,116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73, 100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99, 111,100,101, 32,105,115, 32,102,114,101,101, 32,115,111,102, 116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32, 114,101,100,105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32, 105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116, 119, 97,114,101, 32,112,114,111,118,105,100,101,100, 32,104, 101,114,101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105, 115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97, 117,116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98, 108,105,103, 97,116,105,111,110, 32,116,111, 32,112,114,111, 118,105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99, 101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99, 101,109,101,110,116,115, 44, 32,111,114, 32,109,111,100,105, 102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 45, 45, 32, 86, 97,114,105, 97, 98,108,101, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101,115,101,110,116,115, 32, 97, 32,101,120,116,101,114,110, 32,118, 97,114,105, 97, 98, 108,101, 32,111,114, 32, 97, 32,112,117, 98,108,105, 99, 32, 109,101,109, 98,101,114, 32,111,102, 32, 97, 32, 99,108, 97, 115,115, 46, 10, 45, 45, 32, 83,116,111,114,101,115, 32, 97, 108,108, 32,102,105,101,108,100,115, 32,112,114,101,115,101, 110,116, 32,105,110, 32, 97, 32,100,101, 99,108, 97,114, 97, 116,105,111,110, 46, 10, 99,108, 97,115,115, 86, 97,114,105, 97, 98,108,101, 32, 61, 32,123, 10, 32, 95,103,101,116, 32, 61, 32,123,125, 44, 32, 32, 32, 45, 45, 32,109, 97,112,112, 101,100, 32,103,101,116, 32,102,117,110, 99,116,105,111,110, 115, 10, 32, 95,115,101,116, 32, 61, 32,123,125, 44, 32, 32, 32, 45, 45, 32,109, 97,112,112,101,100, 32,115,101,116, 32, 102,117,110, 99,116,105,111,110,115, 10,125, 10, 99,108, 97, 115,115, 86, 97,114,105, 97, 98,108,101, 46, 95, 95,105,110, 100,101,120, 32, 61, 32, 99,108, 97,115,115, 86, 97,114,105, 97, 98,108,101, 10,115,101,116,109,101,116, 97,116, 97, 98, 108,101, 40, 99,108, 97,115,115, 86, 97,114,105, 97, 98,108, 101, 44, 99,108, 97,115,115, 68,101, 99,108, 97,114, 97,116, 105,111,110, 41, 10, 10, 45, 45, 32, 80,114,105,110,116, 32, 109,101,116,104,111,100, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 86, 97,114,105, 97, 98,108,101, 58, 112,114,105,110,116, 32, 40,105,100,101,110,116, 44, 99,108, 111,115,101, 41, 10, 32,112,114,105,110,116, 40,105,100,101, 110,116, 46, 46, 34, 86, 97,114,105, 97, 98,108,101,123, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,109,111,100, 32, 32, 61, 32, 39, 34, 46, 46,115, 101,108,102, 46,109,111,100, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,116,121,112,101, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46,116,121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32, 112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 112,116,114, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,112,116,114, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114, 105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,110, 97, 109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,105,102, 32, 115,101,108,102, 46,100,105,109, 32,116,104,101,110, 32,112, 114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,100, 105,109, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,100, 105,109, 46, 46, 34, 39, 44, 34, 41, 32,101,110,100, 10, 32, 112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 100,101,102, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,100,101,102, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114, 105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,114,101, 116, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,114, 101,116, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110, 116, 40,105,100,101,110,116, 46, 46, 34,125, 34, 46, 46, 99, 108,111,115,101, 41, 10,101,110,100, 10, 10, 45, 45, 32, 71, 101,110,101,114, 97,116,101,115, 32, 67, 32,102,117,110, 99, 116,105,111,110, 32,110, 97,109,101, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 86, 97,114,105, 97, 98, 108,101, 58, 99,102,117,110, 99,110, 97,109,101, 32, 40,112, 114,101,102,105,120, 41, 10, 32,108,111, 99, 97,108, 32,112, 97,114,101,110,116, 32, 61, 32, 34, 34, 10, 32,108,111, 99, 97,108, 32,117,110,115,105,103,110,101,100, 32, 61, 32, 34, 34, 10, 32,108,111, 99, 97,108, 32,112,116,114, 32, 61, 32, 34, 34, 10, 10, 32,108,111, 99, 97,108, 32,112, 32, 61, 32, 115,101,108,102, 58,105,110,109,111,100,117,108,101, 40, 41, 32,111,114, 32,115,101,108,102, 58,105,110,110, 97,109,101, 115,112, 97, 99,101, 40, 41, 32,111,114, 32,115,101,108,102, 58,105,110, 99,108, 97,115,115, 40, 41, 10, 10, 32,105,102, 32,112, 32,116,104,101,110, 10, 32, 9,105,102, 32,115,101, 108,102, 46,112, 97,114,101,110,116, 46, 99,108, 97,115,115, 116,121,112,101, 32, 61, 61, 32, 39, 99,108, 97,115,115, 39, 32,116,104,101,110, 10, 9, 9,112, 97,114,101,110,116, 32, 61, 32, 34, 95, 34, 32, 46, 46, 32,115,101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 10, 9,101,108,115, 101, 10, 9, 32, 32,112, 97,114,101,110,116, 32, 61, 32, 34, 95, 34, 32, 46, 46, 32,112, 10, 9,101,110,100, 10, 32,101, 110,100, 10, 10, 32,105,102, 32,115,116,114,102,105,110,100, 40,115,101,108,102, 46,109,111,100, 44, 34, 40,117,110,115, 105,103,110,101,100, 41, 34, 41, 32,116,104,101,110, 10, 32, 32,117,110,115,105,103,110,101,100, 32, 61, 32, 34, 95,117, 110,115,105,103,110,101,100, 34, 10, 32,101,110,100, 10, 10, 32,105,102, 32,115,101,108,102, 46,112,116,114, 32, 61, 61, 32, 34, 42, 34, 32,116,104,101,110, 32,112,116,114, 32, 61, 32, 34, 95,112,116,114, 34, 10, 32,101,108,115,101,105,102, 32,115,101,108,102, 46,112,116,114, 32, 61, 61, 32, 34, 38, 34, 32,116,104,101,110, 32,112,116,114, 32, 61, 32, 34, 95, 114,101,102, 34, 10, 32,101,110,100, 10, 10, 32,108,111, 99, 97,108, 32,110, 97,109,101, 32, 61, 32, 32,112,114,101,102, 105,120, 32, 46, 46, 32,112, 97,114,101,110,116, 32, 46, 46, 32,117,110,115,105,103,110,101,100, 32, 46, 46, 32, 34, 95, 34, 32, 46, 46, 32,103,115,117, 98, 40,115,101,108,102, 46, 108,110, 97,109,101, 32,111,114, 32,115,101,108,102, 46,110, 97,109,101, 44, 34, 46, 42, 58, 58, 34, 44, 34, 34, 41, 32, 46, 46, 32,112,116,114, 10, 10, 9,110, 97,109,101, 32, 61, 32, 99,108,101, 97,110, 95,116,101,109,112,108, 97,116,101, 40,110, 97,109,101, 41, 10, 32,114,101,116,117,114,110, 32, 110, 97,109,101, 10, 10,101,110,100, 10, 10, 45, 45, 32, 99, 104,101, 99,107, 32,105,102, 32,105,116, 32,105,115, 32, 97, 32,118, 97,114,105, 97, 98,108,101, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 86, 97,114,105, 97, 98, 108,101, 58,105,115,118, 97,114,105, 97, 98,108,101, 32, 40, 41, 10, 32,114,101,116,117,114,110, 32,116,114,117,101, 10, 101,110,100, 10, 10, 45, 45, 32,103,101,116, 32,118, 97,114, 105, 97, 98,108,101, 32,118, 97,108,117,101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 86, 97,114,105, 97, 98,108,101, 58,103,101,116,118, 97,108,117,101, 32, 40, 99,108, 97,115,115, 44,115,116, 97,116,105, 99, 44, 32,112, 114,111,112, 95,103,101,116, 41, 10, 10, 9,108,111, 99, 97, 108, 32,110, 97,109,101, 10, 9,105,102, 32,112,114,111,112, 95,103,101,116, 32,116,104,101,110, 10, 10, 9, 9,110, 97, 109,101, 32, 61, 32,112,114,111,112, 95,103,101,116, 46, 46, 34, 40, 41, 34, 10, 9,101,108,115,101, 10, 9, 9,110, 97, 109,101, 32, 61, 32,115,101,108,102, 46,110, 97,109,101, 10, 9,101,110,100, 10, 10, 9,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,116, 97,116,105, 99, 32,116,104,101, 110, 10, 9, 32,114,101,116,117,114,110, 32,115,101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 46, 46, 39, 58, 58, 39, 46, 46,110, 97,109,101, 10, 9,101,108,115,101, 105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 10, 9, 32,114,101,116,117,114,110, 32, 39,115,101,108,102, 45, 62, 39, 46, 46,110, 97,109,101, 10, 9,101,108,115,101, 10, 9, 32,114,101,116,117,114,110, 32,110, 97,109,101, 10, 9,101, 110,100, 10,101,110,100, 10, 10, 45, 45, 32,103,101,116, 32, 118, 97,114,105, 97, 98,108,101, 32,112,111,105,110,116,101, 114, 32,118, 97,108,117,101, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 86, 97,114,105, 97, 98,108,101, 58,103,101,116,112,111,105,110,116,101,114,118, 97,108,117, 101, 32, 40, 99,108, 97,115,115, 44,115,116, 97,116,105, 99, 41, 10, 32,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,116, 97,116,105, 99, 32,116,104,101,110, 10, 32, 32, 114,101,116,117,114,110, 32, 99,108, 97,115,115, 46, 46, 39, 58, 58,112, 39, 10, 32,101,108,115,101,105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 10, 32, 32,114,101,116,117, 114,110, 32, 39,115,101,108,102, 45, 62,112, 39, 10, 32,101, 108,115,101, 10, 32, 32,114,101,116,117,114,110, 32, 39,112, 39, 10, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 87,114,105,116,101, 32, 98,105,110,100,105,110,103, 32,102, 117,110, 99,116,105,111,110,115, 10,102,117,110, 99,116,105, 111,110, 32, 99,108, 97,115,115, 86, 97,114,105, 97, 98,108, 101, 58,115,117,112, 99,111,100,101, 32, 40, 41, 10, 10, 32, 108,111, 99, 97,108, 32, 99,108, 97,115,115, 32, 61, 32,115, 101,108,102, 58,105,110, 99,108, 97,115,115, 40, 41, 10, 10, 9,108,111, 99, 97,108, 32,112,114,111,112, 95,103,101,116, 44,112,114,111,112, 95,115,101,116, 10, 9,105,102, 32,115, 116,114,105,110,103, 46,102,105,110,100, 40,115,101,108,102, 46,109,111,100, 44, 32, 39,116,111,108,117, 97, 95,112,114, 111,112,101,114,116,121, 39, 41, 32,116,104,101,110, 10, 10, 9, 9,108,111, 99, 97,108, 32, 95, 44, 95, 44,116,121,112, 101, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,115,101,108,102, 46,109,111,100, 44, 32, 34,116,111,108, 117, 97, 95,112,114,111,112,101,114,116,121, 95, 95, 40, 91, 94, 37,115, 93, 42, 41, 34, 41, 10, 9, 9,116,121,112,101, 32, 61, 32,116,121,112,101, 32,111,114, 32, 34,100,101,102, 97,117,108,116, 34, 10, 9, 9,112,114,111,112, 95,103,101, 116, 44,112,114,111,112, 95,115,101,116, 32, 61, 32,103,101, 116, 95,112,114,111,112,101,114,116,121, 95,109,101,116,104, 111,100,115, 40,116,121,112,101, 44, 32,115,101,108,102, 46, 110, 97,109,101, 41, 10, 9, 9,115,101,108,102, 46,109,111, 100, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,115,101,108,102, 46,109,111,100, 44, 32, 34,116,111,108, 117, 97, 95,112,114,111,112,101,114,116,121, 91, 94, 37,115, 93, 42, 34, 44, 32, 34, 34, 41, 10, 9,101,110,100, 10, 10, 32, 45, 45, 32,103,101,116, 32,102,117,110, 99,116,105,111, 110, 32, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 32,105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 10, 32, 32,111,117,116,112,117,116, 40, 34, 47, 42, 32,103,101,116, 32,102,117,110, 99,116,105,111, 110, 58, 34, 44,115,101,108,102, 46,110, 97,109,101, 44, 34, 32,111,102, 32, 99,108, 97,115,115, 32, 34, 44, 99,108, 97, 115,115, 44, 34, 32, 42, 47, 34, 41, 10, 32,101,108,115,101, 10, 32, 32,111,117,116,112,117,116, 40, 34, 47, 42, 32,103, 101,116, 32,102,117,110, 99,116,105,111,110, 58, 34, 44,115, 101,108,102, 46,110, 97,109,101, 44, 34, 32, 42, 47, 34, 41, 10, 32,101,110,100, 10, 32,115,101,108,102, 46, 99,103,101, 116,110, 97,109,101, 32, 61, 32,115,101,108,102, 58, 99,102, 117,110, 99,110, 97,109,101, 40, 34,116,111,108,117, 97, 95, 103,101,116, 34, 41, 10, 32,111,117,116,112,117,116, 40, 34, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 95, 34, 46, 46,115,101,108,102, 46, 99,103,101,116,110, 97,109,101, 41, 10, 32,111,117,116,112, 117,116, 40, 34, 92,110,115,116, 97,116,105, 99, 32,105,110, 116, 34, 44,115,101,108,102, 46, 99,103,101,116,110, 97,109, 101, 44, 34, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32, 116,111,108,117, 97, 95, 83, 41, 34, 41, 10, 32,111,117,116, 112,117,116, 40, 34,123, 34, 41, 10, 10, 32, 45, 45, 32,100, 101, 99,108, 97,114,101, 32,115,101,108,102, 44, 32,105,102, 32,116,104,101, 32, 99, 97,115,101, 10, 32,108,111, 99, 97, 108, 32, 95, 44, 95, 44,115,116, 97,116,105, 99, 32, 61, 32, 115,116,114,102,105,110,100, 40,115,101,108,102, 46,109,111, 100, 44, 39, 94, 37,115, 42, 40,115,116, 97,116,105, 99, 41, 39, 41, 10, 32,105,102, 32, 99,108, 97,115,115, 32, 97,110, 100, 32,115,116, 97,116,105, 99, 61, 61,110,105,108, 32,116, 104,101,110, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 39, 44,115,101,108,102, 46,112, 97,114,101,110,116, 46,116, 121,112,101, 44, 39, 42, 39, 44, 39,115,101,108,102, 32, 61, 32, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 40, 39, 44,115,101,108,102, 46,112, 97,114,101,110,116, 46,116, 121,112,101, 44, 39, 42, 41, 32, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,116,111, 95,102,117,110, 99, 32, 61, 32,103, 101,116, 95,116,111, 95,102,117,110, 99,116,105,111,110, 40, 115,101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112, 101, 41, 10, 32, 32,111,117,116,112,117,116, 40,116,111, 95, 102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 49, 44, 48, 41, 59, 39, 41, 10, 32,101,108,115,101,105,102, 32,115,116, 97,116,105, 99, 32,116,104,101,110, 10, 32, 32, 95, 44, 95, 44,115,101,108,102, 46,109,111,100, 32, 61, 32, 115,116,114,102,105,110,100, 40,115,101,108,102, 46,109,111, 100, 44, 39, 94, 37,115, 42,115,116, 97,116,105, 99, 37,115, 37,115, 42, 40, 46, 42, 41, 39, 41, 10, 32,101,110,100, 10, 10, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,115,101,108, 102, 32,118, 97,108,117,101, 10, 32,105,102, 32, 99,108, 97, 115,115, 32, 97,110,100, 32,115,116, 97,116,105, 99, 61, 61, 110,105,108, 32,116,104,101,110, 10, 9, 32,111,117,116,112, 117,116, 40, 39, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32,105,102, 32, 40, 33,115,101,108,102, 41, 32,116,111,108,117, 97, 95,101, 114,114,111,114, 40,116,111,108,117, 97, 95, 83, 44, 34,105, 110,118, 97,108,105,100, 32, 92, 39,115,101,108,102, 92, 39, 32,105,110, 32, 97, 99, 99,101,115,115,105,110,103, 32,118, 97,114,105, 97, 98,108,101, 32, 92, 39, 39, 46, 46,115,101, 108,102, 46,110, 97,109,101, 46, 46, 39, 92, 39, 34, 44, 78, 85, 76, 76, 41, 59, 39, 41, 59, 10, 9, 9,111,117,116,112, 117,116, 40, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32,114,101,116,117,114, 110, 32,118, 97,108,117,101, 10, 32,105,102, 32,115,116,114, 105,110,103, 46,102,105,110,100, 40,115,101,108,102, 46,109, 111,100, 44, 32, 39,116,111,108,117, 97, 95,105,110,104,101, 114,105,116,115, 39, 41, 32,116,104,101,110, 10, 9,108,111, 99, 97,108, 32,112,117,115,104, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95,112,117,115,104, 95,102,117,110, 99,116, 105,111,110, 40,115,101,108,102, 46,116,121,112,101, 41, 10, 32, 9,111,117,116,112,117,116, 40, 39, 35,105,102,100,101, 102, 32, 95, 95, 99,112,108,117,115,112,108,117,115, 92,110, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 32, 32, 39, 44,112,117,115,104, 95,102,117,110, 99, 44, 39, 40,116,111, 108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41,115,116, 97,116,105, 99, 95, 99, 97,115,116, 60, 39, 46, 46,115,101, 108,102, 46,116,121,112,101, 46, 46, 39, 42, 62, 40,115,101, 108,102, 41, 44, 32, 34, 39, 44,115,101,108,102, 46,116,121, 112,101, 44, 39, 34, 41, 59, 39, 41, 10, 9,111,117,116,112, 117,116, 40, 39, 35,101,108,115,101, 92,110, 39, 41, 10, 9, 111,117,116,112,117,116, 40, 39, 32, 32, 39, 44,112,117,115, 104, 95,102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41, 40, 40, 39, 46, 46,115, 101,108,102, 46,116,121,112,101, 46, 46, 39, 42, 41,115,101, 108,102, 41, 44, 32, 34, 39, 44,115,101,108,102, 46,116,121, 112,101, 44, 39, 34, 41, 59, 39, 41, 10, 9,111,117,116,112, 117,116, 40, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 32,101,108,115,101, 10, 9,108,111, 99, 97,108, 32,116, 44, 99,116, 32, 61, 32,105,115, 98, 97,115,105, 99, 40,115,101, 108,102, 46,116,121,112,101, 41, 10, 9,105,102, 32,116, 32, 116,104,101,110, 10, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32,116,111,108,117, 97, 95,112,117,115,104, 39, 46, 46, 116, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 40, 39, 44, 99,116, 44, 39, 41, 39, 46, 46,115,101,108,102, 58,103, 101,116,118, 97,108,117,101, 40, 99,108, 97,115,115, 44,115, 116, 97,116,105, 99, 44,112,114,111,112, 95,103,101,116, 41, 46, 46, 39, 41, 59, 39, 41, 10, 9,101,108,115,101, 10, 9, 9,108,111, 99, 97,108, 32,112,117,115,104, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95,112,117,115,104, 95,102,117, 110, 99,116,105,111,110, 40,115,101,108,102, 46,116,121,112, 101, 41, 10, 9, 9,116, 32, 61, 32,115,101,108,102, 46,116, 121,112,101, 10, 9, 9,105,102, 32,115,101,108,102, 46,112, 116,114, 32, 61, 61, 32, 39, 38, 39, 32,111,114, 32,115,101, 108,102, 46,112,116,114, 32, 61, 61, 32, 39, 39, 32,116,104, 101,110, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 39, 44,112,117,115,104, 95,102,117,110, 99, 44, 39, 40, 116,111,108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41, 38, 39, 46, 46,115,101,108,102, 58,103,101,116,118, 97,108, 117,101, 40, 99,108, 97,115,115, 44,115,116, 97,116,105, 99, 44,112,114,111,112, 95,103,101,116, 41, 46, 46, 39, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 9, 9,101,108, 115,101, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 39, 44,112,117,115,104, 95,102,117,110, 99, 44, 39, 40, 116,111,108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41, 39, 46, 46,115,101,108,102, 58,103,101,116,118, 97,108,117, 101, 40, 99,108, 97,115,115, 44,115,116, 97,116,105, 99, 44, 112,114,111,112, 95,103,101,116, 41, 46, 46, 39, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10, 32,101,110,100, 10, 32,111,117,116, 112,117,116, 40, 39, 32,114,101,116,117,114,110, 32, 49, 59, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39,125, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 35,101,110,100,105, 102, 32, 47, 47, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 92,110, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 92,110, 39, 41, 10, 10, 32, 45, 45, 32,115,101,116, 32,102,117,110, 99,116,105,111, 110, 32, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 32,105,102, 32,110,111,116, 32, 40, 115,116,114,102,105,110,100, 40,115,101,108,102, 46,116,121, 112,101, 44, 39, 99,111,110,115,116, 37,115, 43, 39, 41, 32, 111,114, 32,115,116,114,105,110,103, 46,102,105,110,100, 40, 115,101,108,102, 46,109,111,100, 44, 32, 39,116,111,108,117, 97, 95,114,101, 97,100,111,110,108,121, 39, 41, 32,111,114, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,115,101, 108,102, 46,109,111,100, 44, 32, 39,116,111,108,117, 97, 95, 105,110,104,101,114,105,116,115, 39, 41, 41, 32, 32,116,104, 101,110, 10, 32, 32,105,102, 32, 99,108, 97,115,115, 32,116, 104,101,110, 10, 32, 32, 32,111,117,116,112,117,116, 40, 34, 47, 42, 32,115,101,116, 32,102,117,110, 99,116,105,111,110, 58, 34, 44,115,101,108,102, 46,110, 97,109,101, 44, 34, 32, 111,102, 32, 99,108, 97,115,115, 32, 34, 44, 99,108, 97,115, 115, 44, 34, 32, 42, 47, 34, 41, 10, 32, 32,101,108,115,101, 10, 32, 32, 32,111,117,116,112,117,116, 40, 34, 47, 42, 32, 115,101,116, 32,102,117,110, 99,116,105,111,110, 58, 34, 44, 115,101,108,102, 46,110, 97,109,101, 44, 34, 32, 42, 47, 34, 41, 10, 32, 32,101,110,100, 10, 32, 32,115,101,108,102, 46, 99,115,101,116,110, 97,109,101, 32, 61, 32,115,101,108,102, 58, 99,102,117,110, 99,110, 97,109,101, 40, 34,116,111,108, 117, 97, 95,115,101,116, 34, 41, 10, 32, 32,111,117,116,112, 117,116, 40, 34, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 95, 34, 46, 46,115, 101,108,102, 46, 99,115,101,116,110, 97,109,101, 41, 10, 32, 32,111,117,116,112,117,116, 40, 34, 92,110,115,116, 97,116, 105, 99, 32,105,110,116, 34, 44,115,101,108,102, 46, 99,115, 101,116,110, 97,109,101, 44, 34, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32,116,111,108,117, 97, 95, 83, 41, 34, 41, 10, 32, 32,111,117,116,112,117,116, 40, 34,123, 34, 41, 10, 10, 32, 32, 45, 45, 32,100,101, 99,108, 97,114,101, 32,115, 101,108,102, 44, 32,105,102, 32,116,104,101, 32, 99, 97,115, 101, 10, 32, 32,105,102, 32, 99,108, 97,115,115, 32, 97,110, 100, 32,115,116, 97,116,105, 99, 61, 61,110,105,108, 32,116, 104,101,110, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 39, 44,115,101,108,102, 46,112, 97,114,101,110,116, 46, 116,121,112,101, 44, 39, 42, 39, 44, 39,115,101,108,102, 32, 61, 32, 39, 41, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 40, 39, 44,115,101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 44, 39, 42, 41, 32, 39, 41, 10, 32, 32, 32,108,111, 99, 97,108, 32,116,111, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95,116,111, 95,102,117,110, 99,116,105, 111,110, 40,115,101,108,102, 46,112, 97,114,101,110,116, 46, 116,121,112,101, 41, 10, 32, 32, 32,111,117,116,112,117,116, 40,116,111, 95,102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 49, 44, 48, 41, 59, 39, 41, 10, 32, 32, 32, 45, 45, 32, 99,104,101, 99,107, 32,115,101,108,102, 32,118, 97,108,117,101, 10, 9, 9,101,110,100, 10, 32, 32, 45, 45, 32, 99,104,101, 99,107, 32,116,121,112,101,115, 10, 9, 9, 111,117,116,112,117,116, 40, 39, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92, 110, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32,116,111,108,117, 97, 95, 69,114,114,111,114, 32,116,111, 108,117, 97, 95,101,114,114, 59, 39, 41, 10, 32, 32,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,116, 97,116, 105, 99, 61, 61,110,105,108, 32,116,104,101,110, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32,105,102, 32, 40, 33,115,101,108,102, 41, 32,116,111,108,117, 97, 95,101,114, 114,111,114, 40,116,111,108,117, 97, 95, 83, 44, 34,105,110, 118, 97,108,105,100, 32, 92, 39,115,101,108,102, 92, 39, 32, 105,110, 32, 97, 99, 99,101,115,115,105,110,103, 32,118, 97, 114,105, 97, 98,108,101, 32, 92, 39, 39, 46, 46,115,101,108, 102, 46,110, 97,109,101, 46, 46, 39, 92, 39, 34, 44, 78, 85, 76, 76, 41, 59, 39, 41, 59, 10, 32, 32,101,108,115,101,105, 102, 32,115,116, 97,116,105, 99, 32,116,104,101,110, 10, 32, 32, 32, 95, 44, 95, 44,115,101,108,102, 46,109,111,100, 32, 61, 32,115,116,114,102,105,110,100, 40,115,101,108,102, 46, 109,111,100, 44, 39, 94, 37,115, 42,115,116, 97,116,105, 99, 37,115, 37,115, 42, 40, 46, 42, 41, 39, 41, 10, 32, 32,101, 110,100, 10, 10, 32, 32, 45, 45, 32, 99,104,101, 99,107, 32, 118, 97,114,105, 97, 98,108,101, 32,116,121,112,101, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32,105,102, 32, 40, 39, 46, 46,115,101,108,102, 58,111,117,116, 99,104,101, 99, 107,116,121,112,101, 40, 50, 41, 46, 46, 39, 41, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,116,111, 108,117, 97, 95,101,114,114,111,114, 40,116,111,108,117, 97, 95, 83, 44, 34, 35,118,105,110,118, 97,108,105,100, 32,116, 121,112,101, 32,105,110, 32,118, 97,114,105, 97, 98,108,101, 32, 97,115,115,105,103,110,109,101,110,116, 46, 34, 44, 38, 116,111,108,117, 97, 95,101,114,114, 41, 59, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 10, 32, 32, 45, 45, 32, 97,115,115,105, 103,110, 32,118, 97,108,117,101, 10, 9, 9,108,111, 99, 97, 108, 32,100,101,102, 32, 61, 32, 48, 10, 9, 9,105,102, 32, 115,101,108,102, 46,100,101,102, 32,126, 61, 32, 39, 39, 32, 116,104,101,110, 32,100,101,102, 32, 61, 32,115,101,108,102, 46,100,101,102, 32,101,110,100, 10, 9, 9,105,102, 32,115, 101,108,102, 46,116,121,112,101, 32, 61, 61, 32, 39, 99,104, 97,114, 42, 39, 32, 97,110,100, 32,115,101,108,102, 46,100, 105,109, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 32, 45, 45, 32,105,115, 32,115,116,114,105,110,103, 10, 9, 9, 32, 111,117,116,112,117,116, 40, 39, 32,115,116,114,110, 99,112, 121, 40, 39, 41, 10, 9, 9, 9,105,102, 32, 99,108, 97,115, 115, 32, 97,110,100, 32,115,116, 97,116,105, 99, 32,116,104, 101,110, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40,115, 101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 46, 46, 39, 58, 58, 39, 46, 46,115,101,108,102, 46,110, 97, 109,101, 41, 10, 9, 9, 9,101,108,115,101,105,102, 32, 99, 108, 97,115,115, 32,116,104,101,110, 10, 9, 9, 9, 9,111, 117,116,112,117,116, 40, 39,115,101,108,102, 45, 62, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 41, 10, 9, 9, 9, 101,108,115,101, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40,115,101,108,102, 46,110, 97,109,101, 41, 10, 9, 9, 9, 101,110,100, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 44,116,111,108,117, 97, 95,116,111,115,116,114,105,110,103, 40,116,111,108,117, 97, 95, 83, 44, 50, 44, 39, 44,100,101, 102, 44, 39, 41, 44, 39, 44,115,101,108,102, 46,100,105,109, 44, 39, 45, 49, 41, 59, 39, 41, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,108,111, 99, 97,108, 32,112,116,114, 32, 61, 32, 39, 39, 10, 9, 9, 9,105,102, 32,115,101,108,102, 46, 112,116,114,126, 61, 39, 39, 32,116,104,101,110, 32,112,116, 114, 32, 61, 32, 39, 42, 39, 32,101,110,100, 10, 9, 9, 9, 111,117,116,112,117,116, 40, 39, 32, 39, 41, 10, 9, 9, 9, 108,111, 99, 97,108, 32,110, 97,109,101, 32, 61, 32,112,114, 111,112, 95,115,101,116, 32,111,114, 32,115,101,108,102, 46, 110, 97,109,101, 10, 9, 9, 9,105,102, 32, 99,108, 97,115, 115, 32, 97,110,100, 32,115,116, 97,116,105, 99, 32,116,104, 101,110, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40,115, 101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 46, 46, 39, 58, 58, 39, 46, 46,110, 97,109,101, 41, 10, 9, 9, 9,101,108,115,101,105,102, 32, 99,108, 97,115,115, 32, 116,104,101,110, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40, 39,115,101,108,102, 45, 62, 39, 46, 46,110, 97,109,101, 41, 10, 9, 9, 9,101,108,115,101, 10, 9, 9, 9, 9,111, 117,116,112,117,116, 40,110, 97,109,101, 41, 10, 9, 9, 9, 101,110,100, 10, 9, 9, 9,108,111, 99, 97,108, 32,116, 32, 61, 32,105,115, 98, 97,115,105, 99, 40,115,101,108,102, 46, 116,121,112,101, 41, 10, 9, 9, 9,105,102, 32,112,114,111, 112, 95,115,101,116, 32,116,104,101,110, 10, 9, 9, 9, 9, 111,117,116,112,117,116, 40, 39, 40, 39, 41, 10, 9, 9, 9, 101,108,115,101, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 61, 32, 39, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9, 9,105,102, 32,110,111,116, 32,116, 32, 97,110,100, 32,112,116,114, 61, 61, 39, 39, 32,116,104,101,110, 32,111, 117,116,112,117,116, 40, 39, 42, 39, 41, 32,101,110,100, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 40, 40, 39, 44, 115,101,108,102, 46,109,111,100, 44,115,101,108,102, 46,116, 121,112,101, 41, 10, 9, 9, 9,105,102, 32,110,111,116, 32, 116, 32,116,104,101,110, 10, 9, 9, 9, 9,111,117,116,112, 117,116, 40, 39, 42, 39, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 41, 32, 39, 41, 10, 9, 9, 9,105,102, 32,116, 32,116,104,101,110, 10, 9, 9, 9, 9,105,102, 32,105,115,101,110,117,109, 40,115,101, 108,102, 46,116,121,112,101, 41, 32,116,104,101,110, 10, 9, 9, 9, 9, 9,111,117,116,112,117,116, 40, 39, 40,105,110, 116, 41, 32, 39, 41, 10, 9, 9, 9, 9,101,110,100, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40, 39,116,111,108,117, 97, 95,116,111, 39, 46, 46,116, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 50, 44, 39, 44,100,101,102, 44, 39, 41, 41, 39, 41, 10, 9, 9, 9,101,108,115,101, 10, 9, 9, 9, 9, 108,111, 99, 97,108, 32,116,111, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95,116,111, 95,102,117,110, 99,116,105,111, 110, 40,115,101,108,102, 46,116,121,112,101, 41, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40,116,111, 95,102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 50, 44, 39, 44,100,101,102, 44, 39, 41, 41, 39, 41, 10, 9, 9, 9,101, 110,100, 10, 9, 9, 9,105,102, 32,112,114,111,112, 95,115, 101,116, 32,116,104,101,110, 10, 9, 9, 9, 9,111,117,116, 112,117,116, 40, 34, 41, 34, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9, 9,111,117,116,112,117,116, 40, 34, 59, 34, 41, 10, 9, 9,101,110,100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32,114,101,116,117,114,110, 32, 48, 59, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39,125, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 35,101,110,100,105,102, 32, 47, 47, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 92,110, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 92,110, 39, 41, 10, 32, 101,110,100, 10, 10,101,110,100, 10, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 86, 97,114,105, 97, 98, 108,101, 58,114,101,103,105,115,116,101,114, 32, 40,112,114, 101, 41, 10, 10, 9,105,102, 32,110,111,116, 32,115,101,108, 102, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 32,116,104,101,110, 10, 9, 9,114,101,116,117,114,110, 10, 9,101,110,100, 10, 32,112, 114,101, 32, 61, 32,112,114,101, 32,111,114, 32, 39, 39, 10, 32,108,111, 99, 97,108, 32,112, 97,114,101,110,116, 32, 61, 32,115,101,108,102, 58,105,110,109,111,100,117,108,101, 40, 41, 32,111,114, 32,115,101,108,102, 58,105,110,110, 97,109, 101,115,112, 97, 99,101, 40, 41, 32,111,114, 32,115,101,108, 102, 58,105,110, 99,108, 97,115,115, 40, 41, 10, 32,105,102, 32,110,111,116, 32,112, 97,114,101,110,116, 32,116,104,101, 110, 10, 32, 32,105,102, 32, 99,108, 97,115,115, 86, 97,114, 105, 97, 98,108,101, 46, 95,119, 97,114,110,105,110,103, 61, 61,110,105,108, 32,116,104,101,110, 10, 32, 32, 32,119, 97, 114,110,105,110,103, 40, 34, 77, 97,112,112,105,110,103, 32, 118, 97,114,105, 97, 98,108,101, 32,116,111, 32,103,108,111, 98, 97,108, 32,109, 97,121, 32,100,101,103,114, 97,100,101, 32,112,101,114,102,111,114,109, 97,110, 99,101, 34, 41, 10, 32, 32, 32, 99,108, 97,115,115, 86, 97,114,105, 97, 98,108, 101, 46, 95,119, 97,114,110,105,110,103, 32, 61, 32, 49, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 32,105,102, 32, 115,101,108,102, 46, 99,115,101,116,110, 97,109,101, 32,116, 104,101,110, 10, 32, 32,111,117,116,112,117,116, 40,112,114, 101, 46, 46, 39,116,111,108,117, 97, 95,118, 97,114,105, 97, 98,108,101, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101,108,102, 46,108,110, 97,109,101, 46, 46, 39, 34, 44, 39, 46, 46,115,101,108,102, 46, 99,103,101,116,110, 97, 109,101, 46, 46, 39, 44, 39, 46, 46,115,101,108,102, 46, 99, 115,101,116,110, 97,109,101, 46, 46, 39, 41, 59, 39, 41, 10, 32,101,108,115,101, 10, 32, 32,111,117,116,112,117,116, 40, 112,114,101, 46, 46, 39,116,111,108,117, 97, 95,118, 97,114, 105, 97, 98,108,101, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101,108,102, 46,108,110, 97,109,101, 46, 46, 39, 34, 44, 39, 46, 46,115,101,108,102, 46, 99,103,101,116, 110, 97,109,101, 46, 46, 39, 44, 78, 85, 76, 76, 41, 59, 39, 41, 10, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99,111,110,115,116,114, 117, 99,116,111,114, 10,102,117,110, 99,116,105,111,110, 32, 95, 86, 97,114,105, 97, 98,108,101, 32, 40,116, 41, 10, 32, 115,101,116,109,101,116, 97,116, 97, 98,108,101, 40,116, 44, 99,108, 97,115,115, 86, 97,114,105, 97, 98,108,101, 41, 10, 32, 97,112,112,101,110,100, 40,116, 41, 10, 32,114,101,116, 117,114,110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67, 111,110,115,116,114,117, 99,116,111,114, 10, 45, 45, 32, 69, 120,112,101, 99,116,115, 32, 97, 32,115,116,114,105,110,103, 32,114,101,112,114,101,115,101,110,116,105,110,103, 32,116, 104,101, 32,118, 97,114,105, 97, 98,108,101, 32,100,101, 99, 108, 97,114, 97,116,105,111,110, 46, 10,102,117,110, 99,116, 105,111,110, 32, 86, 97,114,105, 97, 98,108,101, 32, 40,115, 41, 10, 32,114,101,116,117,114,110, 32, 95, 86, 97,114,105, 97, 98,108,101, 32, 40, 68,101, 99,108, 97,114, 97,116,105, 111,110, 40,115, 44, 39,118, 97,114, 39, 41, 41, 10,101,110, 100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/variable.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32, 97,114,114, 97,121, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114,105,116,116, 101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97, 102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117, 108, 32, 49, 57, 57, 57, 10, 45, 45, 32, 36, 73,100, 58, 32, 97,114,114, 97,121, 46,108,117, 97, 44,118, 32, 49, 46, 49, 32, 50, 48, 48, 48, 47, 49, 49, 47, 48, 54, 32, 50, 50, 58, 48, 51, 58, 53, 55, 32, 99,101,108,101,115, 32, 69,120,112, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111,100, 101, 32,105,115, 32,102,114,101,101, 32,115,111,102,116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101, 100,105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97, 110,100, 47,111,114, 32,109,111,100,105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116,119, 97, 114,101, 32,112,114,111,118,105,100,101,100, 32,104,101,114, 101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97,117,116, 104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105, 103, 97,116,105,111,110, 32,116,111, 32,112,114,111,118,105, 100,101, 32,109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97,116, 101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101,109, 101,110,116,115, 44, 32,111,114, 32,109,111,100,105,102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 45, 45, 32, 65, 114,114, 97,121, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82, 101,112,114,101,115,101,110,116,115, 32, 97, 32,101,120,116, 101,114,110, 32, 97,114,114, 97,121, 32,118, 97,114,105, 97, 98,108,101, 32,111,114, 32, 97, 32,112,117, 98,108,105, 99, 32,109,101,109, 98,101,114, 32,111,102, 32, 97, 32, 99,108, 97,115,115, 46, 10, 45, 45, 32, 83,116,111,114,101,115, 32, 97,108,108, 32,102,105,101,108,100,115, 32,112,114,101,115, 101,110,116, 32,105,110, 32, 97, 32,100,101, 99,108, 97,114, 97,116,105,111,110, 46, 10, 99,108, 97,115,115, 65,114,114, 97,121, 32, 61, 32,123, 10,125, 10, 99,108, 97,115,115, 65, 114,114, 97,121, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97,115,115, 65,114,114, 97,121, 10,115,101,116,109, 101,116, 97,116, 97, 98,108,101, 40, 99,108, 97,115,115, 65, 114,114, 97,121, 44, 99,108, 97,115,115, 68,101, 99,108, 97, 114, 97,116,105,111,110, 41, 10, 10, 45, 45, 32, 80,114,105, 110,116, 32,109,101,116,104,111,100, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 65,114,114, 97,121, 58, 112,114,105,110,116, 32, 40,105,100,101,110,116, 44, 99,108, 111,115,101, 41, 10, 32,112,114,105,110,116, 40,105,100,101, 110,116, 46, 46, 34, 65,114,114, 97,121,123, 34, 41, 10, 32, 112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 109,111,100, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,109,111,100, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114, 105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,116,121, 112,101, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,116, 121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105, 110,116, 40,105,100,101,110,116, 46, 46, 34, 32,112,116,114, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,112,116, 114, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40, 105,100,101,110,116, 46, 46, 34, 32,100,101,102, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,100,101,102, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100, 101,110,116, 46, 46, 34, 32,100,105,109, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,100,105,109, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110, 116, 46, 46, 34, 32,114,101,116, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,114,101,116, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34,125, 34, 46, 46, 99,108,111,115,101, 41, 10,101,110, 100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32, 105,116, 32,105,115, 32, 97, 32,118, 97,114,105, 97, 98,108, 101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115, 115, 65,114,114, 97,121, 58,105,115,118, 97,114,105, 97, 98, 108,101, 32, 40, 41, 10, 32,114,101,116,117,114,110, 32,116, 114,117,101, 10,101,110,100, 10, 10, 10, 45, 45, 32,103,101, 116, 32,118, 97,114,105, 97, 98,108,101, 32,118, 97,108,117, 101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115, 115, 65,114,114, 97,121, 58,103,101,116,118, 97,108,117,101, 32, 40, 99,108, 97,115,115, 44,115,116, 97,116,105, 99, 41, 10, 32,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32, 115,116, 97,116,105, 99, 32,116,104,101,110, 10, 32, 32,114, 101,116,117,114,110, 32, 99,108, 97,115,115, 46, 46, 39, 58, 58, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 91,116,111,108,117, 97, 95,105,110,100,101,120, 93, 39, 10, 32,101,108,115,101,105,102, 32, 99,108, 97,115,115, 32, 116,104,101,110, 10, 32, 32,114,101,116,117,114,110, 32, 39, 115,101,108,102, 45, 62, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 91,116,111,108,117, 97, 95,105,110, 100,101,120, 93, 39, 10, 32,101,108,115,101, 10, 32, 32,114, 101,116,117,114,110, 32,115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 91,116,111,108,117, 97, 95,105,110,100,101,120, 93, 39, 10, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 87,114,105,116,101, 32, 98,105,110,100,105,110,103, 32, 102,117,110, 99,116,105,111,110,115, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 65,114,114, 97,121, 58, 115,117,112, 99,111,100,101, 32, 40, 41, 10, 32,108,111, 99, 97,108, 32, 99,108, 97,115,115, 32, 61, 32,115,101,108,102, 58,105,110, 99,108, 97,115,115, 40, 41, 10, 10, 32, 45, 45, 32,103,101,116, 32,102,117,110, 99,116,105,111,110, 32, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 32,105,102, 32, 99,108, 97,115,115, 32,116,104, 101,110, 10, 32, 32,111,117,116,112,117,116, 40, 34, 47, 42, 32,103,101,116, 32,102,117,110, 99,116,105,111,110, 58, 34, 44,115,101,108,102, 46,110, 97,109,101, 44, 34, 32,111,102, 32, 99,108, 97,115,115, 32, 34, 44, 99,108, 97,115,115, 44, 34, 32, 42, 47, 34, 41, 10, 32,101,108,115,101, 10, 32, 32, 111,117,116,112,117,116, 40, 34, 47, 42, 32,103,101,116, 32, 102,117,110, 99,116,105,111,110, 58, 34, 44,115,101,108,102, 46,110, 97,109,101, 44, 34, 32, 42, 47, 34, 41, 10, 32,101, 110,100, 10, 32,115,101,108,102, 46, 99,103,101,116,110, 97, 109,101, 32, 61, 32,115,101,108,102, 58, 99,102,117,110, 99, 110, 97,109,101, 40, 34,116,111,108,117, 97, 95,103,101,116, 34, 41, 10, 32,111,117,116,112,117,116, 40, 34, 35,105,102, 110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 95, 34, 46, 46,115,101,108,102, 46, 99,103,101, 116,110, 97,109,101, 41, 10, 32,111,117,116,112,117,116, 40, 34, 92,110,115,116, 97,116,105, 99, 32,105,110,116, 34, 44, 115,101,108,102, 46, 99,103,101,116,110, 97,109,101, 44, 34, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32,116,111,108, 117, 97, 95, 83, 41, 34, 41, 10, 32,111,117,116,112,117,116, 40, 34,123, 34, 41, 10, 32,111,117,116,112,117,116, 40, 34, 32,105,110,116, 32,116,111,108,117, 97, 95,105,110,100,101, 120, 59, 34, 41, 10, 10, 32, 45, 45, 32,100,101, 99,108, 97, 114,101, 32,115,101,108,102, 44, 32,105,102, 32,116,104,101, 32, 99, 97,115,101, 10, 32,108,111, 99, 97,108, 32, 95, 44, 95, 44,115,116, 97,116,105, 99, 32, 61, 32,115,116,114,102, 105,110,100, 40,115,101,108,102, 46,109,111,100, 44, 39, 94, 37,115, 42, 40,115,116, 97,116,105, 99, 41, 39, 41, 10, 32, 105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,116, 97,116,105, 99, 61, 61,110,105,108, 32,116,104,101,110, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 39, 44,115,101, 108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 44, 39, 42, 39, 44, 39,115,101,108,102, 59, 39, 41, 10, 32, 32, 111,117,116,112,117,116, 40, 39, 32,108,117, 97, 95,112,117, 115,104,115,116,114,105,110,103, 40,116,111,108,117, 97, 95, 83, 44, 34, 46,115,101,108,102, 34, 41, 59, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32,108,117, 97, 95,114, 97,119,103,101,116, 40,116,111,108,117, 97, 95, 83, 44, 49, 41, 59, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32,115,101,108,102, 32, 61, 32, 39, 41, 10, 32, 32,111,117, 116,112,117,116, 40, 39, 40, 39, 44,115,101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 44, 39, 42, 41, 32, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39,108,117, 97, 95,116,111,117,115,101,114,100, 97,116, 97, 40,116,111, 108,117, 97, 95, 83, 44, 45, 49, 41, 59, 39, 41, 10, 32,101, 108,115,101,105,102, 32,115,116, 97,116,105, 99, 32,116,104, 101,110, 10, 32, 32, 95, 44, 95, 44,115,101,108,102, 46,109, 111,100, 32, 61, 32,115,116,114,102,105,110,100, 40,115,101, 108,102, 46,109,111,100, 44, 39, 94, 37,115, 42,115,116, 97, 116,105, 99, 37,115, 37,115, 42, 40, 46, 42, 41, 39, 41, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,105,110,100,101,120, 10, 9,111,117,116,112,117,116, 40, 39, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9,111,117, 116,112,117,116, 40, 39, 32,123, 39, 41, 10, 9,111,117,116, 112,117,116, 40, 39, 32, 32,116,111,108,117, 97, 95, 69,114, 114,111,114, 32,116,111,108,117, 97, 95,101,114,114, 59, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 32, 32,105,102, 32, 40, 33,116,111,108,117, 97, 95,105,115,110,117,109, 98, 101,114, 40,116,111,108,117, 97, 95, 83, 44, 50, 44, 48, 44, 38,116,111,108,117, 97, 95,101,114,114, 41, 41, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,116,111,108, 117, 97, 95,101,114,114,111,114, 40,116,111,108,117, 97, 95, 83, 44, 34, 35,118,105,110,118, 97,108,105,100, 32,116,121, 112,101, 32,105,110, 32, 97,114,114, 97,121, 32,105,110,100, 101,120,105,110,103, 46, 34, 44, 38,116,111,108,117, 97, 95, 101,114,114, 41, 59, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 32,125, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 9,105,102, 32,102,108, 97,103,115, 91, 39, 49, 39, 93, 32,116,104,101, 110, 32, 45, 45, 32,102,111,114, 32, 99,111,109,112, 97,116, 105, 98,105,108,105,116,121, 32,119,105,116,104, 32,116,111, 108,117, 97, 53, 32, 63, 10, 9, 9,111,117,116,112,117,116, 40, 39, 32,116,111,108,117, 97, 95,105,110,100,101,120, 32, 61, 32, 40,105,110,116, 41,116,111,108,117, 97, 95,116,111, 110,117,109, 98,101,114, 40,116,111,108,117, 97, 95, 83, 44, 50, 44, 48, 41, 45, 49, 59, 39, 41, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,112,117,116, 40, 39, 32,116,111,108, 117, 97, 95,105,110,100,101,120, 32, 61, 32, 40,105,110,116, 41,116,111,108,117, 97, 95,116,111,110,117,109, 98,101,114, 40,116,111,108,117, 97, 95, 83, 44, 50, 44, 48, 41, 59, 39, 41, 10, 9,101,110,100, 10, 9,111,117,116,112,117,116, 40, 39, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9,105,102, 32,115,101,108,102, 46,100,105,109, 32, 97,110,100, 32,115, 101,108,102, 46,100,105,109, 32,126, 61, 32, 39, 39, 32,116, 104,101,110, 10, 9, 32, 32,111,117,116,112,117,116, 40, 39, 32,105,102, 32, 40,116,111,108,117, 97, 95,105,110,100,101, 120, 60, 48, 32,124,124, 32,116,111,108,117, 97, 95,105,110, 100,101,120, 62, 61, 39, 46, 46,115,101,108,102, 46,100,105, 109, 46, 46, 39, 41, 39, 41, 10, 9,101,108,115,101, 10, 9, 32, 32,111,117,116,112,117,116, 40, 39, 32,105,102, 32, 40, 116,111,108,117, 97, 95,105,110,100,101,120, 60, 48, 41, 39, 41, 10, 9,101,110,100, 10, 32,111,117,116,112,117,116, 40, 39, 32, 32,116,111,108,117, 97, 95,101,114,114,111,114, 40, 116,111,108,117, 97, 95, 83, 44, 34, 97,114,114, 97,121, 32, 105,110,100,101,120,105,110,103, 32,111,117,116, 32,111,102, 32,114, 97,110,103,101, 46, 34, 44, 78, 85, 76, 76, 41, 59, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 35,101,110, 100,105,102, 92,110, 39, 41, 10, 10, 32, 45, 45, 32,114,101, 116,117,114,110, 32,118, 97,108,117,101, 10, 32,108,111, 99, 97,108, 32,116, 44, 99,116, 32, 61, 32,105,115, 98, 97,115, 105, 99, 40,115,101,108,102, 46,116,121,112,101, 41, 10, 32, 108,111, 99, 97,108, 32,112,117,115,104, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95,112,117,115,104, 95,102,117,110, 99,116,105,111,110, 40,116, 41, 10, 32,105,102, 32,116, 32, 116,104,101,110, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32,116,111,108,117, 97, 95,112,117,115,104, 39, 46, 46,116, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 40, 39, 44, 99,116, 44, 39, 41, 39, 46, 46,115,101,108,102, 58,103,101, 116,118, 97,108,117,101, 40, 99,108, 97,115,115, 44,115,116, 97,116,105, 99, 41, 46, 46, 39, 41, 59, 39, 41, 10, 32,101, 108,115,101, 10, 9, 9,116, 32, 61, 32,115,101,108,102, 46, 116,121,112,101, 10, 32, 32,105,102, 32,115,101,108,102, 46, 112,116,114, 32, 61, 61, 32, 39, 38, 39, 32,111,114, 32,115, 101,108,102, 46,112,116,114, 32, 61, 61, 32, 39, 39, 32,116, 104,101,110, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 39, 44,112,117,115,104, 95,102,117,110, 99, 44, 39, 40, 116,111,108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41, 38, 39, 46, 46,115,101,108,102, 58,103,101,116,118, 97,108, 117,101, 40, 99,108, 97,115,115, 44,115,116, 97,116,105, 99, 41, 46, 46, 39, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 32, 32,101,108,115,101, 10, 32, 32, 32,111,117,116, 112,117,116, 40, 39, 32, 39, 44,112,117,115,104, 95,102,117, 110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40,118, 111,105,100, 42, 41, 39, 46, 46,115,101,108,102, 58,103,101, 116,118, 97,108,117,101, 40, 99,108, 97,115,115, 44,115,116, 97,116,105, 99, 41, 46, 46, 39, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 32, 32,101,110,100, 10, 32,101,110, 100, 10, 32,111,117,116,112,117,116, 40, 39, 32,114,101,116, 117,114,110, 32, 49, 59, 39, 41, 10, 32,111,117,116,112,117, 116, 40, 39,125, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 35,101,110,100,105,102, 32, 47, 47, 35,105,102,110,100, 101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 92,110, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 92,110, 39, 41, 10, 10, 32, 45, 45, 32,115,101,116, 32,102, 117,110, 99,116,105,111,110, 32, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 32,105,102, 32,110,111,116, 32,115,116,114,102,105,110,100, 40,115,101, 108,102, 46,116,121,112,101, 44, 39, 99,111,110,115,116, 39, 41, 32,116,104,101,110, 10, 32, 32,105,102, 32, 99,108, 97, 115,115, 32,116,104,101,110, 10, 32, 32, 32,111,117,116,112, 117,116, 40, 34, 47, 42, 32,115,101,116, 32,102,117,110, 99, 116,105,111,110, 58, 34, 44,115,101,108,102, 46,110, 97,109, 101, 44, 34, 32,111,102, 32, 99,108, 97,115,115, 32, 34, 44, 99,108, 97,115,115, 44, 34, 32, 42, 47, 34, 41, 10, 32, 32, 101,108,115,101, 10, 32, 32, 32,111,117,116,112,117,116, 40, 34, 47, 42, 32,115,101,116, 32,102,117,110, 99,116,105,111, 110, 58, 34, 44,115,101,108,102, 46,110, 97,109,101, 44, 34, 32, 42, 47, 34, 41, 10, 32, 32,101,110,100, 10, 32, 32,115, 101,108,102, 46, 99,115,101,116,110, 97,109,101, 32, 61, 32, 115,101,108,102, 58, 99,102,117,110, 99,110, 97,109,101, 40, 34,116,111,108,117, 97, 95,115,101,116, 34, 41, 10, 32, 32, 111,117,116,112,117,116, 40, 34, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 95, 34, 46, 46,115,101,108,102, 46, 99,115,101,116,110, 97,109, 101, 41, 10, 32, 32,111,117,116,112,117,116, 40, 34, 92,110, 115,116, 97,116,105, 99, 32,105,110,116, 34, 44,115,101,108, 102, 46, 99,115,101,116,110, 97,109,101, 44, 34, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32,116,111,108,117, 97, 95, 83, 41, 34, 41, 10, 32, 32,111,117,116,112,117,116, 40, 34, 123, 34, 41, 10, 10, 32, 32, 45, 45, 32,100,101, 99,108, 97, 114,101, 32,105,110,100,101,120, 10, 32, 32,111,117,116,112, 117,116, 40, 39, 32,105,110,116, 32,116,111,108,117, 97, 95, 105,110,100,101,120, 59, 39, 41, 10, 10, 32, 32, 45, 45, 32, 100,101, 99,108, 97,114,101, 32,115,101,108,102, 44, 32,105, 102, 32,116,104,101, 32, 99, 97,115,101, 10, 32, 32,108,111, 99, 97,108, 32, 95, 44, 95, 44,115,116, 97,116,105, 99, 32, 61, 32,115,116,114,102,105,110,100, 40,115,101,108,102, 46, 109,111,100, 44, 39, 94, 37,115, 42, 40,115,116, 97,116,105, 99, 41, 39, 41, 10, 32, 32,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,116, 97,116,105, 99, 61, 61,110,105, 108, 32,116,104,101,110, 10, 32, 32, 32,111,117,116,112,117, 116, 40, 39, 32, 39, 44,115,101,108,102, 46,112, 97,114,101, 110,116, 46,116,121,112,101, 44, 39, 42, 39, 44, 39,115,101, 108,102, 59, 39, 41, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32,108,117, 97, 95,112,117,115,104,115,116,114,105, 110,103, 40,116,111,108,117, 97, 95, 83, 44, 34, 46,115,101, 108,102, 34, 41, 59, 39, 41, 10, 32, 32, 32,111,117,116,112, 117,116, 40, 39, 32,108,117, 97, 95,114, 97,119,103,101,116, 40,116,111,108,117, 97, 95, 83, 44, 49, 41, 59, 39, 41, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32,115,101,108, 102, 32, 61, 32, 39, 41, 10, 32, 32, 32,111,117,116,112,117, 116, 40, 39, 40, 39, 44,115,101,108,102, 46,112, 97,114,101, 110,116, 46,116,121,112,101, 44, 39, 42, 41, 32, 39, 41, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39,108,117, 97, 95, 116,111,117,115,101,114,100, 97,116, 97, 40,116,111,108,117, 97, 95, 83, 44, 45, 49, 41, 59, 39, 41, 10, 32, 32,101,108, 115,101,105,102, 32,115,116, 97,116,105, 99, 32,116,104,101, 110, 10, 32, 32, 32, 95, 44, 95, 44,115,101,108,102, 46,109, 111,100, 32, 61, 32,115,116,114,102,105,110,100, 40,115,101, 108,102, 46,109,111,100, 44, 39, 94, 37,115, 42,115,116, 97, 116,105, 99, 37,115, 37,115, 42, 40, 46, 42, 41, 39, 41, 10, 32, 32,101,110,100, 10, 10, 32, 32, 45, 45, 32, 99,104,101, 99,107, 32,105,110,100,101,120, 10, 9, 32,111,117,116,112, 117,116, 40, 39, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9, 32,111,117,116,112,117,116, 40, 39, 32,123, 39, 41, 10, 9, 32,111,117,116,112,117,116, 40, 39, 32, 32,116,111,108, 117, 97, 95, 69,114,114,111,114, 32,116,111,108,117, 97, 95, 101,114,114, 59, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32,105,102, 32, 40, 33,116,111,108,117, 97, 95, 105,115,110,117,109, 98,101,114, 40,116,111,108,117, 97, 95, 83, 44, 50, 44, 48, 44, 38,116,111,108,117, 97, 95,101,114, 114, 41, 41, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,116,111,108,117, 97, 95,101,114,114,111,114, 40,116,111,108,117, 97, 95, 83, 44, 34, 35,118,105,110,118, 97,108,105,100, 32,116,121,112,101, 32,105,110, 32, 97,114, 114, 97,121, 32,105,110,100,101,120,105,110,103, 46, 34, 44, 38,116,111,108,117, 97, 95,101,114,114, 41, 59, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39, 32,125, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39, 35,101,110,100,105, 102, 92,110, 39, 41, 10, 10, 9,105,102, 32,102,108, 97,103, 115, 91, 39, 49, 39, 93, 32,116,104,101,110, 32, 45, 45, 32, 102,111,114, 32, 99,111,109,112, 97,116,105, 98,105,108,105, 116,121, 32,119,105,116,104, 32,116,111,108,117, 97, 53, 32, 63, 10, 9, 9,111,117,116,112,117,116, 40, 39, 32,116,111, 108,117, 97, 95,105,110,100,101,120, 32, 61, 32, 40,105,110, 116, 41,116,111,108,117, 97, 95,116,111,110,117,109, 98,101, 114, 40,116,111,108,117, 97, 95, 83, 44, 50, 44, 48, 41, 45, 49, 59, 39, 41, 10, 9,101,108,115,101, 10, 9, 9,111,117, 116,112,117,116, 40, 39, 32,116,111,108,117, 97, 95,105,110, 100,101,120, 32, 61, 32, 40,105,110,116, 41,116,111,108,117, 97, 95,116,111,110,117,109, 98,101,114, 40,116,111,108,117, 97, 95, 83, 44, 50, 44, 48, 41, 59, 39, 41, 10, 9,101,110, 100, 10, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35,105, 102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9,105,102, 32,115,101, 108,102, 46,100,105,109, 32, 97,110,100, 32,115,101,108,102, 46,100,105,109, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 9, 32, 32,111,117,116,112,117,116, 40, 39, 32,105,102, 32, 40,116,111,108,117, 97, 95,105,110,100,101,120, 60, 48, 32,124,124, 32,116,111,108,117, 97, 95,105,110,100,101,120, 62, 61, 39, 46, 46,115,101,108,102, 46,100,105,109, 46, 46, 39, 41, 39, 41, 10, 9,101,108,115,101, 10, 9, 32, 32,111, 117,116,112,117,116, 40, 39, 32,105,102, 32, 40,116,111,108, 117, 97, 95,105,110,100,101,120, 60, 48, 41, 39, 41, 10, 9, 101,110,100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32,116,111,108,117, 97, 95,101,114,114,111,114, 40,116,111, 108,117, 97, 95, 83, 44, 34, 97,114,114, 97,121, 32,105,110, 100,101,120,105,110,103, 32,111,117,116, 32,111,102, 32,114, 97,110,103,101, 46, 34, 44, 78, 85, 76, 76, 41, 59, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39, 35,101,110,100, 105,102, 92,110, 39, 41, 10, 10, 32, 32, 45, 45, 32, 97,115, 115,105,103,110, 32,118, 97,108,117,101, 10, 32, 32,108,111, 99, 97,108, 32,112,116,114, 32, 61, 32, 39, 39, 10, 32, 32, 105,102, 32,115,101,108,102, 46,112,116,114,126, 61, 39, 39, 32,116,104,101,110, 32,112,116,114, 32, 61, 32, 39, 42, 39, 32,101,110,100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 39, 41, 10, 32, 32,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,116, 97,116,105, 99, 32,116,104,101,110, 10, 32, 32, 32,111,117,116,112,117,116, 40, 99,108, 97,115, 115, 46, 46, 39, 58, 58, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 91,116,111,108,117, 97, 95,105,110, 100,101,120, 93, 39, 41, 10, 32, 32,101,108,115,101,105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 10, 32, 32, 32, 111,117,116,112,117,116, 40, 39,115,101,108,102, 45, 62, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 91, 116,111,108,117, 97, 95,105,110,100,101,120, 93, 39, 41, 10, 32, 32,101,108,115,101, 10, 32, 32, 32,111,117,116,112,117, 116, 40,115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 91, 116,111,108,117, 97, 95,105,110,100,101,120, 93, 39, 41, 10, 32, 32,101,110,100, 10, 32, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,105,115, 98, 97,115,105, 99, 40,115,101,108,102, 46,116,121,112,101, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 61, 32, 39, 41, 10, 32, 32,105,102, 32,110,111, 116, 32,116, 32, 97,110,100, 32,112,116,114, 61, 61, 39, 39, 32,116,104,101,110, 32,111,117,116,112,117,116, 40, 39, 42, 39, 41, 32,101,110,100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 40, 40, 39, 44,115,101,108,102, 46,109,111,100, 44, 115,101,108,102, 46,116,121,112,101, 41, 10, 32, 32,105,102, 32,110,111,116, 32,116, 32,116,104,101,110, 10, 32, 32, 32, 111,117,116,112,117,116, 40, 39, 42, 39, 41, 10, 32, 32,101, 110,100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 41, 32, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,100,101,102, 32, 61, 32, 48, 10, 32, 32,105,102, 32,115,101,108,102, 46,100, 101,102, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 32,100, 101,102, 32, 61, 32,115,101,108,102, 46,100,101,102, 32,101, 110,100, 10, 32, 32,105,102, 32,116, 32,116,104,101,110, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39,116,111,108,117, 97, 95,116,111, 39, 46, 46,116, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 51, 44, 39, 44,100,101,102, 44, 39, 41, 41, 59, 39, 41, 10, 32, 32,101,108,115,101, 10, 32, 32, 32,108, 111, 99, 97,108, 32,116,111, 95,102,117,110, 99, 32, 61, 32, 103,101,116, 95,116,111, 95,102,117,110, 99,116,105,111,110, 40,115,101,108,102, 46,116,121,112,101, 41, 10, 32, 32, 32, 111,117,116,112,117,116, 40,116,111, 95,102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 51, 44, 39, 44,100, 101,102, 44, 39, 41, 41, 59, 39, 41, 10, 32, 32,101,110,100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32,114,101,116, 117,114,110, 32, 48, 59, 39, 41, 10, 32, 32,111,117,116,112, 117,116, 40, 39,125, 39, 41, 10, 32, 32,111,117,116,112,117, 116, 40, 39, 35,101,110,100,105,102, 32, 47, 47, 35,105,102, 110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 92,110, 39, 41, 10, 32, 32,111,117,116,112,117, 116, 40, 39, 92,110, 39, 41, 10, 32,101,110,100, 10, 10,101, 110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 65,114,114, 97,121, 58,114,101,103,105,115,116, 101,114, 32, 40,112,114,101, 41, 10, 9,105,102, 32,110,111, 116, 32,115,101,108,102, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 32,116, 104,101,110, 10, 9, 9,114,101,116,117,114,110, 10, 9,101, 110,100, 10, 10, 32,112,114,101, 32, 61, 32,112,114,101, 32, 111,114, 32, 39, 39, 10, 32,105,102, 32,115,101,108,102, 46, 99,115,101,116,110, 97,109,101, 32,116,104,101,110, 10, 32, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 39,116, 111,108,117, 97, 95, 97,114,114, 97,121, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101,108,102, 46,108,110, 97,109,101, 46, 46, 39, 34, 44, 39, 46, 46,115,101,108,102, 46, 99,103,101,116,110, 97,109,101, 46, 46, 39, 44, 39, 46, 46,115,101,108,102, 46, 99,115,101,116,110, 97,109,101, 46, 46, 39, 41, 59, 39, 41, 10, 32,101,108,115,101, 10, 32, 32, 111,117,116,112,117,116, 40,112,114,101, 46, 46, 39,116,111, 108,117, 97, 95, 97,114,114, 97,121, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101,108,102, 46,108,110, 97, 109,101, 46, 46, 39, 34, 44, 39, 46, 46,115,101,108,102, 46, 99,103,101,116,110, 97,109,101, 46, 46, 39, 44, 78, 85, 76, 76, 41, 59, 39, 41, 10, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99,111, 110,115,116,114,117, 99,116,111,114, 10,102,117,110, 99,116, 105,111,110, 32, 95, 65,114,114, 97,121, 32, 40,116, 41, 10, 32,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40,116, 44, 99,108, 97,115,115, 65,114,114, 97,121, 41, 10, 32, 97, 112,112,101,110,100, 40,116, 41, 10, 32,114,101,116,117,114, 110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110, 115,116,114,117, 99,116,111,114, 10, 45, 45, 32, 69,120,112, 101, 99,116,115, 32, 97, 32,115,116,114,105,110,103, 32,114, 101,112,114,101,115,101,110,116,105,110,103, 32,116,104,101, 32,118, 97,114,105, 97, 98,108,101, 32,100,101, 99,108, 97, 114, 97,116,105,111,110, 46, 10,102,117,110, 99,116,105,111, 110, 32, 65,114,114, 97,121, 32, 40,115, 41, 10, 32,114,101, 116,117,114,110, 32, 95, 65,114,114, 97,121, 32, 40, 68,101, 99,108, 97,114, 97,116,105,111,110, 40,115, 44, 39,118, 97, 114, 39, 41, 41, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/array.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114, 105,116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73, 100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99, 111,100,101, 32,105,115, 32,102,114,101,101, 32,115,111,102, 116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32, 114,101,100,105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32, 105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116, 119, 97,114,101, 32,112,114,111,118,105,100,101,100, 32,104, 101,114,101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105, 115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97, 117,116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98, 108,105,103, 97,116,105,111,110, 32,116,111, 32,112,114,111, 118,105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99, 101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99, 101,109,101,110,116,115, 44, 32,111,114, 32,109,111,100,105, 102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 10, 45, 45, 32, 70,117,110, 99,116,105,111,110, 32, 99,108, 97,115, 115, 10, 45, 45, 32, 82,101,112,114,101,115,101,110,116,115, 32, 97, 32,102,117,110, 99,116,105,111,110, 32,111,114, 32, 97, 32, 99,108, 97,115,115, 32,109,101,116,104,111,100, 46, 10, 45, 45, 32, 84,104,101, 32,102,111,108,108,111,119,105, 110,103, 32,102,105,101,108,100,115, 32, 97,114,101, 32,115, 116,111,114,101,100, 58, 10, 45, 45, 32, 32,109,111,100, 32, 32, 61, 32,116,121,112,101, 32,109,111,100,105,102,105,101, 114,115, 10, 45, 45, 32, 32,116,121,112,101, 32, 61, 32,116, 121,112,101, 10, 45, 45, 32, 32,112,116,114, 32, 32, 61, 32, 34, 42, 34, 32,111,114, 32, 34, 38, 34, 44, 32,105,102, 32, 114,101,112,114,101,115,101,110,116,105,110,103, 32, 97, 32, 112,111,105,110,116,101,114, 32,111,114, 32, 97, 32,114,101, 102,101,114,101,110, 99,101, 10, 45, 45, 32, 32,110, 97,109, 101, 32, 61, 32,110, 97,109,101, 10, 45, 45, 32, 32,108,110, 97,109,101, 32, 61, 32,108,117, 97, 32,110, 97,109,101, 10, 45, 45, 32, 32, 97,114,103,115, 32, 32, 61, 32,108,105,115, 116, 32,111,102, 32, 97,114,103,117,109,101,110,116, 32,100, 101, 99,108, 97,114, 97,116,105,111,110,115, 10, 45, 45, 32, 32, 99,111,110,115,116, 32, 61, 32,105,102, 32,105,116, 32, 105,115, 32, 97, 32,109,101,116,104,111,100, 32,114,101, 99, 101,105,118,105,110,103, 32, 97, 32, 99,111,110,115,116, 32, 34,116,104,105,115, 34, 46, 10, 99,108, 97,115,115, 70,117, 110, 99,116,105,111,110, 32, 61, 32,123, 10, 32,109,111,100, 32, 61, 32, 39, 39, 44, 10, 32,116,121,112,101, 32, 61, 32, 39, 39, 44, 10, 32,112,116,114, 32, 61, 32, 39, 39, 44, 10, 32,110, 97,109,101, 32, 61, 32, 39, 39, 44, 10, 32, 97,114, 103,115, 32, 61, 32,123,110, 61, 48,125, 44, 10, 32, 99,111, 110,115,116, 32, 61, 32, 39, 39, 44, 10,125, 10, 99,108, 97, 115,115, 70,117,110, 99,116,105,111,110, 46, 95, 95,105,110, 100,101,120, 32, 61, 32, 99,108, 97,115,115, 70,117,110, 99, 116,105,111,110, 10,115,101,116,109,101,116, 97,116, 97, 98, 108,101, 40, 99,108, 97,115,115, 70,117,110, 99,116,105,111, 110, 44, 99,108, 97,115,115, 70,101, 97,116,117,114,101, 41, 10, 10, 45, 45, 32,100,101, 99,108, 97,114,101, 32,116, 97, 103,115, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97, 115,115, 70,117,110, 99,116,105,111,110, 58,100,101, 99,108, 116,121,112,101, 32, 40, 41, 10, 32,115,101,108,102, 46,116, 121,112,101, 32, 61, 32,116,121,112,101,118, 97,114, 40,115, 101,108,102, 46,116,121,112,101, 41, 10, 32,105,102, 32,115, 116,114,102,105,110,100, 40,115,101,108,102, 46,109,111,100, 44, 39, 99,111,110,115,116, 39, 41, 32,116,104,101,110, 10, 9, 32,115,101,108,102, 46,116,121,112,101, 32, 61, 32, 39, 99,111,110,115,116, 32, 39, 46, 46,115,101,108,102, 46,116, 121,112,101, 10, 9, 9,115,101,108,102, 46,109,111,100, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46,109,111,100, 44, 39, 99,111,110,115,116, 39, 44, 39, 39, 41, 10, 9,101, 110,100, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32, 119,104,105,108,101, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 32,100,111, 10, 32, 32,115,101,108,102, 46, 97, 114,103,115, 91,105, 93, 58,100,101, 99,108,116,121,112,101, 40, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101, 110,100, 10,101,110,100, 10, 10, 10, 45, 45, 32, 87,114,105, 116,101, 32, 98,105,110,100,105,110,103, 32,102,117,110, 99, 116,105,111,110, 10, 45, 45, 32, 79,117,116,112,117,116,115, 32, 67, 47, 67, 43, 43, 32, 98,105,110,100,105,110,103, 32, 102,117,110, 99,116,105,111,110, 46, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 70,117,110, 99,116,105, 111,110, 58,115,117,112, 99,111,100,101, 32, 40,108,111, 99, 97,108, 95, 99,111,110,115,116,114,117, 99,116,111,114, 41, 10, 10, 32,108,111, 99, 97,108, 32,111,118,101,114,108,111, 97,100, 32, 61, 32,115,116,114,115,117, 98, 40,115,101,108, 102, 46, 99,110, 97,109,101, 44, 45, 50, 44, 45, 49, 41, 32, 45, 32, 49, 32, 32, 45, 45, 32,105,110,100,105, 99, 97,116, 101, 32,111,118,101,114,108,111, 97,100,101,100, 32,102,117, 110, 99, 10, 32,108,111, 99, 97,108, 32,110,114,101,116, 32, 61, 32, 48, 32, 32, 32, 32, 32, 32, 45, 45, 32,110,117,109, 98,101,114, 32,111,102, 32,114,101,116,117,114,110,101,100, 32,118, 97,108,117,101,115, 10, 32,108,111, 99, 97,108, 32, 99,108, 97,115,115, 32, 61, 32,115,101,108,102, 58,105,110, 99,108, 97,115,115, 40, 41, 10, 32,108,111, 99, 97,108, 32, 95, 44, 95, 44,115,116, 97,116,105, 99, 32, 61, 32,115,116, 114,102,105,110,100, 40,115,101,108,102, 46,109,111,100, 44, 39, 94, 37,115, 42, 40,115,116, 97,116,105, 99, 41, 39, 41, 10, 32,105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 10, 10, 32, 9,105,102, 32,115,101,108,102, 46,110, 97,109, 101, 32, 61, 61, 32, 39,110,101,119, 39, 32, 97,110,100, 32, 115,101,108,102, 46,112, 97,114,101,110,116, 46,102,108, 97, 103,115, 46,112,117,114,101, 95,118,105,114,116,117, 97,108, 32,116,104,101,110, 10, 32, 9, 9, 45, 45, 32,110,111, 32, 99,111,110,115,116,114,117, 99,116,111,114, 32,102,111,114, 32, 99,108, 97,115,115,101,115, 32,119,105,116,104, 32,112, 117,114,101, 32,118,105,114,116,117, 97,108, 32,109,101,116, 104,111,100,115, 10, 32, 9, 9,114,101,116,117,114,110, 10, 32, 9,101,110,100, 10, 10, 32, 9,105,102, 32,108,111, 99, 97,108, 95, 99,111,110,115,116,114,117, 99,116,111,114, 32, 116,104,101,110, 10, 9, 9,111,117,116,112,117,116, 40, 34, 47, 42, 32,109,101,116,104,111,100, 58, 32,110,101,119, 95, 108,111, 99, 97,108, 32,111,102, 32, 99,108, 97,115,115, 32, 34, 44, 99,108, 97,115,115, 44, 34, 32, 42, 47, 34, 41, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,112,117,116, 40, 34, 47, 42, 32,109,101,116,104,111,100, 58, 34, 44,115,101, 108,102, 46,110, 97,109,101, 44, 34, 32,111,102, 32, 99,108, 97,115,115, 32, 34, 44, 99,108, 97,115,115, 44, 34, 32, 42, 47, 34, 41, 10, 9,101,110,100, 10, 32,101,108,115,101, 10, 32, 32,111,117,116,112,117,116, 40, 34, 47, 42, 32,102,117, 110, 99,116,105,111,110, 58, 34, 44,115,101,108,102, 46,110, 97,109,101, 44, 34, 32, 42, 47, 34, 41, 10, 32,101,110,100, 10, 10, 32,105,102, 32,108,111, 99, 97,108, 95, 99,111,110, 115,116,114,117, 99,116,111,114, 32,116,104,101,110, 10, 32, 32,111,117,116,112,117,116, 40, 34, 35,105,102,110,100,101, 102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 95, 34, 46, 46,115,101,108,102, 46, 99,110, 97,109,101, 46, 46, 34, 95,108,111, 99, 97,108, 34, 41, 10, 32, 32,111,117, 116,112,117,116, 40, 34, 92,110,115,116, 97,116,105, 99, 32, 105,110,116, 34, 44,115,101,108,102, 46, 99,110, 97,109,101, 46, 46, 34, 95,108,111, 99, 97,108, 34, 44, 34, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32,116,111,108,117, 97, 95, 83, 41, 34, 41, 10, 32,101,108,115,101, 10, 32, 32,111,117, 116,112,117,116, 40, 34, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 95, 34, 46, 46,115,101,108,102, 46, 99,110, 97,109,101, 41, 10, 32, 32, 111,117,116,112,117,116, 40, 34, 92,110,115,116, 97,116,105, 99, 32,105,110,116, 34, 44,115,101,108,102, 46, 99,110, 97, 109,101, 44, 34, 40,108,117, 97, 95, 83,116, 97,116,101, 42, 32,116,111,108,117, 97, 95, 83, 41, 34, 41, 10, 32,101,110, 100, 10, 32,111,117,116,112,117,116, 40, 34,123, 34, 41, 10, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,116,121,112,101, 115, 10, 9,105,102, 32,111,118,101,114,108,111, 97,100, 32, 60, 32, 48, 32,116,104,101,110, 10, 9, 32,111,117,116,112, 117,116, 40, 39, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9,101,110,100, 10, 9,111,117,116,112,117,116, 40, 39, 32, 116,111,108,117, 97, 95, 69,114,114,111,114, 32,116,111,108, 117, 97, 95,101,114,114, 59, 39, 41, 10, 32,111,117,116,112, 117,116, 40, 39, 32,105,102, 32, 40, 92,110, 39, 41, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,115,101,108,102, 10, 32, 108,111, 99, 97,108, 32,110, 97,114,103, 10, 32,105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 32,110, 97,114,103, 61, 50, 32,101,108,115,101, 32,110, 97,114,103, 61, 49, 32, 101,110,100, 10, 32,105,102, 32, 99,108, 97,115,115, 32,116, 104,101,110, 10, 9, 9,108,111, 99, 97,108, 32,102,117,110, 99, 32, 61, 32,103,101,116, 95,105,115, 95,102,117,110, 99, 116,105,111,110, 40,115,101,108,102, 46,112, 97,114,101,110, 116, 46,116,121,112,101, 41, 10, 9, 9,108,111, 99, 97,108, 32,116,121,112,101, 32, 61, 32,115,101,108,102, 46,112, 97, 114,101,110,116, 46,116,121,112,101, 10, 9, 9,105,102, 32, 115,101,108,102, 46,110, 97,109,101, 61, 61, 39,110,101,119, 39, 32,111,114, 32,115,116, 97,116,105, 99,126, 61,110,105, 108, 32,116,104,101,110, 10, 9, 9, 9,102,117,110, 99, 32, 61, 32, 39,116,111,108,117, 97, 95,105,115,117,115,101,114, 116, 97, 98,108,101, 39, 10, 9, 9, 9,116,121,112,101, 32, 61, 32,115,101,108,102, 46,112, 97,114,101,110,116, 46,116, 121,112,101, 10, 9, 9,101,110,100, 10, 9, 9,105,102, 32, 115,101,108,102, 46, 99,111,110,115,116, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 9, 9, 9,116,121,112,101, 32, 61, 32, 34, 99,111,110,115,116, 32, 34, 46, 46,116,121,112, 101, 10, 9, 9,101,110,100, 10, 9, 9,111,117,116,112,117, 116, 40, 39, 32, 32, 32, 32, 32, 33, 39, 46, 46,102,117,110, 99, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 49, 44, 34, 39, 46, 46,116,121,112,101, 46, 46, 39, 34, 44, 48, 44, 38,116,111,108,117, 97, 95,101,114,114, 41, 32,124,124, 92, 110, 39, 41, 10, 32,101,110,100, 10, 32, 45, 45, 32, 99,104, 101, 99,107, 32, 97,114,103,115, 10, 32,105,102, 32,115,101, 108,102, 46, 97,114,103,115, 91, 49, 93, 46,116,121,112,101, 32,126, 61, 32, 39,118,111,105,100, 39, 32,116,104,101,110, 10, 32, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32, 32, 119,104,105,108,101, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 32,100,111, 10, 32, 32, 32,108,111, 99, 97,108, 32, 98,116,121,112,101, 32, 61, 32,105,115, 98, 97,115,105, 99, 40,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 46, 116,121,112,101, 41, 10, 32, 32, 32,105,102, 32, 98,116,121, 112,101, 32,126, 61, 32, 39,118, 97,108,117,101, 39, 32, 97, 110,100, 32, 98,116,121,112,101, 32,126, 61, 32, 39,115,116, 97,116,101, 39, 32,116,104,101,110, 10, 32, 32, 32, 32,111, 117,116,112,117,116, 40, 39, 32, 32, 32, 32, 32, 39, 46, 46, 115,101,108,102, 46, 97,114,103,115, 91,105, 93, 58,111,117, 116, 99,104,101, 99,107,116,121,112,101, 40,110, 97,114,103, 41, 46, 46, 39, 32,124,124, 92,110, 39, 41, 10, 32, 32, 32, 101,110,100, 10, 32, 32, 32,105,102, 32, 98,116,121,112,101, 32,126, 61, 32, 39,115,116, 97,116,101, 39, 32,116,104,101, 110, 10, 9, 32, 32, 32,110, 97,114,103, 32, 61, 32,110, 97, 114,103, 43, 49, 10, 32, 32, 32,101,110,100, 10, 32, 32, 32, 105, 32, 61, 32,105, 43, 49, 10, 32, 32,101,110,100, 10, 32, 101,110,100, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,101, 110,100, 32,111,102, 32,108,105,115,116, 10, 32,111,117,116, 112,117,116, 40, 39, 32, 32, 32, 32, 32, 33,116,111,108,117, 97, 95,105,115,110,111,111, 98,106, 40,116,111,108,117, 97, 95, 83, 44, 39, 46, 46,110, 97,114,103, 46, 46, 39, 44, 38, 116,111,108,117, 97, 95,101,114,114, 41, 92,110, 32, 41, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 32, 32,103,111, 116,111, 32,116,111,108,117, 97, 95,108,101,114,114,111,114, 59, 39, 41, 10, 10, 32,111,117,116,112,117,116, 40, 39, 32, 101,108,115,101, 92,110, 39, 41, 10, 9,105,102, 32,111,118, 101,114,108,111, 97,100, 32, 60, 32, 48, 32,116,104,101,110, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35,101,110,100, 105,102, 92,110, 39, 41, 10, 9,101,110,100, 10, 9,111,117, 116,112,117,116, 40, 39, 32,123, 39, 41, 10, 10, 32, 45, 45, 32,100,101, 99,108, 97,114,101, 32,115,101,108,102, 44, 32, 105,102, 32,116,104,101, 32, 99, 97,115,101, 10, 32,108,111, 99, 97,108, 32,110, 97,114,103, 10, 32,105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 32,110, 97,114,103, 61, 50, 32,101,108,115,101, 32,110, 97,114,103, 61, 49, 32,101,110, 100, 10, 32,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,101,108,102, 46,110, 97,109,101,126, 61, 39,110,101, 119, 39, 32, 97,110,100, 32,115,116, 97,116,105, 99, 61, 61, 110,105,108, 32,116,104,101,110, 10, 32, 32,111,117,116,112, 117,116, 40, 39, 32, 39, 44,115,101,108,102, 46, 99,111,110, 115,116, 44,115,101,108,102, 46,112, 97,114,101,110,116, 46, 116,121,112,101, 44, 39, 42, 39, 44, 39,115,101,108,102, 32, 61, 32, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40, 39, 40, 39, 44,115,101,108,102, 46, 99,111,110,115,116, 44,115, 101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 44, 39, 42, 41, 32, 39, 41, 10, 32, 32,108,111, 99, 97,108, 32,116,111, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95, 116,111, 95,102,117,110, 99,116,105,111,110, 40,115,101,108, 102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 41, 10, 32, 32,111,117,116,112,117,116, 40,116,111, 95,102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 49, 44, 48, 41, 59, 39, 41, 10, 32,101,108,115,101,105,102, 32,115,116, 97,116,105, 99, 32,116,104,101,110, 10, 32, 32, 95, 44, 95, 44,115,101,108,102, 46,109,111,100, 32, 61, 32,115,116,114, 102,105,110,100, 40,115,101,108,102, 46,109,111,100, 44, 39, 94, 37,115, 42,115,116, 97,116,105, 99, 37,115, 37,115, 42, 40, 46, 42, 41, 39, 41, 10, 32,101,110,100, 10, 32, 45, 45, 32,100,101, 99,108, 97,114,101, 32,112, 97,114, 97,109,101, 116,101,114,115, 10, 32,105,102, 32,115,101,108,102, 46, 97, 114,103,115, 91, 49, 93, 46,116,121,112,101, 32,126, 61, 32, 39,118,111,105,100, 39, 32,116,104,101,110, 10, 32, 32,108, 111, 99, 97,108, 32,105, 61, 49, 10, 32, 32,119,104,105,108, 101, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 32, 100,111, 10, 32, 32, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 58,100,101, 99,108, 97,114,101, 40,110, 97,114, 103, 41, 10, 32, 32, 32,105,102, 32,105,115, 98, 97,115,105, 99, 40,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 46, 116,121,112,101, 41, 32,126, 61, 32, 34,115,116, 97,116,101, 34, 32,116,104,101,110, 10, 9, 32, 32, 32,110, 97,114,103, 32, 61, 32,110, 97,114,103, 43, 49, 10, 32, 32, 32,101,110, 100, 10, 32, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32, 32, 101,110,100, 10, 32,101,110,100, 10, 10, 32, 45, 45, 32, 99, 104,101, 99,107, 32,115,101,108,102, 10, 32,105,102, 32, 99, 108, 97,115,115, 32, 97,110,100, 32,115,101,108,102, 46,110, 97,109,101,126, 61, 39,110,101,119, 39, 32, 97,110,100, 32, 115,116, 97,116,105, 99, 61, 61,110,105,108, 32,116,104,101, 110, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35,105,102, 110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 32, 32,111,117,116,112,117, 116, 40, 39, 32, 32,105,102, 32, 40, 33,115,101,108,102, 41, 32,116,111,108,117, 97, 95,101,114,114,111,114, 40,116,111, 108,117, 97, 95, 83, 44, 34,105,110,118, 97,108,105,100, 32, 92, 39,115,101,108,102, 92, 39, 32,105,110, 32,102,117,110, 99,116,105,111,110, 32, 92, 39, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 46, 46, 39, 92, 39, 34, 44, 78, 85, 76, 76, 41, 59, 39, 41, 59, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 32,101, 110,100, 10, 10, 32, 45, 45, 32,103,101,116, 32, 97,114,114, 97,121, 32,101,108,101,109,101,110,116, 32,118, 97,108,117, 101,115, 10, 32,105,102, 32, 99,108, 97,115,115, 32,116,104, 101,110, 32,110, 97,114,103, 61, 50, 32,101,108,115,101, 32, 110, 97,114,103, 61, 49, 32,101,110,100, 10, 32,105,102, 32, 115,101,108,102, 46, 97,114,103,115, 91, 49, 93, 46,116,121, 112,101, 32,126, 61, 32, 39,118,111,105,100, 39, 32,116,104, 101,110, 10, 32, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32, 32,119,104,105,108,101, 32,115,101,108,102, 46, 97,114, 103,115, 91,105, 93, 32,100,111, 10, 32, 32, 32,115,101,108, 102, 46, 97,114,103,115, 91,105, 93, 58,103,101,116, 97,114, 114, 97,121, 40,110, 97,114,103, 41, 10, 32, 32, 32,110, 97, 114,103, 32, 61, 32,110, 97,114,103, 43, 49, 10, 32, 32, 32, 105, 32, 61, 32,105, 43, 49, 10, 32, 32,101,110,100, 10, 32, 101,110,100, 10, 10, 32,108,111, 99, 97,108, 32,111,117,116, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110,100, 40, 115,101,108,102, 46,109,111,100, 44, 32, 34,116,111,108,117, 97, 95,111,117,116,115,105,100,101, 34, 41, 10, 32, 45, 45, 32, 99, 97,108,108, 32,102,117,110, 99,116,105,111,110, 10, 32,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115, 101,108,102, 46,110, 97,109,101, 61, 61, 39,100,101,108,101, 116,101, 39, 32,116,104,101,110, 10, 32, 32,111,117,116,112, 117,116, 40, 39, 32, 32, 77,116,111,108,117, 97, 95,100,101, 108,101,116,101, 40,115,101,108,102, 41, 59, 39, 41, 10, 32, 101,108,115,101,105,102, 32, 99,108, 97,115,115, 32, 97,110, 100, 32,115,101,108,102, 46,110, 97,109,101, 32, 61, 61, 32, 39,111,112,101,114, 97,116,111,114, 38, 91, 93, 39, 32,116, 104,101,110, 10, 32, 32,105,102, 32,102,108, 97,103,115, 91, 39, 49, 39, 93, 32,116,104,101,110, 32, 45, 45, 32,102,111, 114, 32, 99,111,109,112, 97,116,105, 98,105,108,105,116,121, 32,119,105,116,104, 32,116,111,108,117, 97, 53, 32, 63, 10, 9,111,117,116,112,117,116, 40, 39, 32, 32,115,101,108,102, 45, 62,111,112,101,114, 97,116,111,114, 91, 93, 40, 39, 44, 115,101,108,102, 46, 97,114,103,115, 91, 49, 93, 46,110, 97, 109,101, 44, 39, 45, 49, 41, 32, 61, 32, 39, 44,115,101,108, 102, 46, 97,114,103,115, 91, 50, 93, 46,110, 97,109,101, 44, 39, 59, 39, 41, 10, 32, 32,101,108,115,101, 10, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32,115,101,108,102, 45, 62,111,112,101,114, 97,116,111,114, 91, 93, 40, 39, 44, 115,101,108,102, 46, 97,114,103,115, 91, 49, 93, 46,110, 97, 109,101, 44, 39, 41, 32, 61, 32, 39, 44,115,101,108,102, 46, 97,114,103,115, 91, 50, 93, 46,110, 97,109,101, 44, 39, 59, 39, 41, 10, 32, 32,101,110,100, 10, 32,101,108,115,101, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32,123, 39, 41, 10, 32, 32,105,102, 32,115,101,108,102, 46,116,121,112,101, 32,126, 61, 32, 39, 39, 32, 97,110,100, 32,115,101,108,102, 46,116,121,112,101, 32,126, 61, 32, 39,118,111,105,100, 39, 32,116,104,101,110, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 39, 44,115,101,108,102, 46,109,111,100, 44, 115,101,108,102, 46,116,121,112,101, 44,115,101,108,102, 46, 112,116,114, 44, 39,116,111,108,117, 97, 95,114,101,116, 32, 61, 32, 39, 41, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 40, 39, 44,115,101,108,102, 46,109,111,100, 44,115,101, 108,102, 46,116,121,112,101, 44,115,101,108,102, 46,112,116, 114, 44, 39, 41, 32, 39, 41, 10, 32, 32,101,108,115,101, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 39, 41, 10, 32, 32,101,110,100, 10, 32, 32,105,102, 32, 99,108, 97, 115,115, 32, 97,110,100, 32,115,101,108,102, 46,110, 97,109, 101, 61, 61, 39,110,101,119, 39, 32,116,104,101,110, 10, 32, 32, 32,111,117,116,112,117,116, 40, 39, 77,116,111,108,117, 97, 95,110,101,119, 40, 40, 39, 44,115,101,108,102, 46,116, 121,112,101, 44, 39, 41, 40, 39, 41, 10, 32, 32,101,108,115, 101,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115, 116, 97,116,105, 99, 32,116,104,101,110, 10, 9,105,102, 32, 111,117,116, 32,116,104,101,110, 10, 9, 9,111,117,116,112, 117,116, 40,115,101,108,102, 46,110, 97,109,101, 44, 39, 40, 39, 41, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,112, 117,116, 40, 99,108, 97,115,115, 46, 46, 39, 58, 58, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 44, 39, 40, 39, 41, 10, 9,101,110,100, 10, 32, 32,101,108,115,101,105,102, 32, 99,108, 97,115,115, 32,116,104,101,110, 10, 9,105,102, 32, 111,117,116, 32,116,104,101,110, 10, 9, 9,111,117,116,112, 117,116, 40,115,101,108,102, 46,110, 97,109,101, 44, 39, 40, 39, 41, 10, 9,101,108,115,101, 10, 9, 32, 32,105,102, 32, 115,101,108,102, 46, 99, 97,115,116, 95,111,112,101,114, 97, 116,111,114, 32,116,104,101,110, 10, 9, 32, 32, 9, 45, 45, 111,117,116,112,117,116, 40, 39,115,116, 97,116,105, 99, 95, 99, 97,115,116, 60, 39, 44,115,101,108,102, 46,109,111,100, 44,115,101,108,102, 46,116,121,112,101, 44,115,101,108,102, 46,112,116,114, 44, 39, 62, 40, 42,115,101,108,102, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39,115,101,108,102, 45, 62,111,112,101,114, 97,116,111,114, 32, 39, 44,115,101, 108,102, 46,109,111,100, 44,115,101,108,102, 46,116,121,112, 101, 44, 39, 40, 39, 41, 10, 9, 32, 32,101,108,115,101, 10, 9, 9,111,117,116,112,117,116, 40, 39,115,101,108,102, 45, 62, 39, 46, 46,115,101,108,102, 46,110, 97,109,101, 44, 39, 40, 39, 41, 10, 9, 32, 32,101,110,100, 10, 9,101,110,100, 10, 32, 32,101,108,115,101, 10, 32, 32, 32,111,117,116,112, 117,116, 40,115,101,108,102, 46,110, 97,109,101, 44, 39, 40, 39, 41, 10, 32, 32,101,110,100, 10, 10, 32, 32,105,102, 32, 111,117,116, 32, 97,110,100, 32,110,111,116, 32,115,116, 97, 116,105, 99, 32,116,104,101,110, 10, 32, 32, 9,111,117,116, 112,117,116, 40, 39,115,101,108,102, 39, 41, 10, 9,105,102, 32,115,101,108,102, 46, 97,114,103,115, 91, 49, 93, 32, 97, 110,100, 32,115,101,108,102, 46, 97,114,103,115, 91, 49, 93, 46,110, 97,109,101, 32,126, 61, 32, 39, 39, 32,116,104,101, 110, 10, 9, 9,111,117,116,112,117,116, 40, 39, 44, 39, 41, 10, 9,101,110,100, 10, 32, 32,101,110,100, 10, 32, 32, 45, 45, 32,119,114,105,116,101, 32,112, 97,114, 97,109,101,116, 101,114,115, 10, 32, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32, 32,119,104,105,108,101, 32,115,101,108,102, 46, 97, 114,103,115, 91,105, 93, 32,100,111, 10, 32, 32, 32,115,101, 108,102, 46, 97,114,103,115, 91,105, 93, 58,112, 97,115,115, 112, 97,114, 40, 41, 10, 32, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32, 32, 32,105,102, 32,115,101,108,102, 46, 97,114, 103,115, 91,105, 93, 32,116,104,101,110, 10, 32, 32, 32, 32, 111,117,116,112,117,116, 40, 39, 44, 39, 41, 10, 32, 32, 32, 101,110,100, 10, 32, 32,101,110,100, 10, 10, 32, 32,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,101,108,102, 46,110, 97,109,101, 32, 61, 61, 32, 39,111,112,101,114, 97, 116,111,114, 91, 93, 39, 32, 97,110,100, 32,102,108, 97,103, 115, 91, 39, 49, 39, 93, 32,116,104,101,110, 10, 9,111,117, 116,112,117,116, 40, 39, 45, 49, 41, 59, 39, 41, 10, 32, 32, 101,108,115,101, 10, 9,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,101,108,102, 46,110, 97,109,101, 61, 61, 39,110,101,119, 39, 32,116,104,101,110, 10, 9, 9,111,117, 116,112,117,116, 40, 39, 41, 41, 59, 39, 41, 32, 45, 45, 32, 99,108,111,115,101, 32, 77,116,111,108,117, 97, 95,110,101, 119, 40, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,112, 117,116, 40, 39, 41, 59, 39, 41, 10, 9,101,110,100, 10, 32, 32,101,110,100, 10, 10, 32, 32, 45, 45, 32,114,101,116,117, 114,110, 32,118, 97,108,117,101,115, 10, 32, 32,105,102, 32, 115,101,108,102, 46,116,121,112,101, 32,126, 61, 32, 39, 39, 32, 97,110,100, 32,115,101,108,102, 46,116,121,112,101, 32, 126, 61, 32, 39,118,111,105,100, 39, 32,116,104,101,110, 10, 32, 32, 32,110,114,101,116, 32, 61, 32,110,114,101,116, 32, 43, 32, 49, 10, 32, 32, 32,108,111, 99, 97,108, 32,116, 44, 99,116, 32, 61, 32,105,115, 98, 97,115,105, 99, 40,115,101, 108,102, 46,116,121,112,101, 41, 10, 32, 32, 32,105,102, 32, 116, 32,116,104,101,110, 10, 32, 32, 32, 9,105,102, 32,115, 101,108,102, 46, 99, 97,115,116, 95,111,112,101,114, 97,116, 111,114, 32, 97,110,100, 32, 95, 98, 97,115,105, 99, 95,114, 97,119, 95,112,117,115,104, 91,116, 93, 32,116,104,101,110, 10, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 32, 39, 44, 95, 98, 97,115,105, 99, 95,114, 97,119, 95,112,117,115, 104, 91,116, 93, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40, 39, 44, 99,116, 44, 39, 41,116,111,108,117, 97, 95,114, 101,116, 41, 59, 39, 41, 10, 32, 32, 32, 9,101,108,115,101, 10, 9, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,116,111,108,117, 97, 95,112,117,115,104, 39, 46, 46, 116, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 40, 39, 44, 99,116, 44, 39, 41,116,111,108,117, 97, 95,114,101,116, 41, 59, 39, 41, 10, 9,101,110,100, 10, 32, 32, 32,101,108, 115,101, 10, 9,116, 32, 61, 32,115,101,108,102, 46,116,121, 112,101, 10, 9,110,101,119, 95,116, 32, 61, 32,115,116,114, 105,110,103, 46,103,115,117, 98, 40,116, 44, 32, 34, 99,111, 110,115,116, 37,115, 43, 34, 44, 32, 34, 34, 41, 10, 9,108, 111, 99, 97,108, 32,111,119,110,101,100, 32, 61, 32,102, 97, 108,115,101, 10, 9,105,102, 32,115,116,114,105,110,103, 46, 102,105,110,100, 40,115,101,108,102, 46,109,111,100, 44, 32, 34,116,111,108,117, 97, 95,111,119,110,101,100, 34, 41, 32, 116,104,101,110, 10, 9, 9,111,119,110,101,100, 32, 61, 32, 116,114,117,101, 10, 9,101,110,100, 10, 32, 32, 32, 32,108, 111, 99, 97,108, 32,112,117,115,104, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95,112,117,115,104, 95,102,117,110, 99, 116,105,111,110, 40,116, 41, 10, 32, 32, 32, 32,105,102, 32, 115,101,108,102, 46,112,116,114, 32, 61, 61, 32, 39, 39, 32, 116,104,101,110, 10, 32, 32, 32, 32, 32,111,117,116,112,117, 116, 40, 39, 32, 32, 32,123, 39, 41, 10, 32, 32, 32, 32, 32, 111,117,116,112,117,116, 40, 39, 35,105,102,100,101,102, 32, 95, 95, 99,112,108,117,115,112,108,117,115, 92,110, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,118,111,105,100, 42, 32,116,111,108,117, 97, 95, 111, 98,106, 32, 61, 32, 77,116,111,108,117, 97, 95,110,101, 119, 40, 40, 39, 44,110,101,119, 95,116, 44, 39, 41, 40,116, 111,108,117, 97, 95,114,101,116, 41, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32, 39, 44,112,117,115,104, 95,102,117,110, 99, 44, 39, 40, 116,111,108,117, 97, 95, 83, 44,116,111,108,117, 97, 95,111, 98,106, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,116,111,108,117, 97, 95,114,101,103,105,115,116,101, 114, 95,103, 99, 40,116,111,108,117, 97, 95, 83, 44,108,117, 97, 95,103,101,116,116,111,112, 40,116,111,108,117, 97, 95, 83, 41, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116, 112,117,116, 40, 39, 35,101,108,115,101, 92,110, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,118,111,105,100, 42, 32,116,111,108,117, 97, 95,111, 98,106, 32, 61, 32,116,111,108,117, 97, 95, 99,111,112,121, 40,116,111,108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41, 38,116,111,108,117, 97, 95,114,101,116, 44,115,105,122, 101,111,102, 40, 39, 44,116, 44, 39, 41, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32, 39, 44,112,117,115,104, 95,102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44,116,111,108,117, 97, 95, 111, 98,106, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,116,111,108,117, 97, 95,114,101,103,105,115,116, 101,114, 95,103, 99, 40,116,111,108,117, 97, 95, 83, 44,108, 117, 97, 95,103,101,116,116,111,112, 40,116,111,108,117, 97, 95, 83, 41, 41, 59, 39, 41, 10, 32, 32, 32, 32, 32,111,117, 116,112,117,116, 40, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 32, 32, 32, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32, 32,125, 39, 41, 10, 32, 32, 32, 32,101,108,115,101, 105,102, 32,115,101,108,102, 46,112,116,114, 32, 61, 61, 32, 39, 38, 39, 32,116,104,101,110, 10, 32, 32, 32, 32, 32,111, 117,116,112,117,116, 40, 39, 32, 32, 32, 39, 44,112,117,115, 104, 95,102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41, 38,116,111,108,117, 97, 95,114,101,116, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 32, 32, 32, 32,101,108,115,101, 10, 9, 32,111,117, 116,112,117,116, 40, 39, 32, 32, 32, 39, 44,112,117,115,104, 95,102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41,116,111,108,117, 97, 95,114, 101,116, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 9, 32,105,102, 32,111,119,110,101,100, 32,111,114, 32,108, 111, 99, 97,108, 95, 99,111,110,115,116,114,117, 99,116,111, 114, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32,111,117, 116,112,117,116, 40, 39, 32, 32, 32, 32,116,111,108,117, 97, 95,114,101,103,105,115,116,101,114, 95,103, 99, 40,116,111, 108,117, 97, 95, 83, 44,108,117, 97, 95,103,101,116,116,111, 112, 40,116,111,108,117, 97, 95, 83, 41, 41, 59, 39, 41, 10, 9, 32,101,110,100, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32,101,110,100, 10, 32, 32,101,110,100, 10, 32, 32,108, 111, 99, 97,108, 32,105, 61, 49, 10, 32, 32,119,104,105,108, 101, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 32, 100,111, 10, 32, 32, 32,110,114,101,116, 32, 61, 32,110,114, 101,116, 32, 43, 32,115,101,108,102, 46, 97,114,103,115, 91, 105, 93, 58,114,101,116,118, 97,108,117,101, 40, 41, 10, 32, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32, 32,101,110,100, 10, 32, 32,111,117,116,112,117,116, 40, 39, 32, 32,125, 39, 41, 10, 10, 32, 32, 45, 45, 32,115,101,116, 32, 97,114,114, 97,121, 32,101,108,101,109,101,110,116, 32,118, 97,108,117, 101,115, 10, 32, 32,105,102, 32, 99,108, 97,115,115, 32,116, 104,101,110, 32,110, 97,114,103, 61, 50, 32,101,108,115,101, 32,110, 97,114,103, 61, 49, 32,101,110,100, 10, 32, 32,105, 102, 32,115,101,108,102, 46, 97,114,103,115, 91, 49, 93, 46, 116,121,112,101, 32,126, 61, 32, 39,118,111,105,100, 39, 32, 116,104,101,110, 10, 32, 32, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32, 32, 32,119,104,105,108,101, 32,115,101,108, 102, 46, 97,114,103,115, 91,105, 93, 32,100,111, 10, 32, 32, 32, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 58, 115,101,116, 97,114,114, 97,121, 40,110, 97,114,103, 41, 10, 32, 32, 32, 32,110, 97,114,103, 32, 61, 32,110, 97,114,103, 43, 49, 10, 32, 32, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32, 32, 32,101,110,100, 10, 32, 32,101,110,100, 10, 10, 32, 32, 45, 45, 32,102,114,101,101, 32,100,121,110, 97,109,105, 99, 97,108,108,121, 32, 97,108,108,111, 99, 97,116,101,100, 32, 97,114,114, 97,121, 10, 32, 32,105,102, 32,115,101,108, 102, 46, 97,114,103,115, 91, 49, 93, 46,116,121,112,101, 32, 126, 61, 32, 39,118,111,105,100, 39, 32,116,104,101,110, 10, 32, 32, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32, 32, 32,119,104,105,108,101, 32,115,101,108,102, 46, 97,114,103, 115, 91,105, 93, 32,100,111, 10, 32, 32, 32, 32,115,101,108, 102, 46, 97,114,103,115, 91,105, 93, 58,102,114,101,101, 97, 114,114, 97,121, 40, 41, 10, 32, 32, 32, 32,105, 32, 61, 32, 105, 43, 49, 10, 32, 32, 32,101,110,100, 10, 32, 32,101,110, 100, 10, 32,101,110,100, 10, 10, 32,111,117,116,112,117,116, 40, 39, 32,125, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 32,114,101,116,117,114,110, 32, 39, 46, 46,110,114,101, 116, 46, 46, 39, 59, 39, 41, 10, 10, 32, 45, 45, 32, 99, 97, 108,108, 32,111,118,101,114,108,111, 97,100,101,100, 32,102, 117,110, 99,116,105,111,110, 32,111,114, 32,103,101,110,101, 114, 97,116,101, 32,101,114,114,111,114, 10, 9,105,102, 32, 111,118,101,114,108,111, 97,100, 32, 60, 32, 48, 32,116,104, 101,110, 10, 10, 9, 9,111,117,116,112,117,116, 40, 39, 35, 105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9, 9,111,117,116, 112,117,116, 40, 39,116,111,108,117, 97, 95,108,101,114,114, 111,114, 58, 92,110, 39, 41, 10, 9, 9,111,117,116,112,117, 116, 40, 39, 32,116,111,108,117, 97, 95,101,114,114,111,114, 40,116,111,108,117, 97, 95, 83, 44, 34, 35,102,101,114,114, 111,114, 32,105,110, 32,102,117,110, 99,116,105,111,110, 32, 92, 39, 39, 46, 46,115,101,108,102, 46,108,110, 97,109,101, 46, 46, 39, 92, 39, 46, 34, 44, 38,116,111,108,117, 97, 95, 101,114,114, 41, 59, 39, 41, 10, 9, 9,111,117,116,112,117, 116, 40, 39, 32,114,101,116,117,114,110, 32, 48, 59, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40, 39, 35,101,110,100, 105,102, 92,110, 39, 41, 10, 9,101,108,115,101, 10, 9, 9, 108,111, 99, 97,108, 32, 95,108,111, 99, 97,108, 32, 61, 32, 34, 34, 10, 9, 9,105,102, 32,108,111, 99, 97,108, 95, 99, 111,110,115,116,114,117, 99,116,111,114, 32,116,104,101,110, 10, 9, 9, 9, 95,108,111, 99, 97,108, 32, 61, 32, 34, 95, 108,111, 99, 97,108, 34, 10, 9, 9,101,110,100, 10, 9, 9, 111,117,116,112,117,116, 40, 39,116,111,108,117, 97, 95,108, 101,114,114,111,114, 58, 92,110, 39, 41, 10, 9, 9,111,117, 116,112,117,116, 40, 39, 32,114,101,116,117,114,110, 32, 39, 46, 46,115,116,114,115,117, 98, 40,115,101,108,102, 46, 99, 110, 97,109,101, 44, 49, 44, 45, 51, 41, 46, 46,102,111,114, 109, 97,116, 40, 34, 37, 48, 50,100, 34, 44,111,118,101,114, 108,111, 97,100, 41, 46, 46, 95,108,111, 99, 97,108, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 41, 59, 39, 41, 10, 9, 101,110,100, 10, 32,111,117,116,112,117,116, 40, 39,125, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 35,101,110,100, 105,102, 32, 47, 47, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 92,110, 39, 41, 10, 32,111,117,116,112,117,116, 40, 39, 92,110, 39, 41, 10, 10, 9, 45, 45, 32,114,101, 99,117,114,115,105,118,101, 32, 99, 97,108,108, 32,116,111, 32,119,114,105,116,101, 32,108, 111, 99, 97,108, 32, 99,111,110,115,116,114,117, 99,116,111, 114, 10, 9,105,102, 32, 99,108, 97,115,115, 32, 97,110,100, 32,115,101,108,102, 46,110, 97,109,101, 61, 61, 39,110,101, 119, 39, 32, 97,110,100, 32,110,111,116, 32,108,111, 99, 97, 108, 95, 99,111,110,115,116,114,117, 99,116,111,114, 32,116, 104,101,110, 10, 10, 9, 9,115,101,108,102, 58,115,117,112, 99,111,100,101, 40, 49, 41, 10, 9,101,110,100, 10, 10,101, 110,100, 10, 10, 10, 45, 45, 32,114,101,103,105,115,116,101, 114, 32,102,117,110, 99,116,105,111,110, 10,102,117,110, 99, 116,105,111,110, 32, 99,108, 97,115,115, 70,117,110, 99,116, 105,111,110, 58,114,101,103,105,115,116,101,114, 32, 40,112, 114,101, 41, 10, 10, 9,105,102, 32,110,111,116, 32,115,101, 108,102, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 32,116,104,101,110, 10, 9, 9,114,101,116,117,114,110, 10, 9,101,110,100, 10, 10, 32, 9,105,102, 32,115,101,108,102, 46,110, 97,109,101, 32, 61, 61, 32, 39,110,101,119, 39, 32, 97,110,100, 32,115,101, 108,102, 46,112, 97,114,101,110,116, 46,102,108, 97,103,115, 46,112,117,114,101, 95,118,105,114,116,117, 97,108, 32,116, 104,101,110, 10, 32, 9, 9, 45, 45, 32,110,111, 32, 99,111, 110,115,116,114,117, 99,116,111,114, 32,102,111,114, 32, 99, 108, 97,115,115,101,115, 32,119,105,116,104, 32,112,117,114, 101, 32,118,105,114,116,117, 97,108, 32,109,101,116,104,111, 100,115, 10, 32, 9, 9,114,101,116,117,114,110, 10, 32, 9, 101,110,100, 10, 10, 32,111,117,116,112,117,116, 40,112,114, 101, 46, 46, 39,116,111,108,117, 97, 95,102,117,110, 99,116, 105,111,110, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101,108,102, 46,108,110, 97,109,101, 46, 46, 39, 34, 44, 39, 46, 46,115,101,108,102, 46, 99,110, 97,109,101, 46, 46, 39, 41, 59, 39, 41, 10, 32, 32,105,102, 32,115,101,108, 102, 46,110, 97,109,101, 32, 61, 61, 32, 39,110,101,119, 39, 32,116,104,101,110, 10, 9, 32, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 39,116,111,108,117, 97, 95,102,117, 110, 99,116,105,111,110, 40,116,111,108,117, 97, 95, 83, 44, 34,110,101,119, 95,108,111, 99, 97,108, 34, 44, 39, 46, 46, 115,101,108,102, 46, 99,110, 97,109,101, 46, 46, 39, 95,108, 111, 99, 97,108, 41, 59, 39, 41, 10, 9, 32, 32,111,117,116, 112,117,116, 40,112,114,101, 46, 46, 39,116,111,108,117, 97, 95,102,117,110, 99,116,105,111,110, 40,116,111,108,117, 97, 95, 83, 44, 34, 46, 99, 97,108,108, 34, 44, 39, 46, 46,115, 101,108,102, 46, 99,110, 97,109,101, 46, 46, 39, 95,108,111, 99, 97,108, 41, 59, 39, 41, 10, 9, 32, 32, 45, 45,111,117, 116,112,117,116, 40, 39, 32,116,111,108,117, 97, 95,115,101, 116, 95, 99, 97,108,108, 95,101,118,101,110,116, 40,116,111, 108,117, 97, 95, 83, 44, 39, 46, 46,115,101,108,102, 46, 99, 110, 97,109,101, 46, 46, 39, 95,108,111, 99, 97,108, 44, 32, 34, 39, 46, 46,115,101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 46, 46, 39, 34, 41, 59, 39, 41, 10, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 80,114, 105,110,116, 32,109,101,116,104,111,100, 10,102,117,110, 99, 116,105,111,110, 32, 99,108, 97,115,115, 70,117,110, 99,116, 105,111,110, 58,112,114,105,110,116, 32, 40,105,100,101,110, 116, 44, 99,108,111,115,101, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 70,117,110, 99,116,105, 111,110,123, 34, 41, 10, 32,112,114,105,110,116, 40,105,100, 101,110,116, 46, 46, 34, 32,109,111,100, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,109,111,100, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110, 116, 46, 46, 34, 32,116,121,112,101, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,116,121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,112,116,114, 32, 32, 61, 32, 39, 34, 46, 46, 115,101,108,102, 46,112,116,114, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101, 108,102, 46,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,108,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101, 108,102, 46,108,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 99,111,110,115,116, 32, 61, 32, 39, 34, 46, 46,115, 101,108,102, 46, 99,111,110,115,116, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 99,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46, 115,101,108,102, 46, 99,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,108,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,108,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110, 116, 46, 46, 34, 32, 97,114,103,115, 32, 61, 32,123, 34, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104, 105,108,101, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 32,100,111, 10, 32, 32,115,101,108,102, 46, 97,114,103, 115, 91,105, 93, 58,112,114,105,110,116, 40,105,100,101,110, 116, 46, 46, 34, 32, 32, 34, 44, 34, 44, 34, 41, 10, 32, 32, 105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,112, 114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,125, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34,125, 34, 46, 46, 99,108,111,115,101, 41, 10,101, 110,100, 10, 10, 45, 45, 32, 99,104,101, 99,107, 32,105,102, 32,105,116, 32,114,101,116,117,114,110,115, 32, 97,110, 32, 111, 98,106,101, 99,116, 32, 98,121, 32,118, 97,108,117,101, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 70,117,110, 99,116,105,111,110, 58,114,101,113,117,105,114, 101, 99,111,108,108,101, 99,116,105,111,110, 32, 40,116, 41, 10, 9,108,111, 99, 97,108, 32,114, 32, 61, 32,102, 97,108, 115,101, 10, 9,105,102, 32,115,101,108,102, 46,116,121,112, 101, 32,126, 61, 32, 39, 39, 32, 97,110,100, 32,110,111,116, 32,105,115, 98, 97,115,105, 99, 40,115,101,108,102, 46,116, 121,112,101, 41, 32, 97,110,100, 32,115,101,108,102, 46,112, 116,114, 61, 61, 39, 39, 32,116,104,101,110, 10, 9, 9,108, 111, 99, 97,108, 32,116,121,112,101, 32, 61, 32,103,115,117, 98, 40,115,101,108,102, 46,116,121,112,101, 44, 34, 37,115, 42, 99,111,110,115,116, 37,115, 43, 34, 44, 34, 34, 41, 10, 9, 32,116, 91,116,121,112,101, 93, 32, 61, 32, 34,116,111, 108,117, 97, 95, 99,111,108,108,101, 99,116, 95, 34, 32, 46, 46, 32, 99,108,101, 97,110, 95,116,101,109,112,108, 97,116, 101, 40,116,121,112,101, 41, 10, 9, 32,114, 32, 61, 32,116, 114,117,101, 10, 9,101,110,100, 10, 9,108,111, 99, 97,108, 32,105, 61, 49, 10, 9,119,104,105,108,101, 32,115,101,108, 102, 46, 97,114,103,115, 91,105, 93, 32,100,111, 10, 9, 9, 114, 32, 61, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 58,114,101,113,117,105,114,101, 99,111,108,108,101, 99, 116,105,111,110, 40,116, 41, 32,111,114, 32,114, 10, 9, 9, 105, 32, 61, 32,105, 43, 49, 10, 9,101,110,100, 10, 9,114, 101,116,117,114,110, 32,114, 10,101,110,100, 10, 10, 45, 45, 32,100,101,116,101,114,109,105,110,101, 32,108,117, 97, 32, 102,117,110, 99,116,105,111,110, 32,110, 97,109,101, 32,111, 118,101,114,108,111, 97,100, 10,102,117,110, 99,116,105,111, 110, 32, 99,108, 97,115,115, 70,117,110, 99,116,105,111,110, 58,111,118,101,114,108,111, 97,100, 32, 40, 41, 10, 32,114, 101,116,117,114,110, 32,115,101,108,102, 46,112, 97,114,101, 110,116, 58,111,118,101,114,108,111, 97,100, 40,115,101,108, 102, 46,108,110, 97,109,101, 41, 10,101,110,100, 10, 10, 10, 102,117,110, 99,116,105,111,110, 32,112, 97,114, 97,109, 95, 111, 98,106,101, 99,116, 40,112, 97,114, 41, 32, 45, 45, 32, 114,101,116,117,114,110,115, 32,116,114,117,101, 32,105,102, 32,116,104,101, 32,112, 97,114, 97,109,101,116,101,114, 32, 104, 97,115, 32, 97,110, 32,111, 98,106,101, 99,116, 32, 97, 115, 32,105,116,115, 32,100,101,102, 97,117,108,116, 32,118, 97,108,117,101, 10, 10, 9,105,102, 32,110,111,116, 32,115, 116,114,105,110,103, 46,102,105,110,100, 40,112, 97,114, 44, 32, 39, 61, 39, 41, 32,116,104,101,110, 32,114,101,116,117, 114,110, 32,102, 97,108,115,101, 32,101,110,100, 32, 45, 45, 32,105,116, 32,104, 97,115, 32,110,111, 32,100,101,102, 97, 117,108,116, 32,118, 97,108,117,101, 10, 10, 9,108,111, 99, 97,108, 32, 95, 44, 95, 44,100,101,102, 32, 61, 32,115,116, 114,105,110,103, 46,102,105,110,100, 40,112, 97,114, 44, 32, 34, 61, 40, 46, 42, 41, 36, 34, 41, 10, 10, 9,105,102, 32, 115,116,114,105,110,103, 46,102,105,110,100, 40,112, 97,114, 44, 32, 34,124, 34, 41, 32,116,104,101,110, 32, 45, 45, 32, 97, 32,108,105,115,116, 32,111,102, 32,102,108, 97,103,115, 10, 10, 9, 9,114,101,116,117,114,110, 32,116,114,117,101, 10, 9,101,110,100, 10, 10, 9,105,102, 32,115,116,114,105, 110,103, 46,102,105,110,100, 40,112, 97,114, 44, 32, 34, 37, 42, 34, 41, 32,116,104,101,110, 32, 45, 45, 32,105,116, 39, 115, 32, 97, 32,112,111,105,110,116,101,114, 32,119,105,116, 104, 32, 97, 32,100,101,102, 97,117,108,116, 32,118, 97,108, 117,101, 10, 10, 9, 9,105,102, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,112, 97,114, 44, 32, 39, 61, 37,115, 42,110,101,119, 39, 41, 32,111,114, 32,115,116,114,105,110, 103, 46,102,105,110,100, 40,112, 97,114, 44, 32, 34, 37, 40, 34, 41, 32,116,104,101,110, 32, 45, 45, 32,105,116, 39,115, 32, 97, 32,112,111,105,110,116,101,114, 32,119,105,116,104, 32, 97,110, 32,105,110,115,116, 97,110, 99,101, 32, 97,115, 32,100,101,102, 97,117,108,116, 32,112, 97,114, 97,109,101, 116,101,114, 46, 46, 32,105,115, 32,116,104, 97,116, 32,118, 97,108,105,100, 63, 10, 9, 9, 9,114,101,116,117,114,110, 32,116,114,117,101, 10, 9, 9,101,110,100, 10, 9, 9,114, 101,116,117,114,110, 32,102, 97,108,115,101, 32, 45, 45, 32, 100,101,102, 97,117,108,116, 32,118, 97,108,117,101, 32,105, 115, 32, 39, 78, 85, 76, 76, 39, 32,111,114, 32,115,111,109, 101,116,104,105,110,103, 10, 9,101,110,100, 10, 10, 10, 9, 105,102, 32,115,116,114,105,110,103, 46,102,105,110,100, 40, 112, 97,114, 44, 32, 34, 91, 37, 40, 38, 93, 34, 41, 32,116, 104,101,110, 10, 9, 9,114,101,116,117,114,110, 32,116,114, 117,101, 10, 9,101,110,100, 32, 45, 45, 32,100,101,102, 97, 117,108,116, 32,118, 97,108,117,101, 32,105,115, 32, 97, 32, 99,111,110,115,116,114,117, 99,116,111,114, 32, 99, 97,108, 108, 32, 40,109,111,115,116, 32,108,105,107,101,108,121, 32, 102,111,114, 32, 97, 32, 99,111,110,115,116, 32,114,101,102, 101,114,101,110, 99,101, 41, 10, 10, 9, 45, 45,105,102, 32, 115,116,114,105,110,103, 46,102,105,110,100, 40,112, 97,114, 44, 32, 34, 38, 34, 41, 32,116,104,101,110, 10, 10, 9, 45, 45, 9,105,102, 32,115,116,114,105,110,103, 46,102,105,110, 100, 40,100,101,102, 44, 32, 34, 58, 34, 41, 32,111,114, 32, 115,116,114,105,110,103, 46,102,105,110,100, 40,100,101,102, 44, 32, 34, 94, 37,115, 42,110,101,119, 37,115, 43, 34, 41, 32,116,104,101,110, 10, 10, 9, 45, 45, 9, 9, 45, 45, 32, 105,116, 39,115, 32, 97, 32,114,101,102,101,114,101,110, 99, 101, 32,119,105,116,104, 32,100,101,102, 97,117,108,116, 32, 116,111, 32,115,111,109,101,116,104,105,110,103, 32,108,105, 107,101, 32, 67,108, 97,115,115, 58, 58,109,101,109, 98,101, 114, 44, 32,111,114, 32, 39,110,101,119, 32, 67,108, 97,115, 115, 39, 10, 9, 45, 45, 9, 9,114,101,116,117,114,110, 32, 116,114,117,101, 10, 9, 45, 45, 9,101,110,100, 10, 9, 45, 45,101,110,100, 10, 10, 9,114,101,116,117,114,110, 32,102, 97,108,115,101, 32, 45, 45, 32, 63, 10,101,110,100, 10, 10, 102,117,110, 99,116,105,111,110, 32,115,116,114,105,112, 95, 108, 97,115,116, 95, 97,114,103, 40, 97,108,108, 95, 97,114, 103,115, 44, 32,108, 97,115,116, 95, 97,114,103, 41, 32, 45, 45, 32,115,116,114,105,112,115, 32,116,104,101, 32,100,101, 102, 97,117,108,116, 32,118, 97,108,117,101, 32,102,114,111, 109, 32,116,104,101, 32,108, 97,115,116, 32, 97,114,103,117, 109,101,110,116, 10, 10, 9,108,111, 99, 97,108, 32, 95, 44, 95, 44,115, 95, 97,114,103, 32, 61, 32,115,116,114,105,110, 103, 46,102,105,110,100, 40,108, 97,115,116, 95, 97,114,103, 44, 32, 34, 94, 40, 91, 94, 61, 93, 43, 41, 34, 41, 10, 9, 108, 97,115,116, 95, 97,114,103, 32, 61, 32,115,116,114,105, 110,103, 46,103,115,117, 98, 40,108, 97,115,116, 95, 97,114, 103, 44, 32, 34, 40, 91, 37, 37, 37, 40, 37, 41, 93, 41, 34, 44, 32, 34, 37, 37, 37, 49, 34, 41, 59, 10, 9, 97,108,108, 95, 97,114,103,115, 32, 61, 32,115,116,114,105,110,103, 46, 103,115,117, 98, 40, 97,108,108, 95, 97,114,103,115, 44, 32, 34, 37,115, 42, 44, 37,115, 42, 34, 46, 46,108, 97,115,116, 95, 97,114,103, 46, 46, 34, 37,115, 42, 37, 41, 37,115, 42, 36, 34, 44, 32, 34, 41, 34, 41, 10, 9,114,101,116,117,114, 110, 32, 97,108,108, 95, 97,114,103,115, 44, 32,115, 95, 97, 114,103, 10,101,110,100, 10, 10, 10, 10, 45, 45, 32, 73,110, 116,101,114,110, 97,108, 32, 99,111,110,115,116,114,117, 99, 116,111,114, 10,102,117,110, 99,116,105,111,110, 32, 95, 70, 117,110, 99,116,105,111,110, 32, 40,116, 41, 10, 32,115,101, 116,109,101,116, 97,116, 97, 98,108,101, 40,116, 44, 99,108, 97,115,115, 70,117,110, 99,116,105,111,110, 41, 10, 10, 32, 105,102, 32,116, 46, 99,111,110,115,116, 32,126, 61, 32, 39, 99,111,110,115,116, 39, 32, 97,110,100, 32,116, 46, 99,111, 110,115,116, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 32, 32,101,114,114,111,114, 40, 34, 35,105,110,118, 97,108, 105,100, 32, 39, 99,111,110,115,116, 39, 32,115,112,101, 99, 105,102,105, 99, 97,116,105,111,110, 34, 41, 10, 32,101,110, 100, 10, 10, 32, 97,112,112,101,110,100, 40,116, 41, 10, 32, 105,102, 32,116, 58,105,110, 99,108, 97,115,115, 40, 41, 32, 116,104,101,110, 10, 32, 45, 45,112,114,105,110,116, 32, 40, 39,116, 46,110, 97,109,101, 32,105,115, 32, 39, 46, 46,116, 46,110, 97,109,101, 46, 46, 39, 44, 32,112, 97,114,101,110, 116, 46,110, 97,109,101, 32,105,115, 32, 39, 46, 46,116, 46, 112, 97,114,101,110,116, 46,110, 97,109,101, 41, 10, 32, 32, 105,102, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 116, 46,110, 97,109,101, 44, 32, 34, 37, 98, 60, 62, 34, 44, 32, 34, 34, 41, 32, 61, 61, 32,115,116,114,105,110,103, 46, 103,115,117, 98, 40,116, 46,112, 97,114,101,110,116, 46,111, 114,105,103,105,110, 97,108, 95,110, 97,109,101, 32,111,114, 32,116, 46,112, 97,114,101,110,116, 46,110, 97,109,101, 44, 32, 34, 37, 98, 60, 62, 34, 44, 32, 34, 34, 41, 32,116,104, 101,110, 10, 32, 32, 32,116, 46,110, 97,109,101, 32, 61, 32, 39,110,101,119, 39, 10, 32, 32, 32,116, 46,108,110, 97,109, 101, 32, 61, 32, 39,110,101,119, 39, 10, 32, 32, 32,116, 46, 112, 97,114,101,110,116, 46, 95,110,101,119, 32, 61, 32,116, 114,117,101, 10, 32, 32, 32,116, 46,116,121,112,101, 32, 61, 32,116, 46,112, 97,114,101,110,116, 46,110, 97,109,101, 10, 32, 32, 32,116, 46,112,116,114, 32, 61, 32, 39, 42, 39, 10, 32, 32,101,108,115,101,105,102, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,116, 46,110, 97,109,101, 44, 32, 34, 37, 98, 60, 62, 34, 44, 32, 34, 34, 41, 32, 61, 61, 32, 39, 126, 39, 46, 46,115,116,114,105,110,103, 46,103,115,117, 98, 40,116, 46,112, 97,114,101,110,116, 46,111,114,105,103,105, 110, 97,108, 95,110, 97,109,101, 32,111,114, 32,116, 46,112, 97,114,101,110,116, 46,110, 97,109,101, 44, 32, 34, 37, 98, 60, 62, 34, 44, 32, 34, 34, 41, 32,116,104,101,110, 10, 32, 32, 32,116, 46,110, 97,109,101, 32, 61, 32, 39,100,101,108, 101,116,101, 39, 10, 32, 32, 32,116, 46,108,110, 97,109,101, 32, 61, 32, 39,100,101,108,101,116,101, 39, 10, 32, 32, 32, 116, 46,112, 97,114,101,110,116, 46, 95,100,101,108,101,116, 101, 32, 61, 32,116,114,117,101, 10, 32, 32,101,110,100, 10, 32,101,110,100, 10, 32,116, 46, 99,110, 97,109,101, 32, 61, 32,116, 58, 99,102,117,110, 99,110, 97,109,101, 40, 34,116, 111,108,117, 97, 34, 41, 46, 46,116, 58,111,118,101,114,108, 111, 97,100, 40,116, 41, 10, 32,114,101,116,117,114,110, 32, 116, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110,115,116, 114,117, 99,116,111,114, 10, 45, 45, 32, 69,120,112,101, 99, 116,115, 32,116,104,114,101,101, 32,115,116,114,105,110,103, 115, 58, 32,111,110,101, 32,114,101,112,114,101,115,101,110, 116,105,110,103, 32,116,104,101, 32,102,117,110, 99,116,105, 111,110, 32,100,101, 99,108, 97,114, 97,116,105,111,110, 44, 10, 45, 45, 32, 97,110,111,116,104,101,114, 32,114,101,112, 114,101,115,101,110,116,105,110,103, 32,116,104,101, 32, 97, 114,103,117,109,101,110,116, 32,108,105,115,116, 44, 32, 97, 110,100, 32,116,104,101, 32,116,104,105,114,100, 32,114,101, 112,114,101,115,101,110,116,105,110,103, 10, 45, 45, 32,116, 104,101, 32, 34, 99,111,110,115,116, 34, 32,111,114, 32,101, 109,112,116,121, 32,115,116,114,105,110,103, 46, 10,102,117, 110, 99,116,105,111,110, 32, 70,117,110, 99,116,105,111,110, 32, 40,100, 44, 97, 44, 99, 41, 10, 32, 45, 45,108,111, 99, 97,108, 32,116, 32, 61, 32,115,112,108,105,116, 40,115,116, 114,115,117, 98, 40, 97, 44, 50, 44, 45, 50, 41, 44, 39, 44, 39, 41, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101, 32, 98,114, 97, 99,101,115, 10, 32, 45, 45,108,111, 99, 97, 108, 32,116, 32, 61, 32,115,112,108,105,116, 95,112, 97,114, 97,109,115, 40,115,116,114,115,117, 98, 40, 97, 44, 50, 44, 45, 50, 41, 41, 10, 10, 9,105,102, 32,110,111,116, 32,102, 108, 97,103,115, 91, 39, 87, 39, 93, 32, 97,110,100, 32,115, 116,114,105,110,103, 46,102,105,110,100, 40, 97, 44, 32, 34, 37, 46, 37, 46, 37, 46, 37,115, 42, 37, 41, 34, 41, 32,116, 104,101,110, 10, 10, 9, 9,119, 97,114,110,105,110,103, 40, 34, 70,117,110, 99,116,105,111,110,115, 32,119,105,116,104, 32,118, 97,114,105, 97, 98,108,101, 32, 97,114,103,117,109, 101,110,116,115, 32, 40, 96, 46, 46, 46, 39, 41, 32, 97,114, 101, 32,110,111,116, 32,115,117,112,112,111,114,116,101,100, 46, 32, 73,103,110,111,114,105,110,103, 32, 34, 46, 46,100, 46, 46, 97, 46, 46, 99, 41, 10, 9, 9,114,101,116,117,114, 110, 32,110,105,108, 10, 9,101,110,100, 10, 10, 10, 32,108, 111, 99, 97,108, 32,105, 61, 49, 10, 32,108,111, 99, 97,108, 32,108, 32, 61, 32,123,110, 61, 48,125, 10, 10, 32, 9, 97, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 97, 44, 32, 34, 37,115, 42, 40, 91, 37, 40, 37, 41, 93, 41, 37,115, 42, 34, 44, 32, 34, 37, 49, 34, 41, 10, 9,108,111, 99, 97,108, 32,116, 44,115,116,114,105,112, 44,108, 97,115, 116, 32, 61, 32,115,116,114,105,112, 95,112, 97,114,115, 40, 115,116,114,115,117, 98, 40, 97, 44, 50, 44, 45, 50, 41, 41, 59, 10, 9,105,102, 32,115,116,114,105,112, 32,116,104,101, 110, 10, 9, 9, 45, 45,108,111, 99, 97,108, 32,110,115, 32, 61, 32,115,116,114,105,110,103, 46,115,117, 98, 40,115,116, 114,115,117, 98, 40, 97, 44, 49, 44, 45, 50, 41, 44, 32, 49, 44, 32, 45, 40,115,116,114,105,110,103, 46,108,101,110, 40, 108, 97,115,116, 41, 43, 49, 41, 41, 10, 9, 9,108,111, 99, 97,108, 32,110,115, 32, 61, 32,106,111,105,110, 40,116, 44, 32, 34, 44, 34, 44, 32, 49, 44, 32,108, 97,115,116, 45, 49, 41, 10, 10, 9, 9,110,115, 32, 61, 32, 34, 40, 34, 46, 46, 115,116,114,105,110,103, 46,103,115,117, 98, 40,110,115, 44, 32, 34, 37,115, 42, 44, 37,115, 42, 36, 34, 44, 32, 34, 34, 41, 46, 46, 39, 41, 39, 10, 9, 9, 45, 45,110,115, 32, 61, 32,115,116,114,105,112, 95,100,101,102, 97,117,108,116,115, 40,110,115, 41, 10, 10, 9, 9, 70,117,110, 99,116,105,111, 110, 40,100, 44, 32,110,115, 44, 32, 99, 41, 10, 9, 9,102, 111,114, 32,105, 61, 49, 44,108, 97,115,116, 32,100,111, 10, 9, 9, 9,116, 91,105, 93, 32, 61, 32,115,116,114,105,110, 103, 46,103,115,117, 98, 40,116, 91,105, 93, 44, 32, 34, 61, 46, 42, 36, 34, 44, 32, 34, 34, 41, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10, 10, 32,119,104,105,108,101, 32,116, 91,105, 93, 32,100,111, 10, 32, 32,108, 46,110, 32, 61, 32, 108, 46,110, 43, 49, 10, 32, 32,108, 91,108, 46,110, 93, 32, 61, 32, 68,101, 99,108, 97,114, 97,116,105,111,110, 40,116, 91,105, 93, 44, 39,118, 97,114, 39, 44,116,114,117,101, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,108,111, 99, 97,108, 32,102, 32, 61, 32, 68,101, 99, 108, 97,114, 97,116,105,111,110, 40,100, 44, 39,102,117,110, 99, 39, 41, 10, 32,102, 46, 97,114,103,115, 32, 61, 32,108, 10, 32,102, 46, 99,111,110,115,116, 32, 61, 32, 99, 10, 32, 114,101,116,117,114,110, 32, 95, 70,117,110, 99,116,105,111, 110, 40,102, 41, 10,101,110,100, 10, 10,102,117,110, 99,116, 105,111,110, 32,106,111,105,110, 40,116, 44, 32,115,101,112, 44, 32,102,105,114,115,116, 44, 32,108, 97,115,116, 41, 10, 10, 9,102,105,114,115,116, 32, 61, 32,102,105,114,115,116, 32,111,114, 32, 49, 10, 9,108, 97,115,116, 32, 61, 32,108, 97,115,116, 32,111,114, 32,116, 97, 98,108,101, 46,103,101, 116,110, 40,116, 41, 10, 9,108,111, 99, 97,108, 32,108,115, 101,112, 32, 61, 32, 34, 34, 10, 9,108,111, 99, 97,108, 32, 114,101,116, 32, 61, 32, 34, 34, 10, 9,108,111, 99, 97,108, 32,108,111,111,112, 32, 61, 32,102, 97,108,115,101, 10, 9, 102,111,114, 32,105, 32, 61, 32,102,105,114,115,116, 44,108, 97,115,116, 32,100,111, 10, 10, 9, 9,114,101,116, 32, 61, 32,114,101,116, 46, 46,108,115,101,112, 46, 46,116, 91,105, 93, 10, 9, 9,108,115,101,112, 32, 61, 32,115,101,112, 10, 9, 9,108,111,111,112, 32, 61, 32,116,114,117,101, 10, 9, 101,110,100, 10, 9,105,102, 32,110,111,116, 32,108,111,111, 112, 32,116,104,101,110, 10, 9, 9,114,101,116,117,114,110, 32, 34, 34, 10, 9,101,110,100, 10, 10, 9,114,101,116,117, 114,110, 32,114,101,116, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,115,116,114,105,112, 95,112, 97,114, 115, 40,115, 41, 10, 10, 9,108,111, 99, 97,108, 32,116, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116,111,107,101,110, 115, 40,115, 44, 32, 39, 44, 39, 41, 10, 9,108,111, 99, 97, 108, 32,115,116,114,105,112, 32, 61, 32,102, 97,108,115,101, 10, 9,108,111, 99, 97,108, 32,108, 97,115,116, 10, 10, 9, 102,111,114, 32,105, 61,116, 46,110, 44, 49, 44, 45, 49, 32, 100,111, 10, 10, 9, 9,105,102, 32,110,111,116, 32,115,116, 114,105,112, 32, 97,110,100, 32,112, 97,114, 97,109, 95,111, 98,106,101, 99,116, 40,116, 91,105, 93, 41, 32,116,104,101, 110, 10, 9, 9, 9,108, 97,115,116, 32, 61, 32,105, 10, 9, 9, 9,115,116,114,105,112, 32, 61, 32,116,114,117,101, 10, 9, 9,101,110,100, 10, 9, 9, 45, 45,105,102, 32,115,116, 114,105,112, 32,116,104,101,110, 10, 9, 9, 45, 45, 9,116, 91,105, 93, 32, 61, 32,115,116,114,105,110,103, 46,103,115, 117, 98, 40,116, 91,105, 93, 44, 32, 34, 61, 46, 42, 36, 34, 44, 32, 34, 34, 41, 10, 9, 9, 45, 45,101,110,100, 10, 9, 101,110,100, 10, 10, 9,114,101,116,117,114,110, 32,116, 44, 115,116,114,105,112, 44,108, 97,115,116, 10, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,115,116,114,105, 112, 95,100,101,102, 97,117,108,116,115, 40,115, 41, 10, 10, 9,115, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,115, 44, 32, 34, 94, 37, 40, 34, 44, 32, 34, 34, 41, 10, 9,115, 32, 61, 32,115,116,114,105,110,103, 46,103,115, 117, 98, 40,115, 44, 32, 34, 37, 41, 36, 34, 44, 32, 34, 34, 41, 10, 10, 9,108,111, 99, 97,108, 32,116, 32, 61, 32,115, 112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40,115, 44, 32, 34, 44, 34, 41, 10, 9,108,111, 99, 97,108, 32,115, 101,112, 44, 32,114,101,116, 32, 61, 32, 34, 34, 44, 34, 34, 10, 9,102,111,114, 32,105, 61, 49, 44,116, 46,110, 32,100, 111, 10, 9, 9,116, 91,105, 93, 32, 61, 32,115,116,114,105, 110,103, 46,103,115,117, 98, 40,116, 91,105, 93, 44, 32, 34, 61, 46, 42, 36, 34, 44, 32, 34, 34, 41, 10, 9, 9,114,101, 116, 32, 61, 32,114,101,116, 46, 46,115,101,112, 46, 46,116, 91,105, 93, 10, 9, 9,115,101,112, 32, 61, 32, 34, 44, 34, 10, 9,101,110,100, 10, 10, 9,114,101,116,117,114,110, 32, 34, 40, 34, 46, 46,114,101,116, 46, 46, 34, 41, 34, 10,101, 110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/function.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32,111,112,101,114, 97, 116,111,114, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114, 105,116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73, 100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99, 111,100,101, 32,105,115, 32,102,114,101,101, 32,115,111,102, 116,119, 97,114,101, 59, 32,121,111,117, 32, 99, 97,110, 32, 114,101,100,105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32, 105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116, 119, 97,114,101, 32,112,114,111,118,105,100,101,100, 32,104, 101,114,101,117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105, 115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97, 117,116,104,111,114, 32,104, 97,115, 32,110,111, 32,111, 98, 108,105,103, 97,116,105,111,110, 32,116,111, 32,112,114,111, 118,105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99, 101, 44, 32,115,117,112,112,111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99, 101,109,101,110,116,115, 44, 32,111,114, 32,109,111,100,105, 102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 45, 45, 32, 79,112,101,114, 97,116,111,114, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101,112,114,101,115,101,110,116,115, 32, 97,110, 32,111,112,101,114, 97,116,111,114, 32,102,117,110, 99,116,105,111,110, 32,111,114, 32, 97, 32, 99,108, 97,115, 115, 32,111,112,101,114, 97,116,111,114, 32,109,101,116,104, 111,100, 46, 10, 45, 45, 32, 73,116, 32,115,116,111,114,101, 115, 32,116,104,101, 32,115, 97,109,101, 32,102,105,101,108, 100,115, 32, 97,115, 32,102,117,110, 99,116,105,111,110,115, 32,100,111, 32,112,108,117,115, 58, 10, 45, 45, 32, 32,107, 105,110,100, 32, 61, 32,115,101,116, 32,111,102, 32, 99,104, 97,114, 97, 99,116,101,114, 32,114,101,112,114,101,115,101, 110,116,105,110,103, 32,116,104,101, 32,111,112,101,114, 97, 116,111,114, 32, 40, 97,115, 32,105,116, 32, 97,112,112,101, 114,115, 32,105,110, 32, 67, 43, 43, 32, 99,111,100,101, 41, 10, 99,108, 97,115,115, 79,112,101,114, 97,116,111,114, 32, 61, 32,123, 10, 32,107,105,110,100, 32, 61, 32, 39, 39, 44, 10,125, 10, 99,108, 97,115,115, 79,112,101,114, 97,116,111, 114, 46, 95, 95,105,110,100,101,120, 32, 61, 32, 99,108, 97, 115,115, 79,112,101,114, 97,116,111,114, 10,115,101,116,109, 101,116, 97,116, 97, 98,108,101, 40, 99,108, 97,115,115, 79, 112,101,114, 97,116,111,114, 44, 99,108, 97,115,115, 70,117, 110, 99,116,105,111,110, 41, 10, 10, 45, 45, 32,116, 97, 98, 108,101, 32,116,111, 32,116,114, 97,110,115,102,111,114,109, 32,111,112,101,114, 97,116,111,114, 32,107,105,110,100, 32, 105,110,116,111, 32,116,104,101, 32, 97,112,112,114,111,112, 114,105, 97,116,101, 32,116, 97,103, 32,109,101,116,104,111, 100, 32,110, 97,109,101, 10, 95, 84, 77, 32, 61, 32,123, 91, 39, 43, 39, 93, 32, 61, 32, 39, 97,100,100, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 91, 39, 45, 39, 93, 32, 61, 32, 39, 115,117, 98, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 91, 39, 42, 39, 93, 32, 61, 32, 39,109,117,108, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 91, 39, 47, 39, 93, 32, 61, 32, 39,100, 105,118, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 91, 39, 60, 39, 93, 32, 61, 32, 39,108,116, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 91, 39, 60, 61, 39, 93, 32, 61, 32, 39,108,101, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 91, 39, 61, 61, 39, 93, 32, 61, 32, 39,101,113, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 91, 39, 91, 93, 39, 93, 32, 61, 32, 39,103,101,116, 105, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 91, 39, 38, 91, 93, 39, 93, 32, 61, 32, 39,115,101,116,105, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 45, 45, 91, 39, 45, 62, 39, 93, 32, 61, 32, 39,102,108,101, 99,104,105,116, 97, 39, 44, 10, 32, 32, 32, 32, 32, 32,125, 10, 10, 10, 45, 45, 32, 80,114,105, 110,116, 32,109,101,116,104,111,100, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 79,112,101,114, 97,116, 111,114, 58,112,114,105,110,116, 32, 40,105,100,101,110,116, 44, 99,108,111,115,101, 41, 10, 32,112,114,105,110,116, 40, 105,100,101,110,116, 46, 46, 34, 79,112,101,114, 97,116,111, 114,123, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101, 110,116, 46, 46, 34, 32,107,105,110,100, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,107,105,110,100, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101, 110,116, 46, 46, 34, 32,109,111,100, 32, 32, 61, 32, 39, 34, 46, 46,115,101,108,102, 46,109,111,100, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,116,121,112,101, 32, 61, 32, 39, 34, 46, 46, 115,101,108,102, 46,116,121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,112,116,114, 32, 32, 61, 32, 39, 34, 46, 46,115, 101,108,102, 46,112,116,114, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32, 112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 99,111,110,115,116, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46, 99,111,110,115,116, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 99,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101, 108,102, 46, 99,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,108,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115, 101,108,102, 46,108,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 97,114,103,115, 32, 61, 32,123, 34, 41, 10, 32, 108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108, 101, 32,115,101,108,102, 46, 97,114,103,115, 91,105, 93, 32, 100,111, 10, 32, 32,115,101,108,102, 46, 97,114,103,115, 91, 105, 93, 58,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 32, 34, 44, 34, 44, 34, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,112,114,105, 110,116, 40,105,100,101,110,116, 46, 46, 34, 32,125, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34,125, 34, 46, 46, 99,108,111,115,101, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115, 115, 79,112,101,114, 97,116,111,114, 58,115,117,112, 99,111, 100,101, 95,116,109,112, 40, 41, 10, 10, 9,105,102, 32,110, 111,116, 32, 95, 84, 77, 91,115,101,108,102, 46,107,105,110, 100, 93, 32,116,104,101,110, 10, 9, 9,114,101,116,117,114, 110, 32, 99,108, 97,115,115, 70,117,110, 99,116,105,111,110, 46,115,117,112, 99,111,100,101, 40,115,101,108,102, 41, 10, 9,101,110,100, 10, 10, 9, 45, 45, 32,110,111, 32,111,118, 101,114,108,111, 97,100, 44, 32,110,111, 32,112, 97,114, 97, 109,101,116,101,114,115, 44, 32, 97,108,119, 97,121,115, 32, 105,110, 99,108, 97,115,115, 10, 9,111,117,116,112,117,116, 40, 34, 47, 42, 32,109,101,116,104,111,100, 58, 34, 44,115, 101,108,102, 46,110, 97,109,101, 44, 34, 32,111,102, 32, 99, 108, 97,115,115, 32, 34, 44,115,101,108,102, 58,105,110, 99, 108, 97,115,115, 40, 41, 44, 34, 32, 42, 47, 34, 41, 10, 10, 9,111,117,116,112,117,116, 40, 34, 35,105,102,110,100,101, 102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 95, 34, 46, 46,115,101,108,102, 46, 99,110, 97,109,101, 41, 10, 9,111,117,116,112,117,116, 40, 34, 92,110,115,116, 97, 116,105, 99, 32,105,110,116, 34, 44,115,101,108,102, 46, 99, 110, 97,109,101, 44, 34, 40,108,117, 97, 95, 83,116, 97,116, 101, 42, 32,116,111,108,117, 97, 95, 83, 41, 34, 41, 10, 10, 9,105,102, 32,111,118,101,114,108,111, 97,100, 32, 60, 32, 48, 32,116,104,101,110, 10, 9, 32,111,117,116,112,117,116, 40, 39, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9,101, 110,100, 10, 9,111,117,116,112,117,116, 40, 39, 32,116,111, 108,117, 97, 95, 69,114,114,111,114, 32,116,111,108,117, 97, 95,101,114,114, 59, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 32,105,102, 32, 40, 92,110, 39, 41, 10, 9, 45, 45, 32, 99,104,101, 99,107, 32,115,101,108,102, 10, 9,108,111, 99, 97,108, 32,105,115, 95,102,117,110, 99, 32, 61, 32,103, 101,116, 95,105,115, 95,102,117,110, 99,116,105,111,110, 40, 115,101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112, 101, 41, 10, 9,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32, 32, 33, 39, 46, 46,105,115, 95,102,117,110, 99, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 49, 44, 34, 39, 46, 46,115,101,108,102, 46,112, 97,114,101,110,116, 46,116,121, 112,101, 46, 46, 39, 34, 44, 48, 44, 38,116,111,108,117, 97, 95,101,114,114, 41, 32,124,124, 92,110, 39, 41, 10, 9,111, 117,116,112,117,116, 40, 39, 32, 32, 32, 32, 32, 33,116,111, 108,117, 97, 95,105,115,110,111,111, 98,106, 40,116,111,108, 117, 97, 95, 83, 44, 50, 44, 38,116,111,108,117, 97, 95,101, 114,114, 41, 92,110, 32, 41, 39, 41, 10, 9,111,117,116,112, 117,116, 40, 39, 32, 32,103,111,116,111, 32,116,111,108,117, 97, 95,108,101,114,114,111,114, 59, 39, 41, 10, 10, 9,111, 117,116,112,117,116, 40, 39, 32,101,108,115,101, 92,110, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 35,101,110,100, 105,102, 92,110, 39, 41, 32, 45, 45, 32,116,111,108,117, 97, 95,114,101,108,101, 97,115,101, 10, 9,111,117,116,112,117, 116, 40, 39, 32,123, 39, 41, 10, 10, 9, 45, 45, 32,100,101, 99,108, 97,114,101, 32,115,101,108,102, 10, 9,111,117,116, 112,117,116, 40, 39, 32, 39, 44,115,101,108,102, 46, 99,111, 110,115,116, 44,115,101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 44, 39, 42, 39, 44, 39,115,101,108,102, 32, 61, 32, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 40, 39, 44,115,101,108,102, 46, 99,111,110,115,116, 44,115, 101,108,102, 46,112, 97,114,101,110,116, 46,116,121,112,101, 44, 39, 42, 41, 32, 39, 41, 10, 9,108,111, 99, 97,108, 32, 116,111, 95,102,117,110, 99, 32, 61, 32,103,101,116, 95,116, 111, 95,102,117,110, 99, 40,115,101,108,102, 46,112, 97,114, 101,110,116, 46,116,121,112,101, 41, 10, 9,111,117,116,112, 117,116, 40,116,111, 95,102,117,110, 99, 44, 39, 40,116,111, 108,117, 97, 95, 83, 44, 49, 44, 48, 41, 59, 39, 41, 10, 10, 9, 45, 45, 32, 99,104,101, 99,107, 32,115,101,108,102, 10, 9,111,117,116,112,117,116, 40, 39, 35,105,102,110,100,101, 102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 32, 32,105,102, 32, 40, 33,115,101,108,102, 41, 32,116,111,108, 117, 97, 95,101,114,114,111,114, 40,116,111,108,117, 97, 95, 83, 44, 34,105,110,118, 97,108,105,100, 32, 92, 39,115,101, 108,102, 92, 39, 32,105,110, 32,102,117,110, 99,116,105,111, 110, 32, 92, 39, 39, 46, 46,115,101,108,102, 46,110, 97,109, 101, 46, 46, 39, 92, 39, 34, 44, 78, 85, 76, 76, 41, 59, 39, 41, 59, 10, 9,111,117,116,112,117,116, 40, 39, 35,101,110, 100,105,102, 92,110, 39, 41, 10, 10, 9, 45, 45, 32, 99, 97, 115,116, 32,115,101,108,102, 10, 9,111,117,116,112,117,116, 40, 39, 32, 32, 39, 44,115,101,108,102, 46,109,111,100, 44, 115,101,108,102, 46,116,121,112,101, 44,115,101,108,102, 46, 112,116,114, 44, 39,116,111,108,117, 97, 95,114,101,116, 32, 61, 32, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 40, 39, 44,115,101,108,102, 46,109,111,100, 44,115,101,108,102, 46,116,121,112,101, 44,115,101,108,102, 46,112,116,114, 44, 39, 41, 40, 42,115,101,108,102, 41, 59, 39, 41, 10, 10, 9, 45, 45, 32,114,101,116,117,114,110, 32,118, 97,108,117,101, 10, 9,108,111, 99, 97,108, 32,116, 44, 99,116, 32, 61, 32, 105,115, 98, 97,115,105, 99, 40,115,101,108,102, 46,116,121, 112,101, 41, 10, 9,105,102, 32,116, 32,116,104,101,110, 10, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 32,116,111, 108,117, 97, 95,112,117,115,104, 39, 46, 46,116, 46, 46, 39, 40,116,111,108,117, 97, 95, 83, 44, 40, 39, 44, 99,116, 44, 39, 41,116,111,108,117, 97, 95,114,101,116, 41, 59, 39, 41, 10, 9,101,108,115,101, 10, 9, 9,116, 32, 61, 32,115,101, 108,102, 46,116,121,112,101, 10, 9, 9,108,111, 99, 97,108, 32,112,117,115,104, 95,102,117,110, 99, 32, 61, 32,103,101, 116, 95,112,117,115,104, 95,102,117,110, 99,116,105,111,110, 40,116, 41, 10, 9, 9,110,101,119, 95,116, 32, 61, 32,115, 116,114,105,110,103, 46,103,115,117, 98, 40,116, 44, 32, 34, 99,111,110,115,116, 37,115, 43, 34, 44, 32, 34, 34, 41, 10, 9, 9,105,102, 32,115,101,108,102, 46,112,116,114, 32, 61, 61, 32, 39, 39, 32,116,104,101,110, 10, 9, 9, 9,111,117, 116,112,117,116, 40, 39, 32, 32, 32,123, 39, 41, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 35,105,102,100,101,102, 32, 95, 95, 99,112,108,117,115,112,108,117,115, 92,110, 39, 41, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,118,111,105,100, 42, 32,116,111,108,117, 97, 95,111, 98,106, 32, 61, 32, 77,116,111,108,117, 97, 95,110,101,119, 40, 40, 39, 44,110,101,119, 95,116, 44, 39, 41, 40,116,111, 108,117, 97, 95,114,101,116, 41, 41, 59, 39, 41, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32, 39, 44, 112,117,115,104, 95,102,117,110, 99, 44, 39, 40,116,111,108, 117, 97, 95, 83, 44,116,111,108,117, 97, 95,111, 98,106, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 9, 9, 9, 111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,116,111,108, 117, 97, 95,114,101,103,105,115,116,101,114, 95,103, 99, 40, 116,111,108,117, 97, 95, 83, 44,108,117, 97, 95,103,101,116, 116,111,112, 40,116,111,108,117, 97, 95, 83, 41, 41, 59, 39, 41, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 35,101, 108,115,101, 92,110, 39, 41, 10, 9, 9, 9,111,117,116,112, 117,116, 40, 39, 32, 32, 32, 32,118,111,105,100, 42, 32,116, 111,108,117, 97, 95,111, 98,106, 32, 61, 32,116,111,108,117, 97, 95, 99,111,112,121, 40,116,111,108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41, 38,116,111,108,117, 97, 95,114, 101,116, 44,115,105,122,101,111,102, 40, 39, 44,116, 44, 39, 41, 41, 59, 39, 41, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32, 39, 44,112,117,115,104, 95,102,117, 110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44,116,111, 108,117, 97, 95,111, 98,106, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 32, 32,116,111,108,117, 97, 95,114,101,103,105, 115,116,101,114, 95,103, 99, 40,116,111,108,117, 97, 95, 83, 44,108,117, 97, 95,103,101,116,116,111,112, 40,116,111,108, 117, 97, 95, 83, 41, 41, 59, 39, 41, 10, 9, 9, 9,111,117, 116,112,117,116, 40, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 32,125, 39, 41, 10, 9, 9,101,108,115,101,105,102, 32,115, 101,108,102, 46,112,116,114, 32, 61, 61, 32, 39, 38, 39, 32, 116,104,101,110, 10, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 32, 39, 44,112,117,115,104, 95,102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40,118,111,105, 100, 42, 41, 38,116,111,108,117, 97, 95,114,101,116, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 9, 9,101,108, 115,101, 10, 9, 9, 9,105,102, 32,108,111, 99, 97,108, 95, 99,111,110,115,116,114,117, 99,116,111,114, 32,116,104,101, 110, 10, 9, 9, 9, 9,111,117,116,112,117,116, 40, 39, 32, 32, 32, 39, 44,112,117,115,104, 95,102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40,118,111,105,100, 32, 42, 41,116,111,108,117, 97, 95,114,101,116, 44, 34, 39, 44, 116, 44, 39, 34, 41, 59, 39, 41, 10, 9, 9, 9, 9,111,117, 116,112,117,116, 40, 39, 32, 32, 32, 32,116,111,108,117, 97, 95,114,101,103,105,115,116,101,114, 95,103, 99, 40,116,111, 108,117, 97, 95, 83, 44,108,117, 97, 95,103,101,116,116,111, 112, 40,116,111,108,117, 97, 95, 83, 41, 41, 59, 39, 41, 10, 9, 9, 9,101,108,115,101, 10, 9, 9, 9, 9,111,117,116, 112,117,116, 40, 39, 32, 32, 32, 39, 44,112,117,115,104, 95, 102,117,110, 99, 44, 39, 40,116,111,108,117, 97, 95, 83, 44, 40,118,111,105,100, 42, 41,116,111,108,117, 97, 95,114,101, 116, 44, 34, 39, 44,116, 44, 39, 34, 41, 59, 39, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9,101,110,100, 10, 9,101,110, 100, 10, 10, 9,111,117,116,112,117,116, 40, 39, 32, 32,125, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 32,114,101, 116,117,114,110, 32, 49, 59, 39, 41, 10, 10, 9,111,117,116, 112,117,116, 40, 39, 35,105,102,110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 82, 69, 76, 69, 65, 83, 69, 92,110, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39,116,111,108,117, 97, 95,108,101,114,114,111,114, 58, 92,110, 39, 41, 10, 9,111, 117,116,112,117,116, 40, 39, 32,116,111,108,117, 97, 95,101, 114,114,111,114, 40,116,111,108,117, 97, 95, 83, 44, 34, 35, 102,101,114,114,111,114, 32,105,110, 32,102,117,110, 99,116, 105,111,110, 32, 92, 39, 39, 46, 46,115,101,108,102, 46,108, 110, 97,109,101, 46, 46, 39, 92, 39, 46, 34, 44, 38,116,111, 108,117, 97, 95,101,114,114, 41, 59, 39, 41, 10, 9,111,117, 116,112,117,116, 40, 39, 32,114,101,116,117,114,110, 32, 48, 59, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 35,101, 110,100,105,102, 92,110, 39, 41, 10, 10, 10, 9,111,117,116, 112,117,116, 40, 39,125, 39, 41, 10, 9,111,117,116,112,117, 116, 40, 39, 35,101,110,100,105,102, 32, 47, 47, 35,105,102, 110,100,101,102, 32, 84, 79, 76, 85, 65, 95, 68, 73, 83, 65, 66, 76, 69, 92,110, 39, 41, 10, 9,111,117,116,112,117,116, 40, 39, 92,110, 39, 41, 10,101,110,100, 10, 10, 45, 45, 32, 73,110,116,101,114,110, 97,108, 32, 99,111,110,115,116,114, 117, 99,116,111,114, 10,102,117,110, 99,116,105,111,110, 32, 95, 79,112,101,114, 97,116,111,114, 32, 40,116, 41, 10, 32, 115,101,116,109,101,116, 97,116, 97, 98,108,101, 40,116, 44, 99,108, 97,115,115, 79,112,101,114, 97,116,111,114, 41, 10, 10, 32,105,102, 32,116, 46, 99,111,110,115,116, 32,126, 61, 32, 39, 99,111,110,115,116, 39, 32, 97,110,100, 32,116, 46, 99,111,110,115,116, 32,126, 61, 32, 39, 39, 32,116,104,101, 110, 10, 32, 32,101,114,114,111,114, 40, 34, 35,105,110,118, 97,108,105,100, 32, 39, 99,111,110,115,116, 39, 32,115,112, 101, 99,105,102,105, 99, 97,116,105,111,110, 34, 41, 10, 32, 101,110,100, 10, 10, 32, 97,112,112,101,110,100, 40,116, 41, 10, 32,105,102, 32,110,111,116, 32,116, 58,105,110, 99,108, 97,115,115, 40, 41, 32,116,104,101,110, 10, 32, 32,101,114, 114,111,114, 40, 34, 35,111,112,101,114, 97,116,111,114, 32, 99, 97,110, 32,111,110,108,121, 32, 98,101, 32,100,101,102, 105,110,101,100, 32, 97,115, 32, 99,108, 97,115,115, 32,109, 101,109, 98,101,114, 34, 41, 10, 32,101,110,100, 10, 10, 32, 45, 45,116, 46,110, 97,109,101, 32, 61, 32,116, 46,110, 97, 109,101, 32, 46, 46, 32, 34, 95, 34, 32, 46, 46, 32, 40, 95, 84, 77, 91,116, 46,107,105,110,100, 93, 32,111,114, 32,116, 46,107,105,110,100, 41, 10, 32,116, 46, 99,110, 97,109,101, 32, 61, 32,116, 58, 99,102,117,110, 99,110, 97,109,101, 40, 34,116,111,108,117, 97, 34, 41, 46, 46,116, 58,111,118,101, 114,108,111, 97,100, 40,116, 41, 10, 32,116, 46,110, 97,109, 101, 32, 61, 32, 34,111,112,101,114, 97,116,111,114, 34, 32, 46, 46, 32,116, 46,107,105,110,100, 32, 32, 45, 45, 32,115, 101,116, 32, 97,112,112,114,111,112,114,105, 97,116,101, 32, 99, 97,108,108,105,110,103, 32,110, 97,109,101, 10, 32,114, 101,116,117,114,110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110,115,116,114,117, 99,116,111,114, 10,102,117, 110, 99,116,105,111,110, 32, 79,112,101,114, 97,116,111,114, 32, 40,100, 44,107, 44, 97, 44, 99, 41, 10, 10, 9,108,111, 99, 97,108, 32,111,112, 95,107, 32, 61, 32,115,116,114,105, 110,103, 46,103,115,117, 98, 40,107, 44, 32, 34, 94, 37,115, 42, 34, 44, 32, 34, 34, 41, 10, 9,111,112, 95,107, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,107, 44, 32, 34, 37,115, 42, 36, 34, 44, 32, 34, 34, 41, 10, 9, 45, 45,105,102, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,107, 44, 32, 34, 94, 91, 37,119, 95, 58, 37,100, 60, 62, 37, 42, 37, 38, 93, 43, 36, 34, 41, 32,116,104,101,110, 10, 9,105,102, 32,100, 32, 61, 61, 32, 34,111,112,101,114, 97, 116,111,114, 34, 32, 97,110,100, 32,107, 32,126, 61, 32, 39, 39, 32,116,104,101,110, 10, 10, 9, 9,100, 32, 61, 32,107, 46, 46, 34, 32,111,112,101,114, 97,116,111,114, 34, 10, 9, 101,108,115,101,105,102, 32,110,111,116, 32, 95, 84, 77, 91, 111,112, 95,107, 93, 32,116,104,101,110, 10, 10, 9, 9,105, 102, 32,102,108, 97,103,115, 91, 39, 87, 39, 93, 32,116,104, 101,110, 10, 9, 9, 9,101,114,114,111,114, 40, 34,116,111, 108,117, 97, 58, 32,110,111, 32,115,117,112,112,111,114,116, 32,102,111,114, 32,111,112,101,114, 97,116,111,114, 34, 32, 46, 46, 32,102, 46,107,105,110,100, 41, 10, 9, 9,101,108, 115,101, 10, 9, 9, 9,119, 97,114,110,105,110,103, 40, 34, 78,111, 32,115,117,112,112,111,114,116, 32,102,111,114, 32, 111,112,101,114, 97,116,111,114, 32, 34, 46, 46,111,112, 95, 107, 46, 46, 34, 44, 32,105,103,110,111,114,105,110,103, 34, 41, 10, 9, 9, 9,114,101,116,117,114,110, 32,110,105,108, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10, 10, 9,108, 111, 99, 97,108, 32,114,101,102, 32, 61, 32, 39, 39, 10, 32, 108,111, 99, 97,108, 32,116, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40,115,116,114,115,117, 98, 40, 97, 44, 50, 44,115,116,114,108,101,110, 40, 97, 41, 45, 49, 41, 44, 39, 44, 39, 41, 32, 45, 45, 32,101,108,105, 109,105,110, 97,116,101, 32, 98,114, 97, 99,101,115, 10, 32, 108,111, 99, 97,108, 32,105, 61, 49, 10, 32,108,111, 99, 97, 108, 32,108, 32, 61, 32,123,110, 61, 48,125, 10, 32,119,104, 105,108,101, 32,116, 91,105, 93, 32,100,111, 10, 32, 32,108, 46,110, 32, 61, 32,108, 46,110, 43, 49, 10, 32, 32,108, 91, 108, 46,110, 93, 32, 61, 32, 68,101, 99,108, 97,114, 97,116, 105,111,110, 40,116, 91,105, 93, 44, 39,118, 97,114, 39, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,105,102, 32,107, 32, 61, 61, 32, 39, 91, 93, 39, 32, 116,104,101,110, 10, 9, 32,108,111, 99, 97,108, 32, 95, 10, 9, 32, 95, 44, 32, 95, 44, 32,114,101,102, 32, 61, 32,115, 116,114,102,105,110,100, 40,100, 44, 39, 40, 38, 41, 39, 41, 10, 32, 32,100, 32, 61, 32,103,115,117, 98, 40,100, 44, 39, 38, 39, 44, 39, 39, 41, 10, 32,101,108,115,101,105,102, 32, 107, 61, 61, 39, 38, 91, 93, 39, 32,116,104,101,110, 10, 32, 32,108, 46,110, 32, 61, 32,108, 46,110, 43, 49, 10, 32, 32, 108, 91,108, 46,110, 93, 32, 61, 32, 68,101, 99,108, 97,114, 97,116,105,111,110, 40,100, 44, 39,118, 97,114, 39, 41, 10, 32, 32,108, 91,108, 46,110, 93, 46,110, 97,109,101, 32, 61, 32, 39,116,111,108,117, 97, 95,118, 97,108,117,101, 39, 10, 32,101,110,100, 10, 32,108,111, 99, 97,108, 32,102, 32, 61, 32, 68,101, 99,108, 97,114, 97,116,105,111,110, 40,100, 44, 39,102,117,110, 99, 39, 41, 10, 32,105,102, 32,107, 32, 61, 61, 32, 39, 91, 93, 39, 32, 97,110,100, 32, 40,108, 91, 49, 93, 61, 61,110,105,108, 32,111,114, 32,105,115, 98, 97,115, 105, 99, 40,108, 91, 49, 93, 46,116,121,112,101, 41,126, 61, 39,110,117,109, 98,101,114, 39, 41, 32,116,104,101,110, 10, 32, 32,101,114,114,111,114, 40, 39,111,112,101,114, 97,116, 111,114, 91, 93, 32, 99, 97,110, 32,111,110,108,121, 32, 98, 101, 32,100,101,102,105,110,101,100, 32,102,111,114, 32,110, 117,109,101,114,105, 99, 32,105,110,100,101,120, 46, 39, 41, 10, 32,101,110,100, 10, 32,102, 46, 97,114,103,115, 32, 61, 32,108, 10, 32,102, 46, 99,111,110,115,116, 32, 61, 32, 99, 10, 32,102, 46,107,105,110,100, 32, 61, 32,111,112, 95,107, 10, 32,102, 46,108,110, 97,109,101, 32, 61, 32, 34, 46, 34, 46, 46, 40, 95, 84, 77, 91,102, 46,107,105,110,100, 93, 32, 111,114, 32,102, 46,107,105,110,100, 41, 10, 32,105,102, 32, 110,111,116, 32, 95, 84, 77, 91,102, 46,107,105,110,100, 93, 32,116,104,101,110, 10, 32, 9,102, 46, 99, 97,115,116, 95, 111,112,101,114, 97,116,111,114, 32, 61, 32,116,114,117,101, 10, 32,101,110,100, 10, 32,105,102, 32,102, 46,107,105,110, 100, 32, 61, 61, 32, 39, 91, 93, 39, 32, 97,110,100, 32,114, 101,102, 61, 61, 39, 38, 39, 32, 97,110,100, 32,102, 46, 99, 111,110,115,116,126, 61, 39, 99,111,110,115,116, 39, 32,116, 104,101,110, 10, 32, 32, 79,112,101,114, 97,116,111,114, 40, 100, 44, 39, 38, 39, 46, 46,107, 44, 97, 44, 99, 41, 32, 9, 45, 45, 32, 99,114,101, 97,116,101, 32, 99,111,114,114,101, 115,112,111,100,105,110,103, 32,115,101,116, 32,111,112,101, 114, 97,116,111,114, 10, 32,101,110,100, 10, 32,114,101,116, 117,114,110, 32, 95, 79,112,101,114, 97,116,111,114, 40,102, 41, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/operator.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 10, 95,103,108,111, 98, 97,108, 95,116,101,109,112,108, 97, 116,101,115, 32, 61, 32,123,125, 10, 10, 99,108, 97,115,115, 84,101,109,112,108, 97,116,101, 67,108, 97,115,115, 32, 61, 32,123, 10, 10, 9,110, 97,109,101, 32, 61, 32, 39, 39, 44, 10, 9, 98,111,100,121, 32, 61, 32, 39, 39, 44, 10, 9,112, 97,114,101,110,116,115, 32, 61, 32,123,125, 44, 10, 9, 97, 114,103,115, 32, 61, 32,123,125, 44, 32, 45, 45, 32,116,104, 101, 32,116,101,109,112,108, 97,116,101, 32, 97,114,103,117, 109,101,110,116,115, 10,125, 10, 10, 99,108, 97,115,115, 84, 101,109,112,108, 97,116,101, 67,108, 97,115,115, 46, 95, 95, 105,110,100,101,120, 32, 61, 32, 99,108, 97,115,115, 84,101, 109,112,108, 97,116,101, 67,108, 97,115,115, 10, 10, 10,102, 117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 84,101, 109,112,108, 97,116,101, 67,108, 97,115,115, 58,116,104,114, 111,119, 40,116,121,112,101,115, 44, 32,108,111, 99, 97,108, 95,115, 99,111,112,101, 41, 10, 10, 9, 45, 45,105,102, 32, 116, 97, 98,108,101, 46,103,101,116,110, 40,116,121,112,101, 115, 41, 32,126, 61, 32,116, 97, 98,108,101, 46,103,101,116, 110, 40,115,101,108,102, 46, 97,114,103,115, 41, 32,116,104, 101,110, 10, 9, 45, 45, 9,101,114,114,111,114, 40, 34, 35, 105,110,118, 97,108,105,100, 32,112, 97,114, 97,109,101,116, 101,114, 32, 99,111,117,110,116, 34, 41, 10, 9, 45, 45,101, 110,100, 10, 10, 9, 45, 45, 32,114,101,112,108, 97, 99,101, 10, 9,102,111,114, 32,105, 32, 61, 49, 32, 44, 32,116,121, 112,101,115, 46,110, 32,100,111, 10, 10, 9, 9,108,111, 99, 97,108, 32, 73,108, 32, 61, 32,115,112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40,116,121,112,101,115, 91,105, 93, 44, 32, 34, 32, 34, 41, 10, 9, 9,105,102, 32,116, 97, 98,108,101, 46,103,101,116,110, 40, 73,108, 41, 32,126, 61, 32,116, 97, 98,108,101, 46,103,101,116,110, 40,115,101,108, 102, 46, 97,114,103,115, 41, 32,116,104,101,110, 10, 9, 9, 9,101,114,114,111,114, 40, 34, 35,105,110,118, 97,108,105, 100, 32,112, 97,114, 97,109,101,116,101,114, 32, 99,111,117, 110,116, 32,102,111,114, 32, 34, 46, 46,116,121,112,101,115, 91,105, 93, 41, 10, 9, 9,101,110,100, 10, 9, 9,108,111, 99, 97,108, 32, 98, 73, 32, 61, 32,115,101,108,102, 46, 98, 111,100,121, 10, 9, 9,108,111, 99, 97,108, 32,112, 73, 32, 61, 32,123,125, 10, 9, 9,102,111,114, 32,106, 32, 61, 32, 49, 44,115,101,108,102, 46, 97,114,103,115, 46,110, 32,100, 111, 10, 9, 9, 9, 45, 45, 84,108, 91,106, 93, 32, 61, 32, 102,105,110,100,116,121,112,101, 40, 84,108, 91,106, 93, 41, 32,111,114, 32, 84,108, 91,106, 93, 10, 9, 9, 9, 98, 73, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 98, 73, 44, 32, 34, 40, 91, 94, 95, 37,119, 93, 41, 34, 46, 46,115,101,108,102, 46, 97,114,103,115, 91,106, 93, 46, 46, 34, 40, 91, 94, 95, 37,119, 93, 41, 34, 44, 32, 34, 37, 49, 34, 46, 46, 73,108, 91,106, 93, 46, 46, 34, 37, 50, 34, 41, 10, 9, 9, 9,105,102, 32,115,101,108,102, 46,112, 97,114, 101,110,116,115, 32,116,104,101,110, 10, 9, 9, 9, 9,102, 111,114, 32,105, 61, 49, 44,116, 97, 98,108,101, 46,103,101, 116,110, 40,115,101,108,102, 46,112, 97,114,101,110,116,115, 41, 32,100,111, 10, 9, 9, 9, 9, 9,112, 73, 91,105, 93, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 115,101,108,102, 46,112, 97,114,101,110,116,115, 91,105, 93, 44, 32, 34, 40, 91, 94, 95, 37,119, 93, 63, 41, 34, 46, 46, 115,101,108,102, 46, 97,114,103,115, 91,106, 93, 46, 46, 34, 40, 91, 94, 95, 37,119, 93, 63, 41, 34, 44, 32, 34, 37, 49, 34, 46, 46, 73,108, 91,106, 93, 46, 46, 34, 37, 50, 34, 41, 10, 9, 9, 9, 9,101,110,100, 10, 9, 9, 9,101,110,100, 10, 9, 9,101,110,100, 10, 9, 9, 45, 45,108,111, 99, 97, 108, 32, 97,112,112,101,110,100, 32, 61, 32, 34, 60, 34, 46, 46,115,116,114,105,110,103, 46,103,115,117, 98, 40,116,121, 112,101,115, 91,105, 93, 44, 32, 34, 37,115, 43, 34, 44, 32, 34, 44, 34, 41, 46, 46, 34, 62, 34, 10, 9, 9,108,111, 99, 97,108, 32, 97,112,112,101,110,100, 32, 61, 32, 34, 60, 34, 46, 46, 99,111,110, 99, 97,116, 40, 73,108, 44, 32, 49, 44, 32,116, 97, 98,108,101, 46,103,101,116,110, 40, 73,108, 41, 44, 32, 34, 44, 34, 41, 46, 46, 34, 62, 34, 10, 9, 9, 97, 112,112,101,110,100, 32, 61, 32,115,116,114,105,110,103, 46, 103,115,117, 98, 40, 97,112,112,101,110,100, 44, 32, 34, 37, 115, 42, 44, 37,115, 42, 34, 44, 32, 34, 44, 34, 41, 10, 9, 9, 97,112,112,101,110,100, 32, 61, 32,115,116,114,105,110, 103, 46,103,115,117, 98, 40, 97,112,112,101,110,100, 44, 32, 34, 62, 62, 34, 44, 32, 34, 62, 32, 62, 34, 41, 10, 9, 9, 102,111,114, 32,105, 61, 49, 44,116, 97, 98,108,101, 46,103, 101,116,110, 40,112, 73, 41, 32,100,111, 10, 9, 9, 9, 45, 45,112, 73, 91,105, 93, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,112, 73, 91,105, 93, 44, 32, 34, 62, 62, 34, 44, 32, 34, 62, 32, 62, 34, 41, 10, 9, 9, 9,112, 73, 91,105, 93, 32, 61, 32,114,101,115,111,108,118,101, 95, 116,101,109,112,108, 97,116,101, 95,116,121,112,101,115, 40, 112, 73, 91,105, 93, 41, 10, 9, 9,101,110,100, 10, 9, 9, 98, 73, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 98, 73, 44, 32, 34, 62, 62, 34, 44, 32, 34, 62, 32, 62, 34, 41, 10, 9, 9,108,111, 99, 97,108, 32,110, 32, 61, 32,115,101,108,102, 46,110, 97,109,101, 10, 9, 9,105,102, 32,108,111, 99, 97,108, 95,115, 99,111,112,101, 32,116,104, 101,110, 10, 9, 9, 9,110, 32, 61, 32,115,101,108,102, 46, 108,111, 99, 97,108, 95,110, 97,109,101, 10, 9, 9,101,110, 100, 10, 10, 9, 9, 67,108, 97,115,115, 40,110, 46, 46, 97, 112,112,101,110,100, 44, 32,112, 73, 44, 32, 98, 73, 41, 10, 9,101,110,100, 10,101,110,100, 10, 10, 10,102,117,110, 99, 116,105,111,110, 32, 84,101,109,112,108, 97,116,101, 67,108, 97,115,115, 40,110, 97,109,101, 44, 32,112, 97,114,101,110, 116,115, 44, 32, 98,111,100,121, 44, 32,112, 97,114, 97,109, 101,116,101,114,115, 41, 10, 10, 9,108,111, 99, 97,108, 32, 111, 32, 61, 32,123, 10, 9, 10, 9, 9,112, 97,114,101,110, 116,115, 32, 61, 32,112, 97,114,101,110,116,115, 44, 10, 9, 9, 98,111,100,121, 32, 61, 32, 98,111,100,121, 44, 10, 9, 9, 97,114,103,115, 32, 61, 32,112, 97,114, 97,109,101,116, 101,114,115, 44, 10, 9,125, 10, 9, 10, 9,108,111, 99, 97, 108, 32,111,110, 97,109,101, 32, 61, 32,115,116,114,105,110, 103, 46,103,115,117, 98, 40,110, 97,109,101, 44, 32, 34, 64, 46, 42, 36, 34, 44, 32, 34, 34, 41, 10, 9,111,110, 97,109, 101, 32, 61, 32,103,101,116,110, 97,109,101,115,112, 97, 99, 101, 40, 99,108, 97,115,115, 67,111,110,116, 97,105,110,101, 114, 46, 99,117,114,114, 41, 46, 46,111,110, 97,109,101, 10, 9,111, 46,110, 97,109,101, 32, 61, 32,111,110, 97,109,101, 10, 10, 9,111, 46,108,111, 99, 97,108, 95,110, 97,109,101, 32, 61, 32,110, 97,109,101, 10, 9, 10, 9,115,101,116,109, 101,116, 97,116, 97, 98,108,101, 40,111, 44, 32, 99,108, 97, 115,115, 84,101,109,112,108, 97,116,101, 67,108, 97,115,115, 41, 10, 10, 9,105,102, 32, 95,103,108,111, 98, 97,108, 95, 116,101,109,112,108, 97,116,101,115, 91,111,110, 97,109,101, 93, 32,116,104,101,110, 10, 9, 9,119, 97,114,110,105,110, 103, 40, 34, 68,117,112,108,105, 99, 97,116,101, 32,100,101, 99,108, 97,114, 97,116,105,111,110, 32,111,102, 32,116,101, 109,112,108, 97,116,101, 32, 34, 46, 46,111,110, 97,109,101, 41, 10, 9,101,108,115,101, 10, 9, 9, 95,103,108,111, 98, 97,108, 95,116,101,109,112,108, 97,116,101,115, 91,111,110, 97,109,101, 93, 32, 61, 32,111, 10, 9,101,110,100, 10, 10, 9,114,101,116,117,114,110, 32,111, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/template_class.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,116,111,108,117, 97, 58, 32, 99,108, 97,115,115, 32, 99,108, 97,115,115, 10, 45, 45, 32, 87,114,105,116,116, 101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97, 102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117, 108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111,100,101, 32,105,115, 32,102,114,101,101, 32,115,111,102,116,119, 97, 114,101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101,100, 105,115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110, 100, 47,111,114, 32,109,111,100,105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116,119, 97,114, 101, 32,112,114,111,118,105,100,101,100, 32,104,101,114,101, 117,110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97,110,100, 10, 45, 45, 32,116,104,101, 32, 97,117,116,104, 111,114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105,103, 97,116,105,111,110, 32,116,111, 32,112,114,111,118,105,100, 101, 32,109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32, 115,117,112,112,111,114,116, 44, 32,117,112,100, 97,116,101, 115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101,109,101, 110,116,115, 44, 32,111,114, 32,109,111,100,105,102,105, 99, 97,116,105,111,110,115, 46, 10, 10, 10, 45, 45, 32, 67,108, 97,115,115, 32, 99,108, 97,115,115, 10, 45, 45, 32, 82,101, 112,114,101,115,101,110,116,115, 32, 97, 32, 99,108, 97,115, 115, 32,100,101,102,105,110,105,116,105,111,110, 46, 10, 45, 45, 32, 83,116,111,114,101,115, 32,116,104,101, 32,102,111, 108,108,111,119,105,110,103, 32,102,105,101,108,100,115, 58, 10, 45, 45, 32, 32, 32, 32,110, 97,109,101, 32, 61, 32, 99, 108, 97,115,115, 32,110, 97,109,101, 10, 45, 45, 32, 32, 32, 32, 98, 97,115,101, 32, 61, 32, 99,108, 97,115,115, 32, 98, 97,115,101, 44, 32,105,102, 32, 97,110,121, 32, 40,111,110, 108,121, 32,115,105,110,103,108,101, 32,105,110,104,101,114, 105,116, 97,110, 99,101, 32,105,115, 32,115,117,112,112,111, 114,116,101,100, 41, 10, 45, 45, 32, 32, 32, 32,123,105,125, 32, 32, 61, 32,108,105,115,116, 32,111,102, 32,109,101,109, 98,101,114,115, 10, 99,108, 97,115,115, 67,108, 97,115,115, 32, 61, 32,123, 10, 32, 99,108, 97,115,115,116,121,112,101, 32, 61, 32, 39, 99,108, 97,115,115, 39, 44, 10, 32,110, 97, 109,101, 32, 61, 32, 39, 39, 44, 10, 32, 98, 97,115,101, 32, 61, 32, 39, 39, 44, 10, 32,116,121,112,101, 32, 61, 32, 39, 39, 44, 10, 32, 98,116,121,112,101, 32, 61, 32, 39, 39, 44, 10, 32, 99,116,121,112,101, 32, 61, 32, 39, 39, 44, 10,125, 10, 99,108, 97,115,115, 67,108, 97,115,115, 46, 95, 95,105, 110,100,101,120, 32, 61, 32, 99,108, 97,115,115, 67,108, 97, 115,115, 10,115,101,116,109,101,116, 97,116, 97, 98,108,101, 40, 99,108, 97,115,115, 67,108, 97,115,115, 44, 99,108, 97, 115,115, 67,111,110,116, 97,105,110,101,114, 41, 10, 10, 10, 45, 45, 32,114,101,103,105,115,116,101,114, 32, 99,108, 97, 115,115, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97, 115,115, 67,108, 97,115,115, 58,114,101,103,105,115,116,101, 114, 32, 40,112,114,101, 41, 10, 10, 9,105,102, 32,110,111, 116, 32,115,101,108,102, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 32,116, 104,101,110, 10, 9, 9,114,101,116,117,114,110, 10, 9,101, 110,100, 10, 10, 32,112,114,101, 32, 61, 32,112,114,101, 32, 111,114, 32, 39, 39, 10, 32,112,117,115,104, 40,115,101,108, 102, 41, 10, 9,105,102, 32, 95, 99,111,108,108,101, 99,116, 91,115,101,108,102, 46,116,121,112,101, 93, 32,116,104,101, 110, 10, 9, 9,111,117,116,112,117,116, 40,112,114,101, 44, 39, 35,105,102,100,101,102, 32, 95, 95, 99,112,108,117,115, 112,108,117,115, 92,110, 39, 41, 10, 32, 32,111,117,116,112, 117,116, 40,112,114,101, 46, 46, 39,116,111,108,117, 97, 95, 99, 99,108, 97,115,115, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101,108,102, 46,108,110, 97,109,101, 46, 46, 39, 34, 44, 34, 39, 46, 46,115,101,108,102, 46,116,121, 112,101, 46, 46, 39, 34, 44, 34, 39, 46, 46,115,101,108,102, 46, 98,116,121,112,101, 46, 46, 39, 34, 44, 39, 46, 46, 95, 99,111,108,108,101, 99,116, 91,115,101,108,102, 46,116,121, 112,101, 93, 46, 46, 39, 41, 59, 39, 41, 10, 9, 9,111,117, 116,112,117,116, 40,112,114,101, 44, 39, 35,101,108,115,101, 92,110, 39, 41, 10, 32, 32,111,117,116,112,117,116, 40,112, 114,101, 46, 46, 39,116,111,108,117, 97, 95, 99, 99,108, 97, 115,115, 40,116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46, 115,101,108,102, 46,108,110, 97,109,101, 46, 46, 39, 34, 44, 34, 39, 46, 46,115,101,108,102, 46,116,121,112,101, 46, 46, 39, 34, 44, 34, 39, 46, 46,115,101,108,102, 46, 98,116,121, 112,101, 46, 46, 39, 34, 44, 78, 85, 76, 76, 41, 59, 39, 41, 10, 9, 9,111,117,116,112,117,116, 40,112,114,101, 44, 39, 35,101,110,100,105,102, 92,110, 39, 41, 10, 9,101,108,115, 101, 10, 32, 32,111,117,116,112,117,116, 40,112,114,101, 46, 46, 39,116,111,108,117, 97, 95, 99, 99,108, 97,115,115, 40, 116,111,108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101,108, 102, 46,108,110, 97,109,101, 46, 46, 39, 34, 44, 34, 39, 46, 46,115,101,108,102, 46,116,121,112,101, 46, 46, 39, 34, 44, 34, 39, 46, 46,115,101,108,102, 46, 98,116,121,112,101, 46, 46, 39, 34, 44, 78, 85, 76, 76, 41, 59, 39, 41, 10, 9,101, 110,100, 10, 9,105,102, 32,115,101,108,102, 46,101,120,116, 114, 97, 95, 98, 97,115,101,115, 32,116,104,101,110, 10, 9, 9,102,111,114, 32,107, 44, 98, 97,115,101, 32,105,110, 32, 105,112, 97,105,114,115, 40,115,101,108,102, 46,101,120,116, 114, 97, 95, 98, 97,115,101,115, 41, 32,100,111, 10, 9, 9, 9, 45, 45, 32,110,111,116, 32,110,111,119, 10, 32, 32, 32, 45, 45,111,117,116,112,117,116, 40,112,114,101, 46, 46, 39, 32,116,111,108,117, 97, 95, 97,100,100, 98, 97,115,101, 40, 116,111,108,117, 97, 95, 83, 44, 32, 34, 39, 46, 46,115,101, 108,102, 46,116,121,112,101, 46, 46, 39, 34, 44, 32, 34, 39, 46, 46, 98, 97,115,101, 46, 46, 39, 34, 41, 59, 39, 41, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10, 32,111,117,116, 112,117,116, 40,112,114,101, 46, 46, 39,116,111,108,117, 97, 95, 98,101,103,105,110,109,111,100,117,108,101, 40,116,111, 108,117, 97, 95, 83, 44, 34, 39, 46, 46,115,101,108,102, 46, 108,110, 97,109,101, 46, 46, 39, 34, 41, 59, 39, 41, 10, 32, 108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108, 101, 32,115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32, 115,101,108,102, 91,105, 93, 58,114,101,103,105,115,116,101, 114, 40,112,114,101, 46, 46, 39, 32, 39, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 32,111,117, 116,112,117,116, 40,112,114,101, 46, 46, 39,116,111,108,117, 97, 95,101,110,100,109,111,100,117,108,101, 40,116,111,108, 117, 97, 95, 83, 41, 59, 39, 41, 10, 9,112,111,112, 40, 41, 10,101,110,100, 10, 10, 45, 45, 32,114,101,116,117,114,110, 32, 99,111,108,108,101, 99,116,105,111,110, 32,114,101,113, 117,105,114,101,109,101,110,116, 10,102,117,110, 99,116,105, 111,110, 32, 99,108, 97,115,115, 67,108, 97,115,115, 58,114, 101,113,117,105,114,101, 99,111,108,108,101, 99,116,105,111, 110, 32, 40,116, 41, 10, 9,105,102, 32,115,101,108,102, 46, 102,108, 97,103,115, 46,112,114,111,116,101, 99,116,101,100, 95,100,101,115,116,114,117, 99,116,111,114, 32,111,114, 32, 40,110,111,116, 32,115,101,108,102, 58, 99,104,101, 99,107, 95,112,117, 98,108,105, 99, 95, 97, 99, 99,101,115,115, 40, 41, 41, 32,116,104,101,110, 10, 9, 9,114,101,116,117,114, 110, 32,102, 97,108,115,101, 10, 9,101,110,100, 10, 32,112, 117,115,104, 40,115,101,108,102, 41, 10, 9,108,111, 99, 97, 108, 32,114, 32, 61, 32,102, 97,108,115,101, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104,105,108,101, 32, 115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32,114, 32, 61, 32,115,101,108,102, 91,105, 93, 58,114,101,113,117,105, 114,101, 99,111,108,108,101, 99,116,105,111,110, 40,116, 41, 32,111,114, 32,114, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 9,112,111,112, 40, 41, 10, 9, 45, 45, 32,111,110,108,121, 32, 99,108, 97,115,115, 32,116,104, 97,116, 32,101,120,112,111,114,116,115, 32,100,101,115,116, 114,117, 99,116,111,114, 32, 99, 97,110, 32, 98,101, 32, 97, 112,112,114,111,112,114,105, 97,116,101,108,121, 32, 99,111, 108,108,101, 99,116,101,100, 10, 9, 45, 45, 32, 99,108, 97, 115,115,101,115, 32,116,104, 97,116, 32,101,120,112,111,114, 116, 32, 99,111,110,115,116,114,117, 99,116,111,114,115, 32, 110,101,101,100, 32,116,111, 32,104, 97,118,101, 32, 97, 32, 99,111,108,108,101, 99,116,111,114, 32, 40,111,118,101,114, 114,105,100,101,100, 32, 98,121, 32, 45, 68, 32,102,108, 97, 103, 32,111,110, 32, 99,111,109,109, 97,110,100, 32,108,105, 110,101, 41, 10, 9,105,102, 32,115,101,108,102, 46, 95,100, 101,108,101,116,101, 32,111,114, 32, 40, 40,110,111,116, 32, 102,108, 97,103,115, 91, 39, 68, 39, 93, 41, 32, 97,110,100, 32,115,101,108,102, 46, 95,110,101,119, 41, 32,116,104,101, 110, 10, 9, 9, 45, 45,116, 91,115,101,108,102, 46,116,121, 112,101, 93, 32, 61, 32, 34,116,111,108,117, 97, 95, 99,111, 108,108,101, 99,116, 95, 34, 32, 46, 46, 32,103,115,117, 98, 40,115,101,108,102, 46,116,121,112,101, 44, 34, 58, 58, 34, 44, 34, 95, 34, 41, 10, 9, 9,116, 91,115,101,108,102, 46, 116,121,112,101, 93, 32, 61, 32, 34,116,111,108,117, 97, 95, 99,111,108,108,101, 99,116, 95, 34, 32, 46, 46, 32, 99,108, 101, 97,110, 95,116,101,109,112,108, 97,116,101, 40,115,101, 108,102, 46,116,121,112,101, 41, 10, 9, 9,114, 32, 61, 32, 116,114,117,101, 10, 9,101,110,100, 10, 32,114,101,116,117, 114,110, 32,114, 10,101,110,100, 10, 10, 45, 45, 32,111,117, 116,112,117,116, 32,116, 97,103,115, 10,102,117,110, 99,116, 105,111,110, 32, 99,108, 97,115,115, 67,108, 97,115,115, 58, 100,101, 99,108,116,121,112,101, 32, 40, 41, 10, 32,112,117, 115,104, 40,115,101,108,102, 41, 10, 9,115,101,108,102, 46, 116,121,112,101, 32, 61, 32,114,101,103,116,121,112,101, 40, 115,101,108,102, 46,111,114,105,103,105,110, 97,108, 95,110, 97,109,101, 32,111,114, 32,115,101,108,102, 46,110, 97,109, 101, 41, 10, 9,115,101,108,102, 46, 98,116,121,112,101, 32, 61, 32,116,121,112,101,118, 97,114, 40,115,101,108,102, 46, 98, 97,115,101, 41, 10, 9,115,101,108,102, 46, 99,116,121, 112,101, 32, 61, 32, 39, 99,111,110,115,116, 32, 39, 46, 46, 115,101,108,102, 46,116,121,112,101, 10, 9,105,102, 32,115, 101,108,102, 46,101,120,116,114, 97, 95, 98, 97,115,101,115, 32,116,104,101,110, 10, 9, 9,102,111,114, 32,105, 61, 49, 44,116, 97, 98,108,101, 46,103,101,116,110, 40,115,101,108, 102, 46,101,120,116,114, 97, 95, 98, 97,115,101,115, 41, 32, 100,111, 10, 9, 9, 9,115,101,108,102, 46,101,120,116,114, 97, 95, 98, 97,115,101,115, 91,105, 93, 32, 61, 32,116,121, 112,101,118, 97,114, 40,115,101,108,102, 46,101,120,116,114, 97, 95, 98, 97,115,101,115, 91,105, 93, 41, 10, 9, 9,101, 110,100, 10, 9,101,110,100, 10, 32,108,111, 99, 97,108, 32, 105, 61, 49, 10, 32,119,104,105,108,101, 32,115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32,115,101,108,102, 91,105, 93, 58,100,101, 99,108,116,121,112,101, 40, 41, 10, 32, 32, 105, 32, 61, 32,105, 43, 49, 10, 32,101,110,100, 10, 9,112, 111,112, 40, 41, 10,101,110,100, 10, 10, 10, 45, 45, 32, 80, 114,105,110,116, 32,109,101,116,104,111,100, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97,115,115, 67,108, 97,115, 115, 58,112,114,105,110,116, 32, 40,105,100,101,110,116, 44, 99,108,111,115,101, 41, 10, 32,112,114,105,110,116, 40,105, 100,101,110,116, 46, 46, 34, 67,108, 97,115,115,123, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101, 108,102, 46,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 98, 97,115,101, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46, 98, 97,115,101, 46, 46, 34, 39, 59, 34, 41, 10, 32, 112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 108,110, 97,109,101, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46,108,110, 97,109,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32,116,121,112,101, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46,116,121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32, 112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 98,116,121,112,101, 32, 61, 32, 39, 34, 46, 46,115,101,108, 102, 46, 98,116,121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 99,116,121,112,101, 32, 61, 32, 39, 34, 46, 46,115,101, 108,102, 46, 99,116,121,112,101, 46, 46, 34, 39, 44, 34, 41, 10, 32,108,111, 99, 97,108, 32,105, 61, 49, 10, 32,119,104, 105,108,101, 32,115,101,108,102, 91,105, 93, 32,100,111, 10, 32, 32,115,101,108,102, 91,105, 93, 58,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34, 32, 34, 44, 34, 44, 34, 41, 10, 32, 32,105, 32, 61, 32,105, 43, 49, 10, 32,101,110, 100, 10, 32,112,114,105,110,116, 40,105,100,101,110,116, 46, 46, 34,125, 34, 46, 46, 99,108,111,115,101, 41, 10,101,110, 100, 10, 10,102,117,110, 99,116,105,111,110, 32, 99,108, 97, 115,115, 67,108, 97,115,115, 58,115,101,116, 95,112,114,111, 116,101, 99,116,101,100, 95,100,101,115,116,114,117, 99,116, 111,114, 40,112, 41, 10, 9,115,101,108,102, 46,102,108, 97, 103,115, 46,112,114,111,116,101, 99,116,101,100, 95,100,101, 115,116,114,117, 99,116,111,114, 32, 61, 32,115,101,108,102, 46,102,108, 97,103,115, 46,112,114,111,116,101, 99,116,101, 100, 95,100,101,115,116,114,117, 99,116,111,114, 32,111,114, 32,112, 10,101,110,100, 10, 10, 45, 45, 32, 73,110,116,101, 114,110, 97,108, 32, 99,111,110,115,116,114,117, 99,116,111, 114, 10,102,117,110, 99,116,105,111,110, 32, 95, 67,108, 97, 115,115, 32, 40,116, 41, 10, 32,115,101,116,109,101,116, 97, 116, 97, 98,108,101, 40,116, 44, 99,108, 97,115,115, 67,108, 97,115,115, 41, 10, 32,116, 58, 98,117,105,108,100,110, 97, 109,101,115, 40, 41, 10, 32, 97,112,112,101,110,100, 40,116, 41, 10, 32,114,101,116,117,114,110, 32,116, 10,101,110,100, 10, 10, 45, 45, 32, 67,111,110,115,116,114,117, 99,116,111, 114, 10, 45, 45, 32, 69,120,112,101, 99,116,115, 32,116,104, 101, 32,110, 97,109,101, 44, 32,116,104,101, 32, 98, 97,115, 101, 32, 40, 97,114,114, 97,121, 41, 32, 97,110,100, 32,116, 104,101, 32, 98,111,100,121, 32,111,102, 32,116,104,101, 32, 99,108, 97,115,115, 46, 10,102,117,110, 99,116,105,111,110, 32, 67,108, 97,115,115, 32, 40,110, 44,112, 44, 98, 41, 10, 10, 9,105,102, 32,116, 97, 98,108,101, 46,103,101,116,110, 40,112, 41, 32, 62, 32, 49, 32,116,104,101,110, 10, 9, 9, 98, 32, 61, 32,115,116,114,105,110,103, 46,115,117, 98, 40, 98, 44, 32, 49, 44, 32, 45, 50, 41, 10, 9, 9,102,111,114, 32,105, 61, 50, 44,116, 97, 98,108,101, 46,103,101,116,110, 40,112, 41, 44, 49, 32,100,111, 10, 9, 9, 9, 98, 32, 61, 32, 98, 46, 46, 34, 92,110, 32,116,111,108,117, 97, 95,105, 110,104,101,114,105,116,115, 32, 34, 46, 46,112, 91,105, 93, 46, 46, 34, 32, 95, 95, 34, 46, 46,112, 91,105, 93, 46, 46, 34, 95, 95, 59, 92,110, 34, 10, 9, 9,101,110,100, 10, 9, 9, 98, 32, 61, 32, 98, 46, 46, 34, 92,110,125, 34, 10, 9, 101,110,100, 10, 10, 9, 45, 45, 32, 99,104,101, 99,107, 32, 102,111,114, 32,116,101,109,112,108, 97,116,101, 10, 9, 98, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 98, 44, 32, 34, 94,123, 37,115, 42, 84, 69, 77, 80, 76, 65, 84, 69, 95, 66, 73, 78, 68, 34, 44, 32, 34,123, 92,110, 84, 79, 76, 85, 65, 95, 84, 69, 77, 80, 76, 65, 84, 69, 95, 66, 73, 78, 68, 34, 41, 10, 9,108,111, 99, 97,108, 32,116, 44, 95, 44, 84, 44, 73, 32, 61, 32,115,116,114,105,110,103, 46, 102,105,110,100, 40, 98, 44, 32, 39, 94,123, 37,115, 42, 84, 79, 76, 85, 65, 95, 84, 69, 77, 80, 76, 65, 84, 69, 95, 66, 73, 78, 68, 37,115, 42, 37, 40, 43, 37,115, 42, 92, 34, 63, 40, 91, 94, 92, 34, 44, 93, 42, 41, 92, 34, 63, 37,115, 42, 44, 37,115, 42, 40, 91, 94, 37, 41, 93, 42, 41, 37,115, 42, 37, 41, 43, 39, 41, 10, 9,105,102, 32,116, 32,116,104,101, 110, 10, 10, 9, 9, 45, 45, 32,114,101,109,111,118,101, 32, 113,117,111,116,101,115, 10, 9, 9, 73, 32, 61, 32,115,116, 114,105,110,103, 46,103,115,117, 98, 40, 73, 44, 32, 34, 92, 34, 34, 44, 32, 34, 34, 41, 10, 9, 9, 84, 32, 61, 32,115, 116,114,105,110,103, 46,103,115,117, 98, 40, 84, 44, 32, 34, 92, 34, 34, 44, 32, 34, 34, 41, 10, 9, 9, 45, 45, 32,103, 101,116, 32,116,121,112,101, 32,108,105,115,116, 10, 9, 9, 108,111, 99, 97,108, 32,116,121,112,101,115, 32, 61, 32,115, 112,108,105,116, 95, 99, 95,116,111,107,101,110,115, 40, 73, 44, 32, 34, 44, 34, 41, 10, 9, 9, 45, 45, 32,114,101,109, 111,118,101, 32, 84, 69, 77, 80, 76, 65, 84, 69, 95, 66, 73, 78, 68, 32,108,105,110,101, 10, 9, 9,108,111, 99, 97,108, 32, 98,115, 32, 61, 32,115,116,114,105,110,103, 46,103,115, 117, 98, 40, 98, 44, 32, 34, 94,123, 37,115, 42, 84, 79, 76, 85, 65, 95, 84, 69, 77, 80, 76, 65, 84, 69, 95, 66, 73, 78, 68, 91, 94, 92,110, 93, 42, 92,110, 34, 44, 32, 34,123, 92, 110, 34, 41, 10, 9, 9, 9, 10, 9, 9,108,111, 99, 97,108, 32, 84,108, 32, 61, 32,115,112,108,105,116, 40, 84, 44, 32, 34, 32, 34, 41, 10, 9, 9,108,111, 99, 97,108, 32,116, 99, 32, 61, 32, 84,101,109,112,108, 97,116,101, 67,108, 97,115, 115, 40,110, 44, 32,112, 44, 32, 98,115, 44, 32, 84,108, 41, 10, 10, 9, 9, 10, 9, 9,116, 99, 58,116,104,114,111,119, 40,116,121,112,101,115, 44, 32,116,114,117,101, 41, 10, 9, 9, 45, 45,102,111,114, 32,105, 61, 49, 44,116,121,112,101, 115, 46,110, 32,100,111, 10, 9, 9, 45, 45, 9,116, 99, 58, 116,104,114,111,119, 40,115,112,108,105,116, 95, 99, 95,116, 111,107,101,110,115, 40,116,121,112,101,115, 91,105, 93, 44, 32, 34, 32, 34, 41, 44, 32,116,114,117,101, 41, 10, 9, 9, 45, 45,101,110,100, 10, 9, 9,114,101,116,117,114,110, 10, 9,101,110,100, 10, 9, 10, 9,108,111, 99, 97,108, 32,109, 98, 97,115,101, 10, 10, 9,105,102, 32,112, 32,116,104,101, 110, 10, 9, 9,109, 98, 97,115,101, 32, 61, 32,116, 97, 98, 108,101, 46,114,101,109,111,118,101, 40,112, 44, 32, 49, 41, 10, 9, 9,105,102, 32,110,111,116, 32,112, 91, 49, 93, 32, 116,104,101,110, 32,112, 32, 61, 32,110,105,108, 32,101,110, 100, 10, 9,101,110,100, 10, 10, 9,109, 98, 97,115,101, 32, 61, 32,109, 98, 97,115,101, 32, 97,110,100, 32,114,101,115, 111,108,118,101, 95,116,101,109,112,108, 97,116,101, 95,116, 121,112,101,115, 40,109, 98, 97,115,101, 41, 10, 10, 9,108, 111, 99, 97,108, 32, 99, 10, 9,108,111, 99, 97,108, 32,111, 110, 97,109,101, 32, 61, 32,115,116,114,105,110,103, 46,103, 115,117, 98, 40,110, 44, 32, 34, 64, 46, 42, 36, 34, 44, 32, 34, 34, 41, 10, 9,111,110, 97,109,101, 32, 61, 32,103,101, 116,110, 97,109,101,115,112, 97, 99,101, 40, 99,108, 97,115, 115, 67,111,110,116, 97,105,110,101,114, 46, 99,117,114,114, 41, 46, 46,111,110, 97,109,101, 10, 10, 9,105,102, 32, 95, 103,108,111, 98, 97,108, 95, 99,108, 97,115,115,101,115, 91, 111,110, 97,109,101, 93, 32,116,104,101,110, 10, 9, 9, 99, 32, 61, 32, 95,103,108,111, 98, 97,108, 95, 99,108, 97,115, 115,101,115, 91,111,110, 97,109,101, 93, 10, 9, 9,105,102, 32,109, 98, 97,115,101, 32, 97,110,100, 32, 40, 40,110,111, 116, 32, 99, 46, 98, 97,115,101, 41, 32,111,114, 32, 99, 46, 98, 97,115,101, 32, 61, 61, 32, 34, 34, 41, 32,116,104,101, 110, 10, 9, 9, 9, 99, 46, 98, 97,115,101, 32, 61, 32,109, 98, 97,115,101, 10, 9, 9,101,110,100, 10, 9,101,108,115, 101, 10, 9, 9, 99, 32, 61, 32, 95, 67,108, 97,115,115, 40, 95, 67,111,110,116, 97,105,110,101,114,123,110, 97,109,101, 61,110, 44, 32, 98, 97,115,101, 61,109, 98, 97,115,101, 44, 32,101,120,116,114, 97, 95, 98, 97,115,101,115, 61,112,125, 41, 10, 10, 9, 9,108,111, 99, 97,108, 32,102,116, 32, 61, 32,103,101,116,110, 97,109,101,115,112, 97, 99,101, 40, 99, 46,112, 97,114,101,110,116, 41, 46, 46, 99, 46,111,114,105, 103,105,110, 97,108, 95,110, 97,109,101, 10, 9, 9, 97,112, 112,101,110,100, 95,103,108,111, 98, 97,108, 95,116,121,112, 101, 40,102,116, 44, 32, 99, 41, 10, 9,101,110,100, 10, 10, 9,112,117,115,104, 40, 99, 41, 10, 9, 99, 58,112, 97,114, 115,101, 40,115,116,114,115,117, 98, 40, 98, 44, 50, 44,115, 116,114,108,101,110, 40, 98, 41, 45, 49, 41, 41, 32, 45, 45, 32,101,108,105,109,105,110, 97,116,101, 32, 98,114, 97, 99, 101,115, 10, 9,112,111,112, 40, 41, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/class.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32,109, 97,114,107, 32,117,112, 32, 99,111,109,109, 101,110,116,115, 32, 97,110,100, 32,115,116,114,105,110,103, 115, 10, 83, 84, 82, 49, 32, 61, 32, 34, 92, 48, 48, 49, 34, 10, 83, 84, 82, 50, 32, 61, 32, 34, 92, 48, 48, 50, 34, 10, 83, 84, 82, 51, 32, 61, 32, 34, 92, 48, 48, 51, 34, 10, 83, 84, 82, 52, 32, 61, 32, 34, 92, 48, 48, 52, 34, 10, 82, 69, 77, 32, 32, 61, 32, 34, 92, 48, 48, 53, 34, 10, 65, 78, 89, 32, 32, 61, 32, 34, 40, 91, 92, 48, 48, 49, 45, 92, 48, 48, 53, 93, 41, 34, 10, 69, 83, 67, 49, 32, 61, 32, 34, 92, 48, 48, 54, 34, 10, 69, 83, 67, 50, 32, 61, 32, 34, 92, 48, 48, 55, 34, 10, 10, 77, 65, 83, 75, 32, 61, 32,123, 32, 45, 45, 32,116,104,101, 32,115,117, 98,115,116,105,116,117,116,105, 111,110, 32,111,114,100,101,114, 32,105,115, 32,105,109,112, 111,114,116, 97,110,116, 10, 32,123, 69, 83, 67, 49, 44, 32, 34, 92, 92, 39, 34,125, 44, 10, 32,123, 69, 83, 67, 50, 44, 32, 39, 92, 92, 34, 39,125, 44, 10, 32,123, 83, 84, 82, 49, 44, 32, 34, 39, 34,125, 44, 10, 32,123, 83, 84, 82, 50, 44, 32, 39, 34, 39,125, 44, 10, 32,123, 83, 84, 82, 51, 44, 32, 34, 37, 91, 37, 91, 34,125, 44, 10, 32,123, 83, 84, 82, 52, 44, 32, 34, 37, 93, 37, 93, 34,125, 44, 10, 32,123, 82, 69, 77, 32, 44, 32, 34, 37, 45, 37, 45, 34,125, 44, 10,125, 10, 10,102,117,110, 99,116,105,111,110, 32,109, 97,115,107, 32, 40,115, 41, 10, 32,102,111,114, 32,105, 32, 61, 32, 49, 44, 103,101,116,110, 40, 77, 65, 83, 75, 41, 32, 32,100,111, 10, 32, 32,115, 32, 61, 32,103,115,117, 98, 40,115, 44, 77, 65, 83, 75, 91,105, 93, 91, 50, 93, 44, 77, 65, 83, 75, 91,105, 93, 91, 49, 93, 41, 10, 32,101,110,100, 10, 32,114,101,116, 117,114,110, 32,115, 10,101,110,100, 10, 10,102,117,110, 99, 116,105,111,110, 32,117,110,109, 97,115,107, 32, 40,115, 41, 10, 32,102,111,114, 32,105, 32, 61, 32, 49, 44,103,101,116, 110, 40, 77, 65, 83, 75, 41, 32, 32,100,111, 10, 32, 32,115, 32, 61, 32,103,115,117, 98, 40,115, 44, 77, 65, 83, 75, 91, 105, 93, 91, 49, 93, 44, 77, 65, 83, 75, 91,105, 93, 91, 50, 93, 41, 10, 32,101,110,100, 10, 32,114,101,116,117,114,110, 32,115, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111, 110, 32, 99,108,101, 97,110, 32, 40,115, 41, 10, 32, 45, 45, 32, 99,104,101, 99,107, 32,102,111,114, 32, 99,111,109,112, 105,108, 97,116,105,111,110, 32,101,114,114,111,114, 10, 32, 108,111, 99, 97,108, 32, 99,111,100,101, 32, 61, 32, 34,114, 101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 32, 40, 41, 92,110, 34, 32, 46, 46, 32,115, 32, 46, 46, 32, 34, 92,110, 32,101,110,100, 34, 10, 32,105,102, 32,110,111,116, 32,100,111,115,116,114,105,110,103, 40, 99,111,100,101, 41, 32,116,104,101,110, 10, 32, 32,114,101,116,117,114,110, 32, 110,105,108, 10, 32,101,110,100, 10, 10, 32,105,102, 32,102, 108, 97,103,115, 91, 39, 67, 39, 93, 32,116,104,101,110, 10, 32, 9,114,101,116,117,114,110, 32,115, 10, 32,101,110,100, 10, 10, 32,108,111, 99, 97,108, 32, 83, 32, 61, 32, 34, 34, 32, 45, 45, 32,115, 97,118,101,100, 32,115,116,114,105,110, 103, 10, 10, 32,115, 32, 61, 32,109, 97,115,107, 40,115, 41, 10, 10, 32, 45, 45, 32,114,101,109,111,118,101, 32, 98,108, 97,110,107,115, 32, 97,110,100, 32, 99,111,109,109,101,110, 116,115, 10, 32,119,104,105,108,101, 32, 49, 32,100,111, 10, 32, 32,108,111, 99, 97,108, 32, 98, 44,101, 44,100, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44, 65, 78, 89, 41, 10, 32, 32,105,102, 32, 98, 32,116,104,101,110, 10, 32, 32, 32, 83, 32, 61, 32, 83, 46, 46,115,116,114,115,117, 98, 40, 115, 44, 49, 44, 98, 45, 49, 41, 10, 32, 32, 32,115, 32, 61, 32,115,116,114,115,117, 98, 40,115, 44, 98, 43, 49, 41, 10, 32, 32, 32,105,102, 32,100, 61, 61, 83, 84, 82, 49, 32,111, 114, 32,100, 61, 61, 83, 84, 82, 50, 32,116,104,101,110, 10, 32, 32, 32, 32,101, 32, 61, 32,115,116,114,102,105,110,100, 40,115, 44,100, 41, 10, 32, 32, 32, 32, 83, 32, 61, 32, 83, 32, 46, 46,100, 46, 46,115,116,114,115,117, 98, 40,115, 44, 49, 44,101, 41, 10, 32, 32, 32, 32,115, 32, 61, 32,115,116, 114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32, 32, 101,108,115,101,105,102, 32,100, 61, 61, 83, 84, 82, 51, 32, 116,104,101,110, 10, 32, 32, 32, 32,101, 32, 61, 32,115,116, 114,102,105,110,100, 40,115, 44, 83, 84, 82, 52, 41, 10, 32, 32, 32, 32, 83, 32, 61, 32, 83, 46, 46,100, 46, 46,115,116, 114,115,117, 98, 40,115, 44, 49, 44,101, 41, 10, 32, 32, 32, 32,115, 32, 61, 32,115,116,114,115,117, 98, 40,115, 44,101, 43, 49, 41, 10, 32, 32, 32,101,108,115,101,105,102, 32,100, 61, 61, 82, 69, 77, 32,116,104,101,110, 10, 32, 32, 32, 32, 115, 32, 61, 32,103,115,117, 98, 40,115, 44, 34, 91, 94, 92, 110, 93, 42, 40, 92,110, 63, 41, 34, 44, 34, 37, 49, 34, 44, 49, 41, 10, 32, 32, 32,101,110,100, 10, 32, 32,101,108,115, 101, 10, 32, 32, 32, 83, 32, 61, 32, 83, 46, 46,115, 10, 32, 32, 32, 98,114,101, 97,107, 10, 32, 32,101,110,100, 10, 32, 101,110,100, 10, 32, 45, 45, 32,101,108,105,109,105,110, 97, 116,101, 32,117,110,101, 99,101,115,115, 97,114,121, 32,115, 112, 97, 99,101,115, 10, 32, 83, 32, 61, 32,103,115,117, 98, 40, 83, 44, 34, 91, 32, 92,116, 93, 43, 34, 44, 34, 32, 34, 41, 10, 32, 83, 32, 61, 32,103,115,117, 98, 40, 83, 44, 34, 91, 32, 92,116, 93, 42, 92,110, 91, 32, 92,116, 93, 42, 34, 44, 34, 92,110, 34, 41, 10, 9, 83, 32, 61, 32,103,115,117, 98, 40, 83, 44, 34, 92,110, 43, 34, 44, 34, 92,110, 34, 41, 10, 32, 83, 32, 61, 32,117,110,109, 97,115,107, 40, 83, 41, 10, 32,114,101,116,117,114,110, 32, 83, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/clean.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 45, 45, 32, 71,101,110,101,114, 97,116,101, 32, 98,105,110, 100,105,110,103, 32, 99,111,100,101, 10, 45, 45, 32, 87,114, 105,116,116,101,110, 32, 98,121, 32, 87, 97,108,100,101,109, 97,114, 32, 67,101,108,101,115, 10, 45, 45, 32, 84,101, 67, 71,114, 97,102, 47, 80, 85, 67, 45, 82,105,111, 10, 45, 45, 32, 74,117,108, 32, 49, 57, 57, 56, 10, 45, 45, 32, 76, 97, 115,116, 32,117,112,100, 97,116,101, 58, 32, 65,112,114, 32, 50, 48, 48, 51, 10, 45, 45, 32, 36, 73,100, 58, 32, 36, 10, 10, 10, 45, 45, 32, 84,104,105,115, 32, 99,111,100,101, 32, 105,115, 32,102,114,101,101, 32,115,111,102,116,119, 97,114, 101, 59, 32,121,111,117, 32, 99, 97,110, 32,114,101,100,105, 115,116,114,105, 98,117,116,101, 32,105,116, 32, 97,110,100, 47,111,114, 32,109,111,100,105,102,121, 32,105,116, 46, 10, 45, 45, 32, 84,104,101, 32,115,111,102,116,119, 97,114,101, 32,112,114,111,118,105,100,101,100, 32,104,101,114,101,117, 110,100,101,114, 32,105,115, 32,111,110, 32, 97,110, 32, 34, 97,115, 32,105,115, 34, 32, 98, 97,115,105,115, 44, 32, 97, 110,100, 10, 45, 45, 32,116,104,101, 32, 97,117,116,104,111, 114, 32,104, 97,115, 32,110,111, 32,111, 98,108,105,103, 97, 116,105,111,110, 32,116,111, 32,112,114,111,118,105,100,101, 32,109, 97,105,110,116,101,110, 97,110, 99,101, 44, 32,115, 117,112,112,111,114,116, 44, 32,117,112,100, 97,116,101,115, 44, 10, 45, 45, 32,101,110,104, 97,110, 99,101,109,101,110, 116,115, 44, 32,111,114, 32,109,111,100,105,102,105, 99, 97, 116,105,111,110,115, 46, 10, 10,102,117,110, 99,116,105,111, 110, 32,112, 97,114,115,101, 95,101,120,116,114, 97, 40, 41, 10, 10, 9,102,111,114, 32,107, 44,118, 32,105,110, 32,105, 112, 97,105,114,115, 40, 95,101,120,116,114, 97, 95,112, 97, 114, 97,109,101,116,101,114,115, 32,111,114, 32,123,125, 41, 32,100,111, 10, 9, 9, 10, 9, 9,108,111, 99, 97,108, 32, 98, 44,101, 44,110, 97,109,101, 44,118, 97,108,117,101, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,118, 44, 32, 34, 94, 40, 91, 94, 61, 93, 42, 41, 61, 40, 46, 42, 41, 36, 34, 41, 10, 9, 9,105,102, 32, 98, 32,116,104,101, 110, 10, 9, 9, 9, 95,101,120,116,114, 97, 95,112, 97,114, 97,109,101,116,101,114,115, 91,110, 97,109,101, 93, 32, 61, 32,118, 97,108,117,101, 10, 9, 9,101,108,115,101, 10, 9, 9, 9, 95,101,120,116,114, 97, 95,112, 97,114, 97,109,101, 116,101,114,115, 91,118, 93, 32, 61, 32,116,114,117,101, 10, 9, 9,101,110,100, 10, 9,101,110,100, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,100,111,105,116, 32, 40, 41, 10, 9, 45, 45, 32,100,101,102,105,110,101, 32,112, 97, 99,107, 97,103,101, 32,110, 97,109,101, 44, 32,105,102, 32,110,111,116, 32,112,114,111,118,105,100,101,100, 10, 9, 105,102, 32,110,111,116, 32,102,108, 97,103,115, 46,110, 32, 116,104,101,110, 10, 9, 9,105,102, 32,102,108, 97,103,115, 46,102, 32,116,104,101,110, 10, 9, 9, 9,102,108, 97,103, 115, 46,110, 32, 61, 32,103,115,117, 98, 40,102,108, 97,103, 115, 46,102, 44, 34, 37, 46, 46, 42, 36, 34, 44, 34, 34, 41, 10, 9, 9, 9, 95, 44, 95, 44,102,108, 97,103,115, 46,110, 32, 61, 32,115,116,114,105,110,103, 46,102,105,110,100, 40, 102,108, 97,103,115, 46,110, 44, 32, 34, 40, 91, 94, 47, 92, 92, 93, 42, 41, 36, 34, 41, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,101,114,114,111,114, 40, 34, 35,110,111, 32,112, 97, 99,107, 97,103,101, 32,110, 97,109,101, 32,110,111,114, 32,105,110,112,117,116, 32,102,105,108,101, 32,112,114,111, 118,105,100,101,100, 34, 41, 10, 9, 9,101,110,100, 10, 9, 101,110,100, 10, 10, 9, 45, 45, 32,112, 97,114,115,101, 32, 116, 97, 98,108,101, 32,119,105,116,104, 32,101,120,116,114, 97, 32,112, 97,114, 97,109,116,101,114,115, 10, 9,112, 97, 114,115,101, 95,101,120,116,114, 97, 40, 41, 10, 10, 9, 45, 45, 32,100,111, 32,116,104,105,115, 32, 97,102,116,101,114, 32,115,101,116,116,105,110,103, 32,116,104,101, 32,112, 97, 99,107, 97,103,101, 32,110, 97,109,101, 10, 9,105,102, 32, 102,108, 97,103,115, 91, 39, 76, 39, 93, 32,116,104,101,110, 10, 9, 9,100,111,102,105,108,101, 40,102,108, 97,103,115, 91, 39, 76, 39, 93, 41, 10, 9,101,110,100, 10, 10, 9, 45, 45, 32, 97,100,100, 32, 99,112,112,115,116,114,105,110,103, 10, 9,105,102, 32,110,111,116, 32,102,108, 97,103,115, 91, 39, 83, 39, 93, 32,116,104,101,110, 10, 9, 9, 95, 98, 97, 115,105, 99, 91, 39,115,116,114,105,110,103, 39, 93, 32, 61, 32, 39, 99,112,112,115,116,114,105,110,103, 39, 10, 9, 9, 95, 98, 97,115,105, 99, 91, 39,115,116,100, 58, 58,115,116, 114,105,110,103, 39, 93, 32, 61, 32, 39, 99,112,112,115,116, 114,105,110,103, 39, 10, 9, 9, 95, 98, 97,115,105, 99, 95, 99,116,121,112,101, 46, 99,112,112,115,116,114,105,110,103, 32, 61, 32, 39, 99,111,110,115,116, 32, 99,104, 97,114, 42, 39, 10, 9,101,110,100, 10, 10, 9, 45, 45, 32,112,114,111, 99, 99,101,115,115, 32,112, 97, 99,107, 97,103,101, 10, 9, 108,111, 99, 97,108, 32,112, 32, 32, 61, 32, 80, 97, 99,107, 97,103,101, 40,102,108, 97,103,115, 46,110, 44,102,108, 97, 103,115, 46,102, 41, 10, 10, 9,105,102, 32,102,108, 97,103, 115, 46,112, 32,116,104,101,110, 10, 9, 9,114,101,116,117, 114,110, 32, 32, 32, 32, 32, 32, 32, 32, 45, 45, 32,111,110, 108,121, 32,112, 97,114,115,101, 10, 9,101,110,100, 10, 10, 9,105,102, 32,102,108, 97,103,115, 46,111, 32,116,104,101, 110, 10, 9, 9,108,111, 99, 97,108, 32,115,116, 44,109,115, 103, 32, 61, 32,119,114,105,116,101,116,111, 40,102,108, 97, 103,115, 46,111, 41, 10, 9, 9,105,102, 32,110,111,116, 32, 115,116, 32,116,104,101,110, 10, 9, 9, 9,101,114,114,111, 114, 40, 39, 35, 39, 46, 46,109,115,103, 41, 10, 9, 9,101, 110,100, 10, 9,101,110,100, 10, 10, 9,112, 58,100,101, 99, 108,116,121,112,101, 40, 41, 10, 9,105,102, 32,102,108, 97, 103,115, 46, 80, 32,116,104,101,110, 10, 9, 9,112, 58,112, 114,105,110,116, 40, 41, 10, 9,101,108,115,101, 10, 9, 9, 112, 58,112,114,101, 97,109, 98,108,101, 40, 41, 10, 9, 9, 112, 58,115,117,112, 99,111,100,101, 40, 41, 10, 9, 9,112, 58,114,101,103,105,115,116,101,114, 40, 41, 10, 9, 9,112, 117,115,104, 40,112, 41, 10, 9, 9,112,111,115,116, 95,111, 117,116,112,117,116, 95,104,111,111,107, 40,112, 41, 10, 9, 9,112,111,112, 40, 41, 10, 9,101,110,100, 10, 10, 9,105, 102, 32,102,108, 97,103,115, 46,111, 32,116,104,101,110, 10, 9, 9,119,114,105,116,101,116,111, 40, 41, 10, 9,101,110, 100, 10, 10, 9, 45, 45, 32,119,114,105,116,101, 32,104,101, 97,100,101,114, 32,102,105,108,101, 10, 9,105,102, 32,110, 111,116, 32,102,108, 97,103,115, 46, 80, 32,116,104,101,110, 10, 9, 9,105,102, 32,102,108, 97,103,115, 46, 72, 32,116, 104,101,110, 10, 9, 9, 9,108,111, 99, 97,108, 32,115,116, 44,109,115,103, 32, 61, 32,119,114,105,116,101,116,111, 40, 102,108, 97,103,115, 46, 72, 41, 10, 9, 9, 9,105,102, 32, 110,111,116, 32,115,116, 32,116,104,101,110, 10, 9, 9, 9, 9,101,114,114,111,114, 40, 39, 35, 39, 46, 46,109,115,103, 41, 10, 9, 9, 9,101,110,100, 10, 9, 9, 9,112, 58,104, 101, 97,100,101,114, 40, 41, 10, 9, 9, 9,119,114,105,116, 101,116,111, 40, 41, 10, 9, 9,101,110,100, 10, 9,101,110, 100, 10,101,110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: lua/tolua++/src/bin/lua/doit.lua"); lua_settop(tolua_S, top); } /* end of embedded lua code */ { /* begin embedded lua code */ int top = lua_gettop(tolua_S); static unsigned char B[] = { 10,108,111, 99, 97,108, 32,101,114,114, 44,109,115,103, 32, 61, 32,112, 99, 97,108,108, 40,100,111,105,116, 41, 10,105, 102, 32,110,111,116, 32,101,114,114, 32,116,104,101,110, 10, 32,108,111, 99, 97,108, 32, 95, 44, 95, 44,108, 97, 98,101, 108, 44,109,115,103, 32, 61, 32,115,116,114,102,105,110,100, 40,109,115,103, 44, 34, 40, 46, 45, 58, 46, 45, 58, 37,115, 42, 41, 40, 46, 42, 41, 34, 41, 10, 32,116,111,108,117, 97, 95,101,114,114,111,114, 40,109,115,103, 44,108, 97, 98,101, 108, 41, 10, 32,112,114,105,110,116, 40,100,101, 98,117,103, 46,116,114, 97, 99,101, 98, 97, 99,107, 40, 41, 41, 10,101, 110,100,32 }; tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code 23"); lua_settop(tolua_S, top); } /* end of embedded lua code */ tolua_endmodule(tolua_S); return 1; } #if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501 TOLUA_API int luaopen_tolua (lua_State* tolua_S) { return tolua_tolua_open(tolua_S); }; #endif conky-1.12.2/3rdparty/toluapp/src/bin/toluabind_default.h000066400000000000000000000002711404127277500233620ustar00rootroot00000000000000/* ** Lua binding: tolua ** Generated automatically by tolua++-1.0.8pre2 on Tue Dec 13 01:43:55 2005. */ /* Exported function */ TOLUA_API int tolua_tolua_open (lua_State* tolua_S); conky-1.12.2/3rdparty/toluapp/src/lib/000077500000000000000000000000001404127277500175225ustar00rootroot00000000000000conky-1.12.2/3rdparty/toluapp/src/lib/SCsub000066400000000000000000000005461404127277500204710ustar00rootroot00000000000000Import('env') sources = [ 'tolua_event.c', 'tolua_is.c', 'tolua_map.c', 'tolua_push.c', 'tolua_to.c', ] env.lib_target_static = env.Library('#/lib/'+env['tolua_lib']+'_static', sources) if env['shared']: env.lib_target = env.SharedLibrary('#lib/'+env['tolua_lib'], sources) else: env.lib_target = env.Library('#/lib/'+env['tolua_lib'], sources) conky-1.12.2/3rdparty/toluapp/src/lib/tolua_event.c000066400000000000000000000335571404127277500222300ustar00rootroot00000000000000/* tolua: event functions ** Support code for Lua bindings. ** Written by Waldemar Celes ** TeCGraf/PUC-Rio ** Apr 2003 ** $Id: $ */ /* This code is free software; you can redistribute it and/or modify it. ** The software provided hereunder is on an "as is" basis, and ** the author has no obligation to provide maintenance, support, updates, ** enhancements, or modifications. */ #include #include "tolua++.h" /* Store at ubox * It stores, creating the corresponding table if needed, * the pair key/value in the corresponding ubox table */ static void storeatubox (lua_State* L, int lo) { #ifdef LUA_VERSION_NUM #if LUA_VERSION_NUM > 501 lua_getuservalue(L, lo); #else lua_getfenv(L, lo); #endif if (lua_rawequal(L, -1, TOLUA_NOPEER)) { lua_pop(L, 1); lua_newtable(L); lua_pushvalue(L, -1); #if LUA_VERSION_NUM > 501 lua_setuservalue(L, lo); /* stack: k,v,table */ #else lua_setfenv(L, lo); /* stack: k,v,table */ #endif }; lua_insert(L, -3); lua_settable(L, -3); /* on lua 5.1, we trade the "tolua_peers" lookup for a settable call */ lua_pop(L, 1); #else /* stack: key value (to be stored) */ lua_pushstring(L,"tolua_peers"); lua_rawget(L,LUA_REGISTRYINDEX); /* stack: k v ubox */ lua_pushvalue(L,lo); lua_rawget(L,-2); /* stack: k v ubox ubox[u] */ if (!lua_istable(L,-1)) { lua_pop(L,1); /* stack: k v ubox */ lua_newtable(L); /* stack: k v ubox table */ lua_pushvalue(L,1); lua_pushvalue(L,-2); /* stack: k v ubox table u table */ lua_rawset(L,-4); /* stack: k v ubox ubox[u]=table */ } lua_insert(L,-4); /* put table before k */ lua_pop(L,1); /* pop ubox */ lua_rawset(L,-3); /* store at table */ lua_pop(L,1); /* pop ubox[u] */ #endif } /* Module index function */ static int module_index_event (lua_State* L) { lua_pushstring(L,".get"); lua_rawget(L,-3); if (lua_istable(L,-1)) { lua_pushvalue(L,2); /* key */ lua_rawget(L,-2); if (lua_iscfunction(L,-1)) { lua_call(L,0,1); return 1; } else if (lua_istable(L,-1)) return 1; } /* call old index meta event */ if (lua_getmetatable(L,1)) { lua_pushstring(L,"__index"); lua_rawget(L,-2); lua_pushvalue(L,1); lua_pushvalue(L,2); if (lua_isfunction(L,-1)) { lua_call(L,2,1); return 1; } else if (lua_istable(L,-1)) { lua_gettable(L,-3); return 1; } } lua_pushnil(L); return 1; } /* Module newindex function */ static int module_newindex_event (lua_State* L) { lua_pushstring(L,".set"); lua_rawget(L,-4); if (lua_istable(L,-1)) { lua_pushvalue(L,2); /* key */ lua_rawget(L,-2); if (lua_iscfunction(L,-1)) { lua_pushvalue(L,1); /* only to be compatible with non-static vars */ lua_pushvalue(L,3); /* value */ lua_call(L,2,0); return 0; } } /* call old newindex meta event */ if (lua_getmetatable(L,1) && lua_getmetatable(L,-1)) { lua_pushstring(L,"__newindex"); lua_rawget(L,-2); if (lua_isfunction(L,-1)) { lua_pushvalue(L,1); lua_pushvalue(L,2); lua_pushvalue(L,3); lua_call(L,3,0); } } lua_settop(L,3); lua_rawset(L,-3); return 0; } /* Class index function * If the object is a userdata (ie, an object), it searches the field in * the alternative table stored in the corresponding "ubox" table. */ static int class_index_event (lua_State* L) { int t = lua_type(L,1); if (t == LUA_TUSERDATA) { /* Access alternative table */ #ifdef LUA_VERSION_NUM /* new macro on version 5.1 */ #if LUA_VERSION_NUM > 501 lua_getuservalue(L, 1); #else lua_getfenv(L,1); #endif if (!lua_rawequal(L, -1, TOLUA_NOPEER)) { lua_pushvalue(L, 2); /* key */ lua_gettable(L, -2); /* on lua 5.1, we trade the "tolua_peers" lookup for a gettable call */ if (!lua_isnil(L, -1)) return 1; }; #else lua_pushstring(L,"tolua_peers"); lua_rawget(L,LUA_REGISTRYINDEX); /* stack: obj key ubox */ lua_pushvalue(L,1); lua_rawget(L,-2); /* stack: obj key ubox ubox[u] */ if (lua_istable(L,-1)) { lua_pushvalue(L,2); /* key */ lua_rawget(L,-2); /* stack: obj key ubox ubox[u] value */ if (!lua_isnil(L,-1)) return 1; } #endif lua_settop(L,2); /* stack: obj key */ /* Try metatables */ lua_pushvalue(L,1); /* stack: obj key obj */ while (lua_getmetatable(L,-1)) { /* stack: obj key obj mt */ lua_remove(L,-2); /* stack: obj key mt */ if (lua_isnumber(L,2)) /* check if key is a numeric value */ { /* try operator[] */ lua_pushstring(L,".geti"); lua_rawget(L,-2); /* stack: obj key mt func */ if (lua_isfunction(L,-1)) { lua_pushvalue(L,1); lua_pushvalue(L,2); lua_call(L,2,1); return 1; } } else { lua_pushvalue(L,2); /* stack: obj key mt key */ lua_rawget(L,-2); /* stack: obj key mt value */ if (!lua_isnil(L,-1)) return 1; else lua_pop(L,1); /* try C/C++ variable */ lua_pushstring(L,".get"); lua_rawget(L,-2); /* stack: obj key mt tget */ if (lua_istable(L,-1)) { lua_pushvalue(L,2); lua_rawget(L,-2); /* stack: obj key mt value */ if (lua_iscfunction(L,-1)) { lua_pushvalue(L,1); lua_pushvalue(L,2); lua_call(L,2,1); return 1; } else if (lua_istable(L,-1)) { /* deal with array: create table to be returned and cache it in ubox */ void* u = *((void**)lua_touserdata(L,1)); lua_newtable(L); /* stack: obj key mt value table */ lua_pushstring(L,".self"); lua_pushlightuserdata(L,u); lua_rawset(L,-3); /* store usertype in ".self" */ lua_insert(L,-2); /* stack: obj key mt table value */ lua_setmetatable(L,-2); /* set stored value as metatable */ lua_pushvalue(L,-1); /* stack: obj key met table table */ lua_pushvalue(L,2); /* stack: obj key mt table table key */ lua_insert(L,-2); /* stack: obj key mt table key table */ storeatubox(L,1); /* stack: obj key mt table */ return 1; } } } lua_settop(L,3); } lua_pushnil(L); return 1; } else if (t== LUA_TTABLE) { module_index_event(L); return 1; } lua_pushnil(L); return 1; } /* Newindex function * It first searches for a C/C++ varaible to be set. * Then, it either stores it in the alternative ubox table (in the case it is * an object) or in the own table (that represents the class or module). */ static int class_newindex_event (lua_State* L) { int t = lua_type(L,1); if (t == LUA_TUSERDATA) { /* Try accessing a C/C++ variable to be set */ lua_getmetatable(L,1); while (lua_istable(L,-1)) /* stack: t k v mt */ { if (lua_isnumber(L,2)) /* check if key is a numeric value */ { /* try operator[] */ lua_pushstring(L,".seti"); lua_rawget(L,-2); /* stack: obj key mt func */ if (lua_isfunction(L,-1)) { lua_pushvalue(L,1); lua_pushvalue(L,2); lua_pushvalue(L,3); lua_call(L,3,0); return 0; } } else { lua_pushstring(L,".set"); lua_rawget(L,-2); /* stack: t k v mt tset */ if (lua_istable(L,-1)) { lua_pushvalue(L,2); lua_rawget(L,-2); /* stack: t k v mt tset func */ if (lua_iscfunction(L,-1)) { lua_pushvalue(L,1); lua_pushvalue(L,3); lua_call(L,2,0); return 0; } lua_pop(L,1); /* stack: t k v mt tset */ } lua_pop(L,1); /* stack: t k v mt */ if (!lua_getmetatable(L,-1)) /* stack: t k v mt mt */ lua_pushnil(L); lua_remove(L,-2); /* stack: t k v mt */ } } lua_settop(L,3); /* stack: t k v */ /* then, store as a new field */ storeatubox(L,1); } else if (t== LUA_TTABLE) { module_newindex_event(L); } return 0; } static int class_call_event(lua_State* L) { if (lua_istable(L, 1)) { lua_pushstring(L, ".call"); lua_rawget(L, 1); if (lua_isfunction(L, -1)) { lua_insert(L, 1); lua_call(L, lua_gettop(L)-1, 1); return 1; }; }; tolua_error(L,"Attempt to call a non-callable object.",NULL); return 0; } static int do_operator (lua_State* L, const char* op) { if (lua_isuserdata(L,1)) { /* Try metatables */ lua_pushvalue(L,1); /* stack: op1 op2 */ while (lua_getmetatable(L,-1)) { /* stack: op1 op2 op1 mt */ lua_remove(L,-2); /* stack: op1 op2 mt */ lua_pushstring(L,op); /* stack: op1 op2 mt key */ lua_rawget(L,-2); /* stack: obj key mt func */ if (lua_isfunction(L,-1)) { lua_pushvalue(L,1); lua_pushvalue(L,2); lua_call(L,2,1); return 1; } lua_settop(L,3); } } tolua_error(L,"Attempt to perform operation on an invalid operand",NULL); return 0; } static int class_add_event (lua_State* L) { return do_operator(L,".add"); } static int class_sub_event (lua_State* L) { return do_operator(L,".sub"); } static int class_mul_event (lua_State* L) { return do_operator(L,".mul"); } static int class_div_event (lua_State* L) { return do_operator(L,".div"); } static int class_lt_event (lua_State* L) { return do_operator(L,".lt"); } static int class_le_event (lua_State* L) { return do_operator(L,".le"); } static int class_eq_event (lua_State* L) { /* copying code from do_operator here to return false when no operator is found */ if (lua_isuserdata(L,1)) { /* Try metatables */ lua_pushvalue(L,1); /* stack: op1 op2 */ while (lua_getmetatable(L,-1)) { /* stack: op1 op2 op1 mt */ lua_remove(L,-2); /* stack: op1 op2 mt */ lua_pushstring(L,".eq"); /* stack: op1 op2 mt key */ lua_rawget(L,-2); /* stack: obj key mt func */ if (lua_isfunction(L,-1)) { lua_pushvalue(L,1); lua_pushvalue(L,2); lua_call(L,2,1); return 1; } lua_settop(L,3); } } lua_settop(L, 3); lua_pushboolean(L, 0); return 1; } /* static int class_gc_event (lua_State* L) { void* u = *((void**)lua_touserdata(L,1)); fprintf(stderr, "collecting: looking at %p\n", u); lua_pushstring(L,"tolua_gc"); lua_rawget(L,LUA_REGISTRYINDEX); lua_pushlightuserdata(L,u); lua_rawget(L,-2); if (lua_isfunction(L,-1)) { lua_pushvalue(L,1); lua_call(L,1,0); lua_pushlightuserdata(L,u); lua_pushnil(L); lua_rawset(L,-3); } lua_pop(L,2); return 0; } */ TOLUA_API int class_gc_event (lua_State* L) { if (lua_type(L,1) == LUA_TUSERDATA) { void* u = *((void**)lua_touserdata(L,1)); int top; /*fprintf(stderr, "collecting: looking at %p\n", u);*/ /* lua_pushstring(L,"tolua_gc"); lua_rawget(L,LUA_REGISTRYINDEX); */ lua_pushstring(L,"tolua_gc"); lua_rawget(L,LUA_REGISTRYINDEX); /* gc */ lua_pushlightuserdata(L,u); lua_rawget(L,-2); /* stack: gc umt */ lua_getmetatable(L,1); /* stack: gc umt mt */ /*fprintf(stderr, "checking type\n");*/ top = lua_gettop(L); if (tolua_fast_isa(L,top,top-1, lua_upvalueindex(2))) /* make sure we collect correct type */ { /*fprintf(stderr, "Found type!\n");*/ /* get gc function */ lua_pushliteral(L,".collector"); lua_rawget(L,-2); /* stack: gc umt mt collector */ if (lua_isfunction(L,-1)) { /*fprintf(stderr, "Found .collector!\n");*/ } else { lua_pop(L,1); /*fprintf(stderr, "Using default cleanup\n");*/ lua_pushcfunction(L,tolua_default_collect); } lua_pushvalue(L,1); /* stack: gc umt mt collector u */ lua_call(L,1,0); lua_pushlightuserdata(L,u); /* stack: gc umt mt u */ lua_pushnil(L); /* stack: gc umt mt u nil */ lua_rawset(L,-5); /* stack: gc umt mt */ } lua_pop(L,3); } return 0; } /* Register module events * It expects the metatable on the top of the stack */ TOLUA_API void tolua_moduleevents (lua_State* L) { lua_pushstring(L,"__index"); lua_pushcfunction(L,module_index_event); lua_rawset(L,-3); lua_pushstring(L,"__newindex"); lua_pushcfunction(L,module_newindex_event); lua_rawset(L,-3); } /* Check if the object on the top has a module metatable */ TOLUA_API int tolua_ismodulemetatable (lua_State* L) { int r = 0; if (lua_getmetatable(L,-1)) { lua_pushstring(L,"__index"); lua_rawget(L,-2); r = (lua_tocfunction(L,-1) == module_index_event); lua_pop(L,2); } return r; } /* Register class events * It expects the metatable on the top of the stack */ TOLUA_API void tolua_classevents (lua_State* L) { lua_pushstring(L,"__index"); lua_pushcfunction(L,class_index_event); lua_rawset(L,-3); lua_pushstring(L,"__newindex"); lua_pushcfunction(L,class_newindex_event); lua_rawset(L,-3); lua_pushstring(L,"__add"); lua_pushcfunction(L,class_add_event); lua_rawset(L,-3); lua_pushstring(L,"__sub"); lua_pushcfunction(L,class_sub_event); lua_rawset(L,-3); lua_pushstring(L,"__mul"); lua_pushcfunction(L,class_mul_event); lua_rawset(L,-3); lua_pushstring(L,"__div"); lua_pushcfunction(L,class_div_event); lua_rawset(L,-3); lua_pushstring(L,"__lt"); lua_pushcfunction(L,class_lt_event); lua_rawset(L,-3); lua_pushstring(L,"__le"); lua_pushcfunction(L,class_le_event); lua_rawset(L,-3); lua_pushstring(L,"__eq"); lua_pushcfunction(L,class_eq_event); lua_rawset(L,-3); lua_pushstring(L,"__call"); lua_pushcfunction(L,class_call_event); lua_rawset(L,-3); lua_pushstring(L,"__gc"); lua_pushstring(L, "tolua_gc_event"); lua_rawget(L, LUA_REGISTRYINDEX); /*lua_pushcfunction(L,class_gc_event);*/ lua_rawset(L,-3); } conky-1.12.2/3rdparty/toluapp/src/lib/tolua_event.h000066400000000000000000000011431404127277500222170ustar00rootroot00000000000000/* tolua: event functions ** Support code for Lua bindings. ** Written by Waldemar Celes ** TeCGraf/PUC-Rio ** Apr 2003 ** $Id: $ */ /* This code is free software; you can redistribute it and/or modify it. ** The software provided hereunder is on an "as is" basis, and ** the author has no obligation to provide maintenance, support, updates, ** enhancements, or modifications. */ #ifndef TOLUA_EVENT_H #define TOLUA_EVENT_H #include "tolua++.h" TOLUA_API void tolua_moduleevents (lua_State* L); TOLUA_API int tolua_ismodulemetatable (lua_State* L); TOLUA_API void tolua_classevents (lua_State* L); #endif conky-1.12.2/3rdparty/toluapp/src/lib/tolua_is.c000066400000000000000000000302301404127277500215030ustar00rootroot00000000000000/* tolua: functions to check types. ** Support code for Lua bindings. ** Written by Waldemar Celes ** TeCGraf/PUC-Rio ** Apr 2003 ** $Id: $ */ /* This code is free software; you can redistribute it and/or modify it. ** The software provided hereunder is on an "as is" basis, and ** the author has no obligation to provide maintenance, support, updates, ** enhancements, or modifications. */ #include "tolua++.h" #include "lauxlib.h" #include #include /* a fast check if a is b, without parameter validation i.e. if b is equal to a or a superclass of a. */ TOLUA_API int tolua_fast_isa(lua_State *L, int mt_indexa, int mt_indexb, int super_index) { int result; if (lua_rawequal(L, mt_indexa, mt_indexb)) result = 1; else { if (super_index) { lua_pushvalue(L, super_index); } else { lua_pushliteral(L, "tolua_super"); lua_rawget(L, LUA_REGISTRYINDEX); /* stack: super */ } lua_pushvalue(L, mt_indexa); /* stack: super mta */ lua_rawget(L, -2); /* stack: super super[mta] */ lua_pushvalue(L, mt_indexb); /* stack: super super[mta] mtb */ lua_rawget(L, LUA_REGISTRYINDEX); /* stack: super super[mta] typenameB */ lua_rawget(L, -2); /* stack: super super[mta] bool */ result = lua_toboolean(L, -1); lua_pop(L, 3); } return result; } /* Push and returns the corresponding object typename */ TOLUA_API const char *tolua_typename(lua_State *L, int lo) { int tag = lua_type(L, lo); if (tag == LUA_TNONE) lua_pushstring(L, "[no object]"); else if (tag != LUA_TUSERDATA && tag != LUA_TTABLE) lua_pushstring(L, lua_typename(L, tag)); else if (tag == LUA_TUSERDATA) { if (!lua_getmetatable(L, lo)) lua_pushstring(L, lua_typename(L, tag)); else { lua_rawget(L, LUA_REGISTRYINDEX); if (!lua_isstring(L, -1)) { lua_pop(L, 1); lua_pushstring(L, "[undefined]"); } } } else /* is table */ { lua_pushvalue(L, lo); lua_rawget(L, LUA_REGISTRYINDEX); if (!lua_isstring(L, -1)) { lua_pop(L, 1); lua_pushstring(L, "table"); } else { lua_pushstring(L, "class "); lua_insert(L, -2); lua_concat(L, 2); } } return lua_tostring(L, -1); } TOLUA_API void tolua_error(lua_State *L, const char *msg, tolua_Error *err) { if (msg[0] == '#') { const char *expected = err->type; const char *provided = tolua_typename(L, err->index); if (msg[1] == 'f') { int narg = err->index; if (err->array) luaL_error(L, "%s\n argument #%d is array of '%s'; array of '%s' expected.\n", msg + 2, narg, provided, expected); else luaL_error(L, "%s\n argument #%d is '%s'; '%s' expected.\n", msg + 2, narg, provided, expected); } else if (msg[1] == 'v') { if (err->array) luaL_error(L, "%s\n value is array of '%s'; array of '%s' expected.\n", msg + 2, provided, expected); else luaL_error(L, "%s\n value is '%s'; '%s' expected.\n", msg + 2, provided, expected); } } else luaL_error(L, msg); } /* the equivalent of lua_is* for usertable */ static int lua_isusertable(lua_State *L, int lo, const char *type) { int r = 0; if (lo < 0) lo = lua_gettop(L) + lo + 1; lua_pushvalue(L, lo); lua_rawget(L, LUA_REGISTRYINDEX); /* get registry[t] */ if (lua_isstring(L, -1)) { r = strcmp(lua_tostring(L, -1), type) == 0; if (!r) { /* try const */ lua_pushstring(L, "const "); lua_insert(L, -2); lua_concat(L, 2); r = lua_isstring(L, -1) && strcmp(lua_tostring(L, -1), type) == 0; } } lua_pop(L, 1); return r; } int push_table_instance(lua_State *L, int lo) { if (lua_istable(L, lo)) { lua_pushstring(L, ".c_instance"); lua_gettable(L, lo); if (lua_isuserdata(L, -1)) { lua_replace(L, lo); return 1; } else { lua_pop(L, 1); return 0; } } else { return 0; } return 0; } /* the equivalent of lua_is* for usertype */ static int lua_isusertype(lua_State *L, int lo, const char *type) { if (!lua_isuserdata(L, lo)) { if (!push_table_instance(L, lo)) { return 0; } } { /* check if it is of the same type */ int r; const char *tn; if (lua_getmetatable(L, lo)) /* if metatable? */ { lua_rawget(L, LUA_REGISTRYINDEX); /* get registry[mt] */ tn = lua_tostring(L, -1); r = tn && (strcmp(tn, type) == 0); lua_pop(L, 1); if (r) return 1; else { /* check if it is a specialized class */ lua_pushstring(L, "tolua_super"); lua_rawget(L, LUA_REGISTRYINDEX); /* get super */ lua_getmetatable(L, lo); lua_rawget(L, -2); /* get super[mt] */ if (lua_istable(L, -1)) { int b; lua_pushstring(L, type); lua_rawget(L, -2); /* get super[mt][type] */ b = lua_toboolean(L, -1); lua_pop(L, 3); if (b) return 1; } } } } return 0; } TOLUA_API int tolua_isnoobj(lua_State *L, int lo, tolua_Error *err) { if (lua_gettop(L) < abs(lo)) return 1; err->index = lo; err->array = 0; err->type = "[no object]"; return 0; } TOLUA_API int tolua_isboolean(lua_State *L, int lo, int def, tolua_Error *err) { if (def && lua_gettop(L) < abs(lo)) return 1; if (lua_isnil(L, lo) || lua_isboolean(L, lo)) return 1; err->index = lo; err->array = 0; err->type = "boolean"; return 0; } TOLUA_API int tolua_isnumber(lua_State *L, int lo, int def, tolua_Error *err) { if (def && lua_gettop(L) < abs(lo)) return 1; if (lua_isnumber(L, lo)) return 1; err->index = lo; err->array = 0; err->type = "number"; return 0; } TOLUA_API int tolua_isstring(lua_State *L, int lo, int def, tolua_Error *err) { if (def && lua_gettop(L) < abs(lo)) return 1; if (lua_isnil(L, lo) || lua_isstring(L, lo)) return 1; err->index = lo; err->array = 0; err->type = "string"; return 0; } TOLUA_API int tolua_istable(lua_State *L, int lo, int def, tolua_Error *err) { if (def && lua_gettop(L) < abs(lo)) return 1; if (lua_istable(L, lo)) return 1; err->index = lo; err->array = 0; err->type = "table"; return 0; } TOLUA_API int tolua_isusertable(lua_State *L, int lo, const char *type, int def, tolua_Error *err) { if (def && lua_gettop(L) < abs(lo)) return 1; if (lua_isusertable(L, lo, type)) return 1; err->index = lo; err->array = 0; err->type = type; return 0; } TOLUA_API int tolua_isuserdata(lua_State *L, int lo, int def, tolua_Error *err) { if (def && lua_gettop(L) < abs(lo)) return 1; if (lua_isnil(L, lo) || lua_isuserdata(L, lo)) return 1; err->index = lo; err->array = 0; err->type = "userdata"; return 0; } TOLUA_API int tolua_isvaluenil(lua_State *L, int lo, tolua_Error *err) { if (lua_gettop(L) < abs(lo)) return 0; /* somebody else should chack this */ if (!lua_isnil(L, lo)) return 0; err->index = lo; err->array = 0; err->type = "value"; return 1; } TOLUA_API int tolua_isvalue(lua_State *L, int lo, int def, tolua_Error *err) { if (def || abs(lo) <= lua_gettop(L)) /* any valid index */ return 1; err->index = lo; err->array = 0; err->type = "value"; return 0; } TOLUA_API int tolua_isusertype(lua_State *L, int lo, const char *type, int def, tolua_Error *err) { if (def && lua_gettop(L) < abs(lo)) return 1; if (lua_isnil(L, lo) || lua_isusertype(L, lo, type)) return 1; err->index = lo; err->array = 0; err->type = type; return 0; } TOLUA_API int tolua_isvaluearray(lua_State *L, int lo, int dim, int def, tolua_Error *err) { (void)dim; if (!tolua_istable(L, lo, def, err)) return 0; else return 1; } TOLUA_API int tolua_isbooleanarray(lua_State *L, int lo, int dim, int def, tolua_Error *err) { if (!tolua_istable(L, lo, def, err)) return 0; else { int i; for (i = 1; i <= dim; ++i) { lua_pushnumber(L, i); lua_gettable(L, lo); if (!(lua_isnil(L, -1) || lua_isboolean(L, -1)) && !(def && lua_isnil(L, -1))) { err->index = lo; err->array = 1; err->type = "boolean"; return 0; } lua_pop(L, 1); } } return 1; } TOLUA_API int tolua_isnumberarray(lua_State *L, int lo, int dim, int def, tolua_Error *err) { if (!tolua_istable(L, lo, def, err)) return 0; else { int i; for (i = 1; i <= dim; ++i) { lua_pushnumber(L, i); lua_gettable(L, lo); if (!lua_isnumber(L, -1) && !(def && lua_isnil(L, -1))) { err->index = lo; err->array = 1; err->type = "number"; return 0; } lua_pop(L, 1); } } return 1; } TOLUA_API int tolua_isstringarray(lua_State *L, int lo, int dim, int def, tolua_Error *err) { if (!tolua_istable(L, lo, def, err)) return 0; else { int i; for (i = 1; i <= dim; ++i) { lua_pushnumber(L, i); lua_gettable(L, lo); if (!(lua_isnil(L, -1) || lua_isstring(L, -1)) && !(def && lua_isnil(L, -1))) { err->index = lo; err->array = 1; err->type = "string"; return 0; } lua_pop(L, 1); } } return 1; } TOLUA_API int tolua_istablearray(lua_State *L, int lo, int dim, int def, tolua_Error *err) { if (!tolua_istable(L, lo, def, err)) return 0; else { int i; for (i = 1; i <= dim; ++i) { lua_pushnumber(L, i); lua_gettable(L, lo); if (!lua_istable(L, -1) && !(def && lua_isnil(L, -1))) { err->index = lo; err->array = 1; err->type = "table"; return 0; } lua_pop(L, 1); } } return 1; } TOLUA_API int tolua_isuserdataarray(lua_State *L, int lo, int dim, int def, tolua_Error *err) { if (!tolua_istable(L, lo, def, err)) return 0; else { int i; for (i = 1; i <= dim; ++i) { lua_pushnumber(L, i); lua_gettable(L, lo); if (!(lua_isnil(L, -1) || lua_isuserdata(L, -1)) && !(def && lua_isnil(L, -1))) { err->index = lo; err->array = 1; err->type = "userdata"; return 0; } lua_pop(L, 1); } } return 1; } TOLUA_API int tolua_isusertypearray(lua_State *L, int lo, const char *type, int dim, int def, tolua_Error *err) { if (!tolua_istable(L, lo, def, err)) return 0; else { int i; for (i = 1; i <= dim; ++i) { lua_pushnumber(L, i); lua_gettable(L, lo); if (!(lua_isnil(L, -1) || lua_isuserdata(L, -1)) && !(def && lua_isnil(L, -1))) { err->index = lo; err->type = type; err->array = 1; return 0; } lua_pop(L, 1); } } return 1; } #if 0 int tolua_isbooleanfield (lua_State* L, int lo, int i, int def, tolua_Error* err) { lua_pushnumber(L,i); lua_gettable(L,lo); if (!(lua_isnil(L,-1) || lua_isboolean(L,-1)) && !(def && lua_isnil(L,-1)) ) { err->index = lo; err->array = 1; err->type = "boolean"; return 0; } lua_pop(L,1); return 1; } int tolua_isnumberfield (lua_State* L, int lo, int i, int def, tolua_Error* err) { lua_pushnumber(L,i); lua_gettable(L,lo); if (!lua_isnumber(L,-1) && !(def && lua_isnil(L,-1)) ) { err->index = lo; err->array = 1; err->type = "number"; return 0; } lua_pop(L,1); return 1; } int tolua_isstringfield (lua_State* L, int lo, int i, int def, tolua_Error* err) { lua_pushnumber(L,i); lua_gettable(L,lo); if (!(lua_isnil(L,-1) || lua_isstring(L,-1)) && !(def && lua_isnil(L,-1)) ) { err->index = lo; err->array = 1; err->type = "string"; return 0; } lua_pop(L,1); return 1; } int tolua_istablefield (lua_State* L, int lo, int i, int def, tolua_Error* err) { lua_pushnumber(L,i+1); lua_gettable(L,lo); if (! lua_istable(L,-1) && !(def && lua_isnil(L,-1)) ) { err->index = lo; err->array = 1; err->type = "table"; return 0; } lua_pop(L,1); } int tolua_isusertablefield (lua_State* L, int lo, const char* type, int i, int def, tolua_Error* err) { lua_pushnumber(L,i); lua_gettable(L,lo); if (! lua_isusertable(L,-1,type) && !(def && lua_isnil(L,-1)) ) { err->index = lo; err->array = 1; err->type = type; return 0; } lua_pop(L,1); return 1; } int tolua_isuserdatafield (lua_State* L, int lo, int i, int def, tolua_Error* err) { lua_pushnumber(L,i); lua_gettable(L,lo); if (!(lua_isnil(L,-1) || lua_isuserdata(L,-1)) && !(def && lua_isnil(L,-1)) ) { err->index = lo; err->array = 1; err->type = "userdata"; return 0; } lua_pop(L,1); return 1; } int tolua_isusertypefield (lua_State* L, int lo, const char* type, int i, int def, tolua_Error* err) { lua_pushnumber(L,i); lua_gettable(L,lo); if (!(lua_isnil(L,-1) || lua_isusertype(L,-1,type)) && !(def && lua_isnil(L,-1)) ) { err->index = lo; err->type = type; err->array = 1; return 0; } lua_pop(L,1); return 1; } #endif conky-1.12.2/3rdparty/toluapp/src/lib/tolua_map.c000066400000000000000000000416001404127277500216500ustar00rootroot00000000000000/* tolua: functions to map features ** Support code for Lua bindings. ** Written by Waldemar Celes ** TeCGraf/PUC-Rio ** Apr 2003 ** $Id: $ */ /* This code is free software; you can redistribute it and/or modify it. ** The software provided hereunder is on an "as is" basis, and ** the author has no obligation to provide maintenance, support, updates, ** enhancements, or modifications. */ #include "tolua++.h" #include "tolua_event.h" #include "lauxlib.h" #include #include #include #include /* Create metatable * Create and register new metatable */ static int tolua_newmetatable(lua_State *L, const char *name) { int r = luaL_newmetatable(L, name); #ifdef LUA_VERSION_NUM /* only lua 5.1 */ if (r) { lua_pushvalue(L, -1); lua_pushstring(L, name); lua_settable(L, LUA_REGISTRYINDEX); /* reg[mt] = type_name */ } #endif if (r) tolua_classevents(L); /* set meta events */ lua_pop(L, 1); return r; } /* Map super classes * It sets 'name' as being also a 'base', mapping all super classes of 'base' in 'name' */ static void mapsuper(lua_State *L, const char *name, const char *base) { /* push registry.super */ lua_pushstring(L, "tolua_super"); lua_rawget(L, LUA_REGISTRYINDEX); /* stack: super */ luaL_getmetatable(L, name); /* stack: super mt */ lua_rawget(L, -2); /* stack: super table */ if (lua_isnil(L, -1)) { /* create table */ lua_pop(L, 1); lua_newtable(L); /* stack: super table */ luaL_getmetatable(L, name); /* stack: super table mt */ lua_pushvalue(L, -2); /* stack: super table mt table */ lua_rawset(L, -4); /* stack: super table */ } /* set base as super class */ lua_pushstring(L, base); lua_pushboolean(L, 1); lua_rawset(L, -3); /* stack: super table */ /* set all super class of base as super class of name */ luaL_getmetatable(L, base); /* stack: super table base_mt */ lua_rawget(L, -3); /* stack: super table base_table */ if (lua_istable(L, -1)) { /* traverse base table */ lua_pushnil(L); /* first key */ while (lua_next(L, -2) != 0) { /* stack: ... base_table key value */ lua_pushvalue(L, -2); /* stack: ... base_table key value key */ lua_insert(L, -2); /* stack: ... base_table key key value */ lua_rawset(L, -5); /* stack: ... base_table key */ } } lua_pop(L, 3); /* stack: */ } /* creates a 'tolua_ubox' table for base clases, and // expects the metatable and base metatable on the stack */ static void set_ubox(lua_State *L) { /* mt basemt */ if (!lua_isnil(L, -1)) { lua_pushstring(L, "tolua_ubox"); lua_rawget(L, -2); } else { lua_pushnil(L); } /* mt basemt base_ubox */ if (!lua_isnil(L, -1)) { lua_pushstring(L, "tolua_ubox"); lua_insert(L, -2); /* mt basemt key ubox */ lua_rawset(L, -4); /* (mt with ubox) basemt */ } else { /* mt basemt nil */ lua_pop(L, 1); lua_pushstring(L, "tolua_ubox"); lua_newtable(L); /* make weak value metatable for ubox table to allow userdata to be garbage-collected */ lua_newtable(L); lua_pushliteral(L, "__mode"); lua_pushliteral(L, "v"); lua_rawset(L, -3); /* stack: string ubox mt */ lua_setmetatable(L, -2); /* stack:mt basemt string ubox */ lua_rawset(L, -4); } } /* Map inheritance * It sets 'name' as derived from 'base' by setting 'base' as metatable of 'name' */ static void mapinheritance(lua_State *L, const char *name, const char *base) { /* set metatable inheritance */ luaL_getmetatable(L, name); if (base && *base) luaL_getmetatable(L, base); else { if (lua_getmetatable(L, -1)) { /* already has a mt, we don't overwrite it */ lua_pop(L, 2); return; } luaL_getmetatable(L, "tolua_commonclass"); } set_ubox(L); lua_setmetatable(L, -2); lua_pop(L, 1); } /* Object type */ static int tolua_bnd_type(lua_State *L) { tolua_typename(L, lua_gettop(L)); return 1; } /* Take ownership */ static int tolua_bnd_takeownership(lua_State *L) { int success = 0; if (lua_isuserdata(L, 1)) { if (lua_getmetatable(L, 1)) /* if metatable? */ { lua_pop(L, 1); /* clear metatable off stack */ /* force garbage collection to avoid C to reuse a to-be-collected address */ #ifdef LUA_VERSION_NUM lua_gc(L, LUA_GCCOLLECT, 0); #else lua_setgcthreshold(L, 0); #endif success = tolua_register_gc(L, 1); } } lua_pushboolean(L, success != 0); return 1; } /* Release ownership */ static int tolua_bnd_releaseownership(lua_State *L) { int done = 0; if (lua_isuserdata(L, 1)) { void *u = *((void **)lua_touserdata(L, 1)); /* force garbage collection to avoid releasing a to-be-collected address */ #ifdef LUA_VERSION_NUM lua_gc(L, LUA_GCCOLLECT, 0); #else lua_setgcthreshold(L, 0); #endif lua_pushstring(L, "tolua_gc"); lua_rawget(L, LUA_REGISTRYINDEX); lua_pushlightuserdata(L, u); lua_rawget(L, -2); lua_getmetatable(L, 1); if (lua_rawequal(L, -1, -2)) /* check that we are releasing the correct type */ { lua_pushlightuserdata(L, u); lua_pushnil(L); lua_rawset(L, -5); done = 1; } } lua_pushboolean(L, done != 0); return 1; } /* Type casting */ static int tolua_bnd_cast(lua_State *L) { /* // old code void* v = tolua_tousertype(L,1,NULL); const char* s = tolua_tostring(L,2,NULL); if (v && s) tolua_pushusertype(L,v,s); else lua_pushnil(L); return 1; */ void *v; const char *s; if (lua_islightuserdata(L, 1)) { v = tolua_touserdata(L, 1, NULL); } else { v = tolua_tousertype(L, 1, 0); } s = tolua_tostring(L, 2, NULL); if (v && s) tolua_pushusertype(L, v, s); else lua_pushnil(L); return 1; } /* Inheritance */ static int tolua_bnd_inherit(lua_State *L) { /* stack: lua object, c object */ lua_pushstring(L, ".c_instance"); lua_pushvalue(L, -2); lua_rawset(L, -4); /* l_obj[".c_instance"] = c_obj */ return 0; } #ifdef LUA_VERSION_NUM /* lua 5.1 */ static int tolua_bnd_setpeer(lua_State *L) { /* stack: userdata, table */ if (!lua_isuserdata(L, -2)) { lua_pushstring(L, "Invalid argument #1 to setpeer: userdata expected."); lua_error(L); } if (lua_isnil(L, -1)) { lua_pop(L, 1); lua_pushvalue(L, TOLUA_NOPEER); } #if LUA_VERSION_NUM > 501 lua_setuservalue(L, -2); #else lua_setfenv(L, -2); #endif return 0; } static int tolua_bnd_getpeer(lua_State *L) { /* stack: userdata */ #if LUA_VERSION_NUM > 501 lua_getuservalue(L, -1); #else lua_getfenv(L, -1); #endif if (lua_rawequal(L, -1, TOLUA_NOPEER)) { lua_pop(L, 1); lua_pushnil(L); } return 1; } #endif /* static int class_gc_event (lua_State* L); */ TOLUA_API void tolua_open(lua_State *L) { int top = lua_gettop(L); lua_pushstring(L, "tolua_opened"); lua_rawget(L, LUA_REGISTRYINDEX); if (!lua_isboolean(L, -1)) { lua_pushstring(L, "tolua_opened"); lua_pushboolean(L, 1); lua_rawset(L, LUA_REGISTRYINDEX); #ifndef LUA_VERSION_NUM /* only prior to lua 5.1 */ /* create peer object table */ lua_pushstring(L, "tolua_peers"); lua_newtable(L); /* make weak key metatable for peers indexed by userdata object */ lua_newtable(L); lua_pushliteral(L, "__mode"); lua_pushliteral(L, "k"); lua_rawset(L, -3); /* stack: string peers mt */ lua_setmetatable(L, -2); /* stack: string peers */ lua_rawset(L, LUA_REGISTRYINDEX); #endif /* create object ptr -> udata mapping table */ lua_pushstring(L, "tolua_ubox"); lua_newtable(L); /* make weak value metatable for ubox table to allow userdata to be garbage-collected */ lua_newtable(L); lua_pushliteral(L, "__mode"); lua_pushliteral(L, "v"); lua_rawset(L, -3); /* stack: string ubox mt */ lua_setmetatable(L, -2); /* stack: string ubox */ lua_rawset(L, LUA_REGISTRYINDEX); lua_pushstring(L, "tolua_super"); lua_newtable(L); lua_rawset(L, LUA_REGISTRYINDEX); lua_pushstring(L, "tolua_gc"); lua_newtable(L); lua_rawset(L, LUA_REGISTRYINDEX); /* create gc_event closure */ lua_pushstring(L, "tolua_gc_event"); lua_pushstring(L, "tolua_gc"); lua_rawget(L, LUA_REGISTRYINDEX); lua_pushstring(L, "tolua_super"); lua_rawget(L, LUA_REGISTRYINDEX); lua_pushcclosure(L, class_gc_event, 2); lua_rawset(L, LUA_REGISTRYINDEX); tolua_newmetatable(L, "tolua_commonclass"); tolua_module(L, NULL, 0); tolua_beginmodule(L, NULL); tolua_module(L, "tolua", 0); tolua_beginmodule(L, "tolua"); tolua_function(L, "type", tolua_bnd_type); tolua_function(L, "takeownership", tolua_bnd_takeownership); tolua_function(L, "releaseownership", tolua_bnd_releaseownership); tolua_function(L, "cast", tolua_bnd_cast); tolua_function(L, "inherit", tolua_bnd_inherit); #ifdef LUA_VERSION_NUM /* lua 5.1 */ tolua_function(L, "setpeer", tolua_bnd_setpeer); tolua_function(L, "getpeer", tolua_bnd_getpeer); #endif tolua_endmodule(L); tolua_endmodule(L); } lua_settop(L, top); } /* Copy a C object */ TOLUA_API void *tolua_copy(lua_State *L, void *value, unsigned int size) { void *clone = (void *)malloc(size); if (clone) memcpy(clone, value, size); else tolua_error(L, "insuficient memory", NULL); return clone; } /* Default collect function */ TOLUA_API int tolua_default_collect(lua_State *tolua_S) { void *self = tolua_tousertype(tolua_S, 1, 0); free(self); return 0; } /* Do clone */ TOLUA_API int tolua_register_gc(lua_State *L, int lo) { int success = 1; void *value = *(void **)lua_touserdata(L, lo); lua_pushstring(L, "tolua_gc"); lua_rawget(L, LUA_REGISTRYINDEX); lua_pushlightuserdata(L, value); lua_rawget(L, -2); if (!lua_isnil(L, -1)) /* make sure that object is not already owned */ success = 0; else { lua_pushlightuserdata(L, value); lua_getmetatable(L, lo); lua_rawset(L, -4); } lua_pop(L, 2); return success; } /* Register a usertype * It creates the correspoding metatable in the registry, for both 'type' and 'const type'. * It maps 'const type' as being also a 'type' */ TOLUA_API void tolua_usertype(lua_State *L, const char *type) { char ctype[128] = "const "; strncat(ctype, type, 120); /* create both metatables */ if (tolua_newmetatable(L, ctype) && tolua_newmetatable(L, type)) mapsuper(L, type, ctype); /* 'type' is also a 'const type' */ } /* Begin module * It pushes the module (or class) table on the stack */ TOLUA_API void tolua_beginmodule(lua_State *L, const char *name) { if (name) { lua_pushstring(L, name); lua_rawget(L, -2); } else #if LUA_VERSION_NUM > 501 lua_pushglobaltable(L); #else lua_pushvalue(L, LUA_GLOBALSINDEX); #endif } /* End module * It pops the module (or class) from the stack */ TOLUA_API void tolua_endmodule(lua_State *L) { lua_pop(L, 1); } /* Map module * It creates a new module */ #if 1 TOLUA_API void tolua_module(lua_State *L, const char *name, int hasvar) { if (name) { /* tolua module */ lua_pushstring(L, name); lua_rawget(L, -2); if (!lua_istable(L, -1)) /* check if module already exists */ { lua_pop(L, 1); lua_newtable(L); lua_pushstring(L, name); lua_pushvalue(L, -2); lua_rawset(L, -4); /* assing module into module */ } } else { /* global table */ #if LUA_VERSION_NUM > 501 lua_pushglobaltable(L); #else lua_pushvalue(L, LUA_GLOBALSINDEX); #endif } if (hasvar) { if (!tolua_ismodulemetatable(L)) /* check if it already has a module metatable */ { /* create metatable to get/set C/C++ variable */ lua_newtable(L); tolua_moduleevents(L); if (lua_getmetatable(L, -2)) lua_setmetatable(L, -2); /* set old metatable as metatable of metatable */ lua_setmetatable(L, -2); } } lua_pop(L, 1); /* pop module */ } #else TOLUA_API void tolua_module(lua_State *L, const char *name, int hasvar) { if (name) { /* tolua module */ lua_pushstring(L, name); lua_newtable(L); } else { /* global table */ #if LUA_VERSION_NUM > 501 lua_pushglobaltable(L); #else lua_pushvalue(L, LUA_GLOBALSINDEX); #endif } if (hasvar) { /* create metatable to get/set C/C++ variable */ lua_newtable(L); tolua_moduleevents(L); if (lua_getmetatable(L, -2)) lua_setmetatable(L, -2); /* set old metatable as metatable of metatable */ lua_setmetatable(L, -2); } if (name) lua_rawset(L, -3); /* assing module into module */ else lua_pop(L, 1); /* pop global table */ } #endif static void push_collector(lua_State *L, const char *type, lua_CFunction col) { /* push collector function, but only if it's not NULL, or if there's no collector already */ if (!col) return; luaL_getmetatable(L, type); lua_pushstring(L, ".collector"); /* if (!col) { lua_pushvalue(L, -1); lua_rawget(L, -3); if (!lua_isnil(L, -1)) { lua_pop(L, 3); return; } lua_pop(L, 1); } // */ lua_pushcfunction(L, col); lua_rawset(L, -3); lua_pop(L, 1); } /* Map C class * It maps a C class, setting the appropriate inheritance and super classes. */ TOLUA_API void tolua_cclass(lua_State *L, const char *lname, const char *name, const char *base, lua_CFunction col) { char cname[128] = "const "; char cbase[128] = "const "; strncat(cname, name, 120); strncat(cbase, base, 120); mapinheritance(L, name, base); mapinheritance(L, cname, name); mapsuper(L, cname, cbase); mapsuper(L, name, base); lua_pushstring(L, lname); push_collector(L, name, col); /* luaL_getmetatable(L,name); lua_pushstring(L,".collector"); lua_pushcfunction(L,col); lua_rawset(L,-3); */ luaL_getmetatable(L, name); lua_rawset(L, -3); /* assign class metatable to module */ /* now we also need to store the collector table for the const instances of the class */ push_collector(L, cname, col); /* luaL_getmetatable(L,cname); lua_pushstring(L,".collector"); lua_pushcfunction(L,col); lua_rawset(L,-3); lua_pop(L,1); */ } /* Add base * It adds additional base classes to a class (for multiple inheritance) * (not for now) TOLUA_API void tolua_addbase(lua_State* L, char* name, char* base) { char cname[128] = "const "; char cbase[128] = "const "; strncat(cname,name,120); strncat(cbase,base,120); mapsuper(L,cname,cbase); mapsuper(L,name,base); } */ /* Map function * It assigns a function into the current module (or class) */ TOLUA_API void tolua_function(lua_State *L, const char *name, lua_CFunction func) { lua_pushstring(L, name); lua_pushcfunction(L, func); lua_rawset(L, -3); } /* sets the __call event for the class (expects the class' main table on top) */ /* never really worked :( TOLUA_API void tolua_set_call_event(lua_State* L, lua_CFunction func, char* type) { lua_getmetatable(L, -1); //luaL_getmetatable(L, type); lua_pushstring(L,"__call"); lua_pushcfunction(L,func); lua_rawset(L,-3); lua_pop(L, 1); } */ /* Map constant number * It assigns a constant number into the current module (or class) */ TOLUA_API void tolua_constant(lua_State *L, const char *name, lua_Number value) { lua_pushstring(L, name); tolua_pushnumber(L, value); lua_rawset(L, -3); } /* Map variable * It assigns a variable into the current module (or class) */ TOLUA_API void tolua_variable(lua_State *L, const char *name, lua_CFunction get, lua_CFunction set) { /* get func */ lua_pushstring(L, ".get"); lua_rawget(L, -2); if (!lua_istable(L, -1)) { /* create .get table, leaving it at the top */ lua_pop(L, 1); lua_newtable(L); lua_pushstring(L, ".get"); lua_pushvalue(L, -2); lua_rawset(L, -4); } lua_pushstring(L, name); lua_pushcfunction(L, get); lua_rawset(L, -3); /* store variable */ lua_pop(L, 1); /* pop .get table */ /* set func */ if (set) { lua_pushstring(L, ".set"); lua_rawget(L, -2); if (!lua_istable(L, -1)) { /* create .set table, leaving it at the top */ lua_pop(L, 1); lua_newtable(L); lua_pushstring(L, ".set"); lua_pushvalue(L, -2); lua_rawset(L, -4); } lua_pushstring(L, name); lua_pushcfunction(L, set); lua_rawset(L, -3); /* store variable */ lua_pop(L, 1); /* pop .set table */ } } /* Access const array * It reports an error when trying to write into a const array */ static int const_array(lua_State *L) { luaL_error(L, "value of const array cannot be changed"); return 0; } /* Map an array * It assigns an array into the current module (or class) */ TOLUA_API void tolua_array(lua_State *L, const char *name, lua_CFunction get, lua_CFunction set) { lua_pushstring(L, ".get"); lua_rawget(L, -2); if (!lua_istable(L, -1)) { /* create .get table, leaving it at the top */ lua_pop(L, 1); lua_newtable(L); lua_pushstring(L, ".get"); lua_pushvalue(L, -2); lua_rawset(L, -4); } lua_pushstring(L, name); lua_newtable(L); /* create array metatable */ lua_pushvalue(L, -1); lua_setmetatable(L, -2); /* set the own table as metatable (for modules) */ lua_pushstring(L, "__index"); lua_pushcfunction(L, get); lua_rawset(L, -3); lua_pushstring(L, "__newindex"); lua_pushcfunction(L, set ? set : const_array); lua_rawset(L, -3); lua_rawset(L, -3); /* store variable */ lua_pop(L, 1); /* pop .get table */ } TOLUA_API void tolua_dobuffer(lua_State *L, char *B, unsigned int size, const char *name) { #ifdef LUA_VERSION_NUM /* lua 5.1 */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-value" luaL_loadbuffer(L, B, size, name) || lua_pcall(L, 0, 0, 0); #pragma GCC diagnostic pop #else lua_dobuffer(L, B, size, name); #endif } conky-1.12.2/3rdparty/toluapp/src/lib/tolua_push.c000066400000000000000000000115041404127277500220520ustar00rootroot00000000000000/* tolua: functions to push C values. ** Support code for Lua bindings. ** Written by Waldemar Celes ** TeCGraf/PUC-Rio ** Apr 2003 ** $Id: $ */ /* This code is free software; you can redistribute it and/or modify it. ** The software provided hereunder is on an "as is" basis, and ** the author has no obligation to provide maintenance, support, updates, ** enhancements, or modifications. */ #include "tolua++.h" #include "lauxlib.h" #include TOLUA_API void tolua_pushvalue (lua_State* L, int lo) { lua_pushvalue(L,lo); } TOLUA_API void tolua_pushboolean (lua_State* L, int value) { lua_pushboolean(L,value); } TOLUA_API void tolua_pushnumber (lua_State* L, lua_Number value) { lua_pushnumber(L,value); } TOLUA_API void tolua_pushstring (lua_State* L, const char* value) { if (value == NULL) lua_pushnil(L); else lua_pushstring(L,value); } TOLUA_API void tolua_pushuserdata (lua_State* L, void* value) { if (value == NULL) lua_pushnil(L); else lua_pushlightuserdata(L,value); } TOLUA_API void tolua_pushusertype (lua_State* L, void* value, const char* type) { if (value == NULL) lua_pushnil(L); else { luaL_getmetatable(L, type); lua_pushstring(L,"tolua_ubox"); lua_rawget(L,-2); /* stack: mt ubox */ if (lua_isnil(L, -1)) { lua_pop(L, 1); lua_pushstring(L, "tolua_ubox"); lua_rawget(L, LUA_REGISTRYINDEX); }; lua_pushlightuserdata(L,value); lua_rawget(L,-2); /* stack: mt ubox ubox[u] */ if (lua_isnil(L,-1)) { lua_pop(L,1); /* stack: mt ubox */ lua_pushlightuserdata(L,value); *(void**)lua_newuserdata(L,sizeof(void *)) = value; /* stack: mt ubox u newud */ lua_pushvalue(L,-1); /* stack: mt ubox u newud newud */ lua_insert(L,-4); /* stack: mt newud ubox u newud */ lua_rawset(L,-3); /* stack: mt newud ubox */ lua_pop(L,1); /* stack: mt newud */ /*luaL_getmetatable(L,type);*/ lua_pushvalue(L, -2); /* stack: mt newud mt */ lua_setmetatable(L,-2); /* stack: mt newud */ #ifdef LUA_VERSION_NUM lua_pushvalue(L, TOLUA_NOPEER); #if LUA_VERSION_NUM > 501 lua_setuservalue(L, -2); #else lua_setfenv(L, -2); #endif #endif } else { /* check the need of updating the metatable to a more specialized class */ lua_insert(L,-2); /* stack: mt ubox[u] ubox */ lua_pop(L,1); /* stack: mt ubox[u] */ lua_pushstring(L,"tolua_super"); lua_rawget(L,LUA_REGISTRYINDEX); /* stack: mt ubox[u] super */ lua_getmetatable(L,-2); /* stack: mt ubox[u] super mt */ lua_rawget(L,-2); /* stack: mt ubox[u] super super[mt] */ if (lua_istable(L,-1)) { lua_pushstring(L,type); /* stack: mt ubox[u] super super[mt] type */ lua_rawget(L,-2); /* stack: mt ubox[u] super super[mt] flag */ if (lua_toboolean(L,-1) == 1) /* if true */ { lua_pop(L,3); /* mt ubox[u]*/ lua_remove(L, -2); return; } } /* type represents a more specilized type */ /*luaL_getmetatable(L,type); // stack: mt ubox[u] super super[mt] flag mt */ lua_pushvalue(L, -5); /* stack: mt ubox[u] super super[mt] flag mt */ lua_setmetatable(L,-5); /* stack: mt ubox[u] super super[mt] flag */ lua_pop(L,3); /* stack: mt ubox[u] */ } lua_remove(L, -2); /* stack: ubox[u]*/ } } TOLUA_API void tolua_pushusertype_and_takeownership (lua_State* L, void* value, const char* type) { tolua_pushusertype(L,value,type); tolua_register_gc(L,lua_gettop(L)); } TOLUA_API void tolua_pushfieldvalue (lua_State* L, int lo, int index, int v) { lua_pushnumber(L,index); lua_pushvalue(L,v); lua_settable(L,lo); } TOLUA_API void tolua_pushfieldboolean (lua_State* L, int lo, int index, int v) { lua_pushnumber(L,index); lua_pushboolean(L,v); lua_settable(L,lo); } TOLUA_API void tolua_pushfieldnumber (lua_State* L, int lo, int index, lua_Number v) { lua_pushnumber(L,index); tolua_pushnumber(L,v); lua_settable(L,lo); } TOLUA_API void tolua_pushfieldstring (lua_State* L, int lo, int index, const char* v) { lua_pushnumber(L,index); tolua_pushstring(L,v); lua_settable(L,lo); } TOLUA_API void tolua_pushfielduserdata (lua_State* L, int lo, int index, void* v) { lua_pushnumber(L,index); tolua_pushuserdata(L,v); lua_settable(L,lo); } TOLUA_API void tolua_pushfieldusertype (lua_State* L, int lo, int index, void* v, const char* type) { lua_pushnumber(L,index); tolua_pushusertype(L,v,type); lua_settable(L,lo); } TOLUA_API void tolua_pushfieldusertype_and_takeownership (lua_State* L, int lo, int index, void* v, const char* type) { lua_pushnumber(L,index); tolua_pushusertype(L,v,type); tolua_register_gc(L,lua_gettop(L)); lua_settable(L,lo); } conky-1.12.2/3rdparty/toluapp/src/lib/tolua_to.c000066400000000000000000000060471404127277500215230ustar00rootroot00000000000000/* tolua: funcitons to convert to C types ** Support code for Lua bindings. ** Written by Waldemar Celes ** TeCGraf/PUC-Rio ** Apr 2003 ** $Id: $ */ /* This code is free software; you can redistribute it and/or modify it. ** The software provided hereunder is on an "as is" basis, and ** the author has no obligation to provide maintenance, support, updates, ** enhancements, or modifications. */ #include "tolua++.h" #include #include TOLUA_API lua_Number tolua_tonumber(lua_State *L, int narg, lua_Number def) { return lua_gettop(L) < abs(narg) ? def : lua_tonumber(L, narg); } TOLUA_API const char *tolua_tostring(lua_State *L, int narg, const char *def) { return lua_gettop(L) < abs(narg) ? def : lua_tostring(L, narg); } TOLUA_API void *tolua_touserdata(lua_State *L, int narg, void *def) { /* return lua_gettop(L)x); return 1; } /* set function: x of class Point */ static int tolua_set_Point_x(lua_State* tolua_S) { Point* self = (Point*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'x'",NULL); if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif self->x = ((float) tolua_tonumber(tolua_S,2,0)); return 0; } /* get function: y of class Point */ static int tolua_get_Point_y(lua_State* tolua_S) { Point* self = (Point*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'y'",NULL); #endif tolua_pushnumber(tolua_S,(double)self->y); return 1; } /* set function: y of class Point */ static int tolua_set_Point_y(lua_State* tolua_S) { Point* self = (Point*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'y'",NULL); if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif self->y = ((float) tolua_tonumber(tolua_S,2,0)); return 0; } /* get function: a */ static int tolua_get_tarray_a(lua_State* tolua_S) { int tolua_index; #ifndef TOLUA_RELEASE { tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); } #endif tolua_index = (int)tolua_tonumber(tolua_S,2,0)-1; #ifndef TOLUA_RELEASE if (tolua_index<0 || tolua_index>=10) tolua_error(tolua_S,"array indexing out of range.",NULL); #endif tolua_pushnumber(tolua_S,(double)a[tolua_index]); return 1; } /* set function: a */ static int tolua_set_tarray_a(lua_State* tolua_S) { int tolua_index; #ifndef TOLUA_RELEASE { tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); } #endif tolua_index = (int)tolua_tonumber(tolua_S,2,0)-1; #ifndef TOLUA_RELEASE if (tolua_index<0 || tolua_index>=10) tolua_error(tolua_S,"array indexing out of range.",NULL); #endif a[tolua_index] = ((int) tolua_tonumber(tolua_S,3,0)); return 0; } /* get function: p */ static int tolua_get_tarray_p(lua_State* tolua_S) { int tolua_index; #ifndef TOLUA_RELEASE { tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); } #endif tolua_index = (int)tolua_tonumber(tolua_S,2,0)-1; #ifndef TOLUA_RELEASE if (tolua_index<0 || tolua_index>=10) tolua_error(tolua_S,"array indexing out of range.",NULL); #endif tolua_pushusertype(tolua_S,(void*)&p[tolua_index],"const Point"); return 1; } /* get function: pp */ static int tolua_get_tarray_pp(lua_State* tolua_S) { int tolua_index; #ifndef TOLUA_RELEASE { tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); } #endif tolua_index = (int)tolua_tonumber(tolua_S,2,0)-1; #ifndef TOLUA_RELEASE if (tolua_index<0 || tolua_index>=10) tolua_error(tolua_S,"array indexing out of range.",NULL); #endif tolua_pushusertype(tolua_S,(void*)pp[tolua_index],"Point"); return 1; } /* set function: pp */ static int tolua_set_tarray_pp(lua_State* tolua_S) { int tolua_index; #ifndef TOLUA_RELEASE { tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); } #endif tolua_index = (int)tolua_tonumber(tolua_S,2,0)-1; #ifndef TOLUA_RELEASE if (tolua_index<0 || tolua_index>=10) tolua_error(tolua_S,"array indexing out of range.",NULL); #endif pp[tolua_index] = ((Point*) tolua_tousertype(tolua_S,3,0)); return 0; } /* get function: ma */ static int tolua_get_tarray_M_ma(lua_State* tolua_S) { int tolua_index; #ifndef TOLUA_RELEASE { tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); } #endif tolua_index = (int)tolua_tonumber(tolua_S,2,0)-1; #ifndef TOLUA_RELEASE if (tolua_index<0 || tolua_index>=10) tolua_error(tolua_S,"array indexing out of range.",NULL); #endif tolua_pushnumber(tolua_S,(double)ma[tolua_index]); return 1; } /* set function: ma */ static int tolua_set_tarray_M_ma(lua_State* tolua_S) { int tolua_index; #ifndef TOLUA_RELEASE { tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); } #endif tolua_index = (int)tolua_tonumber(tolua_S,2,0)-1; #ifndef TOLUA_RELEASE if (tolua_index<0 || tolua_index>=10) tolua_error(tolua_S,"array indexing out of range.",NULL); #endif ma[tolua_index] = ((int) tolua_tonumber(tolua_S,3,0)); return 0; } /* get function: mp */ static int tolua_get_tarray_M_mp(lua_State* tolua_S) { int tolua_index; #ifndef TOLUA_RELEASE { tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); } #endif tolua_index = (int)tolua_tonumber(tolua_S,2,0)-1; #ifndef TOLUA_RELEASE if (tolua_index<0 || tolua_index>=10) tolua_error(tolua_S,"array indexing out of range.",NULL); #endif tolua_pushusertype(tolua_S,(void*)&mp[tolua_index],"const Point"); return 1; } /* get function: mpp */ static int tolua_get_tarray_M_mpp(lua_State* tolua_S) { int tolua_index; #ifndef TOLUA_RELEASE { tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); } #endif tolua_index = (int)tolua_tonumber(tolua_S,2,0)-1; #ifndef TOLUA_RELEASE if (tolua_index<0 || tolua_index>=10) tolua_error(tolua_S,"array indexing out of range.",NULL); #endif tolua_pushusertype(tolua_S,(void*)mpp[tolua_index],"Point"); return 1; } /* set function: mpp */ static int tolua_set_tarray_M_mpp(lua_State* tolua_S) { int tolua_index; #ifndef TOLUA_RELEASE { tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); } #endif tolua_index = (int)tolua_tonumber(tolua_S,2,0)-1; #ifndef TOLUA_RELEASE if (tolua_index<0 || tolua_index>=10) tolua_error(tolua_S,"array indexing out of range.",NULL); #endif mpp[tolua_index] = ((Point*) tolua_tousertype(tolua_S,3,0)); return 0; } /* get function: a of class Array */ static int tolua_get_tarray_Array_a(lua_State* tolua_S) { int tolua_index; Array* self; lua_pushstring(tolua_S,".self"); lua_rawget(tolua_S,1); self = (Array*) lua_touserdata(tolua_S,-1); #ifndef TOLUA_RELEASE { tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); } #endif tolua_index = (int)tolua_tonumber(tolua_S,2,0)-1; #ifndef TOLUA_RELEASE if (tolua_index<0 || tolua_index>=10) tolua_error(tolua_S,"array indexing out of range.",NULL); #endif tolua_pushnumber(tolua_S,(double)self->a[tolua_index]); return 1; } /* set function: a of class Array */ static int tolua_set_tarray_Array_a(lua_State* tolua_S) { int tolua_index; Array* self; lua_pushstring(tolua_S,".self"); lua_rawget(tolua_S,1); self = (Array*) lua_touserdata(tolua_S,-1); #ifndef TOLUA_RELEASE { tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); } #endif tolua_index = (int)tolua_tonumber(tolua_S,2,0)-1; #ifndef TOLUA_RELEASE if (tolua_index<0 || tolua_index>=10) tolua_error(tolua_S,"array indexing out of range.",NULL); #endif self->a[tolua_index] = ((int) tolua_tonumber(tolua_S,3,0)); return 0; } /* get function: p of class Array */ static int tolua_get_tarray_Array_p(lua_State* tolua_S) { int tolua_index; Array* self; lua_pushstring(tolua_S,".self"); lua_rawget(tolua_S,1); self = (Array*) lua_touserdata(tolua_S,-1); #ifndef TOLUA_RELEASE { tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); } #endif tolua_index = (int)tolua_tonumber(tolua_S,2,0)-1; #ifndef TOLUA_RELEASE if (tolua_index<0 || tolua_index>=10) tolua_error(tolua_S,"array indexing out of range.",NULL); #endif tolua_pushusertype(tolua_S,(void*)&self->p[tolua_index],"Point"); return 1; } /* set function: p of class Array */ static int tolua_set_tarray_Array_p(lua_State* tolua_S) { int tolua_index; Array* self; lua_pushstring(tolua_S,".self"); lua_rawget(tolua_S,1); self = (Array*) lua_touserdata(tolua_S,-1); #ifndef TOLUA_RELEASE { tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); } #endif tolua_index = (int)tolua_tonumber(tolua_S,2,0)-1; #ifndef TOLUA_RELEASE if (tolua_index<0 || tolua_index>=10) tolua_error(tolua_S,"array indexing out of range.",NULL); #endif self->p[tolua_index] = *((Point*) tolua_tousertype(tolua_S,3,0)); return 0; } /* get function: pp of class Array */ static int tolua_get_tarray_Array_pp(lua_State* tolua_S) { int tolua_index; Array* self; lua_pushstring(tolua_S,".self"); lua_rawget(tolua_S,1); self = (Array*) lua_touserdata(tolua_S,-1); #ifndef TOLUA_RELEASE { tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); } #endif tolua_index = (int)tolua_tonumber(tolua_S,2,0)-1; #ifndef TOLUA_RELEASE if (tolua_index<0 || tolua_index>=10) tolua_error(tolua_S,"array indexing out of range.",NULL); #endif tolua_pushusertype(tolua_S,(void*)self->pp[tolua_index],"Point"); return 1; } /* set function: pp of class Array */ static int tolua_set_tarray_Array_pp(lua_State* tolua_S) { int tolua_index; Array* self; lua_pushstring(tolua_S,".self"); lua_rawget(tolua_S,1); self = (Array*) lua_touserdata(tolua_S,-1); #ifndef TOLUA_RELEASE { tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in array indexing.",&tolua_err); } #endif tolua_index = (int)tolua_tonumber(tolua_S,2,0)-1; #ifndef TOLUA_RELEASE if (tolua_index<0 || tolua_index>=10) tolua_error(tolua_S,"array indexing out of range.",NULL); #endif self->pp[tolua_index] = ((Point*) tolua_tousertype(tolua_S,3,0)); return 0; } /* get function: array */ static int tolua_get_array(lua_State* tolua_S) { tolua_pushusertype(tolua_S,(void*)&array,"Array"); return 1; } /* set function: array */ static int tolua_set_array(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isusertype(tolua_S,2,"Array",0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif array = *((Array*) tolua_tousertype(tolua_S,2,0)); return 0; } /* get function: parray */ static int tolua_get_parray_ptr(lua_State* tolua_S) { tolua_pushusertype(tolua_S,(void*)parray,"Array"); return 1; } /* set function: parray */ static int tolua_set_parray_ptr(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isusertype(tolua_S,2,"Array",0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif parray = ((Array*) tolua_tousertype(tolua_S,2,0)); return 0; } /* Open function */ TOLUA_API int tolua_tarray_open (lua_State* tolua_S) { tolua_open(tolua_S); tolua_reg_types(tolua_S); tolua_module(tolua_S,NULL,1); tolua_beginmodule(tolua_S,NULL); #ifdef __cplusplus tolua_cclass(tolua_S,"Point","Point","",tolua_collect_Point); #else tolua_cclass(tolua_S,"Point","Point","",NULL); #endif tolua_beginmodule(tolua_S,"Point"); tolua_variable(tolua_S,"x",tolua_get_Point_x,tolua_set_Point_x); tolua_variable(tolua_S,"y",tolua_get_Point_y,tolua_set_Point_y); tolua_endmodule(tolua_S); tolua_array(tolua_S,"a",tolua_get_tarray_a,tolua_set_tarray_a); tolua_array(tolua_S,"p",tolua_get_tarray_p,NULL); tolua_array(tolua_S,"pp",tolua_get_tarray_pp,tolua_set_tarray_pp); tolua_module(tolua_S,"M",1); tolua_beginmodule(tolua_S,"M"); tolua_array(tolua_S,"a",tolua_get_tarray_M_ma,tolua_set_tarray_M_ma); tolua_array(tolua_S,"p",tolua_get_tarray_M_mp,NULL); tolua_array(tolua_S,"pp",tolua_get_tarray_M_mpp,tolua_set_tarray_M_mpp); tolua_endmodule(tolua_S); tolua_cclass(tolua_S,"Array","Array","",NULL); tolua_beginmodule(tolua_S,"Array"); tolua_array(tolua_S,"a",tolua_get_tarray_Array_a,tolua_set_tarray_Array_a); tolua_array(tolua_S,"p",tolua_get_tarray_Array_p,tolua_set_tarray_Array_p); tolua_array(tolua_S,"pp",tolua_get_tarray_Array_pp,tolua_set_tarray_Array_pp); tolua_endmodule(tolua_S); tolua_variable(tolua_S,"array",tolua_get_array,tolua_set_array); tolua_variable(tolua_S,"parray",tolua_get_parray_ptr,tolua_set_parray_ptr); tolua_endmodule(tolua_S); return 1; } conky-1.12.2/3rdparty/toluapp/src/tests/tclass.cpp000066400000000000000000000007421404127277500221160ustar00rootroot00000000000000extern "C" { #include "lua.h" #include "lualib.h" #include "lauxlib.h" } #include "tclass.h" //Test::Tst_A* Test::Tst_A::last; //Test::Tst_B* Test::Tst_B::last; //Test::Tst_C* Test::Tst_C::last; extern "C" { int tolua_tclass_open (lua_State*); } int main () { Test::Tst_B* b = new Test::Tst_B; // instance used in Lua code lua_State* L = lua_open(); luaL_openlibs(L); tolua_tclass_open(L); luaL_dofile(L,"tclass.lua"); lua_close(L); delete b; return 0; } conky-1.12.2/3rdparty/toluapp/src/tests/tclass.h000066400000000000000000000034071404127277500215640ustar00rootroot00000000000000#ifndef TCLASS_H #define TCLASS_H #include namespace Test { class Tst_Dummy { }; class Tst_A { int number; public: static Tst_A* last; Tst_A () {last = this;} virtual char* a () { return "A"; } class Tst_AA { public: Tst_AA () {} ~Tst_AA () { } char* aa () { return "AA"; } }; class Tst_BB : public Tst_AA { public: Tst_BB () {} ~Tst_BB () {} Tst_AA* Base () { return this; } }; void set_number(int p_number) { number = p_number;}; int get_number() {return number*2;}; virtual ~Tst_A() {}; }; class Tst_B : public Tst_A { public: static Tst_B* last; Tst_B () {last = this;} virtual char* b () { return "B"; } static Tst_A* create() {return new Tst_B;}; static void* create_void() {return new Tst_B;}; virtual ~Tst_B() {}; }; class Tst_C : public Tst_B { int i; public: static Tst_C* last; Tst_C (int n) : i(n) {last = this;} virtual ~Tst_C () { printf("deleting C: %d\n",i); } virtual char* c () { return "C"; } }; inline Tst_A::Tst_AA* Tst_create_aa () { return new Tst_A::Tst_AA(); } inline bool Tst_is_aa (Tst_A::Tst_AA* obj) { return true; } class Tst_E { void* ptr; public: enum Pete { ONE, TWO, } pete; void get_pete(Pete p) {}; template T get_t() {T a=0; return a;}; Tst_E& operator+(const Tst_E& rvalue) {return *this;}; void pars(int a=0, int b=0) {}; void get_pointer(void* a) {}; Tst_A a; void set_ptr(void* p_ptr) { printf("this is %p, ptr is %p\n", this, p_ptr); ptr = p_ptr; }; void* get_ptr() {return ptr;}; Tst_E(int) {}; }; class Tst_Outside { public: Tst_Outside() {}; }; }; // end of namespace static void outside_func(Test::Tst_Outside* p_out, lua_State* ls) { if (p_out) printf("method!\n"); else printf("static!\n"); //printf("luastate: %i\n", ls); }; #endif conky-1.12.2/3rdparty/toluapp/src/tests/tclass.lua000066400000000000000000000052141404127277500221140ustar00rootroot00000000000000if not Test then local loadlib if not package then loadlib = _G['loadlib'] else loadlib = package.loadlib end f, e, eo = loadlib("./libtclass.so", "luaopen_tclass") if f then f() else print(eo, e) os.exit() end end a = {} rawset(a, ".c_instance", "something") function hello() print("hello world") end rawset(Test.B, "hello", hello) -- type convertion tests --print(Test.A) --print(tolua.type(Test.A.last)) --assert(tolua.type(Test.A.last) == 'Test::Tst_A') -- first time the object is mapped --assert(tolua.type(Test.B.last) == 'Test::Tst_B') -- type convertion to specialized type --assert(tolua.type(Test.A.last) == 'Test::Tst_B') -- no convertion: obj already mapped as B local a = Test.A:new() assert(tolua.type(Test.A.last) == 'Test::Tst_A') -- no type convertion: same type local b = Test.B:new() assert(tolua.type(Test.A.last) == 'Test::Tst_B') -- no convertion: obj already mapped as B local c = Test.luaC:new(0) assert(tolua.type(Test.A.last) == 'Test::Tst_C') -- no convertion: obj already mapped as C assert(tolua.type(Test.luaC.last) == 'Test::Tst_C') local aa = Test.A.AA:new() local bb = Test.A.BB:new() local xx = Test.create_aa() -- method calling tests assert(a:a() == 'A') assert(b:a() == 'A') assert(b:b() == 'B') assert(c:a() == 'A') assert(c:b() == 'B') assert(c:c() == 'C') assert(aa:aa() == 'AA') assert(bb:aa() == bb:Base():aa()) assert(xx:aa() == 'AA') assert(Test.is_aa(bb) == true) -- test ownershipping handling -- should delete objects: 6 7 8 9 10 (it may vary!) local set = {} for i=1,10 do local c = Test.luaC:new(i) if i>5 then tolua.takeownership(c) end --set[i] = c end e = Test.B:new_local() print("e is type "..tolua.type(e)) print("ae is type "..tolua.type(ae)) --e:delete() b:hello() ---------- local out = Test.Outside:new_local() out:outside() Test.Outside:outside_static(nil) print "***** cast" local acast = Test.B:create_void() print("type is "..tolua.type(acast)) local bcast = tolua.cast(acast, "Test::Tst_B") print("bcast is "..tostring(bcast)) print("type is "..tolua.type(bcast)) print(bcast:b()) -- test properies local n = 7 a.number = n assert(a.number == n*2) -- constructors print(getmetatable(Test.A)) print(getmetatable(Test.B)) print(getmetatable(Test.E)) local a = Test.A() local b = Test.B() local e = Test.E(5) --print(e+5) print(tostring(getmetatable(Test.B).__call)) print(tostring(Test.B.__call)) print(tostring(Test.B.__call(Test.B))) print(tolua.type(b)) e:set_ptr(e) local ve = tolua.cast(e:get_ptr(), "Test::Tst_E") ve:set_ptr(ve) print"1" Test.A.pete = {} print"2" table.insert(Test.A.pete, a) print"3" for i=1,100000 do la = {} tolua.inherit(la, a) end print("Class test OK") conky-1.12.2/3rdparty/toluapp/src/tests/tclass.pkg000066400000000000000000000026551404127277500221220ustar00rootroot00000000000000$#include "tclass.h" $Test::Tst_A* Test::Tst_A::last; $Test::Tst_B* Test::Tst_B::last; $Test::Tst_C* Test::Tst_C::last; $renaming ^Tst_ @ namespace Test { class Tst_Dummy; class Tst_A { static Tst_A* last; Tst_A (); virtual char* a (); class Tst_AA { Tst_AA () {} ~Tst_AA () {} char* aa () { return "AA"; } }; class Tst_BB : public Tst_AA { Tst_BB () {} ~Tst_BB () {} Tst_AA* Base () { return this; } }; tolua_property int number; }; class Tst_E { public: typedef enum{ ONE, TWO, } Pete; Pete pete; float get_t(); void get_pete(Pete p); Tst_E& operator+(const Tst_E& rvalue); void pars(int a=0xa, int b=GetNumber(GetNumber(1,2))); void get_pointer(void* a=NULL); void set_ptr(void* p_ptr) { printf("this is %p, ptr is %p\n", this, p_ptr); ptr = p_ptr; }; void* get_ptr() {return ptr;}; Tst_A a; Tst_E(int); //~Tst_E(); }; class Tst_B : public Tst_A { static Tst_B* last; Tst_B (); virtual char* b (); static Tst_A* create(); static void* create_void() {return new Tst_B;}; }; class Tst_C@luaC : public Tst_B { static Tst_C* last; Tst_C (int n); ~Tst_C (); virtual char* c (); }; Tst_A::Tst_AA* Tst_create_aa (); bool Tst_is_aa (Tst_A::Tst_AA* obj); class Tst_Outside { tolua_outside void outside_func@outside(lua_State* ls); static tolua_outside void outside_func@outside_static(Tst_Outside* instance, lua_State* ls); Tst_Outside() {}; }; }; // end of namespace conky-1.12.2/3rdparty/toluapp/src/tests/tconstant.h000066400000000000000000000003451404127277500223060ustar00rootroot00000000000000#define FIRST 1 #define SECOND 2 enum { ONE = 1, TWO = 2 }; #define M_FIRST 1 #define M_SECOND 2 enum { M_ONE = 1, M_TWO = 2 }; class A { public: #define FIRST 1 #define SECOND 2 enum { ONE = 1, TWO = 2 }; }; conky-1.12.2/3rdparty/toluapp/src/tests/tconstant.lua000066400000000000000000000003101404127277500226300ustar00rootroot00000000000000assert(FIRST==M.FIRST) assert(FIRST==A.FIRST) assert(SECOND==M.SECOND) assert(SECOND==A.SECOND) assert(ONE==M.ONE) assert(ONE==A.ONE) assert(TWO==M.TWO) assert(TWO==A.TWO) print("Constant test OK") conky-1.12.2/3rdparty/toluapp/src/tests/tconstant.pkg000066400000000000000000000004411404127277500226350ustar00rootroot00000000000000$#include "tconstant.h" #define FIRST 1 #define SECOND 2 enum { ONE = 1, TWO = 2 }; module M { #define M_FIRST@FIRST 1 #define M_SECOND@SECOND 2 enum { M_ONE@ONE = 1, M_TWO@TWO = 2 }; } class A { public: #define FIRST 1 #define SECOND 2 enum { ONE = 1, TWO = 2 }; }; conky-1.12.2/3rdparty/toluapp/src/tests/tdirective.lua000066400000000000000000000001111404127277500227540ustar00rootroot00000000000000assert(a==3) assert(A==4) assert(func()==5) print("Directive test OK") conky-1.12.2/3rdparty/toluapp/src/tests/tdirective.pkg000066400000000000000000000004731404127277500227670ustar00rootroot00000000000000$#include "lualib.h" $#include "lauxlib.h" $int a; $extern int a; $int main (void) ${ $ lua_State* L = lua_open(); $ luaopen_base(L); $ tolua_tdirective_open(L); $ lua_dofile(L,"tdirective.lua"); $ lua_close(L); $ return 0; $} $pfile "tdirectivepkg.pkg" $< a = 3; $> $[ A = 4 $] $lfile "tdirectivelua.lua" conky-1.12.2/3rdparty/toluapp/src/tests/tdirectivebind.c000066400000000000000000000035301404127277500232620ustar00rootroot00000000000000/* ** Lua binding: tdirective ** Generated automatically by tolua 5.0a-CDLVS2 on 08/08/03 17:06:24. */ #ifndef __cplusplus #include "stdlib.h" #endif #include "string.h" #include "tolua.h" /* Exported function */ TOLUA_API int tolua_tdirective_open (lua_State* tolua_S); #include "lualib.h" #include "lauxlib.h" int a; extern int a; int main (void) { lua_State* L = lua_open(); luaopen_base(L); tolua_tdirective_open(L); lua_dofile(L,"tdirective.lua"); lua_close(L); return 0; } /* function to register type */ static void tolua_reg_types (lua_State* tolua_S) { } /* get function: a */ static int tolua_get_a(lua_State* tolua_S) { tolua_pushnumber(tolua_S,(double)a); return 1; } /* set function: a */ static int tolua_set_a(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif a = ((int) tolua_tonumber(tolua_S,2,0)); return 0; } /* Open function */ TOLUA_API int tolua_tdirective_open (lua_State* tolua_S) { tolua_open(tolua_S); tolua_reg_types(tolua_S); tolua_module(tolua_S,NULL,1); tolua_beginmodule(tolua_S,NULL); tolua_variable(tolua_S,"a",tolua_get_a,tolua_set_a); { a = 3; } { /* begin embedded lua code */ static unsigned char B[] = { 10, 65, 32, 61, 32, 52,32 }; lua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code"); } /* end of embedded lua code */ { /* begin embedded lua code */ static unsigned char B[] = { 10,102,117,110, 99,116,105,111,110, 32,102,117,110, 99, 32, 40, 41, 10,114,101,116,117,114,110, 32, 53, 10,101,110,100, 32 }; lua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code"); } /* end of embedded lua code */ tolua_endmodule(tolua_S); return 1; } conky-1.12.2/3rdparty/toluapp/src/tests/tdirectivelua.lua000066400000000000000000000000371404127277500234650ustar00rootroot00000000000000function func () return 5 end conky-1.12.2/3rdparty/toluapp/src/tests/tdirectivepkg.pkg000066400000000000000000000000171404127277500234630ustar00rootroot00000000000000extern int a; conky-1.12.2/3rdparty/toluapp/src/tests/tfunction.h000066400000000000000000000062171404127277500223060ustar00rootroot00000000000000#ifndef tfunction_h #define tfunction_h #include #include typedef enum { FIRST = 1, SECOND = 2 } Order; class Point { char m_s[64]; float m_x; float m_y; public: enum Error { SUCCESS = 0, ERROR = 1 }; Point (float x=0, float y=0) : m_x(x), m_y(y) { } virtual ~Point () { } void set (float x, float y) { m_x = x, m_y = y; } void set (float v[2]=0) { m_x = v[0], m_y=v[1]; } void setpointer (Point* p) { *this = *p; } void setref (Point& p) { *this = p; } void setvalue (Point p) { *this = p; } void setconst (const Point* p) { *this = *p; } void setname (const char* s) { strncpy(m_s,s,63); } void get (float* x, float* y) const { *x = m_x, *y = m_y; } void get (float v[2]) const { v[0] = m_x, v[1] = m_y; } Point* getpointer () { return this; } Point& getref () { return *this; } Point getvalue () { return *this; } const Point* getconst () const { return this; } const char* getname () const { return m_s; } Point operator+ (const Point& p) const { return Point(m_x+p.m_x,m_y+p.m_y); } Point operator- (const Point& p) const { return Point(m_x-p.m_x,m_y-p.m_y); } Point operator* (const Point& p) const { return Point(m_x*p.m_x,m_y*p.m_y); } Point operator/ (float n) const { return Point(m_x/n,m_y/n); } bool operator< (const Point& p) const { if (m_x < p.m_x) return true; else if (m_x > p.m_x) return false; else return m_y < p.m_y; } bool operator<= (const Point& p) const { return operator<(p) || operator==(p); } bool operator== (const Point& p) const { return m_x==p.m_x && m_y==p.m_y; } float operator[] (int i) const { return (i==0) ? m_x : m_y; } float& operator[] (int i) { return (i==0) ? m_x : m_y; } static Error echo (Error e) { return e; } }; inline Point add (const Point& p1, const Point& p2) { return p1+p2; } inline Point sub (const Point& p1, const Point& p2) { return p1-p2; } inline Point mult (const Point& p1, const Point& p2) { return p1*p2; } inline Point div (const Point& p1, float n) { return p1/n; } inline void getpoint (const Point* p, float* x, float* y) { p->get(x,y); } inline void setpoint (Point* p, float x=0, float y=0) { p->set(x,y); } inline Point average (int n, Point v[]) { Point p(0,0); for (int i=0; iq) assert(t>=q) local p = Point:new(1,2) assert(p[1]==1 and p[2]==2) p[1]=3; p[2] = p[2]+2 local x, y = p:get() assert(x==3 and y==4) local n = 3 local v = {Point:new(0,1), Point:new(2,3), Point:new(4,5)} local m = average(n,v) local c = averagepointer(n,v) local t = {} copyvector(n,v,t) local l = Point:new() for i=1,n do assert(v[i]==t[i]) l[1] = l[1] + v[i][1] l[2] = l[2] + v[i][2] end l = l/n assert(m==l) assert(c==l) assert(Point.SUCCESS==Point:echo(Point.SUCCESS)) assert(Point.ERROR==Point:echo(Point.ERROR)) assert(FIRST==invert(SECOND)) assert(SECOND==invert(FIRST)) print("Function test OK") conky-1.12.2/3rdparty/toluapp/src/tests/tfunction.pkg000066400000000000000000000033221404127277500226320ustar00rootroot00000000000000$#include "tfunction.h" typedef enum { FIRST = 1, SECOND = 2 } Order; class Point { enum Error { SUCCESS = 0, ERROR = 1 }; Point (float x=0, float y=0); virtual ~Point (); void set (float x, float y); void set (float v[2]=0); void setpointer (Point* p); void setref (Point& p); void setvalue (Point p); void setconst (const Point* p); void setname (const char* s); void get (float* x=0, float* y=0) const; void get (float v[2]=0) const; Point* getpointer (); Point& getref (); Point getvalue (); const Point* getconst () const; const char* getname () const; Point operator+ (const Point& p) const; Point operator- (const Point& p) const; Point operator* (const Point& p) const; Point operator/ (float n) const; bool operator< (const Point& p) const; bool operator<= (const Point& p) const; bool operator== (const Point& p) const; float operator[] (int i) const; float& operator[] (int i); static Error echo (Error e); }; module alg { Point add (const Point& p1, const Point& p2); Point sub (const Point& p1, const Point& p2); Point mult (const Point& p1, const Point& p2); Point div (const Point& p1, float n); } void getpoint (const Point* p, float* x=0, float* y=0); void setpoint (Point* p, float x=0, float y=0); inline Point average (int n, Point v[n]); inline Point averagepointer (int n, Point* v[n]); inline void copyvector (int n, const Point v[n], Point u[n]=(u+i)); inline Order invert (Order o); $cfile "tfunction.h" /* class ColorPoint : public Point { ColorPoint (float px, float py, float cr=0.0f, float cg=0.0f, float cb=0.0f); virtual ~ColorPoint (); virtual void getcolor (float* red, float *green, float *blue) const; static const Point* MakeRed (float x, float y); }; */ conky-1.12.2/3rdparty/toluapp/src/tests/tmodule.c000066400000000000000000000004461404127277500217370ustar00rootroot00000000000000#include "lualib.h" #include "lauxlib.h" #include "tmodule.h" int a = 1; int b = 2; int c = 3; int d = 4; int main () { int tolua_tmodule_open (lua_State*); lua_State* L = lua_open(); luaopen_base(L); tolua_tmodule_open(L); lua_dofile(L,"tmodule.lua"); lua_close(L); return 0; } conky-1.12.2/3rdparty/toluapp/src/tests/tmodule.h000066400000000000000000000001151404127277500217350ustar00rootroot00000000000000#include extern int a; extern int b; extern int c; extern int d; conky-1.12.2/3rdparty/toluapp/src/tests/tmodule.lua000066400000000000000000000005221404127277500222710ustar00rootroot00000000000000-- test valid access assert(A.a==1) assert(A.B.b==2) assert(A.B.C.c==3) -- test invalid access assert(A.B.a==nil) -- no inheritance assert(A.B.C.a==nil) assert(A.b==nil) -- no access the inner module assert(A.c==nil) assert(A.B.c==nil) -- test variables appended to existing modules assert(A.d==4) print("Module test OK") conky-1.12.2/3rdparty/toluapp/src/tests/tmodule.pkg000066400000000000000000000002221404127277500222660ustar00rootroot00000000000000 $#include "tmodule.h" module A { extern int a; module B { extern int b; module C { extern int c; } } } module A { extern int d; } conky-1.12.2/3rdparty/toluapp/src/tests/tmodulebind.c000066400000000000000000000057031404127277500225750ustar00rootroot00000000000000/* ** Lua binding: tmodule ** Generated automatically by tolua 5.0a-CDLVS2 on 08/08/03 17:06:13. */ #ifndef __cplusplus #include "stdlib.h" #endif #include "string.h" #include "tolua.h" /* Exported function */ TOLUA_API int tolua_tmodule_open (lua_State* tolua_S); #include "tmodule.h" /* function to register type */ static void tolua_reg_types (lua_State* tolua_S) { } /* get function: a */ static int tolua_get_A_a(lua_State* tolua_S) { tolua_pushnumber(tolua_S,(double)a); return 1; } /* set function: a */ static int tolua_set_A_a(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif a = ((int) tolua_tonumber(tolua_S,2,0)); return 0; } /* get function: b */ static int tolua_get_B_b(lua_State* tolua_S) { tolua_pushnumber(tolua_S,(double)b); return 1; } /* set function: b */ static int tolua_set_B_b(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif b = ((int) tolua_tonumber(tolua_S,2,0)); return 0; } /* get function: c */ static int tolua_get_C_c(lua_State* tolua_S) { tolua_pushnumber(tolua_S,(double)c); return 1; } /* set function: c */ static int tolua_set_C_c(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif c = ((int) tolua_tonumber(tolua_S,2,0)); return 0; } /* get function: d */ static int tolua_get_A_d(lua_State* tolua_S) { tolua_pushnumber(tolua_S,(double)d); return 1; } /* set function: d */ static int tolua_set_A_d(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif d = ((int) tolua_tonumber(tolua_S,2,0)); return 0; } /* Open function */ TOLUA_API int tolua_tmodule_open (lua_State* tolua_S) { tolua_open(tolua_S); tolua_reg_types(tolua_S); tolua_module(tolua_S,NULL,0); tolua_beginmodule(tolua_S,NULL); tolua_module(tolua_S,"A",1); tolua_beginmodule(tolua_S,"A"); tolua_variable(tolua_S,"a",tolua_get_A_a,tolua_set_A_a); tolua_module(tolua_S,"B",1); tolua_beginmodule(tolua_S,"B"); tolua_variable(tolua_S,"b",tolua_get_B_b,tolua_set_B_b); tolua_module(tolua_S,"C",1); tolua_beginmodule(tolua_S,"C"); tolua_variable(tolua_S,"c",tolua_get_C_c,tolua_set_C_c); tolua_endmodule(tolua_S); tolua_endmodule(tolua_S); tolua_endmodule(tolua_S); tolua_module(tolua_S,"A",1); tolua_beginmodule(tolua_S,"A"); tolua_variable(tolua_S,"d",tolua_get_A_d,tolua_set_A_d); tolua_endmodule(tolua_S); tolua_endmodule(tolua_S); return 1; } conky-1.12.2/3rdparty/toluapp/src/tests/tnamespace.h000066400000000000000000000001701404127277500224050ustar00rootroot00000000000000namespace A { enum {FIRST=1}; extern int a; namespace B { extern int b; namespace C { extern int c; } } } conky-1.12.2/3rdparty/toluapp/src/tests/tnamespace.lua000066400000000000000000000004261404127277500227430ustar00rootroot00000000000000-- test valid access assert(A.a==1) assert(A.B.b==2) assert(A.B.C.c==3) -- test invalid access assert(A.B.a==nil) -- no inheritance assert(A.B.C.a==nil) assert(A.b==nil) -- no access the inner module assert(A.c==nil) assert(A.B.c==nil) print("Namespace test OK") conky-1.12.2/3rdparty/toluapp/src/tests/tnamespace.pkg000066400000000000000000000001551404127277500227420ustar00rootroot00000000000000 $#include "tnamespace.h" namespace A { int a; namespace B { int b; namespace C { int c; } } } conky-1.12.2/3rdparty/toluapp/src/tests/tvariable.c000066400000000000000000000014131404127277500222320ustar00rootroot00000000000000#include "lualib.h" #include "lauxlib.h" #include "tvariable.h" int i = 1; float f = 2.0f;; double d = 3.0; char* s = "Hello world"; void* v = (void*)1; char n[64] = "Hi there"; A a = {11,12.0f,13.0,"Hello world from class",(void*)1,"Hi there from class"}; B* b; U u; int mi = 21; float mf = 22.0f; double md = 23.0; char* ms = "Hello world in module"; void* mv = NULL; char mn[64] = "Hi there in module"; A ma = {31,32.0f,33.0,"Hello world from class in module", NULL,"Hi there from class in module"}; B* mb; int main (void) { int tolua_tvariable_open (lua_State*); lua_State* L = lua_open(); B bb = {a,NULL}; B bbb = {ma,&bb}; b = &bb; mb = &bbb; luaopen_base(L); tolua_tvariable_open(L); lua_dofile(L,"tvariable.lua"); lua_close(L); return 0; } conky-1.12.2/3rdparty/toluapp/src/tests/tvariable.h000066400000000000000000000007201404127277500222370ustar00rootroot00000000000000typedef struct A A; typedef struct B B; typedef union U U; struct A { int i; float f; double d; char* s; void* v; char n[64]; }; union U { int i; float f; }; struct B { A a; B* b; }; extern int i; extern float f; extern double d; extern char* s; extern void* v; extern char n[64]; extern A a; extern B* b; extern U u; extern int mi; extern float mf; extern double md; extern char* ms; extern void* mv; extern char mn[64]; extern A ma; extern B* mb; conky-1.12.2/3rdparty/toluapp/src/tests/tvariable.lua000066400000000000000000000027221404127277500225750ustar00rootroot00000000000000assert(i==1) assert(f==2) assert(d==3) assert(s=="Hello world") assert(n=="Hi there") n = "Hello" assert(n=="Hello") assert(a.i==11) assert(a.f==12) assert(a.d==13) assert(a.s=="Hello world from class") assert(a.n=="Hi there from class") a.n = "Hello from class" assert(a.n=="Hello from class") assert(v==a.v) u.i = 2 assert(u.i==2) u.f = 2 assert(u.f==2) assert(u.i~=2) assert(M.mi==21) assert(M.mf==22) assert(M.md==23) assert(M.ms=="Hello world in module") assert(M.mn=="Hi there in module") M.mn = "Hello in module" assert(M.mn=="Hello in module") assert(M.mv==nil) assert(M.ma.i==31) assert(M.ma.f==32) assert(M.ma.d==33) assert(M.ma.s=="Hello world from class in module") assert(M.ma.n=="Hi there from class in module") M.ma.n = "Hello from class in module" assert(M.ma.n=="Hello from class in module") assert(M.ma.v==nil) assert(a.i==b.a.i) assert(a.f==b.a.f) assert(a.d==b.a.d) assert(a.s==b.a.s) assert(a.v==b.a.v) assert(b.b==nil) assert(M.ma.i==M.mb.a.i) assert(M.ma.f==M.mb.a.f) assert(M.ma.d==M.mb.a.d) assert(M.ma.s==M.mb.a.s) assert(M.ma.v==M.mb.a.v) assert(a.i==M.mb.b.a.i) assert(a.f==M.mb.b.a.f) assert(a.d==M.mb.b.a.d) assert(a.s==M.mb.b.a.s) assert(a.v==M.mb.b.a.v) assert(M.mb.b.b==nil) assert(s~=rawget(_G,"s")) -- because s represents a C variable s = "Hello" assert(s==rawget(_G,"s")) -- because s is mapped as const f = 25.0 assert(f~=rawget(_G,"f")) -- because f represents a C variable b.a.i = 5 assert(b.a.i==M.mb.b.a.i) print("Variable test OK") conky-1.12.2/3rdparty/toluapp/src/tests/tvariable.pkg000066400000000000000000000007301404127277500225720ustar00rootroot00000000000000$#include "tvariable.h" struct A { int i; float f; double d; char* s; void* v; char n[64]; }; struct B { A a; B* b; }; union U { int i; float f; }; extern int i; extern float f; extern double d; extern const char* s; extern void* v; extern char n[64]; extern A a; extern B* b; extern U u; module M { extern int mi; extern float mf; extern double md; extern const char* ms; extern void* mv; extern const char mn[64]; extern A a; extern A ma; extern B* mb; } conky-1.12.2/3rdparty/toluapp/src/tests/tvariablebind.c000066400000000000000000000425021404127277500230730ustar00rootroot00000000000000/* ** Lua binding: tvariable ** Generated automatically by tolua 5.0a-CDLVS2 on 08/08/03 17:06:18. */ #ifndef __cplusplus #include "stdlib.h" #endif #include "string.h" #include "tolua.h" /* Exported function */ TOLUA_API int tolua_tvariable_open (lua_State* tolua_S); #include "tvariable.h" /* function to register type */ static void tolua_reg_types (lua_State* tolua_S) { tolua_usertype(tolua_S,"A"); tolua_usertype(tolua_S,"U"); tolua_usertype(tolua_S,"B"); } /* get function: i of class A */ static int tolua_get_A_i(lua_State* tolua_S) { A* self = (A*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'i'",NULL); #endif tolua_pushnumber(tolua_S,(double)self->i); return 1; } /* set function: i of class A */ static int tolua_set_A_i(lua_State* tolua_S) { A* self = (A*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'i'",NULL); if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif self->i = ((int) tolua_tonumber(tolua_S,2,0)); return 0; } /* get function: f of class A */ static int tolua_get_A_f(lua_State* tolua_S) { A* self = (A*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'f'",NULL); #endif tolua_pushnumber(tolua_S,(double)self->f); return 1; } /* set function: f of class A */ static int tolua_set_A_f(lua_State* tolua_S) { A* self = (A*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'f'",NULL); if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif self->f = ((float) tolua_tonumber(tolua_S,2,0)); return 0; } /* get function: d of class A */ static int tolua_get_A_d(lua_State* tolua_S) { A* self = (A*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'd'",NULL); #endif tolua_pushnumber(tolua_S,(double)self->d); return 1; } /* set function: d of class A */ static int tolua_set_A_d(lua_State* tolua_S) { A* self = (A*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'd'",NULL); if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif self->d = ((double) tolua_tonumber(tolua_S,2,0)); return 0; } /* get function: s of class A */ static int tolua_get_A_s(lua_State* tolua_S) { A* self = (A*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 's'",NULL); #endif tolua_pushstring(tolua_S,(const char*)self->s); return 1; } /* set function: s of class A */ static int tolua_set_A_s(lua_State* tolua_S) { A* self = (A*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 's'",NULL); if (!tolua_isstring(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif self->s = ((char*) tolua_tostring(tolua_S,2,0)); return 0; } /* get function: v of class A */ static int tolua_get_A_v(lua_State* tolua_S) { A* self = (A*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'v'",NULL); #endif tolua_pushuserdata(tolua_S,(void*)self->v); return 1; } /* set function: v of class A */ static int tolua_set_A_v(lua_State* tolua_S) { A* self = (A*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'v'",NULL); if (!tolua_isuserdata(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif self->v = ((void*) tolua_touserdata(tolua_S,2,0)); return 0; } /* get function: n of class A */ static int tolua_get_A_n(lua_State* tolua_S) { A* self = (A*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'n'",NULL); #endif tolua_pushstring(tolua_S,(const char*)self->n); return 1; } /* set function: n of class A */ static int tolua_set_A_n(lua_State* tolua_S) { A* self = (A*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'n'",NULL); if (!tolua_isstring(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif strncpy(self->n,tolua_tostring(tolua_S,2,0),64-1); return 0; } /* get function: a of class B */ static int tolua_get_B_a(lua_State* tolua_S) { B* self = (B*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'a'",NULL); #endif tolua_pushusertype(tolua_S,(void*)&self->a,"A"); return 1; } /* set function: a of class B */ static int tolua_set_B_a(lua_State* tolua_S) { B* self = (B*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'a'",NULL); if (!tolua_isusertype(tolua_S,2,"A",0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif self->a = *((A*) tolua_tousertype(tolua_S,2,0)); return 0; } /* get function: b of class B */ static int tolua_get_B_b_ptr(lua_State* tolua_S) { B* self = (B*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'b'",NULL); #endif tolua_pushusertype(tolua_S,(void*)self->b,"B"); return 1; } /* set function: b of class B */ static int tolua_set_B_b_ptr(lua_State* tolua_S) { B* self = (B*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'b'",NULL); if (!tolua_isusertype(tolua_S,2,"B",0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif self->b = ((B*) tolua_tousertype(tolua_S,2,0)); return 0; } /* get function: i of class U */ static int tolua_get_U_i(lua_State* tolua_S) { U* self = (U*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'i'",NULL); #endif tolua_pushnumber(tolua_S,(double)self->i); return 1; } /* set function: i of class U */ static int tolua_set_U_i(lua_State* tolua_S) { U* self = (U*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'i'",NULL); if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif self->i = ((int) tolua_tonumber(tolua_S,2,0)); return 0; } /* get function: f of class U */ static int tolua_get_U_f(lua_State* tolua_S) { U* self = (U*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'f'",NULL); #endif tolua_pushnumber(tolua_S,(double)self->f); return 1; } /* set function: f of class U */ static int tolua_set_U_f(lua_State* tolua_S) { U* self = (U*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'f'",NULL); if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif self->f = ((float) tolua_tonumber(tolua_S,2,0)); return 0; } /* get function: i */ static int tolua_get_i(lua_State* tolua_S) { tolua_pushnumber(tolua_S,(double)i); return 1; } /* set function: i */ static int tolua_set_i(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif i = ((int) tolua_tonumber(tolua_S,2,0)); return 0; } /* get function: f */ static int tolua_get_f(lua_State* tolua_S) { tolua_pushnumber(tolua_S,(double)f); return 1; } /* set function: f */ static int tolua_set_f(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif f = ((float) tolua_tonumber(tolua_S,2,0)); return 0; } /* get function: d */ static int tolua_get_d(lua_State* tolua_S) { tolua_pushnumber(tolua_S,(double)d); return 1; } /* set function: d */ static int tolua_set_d(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif d = ((double) tolua_tonumber(tolua_S,2,0)); return 0; } /* get function: s */ static int tolua_get_s(lua_State* tolua_S) { tolua_pushstring(tolua_S,(const char*)s); return 1; } /* get function: v */ static int tolua_get_v(lua_State* tolua_S) { tolua_pushuserdata(tolua_S,(void*)v); return 1; } /* set function: v */ static int tolua_set_v(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isuserdata(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif v = ((void*) tolua_touserdata(tolua_S,2,0)); return 0; } /* get function: n */ static int tolua_get_n(lua_State* tolua_S) { tolua_pushstring(tolua_S,(const char*)n); return 1; } /* set function: n */ static int tolua_set_n(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isstring(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif strncpy(n,tolua_tostring(tolua_S,2,0),64-1); return 0; } /* get function: a */ static int tolua_get_a(lua_State* tolua_S) { tolua_pushusertype(tolua_S,(void*)&a,"A"); return 1; } /* set function: a */ static int tolua_set_a(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isusertype(tolua_S,2,"A",0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif a = *((A*) tolua_tousertype(tolua_S,2,0)); return 0; } /* get function: b */ static int tolua_get_b_ptr(lua_State* tolua_S) { tolua_pushusertype(tolua_S,(void*)b,"B"); return 1; } /* set function: b */ static int tolua_set_b_ptr(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isusertype(tolua_S,2,"B",0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif b = ((B*) tolua_tousertype(tolua_S,2,0)); return 0; } /* get function: u */ static int tolua_get_u(lua_State* tolua_S) { tolua_pushusertype(tolua_S,(void*)&u,"U"); return 1; } /* set function: u */ static int tolua_set_u(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isusertype(tolua_S,2,"U",0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif u = *((U*) tolua_tousertype(tolua_S,2,0)); return 0; } /* get function: mi */ static int tolua_get_M_mi(lua_State* tolua_S) { tolua_pushnumber(tolua_S,(double)mi); return 1; } /* set function: mi */ static int tolua_set_M_mi(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif mi = ((int) tolua_tonumber(tolua_S,2,0)); return 0; } /* get function: mf */ static int tolua_get_M_mf(lua_State* tolua_S) { tolua_pushnumber(tolua_S,(double)mf); return 1; } /* set function: mf */ static int tolua_set_M_mf(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif mf = ((float) tolua_tonumber(tolua_S,2,0)); return 0; } /* get function: md */ static int tolua_get_M_md(lua_State* tolua_S) { tolua_pushnumber(tolua_S,(double)md); return 1; } /* set function: md */ static int tolua_set_M_md(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif md = ((double) tolua_tonumber(tolua_S,2,0)); return 0; } /* get function: ms */ static int tolua_get_M_ms(lua_State* tolua_S) { tolua_pushstring(tolua_S,(const char*)ms); return 1; } /* get function: mv */ static int tolua_get_M_mv(lua_State* tolua_S) { tolua_pushuserdata(tolua_S,(void*)mv); return 1; } /* set function: mv */ static int tolua_set_M_mv(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isuserdata(tolua_S,2,0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif mv = ((void*) tolua_touserdata(tolua_S,2,0)); return 0; } /* get function: mn */ static int tolua_get_M_mn(lua_State* tolua_S) { tolua_pushstring(tolua_S,(const char*)mn); return 1; } /* get function: a */ static int tolua_get_M_a(lua_State* tolua_S) { tolua_pushusertype(tolua_S,(void*)&a,"A"); return 1; } /* set function: a */ static int tolua_set_M_a(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isusertype(tolua_S,2,"A",0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif a = *((A*) tolua_tousertype(tolua_S,2,0)); return 0; } /* get function: ma */ static int tolua_get_M_ma(lua_State* tolua_S) { tolua_pushusertype(tolua_S,(void*)&ma,"A"); return 1; } /* set function: ma */ static int tolua_set_M_ma(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isusertype(tolua_S,2,"A",0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif ma = *((A*) tolua_tousertype(tolua_S,2,0)); return 0; } /* get function: mb */ static int tolua_get_M_mb_ptr(lua_State* tolua_S) { tolua_pushusertype(tolua_S,(void*)mb,"B"); return 1; } /* set function: mb */ static int tolua_set_M_mb_ptr(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isusertype(tolua_S,2,"B",0,&tolua_err)) tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); #endif mb = ((B*) tolua_tousertype(tolua_S,2,0)); return 0; } /* Open function */ TOLUA_API int tolua_tvariable_open (lua_State* tolua_S) { tolua_open(tolua_S); tolua_reg_types(tolua_S); tolua_module(tolua_S,NULL,1); tolua_beginmodule(tolua_S,NULL); tolua_cclass(tolua_S,"A","A","",NULL); tolua_beginmodule(tolua_S,"A"); tolua_variable(tolua_S,"i",tolua_get_A_i,tolua_set_A_i); tolua_variable(tolua_S,"f",tolua_get_A_f,tolua_set_A_f); tolua_variable(tolua_S,"d",tolua_get_A_d,tolua_set_A_d); tolua_variable(tolua_S,"s",tolua_get_A_s,tolua_set_A_s); tolua_variable(tolua_S,"v",tolua_get_A_v,tolua_set_A_v); tolua_variable(tolua_S,"n",tolua_get_A_n,tolua_set_A_n); tolua_endmodule(tolua_S); tolua_cclass(tolua_S,"B","B","",NULL); tolua_beginmodule(tolua_S,"B"); tolua_variable(tolua_S,"a",tolua_get_B_a,tolua_set_B_a); tolua_variable(tolua_S,"b",tolua_get_B_b_ptr,tolua_set_B_b_ptr); tolua_endmodule(tolua_S); tolua_cclass(tolua_S,"U","U","",NULL); tolua_beginmodule(tolua_S,"U"); tolua_variable(tolua_S,"i",tolua_get_U_i,tolua_set_U_i); tolua_variable(tolua_S,"f",tolua_get_U_f,tolua_set_U_f); tolua_endmodule(tolua_S); tolua_variable(tolua_S,"i",tolua_get_i,tolua_set_i); tolua_variable(tolua_S,"f",tolua_get_f,tolua_set_f); tolua_variable(tolua_S,"d",tolua_get_d,tolua_set_d); tolua_variable(tolua_S,"s",tolua_get_s,NULL); tolua_variable(tolua_S,"v",tolua_get_v,tolua_set_v); tolua_variable(tolua_S,"n",tolua_get_n,tolua_set_n); tolua_variable(tolua_S,"a",tolua_get_a,tolua_set_a); tolua_variable(tolua_S,"b",tolua_get_b_ptr,tolua_set_b_ptr); tolua_variable(tolua_S,"u",tolua_get_u,tolua_set_u); tolua_module(tolua_S,"M",1); tolua_beginmodule(tolua_S,"M"); tolua_variable(tolua_S,"mi",tolua_get_M_mi,tolua_set_M_mi); tolua_variable(tolua_S,"mf",tolua_get_M_mf,tolua_set_M_mf); tolua_variable(tolua_S,"md",tolua_get_M_md,tolua_set_M_md); tolua_variable(tolua_S,"ms",tolua_get_M_ms,NULL); tolua_variable(tolua_S,"mv",tolua_get_M_mv,tolua_set_M_mv); tolua_variable(tolua_S,"mn",tolua_get_M_mn,NULL); tolua_variable(tolua_S,"a",tolua_get_M_a,tolua_set_M_a); tolua_variable(tolua_S,"ma",tolua_get_M_ma,tolua_set_M_ma); tolua_variable(tolua_S,"mb",tolua_get_M_mb_ptr,tolua_set_M_mb_ptr); tolua_endmodule(tolua_S); tolua_endmodule(tolua_S); return 1; } conky-1.12.2/3rdparty/toluapp/win32/000077500000000000000000000000001404127277500171275ustar00rootroot00000000000000conky-1.12.2/3rdparty/toluapp/win32/vc7/000077500000000000000000000000001404127277500176265ustar00rootroot00000000000000conky-1.12.2/3rdparty/toluapp/win32/vc7/toluapp.sln000077500000000000000000000027051404127277500220370ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "toluapp", "toluapp.vcproj", "{71891C1A-E328-4258-AC3F-6F9698C6D8B4}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution withLua50_Debug = withLua50_Debug withLua50_Release = withLua50_Release withLua51_Debug = withLua51_Debug withLua51_Release = withLua51_Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {71891C1A-E328-4258-AC3F-6F9698C6D8B4}.withLua50_Debug.ActiveCfg = withLua51_Release|Win32 {71891C1A-E328-4258-AC3F-6F9698C6D8B4}.withLua50_Debug.Build.0 = withLua51_Release|Win32 {71891C1A-E328-4258-AC3F-6F9698C6D8B4}.withLua50_Release.ActiveCfg = withLua50_Release|Win32 {71891C1A-E328-4258-AC3F-6F9698C6D8B4}.withLua50_Release.Build.0 = withLua50_Release|Win32 {71891C1A-E328-4258-AC3F-6F9698C6D8B4}.withLua51_Debug.ActiveCfg = withLua51_Debug|Win32 {71891C1A-E328-4258-AC3F-6F9698C6D8B4}.withLua51_Debug.Build.0 = withLua51_Debug|Win32 {71891C1A-E328-4258-AC3F-6F9698C6D8B4}.withLua51_Release.ActiveCfg = withLua51_Release|Win32 {71891C1A-E328-4258-AC3F-6F9698C6D8B4}.withLua51_Release.Build.0 = withLua51_Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal conky-1.12.2/3rdparty/toluapp/win32/vc7/toluapp.vcproj000077500000000000000000000155271404127277500225540ustar00rootroot00000000000000 conky-1.12.2/AUTHORS000066400000000000000000000213061404127277500140030ustar00rootroot00000000000000NOTE: Since moving to Git, I am no longer going to continue to update this file (in favour of Git's log stuff). If you want to add yourself here when you submit a patch, feel free. Authors of conky in alphapetical order (please, send mail if I forgot somebody or email address / name is wrong): adi Outline stuff ACPI fan & adapter Adi Zaimi original top code Alex Iconv patch Alexey Bondarenko $scroll fix affinity X-Mozilla-Status support akash battery_percent and battery_bar Asbjørn Zweidorff Kjær support for EVE-Online skill monitoring Aseem Mohanty if_up patch Ben Kibbey $tail fifo patch multiple mailbox patch Blondak diskio read & write patch Bobby Beckmann Interface IP and Wireless Quality patch Byron Clark sysfs AC adapter support patch David Carter CPU usage being reported incorrectly by top Brenden Matthews project maintainer for https://github.com/brndnmtthws/conky Bruce Merry Xdbe (double buffering) btlee linkstatus patch (http://forums.gentoo.org/viewtopic-p-2765647.html#2765647) calmar mboxscan cromka if_existing patch for string matching dan-h adt746x fix Dan Piponi original top code Dave Clark original top code David McCabe utime garo developer Ram Yalamanchili tztime Daniel Thiele APM support for FreeBSD Denis WM_CLASS patch statfs patch Dennis Frommknecht NVCtrl, temperature monitoring for nvdia-based graphics cards Dennis Kaandorp adt746x stuff Elisey O. Savateev Fixed if_mounted on FreeBSD Egor(knick_) Iconv patch Erik Scharwaechter $if_empty patch Falk Feuersenger I2C divisor from a file Fanat1k Iconv patch flitsch hwmon support fow mpd_title max length Google LLC Gwenhael LE MOINE Manual setting of the position WM_CLASS for window when drawing to own window Hannu Saransaari Main code Henri Häkkinen MOC support hinokind support negative values in human_readable() Jaromir Smrcek APC UPS daemon support Jason Mitchell developer UTF8 fix Source clean up Jason Tan developer debian package maintainer Joe Myre - developer jack_mort - gentoo forums $tab patch Jarmo Hekkanen SETI stuff Jeremy Burch $cached and $buffers JL Farinacci pad_percents Johannes Winkelmann disk I/O on linux more consistent cpu freq handling on linux capitalize Hertz in cpu frequeny jolapache maildir format Jonas Koelker reload on SIGHUP patch pad percantages fix patch Joshua Gerrish mpd password patch Jørgen P. Tjernø Restores default settings before loading new config file in SIGHUP Some cleaning and commenting apparently :) SIGHUP config file reload Kapil Hari Paranjape ibm_volume patch kFreeBSD support patch realtime clock patch sysfs battery patch mail_spool patch Kevin Lyles add long options patch add cpu separate option patch add time to top patch simplify round_to_int patch goto width fix patch offset width fix patch individual diskio patch short_units & human_readable patch killfire fs_used_perc and fs_bar_free patch Lars Kotthoff $loadgraph, show_graph_scale patch Lassi Selander XMMS2 patch XMMS2 fixes Lauri Hakkarainen Some translating, web and other stuff Leszek Krupiñski Battery number for ACPI battery Load average bug fix Lucas Brutschy MLDonkey patch if constructs patch Marcus Huesgen battery_bar fix Markus Meissner NVIDIA Graficcard support with libXNVCtrl patch Michal Januszewski hddtemp support Michal Ziabkowski $if_up memleak fix Miroslav Lichvar move audacious thread init to update_audacious() patch x86_64 freq_dyn patch buffer overflow in update_net_stats() patch Moncelier Camille METAR patch Morgan Veyret own_window_type dock patch Nattfodd Fixed top_mem dupes nathanj439 MPD time fix Nikos Ntarmos FreeBSD total memory patch Nikos Pylarinos macOS support norsetto fix SIGUSR1/SIGHUP segfault Pascal Eberhard graph and bar fix for right alignment Peter Tarjan IBM acpi support patch SMP support for freq stuff CPU voltage patch Petr Holub fix autotools on FreeBSD in autogen.sh Improved battery readout on FreeBSD Philip Kovacs tcp port monitor with hashing functionality Audacious, Xmms, BMP, Infopipe stuff Various Xlib changes, e.g. own_window hints, etc. Phil multiple batteries support tp_smapi support if_up patch fix sysfs crashing patch Psychon a bunch of code cleanups Rogier Reerink Intel backlight support roiban adi hex colour patch Ryan Tandy fs_type patch if_mpd_playing patch Rui Paulo NetBSD support Roland Shoemaker user info patch conky version info patch Roman Bogorodskiy FreeBSD support BMPx support Ryan Twitchell head/tail rewrite patch Mikko Sysikaski prss.c and prss.h Sceptik --quiet patch Stepan Zastupov WiFi signal level detection support on FreeBSD Szymon Boniecki Reads current LC_TIME Thomas Cort CPU frequency patch for alpha Toke Høiland-Jørgensen systemd journal support Toni exec*/tail/head output evalution Toni Spets hifi OpenBSD support Linux wifi code RSS code (created together with Mikko Sysikaski) Lua scripting Tris Scroll step patch tyir MPD features patch 1319461 Vivenzio Pagliari Some useful patches for port monitoring PowerBook battery patch Walt Nelson $freq fix Warren Dukes libmpdclient warudemaru rss and vsize for top wedge battery time fix for 2.6.24 William DiPlacido Frequency from /proc/cpuinfo Some other SETI stuff zimba-tm alignment none patch zotrix FreeBSD patch for <10 procs Daniel Beßler argb visual patch conky-1.12.2/CMakeLists.txt000066400000000000000000000056251404127277500155010ustar00rootroot00000000000000# # Conky, a system monitor, based on torsmo # # Please see COPYING for details # # Copyright (c) 2005-2021 Brenden Matthews, et. al. (see AUTHORS) All rights # reserved. # # 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 3 of the License, or (at your option) any later # version. # # 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. You should have received a copy of the GNU General Public License # along with this program. If not, see . # cmake_minimum_required(VERSION 3.6) project(conky) # This is the directory for our custom CMake modules. set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) # 'core' CMake stuff include(Conky) # Handle build options include(ConkyBuildOptions) # Do platform checks include(ConkyPlatformChecks) # CPack module for installation tasks include(ConkyCPackSetup) # setup our configuration headers configure_file(${CMAKE_MODULE_PATH}/config.h.in ${CMAKE_BINARY_DIR}/config.h) configure_file(${CMAKE_MODULE_PATH}/build.h.in ${CMAKE_BINARY_DIR}/build.h) set(conky_sources ${CMAKE_BINARY_DIR}/config.h ${CMAKE_BINARY_DIR}/build.h) # Finally, add some code add_subdirectory(lua) add_subdirectory(data) add_subdirectory(doc) # Include 3rdparty toluapp add_subdirectory(3rdparty/toluapp) set(conky_libs ${conky_libs} toluapp_lib_static) if(BUILD_TESTS) if(USING_CLANG) message(STATUS "Detected clang, enabling test coverage reports") # Enable coverage checks include(CodeCoverage) append_coverage_compiler_flags() else() message(STATUS "NOT enabling test coverage reports") endif() include(Catch) endif() add_subdirectory(src) if(BUILD_TESTS) add_subdirectory(tests) enable_testing() endif() if(NOT DEFINED DOC_PATH) set(DOC_PATH "share/doc/${CPACK_PACKAGE_NAME}-${VERSION}") endif(NOT DEFINED DOC_PATH) set(DOC_FILES extras/convert.lua data/conky_no_x11.conf data/conky.conf) set(HTML_PATH "${DOC_PATH}/html") set(HTML_FILES doc/config_settings.html doc/docs.html doc/lua.html doc/variables.html) set(MAN_PATH "share/man/man1") set(MAN_FILES doc/conky.1) install(FILES ${DOC_FILES} DESTINATION ${DOC_PATH}) if(BUILD_DOCS) install(FILES ${HTML_FILES} DESTINATION ${HTML_PATH}) install(FILES ${MAN_FILES} DESTINATION ${MAN_PATH}) endif(BUILD_DOCS) if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") install(FILES conky.desktop DESTINATION share/applications) install(FILES logo/conky-logomark-violet.svg DESTINATION share/icons/hicolor/scalable/apps) endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") if(CHECK_CODE_QUALITY) find_package(ClangTidy) find_package(ClangFormat) endif(CHECK_CODE_QUALITY) conky-1.12.2/CONTRIBUTING.md000066400000000000000000000025641404127277500151710ustar00rootroot00000000000000# Contributing Contributions are welcome from anyone. ## Pull Request Guidelines When submitting PRs, please: - Describe the changes, why they were necessary, etc - Describe how the changes affect existing behaviour - Describe how you tested and validated your changes - Include unit tests when appropriate - Include any relevant screenshots/evidence demonstrating that the changes work and have been tested - Any new source files should include a GPLv3 license header - All new code must be GPLv3 licensed - Try to leave the code better than you found it - PRs with failed checks may be ignored or closed; please make sure the build and checks pass if possible (and notify someone when the build system is not working) _Patches submitted in issues, email, or elsewhere may be ignored._ ## Coding Style Code should be formatted using `clang-format`. By configuring Conky with `cmake -DCHECK_CODE_QUALITY=ON`, you will be able to run `make clang-format` to automatically format code. If code in your PR is not formatted according to [`.clang-format`](.clang-format), the checks will not pass. ## Unit Testing Conky uses the [Catch2](https://github.com/catchorg/Catch2) unit testing framework. If you are adding new functions or methods, please consider adding unit tests for that code. Additionally, if you'd like to add tests for existing code, that would be a welcome contribution. conky-1.12.2/COPYING000066400000000000000000000007261404127277500137710ustar00rootroot00000000000000Any original torsmo code is licensed under the BSD license (see LICENSE.BSD for a copy) All code written since the fork of torsmo is licensed under the GPL (see LICENSE for a copy), except where noted differently (such as in portmon and audacious code which are LGPL, and prss which is an MIT-style license). Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS) All rights reserved. conky-1.12.2/Dockerfile000066400000000000000000000060601404127277500147250ustar00rootroot00000000000000FROM ubuntu:focal AS builder RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive \ apt-get install -qy --no-install-recommends \ audacious-dev \ ca-certificates \ clang \ curl \ gfortran \ git \ libarchive-dev \ libaudclient-dev \ libcairo2-dev \ libcurl4-openssl-dev \ libical-dev \ libimlib2-dev \ libircclient-dev \ libiw-dev \ libjsoncpp-dev \ liblua5.3-dev \ libmicrohttpd-dev \ libmysqlclient-dev \ libncurses-dev \ libpulse-dev \ librhash-dev \ librsvg2-dev \ libssl-dev \ libsystemd-dev \ libuv1-dev \ libxdamage-dev \ libxext-dev \ libxft-dev \ libxinerama-dev \ libxml2-dev \ libxmmsclient-dev \ libxnvctrl-dev \ make \ patch \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Compile CMake, we need the latest because the bug here (for armv7 builds): # https://gitlab.kitware.com/cmake/cmake/-/issues/20568 WORKDIR /cmake RUN curl -Lq https://github.com/Kitware/CMake/releases/download/v3.19.6/cmake-3.19.6.tar.gz -o cmake-3.19.6.tar.gz \ && tar xf cmake-3.19.6.tar.gz \ && cd cmake-3.19.6 \ && CC=clang CXX=clang++ CFLAGS="-D_FILE_OFFSET_BITS=64" CXXFLAGS="-D_FILE_OFFSET_BITS=64" ./bootstrap --system-libs --parallel=5 \ && make -j5 \ && make -j5 install \ && cd \ && rm -rf /cmake COPY . /conky WORKDIR /conky/build ARG X11=yes RUN sh -c 'if [ "$X11" = "yes" ] ; then \ cmake \ -DCMAKE_C_COMPILER=clang \ -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_INSTALL_PREFIX=/opt/conky \ -DBUILD_AUDACIOUS=ON \ -DBUILD_HTTP=ON \ -DBUILD_ICAL=ON \ -DBUILD_ICONV=ON \ -DBUILD_IRC=ON \ -DBUILD_JOURNAL=ON \ -DBUILD_LUA_CAIRO=ON \ -DBUILD_LUA_CAIRO=ON \ -DBUILD_LUA_IMLIB2=ON \ -DBUILD_LUA_RSVG=ON \ -DBUILD_MYSQL=ON \ -DBUILD_NVIDIA=ON \ -DBUILD_PULSEAUDIO=ON \ -DBUILD_RSS=ON \ -DBUILD_WLAN=ON \ -DBUILD_XMMS2=ON \ ../ \ ; else \ cmake \ -DCMAKE_C_COMPILER=clang \ -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_INSTALL_PREFIX=/opt/conky \ -DBUILD_AUDACIOUS=ON \ -DBUILD_HTTP=ON \ -DBUILD_ICAL=ON \ -DBUILD_ICONV=ON \ -DBUILD_IRC=ON \ -DBUILD_JOURNAL=ON \ -DBUILD_LUA_CAIRO=ON \ -DBUILD_LUA_CAIRO=ON \ -DBUILD_LUA_IMLIB2=ON \ -DBUILD_LUA_RSVG=ON \ -DBUILD_MYSQL=ON \ -DBUILD_PULSEAUDIO=ON \ -DBUILD_RSS=ON \ -DBUILD_WLAN=ON \ -DBUILD_X11=OFF \ -DBUILD_XMMS2=ON \ ../ \ ; fi' \ && make -j5 all \ && make -j5 install FROM ubuntu:focal RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive \ apt-get install -qy --no-install-recommends \ libaudclient2 \ libcairo2 \ libcurl4 \ libical3 \ libimlib2 \ libircclient1 \ libiw30 \ liblua5.3-0 \ libmicrohttpd12 \ libmysqlclient21 \ libncurses6 \ libpulse0 \ librsvg2-2 \ libsm6 \ libsystemd0 \ libxcb-xfixes0 \ libxdamage1 \ libxext6 \ libxfixes3 \ libxft2 \ libxinerama1 \ libxml2 \ libxmmsclient6 \ libxnvctrl0 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* COPY --from=builder /opt/conky /opt/conky ENV PATH="/opt/conky/bin:${PATH}" ENV LD_LIBRARY_PATH="/opt/conky/lib:${LD_LIBRARY_PATH}" ENTRYPOINT [ "/opt/conky/bin/conky" ] conky-1.12.2/LICENSE000066400000000000000000001045131404127277500137420ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. 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. 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. 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. 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. 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. 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. 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. 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. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" 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 "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" 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. To "convey" 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. An interactive user interface displays "Appropriate Legal Notices" 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. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" 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. The "System Libraries" 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 "Major Component", 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. The "Corresponding Source" 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. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. 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. 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. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 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. 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. 4. Conveying Verbatim Copies. 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. 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. 5. Conveying Modified Source Versions. 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: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. 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 "keep intact all notices". 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. 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. 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 "aggregate" 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. 6. Conveying Non-Source Forms. 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: 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. 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. 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. 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. 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. 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. A "User Product" is either (1) a "consumer product", 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, "normally used" 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. "Installation Information" 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. 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). 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. 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. 7. Additional Terms. "Additional permissions" 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. 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. 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: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or 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 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 d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or 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. All other non-permissive additional terms are considered "further restrictions" 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. 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. 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. 8. Termination. 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). 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. 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. 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. 9. Acceptance Not Required for Having Copies. 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. 10. Automatic Licensing of Downstream Recipients. 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. An "entity transaction" 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. 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. 11. Patents. A "contributor" 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 "contributor version". A contributor's "essential patent claims" 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, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. 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. In the following three paragraphs, a "patent license" 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 "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. 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. "Knowingly relying" 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. 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. A patent license is "discriminatory" 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. 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. 12. No Surrender of Others' Freedom. 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. 13. Use with the GNU Affero General Public License. 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. 14. Revised Versions of this License. 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. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" 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. 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. 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. 15. Disclaimer of Warranty. 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 "AS IS" 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. 16. Limitation of Liability. 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. 17. Interpretation of Sections 15 and 16. 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. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs 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. 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 "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 3 of the License, or (at your option) any later version. 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. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program 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. 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 "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . 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 . conky-1.12.2/LICENSE.BSD000066400000000000000000000034021404127277500143440ustar00rootroot00000000000000*NOTICE*: This file exists for historical reasons because the original Torsmo and early Conky code was licensed under the BSD license. Conky is now licensed under GPLv3. Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. conky-1.12.2/README.cmake000066400000000000000000000015231404127277500146710ustar00rootroot00000000000000Hello, there. Using CMake to build Conky is pretty easy, and here is how I do it: 1. From the top level source dir, create a build working dir, and cd into it $ mkdir build $ cd build 2. Run the cmake configuration process $ cmake ../ # pass the path to the sources to cmake OR $ ccmake ../ # you can also use the fance curses interface, or try cmake-gui 3. Compile as usual, and enjoy the out-of-source goodness $ make # make install # if you want There are a number of build options for Conky, and the best way to discover them is to use the ccmake (or cmake-gui) CMake tool for browsing them. Certain Conky build time features (such as doc generation) require third-party applications, which you should be notified of via CMake. In the case of doc generation, you'll need the docbook2X package (available on most distributions). conky-1.12.2/README.docker000066400000000000000000000042341404127277500150620ustar00rootroot00000000000000== INSTALLATION OF THE IMAGE == Build the image with: $ docker build --tag=conky . or if you want the commandline version: $ docker build --build-arg X11=no --tag=conkycmd . == RUNNING OF THE CONTAINER == After building you can run the graphical version with: $ docker run --rm -ti --net=host -e DISPLAY -v ~/.Xauthority:/root/.Xauthority conky The commandline version is easier: $ docker run --rm -ti conkycmd If you want to pass some options to conky you can just add them if you mention 'conky' twice. Once for the image and once for the command. For example: $ docker run --rm -ti --net=host -e DISPLAY -v ~/.Xauthority:/root/.Xauthority conky conky --version will show you the version of conky. Since you don't need X for this you could also do: $ docker run --rm -ti conkycmd conky --version If you want to fiddle around a bit with the configuration first you could do: $ docker run --rm -ti --net=host -e DISPLAY -v ~/.Xauthority:/root/.Xauthority conky bash $ conky -c configurationfile ; exit See the docker docs to a lot of other ways to (ab)use this container == WHY == Disadvantages of using the docker: - You'll have to install docker. This can be done by following the instructions in https://docs.docker.com/install/ to install docker CE. But just using the packagemanager of your distro like you would do with other software will work. - A lot of info will be about the current container instead of the whole system - At the moment our docker image is still in development fase. Advantages of using docker: - During the installation you won't have to care about which compilers, libraries, ... are installed. Neither should you care about how to use them. - The containerization of conky will make it a lot harder to let problems with conky affect the rest of the system. - Your Conky will run in exactly the same environment as everyone else's, so if it works for someone it will work for everyone. No matter which distro you are using or how you configured that distro. (The conky configuration itself will matter and also the version of conky) - Problems will be easier to recreate by developers causing faster debugging. conky-1.12.2/README.md000066400000000000000000000123551404127277500142160ustar00rootroot00000000000000[![Linux build](https://github.com/brndnmtthws/conky/actions/workflows/build-and-test-linux.yaml/badge.svg)](https://github.com/brndnmtthws/conky/actions/workflows/build-and-test-linux.yaml) [![macOS build](https://github.com/brndnmtthws/conky/actions/workflows/build-and-test-macos.yaml/badge.svg)](https://github.com/brndnmtthws/conky/actions/workflows/build-and-test-macos.yaml) [![Docker build](https://github.com/brndnmtthws/conky/actions/workflows/docker.yaml/badge.svg)](https://github.com/brndnmtthws/conky/actions/workflows/docker.yaml) [![AppImage build](https://github.com/brndnmtthws/conky/actions/workflows/publish-appimage.yml/badge.svg)](https://github.com/brndnmtthws/conky/actions/workflows/publish-appimage.yml) [![pipeline status](https://gitlab.com/brndnmtthws-oss/conky/badges/main/pipeline.svg)](https://gitlab.com/brndnmtthws-oss/conky/commits/main) [![coverage report](https://gitlab.com/brndnmtthws-oss/conky/badges/main/coverage.svg)](https://gitlab.com/brndnmtthws-oss/conky/commits/main) [💬 Join the Matrix chat](https://matrix.to/#/#conky:frens.io)

    **Conky** is a free, light-weight system monitor for X, that displays any kind of information on your desktop. 👉 Grab the [latest release from GitHub](https://github.com/brndnmtthws/conky/releases/latest). [📹 An introduction to Conky (YouTube)](https://www.youtube.com/watch?v=bHtpLEoRKmg&t=19s). ## Features Conky can display more than 300 built-in objects, including support for: - A plethora of OS stats (uname, uptime, **CPU usage**, **mem usage**, disk usage, **"top"** like process stats, and **network monitoring**, just to name a few). - Built-in **IMAP** and **POP3** support. - Built-in support for many popular music players ([MPD][], [XMMS2][], [Audacious][]). - Can be extended using built-in [**Lua**](lua) support, or any of your own scripts and programs ([more](https://github.com/brndnmtthws/conky/wiki#tutorial)). - Built-in [**Imlib2**][imlib2] and [**Cairo**][cairo] bindings for arbitrary drawing with Lua ([more](https://github.com/brndnmtthws/conky/wiki/Lua)). - Runs on Linux, FreeBSD, OpenBSD, DragonFlyBSD, NetBSD, Solaris, Haiku, and macOS! - [Docker image](https://hub.docker.com/r/brndnmtthws/conky/) available for amd64, armv7, and aarch64 (aka armv8) ... and much much more. Conky can display information either as text, or using simple progress bars and graph widgets, with different fonts and colours. ## Screenshots [![screenshot](https://github.com/brndnmtthws/conky/wiki/configs/brenden/screenshot-thumb.png)](https://raw.github.com/wiki/brndnmtthws/conky/configs/brenden/screenshot.png) [![screenshot](https://github.com/brndnmtthws/conky/wiki/configs/ke49/screenshot-thumb.png)](https://raw.github.com/wiki/brndnmtthws/conky/configs/ke49/screenshot.png) [![screenshot](https://github.com/brndnmtthws/conky/wiki/configs/jc/screenshot-thumb.png)](https://raw.github.com/wiki/brndnmtthws/conky/configs/jc/screenshot.png) See the User Configs below for more screenshots and associated config files. ## Quickstart Conky comes bundled with many package managers. However, if you'd like to try the latest release of Conky, you can try the AppImage build. If you have `jq` and `curl` installed, run the following command to fetch the latest AppImage: ```ShellSession $ curl -sL -o conky-x86_64.AppImage \ $(curl -sL https://api.github.com/repos/brndnmtthws/conky/releases/latest | \ jq --raw-output '.assets[0] | .browser_download_url') $ ls conky-x86_64.AppImage ``` If you don't have `jq` and `curl` installed, go to https://github.com/brndnmtthws/conky/releases/latest and fetch the latest AppImage. Then: ```ShellSession $ chmod +x ./conky-x86_64.AppImage $ ./conky-x86_64.AppImage -C > ~/.conkyrc $ ./conky-x86_64.AppImage ``` And that's it! [Check out the Wiki](https://github.com/brndnmtthws/conky/wiki) for more details on configuring Conky. _Note_: To use the AppImage, you may need to install additional runtime libraries. ## Documentation The [GitHub Wiki](https://github.com/brndnmtthws/conky/wiki) serves as a central hub for all of Conky's documentation. - [Installation](https://github.com/brndnmtthws/conky/wiki/Installation) - [Configuration Settings](https://github.com/brndnmtthws/conky/wiki/Configurations) - [User Configs](https://github.com/brndnmtthws/conky/wiki/Configs) - [Frequently Asked Questions](https://github.com/brndnmtthws/conky/wiki/FAQ) ## License Conky is licensed under the terms of the [GPLv3](LICENSE) license. ## Contributing Contributions are welcome from anyone. Please read [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on contributing to Conky. [mpd]: https://musicpd.org/ [xmms2]: https://github.com/xmms2/wiki/wiki [audacious]: https://audacious-media-player.org/ [luawiki]: https://en.wikipedia.org/wiki/Lua_%28programming_language%29 [imlib2]: https://docs.enlightenment.org/api/imlib2/html/ [cairo]: https://www.cairographics.org/ ## Supporting this project Conky exists only through the hard work of a collection of volunteers. Please consider sponsoring the project's developers if you get value out of Conky. ## Stargazers over time [![Stargazers over time](https://starchart.cc/brndnmtthws/conky.svg)](https://starchart.cc/brndnmtthws/conky) conky-1.12.2/appimage/000077500000000000000000000000001404127277500145145ustar00rootroot00000000000000conky-1.12.2/appimage/build.sh000077500000000000000000000044751404127277500161640ustar00rootroot00000000000000#!/bin/bash set -e set -x # building in temporary directory to keep system clean # use RAM disk if possible (as in: not building on CI system like Travis, and RAM disk is available) if [ "$CI" == "" ] && [ -d /dev/shm ]; then TEMP_BASE=/dev/shm else TEMP_BASE=/tmp fi BUILD_DIR=$(mktemp -d -p "$TEMP_BASE" AppImageLauncher-build-XXXXXX) # make sure to clean up build dir, even if errors occur cleanup () { if [ -d "$BUILD_DIR" ]; then rm -rf "$BUILD_DIR" fi } trap cleanup EXIT # store repo root as variable REPO_ROOT=$(readlink -f $(dirname $(dirname $0))) OLD_CWD=$(readlink -f .) # switch to build dir pushd "$BUILD_DIR" # configure build files with cmake # we need to explicitly set the install prefix, as CMake's default is /usr/local for some reason... cmake \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DRELEASE=ON \ -DBUILD_AUDACIOUS=ON \ -DBUILD_HTTP=ON \ -DBUILD_ICAL=ON \ -DBUILD_ICONV=ON \ -DBUILD_IRC=ON \ -DBUILD_IRC=ON \ -DBUILD_JOURNAL=ON \ -DBUILD_LUA_CAIRO=ON \ -DBUILD_LUA_IMLIB2=ON \ -DBUILD_LUA_RSVG=ON \ -DBUILD_MYSQL=ON \ -DBUILD_NVIDIA=ON \ -DBUILD_PULSEAUDIO=ON \ -DBUILD_RSS=ON \ -DBUILD_WLAN=ON \ -DBUILD_X11=ON \ -DBUILD_XMMS2=ON \ -DCMAKE_INSTALL_PREFIX=/usr \ "$REPO_ROOT" # build project and install files into AppDir make -j4 make install DESTDIR=AppDir wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage # make them executable chmod +x linuxdeploy-x86_64.AppImage ./linuxdeploy-x86_64.AppImage \ --appdir AppDir \ -e AppDir/usr/bin/conky \ -i AppDir/usr/share/icons/hicolor/scalable/apps/conky-logomark-violet.svg \ -d AppDir/usr/share/applications/conky.desktop wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage chmod +x appimagetool-x86_64.AppImage ./appimagetool-x86_64.AppImage AppDir --sign --sign-key E3034071 mv conky*.AppImage "$OLD_CWD" conky-1.12.2/appimage/pubkey.asc000066400000000000000000000075121404127277500165100ustar00rootroot00000000000000-----BEGIN PGP PUBLIC KEY BLOCK----- mQINBFxLIO4BEAClC1XJTegLU2M7rzalhEuNKxXBML0Cvb4URJ66sxpNY9B4JtmC pQZMuULkZ4CnHAgI1Ldv5sgQyq1W15thajZi2U/amh2ullIY7qPTclnIWn2ehbMu SxfVjvrIwv9EpnrzBubM/oqt/hjvl0sms5IHpzXLs97K/a6sMCuxoXEdkOwK9fUq 5q85HV8cHsO7qv/8gnK8Wkit4z0HhnaeRcwuuY301SP53zkMsm8BWJOlubo7Bv0Z +z1aC3J5Ad5Xb5iBuuQJjG2uN+OxpJ0Ya923C2gA4I9EtzVSNdMTy+JRLsRB3lL3 2adHrNcoH2qkos8SgwDdO73loGlt5f2tI3pfsGSPgDGP1hyfNwx5n/NKXqaBds7Q iGB+e4wa3oGwU4cPw6QpmcPggSCDORF2tHw+Yiz6euH+OmdVezLbpmib1VkT/jDV 1y6Aw03Qp1Yt93Fmnk3qfA0MTPE0Kl3TNLIAI2DqS8HU0jt2pReo0wjQBQ2EeOmg WFTNQIpOhPl1uiykHM+9fbIxUCUq+84EKUuxIsSCNL6/byVQ+G3HIjEkhVFIarLL iCKu0AF655eJaMjmC8xkcvS23Je+bmtaV0/MgYPi+nMtDlFO3GDysbrQZ0H24/6v lntaXNXFwicX3l98CSr7oZnn7Em604EnOqeomqu7oE3mSvWCMQSQOL8z0wARAQAB tC1jb25reS1kZXBsb3kta2V5IDxicmVuZGVuK2Nvbmt5QGRpZGR5aW5jLmNvbT6J Ak4EEwEKADgWIQRv1zYcl+cx8aEUIalnLJIM4wNAcQUCXEsg7gIbAwULCQgHAwUV CgkICwUWAgMBAAIeAQIXgAAKCRBnLJIM4wNAcbbxD/0cfp5IUqmvLsehDLOQtpVn 0C60mJYkEItB5n4dbk4O9BhvCZ3Wfk742Cr/QbcEgool+LyhZwb/S1Db+cTM+Fhx ePpn8zBGAhmdJsACOhDq74KaKw/p5lfRqmPqz5s1835VMq/lZ2g1BcAg7arHQ2lm wb51h3UH9GHDHlN0Z/nEwsvJXGXGju6DZ8tM3yWT3YWW4LQxldM7ASvLsOADbVJX CrmXzmYuJ8CmPF1ACR0wL1QDxj0Y30RK7CeQpYNYczhLo/6KPiNO05wn1AsFnDqY DrCIgVPL/Wv/0Qo/YdM2YgePaXC72zr9OSAvHyiu7e5UDt99MGDbFNWgRsi4OSuX mF/aV1JNps2rGZmZqLt4Z4T3HbG1dnW/oKax7n6VDBPU9E2V/D2mYJWntjAe1qpr 67+MuKZLdqCODNsPIbXQ/Ddx+UBvAl2Wibj078MZ+142yXi2V045gBnyfoEKMspc MwZP7XCBqDwPUY9t93MNya5QzS2Mx7zagUrPoJ7g0zhwi8oltrUIEcjCCpqeBSa5 WnZs71x2pdwDc7heCTf6PScY5l0c0gQaruUMMg5m7Gn2t1omX1vOJWYr1oV4V8ET VboDV37mq06W3g4ne8/nAWkdjlVaaIjvNaED1HoS4CZdt4Oyg/jJanEmeUld/NJq eJ4IWX96X6XJY8oEPUk2PIkCMwQQAQoAHRYhBPKJuweqLq/o6RWJemD70SLmKw0w BQJcSyEDAAoJEGD70SLmKw0wOhEP/iu5sOLz3dMOklrhEyshxmYt+JJr4b84DGEO gvf8KjNznpT3xj5IgPtN6gKmJRfL4XlM+CAdYP80IF6ubHaMHsT8yRIHDbO7i+3T Tqmh9vI2pNQJE7nXE3zJguD8RfQICsa6fTt6FZXarO1O+1TGiMg175Y3140P56uK s9dd6Xe9C9u084ri5VgNLcDzRiuh0LOOTEiVL2PWaWz1EOrGUMUDC1b2a7wyhh/H 8Z8Qy/q1V+KtZZKBSQLTitGlSUlqc1qvQmHnq674Fy1ovJZQCJtelgSCa4vcM+ME BsQJJJ5/E+uT4mSdp9cn8rbGEEgifnaot8aSHgQddpdf0WuvAInqTFqmNfFHcnLu wujcMht+FeBp8XqO5FLY2YnGuzlGyUP2fv/HUN1hMc0mLJP60/RdH3PL1zJ0Y2YZ 5GWZtld/qsa+f3pDaRr2y5kNLNUgRq0e9y2zY7fLT2OHlBzNzzlYJIFCNiWoFYI8 XrUuaujpc8oGVGdrU3jT1hIE6kGTx7PUnVaIZUyhHWah83vfzmhcJ8ophUB/fne8 Q72KFGJF4M0NmDhXx+O9MqmFFGhzn7aMi9iH5cfclSs7ys0/PAUBqZx/G1kLB3th adPkChC7K24mCMgLGhhNqlxakbouI8UF1tEdacD1zEjT7N0ArosUb7OSDQaGB2mD LSJKkH7duQINBFxLIO4BEACp1Px9xaVXjGyB/5Ji8I8cQwBNrjVCLJl1gefovRHP 5x8lBbBjZW8ZElSpF3+zxIiUcrCbg76t1jYhi+AjKBDe8b6nQgdCrlc/eh5X8rar H61KZsUt6jNkcB1gfoLbSu57lXOjQnbt42GLnQBp9lLJxXZ5NWB87KSrlKNX/RAc WIY8EPVmsLHXPF6uVn8bDarTf10C+lVcaan+0f+jCAcRr90NOoxgvv12kAEsaifI EbAGEb0xHDwH7aR5i1ssuPLTzg9ByLZRDF8Uxd3Qht4eGoA/jVQhpehSU6Y0/RkD kydk05DA3vqs85C+fXg5YnoSxhCPmtd0I8PFSkWkwh95DN/ClFadReDmY/adb5Nt HiryskJJizFCFXbxPt6KMJUzOQiEoYR/ZH5ajSb5yOmQ2JKrotoax1mKlPW2WwAP lMABA9aEVVF0BibvDypIMhHZ3QR+oHVMi5pl3qUQ5v0LHDI2c2p23RUdQ5UL0W1R KHTAzAbtDTn44SzsNdVOZr9Gc6t3rFmcVnGtI6q0dmfsBE0n+pSjbnMQ+E9KqulS rAAaylWbgNo0NIQgAPvTN4+BHssLuvNjgFdtJJ4fq+oj9OmatiIOD0EBtlnMz43W SlIB9bCY+mfOvoFh01PZ2Hmv/TTR3Va7KXDTIIYqVpX3sBKC5FgiSDWQtGz0UPJ1 gwARAQABiQI2BBgBCgAgFiEEb9c2HJfnMfGhFCGpZyySDOMDQHEFAlxLIO4CGwwA CgkQZyySDOMDQHFsuQ/9FRU5nEylUn6xV8jQ0HfwrPk6F8ZUFtY/gI5fubTlFoPD WkN8SuVXNYsvWG799aZWwTYReUqicRcAEx0+AYxgvAoNiCaDDDNvesum+K9rzw3p hQjazuZucHx9PNRIexnfNpKa2fOUWa+LaHdgEDJ7QUTH1KcUegTqMbTGANf6zGOZ Uvwa7gt8UwSGp4Mqm1rsEBIxdvAunhTgT+coeuJezicEbBF24sgxNhfDzrImlT06 nK4PL0cJHos/VZbvZPwZrktpjnhzEWp5nrpfjI3mEWUoqwblr4BYGxEtp+t0ZB2y 40qVSrl5B3FOmTyA3O1e+ApDnEoFcTn+PPWk8DPKIU1xQdnTwIxUH6MH5ZhgRWDf x1vx66AlBjZf+WEmuclpaeFacmUSRRMtUGuANVCt7HyOvi5NPely9q3PKtqsQGkw yxfAN0UQ0A3BSqydX4t8g8BlairBk6uGD3Y5s8uXLmgBWwKWu6MjOlFvnzVf/XBM m6O9+GFo5k3mj0yp6Y9ZzuBP3HlwWqE/K9hpOy+zeXY4CYZLBrXqh64rKWOw3RoY CdjhfFCYh8amvBGA1xJ7d2yUyb0/0QAsCX2y0L5o+x0MNghB7FiO4i6W8QFx8rix CB3VYjcoC2nWXmh7BEHbx8mp/cL5eldSXhTUFCHY9649tCcN/NdiE3T1J7LMS1c= =Rn5G -----END PGP PUBLIC KEY BLOCK----- conky-1.12.2/appimage/secret.gpg.enc000066400000000000000000000164001404127277500172450ustar00rootroot00000000000000YrAe¥/ð¨Ñ°Ròþ<àÙÜnŠ¡F†¤žh(Ópx2¨O˜0ùyí[§ÉC_gô!¡ƒi«º&F®™ØNzIËM÷ÕÞõªQžEYµþåÞ|Êï‹\a¼G +RZÙ5";¬sòPpRú‚‘ðYn[¨æ§ÓiÐpE‡.fÎßÐÕªH^÷ó×Z'626x.Ë AÄÍ/ËÏc]{biÁ]zU³LFG±…ÂØÐ4Õ&eƧ(hžfX=J‚7ô&y·¨’P U¿ªd3yĆŠ'TÎõÙI0­¸›ÕHš”°Ñš3@ÅåÎ2O¼”N–ÒIå²KV“çøÃ]€w.T05Ô É¡<þ‰ö?¢¯Kä+ì;{¯úËktÞjµÁÂù5ülîâéÆ@õ&ßÕ±âîO7ˆ³žEˆLöoæbÏ8éjSš?öž[0>«‡k5ù45ëšc]Œdwµ—"Û媺çm7[ЧóPøk» S–ƒ= dðÙ ßpzРÊÒ½-–_{ÅZ§;ñ}0’báá³ìW-ì<÷ˆ r÷>ÆÏrñCŒ)ÎV|à öˆF)'^ïàwíçëBL~ýÙ @›¡sºŸrÙ5C²å Ýôb«õ5ˆ9j/þà&)UÏušéú‰ ‚¾Þ§r$ļì#¢½zân_z CqÍȼŒ¥Oüøã†ŸÖçæ½-rШ ¤ mÃAàÝ]Ô#ý GPnÌÙC³¢„tݶL ¹¯uk%wIŽgå@Y÷ ÝCk‘`•ÛŽ.CE’m#ú±eÍâRA lÌèû |0’ÚÊz giEÒ8•¨8,Q†LÀDzåo¬½dýØÔÛ˜ *@–IþÕe-xÞ Êbëô9±ç÷ÊvNÇC,qœ'ïî‹©w½Úóµ}#DùüÞ)òÕø'ÖnÚº}ª +\c¨˜o‡úÿºßÖ`gZªæ6õ5$Ð`?Ìw¥Ääˆ.)“mZò~,2áÍZ,ŒçY²s–~¼|´˜ t¨‰úž1‘ÄOkU[‡MÑë!ȃLbFh·Å¥@柧—å„q"–#œƒÀ•ñ†5lJ’]/¬’Â^H¾X_“Ù´Tö.•…ÉÔµDfCŒ¢«“ÔÛ7«ôƒ¾ÝNd‰qëåuµ¿",Ëd´ùêfRÛÛ %]?âIn›qãºö}9ñ.µá~ J°Äý0ž*åë˜bèËNøÇù»Â†Sú†ÑÏáOgõ÷Ճȗˆêâ0@Á2Ìêœn÷Íf‚Z ±ÆØ"°O?4óʬµU8+{©¿SÈ|Ë]¸…m²BLêô˜}#3渔w+§MÇvtXDÞ÷ r*ã¡‹€<%š“Ói ¯=´iDÓ˜øê‡cc¥×J6Ý€GÊtSÛÅï†n’PºêµNUVS`bÉÿ»LèÔ{} ÏÉ$f‘™'m(N÷F/ߌ¯­`›¶‰¡zg÷㠾ϬbÃ,P…#’ •䙺ÀGų-ïò#”p~ÆfíÞºh_ÙQ´T¶æF’âR'„¿é8ÄÅ•æðÿìn8P•SÌJCd溇l/âò%IÂŒï:Ѻ‡øåõÖ¨ê£É²èaº4íͨy9«%þ>pÃ¨Œ`²ÈŒ0eÚ蔀RfÙùŠé€‡Oúµ¦ï: ]ˆó:߽ܔäÄž§û|9 ì5ûoaÇ÷û6?s.æê‹]9q1Íiÿj#ßpf$y¯*í¼Ï-J±’Õ´K—ò‡q@Uë3G@vïÚ î‘kt¢LÒ~«i©ïà©#JŸž²HƒË ¶Ëcw‚7âèͤ2\Þ&&<þ¸¼ÎYEö9Jø÷®õb3Ê’Ojµù¶˜¤L{C=”N9À³]GqXýœàxkõMÍHàz"ÄÛ¹yÀf TÅ=#…¦á*2¦Úv[È SÆcp¼n,{¼9¸ÇèP[á¦ÆûâKýl'ì¶®6œƒåšðÏxdÑcÿk†vÞG<|bk¹šxÆä ¾€þ5éu×E,<†{H(“çÍ>Szl-ÜÚrîZëÚ—Ï T6D†ôø<_t"ÍT=ÝÁÞJQL mЦ”•öß‹ÿ&Ñ„§DÕ8kŸc9øÕÍÞ¡©;ÅäÖ—h2xô~XP6æJ‡å ÔÈ&^çÞ#ÄŒZâ³fá(pnÏÏ[p{­¯¡èßõT¬òÓ Á Î³ÏòÈ1h\èL¾HU•³5z›zî`΂'é^ Uº¬SPÿ×^?:B#$#  ]DÓåmîR ki¾´µs¿9»ÈLs̰ï©2™œ`óiò¡ÌÛºÉÖ\>²DKhñ~Î)ÙTÝÍ–ÀÄú0Ayx+ð±ê¢÷¼C7 Í= ³üÂÄZås ¤ìÓé¾îb¦²TÜ¥õdø´âüÃå§ÇÚ«².ØÓhý8å’FbûV½1kM‰O¹_87 –ä×÷h d¾]øp"Ž3ݺŒ'}’ý°_ñ¢=ìó%Ï3´èë*xdƒ@ëÔøGJr@–Få÷S:ý;.¿Å.Trãý”ñäëþ=¨ýýEåþ}Î6oaÓ6©Ç2Ž‹s¶¯ybÍ.°¡Ä_NÞ–Y`EÃaqYÏàA©yÂú€@@Í/äRî5Ðø dZ„“¿×ã,ÑLÞ¥àø¦p‰”·Í}ê¿Xµi §çüè’ Ã<ªž=ƒã÷Ò½3Ç/>´*D߇"§tõœo)C=öÊPÊ·y´Õü"Ed‡4Òdžº  º¡òRФöµOâü.—Å4]æL Ô?8iõ« 6Öw¯kÞÒR$ç&ì©TîzB²¾)äÃ)&×ëK\ܘ=Ô÷÷õXÓ”ö#ñÉYŽEUò¤|op¡‹òýÀœwîÈ—§+Åì" /™ÌQž1g1âºT^@fÿÀ]ù NH÷´é[leŸÚyLÞꋇ[3 ò¤i9Âh”Mì¦ÒŠa”où¤¶÷QÃn[ÁétÔWº)J”Kn”'ÖŠt<&O‡€!µµu‹>$˜bŽù˜º(ì™Ù^Ì#%|YåD^|§?«4`ß«,&‘’¦å,»25e]»M¬£lu]ìtç° Ee+œªY{·%O)Rº?ÒqÔmBB+ŸeÕª«ƒ „ ¡¼í ¾9lj:­ÏdøƒÜɹ"šú}„E× ×.=pˆèJŽÃsÉeF“eíù}IO6»½W߯—.®¨å°¼€r ¸ÔtØË–(£ºÕÚÊá°%¦O‡,Æ6rpߌYåû½zúùÖiÙíÆèyÛ~C •ϼy„ßb·M;wÑðeò¦÷£&¤~Z’]`“]<@f9בŊ˺òÛKþò6¿³ítGA¯É?ó†GþÕ+_­ÙÞ .Mú8[’Οƒë  ZÕwfäZ6¦½I½¶âTC.3ŸÕzsè~ÞèµYßh§‰)oÍù­GàrÈÜ ÿ `àRsñ¸#¿é°¾e8~ üÇ•~Eõ§Áì!šNè±ÅdI²]fvRg§±Ýñ[å4«¶‘÷6sÊॄõNlÜ$…ØV?î&âæÕÇm–0žé¡J,gÓè?Í; øÀQMe")­·.åjÎGR¿ÀˆŸð¸( 8C©õ]-)(‘Ü.úù½?™G¿Û’-r€c ÙÖâý«ë úeÛ‡ãF7”#m0ÀlGÊ:Ò–+¿ÏØë ÙY¿½ÅÂîÕÄ?"ú‹§Ám^å_dðx•0_h|Ëyó®¥)“œž»ýPULK'¦‡‘ |Žñ/²“:dóïÑ“²µ>Y_Íá0³jÚP]¯Ð&ÚõßS$úF°2†ó0<ÜÒÆñû 9<\XÐí$%Á!;›àÓL¯X¯øi@\æ%ÑÚŸß~oãòE%'b§;o4T$Gö¸èAvé& âE³Ÿ]k}*}âAåÌ*–@ yZ¦“C’bÊ)­mã²eÖß zñYV•õ„´Œ)fRËë~8‰[‚äüÉ7ôš•3´%Ê#¢à£ YF¬P%ùТ?ˆoú…„z¸ÏVöå(sÇ×E?›Þ¬ÔŸxXíyCÞÚ±ƒçµ&zù¦zö_`Hظa:@“ÒL^Ž(®\8î| › 8¯>°Õ˜Øf–Î?P<éþŽlONæAÅd@ÔTŒà±(ÏHa*{ˆß4ªÜÏ ä­/~_¾!¹Ô)îY¸Ôqƒ¿šÿo;>iV ôܯm3ÞØÙ3éu¦ Û0 Ü5.⢄Y€+” l^æ"½d ‰8.ü2ŸDgUÍÔ®=‚xH‚£’f™ÄLçDÖ®Óóm•2ÚÝ—ýÐøÀ; Ûõ×ëB/ÊøTﳓáYQ•c!†š±œ/*!¸ÂKA1÷xÖ+ðnÞ¬.e'HgÖ)玽ˆu›û 4 ›å4-ÞdQ+ãáøoŒŽHg§0“Šq~ÓaÑtƒóµî–D?G¤¹5&Úx2̼‹c“y3B¾ñæSÌ>òû¤Ò{!À(•iëÙšÑÏ·w]Ê%ŸÐ¦È™Îç¶éðß÷ys¢îšFó/£¡0% Úd Vi¶ÞˆkMlÒ«Iéy©/+ö&IÇP‹?Uø3õ€Ì´½j¦½F³ÆgJkªú“ñ&d†ÐÎ[Ôp]B¾Þ첎†oháÙERéiy¯ %Ø&Ë®™îC“é["*›e \áÏw93+pV^3É9G’!¸Õ> }40÷Þ¯ºHþ‡‡ý¯Y…ëñÒŸlQŠC(”€,±Ìjš—2³cÐñëqS4(•Šh.“w,'J¬f„AqZnOz=Œ àº8 'X`Qõ]ío0øv¡ðôiVq‡¿ï3 Ÿ¦s@f5_¸´–œÅ#>*Ññøá럊µ<íã°±µ^©˜=ÃÞ•?üßDU 0œdlŠÂgM Ý ·=(Cv<ÈN$M„â`dÚ?ž¿òªr?ÊxO±òd˜öjŸ®!áÈw°h:‰ÚP0 N0BšÖ±hš'äl•ÜçļX€õY›hÌÏÝcWÚúÄGʘXŒí©Äã›U¸ö,ûÞûÍôs÷·::b’ãkýM%|­9µ©ˆŠGKçYÙcÝ'¿SFDÙÄÅ S‘×CÔ¨ð²i¸ç£¶˜Îu*ØÚnˆhÑ—ÀŽHþ?¡ÔÄо°§z¼µú®®ÿ°ÇwŽðñøÂòÆ'\}Žü3è.ÇÏkò‰ÂÎÖ/g˜r”XóÐ)¹c~Wuá—Ñzè\>*°mQ<§$v«¢;O£äœ D=¯HîÎX˜rVË•uÿð@`zT¬å€žîøyoQ7h;µ*M…”3þ'¦Z“¦tÂËhm6.¡É–Fþ,ϯNFÁ³C ÅÔc[fo’üE³A—ÐÕ0}"'pÜRâ8´“cþú-fU6‚µó%;èu”£V(ƽXNE¦JŒÚ5ïrs-ëñ2É%(h%󿉆šàú^I5¦”ªØn'¯@ñ„´AKéo2G/ì+#Ÿ#J· Jq|Wí Ĥ¡ð.ÔµK°‡èd? ªzèº;ßåuK*¯Œ#;ó‰ƒSkê8ç´Ò]Ôµè¬hÃÜf‡ ¶C¨½]5¬¡Ì8‘§§I —cúÓ]e÷Í`ÓIlÔ'SS‚íšÞš÷füƒÖæ ²ý­n'é7á— ÒWki”p^'äÕ{§¢Ho“f£ûfg("ƒÔ²MŠGÝfTN–mÙÔ†yR>kd¶yÇB¤È¾ }»M¸ZxðƘóµp6Ê{{$ùY2fX ¸¦øŠÈ³FÎÃJ>¼Œýr©_ާ pâ&¢G{ËLžºöõ»FÛd§R·Vô©çLd|+ì=!cÛ¾l½cñp7æ²Ñÿ3EyljnÇÎÝ¡îLk¦ æ_åÙî(âNs"{WBgµâþÒ¸d?¯Z´ÚÔ¢’/Íh¹ã§Dbd?„5ÔÙA%ö>@H1ºèP;£†ãí™h“¾»ˆ:¥ïìe@;)öуm7?¦kGs:“ˆÀ¢mg%) ®%%4ŸëÔ@±Ð7w‘a b¡/{Þ\…ç%n€vª¶³Ova{îÄ`ÈñÑÞôËU½¡gB%šV1·XÏ™òÒ_r«éhë$÷=£?›lœS$‚eúLA¡-ýBâ³K²¢öv5:Õè 7äwÔ¤×ë•Ðù÷f&L¾£¦5$X°â® jµ"Ÿ)?í^³ðä×Ob_5lœÆðŠDËÃ;ÕKîסsLr r5Ö ç!æ:+DêÚ¦é‰fR•"‡õë1é̸®{¼©.K.,I -ærSZÄW£aÈÜ6‘AÑ µPæTWÜ NÏd‡Á™&'ŸÔá­CVŽSðÚŒgå¶ŒšðñÚÐ4~7@û‡ h6yüþ‘àãßp^T’ÀøP1ª¿—ñ;—èP î¾&8ºK¾_öwµ`k—6Q)N®k»ìîÀ2~jœ¯(|WóRcýU£ž¼Cm²q‡ù–üÎA.é×ñ …mèíZƬ_0å°(ŸôÌÉåÊY!¼hæ.§DÀE;÷’ª vÈVPÚ¯tÝìõûè™ã"ÖÛ“ò34u Äáþ=šn`?Ä‘¿ÕXŸ©–.Þ^º-Q7ʾ·þ¢²UÿwÙ’CíLTU+$™Y4@s†ì?q“ª+y-‹*ý"Šúç›önÉêŽö\²Ž`£QΩÅÐäÔò\KoåfTÌZo÷ÕŸØúéÚÅ€¥'‰Pjª¡Ò§[…ÊLãу Õå¥Jèà²Ðñ÷ÛÙÜK_Ë ¹Ä²Ñ]BHË”Ê ª$£Å½jjh ì,ª¿ο®9JGÀÕñé›>ßF9„~¸•ž Q†ÛhF›Æ,€Üר[ßÀTP+Û9Êà Ã=øÐXM7øVÃì\YL ±Î"6D¤ÔÁ1ôÒÀt¼¾O¶9º€Ô®§ÿwÁ¤‘º q§È†~ØÝVoÅÛI•¿‰òDNò³¿}µØ!ú>vÅ_‚ƒ·‹3áÖ˜¸9 [Ú'Æ€œî„ta¬õL—6 så6þí´¡±Št¢éÕUŽ|(?”àöÍ5ö{Õ«G™PéLº‚þ†p|ßözMG bÕ-”{ƒ,–65 ͬŒ3m“ JmÖw.øˆÌ¥æ8¤”Ц=²0„9¯Õvœu‰\Q)(˜YpV°ü#žÉÉ×a€-<}D³®Á«‡jg†î0·Nº×e/ÝRñ$Ã(V4håû«š? Wiñ´‹7“…zC Ó·R?XA îP攆;WŠaÄÆ›V\3ˆì¥ÂX+ÿÃ| 0É¢ølçzÀ°¸®Ý¡÷+”N}KrX{+/¿D?f¾5†5PÎ^jÝVx†"®àß«¾ ZR¤°•Gå~•žÏ¹pgÊ/ÎͤÜlÚpcè4€.;EÿJ…ÂE׬ÇvEv™U¤?\l|Yÿ‘Ü„ð w"9Èî„ým]ñ#‘;`/Äã9ÐÒöÒ=7.Å£ŽQêѸX#Û1}Ÿ‡ÿ–[â!}®'µ1w38Of$ŽPŠÏC>§,Àé{Ú5—ùüëþW¨\ˆÐa¼•SOs·ÀƒÓÙÚPUõËëÆJþVþ­—9áü›”RG»Ê3ÕOï½X@fû` ˜éØèÂÕX¬·Á€õË!¦V?êñå™}®Ä•hþr¹­Á¤¡½’œù‡?_QÕ²ô{hD{š‘#{ìconky-1.12.2/bin/000077500000000000000000000000001404127277500135015ustar00rootroot00000000000000conky-1.12.2/bin/changelog2html.py000077500000000000000000000012561404127277500167600ustar00rootroot00000000000000#!/usr/bin/env python import sys if len(sys.argv) <= 1: print >> sys.stderr, "Usage: ./changelog2html.py [changelog file]" sys.exit(1) f = sys.argv[1] blah = 0 print '' for i in open(f).read().splitlines(): # ignore empty lines if i and i[0].isspace(): if not '*' in i: print ' ' + i.strip() else: s = i.split('*', 1)[1].strip() print '
  • ' + s.replace('<', '<').replace('>', '>') else: if blah: print '' print '

    %s

    ' % i.strip() print '
      ' blah = 1 if blah: print '
    ' print '' conky-1.12.2/bin/check-style.sh000077500000000000000000000005721404127277500162570ustar00rootroot00000000000000#!/bin/bash set -euxo pipefail DIR="$( dirname "${BASH_SOURCE[0]}" )" # Run clang-tidy only for the lines of code which have changed. git diff -U0 $TRAVIS_COMMIT_RANGE | \ $DIR/clang-tidy-diff.py -p1 \ -checks=*,-clang-analyzer-alpha.* \ -quiet \ -- \ -warnings-as-errors=*,-clang-analyzer-alpha.* \ -format-style='{BasedOnStyle: google, IndentWidth: 2}' conky-1.12.2/bin/check_docs.py000077500000000000000000000156101404127277500161460ustar00rootroot00000000000000#!/usr/bin/python # # This script will check the documentation consistency against the code. It # doesn't check the actual accuracy of the documentation, it just ensures that # everything is documented and that nothing which doesn't exist in Conky # appears in the documentation. # # This script also updates the vim and nano syntax files so it doesn't have to # be done manually. # # Requires the ElementTree Python module for the sorting stuff, see: # http://effbot.org/zone/element-index.htm # # You should also install htmltidy, but it's not necessary. # import os.path import re import sys import mmap from datetime import * file_names = dict() file_names["text_objects"] = "src/text_object.h" file_names["conky"] = "src/conky.c" file_names["vim_syntax"] = "extras/vim/syntax/conkyrc.vim" file_names["nano_syntax"] = "extras/nano/conky.nanorc" file_names["variables"] = "doc/variables.xml" file_names["config_settings"] = "doc/config_settings.xml" file_names["lua"] = "doc/lua.xml" file_names["docs"] = "doc/docs.xml" file_names["command_options"] = "doc/command_options.xml" for fn in file_names.values(): if not os.path.exists(fn) or not os.path.isfile(fn): print "'%s' doesn't exist, or isn't a file" % (fn) exit(1) print 'sorting/tidying docs...' # sort the docs by variable/config setting import string import xml.etree.ElementTree as ET vars_xml = ET.parse(file_names['variables']) config_xml = ET.parse(file_names['config_settings']) getkey = lambda x: x.findtext('term/command/option') vars = vars_xml.getroot() vars[:] = sorted(vars, key=getkey) configs = config_xml.getroot() configs[:] = sorted(configs, key=getkey) vars_xml.write(file_names['variables']) config_xml.write(file_names['config_settings']) def tidy(file): command = ['tidy', '-qim', '-xml', '-utf8', '--indent-spaces', '4'] os.system('%s %s 2>/dev/null' % (string.join(command), file)) tidy(file_names['variables']) tidy(file_names['config_settings']) tidy(file_names['lua']) tidy(file_names['command_options']) # # Do all the objects first # objects = [] file = open(file_names["text_objects"], "r") exp = re.compile("\s*OBJ_(\w*).*") while file: line = file.readline() if len(line) == 0: break res = exp.match(line) if res: obj = res.group(1) if not re.match("color\d", obj) and obj != "text": # ignore colourN stuff objects.append(res.group(1)) file.close() print 'counted %i text objects' % len(objects) doc_objects = [] exp = re.compile("\s*.*") print "checking docs -> objs consistency (in %s)" % (file_names["text_objects"]) for var in vars: term = getkey(var) doc_objects.append(term) if ['templaten', 'colorn'].count(doc_objects[len(doc_objects) - 1].lower()): # ignore these continue if doc_objects[len(doc_objects) - 1] not in objects: print " '%s' is documented, but doesn't seem to be an object" % (doc_objects[len(doc_objects) - 1]) print "done\n" print "checking objs -> docs consistency (in %s)" % (file_names["variables"]) for obj in objects: if obj not in doc_objects: print " '%s' seems to be undocumented" % (obj) print "done\n" # # Now we'll do config settings # config_entries = [] file = open(file_names["conky"], "r") exp1 = re.compile('\s*CONF\("(\w*)".*') exp2 = re.compile('\s*CONF2\("(\w*)".*') exp3 = re.compile('\s*CONF3\("(\w*)".*') while file: line = file.readline() if len(line) == 0: break res = exp1.match(line) if not res: res = exp2.match(line) if not res: res = exp3.match(line) if res: conf = res.group(1) if re.match("color\d", conf): conf = "colorN" if config_entries.count(conf) == 0: config_entries.append(conf) file.close() print 'counted %i config settings' % len(config_entries) doc_configs = [] print "checking docs -> configs consistency (in %s)" % (file_names["conky"]) for config in configs: term = getkey(config) doc_configs.append(term) if ['text', 'templaten'].count(doc_configs[len(doc_configs) - 1].lower()): # ignore these continue if doc_configs[len(doc_configs) - 1] not in config_entries: print " '%s' is documented, but doesn't seem to be a config setting" % (doc_configs[len(doc_configs) - 1]) print "done\n" print "checking configs -> docs consistency (in %s)" % (file_names["config_settings"]) for obj in config_entries: if obj != "text" and obj != "template" and obj not in doc_configs: print " '%s' seems to be undocumented" % (obj) print "done\n" # Cheat and add the colour/template stuff. for i in range(0, 10): objects.append("color" + str(i)) config_entries.append("color" + str(i)) objects.append("template" + str(i)) config_entries.append("template" + str(i)) # Finally, sort everything. objects.sort() config_entries.sort() # # Update nano syntax stuff # print "updating nano syntax...", sys.stdout.flush() file = open(file_names["nano_syntax"], "rw+") lines = [] while file: line = file.readline() if len(line) == 0: break lines.append(line) # find the line we want to update for line in lines: if re.match("color green ", line): idx = lines.index(line) lines.pop(idx) # remove old line line = 'color green "\<(' for obj in config_entries: line += "%s|" % (obj) line = line[:len(line) - 1] line += ')\>"\n' lines.insert(idx, line) if re.match("color brightblue ", line): idx = lines.index(line) lines.pop(idx) # remove old line line = 'color brightblue "\<(' for obj in objects: line += "%s|" % (obj) line = line[:len(line) - 1] line += ')\>"\n' lines.insert(idx, line) break # want to ignore everything after this line file.truncate(0) file.seek(0) file.writelines(lines) file.close() print "done." # # Update vim syntax stuff # print "updating vim syntax...", sys.stdout.flush() file = open(file_names["vim_syntax"], "rw+") lines = [] while file: line = file.readline() if len(line) == 0: break lines.append(line) # find the line we want to update for line in lines: if re.match("syn keyword ConkyrcSetting ", line): idx = lines.index(line) lines.pop(idx) # remove old line line = 'syn keyword ConkyrcSetting ' for obj in config_entries: line += "%s " % (obj) line = line[:len(line) - 1] line += '\n' lines.insert(idx, line) if re.match("syn keyword ConkyrcVarName contained nextgroup=ConkyrcNumber,ConkyrcColour skipwhite ", line): idx = lines.index(line) lines.pop(idx) # remove old line line = 'syn keyword ConkyrcVarName contained nextgroup=ConkyrcNumber,ConkyrcColour skipwhite ' for obj in objects: line += "%s " % (obj) line = line[:len(line) - 1] line += '\n' lines.insert(idx, line) break # want to ignore everything after this line file.truncate(0) file.seek(0) file.writelines(lines) file.close() # lastly, update the date in docs.xml file = open(file_names["docs"], 'r+') map = mmap.mmap(file.fileno(), os.path.getsize(file_names["docs"])) d = map.find("") d += 6 # skip over first date stuff map[d:d+10] = datetime.now().strftime("%F") map.close() file.close() print "done." conky-1.12.2/bin/clang-tidy-diff.py000077500000000000000000000122071404127277500170210ustar00rootroot00000000000000#!/usr/bin/env python3 # #===- clang-tidy-diff.py - ClangTidy Diff Checker ------------*- python -*--===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===------------------------------------------------------------------------===# r""" ClangTidy Diff Checker ====================== This script reads input from a unified diff, runs clang-tidy on all changed files and outputs clang-tidy warnings in changed lines only. This is useful to detect clang-tidy regressions in the lines touched by a specific patch. Example usage for git/svn users: git diff -U0 HEAD^ | clang-tidy-diff.py -p1 svn diff --diff-cmd=diff -x-U0 | \ clang-tidy-diff.py -fix -checks=-*,modernize-use-override """ import argparse import json import re import subprocess import sys def main(): parser = argparse.ArgumentParser(description= 'Run clang-tidy against changed files, and ' 'output diagnostics only for modified ' 'lines.') parser.add_argument('-clang-tidy-binary', metavar='PATH', default='clang-tidy', help='path to clang-tidy binary') parser.add_argument('-p', metavar='NUM', default=0, help='strip the smallest prefix containing P slashes') parser.add_argument('-regex', metavar='PATTERN', default=None, help='custom pattern selecting file paths to check ' '(case sensitive, overrides -iregex)') parser.add_argument('-iregex', metavar='PATTERN', default= r'.*\.(cpp|cc|c\+\+|cxx|c|cl|h|hpp|m|mm|inc)', help='custom pattern selecting file paths to check ' '(case insensitive, overridden by -regex)') parser.add_argument('-fix', action='store_true', default=False, help='apply suggested fixes') parser.add_argument('-checks', help='checks filter, when not specified, use clang-tidy ' 'default', default='') parser.add_argument('-format-style', help='style format', default='') parser.add_argument('-path', dest='build_path', help='Path used to read a compile command database.') parser.add_argument('-extra-arg', dest='extra_arg', action='append', default=[], help='Additional argument to append to the compiler ' 'command line.') parser.add_argument('-extra-arg-before', dest='extra_arg_before', action='append', default=[], help='Additional argument to prepend to the compiler ' 'command line.') parser.add_argument('-quiet', action='store_true', default=False, help='Run clang-tidy in quiet mode') clang_tidy_args = [] argv = sys.argv[1:] if '--' in argv: clang_tidy_args.extend(argv[argv.index('--'):]) argv = argv[:argv.index('--')] args = parser.parse_args(argv) # Extract changed lines for each file. filename = None lines_by_file = {} for line in sys.stdin: match = re.search('^\+\+\+\ \"?(.*?/){%s}([^ \t\n\"]*)' % args.p, line) if match: filename = match.group(2) if filename == None: continue if args.regex is not None: if not re.match('^%s$' % args.regex, filename): continue else: if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE): continue match = re.search('^@@.*\+(\d+)(,(\d+))?', line) if match: start_line = int(match.group(1)) line_count = 1 if match.group(3): line_count = int(match.group(3)) if line_count == 0: continue end_line = start_line + line_count - 1; lines_by_file.setdefault(filename, []).append([start_line, end_line]) if len(lines_by_file) == 0: print("No relevant changes found.") sys.exit(0) line_filter_json = json.dumps( [{"name" : name, "lines" : lines_by_file[name]} for name in lines_by_file], separators = (',', ':')) quote = ""; if sys.platform == 'win32': line_filter_json=re.sub(r'"', r'"""', line_filter_json) else: quote = "'"; # Run clang-tidy on files containing changes. command = [args.clang_tidy_binary] command.append('-line-filter=' + quote + line_filter_json + quote) if args.fix: command.append('-fix') if args.checks != '': command.append('-checks=' + quote + args.checks + quote) if args.format_style != '': command.append('-format-style=' + quote + args.format_style + quote) if args.quiet: command.append('-quiet') if args.build_path is not None: command.append('-p=%s' % args.build_path) command.extend(lines_by_file.keys()) for arg in args.extra_arg: command.append('-extra-arg=%s' % arg) for arg in args.extra_arg_before: command.append('-extra-arg-before=%s' % arg) command.extend(clang_tidy_args) sys.exit(subprocess.call(' '.join(command), shell=True)) if __name__ == '__main__': main() conky-1.12.2/bin/run-clang-format.py000077500000000000000000000234111404127277500172330ustar00rootroot00000000000000#!/usr/bin/env python3 """A wrapper script around clang-format, suitable for linting multiple files and to use for continuous integration. This is an alternative API for the clang-format command line. It runs over multiple files and directories in parallel. A diff output is produced and a sensible exit code is returned. Source: https://raw.githubusercontent.com/Sarcasm/run-clang-format/master/run-clang-format.py """ from __future__ import print_function, unicode_literals import argparse import codecs import difflib import fnmatch import io import multiprocessing import os import signal import subprocess import sys import traceback from functools import partial DEFAULT_EXTENSIONS = 'c,h,C,H,cpp,hpp,cc,hh,c++,h++,cxx,hxx' class ExitStatus: SUCCESS = 0 DIFF = 1 TROUBLE = 2 def list_files(files, recursive=False, extensions=None, exclude=None): if extensions is None: extensions = [] if exclude is None: exclude = [] out = [] for file in files: if recursive and os.path.isdir(file): for dirpath, dnames, fnames in os.walk(file): fpaths = [os.path.join(dirpath, fname) for fname in fnames] for pattern in exclude: # os.walk() supports trimming down the dnames list # by modifying it in-place, # to avoid unnecessary directory listings. dnames[:] = [ x for x in dnames if not fnmatch.fnmatch(os.path.join(dirpath, x), pattern) ] fpaths = [ x for x in fpaths if not fnmatch.fnmatch(x, pattern) ] for f in fpaths: ext = os.path.splitext(f)[1][1:] if ext in extensions: out.append(f) else: out.append(file) return out def make_diff(file, original, reformatted): return list( difflib.unified_diff( original, reformatted, fromfile='{}\t(original)'.format(file), tofile='{}\t(reformatted)'.format(file), n=3)) class DiffError(Exception): def __init__(self, message, errs=None): super(DiffError, self).__init__(message) self.errs = errs or [] class UnexpectedError(Exception): def __init__(self, message, exc=None): super(UnexpectedError, self).__init__(message) self.formatted_traceback = traceback.format_exc() self.exc = exc def run_clang_format_diff_wrapper(args, file): try: ret = run_clang_format_diff(args, file) return ret except DiffError: raise except Exception as e: raise UnexpectedError('{}: {}: {}'.format(file, e.__class__.__name__, e), e) def run_clang_format_diff(args, file): try: with io.open(file, 'r', encoding='utf-8') as f: original = f.readlines() except IOError as exc: raise DiffError(str(exc)) invocation = [args.clang_format_executable, file] # Use of utf-8 to decode the process output. # # Hopefully, this is the correct thing to do. # # It's done due to the following assumptions (which may be incorrect): # - clang-format will returns the bytes read from the files as-is, # without conversion, and it is already assumed that the files use utf-8. # - if the diagnostics were internationalized, they would use utf-8: # > Adding Translations to Clang # > # > Not possible yet! # > Diagnostic strings should be written in UTF-8, # > the client can translate to the relevant code page if needed. # > Each translation completely replaces the format string # > for the diagnostic. # > -- http://clang.llvm.org/docs/InternalsManual.html#internals-diag-translation # # It's not pretty, due to Python 2 & 3 compatibility. encoding_py3 = {} if sys.version_info[0] >= 3: encoding_py3['encoding'] = 'utf-8' try: proc = subprocess.Popen( invocation, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, **encoding_py3) except OSError as exc: raise DiffError(str(exc)) proc_stdout = proc.stdout proc_stderr = proc.stderr if sys.version_info[0] < 3: # make the pipes compatible with Python 3, # reading lines should output unicode encoding = 'utf-8' proc_stdout = codecs.getreader(encoding)(proc_stdout) proc_stderr = codecs.getreader(encoding)(proc_stderr) # hopefully the stderr pipe won't get full and block the process outs = list(proc_stdout.readlines()) errs = list(proc_stderr.readlines()) proc.wait() if proc.returncode: raise DiffError("clang-format exited with status {}: '{}'".format( proc.returncode, file), errs) return make_diff(file, original, outs), errs def bold_red(s): return '\x1b[1m\x1b[31m' + s + '\x1b[0m' def colorize(diff_lines): def bold(s): return '\x1b[1m' + s + '\x1b[0m' def cyan(s): return '\x1b[36m' + s + '\x1b[0m' def green(s): return '\x1b[32m' + s + '\x1b[0m' def red(s): return '\x1b[31m' + s + '\x1b[0m' for line in diff_lines: if line[:4] in ['--- ', '+++ ']: yield bold(line) elif line.startswith('@@ '): yield cyan(line) elif line.startswith('+'): yield green(line) elif line.startswith('-'): yield red(line) else: yield line def print_diff(diff_lines, use_color): if use_color: diff_lines = colorize(diff_lines) if sys.version_info[0] < 3: sys.stdout.writelines((l.encode('utf-8') for l in diff_lines)) else: sys.stdout.writelines(diff_lines) def print_trouble(prog, message, use_colors): error_text = 'error:' if use_colors: error_text = bold_red(error_text) print("{}: {} {}".format(prog, error_text, message), file=sys.stderr) def main(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument( '--clang-format-executable', metavar='EXECUTABLE', help='path to the clang-format executable', default='clang-format') parser.add_argument( '--extensions', help='comma separated list of file extensions (default: {})'.format( DEFAULT_EXTENSIONS), default=DEFAULT_EXTENSIONS) parser.add_argument( '-r', '--recursive', action='store_true', help='run recursively over directories') parser.add_argument('files', metavar='file', nargs='+') parser.add_argument( '-q', '--quiet', action='store_true') parser.add_argument( '-j', metavar='N', type=int, default=0, help='run N clang-format jobs in parallel' ' (default number of cpus + 1)') parser.add_argument( '--color', default='auto', choices=['auto', 'always', 'never'], help='show colored diff (default: auto)') parser.add_argument( '-e', '--exclude', metavar='PATTERN', action='append', default=[], help='exclude paths matching the given glob-like pattern(s)' ' from recursive search') args = parser.parse_args() # use default signal handling, like diff return SIGINT value on ^C # https://bugs.python.org/issue14229#msg156446 signal.signal(signal.SIGINT, signal.SIG_DFL) try: signal.SIGPIPE except AttributeError: # compatibility, SIGPIPE does not exist on Windows pass else: signal.signal(signal.SIGPIPE, signal.SIG_DFL) colored_stdout = False colored_stderr = False if args.color == 'always': colored_stdout = True colored_stderr = True elif args.color == 'auto': colored_stdout = sys.stdout.isatty() colored_stderr = sys.stderr.isatty() retcode = ExitStatus.SUCCESS files = list_files( args.files, recursive=args.recursive, exclude=args.exclude, extensions=args.extensions.split(',')) if not files: return njobs = args.j if njobs == 0: njobs = multiprocessing.cpu_count() + 1 njobs = min(len(files), njobs) if njobs == 1: # execute directly instead of in a pool, # less overhead, simpler stacktraces it = (run_clang_format_diff_wrapper(args, file) for file in files) pool = None else: pool = multiprocessing.Pool(njobs) it = pool.imap_unordered( partial(run_clang_format_diff_wrapper, args), files) while True: try: outs, errs = next(it) except StopIteration: break except DiffError as e: print_trouble(parser.prog, str(e), use_colors=colored_stderr) retcode = ExitStatus.TROUBLE sys.stderr.writelines(e.errs) except UnexpectedError as e: print_trouble(parser.prog, str(e), use_colors=colored_stderr) sys.stderr.write(e.formatted_traceback) retcode = ExitStatus.TROUBLE # stop at the first unexpected error, # something could be very wrong, # don't process all files unnecessarily if pool: pool.terminate() break else: sys.stderr.writelines(errs) if outs == []: continue if not args.quiet: print_diff(outs, use_color=colored_stdout) if retcode == ExitStatus.SUCCESS: retcode = ExitStatus.DIFF return retcode if __name__ == '__main__': sys.exit(main()) conky-1.12.2/bin/text2c.sh000077500000000000000000000024501404127277500152520ustar00rootroot00000000000000#!/bin/sh # # text2c.sh - convert a text file to C code # # Copyright (C) 2008 Phil Sutter # # 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 3 of the License, or (at your option) # any later version. # # 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. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # Invocation is as follows: # $1: text file # $2: output file # $3: name of variable # # The output will be a char **, with each field containing a single line of $1. # Additionally, a macro with the name print_$3 will be defined, with acts as # a parameter-less function, printing the text to stdout. [ $# -eq 3 ] || { echo "Usage: `basename $0` " exit 1 } outupper="`basename "$2" | tr '[a-z-.]' '[A-Z__]'`" ( printf "const char %s[] = \n" "$3" sed -e 's/["\]/\\&/g' -e 's/^/ "/' -e 's/$/\\n"/' -e '$s/$/;/' "$1" ) > "$2" conky-1.12.2/cmake/000077500000000000000000000000001404127277500140115ustar00rootroot00000000000000conky-1.12.2/cmake/Catch.cmake000066400000000000000000000164051404127277500160430ustar00rootroot00000000000000# Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. #[=======================================================================[.rst: Catch ----- This module defines a function to help use the Catch test framework. The :command:`catch_discover_tests` discovers tests by asking the compiled test executable to enumerate its tests. This does not require CMake to be re-run when tests change. However, it may not work in a cross-compiling environment, and setting test properties is less convenient. This command is intended to replace use of :command:`add_test` to register tests, and will create a separate CTest test for each Catch test case. Note that this is in some cases less efficient, as common set-up and tear-down logic cannot be shared by multiple test cases executing in the same instance. However, it provides more fine-grained pass/fail information to CTest, which is usually considered as more beneficial. By default, the CTest test name is the same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``. .. command:: catch_discover_tests Automatically add tests with CTest by querying the compiled test executable for available tests:: catch_discover_tests(target [TEST_SPEC arg1...] [EXTRA_ARGS arg1...] [WORKING_DIRECTORY dir] [TEST_PREFIX prefix] [TEST_SUFFIX suffix] [PROPERTIES name1 value1...] [TEST_LIST var] ) ``catch_discover_tests`` sets up a post-build command on the test executable that generates the list of tests by parsing the output from running the test with the ``--list-test-names-only`` argument. This ensures that the full list of tests is obtained. Since test discovery occurs at build time, it is not necessary to re-run CMake when the list of tests changes. However, it requires that :prop_tgt:`CROSSCOMPILING_EMULATOR` is properly set in order to function in a cross-compiling environment. Additionally, setting properties on tests is somewhat less convenient, since the tests are not available at CMake time. Additional test properties may be assigned to the set of tests as a whole using the ``PROPERTIES`` option. If more fine-grained test control is needed, custom content may be provided through an external CTest script using the :prop_dir:`TEST_INCLUDE_FILES` directory property. The set of discovered tests is made accessible to such a script via the ``_TESTS`` variable. The options are: ``target`` Specifies the Catch executable, which must be a known CMake executable target. CMake will substitute the location of the built executable when running the test. ``TEST_SPEC arg1...`` Specifies test cases, wildcarded test cases, tags and tag expressions to pass to the Catch executable with the ``--list-test-names-only`` argument. ``EXTRA_ARGS arg1...`` Any extra arguments to pass on the command line to each test case. ``WORKING_DIRECTORY dir`` Specifies the directory in which to run the discovered test cases. If this option is not provided, the current binary directory is used. ``TEST_PREFIX prefix`` Specifies a ``prefix`` to be prepended to the name of each discovered test case. This can be useful when the same test executable is being used in multiple calls to ``catch_discover_tests()`` but with different ``TEST_SPEC`` or ``EXTRA_ARGS``. ``TEST_SUFFIX suffix`` Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may be specified. ``PROPERTIES name1 value1...`` Specifies additional properties to be set on all tests discovered by this invocation of ``catch_discover_tests``. ``TEST_LIST var`` Make the list of tests available in the variable ``var``, rather than the default ``_TESTS``. This can be useful when the same test executable is being used in multiple calls to ``catch_discover_tests()``. Note that this variable is only available in CTest. #]=======================================================================] # ------------------------------------------------------------------------------ function(catch_discover_tests TARGET) cmake_parse_arguments("" "" "TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST" "TEST_SPEC;EXTRA_ARGS;PROPERTIES" ${ARGN}) if(NOT _WORKING_DIRECTORY) set(_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") endif() if(NOT _TEST_LIST) set(_TEST_LIST ${TARGET}_TESTS) endif() # Generate a unique name based on the extra arguments string(SHA1 args_hash "${_TEST_SPEC} ${_EXTRA_ARGS}") string(SUBSTRING ${args_hash} 0 7 args_hash) # Define rule to generate test list for aforementioned test executable set(ctest_include_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_include-${args_hash}.cmake") set(ctest_tests_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_tests-${args_hash}.cmake") get_property(crosscompiling_emulator TARGET ${TARGET} PROPERTY CROSSCOMPILING_EMULATOR) add_custom_command(TARGET ${TARGET} POST_BUILD BYPRODUCTS "${ctest_tests_file}" COMMAND "${CMAKE_COMMAND}" -D "TEST_TARGET=${TARGET}" -D "TEST_EXECUTABLE=$" -D "TEST_EXECUTOR=${crosscompiling_emulator}" -D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}" -D "TEST_SPEC=${_TEST_SPEC}" -D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}" -D "TEST_PROPERTIES=${_PROPERTIES}" -D "TEST_PREFIX=${_TEST_PREFIX}" -D "TEST_SUFFIX=${_TEST_SUFFIX}" -D "TEST_LIST=${_TEST_LIST}" -D "CTEST_FILE=${ctest_tests_file}" -P "${_CATCH_DISCOVER_TESTS_SCRIPT}" VERBATIM) file( WRITE "${ctest_include_file}" "if(EXISTS \"${ctest_tests_file}\")\n" " include(\"${ctest_tests_file}\")\n" "else()\n" " add_test(${TARGET}_NOT_BUILT-${args_hash} ${TARGET}_NOT_BUILT-${args_hash})\n" "endif()\n") if(NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0") # Add discovered tests to directory TEST_INCLUDE_FILES set_property(DIRECTORY APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}") else() # Add discovered tests as directory TEST_INCLUDE_FILE if possible get_property(test_include_file_set DIRECTORY PROPERTY TEST_INCLUDE_FILE SET) if(NOT ${test_include_file_set}) set_property(DIRECTORY PROPERTY TEST_INCLUDE_FILE "${ctest_include_file}") else() message(FATAL_ERROR "Cannot set more than one TEST_INCLUDE_FILE") endif() endif() endfunction() # set(_CATCH_DISCOVER_TESTS_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/CatchAddTests.cmake) conky-1.12.2/cmake/CatchAddTests.cmake000066400000000000000000000045521404127277500174770ustar00rootroot00000000000000# Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. set(prefix "${TEST_PREFIX}") set(suffix "${TEST_SUFFIX}") set(spec ${TEST_SPEC}) set(extra_args ${TEST_EXTRA_ARGS}) set(properties ${TEST_PROPERTIES}) set(script) set(suite) set(tests) function(add_command NAME) set(_args "") foreach(_arg ${ARGN}) if(_arg MATCHES "[^-./:a-zA-Z0-9_]") set(_args "${_args} [==[${_arg}]==]") # form a bracket_argument else() set(_args "${_args} ${_arg}") endif() endforeach() set(script "${script}${NAME}(${_args})\n" PARENT_SCOPE) endfunction() # Run test executable to get list of available tests if(NOT EXISTS "${TEST_EXECUTABLE}") message( FATAL_ERROR "Specified test executable '${TEST_EXECUTABLE}' does not exist") endif() execute_process(COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-test-names-only OUTPUT_VARIABLE output RESULT_VARIABLE result) # Catch --list-test-names-only reports the number of tests, so 0 is... # surprising if(${result} EQUAL 0) message(WARNING "Test executable '${TEST_EXECUTABLE}' contains no tests!\n") elseif(${result} LESS 0) message(FATAL_ERROR "Error running test executable '${TEST_EXECUTABLE}':\n" " Result: ${result}\n" " Output: ${output}\n") endif() string(REPLACE "\n" ";" output "${output}") # Parse output foreach(line ${output}) set(test ${line}) # use escape commas to handle properly test cases with commans inside the name string(REPLACE "," "\\," test_name ${test}) # ...and add to script add_command(add_test "${prefix}${test}${suffix}" ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" "${test_name}" ${extra_args}) add_command(set_tests_properties "${prefix}${test}${suffix}" PROPERTIES WORKING_DIRECTORY "${TEST_WORKING_DIR}" ${properties}) list(APPEND tests "${prefix}${test}${suffix}") endforeach() # Create a list of all discovered tests, which users may use to e.g. set # properties on the tests add_command(set ${TEST_LIST} ${tests}) # Write CTest script file(WRITE "${CTEST_FILE}" "${script}") conky-1.12.2/cmake/CodeCoverage.cmake000066400000000000000000000364431404127277500173530ustar00rootroot00000000000000# Copyright (c) 2012 - 2017, Lars Bilke All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # 1. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # 1. Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # CHANGES: # # 2012-01-31, Lars Bilke - Enable Code Coverage # # 2013-09-17, Joakim Söderberg - Added support for Clang. - Some additional # usage instructions. # # 2016-02-03, Lars Bilke - Refactored functions to use named parameters # # 2017-06-02, Lars Bilke - Merged with modified version from github.com/ufz/ogs # # USAGE: # # 1. Copy this file into your cmake modules path. # # 1. Add the following line to your CMakeLists.txt: include(CodeCoverage) # # 1. Append necessary compiler flags: APPEND_COVERAGE_COMPILER_FLAGS() # # 1. If you need to exclude additional directories from the report, specify them # using the COVERAGE_LCOV_EXCLUDES variable before calling # SETUP_TARGET_FOR_COVERAGE_LCOV. Example: set(COVERAGE_LCOV_EXCLUDES 'dir1/*' # 'dir2/*') # # 1. Use the functions described below to create a custom make target which runs # your test executable and produces a code coverage report. # # 1. Build a Debug build: cmake -DCMAKE_BUILD_TYPE=Debug .. make make # my_coverage_target # include(CMakeParseArguments) # Check prereqs find_program(GCOV_PATH NAMES ${CMAKE_SOURCE_DIR}/tests/llvm-gcov.sh gcov PATHS ENV PATH) find_program(LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl PATHS ENV PATH) find_program(LLVM_COV_PATH NAMES llvm-cov110 llvm-cov-11 llvm-cov100 llvm-cov-10 llvm-cov90 llvm-cov-9 llvm-cov80 llvm-cov-8 llvm-cov70 llvm-cov-7 llvm-cov PATHS ENV PATH) find_program(LLVM_PROFDATA_PATH NAMES llvm-profdata110 llvm-profdata-11 llvm-profdata100 llvm-profdata-10 llvm-profdata90 llvm-profdata-9 llvm-profdata80 llvm-profdata-8 llvm-profdata70 llvm-profdata-7 llvm-profdata PATHS ENV PATH) find_program(GENHTML_PATH NAMES genhtml genhtml.perl genhtml.bat) find_program(GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test) find_program(SIMPLE_PYTHON_EXECUTABLE python) if(NOT GCOV_PATH) message(FATAL_ERROR "gcov not found! Aborting...") endif() # NOT GCOV_PATH if("${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang") if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 3) message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...") endif() elseif(NOT CMAKE_COMPILER_IS_GNUCXX) message(FATAL_ERROR "Compiler is not GNU gcc! Aborting...") endif() set( COVERAGE_COMPILER_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage -fprofile-instr-generate -fcoverage-mapping" CACHE INTERNAL "") set(CMAKE_CXX_FLAGS_COVERAGE ${COVERAGE_COMPILER_FLAGS} CACHE STRING "Flags used by the C++ compiler during coverage builds." FORCE) set(CMAKE_C_FLAGS_COVERAGE ${COVERAGE_COMPILER_FLAGS} CACHE STRING "Flags used by the C compiler during coverage builds." FORCE) set(CMAKE_EXE_LINKER_FLAGS_COVERAGE "" CACHE STRING "Flags used for linking binaries during coverage builds." FORCE) set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "" CACHE STRING "Flags used by the shared libraries linker during coverage builds." FORCE) mark_as_advanced(CMAKE_CXX_FLAGS_COVERAGE CMAKE_C_FLAGS_COVERAGE CMAKE_EXE_LINKER_FLAGS_COVERAGE CMAKE_SHARED_LINKER_FLAGS_COVERAGE) if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") message( WARNING "Code coverage results with an optimised (non-Debug) build may be misleading" ) endif() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug" if(CMAKE_C_COMPILER_ID STREQUAL "GNU") link_libraries(gcov) else() set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-instr-generate") endif() # Defines a target for running and collection code coverage information Builds # dependencies, runs the given executable and outputs reports. NOTE! The # executable should always have a ZERO as exit code otherwise the coverage # generation will not complete. # # SETUP_TARGET_FOR_COVERAGE_LCOV_HTML( NAME testrunner_coverage # New target # name EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in # PROJECT_BINARY_DIR DEPENDENCIES testrunner # Dependencies # to build first ) function(SETUP_TARGET_FOR_COVERAGE_LCOV_HTML) set(options NONE) set(oneValueArgs NAME) set(multiValueArgs EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES LCOV_ARGS GENHTML_ARGS) cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(NOT LCOV_PATH) message(FATAL_ERROR "lcov not found! Aborting...") endif() # NOT LCOV_PATH if(NOT GENHTML_PATH) message(FATAL_ERROR "genhtml not found! Aborting...") endif() # NOT GENHTML_PATH # Setup target add_custom_target( ${Coverage_NAME} # Cleanup lcov COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -directory . --zerocounters # Create baseline to make sure untouched files show # up in the report COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -c -i -d . -o ${Coverage_NAME}.base # Run tests COMMAND ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS} # Capturing lcov counters and generating report COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --directory . --capture --output-file ${Coverage_NAME}.info # add baseline counters COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -a ${Coverage_NAME}.base -a ${Coverage_NAME}.info --output-file ${Coverage_NAME}.total COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --remove ${Coverage_NAME}.total ${COVERAGE_LCOV_EXCLUDES} --output-file ${PROJECT_BINARY_DIR}/${Coverage_NAME}.info.cleaned # Generate HTML COMMAND ${GENHTML_PATH} ${Coverage_GENHTML_ARGS} -o ${Coverage_NAME} ${PROJECT_BINARY_DIR}/${Coverage_NAME}.info.cleaned # Clean up COMMAND ${CMAKE_COMMAND} -E remove ${Coverage_NAME}.base ${Coverage_NAME}.total ${PROJECT_BINARY_DIR}/${Coverage_NAME}.info WORKING_DIRECTORY ${PROJECT_BINARY_DIR} DEPENDS ${Coverage_DEPENDENCIES} COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report." ) # Show where to find the lcov info report add_custom_command( TARGET ${Coverage_NAME} POST_BUILD COMMAND ; COMMENT "Lcov code coverage info report saved in ${Coverage_NAME}.info.cleaned") # Show info where to find the report add_custom_command( TARGET ${Coverage_NAME} POST_BUILD COMMAND ; COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report." ) endfunction() # SETUP_TARGET_FOR_COVERAGE_LCOV_HTML # Defines a target for running and collection code coverage information Builds # dependencies, runs the given executable and outputs reports. NOTE! The # executable should always have a ZERO as exit code otherwise the coverage # generation will not complete. # # SETUP_TARGET_FOR_COVERAGE_LCOV_TXT( NAME testrunner_coverage # New target name # EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR # DEPENDENCIES testrunner # Dependencies to build first ) function(SETUP_TARGET_FOR_COVERAGE_LCOV_TXT) set(options NONE) set(oneValueArgs NAME) set(multiValueArgs EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES LCOV_ARGS GENHTML_ARGS) cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(NOT LCOV_PATH) message(FATAL_ERROR "lcov not found! Aborting...") endif() # NOT LCOV_PATH # Setup target add_custom_target( ${Coverage_NAME} # Run tests COMMAND ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS} # Generate coverage.txt for sonar COMMAND ${LLVM_PROFDATA_PATH} merge default.profraw -output ${Coverage_NAME}.profdata COMMAND ${LLVM_COV_PATH} show -instr-profile=${Coverage_NAME}.profdata ${CMAKE_CURRENT_BINARY_DIR}/${Coverage_EXECUTABLE} > ${Coverage_NAME}.txt # Generate HTML # Clean up COMMAND ${CMAKE_COMMAND} -E remove ${Coverage_NAME}.profdata default.profraw WORKING_DIRECTORY ${PROJECT_BINARY_DIR} DEPENDS ${Coverage_DEPENDENCIES} COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report." ) # Show where to find the lcov info report add_custom_command( TARGET ${Coverage_NAME} POST_BUILD COMMAND ; COMMENT "Lcov code coverage info report saved in ${Coverage_NAME}.txt.") endfunction() # SETUP_TARGET_FOR_COVERAGE_LCOV_TXT # Defines a target for running and collection code coverage information Builds # dependencies, runs the given executable and outputs reports. NOTE! The # executable should always have a ZERO as exit code otherwise the coverage # generation will not complete. # # SETUP_TARGET_FOR_COVERAGE_GCOVR_XML( NAME ctest_coverage # # New target name EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in # PROJECT_BINARY_DIR DEPENDENCIES executable_target # Dependencies to # build first ) function(SETUP_TARGET_FOR_COVERAGE_GCOVR_XML) set(options NONE) set(oneValueArgs NAME) set(multiValueArgs EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES) cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(NOT SIMPLE_PYTHON_EXECUTABLE) message(FATAL_ERROR "python not found! Aborting...") endif() # NOT SIMPLE_PYTHON_EXECUTABLE if(NOT GCOVR_PATH) message(FATAL_ERROR "gcovr not found! Aborting...") endif() # NOT GCOVR_PATH # Combine excludes to several -e arguments set(GCOVR_EXCLUDES "") foreach(EXCLUDE ${COVERAGE_GCOVR_EXCLUDES}) list(APPEND GCOVR_EXCLUDES "-e") list(APPEND GCOVR_EXCLUDES "${EXCLUDE}") endforeach() add_custom_target( ${Coverage_NAME} # Run tests ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS} # Running gcovr COMMAND ${GCOVR_PATH} --xml -r ${PROJECT_SOURCE_DIR} ${GCOVR_EXCLUDES} --object-directory=${PROJECT_BINARY_DIR} -o ${Coverage_NAME}.xml WORKING_DIRECTORY ${PROJECT_BINARY_DIR} DEPENDS ${Coverage_DEPENDENCIES} COMMENT "Running gcovr to produce Cobertura code coverage report.") # Show info where to find the report add_custom_command( TARGET ${Coverage_NAME} POST_BUILD COMMAND ; COMMENT "Cobertura code coverage report saved in ${Coverage_NAME}.xml.") endfunction() # SETUP_TARGET_FOR_COVERAGE_GCOVR_XML # Defines a target for running and collection code coverage information Builds # dependencies, runs the given executable and outputs reports. NOTE! The # executable should always have a ZERO as exit code otherwise the coverage # generation will not complete. # # SETUP_TARGET_FOR_COVERAGE_GCOVR_HTML( NAME ctest_coverage # # New target name EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in # PROJECT_BINARY_DIR DEPENDENCIES executable_target # Dependencies to # build first ) function(SETUP_TARGET_FOR_COVERAGE_GCOVR_HTML) set(options NONE) set(oneValueArgs NAME) set(multiValueArgs EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES) cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(NOT SIMPLE_PYTHON_EXECUTABLE) message(FATAL_ERROR "python not found! Aborting...") endif() # NOT SIMPLE_PYTHON_EXECUTABLE if(NOT GCOVR_PATH) message(FATAL_ERROR "gcovr not found! Aborting...") endif() # NOT GCOVR_PATH # Combine excludes to several -e arguments set(GCOVR_EXCLUDES "") foreach(EXCLUDE ${COVERAGE_GCOVR_EXCLUDES}) list(APPEND GCOVR_EXCLUDES "-e") list(APPEND GCOVR_EXCLUDES "${EXCLUDE}") endforeach() add_custom_target( ${Coverage_NAME} # Run tests ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS} # Create folder COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${Coverage_NAME} # Running gcovr COMMAND ${GCOVR_PATH} --html --html-details -r ${PROJECT_SOURCE_DIR} ${GCOVR_EXCLUDES} --object-directory=${PROJECT_BINARY_DIR} -o ${Coverage_NAME}/index.html WORKING_DIRECTORY ${PROJECT_BINARY_DIR} DEPENDS ${Coverage_DEPENDENCIES} COMMENT "Running gcovr to produce HTML code coverage report.") # Show info where to find the report add_custom_command( TARGET ${Coverage_NAME} POST_BUILD COMMAND ; COMMENT "Open ${CMAKE_CURRENT_BINARY_DIR}/${Coverage_NAME}/index.html in your browser to view the coverage report." ) endfunction() # SETUP_TARGET_FOR_COVERAGE_GCOVR_HTML function(APPEND_COVERAGE_COMPILER_FLAGS) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE) message( STATUS "Appending code coverage compiler flags: ${COVERAGE_COMPILER_FLAGS}") endfunction() # APPEND_COVERAGE_COMPILER_FLAGS conky-1.12.2/cmake/Conky.cmake000066400000000000000000000145721404127277500161070ustar00rootroot00000000000000# # Conky, a system monitor, based on torsmo # # Please see COPYING for details # # Copyright (c) 2005-2021 Brenden Matthews, et. al. (see AUTHORS) All rights # reserved. # # 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 3 of the License, or (at your option) any later # version. # # 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. You should have received a copy of the GNU General Public License # along with this program. If not, see . # # set(RELEASE true) # Set system vars if(CMAKE_SYSTEM_NAME MATCHES "Linux") set(OS_LINUX true) endif(CMAKE_SYSTEM_NAME MATCHES "Linux") if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") set(OS_FREEBSD true) endif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") if(CMAKE_SYSTEM_NAME MATCHES "DragonFly") set(OS_DRAGONFLY true) endif(CMAKE_SYSTEM_NAME MATCHES "DragonFly") if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD") set(OS_OPENBSD true) endif(CMAKE_SYSTEM_NAME MATCHES "OpenBSD") if(CMAKE_SYSTEM_NAME MATCHES "SunOS") set(OS_SOLARIS true) endif(CMAKE_SYSTEM_NAME MATCHES "SunOS") if(CMAKE_SYSTEM_NAME MATCHES "NetBSD") set(OS_NETBSD true) endif(CMAKE_SYSTEM_NAME MATCHES "NetBSD") if(CMAKE_SYSTEM_NAME MATCHES "Haiku") set(OS_HAIKU true) endif(CMAKE_SYSTEM_NAME MATCHES "Haiku") if(CMAKE_SYSTEM_NAME MATCHES "Darwin") set(OS_DARWIN true) endif(CMAKE_SYSTEM_NAME MATCHES "Darwin") if(NOT OS_LINUX AND NOT OS_FREEBSD AND NOT OS_OPENBSD AND NOT OS_DRAGONFLY AND NOT OS_SOLARIS AND NOT OS_HAIKU AND NOT OS_DARWIN) message( FATAL_ERROR "Your platform, '${CMAKE_SYSTEM_NAME}', is not currently supported. Patches are welcome." ) endif(NOT OS_LINUX AND NOT OS_FREEBSD AND NOT OS_OPENBSD AND NOT OS_DRAGONFLY AND NOT OS_SOLARIS AND NOT OS_HAIKU AND NOT OS_DARWIN) include(FindThreads) find_package(Threads) set(conky_libs ${CMAKE_THREAD_LIBS_INIT}) set(conky_includes ${CMAKE_BINARY_DIR}) # # On Darwin _POSIX_C_SOURCE must be >= __DARWIN_C_FULL for asprintf to be # enabled! Thus disable this and _LARGEFILE64_SOURCE isnt needed, it is already # used on macOS. # if(NOT OS_DARWIN) add_definitions(-D_LARGEFILE64_SOURCE -D_POSIX_C_SOURCE=200809L) # Standard # definitions set( CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_LARGEFILE64_SOURCE -D_POSIX_C_SOURCE=200809L" ) endif(NOT OS_DARWIN) if(OS_FREEBSD) add_definitions(-D__BSD_VISIBLE=1 -D_XOPEN_SOURCE=700) set( CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_LARGEFILE64_SOURCE -D_POSIX_C_SOURCE=200809L -D__BSD_VISIBLE=1 -D_XOPEN_SOURCE=700" ) endif(OS_FREEBSD) if(OS_DRAGONFLY) set(conky_libs ${conky_libs} -L/usr/pkg/lib) set(conky_includes ${conky_includes} -I/usr/pkg/include) endif(OS_DRAGONFLY) if(OS_SOLARIS) set(conky_libs ${conky_libs} -L/usr/local/lib) endif(OS_SOLARIS) # Do version stuff set(VERSION_MAJOR "1") set(VERSION_MINOR "12") set(VERSION_PATCH "2") find_program(APP_AWK awk) if(NOT APP_AWK) message(FATAL_ERROR "Unable to find program 'awk'") endif(NOT APP_AWK) find_program(APP_WC wc) if(NOT APP_WC) message(FATAL_ERROR "Unable to find program 'wc'") endif(NOT APP_WC) find_program(APP_DATE date) if(NOT APP_DATE) message(FATAL_ERROR "Unable to find program 'date'") endif(NOT APP_DATE) find_program(APP_UNAME uname) if(NOT APP_UNAME) message(FATAL_ERROR "Unable to find program 'uname'") endif(NOT APP_UNAME) if(NOT RELEASE) find_program(APP_GIT git) if(NOT APP_GIT) message(FATAL_ERROR "Unable to find program 'git'") endif(NOT APP_GIT) mark_as_advanced(APP_GIT) endif(NOT RELEASE) mark_as_advanced(APP_AWK APP_WC APP_DATE APP_UNAME) # BUILD_DATE=$(LANG=en_US LC_ALL=en_US LOCALE=en_US date --utc # --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d) # BUILD_ARCH="$(uname -sm)" STRING(TIMESTAMP BUILD_DATE "%Y-%m-%d" UTC) execute_process(COMMAND ${APP_UNAME} -sm RESULT_VARIABLE RETVAL OUTPUT_VARIABLE BUILD_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) if(RELEASE) set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") else(RELEASE) set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}_pre${COMMIT_COUNT}") endif(RELEASE) set(COPYRIGHT "Copyright Brenden Matthews, et al, 2005-2021") macro(AC_SEARCH_LIBS FUNCTION_NAME INCLUDES TARGET_VAR) if("${TARGET_VAR}" MATCHES "^${TARGET_VAR}$") unset(AC_SEARCH_LIBS_TMP CACHE) check_symbol_exists(${FUNCTION_NAME} ${INCLUDES} AC_SEARCH_LIBS_TMP) if(${AC_SEARCH_LIBS_TMP}) set(${TARGET_VAR} "" CACHE INTERNAL "Library containing ${FUNCTION_NAME}") else(${AC_SEARCH_LIBS_TMP}) foreach(LIB ${ARGN}) unset(AC_SEARCH_LIBS_TMP CACHE) unset(AC_SEARCH_LIBS_FOUND CACHE) find_library(AC_SEARCH_LIBS_TMP ${LIB}) check_library_exists(${LIB} ${FUNCTION_NAME} ${AC_SEARCH_LIBS_TMP} AC_SEARCH_LIBS_FOUND) if(${AC_SEARCH_LIBS_FOUND}) set(${TARGET_VAR} ${AC_SEARCH_LIBS_TMP} CACHE INTERNAL "Library containing ${FUNCTION_NAME}") break() endif(${AC_SEARCH_LIBS_FOUND}) endforeach(LIB) endif(${AC_SEARCH_LIBS_TMP}) endif("${TARGET_VAR}" MATCHES "^${TARGET_VAR}$") endmacro(AC_SEARCH_LIBS) # A function to print the target build properties function(print_target_properties tgt) if(NOT TARGET ${tgt}) message("There is no target named '${tgt}'") return() endif() # this list of properties can be extended as needed set(CMAKE_PROPERTY_LIST SOURCE_DIR BINARY_DIR COMPILE_DEFINITIONS COMPILE_OPTIONS INCLUDE_DIRECTORIES LINK_LIBRARIES) message("Configuration for target ${tgt}") foreach(prop ${CMAKE_PROPERTY_LIST}) get_property(propval TARGET ${tgt} PROPERTY ${prop} SET) if(propval) get_target_property(propval ${tgt} ${prop}) message(STATUS "${prop} = ${propval}") endif() endforeach(prop) endfunction(print_target_properties) conky-1.12.2/cmake/ConkyBuildOptions.cmake000066400000000000000000000244241404127277500204400ustar00rootroot00000000000000# # Conky, a system monitor, based on torsmo # # Please see COPYING for details # # Copyright (c) 2005-2021 Brenden Matthews, et. al. (see AUTHORS) All rights # reserved. # # 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 3 of the License, or (at your option) any later # version. # # 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. You should have received a copy of the GNU General Public License # along with this program. If not, see . # if(NOT CMAKE_BUILD_TYPE) if(MAINTAINER_MODE) set( CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) else(MAINTAINER_MODE) set( CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) endif(MAINTAINER_MODE) endif(NOT CMAKE_BUILD_TYPE) # -std options for all build types set(CMAKE_C_FLAGS "-std=c99 ${CMAKE_C_FLAGS}" CACHE STRING "Flags used by the C compiler during all build types." FORCE) set(CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_CXX_FLAGS}" CACHE STRING "Flags used by the C++ compiler during all build types." FORCE) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) if(MAINTAINER_MODE) set(BUILD_TESTS true) # some extra debug flags when in 'maintainer mode' if(CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) # Some flags are only supported on GCC >= 7.0, such as -Wimplicit- # fallthrough=2 set( CMAKE_C_FLAGS_DEBUG "-ggdb -Wall -W -Wextra -Wunused -Wdeclaration-after-statement -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Winline -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -pedantic -Werror -Wno-unknown-pragmas -Wno-error=pragmas -Wimplicit-fallthrough=2" CACHE STRING "Flags used by the compiler during debug builds." FORCE) set( CMAKE_CXX_FLAGS_DEBUG "-ggdb -Wall -W -Wextra -Wunused -pedantic -Werror -Wno-format -Wno-unknown-pragmas -Wno-error=pragmas -Wimplicit-fallthrough=2" CACHE STRING "Flags used by the compiler during debug builds." FORCE) else() set( CMAKE_C_FLAGS_DEBUG "-ggdb -Wall -W -Wextra -Wunused -Wdeclaration-after-statement -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Winline -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -pedantic -Werror -Wno-unknown-pragmas -Wno-error=pragmas" CACHE STRING "Flags used by the compiler during debug builds." FORCE) set( CMAKE_CXX_FLAGS_DEBUG "-ggdb -Wall -W -Wextra -Wunused -pedantic -Werror -Wno-format -Wno-unknown-pragmas -Wno-error=pragmas" CACHE STRING "Flags used by the compiler during debug builds." FORCE) endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(USING_CLANG true) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") endif() endif(MAINTAINER_MODE) option(CHECK_CODE_QUALITY "Check code formatting/quality with clang" false) option(RELEASE "Build release package" false) mark_as_advanced(RELEASE) option(MAINTAINER_MODE "Enable maintainer mode" false) option(BUILD_DOCS "Build documentation" false) option(BUILD_I18N "Enable if you want internationalization support" true) if(BUILD_I18N) set(LOCALE_DIR "${CMAKE_INSTALL_PREFIX}/share/locale" CACHE STRING "Directory containing the locales") endif(BUILD_I18N) # Some standard options set(SYSTEM_CONFIG_FILE "/etc/conky/conky.conf" CACHE STRING "Default system-wide Conky configuration file") # use FORCE below to make sure this changes when CMAKE_INSTALL_PREFIX is # modified if(NOT LIB_INSTALL_DIR) set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") endif(NOT LIB_INSTALL_DIR) set(PACKAGE_LIBRARY_DIR "${LIB_INSTALL_DIR}/conky" CACHE STRING "Package library path (where Lua bindings are installed" FORCE) set(DEFAULTNETDEV "eno1" CACHE STRING "Default networkdevice") # Mac only override if(OS_DARWIN) set(DEFAULTNETDEV "en0" CACHE STRING "Default networkdevice" FORCE) endif(OS_DARWIN) set(XDG_CONFIG_FILE "$HOME/.config/conky/conky.conf" CACHE STRING "Configfile of the user (XDG)") set(CONFIG_FILE "$HOME/.conkyrc" CACHE STRING "Configfile of the user") set(MAX_USER_TEXT_DEFAULT "16384" CACHE STRING "Default maximum size of config TEXT buffer, i.e. below TEXT line.") set(DEFAULT_TEXT_BUFFER_SIZE "256" CACHE STRING "Default size used for temporary, static text buffers") set(MAX_NET_INTERFACES "256" CACHE STRING "Maximum number of network devices") # Platform specific options Linux only if(OS_LINUX) option(BUILD_PORT_MONITORS "Build TCP portmon support" true) option(BUILD_IBM "Support for IBM/Lenovo notebooks" true) option(BUILD_HDDTEMP "Support for hddtemp" true) option(BUILD_IPV6 "Enable if you want IPv6 support" true) if(BUILD_X11) # nvidia may also work on FreeBSD, not sure option(BUILD_NVIDIA "Enable nvidia support" false) endif(BUILD_X11) else(OS_LINUX) set(BUILD_PORT_MONITORS false) set(BUILD_IBM false) set(BUILD_HDDTEMP false) set(BUILD_NVIDIA false) set(BUILD_IPV6 false) endif(OS_LINUX) # macOS Only if(OS_DARWIN) option( BUILD_IPGFREQ "Enable cpu freq calculation based on Intel® Power Gadget; otherwise use constant factory value" false) endif(OS_DARWIN) # Optional features etc # option(BUILD_WLAN "Enable wireless support" false) option(BUILD_BUILTIN_CONFIG "Enable builtin default configuration" true) option(BUILD_IOSTATS "Enable disk I/O stats" true) option(BUILD_OLD_CONFIG "Enable support for the old syntax of configurations" true) option(BUILD_MATH "Enable math support" true) option(BUILD_NCURSES "Enable ncurses support" true) if(BUILD_NCURSES) option( LEAKFREE_NCURSES "Enable to hide false ncurses-memleaks in valgrind (works only when ncurses is compiled with --disable-leaks)" false) else(BUILD_NCURSES) set( LEAKFREE_NCURSES false CACHE BOOL "Enable to hide false ncurses-memleaks in valgrind (works only when ncurses is compiled with --disable-leaks)" FORCE) endif(BUILD_NCURSES) option(BUILD_X11 "Build X11 support" true) if(BUILD_X11) option(OWN_WINDOW "Enable own_window support" true) # Mac Fix if(OS_DARWIN) option(BUILD_XDAMAGE "Build Xdamage support" false) else(OS_DARWIN) option(BUILD_XDAMAGE "Build Xdamage support" true) endif(OS_DARWIN) option(BUILD_XINERAMA "Build Xinerama support" true) option(BUILD_XDBE "Build Xdbe (double-buffer) support" true) option(BUILD_XFT "Build Xft (freetype fonts) support" true) option(BUILD_IMLIB2 "Enable Imlib2 support" true) option(BUILD_XSHAPE "Enable Xshape support" true) else(BUILD_X11) set(OWN_WINDOW false CACHE BOOL "Enable own_window support" FORCE) set(BUILD_XDAMAGE false CACHE BOOL "Build Xdamage support" FORCE) set(BUILD_XINERAMA false CACHE BOOL "Build Xinerama support" FORCE) set(BUILD_XDBE false CACHE BOOL "Build Xdbe (double-buffer) support" FORCE) set(BUILD_XFT false CACHE BOOL "Build Xft (freetype fonts) support" FORCE) set(BUILD_IMLIB2 false CACHE BOOL "Enable Imlib2 support" FORCE) set(BUILD_XSHAPE false CACHE BOOL "Enable Xshape support" FORCE) set(BUILD_NVIDIA false) endif(BUILD_X11) if(OWN_WINDOW) option(BUILD_ARGB "Build ARGB (real transparency) support" true) else(OWN_WINDOW) set(BUILD_ARGB false CACHE BOOL "Build ARGB (real transparency) support" FORCE) endif(OWN_WINDOW) option(BUILD_LUA_CAIRO "Build cairo bindings for Lua" false) option(BUILD_LUA_IMLIB2 "Build Imlib2 bindings for Lua" false) option(BUILD_LUA_RSVG "Build rsvg bindings for Lua" false) option(BUILD_AUDACIOUS "Build audacious (music player) support" false) option(BUILD_MPD "Enable if you want MPD (music player) support" true) option(BUILD_MYSQL "Enable if you want MySQL support" false) option(BUILD_MOC "Enable if you want MOC (music player) support" true) option(BUILD_XMMS2 "Enable if you want XMMS2 (music player) support" false) option(BUILD_CURL "Enable if you want Curl support" false) option(BUILD_RSS "Enable if you want RSS support" false) option(BUILD_WEATHER_METAR "Enable METAR weather support" true) if(BUILD_WEATHER_METAR OR BUILD_RSS) set(BUILD_CURL true) endif(BUILD_WEATHER_METAR OR BUILD_RSS) option(BUILD_APCUPSD "Enable APCUPSD support" true) option(BUILD_ICAL "Enable if you want iCalendar (RFC 5545) support" false) option(BUILD_IRC "Enable if you want IRC support" false) option(BUILD_HTTP "Enable if you want HTTP support" false) if(BUILD_HTTP) set(HTTPPORT "10080" CACHE STRING "Port to use for out_to_http") endif(BUILD_HTTP) option(BUILD_ICONV "Enable iconv support" false) option(BUILD_CMUS "Enable support for cmus music player" true) option(BUILD_JOURNAL "Enable support for reading from the systemd journal" false) option(BUILD_PULSEAUDIO "Enable support for Pulseaudio's default sink and source" false) option(BUILD_INTEL_BACKLIGHT "Enable support for Intel backlight" false) option(BUILD_HSV_GRADIENT "Enable gradient in HSV colour space" true) message(STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS}) message(STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS}) message(STATUS "CMAKE_C_FLAGS_DEBUG: " ${CMAKE_C_FLAGS_DEBUG}) message(STATUS "CMAKE_CXX_FLAGS_DEBUG: " ${CMAKE_CXX_FLAGS_DEBUG}) message(STATUS "CMAKE_C_FLAGS_MINSIZEREL: " ${CMAKE_C_FLAGS_MINSIZEREL}) message(STATUS "CMAKE_CXX_FLAGS_MINSIZEREL: " ${CMAKE_CXX_FLAGS_MINSIZEREL}) message(STATUS "CMAKE_C_FLAGS_RELEASE: " ${CMAKE_C_FLAGS_RELEASE}) message(STATUS "CMAKE_CXX_FLAGS_RELEASE: " ${CMAKE_CXX_FLAGS_RELEASE}) message(STATUS "CMAKE_C_FLAGS_RELWITHDEBINFO: " ${CMAKE_C_FLAGS_RELWITHDEBINFO}) message(STATUS "CMAKE_CXX_FLAGS_RELWITHDEBINFO: " ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) message(STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE}) conky-1.12.2/cmake/ConkyCPackSetup.cmake000066400000000000000000000043411404127277500200230ustar00rootroot00000000000000# # Conky, a system monitor, based on torsmo # # Please see COPYING for details # # Copyright (c) 2005-2021 Brenden Matthews, et. al. (see AUTHORS) All rights # reserved. # # 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 3 of the License, or (at your option) any later # version. # # 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. You should have received a copy of the GNU General Public License # along with this program. If not, see . # set(CPACK_GENERATOR "TGZ;STGZ;DEB") set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>=2.10-1), libgcc1 (>= 1:4.4.0)") set(CPACK_PACKAGE_CONTACT "brenden@diddyinc.com") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Brenden Matthews") set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION}-${CMAKE_SYSTEM_NAME}-${CPU_ARCH}") set(CPACK_PACKAGE_INSTALL_DIRECTORY ${PROJECT_NAME}) set(CPACK_STRIP_FILES true) # Version numbering, copyright notice, etc. are taken from the variables defined # in ../CMakeLists.txt. set(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}") set(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}") set(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}") if(CPACK_GENERATOR MATCHES "NSIS") set(CPACK_NSIS_COMPRESSOR "/FINAL /SOLID lzma") set(CPACK_PACKAGE_EXECUTABLES ${PROJECT_NAME} ${PROJECT_NAME}) endif(CPACK_GENERATOR MATCHES "NSIS") # Source package setup. Compile with "make package_source". set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION}-src") set(CPACK_SOURCE_GENERATOR "TBZ2") execute_process(COMMAND ${APP_UNAME} COMMAND ${APP_AWK} "{print $1}" RESULT_VARIABLE RETVAL OUTPUT_VARIABLE CPU_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) set(CPACK_SOURCE_IGNORE_FILES # Exclude backup files generated by text editors. "~$" # Git dir/files. "\\\\.git.*$" # vim swap files "\\\\..*\\\\.swp$" # Build dir. "build.*$") # Enable CPack include(CPack) conky-1.12.2/cmake/ConkyPlatformChecks.cmake000066400000000000000000000426171404127277500207360ustar00rootroot00000000000000# # Conky, a system monitor, based on torsmo # # Please see COPYING for details # # Copyright (c) 2005-2021 Brenden Matthews, et. al. (see AUTHORS) All rights # reserved. # # 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 3 of the License, or (at your option) any later # version. # # 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. You should have received a copy of the GNU General Public License # along with this program. If not, see . # include(FindPkgConfig) include(CheckFunctionExists) include(CheckIncludeFiles) include(CheckSymbolExists) # Check for some headers check_include_files(sys/statfs.h HAVE_SYS_STATFS_H) check_include_files(sys/param.h HAVE_SYS_PARAM_H) check_include_files(sys/inotify.h HAVE_SYS_INOTIFY_H) check_include_files(dirent.h HAVE_DIRENT_H) # Check for some functions check_function_exists(strndup HAVE_STRNDUP) check_symbol_exists(pipe2 "unistd.h" HAVE_PIPE2) check_symbol_exists(O_CLOEXEC "fcntl.h" HAVE_O_CLOEXEC) if(CMAKE_SYSTEM_NAME MATCHES "Darwin") check_symbol_exists(statfs64 "sys/mount.h" HAVE_STATFS64) else(CMAKE_SYSTEM_NAME MATCHES "Darwin") check_symbol_exists(statfs64 "sys/statfs.h" HAVE_STATFS64) endif(CMAKE_SYSTEM_NAME MATCHES "Darwin") ac_search_libs(clock_gettime "time.h" CLOCK_GETTIME_LIB "rt") if(NOT DEFINED CLOCK_GETTIME_LIB) if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") message(FATAL_ERROR "clock_gettime not found.") endif(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") else(NOT DEFINED CLOCK_GETTIME_LIB) set(HAVE_CLOCK_GETTIME 1) endif(NOT DEFINED CLOCK_GETTIME_LIB) set(conky_libs ${conky_libs} ${CLOCK_GETTIME_LIB}) # standard path to search for includes set(INCLUDE_SEARCH_PATH /usr/include /usr/local/include) # Set system vars if(CMAKE_SYSTEM_NAME MATCHES "Linux") set(OS_LINUX true) endif(CMAKE_SYSTEM_NAME MATCHES "Linux") if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") set(OS_FREEBSD true) set(conky_libs ${conky_libs} -lkvm -ldevstat -lintl -linotify) if(BUILD_IRC) set(conky_libs ${conky_libs} -lssl -lcrypto) endif(BUILD_IRC) endif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") if(CMAKE_SYSTEM_NAME MATCHES "DragonFly") set(OS_DRAGONFLY true) set(conky_libs ${conky_libs} -ldevstat) endif(CMAKE_SYSTEM_NAME MATCHES "DragonFly") if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD") set(OS_OPENBSD true) endif(CMAKE_SYSTEM_NAME MATCHES "OpenBSD") if(CMAKE_SYSTEM_NAME MATCHES "SunOS") set(OS_SOLARIS true) set(conky_libs ${conky_libs} -lkstat) endif(CMAKE_SYSTEM_NAME MATCHES "SunOS") if(CMAKE_SYSTEM_NAME MATCHES "NetBSD") set(OS_NETBSD true) endif(CMAKE_SYSTEM_NAME MATCHES "NetBSD") if(CMAKE_SYSTEM_NAME MATCHES "Haiku") set(OS_HAIKU true) set(conky_libs ${conky_libs} -lnetwork -lintl) endif(CMAKE_SYSTEM_NAME MATCHES "Haiku") if(CMAKE_SYSTEM_NAME MATCHES "Darwin") set(OS_DARWIN true) endif(CMAKE_SYSTEM_NAME MATCHES "Darwin") if(NOT OS_LINUX AND NOT OS_FREEBSD AND NOT OS_OPENBSD AND NOT OS_DRAGONFLY AND NOT OS_SOLARIS AND NOT OS_HAIKU AND NOT OS_DARWIN) message( FATAL_ERROR "Your platform, '${CMAKE_SYSTEM_NAME}', is not currently supported. Patches are welcome." ) endif(NOT OS_LINUX AND NOT OS_FREEBSD AND NOT OS_OPENBSD AND NOT OS_DRAGONFLY AND NOT OS_SOLARIS AND NOT OS_HAIKU AND NOT OS_DARWIN) # Check for soundcard header if(OS_LINUX) check_include_files("linux/soundcard.h" HAVE_SOME_SOUNDCARD_H) check_include_files("linux/soundcard.h" HAVE_LINUX_SOUNDCARD_H) check_include_files("linux/sockios.h" HAVE_LINUX_SOCKIOS_H) elseif(OS_OPENBSD) check_include_files("soundcard.h" HAVE_SOME_SOUNDCARD_H) else(OS_LINUX) check_include_files("sys/soundcard.h" HAVE_SOME_SOUNDCARD_H) endif(OS_LINUX) if(BUILD_I18N AND OS_DRAGONFLY) set(conky_libs ${conky_libs} -lintl) endif(BUILD_I18N AND OS_DRAGONFLY) if(BUILD_I18N AND OS_DARWIN) find_path(LIBINTL_H_N libintl.h PATHS /usr/local/opt/gettext/include /usr/include /usr/local/include /usr/local/opt/include) if(LIBINTL_H_N) include_directories(${LIBINTL_H_N}) else(LIBINTL_H_N) message(FATAL_ERROR "Unable to find libintl.h (try `brew install gettext`)") endif(LIBINTL_H_N) find_library(INTL_LIB NAMES intl PATHS /usr/local/opt/gettext/lib /usr/lib /usr/local/lib /usr/local/opt/lib) set(conky_libs ${conky_libs} ${INTL_LIB}) endif(BUILD_I18N AND OS_DARWIN) if(BUILD_NCURSES AND OS_DARWIN) set(conky_libs ${conky_libs} -lncurses) endif(BUILD_NCURSES AND OS_DARWIN) if(BUILD_WLAN AND OS_DARWIN) find_library(CW CoreWLAN) find_library(NS Foundation) set(conky_libs ${conky_libs} ${CW}) set(conky_libs ${conky_libs} ${NS}) endif(BUILD_WLAN AND OS_DARWIN) if(OS_DARWIN AND BUILD_IPGFREQ) find_library(IPG IntelPowerGadget) set(conky_libs ${conky_libs} ${IPG}) endif(OS_DARWIN AND BUILD_IPGFREQ) if(BUILD_MATH) set(conky_libs ${conky_libs} -lm) endif(BUILD_MATH) if(BUILD_ICAL) check_include_files(libical/ical.h ICAL_H_) if(NOT ICAL_H_) message(FATAL_ERROR "Unable to find libical") endif(NOT ICAL_H_) set(conky_libs ${conky_libs} -lical) endif(BUILD_ICAL) if(BUILD_IRC) find_path(IRC_H_N libircclient.h PATHS /usr/include/libircclient) find_path(IRC_H_S libircclient.h PATHS /usr/include) if(IRC_H_N) include_directories(${IRC_H_N}) endif(IRC_H_N) if(IRC_H_N OR IRC_H_S) set(IRC_H_ true) else() message(FATAL_ERROR "Unable to find libircclient") endif(IRC_H_N OR IRC_H_S) set(conky_libs ${conky_libs} -lircclient) endif(BUILD_IRC) if(BUILD_IPV6) find_file(IF_INET6 if_inet6 PATHS /proc/net) if(NOT IF_INET6) message(WARNING "/proc/net/if_inet6 unavailable") endif(NOT IF_INET6) endif(BUILD_IPV6) if(BUILD_HTTP) pkg_check_modules(MICROHTTPD REQUIRED libmicrohttpd>=0.9.25) set(conky_libs ${conky_libs} ${MICROHTTPD_LIBRARIES}) set(conky_includes ${conky_includes} ${MICROHTTPD_INCLUDE_DIRS}) endif(BUILD_HTTP) if(BUILD_NCURSES) set(CURSES_NEED_NCURSES TRUE) include(FindCurses) if(NOT CURSES_FOUND) message(FATAL_ERROR "Unable to find ncurses library") endif(NOT CURSES_FOUND) set(conky_libs ${conky_libs} ${CURSES_LIBRARIES}) set(conky_includes ${conky_includes} ${CURSES_INCLUDE_DIR}) endif(BUILD_NCURSES) if(BUILD_MYSQL) find_path(mysql_INCLUDE_PATH mysql.h ${INCLUDE_SEARCH_PATH} /usr/include/mysql /usr/local/include/mysql) if(NOT mysql_INCLUDE_PATH) message(FATAL_ERROR "Unable to find mysql.h") endif(NOT mysql_INCLUDE_PATH) set(conky_includes ${conky_includes} ${mysql_INCLUDE_PATH}) find_library(MYSQLCLIENT_LIB NAMES mysqlclient PATHS /usr/lib /usr/lib64 /usr/lib/mysql /usr/lib64/mysql /usr/local/lib /usr/local/lib64 /usr/local/lib/mysql /usr/local/lib64/mysql) if(NOT MYSQLCLIENT_LIB) message(FATAL_ERROR "Unable to find mysqlclient library") endif(NOT MYSQLCLIENT_LIB) set(conky_libs ${conky_libs} ${MYSQLCLIENT_LIB}) endif(BUILD_MYSQL) if(BUILD_WLAN AND OS_LINUX) set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) check_include_files(iwlib.h IWLIB_H) if(NOT IWLIB_H) message(FATAL_ERROR "Unable to find iwlib.h") endif(NOT IWLIB_H) find_library(IWLIB_LIB NAMES iw) if(NOT IWLIB_LIB) message(FATAL_ERROR "Unable to find libiw.so") endif(NOT IWLIB_LIB) set(conky_libs ${conky_libs} ${IWLIB_LIB}) check_function_exists(iw_sockets_open IWLIB_SOCKETS_OPEN_FUNC) endif(BUILD_WLAN AND OS_LINUX) if(BUILD_PORT_MONITORS) check_function_exists(getnameinfo HAVE_GETNAMEINFO) if(NOT HAVE_GETNAMEINFO) message(FATAL_ERROR "could not find getnameinfo()") endif(NOT HAVE_GETNAMEINFO) check_include_files( "netdb.h;netinet/in.h;netinet/tcp.h;sys/socket.h;arpa/inet.h" HAVE_PORTMON_HEADERS) if(NOT HAVE_PORTMON_HEADERS) message(FATAL_ERROR "missing needed network header(s) for port monitoring") endif(NOT HAVE_PORTMON_HEADERS) endif(BUILD_PORT_MONITORS) # Check for iconv if(BUILD_ICONV) check_include_files(iconv.h HAVE_ICONV_H) find_library(ICONV_LIBRARY NAMES iconv) if(NOT ICONV_LIBRARY) # maybe iconv() is provided by libc set(ICONV_LIBRARY "" CACHE FILEPATH "Path to the iconv library, if iconv is not provided by libc" FORCE) endif(NOT ICONV_LIBRARY) set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY}) check_function_exists(iconv ICONV_FUNC) if(HAVE_ICONV_H AND ICONV_FUNC) set(conky_includes ${conky_includes} ${ICONV_INCLUDE_DIR}) set(conky_libs ${conky_libs} ${ICONV_LIBRARY}) else(HAVE_ICONV_H AND ICONV_FUNC) message(FATAL_ERROR "Unable to find iconv library") endif(HAVE_ICONV_H AND ICONV_FUNC) endif(BUILD_ICONV) # check for Xlib if(BUILD_X11) include(FindX11) find_package(X11) if(X11_FOUND) set(conky_includes ${conky_includes} ${X11_INCLUDE_DIR}) set(conky_libs ${conky_libs} ${X11_LIBRARIES}) # check for Xdamage if(BUILD_XDAMAGE) if(NOT X11_Xdamage_FOUND) message(FATAL_ERROR "Unable to find Xdamage library") endif(NOT X11_Xdamage_FOUND) if(NOT X11_Xfixes_FOUND) message(FATAL_ERROR "Unable to find Xfixes library") endif(NOT X11_Xfixes_FOUND) set(conky_libs ${conky_libs} ${X11_Xdamage_LIB} ${X11_Xfixes_LIB}) endif(BUILD_XDAMAGE) if(BUILD_XSHAPE) if(NOT X11_Xshape_FOUND) message(FATAL_ERROR "Unable to find Xshape library") endif(NOT X11_Xshape_FOUND) set(conky_libs ${conky_libs} ${X11_Xshape_LIB}) endif(BUILD_XSHAPE) # check for Xft if(BUILD_XFT) find_path(freetype_INCLUDE_PATH config/ftconfig.h ${INCLUDE_SEARCH_PATH} /usr/include/freetype2 /usr/local/include/freetype2 /usr/pkg/include/freetype2) if(freetype_INCLUDE_PATH) set(freetype_FOUND true) set(conky_includes ${conky_includes} ${freetype_INCLUDE_PATH}) else(freetype_INCLUDE_PATH) find_path(freetype_INCLUDE_PATH freetype/config/ftconfig.h ${INCLUDE_SEARCH_PATH} /usr/include/freetype2 /usr/local/include/freetype2 /usr/pkg/include/freetype2) if(freetype_INCLUDE_PATH) set(freetype_FOUND true) set(conky_includes ${conky_includes} ${freetype_INCLUDE_PATH}) else(freetype_INCLUDE_PATH) message(FATAL_ERROR "Unable to find freetype library") endif(freetype_INCLUDE_PATH) endif(freetype_INCLUDE_PATH) if(NOT X11_Xft_FOUND) message(FATAL_ERROR "Unable to find Xft library") endif(NOT X11_Xft_FOUND) set(conky_libs ${conky_libs} ${X11_Xft_LIB}) endif(BUILD_XFT) # check for Xdbe if(BUILD_XDBE) if(NOT X11_Xext_FOUND) message(FATAL_ERROR "Unable to find Xext library (needed for Xdbe)") endif(NOT X11_Xext_FOUND) set(conky_libs ${conky_libs} ${X11_Xext_LIB}) endif(BUILD_XDBE) else(X11_FOUND) message(FATAL_ERROR "Unable to find X11 library") endif(X11_FOUND) endif(BUILD_X11) # Otherwise, use the most recent Lua version pkg_search_module(LUA REQUIRED lua>=5.3 lua5.3 lua-5.3 lua53 lua5.2 lua-5.2 lua52) set(conky_libs ${conky_libs} ${LUA_LIBRARIES}) set(conky_includes ${conky_includes} ${LUA_INCLUDE_DIRS}) link_directories(${LUA_LIBRARY_DIRS}) include_directories(3rdparty/toluapp/include) if(BUILD_X11) # Check for libraries used by Lua bindings if(BUILD_LUA_CAIRO) pkg_check_modules(CAIRO REQUIRED cairo cairo-xlib) set(luacairo_libs ${CAIRO_LIBRARIES} ${LUA_LIBRARIES}) set(luacairo_includes ${CAIRO_INCLUDE_DIRS} ${LUA_INCLUDE_DIRS}) find_program(APP_PATCH patch) if(NOT APP_PATCH) message(FATAL_ERROR "Unable to find program 'patch'") endif(NOT APP_PATCH) endif(BUILD_LUA_CAIRO) if(BUILD_LUA_IMLIB2) pkg_search_module(IMLIB2 REQUIRED imlib2 Imlib2) set(luaimlib2_libs ${IMLIB2_LIBS} ${IMLIB2_LDFLAGS} ${LUA_LIBRARIES}) set(luaimlib2_includes ${IMLIB2_INCLUDE_DIRS} ${LUA_INCLUDE_DIRS} ${X11_INCLUDE_DIR}) endif(BUILD_LUA_IMLIB2) if(BUILD_LUA_RSVG) pkg_check_modules(RSVG REQUIRED librsvg-2.0>=2.46) set(luarsvg_libs ${RSVG_LIBRARIES} ${LUA_LIBRARIES}) set(luarsvg_includes ${RSVG_INCLUDE_DIRS} ${LUA_INCLUDE_DIRS}) endif(BUILD_LUA_RSVG) endif(BUILD_X11) if(BUILD_AUDACIOUS) set(WANT_GLIB true) pkg_check_modules(NEW_AUDACIOUS audacious>=1.4.0) if(NEW_AUDACIOUS_FOUND) pkg_check_modules(AUDACIOUS REQUIRED audclient>=1.4.0) pkg_check_modules(DBUS_GLIB REQUIRED dbus-glib-1) else(NEW_AUDACIOUS_FOUND) pkg_check_modules(AUDACIOUS REQUIRED audacious<1.4.0) endif(NEW_AUDACIOUS_FOUND) set(conky_libs ${conky_libs} ${AUDACIOUS_LIBRARIES} ${DBUS_GLIB_LIBRARIES}) set(conky_includes ${conky_includes} ${AUDACIOUS_INCLUDE_DIRS} ${DBUS_GLIB_INCLUDE_DIRS}) endif(BUILD_AUDACIOUS) if(BUILD_XMMS2) pkg_check_modules(XMMS2 REQUIRED xmms2-client>=0.6) set(conky_libs ${conky_libs} ${XMMS2_LIBRARIES}) set(conky_includes ${conky_includes} ${XMMS2_INCLUDE_DIRS}) endif(BUILD_XMMS2) if(BUILD_CURL) set(WANT_CURL true) endif(BUILD_CURL) if(BUILD_RSS) set(WANT_CURL true) set(WANT_LIBXML2 true) endif(BUILD_RSS) if(BUILD_WEATHER_METAR) set(WANT_CURL true) set(BUILD_WEATHER true) endif(BUILD_WEATHER_METAR) if(BUILD_NVIDIA) find_path(XNVCtrl_INCLUDE_PATH NVCtrl/NVCtrl.h ${INCLUDE_SEARCH_PATH}) find_library(XNVCtrl_LIB NAMES XNVCtrl) if(XNVCtrl_INCLUDE_PATH AND XNVCtrl_LIB) set(XNVCtrl_FOUND true) set(conky_libs ${conky_libs} ${XNVCtrl_LIB}) set(conky_includes ${conky_includes} ${XNVCtrl_INCLUDE_PATH}) else(XNVCtrl_INCLUDE_PATH AND XNVCtrl_LIB) message(FATAL_ERROR "Unable to find XNVCtrl library") endif(XNVCtrl_INCLUDE_PATH AND XNVCtrl_LIB) endif(BUILD_NVIDIA) if(BUILD_IMLIB2) pkg_search_module(IMLIB2 REQUIRED imlib2 Imlib2) set(conky_libs ${conky_libs} ${IMLIB2_LIBS} ${IMLIB2_LDFLAGS}) set(conky_includes ${conky_includes} ${IMLIB2_INCLUDE_DIRS}) endif(BUILD_IMLIB2) if(BUILD_JOURNAL) pkg_search_module(SYSTEMD REQUIRED libsystemd>=205 libsystemd-journal>=205) set(conky_libs ${conky_libs} ${SYSTEMD_LIB} ${SYSTEMD_LDFLAGS}) set(conky_includes ${conky_includes} ${SYSTEMD_INCLUDE_DIRS}) endif(BUILD_JOURNAL) if(BUILD_PULSEAUDIO) pkg_check_modules(PULSEAUDIO REQUIRED libpulse) set(conky_libs ${conky_libs} ${PULSEAUDIO_LIBRARIES}) set(conky_includes ${conky_includes} ${PULSEAUDIO_INCLUDE_DIRS}) endif(BUILD_PULSEAUDIO) # Common libraries if(WANT_GLIB) pkg_check_modules(GLIB REQUIRED glib-2.0>=2.36) set(conky_libs ${conky_libs} ${GLIB_LIBRARIES}) set(conky_includes ${conky_includes} ${GLIB_INCLUDE_DIRS}) endif(WANT_GLIB) if(WANT_CURL) pkg_check_modules(CURL REQUIRED libcurl) set(conky_libs ${conky_libs} ${CURL_LIBRARIES}) set(conky_includes ${conky_includes} ${CURL_INCLUDE_DIRS}) endif(WANT_CURL) if(WANT_LIBXML2) include(FindLibXml2) if(NOT LIBXML2_FOUND) message(FATAL_ERROR "Unable to find libxml2 library") endif(NOT LIBXML2_FOUND) set(conky_libs ${conky_libs} ${LIBXML2_LIBRARIES}) set(conky_includes ${conky_includes} ${LIBXML2_INCLUDE_DIR}) endif(WANT_LIBXML2) # Look for doc generation programs if(BUILD_DOCS) # Used for doc generation find_program(APP_DB2X_XSLTPROC db2x_xsltproc) if(NOT APP_DB2X_XSLTPROC) message(FATAL_ERROR "Unable to find program 'db2x_xsltproc'") endif(NOT APP_DB2X_XSLTPROC) find_program(APP_DB2X_MANXML db2x_manxml) if(NOT APP_DB2X_MANXML) message(FATAL_ERROR "Unable to find program 'db2x_manxml'") endif(NOT APP_DB2X_MANXML) find_program(APP_XSLTPROC xsltproc) if(NOT APP_XSLTPROC) message(FATAL_ERROR "Unable to find program 'xsltproc'") endif(NOT APP_XSLTPROC) find_program(APP_MAN man) if(NOT APP_MAN) message(FATAL_ERROR "Unable to find program 'man'") endif(NOT APP_MAN) find_program(APP_LESS less) if(NOT APP_LESS) message(FATAL_ERROR "Unable to find program 'less'") endif(NOT APP_LESS) find_program(APP_SED sed) if(NOT APP_SED) message(FATAL_ERROR "Unable to find program 'sed'") endif(NOT APP_SED) mark_as_advanced(APP_DB2X_XSLTPROC APP_DB2X_MANXML APP_XSLTPROC APP_MAN APP_SED APP_LESS) endif(BUILD_DOCS) if(CMAKE_BUILD_TYPE MATCHES "Debug") set(DEBUG true) endif(CMAKE_BUILD_TYPE MATCHES "Debug") # The version numbers are simply derived from the date and number of commits # since start of month if(DEBUG) execute_process(COMMAND ${APP_GIT} --git-dir=${CMAKE_CURRENT_SOURCE_DIR}/.git log --since=${VERSION_MAJOR}-${VERSION_MINOR}-01 --pretty=oneline COMMAND ${APP_WC} -l COMMAND ${APP_AWK} "{print $1}" RESULT_VARIABLE RETVAL OUTPUT_VARIABLE COMMIT_COUNT OUTPUT_STRIP_TRAILING_WHITESPACE) endif(DEBUG) conky-1.12.2/cmake/Docbook.cmake000066400000000000000000000101101404127277500163640ustar00rootroot00000000000000# # Conky, a system monitor, based on torsmo # # Please see COPYING for details # # Copyright (c) 2005-2021 Brenden Matthews, et. al. (see AUTHORS) All rights # reserved. # # 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 3 of the License, or (at your option) any later # version. # # 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. You should have received a copy of the GNU General Public License # along with this program. If not, see . # # ${db2x_xsltproc_cmd} -s man ${srcdir}/docs.xml -o docs.mxml ${db2x_manxml_cmd} # docs.mxml ${xsltproc_cmd} ${srcdir}/docbook-xml/docbook.xsl ${srcdir}/docs.xml # > docs.html man -P 'less -is' ./conky.1 > README sed -i # "s/[[:cntrl:]]\[[0-9]*m//g" README sed -i "s/\xE2//g" README sed -i # "s/\x80//g" README sed -i "s/\x90/-/g" README mv README ${top_srcdir} # ${xsltproc_cmd} ${srcdir}/variables.xsl ${srcdir}/variables.xml > # variables.html ${xsltproc_cmd} ${srcdir}/config_settings.xsl # ${srcdir}/config_settings.xml > config_settings.html ${xsltproc_cmd} # ${srcdir}/lua.xsl ${srcdir}/lua.xml > lua.html # else conky.1: # endif # man_MANS = conky.1 if(BUILD_DOCS) function(wrap_xsltproc) if(NOT ARGV) message(SEND_ERROR "Error: wrap_xsltproc called without any files") return() endif(NOT ARGV) foreach(FIL ${ARGV}) add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html COMMAND ${APP_XSLTPROC} ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xsl ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xml > ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xsl ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xml COMMENT "Running xsltproc on ${FIL}") add_custom_target(${FIL}.html ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html) endforeach(FIL) endfunction(wrap_xsltproc) function(wrap_man) if(NOT ARGV) message(SEND_ERROR "Error: wrap_man called without any files") return() endif(NOT ARGV) foreach(FIL ${ARGV}) add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.1 ${CMAKE_SOURCE_DIR}/README COMMAND ${APP_XSLTPROC} ${CMAKE_SOURCE_DIR}/doc/docbook-xml/html/docbook.xsl ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xml > ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html COMMAND ${APP_DB2X_XSLTPROC} -s man ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xml -o ${FIL}.mxml COMMAND ${APP_DB2X_MANXML} --encoding=utf-8 ${FIL}.mxml --output-dir ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${APP_XSLTPROC} ${CMAKE_SOURCE_DIR}/doc/docbook-xml/html/docbook.xsl ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xml > ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html COMMAND ${APP_MAN} -P '${APP_LESS} -is' ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.1 > ${CMAKE_SOURCE_DIR}/README COMMAND ${APP_SED} -i'' -e 's/[[:cntrl:]]\\[[0-9]*m//g' ${CMAKE_SOURCE_DIR}/README COMMAND ${APP_SED} -i'' -e 's/\\xE2//g' ${CMAKE_SOURCE_DIR}/README COMMAND ${APP_SED} -i'' -e 's/\\x80//g' ${CMAKE_SOURCE_DIR}/README COMMAND ${APP_SED} -i'' -e 's/\\x90/-/g' ${CMAKE_SOURCE_DIR}/README DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xml COMMENT "Processing man page for ${FIL}") add_custom_target(${FIL} ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html) endforeach(FIL) endfunction(wrap_man) endif(BUILD_DOCS) conky-1.12.2/cmake/FindClangFormat.cmake000066400000000000000000000011711404127277500200110ustar00rootroot00000000000000# Find Clang format # set(ClangFormat_BIN_NAME clang-format clang-format-5.0 clang-format-6.0 clang-format-7 clang-format-8 clang-format-9 clang-format-10 clang-format-11) find_program(ClangFormat_BIN NAMES ${ClangFormat_BIN_NAME}) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(ClangFormat DEFAULT_MSG ClangFormat_BIN) mark_as_advanced(ClangFormat_BIN) if(ClangFormat_FOUND) # A CMake script to find all source files and setup clang-format targets for # them include(clang-format) else() message("clang-format not found. Not setting up format targets") endif() conky-1.12.2/cmake/FindClangTidy.cmake000066400000000000000000000011211404127277500174650ustar00rootroot00000000000000# Find Clang tidy # set(ClangTidy_BIN_NAME clang-tidy clang-tidy-5.0 clang-tidy-6.0 clang-tidy-7 clang-tidy-8 clang-tidy-9 clang-tidy-10 clang-tidy-11) find_program(ClangTidy_BIN NAMES ${ClangTidy_BIN_NAME}) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(ClangTidy DEFAULT_MSG ClangTidy_BIN) mark_as_advanced(ClangTidy_BIN) if(ClangTidy_FOUND) # A CMake script to find all source files and setup clang-tidy targets for # them include(clang-tidy) else() message("clang-tidy not found. Not setting up tidy targets") endif() conky-1.12.2/cmake/FindXinerama.cmake000066400000000000000000000021641404127277500173630ustar00rootroot00000000000000# * Find the Xinerama include file and library # set(Xinerama_INC_SEARCH_PATH /usr/X11R6/include /usr/local/include /usr/include/X11 /usr/openwin/include /usr/openwin/share/include /opt/graphics/OpenGL/include /usr/include) set(Xinerama_LIB_SEARCH_PATH /usr/X11R6/lib /usr/local/lib /usr/openwin/lib /usr/lib) find_path(Xinerama_INCLUDE_DIR X11/extensions/Xinerama.h ${Xinerama_INC_SEARCH_PATH}) find_library(Xinerama_LIBRARIES NAMES Xinerama PATH ${Xinerama_LIB_SEARCH_PATH}) if(Xinerama_INCLUDE_DIR AND Xinerama_LIBRARIES) set(Xinerama_FOUND TRUE) endif(Xinerama_INCLUDE_DIR AND Xinerama_LIBRARIES) if(Xinerama_FOUND) include(CheckLibraryExists) check_library_exists(${Xinerama_LIBRARIES} "XineramaQueryScreens" ${Xinerama_LIBRARIES} Xinerama_HAS_QUERY) if(NOT Xinerama_HAS_QUERY AND Xinerama_FIND_REQUIRED) message(FATAL_ERROR "Could NOT find Xinerama") endif(NOT Xinerama_HAS_QUERY AND Xinerama_FIND_REQUIRED) endif(Xinerama_FOUND) mark_as_advanced(Xinerama_INCLUDE_DIR Xinerama_LIBRARIES) conky-1.12.2/cmake/ToLua.cmake000066400000000000000000000046351404127277500160470ustar00rootroot00000000000000# # Conky, a system monitor, based on torsmo # # Please see COPYING for details # # Copyright (c) 2005-2021 Brenden Matthews, et. al. (see AUTHORS) All rights # reserved. # # 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 3 of the License, or (at your option) any later # version. # # 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. You should have received a copy of the GNU General Public License # along with this program. If not, see . # function(wrap_tolua VAR FIL) set(INCL) set(${VAR}) get_filename_component(ABS_FIL ${FIL} ABSOLUTE) get_filename_component(FIL_WE ${FIL} NAME_WE) list(APPEND ${VAR} "${CMAKE_CURRENT_BINARY_DIR}/lib${FIL_WE}.c") if(DEFINED ARGV2) get_filename_component(PATCH ${ARGV2} ABSOLUTE) set(TOLUA_OUT ${CMAKE_CURRENT_BINARY_DIR}/lib${FIL_WE}-orig.c) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lib${FIL_WE}.c COMMAND ${APP_PATCH} -s ${TOLUA_OUT} ${PATCH} -o ${CMAKE_CURRENT_BINARY_DIR}/lib${FIL_WE}.c DEPENDS ${TOLUA_OUT} ${PATCH} COMMENT "Patching lib${FIL_WE}-orig.c" VERBATIM) set_source_files_properties(${TOLUA_OUT} PROPERTIES GENERATED TRUE) else() set(TOLUA_OUT ${CMAKE_CURRENT_BINARY_DIR}/lib${FIL_WE}.c) endif(DEFINED ARGV2) # Call toluapp from 3rdparty/ path directly. The last argument to toluapp is # the path to the tolua Lua sources. add_custom_command(OUTPUT ${TOLUA_OUT} ${INCL} COMMAND toluapp -n ${FIL_WE} -o ${TOLUA_OUT} ${ABS_FIL} ${CMAKE_SOURCE_DIR}/3rdparty/toluapp/src/bin/lua/ DEPENDS ${ABS_FIL} COMMENT "Running tolua++ on ${FIL}" VERBATIM) set_source_files_properties(${${VAR}} ${INCL} PROPERTIES GENERATED TRUE) set_source_files_properties( ${${VAR}} PROPERTIES COMPILE_FLAGS "-Wno-bad-function-cast -Wno-unused-parameter -Wno-cast-qual -Wno-error=pedantic" ) set(${VAR} ${${VAR}} PARENT_SCOPE) endfunction(wrap_tolua) conky-1.12.2/cmake/build.h.in000066400000000000000000000002311404127277500156620ustar00rootroot00000000000000#ifndef __BUILD_H #define __BUILD_H /* Conky build info */ #define BUILD_DATE "@BUILD_DATE@" #define BUILD_ARCH "@BUILD_ARCH@" #endif /* __BUILD_H */ conky-1.12.2/cmake/clang-format.cmake000066400000000000000000000016511404127277500173700ustar00rootroot00000000000000set(ClangFormat_CXX_FILE_EXTENSIONS ${ClangFormat_CXX_FILE_EXTENSIONS} *.cpp *.h *.cxx *.hxx *.hpp *.cc *.hh *.ipp) foreach(PATTERN ${ClangFormat_CXX_FILE_EXTENSIONS}) list(APPEND ClangFormat_CXX_PATTERN ${CMAKE_SOURCE_DIR}/src/${PATTERN}) list(APPEND ClangFormat_CXX_PATTERN ${CMAKE_SOURCE_DIR}/tests/${PATTERN}) list(APPEND ClangFormat_CXX_PATTERN ${CMAKE_SOURCE_DIR}/lua/${PATTERN}) endforeach() file(GLOB_RECURSE ClangFormat_SRCS ${ClangFormat_CXX_PATTERN}) add_custom_target(clang-format COMMAND ${ClangFormat_BIN} -style=file -i ${ClangFormat_SRCS}) add_custom_target(check-clang-format COMMAND ${CMAKE_SOURCE_DIR}/bin/run-clang-format.py --color always --clang-format-executable ${ClangFormat_BIN} ${ClangFormat_SRCS}) conky-1.12.2/cmake/clang-tidy.cmake000066400000000000000000000021251404127277500170460ustar00rootroot00000000000000get_target_property(ClangTidy_SRCS_TMP conky SOURCES) get_target_property(conky_SRC_DIR conky SOURCE_DIR) if(BUILD_TESTS) get_target_property(ClangTidy_SRCS_TMP_CORE conky_core SOURCES) list(APPEND ClangTidy_SRCS_TMP ${ClangTidy_SRCS_TMP_CORE}) endif() foreach(TMP_SRC ${ClangTidy_SRCS_TMP}) if("${TMP_SRC}" MATCHES ".*\.cc|.*\.hh|.*\.[chi]pp|.*\.[chi]xx|.*\.ii") list(APPEND ClangTidy_SRCS ${conky_SRC_DIR}/${TMP_SRC}) endif() endforeach(TMP_SRC) get_target_property(CLANG_INCLUDES_tmp conky INCLUDE_DIRECTORIES) foreach(TMP_INCLUDE ${CLANG_INCLUDES_tmp}) list(APPEND CLANG_INCLUDES -I${TMP_INCLUDE}) endforeach(TMP_INCLUDE) add_custom_target(clang-tidy COMMAND ${ClangTidy_BIN} -config='' -fix -format-style=file ${ClangTidy_SRCS} -- -std=c++17 -I${CMAKE_BINARY_DIR} ${CLANG_INCLUDES}) add_custom_target(check-clang-tidy COMMAND ${ClangTidy_BIN} -config='' -format-style=file ${ClangTidy_SRCS} -- -std=c++17 -I${CMAKE_BINARY_DIR} ${CLANG_INCLUDES}) conky-1.12.2/cmake/config.h.in000066400000000000000000000050321404127277500160340ustar00rootroot00000000000000/* * Auto-generated header for CMake. See config.h.in if you need to modify the * original. */ #ifndef _conky_config_h_ #define _conky_config_h_ #cmakedefine DEBUG #define SYSTEM_NAME "@CMAKE_SYSTEM_NAME@" #define PACKAGE_NAME "@PROJECT_NAME@" #define VERSION "@VERSION@" #define SYSTEM_CONFIG_FILE "@SYSTEM_CONFIG_FILE@" #define PACKAGE_LIBDIR "@PACKAGE_LIBRARY_DIR@" #define DEFAULTNETDEV "@DEFAULTNETDEV@" #define XDG_CONFIG_FILE "@XDG_CONFIG_FILE@" #define CONFIG_FILE "@CONFIG_FILE@" #define LOCALE_DIR "@LOCALE_DIR@" #define MAX_USER_TEXT_DEFAULT @MAX_USER_TEXT_DEFAULT@ #define DEFAULT_TEXT_BUFFER_SIZE @DEFAULT_TEXT_BUFFER_SIZE@ #define MAX_NET_INTERFACES @MAX_NET_INTERFACES@ #define HTTPPORT @HTTPPORT@ #cmakedefine BUILD_I18N 1 #cmakedefine HAVE_SYS_STATFS_H 1 #cmakedefine HAVE_SYS_PARAM_H 1 #cmakedefine HAVE_SYS_INOTIFY_H 1 #cmakedefine HAVE_DIRENT_H 1 #cmakedefine HAVE_SOME_SOUNDCARD_H 1 #cmakedefine HAVE_LINUX_SOUNDCARD_H 1 #cmakedefine HAVE_STRNDUP 1 #cmakedefine HAVE_FOPENCOOKIE 1 #cmakedefine HAVE_FUNOPEN 1 #cmakedefine HAVE_PIPE2 1 #cmakedefine HAVE_O_CLOEXEC 1 #cmakedefine HAVE_CLOCK_GETTIME 1 #cmakedefine BUILD_X11 1 #cmakedefine OWN_WINDOW 1 #cmakedefine BUILD_XDAMAGE 1 #cmakedefine BUILD_XINERAMA 1 #cmakedefine BUILD_XFT 1 #cmakedefine BUILD_XSHAPE 1 #cmakedefine BUILD_ARGB 1 #cmakedefine BUILD_XDBE 1 #cmakedefine BUILD_PORT_MONITORS 1 #cmakedefine BUILD_AUDACIOUS 1 #cmakedefine NEW_AUDACIOUS_FOUND 1 #cmakedefine BUILD_MPD 1 #cmakedefine BUILD_MYSQL 1 #cmakedefine BUILD_MOC 1 #cmakedefine BUILD_NVIDIA 0 #cmakedefine BUILD_XMMS2 1 #cmakedefine BUILD_HDDTEMP 1 #cmakedefine BUILD_LIBXML2 1 #cmakedefine BUILD_CURL 1 #cmakedefine BUILD_WEATHER_METAR 1 #cmakedefine BUILD_IMLIB2 1 #cmakedefine BUILD_MATH 1 #cmakedefine BUILD_BUILTIN_CONFIG 1 #cmakedefine BUILD_OLD_CONFIG 1 #cmakedefine BUILD_NCURSES 1 #cmakedefine LEAKFREE_NCURSES 1 #cmakedefine BUILD_APCUPSD 1 #cmakedefine BUILD_IOSTATS 1 #cmakedefine BUILD_IPGFREQ 0 #cmakedefine BUILD_WLAN 1 #cmakedefine BUILD_ICAL 1 #cmakedefine BUILD_IRC 1 #cmakedefine BUILD_PULSEAUDIO 1 #cmakedefine BUILD_INTEL_BACKLIGHT 0 #cmakedefine BUILD_IPV6 1 #cmakedefine BUILD_HTTP 1 #cmakedefine BUILD_ICONV 1 #cmakedefine BUILD_LUA_CAIRO 1 #cmakedefine BUILD_LUA_IMLIB2 1 #cmakedefine BUILD_LUA_RSVG 1 #cmakedefine BUILD_IBM 1 #cmakedefine BUILD_RSS 1 #cmakedefine BUILD_CMUS 1 #cmakedefine BUILD_JOURNAL 1 #cmakedefine BUILD_HSV_GRADIENT 1 #cmakedefine HAVE_STATFS64 1 #ifndef HAVE_STATFS64 #define statfs64 statfs #endif #endif /* _conky_config_h_ */ conky-1.12.2/cmake/scripts/000077500000000000000000000000001404127277500155005ustar00rootroot00000000000000conky-1.12.2/cmake/scripts/clang-format-check-changed000077500000000000000000000006551404127277500224500ustar00rootroot00000000000000#!/bin/bash # Required because cmake root isn't git root in this example CLANG_FORMAT_BIN=$1 GIT_ROOT=`git rev-parse --show-toplevel` pushd ${GIT_ROOT} > /dev/null git status --porcelain \ | egrep '*\.cpp|*\.h|*\.cxx|*\.hxx|*\.hpp|*\.cc' \ | awk -F " " '{print $NF}' \ | xargs -r ${CLANG_FORMAT_BIN} -style=file -output-replacements-xml \ | grep "replacement offset" 2>&1 > /dev/null RET=$? popd > /dev/null exit ${RET} conky-1.12.2/cmake/scripts/clang-format-check-changed.py000077500000000000000000000117471404127277500231030ustar00rootroot00000000000000#!/usr/bin/env python3 import argparse import os import sys import subprocess def check_file(filename, excludes, extensions): """ Check if a file should be included in our check """ name, ext = os.path.splitext(filename) if len(ext) > 0 and ext in extensions: if len(excludes) == 0: return True for exclude in excludes: if exclude in filename: return False return True return False def check_directory(directory, excludes, extensions): output = [] if len(excludes) > 0: for exclude in excludes: if exclude in directory: directory_excluded = False return output for root, _, files in os.walk(directory): for file in files: filename = os.path.join(root, file) if check_file(filename, excludes, extensions): print("Will check file [{}]".format(filename)) output.append(filename) return output def get_git_root(git_bin): cmd = [git_bin, "rev-parse", "--show-toplevel"] try: return subprocess.check_output(cmd).strip() except subprocess.CalledProcessError, e: print("Error calling git [{}]".format(e)) raise def clean_git_filename(line): """ Takes a line from git status --porcelain and returns the filename """ file = None git_status = line[:2] # Not an exhaustive list of git status output but should # be enough for this case # check if this is a delete if 'D' in git_status: return None # ignored file if '!' in git_status: return None # Covers renamed files if '->' in line: file = line[3:].split('->')[-1].strip() else: file = line[3:].strip() return file def get_changed_files(git_bin, excludes, file_extensions): """ Run git status and return the list of changed files """ extensions = file_extensions.split(",") # arguments coming from cmake will be *.xx. We want to remove the * for i, extension in enumerate(extensions): if extension[0] == '*': extensions[i] = extension[1:] git_root = get_git_root(git_bin) cmd = [git_bin, "status", "--porcelain", "--ignore-submodules"] print("git cmd = {}".format(cmd)) output = [] returncode = 0 try: cmd_output = subprocess.check_output(cmd) for line in cmd_output.split('\n'): if len(line) > 0: file = clean_git_filename(line) if not file: continue file = os.path.join(git_root, file) if file[-1] == "/": directory_files = check_directory( file, excludes, file_extensions) output = output + directory_files else: if check_file(file, excludes, file_extensions): print("Will check file [{}]".format(file)) output.append(file) except subprocess.CalledProcessError, e: print("Error calling git [{}]".format(e)) returncode = e.returncode return output, returncode def run_clang_format(clang_format_bin, changed_files): """ Run clang format on a list of files @return 0 if formatted correctly. """ if len(changed_files) == 0: return 0 cmd = [clang_format_bin, "-style=file", "-output-replacements-xml"] + changed_files print("clang-format cmd = {}".format(cmd)) try: cmd_output = subprocess.check_output(cmd) if "replacement offset" in cmd_output: print("ERROR: Changed files don't match format") return 1 except subprocess.CalledProcessError, e: print("Error calling clang-format [{}]".format(e)) return e.returncode return 0 def cli(): # global params parser = argparse.ArgumentParser(prog='clang-format-check-changed', description='Checks if files changed in git match the .clang-format specification') parser.add_argument("--file-extensions", type=str, default=".cpp,.h,.cxx,.hxx,.hpp,.cc,.ipp", help="Comma separated list of file extensions to check") parser.add_argument('--exclude', action='append', default=[], help='Will not match the files / directories with these in the name') parser.add_argument('--clang-format-bin', type=str, default="clang-format", help="The clang format binary") parser.add_argument('--git-bin', type=str, default="git", help="The git binary") args = parser.parse_args() # Run gcovr to get the .gcda files form .gcno changed_files, returncode = get_changed_files( args.git_bin, args.exclude, args.file_extensions) if returncode != 0: return returncode return run_clang_format(args.clang_format_bin, changed_files) if __name__ == '__main__': sys.exit(cli()) conky-1.12.2/conky.desktop000066400000000000000000000002461404127277500154510ustar00rootroot00000000000000[Desktop Entry] Type=Application Name=conky Exec=conky --daemonize --pause=1 StartupNotify=false Terminal=false Icon=conky-logomark-violet Categories=System;Monitor; conky-1.12.2/data/000077500000000000000000000000001404127277500136425ustar00rootroot00000000000000conky-1.12.2/data/CMakeLists.txt000066400000000000000000000035361404127277500164110ustar00rootroot00000000000000# # Conky, a system monitor, based on torsmo # # Please see COPYING for details # # Copyright (c) 2005-2021 Brenden Matthews, et. al. (see AUTHORS) All rights # reserved. # # 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 3 of the License, or (at your option) any later # version. # # 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. You should have received a copy of the GNU General Public License # along with this program. If not, see . # if(BUILD_BUILTIN_CONFIG) # generate defconfig if(BUILD_X11) set(builtin_config conky.conf) else(BUILD_X11) set(builtin_config conky_no_x11.conf) endif(BUILD_X11) add_custom_command(OUTPUT defconfig.h COMMAND ${CMAKE_SOURCE_DIR}/bin/text2c.sh ${CMAKE_CURRENT_SOURCE_DIR}/${builtin_config} defconfig.h defconfig DEPENDS ${builtin_config}) add_custom_target(defconfig ALL DEPENDS defconfig.h) set_source_files_properties(defconfig.h PROPERTIES GENERATED TRUE) endif(BUILD_BUILTIN_CONFIG) if(BUILD_OLD_CONFIG) add_custom_command(OUTPUT convertconf.h COMMAND ${CMAKE_SOURCE_DIR}/bin/text2c.sh ${CMAKE_SOURCE_DIR}/extras/convert.lua convertconf.h convertconf DEPENDS ${CMAKE_SOURCE_DIR}/extras/convert.lua) add_custom_target(convertconf ALL DEPENDS convertconf.h) set_source_files_properties(convertconf.h PROPERTIES GENERATED TRUE) endif(BUILD_OLD_CONFIG) conky-1.12.2/data/conky-dfly-smp.conf000066400000000000000000000052031404127277500173650ustar00rootroot00000000000000-- Conky, a system monitor https://github.com/brndnmtthws/conky -- -- This configuration file is Lua code. You can write code in here, and it will -- execute when Conky loads. You can use it to generate your own advanced -- configurations. -- -- Try this (remove the `--`): -- -- print("Loading Conky config") -- -- For more on Lua, see: -- https://www.lua.org/pil/contents.html conky.config = { alignment = 'bottom_left', background = false, border_width = 1, cpu_avg_samples = 2, default_color = 'white', default_outline_color = 'white', default_shade_color = 'white', draw_borders = false, draw_graph_borders = true, draw_outline = false, draw_shades = false, use_xft = false, --font = 'DejaVu Sans Mono:size=12', gap_x = 5, gap_y = 30, minimum_height = 5, minimum_width = 5, net_avg_samples = 2, no_buffers = true, out_to_console = false, out_to_stderr = false, extra_newline = false, own_window = false, own_window_class = 'Conky', own_window_type = 'desktop', stippled_borders = 0, update_interval = 3.0, uppercase = false, use_spacer = 'none', show_graph_scale = false, show_graph_range = false } conky.text = [[ $sysname $version on $machine $hr ${color grey}Uptime:$color $uptime #${color grey}Temp:$color $acpitemp #${color grey}Frequency (in MHz):$color $freq #${color grey}Frequency (in GHz):$color $freq_g ${color grey}RAM Usage:$color $mem/$memmax - $memperc% ${membar 4} ${color grey}Swap Usage:$color $swap/$swapmax - $swapperc% ${swapbar 4} ${color grey}CPU Usage:$color $cpu% ${cpubar 4} ${color grey}CPU 0: ${cpu cpu1}% ${cpubar cpu1 4} CPU 1: ${cpu cpu2}% ${cpubar cpu2 4} CPU 2: ${cpu cpu3}% ${cpubar cpu3 4} CPU 3: ${cpu cpu4}% ${cpubar cpu4 4}$color ${color grey}Processes:$color $processes ${color grey}Running:$color $running_processes $hr ${color grey}File systems: / $color${fs_used /}/${fs_size /} ${fs_bar 6 /} ${color grey}Networking: Up:$color ${upspeed re0} ${color grey} - Down:$color ${downspeed re0} $hr ${color grey}Name PID CPU% MEM% ${color lightgrey} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1} ${color lightgrey} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2} ${color lightgrey} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3} ${color lightgrey} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4} ${color lightgrey} ${top name 5} ${top pid 5} ${top cpu 5} ${top mem 5} ${color lightgrey} ${top name 6} ${top pid 6} ${top cpu 6} ${top mem 6} ${color lightgrey} ${top name 7} ${top pid 7} ${top cpu 7} ${top mem 7} ${color lightgrey} ${top name 8} ${top pid 8} ${top cpu 8} ${top mem 8} ]] conky-1.12.2/data/conky.conf000066400000000000000000000044371404127277500156440ustar00rootroot00000000000000-- Conky, a system monitor https://github.com/brndnmtthws/conky -- -- This configuration file is Lua code. You can write code in here, and it will -- execute when Conky loads. You can use it to generate your own advanced -- configurations. -- -- Try this (remove the `--`): -- -- print("Loading Conky config") -- -- For more on Lua, see: -- https://www.lua.org/pil/contents.html conky.config = { alignment = 'top_left', background = false, border_width = 1, cpu_avg_samples = 2, default_color = 'white', default_outline_color = 'white', default_shade_color = 'white', double_buffer = true, draw_borders = false, draw_graph_borders = true, draw_outline = false, draw_shades = false, extra_newline = false, font = 'DejaVu Sans Mono:size=12', gap_x = 60, gap_y = 60, minimum_height = 5, minimum_width = 5, net_avg_samples = 2, no_buffers = true, out_to_console = false, out_to_ncurses = false, out_to_stderr = false, out_to_x = true, own_window = true, own_window_class = 'Conky', own_window_type = 'desktop', show_graph_range = false, show_graph_scale = false, stippled_borders = 0, update_interval = 1.0, uppercase = false, use_spacer = 'none', use_xft = true, } conky.text = [[ ${color grey}Info:$color ${scroll 32 Conky $conky_version - $sysname $nodename $kernel $machine} $hr ${color grey}Uptime:$color $uptime ${color grey}Frequency (in MHz):$color $freq ${color grey}Frequency (in GHz):$color $freq_g ${color grey}RAM Usage:$color $mem/$memmax - $memperc% ${membar 4} ${color grey}Swap Usage:$color $swap/$swapmax - $swapperc% ${swapbar 4} ${color grey}CPU Usage:$color $cpu% ${cpubar 4} ${color grey}Processes:$color $processes ${color grey}Running:$color $running_processes $hr ${color grey}File systems: / $color${fs_used /}/${fs_size /} ${fs_bar 6 /} ${color grey}Networking: Up:$color ${upspeed} ${color grey} - Down:$color ${downspeed} $hr ${color grey}Name PID CPU% MEM% ${color lightgrey} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1} ${color lightgrey} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2} ${color lightgrey} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3} ${color lightgrey} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4} ]] conky-1.12.2/data/conky_no_x11.conf000066400000000000000000000023601404127277500170220ustar00rootroot00000000000000-- Conky, a system monitor https://github.com/brndnmtthws/conky -- -- This configuration file is Lua code. You can write code in here, and it will -- execute when Conky loads. You can use it to generate your own advanced -- configurations. -- -- Try this (remove the `--`): -- -- print("Loading Conky config") -- -- For more on Lua, see: -- https://www.lua.org/pil/contents.html conky.config = { background = false, cpu_avg_samples = 2, net_avg_samples = 2, no_buffers = true, out_to_stderr = false, update_interval = 1.0, uppercase = false, use_spacer = 'none', }; conky.text = [[${scroll 16 $nodename - $sysname $kernel on $machine | } Uptime: $uptime Frequency (in MHz): $freq Frequency (in GHz): $freq_g RAM Usage: $mem/$memmax - $memperc% ${membar 4} Swap Usage: $swap/$swapmax - $swapperc% ${swapbar 4} CPU Usage: $cpu% ${cpubar 4} Processes: $processes Running: $running_processes File systems: / ${fs_used /}/${fs_size /} ${fs_bar 6 /} Networking: Up: ${upspeed} - Down: ${downspeed} Name PID CPU% MEM% ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4} ]]; conky-1.12.2/doc/000077500000000000000000000000001404127277500134765ustar00rootroot00000000000000conky-1.12.2/doc/CMakeLists.txt000066400000000000000000000016311404127277500162370ustar00rootroot00000000000000# # Conky, a system monitor, based on torsmo # # Please see COPYING for details # # Copyright (c) 2005-2021 Brenden Matthews, et. al. (see AUTHORS) All rights # reserved. # # 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 3 of the License, or (at your option) any later # version. # # 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. You should have received a copy of the GNU General Public License # along with this program. If not, see . # include(Docbook) if(BUILD_DOCS) wrap_xsltproc(lua config_settings variables) wrap_man(docs) endif(BUILD_DOCS) conky-1.12.2/doc/README.docs000066400000000000000000000041351404127277500153100ustar00rootroot00000000000000DA DOCS. YO. ============ The main file that contains the bulk of our documentation is docs.xml . We use the DocBook format, which is a really kickass xml-based way of writing documentation, heavily oriented towards programming and computer stuff. There are tags like and

    #fffafa #b4cdcd
    Variable Explanation
    conky-1.12.2/doc/conky-howto.xml000066400000000000000000000207121404127277500165030ustar00rootroot00000000000000 Gentoo Linux Conky Howto Bill Woodford Brenden Matthews This document describes how to install and configure the system monitor known as Conky. 1.0 2006-02-22 Background
    Introduction to Conky

    So you have a Gentoo machine, and have already learned 30 different commands to monitor different aspects of what your computer is doing at the current moment. What do you do from here? Isn't there an easier way to monitor system performance and see what its doing, as well as the resources its using to perform all those tasks? This is what a system monitor, such as Conky, provides.

    What it does

    Unlike other system monitors such as top, Conky can run as a window in an X session, or by drawing to the root window (there is also an option to have Conky display information to stdout, but we won't discuss that here). It displays the information it has gathered through the use of both text, progress bars, and graphs. Also unlike top, the way it is formatted is completely user-configurable. In addition to monitoring the system itself, Conky can also give you information about several music players (such as XMMS, Music Player Daemon, and Audacious Media Player), tell you how many new messages are in your mail spool, and plenty more. If the functionality you require isn't in Conky yet, it is a simple matter of writing a script to get the information you would like - some examples of this, which have already been done are RSS feeds, POP3 e-mail message count, local weather, boinc status, and even the status of portage.

    Installing Conky
    Base install

    Gentoo provides an ebuild to quickly and easily install Conky. Pay particular attention to the the USE flags. You'll most likely want X11 support ( X), and make sure you select the USE flags for any music players (other than MPD) which you want. XMMS ( xmms), Audacious ( audacious), or XMMS support via the xmms-infopipe plugin ( infopipe).

    # Example line to append to /etc/portage/package.use if you don't
    want the
    default USE flags.
    app-admin/conky xmms infopipe -ipv6
    

    In addition, the truetypeUSE flag compiles support for TrueType fonts with the use of Xft. Most users will want this as well.

    Once you have your USE flags correctly set up, it's time to install Conky!

    emerge -av conky
    

    You can test Conky to see how it will look by running the command conkyin a terminal. This will likely give you a good reference to how it will look and what you want to change, add or even remove.

    $
    conky
    

    Once you have an idea of how Conky looks, you can now move on to configuring it!

    Configuring Conky

    By default, Conky will look for a configuration file in the users home directory located at ~/.config/conky/conky.confThis file contains all the configuration options, and the static text, colors and other variables which control what data is shown to the user. Conky also provides a great sample configuration, located at /usr/share/doc/conky-version/Conkyrc.sample.gzMake sure to replace "version" with the specific version of Conky you have installed.

    $
    mkdir -p ~/.config/conky
    $
    zcat /usr/share/conky-1.6.0/conkyrc.sample.gz >>
    ~/.config/conky/conky.conf
    
    Make sure to replace "1.6.0" with the specific version of Conky you have installed.

    Now, open up the sample configuration in the text editor of your choice. You may notice that there are two separate sections of the configuration file. The first section of the file, contains the programs configuration options and controls how it acts. This includes things such as the update_interval, or how often Conky will update the information on the screen. The second section contains the actual text, graphs, and variables which are rendered on the screen. This includes things such as the system uptime ( $uptime), cpu usage ( $cpu) and anything else you want to be shown. The first section of the file starts right from the beginning, the second section is comprised of everything after the line which says " TEXT". Comments in the file start with #, but keep in mind that even if a line is commented out in the second section of the file, the text will still be rendered to the screen.

    Lists of all the available configuration options and variables are kept at http://conky.sourceforge.net/config_settings.htmland http://conky.sourceforge.net/variables.html. Also, there's a few great sample configurations and screenshots of working configurations at http://conky.sourceforge.net/screenshots.html.

    Extending Conky
    Beyond the built-in variables

    So you've gotten this far, and have scoured the Conky documentation for that extra variable which Conky just doesn't seem to have... You're in luck! Conky provides several variables for just this reason! $execWill run a command every time Conky updates, $execiwill run a command at a specified interval and $texeciwill run a command in it's own thread at a specified interval.

    ${exec grep 'sudo' /var/log/messages | tail -n 4}
    ${execi 30 ~/scripts/emerge-status.sh
    ${texeci 600 ~/scripts/gmail.pl}
    
    While any command which works in a command shell will work in any of these variables, it is important to keep in mind that the commands must exit. This means that commands like tail -fwhich keep running will NOT work properly.
    conky-1.12.2/doc/docbook-xml/000077500000000000000000000000001404127277500157145ustar00rootroot00000000000000conky-1.12.2/doc/docbook-xml/ChangeLog000066400000000000000000000055711404127277500174760ustar00rootroot000000000000002006-10-03 13:23 nwalsh * trunk/docbook/sgml/catalog.xml, trunk/docbook/sgml/docbook.cat, trunk/docbook/sgml/docbook.dcl, trunk/docbook/sgml/docbook.dtd, calstblx.dtd, catalog.xml, dbcentx.mod, dbgenent.mod, dbhierx.mod, dbnotnx.mod, dbpoolx.mod, docbook.cat, docbookx.dtd, htmltblx.mod: DocBook V4.5 released 2006-06-02 11:28 nwalsh * calstblx.dtd, catalog.xml, dbcentx.mod, dbgenent.mod, dbhierx.mod, dbnotnx.mod, dbpoolx.mod, docbook.cat, docbookx.dtd, freshmeat.xsl, htmltblx.mod: Changed copyright dates and version numbers 2006-05-30 20:58 nwalsh * htmltblx.mod: Supply tag omission markers in SGML; suppress xml:lang in SGML 2006-03-07 13:11 nwalsh * trunk/docbook/sgml/catalog.xml, trunk/docbook/sgml/docbook.cat, trunk/docbook/sgml/docbook.dcl, trunk/docbook/sgml/docbook.dtd, calstblx.dtd, catalog.xml, dbcentx.mod, dbgenent.mod, dbhierx.mod, dbnotnx.mod, dbpoolx.mod, docbook.cat, docbookx.dtd, freshmeat.xsl, htmltblx.mod: Change version numbers to 4.5CR2 2006-03-07 13:03 nwalsh * dbpoolx.mod: Allow citebiblioid anywhere the other citation elements are allowed 2006-02-16 21:12 nwalsh * calstblx.dtd, catalog.xml, dbcentx.mod, dbgenent.mod, dbhierx.mod, dbnotnx.mod, dbpoolx.mod, docbook.cat, docbookx.dtd, freshmeat.xsl, htmltblx.mod: DocBook V4.5 released 2005-06-29 10:59 nwalsh * trunk/docbook/sgml/docbook.dtd, docbookx.dtd: DocBook V4.5CR1 Released 2005-06-29 10:58 nwalsh * trunk/docbook/sgml/catalog.xml, trunk/docbook/sgml/docbook.cat, trunk/docbook/sgml/docbook.dcl, calstblx.dtd, catalog.xml, dbcentx.mod, dbgenent.mod, dbhierx.mod, dbnotnx.mod, dbpoolx.mod, docbook.cat, htmltblx.mod: Updated version number 2005-06-29 10:53 nwalsh * freshmeat.xsl: Tweaked freshmeat changes 2005-06-24 21:09 nwalsh * calstblx.dtd, dbhierx.mod, dbpoolx.mod, htmltblx.mod, soextblx.dtd: Added doc: structured comments 2005-05-05 11:41 nwalsh * trunk/docbook/sgml/docbook.dtd, docbookx.dtd: DocBook V4.5b1 Released 2005-05-05 11:40 nwalsh * trunk/docbook/sgml/catalog.xml, trunk/docbook/sgml/docbook.cat, trunk/docbook/sgml/docbook.dcl, calstblx.dtd, catalog.xml, dbcentx.mod, dbgenent.mod, dbhierx.mod, dbnotnx.mod, dbpoolx.mod, docbook.cat, htmltblx.mod: Updated version number 2005-05-05 11:37 nwalsh * freshmeat.xsl: Prepare for 4.5b1 2005-05-05 10:59 nwalsh * dbpoolx.mod: RFE 1055480: Make revnumber optional 2005-05-05 10:54 nwalsh * dbpoolx.mod, htmltblx.mod: Allow common attributes on HTML table elements 2005-05-05 10:48 nwalsh * dbpoolx.mod: Added termdef 2005-05-05 10:39 nwalsh * dbpoolx.mod: Added mathphrase 2005-05-05 10:33 nwalsh * dbhierx.mod: RFE 1070458: Allow colophon in article 2005-05-05 10:32 nwalsh * dbpoolx.mod: RFE 1070770: Allow procedure in example 2005-05-05 10:21 nwalsh * dbpoolx.mod: Add isrn to list of biblioid class attribute values conky-1.12.2/doc/docbook-xml/VERSION.xsl000066400000000000000000000106631404127277500175770ustar00rootroot00000000000000 docbook-xsl 1.78.1 9732 $Revision: 9732 $ $URL: svn+ssh://bobstayton@svn.code.sf.net/p/docbook/code/trunk/xsl/VERSION.xsl $ DocBook XSL Stylesheets 1.79.1 * Major feature enhancements http://sourceforge.net/projects/docbook/ http://prdownloads.sourceforge.net/docbook/{DISTRONAME-VERSION}.tar.gz?download http://prdownloads.sourceforge.net/docbook/{DISTRONAME-VERSION}.zip?download http://prdownloads.sourceforge.net/docbook/{DISTRONAME-VERSION}.bz2?download http://sourceforge.net/project/shownotes.php?release_id={SFRELID} http://docbook.svn.sourceforge.net/viewvc/docbook/ http://lists.oasis-open.org/archives/docbook-apps/ This is a release with bugfixes and some enhancements. You must specify the sf-relid as a parameter. : : : conky-1.12.2/doc/docbook-xml/calstblx.dtd000066400000000000000000000217261404127277500202350ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/common/000077500000000000000000000000001404127277500172045ustar00rootroot00000000000000conky-1.12.2/doc/docbook-xml/common/addns.xsl000066400000000000000000000114371404127277500210330ustar00rootroot00000000000000 Warn no @xml:base cannot add @xml:base to node-set root element Warn no @xml:base relative paths may not work / conky-1.12.2/doc/docbook-xml/common/af.xml000066400000000000000000001355201404127277500203220ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/am.xml000066400000000000000000001370151404127277500203320ustar00rootroot00000000000000 áˆáˆáŠ­á‰¶á‰½ A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/ar.xml000066400000000000000000001362511404127277500203400ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/as.xml000066400000000000000000001113161404127277500203340ustar00rootroot00000000000000 চিহà§à¦¨ A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/ast.xml000066400000000000000000001020761404127277500205230ustar00rootroot00000000000000 Símbolos A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/autoidx-kimber.xsl000066400000000000000000000031261404127277500226620ustar00rootroot00000000000000 %common.entities; ]> ERROR: the 'kimber' index method requires the Saxon version 6 or 8 XSLT processor. 1 conky-1.12.2/doc/docbook-xml/common/autoidx-kosek.xsl000066400000000000000000000120331404127277500225220ustar00rootroot00000000000000 %common.entities; ]> ERROR: the 'kosek' index method does not work with the xsltproc XSLT processor. 1 No " " localization of index grouping letters exists . ; using "en". 0 No " " localization of index grouping letters exists . ; using "en". conky-1.12.2/doc/docbook-xml/common/az.xml000066400000000000000000001030251404127277500203410ustar00rootroot00000000000000 İşarÉ™lÉ™r A a B b C c Ç ç D d E e e e Æ É™ G g Äž ÄŸ H h X x I ı İ i J j K k Q q L l M m N n O o Ö ö P p R r S s Åž ÅŸ T t U u Ü ü V v Y y Z z conky-1.12.2/doc/docbook-xml/common/bg.xml000066400000000000000000001123771404127277500203310ustar00rootroot00000000000000 Цифри и знаци Ра Б б Ð’ в Г г Д д Е е Ж ж З з И и Й й К к Л л М м Рн О о П п Р Ñ€ С Ñ Ð¢ Ñ‚ У у Ф Ñ„ Ð¥ Ñ… Ц ц Ч ч Ш ш Щ щ Ъ ÑŠ Ь ÑŒ Ю ÑŽ Я Ñ Ð­ Ñ Ð« Ñ‹ A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/bn.xml000066400000000000000000001435411404127277500203350ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/bn_in.xml000066400000000000000000001127751404127277500210300ustar00rootroot00000000000000 সংকেত A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/bs.xml000066400000000000000000001015461404127277500203410ustar00rootroot00000000000000 Simboli A a B b C c Ć ć ÄŒ Ä D d Ä Ä‘ E e F f G g H h I i J j K k L l M m N n O o P p R r S s Å  Å¡ T t U u V v Z z Ž ž conky-1.12.2/doc/docbook-xml/common/ca.xml000066400000000000000000001016001404127277500203070ustar00rootroot00000000000000 Símbols A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/charmap.xml000066400000000000000000000150671404127277500213520ustar00rootroot00000000000000 Common » Character-Map Template Reference $Id: charmap.xsl 7266 2007-08-22 11:58:42Z xmldoc $ Introduction This is technical reference documentation for the character-map templates in the DocBook XSL Stylesheets. These templates are defined in a separate file from the set of “common†templates because some of the common templates reference DocBook XSL stylesheet parameters, requiring the entire set of parameters to be imported/included in any stylesheet that imports/includes the common templates. The character-map templates don’t import or include any DocBook XSL stylesheet parameters, so the character-map templates can be used without importing the whole set of parameters. This is not intended to be user documentation. It is provided for developers writing customization layers for the stylesheets. apply-character-map Applies an XSLT character map <xsl:template name="apply-character-map"> <xsl:param name="content"/> <xsl:param name="map.contents"/> ... </xsl:template> Description This template applies an XSLT character map; that is, it causes certain individual characters to be substituted with strings of one or more characters. It is useful mainly for replacing multiple “special†characters or symbols in the same target content. It uses the value of map.contents to do substitution on content, and then returns the modified contents. This template is a very slightly modified version of Jeni Tennison’s replace_strings template in the multiple string replacements section of Dave Pawson’s XSLT FAQ. The apply-string-subst-map template is essentially the same template as the apply-character-map template; the only difference is that in the map that apply-string-subst-map expects, oldstring and newstring attributes are used instead of character and string attributes. Parameters content The content on which to perform the character-map substitution. map.contents A node set of elements, with each element having the following attributes: character, a character to be replaced string, a string with which to replace character read-character-map Reads in all or part of an XSLT character map <xsl:template name="read-character-map"> <xsl:param name="use.subset"/> <xsl:param name="subset.profile"/> <xsl:param name="uri"/> ... </xsl:template> Description The XSLT 2.0 specification describes character maps and explains how they may be used to allow a specific character appearing in a text or attribute node in a final result tree to be substituted by a specified string of characters during serialization. The read-character-map template provides a means for reading and using character maps with XSLT 1.0-based tools. This template reads the character-map contents from uri (in full or in part, depending on the value of the use.subset parameter), then passes those contents to the apply-character-map template, along with content, the data on which to perform the character substitution. Using the character map “in part†means that it uses only those output-character elements that match the XPath expression given in the value of the subset.profile parameter. The current implementation of that capability here relies on the evaluate extension XSLT function. Parameters use.subset Specifies whether to use a subset of the character map instead of the whole map; boolean 0 or 1 subset.profile XPath expression that specifies what subset of the character map to use uri URI for a character map conky-1.12.2/doc/docbook-xml/common/charmap.xsl000066400000000000000000000224731404127277500213570ustar00rootroot00000000000000 Common » Character-Map Template Reference $Id: charmap.xsl 7266 2007-08-22 11:58:42Z xmldoc $ Introduction This is technical reference documentation for the character-map templates in the DocBook XSL Stylesheets. These templates are defined in a separate file from the set of “common†templates because some of the common templates reference DocBook XSL stylesheet parameters, requiring the entire set of parameters to be imported/included in any stylesheet that imports/includes the common templates. The character-map templates don’t import or include any DocBook XSL stylesheet parameters, so the character-map templates can be used without importing the whole set of parameters. This is not intended to be user documentation. It is provided for developers writing customization layers for the stylesheets. Applies an XSLT character map This template applies an XSLT character map; that is, it causes certain individual characters to be substituted with strings of one or more characters. It is useful mainly for replacing multiple “special†characters or symbols in the same target content. It uses the value of map.contents to do substitution on content, and then returns the modified contents. This template is a very slightly modified version of Jeni Tennison’s replace_strings template in the multiple string replacements section of Dave Pawson’s XSLT FAQ. The apply-string-subst-map template is essentially the same template as the apply-character-map template; the only difference is that in the map that apply-string-subst-map expects, oldstring and newstring attributes are used instead of character and string attributes. content The content on which to perform the character-map substitution. map.contents A node set of elements, with each element having the following attributes: character, a character to be replaced string, a string with which to replace character Reads in all or part of an XSLT character map The XSLT 2.0 specification describes character maps and explains how they may be used to allow a specific character appearing in a text or attribute node in a final result tree to be substituted by a specified string of characters during serialization. The read-character-map template provides a means for reading and using character maps with XSLT 1.0-based tools. This template reads the character-map contents from uri (in full or in part, depending on the value of the use.subset parameter), then passes those contents to the apply-character-map template, along with content, the data on which to perform the character substitution. Using the character map “in part†means that it uses only those output-character elements that match the XPath expression given in the value of the subset.profile parameter. The current implementation of that capability here relies on the evaluate extension XSLT function. use.subset Specifies whether to use a subset of the character map instead of the whole map; boolean 0 or 1 subset.profile XPath expression that specifies what subset of the character map to use uri URI for a character map Error: To process character-map subsets, you must use an XSLT engine that supports the evaluate() XSLT extension function. Your XSLT engine does not support it. conky-1.12.2/doc/docbook-xml/common/common.xml000066400000000000000000000452041404127277500212230ustar00rootroot00000000000000 Common » Base Template Reference $Id: common.xsl 9965 2015-06-29 14:38:09Z tom_schr $ Introduction This is technical reference documentation for the “base†set of common templates in the DocBook XSL Stylesheets. This is not intended to be user documentation. It is provided for developers writing customization layers for the stylesheets. is.component Tests if a given node is a component-level element <xsl:template name="is.component"> <xsl:param name="node" select="."/> ... </xsl:template> Description This template returns '1' if the specified node is a component (Chapter, Appendix, etc.), and '0' otherwise. Parameters node The node which is to be tested. Returns This template returns '1' if the specified node is a component (Chapter, Appendix, etc.), and '0' otherwise. is.section Tests if a given node is a section-level element <xsl:template name="is.section"> <xsl:param name="node" select="."/> ... </xsl:template> Description This template returns '1' if the specified node is a section (Section, Sect1, Sect2, etc.), and '0' otherwise. Parameters node The node which is to be tested. Returns This template returns '1' if the specified node is a section (Section, Sect1, Sect2, etc.), and '0' otherwise. section.level Returns the hierarchical level of a section <xsl:template name="section.level"> <xsl:param name="node" select="."/> ... </xsl:template> Description This template calculates the hierarchical level of a section. The element sect1 is at level 1, sect2 is at level 2, etc. Recursive sections are calculated down to the fifth level. Parameters node The section node for which the level should be calculated. Defaults to the context node. Returns The section level, 1, 2, etc. qanda.section.level Returns the hierarchical level of a QandASet <xsl:template name="qanda.section.level"/> Description This template calculates the hierarchical level of a QandASet. Returns The level, 1, 2, etc. select.mediaobject Selects and processes an appropriate media object from a list <xsl:template name="select.mediaobject"> <xsl:param name="olist" select="imageobject|imageobjectco |videoobject|audioobject|textobject"/> ... </xsl:template> Description This template takes a list of media objects (usually the children of a mediaobject or inlinemediaobject) and processes the "right" object. This template relies on a template named "select.mediaobject.index" to determine which object in the list is appropriate. If no acceptable object is located, nothing happens. Parameters olist The node list of potential objects to examine. Returns Calls <xsl:apply-templates> on the selected object. select.mediaobject.index Selects the position of the appropriate media object from a list <xsl:template name="select.mediaobject.index"> <xsl:param name="olist" select="imageobject|imageobjectco |videoobject|audioobject|textobject"/> <xsl:param name="count">1</xsl:param> ... </xsl:template> Description This template takes a list of media objects (usually the children of a mediaobject or inlinemediaobject) and determines the "right" object. It returns the position of that object to be used by the calling template. If the parameter use.role.for.mediaobject is nonzero, then it first checks for an object with a role attribute of the appropriate value. It takes the first of those. Otherwise, it takes the first acceptable object through a recursive pass through the list. This template relies on a template named "is.acceptable.mediaobject" to determine if a given object is an acceptable graphic. The semantics of media objects is that the first acceptable graphic should be used. If no acceptable object is located, no index is returned. Parameters olist The node list of potential objects to examine. count The position in the list currently being considered by the recursive process. Returns Returns the position in the original list of the selected object. is.acceptable.mediaobject Returns '1' if the specified media object is recognized <xsl:template name="is.acceptable.mediaobject"> <xsl:param name="object"/> ... </xsl:template> Description This template examines a media object and returns '1' if the object is recognized as a graphic. Parameters object The media object to consider. Returns 0 or 1 check.id.unique Warn users about references to non-unique IDs <xsl:template name="check.id.unique"> <xsl:param name="linkend"/> ... </xsl:template> Description If passed an ID in linkend, check.id.unique prints a warning message to the user if either the ID does not exist or the ID is not unique. check.idref.targets Warn users about incorrectly typed references <xsl:template name="check.idref.targets"> <xsl:param name="linkend"/> <xsl:param name="element-list"/> ... </xsl:template> Description If passed an ID in linkend, check.idref.targets makes sure that the element pointed to by the link is one of the elements listed in element-list and warns the user otherwise. copyright.years Print a set of years with collapsed ranges <xsl:template name="copyright.years"> <xsl:param name="years"/> <xsl:param name="print.ranges" select="1"/> <xsl:param name="single.year.ranges" select="0"/> <xsl:param name="firstyear" select="0"/> <xsl:param name="nextyear" select="0"/> ... </xsl:template> Description This template prints a list of year elements with consecutive years printed as a range. In other words: <year>1992</year> <year>1993</year> <year>1994</year> is printed 1992-1994, whereas: <year>1992</year> <year>1994</year> is printed 1992, 1994. This template assumes that all the year elements contain only decimal year numbers, that the elements are sorted in increasing numerical order, that there are no duplicates, and that all the years are expressed in full century+year (1999 not 99) notation. Parameters years The initial set of year elements. print.ranges If non-zero, multi-year ranges are collapsed. If zero, all years are printed discretely. single.year.ranges If non-zero, two consecutive years will be printed as a range, otherwise, they will be printed discretely. In other words, a single year range is 1991-1992 but discretely it's 1991, 1992. Returns This template returns the formatted list of years. find.path.params Search in a table for the "best" match for the node <xsl:template name="find.path.params"> <xsl:param name="node" select="."/> <xsl:param name="table" select="''"/> <xsl:param name="location"> <xsl:call-template name="xpath.location"> <xsl:with-param name="node" select="$node"/> </xsl:call-template> </xsl:param> ... </xsl:template> Description This template searches in a table for the value that most-closely (in the typical best-match sense of XSLT) matches the current (element) node location. string.upper Converts a string to all uppercase letters <xsl:template name="string.upper"> <xsl:param name="string" select="''"/> ... </xsl:template> Description Given a string, this template does a language-aware conversion of that string to all uppercase letters, based on the values of the lowercase.alpha and uppercase.alpha gentext keys for the current locale. It affects only those characters found in the values of lowercase.alpha and uppercase.alpha. All other characters are left unchanged. Parameters string The string to convert to uppercase. string.lower Converts a string to all lowercase letters <xsl:template name="string.lower"> <xsl:param name="string" select="''"/> ... </xsl:template> Description Given a string, this template does a language-aware conversion of that string to all lowercase letters, based on the values of the uppercase.alpha and lowercase.alpha gentext keys for the current locale. It affects only those characters found in the values of uppercase.alpha and lowercase.alpha. All other characters are left unchanged. Parameters string The string to convert to lowercase. select.choice.separator Returns localized choice separator <xsl:template name="select.choice.separator"/> Description This template enables auto-generation of an appropriate localized "choice" separator (for example, "and" or "or") before the final item in an inline list (though it could also be useful for generating choice separators for non-inline lists). It currently works by evaluating a processing instruction (PI) of the form <?dbchoice choice="foo"?> : if the value of the choice pseudo-attribute is "and" or "or", returns a localized "and" or "or" otherwise returns the literal value of the choice pseudo-attribute The latter is provided only as a temporary workaround because the locale files do not currently have translations for the word or. So if you want to generate a a logical "or" separator in French (for example), you currently need to do this: <?dbchoice choice="ou"?> The dbchoice processing instruction is an unfortunate hack; support for it may disappear in the future (particularly if and when a more appropriate means for marking up "choice" lists becomes available in DocBook). evaluate.info.profile Evaluates an info profile <xsl:template name="evaluate.info.profile"> <xsl:param name="profile"/> <xsl:param name="info"/> ... </xsl:template> Description This template evaluates an "info profile" matching the XPath expression given by the profile parameter. It relies on the XSLT evaluate() extension function. The value of the profile parameter can include the literal string $info. If found in the value of the profile parameter, the literal string $info string is replaced with the value of the info parameter, which should be a set of *info nodes; the expression is then evaluated using the XSLT evaluate() extension function. Parameters profile A string representing an XPath expression info A set of *info nodes Returns Returns a node (the result of evaluating the profile parameter) graphic.format.content-type Returns mimetype for media format <xsl:template name="graphic.format.content-type"> <xsl:param name="format"/> ... </xsl:template> Description This takes as input a 'format' param and returns a mimetype string. It uses an xsl:choose after first converting the input to all uppercase. conky-1.12.2/doc/docbook-xml/common/common.xsl000066400000000000000000002302051404127277500212260ustar00rootroot00000000000000 ]> Common » Base Template Reference $Id: common.xsl 9965 2015-06-29 14:38:09Z tom_schr $ Introduction This is technical reference documentation for the “base†set of common templates in the DocBook XSL Stylesheets. This is not intended to be user documentation. It is provided for developers writing customization layers for the stylesheets. Tests if a given node is a component-level element This template returns '1' if the specified node is a component (Chapter, Appendix, etc.), and '0' otherwise. node The node which is to be tested. This template returns '1' if the specified node is a component (Chapter, Appendix, etc.), and '0' otherwise. 1 0 Tests if a given node is a section-level element This template returns '1' if the specified node is a section (Section, Sect1, Sect2, etc.), and '0' otherwise. node The node which is to be tested. This template returns '1' if the specified node is a section (Section, Sect1, Sect2, etc.), and '0' otherwise. 1 0 Returns the hierarchical level of a section This template calculates the hierarchical level of a section. The element sect1 is at level 1, sect2 is at level 2, etc. Recursive sections are calculated down to the fifth level. node The section node for which the level should be calculated. Defaults to the context node. The section level, 1, 2, etc. 1 2 3 4 5 6 5 4 3 2 1 2 3 4 5 5 5 4 3 2 1 1 Returns the hierarchical level of a QandASet This template calculates the hierarchical level of a QandASet. The level, 1, 2, etc. 1 1 1 2 3 5 4 3 2 1 1 question answer qandadiv qandaset id- [FAMILY Given] , , [ ] { } [ ] ... | 4pi Selects and processes an appropriate media object from a list This template takes a list of media objects (usually the children of a mediaobject or inlinemediaobject) and processes the "right" object. This template relies on a template named "select.mediaobject.index" to determine which object in the list is appropriate. If no acceptable object is located, nothing happens. olist The node list of potential objects to examine. Calls <xsl:apply-templates> on the selected object. Selects the position of the appropriate media object from a list This template takes a list of media objects (usually the children of a mediaobject or inlinemediaobject) and determines the "right" object. It returns the position of that object to be used by the calling template. If the parameter use.role.for.mediaobject is nonzero, then it first checks for an object with a role attribute of the appropriate value. It takes the first of those. Otherwise, it takes the first acceptable object through a recursive pass through the list. This template relies on a template named "is.acceptable.mediaobject" to determine if a given object is an acceptable graphic. The semantics of media objects is that the first acceptable graphic should be used. If no acceptable object is located, no index is returned. olist The node list of potential objects to examine. count The position in the list currently being considered by the recursive process. Returns the position in the original list of the selected object. 1 1 1 0 1 0 0 1 0 1 Returns '1' if the specified media object is recognized This template examines a media object and returns '1' if the object is recognized as a graphic. object The media object to consider. 0 or 1 0 1 1 1 0 . . Warn users about references to non-unique IDs If passed an ID in linkend, check.id.unique prints a warning message to the user if either the ID does not exist or the ID is not unique. Error: no ID for constraint linkend: . Warning: multiple "IDs" for constraint linkend: . Warn users about incorrectly typed references If passed an ID in linkend, check.idref.targets makes sure that the element pointed to by the link is one of the elements listed in element-list and warns the user otherwise. Error: linkend ( ) points to " " not (one of): Unexpected context in procedure.step.numeration: 1 2 loweralpha lowerroman upperalpha upperroman arabic arabic 1. a. i. A. I. Unexpected numeration: circle square disc Print a set of years with collapsed ranges This template prints a list of year elements with consecutive years printed as a range. In other words: 1992
    1993 1994]]> is printed 1992-1994, whereas: 1992
    1994]]> is printed 1992, 1994. This template assumes that all the year elements contain only decimal year numbers, that the elements are sorted in increasing numerical order, that there are no duplicates, and that all the years are expressed in full century+year (1999 not 99) notation. years The initial set of year elements. print.ranges If non-zero, multi-year ranges are collapsed. If zero, all years are printed discretely. single.year.ranges If non-zero, two consecutive years will be printed as a range, otherwise, they will be printed discretely. In other words, a single year range is 1991-1992 but discretely it's 1991, 1992. This template returns the formatted list of years. , , - , , , , - , Search in a table for the "best" match for the node This template searches in a table for the value that most-closely (in the typical best-match sense of XSLT) matches the current (element) node location. / Converts a string to all uppercase letters Given a string, this template does a language-aware conversion of that string to all uppercase letters, based on the values of the lowercase.alpha and uppercase.alpha gentext keys for the current locale. It affects only those characters found in the values of lowercase.alpha and uppercase.alpha. All other characters are left unchanged. string The string to convert to uppercase. Converts a string to all lowercase letters Given a string, this template does a language-aware conversion of that string to all lowercase letters, based on the values of the uppercase.alpha and lowercase.alpha gentext keys for the current locale. It affects only those characters found in the values of uppercase.alpha and lowercase.alpha. All other characters are left unchanged. string The string to convert to lowercase. Returns localized choice separator This template enables auto-generation of an appropriate localized "choice" separator (for example, "and" or "or") before the final item in an inline list (though it could also be useful for generating choice separators for non-inline lists). It currently works by evaluating a processing instruction (PI) of the form <?dbchoice choice="foo"?> : if the value of the choice pseudo-attribute is "and" or "or", returns a localized "and" or "or" otherwise returns the literal value of the choice pseudo-attribute The latter is provided only as a temporary workaround because the locale files do not currently have translations for the word or. So if you want to generate a a logical "or" separator in French (for example), you currently need to do this: <?dbchoice choice="ou"?> The dbchoice processing instruction is an unfortunate hack; support for it may disappear in the future (particularly if and when a more appropriate means for marking up "choice" lists becomes available in DocBook). Evaluates an info profile This template evaluates an "info profile" matching the XPath expression given by the profile parameter. It relies on the XSLT evaluate() extension function. The value of the profile parameter can include the literal string $info. If found in the value of the profile parameter, the literal string $info string is replaced with the value of the info parameter, which should be a set of *info nodes; the expression is then evaluated using the XSLT evaluate() extension function. profile A string representing an XPath expression info A set of *info nodes Returns a node (the result of evaluating the profile parameter) Error: The "info profiling" mechanism currently requires an XSLT engine that supports the evaluate() XSLT extension function. Your XSLT engine does not support it. Returns mimetype for media format This takes as input a 'format' param and returns a mimetype string. It uses an xsl:choose after first converting the input to all uppercase. application/postscript application/pdf image/png image/svg+xml image/jpeg image/jpeg image/gif image/gif image/gif audio/acc audio/mpeg audio/mpeg audio/mpeg audio/mpeg audio/mp4 audio/mpeg audio/wav video/mp4 video/mp4 video/ogg video/ogg video/webm conky-1.12.2/doc/docbook-xml/common/cs.xml000066400000000000000000000762311404127277500203440ustar00rootroot00000000000000 Symboly A a à á B b C c ÄŒ Ä D d ÄŽ Ä E e É é Äš Ä› Ë ë F f G g H h Ch ch cH CH I i à í J j K k L l M m N n Ň ň O o Ó ó Ö ö P p Q q R r Ř Å™ S s Å  Å¡ T t Ť Å¥ U u Ú ú Å® ů Ü ü V v W w X x Y y à ý Z z Ž ž conky-1.12.2/doc/docbook-xml/common/cy.xml000066400000000000000000001340571404127277500203530ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ Ch ch D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ Dd dd E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ Ff ff G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ Ng ng H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ Ll ll M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Ph ph Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ Rh rh S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ Th th U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/da.xml000066400000000000000000001014151404127277500203140ustar00rootroot00000000000000 A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z Æ æ Ø ø Ã… Ã¥ conky-1.12.2/doc/docbook-xml/common/de.xml000066400000000000000000001026151404127277500203230ustar00rootroot00000000000000 Symbole A a Ä ä B b C c D d E e F f G g H h I i J j K k L l M m N n O o Ö ö P p Q q R r S s T t U u Ü ü V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/el.xml000066400000000000000000001060361404127277500203340ustar00rootroot00000000000000 ΣÏμβολα A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z Α α Ά ά Î’ β Γ γ Δ δ Ε ε Έ έ Ζ ζ Η η Ή ή Θ θ Ι ι Ί ί Ϊ ÏŠ ΠΚ κ Λ λ Μ μ Πν Ξ ξ Ο ο ÎŒ ÏŒ Π Ï€ Ρ Ï Î£ σ Ï‚ Τ Ï„ Î¥ Ï… ÎŽ Ï Î« Ï‹ ΰ Φ φ Χ χ Ψ ψ Ω ω Î ÏŽ conky-1.12.2/doc/docbook-xml/common/en.xml000066400000000000000000001305251404127277500203360ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/entities.ent000066400000000000000000000203601404127277500215410ustar00rootroot00000000000000 normalize.sort.input normalize.sort.output '> conky-1.12.2/doc/docbook-xml/common/eo.xml000066400000000000000000001321661404127277500203420ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/es.xml000066400000000000000000001032671404127277500203460ustar00rootroot00000000000000 Símbolos A a á à B b C c CH ch D d E e É é F f G g H h I i à í J j K k L l LL ll M m N n Ñ ñ O o Ó ó P p Q q R r S s T t U u Ú ú V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/et.xml000066400000000000000000001340231404127277500203410ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/eu.xml000066400000000000000000001347011404127277500203450ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/fa.xml000066400000000000000000001073111404127277500203170ustar00rootroot00000000000000 سمبل‌های راهنم A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/fi.xml000066400000000000000000001025201404127277500203240ustar00rootroot00000000000000 Symbole A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s Å  Å¡ T t U u V v W w X x Y y Z z Ž ž Ã… Ã¥ Ä ä Ö ö conky-1.12.2/doc/docbook-xml/common/fr.xml000066400000000000000000001027011404127277500203360ustar00rootroot00000000000000 Symboles A a à À â Â Æ æ B b C c ç D d E e ê Ê é É è È ë Ë € F f G g H h I i ÃŽ î à ï J j K k L l M m N n O o Ö ö Å’ Å“ P p Q q R r S s T t U u Ù ù Û û Ü ü V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/ga.xml000066400000000000000000001340371404127277500203250ustar00rootroot00000000000000 Siombailí A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/gentext.xsl000066400000000000000000000745501404127277500214250ustar00rootroot00000000000000 .formal 0 object.xref.markup: empty xref template for linkend=" " and @xrefstyle=" " Xref is only supported to listitems in an orderedlist: ??? %n 1 Attempt to use %d in gentext with no referrer! % % labelnumber labelname label quotedtitle title nopage pagenumber pageabbrev Page page nodocname docnamelong docname %n %t %t %p conky-1.12.2/doc/docbook-xml/common/gl.xml000066400000000000000000001337021404127277500203360ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/gu.xml000066400000000000000000001113231404127277500203420ustar00rootroot00000000000000 સંકેતો A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/he.xml000066400000000000000000001362651404127277500203370ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/hi.xml000066400000000000000000001103771404127277500203370ustar00rootroot00000000000000 संकेत A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/hr.xml000066400000000000000000001017161404127277500203450ustar00rootroot00000000000000 Oznake A a B b C c Ć ć ÄŒ Ä D d Ä Ä‘ E e F f G g H h I i J j K k L l M m N n O o P p R r S s Å  Å¡ T t U u V v Z z Ž ž conky-1.12.2/doc/docbook-xml/common/hu.xml000066400000000000000000001026131404127277500203450ustar00rootroot00000000000000 Jelzések A a à á B b C c D d E e É é F f G g H h I i à í J j K k L l M m N n O o Ó ó Ö ö Å Å‘ P p Q q R r S s T t U u Ú ú Ü ü Ű ű V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/id.xml000066400000000000000000001330431404127277500203260ustar00rootroot00000000000000 Simbol A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/insertfile.xsl000066400000000000000000000075621404127277500221120ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/common/is.xml000066400000000000000000000761731404127277500203570ustar00rootroot00000000000000 tákn A a à á B b D d Ä Ã° E e É é F f G g H h I i à í J j K k L l M m N n O o Ó ó P p R r S s T t U u Ú ú V v X x Y y à ý Þ þ Æ æ Ö ö conky-1.12.2/doc/docbook-xml/common/it.xml000066400000000000000000001323251404127277500203500ustar00rootroot00000000000000 Simboli A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/ja.xml000066400000000000000000001012231404127277500203170ustar00rootroot00000000000000 シンボル A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/ka.xml000066400000000000000000001145031404127277500203250ustar00rootroot00000000000000 სიმბáƒáƒšáƒáƒ”ბი A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z რბ გ დ ე ვ ზ ჱ თ ი კ ლ მ ნ ჲ რპ ჟ რ ს ტ ჳ უ ფ ქ ღ ყ შ ჩ ც ძ წ ჭ ხ ჴ ჯ ჰ ჵ ჶ ჷ conky-1.12.2/doc/docbook-xml/common/kn.xml000066400000000000000000001440021404127277500203370ustar00rootroot00000000000000 ಸಂಕೇತಗಳೠA a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/ko.xml000066400000000000000000001340461404127277500203470ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/ky.xml000066400000000000000000001111651404127277500203560ustar00rootroot00000000000000 Символдор A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z Ра Б б Ð’ в Г г Д д Е е Ð Ñ‘ Ж ж З з И и Й й К к Л л М м Рн Ò¢ Ò£ О о Ó¨ Ó© П п Р Ñ€ С Ñ Ð¢ Ñ‚ У у Ò® Ò¯ Ф Ñ„ Ð¥ Ñ… Ц ц Ч ч Ш ш Щ щ Ъ ÑŠ Ы Ñ‹ Ь ÑŒ Э Ñ Ð® ÑŽ Я Ñ conky-1.12.2/doc/docbook-xml/common/l10n.dtd000066400000000000000000000024501404127277500204540ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/common/l10n.xml000066400000000000000000000056471404127277500205140ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/common/l10n.xsl000066400000000000000000000505541404127277500205170ustar00rootroot00000000000000 No localization exists for " " or " ". Using default " ". No " " localization of " " exists . ; using "en". bullet No " " localization of dingbat exists; using "en". startquote endquote nestedstartquote nestedendquote No " " localization exists. No context named " " exists in the " " localization. No template for " " (or any of its leaves) exists in the context named " " in the " " localization. No " " localization exists. No context named " " exists in the " " localization. No template for " " (or any of its leaves) exists in the context named " " in the " " localization. 1 0 conky-1.12.2/doc/docbook-xml/common/la.xml000066400000000000000000001336201404127277500203270ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/labels.xsl000066400000000000000000001000041404127277500211710ustar00rootroot00000000000000 Provides access to element labels Processing an element in the label.markup mode produces the element label. Trailing punctuation is not added to the label. . Request for label of unexpected element: label.markup: this can't happen!   1 a i A I Unexpected numeration: 0 0 Returns true if $section should be labelled Returns true if the specified section should be labelled. By default, this template returns zero unless the section level is less than or equal to the value of the $section.autolabel.max.depth parameter, in which case it returns $section.autolabel. Custom stylesheets may override it to get more selective behavior. 1 1 Unexpected .autolabel value: ; using default. Returns format for autolabel parameters Returns format passed as parameter if non zero. Supported format are 'arabic' or '1', 'loweralpha' or 'a', 'lowerroman' or 'i', 'upperlapha' or 'A', 'upperroman' or 'I', 'arabicindic' or '١'. If its not one of these then returns the default format. conky-1.12.2/doc/docbook-xml/common/lt.xml000066400000000000000000001041161404127277500203500ustar00rootroot00000000000000 Simboliai A a Ä„ Ä… B b C c ÄŒ Ä D d E e Ę Ä™ Ä– Ä— F f G g H h I i Ä® į Y y J j K k L l M m N n O o P p R r S s Å  Å¡ T t U u Ų ų Ū Å« V v Z z Ž ž Q q W w X x conky-1.12.2/doc/docbook-xml/common/lv.xml000066400000000000000000001326611404127277500203600ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/ml.xml000066400000000000000000001131731404127277500203440ustar00rootroot00000000000000 à´šà´¿à´¹àµà´¨à´™àµà´™à´³àµâ€ A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/mn.xml000066400000000000000000001116211404127277500203420ustar00rootroot00000000000000 ТÑмдÑгтүүд A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z Ра Б б Ð’ в Г г Д д Е е Ð Ñ‘ Ж ж З з И и Й й К к Л л М м Рн О о Ó¨ Ó© П п Р Ñ€ С Ñ Ð¢ Ñ‚ У у Ò® Ò¯ Ф Ñ„ Ð¥ Ñ… Ц ц Ч ч Ш ш Щ щ Ъ ÑŠ Ы Ñ‹ Ь ÑŒ Э Ñ Ð® ÑŽ Я Ñ conky-1.12.2/doc/docbook-xml/common/mr.xml000066400000000000000000001102111404127277500203400ustar00rootroot00000000000000 पà¥à¤°à¤¤à¥€à¤• A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/nb.xml000066400000000000000000001341251404127277500203330ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/nds.xml000066400000000000000000001015601404127277500205150ustar00rootroot00000000000000 Symbole A a Ä ä B b C c D d E e F f G g H h I i J j K k L l M m N n O o Ö ö P p Q q R r S s T t U u Ü ü V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/nl.xml000066400000000000000000001027001404127277500203370ustar00rootroot00000000000000 Symbolen A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/nn.xml000066400000000000000000001337411404127277500203520ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/olink.xsl000066400000000000000000001456311404127277500210620ustar00rootroot00000000000000 Olink error: Olink warning: Error: unresolved olink: targetdoc/targetptr = ' / '. olinks not processed: must specify a $target.database.document parameter when using olinks with targetdoc and targetptr attributes. the targetset element and children in ' ' should not be in any namespace. could not open target database ' '. Olink debug: cases for targetdoc=' ' and targetptr=' ' in language ' '. Olink debug: CaseA matched. Olink debug: CaseA NOT matched Olink debug: CaseB matched. Olink debug: CaseB NOT matched Olink debug: CaseC matched. Olink debug: CaseC NOT matched. Olink debug: CaseD matched. Olink debug: CaseD NOT matched Olink debug: CaseE matched. Olink debug: CaseE NOT matched. Olink debug: CaseF matched. Olink debug: CaseF NOT matched. Olink debug: CaseB key is the final selection: Olink debug: CaseA key is the final selection: Olink debug: CaseC key is the final selection: Olink debug: CaseD key is the final selection: Olink debug: CaseF key is the final selection: Olink debug: CaseE key is the final selection: Olink debug: No case matched for lang ' '. 1 0 cannot compute relative sitemap path because $current.docid ' ' not found in target database. cannot compute relative sitemap path without $current.docid parameter 1 1 1 0 1 xrefstyle is ' '. no gentext template exists for xrefstyle ' ' for element ' ' in language ' ' in context 'xref-number-and-title '. Using template without @style. no gentext template exists for xrefstyle ' ' for element ' ' in language ' ' in context 'xref-number '. Using template without @style. no gentext template exists for xrefstyle ' ' for element ' ' in language ' ' in context 'xref '. Using template without @style. no gentext template exists for xrefstyle ' ' for element ' ' in language ' '. Trying '%t'. Olink debug: xrefstyle template is ' '. 1 0 no generated text for targetdoc/targetptr/lang = ' '. ???? no generated text for targetdoc/targetptr/lang = ' '. ???? cannot locate targetdoc in sitemap / ../ conky-1.12.2/doc/docbook-xml/common/or.xml000066400000000000000000001435151404127277500203570ustar00rootroot00000000000000 ପà­à¬°à¬¤à­€à¬• A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/pa.xml000066400000000000000000001067451404127277500203430ustar00rootroot00000000000000 ਚਿੰਨ A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/pi.xml000066400000000000000000000120041404127277500203330ustar00rootroot00000000000000 Common Processing Instruction Reference $Id: pi.xsl 8782 2010-07-27 21:15:17Z mzjn $ Introduction This is generated reference documentation for all user-specifiable processing instructions (PIs) in the “common†part of the DocBook XSL stylesheets. You add these PIs at particular points in a document to cause specific “exceptions†to formatting/output behavior. To make global changes in formatting/output behavior across an entire document, it’s better to do it by setting an appropriate stylesheet parameter (if there is one). dbchoice_choice Generates a localized choice separator dbchoice choice="and"|"or"|string" Description Use the dbchoice choice PI to generate an appropriate localized “choice†separator (for example, and or or) before the final item in an inline simplelist This PI is a less-than-ideal hack; support for it may disappear in the future (particularly if and when a more appropriate means for marking up "choice" lists becomes available in DocBook). Parameters choice="and" generates a localized and separator choice="or" generates a localized or separator choice="string" generates a literal string separator dbtimestamp Inserts a date timestamp dbtimestamp format="formatstring" [padding="0"|"1"] Description Use the dbtimestamp PI at any point in a source document to cause a date timestamp (a formatted string representing the current date and time) to be inserted in output of the document. Parameters format="formatstring" Specifies format in which the date and time are output For details of the content of the format string, see Date and time. padding="0"|"1" Specifies padding behavior; if non-zero, padding is is added dbtex_delims Generates delimiters around embedded TeX equations in output dbtex delims="no"|"yes" Description Use the dbtex delims PI as a child of a textobject containing embedded TeX markup, to cause that markup to be surrounded by $ delimiter characters in output. This feature is useful for print/PDF output only if you use the obsolete and now unsupported PassiveTeX XSL-FO engine. Parameters dbtex delims="no"|"yes" Specifies whether delimiters are output Related Global Parameters tex.math.delims conky-1.12.2/doc/docbook-xml/common/pi.xsl000066400000000000000000000331061404127277500203470ustar00rootroot00000000000000 Common Processing Instruction Reference $Id: pi.xsl 8782 2010-07-27 21:15:17Z mzjn $ Introduction This is generated reference documentation for all user-specifiable processing instructions (PIs) in the “common†part of the DocBook XSL stylesheets. You add these PIs at particular points in a document to cause specific “exceptions†to formatting/output behavior. To make global changes in formatting/output behavior across an entire document, it’s better to do it by setting an appropriate stylesheet parameter (if there is one). Generates a localized choice separator Use the dbchoice choice PI to generate an appropriate localized “choice†separator (for example, and or or) before the final item in an inline simplelist This PI is a less-than-ideal hack; support for it may disappear in the future (particularly if and when a more appropriate means for marking up "choice" lists becomes available in DocBook). dbchoice choice="and"|"or"|string" choice="and" generates a localized and separator choice="or" generates a localized or separator choice="string" generates a literal string separator choice Inserts a date timestamp Use the dbtimestamp PI at any point in a source document to cause a date timestamp (a formatted string representing the current date and time) to be inserted in output of the document. dbtimestamp format="formatstring" [padding="0"|"1"] format="formatstring" Specifies format in which the date and time are output For details of the content of the format string, see Date and time. padding="0"|"1" Specifies padding behavior; if non-zero, padding is is added format padding 1 Timestamp processing requires XSLT processor with EXSLT date support. Generates delimiters around embedded TeX equations in output Use the dbtex delims PI as a child of a textobject containing embedded TeX markup, to cause that markup to be surrounded by $ delimiter characters in output. This feature is useful for print/PDF output only if you use the obsolete and now unsupported PassiveTeX XSL-FO engine. dbtex delims="no"|"yes" dbtex delims="no"|"yes" Specifies whether delimiters are output tex.math.delims 0 0 0 0 0 Timestamp processing requires an XSLT processor with support for the EXSLT node-set() function. conky-1.12.2/doc/docbook-xml/common/pl.xml000066400000000000000000001027241404127277500203470ustar00rootroot00000000000000 Symbole A a Ä„ Ä… B b C c Ć ć D d E e Ę Ä™ F f G g H h I i J j K k L l Å Å‚ M m N n Ń Å„ O o Ó ó P p Q q R r S s Åš Å› T t U u V v W w X x Y y Z z Ź ź Å» ż conky-1.12.2/doc/docbook-xml/common/pt.xml000066400000000000000000001334501404127277500203570ustar00rootroot00000000000000 Símbolos A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/pt_br.xml000066400000000000000000001324541404127277500210450ustar00rootroot00000000000000 Símbolos A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/refentry.xml000066400000000000000000000541301404127277500215670ustar00rootroot00000000000000 Common » Refentry Metadata Template Reference $Id: refentry.xsl 7867 2008-03-07 09:54:25Z xmldoc $ Introduction This is technical reference documentation for the “refentry metadata†templates in the DocBook XSL Stylesheets. This is not intended to be user documentation. It is provided for developers writing customization layers for the stylesheets. Currently, only the manpages stylesheets make use of these templates. They are, however, potentially useful elsewhere. get.refentry.metadata Gathers metadata from a refentry and its ancestors <xsl:template name="get.refentry.metadata"> <xsl:param name="refname"/> <xsl:param name="info"/> <xsl:param name="prefs"/> ... </xsl:template> Description Reference documentation for particular commands, functions, etc., is sometimes viewed in isolation from its greater "context". For example, users view Unix man pages as, well, individual pages, not as part of a "book" of some kind. Therefore, it is sometimes necessary to embed "context" information in output for each refentry. However, one problem is that different users mark up that context information in different ways. Often (usually), the context information is not actually part of the content of the refentry itself, but instead part of the content of a parent or ancestor element to the refentry. And even then, DocBook provides a variety of elements that users might potentially use to mark up the same kind of information. One user might use the productnumber element to mark up version information about a particular product, while another might use the releaseinfo element. Taking all that in mind, the get.refentry.metadata template tries to gather metadata from a refentry element and its ancestor elements in an intelligent and user-configurable way. The basic mechanism used in the XPath expressions throughout this stylesheet is to select the relevant metadata from the *info element that is closest to the actual refentry – either on the refentry itself, or on its nearest ancestor. The get.refentry.metadata template is actually just sort of a "driver" template; it calls other templates that do the actual data collection, then returns the data as a set. Parameters refname The first refname in the refentry info A set of info nodes (from a refentry element and its ancestors) prefs A node containing user preferences (from global stylesheet parameters) Returns Returns a node set with the following elements. The descriptions are verbatim from the man(7) man page. title the title of the man page (e.g., MAN) section the section number the man page should be placed in (e.g., 7) date the date of the last revision source the source of the command manual the title of the manual (e.g., Linux Programmer's Manual) get.refentry.title Gets title metadata for a refentry <xsl:template name="get.refentry.title"> <xsl:param name="refname"/> ... </xsl:template> Description The man(7) man page describes this as "the title of the man page (e.g., MAN). This differs from refname in that, if the refentry has a refentrytitle, we use that as the title; otherwise, we just use first refname in the first refnamediv in the source. Parameters refname The first refname in the refentry Returns Returns a title node. get.refentry.section Gets section metadata for a refentry <xsl:template name="get.refentry.section"> <xsl:param name="refname"/> <xsl:param name="quiet" select="0"/> ... </xsl:template> Description The man(7) man page describes this as "the section number the man page should be placed in (e.g., 7)". If we do not find a manvolnum specified in the source, and we find that the refentry is for a function, we use the section number 3 ["Library calls (functions within program libraries)"]; otherwise, we default to using 1 ["Executable programs or shell commands"]. Parameters refname The first refname in the refentry quiet If non-zero, no "missing" message is emitted Returns Returns a string representing a section number. get.refentry.date Gets date metadata for a refentry <xsl:template name="get.refentry.date"> <xsl:param name="refname"/> <xsl:param name="info"/> <xsl:param name="prefs"/> ... </xsl:template> Description The man(7) man page describes this as "the date of the last revision". If we cannot find a date in the source, we generate one. Parameters refname The first refname in the refentry info A set of info nodes (from a refentry element and its ancestors) prefs A node containing users preferences (from global stylesheet parameters) Returns Returns a date node. get.refentry.source Gets source metadata for a refentry <xsl:template name="get.refentry.source"> <xsl:param name="refname"/> <xsl:param name="info"/> <xsl:param name="prefs"/> ... </xsl:template> Description The man(7) man page describes this as "the source of the command", and provides the following examples: For binaries, use something like: GNU, NET-2, SLS Distribution, MCC Distribution. For system calls, use the version of the kernel that you are currently looking at: Linux 0.99.11. For library calls, use the source of the function: GNU, BSD 4.3, Linux DLL 4.4.1. The solbook(5) man page describes something very much like what man(7) calls "source", except that solbook(5) names it "software" and describes it like this:
    This is the name of the software product that the topic discussed on the reference page belongs to. For example UNIX commands are part of the SunOS x.x release.
    In practice, there are many pages that simply have a version number in the "source" field. So, it looks like what we have is a two-part field, Name Version, where: Name product name (e.g., BSD) or org. name (e.g., GNU) Version version name Each part is optional. If the Name is a product name, then the Version is probably the version of the product. Or there may be no Name, in which case, if there is a Version, it is probably the version of the item itself, not the product it is part of. Or, if the Name is an organization name, then there probably will be no Version.
    Parameters refname The first refname in the refentry info A set of info nodes (from a refentry element and its ancestors) prefs A node containing users preferences (from global stylesheet parameters) Returns Returns a source node.
    get.refentry.source.name Gets source-name metadata for a refentry <xsl:template name="get.refentry.source.name"> <xsl:param name="refname"/> <xsl:param name="info"/> <xsl:param name="prefs"/> ... </xsl:template> Description A "source name" is one part of a (potentially) two-part Name Version source field. For more details, see the documentation for the get.refentry.source template. Parameters refname The first refname in the refentry info A set of info nodes (from a refentry element and its ancestors) prefs A node containing users preferences (from global stylesheet parameters) Returns Depending on what output method is used for the current stylesheet, either returns a text node or possibly an element node, containing "source name" data. get.refentry.version Gets version metadata for a refentry <xsl:template name="get.refentry.version"> <xsl:param name="refname"/> <xsl:param name="info"/> <xsl:param name="prefs"/> ... </xsl:template> Description A "version" is one part of a (potentially) two-part Name Version source field. For more details, see the documentation for the get.refentry.source template. Parameters refname The first refname in the refentry info A set of info nodes (from a refentry element and its ancestors) prefs A node containing users preferences (from global stylesheet parameters) Returns Depending on what output method is used for the current stylesheet, either returns a text node or possibly an element node, containing "version" data. get.refentry.manual Gets source metadata for a refentry <xsl:template name="get.refentry.manual"> <xsl:param name="refname"/> <xsl:param name="info"/> <xsl:param name="prefs"/> ... </xsl:template> Description The man(7) man page describes this as "the title of the manual (e.g., Linux Programmer's Manual)". Here are some examples from existing man pages: dpkg utilities (dpkg-name) User Contributed Perl Documentation (GET) GNU Development Tools (ld) Emperor Norton Utilities (ddate) Debian GNU/Linux manual (faked) GIMP Manual Pages (gimp) KDOC Documentation System (qt2kdoc) The solbook(5) man page describes something very much like what man(7) calls "manual", except that solbook(5) names it "sectdesc" and describes it like this:
    This is the section title of the reference page; for example User Commands.
    Parameters refname The first refname in the refentry info A set of info nodes (from a refentry element and its ancestors) prefs A node containing users preferences (from global stylesheet parameters) Returns Returns a manual node.
    get.refentry.metadata.prefs Gets user preferences for refentry metadata gathering <xsl:template name="get.refentry.metadata.prefs"/> Description The DocBook XSL stylesheets include several user-configurable global stylesheet parameters for controlling refentry metadata gathering. Those parameters are not read directly by the other refentry metadata-gathering templates. Instead, they are read only by the get.refentry.metadata.prefs template, which assembles them into a structure that is then passed to the other refentry metadata-gathering templates. So the, get.refentry.metadata.prefs template is the only interface to collecting stylesheet parameters for controlling refentry metadata gathering. Parameters There are no local parameters for this template; however, it does rely on a number of global parameters. Returns Returns a manual node. set.refentry.metadata Sets content of a refentry metadata item <xsl:template name="set.refentry.metadata"> <xsl:param name="refname"/> <xsl:param name="info"/> <xsl:param name="contents"/> <xsl:param name="context"/> <xsl:param name="preferred"/> ... </xsl:template> Description The set.refentry.metadata template is called each time a suitable source element is found for a certain metadata field. Parameters refname The first refname in the refentry info A single *info node that contains the selected source element. contents A node containing the selected source element. context A string describing the metadata context in which the set.refentry.metadata template was called: either "date", "source", "version", or "manual". Returns Returns formatted contents of a selected source element.
    conky-1.12.2/doc/docbook-xml/common/refentry.xsl000066400000000000000000001553471404127277500216110ustar00rootroot00000000000000 Common » Refentry Metadata Template Reference $Id: refentry.xsl 7867 2008-03-07 09:54:25Z xmldoc $ Introduction This is technical reference documentation for the “refentry metadata†templates in the DocBook XSL Stylesheets. This is not intended to be user documentation. It is provided for developers writing customization layers for the stylesheets. Currently, only the manpages stylesheets make use of these templates. They are, however, potentially useful elsewhere. Gathers metadata from a refentry and its ancestors Reference documentation for particular commands, functions, etc., is sometimes viewed in isolation from its greater "context". For example, users view Unix man pages as, well, individual pages, not as part of a "book" of some kind. Therefore, it is sometimes necessary to embed "context" information in output for each refentry. However, one problem is that different users mark up that context information in different ways. Often (usually), the context information is not actually part of the content of the refentry itself, but instead part of the content of a parent or ancestor element to the refentry. And even then, DocBook provides a variety of elements that users might potentially use to mark up the same kind of information. One user might use the productnumber element to mark up version information about a particular product, while another might use the releaseinfo element. Taking all that in mind, the get.refentry.metadata template tries to gather metadata from a refentry element and its ancestor elements in an intelligent and user-configurable way. The basic mechanism used in the XPath expressions throughout this stylesheet is to select the relevant metadata from the *info element that is closest to the actual refentry â€“ either on the refentry itself, or on its nearest ancestor. The get.refentry.metadata template is actually just sort of a "driver" template; it calls other templates that do the actual data collection, then returns the data as a set. refname The first refname in the refentry info A set of info nodes (from a refentry element and its ancestors) prefs A node containing user preferences (from global stylesheet parameters) Returns a node set with the following elements. The descriptions are verbatim from the man(7) man page. title the title of the man page (e.g., MAN) section the section number the man page should be placed in (e.g., 7) date the date of the last revision source the source of the command manual the title of the manual (e.g., Linux Programmer's Manual) <xsl:call-template name="get.refentry.title"> <xsl:with-param name="refname" select="$refname"/> </xsl:call-template>
    Gets title metadata for a refentry The man(7) man page describes this as "the title of the man page (e.g., MAN). This differs from refname in that, if the refentry has a refentrytitle, we use that as the title; otherwise, we just use first refname in the first refnamediv in the source. refname The first refname in the refentry Returns a title node. Gets section metadata for a refentry The man(7) man page describes this as "the section number the man page should be placed in (e.g., 7)". If we do not find a manvolnum specified in the source, and we find that the refentry is for a function, we use the section number 3 ["Library calls (functions within program libraries)"]; otherwise, we default to using 1 ["Executable programs or shell commands"]. refname The first refname in the refentry quiet If non-zero, no "missing" message is emitted Returns a string representing a section number. Note meta manvol no refentry/refmeta/manvolnum Note meta manvol see http://docbook.sf.net/el/manvolnum Note meta manvol Setting man section to 3 3 1 Gets date metadata for a refentry The man(7) man page describes this as "the date of the last revision". If we cannot find a date in the source, we generate one. refname The first refname in the refentry info A set of info nodes (from a refentry element and its ancestors) prefs A node containing users preferences (from global stylesheet parameters) Returns a date node. Gets source metadata for a refentry The man(7) man page describes this as "the source of the command", and provides the following examples: For binaries, use something like: GNU, NET-2, SLS Distribution, MCC Distribution. For system calls, use the version of the kernel that you are currently looking at: Linux 0.99.11. For library calls, use the source of the function: GNU, BSD 4.3, Linux DLL 4.4.1. The solbook(5) man page describes something very much like what man(7) calls "source", except that solbook(5) names it "software" and describes it like this:
    This is the name of the software product that the topic discussed on the reference page belongs to. For example UNIX commands are part of the SunOS x.x release.
    In practice, there are many pages that simply have a version number in the "source" field. So, it looks like what we have is a two-part field, Name Version, where: Name product name (e.g., BSD) or org. name (e.g., GNU) Version version name Each part is optional. If the Name is a product name, then the Version is probably the version of the product. Or there may be no Name, in which case, if there is a Version, it is probably the version of the item itself, not the product it is part of. Or, if the Name is an organization name, then there probably will be no Version.
    refname The first refname in the refentry info A set of info nodes (from a refentry element and its ancestors) prefs A node containing users preferences (from global stylesheet parameters) Returns a source node.
    Warn meta source using " " for "source" [FIXME: source] Warn meta source no fallback for source, so inserted a fixme [FIXME: source] Warn meta source no source fallback given, so inserted a fixme Gets source-name metadata for a refentry A "source name" is one part of a (potentially) two-part Name Version source field. For more details, see the documentation for the get.refentry.source template. refname The first refname in the refentry info A set of info nodes (from a refentry element and its ancestors) prefs A node containing users preferences (from global stylesheet parameters) Depending on what output method is used for the current stylesheet, either returns a text node or possibly an element node, containing "source name" data. source source productname source productname source productname source productname source productname Note meta source no *info/productname or alternative Note meta source see http://docbook.sf.net/el/productname Note meta source no refentry/refmeta/refmiscinfo@class=source Note meta source see http://docbook.sf.net/el/refmiscinfo Gets version metadata for a refentry A "version" is one part of a (potentially) two-part Name Version source field. For more details, see the documentation for the get.refentry.source template. refname The first refname in the refentry info A set of info nodes (from a refentry element and its ancestors) prefs A node containing users preferences (from global stylesheet parameters) Depending on what output method is used for the current stylesheet, either returns a text node or possibly an element node, containing "version" data. version version productnumber version productnumber Note meta version no *info/productnumber or alternative Note meta version see http://docbook.sf.net/el/productnumber Note meta version no refentry/refmeta/refmiscinfo@class=version Note meta version see http://docbook.sf.net/el/refmiscinfo Gets source metadata for a refentry The man(7) man page describes this as "the title of the manual (e.g., Linux Programmer's Manual)". Here are some examples from existing man pages: dpkg utilities (dpkg-name) User Contributed Perl Documentation (GET) GNU Development Tools (ld) Emperor Norton Utilities (ddate) Debian GNU/Linux manual (faked) GIMP Manual Pages (gimp) KDOC Documentation System (qt2kdoc) The solbook(5) man page describes something very much like what man(7) calls "manual", except that solbook(5) names it "sectdesc" and describes it like this:
    This is the section title of the reference page; for example User Commands.
    refname The first refname in the refentry info A set of info nodes (from a refentry element and its ancestors) prefs A node containing users preferences (from global stylesheet parameters) Returns a manual node.
    manual manual Warn meta manual using " " for "manual" [FIXME: manual] Warn meta manual no fallback for manual, so inserted a fixme [FIXME: manual] Warn meta manual no manual fallback given, so inserted a fixme Note meta manual no titled ancestor of refentry Note meta manual no refentry/refmeta/refmiscinfo@class=manual Note meta manual see http://docbook.sf.net/el/refmiscinfo Gets user preferences for refentry metadata gathering The DocBook XSL stylesheets include several user-configurable global stylesheet parameters for controlling refentry metadata gathering. Those parameters are not read directly by the other refentry metadata-gathering templates. Instead, they are read only by the get.refentry.metadata.prefs template, which assembles them into a structure that is then passed to the other refentry metadata-gathering templates. So the, get.refentry.metadata.prefs template is the only interface to collecting stylesheet parameters for controlling refentry metadata gathering. There are no local parameters for this template; however, it does rely on a number of global parameters. Returns a manual node. Sets content of a refentry metadata item The set.refentry.metadata template is called each time a suitable source element is found for a certain metadata field. refname The first refname in the refentry info A single *info node that contains the selected source element. contents A node containing the selected source element. context A string describing the metadata context in which the set.refentry.metadata template was called: either "date", "source", "version", or "manual". Returns formatted contents of a selected source element.
    conky-1.12.2/doc/docbook-xml/common/ro.xml000066400000000000000000001343471404127277500203620ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/ru.xml000066400000000000000000001123071404127277500203600ustar00rootroot00000000000000 A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z Ра Б б Ð’ в Г г Д д Е е Ð Ñ‘ Ж ж З з И и Й й К к Л л М м Рн О о П п Р Ñ€ С Ñ Ð¢ Ñ‚ У у Ф Ñ„ Ð¥ Ñ… Ц ц Ч ч Ш ш Щ щ Ъ ÑŠ Ы Ñ‹ Ь ÑŒ Э Ñ Ð® ÑŽ Я Ñ conky-1.12.2/doc/docbook-xml/common/sk.xml000066400000000000000000001335541404127277500203560ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/sl.xml000066400000000000000000001341441404127277500203530ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/sq.xml000066400000000000000000001337661404127277500203710ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/sr.xml000066400000000000000000001111221404127277500203500ustar00rootroot00000000000000 Симболи Ра Б б Ð’ в Г г Д д Ђ Ñ’ Е е Ж ж З з И и Ј ј К к Л л Љ Ñ™ М м Рн Њ Ñš О о П п Р Ñ€ С Ñ Ð¢ Ñ‚ Ћ Ñ› У у Ф Ñ„ Ð¥ Ñ… Ц ц Ч ч Ð ÑŸ Ш ш A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q Q R r S s T t U u V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/sr_Latn.xml000066400000000000000000001033071404127277500213340ustar00rootroot00000000000000 Simboli A a B b C c ÄŒ Ä Ä† ć D d DŽ Dž dž Ä Ä‘ E e F f G g H h I i J j K k L l LJ Lj lj M m N n NJ Nj nj O o P p Q Q R r S s Å  Å¡ T t U u V v W w X x Y y Z z Ž ž conky-1.12.2/doc/docbook-xml/common/stripns.xsl000066400000000000000000000320601404127277500214370ustar00rootroot00000000000000 info objectinfo blockinfo WARNING: cannot add @xml:base to node set root element. Relative paths may not work. / 1 0 Stripping namespace from DocBook 5 document. It is suggested to use namespaced version of the stylesheets available in distribution file 'docbook-xsl-ns' at //http://sourceforge.net/projects/docbook/files/ which does not require namespace stripping step. Processing stripped document. conky-1.12.2/doc/docbook-xml/common/subtitles.xsl000066400000000000000000000162361404127277500217620ustar00rootroot00000000000000 Provides access to element subtitles Processing an element in the subtitle.markup mode produces the subtitle of the element. Request for subtitle of unexpected element: ???SUBTITLE??? conky-1.12.2/doc/docbook-xml/common/sv.xml000066400000000000000000001031711404127277500203610ustar00rootroot00000000000000 A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z Ã… Ã¥ Ä ä Ö ö conky-1.12.2/doc/docbook-xml/common/ta.xml000066400000000000000000001137131404127277500203400ustar00rootroot00000000000000 கà¯à®±à®¿à®¯à¯€à®Ÿà¯à®•ள௠A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/table.xsl000066400000000000000000000435221404127277500210310ustar00rootroot00000000000000 0: 0: : 0 Determine the column number in which a given entry occurs If an entry has a colname or namest attribute, this template will determine the number of the column in which the entry should occur. For other entrys, nothing is returned. entry The entry-element which is to be tested. This template returns the column number if it can be determined, or 0 (the empty string) 1 1 1 1 : conky-1.12.2/doc/docbook-xml/common/targetdatabase.dtd000066400000000000000000000023171404127277500226570ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/common/targets.xsl000066400000000000000000000251111404127277500214050ustar00rootroot00000000000000 Collects information for potential cross reference targets Processing the root element in the collect.targets mode produces a set of target database elements that can be used by the olink mechanism to resolve external cross references. The collection process is controlled by the collect.xref.targets parameter, which can be yes to collect targets and process the document for output, only to only collect the targets, and no (default) to not collect the targets and only process the document. A targets.filename parameter must be specified to receive the output if collect.xref.targets is set to yes so as to redirect the target data to a file separate from the document output. Must specify a $targets.filename parameter when $collect.xref.targets is set to 'yes'. The xref targets were not collected.
    Warning: processing automatic glossary without a glossary.collection file. Warning: processing automatic glossary but unable to open glossary.collection file ' '
    conky-1.12.2/doc/docbook-xml/common/te.xml000066400000000000000000001144021404127277500203400ustar00rootroot00000000000000 à°šà°¿à°¹à±à°¨à°®à±à°²à± A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/th.xml000066400000000000000000001415471404127277500203550ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/titles.xsl000066400000000000000000000737131404127277500212530ustar00rootroot00000000000000 Provides access to element titles Processing an element in the title.markup mode produces the title of the element. This does not include the label. Request for title of element with no title: (id=" ") (xml:id=" ") (contained in with id ) ???TITLE??? REFENTRY WITHOUT TITLE??? ERROR: glossdiv missing its required title Note Important Caution Warning Tip question answer Endterm points to nonexistent ID: ??? XRef to nonexistent id: ??? Endterm points to nonexistent ID: ??? conky-1.12.2/doc/docbook-xml/common/tl.xml000066400000000000000000001341521404127277500203530ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/tr.xml000066400000000000000000001024461404127277500203620ustar00rootroot00000000000000 Semboller A a B b C c Ç ç D d E e F f G g Äž ÄŸ H h I ı İ i J j K k L l M m N n O o Ö ö P p R r S s Åž ÅŸ T t U u Ü ü V v Y y Z z conky-1.12.2/doc/docbook-xml/common/uk.xml000066400000000000000000001117571404127277500203610ustar00rootroot00000000000000 A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z Ра Б б Ð’ в Г г Ò Ò‘ Д д Е е Є Ñ” Ж ж З з И и І Ñ– Ї Ñ— Й й К к Л л М м Рн О о П п Р Ñ€ С Ñ Ð¢ Ñ‚ У у Ф Ñ„ Ð¥ Ñ… Ц ц Ч ч Ш ш Щ щ Ь ÑŒ Ю ÑŽ Я Ñ conky-1.12.2/doc/docbook-xml/common/ur.xml000066400000000000000000001024431404127277500203600ustar00rootroot00000000000000 Symbols ا Ø¢ ب بھ Ù¾ Ù¾Ú¾ ت تھ Ù¹ Ù¹Ú¾ Ø« ج جھ Ú† Ú†Ú¾ Ø­ Ø® د دھ Úˆ ÚˆÚ¾ ذ ر رھ Ú‘ Ú‘Ú¾ ز Ú˜ س Ø´ ص ض Ø· ظ ع غ Ù Ù‚ Ú© Ú©Ú¾ Ú¯ Ú¯Ú¾ Ù„ Ù„Ú¾ Ù… Ù…Ú¾ Ù† Ù†Ú¾ Ùˆ ÙˆÚ¾ Û Ø¡ ÛŒ Û’ conky-1.12.2/doc/docbook-xml/common/utility.xml000066400000000000000000000231401404127277500214310ustar00rootroot00000000000000 Common » Utility Template Reference $Id: utility.xsl 7101 2007-07-20 15:32:12Z xmldoc $ Introduction This is technical reference documentation for the miscellaneous utility templates in the DocBook XSL Stylesheets. These templates are defined in a separate file from the set of “common†templates because some of the common templates reference DocBook XSL stylesheet parameters, requiring the entire set of parameters to be imported/included in any stylesheet that imports/includes the common templates. The utility templates don’t import or include any DocBook XSL stylesheet parameters, so the utility templates can be used without importing the whole set of parameters. This is not intended to be user documentation. It is provided for developers writing customization layers for the stylesheets. log.message Logs/emits formatted notes and warnings <xsl:template name="log.message"> <xsl:param name="level"/> <xsl:param name="source"/> <xsl:param name="context-desc"/> <xsl:param name="context-desc-field-length">12</xsl:param> <xsl:param name="context-desc-padded"> <xsl:if test="not($context-desc = '')"> <xsl:call-template name="pad-string"> <xsl:with-param name="leftRight">right</xsl:with-param> <xsl:with-param name="padVar" select="substring($context-desc, 1, $context-desc-field-length)"/> <xsl:with-param name="length" select="$context-desc-field-length"/> </xsl:call-template> </xsl:if> </xsl:param> <xsl:param name="message"/> <xsl:param name="message-field-length" select="45"/> <xsl:param name="message-padded"> <xsl:variable name="spaces-for-blank-level"> <!-- * if the level field is blank, we'll need to pad out --> <!-- * the message field with spaces to compensate --> <xsl:choose> <xsl:when test="$level = ''"> <xsl:value-of select="4 + 2"/> <!-- * 4 = hard-coded length of comment text ("Note" or "Warn") --> <!-- * + 2 = length of colon-plus-space separator ": " --> </xsl:when> <xsl:otherwise> <xsl:value-of select="0"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="spaces-for-blank-context-desc"> <!-- * if the context-description field is blank, we'll need --> <!-- * to pad out the message field with spaces to compensate --> <xsl:choose> <xsl:when test="$context-desc = ''"> <xsl:value-of select="$context-desc-field-length + 2"/> <!-- * + 2 = length of colon-plus-space separator ": " --> </xsl:when> <xsl:otherwise> <xsl:value-of select="0"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="extra-spaces" select="$spaces-for-blank-level + $spaces-for-blank-context-desc"/> <xsl:call-template name="pad-string"> <xsl:with-param name="leftRight">right</xsl:with-param> <xsl:with-param name="padVar" select="substring($message, 1, ($message-field-length + $extra-spaces))"/> <xsl:with-param name="length" select="$message-field-length + $extra-spaces"/> </xsl:call-template> </xsl:param> ... </xsl:template> Description The log.message template is a utility template for logging/emitting formatted messages – that is, notes and warnings, along with a given log “level†and an identifier for the “source†that the message relates to. Parameters level Text to log/emit in the message-level field to indicate the message level (Note or Warning) source Text to log/emit in the source field to identify the “source†to which the notification/warning relates. This can be any arbitrary string, but because the message lacks line and column numbers to identify the exact part of the source document to which it relates, the intention is that the value you pass into the source parameter should give the user some way to identify the portion of their source document on which to take potentially take action in response to the log message (for example, to edit, change, or add content). So the source value should be, for example, an ID, book/chapter/article title, title of some formal object, or even a string giving an XPath expression. context-desc Text to log/emit in the context-description field to describe the context for the message. context-desc-field-length Specifies length of the context-description field (in characters); default is 12 If the text specified by the context-desc parameter is longer than the number of characters specified in context-desc-field-length, it is truncated to context-desc-field-length (12 characters by default). If the specified text is shorter than context-desc-field-length, it is right-padded out to context-desc-field-length (12 by default). If no value has been specified for the context-desc parameter, the field is left empty and the text of the log message begins with the value of the message parameter. message Text to log/emit in the actual message field message-field-length Specifies length of the message field (in characters); default is 45 Returns Outputs a message (generally, to standard error). get.doc.title Gets a title from the current document <xsl:template name="get.doc.title"/> Description The get.doc.title template is a utility template for returning the first title found in the current document. Returns Returns a string containing some identifying title for the current document . pad-string Right-pads or left-pads a string out to a certain length <xsl:template name="pad-string"> <xsl:param name="padChar" select="' '"/> <xsl:param name="leftRight">left</xsl:param> <xsl:param name="padVar"/> <xsl:param name="length"/> ... </xsl:template> Description This function takes string padVar and pads it out in the direction rightLeft to the string-length length, using string padChar (a space character by default) as the padding string (note that padChar can be a string; it is not limited to just being a single character). This function began as a copy of Nate Austin's prepend-pad function in the Padding Content section of Dave Pawson's XSLT FAQ. Returns Returns a (padded) string. conky-1.12.2/doc/docbook-xml/common/utility.xsl000066400000000000000000000277771404127277500214630ustar00rootroot00000000000000 Common » Utility Template Reference $Id: utility.xsl 7101 2007-07-20 15:32:12Z xmldoc $ Introduction This is technical reference documentation for the miscellaneous utility templates in the DocBook XSL Stylesheets. These templates are defined in a separate file from the set of “common†templates because some of the common templates reference DocBook XSL stylesheet parameters, requiring the entire set of parameters to be imported/included in any stylesheet that imports/includes the common templates. The utility templates don’t import or include any DocBook XSL stylesheet parameters, so the utility templates can be used without importing the whole set of parameters. This is not intended to be user documentation. It is provided for developers writing customization layers for the stylesheets. Logs/emits formatted notes and warnings The log.message template is a utility template for logging/emitting formatted messages â€“ that is, notes and warnings, along with a given log “level†and an identifier for the “source†that the message relates to. level Text to log/emit in the message-level field to indicate the message level (Note or Warning) source Text to log/emit in the source field to identify the “source†to which the notification/warning relates. This can be any arbitrary string, but because the message lacks line and column numbers to identify the exact part of the source document to which it relates, the intention is that the value you pass into the source parameter should give the user some way to identify the portion of their source document on which to take potentially take action in response to the log message (for example, to edit, change, or add content). So the source value should be, for example, an ID, book/chapter/article title, title of some formal object, or even a string giving an XPath expression. context-desc Text to log/emit in the context-description field to describe the context for the message. context-desc-field-length Specifies length of the context-description field (in characters); default is 12 If the text specified by the context-desc parameter is longer than the number of characters specified in context-desc-field-length, it is truncated to context-desc-field-length (12 characters by default). If the specified text is shorter than context-desc-field-length, it is right-padded out to context-desc-field-length (12 by default). If no value has been specified for the context-desc parameter, the field is left empty and the text of the log message begins with the value of the message parameter. message Text to log/emit in the actual message field message-field-length Specifies length of the message field (in characters); default is 45 Outputs a message (generally, to standard error). 12 right right : : Gets a title from the current document The get.doc.title template is a utility template for returning the first title found in the current document. Returns a string containing some identifying title for the current document . Right-pads or left-pads a string out to a certain length This function takes string padVar and pads it out in the direction rightLeft to the string-length length, using string padChar (a space character by default) as the padding string (note that padChar can be a string; it is not limited to just being a single character). This function began as a copy of Nate Austin's prepend-pad function in the Padding Content section of Dave Pawson's XSLT FAQ. Returns a (padded) string. left conky-1.12.2/doc/docbook-xml/common/vi.xml000066400000000000000000001350371404127277500203550ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/xh.xml000066400000000000000000001355731404127277500203630ustar00rootroot00000000000000 Symbols A a À à à á  â à ã Ä ä Ã… Ã¥ Ä€ Ä Ä‚ ă Ä„ Ä… Ç ÇŽ Çž ÇŸ Ç  Ç¡ Ǻ Ç» È€ È È‚ ȃ Ȧ ȧ Ḁ Ḡẚ Ạ ạ Ả ả Ấ ấ Ầ ầ Ẩ ẩ Ẫ ẫ Ậ ậ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ B b Æ€ Æ É“ Æ‚ ƃ Ḃ ḃ Ḅ ḅ Ḇ ḇ C c Ç ç Ć ć Ĉ ĉ ÄŠ Ä‹ ÄŒ Ä Æ‡ ƈ É• Ḉ ḉ D d ÄŽ Ä Ä Ä‘ ÆŠ É— Æ‹ ÆŒ Ç… Dz È¡ É– Ḋ ḋ Ḍ ḠḎ ḠḠḑ Ḓ ḓ E e È è É é Ê ê Ë ë Ä’ Ä“ Ä” Ä• Ä– Ä— Ę Ä™ Äš Ä› È„ È… Ȇ ȇ Ȩ È© Ḕ ḕ Ḗ ḗ Ḙ ḙ Ḛ ḛ Ḝ ḠẸ ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ỠỂ ể Ễ á»… Ệ ệ F f Æ‘ Æ’ Ḟ ḟ G g Äœ Ä Äž ÄŸ Ä  Ä¡ Ä¢ Ä£ Æ“ É  Ǥ Ç¥ Ǧ ǧ Ç´ ǵ Ḡ ḡ H h Ĥ Ä¥ Ħ ħ Èž ÈŸ ɦ Ḣ ḣ Ḥ ḥ Ḧ ḧ Ḩ ḩ Ḫ ḫ ẖ I i ÃŒ ì à í ÃŽ î à ï Ĩ Ä© Ī Ä« Ĭ Ä­ Ä® į İ Æ— ɨ Ç Ç Èˆ ȉ ÈŠ È‹ Ḭ ḭ Ḯ ḯ Ỉ ỉ Ị ị J j Ä´ ĵ ǰ Ê K k Ķ Ä· Ƙ Æ™ Ǩ Ç© Ḱ ḱ Ḳ ḳ Ḵ ḵ L l Ĺ ĺ Ä» ļ Ľ ľ Ä¿ Å€ Å Å‚ Æš Lj È´ É« ɬ É­ Ḷ ḷ Ḹ ḹ Ḻ ḻ Ḽ ḽ M m ɱ Ḿ ḿ á¹€ ṠṂ ṃ N n Ñ ñ Ń Å„ Å… ņ Ň ň Æ É² Æž È  Ç‹ Ǹ ǹ ȵ ɳ Ṅ á¹… Ṇ ṇ Ṉ ṉ Ṋ ṋ O o Ã’ ò Ó ó Ô ô Õ õ Ö ö Ø ø ÅŒ Å ÅŽ Å Å Å‘ ÆŸ Æ  Æ¡ Ç‘ Ç’ Ǫ Ç« Ǭ Ç­ Ǿ Ç¿ ÈŒ È ÈŽ È Èª È« Ȭ È­ È® ȯ Ȱ ȱ Ṍ ṠṎ ṠṠṑ á¹’ ṓ Ọ ỠỎ ỠỠố á»’ ồ á»” ổ á»– á»— Ộ á»™ Ớ á»› Ờ ỠỞ ở á»  ỡ Ợ ợ P p Ƥ Æ¥ á¹” ṕ á¹– á¹— Q q Ê  R r Å” Å• Å– Å— Ř Å™ È È‘ È’ È“ ɼ ɽ ɾ Ṙ á¹™ Ṛ á¹› Ṝ ṠṞ ṟ S s Åš Å› Åœ Å Åž ÅŸ Å  Å¡ Ș È™ Ê‚ á¹  ṡ á¹¢ á¹£ Ṥ á¹¥ Ṧ á¹§ Ṩ ṩ T t Å¢ Å£ Ť Å¥ Ŧ ŧ Æ« Ƭ Æ­ Æ® ʈ Èš È› ȶ Ṫ ṫ Ṭ á¹­ á¹® ṯ á¹° á¹± ẗ U u Ù ù Ú ú Û û Ü ü Ũ Å© Ū Å« Ŭ Å­ Å® ů Ű ű Ų ų Ư ư Ç“ Ç” Ç• Ç– Ç— ǘ Ç™ Çš Ç› Çœ È” È• È– È— á¹² á¹³ á¹´ á¹µ á¹¶ á¹· Ṹ á¹¹ Ṻ á¹» Ụ ụ Ủ á»§ Ứ ứ Ừ ừ Ử á»­ á»® ữ á»° á»± V v Ʋ Ê‹ á¹¼ á¹½ á¹¾ ṿ W w Å´ ŵ Ẁ ẠẂ ẃ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ X x Ẋ ẋ Ẍ ẠY y à ý ÿ Ÿ Ŷ Å· Ƴ Æ´ Ȳ ȳ Ẏ Ạẙ Ỳ ỳ á»´ ỵ á»¶ á»· Ỹ ỹ Z z Ź ź Å» ż Ž ž Ƶ ƶ Ȥ È¥ Ê Ê‘ Ạẑ Ẓ ẓ Ẕ ẕ conky-1.12.2/doc/docbook-xml/common/zh.xml000066400000000000000000000733171404127277500203620ustar00rootroot00000000000000 ç¬¦å· A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/zh_cn.xml000066400000000000000000000733431404127277500210410ustar00rootroot00000000000000 ç¬¦å· A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/common/zh_tw.xml000066400000000000000000001010371404127277500210630ustar00rootroot00000000000000 符號 A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z conky-1.12.2/doc/docbook-xml/dbcentx.mod000066400000000000000000000236531404127277500200550ustar00rootroot00000000000000 ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> conky-1.12.2/doc/docbook-xml/dbgenent.mod000066400000000000000000000030351404127277500202040ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/dbhierx.mod000066400000000000000000001743061404127277500200550ustar00rootroot00000000000000 %rdbhier; ]]> %rdbhier2; ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> conky-1.12.2/doc/docbook-xml/dbnotnx.mod000066400000000000000000000106511404127277500200740ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/dbpoolx.mod000066400000000000000000007424201404127277500200750ustar00rootroot00000000000000 %rdbpool; ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> %htmltbl; ]]> ]]> ]]> %tablemodel; ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> conky-1.12.2/doc/docbook-xml/docbook.cat000066400000000000000000000076521404127277500200370ustar00rootroot00000000000000 -- ...................................................................... -- -- Catalog data for DocBook XML V4.5 .................................... -- -- File docbook.cat ..................................................... -- -- Please direct all questions, bug reports, or suggestions for changes to the docbook@lists.oasis-open.org mailing list. For more information, see http://www.oasis-open.org/. -- -- This is the catalog data file for DocBook XML V4.5. It is provided as a convenience in building your own catalog files. You need not use the filenames listed here, and need not use the filename method of identifying storage objects at all. See the documentation for detailed information on the files associated with the DocBook DTD. See SGML Open Technical Resolution 9401 for detailed information on supplying and using catalog data. -- -- ...................................................................... -- -- DocBook driver file .................................................. -- PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "docbookx.dtd" -- ...................................................................... -- -- DocBook modules ...................................................... -- PUBLIC "-//OASIS//DTD DocBook CALS Table Model V4.5//EN" "calstblx.dtd" PUBLIC "-//OASIS//ELEMENTS DocBook XML HTML Tables V4.5//EN" "htmltblx.mod" PUBLIC "-//OASIS//DTD XML Exchange Table Model 19990315//EN" "soextblx.dtd" PUBLIC "-//OASIS//ELEMENTS DocBook Information Pool V4.5//EN" "dbpoolx.mod" PUBLIC "-//OASIS//ELEMENTS DocBook Document Hierarchy V4.5//EN" "dbhierx.mod" PUBLIC "-//OASIS//ENTITIES DocBook Additional General Entities V4.5//EN" "dbgenent.mod" PUBLIC "-//OASIS//ENTITIES DocBook Notations V4.5//EN" "dbnotnx.mod" PUBLIC "-//OASIS//ENTITIES DocBook Character Entities V4.5//EN" "dbcentx.mod" -- ...................................................................... -- -- ISO entity sets ...................................................... -- PUBLIC "ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML" "ent/isodia.ent" PUBLIC "ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML" "ent/isonum.ent" PUBLIC "ISO 8879:1986//ENTITIES Publishing//EN//XML" "ent/isopub.ent" PUBLIC "ISO 8879:1986//ENTITIES General Technical//EN//XML" "ent/isotech.ent" PUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN//XML" "ent/isolat1.ent" PUBLIC "ISO 8879:1986//ENTITIES Added Latin 2//EN//XML" "ent/isolat2.ent" PUBLIC "ISO 8879:1986//ENTITIES Greek Letters//EN//XML" "ent/isogrk1.ent" PUBLIC "ISO 8879:1986//ENTITIES Monotoniko Greek//EN//XML" "ent/isogrk2.ent" PUBLIC "ISO 8879:1986//ENTITIES Greek Symbols//EN//XML" "ent/isogrk3.ent" PUBLIC "ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN//XML" "ent/isogrk4.ent" PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML" "ent/isoamsa.ent" PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN//XML" "ent/isoamsb.ent" PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN//XML" "ent/isoamsc.ent" PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN//XML" "ent/isoamsn.ent" PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN//XML" "ent/isoamso.ent" PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN//XML" "ent/isoamsr.ent" PUBLIC "ISO 8879:1986//ENTITIES Box and Line Drawing//EN//XML" "ent/isobox.ent" PUBLIC "ISO 8879:1986//ENTITIES Russian Cyrillic//EN//XML" "ent/isocyr1.ent" PUBLIC "ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML" "ent/isocyr2.ent" -- End of catalog data for DocBook XML V4.5 ............................. -- -- ...................................................................... -- conky-1.12.2/doc/docbook-xml/docbookx.dtd000066400000000000000000000132371404127277500202270ustar00rootroot00000000000000 ]]> ]]> ]]> ]]> ]]> %dbnotn; ]]> ]]> ]]> ]]> %dbcent; ]]> %dbpool; ]]> %rdbmods; ]]> %dbhier; ]]> %dbgenent; ]]> conky-1.12.2/doc/docbook-xml/ent/000077500000000000000000000000001404127277500165025ustar00rootroot00000000000000conky-1.12.2/doc/docbook-xml/ent/isoamsa.ent000066400000000000000000000125561404127277500206570ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/ent/isoamsb.ent000066400000000000000000000076151404127277500206600ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/ent/isoamsc.ent000066400000000000000000000035771404127277500206640ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/ent/isoamsn.ent000066400000000000000000000141741404127277500206720ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/ent/isoamso.ent000066400000000000000000000045601404127277500206710ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/ent/isoamsr.ent000066400000000000000000000155601404127277500206760ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/ent/isobox.ent000066400000000000000000000111201404127277500205100ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/ent/isocyr1.ent000066400000000000000000000140241404127277500206040ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/ent/isocyr2.ent000066400000000000000000000062471404127277500206150ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/ent/isodia.ent000066400000000000000000000040141404127277500204610ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/ent/isogrk1.ent000066400000000000000000000112451404127277500205740ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/ent/isogrk2.ent000066400000000000000000000056321404127277500206000ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/ent/isogrk3.ent000066400000000000000000000103131404127277500205710ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/ent/isogrk4.ent000066400000000000000000000107121404127277500205750ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/ent/isolat1.ent000066400000000000000000000141441404127277500205720ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/ent/isolat2.ent000066400000000000000000000255001404127277500205710ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/ent/isonum.ent000066400000000000000000000137631404127277500205360ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/ent/isopub.ent000066400000000000000000000151441404127277500205200ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/ent/isotech.ent000066400000000000000000000120171404127277500206510ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/html/000077500000000000000000000000001404127277500166605ustar00rootroot00000000000000conky-1.12.2/doc/docbook-xml/html/admon.xsl000066400000000000000000000113131404127277500205050ustar00rootroot00000000000000 25 note warning caution tip important note Note Warning Caution Tip Important Note
    :
    [{$alt}]

    conky-1.12.2/doc/docbook-xml/html/annotations.xsl000066400000000000000000000130311404127277500217430ustar00rootroot00000000000000 <xsl:copy-of select="$title"/> Note namesp. cut stripped namespace before processing Unable to strip the namespace from DB5 document, cannot proceed. ID ' ' not found in document. 0 conky-1.12.2/doc/docbook-xml/html/ebnf.xsl000066400000000000000000000242731404127277500203320ustar00rootroot00000000000000 $Id: ebnf.xsl 9664 2012-11-07 20:02:17Z bobstayton $ Walsh Norman 19992000 Norman Walsh HTML EBNF Reference
    Introduction This is technical reference documentation for the DocBook XSL Stylesheets; it documents (some of) the parameters, templates, and other elements of the stylesheets. This reference describes the templates and parameters relevant to formatting EBNF markup. This is not intended to be user documentation. It is provided for developers writing customization layers for the stylesheets, and for anyone who's interested in how it works. Although I am trying to be thorough, this documentation is known to be incomplete. Don't forget to read the source, too :-)
    1 EBNF for
    EBNF productions
    [ ]   Error: no ID for productionrecap linkend: . Warning: multiple "IDs" for productionrecap linkend: . |
    production Non-terminals with no content must point to production elements in the current document. Invalid xpointer for empty nt: ??? /*   */
    constraintdef : :  ]

    conky-1.12.2/doc/docbook-xml/html/footnote.xsl000066400000000000000000000303111404127277500212430ustar00rootroot00000000000000 #ftn. [ ] ERROR: A footnoteref element has a linkend that points to an element that is not a footnote. Typically this happens when an id attribute is accidentally applied to the child of a footnote element. target element: linkend/id: #ftn. [ ] # [ ] ftn. # [ ]


    footnote-hr 100

    The following annotations are from this essay. You are seeing them here because your browser doesn’t support the user-interface techniques used to make them appear as ‘popups’ on modern browsers.

    ftn.
    Warning: footnote number may not be generated correctly; unexpected as first child of footnote.
    conky-1.12.2/doc/docbook-xml/html/formal.xsl000066400000000000000000000402261404127277500206740ustar00rootroot00000000000000 1


    -float

    -float
    before
    before


    -float
    Broken table: tr descendent of CALS Table. before Broken table: row descendent of HTML table. before before
    float: ;
    conky-1.12.2/doc/docbook-xml/html/glossary.xsl000066400000000000000000000440351404127277500212610ustar00rootroot00000000000000 %common.entities; ]> &setup-language-variable;
    &setup-language-variable;
    &setup-language-variable;

    0 1 0 1 ( )
    0 1 0 1 ( )
    0 1 0 1
    , , ,

    Warning: glosssee @otherterm reference not found:

    Warning: glossseealso @otherterm reference not found: &setup-language-variable; Warning: processing automatic glossary without a glossary.collection file. Warning: processing automatic glossary but unable to open glossary.collection file ' '
    &setup-language-variable;
    conky-1.12.2/doc/docbook-xml/html/graphics.xsl000066400000000000000000001657341404127277500212300ustar00rootroot00000000000000 1 1
    0 0 0 1 0 1.0 1.0 1.0 1 0 px px px px 0 0 middle Warning: imagemaps not supported on scaled images 0 middle manufactured viewport for HTML img cellpadding: 0; cellspacing: 0; height: px
    background-color:
    calspair , , , Warning: only calspair or otherunits='imagemap' supported in imageobjectco
    middle
    No insertfile extension available. Cannot insert . Check use.extensions and textinsert.extension parameters.
    No insertfile extension available.
    No insertfile extension available. Cannot insert . Check use.extensions and textinsert.extension parameters.
    conky-1.12.2/doc/docbook-xml/html/highlight.xsl000066400000000000000000000061621404127277500213640ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/html/html-rtf.xsl000066400000000000000000000263611404127277500211550ustar00rootroot00000000000000

    conky-1.12.2/doc/docbook-xml/html/html.xsl000066400000000000000000000571151404127277500203650ustar00rootroot00000000000000 left right left right left right ltr rtl ltr div 0 # # bullet bullet © ® (SM)   ID recommended on : ... ERROR: no root element for CSS source file' '. ERROR: missing CSS input filename. conky-1.12.2/doc/docbook-xml/html/htmltbl.xsl000066400000000000000000000110301404127277500210510ustar00rootroot00000000000000 float: left right none none ; conky-1.12.2/doc/docbook-xml/html/index.xsl000066400000000000000000000240561404127277500205260ustar00rootroot00000000000000

    ( )
    ( )
    conky-1.12.2/doc/docbook-xml/html/info.xsl000066400000000000000000000031571404127277500203510ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/html/inline.xsl000066400000000000000000001426131404127277500206750ustar00rootroot00000000000000 %common.entities; ]> WARNING: nested link may be undefined in output: < @linkend = ' '> @xlink:href = ' '> nested inside parent element _blank _top 1 0 1 0 XLink to nonexistent id: span ( ) , , abbr acronym http://example.com/cgi-bin/man.cgi? ( ) SM Warning: glossary.collection specified, but there are automatic glossaries There's no entry for in Error: no glossentry for glossterm: . element </ > & ; &# ; % ; <? > <? ?> < > < /> <!-- --> < mailto: > + - - - + ( ) [ ] [ ] [ ] [ ]

    conky-1.12.2/doc/docbook-xml/html/its.xsl000066400000000000000000000111521404127277500202070ustar00rootroot00000000000000 its-allowed-characters its-annotators-ref its-line-break-type its-loc-note its-loc-note-ref its-loc-note-type its-loc-quality-issue-comment its-loc-quality-issue-enabled its-loc-quality-issue-profile-ref its-loc-quality-issue-severity its-loc-quality-issue-type its-loc-quality-issues-ref its-loc-quality-rating-profile-ref its-loc-quality-rating-score its-loc-quality-rating-score-threshold its-loc-quality-rating-vote its-loc-quality-rating-vote-threshold its-locale-filter-list its-locale-filter-type its-mt-confidence its-org its-org-ref its-person its-person-ref its-prov-ref its-provenance-records-ref its-rev-org its-rev-org-ref its-rev-person its-rev-person-ref its-rev-tool its-rev-tool-ref its-storage-encoding its-storage-size its-ta-class-ref its-ta-confidence its-ta-ident its-ta-ident-ref its-ta-source its-term its-term-confidence its-term-info-ref its-tool its-tool-ref its-within-text Attribute is not recognized as ITS attribute. Ignoring. its- conky-1.12.2/doc/docbook-xml/html/keywords.xsl000066400000000000000000000023151404127277500212600ustar00rootroot00000000000000 , conky-1.12.2/doc/docbook-xml/html/lists.xsl000066400000000000000000001220501404127277500205460ustar00rootroot00000000000000 compact list-style-type: ;
    circle disc square
  • list-style-type:
  • compact 1 a i A I Unexpected numeration:
  • compact


    Simple list 1
    , Simple list 1
    Simple list 1
    1 1 1 1 1   1 1 1 1 1 1   before
    0 1 0 1

    :
    Callout list

    ??? # ???
    conky-1.12.2/doc/docbook-xml/html/maketoc.xsl000066400000000000000000000052731404127277500210420ustar00rootroot00000000000000 filename=" " conky-1.12.2/doc/docbook-xml/html/manifest.xsl000066400000000000000000000017541404127277500212250ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/html/math.xsl000066400000000000000000000217261404127277500203510ustar00rootroot00000000000000 Unsupported TeX math notation: \nopagenumbers \bye \special{dvi2bitmap outputfile } $ $ \vfill\eject \special{dvi2bitmap outputfile } $$ $$ \vfill\eject \documentclass{article} \pagestyle{empty} \begin{document} \end{document} \special{dvi2bitmap outputfile } $ $ \newpage \special{dvi2bitmap outputfile } $$ $$ \newpage 0 0 1 conky-1.12.2/doc/docbook-xml/html/oldchunker.xsl000066400000000000000000000165441404127277500215600ustar00rootroot00000000000000 Encoding used in generated HTML pages This encoding is used in files generated by chunking stylesheet. Currently only Saxon is able to change output encoding. Saxon character representation used in generated HTML pages This character representation is used in files generated by chunking stylesheet. If you want to suppress entity references for characters with direct representation in default.encoding, set this parameter to value native. Chunking isn't supported with Writing for ( ) Can't make chunks with 's processor. Writing for Can't make chunks with 's processor. conky-1.12.2/doc/docbook-xml/html/onechunk.xsl000066400000000000000000000026601404127277500212260ustar00rootroot00000000000000 1 # conky-1.12.2/doc/docbook-xml/html/param.xml000066400000000000000000014204321404127277500205100ustar00rootroot00000000000000 HTML Parameter Reference $Id: param.xweb 9995 2015-10-01 16:34:45Z bobstayton $ Walsh Norman 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 Norman Walsh This is reference documentation for all user-configurable parameters in the DocBook XSL HTML stylesheets (for generating HTML output). Admonitions admon.graphics.extension string admon.graphics.extension Filename extension for admonition graphics <xsl:param name="admon.graphics.extension">.png</xsl:param> Description Sets the filename extension to use on admonition graphics. The DocBook XSL distribution provides admonition graphics in the following formats: GIF (extension: .gif) PNG (extension: .png) SVG (extension: .svg) TIFF (extension: .tif) admon.graphics.path string admon.graphics.path Path to admonition graphics <xsl:param name="admon.graphics.path">images/</xsl:param> Description Sets the path to the directory containing the admonition graphics (caution.png, important.png etc). This location is normally relative to the output html directory. See base.dir admon.graphics boolean admon.graphics Use graphics in admonitions? <xsl:param name="admon.graphics" select="0"></xsl:param> Description If true (non-zero), admonitions are presented in an alternate style that uses a graphic. Default graphics are provided in the distribution. admon.textlabel boolean admon.textlabel Use text label in admonitions? <xsl:param name="admon.textlabel" select="1"></xsl:param> Description If true (non-zero), admonitions are presented with a generated text label such as Note or Warning in the appropriate language. If zero, such labels are turned off, but any title child of the admonition element are still output. The default value is 1. admon.style string admon.style Specifies the CSS style attribute that should be added to admonitions. <xsl:param name="admon.style"> <xsl:value-of select="concat('margin-', $direction.align.start, ': 0.5in; margin-', $direction.align.end, ': 0.5in;')"></xsl:value-of> </xsl:param> Description Specifies the value of the CSS style attribute that should be added to admonitions. Callouts callout.defaultcolumn integer callout.defaultcolumn Indicates what column callouts appear in by default <xsl:param name="callout.defaultcolumn">60</xsl:param> Description If a callout does not identify a column (for example, if it uses the linerange unit), it will appear in the default column. callout.graphics.extension string callout.graphics.extension Filename extension for callout graphics <xsl:param name="callout.graphics.extension">.png</xsl:param> Description Sets the filename extension to use on callout graphics. The Docbook XSL distribution provides callout graphics in the following formats: SVG (extension: .svg) PNG (extension: .png) GIF (extension: .gif) callout.graphics.number.limit integer callout.graphics.number.limit Number of the largest callout graphic <xsl:param name="callout.graphics.number.limit">15</xsl:param> Description If callout.graphics is non-zero, graphics are used to represent callout numbers instead of plain text. The value of callout.graphics.number.limit is the largest number for which a graphic exists. If the callout number exceeds this limit, the default presentation "(plain text instead of a graphic)" will be used. callout.graphics.path string callout.graphics.path Path to callout graphics <xsl:param name="callout.graphics.path">images/callouts/</xsl:param> Description Sets the path to the directory holding the callout graphics. his location is normally relative to the output html directory. see base.dir. Always terminate the directory with / since the graphic file is appended to this string, hence needs the separator. callout.graphics boolean callout.graphics Use graphics for callouts? <xsl:param name="callout.graphics" select="1"></xsl:param> Description If non-zero, callouts are presented with graphics (e.g., reverse-video circled numbers instead of "(1)", "(2)", etc.). Default graphics are provided in the distribution. callout.list.table boolean callout.list.table Present callout lists using a table? <xsl:param name="callout.list.table" select="1"></xsl:param> Description The default presentation of calloutlists uses an HTML DL element. Some browsers don't align DLs very well if callout.graphics is used. With this option turned on, calloutlists are presented in an HTML TABLE, which usually results in better alignment of the callout number with the callout description. callout.unicode.number.limit integer callout.unicode.number.limit Number of the largest unicode callout character <xsl:param name="callout.unicode.number.limit">10</xsl:param> Description If callout.unicode is non-zero, unicode characters are used to represent callout numbers. The value of callout.unicode.number.limit is the largest number for which a unicode character exists. If the callout number exceeds this limit, the default presentation "(nnn)" will always be used. callout.unicode.start.character integer callout.unicode.start.character First Unicode character to use, decimal value. <xsl:param name="callout.unicode.start.character">10102</xsl:param> Description If callout.graphics is zero and callout.unicode is non-zero, unicode characters are used to represent callout numbers. The value of callout.unicode.start.character is the decimal unicode value used for callout number one. Currently, only values 9312 and 10102 are supported in the stylesheets for this parameter. callout.unicode boolean callout.unicode Use Unicode characters rather than images for callouts. <xsl:param name="callout.unicode" select="0"></xsl:param> Description The stylesheets can use either an image of the numbers one to ten, or the single Unicode character which represents the numeral, in white on a black background. Use this to select the Unicode character option. callouts.extension boolean callouts.extension Enable the callout extension <xsl:param name="callouts.extension" select="1"></xsl:param> Description The callouts extension processes areaset elements in programlistingco and other text-based callout elements. EBNF ebnf.table.bgcolor color ebnf.table.bgcolor Background color for EBNF tables <xsl:param name="ebnf.table.bgcolor">#F5DCB3</xsl:param> Description Sets the background color for EBNF tables (a pale brown). No bgcolor attribute is output if ebnf.table.bgcolor is set to the null string. ebnf.table.border boolean ebnf.table.border Selects border on EBNF tables <xsl:param name="ebnf.table.border" select="1"></xsl:param> Description Selects the border on EBNF tables. If non-zero, the tables have borders, otherwise they don't. ebnf.assignment rtf ebnf.assignment The EBNF production assignment operator <xsl:param name="ebnf.assignment"> <code>::=</code> </xsl:param> Description The ebnf.assignment parameter determines what text is used to show assignment in productions in productionsets. While ::= is common, so are several other operators. ebnf.statement.terminator rtf ebnf.statement.terminator Punctuation that ends an EBNF statement. <xsl:param name="ebnf.statement.terminator"></xsl:param> Description The ebnf.statement.terminator parameter determines what text is used to terminate each production in productionset. Some notations end each statement with a period. ToC/LoT/Index Generation annotate.toc boolean annotate.toc Annotate the Table of Contents? <xsl:param name="annotate.toc" select="1"></xsl:param> Description If true, TOCs will be annotated. At present, this just means that the refpurpose of refentry TOC entries will be displayed. autotoc.label.separator string autotoc.label.separator Separator between labels and titles in the ToC <xsl:param name="autotoc.label.separator">. </xsl:param> Description String used to separate labels and titles in a table of contents. autotoc.label.in.hyperlink boolean autotoc.label.in.hyperlink Include label in hyperlinked titles in TOC? <xsl:param name="autotoc.label.in.hyperlink" select="1"></xsl:param> Description If the value of autotoc.label.in.hyperlink is non-zero, labels are included in hyperlinked titles in the TOC. If it is instead zero, labels are still displayed prior to the hyperlinked titles, but are not hyperlinked along with the titles. process.source.toc boolean process.source.toc Process a non-empty toc element if it occurs in a source document? <xsl:param name="process.source.toc" select="0"></xsl:param> Description Specifies that the contents of a non-empty "hard-coded" toc element in a source document are processed to generate a TOC in output. This parameter has no effect on automated generation of TOCs. An automated TOC may still be generated along with the "hard-coded" TOC. To suppress automated TOC generation, adjust the value of the generate.toc paramameter. The process.source.toc parameter also has no effect if the toc element is empty; handling for empty toc is controlled by the process.empty.source.toc parameter. process.empty.source.toc boolean process.empty.source.toc Generate automated TOC if toc element occurs in a source document? <xsl:param name="process.empty.source.toc" select="0"></xsl:param> Description Specifies that if an empty toc element is found in a source document, an automated TOC is generated at this point in the document. Depending on what the value of the generate.toc parameter is, setting this parameter to 1 could result in generation of duplicate automated TOCs. So the process.empty.source.toc is primarily useful as an "override": by placing an empty toc in your document and setting this parameter to 1, you can force a TOC to be generated even if generate.toc says not to. bridgehead.in.toc boolean bridgehead.in.toc Should bridgehead elements appear in the TOC? <xsl:param name="bridgehead.in.toc" select="0"></xsl:param> Description If non-zero, bridgeheads appear in the TOC. Note that this option is not fully supported and may be removed in a future version of the stylesheets. simplesect.in.toc boolean simplesect.in.toc Should simplesect elements appear in the TOC? <xsl:param name="simplesect.in.toc" select="0"></xsl:param> Description If non-zero, simplesects will be included in the TOC. manual.toc string manual.toc An explicit TOC to be used for the TOC <xsl:param name="manual.toc"></xsl:param> Description The manual.toc identifies an explicit TOC that will be used for building the printed TOC. toc.list.type list dl ul ol toc.list.type Type of HTML list element to use for Tables of Contents <xsl:param name="toc.list.type">dl</xsl:param> Description When an automatically generated Table of Contents (or List of Titles) is produced, this HTML element will be used to make the list. toc.section.depth integer toc.section.depth How deep should recursive sections appear in the TOC? <xsl:param name="toc.section.depth">2</xsl:param> Description Specifies the depth to which recursive sections should appear in the TOC. toc.max.depth integer toc.max.depth How many levels should be created for each TOC? <xsl:param name="toc.max.depth">8</xsl:param> Description Specifies the maximal depth of TOC on all levels. generate.toc table generate.toc Control generation of ToCs and LoTs <xsl:param name="generate.toc"> appendix toc,title article/appendix nop article toc,title book toc,title,figure,table,example,equation chapter toc,title part toc,title preface toc,title qandadiv toc qandaset toc reference toc,title sect1 toc sect2 toc sect3 toc sect4 toc sect5 toc section toc set toc,title </xsl:param> Description This parameter has a structured value. It is a table of space-delimited path/value pairs. Each path identifies some element in the source document using a restricted subset of XPath (only the implicit child axis, no wildcards, no predicates). Paths can be either relative or absolute. When processing a particular element, the stylesheets consult this table to determine if a ToC (or LoT(s)) should be generated. For example, consider the entry: book toc,figure This indicates that whenever a book is formatted, a Table Of Contents and a List of Figures should be generated. Similarly, /chapter toc indicates that whenever a document that has a root of chapter is formatted, a Table of Contents should be generated. The entry chapter would match all chapters, but /chapter matches only chapter document elements. Generally, the longest match wins. So, for example, if you want to distinguish articles in books from articles in parts, you could use these two entries: book/article toc,figure part/article toc Note that an article in a part can never match a book/article, so if you want nothing to be generated for articles in parts, you can simply leave that rule out. If you want to leave the rule in, to make it explicit that you're turning something off, use the value nop. For example, the following entry disables ToCs and LoTs for articles: article nop Do not simply leave the word article in the file without a matching value. That'd be just begging the silly little path/value parser to get confused. Section ToCs are further controlled by the generate.section.toc.level parameter. For a given section level to have a ToC, it must have both an entry in generate.toc and be within the range enabled by generate.section.toc.level. generate.section.toc.level integer generate.section.toc.level Control depth of TOC generation in sections <xsl:param name="generate.section.toc.level" select="0"></xsl:param> Description The generate.section.toc.level parameter controls the depth of section in which TOCs will be generated. Note that this is related to, but not the same as toc.section.depth, which controls the depth to which TOC entries will be generated in a given TOC. If, for example, generate.section.toc.level is 3, TOCs will be generated in first, second, and third level sections, but not in fourth level sections. generate.index boolean generate.index Do you want an index? <xsl:param name="generate.index" select="1"></xsl:param> Description Specify if an index should be generated. index.method list basic kosek kimber index.method Select method used to group index entries in an index <xsl:param name="index.method">basic</xsl:param> Description This parameter lets you select which method to use for sorting and grouping index entries in an index. Indexes in Latin-based languages that have accented characters typically sort together accented words and unaccented words. Thus Á (U+00C1 LATIN CAPITAL LETTER A WITH ACUTE) would sort together with A (U+0041 LATIN CAPITAL LETTER A), so both would appear in the A section of the index. Languages using other alphabets (such as Russian, which is written in the Cyrillic alphabet) and languages using ideographic chararacters (such as Japanese) require grouping specific to the languages and alphabets. The default indexing method is limited. It can group accented characters in Latin-based languages only. It cannot handle non-Latin alphabets or ideographic languages. The other indexing methods require extensions of one type or another, and do not work with all XSLT processors, which is why they are not used by default. The three choices for indexing method are: basic (default) Sort and groups words based only on the Latin alphabet. Words with accented Latin letters will group and sort with their respective primary letter, but words in non-Latin alphabets will be put in the Symbols section of the index. kosek This method sorts and groups words based on letter groups configured in the DocBook locale file for the given language. See, for example, the French locale file common/fr.xml. This method requires that the XSLT processor supports the EXSLT extensions (most do). It also requires support for using user-defined functions in xsl:key (xsltproc does not). This method is suitable for any language for which you can list all the individual characters that should appear in each letter group in an index. It is probably not practical to use it for ideographic languages such as Chinese that have hundreds or thousands of characters. To use the kosek method, you must: Use a processor that supports its extensions, such as Saxon 6 or Xalan (xsltproc and Saxon 8 do not). Set the index.method parameter's value to kosek. Import the appropriate index extensions stylesheet module fo/autoidx-kosek.xsl or html/autoidx-kosek.xsl into your customization. kimber This method uses extensions to the Saxon processor to implement sophisticated indexing processes. It uses its own configuration file, which can include information for any number of languages. Each language's configuration can group words using one of two processes. In the enumerated process similar to that used in the kosek method, you indicate the groupings character-by-character. In the between-key process, you specify the break-points in the sort order that should start a new group. The latter configuration is useful for ideographic languages such as Chinese, Japanese, and Korean. You can also define your own collation algorithms and how you want mixed Latin-alphabet words sorted. For a whitepaper describing the extensions, see: http://www.innodata-isogen.com/knowledge_center/white_papers/back_of_book_for_xsl_fo.pdf. To download the extension library, see http://www.innodata-isogen.com/knowledge_center/tools_downloads/i18nsupport. To use the kimber method, you must: Use Saxon (version 6 or 8) as your XSLT processor. Install and configure the Innodata Isogen library, using the documentation that comes with it. Set the index.method parameter's value to kimber. Import the appropriate index extensions stylesheet module fo/autoidx-kimber.xsl or html/autoidx-kimber.xsl into your customization. index.on.type boolean index.on.type Select indexterms based on type attribute value <xsl:param name="index.on.type" select="0"></xsl:param> Description If non-zero, then an index element that has a type attribute value will contain only those indexterm elements with a matching type attribute value. If an index has no type attribute or it is blank, then the index will contain all indexterms in the current scope. If index.on.type is zero, then the type attribute has no effect on selecting indexterms for an index. For those using DocBook version 4.2 or earlier, the type attribute is not available for index terms. However, you can achieve the same effect by using the role attribute in the same manner on indexterm and index, and setting the stylesheet parameter index.on.role to a nonzero value. index.on.role boolean index.on.role Select indexterms based on role value <xsl:param name="index.on.role" select="0"></xsl:param> Description If non-zero, then an index element that has a role attribute value will contain only those indexterm elements with a matching role value. If an index has no role attribute or it is blank, then the index will contain all indexterms in the current scope. If index.on.role is zero, then the role attribute has no effect on selecting indexterms for an index. If you are using DocBook version 4.3 or later, you should use the type attribute instead of role on indexterm and index, and set the index.on.type to a nonzero value. index.links.to.section boolean index.links.to.section HTML index entries link to container section title <xsl:param name="index.links.to.section" select="1"></xsl:param> Description If zero, then an index entry in an index links directly to the location of the generated anchor that is output for the indexterm. If two identical indexterm elements exist in the same section, then both entries appear in the index with the same title but link to different locations. If non-zero, then an index entry in an index links to the section title containing the indexterm, rather than directly to the anchor output for the indexterm. Duplicate indexterm entries in the same section are dropped. The default value is 1, so index entries link to section titles by default. In both cases, the link text in an index entry is the title of the section containing the indexterm. That is because HTML does not have numbered pages. It also provides the reader with context information for each link. This parameter lets you choose which style of index linking you want. When set to 0, an index entry takes you to the precise location of its corresponding indexterm. However, if you have a lot of duplicate entries in sections, then you have a lot of duplicate titles in the index, which makes it more cluttered. The reader may not recognize why duplicate titles appear until they follow the links. Also, the links may land the reader in the middle of a section where the section title is not visible, which may also be confusing to the reader. When set to 1, an index entry link is less precise, but duplicate titles in the index entries are eliminated. Landing on the section title location may confirm the reader's expectation that a link that shows a section title will take them to that section title, not a location within the section. index.prefer.titleabbrev boolean index.prefer.titleabbrev Should abbreviated titles be used as back references? <xsl:param name="index.prefer.titleabbrev" select="0"></xsl:param> Description If non-zero, and if a titleabbrev is defined, the abbreviated title is used as the link text of a back reference in the index. autolink.index.see boolean autolink.index.see Link index see and seealso to index primary <xsl:param name="autolink.index.see" select="1"></xsl:param> Description If this param is set to a non-zero value, (default = 1), then the stylesheet will attempt for form a link between a see or seealso element and a matching indexterm primary element. The stylesheet uses an exact text match after applying the normalize-space() function. If the see or seealso text contains a comma, then only the text prior to the comma is used. This assumes the author is using the convention "see primary, secondary" to specify a subentry. Automatic links always land on the primary entry in the index, so the reader has to look down to see the secondary entry. If there is no match on a primary, no link is formed, but the text still displays. No attempt is made to automatically link to text in secondary or tertiary elements. If you want to link to such elements, you can form a manual link by adding a linkend attribute to the see or seealso element, where the linkend references an id or xml:id attribute on such a subelement. Such manual links take precedence over any automatic links. If this parameter is zero, then no automatic links from see and seealso are formed within the index. Any manual links are still processed, however. index.term.separator string index.term.separator Override for punctuation separating an index term from its list of page references in an index <xsl:param name="index.term.separator"></xsl:param> Description This parameter permits you to override the text to insert between the end of an index term and its list of page references. Typically that might be a comma and a space. Because this text may be locale dependent, this parameter's value is normally taken from a gentext template named 'term-separator' in the context 'index' in the stylesheet locale file for the language of the current document. This parameter can be used to override the gentext string, and would typically be used on the command line. This parameter would apply to all languages. So this text string can be customized in two ways. You can reset the default gentext string using the local.l10n.xml parameter, or you can fill in the content for this normally empty override parameter. The content can be a simple string, or it can be something more complex such as a call-template. For fo output, it could be an fo:leader element to provide space of a specific length, or a dot leader. index.number.separator string index.number.separator Override for punctuation separating page numbers in index <xsl:param name="index.number.separator"></xsl:param> Description This parameter permits you to override the text to insert between page references in a formatted index entry. Typically that would be a comma and a space. Because this text may be locale dependent, this parameter's value is normally taken from a gentext template named 'number-separator' in the context 'index' in the stylesheet locale file for the language of the current document. This parameter can be used to override the gentext string, and would typically be used on the command line. This parameter would apply to all languages. So this text string can be customized in two ways. You can reset the default gentext string using the local.l10n.xml parameter, or you can override the gentext with the content of this parameter. The content can be a simple string, or it can be something more complex such as a call-template. In HTML index output, section title references are used instead of page number references. This punctuation appears between such section titles in an HTML index. index.range.separator string index.range.separator Override for punctuation separating the two numbers in a page range in index <xsl:param name="index.range.separator"></xsl:param> Description This parameter permits you to override the text to insert between the two numbers of a page range in an index. This parameter is only used by those XSL-FO processors that support an extension for generating such page ranges (such as XEP). Because this text may be locale dependent, this parameter's value is normally taken from a gentext template named 'range-separator' in the context 'index' in the stylesheet locale file for the language of the current document. This parameter can be used to override the gentext string, and would typically be used on the command line. This parameter would apply to all languages. So this text string can be customized in two ways. You can reset the default gentext string using the local.l10n.xml parameter, or you can override the gentext with the content of this parameter. The content can be a simple string, or it can be something more complex such as a call-template. In HTML index output, section title references are used instead of page number references. So there are no page ranges and this parameter has no effect. Stylesheet Extensions linenumbering.everyNth integer linenumbering.everyNth Indicate which lines should be numbered <xsl:param name="linenumbering.everyNth">5</xsl:param> Description If line numbering is enabled, everyNth line will be numbered. Note that numbering is one based, not zero based. See also linenumbering.extension, linenumbering.separator, linenumbering.width and use.extensions linenumbering.extension boolean linenumbering.extension Enable the line numbering extension <xsl:param name="linenumbering.extension" select="1"></xsl:param> Description If non-zero, verbatim environments (address, literallayout, programlisting, screen, synopsis) that specify line numbering will have line numbers. linenumbering.separator string linenumbering.separator Specify a separator between line numbers and lines <xsl:param name="linenumbering.separator"><xsl:text> </xsl:text></xsl:param> Description The separator is inserted between line numbers and lines in the verbatim environment. The default value is a single white space. Note the interaction with linenumbering.width linenumbering.width integer linenumbering.width Indicates the width of line numbers <xsl:param name="linenumbering.width">3</xsl:param> Description If line numbering is enabled, line numbers will appear right justified in a field "width" characters wide. tablecolumns.extension boolean tablecolumns.extension Enable the table columns extension function <xsl:param name="tablecolumns.extension" select="1"></xsl:param> Description The table columns extension function adjusts the widths of table columns in the HTML result to more accurately reflect the specifications in the CALS table. textinsert.extension boolean textinsert.extension Enables the textinsert extension element <xsl:param name="textinsert.extension" select="1"></xsl:param> Description The textinsert extension element inserts the contents of a file into the result tree (as text). To use the textinsert extension element, you must use either Saxon or Xalan as your XSLT processor (it doesn’t work with xsltproc), along with either the DocBook Saxon extensions or DocBook Xalan extensions (for more information about those extensions, see DocBook Saxon Extensions and DocBook Xalan Extensions), and you must set both the use.extensions and textinsert.extension parameters to 1. As an alternative to using the textinsert element, consider using an Xinclude element with the parse="text" attribute and value specified, as detailed in Using XInclude for text inclusions. See Also You can also use the dbhtml-include href processing instruction to insert external files — both files containing plain text and files with markup content (including HTML content). More information For how-to documentation on inserting contents of external code files and other text files into output, see External code files. For guidelines on inserting contents of HTML files into output, see Inserting external HTML code. textdata.default.encoding string textdata.default.encoding Default encoding of external text files which are included using textdata element <xsl:param name="textdata.default.encoding"></xsl:param> Description Specifies the encoding of any external text files included using textdata element. This value is used only when you do not specify encoding by the appropriate attribute directly on textdata. An empty string is interpreted as the system default encoding. graphicsize.extension boolean graphicsize.extension Enable the getWidth()/getDepth() extension functions <xsl:param name="graphicsize.extension" select="1"></xsl:param> Description If non-zero (and if use.extensions is non-zero and if you're using a processor that supports extension functions), the getWidth and getDepth functions will be used to extract image sizes from graphics. The main supported image formats are GIF, JPEG, and PNG. Somewhat cruder support for EPS and PDF images is also available. graphicsize.use.img.src.path boolean graphicsize.use.img.src.path Prepend img.src.path before filenames passed to extension functions <xsl:param name="graphicsize.use.img.src.path" select="0"></xsl:param> Description If non-zero img.src.path parameter will be appended before filenames passed to extension functions for measuring image dimensions. use.extensions boolean use.extensions Enable extensions <xsl:param name="use.extensions" select="0"></xsl:param> Description If non-zero, extensions may be used. Each extension is further controlled by its own parameter. But if use.extensions is zero, no extensions will be used. Automatic labelling chapter.autolabel list 0none 11,2,3... AA,B,C... aa,b,c... ii,ii,iii... II,II,III... chapter.autolabel Specifies the labeling format for Chapter titles <xsl:param name="chapter.autolabel" select="1"></xsl:param> Description If non-zero, then chapters will be numbered using the parameter value as the number format if the value matches one of the following: 1 or arabic Arabic numeration (1, 2, 3 ...). A or upperalpha Uppercase letter numeration (A, B, C ...). a or loweralpha Lowercase letter numeration (a, b, c ...). I or upperroman Uppercase roman numeration (I, II, III ...). i or lowerroman Lowercase roman letter numeration (i, ii, iii ...). Any nonzero value other than the above will generate the default number format (arabic). appendix.autolabel list 0none 11,2,3... AA,B,C... aa,b,c... ii,ii,iii... II,II,III... appendix.autolabel Specifies the labeling format for Appendix titles <xsl:param name="appendix.autolabel">A</xsl:param> Description If non-zero, then appendices will be numbered using the parameter value as the number format if the value matches one of the following: 1 or arabic Arabic numeration (1, 2, 3 ...). A or upperalpha Uppercase letter numeration (A, B, C ...). a or loweralpha Lowercase letter numeration (a, b, c ...). I or upperroman Uppercase roman numeration (I, II, III ...). i or lowerroman Lowercase roman letter numeration (i, ii, iii ...). Any nonzero value other than the above will generate the default number format (upperalpha). part.autolabel list 0none 11,2,3... AA,B,C... aa,b,c... ii,ii,iii... II,II,III... part.autolabel Specifies the labeling format for Part titles <xsl:param name="part.autolabel">I</xsl:param> Description If non-zero, then parts will be numbered using the parameter value as the number format if the value matches one of the following: 1 or arabic Arabic numeration (1, 2, 3 ...). A or upperalpha Uppercase letter numeration (A, B, C ...). a or loweralpha Lowercase letter numeration (a, b, c ...). I or upperroman Uppercase roman numeration (I, II, III ...). i or lowerroman Lowercase roman letter numeration (i, ii, iii ...). Any nonzero value other than the above will generate the default number format (upperroman). reference.autolabel list 0none 11,2,3... AA,B,C... aa,b,c... ii,ii,iii... II,II,III... reference.autolabel Specifies the labeling format for Reference titles <xsl:param name="reference.autolabel">I</xsl:param> Description If non-zero, references will be numbered using the parameter value as the number format if the value matches one of the following: 1 or arabic Arabic numeration (1, 2, 3 ...). A or upperalpha Uppercase letter numeration (A, B, C ...). a or loweralpha Lowercase letter numeration (a, b, c ...). I or upperroman Uppercase roman numeration (I, II, III ...). i or lowerroman Lowercase roman letter numeration (i, ii, iii ...). Any non-zero value other than the above will generate the default number format (upperroman). preface.autolabel list 0none 11,2,3... AA,B,C... aa,b,c... ii,ii,iii... II,II,III... preface.autolabel Specifices the labeling format for Preface titles <xsl:param name="preface.autolabel" select="0"></xsl:param> Description If non-zero then prefaces will be numbered using the parameter value as the number format if the value matches one of the following: 1 or arabic Arabic numeration (1, 2, 3 ...). A or upperalpha Uppercase letter numeration (A, B, C ...). a or loweralpha Lowercase letter numeration (a, b, c ...). I or upperroman Uppercase roman numeration (I, II, III ...). i or lowerroman Lowercase roman letter numeration (i, ii, iii ...). Any nonzero value other than the above will generate the default number format (arabic). qandadiv.autolabel boolean qandadiv.autolabel Are divisions in QAndASets enumerated? <xsl:param name="qandadiv.autolabel" select="1"></xsl:param> Description If non-zero, unlabeled qandadivs will be enumerated. section.autolabel boolean section.autolabel Are sections enumerated? <xsl:param name="section.autolabel" select="0"></xsl:param> Description If true (non-zero), unlabeled sections will be enumerated. section.autolabel.max.depth integer section.autolabel.max.depth The deepest level of sections that are numbered. <xsl:param name="section.autolabel.max.depth">8</xsl:param> Description When section numbering is turned on by the section.autolabel parameter, then this parameter controls the depth of section nesting that is numbered. Sections nested to a level deeper than this value will not be numbered. section.label.includes.component.label boolean section.label.includes.component.label Do section labels include the component label? <xsl:param name="section.label.includes.component.label" select="0"></xsl:param> Description If non-zero, section labels are prefixed with the label of the component that contains them. label.from.part boolean label.from.part Renumber components in each part? <xsl:param name="label.from.part" select="0"></xsl:param> Description If label.from.part is non-zero, then numbering of components — preface, chapter, appendix, and reference (when reference occurs at the component level) — is re-started within each part. If label.from.part is zero (the default), numbering of components is not re-started within each part; instead, components are numbered sequentially throughout each book, regardless of whether or not they occur within part instances. component.label.includes.part.label boolean component.label.includes.part.label Do component labels include the part label? <xsl:param name="component.label.includes.part.label" select="0"></xsl:param> Description If non-zero, number labels for chapter, appendix, and other component elements are prefixed with the label of the part element that contains them. So you might see Chapter II.3 instead of Chapter 3. Also, the labels for formal elements such as table and figure will include the part label. If there is no part element container, then no prefix is generated. This feature is most useful when the label.from.part parameter is turned on. In that case, there would be more than one chapter 1, and the extra part label prefix will identify each chapter unambiguously. HTML html.base uri html.base An HTML base URI <xsl:param name="html.base"></xsl:param> Description If html.base is set, it is used for the base element in the head of the html documents. The parameter specifies the base URL for all relative URLs in the document. This is useful for dynamically served html where the base URI needs to be shifted. html.stylesheet string html.stylesheet Name of the stylesheet(s) to use in the generated HTML <xsl:param name="html.stylesheet"></xsl:param> Description The html.stylesheet parameter is either empty, indicating that no stylesheet link tag should be generated in the html output, or it is a list of one or more stylesheet files. Multiple stylesheets are space-delimited. If you need to reference a stylesheet URI that includes a space, encode it with %20. A separate html link element will be generated for each stylesheet in the order they are listed in the parameter. html.stylesheet.type string html.stylesheet.type The type of the stylesheet used in the generated HTML <xsl:param name="html.stylesheet.type">text/css</xsl:param> Description The type of the stylesheet to place in the HTML link tag. css.decoration boolean css.decoration Enable CSS decoration of elements <xsl:param name="css.decoration" select="1"></xsl:param> Description If non-zero, then html elements produced by the stylesheet may be decorated with style attributes. For example, the li tags produced for list items may include a fragment of CSS in the style attribute which sets the CSS property "list-style-type". html.script string html.script Name of the script(s) to use in the generated HTML <xsl:param name="html.script"></xsl:param> Description The html.script parameter is either empty (default), indicating that no script element should be generated in the html output, or it is a list of one or more script locations. Multiple script locations are space-delimited. If you need to reference a script URI that includes a space, encode it with %20. A separate html script element will be generated for each script in the order they are listed in the parameter. html.script.type string html.script.type The type of script used in the generated HTML <xsl:param name="html.script.type">text/javascript</xsl:param> Description The type of script to place in the HTML script element. Specifically, the value of the script element's type attribute. The default value is text/javascript. This param is used only when the stylesheet parameter html.script is non-blank and specifies the location of a script. spacing.paras boolean spacing.paras Insert additional <p> elements for spacing? <xsl:param name="spacing.paras" select="0"></xsl:param> Description When non-zero, additional, empty paragraphs are inserted in several contexts (for example, around informal figures), to create a more pleasing visual appearance in many browsers. emphasis.propagates.style boolean emphasis.propagates.style Pass emphasis role attribute through to HTML? <xsl:param name="emphasis.propagates.style" select="1"></xsl:param> Description If non-zero, the role attribute of emphasis elements will be passed through to the HTML as a class attribute on a span that surrounds the emphasis. para.propagates.style boolean para.propagates.style Pass para role attribute through to HTML? <xsl:param name="para.propagates.style" select="1"></xsl:param> Description If true, the role attribute of para elements will be passed through to the HTML as a class attribute on the p generated for the paragraph. phrase.propagates.style boolean phrase.propagates.style Pass phrase role attribute through to HTML? <xsl:param name="phrase.propagates.style" select="1"></xsl:param> Description If non-zero, the role attribute of phrase elements will be passed through to the HTML as a class attribute on a span that surrounds the phrase. entry.propagates.style boolean entry.propagates.style Pass entry role attribute through to HTML? <xsl:param name="entry.propagates.style" select="1"></xsl:param> Description If true, the role attribute of entry elements will be passed through to the HTML as a class attribute on the td or th generated for the table cell. html.longdesc boolean html.longdesc Should longdesc URIs be created? <xsl:param name="html.longdesc" select="1"></xsl:param> Description If non-zero, HTML files will be created for the longdesc attribute. These files are created from the textobjects in mediaobjects and inlinemediaobject. html.longdesc.link boolean html.longdesc.link Should a link to the longdesc be included in the HTML? <xsl:param name="html.longdesc.link" select="$html.longdesc"></xsl:param> Description If non-zero, links will be created to the HTML files created for the longdesc attribute. It makes no sense to enable this option without also enabling the html.longdesc parameter. make.valid.html boolean make.valid.html Attempt to make sure the HTML output is valid HTML <xsl:param name="make.valid.html" select="0"></xsl:param> Description If make.valid.html is true, the stylesheets take extra effort to ensure that the resulting HTML is valid. This may mean that some para tags are translated into HTML divs or that other substitutions occur. This parameter is different from html.cleanup because it changes the resulting markup; it does not use extension functions to manipulate result-tree-fragments and is therefore applicable to any XSLT processor. html.cleanup boolean html.cleanup Attempt to clean up the resulting HTML? <xsl:param name="html.cleanup" select="1"></xsl:param> Description If non-zero, and if the EXSLT extensions are supported by your processor, the resulting HTML will be cleaned up. This improves the chances that the resulting HTML will be valid. It may also improve the formatting of some elements. This parameter is different from make.valid.html because it uses extension functions to manipulate result-tree-fragments. html.append string html.append Specifies content to append to HTML output <xsl:param name="html.append"></xsl:param> Description Specifies content to append to the end of HTML files output by the html/docbook.xsl stylesheet, after the closing <html> tag. You probably don’t want to set any value for this parameter; but if you do, the only value it should ever be set to is a newline character: &#x0a; or &#10; draft.mode list no yes maybe draft.mode Select draft mode <xsl:param name="draft.mode">no</xsl:param> Description Selects draft mode. If draft.mode is yes, the entire document will be treated as a draft. If it is no, the entire document will be treated as a final copy. If it is maybe, individual sections will be treated as draft or final independently, depending on how their status attribute is set. draft.watermark.image uri draft.watermark.image The URI of the image to be used for draft watermarks <xsl:param name="draft.watermark.image">images/draft.png</xsl:param> Description The image to be used for draft watermarks. generate.id.attributes boolean generate.id.attributes Generate ID attributes on container elements? <xsl:param name="generate.id.attributes" select="0"></xsl:param> Description If non-zero, the HTML stylesheet will generate ID attributes on containers. For example, the markup: <section id="foo"><title>Some Title</title> <para>Some para.</para> </section> might produce: <div class="section" id="foo"> <h2>Some Title</h2> <p>Some para.</p> </div> The alternative is to generate anchors: <div class="section"> <h2><a name="foo"></a>Some Title</h2> <p>Some para.</p> </div> Because the name attribute of the a element and the id attribute of other tags are both of type ID, producing both generates invalid documents. As of version 1.50, you can use this switch to control which type of identifier is generated. For backwards-compatibility, generating a anchors is preferred. Note: at present, this switch is incompletely implemented. Disabling ID attributes will suppress them, but enabling ID attributes will not suppress the anchors. generate.consistent.ids boolean generate.consistent.ids Generate consistent id values if document is unchanged <xsl:param name="generate.consistent.ids" select="0"></xsl:param> Description When the stylesheet assigns an id value to an output element, the generate-id() function may be used. That function may not produce consistent values between runs. Version control systems may misidentify the changing id values as changes to the document. If you set this parameter's value to 1, then the template named object.id will replace the use of the function generate-id() with <xsl:number level="multiple" count="*"/>. This counts preceding elements to generate a unique number for the id value. This param does not associate permanent unique id values with particular elements. The id values are consistent only as long as the document structure does not change. If the document structure changes, then the counting of elements changes, and all id values after the first such change may be different, even when there is no change to the element itself or its output. The default value of this parameter is zero, so generate-id() is used by default. generate.meta.abstract boolean generate.meta.abstract Generate HTML META element from abstract? <xsl:param name="generate.meta.abstract" select="1"></xsl:param> Description If non-zero, document abstracts will be reproduced in the HTML head, with >meta name="description" content="..." make.clean.html boolean make.clean.html Make HTML conform to modern coding standards <xsl:param name="make.clean.html" select="0"></xsl:param> Description If make.clean.html is true, the stylesheets take extra effort to ensure that the resulting HTML is conforms to modern HTML coding standards. In addition to eliminating excessive and noncompliant coding, it moves presentation HTML coding to a CSS stylesheet. The resulting HTML is dependent on CSS for formatting, and so the stylesheet is capable of generating a supporting CSS file. The docbook.css.source and custom.css.source parameters control how a CSS file is generated. If you require your CSS to reside in the HTML head element, then the generate.css.header can be used to do that. The make.clean.html parameter is different from html.cleanup because the former changes the resulting markup; it does not use extension functions like the latter to manipulate result-tree-fragments, and is therefore applicable to any XSLT processor. If make.clean.html is set to zero (the default), then the stylesheet retains its original old style HTML formatting features. docbook.css.source string docbook.css.source Name of the default CSS input file <xsl:param name="docbook.css.source">docbook.css.xml</xsl:param> Description The docbook.css.source parameter specifies the name of the file containing the default DocBook CSS styles. Those styles are necessary when the make.clean.html parameter is nonzero. The file is a well-formed XML file that must consist of a single style root element that contains CSS styles as its text content. The default value of the parameter (and filename) is docbook.css.xml. The stylesheets ship with the default file. You can substitute your own and specify its path in this parameter. If docbook.css.source is not blank, and make.clean.html is nonzero, then the stylesheet takes the following actions: The stylesheet uses the XSLT document() function to open the file specified by the parameter and load it into a variable. The stylesheet forms an output pathname consisting of the value of the base.dir parameter (if it is set) and the value of docbook.css.source, with the .xml suffix stripped off. The stylesheet removes the style wrapper element and writes just the CSS text content to the output file. The stylesheet adds a link element to the HTML HEAD element to reference the external CSS stylesheet. For example: <link rel="stylesheet" href="docbook.css" type="text/css"> However, if the docbook.css.link parameter is set to zero, then no link is written for the default CSS file. That is useful if a custom CSS file will import the default CSS stylesheet to ensure proper cascading of styles. If the docbook.css.source parameter is changed from its default docbook.css.xml to blank, then no default CSS is generated. Likewise if the make.clean.html parameter is set to zero, then no default CSS is generated. The custom.css.source parameter can be used instead to generate a complete custom CSS file. You can use the generate.css.header parameter to instead write the CSS to each HTML HEAD element in a style tag instead of an external CSS file. docbook.css.link boolean docbook.css.link Insert a link referencing the default CSS stylesheet <xsl:param name="docbook.css.link" select="1"></xsl:param> Description The stylesheets are capable of generating a default CSS stylesheet file. The parameters make.clean.html and docbook.css.source control that feature. Normally if a default CSS file is generated, then the stylesheet inserts a link tag in the HTML HEAD element to reference it. However, you can omit that link reference if you set the docbook.css.link to zero (1 is the default). This parameter is useful when you want to import the default CSS into a custom CSS file generated using the custom.css.source parameter. custom.css.source string custom.css.source Name of a custom CSS input file <xsl:param name="custom.css.source"></xsl:param> Description The custom.css.source parameter enables you to add CSS styles to DocBook's HTML output. The parameter specifies the name of a file containing custom CSS styles. The file must be a well-formed XML file that consists of a single style root element that contains CSS styles as its text content. For example: <?xml version="1.0"?> <style> h2 { font-weight: bold; color: blue; } ... </style> The filename specified by the parameter should have a .xml filename suffix, although that is not required. The default value of this parameter is blank. If custom.css.source is not blank, then the stylesheet takes the following actions. These actions take place regardless of the value of the make.clean.html parameter. The stylesheet uses the XSLT document() function to open the file specified by the parameter and load it into a variable. The stylesheet forms an output pathname consisting of the value of the base.dir parameter (if it is set) and the value of custom.css.source, with the .xml suffix stripped off. The stylesheet removes the style wrapper element and writes just the CSS text content to the output file. The stylesheet adds a link element to the HTML HEAD element to reference this external CSS stylesheet. For example: <link rel="stylesheet" href="custom.css" type="text/css"> If the make.clean.html parameter is nonzero (the default is zero), and if the docbook.css.source parameter is not blank (the default is not blank), then the stylesheet will also generate a default CSS file and add a link tag to reference it. The link to the custom CSS comes after the link to the default, so it should cascade properly in most browsers. If you do not want two link tags, and instead want your custom CSS to import the default generated CSS file, then do the following: Add a line like the following to your custom CSS source file: @import url("docbook.css") Set the docbook.css.link parameter to zero. This will omit the link tag that references the default CSS file. If you set make.clean.html to nonzero but you do not want the default CSS generated, then also set the docbook.css.source parameter to blank. Then no default CSS will be generated, and so all CSS styles must come from your custom CSS file. You can use the generate.css.header parameter to instead write the CSS to each HTML HEAD element in a style tag instead of an external CSS file. generate.css.header boolean generate.css.header Insert generated CSS styles in HEAD element <xsl:param name="generate.css.header" select="0"></xsl:param> Description The stylesheets are capable of generating both default and custom CSS stylesheet files. The parameters make.clean.html, docbook.css.source, and custom.css.source control that feature. If you require that CSS styles reside in the HTML HEAD element instead of external CSS files, then set the generate.css.header parameter to nonzero (it is zero by default). Then instead of generating the CSS in external files, they are wrapped in style elements in the HEAD element of each HTML output file. XSLT Processing rootid string rootid Specify the root element to format <xsl:param name="rootid"></xsl:param> Description If rootid is not empty, it must be the value of an ID that occurs in the document being formatted. The entire document will be loaded and parsed, but formatting will begin at the element identified, rather than at the root. For example, this allows you to process only chapter 4 of a book. Because the entire document is available to the processor, automatic numbering, cross references, and other dependencies are correctly resolved. suppress.navigation boolean suppress.navigation Disable header and footer navigation <xsl:param name="suppress.navigation" select="0"></xsl:param> Description If non-zero, header and footer navigation will be suppressed. suppress.header.navigation boolean suppress.header.navigation Disable header navigation <xsl:param name="suppress.header.navigation" select="0"></xsl:param> Description If non-zero, header navigation will be suppressed. suppress.footer.navigation boolean suppress.footer.navigation Disable footer navigation <xsl:param name="suppress.footer.navigation">0</xsl:param> Description If non-zero, footer navigation will be suppressed. header.rule boolean header.rule Rule under headers? <xsl:param name="header.rule" select="1"></xsl:param> Description If non-zero, a rule will be drawn below the page headers. footer.rule boolean footer.rule Rule over footers? <xsl:param name="footer.rule" select="1"></xsl:param> Description If non-zero, a rule will be drawn above the page footers. id.warnings boolean id.warnings Should warnings be generated for titled elements without IDs? <xsl:param name="id.warnings" select="0"></xsl:param> Description If non-zero, the stylesheet will issue a warning for any element (other than the root element) which has a title but does not have an ID. Meta/*Info and Titlepages inherit.keywords boolean inherit.keywords Inherit keywords from ancestor elements? <xsl:param name="inherit.keywords" select="1"></xsl:param> Description If inherit.keywords is non-zero, the keyword meta for each HTML head element will include all of the keywords from ancestor elements. Otherwise, only the keywords from the current section will be used. make.single.year.ranges boolean make.single.year.ranges Print single-year ranges (e.g., 1998-1999) <xsl:param name="make.single.year.ranges" select="0"></xsl:param> Description If non-zero, year ranges that span a single year will be printed in range notation (1998-1999) instead of discrete notation (1998, 1999). make.year.ranges boolean make.year.ranges Collate copyright years into ranges? <xsl:param name="make.year.ranges" select="0"></xsl:param> Description If non-zero, multiple copyright year elements will be collated into ranges. This works only if each year number is put into a separate year element. The copyright element permits multiple year elements. If a year element contains a dash or a comma, then that year element will not be merged into any range. author.othername.in.middle boolean author.othername.in.middle Is othername in author a middle name? <xsl:param name="author.othername.in.middle" select="1"></xsl:param> Description If non-zero, the othername of an author appears between the firstname and surname. Otherwise, othername is suppressed. blurb.on.titlepage.enabled boolean blurb.on.titlepage.enabled Display personblurb and authorblurb on title pages? <xsl:param name="blurb.on.titlepage.enabled" select="0"></xsl:param> Description If non-zero, output from authorblurb and personblurb elements is displayed on title pages. If zero (the default), output from those elements is suppressed on title pages (unless you are using a titlepage customization that causes them to be included). contrib.inline.enabled boolean contrib.inline.enabled Display contrib output inline? <xsl:param name="contrib.inline.enabled">1</xsl:param> Description If non-zero (the default), output of the contrib element is displayed as inline content rather than as block content. editedby.enabled boolean editedby.enabled Display “Edited by” heading above editor name? <xsl:param name="editedby.enabled">1</xsl:param> Description If non-zero, a localized Edited by heading is displayed above editor names in output of the editor element. abstract.notitle.enabled boolean abstract.notitle.enabled Suppress display of abstract titles? <xsl:param name="abstract.notitle.enabled" select="0"></xsl:param> Description If non-zero, in output of the abstract element on titlepages, display of the abstract title is suppressed. othercredit.like.author.enabled boolean othercredit.like.author.enabled Display othercredit in same style as author? <xsl:param name="othercredit.like.author.enabled">0</xsl:param> Description If non-zero, output of the othercredit element on titlepages is displayed in the same style as author and editor output. If zero then othercredit output is displayed using a style different than that of author and editor. generate.legalnotice.link boolean generate.legalnotice.link Write legalnotice to separate chunk and generate link? <xsl:param name="generate.legalnotice.link" select="0"></xsl:param> Description If the value of generate.legalnotice.link is non-zero, the stylesheet: writes the contents of legalnotice to a separate HTML file inserts a hyperlink to the legalnotice file adds (in the HTML head) either a single link or element or multiple link elements (depending on the value of the html.head.legalnotice.link.multiple parameter), with the value or values derived from the html.head.legalnotice.link.types parameter Otherwise, if generate.legalnotice.link is zero, legalnotice contents are rendered on the title page. The name of the separate HTML file is computed as follows: If a filename is given by the dbhtml filename processing instruction, that filename is used. If the legalnotice has an id/xml:id attribute, and if use.id.as.filename != 0, the filename is the concatenation of the id value and the value of the html.ext parameter. If the legalnotice does not have an id/xml:id attribute, or if use.id.as.filename = 0, the filename is the concatenation of "ln-", auto-generated id value, and html.ext value. generate.revhistory.link boolean generate.revhistory.link Write revhistory to separate chunk and generate link? <xsl:param name="generate.revhistory.link" select="0"></xsl:param> Description If non-zero, the contents of revhistory are written to a separate HTML file and a link to the file is generated. Otherwise, revhistory contents are rendered on the title page. The name of the separate HTML file is computed as follows: If a filename is given by the dbhtml filename processing instruction, that filename is used. If the revhistory has an id/xml:id attribute, and if use.id.as.filename != 0, the filename is the concatenation of the id value and the value of the html.ext parameter. If the revhistory does not have an id/xml:id attribute, or if use.id.as.filename = 0, the filename is the concatenation of "rh-", auto-generated id value, and html.ext value. html.head.legalnotice.link.types string html.head.legalnotice.link.types Specifies link types for legalnotice link in html head <xsl:param name="html.head.legalnotice.link.types">copyright</xsl:param> Description The value of html.head.legalnotice.link.types is a space-separated list of link types, as described in Section 6.12 of the HTML 4.01 specification. If the value of the generate.legalnotice.link parameter is non-zero, then the stylesheet generates (in the head section of the HTML source) either a single HTML link element or, if the value of the html.head.legalnotice.link.multiple is non-zero, one link element for each link type specified. Each link has the following attributes: a rel attribute whose value is derived from the value of html.head.legalnotice.link.types an href attribute whose value is set to the URL of the file containing the legalnotice a title attribute whose value is set to the title of the corresponding legalnotice (or a title programatically determined by the stylesheet) For example: <link rel="license" href="ln-id2524073.html" title="Legal Notice"> About the default value In an ideal world, the default value of html.head.legalnotice.link.types would probably be “license”, since the content of the DocBook legalnotice is typically license information, not copyright information. However, the default value is “copyright” for pragmatic reasons: because that’s among the set of “recognized link types” listed in Section 6.12 of the HTML 4.01 specification, and because certain browsers and browser extensions are preconfigured to recognize that value. html.head.legalnotice.link.multiple boolean html.head.legalnotice.link.multiple Generate multiple link instances in html head for legalnotice? <xsl:param name="html.head.legalnotice.link.multiple" select="1"></xsl:param> Description If html.head.legalnotice.link.multiple is non-zero and the value of html.head.legalnotice.link.types contains multiple link types, then the stylesheet generates (in the head section of the HTML source) one link element for each link type specified. For example, if the value of html.head.legalnotice.link.types is “copyright license”: <link rel="copyright" href="ln-id2524073.html" title="Legal Notice"> <link rel="license" href="ln-id2524073.html" title="Legal Notice"> Otherwise, the stylesheet generates generates a single link instance; for example: <link rel="copyright license" href="ln-id2524073.html" title="Legal Notice"> Reference Pages funcsynopsis.decoration boolean funcsynopsis.decoration Decorate elements of a funcsynopsis? <xsl:param name="funcsynopsis.decoration" select="1"></xsl:param> Description If non-zero, elements of the funcsynopsis will be decorated (e.g. rendered as bold or italic text). The decoration is controlled by templates that can be redefined in a customization layer. funcsynopsis.style list ansi kr funcsynopsis.style What style of funcsynopsis should be generated? <xsl:param name="funcsynopsis.style">kr</xsl:param> Description If funcsynopsis.style is ansi, ANSI-style function synopses are generated for a funcsynopsis, otherwise K&R-style function synopses are generated. function.parens boolean function.parens Generate parens after a function? <xsl:param name="function.parens" select="0"></xsl:param> Description If non-zero, the formatting of a function element will include generated parentheses. refentry.generate.name boolean refentry.generate.name Output NAME header before refnames? <xsl:param name="refentry.generate.name" select="1"></xsl:param> Description If non-zero, a "NAME" section title is output before the list of refnames. This parameter and refentry.generate.title are mutually exclusive. This means that if you change this parameter to zero, you should set refentry.generate.title to non-zero unless you want get quite strange output. refentry.generate.title boolean refentry.generate.title Output title before refnames? <xsl:param name="refentry.generate.title" select="0"></xsl:param> Description If non-zero, the reference page title or first name is output before the list of refnames. This parameter and refentry.generate.name are mutually exclusive. This means that if you change this parameter to non-zero, you should set refentry.generate.name to zero unless you want get quite strange output. refentry.xref.manvolnum boolean refentry.xref.manvolnum Output manvolnum as part of refentry cross-reference? <xsl:param name="refentry.xref.manvolnum" select="1"></xsl:param> Description if non-zero, the manvolnum is used when cross-referencing refentrys, either with xref or citerefentry. citerefentry.link boolean citerefentry.link Generate URL links when cross-referencing RefEntrys? <xsl:param name="citerefentry.link" select="0"></xsl:param> Description If non-zero, a web link will be generated, presumably to an online man->HTML gateway. The text of the link is generated by the generate.citerefentry.link template. refentry.separator boolean refentry.separator Generate a separator between consecutive RefEntry elements? <xsl:param name="refentry.separator" select="1"></xsl:param> Description If true, a separator will be generated between consecutive reference pages. refclass.suppress boolean refclass.suppress Suppress display of refclass contents? <xsl:param name="refclass.suppress" select="0"></xsl:param> Description If the value of refclass.suppress is non-zero, then display of refclass contents is suppressed in output. Tables default.table.width length default.table.width The default width of tables <xsl:param name="default.table.width"></xsl:param> Description If non-zero, this value will be used for the width attribute on tables that do not specify an alternate width (with the dbhtml table-width or dbfo table-width processing instruction). nominal.table.width length nominal.table.width The (absolute) nominal width of tables <xsl:param name="nominal.table.width">6in</xsl:param> Description In order to convert CALS column widths into HTML column widths, it is sometimes necessary to have an absolute table width to use for conversion of mixed absolute and relative widths. This value must be an absolute length (not a percentage). table.borders.with.css boolean table.borders.with.css Use CSS to specify table, row, and cell borders? <xsl:param name="table.borders.with.css" select="0"></xsl:param> Description If non-zero, CSS will be used to draw table borders. table.cell.border.style list none solid dotted dashed double groove ridge inset outset solid table.cell.border.style Specifies the border style of table cells <xsl:param name="table.cell.border.style">solid</xsl:param> Description Specifies the border style of table cells. To control properties of cell borders in HTML output, you must also turn on the table.borders.with.css parameter. table.cell.border.thickness length table.cell.border.thickness Specifies the thickness of table cell borders <xsl:param name="table.cell.border.thickness"> <xsl:choose> <xsl:when test="contains($stylesheet.result.type,'html')">1px</xsl:when> <xsl:otherwise>0.5pt</xsl:otherwise> </xsl:choose> </xsl:param> Description If non-zero, specifies the thickness of borders on table cells. See CSS To control properties of cell borders in HTML output, you must also turn on the table.borders.with.css parameter. table.cell.border.color color table.cell.border.color Specifies the border color of table cells <xsl:param name="table.cell.border.color"></xsl:param> Description Set the color of table cell borders. If non-zero, the value is used for the border coloration. See CSS. A color is either a keyword or a numerical RGB specification. Keywords are aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, orange, purple, red, silver, teal, white, and yellow. To control properties of cell borders in HTML output, you must also turn on the table.borders.with.css parameter. table.frame.border.style list none solid dotted dashed double groove ridge inset outset solid table.frame.border.style Specifies the border style of table frames <xsl:param name="table.frame.border.style">solid</xsl:param> Description Specifies the border style of table frames. table.frame.border.thickness length table.frame.border.thickness Specifies the thickness of the frame border <xsl:param name="table.frame.border.thickness"> <xsl:choose> <xsl:when test="contains($stylesheet.result.type,'html')">1px</xsl:when> <xsl:otherwise>0.5pt</xsl:otherwise> </xsl:choose> </xsl:param> Description Specifies the thickness of the border on the table's frame. table.frame.border.color color table.frame.border.color Specifies the border color of table frames <xsl:param name="table.frame.border.color"></xsl:param> Description Specifies the border color of table frames. default.table.frame string default.table.frame The default framing of tables <xsl:param name="default.table.frame">all</xsl:param> Description This value will be used when there is no frame attribute on the table. html.cellspacing integer html.cellspacing Default value for cellspacing in HTML tables <xsl:param name="html.cellspacing"></xsl:param> Description If non-zero, this value will be used as the default cellspacing value in HTML tables. nn for pixels or nn% for percentage length. E.g. 5 or 5% html.cellpadding integer html.cellpadding Default value for cellpadding in HTML tables <xsl:param name="html.cellpadding"></xsl:param> Description If non-zero, this value will be used as the default cellpadding value in HTML tables. nn for pixels or nn% for percentage length. E.g. 5 or 5% QAndASet qanda.defaultlabel list number qanda none qanda.defaultlabel Sets the default for defaultlabel on QandASet. <xsl:param name="qanda.defaultlabel">number</xsl:param> Description If no defaultlabel attribute is specified on a qandaset, this value is used. It is generally one of the legal values for the defaultlabel attribute (none, number or qanda), or one of the additional stylesheet-specific values (qnumber or qnumberanda). The default value is 'number'. The values are rendered as follows: qanda questions are labeled "Q:" and answers are labeled "A:". number The questions are enumerated and the answers are not labeled. qnumber The questions are labeled "Q:" followed by a number, and answers are not labeled. When sections are numbered, adding a label to the number distinguishes the question numbers from the section numbers. This value is not allowed in the defaultlabel attribute of a qandaset element. qnumberanda The questions are labeled "Q:" followed by a number, and the answers are labeled "A:". When sections are numbered, adding a label to the number distinguishes the question numbers from the section numbers. This value is not allowed in the defaultlabel attribute of a qandaset element. none No distinguishing label precedes Questions or Answers. qanda.inherit.numeration boolean qanda.inherit.numeration Does enumeration of QandASet components inherit the numeration of parent elements? <xsl:param name="qanda.inherit.numeration" select="1"></xsl:param> Description If non-zero, numbered qandadiv elements and question and answer inherit the enumeration of the ancestors of the qandaset. qanda.in.toc boolean qanda.in.toc Should qandaentry questions appear in the document table of contents? <xsl:param name="qanda.in.toc" select="0"></xsl:param> Description If true (non-zero), then the generated table of contents for a document will include qandaset titles, qandadiv titles, and question elements. The default value (zero) excludes them from the TOC. This parameter does not affect any tables of contents that may be generated inside a qandaset or qandadiv. qanda.nested.in.toc boolean qanda.nested.in.toc Should nested answer/qandaentry instances appear in TOC? <xsl:param name="qanda.nested.in.toc" select="0"></xsl:param> Description If non-zero, instances of qandaentry that are children of answer elements are shown in the TOC. Linking target.database.document uri target.database.document Name of master database file for resolving olinks <xsl:param name="target.database.document">olinkdb.xml</xsl:param> Description To resolve olinks between documents, the stylesheets use a master database document that identifies the target datafiles for all the documents within the scope of the olinks. This parameter value is the URI of the master document to be read during processing to resolve olinks. The default value is olinkdb.xml. The data structure of the file is defined in the targetdatabase.dtd DTD. The database file provides the high level elements to record the identifiers, locations, and relationships of documents. The cross reference data for individual documents is generally pulled into the database using system entity references or XIncludes. See also targets.filename. targets.filename string targets.filename Name of cross reference targets data file <xsl:param name="targets.filename">target.db</xsl:param> Description In order to resolve olinks efficiently, the stylesheets can generate an external data file containing information about all potential cross reference endpoints in a document. This parameter lets you change the name of the generated file from the default name target.db. The name must agree with that used in the target database used to resolve olinks during processing. See also target.database.document. olink.base.uri uri olink.base.uri Base URI used in olink hrefs <xsl:param name="olink.base.uri"></xsl:param> Description When cross reference data is collected for resolving olinks, it may be necessary to prepend a base URI to each target's href. This parameter lets you set that base URI when cross reference data is collected. This feature is needed when you want to link to a document that is processed without chunking. The output filename for such a document is not known to the XSL stylesheet; the only target information consists of fragment identifiers such as #idref. To enable the resolution of olinks between documents, you should pass the name of the HTML output file as the value of this parameter. Then the hrefs recorded in the cross reference data collection look like outfile.html#idref, which can be reached as links from other documents. use.local.olink.style boolean use.local.olink.style Process olinks using xref style of current document <xsl:param name="use.local.olink.style" select="0"></xsl:param> Description When cross reference data is collected for use by olinks, the data for each potential target includes one field containing a completely assembled cross reference string, as if it were an xref generated in that document. Other fields record the separate title, number, and element name of each target. When an olink is formed to a target from another document, the olink resolves to that preassembled string by default. If the use.local.olink.style parameter is set to non-zero, then instead the cross reference string is formed again from the target title, number, and element name, using the stylesheet processing the targeting document. Then olinks will match the xref style in the targeting document rather than in the target document. If both documents are processed with the same stylesheet, then the results will be the same. current.docid string current.docid targetdoc identifier for the document being processed <xsl:param name="current.docid"></xsl:param> Description When olinks between documents are resolved for HTML output, the stylesheet can compute the relative path between the current document and the target document. The stylesheet needs to know the targetdoc identifiers for both documents, as they appear in the target.database.document database file. This parameter passes to the stylesheet the targetdoc identifier of the current document, since that identifier does not appear in the document itself. This parameter can also be used for print output. If an olink's targetdoc id differs from the current.docid, then the stylesheet can append the target document's title to the generated olink text. That identifies to the reader that the link is to a different document, not the current document. See also olink.doctitle to enable that feature. olink.doctitle list no yes maybe olink.doctitle show the document title for external olinks? <xsl:param name="olink.doctitle">no</xsl:param> Description When olinks between documents are resolved, the generated text may not make it clear that the reference is to another document. It is possible for the stylesheets to append the other document's title to external olinks. For this to happen, two parameters must be set. This olink.doctitle parameter should be set to either yes or maybe to enable this feature. And you should also set the current.docid parameter to the document id for the document currently being processed for output. Then if an olink's targetdoc id differs from the current.docid value, the stylesheet knows that it is a reference to another document and can append the target document's title to the generated olink text. The text for the target document's title is copied from the olink database from the ttl element of the top-level div for that document. If that ttl element is missing or empty, no title is output. The supported values for olink.doctitle are: yes Always insert the title to the target document if it is not the current document. no Never insert the title to the target document, even if requested in an xrefstyle attribute. maybe Only insert the title to the target document, if requested in an xrefstyle attribute. An xrefstyle attribute may override the global setting for individual olinks. The following values are supported in an xrefstyle attribute using the select: syntax: docname Insert the target document name for this olink using the docname gentext template, but only if the value of olink.doctitle is not no. docnamelong Insert the target document name for this olink using the docnamelong gentext template, but only if the value of olink.doctitle is not no. nodocname Omit the target document name even if the value of olink.doctitle is yes. Another way of inserting the target document name for a single olink is to employ an xrefstyle attribute using the template: syntax. The %o placeholder (the letter o, not zero) in such a template will be filled in with the target document's title when it is processed. This will occur regardless of the value of olink.doctitle. Note that prior to version 1.66 of the XSL stylesheets, the allowed values for this parameter were 0 and 1. Those values are still supported and mapped to 'no' and 'yes', respectively. activate.external.olinks boolean activate.external.olinks Make external olinks into active links <xsl:param name="activate.external.olinks" select="1"></xsl:param> Description If activate.external.olinks is nonzero (the default), then any olinks that reference another document become active links that can be clicked on to follow the link. If the parameter is set to zero, then external olinks will have the appropriate link text generated, but the link is not made active. Olinks to destinations in the current document remain active. To make an external olink active for HTML outputs, the link text is wrapped in an a element with an href attribute. To make an external olink active for FO outputs, the link text is wrapped in an fo:basic-link element with an external-destination attribute. This parameter is useful when you need external olinks to resolve but not be clickable. For example, if documents in a collection are available independently of each other, then having active links between them could lead to unresolved links when a given target document is missing. The epub stylesheets set this parameter to zero by default because there is no standard linking mechanism between Epub documents. If external links are made inactive, you should consider setting the stylesheet parameter olink.doctitle to yes. That will append the external document's title to the link text, making it easier for the user to locate the other document. An olink is considered external when the current.docid stylesheet parameter is set to some value, and the olink's targetdoc attribute has a different value. If the two values match, then the link is considered internal. If the current.docid parameter is blank, or the olink element does not have a targetdoc attribute, then the link is considered to be internal and will become an active link. See also olink.doctitle, prefer.internal.olink. olink.debug boolean olink.debug Turn on debugging messages for olinks <xsl:param name="olink.debug" select="0"></xsl:param> Description If non-zero, then each olink will generate several messages about how it is being resolved during processing. This is useful when an olink does not resolve properly and the standard error messages are not sufficient to find the problem. You may need to read through the olink XSL templates to understand the context for some of the debug messages. olink.properties attribute set olink.properties Properties associated with the cross-reference text of an olink. <xsl:attribute-set name="olink.properties"> <xsl:attribute name="show-destination">replace</xsl:attribute> </xsl:attribute-set> Description This attribute set is applied to the fo:basic-link element of an olink. It is not applied to the optional page number or optional title of the external document. olink.lang.fallback.sequence string olink.lang.fallback.sequence look up translated documents if olink not found? <xsl:param name="olink.lang.fallback.sequence"></xsl:param> Description This parameter defines a list of lang values to search among to resolve olinks. Normally an olink tries to resolve to a document in the same language as the olink itself. The language of an olink is determined by its nearest ancestor element with a lang attribute, otherwise the value of the l10n.gentext.default.lang parameter. An olink database can contain target data for the same document in multiple languages. Each set of data has the same value for the targetdoc attribute in the document element in the database, but with a different lang attribute value. When an olink is being resolved, the target is first sought in the document with the same language as the olink. If no match is found there, then this parameter is consulted for additional languages to try. The olink.lang.fallback.sequence must be a whitespace separated list of lang values to try. The first one with a match in the olink database is used. The default value is empty. For example, a document might be written in German and contain an olink with targetdoc="adminguide". When the document is processed, the processor first looks for a target dataset in the olink database starting with: <document targetdoc="adminguide" lang="de">. If there is no such element, then the olink.lang.fallback.sequence parameter is consulted. If its value is, for example, fr en, then the processor next looks for targetdoc="adminguide" lang="fr", and then for targetdoc="adminguide" lang="en". If there is still no match, it looks for targetdoc="adminguide" with no lang attribute. This parameter is useful when a set of documents is only partially translated, or is in the process of being translated. If a target of an olink has not yet been translated, then this parameter permits the processor to look for the document in other languages. This assumes the reader would rather have a link to a document in a different language than to have a broken link. insert.olink.page.number list no yes maybe insert.olink.page.number Turns page numbers in olinks on and off <xsl:param name="insert.olink.page.number">no</xsl:param> Description The value of this parameter determines if cross references made between documents with olink will include page number citations. In most cases this is only applicable to references in printed output. The parameter has three possible values. no No page number references will be generated for olinks. yes Page number references will be generated for all olink references. The style of page reference may be changed if an xrefstyle attribute is used. maybe Page number references will not be generated for an olink element unless it has an xrefstyle attribute whose value specifies a page reference. Olinks that point to targets within the same document are treated as xrefs, and controlled by the insert.xref.page.number parameter. Page number references for olinks to external documents can only be inserted if the information exists in the olink database. This means each olink target element (div or obj) must have a page attribute whose value is its page number in the target document. The XSL stylesheets are not able to extract that information during processing because pages have not yet been created in XSLT transformation. Only the XSL-FO processor knows what page each element is placed on. Therefore some postprocessing must take place to populate page numbers in the olink database. insert.olink.pdf.frag boolean insert.olink.pdf.frag Add fragment identifiers for links into PDF files <xsl:param name="insert.olink.pdf.frag" select="0"></xsl:param> Description The value of this parameter determines whether the cross reference URIs to PDF documents made with olink will include fragment identifiers. When forming a URI to link to a PDF document, a fragment identifier (typically a '#' followed by an id value) appended to the PDF filename can be used by the PDF viewer to open the PDF file to a location within the document instead of the first page. However, not all PDF files have id values embedded in them, and not all PDF viewers can handle fragment identifiers. If insert.olink.pdf.frag is set to a non-zero value, then any olink targeting a PDF file will have the fragment identifier appended to the URI. The URI is formed by concatenating the value of the olink.base.uri parameter, the value of the baseuri attribute from the document element in the olink database with the matching targetdoc value, and the value of the href attribute for the targeted element in the olink database. The href attribute contains the fragment identifier. If insert.olink.pdf.frag is set to zero (the default value), then the href attribute from the olink database is not appended to PDF olinks, so the fragment identifier is left off. A PDF olink is any olink for which the baseuri attribute from the matching document element in the olink database ends with '.pdf'. Any other olinks will still have the fragment identifier added. prefer.internal.olink boolean prefer.internal.olink Prefer a local olink reference to an external reference <xsl:param name="prefer.internal.olink" select="0"></xsl:param> Description If you are re-using XML content modules in multiple documents, you may want to redirect some of your olinks. This parameter permits you to redirect an olink to the current document. For example: you are writing documentation for a product, which includes 3 manuals: a little installation booklet (booklet.xml), a user guide (user.xml), and a reference manual (reference.xml). All 3 documents begin with the same introduction section (intro.xml) that contains a reference to the customization section (custom.xml) which is included in both user.xml and reference.xml documents. How do you write the link to custom.xml in intro.xml so that it is interpreted correctly in all 3 documents? If you use xref, it will fail in booklet.xml. If you use olink (pointing to reference.xml), the reference in user.xml will point to the customization section of the reference manual, while it is actually available in user.xml. If you set the prefer.internal.olink parameter to a non-zero value, then the processor will first look in the olink database for the olink's targetptr attribute value in document matching the current.docid parameter value. If it isn't found there, then it tries the document in the database with the targetdoc value that matches the olink's targetdoc attribute. This feature permits an olink reference to resolve to the current document if there is an element with an id matching the olink's targetptr value. The current document's olink data must be included in the target database for this to work. There is a potential for incorrect links if the same id attribute value is used for different content in different documents. Some of your olinks may be redirected to the current document when they shouldn't be. It is not possible to control individual olink instances. link.mailto.url string link.mailto.url Mailto URL for the LINK REL=made HTML HEAD element <xsl:param name="link.mailto.url"></xsl:param> Description If not the empty string, this address will be used for the rel=made link element in the html head ulink.target string ulink.target The HTML anchor target for ULinks <xsl:param name="ulink.target">_top</xsl:param> Description If ulink.target is non-zero, its value will be used for the target attribute on anchors generated for ulinks. Cross References collect.xref.targets list no yes only collect.xref.targets Controls whether cross reference data is collected <xsl:param name="collect.xref.targets">no</xsl:param> Description In order to resolve olinks efficiently, the stylesheets can generate an external data file containing information about all potential cross reference endpoints in a document. This parameter determines whether the collection process is run when the document is processed by the stylesheet. The default value is no, which means the data file is not generated during processing. The other choices are yes, which means the data file is created and the document is processed for output, and only, which means the data file is created but the document is not processed for output. See also targets.filename. insert.xref.page.number list no yes maybe insert.xref.page.number Turns page numbers in xrefs on and off <xsl:param name="insert.xref.page.number">no</xsl:param> Description The value of this parameter determines if cross references (xrefs) in printed output will include page number citations. It has three possible values. no No page number references will be generated. yes Page number references will be generated for all xref elements. The style of page reference may be changed if an xrefstyle attribute is used. maybe Page number references will not be generated for an xref element unless it has an xrefstyle attribute whose value specifies a page reference. insert.xref.page.number.para list yes maybe insert.xref.page.number.para Turns page numbers in xrefs to paragraphs on and off <xsl:param name="insert.xref.page.number.para">yes</xsl:param> Description The value of this parameter determines if cross references (xrefs) to paragraphs in printed output will include page number citations. Historically, cross references to paragraphs included page number citations unconditionally, regardless of the insert.xref.page.number value. yes Page number references will be generated for paragraphs. maybe Whether page number references are generated for an xref element referring to a paragraph will be controlled by the insert.xref.page.number rules. use.role.as.xrefstyle boolean use.role.as.xrefstyle Use role attribute for xrefstyle on xref? <xsl:param name="use.role.as.xrefstyle" select="1"></xsl:param> Description In DocBook documents that conform to a schema older than V4.3, this parameter allows role to serve the purpose of specifying the cross reference style. If non-zero, the role attribute on xref will be used to select the cross reference style. In DocBook V4.3, the xrefstyle attribute was added for this purpose. If the xrefstyle attribute is present, role will be ignored, regardless of the setting of this parameter. Example The following small stylesheet shows how to configure the stylesheets to make use of the cross reference style: <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:import href="../xsl/html/docbook.xsl"/> <xsl:output method="html"/> <xsl:param name="local.l10n.xml" select="document('')"/> <l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"> <l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="en"> <l:context name="xref"> <l:template name="chapter" style="title" text="Chapter %n, %t"/> <l:template name="chapter" text="Chapter %n"/> </l:context> </l:l10n> </l:i18n> </xsl:stylesheet> With this stylesheet, the cross references in the following document: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> <book id="book"><title>Book</title> <preface> <title>Preface</title> <para>Normal: <xref linkend="ch1"/>.</para> <para>Title: <xref xrefstyle="title" linkend="ch1"/>.</para> </preface> <chapter id="ch1"> <title>First Chapter</title> <para>Irrelevant.</para> </chapter> </book> will appear as: Normal: Chapter 1. Title: Chapter 1, First Chapter. xref.with.number.and.title boolean xref.with.number.and.title Use number and title in cross references <xsl:param name="xref.with.number.and.title" select="1"></xsl:param> Description A cross reference may include the number (for example, the number of an example or figure) and the title which is a required child of some targets. This parameter inserts both the relevant number as well as the title into the link. xref.label-page.separator string xref.label-page.separator Punctuation or space separating label from page number in xref <xsl:param name="xref.label-page.separator"><xsl:text> </xsl:text></xsl:param> Description This parameter allows you to control the punctuation of certain types of generated cross reference text. When cross reference text is generated for an xref or olink element using an xrefstyle attribute that makes use of the select: feature, and the selected components include both label and page but no title, then the value of this parameter is inserted between label and page number in the output. If a title is included, then other separators are used. xref.label-title.separator string xref.label-title.separator Punctuation or space separating label from title in xref <xsl:param name="xref.label-title.separator">: </xsl:param> Description This parameter allows you to control the punctuation of certain types of generated cross reference text. When cross reference text is generated for an xref or olink element using an xrefstyle attribute that makes use of the select: feature, and the selected components include both label and title, then the value of this parameter is inserted between label and title in the output. xref.title-page.separator string xref.title-page.separator Punctuation or space separating title from page number in xref <xsl:param name="xref.title-page.separator"><xsl:text> </xsl:text></xsl:param> Description This parameter allows you to control the punctuation of certain types of generated cross reference text. When cross reference text is generated for an xref or olink element using an xrefstyle attribute that makes use of the select: feature, and the selected components include both title and page number, then the value of this parameter is inserted between title and page number in the output. Lists segmentedlist.as.table boolean segmentedlist.as.table Format segmented lists as tables? <xsl:param name="segmentedlist.as.table" select="0"></xsl:param> Description If non-zero, segmentedlists will be formatted as tables. variablelist.as.table boolean variablelist.as.table Format variablelists as tables? <xsl:param name="variablelist.as.table" select="0"></xsl:param> Description If non-zero, variablelists will be formatted as tables. A processing instruction exists to specify a particular width for the column containing the terms: dbhtml term-width=".25in" You can override this setting with a processing instruction as the child of variablelist: dbhtml list-presentation="table" or dbhtml list-presentation="list". This parameter only applies to the HTML transformations. In the FO case, proper list markup is robust enough to handle the formatting. But see also variablelist.as.blocks. <variablelist> <?dbhtml list-presentation="table"?> <?dbhtml term-width="1.5in"?> <?dbfo list-presentation="list"?> <?dbfo term-width="1in"?> <varlistentry> <term>list</term> <listitem> <para> Formatted as a table even if variablelist.as.table is set to 0. </para> </listitem> </varlistentry> </variablelist> variablelist.term.separator string variablelist.term.separator Text to separate terms within a multi-term varlistentry <xsl:param name="variablelist.term.separator">, </xsl:param> Description When a varlistentry contains multiple term elements, the string specified in the value of the variablelist.term.separator parameter is placed after each term except the last. To generate a line break between multiple terms in a varlistentry, set a non-zero value for the variablelist.term.break.after parameter. If you do so, you may also want to set the value of the variablelist.term.separator parameter to an empty string (to suppress rendering of the default comma and space after each term). variablelist.term.break.after boolean variablelist.term.break.after Generate line break after each term within a multi-term varlistentry? <xsl:param name="variablelist.term.break.after">0</xsl:param> Description Set a non-zero value for the variablelist.term.break.after parameter to generate a line break between terms in a multi-term varlistentry. If you set a non-zero value for variablelist.term.break.after, you may also want to set the value of the variablelist.term.separator parameter to an empty string (to suppress rendering of the default comma and space after each term). Bibliography bibliography.style list normal iso690 bibliography.style Style used for formatting of biblioentries. <xsl:param name="bibliography.style">normal</xsl:param> Description Currently only normal and iso690 styles are supported. In order to use ISO690 style to the full extent you might need to use additional markup described on the following WiKi page. biblioentry.item.separator string biblioentry.item.separator Text to separate bibliography entries <xsl:param name="biblioentry.item.separator">. </xsl:param> Description Text to separate bibliography entries bibliography.collection string bibliography.collection Name of the bibliography collection file <xsl:param name="bibliography.collection">http://docbook.sourceforge.net/release/bibliography/bibliography.xml</xsl:param> Description Maintaining bibliography entries across a set of documents is tedious, time consuming, and error prone. It makes much more sense, usually, to store all of the bibliography entries in a single place and simply extract the ones you need in each document. That's the purpose of the bibliography.collection parameter. To setup a global bibliography database, follow these steps: First, create a stand-alone bibliography document that contains all of the documents that you wish to reference. Make sure that each bibliography entry (whether you use biblioentry or bibliomixed) has an ID. My global bibliography, ~/bibliography.xml begins like this: <!DOCTYPE bibliography PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> <bibliography><title>References</title> <bibliomixed id="xml-rec"><abbrev>XML 1.0</abbrev>Tim Bray, Jean Paoli, C. M. Sperberg-McQueen, and Eve Maler, editors. <citetitle><ulink url="http://www.w3.org/TR/REC-xml">Extensible Markup Language (XML) 1.0 Second Edition</ulink></citetitle>. World Wide Web Consortium, 2000. </bibliomixed> <bibliomixed id="xml-names"><abbrev>Namespaces</abbrev>Tim Bray, Dave Hollander, and Andrew Layman, editors. <citetitle><ulink url="http://www.w3.org/TR/REC-xml-names/">Namespaces in XML</ulink></citetitle>. World Wide Web Consortium, 1999. </bibliomixed> <!-- ... --> </bibliography> When you create a bibliography in your document, simply provide empty bibliomixed entries for each document that you wish to cite. Make sure that these elements have the same ID as the corresponding real entry in your global bibliography. For example: <bibliography><title>Bibliography</title> <bibliomixed id="xml-rec"/> <bibliomixed id="xml-names"/> <bibliomixed id="DKnuth86">Donald E. Knuth. <citetitle>Computers and Typesetting: Volume B, TeX: The Program</citetitle>. Addison-Wesley, 1986. ISBN 0-201-13437-3. </bibliomixed> <bibliomixed id="relaxng"/> </bibliography> Note that it's perfectly acceptable to mix entries from your global bibliography with normal entries. You can use xref or other elements to cross-reference your bibliography entries in exactly the same way you do now. Finally, when you are ready to format your document, simply set the bibliography.collection parameter (in either a customization layer or directly through your processor's interface) to point to your global bibliography. A relative path in the parameter is interpreted in one of two ways: If your document contains no links to empty bibliographic elements, then the path is relative to the file containing the first bibliomixed element in the document. If your document does contain links to empty bibliographic elements, then the path is relative to the file containing the first such link element in the document. Once the collection file is opened by the first instance described above, it stays open for the current document and the relative path is not reinterpreted again. The stylesheets will format the bibliography in your document as if all of the entries referenced appeared there literally. bibliography.numbered boolean bibliography.numbered Should bibliography entries be numbered? <xsl:param name="bibliography.numbered" select="0"></xsl:param> Description If non-zero bibliography entries will be numbered Glossary glossterm.auto.link boolean glossterm.auto.link Generate links from glossterm to glossentry automatically? <xsl:param name="glossterm.auto.link" select="0"></xsl:param> Description If non-zero, links from inline glossterms to the corresponding glossentry elements in a glossary or glosslist will be automatically generated. This is useful when your glossterms are consistent and you don't want to add links manually. The automatic link generation feature is not used on glossterm elements that have a linkend attribute. firstterm.only.link boolean firstterm.only.link Does automatic glossterm linking only apply to firstterms? <xsl:param name="firstterm.only.link" select="0"></xsl:param> Description If non-zero, only firstterms will be automatically linked to the glossary. If glossary linking is not enabled, this parameter has no effect. glossary.collection string glossary.collection Name of the glossary collection file <xsl:param name="glossary.collection"></xsl:param> Description Glossaries maintained independently across a set of documents are likely to become inconsistent unless considerable effort is expended to keep them in sync. It makes much more sense, usually, to store all of the glossary entries in a single place and simply extract the ones you need in each document. That's the purpose of the glossary.collection parameter. To setup a global glossary database, follow these steps: Setting Up the Glossary Database First, create a stand-alone glossary document that contains all of the entries that you wish to reference. Make sure that each glossary entry has an ID. Here's an example glossary: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE glossary PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> <glossary> <glossaryinfo> <editor><firstname>Eric</firstname><surname>Raymond</surname></editor> <title>Jargon File 4.2.3 (abridged)</title> <releaseinfo>Just some test data</releaseinfo> </glossaryinfo> <glossdiv><title>0</title> <glossentry> <glossterm>0</glossterm> <glossdef> <para>Numeric zero, as opposed to the letter `O' (the 15th letter of the English alphabet). In their unmodified forms they look a lot alike, and various kluges invented to make them visually distinct have compounded the confusion. If your zero is center-dotted and letter-O is not, or if letter-O looks almost rectangular but zero looks more like an American football stood on end (or the reverse), you're probably looking at a modern character display (though the dotted zero seems to have originated as an option on IBM 3270 controllers). If your zero is slashed but letter-O is not, you're probably looking at an old-style ASCII graphic set descended from the default typewheel on the venerable ASR-33 Teletype (Scandinavians, for whom /O is a letter, curse this arrangement). (Interestingly, the slashed zero long predates computers; Florian Cajori's monumental "A History of Mathematical Notations" notes that it was used in the twelfth and thirteenth centuries.) If letter-O has a slash across it and the zero does not, your display is tuned for a very old convention used at IBM and a few other early mainframe makers (Scandinavians curse <emphasis>this</emphasis> arrangement even more, because it means two of their letters collide). Some Burroughs/Unisys equipment displays a zero with a <emphasis>reversed</emphasis> slash. Old CDC computers rendered letter O as an unbroken oval and 0 as an oval broken at upper right and lower left. And yet another convention common on early line printers left zero unornamented but added a tail or hook to the letter-O so that it resembled an inverted Q or cursive capital letter-O (this was endorsed by a draft ANSI standard for how to draw ASCII characters, but the final standard changed the distinguisher to a tick-mark in the upper-left corner). Are we sufficiently confused yet?</para> </glossdef> </glossentry> <glossentry> <glossterm>1TBS</glossterm> <glossdef> <para role="accidence"> <phrase role="pronounce"></phrase> <phrase role="partsofspeach">n</phrase> </para> <para>The "One True Brace Style"</para> <glossseealso>indent style</glossseealso> </glossdef> </glossentry> <!-- ... --> </glossdiv> <!-- ... --> </glossary> Marking Up Glossary Terms That takes care of the glossary database, now you have to get the entries into your document. Unlike bibliography entries, which can be empty, creating placeholder glossary entries would be very tedious. So instead, support for glossary.collection relies on implicit linking. In your source document, simply use firstterm and glossterm to identify the terms you wish to have included in the glossary. The stylesheets assume that you will either set the baseform attribute correctly, or that the content of the element exactly matches a term in your glossary. If you're using a glossary.collection, don't make explicit links on the terms in your document. So, in your document, you might write things like this: <para>This is dummy text, without any real meaning. The point is simply to reference glossary terms like <glossterm>0</glossterm> and the <firstterm baseform="1TBS">One True Brace Style (1TBS)</firstterm>. The <glossterm>1TBS</glossterm>, as you can probably imagine, is a nearly religious issue.</para> If you set the firstterm.only.link parameter, only the terms marked with firstterm will be links. Otherwise, all the terms will be linked. Marking Up the Glossary The glossary itself has to be identified for the stylesheets. For lack of a better choice, the role is used. To identify the glossary as the target for automatic processing, set the role to auto. The title of this glossary (and any other information from the glossaryinfo that's rendered by your stylesheet) will be displayed, but the entries will come from the database. Unfortunately, the glossary can't be empty, so you must put in at least one glossentry. The content of this entry is irrelevant, it will not be rendered: <glossary role="auto"> <glossentry> <glossterm>Irrelevant</glossterm> <glossdef> <para>If you can see this, the document was processed incorrectly. Use the <parameter>glossary.collection</parameter> parameter.</para> </glossdef> </glossentry> </glossary> What about glossary divisions? If your glossary database has glossary divisions and your automatic glossary contains at least one glossdiv, the automic glossary will have divisions. If the glossdiv is missing from either location, no divisions will be rendered. Glossary entries (and divisions, if appropriate) in the glossary will occur in precisely the order they occur in your database. Formatting the Document Finally, when you are ready to format your document, simply set the glossary.collection parameter (in either a customization layer or directly through your processor's interface) to point to your global glossary. A relative path in the parameter is interpreted in one of two ways: If the parameter glossterm.auto.link is set to zero, then the path is relative to the file containing the empty glossary element in the document. If the parameter glossterm.auto.link is set to non-zero, then the path is relative to the file containing the first inline glossterm or firstterm in the document to be linked. Once the collection file is opened by the first instance described above, it stays open for the current document and the relative path is not reinterpreted again. The stylesheets will format the glossary in your document as if all of the entries implicilty referenced appeared there literally. Limitations Glossary cross-references within the glossary are not supported. For example, this will not work: <glossentry> <glossterm>gloss-1</glossterm> <glossdef><para>A description that references <glossterm>gloss-2</glossterm>.</para> <glossseealso>gloss-2</glossseealso> </glossdef> </glossentry> If you put glossary cross-references in your glossary that way, you'll get the cryptic error: Warning: glossary.collection specified, but there are 0 automatic glossaries. Instead, you must do two things: Markup your glossary using glossseealso: <glossentry> <glossterm>gloss-1</glossterm> <glossdef><para>A description that references <glossterm>gloss-2</glossterm>.</para> <glossseealso>gloss-2</glossseealso> </glossdef> </glossentry> Make sure there is at least one glossterm reference to gloss-2 in your document. The easiest way to do that is probably within a remark in your automatic glossary: <glossary role="auto"> <remark>Make sure there's a reference to <glossterm>gloss-2</glossterm>.</remark> <glossentry> <glossterm>Irrelevant</glossterm> <glossdef> <para>If you can see this, the document was processed incorrectly. Use the <parameter>glossary.collection</parameter> parameter.</para> </glossdef> </glossentry> </glossary> glossary.sort boolean glossary.sort Sort glossentry elements? <xsl:param name="glossary.sort" select="0"></xsl:param> Description If non-zero, then the glossentry elements within a glossary, glossdiv, or glosslist are sorted on the glossterm, using the current lang setting. If zero (the default), then glossentry elements are not sorted and are presented in document order. glossentry.show.acronym list no yes primary glossentry.show.acronym Display glossentry acronyms? <xsl:param name="glossentry.show.acronym">no</xsl:param> Description A setting of yes means they should be displayed; no means they shouldn't. If primary is used, then they are shown as the primary text for the entry. This setting controls both acronym and abbrev elements in the glossentry. Miscellaneous formal.procedures boolean formal.procedures Selects formal or informal procedures <xsl:param name="formal.procedures" select="1"></xsl:param> Description Formal procedures are numbered and always have a title. formal.title.placement table formal.title.placement Specifies where formal object titles should occur <xsl:param name="formal.title.placement"> figure before example before equation before table before procedure before task before </xsl:param> Description Specifies where formal object titles should occur. For each formal object type (figure, example, equation, table, and procedure) you can specify either the keyword before or after. runinhead.default.title.end.punct string runinhead.default.title.end.punct Default punctuation character on a run-in-head <xsl:param name="runinhead.default.title.end.punct">.</xsl:param> Description If non-zero, For a formalpara, use the specified string as the separator between the title and following text. The period is the default value. runinhead.title.end.punct string runinhead.title.end.punct Characters that count as punctuation on a run-in-head <xsl:param name="runinhead.title.end.punct">.!?:</xsl:param> Description Specify which characters are to be counted as punctuation. These characters are checked for a match with the last character of the title. If no match is found, the runinhead.default.title.end.punct contents are inserted. This is to avoid duplicated punctuation in the output. show.comments boolean show.comments Display remark elements? <xsl:param name="show.comments" select="1"></xsl:param> Description If non-zero, comments will be displayed, otherwise they are suppressed. Comments here refers to the remark element (which was called comment prior to DocBook 4.0), not XML comments (<-- like this -->) which are unavailable. show.revisionflag boolean show.revisionflag Enable decoration of elements that have a revisionflag <xsl:param name="show.revisionflag" select="0"></xsl:param> Description If show.revisionflag is turned on, then the stylesheets may produce additional markup designed to allow a CSS stylesheet to highlight elements that have specific revisionflag settings. The markup inserted will be usually be either a <span> or <div> with an appropriate class attribute. (The value of the class attribute will be the same as the value of the revisionflag attribute). In some contexts, for example tables, where extra markup would be structurally illegal, the class attribute will be added to the appropriate container element. In general, the stylesheets only test for revisionflag in contexts where an importing stylesheet would have to redefine whole templates. Most of the revisionflag processing is expected to be done by another stylesheet, for example changebars.xsl. shade.verbatim boolean shade.verbatim Should verbatim environments be shaded? <xsl:param name="shade.verbatim" select="0"></xsl:param> Description In the FO stylesheet, if this parameter is non-zero then the shade.verbatim.style properties will be applied to verbatim environments. In the HTML stylesheet, this parameter is now deprecated. Use CSS instead. shade.verbatim.style attribute set shade.verbatim.style Properties that specify the style of shaded verbatim listings <xsl:attribute-set name="shade.verbatim.style"> <xsl:attribute name="border">0</xsl:attribute> <xsl:attribute name="bgcolor">#E0E0E0</xsl:attribute> </xsl:attribute-set> Description Properties that specify the style of shaded verbatim listings. The parameters specified (the border and background color) are added to the styling of the xsl-fo output. A border might be specified as "thin black solid" for example. See xsl-fo punct.honorific string punct.honorific Punctuation after an honorific in a personal name. <xsl:param name="punct.honorific">.</xsl:param> Description This parameter specifies the punctuation that should be added after an honorific in a personal name. tex.math.in.alt list plain latex tex.math.in.alt TeX notation used for equations <xsl:param name="tex.math.in.alt"></xsl:param> Description If you want type math directly in TeX notation in equations, this parameter specifies notation used. Currently are supported two values -- plain and latex. Empty value means that you are not using TeX math at all. Preferred way for including TeX alternative of math is inside of textobject element. Eg.: <inlineequation> <inlinemediaobject> <imageobject> <imagedata fileref="eq1.gif"/> </imageobject> <textobject><phrase>E=mc squared</phrase></textobject> <textobject role="tex"><phrase>E=mc^2</phrase></textobject> </inlinemediaobject> </inlineequation> If you are using graphic element, you can store TeX inside alt element: <inlineequation> <alt role="tex">a^2+b^2=c^2</alt> <graphic fileref="a2b2c2.gif"/> </inlineequation> If you want use this feature, you should process your FO with PassiveTeX, which only supports TeX math notation. When calling stylsheet, don't forget to specify also passivetex.extensions=1. If you want equations in HTML, just process generated file tex-math-equations.tex by TeX or LaTeX. Then run dvi2bitmap program on result DVI file. You will get images for equations in your document. This feature is useful for print/PDF output only if you use the obsolete and now unsupported PassiveTeX XSL-FO engine. Related Parameters tex.math.delims, passivetex.extensions, tex.math.file tex.math.file string tex.math.file Name of temporary file for generating images from equations <xsl:param name="tex.math.file">tex-math-equations.tex</xsl:param> Description Name of auxiliary file for TeX equations. This file can be processed by dvi2bitmap to get bitmap versions of equations for HTML output. Related Parameters tex.math.in.alt, tex.math.delims, More information For how-to documentation on embedding TeX equations and generating output from them, see DBTeXMath. tex.math.delims boolean tex.math.delims Should equations output for processing by TeX be surrounded by math mode delimiters? <xsl:param name="tex.math.delims" select="1"></xsl:param> Description For compatibility with DSSSL based DBTeXMath from Allin Cottrell you should set this parameter to 0. This feature is useful for print/PDF output only if you use the obsolete and now unsupported PassiveTeX XSL-FO engine. Related Parameters tex.math.in.alt, passivetex.extensions See Also You can also use the dbtex delims processing instruction to control whether delimiters are output. pixels.per.inch integer pixels.per.inch How many pixels are there per inch? <xsl:param name="pixels.per.inch">90</xsl:param> Description When lengths are converted to pixels, this value is used to determine the size of a pixel. The default value is taken from the XSL Recommendation. points.per.em number points.per.em Specify the nominal size of an em-space in points <xsl:param name="points.per.em">10</xsl:param> Description The fixed value used for calculations based upon the size of a character. The assumption made is that ten point font is in use. This assumption may not be valid. use.svg boolean use.svg Allow SVG in the result tree? <xsl:param name="use.svg" select="1"></xsl:param> Description If non-zero, SVG will be considered an acceptable image format. SVG is passed through to the result tree, so correct rendering of the resulting diagram depends on the formatter (FO processor or web browser) that is used to process the output from the stylesheet. menuchoice.separator string menuchoice.separator Separator between items of a menuchoice other than guimenuitem and guisubmenu <xsl:param name="menuchoice.separator">+</xsl:param> Description Separator used to connect items of a menuchoice other than guimenuitem and guisubmenu. The latter elements are linked with menuchoice.menu.separator. menuchoice.menu.separator string menuchoice.menu.separator Separator between items of a menuchoice with guimenuitem or guisubmenu <xsl:param name="menuchoice.menu.separator"> → </xsl:param> Description Separator used to connect items of a menuchoice with guimenuitem or guisubmenu. Other elements are linked with menuchoice.separator. The default value is &#x2192;, which is the &rarr; (right arrow) character entity. The current FOP (0.20.5) requires setting the font-family explicitly. The default value also includes spaces around the arrow, which will allow a line to break. Replace the spaces with &#xA0; (nonbreaking space) if you don't want those spaces to break. default.float.class string default.float.class Specifies the default float class <xsl:param name="default.float.class"> <xsl:choose> <xsl:when test="contains($stylesheet.result.type,'html')">left</xsl:when> <xsl:otherwise>before</xsl:otherwise> </xsl:choose> </xsl:param> Description Selects the direction in which a float should be placed. for xsl-fo this is before, for html it is left. For Western texts, the before direction is the top of the page. footnote.number.format list 11,2,3... AA,B,C... aa,b,c... ii,ii,iii... II,II,III... footnote.number.format Identifies the format used for footnote numbers <xsl:param name="footnote.number.format">1</xsl:param> Description The footnote.number.format specifies the format to use for footnote numeration (1, i, I, a, or A). table.footnote.number.format list 11,2,3... AA,B,C... aa,b,c... ii,ii,iii... II,II,III... table.footnote.number.format Identifies the format used for footnote numbers in tables <xsl:param name="table.footnote.number.format">a</xsl:param> Description The table.footnote.number.format specifies the format to use for footnote numeration (1, i, I, a, or A) in tables. footnote.number.symbols footnote.number.symbols Special characters to use as footnote markers <xsl:param name="footnote.number.symbols"></xsl:param> Description If footnote.number.symbols is not the empty string, footnotes will use the characters it contains as footnote symbols. For example, *&#x2020;&#x2021;&#x25CA;&#x2720; will identify footnotes with *, , , , and . If there are more footnotes than symbols, the stylesheets will fall back to numbered footnotes using footnote.number.format. The use of symbols for footnotes depends on the ability of your processor (or browser) to render the symbols you select. Not all systems are capable of displaying the full range of Unicode characters. If the quoted characters in the preceding paragraph are not displayed properly, that's a good indicator that you may have trouble using those symbols for footnotes. table.footnote.number.symbols string table.footnote.number.symbols Special characters to use a footnote markers in tables <xsl:param name="table.footnote.number.symbols"></xsl:param> Description If table.footnote.number.symbols is not the empty string, table footnotes will use the characters it contains as footnote symbols. For example, *&#x2020;&#x2021;&#x25CA;&#x2720; will identify footnotes with *, , , , and . If there are more footnotes than symbols, the stylesheets will fall back to numbered footnotes using table.footnote.number.format. The use of symbols for footnotes depends on the ability of your processor (or browser) to render the symbols you select. Not all systems are capable of displaying the full range of Unicode characters. If the quoted characters in the preceding paragraph are not displayed properly, that's a good indicator that you may have trouble using those symbols for footnotes. highlight.source boolean highlight.source Should the content of programlisting be syntactically highlighted? <xsl:param name="highlight.source" select="0"></xsl:param> Description When this parameter is non-zero, the stylesheets will try to do syntax highlighting of the content of programlisting elements. You specify the language for each programlisting by using the language attribute. The highlight.default.language parameter can be used to specify the language for programlistings without a language attribute. Syntax highlighting also works for screen and synopsis elements. The actual highlighting work is done by the XSLTHL extension module. This is an external Java library that has to be downloaded separately (see below). In order to use this extension, you must add xslthl-2.x.x.jar to your Java classpath. The latest version is available from the XSLT syntax highlighting project at SourceForge. use a customization layer in which you import one of the following stylesheet modules: html/highlight.xsl xhtml/highlight.xsl xhtml-1_1/highlight.xsl fo/highlight.xsl let either the xslthl.config Java system property or the highlight.xslthl.config parameter point to the configuration file for syntax highlighting (using URL syntax). DocBook XSL comes with a ready-to-use configuration file, highlighting/xslthl-config.xml. The extension works with Saxon 6.5.x and Xalan-J. (Saxon 8.5 or later is also supported, but since it is an XSLT 2.0 processor it is not guaranteed to work with DocBook XSL in all circumstances.) The following is an example of a Saxon 6 command adapted for syntax highlighting, to be used on Windows: java -cp c:/Java/saxon.jar;c:/Java/xslthl-2.0.1.jar -Dxslthl.config=file:///c:/docbook-xsl/highlighting/xslthl-config.xml com.icl.saxon.StyleSheet -o test.html test.xml myhtml.xsl highlight.xslthl.config uri highlight.xslthl.config Location of XSLTHL configuration file <xsl:param name="highlight.xslthl.config"></xsl:param> Description This location has precedence over the corresponding Java property. Please note that usually you have to specify location as URL not just as a simple path on the local filesystem. E.g. file:///home/user/xslthl/my-xslthl-config.xml. highlight.default.language string highlight.default.language Default language of programlisting <xsl:param name="highlight.default.language"></xsl:param> Description This language is used when there is no language attribute on programlisting. email.delimiters.enabled boolean email.delimiters.enabled Generate delimiters around email addresses? <xsl:param name="email.delimiters.enabled" select="1"></xsl:param> Description If non-zero, delimiters For delimiters, the stylesheets are currently hard-coded to output angle brackets. are generated around e-mail addresses (the output of the email element). exsl.node.set.available boolean exsl.node.set.available Is the test function-available('exsl:node-set') true? <xsl:param name="exsl.node.set.available"> <xsl:choose> <xsl:when exsl:foo="" test="function-available('exsl:node-set') or contains(system-property('xsl:vendor'), 'Apache Software Foundation')">1</xsl:when> <xsl:otherwise>0</xsl:otherwise> </xsl:choose> </xsl:param> Description If non-zero, then the exsl:node-set() function is available to be used in the stylesheet. If zero, then the function is not available. This param automatically detects the presence of the function and does not normally need to be set manually. This param was created to handle a long-standing bug in the Xalan processor that fails to detect the function even though it is available. Annotations annotation.support boolean annotation.support Enable annotations? <xsl:param name="annotation.support" select="0"></xsl:param> Description If non-zero, the stylesheets will attempt to support annotation elements in HTML by including some JavaScript (see annotation.js). annotation.js string annotation.js URIs identifying JavaScript files with support for annotation popups <xsl:param name="annotation.js"> <xsl:text>http://docbook.sourceforge.net/release/script/AnchorPosition.js http://docbook.sourceforge.net/release/script/PopupWindow.js</xsl:text></xsl:param> Description If annotation.support is enabled and the document contains annotations, then the URIs listed in this parameter will be included. These JavaScript files are required for popup annotation support. annotation.css string annotation.css CSS rules for annotations <xsl:param name="annotation.css"> /* ====================================================================== Annotations */ div.annotation-list { visibility: hidden; } div.annotation-nocss { position: absolute; visibility: hidden; } div.annotation-popup { position: absolute; z-index: 4; visibility: hidden; padding: 0px; margin: 2px; border-style: solid; border-width: 1px; width: 200px; background-color: white; } div.annotation-title { padding: 1px; font-weight: bold; border-bottom-style: solid; border-bottom-width: 1px; color: white; background-color: black; } div.annotation-body { padding: 2px; } div.annotation-body p { margin-top: 0px; padding-top: 0px; } div.annotation-close { position: absolute; top: 2px; right: 2px; } </xsl:param> Description If annotation.support is enabled and the document contains annotations, then the CSS in this parameter will be included in the document. annotation.graphic.open uri annotation.graphic.open Image for identifying a link that opens an annotation popup <xsl:param name="annotation.graphic.open">http://docbook.sourceforge.net/release/images/annot-open.png</xsl:param> Description This image is used inline to identify the location of annotations. It may be replaced by a user provided graphic. The size should be approximately 10x10 pixels. annotation.graphic.close uri annotation.graphic.close Image for identifying a link that closes an annotation popup <xsl:param name="annotation.graphic.close"> http://docbook.sourceforge.net/release/images/annot-close.png</xsl:param> Description This image is used on popup annotations as the “x” that the user can click to dismiss the popup. This image is used on popup annotations as the “x” that the user can click to dismiss the popup. It may be replaced by a user provided graphic. The size should be approximately 10x10 pixels. Graphics img.src.path string img.src.path Path to HTML/FO image files <xsl:param name="img.src.path"></xsl:param> Description Add a path prefix to the value of the fileref attribute of graphic, inlinegraphic, and imagedata elements. The resulting compound path is used in the output as the value of the src attribute of img (HTML) or external-graphic (FO). The path given by img.src.path could be relative to the directory where the HTML/FO files are created, or it could be an absolute URI. The default value is empty. Be sure to include a trailing slash if needed. This prefix is not applied to any filerefs that start with "/" or contain "//:". keep.relative.image.uris boolean keep.relative.image.uris Should image URIs be resolved against xml:base? <xsl:param name="keep.relative.image.uris" select="1"></xsl:param> Description If non-zero, relative URIs (in, for example fileref attributes) will be used in the generated output. Otherwise, the URIs will be made absolute with respect to the base URI. Note that the stylesheets calculate (and use) the absolute form for some purposes, this only applies to the resulting output. graphic.default.extension string graphic.default.extension Default extension for graphic filenames <xsl:param name="graphic.default.extension"></xsl:param> Description If a graphic or mediaobject includes a reference to a filename that does not include an extension, and the format attribute is unspecified, the default extension will be used. default.image.width length default.image.width The default width of images <xsl:param name="default.image.width"></xsl:param> Description If specified, this value will be used for the width attribute on images that do not specify any viewport dimensions. nominal.image.width length nominal.image.width The nominal image width <xsl:param name="nominal.image.width" select="6 * $pixels.per.inch"></xsl:param> Description Graphic widths expressed as a percentage are problematic. In the following discussion, we speak of width and contentwidth, but the same issues apply to depth and contentdepth. A width of 50% means "half of the available space for the image." That's fine. But note that in HTML, this is a dynamic property and the image size will vary if the browser window is resized. A contentwidth of 50% means "half of the actual image width". But what does that mean if the stylesheets cannot assess the image's actual size? Treating this as a width of 50% is one possibility, but it produces behavior (dynamic scaling) that seems entirely out of character with the meaning. Instead, the stylesheets define a nominal.image.width and convert percentages to actual values based on that nominal size. nominal.image.depth length nominal.image.depth Nominal image depth <xsl:param name="nominal.image.depth" select="4 * $pixels.per.inch"></xsl:param> Description See nominal.image.width. use.embed.for.svg boolean use.embed.for.svg Use HTML embed for SVG? <xsl:param name="use.embed.for.svg" select="0"></xsl:param> Description If non-zero, an embed element will be created for SVG figures. An object is always created, this parameter merely controls whether or not an additional embed is generated inside the object. On the plus side, this may be more portable among browsers and plug-ins. On the minus side, it isn't valid HTML. make.graphic.viewport boolean make.graphic.viewport Use tables in HTML to make viewports for graphics <xsl:param name="make.graphic.viewport" select="1"></xsl:param> Description The HTML img element only supports the notion of content-area scaling; it doesn't support the distinction between a content-area and a viewport-area, so we have to make some compromises. If make.graphic.viewport is non-zero, a table will be used to frame the image. This creates an effective viewport-area. Tables and alignment don't work together, so this parameter is ignored if alignment is specified on an image. preferred.mediaobject.role string preferred.mediaobject.role Select which mediaobject to use based on this value of an object's role attribute. <xsl:param name="preferred.mediaobject.role"></xsl:param> Description A mediaobject may contain several objects such as imageobjects. If the parameter use.role.for.mediaobject is non-zero, then the role attribute on imageobjects and other objects within a mediaobject container will be used to select which object will be used. If one of the objects has a role value that matches the preferred.mediaobject.role parameter, then it has first priority for selection. If more than one has such a role value, the first one is used. See the use.role.for.mediaobject parameter for the sequence of selection. link.to.self.for.mediaobject boolean link.to.self.for.mediaobject Include a element to image objects itself to go to a full-size, freely-zoomable version <xsl:param name="link.to.self.for.mediaobject" select="0"></xsl:param> Description In some cases, it can be very helpful to be able to click on an embedded figure or informalfigure to get a full-size, freely-zoomable version of an image, for instance when targeting readers on smartphones. This is implemented for images only, but not for audio or video objects. If non-zero, the image will be wrapped in an a element, using the href attribute pointing to the image itself: <a href="source/image"> <!-- the image object --> </a> If the value of link.to.self.for.mediaobject.xml is zero (default), then no a container is added. use.role.for.mediaobject boolean use.role.for.mediaobject Use role attribute value for selecting which of several objects within a mediaobject to use. <xsl:param name="use.role.for.mediaobject" select="1"></xsl:param> Description If non-zero, the role attribute on imageobjects or other objects within a mediaobject container will be used to select which object will be used. The order of selection when then parameter is non-zero is: If the stylesheet parameter preferred.mediaobject.role has a value, then the object whose role equals that value is selected. Else if an object's role attribute has a value of html for HTML processing or fo for FO output, then the first of such objects is selected. Else the first suitable object is selected. If the value of use.role.for.mediaobject is zero, then role attributes are not considered and the first suitable object with or without a role value is used. ignore.image.scaling boolean ignore.image.scaling Tell the stylesheets to ignore the author's image scaling attributes <xsl:param name="ignore.image.scaling" select="0"></xsl:param> Description If non-zero, the scaling attributes on graphics and media objects are ignored. Chunking chunker.output.cdata-section-elements string chunker.output.cdata-section-elements List of elements to escape with CDATA sections <xsl:param name="chunker.output.cdata-section-elements"></xsl:param> Description This parameter specifies the list of elements that should be escaped as CDATA sections by the chunking stylesheet. Not all processors support specification of this parameter. This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. chunker.output.doctype-public string chunker.output.doctype-public Public identifer to use in the document type of generated pages <xsl:param name="chunker.output.doctype-public"></xsl:param> Description This parameter specifies the public identifier that should be used by the chunking stylesheet in the document type declaration of chunked pages. Not all processors support specification of this parameter. This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. chunker.output.doctype-system uri chunker.output.doctype-system System identifier to use for the document type in generated pages <xsl:param name="chunker.output.doctype-system"></xsl:param> Description This parameter specifies the system identifier that should be used by the chunking stylesheet in the document type declaration of chunked pages. Not all processors support specification of this parameter. This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. chunker.output.encoding string chunker.output.encoding Encoding used in generated pages <xsl:param name="chunker.output.encoding">ISO-8859-1</xsl:param> Description This parameter specifies the encoding to be used in files generated by the chunking stylesheet. Not all processors support specification of this parameter. This parameter used to be named default.encoding. This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. chunker.output.indent string chunker.output.indent Specification of indentation on generated pages <xsl:param name="chunker.output.indent">no</xsl:param> Description This parameter specifies the value of the indent specification for generated pages. Not all processors support specification of this parameter. This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. chunker.output.media-type string chunker.output.media-type Media type to use in generated pages <xsl:param name="chunker.output.media-type"></xsl:param> Description This parameter specifies the media type that should be used by the chunking stylesheet. Not all processors support specification of this parameter. This parameter specifies the media type that should be used by the chunking stylesheet. This should be one from those defined in [RFC2045] and [RFC2046] This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. It must be one from html, xml or text chunker.output.method list html xml chunker.output.method Method used in generated pages <xsl:param name="chunker.output.method">html</xsl:param> Description This parameter specifies the output method to be used in files generated by the chunking stylesheet. This parameter used to be named output.method. This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. chunker.output.omit-xml-declaration string chunker.output.omit-xml-declaration Omit-xml-declaration for generated pages <xsl:param name="chunker.output.omit-xml-declaration">no</xsl:param> Description This parameter specifies the value of the omit-xml-declaration specification for generated pages. Not all processors support specification of this parameter. This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. chunker.output.standalone string chunker.output.standalone Standalone declaration for generated pages <xsl:param name="chunker.output.standalone">no</xsl:param> Description This parameter specifies the value of the standalone specification for generated pages. It must be either yes or no. Not all processors support specification of this parameter. This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. saxon.character.representation string saxon.character.representation Saxon character representation used in generated HTML pages <xsl:param name="saxon.character.representation" select="'entity;decimal'"></xsl:param> Description This parameter has effect only when Saxon 6 is used (version 6.4.2 or later). It sets the character representation in files generated by the chunking stylesheets. If you want to suppress entity references for characters with direct representations in chunker.output.encoding, set the parameter value to native. For more information, see Saxon output character representation. This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. html.ext string html.ext Identifies the extension of generated HTML files <xsl:param name="html.ext">.html</xsl:param> Description The extension identified by html.ext will be used as the filename extension for chunks created by this stylesheet. use.id.as.filename boolean use.id.as.filename Use ID value of chunk elements as the filename? <xsl:param name="use.id.as.filename" select="0"></xsl:param> Description If use.id.as.filename is non-zero, the filename of chunk elements that have IDs will be derived from the ID value. html.extra.head.links boolean html.extra.head.links Toggle extra HTML head link information <xsl:param name="html.extra.head.links" select="0"></xsl:param> Description If non-zero, extra link elements will be generated in the head of chunked HTML files. These extra links point to chapters, appendixes, sections, etc. as supported by the Site Navigation Bar in Mozilla 1.0 (as of CR1, at least). root.filename uri root.filename Identifies the name of the root HTML file when chunking <xsl:param name="root.filename">index</xsl:param> Description The root.filename is the base filename for the chunk created for the root of each document processed. base.dir uri base.dir The base directory of chunks <xsl:param name="base.dir"></xsl:param> Description If specified, the base.dir parameter identifies the output directory for chunks. (If not specified, the output directory is system dependent.) Starting with version 1.77 of the stylesheets, the param's value will have a trailing slash added if it does not already have one. Do not use base.dir to add a filename prefix string to chunked files. Instead, use the chunked.filename.prefix parameter. chunked.filename.prefix string chunked.filename.prefix Filename prefix for chunked files <xsl:param name="chunked.filename.prefix"></xsl:param> Description If specified, the chunked.filename.prefix parameter specifies a prefix string to add to each generated chunk filename. For example: <xsl:param name="chunked.filename.prefix">admin-<xsl:param> will produce chunked filenames like: admin-index.html admin-ch01.html admin-ch01s01.html ... Trying to use the base.dir parameter to add a string prefix (by omitting the trailing slash) no longer works (it never worked completely anyway). That parameter value should contain only a directory path, and now gets a trailing slash appended if it was omitted from the param. generate.manifest boolean generate.manifest Generate a manifest file? <xsl:param name="generate.manifest" select="0"></xsl:param> Description If non-zero, a list of HTML files generated by the stylesheet transformation is written to the file named by the manifest parameter. manifest string manifest Name of manifest file <xsl:param name="manifest">HTML.manifest</xsl:param> Description The name of the file to which a manifest is written (if the value of the generate.manifest parameter is non-zero). manifest.in.base.dir boolean manifest.in.base.dir Should the manifest file be written into base.dir? <xsl:param name="manifest.in.base.dir" select="0"></xsl:param> Description If non-zero, the manifest file as well as project files for HTML Help and Eclipse Help are written into base.dir instead of the current directory. chunk.toc string chunk.toc An explicit TOC to be used for chunking <xsl:param name="chunk.toc"></xsl:param> Description The chunk.toc identifies an explicit TOC that will be used for chunking. This parameter is only used by the chunktoc.xsl stylesheet (and customization layers built from it). chunk.tocs.and.lots boolean chunk.tocs.and.lots Should ToC and LoTs be in separate chunks? <xsl:param name="chunk.tocs.and.lots" select="0"></xsl:param> Description If non-zero, ToC and LoT (List of Examples, List of Figures, etc.) will be put in a separate chunk. At the moment, this chunk is not in the normal forward/backward navigation list. Instead, a new link is added to the navigation footer. This feature is still somewhat experimental. Feedback welcome. chunk.separate.lots boolean chunk.separate.lots Should each LoT be in its own separate chunk? <xsl:param name="chunk.separate.lots" select="0"></xsl:param> Description If non-zero, each of the ToC and LoTs (List of Examples, List of Figures, etc.) will be put in its own separate chunk. The title page includes generated links to each of the separate files. This feature depends on the chunk.tocs.and.lots parameter also being non-zero. chunk.tocs.and.lots.has.title boolean chunk.tocs.and.lots.has.title Should ToC and LoTs in a separate chunks have title? <xsl:param name="chunk.tocs.and.lots.has.title" select="1"></xsl:param> Description If non-zero title of document is shown before ToC/LoT in separate chunk. chunk.section.depth integer chunk.section.depth Depth to which sections should be chunked <xsl:param name="chunk.section.depth" select="1"></xsl:param> Description This parameter sets the depth of section chunking. chunk.first.sections boolean chunk.first.sections Chunk the first top-level section? <xsl:param name="chunk.first.sections" select="0"></xsl:param> Description If non-zero, a chunk will be created for the first top-level sect1 or section elements in each component. Otherwise, that section will be part of the chunk for its parent. chunk.quietly boolean chunk.quietly Omit the chunked filename messages. <xsl:param name="chunk.quietly" select="0"></xsl:param> Description If zero (the default), the XSL processor emits a message naming each separate chunk filename as it is being output. If nonzero, then the messages are suppressed. chunk.append string chunk.append Specifies content to append to chunked HTML output <xsl:param name="chunk.append"></xsl:param> Description Specifies content to append to the end of HTML files output by the html/chunk.xsl stylesheet, after the closing <html> tag. You probably don’t want to set any value for this parameter; but if you do, the only value it should ever be set to is a newline character: &#x0a; or &#10; navig.graphics boolean navig.graphics Use graphics in navigational headers and footers? <xsl:param name="navig.graphics" select="0"></xsl:param> Description If non-zero, the navigational headers and footers in chunked HTML are presented in an alternate style that uses graphical icons for Next, Previous, Up, and Home. Default graphics are provided in the distribution. If zero, text is used instead of graphics. navig.graphics.extension string navig.graphics.extension Extension for navigational graphics <xsl:param name="navig.graphics.extension">.gif</xsl:param> Description Sets the filename extension to use on navigational graphics used in the headers and footers of chunked HTML. navig.graphics.path string navig.graphics.path Path to navigational graphics <xsl:param name="navig.graphics.path">images/</xsl:param> Description Sets the path, probably relative to the directory where the HTML files are created, to the navigational graphics used in the headers and footers of chunked HTML. navig.showtitles boolean navig.showtitles Display titles in HTML headers and footers? <xsl:param name="navig.showtitles">1</xsl:param> Description If non-zero, the headers and footers of chunked HTML display the titles of the next and previous chunks, along with the words 'Next' and 'Previous' (or the equivalent graphical icons if navig.graphics is true). If false (zero), then only the words 'Next' and 'Previous' (or the icons) are displayed. Profiling The following parameters can be used for attribute-based profiling of your document. For more information about profiling, see Profiling (conditional text). profile.arch string profile.arch Target profile for arch attribute <xsl:param name="profile.arch"></xsl:param> Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). profile.audience string profile.audience Target profile for audience attribute <xsl:param name="profile.audience"></xsl:param> Description Value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). profile.condition string profile.condition Target profile for condition attribute <xsl:param name="profile.condition"></xsl:param> Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). profile.conformance string profile.conformance Target profile for conformance attribute <xsl:param name="profile.conformance"></xsl:param> Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). profile.lang string profile.lang Target profile for lang attribute <xsl:param name="profile.lang"></xsl:param> Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). profile.os string profile.os Target profile for os attribute <xsl:param name="profile.os"></xsl:param> Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). profile.outputformat string profile.outputformat Target profile for outputformat attribute <xsl:param name="profile.outputformat"></xsl:param> Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). profile.revision string profile.revision Target profile for revision attribute <xsl:param name="profile.revision"></xsl:param> Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). profile.revisionflag string profile.revisionflag Target profile for revisionflag attribute <xsl:param name="profile.revisionflag"></xsl:param> Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). profile.role string profile.role Target profile for role attribute <xsl:param name="profile.role"></xsl:param> Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). Note that role is often used for other purposes than profiling. For example it is commonly used to get emphasize in bold font: <emphasis role="bold">very important</emphasis> If you are using role for these purposes do not forget to add values like bold to value of this parameter. If you forgot you will get document with small pieces missing which are very hard to track. For this reason it is not recommended to use role attribute for profiling. You should rather use profiling specific attributes like userlevel, os, arch, condition, etc. profile.security string profile.security Target profile for security attribute <xsl:param name="profile.security"></xsl:param> Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). profile.status string profile.status Target profile for status attribute <xsl:param name="profile.status"></xsl:param> Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). profile.userlevel string profile.userlevel Target profile for userlevel attribute <xsl:param name="profile.userlevel"></xsl:param> Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). profile.vendor string profile.vendor Target profile for vendor attribute <xsl:param name="profile.vendor"></xsl:param> Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). profile.wordsize string profile.wordsize Target profile for wordsize attribute <xsl:param name="profile.wordsize"></xsl:param> Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). profile.attribute string profile.attribute Name of user-specified profiling attribute <xsl:param name="profile.attribute"></xsl:param> Description This parameter is used in conjuction with profile.value. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). profile.value string profile.value Target profile for user-specified attribute <xsl:param name="profile.value"></xsl:param> Description When you are using this parameter you must also specify name of profiling attribute with parameter profile.attribute. The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). profile.separator string profile.separator Separator character for compound profile values <xsl:param name="profile.separator">;</xsl:param> Description Separator character used for compound profile values. See profile.arch HTML Help htmlhelp.encoding string htmlhelp.encoding Character encoding to use in files for HTML Help compiler. <xsl:param name="htmlhelp.encoding">iso-8859-1</xsl:param> Description The HTML Help Compiler is not UTF-8 aware, so you should always use an appropriate single-byte encoding here. See also Processing options. htmlhelp.autolabel boolean htmlhelp.autolabel Should tree-like ToC use autonumbering feature? <xsl:param name="htmlhelp.autolabel" select="0"></xsl:param> Description Set this to non-zero to include chapter and section numbers into ToC in the left panel. htmlhelp.chm string htmlhelp.chm Filename of output HTML Help file. <xsl:param name="htmlhelp.chm">htmlhelp.chm</xsl:param> Description Set the name of resulting CHM file htmlhelp.default.topic string htmlhelp.default.topic Name of file with default topic <xsl:param name="htmlhelp.default.topic"></xsl:param> Description Normally first chunk of document is displayed when you open HTML Help file. If you want to display another topic, simply set its filename by this parameter. This is useful especially if you don't generate ToC in front of your document and you also hide root element in ToC. E.g.: <xsl:param name="generate.book.toc" select="0"/> <xsl:param name="htmlhelp.hhc.show.root" select="0"/> <xsl:param name="htmlhelp.default.topic">pr01.html</xsl:param> htmlhelp.display.progress boolean htmlhelp.display.progress Display compile progress? <xsl:param name="htmlhelp.display.progress" select="1"></xsl:param> Description Set to non-zero to to display compile progress htmlhelp.hhp string htmlhelp.hhp Filename of project file. <xsl:param name="htmlhelp.hhp">htmlhelp.hhp</xsl:param> Description Change this parameter if you want different name of project file than htmlhelp.hhp. htmlhelp.hhc string htmlhelp.hhc Filename of TOC file. <xsl:param name="htmlhelp.hhc">toc.hhc</xsl:param> Description Set the name of the TOC file. The default is toc.hhc. htmlhelp.hhk string htmlhelp.hhk Filename of index file. <xsl:param name="htmlhelp.hhk">index.hhk</xsl:param> Description set the name of the index file. The default is index.hhk. htmlhelp.hhp.tail string htmlhelp.hhp.tail Additional content for project file. <xsl:param name="htmlhelp.hhp.tail"></xsl:param> Description If you want to include some additional parameters into project file, store appropriate part of project file into this parameter. htmlhelp.hhp.window string htmlhelp.hhp.window Name of default window. <xsl:param name="htmlhelp.hhp.window">Main</xsl:param> Description Name of default window. If empty no [WINDOWS] section will be added to project file. htmlhelp.hhp.windows string htmlhelp.hhp.windows Definition of additional windows <xsl:param name="htmlhelp.hhp.windows"></xsl:param> Description Content of this parameter is placed at the end of [WINDOWS] section of project file. You can use it for defining your own addtional windows. htmlhelp.enhanced.decompilation boolean htmlhelp.enhanced.decompilation Allow enhanced decompilation of CHM? <xsl:param name="htmlhelp.enhanced.decompilation" select="0"></xsl:param> Description When non-zero this parameter enables enhanced decompilation of CHM. htmlhelp.enumerate.images boolean htmlhelp.enumerate.images Should the paths to all used images be added to the project file? <xsl:param name="htmlhelp.enumerate.images" select="0"></xsl:param> Description Set to non-zero if you insert images into your documents as external binary entities or if you are using absolute image paths. htmlhelp.force.map.and.alias boolean htmlhelp.force.map.and.alias Should [MAP] and [ALIAS] sections be added to the project file unconditionally? <xsl:param name="htmlhelp.force.map.and.alias" select="0"></xsl:param> Description Set to non-zero if you have your own alias.h and context.h files and you want to include references to them in the project file. htmlhelp.map.file string htmlhelp.map.file Filename of map file. <xsl:param name="htmlhelp.map.file">context.h</xsl:param> Description Set the name of map file. The default is context.h. (used for context-sensitive help). htmlhelp.alias.file string htmlhelp.alias.file Filename of alias file. <xsl:param name="htmlhelp.alias.file">alias.h</xsl:param> Description Specifies the filename of the alias file (used for context-sensitive help). htmlhelp.hhc.section.depth integer htmlhelp.hhc.section.depth Depth of TOC for sections in a left pane. <xsl:param name="htmlhelp.hhc.section.depth">5</xsl:param> Description Set the section depth in the left pane of HTML Help viewer. htmlhelp.hhc.show.root boolean htmlhelp.hhc.show.root Should there be an entry for the root element in the ToC? <xsl:param name="htmlhelp.hhc.show.root" select="1"></xsl:param> Description If set to zero, there will be no entry for the root element in the ToC. This is useful when you want to provide the user with an expanded ToC as a default. htmlhelp.hhc.folders.instead.books boolean htmlhelp.hhc.folders.instead.books Use folder icons in ToC (instead of book icons)? <xsl:param name="htmlhelp.hhc.folders.instead.books" select="1"></xsl:param> Description Set to non-zero for folder-like icons or zero for book-like icons in the ToC. If you want to use folder-like icons, you must switch off the binary ToC using htmlhelp.hhc.binary. htmlhelp.hhc.binary boolean htmlhelp.hhc.binary Generate binary ToC? <xsl:param name="htmlhelp.hhc.binary" select="1"></xsl:param> Description Set to non-zero to generate a binary TOC. You must create a binary TOC if you want to add Prev/Next buttons to toolbar (which is default behaviour). Files with binary TOC can't be merged. htmlhelp.hhc.width integer htmlhelp.hhc.width Width of navigation pane <xsl:param name="htmlhelp.hhc.width"></xsl:param> Description This parameter specifies the width of the navigation pane (containing TOC and other navigation tabs) in pixels. htmlhelp.title string htmlhelp.title Title of HTML Help <xsl:param name="htmlhelp.title"></xsl:param> Description Content of this parameter will be used as a title for generated HTML Help. If empty, title will be automatically taken from document. htmlhelp.show.menu boolean htmlhelp.show.menu Should the menu bar be shown? <xsl:param name="htmlhelp.show.menu" select="0"></xsl:param> Description Set to non-zero to have an application menu bar in your HTML Help window. htmlhelp.show.toolbar.text boolean htmlhelp.show.toolbar.text Show text under toolbar buttons? <xsl:param name="htmlhelp.show.toolbar.text" select="1"></xsl:param> Description Set to non-zero to display texts under toolbar buttons, zero to switch off displays. htmlhelp.show.advanced.search boolean htmlhelp.show.advanced.search Should advanced search features be available? <xsl:param name="htmlhelp.show.advanced.search" select="0"></xsl:param> Description If you want advanced search features in your help, turn this parameter to 1. htmlhelp.show.favorities boolean htmlhelp.show.favorities Should the Favorites tab be shown? <xsl:param name="htmlhelp.show.favorities" select="0"></xsl:param> Description Set to non-zero to include a Favorites tab in the navigation pane of the help window. htmlhelp.button.hideshow boolean htmlhelp.button.hideshow Should the Hide/Show button be shown? <xsl:param name="htmlhelp.button.hideshow" select="1"></xsl:param> Description Set to non-zero to include the Hide/Show button shown on toolbar htmlhelp.button.back boolean htmlhelp.button.back Should the Back button be shown? <xsl:param name="htmlhelp.button.back" select="1"></xsl:param> Description Set to non-zero to include the Hide/Show button shown on toolbar htmlhelp.button.forward boolean htmlhelp.button.forward Should the Forward button be shown? <xsl:param name="htmlhelp.button.forward" select="0"></xsl:param> Description Set to non-zero to include the Forward button on the toolbar. htmlhelp.button.stop boolean htmlhelp.button.stop Should the Stop button be shown? <xsl:param name="htmlhelp.button.stop" select="0"></xsl:param> Description If you want Stop button shown on toolbar, turn this parameter to 1. htmlhelp.button.refresh boolean htmlhelp.button.refresh Should the Refresh button be shown? <xsl:param name="htmlhelp.button.refresh" select="0"></xsl:param> Description Set to non-zero to include the Stop button on the toolbar. htmlhelp.button.home boolean htmlhelp.button.home Should the Home button be shown? <xsl:param name="htmlhelp.button.home" select="0"></xsl:param> Description Set to non-zero to include the Home button on the toolbar. htmlhelp.button.home.url string htmlhelp.button.home.url URL address of page accessible by Home button <xsl:param name="htmlhelp.button.home.url"></xsl:param> Description URL address of page accessible by Home button. htmlhelp.button.options boolean htmlhelp.button.options Should the Options button be shown? <xsl:param name="htmlhelp.button.options" select="1"></xsl:param> Description If you want Options button shown on toolbar, turn this parameter to 1. htmlhelp.button.print boolean htmlhelp.button.print Should the Print button be shown? <xsl:param name="htmlhelp.button.print" select="1"></xsl:param> Description Set to non-zero to include the Print button on the toolbar. htmlhelp.button.locate boolean htmlhelp.button.locate Should the Locate button be shown? <xsl:param name="htmlhelp.button.locate" select="0"></xsl:param> Description If you want Locate button shown on toolbar, turn this parameter to 1. htmlhelp.button.jump1 boolean htmlhelp.button.jump1 Should the Jump1 button be shown? <xsl:param name="htmlhelp.button.jump1" select="0"></xsl:param> Description Set to non-zero to include the Jump1 button on the toolbar. htmlhelp.button.jump1.url string htmlhelp.button.jump1.url URL address of page accessible by Jump1 button <xsl:param name="htmlhelp.button.jump1.url"></xsl:param> Description URL address of page accessible by Jump1 button. htmlhelp.button.jump1.title string htmlhelp.button.jump1.title Title of Jump1 button <xsl:param name="htmlhelp.button.jump1.title">User1</xsl:param> Description Title of Jump1 button. htmlhelp.button.jump2 boolean htmlhelp.button.jump2 Should the Jump2 button be shown? <xsl:param name="htmlhelp.button.jump2" select="0"></xsl:param> Description Set to non-zero to include the Jump2 button on the toolbar. htmlhelp.button.jump2.url string htmlhelp.button.jump2.url URL address of page accessible by Jump2 button <xsl:param name="htmlhelp.button.jump2.url"></xsl:param> Description URL address of page accessible by Jump2 button. htmlhelp.button.jump2.title string htmlhelp.button.jump2.title Title of Jump2 button <xsl:param name="htmlhelp.button.jump2.title">User2</xsl:param> Description Title of Jump2 button. htmlhelp.button.next boolean htmlhelp.button.next Should the Next button be shown? <xsl:param name="htmlhelp.button.next" select="1"></xsl:param> Description Set to non-zero to include the Next button on the toolbar. htmlhelp.button.prev boolean htmlhelp.button.prev Should the Prev button be shown? <xsl:param name="htmlhelp.button.prev" select="1"></xsl:param> Description Set to non-zero to include the Prev button on the toolbar. htmlhelp.button.zoom boolean htmlhelp.button.zoom Should the Zoom button be shown? <xsl:param name="htmlhelp.button.zoom" select="0"></xsl:param> Description Set to non-zero to include the Zoom button on the toolbar. htmlhelp.remember.window.position boolean htmlhelp.remember.window.position Remember help window position? <xsl:param name="htmlhelp.remember.window.position" select="0"></xsl:param> Description Set to non-zero to remember help window position between starts. htmlhelp.window.geometry string htmlhelp.window.geometry Set initial geometry of help window <xsl:param name="htmlhelp.window.geometry"></xsl:param> Description This parameter specifies initial position of help window. E.g. <xsl:param name="htmlhelp.window.geometry">[160,64,992,704]</xsl:param> htmlhelp.use.hhk boolean htmlhelp.use.hhk Should the index be built using the HHK file? <xsl:param name="htmlhelp.use.hhk" select="0"></xsl:param> Description If non-zero, the index is created using the HHK file (instead of using object elements in the HTML files). For more information, see Generating an index. htmlhelp.only boolean htmlhelp.only Should only project files be generated? <xsl:param name="htmlhelp.only" select="0"></xsl:param> Description Set to non-zero if you want to play with various HTML Help parameters and you don't need to regenerate all HTML files. This setting will not process whole document, only project files (hhp, hhc, hhk,...) will be generated. Eclipse Help Platform eclipse.autolabel boolean eclipse.autolabel Should tree-like ToC use autonumbering feature? <xsl:param name="eclipse.autolabel" select="0"></xsl:param> Description If you want to include chapter and section numbers into ToC in the left panel, set this parameter to 1. eclipse.plugin.name string eclipse.plugin.name Eclipse Help plugin name <xsl:param name="eclipse.plugin.name">DocBook Online Help Sample</xsl:param> Description Eclipse Help plugin name. eclipse.plugin.id string eclipse.plugin.id Eclipse Help plugin id <xsl:param name="eclipse.plugin.id">com.example.help</xsl:param> Description Eclipse Help plugin id. You should change this id to something unique for each help. eclipse.plugin.provider string eclipse.plugin.provider Eclipse Help plugin provider name <xsl:param name="eclipse.plugin.provider">Example provider</xsl:param> Description Eclipse Help plugin provider name. WebHelp webhelp.autolabel boolean webhelp.autolabel Should tree-like ToC use autonumbering feature? <xsl:param name="webhelp.autolabel">0</xsl:param> Description To include chapter and section numbers the table of contents pane, set this parameter to 1. webhelp.base.dir string webhelp.base.dir The base directory for webhelp output. <xsl:param name="webhelp.base.dir">docs</xsl:param> Description If specified, the webhelp.base.dir parameter identifies the output directory for webhelp. (If not specified, the output directory is system dependent.) By default, this parameter is set to docs. webhelp.common.dir string webhelp.common.dir Path to the directory for the common webhelp resources (JavaScript, css, common images, etc). <xsl:param name="webhelp.common.dir">../common/</xsl:param> Description By default, webhelp creates a common directory containing resources such as JavaScript files, css, common images, etc. In some cases you may prefer to store these files in a standard location on your site and point all webhelp documents to that location. You can use this parameter to control the urls written to these common resources. For example, you might set this parameter to /common and create a single common directory at the root of your web server. webhelp.default.topic string webhelp.default.topic The name of the file to which the start file in the webhelp base directory redirects <xsl:param name="webhelp.default.topic">index.html</xsl:param> Description Currently webhelp creates a base directory and puts the output files in a content subdirectory. It creates a file in the base directory that redirects to a configured file in the content directory. The webhelp.default.topic parameter lets you configure the name of the file that is redirected to. This parameter will be removed from a future version of webhelp along with the content directory. webhelp.include.search.tab boolean webhelp.include.search.tab Should the webhelp output include a Search tab? <xsl:param name="webhelp.include.search.tab">1</xsl:param> Description Set this parameter to 0 to suppress the search tab from webhelp output. webhelp.indexer.language webhelp.indexer.language The language to use for creating the webhelp search index. <xsl:param name="webhelp.indexer.language">en</xsl:param> Description To support stemming in the client-side webhelp stemmer, you must provide the language code. By default, the following languages are supported: en: English de: German fr: French zh: Chinese ja: Japanese ko: Korean See the webhelp documentation for information on adding support for additional languages. webhelp.start.filename string webhelp.start.filename The name of the start file in the webhelp base directory. <xsl:param name="webhelp.start.filename">index.html</xsl:param> Description Currently webhelp creates a base directory and puts the output files in a content subdirectory. It creates a file in the base directory that redirects to a configured file in the content directory. The webhelp.start.filename parameter lets you configure the name of the redirect file. This parameter will be removed from a future version of webhelp along with the content directory. webhelp.tree.cookie.id string webhelp.tree.cookie.id Controls how the cookie that stores the webhelp toc state is named. <xsl:param name="webhelp.tree.cookie.id" select="concat( 'treeview-', count(//node()) )"></xsl:param> Description The webhelp output does not use a frameset. Instead, the table of contents is a div on each page. To preserve the state of the table of contents as the user navigates from page to page, webhelp stores the state in a cookie and reads that cookie when you get to the next page. If you've published several webhelp documents on the same domain, it is important that each cookie have a unique id. In lieu of calling on a GUID generator, by default this parameter is just set to the number of nodes in the document on the assumption that it is unlikely that you will have more than one document with the exact number of nodes. A more optimal solution would be for the user to pass in some unique, stable identifier from the build system to use as the webhelp cookie id. For example, if you have safeguards in place to ensure that the xml:id of the root element of each document will be unique on your site, then you could set webhelptree.cookie.id as follows: <xsl:param name="webhelp.tree.cookie.id"> <xsl:choose> <xsl:when test="/*/@xml:id"> <xsl:value-of select="concat('treeview-',/*/@xml:id)"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="concat( 'treeview-', count(//node()) )"/> </xsl:otherwise> </xsl:choose> </xsl:param> JavaHelp javahelp.encoding string javahelp.encoding Character encoding to use in control files for JavaHelp. <xsl:param name="javahelp.encoding">iso-8859-1</xsl:param> Description JavaHelp crashes on some characters when written as character references. In that case you can use this parameter to select an appropriate encoding. Localization l10n.gentext.language string l10n.gentext.language Sets the gentext language <xsl:param name="l10n.gentext.language"></xsl:param> Description If this parameter is set to any value other than the empty string, its value will be used as the value for the language when generating text. Setting l10n.gentext.language overrides any settings within the document being formatted. It's much more likely that you might want to set the l10n.gentext.default.language parameter. l10n.gentext.default.language string l10n.gentext.default.language Sets the default language for generated text <xsl:param name="l10n.gentext.default.language">en</xsl:param> Description The value of the l10n.gentext.default.language parameter is used as the language for generated text if no setting is provided in the source document. l10n.gentext.use.xref.language boolean l10n.gentext.use.xref.language Use the language of target when generating cross-reference text? <xsl:param name="l10n.gentext.use.xref.language" select="0"></xsl:param> Description If non-zero, the language of the target will be used when generating cross reference text. Usually, the current language is used when generating text (that is, the language of the element that contains the cross-reference element). But setting this parameter allows the language of the element pointed to to control the generated text. Consider the following example: <para lang="en">See also <xref linkend="chap3"/>.</para> Suppose that Chapter 3 happens to be written in German. If l10n.gentext.use.xref.language is non-zero, the resulting text will be something like this:
    See also Kapital 3.
    Where the more traditional rendering would be:
    See also Chapter 3.
    l10n.lang.value.rfc.compliant boolean l10n.lang.value.rfc.compliant Make value of lang attribute RFC compliant? <xsl:param name="l10n.lang.value.rfc.compliant" select="1"></xsl:param> Description If non-zero, ensure that the values for all lang attributes in HTML output are RFC compliantSection 8.1.1, Language Codes, in the HTML 4.0 Recommendation states that:
    [RFC1766] defines and explains the language codes that must be used in HTML documents. Briefly, language codes consist of a primary code and a possibly empty series of subcodes: language-code = primary-code ( "-" subcode )* And in RFC 1766, Tags for the Identification of Languages, the EBNF for "language tag" is given as: Language-Tag = Primary-tag *( "-" Subtag ) Primary-tag = 1*8ALPHA Subtag = 1*8ALPHA
    . by taking any underscore characters in any lang values found in source documents, and replacing them with hyphen characters in output HTML files. For example, zh_CN in a source document becomes zh-CN in the HTML output form that source. This parameter does not cause any case change in lang values, because RFC 1766 explicitly states that all "language tags" (as it calls them) "are to be treated as case insensitive".
    writing.mode string writing.mode Direction of text flow based on locale <xsl:param name="writing.mode"> <xsl:call-template name="gentext"> <xsl:with-param name="key">writing-mode</xsl:with-param> <xsl:with-param name="lang"> <xsl:call-template name="l10n.language"> <xsl:with-param name="target" select="/*[1]"></xsl:with-param> </xsl:call-template> </xsl:with-param> </xsl:call-template> </xsl:param> Description Sets direction of text flow and text alignment based on locale. The value is normally taken from the gentext file for the lang attribute of the document's root element, using the key name 'writing-mode' to look it up in the gentext file. But this param can also be set on the command line to override that gentext value. Accepted values are: lr-tb Left-to-right text flow in each line, lines stack top to bottom. rl-tb Right-to-left text flow in each line, lines stack top to bottom. tb-rl Top-to-bottom text flow in each vertical line, lines stack right to left. Supported by only a few XSL-FO processors. Not supported in HTML output. lr Shorthand for lr-tb. rl Shorthand for rl-tb. tb Shorthand for tb-rl.
    The Stylesheet The param.xsl stylesheet is just a wrapper around all these parameters. <!-- This file is generated from param.xweb --> <xsl:stylesheet exclude-result-prefixes="src" version="1.0"> <!-- ******************************************************************** $Id: param.xweb 9995 2015-10-01 16:34:45Z bobstayton $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. See ../README or http://docbook.sf.net/release/xsl/current/ for copyright and other information. ******************************************************************** --> <src:fragref linkend="abstract.notitle.enabled.frag"></src:fragref> <src:fragref linkend="activate.external.olinks.frag"></src:fragref> <src:fragref linkend="admon.graphics.extension.frag"></src:fragref> <src:fragref linkend="admon.graphics.frag"></src:fragref> <src:fragref linkend="admon.graphics.path.frag"></src:fragref> <src:fragref linkend="admon.style.frag"></src:fragref> <src:fragref linkend="admon.textlabel.frag"></src:fragref> <src:fragref linkend="annotate.toc.frag"></src:fragref> <src:fragref linkend="annotation.css.frag"></src:fragref> <src:fragref linkend="annotation.graphic.close.frag"></src:fragref> <src:fragref linkend="annotation.graphic.open.frag"></src:fragref> <src:fragref linkend="annotation.js.frag"></src:fragref> <src:fragref linkend="annotation.support.frag"></src:fragref> <src:fragref linkend="appendix.autolabel.frag"></src:fragref> <src:fragref linkend="author.othername.in.middle.frag"></src:fragref> <src:fragref linkend="autotoc.label.in.hyperlink.frag"></src:fragref> <src:fragref linkend="autotoc.label.separator.frag"></src:fragref> <src:fragref linkend="autolink.index.see.frag"></src:fragref> <src:fragref linkend="base.dir.frag"></src:fragref> <src:fragref linkend="biblioentry.item.separator.frag"></src:fragref> <src:fragref linkend="bibliography.collection.frag"></src:fragref> <src:fragref linkend="bibliography.numbered.frag"></src:fragref> <src:fragref linkend="bibliography.style.frag"></src:fragref> <src:fragref linkend="blurb.on.titlepage.enabled.frag"></src:fragref> <src:fragref linkend="bridgehead.in.toc.frag"></src:fragref> <src:fragref linkend="callout.defaultcolumn.frag"></src:fragref> <src:fragref linkend="callout.graphics.extension.frag"></src:fragref> <src:fragref linkend="callout.graphics.frag"></src:fragref> <src:fragref linkend="callout.graphics.number.limit.frag"></src:fragref> <src:fragref linkend="callout.graphics.path.frag"></src:fragref> <src:fragref linkend="callout.list.table.frag"></src:fragref> <src:fragref linkend="callout.unicode.frag"></src:fragref> <src:fragref linkend="callout.unicode.number.limit.frag"></src:fragref> <src:fragref linkend="callout.unicode.start.character.frag"></src:fragref> <src:fragref linkend="callouts.extension.frag"></src:fragref> <src:fragref linkend="chapter.autolabel.frag"></src:fragref> <src:fragref linkend="chunk.append.frag"></src:fragref> <src:fragref linkend="chunk.first.sections.frag"></src:fragref> <src:fragref linkend="chunk.quietly.frag"></src:fragref> <src:fragref linkend="chunk.section.depth.frag"></src:fragref> <src:fragref linkend="chunk.separate.lots.frag"></src:fragref> <src:fragref linkend="chunk.toc.frag"></src:fragref> <src:fragref linkend="chunk.tocs.and.lots.frag"></src:fragref> <src:fragref linkend="chunk.tocs.and.lots.has.title.frag"></src:fragref> <src:fragref linkend="chunked.filename.prefix.frag"></src:fragref> <src:fragref linkend="citerefentry.link.frag"></src:fragref> <src:fragref linkend="collect.xref.targets.frag"></src:fragref> <src:fragref linkend="component.label.includes.part.label.frag"></src:fragref> <src:fragref linkend="contrib.inline.enabled.frag"></src:fragref> <src:fragref linkend="css.decoration.frag"></src:fragref> <src:fragref linkend="current.docid.frag"></src:fragref> <src:fragref linkend="custom.css.source.frag"></src:fragref> <src:fragref linkend="default.float.class.frag"></src:fragref> <src:fragref linkend="default.image.width.frag"></src:fragref> <src:fragref linkend="default.table.frame.frag"></src:fragref> <src:fragref linkend="default.table.width.frag"></src:fragref> <src:fragref linkend="docbook.css.link.frag"></src:fragref> <src:fragref linkend="docbook.css.source.frag"></src:fragref> <src:fragref linkend="draft.mode.frag"></src:fragref> <src:fragref linkend="draft.watermark.image.frag"></src:fragref> <src:fragref linkend="ebnf.assignment.frag"></src:fragref> <src:fragref linkend="ebnf.statement.terminator.frag"></src:fragref> <src:fragref linkend="ebnf.table.bgcolor.frag"></src:fragref> <src:fragref linkend="ebnf.table.border.frag"></src:fragref> <src:fragref linkend="eclipse.autolabel.frag"></src:fragref> <src:fragref linkend="eclipse.plugin.id.frag"></src:fragref> <src:fragref linkend="eclipse.plugin.name.frag"></src:fragref> <src:fragref linkend="eclipse.plugin.provider.frag"></src:fragref> <src:fragref linkend="editedby.enabled.frag"></src:fragref> <src:fragref linkend="email.delimiters.enabled.frag"></src:fragref> <src:fragref linkend="emphasis.propagates.style.frag"></src:fragref> <src:fragref linkend="entry.propagates.style.frag"></src:fragref> <src:fragref linkend="exsl.node.set.available.frag"></src:fragref> <src:fragref linkend="firstterm.only.link.frag"></src:fragref> <src:fragref linkend="footer.rule.frag"></src:fragref> <src:fragref linkend="footnote.number.format.frag"></src:fragref> <src:fragref linkend="footnote.number.symbols.frag"></src:fragref> <src:fragref linkend="formal.procedures.frag"></src:fragref> <src:fragref linkend="formal.title.placement.frag"></src:fragref> <src:fragref linkend="funcsynopsis.decoration.frag"></src:fragref> <src:fragref linkend="funcsynopsis.style.frag"></src:fragref> <src:fragref linkend="function.parens.frag"></src:fragref> <src:fragref linkend="generate.consistent.ids.frag"></src:fragref> <src:fragref linkend="generate.css.header.frag"></src:fragref> <src:fragref linkend="generate.id.attributes.frag"></src:fragref> <src:fragref linkend="generate.index.frag"></src:fragref> <src:fragref linkend="generate.legalnotice.link.frag"></src:fragref> <src:fragref linkend="generate.manifest.frag"></src:fragref> <src:fragref linkend="generate.meta.abstract.frag"></src:fragref> <src:fragref linkend="generate.revhistory.link.frag"></src:fragref> <src:fragref linkend="generate.section.toc.level.frag"></src:fragref> <src:fragref linkend="generate.toc.frag"></src:fragref> <src:fragref linkend="glossary.collection.frag"></src:fragref> <src:fragref linkend="glossary.sort.frag"></src:fragref> <src:fragref linkend="glossentry.show.acronym.frag"></src:fragref> <src:fragref linkend="glossterm.auto.link.frag"></src:fragref> <src:fragref linkend="graphic.default.extension.frag"></src:fragref> <src:fragref linkend="graphicsize.extension.frag"></src:fragref> <src:fragref linkend="graphicsize.use.img.src.path.frag"></src:fragref> <src:fragref linkend="header.rule.frag"></src:fragref> <src:fragref linkend="highlight.default.language.frag"></src:fragref> <src:fragref linkend="highlight.source.frag"></src:fragref> <src:fragref linkend="highlight.xslthl.config.frag"></src:fragref> <src:fragref linkend="html.append.frag"></src:fragref> <src:fragref linkend="html.base.frag"></src:fragref> <src:fragref linkend="html.cellpadding.frag"></src:fragref> <src:fragref linkend="html.cellspacing.frag"></src:fragref> <src:fragref linkend="html.cleanup.frag"></src:fragref> <src:fragref linkend="html.ext.frag"></src:fragref> <src:fragref linkend="html.extra.head.links.frag"></src:fragref> <src:fragref linkend="html.head.legalnotice.link.multiple.frag"></src:fragref> <src:fragref linkend="html.head.legalnotice.link.types.frag"></src:fragref> <src:fragref linkend="html.longdesc.frag"></src:fragref> <src:fragref linkend="html.longdesc.link.frag"></src:fragref> <src:fragref linkend="html.script.frag"></src:fragref> <src:fragref linkend="html.script.type.frag"></src:fragref> <src:fragref linkend="html.stylesheet.frag"></src:fragref> <src:fragref linkend="html.stylesheet.type.frag"></src:fragref> <src:fragref linkend="htmlhelp.alias.file.frag"></src:fragref> <src:fragref linkend="htmlhelp.autolabel.frag"></src:fragref> <src:fragref linkend="htmlhelp.button.back.frag"></src:fragref> <src:fragref linkend="htmlhelp.button.forward.frag"></src:fragref> <src:fragref linkend="htmlhelp.button.hideshow.frag"></src:fragref> <src:fragref linkend="htmlhelp.button.home.frag"></src:fragref> <src:fragref linkend="htmlhelp.button.home.url.frag"></src:fragref> <src:fragref linkend="htmlhelp.button.jump1.frag"></src:fragref> <src:fragref linkend="htmlhelp.button.jump1.title.frag"></src:fragref> <src:fragref linkend="htmlhelp.button.jump1.url.frag"></src:fragref> <src:fragref linkend="htmlhelp.button.jump2.frag"></src:fragref> <src:fragref linkend="htmlhelp.button.jump2.title.frag"></src:fragref> <src:fragref linkend="htmlhelp.button.jump2.url.frag"></src:fragref> <src:fragref linkend="htmlhelp.button.locate.frag"></src:fragref> <src:fragref linkend="htmlhelp.button.next.frag"></src:fragref> <src:fragref linkend="htmlhelp.button.options.frag"></src:fragref> <src:fragref linkend="htmlhelp.button.prev.frag"></src:fragref> <src:fragref linkend="htmlhelp.button.print.frag"></src:fragref> <src:fragref linkend="htmlhelp.button.refresh.frag"></src:fragref> <src:fragref linkend="htmlhelp.button.stop.frag"></src:fragref> <src:fragref linkend="htmlhelp.button.zoom.frag"></src:fragref> <src:fragref linkend="htmlhelp.chm.frag"></src:fragref> <src:fragref linkend="htmlhelp.default.topic.frag"></src:fragref> <src:fragref linkend="htmlhelp.display.progress.frag"></src:fragref> <src:fragref linkend="htmlhelp.encoding.frag"></src:fragref> <src:fragref linkend="htmlhelp.enhanced.decompilation.frag"></src:fragref> <src:fragref linkend="htmlhelp.enumerate.images.frag"></src:fragref> <src:fragref linkend="htmlhelp.force.map.and.alias.frag"></src:fragref> <src:fragref linkend="htmlhelp.hhc.binary.frag"></src:fragref> <src:fragref linkend="htmlhelp.hhc.folders.instead.books.frag"></src:fragref> <src:fragref linkend="htmlhelp.hhc.frag"></src:fragref> <src:fragref linkend="htmlhelp.hhc.section.depth.frag"></src:fragref> <src:fragref linkend="htmlhelp.hhc.show.root.frag"></src:fragref> <src:fragref linkend="htmlhelp.hhc.width.frag"></src:fragref> <src:fragref linkend="htmlhelp.hhk.frag"></src:fragref> <src:fragref linkend="htmlhelp.hhp.frag"></src:fragref> <src:fragref linkend="htmlhelp.hhp.tail.frag"></src:fragref> <src:fragref linkend="htmlhelp.hhp.window.frag"></src:fragref> <src:fragref linkend="htmlhelp.hhp.windows.frag"></src:fragref> <src:fragref linkend="htmlhelp.map.file.frag"></src:fragref> <src:fragref linkend="htmlhelp.only.frag"></src:fragref> <src:fragref linkend="htmlhelp.remember.window.position.frag"></src:fragref> <src:fragref linkend="htmlhelp.show.advanced.search.frag"></src:fragref> <src:fragref linkend="htmlhelp.show.favorities.frag"></src:fragref> <src:fragref linkend="htmlhelp.show.menu.frag"></src:fragref> <src:fragref linkend="htmlhelp.show.toolbar.text.frag"></src:fragref> <src:fragref linkend="htmlhelp.title.frag"></src:fragref> <src:fragref linkend="htmlhelp.use.hhk.frag"></src:fragref> <src:fragref linkend="htmlhelp.window.geometry.frag"></src:fragref> <src:fragref linkend="id.warnings.frag"></src:fragref> <src:fragref linkend="ignore.image.scaling.frag"></src:fragref> <src:fragref linkend="img.src.path.frag"></src:fragref> <src:fragref linkend="index.links.to.section.frag"></src:fragref> <src:fragref linkend="index.method.frag"></src:fragref> <src:fragref linkend="index.number.separator.frag"></src:fragref> <src:fragref linkend="index.on.role.frag"></src:fragref> <src:fragref linkend="index.on.type.frag"></src:fragref> <src:fragref linkend="index.prefer.titleabbrev.frag"></src:fragref> <src:fragref linkend="index.range.separator.frag"></src:fragref> <src:fragref linkend="index.term.separator.frag"></src:fragref> <src:fragref linkend="inherit.keywords.frag"></src:fragref> <src:fragref linkend="insert.olink.page.number.frag"></src:fragref> <src:fragref linkend="insert.olink.pdf.frag.frag"></src:fragref> <src:fragref linkend="insert.xref.page.number.frag"></src:fragref> <src:fragref linkend="insert.xref.page.number.para.frag"></src:fragref> <src:fragref linkend="javahelp.encoding.frag"></src:fragref> <src:fragref linkend="keep.relative.image.uris.frag"></src:fragref> <src:fragref linkend="l10n.gentext.default.language.frag"></src:fragref> <src:fragref linkend="l10n.gentext.language.frag"></src:fragref> <src:fragref linkend="l10n.gentext.use.xref.language.frag"></src:fragref> <src:fragref linkend="l10n.lang.value.rfc.compliant.frag"></src:fragref> <src:fragref linkend="label.from.part.frag"></src:fragref> <src:fragref linkend="linenumbering.everyNth.frag"></src:fragref> <src:fragref linkend="linenumbering.extension.frag"></src:fragref> <src:fragref linkend="linenumbering.separator.frag"></src:fragref> <src:fragref linkend="linenumbering.width.frag"></src:fragref> <src:fragref linkend="link.mailto.url.frag"></src:fragref> <src:fragref linkend="make.clean.html.frag"></src:fragref> <src:fragref linkend="make.graphic.viewport.frag"></src:fragref> <src:fragref linkend="make.single.year.ranges.frag"></src:fragref> <src:fragref linkend="make.valid.html.frag"></src:fragref> <src:fragref linkend="make.year.ranges.frag"></src:fragref> <src:fragref linkend="manifest.frag"></src:fragref> <src:fragref linkend="manifest.in.base.dir.frag"></src:fragref> <src:fragref linkend="manual.toc.frag"></src:fragref> <src:fragref linkend="menuchoice.menu.separator.frag"></src:fragref> <src:fragref linkend="menuchoice.separator.frag"></src:fragref> <src:fragref linkend="navig.graphics.extension.frag"></src:fragref> <src:fragref linkend="navig.graphics.frag"></src:fragref> <src:fragref linkend="navig.graphics.path.frag"></src:fragref> <src:fragref linkend="navig.showtitles.frag"></src:fragref> <src:fragref linkend="nominal.image.depth.frag"></src:fragref> <src:fragref linkend="nominal.image.width.frag"></src:fragref> <src:fragref linkend="nominal.table.width.frag"></src:fragref> <src:fragref linkend="olink.base.uri.frag"></src:fragref> <src:fragref linkend="olink.debug.frag"></src:fragref> <src:fragref linkend="olink.doctitle.frag"></src:fragref> <src:fragref linkend="olink.lang.fallback.sequence.frag"></src:fragref> <src:fragref linkend="olink.properties.frag"></src:fragref> <src:fragref linkend="othercredit.like.author.enabled.frag"></src:fragref> <src:fragref linkend="para.propagates.style.frag"></src:fragref> <src:fragref linkend="part.autolabel.frag"></src:fragref> <src:fragref linkend="phrase.propagates.style.frag"></src:fragref> <src:fragref linkend="pixels.per.inch.frag"></src:fragref> <src:fragref linkend="points.per.em.frag"></src:fragref> <src:fragref linkend="preface.autolabel.frag"></src:fragref> <src:fragref linkend="prefer.internal.olink.frag"></src:fragref> <src:fragref linkend="preferred.mediaobject.role.frag"></src:fragref> <src:fragref linkend="process.empty.source.toc.frag"></src:fragref> <src:fragref linkend="process.source.toc.frag"></src:fragref> <src:fragref linkend="profile.arch.frag"></src:fragref> <src:fragref linkend="profile.attribute.frag"></src:fragref> <src:fragref linkend="profile.audience.frag"></src:fragref> <src:fragref linkend="profile.condition.frag"></src:fragref> <src:fragref linkend="profile.conformance.frag"></src:fragref> <src:fragref linkend="profile.lang.frag"></src:fragref> <src:fragref linkend="profile.os.frag"></src:fragref> <src:fragref linkend="profile.outputformat.frag"></src:fragref> <src:fragref linkend="profile.revision.frag"></src:fragref> <src:fragref linkend="profile.revisionflag.frag"></src:fragref> <src:fragref linkend="profile.role.frag"></src:fragref> <src:fragref linkend="profile.security.frag"></src:fragref> <src:fragref linkend="profile.separator.frag"></src:fragref> <src:fragref linkend="profile.status.frag"></src:fragref> <src:fragref linkend="profile.userlevel.frag"></src:fragref> <src:fragref linkend="profile.value.frag"></src:fragref> <src:fragref linkend="profile.vendor.frag"></src:fragref> <src:fragref linkend="profile.wordsize.frag"></src:fragref> <src:fragref linkend="punct.honorific.frag"></src:fragref> <src:fragref linkend="qanda.defaultlabel.frag"></src:fragref> <src:fragref linkend="qanda.in.toc.frag"></src:fragref> <src:fragref linkend="qanda.inherit.numeration.frag"></src:fragref> <src:fragref linkend="qanda.nested.in.toc.frag"></src:fragref> <src:fragref linkend="qandadiv.autolabel.frag"></src:fragref> <src:fragref linkend="refclass.suppress.frag"></src:fragref> <src:fragref linkend="refentry.generate.name.frag"></src:fragref> <src:fragref linkend="refentry.generate.title.frag"></src:fragref> <src:fragref linkend="refentry.separator.frag"></src:fragref> <src:fragref linkend="refentry.xref.manvolnum.frag"></src:fragref> <src:fragref linkend="reference.autolabel.frag"></src:fragref> <src:fragref linkend="root.filename.frag"></src:fragref> <src:fragref linkend="rootid.frag"></src:fragref> <src:fragref linkend="runinhead.default.title.end.punct.frag"></src:fragref> <src:fragref linkend="runinhead.title.end.punct.frag"></src:fragref> <src:fragref linkend="section.autolabel.frag"></src:fragref> <src:fragref linkend="section.autolabel.max.depth.frag"></src:fragref> <src:fragref linkend="section.label.includes.component.label.frag"></src:fragref> <src:fragref linkend="segmentedlist.as.table.frag"></src:fragref> <src:fragref linkend="shade.verbatim.frag"></src:fragref> <src:fragref linkend="shade.verbatim.style.frag"></src:fragref> <src:fragref linkend="show.comments.frag"></src:fragref> <src:fragref linkend="show.revisionflag.frag"></src:fragref> <src:fragref linkend="simplesect.in.toc.frag"></src:fragref> <src:fragref linkend="spacing.paras.frag"></src:fragref> <src:fragref linkend="suppress.footer.navigation.frag"></src:fragref> <src:fragref linkend="suppress.header.navigation.frag"></src:fragref> <src:fragref linkend="suppress.navigation.frag"></src:fragref> <src:fragref linkend="table.borders.with.css.frag"></src:fragref> <src:fragref linkend="table.cell.border.color.frag"></src:fragref> <src:fragref linkend="table.cell.border.style.frag"></src:fragref> <src:fragref linkend="table.cell.border.thickness.frag"></src:fragref> <src:fragref linkend="table.footnote.number.format.frag"></src:fragref> <src:fragref linkend="table.footnote.number.symbols.frag"></src:fragref> <src:fragref linkend="table.frame.border.color.frag"></src:fragref> <src:fragref linkend="table.frame.border.style.frag"></src:fragref> <src:fragref linkend="table.frame.border.thickness.frag"></src:fragref> <src:fragref linkend="tablecolumns.extension.frag"></src:fragref> <src:fragref linkend="target.database.document.frag"></src:fragref> <src:fragref linkend="targets.filename.frag"></src:fragref> <src:fragref linkend="tex.math.delims.frag"></src:fragref> <src:fragref linkend="tex.math.file.frag"></src:fragref> <src:fragref linkend="tex.math.in.alt.frag"></src:fragref> <src:fragref linkend="textdata.default.encoding.frag"></src:fragref> <src:fragref linkend="textinsert.extension.frag"></src:fragref> <src:fragref linkend="toc.list.type.frag"></src:fragref> <src:fragref linkend="toc.max.depth.frag"></src:fragref> <src:fragref linkend="toc.section.depth.frag"></src:fragref> <src:fragref linkend="ulink.target.frag"></src:fragref> <src:fragref linkend="use.embed.for.svg.frag"></src:fragref> <src:fragref linkend="use.extensions.frag"></src:fragref> <src:fragref linkend="use.id.as.filename.frag"></src:fragref> <src:fragref linkend="use.local.olink.style.frag"></src:fragref> <src:fragref linkend="use.role.as.xrefstyle.frag"></src:fragref> <src:fragref linkend="use.role.for.mediaobject.frag"></src:fragref> <src:fragref linkend="use.svg.frag"></src:fragref> <src:fragref linkend="variablelist.as.table.frag"></src:fragref> <src:fragref linkend="variablelist.term.break.after.frag"></src:fragref> <src:fragref linkend="variablelist.term.separator.frag"></src:fragref> <src:fragref linkend="webhelp.autolabel.frag"></src:fragref> <src:fragref linkend="webhelp.base.dir.frag"></src:fragref> <src:fragref linkend="webhelp.common.dir.frag"></src:fragref> <src:fragref linkend="webhelp.default.topic.frag"></src:fragref> <src:fragref linkend="webhelp.include.search.tab.frag"></src:fragref> <src:fragref linkend="webhelp.indexer.language.frag"></src:fragref> <src:fragref linkend="webhelp.start.filename.frag"></src:fragref> <src:fragref linkend="webhelp.tree.cookie.id.frag"></src:fragref> <src:fragref linkend="writing.mode.frag"></src:fragref> <src:fragref linkend="xref.label-page.separator.frag"></src:fragref> <src:fragref linkend="xref.label-title.separator.frag"></src:fragref> <src:fragref linkend="xref.title-page.separator.frag"></src:fragref> <src:fragref linkend="xref.with.number.and.title.frag"></src:fragref> <src:fragref linkend="link.to.self.for.mediaobject.frag"></src:fragref> </xsl:stylesheet>
    conky-1.12.2/doc/docbook-xml/html/param.xsl000066400000000000000000000500601404127277500205110ustar00rootroot00000000000000 .png images/ /* ====================================================================== Annotations */ div.annotation-list { visibility: hidden; } div.annotation-nocss { position: absolute; visibility: hidden; } div.annotation-popup { position: absolute; z-index: 4; visibility: hidden; padding: 0px; margin: 2px; border-style: solid; border-width: 1px; width: 200px; background-color: white; } div.annotation-title { padding: 1px; font-weight: bold; border-bottom-style: solid; border-bottom-width: 1px; color: white; background-color: black; } div.annotation-body { padding: 2px; } div.annotation-body p { margin-top: 0px; padding-top: 0px; } div.annotation-close { position: absolute; top: 2px; right: 2px; } http://docbook.sourceforge.net/release/images/annot-close.png http://docbook.sourceforge.net/release/images/annot-open.png http://docbook.sourceforge.net/release/script/AnchorPosition.js http://docbook.sourceforge.net/release/script/PopupWindow.js A . . http://docbook.sourceforge.net/release/bibliography/bibliography.xml normal 60 .png 15 images/callouts/ 10 10102 no 1 left before all docbook.css.xml no images/draft.png ::= #F5DCB3 com.example.help DocBook Online Help Sample Example provider 1 1 0 1 figure before example before equation before table before procedure before task before kr appendix toc,title article/appendix nop article toc,title book toc,title,figure,table,example,equation chapter toc,title part toc,title preface toc,title qandadiv toc qandaset toc reference toc,title sect1 toc sect2 toc sect3 toc sect4 toc sect5 toc section toc set toc,title no .html copyright text/javascript text/css alias.h User1 User2 htmlhelp.chm iso-8859-1 toc.hhc 5 index.hhk htmlhelp.hhp Main context.h basic no no yes iso-8859-1 en 5 3 HTML.manifest → + .gif images/ 1 6in no replace 0 I 90 10 ; . number I index . .!?: 8 0 #E0E0E0 0 solid 1px 0.5pt a solid 1px 0.5pt olinkdb.xml target.db tex-math-equations.tex dl 8 2 _top 0 , 0 docs ../common/ index.html 1 en index.html writing-mode : conky-1.12.2/doc/docbook-xml/html/pi.xml000066400000000000000000001173031404127277500200170ustar00rootroot00000000000000 HTML Processing Instruction Reference $Id: pi.xsl 9848 2014-01-17 22:44:39Z bobstayton $ Introduction This is generated reference documentation for all user-specifiable processing instructions (PIs) in the DocBook XSL stylesheets for HTML output. You add these PIs at particular points in a document to cause specific “exceptions†to formatting/output behavior. To make global changes in formatting/output behavior across an entire document, it’s better to do it by setting an appropriate stylesheet parameter (if there is one). dbhtml_background-color Sets background color for an image dbhtml background-color="color" Description Use the dbhtml background-color PI before or after an image (graphic, inlinegraphic, imagedata, or videodata element) as a sibling to the element, to set a background color for the image. Parameters background-color="color" An HTML color value Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Background color dbhtml_bgcolor Sets background color on a CALS table row or table cell dbhtml bgcolor="color" Description Use the dbhtml bgcolor PI as child of a CALS table row or cell to set a background color for that table row or cell. Parameters bgcolor="color" An HTML color value Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Cell background color dbhtml_cellpadding Specifies cellpadding in CALS table or qandaset output dbhtml cellpadding="number" Description Use the dbhtml cellpadding PI as a child of a CALS table or qandaset to specify the value for the HTML cellpadding attribute in the output HTML table. Parameters cellpadding="number" Specifies the cellpadding Related Global Parameters html.cellpadding Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Cell spacing and cell padding, Q and A formatting dbhtml_cellspacing Specifies cellspacing in CALS table or qandaset output dbhtml cellspacing="number" Description Use the dbhtml cellspacing PI as a child of a CALS table or qandaset to specify the value for the HTML cellspacing attribute in the output HTML table. Parameters cellspacing="number" Specifies the cellspacing Related Global Parameters html.cellspacing Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Cell spacing and cell padding, Q and A formatting dbhtml_class Set value of the class attribute for a CALS table row dbhtml class="name" Description Use the dbhtml class PI as a child of a row to specify a class attribute and value in the HTML output for that row. Parameters class="name" Specifies the class name Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Table styles in HTML output dbhtml_dir Specifies a directory name in which to write files dbhtml dir="path" Description When chunking output, use the dbhtml dir PI as a child of a chunk source to cause the output of that chunk to be written to the specified directory; also, use it as a child of a mediaobject to specify a directory into which any long-description files for that mediaobject will be written. The output directory specification is inherited by all chunks of the descendants of the element. If descendants need to go to a different directory, then add another dbhtml dir processing instruction as a child of the source element for that chunk, and specify the path relative to the ancestor path. For example, to put most chunk files into shared but one chapter into exception at the same level, use: <book> <?dbhtml dir="shared"?> ... <chapter> <?dbhtml dir="../exception"?> </chapter> </book> Parameters dir="path" Specifies the pathname for the directory Related Global Parameters base.dir Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> dbhtml dir processing instruction dbhtml_filename Specifies a filename for a chunk dbhtml filename="filename" Description When chunking output, use the dbhtml filename PI as a child of a chunk source to specify a filename for the output file for that chunk. Include the filename suffix. You cannot include a directory path in the filename value, or your links may not work. Add a dbhtml dir processing instruction to specify the output directory. You can also combine the two specifications in one processing instruction: dbhtml dir="mydir" filename="myfile.html". Parameters filename="path" Specifies the filename for the file Related Global Parameters use.id.as.filename Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> dbhtml filenames dbhtml_funcsynopsis-style Specifies presentation style for a funcsynopsis dbhtml funcsynopsis-style="kr"|"ansi" Description Use the dbhtml funcsynopsis-style PI as a child of a funcsynopsis or anywhere within a funcsynopsis to control the presentation style for output of all funcprototype instances within that funcsynopsis. Parameters funcsynopsis-style="kr" Displays funcprototype output in K&R style funcsynopsis-style="ansi" Displays funcprototype output in ANSI style Related Global Parameters funcsynopsis.style dbhtml_img.src.path Specifies a path to the location of an image file dbhtml img.src.path="path" Description Use the dbhtml img.src.path PI before or after an image (graphic, inlinegraphic, imagedata, or videodata element) as a sibling to the element, to specify a path to the location of the image; in HTML output, the value specified for the img.src.path attribute is prepended to the filename. Parameters img.src.path="path" Specifies the pathname to prepend to the name of the image file Related Global Parameters img.src.path Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Using fileref dbhtml_label-width Specifies the label width for a qandaset dbhtml label-width="width" Description Use the dbhtml label-width PI as a child of a qandaset to specify the width of labels. Parameters label-width="width" Specifies the label width (including units) Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Q and A formatting dbhtml_linenumbering.everyNth Specifies interval for line numbers in verbatims dbhtml linenumbering.everyNth="N" Description Use the dbhtml linenumbering.everyNth PI as a child of a “verbatim†element – programlisting, screen, synopsis — to specify the interval at which lines are numbered. Parameters linenumbering.everyNth="N" Specifies numbering interval; a number is output before every Nth line Related Global Parameters linenumbering.everyNth Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Line numbering dbhtml_linenumbering.separator Specifies separator text for line numbers in verbatims dbhtml linenumbering.separator="text" Description Use the dbhtml linenumbering.separator PI as a child of a “verbatim†element – programlisting, screen, synopsis — to specify the separator text output between the line numbers and content. Parameters linenumbering.separator="text" Specifies the text (zero or more characters) Related Global Parameters linenumbering.separator Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Line numbering dbhtml_linenumbering.width Specifies width for line numbers in verbatims dbhtml linenumbering.width="width" Description Use the dbhtml linenumbering.width PI as a child of a “verbatim†element – programlisting, screen, synopsis — to specify the width set aside for line numbers. Parameters linenumbering.width="width" Specifies the width (inluding units) Related Global Parameters linenumbering.width Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Line numbering dbhtml_list-presentation Specifies presentation style for a variablelist or segmentedlist dbhtml list-presentation="list"|"table" Description Use the dbhtml list-presentation PI as a child of a variablelist or segmentedlist to control the presentation style for the list (to cause it, for example, to be displayed as a table). Parameters list-presentation="list" Displays the list as a list list-presentation="table" Displays the list as a table Related Global Parameters variablelist.as.table segmentedlist.as.table Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Variable list formatting in HTML dbhtml_list-width Specifies the width of a variablelist or simplelist dbhtml list-width="width" Description Use the dbhtml list-width PI as a child of a variablelist or a simplelist presented as a table, to specify the output width. Parameters list-width="width" Specifies the output width (including units) Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Variable list formatting in HTML dbhtml_row-height Specifies the height for a CALS table row dbhtml row-height="height" Description Use the dbhtml row-height PI as a child of a row to specify the height of the row. Parameters row-height="height" Specifies the row height (including units) Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Row height dbhtml_start (obsolete) Sets the starting number on an ordered list dbhtml start="character" Description This PI is obsolete. The intent of this PI was to provide a means for setting a specific starting number for an ordered list. Instead of this PI, set a value for the override attribute on the first listitem in the list; that will have the same effect as what this PI was intended for. Parameters start="character" Specifies the character to use as the starting number; use 0-9, a-z, A-Z, or lowercase or uppercase Roman numerals Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> List starting number dbhtml_stop-chunking Do not chunk any descendants of this element. dbhtml stop-chunking Description When generating chunked HTML output, adding this PI as the child of an element that contains elements that would normally be generated on separate pages if generating chunked output causes chunking to stop at this point. No descendants of the current element will be split into new HTML pages: <section> <title>Configuring pencil</title> <?dbhtml stop-chunking?> ... </section> Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Chunking into multiple HTML files dbhtml_table-summary Specifies summary for CALS table, variablelist, segmentedlist, or qandaset output dbhtml table-summary="text" Description Use the dbhtml table-summary PI as a child of a CALS table, variablelist, segmentedlist, or qandaset to specify the text for the HTML summary attribute in the output HTML table. Parameters table-summary="text" Specifies the summary text (zero or more characters) Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Variable list formatting in HTML, Table summary text dbhtml_table-width Specifies the width for a CALS table dbhtml table-width="width" Description Use the dbhtml table-width PI as a child of a CALS table to specify the width of the table in output. Parameters table-width="width" Specifies the table width (including units or as a percentage) Related Global Parameters default.table.width Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Table width dbhtml_term-presentation Sets character formatting for terms in a variablelist dbhtml term-presentation="bold"|"italic"|"bold-italic" Description Use the dbhtml term-presentation PI as a child of a variablelist to set character formatting for the term output of the list. Parameters term-presentation="bold" Specifies that terms are displayed in bold term-presentation="italic" Specifies that terms are displayed in italic term-presentation="bold-italic" Specifies that terms are displayed in bold-italic Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Variable list formatting in HTML dbhtml_term-separator Specifies separator text among terms in a varlistentry dbhtml term-separator="text" Description Use the dbhtml term-separator PI as a child of a variablelist to specify the separator text among term instances. Parameters term-separator="text" Specifies the text (zero or more characters) Related Global Parameters variablelist.term.separator Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Variable list formatting in HTML dbhtml_term-width Specifies the term width for a variablelist dbhtml term-width="width" Description Use the dbhtml term-width PI as a child of a variablelist to specify the width for term output. Parameters term-width="width" Specifies the term width (including units) Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Variable list formatting in HTML dbhtml_toc Specifies whether a TOC should be generated for a qandaset dbhtml toc="0"|"1" Description Use the dbhtml toc PI as a child of a qandaset to specify whether a table of contents (TOC) is generated for the qandaset. Parameters toc="0" If zero, no TOC is generated toc="1" If 1 (or any non-zero value), a TOC is generated Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Q and A list of questions, Q and A formatting dbcmdlist Generates a hyperlinked list of commands dbcmdlist Description Use the dbcmdlist PI as the child of any element (for example, refsynopsisdiv) containing multiple cmdsynopsis instances; a hyperlinked navigational “command list†will be generated at the top of output for that element, enabling users to quickly jump to each command synopsis. Parameters [No parameters] dbfunclist Generates a hyperlinked list of functions dbfunclist Description Use the dbfunclist PI as the child of any element (for example, refsynopsisdiv) containing multiple funcsynopsis instances; a hyperlinked navigational “function list†will be generated at the top of output for that element, enabling users to quickly jump to to each function synopsis. Parameters [No parameters] dbhtml-include_href Copies an external well-formed HTML/XML file into current doc dbhtml-include href="URI" Description Use the dbhtml-include href PI anywhere in a document to cause the contents of the file referenced by the href pseudo-attribute to be copied/inserted “as is†into your HTML output at the point in document order where the PI occurs in the source. The referenced file may contain plain text (as long as it is “wrapped†in an html element — see the note below) or markup in any arbitrary vocabulary, including HTML — but it must conform to XML well-formedness constraints (because the feature in XSLT 1.0 for opening external files, the document() function, can only handle files that meet XML well-formedness constraints). Among other things, XML well-formedness constraints require a document to have a single root element. So if the content you want to include is plain text or is markup that does not have a single root element, wrap the content in an html element. The stylesheets will strip out that surrounding html “wrapper†when they find it, leaving just the content you want to insert. Parameters href="URI" Specifies the URI for the file to include; the URI can be, for example, a remote http: URI, or a local filesystem file: URI Related Global Parameters textinsert.extension Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Inserting external HTML code, External code files dbhh Sets topic name and topic id for context-sensitive HTML Help dbhh topicname="name" topicid="id" Description Use the dbhh PI as a child of components that should be used as targets for context-sensitive help requests. Parameters topicname="name" Specifies a unique string constant that identifies a help topic topicid="id" Specifies a unique integer value for the topicname string Related Information in <link xlink:href="http://www.sagehill.net/docbookxsl/">DocBook XSL: The Complete Guide</link> Context-sensitive help conky-1.12.2/doc/docbook-xml/html/pi.xsl000066400000000000000000001377641404127277500200420ustar00rootroot00000000000000 HTML Processing Instruction Reference $Id: pi.xsl 9848 2014-01-17 22:44:39Z bobstayton $ Introduction This is generated reference documentation for all user-specifiable processing instructions (PIs) in the DocBook XSL stylesheets for HTML output. You add these PIs at particular points in a document to cause specific “exceptions†to formatting/output behavior. To make global changes in formatting/output behavior across an entire document, it’s better to do it by setting an appropriate stylesheet parameter (if there is one). Sets background color for an image Use the dbhtml background-color PI before or after an image (graphic, inlinegraphic, imagedata, or videodata element) as a sibling to the element, to set a background color for the image. dbhtml background-color="color" background-color="color" An HTML color value Background color Sets background color on a CALS table row or table cell Use the dbhtml bgcolor PI as child of a CALS table row or cell to set a background color for that table row or cell. dbhtml bgcolor="color" bgcolor="color" An HTML color value Cell background color Specifies cellpadding in CALS table or qandaset output Use the dbhtml cellpadding PI as a child of a CALS table or qandaset to specify the value for the HTML cellpadding attribute in the output HTML table. dbhtml cellpadding="number" cellpadding="number" Specifies the cellpadding html.cellpadding Cell spacing and cell padding, Q and A formatting Specifies cellspacing in CALS table or qandaset output Use the dbhtml cellspacing PI as a child of a CALS table or qandaset to specify the value for the HTML cellspacing attribute in the output HTML table. dbhtml cellspacing="number" cellspacing="number" Specifies the cellspacing html.cellspacing Cell spacing and cell padding, Q and A formatting Set value of the class attribute for a CALS table row Use the dbhtml class PI as a child of a row to specify a class attribute and value in the HTML output for that row. dbhtml class="name" class="name" Specifies the class name Table styles in HTML output Specifies a directory name in which to write files When chunking output, use the dbhtml dir PI as a child of a chunk source to cause the output of that chunk to be written to the specified directory; also, use it as a child of a mediaobject to specify a directory into which any long-description files for that mediaobject will be written. The output directory specification is inherited by all chunks of the descendants of the element. If descendants need to go to a different directory, then add another dbhtml dir processing instruction as a child of the source element for that chunk, and specify the path relative to the ancestor path. For example, to put most chunk files into shared but one chapter into exception at the same level, use: ... ]]> dbhtml dir="path" dir="path" Specifies the pathname for the directory base.dir dbhtml dir processing instruction Specifies a filename for a chunk When chunking output, use the dbhtml filename PI as a child of a chunk source to specify a filename for the output file for that chunk. Include the filename suffix. You cannot include a directory path in the filename value, or your links may not work. Add a dbhtml dir processing instruction to specify the output directory. You can also combine the two specifications in one processing instruction: dbhtml dir="mydir" filename="myfile.html". dbhtml filename="filename" filename="path" Specifies the filename for the file use.id.as.filename dbhtml filenames Specifies presentation style for a funcsynopsis Use the dbhtml funcsynopsis-style PI as a child of a funcsynopsis or anywhere within a funcsynopsis to control the presentation style for output of all funcprototype instances within that funcsynopsis. dbhtml funcsynopsis-style="kr"|"ansi" funcsynopsis-style="kr" Displays funcprototype output in K&R style funcsynopsis-style="ansi" Displays funcprototype output in ANSI style funcsynopsis.style Specifies a path to the location of an image file Use the dbhtml img.src.path PI before or after an image (graphic, inlinegraphic, imagedata, or videodata element) as a sibling to the element, to specify a path to the location of the image; in HTML output, the value specified for the img.src.path attribute is prepended to the filename. dbhtml img.src.path="path" img.src.path="path" Specifies the pathname to prepend to the name of the image file img.src.path Using fileref Specifies the label width for a qandaset Use the dbhtml label-width PI as a child of a qandaset to specify the width of labels. dbhtml label-width="width" label-width="width" Specifies the label width (including units) Q and A formatting Specifies interval for line numbers in verbatims Use the dbhtml linenumbering.everyNth PI as a child of a “verbatim†element – programlisting, screen, synopsis — to specify the interval at which lines are numbered. dbhtml linenumbering.everyNth="N" linenumbering.everyNth="N" Specifies numbering interval; a number is output before every Nth line linenumbering.everyNth Line numbering Specifies separator text for line numbers in verbatims Use the dbhtml linenumbering.separator PI as a child of a “verbatim†element – programlisting, screen, synopsis — to specify the separator text output between the line numbers and content. dbhtml linenumbering.separator="text" linenumbering.separator="text" Specifies the text (zero or more characters) linenumbering.separator Line numbering Specifies width for line numbers in verbatims Use the dbhtml linenumbering.width PI as a child of a “verbatim†element – programlisting, screen, synopsis — to specify the width set aside for line numbers. dbhtml linenumbering.width="width" linenumbering.width="width" Specifies the width (inluding units) linenumbering.width Line numbering Specifies presentation style for a variablelist or segmentedlist Use the dbhtml list-presentation PI as a child of a variablelist or segmentedlist to control the presentation style for the list (to cause it, for example, to be displayed as a table). dbhtml list-presentation="list"|"table" list-presentation="list" Displays the list as a list list-presentation="table" Displays the list as a table variablelist.as.table segmentedlist.as.table Variable list formatting in HTML Specifies the width of a variablelist or simplelist Use the dbhtml list-width PI as a child of a variablelist or a simplelist presented as a table, to specify the output width. dbhtml list-width="width" list-width="width" Specifies the output width (including units) Variable list formatting in HTML Specifies the height for a CALS table row Use the dbhtml row-height PI as a child of a row to specify the height of the row. dbhtml row-height="height" row-height="height" Specifies the row height (including units) Row height (obsolete) Sets the starting number on an ordered list This PI is obsolete. The intent of this PI was to provide a means for setting a specific starting number for an ordered list. Instead of this PI, set a value for the override attribute on the first listitem in the list; that will have the same effect as what this PI was intended for. dbhtml start="character" start="character" Specifies the character to use as the starting number; use 0-9, a-z, A-Z, or lowercase or uppercase Roman numerals List starting number Do not chunk any descendants of this element. When generating chunked HTML output, adding this PI as the child of an element that contains elements that would normally be generated on separate pages if generating chunked output causes chunking to stop at this point. No descendants of the current element will be split into new HTML pages: Configuring pencil ...
    ]]> dbhtml stop-chunking Chunking into multiple HTML files Specifies summary for CALS table, variablelist, segmentedlist, or qandaset output Use the dbhtml table-summary PI as a child of a CALS table, variablelist, segmentedlist, or qandaset to specify the text for the HTML summary attribute in the output HTML table. dbhtml table-summary="text" table-summary="text" Specifies the summary text (zero or more characters) Variable list formatting in HTML, Table summary text Specifies the width for a CALS table Use the dbhtml table-width PI as a child of a CALS table to specify the width of the table in output. dbhtml table-width="width" table-width="width" Specifies the table width (including units or as a percentage) default.table.width Table width Sets character formatting for terms in a variablelist Use the dbhtml term-presentation PI as a child of a variablelist to set character formatting for the term output of the list. dbhtml term-presentation="bold"|"italic"|"bold-italic" term-presentation="bold" Specifies that terms are displayed in bold term-presentation="italic" Specifies that terms are displayed in italic term-presentation="bold-italic" Specifies that terms are displayed in bold-italic Variable list formatting in HTML Specifies separator text among terms in a varlistentry Use the dbhtml term-separator PI as a child of a variablelist to specify the separator text among term instances. dbhtml term-separator="text" term-separator="text" Specifies the text (zero or more characters) variablelist.term.separator Variable list formatting in HTML Specifies the term width for a variablelist Use the dbhtml term-width PI as a child of a variablelist to specify the width for term output. dbhtml term-width="width" term-width="width" Specifies the term width (including units) Variable list formatting in HTML Specifies whether a TOC should be generated for a qandaset Use the dbhtml toc PI as a child of a qandaset to specify whether a table of contents (TOC) is generated for the qandaset. dbhtml toc="0"|"1" toc="0" If zero, no TOC is generated toc="1" If 1 (or any non-zero value), a TOC is generated Q and A list of questions, Q and A formatting Generates a hyperlinked list of commands Use the dbcmdlist PI as the child of any element (for example, refsynopsisdiv) containing multiple cmdsynopsis instances; a hyperlinked navigational “command list†will be generated at the top of output for that element, enabling users to quickly jump to each command synopsis. dbcmdlist [No parameters] No cmdsynopsis elements matched dbcmdlist PI, perhaps it's nested too deep?
    Generates a hyperlinked list of functions Use the dbfunclist PI as the child of any element (for example, refsynopsisdiv) containing multiple funcsynopsis instances; a hyperlinked navigational “function list†will be generated at the top of output for that element, enabling users to quickly jump to to each function synopsis. dbfunclist [No parameters] No funcsynopsis elements matched dbfunclist PI, perhaps it's nested too deep?
    Copies an external well-formed HTML/XML file into current doc Use the dbhtml-include href PI anywhere in a document to cause the contents of the file referenced by the href pseudo-attribute to be copied/inserted “as is†into your HTML output at the point in document order where the PI occurs in the source. The referenced file may contain plain text (as long as it is “wrapped†in an html element — see the note below) or markup in any arbitrary vocabulary, including HTML — but it must conform to XML well-formedness constraints (because the feature in XSLT 1.0 for opening external files, the document() function, can only handle files that meet XML well-formedness constraints). Among other things, XML well-formedness constraints require a document to have a single root element. So if the content you want to include is plain text or is markup that does not have a single root element, wrap the content in an html element. The stylesheets will strip out that surrounding html “wrapper†when they find it, leaving just the content you want to insert. dbhtml-include href="URI" href="URI" Specifies the URI for the file to include; the URI can be, for example, a remote http: URI, or a local filesystem file: URI textinsert.extension Inserting external HTML code, External code files href ERROR: dbhtml-include processing instruction href has no content. ERROR: dbhtml-include processing instruction has missing or empty href value. Sets topic name and topic id for context-sensitive HTML Help Use the dbhh PI as a child of components that should be used as targets for context-sensitive help requests. dbhh topicname="name" topicid="id" topicname="name" Specifies a unique string constant that identifies a help topic topicid="id" Specifies a unique integer value for the topicname string Context-sensitive help filename
    #
    #
    / / conky-1.12.2/doc/docbook-xml/html/profile-chunk-code.xsl000066400000000000000000000623701404127277500230760ustar00rootroot00000000000000 se bk ar pr ch ap pt rn re co s bi go ix si to chunk-filename-error- Notenamesp. cutstripped namespace before processing ID ' ' not found in document. conky-1.12.2/doc/docbook-xml/html/profile-chunk.xsl000066400000000000000000000045221404127277500221610ustar00rootroot00000000000000 conky-1.12.2/doc/docbook-xml/html/profile-docbook.xsl000066400000000000000000000500151404127277500224670ustar00rootroot00000000000000 Element in namespace ' ' encountered in , but no template matches. < > </ > white black #0000FF #840084 #0000FF rtl <xsl:copy-of select="$title"/> Notenamesp. cutstripped namespace before processing ID ' ' not found in document. 0 conky-1.12.2/doc/docbook-xml/html/profile-onechunk.xsl000066400000000000000000000027001404127277500226570ustar00rootroot00000000000000 1 # conky-1.12.2/doc/docbook-xml/html/publishers.xsl000066400000000000000000000063641404127277500216010ustar00rootroot00000000000000
    font-style:italic; font-weight:bold;
    font-style:italic; font-weight:bold; [ ]
    width: 100%; display: table; margin-top: 5px;
    display: table-row;
    display: table-cell; width: 15%
    display: table-cell; width: 85%
    conky-1.12.2/doc/docbook-xml/html/qandaset.xsl000066400000000000000000000364361404127277500212240ustar00rootroot00000000000000

    width: 100%; 1%
    conky-1.12.2/doc/docbook-xml/html/refentry.xsl000066400000000000000000000233001404127277500212440ustar00rootroot00000000000000


    ( )

    , em-dash em-dash :

    0 1 6

    conky-1.12.2/doc/docbook-xml/html/sections.xsl000066400000000000000000000555031404127277500212470ustar00rootroot00000000000000 1 2 3 4 5 6 clear: both 1 1 2 3 4 5 6 conky-1.12.2/doc/docbook-xml/html/synop.xsl000066400000000000000000001451571404127277500205750ustar00rootroot00000000000000 ]>



    ( )   ( )
        
        
        
      


    ( ) ; ... ) ; , ) ;
    ;
    ( ) Function synopsis cellspacing: 0; cellpadding: 0;
     
     
    ( ) ;   ... ) ;   , ) ;       ; ( ) ;

    ( void) ; ... ) ; , ) ; ( ) Function synopsis cellspacing: 0; cellpadding: 0;
     
     
    ( void) ;   ... ) ;   , ) ; ( ) java Unrecognized language on :
        
        
        
        
           extends
          
          
            
        
    implements
        
    throws  {
    }
    ,   , , ,    ;     void  0 ,
     
       ( )
        throws 
    ;
        
        
        
        
          : 
          
          
            
        
    implements
        
    throws  {
    }
    ,   , , ,    ;     void  ,    ( )
        throws 
    ;
        
        
        interface 
        
        
          : 
          
          
            
        
    implements
        
    throws  {
    }
    ,   , , ,    ;     void  ,    ( )
        raises( )
    ;
        
        
        package 
        
        ;
        
    @ISA = ( );
    ,   , , ,    ;     void  , sub { ... };
    conky-1.12.2/doc/docbook-xml/html/table.xsl000066400000000000000000001256361404127277500205140ustar00rootroot00000000000000 0   border- : ; border- -width: ; border- -style: ; border- -color: ; Error: CALS tables must specify the number of columns. 100% border-collapse: collapse; border-collapse: collapse; border-collapse: collapse; border-collapse: collapse; border-collapse: collapse; border: none; border-collapse: collapse; 0 1 100% No convertLength function available. No adjustColumnWidths function available.
    Warning: overlapped row contains content! This row intentionally left blank 1 1 th th th td 0   1 : 0: 0 : 1 1 1 1
    conky-1.12.2/doc/docbook-xml/html/task.xsl000066400000000000000000000046111404127277500203540ustar00rootroot00000000000000 before
    conky-1.12.2/doc/docbook-xml/html/titlepage.templates.xml000066400000000000000000000455311404127277500233650ustar00rootroot00000000000000 <subtitle/> <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> <hr/> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> <t:titlepage t:element="set" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title/> <subtitle/> <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> <hr/> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> <t:titlepage t:element="book" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title/> <subtitle/> <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> <hr/> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> <t:titlepage t:element="part" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title t:force="1" t:named-template="division.title" param:node="ancestor-or-self::part[1]"/> <subtitle/> <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <t:titlepage t:element="partintro" t:wrapper="div"> <t:titlepage-content t:side="recto"> <title/> <subtitle/> <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> <t:titlepage t:element="reference" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title/> <subtitle/> <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> <hr/> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> <t:titlepage t:element="refentry" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <!-- uncomment this if you want refentry titlepages <title t:force="1" t:named-template="refentry.title" param:node="ancestor-or-self::refentry[1]"/> --> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator/> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> <t:titlepage t:element="dedication" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title t:force="1" t:named-template="component.title" param:node="ancestor-or-self::dedication[1]"/> <subtitle/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> <t:titlepage t:element="acknowledgements" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title t:force="1" t:named-template="component.title" param:node="ancestor-or-self::acknowledgements[1]"/> <subtitle/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> <t:titlepage t:element="preface" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title/> <subtitle/> <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> <t:titlepage t:element="chapter" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title/> <subtitle/> <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <t:titlepage t:element="topic" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title/> <subtitle/> <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> <t:titlepage t:element="appendix" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title/> <subtitle/> <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> <t:titlepage t:element="section" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title/> <subtitle/> <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> <xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <t:titlepage t:element="sect1" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title/> <subtitle/> <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> <xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <t:titlepage t:element="sect2" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title/> <subtitle/> <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> <xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <t:titlepage t:element="sect3" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title/> <subtitle/> <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> <xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <t:titlepage t:element="sect4" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title/> <subtitle/> <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> <xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <t:titlepage t:element="sect5" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title/> <subtitle/> <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> <xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <t:titlepage t:element="simplesect" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title/> <subtitle/> <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> <xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> <t:titlepage t:element="dialogue" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title/> <subtitle/> <!-- <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> --> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> <xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> <t:titlepage t:element="drama" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title/> <subtitle/> <!-- <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> --> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> <xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> <t:titlepage t:element="poetry" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title/> <subtitle/> <!-- <corpauthor/> <authorgroup/> <author/> <othercredit/> <releaseinfo/> <copyright/> <legalnotice/> <pubdate/> <revision/> <revhistory/> <abstract/> --> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> <xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> <t:titlepage t:element="bibliography" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title t:force="1" t:named-template="component.title" param:node="ancestor-or-self::bibliography[1]"/> <subtitle/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> <t:titlepage t:element="glossary" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title t:force="1" t:named-template="component.title" param:node="ancestor-or-self::glossary[1]"/> <subtitle/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> <t:titlepage t:element="index" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title t:force="1" t:named-template="component.title" param:node="ancestor-or-self::index[1]"/> <subtitle/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> <t:titlepage t:element="setindex" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title t:force="1" t:named-template="component.title" param:node="ancestor-or-self::setindex[1]"/> <subtitle/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> <t:titlepage t:element="sidebar" t:wrapper="div" class="titlepage"> <t:titlepage-content t:side="recto"> <title t:force="1" t:named-template="formal.object.heading" param:node="ancestor-or-self::sidebar[1]"/> <subtitle/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> <!-- ==================================================================== --> </t:templates> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������conky-1.12.2/doc/docbook-xml/html/titlepage.templates.xsl�������������������������������������������0000664�0000000�0000000�00000577502�14041272775�0023403�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" version="1.0" exclude-result-prefixes="exsl"> <!-- This stylesheet was created by template/titlepage.xsl--> <xsl:template name="article.titlepage.recto"> <xsl:choose> <xsl:when test="articleinfo/title"> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/title"/> </xsl:when> <xsl:when test="artheader/title"> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/title"/> </xsl:when> <xsl:when test="info/title"> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/title"/> </xsl:when> <xsl:when test="title"> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="title"/> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="articleinfo/subtitle"> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/subtitle"/> </xsl:when> <xsl:when test="artheader/subtitle"> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/corpauthor"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/corpauthor"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/corpauthor"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/authorgroup"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/authorgroup"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/authorgroup"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/author"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/author"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/author"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/othercredit"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/othercredit"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/othercredit"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/releaseinfo"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/releaseinfo"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/releaseinfo"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/copyright"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/copyright"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/copyright"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/legalnotice"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/legalnotice"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/legalnotice"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/pubdate"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/pubdate"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/pubdate"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/revision"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/revision"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/revision"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/revhistory"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/revhistory"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/revhistory"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/abstract"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/abstract"/> <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/abstract"/> </xsl:template> <xsl:template name="article.titlepage.verso"> </xsl:template> <xsl:template name="article.titlepage.separator"><hr/> </xsl:template> <xsl:template name="article.titlepage.before.recto"> </xsl:template> <xsl:template name="article.titlepage.before.verso"> </xsl:template> <xsl:template name="article.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="article.titlepage.before.recto"/> <xsl:call-template name="article.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="article.titlepage.before.verso"/> <xsl:call-template name="article.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="article.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="article.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="article.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="title" mode="article.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="article.titlepage.recto.style"> <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="subtitle" mode="article.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="article.titlepage.recto.style"> <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="corpauthor" mode="article.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="article.titlepage.recto.style"> <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="authorgroup" mode="article.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="article.titlepage.recto.style"> <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="author" mode="article.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="article.titlepage.recto.style"> <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="othercredit" mode="article.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="article.titlepage.recto.style"> <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="releaseinfo" mode="article.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="article.titlepage.recto.style"> <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="copyright" mode="article.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="article.titlepage.recto.style"> <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="legalnotice" mode="article.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="article.titlepage.recto.style"> <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="pubdate" mode="article.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="article.titlepage.recto.style"> <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revision" mode="article.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="article.titlepage.recto.style"> <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revhistory" mode="article.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="article.titlepage.recto.style"> <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="abstract" mode="article.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="article.titlepage.recto.style"> <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="set.titlepage.recto"> <xsl:choose> <xsl:when test="setinfo/title"> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/title"/> </xsl:when> <xsl:when test="info/title"> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/title"/> </xsl:when> <xsl:when test="title"> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="title"/> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="setinfo/subtitle"> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/corpauthor"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/corpauthor"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/authorgroup"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/authorgroup"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/author"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/author"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/othercredit"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/othercredit"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/releaseinfo"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/releaseinfo"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/copyright"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/copyright"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/legalnotice"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/legalnotice"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/pubdate"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/pubdate"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/revision"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/revision"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/revhistory"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/revhistory"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/abstract"/> <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/abstract"/> </xsl:template> <xsl:template name="set.titlepage.verso"> </xsl:template> <xsl:template name="set.titlepage.separator"><hr/> </xsl:template> <xsl:template name="set.titlepage.before.recto"> </xsl:template> <xsl:template name="set.titlepage.before.verso"> </xsl:template> <xsl:template name="set.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="set.titlepage.before.recto"/> <xsl:call-template name="set.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="set.titlepage.before.verso"/> <xsl:call-template name="set.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="set.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="set.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="set.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="title" mode="set.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="set.titlepage.recto.style"> <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="subtitle" mode="set.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="set.titlepage.recto.style"> <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="corpauthor" mode="set.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="set.titlepage.recto.style"> <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="authorgroup" mode="set.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="set.titlepage.recto.style"> <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="author" mode="set.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="set.titlepage.recto.style"> <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="othercredit" mode="set.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="set.titlepage.recto.style"> <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="releaseinfo" mode="set.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="set.titlepage.recto.style"> <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="copyright" mode="set.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="set.titlepage.recto.style"> <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="legalnotice" mode="set.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="set.titlepage.recto.style"> <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="pubdate" mode="set.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="set.titlepage.recto.style"> <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revision" mode="set.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="set.titlepage.recto.style"> <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revhistory" mode="set.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="set.titlepage.recto.style"> <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="abstract" mode="set.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="set.titlepage.recto.style"> <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="book.titlepage.recto"> <xsl:choose> <xsl:when test="bookinfo/title"> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/title"/> </xsl:when> <xsl:when test="info/title"> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/title"/> </xsl:when> <xsl:when test="title"> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="title"/> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="bookinfo/subtitle"> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/corpauthor"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/corpauthor"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/authorgroup"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/authorgroup"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/author"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/author"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/othercredit"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/othercredit"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/releaseinfo"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/releaseinfo"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/copyright"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/copyright"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/legalnotice"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/legalnotice"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/pubdate"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/pubdate"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/revision"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/revision"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/revhistory"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/revhistory"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/abstract"/> <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/abstract"/> </xsl:template> <xsl:template name="book.titlepage.verso"> </xsl:template> <xsl:template name="book.titlepage.separator"><hr/> </xsl:template> <xsl:template name="book.titlepage.before.recto"> </xsl:template> <xsl:template name="book.titlepage.before.verso"> </xsl:template> <xsl:template name="book.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="book.titlepage.before.recto"/> <xsl:call-template name="book.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="book.titlepage.before.verso"/> <xsl:call-template name="book.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="book.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="book.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="book.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="title" mode="book.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="book.titlepage.recto.style"> <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="subtitle" mode="book.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="book.titlepage.recto.style"> <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="corpauthor" mode="book.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="book.titlepage.recto.style"> <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="authorgroup" mode="book.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="book.titlepage.recto.style"> <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="author" mode="book.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="book.titlepage.recto.style"> <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="othercredit" mode="book.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="book.titlepage.recto.style"> <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="releaseinfo" mode="book.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="book.titlepage.recto.style"> <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="copyright" mode="book.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="book.titlepage.recto.style"> <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="legalnotice" mode="book.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="book.titlepage.recto.style"> <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="pubdate" mode="book.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="book.titlepage.recto.style"> <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revision" mode="book.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="book.titlepage.recto.style"> <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revhistory" mode="book.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="book.titlepage.recto.style"> <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="abstract" mode="book.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="book.titlepage.recto.style"> <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="part.titlepage.recto"> <div xsl:use-attribute-sets="part.titlepage.recto.style"> <xsl:call-template name="division.title"> <xsl:with-param name="node" select="ancestor-or-self::part[1]"/> </xsl:call-template></div> <xsl:choose> <xsl:when test="partinfo/subtitle"> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/subtitle"/> </xsl:when> <xsl:when test="docinfo/subtitle"> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/corpauthor"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/corpauthor"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/corpauthor"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/authorgroup"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/authorgroup"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/authorgroup"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/author"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/author"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/author"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/othercredit"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/othercredit"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/othercredit"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/releaseinfo"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/releaseinfo"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/copyright"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/copyright"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/copyright"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/legalnotice"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/legalnotice"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/legalnotice"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/pubdate"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/pubdate"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/pubdate"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/revision"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/revision"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/revision"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/revhistory"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/revhistory"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/revhistory"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/abstract"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/abstract"/> <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/abstract"/> </xsl:template> <xsl:template name="part.titlepage.verso"> </xsl:template> <xsl:template name="part.titlepage.separator"> </xsl:template> <xsl:template name="part.titlepage.before.recto"> </xsl:template> <xsl:template name="part.titlepage.before.verso"> </xsl:template> <xsl:template name="part.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="part.titlepage.before.recto"/> <xsl:call-template name="part.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="part.titlepage.before.verso"/> <xsl:call-template name="part.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="part.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="part.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="part.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="subtitle" mode="part.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="part.titlepage.recto.style"> <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="corpauthor" mode="part.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="part.titlepage.recto.style"> <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="authorgroup" mode="part.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="part.titlepage.recto.style"> <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="author" mode="part.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="part.titlepage.recto.style"> <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="othercredit" mode="part.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="part.titlepage.recto.style"> <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="releaseinfo" mode="part.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="part.titlepage.recto.style"> <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="copyright" mode="part.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="part.titlepage.recto.style"> <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="legalnotice" mode="part.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="part.titlepage.recto.style"> <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="pubdate" mode="part.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="part.titlepage.recto.style"> <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revision" mode="part.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="part.titlepage.recto.style"> <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revhistory" mode="part.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="part.titlepage.recto.style"> <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="abstract" mode="part.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="part.titlepage.recto.style"> <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="partintro.titlepage.recto"> <xsl:choose> <xsl:when test="partintroinfo/title"> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/title"/> </xsl:when> <xsl:when test="docinfo/title"> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/title"/> </xsl:when> <xsl:when test="info/title"> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/title"/> </xsl:when> <xsl:when test="title"> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="title"/> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="partintroinfo/subtitle"> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/subtitle"/> </xsl:when> <xsl:when test="docinfo/subtitle"> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/corpauthor"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/corpauthor"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/corpauthor"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/authorgroup"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/authorgroup"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/authorgroup"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/author"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/author"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/author"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/othercredit"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/othercredit"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/othercredit"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/releaseinfo"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/releaseinfo"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/copyright"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/copyright"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/copyright"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/legalnotice"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/legalnotice"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/legalnotice"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/pubdate"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/pubdate"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/pubdate"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/revision"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/revision"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/revision"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/revhistory"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/revhistory"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/revhistory"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/abstract"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/abstract"/> <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/abstract"/> </xsl:template> <xsl:template name="partintro.titlepage.verso"> </xsl:template> <xsl:template name="partintro.titlepage.separator"> </xsl:template> <xsl:template name="partintro.titlepage.before.recto"> </xsl:template> <xsl:template name="partintro.titlepage.before.verso"> </xsl:template> <xsl:template name="partintro.titlepage"> <div> <xsl:variable name="recto.content"> <xsl:call-template name="partintro.titlepage.before.recto"/> <xsl:call-template name="partintro.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="partintro.titlepage.before.verso"/> <xsl:call-template name="partintro.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="partintro.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="partintro.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="partintro.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="title" mode="partintro.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="subtitle" mode="partintro.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="corpauthor" mode="partintro.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="authorgroup" mode="partintro.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="author" mode="partintro.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="othercredit" mode="partintro.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="releaseinfo" mode="partintro.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="copyright" mode="partintro.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="legalnotice" mode="partintro.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="pubdate" mode="partintro.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revision" mode="partintro.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revhistory" mode="partintro.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="abstract" mode="partintro.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="reference.titlepage.recto"> <xsl:choose> <xsl:when test="referenceinfo/title"> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/title"/> </xsl:when> <xsl:when test="docinfo/title"> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/title"/> </xsl:when> <xsl:when test="info/title"> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/title"/> </xsl:when> <xsl:when test="title"> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="title"/> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="referenceinfo/subtitle"> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/subtitle"/> </xsl:when> <xsl:when test="docinfo/subtitle"> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/corpauthor"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/corpauthor"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/corpauthor"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/authorgroup"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/authorgroup"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/authorgroup"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/author"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/author"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/author"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/othercredit"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/othercredit"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/othercredit"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/releaseinfo"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/releaseinfo"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/copyright"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/copyright"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/copyright"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/legalnotice"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/legalnotice"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/legalnotice"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/pubdate"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/pubdate"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/pubdate"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/revision"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/revision"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/revision"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/revhistory"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/revhistory"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/revhistory"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/abstract"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/abstract"/> <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/abstract"/> </xsl:template> <xsl:template name="reference.titlepage.verso"> </xsl:template> <xsl:template name="reference.titlepage.separator"><hr/> </xsl:template> <xsl:template name="reference.titlepage.before.recto"> </xsl:template> <xsl:template name="reference.titlepage.before.verso"> </xsl:template> <xsl:template name="reference.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="reference.titlepage.before.recto"/> <xsl:call-template name="reference.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="reference.titlepage.before.verso"/> <xsl:call-template name="reference.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="reference.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="reference.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="reference.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="title" mode="reference.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="reference.titlepage.recto.style"> <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="subtitle" mode="reference.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="reference.titlepage.recto.style"> <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="corpauthor" mode="reference.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="reference.titlepage.recto.style"> <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="authorgroup" mode="reference.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="reference.titlepage.recto.style"> <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="author" mode="reference.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="reference.titlepage.recto.style"> <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="othercredit" mode="reference.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="reference.titlepage.recto.style"> <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="releaseinfo" mode="reference.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="reference.titlepage.recto.style"> <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="copyright" mode="reference.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="reference.titlepage.recto.style"> <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="legalnotice" mode="reference.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="reference.titlepage.recto.style"> <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="pubdate" mode="reference.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="reference.titlepage.recto.style"> <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revision" mode="reference.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="reference.titlepage.recto.style"> <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revhistory" mode="reference.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="reference.titlepage.recto.style"> <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="abstract" mode="reference.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="reference.titlepage.recto.style"> <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="refentry.titlepage.recto"> </xsl:template> <xsl:template name="refentry.titlepage.verso"> </xsl:template> <xsl:template name="refentry.titlepage.separator"> </xsl:template> <xsl:template name="refentry.titlepage.before.recto"> </xsl:template> <xsl:template name="refentry.titlepage.before.verso"> </xsl:template> <xsl:template name="refentry.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="refentry.titlepage.before.recto"/> <xsl:call-template name="refentry.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="refentry.titlepage.before.verso"/> <xsl:call-template name="refentry.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="refentry.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="refentry.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="refentry.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template name="dedication.titlepage.recto"> <div xsl:use-attribute-sets="dedication.titlepage.recto.style"> <xsl:call-template name="component.title"> <xsl:with-param name="node" select="ancestor-or-self::dedication[1]"/> </xsl:call-template></div> <xsl:choose> <xsl:when test="dedicationinfo/subtitle"> <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="dedicationinfo/subtitle"/> </xsl:when> <xsl:when test="docinfo/subtitle"> <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="docinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> </xsl:template> <xsl:template name="dedication.titlepage.verso"> </xsl:template> <xsl:template name="dedication.titlepage.separator"> </xsl:template> <xsl:template name="dedication.titlepage.before.recto"> </xsl:template> <xsl:template name="dedication.titlepage.before.verso"> </xsl:template> <xsl:template name="dedication.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="dedication.titlepage.before.recto"/> <xsl:call-template name="dedication.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="dedication.titlepage.before.verso"/> <xsl:call-template name="dedication.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="dedication.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="dedication.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="dedication.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="subtitle" mode="dedication.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="dedication.titlepage.recto.style"> <xsl:apply-templates select="." mode="dedication.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="acknowledgements.titlepage.recto"> <div xsl:use-attribute-sets="acknowledgements.titlepage.recto.style"> <xsl:call-template name="component.title"> <xsl:with-param name="node" select="ancestor-or-self::acknowledgements[1]"/> </xsl:call-template></div> <xsl:choose> <xsl:when test="acknowledgementsinfo/subtitle"> <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="acknowledgementsinfo/subtitle"/> </xsl:when> <xsl:when test="docinfo/subtitle"> <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="docinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> </xsl:template> <xsl:template name="acknowledgements.titlepage.verso"> </xsl:template> <xsl:template name="acknowledgements.titlepage.separator"> </xsl:template> <xsl:template name="acknowledgements.titlepage.before.recto"> </xsl:template> <xsl:template name="acknowledgements.titlepage.before.verso"> </xsl:template> <xsl:template name="acknowledgements.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="acknowledgements.titlepage.before.recto"/> <xsl:call-template name="acknowledgements.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="acknowledgements.titlepage.before.verso"/> <xsl:call-template name="acknowledgements.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="acknowledgements.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="acknowledgements.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="acknowledgements.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="subtitle" mode="acknowledgements.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="acknowledgements.titlepage.recto.style"> <xsl:apply-templates select="." mode="acknowledgements.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="preface.titlepage.recto"> <xsl:choose> <xsl:when test="prefaceinfo/title"> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/title"/> </xsl:when> <xsl:when test="docinfo/title"> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/title"/> </xsl:when> <xsl:when test="info/title"> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/title"/> </xsl:when> <xsl:when test="title"> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="title"/> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="prefaceinfo/subtitle"> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/subtitle"/> </xsl:when> <xsl:when test="docinfo/subtitle"> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/corpauthor"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/corpauthor"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/corpauthor"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/authorgroup"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/authorgroup"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/authorgroup"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/author"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/author"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/author"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/othercredit"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/othercredit"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/othercredit"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/releaseinfo"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/releaseinfo"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/copyright"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/copyright"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/copyright"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/legalnotice"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/legalnotice"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/legalnotice"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/pubdate"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/pubdate"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/pubdate"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/revision"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/revision"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/revision"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/revhistory"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/revhistory"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/revhistory"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/abstract"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/abstract"/> <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/abstract"/> </xsl:template> <xsl:template name="preface.titlepage.verso"> </xsl:template> <xsl:template name="preface.titlepage.separator"> </xsl:template> <xsl:template name="preface.titlepage.before.recto"> </xsl:template> <xsl:template name="preface.titlepage.before.verso"> </xsl:template> <xsl:template name="preface.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="preface.titlepage.before.recto"/> <xsl:call-template name="preface.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="preface.titlepage.before.verso"/> <xsl:call-template name="preface.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="preface.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="preface.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="preface.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="title" mode="preface.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="preface.titlepage.recto.style"> <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="subtitle" mode="preface.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="preface.titlepage.recto.style"> <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="corpauthor" mode="preface.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="preface.titlepage.recto.style"> <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="authorgroup" mode="preface.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="preface.titlepage.recto.style"> <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="author" mode="preface.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="preface.titlepage.recto.style"> <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="othercredit" mode="preface.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="preface.titlepage.recto.style"> <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="releaseinfo" mode="preface.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="preface.titlepage.recto.style"> <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="copyright" mode="preface.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="preface.titlepage.recto.style"> <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="legalnotice" mode="preface.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="preface.titlepage.recto.style"> <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="pubdate" mode="preface.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="preface.titlepage.recto.style"> <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revision" mode="preface.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="preface.titlepage.recto.style"> <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revhistory" mode="preface.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="preface.titlepage.recto.style"> <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="abstract" mode="preface.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="preface.titlepage.recto.style"> <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="chapter.titlepage.recto"> <xsl:choose> <xsl:when test="chapterinfo/title"> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/title"/> </xsl:when> <xsl:when test="docinfo/title"> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/title"/> </xsl:when> <xsl:when test="info/title"> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/title"/> </xsl:when> <xsl:when test="title"> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="title"/> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="chapterinfo/subtitle"> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/subtitle"/> </xsl:when> <xsl:when test="docinfo/subtitle"> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/corpauthor"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/corpauthor"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/corpauthor"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/authorgroup"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/authorgroup"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/authorgroup"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/author"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/author"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/author"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/othercredit"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/othercredit"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/othercredit"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/releaseinfo"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/releaseinfo"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/copyright"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/copyright"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/copyright"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/legalnotice"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/legalnotice"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/legalnotice"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/pubdate"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/pubdate"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/pubdate"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/revision"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/revision"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/revision"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/revhistory"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/revhistory"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/revhistory"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/abstract"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/abstract"/> <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/abstract"/> </xsl:template> <xsl:template name="chapter.titlepage.verso"> </xsl:template> <xsl:template name="chapter.titlepage.separator"> </xsl:template> <xsl:template name="chapter.titlepage.before.recto"> </xsl:template> <xsl:template name="chapter.titlepage.before.verso"> </xsl:template> <xsl:template name="chapter.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="chapter.titlepage.before.recto"/> <xsl:call-template name="chapter.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="chapter.titlepage.before.verso"/> <xsl:call-template name="chapter.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="chapter.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="chapter.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="chapter.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="title" mode="chapter.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="subtitle" mode="chapter.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="corpauthor" mode="chapter.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="authorgroup" mode="chapter.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="author" mode="chapter.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="othercredit" mode="chapter.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="releaseinfo" mode="chapter.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="copyright" mode="chapter.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="legalnotice" mode="chapter.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="pubdate" mode="chapter.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revision" mode="chapter.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revhistory" mode="chapter.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="abstract" mode="chapter.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="topic.titlepage.recto"> <xsl:choose> <xsl:when test="topicinfo/title"> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/title"/> </xsl:when> <xsl:when test="info/title"> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/title"/> </xsl:when> <xsl:when test="title"> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="title"/> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="topicinfo/subtitle"> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/corpauthor"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/corpauthor"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/authorgroup"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/authorgroup"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/author"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/author"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/othercredit"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/othercredit"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/releaseinfo"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/releaseinfo"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/copyright"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/copyright"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/legalnotice"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/legalnotice"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/pubdate"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/pubdate"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/revision"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/revision"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/revhistory"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/revhistory"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/abstract"/> <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/abstract"/> </xsl:template> <xsl:template name="topic.titlepage.verso"> </xsl:template> <xsl:template name="topic.titlepage.separator"> </xsl:template> <xsl:template name="topic.titlepage.before.recto"> </xsl:template> <xsl:template name="topic.titlepage.before.verso"> </xsl:template> <xsl:template name="topic.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="topic.titlepage.before.recto"/> <xsl:call-template name="topic.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="topic.titlepage.before.verso"/> <xsl:call-template name="topic.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="topic.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="topic.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="topic.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="title" mode="topic.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="topic.titlepage.recto.style"> <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="subtitle" mode="topic.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="topic.titlepage.recto.style"> <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="corpauthor" mode="topic.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="topic.titlepage.recto.style"> <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="authorgroup" mode="topic.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="topic.titlepage.recto.style"> <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="author" mode="topic.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="topic.titlepage.recto.style"> <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="othercredit" mode="topic.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="topic.titlepage.recto.style"> <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="releaseinfo" mode="topic.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="topic.titlepage.recto.style"> <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="copyright" mode="topic.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="topic.titlepage.recto.style"> <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="legalnotice" mode="topic.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="topic.titlepage.recto.style"> <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="pubdate" mode="topic.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="topic.titlepage.recto.style"> <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revision" mode="topic.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="topic.titlepage.recto.style"> <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revhistory" mode="topic.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="topic.titlepage.recto.style"> <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="abstract" mode="topic.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="topic.titlepage.recto.style"> <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="appendix.titlepage.recto"> <xsl:choose> <xsl:when test="appendixinfo/title"> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/title"/> </xsl:when> <xsl:when test="docinfo/title"> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/title"/> </xsl:when> <xsl:when test="info/title"> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/title"/> </xsl:when> <xsl:when test="title"> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="title"/> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="appendixinfo/subtitle"> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/subtitle"/> </xsl:when> <xsl:when test="docinfo/subtitle"> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/corpauthor"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/corpauthor"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/corpauthor"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/authorgroup"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/authorgroup"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/authorgroup"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/author"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/author"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/author"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/othercredit"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/othercredit"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/othercredit"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/releaseinfo"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/releaseinfo"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/copyright"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/copyright"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/copyright"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/legalnotice"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/legalnotice"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/legalnotice"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/pubdate"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/pubdate"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/pubdate"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/revision"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/revision"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/revision"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/revhistory"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/revhistory"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/revhistory"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/abstract"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/abstract"/> <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/abstract"/> </xsl:template> <xsl:template name="appendix.titlepage.verso"> </xsl:template> <xsl:template name="appendix.titlepage.separator"> </xsl:template> <xsl:template name="appendix.titlepage.before.recto"> </xsl:template> <xsl:template name="appendix.titlepage.before.verso"> </xsl:template> <xsl:template name="appendix.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="appendix.titlepage.before.recto"/> <xsl:call-template name="appendix.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="appendix.titlepage.before.verso"/> <xsl:call-template name="appendix.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="appendix.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="appendix.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="appendix.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="title" mode="appendix.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="subtitle" mode="appendix.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="corpauthor" mode="appendix.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="authorgroup" mode="appendix.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="author" mode="appendix.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="othercredit" mode="appendix.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="releaseinfo" mode="appendix.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="copyright" mode="appendix.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="legalnotice" mode="appendix.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="pubdate" mode="appendix.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revision" mode="appendix.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revhistory" mode="appendix.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="abstract" mode="appendix.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="section.titlepage.recto"> <xsl:choose> <xsl:when test="sectioninfo/title"> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/title"/> </xsl:when> <xsl:when test="info/title"> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/title"/> </xsl:when> <xsl:when test="title"> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="title"/> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="sectioninfo/subtitle"> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/corpauthor"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/corpauthor"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/authorgroup"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/authorgroup"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/author"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/author"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/othercredit"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/othercredit"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/releaseinfo"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/releaseinfo"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/copyright"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/copyright"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/legalnotice"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/legalnotice"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/pubdate"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/pubdate"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/revision"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/revision"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/revhistory"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/revhistory"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/abstract"/> <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/abstract"/> </xsl:template> <xsl:template name="section.titlepage.verso"> </xsl:template> <xsl:template name="section.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </xsl:template> <xsl:template name="section.titlepage.before.recto"> </xsl:template> <xsl:template name="section.titlepage.before.verso"> </xsl:template> <xsl:template name="section.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="section.titlepage.before.recto"/> <xsl:call-template name="section.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="section.titlepage.before.verso"/> <xsl:call-template name="section.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="section.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="section.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="section.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="title" mode="section.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="section.titlepage.recto.style"> <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="subtitle" mode="section.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="section.titlepage.recto.style"> <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="corpauthor" mode="section.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="section.titlepage.recto.style"> <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="authorgroup" mode="section.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="section.titlepage.recto.style"> <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="author" mode="section.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="section.titlepage.recto.style"> <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="othercredit" mode="section.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="section.titlepage.recto.style"> <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="releaseinfo" mode="section.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="section.titlepage.recto.style"> <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="copyright" mode="section.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="section.titlepage.recto.style"> <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="legalnotice" mode="section.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="section.titlepage.recto.style"> <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="pubdate" mode="section.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="section.titlepage.recto.style"> <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revision" mode="section.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="section.titlepage.recto.style"> <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revhistory" mode="section.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="section.titlepage.recto.style"> <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="abstract" mode="section.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="section.titlepage.recto.style"> <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="sect1.titlepage.recto"> <xsl:choose> <xsl:when test="sect1info/title"> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/title"/> </xsl:when> <xsl:when test="info/title"> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/title"/> </xsl:when> <xsl:when test="title"> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="title"/> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="sect1info/subtitle"> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/corpauthor"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/corpauthor"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/authorgroup"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/authorgroup"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/author"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/author"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/othercredit"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/othercredit"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/releaseinfo"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/releaseinfo"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/copyright"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/copyright"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/legalnotice"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/legalnotice"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/pubdate"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/pubdate"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/revision"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/revision"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/revhistory"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/revhistory"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/abstract"/> <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/abstract"/> </xsl:template> <xsl:template name="sect1.titlepage.verso"> </xsl:template> <xsl:template name="sect1.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </xsl:template> <xsl:template name="sect1.titlepage.before.recto"> </xsl:template> <xsl:template name="sect1.titlepage.before.verso"> </xsl:template> <xsl:template name="sect1.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="sect1.titlepage.before.recto"/> <xsl:call-template name="sect1.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="sect1.titlepage.before.verso"/> <xsl:call-template name="sect1.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="sect1.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="sect1.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="sect1.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="title" mode="sect1.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="subtitle" mode="sect1.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="corpauthor" mode="sect1.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="authorgroup" mode="sect1.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="author" mode="sect1.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="othercredit" mode="sect1.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="releaseinfo" mode="sect1.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="copyright" mode="sect1.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="legalnotice" mode="sect1.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="pubdate" mode="sect1.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revision" mode="sect1.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revhistory" mode="sect1.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="abstract" mode="sect1.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="sect2.titlepage.recto"> <xsl:choose> <xsl:when test="sect2info/title"> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/title"/> </xsl:when> <xsl:when test="info/title"> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/title"/> </xsl:when> <xsl:when test="title"> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="title"/> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="sect2info/subtitle"> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/corpauthor"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/corpauthor"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/authorgroup"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/authorgroup"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/author"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/author"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/othercredit"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/othercredit"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/releaseinfo"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/releaseinfo"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/copyright"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/copyright"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/legalnotice"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/legalnotice"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/pubdate"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/pubdate"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/revision"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/revision"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/revhistory"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/revhistory"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/abstract"/> <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/abstract"/> </xsl:template> <xsl:template name="sect2.titlepage.verso"> </xsl:template> <xsl:template name="sect2.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </xsl:template> <xsl:template name="sect2.titlepage.before.recto"> </xsl:template> <xsl:template name="sect2.titlepage.before.verso"> </xsl:template> <xsl:template name="sect2.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="sect2.titlepage.before.recto"/> <xsl:call-template name="sect2.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="sect2.titlepage.before.verso"/> <xsl:call-template name="sect2.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="sect2.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="sect2.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="sect2.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="title" mode="sect2.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="subtitle" mode="sect2.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="corpauthor" mode="sect2.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="authorgroup" mode="sect2.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="author" mode="sect2.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="othercredit" mode="sect2.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="releaseinfo" mode="sect2.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="copyright" mode="sect2.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="legalnotice" mode="sect2.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="pubdate" mode="sect2.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revision" mode="sect2.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revhistory" mode="sect2.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="abstract" mode="sect2.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="sect3.titlepage.recto"> <xsl:choose> <xsl:when test="sect3info/title"> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/title"/> </xsl:when> <xsl:when test="info/title"> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/title"/> </xsl:when> <xsl:when test="title"> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="title"/> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="sect3info/subtitle"> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/corpauthor"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/corpauthor"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/authorgroup"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/authorgroup"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/author"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/author"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/othercredit"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/othercredit"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/releaseinfo"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/releaseinfo"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/copyright"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/copyright"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/legalnotice"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/legalnotice"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/pubdate"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/pubdate"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/revision"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/revision"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/revhistory"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/revhistory"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/abstract"/> <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/abstract"/> </xsl:template> <xsl:template name="sect3.titlepage.verso"> </xsl:template> <xsl:template name="sect3.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </xsl:template> <xsl:template name="sect3.titlepage.before.recto"> </xsl:template> <xsl:template name="sect3.titlepage.before.verso"> </xsl:template> <xsl:template name="sect3.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="sect3.titlepage.before.recto"/> <xsl:call-template name="sect3.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="sect3.titlepage.before.verso"/> <xsl:call-template name="sect3.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="sect3.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="sect3.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="sect3.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="title" mode="sect3.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="subtitle" mode="sect3.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="corpauthor" mode="sect3.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="authorgroup" mode="sect3.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="author" mode="sect3.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="othercredit" mode="sect3.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="releaseinfo" mode="sect3.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="copyright" mode="sect3.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="legalnotice" mode="sect3.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="pubdate" mode="sect3.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revision" mode="sect3.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revhistory" mode="sect3.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="abstract" mode="sect3.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="sect4.titlepage.recto"> <xsl:choose> <xsl:when test="sect4info/title"> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/title"/> </xsl:when> <xsl:when test="info/title"> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/title"/> </xsl:when> <xsl:when test="title"> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="title"/> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="sect4info/subtitle"> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/corpauthor"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/corpauthor"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/authorgroup"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/authorgroup"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/author"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/author"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/othercredit"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/othercredit"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/releaseinfo"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/releaseinfo"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/copyright"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/copyright"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/legalnotice"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/legalnotice"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/pubdate"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/pubdate"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/revision"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/revision"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/revhistory"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/revhistory"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/abstract"/> <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/abstract"/> </xsl:template> <xsl:template name="sect4.titlepage.verso"> </xsl:template> <xsl:template name="sect4.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </xsl:template> <xsl:template name="sect4.titlepage.before.recto"> </xsl:template> <xsl:template name="sect4.titlepage.before.verso"> </xsl:template> <xsl:template name="sect4.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="sect4.titlepage.before.recto"/> <xsl:call-template name="sect4.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="sect4.titlepage.before.verso"/> <xsl:call-template name="sect4.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="sect4.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="sect4.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="sect4.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="title" mode="sect4.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="subtitle" mode="sect4.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="corpauthor" mode="sect4.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="authorgroup" mode="sect4.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="author" mode="sect4.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="othercredit" mode="sect4.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="releaseinfo" mode="sect4.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="copyright" mode="sect4.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="legalnotice" mode="sect4.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="pubdate" mode="sect4.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revision" mode="sect4.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revhistory" mode="sect4.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="abstract" mode="sect4.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="sect5.titlepage.recto"> <xsl:choose> <xsl:when test="sect5info/title"> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/title"/> </xsl:when> <xsl:when test="info/title"> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/title"/> </xsl:when> <xsl:when test="title"> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="title"/> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="sect5info/subtitle"> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/corpauthor"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/corpauthor"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/authorgroup"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/authorgroup"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/author"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/author"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/othercredit"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/othercredit"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/releaseinfo"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/releaseinfo"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/copyright"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/copyright"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/legalnotice"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/legalnotice"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/pubdate"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/pubdate"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/revision"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/revision"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/revhistory"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/revhistory"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/abstract"/> <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/abstract"/> </xsl:template> <xsl:template name="sect5.titlepage.verso"> </xsl:template> <xsl:template name="sect5.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </xsl:template> <xsl:template name="sect5.titlepage.before.recto"> </xsl:template> <xsl:template name="sect5.titlepage.before.verso"> </xsl:template> <xsl:template name="sect5.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="sect5.titlepage.before.recto"/> <xsl:call-template name="sect5.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="sect5.titlepage.before.verso"/> <xsl:call-template name="sect5.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="sect5.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="sect5.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="sect5.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="title" mode="sect5.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="subtitle" mode="sect5.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="corpauthor" mode="sect5.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="authorgroup" mode="sect5.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="author" mode="sect5.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="othercredit" mode="sect5.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="releaseinfo" mode="sect5.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="copyright" mode="sect5.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="legalnotice" mode="sect5.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="pubdate" mode="sect5.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revision" mode="sect5.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revhistory" mode="sect5.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="abstract" mode="sect5.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="simplesect.titlepage.recto"> <xsl:choose> <xsl:when test="simplesectinfo/title"> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/title"/> </xsl:when> <xsl:when test="docinfo/title"> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/title"/> </xsl:when> <xsl:when test="info/title"> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/title"/> </xsl:when> <xsl:when test="title"> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="title"/> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="simplesectinfo/subtitle"> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/subtitle"/> </xsl:when> <xsl:when test="docinfo/subtitle"> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/corpauthor"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/corpauthor"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/corpauthor"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/authorgroup"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/authorgroup"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/authorgroup"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/author"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/author"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/author"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/othercredit"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/othercredit"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/othercredit"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/releaseinfo"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/releaseinfo"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/copyright"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/copyright"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/copyright"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/legalnotice"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/legalnotice"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/legalnotice"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/pubdate"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/pubdate"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/pubdate"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/revision"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/revision"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/revision"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/revhistory"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/revhistory"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/revhistory"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/abstract"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/abstract"/> <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/abstract"/> </xsl:template> <xsl:template name="simplesect.titlepage.verso"> </xsl:template> <xsl:template name="simplesect.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </xsl:template> <xsl:template name="simplesect.titlepage.before.recto"> </xsl:template> <xsl:template name="simplesect.titlepage.before.verso"> </xsl:template> <xsl:template name="simplesect.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="simplesect.titlepage.before.recto"/> <xsl:call-template name="simplesect.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="simplesect.titlepage.before.verso"/> <xsl:call-template name="simplesect.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="simplesect.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="simplesect.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="simplesect.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="title" mode="simplesect.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="subtitle" mode="simplesect.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="corpauthor" mode="simplesect.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="authorgroup" mode="simplesect.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="author" mode="simplesect.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="othercredit" mode="simplesect.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="releaseinfo" mode="simplesect.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="copyright" mode="simplesect.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="legalnotice" mode="simplesect.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="pubdate" mode="simplesect.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revision" mode="simplesect.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="revhistory" mode="simplesect.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="abstract" mode="simplesect.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="dialogue.titlepage.recto"> <xsl:choose> <xsl:when test="dialogueinfo/title"> <xsl:apply-templates mode="dialogue.titlepage.recto.auto.mode" select="dialogueinfo/title"/> </xsl:when> <xsl:when test="docinfo/title"> <xsl:apply-templates mode="dialogue.titlepage.recto.auto.mode" select="docinfo/title"/> </xsl:when> <xsl:when test="info/title"> <xsl:apply-templates mode="dialogue.titlepage.recto.auto.mode" select="info/title"/> </xsl:when> <xsl:when test="title"> <xsl:apply-templates mode="dialogue.titlepage.recto.auto.mode" select="title"/> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="dialogueinfo/subtitle"> <xsl:apply-templates mode="dialogue.titlepage.recto.auto.mode" select="dialogueinfo/subtitle"/> </xsl:when> <xsl:when test="docinfo/subtitle"> <xsl:apply-templates mode="dialogue.titlepage.recto.auto.mode" select="docinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="dialogue.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="dialogue.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> </xsl:template> <xsl:template name="dialogue.titlepage.verso"> </xsl:template> <xsl:template name="dialogue.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </xsl:template> <xsl:template name="dialogue.titlepage.before.recto"> </xsl:template> <xsl:template name="dialogue.titlepage.before.verso"> </xsl:template> <xsl:template name="dialogue.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="dialogue.titlepage.before.recto"/> <xsl:call-template name="dialogue.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="dialogue.titlepage.before.verso"/> <xsl:call-template name="dialogue.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="dialogue.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="dialogue.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="dialogue.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="title" mode="dialogue.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="dialogue.titlepage.recto.style"> <xsl:apply-templates select="." mode="dialogue.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="subtitle" mode="dialogue.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="dialogue.titlepage.recto.style"> <xsl:apply-templates select="." mode="dialogue.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="drama.titlepage.recto"> <xsl:choose> <xsl:when test="dramainfo/title"> <xsl:apply-templates mode="drama.titlepage.recto.auto.mode" select="dramainfo/title"/> </xsl:when> <xsl:when test="docinfo/title"> <xsl:apply-templates mode="drama.titlepage.recto.auto.mode" select="docinfo/title"/> </xsl:when> <xsl:when test="info/title"> <xsl:apply-templates mode="drama.titlepage.recto.auto.mode" select="info/title"/> </xsl:when> <xsl:when test="title"> <xsl:apply-templates mode="drama.titlepage.recto.auto.mode" select="title"/> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="dramainfo/subtitle"> <xsl:apply-templates mode="drama.titlepage.recto.auto.mode" select="dramainfo/subtitle"/> </xsl:when> <xsl:when test="docinfo/subtitle"> <xsl:apply-templates mode="drama.titlepage.recto.auto.mode" select="docinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="drama.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="drama.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> </xsl:template> <xsl:template name="drama.titlepage.verso"> </xsl:template> <xsl:template name="drama.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </xsl:template> <xsl:template name="drama.titlepage.before.recto"> </xsl:template> <xsl:template name="drama.titlepage.before.verso"> </xsl:template> <xsl:template name="drama.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="drama.titlepage.before.recto"/> <xsl:call-template name="drama.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="drama.titlepage.before.verso"/> <xsl:call-template name="drama.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="drama.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="drama.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="drama.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="title" mode="drama.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="drama.titlepage.recto.style"> <xsl:apply-templates select="." mode="drama.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="subtitle" mode="drama.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="drama.titlepage.recto.style"> <xsl:apply-templates select="." mode="drama.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="poetry.titlepage.recto"> <xsl:choose> <xsl:when test="poetryinfo/title"> <xsl:apply-templates mode="poetry.titlepage.recto.auto.mode" select="poetryinfo/title"/> </xsl:when> <xsl:when test="docinfo/title"> <xsl:apply-templates mode="poetry.titlepage.recto.auto.mode" select="docinfo/title"/> </xsl:when> <xsl:when test="info/title"> <xsl:apply-templates mode="poetry.titlepage.recto.auto.mode" select="info/title"/> </xsl:when> <xsl:when test="title"> <xsl:apply-templates mode="poetry.titlepage.recto.auto.mode" select="title"/> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="poetryinfo/subtitle"> <xsl:apply-templates mode="poetry.titlepage.recto.auto.mode" select="poetryinfo/subtitle"/> </xsl:when> <xsl:when test="docinfo/subtitle"> <xsl:apply-templates mode="poetry.titlepage.recto.auto.mode" select="docinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="poetry.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="poetry.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> </xsl:template> <xsl:template name="poetry.titlepage.verso"> </xsl:template> <xsl:template name="poetry.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> </xsl:template> <xsl:template name="poetry.titlepage.before.recto"> </xsl:template> <xsl:template name="poetry.titlepage.before.verso"> </xsl:template> <xsl:template name="poetry.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="poetry.titlepage.before.recto"/> <xsl:call-template name="poetry.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="poetry.titlepage.before.verso"/> <xsl:call-template name="poetry.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="poetry.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="poetry.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="poetry.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="title" mode="poetry.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="poetry.titlepage.recto.style"> <xsl:apply-templates select="." mode="poetry.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template match="subtitle" mode="poetry.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="poetry.titlepage.recto.style"> <xsl:apply-templates select="." mode="poetry.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="bibliography.titlepage.recto"> <div xsl:use-attribute-sets="bibliography.titlepage.recto.style"> <xsl:call-template name="component.title"> <xsl:with-param name="node" select="ancestor-or-self::bibliography[1]"/> </xsl:call-template></div> <xsl:choose> <xsl:when test="bibliographyinfo/subtitle"> <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="bibliographyinfo/subtitle"/> </xsl:when> <xsl:when test="docinfo/subtitle"> <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="docinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> </xsl:template> <xsl:template name="bibliography.titlepage.verso"> </xsl:template> <xsl:template name="bibliography.titlepage.separator"> </xsl:template> <xsl:template name="bibliography.titlepage.before.recto"> </xsl:template> <xsl:template name="bibliography.titlepage.before.verso"> </xsl:template> <xsl:template name="bibliography.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="bibliography.titlepage.before.recto"/> <xsl:call-template name="bibliography.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="bibliography.titlepage.before.verso"/> <xsl:call-template name="bibliography.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="bibliography.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="bibliography.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="bibliography.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="subtitle" mode="bibliography.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="bibliography.titlepage.recto.style"> <xsl:apply-templates select="." mode="bibliography.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="glossary.titlepage.recto"> <div xsl:use-attribute-sets="glossary.titlepage.recto.style"> <xsl:call-template name="component.title"> <xsl:with-param name="node" select="ancestor-or-self::glossary[1]"/> </xsl:call-template></div> <xsl:choose> <xsl:when test="glossaryinfo/subtitle"> <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="glossaryinfo/subtitle"/> </xsl:when> <xsl:when test="docinfo/subtitle"> <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="docinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> </xsl:template> <xsl:template name="glossary.titlepage.verso"> </xsl:template> <xsl:template name="glossary.titlepage.separator"> </xsl:template> <xsl:template name="glossary.titlepage.before.recto"> </xsl:template> <xsl:template name="glossary.titlepage.before.verso"> </xsl:template> <xsl:template name="glossary.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="glossary.titlepage.before.recto"/> <xsl:call-template name="glossary.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="glossary.titlepage.before.verso"/> <xsl:call-template name="glossary.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="glossary.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="glossary.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="glossary.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="subtitle" mode="glossary.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="glossary.titlepage.recto.style"> <xsl:apply-templates select="." mode="glossary.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="index.titlepage.recto"> <div xsl:use-attribute-sets="index.titlepage.recto.style"> <xsl:call-template name="component.title"> <xsl:with-param name="node" select="ancestor-or-self::index[1]"/> </xsl:call-template></div> <xsl:choose> <xsl:when test="indexinfo/subtitle"> <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="indexinfo/subtitle"/> </xsl:when> <xsl:when test="docinfo/subtitle"> <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="docinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> </xsl:template> <xsl:template name="index.titlepage.verso"> </xsl:template> <xsl:template name="index.titlepage.separator"> </xsl:template> <xsl:template name="index.titlepage.before.recto"> </xsl:template> <xsl:template name="index.titlepage.before.verso"> </xsl:template> <xsl:template name="index.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="index.titlepage.before.recto"/> <xsl:call-template name="index.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="index.titlepage.before.verso"/> <xsl:call-template name="index.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="index.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="index.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="index.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="subtitle" mode="index.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="index.titlepage.recto.style"> <xsl:apply-templates select="." mode="index.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="setindex.titlepage.recto"> <div xsl:use-attribute-sets="setindex.titlepage.recto.style"> <xsl:call-template name="component.title"> <xsl:with-param name="node" select="ancestor-or-self::setindex[1]"/> </xsl:call-template></div> <xsl:choose> <xsl:when test="setindexinfo/subtitle"> <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="setindexinfo/subtitle"/> </xsl:when> <xsl:when test="docinfo/subtitle"> <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="docinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> </xsl:template> <xsl:template name="setindex.titlepage.verso"> </xsl:template> <xsl:template name="setindex.titlepage.separator"> </xsl:template> <xsl:template name="setindex.titlepage.before.recto"> </xsl:template> <xsl:template name="setindex.titlepage.before.verso"> </xsl:template> <xsl:template name="setindex.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="setindex.titlepage.before.recto"/> <xsl:call-template name="setindex.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="setindex.titlepage.before.verso"/> <xsl:call-template name="setindex.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="setindex.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="setindex.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="setindex.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="subtitle" mode="setindex.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="setindex.titlepage.recto.style"> <xsl:apply-templates select="." mode="setindex.titlepage.recto.mode"/> </div> </xsl:template> <xsl:template name="sidebar.titlepage.recto"> <div xsl:use-attribute-sets="sidebar.titlepage.recto.style"> <xsl:call-template name="formal.object.heading"> <xsl:with-param name="node" select="ancestor-or-self::sidebar[1]"/> </xsl:call-template></div> <xsl:choose> <xsl:when test="sidebarinfo/subtitle"> <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="sidebarinfo/subtitle"/> </xsl:when> <xsl:when test="docinfo/subtitle"> <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="docinfo/subtitle"/> </xsl:when> <xsl:when test="info/subtitle"> <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="info/subtitle"/> </xsl:when> <xsl:when test="subtitle"> <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="subtitle"/> </xsl:when> </xsl:choose> </xsl:template> <xsl:template name="sidebar.titlepage.verso"> </xsl:template> <xsl:template name="sidebar.titlepage.separator"> </xsl:template> <xsl:template name="sidebar.titlepage.before.recto"> </xsl:template> <xsl:template name="sidebar.titlepage.before.verso"> </xsl:template> <xsl:template name="sidebar.titlepage"> <div class="titlepage"> <xsl:variable name="recto.content"> <xsl:call-template name="sidebar.titlepage.before.recto"/> <xsl:call-template name="sidebar.titlepage.recto"/> </xsl:variable> <xsl:variable name="recto.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> <div><xsl:copy-of select="$recto.content"/></div> </xsl:if> <xsl:variable name="verso.content"> <xsl:call-template name="sidebar.titlepage.before.verso"/> <xsl:call-template name="sidebar.titlepage.verso"/> </xsl:variable> <xsl:variable name="verso.elements.count"> <xsl:choose> <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> <div><xsl:copy-of select="$verso.content"/></div> </xsl:if> <xsl:call-template name="sidebar.titlepage.separator"/> </div> </xsl:template> <xsl:template match="*" mode="sidebar.titlepage.recto.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="*" mode="sidebar.titlepage.verso.mode"> <!-- if an element isn't found in this mode, --> <!-- try the generic titlepage.mode --> <xsl:apply-templates select="." mode="titlepage.mode"/> </xsl:template> <xsl:template match="subtitle" mode="sidebar.titlepage.recto.auto.mode"> <div xsl:use-attribute-sets="sidebar.titlepage.recto.style"> <xsl:apply-templates select="." mode="sidebar.titlepage.recto.mode"/> </div> </xsl:template> </xsl:stylesheet> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������conky-1.12.2/doc/docbook-xml/html/titlepage.xsl�����������������������������������������������������0000664�0000000�0000000�00000113013�14041272775�0021365�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'> <!-- ******************************************************************** $Id: titlepage.xsl 9983 2015-09-16 20:58:50Z bobstayton $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. See ../README or http://docbook.sf.net/release/xsl/current/ for copyright and other information. ******************************************************************** --> <!-- ==================================================================== --> <xsl:attribute-set name="book.titlepage.recto.style"/> <xsl:attribute-set name="book.titlepage.verso.style"/> <xsl:attribute-set name="article.titlepage.recto.style"/> <xsl:attribute-set name="article.titlepage.verso.style"/> <xsl:attribute-set name="set.titlepage.recto.style"/> <xsl:attribute-set name="set.titlepage.verso.style"/> <xsl:attribute-set name="part.titlepage.recto.style"/> <xsl:attribute-set name="part.titlepage.verso.style"/> <xsl:attribute-set name="partintro.titlepage.recto.style"/> <xsl:attribute-set name="partintro.titlepage.verso.style"/> <xsl:attribute-set name="reference.titlepage.recto.style"/> <xsl:attribute-set name="reference.titlepage.verso.style"/> <xsl:attribute-set name="refentry.titlepage.recto.style"/> <xsl:attribute-set name="refentry.titlepage.verso.style"/> <xsl:attribute-set name="dedication.titlepage.recto.style"/> <xsl:attribute-set name="dedication.titlepage.verso.style"/> <xsl:attribute-set name="acknowledgements.titlepage.recto.style"/> <xsl:attribute-set name="acknowledgements.titlepage.verso.style"/> <xsl:attribute-set name="preface.titlepage.recto.style"/> <xsl:attribute-set name="preface.titlepage.verso.style"/> <xsl:attribute-set name="chapter.titlepage.recto.style"/> <xsl:attribute-set name="chapter.titlepage.verso.style"/> <xsl:attribute-set name="appendix.titlepage.recto.style"/> <xsl:attribute-set name="appendix.titlepage.verso.style"/> <xsl:attribute-set name="bibliography.titlepage.recto.style"/> <xsl:attribute-set name="bibliography.titlepage.verso.style"/> <xsl:attribute-set name="glossary.titlepage.recto.style"/> <xsl:attribute-set name="glossary.titlepage.verso.style"/> <xsl:attribute-set name="index.titlepage.recto.style"/> <xsl:attribute-set name="index.titlepage.verso.style"/> <xsl:attribute-set name="setindex.titlepage.recto.style"/> <xsl:attribute-set name="setindex.titlepage.verso.style"/> <xsl:attribute-set name="sidebar.titlepage.recto.style"/> <xsl:attribute-set name="sidebar.titlepage.verso.style"/> <xsl:attribute-set name="topic.titlepage.recto.style"/> <xsl:attribute-set name="topic.titlepage.verso.style"/> <xsl:attribute-set name="section.titlepage.recto.style"/> <xsl:attribute-set name="section.titlepage.verso.style"/> <xsl:attribute-set name="sect1.titlepage.recto.style" use-attribute-sets="section.titlepage.recto.style"/> <xsl:attribute-set name="sect1.titlepage.verso.style" use-attribute-sets="section.titlepage.verso.style"/> <xsl:attribute-set name="sect2.titlepage.recto.style" use-attribute-sets="section.titlepage.recto.style"/> <xsl:attribute-set name="sect2.titlepage.verso.style" use-attribute-sets="section.titlepage.verso.style"/> <xsl:attribute-set name="sect3.titlepage.recto.style" use-attribute-sets="section.titlepage.recto.style"/> <xsl:attribute-set name="sect3.titlepage.verso.style" use-attribute-sets="section.titlepage.verso.style"/> <xsl:attribute-set name="sect4.titlepage.recto.style" use-attribute-sets="section.titlepage.recto.style"/> <xsl:attribute-set name="sect4.titlepage.verso.style" use-attribute-sets="section.titlepage.verso.style"/> <xsl:attribute-set name="sect5.titlepage.recto.style" use-attribute-sets="section.titlepage.recto.style"/> <xsl:attribute-set name="sect5.titlepage.verso.style" use-attribute-sets="section.titlepage.verso.style"/> <xsl:attribute-set name="simplesect.titlepage.recto.style" use-attribute-sets="section.titlepage.recto.style"/> <xsl:attribute-set name="simplesect.titlepage.verso.style" use-attribute-sets="section.titlepage.verso.style"/> <xsl:attribute-set name="table.of.contents.titlepage.recto.style"/> <xsl:attribute-set name="table.of.contents.titlepage.verso.style"/> <xsl:attribute-set name="list.of.tables.titlepage.recto.style"/> <xsl:attribute-set name="list.of.tables.contents.titlepage.verso.style"/> <xsl:attribute-set name="list.of.figures.titlepage.recto.style"/> <xsl:attribute-set name="list.of.figures.contents.titlepage.verso.style"/> <xsl:attribute-set name="list.of.equations.titlepage.recto.style"/> <xsl:attribute-set name="list.of.equations.contents.titlepage.verso.style"/> <xsl:attribute-set name="list.of.examples.titlepage.recto.style"/> <xsl:attribute-set name="list.of.examples.contents.titlepage.verso.style"/> <xsl:attribute-set name="list.of.unknowns.titlepage.recto.style"/> <xsl:attribute-set name="list.of.unknowns.contents.titlepage.verso.style"/> <xsl:attribute-set name="dialogue.titlepage.recto.style"/> <xsl:attribute-set name="dialogue.titlepage.verso.style"/> <xsl:attribute-set name="drama.titlepage.recto.style"/> <xsl:attribute-set name="drama.titlepage.verso.style"/> <xsl:attribute-set name="poetry.titlepage.recto.style"/> <xsl:attribute-set name="poetry.titlepage.verso.style"/> <!-- ==================================================================== --> <xsl:template match="*" mode="titlepage.mode"> <!-- if an element isn't found in this mode, try the default mode --> <xsl:apply-templates select="."/> </xsl:template> <xsl:template match="abbrev" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="abstract" mode="titlepage.mode"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:call-template name="anchor"/> <xsl:if test="$abstract.notitle.enabled = 0"> <xsl:call-template name="formal.object.heading"> <xsl:with-param name="title"> <xsl:apply-templates select="." mode="title.markup"/> </xsl:with-param> </xsl:call-template> </xsl:if> <xsl:apply-templates mode="titlepage.mode"/> <xsl:call-template name="process.footnotes"/> </div> </xsl:template> <xsl:template match="abstract/title" mode="titlepage.mode"> </xsl:template> <xsl:template match="address" mode="titlepage.mode"> <xsl:param name="suppress-numbers" select="'0'"/> <xsl:variable name="rtf"> <xsl:apply-templates mode="titlepage.mode"/> </xsl:variable> <xsl:choose> <xsl:when test="$suppress-numbers = '0' and @linenumbering = 'numbered' and $use.extensions != '0' and $linenumbering.extension != '0'"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="paragraph"> <xsl:with-param name="content"> <xsl:call-template name="number.rtf.lines"> <xsl:with-param name="rtf" select="$rtf"/> </xsl:call-template> </xsl:with-param> </xsl:call-template> </div> </xsl:when> <xsl:otherwise> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="paragraph"> <xsl:with-param name="content"> <xsl:call-template name="make-verbatim"> <xsl:with-param name="rtf" select="$rtf"/> </xsl:call-template> </xsl:with-param> </xsl:call-template> </div> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="affiliation" mode="titlepage.mode"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> </div> </xsl:template> <xsl:template match="artpagenums" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="author|editor" mode="titlepage.mode"> <xsl:call-template name="credits.div"/> </xsl:template> <xsl:template name="credits.div"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:if test="self::editor and count(preceding-sibling::editor) = 0 and not($editedby.enabled = 0)"> <h4 class="editedby"><xsl:call-template name="gentext.edited.by"/></h4> </xsl:if> <h3> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:choose> <xsl:when test="orgname"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> <xsl:call-template name="person.name"/> </xsl:otherwise> </xsl:choose> </h3> <xsl:if test="not($contrib.inline.enabled = 0)"> <xsl:apply-templates mode="titlepage.mode" select="contrib"/> </xsl:if> <xsl:apply-templates mode="titlepage.mode" select="affiliation"/> <xsl:apply-templates mode="titlepage.mode" select="email"/> <xsl:if test="not($blurb.on.titlepage.enabled = 0)"> <xsl:choose> <xsl:when test="$contrib.inline.enabled = 0"> <xsl:apply-templates mode="titlepage.mode" select="contrib|authorblurb|personblurb"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates mode="titlepage.mode" select="authorblurb|personblurb"/> </xsl:otherwise> </xsl:choose> </xsl:if> </div> </xsl:template> <xsl:template match="authorblurb|personblurb" mode="titlepage.mode"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> </div> </xsl:template> <xsl:template match="authorgroup" mode="titlepage.mode"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:if test="parent::refentryinfo"> <h2>Authors</h2> </xsl:if> <xsl:call-template name="anchor"/> <xsl:apply-templates mode="titlepage.mode"/> </div> </xsl:template> <xsl:template match="authorinitials" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="bibliomisc" mode="titlepage.mode"> <xsl:apply-templates mode="titlepage.mode"/> </xsl:template> <xsl:template match="bibliomset" mode="titlepage.mode"> <xsl:apply-templates mode="titlepage.mode"/> </xsl:template> <xsl:template match="collab" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="collabname" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> </span> </xsl:template> <xsl:template match="confgroup" mode="titlepage.mode"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> </div> </xsl:template> <xsl:template match="confdates" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="confsponsor" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="conftitle" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="confnum" mode="titlepage.mode"> <!-- suppress --> </xsl:template> <xsl:template match="contractnum" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="contractsponsor" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="contrib" mode="titlepage.mode"> <xsl:choose> <xsl:when test="not($contrib.inline.enabled = 0)"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> </span><xsl:text> </xsl:text> </xsl:when> <xsl:otherwise> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <p><xsl:apply-templates mode="titlepage.mode"/></p> </div> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="copyright" mode="titlepage.mode"> <xsl:if test="generate-id() = generate-id(//refentryinfo/copyright[1]) and ($stylesheet.result.type = 'html' or $stylesheet.result.type = 'xhtml')"> <h2>Copyright</h2> </xsl:if> <p> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:call-template name="gentext"> <xsl:with-param name="key" select="'Copyright'"/> </xsl:call-template> <xsl:call-template name="gentext.space"/> <xsl:call-template name="dingbat"> <xsl:with-param name="dingbat">copyright</xsl:with-param> </xsl:call-template> <xsl:call-template name="gentext.space"/> <xsl:call-template name="copyright.years"> <xsl:with-param name="years" select="year"/> <xsl:with-param name="print.ranges" select="$make.year.ranges"/> <xsl:with-param name="single.year.ranges" select="$make.single.year.ranges"/> </xsl:call-template> <xsl:call-template name="gentext.space"/> <xsl:apply-templates select="holder" mode="titlepage.mode"/> </p> </xsl:template> <xsl:template match="year" mode="titlepage.mode"> <xsl:choose> <xsl:when test="$show.revisionflag != 0 and @revisionflag"> <span class="{@revisionflag}"> <xsl:apply-templates mode="titlepage.mode"/> </span> </xsl:when> <xsl:otherwise> <xsl:apply-templates mode="titlepage.mode"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="holder" mode="titlepage.mode"> <xsl:choose> <xsl:when test="$show.revisionflag != 0 and @revisionflag"> <span class="{@revisionflag}"> <xsl:apply-templates mode="titlepage.mode"/> </span> </xsl:when> <xsl:otherwise> <xsl:apply-templates mode="titlepage.mode"/> </xsl:otherwise> </xsl:choose> <xsl:if test="position() < last()"> <xsl:text>, </xsl:text> </xsl:if> </xsl:template> <xsl:template match="corpauthor" mode="titlepage.mode"> <h3> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> </h3> </xsl:template> <xsl:template match="corpcredit" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="corpname" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="date" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="edition" mode="titlepage.mode"> <p> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <xsl:call-template name="gentext.space"/> <xsl:call-template name="gentext"> <xsl:with-param name="key" select="'Edition'"/> </xsl:call-template> </p> </xsl:template> <xsl:template match="email" mode="titlepage.mode"> <!-- use the normal e-mail handling code --> <xsl:apply-templates select="."/> </xsl:template> <xsl:template match="firstname" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="graphic" mode="titlepage.mode"> <!-- use the normal graphic handling code --> <xsl:apply-templates select="."/> </xsl:template> <xsl:template match="honorific" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="isbn" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="issn" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="biblioid" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="itermset" mode="titlepage.mode"> </xsl:template> <xsl:template match="invpartnumber" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="issuenum" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="jobtitle" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="keywordset" mode="titlepage.mode"> </xsl:template> <xsl:template match="legalnotice" mode="titlepage.mode"> <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable> <xsl:choose> <xsl:when test="$generate.legalnotice.link != 0"> <!-- Compute name of legalnotice file --> <xsl:variable name="file"> <xsl:call-template name="ln.or.rh.filename"/> </xsl:variable> <xsl:variable name="filename"> <xsl:call-template name="make-relative-filename"> <xsl:with-param name="base.dir" select="$chunk.base.dir"/> <xsl:with-param name="base.name" select="$file"/> </xsl:call-template> </xsl:variable> <xsl:variable name="title"> <xsl:apply-templates select="." mode="title.markup"/> </xsl:variable> <a href="{$file}"> <xsl:copy-of select="$title"/> </a> <xsl:call-template name="write.chunk"> <xsl:with-param name="filename" select="$filename"/> <xsl:with-param name="quiet" select="$chunk.quietly"/> <xsl:with-param name="content"> <xsl:call-template name="user.preroot"/> <html> <head> <xsl:call-template name="system.head.content"/> <xsl:call-template name="head.content"/> <xsl:call-template name="user.head.content"/> </head> <body> <xsl:call-template name="body.attributes"/> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"> <xsl:with-param name="conditional" select="0"/> </xsl:call-template> <xsl:apply-templates mode="titlepage.mode"/> </div> </body> </html> <xsl:value-of select="$chunk.append"/> </xsl:with-param> </xsl:call-template> </xsl:when> <xsl:otherwise> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"> <xsl:with-param name="conditional" select="0"/> </xsl:call-template> <xsl:call-template name="anchor"> <xsl:with-param name="conditional" select="0"/> </xsl:call-template> <xsl:apply-templates mode="titlepage.mode"/> </div> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="legalnotice/title" mode="titlepage.mode"> <p class="legalnotice-title"><b><xsl:apply-templates/></b></p> </xsl:template> <xsl:template match="lineage" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="modespec" mode="titlepage.mode"> </xsl:template> <xsl:template match="orgdiv" mode="titlepage.mode"> <xsl:if test="preceding-sibling::*[1][self::orgname]"> <xsl:text> </xsl:text> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="orgname" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="othercredit" mode="titlepage.mode"> <xsl:choose> <xsl:when test="not($othercredit.like.author.enabled = 0)"> <xsl:variable name="contrib" select="string(contrib)"/> <xsl:choose> <xsl:when test="contrib"> <xsl:if test="not(preceding-sibling::othercredit[string(contrib)=$contrib])"> <xsl:call-template name="paragraph"> <xsl:with-param name="class" select="local-name(.)"/> <xsl:with-param name="content"> <xsl:apply-templates mode="titlepage.mode" select="contrib"/> <xsl:text>: </xsl:text> <xsl:call-template name="person.name"/> <xsl:apply-templates mode="titlepage.mode" select="affiliation"/> <xsl:apply-templates select="following-sibling::othercredit[string(contrib)=$contrib]" mode="titlepage.othercredits"/> </xsl:with-param> </xsl:call-template> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:call-template name="paragraph"> <xsl:with-param name="class" select="local-name(.)"/> <xsl:with-param name="content"> <xsl:call-template name="person.name"/> </xsl:with-param> </xsl:call-template> <xsl:apply-templates mode="titlepage.mode" select="affiliation"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:call-template name="credits.div"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="othercredit" mode="titlepage.othercredits"> <xsl:text>, </xsl:text> <xsl:call-template name="person.name"/> </xsl:template> <xsl:template match="othername" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="pagenums" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="printhistory" mode="titlepage.mode"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> </div> </xsl:template> <xsl:template match="productname" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="productnumber" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="pubdate" mode="titlepage.mode"> <xsl:call-template name="paragraph"> <xsl:with-param name="class" select="local-name(.)"/> <xsl:with-param name="content"> <xsl:apply-templates mode="titlepage.mode"/> </xsl:with-param> </xsl:call-template> </xsl:template> <xsl:template match="publisher" mode="titlepage.mode"> <xsl:call-template name="paragraph"> <xsl:with-param name="class" select="local-name(.)"/> <xsl:with-param name="content"> <xsl:apply-templates mode="titlepage.mode"/> </xsl:with-param> </xsl:call-template> </xsl:template> <xsl:template match="publishername" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="pubsnumber" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="releaseinfo" mode="titlepage.mode"> <xsl:call-template name="paragraph"> <xsl:with-param name="class" select="local-name(.)"/> <xsl:with-param name="content"> <xsl:apply-templates mode="titlepage.mode"/> </xsl:with-param> </xsl:call-template> </xsl:template> <xsl:template match="revhistory" mode="titlepage.mode"> <xsl:variable name="numcols"> <xsl:choose> <xsl:when test=".//authorinitials|.//author">3</xsl:when> <xsl:otherwise>2</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable> <xsl:variable name="title"> <xsl:call-template name="gentext"> <xsl:with-param name="key">RevHistory</xsl:with-param> </xsl:call-template> </xsl:variable> <xsl:variable name="contents"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <table> <xsl:if test="$css.decoration != 0"> <xsl:attribute name="style"> <xsl:text>border-style:solid; width:100%;</xsl:text> </xsl:attribute> </xsl:if> <!-- include summary attribute if not HTML5 --> <xsl:if test="$div.element != 'section'"> <xsl:attribute name="summary"> <xsl:call-template name="gentext"> <xsl:with-param name="key">revhistory</xsl:with-param> </xsl:call-template> </xsl:attribute> </xsl:if> <tr> <th align="{$direction.align.start}" valign="top" colspan="{$numcols}"> <b> <xsl:call-template name="gentext"> <xsl:with-param name="key" select="'RevHistory'"/> </xsl:call-template> </b> </th> </tr> <xsl:apply-templates mode="titlepage.mode"> <xsl:with-param name="numcols" select="$numcols"/> </xsl:apply-templates> </table> </div> </xsl:variable> <xsl:choose> <xsl:when test="$generate.revhistory.link != 0"> <!-- Compute name of revhistory file --> <xsl:variable name="file"> <xsl:call-template name="ln.or.rh.filename"> <xsl:with-param name="is.ln" select="false()"/> </xsl:call-template> </xsl:variable> <xsl:variable name="filename"> <xsl:call-template name="make-relative-filename"> <xsl:with-param name="base.dir" select="$chunk.base.dir"/> <xsl:with-param name="base.name" select="$file"/> </xsl:call-template> </xsl:variable> <a href="{$file}"> <xsl:copy-of select="$title"/> </a> <xsl:call-template name="write.chunk"> <xsl:with-param name="filename" select="$filename"/> <xsl:with-param name="quiet" select="$chunk.quietly"/> <xsl:with-param name="content"> <xsl:call-template name="user.preroot"/> <html> <head> <xsl:call-template name="system.head.content"/> <xsl:call-template name="head.content"> <xsl:with-param name="title"> <xsl:value-of select="$title"/> <xsl:if test="../../title"> <xsl:value-of select="concat(' (', ../../title, ')')"/> </xsl:if> </xsl:with-param> </xsl:call-template> <xsl:call-template name="user.head.content"/> </head> <body> <xsl:call-template name="body.attributes"/> <xsl:copy-of select="$contents"/> </body> </html> <xsl:text> </xsl:text> </xsl:with-param> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:copy-of select="$contents"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="revhistory/revision" mode="titlepage.mode"> <xsl:param name="numcols" select="'3'"/> <xsl:variable name="revnumber" select="revnumber"/> <xsl:variable name="revdate" select="date"/> <xsl:variable name="revauthor" select="authorinitials|author"/> <xsl:variable name="revremark" select="revremark|revdescription"/> <tr> <td align="{$direction.align.start}"> <xsl:if test="$revnumber"> <xsl:call-template name="gentext"> <xsl:with-param name="key" select="'Revision'"/> </xsl:call-template> <xsl:call-template name="gentext.space"/> <xsl:apply-templates select="$revnumber[1]" mode="titlepage.mode"/> </xsl:if> </td> <td align="{$direction.align.start}"> <xsl:apply-templates select="$revdate[1]" mode="titlepage.mode"/> </td> <xsl:choose> <xsl:when test="$revauthor"> <td align="{$direction.align.start}"> <xsl:for-each select="$revauthor"> <xsl:apply-templates select="." mode="titlepage.mode"/> <xsl:if test="position() != last()"> <xsl:text>, </xsl:text> </xsl:if> </xsl:for-each> </td> </xsl:when> <xsl:when test="$numcols > 2"> <td> </td> </xsl:when> <xsl:otherwise></xsl:otherwise> </xsl:choose> </tr> <xsl:if test="$revremark"> <tr> <td align="{$direction.align.start}" colspan="{$numcols}"> <xsl:apply-templates select="$revremark[1]" mode="titlepage.mode"/> </td> </tr> </xsl:if> </xsl:template> <xsl:template match="revision/revnumber" mode="titlepage.mode"> <xsl:apply-templates mode="titlepage.mode"/> </xsl:template> <xsl:template match="revision/date" mode="titlepage.mode"> <xsl:apply-templates mode="titlepage.mode"/> </xsl:template> <xsl:template match="revision/authorinitials" mode="titlepage.mode"> <xsl:apply-templates mode="titlepage.mode"/> </xsl:template> <xsl:template match="revision/author" mode="titlepage.mode"> <xsl:apply-templates mode="titlepage.mode"/> </xsl:template> <xsl:template match="revision/revremark" mode="titlepage.mode"> <xsl:apply-templates mode="titlepage.mode"/> </xsl:template> <xsl:template match="revision/revdescription" mode="titlepage.mode"> <xsl:apply-templates mode="titlepage.mode"/> </xsl:template> <xsl:template match="seriesvolnums" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="shortaffil" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="subjectset" mode="titlepage.mode"> </xsl:template> <xsl:template match="subtitle" mode="titlepage.mode"> <h2> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> </h2> </xsl:template> <xsl:template match="surname" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <xsl:template match="title" mode="titlepage.mode"> <xsl:variable name="id"> <xsl:choose> <!-- if title is in an *info wrapper, get the grandparent --> <xsl:when test="contains(local-name(..), 'info')"> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="../.."/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:call-template name="object.id"> <xsl:with-param name="object" select=".."/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:variable> <h1> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:choose> <xsl:when test="$generate.id.attributes = 0"> <a name="{$id}"/> </xsl:when> <xsl:otherwise> </xsl:otherwise> </xsl:choose> <xsl:choose> <xsl:when test="$show.revisionflag != 0 and @revisionflag"> <span class="{@revisionflag}"> <xsl:apply-templates mode="titlepage.mode"/> </span> </xsl:when> <xsl:otherwise> <xsl:apply-templates mode="titlepage.mode"/> </xsl:otherwise> </xsl:choose> </h1> </xsl:template> <xsl:template match="titleabbrev" mode="titlepage.mode"> <!-- nop; title abbreviations don't belong on the title page! --> </xsl:template> <xsl:template match="volumenum" mode="titlepage.mode"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="titlepage.mode"/> <br/> </span> </xsl:template> <!-- This template computes the filename for legalnotice and revhistory chunks --> <xsl:template name="ln.or.rh.filename"> <xsl:param name="node" select="."/> <xsl:param name="is.ln" select="true()"/> <xsl:variable name="dbhtml-filename"> <xsl:call-template name="pi.dbhtml_filename"> <xsl:with-param name="node" select="$node"/> </xsl:call-template> </xsl:variable> <xsl:choose> <!-- 1. If there is a dbhtml_filename PI, use that --> <xsl:when test="$dbhtml-filename != ''"> <xsl:value-of select="$dbhtml-filename"/> </xsl:when> <xsl:when test="($node/@id or $node/@xml:id) and not($use.id.as.filename = 0)"> <!-- * 2. If this legalnotice/revhistory has an ID, then go ahead and use --> <!-- * just the value of that ID as the basename for the file --> <!-- * (that is, without prepending an "ln-" or "rh-" to it) --> <xsl:value-of select="($node/@id|$node/@xml:id)[1]"/> <xsl:value-of select="$html.ext"/> </xsl:when> <xsl:when test="not ($node/@id or $node/@xml:id) or $use.id.as.filename = 0"> <!-- * 3. Otherwise, if this legalnotice/revhistory does not have an ID, or --> <!-- * if $use.id.as.filename = 0 --> <!-- * then we generate an ID... --> <xsl:variable name="id"> <xsl:value-of select="generate-id($node)"/> </xsl:variable> <!-- * ...and then we take that generated ID, prepend a --> <!-- * prefix to it, and use that as the basename for the file --> <xsl:choose> <xsl:when test="$is.ln"> <xsl:value-of select="concat('ln-',$id,$html.ext)"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="concat('rh-',$id,$html.ext)"/> </xsl:otherwise> </xsl:choose> </xsl:when> </xsl:choose> </xsl:template> <!-- ==================================================================== --> </xsl:stylesheet> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������conky-1.12.2/doc/docbook-xml/html/toc.xsl�����������������������������������������������������������0000664�0000000�0000000�00000030645�14041272775�0020205�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'> <!-- ******************************************************************** $Id: toc.xsl 9796 2013-09-03 16:26:58Z bobstayton $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. See ../README or http://docbook.sf.net/release/xsl/current/ for copyright and other information. ******************************************************************** --> <!-- ==================================================================== --> <xsl:template match="set/toc | book/toc | part/toc"> <xsl:variable name="toc.params"> <xsl:call-template name="find.path.params"> <xsl:with-param name="node" select="parent::*"/> <xsl:with-param name="table" select="normalize-space($generate.toc)"/> </xsl:call-template> </xsl:variable> <!-- Do not output the toc element if one is already generated by the use of $generate.toc parameter, or if generating a source toc is turned off --> <xsl:if test="not(contains($toc.params, 'toc')) and ($process.source.toc != 0 or $process.empty.source.toc != 0)"> <xsl:variable name="content"> <xsl:choose> <xsl:when test="* and $process.source.toc != 0"> <xsl:apply-templates /> </xsl:when> <xsl:when test="count(*) = 0 and $process.empty.source.toc != 0"> <!-- trick to switch context node to parent element --> <xsl:for-each select="parent::*"> <xsl:choose> <xsl:when test="self::set"> <xsl:call-template name="set.toc"> <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/> </xsl:call-template> </xsl:when> <xsl:when test="self::book"> <xsl:call-template name="division.toc"> <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/> </xsl:call-template> </xsl:when> <xsl:when test="self::part"> <xsl:call-template name="division.toc"> <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/> </xsl:call-template> </xsl:when> </xsl:choose> </xsl:for-each> </xsl:when> </xsl:choose> </xsl:variable> <xsl:if test="string-length(normalize-space($content)) != 0"> <xsl:copy-of select="$content"/> </xsl:if> </xsl:if> </xsl:template> <xsl:template match="chapter/toc | appendix/toc | preface/toc | article/toc"> <xsl:variable name="toc.params"> <xsl:call-template name="find.path.params"> <xsl:with-param name="node" select="parent::*"/> <xsl:with-param name="table" select="normalize-space($generate.toc)"/> </xsl:call-template> </xsl:variable> <!-- Do not output the toc element if one is already generated by the use of $generate.toc parameter, or if generating a source toc is turned off --> <xsl:if test="not(contains($toc.params, 'toc')) and ($process.source.toc != 0 or $process.empty.source.toc != 0)"> <xsl:choose> <xsl:when test="* and $process.source.toc != 0"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates select="title"/> <dl> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:apply-templates select="*[not(self::title)]"/> </dl> </div> <xsl:call-template name="component.toc.separator"/> </xsl:when> <xsl:when test="count(*) = 0 and $process.empty.source.toc != 0"> <!-- trick to switch context node to section element --> <xsl:for-each select="parent::*"> <xsl:call-template name="component.toc"> <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/> </xsl:call-template> </xsl:for-each> <xsl:call-template name="component.toc.separator"/> </xsl:when> </xsl:choose> </xsl:if> </xsl:template> <xsl:template match="section/toc |sect1/toc |sect2/toc |sect3/toc |sect4/toc |sect5/toc"> <xsl:variable name="toc.params"> <xsl:call-template name="find.path.params"> <xsl:with-param name="node" select="parent::*"/> <xsl:with-param name="table" select="normalize-space($generate.toc)"/> </xsl:call-template> </xsl:variable> <!-- Do not output the toc element if one is already generated by the use of $generate.toc parameter, or if generating a source toc is turned off --> <xsl:if test="not(contains($toc.params, 'toc')) and ($process.source.toc != 0 or $process.empty.source.toc != 0)"> <xsl:choose> <xsl:when test="* and $process.source.toc != 0"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates select="title"/> <dl> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:apply-templates select="*[not(self::title)]"/> </dl> </div> <xsl:call-template name="section.toc.separator"/> </xsl:when> <xsl:when test="count(*) = 0 and $process.empty.source.toc != 0"> <!-- trick to switch context node to section element --> <xsl:for-each select="parent::*"> <xsl:call-template name="section.toc"> <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/> </xsl:call-template> </xsl:for-each> <xsl:call-template name="section.toc.separator"/> </xsl:when> </xsl:choose> </xsl:if> </xsl:template> <!-- ==================================================================== --> <xsl:template match="tocpart|tocchap |toclevel1|toclevel2|toclevel3|toclevel4|toclevel5"> <xsl:variable name="sub-toc"> <xsl:if test="tocchap|toclevel1|toclevel2|toclevel3|toclevel4|toclevel5"> <xsl:choose> <xsl:when test="$toc.list.type = 'dl'"> <dd> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:element name="{$toc.list.type}"> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:apply-templates select="tocchap|toclevel1|toclevel2| toclevel3|toclevel4|toclevel5"/> </xsl:element> </dd> </xsl:when> <xsl:otherwise> <xsl:element name="{$toc.list.type}"> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:apply-templates select="tocchap|toclevel1|toclevel2| toclevel3|toclevel4|toclevel5"/> </xsl:element> </xsl:otherwise> </xsl:choose> </xsl:if> </xsl:variable> <xsl:apply-templates select="tocentry[position() != last()]"/> <xsl:choose> <xsl:when test="$toc.list.type = 'dl'"> <dt> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:apply-templates select="tocentry[position() = last()]"/> </dt> <xsl:copy-of select="$sub-toc"/> </xsl:when> <xsl:otherwise> <li> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:apply-templates select="tocentry[position() = last()]"/> <xsl:copy-of select="$sub-toc"/> </li> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="tocentry|tocdiv|lotentry|tocfront|tocback"> <xsl:choose> <xsl:when test="$toc.list.type = 'dl'"> <dt> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="tocentry-content"/> </dt> </xsl:when> <xsl:otherwise> <li> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="tocentry-content"/> </li> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="tocentry[position() = last()]" priority="2"> <xsl:call-template name="tocentry-content"/> </xsl:template> <xsl:template name="tocentry-content"> <xsl:variable name="targets" select="key('id',@linkend)"/> <xsl:variable name="target" select="$targets[1]"/> <xsl:choose> <xsl:when test="@linkend"> <xsl:call-template name="check.id.unique"> <xsl:with-param name="linkend" select="@linkend"/> </xsl:call-template> <a> <xsl:attribute name="href"> <xsl:call-template name="href.target"> <xsl:with-param name="object" select="$target"/> </xsl:call-template> </xsl:attribute> <xsl:apply-templates/> </a> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="toc/title | tocdiv/title"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:apply-templates/> </div> </xsl:template> <xsl:template match="toc/subtitle | tocdiv/subtitle"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:apply-templates/> </div> </xsl:template> <xsl:template match="toc/titleabbrev | tocdiv/titleabbrev"> </xsl:template> <!-- ==================================================================== --> <!-- A lot element must have content, because there is no attribute to select what kind of list should be generated --> <xsl:template match="book/lot | part/lot"> <!-- Don't generate a page sequence unless there is content --> <xsl:variable name="content"> <xsl:choose> <xsl:when test="* and $process.source.toc != 0"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:apply-templates /> </div> </xsl:when> <xsl:when test="not(child::*) and $process.empty.source.toc != 0"> <xsl:call-template name="process.empty.lot"/> </xsl:when> </xsl:choose> </xsl:variable> <xsl:if test="string-length(normalize-space($content)) != 0"> <xsl:copy-of select="$content"/> </xsl:if> </xsl:template> <xsl:template match="chapter/lot | appendix/lot | preface/lot | article/lot"> <xsl:choose> <xsl:when test="* and $process.source.toc != 0"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:apply-templates /> </div> <xsl:call-template name="component.toc.separator"/> </xsl:when> <xsl:when test="not(child::*) and $process.empty.source.toc != 0"> <xsl:call-template name="process.empty.lot"/> </xsl:when> </xsl:choose> </xsl:template> <xsl:template match="section/lot |sect1/lot |sect2/lot |sect3/lot |sect4/lot |sect5/lot"> <xsl:choose> <xsl:when test="* and $process.source.toc != 0"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:apply-templates/> </div> <xsl:call-template name="section.toc.separator"/> </xsl:when> <xsl:when test="not(child::*) and $process.empty.source.toc != 0"> <xsl:call-template name="process.empty.lot"/> </xsl:when> </xsl:choose> </xsl:template> <xsl:template name="process.empty.lot"> <!-- An empty lot element does not provide any information to indicate what should be included in it. You can customize this template to generate a lot based on @role or something --> <xsl:message> <xsl:text>Warning: don't know what to generate for </xsl:text> <xsl:text>lot that has no children.</xsl:text> </xsl:message> </xsl:template> <xsl:template match="lot/title"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:apply-templates/> </div> </xsl:template> <xsl:template match="lot/subtitle"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:apply-templates/> </div> </xsl:template> <xsl:template match="lot/titleabbrev"> </xsl:template> </xsl:stylesheet> �������������������������������������������������������������������������������������������conky-1.12.2/doc/docbook-xml/html/verbatim.xsl������������������������������������������������������0000664�0000000�0000000�00000033565�14041272775�0021235�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sverb="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Verbatim" xmlns:xverb="xalan://com.nwalsh.xalan.Verbatim" xmlns:lxslt="http://xml.apache.org/xslt" xmlns:exsl="http://exslt.org/common" exclude-result-prefixes="sverb xverb lxslt exsl" version='1.0'> <!-- ******************************************************************** $Id: verbatim.xsl 9589 2012-09-02 20:52:15Z tom_schr $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. See ../README or http://docbook.sf.net/release/xsl/current/ for copyright and other information. ******************************************************************** --> <!-- XSLTHL highlighting is turned off by default. See highlighting/README for instructions on how to turn on XSLTHL --> <xsl:template name="apply-highlighting"> <xsl:apply-templates/> </xsl:template> <lxslt:component prefix="xverb" functions="numberLines"/> <xsl:template match="programlisting|screen|synopsis"> <xsl:param name="suppress-numbers" select="'0'"/> <xsl:call-template name="anchor"/> <xsl:variable name="div.element">pre</xsl:variable> <xsl:if test="$shade.verbatim != 0"> <xsl:message> <xsl:text>The shade.verbatim parameter is deprecated. </xsl:text> <xsl:text>Use CSS instead,</xsl:text> </xsl:message> <xsl:message> <xsl:text>for example: pre.</xsl:text> <xsl:value-of select="local-name(.)"/> <xsl:text> { background-color: #E0E0E0; }</xsl:text> </xsl:message> </xsl:if> <xsl:choose> <xsl:when test="$suppress-numbers = '0' and @linenumbering = 'numbered' and $use.extensions != '0' and $linenumbering.extension != '0'"> <xsl:variable name="rtf"> <xsl:choose> <xsl:when test="$highlight.source != 0"> <xsl:call-template name="apply-highlighting"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:element name="{$div.element}"> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:if test="@width != ''"> <xsl:attribute name="width"> <xsl:value-of select="@width"/> </xsl:attribute> </xsl:if> <xsl:call-template name="number.rtf.lines"> <xsl:with-param name="rtf" select="$rtf"/> </xsl:call-template> </xsl:element> </xsl:when> <xsl:otherwise> <xsl:element name="{$div.element}"> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:if test="@width != ''"> <xsl:attribute name="width"> <xsl:value-of select="@width"/> </xsl:attribute> </xsl:if> <xsl:choose> <xsl:when test="$highlight.source != 0"> <xsl:call-template name="apply-highlighting"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> </xsl:element> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="literallayout"> <xsl:param name="suppress-numbers" select="'0'"/> <xsl:variable name="rtf"> <xsl:apply-templates/> </xsl:variable> <xsl:if test="$shade.verbatim != 0 and @class='monospaced'"> <xsl:message> <xsl:text>The shade.verbatim parameter is deprecated. </xsl:text> <xsl:text>Use CSS instead,</xsl:text> </xsl:message> <xsl:message> <xsl:text>for example: pre.</xsl:text> <xsl:value-of select="local-name(.)"/> <xsl:text> { background-color: #E0E0E0; }</xsl:text> </xsl:message> </xsl:if> <xsl:choose> <xsl:when test="$suppress-numbers = '0' and @linenumbering = 'numbered' and $use.extensions != '0' and $linenumbering.extension != '0'"> <xsl:choose> <xsl:when test="@class='monospaced'"> <pre> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:call-template name="number.rtf.lines"> <xsl:with-param name="rtf" select="$rtf"/> </xsl:call-template> </pre> </xsl:when> <xsl:otherwise> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <p> <xsl:call-template name="number.rtf.lines"> <xsl:with-param name="rtf" select="$rtf"/> </xsl:call-template> </p> </div> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="@class='monospaced'"> <pre> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:copy-of select="$rtf"/> </pre> </xsl:when> <xsl:otherwise> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <p> <xsl:call-template name="make-verbatim"> <xsl:with-param name="rtf" select="$rtf"/> </xsl:call-template> </p> </div> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="address"> <xsl:param name="suppress-numbers" select="'0'"/> <xsl:variable name="rtf"> <xsl:apply-templates/> </xsl:variable> <xsl:choose> <xsl:when test="$suppress-numbers = '0' and @linenumbering = 'numbered' and $use.extensions != '0' and $linenumbering.extension != '0'"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <p> <xsl:call-template name="number.rtf.lines"> <xsl:with-param name="rtf" select="$rtf"/> </xsl:call-template> </p> </div> </xsl:when> <xsl:otherwise> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <p> <xsl:call-template name="make-verbatim"> <xsl:with-param name="rtf" select="$rtf"/> </xsl:call-template> </p> </div> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="number.rtf.lines"> <xsl:param name="rtf" select="''"/> <xsl:param name="pi.context" select="."/> <!-- Save the global values --> <xsl:variable name="global.linenumbering.everyNth" select="$linenumbering.everyNth"/> <xsl:variable name="global.linenumbering.separator" select="$linenumbering.separator"/> <xsl:variable name="global.linenumbering.width" select="$linenumbering.width"/> <!-- Extract the <?dbhtml linenumbering.*?> PI values --> <xsl:variable name="pi.linenumbering.everyNth"> <xsl:call-template name="pi.dbhtml_linenumbering.everyNth"> <xsl:with-param name="node" select="$pi.context"/> </xsl:call-template> </xsl:variable> <xsl:variable name="pi.linenumbering.separator"> <xsl:call-template name="pi.dbhtml_linenumbering.separator"> <xsl:with-param name="node" select="$pi.context"/> </xsl:call-template> </xsl:variable> <xsl:variable name="pi.linenumbering.width"> <xsl:call-template name="pi.dbhtml_linenumbering.width"> <xsl:with-param name="node" select="$pi.context"/> </xsl:call-template> </xsl:variable> <!-- Construct the 'in-context' values --> <xsl:variable name="linenumbering.everyNth"> <xsl:choose> <xsl:when test="$pi.linenumbering.everyNth != ''"> <xsl:value-of select="$pi.linenumbering.everyNth"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$global.linenumbering.everyNth"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="linenumbering.separator"> <xsl:choose> <xsl:when test="$pi.linenumbering.separator != ''"> <xsl:value-of select="$pi.linenumbering.separator"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$global.linenumbering.separator"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="linenumbering.width"> <xsl:choose> <xsl:when test="$pi.linenumbering.width != ''"> <xsl:value-of select="$pi.linenumbering.width"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$global.linenumbering.width"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="linenumbering.startinglinenumber"> <xsl:choose> <xsl:when test="$pi.context/@startinglinenumber"> <xsl:value-of select="$pi.context/@startinglinenumber"/> </xsl:when> <xsl:when test="$pi.context/@continuation='continues'"> <xsl:variable name="lastLine"> <xsl:choose> <xsl:when test="$pi.context/self::programlisting"> <xsl:call-template name="lastLineNumber"> <xsl:with-param name="listings" select="preceding::programlisting[@linenumbering='numbered']"/> </xsl:call-template> </xsl:when> <xsl:when test="$pi.context/self::screen"> <xsl:call-template name="lastLineNumber"> <xsl:with-param name="listings" select="preceding::screen[@linenumbering='numbered']"/> </xsl:call-template> </xsl:when> <xsl:when test="$pi.context/self::literallayout"> <xsl:call-template name="lastLineNumber"> <xsl:with-param name="listings" select="preceding::literallayout[@linenumbering='numbered']"/> </xsl:call-template> </xsl:when> <xsl:when test="$pi.context/self::address"> <xsl:call-template name="lastLineNumber"> <xsl:with-param name="listings" select="preceding::address[@linenumbering='numbered']"/> </xsl:call-template> </xsl:when> <xsl:when test="$pi.context/self::synopsis"> <xsl:call-template name="lastLineNumber"> <xsl:with-param name="listings" select="preceding::synopsis[@linenumbering='numbered']"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:message> <xsl:text>Unexpected verbatim environment: </xsl:text> <xsl:value-of select="local-name($pi.context)"/> </xsl:message> <xsl:value-of select="0"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:value-of select="$lastLine + 1"/> </xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:choose> <xsl:when test="function-available('sverb:numberLines')"> <xsl:copy-of select="sverb:numberLines($rtf)"/> </xsl:when> <xsl:when test="function-available('xverb:numberLines')"> <xsl:copy-of select="xverb:numberLines($rtf)"/> </xsl:when> <xsl:otherwise> <xsl:message terminate="yes"> <xsl:text>No numberLines function available.</xsl:text> </xsl:message> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="make-verbatim"> <xsl:param name="rtf"/> <!-- I want to make this RTF verbatim. There are two possibilities: either I have access to the exsl:node-set extension function and I can "do it right" or I have to rely on CSS. --> <xsl:choose> <xsl:when test="$exsl.node.set.available != 0"> <xsl:apply-templates select="exsl:node-set($rtf)" mode="make.verbatim.mode"/> </xsl:when> <xsl:otherwise> <span style="white-space: pre;"> <xsl:copy-of select="$rtf"/> </span> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ======================================================================== --> <xsl:template name="lastLineNumber"> <xsl:param name="listings"/> <xsl:param name="number" select="0"/> <xsl:variable name="lines"> <xsl:call-template name="countLines"> <xsl:with-param name="listing" select="string($listings[1])"/> </xsl:call-template> </xsl:variable> <xsl:choose> <xsl:when test="not($listings)"> <xsl:value-of select="$number"/> </xsl:when> <xsl:when test="$listings[1]/@startinglinenumber"> <xsl:value-of select="$number + $listings[1]/@startinglinenumber + $lines - 1"/> </xsl:when> <xsl:when test="$listings[1]/@continuation='continues'"> <xsl:call-template name="lastLineNumber"> <xsl:with-param name="listings" select="$listings[position() > 1]"/> <xsl:with-param name="number" select="$number + $lines"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$lines"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="countLines"> <xsl:param name="listing"/> <xsl:param name="count" select="1"/> <xsl:choose> <xsl:when test="contains($listing, ' ')"> <xsl:call-template name="countLines"> <xsl:with-param name="listing" select="substring-after($listing, ' ')"/> <xsl:with-param name="count" select="$count + 1"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$count"/> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet> �������������������������������������������������������������������������������������������������������������������������������������������conky-1.12.2/doc/docbook-xml/html/xref.xsl����������������������������������������������������������0000664�0000000�0000000�00000134765�14041272775�0020374�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:suwl="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.UnwrapLinks" xmlns:exsl="http://exslt.org/common" xmlns:xlink='http://www.w3.org/1999/xlink' exclude-result-prefixes="suwl exsl xlink" version='1.0'> <!-- ******************************************************************** $Id: xref.xsl 9947 2014-10-16 01:01:39Z bobstayton $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. See ../README or http://docbook.sf.net/release/xsl/current/ for copyright and other information. ******************************************************************** --> <!-- Use internal variable for olink xlink role for consistency --> <xsl:variable name="xolink.role">http://docbook.org/xlink/role/olink</xsl:variable> <!-- ==================================================================== --> <xsl:template match="anchor"> <xsl:choose> <xsl:when test="$generate.id.attributes = 0"> <xsl:call-template name="anchor"/> </xsl:when> <xsl:otherwise> <span> <xsl:call-template name="id.attribute"/> </span> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ==================================================================== --> <xsl:template match="xref" name="xref"> <xsl:param name="xhref" select="@xlink:href"/> <!-- is the @xlink:href a local idref link? --> <xsl:param name="xlink.idref"> <xsl:if test="starts-with($xhref,'#') and (not(contains($xhref,'(')) or starts-with($xhref, '#xpointer(id('))"> <xsl:call-template name="xpointer.idref"> <xsl:with-param name="xpointer" select="$xhref"/> </xsl:call-template> </xsl:if> </xsl:param> <xsl:param name="xlink.targets" select="key('id',$xlink.idref)"/> <xsl:param name="linkend.targets" select="key('id',@linkend)"/> <xsl:param name="target" select="($xlink.targets | $linkend.targets)[1]"/> <xsl:param name="referrer" select="."/> <xsl:param name="xrefstyle"> <xsl:apply-templates select="." mode="xrefstyle"> <xsl:with-param name="target" select="$target"/> <xsl:with-param name="referrer" select="$referrer"/> </xsl:apply-templates> </xsl:param> <xsl:call-template name="anchor"/> <xsl:variable name="content"> <xsl:choose> <xsl:when test="@endterm"> <xsl:variable name="etargets" select="key('id',@endterm)"/> <xsl:variable name="etarget" select="$etargets[1]"/> <xsl:choose> <xsl:when test="count($etarget) = 0"> <xsl:message> <xsl:value-of select="count($etargets)"/> <xsl:text>Endterm points to nonexistent ID: </xsl:text> <xsl:value-of select="@endterm"/> </xsl:message> <xsl:text>???</xsl:text> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="$etarget" mode="endterm"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:when test="$target/@xreflabel"> <xsl:call-template name="xref.xreflabel"> <xsl:with-param name="target" select="$target"/> </xsl:call-template> </xsl:when> <xsl:when test="$target"> <xsl:if test="not(parent::citation)"> <xsl:apply-templates select="$target" mode="xref-to-prefix"> <xsl:with-param name="referrer" select="."/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> </xsl:apply-templates> </xsl:if> <xsl:apply-templates select="$target" mode="xref-to"> <xsl:with-param name="referrer" select="."/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> </xsl:apply-templates> <xsl:if test="not(parent::citation)"> <xsl:apply-templates select="$target" mode="xref-to-suffix"> <xsl:with-param name="referrer" select="."/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> </xsl:apply-templates> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:message> <xsl:text>ERROR: xref linking to </xsl:text> <xsl:value-of select="@linkend|@xlink:href"/> <xsl:text> has no generated link text.</xsl:text> </xsl:message> <xsl:text>???</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="id" select="(@id | @xml:id)[1]"/> <xsl:choose> <xsl:when test="$id"> <span id="{$id}"> <xsl:call-template name="simple.xlink"> <xsl:with-param name="content" select="$content"/> </xsl:call-template> </span> </xsl:when> <xsl:otherwise> <xsl:call-template name="simple.xlink"> <xsl:with-param name="content" select="$content"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ==================================================================== --> <!-- biblioref handled largely like an xref --> <!-- To be done: add support for begin, end, and units attributes --> <xsl:template match="biblioref"> <xsl:variable name="targets" select="key('id',@linkend)"/> <xsl:variable name="target" select="$targets[1]"/> <xsl:variable name="refelem" select="local-name($target)"/> <xsl:variable name="referrer" select="."/> <xsl:variable name="xrefstyle"> <xsl:apply-templates select="." mode="xrefstyle"> <xsl:with-param name="target" select="$target"/> <xsl:with-param name="referrer" select="$referrer"/> </xsl:apply-templates> </xsl:variable> <xsl:call-template name="check.id.unique"> <xsl:with-param name="linkend" select="@linkend"/> </xsl:call-template> <xsl:call-template name="anchor"/> <xsl:choose> <xsl:when test="count($target) = 0"> <xsl:message> <xsl:text>XRef to nonexistent id: </xsl:text> <xsl:value-of select="@linkend"/> </xsl:message> <xsl:text>???</xsl:text> </xsl:when> <xsl:when test="@endterm"> <xsl:variable name="href"> <xsl:call-template name="href.target"> <xsl:with-param name="object" select="$target"/> </xsl:call-template> </xsl:variable> <xsl:variable name="etargets" select="key('id',@endterm)"/> <xsl:variable name="etarget" select="$etargets[1]"/> <xsl:choose> <xsl:when test="count($etarget) = 0"> <xsl:message> <xsl:value-of select="count($etargets)"/> <xsl:text>Endterm points to nonexistent ID: </xsl:text> <xsl:value-of select="@endterm"/> </xsl:message> <a href="{$href}"> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:text>???</xsl:text> </a> </xsl:when> <xsl:otherwise> <a href="{$href}"> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates select="$etarget" mode="endterm"/> </a> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:when test="$target/@xreflabel"> <a> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:attribute name="href"> <xsl:call-template name="href.target"> <xsl:with-param name="object" select="$target"/> </xsl:call-template> </xsl:attribute> <xsl:call-template name="xref.xreflabel"> <xsl:with-param name="target" select="$target"/> </xsl:call-template> </a> </xsl:when> <xsl:otherwise> <xsl:variable name="href"> <xsl:call-template name="href.target"> <xsl:with-param name="object" select="$target"/> </xsl:call-template> </xsl:variable> <xsl:if test="not(parent::citation)"> <xsl:apply-templates select="$target" mode="xref-to-prefix"> <xsl:with-param name="referrer" select="."/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> </xsl:apply-templates> </xsl:if> <a href="{$href}"> <xsl:apply-templates select="." mode="class.attribute"/> <xsl:if test="$target/title or $target/info/title"> <xsl:attribute name="title"> <xsl:apply-templates select="$target" mode="xref-title"/> </xsl:attribute> </xsl:if> <xsl:apply-templates select="$target" mode="xref-to"> <xsl:with-param name="referrer" select="."/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> </xsl:apply-templates> </a> <xsl:if test="not(parent::citation)"> <xsl:apply-templates select="$target" mode="xref-to-suffix"> <xsl:with-param name="referrer" select="."/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> </xsl:apply-templates> </xsl:if> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ==================================================================== --> <xsl:template match="*" mode="endterm"> <!-- Process the children of the endterm element --> <xsl:variable name="endterm"> <xsl:apply-templates select="child::node()" mode="no.anchor.mode"/> </xsl:variable> <xsl:choose> <xsl:when test="$exsl.node.set.available != 0"> <xsl:apply-templates select="exsl:node-set($endterm)" mode="remove-ids"/> </xsl:when> <xsl:otherwise> <xsl:copy-of select="$endterm"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="*" mode="remove-ids"> <xsl:choose> <!-- handle html or xhtml --> <xsl:when test="local-name(.) = 'a' and (namespace-uri(.) = '' or namespace-uri(.) = 'http://www.w3.org/1999/xhtml')"> <xsl:choose> <xsl:when test="(@name and count(@*) = 1) or (@id and count(@*) = 1) or (@xml:id and count(@*) = 1) or (@xml:id and @name and count(@*) = 2) or (@id and @name and count(@*) = 2)"> <xsl:message>suppress anchor</xsl:message> <!-- suppress the whole thing --> </xsl:when> <xsl:otherwise> <xsl:copy> <xsl:for-each select="@*"> <xsl:choose> <xsl:when test="local-name(.) != 'name' and local-name(.) != 'id'"> <xsl:copy/> </xsl:when> <xsl:otherwise> <xsl:message>removing <xsl:value-of select="local-name(.)"/></xsl:message> </xsl:otherwise> </xsl:choose> </xsl:for-each> <xsl:apply-templates mode="remove-ids"/> </xsl:copy> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:copy> <xsl:for-each select="@*"> <xsl:choose> <xsl:when test="local-name(.) != 'id'"> <xsl:copy/> </xsl:when> <xsl:otherwise> <xsl:message>removing <xsl:value-of select="local-name(.)"/></xsl:message> </xsl:otherwise> </xsl:choose> </xsl:for-each> <xsl:apply-templates mode="remove-ids"/> </xsl:copy> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ==================================================================== --> <xsl:template match="*" mode="xref-to-prefix"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> </xsl:template> <xsl:template match="*" mode="xref-to-suffix"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> </xsl:template> <xsl:template match="*" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:if test="$verbose"> <xsl:message> <xsl:text>Don't know what gentext to create for xref to: "</xsl:text> <xsl:value-of select="name(.)"/> <xsl:text>", ("</xsl:text> <xsl:value-of select="(@id|@xml:id)[1]"/> <xsl:text>")</xsl:text> </xsl:message> </xsl:if> <xsl:text>???</xsl:text> </xsl:template> <xsl:template match="title" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <!-- if you xref to a title, xref to the parent... --> <xsl:choose> <!-- FIXME: how reliable is this? --> <xsl:when test="contains(local-name(parent::*), 'info')"> <xsl:apply-templates select="parent::*[2]" mode="xref-to"> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="parent::*" mode="xref-to"> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="abstract|authorblurb|personblurb|bibliodiv|bibliomset |biblioset|blockquote|calloutlist|caution|colophon |constraintdef|formalpara|glossdiv|important|indexdiv |itemizedlist|legalnotice|lot|msg|msgexplan|msgmain |msgrel|msgset|msgsub|note|orderedlist|partintro |productionset|qandadiv|refsynopsisdiv|screenshot|segmentedlist |set|setindex|sidebar|tip|toc|variablelist|warning" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <!-- catch-all for things with (possibly optional) titles --> <xsl:apply-templates select="." mode="object.xref.markup"> <xsl:with-param name="purpose" select="'xref'"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:template> <xsl:template match="author|editor|othercredit|personname" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:call-template name="person.name"/> </xsl:template> <xsl:template match="authorgroup" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:call-template name="person.name.list"/> </xsl:template> <xsl:template match="figure|example|table|equation" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:apply-templates select="." mode="object.xref.markup"> <xsl:with-param name="purpose" select="'xref'"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:template> <xsl:template match="procedure" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose"/> <xsl:apply-templates select="." mode="object.xref.markup"> <xsl:with-param name="purpose" select="'xref'"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:template> <xsl:template match="task" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose"/> <xsl:apply-templates select="." mode="object.xref.markup"> <xsl:with-param name="purpose" select="'xref'"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:template> <xsl:template match="cmdsynopsis" mode="xref-to"> <xsl:apply-templates select="(.//command)[1]" mode="xref"/> </xsl:template> <xsl:template match="funcsynopsis" mode="xref-to"> <xsl:apply-templates select="(.//function)[1]" mode="xref"/> </xsl:template> <xsl:template match="dedication|acknowledgements|preface|chapter|appendix|article" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:apply-templates select="." mode="object.xref.markup"> <xsl:with-param name="purpose" select="'xref'"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:template> <xsl:template match="bibliography" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:apply-templates select="." mode="object.xref.markup"> <xsl:with-param name="purpose" select="'xref'"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:template> <xsl:template match="biblioentry|bibliomixed" mode="xref-to-prefix"> <xsl:text>[</xsl:text> </xsl:template> <xsl:template match="biblioentry|bibliomixed" mode="xref-to-suffix"> <xsl:text>]</xsl:text> </xsl:template> <xsl:template match="biblioentry|bibliomixed" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <!-- handles both biblioentry and bibliomixed --> <xsl:choose> <xsl:when test="string(.) = ''"> <xsl:variable name="bib" select="document($bibliography.collection,.)"/> <xsl:variable name="id" select="(@id|@xml:id)[1]"/> <xsl:variable name="entry" select="$bib/bibliography/ *[@id=$id or @xml:id=$id][1]"/> <xsl:choose> <xsl:when test="$entry"> <xsl:choose> <xsl:when test="$bibliography.numbered != 0"> <xsl:number from="bibliography" count="biblioentry|bibliomixed" level="any" format="1"/> </xsl:when> <xsl:when test="local-name($entry/*[1]) = 'abbrev'"> <xsl:apply-templates select="$entry/*[1]" mode="no.anchor.mode"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="(@id|@xml:id)[1]"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:message> <xsl:text>No bibliography entry: </xsl:text> <xsl:value-of select="$id"/> <xsl:text> found in </xsl:text> <xsl:value-of select="$bibliography.collection"/> </xsl:message> <xsl:value-of select="(@id|@xml:id)[1]"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="$bibliography.numbered != 0"> <xsl:number from="bibliography" count="biblioentry|bibliomixed" level="any" format="1"/> </xsl:when> <xsl:when test="local-name(*[1]) = 'abbrev'"> <xsl:apply-templates select="*[1]" mode="no.anchor.mode"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="(@id|@xml:id)[1]"/> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="glossary" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:apply-templates select="." mode="object.xref.markup"> <xsl:with-param name="purpose" select="'xref'"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:template> <xsl:template match="glossentry" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:choose> <xsl:when test="$glossentry.show.acronym = 'primary'"> <xsl:choose> <xsl:when test="acronym|abbrev"> <xsl:apply-templates select="(acronym|abbrev)[1]" mode="no.anchor.mode"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="glossterm[1]" mode="xref-to"> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="glossterm[1]" mode="xref-to"> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="glossterm|firstterm" mode="xref-to"> <xsl:apply-templates mode="no.anchor.mode"/> </xsl:template> <xsl:template match="index" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:apply-templates select="." mode="object.xref.markup"> <xsl:with-param name="purpose" select="'xref'"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:template> <xsl:template match="listitem" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose"/> <xsl:apply-templates select="." mode="object.xref.markup"> <xsl:with-param name="purpose" select="'xref'"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:template> <xsl:template match="section|simplesect |sect1|sect2|sect3|sect4|sect5 |refsect1|refsect2|refsect3|refsection" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:apply-templates select="." mode="object.xref.markup"> <xsl:with-param name="purpose" select="'xref'"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> <!-- FIXME: What about "in Chapter X"? --> </xsl:template> <xsl:template match="topic" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:apply-templates select="." mode="object.xref.markup"> <xsl:with-param name="purpose" select="'xref'"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:template> <xsl:template match="bridgehead" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:apply-templates select="." mode="object.xref.markup"> <xsl:with-param name="purpose" select="'xref'"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> <!-- FIXME: What about "in Chapter X"? --> </xsl:template> <xsl:template match="qandaset" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:apply-templates select="." mode="object.xref.markup"> <xsl:with-param name="purpose" select="'xref'"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:template> <xsl:template match="qandaentry" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:apply-templates select="question[1]" mode="xref-to"> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:template> <xsl:template match="question|answer" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:choose> <xsl:when test="string-length(label) != 0"> <xsl:apply-templates select="." mode="label.markup"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="." mode="object.xref.markup"> <xsl:with-param name="purpose" select="'xref'"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="part|reference" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:apply-templates select="." mode="object.xref.markup"> <xsl:with-param name="purpose" select="'xref'"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:template> <xsl:template match="refentry" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:choose> <xsl:when test="refmeta/refentrytitle"> <xsl:apply-templates select="refmeta/refentrytitle" mode="no.anchor.mode"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="refnamediv/refname[1]" mode="no.anchor.mode"/> </xsl:otherwise> </xsl:choose> <xsl:apply-templates select="refmeta/manvolnum" mode="no.anchor.mode"/> </xsl:template> <xsl:template match="refnamediv" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:apply-templates select="refname[1]" mode="xref-to"> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:template> <xsl:template match="refname" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:apply-templates mode="xref-to"/> </xsl:template> <xsl:template match="step" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:call-template name="gentext"> <xsl:with-param name="key" select="'Step'"/> </xsl:call-template> <xsl:text> </xsl:text> <xsl:apply-templates select="." mode="number"/> </xsl:template> <xsl:template match="varlistentry" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:apply-templates select="term[1]" mode="xref-to"> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:template> <xsl:template match="primary|secondary|tertiary" mode="xref-to"> <xsl:value-of select="."/> </xsl:template> <xsl:template match="indexterm" mode="xref-to"> <xsl:value-of select="primary"/> </xsl:template> <xsl:template match="varlistentry/term" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:apply-templates mode="no.anchor.mode"/> </xsl:template> <xsl:template match="co" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:apply-templates select="." mode="callout-bug"/> </xsl:template> <xsl:template match="area|areaset" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:call-template name="callout-bug"> <xsl:with-param name="conum"> <xsl:apply-templates select="." mode="conumber"/> </xsl:with-param> </xsl:call-template> </xsl:template> <xsl:template match="book" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:apply-templates select="." mode="object.xref.markup"> <xsl:with-param name="purpose" select="'xref'"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:template> <!-- These are elements for which no link text exists, so an xref to one uses the xrefstyle attribute if specified, or if not it falls back to the container element's link text --> <xsl:template match="para|phrase|simpara|anchor|quote" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> <xsl:param name="verbose" select="1"/> <xsl:variable name="context" select="(ancestor::simplesect |ancestor::section |ancestor::sect1 |ancestor::sect2 |ancestor::sect3 |ancestor::sect4 |ancestor::sect5 |ancestor::topic |ancestor::refsection |ancestor::refsect1 |ancestor::refsect2 |ancestor::refsect3 |ancestor::chapter |ancestor::appendix |ancestor::preface |ancestor::partintro |ancestor::dedication |ancestor::acknowledgements |ancestor::colophon |ancestor::bibliography |ancestor::index |ancestor::glossary |ancestor::glossentry |ancestor::listitem |ancestor::varlistentry)[last()]"/> <xsl:choose> <xsl:when test="$xrefstyle != ''"> <xsl:apply-templates select="." mode="object.xref.markup"> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="$context" mode="xref-to"> <xsl:with-param name="purpose" select="'xref'"/> <xsl:with-param name="xrefstyle" select="$xrefstyle"/> <xsl:with-param name="referrer" select="$referrer"/> <xsl:with-param name="verbose" select="$verbose"/> </xsl:apply-templates> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ==================================================================== --> <xsl:template match="*" mode="xref-title"> <xsl:variable name="title"> <xsl:apply-templates select="." mode="object.title.markup"/> </xsl:variable> <xsl:value-of select="$title"/> </xsl:template> <xsl:template match="author" mode="xref-title"> <xsl:variable name="title"> <xsl:call-template name="person.name"/> </xsl:variable> <xsl:value-of select="$title"/> </xsl:template> <xsl:template match="authorgroup" mode="xref-title"> <xsl:variable name="title"> <xsl:call-template name="person.name.list"/> </xsl:variable> <xsl:value-of select="$title"/> </xsl:template> <xsl:template match="cmdsynopsis" mode="xref-title"> <xsl:variable name="title"> <xsl:apply-templates select="(.//command)[1]" mode="xref"/> </xsl:variable> <xsl:value-of select="$title"/> </xsl:template> <xsl:template match="funcsynopsis" mode="xref-title"> <xsl:variable name="title"> <xsl:apply-templates select="(.//function)[1]" mode="xref"/> </xsl:variable> <xsl:value-of select="$title"/> </xsl:template> <xsl:template match="biblioentry|bibliomixed" mode="xref-title"> <!-- handles both biblioentry and bibliomixed --> <xsl:variable name="title"> <xsl:text>[</xsl:text> <xsl:choose> <xsl:when test="local-name(*[1]) = 'abbrev'"> <xsl:apply-templates select="*[1]" mode="no.anchor.mode"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="(@id|@xml:id)[1]"/> </xsl:otherwise> </xsl:choose> <xsl:text>]</xsl:text> </xsl:variable> <xsl:value-of select="$title"/> </xsl:template> <xsl:template match="step" mode="xref-title"> <xsl:call-template name="gentext"> <xsl:with-param name="key" select="'Step'"/> </xsl:call-template> <xsl:text> </xsl:text> <xsl:apply-templates select="." mode="number"/> </xsl:template> <xsl:template match="step[not(./title)]" mode="title.markup"> <xsl:call-template name="gentext"> <xsl:with-param name="key" select="'Step'"/> </xsl:call-template> <xsl:text> </xsl:text> <xsl:apply-templates select="." mode="number"/> </xsl:template> <xsl:template match="co" mode="xref-title"> <xsl:variable name="title"> <xsl:apply-templates select="." mode="callout-bug"/> </xsl:variable> <xsl:value-of select="$title"/> </xsl:template> <!-- ==================================================================== --> <xsl:template match="link" name="link"> <xsl:param name="linkend" select="@linkend"/> <xsl:param name="a.target"/> <xsl:param name="xhref" select="@xlink:href"/> <xsl:variable name="content"> <xsl:call-template name="anchor"/> <xsl:choose> <xsl:when test="count(child::node()) > 0"> <!-- If it has content, use it --> <xsl:apply-templates mode="no.anchor.mode"/> </xsl:when> <!-- else look for an endterm --> <xsl:when test="@endterm"> <xsl:variable name="etargets" select="key('id',@endterm)"/> <xsl:variable name="etarget" select="$etargets[1]"/> <xsl:choose> <xsl:when test="count($etarget) = 0"> <xsl:message> <xsl:value-of select="count($etargets)"/> <xsl:text>Endterm points to nonexistent ID: </xsl:text> <xsl:value-of select="@endterm"/> </xsl:message> <xsl:text>???</xsl:text> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="$etarget" mode="endterm"/> </xsl:otherwise> </xsl:choose> </xsl:when> <!-- Use the xlink:href if no other text --> <xsl:when test="@xlink:href"> <xsl:value-of select="@xlink:href"/> </xsl:when> <xsl:otherwise> <xsl:message> <xsl:text>Link element has no content and no Endterm. </xsl:text> <xsl:text>Nothing to show in the link to </xsl:text> <xsl:value-of select="(@xlink:href|@linkend)[1]"/> </xsl:message> <xsl:text>???</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="id" select="(@id | @xml:id)[1]"/> <xsl:choose> <xsl:when test="$id"> <span id="{$id}"> <xsl:call-template name="simple.xlink"> <xsl:with-param name="node" select="."/> <xsl:with-param name="linkend" select="$linkend"/> <xsl:with-param name="content" select="$content"/> <xsl:with-param name="a.target" select="$a.target"/> <xsl:with-param name="xhref" select="$xhref"/> </xsl:call-template> </span> </xsl:when> <xsl:otherwise> <xsl:call-template name="simple.xlink"> <xsl:with-param name="node" select="."/> <xsl:with-param name="linkend" select="$linkend"/> <xsl:with-param name="content" select="$content"/> <xsl:with-param name="a.target" select="$a.target"/> <xsl:with-param name="xhref" select="$xhref"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="ulink" name="ulink"> <xsl:param name="url" select="@url"/> <xsl:variable name="link"> <a> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:if test="@id or @xml:id"> <xsl:choose> <xsl:when test="$generate.id.attributes = 0"> <xsl:attribute name="name"> <xsl:value-of select="(@id|@xml:id)[1]"/> </xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="id"> <xsl:value-of select="(@id|@xml:id)[1]"/> </xsl:attribute> </xsl:otherwise> </xsl:choose> </xsl:if> <xsl:attribute name="href"><xsl:value-of select="$url"/></xsl:attribute> <xsl:if test="$ulink.target != ''"> <xsl:attribute name="target"> <xsl:value-of select="$ulink.target"/> </xsl:attribute> </xsl:if> <xsl:choose> <xsl:when test="count(child::node())=0"> <xsl:value-of select="$url"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates mode="no.anchor.mode"/> </xsl:otherwise> </xsl:choose> </a> </xsl:variable> <xsl:choose> <xsl:when test="function-available('suwl:unwrapLinks')"> <xsl:copy-of select="suwl:unwrapLinks($link)"/> </xsl:when> <xsl:otherwise> <xsl:copy-of select="$link"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="olink" name="olink"> <!-- olink content may be passed in from xlink olink --> <xsl:param name="content" select="NOTANELEMENT"/> <xsl:call-template name="anchor"/> <xsl:choose> <!-- olinks resolved by stylesheet and target database --> <xsl:when test="@targetdoc or @targetptr or (@xlink:role=$xolink.role and contains(@xlink:href, '#') )" > <xsl:variable name="targetdoc.att"> <xsl:choose> <xsl:when test="@targetdoc != ''"> <xsl:value-of select="@targetdoc"/> </xsl:when> <xsl:when test="@xlink:role=$xolink.role and contains(@xlink:href, '#')" > <xsl:value-of select="substring-before(@xlink:href, '#')"/> </xsl:when> </xsl:choose> </xsl:variable> <xsl:variable name="targetptr.att"> <xsl:choose> <xsl:when test="@targetptr != ''"> <xsl:value-of select="@targetptr"/> </xsl:when> <xsl:when test="@xlink:role=$xolink.role and contains(@xlink:href, '#')" > <xsl:value-of select="substring-after(@xlink:href, '#')"/> </xsl:when> </xsl:choose> </xsl:variable> <xsl:variable name="olink.lang"> <xsl:call-template name="l10n.language"> <xsl:with-param name="xref-context" select="true()"/> </xsl:call-template> </xsl:variable> <xsl:variable name="target.database.filename"> <xsl:call-template name="select.target.database"> <xsl:with-param name="targetdoc.att" select="$targetdoc.att"/> <xsl:with-param name="targetptr.att" select="$targetptr.att"/> <xsl:with-param name="olink.lang" select="$olink.lang"/> </xsl:call-template> </xsl:variable> <xsl:variable name="target.database" select="document($target.database.filename,/)"/> <xsl:if test="$olink.debug != 0"> <xsl:message> <xsl:text>Olink debug: root element of target.database '</xsl:text> <xsl:value-of select="$target.database.filename"/> <xsl:text>' is '</xsl:text> <xsl:value-of select="local-name($target.database/*[1])"/> <xsl:text>'.</xsl:text> </xsl:message> </xsl:if> <xsl:variable name="olink.key"> <xsl:call-template name="select.olink.key"> <xsl:with-param name="targetdoc.att" select="$targetdoc.att"/> <xsl:with-param name="targetptr.att" select="$targetptr.att"/> <xsl:with-param name="olink.lang" select="$olink.lang"/> <xsl:with-param name="target.database" select="$target.database"/> </xsl:call-template> </xsl:variable> <xsl:if test="string-length($olink.key) = 0"> <xsl:call-template name="olink.unresolved"> <xsl:with-param name="targetdoc.att" select="$targetdoc.att"/> <xsl:with-param name="targetptr.att" select="$targetptr.att"/> </xsl:call-template> </xsl:if> <xsl:variable name="href"> <xsl:call-template name="make.olink.href"> <xsl:with-param name="olink.key" select="$olink.key"/> <xsl:with-param name="target.database" select="$target.database"/> </xsl:call-template> </xsl:variable> <xsl:variable name="hottext"> <xsl:choose> <xsl:when test="string-length($content) != 0"> <xsl:copy-of select="$content"/> </xsl:when> <xsl:otherwise> <xsl:call-template name="olink.hottext"> <xsl:with-param name="olink.key" select="$olink.key"/> <xsl:with-param name="olink.lang" select="$olink.lang"/> <xsl:with-param name="target.database" select="$target.database"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="olink.docname.citation"> <xsl:call-template name="olink.document.citation"> <xsl:with-param name="olink.key" select="$olink.key"/> <xsl:with-param name="target.database" select="$target.database"/> <xsl:with-param name="olink.lang" select="$olink.lang"/> </xsl:call-template> </xsl:variable> <xsl:variable name="olink.page.citation"> <xsl:call-template name="olink.page.citation"> <xsl:with-param name="olink.key" select="$olink.key"/> <xsl:with-param name="target.database" select="$target.database"/> <xsl:with-param name="olink.lang" select="$olink.lang"/> </xsl:call-template> </xsl:variable> <xsl:choose> <xsl:when test="$href != ''"> <a href="{$href}"> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:copy-of select="$hottext"/> </a> <xsl:copy-of select="$olink.page.citation"/> <xsl:copy-of select="$olink.docname.citation"/> </xsl:when> <xsl:otherwise> <span class="olink"> <xsl:call-template name="id.attribute"/> <xsl:copy-of select="$hottext"/> </span> <xsl:copy-of select="$olink.page.citation"/> <xsl:copy-of select="$olink.docname.citation"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="@linkmode or @targetdocent or @localinfo"> <!-- old olink mechanism --> <xsl:message> <xsl:text>ERROR: olink using obsolete attributes </xsl:text> <xsl:text>@linkmode, @targetdocent, @localinfo are </xsl:text> <xsl:text>not supported.</xsl:text> </xsl:message> </xsl:when> <xsl:otherwise> <xsl:message> <xsl:text>ERROR: olink is missing linking attributes.</xsl:text> </xsl:message> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="*" mode="pagenumber.markup"> <!-- no-op in HTML --> </xsl:template> <!-- ==================================================================== --> <xsl:template name="xref.xreflabel"> <!-- called to process an xreflabel...you might use this to make --> <!-- xreflabels come out in the right font for different targets, --> <!-- for example. --> <xsl:param name="target" select="."/> <xsl:value-of select="$target/@xreflabel"/> </xsl:template> <!-- ==================================================================== --> <xsl:template match="title" mode="xref"> <xsl:apply-templates mode="no.anchor.mode"/> </xsl:template> <xsl:template match="command" mode="xref"> <xsl:call-template name="inline.boldseq"/> </xsl:template> <xsl:template match="function" mode="xref"> <xsl:call-template name="inline.monoseq"/> </xsl:template> <!-- ==================================================================== --> <xsl:template match="*" mode="insert.title.markup"> <xsl:param name="purpose"/> <xsl:param name="xrefstyle"/> <xsl:param name="title"/> <xsl:choose> <xsl:when test="$purpose = 'xref'"> <xsl:copy-of select="$title"/> </xsl:when> <xsl:otherwise> <xsl:copy-of select="$title"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="chapter|appendix" mode="insert.title.markup"> <xsl:param name="purpose"/> <xsl:param name="xrefstyle"/> <xsl:param name="title"/> <xsl:choose> <xsl:when test="$purpose = 'xref'"> <i> <xsl:copy-of select="$title"/> </i> </xsl:when> <xsl:otherwise> <xsl:copy-of select="$title"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="*" mode="insert.subtitle.markup"> <xsl:param name="purpose"/> <xsl:param name="xrefstyle"/> <xsl:param name="subtitle"/> <xsl:copy-of select="$subtitle"/> </xsl:template> <xsl:template match="*" mode="insert.label.markup"> <xsl:param name="purpose"/> <xsl:param name="xrefstyle"/> <xsl:param name="label"/> <xsl:copy-of select="$label"/> </xsl:template> <xsl:template match="*" mode="insert.pagenumber.markup"> <xsl:param name="purpose"/> <xsl:param name="xrefstyle"/> <xsl:param name="pagenumber"/> <xsl:copy-of select="$pagenumber"/> </xsl:template> <xsl:template match="*" mode="insert.direction.markup"> <xsl:param name="purpose"/> <xsl:param name="xrefstyle"/> <xsl:param name="direction"/> <xsl:copy-of select="$direction"/> </xsl:template> <xsl:template match="*" mode="insert.olink.docname.markup"> <xsl:param name="purpose"/> <xsl:param name="xrefstyle"/> <xsl:param name="docname"/> <span class="olinkdocname"> <xsl:copy-of select="$docname"/> </span> </xsl:template> </xsl:stylesheet> �����������conky-1.12.2/doc/docbook-xml/htmltblx.mod�����������������������������������������������������������0000664�0000000�0000000�00000017770�14041272775�0020267�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!-- ...................................................................... --> <!-- DocBook XML HTML Table Module V4.5 ................................... --> <!-- File htmltblx.mod .................................................... --> <!-- Copyright 2003-2006 ArborText, Inc., Norman Walsh, Sun Microsystems, Inc., and the Organization for the Advancement of Structured Information Standards (OASIS). $Id: htmltblx.mod 6340 2006-10-03 13:23:24Z nwalsh $ Permission to use, copy, modify and distribute the DocBook XML DTD and its accompanying documentation for any purpose and without fee is hereby granted in perpetuity, provided that the above copyright notice and this paragraph appear in all copies. The copyright holders make no representation about the suitability of the DTD for any purpose. It is provided "as is" without expressed or implied warranty. If you modify the DocBook XML DTD in any way, except for declaring and referencing additional sets of general entities and declaring additional notations, label your DTD as a variant of DocBook. See the maintenance documentation for more information. Please direct all questions, bug reports, or suggestions for changes to the docbook@lists.oasis-open.org mailing list. For more information, see http://www.oasis-open.org/docbook/. --> <!-- ...................................................................... --> <!-- This module contains the definitions for elements that are isomorphic to the HTML elements. One could argue we should instead have based ourselves on the XHTML Table Module, but the HTML one is more like what browsers are likely to accept today and users are likely to use. This module has been developed for use with the DocBook V4.5 "union table model" in which elements and attlists common to both models are defined (as the union) in the CALS table module by setting various parameter entities appropriately in this file. In DTD driver files referring to this module, please use an entity declaration that uses the public identifier shown below: <!ENTITY % htmltbl PUBLIC "-//OASIS//ELEMENTS DocBook XML HTML Tables V4.5//EN" "htmltblx.mod"> %htmltbl; See the documentation for detailed information on the parameter entity and module scheme used in DocBook, customizing DocBook and planning for interchange, and changes made since the last release of DocBook. --> <!--======================= XHTML Tables =======================================--> <!ENTITY % html.coreattrs "%common.attrib; class CDATA #IMPLIED style CDATA #IMPLIED title CDATA #IMPLIED" > <!-- Does not contain lang or dir because they are in %common.attribs --> <![%sgml.features;[ <!ENTITY % i18n ""> ]]> <!ENTITY % i18n "xml:lang NMTOKEN #IMPLIED" > <!ENTITY % events "onclick CDATA #IMPLIED ondblclick CDATA #IMPLIED onmousedown CDATA #IMPLIED onmouseup CDATA #IMPLIED onmouseover CDATA #IMPLIED onmousemove CDATA #IMPLIED onmouseout CDATA #IMPLIED onkeypress CDATA #IMPLIED onkeydown CDATA #IMPLIED onkeyup CDATA #IMPLIED" > <!ENTITY % attrs "%html.coreattrs; %i18n; %events;"> <!ENTITY % cellhalign "align (left|center|right|justify|char) #IMPLIED char CDATA #IMPLIED charoff CDATA #IMPLIED" > <!ENTITY % cellvalign "valign (top|middle|bottom|baseline) #IMPLIED" > <!--doc:A group of columns in an HTML table.--> <!ELEMENT colgroup %ho; (col)*> <!--doc:Specifications for a column in an HTML table.--> <!ELEMENT col %ho; EMPTY> <!--doc:A row in an HTML table.--> <!ELEMENT tr %ho; (th|td)+> <!--doc:A table header entry in an HTML table.--> <!ELEMENT th %ho; (%para.char.mix; | %tabentry.mix; | table | informaltable)*> <!--doc:A table ntry in an HTML table.--> <!ELEMENT td %ho; (%para.char.mix; | %tabentry.mix; | table | informaltable)*> <!ATTLIST colgroup %attrs; span CDATA "1" width CDATA #IMPLIED %cellhalign; %cellvalign; > <!ATTLIST col %attrs; span CDATA "1" width CDATA #IMPLIED %cellhalign; %cellvalign; > <!ATTLIST tr %attrs; %cellhalign; %cellvalign; bgcolor CDATA #IMPLIED > <!ATTLIST th %attrs; abbr CDATA #IMPLIED axis CDATA #IMPLIED headers IDREFS #IMPLIED scope (row|col|rowgroup|colgroup) #IMPLIED rowspan CDATA "1" colspan CDATA "1" %cellhalign; %cellvalign; nowrap (nowrap) #IMPLIED bgcolor CDATA #IMPLIED width CDATA #IMPLIED height CDATA #IMPLIED > <!ATTLIST td %attrs; abbr CDATA #IMPLIED axis CDATA #IMPLIED headers IDREFS #IMPLIED scope (row|col|rowgroup|colgroup) #IMPLIED rowspan CDATA "1" colspan CDATA "1" %cellhalign; %cellvalign; nowrap (nowrap) #IMPLIED bgcolor CDATA #IMPLIED width CDATA #IMPLIED height CDATA #IMPLIED > <!-- ====================================================== --> <!-- Set up to read in the CALS model configured to merge with the XHTML table model --> <!-- ====================================================== --> <!ENTITY % tables.role.attrib "%role.attrib;"> <!-- Add label and role attributes to table and informaltable --> <!ENTITY % bodyatt " floatstyle CDATA #IMPLIED rowheader (firstcol|norowheader) #IMPLIED %label.attrib;" > <!-- Add common attributes to Table, TGroup, TBody, THead, TFoot, Row, EntryTbl, and Entry (and InformalTable element). --> <!ENTITY % secur " %common.attrib; class CDATA #IMPLIED style CDATA #IMPLIED title CDATA #IMPLIED %i18n; %events; %tables.role.attrib;"> <!ENTITY % common.table.attribs "%bodyatt; %secur;"> <!-- Content model for Table (that also allows HTML tables) --> <!ENTITY % tbl.table.mdl "((blockinfo?, (%formalobject.title.content;), (%ndxterm.class;)*, textobject*, (graphic+|mediaobject+|tgroup+)) |(caption, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+)))"> <!ENTITY % informal.tbl.table.mdl "(textobject*, (graphic+|mediaobject+|tgroup+)) | ((col*|colgroup*), thead?, tfoot?, (tbody+|tr+))"> <!-- Attributes for Table (including HTML ones) --> <!-- N.B. rules = (none | groups | rows | cols | all) but it can't be spec'd --> <!-- that way because 'all' already occurs in a different enumeration in --> <!-- CALS tables (frame). --> <!ENTITY % tbl.table.att ' tabstyle CDATA #IMPLIED tocentry %yesorno.attvals; #IMPLIED shortentry %yesorno.attvals; #IMPLIED orient (port|land) #IMPLIED pgwide %yesorno.attvals; #IMPLIED summary CDATA #IMPLIED width CDATA #IMPLIED border CDATA #IMPLIED rules CDATA #IMPLIED cellspacing CDATA #IMPLIED cellpadding CDATA #IMPLIED align (left|center|right) #IMPLIED bgcolor CDATA #IMPLIED '> <!ENTITY % tbl.frame.attval "void|above|below|hsides|lhs|rhs|vsides|box|border| top|bottom|topbot|all|sides|none"> <!-- Allow either objects or inlines; beware of REs between elements. --> <!ENTITY % tbl.entry.mdl "%para.char.mix; | %tabentry.mix;"> <!-- thead, tfoot, and tbody are defined in both table models, so we set up parameter entities to define union models for them --> <!ENTITY % tbl.hdft.mdl "(tr+|(colspec*,row+))"> <!ENTITY % tbl.tbody.mdl "(tr+|row+)"> <!ENTITY % tbl.valign.attval "top|middle|bottom|baseline"> <!-- End of DocBook XML HTML Table Module V4.5 ............................ --> <!-- ...................................................................... --> ��������conky-1.12.2/doc/docbook-xml/lib/�������������������������������������������������������������������0000775�0000000�0000000�00000000000�14041272775�0016462�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������conky-1.12.2/doc/docbook-xml/lib/lib.xsl������������������������������������������������������������0000664�0000000�0000000�00000047477�14041272775�0020003�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0"?> <!-- ******************************************************************** $Id: lib.xweb 9040 2011-08-19 21:51:47Z bobstayton $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. See ../README or http://docbook.sf.net/release/xsl/current/ for copyright and other information. This module implements DTD-independent functions ******************************************************************** --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template name="dot.count"> <!-- Returns the number of "." characters in a string --> <xsl:param name="string"/> <xsl:param name="count" select="0"/> <xsl:choose> <xsl:when test="contains($string, '.')"> <xsl:call-template name="dot.count"> <xsl:with-param name="string" select="substring-after($string, '.')"/> <xsl:with-param name="count" select="$count+1"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$count"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="copy-string"> <!-- returns 'count' copies of 'string' --> <xsl:param name="string"/> <xsl:param name="count" select="0"/> <xsl:param name="result"/> <xsl:choose> <xsl:when test="$count>0"> <xsl:call-template name="copy-string"> <xsl:with-param name="string" select="$string"/> <xsl:with-param name="count" select="$count - 1"/> <xsl:with-param name="result"> <xsl:value-of select="$result"/> <xsl:value-of select="$string"/> </xsl:with-param> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$result"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="string.subst"> <xsl:param name="string"/> <xsl:param name="target"/> <xsl:param name="replacement"/> <xsl:choose> <xsl:when test="contains($string, $target)"> <xsl:variable name="rest"> <xsl:call-template name="string.subst"> <xsl:with-param name="string" select="substring-after($string, $target)"/> <xsl:with-param name="target" select="$target"/> <xsl:with-param name="replacement" select="$replacement"/> </xsl:call-template> </xsl:variable> <xsl:value-of select="concat(substring-before($string, $target), $replacement, $rest)"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$string"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="xpointer.idref"> <xsl:param name="xpointer">http://...</xsl:param> <xsl:choose> <xsl:when test="starts-with($xpointer, '#xpointer(id(')"> <xsl:variable name="rest" select="substring-after($xpointer, '#xpointer(id(')"/> <xsl:variable name="quote" select="substring($rest, 1, 1)"/> <xsl:value-of select="substring-before(substring-after($xpointer, $quote), $quote)"/> </xsl:when> <xsl:when test="starts-with($xpointer, '#')"> <xsl:value-of select="substring-after($xpointer, '#')"/> </xsl:when> <!-- otherwise it's a pointer to some other document --> </xsl:choose> </xsl:template> <xsl:template name="length-magnitude"> <xsl:param name="length" select="'0pt'"/> <xsl:choose> <xsl:when test="string-length($length) = 0"/> <xsl:when test="substring($length,1,1) = '0' or substring($length,1,1) = '1' or substring($length,1,1) = '2' or substring($length,1,1) = '3' or substring($length,1,1) = '4' or substring($length,1,1) = '5' or substring($length,1,1) = '6' or substring($length,1,1) = '7' or substring($length,1,1) = '8' or substring($length,1,1) = '9' or substring($length,1,1) = '.'"> <xsl:value-of select="substring($length,1,1)"/> <xsl:call-template name="length-magnitude"> <xsl:with-param name="length" select="substring($length,2)"/> </xsl:call-template> </xsl:when> </xsl:choose> </xsl:template> <xsl:template name="length-units"> <xsl:param name="length" select="'0pt'"/> <xsl:param name="default.units" select="'px'"/> <xsl:variable name="magnitude"> <xsl:call-template name="length-magnitude"> <xsl:with-param name="length" select="$length"/> </xsl:call-template> </xsl:variable> <xsl:variable name="units"> <xsl:value-of select="substring($length, string-length($magnitude)+1)"/> </xsl:variable> <xsl:choose> <xsl:when test="$units = ''"> <xsl:value-of select="$default.units"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$units"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="length-spec"> <xsl:param name="length" select="'0pt'"/> <xsl:param name="default.units" select="'px'"/> <xsl:variable name="magnitude"> <xsl:call-template name="length-magnitude"> <xsl:with-param name="length" select="$length"/> </xsl:call-template> </xsl:variable> <xsl:variable name="units"> <xsl:value-of select="substring($length, string-length($magnitude)+1)"/> </xsl:variable> <xsl:value-of select="$magnitude"/> <xsl:choose> <xsl:when test="$units='cm' or $units='mm' or $units='in' or $units='pt' or $units='pc' or $units='px' or $units='em'"> <xsl:value-of select="$units"/> </xsl:when> <xsl:when test="$units = ''"> <xsl:value-of select="$default.units"/> </xsl:when> <xsl:otherwise> <xsl:message> <xsl:text>Unrecognized unit of measure: </xsl:text> <xsl:value-of select="$units"/> <xsl:text>.</xsl:text> </xsl:message> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="length-in-points"> <xsl:param name="length" select="'0pt'"/> <xsl:param name="em.size" select="10"/> <xsl:param name="pixels.per.inch" select="90"/> <xsl:variable name="magnitude"> <xsl:call-template name="length-magnitude"> <xsl:with-param name="length" select="$length"/> </xsl:call-template> </xsl:variable> <xsl:variable name="units"> <xsl:value-of select="substring($length, string-length($magnitude)+1)"/> </xsl:variable> <xsl:choose> <xsl:when test="$units = 'pt'"> <xsl:value-of select="$magnitude"/> </xsl:when> <xsl:when test="$units = 'cm'"> <xsl:value-of select="$magnitude div 2.54 * 72.0"/> </xsl:when> <xsl:when test="$units = 'mm'"> <xsl:value-of select="$magnitude div 25.4 * 72.0"/> </xsl:when> <xsl:when test="$units = 'in'"> <xsl:value-of select="$magnitude * 72.0"/> </xsl:when> <xsl:when test="$units = 'pc'"> <xsl:value-of select="$magnitude * 12.0"/> </xsl:when> <xsl:when test="$units = 'px'"> <xsl:value-of select="$magnitude div $pixels.per.inch * 72.0"/> </xsl:when> <xsl:when test="$units = 'em'"> <xsl:value-of select="$magnitude * $em.size"/> </xsl:when> <xsl:otherwise> <xsl:message> <xsl:text>Unrecognized unit of measure: </xsl:text> <xsl:value-of select="$units"/> <xsl:text>.</xsl:text> </xsl:message> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="pi-attribute"> <xsl:param name="pis" select="processing-instruction('BOGUS_PI')"/> <xsl:param name="attribute">filename</xsl:param> <xsl:param name="count">1</xsl:param> <xsl:choose> <xsl:when test="$count>count($pis)"> <!-- not found --> </xsl:when> <xsl:otherwise> <xsl:variable name="pi"> <xsl:value-of select="$pis[$count]"/> </xsl:variable> <xsl:variable name="pivalue"> <xsl:value-of select="concat(' ', normalize-space($pi))"/> </xsl:variable> <xsl:choose> <xsl:when test="contains($pivalue,concat(' ', $attribute, '='))"> <xsl:variable name="rest" select="substring-after($pivalue,concat(' ', $attribute,'='))"/> <xsl:variable name="quote" select="substring($rest,1,1)"/> <xsl:value-of select="substring-before(substring($rest,2),$quote)"/> </xsl:when> <xsl:otherwise> <xsl:call-template name="pi-attribute"> <xsl:with-param name="pis" select="$pis"/> <xsl:with-param name="attribute" select="$attribute"/> <xsl:with-param name="count" select="$count + 1"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="lookup.key"> <xsl:param name="key" select="''"/> <xsl:param name="table" select="''"/> <xsl:if test="contains($table, ' ')"> <xsl:choose> <xsl:when test="substring-before($table, ' ') = $key"> <xsl:variable name="rest" select="substring-after($table, ' ')"/> <xsl:choose> <xsl:when test="contains($rest, ' ')"> <xsl:value-of select="substring-before($rest, ' ')"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$rest"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:call-template name="lookup.key"> <xsl:with-param name="key" select="$key"/> <xsl:with-param name="table" select="substring-after(substring-after($table,' '), ' ')"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:if> </xsl:template> <xsl:template name="xpath.location"> <xsl:param name="node" select="."/> <xsl:param name="path" select="''"/> <xsl:variable name="next.path"> <xsl:value-of select="local-name($node)"/> <xsl:if test="$path != ''">/</xsl:if> <xsl:value-of select="$path"/> </xsl:variable> <xsl:choose> <xsl:when test="$node/parent::*"> <xsl:call-template name="xpath.location"> <xsl:with-param name="node" select="$node/parent::*"/> <xsl:with-param name="path" select="$next.path"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:text>/</xsl:text> <xsl:value-of select="$next.path"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="comment-escape-string"> <xsl:param name="string" select="''"/> <xsl:if test="starts-with($string, '-')"> <xsl:text> </xsl:text> </xsl:if> <xsl:call-template name="comment-escape-string.recursive"> <xsl:with-param name="string" select="$string"/> </xsl:call-template> <xsl:if test="substring($string, string-length($string), 1) = '-'"> <xsl:text> </xsl:text> </xsl:if> </xsl:template> <xsl:template name="comment-escape-string.recursive"> <xsl:param name="string" select="''"/> <xsl:choose> <xsl:when test="contains($string, '--')"> <xsl:value-of select="substring-before($string, '--')"/> <xsl:value-of select="'- -'"/> <xsl:call-template name="comment-escape-string.recursive"> <xsl:with-param name="string" select="substring-after($string, '--')"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$string"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="str.tokenize.keep.delimiters"> <xsl:param name="string" select="''"/> <xsl:param name="delimiters" select="' '"/> <xsl:choose> <xsl:when test="not($string)"/> <xsl:when test="not($delimiters)"> <xsl:call-template name="str.tokenize.keep.delimiters-characters"> <xsl:with-param name="string" select="$string"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:call-template name="str.tokenize.keep.delimiters-delimiters"> <xsl:with-param name="string" select="$string"/> <xsl:with-param name="delimiters" select="$delimiters"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="str.tokenize.keep.delimiters-characters"> <xsl:param name="string"/> <xsl:if test="$string"> <ssb:token xmlns:ssb="http://sideshowbarker.net/ns"><xsl:value-of select="substring($string, 1, 1)"/></ssb:token> <xsl:call-template name="str.tokenize.keep.delimiters-characters"> <xsl:with-param name="string" select="substring($string, 2)"/> </xsl:call-template> </xsl:if> </xsl:template> <xsl:template name="str.tokenize.keep.delimiters-delimiters"> <xsl:param name="string"/> <xsl:param name="delimiters"/> <xsl:variable name="delimiter" select="substring($delimiters, 1, 1)"/> <xsl:choose> <xsl:when test="not($delimiter)"> <ssb:token xmlns:ssb="http://sideshowbarker.net/ns"><xsl:value-of select="$string"/></ssb:token> </xsl:when> <xsl:when test="contains($string, $delimiter)"> <xsl:if test="not(starts-with($string, $delimiter))"> <xsl:call-template name="str.tokenize.keep.delimiters-delimiters"> <xsl:with-param name="string" select="substring-before($string, $delimiter)"/> <xsl:with-param name="delimiters" select="substring($delimiters, 2)"/> </xsl:call-template> </xsl:if> <!-- output each delimiter --> <xsl:value-of select="$delimiter"/> <xsl:call-template name="str.tokenize.keep.delimiters-delimiters"> <xsl:with-param name="string" select="substring-after($string, $delimiter)"/> <xsl:with-param name="delimiters" select="$delimiters"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:call-template name="str.tokenize.keep.delimiters-delimiters"> <xsl:with-param name="string" select="$string"/> <xsl:with-param name="delimiters" select="substring($delimiters, 2)"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="apply-string-subst-map"> <xsl:param name="content"/> <xsl:param name="map.contents"/> <xsl:variable name="replaced_text"> <xsl:call-template name="string.subst"> <xsl:with-param name="string" select="$content"/> <xsl:with-param name="target" select="$map.contents[1]/@oldstring"/> <xsl:with-param name="replacement" select="$map.contents[1]/@newstring"/> </xsl:call-template> </xsl:variable> <xsl:choose> <xsl:when test="$map.contents[2]"> <xsl:call-template name="apply-string-subst-map"> <xsl:with-param name="content" select="$replaced_text"/> <xsl:with-param name="map.contents" select="$map.contents[position() > 1]"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$replaced_text"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="count.uri.path.depth"> <xsl:param name="filename" select="''"/> <xsl:param name="count" select="0"/> <xsl:choose> <xsl:when test="contains($filename, '/')"> <xsl:call-template name="count.uri.path.depth"> <xsl:with-param name="filename" select="substring-after($filename, '/')"/> <xsl:with-param name="count" select="$count + 1"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$count"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="trim.common.uri.paths"> <xsl:param name="uriA" select="''"/> <xsl:param name="uriB" select="''"/> <xsl:param name="return" select="'A'"/> <!-- Resolve any ../ in the path --> <xsl:variable name="trimmed.uriA"> <xsl:call-template name="resolve.path"> <xsl:with-param name="filename" select="$uriA"/> </xsl:call-template> </xsl:variable> <xsl:variable name="trimmed.uriB"> <xsl:call-template name="resolve.path"> <xsl:with-param name="filename" select="$uriB"/> </xsl:call-template> </xsl:variable> <xsl:choose> <xsl:when test="contains($trimmed.uriA, '/') and contains($trimmed.uriB, '/') and substring-before($trimmed.uriA, '/') = substring-before($trimmed.uriB, '/')"> <xsl:call-template name="trim.common.uri.paths"> <xsl:with-param name="uriA" select="substring-after($trimmed.uriA, '/')"/> <xsl:with-param name="uriB" select="substring-after($trimmed.uriB, '/')"/> <xsl:with-param name="return" select="$return"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="$return = 'A'"> <xsl:value-of select="$trimmed.uriA"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$trimmed.uriB"/> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="resolve.path"> <xsl:param name="filename" select="''"/> <xsl:choose> <!-- Leading .. are not eliminated --> <xsl:when test="starts-with($filename, '../')"> <xsl:value-of select="'../'"/> <xsl:call-template name="resolve.path"> <xsl:with-param name="filename" select="substring-after($filename, '../')"/> </xsl:call-template> </xsl:when> <xsl:when test="contains($filename, '/../')"> <xsl:call-template name="resolve.path"> <xsl:with-param name="filename"> <xsl:call-template name="dirname"> <xsl:with-param name="filename" select="substring-before($filename, '/../')"/> </xsl:call-template> <xsl:value-of select="substring-after($filename, '/../')"/> </xsl:with-param> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$filename"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="dirname"> <xsl:param name="filename" select="''"/> <xsl:if test="contains($filename, '/')"> <xsl:value-of select="substring-before($filename, '/')"/> <xsl:text>/</xsl:text> <xsl:call-template name="dirname"> <xsl:with-param name="filename" select="substring-after($filename, '/')"/> </xsl:call-template> </xsl:if> </xsl:template> <xsl:template name="trim.text"> <xsl:param name="contents" select="."/> <xsl:variable name="contents-left-trimmed"> <xsl:call-template name="trim-left"> <xsl:with-param name="contents" select="$contents"/> </xsl:call-template> </xsl:variable> <xsl:variable name="contents-trimmed"> <xsl:call-template name="trim-right"> <xsl:with-param name="contents" select="$contents-left-trimmed"/> </xsl:call-template> </xsl:variable> <xsl:value-of select="$contents-trimmed"/> </xsl:template> <xsl:template name="trim-left"> <xsl:param name="contents"/> <xsl:choose> <xsl:when test="starts-with($contents,' ') or starts-with($contents,' ') or starts-with($contents,' ') or starts-with($contents,' ')"> <xsl:call-template name="trim-left"> <xsl:with-param name="contents" select="substring($contents, 2)"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$contents"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="trim-right"> <xsl:param name="contents"/> <xsl:variable name="last-char"> <xsl:value-of select="substring($contents, string-length($contents), 1)"/> </xsl:variable> <xsl:choose> <xsl:when test="($last-char = ' ') or ($last-char = ' ') or ($last-char = ' ') or ($last-char = ' ')"> <xsl:call-template name="trim-right"> <xsl:with-param name="contents" select="substring($contents, 1, string-length($contents) - 1)"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$contents"/> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������conky-1.12.2/doc/docbook-xml/soextblx.dtd�����������������������������������������������������������0000664�0000000�0000000�00000031535�14041272775�0020270�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!-- XML EXCHANGE TABLE MODEL DECLARATION MODULE --> <!-- This set of declarations defines the XML version of the Exchange Table Model as of the date shown in the Formal Public Identifier (FPI) for this entity. This set of declarations may be referred to using a public external entity declaration and reference as shown in the following three lines: <!ENTITY % calstblx PUBLIC "-//OASIS//DTD XML Exchange Table Model 19990315//EN"> %calstblx; If various parameter entities used within this set of declarations are to be given non-default values, the appropriate declarations should be given before calling in this package (i.e., before the "%calstblx;" reference). --> <!-- The motivation for this XML version of the Exchange Table Model is simply to create an XML version of the SGML Exchange Table Model. By design, no effort has been made to "improve" the model. This XML version incorporates the logical bare minimum changes necessary to make the Exchange Table Model a valid XML DTD. It has been modified slightly for use in the combined HTML/CALS models supported by DocBook V4.3 and later. --> <!-- The XML version of the Exchange Table Model differs from the SGML version in the following ways: The following parameter entities have been removed: - tbl.table.excep, tbl.hdft.excep, tbl.row.excep, tbl.entry.excep There are no exceptions in XML. The following normative statement is made in lieu of exceptions: the exchange table model explicitly forbids a table from occurring within another table. If the content model of an entry includes a table element, then this cannot be enforced by the DTD, but it is a deviation from the exchange table model to include a table within a table. - tbl.hdft.name, tbl.hdft.mdl, tbl.hdft.excep, tbl.hdft.att The motivation for these elements was to change the table header/footer elements. Since XML does not allow element declarations to contain name groups, and the exchange table model does not allow a table to contain footers, the continued presence of these attributes seems unnecessary. The following parameter entity has been added: - tbl.thead.att This entity parameterizes the attributes on thead. It replaces the tbl.hdft.att parameter entity. Other miscellaneous changes: - Tag omission indicators have been removed - Comments have been removed from declarations - NUMBER attributes have been changed to NMTOKEN - NUTOKEN attributes have been to changed to NMTOKEN - Removed the grouping characters around the content model parameter entry for the 'entry' element. This is necessary so that an entry can contain #PCDATA and be defined as an optional, repeatable OR group beginning with #PCDATA. --> <!-- This entity includes a set of element and attribute declarations that partially defines the Exchange table model. However, the model is not well-defined without the accompanying natural language description of the semantics (meanings) of these various elements, attributes, and attribute values. The semantic writeup, also available from SGML Open, should be used in conjunction with this entity. --> <!-- In order to use the Exchange table model, various parameter entity declarations are required. A brief description is as follows: ENTITY NAME WHERE USED WHAT IT IS %yesorno In ATTLIST of: An attribute declared value almost all elements for a "boolean" attribute %paracon In content model of: The "text" (logical content) <entry> of the model group for <entry> %titles In content model of: The "title" part of the model table element group for the table element %tbl.table.name In declaration of: The name of the "table" table element element %tbl.table-titles.mdl In content model of: The model group for the title table elements part of the content model for table element %tbl.table.mdl In content model of: The model group for the content table elements model for table element, often (and by default) defined in terms of %tbl.table-titles.mdl and tgroup %tbl.table.att In ATTLIST of: Additional attributes on the table element table element %bodyatt In ATTLIST of: Additional attributes on the table element table element (for backward compatibility with the SGML model) %tbl.tgroup.mdl In content model of: The model group for the content <tgroup> model for <tgroup> %tbl.tgroup.att In ATTLIST of: Additional attributes on the <tgroup> <tgroup> element %tbl.thead.att In ATTLIST of: Additional attributes on the <thead> <thead> element %tbl.tbody.att In ATTLIST of: Additional attributes on the <tbody> <tbody> element %tbl.colspec.att In ATTLIST of: Additional attributes on the <colspec> <colspec> element %tbl.row.mdl In content model of: The model group for the content <row> model for <row> %tbl.row.att In ATTLIST of: Additional attributes on the <row> <row> element %tbl.entry.mdl In content model of: The model group for the content <entry> model for <entry> %tbl.entry.att In ATTLIST of: Additional attributes on the <entry> <entry> element This set of declarations will use the default definitions shown below for any of these parameter entities that are not declared before this set of declarations is referenced. --> <!-- These definitions are not directly related to the table model, but are used in the default CALS table model and may be defined elsewhere (and prior to the inclusion of this table module) in the referencing DTD. --> <!ENTITY % yesorno 'NMTOKEN'> <!-- no if zero(s), yes if any other value --> <!ENTITY % titles 'title?'> <!ENTITY % pcd "#PCDATA"> <!ENTITY % paracon '%pcd;'> <!-- default for use in entry content --> <!-- The parameter entities as defined below change and simplify the CALS table model as published (as part of the Example DTD) in MIL-HDBK-28001. The resulting simplified DTD has support from the SGML Open vendors and is therefore more interoperable among different systems. These following declarations provide the Exchange default definitions for these entities. However, these entities can be redefined (by giving the appropriate parameter entity declaration(s) prior to the reference to this Table Model declaration set entity) to fit the needs of the current application. Note, however, that changes may have significant effect on the ability to interchange table information. These changes may manifest themselves in useability, presentation, and possible structure information degradation. --> <!ENTITY % tbl.table.name "table"> <!ENTITY % tbl.table-titles.mdl "%titles;,"> <!ENTITY % tbl.table-main.mdl "tgroup+"> <!ENTITY % tbl.table.mdl "%tbl.table-titles.mdl; %tbl.table-main.mdl;"> <!ENTITY % tbl.table.att " pgwide %yesorno; #IMPLIED "> <!ENTITY % bodyatt ""> <!ENTITY % tbl.tgroup.mdl "colspec*,thead?,tbody"> <!ENTITY % tbl.tgroup.att ""> <!ENTITY % tbl.thead.att ""> <!ENTITY % tbl.tbody.att ""> <!ENTITY % tbl.colspec.att ""> <!ENTITY % tbl.row.mdl "entry+"> <!ENTITY % tbl.row.att ""> <!ENTITY % tbl.entry.mdl "(%paracon;)*"> <!ENTITY % tbl.entry.att ""> <!ENTITY % tbl.frame.attval "top|bottom|topbot|all|sides|none"> <!ENTITY % tbl.tbody.mdl "row+"> <!-- ===== Element and attribute declarations follow. ===== --> <!-- Default declarations previously defined in this entity and referenced below include: ENTITY % tbl.table.name "table" ENTITY % tbl.table-titles.mdl "%titles;," ENTITY % tbl.table.mdl "%tbl.table-titles; tgroup+" ENTITY % tbl.table.att " pgwide %yesorno; #IMPLIED " --> <!--doc:???--> <!ELEMENT %tbl.table.name; (%tbl.table.mdl;)> <!ATTLIST %tbl.table.name; frame (%tbl.frame.attval;) #IMPLIED colsep %yesorno; #IMPLIED rowsep %yesorno; #IMPLIED %tbl.table.att; %bodyatt; > <!-- Default declarations previously defined in this entity and referenced below include: ENTITY % tbl.tgroup.mdl "colspec*,thead?,tbody" ENTITY % tbl.tgroup.att "" --> <!--doc:A wrapper for the main content of a table, or part of a table.--> <!ELEMENT tgroup (%tbl.tgroup.mdl;) > <!ATTLIST tgroup cols NMTOKEN #REQUIRED colsep %yesorno; #IMPLIED rowsep %yesorno; #IMPLIED align (left|right|center|justify|char) #IMPLIED %tbl.tgroup.att; > <!-- Default declarations previously defined in this entity and referenced below include: ENTITY % tbl.colspec.att "" --> <!--doc:Specifications for a column in a table.--> <!ELEMENT colspec EMPTY > <!ATTLIST colspec colnum NMTOKEN #IMPLIED colname NMTOKEN #IMPLIED colwidth CDATA #IMPLIED colsep %yesorno; #IMPLIED rowsep %yesorno; #IMPLIED align (left|right|center|justify|char) #IMPLIED char CDATA #IMPLIED charoff NMTOKEN #IMPLIED %tbl.colspec.att; > <!-- Default declarations previously defined in this entity and referenced below include: ENTITY % tbl.thead.att "" --> <!--doc:A table header consisting of one or more rows.--> <!ELEMENT thead (row+)> <!ATTLIST thead valign (top|middle|bottom) #IMPLIED %tbl.thead.att; > <!-- Default declarations previously defined in this entity and referenced below include: ENTITY % tbl.tbody.att "" --> <!--doc:A wrapper for the rows of a table or informal table.--> <!ELEMENT tbody (%tbl.tbody.mdl;)> <!ATTLIST tbody valign (top|middle|bottom) #IMPLIED %tbl.tbody.att; > <!-- Default declarations previously defined in this entity and referenced below include: ENTITY % tbl.row.mdl "entry+" ENTITY % tbl.row.att "" --> <!--doc:A row in a table.--> <!ELEMENT row (%tbl.row.mdl;)> <!ATTLIST row rowsep %yesorno; #IMPLIED valign (top|middle|bottom) #IMPLIED %tbl.row.att; > <!-- Default declarations previously defined in this entity and referenced below include: ENTITY % paracon "#PCDATA" ENTITY % tbl.entry.mdl "(%paracon;)*" ENTITY % tbl.entry.att "" --> <!--doc:A cell in a table.--> <!ELEMENT entry (%tbl.entry.mdl;)*> <!ATTLIST entry colname NMTOKEN #IMPLIED namest NMTOKEN #IMPLIED nameend NMTOKEN #IMPLIED morerows NMTOKEN #IMPLIED colsep %yesorno; #IMPLIED rowsep %yesorno; #IMPLIED align (left|right|center|justify|char) #IMPLIED char CDATA #IMPLIED charoff NMTOKEN #IMPLIED valign (top|middle|bottom) #IMPLIED %tbl.entry.att; > �������������������������������������������������������������������������������������������������������������������������������������������������������������������conky-1.12.2/doc/docgen.sh��������������������������������������������������������������������������0000664�0000000�0000000�00000000602�14041272775�0015267�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh xsltproc http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl docs.xml > docs.html && \ db2x_xsltproc -s man docs.xml -o docs.mxml && \ db2x_manxml docs.mxml && \ { echo ".TH CONKY 1 \"August 2005\" \"conky compiled August 2005\" \"User Commands\""; sed 1d < conky.1; } > conky.2 && \ mv conky.2 conky.1 && \ man ./conky.1 | col -b > README && \ mv README ../ ������������������������������������������������������������������������������������������������������������������������������conky-1.12.2/doc/docs.xml���������������������������������������������������������������������������0000664�0000000�0000000�00000030047�14041272775�0015154�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "docbook-xml/docbookx.dtd" [ <!ENTITY command_options SYSTEM "command_options.xml"> <!ENTITY config_settings SYSTEM "config_settings.xml"> <!ENTITY variables SYSTEM "variables.xml"> <!ENTITY lua SYSTEM "lua.xml"> ]> <refentry> <refentryinfo> <address> <email>brenden1@users.sourceforge.net</email> </address> <author> <firstname>Brenden</firstname> <surname>Matthews</surname> </author> <date>2012-05-03</date> </refentryinfo> <refmeta> <refentrytitle>conky</refentrytitle> <manvolnum>1</manvolnum> </refmeta> <refnamediv> <refname>conky</refname> <refpurpose>A system monitor for X originally based on the torsmo code, but more kickass. It just keeps on given'er. Yeah.</refpurpose> </refnamediv> <refsynopsisdiv> <cmdsynopsis> <command>conky</command> <arg> <replaceable>options</replaceable> </arg> </cmdsynopsis> </refsynopsisdiv> <refsect1> <title>Description Conky is a system monitor for X originally based on torsmo. Since its inception, Conky has changed significantly from its predecessor, while maintaining simplicity and configurability. Conky can display just about anything, either on your root desktop or in its own window. Not only does Conky have many built-in objects, it can also display just about any piece of information by using scripts and other external programs. Conky has more than 250 built in objects, including support for a plethora of OS stats (uname, uptime, CPU usage, mem usage, disk usage, "top" like process stats, and network monitoring, just to name a few), built in IMAP and POP3 support, built in support for many popular music players (MPD, XMMS2, Audacious), and much much more. Conky can display this info either as text, or using simple progress bars and graph widgets, with different fonts and colours. We are always looking for help, whether its reporting bugs, writing patches, or writing docs. Please use the facilities at SourceForge to make bug reports, feature requests, and submit patches, or stop by #conky on irc.freenode.net if you have questions or want to contribute. Thanks for your interest in Conky. Compiling For users compiling from source on a binary distro, make sure you have the X development libraries installed (Unless you configure your build without X11). This should be a package along the lines of "libx11-dev" or "xorg-x11-dev" for X11 libs, and similar "-dev" format for the other libs required (depending on your build options). You should be able to see which extra packages you need to install by reading errors that you get from running `cmake'. The easiest way to view the available build options is to run `ccmake' or `cmake-gui' from the source tree, but be careful when disabling certain features as you may lose desired functionality. E.g., with BUILD_MATH disabled you won't get errors but logarithmic graphs will be normal graphs and gauges will miss their line. Conky has (for some time) been available in the repositories of most popular distributions. Here are some installation instructions for a few: Gentoo users -- Conky is in Gentoo's Portage... simply use "emerge app-admin/conky" for installation. Debian, etc. users -- Conky should be in your repositories, and can be installed by doing "aptitude install conky". Example to compile and run Conky with default components (note that some build options may differ for your system): Conky has been tested to be compatible with C99 C and C++0x C++, however it has not been tested with anything other than gcc, and is not guaranteed to work with other compilers. TIP: Try configuring Conky with `ccmake' or `cmake-gui' instead of just `cmake'. You Should Know Conky is generally very good on resources. That said, the more you try to make Conky do, the more resources it is going to consume. An easy way to force Conky to reload your ~/.config/conky/conky.conf: "killall -SIGUSR1 conky". Saves you the trouble of having to kill and then restart. Options Command line options override configurations defined in configuration file.&command_options; Configuration Settings Default configuration file location is ~/.config/conky/conky.conf or ${sysconfdir}/conky/conky.conf. On most systems, sysconfdir is /etc, and you can find the sample config file there in /etc/conky/conky.conf. You might want to copy it to ~/.config/conky/conky.conf and then start modifying it. Other configs can be found at https://github.com/brndnmtthws/conky.&config_settings; Objects/Variables Colours are parsed using XParsecolor(), there might be a list of them: /usr/share/X11/rgb.txt. Colour can be also in #rrggbb format (hex). Some objects may create threads, and sometimes these threads will not be destroyed until Conky terminates. There is no way to destroy or clean up threads while Conky is running. For example, if you use an MPD variable, the MPD thread will keep running until Conky dies. Some threaded objects will use one of the parameters as a 'key', so that you only have 1 relevant thread running (for example, the $curl, $rss and $weather objects launch one thread per URI).&variables; Lua API Conky features a Lua Programming API, and also ships with Lua bindings for some useful libraries. Note that the bindings require tolua++, which currently only compiles against Lua 5.1. To use Lua Conky, you first need to make sure you have a version of Conky with Lua support enabled (``conky -v'' will report this). Conky defines certain global functions and variables which can be accessed from Lua code running in Conky. Scripts must first be loaded using the lua_load configuration option. You then call functions in Lua via Conky's $lua, $lua_read, and Lua hooks. Be careful when creating threaded objects through the Lua API. You could wind up with a whole bunch of threads running if a thread is created with each iteration. At this time, the Lua API should not be considered stable and may change drastically from one release to another as it matures. NOTE: In order to accommodate certain features in the cairo library's API, Conky will export a few additional functions for the creation of certain structures. These are documented below.&lua; Examples Start Conky in its own window with date and clock as text and 30 sec update interval. Start Conky to background at coordinates (5, 500). Do not start Conky, but have it output the builtin default config file to ~/.config/conky/conky.conf for later customising. Files ${sysconfdir}/conky/conky.conf Default system-wide configuration file. The value of ${sysconfdir} depends on the compile-time options (most likely /etc). ~/.config/conky/conky.conf Default personal configuration file. Bugs Drawing to root or some other desktop window directly doesn't work with all window managers. Especially doesn't work well with Gnome and it has been reported that it doesn't work with KDE either. Nautilus can be disabled from drawing to desktop with program gconf-editor. Uncheck show_desktop in /apps/nautilus/preferences/. There is -w switch in Conky to set some specific window id. You might find xwininfo -tree useful to find the window to draw to. You can also use -o argument which makes Conky to create its own window. If you do try running Conky in its own window, be sure to read up on the own_window_type settings and experiment. See Also https://github.com/brndnmtthws/conky #conky on irc.freenode.net Copying Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. Any original torsmo code is licensed under the BSD license (see LICENSE.BSD for a copy). All code written since the fork of torsmo is licensed under the GPL (see LICENSE.GPL for a copy), except where noted differently (such as in portmon and audacious code which are LGPL, and prss which is an MIT-style license). Authors The Conky dev team (see AUTHORS for a full list of contributors). conky-1.12.2/doc/lua.xml000066400000000000000000000214321404127277500150030ustar00rootroot00000000000000 This function takes a string that is evaluated as per Conky's TEXT section, and then returns a string with the result. Sets Conky's update interval (in seconds) to 'number'. This table contains some information about Conky's window. The following table describes the values contained: drawable visual display width height border_inner_margin border_outer_margin border_width text_start_x text_start_y text_width text_height NOTE: This table is only defined when X support is enabled. This table contains some information about Conky's internal data. The following table describes the values contained: update_interval A string containing the build info for this particular instance of Conky, including the version, build date, and architecture. A string containing the build date for this particular instance of Conky. A string containing the build architecture for this particular instance of Conky. A string containing the version of the current instance of Conky. A string containing the path of the current Conky configuration file. Call this function to return a new cairo_text_extents_t structure. A creation function for this structure is not provided by the cairo API. After calling this, you should use tolua.takeownership() on the return value to ensure ownership is passed properly. Call this function to return a new cairo_font_extents_t structure. A creation function for this structure is not provided by the cairo API. After calling this, you should use tolua.takeownership() on the return value to ensure ownership is passed properly. Call this function to return a new cairo_matrix_t structure. A creation function for this structure is not provided by the cairo API. After calling this, you should use tolua.takeownership() on the return value to ensure ownership is passed properly. Call this function to free memory allocated by cairo_text_extents_t:create. Call this function to free memory allocated by cairo_font_extents_t:create. Call this function to free memory allocated by cairo_matrix_t:create. conky-1.12.2/doc/lua.xsl000066400000000000000000000030341404127277500150070ustar00rootroot00000000000000 Lua API -

    #fffafa #b4cdcd
    Name Type Details
    conky-1.12.2/doc/variables.xml000066400000000000000000005172041404127277500162010ustar00rootroot00000000000000 ACPI ac adapter state. On linux, the adapter option specifies the subfolder of /sys/class/power_supply containing the state information (tries "AC" and "ADP1" if there is no argument given). Non-linux systems ignore it. ACPI fan state. ACPI temperature in C. IP address for an interface, or "No Address" if no address is assigned. IP addresses for an interface (if one - works like addr). Linux only. CPU temperature from therm_adt746x. Fan speed from therm_adt746x. Align text to centre. Right-justify text, with space of N. Sets up the connection to apcupsd daemon. Prints nothing, defaults to localhost:3551. Prints the UPS connection type. Current battery capacity in percent. Reason for last transfer from line to battery. Nominal input voltage. Current load in percent. Bar showing current load. Gauge that shows current load. History graph of current load. Prints the model of the UPS. Prints the UPS user-defined name. Prints current status (on-line, on-battery). Current internal temperature. Time left to run on battery. Prints the UPS mode (e.g. standalone). Display APM AC adapter status. FreeBSD, OpenBSD only. Display APM battery life in percent. FreeBSD, OpenBSD only. Display remaining APM battery life in hh:mm:ss or "unknown" if AC adapterstatus is on-line or charging. FreeBSD, OpenBSD only. Progress bar. Bitrate of current tune. Number of audio channels of current tune. Full path and filename of current tune. Sampling frequency of current tune. Total length of current tune as MM:SS. Total length of current tune in seconds. The current volume fetched from Audacious. Number of tunes in playlist. Playlist position of current tune. Position of current tune (MM:SS). Position of current tune in seconds. Player status (Playing/Paused/Stopped/Not running). Title of current tune with optional maximum length specifier. Battery status and remaining percentage capacity of ACPI or APM battery. ACPI battery number can be given as argument (default is BAT0). Battery percentage remaining of ACPI battery in a bar. ACPI battery number can be given as argument (default is BAT0, use all to get the mean percentage remaining for all batteries). Battery percentage remaining for ACPI battery. ACPI battery number can be given as argument (default is BAT0, use all to get the mean percentage remaining for all batteries). Battery status and remaining percentage capacity of ACPI or APM battery. ACPI battery number can be given as argument (default is BAT0). This mode display a short status, which means that C is displayed instead of charging, D for discharging, F for full, N for not present, E for empty and U for unknown. Battery status for ACPI battery. ACPI battery number can be given as argument (default is BAT0). Battery charge/discharge time remaining of ACPI battery. ACPI battery number can be given as argument (default is BAT0). Let 'text_and_other_conky_vars' blink on and off. Amount of memory buffered. Amount of memory cached. Reads a file and displays the contents in conky. This is useful if you have an independent process generating output that you want to include in conky. Reads a file and displays the contents in conky. This is useful if you have an independent process generating output that you want to include in conky. This differs from $cat in that it parses the contents of the file, so you can insert things like ${color red}hi!${color} in your file and have it correctly parsed by Conky. PID of the first process that has string in its commandline. Print aaa status of cmus (all/artist/album). Prints the album of the current cmus song. Prints the artist of the current cmus song. Current time of the current cmus song. Print the file name of the current cmus song. Print the date of the current cmus song. Print the genre name of the current cmus song. Percent of song's progress. cmus' progress bar. Random status of cmus (on/off). Repeat status of cmus (song/all/off). Current state of cmus (playing, paused, stopped etc). Time left of the current cmus song. Prints the title of the current cmus song. Total length of the current cmus song. Print track number of current cmus song. Change drawing color to 'color' which is a name of a color or a hexcode preceded with #, e.g. #0A1B2C. If you use ncurses only the following colors are supported: red, green, yellow, blue, magenta, cyan, black, and white. Change drawing color to colorN configuration option, where N is a digit between 0 and 9, inclusively. Places the lines of var2 to the right of the lines of var1 separated by the chars that are put between var1 and var2. For example: ${combine ${head /proc/cpuinfo 2} - ${head /proc/meminfo 1}} gives as output "cpuinfo_line1 - meminfo_line1" on line 1 and "cpuinfo_line2 -" on line 2. $combine vars can also be nested to place more vars next to each other. CPU architecture Conky was built for. Date Conky was built. Conky version. CPU usage in percents. For SMP machines, the CPU number can be provided as an argument. ${cpu cpu0} is the total usage, and ${cpu cpuX} (X >= 1) are individual CPUs. Bar that shows CPU usage, height is bar's height in pixels. See $cpu for more info on SMP. Elliptical gauge that shows CPU usage, height and width are gauge's vertical and horizontal axis respectively. See $cpu for more info on SMP. CPU usage graph, with optional colours in hex, minus the #. See $cpu for more info on SMP. Uses a logarithmic scale (to see small numbers) when you use the -l switch. Takes the switch '-t' to use a temperature gradient, which makes the gradient values change depending on the amplitude of a particular graph value (try it and see). Download data from URI using Curl at the specified interval. The interval may be a positive floating point value (0 is allowed), otherwise defaults to 15 minutes. Most useful when used in conjunction with Lua and the Lua API. This object is threaded, and once a thread is created it can't be explicitly destroyed. One thread will run for each URI specified. You can use any protocol that Curl supports. Number of the desktop on which conky is running or the message "Not running in X" if this is the case. Name of the desktop on which conky is running or the message "Not running in X" if this is the case. Number of desktops or the message "Not running in X" if this is the case. Disk protection status, if supported (needs kernel-patch). Prints either "frozen" or "free " (note the padding). Displays current disk IO. Device is optional, and takes the form of sda for /dev/sda. A block device label can be specified with label:foo and a block device partuuid can be specified with partuuid:40000000-01. Displays current disk IO for reads. Device as in diskio. Displays current disk IO for writes. Device as in diskio. Disk IO graph, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Uses a logarithmic scale (to see small numbers) when you use -l switch. Takes the switch '-t' to use a temperature gradient, which makes the gradient values change depending on the amplitude of a particular graph value (try it and see). Disk IO graph for reads, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Device as in diskio. Uses a logarithmic scale (to see small numbers) when you use -l switch. Takes the switch '-t' to use a temperature gradient, which makes the gradient values change depending on the amplitude of a particular graph value (try it and see). Disk IO graph for writes, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Device as in diskio. Uses a logarithmic scale (to see small numbers) when you use -l switch. Takes the switch '-t' to use a temperature gradient, which makes the gradient values change depending on the amplitude of a particular graph value (try it and see). The name of the distribution. It could be that some of the untested distributions will show up wrong or as "unknown", if that's the case post a bug on sourceforge, make sure it contains the name of your distribution, the contents of /proc/version and if there is a file that only exists on your distribution, also add the path of that file in the bug. If there is no such file, please add another way which we can use to identify your distribution. Download speed in suitable IEC units. Download speed in KiB with one decimal. Download speed graph, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Uses a logarithmic scale (to see small numbers) when you use -l switch. Takes the switch '-t' to use a temperature gradient, which makes the gradient values change depending on the amplitude of a particular graph value (try it and see). Number of mails marked as draft in the specified mailbox or mail spool if not. Only maildir type mailboxes are supported, mbox type will return -1. Text to show if any of the above are not true. Ends an $if block. Current entropy available for crypto freaks. Normalized bar of available entropy for crypto freaks. Percentage of entropy available in comparison to the poolsize. Total size of system entropy pool for crypto freaks. Evaluates given string according to the rules of conky.text interpretation, i.e. parsing any contained text object specifications into their output, any occurring '$$' into a single '$' and so on. The output is then being parsed again. Executes a shell command and displays the output in conky. Warning: this takes a lot more resources than other variables. I'd recommend coding wanted behaviour in C/C++ and posting a patch. Same as exec, except if the first value returned is a value between 0-100, it will use that number to draw a horizontal bar. The height and width parameters are optional, and default to the default_bar_height and default_bar_width config settings, respectively. Same as exec, except if the first value returned is a value between 0-100, it will use that number to draw a round gauge (much like a vehicle speedometer). The height and width parameters are optional, and default to the default_gauge_height and default_gauge_width config settings, respectively. Draws a horizontally scrolling graph with values from 0-100 plotted on the vertical axis. All parameters following the command are optional. Gradient colors can be specified as hexadecimal values with no 0x or # prefix. Use the -t switch to enable a temperature gradient, so that small values are "cold" with color 1 and large values are "hot" with color 2. Without the -t switch, the colors produce a horizontal gradient spanning the width of the graph. The scale parameter defines the maximum value of the graph. Use the -l switch to enable a logarithmic scale, which helps to see small values. The default size for graphs can be controlled via the default_graph_height and default_graph_width config settings. If you need to execute a command with spaces, you have a couple options: 1) wrap your command in double-quotes, or 2) put your command into a separate file, such as ~/bin/myscript.sh, and use that as your execgraph command. Remember to make your script executable! In the following example, we set up execgraph to display seconds (0-59) on a graph that is 50px high and 200px wide, using a temperature gradient with colors ranging from red for small values (FF0000) to yellow for large values (FFFF00). We set the scale to 60. ${execgraph ~/seconds.sh 50,200 FF0000 FFFF00 60 -t} Same as exec, but with a specific interval in seconds. The interval can't be less than the update_interval in your configuration. See also $texeci. Same as execbar, but with an interval. Same as execgauge, but with an interval. Same as execgraph, but with an interval. Executes a shell command and displays the output in conky. Warning: this takes a lot more resources than other variables. I'd recommend coding wanted behaviour in C/C++ and posting a patch. This differs from $exec in that it parses the output of the command, so you can insert things like ${color red}hi!${color} in your script and have it correctly parsed by Conky. Caveats: Conky parses and evaluates the output of $execp every time Conky loops, and then destroys all the objects. If you try to use anything like $execi within an $execp statement, it will functionally run at the same interval that the $execp statement runs, as it is created and destroyed at every interval. Same as execp, but with an interval. Note that the output from the $execpi command is still parsed and evaluated at every interval. Number of mails marked as flagged in the specified mailbox or mail spool if not. Only maildir type mailboxes are supported, mbox type will return -1. Specify a different font. This new font will apply to the current line and everything following. You can use a $font with no arguments to change back to the default font (much like with $color). Change font to fontN configuration option, where N is a digit between 0 and 9, inclusively. Format time given in seconds. This var only works when the times_in_seconds configuration setting is on. Format is a string that should start and end with a "-char. The "-chars are not part of the output, \w,\d,\h,\m,\s,\(,\) and \\ are replaced by weeks,days,hours,minutes,seconds,(,) and \. If you leave out a unit, it's value will be expressed in the highest unit lower than the one left out. Text between ()-chars will not be visible if a replaced unit in this text is 0. If seconds is a decimal number then you can see the numbers behind the point by using \S followed by a number that specifies the amount of digits behind the point that you want to see (maximum 9). You can also place a 'x' behind \S so you have all digits behind the point and no trailing zero's. (also maximum 9). Number of mails marked as forwarded in the specified mailbox or mail spool if not. Only maildir type mailboxes are supported, mbox type will return -1. Returns CPU #n's frequency in MHz. CPUs are counted from 1. If omitted, the parameter defaults to 1. Returns CPU #n's frequency in GHz. CPUs are counted from 1. If omitted, the parameter defaults to 1. Returns CPU #n's clock speed from assembly in MHz. CPUs are counted from 1. If omitted, the parameter defaults to 1. Bar that shows how much space is used on a file system. height is the height in pixels. fs is any file on that file system. Bar that shows how much space is free on a file system. height is the height in pixels. fs is any file on that file system. Free space on a file system available for users. Free percentage of space on a file system available for users. File system size. File system type. File system used space. Percent of file system used space. Number of GitHub notifications. The next element will be printed at position 'x'. Displays the default route's interface or "multiple"/"none" accordingly. Displays the default gateway's IP or "multiple"/"none" accordingly. Displays temperature of a selected hard disk drive as reported by the hddtemp daemon. Use hddtemp_host and hddtemp_port to specify a host and port for all hddtemp objects. If no dev parameter is given, the first disk returned by the hddtemp daemon is used. Displays first N lines of supplied text file. The file is checked every 'next_check' update. If next_check is not supplied, Conky defaults to 2. Max of 30 lines can be displayed, or until the text buffer is filled. Horizontal line, height is the height in pixels. Hwmon sensor from sysfs (Linux 2.6). Parameter dev can be: 1) Number. e.g '1' means hwmon1. 2) Module name. e.g. 'k10temp' means the first hwmon device whose module name is 'k10temp. 3) Omitted. Then the first hwmon device (hwmon0) will be used. Parameter type is either 'in' or 'vol' meaning voltage; 'fan' meaning fan; 'temp' meaning temperature. Parameter n is number of the sensor. See /sys/class/hwmon/ on your local computer. The optional arguments 'factor' and 'offset' allow precalculation of the raw input, which is being modified as follows: 'input = input * factor + offset'. Note that they have to be given as decimal values (i.e. contain at least one decimal place). Display interface names starting from 1, eg ${iface 1}. I2C sensor from sysfs (Linux 2.6). Parameter dev may be omitted if you have only one I2C device. Parameter type is either 'in' or 'vol' meaning voltage; 'fan' meaning fan; 'temp' meaning temperature. Parameter n is number of the sensor. See /sys/bus/i2c/devices/ on your local computer. The optional arguments 'factor' and 'offset' allow precalculation of the raw input, which is being modified as follows: 'input = input * factor + offset'. Note that they have to be given as decimal values (i.e. contain at least one decimal place). If running the i8k kernel driver for Inspiron laptops, displays whether ac power is on, as listed in /proc/i8k (translated to human-readable). Beware that this is by default not enabled by i8k itself. If running the i8k kernel driver for Inspiron laptops, displays the bios version as listed in /proc/i8k. If running the i8k kernel driver for Inspiron laptops, displays the volume buttons status as listed in /proc/i8k. If running the i8k kernel driver for Inspiron laptops, displays the cpu temperature in Celsius, as reported by /proc/i8k. If running the i8k kernel driver for Inspiron laptops, displays the left fan's rate of rotation, in revolutions per minute as listed in /proc/i8k. Beware, some laptops i8k reports these fans in reverse order. If running the i8k kernel driver for Inspiron laptops, displays the left fan status as listed in /proc/i8k (translated to human-readable). Beware, some laptops i8k reports these fans in reverse order. If running the i8k kernel driver for Inspiron laptops, displays the right fan's rate of rotation, in revolutions per minute as listed in /proc/i8k. Beware, some laptops i8k reports these fans in reverse order. If running the i8k kernel driver for Inspiron laptops, displays the right fan status as listed in /proc/i8k (translated to human-readable). Beware, some laptops i8k reports these fans in reverse order. If running the i8k kernel driver for Inspiron laptops, displays your laptop serial number as listed in /proc/i8k. If running the i8k kernel driver for Inspiron laptops, displays the version formatting of /proc/i8k. If running the IBM ACPI, displays the brigtness of the laptops's LCD (0-7). If running the IBM ACPI, displays the fan speed. If running the IBM ACPI, displays the temperatures from the IBM temperature sensors (N=0..7) Sensor 0 is on the CPU, 3 is on the GPU. If running the IBM ACPI, displays the status of your ThinkLightâ„¢. Value is either 'on', 'off' or 'unknown'. If running the IBM ACPI, displays the "master" volume, controlled by the volume keys (0-14). Shows title of event number 'number' in the ical (RFC 5545) file 'file'. The events are first ordered by starting time, events that started in the past are ignored. The events that are shown are the VEVENTS, the title that is shown is the SUMMARY and the starting time used for sorting is DTSTART. Shows everything that's being told in #channel on IRCserver 'server'. TCP-port 6667 is used for the connection unless 'port' is specified. Shows everything since the last time or the last 'max_msg_lines' entries if specified. Convert text from one codeset to another using GNU iconv. Needs to be stopped with iconv_stop. Stop iconv codeset conversion. if conky variable VAR is empty, display everything between $if_empty and the matching $endif. if FILE exists, display everything between if_existing and the matching $endif. The optional second parameter checks for FILE containing the specified string and prints everything between $if_existing and the matching $endif. if there is at least one default gateway, display everything between $if_gw and the matching $endif. Evaluates the given boolean expression, printing everything between $if_match and the matching $endif depending on whether the evaluation returns true or not. Valid expressions consist of a left side, an operator and a right side. Left and right sides are being parsed for contained text objects before evaluation. Recognised left and right side types are: doubleArgument consists of only digits and a single dot. longArgument consists of only digits. stringArgument is enclosed in quotation marks. (") Valid operands are: '>', '<', '>=', '<=', '==', '!='. If mixer exists, display everything between $if_mixer_mute and the matching $endif. If no mixer is specified, "Vol" is used. if MOUNTPOINT is mounted, display everything between $if_mounted and the matching $endif. if mpd is playing or paused, display everything between $if_mpd_playing and the matching $endif. If Pulseaudio's default sink is muted, display everything between $if_pa_sink_muted and the corresponding $else or $endif. If PROCESS is running, display everything between $if_running and the corresponding $else or $endif. Note that PROCESS may be either a full command line with arguments (without the directory prefix), or simply the name of an executable. For example, either of the following will be true if there is a running process with the command line /usr/bin/conky -u 5: ${if_running conky -u 5}or ${if_running conky} It is important not to include trailing spaces. For example, ${if_running conky }will be false. when using smapi, if the battery with index INDEX is installed, display everything between $if_smapi_bat_installed and the matching $endif. if INTERFACE exists and is up, display everything between $if_up and the matching $endif. If it's the UPDATENR-th time that conky updates, display everything between $if_updatenr and the matching $endif. The counter resets when the highest UPDATENR is reached. Example : "{$if_updatenr 1}foo$endif{$if_updatenr 2}bar$endif{$if_updatenr 4}$endif" shows foo 25% of the time followed by bar 25% of the time followed by nothing the other half of the time. Display everything between $if_xmms2_connected and the matching $endif if xmms2 is running. Renders an image from the path specified using Imlib2. Takes 4 optional arguments: a position, a size, a no-cache switch, and a cache flush interval. Changing the x,y position will move the position of the image, and changing the WxH will scale the image. If you specify the no-cache flag (-n), the image will not be cached. Alternately, you can specify the -f int switch to specify a cache flush interval for a particular image. Example: ${image /home/brenden/cheeseburger.jpg -p 20,20 -s 200x200} will render 'cheeseburger.jpg' at (20,20) scaled to 200x200 pixels. Conky does not make any attempt to adjust the position (or any other formatting) of images, they are just rendered as per the arguments passed. The only reason $image is part of the conky.text section, is to allow for runtime modifications, through $execp $lua_parse, or some other method. Displays the number of messages in your global IMAP inbox by default. You can define individual IMAP inboxes separately by passing arguments to this object. Arguments are: "host user pass [-i interval (in seconds)] [-f 'folder'] [-p port] [-e 'command'] [-r retries]". Default port is 143, default folder is 'INBOX', default interval is 5 minutes, and default number of retries before giving up is 5. If the password is supplied as '*', you will be prompted to enter the password when Conky starts. Displays the number of unseen messages in your global IMAP inbox by default. You can define individual IMAP inboxes separately by passing arguments to this object. Arguments are: "host user pass [-i interval (in seconds)] [-f 'folder'] [-p port] [-e 'command'] [-r retries]". Default port is 143, default folder is 'INBOX', default interval is 5 minutes, and default number of retries before giving up is 5. If the password is supplied as '*', you will be prompted to enter the password when Conky starts. Display the brightness of your Intel backlight in percent. Prints the current ioscheduler used for the given disk name (i.e. e.g. "hda" or "sdb"). Displays last N lines of the systemd journal. The optional type can be 'user' or 'system' which will show only the user or system journal respectively. By default, all journal lines visible to the user are shown. A maximum of 200 lines can be displayed, or until the text buffer is filled. Kernel version. An indicator for Capital Lock key. An indicator for Number Lock key. An indicator for Scrolling Lock key. Display keyboard layout. Git version number. DragonFly only. The value of /proc/sys/vm/laptop_mode. Displays the number of lines in the given file. System load average, 1 is for past 1 minute, 2 for past 5 minutes and 3 for past 15 minutes. Without argument, prints all three values separated by whitespace. Load1 average graph, similar to xload, with optional colours in hex, minus the #. Uses a logarithmic scale (to see small numbers) when you use the -l switch. Takes the switch '-t' to use a temperature gradient, which makes the gradient values change depending on the amplitude of a particular graph value (try it and see). Executes a Lua function with given parameters, then prints the returned string. See also 'lua_load' on how to load scripts. Conky puts 'conky_' in front of function_name to prevent accidental calls to the wrong function unless you put you place 'conky_' in front of it yourself. Executes a Lua function with given parameters and draws a bar. Expects result value to be an integer between 0 and 100. See also 'lua_load' on how to load scripts. Conky puts 'conky_' in front of function_name to prevent accidental calls to the wrong function unless you put you place 'conky_' in front of it yourself. Executes a Lua function with given parameters and draws a gauge. Expects result value to be an integer between 0 and 100. See also 'lua_load' on how to load scripts. Conky puts 'conky_' in front of function_name to prevent accidental calls to the wrong function unless you put you place 'conky_' in front of it yourself. Executes a Lua function with and draws a graph. Expects result value to be any number, and by default will scale to show the full range. See also 'lua_load' on how to load scripts. Takes the switch '-t' to use a temperature gradient, which makes the gradient values change depending on the amplitude of a particular graph value (try it and see). Conky puts 'conky_' in front of function_name to prevent accidental calls to the wrong function unless you put you place 'conky_' in front of it yourself. Executes a Lua function with given parameters as per $lua, then parses and prints the result value as per the syntax for the conky.text section. See also 'lua_load' on how to load scripts. Conky puts 'conky_' in front of function_name to prevent accidental calls to the wrong function unless you put you place 'conky_' in front of it yourself. Machine, e.g. i686, x86_64. Mail count in the specified mailbox or your mail spool if not. Both mbox and maildir type mailboxes are supported. You can use a program like fetchmail to get mails from some server using your favourite protocol. See also new_mails. Print a summary of recent messages in an mbox format mailbox. mbox parameter is the filename of the mailbox (can be encapsulated using '"', ie. ${mboxscan -n 10 "/home/brenden/some box"} Amount of memory in use. Amount of memory in use, including that used by system buffers and caches. Bar that shows amount of memory in use. Bar that shows amount of memory in use (including memory used by system buffers and caches). Memory usage graph including memory used by system buffers and cache. Uses a logarithmic scale (to see small numbers) when you use the -l switch. Takes the switch '-t' to use a temperature gradient, which makes the gradient values change depending on the amplitude of a particular graph value (try it and see). Amount of "dirty" memory. Linux only. Amount of free memory including the memory that is very easily freed (buffers/cache). Amount of free memory. Amount of memory used, calculated the same way as in the `free` program. Gauge that shows amount of memory in use (see cpugauge). Memory usage graph. Uses a logarithmic scale (to see small numbers) when you use the -l switch. Takes the switch '-t' to use a temperature gradient, which makes the gradient values change depending on the amplitude of a particular graph value (try it and see). Total amount of memory. Percentage of memory in use. Prints the mixer value as reported by the OS. On Linux, this variable uses the OSS emulation, so you need the proper kernel module loaded. Default mixer is "Vol", but you can specify one of the available OSS controls: "Vol", "Bass", "Trebl", "Synth", "Pcm", "Spkr", "Line", "Mic", "CD", "Mix", "Pcm2 ", "Rec", "IGain", "OGain", "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", "PhoneIn", "PhoneOut", "Video", "Radio" and "Monitor". Displays mixer value in a bar as reported by the OS. See docs for $mixer for details on arguments. Prints the left channel mixer value as reported by the OS. See docs for $mixer for details on arguments. Displays the left channel mixer value in a bar as reported by the OS. See docs for $mixer for details on arguments. Prints the right channel mixer value as reported by the OS. See docs for $mixer for details on arguments. Displays the right channel mixer value in a bar as reported by the OS. See docs for $mixer for details on arguments. Album of the current MOC song. Artist of the current MOC song. Bitrate in the current MOC song. Current time of the current MOC song. File name of the current MOC song. Rate of the current MOC song. The current song name being played in MOC. Current state of MOC; playing, stopped etc. Time left in the current MOC song. Title of the current MOC song. Total length of the current MOC song. Number of the monitor on which conky is running or the message "Not running in X" if this is the case. Number of monitors or the message "Not running in X" if this is the case. Display mouse speed. Album in current MPD song. Artist in current MPD song must be enabled at compile. Artist of the album of the current MPD song. Bar of mpd's progress. Bitrate of current song. Date of current song. Song's elapsed time. Prints the file name of the current MPD song. Song's length. Prints the MPD name field. Percent of song's progress. Random status (On/Off). Repeat status (On/Off). Prints the song name in either the form "artist - title" or file name, depending on whats available. Playing, stopped, et cetera. Title of current MPD song. Comment of current MPD song. Prints the MPD track field. MPD's volume. Shows the first field of the first row of the result of the query. Print a nameserver from /etc/resolv.conf. Index starts at and defaults to 0. Unread mail count in the specified mailbox or mail spool if not. Both mbox and maildir type mailboxes are supported. Hostname. Short hostname (same as 'hostname -s' shell command). Shows text and parses the vars in it, but doesn't update them. Use this for things that do not change while conky is running, like $machine, $conky_version,... By not updating this you can save some resources. Nvidia graphics card information via the XNVCtrl library. GPU_ID:Optional parameter to choose the GPU to be used as 0,1,2,3,.. Default parameter is 0 Possible arguments:(Temperatures are printed as float, all other values as integer. Bracketed arguments are aliases) gputemp( temp) gputempthreshold( threshold) ambienttemp( ambient) gpufreqcur( gpufreq) gpufreqmin gpufreqmax memfreqcur( memfreq) memfreqmin memfreqmax mtrfreqcur( mtrfreq) mtrfreqmin mtrfreqmax perflevelcur( perflevel) perflevelmin perflevelmax perfmode gpuutil membwutil videoutil pcieutil memused( mem) memfree( memavail) memmax( memtotal) memutil( memperc) fanspeed fanlevel imagequality modelname driverversion Same as nvidia, except it draws its output in a horizontal bar. The height and width parameters are optional, and default to the default_bar_height and default_bar_width config settings, respectively. GPU_ID:Optional parameter to choose the GPU to be used as 0,1,2,3,.. Default parameter is 0 Note the following arguments are incompatible: gputempthreshold( threshold) gpufreqmin gpufreqmax memfreqmin memfreqmax mtrfreqmin mtrfreqmax perflevelmin perflevelmax perfmode memtotal( memmax) fanspeed Same as nvidiabar, except a round gauge (much like a vehicle speedometer). The height and width parameters are optional, and default to the default_gauge_height and default_gauge_width config settings, respectively. GPU_ID:Optional parameter to choose the GPU to be used as 0,1,2,3,.. Default parameter is 0 For possible arguments see nvidia and nvidiabar. Same as nvidiabar, except a horizontally scrolling graph with values from 0-100 plotted on the vertical axis. The height and width parameters are optional, and default to the default_graph_height and default_graph_width config settings, respectively. GPU_ID:NOT optional. This parameter allows to choose the GPU to be used as 0,1,2,3,.. For possible arguments see nvidia and nvidiabar. To learn more about the -t -l and gradient color options, see execgraph. Move text over by N pixels. See also $voffset. Change outline color. Generate random passwords. Pulseaudio's default sink volume percentage. Pulseaudio's default sink volume bar. Pulseaudio's default sink description. Pulseaudio's default sink active port name. Pulseaudio's default sink active port description. Pulseaudio's default card name. Pulseaudio's default card active profile. If running on Apple powerbook/ibook, display information on battery status. The item parameter specifies, what information to display. Exactly one item must be specified. Valid items are: status percent time Directory used as rootdirectory by the process (this will be "/" unless the process did a chroot syscall). Command line this process was invoked with. Current working directory of the process. Contents of a environment-var of the process. List of environment-vars that the process can see. Path to executed command that started the process. The nice value of the process. List of files that the process has open. The pid of the parent of the process. The priority of the process (see 'priority' in "man 5 proc"). Total number of bytes read by the process. State of the process. One of the chars in "RSDZTW" representing the state of the process where R is running, S is sleeping in an interruptible wait, D is waiting in uninterruptible disk sleep, Z is zombie, T is traced or stopped (on a signal), and W is paging. Filedescriptor binded to the STDERR of the process. Filedescriptor binded to the STDIN of the process. Filedescriptor binded to the STDOUT of the process. Number of threads in process containing this thread. List with pid's from threads from this process. Amount of time that the process has been scheduled in kernel mode in seconds. Amount of time that the process has been scheduled in user mode in seconds. Sum of $pid_time_kernelmode and $pid_time_usermode. The real uid of the process. The effective uid of the process. The saved set uid of the process. The file system uid of the process. The real gid of the process. The effective gid of the process. The saved set gid of the process. The file system gid of the process. Peak virtual memory size of the process. Virtual memory size of the process. Locked memory size of the process. Peak resident set size ("high water mark") of the process. Resident set size of the process. Data segment size of the process. Stack segment size of the process. Text segment size of the process. Shared library code size of the process. Page table entries size of the process. Total number of bytes written by the process. Platform sensor from sysfs (Linux 2.6). Parameter dev may be omitted if you have only one platform device. Platform type is either 'in' or 'vol' meaning voltage; 'fan' meaning fan; 'temp' meaning temperature. Parameter n is number of the sensor. See /sys/bus/platform/devices/ on your local computer. The optional arguments 'factor' and 'offset' allow precalculation of the raw input, which is being modified as follows: 'input = input * factor + offset'. Note that they have to be given as decimal values (i.e. contain at least one decimal place). Displays the number of unseen messages in your global POP3 inbox by default. You can define individual POP3 inboxes separately by passing arguments to this object. Arguments are: "host user pass [-i interval (in seconds)] [-p port] [-e 'command'] [-r retries]". Default port is 110, default interval is 5 minutes, and default number of retries before giving up is 5. If the password is supplied as '*', you will be prompted to enter the password when Conky starts. Displays the amount of space (in MiB, 2^20) used in your global POP3 inbox by default. You can define individual POP3 inboxes separately by passing arguments to this object. Arguments are: "host user pass [-i interval (in seconds)] [-p port] [-e 'command'] [-r retries]". Default port is 110, default interval is 5 minutes, and default number of retries before giving up is 5. If the password is supplied as '*', you will be prompted to enter the password when Conky starts. Total processes (sleeping and running). Connects to a tcp port on a host (default is localhost), reads every char available at the moment and shows them. Connects to a udp port on a host (default is localhost), reads every char available at the moment and shows them. Number of mails marked as replied in the specified mailbox or mail spool if not. Only maildir type mailboxes are supported, mbox type will return -1. Download and parse RSS feeds. The interval may be a (floating point) value greater than 0. Action may be one of the following: feed_title, item_title (with num par), item_desc (with num par) and item_titles (when using this action and spaces_in_front is given conky places that many spaces in front of each item). This object is threaded, and once a thread is created it can't be explicitly destroyed. One thread will run for each URI specified. You can use any protocol that Curl supports. Running processes (not sleeping). Requires Linux 2.6. Number of running (runnable) threads. Linux only. Scroll 'text' by 'step' characters to the left or right (set 'direction' to 'left' or 'right' or 'wait') showing 'length' number of characters at the same time. The text may also contain variables. 'step' is optional and defaults to 1 if not set. 'direction' is optional and defaults to left if not set. When direction is 'wait' then text will scroll left and wait for 'interval' itertations at the beginning and end of the text. If a var creates output on multiple lines then the lines are placed behind each other separated with a '|'-sign. If you change the textcolor inside $scroll it will automatically have it's old value back at the end of $scroll. The end and the start of text will be separated by 'length' number of spaces unless direction is 'wait'. Number of mails marked as seen in the specified mailbox or mail spool if not. Only maildir type mailboxes are supported, mbox type will return -1. Prints info regarding System Integrity Protection (SIP) on macOS. If no switch is provided, prints SIP status (enabled / disabled), else, status of the specific SIP feature corresponding to the switch provided. Below are shown the available switches: SWITCH--------------------------RESULT--------------------------STATUS 0 apple internal YES/NO 1 forbid untrusted kexts YES/NO 2 forbid task-for-pid YES/NO 3 restrict filesystem YES/NO 4 forbid kernel-debugger YES/NO 5 restrict dtrace YES/NO 6 restrict nvram YES/NO 7 forbid device-configuration YES/NO 8 forbid any-recovery-os YES/NO 9 forbid user-approved-kexts YES/NO a uses unsupported configuration? (*) (*): If yes, prints "unsupported configuration, beware!" Else, prints "configuration is ok". ---------------------------------------------------------------------- USAGE: conky -t '${sip_status}' # print SIP status conky -t '${sip_status 0}' # print allows apple-internal? Yes or No? NOTES: * Available for all macOS versions (even the ones prior El Capitan where SIP was first introduced) * If run on versions prior El Capitan SIP is unavailable, so all you will get is "unsupported". Change shading color. when using smapi, display contents of the /sys/devices/platform/smapi directory. ARGS are either '(FILENAME)' or 'bat (INDEX) (FILENAME)' to display the corresponding files' content. This is a very raw method of accessing the smapi values. When available, better use one of the smapi_* variables instead. when using smapi, display the remaining capacity of the battery with index INDEX as a bar. when using smapi, display the remaining capacity in percent of the battery with index INDEX. This is a separate variable because it supports the 'use_spacer' configuration option. when using smapi, display the current power of the battery with index INDEX in watt. This is a separate variable because the original read out value is being converted from mW. The sign of the output reflects charging (positive) or discharging (negative) state. when using smapi, display the current temperature of the battery with index INDEX in degree Celsius. This is a separate variable because the original read out value is being converted from milli degree Celsius. Displays the Sony VAIO fanspeed information if sony-laptop kernel support is enabled. Linux only. Capitalises the start of each word. Converts all letters into lowercase. Converts all letters into uppercase. Strips all trailing whitespace from input. Stippled (dashed) horizontal line. Displays the data of a stock symbol. The following data is supported: adv(Average Daily Volume), ask, asksize, bid, askrt(ask realtime), bidrt(bid realtime), bookvalue, bidsize, change, commission, changert(change realtime), ahcrt(After Hours Change realtime), ds(dividend/share), ltd(Last Trade Date), tradedate, es(earnings/share), ei(error indication), epsecy(EPS Estimate Current Year), epseny(EPS Estimate Next Year), epsenq(EPS Estimate Next Quarter), floatshares, dayslow, dayshigh, 52weeklow, 52weekhigh, hgp(Holdings Gain Percent), ag(Annualized Gain), hg(Holdings Gain), hgprt(Holdings Gain Percent realtime), hgrt(Holdings Gain realtime), moreinfo, obrt(Order Book realtime), mc(Market Capitalization), mcrt(Market Cap realtime), ebitda, c52wlow(Change From 52-week Low), pc52wlow(Percent Change From 52-week Low), cprt(change percent realtime), lts(Last Trade Size), c52whigh(Change from 52-week high), pc52whigh(percent change from 52-week high), ltp(last trade price), hl(high limit), ll(low limit), dr(day's range), drrt(day's range realtime), 50ma(50-day Moving Average), 200ma(200-day Moving Average), c200ma(Change From 200-day Moving Average), pc200ma(Percent Change From 200-day Moving Average), c50ma(Change From 50-day Moving Average), pc50ma(Percent Change From 50-day Moving Average), name, notes, open, pc(previous close), pricepaid, cip(change in percent), ps(price/sales), pb(price/book), edv(Ex-Dividend Date), per(P/E Ratio), dpd(Dividend Pay Date), perrt(P/E Ratio realtime), pegr(PEG Ratio), pepsecy(Price/EPS Estimate Current Year), pepseny(Price/EPS Estimate Next Year), symbol, sharesowned, shortratio, ltt(Last Trade Time), tradelinks, tt(Ticker Trend), 1ytp(1 yr Target Price), volume, hv(Holdings Value), hvrt(Holdings Value realtime), 52weekrange, dvc(Day's Value Change), dvcrt(Day's Value Change realtime), se(Stock Exchange), dy(Dividend Yield). Amount of swap in use. Bar that shows amount of swap in use. Amount of free swap. Total amount of swap. Percentage of swap in use. System name, e.g. Linux. Print sysctl value by name. FreeBSD only. Puts a tab of the specified width, starting from column 'start'. The unit is pixels for both arguments. Displays last N lines of supplied text file. The file is checked every 'next_check' update. If next_check is not supplied, Conky defaults to 2. Max of 30 lines can be displayed, or until the text buffer is filled. Displays the number of microseconds it takes to get a reply on a ping to to tcp 'port' on 'host'. 'port' is optional and has 80 as default. This works on both open and closed ports, just make sure that the port is not behind a firewall or you will get 'down' as answer. It's best to test a closed port instead of an open port, you will get a quicker response. TCP port (both IPv6 and IPv4) monitor for specified local ports. Port numbers must be in the range 1 to 65535. Valid items are: count rip rhost rport rservice lip lhost lport lservice The connection index provides you with access to each connection in the port monitor. The monitor will return information for index values from 0 to n-1 connections. Values higher than n-1 are simply ignored. For the "count" item, the connection index must be omitted. It is required for all other items. Examples: ${tcp_portmon 6881 6999 count} ${tcp_portmon 22 22 rip 0} ${tcp_portmon 22 22 rip 9} ${tcp_portmon 1 1024 rhost 0} ${tcp_portmon 1 1024 rport 4} ${tcp_portmon 1 65535 lservice 14} Note that port monitor variables which share the same port range actually refer to the same monitor, so many references to a single port range for different items and different indexes all use the same monitor internally. In other words, the program avoids creating redundant monitors. Evaluate the content of the templateN configuration variable (where N is a value between 0 and 9, inclusively), applying substitutions as described in the documentation of the corresponding configuration variable. The number of arguments is optional, but must match the highest referred index in the template. You can use the same special sequences in each argument as the ones valid for a template definition, e.g. to allow an argument to contain a whitespace. Also simple nesting of templates is possible this way. Here are some examples of template definitions, note they are placed between [[ ... ]] instead of ' ... ': template0 = [[$\1\2]] template1 = [[\1: ${fs_used \2} / ${fs_size \2}]] template2 = [[\1 \2]] The following list shows sample usage of the templates defined above, with the equivalent syntax when not using any template at all: using template same without template ${template0 node name} $nodename ${template1 root /} root: ${fs_free /} / ${fs_size /} ${template1 ${template2\ disk\ root} /} disk root: ${fs_free /} / ${fs_size /}
    Runs a command at an interval inside a thread and displays the output. Same as $execi, except the command is run inside a thread. Use this if you have a slow script to keep Conky updating. You should make the interval slightly longer than the time it takes your script to execute. For example, if you have a script that take 5 seconds to execute, you should make the interval at least 6 seconds. See also $execi. This object will clean up the thread when it is destroyed, so it can safely be used in a nested fashion, though it may not produce the desired behaviour if used this way. Same as execpi, except the command is run inside a thread. Total threads. Local time, see "man strftime" to get more information about format. If 'size' is a number followed by a size-unit (kilobyte,mb,GiB,...) then it converts the size to bytes and shows it without unit, otherwise it just shows 'size'. This takes arguments in the form:top (name) (number) Basically, processes are ranked from highest to lowest in terms of cpu usage, which is what (num) represents. The types are: "name", "pid", "cpu", "mem", "mem_res", "mem_vsize", "time", "uid", "user", "io_perc", "io_read" and "io_write". There can be a max of 10 processes listed. Same as top, except sorted by the amount of I/O the process has done during the update interval. Same as top, except sorted by mem usage instead of cpu. Same as top, except sorted by total CPU time instead of current CPU usage. Total download, overflows at 4 GB on Linux with 32-bit arch and there doesn't seem to be a way to know how many times it has already done that before conky has started. Total upload, this one too, may overflow. Number of mails marked as trashed in the specified mailbox or mail spool if not. Only maildir type mailboxes are supported, mbox type will return -1. Local time for specified timezone, see man strftime to get more information about format. The timezone argument is specified in similar fashion as TZ environment variable. For hints, look in /usr/share/zoneinfo. e.g. US/Pacific, Europe/Zurich, etc. Name of group with this gid. Username of user with this uid. Number of mails not marked as flagged in the specified mailbox or mail spool if not. Only maildir type mailboxes are supported, mbox type will return -1. Number of mails not marked as forwarded in the specified mailbox or mail spool if not. Only maildir type mailboxes are supported, mbox type will return -1. Number of mails not marked as replied in the specified mailbox or mail spool if not. Only maildir type mailboxes are supported, mbox type will return -1. Number of new or unseen mails in the specified mailbox or mail spool if not. Only maildir type mailboxes are supported, mbox type will return -1. for debugging. Upload speed in suitable IEC units. Upload speed in KiB with one decimal. Upload speed graph, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Uses a logarithmic scale (to see small numbers) when you use the -l switch. Takes the switch '-t' to use a temperature gradient, which makes the gradient values change depending on the amplitude of a particular graph value (try it and see). Uptime. Uptime in a shorter format. Lists the names of the users logged in. Number of users logged in. Lists the consoles in use. Lists how long users have been logged in for. Lists how long the user for the given console has been logged in for. Display time in UTC (universal coordinate time). IPv6 addresses for an interface, followed by netmask if -n is specified and scope with -s. Scopes are Global(G), Host-local(H), Link-local(L), Site-local(S), Compat(C) and Unspecified(/). Linux only. Change vertical offset by N pixels. Negative values will cause text to overlap. See also $offset. Returns CPU #n's voltage in mV. CPUs are counted from 1. If omitted, the parameter defaults to 1. Returns CPU #n's voltage in V. CPUs are counted from 1. If omitted, the parameter defaults to 1. Download, parse and display METAR data. 'URI' must be a valid METAR URI. http://tgftp.nws.noaa.gov/data/observations/metar/stations/ 'locID' must be a valid location identifier for the required uri. For the NOAA site this must be a valid ICAO (see for instance https://pilotweb.nas.faa.gov/qryhtml/icao/). For the weather.com site this must be a valid location ID (see for instance http://aspnetresources.com/tools/locid.aspx). 'data_type' must be one of the following: last_update The date and time stamp of the data. The result depends on the URI used. For the NOAA site it is date (yyyy/mm/dd) and UTC time. For the weather.com one it is date ([m]m/[d]d/yy) and Local Time of the station. temperature Air temperature (you can use the 'temperature_unit' config setting to change units) cloud_cover The highest cloud cover status pressure Air pressure in millibar wind_speed Wind speed in km/h wind_dir Wind direction wind_dir_DEG Compass wind direction humidity Relative humidity in % weather Any relevant weather event (rain, snow, etc.). This is not used if you are querying the weather.com site since this data is aggregated into the cloud_cover one icon Weather icon (only for www.weather.com). Can be used together with the icon kit provided upon registering to their service. 'delay_in_minutes' (optional, default 30) cannot be less than 30 minutes. This object is threaded, and once a thread is created it can't be explicitly destroyed. One thread will run for each URI specified. Note that these variables are still EXPERIMENTAL and can be subject to many future changes. Download, parse and display weather forecast data for a given day (daytime only). 'locID', see 'weather' above. 'day' is a number from 0 (today) to 4 (3 days after tomorrow). 'data_type' must be one of the following: day date low hi icon forecast wind_speed wind_dir wind_dir_DEG humidity precipitation 'delay_in_minutes' (optional, default 210) cannot be lower than 210 min. This object is threaded, and once a thread is created it can't be explicitly destroyed. One thread will run for each URI specified. You can use any protocol that Curl supports. Note that these variables are still EXPERIMENTAL and can be subject to many future changes. Wireless access point MAC address. Linux only. Wireless bitrate (ie 11 Mb/s). Linux only. WLAN channel on which device 'net' is listening. Wireless access point ESSID. Linux only. Frequency on which device 'net' is listening. Wireless link quality bar. Linux only. Wireless link quality. Linux only. Wireless link quality maximum value. Linux only. Wireless link quality in percents. Linux only. Wireless mode (Managed/Ad-Hoc/Master). Linux only. Displays the number of words in the given file. Album in current XMMS2 song. Artist in current XMMS2 song. Bar of XMMS2's progress. Bitrate of current song. Comment in current XMMS2 song. Returns song's date. Duration of current song. Song's elapsed time. Genre in current XMMS2 song. XMMS2 id of current song. Percent of song's progress. Returns the XMMS2 playlist. Size of current song. Prints the song name in either the form "artist - title" or file name, depending on whats available. XMMS2 status (Playing, Paused, Stopped, or Disconnected). Number of times a song was played (presumably). Title in current XMMS2 song. Track number in current XMMS2 song. Full path to current song.
    conky-1.12.2/doc/variables.xsl000066400000000000000000000033671404127277500162070ustar00rootroot00000000000000 Conky Variables Conky Objects -

    #fffafa #b4cdcd
    Variable Arguments () = optional Explanation
    conky-1.12.2/extras/000077500000000000000000000000001404127277500142375ustar00rootroot00000000000000conky-1.12.2/extras/convert.lua000077500000000000000000000131051404127277500164250ustar00rootroot00000000000000#! /usr/bin/lua local usage = [[ Usage: convert.lua old_conkyrc [new_conkyrc] Tries to convert conkyrc from the old v1.x format to the new, lua-based format. Keep in mind that there is no guarantee that the output will work correctly with conky, or that it will be able to convert every conkyrc. However, it should provide a good starting point. Although you can use this script with only 1 arg and let it overwrite the old config, it's suggested to use 2 args so that the new config is written in a new file (so that you have backup if something went wrong). Optional: Install dos2unix. We will attempt to use this if it is available because Conky configs downloaded from Internet sometimes are created on DOS/Windows machines with different line endings than Conky configs created on Unix/Linux. For more information about the new format, read the wiki page ]]; local function quote(s) if not s:find("[\n'\\]") then return "'" .. s .. "'"; end; local q = ''; while s:find(']' .. q .. ']', 1, true) do q = q .. '='; end; return string.format('[%s[\n%s]%s]', q, s, q); end; local bool_setting = { background = true, disable_auto_reload = true, double_buffer = true, draw_borders = true, draw_graph_borders = true, draw_outline = true, draw_shades = true, extra_newline = true, format_human_readable = true, no_buffers = true, out_to_console = true, out_to_ncurses = true, out_to_stderr = true, out_to_x = true, override_utf8_locale = true, own_window = true, own_window_argb_visual = true, own_window_transparent = true, short_units = true, show_graph_range = true, show_graph_scale = true, times_in_seconds = true, top_cpu_separate = true, uppercase = true, use_xft = true, draw_blended = true, forced_redraw = true }; local num_setting = { border_inner_margin = true, border_outer_margin = true, border_width = true, cpu_avg_samples = true, diskio_avg_samples = true, gap_x = true, gap_y = true, imlib_cache_flush_interval = true, imlib_cache_size = true, max_port_monitor_connections = true, max_text_width = true, max_user_text = true, maximum_width = true, mpd_port = true, music_player_interval = true, net_avg_samples = true, own_window_argb_value = true, pad_percents = true, stippled_borders = true, text_buffer_size = true, top_name_width = true, total_run_times = true, update_interval = true, update_interval_on_battery = true, xftalpha = true, xinerama_head = true, }; local split_setting = { default_bar_size = true, default_gauge_size = true, default_graph_size = true, minimum_size = true }; local colour_setting = { color0 = true, color1 = true, color2 = true, color3 = true, color4 = true, color5 = true, color6 = true, color7 = true, color8 = true, color9 = true, default_color = true, default_outline_color = true, default_shade_color = true, own_window_colour = true }; local function alignment_map(value) local map = { m = 'middle', t = 'top', b = 'bottom', r = 'right', l = 'left' }; if map[value] == nil then return value; else return map[value]; end; end; local function handle(setting, value) setting = setting:lower(); if setting == '' then return ''; end; if split_setting[setting] then local x, y = value:match('^(%S+)%s*(%S*)$'); local ret = setting:gsub('_size', '_width = ') .. x .. ','; if y ~= '' then ret = ret .. ' ' .. setting:gsub('_size', '_height = ') .. y .. ','; end; return '\t' .. ret; end; if bool_setting[setting] then value = value:lower(); if value == 'yes' or value == 'true' or value == '1' or value == '' then value = 'true'; else value = 'false'; end; elseif not num_setting[setting] then if setting == 'alignment' and value:len() == 2 then value = alignment_map(value:sub(1,1)) .. '_' .. alignment_map(value:sub(2,2)); elseif colour_setting[setting] and value:match('^[0-9a-fA-F]+$') then value = '#' .. value; elseif setting == 'xftfont' then setting = 'font'; end; value = quote(value); end; return '\t' .. setting .. ' = ' .. value .. ','; end; local function convert(s) local setting, comment = s:match('^([^#]*)#?(.*)\n$'); if comment ~= '' then comment = '--' .. comment; end; comment = comment .. '\n'; return handle(setting:match('^%s*(%S*)%s*(.-)%s*$')) .. comment; end; local input; local output; if conky == nil then --> standalone program -- 1 arg: arg is input and outputfile -- 2 args: 1st is inputfile, 2nd is outputfile -- 0, 3 or more args: print usage to STDERR and quit if #arg == 1 or #arg == 2 then if os.execute('command -v dos2unix 2>&1 >/dev/null') == 0 then os.execute('dos2unix ' .. arg[1]); end input = io.input(arg[1]); else io.stderr:write(usage); return; end; else -- we are called from conky, the filename is the first argument input = io.open(..., 'r'); end; local config = input:read('*a'); input:close(); local settings, text = config:match('^(.-)TEXT\n(.*)$'); local converted = 'conky.config = {\n' .. settings:gsub('.-\n', convert) .. '};\n\nconky.text = ' .. quote(text) .. ';\n'; if conky == nil then if #arg == 2 then output = io.output(arg[2]); else output = io.output(arg[1]); end output:write(converted); output:close(); else return assert(load(converted, 'converted config')); end; conky-1.12.2/extras/gedit/000077500000000000000000000000001404127277500153335ustar00rootroot00000000000000conky-1.12.2/extras/gedit/README.md000066400000000000000000000032061404127277500166130ustar00rootroot00000000000000# Gedit syntax highlighting Note: this highlights based on syntax and does **NOT** attempt to validate arguments or keywords. The syntax highlighting is unlikely to be 100% accurate and is open to improvement. The syntax highlighting will automatically be applied to all files with `conky` in their name. eg. `my_config.conky` (unfortunately it also triggers for the `conky.lang` file itself, you should set it to XML manually) * [`gtksourceview` Syntax Highlight documentation][1] * [Regex Tutorial](http://www.rexegg.com/) * [Regex Testing](https://regex101.com/) Developers: The main context (`id="conkyrc"`) is where gedit begins. This main context then references other sub-contexts. Each context can apply styles to itself, sub-strings from its regexs, or its contents (in the case of `` "container" contexts). If you are ever confused by something, try searching for XML attributes in the [`gtksourceview` docs][1]. If you find a particularly complex regex, try using the Regex Tester linked above, and bear in mind that `gtksourceview` adds some extra regex syntax (i.e. `\%[ ... ]` and `\%{ ... }`). *** for medit v1.1.1: ` /usr/share/medit/language-specs/conky.lang` for medit - older versions: `/usr/share/medit-1/language-specs/conky.lang` for gedit v2.x ` /usr/share/gtksourceview-2.0/language-specs/conky.lang` or (for single user) ` ~/.local/share/gtksourceview-2.0/language-specs/conky.lang` for gedit v3.x ` /usr/share/gtksourceview-3.0/language-specs/conky.lang` or (for single user) ` ~/.local/share/gtksourceview-3.0/language-specs/conky.lang` [1]: https://developer.gnome.org/gtksourceview/stable/lang-reference.html conky-1.12.2/extras/gedit/conky.lang000066400000000000000000000303211404127277500173200ustar00rootroot00000000000000 *conky* --[[ ]] conky-1.12.2/logo/conky-logotype-horizontal-violet.png000066400000000000000000002163321404127277500230600ustar00rootroot00000000000000‰PNG  IHDR ÒH‘­6¾ pHYs.#.#x¥?vŒIDATxÚìýÝodç'x>‡éL½dI¤^mK²IÉU%»ÚvÒUV—»««“vucªÝI³  $µ{S¢ÿQè c®¢€]øbvajn¶±Ø˜= n´˜Ó½[Ó3»0³¦Û¨r¹J™VIÊ’gŸq‚q"$#Èx9/Ÿtò#‚Á_œxNœˆïù$MÓM1§4‰ ="H@£ÒÐ(‚ô4Š ="H@£ÒÐ(‚ô4Š ="H@£ÒÐ(‚ô4Š ="H@£ÒÐ(‚ô4Š ="H@£ÒÐ(‚ô4Š ="H@£ÒÐ(‚ô4Š ="H@£ÒÐ(‚ô4Š ="H@£ÒÐ(‚ô4Š ="H@£ÒÐ(‚ô4Š ="H@£ÒÐ(‚ô4Š ="H@£ÒÐ(‚ô4Š =’¤iª P?|ã'Kq¶”ÿX›®© 0·B;X¿#X“#HOcÅðürœ­†vp^Çy Œë`éiŒB×ùÕ|šW Bî…v¨~;´ƒõ{Jç#HO­åáùÕ|º¡"@ÜíPýv Õï* OžÚžèNh‡ê·„êàl‚ôÔ‚ð<À¡z8ƒ =•ô«¡ž¿©ÇtBõ›1T¿§Ð&HOåÄðüRœ­‡v€~QE†r;N›qÚŽ¡ú»Ê@“ ÒS1@¿gÙt]5.äý8mÅ@ýŽRÐD‚ô”Z¡ûüZœæU`¬î„v—ú-]êhAzJ)èWB;@C5&î^œ¶ã´õ»Ê@Ý ÒS*1@¿gqZT €™¸Úúm¥ ®陹ž_íîókA€ ,îÄi#ê·”€º¤gf úlšW€RÊõ[¡Ý¥þ®rP‚ôL] Ð/ÅÙFœVƒ=@UÜ‹Óf¨ 陚B€þ¦jT–@=•'HÏÄÅýBœ­ÇémÕ¨V >†é7”€ª¤gb úlšW€Zº§¨ßR ªBž‰ˆ!úõ8ÛôM‘ê×b ~G)(;AzÆ*èWãl3N‹ªÐH·B;P¿§”• =côË¡ ¿®D?ŽÓF ÔßU ÊFž ‰ú…ÐÐßT úÜ‹Óz Óo)e"HϹÅýzœmÄi^58Å­ÐÔï*”_Ì„¬ yÕ½øùÿžŠPE‚ôœgci9ζâtM5Á;qÚŒ¨ßU ˜­<,¿§¥Â|ñ7y+ŸïÄi7›„ì(3AzFÙ€Zíôo©çt'Nkñƒó¥€é‰¹Õ8[ɧi5O¼ÚÁúlÚ¬ Léecj3\lÏcèøqœ6t§€É‰yµ8[ íðü| RÖpg;N[ñ;‚]ϳ$HÏYT ÙÆKœn¨c¦;=ŒYÌz,ÅÙFhèçKüPo‡vSÇmw˜AzNÛ°Ê6¨¶J¾Q@õéNs+¡ ¿^±‡~/´õ›¾+`šé´aµt¡`ºt§€s¨p€¾Ÿ@=S%HÏ «í  =³ñNüp|Càt1ã±Ú¯×ìOkê}_À¤ ÒÓÙ¸Zí½“ßR fìvœVãä{J½òŒÇzœÞ®ùŸêh¶L” =ÙÖrhï¡|M5(‰¬ÛÌzüp|K) -fÌ×5Õ &î„v˜~W)¨G"LÀ¹ Ò×ãj9Îvâ4¯Ô̽8­ÅÇ·•€:¢?—¬ùβ0=£šS‚Zo\­ÅÙGAˆ€zÊÞçþ,¾ï]W ªNˆþÜã´ë· ŒB¾¾W›qöžJÐïæ_.@%å9!úó»§e`Iš¦ªP¯ «…8ÛŠÓ Õ anÅiÕ¡[¨’˜õX š%ŽËûñ{‚5e`‚ôõÚ°Zí½k¯© u;N+ÂôTAÌz¬ÄÙ‡*1V?Šßl*g¤¯Ï†Õrh‡èçU€†»Úaú]¥ ¬bÖc)Îvƒ¬Ç$|?~O°£ œfN j±aµ„è #{_¼“¿O€²Ú²«müž`A8 }ÅÅ7ýkqö‘ +èÑ Ó¯)e?¿ÞŒ³k*11Ù÷ÛÊÀi’4MU¡ºUkqöžJÀ©ÞŒ‡oÝRÊ æ=VâìC•˜ŠÅï6•€Aé«»Qµ„è`XÂôÌ\Ì{,ÄÙnœUc*îÅi9~G°§ô›S‚JnTm!zÅ{ùΨ0KëAˆ~šæã´© ¢#}ÅÄðÏVœÝT 8阉˜ùXг_¨ÄL|?~?°£ éH_­ ª­ D¡3=³²©3³¥ô¤¯!zaz¦*~.½g7Tbf}7@?AújlLm!z'az¦iC <”‹ }É ÑÀÄÓ0qy7úë*1sºÒÐC¾ÜR[Aˆ&I˜€I[S‚ÒØP:’4MU¡„„è`ªÞüéÏÿ|K§˜ÿXг_¨D©üYüN`[Б¾œQAˆ¦)ëL¿ª ŒÙšxN('Aú’‰áìÍúÛ*S·ß/+c´¦¥s#?R 'H_"yˆþ=•€™˜ÓŽ0=ã?o^‰³E•(¥U%@¾\OBô0[0ý‚RpAkJ๠¼éK ïx¹­P ÂôŒÃДֵø=À’24› ýŒåáœÐëåp-ØÙ€sÊ›*.ªD©­(@³ ÒÏv£i!Ñ@Y]ïÙ·”€sXQ‚Ò[U€f¤Ÿ­­Ðît ”Óͦ_WF´¢ž#ÊM~Fbg3În¨”Þ»ñýûª20‚%(½ùøùÿ²24— ý Ä7ákqö–J@elù0€aÄÏ“—âl^%*aY šK~úKÙð÷T*%ûÂ# Ó/(gXVÏå'H?EyèfG% ’®Åi[8òx®(?AúéÚ ÝUv=î »¡ œbI *cY šK~JbØf3´;XÕöv|¿ª œ`I *CCL€¤Ÿ‚²Y‹³·Tjc+¾Ï_RXP‚ꈟ÷/«@3 ÒOçÍö¦J@­dj¶•€®)A¥,(@3 ÒOP Ñgo´·‚Ã@@]‹ïù7• zé'k#ØËêì­¦_U¨¬e%h&Aú ÉÃ4o©ÔÞV|ÿ¿¤ PI JÐL‚ôC4Ùì-•`XI2þ €©™Ó¶2T‡ ýdl‡v˜zL3ô.d0U×âµÊP ‚ôcÃ3ëqv]%(s€]¨`"ÞŽÛËÊP~‚ôc”‡f6T¢™ÆšOû¦)‡½ßÓBögv­âNêF¶§ e('Aú Š]&×ãìºJÔǨ!öÞúàÀ|8¾g ½Sòýè²äôéÄ¿ç”`}ûH»øµ`hoÅí…e(Aú ˆ¡˜¥ Ëdmœ'<† ͇ô´;îÒäøy'6°/î‡ ØëyõÂô#ÙŠÛ ÊP.‚ô³§ye¨¶QôáŒàüà;)ÌϘ’!®“†·W|…„üIí¢z†²§ue(AúsŠ]%Wãì†JT×°úNx>œž?é¶à“Âí„‘¦c?°ï×Õ÷<ÖÓõ'ü2ö#y;n?,+@yÒŸC Á,„v7z*èôÎñÝ ŠÝç‹¿—$áØ $Çíýùä”`üÙS÷T:tÀþX×úî5T ¾}B˜`Ll?”ˆ ýù¬ÇiQªe¨ôYpü„îóG?„v ýäà|ÒtO’äxù3ì Óû¡Bõ­¿óäštõÄéÚõ¸Cîš2”ƒ ýˆbøe)ÎÞV‰ê*@ß¾fgtŸïèO Î ÍgôtÀ]%sIÏtfÐ>é½NïßU|<'‡êG Ô§CÔ€¡mæG·`ÆéG·¥Õp‘ýÑ!¦ì<ßœŸKzBóíËz§¹x¹£ûH{¦ì¼ìòA¿×šúušäA÷3Bõ£êÒ•`æã´¡ ³'H?‚Ø=r%ή«Dù%É0 ПÐ}>-†ç;W›ëÙ»A÷VP>ŸzƒòmY= }-ë SÚÓ¾°ïNÝ`}ñʧ…ê‡ÔÓëJ0voÅíŠee˜-AúÑl)A¹Ø…¾sfzo)ß Îï³”? ¤÷v“ïüê ) ¡/0B1\ßžÒž?e`¨>évÅï­C’ï†PèmŸœ¦HWz€qÙT€Ù¤Rì¹g‹*QNã Ðw»Ï'¡™ïvoOŠÞ{šÂw»Ñ'…¨zçŽòÄ|«sü€©{GÝGY éwƒõ=™ùc¡úþ@}èëNß Ô÷–(=¡l! ו€‘\Û«Ê0;‚ôCˆ!—… kdiÚ$}ä}7ÓžÌ%Ýð|ÒÉEÊóîôG¡ù¤6Ï蠟ý€)4ö=üøÎNõýúîߟ !„¾îô½ó¾‹ÎêJ?êsÀ ¶/fH~8ëqšW†r9± }®ù=@ô !…ç‹ç·¯WhŸ áø ùtÀÔ¹l` ¾ó7ä¡úbо·K}o >„BwúÞBËÍûÌÔ•^j`ã»ëÊ0‚ôgȻѯ«D¹ Ìr÷œ™äñøþ@øÉúN÷ùV7ù¾ð|7Äžý<×½z;Ôž>ïBß ÝŸŽæ³Î÷…pýiú,1RŒ=MÓêN9s|]éÙF¾½À”%©Pì©b°e3ÎÞR‰’,°g6COŽ_·@Ïôkutᨃ{«ïz’ôÞÒ±Ÿ‹·yü¥C?ÂÂïä-å;¯Ç$=~{i÷Ê­ÛxúÙ'ÕÇ.usíiûÆž{"\¾r©ç—Ò4ô„üÎðؓ©´ð×üê?}rú ·÷ñ¯? X`jêÅ—ž>çï=5ñÇöé'âôpàe¿úåo8hu®Ï¦¿þO¿ wÿö3EaÞЯ)@=ÒWŽ =@C ÒŸ¼Q³t£ŸýzJ€þì.ôI+(ò üÑï$ɱ}šäÝêCþO’ôt‹OúÈ;Ǭó{qþå¯.„ç¾ø[­ÐüB ÐWæ9 :ÒЂõLÑ«ºÒÔƒ }åÒ4ÔœœÈä9DÚæÃQˆ¾šÏƒßñô\!p?—æ[§;·3—ýNçv“N°>Ÿ:gæ¿zêTôô3O„¯ýÞ‹áŸüg¿Voþ~øÃ¼~;þ<ö}2ÁçÄb @Ã\yìRxåÕgÂïÿÑbøÿ»o…ÿâÿøÝð‡ß-¼úúóár<¢ Øþ¨&éо 橉ídàõu¡¦}št÷=·{ÔÝ>9êÀ>ðqµ»O=Ê/}e><ÿŧb÷ùùðÄÕ+ÇÿŒŠ½ü:¾QÚ>þõgáÿáoÂüÅÇáÓO(¥+=@ èH_9:Ò4”Žôƒys;]8—OÅ;ît¨ïò;¿óå¯.„ïüãÅð§ÿûo‡¸òZxí/Ñwÿ Ók1rñ¦ñYF ã™çŸlu«ÿÏÿË­);½ðÜ“ ƒí€’Ó‘¾nô3\Oêöž¦óÇ®wÔu¾ýÓ©]èCz/v ïüîQúÂíu_/t¦?éq?÷âo…W^{6|9v ¿|åRïåá„Ì|Å:ÒëFÃ˺Óÿ‡ÿñ¯tªçíéB?×°Oò0}·ý\_÷ùnúãë;çu:Ð/ÿ£¯†'òýñÇ=à¼dˆ+Ž\¼“ÏKÒ’0Þ¦÷ºÑÀÅÔ3‚5%˜,Aú^kJ0=§…è‹úb'ú´{ÉÑuçæ:×í¦íç:óÂ$IoúÐÓ}>éy\­îôñ‚4¿ç¾ø[áÿóßn蟠݇8øç‹$ÚOºÑôøyÅý¸BôºÑÀx Ô3„õühYLˆ }.UÖâlQ%¦cØýQ< G—$îòsí|ðž›ë„ä“£.ô»èt•?ºÍúþð|ç—Ÿú?úg_ ÿèO¾ž{ñ·Fþ;Ç’=ïÌO)@ßû„Yf`Ü:úßÿ£ÅpùÊ%¡(;JÖº2LŽ }׺LÇH!ú$ô…èó³;WÈñ­ÎôùuçŠáø¹núNXþ¨}á:Iþ»y¿ÕuþÚ~¥ ¶ ?#LÞŸqºƒ~tæ± ÚúNí& ×&ïõo)꿾ùÝ—ƒ¢5%˜AúÐêF¿g×TbòÆ¢ïÎ[aúÎ<ïH_ ËwN'4}(t©Oºañ$OÓÿÎ7¿þøO__yíÙAòDçÍš§?#ÿ'-ÞX1@_¨I±ý©õ>ïóTü]Ýè`â®ØQ$CœÝ Å’ñG× }zvú䜷ÿ±µîG7z˜š«O=þäÆ7âN}¿Û:Mã­+Àd4>H»<.ÅÙM‹Âä êFVˆ¾Ø2~n®7D?—_o®®ïÜG§ }ëw:¡úb€¾Ðsý 14í¿þÑ^ O\½2ð±§!ŒÔ™½þï„ä‹5(v’ïïBß Ð§i:r€¾??òóz»ÐËÏÀì¼òê3áOÿËo…׿ý%Åh¶kùѳ3éu£ŸŠs‡è; j ÁgÙòN0~.ÿ¥¹¾x½n þüúóßèu¡€Ù»òØ¥ðû´ØêP¯;½íÆK^0eâ’:¹¢OÚAøVˆ>y·Ú¹ä(ü$½ê“$é™·n3éèÓüìð—ÂüñR¸|åô—ARx8gÿ±=³žÓÅlzÚw…´¯MýYú‹vŸA€ªâÅ—žnu§jÇ?êèfìJ¿  ãÕè } ¤¬ÆÙ¢Å`rŽ…èó3Òâg…èC»»|ÚéDßé.ŸwšÏÏjåóÆôínôù¼¹Oóß¹|ùRøÞ¾–~÷ùSx÷dOÈý,ƒºÐ¿Éž.ôGiù<@NÐ#<‚=TQÖþÿôwÃ7¿û²b4ÓºŒWÓ;Ò¯Y&g`'ú˜ØngÆó OÑgù!úüzÉQ—ùn'ú£;,t¡o§ê;áú$<µðDøþÿæáÙ®žþàÓNüCO>+ Ç;Òwôiá I~ú´îóí<ŸôÝ–=TÏ·Þx%üÉoÄ#ê\R Û-\@cƒô±ýRœÝ°LW1DŸÒÝýè“…èC!Dòð|',ߺ,ïP?—tøM ·ýòÒBøÞ÷¿ƒgg,öÉ%…yÚû;ý]èϠ⦅ö˜NzœI8ÞÅ~P§{ Z^|éé¦ÿ½põ©Ç£9ó£i0&MîH¿ê韜AÝè…è[':ÿ$G³b'úNp>™k§âçúÂôsìý\oúd® Ïæ¯Äý·ÿð+g‡èó:(·^ Å蟇“»Ð ï\-í/ÞY5'tÂóP7Ï<ÿdøÓÿò[aá¹'£9Ö”`|š¤_÷ôOƨ!ú£,}¶@Î%ÇCôù/ÌåaúþýÑy=]è“NÃúðò«Ï†kßûÊHà€û±0zröï Ô'gè‡í>ŸôMi*8Mrå±K­Îô¯¾þ¼b4ÃØ•~AÆ£‘Aú@Y޳EOÿ$žðÝ}RÑ'Å}†è“<5?—Ÿ—nèèúyúÖå­¶òIøö?|¥5¥£$ËOØ`¸3»7Q ßNÜU:âíê:?l¨,Lÿ½|M˜¾9Ö”`<šÚ‘~ÝS?Ǻѧí^ôG—å!ñιÙyÙéaBôNôð|vþ\(\ÿ(®ß¾ì[o¼^^zfÀƒ 'Ÿ7°õü¿;à*ÅÀü©ú!oO×yà4Y˜þõoI!êoM Æ£©AúUOýø%§trOŠAõ¤7DŸæ[!ú,LŸ$=ÝÖ‹!ú$¿lîè6â?—’nwû<\ÿ…Ësá›ß}%¼òê3ƒç 3;Éþ³Bôgt‹Io€>„3ôÃtµOuÎöû´þðû¯)D½]Ë®À5.Hƒ'«q6著°N7ùþäwrÔŸþ(Dß¹zÚY ó”}ž¡ï Ñ·‚õIá†Òn(?sé —Â÷¾ÿµCô­ ûIáõ ´x?ÊØ§…|ßå­‹ÏÐ÷tŸÂóÀh^ûú Âôõ·¦×ÄŽô«žöñ;Ö>í´xï^Öéß=¿O:ÁùÖ™´ÎŸ+„é;!úî¯&Gáú¹BŠþ —³ýkáégï>®þÇy‘?ò¤ }_ú4ôþܪ?#@Ÿöý>À¨²0}ÖÛ3œLž K¤ÓÓâeI’wœOºÝã“öµ’v"¾ˆŸ+^žtç¡}ý¤š/t¨Oîüò•¢ÿÁká©…Ç{:Î÷ÒOëFž¿»p'ƒÍã“Óo£?|pQ¯ûKáÕןWˆzZŒGÙZQ€‹iT>NVãlÞÓ>Ay°=)ö~éõvú4ÔÇo®Ð™>„Ðé__ Ñw:Ñgú¤Ó©~®÷z™,DÿWbˆ~þñ“Nþ8Š\ðÏ Ç»Ð÷ßt:(]ºáyz`’¾÷ƒ¯ Ó×ך\LÓ:Ò¯zÊÇëX7ú´‰ï^Ö Å·OµóñŒìjsy8>»p®Àït¢Ï±Õ…>)œŸv:Ó·ÏË~ï÷ÿh1<½ðøÀÇ×é@üqöž?j®þ´}Ú¥¾ËC"@LG¦_xîI…°]@AzÆê(`^è,Ÿ†B÷ù¤²ïDîç çuÚÍg!ûnÓúä(Œ_ ÑgþÁ/‡g_¼ÚMÂñIoSü^I÷üþ0ü0ú›ÍëB?àúGè%è€)ú“¿'L_?óùѶ8§Æéó É¼§||zº¼wÂð¡7½Þ Ë…ä³X}',ÂQ½Ýy¾=Íõ„â»èÓ¤·Óý×—¿^yõ™ÞöîiÏÝŸðÀ»×%D_üs‡íBß ·È3på±KÂôõ´ªçפŽô«žîñIú;¯§È|÷²NùÖÅÙÂ6WèLßZú’VgùÎõ³‹ç Áú¤¯}7Ÿ„—_]K¿óÜñtzÒ÷ø’ã—7DŸ¸ÉpÊmäûÐ3× Ó_¾rI1lßé‡Bª¾tOZòBp>ž‘eíçòð|Hºê“Nú¤{Ý$¿Bëô\Òs_Ͻp5|뻯œúÒþõÙmõ%Ú‡¸÷…áÓ³¯ÞíB/E”„0}íÌÇ£n-+Àù4"HŸLæ=ÝãqZ7úÎÏs’£,}š‡ëÛ?Îo¤¾o‡èÛKfo·úv þéùÇÃwþñâ ¬u7=ñ~HÏÙ~”¶õ…«ËÏeôÌóO¶ÂôÔÆšœOS:Ò¯yª'ç¨é{!ß Ög—ÍÍ:Ó·–ºüô\’_¿¢o§ìC1ß àÇéòå¹ðÍ7^ _¸|úbÛÉõ§Å–ð}áÿd˜?l„}FÎÜÌD¦ÿÃ₩õ°ªçÓ” ýЧz ÇgYö,LŸ´ÎèvªÏ3óÝÛÌøËÚwѾBv½¯/¿ž^xü„zºÑwÓý}?‡Bàý´4ýˆ!ú„è€êxíë/„׿ý%…¨¾Åxô­%e]íƒôy°äš§z:­ßCo7ú$‹Ò'í`yžƒkΓø…¶ó­nô¡´ï Þõ·Ÿ//.œúp’ü!%ÅÛí зvñ‡0 O?bˆ> Bô@õ|󻯄«O=¦Õ·ª£kBGúOóx êFt²„ow£oGé»ÝèÛç„vûùÐÉwöíýQ3ú£ôGý8=µðDøúµS:¦æiö40­|ÚŽ¶§½Wé*¤ßÓ·5T=‚=P]W»þøOW!lï4’ =çSèF_ÔéFß Äw:Óuªïæï³,}'Oßùá(C:]éÛ§¿õÝ—Ï|8Iáqrø½]è>â¾¢ä™çŸŒé_Vˆj»¡£kB~ÕÓ|q£w£ï„é» ÙQH¾¨oÇñ»AûÖõc¨>Í^úçcGúÇOpy7úÎí·ºà÷u›ïÔ÷œ]xæ]Ô·Þx%\}ê1…¨°¾ñ“UM­ƒô1P²góžæ1;±}7@ß ³·:Ñç¡øbоӡ>þ3×ùÅìúsùõC»IýãO^ ¯}ãÅÁ!éΓÂÃêòÓbgûß/œt×uñ½¼¦Õ¶ª£©{GúOñÅ ß>ºÑwºÍg¡ø$¿~oçùüÂÖåYˆ>M»·›ÝÞׯ}9\¾rÂ"švçýÝè[·‘vôiÿï\¤A7z ~^|ééðêëÏ+„í€Æ¤g4£t£…ÎðsIÞ>ɯ›Í“<ߎ¦ÏeéçÚ·õì Wc ë©Á¡Ø¾?@ºáùÎ#MN»Ñuö­7^‰;1^RˆjºƵ  ägxèFßZØ’ö”…ê“<áÞšµ~NŽ~'»ð[ß}ùøÝwN»Ñ§ÝûÌ®pÜÝÇ10ü^Ø`˜L½=PwWŸz,¼þí/)„m€F¨m>vd\޳yOñÅ$Å”ùˆÝè[©ùP Îw÷!tÏë„áçZaú$,þösáñ'/»Ÿ4¿³£~¡}ë6ò©sÝb—úÒáòBô@Sd]é³@=•´¢ësGúOïd…ëÓӻѲó=aû¹b7úl!œKŽÒî—/Ï…¯}ãÅ“ï<ÍÍ ÷Ñé>Ÿ¦zšÏº¹ÓÿÖ D4Ë7Û?uSç ý²§÷bzºÑ'ɱ [Áø,JJ7úÎõúõI7Yß ºÇç¹ð…Ës§?¦<°_Èó÷\Þ Ôðnö#ýýAˆhž×¾þBXxîI…¨žkñ¨\ Ê0éNÚ××ý¨}rf7úºÝè;gçíßKÂO^9½}ÒÛ>í»­£‡9àüö…Ý3ÏÊÔ ÑMöÿdQªiY †SË }ìĸgÒ?pR7ú¤ÐQþ¤nôiÒ½rçòöÏíóæòÔ}ëü¹ììöï}í/ ~,Åy_7úP¸¿$ô‡éÏ É ÑM÷âKO·&*gE †S׎ôËžÚ1Ø>„N7ú£³ókÍ%½ñõþnôáè·»áø'®^ /-. ¾ûü:'v£O»×KûÒôéI·w¥¢hûÖ/+Bõ¬(ÀpéZ±}«üQ==êÔ~îänôíË’|ékì¿ùÝÁA­cÝèÃéÝè“è“Âu²ßÉÓìÙ쉫Wb0ë©£«£¨GMçûRòíøÝë$C<þ´8O{ïCüêíoó÷ÒüÉß+4P{¯ûKŠ`{ Vé9’ô¥Ò{Bæ1ÁÞþ99êàž]?̓òI´ï\Ìu;Óÿëž^øòS…KO¸ïNwûäø…i’wÂ"Mßßþ¤îô@}dÝè‹Ðg¹÷¹vþ½ÕQ>:ÌÇÿ¾øÒS'Þ]Ocü£~Ú†O ӱǫ=ƒGÓµ*tBøéÑGó³ñé‰?èFM±pЈû˜¶«O=ž{R!ªaY NV· ýuOé%gœ™¦GaöAWm7Šo_Úí(ß¹n¾py.<ûÂÕã¿—¸¡Âݧ… }št/?­Á|:ÔßÔÑþÁô»ÃßøHáFЕ¾2–”àdµ ÒÿðŸ,x:Ç#)$λæÛÝåÓ£H|·Û|ç IèëXŸv»Øçç„g_¼:zWø4ô¦âÓ'×Ñ<é=_7zhŽGûûS¿ÏÔ 4Ä+¯>£Õ°¤'«SGúeOçø$…ðýÜÓ$9vÝNp½dïJÓÐ Ü'á™ç¯ž|Ÿ#=ÀÁ?¦Å¹L+4Öá BígÞ˜…_z:\¾rI!ÊoI NV§ ý‚§ó‚Ò“³çÎòGûþ {Þ±>»b’·¦ït¬?êaÿñËOv÷¡sÕS%áØM“3~-ñôBS´LÞ_~ZÊoI N¦#}Ãõ4—6/œ™¶“öIñÜüò‹ònõGÑùÂo§á‰'/‡Çãt¦ô—§}8éý9Õãðpv/øûy€FȺÒSzKJp²$­IÂø‡oüd3ÎÞò”ޏ Ï'Gç·Ì'a.ét¤oŸNò6ó­Žósí®ósíÂ\ösvݹü²x:;/û…—çÃ?øƒ—§ÿ7†³³ù@}|zÿAøÛß|2“û~qa><~å²'¨½ýYø—ÿõ¿Sˆ’ûéÏÿÜq™&,~µÒwÖR˜ÌÎL{ùTçw<@MÇÖâXÚ?®.‡ãG§ÍΛÃ]ßék£»qÚ=a<Þ‹cñžg €1¬ãÂñ¦qÙe‹X·íæë·þõÚn\¯Ýõ,ÁX_ób ÕòN7”¼/èßî=Kg;õn\fwU’ .‡÷¡Ëù{Ò•ß‹Þ ÝÏM:ï3w‚ÏL jcÁJa}Ô²éZSÆ:é³â_·X¸ ÒwÎëΓ£²pü\>OúÂôíy;lŽÎÏŽ·ûÍ?x)|yqáìÇF ¾Ÿñ ‚ôÐ,÷>ý¬5ÍÂ3¿u5<õäž þoÿç=ìÛ¡†ÙÉç{ùäK5 Lcìra\ÍæKùTÖñuX·òùn>wÆ`_4s=×Ù¦(n[ÌWäϸWXŸçÖi0ú˜ ¦P-‚ôLú=ÂJè–ǹýÛÙqn'ŸìÇiËâRœ­–ÇÅ ÞݽÂr¹ã3j(Í8°Ð7\›ð8°[vÊZAú†+é[]ç AúV×ùÎÏIï|.é ÏçÝçºÒ'Ý }§{ý?ùÏ~'<ñäšÏJ½Ÿp¹°»Ê¥vÈþ(p?Wø9ÞÀëßþRøêo?{ü1„‹ÝÏú}Azhž¿ú»»ááþþLî[hšŸþWÿZÊÍÿ@-宄n S—ùéê„ëw‚N“Є±¶3ÞkgïVgìÍævlËú.[Ç­æë;;ãNg[b§3 ÖÓ€1FT¡Z|žÎ¨¯ñìýÃZ¨V`¹¸NÞ˜e`‘±/Kq¶Êu4„ó,—ëvô€ ]/Í|ýT— }öæäC/‡ŸüS‚ôÙ”†n0>3×׉>;ÐÏõéç.µ;ÑÏ%íŽößýãÅðÌóWÏ~L¡|OŽS÷ñú Ñ_þê×3»ï+_øBøÒ³ ž 1þÛþ"üê—¿QˆòòÁ?P }]!³ÉÞ«åÓ wîÖƒ±–©¹zÈw•àÌõÝRèç­ïJ´.˜¢¦cŽ$Cµøù… }±}û¼|ŒoÌós…®ôs…ð|Èît¡ïéŸZx<|ï_;Ç C%á‹ëÓѨAz€éù¿ø8üwÿòVˆòº7*W”(»üK¨l¼Z œut/ä¡ú ³o—C7HxME3önûÒhà:oµ°Î³cn5e;ˆmåë1ÛTu,W¨AzÎzo±Õ€÷ïÄiÓ6dé—Çå|ylÂg;ÙçkŽ^ÇÆ¥|¸nºé³7³o{‰ŒøäwBóqH“AAúÞ}èë4¢ïïLß:w³·ñì‹O†?ø'K#>¸0t ^Gz ãáþ~ø«¿›í6 =Ð$¿úåoÂûÁ_(Dy Ò¥Õ×uþ†Š4J§c²nõ0ñv5"ŒXça=³—ĪEžA¯ã…|Ô¤Ï/³õîšÏíJ»LfãT3’äËå]KÆŸ¬‡öRš¶Ý;Ñîô‚ô 6T¾Õ>u¦o…æC7\ŸÄÄ|ogúpt¹ö/†g^x2|÷—ÆÿøÃéAyAzhžû…_ݽ7ÓÇðÒsÏ„/\ºäÉA¾ôéRÑ ™î„v¨~Ë—s0¶±v¡0Öfï 1öu^ïe뺵 <ß$Pý– £ÄªEžAï3²uNSžù£øšØ´$”fy\Ê·å›ü¹zZËåŽ%‚†Ž ¡y;w Ú\ÄÖ‚ô všíÀù©AútÃó@ýQ'úpÔ‘¾uÍÎùyÿ«_{6¼þí/ÿñ‡3‚òi~% 1ʤqa><~å²'hAúò‹‘Þ3•‡ç×B;ز¨"œ" vn…v fO9`äñv5oåc/P÷uÞR¾Î[³Ñxäë°m¥ ¤ã• }µÒS|ý®ÇÙ»*¡ xI–Ç•ÐÑÛq´ÍN4qXíÏð4©šÐN5u Ògƒã[–‘žø¾8ÍYAú¤ ?¤Ÿët ÏNç7œ»ÓǾöõÂkßxá2\¬å¼ =4Ž =Àt}úɃðßü_v¢ÄéYȃ-«¡lñ¡çq+N›1pæx»ºÝç}™ÊEéð ”}½·–oc\W út޶²iÇ0J6n ÒW‹ =n¿›qº©=ÛŠ«Ö±3[&׃:y?.“kÊ@CÆ•`gšAÞŒãÀÖ¸n¬.AúàC“Ñžø3ƒôIÈÑu—? Ðçæ铨ž>™ë†ðGÒ÷…ãÏì:PðÉgŸ‡ÿþÓ™>Az i~ú_ýkE(óó#HLIþ%Ójla¼²@ÌFœ¶…:áh¼]гõàHL–¿@™Ö{kùºOhë0ª6†‰:T‹ ½×ìBœíAɺ®Ä×È®RLu™Ü vê8MÖŒeÕçÆÔ|ȶ‡ßS‰-L/HßP'é[¶¯0—t¯8(H?—Ÿžk_˜ÿ\èZŸ_ï¤ }H¾õs~fº åÓ•‡ Ö àCC·Þ>ý¬5ÍÒ óO‡'»âÉC¾äÏ =0ay'Œµ 2ÞÜ íî’JAƒÇÛµ`g%f3þn~Ùmgq^ÙN¹›Á‘V˜íX&²P-‚ôÍ~½.çÛ>Bô§o ÓOgy\ȗǪq¦Ûùréýu ²mb!ú³%L/HßP§é³0{'8R>)„æOÒ'­îô¯½>\þÄ O¹âI ÒCC·ÜJ¤Ÿ¿údkh Aú’??‚ôÀä䯅vWHÝ™¦V‡úq®J>Þ.åcm6æÚY‰YË:½mƒ ¯û:ÛBlŒ‹Â˜å˜&²P-‚ôÍ}­.‡v'zÛÝíW…é'»<.GF•0=uÝ6¢Þ…Ãô‚ô •‹Ó$Ýçòy†oŒ!ù¹|~¦ï„ç[¿Ó>ÿRžoÅòÏÒŸþÃPIxAz g«M`êéKïU_ã’©´t…dö²/GÖã:nG)¨éx»š·>ó¦ŒZG íP½m `ë½…Ð>ÂÕF°£.“õ~hêw•‚)o" Õ"HßÌ×ér¢?Ï6¡0ýäÞgË£ýè„é©ÓX°„èÏãBaú9õã¨ñ{–>?­_e2øwÓ“n+û9=ã6Oºít´ÇÀl\}ê1E(·%%.*ûÐ.N»ñäGAˆžrȾLú0.—›ùLP‡±v!NëqÚ‹?þ,ÑS^YÀäí8ý".¯[qZQàë¾x2[÷e!!z&-Ûžý(kÒgý€ý…¶ wòú1Æ÷ÆAˆþ"®åËå‚RPñ±`-ÑŸ×{yýÎ¥.Aú%ËÁäZO Ýìfèáþ¾"L™ =@=uB-y 3ûÐÎø”Ñ[qÚõÅo—²BB;Døn"¤Z²@â‡y qU9€Q¶5òu_¶cŽðÓv½°þZQ€F¾YBô!L?~ÛÁgðu-¯#TuÝ´„è/êÜaúºé}¹0%­ô±Í|ÚIÕ§ÇãõéÚÄ íƒ:N\DèÜ ÝP‹Ï\(»lý(cAÇÛ_„öN!¾¼§Ê²@âϲð.Òù ¨ýºO€ž2®¿êøž$ÑC'L¿ ^&·‚#Žíý]^O¨Ú8°„èÇeó<;zÍ©gI’³/L’ FÛe_šÐ€*ê tfÝe}‘DÕ¼—ám_ÞQñv% kÆ[¨“lç¦÷ò@ýº1(¬ÿÖâl7ÐSN@}¶=±¤µ~O’m£ìx?26Âô_&7‚χÆífö™„2PÁu3\7 Òs‚¤’?)bn>)\˜œÂ¨!]ñ¨’z¨²¡ýé’RPÂñ¶ ÿ0è2Fýeúwã”ê7„* Ñë¿ÕlçšÐî¬çhWTa{âÙ6²m €ÚÚŒÓ5e«¬ž[Êp¾÷Ê¡½£)ã÷®#Q!;Á^ã6FÜ9Až‘õwŸoý˜N78šžÐOåXàDÙa uD¦¦²/ïvÏsèN˜Ðx+@O“e_Ze¡zhîúïgA€žê¹™oSXwÔëýÉzð9è¤ÜÈ;«3üò¸ì€0iŽ^JÆ‚Í`¯I¹–×w(‚ôMwZà¼Fo7šïëPJ»y9v(ŸBú‚@'õÕ9tç²R0ÃñvY€zÆåN ~M9 Öë¿…|{Ãúº¬»v­»ê±ÚGÍbrÞÖ|$[Aêi¼ŸÛRJ¼nÊÆÌ·Tb¢ÞÊþq&Aú¦KF¼~Yòé˜ÿ.Îå™çŸT€ (èu §)„é™õxk‡%<6¿_#õPÏuàzœíÙÞ fóu׎p @¥m)ÁTè>Üûæà3£i¹1lˆ¦<,X7Mï=À0ë&AzÎ-)v¬ŸPp]g{`‡Š0e—¯\R€Ë;BnzšI˜ã-”S'”¸'”µX®Äi7´»¼êªI]ea·³÷{‚•{¯²g×Tb*t?{y\ í£Þ0=[Þ¿QBÙºiQʳn¤çBßÙ?8T€)»úÔcŠPn»JÍ•I´’fk}HêËŒ·PJÙ†æ]~—•*·þ[ÈÂòaN£9²÷{ެP÷+KAhyÚt?Ý–L]öùð¦2P¢uÓJð9réÖM‚ôÔŽl?ÀôüÖÓ‚ôeöÓŸÿù]U€æÉ> Ê:¼†ö—D:BB;ص­ o¡´².¿e\;>AuÖ¡½™£°ÐDÙû¾÷òÁ–” Ô¶”`6u·mwâ{èë*17ÙT‚òÕ]¾Fé"Ÿ¦'ü0¥VôBñå¶ðÜUE(¯{JÍ’ur;È'ú]¯Me`Lãí’ñ&" äf]~וJ½ÜÎ×v"£ñÛqÚÍN@ùÞ·¬¡åYÉÞ'Ú®;nS fÊ{6ʰnZ Žè6+‹§m» ÒSZBô@=xôH€F¹òØ¥pùÊ%…(§]%€fȺûäá‚/‡à4oé<ĘÆÛ_oab²ÀÅ»ÙÑŒÙPºõàzhÖpC5 g½õv|}dúeå(•-%˜©·¹¥ç½ôZÐŒaÖ®çG€YÚP‚™Z?éˆ)‚ô\\¡S}«Q}üY 9¾øòÓŠPN»Jõ—¿§·T†²íÐÒœs¼]5ÞÂTeƒ³Îׯm˜ù:p!ïBÿnÐ…N’u•üHwz€Ò¼Y BËe`½¨e³©X75Ú‰GL¤ç iëÿS%IßbôM²ðÜ“ŠPN{Jõ•uº‹ÓN<ù^fQd¯— e`„ñv)of¼…™È:_ïå°é¯WCûó]èa8îôKJ0SJP 7­…gKfÑÑï°nj¼]éé›ô©ÚÔ™Žô¥µ«POy‡»ât]5à\Þò… #Œ·»Æ[˜¹l'–w³Z² •¦²̺Ðo;’ÁydÝéwí0³÷1«Ah¹L6” xO`™Äºiͺ©4v¥¤g¼„æçÅ—éËè§?ÿóU€zÉ‚¿qÚ‹'ßV ¸° %à”ñ6;êÇn>Þ Byd;µ|”ïäLp=Ú;’ÝT 8·ÎN`Ûƒº0QëJP*«M^æÍ<®Y Jåº#%0kJPîçCž3 l4ŸÆÄ|¢6´½òê3ŠP.·”ê#ï¹O~t¬€q¹žwþ1w#´úáKN(¯·³]]&²\Ï׃¶;`_gÙþ˜¼u%(¥µÿí«ž~Ë$ÖMJPþq@žñ8–šOž•0=@5|ñå§¡\v”ªMz˜ŠE]éÉÇÜ  =TÕ[ywúe¥€s¯³×ÏnhwÎ&';¢ÊN¶½¯³ª¥t­‰Ûly·ãyO)Í÷w£ë¦Æ¹QÜ6¤g$§w™OG¼>uqõ©Ç‹/ Ó—ÄŸþüÏw•ª«dÑ…&oM =Þ.éBµíó‘N¿p®uaö^(Û™Ìλ0×ã´—}€ñ¾¯Yõž¦ÔÖø7¯zÚ=?4~Ý´lÝTq@ž¡dyød@*þ´œ|šw»¹|àýzºfâÕןW„rØR¨®BWd¬Át\ן±ãíZhï´¤ =ÔÇÛywú%¥€¡Ö…[qöžJÀÔei?Œ¯Áu¥«U%(µË$ž,g”õù¤g¬Fí@_‡ÐûaÜcà¯?¾þòW¿žÈôÿæoÃ'Ÿ}náJï•WŸ —¯\RˆÙÛR¨]‘a¦Ö• QãíBœ¶C;8èðÚP?ÙÎ1»ùÎ2ÀÉëÂlÛã¦jÀL½›½/Í^“J0+JPîmµ&íôœ7îð¹S¹Ík°Â¬*A©Ý蜤ç\ŽºÓ§ƒ.kV-²ûƒG&vûYPÿã¿ÿ4ìXð€R»òØ¥¦F!fëÖOþç{ÊÕ’vx7èŠ ³²ªo—óñö†j@­ea…÷„áÄuážm(ì}éŽÀXÞã8Âgù­ø[ñ<Ñ uÓ‚mïJ܈³÷‚=”UöÚü0ßá€Ñ­*A%¬4èo]öt[&±|)Auž'Azºò`z2dB=IºÉød˜ÛN{¯˜¸ïán¬<<|4½ûzôÈ2 T·ÞxYfcC   ÒÊcE j9Þ.ÇÙnhw¥šíÝl§šü°ÚдõáVœ½­P ïå¯YFs] *a± Ûdùß興Õ©tI˜e%¨Îó$HÏÈNʹ·³òg´ž&£ŸNî1Ž[Ö‘~šî?¦Ê/ëH¯+ýÔéF?”Ý :AB-æ¡kê3Þ®ÅÙGÁ—@W¶SÍ®ñž­ ³£²ìGÁ‚ª¹iç/€‘Þóx_-ËþFJfI 04Zk‡AzÎpF$=ïJ_̾§ùOÙEiΗj¯HWúGûS¾¿}‹$P ºÒO݆@¹å!–Ýxò-Õ€ÒZQ‚ÚŒ¹[¡½Ó@¿lçš|g¨õöGhKwV¨¦ùújA)δ¬ž/#°¢Lˆ/Õ!HÏ9$gŸŸçëã< I:Üï’OÒr”bÚé÷-@%èJ?U·u£‡rË»"íÅéšj@©-+AåÇÛÎNK:ï§ÉŽ ô^~¤ °ý”UöÞÓiàLÆÉjYð7âù¢!ÛåTÇŠ =–ôEàÏ Ä§#]ZgÐþ¡Žô@…|ï¯)Ât¬+”WÞíô£Ðlå¶¢•o—ƒÐ 0š·âØ¡Û/u\îØþ€ÚÈ^Ë;‚8§2FVËŠeÏ ° Õ"HÏ…¥g]0B«ù$¹à}NÑÁ ºÃ?¤*äêS…o~÷e…˜¬Çnô;Êå”w9}O% 2jµºãíZ°Óp>×ã´+ HMÖ‡+Aˆê¨¦_S €¼—§l”¬›” Rt¤g°,О$ɹ~/KΧiè ПtSýg§„|ÚÓÏ¢;üašZ8€JyýÛ_nꙈ;qÚP(Ÿ¬«iÖÝ4ž|K5 r¯ßU¨Üs¶ì´\L¶#•€"U_fËï‡Aˆê*{m¿g]pâIu,)%³¬LÀ‚T‹ =çrbÆ>í»<Ÿ§é¿×û¨ÁþÁÁLî÷þÃG@ 2®šÙ}Ú³¨®_z:üá÷_SˆÑe!ú•¢ßU (üËê›*µ²¤¥oׂ#³‘;Ygú¥ dëD€az É–”¸(Az.¬xh^Tü”Ú¤ªTÛk_!|ó»/+Äð„è¡dâÔ qÚ BôPG‹JPº1w= ³•…é?ÌÌ0Ëuâšu"paz ©|Ž\˜ =•6«¦õ‡‡3û›îï{â€ÊûÖ¯„W_^!Î&D%“…èãl'N×U`âcîVœ½«@I¼'LÏ ×‰Ù²'Dœæf¾*@SÞ­¨0‚ôŒE’L Ò^l¼ž”ëïÝ?8ð¤\Ð÷~ðµðÊמQˆ“ ÑCÉBô×T`âcîVpä |²0ý¦20åuâj¢†ó®¾€YR‚Jº£” =T ?Pßþ£WÂK¿=¯Ç ÑCÉÑLuÌÝ Bô@y½•S0uârœYÞ€Q8‚ ÐËJPI{J@ÙÒ3qÇšÉ'Iåÿ¦YÙ÷-X@m¼zíùð;ß}Q!ºnÇiIˆÊ#¯ì!z€iŒ¹[Aˆ(¿›ÂôLi;d'N:£¦š`Y *iW (Az8Av€j{¸¿þúã{²û†÷ââSáëÿèKáÒåÆo¢¼ôËqºk©€r^˜ê˜»„èê¦g’ëÄ%Û!ÀmæŸiÔÕu%¨¤»J@ÙÒóñ'Ÿ†Mtº÷ég #zá[ÿô¥puþJÿü{qz3è×, PBôSo„芦g"ëÅ8Û¶\P6†ìÓ5}¿´¢ •uW (Az¨ ,  Àùdâ§1Ž~þàa<‚ɂÈ®.<¾yýåV‡ú¹§¬ ý–%ÊCˆ`ª²ñVˆ¨ª,L¿­ Œi;d!_/^S ` ²Ï4¶ó± N–• ²v•€²¤çÜÒ¾Ÿ“ø_S<Š!LªéÁÃéíŒôà‘õœÇ.Ï…ßùî‹áëÿèKáÒåZo²d]èô+qÚóÌCyÑLuÌÝ Â‚@õÝЙž1Ù´^Æl1´;Ó/(P#+JŒ‹ =“sõÉ ÙúÖùÉ€_(HKü§¦©ç ¢>‹â§åþÇ ðÜKWÃwÿÅbx6Îkèý8-Åý¦gÊEˆ`ªcîVЉ¨›Âô\p½¸i½LH¶ƒŽuP'+JPMñ{±U lé€FyðèQ-ï ê*ëNÿØ™þ›ÿô¥ðØ“_¨ÃŸt+N߉®Åé®gÊEˆ`ªcîVêG˜žó®×âì-•&èF¾Ã@Õß7-Ÿßc$Htÿ¡`&Ày<Üߟêýí:Š ŒÉü O´ºÓ¿zíùpér%7c²ý÷cx~%N»žQ(Ÿüç;Á—0Ðt·•`*cîV¢êK˜žQ׋ËqöžJSðV¾ã@•­(AeùÜ €R¤‡í(@EÄ`û´=|´¯ð0F/ýö|+Pÿ•o ÕåÏ„ùž˜ä]fÁù÷ãôfè Ïïy6 R¶ƒà Ð˺|òé{*4Ô{Âô X7®;˜³•}²© @Ŭ(A¥í(e$HôàÑ#E¨Èø™¦©ÂÔe¡ú¯þÞ³á›ÿô¥ðGÿÅ×Zó,XŸu¯ÏÂõ—.´”æoÅéÇ¡Ýqþûqz&ίÅiKxª)W¶‚ÃÇY¯¼] Bôïåã!dëÆ•8{W%€pä j¼§Æ.©C¸+nÜI¨ò¤'½?gÅKZÿµN´.O’äèŠsùÏÉ\>ÅŸçÚg¶æ­“ss­Ó­_iŸÏãÏK¿ûBxõõç{@ï5íÜyñõ-Iç*Ißuû/òüq¸ÿðQøÕÝ{3¿úâófèó—¿úu)‡×§eÄ2û÷ég­iö†Oï>h¾<÷…ÿ壿ü?e§c0~Ç3õ–‡èuù¾÷co—C»Ûؼj„ì‹…•¸žÙUŠF¯B{Ç=ëF L¾cý4‘1_Ž¥ZÞ‰¯ƒ e(õkj5Î~¦Õ_c‰ñË& ²÷o«DuèH#Ò  š²¡fåPWz(¥/ÄÎôY‡úlzáå§>ÉBs‚sPy§5!zà$»J0¶ñv9ÑeãáN>>Ò\ÛÖ@Ǧ|G€2[U‚J»§”• =À„=|´¯Pyˆþ=•Np'îTwWÆ2Þ.ÄÙVè—‹[Š]?nÄÙu•Jh1ÿPÖ÷QÙûgÍQªmW (+Az í ³@“å?7U8Å®ŒÍNœ®)À@×òq’fm¬‡uÊíF«Ö•(©U%¨¼]% ¬é€F8LÓ™Ý÷ƒG<0Cñ‹à¥Ð+éŒ œfG Æ2æn!z€³\ËÇKš±n\ˆ³m•*àݼ@Ù¬)Aåí)e%H4ÂáaªÐ@…Њ=p–%¸ð˜»j`X7óq“ú³=TÉVþY @)äMR®«Dåí*e%Hõp_*2n ñÀLm‘³ÝûéÏÿ|WÎ/~±½go«ÀHÞÎÇOê»~\‚_@µdŸ¡l(P"ëJP {J@Y ÒCE eT‡Ÿ`6bhe3­ÃÙV‚ ·Ëq¶©ç²™£Ôsý¸¡@½ǰUeJð~j!ÎÖT¢ò²{Ê@Y Òppx Ð ygÏ·TÒŽœ{¼]íæUà\²ñs;O©—-ëG Êc˜uP«ÞOÕ®Pf‚ô0"àªiÿàpf÷¦Ö0MyçÇ÷TÒ½ #ýEìÄiQ.d1Ø©«nÛ$qvM%€ Ë‚«[ÊÌØ†Ô®Pf‚ô0¢‡ûûŠ€u”TÞ-mG%€lÇÃKßU†s¹›AH`\®åã*Õ_?.ÇÙÛ*ÔÀ8¦­*0£÷TkÁŽûu±§”™ =P';Áá~Ñl)Áèò/´ßR €±z+_ñÞ 4cZÞ´`Ú¼/®]% Ìé€Ú»ÿð‘"@èŒ œÃØ~GFo—ãlS%&b3g©æ:rÃ6 P3Y³‚-e¦üžj%ή«D=øì €²¤˜‚‡ûûФ32pNJ0òx»ÚAGÿ˜ŒV`Q÷ßJ®#—âl]%€º‘‡Z¦eC jã¶Pv‚ôSpx˜*LˆÎÈÀ9݋Ӷ2Œl+è´ 0iׂî¿U]GÚÑ ¨íg'/`t£¯]% ìé€ÊÒ¸€Íxhé»Ê0Ò˜»g7T`*näã.ÕXG®/ Þƒ£nÓ±¥µ²«” =P{=R¨¯Í 320º;Á‘,F’ýã]•˜ªwóñ—r¯#¼¯âí8æ-)0Á÷Uk¡½ãõ±«” =À*ŒYübe5ÎnªpºÑ4Þ.áfe+‡)ñûŠàY@ƒÖKJLBþžwC%ê%~þ¶£ ” =Àì(ŒQÞmK%€s¸¿Ä3~Œf38úÀ¬\ º—y»d9ÎÞR  A®ç Æm=èF_7·•€*¤ªh;èúœÏº ÏÑ?Já¦Ðbim*ÐıÏÑR€qÊ›¦¬«Díì(U H0!÷÷Ãý‡&6én 0~“·³é0M` â+Agdà|Þ‰Ýèw•aèñv)8ú@Ylåã2åYO®ÅÙu•(ë½® ÀmMSêhW ¨Az€ ÈBôõwwïîޛؔݾ0= ' 0ÃYî}úÙDÇílú›»¿Qh€ Ša•å8{[%€s¸CôÊ0’­à‹l€²˜vn*ï+€&[·ƒ0ù‘—n¨D-í(U H0òéÄï#ëjœ…>¨Î˜úàÑ£ðùƒ‡ pNùa÷U8‡{qZU†‘ÆÜõ Ë.@Ù\ÏÇgf¿žÜíŽÌM•íൡ ÀßS-;‹ÖÕØÐbO¨Az€1˺ÄgAÉiøôþƒVø(?]ñËíÓÏïOí¾þþþ}8¿ ¬œÏš/w–ÜP €r¾'ÖxæëÉ…8[W €p3?r À¹ßÛG««]% *éÆlÚ†ç\ØgS»u¤8ŸøÅìJœ½¥À9¼CôÛÊ0’­à‹l€²šºvÎÚ†õ$À‘M%Î#~Þ»|Þ[g;J@UÒŒÙýGÓ ¶öà¢\Ѓ)ÝŽP0‡ø.àý¢ßP†‘ÆÜõ8»®¥v=¯™þzr)|ô¯“V”ñ=ÕBðyoÝí(U!H0fÓîÿhÿ@Ñ.`¡öi÷j`#N‹ÊŒèƒ¢_S†áåáÀ •¨Æ{ä|ÜfúÛ&‹Ù ŽðSg÷âgr»Ê@UÒŒÑþÁA8LÓ©ÞçÃýý©ß'@Ì"Ô®#=Àðò®f:>£º§5eÙVðE6@UÌ]<§½m²g7Uà]éQÞS­ÇÙ •¨µ% JéÆhVÝá>ÚW|8õµé5Â)cè –Ë$ÀH¶”Q¢_‰¯î*Åðò/²¯«@¥\ÏÇo¦cC N´©ÀYâ{×å8{W%jo[ ¨Az€1z8£`¤@&œÎQ8ÍÁÁáL–IË%ÀÙâ+q¶¨ÀÞúe!ú‘ÇÛ… PUù8ÎdוKA7z€Ó\‹cåš2§¼ŸÊÞ³n«D#ì(U"H0F³ ÒïÏ  `ì¾àý:šÀ©òîDo«0‚,D¿¦ ç²§ye¨¤ùà(NÓ°¡g²=œ&{ϪiJý݉ŸÏí)U"H0F3 ´?Ô‘ rã§£‰œiS €¼)D>qÇ¥•8»¡•v#ϙ̺r)èF0ŒëÖGÀ ï§6ƒÏšb[ ¨Az€1šU óàð@ñ¡ä« ŠéÆ$aGúÌáaêIÑ,»Âϲ>@Yå_®8Ì/pš¬ ýrüRnS).,«¡—êe>8ºÓ8·O‚0(åxÿÛ™>ˆÓ;§Lô]f冻Àû¨8Û>whš% Š’Y?ÇôLzt”'=éý9+^Òú¯u¢uy’$GWœËNæò)þ<×>³5oœ›knýJëü|^úÝ«¯?ßó’x¯iç΋¬oyL:WIú®ÛùçÃ_|¯Á·æÃãW.[ KäÞ§Ÿµ¦Yyîé§ÂÕÇkôsð—¿úu)ÇW_|Þ Â²aÙ¨ˆY¯×-³_v\}üñûæúÊxUÀÌ·ïwâìºJPa·ãt7?½—OƒÜÍ/[>áò…ÂeÙékJîÄi=è·•b,ãíJœ}¨4dÌÍìž2æ†ü²…üôRœ•—Šû~\gî(Ã…×—kqöžJ0a÷òõÔn¾.ËæwãkxwŒËòR¾~ë¬ïVòÓÂLÒûq9^køzDŽ¥ZÞ‰Ëì†2ŒeÙÏÖ5Ù{QŸg5Ï«ñu´ç5`ü¯š¸Ü&ªÀ˜Çì=ÅÛ*Q‚ôM|Òé/Dž“Ì:8õÉÖÔdÂÒX6Õ/ÿöïÂþÁáÌîÿ¥çž _¸tÉúShoÛ¯ÆÙÏT‚’ËB›{!·„ „\Îx¬„nÈ~)Ÿê¾óI,ÚôeöØ—¥l™õ…6ew'sw cn˜f88w3Åñ7›)ý{–øZYV† ÙdÇ&±M±“O»³ ›åûåÐ ÖÛ±qoË-Åeünƒ×#r,Õ"H?žå~!ÑÛñ:0þWŒ =²÷‚ô"HßÄ']þBé9ÉßÜûMøüÁÙݿ ½°4– ª·lXŸ Ò=Ûö{AH…r¹º!w§–?çëg)Ô/Ó Ð‡vˆþ®Åq¬ËËZÐ]—r¹{e龜C– ÓŠ÷1”Лñµ´¥ ç~¯;ú2¾÷µÛù´Sæ÷¶ùú-[§­Z·1&?ŠËüfƒ×%r,Õ"H?žõH¶-'DßL?ޝ¡ue0þW‘ =²÷‚ô"HßÄ']þBé)ë²ñÄcW óO7ú9–ƲAÕ– ësAzàh»~#ø@‰¯’B·+äN™Có#¼®VB;ü’MU Ög¨·‚ý¤–‹…Ðîð­›6³v«0æîÔèõU{…G(Ã:uÙúôܯéí8»¡\`û"{O»Uåm‹ø:X޳µÐÖ Õs®uQ| ,5x]"ÇR-‚ôßÚ±Ôhß©ÃgªÆÿf¤gã@öžÂ÷ž"HßÄ']þBé)ë²ñØåËá‹Ï4û{pai,Œâáþ~ø«¿»;ÓÇðÌo] O=ùD£ŸAz@¨“ºòÎuÿ’§¯³äjI_oY¨vKç܉/ ÁøÌnÌÝÉÇܽÇ)ûØKý „ïõ»g¿P Îáƒü=ív _Ùºl-ØÁ„ÑýY_C¾näX¼ojʲ¾„è›®Ñ;Nÿ«Ož ŒÙ{ ŸÃWÈœŒÇ£È :gÿÆaês€h#–1=Y°åÍ8=?Ï:´n4¡SRÖ‰6 .Äi-N ñ¬ïÄéǡݩv–²`íâôj|\+Bô“•±½®Ìè5ž¹ëM Ñ—|ì¥YÖóñŸë¦Œ ë>ÿN¾¾[­k`8_§­fgþ÷ÞóÔ3¤5%€ú¢'·­T™ =À˜Ì: )È@ÕäßR &,ëtÞ ÏgÁ–¬CäÝ&$Ûy ´f¯Á,Ø™]³ &†¹º;3t‚µ›qÚ³˜NÅF°ã“מ÷?yìýqBdòæóñŸÑ¬)C¸“¿¯]ÊwÐmÄú.û;óŽÍKù:ßbœåFþùP3Bôl)U–¤5è‚é(#>é}#ÉŠ—´þkh]ž$ÉÑçòŸ“¹|Š?ϵÏlÍ['çæZ§[¿Ò:?ŸÇŸ—~÷…ðêëÏ÷<€$ÞkÚ¹óâë[“ÎU’¾ëö_>äùãð×ß =šùóøâÂ|xüÊe t‰üå¯~=óÇðÕŸ÷”@ÓŸˆe£*>½ÿ üío>™éc¸úøcá¹§ŸjôópïÓÏZÓ¬]}üñûæúÊxeÀÔ·ç·âì¦J0Y˜#[¾¶8G~].ÅÙraZˆÓõsÜT¦½Ú_¨îf“çbæÏë/T‚I½­/Œ¹»Ê1òës5´C»7Tƒ zÕzxè×döz|O%8c½·îhJ=¯›Ð>’ƒ69É;ùM{mȱXNë¼|/!zÚîä;Œcü¯¬¸ 'ªÀ¶‘ÞV‰ê¤oâ“.H!‚ôœDÞsày°lX6ª¥ îÇ.__|fÞó H$ÔÉ„dÝç³îÇÛJ1±×íÒ)W¹+D[Úçn+Øq‰ñËv˜ÙŒÓvÓô1Æ1v=´Cõ‚ˆŒÛûñuº¦ C½³÷‘vla{ùzoÓzoàkg!_ ‹0H#C–r,•#H?ü²½Ú!zÛ-d~œ}MŒÿU&HÏÆ ÛFÕ"HßÄ']þBéäþÃGáWwg$fAzai, OÞóP$H3Ù–ß BŒÏûqÚÐiŽ·KÁŽKŒ×¡"ÜQЉ¼fâl5[¯ÅiQE#]é­3±½1­×Q¶½]5èóý¦½”c©Aúá–ëå DO¯ïh¬aü¯:Az&0dï)é+dN êcÿà@(½ü !z.*Û›ùÇ¡ [jm(cò~>æ® ÑONÖå8N[y×Ö7ãtGU°>˜šU% O6ßöÆHë±½8­Ä“–o³AÇš@µÅÏt³×ñGAˆž®ÛBôÔ =@ì*U°©\Ð;qZÊ,Ð'Ë;‚Úq‰‹êè…§L ž1»™¯8Ùºзͱlç±s¯Ã¶³m¶Ð>’ dVó#ï_¿›qöžJÐgK ¨AzéáþþÌã<€iË»Ñ;Ä;çÕ snd{•δ¡\À­ @_ õX/Lm;eQ%Ý.ô¶9.¾þÊŽ²²t§§-ë`½ª P¹÷H qÚŽ'ßR ØVê@€F:•—”`ænÙQ€&¤ÆaU á¶çf+?ˆCÂ7C\ÍCb0Sy˜þM•hŒÅ|}S·uè’§¶66­É×O›qvG%jaY fn] h"AzàB„:C ÊaM c%޹{Ê@YÄåq+ÎÞQ ë› [ö´ÖÂ8m(–c4÷~¾54Ž =pQ«JÐ`ÌezÞô6e”‡WßW 뛊Zö´Ö†зnÚŠ³[*aŒàÜîy@“ Òµªµ'Ð %à ñã<eµ§ÛÊP{‹ùz§N–=­•wÇ:’l*Aå-)ÀìÖ£¨Ðd‚ôÀ¹ÅpÍRœ]S‰Z{_XJcU jïvsו2‹ËèÝ|<º§Ö;³ä)­¼ %à„uÓvœÝQ‰JóÙÀlÜÉ<%H\ĪÔZÖmv]À˜ËTd¡äe  òn…Æ$ëªÒ¬øzÒ¾œaC ª­†GB¨‚u% é逋XQ‚ÚÊky×Y`ƤV¹TI\^wâ앨µkùú§ëÑeOgåm*g¬—¶‚®ôU·¤SõA~Th4Az&'ÿ§'\”¶/?ö ‰ rN‡qû›{¿ ýñ½‰MÙíž´€0²‡ûû·³éãO>Uh€1‹a”…8»¡µµ¿HÙU(%¨µwòP2TJ\n7âì–JXÿTÀ‚§²ò¶”ËIí-+ÀÔdMTÖ•é¹€þ {„Š)‡?ùûðùƒ‡áÁ£G›²Ûÿ›»¿Ql€1ÈvLúU ºOrÜΦO>ÿ<|zÿ‚Œ×ŠÔÖy7? ½_Ñ.<–N¯KüþÁáÔ×5·¢µ´–‒øá?ÉÆÛy•¨¥ ਃ¸oÇÙU¢–æóõPÕ-{*+ë^>ÆÀ°,/ÆjN·¦Ð%HÔÊ4ØaL€‹ÉŽ$òpª÷éh"ãÃ4Kq¶¨µóãRÙQ(%¨¥[qÌÝTjd#´lƒõP-y+kK Ñvhõ‡ê±ó0ÀäeŸÿî*t Ò3qé±3REa"ã²5í0æ,î N<šþúùà 0«JP;YðmC ”V” v²pך2P'ùm,×ÖCee'àêÚVα>ÚQ‰jŠ–U`b|þ Òµñ`F†èl pn÷NÿÈû‡­¡¸°%¨õël @µÆÐYøê"?Ìö¼JÔFt[W(­%¨c.µ–w8´œ[Á8ì(XÝR‰JZR€±Ëvè·'¤çŠÍè;§/Ú >QVÎáÑŒ:à cœÏ¬v€Êìx.fE je3~‘²§ PZËJP+èGÄå|+0ZÙ~áâ¶•€ ðž ÚÖ”N&HÏÅ%}±÷¾}R¼Nœ''¥äû~/ÕnžÎp¡Èݬv€jÛŽ&pA+JPwâ´© Pjו 6„¦ÙPë#¸€ÛyWq8¯%¨¤%«Å÷T»Ê'¤çü’³Âîio8>)üÂ-çÓ®K³Í²«qF `t³ÜÊÑD.lE jcC8Êë‡oüÄx[/ŽB£äG_x_%¬—J`Á³WI;JÀÖCÐd·âúpSàt‚ôŒ¦/ðvVÆ=m]!íù½™¹ÓnHgz†Z4g» êH0ªYïÀùÄðÌRœÍ«D-d·”JmE j#ëF¿© 4ІX/•À²§®’v•€1¸¥•³ c‘}±ª p6Azί/·|fŽù´+.Jt çîïÏôþu¤¨]éÎmE jc] À˜ËÔl:M”…ᕨe%`Šv•ËQ#]S€±Xõ9 Gž©: ÉçÁùA™ùTzÎáðЂP5‚앵¬µpËaîÁ˜ËÔ܉cî†2Ð`›¡Ý ‘ê[Q¦%®;wU1°ÐDïøì†'HϹœvOû/ïæ“~/ü³H4£šuGzh%¨… %€rûá?Yгy•0æBÕå]7U¢æóõSÕ\÷ÔUÎ-%`Lö”€†ùÀÎü0AzÊïé¹[çíà|!Lbð>íÍÒ'ÇNu´p ÕåÛÕ§=TòÔ½8æn)èJoý#ÙSÆÁ¶o5Ŷ¬kÎçNœÖ”F#HÏ…%£^Ðw~Z8{Øì¾œ=ýéHP)û‡ŠPAñ‹ÌU¨…M%€JXVc.Ô…®ôÖO0¢=%`Œî(Aå,(ÀȲ—Wóm/`‚ô\XÚ‰ÂfÅ@|šû…‹ß§$=}ÓT`ò–• òîÄ/S¶•*aE */û{SàÈ–X?Áv•€1ÚS`=~îë=œƒ =]y8==£ßûYyå$ÿýöõ†73-S åæH"•µ¬•·¡`Ìej¶t‚ƒ®øzØ‹³÷UÂúišU«²¬?§=% æ~··¶”ÎGž3œ‘HÏëIÏÏéÉ71L'ù$\û|¢ËÅý‡Î){ýLòõ™½þË<>qòzmÒË…ú°¤•vÏ*P 1ô—·ó*Qy›J^54Ÿ¯§`’v•€1ÚSjìƒø™ïº2Àù Òsni!€•ʲëÉ€ûa¼ôÓûZÓßžM÷óŸï·N·¦âéÏî‡OâüðìÖ÷tjkõ«ïMÈ»oñu±g·TÂz Î+îª4ÚŠ åvœÖ”.FžÉH»óƒýÃvPþþýVxþ³,PŸþ<ÓBôŸ|þy{ŠR{‚Bó§Êêõpâ÷ÓénN5d!ݦpÿ»OuaTY y²×ììR­åb;­eï²e`±ëä²*TÞ¦@es«oK ÀëÃz  v”€ʺf­Ø.Nžs9êFŸd§óóBÚwà„ÁÒçöœùhÿ |öàá±ó~N=Ù Ó"H_ÙN)Ó’@P†—…˜§µ£Ë´×Ã:<´"?V“4j¸Ý:8‡%%¨´[:#C¥,+A¥Ý‰cî¶2À`ñõ±Ú¡¬§`à¶‹œJˆÆHž±ÊÂó›¨vr÷}ú´¿Õ|’ôüʧŸßWÔ3dáå,Ä<-YÈïóΔÖ,ž§2u¡¬²£²L÷õY¾ÎãÓ8’Jõ–‹ûS<Àˆ–• Ò¶”*eI Œ¹àu‚õ0Àj Ñï*Œ‡ =Ò›™ï Å'…nõ=é“¿Qا=]é÷ÃÁÁBŸb¡öÏ”+™¦º—a¹˜fwm¨ükôáôÇQ;A•ßýŒ£MͲTÖ½¼ó+P×” ÒŒ¹àub=Pw•€y3~Ö»£ 0>‚ô %‹)gaåóÊÇ.H…›“üvB:àÆüÐ ÙwBeÉ5iØs3‹ðrÙÓºéwÿáô³Ù‘öíøC¼V¦z$‘î¸ 0]v³Ù9ÎÀH–” ²¶•ªã‡oüdY*ívüB{Oàty÷ÄÛ*a}0¥uÔÁ›¦Àø Ò3AÝH{zÂ%1nßê\_<3û9)üÖƒGBÒ§™Eˆ\`ºüfµ³ƒ×+”÷ub§#ëóAY.€Ñè:Y]ÛJ•² •¶¥àõb}ŒÙ;Bô0‚ôœO–vïKÇ·:Ð'¡§}v²óSkžNwþͯô\±«>)Œßd³ì.üh_¾¬ã‹jÝ®3é¡´¯“²M„¾çgFëôla' `ºMVÚ½ø˶2@¥¬(A¥sÁëÅúª\§›e×éGBºPòרÀtYÍêH"íû¶\CYQ‚ÊÚV¨œe%¨¬-%¯ë+`L„è` é9C28?ìoÇß½ô…¹v`¾/4Ÿvn8éüܾÂQƒûÂõ<Îd–¡»4M=%•Åaf÷m¹€R¿F¦Ëk–;XØ9 Þâ-Ûª•³¤•eÌ…Ñí(õpŒ=L‰ =ÒÉöä ?daë«O=Öó;IqÞùáŒ\áàß@³ìþýPçñÒšõs# §¼>g¼c˜±»¬ï§ÒFß?P+JPI(TÒ¢TÒø÷ž2Àhâëf7{ý¨„õpDˆ¦HžS%É ? ¸:ÞÎ> £‡µöÜ:3ÈÁálŸL8íõy8ÓûŸå+8Ù¬wp°ƒ0¤%¨¤%€jùá?YR…ÊÚVðžÅz ¸ !z˜2AzÆ+í ß” uQZ¸¡G¼ú=*AèmÿàÐQB³~^2á´×çlwtyäõYJeØÁáÐNPÀÙ®)A%m+TÎ’TÖŽ€÷,Ö[ÀÑÀ Òsné)‰ùvkˆ@VzÂé¾óõŸ?¦ ·YwVæ8G €’Ý3L K—Sv@zh§E€:º¿tÙS¨œ%%¨¬%¯ë-àœÞ¢€Ù¤gâÇíGò —¯ž“2.³ß¹AGz(÷ëÃØ À¨~øÆOVT¡’v”*iI *évü²û®2Àù䯟Û*a½ õfÜ.ÚP˜ AzÆã”îô=W+œNã­_KOŠÕ÷ž{p ûyѾzPR³î¸ XTÍ£ì`ñÈNPu´«PI JPI;J^GÖ[À9d!ú-e€Ù¤ÎMçñò„¯Qªç0M= ì–• ’v”Œ¹LÍ®€×‘õ0"!z(AzÆ*™àm?:8˜ø}TÉÁáÁ̃ÎãåS† ¤ 0”û5zp¨#=#[P‚ê‰_ÀìªÀÔì(xŒhó‡oüdM`¶é¹°S3iëÿVø½€?-ŸœzáQø0•¤oÙ?„¤œt5†²¯?ãc·ã€Ó-(AåÜR¨¬e%¨œ{qç¥=e€‹É_G÷TÂz d>NïÅ0ý¦RÀìÒ31ƒâXòµåó°!G¹÷7Ÿ‡_þï…_Üþuø÷ÿê—a÷ÿõ¿†ÿþÿþÿkMÿÏÿëÿû÷ã•é)ÓÝ8íÄi;NqZÓ’¥‡†XV‚ÊÙU¨¬y%0æ‚×Ö[Ð(oåß?-(LŸ =÷h@çÛ4h+_‹ç¶!¡; zö†¿ýå§­Ð|'0Ÿ…糟³0}ªÿôÞÃQn2 \Ó8½§ŸÅéñCͽ8me‡Þô'P"»J05;J^O”}ÿ´£‰LŸ =¥rZÇú‡BÛ¥sè@‰dáù_Ýù$üÅÿðWá_ÿ7¿ÿSœg¡ùó£ZŒÓÍ8½§ãœ»BõÔå¹zö”ª'¾XVc.x=aýu-N»ÞcÀt ÒS©Ð6T†_Àë¦)ë.ÿ¿ü›_µÂóÙüïb'úÊ>äì„ê³Nõ+ž!jàšTËOþç;ª•´ •´§àõdýŒIv„ä¬3ýšRÀtÒ3qOþÖeE€†9<´ã x}ÂduºÏÿ›ÿÇðïÿÕ/[§K(ëTÿa§K½g ˜’;J0=v^¯'€1ËÂôïùn ¦Cž‰»tù’"0Y€þ/ÿ?× ÐgÝç|V‰£,´ºÔÇ<÷â´êY&lO  ²” rî)x]aý’}·´® 0Y‚ô@%t:Ðÿ¯ñq8ˆú ZŒÓÏ⇞Ù!9—=£TA\VWT¡rv•*Ëûc.àueý½?§ßR˜Azh¸ƒÃƒR?¾{óùQúŠèû]ÓGñƒÏÍ8-X1»«S³§àu0a7…é`ré€RÚ¡ù¿øþ*üûõËðà³ý:þ‰oÅiWÇo`Ìv•`jö”¼®¦@˜&DîÒÜ¥Ò=¦¿ýå§­.ôç5·§³îô–D`Lî*€1¼®jG˜&@(¬ ý/nÿ:üO±ýA<Ý oÅ?³îô –JfI *gO  ²–• rv•¼®°þàÿÏÞß|Græ÷¡ç¥–,K×.H¶53÷Ü{ :wfã9§Ð3§×•ü ž3›^1¹Ö‚àj–D-gÕà¢×D­´º§Q³ñœ{l%ǾG²:KjK–ÝQêÕ"›$@v±XoˆyDdfd"ñž/ñòùt$2¿Œxâ%¿ù –H˜æLìÅ«WáÛ/:´Áóo^…Ÿ<ú»ðÉOºZ‚»q:ˆ'@7, ÔȺ4Ëþñ¨4Öš`û\@˜æHž…;Î_+ÐYÏž¿¿øâ0|zx´Ðéó¯¾Vl ÑŽ>{ÿúgáéÑ‹®—âvœöã о¥ öJsw ¦€9¤gá^¿Îè¬/õ«¥<ÎÓoŸŸ„öšèÓ'_‡ŸüÑ'áÕËcÅ(¤0ý‡ÂôÀ56À™ãâó×áß<ü …¸¹“0½2@+­) ´®P+w‚ÆLpi‚ô\O–©ÀVÝþÕëc/P;ÿîÿó_Ã˯b>îÆ“Ÿ;ÊíÛÆ+ ´¦P;é<ÓŽ2ÀÅé¹Ðy™ùY?›n,¯Ï<Ð5¯Wd¡#=P3þÇ?Ÿ~ò•BÌ×»1LßSh•GJ@ ”jéíø^Ò¶2Àù陯 Õ Õ]ðêõj;.¿¤jäË_~~ò'§‹±ë²œœáýø^Ò¦2ÀÙé»nÊ=?ý‹E§úLMNZuþ8÷±% >þã¿ýkEXœ;qÚVÎ3m(Ì&HÏ)ÙeõS!ÍLf`äÕëã•?‡ºÒ5ðWö‹pøù7 ±XïÆ“Ÿ=e`†ÛqÚs•c˜MžÅÊÏ “f'ÿ»|Óä|æ—µújÐþøØ` ¬Ö‹ç¯ÃŸÿñÏb9¶•€3¤«ï*œ&HÏüUÚÓçrœ@éÂOþäçáå‹× ±÷b‘¾2ц0Ûñý¤me€I‚ô¬^vòæèùË—Š¬ÌÓ¯Ÿ‡¿ú³_(Ärm+­)gx?†é{Êc‚ôÀ\ýùÿ\–ôKuO ÀúÐ@{ñ=¥ue€‚ = ‘OÍgÿô"Ùõ~ €•yñüuøø¯~©«±­œãvœö” ‚ô\ß0çžejÀ‰¿ú³¿W„ÕÑ•XS.p7¾§´£ HÏMŒÚÎkP7ß¾x©ÀJèF¿r}%€N»«ÐhJÐ,ñ ç5Uë¶_ÐPïÆc°Me ë逹øùÇ_†§_?WˆÕºOz®+s´¯Ks ³¡`½Âö lךè:Az"›šÐ~ÿÕgŠP[JÝåM.évœö”€.¤g¡¾ó1€.xñüõIGzjaS  Ó6”`iÖ•ìË4\ºÚñ–2ÐURÎ,ÔoÿÓßT€øùÇ_(B}܉'<7”`áÖ•ænM –îÞ[ «éY¨çß¼T€ø»Ýèk¦¯ÌÉ4NO  ±ö• qÖ”æn] l¿€•Øaú5e ké9%ÙÅ7ʲKÝ×·‚ôð÷•"Ô˦0øÇp  p¦ %€¹[W€•¸§me kéË®û{YÈóÊ¿«ÿÈû”Ÿ>¾zúM8ú&NOç?=ýö¹åèŒgqßê:ûLóן…—/^+`½Ü‰]CÖ•:©§Kc æoC VæÝøþROèAz.4’¯‘/¾þ:|ñÕ×'á­¯ž>[Hþóxÿih÷þ^þáË£ðÙÑW×Úgúäg_*b=õ”€99R‚FYSh¬%hœ;Jsw[ l¿€•Úaú5e +é™!¯ý3üöÅËØ-þÅR+u¥×™h³¯^…ç/_^û÷¿úå·ŠXOJÀœ ” Qî*4Óþñ¨BóÄ7–ísÁüÖ§ž*Ø~+—l+]!HÏõ”mêçÚ­>»üM¿úæÙRÿÜ£§O½ægí+}öLêiC  ›„:–j] ÀúÐ2ïú°3]!HϹ²«þB~øÄï¿zýúFS¯ãÕëã“N­LzzèÊ=5vO ˜“C%hœu%€Æz¬³¡`}ê°'J­µÃôkÊ@Û Ò³PÙÕ£øzöüÅJþ–§Ï„Ħ½zy¬5Op®«s0P‚ÆÙPh¬C%0æ‚õ‰9Ph­;qÚVÚNžóeY¸Q>[DþåJJñì… =À´£Ïž)B½­+tRO –fC `n\U  ^ÞM›zÊ@› ÒsyS¡øüŒ|úvžŸÜâf—îdÆC<U Òçùä|^½>ŽÓkËM²®ÌÁ@ gC  ±ö• qî¸Ì9Ü\\ì¿Ønõ´«W²¦ÍÒ– ý/åêœdØÐy~–ç/^®ôo}ùJ êéÑ E¨·u%`• qnÇ0šõ`yzJ7¶¡µ”šl+À¥m(A³´%Hॼ¼¹5o_Bø¡¬lMÿòõ«òß3›Õ/Ü‹W¯,@¯_+´Ÿcîfê)4Ò@ iC À¾‹íÐbïkÞ@[ÝR®äŠéõ/ùt®?«#|¾Ä?ÿÛwÄX¶?üã?8P…FÚPh¤C%h¤ž€õÈv h¹]% é¹´‡W¯W^hu%`NŽ” qzJ4P‚Fº§p}eWÃ;*ÑHJq/¿õ•¶‰ËuO Ûé9[6n?_O„É˯¯0Ïʶöùä7O?ìŒî÷/_½šñ4³¥•äŌǀ[Wæd s7žü]Sh–xCUh&o¸ÁXš»Ý:Pè”çhAz®å*Ùý;¿6ù»gÜn°¯Þ ›ºñqå§ïgYz]é–¿Ƶ ”€99P‚FÚTh¤ÇJ`Ì…Žé)íз㴣 Ž•ÚDž³ÅÀøY™ñ”—:ÉLMu­ÏÂÕBö'¿T½}61›øÇq~|é»\$]éhC%`N” ‘zJ¶ßs¡6•Àö hŒ·]™Ï±p®{JÐ,‚ôœ¡Òù}*™>ì:š¾’¥/op¢ŸcÿúËçg?Lvêáfü°ðòõqùøWzúÜÜ4Ò¦@#í+A#Ýo"¯+\M\o6BÑÑæ(tÖŽÐ"=%€n¤çJÎʰ_*Ü~ê¾&ÓîyyyuÊŠÀ~~Ö¹ÎpUJÐH·ËpÐ,‡JÐX=%€+ë+íÐ8©¡€ã9€)š­4“ =—6+²ž—ÝèÇ]ëÇ·~ëÖa÷l¢+}6ûqóé°D%h¬¾€1—¥ÙT°ÞtȾ@§íÄÀèš2ÐJÀ­+Aó´%H¿ï¥\‚a˜=Ÿê?#ÛžWnók·®¶˜ ³òÙ©ïå§ŸË÷ÀÍýáÿÁaœ©D#m*4Î@ ëMo Ãå•Wι£u Ði·ã´­ ´Àš0GëJÐ<:Ò3 ¬ŸdßϨgSáù|V¦}øÍt‡•$ûW_<;ó‘ÓÿN~-vžÏÏxv•ÇȽf+0P‚FºS†Ô€†(?¼Dsm*\Z_ ½½:P EžÄéþ§GSÓ%§%ÞçŸ×•aÂ@ gC ˜#cbeyÞüTrÜ oÇÙû^Î+¼ðÓùô0ŒµÇ¯ãn¥`{–n8üw¿ÈÊ |šßº5ü^vr›ÿ}òëñÿãÿéwÂïü¿5ùø¡Òà~øU>ü:u´ÏÇ?˜ºÝ”tûlü{Õûg±þ§ßûç+GO¿9™¨ß[»~ó7~}éû·ŸþRñKÿè×=üï~ç¶BX6j»lü×GáùË—^ø÷ÿË_+B½Ýá†me`NÇÞ;qö®J4Òq,ØRhÔ˜»g÷T¢‘Æ1wSàRcÝAБ¾©ű®×å,{Ñò…mŽ·Ž›¥ç4-w¶?WXVÖCº[ E˜søïôµ7|±þ4oüw ÒL¿£Á söâìM•hé9¥¡ús?h1ÆŸq?' Ù­lüòËsãcf£_É+÷—ºÿ¬ú\rÇ¡ t µ©`ÌeiÞŒo–¬)œ/®'½ Do;ÀÉ•~â´§½ô!’8õS(9NkqJ±˜7âô^œ>ˆÓc£†î•ÇxÐdJÀœ¬+AóÒ3©’UçÒÇÝáS°~"¯~Vv½r£§_=?óá&"› Ë¿Ê.ÊÇW+» ÜÀµ ” ±îÄ726•Œ¹,M_ ÀzÒrJ°eÈ~']q2NSáú‡q:R%j`G h¸ %`Nî*Aó´%H?ðR^ÍÅÍÛ«àÏÈ˧P} ®§û:™*íæ« â_½<>óQªçC^>N6¼¿â>ólâ>›²~6¼}6ûÙkP0rѯ¿yŽž~³°)Ýÿ±«ƒÔÍàØ›Ò¦€1—¥é+œ­¼jƒ}“fÛW€Õ©„ë7Sçúø­ïÆé~бžÕ¹õúÊàx©Á6”€›ruŽæjKþÐKyeË z^†AÉJ`2ŸžÌÇ]â‡?žÈ½gÅÿ¦¿—MÞ4=/ôâ›W3îýŒçMþ0«ü#+CõÕæö£_M©þ\¼ *u£ÿúÙ³¥>æ×ß<;y\ ýŽ>{¦Ð=ûJÐh[J2P‚Fs%˜¡¼Äõ•°}`ñf„êß >¸Ïbítý|H\ßö-ÕSnhC š©-Aú/åÍLæËìc>•°Ï¦B‘ÃŽóå7GÿβÑ=<úúÌÇžÈâgeX>Lu¾Ï'áTö¿òܲ,›¼_€{úìÛ¥?f Ñ?{þBñ¡ cÌ‘u½îœ¬cJÐh©#Ц2€1—¥ÙR8e[ Ïq&@•¡ú8­Ç¾§ªÂÜ·Ð\=%àºâûoAóˆÆjE>îäx)on‡ŸêŸ‚ñY6ùïQˆ>„³ë•pû·¿zyÙ'1zÃL^ö¤eüË'“eãÛM<ÁY÷ÐQO¿}¾’ÇýæùsŇøJGzè¢4Þ–@cì+Aãõ•ÆâŠëqvO%°Z© OœÒ1ëïÇé~œŽT…9Úr•>W~h¨ž`ùé¦[JÀyFYøò‹üŒŒ»Ó¿_dÛó2iÿõ—߆Ùwʘü8 _þkò1²j‡úJŠÿ‚ üYùz€.xõúuxñêÕJ[Gzh¿çß¼ ¯^+tLùAvoª4Û½ø&FO JÐxéJ }e€‘m%°} >ÒùÞ8¥ýôõ8½„™]éC8°4Òݲ \GO š«MAzoä_Q^ ¡Ï ¤ç3ÿ5ê_ ×—]êó0ʽOÜÿ¯¾šêLœMþ#~£ ̇Jü,~‘åS¿S ÝgÕIÎŒ<ùj¥ÿí‹—^h±#Ýè›à‘° ûJÐxÛJõ—.¹¼mÌ…–(߈~[%D´O:§8¥ýöw‚óÜ\×»ÒZkS ¸ªr¼{S%š«MAú—óÎËŸŸä'zÁO†×Ã0ì>î,?nd_FÝãìÛ¯ÏtæÓÏ'Ÿýïì¬'[i‹Ÿ Ô„+Ò?)Hmöôð¹"@w9þn>]é¡9ö• ñt¥‡Â¶8 þb˜~· Ôßššr}]ïJïØ©¹zJÀ5l*A³ÝR†fGÏÇá‡9õlF'û˜Ï‡wpÒ>/~”ðÏŽ^Œ'?ÿ‰ ÃòÕÀ~6ãÙfå Æ5ýìÏÿŒ@›½xõªÓ,ÖÑgß*Bý( ²¯­°­Ð%0æBÓéFïX€æ‰aút,›öåï«×Ôå®ô‡^þÆz³<W±©ÍÖ¦ ½ МŒóa܉~hØu~tÛPvÏ'ÂoòÑ¿¿þòì°U>q‡£_ý3=<›ñùäã0¶êŽð¯_{ ¥^½<Ot¤o€%`â(ûªÐ ºÒC3sÛAWzºn[ Zc ÝÏ–úßÓCኺܕޱS³m*—U~`èM•h¶6ém€æ ¯´Š¯ãSX>+6 ÏWìyõwÊÎðY5\ÿwøù³3wxߣî÷å†ÿõ§Ï&~©š¹/~”)Ëô¢:<ž×àSF:ÒC{}öLšáP X ÇJÐ ÛJõ߬—Q7æBƒ•ÜÓ¾=Û¥}Uèä~àAœ6ã—oÄ鉊pýŽþ݇^zË-–šã–0’_ðÍ,«tˆ†ÝÇø“0{>n)òß2ìž•ßxþõYÝ‘³“ÿåå³òwÃTwûê­O‚ö§îf˜ÄÏ'þ¡z kêbõúµZè+Aú¦( ´¯­ +=sYžÔ•~[è Ë}{ý,eسl´O¿÷«£ç!}~wøl˜ˆ/ÓùÕ,|6 Ø;ÖϾƒ0Ñ…þäׄêV°=qEh›£Ïž)BC^*%`‘â$‡A·¡6ÙvBj=ælÛ[åí²S´ÝVБ«mÛ£}U`Æ~âvОË#vc¨f»t¥çñïzœ½­íК }Ü1;ðrÎG~ªýøß)Œ>ì?+Ydà‹ŸŒBõS·ùÕ/f>nvÒÏÆù÷lüðY6jP?¦/¾‘³óçþaœËöâ•®ÕÐ6ŸòTša ,Á¾´F:!¼« `Ìeiv”€6‹o$nÄÙû*Ñ*”€³”Mzqz œá^y¬Ø%^öÆÛÒ„ˆsl+A{ÜjÙßóÄKzu—Í—gaŽ?ùwµ}^éR?qßyù»ãîõß½³›Ãg³âË"A?ºÿtO£nõ!Œ"ý•®÷Ùð*¤Ú‰^Wz€›ùB¾)”€%ØW‚VyS‡d0æ²4w㘻¥ ´ØŽ´ÎžpžtÓ8õã—ïWÖc¶­Žý½^òÆKMˆ6•iºÑ·OÛ‚ô6@s05ϲ0‘[~» Ìçù8 ¨/;ʧa'ùqgú<|þ‹_ ïç£ŸŽ¾1 ÇŸÄé'2öY%s_ü¯|ªEè~ô0ñ)|êß\nôŽ *¾)²§ ­³«» Ô–1·}¶Ë7\ UʉÜS‰ÖÙW.#ž7Þ EwúǪÁ”·»tþ9® Ž£ÚaÛû&ÌZ.” ]é9S^$åGÙó"ŸÝ凷 “!ûì$J?ì@ŸCõaÐùòuxúÅdWúl2¾? ÅgÃG©„òO¦ÊƒŽžMµ[þð ëJ07ºÑ7Ê@ X’GJÐ*w‚“PKñ·ƒàjœm“:Zí*mR~8ľDûÅícL.­ÜìÅé¡j0e«c¯óyÍw§ƒË-çоé9qV‡øêw’ì$Óž¿“Cëé>ŽË°}>qßùèÆ'Ùöø¿¯?ÿvfsø"(Ÿ?+»ÎgY¥«}œg“]éC6yy%D¯+=À|Ò;6‚ö” uÞ'{ÊÆ\–â^Ù½Úb7Áö€Ž‹aúÃ8mÆ/ï«ýŽý½/y+léJOÅ®´OÛ‚ô6>s2ѳ=ËÆÑùj6½ ¤ç•®õ'ú:ÑO†ØËߟÿÃ%BX•v÷'í«]åO¥ ÏŠç™•¿R ÑëJpcŸÇý«—Ç Ñº²DûJÐJ»N ƒ1—¥I—‡ÞPš..ÇÛqvO%l *¾_‘ŽÞ‰Ó‘j݉Çýý½/y+¤¦ÛÊ@ÙˆÊù¯j[þÐK:_ÃÀ|^v¢ÏËŽó!LuyŸú¥¢³|>l? ÛgeWú×1„•ºÒÏ|ÌržwÆyùü$Ÿ…ò¹„J‹ú2u? ô»äëJ0ºÑ7Êc%`YÊm¸4iû¤K•î*ÔnÌÝS…VºmÌ¥éʃ¼¯­eûÀÄs鸷„é)ô;ô·î{¹[ã]Í0Îã¶V«‚ôqÇËÆgŽòSùJ{øqúU»ÑçãFòyyƒ“ÞñYq»ñ¯æáW_<Ÿ¸÷¬2ÏŠþøñ²áOòñ?+é³Ño]é@¾Q”€%ÛS‚Vz³c )*A+ÝcîŽ2ÐDåUlì¶×£øÞÛ¡2pSeS– ±›s<–\ïÈß:ðr·ÊŽtWy5Æ;*ÑN·Zø7é„wMÓMÚ'bæe'ø¢+üøöY^Û‡ç‡?È+ÿ•€}¥™ýg?ÿUxýêxüX3rí•ü|&ê³lÔ¨~4 §úwèJ0Ÿ>ù:¼zy¬Í1P–l_ ZkG‡¨=%h­ÔÕjSh ÝàMDÛ¸„¦?Egzaz¶:²ÌYÆ6IÙR†îq5ÆökcþÀË:_y™€ÏËîò'óüä«Q×øüŒ_¬ìO~§ Ä—‘÷ð´ìJ? ÙWî/«Æä³á¿Ç¡üâvñYT»Òg—ïJ?îlÀy>×¾iö•€eŠ'‚÷‚Kò¶Õí8í–fÛyo·CÙhòÍã7U¢Õö”€y*ƒÅ½ Lßuýý­/w«l;×I»JÐnm Òï{Yç'?‘/þUCõå¿‹WºÏB÷Eˆ~øÛÇ•®ôÿñW37EíóÑÛҧ ü<ºÒ+§8ËÑgÏ‚ôMs ¬Àž´ÖÝà!ÔFÙ¹ÍÍí•>À´çL4A\N{qö•hµÇåvæ*…éã´¿| u»CWæÛ÷r·kÙ Þ3é”8Ví„â½2ZLGz&LçÌ'"æe·÷"Í^ùvž—å‹}V~/;‰Ò‡qçú²C}µ+ýóo^†/1+˜•M~5 ÎgEWú®Ö•~"PŸžC¥+ý¬p=…Ÿýå—ŠÐ,G‚¬È¾´Ú›ñDá¶2@mì*A«¥7ev”:+;¯í©„}|¸‰ø~F?ÓwY¿#çÀKÝ:÷¼gÒ e#‰wU¢ýé¹”¼HÊ—Ýæ³Q—ùaX½Òdþäû©ë|uu”“]éÓý|zðõìÇ e0>ŒRò¡úŹ]é³É®ôÃ@}¨Ì«az=éNKÝèÓD£ ”€ÙS‚Ö{¿C‚À˜Ëª½ÇÜ-e ŽÊ+&¤qè¶j´Þ®°hÂôöf®Ê—ñ}/u+¥÷L6”¡½*çÀè€Öém|æ/“Û³òß'õ|²ÏòqWúâÇ]é‡!üé®ôé‡ÏŸ½šÙ•>«tžÏ&¾_}nÃùTWúôßÔ‰>ÿþDX~ª ½0=ÀiºÑ7’ã!Vu,~gU¢õv†ZŒ¹qöX%Zï>ÀD]÷‚ËYwÁ“¸½(Ë LßiýŽü¼Ô­´ß…ƒtùõ ItÆ­–þ]ÞHº©ŒùdÀ¼ÒÅ}Ø•>TïùŒû: ×OÝÛåºÒ¹sÏN?«Y]éG’—O9«<·¼üæIG}ñùy{úíópôô›…N/^½Rh€99ŽÛÃEÛ_óìäqhÝèk ¬Ðž´^:aèÄ0Ôîtãuö&ê$.iìyS%ìÛÀ¼•azaãîéwäïÜ÷R·ÒmÇÏíTžÓH¢CÚ¤xiçoÜQþä_å7Ó²"0Ÿ¾~û8¯íÃ(y\¶°w¥çv¥/"ôÙŒŽñeWülFWújؾLÑçyuÆ~`:L¯+ýÍ}vôUøü«¯ÈüŇ'}n&}0é“_~±ðqûË_=c÷—Âô £}cí++´§#eh=az¨Ï˜KwÆÜ ¥`Õârس·U¢3v”€Ø š§vÍÝx¼¹Þ¿sßKÝZ÷ÊÐ5-áX7 Òs±“ y>ñïaô¼È¢—¡ö0ì4?’›îJ_ƒõîô“¿›Mü{Ü•>«´˜Ï²©ŽôùøÖÃðü(p?zî³ Ó__ J>{þbi÷å׿ ¯^¿Vx€øâ«_--Üþêõqøìð+EoÊv]7ú¦z;¶*«R.{*Ñ © Ǿ2ÀJÇ܃ K[W¤0ý®0±J刪Dg<.·3°Tå9æ^¦ïš~–í}/s«½]ž;¡áœë®¶ém|nh"SWùGµ+}^vzO†újWúÑí¦ºÒï£èJŸ—?J]éùóé®ôãnôùÉ#ŽƒîÃNòûÿF婇¢ýÄó SÝé+]é‡÷%L5)„ùõ7Ï–þ˜)¼Àõ¤+{¤ŽôËôüåËðí‹—ŠßºÑ;‚ØS‚θ«Ë ¬œu°Ccnp5VĈ¶/°Le˜~3¸úi—ô;òw>ôR·Ú‡ñʦ24WyUЕè¦VéãNÕÀK;g3»Òø“Ÿäe.=ŒƒñÕ0þy]é‹ß+~ö_…W¯ŽÏzaÔ£>«ÞÁ¸+ýÉÏÇÿ(:×§ÿfÅT}Žaž¦¿±¢_VGãª]Åã´eì^‚ª¿Ï?yª}s9¢Çã{Á]ò¶0=¬ÔžtŠ0=Kç DÛX…ò I½à\sWÜ)?ÛnßKÝz»Y–[§|ÝÒ:z[5ºéV‹ÿ6—6¾¡³ºÒÿ]íJÒ]¾Ò•>¦›'nÎèJ`/¿þóêÅqøâï~ª¡ýl*~ª+}V Ç—·Ÿ¸Íðw‡Ïqê>Ê;¦¿§ß~»ºÇ~ö­àŠR'úew£J]é_½~íE¨±ÿRšk_ ¨‰]%èazX‘²CÛ•èaz–ƈõ° -ÀJ•MTû*Ñ]x­÷½Ì­—Ρì Ó7‹s`$mÒÛø,È(S?êJ.ìJ?ÎÍçEÆ>ßæø8/ÿ]„ðñ7_…ß¾®ÜË0Ô>©Ï&ŸÓ8ŸM4Ï)ŸX–o’Íøã„é¯&…!_½>^Ùã™\Íó«;Ÿ¿|åE¨©O~zžãõi¨#Wæ¢Fv• s„éauö” s„éY8o Ú®@”W@}O%:a³Ëó Ξx©[O˜¾AœcHžsM4¢Ïª}ß+· áÜ®ôùñdWúa‡øá÷Êfðe¾øÝ¿!®¼aŸŒÐgãÐ|VükØ™~|/ÿ=¼‹Ño”)újà?þ¡Ã½0ý•¬: ùìù /À}³â±óÛÆî:zõò8üì/¾PÇ?pcåÉàÇ*Ñ9Âô°š1w/x®‹„éYo vZú€¶ý9j%î£îWäë‚;ñxt½ç¾—º„éÀ90ªZ¤;R6<óVIÕCðy8¿+ýqåwR®þ¤ùü(X_†ðOþ~'ýððÓgáéá·£0}^>J6ŠÚOFú‡ß˦ïY>ÁWrõ'Aùa@>þ¢0ýµÔ! ùâ•ιЬqãåB§ãÿ"|zx´ÐéçŸ}Žž~£àgx}üzå6¨Ã¶ƒIGŸ= ŸÄ+ÑhûJ@Íì*Ag ÓÃòí(Ag Ó37q9êo Úž@ Åfª‡q–ŽY¼™Õný,Ë{–ãN¦¯!!zfi{~ßK|sY»t¥Oáùã<ŒoYüðäç'Aûlò~¿}ö*üâã¯f†×óPé`*_davšÏ*­è³a_úòF£0ýðÁ…鯬]…2¡þÒXÿé—GK[_Sþëož)|ÇL]éëåãÇ¿T„f;Š'ÞÊ@”ol¸Ünw¥0ýž`',mÌ=Št™0=7V†è? Þ@ì²ÇŽ+¨³rµ¯­v7Ÿ®wàïÜ÷RwŠ0}h$ÁY鹺«t¥O_—ß+nT¤ì‡?;þbVt­?¹]>üV~¤öõ‹PÉÂÃðS]éC%ˆŸ¿xÏòêïÿŽQf>›úû.Óp5_~ý«¥wAOaúUw^‡&øÛ¿ø"<=z¡Ž{`v• ÓÞ ‚`ÌeYR˜~à 9®£¢§Ûv”€º+»y ­ÖëÀ߸çeîœÚþqy†ÑH‚ó´:Hw öƒË¡ÌÅå»Òç•®ôÅ펧~mø;IÉÏCžê£ð}yãŸýå—ÅmÊ[äåãLt¥/[ЧgQ ½ùÉOÌË–ôÕÜ|ùƒsÃôºÒ\ޫׯÃÓoŸ/ýqSˆ^Wz8ßÓÃç'ûZ4ÞžPãcò'*ÑiÃ.ÉJ sw¹wǘËUÅå%Bô9® A¶ãôXZk³£ã¯îú0ž‹ÙR†åsŒ‹ÜêÀ߸ïe^€3»Òg•}Ùñ=å‡aúØ|þd:¹]ù²Y}ùóøï2ÿMìHÿ±3}qÿgt.»ÊçYå6Ù(__tŸ?™Â(?ú2ËFáÿˆéó LpY«Ñû[/œáÕËãð—ÿá á˜m[ :O˜–gW :ox©è¾RpžtŘ8íÅ/ßV Òö#~ ëPh‚rßÕqo{½Ù‘eø¡—º³~BÝ®æ»å9°ýàèB~ÏË<WïJŸ‡¬f?.;Ê?Õ€}egø¼ ¬—÷]>Æ/þæ«ðìë—§ŸS¨ÚOBûÃôÅWƒñÁ÷ÑMF.L° Ïž¿XÙc¿z}^¼zåE€þK Ñ?ÿÆúÑã ·e æÇ䮇˖Ârì*嘛º[m+³Äec=Æ}S5(í(MßÄÙ}•híqëfþÌ=¯t§¥P÷~yކÅ%qv§{ªÁEé¹¾JWúQ˜>w¥ÓG_‡¢Ó|qû|ô;£ø¡ÛçeÊ~¦ò矇ׯòsžO˜è6?ú:Þ+7¶ª¯üÂåÃôÕ»˜¸O&Çñ|ÕAöUù¡®>ùéQ8úì™B´Ã¾PgegÇå ¥`çŽ2ÀÂÆÜƒ8{ ”ÞOÇu·¢ª|qŠ+Æ@òЇ³h¢¸»gU¢•zø÷¼Ì—ÎÍ :òÁ‘¥+›Œü8MGàB­Ò—oÚÛqš“Y]éóPùfVt¥fä‡]éË`ü((_þJjR< ´çã€}>zˆ¼ìvÂóg¯Â_ÿég§Âôà~ùdf'ÛGaúò¿y¨þ+LÏ. Óg•æaâר¨C7øo_¼ôB@ÅÓÃçágñ…B´ÇžÐÛJ@Å»é2š‚°0;J@Eê8¾_†§é¸¸lo b»@»ô• •zmÿË<£†¤s4?J ˆ¼g2©Ëz*~ù¾jp·:òwîz©g ¯v¥ÆË‡¡ôá¿óኮóÖõ'úãòwó‰°ýè~ãìÙ×/Âßÿ×Ãò‹žLú²LÔ&Œƒóy–Mt©¿r˜þäÙ(PŸ‡êý0ôüåêCì¯_{! ôêåqøó?úädN+ÅmûÊ@Ý•.ªé2š‚°1wgT‚ŠÔÝ*…éûJÑMéØ8íÆ/ Ly☀&+σÜW‰Ö¹›Â°ø;÷¼Ô”Þ EwúžR\_ÙD"mî©WÕ• ½ ÏåÓ!ölØg~üïjçù“®ò)¼^vŽ/²ò•ÛW‚òé¶'±®ãqwúácæeÀþó_< ?ûË/‹ÐúD‡üÊ<«ÛËÀ{–MÝüªaúJˆ~4§»ÓÏjˆÀê¼z-0 'ëB ÏÿäÑß…×BôŽs`5v”€)©ÓÊËËkÆ\?æ~¨»U÷”ZÛÓÛªÁ öÃhƒ8=Q†ÖéµýŒÙ‹³#/5¥;qúÈù»««t¡OM$\‰‘kéD¾ì~÷ØË½ •P|µ+}Vöi/éùIöüø¸è>òÉ ýñT ú¼¼Á°S}õÒ;ˆaú¿ÿ›¯Nî3›N­Wƒð£´}qŸ Î_!LÆùQp~¦/»ÓžâÔcÔÁû“OÃÓ£ Ñ.{J@ƒŽË÷—s†÷Ó ÎŽt‚e¹iÁÈÌ’º[í»"H7”]¸~Š«À´Ô~Whº¸_{g}•h^GþNÇeLKçï\]òbåU·ã—]蹡[ú[mxæè¼®ô]äÃ8ˆ~|œo“þ3 Õ—Ò+]åOâôÃû8ÎG÷uò³ØHõ¾øûo†Yö0¾ã0j ŸåÕø|ñD²JH¾Û_¦¯v¸ÏOýÝa¦êÇÑ}z`õRˆþ‹Ož*DË”!9h’%à égºlé¦RÀÜl+gH¡jWi±©.\p–]% -ÊF.T¢UzŽÍè°áÕ%SCŒžrœV~Ðà Nï«óÐ¥ ýž—{¾&Âôù0 _ùfP¯àOúÔ—ß8®üêI×ù2\v¢/n?ÓSö£ð}œ=ù‹/bwúo©Vó•ù¸}6JÁW»Ø_¦ÏŠçœe3Âñà »Ó‡pfwú,©–ïãÇ¿ Ÿ>ùZ!Úç¡Ð4eÇK’9K:1ü£xòsÏeKÁ˜ËR¸"H •]èA.Îw|È€öé+A«ÜéÂ9‹x/ûš/gIçw>¨Kú8Ä/? ÅûJ0 ÒÇ Ï Ïâz¿—aù¼ ûջÖgåü¸ò½aê>u¯7°/ï'+÷•ûIçÿ6†é?{vºõ{>~NyV~£LÃOwÔ?7L_v›¯üzù´ò©D~6ú0À¬îô'ß·ˆK”ôŸüôH!ÚiO h¨m%ào—-…yÙU.ÞŒûXwúæ›êBïMD.²ß3;Tڤ̅} ­ÒëÊ1š—š t>P? ¿c‘`Þnuìïµá™³é@z,Ï'–¾S†çó2sž:ÏÃôyå÷ò²S}ñ»ÃÎôÕ0ýqùÍŸýç/³¯_Ì~’Y¸õÇÏÂÌ@û™aú¬ò· Їq‡ùlúïŸêN?¨ÏB¨.…èÿÛŸ|ªíµ§4‘É\Rõ²¥ëÊ×¶Š®Ãp‘Ôþ@g«f*?ñqÐ…žËÑ€6ÛÎ…´ÉFGþÎ=Ë-—4 ԺЌ(]½8÷ gº¤ßó’/Ø0* ûlaÏ&:ѺӇ0Œ¸Ot²? Õ‡"82å•0}^y¬8ý*ýŸ> ϾzQm€ªO£xœ2žM6“=Õ0;LŸUþ–Ñ®<ïlêï¯v§/þ™M<z`‘„è[ï¡î4ܶpI£NÉé„©rÀÕ”û ;*Á%¥7¢Òq»>ÄÔ éƒå‰ï«W =­å\Hëô:´Üîy¹¹‚»¡hFt§8m´é‹Ïf:G¿ü2ç½èY¸NéË ÏC/û|êJÆñj0>+ãõ'ùòã"J>üùÉ?óSaúP†éÃèwª!ûlôóôïW1LÿÓ?ýlvgúl’/cñ•¼û¬ç~*L_íb_IÏçS÷‘MþãÌîôåŸ$PÌ}'ì* ?6O˰î*\E:QzÐ…+°;Æ\®èí8 |ˆ©¾Ò›£éª-ñË‚7¹Ýèè‚à\H[Üíй‰m/7×®îûnœ~\^mr»©¡úò|×NÙ4âG¡8G Ks«ƒó®—}þN…é³aÚ|ü³|˜ˆãNò£ï§0}úGÙyþ¸°Ï+aúáÃ0}úyVéLÿêåq¦ÿU%L_}nï‡éø¼Ì»W¿N‡éGÁûá³ñïæ•ŸMt§Ÿ¨E¸t ^¨¸.!úN8Š!ä=e v”€+J'„?,O÷•.G'6n0æúSͤ+”ݸ~Š«¶À•÷Áu£ íœ iŽ,·qöÈËÍ ¤f é|Þ0T¿Svv_«ã“MÏ+w,¯Ž™Æít¾ëÝ i+Ò¹ }:ñÉÃE†ÛÃTÂ>Åè‹ày%LŸþ}\ÞfÔ¥¾üÙ0LÒ•¾¦O¿t<êV_8 ÓÿI¦ŸJ¦ÃîåWY6J±OáO…鳉Ù8L&óùy˜º]õö•Úœ¨ª®Cˆ¾3ö”€–›oÇÙ•àÒIÔ¨ßSO9àRv‚ó¡\1Õ@%@ÿqЋëÓ€.Ù Î…´E¯cË-ÌCz%…ÒSg÷/ãy¥A¬ï¯ªc}Ùq~œ¤ç§Cq®ë¶—ŒUËòS­ÄÛ/ å`Á¼¨™Éïlü³JJù©óñF ï+-96ï‡â$ÜDú@Ævw•Îs·CÑ‘Œ¹ÍYo×Cqiwáyæá~ùaVÛ@šàQ\^{ÊÀœÇo³ÚnYî°ý±ˆu³ ËíAБ›åx§Ã8í—óAùýÁu¯fWi~´^Nåü®rSw] Ò§ôc/ÿ‚ªlêù8R>üY /»½—ß»L˜~ø³4݆ð³ñAû|ôûéþîüËß ¿ûøíÑSšìŸŸ¢Þ>vÎÏ*ø0î®? ñçùd€~üÓ0ÄÿðòúNw¨wäM] Ò,OêBŸºÑÓ O≋ue eÇçÁIaæ4F†"l¸wÝ“¼`Ì…Kv¶Þ1æ.d]íÅY?Ð3ßuv½«ë«U# 2²ˆ±ÀÛªÍ"HíóX×BÑñ˜†ÏÄus­CËm: µÚ>žó³õà|3-q«‹tÜÀ„âS5,Ú0€>ŒœçÕo—ß-¿w|œŸäÉóâé6ÇÃß?.æÃŸ¥)ÝþdžO>Îè&åïüí_|>ÿäiñý©§7ìh†íÃd¾lžôåwʆ÷“·+>P ØWï£Û¦ß;õ²qˆ¾ž?ù@@9M”³2UŸ_N‡ì€v{õò8üä>¢ï–]% …¶•€9I'kÓ å%JוŒ¹,LºÜr ¥~Y^޹§$7W^Þz¿ü(Ñ3_>ô@ç”ûÀT¢ñnwì\ï^(> uqïœIˆžÖèdGúÄ'¸¼`ÍHuû¶Oü¼LOt¦v¤Þ0Kß«ü^Ùm~Ø•~øƒlx_£lzÙ¾üù?ûï;üÿ—ß|ž¡Ú•¾l7?œÿ9 ¯§ÎôùtWùá}TâõÃîô‰û©nõg®yWìR_ý[fÕVAGz€Å: Ñ?ú»ðôè…btËï— †¶Ÿ§åÚÉ6!uJÙ ºÔ_g½ÜãK¯¦i-\¾»Lz£gP~½§´ŽÄ×`_e¹´ÚãrÌÝ5æ^y¼í—Óma:e3雹¯#0  ¼mÚ,:ÒcûÃ<¹~¬÷V\?÷ð( Ò—žÃàäôâ®+„é‡ÝOþ{« ÀWÂôE8¾ˆÅß:#LŸ•¡ûQ÷¬Ú1¾XÎ×~ï·Âÿø/7üÚwnUíÕþîã´û¥ÂôS¡úa_üPùÝP¹É:T~gF8¿Ú¡þª¡úNëóOq«š/õ¿þ›ß ÿóÆ?ÿøŸüF%DN§Û˯G âÃ8LrïùT~”Ãχ=éÃyÝég=äì‚åçöZ¡z‹' &H° qî/¾ÿÓ£“ŽôtNçôþø|?x3ƒå…êC‡ƒÜ•çæŠ×=a[c.íg=£.ˆ½ <Ïr=ŽëÝ†íž } 2²ˆ±ÀÛ£Í"Híó\Óq؇*Ñhk6å8`¹nuüïß±,ÎÌ|÷0ôÂd¸<¯tsOÿ=·rÏËçÃÛ¾.édžWn“Ot†Ï'î; /¾}þÛŸ|>ÿäiåÉŽžà©¿a:[?œòlêÖ£À}6 Ó‡2D_ýÐ@^i€?ë¾gÕl4…É¿·øq6šÎ|-BõC“P© ýà_ÿ,üì/¿¢ï¦#!z:`K X’ÔÅçíPtäþ2Šã´U[-]ý!5•ˆÓ þóã8ý ¬>Lýf(ÞÈL¯Å^Ù-ÅÛVV´žÒÁåÕhÚ>殥1­wâ·~\Ž»BôØÇ€%*ß_9R‰FÛèàß¼c¹XžNw¤OÒ›t¡8™Ï¢²iía¯öÑÏÏéL?Œ¥Ÿt™O]çÓn¿eãý¼Ò¹~âþ²éç“…ßýï+üÿçß ¿ö¬òDÂDâ|„¯v¦?>™—qùܯüêäßyvwúâ~Gmì'BîÕ§0NâOßy~n±¯Ú©ÞÇá™'éæ8¶Å.ô)@O§uê’•túø|7gX•ôÆÄ~9 âØ»ßàõi-o0õÊ©IÝÇŸÄ);ºÔsi½GÃq·Écn¹N­O»ó¬Zç:6ž³~¦ãi¶}ИŒÞ mé±ýaÞëãNœ½«Í×ÏÌr À¢ÒÝo>²(,xA»A˜>ÍNBòg„éOnr«r?î÷e¨>ÆîÙ¨~µü¯ÿæwÂù»áŸüî?š|råíª9öêêR<Ýaú©PýD˜>Ÿ.J>™“?/P?| Õ Ô3o‚ô7wôÙ³“«è<ÿæ•bðûñá2Ðãóµ8KËúmÕ FÇiPêî.Ûiê…"Ä™¦;mØ Eç%úÅ-7c.5sÓþÀ~š×q?¸¼ŠÉzeÌm˸‹ãȶnó¶ƒ }Ó2²ˆ±À[ Í"Hí‹8Žû±J4ÚMÿþ5–Ûµà=€¥è|¾Üð¤ŽÝ‹^Øn¦©ø´¸žÌã·R˜>? ÙW:ϧ°|¥#}vFwú,êC™M¿ý/þq¸óýgá×~­òD+újWúÉç?Ùwþ¬$ú8cº;ýÄ Ê¯'2÷•›L<¡™týP}V¹½±›¤¸¾œO]è?}òµbè"H׎Ϸƒ õ—Þƒ8NÍ“¹í+ÝåC9_«Ìïu¤Þ;A Þ˜K—=šk÷5æ–ëÆz(‚òI¯2Oã®Nó4«šÙÞ5~Üddc7>mË,wØþØÙ°&{'®£»ŽgXAúb£Ó³-KX஦/o¦Ÿì<_„éOÂõÙøFÝëËnöé£Îõ•ÿŽÛÚ‡ð_»þ÷ÿóíð{ÿÓ7¢ÝlØ¡>Lçå‹0ýè»g†é«‘ûâβòùMö¢ÏgÞÕ•ºÔWŸüŒà¬u_wzæAàšãX ÐòÓ£ðúå±b0Ô¹à ZäI(:%ýlýŒŸ­aÍi)P¿ÕÅ7ÌŒ¹0—1wÆJš%ýL‡7Ú².løðÙĶn;ž4 #‹ ¼íÙ,‚ôØþ`¿Vn®±Ü®]éî–„P¾w¤«1îÒÆÚóPÉ’CåÇÇ•ÛåãðÇùøûÃ|øqy›“ßþü8Ý]>zò{1¯öêÕqøù_}~òï> _ñüÂç]ýWVùHÀ0tŸUo˜?00úªò¯Vãä®Ê.úÙèsÃg<ºå° ÿ©?~ô´²ñ4u›¢cÿéþ©Ç8+¤ÌÍçŸ< ò¯ž„Ÿýå—BôT=¢§£úJ@K¤pò½s¦·Ïù™ýiéÍ¢ã›GƒòrÜsá*cî»üÜÒ´Å–=Ì´§Öëâ]ßíxùK~ÌFg κÂEaúa`þäÛùT˜¾ §ä|>zœ¼üÙøvÃ<ýÉ|"P?ì?Õ?ö:ü×?þôdúöëãNðg4œ†à³agúôÿtWÕûùôß;ŒÓ½ÆÏŠG)/›èÐ_íJ_iÞf`~ü gêg¾V•M˜ãéáóð“?ú$ü—ÿð‹ðü›W ´m% ‹ÊÕ¡>=ûÊ¿«]éÇ7š¸M6ŽÐ‡‰Odþôùè÷Ò·FŸ¨ÔfV >3õ•ŽüÃïåS/Êt`>¿è.4 Ðÿ§õ$üì/¿<ù7œ#u„ÝQº.žÞ޳Ç*\àvœ>Œo¤í*ÅÆÜc.@c=)÷€sÄýæApU¾&[ëøßß·,† ýäÓAœ=P‰å¹l˜~t»2EžþQv¢…äóÑ—7©v§†íG÷; Ô—üêÓ9ùÙqùX•p}š~ùóØ¡~ÿçáàÏÇê«ñó,ŸÑ•> aú†ãýðÛSŸHA÷êß^v§ŸÔWîó¼@}qƒÓÝé³é0ý9t¥€« çšvË+fN —÷v Óâ´¦Æ\ã7p†}%h¬^—ÿøøÞaZvY æOþ´m%X®óÂôEœ>Ÿ¼]™†ÄÓ÷OéÃðzÙi~¸¯v§Ï‡Ýå§õùø‹aÖ>?‰p¡ÏÇáúყõöè““@ýá?|†±ø<Çâ‹»©Ð'’í“Á÷ê ª}ê‡øQ·ýPÉćËêǘ_x]éàÆ>ÿäiøoò©=×µ£P(;} À%ÝÓ~ Ó¯+ŵÇÜû*Ð(”a àrö”€ë+Àü ÒOÑ•~5ÎÌggÙ©îôÕ†íßäÃT}ÙY~tÛa8~xû|ôk£ŽôÕ@ýqåw†¡úaûáC„¬Úé=?™R‡úŸþégáÏöÿ.vý2<ûêy(ã÷ü•?%Lî‡qúòS£Z„Êß2ìN?úÖ°>•@ýÌ"O…éu¥€›IAùOŸ|}žÿÿïÃù¿8ù·=×ð <&ƶãôD€KJaúÔ™~C)®eǘ ÐO‚æPpUûJÐX½® |Q# €9¤Ÿm[ –ofÖ¼ ?Õ™þäE˜}sæÈó|œ¦?>¨ÏO~žW¢¨e ~ø{ÙÔïç“OoüPyxþìuø‡šûÏÿß¿?ù(…ê¿_ÆNõùtö|êoÍ&¾Îfß ¬Å¬û©~»úœfÖù’/†®ôp¾§‡ÏÃ'?= ?ù£OÂÿÃó)DŸÂó¯…çq,sO ]V€«¹ŠÎôJaÌh±~9n—T‘5 Év,Ãó%HöN“®ô+03>ìšf‡éóJ§ùafþ$^éN_ ÔãxF ¾ ÌÏ ÕWž`^Âdp?+Ã÷ß>{þáàë“Nõ?þ_~úŸ>;é\ÿ<~æß~Æ÷²ûaúQÁB%¤Ÿnç“ÿ®ÖWWz8×óo^Mtü›Ÿ‡ÿ2}öLq˜Ýèáìãôý8û@%€+¦7æ´Ùåx \}éfÚP‚Q#Œ-•˜Aú³mÇéHV㬦çE|{¦ŸÝ>ŒîÙèël˜#åÃŒ@}>¾ß¼üþøÁ*?ËÏ~²Õ@ÿpz;Ó~ù‹oÂÁŸ}þìßþ<üÙG?ƒw)XÿÍÑóqøÿÔ=Mýñ•®ôÙ5k8ãžÏ¼ƒ3»Ò@Tƒóò¯žœLºÎ³„càüuD—à*R˜~/†éה˜ Ð"O?À ” ‘n+A!†é÷âì‘J̇ ýÙœƒP\ …ÉÏMmçgv§…éø[ýIpþxŠ?®$ÝG·+ƒóÇù8@?Ô‡©NõùDP~ÖT• çäÙI0ïó¢ÿ›Á/ÃOþÝ߇?ý_ÿ6ü—ÿø‹ðó¿ú2|÷/¾y}¹M}±´®ô¹H=íóôðyøä§Gá/ÿÃ/NçÓ¶L7z¸ø8ý0Îú*\ÑPt¦_SŠ+¹›*PKýrœ®g ÍÏñ­«ÂøØ0h 0Y.{ÞÆw-΂O´­v!=§õzÑu>›¼Ý0,ž óåÅ-N~žBîY/÷E§úlê²áF÷•ý|¦Âègþ•ŸŸÛ-~âÓ?ýgÿøäyþ“ö›'ßûµ_¿~ëŸþÆÄýÜþç¿YyÒg„øC5t_tµvìýBù<óAûê8qêþ.pôÙ3 qýÎ÷Ûá7~ý;KÜøÒ1ÔÍo¯ý£ð__þg7ÓÕ`R0þ¼ï¥®òO^Ø^Q¿/H—>V߉³wU¸¢‡q[»© Ws·ãì}•¨âölKlËZîQ\Î{ÊÀœÇ¡ˆf¹Çm˶?XG™á¸®î+Ãh9NLJ?P €›¤¿xƒ“М`«ÃšûÓ3oWê‹à|(ƒóÉÉ¿fêÓϲ2|_¹û¬ò;CùÄ#Ÿý<¯²šåàû0О«:/WàñýŸ Òçµ™^×Ó?ó·¾þÑo}çÔ÷¿ú峉?nÔˆ?ä!;÷¹[N˜Ÿµßû­Sß{õâuøÕT@Z u£ï+\éX}gwU¸¢V„1Œ¹õ8nÇ6”áÊÛ±´í÷>_³2²ˆ±À»˜ŽÝ,wØþ0½ŽîÇÙ=•hAzË2ÀÜÝR‚ó•hOTbõÎ i[͇|æíNré'ðòVùð{Å?Žóñ G÷RÞhúwN:Ú¿ŸÏ•§ÛOMãgwÖß–ï·¼“Y!ú3 rV7ú™©þñ¯<ÿæÕIh>MG•éRu€;üô›S“=-”.§²¥ pe}%®áýøÆRO®l3¸L4@ŽíÀü(A#õ”à”-%¸AúËÙV‚z˜êžøæ8L_ýöI,}¨ÏÏ ÔOþNp?‡ê‡W¦ãó“ß+¦ÑíË;v´¯N¡r›éðü©ýŒý¨Ç|%Ä?;ç>ù¡‚|Fè~òÖ™… `5vâ‡w•®&®7ƒ8{O%€kØaú5e¸Ò˜{¼!°jÛå>00ö¯i…òXñ¾J\Ÿ ýå68»qöH%êa:$?aFwú|˜š—ÔGÇÇùøþË—¡ùYêO:®„ì§÷a*Õ™ýÂ@ýq>îPŸõéùðîŠß…ê‡÷—nÊnõ¡Þ£ýYSfóÃÙÓÉŸs¶&þ³Q÷ûÓuÈOôišG7úÉý•[žùI®`K7z¸±~(>”pïÆ®ô=e¸ú¾Kœž(ÀR=)÷y€ù:P‚Fê)Á™Ò±£÷K®Aþ’bÀe?èºT;gv§/¿Y¿óÓ·='P\íP? ÏO‡êËïšÐçS!óJçùãs¦3;Ï—Áùá4ñó|Æßs £ýÌýø¦S_\±ý9¯—ö¤ìì ÜìXý0Î6U¸Ûac.@lú6Ì_ÜÏ>PZ¸Lo«ÀÕ Ò_MÚØøäV â.»Ó_6P¦õÕ.õ'ßO¡újãûònN‚õÇãÐûèÊ)»Ä4|ÐY]é§î.ŒÃóE€~ºÓ!úQH¾Z·ët£Ï2 ÀÍm)ÌGùÁ÷û*\ÑØ•Þöøêcî ÎÞS €¥x¯w€Åx¤´I<†Ü‰³‡*p5‚ôWÛØÄÙŽJÔÓEÝ鯨ŸÕ¥>”¡úQ·ùJ¨~ô£»ÌË© ÚOMÕ üÄ÷òÙS(ŸS5<ú6ãÇ>™¬œò‰NôÃhü5ºÑk=pSâ±Åž2À\×·ƒ7=€«ÛŽaú5e¸ò˜»\¹`Ñ–ã-ckJp¡~Ð(àJ鯨|sþ‰JÔ×¼õyy“q—úq¨þ$PŸOvªOáõQWú“»FØÇ›Òêy%h?Ý~:0?ü½lô¼ÆS~jèËç7Y|xïáTˆ~F©Æ¿Qù#Î)-—²¥°›Ž×+ºm»|£ý™Çʰi|í+,ܾ4Î]%8_Ì6†âý.IþzúJP× Ôçy˜øÅa—úÉPý¸K}µSý¸ûûé€ûìýìi:0_üÞŒÐü”“ß>3@Âd?ýáß4º‰nô‹÷ žÀ(ÌŸ“ÃÀ5méJí1·t·˜·4®öËq®,SîÇÙ}•¸AúëolªD3\%PŸŸÓ¥~ôåŒ.õ§‚õ•i²/}y?)?œò ¦“;žý·î»|¬‰tf€~tŸÃ¯³S®nôó•[Ê =^ÄÙ;*\AêJ¿© ×sû*0W[>| Kcߛ֊ǖÛqöH%.&H}ý ãR£\¨Ã,ùé@ýôïåAù|f°>ÞWžŸ ×OÞY˜ÝŸúþŒÛMçgÝàÂýðßeúïÌ«7Ì2‰y€›ÛÖU/®g»qö@%€«l£•àÚcî^ÐÝ `^>(÷e€å8TZn3È7\HþšÊ̶J4Ï™úŠa þR¡ú£?3X?y/yå~gMy~F[û ¦ah~:Än€¾üCgÿMy¥áÌ‚ÉÖ\Ú£x ±£ °´cö~œ=V à’î|ÿ{?ì)õÇÜíàê7õ0ާ[ÊKu¨ÍÏã­©Âå”ùÆM•8Ÿ ýÍ66;Á%Pë2úä¼Pýè³îwj:®Ÿß4ñÕìLéÏ ÐçeûìõàÒ¶”–®§'Ê\R_ n\?`¸žÇ¶C°|1÷5P…FÚP‚+-çûqöžJœMþæúÁ%Pí²údªŸÕ¥þ¢û¸¨É|žŸ§~vÆ4î"N…çÏú{gè³ÌÂ08 ËWé´â˜¸ŒM%0æ¬@7ûå8 sW6 ~ ³ Òß|CsgÛ*Ñ|× Ô#賃õÞ_5?œÂxšÈOülêç3ƒóSáù+u ?çÉëFpiO/ÀJÙÁ!€Ë¹/ ½© 7sBq5.¯çƒ×,ÁVpEI€™éç üÔÖ#•h‡K‡àKãz~êÓ÷wj eöýTB>\íÁ+Ó…í+ÿ»ÎC Ñ\‰Î‚°úcöÝಥÀål*ÁÇÜAœ½£—òŽ=¬Ü%  \Qàl‚ôóÓ·¡iŸ«ê“Ó]ãó™ÿ;ëqæ1ºï}ýðypiÄ“Rûʫ粥À%õ”`.cînœÝW € w•Vî@ è W”˜M~¾šm•h§«v©¯šÑ4þŒxýÅûsŸã9÷q:ཿ€K{âøjwÜÞ®&œïÎ÷¿÷Ãue˜Ë˜›öƒ|€ `¶qœÜR–Í%N¤Ÿï†f'xS¾õn*Ïg‡ëg…Üó+üoè¢û\êß Ð]ýò‰@½lÆé±2çè)Á|”`2æLz\ް®( 0I~þ6ãt¤ íwí.õ$Û³¼œÂõ¦yþm\ËñÔ¾2@ý”pé9nα¡s•Æ\az€Âãà[Ô€+JŒ ÒÏ#sg}•è–j¨þÆôy&â¯ùwpm)±­ Pûãö^¦fÛP‚…Œ¹OTè¸4ö\¹ €ºpEI€‚ ýb62{qöJt×t°¾Îáô&æ Óm%D@#¹¢$ÐE‚ôËÙÀÆY?ø´´Éø¯¿­ Ъã÷tì.Lô”`)cîn¦ÚGˆ€FsÞèAúåm`¡ÓÍ÷Øþ=´öø=­ÛÂôËswƒ7å€ö¢ œ·ºD~¹˜½8»¯ÐhéJSýòÊS@;ßûA˜`Ycînð¦Ð|Bô´Šóv@WÒ/³gU«_^q h÷ñ{?Ó,kÌÝ Þ”šKˆ€VrÞèAúÕèÇé±2@ãÜ/¯4t€0=ÀRÇÜÝàM9 y„èh5ç퀶¤_ÍÆå0Î6ãt¤ÐÊ+LÝ:†ïaz€e¹»Á›r@sÑÐ ÎÛm&H¿ºËAœõT!]QjK ³Çðý8»¯Kswƒ7å€ú¢ Sœ·ÚJ~µ— ÔÞ“8õÊ+KÝ=†ßv °´1w·s]Ѩ›4. ÑÐIåñðÁy; Eéë±qÑÕê)Ú¢*ÇðÂôËs{Á›r@½Ž{BôtY<.ÞÎÛ-"H_Ëvœ=P ¨^y%)€á1ün¦‡¶;T‚ÚŒ¹i?¬¼)¬Þ‘ãC(8o´‰ }}6.ý8{¤PïIgÃï—.…6³ý¯×˜›^^œž¨°"iü¢€ŠÊy»Çª4™ }½lÚ°@-¼SefréR€¥Ž¹ƒ8ÛÎË—Æ !z8M˜hAúzmXmX`åÞ¢.y?p­t µsË1×U=eIãM¯h®Ø§rÞî¡jM$H_Ï ËfÐÑVáAÜ'ßQà Çñƒ Lms µsã”ÆÜª,áØPˆ¾¼†öÅ€+ÏÛmç퀤¯ç†å ¸<<,[ Jô•¸Æqüayï1´ÃÔ~ÜMûl÷UXûŽ àêÊãé÷ThAúúnTA˜–Eˆ¸éqüa9ŽÓCó×çUhÄë´gï¨0Géý˜wÊñè†À|•Wÿ~'È= !H_ïJÚYë©,”=0Ïcù4žvBs=R‚F¹»qöÝàM9àæÒ8Ò+ÇÚç‰4ÊKt¨¶Ì_y|Ý ÎÛ H_ÿÊ xEˆXıünœ½œ †&:P‚ƹƒ8ÛˆÓcÕ®)åx‚m;^3,Wx½æÅ8,wÀ¸šd£^«tœ½œ·jN¾•Ý Ló&D,òX~?ÝVœ †f(A#Ç܃rÌ}¨ÀU Cщþ@)Z½ Y¼f€ñ ¯Ë4PXè1Ùaœ6Êão€Z¤oÎFe7ÎÞS ˜ !z`Çòƒ Ø M³¯sÓ›r›ñËûª\Òýt\˜Æ¥h=WŠjë$öóíÛ·åõ2žy½ðÚ3” ±Û÷~ÐH¨)AúfmPv‚OgÀM ÑË<–ì„æ8*?C³ÇÝí8{+MçŒ÷qz£/èÛ÷fm˽^,¡4j;mûƒ× ¯=¶éíÜ×ß³ïÆé‰ju"Hß¼ J?ÓÀu Ñ«:žß‚PwûJК1w/Wy¬À”4.l´¨Ó-—3P‚F­£`ðZù[ðz±4媜³µ®²¼u.½†Á•|¤o楄é઄èUÏïÁN¨³=%hÕ˜;(Ç\çQÑ1aâøp ã5÷ZÁ@ ¼VÆ4ÎqT†©1öàµb *Wò}O5€:¤o —%DÔåx~;¡®ö” ucîa¹øNÐ]º,­ÿï¤ñ@@ª³JàµÂ~aœ=Q ãÀ’—;cšåË^+ÎßVîÄÙwí§«&HßìI?xã.òž=P³ãyÁN¨ŸG•­wwƒ+‚@W¥õ¾WŽtw;°¯ áµb‘JàuZű¦—ÔöËssä c­<^KÛþ8=T `U雿1éÇÙ}•€™Þ)»Ôñ˜~7vB]ì*AëÇÜApEèš´¾÷tƒ¥$ÈØŒíõ¾*°@–¯ú;jávÛrçu¢3XWYíq@j>´4VD¾“írCÒI–7tpL?E°óÕ€•î7ì)C'Æ\WîŒëo¥õÝÕF¨ØW‚ÚóaŒìû›Xѱ¢×É2pgOT˜ÊÊ×ÅÝPt§wl,• }»6$ÂôPœìì9ù 4è˜>;·â—oÁNX…=AËλ»¡xSÎA }Ò›íq=ßS ¦·÷Jà5¢óû€ƒ $iXþr·œë©»‡J€}¯µÚvÄ©¿|Ï6XAúvmHvãì :,…¡6Zx ` Çõ{q¶t[eÛQ‚N޹éM¹øå}Õ€Öx/½Ù^v“„éq¼Vw{JÀì+×Çß…íÖÕFzìX¯sÇp;Awz`IéÛ·I;v½àÓôtσ†ÒQhøqý¡n+°T|¯óãîvœ}7èNM–Ößï–o²Ãyö” ¾ë±`Æã@‹ÇËׇfœHË‚ó±õµ«\/u§–B¾‘Apibº%uì+ТcûÇö°ÛJ@y>µ§Tç~ùêRp »Jൡóû}{AË8°|–»úz¨13ÖW¼6Ôon'ï—¨nXör7plQ+>œÉYëj?Î>T‰Úx×ÕueXú1S/Nå<ÕÿÎî:]eE°~÷&W-÷íÒqÞ¯(p‚ôÝÜøí'hžtr;uÜS €“cüÍòßÉa¸š·ìOp1w=ø¬ÂƒP„è•‚9é«D-èFÏ*Ç‚´ìé^jXörwœÇ©Á\.ZWÓòñ¾J¬œ½,n_‹³ÍrªË¹®'¡h|íP½fÀ5=¤ïî±|Ú€¼Äi3ž89P €‰ãûµ8Û ÞØËz÷'6•Œ»½ Ã,ëpKÀ–Žçi,×tjµt£§ûuºÒ–½ÜõƒœÆª ær™uu-΂0îªùÐËü—ëÍP¯ðü™ûqÚ¾Î9Ê{&[Öaà²cŽ }·7¡ø$—7}¨³≒-e8÷=ÁNÝôàl©«Ñ†7˙Ӹ»¼!‹‚M)@¿«,aÿYWúÕÒž:ŒûŽ£+XÆ* ærÙu5óÿ@%VæI\WוanÇ>iÜÛ Í;uÓ@ýNðjàcÍ-5è®ò2(qz¨ÔP P¼!Dp©cüƒ²‹Û[¡ §÷+6…è™ã¸»gëqz 07„¢;è®R°Œýç8»¯+óPˆžšØVãÀ ô½ü+“Ιí(—Ü_Ü Î³®Ò–ÜLºúNù¡Áôâ&ob3ˆôÇÒßQ6 ¾Ê:|§´Íýýàüpén<ÓˆORPéÞ}a7€kço’¡êÁL8æn„"Œ¡›)\ÿøo« 6Ã2Çïµ8]—-}ÀqÃ:OÆ‚´÷®J–¼ÜíÅÙ›…¥{+.w{ÊÀÖÕ^œ}¤K÷¨lÃõ—ÛíÐÎóTéøÛ×yÿ¸Ò™_‡zàÔvGžêc#ÎÒAƒ†¬Jze»ìôÀÍŽó×BqbX €®sÙv–5îöâl78¿ —uíK´ÃÇîÍ8û‘J,Õ{ÎûPÃcçƒàƒèŽÑ–»Ü­‡âÃ\–»åIWAØT®±¾î|Y&º¼Ù¶%m_ßîÀ2Ò¿î£Ê:m…â 1¶ÃÀÉ~¢ =³N쟾`ùRˆ¢ïäÀÜõ׃N+t׃ò¾°Ìq·_Ž»õ0Û“Pt ßS j2n§eQ8j9t¥®ãÀfð¡šeyÇ e8Yî¶âì*±)t¹î ¸\s]] >pµL>tyýmÊvÇ–Ó]ݼ\··‚+ûñƒ¾‚ôœw²`׆€%Ð…`9Çú½ÐÞKºÂ,Bô¬zÜÝ Ý{Îó¤<öÛU j6^¯…¢+°@-–#u ÒöÉÐ?ôâ80PŠÑr·|˜kÞp$n¸®öâì#•X8Wޏú²¹Š|_WÏù§ó ›7Ý·Ð:ïþ-5`–²LÚØ>T (u¡ß¢Xʱþ~Ùýñrü…6¢§ãnÚÇ]ÓýP„† «ÒÛïÄub]ˆžšŽ×‡q¶© ·)DOÍmÅé±2,¶ÆBô§ôË}%ç¾=sØ_LËÐ*±PË1‘K*›ä¦íj—ç¤àûËf7YÇwÓ9‹P¼w"+ ¤#=—Ýð]èV¼ß :ÔÓN.MÇܵàrÑtô4m¬NcôTÂþ6âlßþÚBø°óùËÝUb!t·fÞëkÚF8—:®Xrõe1í[¿«‹Ù×(;ý÷ËI—zh¿wé¹ìb-az—à¦Ò'ùûºÔ昿êi‡ô¦Û–À&5s×BÑõ8»Þˆ£­èiò8–Û·Ub®„giÚ8öÕ~¤sõ8ŽÊpîr—ÆÉUb¾Ë](‚¹‡JÁœéŽççî­¸®î)Ã¥—ÁtÌ"¿·¤±¿Ü7ì«9xT®›Û¶ô† =×Ù8¤•ާ𸪦軌*@mù{¡8!,8DS÷36u®¢aãns·ƒ7Whô¦áŽ-ŸÓþÄ]•˜ €iò~šPó|3_~¹Û º ÏóÁ†åŽ­«ÁÕKæé¾ô²·V.{ŽUV°ïQÖ¿_N^’ÔØ'_é\ØAy%ƒ•¥‘é¹ö†aÛAWp¿<ˆì4¿©£r(…åÎrGËÖÕ L?BôŽQy,R¾‡²Š÷P4Èèžtloº‘„ã6ÚïÒs“B/Îvl¤8G ¶m¥Oa+@ãŽû×Bq2¸œ ¦žÒ›ã}iѸ»Š@½à MƒwCÙuK9hé¾ð~ðØu ÑÓ–±`×¾Ùö„™-w–;Ú¼®nÆÙTâڄ蛴☤ü`M?Õ·]Ê<ì…"@h®]âkš Ò3 ÂV(ÞàñIK†Ò¥Sû:´æØ¿Š“Áº%SºÐÓæ1w­s·‚7ਟôFôN8çChÙx¼V®êQœ6´h,Ø 1W%Ìl¹[…'åöÇrÇ2×Õ~y|$/u5BôŽI–e©ð-›dl†â¼ž×¬ùû³iÝÛ —<_ÿCÛƒf¾Öñõ]¤gžîs4â´6v” •Çÿa|ÉR'YÖ£kãnoûqzS5X±tÙê]ã/‡×‚àʕƊ8Nô•Ž»Áûà—%Do¹[WBa•ëêF¹¿è\éåÑ_mùÚ Î Ýx—¹Kn¦íSð~J“ö'Òx¾wÕó_å¶àÇJØHâëݤg;ˆ;A‡:€®9*÷wœ¬èÄñÿZ(Nþn¡"–#è·½ÑF‡ÇÝõPêÓ¤K=Ë¢û<aú+¢§ícAÚ&¾«·é>ßå. Ó_¼Ï*DϪ×Õ LBôö=:{¬R޽Êd¼¨Ç¾ëþpŠËÈõµ“éYè࿊ìÞÔh¿Ô™pû&—4úÀF‡;üeÞèáô¸Û+ÇÜMã. >$ÆÜ]!8˜{×ÊuC7ÈÙ„èéÊX–óUb&aæÅ-wÛqö¾JXî¨ýºº„éÏ;ÎLW˜ÜSŠK/O›qö#•˜«÷êtEõ©`}úZÆrñÅiPŽÕƒyfâëyà5l¬ûqYؤg'vì(´’=Óç6Cî0â¦Nº ÐùcîZ(Âô›Æ]n(…öBÑy~O9àܱw'è27MgQºxÜ›–yï= E@òP)¶ÜõƒÜÅ4⢮ÇéûÁ•Œ¦7{>¨}¥åh=a_cþü½—Åý¿îåÔ+ç–ëK¡ùƒr],òu/›ž|¤ä%HÏRw·ÊÉÐŽÏ-'½¸à\Àfîäj†AÎݺ¾¡Æ]Zæaè•.=æöƒ0ãpßmÓ~6B¦”,ƒ'ʰ´å.í»évZ³®Â0ãø<-Ÿo«†«F\sJû×÷TbaÇ0ëMY&§ÂõiZ·ÿyJÊ-¤×sPNËÎ0Ä×iטßh'°¤gÙ;‹[A  É¢ÛÞ àç6ƒp'gäã.Ë1üÀÒ¾1n<Ön„n‡hS(jÓU ±ÏÕé dگ軚ÍJ–»ÝïçûMZ_û¡Û¾ü ®«[–„+/7©f?P‰…z—Íͦ}‚^9þ»Ç§OBÑYþÔT‡ãÑrßì ÈÂ6ÙwÓ‡/éYÕ²êšâA(ôJÀÎ l–S/8/ÐUéïý <Ëw{åܸÛ=OÂ88¿§0÷1v;NïvìO×}&Ç‚´µÛ±ý¬Ôp¥ï|ñJ—»­rÔ¥åîa¹Ü9‡@“ÖÕн_úÀËõ——õPtÔvîfñÞjë9’ò8u£ügš¯…qØ~èފLjAåßå4ñuSÆòCSZ¥š+.kYš Ò³ê{+ÔÔ•= Uz¡wº4y»¥ ç^œö9a¥ãîpÌMs—‚n¯G•1w °”±u·û³© }߸3ǵÐ.á)ø”ÎïxÕk±Ü­—Ëݽ,w®~@Ó××íÐl”¼Ül9Ù ®,¸Ìm˺euâ˜ö"ëåtÆÁ÷ µýC5±vÁ{[Mö$.£i¹¤§6'ÒcßÀP‹;qÚ `™Ê7€7CîL“Ý7Ÿb?Œ» Û¯€ú»kSã®s³Íõ¸2æî{#V6¦n…v¤NÎéB— Ò¾ÕNK÷«R8r˱]-—»~(ºÓ·q¹{P.wöoiúºÚûá—Ô@£¯ ý–^œ}¤ËÝÆÄe¶¯ Xo;íQÒë(Hƒ<N<)÷Ãöœ” Ê“Ã鞊4‚ÈÐìqw½2î¦É9Úúœ‡z¥Ûqz»%’«ÂõÆ‚4l…v|°æQ9ì{ek½Ì­…v} ËrG›××^¹¿Ø†ó®T2¿åb?8¾ oØÖ`½í´ûæ‚ôÔyÇ1ä¹d Àb¥Ò;.‹ @Ý•ç 6‚ŽõuQí8/8íw×*cn½1´ºñvPs‚óЈ1t=4;P/@óÙ—Ú Í 6 2[î,w°Øõµgý†k¯n½ãøt.ËB/èj½²íΰ5Xo;é8ì¦/é©û ³^äõƒ7Èæ%àJ;Þ ©ÊsAÀsYÒ›Ùƒ0qÚ‡€n޽嘻aì]رÚp¬Mãì¾ñZ±Ïºšñ>—óE°˜q`-Î6Cs®Êþ°ö½z_îúå6¨ Ë]ú׮厎®¯½ÐœF£®n½˜e }ί¬Î[Îa½í¬ÑU)éiÚ †´óxWE®%àv‡Ÿª€¶©„ëÓÔ‹Sú÷•¹’ô†ØA(óékÝæ+Œ½åØëîåŽÏ*cîà*´~¼ì‡â½®º…¤NÎ(XÆ8ö•¶Ê± N®IÇ;å8`¤}Ë]/¡zËÔÿØz3Ôï0éÖ{Á‡]9Fëj½âíQ\¶×•ëm÷Äu?~-H -?øÅ .ÝÄè¬òÄæz9mÄi-èò8N‡¡o¦ù æ-1ÀœÆÞá¸Û+ÇÝáøÛ¥ý£r^kæÁø˜ÆÂÍrJcä*ÞëzXŽM‹°º±`8¤ù*“é˜p7WÀxE:µÜ —½U-w{åöÇrg¯«•mÄ*Îa>©ì+îyEúZ§ú¾©+÷^\Öw”K®·iF‘æ{×ûá?éiúÀÔõìÞ°JÃîNpÀ9ÊÓF˜ xn”?nzÐ~ØYþ0ÁÍá\€¨Óø›ôÊùz9…ògun¢rTŽ©!Œ»ÊÇÙ KpÅ1q£ 7ÊiÞoÈ?)ǧ4í£ –ãÀúÔ80ïãÑá¾Ë~9ù5Ë^î†Û Ë\ÿø¹WYgç}¼ü¸º¾ú ËRÇáU¢Ò6kÝvŠK¬·ý8ûP%ZáA\çûÃÒÓ¦Ç~9ùÄÐU©›Ø^p)n˜›©°çz‡<“ÞÔÍÓÏÑÑmŠJÛùAå߃ò{›@Çáé±wúßáœqù2Î7GckÉ‘€eŽ}iÿs¸ºV~»úõEãÙ¾}ChÍ>Pußç¼ý ã«ZîªûÍï}X¿¾öÂdS‹Ž‰Ãø|âðëC¡ù•¾†Ûqö¾JÔÆD¨f¬³iÌ=õnþÁåM\‰Bž¶Üm¡z „ç"æÛÂbš²p}oø"笳;qö®J´s}¤§íØzªÚ%]Zn/…„ç"æÙ6ãìG*Q;éʰÞgÆ:Û‹³T¢=âzžUÿ-HO—´µP„êÓ”7—Ùštо§ý¸C¿§Í3l{qö¦JÔÒƒø~|_˜ZgAç6y×óê7ééò× ãP½¨“Ôu~?Œ»Î( @s•`¿T‰Z{Ks;*ëìvœ½¯­òA\Ç·ªß¤‡ñNJ/ŒƒõwTX²Gaœ(@{ÄŒÚVœý@%j-5½ÛÐ쎲QóG*Ñ:ïÄõ{·ú Az˜=®§ b(Bõi~OU€9|ï—Ó î¤ï+ @{ÅLÚ~Ck‚Çñ=ü eèôººgƒ !sýþôeéáòƒcÚ8V';5Àe=*²Ò´ïÓëÝQs¿T‰Æxß×ï+Cg××½8{S%ZçI\¯×§¿)H70ÓJ•¦^9O“€=tx§;N¡ì4Ÿ¾Ž;áe讘3ÛŒ³©D£¼ßïßQ†Î­«[qö•h¥™¤‡Å ¦k¡èZ¿^Néëµòk—û€æ{§ÃPæB˜ßW¦Å<Ùnœ½­óVÌì)CgÖÓ8û±J´Ö;q}Þþ¦ =¬fÀ]E¨>é•óµPî‡_ßU)X‰aWùd¿œBœÄêC%à²b^läÁšè(N=W¢ïÄ:ºЬÈmÕh­ßëòÁô7顃ôF(ÂõCëaįš¾ÝYÒïêŒÏʽxý,‡× QS¿që‡[Ù¯)M>˜>=ã€|ãp|rèÀ€y+º_ªDc ÓwcÝ>ìÒfOâ:¼>ë‚ô¬Ì[ÿ·ÿWþ:¥5õkÙwþ?úÓÿçÿ¢×Cº½8ûH%M˜¾Ýëè^œ½©­öA\·fýà–Ú,Ć4Þí8íÇÀµ×²eâkº„è»`ÿ¬Ò,ƺ´‚0}ËÄ×r+ÎÞV‰ö‹Ýè÷Îú™ =Àbl(AkÓ·D| ûqö•脇çýP.6 Óo*E3•!úU¢3öÏû¡ =ÀbÜS‚ÖIaú•lDˆ¾“öÎû¡ =\͇1˜½« Í DßIÿðÿàà¼ÒÀÕ½Úƒ8­)E} ÑwÖîE7¤€ë¹§ƒÖî)Eý”W ¢ï¦½‹n H×w;NÅÐö¶RÔCºJ@¢[5:éñþñ\t#Az€9‹!Þ Uèœ÷ãë>ðÚ¯|Ý[‹³ý Dße»—¹‘ =ÀœÅnÈU褻qÚaî-¥X¾X÷^œ”¯ݵw™ ÒÀüÜŽÓt§_®òà •õ§»Å2\æ†YžçÊÀªv\l„êí¸C±¯ ×#Céƒ8mÇ,ΡR,d=[ Eò{ªAôN\×v/sCé`qÞÓA |÷•b¾bM7Smƒ=c{—½¡ =Àb€¿ü0èBÏiOb7úý«ü‚ =Àb(x;úÔ¡¾§§¥¤Ä/Š À,;WýAz€Å(—”â•ú¾rLè?Åà<»Wý…,Ïse`U;:6BõöÆU/uÀ$®é(¶wc†ç cëÌzœmáy.ïA\OúWý%éç±p ·ãô~œ>v©ÓZ›ÿàø÷m¦¿5è@ÏÕí^ç—t¤`•;>6Bõ¦#=À ÅŒÌNœ½«ÌÉÃ8í¥)f{[°~¬ÇÙVœ6ãtÇËË5<ŠëBï:¿¨#=Àâì+sôfœ>ŒÓ—e§ú­8m4éHÏ7NÛq„¢û|ú ‰=×µ{Ý_Ô‘€UîÙÕ›Žôs 'Ã…âCiÔ)÷SvïU&¡yæåI\ÖׯûË‚ô¬rÇèCÕ¨µâ´w4Jp}1/³ŠNâ°Lã4ˆÓA(ö‡‹Î•Ù°4õâ´QN‚ó,Ê{q™Þ¹î/ Ò°ŒµrÇh3øDaU?­ºw<”àòb~¦4¤>ž„"\Š ýÐþ%½œª_¯Åé®Ò²D)×¶ól‡×½Azµóß ãð¼¤öíH§æ½4¿ÉŽ@”(ât[5æâ~Ì®mßäé˜çÎþf‡çíôwÇ£P„êu«8CÌ×ìÆÙÛ*pc7îFŸÒp“ûõP„æÓtOEE·ú½8íÆ”rbÖ¦g©Àݸ}"HÀUwè×CœïÇ鮊pŽªßE§ú=åº.foAæà&æÒ>¤à2;ðëAxž›ï¼ìꀋ9œ~œ}¨×6—nô‰ =gí´¯…qxþžŠ0G©Sý^œvâÍr]s9qvG%®lnÝèAz¦wÔ7C [5X‚ÇaÜ©þP9€¶Ó•àÚæÖ>¤ 휯‡¢ó|š|Ú•Uy§½¸£³§@›éJpesíFŸÒt{‡|3ζâtO5¨‘'aÜ¥þ@9€¶Ñ•àÊæÚ>¤èÞNøzÐ}žæH]êS ~_)€6Ñ•àÒRsÖyv£O麳ãÝ ExþmÕ ¡;BÛqÚ›÷ÎÀ*èJpiïÄÜØî¼ïT ;Üiº§´ÀQœvBÑ¥þ@9€&‹Ùžý ×pžÇ1+¶±ˆ;¤hçöZ(Âó[ÁåŸh¯qÚ¨š*æ|zqö‘Jœé˜Û_Ä Ò´kÇz-áù4ÝV:âQ(õûJ4®ôgzsa›‹ºsAz€vìL¯‡"<ßôt—@=Ð8eöçc•˜p§˜;XÔÒ4'z;No«Œ¤@ýnÜÚU   bh'ÎÞU €‘û1¶½È¤hæŽóz ‡‹<‰ÓVÜ™ÚS  Îbh-Îât[5“˜ûZ_ôƒÒ4o‡y;øô)\EêP¿w¬ö•¨«˜ ÚŠ³¨@xcy/Az€fì$¯ÅÙV9ùÔ)\@=Pk1'4ˆ³»*t؃˜ñê/ãn©5@íwŽ·BqÙ¦÷ƒ=ÜĽ8}שý8­+PC[JtØÑ2ÇAéj*}ûq¶§;ª ñ ítÅO/*P17´go«ÐAoÅ<×Þ²L ~;½Pèï©,\úãNšê€:ˆù¡µ8;ˆÓmÕ:äaÌpm.óéê³¼нO“Âò=Ië_ÜÛU `Õb–h3Î~¤@G¤†¨1¿u°Ì¤¨ÇŽïvœmŸ"…U{”ÖŸC6P `•b¦h?Îî©ÐoÅÌÖÞ²T`µ;»½8ÛÓÕ€Zù ê•X…˜-Z³AМh·‡1§µ¹Š¾¥ö«ÙÉÓ^üò£ DuônœâzÚW `b°ô ζUh±£8õWõà:Ò,Y æn•;¸>) Íð(í¬•§KóFûqvO%€z+æ²öVõà:Ò,o‡v£Ü©ýA¢‡&I¢Çõw[)€臢k3@›|°Ê}¢#=À”Ü÷Uïq(ºÓ”X–˜?êÇÙ‡*´DÊaõbëp•OB`±;°q¶§»ª­òAœ¶W½#tGÌ"íÅÙ›*4\ºÂF¯ÍLoy-¶ãºg?BôÐFïÆi×óžRKÒE É¶ê¢Ot¤˜3]è¡sîÇ»me­lú÷‘J õ f­úuy2:ÒÌwGu;èB]ó~\÷å‡h&P÷ãì¾J ô8N[uzB:ÒÌA ЮÇÙ^ ‡®{/°î(°H1¯´g÷Thˆ£8õb¶jP§'¥#=ÀÍwJûq–w!zàé@5NkJ,Ðf(‚©M°U·}¢#=À5•AÙÝ8½©À”t Ú;{J,BÌ/õâì#•j£ÚªãÓ‘àz;¡¡èB/DÌr;N?ŠcÅŽR‹ƒ©ûqv_%€{T×}¢#=ÀÅ`lÔ À%=ŽÓfÜ!

    hJˆ>Ñ‘`†p]‹³½P^!]Nm«I;Ž@ýÅìÓnœ½­À’=ˆY¨~“ž° =ÀéÉP„è侮éS˜[ÊÌKÌ@íÅÙ›*,Éã˜ÚhÚ“¾åu˜ØìÇÙ~¢–çÝtðZ^ `úqz¬ À¤±¦×Ä'®#=@)†X·ãì}•V¸C¹?™y ÀM•MýöãtW5€9ŠÓzÌ<6ñÉ Ò;»qö¶J5رìÅËR7sQ¡ÓßV `Οu¤º¾£¸|ê¨ßæVÜÁÜU ঄éhEÃÐ[^G Ã;ˆëAˆ¨ŸtÐúa£úJÜTtí…"ø pS­Ñ':ÒäS–@C|w8·”¸©˜™êÅÙG*ÜÐwÛ¢Ot¤ººC¸„èú{7ŽY»ÊÜT ¾îÇÙ;*ÜÀ;m Ñ':Ò©ý8ûP%€†y§~Ü =T à&d¨€kJ!úÝ6ýA‚ô€@€fx§ž0=pS²TÀµ.DŸÜòºÙñÛ¶ã4ÜÝ8íÇñlM)€›(±ï¨p ­ Ñ':Ò­C§i[%€–Й˜ é ´6DŸÒmßÑK¸=Ð6ÂôÀ\”aú8ÝV  tŠ|Ҡͤ =Ðæ¼Ý D´—0=01kµgûA˜èHˆ>¹åµZºc·„èv»§AïÖ•¸‰20Û E€è®Î„èAz u„è¹§½8î­)pÂôÐy Ñ'‚ô@«Ñ”:Óï Ó7Uh×ãôX5 S:¢OéÖˆ!Ò~¢ºI˜˜‹¤= Egzaz膴®ot-DŸÒ­ãiÇíC•:,…éw”¸©¦ÓFüòj@«¥}êDÐÅ?^h¼¢_³=•oÇ1qK€yˆáÚ~œ} ÐJB¢?ìj²<Ï-@£ÅÐè ˜(|·‹—Z#f´úqö¡J@k<(?(Ói:ÒMßAÛBôÓöâø¸¦ À<ÄÀínœ}7NGªw_ˆ¾ H4V ‰nÄÙû*pÊ8m+0/1x;ˆ³8=V h¬w⺼­ Az Év”àLïÆõ”˜—À=ˆ³^œ¨4JºšÄwË«KP¤)†CûqvO%Îeǘ«Ä=ŒS?~ùžj@#¤«HôÊ«JP‘åy® @£ÄýZœÄé¶j\è¾Ë1‹³\q¶d¹ ®Æ©Ÿ>£§éH4Ñ–/€Ë™åæªìp½§Gªµ“pn ÑŸMh”2 º¥—–>x´­ À"¤nœzñËûªµp§·âz¹­ç¤šf+èFpUïÆ"­+°(eh÷8=Q X™ÇqêÅõqO).&H4Í–\K_ €EŠáÝý8ÛˆÓCÕ€¥{Šý@).'Ëó\€FˆÝ”ûqö¡J\KºdÓzºœšR‹ó^[q¶§Ûª •rA[1´«W£#=Ð$[Jpmé tS€eˆ¡ÞPt§¬°0iýê Ñ_ =ÐñÓ‰i‡ê®JÜÈ–ËýqÚˆ_ÞW ˜»¡Ñ”âzé¦è+ÀÝLZW`™bÐw;ξt§‡y8ŠÓ[q½êÇéP9®OhŠM%˜‹-%–-uÍÖnìQœ6⺴§7'HÔ^ìžœvžî¨À\ô”X•²;ýï‡" \NêBÿ^\zq:PŽù¤š`S æænü€Òº2«’‚À)¿|/aàlÃ.ô;J1_‚ô@l*À\õ”Xµ2¼§‡ª§èB¿`‚ô@­Å®ÉkqvW%檧@Ä€ðaœ6ã—oÄ鉊À ]è—@¨» %˜»žuÃûqZ_¾ŠNÜÐEiÙKúå¤ê®§sw§¼â@­”¸×ãô@5è˜Ò²×=¥XAz îzJ°JÔQ Æ©¿ünœ©-—–ñïÆe~+-ûʱ<‚ô@Ý­+ÀBô”¨³*Ä©¿|#NU„–9ŠÓ;iO˺r,Ÿ =Pww”`!Ö”h‚2ÞÓFüò8=QZà~œÖãr½««“åy® @-}ÿ{?ìÅÙG*°ÊOl4JÌ–õãl;hÔJó¿¯í"HÔyç$mtéY†'q:ˆSZæã4Hß\ÄŽO\®7B°J_o”_¯—_ ß³‚ôc1Û³Š@}šÞT‘NÓ}¾é:ï”ìÙaA;8ƒáT×O –ûêäC%Ì}]ˆËÿ†2œó;ë¡Ô÷ƒÆ˜]‘²îÅi'æj”£ýé:ïˆlÇÙû*Á = E§ù4 šüéÀ2\ß+§ôõ//7Y7âúÐS€ó•¡ú^Щ¾ŽBžß­kSVG¨óÎÇv¤çêFÁù¶ïØT>õÚ+§Û^~®àA\GúÊpy1³³Æ™4—ÙižÔy~?N{1?³§Ý%HÔy‡£gª—Ý© Exþ°ÃëÌF¹sž&—“â"÷ãú²­ ×'³ÓC‘3KçÊA"HÔy£g©gìÔì…âvjf¯?k•t—“b–·|¢`~ÊÌN¯2 Ö¯ÎQ˜lÐz $L¤ê¼S±g«¥žß ExÞNÍÕwÐ7ƒP=“¾ëƒ(‹S Öo”ó{ª²0ÃàüÉ$ÃeÒuß‘0Hu›ðübvÎ7ƒP}çÅu*S€åŠù^(‚õÃI×úëyŠÐü ÎsM‚ô@Ýw҆Χðº%}2p7Mvn¾~­ÅY¿œìwË£¸~õ”`õ*áúõ0ØßV™‘š”Ó~šÇìË¡²pS‚ô@Ýwvâì]•èÌÎÎvÜÁÙUŠ•íŒo]ê»âƒ¸®m)@=•M27Ê)}Ý+çmn˜™2d¡˧ùA̸ì[XAz î;ý8ûP%ZíQ(ºÏï*E-Ö¹õ8ÛŽÓÛªÑjoÅunOš§²Γ^9_Óš>õaPþ0ÝåGó˜exeY6Az îü´QÿX%Zéqœ¶|b°ÖëÞv¨o«ßqy+€v+3@ë•oõfܬ7‡‡ÚŸú÷A9%BòÔ– =ЄyÚ ÞQ‰ÖHŸ*ÜÖ¾Q;ÓÛA ¾MÆõoS€.»¥@ì+A+¤ý;1À».Dßñµ:ˆS?~ùûqz "ÆT€6¤š`O í(N÷ã´!@ß\SúG*bLh²,ÏsUjïûßûáaœÝV‰ÆIÌ·S[)Z·Nöâl'NwU£QÅõ±§ @×éH4Åž4Êã8½‘:˜ Ñ·S|]÷ã´¿|/W v•@hŽ%h„¨~/¬SÐZ9Ú/¾ÎiÝ\ÅÕ¨ÿú¹§ !dyž«ÐßÿÞâìŽJÔV RoÅ`õ¡Rtví…¢ã¹õ´ž>ˆëç–2èH4˶ÔÒã8½º}!ún+¯B°§T£–v”  #=Ð(±ãõaœÝV‰Ú¸ÃÓÛÊÀŒuµŠàö]Õ¨…éÃ.ÊPБhš%¨…'qú®=gIÝéã´¿|/NG*²rÖU€ Az iv‚Pîª}§’(‰ËIZg7âôX5V&u£?P€±,ÏsUåûßûa?Î>T‰¥{§íÔi\)¸æº»gï«ÄÒý¾ =À$Az ‘b wgwUbiRGë¾20‡u7-G>³<ÄuwK&ÝR ¡úJ°4ïÑ3/qYÚ³7ât¤ —j¼­ § Òøƒ8û@%*…p¿[Ÿažëï~œõ‚0ý¢mÅZ*ÀiYžçª4Ö÷¿÷ÃAœÝU‰¹{§~ùXÔú»g{qº£s÷(®¿=e˜MGz éúAWëyK!úž=‹V.cå2Çü•c#g¤­ ân©ÄÜ< EˆþP)XÒ:œ–µ^¦Ÿ§­X×e8[–ç¹*÷ýïýp'ÎÞU‰y÷}e`EëðZœíÆéMÕ¸‘‡q=ÞT€ó Ò­ƒ¸»qö¶J\‹=ÖãæK]ý]Qàn)ÐeüJ\™=Öãæ;ŠS_ˆàréV½²„è±·Âf¬Û@.Gh!ÜK{'ÖjK°·b]ÞW€Ë¤Z© á¾§gJÁÛ]e ë±0½u`îéÖŠáÒ8{+NGª1Að–&­ÇýàC1Öe€9Ëò conky-1.12.2/logo/conky-logotype-vertical-violet.png000066400000000000000000002001601404127277500224700ustar00rootroot00000000000000‰PNG  IHDRøõ^ »0 pHYs.#.#x¥?v"IDATxÚìýM°çy'z¾yðI€ @‰¤>MBRÛRÛ’Û¢Ý=înBÝ·ï히±câ΄"&‚ÐÊ - Gôbb6‚V3³jh¡»è¡ˆ‰ÐÄ܉¸ÐÌ¢;fn[ ïõî–lò—dÉHI¤‚@|œÏœÌªÌªÌ¬¬:uΩS•™õûÉɪÊÊÊÊóøTÕ?ŸzÞ(Žã´ËŠ!€öð@ ø …üÐB~h!?´€ZHÀ-$à€ð@ ø …üÐB~h!?´€ZHÀ-$à€ð@ ø …üÐB~h!?´€ZHÀ-$à€ð@ ø …üÐB~h!?´€ZHÀ-$à€Šâ86 Ðp_|áëg“‹³…UÕÛ¹3ÉrΈ@'ÜÈ–iï»þÍï|ùŽa€å!à€IBû3aÆŸÏ.φapŸÞwÚH{°š,× ·¯e—7²%$'®&h7? BåýùlUzy&Yž7:@C¼š,wÂ0üÏ߀†ðÀ $Aþ¹ÐòÏeKz]ˆtÁ+¡àzÈÂÕÿÐ ~Ø¥$Ì?†!~zù¢Q–Ðk¡ø_ YøŸÿ× Ì€&ÈZìœÃÊ|a>ÀdiÅÿõ|úÀÁð@AÖjç|a1É-Àþäþ^˽ý`Fü,5>ÀB¤û^Ë?쀀¥’úg’‹—B?ÌO/ú‹'ð€=ðÐyY•þKÙò¼h¼´ÿÕÐû¯¨'à “’Pÿ¥0¬ÔΈ´Ök¡_Ù5 û¯ðÐ…P?]´Þè¦o…~uÿU­|Xv~ZM¨°Ô„ý,5?­“„úç“‹ A¨À°€¥#à ’Pÿlè‡ú颧>“|#èÙÀðÐhI°!ôCý»´š,W’åröß0t€€ÆÉªõ/†~°¯³ðj²\ZøÐ!~Cµ>s ª€Îð°PI¨& «õõÖ`ž^ ý ÿª¡ ü,DÖ†çR²¼l4X°×B¿}Ïí{h?s•ûçC?Ø×†€¦IÛ÷\ý ÿ†á éüÌEÖ_ÿb²í$è ±üÁ>#è qüÌ”`€ŽôÐ~fB°À’ô°p~ö% ö_J..Á>Ëék¡ôß1Ì›€€=I‚ýó¡_±ÿ¢Ñ`É­&Ëå$ä¿d(˜'?»’ûgC¿bÿ FJ^K–‹IÐÕP0~¦’ûgÒ+Éò£½úAÿuCÀAð°£lÝËÉrÚhÀÔôçà@ ø+ë³9Yž7°'iþ´šÿŠ¡`ÖüŒÈÚñ\N–—ÌDÚ¶çBôß0ÌÊŠ! ( ÷/&é‡á>Ì΋ÉòÓäýö%CÀ¬¨à 'ù q.ô«ö_4p ^ ýjþk†€ýð²*¢¯ ˜+“ð°/~€%–Uí_ &Ñ€EQÍÀž ø–P6‰î¥dù£ š€]ð,UûÐX¯†~5ÿuCÀ4V ÀòÈzí/÷ ‰Ò÷éßËÞ·ÀŽTð,UûÐ:¯„~5ÿ CÀ8*ø:. ÷/&ׂpÚäÅd¹ž¼ŸÉP0Ž ~€ŽÊ&Ò½’,_0ÐjßH–‹&à JÀÐAI¸>¹¸š,§t‚ x¡E@Çdr};÷ KÒ–›×’÷û 9ü‘µä¹ú½:€îúZRÉÑ0 àè€$Ü?úéªÚ€å¶ì9¯/?ÀrÓ¢ å’pÿbrñ½ Ü€e’¶ì¹‘û°¤Tð´TÖ’çr²¼l4`©})©ä¿b–€ …’pÿlè÷ÛÞh‰o$!ÿð\ü-£ß>0Æ+Éò’¾üËC~€IÂý A¿} Þ‹ÉrM_~€å¡‚ %’7éW‚~ûÀÎV“å|RÉÝPt›€ á²Ét¯$ËŒ° &ßè8?@ƒeáþµ`2]`oþ0 ù/€nð4”Ét€ùFò_0 Ýc’]€î3ôr6§£‚ a’7Þ’‹?2ÀŒ½ú“ïÞ1Ý ‚ A„ûÀJçöº–Íõ@ø"y“})÷€ƒ%äè-z ë‡ù²‘æ$m×óRҮ熡h/?À‚ ÷€Y ýžü× @;iѰ@Â}`N‡~»žs† ü "Ü@ÈÐb~€î "äh)?Àœ ÷€ò´€`Ž„û@ƒ ùZFÀ0'Â} ÒÿJòù匡h>?À÷€y>ô+ùÏ €fð0á>ÐBB~€ð äÍðÅ ÜÚIÈÐp~€’¼ ¾\ü[#´Xò_6 Í$à8Y¸ÿGF耗³Ö£4LDZQ˜¡äï¹äâ{F蘯~ó;_¾dšCÀ0CY¸-YN  ƒ¾”„üW @3øf$›xêz²ùLtÅ0,ŽIvö(ë9y-ô¿ž °¬þ0™t÷²a˜??Àd½&¯“ê¤>Ÿ„ü× À|iѰ7Wƒp`ð))„:kæKÀ°KÉ›ÖËÉÅ‹F` m]z5û¶3s"àØ…äÍêKÉÅ €Ï'ËeÃ0?zðLɤºSùRÒÿŠa8x~€)d_3½ú)Lö›IÈÝ0,-z¦s9÷¦¥?ÀøvõÝÙHLí¹d¹b–€`‚$Ü?ëM)Àž|!ùLuÑ0?ÀdWƒIuöêRòŸ3 CÀ0Fò&ôRÐw`?Ò‚©+†à`øj$áþùäâ+F`ßžO>c]6 ³Åql ’7žg’‹ë¡?)³ñùo~çË× Àì¨àu)÷™£(:˜æJVPÀŒø ²Ö<`$8óâ…ÿ4LZHuÅ0Ìð³¿=}Zó0óÙéÞ0Gÿ:iÕsÕ0ìŸ ~€¡KA¸ÏÍ´J>Ζi×Ïøøà€iÕ0#~€ 5{³çP<Þùî9çûµ?ÓA«€Ù|†×¢XvZó°«ÎßéKï¤ýìôÊíçà÷ðºï­D«€}RÁÂÅ Üg‚™·¯‰òÿÔ/;ýoÜãv¬ð¯&õSþ@*ú8 Zõì“€XjÉ›ÉsÉÅWŒUS‡ú;V·×ø;l2~™øLõ'Æb1ðŸ"Áô0ci«žK†`ïüÀ²»bÈí¥R¿žIäÇ„õ»ÉõK{Üå €hšÀ?û§ ú`Fþ › €=ðK+yy1¹xÞH°÷Êô$:vów ê3ã*íãòSî>ü=ê06ìŸ2èò0CW ÀÞ˜dXJYŸÇ¡ÿ•P–õEp¡þ.n–žë@^qã]nÛ&®?ö&æõ6€ùj2áî%ð;*øeu9÷—ÖÄŠý‘;&·Ü©+–v,­óÔ¥‰t'þabûŸ ?Á¸í¢Iý΄¨ä`F.&…Xg Àîø¥“õw|ÙH,Ÿé&ÍM#îÉmwÒ¶<ýJ‚eg=þ«ÿ‹²V?#Ï1æQ5ŸŸp¼Õ1˜Ãc­ýÊô8xiÖeð;~`]2Ëel°?¶Z?ŒVéGÑ„JøáãJa~ò¿•({Ra§ƒûkzúçÏ5ü£ò)…Ý„ý“‚þÉã5q5ìÖL¸ °;~`©$o/$/‰å°c°?¡Z¿êç«Ë™÷h _ óëž»·ÏäÕ7]†ÕúõËØŽ>…jÿA°ŸÏ;Rá_öWwÆý¥jþÚõÀ \1ÓðK#›X÷²‘è¾Ýû¡¶ýN¾ºê ôËÁþhËtÛ•ÞFåv7“úîçëóç©ý¹¢,€/Þ_öï2è¯Ç4c3ð\òÙí’a˜Ž€X&ƒ‰u;m¯ÁþH ž1¡þJaÿQ¡”= öûwÅåð¾x!šÐw?3ƒo¥SùÏûãgaTöƒþªWKÃUsŸ*~æùÙ-+Ð`~`)$oφ~ÀOí7ØÏWM õÇú¡¾/TÓFg¤p¾ràùýés®¬T¦Ñ-ì$5ý÷‹a4l«TãW®M¨æ/Ÿ PÅÀܘp`J~`Y\ ª÷;gÏÁþ ¤ ö«=ñ‡û+úQM ¿R¼Bcý¨\é?øö@4úÄ#÷—~ÆrÐ a5è¯ ùkZíÅ£« «Uñ0/'…Zç Àd~ ó²êý—D·LÌ—§lÅSl}3¨Ö/=AÄÇ#“ÞFÅoÔ̬[W±?’õ‡0¾·~ñÙÏÕýì¥n>à¿ÿ~$_ìÑ?|P<Ò²'.Þ]s}š*~˜¡Ë†`2?° ®‚·^Ôµâl•ZèäO0ê—«íë*íKÇ6RÙ?.Àƒ*ûêD¹#É«ÿ+Ï—ÊÏgÄaØgäñq¨Tó׌Çn«øÇü~`F^L ¶Î€ñü@§eo_4Ý0±OÿF(†ûÕ`Ðæ¦RE_]7)Ô¯VÞCüj&ÑÍŽ±¶ O~l¥oD…½üãÅ!Œ úó¼½ò×M¨;ËÇa7Uü;ÿB`¦.€ñ¢xL@$ÿµ àoÿ‹Õ´û…«Q–z—z×G5“Ü[Õ ÿK“ßVËÜ û-Æãå¨|wJ¯ÆYû8kËsøÈ¡pæý'úUøÉŠ'„“l²þÈÑl›PüSOèÔÈhí÷Õ?ª9îû÷ÖzË^­¯m…Û·îûÀžð]•UïÛH´ü…j\Õþàõ+*_ø¸ÞGSûQa}±ýð!ÑøCÈo×jƾÖ„ìúá#+½ þ©<Þ æŸx߉pôè¡æý^*?Ð,ù ‚ô„@úß¾õ w"}c}ËàÐF¯%ÿYÃPóù\Àt•êý–¿@í²jØ®¦ìWîìÇyË›hØÏ¾ÔÒ§p_T×´>޳þöã:.L’›?.]w"©Äê'ÃS<Õ ôOœ<:ö§ÝÕ+ö,Êô§}ï" ]ÒŠÿ·~qwúß|ã®A¡-TñÔ}>ð]¤z¿å/N»™D7«öû+{UªöÃØ`°ºâäø¥oTŽ3mÕ3Α¤BÿCÏžéUè?5!Ðßÿ ?0•4äOCÿ›oÜSåO“©â¨û|.àºHõ~‹_˜&†ûSTí´ã™2ØÏ÷žãÅP?Ÿ\7Ä£‡1î(‹¯®O<ùXxöïï…ú§ß÷Øäg6áàþJ›" Š¿ F?@õó¹€èÕû-}AÚmÕ~au};ž)‚ýÂçyþH¨_xö¸r°Qö:²>Y>øÑ'ÂåLøÐ¯œîõÐGvÒòßWöo# ÛÒ^þiÈÿ󟾛,·U÷³hªøªŸÏü@רÞoá‹Ñ.Âý¨ð˜a«œ¨Ôß¾â ö£Ê>kCýb˜_h7»L#7 ó?”„úL.w7a¶Á¿ö<ÀIC~a? ¦Š ø]Àt‰êý¾í¡%O©j¿¸|}½ò'ûyx_êG•*þüå²x¸‡“ÊüöBýdùè0ÔÇü$]yÅU½¤„ý,ˆ*~€âgt?Ð%ª÷[ö"4M¸_¸_µ_nÇvªØ¯ûÕ*ÿ¿Q¯|ü}á7~û£áÈÑ•‘£ÞUÀß²ä_õ>P•¶ñIƒþ¿üî/Âý{k„yPÅNð]‘„ûg“‹Ÿ‰¼øDcVÆ•Ylw[µ² >xeòܺŠý<øŠÉõ„¤ÿ£{2|ê³ <:þç Ý ÀUï“üäo ú™Uüùçt?ÐIÀ%¹xÙH4ü…gýöóT9š0‰n±j?Z)Ÿ׊g°]êÚúäóì' ö?ù™ÉÁ~qß]|uU½L+ úÿüO_Óº‡ƒ¤Š øŽP½ß’]öÛŸÜ’'Dwð¸B _3qnù@4ö0RLzëÿÆoxì/àe³)' Tﻑ¶îùá÷ßL–_ ú9ªø+†èˆ † Ù¦î·+ç£ÁÿòÒú~Ð_8·ØYÉîËýÞ²•úì¯dÛäå_ ˆò“y (¼ÿ™ÇÃ?ügŸŸûÇgÉG§NØ£»8jÀï/?á>0¥£Ç…ϼðÑð¿ù?üføôç>b@˜µç’B¯ó†Xv*øÖKÞÔI.n$Ëi£ÑЛ)ÃýZòô÷•Zéäwåaý`BÝâ}+Qmž¨¸ãìjZ©ÿë¿ùá¤rÿ‰‘£ŒKWv9V·ï¦µùQ½ìWÚ—ÿ/¾óóðÓÞ2ÌÊ+IÿyÃ,3?ÐzIÀ!¹ø##ÑК…ûQa£A ž•aD_Ûk¿Øºg¤TúâÀá#+áì¯=~í3Xìx…æõ¸î³tó»IÐÿ‹Þ%ÌÀo&!ÿuÃ,+-z€.¸dšioá~e2ÜJKžA¥~¹KO?ìïõáÉÚödíy†­{†Õÿ¥ ÿ(ôªõÿñ¿øµ]…ûÑ>ÛæDu·£r;ž¨)­y„ûÀ =óá'Â?ûÂß¿ûù‡#Göë¢!–™ ~ Õ²ž‹ß6 |Ùk¸†ÕùÅêûRKž¼ï~4~BÝrÅ~Téíßžã'„ç÷WÂûž>¹óϲð=þ|“^B‹•øÅm««mÏÓ€@]°ÌC:ï_~÷罉xažLªøï`©àÚî¢!hžý‡ûéãrkп¾R˜T7ªù“íFÅõÃjýáÉ€~ÿßûgÂ?ú¯mªp?;šRïâÝq¡¯~±Ç~ïf4|@>n‹ Õó'qî/ˆ÷·~ï¹^Eÿ™÷Ÿ0 ø\°ÛÏñ*ø¶Jª÷Ï&?5 |qðOî+ð£J€ŸÝŸWø‡Â»Õ‰vÏ•­L^óN=ùXøìïüJxâÌñùG(Tó‡Á|¿#ëú;Ëþãm°Hé$¼ùÝ_v뵤‚ÿ¬a–‘ ~ Í.‚æÙk¸ßï—Ÿïcî‡(zèg×W† ô‡UúÑ O©ç~áy~õÓÿè¿ùÕ~¸?ëþöö×lnÇÓífªû÷rØ*ö€¦øÌ  ÿâ¿ýŒj~v빤ÌçC`) ø6ó®aöîç•öÅÀ¾T•_l½“¾€'Ñ]Þ¿²RöÓëi ÿ{ÿõ¯&my>0LÓ‹ û¾ð0R‚Õ\ÃÎÁ~íÍFzö§>röÉð™ßùh3Æ(Œô“ÚóŒ„úûèå3ËórûÖƒðŸþøïÂw ¦ñ±¤UÏ Ã,ü@[]0Í1Óp?ä-y†=÷£a²?hÑå¡þJ¿j¿Ø¦'ßoZ±?)ÜfÜï&Úáz\xÞÒº¨~?q¨òñÞ'Â} }Òjþö…_Ï|ø ƒÁ4.`ÙøÖÉ&×ý‚‘h†hЦñ» ÷WÊÁ~Þo¿Ø’gØ—XÙ_>Ž¨×¿õWã™Pyê}þ°“wW®OìÇ£msösxaŸûh’£Ç%!ÿßûäSƒ\0À²ðmô’!hƒr«œb¸Ÿßžîg“éöúê&Õ ÃIw‹“ì†lý‘£‡ÂïœÿX¯5ÏHà^HÀ{Ëî6+—Sn^‡R%}\Yíu”wuX­ôþé'Â'?ûAÁ$§M¶ ,?ÐF A3LÓš§|3 âW ëkÂýP ðÏ5lÉ3¨î/öêOÖ>²^xñãá}OŸ¬­²ßKí¸bòÝuÁ~©Ößà õ€eò[¿÷\øÝÏÜ@0ÉC,“ì­’TcœK.¾g$ð2mßýì?ƒ ~%|41ÜB(õÕƒ‰tÓmãÒI€ôæ©3ÇÃg“¶<§ž<^HÒCýõ]ÿ°aOý䀘㎴çñ °'?ùÁÛá?û'‚qL¶ , ü@Û\0‹·ëp?ï·¿—p%”+ú‹­y²ç{" õçüÇ{!ÿÌCó)‚øºá(öØÏ+öKmx„û{öñO=þÅû™^{Fð¹Xf~À5f¤îG…p?*lE…ÞüÅm«áþJî‡~å~µ%O~Âà‰$Ôÿ¤-Ï‘#+“m&ýyêÅã6ì˜'Ÿ:‘L¾ûëB~|n–š€h¤=ÏKÉÅi#±XѤÐ;*·¡)†û+…úJeþ`ݬÏ~/Ü_Nº[~lÒ–çôñ^ÏýÃãÂýY„écÓûÉO7Á>Àò3ÆsY{W€Îðmò’!X¬ZóD囥 rÓ++Q9ÜÏvZ ÷C4 ôG{ñÃýÇzáþ‘£+“©oÚp½úóÅ;ïcÜÄSÀì ù©8}Žè4?ÐÞ˜5ÕÈ$ºY8¿2¼?D•?¯Ò_¶ÞÉOô^œŠë þi¸ÿ;iåþÑ^¾âÙýl;í>šâyûó!äÇçH`ÙøoÌØQ©z¿ÒšglßýWßGåP¿ܯäþJÿù„ºƒ–>…IxÓŠýßú_=;~B݃ïoÁ>Àü¥!ÿ?ù—¿f ð9X ~ ñ´çY¬ZóÔnSé‹§Š=÷‡­xú¯ÖÚòdLÃý´çþñG¦8à9ŒÉ”Û öã™?~÷ó7hÓtž€hoÈšhÐ#¿£Úw´—~¥ç~aÝ( £·Cû´OîŸ:}|ºãšC¨>MÕ>‹õñO=-äÇçI óü€7dŒµckž¤D=ÎnŒôÝÃpeÐr§¿2ïW¢P ÷C¹ú?¹üäg?4}¸_{àó¥j 9ÒÿcŸ|Ê@ø< ÐY~ Ñ’¯Sž Úó4ÄÖÒw¿Ð†gЦg%*‡û…6>OøTøôç>2ù ã1×§Ù€¥rôØ¡ðϾðëáä©cc9½d€®ð•|òlrñ¼‘hb¯üTœ¯mÍSí»ßÛneØ~'*ô÷‰ -Y ¿ñÛÝ÷aè0hÉÐ:iÈÿþ©Iw—ÔsYûW€ÎðMvÞÌß4ëNjÍ3¬Ê¦öƒÖ;y¸?Ø}4ØóJöU€Ï|î£áÈ‘ý½<t±¾–<íô̇ŸŸüì „Ï—!àšì%C°`“&ÖÓš'¿ÌïO+ùÃʰMO©'ÿJ(}#à™œ OèÔL]‘=u>”=d –ÏCt‘€h²ó†`¾ê«÷ÃÈĺƒ‘hBkžP¼ Y?ܾî*ú'²~í3;TSM™Ú§›)² NÚªçŸüË_3Ëçù¤MÏÃt€h¤ä×ùäâ´‘X Bõþ؉u ­y çþð1ýõÃÖ<¡0ÑnTÙæŸz&iÕ³tΠKü€7\ ©Þï] åêýAÈ_0h×SiÍ“öÙ¢¨TÍÿ¾§O†§?tjòñÃüìqÍ&ºð°i«ž~ìIáó&@ëø&ÒNvU½_Ø,Ê‚öÞf+Q)ì/´ÛnFoüÚg>¸ã1÷qq þò°_¿õ{Ï…#Gˆî;ôá?g€®ð’¼Ñ:o¤¦z?ÎÇUï—ªôÉ~4¨¶ g¢Bûž?{fìĺqa6ÝüzTAW¢ÀŒ¥}øM¸»4|î:CÀx£EY¥z¿tW¥z?ªöC!ð<6mÍsøÈ¡±ÕûaLõ~]¯}my˜µÏ¼`ÂÝ%qÎ]!à¼ÑZRј„|Ø{?„¨P±¿Sõ~”m?˜Xw¥p’ ëßzöï?±î¤êý1›À,}ús1ÝwÞ]!à¼Ñ"Uª÷£Áêv®ÞÏg»ím1lº_êÍŸVï?û‰÷ï|(…ô>ŽÇíTUü*ýØêéÞ¤»tÚsI{س†è?ÐÙ¬ÓFâà›\·X½JívÊÕûÅÇV«÷{ëÂp}¾Ÿt¯ŸøûO­Þv™ÄO;¹n<ƒç`¹|æUüKàœ!º@À4ÉyC°…Éu‡¢A2ž‡õ¡P½Ÿ·ß[½Ÿ%ûÅ“8~åãï«=„(”Î+L6méþ„‡Çúû0AZÁ¯Š¿óΠ ü€7XôU&×ò }˜ßž˜T½_jí“~Õù©©#Þ)ÀŸ¶t?ÔïG¶À4TñwÞyCt€h’s†ààí4¹n\Z7Lé“ë®DåV=ãª÷ó3‰C‡…§>ôDá‰ÊÏ[ Ýó}t¢â¾`TñwÞ‹†è?à ÖÒ+ôà´Ö)äìUNÔWï?û‰÷…#iïýÝÌŠ»>:úî0 ûäS¡Ã’yàΠíü€7V˪4YîèêÁÝQT¯«L¢;ÜG¹zÿð‘CáW>ñþ±‡ï¸b—?VåçÉoê»Àn}üSO‡“§Žˆîò9h=?Ðg ÁÁ+U±&×-ÔðN®ú}ñû-úûëVòv=ÙQ±z¿ð\éòôOõ«÷Ï;é÷ÿ3Æ5Ï!Û`¯>ùÙŸC+Š•4 Tð_J.¾b$øþH€eøQ¿‡~êÖ…^Ïýþc³þûÉÒ øW¢áº0¼½Eƒªþôögç£á韪MÙ{­€òó ÅË}ýå} žà€l'dÞ¹{/loü›Ã‡V“§ïÿ­`.îß[ ÿ¯ÿÛuÑM¯|ó;_>o€6SÁ4…7Uó•jökðrŸžÒäºå-J•ýÕêýã'Ž„§?4&Ü/>í 2±º‰uµææáö½÷Âõõ°¶±qàËýGkáÞƒ‡`ŽÒ=gÞÂ@tÓ9C´€hг†à`kÏSØ¢p­RÕílØ¢§ÿE€h¤/ÜjŸ¢Þ,ª÷Ã.ž`ŸÒêý4tŸ'?Àü¥½øé¤ÓÉ·ÉÏ Íü@SpðÒÊýyKO*,ây–ÙG?ö¤Aè®s†h3?°pIÅÄy£°y{ž¸º¶îW[ð Zõ ýìd@qŸÉÓö<§Nÿ¼u+âxЧû¹dûÀ<urìSÆcŽbÏâñ?ÀAZtÀ¿¨ö@Ëì£{ŸAè¦s†h+?°PI¥ÄY£°Y“ýbÿý(ë³3ùóQ4¬ì¯¶ç‰¦œ`·°ÏYý(r.`žšÒÿþÑú†_ÀœéÃïs)@“øo¤–M¥ÿ~…?»Rê¹ß»,'ùñ =O¡EOvýÌûOìé°â}<@ñ>0oÚã,¯'“o¬9zÈ@ø\ Ð~À©%3©ÿ~º.ÎÓòjI|eVÛBŸþæÉrê‰c»:–™UÝKø9kJ{œµ ü‹ðèÃß1Ï ­üÀ¢1‹7®ÿ~ÝvQÖ¢§®äþɧNîªíΞ[ôhÏ,غ ~€¥f¢Ýîùâ _÷Ùh%?°hÏ‚ƒQ ÏG3ðh°>…Ì<ŽKú ÷þ`§q¡ywg’€Waû.¶-M  =°`ÛÛÍ8³¨?Àb¤mzèœs†h#?À*éGYëAÈ 'Ûöß/LªÛ¯ã¯ì+Ù.ÙÁ©Ó•=;¤ï{9 Xh‚ØW‡–š ~šBÀ,LòÈóFa~z±}¡_~ñžþEÔ뿟‡üƒ{òÿ¤÷—JýËß8~òH8þØ‘ò“Î!ÿ±‹Ð”=[Û[~ "äïŸOVð,‘RGhŽôÂÏ+Só¢JÕÿÈÞÒêýããŸ7šnÝ4Ç]:ÁàW ,¹Í­mƒ° Ï|ø”A`áüÀ"1 ”gøaxUz÷Ä•í£,ð ç“Û?qlüSÅ㟇ºëÇìz2™ ŸOMÀ,Ò9C0ñΙxi‚ÝÒúlÂÝl)O¸;ÜÚ·pâÙühs×” vsN8,†‰v}>h?@•*ìkûØWÆÃ5Ãþ;åÊþì®4ÿ/žˆ†3ï&üÇ <À4í„À²8yêX8rô`¡üÀ"1‹3¬Æ†ýÅ0¿¿ÍprÝÁ»ù¼…s‡J/)ÀrØP1@F›ŸOM,Ò9C°Q9ÒïÕ}Óúh8…nï¾¼÷þÈD¼aÐ#çñÓÇòpwµà mÇͪ˜wÂ`qL´Û)Ï üK Õ€¾Nõ²úAOý¸¼E±×þ`7ù‰°ë¤=ÚåöOLÖ´Àüø–DT¹•ÇAÅÀ½TÍ•ëü£J2?ج7Áîc{9ˆ}g‹²¹µe€Fð‹tÖ¼IAøÈDºƒ;¢ÒýÅí£â†{HÙšm·¹µÝ¨ã1É.ÌÆ_øú£´€X¤ç ÁÛGæÓ«ñœˆFZëDÅÙxçp<Ô[׃fåœ!ÚFÀÐe;æïqy“¨ü°â}iåý¸êûx&Ç2à ` ø–Ø ï?Q)8êªó£~ïþÒ]ÉõÇNþÉvA4ÑÖ¶ü@3ø:fç®9Qíõ¨öñÑÈÕÞEJýñGöqÀ~g@»4­?‹sòÔ1ƒÀB ø…H&/:k' ñkO&×Í3üºJþ8ßh§ç™æ`â=Ý@fmcà ,ÈãOøX,?°(g ÁœeiùHÍþ¸¿FT¿‡éE;ÜÞë~|N–€`™dýuŠ~¯R\Ð>èÇS>M™ÀÇãVDã6Øã~öï¬!ÚFÀÐq½©s£0]Y|œ—ù×TéOHÕŸ|ÿ‰ÝT¼¯»%üÀ¬on 1üK`ªl¿·a}ûº>ü²G3øÀö¶3Œ@sø:l§j\Û(}d4fû¨æó>pJ|³–“€`éD½p>Þ*Wè§×‹{ï¾xO=øÇ=}XÜÃ:É7 `9 ø–Q\S¡_ õ§ÜÏ^ÒvÀLø¨UêÁŸ6íÌ@É‘£‡  %àèªÝòcÒû¨²«ô2ëØ°œZí àɧNJÀÐU;µÏ‰§xXTè·“êF»8\€&0™-Ð$~€¥„ùƒ«…0¿X¬õ–ÍÌ»¿g÷EºàÈÑC¡;® müK*×{9}ÕäõQíÕ™‡òÑ®VP÷7]ë €…yò©“€…ð0!LÆÞŽdI¡uÀâœmÚéÕ¤ÿþ ô•€`Ä#W¦©Ê€=ùÔ mzÚéŠ!ÚLÀSz´¾a듟ý AhŸ«†h3?Ì@úô²¾¹i LþÖyE{ í¢8Ž0w_|áëç“‹o‰ÿQ¯tÓIÿºäGýû£(l¸’ÝŽV²%¹½Ò»ìßîÝ¿²’,é¶ýÇ­¬ôwÖÛEÔß÷çÿÕ§†P÷ºRYޝw£î!õ«Ç®_¤·n¯†µùTõž<~,¼ÿ‰Sþ±Ãüÿûnœ>y¢·°xÿéÿ.üô‡· D;|) ø¯ ÍTð0Sýàò6]:µüpm}®aßýGkZ„4ØÇ?e²Ý–xM¸t€€EÕÄ>ý¶À²zïÑ£¹?çý<'ÓyæÃOôï²!º@ÀÀÍÛ¦—Vð/Ãs0½Ï¼ðƒÐl«ÉrÅ0] à€=ZT«œíd>î4—*þÆ»œ´ç¹c€.ðÀ-r¢Í5}øMc½´ç:DÀ{´ÈÉnUð4›*þƺ¤zè?ìÑÆCöÍ-¿€†ûÿôã¡Y^IÂý+†è?ìAÚ?]E?@óùÙõ‚~î«IõþuÃt€ö`£áúÖÖ¶_@Ã=vH«žÅ{5 ÷/ ‹ü°‹lÏ“SÁÐéd»Ÿüì Äb¬&ËÃt•€öàÑúÆÂasËD»mñéÏ}4œyÿ 1µæºLÀ{7 ‚S‹€Öè·êùD8rôÁ˜Ÿo$áþÃt™€ö  íq¶¶Uð´É“O¿õ{ψùHûî_0 @× ø ¥Tð´ÏÇ?õ´~üïµd9o€e à€]jBÿý\&û`wÒ*þ}ò)q0ÒIu_Jª÷ï `ø ÅÖ76 @ ýÖï5éîì¥áþy“êËDÀ»´±)T`ÒIwÿÙ~]È?;Â}`) ø`—šÔgmcÃ/ ¥„ü3#Ü––€vi{[ß{f# ùÿÑÿúWÃãgŽŒ½éM¨+Ü–•€vi½A-zœlh¿#G…ßø'òïÞ«ÉrN¸,3?´Øºù:áð‘•^Èò´JßýÊý;†Xf~Ø¥8V5Àì¥!ÿ§_üpøÀs§ Æd˜û„û~ص&UÍ;Ù°¯;Ö7|š! ùÿÞçž ¿ò÷Ÿ4£Ò~û¿™û— @_$á‹/|ý|rñm#1ã?êQùvú>êý¯w¥wEƒ W²ÛÑJ¶$·Wú+{—½«++½ë½‡ôÖg—Qºÿþ¾?ÿ¯>58€(YçO^<°ÊëM”oU¶­Þ?åúyzýæ­FýÞŸ}æ)ÿøaNÞº½Ö6š„ž>y¢·Ð=·ïÝ÷>œËs=|8|ð}g :,@z’íæÕ‘õï¼q?üø»7ÃæÆ¶A ákÉrIÕ>@™ ~€ÚÜÚš[¸ŸJ¿)pÿÑš‡yÿ‡O†sÿÕ¯„3O?¶ÌÃVí> ö/ ÷F ø`Lj À¼Ü{ðhÏùÐÀCÃ;q¸7ùnÚ²çð‘CËöã5YÎ%Áþ5ÿê ø`¶·›×ÚÎI€nZD;¨ô5e[Wh¤gý}I5ÿG—¥šÿÉò±$Ø×’`~h¹&žt`Òö<‹:»fÂ]h¬¼šÿSÿðƒáøÉ#]ü_ ýv<’å†ß8ÀÎü ³±¹µ°ç~$à‡ÆK{óÿö¿x6kÛÓ‰h'­ØOƒýóÚñ쎀vaíX>‹l¿¦õ´GÚ¶ç·ÿås½ ÿ±öUô¯&Ë×B¿ÏÁ>ÀÞø å¶¶· @Ç,²ŠÞÉlh—´‚? ú+©èÿÕÏ=ΗTõäWÏ4©ª¿ê'Ë“I ÿR²\ñÛ˜(ŽMÌÌß_øúùäâÛFbÆÔ£òíô/|Ôû_ïJïþ(Š®d·£•lIn¯ôWö.{WWVz×{é­Ï.£tÿý}þ_}jpQ²6Ο¼x`•×›(ß$ªl[½Êõó²zÿAoi’Ó'Oôàà½u{µ‘ÕÍþtËvòšùó·ßYè1<}ú‰ðر£~0'é·vnÞY=}ß¿³Þ}óA¸wëQ¸}snïcÓÉr¯'ËU­w–€XÿýQð8?,7?ópAŸSàÿïWß~î&aÿƒÕõ°þ`3ܽýh?»{-Yn„~˜ß»èÌ—€XÿýQð¸&†{BXî¿þtÏýGká»÷z ' ïâ”_ÌÉ¢Oì­%Aÿ£ûÃ×·#‡‡CÉþ‡Ûÿý«ú³ÿ®æ!7ôÎh?°þú£.à?pM ÷N=öXxòÔIÿKú7 %àï–&|[ìØ‘#áOžöË€9iÂ7wê9|èßýþ¿ùç¿ï7Ð\&Ù€–3"€¿ë³¶áµ ü ²½½øoYoû¦7@+ø¤)Õó¾!Ð|~€iJõ|¾IÀd~Ø…­í-ƒÀÙÜjÎëÌÖö¶_@à ø`6·„,ÇëL“N6POÀ-$à€–Û0 "@g¬ml4æX­oø…4œ€Z®)“1ó%àhˆííæœ´@h<?@C¬7¨íÚºp'à€ð@ øbmc£QÇóh}Ã/ ÁüÐB~h!?@lÇqãŽ)nà10$àh€õÍæÓæ¦_ @ƒ ø …üÐB~h!?@llêÁÀîøjsk+ôï~ÿßüóß÷h.ü ”/ó”†Ö÷­x€%þ½ŸG¸ŸJ¿™’>×õu@ÀÐ0iõþ"ªÄï=xhð–Àêýûsλ^cà@øæþÃÅTÒ§'Ò¾ÿtWZI¿¹µ=÷çMO\{€Ùð4ÌÃõŵÊÑB'íÁÝ4Mœs‚öþ;ó³'àh´ºq••¹GÂ<€N[äIä~˜9?@ƒ¬ml.öù×ü]µè“Ⱦ³'àhõüÛq¬G2@Gml.þïû#'’`¦ü ’Nt»hM€èêk̦_Ì€ AšÐ¾`]øÐIM¨ž÷³%àhˆ¦´ÆÑ> ›šP=¿È9 ‹ü Ñ”Ð#NúðÐ=Û øûn¢]˜-?@C4%ôÐ> {šôí,“¹Àìøb{»9•óB~˜¿¦N>êïA7lm7§5Ž6=0;~€†hRˆÖ¤“ °,¶ÚË߃nhRÕ|“N6@Û ø¢I½ï7TìtJ“~-z`vü Ѩ ~ítJ“Úâø`vüŒ¾tK“¾%¦?ÌŽ€ ­o4êx„/ÝÒ¤o‰Å¾%3#àæfÝ»ŒÒý÷÷ýùõ©ÁDÉÚ8òâU^o¢|“¨²mõþ)×ÏËë7o5òwÿì3Où€}¸ÿh-¼s÷ÞÜžïäñcáýOœÜNCÿ›wV7.ÇŽ xò´ oÝ^ kÍ;Isúä‰ÞB»5õ5æ™3§Ãñ£Gü‚öh;ytûÞ{ɉäí¹<ßãï½ÎxÿÒ.M}/päð¡÷ûÿæŸÿ¾ß@s©à–Z¼ÌSzB!]è¾Õ÷ôþæ§'籤'¬}[ –‡€Xj÷<ì…ü‹x^º-mÿvïáüÿÞ¯Þ`ð`Iø€¥vÿÑ£…<ïúæfo »î=XÌkLZÉï5–ƒ€XZiø1¯žÈuî?Ô¦ Ë®/îï¼×X~`i=\[_èó7q²VfcÑ'‘yr˜?°´= a?üÙò‹è µ¿Æ¤'¼Æ@÷ ø€¥Õ„ úMá @=Xð·ÄRp ÀÁðK©)“.ú[Œ¼Î˜hºOÀ,¥¦TÎ _º'm³Ç ?s½@÷ ø€¥´¾ÑŒ`]øÐ=M9‰œöáo‰ààø€¥Ô¤Êù Uü^cêX6¼Æ@— ø€¥Ô¤P=­° ;œDæEÀ,¥&µ,Ї c¯1ÛÍyqºMÀ,GëÍê{¿µ½å—Ð!Mš_ÅIdè6?À‚©®莦Mjë$2t›€X:Mª¬ [š6©­“ÈÐm~h!?°t6·´+à`ø–0O~`éhW@ø`F¶·cƒÌ€X:››€±î5˜£(ŽUó÷ž~>¹ø¶‘˜ñõ¨|;ý õþ×»Ò»?Š¢Á†+Ùíh%[’Û+ý•½ËÞÕ••ÞõÞCzë³Ë(Ýßÿð¿ùDx¸¾²§ ù+Kÿ%&¬MoÇùÙ†G §OžýY û™fý¼¼~óV#÷Ï>óTéöv2Æ«ï=˜[ÈðøcÇÃÉãÇZóÿ+Mý=6ͱ#Gž<=òoëö½÷æÒæèèáÃáÉS'5&oÝ^mdíôïhÝßRÚ¥©›ž9s:?z¤´.Ëd^íÎZI–C­ù=6õïDÞ¿ÌûßÖÑ#‡“÷´Q#ÆâÑúF¸ygµq¿£ä½ú¿ûýóÏß¿V€æð !à? ?ê øçŸ,Ü´Ö?†4Èy_<–4à﯈ gâd;N?^¦üûû€|ûÞýpïáùÃÓ§Ÿ;ÚŠÿ_ðO§.àÿå»wæZZþ,’€ŸeüÛT øÓ¿7“ÿ_ØžÓgÉ4€}&ù[”žôkÿÞÿÆ?\[o¯ÞÛó§ÿ¶>ø¾38$à`ϯg†€E{ïÑ£°¶îƒð,? Î;ÜO½s÷ÞÜÂ#=‘7ïÖüm€Æy÷î{sý{Ÿ>×­9†¾û¥ ÜÞÏé{‰ù?ç{€VðÐÖÖ ÂŒÜON˜,êƒyZy×tz#ïݽó?q$(ƒfIÿÎ/âïhÚ²%ÿ¶`Ó9Ù½÷טEŒ]úm '“h3?p? øµÛ¿ôƒñ"EÀ»£mÿÎö" ôêÍñÞ‚N"·å5†}¼\à¿­E>7ì—€€ÆÐ¦§ýc˜À*»iQßÎð hŽES+ý{NÀJ÷ô·‹;¡Û†o À8~ãáºWûÕ„VG>$wôÿ?ô{5Q%4GNÄ{ñsÒ“WÚôÐV~C×1|äDMç¤ÁÇ"+é}+š¡ '‘5ü½‚¿W{}ï°øß«÷¡´•€€ÆH¿ší«÷û¿­Fô+÷¹{Ö76—úù¾ÍÅ¿F7½Ÿ¿Wí}ï ‚€¶ðÐ(MŒÝþ¤'T0vË¢ƒ—­mí¢-ú›<ÅãP Ð-M Ö(ÐV~öåø‰#3Ý߆í{Ö¤ÉHU0ú·5KÂ<ðw½ô^A1@§l4éý‹‰Ýh!?ûrü±Ùü>Xucì6ü;ekÁ­Ÿüàïº÷ Þ¿Ìçß¹×ÚGÀ@£lmiÅÑ…±ÛlðïÑWðwoñüþ.À²ÿ(Ò+½[6õþEÀ@ûøhUyÝ;¿Gÿ®f)6§,\“BXºÅ·C`ü4Žê©öÙÖ¶ßaWlo/>H¸Àâ a9טädÍvƒNØ4á5vKÀÀ¾Í:\Ö¦g/¿ƒmÇÃÐÒHm7¬j^1@74iòf¯y´•€€Æ}èߊ…û³íæ™ð…YR± ‹ÓĉÓHèð°{qÚÿvì]!YW^ùÐ>sM Óý»¡)Áº¶ °Àÿÿk`Ï{}ø»¡‰ó&q müŒ¨ðqð!–•`hâIdßêèðÐ8*§º1fúØ2KÂ?{—TÔìp~#Ì*Å_×Úe×LRÀAñ ÊÖvóªåUðÐ6QìͰ_|áëç“‹o‰ÿQ¯ÌŽ›þ…zÿë]éÝEÑ`Õìv´’-Éí•Þeÿvïþ••dI·í?ne¥¿³ü¹>öɧ™Ÿ[›¥ç-^éMÒ&ë³»’× 8 Ãûâü˜Cø•§ß_{º ‹ý2Àë7où‡6¥cGŽ„y¢·Ðn^c¦wôðáðÁ÷iÜq¥'·oÞYõ òþ¥µÿvÒ÷üï½»Þ»|pw=¬¾óðÿ÷ÆOîüÆl~#[Rw¾ù/_÷/`þüÀBøèúüùõ]ü…”?¿ï ½—Ÿxù ø}@ž¿Oû!àÇkLs<ûÌS;&¿×›6ýÛyïµððîFx°ºÝß·~ùÞLÞj%Ëõâ"ø8X~`!üôGýþ^¨hïµj?}ÝI;)àO¥íÏü> ïóS§€ß¿§}ðã5¦9ütéõfÿvîÝzî'ÕùwÞ~Þ™M˜?õÛ¯d¹–,WÓË$ð¿á_ÀìèÁÀXÅ =?\w^¸îï¤z˜½Ííðök÷ÂO¿÷Nø/ÿïáû¯ü"üÝ_¼=ïp?•ž1ùB²üQ²ü4)öºž,“åŒßÀþ ø˜^%Üò¯„âeúõ°ý?ÕÆæ¦ñn9¿C uow;Ðå`5©ÐÿÉ÷n…?ÿ¯‡¿ýîÍôÐëš<øùdù·Ér; ù¯dßî`üŒÊ[è„qåöq%ìï7Ιº8?ì„rþím-äÚn[@ eÖ[Z Wë§¡þ_þÉáÍŸ¬6-ÔçådùvòßH– þ잀€Z;…õq¶A©Ï„=Þûó»–û?ÿÁíðgYµþÃûmýQžK–?ô잀€¾bµu<þ®úõ“‚úá}ÚïÀþ¥ÁþÏþ¦ì¿öWï†ÍvTëO#ú¯kÝ0?3‡b¤×Ü ìÕ?^íû¯ÿu§‚ýª´OÚºçªÉx&ðP2¶mzT¹?»|ìÄ‘ÚmK]ùãÂ…Œ؃µ ƒ”ÝhL]¿àF¤íxn|ÿÞä¹ïÝY[Æ!8,ÿV5?@=?À’é‡éñ w6þvT\O·#}ú ï~è§Uû¿øÑƒ1¬æ?o(†üË&ÞM±|\k\ Ÿ¶æ‰+‹Æí¹Rʉö —öØ¿ž„ûîkGUVó§½ù/ €¾(ŽõDæ/«ºø¶‘˜ñõJFžþ…zÿ ýð}p%½…•ì2J®¤÷õ/“õÙe´’Ý_Øf%[ßÛwrý³¿ûÑÛ>_óTãŽiõþƒÞ‚O{ñÖíÕFÎpúä‰ÞRtÿÑZòoý~ØÜÚ>ðç?zøpxß÷.ñ3/Ïœ9Ž7ì½B:/ÀÍ;«~9^oöõo'mÉóãïÞ ï¼qß/c²o$ËÅo~çËw °ÌTð0½Ñ“ž*èèÇ•ö;õ›÷WW&ØuZàà=\[ïܽ7—p?µ¾¹n&'?6·¶ >À>¤-yþ*éµ/ÜŸÊËÉrM_~`Ù ø¨—%ñƒ/ÄÕÞ;•m³ ã¨f'ùõ(’ðÌÁí÷Þ›ûsn'¯¾°wi¸¿ÄéîÕóAÈ,9?ÀÒÚeÒM¾/oÏ3ò Qñ©â½??SI[óÌ«r¿þ¹UñìÖë?z§×o?mÏî¥!:ùî9C,#?yä^œŸ%/ÎÆmF£ú(ª[;ù9×âú}0{.øùù%ìÂO~ðvø³?yÍ@ìO:ùî5!?°ŒüìÎ}ú{}ö{½ö£ÝïWª°/iõ|Ú‘®k-0­4ÜÿÏßþ‰˜4俪]°lüìZ\è¹?\YÎç£ò]½5…/ÔÆÿò}€ýYÛØ\ø1¤í´éØÙÍ7î ÷gï¹ '?°düì(ž"zÿÙ…h÷`¼Gëë8Ž&œhh²Û·„?ù÷k Foâ]Ã, ?ãU'ÍÍnG…Tþðá•‘Éuë÷Ý÷´!¿““­ml4â8šr¢ ‰Ö×¶ÂüÖ_‡ußv:@Ï'UüW ° üŒUŒä㺰?YN>qlìã«|4¶b_s€ýJÛâ¤íqš )'šF¸?W/'!ÿEÃt€€™ˆÿÙi£Â•¸²€=kJ¸ß´ch’?ÿÓáÎ; ÄüüÛ$ä?g€.ðP/w#ž˜ÈGÅí&ˆ§}j¦Ò´ªùGëªøŠ~òƒ·ÃOxË@ÌßU“î]&à`×jÃùht›AÏþ À¾¥-zšdk[?@.T÷Ïÿô5±Ï%ËÃt•€€½Ë’ûR¯þ‘5ÌCÓÚâ4í„À"ý§?þ;}÷ë IÿK†è"?ÀÒŠæû4ñ˜ëÌÄÆæf£Žg½aǰ(ñŸë»ß W´êºHÀ@£ÄAý?À^lÇÍúë¹½í¯9@Úšç/¿û Ñ §“å’aºFÀÀ‹+—ÌV«å7Tðè»ß<TñŸ3 @—ø–Lõ—Y™®b4.]0[M¬–oÚ7 æí'?x;Ü|ã®hžË†è?ÀRš]¿eE(Y_ÛÒš§¹^LªøÏ +üÐrk<®Gë~9ÀRúá÷ß ÷ï­ˆæºb€®ð°/‡2I«÷øý_ˆf{.©â¿`€.ð°¿’Y6ô€–K«÷7Öµ±l †è?ÀŒüô‡· B;èÅt‚€8››X*?ùÁÛzï·ËC´€8Ûql€¥¢z¿u^NªøÏ Íü¸(èÓ@·¥•û7߸k Úç‚!ÚLÀÀܘ€®úá÷iÚé‚!ÚLÀÀüLÙ©ÁyÚæç?½mÚéù¤MÏYô•€`Éô2ööD^}çÁOX…±a¿p€¶¹}ëÉuÛí%C´•€`ÙÄSÒO'ʰÜôÞo½ †h+?»Õ÷Òó{‡ÿ­< :I{žÖKÛôœ1 @Eq`î’7Oç“‹o‰ÿQ¯„èé_ø¨÷¿Ð¯´\é__‰Ò°>YV²Ð>ùÏJv=½ÞÛgÏ—,Ÿý‡ ñÑxä[éš^'žxx;T®Çaôvþ#ˆxªøçÑ}­Û:âEC´‘€€±ªµùÅP¿´2ÊÖÅ5;ˆÆí-zòOøÀ´¶Þ ùéÞƒGþ1Pëî-ï»"™+îœQÚFÀ° &…ìS<. ÑLž¾Tõ_w² ÆƒµáW¤ó?\_óo€Z*ø;åŒ!ÚFÀ°Df÷‚új¿¨zú ûìãND•ëiåþõÅ÷4MûÿkÓ@µ›¡;ΠmüìN)…ïß8rèPéþh/»ËZý¼¶Þœj¨&œh YVß~hX(?{ /¢,èÏkôã⥫Q¨Y9ÖúfM5Ô‚úô<ÚðÕkè¸ó†h?;êuã‰'oЋëóÖ=Õ‡¼<~ñ茻M Õ76}õ€²û«¾å Àb ø:$Þ±º=®]Ç{/‹¿ýöýÒír~4˜X7²hRå066GûÞGÑbÆ6íÃ¥÷ˆëæi`±üôL“ñÇÕyØ>©8¿øÀRמxâ¦[ÛÛû:ñp­kÓ4‡€X”† ¡¦ Õ{ù~ò¯deõµzòÎ;u-ù·GgæÝÜn^5TzÒè¬s†h?°ßüΗo…Å‹§X7¸]è“^ ·:T®æ¯¶áÓV'š0ÑîúfóþÍ-_ÁšCÀ°¤zÑz¼Ó»ìáUWÄÙÚxÜ”moÇ3?tÚuC´€€ñê2öJ.ûÖÃÚÇÅcÖ›Ô7*lÕ?ÅvÖ¢§·Ÿ†ôâ7Ñ.Ð$~€®Ú1ê‹è ­wŠóèNµß¨tQó踿ûxƒ3i˜žûQäw @#ݽõÈ °P~€eUê“?¢ÇÓî#Êzðç«â)ž¯øñt‚¢ýkþÝ!àèªh÷ÕÁ?z°1¾Ç¥§Š¦<[0Ý¡Å~³=~€eTIÉã8Þ!YÆÞÿèÁzíæÅí£AëžjØþ›mX|¬ö<c øEzÍ,B?aÏç­Íóö¸p%.n¯O·×µâ)îgìöqÃIÛ0 àé†!X°ºJþž¨ÊG5…ÂÉ€ÌÆ£ÍÚÝæÓ O+úgsÜËHÀÐay€>®‚>÷ˆj‚_¬úGw°±¶5²—(+Æò¢ògŽÊ'&ý\:÷øº®ÐpgÛ×åã½ü½rÇ cN<ú xê2úb²?|öì”A?ØŸðHê ø–E42¥m_žâW¶­Þ ù ¹}ë~eŸÕ]Æcv›5ñ‰FŸ¸¼mTó­€å&àéŽ!˜¿A—B`>œç¶2ón(öå/Ü«ýãì?G.?Ѹ¯ ¤UûÑð9òÇÇ59N½y:áÑúÆ\–õÍMƒ ¨Íõ-ƒÐ-× Ð6~À›§ŽÙ¹Ð=êQ¯EΤÅ¥‡õ/ öà‡7ÊÊ—ÑH#žhäú°ˆ?*uõ©k¸¯– ÒÀýço¿nÞYËòËwï„wîÞ3ðÀ¹¿ºnºåŽ!ÚFÀÐeñt›ôûìÇýn=…jú¨º›ììÁ ?ë®óèáÎ’ñ`ûþƒ£ÑŒ¸a¤ø³ü}¿y{µw9O÷­…Û÷îûÐI~€.‹ö·A ›[Úh³uÿΚA`áüK,.\–ŠæÓjþb„^ÈcÅû…u[[!Ú.ï»ÞÇÃëù>¢AÚ?ÜrRX_jÝ@+¥ázZI¿H«÷øE3¥=O']3@Ûøož:®>/Ä÷•bʸ0“n\*áóÕå~üÙõG6kžeòÄ;q]÷}í´ÏõŇ`é †E}ƒè&ü4€` ¤A|\¬¦/DçqåÊ @Ï[åÄa¤7®µ¯¾ó ZY ¥G#R,É9†¸fßqõñuëh´EWïçšp¢èÐß6ü4€€`É”‚ú|ÒÜ8Î[ä{ï’ÿ¸PñÖe·£þºÛï< G>QT¾Œ Íõ£ìJT ûÕætOÚžg}s³Çò`Mµ-0;«o?4óÍï|ùšQÚFÀ,ÒuCp0¦é@wÚ‰‘}(ùùŽzÁ¥œ>Î×e;I¯ö&Ú=|dò“æaƒ‰v‹_˜2éwB ùÖ66s,*øYÑž€¦ð “TGÜ1 ‹R,ãJínªíxâÁBqÍH žt¢Ýµ¥g)N´[|ÌØ‰v£‘£ ¥Õúï´Î£õõ†φ_ °oÚótÒª!ÚHÀ°&ÅâÅ ¿0nékq͆qq“ìòÁ½rþP3Ñn±é4z"!.qL´ Ðv›[ ;žM¿`ß´çé¤ë†h#?°h¯‚ù)O´[Ï )|©ñ±Y²<&öá¿u?>t¨ø RJŸÖéGÙí¨˜îަT­ÞÈD»¢~€f[oX ¾¹µí—움€¦ð‹vÇÌG\ŽÉCµsNyöÝl}¥¬¿8ÿnœO´[èÃgÜD»aØ]gðm€AПoZéÃâÑÅÐxë ¬–_WÁìÓæÆvÒšÒß’ºf€6ðtÔ¤‰v‹Aý0¥Ïï+¦øqv»R6ß›|wXŸ{ô`=lWÚ‘æ}øKÇ3hÕBþrþhó×Ò¦ ù¶·ãÆ“=À~©Þ IüÀ¢]3‹ô¼ï_Åü#í–f½Í_éÃïöÑ>üuO=ØG¨ïÃgÇõ/Æý½] ûim£yÚnDZ_ °/wü]uÝm$àXõx\Zß/·—Y€?ìÞ3œa·4ÉnÖ‡?uë­÷ÊmzÒ{‹çòÊÿx´”ÿùââEa‡ñäÛ0ÁæÖ–AöLgÝ1@ øE»næ«<Ñn!y¯Tâ÷î­¦ÿaö÷/ã‘êþwo=G}â¨Ò‡?*ué´ç)Mì¢t`*÷Ø í{þû‘ôß¿¿ºn |6h ?°hw ÁüÄ¥^û…\>îGõQœUô.ð„¿øèbùþ ÝNÿúÖÆVò¡gmä¹Ë}ø+§¢a« òy†áv“Úôô¶öpÀÞ}ã¾Aè¨o~çË>›­$àí†!88¥Î5µéø°ÝN>ïmÞû¾®u¾ÝA+þ¬Œ?oÅóîÍûáð¡CåíBùq¥ ý¸zïèc&µé‰k7€ÙÒž§³^5@[ ø…Jª$n…9‰Æõá†û! ûðï ¥^üÃjþA«üFö°·ßLûð.=G\÷äyþRkžxpC›šDgÝ1@[ ø&xÍÌW¹æGÅæúƒ ‡m|B¹-O\©è/ô×ô`=Ä›5O<®©j?ªûÓµé)v €Y»g­×ƒŸNºf€¶ðMpÃÌOµÿ ï}Wî‹ UûýGæqeÃ} ïY}ûÁHu}¹¶.ßG)¼¯OòëOL¨âààÝ|ížAð™ qü€7S·Skú¸Ð‡+÷ã,åôäó>qÿ$@ygY)}Þ|}5;rdp×hþ¨Ð–§èsúxÚ×µé©ßc¶VØÀÐßgR€&ðÞL-™¨r#ô ÙzWA_Ø`xâ ØÖ'o¿“Ü~ïî£*mzâ¨|¥§*óÑh Ÿ(LÎ[>©`²]ÖÚƒÍpuÝ@t×uC´•€ðfjIÅÅ>ú¥6=i+x¸Q±MOVÉ K^ÅÇ•Ð? äWo=ìUÔW#÷¨r­Úr§ºmÝý“&ÛUÅÀ,½crÝ.[ýæw¾|Ç0m%àšÀ›©9‹GºèÛôäòå6=¡4áníý…½õþ›¬ÌÛô [ñd}ø‹·³+Q)ìïŸrˆ†_1(4ôÙy²]UüÌÒÍw Bw]7@› ø…Kª%®…ƒU?±íèíAû›‘6=qù¢Xá ÛTªøïÕ´é©ÀH]þ°4?Ä£”4òs¨â`Æ´çé¼ë†h3?Я‚ù«-tŸ¢MOé±Y ŸWóWöo½õúÝRØçù… ¿xѫլŠK)~9ÀWÅÀÁ{ãGw B·]7@› ø¦¸aæ«Ø¦'ïó¥Ú¦§nÃx°Ä…~þq©¯zýí7ïõÚôdOB¾ÿÂõjÖ?¼MúBÝ¥“~Íì“þû>‹4™€hŠk†à`MÕ¦'®´é)–åÇÃ>ýq–è[õ ÛöÄ¥Òþ8<|¸¼»6ùØòcˆ GS¼ÕøŽUüA«ö. ÷Ó=t—–±@Û ø¦¸a#®öÙÏV–+üãR•qó¸0ùnˆ —…*þ7^»Ž:²5ƒÿåè=*¬‹{á}^Ý_ªò/üà‘¥•y¨¯UûñÓWo„n{Õm'àšâ†!˜¿Ñ6=Å^úÑÈ6ù†ƒ~ü!ä%ýå=¡tg¸}ë~X¿¿Uóü!{¦h4ìÅýDÃÞý•3£UüQ¶Þ„»ìÝÍ×î©Þï¾ë†h;?о9Ûôä¹y²Ñ`}.P\8Ö(*žÈ¢ýh´gy?…çòO`îÝ' `Ò¶ tOú÷}‘­³ÒçöÓoüèŽêýåqÝ] àšæC°8;N¶[é‘_œ€wPÁ_í‘_xT>'oZŲÊþ¨’¸GaЯ§\Å?¸=Ú’§® ϸV=ù–BþùI«÷›Ð³|õþ}¿ €jÂßw¯1ÝVï¿ùcs(,‘k†è?Ð4× Á"Túä f¤†ûý*þȯ„ѯd)q“Rêõ«øï¾ùhäa#½ø+ÇXl¿3¦YOÍO3Úª§úcr°î?zÔŒí[Û½“ tG:×Jú÷Ýk ³ð³¤5Oò³V“oß0 @ø¦¹fæcÜd»q)Ä­âß.µá©Vñ+ù{ ýü ­z~ñÓ¤ÿ˜6:ÅUý ýÊ ˆA[žPZ—øÑ¸V=Á¤»‹’†/Ž€ƒð`­9­qšrB›½IÛò¼¡zßçN€ðÞh‘Ù}\èË?Hñó̾¸.; P þ·6·Ã[?¹7|ª¨|Ò¡WÅ_i­ßï¿?zˆÃëqÛª'„‘ohÕsðÒÞ÷ÛqsN§<\×# KœDfV~ôÝ›ÁçN€Vð’|MòNrñš‘˜ýVñ6.VòoÇ…ð?«Þ/†û…ÿ—?[ Ûëq¹6?*Q4Ø>Šê&ÒÐGÓÃØ(ªüÔBþƒÓ´°#m¡°½íû]°Ñ°“È鱤ÇDû¼óÆý°úöC±\® +¢8ö!h–/¾ðõ+ÉÅËFbN/•67yä ºàZÛDYoü•þe´’WÙ/“e%Ý$*ÝòËп/îï&œyêDxöÓïëŸ4ˆG$„lšÞÁÝ•…ûË÷†A{ ÂŠ0øª@z …×Àj fã±cGò;r¤“þ²{Ï>óÔÂá­Û«þýtÀ3gN‡ãG n§Áìê{zß:š‡•äðÔc•Ž!õúÍ[~9-9yüXҪǷÅÚ$í¹ýüY¯EK#í¿Æ0]¡‚h¢«†`~öRÅ?ÎóêýRïýa ?èÓ_lÕÊUüwÞyî¿“}8Ï'ÙêÃöaýýèd¹ÑÈõ¸¸Ë0ò•IwUòŒ­­æMT'œŠÒPÿ[ï†{öþ>ÌcICé›wVÁûÔÄjùÍ-´¶Í?º#Ü_>× Ð%~À.*¦ëŪý÷³{‡¡~\nÍŠÛÆ¥°ÿÆn…CñèKRž¿Gƒž;uñþ?Ê?§ÿ`­kU4Ü»wß[X›—wîÞ ÖtÜ«M'‘Ù§ûwÖÂÏþæ¶X>W Ð%~ q²>ü¯‰ùÙmÿ0£Ã`.ÝbЗÛíÄÃòþþcBá±qÿ«Ñ·~v?yQŠ¢êq…Ò‰„TÖù'dý!_—ߊ' Š„üËlõþƒ…Ÿˆ|÷Þ=¿XŸ~ÿƒ°œ® Kü€7]Ô˜\ÅßùGý¸Ò®§<án]«žxððŸÿäÝä»ö“ލX¾esD¥4¾xÔ#í|ââ Cy[!!?Àò¹ÿèÑÂ!­Bתæï¯šXw9½–”Ý0 @—ø¦ºjækš*þA>6+õáGÚóÛôäÕÿÕuùÅßýÅÛáÈáÃ5ÇÓ7Úž'ž¸Íð|Àè£}ú{“íö¯ ù–Gª7¥ÅË{ù…À¥=÷ö×ïŸ3:AÀ4RRUq-¹X5‹4ZÅß ¼‹Mõ³‹íÒ Bx_쵿—'ê-Þ­zïîZx7iÕEã©vòÝb«ž1?I£høe„@ȰŒ¬5§j>íÛ¾¨y`ýè»7{-"YJ× Ð5~ É®‚ùÚ¹Š¿\3? ç£ò„»¥V=£Õüq>Io(| {ÜOx+¬lŒ‹Õã¼COÖo?kÕSJâ‡ýøËéü°7Ð^B~A?@·¬5lrÛ‡kë~)0Zó,·¤ÌgL sü@“]3‹6¦Š?_Dž˸p`4ÐÏ{öÿP:q0¬üÿq¡UOõxJóì–î—®VçÚ­n0.ä7ñnÝ®h§dbݦUÌ?ZðÃAÓšgé}Ë]$àšìª!˜¿iªøKf}qÂÝR5¾mµÃ~üÙ8{‚{wÖÂ?¼Vj{õD¥*þÒ=QùÑÈ£ÊéþhÈ_|ähȯe@7¬'Ó4e>誴%Ïßü/¿Ôšg¹]3@ øÆJ¾>y'¨²h€aÿ0ÓïGÝÕ w‡“ðÆÃÊüxXÙ?hÍ“öãßÞ®| ZöÇáÍ×ï†;¿x8Ò??šRGž<¼‹¹ÿhWþÒšÚô™zûÓ— Sš¦§}øƒóã¤ïþýÕ5±Ü® ‹ü€7aŒ¨«â+­zJ–ª÷‹~¡UÏv\nÙ“/Ûq¡'(œ(ˆÃ¤ÿ£w·jŽpÌdº…ÞûQ4Ün!ÿØôåèa:,—Ÿ¾z+¼óÆ}±Ü^M Èn ‹ü@Ó]5ÍPÊôãBk €‘¶<¡XÍ_üo¶É3œ¸·ÿ¬?¸þfˆåÏ‹Gªøû7Š[]…ü¡¸—hx¾üíróµ{½‰uñ¹Ò]%àM›žÅ{pÜ„»Y«ž¼ÛA¡O±UÏHþÂD¼ùó¶ëéß÷7ß}3™q¥ðÔ£õóý‚ýºJ¯ÿiCþº6=ÕÉwó ¿Ø—?ŠDýMr?™×éGIk~ Ãü€7cŒµû w‡·ýøC9̳ô¾ò—OăûÒu›[á¯þó/B¼—ާTÅŸm›‡ÿÕ0ª?méS>±1¼>RÍǪù" ÷ÿòOÞ0¤^K Ç® «ü@\5MQ?áîh«ž0¨Ô¯«Ø%þ•>ý…jþPèËŸ.›ëÛáÆ_½ެh¥ô>ʪí+G>)äñ˜]×.PÍÐD›ÛáÇövï|žºNÀ4^Ö¦çFb1vœpw°:´æ†üqé°©úÈt»;„üÅV>ÅÇT¯Ž¶ì)î±\Í_ÝBÐ0{iåþÍ×îª. ëü@›\1ÍÒ´ã‘uy?þŠ“î†Roý8ÄcCþb…È[ôäç Â`YÈ3y1뿜EÕô>Ê/¦ù£ÒPþ@!¬ßm5µmOÝ>Ø»4ÜK¸Ï¨W“o‚ß0 @× øÖÈz'¾j$g´UÏh?þj5\ æ‹“ïÖ‡ü¡vBÞÞííÑ ?m×óƒÿü˰ù(.õóÏsöaÖ¿CÈ_øYª!ï²Ð²§4&ar5ÿ¡‚~€YK'ÔýázK¸Ï8W ° ü@Û\6ÍëÇ_œt·îù+ÿÅDŽѓéòðþzøÁùeˆ×êÏ@”Cþ¨´>„rµ~}È_ÙYy“BŸýqÕüãƒ~=úv/ ÷ÿêOÞ·~ñžÁ`œ«†X~ oÒL¶»@ãªøëûñgÉãòõBþíü¤@ˆË߈ãAoÿáó„°±±þ: ùß»µV=°aÈ…PéÝ3à¹UîË_ß²'uAýä ?„Ñ _Ø0^î¿wgÍ`0η´ç–…€h•äMÚ cávò®ÄÅV=“Cþôúvá¾auÿp²Þx»p q?äÿñ÷ßnmÔ`‡,Xû!ý˜XÅ_.ã ?i]Ëž±'k¦ ú…ýõî'¡þŸýûׄûìÄgF`iø6ºlo§¿¿Q(…üqöÀ©BþÁㇽøóç+-{Jóü&×ÿöÕ·Â/ÿönù8 Ç…éCþbÑÿàv©OOm/Ÿ ­wÆýÓ„ý`Y¥áþ_&•ûi?L°š†]1 À²ð­c²Ý&‹Ê“îrìr¸?EÈ¿ûíׄüå^þ¥3 =¿|ýnòß+…æÅV=Ñè,¼5 zú'ª}ù‡W ' *íÏ?:Vå ¿¾ª?T¶PÝ,£›ÉDº×ÿãÏ…ûLãŠ!–‰€h«Ë†`ñF«øKµú¥?ÞCÈâBȆ!©‚?.‡þÅ ÿ—¯¯†·~t·š¿ýaÿÄžüQTÛ~'ùGZúÔUØ)èß¹ª¿¸/ÕýÀ²xãÇ«áGß½i ðY F×õXh/¾ðõ;ÉÅi#Ñ€“šd¹>G¥ûãÂõ(Í—y¨=f]è_FÙºü¾|_Åç‰ÿé_9uúx8ûé÷‡CÇ -p²žüq1á¯t*ÿ@q6IoÝ•¹¢Ñm*çÊ QíÞ ?Má0&¿n×…ü^ééŠgŸyjáÇðÖíÕ°¶±á—0iµþßýÙÛáÖ/Þ3Lë•äßç °LTðmvÙ4ô“îF¡fÞºJþ0œhw¸®Øƒ?TZöT.ð˜?ýϽՇá/þôçáÎÏöNûöGcÊ÷G‚ò¨Ò—¿²Ñà¾Â‰‹IûVß×EòuUý;Wö‡‘­G÷Ыo? ö^î³[W °lü€7oÌÄnCþA¯ýìÎRÈ?è¿_˜twög=÷óv>…uùv!ßW(tíI–ŸþàVøÑ¹¶mç›ÔñÈE! =ü«÷ Ãú¸æ¡fûüFÃ÷šx~8ëpØKØ—÷&ð)­Ú¿ñýwú“é®ovÃäºÀRð­•¼y»‘\|ÃH4ÛN!\éÉ_ íC„ù½M¶‹÷‡þž·‡•þ! ïËŸ³˜³§Ï{oõQø‹ÿù½jþx«¤.”Bþ¸ò[ Å5I±šäL@m¡ò1ÖFïQ!–ßCØ?úˆáó û€&H«ö¿ŸL¤û‹Ý1ìÅC,#?àM33®=üÎíz a~ˆ U÷ƒG…í^UÔ‡“ê†â„¼Q¶Â„»ƒ½29o©µ~ᄌ×>§œ?õáSáÿz:¬] ãfÐ-ïqåŽÁ„½ƒ‰{Çýü5;ŠJƒ3ÒÙ§~^ߺ‰yCÿ,GTݬ0±ð.'èõ¦1É.@÷¼ùãÕðúßÜÖŽ‡ýúVò ï— °ŒTð]pÅ4K}ŽíЮ§·vÐ/¿8©î`ÝHßýþõíRÅ~¡š¿ÅÛú”þÂÛoÜ õ¿¼Þ}ýÁ0þó£ ¥*þr´Þ¿cî‡BËž1†m{¢Bö^™·RÑ?ZÕÛy(WööüðÓöì#Ï0[i;ž¿þŸÞ ?yõ–pŸY¸l€e¥‚脤ŠÿFrñœ‘h؋̔•ü½Âó¼Ní°BÐ*§ÿˆh%„ÕƒuéV¢a ]¬æÃo”*úóíŠEõÉíÇN ýÕ'ÃãO­í›WZõWªürº××üù©ˆÂ^ÇTô=„Ê· ÆÅñŃ._™xœQå—é=‹¦‚ ýÖl†ŸÿÍðË«ƒYy5©Þ?g€e¥‚èŠK† y¦íÉå¹vM%\h¸ß«ÂßöëÏ«ôÕûc«ùËýøãqÇ—Ü~x=üíõ·Âë«›Ãí£úŸ£úS•jì£ÑÉt OUyL?è/í9ÏåkæˆK¬>IuB€hx¥Ø³¿PÕ_ûû+î)Ý6„‰}ýÆIûìÿü·Ã«É$ºÂ}fì²!–™ ~ 3Tñ7øÅfÚžü…ĺ´>oi ÷ûò‡ác¢ÂýÃç¯î+ïÑ+ûk<„§?ôxøè'Ÿ Ñ‘á1î®yhVÁâáýñØ wŃˆ?Ê'Ž¢òYˆ<÷ŸxâdJÕ¯"dc4UE¿j~D?@;½ýÚ½ð“ï¿£ᵤzÿ¬a–™ ~ K.‚fš¶’?”*ù Õöyöäöê…ÊþJïôìÏ—{õGƒgT®§÷¿ýÆ{á{ßþYxó‡«É‡ÒíÚŸ¡æ'aÖ‡‰Éûð®aÓxP“—ÏŽdEã«úÇSõ‰£òÉxºŠþ|[•üÀNÒ`ÿÏÿÃëáo¿{S¸ÏA¹b€e'àºöæÎ÷}jW!ïÆ°=O<èÒ3¼WZö _ ïG'äíÿ…‰}ó“ùúâÙƒÂÙ„7_[ ¯^ûyxówÃÖÚ¤¨Y8ׄüåMJ7‡_`È®õ²÷áõR¢_èmÿ3å$¹#g vú&I'Ðýþÿ¢ì?¼ï[OÜ?µ È @ÀtGòÕÌ;Þà5Û´!ÿ`»Á|³ÅD> úîça~Èüþã‡A}?ÐÏ÷7ô‡¸ö‡Púf@ñxòUo¾~'\¿ö‹ðÆ’Šþ±A4Ò¿òWæÃ­¼†A1þ'WôŒw¨öéw¸Ñè ²A¨†üªø€qÒ`ÿ¯ÿ§7Ã_þÉáÞíG„ƒv9û °Ôü@çÞäUü6)äÏbùÒvq^±Ÿ?>ÿOÖ²'+õójþA€¿SÐ_øV@Vûæõ-åIx+_m(ì§8QTäW÷P÷LùY‚¸æ—56ä–^úèÎ/„¿ùŸÙ öoß|`P˜çg?€¥g’] s’Év/%_1 ªM›‡µü¥Iv wG…êøâ¤¯ƒ‰v‡3îŽLÂÂðñQT¸oÇã*=[7[îS9ÎòYy{mÐ_\Ws@Óv¡É+èóŠúg>|*<þ¾ã½°ÿÈc‡²ÝЯæÏÀü¹ãêÏ_ÞœúÈüâëw%ÐÆ¬/ý\aBÈ_ðçë«ûð3O~€ÅY{°ÞyóPŸ&øXðß0 ~ £Tñ·ìÅhLˆ>¶’¿·¢ÒWvE…À>ª¯ö¡ò€|2Û¬¿ü¸¶6#}Tž°·gܯÞO.O=y<œ~ÿ‰pæéãáø™#õ=y¸1¨©ë¯ ùGÆmºjþüX‹c§ŠŸ¦ðÌ×ý;káîÍGáÖ/Þ wßÕSŸÆP½Pülî9ÐUIÈ#¹xÎH´äiò,°µÛU+î£bõ~5¸¯ž ˜ôvh÷Uüù­êkxùiGFoÇ¿ðC«â§‰ü+¯Ò¿{ëQ¸ùó{ac}Ë ÐDª÷ŠŸË} º* ø/$d$Zô¢´Ç¾ü!Ôúaøˆ]ý#ûªÜW>ªâñ„m†›”‹üãpâäѤ²¿ø{üP8þø‘‘o쪊¿¦bUüÞM0~€ÙJ{é?xw½è¿úÞ[7(4ê}€jö àºL _˜vìy?¾šƒ×´í™ôrò)Âþ¸î8Çõò !L*¸6î7=N9ž„þ…ÇÏ$ýû?‰ÂT½ø Ç~PUüÚô°H~€ýy¸ºÞÛ ÷’@ÿÝ·î ôi#Õû~ ÓTñ·øj·ðféûض=ÙjÐeÓõn÷úéÃô^¾ŸMŽ•Êúw8þP¦BóJ8 ó+ÛIBÿÇOïûgžz,lg9q(9v¨´ÿ§&m€V¦Š_›¬ ÿí{÷Ãúæ¦_tÀÖöVØÜÚîÔÏ´úöÃpäðááϸ¶&!þí·„Õwj¹CÛ©Þ¨Ë|º. ù¯%/‰¾Hí£š¿• ú󜽮}Ï ìÏ&Ý­­ä¯¦ý½;ãÑêúB8^ð'ÿ„q¶¯üõ:*œ(^æAüðv1Ìïÿã§õ¾!л/Ù~»0F8ŽŸ´.k޼·¾0ÏíØN:ýðdâß(kÝS*«ÏOsŒ>kþí€Úvúqéf©z?Û¾Z½?<îú)…½Å`Ÿ^KÂý³†`<üÀ2¹ú_ï¤åÆWóÃý*ú )TÇ÷4ü_¾Ý â¿RÝ?\Y¹?.æ¥oÔ,ñHÅ~¹²? õ£¸Äç-†*-†¡{yÐf]½… î° Àd~`id_ëô±Cvúóë»lݪ-| ' û^æ' †ívŠ;¶î)œ0(a¶ ÷æ×¢x4ÔσýâŠáŒcúôÇågJC—Ž#ßýN½÷K{“æ0{¯$Ÿá®€ÉüÀRIÞ ^Iß(‰n™._ž"èσôBU|\l|Ÿñq!‚®G¶}úŸ'”Nú÷÷‚ü0Òd¿X½*•úùdÀ©¼b¿¸‹âÚ•›é +÷Çž'ÙCõ>ÌÀC°3?°Œ.‚î™< oiË0.èïß[3¹m±…Oé1Ű?­þ/l_ך§Ú¥'LhÝ3˜è·R=_ZSé”ûýÖ>•¦E…FüÅêÿüøTï°`_Kгn€ ø¥“¼Q¼ž¾a4Ý´¯ ?„‰UýÅmêBûjeþ éNa£‰þø#YWêWwWìÇŪýòä¼QõIöX½/ó`ÒyÓ.€éøeu)˜p·Ó¦ úë'ã[Õ?è…ÖöÅööÕêÿPs .õßå5­yŠY ôC¡¿~<9Ø/N\m!”ï¨:†½yŠc'É`ö.fó§0…(öáXR_|áë/%ÿƒ‘X’¼‰½â‡éûùv4þ±…&öQvG\û¨Pmxß»o3ñÕ7.<~Â÷6ëV†Ñ'a¤bä9£š}îŽË‡ÕüÞV°éĺç ÀôTðK+yãx5˜pwiL®èÞ nÇ¥Þôã*ûã8®TÈ+ðËÏ—UíÇ“ûí—‚÷ Û”Û÷Tšýg?IõÅêþ‘=ª£âcUïpÀ.€ÝðËîBЪg©Lߣ¿X÷¾sØß¿¯ø‡JKŸBØ^ûüñî–ÁóG5÷Ö´à©Î30e°?‡â¨ÄcÇöè«Ù|iì‚€XjÉÈÉÅe#±|vôïöÛW<¦‡þøþûÓ.ñØ äÛÕÛczìÂòÏ”ͅ`/^ó¹ `oôà½~üד‹çÄ’¿(F»Û¾Üå>š~…~÷3Wד¿x÷¸#mŠŠ·v~¯àíûðù¤øêšaØ=ü} »©êOE…e´´Â°ÿiÂýiKù'Tís<Íþ+ö…ûìÃׄû{'à½V=ד‹¯ R;µÝ§ø‡‡úF<ãƒÿÒ¦\&ì£ög«ü¯|Ì!ì6Øî°é|h— ÀÞiÑP U_4wÓV§¦R§WÜh†}{â1Ï6‹gðÖ€ù×I±ÕUðw*øÊ.ÆÙUe]’—«ü£Êfñ ÿÂäçÚÏÏ3ð-á>Àþ ø ´êaZ{iã3iÒݺ0~¿Ë¬V˜‘ׂâ*€™Ð¢ FÒªçZrñ¢‘`O/®Ñí¸ú’ìÏá-äó&Ö˜ üõ.„þ„O°kÓNx»kU¢?æØà|M¸0;~€ÉÎÉÅE#Á¬Xè?ãã€ôj²\2 ³£EÀI«ž«ÉÅŒsžq…¾—{à7³yϘü“]ý  `®ê*þ÷³À‚ý¡p`öTðì ©â?—\|ÏHìÉ+I¸Þ0Ìž ~€dU&h$vm5Y^2 CÀ0…$俜\|ËHìÊKÉç©;†à`ø¦w!èÇ0­¯&áþ5ÃppôàØýø¦ò­$ÜÉ0,ü»õãÿ’‘+ýæóÃpðü»”„üW’‹o €½Iuõݘ?ÀÞ\L–W @ù³RöÍgæ@À°Y5ÊK¡_@RÝ+†`~L² °&Ýè1©.À¨àØ“îôÚ—^0 ó§‚`’Jþ+ÉÅËFX2iÛÒ³&ÕX ü3¼™½\|ËHK$ ÷Ï ÷GÀ0;Bÿ«©Kñ(k[ À‚øf$«Zy)ô«XºìKÉg «†`±ü3”¼Á½‘\œB~ »þ0ùìsÅ0,ž€`Ʋ¯¨^0@}#ùÌsÙ04ƒ€àd_Uý’‘:$ ÷/€æðì+«h$€î4PDZQ8@_|áëW’‹—ÐRßJÂý— @ó¨à8`Y•Ë7ŒÐB¯sŒ4–€`„ü@ ¥áþùäóÌCÐLZôÌQÒ®çjrñ#4œp TðÌQÖ·R%?Ðdß Â}€VPÁ°&ÞêY‹QZ@?ÀèÉ4p eü "äD¸ÐB~€ò Üh)?À‚ ù€î´˜€ „üÀ|M¸Ðn~€†ÈÞXÕHsð¥ä3ÈEÃÐnQÇF A¾øÂ×/$d$€’†ûW @û øHÈ€Õdy) ÷¯ €nð4TòŸO.®&Ëi£ìSîŸOÂý놠;ü –„üç’‹kAÈìÝ«¡îß1Ýb’]€˪kÎgoÈvë[A¸ÐY*øZ ©ä?ú•üÏ `JßH‚ý † »ü-’ýW’‹—°ƒ/%áþÃÐmZô´HV}óU#Œ‘N¦ûyá>ÀrPÁÐBI%ÿ…äâr0ù.0”ÎÝõRîß0ËAÀÐRIÈ.ôûò ù€o$ËE“é,?@‹™|Hüaì_6 ËGÀÐ&߀¥”öÛO[ò\3ËÉ$»M¾û¥ì >Ð}¯$ËYá>ÀrSÁÐ!Y_þ«ÉòœÑ€ÎúZì_4 ø:&ëË5Y^4Ð)ZòP"àè¨$è¿”\|ÅH@'¤-yÒpÿŽ¡ 'àè°$ä?úÕü§´ÖW“`ÿ’a JÀÐqZö@k½š,’pÿº¡ Ž€`I$AÿÅäâß h…¯%Ë%-y˜DÀ°D’ÿ\rq%Yž7ÐH¯…~Õþ5CÀNV ÀòȾÚ{>ô«€fIß§Ÿî0-üKʼЪöØüK*ûðp6Y¾e4`aTí°g*øH«ù_ ýÞüªù`>^M–‹‚}öCÀ@OòŸI..'ËËFÌjú¾; ö/ öKÀ@IÖ›ÿJ²˜˜„¦ód¹¤IÀÀT²¶=—’匌•öÙOƒýk†€ƒ&à`W’ ÿlèO«m ¥}öÓ`ÿŠ¡`^üìIôŸý ÿ9£ÀKûì_ì°~ö%ëÏ)úX.&Ð`áüì[ÖŸÿb¶˜ˆ€.ìÐ~fFÐ@‡ öh?3Wú¿b4h9Á>%ààÀ$AÿÙäâBPÑ@ûöh<?NëZäµd¹”„úW M'à`ný4Ø+ÉrE°@›øXˆ$ì¿\\J–çŒ ôÐö¯ ÚFÀÀB%AÿùÐú_4ÌIÚ†çJèû7 m%à ² y/%ËKAû†6<tŠ€€FÉúô¿ú}úŸ7"ìÓjèWë_V­@×øh¬$ì?úAÿKAU?»ó­Ð¯Ö¿j(è*?W¨êO—/Æx5 {ëß1t€€VÉzõ¿”,‚>ô'̽´à` øh­¬…Ï…ÐüŸ3"K#õÓJý놀e%à  aÿù ² ‹Òö;ׂPütN¡Oº¼hDZë•ЯԿªýŒðÐiÙ½çC?ìO/µòh®´õεÐõ¯™(&ð°T²V>ç Ëi£°Pß ýPÿšÖ;°;~–šÀ`îÒ¶;×B?пf8`ïüPþér>»4a/ÀÞ¥-w®úp ü°ƒ$ô?úaÿÙìÒĽ£VÃ0ÌO/¯›–€ö ýφ~à>»LÁ?°,^M–aèßæÀü ø`†’àÿLVûW—çŒÐ2i¿ü;!«Èý ÿºa€fðÀ*ÿÏ„þ‰€]ž)\7Ñ/0yKÔµì2½}Çä·Ð~h¨lÂß3ÙÍôò\e“âý¡°‰`ù¤“ÙÞ¨¬»V¸~£pÚÿŽ!€öðÀ’)|‹:i+ÞüÝíxóÿb$:ò%¬ü÷‡WŽþwFFèyøè–ý[ÿ×ÿmòÿ?D7¬„Cÿîê÷þ¿o$ îý2Ð:~h!?´€ZHÀ-$à€ð@ ø …üÐB~h!?´€ZHÀ-ÅqlèŒÿýç¾ö_%ïpÿ¿F¢3þÏÿïþÁÿÉ0À(?òž~>¹ø¶‘茯~ó;_¾d`”=ÐB~h!?´€ZHÀ-$à€ð@ ø …üÐB~h!?´€ZHÀ@g|ñ…¯ŸI.ΉN9›ü^ÏÅqlh­$ü=Ÿ\¤ËKÉò¼é¬×’åZ¾|ó;_¾aHXv~Z% ôÏ…~ Ÿ._0"KëÕ0 û¯–‘€€ÆKBý—B¿Bÿ|²Í”†ý—ƒ zh?& õχ~¥þKÉrڈЯ$Ë•ÐûïšLÀÀLZð\L–çŒ-¥_?'à`&’`ÿ¥Ðöµà¡k^ Ã>w M!à`ÏTë³dTõÐ(~v- öÏ…~¨ÿ²Ñ`Iõzõ'AÿCÀ¢ø˜Zì_ýŠýô¼ú“ò^Ö¾€yð0‘6<0•¼}Ï¥$è¿a8˜?µ’`ÿlû§Lí[¡_ÑÍPpü”dÁþ¥ ¿>ìWÚ§ÿ’ €ƒ"à G°æÕЯè¿b(˜%?À’K‚ýó¡ß†ç FT:!ï%A?³"àXRY°)Y^40W‚~fBÀ°d²V<—ƒŠ}X´4还ýW {!àXzìCc™Œ€=ðt\ìŸ ýŠ}Á>4› €]ðtTì_Ì–ÓFZã¡ôß0L"àè $Ü¿úUû‚}h¯¯¦ÿœýw uü’ûç“‹+ÉòœÑ€NX ýjþˆ€*?@dè^I–tÒkÉrA~Šü-Vè³ÿ£Ká[éÿÏëÏ@JÀÐRúìÃÒJÛö¤½ù/ €å&àhíx€Œ¶=KNÀÐÚñchÛ°¤ü-„ûçC¿jÿ9£ÔHÛö\JBþˆ`yø,«Ú¿’,_0À^ ýjþ놠ûV @3%áþKÉŠܦ—ÎÍñ½äïÇ%CÐ}*øFÕ>0#¯†þ$¼× @7©àhUûÀ =Tótš ~€Pµ0Õü¤‚`ÁTís š ƒTð,HVµ9Y^6À¥Õü/%Õü7 @»©àX€$Ü?Ÿ\\Â}`þÒjþëÉß¡ † ÝTðÌYÖ"ã+ÿÿöî'ω#Ïp¸.@½'@}Ô‹Y#ŸõrVˆõ,O`q‹E¯-V³´8UëYXœ`ŠLqÞ2Ô¥”’2"ŸçóÉVacý232⛑‘*tÀû°Y›ÿF)Ê#à8‘ìÂæEºÏUèa³dÏZ)Êb‰€È/Ò]á>Ð=OƒðÉ ~€#‹¡Ù<~¼V  Wa3›ÿF)ºOÀp$yIžeؼРŸÂ&ä_)@·Y¢àb¸? ›%y„û@ižÄíÏØŽM• ÛÌàhY^ÇúW•*ð>nKöt“€ %1Ø¿Œ‹¸½P  "Â&ä_+@·X¢ 1ÜÆUîõIK­b;7V €nð(‡^«`½} ^i]þ?òdt„%z_Bù›J=b]~€Žðì)†û‹øñR%€JëòcÈ­ç#àh(¿Lw,ÉôÛ§¸¼|à|¬ÁÐ@~™î:÷ÒºüÅvq¢ç!àØQ ±Fa3sÿ©jüíw/ß8Kôì ÏPý]%îõ..×3Q€Óð<"†ûÓøñ›J<ê*l^¾{£Ç'àx@ ÷ñã¥JììCؼ|÷F)ŽËü÷îì%½„|_JÀ™ÁðJ]†ÍËtŸ©ÀÞ>…ÍLþµR‡ü·÷Zó$µ§±])Àqø2á>@ëRÈÿgl_'JÐ>?@øî‚pàX~ò´Ïü@ïåA®Âf¦)Çó*®É¿P€v˜Áôšpà¤Ìäh‘€è-á>ÀY¤¦ ‡³DÐKÂ}€³û%.×3W€ý ø€Þ‰áþeü¸Â}€s³&?À,ÑôJ÷WA¸ÐÖä8€€è›eÜž)@güž—M !?Ð1@šÇç*Ð9«ØF” ?Ð 18Ç×*ÐIiÙ´¥24#ગ×Ý_¨@§=ËOZ°#?ÐËॺ%xCþ‘2ìFÀT-EÓ`Ý}€’,ò“WÄí¦Áï_åÏÑ=ÿþ2nÏ”• ý¿ÿþŸÿºQ Ïü@±ü(…÷ë¸]çÏ›´År}Âóf6¡²ýy˜·§v¥ˆçÍOªô€(–€ŸŽÛ†ù_¶F® 8§.Ã×°„þt˜€@À,†‘‹øñR%è€Oaä¯ò¶®eéúÂ×ÐßM5ºàc<ÇÊô€(V gñãW•à R ¿Ún§\b§#çÞ(lÂþ´ ü9‡«xÞ”è;?P,?'v·eèa ¿Ã¹8 ›°¼Ð—ÓxÏÉ2}'àŠCÅqüøC%8’a3C6¡þ’ìt^^†MÐ?ÊŸOT…#xÏÉ™2}'àŠ•g ÿ©´(½w·…Yú­ž§ã¼ya/mùWïgñcêÜï÷ñœ+ÀWfðµX*A/¤uö_¥åZ„û¤'7âÇ noUC;ÐGfðUˆ3yGñãO•¨Z q-ÅÃ}mÀ0~Ìãö\5ªô)žû—Êð-?Pð]ǧ*QôRÕI ÷ÖJÁíÀ8~,‚e{jó6¶Seø–%z€š,” *i9ž_ÒKU…ûì*+Ë`͕ٞàGfðÕˆ3w/ãÇÿ©DÒKtÓ¬ýk¥à€6a67þž©FѼ\à~ *1Ð[Ä—*Q¬4k?­³?W ZlfñãW•(ÖÏ^ª p7Kôµ™)A±ÞÇm ܧmñ˜JíÂ?Ãæ}”åJ¸p??P•¼¤Ë;•(Jšµÿ¯´GÜn”ƒ#µ ëø1 Öæ/ÍL îg‰ :q9ŽAüø_•(Bšµ?ìsâ6b6kó?UNK³÷GÊp?3ø€êäYüoT¢Ó>†ÍºÚfísŽ6b?†ÁÓ>]7Q€‡ ø€ZÍÃféº'­ƒ>´®6ç”n,ÅmÜ ìª·ùf-°DP­¸ Ç8~ü¡ò.‡ªÐ¥¶"“¿«Dg¤›³O÷<Î ~ Z1Z†ÍïtÃ/Â}:ÚV,âÇÏÁS?]á½;𵛡ݹ¥ú¿ŠÝ\)誼dÔH{qvïóÍYv ખgŽUâlRX:Ê3¤¡ëíÅ:~ Âæ=œ§½˜(Àîü@õòÌ\/Ò<½m¸¿V j/nÂf&ÿ•jœœ¥yò’] 7â‹4—ñã…JœDš=ÖQx›±ˆ/Uâ$ÞÆöbª ͘ÁôÉ$Xzã„ûT!¿úJÝ•p`?~ 7n-½!ä?á>µµ“øñJ%Žæc𞀽 ø€^ò•pŸZÛEòCzOÇX›°??Ð;Bþ£îS{»±Bþ¶½„à0^² ôV|æeüXÅí™jä]^ÆúÐn¤cýw•8Ø«|Ó€˜ÁôÖ­™üïUcoÂ}úÖn,‚™ü‡î´Ä ~€ðeVî<~¼V‰F„ûô¹Í†Í@OT£á>@‹Ìà_fåNÃfVî'ÕØÉá>=o3ÖaóÐGÕØ™p efðÜ’gå.‚uùï“n€LbH·T øû]é|x®¶#/ÔhŸ€à–ì¹Ó‡° ÷×J?´³øñ«JÜÙnŒc»q­í³DÀò’=?Ëol½ fàÂCmÆL›ñƒw¹Ý¸V €ã0ƒàyfî4ôóeš)¬L³öWŽØ©½¸Œ©Íèó@–ò8?Àbh7›Ðîe¾všµ?‹!Ý#·Ãø1ý[›ÿ}Ø„ûÚ €ð4C»QØý5‡vWq›ZŽZi3&¹ÍxZùWõ´ÀøöPiП^†9ÐÁQÚŒin3j[ê+-Ç“žô™Û˧'à8@^†cÊ^º'ÍØŸ öá$mÆ$Ô1£?ûó´YŽà|ü-È/Öœ„MØ_Jp÷.n Á>œ¥Íç6ãEaõô¤O õö"Àù øZ–gõOâ6Ý û¿„sq[šu h/¹­HmƳŽþ5ÓlýeØûk{  ;üG”ÃþQØxçX¯?s«° çV1œ»¶W ³íÅ ·çj/nû¸m;b»±´wºIÀpBùå¼Ã° ý¡ý»i†þ:o+³m¡øöb»¥vã˜/èý¸m7´åðœYžµ{{ ßý|ÛMØ„p[×ÛÍì|èM[1ŠÛeØ„þI“ÙþWùsu«=Y[²  L~(Ð…@yüP ?HÀð@üP ?HÀð@üP ?HÀð@üP ?HÀð@üP ?HÀð@üP ?HÀð@üP ?HÀð@üP ?HÀð@üP ?HÀð@üP ?HÀð@üP ?HÀð@üP ?HÀð@üP ?HÀð@üP ?è§ÏŸ?«´à?ÿã߃ø1ÌÛ oÉó{þ“q»ÉÛz»ý÷ÿü×µjðÀb¨?ŽiÅíiKìǸ­ò¶ŒÿJßð@C1ÔÆiØûONðù.n‹ô¯TØðÀŽb°?гpÿ’;Ç–föÏbп°7?<"ÏØŸ‡óûßKAÿÄŒ~è7?Ü#û—a3cÿuGÿŠïÃ&迱· üp‡¼Ï"´÷âÜcù6!ÿÒ^€~¹PøV ÷gñãÏÐýp?I/ùý#þöô‹üå%yæq{YèWø·‘%{ üþ÷Wq{VøWI/àÇm¯@Ýüô^EáþVZ—$䀺Yƒ€^«0ÜOÒºü«øÝ†ö0ÔKÀ@oUîo¥‘¿#P!?}6u†û[é»-íf¨“€€^Š3Ûgñãe¾êóø]çö8ÔÇKvèxâÇŸ=ûÚÿŠ/Ý]ÚûP?½’פ_ÇíiϾú§¸ bÈã(€:X¢€¾™…þ…ûIzéîÜî€z˜Á@oÄÙûÃøñWÏËðsœÅ¿r4@ùÌà OæJ P ?½_¬û\%³X‹‰2@ùüôÅL Ôj"à zyí}³÷¿zšŸh &à ¦J &P?}0V‚¼ˆ³øÊåðPµbãÇ•¸ÓX  \~j7Vµ€ ø¨ÝH îõ<>áp© P&?ÕÊkÌ?U‰”Ê$à f#%xÔP  L~j6P‚G”Ê$à f#%xÔ@  L~jv©òŽ(”€€š=S‚Çå—…ð%€òø @~ª—¹T f~j5T f~(€ $à€ ø @~(€ $à€ ø @~(€ $à€ ø @~(€ $à€ ø @~(€ $à€ ø @~(€ $à€ ø @~(€ $à€ ø @~(€ $à€ ø @~(€ $à€ ø @~(€ $à€ ø @~(€ $à€ ø @~(€ $à€ ø @~(€ $à€ ø @~(€ $à€ ø @~(€ $à€ ø @~(€ $à€ ø @~(€ $à€ ø @~(€ $à€ ø @~(€ $à€ýôùógUàdþó?þ}?†»þþÿþŸÿZ©ô¾ÝHmÆåŽ¿ý:¶תpg{:ˆƒ~ëMlK×*F%Çý(~ü©;ùÙø«—çÇ]côôÏoâöýµ`åQ]Ÿàû¾Áö×ß·ë¼ïµôí\¹«ì\YÀOÄQþüþ O??9Âÿý‡ÜÙßu:Öù×:ÐÝDø®9 _ÃûôùìHÿ÷W·~¾Î›v(¹MݶŸwõÉŽÑû¾ zVßµ©ÚQºÜÿðïFÀ_÷¹®ã|­¶Ðï¾Ê×…UY—ûbo÷»òà_ʹÇ4þÝøëìŸã6 Ç›H³õ>n açúÓ| ³ïÂÍyÜ–®÷vŽŒÃןOp^,òyq}ìï"àgÛèó6 e…ø‡ >×·7w¡ñ`y˜Û‹ôù¼_{þ§ïun7ÖŽ ÅþØ(ì7k¨´6Tß‹S÷Yü»ð×uM™…MpuêkIk/â6öžµÝ›aŒ–®õËôÿíOÇÛÇIÞN•}¦'žÒ Ðűþüý;/o GÛx®‚Ùf°m7n·i{¦*?\¬×áë£x:³À®ƒïÛ}²>öÇ>…oñ_;28Ò¹&à߀¿üã}6ÁîËŽ´ñó è?u{—ö&_½ ‚~´ßû˜Ï‹EÛ°€¿ðèÖöTUùðÝÀSÇ„¾t ·ÛsÙ뢽+àÛ¶ux«m}¡"wºø/…´Ø¯ðïFÀ_ö±> ›åXºvÃ8õ§–î9꾄ÍÍ”®õ/¾Üä‰û~f/qÆóã2Ÿ/;ô×úÛÅÖ®¹þ:ÜÔ‰þ±NÂí Sç—ZÚa:»c» ^B}l_Çúdù˜ÛOý.9Óù'à߀¿Ü¾ü"tÿ)Û´FÿĤ¹Ö÷ÿ4lf%wùIÀy߯í1œßx63únüõ\ÐSÇu,qJÛYfÛ§Ž %µã t:gwÛnèäB]mëen[Óæ†iûý®mÛ¹Tœ—©¯#à߀¿¼ã;e¿ôWN7nÇúÀ­õ9…õ7~‰û~nïq¢ó#õKX‘ •vQÀ_îÁ: ›@? …sÝpÒ7døqøê{÷Fw.æ©ã±XAÑmì¶}}©'± ûÂHv8?S¿GÀ¿YÇö¢àëΫc¾l²û~˜¯ƒ%fAimþ© ’ùºŸÎÒ2ƒÚEyø$õKpô7dÃmÆe0“´$ÛÀjnVÕ/›7MÏ)Ý(]ä~×µrpÏ@_À¿9}ü´ŸJzÿm<Þ¦öè^mÚ²ð¾Gš9òs„ó#µ)¿üÞÅób²Ï(àïþÁ9›p.¤Býò|y©LØv.^œ²Ó7Ém‡Ð©LÛ™ýstª}½¼Õ/³,b÷¤õžˆâŽ~‘€7þ2®C«Š®A{‡Y=Ýÿ©V¿Wòu„ü´}~,BOÓîÕ. ø»Ýp§¤Y·uôsì6c¾Î$u3°._ž Þõçnc§ÁlýR|Ìý®…v#þnË—¡®pKÈ¿ÛþO5ú½²¯%ä§­ócêÊOßÇóbÜä?ð§’žà] €–M”àî>jO–”ÛÕÎ œûžþÝÛu\ÓË0…tœšµçÊl7¦AØD™¼T’’ÚÚíògè£qbé¦è_–8Z4V‚~Ö&OTÐq^àhâ›'\ü7´³`WÎo¢Å´·—ˆÐI£ØÎB0›Ÿî··©C›Ú[ËŸqN¿y/ÐÒ5Í÷WþýFvñýãOÌõºmLç¾\å~“íþû¢mH÷«jÐÏ{òXbéíFj\×Á¬}êa6?]noS?Í ºàEn+‡JìI_ë‘ñ°ýïüÀ¾çãíþûë ¤£[¦JÐÙ6#-± ÖÚ§NÛÙü3¥ #mî\{KGÛÊ•e=”àÑëÿ¨ÒïuLXp~pŸ¡<ÜÿÜNð×° éè°±t¶£¹›Ù{P³_Óûhà¿õ2]wÅ©Å@ ŽÞnL‚¥¼àÛ—JŽ•‚ÚÜË Ü§„ü@2T‚])Àݪø-¯ìÑnÌ‚—éBRÈÿ‡—JòH›{„ûô—)‡ª6àÏá~0š ìÚn¤Aö¯*­J/•œ+w´¹—A¸B~è·ììZ îVeÀŸg þ„ûÀnmÆe\{OÇkß·»A¸[B~诡ììZ îV]ÀŸÃ}Ëk»¶—a2 ÷ḾX^&‡pîo#•zw=t-à`UüÂ}`NõJÇN&ÝH[ ùµ»Ú]¸»òC¯ • ‘•Ü­š€_¸4l3.ƒ Î!sBþþZhwáA)äŸ*ôÂH hCìÏ‚pؽ͸ Â}8'!?ÛÞEüx¡ð¨ßòä% n#%hd­w+>àσÅ_íJzäF j3.ƒpº@È߯¶w¼ëšø=ž7ce€ªÇ$ÏUbwÿý?ÿe p¢~ƒEzj­u¤WA¸]!äïGÛ;‰¯UK/&*Ti¤|P€ûð, ÛŒË Ü‡.ò×ÝöŽ‚ea_O´P­±4r£÷+2à÷B]ú,>š¸R…ÆmF§º ÷¡›„üu¶½Ãø±T 8ˆê4R‚FÖJp¿â~á>=÷Q ·i@¼ Â}è:!}mï2lÂIàðöq¡ PÍ5r?žªD#7Jp¿¢~á>˜¹Ð°Í¸ Â}(‰¿Ë ¼€6½ˆmãL  %hl¥÷+&àÍæA¸¥y¦­+[ì³¥¶÷¹J@ë~ç×X xÎãæn”à~Eüù¶¹ÝB¯íÆ"~¼T (Ò³|S^Û;‰¯UŽf‘ÇF@™×Étþz­¡øºµ*ܯ󾮂5\ᣎÍÎíÆ<÷¡t/…üŵ½©Ï6W 8ª4&ZXÊ Š5U‚Æ>(ÀÃ:ðßZ?[¸fïïÚnL‚Ù£P‹—Öœ.¦íM}¶…>œDZÊl® P¤±4v£ëlÀ/܇È=Þn¤³wu@]~Í7îèþ5Ê;Oàt^j¡¸±J:gåÍ­”àa]žÁ¿4P„¿Yžçñó0lfõù=žã#eèlû;–Eƒs˜Çóo  PŒ‰ìÅ8à øóš»ÏíøÛL l3.ƒ'~ vK/–ìdû;n®Â¹¤~ÏR ˆëeêÃÈ8ös­ë\ÀŸ[3 ¾J³÷Êpo›q„ûÐ_‚,/–윅öÎê™w•@¦J°O²<®S~üÞúÙð-ƒ¶‡Íƒå¼ /žë°v©ß6 f#Büê 'èôõrLbÜו<®3¾è-íø†Ùû·3eègy)?ÎÛþãÇo*á '让ìm­ëDÀŸ;£ËàoøÞD îm7FñãW•€^z™—ôã|æJ’žpš)tnÌriLwµ<®+3øÓ Ñð­·qöþJîì(‚'~ ï~·$ÅÙÚài°4tÑkí"tNºfšÈ¸¿µ<îì$Zb¾õ!˜…õ¥Ž2­,Iqò~ÛÀõ :m¡Щk¦'Žà»»9kÀoýV¸Ó§¸MbgæF)îl7ÒÀÕ?@’nô-•á¤Á Vè²gùEÀù9ã»;:[ÀkÝ}à[3îm7ÆÁ?À·ž ³NÚ[šºošgç»f[¶R€Ýœsÿ"l^|õ*†ûKe¸³“<;îök~ñ6Çkƒ/ƒëB)ž8_á윃‡[+ÀnÎðÇAâ$~¼P~øF ÷Êp¯e°,p¿…õøjLÌ€’¼pãÎÃo­Y)ÀnNðçY¸s¥‡o÷n7fÁºûÀÃRø¬=^ßmªPc.8ý5óR¤¼“`wç˜Á¿ fáÂVz¡îÏÂý;É£øñ«J;x‘Ÿ¤]3}7(Ò3m"¸fj¥»;iÀo.|ãC܆1Ü×y¹¿Í¸ fÀÍ̽\²Õvx¼$Jo/•NvÍ|­­0Fhàd~‹¼Y¸°ñ6û)Ü¿VŠÍ‚5ŸfÒ¬¹…2´Úe·‰Se€ã21©u+%ØÝ)gð»ØqÛǸ]=°}¬ø{§%y ´ï$‚0À~žÇ6D;ÛN;ì%P¾©Yüptó`bR[®¬¿ÐÌOŸ?>ÅqÌÞï‹´ìLº¯ò¯·Ÿ×‡ÌVÏO€l&£[ŸƒB:Ri­ýy¬ÁÌ!²ÓþNûz­“ ØîzRê°¶8]Ãüe»ú®?v“¯¯¹«ßåX(Û›¾öCóÍÊ?;ùÙò¡{cãøñ‡Jh¯ô·87Îu~=àÏÁì_j]Oy€¸ÊŸës†(¹ã>ÈÒôs—Þõð6n3³íÏy0{¿oÒÓ-×·¶¾{4÷±gnnÛþzpksÓ¨_Ò °‘2ì}]ˆ•Õ/[Ýê›]£_–ßo1¼ÕßJŸ^&YÎ12ècT{Öˆ€¿vq­-lÕ?ãq¸îÑ1”Î9!æãüýk_ ÎSüvH]Ç/[ ÜÜ™OÛ8œ>ðÿ2c?lfíß8| ÂøÛÇ<Ún×§nOòç4U¼ŠÇØBôß*ô¾ ý²Ü¦nû[Ž™ŽþúŽè[6"àovl]ævø™j´7ŽŽÇà¥>®a87šG øóú·¿©s±Òr;Ë´•~=w¾ÆyKüc…yïs½Ÿ½÷ÕZ'¹ºvd•·uW—K¹5+uº÷COg­p>¤s@ÖMïr?cY@ë…Ý¥=Ô¦GÀßìØJc¾—*Ñîu.ƒ“žGéœb>NÀß¿6Ö¹Ñàü8ZÀŸ;ø×Á¬ÈÒ¤0n‘×7ià9 › ïùõZ‡Í•éàý2 n Ö|9r;rSè±8_g¤Ž\Ë u¦9sßl^Z›šÛÑÔ†¦k»åÑ:4ì[@"àoDÀoÜrnÿêêMlý.×/œ]>?Žð/‚»Ù¥H\Ú_‹>­uwÇ 4mÃðõ¥r÷¹›eEt~Ûßéø¤–Û†,k=/òMÁíæ-“Ðb·c}a]ñ.÷ÍVW©íœ¤uæšÝ«YüÚ5×Ê#µi^ª{ÿ¯‡O­\w"àï_[ëÜhp~%à׉*ÆU8.”‚4Þé8tS°,^*âˆÇê$X~¢Dâ±:Tmq!më¬Æ')óaf°vv½z7‰±i#þǧԗH52á£}ïãñ7îá1µr]܉€ß¹ÁçÇÅ‘þà¹Úv~à˜:o#á>x ”Ê^’ûKØÌ®™ô-ÜOR»™ÿHÒ°™ I÷=Ë7g¸¿-h‹ÏÞ?ûGn[¯+m?Ór†éšÿsØL4áÜD%N*Û¿¤¥£úÚ¾æ'ISÛùÖáprÚBhv\³Õ{ˆö×ö þipG»KRÈôOÁ>ï,ÏT¢›ìðõÆàZ9v“–,ºµü„ýÝôk^ІoõáNÞGKÁþ\»ù_7q›j7Oî¹¶v¯¬‚pÿØ–J°¿ÖþÜAœ*i'¤ÁÑ¿òŒÛµrÐa©Íxª ²]ŠgìÆàþòòéºhéžnš)Áí1§ñKî£ic¿k7ãÇ0lžÃyg'Ü?™ôDÛRö׿ þ4X6óëüÒ ‡}|ñ%Ev˜ ,»ãöÁ•r´#/?1 ^ÆÛ5/Í\ý¦=NǨðâ4íì?ÍÚ°ÍL³ù'ÁÚü§2Qxp¬²r}<‰¥åyÓJÀŸÉ/•ó¬¶ËñÌ\)Ä4¸)Øn Q¬faô[Ÿ¿;Jð·‰ÝûÜή•b§v3Ÿ£°y1ÇóÄËváGùÆwj¯…ûúdEhkÿL)Ïêåx(¬Ó<fïwA ›ÿáÆài¤å8òúüéE¼f¦ž_Zz¤ _L”à¨ÞæeÏ´³ÍÚÌÔ¯7FÿpÚqÊ0lfî[Fô4>zzàpüfïŸUšÕôÏ<3J’ŽY³÷Ï'…ËÖ€>“ü¤Dºv¾WN´E½–gïjçU~,ûµ—7ùƨuùçE^Šz/ž “° ÷]Og¡‡kcÿLÏâmÜÌÚ§ÄŽó ¸)xNéÆàÐÐç•C«q0›ÿÜÌâaì08Št^ÿ+/5Ãámæ$l–“C;Ç£LãÇïA¸j®“-8(àÔmÀøe6˜G½)ÔT Î&-ç54k¿;òlþa°Îô9ÍúúÅó¬]ý¸ãôÕFÞkÒz{™ÎÕW*¡om_ 㶈?þ¦'÷Þ¸ ‡ÎàŸ)áI}ÈÆ…RPj:XëõRØô³å¼º)¯Í? ›'³8½çy½Ý>ÛýGio=ay¼ö2õ…üí{–'nA߯&é¸_7»Ïe¡íØ;à7{ÿäÞ0RiðØë©m—äY)E·åuºSpeÉžó´M}4¶ë[%Ü?M[¹B~í(¿ƒ&µ×ÏTã,>zÒ  =‡ÌàŸ*ßɼKk5[’‡Â;Ñ—Ú³´–ä)H®FiУ'õ²§³W_Øõ­š ÷OÚVZ“¿]c% /c’¸ÍãÎi®íÙ+à·ÌÆI½Ê/ƒÒMt¢OêmG™r@8 Öå?µYŸ¾lž¹H»ýµ…2œ´­Lçì;•hÍó<ƃš¯}©µŠÛkÕ8«ôÄ›k&@‹öÁ? ‚:ƒEhÞnpšsj;æJQ®üÄÖ(¯Niܳpkl—·æþÚÙÚÊIØ,c‰v¯ñ³øñW°$O,¬NЮ}þ‰ÒÕö…˜‹ÔÒ¡NƧ*q’¶Ã‹¸+‘>9¼òŸÆ“žõoFvy+®<-uv©þžxÒ.À}ãQÜÖñÇ_U£3æJЮÆ¼8¦N´ îx¶ÝJ)¨ÈT NÖv¬•¢.9<´Ö´¶ª5y‰}¹vÚݱ2œ½¼ ›ß Êçx¦¦k]Zkü3˜µß%ï¼  }ûÌàŸ(ÛQŠ:jë\âÇs•Ðv°¿¼Öô+•8º§=Y›~dW·bl‰Î´‘kc”V<É7¡ôñGê7]Çí¥jtÎL Ú×(àÔ•€8öñAÛÑyé%!ÿñMzðGvóÁÞxÚ²smä2XÒLû@¯¥Õâv6Ëñxg`÷˜½p$MgðO•ìh&:*ìd_{Ó'mG¿ùOâEžÐPõw´›ò!?UC÷¤±ÊGe8ˆ~%Ž9¶ÁþïÁt]æÚ p$Mþ‰’Å«<ëj$š=sžúé)!ÿITÛßI/´{·7öÏÁ<­MI×4Á~9ÌÞ8¢þür]A]û~Éa ÔÈ û8„û=—¯oUBÛµ‡‘Ý{7ÚÞη+íãaܤãÇgzyîL°_œ™O“ücåj]º‹=W*í|‚Y`Ç20i°Þô±<­8àÚ½{KK¿è·•a67ÃÑNPÏØb·EüñÿÂf}Á~9ÌÞ8²þÔY¯µ]Wñ"7Q*6U‚£xåÅŽlåëÈ{•8ŠZ¯Ñ#»vÿëZ^†î·7ú!Ú Ê—rˆ¸Mólý?ãöRUŠ4S€ãÚuÿX©ZõQMéÇxûÞZÒ‹;LâöAÚoÃò‹Â«‘'lXnq?WÞ—T–|½ôÂÝý •€s^«r¨¿Ž¿ü߸ýÌÖ/Ù³÷Žo×€¢T­I Í£òŽùPG¼uïó’,ð|=ËQ´-áãʾÓÈnÝÛL Šd ³Ÿ§ù† œbÜÖÔO7Õçy¦þ6Ô¦:ÅK}Ó¹2ߣê\\Û3µv6}8Ε UiâD¸Ï­Ÿv+û>C»t/W–F+¶mLûíJ%´tGÊâ6É~§5õÿˆÛë`‚Pmf&6œÆ.3ø'ÊÔšw–× 'ÆJÐOý°“|óø•J´êEeËô íҽ̔ hs%Ð^pz9ÈO/Æ¥—ãÆm·Ïñ_ý·ßÃ&Ð7‘°^bßTû p"?}þüù± óup'½ iîPHG:óã°™…C;^¹1HÃs0/^Bç¼ëØH}kð7“føcßx¦¹´4ฒýŸÎá?íÒü·õ=ÿn·» ãv™~®ŒD?{úmç6jå¼ÙIzŸÃLœÜ}~\=¢Ýh‡u÷ÙK¾™ìØiÏ‹J¾ÇÀ®lÞÇói© UHûыț1É ØGjk§ÊpZü%:ØÑù¥Ü„í˜xê‡}å›Ê¿¨DkmÛ¸‚¯1²'[(A5mbºž.U¢qÛ§ÝššÜÞźAðÒ›6L”€+A+Þz¬•Cå›]©„¶-»´[(AUæJ ÝŽêÊò¢çñÐ þ‘òì­¥yè™±,-Í3SZ2 –¥hC }¢¡ÝØH )®•¡¹OþQ%´ÀQ| &7œÍCÿXy¾ÀÍ”¾ðÔOk<ÖJkr@9W‰ƒ=ÍK•l`76²P‚*-•@»ÅÌq€ó1ƒÿx„tô6ãpï½Ð‘¶å÷À|P‰Þ·qÞÒŒ¶¸N %hd À®òÒœÉ~¡Òå9ègAߌ”à 驟©2p$Ž­·q<}pjLÒ¨S^¦Ç²e»Óv»ŒaÆÊp^µ b;b¦ôŽÝaækåXòK›ß©ÄA^üw¿´ûY*ýË&|™¸)p~þö]å z#Ï5Ü_šù2WŽlÌ\=´­+µ4°÷Y*AÕôÓ›µ{Úà>o-/ Ð ÷üÏ•fo% ‡FJpïìàè¼p·×mÝÀ®kt®¬U¡j+%Ð~KËÙM• ~ø žÖï,±AOi7ö÷Ñ;;8¡y0‹_[ÇC®” n¹¯®ØŸu÷:æÂàµU3% §†J Ý ûò“"s•Ø[©O8êÛín¥½°Ví°·‰‰Ý"àoÏ•‹}”×f}ª{1{Ÿs˜³Wió†ªPµµôÂJ öòƺûÝsWÀoຟ™ÐS#%ÐnP³øµy<èZ za­½ýHã€ú&àϳҞ(Kcé3+e §†J°—OfïsFó`ŸÚ<íô޼`·7n”@û4ò!neè¦ ¸VÌ•?´”"Ïâ_¨DoÚ<“7vóA zÓ®Tag—J½÷奺¹ÿ@ ø[¸Ø™…KÏ=W‚½Ì•Ç`‘ž)Aµn”¾‘Âý‘÷ t›€ÿp % ¯¼lroïÌ€áÜò@í½JìÕöT¡Jk%è•+%xÔÄòuÝ÷}Ào&ns % Ç†J ÝÀ±¨í£7J{Ãý¥2tßßœ6PŽÆ>¸›MÏi7šûhí_º"Ú>ªD½mŸ'­à^7J°môÓ+K”ãBçí .xôÝH ´o©•Ôgº´»v¶R‚^Y+ÁN¼¤úçp ,þÃ,•€žÓn4§³Œc²|–4j”Âý‰2”EÀ¿¿Þ$OŸÅe.ƒY]Ú Š——šû {µµîêvÀo ÚÌR 蹡4¶P\Ó´#Ü(Øí€ßãæÍ,•€ž(vÇf •¨€p p_~™7ö1/i}6P‚ÆíƵ2ÐEùšöQ%ÑwJ÷‹p |ÛüC¥hd¥ Ýhh©8F«2R `¯b¸?W€òmþR4²R0{U»c€Â| ›p¡uðïg¥`±½T\ÛªâÝE@iR¸?îÔEÀßœu´aã‰ììJ èºxm»‰T J©Ÿ7ò>A€úø›s1¤÷⋹‡ªÐÈJ p¬VÙŽT(@šp$ܨÔ6à¿Tй ‚6C»A­VJP•«ìòÓšThð?SŠ­”<õ£Ý Rk%ÐUyŸ:œ+@½.” ±µ€P«fËPŠüŽ™O*¡-ªò:†üë¸é»TèBßÈ'AÐеP˜µT'­ÜBþ±RÔ%Íà(ÃÎÖJ_h7v·R³Õ*P'qû#†ü3¥¨‡%zšY+|1P‚]+ŽÙj]*P _cÈ¿ˆ›¾ @ÌàoæF €†®•Ç,ó2n+!?@ùüͬ”h"¾·C»c¶^Ä@ÉÒºü×1ä*@¹,Ñìã¹|”,­Ë¿ò”KÀßÌZ €®”Ç.· ù'JPqÙ‚U*“Bþß…üåIÿHŽb­êZ zIÈP3øwg¹ ©% P×JÐ[B~€‚øF¼| @›TOÈP?ÐÔ¥ììF pìj %ä(€€àxÖJ€c€‚ ù:NÀÀ}~·,!@w øxÈJÈÐMþÝÝ(ÐCOÂ&ä(@·øww©@O¥CþK¥è?»x·¥2t‡€€]=³øÊÐ ~šxCþ©2œŸ€€¦~‹!ÿHÎKÀ4u£ÚD€°yéî@ÎGÀ4òßÿó_kU€ê]*6`OÂ&ä×8ÿîž+ÐÐH (ÔP ØÑ³¸Í•àî*/#eèÕ¹!§ÞÝ›‹Û«z42Vzn­èŒà­Ëµ@;bpw“n.¤›çq›¥ /nƒø¯þ_Ø<fý{X]žåIc°‹Àý. T÷6Rzn­Œ•€®Šƒ«Ôa~¦Ú@è’[Áÿ6ôOO”l“Ë7³”);ò4O¿Æ§#UhæÂ@uo/\ˆè{g[yÛŒ¡2ÐQc%hä“6Î6Ùþ©oý¸½ ›5ý)pŒ¼p÷Úa°›<) ¸ƒü‡+=ç1Ùf&J€c³ k%€óKïÅËËú¤±yZÎ'½Ì×Ìþ²¼ìùD¨k‡ÀÎJÐ#%hÆ þÃL”€žÓn43VºÆò<{Y)tK^Îgžgöÿ3nïâöIeŠ0Wv0T‚Þ(A3·.†kåhì¹G„è¹k%h䩵äè ±hû &)߈Û$lB¢´„ÏGUé´”­è“ò˜Ø×Üíâ»_{”­¹‰Ðck%ÐfP¼©hû FyVZÂg6A¿Ì£»æ=ýÞ+»~gC%èçJÐÌ…ëÁ&J@;Ì:#ͽ ›®ÈO”Þƒ€¿¥‹ÐcÚ mevŽÓàé¥Jhó n-ÝóKð2Þ®xÒ·±’'C)}Ì.¾kXVJ²—çî"Òc:$Í=óØ0Umô]ÌAæaóBÇwªÑ>j+ ”{GÛÇÜáâŽæÑó=/BJ@O­”`/%à\òì}×-mþ~o꟧õù-Ûs^iÿ¬gßY·»‘T=Nå6€†î ø×ʲ——î2ÓÓΰ6C›AyÆ:N{ùÛ¼ke€jÇ6«¼lÏÕ0V¢“žx¾úq*{¸+à_)ËÞfJ@O™q ÍÀ±×k%€úÅ?õ•þ·ª¡¿z+»»‘±Ø·|KÀß.w™é+í†6ƒBÄcn?žª„¶¸_~Ry··ªa¬D§Œ• ÊqêÐ8uw\Än‚»Ô‡˜)=´RmŽ9mP“¼6ÿ4þø¯¸}RýV}ÌNxšÃ`ê2U‚ý]h\Z÷Òz`ô°ã«Í8¬Í(§µ4H2+b?Ÿ¼sz;ÞY†Íl~“!O?VºìÁ÷¼¶«›*AuÆJ°?ÿqÌ”€z¯Ú º+Žt„÷·Tè¯[Kö¼S“šöàØº¶›÷äæO_ƪ“øñD%ö'à?Žçùà„>ÑnìÏ“?œÂL§Iì//Ù“ÆúoTãd¦= r¯ìêFÒ¸f¬ õœçJp˜‹û.Z—ƒÍÝM¤gVJp™p,yÊ×*¡3“Ôw¬Ë )Èôà{^ÛÕÆÐ=«ŽâÇ3•8ÌÅÿn©<_„46ô©“»ŽUboéÉŸ©2p$s%8ÈNßa³dÿøú0NÒ×l.½lw¬ Å›)Áá øWÊs°×–Ý g´^Ø<ùCÛò£ç*q¥ß»µ.¿ÿ¸úäKïgªEUGƪí¸xäBe6îá;zd©IOþ,”;Léú3S mp9;ÄíƒjÕ´òï·¶‹÷òÜÄÚ¢«¶ä€öèž:`éQçV›q¸3¤E‹àź‡ú˜î÷ƒnÂf&¿ÿxR;¨ürüì?æ¡0fï·ë±€¥D­x-°£GÞ+ÁáOþÐB‡i?^¨ÄÁ–Jn…ü´ëYÍ/Û fñÊòØÝ¯NƒëÅÅ®'ˆRµjnV.•[7ÛòTÌŽ¥¡c¥UóÀ`/¹/ñJ%Z7­ø»­ìÞƒÇÏ3eèìxÕ¾9ÿy¤Y¹+w©¸#{ÌâoÓ Ë{ñHgé2Xw¿mÚ0 ±Ñ"~¼U‰V+þn+»÷`¯ó“Ítk¼º0^=žþ|×ù£rµJÈOíJÐz'e¢ <0xª ­š+І˜©LãÇ•J´æi­k­ËßZ³¨|)§ÇVÞwD wíJ÷R¨´c²Ò1iÝï–÷â{ñ˜Xè,µî*¶a×Ê´hl|ÔªIÅßme÷Ìûìº3^MçêK•8®&ÿR¹Žâyg FŽí#tö„üÜê,Íu–´]@÷åeLÇ*Ñššk¹´{[‘&AÍ•á¬ãÕQüø]%Žoç€?Ïd{¯dGñRÈO¥×íÛ.ï5PŠÞw–&ñãµJ´î“Ap yù•_T¢qQÅ묯ìÞÖ¼ô>»³W‡ÆU§sÑð÷/”쨎úR[ö:¸1x”Îlð¸aß;K“`&ı,ó ;€cŒ‘æÆH­WzŒÜ8FZå}v§¯^†Í*/Õ=‘Fld–ÁšqÇ$ä§FŽéãHzQw?;K©s*Ü?ž™G–úsŸ”á`㊿ÛÒîmÕïBþ“W/ƒpÿä.öøoæÊvTB~ªâÆàQ ùû×YJRáþñx¹.pŠ1ÒM¨û%±§Ró2=K»·uBþãW/Ã&ܦ§µOÀ¿î4›ŸÚÌ•àh„üýé,¥Î¨p_[T O„² ËáF•7Ž£òo¼z„ûgÓ8àÏÌRéŽ.…üB;j±n Ó6ä*Eµ¥Ô î×Ç<Ð8•‰qÒÁÆ7}Óãò·?^áþY]ìùßÍ”î$ž3s©€ƒ'!䯷³”®¹Âýã›+p†qÒL%ò´â11ôñüžÇY>^Mçß*÷Ïj¯€?¯O{¥|'‘Nk¡pñ<¾ô›ò”¢šÎÒ"~üªG—fÎ-”8µ˜¯ÌãÇ•8ȨÒcã&X¦ç˜~µ<öÁãÕqðBÝN¸8à¿)ßÉlC»‰RPpçä:~¼S‰“´j/Šï(]Æm|©'1Ï(€s˜*ÁAÆ·…Ý{Tiy쵕3ö³¦vë Üþ8^³øO)0颹RP0Çïéh/Êí( ÂfÄ Õ8‰OÚ&àœr¾b¦öþžW|l,ãÇG»ø¨¶+gŒ”b§ñêv2ÚoªÑþ÷3%<¹×^¾KÁ“upcP{ÁC¥Ô©\ëžÒÂì} ¦Jpp?ºÚþª=|tÛ'ágJñày6ÌãU“Ñ:æ €ß,þ³Iw§Ý]¤T.˜§o/ÖÞãQDg)8žÚ\ €s³¤éÁF·…Ý{2¿æ%{Jqçxõ¯¸=Uî¹háϘ)ãYlï.ÎÍÎ¥°Žë*¸1xjéüW^#îu”Ò#Žé¼ð2ÝÓ{—Ó]0S‚½*C§þª%œN'=M½6›ÿïñê0Ýô0^í¶ƒ~aÝÙ½›ðŽ”Wñ›%{:×YJmwê°?W“û¤-ºÄ,þƒÔÞŸ^ØÅ'•&Õngóz:V½ÌïõK³ö-!Ûq-ý9Èç•N4³ù)©ãº n ž³ã›–ø+E':K–ä9Ÿ¹Ùû@Í”`ï>ö¨â1ô2xÙî9ló¶eŸ–íÉOÿ§±Òk‡@Z ø…u‘N¼µàŽBL”àlR üGß:)x¬u–Î*ÍÞŸ+Ð5fñdTù÷›ÙÅg“^*û¿q,·¨y ¿Û$n© ú-˜ˆV”‹ÿ, M7¤µ¶ÿÈËp ”W餬­Í²ÎRšµ¿›Yû^Lt^iöþ2µP‚½Œ*ÿ~˰™¨Âù¼ _ƒþaEãÔiö7V-SkžÅï¥Ýñ<ôàî"Å›)ÁÙ¥»ò¿õymÁuš¦aóˆãKÕ8»ôhó\€®ÊùÊ•hlXùqq£Ûi\÷Wž\;)tŒ:ÌÐÒ85ÍØìì¢å?oª¤lt¾¼ýÛúüt°ƒ’.$oT¢z¹¶à :M#8vÎÌì} s%hìI-³ª9.ÌâïŽ4¹ö÷xÜÝä ¶ãŽOy¶þ:l^žûÒ8µ­ü9¬{«¬Ý»ÈÅí×°y±æ\x‡ èÅÚ‚'è8¥`,ÇÓ5b_e¡ @×å>‹qRsÃÊ‹›àæO¥Ü-…åÜ û']˜h›gêÏr¨ÿ¿a3ùì™]V—‹#ü™3¡N78饎U­F”©JtÎíµʱsçév°ÿ\E:G[”d© {ðçAîÖeÛ°?­gÿy9ÜmàÔã3¯§?Ê~z:ÿ&lfê§I¿BýŠýôùóçcP“| Ó}Wq[˜Ñȹå»É.8Ý•^ˆœ^LºVŠ;ßqØ„ÇBýÃñøôðØ…Í '÷s^ó˜~œ³<Øåñ¼øI;¨älÇï0lÂ9vwã‘ë—Þ±q·m›»Î¿N®ó )÷µ —ù—ƒ¼¥_óf¹~zs”€?téàÖ•#Ýý]†xùQ©Ô޾k:nÓ˯om©1^[ÏÙà«Oæà¦àí6d6Á¾exºÞ×QÖ¶’ ¶úunÌ‚`d'~í g?†¯õ5›õûâq|Ù“±H:6ºÀ›‹#þáõ-Êö¢ôðíZýà /‚ÃüÝÖñ—ÿ—;û¿æïžfÞ>vSêiþ}/ó—þûí#WsË4xLƒ‰w*Ñy·_"ÔËc>?ò¸ÈmÈo\E˜õ1ܪ°T‚Fžôa‰Qkñ·m’Ÿ°Yórmgö¯Ògi3Õó]íQÜÆùóA\šå¿›YÎסÆû+ÕÌ,„²|ÌËU­Oå“Ü–ôË’^¬;ìq»š®}f®îÆÌÕ~³`ÿNÌà×Ò‰~¨ezËÆÏÀ}Þ;àOÍ:Cj’Ö [åýºêZ€ýݲ;i;÷zØiFº™£Íöá$x‡GÉRØ¿ ›‚«ÂÅqøzƒÐu̯Ôã8Â-Ç ?ž³ à߉€_;H'ŽãkýÑFÞÄcyfü ô¥Í;jÀŸ›qüøC­«•fø¯óv½ýù3ýo½\$uÚ‡yëj§çmØý7™ömXxYiÒšýi®º>`ÌÀvsüÕám<î¦=oOÓñ,ØÚ`«_çÆ,øw"à×Ò‰ãx6ËIJ›wñXžôèø¸nAŸ?àÏÍ2~¼PïÞÙ¾ü:o!ÿzÝàÏÝúy6þ Ð‹Wº2õrÒÚŒA>NŸ”h -Í3S 2+%Ø]¾¹×ù‰ç¹=ýtqâÿ¿Ix¿Çއ‹ðÔ©JMú–@*´R?ÏÂæg@Ïœ4àÏÃ7^Ç¡ ÷¶©6žþvñÆÒ@¥ÖJÐȨ§ß{j×CÿœzÈï·Jßx)äÐ$xúx؇ &ÈA¯\œñÿ{¼<¾÷Ò‹wï–g"¼Q à“ü΀šéïìî²Çcç›`‚ôÊÙþ<×àÀÒ‹w‡Êpg»1‹W*Üò.¶ Kez`¥;»ìùØ9+–êž8ç þäøÑ2†ü—Êp§qðô°‘ÖÝŸ(Ð×J°³g}/€å±¡?.ÎýÐàÀžÆm¡ w¶7ñc¤Ð{ÖÝú6ºVšä zù{Œ48ðƒqÿXîìØ®ãÇ+•€^ä=dÉRšŽg*uëDÀoF.Ük®÷¶‹øñN% —ÞäuEàNqÂÜH¾Œçñã½J@½º2ƒßŒ\¸ÛÓØ)™)ýíÆ$Xâ úæ]~á6@­”€=¤±óGe€:]té/“gäzé.|kê…»é¨@o¤zSe€Ýå•3ÆÁòØP¥‹®ý…òKw=:_= ^$©£¤s|”Ïy€¾Z+{ŽÓ±3U ¨ÏEGÿ^“`Ù ¸m¦vTÆ*Õîlèín¨?ŒÁÊPNü·^ºkÙ ØHkñëœ<Ün¬‚÷x@­&ùFìêR î;OãÇ•J@=º:ƒß²ð£©<Ún,âÇ•€ª¼ŠçöRþžØ‡+g@5.ºü—˳õFAÈ!Ÿ <ÞnÌâÇ;•€*¼Í7î€öÆÍ7a³<¶¼ *pÑõ¿ —€Àß,Ó³{»‘:*B~(Û»üø0Ðþ¸yL$„*\”ð—̳÷¬­ .¾MÚIðÈ!”ê]>‡€ã›×AÞÅ»(å/*ä‡/FJи^B~(K:g§ÊÇ'oƒò]”ô—Õè@*A£6ã&ù¡$é\ås8ÍØy,s ź(í/,ä§çž*Aã6ã&ù¡Â}8ߨy„üP¤‹ÿÒ9äk÷ÑGñE»#UhÜfÜ!?t™pÎ?vž!?ç¢Ô¿xlt¦ñã]ìØfÜ!?t‘pº3vž!?å¢ä¿|ltfÁr=ôÏP ön3n‚ºD¸Ý;O‚ŠqQú°&?=t©µ7AÈ] Ü€îšÆí½2@÷]Ôð%„ü@Ã6ã&ùᜄûÐñqsÜÆÁL~輋Z¾ˆhÚY B~8á>”3vž!?tÚEM_FÈ4l3nÂ&ä×YÓî@ycç‰q3t×Em_(‡ü?Çí“Ý ìÐfÜè¬ÀI¼‹çÚP¸EŽ›¡£.jüR±ÑY…ͬ\!?Ф³òV%à(Þås ({ÜüF% [.jýb±ÑYëkÍÚi°Ì´ípª7ÏŒ›¡[.jþrB~*u­Gm7ñã_Á@ІWy7GpQûÌëkƒu¨ǵ½ÝXË|Á!Ò¹ósîøÆÍÀ‘\ôå‹Z'ŒŠÜ(ÁIÚŒuüOASSG?¿0nŽè¢O_öÖ:aî.Rú”ÓÔú&lf$xv“:öCíâšD­}.0n¾¸èÛÎˤ†ç£ÝO·gè¬xvò.-‰—;øÐ™¾œ*P!Ç5]7ÿ¢pz}üÒyfá0nW ³V‚³µ³à%BpŸW¹Cë†Za×Å,ašŒ›çñãgãf8­‹¾~ñ|wqÌÊ¥,+%8k»± ››ƒ»°‘:îÿô2Ýn÷wTA­¸“ý­NØß8¦9NŸjeÜ §uÑ÷äY¹î.RŠ•œ½Í¸NËë Bz n`½ý"èãÀn” Wu²Ìåný\×ôr\+ÁNÓç7¿U 8¾ %øæî¢%{è²O:Ýj7&Á’=ô×›ôœÏ·ÑìßuÜyѯöãÚ®¤2ŽiJ¹ÞNƒIµptþ¯Îµ%{踥t®ÝHûdÚAçƒ}¦>tªMÞ.‘m6?´DÀÿxó Ö ã¼Òo® Å´7·^$d6?%·;¿äé^+G–Jp/}¼þ^³×®Õ½j7Vvéý×}/žvL«g¸σ¼ Z!àß­ÑÙ®ö/ƒÎ`nYŒ"ÛÔ¡³ù)ÏvÖþ\) rÕû¿×–¾}ýV¨nZ3nÞæm&ÈÁüÍžt§cö~ù•iî¬|P ho^™µ_m{´¾ÏB zM?ënï+œ`²´[Õ¦²kûµ1†cº¢ãy·Aüñ>+4'àoÞèl»º˜r3³÷«é¬ ƒ5é®ôRùµö v{è½ëlï¯Ñë`Æà]îët®[âGŸòD6œ«êBÚêYØL¬}§°;ÿƒGve‰ŒêڹΠ“nTÿœ^*/äì…™üÀuçÆ>Vø:çÕ¤6‹ ¸k½V†¢ÇÍé%¼“°™X{¥"ð8ÿá Oê ‚e{hWê¤M”¡êΊe{8w“–ãæ÷EГöÇ é‡ÀñO² ²Ûf·ƒéœ÷ÄÆ·JPô1}<¡ç˜®÷øNkGyì¬ ð·tQÍËöüC£CK&ÖÀ®¾ÝØ.ÛóÊ@“KëZZާ¿fJ üØ—f1o}ìÁõÁ¹ÿÕ;cÇ´6ŒBÆÎ£ è‡{ øÛmt®5:´àë`öªÝHÐað2!N0ˆÛ?Òº––ãé÷)X&,1{ŸïÏYpÃ=™ô¤ïe¬¶éwN•¡Šcú:%ð|õýX™[o®OVIiHÀÜFÇÌ\šzgÝý^¶79XA?íKßäuö¯•ƒ° túÜÎXûôý¸xߣ_3‡{˜»á_×þ4†pó¾GãçÛA¿—§×ÕGÿò´y°ôXc?}þüYŽì?ÿãߓ܉|ª<à]^›mÆ ·/UƒC9é82Ðážvf?~ëé×ÿÅÍt87Ò€òEOÕƒ>¾q_§vàuOõy©Hê:¦Çñãž~ýÔ† Mfiõxº ›'ÍïÕ•qÆ­ñs:žØ{Ež¿éšü÷çž·gûx#à?m£3 ‚~„ è¨p\‚}vmc–¡AæUžñ÷—ñcÝÃþú¿ú¶Dd÷u RFéå•Îx×öм²öþAÇÍ0µ aè§íYÃ6e·4þXëfqn×ÓØyÚð;piÅ“tÞþðDYÜ—³øñ«íÞðŸ§Ñ™„Í#ÀÏU£÷¾¬}©3•iÞýÜç]î°Ó¤mIÇK_­4ˆZ’‚Îaüø«G_ùm ²ûþTKöu"um¯qL=ró¾Ññ‘Úüy8Ý ÷wç«äv~doçî‹/ÂfBÚõû,µa&EïNÀß‘v6Ý$¸³ØoòKUaßvcœÛ ½~ú˜;æ Z jŸÁúOá>{œé:[ó»*c_÷uº¦Ö¾¿p¿c…Úׯֆí~<\†¯™Ó¹&Šu!èOuaÿ©l'£-›.÷Õu0©± Ýq°^XÍÒ£HS!-¶ƒ`þ>y6¡þR)h¹-I¾Zg°ZŽ‚CÎtìÔøÒ{ÁXöõ—ýí¥º®í•ñRÝfcÅ.µmoÃ&è¿9sm.Ã×°d,Ýš4möõ¿Û?ÂêfþŸ€¿» qê€MƒÐ®¦Fn&`à”Ô‘7«¿¾ö#µ ƒŽÜޤÁͲ¢~Gü½pšÎÔ'¯i&:7Âý;÷uºÞÖò»™Óïc: j ù-»·ÛØpºû·4¾™viÒRî§ñtú4á¶™í;Vmœ—y_ü©¬»‹uÿIÀ_FÃ<!*•`Ÿs´ƒðõ¡ÇÚʸ¤NÒB8ɉÛa¨cÝ^ƒÚ>7&¡ŽÌ¹ñø¾NýöZB~ËòP[Èï†Õãû{6“ƒJvb6ÿ5¼ › » ü¿íG¬óxauŒ±ªì6'à/¯¡„¯3t50ïLÁÝh7†ÁÓ@%IKð,Ãæ‘FÎÙn¬ n3˜ëÜH}ðyÁç†`l÷}úN¥?µ!Üçö1= å?¥§ {|?§kÔë÷ë¸ëO*çs(õ‘·Ÿ}˜H· óÿÞNÑ¿ŽµNm• λ»Šûe$à/·áa/L‹à¥—t·ÝçÉ8˜Ùß%B}ºØ^\†MÈ_ZÃàŸcŸÃÜf—vMÏöugÍC™è/q_ÏíE*i¿’4nª «®ß¶UääŒúò¶ý¹Äó+õŸÓ¹•꾆ù7gªëM09±QOÀ_Wc>^rŽ‹Ð*æ(·ƒ¿m7Ü$<­V^<'j+f¡œGdßÄsjf¯q¢¾÷"”3»Ì¹qXiQP_É»G¨­ýJܰª«z¨ýšÔ0>Êroo鼿~}ª›iÜy¾¾õó:lýë®=9‘翜ټûq*௳/9–tg3u˜—:ÎTÔf Â×õSÛá&aûÞ‡¯ë®•ƒû‹ÐÝIó€Ðu™SŸã|nÌ?×~Ç,r©Ó°ÎÆkhÔn Ã×À»õáfáU¸õò!7éùÀr6Aÿ)×/³§ûçÆ4Ÿ§<7AÐ{ê}öñ,œ>è·¿9Ö1= ç úS˜» ‚ý&û*ÕëEå_3µuCí\¯ŽëÔþXž§¹ÿ—Î?\ðyÈ(|})È ”³\Çö…"Ûm6AþÚÞ…£´·Û‰AþyûÏJ ÿ¯òç*l^>”ÚŒµÎ%<Ø_˜„Í;<Úî#|̃þ…ë7Î;Ï ï…:ÿ~ÝÚÏÇìï¼ÏmáRÕ9ò1úñÓ#µ]·¥IwóÜŽégï¾f¡?!èûxlŒíõÞÛ×ÁòÀM}ŠçÈeúAÀϾ'^:€†ù—£üyûŸ…p¼PïêÖÏס€7ßÜ4ä-|÷sr¬CrûÂ×Ðþ›6D@­…£ðõÉžAƒŽúöÆü:|]òÊõœšÎíy1rnT»ŸGáë{ŒíÓx]é¿ß>®ßüî˜ÖŽí·?þêÙ×þ%+s{¿×Ï?U¢±«x~¤Ú ø9ùI{¾½ ð³õ€[7´P~Çýn®áÜpnô ³k_f¥/CÇéAø:Ag°Ã²ÎÇ´ö¬ú§zöí¤i §¡BÕÛËPÿ²SÇð6žÓôƒ€:ªçë“ÿ=K™*íAðrÝ}ýý„Ë…Z@÷Üz{_=¿ïi7ª0S‚½­·?ø ›fá¸/ñ.ÁÂaPŸ<{ÿ¥Jìçöòg~蘀¾V‰ð4Öb¢ Õ™)ÁÞ>Üþ…€ºg¢›å动€Ùû[ßþ…€:ÄÚû?xªU™)ÁAÖ·!à€nkïï×<ó›‚å—&›½˜Õí_ø [fJp§…o®ù_°»¾ýüÐq†ó0l–¤áGÏc}¦ÊPì±=‹ÏTâ «ïÿ€ºc¢šYª§<ùÆÕ¯*q°Õ÷ÿ@ÀÝ1V‚¥w,•¡8 %hÅêû à€°<ÏΞÅZÍ•¡˜ã:í+Kóî‡õ÷?tÃH vö:Çceè¶¼^«D+–wýC?tÃP Yä§è ¼o*ÑšÕ]ÿPÀÝ0T‚FÒzü«$_*E·ä}²Ìûˆv,ïú‡~èë”7'äï¦Uð>‰6]Åõ÷oîú~ déÆˆ¿#â~X7«Ú¶¼ï_øàÌb(:R…ƒù»q/âÇK•hÝò¾!àj ä?#áþÑ|ˆËó\ß÷/ü@-„üg Ü?ªÅCÿRÀÔdò•âø„ûG·|è_ ø€ÚlCþ‘RpÿèÞ?´Z…ÍSϧ8{ñØoðÀù­•à¨^¤[²ç0±~ã Ü?•å.¿IÀggêÞ¨ÂÑ= ›%{æfó7k6‹„ÍÒGß|—ß$à€nø 'ñ:lfó•âqy½ýUüñWÕ8™«xÓo½Ëoð@7\+ÁɤÙü¤à:nå¸[¾ ’ŽËçªqR‹]ãOŸ?V.8³¼ŠYÒçñ6n3K%ý},^†MÈüB5Nîc<»þf3ø VJp6iÙžëlOû^ˆ\ƒë Ü?—E“ßl?tD Wo‚—˜žÛǰ™Í¿èÙ±7 ›»>sœÍ§¸ šÞªám~IöQø <³`©èºù\=?&/÷1Q è´ñ±–æÙð@,Õö&ž£ëcÿŸüôùóg¥€Býçü{?ž©tÆU ÷G§ø?2ƒÊ6‰Û'e€NHçâøTÿg~(X^dªÐ £c¯»›€ ÅEüx§pV¿œbÝýÛüP‡iÜ>(œÅ»îÏOý*à€ äeA&ÁzüpjéÆÚôÿÇ?}þüYù ÿùÿÇ?TN"ÝPœrÝýÛÌà€ŠÄ q?~Q 8ºîÎî'~¨L^ ÜKwḦ§~©î÷,Ñ•ŠËõ¬ãÇ3•€ÖýrŽ—ê~Ï ~¨×(l^ ´ç]ÂýDÀ•ÊkƒOÂf­pàp)ÜŸtå/c‰¨\\ªg?Vq{¢°·«îºô2ƒ*—_:R Ø[Zêjܵ¿”€z ‡ü¯TKáþ(/yÕ)~è‰P.‚šèl¸Ÿø G„ü°³N‡û‰€zFÈê|¸Ÿø ‡„üp¯"ÂýDÀ=u+äÿ¤ðE1á~òÓçÏŸí2è±ÿüãÇ*nOTƒ+*ÜOÌà€ž‹æ:~Œ‚™üôWqá~"àn‡üTƒžy ÷Kô‹Ëõ\†Ír=ÏTƒxƒýI©y?ðƒô/âÇK• boc¸?-ù X¢øAžÕüF%¨Ô«ÒÃýÄ ~à^q&ÿ8~,âöD5¨@z‘ô$†û˾Œ€xP ù‡aò[—Ÿ’}ŒÛ8¿Pº –è”ÑQÜÞ©…ú·aMá~b?°³8›?~S ò.¿S¢:~ KöPô2ÝE­_Î=@#·–ìy«tTZoÿŸ5‡û‰üÀÞâlþqØÌæ¢tÄû¸Mb¸Sûð‰!ÿeØ„ü/Tƒ3û%ûó¾|Y?Ð ³ù9£a3kݧ/m ~ 1\]ÆAØ,‘§’Þ1ê[¸Ÿ˜Á´.Îæ…Ílþ§ªÁ‘¤é¦Yû«¾@ÀM úgñãW• eiÖþ¬/Ò}ˆ€8ªòâÇ conky-1.12.2/lua/000077500000000000000000000000001404127277500135125ustar00rootroot00000000000000conky-1.12.2/lua/CMakeLists.txt000066400000000000000000000064371404127277500162640ustar00rootroot00000000000000# # Conky, a system monitor, based on torsmo # # Please see COPYING for details # # Copyright (c) 2005-2021 Brenden Matthews, et. al. (see AUTHORS) All rights # reserved. # # 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 3 of the License, or (at your option) any later # version. # # 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. You should have received a copy of the GNU General Public License # along with this program. If not, see . # include(ToLua) add_definitions(-DTOLUA_RELEASE) if(BUILD_X11) if(BUILD_LUA_CAIRO) include_directories(${luacairo_includes} ${CMAKE_CURRENT_SOURCE_DIR}) # Need the directory for -lSM get_filename_component(X11_SM_LIB_PATH ${X11_SM_LIB} DIRECTORY) link_directories(${X11_SM_LIB_PATH}) # cairo_set_dash() needs this special hack to work properly if you have a # better solution, please let me know wrap_tolua(luacairo_src cairo.pkg libcairo.patch) add_library(conky-cairo SHARED ${luacairo_src}) set_target_properties(conky-cairo PROPERTIES OUTPUT_NAME "cairo") target_link_libraries(conky-cairo ${luacairo_libs} toluapp_lib_static) set(lua_libs ${lua_libs} conky-cairo) print_target_properties(conky-cairo) endif(BUILD_LUA_CAIRO) if(BUILD_LUA_IMLIB2) include_directories(${luaimlib2_includes} ${CMAKE_CURRENT_SOURCE_DIR}) wrap_tolua(luaimlib2_src imlib2.pkg) add_library(conky-imlib2 SHARED ${luaimlib2_src}) set_target_properties(conky-imlib2 PROPERTIES OUTPUT_NAME "imlib2") target_link_libraries(conky-imlib2 ${luaimlib2_libs} toluapp_lib_static) set(lua_libs ${lua_libs} conky-imlib2) print_target_properties(conky-imlib2) endif(BUILD_LUA_IMLIB2) if(BUILD_LUA_RSVG) include_directories(${luarsvg_includes} ${CMAKE_CURRENT_SOURCE_DIR}) wrap_tolua(luarsvg_src rsvg.pkg) add_library(conky-rsvg SHARED ${luarsvg_src}) set_target_properties(conky-rsvg PROPERTIES OUTPUT_NAME "rsvg") target_link_libraries(conky-rsvg ${luarsvg_libs} toluapp_lib_static) set(lua_libs ${lua_libs} conky-rsvg) print_target_properties(conky-rsvg) endif(BUILD_LUA_RSVG) if(BUILD_LUA_CAIRO AND BUILD_LUA_IMLIB2) include_directories(${luacairo_includes} ${luaimlib2_includes} ${CMAKE_CURRENT_SOURCE_DIR}) wrap_tolua(luacairo_imlib2_helper_src cairo_imlib2_helper.pkg) add_library(conky-cairo_imlib2_helper SHARED ${luacairo_imlib2_helper_src}) set_target_properties(conky-cairo_imlib2_helper PROPERTIES OUTPUT_NAME "cairo_imlib2_helper") target_link_libraries(conky-cairo_imlib2_helper ${luacairo_libs} ${luaimlib2_libs} toluapp_lib_static) set(lua_libs ${lua_libs} conky-cairo_imlib2_helper) endif(BUILD_LUA_CAIRO AND BUILD_LUA_IMLIB2) endif(BUILD_X11) install(TARGETS ${lua_libs} LIBRARY DESTINATION ${LIB_INSTALL_DIR}/conky ARCHIVE DESTINATION ${LIB_INSTALL_DIR}/conky) conky-1.12.2/lua/cairo.pkg000066400000000000000000000732031404127277500153170ustar00rootroot00000000000000$#include $#include $#include $#include $#include $#include /* * This code was mostly copied from cairo.h and cairo-xlib.h with comments * removed. The licence noticed below is present for the sake of clarity. */ /* cairo - a vector graphics library with display and print output * * Copyright © 2002 University of Southern California * Copyright © 2005 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it either under the terms of the GNU Lesser General Public * License version 2.1 as published by the Free Software Foundation * (the "LGPL") or, at your option, under the terms of the Mozilla * Public License Version 1.1 (the "MPL"). If you do not alter this * notice, a recipient may use your version of this file under either * the MPL or the LGPL. * * You should have received a copy of the LGPL along with this library * in the file COPYING-LGPL-2.1; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * You should have received a copy of the MPL along with this library * in the file COPYING-MPL-1.1 * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY * OF ANY KIND, either express or implied. See the LGPL or the MPL for * the specific language governing rights and limitations. * * The Original Code is the cairo graphics library. * * The Initial Developer of the Original Code is University of Southern * California. * * Contributor(s): * Carl D. Worth */ typedef enum _cairo_antialias { CAIRO_ANTIALIAS_DEFAULT, CAIRO_ANTIALIAS_NONE, CAIRO_ANTIALIAS_GRAY, CAIRO_ANTIALIAS_SUBPIXEL } cairo_antialias_t; typedef struct _cairo_matrix { double xx; double yx; double xy; double yy; double x0; double y0; static tolua_outside cairo_matrix_t* create_cairo_matrix_t @ create(); static tolua_outside void destroy_cairo_matrix_t @ destroy(cairo_matrix_t *pointer); } cairo_matrix_t; typedef int cairo_bool_t; typedef struct _cairo cairo_t; typedef struct _cairo_surface cairo_surface_t; typedef struct _cairo_pattern cairo_pattern_t; typedef struct _cairo_user_data_key { int unused; } cairo_user_data_key_t; typedef enum _cairo_status { CAIRO_STATUS_SUCCESS = 0, CAIRO_STATUS_NO_MEMORY, CAIRO_STATUS_INVALID_RESTORE, CAIRO_STATUS_INVALID_POP_GROUP, CAIRO_STATUS_NO_CURRENT_POINT, CAIRO_STATUS_INVALID_MATRIX, CAIRO_STATUS_INVALID_STATUS, CAIRO_STATUS_NULL_POINTER, CAIRO_STATUS_INVALID_STRING, CAIRO_STATUS_INVALID_PATH_DATA, CAIRO_STATUS_READ_ERROR, CAIRO_STATUS_WRITE_ERROR, CAIRO_STATUS_SURFACE_FINISHED, CAIRO_STATUS_SURFACE_TYPE_MISMATCH, CAIRO_STATUS_PATTERN_TYPE_MISMATCH, CAIRO_STATUS_INVALID_CONTENT, CAIRO_STATUS_INVALID_FORMAT, CAIRO_STATUS_INVALID_VISUAL, CAIRO_STATUS_FILE_NOT_FOUND, CAIRO_STATUS_INVALID_DASH, CAIRO_STATUS_INVALID_DSC_COMMENT, CAIRO_STATUS_INVALID_INDEX, CAIRO_STATUS_CLIP_NOT_REPRESENTABLE, CAIRO_STATUS_TEMP_FILE_ERROR, CAIRO_STATUS_INVALID_STRIDE, CAIRO_STATUS_FONT_TYPE_MISMATCH, CAIRO_STATUS_USER_FONT_IMMUTABLE, CAIRO_STATUS_USER_FONT_ERROR, CAIRO_STATUS_NEGATIVE_COUNT, CAIRO_STATUS_INVALID_CLUSTERS, CAIRO_STATUS_INVALID_SLANT, CAIRO_STATUS_INVALID_WEIGHT } cairo_status_t; typedef enum _cairo_content { CAIRO_CONTENT_COLOR = 0x1000, CAIRO_CONTENT_ALPHA = 0x2000, CAIRO_CONTENT_COLOR_ALPHA = 0x3000 } cairo_content_t; typedef enum _cairo_operator { CAIRO_OPERATOR_CLEAR, CAIRO_OPERATOR_SOURCE, CAIRO_OPERATOR_OVER, CAIRO_OPERATOR_IN, CAIRO_OPERATOR_OUT, CAIRO_OPERATOR_ATOP, CAIRO_OPERATOR_DEST, CAIRO_OPERATOR_DEST_OVER, CAIRO_OPERATOR_DEST_IN, CAIRO_OPERATOR_DEST_OUT, CAIRO_OPERATOR_DEST_ATOP, CAIRO_OPERATOR_XOR, CAIRO_OPERATOR_ADD, CAIRO_OPERATOR_SATURATE, /* blending modes */ /* source and destination layers are multiplied. This causes the result to be at least as dark as the darker inputs. (Since 1.10) */ CAIRO_OPERATOR_MULTIPLY, /* source and destination are complemented and multiplied. This causes the result to be at least as light as the lighter inputs. (Since 1.10) */ CAIRO_OPERATOR_SCREEN, /* multiplies or screens, depending on the lightness of the destination color. (Since 1.10) */ CAIRO_OPERATOR_OVERLAY, /* replaces the destination with the source if it is darker, otherwise keeps the source. (Since 1.10) */ CAIRO_OPERATOR_DARKEN, /* replaces the destination with the source if it is lighter, otherwise keeps the source. (Since 1.10) */ CAIRO_OPERATOR_LIGHTEN, /* brightens the destination color to reflect the source color. (Since 1.10) */ CAIRO_OPERATOR_COLOR_DODGE, /* darkens the destination color to reflect the source color. (Since 1.10) */ CAIRO_OPERATOR_COLOR_BURN, /* Multiplies or screens, dependent on source color. (Since 1.10) */ CAIRO_OPERATOR_HARD_LIGHT, /* Darkens or lightens, dependent on source color. (Since 1.10) */ CAIRO_OPERATOR_SOFT_LIGHT, /* Takes the difference of the source and destination color. (Since 1.10) */ CAIRO_OPERATOR_DIFFERENCE, /* Produces an effect similar to difference, but with lower contrast. (Since 1.10) */ CAIRO_OPERATOR_EXCLUSION, /* Creates a color with the hue of the source and the saturation and luminosity of the target. (Since 1.10) */ CAIRO_OPERATOR_HSL_HUE, /* Creates a color with the saturation of the source and the hue and luminosity of the target. Painting with this mode onto a gray area produces no change. (Since 1.10) */ CAIRO_OPERATOR_HSL_SATURATION, /* Creates a color with the hue and saturation of the source and the luminosity of the target. This preserves the gray levels of the target and is useful for coloring monochrome images or tinting color images. (Since 1.10) */ CAIRO_OPERATOR_HSL_COLOR, /* Creates a color with the luminosity of the source and the hue and saturation of the target. This produces an inverse effect to CAIRO_OPERATOR_HSL_COLOR. (Since 1.10) */ CAIRO_OPERATOR_HSL_LUMINOSITY } cairo_operator_t; typedef enum _cairo_filter { CAIRO_FILTER_FAST, CAIRO_FILTER_GOOD, CAIRO_FILTER_BEST, CAIRO_FILTER_NEAREST, CAIRO_FILTER_BILINEAR, CAIRO_FILTER_GAUSSIAN } cairo_filter_t; cairo_surface_t *cairo_xlib_surface_create(Display * dpy, Drawable drawable, Visual * visual, int width, int height); cairo_surface_t *cairo_xlib_surface_create_for_bitmap(Display * dpy, Pixmap bitmap, Screen * screen, int width, int height); void cairo_xlib_surface_set_size(cairo_surface_t * surface, int width, int height); void cairo_xlib_surface_set_drawable(cairo_surface_t * surface, Drawable drawable, int width, int height); Display *cairo_xlib_surface_get_display(cairo_surface_t * surface); Drawable cairo_xlib_surface_get_drawable(cairo_surface_t * surface); Screen *cairo_xlib_surface_get_screen(cairo_surface_t * surface); Visual *cairo_xlib_surface_get_visual(cairo_surface_t * surface); int cairo_xlib_surface_get_depth(cairo_surface_t * surface); int cairo_xlib_surface_get_width(cairo_surface_t * surface); int cairo_xlib_surface_get_height(cairo_surface_t * surface); int cairo_version(void); const char *cairo_version_string(void); cairo_t *cairo_create(cairo_surface_t * target); cairo_t *cairo_reference(cairo_t * cr); void cairo_destroy(cairo_t * cr); unsigned int cairo_get_reference_count(cairo_t * cr); void *cairo_get_user_data(cairo_t * cr, const cairo_user_data_key_t * key); cairo_status_t cairo_set_user_data(cairo_t * cr, const cairo_user_data_key_t * key, void *user_data, cairo_destroy_func_t destroy); void cairo_save(cairo_t * cr); void cairo_restore(cairo_t * cr); void cairo_push_group(cairo_t * cr); void cairo_push_group_with_content(cairo_t * cr, cairo_content_t content); cairo_pattern_t *cairo_pop_group(cairo_t * cr); void cairo_pop_group_to_source(cairo_t * cr); void cairo_set_operator(cairo_t * cr, cairo_operator_t op); void cairo_set_source(cairo_t * cr, cairo_pattern_t * source); void cairo_set_source_rgb(cairo_t * cr, double red, double green, double blue); void cairo_set_source_rgba(cairo_t * cr, double red, double green, double blue, double alpha); void cairo_set_source_surface(cairo_t * cr, cairo_surface_t * surface, double x, double y); void cairo_set_tolerance(cairo_t * cr, double tolerance); void cairo_set_antialias(cairo_t * cr, cairo_antialias_t antialias); typedef enum _cairo_fill_rule { CAIRO_FILL_RULE_WINDING, CAIRO_FILL_RULE_EVEN_ODD } cairo_fill_rule_t; void cairo_set_fill_rule(cairo_t * cr, cairo_fill_rule_t fill_rule); void cairo_set_line_width(cairo_t * cr, double width); typedef enum _cairo_line_cap { CAIRO_LINE_CAP_BUTT, CAIRO_LINE_CAP_ROUND, CAIRO_LINE_CAP_SQUARE } cairo_line_cap_t; void cairo_set_line_cap(cairo_t * cr, cairo_line_cap_t line_cap); typedef enum _cairo_line_join { CAIRO_LINE_JOIN_MITER, CAIRO_LINE_JOIN_ROUND, CAIRO_LINE_JOIN_BEVEL } cairo_line_join_t; void cairo_set_line_join(cairo_t * cr, cairo_line_join_t line_join); void cairo_set_dash(cairo_t * cr, const double dashes[num_dashes], int num_dashes, double offset); void cairo_set_miter_limit(cairo_t * cr, double limit); void cairo_translate(cairo_t * cr, double tx, double ty); void cairo_scale(cairo_t * cr, double sx, double sy); void cairo_rotate(cairo_t * cr, double angle); void cairo_transform(cairo_t * cr, cairo_matrix_t * matrix); void cairo_set_matrix(cairo_t * cr, cairo_matrix_t * matrix); void cairo_identity_matrix(cairo_t * cr); void cairo_user_to_device(cairo_t * cr, double *x, double *y); void cairo_user_to_device_distance(cairo_t * cr, double *dx, double *dy); void cairo_device_to_user(cairo_t * cr, double *x, double *y); void cairo_device_to_user_distance(cairo_t * cr, double *dx, double *dy); void cairo_new_path(cairo_t * cr); void cairo_move_to(cairo_t * cr, double x, double y); void cairo_new_sub_path(cairo_t * cr); void cairo_line_to(cairo_t * cr, double x, double y); void cairo_curve_to(cairo_t * cr, double x1, double y1, double x2, double y2, double x3, double y3); void cairo_arc(cairo_t * cr, double xc, double yc, double radius, double angle1, double angle2); void cairo_arc_negative(cairo_t * cr, double xc, double yc, double radius, double angle1, double angle2); void cairo_rel_move_to(cairo_t * cr, double dx, double dy); void cairo_rel_line_to(cairo_t * cr, double dx, double dy); void cairo_rel_curve_to(cairo_t * cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3); void cairo_rectangle(cairo_t * cr, double x, double y, double width, double height); void cairo_close_path(cairo_t * cr); void cairo_path_extents(cairo_t * cr, double *x1, double *y1, double *x2, double *y2); void cairo_paint(cairo_t * cr); void cairo_paint_with_alpha(cairo_t * cr, double alpha); void cairo_mask(cairo_t * cr, cairo_pattern_t * pattern); void cairo_mask_surface(cairo_t * cr, cairo_surface_t * surface, double surface_x, double surface_y); void cairo_stroke(cairo_t * cr); void cairo_stroke_preserve(cairo_t * cr); void cairo_fill(cairo_t * cr); void cairo_fill_preserve(cairo_t * cr); void cairo_copy_page(cairo_t * cr); void cairo_show_page(cairo_t * cr); cairo_bool_t cairo_in_stroke(cairo_t * cr, double x, double y); cairo_bool_t cairo_in_fill(cairo_t * cr, double x, double y); void cairo_stroke_extents(cairo_t * cr, double *x1, double *y1, double *x2, double *y2); void cairo_fill_extents(cairo_t * cr, double *x1, double *y1, double *x2, double *y2); void cairo_reset_clip(cairo_t * cr); void cairo_clip(cairo_t * cr); void cairo_clip_preserve(cairo_t * cr); void cairo_clip_extents(cairo_t * cr, double *x1, double *y1, double *x2, double *y2); typedef struct _cairo_rectangle { double x, y, width, height; } cairo_rectangle_t; typedef struct _cairo_rectangle_list { cairo_status_t status; cairo_rectangle_t *rectangles; int num_rectangles; } cairo_rectangle_list_t; cairo_rectangle_list_t *cairo_copy_clip_rectangle_list(cairo_t * cr); void cairo_rectangle_list_destroy(cairo_rectangle_list_t * rectangle_list); typedef struct _cairo_scaled_font cairo_scaled_font_t; typedef struct _cairo_font_face cairo_font_face_t; typedef struct { unsigned long index; double x; double y; } cairo_glyph_t; cairo_glyph_t *cairo_glyph_allocate(int num_glyphs); void cairo_glyph_free(cairo_glyph_t * glyphs); typedef struct { int num_bytes; int num_glyphs; } cairo_text_cluster_t; cairo_text_cluster_t *cairo_text_cluster_allocate(int num_clusters); void cairo_text_cluster_free(cairo_text_cluster_t * clusters); typedef enum _cairo_text_cluster_flags { CAIRO_TEXT_CLUSTER_FLAG_BACKWARD = 0x00000001 } cairo_text_cluster_flags_t; typedef struct { double x_bearing; double y_bearing; double width; double height; double x_advance; double y_advance; static tolua_outside cairo_text_extents_t* create_cairo_text_extents_t @ create(); static tolua_outside void destroy_cairo_text_extents_t @ destroy(cairo_text_extents_t *pointer); } cairo_text_extents_t; typedef struct { double ascent; double descent; double height; double max_x_advance; double max_y_advance; static tolua_outside cairo_font_extents_t* create_cairo_font_extents_t @ create(); static tolua_outside void destroy_cairo_font_extents_t @ destroy(cairo_font_extents_t *pointer); } cairo_font_extents_t; typedef enum _cairo_font_slant { CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_SLANT_OBLIQUE } cairo_font_slant_t; typedef enum _cairo_font_weight { CAIRO_FONT_WEIGHT_NORMAL, CAIRO_FONT_WEIGHT_BOLD } cairo_font_weight_t; typedef enum _cairo_subpixel_order { CAIRO_SUBPIXEL_ORDER_DEFAULT, CAIRO_SUBPIXEL_ORDER_RGB, CAIRO_SUBPIXEL_ORDER_BGR, CAIRO_SUBPIXEL_ORDER_VRGB, CAIRO_SUBPIXEL_ORDER_VBGR } cairo_subpixel_order_t; typedef enum _cairo_hint_style { CAIRO_HINT_STYLE_DEFAULT, CAIRO_HINT_STYLE_NONE, CAIRO_HINT_STYLE_SLIGHT, CAIRO_HINT_STYLE_MEDIUM, CAIRO_HINT_STYLE_FULL } cairo_hint_style_t; typedef enum _cairo_hint_metrics { CAIRO_HINT_METRICS_DEFAULT, CAIRO_HINT_METRICS_OFF, CAIRO_HINT_METRICS_ON } cairo_hint_metrics_t; typedef struct _cairo_font_options cairo_font_options_t; cairo_font_options_t *cairo_font_options_create(void); cairo_font_options_t *cairo_font_options_copy(cairo_font_options_t * original); void cairo_font_options_destroy(cairo_font_options_t * options); cairo_status_t cairo_font_options_status(cairo_font_options_t * options); void cairo_font_options_merge(cairo_font_options_t * options, cairo_font_options_t * other); cairo_bool_t cairo_font_options_equal(cairo_font_options_t * options, cairo_font_options_t * other); unsigned long cairo_font_options_hash(cairo_font_options_t * options); void cairo_font_options_set_antialias(cairo_font_options_t * options, cairo_antialias_t antialias); cairo_antialias_t cairo_font_options_get_antialias(cairo_font_options_t * options); void cairo_font_options_set_subpixel_order(cairo_font_options_t * options, cairo_subpixel_order_t subpixel_order); cairo_subpixel_order_t cairo_font_options_get_subpixel_order(cairo_font_options_t * options); void cairo_font_options_set_hint_style(cairo_font_options_t * options, cairo_hint_style_t hint_style); cairo_hint_style_t cairo_font_options_get_hint_style(cairo_font_options_t * options); void cairo_font_options_set_hint_metrics(cairo_font_options_t * options, cairo_hint_metrics_t hint_metrics); cairo_hint_metrics_t cairo_font_options_get_hint_metrics(cairo_font_options_t * options); void cairo_select_font_face(cairo_t * cr, const char *family, cairo_font_slant_t slant, cairo_font_weight_t weight); void cairo_set_font_size(cairo_t * cr, double size); void cairo_set_font_matrix(cairo_t * cr, cairo_matrix_t * matrix); void cairo_get_font_matrix(cairo_t * cr, cairo_matrix_t * matrix); void cairo_set_font_options(cairo_t * cr, cairo_font_options_t * options); void cairo_get_font_options(cairo_t * cr, cairo_font_options_t * options); void cairo_set_font_face(cairo_t * cr, cairo_font_face_t * font_face); cairo_font_face_t *cairo_get_font_face(cairo_t * cr); void cairo_set_scaled_font(cairo_t * cr, cairo_scaled_font_t * scaled_font); cairo_scaled_font_t *cairo_get_scaled_font(cairo_t * cr); void cairo_show_text(cairo_t * cr, const char *utf8); void cairo_show_glyphs(cairo_t * cr, const cairo_glyph_t * glyphs, int num_glyphs); void cairo_show_text_glyphs(cairo_t * cr, const char *utf8, int utf8_len, const cairo_glyph_t * glyphs, int num_glyphs, const cairo_text_cluster_t * clusters, int num_clusters, cairo_text_cluster_flags_t cluster_flags); void cairo_text_path(cairo_t * cr, const char *utf8); void cairo_glyph_path(cairo_t * cr, const cairo_glyph_t * glyphs, int num_glyphs); void cairo_text_extents(cairo_t * cr, const char *utf8, cairo_text_extents_t * extents); void cairo_glyph_extents(cairo_t * cr, const cairo_glyph_t * glyphs, int num_glyphs, cairo_text_extents_t * extents); void cairo_font_extents(cairo_t * cr, cairo_font_extents_t * extents); cairo_font_face_t *cairo_font_face_reference(cairo_font_face_t * font_face); void cairo_font_face_destroy(cairo_font_face_t * font_face); unsigned int cairo_font_face_get_reference_count(cairo_font_face_t * font_face); cairo_status_t cairo_font_face_status(cairo_font_face_t * font_face); typedef enum _cairo_font_type { CAIRO_FONT_TYPE_TOY, CAIRO_FONT_TYPE_FT, CAIRO_FONT_TYPE_WIN32, CAIRO_FONT_TYPE_QUARTZ, CAIRO_FONT_TYPE_USER } cairo_font_type_t; cairo_font_type_t cairo_font_face_get_type(cairo_font_face_t * font_face); void *cairo_font_face_get_user_data(cairo_font_face_t * font_face, const cairo_user_data_key_t * key); cairo_status_t cairo_font_face_set_user_data(cairo_font_face_t * font_face, const cairo_user_data_key_t * key, void *user_data, cairo_destroy_func_t destroy); cairo_scaled_font_t *cairo_scaled_font_create(cairo_font_face_t * font_face, cairo_matrix_t * font_matrix, cairo_matrix_t * ctm, cairo_font_options_t * options); cairo_scaled_font_t *cairo_scaled_font_reference(cairo_scaled_font_t * scaled_font); void cairo_scaled_font_destroy(cairo_scaled_font_t * scaled_font); unsigned int cairo_scaled_font_get_reference_count(cairo_scaled_font_t * scaled_font); cairo_status_t cairo_scaled_font_status(cairo_scaled_font_t * scaled_font); cairo_font_type_t cairo_scaled_font_get_type(cairo_scaled_font_t * scaled_font); void *cairo_scaled_font_get_user_data(cairo_scaled_font_t * scaled_font, const cairo_user_data_key_t * key); cairo_status_t cairo_scaled_font_set_user_data(cairo_scaled_font_t * scaled_font, const cairo_user_data_key_t * key, void *user_data, cairo_destroy_func_t destroy); void cairo_scaled_font_extents(cairo_scaled_font_t * scaled_font, cairo_font_extents_t * extents); void cairo_scaled_font_text_extents(cairo_scaled_font_t * scaled_font, const char *utf8, cairo_text_extents_t * extents); void cairo_scaled_font_glyph_extents(cairo_scaled_font_t * scaled_font, const cairo_glyph_t * glyphs, int num_glyphs, cairo_text_extents_t * extents); cairo_status_t cairo_scaled_font_text_to_glyphs(cairo_scaled_font_t * scaled_font, double x, double y, const char *utf8, int utf8_len, cairo_glyph_t ** glyphs, int *num_glyphs, cairo_text_cluster_t ** clusters, int *num_clusters, cairo_text_cluster_flags_t * cluster_flags); cairo_font_face_t *cairo_scaled_font_get_font_face(cairo_scaled_font_t * scaled_font); void cairo_scaled_font_get_font_matrix(cairo_scaled_font_t * scaled_font, cairo_matrix_t * font_matrix); void cairo_scaled_font_get_ctm(cairo_scaled_font_t * scaled_font, cairo_matrix_t * ctm); void cairo_scaled_font_get_scale_matrix(cairo_scaled_font_t * scaled_font, cairo_matrix_t * scale_matrix); void cairo_scaled_font_get_font_options(cairo_scaled_font_t * scaled_font, cairo_font_options_t * options); cairo_font_face_t *cairo_toy_font_face_create(const char *family, cairo_font_slant_t slant, cairo_font_weight_t weight); const char *cairo_toy_font_face_get_family(cairo_font_face_t * font_face); cairo_font_slant_t cairo_toy_font_face_get_slant(cairo_font_face_t * font_face); cairo_font_weight_t cairo_toy_font_face_get_weight(cairo_font_face_t * font_face); cairo_font_face_t *cairo_user_font_face_create(void); void cairo_user_font_face_set_init_func(cairo_font_face_t * font_face, cairo_user_scaled_font_init_func_t init_func); void cairo_user_font_face_set_render_glyph_func(cairo_font_face_t * font_face, cairo_user_scaled_font_render_glyph_func_t render_glyph_func); void cairo_user_font_face_set_text_to_glyphs_func(cairo_font_face_t * font_face, cairo_user_scaled_font_text_to_glyphs_func_t text_to_glyphs_func); void cairo_user_font_face_set_unicode_to_glyph_func(cairo_font_face_t * font_face, cairo_user_scaled_font_unicode_to_glyph_func_t unicode_to_glyph_func); cairo_user_scaled_font_init_func_t cairo_user_font_face_get_init_func(cairo_font_face_t * font_face); cairo_user_scaled_font_render_glyph_func_t cairo_user_font_face_get_render_glyph_func(cairo_font_face_t * font_face); cairo_user_scaled_font_text_to_glyphs_func_t cairo_user_font_face_get_text_to_glyphs_func(cairo_font_face_t * font_face); cairo_user_scaled_font_unicode_to_glyph_func_t cairo_user_font_face_get_unicode_to_glyph_func(cairo_font_face_t * font_face); cairo_operator_t cairo_get_operator(cairo_t * cr); cairo_pattern_t *cairo_get_source(cairo_t * cr); double cairo_get_tolerance(cairo_t * cr); cairo_antialias_t cairo_get_antialias(cairo_t * cr); cairo_bool_t cairo_has_current_point(cairo_t * cr); void cairo_get_current_point(cairo_t * cr, double *x, double *y); cairo_fill_rule_t cairo_get_fill_rule(cairo_t * cr); double cairo_get_line_width(cairo_t * cr); cairo_line_cap_t cairo_get_line_cap(cairo_t * cr); cairo_line_join_t cairo_get_line_join(cairo_t * cr); double cairo_get_miter_limit(cairo_t * cr); int cairo_get_dash_count(cairo_t * cr); void cairo_get_dash(cairo_t * cr, double *dashes, double *offset); void cairo_get_matrix(cairo_t * cr, cairo_matrix_t * matrix); cairo_surface_t *cairo_get_target(cairo_t * cr); cairo_surface_t *cairo_get_group_target(cairo_t * cr); typedef enum _cairo_path_data_type { CAIRO_PATH_MOVE_TO, CAIRO_PATH_LINE_TO, CAIRO_PATH_CURVE_TO, CAIRO_PATH_CLOSE_PATH } cairo_path_data_type_t; typedef union _cairo_path_data_t cairo_path_data_t; typedef struct cairo_path { cairo_status_t status; cairo_path_data_t *data; int num_data; } cairo_path_t; cairo_path_t *cairo_copy_path(cairo_t * cr); cairo_path_t *cairo_copy_path_flat(cairo_t * cr); void cairo_append_path(cairo_t * cr, const cairo_path_t * path); void cairo_path_destroy(cairo_path_t * path); cairo_status_t cairo_status(cairo_t * cr); const char *cairo_status_to_string(cairo_status_t status); cairo_surface_t *cairo_surface_create_similar(cairo_surface_t * other, cairo_content_t content, int width, int height); cairo_surface_t *cairo_surface_reference(cairo_surface_t * surface); void cairo_surface_finish(cairo_surface_t * surface); void cairo_surface_destroy(cairo_surface_t * surface); unsigned int cairo_surface_get_reference_count(cairo_surface_t * surface); cairo_status_t cairo_surface_status(cairo_surface_t * surface); typedef enum _cairo_surface_type { CAIRO_SURFACE_TYPE_IMAGE, CAIRO_SURFACE_TYPE_PDF, CAIRO_SURFACE_TYPE_PS, CAIRO_SURFACE_TYPE_XLIB, CAIRO_SURFACE_TYPE_XCB, CAIRO_SURFACE_TYPE_GLITZ, CAIRO_SURFACE_TYPE_QUARTZ, CAIRO_SURFACE_TYPE_WIN32, CAIRO_SURFACE_TYPE_BEOS, CAIRO_SURFACE_TYPE_DIRECTFB, CAIRO_SURFACE_TYPE_SVG, CAIRO_SURFACE_TYPE_OS2, CAIRO_SURFACE_TYPE_WIN32_PRINTING, CAIRO_SURFACE_TYPE_QUARTZ_IMAGE } cairo_surface_type_t; cairo_surface_type_t cairo_surface_get_type(cairo_surface_t * surface); cairo_content_t cairo_surface_get_content(cairo_surface_t * surface); cairo_status_t cairo_surface_write_to_png(cairo_surface_t * surface, const char *filename); cairo_status_t cairo_surface_write_to_png_stream(cairo_surface_t * surface, cairo_write_func_t write_func, void *closure); void *cairo_surface_get_user_data(cairo_surface_t * surface, const cairo_user_data_key_t * key); cairo_status_t cairo_surface_set_user_data(cairo_surface_t * surface, const cairo_user_data_key_t * key, void *user_data, cairo_destroy_func_t destroy); void cairo_surface_get_font_options(cairo_surface_t * surface, cairo_font_options_t * options); void cairo_surface_flush(cairo_surface_t * surface); void cairo_surface_mark_dirty(cairo_surface_t * surface); void cairo_surface_mark_dirty_rectangle(cairo_surface_t * surface, int x, int y, int width, int height); void cairo_surface_set_device_offset(cairo_surface_t * surface, double x_offset, double y_offset); void cairo_surface_get_device_offset(cairo_surface_t * surface, double *x_offset, double *y_offset); void cairo_surface_set_fallback_resolution(cairo_surface_t * surface, double x_pixels_per_inch, double y_pixels_per_inch); void cairo_surface_get_fallback_resolution(cairo_surface_t * surface, double *x_pixels_per_inch, double *y_pixels_per_inch); void cairo_surface_copy_page(cairo_surface_t * surface); void cairo_surface_show_page(cairo_surface_t * surface); cairo_bool_t cairo_surface_has_show_text_glyphs(cairo_surface_t * surface); typedef enum _cairo_format { CAIRO_FORMAT_ARGB32, CAIRO_FORMAT_RGB24, CAIRO_FORMAT_A8, CAIRO_FORMAT_A1 } cairo_format_t; cairo_surface_t *cairo_image_surface_create(cairo_format_t format, int width, int height); int cairo_format_stride_for_width(cairo_format_t format, int width); cairo_surface_t *cairo_image_surface_create_for_data(unsigned char *data, cairo_format_t format, int width, int height, int stride); unsigned char *cairo_image_surface_get_data(cairo_surface_t * surface); cairo_format_t cairo_image_surface_get_format(cairo_surface_t * surface); int cairo_image_surface_get_width(cairo_surface_t * surface); int cairo_image_surface_get_height(cairo_surface_t * surface); int cairo_image_surface_get_stride(cairo_surface_t * surface); cairo_surface_t *cairo_image_surface_create_from_png(const char *filename); cairo_surface_t *cairo_image_surface_create_from_png_stream(cairo_read_func_t read_func, void *closure); cairo_pattern_t *cairo_pattern_create_rgb(double red, double green, double blue); cairo_pattern_t *cairo_pattern_create_rgba(double red, double green, double blue, double alpha); cairo_pattern_t *cairo_pattern_create_for_surface(cairo_surface_t * surface); cairo_pattern_t *cairo_pattern_create_linear(double x0, double y0, double x1, double y1); cairo_pattern_t *cairo_pattern_create_radial(double cx0, double cy0, double radius0, double cx1, double cy1, double radius1); cairo_pattern_t *cairo_pattern_reference(cairo_pattern_t * pattern); void cairo_pattern_destroy(cairo_pattern_t * pattern); unsigned int cairo_pattern_get_reference_count(cairo_pattern_t * pattern); cairo_status_t cairo_pattern_status(cairo_pattern_t * pattern); void *cairo_pattern_get_user_data(cairo_pattern_t * pattern, const cairo_user_data_key_t * key); cairo_status_t cairo_pattern_set_user_data(cairo_pattern_t * pattern, const cairo_user_data_key_t * key, void *user_data, cairo_destroy_func_t destroy); typedef enum _cairo_pattern_type { CAIRO_PATTERN_TYPE_SOLID, CAIRO_PATTERN_TYPE_SURFACE, CAIRO_PATTERN_TYPE_LINEAR, CAIRO_PATTERN_TYPE_RADIAL } cairo_pattern_type_t; cairo_pattern_type_t cairo_pattern_get_type(cairo_pattern_t * pattern); void cairo_pattern_add_color_stop_rgb(cairo_pattern_t * pattern, double offset, double red, double green, double blue); void cairo_pattern_add_color_stop_rgba(cairo_pattern_t * pattern, double offset, double red, double green, double blue, double alpha); void cairo_pattern_set_matrix(cairo_pattern_t * pattern, cairo_matrix_t * matrix); void cairo_pattern_get_matrix(cairo_pattern_t * pattern, cairo_matrix_t * matrix); typedef enum _cairo_extend { CAIRO_EXTEND_NONE, CAIRO_EXTEND_REPEAT, CAIRO_EXTEND_REFLECT, CAIRO_EXTEND_PAD } cairo_extend_t; void cairo_pattern_set_extend(cairo_pattern_t * pattern, cairo_extend_t extend); cairo_extend_t cairo_pattern_get_extend(cairo_pattern_t * pattern); void cairo_pattern_set_filter(cairo_pattern_t * pattern, cairo_filter_t filter); cairo_filter_t cairo_pattern_get_filter(cairo_pattern_t * pattern); cairo_status_t cairo_pattern_get_rgba(cairo_pattern_t * pattern, double *red, double *green, double *blue, double *alpha); cairo_status_t cairo_pattern_get_surface(cairo_pattern_t * pattern, cairo_surface_t ** surface); cairo_status_t cairo_pattern_get_color_stop_rgba(cairo_pattern_t * pattern, int index, double *offset, double *red, double *green, double *blue, double *alpha); cairo_status_t cairo_pattern_get_color_stop_count(cairo_pattern_t * pattern, int *count); cairo_status_t cairo_pattern_get_linear_points(cairo_pattern_t * pattern, double *x0, double *y0, double *x1, double *y1); cairo_status_t cairo_pattern_get_radial_circles(cairo_pattern_t * pattern, double *x0, double *y0, double *r0, double *x1, double *y1, double *r1); void cairo_matrix_init(cairo_matrix_t * matrix, double xx, double yx, double xy, double yy, double x0, double y0); void cairo_matrix_init_identity(cairo_matrix_t * matrix); void cairo_matrix_init_translate(cairo_matrix_t * matrix, double tx, double ty); void cairo_matrix_init_scale(cairo_matrix_t * matrix, double sx, double sy); void cairo_matrix_init_rotate(cairo_matrix_t * matrix, double radians); void cairo_matrix_translate(cairo_matrix_t * matrix, double tx, double ty); void cairo_matrix_scale(cairo_matrix_t * matrix, double sx, double sy); void cairo_matrix_rotate(cairo_matrix_t * matrix, double radians); cairo_status_t cairo_matrix_invert(cairo_matrix_t * matrix); void cairo_matrix_multiply(cairo_matrix_t * result, cairo_matrix_t * a, cairo_matrix_t * b); void cairo_matrix_transform_distance(cairo_matrix_t * matrix, double *dx, double *dy); void cairo_matrix_transform_point(cairo_matrix_t * matrix, double *x, double *y); void cairo_debug_reset_static_data(void); conky-1.12.2/lua/cairo_imlib2_helper.pkg000066400000000000000000000003241404127277500201060ustar00rootroot00000000000000$#include $#include void cairo_draw_image(const char *, cairo_surface_t *, int, int, double, double, double * return_scale_w, double * return_scale_h); conky-1.12.2/lua/imlib2.pkg000066400000000000000000000400601404127277500153730ustar00rootroot00000000000000$#include $#include $#define _userdata void* typedef void *Imlib_Context; typedef void *Imlib_Image; typedef void *Imlib_Color_Modifier; typedef void *Imlib_Updates; typedef void *Imlib_Font; typedef void *Imlib_Color_Range; typedef void *Imlib_Filter; typedef struct _imlib_color Imlib_Color; typedef void *ImlibPolygon; enum _imlib_operation { IMLIB_OP_COPY, IMLIB_OP_ADD, IMLIB_OP_SUBTRACT, IMLIB_OP_RESHADE }; enum _imlib_text_direction { IMLIB_TEXT_TO_RIGHT = 0, IMLIB_TEXT_TO_LEFT = 1, IMLIB_TEXT_TO_DOWN = 2, IMLIB_TEXT_TO_UP = 3, IMLIB_TEXT_TO_ANGLE = 4 }; enum _imlib_load_error { IMLIB_LOAD_ERROR_NONE, IMLIB_LOAD_ERROR_FILE_DOES_NOT_EXIST, IMLIB_LOAD_ERROR_FILE_IS_DIRECTORY, IMLIB_LOAD_ERROR_PERMISSION_DENIED_TO_READ, IMLIB_LOAD_ERROR_NO_LOADER_FOR_FILE_FORMAT, IMLIB_LOAD_ERROR_PATH_TOO_LONG, IMLIB_LOAD_ERROR_PATH_COMPONENT_NON_EXISTANT, IMLIB_LOAD_ERROR_PATH_COMPONENT_NOT_DIRECTORY, IMLIB_LOAD_ERROR_PATH_POINTS_OUTSIDE_ADDRESS_SPACE, IMLIB_LOAD_ERROR_TOO_MANY_SYMBOLIC_LINKS, IMLIB_LOAD_ERROR_OUT_OF_MEMORY, IMLIB_LOAD_ERROR_OUT_OF_FILE_DESCRIPTORS, IMLIB_LOAD_ERROR_PERMISSION_DENIED_TO_WRITE, IMLIB_LOAD_ERROR_OUT_OF_DISK_SPACE, IMLIB_LOAD_ERROR_UNKNOWN }; enum _imlib_TTF_encoding { IMLIB_TTF_ENCODING_ISO_8859_1, IMLIB_TTF_ENCODING_ISO_8859_2, IMLIB_TTF_ENCODING_ISO_8859_3, IMLIB_TTF_ENCODING_ISO_8859_4, IMLIB_TTF_ENCODING_ISO_8859_5 }; typedef enum _imlib_operation Imlib_Operation; typedef enum _imlib_load_error Imlib_Load_Error; typedef enum _imlib_load_error ImlibLoadError; typedef enum _imlib_text_direction Imlib_Text_Direction; typedef enum _imlib_TTF_encoding Imlib_TTF_Encoding; typedef struct _imlib_border Imlib_Border; Imlib_Context imlib_context_new(void); void imlib_context_free(Imlib_Context context); void imlib_context_push(Imlib_Context context); void imlib_context_pop(void); Imlib_Context imlib_context_get(void); void imlib_context_set_display(Display * display); void imlib_context_disconnect_display(void); void imlib_context_set_visual(Visual * visual); void imlib_context_set_colormap(Colormap colormap); void imlib_context_set_drawable(Drawable drawable); void imlib_context_set_mask(Pixmap mask); void imlib_context_set_dither_mask(char dither_mask); void imlib_context_set_mask_alpha_threshold(int mask_alpha_threshold); void imlib_context_set_anti_alias(char anti_alias); void imlib_context_set_dither(char dither); void imlib_context_set_blend(char blend); void imlib_context_set_color_modifier(Imlib_Color_Modifier color_modifier); void imlib_context_set_operation(Imlib_Operation operation); void imlib_context_set_font(Imlib_Font font); void imlib_context_set_direction(Imlib_Text_Direction direction); void imlib_context_set_angle(double angle); void imlib_context_set_color(int red, int green, int blue, int alpha); void imlib_context_set_color_hsva(float hue, float saturation, float value, int alpha); void imlib_context_set_color_hlsa(float hue, float lightness, float saturation, int alpha); void imlib_context_set_color_cmya(int cyan, int magenta, int yellow, int alpha); void imlib_context_set_color_range(Imlib_Color_Range color_range); void imlib_context_set_progress_function(Imlib_Progress_Function progress_function); void imlib_context_set_progress_granularity(char progress_granularity); void imlib_context_set_image(Imlib_Image image); void imlib_context_set_cliprect(int x, int y, int w, int h); void imlib_context_set_TTF_encoding(Imlib_TTF_Encoding encoding); Display *imlib_context_get_display(void); Visual *imlib_context_get_visual(void); Colormap imlib_context_get_colormap(void); Drawable imlib_context_get_drawable(void); Pixmap imlib_context_get_mask(void); char imlib_context_get_dither_mask(void); char imlib_context_get_anti_alias(void); int imlib_context_get_mask_alpha_threshold(void); char imlib_context_get_dither(void); char imlib_context_get_blend(void); Imlib_Color_Modifier imlib_context_get_color_modifier(void); Imlib_Operation imlib_context_get_operation(void); Imlib_Font imlib_context_get_font(void); double imlib_context_get_angle(void); Imlib_Text_Direction imlib_context_get_direction(void); void imlib_context_get_color(int *red, int *green, int *blue, int *alpha); void imlib_context_get_color_hsva(float *hue, float *saturation, float *value, int *alpha); void imlib_context_get_color_hlsa(float *hue, float *lightness, float *saturation, int *alpha); void imlib_context_get_color_cmya(int *cyan, int *magenta, int *yellow, int *alpha); Imlib_Color *imlib_context_get_imlib_color(void); Imlib_Color_Range imlib_context_get_color_range(void); Imlib_Progress_Function imlib_context_get_progress_function(void); char imlib_context_get_progress_granularity(void); Imlib_Image imlib_context_get_image(void); void imlib_context_get_cliprect(int *x, int *y, int *w, int *h); Imlib_TTF_Encoding imlib_context_get_TTF_encoding(void); int imlib_get_cache_size(void); void imlib_set_cache_size(int bytes); int imlib_get_color_usage(void); void imlib_set_color_usage(int max); void imlib_flush_loaders(void); int imlib_get_visual_depth(Display * display, Visual * visual); Visual *imlib_get_best_visual(Display * display, int screen, int *depth_return); Imlib_Image imlib_load_image(const char *file); Imlib_Image imlib_load_image_immediately(const char *file); Imlib_Image imlib_load_image_without_cache(const char *file); Imlib_Image imlib_load_image_immediately_without_cache(const char *file); Imlib_Image imlib_load_image_with_error_return(const char *file, Imlib_Load_Error * error_return); void imlib_free_image(void); void imlib_free_image_and_decache(void); int imlib_image_get_width(void); int imlib_image_get_height(void); const char *imlib_image_get_filename(void); int *imlib_image_get_data(void); int *imlib_image_get_data_for_reading_only(void); void imlib_image_put_back_data(unsigned int * data); char imlib_image_has_alpha(void); void imlib_image_set_changes_on_disk(void); void imlib_image_get_border(Imlib_Border * border); void imlib_image_set_border(Imlib_Border * border); void imlib_image_set_format(const char *format); void imlib_image_set_irrelevant_format(char irrelevant); void imlib_image_set_irrelevant_border(char irrelevant); void imlib_image_set_irrelevant_alpha(char irrelevant); char *imlib_image_format(void); void imlib_image_set_has_alpha(char has_alpha); void imlib_image_query_pixel(int x, int y, Imlib_Color * color_return); void imlib_image_query_pixel_hsva(int x, int y, float *hue, float *saturation, float *value, int *alpha); void imlib_image_query_pixel_hlsa(int x, int y, float *hue, float *lightness, float *saturation, int *alpha); void imlib_image_query_pixel_cmya(int x, int y, int *cyan, int *magenta, int *yellow, int *alpha); void imlib_render_pixmaps_for_whole_image(Pixmap * pixmap_return, Pixmap * mask_return); void imlib_render_pixmaps_for_whole_image_at_size(Pixmap * pixmap_return, Pixmap * mask_return, int width, int height); void imlib_free_pixmap_and_mask(Pixmap pixmap); void imlib_render_image_on_drawable(int x, int y); void imlib_render_image_on_drawable_at_size(int x, int y, int width, int height); void imlib_render_image_part_on_drawable_at_size(int source_x, int source_y, int source_width, int source_height, int x, int y, int width, int height); unsigned int imlib_render_get_pixel_color(void); void imlib_blend_image_onto_image(Imlib_Image source_image, char merge_alpha, int source_x, int source_y, int source_width, int source_height, int destination_x, int destination_y, int destination_width, int destination_height); Imlib_Image imlib_create_image(int width, int height); Imlib_Image imlib_create_image_using_data(int width, int height, unsigned int * data); Imlib_Image imlib_create_image_using_copied_data(int width, int height, unsigned int * data); Imlib_Image imlib_create_image_from_drawable(Pixmap mask, int x, int y, int width, int height, char need_to_grab_x); Imlib_Image imlib_create_image_from_ximage(XImage *image, XImage *mask, int x, int y, int width, int height, char need_to_grab_x); Imlib_Image imlib_create_scaled_image_from_drawable(Pixmap mask, int source_x, int source_y, int source_width, int source_height, int destination_width, int destination_height, char need_to_grab_x, char get_mask_from_shape); char imlib_copy_drawable_to_image(Pixmap mask, int x, int y, int width, int height, int destination_x, int destination_y, char need_to_grab_x); Imlib_Image imlib_clone_image(void); Imlib_Image imlib_create_cropped_image(int x, int y, int width, int height); Imlib_Image imlib_create_cropped_scaled_image(int source_x, int source_y, int source_width, int source_height, int destination_width, int destination_height); Imlib_Updates imlib_updates_clone(Imlib_Updates updates); Imlib_Updates imlib_update_append_rect(Imlib_Updates updates, int x, int y, int w, int h); Imlib_Updates imlib_updates_merge(Imlib_Updates updates, int w, int h); Imlib_Updates imlib_updates_merge_for_rendering(Imlib_Updates updates, int w, int h); void imlib_updates_free(Imlib_Updates updates); Imlib_Updates imlib_updates_get_next(Imlib_Updates updates); void imlib_updates_get_coordinates(Imlib_Updates updates, int *x_return, int *y_return, int *width_return, int *height_return); void imlib_updates_set_coordinates(Imlib_Updates updates, int x, int y, int width, int height); void imlib_render_image_updates_on_drawable(Imlib_Updates updates, int x, int y); Imlib_Updates imlib_updates_init(void); Imlib_Updates imlib_updates_append_updates(Imlib_Updates updates, Imlib_Updates appended_updates); void imlib_image_flip_horizontal(void); void imlib_image_flip_vertical(void); void imlib_image_flip_diagonal(void); void imlib_image_orientate(int orientation); void imlib_image_blur(int radius); void imlib_image_sharpen(int radius); void imlib_image_tile_horizontal(void); void imlib_image_tile_vertical(void); void imlib_image_tile(void); Imlib_Font imlib_load_font(const char *font_name); void imlib_free_font(void); int imlib_insert_font_into_fallback_chain(Imlib_Font font, Imlib_Font fallback_font); void imlib_remove_font_from_fallback_chain(Imlib_Font fallback_font); Imlib_Font imlib_get_prev_font_in_fallback_chain(Imlib_Font fn); Imlib_Font imlib_get_next_font_in_fallback_chain(Imlib_Font fn); void imlib_text_draw(int x, int y, const char *text); void imlib_text_draw_with_return_metrics(int x, int y, const char *text, int *width_return, int *height_return, int *horizontal_advance_return, int *vertical_advance_return); void imlib_get_text_size(const char *text, int *width_return, int *height_return); void imlib_get_text_advance(const char *text, int *horizontal_advance_return, int *vertical_advance_return); int imlib_get_text_inset(const char *text); void imlib_add_path_to_font_path(const char *path); void imlib_remove_path_from_font_path(const char *path); char **imlib_list_font_path(int *number_return); int imlib_text_get_index_and_location(const char *text, int x, int y, int *char_x_return, int *char_y_return, int *char_width_return, int *char_height_return); void imlib_text_get_location_at_index(const char *text, int index, int *char_x_return, int *char_y_return, int *char_width_return, int *char_height_return); char **imlib_list_fonts(int *number_return); void imlib_free_font_list(char **font_list, int number); int imlib_get_font_cache_size(void); void imlib_set_font_cache_size(int bytes); void imlib_flush_font_cache(void); int imlib_get_font_ascent(void); int imlib_get_font_descent(void); int imlib_get_maximum_font_ascent(void); int imlib_get_maximum_font_descent(void); Imlib_Color_Modifier imlib_create_color_modifier(void); void imlib_free_color_modifier(void); void imlib_modify_color_modifier_gamma(double gamma_value); void imlib_modify_color_modifier_brightness(double brightness_value); void imlib_modify_color_modifier_contrast(double contrast_value); void imlib_set_color_modifier_tables(unsigned char * red_table, unsigned char * green_table, unsigned char * blue_table, unsigned char * alpha_table); void imlib_get_color_modifier_tables(unsigned char * red_table, unsigned char * green_table, unsigned char * blue_table, unsigned char * alpha_table); void imlib_reset_color_modifier(void); void imlib_apply_color_modifier(void); void imlib_apply_color_modifier_to_rectangle(int x, int y, int width, int height); Imlib_Updates imlib_image_draw_pixel(int x, int y, char make_updates); Imlib_Updates imlib_image_draw_line(int x1, int y1, int x2, int y2, char make_updates); void imlib_image_draw_rectangle(int x, int y, int width, int height); void imlib_image_fill_rectangle(int x, int y, int width, int height); void imlib_image_copy_alpha_to_image(Imlib_Image image_source, int x, int y); void imlib_image_copy_alpha_rectangle_to_image(Imlib_Image image_source, int x, int y, int width, int height, int destination_x, int destination_y); void imlib_image_scroll_rect(int x, int y, int width, int height, int delta_x, int delta_y); void imlib_image_copy_rect(int x, int y, int width, int height, int new_x, int new_y); ImlibPolygon imlib_polygon_new(void); void imlib_polygon_free(ImlibPolygon poly); void imlib_polygon_add_point(ImlibPolygon poly, int x, int y); void imlib_image_draw_polygon(ImlibPolygon poly, unsigned char closed); void imlib_image_fill_polygon(ImlibPolygon poly); void imlib_polygon_get_bounds(ImlibPolygon poly, int *px1, int *py1, int *px2, int *py2); unsigned char imlib_polygon_contains_point(ImlibPolygon poly, int x, int y); void imlib_image_draw_ellipse(int xc, int yc, int a, int b); void imlib_image_fill_ellipse(int xc, int yc, int a, int b); Imlib_Color_Range imlib_create_color_range(void); void imlib_free_color_range(void); void imlib_add_color_to_color_range(int distance_away); void imlib_image_fill_color_range_rectangle(int x, int y, int width, int height, double angle); void imlib_image_fill_hsva_color_range_rectangle(int x, int y, int width, int height, double angle); void imlib_image_attach_data_value(const char *key, void *data, int value, Imlib_Data_Destructor_Function destructor_function); void *imlib_image_get_attached_data(const char *key); int imlib_image_get_attached_value(const char *key); void imlib_image_remove_attached_data_value(const char *key); void imlib_image_remove_and_free_attached_data_value(const char *key); void imlib_save_image(const char *filename); void imlib_save_image_with_error_return(const char *filename, Imlib_Load_Error * error_return); Imlib_Image imlib_create_rotated_image(double angle); void imlib_rotate_image_from_buffer(double angle, Imlib_Image source_image); void imlib_blend_image_onto_image_at_angle(Imlib_Image source_image, char merge_alpha, int source_x, int source_y, int source_width, int source_height, int destination_x, int destination_y, int angle_x, int angle_y); void imlib_blend_image_onto_image_skewed(Imlib_Image source_image, char merge_alpha, int source_x, int source_y, int source_width, int source_height, int destination_x, int destination_y, int h_angle_x, int h_angle_y, int v_angle_x, int v_angle_y); void imlib_render_image_on_drawable_skewed(int source_x, int source_y, int source_width, int source_height, int destination_x, int destination_y, int h_angle_x, int h_angle_y, int v_angle_x, int v_angle_y); void imlib_render_image_on_drawable_at_angle(int source_x, int source_y, int source_width, int source_height, int destination_x, int destination_y, int angle_x, int angle_y); void imlib_image_filter(void); Imlib_Filter imlib_create_filter(int initsize); void imlib_context_set_filter(Imlib_Filter filter); Imlib_Filter imlib_context_get_filter(void); void imlib_free_filter(void); void imlib_filter_set(int xoff, int yoff, int a, int r, int g, int b); void imlib_filter_set_alpha(int xoff, int yoff, int a, int r, int g, int b); void imlib_filter_set_red(int xoff, int yoff, int a, int r, int g, int b); void imlib_filter_set_green(int xoff, int yoff, int a, int r, int g, int b); void imlib_filter_set_blue(int xoff, int yoff, int a, int r, int g, int b); void imlib_filter_constants(int a, int r, int g, int b); void imlib_filter_divisors(int a, int r, int g, int b); void imlib_image_clear(void); void imlib_image_clear_color(int r, int g, int b, int a); conky-1.12.2/lua/libcairo-helper.h000066400000000000000000000027651404127277500167360ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _LIBCAIRO_HELPER_H_ #define _LIBCAIRO_HELPER_H_ #include cairo_text_extents_t *create_cairo_text_extents_t(void) { return calloc(1, sizeof(cairo_text_extents_t)); } cairo_font_extents_t *create_cairo_font_extents_t(void) { return calloc(1, sizeof(cairo_font_extents_t)); } cairo_matrix_t *create_cairo_matrix_t(void) { return calloc(1, sizeof(cairo_matrix_t)); } void destroy_cairo_text_extents_t(cairo_text_extents_t *pointer) { free(pointer); } void destroy_cairo_font_extents_t(cairo_font_extents_t *pointer) { free(pointer); } void destroy_cairo_matrix_t(cairo_matrix_t *pointer) { free(pointer); } #endif /* _LIBCAIRO_HELPER_H_ */ conky-1.12.2/lua/libcairo.patch000066400000000000000000000011101404127277500163100ustar00rootroot00000000000000--- lua/libcairo.c~ 2010-06-11 23:14:43.000000000 +0200 +++ lua/libcairo.c 2010-06-12 10:47:51.000000000 +0200 @@ -1452,12 +1452,12 @@ #endif { struct _cairo* cr = (( struct _cairo*) tolua_tousertype(tolua_S,1,0)); + int num_dashes = ((int) tolua_tonumber(tolua_S,3,0)); #ifdef __cplusplus double* dashes = Mtolua_new_dim(double, num_dashes); #else double* dashes = (double*) malloc((num_dashes)*sizeof(double)); #endif - int num_dashes = ((int) tolua_tonumber(tolua_S,3,0)); double offset = ((double) tolua_tonumber(tolua_S,4,0)); { #ifndef TOLUA_RELEASE conky-1.12.2/lua/libcairo_imlib2_helper.h000066400000000000000000000050721404127277500202500ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _LIBCAIRO_IMAGE_HELPER_H_ #define _LIBCAIRO_IMAGE_HELPER_H_ #include #include void cairo_draw_image(const char *file, cairo_surface_t *cs, int x, int y, double scale_x, double scale_y, double *return_scale_w, double *return_scale_h) { int w, h; double scaled_w, scaled_h; Imlib_Image premul; cairo_surface_t *result; cairo_t *cr; Imlib_Image *image = imlib_load_image(file); if (!image) { return; } imlib_context_set_image(image); w = imlib_image_get_width(); h = imlib_image_get_height(); scaled_w = *return_scale_w = scale_x * (double)w; scaled_h = *return_scale_h = scale_y * (double)h; /* create temporary image */ premul = imlib_create_image(scaled_w, scaled_h); /* FIXME: add error handling */ /* fill with opaque black */ imlib_context_set_image(premul); imlib_context_set_color(0, 0, 0, 255); imlib_image_fill_rectangle(0, 0, scaled_w, scaled_h); /* blend source image on top - * in effect this multiplies the rgb values by alpha */ imlib_blend_image_onto_image(image, 0, 0, 0, w, h, 0, 0, scaled_w, scaled_h); /* and use the alpha channel of the source image */ imlib_image_copy_alpha_to_image(image, 0, 0); /* now pass the result to cairo */ result = cairo_image_surface_create_for_data( (void *)imlib_image_get_data_for_reading_only(), CAIRO_FORMAT_ARGB32, scaled_w, scaled_h, sizeof(DATA32) * scaled_w); cr = cairo_create(cs); cairo_set_source_surface(cr, result, x, y); cairo_paint(cr); imlib_context_set_image(image); imlib_free_image(); imlib_context_set_image(premul); imlib_free_image(); cairo_destroy(cr); cairo_surface_destroy(result); } #endif /* _LIBCAIRO_IMAGE_HELPER_H_ */ conky-1.12.2/lua/librsvg-helper.h000066400000000000000000000040571404127277500166160ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _LIBRSVG_HELPER_H_ #define _LIBRSVG_HELPER_H_ #include #include #include RsvgDimensionData *rsvgDimensionDataCreate(void) { return (RsvgDimensionData *)calloc(1, sizeof(RsvgDimensionData)); } void rsvgDimensionDataGet(RsvgDimensionData *dd, int *width, int *height, double *em, double *ex) { if (dd) { *width = dd->width; *height = dd->height; *em = dd->em; *ex = dd->ex; } } RsvgPositionData *rsvgPositionDataCreate(void) { return (RsvgPositionData *)calloc(1, sizeof(RsvgPositionData)); } void rsvgPositionDataGet(RsvgPositionData *pd, int *x, int *y) { if (pd) { *x = pd->x; *y = pd->y; } } RsvgHandle *rsvg_create_handle_from_file(const char *filename) { GFile *gfile = g_file_new_for_path(filename); GError *error = NULL; RsvgHandle *handle = rsvg_handle_new_from_gfile_sync( gfile, RSVG_HANDLE_FLAGS_NONE, NULL, &error); if (error) { g_object_unref(error); if (handle) g_object_unref(handle); handle = NULL; } g_object_unref(gfile); return handle; } int rsvg_destroy_handle(RsvgHandle *handle) { if (handle) { g_object_unref(handle); } return 0; } #endif /* _LIBRSVG_HELPER_H_ */ conky-1.12.2/lua/rsvg.pkg000066400000000000000000000123641404127277500152040ustar00rootroot00000000000000/* rsvg.h: SAX-based renderer for SVG files into a GdkPixbuf. Copyright (C) 2000 Eazel, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Author: Raph Levien rsvg-cairo.h: SAX-based renderer for SVG files using cairo Copyright (C) 2005 Red Hat, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Author: Carl Worth */ $#include $#include $#include "librsvg-helper.h" typedef struct _RsvgHandle RsvgHandle; typedef struct _RsvgHandleClass RsvgHandleClass; /** * RsvgDimensionData: * @width: SVG's width, in pixels * @height: SVG's height, in pixels * @em: em * @ex: ex */ typedef struct _RsvgDimensionData { int width; int height; double em; double ex; static tolua_outside RsvgDimensionData * rsvgDimensionDataCreate @ create(); tolua_outside void rsvgDimensionDataGet @ get(int * width, int * height, double * em, double * ex); } RsvgDimensionData; /** * RsvgRectangle: * @x: X coordinate of the left side of the rectangle * @y: Y coordinate of the the top side of the rectangle * @width: width of the rectangle * @height: height of the rectangle * * A data structure for holding a rectangle. * * Since: 2.46 */ typedef struct _RsvgRectangle { double x; double y; double width; double height; } RsvgRectangle; const char *rsvg_handle_get_base_uri (RsvgHandle * handle); void rsvg_handle_set_base_uri (RsvgHandle * handle, const char *base_uri); void rsvg_handle_get_dimensions (RsvgHandle * handle, RsvgDimensionData * dimension_data); gboolean rsvg_handle_get_geometry_for_layer(RsvgHandle *handle, const char *id, const RsvgRectangle *viewport, RsvgRectangle *out_ink_rect, RsvgRectangle *out_logical_rect, GError **error); int rsvg_handle_has_sub (RsvgHandle * handle, const char *id); RsvgHandle *rsvg_handle_new_with_flags (RsvgHandleFlags flags); RsvgHandle *rsvg_handle_new_from_data (const unsigned char * data, unsigned long data_len, GError ** error); RsvgHandle *rsvg_handle_new_from_file (const char * file_name, GError ** error); int rsvg_handle_render_cairo (RsvgHandle * handle, cairo_t * cr); int rsvg_handle_render_cairo_sub (RsvgHandle * handle, cairo_t * cr, const char *id); void g_object_unref(gpointer object); RsvgHandle * rsvg_create_handle_from_file(const char *); int rsvg_destroy_handle(RsvgHandle *); RsvgHandle *rsvg_handle_new_with_flags (RsvgHandleFlags flags); void rsvg_handle_set_base_gfile (RsvgHandle *handle, GFile *base_file); gboolean rsvg_handle_read_stream_sync (RsvgHandle *handle, GInputStream *stream, GCancellable *cancellable, GError **error); RsvgHandle *rsvg_handle_new_from_gfile_sync (GFile *file, RsvgHandleFlags flags, GCancellable *cancellable, GError **error); RsvgHandle *rsvg_handle_new_from_stream_sync (GInputStream *input_stream, GFile *base_file, RsvgHandleFlags flags, GCancellable *cancellable, GError **error); RsvgHandle *rsvg_handle_new_from_data (const guint8 *data, gsize data_len, GError **error); RsvgHandle *rsvg_handle_new_from_file (const gchar *filename, GError **error); conky-1.12.2/sonar-project.properties000066400000000000000000000004121404127277500176320ustar00rootroot00000000000000sonar.projectKey=conky sonar.projectName=Conky sonar.sources=src sonar.cfamily.build-wrapper-output=build/bw-output sonar.cpp.std=c++17 sonar.exclusions=3rdparty/**,tests/** sonar.cfamily.threads=4 sonar.cfamily.llvm-cov.reportPath=build/test-conky-coverage-txt.txt conky-1.12.2/src/000077500000000000000000000000001404127277500135205ustar00rootroot00000000000000conky-1.12.2/src/CMakeLists.txt000066400000000000000000000206041404127277500162620ustar00rootroot00000000000000# # Conky, a system monitor, based on torsmo # # Please see COPYING for details # # Copyright (c) 2005-2021 Brenden Matthews, et. al. (see AUTHORS) All rights # reserved. # # 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 3 of the License, or (at your option) any later # version. # # 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. You should have received a copy of the GNU General Public License # along with this program. If not, see . # include_directories(${conky_includes}) if(BUILD_BUILTIN_CONFIG OR BUILD_OLD_CONFIG) # include config output dir include_directories(${CMAKE_BINARY_DIR}/data) endif(BUILD_BUILTIN_CONFIG OR BUILD_OLD_CONFIG) # ensure build.h and config.h aren't in the way if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/config.h) message( FATAL_ERROR "You must remove the autotools generated file '${CMAKE_CURRENT_SOURCE_DIR}/config.h' in order to build with CMake." ) endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/config.h) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/build.h) message( FATAL_ERROR "You must remove the autotools generated file '${CMAKE_CURRENT_SOURCE_DIR}/build.h' in order to build with CMake." ) endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/build.h) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/defconfig.h) message( FATAL_ERROR "You must remove the autotools generated file '${CMAKE_CURRENT_SOURCE_DIR}/defconfig.h' in order to build with CMake." ) endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/defconfig.h) set(conky_sources ${conky_sources} c++wrap.cc c++wrap.hh colours.cc colours.h combine.cc combine.h common.cc common.h conky.cc conky.h core.cc core.h cpu.cc cpu.h diskio.cc diskio.h entropy.cc entropy.h exec.cc exec.h fs.cc fs.h mail.cc mail.h misc.cc misc.h net_stat.cc net_stat.h template.cc template.h mboxscan.cc mboxscan.h read_tcpip.cc read_tcpip.h scroll.cc scroll.h specials.cc specials.h tailhead.cc tailhead.h temphelper.cc temphelper.h text_object.cc text_object.h timeinfo.cc timeinfo.h top.cc top.h algebra.cc algebra.h prioqueue.cc prioqueue.h proc.cc proc.h user.cc user.h luamm.cc luamm.hh data-source.cc data-source.hh lua-config.cc lua-config.hh setting.cc setting.hh llua.cc llua.h update-cb.cc update-cb.hh logging.h semaphore.hh) # Platform specific sources if(OS_LINUX) set(linux linux.cc linux.h users.cc users.h sony.cc sony.h i8k.cc i8k.h) set(optional_sources ${optional_sources} ${linux}) endif(OS_LINUX) if(OS_FREEBSD) set(freebsd freebsd.cc freebsd.h bsdapm.cc bsdapm.h) set(optional_sources ${optional_sources} ${freebsd}) endif(OS_FREEBSD) if(OS_DRAGONFLY) set(dragonfly dragonfly.cc dragonfly.h bsdapm.cc bsdapm.h) set(optional_sources ${optional_sources} ${dragonfly}) endif(OS_DRAGONFLY) if(OS_OPENBSD) set(openbsd openbsd.cc openbsd.h bsdapm.cc bsdapm.h) set(optional_sources ${optional_sources} ${openbsd}) endif(OS_OPENBSD) # These below are not actually supported. No idea what their status is. if(OS_SOLARIS) set(solaris solaris.cc solaris.h) set(optional_sources ${optional_sources} ${solaris}) endif(OS_SOLARIS) if(OS_NETBSD) set(netbsd netbsd.cc netbsd.h) set(optional_sources ${optional_sources} ${netbsd}) endif(OS_NETBSD) if(OS_HAIKU) set(haiku haiku.cc haiku.h) set(optional_sources ${optional_sources} ${haiku}) endif(OS_HAIKU) if(OS_DARWIN) set(darwin darwin.mm darwin.h darwin_sip.h i18n.h) set(optional_sources ${optional_sources} ${darwin}) endif(OS_DARWIN) # Optional sources if(HAVE_SOME_SOUNDCARD_H) set(mixer mixer.cc mixer.h) set(optional_sources ${optional_sources} ${mixer}) endif(HAVE_SOME_SOUNDCARD_H) if(BUILD_AUDACIOUS) set(audacious audacious.cc audacious.h) set(optional_sources ${optional_sources} ${audacious}) endif(BUILD_AUDACIOUS) if(BUILD_IBM) set(ibm ibm.cc ibm.h smapi.cc smapi.h) set(optional_sources ${optional_sources} ${ibm}) endif(BUILD_IBM) if(BUILD_MPD) set(mpd mpd.cc mpd.h libmpdclient.cc libmpdclient.h) set(optional_sources ${optional_sources} ${mpd}) endif(BUILD_MPD) if(BUILD_MYSQL) set(mysql mysql.cc mysql.h) set(optional_sources ${optional_sources} ${mysql}) endif(BUILD_MYSQL) if(BUILD_MOC) set(moc moc.cc moc.h) set(optional_sources ${optional_sources} ${moc}) endif(BUILD_MOC) if(BUILD_CMUS) set(cmus cmus.cc cmus.h) set(optional_sources ${optional_sources} ${cmus}) endif(BUILD_CMUS) if(BUILD_JOURNAL) set(journal journal.cc journal.h) set(optional_sources ${optional_sources} ${journal}) endif(BUILD_JOURNAL) if(BUILD_XMMS2) set(xmms2 xmms2.cc xmms2.h) set(optional_sources ${optional_sources} ${xmms2}) endif(BUILD_XMMS2) if(BUILD_PORT_MONITORS) add_library(tcp-portmon libtcp-portmon.cc libtcp-portmon.h) set(conky_libs ${conky_libs} tcp-portmon) set(port_monitors tcp-portmon.cc tcp-portmon.h) set(optional_sources ${optional_sources} ${port_monitors}) endif(BUILD_PORT_MONITORS) if(BUILD_X11) set(x11 x11.cc x11.h fonts.cc fonts.h) set(optional_sources ${optional_sources} ${x11}) if(BUILD_XINERAMA) find_package(Xinerama REQUIRED) set(conky_libs ${conky_libs} ${Xinerama_LIBRARIES}) endif(BUILD_XINERAMA) endif(BUILD_X11) if(BUILD_HDDTEMP) set(hddtemp hddtemp.cc hddtemp.h) set(optional_sources ${optional_sources} ${hddtemp}) endif(BUILD_HDDTEMP) if(BUILD_CURL) set(ccurl_thread ccurl_thread.cc ccurl_thread.h) set(optional_sources ${optional_sources} ${ccurl_thread}) endif(BUILD_CURL) if(BUILD_RSS) set(rss rss.cc rss.h prss.cc prss.h) set(optional_sources ${optional_sources} ${rss}) endif(BUILD_RSS) if(BUILD_WEATHER) set(weather weather.cc weather.h) set(optional_sources ${optional_sources} ${weather}) endif(BUILD_WEATHER) if(BUILD_NVIDIA) set(nvidia nvidia.cc nvidia.h) set(optional_sources ${optional_sources} ${nvidia}) endif(BUILD_NVIDIA) if(BUILD_IMLIB2) set(imlib2 imlib2.cc imlib2.h) set(optional_sources ${optional_sources} ${imlib2}) endif(BUILD_IMLIB2) if(BUILD_APCUPSD) set(apcupsd apcupsd.cc apcupsd.h) set(optional_sources ${optional_sources} ${apcupsd}) endif(BUILD_APCUPSD) if(BUILD_ICAL) set(ical ical.cc ical.h) set(optional_sources ${optional_sources} ${ical}) endif(BUILD_ICAL) if(BUILD_IRC) set(irc irc.cc irc.h) set(optional_sources ${optional_sources} ${irc}) endif(BUILD_IRC) if(BUILD_ICONV) set(iconv iconv_tools.cc iconv_tools.h) set(optional_sources ${optional_sources} ${iconv}) endif(BUILD_ICONV) if(BUILD_NCURSES) set(ncurses_srcs nc.cc nc.h) set(optional_sources ${optional_sources} ${ncurses_srcs}) endif(BUILD_NCURSES) if(BUILD_PULSEAUDIO) set(pulseaudio pulseaudio.cc pulseaudio.h) set(optional_sources ${optional_sources} ${pulseaudio}) endif(BUILD_PULSEAUDIO) if(BUILD_INTEL_BACKLIGHT) set(intel_backlight intel_backlight.cc intel_backlight.h) set(optional_sources ${optional_sources} ${intel_backlight}) endif(BUILD_INTEL_BACKLIGHT) if(BUILD_HSV_GRADIENT) set(hsv_gradient hsv_gradient.cc hsv_gradient.h) set(optional_sources ${optional_sources} ${hsv_gradient}) endif(BUILD_HSV_GRADIENT) if(BUILD_TESTS) # Create a library strictly for testing add_library(conky_core ${conky_sources} ${optional_sources}) target_link_libraries(conky_core ${conky_libs}) add_executable(conky main.cc) target_link_libraries(conky conky_core ${conky_libs}) install(TARGETS conky_core RUNTIME DESTINATION bin LIBRARY DESTINATION ${LIB_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) else() add_executable(conky main.cc ${conky_sources} ${optional_sources}) target_link_libraries(conky ${conky_libs}) endif() install(TARGETS conky RUNTIME DESTINATION bin LIBRARY DESTINATION ${LIB_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) if(BUILD_PORT_MONITORS) install(TARGETS tcp-portmon RUNTIME DESTINATION bin LIBRARY DESTINATION ${LIB_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) endif(BUILD_PORT_MONITORS) print_target_properties(conky) conky-1.12.2/src/algebra.cc000066400000000000000000000150551404127277500154320ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "algebra.h" #include #include #include #include #include #include "config.h" #include "conky.h" #include "logging.h" /* find the operand in the given expression * returns the index of the first op character or -1 on error */ int find_match_op(const char *expr) { unsigned int idx; for (idx = 0; idx < strlen(expr); idx++) { switch (expr[idx]) { case '=': case '!': if (expr[idx + 1] != '=') { return -1; } /* falls through */ case '<': case '>': return idx; } } return -1; } int get_match_type(const char *expr) { int idx; const char *str; if ((idx = find_match_op(expr)) == -1) { return -1; } str = expr + idx; if (*str == '=' && *(str + 1) == '=') { return OP_EQ; } if (*str == '!' && *(str + 1) == '=') { return OP_NEQ; } if (*str == '>') { if (*(str + 1) == '=') { return OP_GEQ; } return OP_GT; } if (*str == '<') { if (*(str + 1) == '=') { return OP_LEQ; } return OP_LT; } return -1; } /* generic compare function * * v is actually the difference of the compared values. For strings * this is equal to the output of str(n)cmp(). Use a macro here, as * it's type-independent. */ #define COMPARE(v, t) \ switch (t) { \ case OP_GT: \ return ((v) > 0); \ case OP_LT: \ return ((v) < 0); \ case OP_EQ: \ return ((v) == 0); \ case OP_GEQ: \ return ((v) >= 0); \ case OP_LEQ: \ return ((v) <= 0); \ case OP_NEQ: \ return ((v) != 0); \ } \ return 0 int lcompare(long a, enum match_type mtype, long b) { DBGP2("comparing longs '%ld' and '%ld'", a, b); COMPARE((a - b), mtype); } int dcompare(double a, enum match_type mtype, double b) { DBGP2("comparing doubles '%.lf' and '%.lf'", a, b); COMPARE((a - b), mtype); } int scompare(const char *a, enum match_type mtype, const char *b) { DBGP2("comparing strings '%s' and '%s'", a, b); COMPARE(strcmp(a, b), mtype); } enum arg_type get_arg_type(const char *arg) { const char *p, *e; p = arg; e = arg + strlen(arg) - 1; while (p != e && (*e != 0) && *e == ' ') { e--; } while (p != e && *p == ' ') { p++; } if (*p == '"' && *e == '"') { return ARG_STRING; } if (*p == '-') { // allow negative values p++; } while (p <= e) { if (isdigit(static_cast(*p)) == 0) { break; } p++; } if (p == e + 1) { return ARG_LONG; } if (*p == '.' || *p == ',') { p++; while (p <= e) { if (isdigit(static_cast(*p)) == 0) { return ARG_BAD; } p++; } return ARG_DOUBLE; } return ARG_BAD; } char *arg_to_string(const char *arg) { const char *start; int len; start = arg; len = 0; while ((*start != 0) && *start == ' ') { start++; } if (!(*(start++) == '"')) { return nullptr; } while (start[len] != '"') { len++; } return strndup(start, len); } double arg_to_double(const char *arg) { double d; if (sscanf(arg, "%lf", &d) != 1) { NORM_ERR("converting '%s' to double failed", arg); return 0.0; } return d; } long arg_to_long(const char *arg) { long l; if (sscanf(arg, "%ld", &l) != 1) { NORM_ERR("converting '%s' to long failed", arg); return 0; } return l; } int compare(const char *expr) { char *expr_dup; int idx, mtype; enum arg_type type1, type2; long lng_a, lng_b; double dbl_a, dbl_b; idx = find_match_op(expr); mtype = get_match_type(expr); if ((idx <= 0) || mtype == -1) { NORM_ERR("failed to parse compare string '%s'", expr); return -2; } expr_dup = strdup(expr); expr_dup[idx] = '\0'; if (expr_dup[idx + 1] == '=') { expr_dup[++idx] = '\0'; } type1 = get_arg_type(expr_dup); type2 = get_arg_type(expr_dup + idx + 1); if (type1 == ARG_BAD || type2 == ARG_BAD) { NORM_ERR("Bad arguments: '%s' and '%s'", expr_dup, (expr_dup + idx + 1)); free(expr_dup); return -2; } if (type1 == ARG_LONG && type2 == ARG_DOUBLE) { type1 = ARG_DOUBLE; } if (type1 == ARG_DOUBLE && type2 == ARG_LONG) { type2 = ARG_DOUBLE; } if (type1 != type2) { NORM_ERR("trying to compare args '%s' and '%s' of different type", expr_dup, (expr_dup + idx + 1)); free(expr_dup); return -2; } switch (type1) { case ARG_STRING: { char *a, *b; a = arg_to_string(expr_dup); b = arg_to_string(expr_dup + idx + 1); idx = scompare(a, static_cast(mtype), b); free(a); free(b); free(expr_dup); return idx; } case ARG_LONG: lng_a = arg_to_long(expr_dup); lng_b = arg_to_long(expr_dup + idx + 1); free(expr_dup); return lcompare(lng_a, static_cast(mtype), lng_b); case ARG_DOUBLE: dbl_a = arg_to_double(expr_dup); dbl_b = arg_to_double(expr_dup + idx + 1); free(expr_dup); return dcompare(dbl_a, static_cast(mtype), dbl_b); case ARG_BAD: /* make_gcc_happy() */; } /* not reached */ free(expr_dup); return -2; } int check_if_match(struct text_object *obj) { std::unique_ptr expression(new char[max_user_text.get(*state)]); int val; int result = 1; generate_text_internal(expression.get(), max_user_text.get(*state), *obj->sub); DBGP("parsed arg into '%s'", expression.get()); val = compare(expression.get()); if (val == -2) { NORM_ERR("compare failed for expression '%s'", expression.get()); } else if (val == 0) { result = 0; } return result; } conky-1.12.2/src/algebra.h000066400000000000000000000027331404127277500152730ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _ALGEBRA_H #define _ALGEBRA_H enum match_type { OP_LT = 1, /* < */ OP_GT = 2, /* > */ OP_EQ = 3, /* == */ OP_LEQ = 4, /* <= */ OP_GEQ = 5, /* >= */ OP_NEQ = 6 /* != */ }; enum arg_type { ARG_BAD = 0, /* something strange */ ARG_STRING = 1, /* "asdf" */ ARG_LONG = 2, /* 123456 */ ARG_DOUBLE = 3 /* 12.456 */ }; int compare(const char *); int check_if_match(struct text_object *); #endif /* _ALGEBRA_H */ conky-1.12.2/src/apcupsd.cc000066400000000000000000000174271404127277500155010ustar00rootroot00000000000000/* * * apcupsd.c: conky module for APC UPS daemon monitoring * * Copyright (C) 2009 Jaromir Smrcek * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA. * */ #include "apcupsd.h" #include "conky.h" #include "logging.h" #include "text_object.h" #include #include #include #include #include enum _apcupsd_items { APCUPSD_NAME, APCUPSD_MODEL, APCUPSD_UPSMODE, APCUPSD_CABLE, APCUPSD_STATUS, APCUPSD_LINEV, APCUPSD_LOAD, APCUPSD_CHARGE, APCUPSD_TIMELEFT, APCUPSD_TEMP, APCUPSD_LASTXFER, _APCUPSD_COUNT }; /* type for data exchange with main thread */ #define APCUPSD_MAXSTR 32 typedef struct apcupsd_s { char items[_APCUPSD_COUNT] [APCUPSD_MAXSTR + 1]; /* e.g. items[APCUPSD_STATUS] */ char host[64]; int port; } APCUPSD_S, *PAPCUPSD_S; static APCUPSD_S apcupsd; // // encapsulated recv() // static int net_recv_ex(int sock, void *buf, int size, struct timeval *tv) { fd_set fds; int res; // wait for some data to be read do { errno = 0; FD_ZERO(&fds); FD_SET(sock, &fds); res = select(sock + 1, &fds, nullptr, nullptr, tv); } while (res < 0 && errno == EINTR); if (res < 0) { return 0; } if (res == 0) { // timeout errno = ETIMEDOUT; // select was successful, errno is now 0 return 0; } // socket ready, read the data do { errno = 0; res = recv(sock, static_cast(buf), size, 0); } while (res < 0 && errno == EINTR); if (res < 0) { return 0; } if (res == 0) { // orderly shutdown errno = ENOTCONN; return 0; } return res; } // // read whole buffer or fail // static int net_recv(int sock, void *buf, int size) { int todo = size; int off = 0; int len; struct timeval tv = {0, 250000}; while (todo != 0) { len = net_recv_ex(sock, static_cast(buf) + off, todo, &tv); if (len == 0) { return 0; } todo -= len; off += len; } return 1; } // // get one response line // static int get_line(int sock, char line[], short linesize) { // get the line length short sz; if (net_recv(sock, &sz, sizeof(sz)) == 0) { return -1; } sz = ntohs(sz); if (sz == 0) { return 0; } // get the line while (sz >= linesize) { // this is just a hack (being lazy), this should not happen anyway net_recv(sock, line, linesize); sz -= linesize; } if (net_recv(sock, line, sz) == 0) { return 0; } line[sz] = 0; return sz; } #define FILL(NAME, FIELD, FIRST) \ if (!strncmp(NAME, line, sizeof(NAME) - 1)) { \ strncpy(apc->items[FIELD], line + 11, APCUPSD_MAXSTR); \ /* remove trailing newline and assure termination */ \ apc->items[FIELD][len - 11 > APCUPSD_MAXSTR ? APCUPSD_MAXSTR : len - 12] = \ 0; \ if (FIRST) { \ char *c; \ for (c = apc->items[FIELD]; *c; ++c) \ if (*c == ' ' && c > apc->items[FIELD] + 2) { \ *c = 0; \ break; \ } \ } \ } // // fills in the data received from a socket // static int fill_items(int sock, PAPCUPSD_S apc) { char line[512]; int len; while ((len = get_line(sock, line, sizeof(line))) != 0) { // fill the right types in FILL("UPSNAME", APCUPSD_NAME, FALSE); FILL("MODEL", APCUPSD_MODEL, FALSE); FILL("UPSMODE", APCUPSD_UPSMODE, FALSE); FILL("CABLE", APCUPSD_CABLE, FALSE); FILL("STATUS", APCUPSD_STATUS, TRUE); FILL("LINEV", APCUPSD_LINEV, TRUE); FILL("LOADPCT", APCUPSD_LOAD, TRUE); FILL("BCHARGE", APCUPSD_CHARGE, TRUE); FILL("TIMELEFT", APCUPSD_TIMELEFT, TRUE); FILL("ITEMP", APCUPSD_TEMP, TRUE); FILL("LASTXFER", APCUPSD_LASTXFER, FALSE); } return static_cast(len == 0); } // // Conky update function for apcupsd data // int update_apcupsd() { int i; APCUPSD_S apc; int sock = -1; for (i = 0; i < _APCUPSD_COUNT; ++i) { memcpy(apc.items[i], "N/A", 4); // including \0 } do { struct addrinfo hints {}; struct addrinfo *ai, *rp; int res; short sz = 0; char portbuf[8]; // // connect to apcupsd daemon // memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = 0; hints.ai_protocol = 0; snprintf(portbuf, 8, "%d", apcupsd.port); res = getaddrinfo(apcupsd.host, portbuf, &hints, &ai); if (res != 0) { NORM_ERR("APCUPSD getaddrinfo: %s", gai_strerror(res)); break; } for (rp = ai; rp != nullptr; rp = rp->ai_next) { sock = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); if (sock == -1) { continue; } if (connect(sock, rp->ai_addr, rp->ai_addrlen) != -1) { break; } close(sock); sock = -1; } freeaddrinfo(ai); if (rp == nullptr) { // no error reporting, the daemon is probably not running if (sock >= 0) { close(sock); } break; } // // send status request - "status" - 6B // sz = htons(6); // no waiting to become writeable is really needed if (send(sock, &sz, sizeof(sz), 0) != sizeof(sz) || send(sock, "status", 6, 0) != 6) { perror("send"); close(sock); break; } // // read the lines of output and put them into the info structure // fill_items(sock, &apc); close(sock); } while (0); // // "atomically" copy the data into working set // memcpy(apcupsd.items, apc.items, sizeof(apcupsd.items)); return 0; } int apcupsd_scan_arg(const char *arg) { char host[64]; int port; if (sscanf(arg, "%63s %d", host, &port) != 2) { return 1; } apcupsd.port = port; strncpy(apcupsd.host, host, sizeof(apcupsd.host)); return 0; } double apcupsd_loadbarval(struct text_object *obj) { (void)obj; return atof(apcupsd.items[APCUPSD_LOAD]); } #define APCUPSD_PRINT_GENERATOR(name, idx) \ void print_apcupsd_##name(struct text_object *obj, char *p, \ unsigned int p_max_size) { \ (void)obj; \ snprintf(p, p_max_size, "%s", apcupsd.items[APCUPSD_##idx]); \ } APCUPSD_PRINT_GENERATOR(name, NAME) APCUPSD_PRINT_GENERATOR(model, MODEL) APCUPSD_PRINT_GENERATOR(upsmode, UPSMODE) APCUPSD_PRINT_GENERATOR(cable, CABLE) APCUPSD_PRINT_GENERATOR(status, STATUS) APCUPSD_PRINT_GENERATOR(linev, LINEV) APCUPSD_PRINT_GENERATOR(load, LOAD) APCUPSD_PRINT_GENERATOR(charge, CHARGE) APCUPSD_PRINT_GENERATOR(timeleft, TIMELEFT) APCUPSD_PRINT_GENERATOR(temp, TEMP) APCUPSD_PRINT_GENERATOR(lastxfer, LASTXFER) #undef APCUPSD_PRINT_GENERATOR conky-1.12.2/src/apcupsd.h000066400000000000000000000035331404127277500153340ustar00rootroot00000000000000/* * * apcupsd.h: conky module for APC UPS daemon monitoring * * Copyright (C) 2009 Jaromir Smrcek * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA. * */ #ifndef APCUPSD_H_ #define APCUPSD_H_ int apcupsd_scan_arg(const char *); /* Service routine for the conky main thread */ int update_apcupsd(void); double apcupsd_loadbarval(struct text_object *); void print_apcupsd_name(struct text_object *, char *, unsigned int); void print_apcupsd_model(struct text_object *, char *, unsigned int); void print_apcupsd_upsmode(struct text_object *, char *, unsigned int); void print_apcupsd_cable(struct text_object *, char *, unsigned int); void print_apcupsd_status(struct text_object *, char *, unsigned int); void print_apcupsd_linev(struct text_object *, char *, unsigned int); void print_apcupsd_load(struct text_object *, char *, unsigned int); void print_apcupsd_charge(struct text_object *, char *, unsigned int); void print_apcupsd_timeleft(struct text_object *, char *, unsigned int); void print_apcupsd_temp(struct text_object *, char *, unsigned int); void print_apcupsd_lastxfer(struct text_object *, char *, unsigned int); #endif /*APCUPSD_H_*/ conky-1.12.2/src/audacious.cc000066400000000000000000000205371404127277500160130ustar00rootroot00000000000000/* * * audacious.c: conky support for audacious music player * * Copyright (C) 2005-2007 Philip Kovacs pkovacs@users.sourceforge.net * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA. * */ #include #include #include #include "audacious.h" #include "conky.h" #include "logging.h" #include "update-cb.hh" #include #ifdef NEW_AUDACIOUS_FOUND #include #include #include #else /* NEW_AUDACIOUS_FOUND */ #include #define audacious_remote_is_running(x) xmms_remote_is_running(x) #define audacious_remote_is_paused(x) xmms_remote_is_paused(x) #define audacious_remote_is_playing(x) xmms_remote_is_playing(x) #define audacious_remote_get_playlist_pos(x) xmms_remote_get_playlist_pos(x) #define audacious_remote_get_playlist_title(x, y) \ xmms_remote_get_playlist_title(x, y) #define audacious_remote_get_playlist_time(x, y) \ xmms_remote_get_playlist_time(x, y) #define audacious_remote_get_output_time(x) xmms_remote_get_output_time(x) #define audacious_remote_get_info(w, x, y, z) xmms_remote_get_info(w, x, y, z) #define audacious_remote_get_playlist_file(x, y) \ xmms_remote_get_playlist_file(x, y) #define audacious_remote_get_playlist_length(x) \ xmms_remote_get_playlist_length(x) #endif /* NEW_AUDACIOUS_FOUND */ namespace { enum aud_status { AS_NOT_RUNNING, AS_PAUSED, AS_PLAYING, AS_STOPPED }; const char *const as_message[] = {"Not running", "Paused", "Playing", "Stopped"}; struct aud_result { std::string title; std::string filename; int length; // in ms int position; // in ms int bitrate; int frequency; int channels; int playlist_length; int playlist_position; int main_volume; aud_status status; aud_result() : length(0), position(0), bitrate(0), frequency(0), channels(0), playlist_length(0), playlist_position(0), main_volume(0), status(AS_NOT_RUNNING) {} }; class audacious_cb : public conky::callback { typedef conky::callback Base; #ifdef NEW_AUDACIOUS_FOUND DBusGProxy *session; #else gint session; #endif protected: virtual void work(); public: audacious_cb(uint32_t period) : Base(period, false, Tuple()) { #ifdef NEW_AUDACIOUS_FOUND DBusGConnection *connection = dbus_g_bus_get(DBUS_BUS_SESSION, nullptr); if (!connection) throw std::runtime_error("unable to establish dbus connection"); session = dbus_g_proxy_new_for_name(connection, AUDACIOUS_DBUS_SERVICE, AUDACIOUS_DBUS_PATH, AUDACIOUS_DBUS_INTERFACE); if (!session) throw std::runtime_error("unable to create dbus proxy"); #else session = 0; #endif /* NEW_AUDACIOUS_FOUND */ } #ifdef NEW_AUDACIOUS_FOUND ~audacious_cb() { /* release reference to dbus proxy */ g_object_unref(session); } #endif }; /* --------------------------------------------------- * Worker thread function for audacious data sampling. * --------------------------------------------------- */ void audacious_cb::work() { aud_result tmp; gchar *psong, *pfilename; psong = nullptr; pfilename = nullptr; do { if (!audacious_remote_is_running(session)) { tmp.status = AS_NOT_RUNNING; break; } /* Player status */ if (audacious_remote_is_paused(session)) { tmp.status = AS_PAUSED; } else if (audacious_remote_is_playing(session)) { tmp.status = AS_PLAYING; } else { tmp.status = AS_STOPPED; } /* Current song title */ tmp.playlist_position = audacious_remote_get_playlist_pos(session); psong = audacious_remote_get_playlist_title(session, tmp.playlist_position); if (psong) { tmp.title = psong; g_free(psong); } /* Current song length */ tmp.length = audacious_remote_get_playlist_time(session, tmp.playlist_position); /* Current song position */ tmp.position = audacious_remote_get_output_time(session); /* Current song bitrate, frequency, channels */ audacious_remote_get_info(session, &tmp.bitrate, &tmp.frequency, &tmp.channels); /* Current song filename */ pfilename = audacious_remote_get_playlist_file(session, tmp.playlist_position); if (pfilename) { tmp.filename = pfilename; g_free(pfilename); } /* Length of the Playlist (number of songs) */ tmp.playlist_length = audacious_remote_get_playlist_length(session); /* Main volume */ tmp.main_volume = audacious_remote_get_main_volume(session); } while (0); { /* Deliver the refreshed items array to audacious_items. */ std::lock_guard lock(result_mutex); result = tmp; } } aud_result get_res() { uint32_t period = std::max( lround(music_player_interval.get(*state) / active_update_interval()), 1l); return conky::register_cb(period)->get_result_copy(); } } // namespace void print_audacious_status(struct text_object *, char *p, unsigned int p_max_size) { const aud_result &res = get_res(); snprintf(p, p_max_size, "%s", as_message[res.status]); } void print_audacious_title(struct text_object *obj, char *p, unsigned int p_max_size) { snprintf(p, std::min((unsigned int)obj->data.i, p_max_size), "%s", get_res().title.c_str()); } void print_audacious_filename(struct text_object *obj, char *p, unsigned int p_max_size) { snprintf(p, std::min((unsigned int)obj->data.i, p_max_size), "%s", get_res().filename.c_str()); } double audacious_barval(struct text_object *) { const aud_result &res = get_res(); return (double)res.position / res.length; } void print_audacious_length(struct text_object *, char *p, unsigned int p_max_size) { const aud_result &res = get_res(); int sec = res.length / 1000; snprintf(p, p_max_size, "%d:%.2d", sec / 60, sec % 60); } void print_audacious_length_seconds(struct text_object *, char *p, unsigned int p_max_size) { snprintf(p, p_max_size, "%d", get_res().length); } void print_audacious_position(struct text_object *, char *p, unsigned int p_max_size) { const aud_result &res = get_res(); int sec = res.position / 1000; snprintf(p, p_max_size, "%d:%.2d", sec / 60, sec % 60); } void print_audacious_position_seconds(struct text_object *, char *p, unsigned int p_max_size) { snprintf(p, p_max_size, "%d", get_res().position); } void print_audacious_bitrate(struct text_object *, char *p, unsigned int p_max_size) { snprintf(p, p_max_size, "%d", get_res().bitrate); } void print_audacious_frequency(struct text_object *, char *p, unsigned int p_max_size) { snprintf(p, p_max_size, "%d", get_res().frequency); } void print_audacious_channels(struct text_object *, char *p, unsigned int p_max_size) { snprintf(p, p_max_size, "%d", get_res().channels); } void print_audacious_playlist_length(struct text_object *, char *p, unsigned int p_max_size) { snprintf(p, p_max_size, "%d", get_res().playlist_length); } void print_audacious_playlist_position(struct text_object *, char *p, unsigned int p_max_size) { snprintf(p, p_max_size, "%d", get_res().playlist_position + 1); } void print_audacious_main_volume(struct text_object *, char *p, unsigned int p_max_size) { snprintf(p, p_max_size, "%d", get_res().main_volume); } conky-1.12.2/src/audacious.h000066400000000000000000000041061404127277500156470ustar00rootroot00000000000000/* * * audacious.h: conky support for audacious music player * * Copyright (C) 2005-2007 Philip Kovacs pkovacs@users.sourceforge.net * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA. * */ #ifndef AUDACIOUS_H #define AUDACIOUS_H void print_audacious_status(struct text_object *, char *, unsigned int); void print_audacious_title(struct text_object *, char *, unsigned int); void print_audacious_length(struct text_object *, char *, unsigned int); void print_audacious_length_seconds(struct text_object *, char *, unsigned int); void print_audacious_position(struct text_object *, char *, unsigned int); void print_audacious_position_seconds(struct text_object *, char *, unsigned int); void print_audacious_bitrate(struct text_object *, char *, unsigned int); void print_audacious_frequency(struct text_object *, char *, unsigned int); void print_audacious_channels(struct text_object *, char *, unsigned int); void print_audacious_filename(struct text_object *, char *, unsigned int); void print_audacious_playlist_length(struct text_object *, char *, unsigned int); void print_audacious_playlist_position(struct text_object *, char *, unsigned int); void print_audacious_main_volume(struct text_object *, char *, unsigned int); double audacious_barval(struct text_object *); #endif /* AUDACIOUS_H */ conky-1.12.2/src/bsdapm.cc000066400000000000000000000103601404127277500152750ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include #include "config.h" #include "conky.h" #include "text_object.h" #define APMDEV "/dev/apm" #define APM_UNKNOWN 255 #ifndef APM_AC_OFF #define APM_AC_OFF 0 #endif #ifndef APM_AC_ON #define APM_AC_ON 1 #endif #ifndef APM_BATT_CHARGING #define APM_BATT_CHARGING 3 #endif static int apm_getinfo(int fd, apm_info_t aip) { #ifdef __OpenBSD__ if (ioctl(fd, APM_IOC_GETPOWER, aip) == -1) { #else if (ioctl(fd, APMIO_GETINFO, aip) == -1) { #endif return -1; } return 0; } void print_apm_adapter(struct text_object *obj, char *p, unsigned int p_max_size) { int fd; const char *out; #ifdef __OpenBSD__ struct apm_power_info a_info; #else struct apm_info a_info; #endif (void)obj; fd = open(APMDEV, O_RDONLY); if (fd < 0) { snprintf(p, p_max_size, "%s", "ERR"); return; } if (apm_getinfo(fd, &a_info) != 0) { close(fd); snprintf(p, p_max_size, "%s", "ERR"); return; } close(fd); #ifdef __OpenBSD__ #define ai_acline ac_state #endif switch (a_info.ai_acline) { case APM_AC_OFF: out = "off-line"; break; case APM_AC_ON: #ifdef __OpenBSD__ #define ai_batt_stat battery_state #endif if (a_info.ai_batt_stat == APM_BATT_CHARGING) { out = "charging"; } else { out = "on-line"; } break; default: out = "unknown"; break; } snprintf(p, p_max_size, "%s", out); } void print_apm_battery_life(struct text_object *obj, char *p, unsigned int p_max_size) { int fd; u_int batt_life; const char *out; #ifdef __OpenBSD__ struct apm_power_info a_info; #else struct apm_info a_info; #endif (void)obj; fd = open(APMDEV, O_RDONLY); if (fd < 0) { snprintf(p, p_max_size, "%s", "ERR"); return; } if (apm_getinfo(fd, &a_info) != 0) { close(fd); snprintf(p, p_max_size, "%s", "ERR"); return; } close(fd); #ifdef __OpenBSD__ #define ai_batt_life battery_life #endif batt_life = a_info.ai_batt_life; if (batt_life == APM_UNKNOWN) { out = "unknown"; } else if (batt_life <= 100) { snprintf(p, p_max_size, "%d%%", batt_life); return; } else { out = "ERR"; } snprintf(p, p_max_size, "%s", out); } void print_apm_battery_time(struct text_object *obj, char *p, unsigned int p_max_size) { int fd; int batt_time; #ifdef __OpenBSD__ int h, m; struct apm_power_info a_info; #else int h, m, s; struct apm_info a_info; #endif (void)obj; fd = open(APMDEV, O_RDONLY); if (fd < 0) { snprintf(p, p_max_size, "%s", "ERR"); return; } if (apm_getinfo(fd, &a_info) != 0) { close(fd); snprintf(p, p_max_size, "%s", "ERR"); return; } close(fd); #ifdef __OpenBSD__ #define ai_batt_time minutes_left #endif batt_time = a_info.ai_batt_time; if (batt_time == -1) { snprintf(p, p_max_size, "%s", "unknown"); } else #ifdef __OpenBSD__ { h = batt_time / 60; m = batt_time % 60; snprintf(p, p_max_size, "%2d:%02d", h, m); } #else { h = batt_time; s = h % 60; h /= 60; m = h % 60; h /= 60; snprintf(p, p_max_size, "%2d:%02d:%02d", h, m, s); } #endif } conky-1.12.2/src/bsdapm.h000066400000000000000000000024601404127277500151410ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _BSDAPM_H #define _BSDAPM_H void print_apm_adapter(struct text_object *, char *, unsigned int); void print_apm_battery_life(struct text_object *, char *, unsigned int); void print_apm_battery_time(struct text_object *, char *, unsigned int); #endif /* _BSDAPM_H */ conky-1.12.2/src/build.h.in000066400000000000000000000002311404127277500153710ustar00rootroot00000000000000#ifndef __BUILD_H #define __BUILD_H /* Conky build info */ #define BUILD_DATE "@BUILD_DATE@" #define BUILD_ARCH "@BUILD_ARCH@" #endif /* __BUILD_H */ conky-1.12.2/src/c++wrap.cc000066400000000000000000000040671404127277500153000ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (C) 2010 Pavel Labath et al. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "config.h" #include "c++wrap.hh" #include #include /* force use of POSIX strerror_r instead of non-portable GNU specific */ #ifdef _GNU_SOURCE #undef _GNU_SOURCE #endif #include #if __cplusplus <= 199711L #define thread_local __thread #endif #if !defined(HAVE_PIPE2) || !defined(HAVE_O_CLOEXEC) #include namespace { int pipe2_emulate(int pipefd[2], int flags) { if (pipe(pipefd) == -1) { return -1; } if ((flags & O_CLOEXEC) != 0) { // we emulate O_CLOEXEC if the system does not have it // not very thread-safe, but at least it works for (int i = 0; i < 2; ++i) { int r = fcntl(pipefd[i], F_GETFD); if (r == -1) { return -1; } if (fcntl(pipefd[i], F_SETFD, r | FD_CLOEXEC) == -1) { return -1; } } } return 0; } int (*const pipe2_ptr)(int[2], int) = &pipe2_emulate; } // namespace #else int (*const pipe2_ptr)(int[2], int) = &pipe2; #endif std::string strerror_r(int errnum) { static thread_local char buf[100]; if (strerror_r(errnum, buf, sizeof buf) != 0) { snprintf(buf, sizeof buf, "Unknown error %i", errnum); } return buf; } std::pair pipe2(int flags) { int fd[2]; if (pipe2_ptr(fd, flags) == -1) { throw errno_error("pipe2"); } { return std::pair(fd[0], fd[1]); } } conky-1.12.2/src/c++wrap.hh000066400000000000000000000024631404127277500153100ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (C) 2010 Pavel Labath et al. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef CPPWRAP_HH #define CPPWRAP_HH #ifdef HAVE_O_CLOEXEC #include #else enum { O_CLOEXEC = 02000000 }; #endif #include #include #include #include std::string strerror_r(int errnum); std::pair pipe2(int flags); class errno_error : public std::runtime_error { typedef std::runtime_error Base; public: explicit errno_error(const std::string &prefix, int err_ = errno) : Base(prefix + ": " + strerror_r(err_)), err(err_) {} const int err; }; #endif /* CPPWRAP_HH */ conky-1.12.2/src/ccurl_thread.cc000066400000000000000000000145571404127277500165020ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "ccurl_thread.h" #include #include #include "conky.h" #include "logging.h" #include "text_object.h" #ifdef DEBUG #include #endif /* DEBUG */ #include /* * The following code is the conky curl thread lib, which can be re-used to * create any curl-based object (see weather and rss). Below is an * implementation of a curl-only object ($curl) which can also be used as an * example. */ namespace priv { /* callback used by curl for parsing the header data */ size_t curl_internal::parse_header_cb(void *ptr, size_t size, size_t nmemb, void *data) { curl_internal *obj = static_cast(data); const char *value = static_cast(ptr); size_t realsize = size * nmemb; if (realsize > 0 && (value[realsize - 1] == '\r' || value[realsize - 1] == 0)) { --realsize; } if (strncmp(value, "Last-Modified: ", 15) == EQUAL) { obj->last_modified = std::string(value + 15, realsize - 15); } else if (strncmp(value, "ETag: ", 6) == EQUAL) { obj->etag = std::string(value + 6, realsize - 6); } return size * nmemb; } /* callback used by curl for writing the received data */ size_t curl_internal::write_cb(void *ptr, size_t size, size_t nmemb, void *data) { curl_internal *obj = static_cast(data); const char *value = static_cast(ptr); size_t realsize = size * nmemb; obj->data += std::string(value, realsize); return realsize; } curl_internal::curl_internal(const std::string &url) : curl(curl_easy_init()) { if (!curl) throw std::runtime_error("curl_easy_init() failed"); curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1); curl_easy_setopt(curl, CURLOPT_HEADERDATA, this); curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, parse_header_cb); curl_easy_setopt(curl, CURLOPT_WRITEDATA, this); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); curl_easy_setopt(curl, CURLOPT_USERAGENT, "conky-curl/1.1"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 1000); curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 60); // curl's usage of alarm()+longjmp() is a really bad idea for multi-threaded // applications curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); } /* fetch our datums */ void curl_internal::do_work() { CURLcode res; struct headers_ { struct curl_slist *h; headers_() : h(nullptr) {} ~headers_() { curl_slist_free_all(h); } } headers; data.clear(); if (!last_modified.empty()) { headers.h = curl_slist_append( headers.h, ("If-Modified-Since: " + last_modified).c_str()); last_modified.clear(); } if (!etag.empty()) { headers.h = curl_slist_append(headers.h, ("If-None-Match: " + etag).c_str()); etag.clear(); } curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers.h); res = curl_easy_perform(curl); if (res == CURLE_OK) { long http_status_code; if (curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_status_code) == CURLE_OK) { switch (http_status_code) { case 200: process_data(); break; case 304: break; default: NORM_ERR("curl: no data from server, got HTTP status %ld", http_status_code); break; } } else { NORM_ERR("curl: no HTTP status from server"); } } else { NORM_ERR("curl: could not retrieve data from server"); } } } // namespace priv namespace { class simple_curl_cb : public curl_callback { typedef curl_callback Base; protected: virtual void process_data() { std::lock_guard lock(result_mutex); result = data; } public: simple_curl_cb(uint32_t period, const std::string &uri) : Base(period, Tuple(uri)) {} }; } // namespace /* * This is where the $curl section begins. */ struct curl_data { char *uri; float interval; }; /* prints result data to text buffer, used by $curl */ void ccurl_process_info(char *p, int p_max_size, const std::string &uri, int interval) { uint32_t period = std::max(lround(interval / active_update_interval()), 1l); auto cb = conky::register_cb(period, uri); strncpy(p, cb->get_result_copy().c_str(), p_max_size); } void curl_parse_arg(struct text_object *obj, const char *arg) { struct curl_data *cd; float interval = 0; char *space; if (strlen(arg) < 1) { NORM_ERR("wrong number of arguments for $curl"); return; } cd = static_cast(malloc(sizeof(struct curl_data))); memset(cd, 0, sizeof(struct curl_data)); // Default to a 15 minute interval cd->interval = 15 * 60; cd->uri = strdup(arg); space = strchr(cd->uri, ' '); if (space) { // If an explicit interval was given, use that char *interval_str = &space[1]; *space = '\0'; sscanf(interval_str, "%f", &interval); cd->interval = interval > 0 ? interval * 60 : active_update_interval(); } obj->data.opaque = cd; } void curl_print(struct text_object *obj, char *p, unsigned int p_max_size) { struct curl_data *cd = static_cast(obj->data.opaque); if (!cd) { NORM_ERR("error processing Curl data"); return; } ccurl_process_info(p, p_max_size, cd->uri, cd->interval); } void curl_obj_free(struct text_object *obj) { struct curl_data *cd = static_cast(obj->data.opaque); free_and_zero(cd->uri); free_and_zero(obj->data.opaque); } conky-1.12.2/src/ccurl_thread.h000066400000000000000000000051561404127277500163370ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _CURL_THREAD_H_ #define _CURL_THREAD_H_ #include #include "logging.h" #include "update-cb.hh" namespace priv { // factored out stuff that does not depend on the template parameters class curl_internal { public: std::string last_modified; std::string etag; std::string data; CURL *curl; static size_t parse_header_cb(void *ptr, size_t size, size_t nmemb, void *data); static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data); void do_work(); // called by do_work() after downloading data from the uri // it should populate the result variable virtual void process_data() = 0; explicit curl_internal(const std::string &url); virtual ~curl_internal() { if (curl) curl_easy_cleanup(curl); } }; } // namespace priv /* * Curl callback class template * the key is an url */ template class curl_callback : public conky::callback, public priv::curl_internal { typedef conky::callback Base1; typedef priv::curl_internal Base2; protected: virtual void work() { DBGP("reading curl data from '%s'", std::get<0>(Base1::tuple).c_str()); do_work(); } public: curl_callback(uint32_t period, const typename Base1::Tuple &tuple) : Base1(period, false, tuple), Base2(std::get<0>(tuple)) {} }; /* $curl exports begin */ /* runs instance of $curl */ void ccurl_process_info(char *p, int p_max_size, const std::string &uri, int interval); void curl_parse_arg(struct text_object *, const char *); void curl_print(struct text_object *, char *, unsigned int); void curl_obj_free(struct text_object *); /* $curl exports end */ #endif /* _CURL_THREAD_H_ */ conky-1.12.2/src/cmus.cc000066400000000000000000000155441404127277500150070ustar00rootroot00000000000000/* * * CMUS Conky integration * * Please see COPYING for details * * Copyright (c) 2008, Henri Häkkinen * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "conky.h" #include "logging.h" #include "text_object.h" #include #include #include #include #include #include #include "update-cb.hh" namespace { struct cmus_result { std::string state; std::string file; std::string title; std::string artist; std::string album; std::string totaltime; std::string curtime; std::string random; std::string repeat; std::string aaa; std::string track; std::string genre; std::string date; float progress; float timeleft; }; class cmus_cb : public conky::callback { typedef conky::callback Base; protected: virtual void work(); public: explicit cmus_cb(uint32_t period) : Base(period, false, Tuple()) {} }; void cmus_cb::work() { cmus_result cmus; FILE *fp; fp = popen("cmus-remote -Q 2>/dev/null", "r"); if (!fp) { cmus.state = "Can't run 'cmus-remote -Q'"; } else { while (1) { char line[255]; char *p; /* Read a line from the pipe and strip the possible '\n'. */ if (!fgets(line, 255, fp)) break; if ((p = strrchr(line, '\n'))) *p = '\0'; /* Parse infos. */ if (strncmp(line, "status ", 7) == 0) { cmus.state = line + 7; } else if (strncmp(line, "file ", 5) == 0) { cmus.file = line + 5; } else if (strncmp(line, "tag artist ", 11) == 0) { cmus.artist = line + 11; } else if (strncmp(line, "tag title ", 10) == 0) { cmus.title = line + 10; } else if (strncmp(line, "tag album ", 10) == 0) { cmus.album = line + 10; } else if (strncmp(line, "duration ", 9) == 0) { cmus.totaltime = line + 9; } else if (strncmp(line, "position ", 9) == 0) { cmus.curtime = line + 9; cmus.timeleft = atoi(cmus.totaltime.c_str()) - atoi(cmus.curtime.c_str()); if (cmus.curtime.size() > 0) { cmus.progress = static_cast(atoi(cmus.curtime.c_str())) / atoi(cmus.totaltime.c_str()); } else { cmus.progress = 0; } } else if (strncmp(line, "set shuffle ", 12) == 0) { cmus.random = (strncmp(line + 12, "true", 4) == 0 ? "on" : "off"); } else if (strncmp(line, "set repeat ", 11) == 0) { cmus.repeat = (strncmp((line + 11), "true", 4) == 0 ? "all" : "off"); } else if (strncmp(line, "set repeat_current ", 19) == 0) { cmus.repeat = (strncmp((line + 19), "true", 4) == 0 ? "song" : cmus.repeat); } else if (strncmp(line, "set aaa_mode ", 13) == 0) { cmus.aaa = line + 13; } else if (strncmp(line, "tag tracknumber ", 16) == 0) { cmus.track = line + 16; } else if (strncmp(line, "tag genre ", 10) == 0) { cmus.genre = line + 10; } else if (strncmp(line, "tag date ", 9) == 0) { cmus.date = line + 9; } } } pclose(fp); std::lock_guard l(result_mutex); result = cmus; } } // namespace #define CMUS_PRINT_GENERATOR(type, alt) \ void print_cmus_##type(struct text_object *obj, char *p, \ unsigned int p_max_size) { \ (void)obj; \ uint32_t period = std::max( \ lround(music_player_interval.get(*state) / active_update_interval()), \ 1l); \ const cmus_result &cmus = \ conky::register_cb(period)->get_result_copy(); \ snprintf(p, p_max_size, "%s", \ (cmus.type.length() ? cmus.type.c_str() : alt)); \ } CMUS_PRINT_GENERATOR(state, "Off") CMUS_PRINT_GENERATOR(file, "no file") CMUS_PRINT_GENERATOR(title, "no title") CMUS_PRINT_GENERATOR(artist, "no artist") CMUS_PRINT_GENERATOR(album, "no album") CMUS_PRINT_GENERATOR(random, "") CMUS_PRINT_GENERATOR(repeat, "") CMUS_PRINT_GENERATOR(aaa, "all") CMUS_PRINT_GENERATOR(track, "no track") CMUS_PRINT_GENERATOR(genre, "") CMUS_PRINT_GENERATOR(date, "") uint8_t cmus_percent(struct text_object *obj) { (void)obj; uint32_t period = std::max( lround(music_player_interval.get(*state) / active_update_interval()), 1l); const cmus_result &cmus = conky::register_cb(period)->get_result_copy(); return static_cast(round(cmus.progress * 100.0f)); } double cmus_progress(struct text_object *obj) { (void)obj; uint32_t period = std::max( lround(music_player_interval.get(*state) / active_update_interval()), 1l); const cmus_result &cmus = conky::register_cb(period)->get_result_copy(); return static_cast(cmus.progress); } void print_cmus_totaltime(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; uint32_t period = std::max( lround(music_player_interval.get(*state) / active_update_interval()), 1l); const cmus_result &cmus = conky::register_cb(period)->get_result_copy(); format_seconds_short(p, p_max_size, atol(cmus.totaltime.c_str())); } void print_cmus_timeleft(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; uint32_t period = std::max( lround(music_player_interval.get(*state) / active_update_interval()), 1l); const cmus_result &cmus = conky::register_cb(period)->get_result_copy(); // format_seconds_short(p, p_max_size, atol(cmus.timeleft.c_str())); format_seconds_short(p, p_max_size, static_cast(cmus.timeleft)); } void print_cmus_curtime(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; uint32_t period = std::max( lround(music_player_interval.get(*state) / active_update_interval()), 1l); const cmus_result &cmus = conky::register_cb(period)->get_result_copy(); format_seconds_short(p, p_max_size, atol(cmus.curtime.c_str())); } #undef CMUS_PRINT_GENERATOR conky-1.12.2/src/cmus.h000066400000000000000000000036301404127277500146420ustar00rootroot00000000000000/* * * CMUS Conky integration * * Please see COPYING for details * * Copyright (c) 2011, Christian Brabandt * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef CMUS_H_ #define CMUS_H_ void print_cmus_state(struct text_object *, char *, unsigned int); void print_cmus_file(struct text_object *, char *, unsigned int); void print_cmus_title(struct text_object *, char *, unsigned int); void print_cmus_artist(struct text_object *, char *, unsigned int); void print_cmus_album(struct text_object *, char *, unsigned int); void print_cmus_totaltime(struct text_object *, char *, unsigned int); void print_cmus_timeleft(struct text_object *, char *, unsigned int); void print_cmus_curtime(struct text_object *, char *, unsigned int); void print_cmus_random(struct text_object *, char *, unsigned int); void print_cmus_repeat(struct text_object *, char *, unsigned int); void print_cmus_aaa(struct text_object *, char *, unsigned int); void print_cmus_track(struct text_object *, char *, unsigned int); void print_cmus_genre(struct text_object *, char *, unsigned int); void print_cmus_date(struct text_object *, char *, unsigned int); void print_cmus_bar(struct text_object *, char *, unsigned int); double cmus_progress(struct text_object *obj); uint8_t cmus_percent(struct text_object *obj); #endif /* CMUS_H_ */ conky-1.12.2/src/colours.cc000066400000000000000000000131161404127277500155170ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "conky.h" #include "logging.h" #ifdef BUILD_X11 #include "x11.h" #endif /* precalculated: 31/255, and 63/255 */ #define CONST_8_TO_5_BITS 0.12156862745098 #define CONST_8_TO_6_BITS 0.247058823529412 short colour_depth = 0; long redmask, greenmask, bluemask; void set_up_gradient() { #ifdef BUILD_X11 if (out_to_x.get(*state)) { colour_depth = DisplayPlanes(display, screen); } else #endif /* BUILD_X11 */ { colour_depth = 16; } if (colour_depth != 24 && colour_depth != 16) { NORM_ERR( "using non-standard colour depth, gradients may look like a " "lolly-pop"); } redmask = 0; greenmask = 0; bluemask = 0; for (int i = (colour_depth / 3) - 1; i >= 0; i--) { redmask |= 1 << i; greenmask |= 1 << i; bluemask |= 1 << i; } if (colour_depth % 3 == 1) { greenmask |= 1 << (colour_depth / 3); } redmask = redmask << (2 * colour_depth / 3 + colour_depth % 3); greenmask = greenmask << (colour_depth / 3); } /* adjust colour values depending on colour depth */ unsigned int adjust_colours(unsigned int colour) { double r, g, b; if (colour_depth == 0) { set_up_gradient(); } if (colour_depth == 16) { r = (colour & 0xff0000) >> 16; g = (colour & 0xff00) >> 8; b = colour & 0xff; colour = static_cast(r * CONST_8_TO_5_BITS) << 11; colour |= static_cast(g * CONST_8_TO_6_BITS) << 5; colour |= static_cast(b * CONST_8_TO_5_BITS); } return colour; } /* this function returns the next colour between two colours for a gradient */ std::unique_ptr do_gradient(int width, unsigned long first_colour, unsigned long last_colour) { int red1, green1, blue1; // first colour int red2, green2, blue2; // last colour int reddiff, greendiff, bluediff; // difference short redshift = (2 * colour_depth / 3 + colour_depth % 3); short greenshift = (colour_depth / 3); // Make sure the width is always at least 2 width = std::max(2, width); std::unique_ptr colours(new unsigned long[width]); if (colour_depth == 0) { set_up_gradient(); } red1 = (first_colour & redmask) >> redshift; green1 = (first_colour & greenmask) >> greenshift; blue1 = first_colour & bluemask; red2 = (last_colour & redmask) >> redshift; green2 = (last_colour & greenmask) >> greenshift; blue2 = last_colour & bluemask; reddiff = abs(red1 - red2); greendiff = abs(green1 - green2); bluediff = abs(blue1 - blue2); #ifdef HAVE_OPENMP #pragma omp parallel for schedule(dynamic, 10) shared(colours) #endif /* HAVE_OPENMP */ for (int i = 0; i < width; i++) { int red3 = 0, green3 = 0, blue3 = 0; // colour components float factor = (static_cast(i) / (width - 1)); /* the '+ 0.5' bit rounds our floats to ints properly */ if (red1 >= red2) { red3 = -(factor * reddiff) - 0.5; } else if (red1 < red2) { red3 = factor * reddiff + 0.5; } if (green1 >= green2) { green3 = -(factor * greendiff) - 0.5; } else if (green1 < green2) { green3 = factor * greendiff + 0.5; } if (blue1 >= blue2) { blue3 = -(factor * bluediff) - 0.5; } else if (blue1 < blue2) { blue3 = factor * bluediff + 0.5; } red3 += red1; green3 += green1; blue3 += blue1; if (red3 < 0) { red3 = 0; } if (green3 < 0) { green3 = 0; } if (blue3 < 0) { blue3 = 0; } if (red3 > bluemask) { red3 = bluemask; } if (green3 > bluemask) { green3 = bluemask; } if (blue3 > bluemask) { blue3 = bluemask; } colours[i] = (red3 << redshift) | (green3 << greenshift) | blue3; } return colours; } #ifdef BUILD_X11 long get_x11_color(const char *name) { XColor color; color.pixel = 0; if (XParseColor(display, DefaultColormap(display, screen), name, &color) == 0) { /* lets check if it's a hex colour with the # missing in front * if yes, then do something about it */ char newname[DEFAULT_TEXT_BUFFER_SIZE]; newname[0] = '#'; strncpy(&newname[1], name, DEFAULT_TEXT_BUFFER_SIZE - 1); /* now lets try again */ if (XParseColor(display, DefaultColormap(display, screen), &newname[0], &color) == 0) { NORM_ERR("can't parse X color '%s'", name); return 0xFF00FF; } } if (XAllocColor(display, DefaultColormap(display, screen), &color) == 0) { NORM_ERR("can't allocate X color '%s'", name); } return static_cast(color.pixel); } long get_x11_color(const std::string &colour) { return get_x11_color(colour.c_str()); } #endif conky-1.12.2/src/colours.h000066400000000000000000000026161404127277500153640ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _COLOURS_H #define _COLOURS_H #include #include unsigned int adjust_colours(unsigned int); std::unique_ptr do_gradient(int, unsigned long, unsigned long); long get_x11_color(const std::string &colour); // XXX: when everyone uses C++ strings, remove this C version long get_x11_color(const char *); #endif /* _COLOURS_H */ conky-1.12.2/src/combine.cc000066400000000000000000000150141404127277500154440ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include "core.h" #include "logging.h" #include "text_object.h" struct combine_data { char *left; char *seperation; char *right; }; void parse_combine_arg(struct text_object *obj, const char *arg) { struct combine_data *cd; unsigned int i, j; unsigned int indenting = 0; // vars can be used as args for other vars int startvar[2]; int endvar[2]; startvar[0] = endvar[0] = startvar[1] = endvar[1] = -1; j = 0; for (i = 0; arg[i] != 0 && j < 2; i++) { if (startvar[j] == -1) { if (arg[i] == '$') { startvar[j] = i; } } else if (endvar[j] == -1) { if (arg[i] == '{') { indenting++; } else if (arg[i] == '}') { indenting--; } if (indenting == 0 && arg[i + 1] < 48) { //<48 has 0, $, and the most used chars not used // in varnames but not { or } endvar[j] = i + 1; j++; } } } if (startvar[0] >= 0 && endvar[0] >= 0 && startvar[1] >= 0 && endvar[1] >= 0) { cd = static_cast(malloc(sizeof(struct combine_data))); memset(cd, 0, sizeof(struct combine_data)); cd->left = static_cast(malloc(endvar[0] - startvar[0] + 1)); cd->seperation = static_cast(malloc(startvar[1] - endvar[0] + 1)); cd->right = static_cast(malloc(endvar[1] - startvar[1] + 1)); strncpy(cd->left, arg + startvar[0], endvar[0] - startvar[0]); cd->left[endvar[0] - startvar[0]] = 0; strncpy(cd->seperation, arg + endvar[0], startvar[1] - endvar[0]); cd->seperation[startvar[1] - endvar[0]] = 0; strncpy(cd->right, arg + startvar[1], endvar[1] - startvar[1]); cd->right[endvar[1] - startvar[1]] = 0; obj->sub = static_cast(malloc(sizeof(struct text_object))); extract_variable_text_internal(obj->sub, cd->left); obj->sub->sub = static_cast(malloc(sizeof(struct text_object))); extract_variable_text_internal(obj->sub->sub, cd->right); obj->data.opaque = cd; } else { throw combine_needs_2_args_error(); } } void print_combine(struct text_object *obj, char *p, unsigned int p_max_size) { auto *cd = static_cast(obj->data.opaque); std::vector> buf; buf.resize(2); buf[0].resize(max_user_text.get(*state)); buf[1].resize(max_user_text.get(*state)); int i, j; int p_len_remaining = p_max_size - 1; long longest = 0; int nextstart; int nr_rows[2]; struct llrows { char *row; struct llrows *next; }; struct llrows *ll_rows[2], *current[2]; struct text_object *objsub = obj->sub; if ((cd == nullptr) || (p_max_size == 0)) { return; } p[0] = 0; for (i = 0; i < 2; i++) { nr_rows[i] = 1; nextstart = 0; ll_rows[i] = static_cast(malloc(sizeof(struct llrows))); current[i] = ll_rows[i]; for (j = 0; j < i; j++) { objsub = objsub->sub; } generate_text_internal(&(buf[i][0]), max_user_text.get(*state), *objsub); for (j = 0; buf[i][j] != 0; j++) { if (buf[i][j] == '\t') { buf[i][j] = ' '; } if (buf[i][j] == '\n') { buf[i][j] = 0; // the vars inside combine may not have a \n at the end } if (buf[i][j] == 2) { // \002 is used instead of \n to separate lines inside a var buf[i][j] = 0; current[i]->row = strdup(&(buf[i][0]) + nextstart); if (i == 0 && static_cast(strlen(current[i]->row)) > longest) { longest = static_cast(strlen(current[i]->row)); } current[i]->next = static_cast(malloc(sizeof(struct llrows))); current[i] = current[i]->next; nextstart = j + 1; nr_rows[i]++; } } current[i]->row = strdup(&(buf[i][0]) + nextstart); if (i == 0 && static_cast(strlen(current[i]->row)) > longest) { longest = static_cast(strlen(current[i]->row)); } current[i]->next = nullptr; current[i] = ll_rows[i]; } for (j = 0; j < (nr_rows[0] > nr_rows[1] ? nr_rows[0] : nr_rows[1]); j++) { if (current[0] != nullptr) { strncat(p, current[0]->row, p_len_remaining); p_len_remaining -= strlen(current[0]->row); i = strlen(current[0]->row); } else { i = 0; } while (i < longest) { strncat(p, " ", p_len_remaining); p_len_remaining -= 2; i++; } if (current[1] != nullptr) { p_len_remaining -= strlen(cd->seperation); strncat(p, cd->seperation, p_len_remaining); p_len_remaining -= strlen(current[1]->row); strncat(p, current[1]->row, p_len_remaining); } strncat(p, "\n", p_len_remaining); p_len_remaining -= 2; #ifdef HAVE_OPENMP #pragma omp parallel for schedule(dynamic, 10) #endif /* HAVE_OPENMP */ for (i = 0; i < 2; i++) { if (current[i] != nullptr) { current[i] = current[i]->next; } } } #ifdef HAVE_OPENMP #pragma omp parallel for schedule(dynamic, 10) #endif /* HAVE_OPENMP */ for (i = 0; i < 2; i++) { while (ll_rows[i] != nullptr) { current[i] = ll_rows[i]; free(current[i]->row); ll_rows[i] = current[i]->next; free(current[i]); } } } void free_combine(struct text_object *obj) { auto *cd = static_cast(obj->data.opaque); if (cd == nullptr) { return; } free(cd->left); free(cd->seperation); free(cd->right); free_text_objects(obj->sub->sub); free_and_zero(obj->sub->sub); free_text_objects(obj->sub); free_and_zero(obj->sub); free_and_zero(obj->data.opaque); } conky-1.12.2/src/combine.h000066400000000000000000000024021404127277500153030ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _COMBINE_H #define _COMBINE_H void parse_combine_arg(struct text_object *, const char *); void print_combine(struct text_object *, char *, unsigned int); void free_combine(struct text_object *); #endif /* _COMBINE_H */ conky-1.12.2/src/common.cc000066400000000000000000000604621404127277500153270ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include #include #include #include #include #include #include #include #include "config.h" #include "conky.h" #include "core.h" #include "fs.h" #include "logging.h" #include "misc.h" #include "net_stat.h" #include "specials.h" #include "temphelper.h" #include "timeinfo.h" #include "top.h" /* check for OS and include appropriate headers */ #if defined(__linux__) #include "linux.h" #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include "freebsd.h" #elif defined(__DragonFly__) #include "dragonfly.h" #elif defined(__OpenBSD__) #include "openbsd.h" #elif defined(__APPLE__) && defined(__MACH__) #include "darwin.h" // strings.h #endif #include "update-cb.hh" #ifdef BUILD_CURL #include "ccurl_thread.h" #endif /* BUILD_CURL */ /* folds a string over top of itself, like so: * * if start is "blah", and you call it with count = 1, the result will be "lah" */ void strfold(char *start, int count) { char *curplace; for (curplace = start + count; *curplace != 0; curplace++) { *(curplace - count) = *curplace; } *(curplace - count) = 0; } #ifndef HAVE_STRNDUP // use our own strndup() if it's not available char *strndup(const char *s, size_t n) { if (strlen(s) > n) { char *ret = malloc(n + 1); strncpy(ret, s, n); ret[n] = 0; return ret; } else { return strdup(s); } } #endif /* HAVE_STRNDUP */ int update_uname() { uname(&info.uname_s); #if defined(__DragonFly__) { size_t desc_n; char desc[256]; if (sysctlbyname("kern.version", nullptr, &desc_n, NULL, 0) == -1 || sysctlbyname("kern.version", desc, &desc_n, nullptr, 0) == -1) perror("kern.version"); else { char *start = desc; strsep(&start, " "); strcpy(info.uname_v, strsep(&start, " ")); } if (errno == ENOMEM) printf("desc_n %zu\n", desc_n); } #endif return 0; } double get_time() { struct timespec tv {}; #ifdef _POSIX_MONOTONIC_CLOCK clock_gettime(CLOCK_MONOTONIC, &tv); #else clock_gettime(CLOCK_REALTIME, &tv); #endif return tv.tv_sec + (tv.tv_nsec * 1e-9); } /* Converts '~/...' paths to '/home/blah/...'. It's similar to * variable_substitute, except only cheques for $HOME and ~/ in * path. If HOME is unset it uses an empty string for substitution */ std::string to_real_path(const std::string &source) { const char *homedir = getenv("HOME") != nullptr ? getenv("HOME") : ""; if (source.find("~/") == 0) { return homedir + source.substr(1); } if (source.find("$HOME/") == 0) { return homedir + source.substr(5); } return source; } int open_fifo(const char *file, int *reported) { int fd = 0; fd = open(file, O_RDONLY | O_NONBLOCK | O_CLOEXEC); if (fd == -1) { if ((reported == nullptr) || *reported == 0) { NORM_ERR("can't open %s: %s", file, strerror(errno)); if (reported != nullptr) { *reported = 1; } } return -1; } return fd; } FILE *open_file(const char *file, int *reported) { FILE *fp = nullptr; fp = fopen(file, "re"); if (fp == nullptr) { if ((reported == nullptr) || *reported == 0) { NORM_ERR("can't open %s: %s", file, strerror(errno)); if (reported != nullptr) { *reported = 1; } } return nullptr; } return fp; } std::string variable_substitute(std::string s) { std::string::size_type pos = 0; while ((pos = s.find('$', pos)) != std::string::npos) { if (pos + 1 >= s.size()) { break; } if (s[pos + 1] == '$') { s.erase(pos, 1); ++pos; } else { std::string var; std::string::size_type l = 0; if (isalpha(static_cast(s[pos + 1])) != 0) { l = 1; while (pos + l < s.size() && (isalnum(static_cast(s[pos + l])) != 0)) { ++l; } var = s.substr(pos + 1, l - 1); } else if (s[pos + 1] == '{') { l = s.find('}', pos); if (l == std::string::npos) { break; } l -= pos - 1; var = s.substr(pos + 2, l - 3); } else { ++pos; } if (l != 0u) { s.erase(pos, l); const char *val = getenv(var.c_str()); if (val != nullptr) { s.insert(pos, val); pos += strlen(val); } } } } return s; } void format_seconds(char *buf, unsigned int n, long seconds) { long days; int hours, minutes; if (times_in_seconds.get(*state)) { snprintf(buf, n, "%ld", seconds); return; } days = seconds / 86400; seconds %= 86400; hours = seconds / 3600; seconds %= 3600; minutes = seconds / 60; seconds %= 60; if (days > 0) { snprintf(buf, n, "%ldd %dh %dm", days, hours, minutes); } else { snprintf(buf, n, "%dh %dm %lds", hours, minutes, seconds); } } void format_seconds_short(char *buf, unsigned int n, long seconds) { long days; int hours, minutes; if (times_in_seconds.get(*state)) { snprintf(buf, n, "%ld", seconds); return; } days = seconds / 86400; seconds %= 86400; hours = seconds / 3600; seconds %= 3600; minutes = seconds / 60; seconds %= 60; if (days > 0) { snprintf(buf, n, "%ldd %dh", days, hours); } else if (hours > 0) { snprintf(buf, n, "%dh %dm", hours, minutes); } else { snprintf(buf, n, "%dm %lds", minutes, seconds); } } conky::simple_config_setting no_buffers("no_buffers", true, true); conky::simple_config_setting bar_fill("console_bar_fill", "#", false); conky::simple_config_setting bar_unfill("console_bar_unfill", ".", false); conky::simple_config_setting github_token("github_token", "", false); void update_stuff() { /* clear speeds, addresses and up status in case device was removed and * doesn't get updated */ #ifdef HAVE_OPENMP #pragma omp parallel for schedule(dynamic, 10) #endif /* HAVE_OPENMP */ for (int i = 0; i < MAX_NET_INTERFACES; ++i) { if (netstats[i].dev != nullptr) { netstats[i].up = 0; netstats[i].recv_speed = 0.0; netstats[i].trans_speed = 0.0; netstats[i].addr.sa_data[2] = 0; netstats[i].addr.sa_data[3] = 0; netstats[i].addr.sa_data[4] = 0; netstats[i].addr.sa_data[5] = 0; } } /* this is a stub on all platforms except solaris */ prepare_update(); /* if you registered a callback with conky::register_cb, this will run it */ conky::run_all_callbacks(); #if !defined(__linux__) /* XXX: move the following into the update_meminfo() functions? */ if (no_buffers.get(*state)) { info.mem -= info.bufmem; info.memeasyfree += info.bufmem; } #endif } /* Ohkie to return negative values for temperatures */ int round_to_int_temp(float f) { return static_cast(f); } /* Don't return negative values for cpugraph, bar, gauge, percentage. * Causes unreasonable numbers to show */ unsigned int round_to_positive_int(float f) { if (f >= 0.0) { return static_cast(f + 0.5); } return 0; } void scan_loadavg_arg(struct text_object *obj, const char *arg) { obj->data.i = 0; if ((arg != nullptr) && (arg[1] == 0) && (isdigit(static_cast(arg[0])) != 0)) { obj->data.i = atoi(arg); if (obj->data.i > 3 || obj->data.i < 1) { NORM_ERR("loadavg arg needs to be in range (1,3)"); obj->data.i = 0; } } /* convert to array index (or the default (-1)) */ obj->data.i--; } void print_loadavg(struct text_object *obj, char *p, unsigned int p_max_size) { float *v = info.loadavg; if (obj->data.i < 0) { snprintf(p, p_max_size, "%.2f %.2f %.2f", v[0], v[1], v[2]); } else { snprintf(p, p_max_size, "%.2f", v[obj->data.i]); } } void scan_no_update(struct text_object *obj, const char *arg) { obj->data.s = static_cast(malloc(text_buffer_size.get(*state))); evaluate(arg, obj->data.s, text_buffer_size.get(*state)); obj->data.s = static_cast(realloc(obj->data.s, strlen(obj->data.s) + 1)); } void free_no_update(struct text_object *obj) { free(obj->data.s); } void print_no_update(struct text_object *obj, char *p, unsigned int p_max_size) { snprintf(p, p_max_size, "%s", obj->data.s); } #ifdef BUILD_X11 void scan_loadgraph_arg(struct text_object *obj, const char *arg) { char *buf = nullptr; buf = scan_graph(obj, arg, 0); free_and_zero(buf); } double loadgraphval(struct text_object *obj) { (void)obj; return info.loadavg[0]; } #endif /* BUILD_X11 */ uint8_t cpu_percentage(struct text_object *obj) { if (static_cast(obj->data.i) > info.cpu_count) { NORM_ERR("obj->data.i %i info.cpu_count %i", obj->data.i, info.cpu_count); CRIT_ERR(nullptr, nullptr, "attempting to use more CPUs than you have!"); } if (info.cpu_usage != nullptr) { return round_to_positive_int(info.cpu_usage[obj->data.i] * 100.0); } return 0; } double cpu_barval(struct text_object *obj) { if (static_cast(obj->data.i) > info.cpu_count) { NORM_ERR("obj->data.i %i info.cpu_count %i", obj->data.i, info.cpu_count); CRIT_ERR(nullptr, nullptr, "attempting to use more CPUs than you have!"); } if (info.cpu_usage != nullptr) { return info.cpu_usage[obj->data.i]; } return 0.; } #define PRINT_HR_GENERATOR(name) \ void print_##name(struct text_object *obj, char *p, \ unsigned int p_max_size) { \ human_readable(apply_base_multiplier(obj->data.s, info.name), p, \ p_max_size); \ } PRINT_HR_GENERATOR(mem) PRINT_HR_GENERATOR(memwithbuffers) PRINT_HR_GENERATOR(memeasyfree) PRINT_HR_GENERATOR(legacymem) PRINT_HR_GENERATOR(memfree) PRINT_HR_GENERATOR(memmax) PRINT_HR_GENERATOR(memdirty) PRINT_HR_GENERATOR(swap) PRINT_HR_GENERATOR(swapfree) PRINT_HR_GENERATOR(swapmax) uint8_t mem_percentage(struct text_object *obj) { (void)obj; return (info.memmax != 0u ? round_to_positive_int(info.mem * 100 / info.memmax) : 0); } double mem_barval(struct text_object *obj) { (void)obj; return info.memmax != 0u ? (static_cast(info.mem) / info.memmax) : 0; } double mem_with_buffers_barval(struct text_object *obj) { (void)obj; return info.memmax != 0u ? (static_cast(info.memwithbuffers) / info.memmax) : 0; } uint8_t swap_percentage(struct text_object *obj) { (void)obj; return (info.swapmax != 0u ? round_to_positive_int(info.swap * 100 / info.swapmax) : 0); } double swap_barval(struct text_object *obj) { (void)obj; return info.swapmax != 0u ? (static_cast(info.swap) / info.swapmax) : 0; } void print_kernel(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; snprintf(p, p_max_size, "%s", info.uname_s.release); } void print_machine(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; snprintf(p, p_max_size, "%s", info.uname_s.machine); } void print_nodename(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; snprintf(p, p_max_size, "%s", info.uname_s.nodename); } void print_nodename_short(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; snprintf(p, p_max_size, "%s", info.uname_s.nodename); for (int i = 0; p[i] != 0; i++) { if (p[i] == '.') { p[i] = 0; break; } } } void print_sysname(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; snprintf(p, p_max_size, "%s", info.uname_s.sysname); } #if defined(__DragonFly__) void print_version(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; snprintf(p, p_max_size, "%s", info.uname_v); } #endif void print_uptime(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; format_seconds(p, p_max_size, static_cast(info.uptime)); } void print_uptime_short(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; format_seconds_short(p, p_max_size, static_cast(info.uptime)); } void print_processes(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; spaced_print(p, p_max_size, "%hu", 4, info.procs); } void print_running_processes(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; spaced_print(p, p_max_size, "%hu", 4, info.run_procs); } void print_running_threads(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; spaced_print(p, p_max_size, "%hu", 4, info.run_threads); } void print_threads(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; spaced_print(p, p_max_size, "%hu", 4, info.threads); } void print_buffers(struct text_object *obj, char *p, unsigned int p_max_size) { human_readable(apply_base_multiplier(obj->data.s, info.buffers), p, p_max_size); } void print_cached(struct text_object *obj, char *p, unsigned int p_max_size) { human_readable(apply_base_multiplier(obj->data.s, info.cached), p, p_max_size); } void print_evaluate(struct text_object *obj, char *p, unsigned int p_max_size) { std::vector buf(text_buffer_size.get(*state)); evaluate(obj->data.s, &buf[0], buf.size()); evaluate(&buf[0], p, p_max_size); } int if_empty_iftest(struct text_object *obj) { std::vector buf(max_user_text.get(*state)); int result = 1; generate_text_internal(&(buf[0]), max_user_text.get(*state), *obj->sub); if (strlen(&(buf[0])) != 0) { result = 0; } return result; } static int check_contains(char *f, char *s) { int ret = 0; FILE *where = open_file(f, nullptr); if (where != nullptr) { char buf1[256]; while (fgets(buf1, 256, where) != nullptr) { if (strstr(buf1, s) != nullptr) { ret = 1; break; } } fclose(where); } else { NORM_ERR("Could not open the file"); } return ret; } int if_existing_iftest(struct text_object *obj) { char *spc; int result = 0; spc = strchr(obj->data.s, ' '); if (spc != nullptr) { *spc = 0; } if (access(obj->data.s, F_OK) == 0) { if (spc == nullptr || (check_contains(obj->data.s, spc + 1) != 0)) { result = 1; } } if (spc != nullptr) { *spc = ' '; } return result; } int if_running_iftest(struct text_object *obj) { #ifdef __linux__ if (!get_process_by_name(obj->data.s)) { #else if (((obj->data.s) != nullptr) && (system(obj->data.s) != 0)) { #endif return 0; } return 1; } #ifndef __OpenBSD__ void print_acpitemp(struct text_object *obj, char *p, unsigned int p_max_size) { temp_print(p, p_max_size, get_acpi_temperature(obj->data.i), TEMP_CELSIUS, 1); } void free_acpitemp(struct text_object *obj) { close(obj->data.i); } #endif /* !__OpenBSD__ */ void print_freq(struct text_object *obj, char *p, unsigned int p_max_size) { static int ok = 1; if (ok != 0) { ok = get_freq(p, p_max_size, "%.0f", 1, obj->data.i); } } void print_freq_g(struct text_object *obj, char *p, unsigned int p_max_size) { static int ok = 1; if (ok != 0) { #ifndef __OpenBSD__ ok = get_freq(p, p_max_size, "%'.2f", 1000, obj->data.i); #else /* OpenBSD has no such flag (SUSv2) */ ok = get_freq(p, p_max_size, "%.2f", 1000, obj->data.i); #endif /* __OpenBSD */ } } #ifndef __OpenBSD__ void print_acpifan(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; get_acpi_fan(p, p_max_size); } void print_acpiacadapter(struct text_object *obj, char *p, unsigned int p_max_size) { get_acpi_ac_adapter(p, p_max_size, static_cast(obj->data.opaque)); } void print_battery(struct text_object *obj, char *p, unsigned int p_max_size) { get_battery_stuff(p, p_max_size, obj->data.s, BATTERY_STATUS); } void print_battery_time(struct text_object *obj, char *p, unsigned int p_max_size) { get_battery_stuff(p, p_max_size, obj->data.s, BATTERY_TIME); } uint8_t battery_percentage(struct text_object *obj) { return get_battery_perct(obj->data.s); } void print_battery_short(struct text_object *obj, char *p, unsigned int p_max_size) { get_battery_short_status(p, p_max_size, obj->data.s); } void print_battery_status(struct text_object *obj, char *p, unsigned int p_max_size) { get_battery_stuff(p, p_max_size, obj->data.s, BATTERY_STATUS); if (0 == strncmp("charging", p, 8)) { snprintf(p, p_max_size, "%s", "charging"); } else if (0 == strncmp("discharging", p, 11) || 0 == strncmp("remaining", p, 9)) { snprintf(p, p_max_size, "%s", "discharging"); } else if (0 == strncmp("charged", p, 7)) { snprintf(p, p_max_size, "%s", "charged"); } else if (0 == strncmp("not present", p, 11) || 0 == strncmp("absent/on AC", p, 12)) { snprintf(p, p_max_size, "%s", "not present"); } else if (0 == strncmp("empty", p, 5)) { snprintf(p, p_max_size, "%s", "empty"); } else if (0 == strncmp("unknown", p, 7)) { snprintf(p, p_max_size, "%s", "unknown"); } } #endif /* !__OpenBSD__ */ void print_blink(struct text_object *obj, char *p, unsigned int p_max_size) { // blinking like this can look a bit ugly if the chars in the font don't have // the same width std::vector buf(max_user_text.get(*state)); static int visible = 1; static int last_len = 0; int i; if (visible != 0) { generate_text_internal(&(buf[0]), max_user_text.get(*state), *obj->sub); last_len = strlen(&(buf[0])); } else { for (i = 0; i < last_len; i++) { buf[i] = ' '; } } snprintf(p, p_max_size, "%s", &(buf[0])); visible = static_cast(static_cast(visible) == 0); } void print_include(struct text_object *obj, char *p, unsigned int p_max_size) { std::vector buf(max_user_text.get(*state)); if (obj->sub == nullptr) { return; } generate_text_internal(&(buf[0]), max_user_text.get(*state), *obj->sub); snprintf(p, p_max_size, "%s", &(buf[0])); } #ifdef BUILD_CURL #define NEW_TOKEN \ "https://github.com/settings/tokens/" \ "new?scopes=notifications&description=conky-query-github\n" static size_t read_github_data_cb(char *, size_t, size_t, char *); static size_t read_github_data_cb(char *data, size_t size, size_t nmemb, char *p) { char *ptr = data; size_t sz = nmemb * size; size_t z = 0; static size_t x = 0; static unsigned int skip = 0U; for (; *ptr; ptr++, z++) { if (z + 4 < sz) { /* Verifying up to *(ptr+4) */ if ('u' == *ptr && 'n' == *(ptr + 1) && 'r' == *(ptr + 2) && 'e' == *(ptr + 3)) { /* "unread" */ ++x; skip = 0U; } if ('m' == *ptr && 'e' == *(ptr + 1) && 's' == *(ptr + 2) && 's' == *(ptr + 3) && z + 13 < sz) { /* "message": */ if ('B' == *(ptr + 10) && 'a' == *(ptr + 11) && 'd' == *(ptr + 12)) { /* "Bad credentials" */ NORM_ERR("Bad credentials: generate a new token:\n" NEW_TOKEN); snprintf(p, 80, "%s", "GitHub: Bad credentials, generate a new token."); skip = 1U; break; } if ('M' == *(ptr + 10) && 'i' == *(ptr + 11) && 's' == *(ptr + 12)) { /* Missing the 'notifications' scope. */ NORM_ERR( "Missing 'notifications' scope. Generate a new " "token\n" NEW_TOKEN); snprintf( p, 80, "%s", "GitHub: Missing the notifications scope. Generate a new token."); skip = 1U; break; } } } } if (0U == skip) { snprintf(p, 49, "%zu", x); } return sz; } void print_github(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; char github_url[256] = {""}; char user_agent[30] = {""}; static char cached_result[256] = {""}; static unsigned int last_update = 1U; CURL *curl = nullptr; CURLcode res; if (0 == strcmp(github_token.get(*state).c_str(), "")) { NORM_ERR( "${github_notifications} requires token. " "Go ahead and generate one " NEW_TOKEN "Insert it in conky.config = { github_token='TOKEN_SHA' }\n"); snprintf(p, p_max_size, "%s", "GitHub notifications requires token, generate a new one."); return; } if (1U != last_update) { --last_update; snprintf(p, p_max_size, "%s", cached_result); return; } snprintf(github_url, 255, "%s%s", "https://api.github.com/notifications?access_token=", github_token.get(*state).c_str()); /* unique string for each conky user, so we dont hit any query limits */ snprintf(user_agent, 29, "conky/%s", github_token.get(*state).c_str()); curl_global_init(CURL_GLOBAL_ALL); if (nullptr == (curl = curl_easy_init())) { goto error; } curl_easy_setopt(curl, CURLOPT_URL, github_url); #if defined(CURLOPT_ACCEPT_ENCODING) curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, "gzip"); #else /* defined(CURLOPT_ACCEPT_ENCODING) */ curl_easy_setopt(curl, CURLOPT_ENCODING, "gzip"); #endif /* defined(CURLOPT_ACCEPT_ENCODING) */ curl_easy_setopt(curl, CURLOPT_USERAGENT, user_agent); curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL); curl_easy_setopt(curl, CURLOPT_TIMEOUT, 20L); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, read_github_data_cb); curl_easy_setopt(curl, CURLOPT_WRITEDATA, p); res = curl_easy_perform(curl); if (CURLE_OK != res) { goto error; } snprintf(cached_result, 255, "%s", p); last_update = 60U; error: if (nullptr != curl) { curl_easy_cleanup(curl); } curl_global_cleanup(); if (!isdigit(static_cast(*p))) { last_update = 1U; } } void print_stock(struct text_object *obj, char *p, unsigned int p_max_size) { if (!obj->data.s) { p[0] = 0; return; } ccurl_process_info(p, p_max_size, obj->data.s, 1); } void free_stock(struct text_object *obj) { free(obj->data.s); } #endif /* BUILD_CURL */ void print_to_bytes(struct text_object *obj, char *p, unsigned int p_max_size) { std::vector buf(max_user_text.get(*state)); long double bytes; char unit[16]; // 16 because we can also have long names (like mega-bytes) generate_text_internal(&(buf[0]), max_user_text.get(*state), *obj->sub); if (sscanf(&(buf[0]), "%Lf%s", &bytes, unit) == 2 && strlen(unit) < 16) { if (strncasecmp("b", unit, 1) == 0) { snprintf(&(buf[0]), max_user_text.get(*state), "%Lf", bytes); } else if (strncasecmp("k", unit, 1) == 0) { snprintf(&(buf[0]), max_user_text.get(*state), "%Lf", bytes * 1024); } else if (strncasecmp("m", unit, 1) == 0) { snprintf(&(buf[0]), max_user_text.get(*state), "%Lf", bytes * 1024 * 1024); } else if (strncasecmp("g", unit, 1) == 0) { snprintf(&(buf[0]), max_user_text.get(*state), "%Lf", bytes * 1024 * 1024 * 1024); } else if (strncasecmp("t", unit, 1) == 0) { snprintf(&(buf[0]), max_user_text.get(*state), "%Lf", bytes * 1024 * 1024 * 1024 * 1024); } } snprintf(p, p_max_size, "%s", &(buf[0])); } void print_updates(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; snprintf(p, p_max_size, "%d", get_total_updates()); } int updatenr_iftest(struct text_object *obj) { if (get_total_updates() % get_updatereset() != obj->data.i - 1) { return 0; } return 1; } conky-1.12.2/src/common.h000066400000000000000000000155521404127277500151710ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _COMMON_H #define _COMMON_H #include #include #include #include #include #include "setting.hh" #include "text_object.h" char *readfile(const char *filename, int *total_read, char showerror); void print_to_bytes(struct text_object *, char *, unsigned int); void strfold(char *start, int count); int check_mount(struct text_object *); void prepare_update(void); int update_uptime(void); int update_meminfo(void); int update_net_stats(void); int update_cpu_usage(void); int update_total_processes(void); int update_uname(void); int update_threads(void); int update_running_processes(void); void update_stuff(void); char get_freq(char *, size_t, const char *, int, unsigned int); void print_voltage_mv(struct text_object *, char *, unsigned int); void print_voltage_v(struct text_object *, char *, unsigned int); int update_load_average(void); void free_all_processes(void); struct process *get_first_process(void); void get_cpu_count(void); double get_time(void); /* Converts '~/...' paths to '/home/blah/...' * It's similar to variable_substitute, except only cheques for $HOME and ~/ in * path */ std::string to_real_path(const std::string &source); FILE *open_file(const char *file, int *reported); int open_fifo(const char *file, int *reported); std::string variable_substitute(std::string s); void format_seconds(char *buf, unsigned int n, long seconds); void format_seconds_short(char *buf, unsigned int n, long seconds); int round_to_int_temp(float); unsigned int round_to_positive_int(float); extern conky::simple_config_setting no_buffers; extern conky::simple_config_setting bar_fill; extern conky::simple_config_setting bar_unfill; extern conky::simple_config_setting github_token; int open_acpi_temperature(const char *name); double get_acpi_temperature(int fd); void get_acpi_ac_adapter(char *p_client_buffer, size_t client_buffer_size, const char *adapter); void get_acpi_fan(char *, size_t); void get_battery_stuff(char *buf, unsigned int n, const char *bat, int item); int get_battery_perct(const char *bat); double get_battery_perct_bar(struct text_object *); void get_battery_short_status(char *buf, unsigned int n, const char *bat); void scan_no_update(struct text_object *, const char *); void print_no_update(struct text_object *, char *, unsigned int); void free_no_update(struct text_object *); void scan_loadavg_arg(struct text_object *, const char *); void print_loadavg(struct text_object *, char *, unsigned int); #ifdef BUILD_X11 void scan_loadgraph_arg(struct text_object *, const char *); double loadgraphval(struct text_object *); #endif /* BUILD_X11 */ uint8_t cpu_percentage(struct text_object *); double cpu_barval(struct text_object *); void print_mem(struct text_object *, char *, unsigned int); void print_memwithbuffers(struct text_object *, char *, unsigned int); void print_memeasyfree(struct text_object *, char *, unsigned int); void print_legacymem(struct text_object *, char *, unsigned int); void print_memfree(struct text_object *, char *, unsigned int); void print_memmax(struct text_object *, char *, unsigned int); void print_memdirty(struct text_object *, char *, unsigned int); void print_swap(struct text_object *, char *, unsigned int); void print_swapfree(struct text_object *, char *, unsigned int); void print_swapmax(struct text_object *, char *, unsigned int); uint8_t mem_percentage(struct text_object *); double mem_barval(struct text_object *); double mem_with_buffers_barval(struct text_object *); uint8_t swap_percentage(struct text_object *); double swap_barval(struct text_object *); void print_kernel(struct text_object *, char *, unsigned int); void print_machine(struct text_object *, char *, unsigned int); void print_nodename(struct text_object *, char *, unsigned int); void print_nodename_short(struct text_object *, char *, unsigned int); void print_sysname(struct text_object *, char *, unsigned int); #if defined(__DragonFly__) void print_version(struct text_object *obj, char *p, unsigned int p_max_size); #endif void print_uptime(struct text_object *, char *, unsigned int); void print_uptime_short(struct text_object *, char *, unsigned int); void print_processes(struct text_object *, char *, unsigned int); void print_running_processes(struct text_object *, char *, unsigned int); void print_running_threads(struct text_object *, char *, unsigned int); void print_threads(struct text_object *, char *, unsigned int); void print_buffers(struct text_object *, char *, unsigned int); void print_cached(struct text_object *, char *, unsigned int); void print_evaluate(struct text_object *, char *, unsigned int); int if_empty_iftest(struct text_object *); int if_existing_iftest(struct text_object *); int if_running_iftest(struct text_object *); #ifndef __OpenBSD__ void print_acpitemp(struct text_object *, char *, unsigned int); void free_acpitemp(struct text_object *); #endif /* !__OpenBSD__ */ void print_freq(struct text_object *, char *, unsigned int); void print_freq_g(struct text_object *, char *, unsigned int); #ifndef __OpenBSD__ void print_acpifan(struct text_object *, char *, unsigned int); void print_acpiacadapter(struct text_object *, char *, unsigned int); void print_battery(struct text_object *, char *, unsigned int); void print_battery_time(struct text_object *, char *, unsigned int); uint8_t battery_percentage(struct text_object *); void print_battery_short(struct text_object *, char *, unsigned int); void print_battery_status(struct text_object *, char *, unsigned int); #endif /* !__OpenBSD__ */ void free_cpu(struct text_object *); void print_blink(struct text_object *, char *, unsigned int); void print_include(struct text_object *, char *, unsigned int); void print_updates(struct text_object *, char *, unsigned int); int updatenr_iftest(struct text_object *); #ifdef BUILD_CURL void print_github(struct text_object *, char *, unsigned int); void print_stock(struct text_object *, char *, unsigned int); void free_stock(struct text_object *); #endif /* BUILD_CURL */ #endif /* _COMMON_H */ conky-1.12.2/src/conky.cc000066400000000000000000002622531404127277500151640ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "conky.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "common.h" #include "config.h" #include "text_object.h" #ifdef HAVE_DIRENT_H #include #endif /* HAVE_DIRENT_H */ #include #include #ifdef HAVE_SYS_INOTIFY_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wc99-extensions" #include #pragma clang diagnostic pop #endif /* HAVE_SYS_INOTIFY_H */ #ifdef BUILD_X11 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wvariadic-macros" #include #ifdef BUILD_XFT #include #endif /* BUILD_XFT */ #pragma GCC diagnostic pop #include "x11.h" #ifdef BUILD_XDAMAGE #include #endif #ifdef BUILD_IMLIB2 #include "imlib2.h" #endif /* BUILD_IMLIB2 */ #endif /* BUILD_X11 */ #ifdef BUILD_NCURSES #include #endif #include #include #include #include #include #include #if defined BUILD_RSS #include #endif #ifdef BUILD_CURL #include #endif /* local headers */ #include "colours.h" #include "core.h" #include "diskio.h" #include "exec.h" #ifdef BUILD_X11 #include "fonts.h" #endif #include "fs.h" #ifdef BUILD_ICONV #include "iconv_tools.h" #endif #include "llua.h" #include "logging.h" #include "mail.h" #include "nc.h" #include "net_stat.h" #include "specials.h" #include "temphelper.h" #include "template.h" #include "timeinfo.h" #include "top.h" #ifdef BUILD_MYSQL #include "mysql.h" #endif /* BUILD_MYSQL */ #ifdef BUILD_NVIDIA #include "nvidia.h" #endif #ifdef BUILD_CURL #include "ccurl_thread.h" #endif /* BUILD_CURL */ #ifdef BUILD_WEATHER_METAR #include "weather.h" #endif /* BUILD_WEATHER_METAR */ #include "lua-config.hh" #include "setting.hh" /* check for OS and include appropriate headers */ #if defined(__linux__) #include "linux.h" #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include "freebsd.h" #elif defined(__DragonFly__) #include "dragonfly.h" #elif defined(__OpenBSD__) #include "openbsd.h" #endif /* __OpenBSD__ */ #ifdef BUILD_HTTP #include #endif /* BUILD_HTTP */ #ifdef BUILD_OLD_CONFIG #include "convertconf.h" #endif /* BUILD_OLD_CONFIG */ #ifdef BUILD_BUILTIN_CONFIG #include "defconfig.h" #ifdef BUILD_HSV_GRADIENT #include "hsv_gradient.h" #endif /* BUILD_HSV_GRADIENT */ namespace { const char builtin_config_magic[] = "==builtin=="; } // namespace #endif /* BUILD_BUILTIN_CONFIG */ #ifndef S_ISSOCK #define S_ISSOCK(x) ((x & S_IFMT) == S_IFSOCK) #endif #define MAX_IF_BLOCK_DEPTH 5 //#define SIGNAL_BLOCKING #undef SIGNAL_BLOCKING /* debugging level, used by logging.h */ int global_debug_level = 0; /* disable inotify auto reload feature if desired */ static conky::simple_config_setting disable_auto_reload( "disable_auto_reload", false, false); /* two strings for internal use */ static char *tmpstring1, *tmpstring2; #ifdef BUILD_NCURSES extern WINDOW *ncurses_window; #endif enum spacer_state { NO_SPACER = 0, LEFT_SPACER, RIGHT_SPACER }; template <> conky::lua_traits::Map conky::lua_traits::map = { {"none", NO_SPACER}, {"left", LEFT_SPACER}, {"right", RIGHT_SPACER}}; static conky::simple_config_setting use_spacer("use_spacer", NO_SPACER, false); /* variables holding various config settings */ static conky::simple_config_setting short_units("short_units", false, true); static conky::simple_config_setting format_human_readable( "format_human_readable", true, true); conky::simple_config_setting out_to_stdout("out_to_console", // Default value is false, unless we are building without X #ifdef BUILD_X11 false, #else true, #endif false); static conky::simple_config_setting out_to_stderr("out_to_stderr", false, false); int top_cpu, top_mem, top_time; #ifdef BUILD_IOSTATS int top_io; #endif int top_running; static conky::simple_config_setting extra_newline("extra_newline", false, false); /* Update interval */ conky::range_config_setting update_interval( "update_interval", 0.0, std::numeric_limits::infinity(), 3.0, true); conky::range_config_setting update_interval_on_battery( "update_interval_on_battery", 0.0, std::numeric_limits::infinity(), NOBATTERY, true); conky::simple_config_setting detect_battery("detect_battery", std::string("BAT0"), false); static bool on_battery = false; double active_update_interval() { return (on_battery ? update_interval_on_battery : update_interval) .get(*state); } void music_player_interval_setting::lua_setter(lua::state &l, bool init) { lua::stack_sentry s(l, -2); if (l.isnil(-2)) { l.checkstack(1); l.pushnumber(update_interval.get(l)); l.replace(-3); } Base::lua_setter(l, init); ++s; } music_player_interval_setting music_player_interval; void *global_cpu = nullptr; static conky::range_config_setting max_text_width( "max_text_width", 0, std::numeric_limits::max(), 0, true); #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) extern kvm_t *kd; #endif /* prototypes for internally used functions */ static void signal_handler(int /*sig*/); static void reload_config(); static const char *suffixes[] = {_nop("B"), _nop("KiB"), _nop("MiB"), _nop("GiB"), _nop("TiB"), _nop("PiB"), ""}; #ifdef BUILD_X11 static void X11_create_window(); struct _x11_stuff_s { Region region; #ifdef BUILD_XDAMAGE Damage damage; XserverRegion region2, part; int event_base, error_base; #endif } x11_stuff; /* text size */ static int text_start_x, text_start_y; /* text start position in window */ static int text_offset_x, text_offset_y; /* offset for start position */ static int text_width = 1, text_height = 1; /* initially 1 so no zero-sized window is created */ #ifdef BUILD_XFT static int xft_dpi = -1; #endif /* BUILD_XFT */ #endif /* BUILD_X11 */ /* struct that has all info to be shared between * instances of the same text object */ struct information info; /* path to config file */ std::string current_config; /* set to 1 if you want all text to be in uppercase */ static conky::simple_config_setting stuff_in_uppercase("uppercase", false, true); static conky::simple_config_setting stuff_in_lowercase("lowercase", false, true); /* Run how many times? */ static conky::range_config_setting total_run_times( "total_run_times", 0, std::numeric_limits::max(), 0, true); /* fork? */ static conky::simple_config_setting fork_to_background("background", false, false); /* set to 0 after the first time conky is run, so we don't fork again after the * first forking */ int first_pass = 1; int argc_copy; char **argv_copy; conky::range_config_setting cpu_avg_samples("cpu_avg_samples", 1, 14, 2, true); conky::range_config_setting net_avg_samples("net_avg_samples", 1, 14, 2, true); conky::range_config_setting diskio_avg_samples("diskio_avg_samples", 1, 14, 2, true); /* filenames for output */ static conky::simple_config_setting overwrite_file( "overwrite_file", std::string(), true); static FILE *overwrite_fpointer = nullptr; static conky::simple_config_setting append_file("append_file", std::string(), true); static FILE *append_fpointer = nullptr; #ifdef BUILD_HTTP #ifdef MHD_YES /* older API */ #define MHD_Result int #endif /* MHD_YES */ std::string webpage; struct MHD_Daemon *httpd; static conky::simple_config_setting http_refresh("http_refresh", false, true); MHD_Result sendanswer(void *cls, struct MHD_Connection *connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls) { struct MHD_Response *response = MHD_create_response_from_buffer( webpage.length(), (void *)webpage.c_str(), MHD_RESPMEM_PERSISTENT); MHD_Result ret = MHD_queue_response(connection, MHD_HTTP_OK, response); MHD_destroy_response(response); if (cls || url || method || version || upload_data || upload_data_size || con_cls) {} // make compiler happy return ret; } class out_to_http_setting : public conky::simple_config_setting { typedef conky::simple_config_setting Base; protected: virtual void lua_setter(lua::state &l, bool init) { lua::stack_sentry s(l, -2); Base::lua_setter(l, init); if (init && do_convert(l, -1).first) { httpd = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY, HTTPPORT, nullptr, NULL, &sendanswer, nullptr, MHD_OPTION_END); } ++s; } virtual void cleanup(lua::state &l) { lua::stack_sentry s(l, -1); if (do_convert(l, -1).first) { MHD_stop_daemon(httpd); httpd = nullptr; } l.pop(); } public: out_to_http_setting() : Base("out_to_http", false, false) {} }; static out_to_http_setting out_to_http; #endif /* BUILD_HTTP */ #ifdef BUILD_X11 static conky::simple_config_setting show_graph_scale("show_graph_scale", false, false); static conky::simple_config_setting show_graph_range("show_graph_range", false, false); /* Position on the screen */ static conky::simple_config_setting gap_x("gap_x", 5, true); static conky::simple_config_setting gap_y("gap_y", 60, true); /* border */ static conky::simple_config_setting draw_borders("draw_borders", false, false); static conky::simple_config_setting draw_graph_borders( "draw_graph_borders", true, false); conky::range_config_setting stippled_borders( "stippled_borders", 0, std::numeric_limits::max(), 0, true); static conky::simple_config_setting draw_shades("draw_shades", true, false); static conky::simple_config_setting draw_outline("draw_outline", false, false); #ifdef OWN_WINDOW /* fixed size/pos is set if wm/user changes them */ static int fixed_size = 0, fixed_pos = 0; #endif static conky::range_config_setting minimum_height( "minimum_height", 0, std::numeric_limits::max(), 5, true); static conky::range_config_setting minimum_width( "minimum_width", 0, std::numeric_limits::max(), 5, true); static conky::range_config_setting maximum_width( "maximum_width", 0, std::numeric_limits::max(), 0, true); static bool isutf8(const char *envvar) { char *s = getenv(envvar); if (s != nullptr) { std::string temp = s; std::transform(temp.begin(), temp.end(), temp.begin(), ::tolower); if ((temp.find("utf-8") != std::string::npos) || (temp.find("utf8") != std::string::npos)) { return true; } } return false; } /* UTF-8 */ conky::simple_config_setting utf8_mode("override_utf8_locale", isutf8("LC_ALL") || isutf8("LC_CTYPE") || isutf8("LANG"), false); #endif /* BUILD_X11 */ /* maximum size of config TEXT buffer, i.e. below TEXT line. */ conky::range_config_setting max_user_text( "max_user_text", 47, std::numeric_limits::max(), MAX_USER_TEXT_DEFAULT, false); /* maximum size of individual text buffers, ie $exec buffer size */ conky::range_config_setting text_buffer_size( "text_buffer_size", DEFAULT_TEXT_BUFFER_SIZE, std::numeric_limits::max(), DEFAULT_TEXT_BUFFER_SIZE, false); /* pad percentages to decimals? */ static conky::simple_config_setting pad_percents("pad_percents", 0, false); static char *global_text = nullptr; char *get_global_text() { return global_text; } long global_text_lines; static int total_updates; static int updatereset; std::unique_ptr state; void set_updatereset(int i) { updatereset = i; } int get_updatereset() { return updatereset; } int get_total_updates() { return total_updates; } int calc_text_width(const char *s) { size_t slen = strlen(s); #ifdef BUILD_X11 if (!out_to_x.get(*state)) { #endif /* BUILD_X11 */ return slen; #ifdef BUILD_X11 } #ifdef BUILD_XFT if (use_xft.get(*state)) { XGlyphInfo gi; if (utf8_mode.get(*state)) { XftTextExtentsUtf8(display, fonts[selected_font].xftfont, reinterpret_cast(s), slen, &gi); } else { XftTextExtents8(display, fonts[selected_font].xftfont, reinterpret_cast(s), slen, &gi); } return gi.xOff; } #endif /* BUILD_XFT */ return XTextWidth(fonts[selected_font].font, s, slen); #endif /* BUILD_X11 */ } int xft_dpi_scale(int value) { #if defined(BUILD_X11) && defined(BUILD_XFT) if (use_xft.get(*state) && xft_dpi > 0) { return (value * xft_dpi + (value > 0 ? 48 : -48)) / 96; } else { return value; } #else /* defined(BUILD_X11) && defined(BUILD_XFT) */ return value; #endif /* defined(BUILD_X11) && defined(BUILD_XFT) */ } /* formatted text to render on screen, generated in generate_text(), * drawn in draw_stuff() */ static char *text_buffer; /* quite boring functions */ static inline void for_each_line(char *b, int f(char *, int)) { char *ps, *pe; int special_index = 0; /* specials index */ if (b == nullptr) { return; } for (ps = b, pe = b; *pe != 0; pe++) { if (*pe == '\n') { *pe = '\0'; special_index = f(ps, special_index); *pe = '\n'; ps = pe + 1; } } if (ps < pe) { f(ps, special_index); } } static void convert_escapes(char *buf) { char *p = buf, *s = buf; while (*s != 0) { if (*s == '\\') { s++; if (*s == 'n') { *p++ = '\n'; } else if (*s == '\\') { *p++ = '\\'; } s++; } else { *p++ = *s++; } } *p = '\0'; } /* Prints anything normally printed with snprintf according to the current value * of use_spacer. Actually slightly more flexible than snprintf, as you can * safely specify the destination buffer as one of your inputs. */ int spaced_print(char *buf, int size, const char *format, int width, ...) { int len = 0; va_list argp; char *tempbuf; if (size < 1) { return 0; } tempbuf = new char[size]; // Passes the varargs along to vsnprintf va_start(argp, width); vsnprintf(tempbuf, size, format, argp); va_end(argp); switch (use_spacer.get(*state)) { case NO_SPACER: len = snprintf(buf, size, "%s", tempbuf); break; case LEFT_SPACER: len = snprintf(buf, size, "%*s", width, tempbuf); break; case RIGHT_SPACER: len = snprintf(buf, size, "%-*s", width, tempbuf); break; } delete[] tempbuf; return len; } /* print percentage values * * - i.e., unsigned values between 0 and 100 * - respect the value of pad_percents */ int percent_print(char *buf, int size, unsigned value) { return spaced_print(buf, size, "%u", pad_percents.get(*state), value); } /* converts from bytes to human readable format (K, M, G, T) * * The algorithm always divides by 1024, as unit-conversion of byte * counts suggests. But for output length determination we need to * compare with 1000 here, as we print in decimal form. */ void human_readable(long long num, char *buf, int size) { const char **suffix = suffixes; float fnum; int precision; int width; const char *format; /* Possibly just output as usual, for example for stdout usage */ if (!format_human_readable.get(*state)) { spaced_print(buf, size, "%lld", 6, num); return; } if (short_units.get(*state)) { width = 6; format = "%.*f %.1s"; } else { width = 8; format = "%.*f %-.3s"; } if (llabs(num) < 1000LL) { spaced_print(buf, size, format, width, 0, static_cast(num), _(*suffix)); return; } while (llabs(num / 1024) >= 1000LL && (**(suffix + 2) != 0)) { num /= 1024; suffix++; } suffix++; fnum = num / 1024.0; /* fnum should now be < 1000, so looks like 'AAA.BBBBB' * * The goal is to always have a significance of 3, by * adjusting the decimal part of the number. Sample output: * 123MiB * 23.4GiB * 5.12B * so the point of alignment resides between number and unit. The * upside of this is that there is minimal padding necessary, though * there should be a way to make alignment take place at the decimal * dot (then with fixed width decimal part). * * Note the repdigits below: when given a precision value, printf() * rounds the float to it, not just cuts off the remaining digits. So * e.g. 99.95 with a precision of 1 gets 100.0, which again should be * printed with a precision of 0. Yay. */ precision = 0; /* print 100-999 without decimal part */ if (fnum < 99.95) { precision = 1; /* print 10-99 with one decimal place */ } if (fnum < 9.995) { precision = 2; /* print 0-9 with two decimal places */ } spaced_print(buf, size, format, width, precision, fnum, _(*suffix)); } /* global object list root element */ static struct text_object global_root_object; static long current_text_color; void set_current_text_color(long colour) { current_text_color = colour; } long get_current_text_color() { return current_text_color; } static void extract_variable_text(const char *p) { free_text_objects(&global_root_object); delete_block_and_zero(tmpstring1); delete_block_and_zero(tmpstring2); delete_block_and_zero(text_buffer); extract_variable_text_internal(&global_root_object, p); } void parse_conky_vars(struct text_object *root, const char *txt, char *p, int p_max_size) { extract_variable_text_internal(root, txt); generate_text_internal(p, p_max_size, *root); } /* IFBLOCK jumping algorithm * * This is easier as it looks like: * - each IF checks it's condition * - on FALSE: jump * - on TRUE: don't care * - each ELSE jumps unconditionally * - each ENDIF is silently being ignored * * Why this works (or: how jumping works): * Jumping means to overwrite the "obj" variable of the loop and set it to the * target (i.e. the corresponding ELSE or ENDIF). After that, the for-loop does * the rest: as regularly, "obj" is being updated to point to obj->next, so * object parsing continues right after the corresponding ELSE or ENDIF. This * means that if we find an ELSE, it's corresponding IF must not have jumped, * so we need to jump always. If we encounter an ENDIF, it's corresponding IF * or ELSE has not jumped, and there is nothing to do. */ void generate_text_internal(char *p, int p_max_size, struct text_object root) { struct text_object *obj; size_t a; if (p == nullptr) { return; } #ifdef BUILD_ICONV char *buff_in; buff_in = new char[p_max_size]; memset(buff_in, 0, p_max_size); #endif /* BUILD_ICONV */ p[0] = 0; obj = root.next; while ((obj != nullptr) && p_max_size > 0) { /* check callbacks for existence and act accordingly */ if (obj->callbacks.print != nullptr) { (*obj->callbacks.print)(obj, p, p_max_size); } else if (obj->callbacks.iftest != nullptr) { if ((*obj->callbacks.iftest)(obj) == 0) { DBGP2("jumping"); if (obj->ifblock_next != nullptr) { obj = obj->ifblock_next; } } } else if (obj->callbacks.barval != nullptr) { new_bar(obj, p, p_max_size, (*obj->callbacks.barval)(obj)); } else if (obj->callbacks.gaugeval != nullptr) { new_gauge(obj, p, p_max_size, (*obj->callbacks.gaugeval)(obj)); #ifdef BUILD_X11 } else if (obj->callbacks.graphval != nullptr) { new_graph(obj, p, p_max_size, (*obj->callbacks.graphval)(obj)); #endif /* BUILD_X11 */ } else if (obj->callbacks.percentage != nullptr) { percent_print(p, p_max_size, (*obj->callbacks.percentage)(obj)); } a = strlen(p); #ifdef BUILD_ICONV iconv_convert(&a, buff_in, p, p_max_size); #endif /* BUILD_ICONV */ p += a; p_max_size -= a; (*p) = 0; obj = obj->next; } #ifdef BUILD_X11 /* load any new fonts we may have had */ load_fonts(utf8_mode.get(*state)); #endif /* BUILD_X11 */ #ifdef BUILD_ICONV delete[] buff_in; #endif /* BUILD_ICONV */ } void evaluate(const char *text, char *p, int p_max_size) { struct text_object subroot {}; /** * Consider expressions like: ${execp echo '${execp echo hi}'} * These would require run extract_variable_text_internal() before * callbacks and generate_text_internal() after callbacks. */ extract_variable_text_internal(&subroot, text); generate_text_internal(p, p_max_size, subroot); DBGP2("evaluated '%s' to '%s'", text, p); free_text_objects(&subroot); } double current_update_time, next_update_time, last_update_time; static void generate_text() { char *p; unsigned int i, j, k; special_count = 0; current_update_time = get_time(); /* clears netstats info, calls conky::run_all_callbacks(), and changes * some info.mem entries */ update_stuff(); /* populate the text buffer; generate_text_internal() iterates through * global_root_object (an instance of the text_object struct) and calls * any callbacks that were set on startup by construct_text_object(). */ p = text_buffer; generate_text_internal(p, max_user_text.get(*state), global_root_object); unsigned int mw = max_text_width.get(*state); unsigned int tbs = text_buffer_size.get(*state); if (mw > 0) { for (i = 0, j = 0; p[i] != 0; i++) { if (p[i] == '\n') { j = 0; } else if (j == mw) { k = i + strlen(p + i) + 1; if (k < tbs) { while (k != i) { p[k] = p[k - 1]; k--; } p[k] = '\n'; j = 0; } else { NORM_ERR( "The end of the text_buffer is reached, increase " "\"text_buffer_size\""); } } else { j++; } } } if (stuff_in_uppercase.get(*state)) { char *tmp_p; tmp_p = text_buffer; while (*tmp_p != 0) { *tmp_p = toupper(static_cast(*tmp_p)); tmp_p++; } } else if (stuff_in_lowercase.get(*state)) { char *tmp_p; tmp_p = text_buffer; while (*tmp_p != 0) { *tmp_p = tolower(static_cast(*tmp_p)); tmp_p++; } } double ui = active_update_interval(); double time = get_time(); next_update_time += ui; if (next_update_time < time || next_update_time > time + ui) { next_update_time = time - fmod(time, ui) + ui; } last_update_time = current_update_time; total_updates++; } int get_string_width(const char *s) { return *s != 0 ? calc_text_width(s) : 0; } #ifdef BUILD_X11 static inline int get_border_total() { return xft_dpi_scale(border_inner_margin.get(*state)) + xft_dpi_scale(border_outer_margin.get(*state)) + xft_dpi_scale(border_width.get(*state)); } static int get_string_width_special(char *s, int special_index) { char *p, *final; special_t *current = specials; int idx = 1; int width = 0; long i; if (s == nullptr) { return 0; } if (!out_to_x.get(*state)) { return strlen(s); } p = strndup(s, text_buffer_size.get(*state)); final = p; for (i = 0; i < special_index; i++) { current = current->next; } for (i = 0; i < idx; i++) { current = current->next; } while (*p != 0) { if (*p == SPECIAL_CHAR) { /* shift everything over by 1 so that the special char * doesn't mess up the size calculation */ for (i = 0; i < static_cast(strlen(p)); i++) { *(p + i) = *(p + i + 1); } if (current->type == GRAPH || current->type == GAUGE || current->type == BAR) { width += current->width; } if (current->type == FONT) { // put all following text until the next fontchange/stringend in // influenced_by_font but do not include specials char *influenced_by_font = strdup(p); special_t *current_after_font = current; for (i = 0; influenced_by_font[i] != 0; i++) { if (influenced_by_font[i] == SPECIAL_CHAR) { // remove specials and stop at fontchange current_after_font = current_after_font->next; if (current_after_font->type == FONT) { influenced_by_font[i] = 0; break; } { memmove(&influenced_by_font[i], &influenced_by_font[i + 1], strlen(&influenced_by_font[i + 1]) + 1); } } } // add the length of influenced_by_font in the new font to width int orig_font = selected_font; selected_font = current->font_added; width += calc_text_width(influenced_by_font); selected_font = orig_font; free(influenced_by_font); // make sure there chars counted in the new font are not again counted // in the old font int specials_skipped = 0; while (i > 0) { if (p[specials_skipped] != 1) { memmove(&p[specials_skipped], &p[specials_skipped + 1], strlen(&p[specials_skipped + 1]) + 1); } else { specials_skipped++; } i--; } } idx++; current = current->next; } else { p++; } } if (strlen(final) > 1) { width += calc_text_width(final); } free(final); return width; } static int text_size_updater(char *s, int special_index); int last_font_height; static void update_text_area() { int x = 0, y = 0; if (!out_to_x.get(*state)) { return; } /* update text size if it isn't fixed */ #ifdef OWN_WINDOW if (fixed_size == 0) #endif { text_width = xft_dpi_scale(minimum_width.get(*state)); text_height = 0; last_font_height = font_height(); for_each_line(text_buffer, text_size_updater); text_width += 1; if (text_height < xft_dpi_scale(minimum_height.get(*state))) { text_height = xft_dpi_scale(minimum_height.get(*state)); } int mw = xft_dpi_scale(maximum_width.get(*state)); if (text_width > mw && mw > 0) { text_width = mw; } } alignment align = text_alignment.get(*state); /* get text position on workarea */ switch (align) { case TOP_LEFT: case TOP_RIGHT: case TOP_MIDDLE: y = workarea[1] + xft_dpi_scale(gap_y.get(*state)); break; case BOTTOM_LEFT: case BOTTOM_RIGHT: case BOTTOM_MIDDLE: default: y = workarea[3] - text_height - xft_dpi_scale(gap_y.get(*state)); break; case MIDDLE_LEFT: case MIDDLE_RIGHT: case MIDDLE_MIDDLE: y = workarea[1] + (workarea[3] - workarea[1]) / 2 - text_height / 2 - xft_dpi_scale(gap_y.get(*state)); break; } switch (align) { case TOP_LEFT: case BOTTOM_LEFT: case MIDDLE_LEFT: default: x = workarea[0] + xft_dpi_scale(gap_x.get(*state)); break; case TOP_RIGHT: case BOTTOM_RIGHT: case MIDDLE_RIGHT: x = workarea[2] - text_width - xft_dpi_scale(gap_x.get(*state)); break; case TOP_MIDDLE: case BOTTOM_MIDDLE: case MIDDLE_MIDDLE: x = workarea[0] + (workarea[2] - workarea[0]) / 2 - text_width / 2 - xft_dpi_scale(gap_x.get(*state)); break; } #ifdef OWN_WINDOW if (align == NONE) { // Let the WM manage the window x = window.x; y = window.y; fixed_pos = 1; fixed_size = 1; } #endif /* OWN_WINDOW */ #ifdef OWN_WINDOW if (own_window.get(*state) && (fixed_pos == 0)) { int border_total = get_border_total(); text_start_x = text_start_y = border_total; window.x = x - border_total; window.y = y - border_total; } else #endif { text_start_x = x; text_start_y = y; } /* update lua window globals */ llua_update_window_table(text_start_x, text_start_y, text_width, text_height); } /* drawing stuff */ static int cur_x, cur_y; /* current x and y for drawing */ #endif // draw_mode also without BUILD_X11 because we only need to print to stdout with // FG static int draw_mode; /* FG, BG or OUTLINE */ #ifdef BUILD_X11 static long current_color; static int saved_coordinates_x[100]; static int saved_coordinates_y[100]; int get_saved_coordinates_x(int i) { return saved_coordinates_x[i]; } int get_saved_coordinates_y(int i) { return saved_coordinates_y[i]; } static int text_size_updater(char *s, int special_index) { int w = 0; char *p; special_t *current = specials; for (int i = 0; i < special_index; i++) { current = current->next; } if (!out_to_x.get(*state)) { return 0; } /* get string widths and skip specials */ p = s; while (*p != 0) { if (*p == SPECIAL_CHAR) { *p = '\0'; w += get_string_width(s); *p = SPECIAL_CHAR; if (current->type == BAR || current->type == GAUGE || current->type == GRAPH) { w += current->width; if (current->height > last_font_height) { last_font_height = current->height; last_font_height += font_height(); } } else if (current->type == OFFSET) { if (current->arg > 0) { w += current->arg; } } else if (current->type == VOFFSET) { last_font_height += current->arg; } else if (current->type == GOTO) { if (current->arg > cur_x) { w = static_cast(current->arg); } } else if (current->type == TAB) { int start = current->arg; int step = current->width; if ((step == 0) || step < 0) { step = 10; } w += step - (cur_x - text_start_x - start) % step; } else if (current->type == FONT) { selected_font = current->font_added; if (font_height() > last_font_height) { last_font_height = font_height(); } } special_index++; current = current->next; s = p + 1; } p++; } w += get_string_width(s); if (w > text_width) { text_width = w; } int mw = xft_dpi_scale(maximum_width.get(*state)); if (text_width > mw && mw > 0) { text_width = mw; } text_height += last_font_height; last_font_height = font_height(); return special_index; } #endif /* BUILD_X11 */ static inline void set_foreground_color(long c) { #ifdef BUILD_X11 if (out_to_x.get(*state)) { #ifdef BUILD_ARGB if (have_argb_visual) { current_color = c | (own_window_argb_value.get(*state) << 24); } else { #endif /* BUILD_ARGB */ current_color = c; #ifdef BUILD_ARGB } #endif /* BUILD_ARGB */ XSetForeground(display, window.gc, current_color); } #endif /* BUILD_X11 */ #ifdef BUILD_NCURSES if (out_to_ncurses.get(*state)) { attron(COLOR_PAIR(c)); } #endif /* BUILD_NCURSES */ UNUSED(c); } std::string string_replace_all(std::string original, const std::string &oldpart, const std::string &newpart, std::string::size_type start) { std::string::size_type i = start; int oldpartlen = oldpart.length(); while (1) { i = original.find(oldpart, i); if (i == std::string::npos) { break; } original.replace(i, oldpartlen, newpart); } return original; } static void draw_string(const char *s) { int i; int i2; int pos; #ifdef BUILD_X11 int width_of_s; #endif /* BUILD_X11 */ int max = 0; int added; if (s[0] == '\0') { return; } #ifdef BUILD_X11 width_of_s = get_string_width(s); #endif /* BUILD_X11 */ if (out_to_stdout.get(*state) && draw_mode == FG) { printf("%s\n", s); if (extra_newline.get(*state)) { fputc('\n', stdout); } fflush(stdout); /* output immediately, don't buffer */ } if (out_to_stderr.get(*state) && draw_mode == FG) { fprintf(stderr, "%s\n", s); fflush(stderr); /* output immediately, don't buffer */ } if (draw_mode == FG && (overwrite_fpointer != nullptr)) { fprintf(overwrite_fpointer, "%s\n", s); } if (draw_mode == FG && (append_fpointer != nullptr)) { fprintf(append_fpointer, "%s\n", s); } #ifdef BUILD_NCURSES if (out_to_ncurses.get(*state) && draw_mode == FG) { printw("%s", s); } #endif /* BUILD_NCURSES */ #ifdef BUILD_HTTP if (out_to_http.get(*state) && draw_mode == FG) { std::string::size_type origlen = webpage.length(); webpage.append(s); webpage = string_replace_all(webpage, "\n", "
    ", origlen); webpage = string_replace_all(webpage, " ", "  ", origlen); webpage = string_replace_all(webpage, "  ", "  ", origlen); webpage.append("
    "); } #endif /* BUILD_HTTP */ int tbs = text_buffer_size.get(*state); memset(tmpstring1, 0, tbs); memset(tmpstring2, 0, tbs); strncpy(tmpstring1, s, tbs - 1); pos = 0; added = 0; #ifdef BUILD_X11 if (out_to_x.get(*state)) { max = ((text_width - width_of_s) / get_string_width(" ")); } #endif /* BUILD_X11 */ /* This code looks for tabs in the text and coverts them to spaces. * The trick is getting the correct number of spaces, and not going * over the window's size without forcing the window larger. */ for (i = 0; i < tbs; i++) { if (tmpstring1[i] == '\t') { i2 = 0; for (i2 = 0; i2 < (8 - (1 + pos) % 8) && added <= max; i2++) { /* guard against overrun */ tmpstring2[std::min(pos + i2, tbs - 1)] = ' '; added++; } pos += i2; } else { /* guard against overrun */ tmpstring2[std::min(pos, tbs - 1)] = tmpstring1[i]; pos++; } } #ifdef BUILD_X11 if (out_to_x.get(*state)) { int mw = xft_dpi_scale(maximum_width.get(*state)); if (text_width == mw) { /* this means the text is probably pushing the limit, * so we'll chop it */ while (cur_x + get_string_width(tmpstring2) - text_start_x > mw && strlen(tmpstring2) > 0) { tmpstring2[strlen(tmpstring2) - 1] = '\0'; } } } #endif /* BUILD_X11 */ s = tmpstring2; #ifdef BUILD_X11 if (out_to_x.get(*state)) { #ifdef BUILD_XFT if (use_xft.get(*state)) { XColor c; XftColor c2; c.pixel = current_color; // query color on custom colormap XQueryColor(display, window.colourmap, &c); c2.pixel = c.pixel; c2.color.red = c.red; c2.color.green = c.green; c2.color.blue = c.blue; c2.color.alpha = fonts[selected_font].font_alpha; if (utf8_mode.get(*state)) { XftDrawStringUtf8(window.xftdraw, &c2, fonts[selected_font].xftfont, text_offset_x + cur_x, text_offset_y + cur_y, reinterpret_cast(s), strlen(s)); } else { XftDrawString8(window.xftdraw, &c2, fonts[selected_font].xftfont, text_offset_x + cur_x, text_offset_y + cur_y, reinterpret_cast(s), strlen(s)); } } else #endif { if (utf8_mode.get(*state)) { Xutf8DrawString(display, window.drawable, fonts[selected_font].fontset, window.gc, text_offset_x + cur_x, text_offset_y + cur_y, s, strlen(s)); } else { XDrawString(display, window.drawable, window.gc, text_offset_x + cur_x, text_offset_y + cur_y, s, strlen(s)); } } cur_x += width_of_s; } #endif /* BUILD_X11 */ memcpy(tmpstring1, s, tbs); } #if defined(BUILD_MATH) && defined(BUILD_X11) /// Format \a size as a real followed by closest SI unit, with \a prec number /// of digits after the decimal point. static std::string formatSizeWithUnits(double size, int prec = 1) { int div = 0; double rem = 0; while (size >= 1024.0 && static_cast(div) < (sizeof suffixes / sizeof *suffixes)) { rem = fmod(size, 1024.0); div++; size /= 1024.0; } double size_d = size + rem / 1024.0; std::ostringstream result; result.setf(std::ios::fixed, std::ios::floatfield); result.precision(prec); result << size_d; result << " "; if (short_units.get(*state)) { result << suffixes[div][0]; } else { result << suffixes[div]; } return result.str(); } #endif /* BUILD_MATH && BUILD_X11 */ int draw_each_line_inner(char *s, int special_index, int last_special_applied) { #ifndef BUILD_X11 static int cur_x, cur_y; /* current x and y for drawing */ (void)cur_y; #endif #ifdef BUILD_X11 int font_h = 0; int cur_y_add = 0; int mw = xft_dpi_scale(maximum_width.get(*state)); #endif /* BUILD_X11 */ char *p = s; int orig_special_index = special_index; #ifdef BUILD_X11 if (out_to_x.get(*state)) { font_h = font_height(); cur_y += font_ascent(); } cur_x = text_start_x; #endif /* BUILD_X11 */ while (*p != 0) { if (*p == SPECIAL_CHAR || last_special_applied > -1) { #ifdef BUILD_X11 int w = 0; #endif /* BUILD_X11 */ /* draw string before special, unless we're dealing multiline * specials */ if (last_special_applied > -1) { special_index = last_special_applied; } else { *p = '\0'; draw_string(s); *p = SPECIAL_CHAR; s = p + 1; } /* draw special */ special_t *current = specials; for (int i = 0; i < special_index; i++) { current = current->next; } switch (current->type) { #ifdef BUILD_X11 case HORIZONTAL_LINE: if (out_to_x.get(*state)) { int h = current->height; int mid = font_ascent() / 2; w = text_start_x + text_width - cur_x; XSetLineAttributes(display, window.gc, h, LineSolid, CapButt, JoinMiter); XDrawLine(display, window.drawable, window.gc, text_offset_x + cur_x, text_offset_y + cur_y - mid / 2, text_offset_x + cur_x + w, text_offset_y + cur_y - mid / 2); } break; case STIPPLED_HR: if (out_to_x.get(*state)) { int h = current->height; char tmp_s = current->arg; int mid = font_ascent() / 2; char ss[2] = {tmp_s, tmp_s}; w = text_start_x + text_width - cur_x - 1; XSetLineAttributes(display, window.gc, h, LineOnOffDash, CapButt, JoinMiter); XSetDashes(display, window.gc, 0, ss, 2); XDrawLine(display, window.drawable, window.gc, text_offset_x + cur_x, text_offset_y + cur_y - mid / 2, text_offset_x + cur_x + w, text_offset_x + cur_y - mid / 2); } break; case BAR: if (out_to_x.get(*state)) { int h, by; double bar_usage, scale; if (cur_x - text_start_x > mw && mw > 0) { break; } h = current->height; bar_usage = current->arg; scale = current->scale; by = cur_y - (font_ascent() / 2) - 1; if (h < font_h) { by -= h / 2 - 1; } w = current->width; if (w == 0) { w = text_start_x + text_width - cur_x - 1; } if (w < 0) { w = 0; } XSetLineAttributes(display, window.gc, xft_dpi_scale(1), LineSolid, CapButt, JoinMiter); XDrawRectangle(display, window.drawable, window.gc, text_offset_x + cur_x, text_offset_y + by, w, h); XFillRectangle(display, window.drawable, window.gc, text_offset_x + cur_x, text_offset_y + by, w * bar_usage / scale, h); if (h > cur_y_add && h > font_h) { cur_y_add = h; } } break; case GAUGE: /* new GAUGE */ if (out_to_x.get(*state)) { int h, by = 0; unsigned long last_colour = current_color; #ifdef BUILD_MATH float angle, px, py; double usage, scale; #endif /* BUILD_MATH */ if (cur_x - text_start_x > mw && mw > 0) { break; } h = current->height; by = cur_y - (font_ascent() / 2) - 1; if (h < font_h) { by -= h / 2 - 1; } w = current->width; if (w == 0) { w = text_start_x + text_width - cur_x - 1; } if (w < 0) { w = 0; } XSetLineAttributes(display, window.gc, 1, LineSolid, CapButt, JoinMiter); XDrawArc(display, window.drawable, window.gc, text_offset_x + cur_x, text_offset_y + by, w, h * 2, 0, 180 * 64); #ifdef BUILD_MATH usage = current->arg; scale = current->scale; angle = M_PI * usage / scale; px = static_cast(cur_x + (w / 2.)) - static_cast(w / 2.) * cos(angle); py = static_cast(by + (h)) - static_cast(h) * sin(angle); XDrawLine(display, window.drawable, window.gc, text_offset_x + cur_x + (w / 2.), text_offset_y + by + (h), text_offset_x + static_cast(px), text_offset_y + static_cast(py)); #endif /* BUILD_MATH */ if (h > cur_y_add && h > font_h) { cur_y_add = h; } set_foreground_color(last_colour); } break; case GRAPH: if (out_to_x.get(*state)) { int h, by, i = 0, j = 0; int colour_idx = 0; unsigned long last_colour = current_color; if (cur_x - text_start_x > mw && mw > 0) { break; } h = current->height; by = cur_y - (font_ascent() / 2) - 1; if (h < font_h) { by -= h / 2 - 1; } w = current->width; if (w == 0) { w = text_start_x + text_width - cur_x - 1; current->graph_width = std::max(w - 1, 0); if (current->graph_width != current->graph_allocated) { w = current->graph_allocated + 1; } } if (w < 0) { w = 0; } if (draw_graph_borders.get(*state)) { XSetLineAttributes(display, window.gc, xft_dpi_scale(1), LineSolid, CapButt, JoinMiter); XDrawRectangle(display, window.drawable, window.gc, text_offset_x + cur_x, text_offset_y + by, w, h); } XSetLineAttributes(display, window.gc, 1, LineSolid, CapButt, JoinMiter); /* in case we don't have a graph yet */ if (current->graph != nullptr) { std::unique_ptr tmpcolour; if (current->last_colour != 0 || current->first_colour != 0) { #ifdef BUILD_HSV_GRADIENT tmpcolour = do_hsv_gradient(w - 1, current->last_colour, current->first_colour); #else /* BUILD_HSV_GRADIENT */ tmpcolour = do_gradient(w - 1, current->last_colour, current->first_colour); #endif /* BUILD_HSV_GRADIENT */ } colour_idx = 0; for (i = w - 2; i > -1; i--) { if (current->last_colour != 0 || current->first_colour != 0) { if (current->tempgrad != 0) { set_foreground_color(tmpcolour[static_cast( static_cast(w - 2) - current->graph[j] * (w - 2) / std::max(static_cast(current->scale), 1.0F))]); } else { set_foreground_color(tmpcolour[colour_idx++]); } } /* this is mugfugly, but it works */ XDrawLine(display, window.drawable, window.gc, text_offset_x + cur_x + i + 1, text_offset_y + by + h, text_offset_x + cur_x + i + 1, text_offset_y + round_to_positive_int( static_cast(by) + h - current->graph[j] * (h - 1) / current->scale)); ++j; } } if (h > cur_y_add && h > font_h) { cur_y_add = h; } if (show_graph_range.get(*state)) { int tmp_x = cur_x; int tmp_y = cur_y; unsigned short int seconds = active_update_interval() * w; char *tmp_day_str; char *tmp_hour_str; char *tmp_min_str; char *tmp_sec_str; char *tmp_str; unsigned short int timeunits; if (seconds != 0) { timeunits = seconds / 86400; seconds %= 86400; if (timeunits <= 0 || asprintf(&tmp_day_str, _("%dd"), timeunits) == -1) { tmp_day_str = strdup(""); } timeunits = seconds / 3600; seconds %= 3600; if (timeunits <= 0 || asprintf(&tmp_hour_str, _("%dh"), timeunits) == -1) { tmp_hour_str = strdup(""); } timeunits = seconds / 60; seconds %= 60; if (timeunits <= 0 || asprintf(&tmp_min_str, _("%dm"), timeunits) == -1) { tmp_min_str = strdup(""); } if (seconds <= 0 || asprintf(&tmp_sec_str, _("%ds"), seconds) == -1) { tmp_sec_str = strdup(""); } if (asprintf(&tmp_str, "%s%s%s%s", tmp_day_str, tmp_hour_str, tmp_min_str, tmp_sec_str) == -1) { tmp_str = strdup(""); } free(tmp_day_str); free(tmp_hour_str); free(tmp_min_str); free(tmp_sec_str); } else { tmp_str = strdup( _("Range not possible")); // should never happen, but // better safe then sorry } cur_x += (w / 2) - (font_ascent() * (strlen(tmp_str) / 2)); cur_y += font_h / 2; draw_string(tmp_str); free(tmp_str); cur_x = tmp_x; cur_y = tmp_y; } #ifdef BUILD_MATH if (show_graph_scale.get(*state) && (current->show_scale == 1)) { int tmp_x = cur_x; int tmp_y = cur_y; cur_x += font_ascent() / 2; cur_y += font_h / 2; std::string tmp_str = formatSizeWithUnits( current->scale_log != 0 ? std::pow(10.0, current->scale) : current->scale); draw_string(tmp_str.c_str()); cur_x = tmp_x; cur_y = tmp_y; } #endif set_foreground_color(last_colour); } break; case FONT: if (out_to_x.get(*state)) { int old = font_ascent(); cur_y -= font_ascent(); selected_font = current->font_added; set_font(); if (cur_y + font_ascent() < cur_y + old) { cur_y += old; } else { cur_y += font_ascent(); } font_h = font_height(); } break; #endif /* BUILD_X11 */ case FG: if (draw_mode == FG) { set_foreground_color(current->arg); } break; #ifdef BUILD_X11 case BG: if (draw_mode == BG) { set_foreground_color(current->arg); } break; case OUTLINE: if (draw_mode == OUTLINE) { set_foreground_color(current->arg); } break; case OFFSET: w += current->arg; break; case VOFFSET: cur_y += current->arg; break; case SAVE_COORDINATES: saved_coordinates_x[static_cast(current->arg)] = cur_x - text_start_x; saved_coordinates_y[static_cast(current->arg)] = cur_y - text_start_y - last_font_height; break; case TAB: { int start = current->arg; int step = current->width; if ((step == 0) || step < 0) { step = 10; } w = step - (cur_x - text_start_x - start) % step; break; } case ALIGNR: { /* TODO: add back in "+ window.border_inner_margin" to the end of * this line? */ int pos_x = text_start_x + text_width - get_string_width_special(s, special_index); /* printf("pos_x %i text_start_x %i text_width %i cur_x %i " "get_string_width(p) %i gap_x %i " "current->arg %i window.border_inner_margin %i " "window.border_width %i\n", pos_x, text_start_x, text_width, cur_x, get_string_width_special(s), gap_x, current->arg, window.border_inner_margin, window.border_width); */ if (pos_x > current->arg && pos_x > cur_x) { cur_x = pos_x - current->arg; } break; } case ALIGNC: { int pos_x = (text_width) / 2 - get_string_width_special(s, special_index) / 2 - (cur_x - text_start_x); /* int pos_x = text_start_x + text_width / 2 - get_string_width_special(s) / 2; */ /* printf("pos_x %i text_start_x %i text_width %i cur_x %i " "get_string_width(p) %i gap_x %i " "current->arg %i\n", pos_x, text_start_x, text_width, cur_x, get_string_width(s), gap_x, current->arg); */ if (pos_x > current->arg) { w = pos_x - current->arg; } break; } #endif /* BUILD_X11 */ case GOTO: if (current->arg >= 0) { #ifdef BUILD_X11 cur_x = static_cast(current->arg); // make sure shades are 1 pixel to the right of the text if (draw_mode == BG) { cur_x++; } #endif /* BUILD_X11 */ #ifdef BUILD_NCURSES cur_x = static_cast(current->arg); if (out_to_ncurses.get(*state)) { int x, y; getyx(ncurses_window, y, x); move(y, cur_x); } #endif /* BUILD_NCURSES */ } break; } #ifdef BUILD_X11 cur_x += w; #endif /* BUILD_X11 */ if (special_index != last_special_applied) { special_index++; } else { special_index = orig_special_index; last_special_applied = -1; } } p++; } #ifdef BUILD_X11 cur_y += cur_y_add; #endif /* BUILD_X11 */ draw_string(s); #ifdef BUILD_NCURSES if (out_to_ncurses.get(*state)) { printw("\n"); } #endif /* BUILD_NCURSES */ #ifdef BUILD_X11 if (out_to_x.get(*state)) { cur_y += font_descent(); } #endif /* BUILD_X11 */ return special_index; } static int draw_line(char *s, int special_index) { #ifdef BUILD_X11 if (out_to_x.get(*state)) { return draw_each_line_inner(s, special_index, -1); } #endif /* BUILD_X11 */ #ifdef BUILD_NCURSES if (out_to_ncurses.get(*state)) { return draw_each_line_inner(s, special_index, -1); } #endif /* BUILD_NCURSES */ draw_string(s); UNUSED(special_index); return 0; } static void draw_text() { #ifdef BUILD_HTTP #define WEBPAGE_START1 \ "\n" #define WEBPAGE_START2 \ "Conky

    " #define WEBPAGE_END "

    " if (out_to_http.get(*state)) { webpage = WEBPAGE_START1; if (http_refresh.get(*state)) { webpage.append(""); } webpage.append(WEBPAGE_START2); } #endif /* BUILD_HTTP */ #ifdef BUILD_X11 if (out_to_x.get(*state)) { cur_y = text_start_y; int bw = xft_dpi_scale(border_width.get(*state)); /* draw borders */ if (draw_borders.get(*state) && bw > 0) { if (stippled_borders.get(*state) != 0) { char ss[2] = {(char)xft_dpi_scale(stippled_borders.get(*state)), (char)xft_dpi_scale(stippled_borders.get(*state))}; XSetLineAttributes(display, window.gc, bw, LineOnOffDash, CapButt, JoinMiter); XSetDashes(display, window.gc, 0, ss, 2); } else { XSetLineAttributes(display, window.gc, bw, LineSolid, CapButt, JoinMiter); } int offset = xft_dpi_scale(border_inner_margin.get(*state)) + bw; XDrawRectangle(display, window.drawable, window.gc, text_offset_x + text_start_x - offset, text_offset_y + text_start_y - offset, text_width + 2 * offset, text_height + 2 * offset); } /* draw text */ } setup_fonts(); #endif /* BUILD_X11 */ #ifdef BUILD_NCURSES init_pair(COLOR_WHITE, COLOR_WHITE, COLOR_BLACK); attron(COLOR_PAIR(COLOR_WHITE)); #endif /* BUILD_NCURSES */ for_each_line(text_buffer, draw_line); #ifdef BUILD_HTTP if (out_to_http.get(*state)) { webpage.append(WEBPAGE_END); } #endif /* BUILD_HTTP */ } static void draw_stuff() { #ifdef BUILD_X11 text_offset_x = text_offset_y = 0; #ifdef BUILD_IMLIB2 cimlib_render(text_start_x, text_start_y, window.width, window.height); #endif /* BUILD_IMLIB2 */ #endif /* BUILD_X11 */ if (static_cast(!overwrite_file.get(*state).empty()) != 0u) { overwrite_fpointer = fopen(overwrite_file.get(*state).c_str(), "we"); if (overwrite_fpointer == nullptr) { NORM_ERR("Cannot overwrite '%s'", overwrite_file.get(*state).c_str()); } } if (static_cast(!append_file.get(*state).empty()) != 0u) { append_fpointer = fopen(append_file.get(*state).c_str(), "ae"); if (append_fpointer == nullptr) { NORM_ERR("Cannot append to '%s'", append_file.get(*state).c_str()); } } #ifdef BUILD_X11 llua_draw_pre_hook(); if (out_to_x.get(*state)) { selected_font = 0; if (draw_shades.get(*state) && !draw_outline.get(*state)) { text_offset_x = text_offset_y = 1; set_foreground_color(default_shade_color.get(*state)); draw_mode = BG; draw_text(); text_offset_x = text_offset_y = 0; } if (draw_outline.get(*state)) { selected_font = 0; for (text_offset_x = -1; text_offset_x < 2; text_offset_x++) { for (text_offset_y = -1; text_offset_y < 2; text_offset_y++) { if (text_offset_x == 0 && text_offset_y == 0) { continue; } set_foreground_color(default_outline_color.get(*state)); draw_mode = OUTLINE; draw_text(); } } text_offset_x = text_offset_y = 0; } set_foreground_color(default_color.get(*state)); } #endif /* BUILD_X11 */ draw_mode = FG; draw_text(); #if defined(BUILD_X11) llua_draw_post_hook(); #if defined(BUILD_XDBE) if (out_to_x.get(*state)) { xdbe_swap_buffers(); } #else if (out_to_x.get(*state)) { xpmdb_swap_buffers(); } #endif #endif /* BUILD_X11 && BUILD_XDBE */ if (overwrite_fpointer != nullptr) { fclose(overwrite_fpointer); overwrite_fpointer = nullptr; } if (append_fpointer != nullptr) { fclose(append_fpointer); append_fpointer = nullptr; } } #ifdef BUILD_X11 static void clear_text(int exposures) { #ifdef BUILD_XDBE if (use_xdbe.get(*state)) { /* The swap action is XdbeBackground, which clears */ return; } #else if (use_xpmdb.get(*state)) { return; } else #endif if ((display != nullptr) && (window.window != 0u)) { // make sure these are !null /* there is some extra space for borders and outlines */ int border_total = get_border_total(); XClearArea(display, window.window, text_start_x - border_total, text_start_y - border_total, text_width + 2 * border_total, text_height + 2 * border_total, exposures != 0 ? True : 0); } } #endif /* BUILD_X11 */ static int need_to_update; /* update_text() generates new text and clears old text area */ static void update_text() { #ifdef BUILD_IMLIB2 cimlib_cleanup(); #endif /* BUILD_IMLIB2 */ generate_text(); #ifdef BUILD_X11 if (out_to_x.get(*state)) { clear_text(1); } #endif /* BUILD_X11 */ need_to_update = 1; llua_update_info(&info, active_update_interval()); } #ifdef HAVE_SYS_INOTIFY_H int inotify_fd = -1; #endif template void split(const std::string &s, char delim, Out result) { std::stringstream ss(s); std::string item; while (std::getline(ss, item, delim)) { *(result++) = item; } } std::vector split(const std::string &s, char delim) { std::vector elems; split(s, delim, std::back_inserter(elems)); return elems; } bool is_on_battery() { // checks if at least one battery specified in // "detect_battery" is discharging char buf[64]; std::vector b_items = split(detect_battery.get(*state), ','); for (auto const &value : b_items) { get_battery_short_status(buf, 64, value.c_str()); if (buf[0] == 'D') { return true; } } return false; } volatile sig_atomic_t g_sigterm_pending, g_sighup_pending, g_sigusr2_pending; void main_loop() { int terminate = 0; #ifdef SIGNAL_BLOCKING sigset_t newmask, oldmask; #endif #ifdef BUILD_X11 double t; #endif /* BUILD_X11 */ #ifdef HAVE_SYS_INOTIFY_H int inotify_config_wd = -1; #define INOTIFY_EVENT_SIZE (sizeof(struct inotify_event)) #define INOTIFY_BUF_LEN (20 * (INOTIFY_EVENT_SIZE + 16)) + 1 char inotify_buff[INOTIFY_BUF_LEN]; #endif /* HAVE_SYS_INOTIFY_H */ #ifdef SIGNAL_BLOCKING sigemptyset(&newmask); sigaddset(&newmask, SIGINT); sigaddset(&newmask, SIGTERM); sigaddset(&newmask, SIGUSR1); #endif last_update_time = 0.0; next_update_time = get_time() - fmod(get_time(), active_update_interval()); info.looped = 0; while (terminate == 0 && (total_run_times.get(*state) == 0 || info.looped < total_run_times.get(*state))) { if ((update_interval_on_battery.get(*state) != NOBATTERY)) { on_battery = is_on_battery(); } info.looped++; #ifdef SIGNAL_BLOCKING /* block signals. we will inspect for pending signals later */ if (sigprocmask(SIG_BLOCK, &newmask, &oldmask) < 0) { CRIT_ERR(nullptr, NULL, "unable to sigprocmask()"); } #endif #ifdef BUILD_X11 if (out_to_x.get(*state)) { /* wait for X event or timeout */ if (XPending(display) == 0) { fd_set fdsr; struct timeval tv {}; int s; t = next_update_time - get_time(); t = std::min(std::max(t, 0.0), active_update_interval()); tv.tv_sec = static_cast(t); tv.tv_usec = static_cast(t * 1000000) % 1000000; FD_ZERO(&fdsr); FD_SET(ConnectionNumber(display), &fdsr); s = select(ConnectionNumber(display) + 1, &fdsr, nullptr, nullptr, &tv); if (s == -1) { if (errno != EINTR) { NORM_ERR("can't select(): %s", strerror(errno)); } } else { /* timeout */ if (s == 0) { update_text(); } } } if (need_to_update != 0) { #ifdef OWN_WINDOW int wx = window.x, wy = window.y; #endif need_to_update = 0; selected_font = 0; update_text_area(); #ifdef OWN_WINDOW if (own_window.get(*state)) { int changed = 0; int border_total = get_border_total(); /* resize window if it isn't right size */ if ((fixed_size == 0) && (text_width + 2 * border_total != window.width || text_height + 2 * border_total != window.height)) { window.width = text_width + 2 * border_total; window.height = text_height + 2 * border_total; draw_stuff(); /* redraw everything in our newly sized window */ XResizeWindow(display, window.window, window.width, window.height); /* resize window */ set_transparent_background(window.window); #ifdef BUILD_XDBE /* swap buffers */ xdbe_swap_buffers(); #else if (use_xpmdb.get(*state)) { XFreePixmap(display, window.back_buffer); window.back_buffer = XCreatePixmap(display, window.window, window.width, window.height, DefaultDepth(display, screen)); if (window.back_buffer != None) { window.drawable = window.back_buffer; } else { // this is probably reallllly bad NORM_ERR("Failed to allocate back buffer"); } XSetForeground(display, window.gc, 0); XFillRectangle(display, window.drawable, window.gc, 0, 0, window.width, window.height); } #endif changed++; /* update lua window globals */ llua_update_window_table(text_start_x, text_start_y, text_width, text_height); } /* move window if it isn't in right position */ if ((fixed_pos == 0) && (window.x != wx || window.y != wy)) { XMoveWindow(display, window.window, window.x, window.y); changed++; } /* update struts */ if ((changed != 0) && own_window_type.get(*state) == TYPE_PANEL) { int sidenum = -1; DBGP("%s", _(PACKAGE_NAME ": defining struts\n")); fflush(stderr); switch (text_alignment.get(*state)) { case TOP_LEFT: case TOP_RIGHT: case TOP_MIDDLE: { sidenum = 2; break; } case BOTTOM_LEFT: case BOTTOM_RIGHT: case BOTTOM_MIDDLE: { sidenum = 3; break; } case MIDDLE_LEFT: { sidenum = 0; break; } case MIDDLE_RIGHT: { sidenum = 1; break; } case NONE: case MIDDLE_MIDDLE: /* XXX What about these? */; } set_struts(sidenum); } } #endif clear_text(1); #if defined(BUILD_XDBE) if (use_xdbe.get(*state)) { #else if (use_xpmdb.get(*state)) { #endif XRectangle r; int border_total = get_border_total(); r.x = text_start_x - border_total; r.y = text_start_y - border_total; r.width = text_width + 2 * border_total; r.height = text_height + 2 * border_total; XUnionRectWithRegion(&r, x11_stuff.region, x11_stuff.region); } } /* handle X events */ while (XPending(display) != 0) { XEvent ev; XNextEvent(display, &ev); switch (ev.type) { case Expose: { XRectangle r; r.x = ev.xexpose.x; r.y = ev.xexpose.y; r.width = ev.xexpose.width; r.height = ev.xexpose.height; XUnionRectWithRegion(&r, x11_stuff.region, x11_stuff.region); XSync(display, False); break; } case PropertyNotify: { if (ev.xproperty.state == PropertyNewValue) { get_x11_desktop_info(ev.xproperty.display, ev.xproperty.atom); } #ifdef USE_ARGB if (!have_argb_visual) { #endif if (ev.xproperty.atom == ATOM(_XROOTPMAP_ID) || ev.xproperty.atom == ATOM(_XROOTMAP_ID)) { if (forced_redraw.get(*state)) { draw_stuff(); next_update_time = get_time(); need_to_update = 1; } } #ifdef USE_ARGB } #endif break; } #ifdef OWN_WINDOW case ReparentNotify: /* make background transparent */ if (own_window.get(*state)) { set_transparent_background(window.window); } break; case ConfigureNotify: if (own_window.get(*state)) { /* if window size isn't what expected, set fixed size */ if (ev.xconfigure.width != window.width || ev.xconfigure.height != window.height) { if (window.width != 0 && window.height != 0) { fixed_size = 1; } /* clear old stuff before screwing up * size and pos */ clear_text(1); { XWindowAttributes attrs; if (XGetWindowAttributes(display, window.window, &attrs) != 0) { window.width = attrs.width; window.height = attrs.height; } } int border_total = get_border_total(); text_width = window.width - 2 * border_total; text_height = window.height - 2 * border_total; int mw = xft_dpi_scale(maximum_width.get(*state)); if (text_width > mw && mw > 0) { text_width = mw; } } /* if position isn't what expected, set fixed pos * total_updates avoids setting fixed_pos when window * is set to weird locations when started */ /* // this is broken if (total_updates >= 2 && !fixed_pos && (window.x != ev.xconfigure.x || window.y != ev.xconfigure.y) && (ev.xconfigure.x != 0 || ev.xconfigure.y != 0)) { fixed_pos = 1; } */ } break; case ButtonPress: if (own_window.get(*state)) { /* if an ordinary window with decorations */ if ((own_window_type.get(*state) == TYPE_NORMAL && !TEST_HINT(own_window_hints.get(*state), HINT_UNDECORATED)) || own_window_type.get(*state) == TYPE_DESKTOP) { /* allow conky to hold input focus. */ break; } /* forward the click to the desktop window */ XUngrabPointer(display, ev.xbutton.time); ev.xbutton.window = window.desktop; ev.xbutton.x = ev.xbutton.x_root; ev.xbutton.y = ev.xbutton.y_root; XSendEvent(display, ev.xbutton.window, False, ButtonPressMask, &ev); XSetInputFocus(display, ev.xbutton.window, RevertToParent, ev.xbutton.time); } break; case ButtonRelease: if (own_window.get(*state)) { /* if an ordinary window with decorations */ if ((own_window_type.get(*state) == TYPE_NORMAL) && !TEST_HINT(own_window_hints.get(*state), HINT_UNDECORATED)) { /* allow conky to hold input focus. */ break; } /* forward the release to the desktop window */ ev.xbutton.window = window.desktop; ev.xbutton.x = ev.xbutton.x_root; ev.xbutton.y = ev.xbutton.y_root; XSendEvent(display, ev.xbutton.window, False, ButtonReleaseMask, &ev); } break; #endif default: #ifdef BUILD_XDAMAGE if (ev.type == x11_stuff.event_base + XDamageNotify) { auto *dev = reinterpret_cast(&ev); XFixesSetRegion(display, x11_stuff.part, &dev->area, 1); XFixesUnionRegion(display, x11_stuff.region2, x11_stuff.region2, x11_stuff.part); } #endif /* BUILD_XDAMAGE */ break; } } #ifdef BUILD_XDAMAGE if (x11_stuff.damage) { XDamageSubtract(display, x11_stuff.damage, x11_stuff.region2, None); XFixesSetRegion(display, x11_stuff.region2, nullptr, 0); } #endif /* BUILD_XDAMAGE */ /* XDBE doesn't seem to provide a way to clear the back buffer * without interfering with the front buffer, other than passing * XdbeBackground to XdbeSwapBuffers. That means that if we're * using XDBE, we need to redraw the text even if it wasn't part of * the exposed area. OTOH, if we're not going to call draw_stuff at * all, then no swap happens and we can safely do nothing. */ if (XEmptyRegion(x11_stuff.region) == 0) { #if defined(BUILD_XDBE) if (use_xdbe.get(*state)) { #else if (use_xpmdb.get(*state)) { #endif XRectangle r; int border_total = get_border_total(); r.x = text_start_x - border_total; r.y = text_start_y - border_total; r.width = text_width + 2 * border_total; r.height = text_height + 2 * border_total; XUnionRectWithRegion(&r, x11_stuff.region, x11_stuff.region); } XSetRegion(display, window.gc, x11_stuff.region); #ifdef BUILD_XFT if (use_xft.get(*state)) { XftDrawSetClip(window.xftdraw, x11_stuff.region); } #endif draw_stuff(); XDestroyRegion(x11_stuff.region); x11_stuff.region = XCreateRegion(); } } else { #endif /* BUILD_X11 */ struct timespec req, rem; auto time_to_sleep = next_update_time - get_time(); auto seconds = static_cast(std::floor(time_to_sleep)); auto nanos = (time_to_sleep - seconds) * 1000000000L; req.tv_sec = seconds; req.tv_nsec = nanos; nanosleep(&req, &rem); update_text(); draw_stuff(); #ifdef BUILD_NCURSES if (out_to_ncurses.get(*state)) { refresh(); clear(); } #endif #ifdef BUILD_X11 } #endif /* BUILD_X11 */ #ifdef SIGNAL_BLOCKING /* unblock signals of interest and let handler fly */ if (sigprocmask(SIG_SETMASK, &oldmask, nullptr) < 0) { CRIT_ERR(nullptr, NULL, "unable to sigprocmask()"); } #endif if (g_sighup_pending != 0) { g_sighup_pending = 0; NORM_ERR("received SIGUSR1. reloading the config file."); reload_config(); } if (g_sigusr2_pending != 0) { g_sigusr2_pending = 0; // refresh view; NORM_ERR("received SIGUSR2. refreshing."); update_text(); draw_stuff(); #ifdef BUILD_NCURSES if (out_to_ncurses.get(*state)) { refresh(); clear(); } #endif } if (g_sigterm_pending != 0) { g_sigterm_pending = 0; NORM_ERR("received SIGHUP, SIGINT, or SIGTERM to terminate. bye!"); terminate = 1; #ifdef BUILD_X11 if (out_to_x.get(*state)) { XDestroyRegion(x11_stuff.region); x11_stuff.region = nullptr; #ifdef BUILD_XDAMAGE if (x11_stuff.damage) { XDamageDestroy(display, x11_stuff.damage); XFixesDestroyRegion(display, x11_stuff.region2); XFixesDestroyRegion(display, x11_stuff.part); } #endif /* BUILD_XDAMAGE */ } #endif /* BUILD_X11 */ } #ifdef HAVE_SYS_INOTIFY_H if (!disable_auto_reload.get(*state) && inotify_fd != -1 && inotify_config_wd == -1 && !current_config.empty()) { inotify_config_wd = inotify_add_watch(inotify_fd, current_config.c_str(), IN_MODIFY); } if (!disable_auto_reload.get(*state) && inotify_fd != -1 && inotify_config_wd != -1 && !current_config.empty()) { int len = 0, idx = 0; fd_set descriptors; struct timeval time_to_wait; FD_ZERO(&descriptors); FD_SET(inotify_fd, &descriptors); time_to_wait.tv_sec = time_to_wait.tv_usec = 0; select(inotify_fd + 1, &descriptors, nullptr, NULL, &time_to_wait); if (FD_ISSET(inotify_fd, &descriptors)) { /* process inotify events */ len = read(inotify_fd, inotify_buff, INOTIFY_BUF_LEN - 1); inotify_buff[len] = 0; while (len > 0 && idx < len) { struct inotify_event *ev = (struct inotify_event *)&inotify_buff[idx]; if (ev->wd == inotify_config_wd && (ev->mask & IN_MODIFY || ev->mask & IN_IGNORED)) { /* current_config should be reloaded */ NORM_ERR("'%s' modified, reloading...", current_config.c_str()); reload_config(); if (ev->mask & IN_IGNORED) { /* for some reason we get IN_IGNORED here * sometimes, so we need to re-add the watch */ inotify_config_wd = inotify_add_watch( inotify_fd, current_config.c_str(), IN_MODIFY); } break; } else { llua_inotify_query(ev->wd, ev->mask); } idx += INOTIFY_EVENT_SIZE + ev->len; } } } else if (disable_auto_reload.get(*state) && inotify_fd != -1) { inotify_rm_watch(inotify_fd, inotify_config_wd); close(inotify_fd); inotify_fd = inotify_config_wd = -1; } #endif /* HAVE_SYS_INOTIFY_H */ llua_update_info(&info, active_update_interval()); } clean_up(nullptr, nullptr); #ifdef HAVE_SYS_INOTIFY_H if (inotify_fd != -1) { inotify_rm_watch(inotify_fd, inotify_config_wd); close(inotify_fd); inotify_fd = inotify_config_wd = -1; } #endif /* HAVE_SYS_INOTIFY_H */ } /* reload the config file */ static void reload_config() { struct stat sb {}; if ((stat(current_config.c_str(), &sb) != 0) || (!S_ISREG(sb.st_mode) && !S_ISLNK(sb.st_mode))) { NORM_ERR(_("Config file '%s' is gone, continuing with config from " "memory.\nIf you recreate this file sent me a SIGUSR1 to tell " "me about it. ( kill -s USR1 %d )"), current_config.c_str(), getpid()); return; } clean_up(nullptr, nullptr); state = std::make_unique(); conky::export_symbols(*state); sleep(1); /* slight pause */ initialisation(argc_copy, argv_copy); } #ifdef BUILD_X11 void clean_up_x11() { if (window_created == 1) { int border_total = get_border_total(); XClearArea(display, window.window, text_start_x - border_total, text_start_y - border_total, text_width + 2 * border_total, text_height + 2 * border_total, 0); } destroy_window(); free_fonts(utf8_mode.get(*state)); if (x11_stuff.region != nullptr) { XDestroyRegion(x11_stuff.region); x11_stuff.region = nullptr; } } #endif void free_specials(special_t *¤t) { if (current != nullptr) { free_specials(current->next); if (current->type == GRAPH) { free(current->graph); } delete current; current = nullptr; } clear_stored_graphs(); } void clean_up_without_threads(void *memtofree1, void *memtofree2) { free_and_zero(memtofree1); free_and_zero(memtofree2); free_and_zero(info.cpu_usage); #ifdef BUILD_X11 if (out_to_x.get(*state)) { clean_up_x11(); } else { fonts.clear(); // in set_default_configurations a font is set but not } // loaded #endif /* BUILD_X11 */ if (info.first_process != nullptr) { free_all_processes(); info.first_process = nullptr; } free_text_objects(&global_root_object); delete_block_and_zero(tmpstring1); delete_block_and_zero(tmpstring2); delete_block_and_zero(text_buffer); free_and_zero(global_text); #ifdef BUILD_PORT_MONITORS tcp_portmon_clear(); #endif llua_shutdown_hook(); #if defined BUILD_RSS xmlCleanupParser(); #endif free_specials(specials); clear_net_stats(); clear_fs_stats(); clear_diskio_stats(); free_and_zero(global_cpu); conky::cleanup_config_settings(*state); state.reset(); } void clean_up(void *memtofree1, void *memtofree2) { /* free_update_callbacks(); XXX: some new equivalent of this? */ clean_up_without_threads(memtofree1, memtofree2); } static void set_default_configurations() { update_uname(); info.memmax = 0; top_cpu = 0; top_mem = 0; top_time = 0; #ifdef BUILD_IOSTATS top_io = 0; #endif top_running = 0; #ifdef BUILD_XMMS2 info.xmms2.artist = nullptr; info.xmms2.album = nullptr; info.xmms2.title = nullptr; info.xmms2.genre = nullptr; info.xmms2.comment = nullptr; info.xmms2.url = nullptr; info.xmms2.status = nullptr; info.xmms2.playlist = nullptr; #endif /* BUILD_XMMS2 */ state->pushboolean(true); #ifdef BUILD_X11 out_to_x.lua_set(*state); #else out_to_stdout.lua_set(*state); #endif info.users.number = 1; } #ifdef BUILD_X11 static void X11_create_window() { if (out_to_x.get(*state)) { setup_fonts(); load_fonts(utf8_mode.get(*state)); #ifdef BUILD_XFT if (use_xft.get(*state)) { auto dpi = XGetDefault(display, "Xft", "dpi"); if (dpi) { xft_dpi = atoi(dpi); } } #endif /* BUILD_XFT */ update_text_area(); /* to position text/window on screen */ #ifdef OWN_WINDOW if (own_window.get(*state)) { if (fixed_pos == 0) { XMoveWindow(display, window.window, window.x, window.y); } set_transparent_background(window.window); } #endif create_gc(); draw_stuff(); x11_stuff.region = XCreateRegion(); #ifdef BUILD_XDAMAGE if (XDamageQueryExtension(display, &x11_stuff.event_base, &x11_stuff.error_base) == 0) { NORM_ERR("Xdamage extension unavailable"); x11_stuff.damage = 0; } else { x11_stuff.damage = XDamageCreate(display, window.window, XDamageReportNonEmpty); x11_stuff.region2 = XFixesCreateRegionFromWindow(display, window.window, 0); x11_stuff.part = XFixesCreateRegionFromWindow(display, window.window, 0); } #endif /* BUILD_XDAMAGE */ selected_font = 0; update_text_area(); /* to get initial size of the window */ } /* setup lua window globals */ llua_setup_window_table(text_start_x, text_start_y, text_width, text_height); } #endif /* BUILD_X11 */ void load_config_file() { DBGP(_("reading contents from config file '%s'"), current_config.c_str()); lua::state &l = *state; lua::stack_sentry s(l); l.checkstack(2); try { #ifdef BUILD_BUILTIN_CONFIG if (current_config == builtin_config_magic) { l.loadstring(defconfig); } else { #endif l.loadfile(current_config.c_str()); #ifdef BUILD_BUILTIN_CONFIG } #endif } catch (lua::syntax_error &e) { #define SYNTAX_ERR_READ_CONF "Syntax error (%s) while reading config file. " #ifdef BUILD_OLD_CONFIG NORM_ERR(_(SYNTAX_ERR_READ_CONF), e.what()); NORM_ERR(_("Assuming it's in old syntax and attempting conversion.")); // the strchr thingy skips the first line (#! /usr/bin/lua) l.loadstring(strchr(convertconf, '\n')); l.pushstring(current_config.c_str()); l.call(1, 1); #else char *syntaxerr; if (asprintf(&syntaxerr, _(SYNTAX_ERR_READ_CONF), e.what())) { std::string syntaxerrobj(syntaxerr); free(syntaxerr); throw conky::error(syntaxerrobj); } #endif } l.call(0, 0); l.getglobal("conky"); l.getfield(-1, "text"); l.replace(-2); if (l.type(-1) != lua::TSTRING) { throw conky::error(_("missing text block in configuration")); } /* Remove \\-\n. */ l.gsub(l.tocstring(-1), "\\\n", ""); l.replace(-2); global_text = strdup(l.tocstring(-1)); l.pop(); } inline void reset_optind() { #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) optind = optreset = 1; #else optind = 0; #endif } void set_current_config() { /* load current_config, CONFIG_FILE or SYSTEM_CONFIG_FILE */ struct stat s {}; if (current_config.empty()) { /* Try to use personal config file first */ std::string buf = to_real_path(XDG_CONFIG_FILE); if (stat(buf.c_str(), &s) == 0) { current_config = buf; } } if (current_config.empty()) { /* Try to use personal config file first */ std::string buf = to_real_path(CONFIG_FILE); if (stat(buf.c_str(), &s) == 0) { current_config = buf; } } /* Try to use system config file if personal config does not exist */ if (current_config.empty() && (stat(SYSTEM_CONFIG_FILE, &s) == 0)) { current_config = SYSTEM_CONFIG_FILE; } /* No readable config found */ if (current_config.empty()) { #define NOCFGFILEFOUND "no personal or system-wide config file found" #ifdef BUILD_BUILTIN_CONFIG current_config = builtin_config_magic; NORM_ERR(NOCFGFILEFOUND ", using builtin default"); #else throw conky::error(NOCFGFILEFOUND); #endif } // "-" stands for "read from stdin" if (current_config == "-") { current_config = "/dev/stdin"; } } /* : means that character before that takes an argument */ const char *getopt_string = "vVqdDSs:t:u:i:hc:p:" #ifdef BUILD_X11 "x:y:w:a:X:m:f:" #ifdef OWN_WINDOW "o" #endif "b" #endif /* BUILD_X11 */ #ifdef BUILD_BUILTIN_CONFIG "C" #endif ; const struct option longopts[] = { {"help", 0, nullptr, 'h'}, {"version", 0, nullptr, 'V'}, {"quiet", 0, nullptr, 'q'}, {"debug", 0, nullptr, 'D'}, {"config", 1, nullptr, 'c'}, #ifdef BUILD_BUILTIN_CONFIG {"print-config", 0, nullptr, 'C'}, #endif {"daemonize", 0, nullptr, 'd'}, #ifdef BUILD_X11 {"alignment", 1, nullptr, 'a'}, {"display", 1, nullptr, 'X'}, {"xinerama-head", 1, nullptr, 'm'}, {"font", 1, nullptr, 'f'}, #ifdef OWN_WINDOW {"own-window", 0, nullptr, 'o'}, #endif {"double-buffer", 0, nullptr, 'b'}, {"window-id", 1, nullptr, 'w'}, #endif /* BUILD_X11 */ {"text", 1, nullptr, 't'}, {"interval", 1, nullptr, 'u'}, {"pause", 1, nullptr, 'p'}, {nullptr, 0, nullptr, 0}}; void setup_inotify() { #ifdef HAVE_SYS_INOTIFY_H // the file descriptor will be automatically closed on exit inotify_fd = inotify_init(); if (inotify_fd != -1) { fcntl(inotify_fd, F_SETFL, fcntl(inotify_fd, F_GETFL) | O_NONBLOCK); fcntl(inotify_fd, F_SETFD, fcntl(inotify_fd, F_GETFD) | FD_CLOEXEC); } #endif /* HAVE_SYS_INOTIFY_H */ } void initialisation(int argc, char **argv) { struct sigaction act { }, oact{}; clear_net_stats(); set_default_configurations(); set_current_config(); load_config_file(); /* handle other command line arguments */ reset_optind(); #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) if ((kd = kvm_open("/dev/null", "/dev/null", "/dev/null", O_RDONLY, "kvm_open")) == nullptr) { CRIT_ERR(nullptr, NULL, "cannot read kvm"); } #endif while (1) { int c = getopt_long(argc, argv, getopt_string, longopts, nullptr); int startup_pause; char *conv_end; if (c == -1) { break; } switch (c) { case 'd': state->pushboolean(true); fork_to_background.lua_set(*state); break; #ifdef BUILD_X11 case 'f': state->pushstring(optarg); font.lua_set(*state); break; case 'a': state->pushstring(optarg); text_alignment.lua_set(*state); break; case 'm': state->pushinteger(strtol(optarg, &conv_end, 10)); if (*conv_end != 0) { CRIT_ERR(nullptr, nullptr, "'%s' is a wrong xinerama-head index", optarg); } head_index.lua_set(*state); break; case 'X': state->pushstring(optarg); display_name.lua_set(*state); break; #ifdef OWN_WINDOW case 'o': state->pushboolean(true); own_window.lua_set(*state); break; #endif #ifdef BUILD_XDBE case 'b': state->pushboolean(true); use_xdbe.lua_set(*state); break; #else case 'b': state->pushboolean(true); use_xpmdb.lua_set(*state); break; #endif #endif /* BUILD_X11 */ case 't': free_and_zero(global_text); global_text = strndup(optarg, max_user_text.get(*state)); convert_escapes(global_text); break; case 'u': state->pushinteger(xft_dpi_scale(strtol(optarg, &conv_end, 10))); if (*conv_end != 0) { CRIT_ERR(nullptr, nullptr, "'%s' is a wrong update-interval", optarg); } update_interval.lua_set(*state); break; case 'i': state->pushinteger(strtol(optarg, &conv_end, 10)); if (*conv_end != 0) { CRIT_ERR(nullptr, nullptr, "'%s' is a wrong number of update-times", optarg); } total_run_times.lua_set(*state); break; #ifdef BUILD_X11 case 'x': state->pushinteger(strtol(optarg, &conv_end, 10)); if (*conv_end != 0) { CRIT_ERR(nullptr, nullptr, "'%s' is a wrong value for the X-position", optarg); } gap_x.lua_set(*state); break; case 'y': state->pushinteger(strtol(optarg, &conv_end, 10)); if (*conv_end != 0) { CRIT_ERR(nullptr, nullptr, "'%s' is a wrong value for the Y-position", optarg); } gap_y.lua_set(*state); break; #endif /* BUILD_X11 */ case 'p': if (first_pass != 0) { startup_pause = atoi(optarg); sleep(startup_pause); } break; case '?': throw unknown_arg_throw(); } } conky::set_config_settings(*state); #ifdef BUILD_X11 if (out_to_x.get(*state)) { current_text_color = default_color.get(*state); } #endif /* generate text and get initial size */ extract_variable_text(global_text); free_and_zero(global_text); /* fork */ if (fork_to_background.get(*state) && (first_pass != 0)) { int pid = fork(); switch (pid) { case -1: NORM_ERR(PACKAGE_NAME ": couldn't fork() to background: %s", strerror(errno)); break; case 0: /* child process */ usleep(25000); fprintf(stderr, "\n"); fflush(stderr); break; default: /* parent process */ fprintf(stderr, PACKAGE_NAME ": forked to background, pid is %d\n", pid); fflush(stderr); throw fork_throw(); } } text_buffer = new char[max_user_text.get(*state)]; memset(text_buffer, 0, max_user_text.get(*state)); tmpstring1 = new char[text_buffer_size.get(*state)]; memset(tmpstring1, 0, text_buffer_size.get(*state)); tmpstring2 = new char[text_buffer_size.get(*state)]; memset(tmpstring2, 0, text_buffer_size.get(*state)); #ifdef BUILD_X11 X11_create_window(); #endif /* BUILD_X11 */ llua_setup_info(&info, active_update_interval()); /* Set signal handlers */ act.sa_handler = signal_handler; sigemptyset(&act.sa_mask); act.sa_flags = 0; #ifdef SA_RESTART act.sa_flags |= SA_RESTART; #endif if (sigaction(SIGINT, &act, &oact) < 0 || sigaction(SIGALRM, &act, &oact) < 0 || sigaction(SIGUSR1, &act, &oact) < 0 || sigaction(SIGUSR2, &act, &oact) < 0 || sigaction(SIGHUP, &act, &oact) < 0 || sigaction(SIGTERM, &act, &oact) < 0) { NORM_ERR("error setting signal handler: %s", strerror(errno)); } llua_startup_hook(); } static void signal_handler(int sig) { /* signal handler is light as a feather, as it should be. * we will poll g_signal_pending with each loop of conky * and do any signal processing there, NOT here */ switch (sig) { case SIGHUP: case SIGINT: case SIGTERM: g_sigterm_pending = 1; break; case SIGUSR1: g_sighup_pending = 1; break; case SIGUSR2: g_sigusr2_pending = 1; default: /* Reaching here means someone set a signal * (SIGXXXX, signal_handler), but didn't write any code * to deal with it. * If you don't want to handle a signal, don't set a handler on * it in the first place. * We cannot print debug messages from a sighandler, so simply ignore. */ break; } } conky-1.12.2/src/conky.h000066400000000000000000000221551404127277500150210ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _conky_h_ #define _conky_h_ #define __STDC_FORMAT_MACROS #include #include /* defines */ #include /* struct uname_s */ #include #include #include "common.h" /* at least for struct dns_data */ #include "luamm.hh" #if defined(HAS_MCHECK_H) #include #endif /* HAS_MCHECK_H */ #undef EQUAL #undef FALSE #undef TRUE #define EQUAL 0 // returnvalue of strcmp-variants when strings are equal #define FALSE 0 #define TRUE 1 #define DEFAULT_BAR_WIDTH_NO_X 10 #if !defined(__GNUC__) #define __attribute__(x) /* nothing */ #endif #ifndef HAVE_STRNDUP // use our own strndup() if it's not available char *strndup(const char *s, size_t n); #endif /* HAVE_STRNDUP */ /* headers of optional features * include them here, so we don't need to run the check * in every code file optionally using the feature */ /* forward define to make gcc happy */ struct text_object; #ifdef BUILD_HDDTEMP #include "hddtemp.h" #endif /* BUILD_HDDTEMP */ #ifdef BUILD_MOC #include "moc.h" #endif /* BUILD_MOC */ #ifdef BUILD_MPD #include "mpd.h" #endif /* BUILD_MPD */ #ifdef BUILD_MYSQL #include "mysql.h" #endif /* BUILD_MYSQL */ #ifdef BUILD_PORT_MONITORS #include "tcp-portmon.h" #endif #ifdef BUILD_XMMS2 #include "xmms2.h" #endif /* BUILD_XMMS2 */ #ifdef BUILD_APCUPSD #include "apcupsd.h" #endif /* BUILD_APCUPSD */ /* sony support */ #include "sony.h" /* A size for temporary, static buffers to use when * one doesn't know what to choose. Defaults to 256. */ extern conky::range_config_setting text_buffer_size; struct usr_info { char *names; char *times; char *ctime; char *terms; int number; }; #ifdef BUILD_X11 struct monitor_info { int number; int current; }; struct desktop_info { int current; int number; std::string all_names; std::string name; }; struct x11_info { struct monitor_info monitor; struct desktop_info desktop; }; #endif /* BUILD_X11 */ struct conftree { char *string; struct conftree *horz_next; struct conftree *vert_next; struct conftree *back; }; void load_config_file(); char *get_global_text(void); extern long global_text_lines; #define MAX_TEMPLATES 10 char **get_templates(void); /* get_battery_stuff() item selector * needed by conky.c, linux.c and freebsd.c */ enum { BATTERY_STATUS, BATTERY_TIME }; struct information { unsigned int mask; struct utsname uname_s; #if defined(__DragonFly__) char uname_v[256]; /* with git version */ #endif char freq[10]; double uptime; /* memory information in kilobytes */ unsigned long long mem, memwithbuffers, memeasyfree, memfree, memmax, memdirty, legacymem; unsigned long long swap, swapfree, swapmax; unsigned long long bufmem, buffers, cached; unsigned short procs; unsigned short run_procs; unsigned short threads; unsigned short run_threads; float *cpu_usage; /* struct cpu_stat cpu_summed; what the hell is this? */ unsigned int cpu_count; float loadavg[3]; #ifdef BUILD_XMMS2 struct xmms2_s xmms2; #endif /* BUILD_XMMS2 */ struct usr_info users; struct process *cpu[10]; struct process *memu[10]; struct process *time[10]; #ifdef BUILD_IOSTATS struct process *io[10]; #endif /* BUILD_IOSTATS */ struct process *first_process; unsigned long looped; #ifdef BUILD_X11 struct x11_info x11; #endif /* BUILD_X11 */ short kflags; /* kernel settings, see enum KFLAG */ #if defined(__APPLE__) && defined(__MACH__) /* System Integrity Protection related */ struct csr_config_flags { bool csr_allow_untrusted_kexts; bool csr_allow_unrestricted_fs; bool csr_allow_task_for_pid; bool csr_allow_kernel_debugger; bool csr_allow_apple_internal; bool csr_allow_unrestricted_dtrace; bool csr_allow_unrestricted_nvram; bool csr_allow_device_configuration; bool csr_allow_any_recovery_os; bool csr_allow_user_approved_kexts; }; /* SIP typedefs */ typedef csr_config_flags csr_config_flags_t; typedef uint32_t csr_config_t; /* SIP variables */ csr_config_t csr_config; csr_config_flags_t csr_config_flags; #endif /* defined(__APPLE__) && defined(__MACH__) */ }; class music_player_interval_setting : public conky::simple_config_setting { typedef conky::simple_config_setting Base; protected: virtual void lua_setter(lua::state &l, bool init); public: music_player_interval_setting() : Base("music_player_interval", 0, true) {} }; extern music_player_interval_setting music_player_interval; extern conky::range_config_setting cpu_avg_samples; extern conky::range_config_setting net_avg_samples; extern conky::range_config_setting diskio_avg_samples; /* needed by linux.c and top.c -> outsource somewhere */ enum { /* set to true if kernel uses "long" format for /proc/stats */ KFLAG_IS_LONGSTAT = 0x01, /* set to true if kernel shows # of threads for the proc value * in sysinfo() call */ KFLAG_PROC_IS_THREADS = 0x02 /* bits 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 available for future use */ /* KFLAG_NEXT_ONE = 0x04 */ }; #define KFLAG_SETON(a) info.kflags |= a #define KFLAG_SETOFF(a) info.kflags &= (~a) #define KFLAG_FLIP(a) info.kflags ^= a #define KFLAG_ISSET(a) info.kflags &a #if !defined(MAX) #define MAX(x, y) \ ({ \ __typeof__(x) _x = (x); \ __typeof__(y) _y = (y); \ _x > _y ? _x : _y; \ }) #endif #if !defined(MIN) #define MIN(x, y) \ ({ \ __typeof__(x) _x = (x); \ __typeof__(y) _y = (y); \ _x < _y ? _x : _y; \ }) #endif /* defined in conky.c, needed by top.c */ extern int top_cpu, top_mem, top_time; #ifdef BUILD_IOSTATS extern int top_io; #endif /* BUILD_IOSTATS */ extern int top_running; /* struct that has all info to be shared between * instances of the same text object */ extern struct information info; /* defined in conky.c */ extern double current_update_time, last_update_time; extern conky::range_config_setting update_interval; extern conky::range_config_setting update_interval_on_battery; double active_update_interval(); extern conky::range_config_setting stippled_borders; void set_current_text_color(long colour); long get_current_text_color(void); void set_updatereset(int); int get_updatereset(void); int get_total_updates(void); int xft_dpi_scale(int value); int get_saved_coordinates_x(int); int get_saved_coordinates_y(int); /* defined in conky.c */ int spaced_print(char *, int, const char *, int, ...) __attribute__((format(printf, 3, 5))); extern int inotify_fd; /* defined in conky.c * evaluates 'text' and places the result in 'p' of max length 'p_max_size' */ void evaluate(const char *text, char *p, int p_max_size); void parse_conky_vars(struct text_object *, const char *, char *, int); void extract_object_args_to_sub(struct text_object *, const char *); void generate_text_internal(char *, int, struct text_object); int percent_print(char *, int, unsigned); void human_readable(long long, char *, int); #ifdef BUILD_X11 /* UTF-8 */ extern conky::simple_config_setting utf8_mode; #endif /* maximum size of config TEXT buffer, i.e. below TEXT line. */ extern conky::range_config_setting max_user_text; /* path to config file */ extern std::string current_config; #define DEFAULT_TEXT_BUFFER_SIZE_S "##DEFAULT_TEXT_BUFFER_SIZE" #define NOBATTERY 0 /* to get rid of 'unused variable' warnings */ #define UNUSED(a) (void)a #define UNUSED_ATTR __attribute__((unused)) template void free_and_zero(T *&ptr) { if (ptr) { free(ptr); ptr = nullptr; } } template void delete_block_and_zero(T *&ptr) { if (ptr) { delete[] ptr; ptr = nullptr; } } extern std::unique_ptr state; extern conky::simple_config_setting out_to_stdout; void setup_inotify(); void initialisation(int argc, char **argv); void set_current_config(); void main_loop(); extern volatile sig_atomic_t g_sigterm_pending, g_sighup_pending, g_sigusr2_pending; extern int first_pass; extern int argc_copy; extern char **argv_copy; extern const char *getopt_string; extern const struct option longopts[]; #endif /* _conky_h_ */ conky-1.12.2/src/core.cc000066400000000000000000002562451404127277500147750ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ /* local headers */ #include "core.h" #include "algebra.h" #include "bsdapm.h" #include "build.h" #include "colours.h" #include "combine.h" #include "diskio.h" #include "entropy.h" #include "exec.h" #include "i8k.h" #include "misc.h" #include "text_object.h" #ifdef BUILD_IMLIB2 #include "imlib2.h" #endif /* BUILD_IMLIB2 */ #include "proc.h" #ifdef BUILD_MYSQL #include "mysql.h" #endif /* BUILD_MYSQL */ #ifdef BUILD_ICAL #include "ical.h" #endif /* BUILD_ICAL */ #ifdef BUILD_IRC #include "irc.h" #endif /* BUILD_IRC */ #ifdef BUILD_X11 #include "fonts.h" #endif /* BUILD_X11 */ #include "fs.h" #ifdef BUILD_IBM #include "ibm.h" #include "smapi.h" #endif /* BUILD_IBM */ #ifdef BUILD_ICONV #include "iconv_tools.h" #endif /* BUILD_ICONV */ #include "llua.h" #include "logging.h" #include "mail.h" #include "mboxscan.h" #include "mixer.h" #include "nc.h" #include "net_stat.h" #ifdef BUILD_NVIDIA #include "nvidia.h" #endif /* BUILD_NVIDIA */ #include #include "cpu.h" #include "read_tcpip.h" #include "scroll.h" #include "specials.h" #include "tailhead.h" #include "temphelper.h" #include "template.h" #include "timeinfo.h" #include "top.h" #include "user.h" #include "users.h" #ifdef BUILD_CURL #include "ccurl_thread.h" #endif /* BUILD_CURL */ #ifdef BUILD_WEATHER_METAR #include "weather.h" #endif /* BUILD_WEATHER_METAR */ #ifdef BUILD_RSS #include "rss.h" #endif /* BUILD_RSS */ #ifdef BUILD_AUDACIOUS #include "audacious.h" #endif /* BUILD_AUDACIOUS */ #ifdef BUILD_CMUS #include "cmus.h" #endif /* BUILD_CMUS */ #ifdef BUILD_JOURNAL #include "journal.h" #endif /* BUILD_JOURNAL */ #ifdef BUILD_PULSEAUDIO #include "pulseaudio.h" #endif /* BUILD_PULSEAUDIO */ #ifdef BUILD_INTEL_BACKLIGHT #include "intel_backlight.h" #endif /* BUILD_INTEL_BACKLIGHT */ /* check for OS and include appropriate headers */ #if defined(__linux__) #include "linux.h" #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include "freebsd.h" #elif defined(__DragonFly__) #include "dragonfly.h" #elif defined(__OpenBSD__) #include "openbsd.h" #elif defined(__APPLE__) && defined(__MACH__) #include "darwin.h" #endif #define STRNDUP_ARG strndup(arg ? arg : "", text_buffer_size.get(*state)) #include #include /* strip a leading /dev/ if any, following symlinks first * * BEWARE: this function returns a pointer to static content * which gets overwritten in consecutive calls. I.e.: * this function is NOT reentrant. */ const char *dev_name(const char *path) { static char buf[PATH_MAX]; if (path == nullptr) { return nullptr; } #define DEV_NAME(x) \ ((x) != nullptr && strlen(x) > 5 && strncmp(x, "/dev/", 5) == 0 ? (x) + 5 \ : (x)) if (realpath(path, buf) == nullptr) { return DEV_NAME(path); } return DEV_NAME(buf); #undef DEV_NAME } static struct text_object *new_text_object_internal() { auto *obj = static_cast(malloc(sizeof(struct text_object))); memset(obj, 0, sizeof(struct text_object)); return obj; } static struct text_object *create_plain_text(const char *s) { struct text_object *obj; if (s == nullptr || *s == '\0') { return nullptr; } obj = new_text_object_internal(); obj_be_plain_text(obj, s); return obj; } #ifdef BUILD_CURL void stock_parse_arg(struct text_object *obj, const char *arg) { char stock[8]; char data[16]; obj->data.s = nullptr; if (sscanf(arg, "%7s %15s", stock, data) != 2) { NORM_ERR("wrong number of arguments for $stock"); return; } if (!strcasecmp("ask", data)) { strncpy(data, "a", 3); } else if (!strcasecmp("adv", data)) { strncpy(data, "a2", 3); } else if (!strcasecmp("asksize", data)) { strncpy(data, "a5", 3); } else if (!strcasecmp("bid", data)) { strncpy(data, "b", 3); } else if (!strcasecmp("askrt", data)) { strncpy(data, "b2", 3); } else if (!strcasecmp("bidrt", data)) { strncpy(data, "b3", 3); } else if (!strcasecmp("bookvalue", data)) { strncpy(data, "b4", 3); } else if (!strcasecmp("bidsize", data)) { strncpy(data, "b6", 3); } else if (!strcasecmp("change", data)) { strncpy(data, "c1", 3); } else if (!strcasecmp("commission", data)) { strncpy(data, "c3", 3); } else if (!strcasecmp("changert", data)) { strncpy(data, "c6", 3); } else if (!strcasecmp("ahcrt", data)) { strncpy(data, "c8", 3); } else if (!strcasecmp("ds", data)) { strncpy(data, "d", 3); } else if (!strcasecmp("ltd", data)) { strncpy(data, "d1", 3); } else if (!strcasecmp("tradedate", data)) { strncpy(data, "d2", 3); } else if (!strcasecmp("es", data)) { strncpy(data, "e", 3); } else if (!strcasecmp("ei", data)) { strncpy(data, "e1", 3); } else if (!strcasecmp("epsecy", data)) { strncpy(data, "e7", 3); } else if (!strcasecmp("epseny", data)) { strncpy(data, "e8", 3); } else if (!strcasecmp("epsenq", data)) { strncpy(data, "e9", 3); } else if (!strcasecmp("floatshares", data)) { strncpy(data, "f6", 3); } else if (!strcasecmp("dayslow", data)) { strncpy(data, "g", 3); } else if (!strcasecmp("dayshigh", data)) { strncpy(data, "h", 3); } else if (!strcasecmp("52weeklow", data)) { strncpy(data, "j", 3); } else if (!strcasecmp("52weekhigh", data)) { strncpy(data, "k", 3); } else if (!strcasecmp("hgp", data)) { strncpy(data, "g1", 3); } else if (!strcasecmp("ag", data)) { strncpy(data, "g3", 3); } else if (!strcasecmp("hg", data)) { strncpy(data, "g4", 3); } else if (!strcasecmp("hgprt", data)) { strncpy(data, "g5", 3); } else if (!strcasecmp("hgrt", data)) { strncpy(data, "g6", 3); } else if (!strcasecmp("moreinfo", data)) { strncpy(data, "i", 3); } else if (!strcasecmp("obrt", data)) { strncpy(data, "i5", 3); } else if (!strcasecmp("mc", data)) { strncpy(data, "j1", 3); } else if (!strcasecmp("mcrt", data)) { strncpy(data, "j3", 3); } else if (!strcasecmp("ebitda", data)) { strncpy(data, "j4", 3); } else if (!strcasecmp("c52wlow", data)) { strncpy(data, "j5", 3); } else if (!strcasecmp("pc52wlow", data)) { strncpy(data, "j6", 3); } else if (!strcasecmp("cprt", data)) { strncpy(data, "k2", 3); } else if (!strcasecmp("lts", data)) { strncpy(data, "k3", 3); } else if (!strcasecmp("c52whigh", data)) { strncpy(data, "k4", 3); } else if (!strcasecmp("pc52whigh", data)) { strncpy(data, "k5", 3); } else if (!strcasecmp("ltp", data)) { strncpy(data, "l1", 3); } else if (!strcasecmp("hl", data)) { strncpy(data, "l2", 3); } else if (!strcasecmp("ll", data)) { strncpy(data, "l3", 3); } else if (!strcasecmp("dr", data)) { strncpy(data, "m", 3); } else if (!strcasecmp("drrt", data)) { strncpy(data, "m2", 3); } else if (!strcasecmp("50ma", data)) { strncpy(data, "m3", 3); } else if (!strcasecmp("200ma", data)) { strncpy(data, "m4", 3); } else if (!strcasecmp("c200ma", data)) { strncpy(data, "m5", 3); } else if (!strcasecmp("pc200ma", data)) { strncpy(data, "m6", 3); } else if (!strcasecmp("c50ma", data)) { strncpy(data, "m7", 3); } else if (!strcasecmp("pc50ma", data)) { strncpy(data, "m8", 3); } else if (!strcasecmp("name", data)) { strncpy(data, "n", 3); } else if (!strcasecmp("notes", data)) { strncpy(data, "n4", 3); } else if (!strcasecmp("open", data)) { strncpy(data, "o", 3); } else if (!strcasecmp("pc", data)) { strncpy(data, "p", 3); } else if (!strcasecmp("pricepaid", data)) { strncpy(data, "p1", 3); } else if (!strcasecmp("cip", data)) { strncpy(data, "p2", 3); } else if (!strcasecmp("ps", data)) { strncpy(data, "p5", 3); } else if (!strcasecmp("pb", data)) { strncpy(data, "p6", 3); } else if (!strcasecmp("edv", data)) { strncpy(data, "q", 3); } else if (!strcasecmp("per", data)) { strncpy(data, "r", 3); } else if (!strcasecmp("dpd", data)) { strncpy(data, "r1", 3); } else if (!strcasecmp("perrt", data)) { strncpy(data, "r2", 3); } else if (!strcasecmp("pegr", data)) { strncpy(data, "r5", 3); } else if (!strcasecmp("pepsecy", data)) { strncpy(data, "r6", 3); } else if (!strcasecmp("pepseny", data)) { strncpy(data, "r7", 3); } else if (!strcasecmp("symbol", data)) { strncpy(data, "s", 3); } else if (!strcasecmp("sharesowned", data)) { strncpy(data, "s1", 3); } else if (!strcasecmp("shortratio", data)) { strncpy(data, "s7", 3); } else if (!strcasecmp("ltt", data)) { strncpy(data, "t1", 3); } else if (!strcasecmp("tradelinks", data)) { strncpy(data, "t6", 3); } else if (!strcasecmp("tt", data)) { strncpy(data, "t7", 3); } else if (!strcasecmp("1ytp", data)) { strncpy(data, "t8", 3); } else if (!strcasecmp("volume", data)) { strncpy(data, "v", 3); } else if (!strcasecmp("hv", data)) { strncpy(data, "v1", 3); } else if (!strcasecmp("hvrt", data)) { strncpy(data, "v7", 3); } else if (!strcasecmp("52weekrange", data)) { strncpy(data, "w", 3); } else if (!strcasecmp("dvc", data)) { strncpy(data, "w1", 3); } else if (!strcasecmp("dvcrt", data)) { strncpy(data, "w4", 3); } else if (!strcasecmp("se", data)) { strncpy(data, "x", 3); } else if (!strcasecmp("dy", data)) { strncpy(data, "y", 3); } else { NORM_ERR( "\"%s\" is not supported by $stock. Supported: 1ytp, 200ma, 50ma, " "52weeklow, 52weekhigh, 52weekrange, adv, ag, ahcrt, ask, askrt, " "asksize, bid, bidrt, bidsize, bookvalue, c200ma, c50ma, c52whigh, " "c52wlow, change, changert, cip, commission, cprt, dayshigh, dayslow, " "dpd, dr, drrt, ds, dvc, dvcrt, dy, ebitda, edv, ei, epsecy, epsenq, " "epseny, es, floatshares, hg, hgp, hgprt, hl, hv, hvrt, ll, ltd, ltp, " "lts, ltt, mc, mcrt, moreinfo, name, notes, obrt, open, pb, pc, " "pc200ma, pc50ma, pc52whigh, pc52wlow, pegr, pepsecy, pepseny, per, " "perrt, pricepaid, ps, se, sharesowned, shortratio, symbol, tradedate, " "tradelinks, tt, volume", data); return; } #define MAX_FINYAH_URL_LENGTH 64 obj->data.s = static_cast(malloc(MAX_FINYAH_URL_LENGTH)); snprintf(obj->data.s, MAX_FINYAH_URL_LENGTH, "http://download.finance.yahoo.com/d/quotes.csv?s=%s&f=%s", stock, data); } #endif /* BUILD_CURL */ legacy_cb_handle *create_cb_handle(int (*fn)()) { if (fn != nullptr) { return new legacy_cb_handle(conky::register_cb(1, fn)); } { return nullptr; } } /* construct_text_object() creates a new text_object */ struct text_object *construct_text_object(char *s, const char *arg, long line, void **ifblock_opaque, void *free_at_crash) { // struct text_object *obj = new_text_object(); struct text_object *obj = new_text_object_internal(); obj->line = line; /* helper defines for internal use only */ #define __OBJ_HEAD(a, n) \ if (!strcmp(s, #a)) { \ obj->cb_handle = create_cb_handle(n); #define __OBJ_IF obj_be_ifblock_if(ifblock_opaque, obj) #define __OBJ_ARG(...) \ if (!arg) { \ free(s); \ CRIT_ERR(obj, free_at_crash, __VA_ARGS__); \ } /* defines to be used below */ #define OBJ(a, n) __OBJ_HEAD(a, n) { #define OBJ_ARG(a, n, ...) __OBJ_HEAD(a, n) __OBJ_ARG(__VA_ARGS__) { #define OBJ_IF(a, n) \ __OBJ_HEAD(a, n) __OBJ_IF; \ { #define OBJ_IF_ARG(a, n, ...) \ __OBJ_HEAD(a, n) __OBJ_ARG(__VA_ARGS__) __OBJ_IF; \ { #define END \ } \ } \ else #ifdef BUILD_X11 if (s[0] == '#') { obj->data.l = get_x11_color(s); obj->callbacks.print = &new_fg; } else #endif /* BUILD_X11 */ #ifndef __OpenBSD__ OBJ(acpitemp, nullptr) obj->data.i = open_acpi_temperature(arg); obj->callbacks.print = &print_acpitemp; obj->callbacks.free = &free_acpitemp; END OBJ(acpiacadapter, nullptr) if (arg != nullptr) { #ifdef __linux__ if (strpbrk(arg, "/.") != nullptr) { /* * a bit of paranoia. screen out funky paths * i hope no device will have a '.' in its name */ NORM_ERR("acpiacadapter: arg must not contain '/' or '.'"); } else obj->data.opaque = strdup(arg); #else NORM_ERR("acpiacadapter: arg is only used on linux"); #endif } obj->callbacks.print = &print_acpiacadapter; obj->callbacks.free = &gen_free_opaque; #endif /* !__OpenBSD__ */ END OBJ(freq, nullptr) get_cpu_count(); if ((arg == nullptr) || (isdigit(static_cast(arg[0])) == 0) || strlen(arg) >= 3 || atoi(&arg[0]) == 0 || static_cast(atoi(&arg[0])) > info.cpu_count) { obj->data.i = 1; /* NORM_ERR("freq: Invalid CPU number or you don't have that many CPUs! " "Displaying the clock for CPU 1."); */ } else { obj->data.i = atoi(&arg[0]); } obj->callbacks.print = &print_freq; END OBJ(freq_g, nullptr) get_cpu_count(); if ((arg == nullptr) || (isdigit(static_cast(arg[0])) == 0) || strlen(arg) >= 3 || atoi(&arg[0]) == 0 || static_cast(atoi(&arg[0])) > info.cpu_count) { obj->data.i = 1; /* NORM_ERR("freq_g: Invalid CPU number or you don't have that many " "CPUs! Displaying the clock for CPU 1."); */ } else { obj->data.i = atoi(&arg[0]); } obj->callbacks.print = &print_freq_g; END OBJ_ARG(read_tcp, nullptr, "read_tcp: Needs \"(host) port\" as argument(s)") parse_read_tcpip_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_read_tcp; obj->callbacks.free = &free_read_tcpip; END OBJ_ARG(read_udp, nullptr, "read_udp: Needs \"(host) port\" as argument(s)") parse_read_tcpip_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_read_udp; obj->callbacks.free = &free_read_tcpip; END OBJ_ARG(tcp_ping, nullptr, "tcp_ping: Needs \"host (port)\" as argument(s)") parse_tcp_ping_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_tcp_ping; obj->callbacks.free = &free_tcp_ping; #if defined(__linux__) END OBJ(voltage_mv, 0) get_cpu_count(); if (!arg || !isdigit((unsigned char)arg[0]) || strlen(arg) >= 3 || atoi(&arg[0]) == 0 || (unsigned int)atoi(&arg[0]) > info.cpu_count) { obj->data.i = 1; /* NORM_ERR("voltage_mv: Invalid CPU number or you don't have that many " "CPUs! Displaying voltage for CPU 1."); */ } else { obj->data.i = atoi(&arg[0]); } obj->callbacks.print = &print_voltage_mv; END OBJ(voltage_v, 0) get_cpu_count(); if (!arg || !isdigit((unsigned char)arg[0]) || strlen(arg) >= 3 || atoi(&arg[0]) == 0 || (unsigned int)atoi(&arg[0]) > info.cpu_count) { obj->data.i = 1; /* NORM_ERR("voltage_v: Invalid CPU number or you don't have that many " "CPUs! Displaying voltage for CPU 1."); */ } else { obj->data.i = atoi(&arg[0]); } obj->callbacks.print = &print_voltage_v; #endif /* __linux__ */ #ifdef BUILD_WLAN END OBJ(wireless_essid, &update_net_stats) obj->data.opaque = get_net_stat(arg, obj, free_at_crash); parse_net_stat_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_wireless_essid; END OBJ(wireless_channel, &update_net_stats) parse_net_stat_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_wireless_channel; END OBJ(wireless_freq, &update_net_stats) parse_net_stat_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_wireless_frequency; END OBJ(wireless_mode, &update_net_stats) parse_net_stat_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_wireless_mode; END OBJ(wireless_bitrate, &update_net_stats) parse_net_stat_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_wireless_bitrate; END OBJ(wireless_ap, &update_net_stats) parse_net_stat_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_wireless_ap; END OBJ(wireless_link_qual, &update_net_stats) parse_net_stat_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_wireless_link_qual; END OBJ(wireless_link_qual_max, &update_net_stats) parse_net_stat_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_wireless_link_qual_max; END OBJ(wireless_link_qual_perc, &update_net_stats) parse_net_stat_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_wireless_link_qual_perc; END OBJ(wireless_link_bar, &update_net_stats) parse_net_stat_bar_arg(obj, arg, free_at_crash); obj->callbacks.barval = &wireless_link_barval; #endif /* BUILD_WLAN */ #ifndef __OpenBSD__ END OBJ(acpifan, nullptr) obj->callbacks.print = &print_acpifan; END OBJ(battery, nullptr) char bat[64]; if (arg != nullptr) { sscanf(arg, "%63s", bat); } else { strncpy(bat, "BAT0", 5); } obj->data.s = strndup(bat, text_buffer_size.get(*state)); obj->callbacks.print = &print_battery; obj->callbacks.free = &gen_free_opaque; END OBJ(battery_short, nullptr) char bat[64]; if (arg != nullptr) { sscanf(arg, "%63s", bat); } else { strncpy(bat, "BAT0", 5); } obj->data.s = strndup(bat, text_buffer_size.get(*state)); obj->callbacks.print = &print_battery_short; obj->callbacks.free = &gen_free_opaque; END OBJ(battery_status, 0) obj->data.s = strndup(arg ? arg : "BAT0", text_buffer_size.get(*state)); obj->callbacks.print = &print_battery_status; obj->callbacks.free = &gen_free_opaque; END OBJ(battery_time, nullptr) char bat[64]; if (arg != nullptr) { sscanf(arg, "%63s", bat); } else { strncpy(bat, "BAT0", 5); } obj->data.s = strndup(bat, text_buffer_size.get(*state)); obj->callbacks.print = &print_battery_time; obj->callbacks.free = &gen_free_opaque; END OBJ(battery_percent, nullptr) char bat[64]; if (arg != nullptr) { sscanf(arg, "%63s", bat); } else { strncpy(bat, "BAT0", 5); } obj->data.s = strndup(bat, text_buffer_size.get(*state)); obj->callbacks.percentage = &battery_percentage; obj->callbacks.free = &gen_free_opaque; END OBJ(battery_bar, nullptr) char bat[64]; arg = scan_bar(obj, arg, 100); if ((arg != nullptr) && strlen(arg) > 0) { sscanf(arg, "%63s", bat); } else { strncpy(bat, "BAT0", 5); } obj->data.s = strndup(bat, text_buffer_size.get(*state)); obj->callbacks.barval = &get_battery_perct_bar; obj->callbacks.free = &gen_free_opaque; #endif /* !__OpenBSD__ */ #if defined(__linux__) END OBJ_ARG(disk_protect, 0, "disk_protect needs an argument") obj->data.s = strndup(dev_name(arg), text_buffer_size.get(*state)); obj->callbacks.print = &print_disk_protect_queue; obj->callbacks.free = &gen_free_opaque; END OBJ(i8k_version, &update_i8k) obj->callbacks.print = &print_i8k_version; END OBJ(i8k_bios, &update_i8k) obj->callbacks.print = &print_i8k_bios; END OBJ(i8k_serial, &update_i8k) obj->callbacks.print = &print_i8k_serial; END OBJ(i8k_cpu_temp, &update_i8k) obj->callbacks.print = &print_i8k_cpu_temp; END OBJ(i8k_left_fan_status, &update_i8k) obj->callbacks.print = &print_i8k_left_fan_status; END OBJ(i8k_right_fan_status, &update_i8k) obj->callbacks.print = &print_i8k_right_fan_status; END OBJ(i8k_left_fan_rpm, &update_i8k) obj->callbacks.print = &print_i8k_left_fan_rpm; END OBJ(i8k_right_fan_rpm, &update_i8k) obj->callbacks.print = &print_i8k_right_fan_rpm; END OBJ(i8k_ac_status, &update_i8k) obj->callbacks.print = &print_i8k_ac_status; END OBJ(i8k_buttons_status, &update_i8k) obj->callbacks.print = &print_i8k_buttons_status; #if defined(BUILD_IBM) END OBJ(ibm_fan, 0) obj->callbacks.print = &get_ibm_acpi_fan; END OBJ_ARG(ibm_temps, &get_ibm_acpi_temps, "ibm_temps: needs an argument") parse_ibm_temps_arg(obj, arg); obj->callbacks.print = &print_ibm_temps; END OBJ(ibm_volume, 0) obj->callbacks.print = &get_ibm_acpi_volume; END OBJ(ibm_brightness, 0) obj->callbacks.print = &get_ibm_acpi_brightness; END OBJ(ibm_thinklight, 0) obj->callbacks.print = &get_ibm_acpi_thinklight; #endif /* information from sony_laptop kernel module * /sys/devices/platform/sony-laptop */ END OBJ(sony_fanspeed, 0) obj->callbacks.print = &get_sony_fanspeed; END OBJ_ARG(ioscheduler, 0, "get_ioscheduler needs an argument (e.g. hda)") obj->data.s = strndup(dev_name(arg), text_buffer_size.get(*state)); obj->callbacks.print = &print_ioscheduler; obj->callbacks.free = &gen_free_opaque; END OBJ(laptop_mode, 0) obj->callbacks.print = &print_laptop_mode; END OBJ_ARG( pb_battery, 0, "pb_battery: needs one argument: status, percent or time") if (strcmp(arg, "st" "at" "u" "s") == EQUAL) { obj->data.i = PB_BATT_STATUS; } else if (strcmp(arg, "percent") == EQUAL) { obj->data.i = PB_BATT_PERCENT; } else if (strcmp(arg, "time") == EQUAL) { obj->data.i = PB_BATT_TIME; } else { NORM_ERR("pb_battery: illegal argument '%s', defaulting to status", arg); obj->data.i = PB_BATT_STATUS; } obj->callbacks.print = get_powerbook_batt_info; #endif /* __linux__ */ #if (defined(__FreeBSD__) || defined(__linux__) || defined(__DragonFly__) || \ (defined(__APPLE__) && defined(__MACH__))) END OBJ_IF_ARG(if_up, nullptr, "if_up needs an argument") parse_if_up_arg(obj, arg); obj->callbacks.iftest = &interface_up; obj->callbacks.free = &free_if_up; #endif #if defined(__OpenBSD__) END OBJ_ARG(obsd_sensors_temp, 0, "obsd_sensors_temp: needs an argument") parse_obsd_sensor(obj, arg); obj->callbacks.print = &print_obsd_sensors_temp; END OBJ_ARG(obsd_sensors_fan, 0, "obsd_sensors_fan: needs 2 arguments (device and sensor number)") parse_obsd_sensor(obj, arg); obj->callbacks.print = &print_obsd_sensors_fan; END OBJ_ARG(obsd_sensors_volt, 0, "obsd_sensors_volt: needs 2 arguments (device and sensor number)") parse_obsd_sensor(obj, arg); obj->callbacks.print = &print_obsd_sensors_volt; END OBJ(obsd_vendor, 0) obj->callbacks.print = &get_obsd_vendor; END OBJ(obsd_product, 0) obj->callbacks.print = &get_obsd_product; #endif /* __OpenBSD__ */ END OBJ(buffers, &update_meminfo) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_buffers; obj->callbacks.free = &gen_free_opaque; END OBJ(cached, &update_meminfo) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_cached; obj->callbacks.free = &gen_free_opaque; #define SCAN_CPU(__arg, __var) \ { \ int __offset = 0; \ if ((__arg) && sscanf(__arg, " cpu%d %n", &(__var), &__offset) > 0) \ (__arg) += __offset; \ else \ (__var) = 0; \ } END OBJ(cpu, &update_cpu_usage) get_cpu_count(); SCAN_CPU(arg, obj->data.i); obj->callbacks.percentage = &cpu_percentage; obj->callbacks.free = &free_cpu; DBGP2("Adding $cpu for CPU %d", obj->data.i); #ifdef BUILD_X11 END OBJ(cpugauge, &update_cpu_usage) get_cpu_count(); SCAN_CPU(arg, obj->data.i); scan_gauge(obj, arg, 1); obj->callbacks.gaugeval = &cpu_barval; obj->callbacks.free = &free_cpu; DBGP2("Adding $cpugauge for CPU %d", obj->data.i); #endif END OBJ(cpubar, &update_cpu_usage) get_cpu_count(); SCAN_CPU(arg, obj->data.i); scan_bar(obj, arg, 1); obj->callbacks.barval = &cpu_barval; obj->callbacks.free = &free_cpu; DBGP2("Adding $cpubar for CPU %d", obj->data.i); #ifdef BUILD_X11 END OBJ(cpugraph, &update_cpu_usage) get_cpu_count(); char *buf = nullptr; SCAN_CPU(arg, obj->data.i); buf = scan_graph(obj, arg, 1); DBGP2("Adding $cpugraph for CPU %d", obj->data.i); free_and_zero(buf); obj->callbacks.graphval = &cpu_barval; obj->callbacks.free = &free_cpu; END OBJ(loadgraph, &update_load_average) scan_loadgraph_arg(obj, arg); obj->callbacks.graphval = &loadgraphval; #endif /* BUILD_X11 */ END OBJ(diskio, &update_diskio) parse_diskio_arg(obj, arg); obj->callbacks.print = &print_diskio; END OBJ(diskio_read, &update_diskio) parse_diskio_arg(obj, arg); obj->callbacks.print = &print_diskio_read; END OBJ(diskio_write, &update_diskio) parse_diskio_arg(obj, arg); obj->callbacks.print = &print_diskio_write; #ifdef BUILD_X11 END OBJ(diskiograph, &update_diskio) parse_diskiograph_arg(obj, arg); obj->callbacks.graphval = &diskiographval; END OBJ(diskiograph_read, &update_diskio) parse_diskiograph_arg(obj, arg); obj->callbacks.graphval = &diskiographval_read; END OBJ(diskiograph_write, &update_diskio) parse_diskiograph_arg(obj, arg); obj->callbacks.graphval = &diskiographval_write; #endif /* BUILD_X11 */ END OBJ(color, nullptr) #ifdef BUILD_X11 if (out_to_x.get(*state)) { obj->data.l = arg != nullptr ? get_x11_color(arg) : default_color.get(*state); set_current_text_color(obj->data.l); } #endif /* BUILD_X11 */ #ifdef BUILD_NCURSES if (out_to_ncurses.get(*state)) { obj->data.l = COLOR_WHITE; if (arg != nullptr) { if (strcasecmp(arg, "red") == 0) { obj->data.l = COLOR_RED; } else if (strcasecmp(arg, "green") == 0) { obj->data.l = COLOR_GREEN; } else if (strcasecmp(arg, "yellow") == 0) { obj->data.l = COLOR_YELLOW; } else if (strcasecmp(arg, "blue") == 0) { obj->data.l = COLOR_BLUE; } else if (strcasecmp(arg, "magenta") == 0) { obj->data.l = COLOR_MAGENTA; } else if (strcasecmp(arg, "cyan") == 0) { obj->data.l = COLOR_CYAN; } else if (strcasecmp(arg, "black") == 0) { obj->data.l = COLOR_BLACK; } } set_current_text_color(obj->data.l); init_pair(obj->data.l, obj->data.l, COLOR_BLACK); } #endif /* BUILD_NCURSES */ obj->callbacks.print = &new_fg; #ifdef BUILD_X11 END OBJ(color0, nullptr) obj->data.l = color[0].get(*state); set_current_text_color(obj->data.l); obj->callbacks.print = &new_fg; END OBJ(color1, nullptr) obj->data.l = color[1].get(*state); set_current_text_color(obj->data.l); obj->callbacks.print = &new_fg; END OBJ(color2, nullptr) obj->data.l = color[2].get(*state); set_current_text_color(obj->data.l); obj->callbacks.print = &new_fg; END OBJ(color3, nullptr) obj->data.l = color[3].get(*state); set_current_text_color(obj->data.l); obj->callbacks.print = &new_fg; END OBJ(color4, nullptr) obj->data.l = color[4].get(*state); set_current_text_color(obj->data.l); obj->callbacks.print = &new_fg; END OBJ(color5, nullptr) obj->data.l = color[5].get(*state); set_current_text_color(obj->data.l); obj->callbacks.print = &new_fg; END OBJ(color6, nullptr) obj->data.l = color[6].get(*state); set_current_text_color(obj->data.l); obj->callbacks.print = &new_fg; END OBJ(color7, nullptr) obj->data.l = color[7].get(*state); set_current_text_color(obj->data.l); obj->callbacks.print = &new_fg; END OBJ(color8, nullptr) obj->data.l = color[8].get(*state); set_current_text_color(obj->data.l); obj->callbacks.print = &new_fg; END OBJ(color9, nullptr) obj->data.l = color[9].get(*state); set_current_text_color(obj->data.l); obj->callbacks.print = &new_fg; END OBJ(font, nullptr) scan_font(obj, arg); obj->callbacks.print = &new_font; obj->callbacks.free = &gen_free_opaque; END OBJ(font0, nullptr) scan_font(obj, font_template[0].get(*state).c_str()); obj->callbacks.print = &new_font; obj->callbacks.free = &gen_free_opaque; END OBJ(font1, nullptr) scan_font(obj, font_template[1].get(*state).c_str()); obj->callbacks.print = &new_font; obj->callbacks.free = &gen_free_opaque; END OBJ(font2, nullptr) scan_font(obj, font_template[2].get(*state).c_str()); obj->callbacks.print = &new_font; obj->callbacks.free = &gen_free_opaque; END OBJ(font3, nullptr) scan_font(obj, font_template[3].get(*state).c_str()); obj->callbacks.print = &new_font; obj->callbacks.free = &gen_free_opaque; END OBJ(font4, nullptr) scan_font(obj, font_template[4].get(*state).c_str()); obj->callbacks.print = &new_font; obj->callbacks.free = &gen_free_opaque; END OBJ(font5, nullptr) scan_font(obj, font_template[5].get(*state).c_str()); obj->callbacks.print = &new_font; obj->callbacks.free = &gen_free_opaque; END OBJ(font6, nullptr) scan_font(obj, font_template[6].get(*state).c_str()); obj->callbacks.print = &new_font; obj->callbacks.free = &gen_free_opaque; END OBJ(font7, nullptr) scan_font(obj, font_template[7].get(*state).c_str()); obj->callbacks.print = &new_font; obj->callbacks.free = &gen_free_opaque; END OBJ(font8, nullptr) scan_font(obj, font_template[8].get(*state).c_str()); obj->callbacks.print = &new_font; obj->callbacks.free = &gen_free_opaque; END OBJ(font9, nullptr) scan_font(obj, font_template[9].get(*state).c_str()); obj->callbacks.print = &new_font; obj->callbacks.free = &gen_free_opaque; #endif /* BUILD_X11 */ END OBJ(conky_version, nullptr) obj_be_plain_text(obj, VERSION); END OBJ(conky_build_date, nullptr) obj_be_plain_text(obj, BUILD_DATE); END OBJ(conky_build_arch, nullptr) obj_be_plain_text(obj, BUILD_ARCH); END OBJ(downspeed, &update_net_stats) parse_net_stat_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_downspeed; END OBJ(downspeedf, &update_net_stats) parse_net_stat_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_downspeedf; #ifdef BUILD_X11 END OBJ(downspeedgraph, &update_net_stats) parse_net_stat_graph_arg(obj, arg, free_at_crash); obj->callbacks.graphval = &downspeedgraphval; #endif /* BUILD_X11 */ END OBJ(else, nullptr) obj_be_ifblock_else(ifblock_opaque, obj); obj->callbacks.iftest = &gen_false_iftest; END OBJ(endif, nullptr) obj_be_ifblock_endif(ifblock_opaque, obj); obj->callbacks.print = &gen_print_nothing; END OBJ(eval, nullptr) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_evaluate; obj->callbacks.free = &gen_free_opaque; #if defined(BUILD_IMLIB2) && defined(BUILD_X11) END OBJ(image, nullptr) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_image_callback; obj->callbacks.free = &gen_free_opaque; #endif /* BUILD_IMLIB2 */ #ifdef BUILD_MYSQL END OBJ_ARG(mysql, 0, "mysql needs a query") obj->data.s = strdup(arg); obj->callbacks.print = &print_mysql; #endif /* BUILD_MYSQL */ END OBJ_ARG(no_update, nullptr, "no_update needs arguments") scan_no_update(obj, arg); obj->callbacks.print = &print_no_update; obj->callbacks.free = &free_no_update; END OBJ(cat, 0) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_cat; obj->callbacks.free = &gen_free_opaque; #ifdef BUILD_X11 END OBJ(key_num_lock, 0) obj->callbacks.print = &print_key_num_lock; END OBJ(key_caps_lock, 0) obj->callbacks.print = &print_key_caps_lock; END OBJ(key_scroll_lock, 0) obj->callbacks.print = &print_key_scroll_lock; END OBJ(keyboard_layout, 0) obj->callbacks.print = &print_keyboard_layout; END OBJ(mouse_speed, 0) obj->callbacks.print = &print_mouse_speed; #endif /* BUILD_X11 */ #ifdef __FreeBSD__ END OBJ(sysctlbyname, 0) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_sysctlbyname; obj->callbacks.free = &gen_free_opaque; #endif /* __FreeBSD__ */ END OBJ(password, 0) obj->data.s = strndup(arg ? arg : "20", text_buffer_size.get(*state)); obj->callbacks.print = &print_password; obj->callbacks.free = &gen_free_opaque; #ifdef __x86_64__ END OBJ(freq2, 0) obj->callbacks.print = &print_freq2; #endif /* __x86_64__ */ END OBJ(startcase, 0) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_startcase; obj->callbacks.free = &gen_free_opaque; // Deprecated, for compatibility purposes only END OBJ(start_case, 0) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_startcase; obj->callbacks.free = &gen_free_opaque; END OBJ(lowercase, 0) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_lowercase; obj->callbacks.free = &gen_free_opaque; END OBJ(uppercase, 0) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_uppercase; obj->callbacks.free = &gen_free_opaque; END OBJ(rstrip, 0) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &strip_trailing_whitespace; obj->callbacks.free = &gen_free_opaque; END OBJ(catp, 0) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_catp; obj->callbacks.free = &gen_free_opaque; END OBJ_ARG(exec, nullptr, "exec needs arguments: ") scan_exec_arg(obj, arg, EF_EXEC); obj->parse = false; obj->thread = false; register_exec(obj); obj->callbacks.print = &print_exec; obj->callbacks.free = &free_exec; END OBJ_ARG(execi, nullptr, "execi needs arguments: ") scan_exec_arg(obj, arg, EF_EXECI); obj->parse = false; obj->thread = false; register_execi(obj); obj->callbacks.print = &print_exec; obj->callbacks.free = &free_execi; END OBJ_ARG(execp, nullptr, "execp needs arguments: ") scan_exec_arg(obj, arg, EF_EXEC); obj->parse = true; obj->thread = false; register_exec(obj); obj->callbacks.print = &print_exec; obj->callbacks.free = &free_exec; END OBJ_ARG(execpi, nullptr, "execpi needs arguments: ") scan_exec_arg(obj, arg, EF_EXECI); obj->parse = true; obj->thread = false; register_execi(obj); obj->callbacks.print = &print_exec; obj->callbacks.free = &free_execi; END OBJ_ARG(execbar, nullptr, "execbar needs arguments: [height],[width] ") scan_exec_arg(obj, arg, EF_EXEC | EF_BAR); register_exec(obj); obj->callbacks.barval = &execbarval; obj->callbacks.free = &free_exec; END OBJ_ARG(execibar, nullptr, "execibar needs arguments: [height],[width] ") scan_exec_arg(obj, arg, EF_EXECI | EF_BAR); register_execi(obj); obj->callbacks.barval = &execbarval; obj->callbacks.free = &free_execi; #ifdef BUILD_X11 END OBJ_ARG(execgauge, nullptr, "execgauge needs arguments: [height],[width] ") scan_exec_arg(obj, arg, EF_EXEC | EF_GAUGE); register_exec(obj); obj->callbacks.gaugeval = &execbarval; obj->callbacks.free = &free_exec; END OBJ_ARG( execigauge, nullptr, "execigauge needs arguments: [height],[width] ") scan_exec_arg(obj, arg, EF_EXECI | EF_GAUGE); register_execi(obj); obj->callbacks.gaugeval = &execbarval; obj->callbacks.free = &free_execi; END OBJ_ARG(execgraph, nullptr, "execgraph needs arguments: [height],[width] [color1] " "[color2] [scale] [-t|-l]") scan_exec_arg(obj, arg, EF_EXEC | EF_GRAPH); register_exec(obj); obj->callbacks.graphval = &execbarval; obj->callbacks.free = &free_exec; END OBJ_ARG(execigraph, nullptr, "execigraph needs arguments: " "[height],[width] [color1] [color2] [scale] [-t|-l]") scan_exec_arg(obj, arg, EF_EXECI | EF_GRAPH); register_execi(obj); obj->callbacks.graphval = &execbarval; obj->callbacks.free = &free_execi; #endif /* BUILD_X11 */ END OBJ_ARG(texeci, nullptr, "texeci needs arguments: ") scan_exec_arg(obj, arg, EF_EXECI); obj->parse = false; obj->thread = true; register_execi(obj); obj->callbacks.print = &print_exec; obj->callbacks.free = &free_execi; END OBJ_ARG(texecpi, nullptr, "texecpi needs arguments: ") scan_exec_arg(obj, arg, EF_EXECI); obj->parse = true; obj->thread = true; register_execi(obj); obj->callbacks.print = &print_exec; obj->callbacks.free = &free_execi; END OBJ(fs_bar, &update_fs_stats) init_fs_bar(obj, arg); obj->callbacks.barval = &fs_barval; END OBJ(fs_bar_free, &update_fs_stats) init_fs_bar(obj, arg); obj->callbacks.barval = &fs_free_barval; END OBJ(fs_free, &update_fs_stats) init_fs(obj, arg); obj->callbacks.print = &print_fs_free; END OBJ(fs_used_perc, &update_fs_stats) init_fs(obj, arg); obj->callbacks.percentage = &fs_used_percentage; END OBJ(fs_free_perc, &update_fs_stats) init_fs(obj, arg); obj->callbacks.percentage = &fs_free_percentage; END OBJ(fs_size, &update_fs_stats) init_fs(obj, arg); obj->callbacks.print = &print_fs_size; END OBJ(fs_type, &update_fs_stats) init_fs(obj, arg); obj->callbacks.print = &print_fs_type; END OBJ(fs_used, &update_fs_stats) init_fs(obj, arg); obj->callbacks.print = &print_fs_used; #ifdef BUILD_X11 END OBJ(hr, nullptr) obj->data.l = arg != nullptr ? atoi(arg) : 1; obj->callbacks.print = &new_hr; #endif /* BUILD_X11 */ END OBJ(nameserver, &update_dns_data) parse_nameserver_arg(obj, arg); obj->callbacks.print = &print_nameserver; obj->callbacks.free = &free_dns_data; END OBJ(offset, nullptr) obj->data.l = arg != nullptr ? atoi(arg) : 1; obj->callbacks.print = &new_offset; END OBJ(voffset, nullptr) obj->data.l = arg != nullptr ? atoi(arg) : 1; obj->callbacks.print = &new_voffset; END OBJ(save_coordinates, nullptr) obj->data.l = arg != nullptr ? atoi(arg) : 0; obj->callbacks.print = &new_save_coordinates; END OBJ_ARG(goto, nullptr, "goto needs arguments") obj->data.l = atoi(arg); obj->callbacks.print = &new_goto; #ifdef BUILD_X11 END OBJ(tab, nullptr) scan_tab(obj, arg); obj->callbacks.print = &new_tab; #endif /* BUILD_X11 */ #ifdef __linux__ END OBJ_ARG(i2c, 0, "i2c needs arguments") parse_i2c_sensor(obj, arg); obj->callbacks.print = &print_sysfs_sensor; obj->callbacks.free = &free_sysfs_sensor; END OBJ_ARG(platform, 0, "platform needs arguments") parse_platform_sensor(obj, arg); obj->callbacks.print = &print_sysfs_sensor; obj->callbacks.free = &free_sysfs_sensor; END OBJ_ARG(hwmon, 0, "hwmon needs argumanets") parse_hwmon_sensor(obj, arg); obj->callbacks.print = &print_sysfs_sensor; obj->callbacks.free = &free_sysfs_sensor; #endif /* __linux__ */ END /* we have four different types of top (top, top_mem, top_time and * top_io). To avoid having almost-same code four times, we have this * special handler. */ /* XXX: maybe fiddle them apart later, as print_top() does * nothing else than just that, using an ugly switch(). */ if (strncmp(s, "top", 3) == EQUAL) { if (parse_top_args(s, arg, obj) != 0) { #ifdef __linux__ determine_longstat_file(); #endif obj->cb_handle = create_cb_handle(update_top); } else { free(obj); return nullptr; } } else OBJ(addr, &update_net_stats) parse_net_stat_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_addr; END #ifdef __linux__ OBJ(addrs, &update_net_stats) parse_net_stat_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_addrs; #ifdef BUILD_IPV6 END OBJ(v6addrs, &update_net_stats) parse_net_stat_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_v6addrs; #endif /* BUILD_IPV6 */ END #endif /* __linux__ */ OBJ_ARG(tail, nullptr, "tail needs arguments") init_tailhead("tail", arg, obj, free_at_crash); obj->callbacks.print = &print_tail; obj->callbacks.free = &free_tailhead; END OBJ_ARG(head, nullptr, "head needs arguments") init_tailhead("head", arg, obj, free_at_crash); obj->callbacks.print = &print_head; obj->callbacks.free = &free_tailhead; END OBJ_ARG(lines, nullptr, "lines needs an argument") obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_lines; obj->callbacks.free = &gen_free_opaque; END OBJ_ARG(words, nullptr, "words needs a argument") obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_words; obj->callbacks.free = &gen_free_opaque; END OBJ(loadavg, &update_load_average) scan_loadavg_arg(obj, arg); obj->callbacks.print = &print_loadavg; END OBJ_IF_ARG(if_empty, nullptr, "if_empty needs an argument") obj->sub = static_cast(malloc(sizeof(struct text_object))); extract_variable_text_internal(obj->sub, arg); obj->callbacks.iftest = &if_empty_iftest; END OBJ_IF_ARG(if_match, nullptr, "if_match needs arguments") obj->sub = static_cast(malloc(sizeof(struct text_object))); extract_variable_text_internal(obj->sub, arg); obj->callbacks.iftest = &check_if_match; END OBJ_IF_ARG(if_existing, nullptr, "if_existing needs an argument or two") obj->data.s = STRNDUP_ARG; obj->callbacks.iftest = &if_existing_iftest; obj->callbacks.free = &gen_free_opaque; #if defined(__linux__) || defined(__FreeBSD__) END OBJ_IF_ARG(if_mounted, 0, "if_mounted needs an argument") obj->data.s = STRNDUP_ARG; obj->callbacks.iftest = &check_mount; obj->callbacks.free = &gen_free_opaque; END OBJ_IF_ARG(if_running, &update_top, "if_running needs an argument") top_running = 1; obj->data.s = STRNDUP_ARG; obj->callbacks.iftest = &if_running_iftest; obj->callbacks.free = &gen_free_opaque; #elif defined(__APPLE__) && defined(__MACH__) END OBJ_IF_ARG(if_mounted, nullptr, "if_mounted needs an argument") obj->data.s = STRNDUP_ARG; obj->callbacks.iftest = &check_mount; obj->callbacks.free = &gen_free_opaque; /* System Integrity Protection */ END OBJ(sip_status, &get_sip_status) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_sip_status; obj->callbacks.free = &gen_free_opaque; #else END OBJ_IF_ARG(if_running, 0, "if_running needs an argument") char buf[DEFAULT_TEXT_BUFFER_SIZE]; snprintf(buf, DEFAULT_TEXT_BUFFER_SIZE, "pidof %s >/dev/null", arg); obj->data.s = STRNDUP_ARG; /* XXX: maybe use a different callback here */ obj->callbacks.iftest = &if_running_iftest; #endif END OBJ(kernel, nullptr) obj->callbacks.print = &print_kernel; END OBJ(machine, nullptr) obj->callbacks.print = &print_machine; #if defined(__DragonFly__) END OBJ(version, 0) obj->callbacks.print = &print_version; #endif END OBJ(mails, nullptr) parse_local_mail_args(obj, arg); obj->callbacks.print = &print_mails; obj->callbacks.free = &free_local_mails; END OBJ(new_mails, nullptr) parse_local_mail_args(obj, arg); obj->callbacks.print = &print_new_mails; obj->callbacks.free = &free_local_mails; END OBJ(seen_mails, nullptr) parse_local_mail_args(obj, arg); obj->callbacks.print = &print_seen_mails; obj->callbacks.free = &free_local_mails; END OBJ(unseen_mails, nullptr) parse_local_mail_args(obj, arg); obj->callbacks.print = &print_unseen_mails; obj->callbacks.free = &free_local_mails; END OBJ(flagged_mails, nullptr) parse_local_mail_args(obj, arg); obj->callbacks.print = &print_flagged_mails; obj->callbacks.free = &free_local_mails; END OBJ(unflagged_mails, nullptr) parse_local_mail_args(obj, arg); obj->callbacks.print = &print_unflagged_mails; obj->callbacks.free = &free_local_mails; END OBJ(forwarded_mails, nullptr) parse_local_mail_args(obj, arg); obj->callbacks.print = &print_forwarded_mails; obj->callbacks.free = &free_local_mails; END OBJ(unforwarded_mails, nullptr) parse_local_mail_args(obj, arg); obj->callbacks.print = &print_unforwarded_mails; obj->callbacks.free = &free_local_mails; END OBJ(replied_mails, nullptr) parse_local_mail_args(obj, arg); obj->callbacks.print = &print_replied_mails; obj->callbacks.free = &free_local_mails; END OBJ(unreplied_mails, nullptr) parse_local_mail_args(obj, arg); obj->callbacks.print = &print_unreplied_mails; obj->callbacks.free = &free_local_mails; END OBJ(draft_mails, nullptr) parse_local_mail_args(obj, arg); obj->callbacks.print = &print_draft_mails; obj->callbacks.free = &free_local_mails; END OBJ(trashed_mails, nullptr) parse_local_mail_args(obj, arg); obj->callbacks.print = &print_trashed_mails; obj->callbacks.free = &free_local_mails; END OBJ(mboxscan, nullptr) parse_mboxscan_arg(obj, arg); obj->callbacks.print = &print_mboxscan; obj->callbacks.free = &free_mboxscan; END OBJ(mem, &update_meminfo) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_mem; obj->callbacks.free = &gen_free_opaque; END OBJ(legacymem, &update_meminfo) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_legacymem; obj->callbacks.free = &gen_free_opaque; END OBJ(memwithbuffers, &update_meminfo) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_memwithbuffers; obj->callbacks.free = &gen_free_opaque; END OBJ(memeasyfree, &update_meminfo) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_memeasyfree; obj->callbacks.free = &gen_free_opaque; END OBJ(memfree, &update_meminfo) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_memfree; obj->callbacks.free = &gen_free_opaque; END OBJ(memmax, &update_meminfo) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_memmax; obj->callbacks.free = &gen_free_opaque; END OBJ(memperc, &update_meminfo) obj->callbacks.percentage = &mem_percentage; #ifdef __linux__ END OBJ(memdirty, &update_meminfo) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_memdirty; obj->callbacks.free = &gen_free_opaque; #endif /* __linux__ */ #ifdef BUILD_X11 END OBJ(memgauge, &update_meminfo) scan_gauge(obj, arg, 1); obj->callbacks.gaugeval = &mem_barval; #endif /* BUILD_X11 */ END OBJ(membar, &update_meminfo) scan_bar(obj, arg, 1); obj->callbacks.barval = &mem_barval; END OBJ(memwithbuffersbar, &update_meminfo) scan_bar(obj, arg, 1); obj->callbacks.barval = &mem_with_buffers_barval; #ifdef BUILD_X11 END OBJ(memgraph, &update_meminfo) char *buf = nullptr; buf = scan_graph(obj, arg, 1); free_and_zero(buf); obj->callbacks.graphval = &mem_barval; END OBJ(memwithbuffersgraph, &update_meminfo) char *buf = nullptr; buf = scan_graph(obj, arg, 1); free_and_zero(buf); obj->callbacks.graphval = &mem_with_buffers_barval; #endif /* BUILD_X11*/ #ifdef HAVE_SOME_SOUNDCARD_H END OBJ(mixer, 0) parse_mixer_arg(obj, arg); obj->callbacks.percentage = &mixer_percentage; END OBJ(mixerl, 0) parse_mixer_arg(obj, arg); obj->callbacks.percentage = &mixerl_percentage; END OBJ(mixerr, 0) parse_mixer_arg(obj, arg); obj->callbacks.percentage = &mixerr_percentage; END OBJ(mixerbar, 0) scan_mixer_bar(obj, arg); obj->callbacks.barval = &mixer_barval; END OBJ(mixerlbar, 0) scan_mixer_bar(obj, arg); obj->callbacks.barval = &mixerl_barval; END OBJ(mixerrbar, 0) scan_mixer_bar(obj, arg); obj->callbacks.barval = &mixerr_barval; END OBJ_IF(if_mixer_mute, 0) parse_mixer_arg(obj, arg); obj->callbacks.iftest = &check_mixer_muted; #endif /* HAVE_SOME_SOUNDCARD_H */ #ifdef BUILD_X11 END OBJ(monitor, nullptr) obj->callbacks.print = &print_monitor; END OBJ(monitor_number, nullptr) obj->callbacks.print = &print_monitor_number; END OBJ(desktop, nullptr) obj->callbacks.print = &print_desktop; END OBJ(desktop_number, nullptr) obj->callbacks.print = &print_desktop_number; END OBJ(desktop_name, nullptr) obj->callbacks.print = &print_desktop_name; #endif /* BUILD_X11 */ END OBJ_ARG(format_time, nullptr, "format_time needs a pid as argument") obj->sub = static_cast(malloc(sizeof(struct text_object))); extract_variable_text_internal(obj->sub, arg); obj->callbacks.print = &print_format_time; END OBJ(nodename, nullptr) obj->callbacks.print = &print_nodename; END OBJ(nodename_short, nullptr) obj->callbacks.print = &print_nodename_short; END OBJ_ARG(cmdline_to_pid, nullptr, "cmdline_to_pid needs a command line as argument") scan_cmdline_to_pid_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_cmdline_to_pid; obj->callbacks.free = &gen_free_opaque; END OBJ_ARG(pid_chroot, nullptr, "pid_chroot needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_chroot; END OBJ_ARG(pid_cmdline, nullptr, "pid_cmdline needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_cmdline; END OBJ_ARG(pid_cwd, nullptr, "pid_cwd needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_cwd; END OBJ_ARG(pid_environ, nullptr, "pid_environ needs arguments") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_environ; END OBJ_ARG(pid_environ_list, nullptr, "pid_environ_list needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_environ_list; END OBJ_ARG(pid_exe, nullptr, "pid_exe needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_exe; END OBJ_ARG(pid_nice, nullptr, "pid_nice needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_nice; END OBJ_ARG(pid_openfiles, nullptr, "pid_openfiles needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_openfiles; END OBJ_ARG(pid_parent, nullptr, "pid_parent needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_parent; END OBJ_ARG(pid_priority, nullptr, "pid_priority needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_priority; END OBJ_ARG(pid_state, nullptr, "pid_state needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_state; END OBJ_ARG(pid_state_short, nullptr, "pid_state_short needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_state_short; END OBJ_ARG(pid_stderr, nullptr, "pid_stderr needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_stderr; END OBJ_ARG(pid_stdin, nullptr, "pid_stdin needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_stdin; END OBJ_ARG(pid_stdout, nullptr, "pid_stdout needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_stdout; END OBJ_ARG(pid_threads, nullptr, "pid_threads needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_threads; END OBJ_ARG(pid_thread_list, nullptr, "pid_thread_list needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_thread_list; END OBJ_ARG(pid_time_kernelmode, nullptr, "pid_time_kernelmode needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_time_kernelmode; END OBJ_ARG(pid_time_usermode, nullptr, "pid_time_usermode needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_time_usermode; END OBJ_ARG(pid_time, nullptr, "pid_time needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_time; END OBJ_ARG(pid_uid, nullptr, "pid_uid needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_uid; END OBJ_ARG(pid_euid, nullptr, "pid_euid needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_euid; END OBJ_ARG(pid_suid, nullptr, "pid_suid needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_suid; END OBJ_ARG(pid_fsuid, nullptr, "pid_fsuid needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_fsuid; END OBJ_ARG(pid_gid, nullptr, "pid_gid needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_gid; END OBJ_ARG(pid_egid, nullptr, "pid_egid needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_egid; END OBJ_ARG(pid_sgid, nullptr, "pid_sgid needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_sgid; END OBJ_ARG(pid_fsgid, nullptr, "pid_fsgid needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_fsgid; END OBJ_ARG(gid_name, nullptr, "gid_name needs a gid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_gid_name; END OBJ_ARG(uid_name, nullptr, "uid_name needs a uid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_uid_name; END OBJ_ARG(pid_read, nullptr, "pid_read needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_read; END OBJ_ARG(pid_vmpeak, nullptr, "pid_vmpeak needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_vmpeak; END OBJ_ARG(pid_vmsize, nullptr, "pid_vmsize needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_vmsize; END OBJ_ARG(pid_vmlck, nullptr, "pid_vmlck needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_vmlck; END OBJ_ARG(pid_vmhwm, nullptr, "pid_vmhwm needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_vmhwm; END OBJ_ARG(pid_vmrss, nullptr, "pid_vmrss needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_vmrss; END OBJ_ARG(pid_vmdata, nullptr, "pid_vmdata needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_vmdata; END OBJ_ARG(pid_vmstk, nullptr, "pid_vmstk needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_vmstk; END OBJ_ARG(pid_vmexe, nullptr, "pid_vmexe needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_vmexe; END OBJ_ARG(pid_vmlib, nullptr, "pid_vmlib needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_vmlib; END OBJ_ARG(pid_vmpte, nullptr, "pid_vmpte needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_vmpte; END OBJ_ARG(pid_write, nullptr, "pid_write needs a pid as argument") extract_object_args_to_sub(obj, arg); obj->callbacks.print = &print_pid_write; #ifdef __DragonFly__ END OBJ(processes, &update_top) #else END OBJ(processes, &update_total_processes) #endif obj->callbacks.print = &print_processes; #ifdef __linux__ END OBJ(distribution, 0) obj->callbacks.print = &print_distribution; END OBJ(running_processes, &update_top) top_running = 1; obj->callbacks.print = &print_running_processes; END OBJ(threads, &update_threads) obj->callbacks.print = &print_threads; END OBJ(running_threads, &update_stat) obj->callbacks.print = &print_running_threads; #else #if defined(__DragonFly__) END OBJ(running_processes, &update_top) obj->callbacks.print = &print_running_processes; #elif (defined(__APPLE__) && defined(__MACH__)) END OBJ(running_processes, &update_running_processes) obj->callbacks.print = &print_running_processes; END OBJ(threads, &update_threads) obj->callbacks.print = &print_threads; END OBJ(running_threads, &update_running_threads) obj->callbacks.print = &print_running_threads; #else END OBJ(running_processes, &update_running_processes) obj->callbacks.print = &print_running_processes; #endif #endif /* __linux__ */ END OBJ(shadecolor, nullptr) #ifdef BUILD_X11 obj->data.l = arg != nullptr ? get_x11_color(arg) : default_shade_color.get(*state); obj->callbacks.print = &new_bg; #endif /* BUILD_X11 */ END OBJ(outlinecolor, nullptr) #ifdef BUILD_X11 obj->data.l = arg != nullptr ? get_x11_color(arg) : default_outline_color.get(*state); obj->callbacks.print = &new_outline; #endif /* BUILD_X11 */ END OBJ(stippled_hr, nullptr) #ifdef BUILD_X11 scan_stippled_hr(obj, arg); obj->callbacks.print = &new_stippled_hr; #endif /* BUILD_X11 */ END OBJ(swap, &update_meminfo) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_swap; obj->callbacks.free = &gen_free_opaque; END OBJ(swapfree, &update_meminfo) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_swapfree; obj->callbacks.free = &gen_free_opaque; END OBJ(swapmax, &update_meminfo) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_swapmax; obj->callbacks.free = &gen_free_opaque; END OBJ(swapperc, &update_meminfo) obj->callbacks.percentage = &swap_percentage; END OBJ(swapbar, &update_meminfo) scan_bar(obj, arg, 1); obj->callbacks.barval = &swap_barval; /* XXX: swapgraph, swapgauge? */ END OBJ(sysname, nullptr) obj->callbacks.print = &print_sysname; END OBJ(time, nullptr) scan_time(obj, arg); obj->callbacks.print = &print_time; obj->callbacks.free = &free_time; END OBJ(utime, nullptr) scan_time(obj, arg); obj->callbacks.print = &print_utime; obj->callbacks.free = &free_time; END OBJ(tztime, nullptr) scan_tztime(obj, arg); obj->callbacks.print = &print_tztime; obj->callbacks.free = &free_tztime; #ifdef BUILD_ICAL END OBJ_ARG(ical, 0, "ical requires arguments") parse_ical_args(obj, arg, free_at_crash, s); obj->callbacks.print = &print_ical; obj->callbacks.free = &free_ical; #endif #ifdef BUILD_IRC END OBJ_ARG(irc, 0, "irc requires arguments") parse_irc_args(obj, arg); obj->callbacks.print = &print_irc; obj->callbacks.free = &free_irc; #endif #ifdef BUILD_ICONV END OBJ_ARG(iconv_start, 0, "Iconv requires arguments") init_iconv_start(obj, free_at_crash, arg); obj->callbacks.print = &print_iconv_start; obj->callbacks.free = &free_iconv; END OBJ(iconv_stop, 0) init_iconv_stop(); obj->callbacks.print = &print_iconv_stop; #endif END OBJ(totaldown, &update_net_stats) parse_net_stat_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_totaldown; END OBJ(totalup, &update_net_stats) parse_net_stat_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_totalup; END OBJ(updates, nullptr) obj->callbacks.print = &print_updates; END OBJ_IF(if_updatenr, nullptr) obj->data.i = arg != nullptr ? atoi(arg) : 0; if (obj->data.i == 0) { CRIT_ERR(obj, free_at_crash, "if_updatenr needs a number above 0 as argument"); } set_updatereset(obj->data.i > get_updatereset() ? obj->data.i : get_updatereset()); obj->callbacks.iftest = &updatenr_iftest; END OBJ(alignr, nullptr) obj->data.l = arg != nullptr ? atoi(arg) : 1; obj->callbacks.print = &new_alignr; END OBJ(alignc, nullptr) obj->data.l = arg != nullptr ? atoi(arg) : 0; obj->callbacks.print = &new_alignc; END OBJ(upspeed, &update_net_stats) parse_net_stat_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_upspeed; END OBJ(upspeedf, &update_net_stats) parse_net_stat_arg(obj, arg, free_at_crash); obj->callbacks.print = &print_upspeedf; #ifdef BUILD_X11 END OBJ(upspeedgraph, &update_net_stats) parse_net_stat_graph_arg(obj, arg, free_at_crash); obj->callbacks.graphval = &upspeedgraphval; #endif END OBJ(uptime_short, &update_uptime) obj->callbacks.print = &print_uptime_short; END OBJ(uptime, &update_uptime) obj->callbacks.print = &print_uptime; #if defined(__linux__) END OBJ(user_names, &update_users) obj->callbacks.print = &print_user_names; obj->callbacks.free = &free_user_names; END OBJ(user_times, &update_users) obj->callbacks.print = &print_user_times; obj->callbacks.free = &free_user_times; END OBJ_ARG(user_time, 0, "user time needs a console name as argument") obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_user_time; obj->callbacks.free = &free_user_time; END OBJ(user_terms, &update_users) obj->callbacks.print = &print_user_terms; obj->callbacks.free = &free_user_terms; END OBJ(user_number, &update_users) obj->callbacks.print = &print_user_number; END OBJ(gw_iface, &update_gateway_info) obj->callbacks.print = &print_gateway_iface; obj->callbacks.free = &free_gateway_info; END OBJ_IF(if_gw, &update_gateway_info) obj->callbacks.iftest = &gateway_exists; obj->callbacks.free = &free_gateway_info; END OBJ(gw_ip, &update_gateway_info) obj->callbacks.print = &print_gateway_ip; obj->callbacks.free = &free_gateway_info; END OBJ(iface, &update_gateway_info2) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_gateway_iface2; obj->callbacks.free = &gen_free_opaque; #endif /* __linux__ */ #if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ defined(__DragonFly__) || defined(__OpenBSD__)) && \ (defined(i386) || defined(__i386__)) END OBJ(apm_adapter, 0) obj->callbacks.print = &print_apm_adapter; END OBJ(apm_battery_life, 0) obj->callbacks.print = &print_apm_battery_life; END OBJ(apm_battery_time, 0) obj->callbacks.print = &print_apm_battery_time; #endif /* __FreeBSD__ */ END OBJ(imap_unseen, nullptr) parse_imap_mail_args(obj, arg); obj->callbacks.print = &print_imap_unseen; obj->callbacks.free = &free_mail_obj; END OBJ(imap_messages, nullptr) parse_imap_mail_args(obj, arg); obj->callbacks.print = &print_imap_messages; obj->callbacks.free = &free_mail_obj; END OBJ(pop3_unseen, nullptr) parse_pop3_mail_args(obj, arg); obj->callbacks.print = &print_pop3_unseen; obj->callbacks.free = &free_mail_obj; END OBJ(pop3_used, nullptr) parse_pop3_mail_args(obj, arg); obj->callbacks.print = &print_pop3_used; obj->callbacks.free = &free_mail_obj; #ifdef BUILD_IBM END OBJ_ARG(smapi, 0, "smapi needs an argument") obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_smapi; obj->callbacks.free = &gen_free_opaque; END OBJ_IF_ARG(if_smapi_bat_installed, 0, "if_smapi_bat_installed needs an argument") obj->data.s = STRNDUP_ARG; obj->callbacks.iftest = &smapi_bat_installed; obj->callbacks.free = &gen_free_opaque; END OBJ_ARG(smapi_bat_perc, 0, "smapi_bat_perc needs an argument") obj->data.s = STRNDUP_ARG; obj->callbacks.percentage = &smapi_bat_percentage; obj->callbacks.free = &gen_free_opaque; END OBJ_ARG(smapi_bat_temp, 0, "smapi_bat_temp needs an argument") obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_smapi_bat_temp; obj->callbacks.free = &gen_free_opaque; END OBJ_ARG(smapi_bat_power, 0, "smapi_bat_power needs an argument") obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_smapi_bat_power; obj->callbacks.free = &gen_free_opaque; END OBJ_ARG(smapi_bat_bar, 0, "smapi_bat_bar needs an argument") int cnt; if (sscanf(arg, "%i %n", &obj->data.i, &cnt) <= 0) { NORM_ERR("first argument to smapi_bat_bar must be an integer value"); obj->data.i = -1; } else arg = scan_bar(obj, arg + cnt, 100); obj->callbacks.barval = &smapi_bat_barval; #endif /* BUILD_IBM */ #ifdef BUILD_MPD #define mpd_set_maxlen(name) \ if (arg) { \ int i; \ sscanf(arg, "%d", &i); \ if (i > 0) \ obj->data.i = i + 1; \ else \ NORM_ERR(#name ": invalid length argument"); \ } END OBJ(mpd_artist, nullptr) mpd_set_maxlen(mpd_artist); obj->callbacks.print = &print_mpd_artist; END OBJ(mpd_albumartist, nullptr) mpd_set_maxlen(mpd_albumartist); obj->callbacks.print = &print_mpd_albumartist; END OBJ(mpd_title, nullptr) mpd_set_maxlen(mpd_title); obj->callbacks.print = &print_mpd_title; END OBJ(mpd_date, nullptr) mpd_set_maxlen(mpd_date); obj->callbacks.print = &print_mpd_date; END OBJ(mpd_comment, nullptr) mpd_set_maxlen(mpd_comment); obj->callbacks.print = &print_mpd_comment; END OBJ(mpd_random, nullptr) obj->callbacks.print = &print_mpd_random; END OBJ(mpd_repeat, nullptr) obj->callbacks.print = &print_mpd_repeat; END OBJ(mpd_elapsed, nullptr) obj->callbacks.print = &print_mpd_elapsed; END OBJ(mpd_length, nullptr) obj->callbacks.print = &print_mpd_length; END OBJ(mpd_track, nullptr) mpd_set_maxlen(mpd_track); obj->callbacks.print = &print_mpd_track; END OBJ(mpd_name, nullptr) mpd_set_maxlen(mpd_name); obj->callbacks.print = &print_mpd_name; END OBJ(mpd_file, nullptr) mpd_set_maxlen(mpd_file); obj->callbacks.print = &print_mpd_file; END OBJ(mpd_percent, nullptr) obj->callbacks.percentage = &mpd_percentage; END OBJ(mpd_album, nullptr) mpd_set_maxlen(mpd_album); obj->callbacks.print = &print_mpd_album; END OBJ(mpd_vol, nullptr) obj->callbacks.print = &print_mpd_vol; END OBJ(mpd_bitrate, nullptr) obj->callbacks.print = &print_mpd_bitrate; END OBJ(mpd_status, nullptr) obj->callbacks.print = &print_mpd_status; END OBJ(mpd_bar, nullptr) scan_bar(obj, arg, 1); obj->callbacks.barval = &mpd_barval; END OBJ(mpd_smart, nullptr) mpd_set_maxlen(mpd_smart); obj->callbacks.print = &print_mpd_smart; END OBJ_IF(if_mpd_playing, nullptr) obj->callbacks.iftest = &check_mpd_playing; #undef mpd_set_maxlen #endif /* BUILD_MPD */ #ifdef BUILD_MOC END OBJ(moc_state, nullptr) obj->callbacks.print = &print_moc_state; END OBJ(moc_file, nullptr) obj->callbacks.print = &print_moc_file; END OBJ(moc_title, nullptr) obj->callbacks.print = &print_moc_title; END OBJ(moc_artist, nullptr) obj->callbacks.print = &print_moc_artist; END OBJ(moc_song, nullptr) obj->callbacks.print = &print_moc_song; END OBJ(moc_album, nullptr) obj->callbacks.print = &print_moc_album; END OBJ(moc_totaltime, nullptr) obj->callbacks.print = &print_moc_totaltime; END OBJ(moc_timeleft, nullptr) obj->callbacks.print = &print_moc_timeleft; END OBJ(moc_curtime, nullptr) obj->callbacks.print = &print_moc_curtime; END OBJ(moc_bitrate, nullptr) obj->callbacks.print = &print_moc_bitrate; END OBJ(moc_rate, nullptr) obj->callbacks.print = &print_moc_rate; #endif /* BUILD_MOC */ #ifdef BUILD_CMUS END OBJ(cmus_state, 0) obj->callbacks.print = &print_cmus_state; END OBJ(cmus_file, 0) obj->callbacks.print = &print_cmus_file; END OBJ(cmus_title, 0) obj->callbacks.print = &print_cmus_title; END OBJ(cmus_artist, 0) obj->callbacks.print = &print_cmus_artist; END OBJ(cmus_album, 0) obj->callbacks.print = &print_cmus_album; END OBJ(cmus_totaltime, 0) obj->callbacks.print = &print_cmus_totaltime; END OBJ(cmus_timeleft, 0) obj->callbacks.print = &print_cmus_timeleft; END OBJ(cmus_curtime, 0) obj->callbacks.print = &print_cmus_curtime; END OBJ(cmus_random, 0) obj->callbacks.print = &print_cmus_random; END OBJ(cmus_state, 0) obj->callbacks.print = &print_cmus_state; END OBJ(cmus_file, 0) obj->callbacks.print = &print_cmus_file; END OBJ(cmus_title, 0) obj->callbacks.print = &print_cmus_title; END OBJ(cmus_artist, 0) obj->callbacks.print = &print_cmus_artist; END OBJ(cmus_album, 0) obj->callbacks.print = &print_cmus_album; END OBJ(cmus_totaltime, 0) obj->callbacks.print = &print_cmus_totaltime; END OBJ(cmus_timeleft, 0) obj->callbacks.print = &print_cmus_timeleft; END OBJ(cmus_curtime, 0) obj->callbacks.print = &print_cmus_curtime; END OBJ(cmus_random, 0) obj->callbacks.print = &print_cmus_random; END OBJ(cmus_repeat, 0) obj->callbacks.print = &print_cmus_repeat; END OBJ(cmus_aaa, 0) obj->callbacks.print = &print_cmus_aaa; END OBJ(cmus_track, 0) obj->callbacks.print = &print_cmus_track; END OBJ(cmus_genre, 0) obj->callbacks.print = &print_cmus_genre; END OBJ(cmus_date, 0) obj->callbacks.print = &print_cmus_date; END OBJ(cmus_progress, 0) scan_bar(obj, arg, 1); obj->callbacks.barval = &cmus_progress; END OBJ(cmus_percent, 0) obj->callbacks.percentage = &cmus_percent; #endif /* BUILD_CMUS */ #ifdef BUILD_XMMS2 END OBJ(xmms2_artist, &update_xmms2) obj->callbacks.print = &print_xmms2_artist; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_album, &update_xmms2) obj->callbacks.print = &print_xmms2_album; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_title, &update_xmms2) obj->callbacks.print = &print_xmms2_title; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_genre, &update_xmms2) obj->callbacks.print = &print_xmms2_genre; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_comment, &update_xmms2) obj->callbacks.print = &print_xmms2_comment; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_url, &update_xmms2) obj->callbacks.print = &print_xmms2_url; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_tracknr, &update_xmms2) obj->callbacks.print = &print_xmms2_tracknr; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_bitrate, &update_xmms2) obj->callbacks.print = &print_xmms2_bitrate; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_date, &update_xmms2) obj->callbacks.print = &print_xmms2_date; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_id, &update_xmms2) obj->callbacks.print = &print_xmms2_id; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_duration, &update_xmms2) obj->callbacks.print = &print_xmms2_duration; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_elapsed, &update_xmms2) obj->callbacks.print = &print_xmms2_elapsed; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_size, &update_xmms2) obj->callbacks.print = &print_xmms2_size; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_status, &update_xmms2) obj->callbacks.print = &print_xmms2_status; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_percent, &update_xmms2) obj->callbacks.print = &print_xmms2_percent; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_bar, &update_xmms2) scan_bar(obj, arg, 1); obj->callbacks.barval = &xmms2_barval; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_smart, &update_xmms2) obj->callbacks.print = &print_xmms2_smart; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_playlist, &update_xmms2) obj->callbacks.print = &print_xmms2_playlist; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_timesplayed, &update_xmms2) obj->callbacks.print = &print_xmms2_timesplayed; obj->callbacks.free = &free_xmms2; END OBJ_IF(if_xmms2_connected, &update_xmms2) obj->callbacks.iftest = &if_xmms2_connected; obj->callbacks.free = &free_xmms2; #endif /* BUILD_XMMS2 */ #ifdef BUILD_AUDACIOUS END OBJ(audacious_status, 0) obj->callbacks.print = &print_audacious_status; END OBJ_ARG(audacious_title, 0, "audacious_title needs an argument") sscanf(arg, "%d", &obj->data.i); if (obj->data.i > 0) { ++obj->data.i; } else { CRIT_ERR(obj, free_at_crash, "audacious_title: invalid length argument"); } obj->callbacks.print = &print_audacious_title; END OBJ(audacious_length, 0) obj->callbacks.print = &print_audacious_length; END OBJ(audacious_length_seconds, 0) obj->callbacks.print = &print_audacious_length_seconds; END OBJ(audacious_position, 0) obj->callbacks.print = &print_audacious_position; END OBJ(audacious_position_seconds, 0) obj->callbacks.print = &print_audacious_position_seconds; END OBJ(audacious_bitrate, 0) obj->callbacks.print = &print_audacious_bitrate; END OBJ(audacious_frequency, 0) obj->callbacks.print = &print_audacious_frequency; END OBJ(audacious_channels, 0) obj->callbacks.print = &print_audacious_channels; END OBJ(audacious_filename, 0) obj->callbacks.print = &print_audacious_filename; END OBJ(audacious_playlist_length, 0) obj->callbacks.print = &print_audacious_playlist_length; END OBJ(audacious_playlist_position, 0) obj->callbacks.print = &print_audacious_playlist_position; END OBJ(audacious_main_volume, 0) obj->callbacks.print = &print_audacious_main_volume; END OBJ(audacious_bar, 0) scan_bar(obj, arg, 1); obj->callbacks.barval = &audacious_barval; #endif /* BUILD_AUDACIOUS */ #ifdef BUILD_CURL END OBJ_ARG(curl, 0, "curl needs arguments: ") curl_parse_arg(obj, arg); obj->callbacks.print = &curl_print; obj->callbacks.free = &curl_obj_free; END OBJ(github_notifications, 0) obj->callbacks.print = &print_github; #endif /* BUILD_CURL */ #ifdef BUILD_RSS END OBJ_ARG(rss, 0, "rss needs arguments: " "[act_par] [spaces in front]") rss_scan_arg(obj, arg); obj->callbacks.print = &rss_print_info; obj->callbacks.free = &rss_free_obj_info; #endif /* BUILD_RSS */ #ifdef BUILD_WEATHER_METAR END OBJ_ARG(weather, 0, "weather still needs to written...") obj->callbacks.print = &print_weather; #endif /* BUILD_WEATHER_METAR */ END OBJ_ARG(lua, nullptr, "lua needs arguments: [function parameters]") obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_lua; obj->callbacks.free = &gen_free_opaque; END OBJ_ARG( lua_parse, nullptr, "lua_parse needs arguments: [function parameters]") obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_lua_parse; obj->callbacks.free = &gen_free_opaque; END OBJ_ARG(lua_bar, nullptr, "lua_bar needs arguments: , " "[function parameters]") arg = scan_bar(obj, arg, 100); if (arg != nullptr) { obj->data.s = STRNDUP_ARG; } else { CRIT_ERR(obj, free_at_crash, "lua_bar needs arguments: , " "[function parameters]"); } obj->callbacks.barval = &lua_barval; obj->callbacks.free = &gen_free_opaque; #ifdef BUILD_X11 END OBJ_ARG( lua_graph, nullptr, "lua_graph needs arguments: [height],[width] [gradient " "colour 1] [gradient colour 2] [scale] [-t] [-l]") char *buf = nullptr; buf = scan_graph(obj, arg, 100); if (buf != nullptr) { obj->data.s = buf; } else { CRIT_ERR(obj, free_at_crash, "lua_graph needs arguments: [height],[width] " "[gradient colour 1] [gradient colour 2] [scale] [-t] [-l]"); } obj->callbacks.graphval = &lua_barval; obj->callbacks.free = &gen_free_opaque; END OBJ_ARG(lua_gauge, nullptr, "lua_gauge needs arguments: , " "[function parameters]") arg = scan_gauge(obj, arg, 100); if (arg != nullptr) { obj->data.s = STRNDUP_ARG; } else { CRIT_ERR(obj, free_at_crash, "lua_gauge needs arguments: , " "[function parameters]"); } obj->callbacks.gaugeval = &lua_barval; obj->callbacks.free = &gen_free_opaque; #endif /* BUILD_X11 */ #ifdef BUILD_HDDTEMP END OBJ(hddtemp, &update_hddtemp) if (arg) obj->data.s = STRNDUP_ARG; obj->callbacks.print = &print_hddtemp; obj->callbacks.free = &free_hddtemp; #endif /* BUILD_HDDTEMP */ #ifdef BUILD_PORT_MONITORS END OBJ_ARG(tcp_portmon, &tcp_portmon_update, "tcp_portmon: needs arguments") tcp_portmon_init(obj, arg); obj->callbacks.print = &tcp_portmon_action; obj->callbacks.free = &tcp_portmon_free; #endif /* BUILD_PORT_MONITORS */ END OBJ(entropy_avail, &update_entropy) obj->callbacks.print = &print_entropy_avail; END OBJ(entropy_perc, &update_entropy) obj->callbacks.percentage = &entropy_percentage; END OBJ(entropy_poolsize, &update_entropy) obj->callbacks.print = &print_entropy_poolsize; END OBJ(entropy_bar, &update_entropy) scan_bar(obj, arg, 1); obj->callbacks.barval = &entropy_barval; END OBJ_ARG(blink, nullptr, "blink needs a argument") obj->sub = static_cast(malloc(sizeof(struct text_object))); extract_variable_text_internal(obj->sub, arg); obj->callbacks.print = &print_blink; END OBJ_ARG(to_bytes, nullptr, "to_bytes needs a argument") obj->sub = static_cast(malloc(sizeof(struct text_object))); extract_variable_text_internal(obj->sub, arg); obj->callbacks.print = &print_to_bytes; #ifdef BUILD_CURL END OBJ_ARG(stock, 0, "stock needs arguments") stock_parse_arg(obj, arg); obj->callbacks.print = &print_stock; obj->callbacks.free = &free_stock; #endif /* BUILD_CURL */ END OBJ(scroll, nullptr) #ifdef BUILD_X11 /* allocate a follower to reset any color changes */ #endif /* BUILD_X11 */ parse_scroll_arg(obj, arg, free_at_crash, s); obj->callbacks.print = &print_scroll; obj->callbacks.free = &free_scroll; END OBJ(combine, nullptr) try { parse_combine_arg(obj, arg); } catch (combine_needs_2_args_error &e) { free(obj); throw obj_create_error(e.what()); } obj->callbacks.print = &print_combine; obj->callbacks.free = &free_combine; #ifdef BUILD_NVIDIA END OBJ_ARG( nvidia, 0, "nvidia needs an argument") if (set_nvidia_query(obj, arg, NONSPECIAL)) { CRIT_ERR(obj, free_at_crash, "nvidia: invalid argument" " specified: '%s'", arg); } obj->callbacks.print = &print_nvidia_value; obj->callbacks.free = &free_nvidia; END OBJ_ARG( nvidiabar, 0, "nvidiabar needs an argument") if (set_nvidia_query(obj, arg, BAR)) { CRIT_ERR(obj, free_at_crash, "nvidiabar: invalid argument" " specified: '%s'", arg); } obj->callbacks.barval = &get_nvidia_barval; obj->callbacks.free = &free_nvidia; END OBJ_ARG( nvidiagraph, 0, "nvidiagraph needs an argument") if (set_nvidia_query(obj, arg, GRAPH)) { CRIT_ERR(obj, free_at_crash, "nvidiagraph: invalid argument" " specified: '%s'", arg); } obj->callbacks.graphval = &get_nvidia_barval; obj->callbacks.free = &free_nvidia; END OBJ_ARG( nvidiagauge, 0, "nvidiagauge needs an argument") if (set_nvidia_query(obj, arg, GAUGE)) { CRIT_ERR(obj, free_at_crash, "nvidiagauge: invalid argument" " specified: '%s'", arg); } obj->callbacks.gaugeval = &get_nvidia_barval; obj->callbacks.free = &free_nvidia; #endif /* BUILD_NVIDIA */ #ifdef BUILD_APCUPSD END OBJ_ARG( apcupsd, &update_apcupsd, "apcupsd needs arguments: ") if (apcupsd_scan_arg(arg) != 0) { CRIT_ERR(obj, free_at_crash, "apcupsd needs arguments: "); } obj->callbacks.print = &gen_print_nothing; END OBJ(apcupsd_name, &update_apcupsd) obj->callbacks.print = &print_apcupsd_name; END OBJ(apcupsd_model, &update_apcupsd) obj->callbacks.print = &print_apcupsd_model; END OBJ(apcupsd_upsmode, &update_apcupsd) obj->callbacks.print = &print_apcupsd_upsmode; END OBJ(apcupsd_cable, &update_apcupsd) obj->callbacks.print = &print_apcupsd_cable; END OBJ(apcupsd_status, &update_apcupsd) obj->callbacks.print = &print_apcupsd_status; END OBJ(apcupsd_linev, &update_apcupsd) obj->callbacks.print = &print_apcupsd_linev; END OBJ(apcupsd_load, &update_apcupsd) obj->callbacks.print = &print_apcupsd_load; END OBJ(apcupsd_loadbar, &update_apcupsd) scan_bar(obj, arg, 100); obj->callbacks.barval = &apcupsd_loadbarval; #ifdef BUILD_X11 END OBJ(apcupsd_loadgraph, &update_apcupsd) char *buf = nullptr; buf = scan_graph(obj, arg, 100); free_and_zero(buf); obj->callbacks.graphval = &apcupsd_loadbarval; END OBJ(apcupsd_loadgauge, &update_apcupsd) scan_gauge(obj, arg, 100); obj->callbacks.gaugeval = &apcupsd_loadbarval; #endif /* BUILD_X11 */ END OBJ(apcupsd_charge, &update_apcupsd) obj->callbacks.print = &print_apcupsd_charge; END OBJ(apcupsd_timeleft, &update_apcupsd) obj->callbacks.print = &print_apcupsd_timeleft; END OBJ(apcupsd_temp, &update_apcupsd) obj->callbacks.print = &print_apcupsd_temp; END OBJ(apcupsd_lastxfer, &update_apcupsd) obj->callbacks.print = &print_apcupsd_lastxfer; #endif /* BUILD_APCUPSD */ #ifdef BUILD_JOURNAL END OBJ_ARG(journal, 0, "journal needs arguments") init_journal("journal", arg, obj, free_at_crash); obj->callbacks.print = &print_journal; obj->callbacks.free = &free_journal; #endif /* BUILD_JOURNAL */ #ifdef BUILD_PULSEAUDIO END OBJ_IF(if_pa_sink_muted, 0) obj->callbacks.iftest = &puau_muted; obj->callbacks.free = &free_pulseaudio; init_pulseaudio(obj); END OBJ(pa_sink_description, 0) obj->callbacks.print = &print_puau_sink_description; obj->callbacks.free = &free_pulseaudio; init_pulseaudio(obj); END OBJ(pa_sink_active_port_name, 0) obj->callbacks.print = &print_puau_sink_active_port_name; obj->callbacks.free = &free_pulseaudio; init_pulseaudio(obj); END OBJ(pa_sink_active_port_description, 0) obj->callbacks.print = &print_puau_sink_active_port_description; obj->callbacks.free = &free_pulseaudio; init_pulseaudio(obj); END OBJ(pa_sink_volume, 0) obj->callbacks.percentage = &puau_vol; obj->callbacks.free = &free_pulseaudio; init_pulseaudio(obj); END OBJ(pa_sink_volumebar, 0) scan_bar(obj, arg, 1); init_pulseaudio(obj); obj->callbacks.barval = &puau_volumebarval; obj->callbacks.free = &free_pulseaudio; END OBJ(pa_card_active_profile, 0) obj->callbacks.print = &print_puau_card_active_profile; obj->callbacks.free = &free_pulseaudio; init_pulseaudio(obj); END OBJ(pa_card_name, 0) obj->callbacks.print = &print_puau_card_name; obj->callbacks.free = &free_pulseaudio; init_pulseaudio(obj); #endif /* BUILD_PULSEAUDIO */ #ifdef BUILD_INTEL_BACKLIGHT END OBJ(intel_backlight, 0) obj->callbacks.print = &print_intel_backlight; obj->callbacks.free = &free_intel_backlight; init_intel_backlight(obj); #endif /* BUILD_INTEL_BACKLIGHT */ END { auto *buf = static_cast(malloc(text_buffer_size.get(*state))); NORM_ERR("unknown variable '$%s'", s); snprintf(buf, text_buffer_size.get(*state), "${%s}", s); obj_be_plain_text(obj, buf); free(buf); } #undef OBJ #undef OBJ_IF #undef OBJ_ARG #undef OBJ_IF_ARG #undef __OBJ_HEAD #undef __OBJ_IF #undef __OBJ_ARG #undef END return obj; } /* * - assumes that *string is '#' * - removes the part from '#' to the end of line ('\n' or '\0') * - it removes the '\n' * - copies the last char into 'char *last' argument, which should be a pointer * to a char rather than a string. */ static size_t remove_comment(char *string, char *last) { char *end = string; while (*end != '\0' && *end != '\n') { ++end; } if (last != nullptr) { *last = *end; } if (*end == '\n') { end++; } strfold(string, end - string); return end - string; } size_t remove_comments(char *string) { char *curplace; size_t folded = 0; for (curplace = string; *curplace != 0; curplace++) { if (*curplace == '\\' && *(curplace + 1) == '#') { // strcpy can't be used for overlapping strings strfold(curplace, 1); folded += 1; } else if (*curplace == '#') { folded += remove_comment(curplace, nullptr); } } return folded; } int extract_variable_text_internal(struct text_object *retval, const char *const_p) { struct text_object *obj; char *p, *s, *orig_p; long line; void *ifblock_opaque = nullptr; char *tmp_p; char *arg = nullptr; size_t len = 0; p = strndup(const_p, max_user_text.get(*state) - 1); while (text_contains_templates(p) != 0) { char *tmp; tmp = find_and_replace_templates(p); free(p); p = tmp; } s = orig_p = p; if (static_cast(strcmp(p, const_p) != 0) != 0) { DBGP2("replaced all templates in text: input is\n'%s'\noutput is\n'%s'", const_p, p); } else { DBGP2("no templates to replace"); } memset(retval, 0, sizeof(struct text_object)); line = global_text_lines; while (*p != 0) { if (*p == '\n') { line++; } if (*p == '$') { *p = '\0'; obj = create_plain_text(s); if (obj != nullptr) { append_object(retval, obj); } *p = '$'; p++; s = p; if (*p != '$') { auto *buf = static_cast(malloc(text_buffer_size.get(*state))); const char *var; /* variable is either $foo or ${foo} */ if (*p == '{') { unsigned int brl = 1, brr = 0; p++; s = p; while ((*p != 0) && brl != brr) { if (*p == '{') { brl++; } if (*p == '}') { brr++; } p++; } p--; } else { s = p; if (*p == '#') { p++; } while ((*p != 0) && ((isalnum(static_cast(*p)) != 0) || *p == '_')) { p++; } } /* copy variable to buffer */ len = (p - s > static_cast(text_buffer_size.get(*state)) - 1) ? static_cast(text_buffer_size.get(*state)) - 1 : (p - s); strncpy(buf, s, len); buf[len] = '\0'; if (*p == '}') { p++; } s = p; /* search for variable in environment */ var = getenv(buf); if (var != nullptr) { obj = create_plain_text(var); if (obj != nullptr) { append_object(retval, obj); } free(buf); continue; } /* if variable wasn't found in environment, use some special */ arg = nullptr; /* split arg */ if (strchr(buf, ' ') != nullptr) { arg = strchr(buf, ' '); *arg = '\0'; arg++; while (isspace(static_cast(*arg)) != 0) { arg++; } if (*arg == 0) { arg = nullptr; } } /* lowercase variable name */ tmp_p = buf; while (*tmp_p != 0) { *tmp_p = tolower(static_cast(*tmp_p)); tmp_p++; } try { obj = construct_text_object(buf, arg, line, &ifblock_opaque, orig_p); } catch (obj_create_error &e) { free(buf); free(orig_p); throw; } if (obj != nullptr) { append_object(retval, obj); } free(buf); continue; } obj = create_plain_text("$"); s = p + 1; if (obj != nullptr) { append_object(retval, obj); } } else if (*p == '\\' && *(p + 1) == '#') { strfold(p, 1); } else if (*p == '#') { char c; if ((remove_comment(p, &c) != 0u) && p >= orig_p && c == '\n') { /* if remove_comment removed a newline, we need to 'back up' with p */ p--; } } p++; } obj = create_plain_text(s); if (obj != nullptr) { append_object(retval, obj); } if (ifblock_stack_empty(&ifblock_opaque) == 0) { NORM_ERR("one or more $endif's are missing"); } free(orig_p); return 0; } void extract_object_args_to_sub(struct text_object *obj, const char *args) { obj->sub = static_cast(malloc(sizeof(struct text_object))); memset(obj->sub, 0, sizeof(struct text_object)); extract_variable_text_internal(obj->sub, args); } /* Frees the list of text objects root points to. */ void free_text_objects(struct text_object *root) { struct text_object *obj; if ((root != nullptr) && (root->prev != nullptr)) { for (obj = root->prev; obj != nullptr; obj = root->prev) { root->prev = obj->prev; if (obj->callbacks.free != nullptr) { (*obj->callbacks.free)(obj); } free_text_objects(obj->sub); free_and_zero(obj->sub); free_and_zero(obj->special_data); delete obj->cb_handle; free(obj); } } } conky-1.12.2/src/core.h000066400000000000000000000031141404127277500146200ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _CONKY_CORE_H_ #define _CONKY_CORE_H_ #include "conky.h" struct text_object *construct_text_object(const char *s, const char *arg, long line, void **ifblock_opaque, void *free_at_crash); size_t remove_comments(char *string); int extract_variable_text_internal(struct text_object *retval, const char *const_p); void free_text_objects(struct text_object *root); const char *dev_name(const char *); #endif /* _CONKY_CORE_H_ */ conky-1.12.2/src/cpu.cc000066400000000000000000000071471404127277500146270ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include #include #include #include "config.h" #include "conky.h" #include "text_object.h" #ifdef __x86_64__ #define CPU_FEATURE(x, z) __asm__ __volatile__("cpuid" : "=a"(z) : "a"(x)) #define CPU_REGS(x, y, z) \ __asm__ __volatile__("cpuid" : "=a"(z), "=b"(y) : "a"(x)) #define CPU_STR2(regizter, a, b, c, d) \ __asm__ __volatile__("cpuid" \ : "=a"(a), "=b"(b), "=c"(c), "=d"(d) \ : "a"(regizter)) #define AmD 0x68747541 #define InteL 0x756e6547 #if defined(__FreeBSD__) #define TICKZ 100L #else #define TICKZ sysconf(_SC_CLK_TCK) #endif /* __FreeBSD__ */ uint8_t has_tsc_reg(void) { uint_fast16_t vend = 0; uint_fast16_t leafs = 0; uint_fast16_t eax = 0; uint_fast16_t ecx = 0; uint_fast16_t edx = 0; uint_fast16_t ebx = 0; CPU_REGS(0x00000000, vend, leafs); if (0x00000001 > leafs) { return 1U; } if (static_cast(vend) != AmD && static_cast(vend) != InteL) { return 1U; } CPU_STR2(0x00000001, eax, ebx, ecx, edx); if (0U == (edx & (1U << 4U))) { return 1U; } return 0U; } uintmax_t rdtsc(void) { unsigned int tickhi = 0; unsigned int ticklo = 0; uint_fast16_t eax = 0; uint_fast16_t ecx = 0; uint_fast16_t edx = 0; uint_fast16_t ebx = 0; uint_fast16_t regz = 0; uint_fast16_t x = 0; if (0U != (has_tsc_reg())) { goto seeya; } __asm__ __volatile__( "cpuid\n\t" "rdtsc\n\t" : "=a"(ticklo), "=d"(tickhi)::"%rbx", "%rcx"); CPU_FEATURE(0x80000000, regz); if (0x80000001 > static_cast(regz)) { goto seeya; } CPU_STR2(0x80000001, eax, ebx, ecx, edx); if (0U != (edx & (1U << 27U))) { for (x = 0; x < 6U; x++) { __asm__ __volatile__( "rdtscp\n\t" "mov %%edx, %0\n\t" "mov %%eax, %1\n\t" "cpuid\n\t" : "=r"(tickhi), "=r"(ticklo)::"%rax", "%rbx", "%rcx", "%rdx"); } } seeya: return ((static_cast(tickhi) << 32) | static_cast(ticklo)); } void get_cpu_clock_speed(char *str1, unsigned int p_max_size) { uintmax_t x = 0; uintmax_t z = 0; struct timespec tc = {0L, 0L}; tc.tv_nsec = TICKZ * 1000000L; x = rdtsc(); if (-1 == (nanosleep(&tc, NULL))) { return; } z = rdtsc(); snprintf(str1, p_max_size, "%ju MHz", ((z - x) / 100000U)); } void print_freq2(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; get_cpu_clock_speed(p, p_max_size); } #else char *l337; #endif /* __x86_64__ */ conky-1.12.2/src/cpu.h000066400000000000000000000024341404127277500144630ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _CPU_H #define _CPU_H #ifdef __x86_64__ uintmax_t rdtsc(void); void get_cpu_clock_speed(char *, unsigned int); uint8_t has_tsc_reg(void); void print_freq2(struct text_object *, char *, unsigned int); #endif /* __x86_64__ */ #endif /* _CPU_H */ conky-1.12.2/src/darwin.h000066400000000000000000000034041404127277500151560ustar00rootroot00000000000000/* * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2018-2019, npyl * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef DARWIN_H #define DARWIN_H #include #include #include #include /* * on versions prior to Sierra clock_gettime is not implemented. */ #ifndef HAVE_CLOCK_GETTIME /* only CLOCK_REALTIME and CLOCK_MONOTONIC are emulated */ #ifndef CLOCK_REALTIME #define CLOCK_REALTIME 0 #endif #ifndef CLOCK_MONOTONIC #define CLOCK_MONOTONIC 1 #endif int clock_gettime(int clock_id, struct timespec *ts); #endif /* ifndef HAVE_CLOCK_GETTIME */ int update_running_threads(void); int get_entropy_avail(const unsigned int *); int get_entropy_poolsize(const unsigned int *); /* System Integrity Protection */ int get_sip_status(void); void print_sip_status(struct text_object *obj, char *p, unsigned int p_max_size); void deallocate_cpu_sample(struct text_object *obj); #endif /*DARWIN_H*/ conky-1.12.2/src/darwin.mm000066400000000000000000001243601404127277500153450ustar00rootroot00000000000000/* * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2018-2019, npyl * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ /* *********************************************************************************************** * * darwin.cc * Nickolas Pylarinos * * ~ To mrt and vggol ~ * *********************************************************************************************** * * Code for SIP taken from Pike R. Alpha's csrstat tool *https://github.com/Piker-Alpha/csrstat csrstat version 1.8 ( works for OS up *to High Sierra ) * * My patches: * made csr_get_active_config weak link and added check for finding if it *is available. patched the _csr_check function to return the bool bit instead. */ #include "conky.h" // for struct info #include "darwin.h" #include #include // statfs #include #include #include #include #include #include #include #include // update_total_processes #include // get_top_info #include // get_top_info #include "top.h" // get_top_info #include // update_net_stats #include "net_stat.h" // update_net_stats #include "darwin_sip.h" // sip status #include #ifdef BUILD_IPGFREQ #include #endif #ifdef BUILD_WLAN #import #endif /* clock_gettime includes */ #ifndef HAVE_CLOCK_GETTIME #include #include #include #include #include #endif /* debugging defines */ #define DEBUG_MODE /* (E)nhanced printf */ #ifdef DEBUG_MODE #include void eprintf(const char *fmt, ...) { va_list args; va_start(args, fmt); vprintf(fmt, args); va_end(args); } #else #define eprintf(...) /* ... */ #endif #define GETSYSCTL(name, var) getsysctl(name, &(var), sizeof(var)) /* * used by calc_cpu_each() for get_top_info() */ static conky::simple_config_setting top_cpu_separate("top_cpu_separate", false, true); /* * used by update_cpu_usage() */ struct cpusample *sample_handle = nullptr; static int getsysctl(const char *name, void *ptr, size_t len) { size_t nlen = len; if (sysctlbyname(name, ptr, &nlen, nullptr, 0) == -1) { return -1; } if (nlen != len && errno == ENOMEM) { return -1; } return 0; } /* * clock_gettime is not implemented on versions prior to Sierra! * code taken from * https://github.com/lorrden/darwin-posix-rt/blob/master/clock_gettime.c */ #ifndef HAVE_CLOCK_GETTIME int clock_gettime(int clock_id, struct timespec *ts) { mach_timespec_t mts; static clock_serv_t rt_clock_serv = 0; static clock_serv_t mono_clock_serv = 0; switch (clock_id) { case CLOCK_REALTIME: if (rt_clock_serv == 0) { (void)host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &rt_clock_serv); } (void)clock_get_time(rt_clock_serv, &mts); ts->tv_sec = mts.tv_sec; ts->tv_nsec = mts.tv_nsec; return 0; case CLOCK_MONOTONIC: if (mono_clock_serv == 0) { (void)host_get_clock_service(mach_host_self(), SYSTEM_CLOCK, &mono_clock_serv); } (void)clock_get_time(mono_clock_serv, &mts); ts->tv_sec = mts.tv_sec; ts->tv_nsec = mts.tv_nsec; return 0; default: errno = EINVAL; return -1; } } #endif /* ifndef HAVE_CLOCK_GETTIME */ /* * helper_update_threads_processes() * * Helper function for update_threads() and update_running_threads() * Uses mach API to get load info ( task_count, thread_count ) * */ static void helper_update_threads_processes() { static host_name_port_t machHost; static processor_set_name_port_t processorSet = 0; static bool machStuffInitialised = false; /* Set up our mach host and default processor set for later calls */ if (!machStuffInitialised) { machHost = mach_host_self(); processor_set_default(machHost, &processorSet); /* set this to true so we don't ever initialise stuff again */ machStuffInitialised = true; } /* get load info */ struct processor_set_load_info loadInfo {}; mach_msg_type_number_t count = PROCESSOR_SET_LOAD_INFO_COUNT; kern_return_t err = processor_set_statistics( processorSet, PROCESSOR_SET_LOAD_INFO, reinterpret_cast(&loadInfo), &count); if (err != KERN_SUCCESS) { return; } info.procs = loadInfo.task_count; info.threads = loadInfo.thread_count; } /* * useful info about the cpu used by functions such as update_cpu_usage() and * get_top_info() */ struct cpusample { uint64_t totalUserTime; /* ticks of CPU in userspace */ uint64_t totalSystemTime; /* ticks of CPU in kernelspace */ uint64_t totalIdleTime; /* ticks in idleness */ uint64_t total; /* delta of current and previous */ uint64_t current_total; /* total CPU ticks of current iteration */ uint64_t previous_total; /* total CPU tick of previous iteration */ }; /* * Memory sample */ typedef struct memorysample { vm_statistics64_data_t vm_stat; /* general VM information */ uint64_t pages_stolen; /* # of stolen pages */ vm_size_t pagesize; /* pagesize (in bytes) */ boolean_t purgeable_is_valid; /* check if we have data for purgeable memory */ } libtop_tsamp_t; /* * get_cpu_sample() * * Gets systemTime, userTime and idleTime for CPU * MenuMeters has been great inspiration for this function */ static void get_cpu_sample(struct cpusample **sample) { host_name_port_t machHost; natural_t processorCount; processor_cpu_load_info_t processorTickInfo; mach_msg_type_number_t processorInfoCount; machHost = mach_host_self(); kern_return_t err = host_processor_info( machHost, PROCESSOR_CPU_LOAD_INFO, &processorCount, reinterpret_cast(&processorTickInfo), &processorInfoCount); if (err != KERN_SUCCESS) { printf("host_statistics: %s\n", mach_error_string(err)); return; } /* * start from samples[1] because samples[0] is overall CPU usage */ for (natural_t i = 1; i < processorCount + 1; i++) { (*sample)[i].totalSystemTime = processorTickInfo[i - 1].cpu_ticks[CPU_STATE_SYSTEM], (*sample)[i].totalUserTime = processorTickInfo[i - 1].cpu_ticks[CPU_STATE_USER], (*sample)[i].totalIdleTime = processorTickInfo[i - 1].cpu_ticks[CPU_STATE_IDLE]; } /* * sum up all totals */ for (natural_t i = 1; i < processorCount + 1; i++) { (*sample)[0].totalSystemTime += (*sample)[i].totalSystemTime; (*sample)[0].totalUserTime += (*sample)[i].totalUserTime; (*sample)[0].totalIdleTime += (*sample)[i].totalIdleTime; } /* * Dealloc */ vm_deallocate(mach_task_self(), (vm_address_t)processorTickInfo, static_cast(processorInfoCount * sizeof(natural_t))); } void allocate_cpu_sample(struct cpusample **sample) { if (*sample != nullptr) return; /* * allocate ncpus+1 cpusample structs (one foreach CPU) * ** sample_handle[0] is overal CPU usage */ *sample = reinterpret_cast(malloc(sizeof(cpusample) * (info.cpu_count + 1))); memset(*sample, 0, sizeof(cpusample) * (info.cpu_count + 1)); sample_handle = *sample; /* use a public handle for deallocating */ } void free_cpu(struct text_object *) { if (sample_handle != nullptr) { free(sample_handle); sample_handle = nullptr; } } /* * helper_get_proc_list() * * helper function that returns the count of processes * and provides a list of kinfo_proc structs representing each. * * ERRORS: returns -1 if something failed * * ATTENTION: Do not forget to free the array once you are done with it, * it is not freed automatically. */ static int helper_get_proc_list(struct kinfo_proc **p) { int err = 0; size_t length = 0; static const int name[] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0}; /* Call sysctl with a nullptr buffer to get proper length */ err = sysctl((int *)name, (sizeof(name) / sizeof(*name)) - 1, nullptr, &length, nullptr, 0); if (err != 0) { perror(nullptr); return (-1); } /* Allocate buffer */ *p = static_cast(malloc(length)); if (p == nullptr) { perror(nullptr); return (-1); } /* Get the actual process list */ err = sysctl((int *)name, (sizeof(name) / sizeof(*name)) - 1, *p, &length, nullptr, 0); if (err != 0) { perror(nullptr); return (-1); } int proc_count = length / sizeof(struct kinfo_proc); return proc_count; } /*------------------------------------------------------------------------------------------------------------------------------------------------------------------- * macOS Swapfiles Logic... * * o There is NO separate partition for swap storage ( unlike most Unix-based *OSes ) --- Instead swap memory is stored in the currently used partition *inside files * * o macOS can use ALL the available space on the used partition * * o Swap memory files are called swapfiles, stored inside /private/var/vm/ * * o Every swapfile has index number eg. swapfile0, swapfile1, ... * * o Anyone can change the location of the swapfiles by editing the plist: * /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist ( Though it seems *like this is not supported by the dynamic_pager application as can be observed *from the code: * https://github.com/practicalswift/osx/blob/master/src/system_cmds/dynamic_pager.tproj/dynamic_pager.c *) o Every swapfile has size of 1GB * *------------------------------------------------------------------------------------------------------------------------------------------------------------------- */ static int swapmode(unsigned long *retavail, unsigned long *retfree) { /* * COMPATIBILITY: Tiger+ */ int swapMIB[] = {CTL_VM, 5}; struct xsw_usage swapUsage {}; size_t swapUsageSize = sizeof(swapUsage); memset(&swapUsage, 0, sizeof(swapUsage)); if (sysctl(swapMIB, 2, &swapUsage, &swapUsageSize, nullptr, 0) == 0) { *retfree = swapUsage.xsu_avail / 1024; *retavail = swapUsage.xsu_total / 1024; } else { perror("sysctl"); return (-1); } return 1; } void prepare_update() { // in freebsd.cc this is empty so leaving it here too! } int update_uptime() { int mib[2] = {CTL_KERN, KERN_BOOTTIME}; struct timeval boottime {}; time_t now; size_t size = sizeof(boottime); if ((sysctl(mib, 2, &boottime, &size, nullptr, 0) != -1) && (boottime.tv_sec != 0)) { time(&now); info.uptime = now - boottime.tv_sec; } else { fprintf(stderr, "could not get uptime\n"); info.uptime = 0; } return 0; } /* * check_mount * * Notes on macOS implementation: * 1. path mustn't contain a '/' at the end! ( eg. /Volumes/MacOS/ is not * correct but this is correct: /Volumes/MacOS ) * 2. it works the same as the FreeBSD function */ int check_mount(struct text_object *obj) { int num_mounts = 0; struct statfs *mounts; if (obj->data.s == nullptr) { return 0; } num_mounts = getmntinfo(&mounts, MNT_WAIT); if (num_mounts < 0) { NORM_ERR("could not get mounts using getmntinfo"); return 0; } for (int i = 0; i < num_mounts; i++) { if (strcmp(mounts[i].f_mntonname, obj->data.s) == 0) { return 1; } } return 0; } /* * required by update_pages_stolen(). * Taken from apple's top. * The code is intact. */ /* This is for . */ static uint64_t round_down_wired(uint64_t value) { return (value & ~((128 * 1024 * 1024ULL) - 1)); } /* * must be called before libtop_tsamp_update_vm_stats() * to calculate the pages_stolen variable. * Taken from apple's top. * The code is intact. */ /* This is for . */ static void update_pages_stolen(libtop_tsamp_t *tsamp) { static int mib_reserved[CTL_MAXNAME]; static int mib_unusable[CTL_MAXNAME]; static int mib_other[CTL_MAXNAME]; static size_t mib_reserved_len = 0; static size_t mib_unusable_len = 0; static size_t mib_other_len = 0; int r; tsamp->pages_stolen = 0; /* This can be used for testing: */ // tsamp->pages_stolen = (256 * 1024 * 1024ULL) / tsamp->pagesize; if (0 == mib_reserved_len) { mib_reserved_len = CTL_MAXNAME; r = sysctlnametomib("machdep.memmap.Reserved", mib_reserved, &mib_reserved_len); if (-1 == r) { mib_reserved_len = 0; return; } mib_unusable_len = CTL_MAXNAME; r = sysctlnametomib("machdep.memmap.Unusable", mib_unusable, &mib_unusable_len); if (-1 == r) { mib_reserved_len = 0; return; } mib_other_len = CTL_MAXNAME; r = sysctlnametomib("machdep.memmap.Other", mib_other, &mib_other_len); if (-1 == r) { mib_reserved_len = 0; return; } } if (mib_reserved_len > 0 && mib_unusable_len > 0 && mib_other_len > 0) { uint64_t reserved = 0, unusable = 0, other = 0; size_t reserved_len; size_t unusable_len; size_t other_len; reserved_len = sizeof(reserved); unusable_len = sizeof(unusable); other_len = sizeof(other); /* These are all declared as QUAD/uint64_t sysctls in the kernel. */ if (-1 == sysctl(mib_reserved, mib_reserved_len, &reserved, &reserved_len, nullptr, 0)) { return; } if (-1 == sysctl(mib_unusable, mib_unusable_len, &unusable, &unusable_len, nullptr, 0)) { return; } if (-1 == sysctl(mib_other, mib_other_len, &other, &other_len, nullptr, 0)) { return; } if (reserved_len == sizeof(reserved) && unusable_len == sizeof(unusable) && other_len == sizeof(other)) { uint64_t stolen = reserved + unusable + other; uint64_t mb128 = 128 * 1024 * 1024ULL; if (stolen >= mb128) { tsamp->pages_stolen = round_down_wired(stolen) / tsamp->pagesize; } } } } /** * libtop_tsamp_update_vm_stats * * taken from apple's top (libtop.c) * Changes for conky: * - remove references to p_* and b_* named variables * - remove reference to seq variable * - libtop_port replaced with mach_host_self() */ static int libtop_tsamp_update_vm_stats(libtop_tsamp_t *tsamp) { kern_return_t kr; mach_msg_type_number_t count = sizeof(tsamp->vm_stat) / sizeof(natural_t); kr = host_statistics64(mach_host_self(), HOST_VM_INFO64, reinterpret_cast(&tsamp->vm_stat), &count); if (kr != KERN_SUCCESS) { return kr; } if (tsamp->pages_stolen > 0) { tsamp->vm_stat.wire_count += tsamp->pages_stolen; } // Check whether we got purgeable memory statistics tsamp->purgeable_is_valid = static_cast( count == (sizeof(tsamp->vm_stat) / sizeof(natural_t))); if (tsamp->purgeable_is_valid == 0u) { tsamp->vm_stat.purgeable_count = 0; tsamp->vm_stat.purges = 0; } return kr; } /* * helper function for update_meminfo() * return physical memory in bytes */ uint64_t get_physical_memory() { int mib[2] = {CTL_HW, HW_MEMSIZE}; int64_t physical_memory = 0; size_t length = sizeof(int64_t); if (sysctl(mib, 2, &physical_memory, &length, nullptr, 0) == -1) { physical_memory = 0; } return physical_memory; } int update_meminfo() { /* XXX See #34 */ vm_size_t page_size = getpagesize(); // get pagesize in bytes unsigned long swap_avail, swap_free; static libtop_tsamp_t *tsamp = nullptr; if (tsamp == nullptr) { tsamp = new libtop_tsamp_t; if (tsamp == nullptr) { return 0; } memset(tsamp, 0, sizeof(libtop_tsamp_t)); tsamp->pagesize = page_size; } /* get physical memory */ uint64_t physical_memory = get_physical_memory() / 1024; info.memmax = physical_memory; /* * get general memory stats * but first update pages stolen count */ update_pages_stolen(tsamp); if (libtop_tsamp_update_vm_stats(tsamp) == KERN_FAILURE) { return 0; } /* * This is actually a tricky part. * * MenuMeters, Activity Monitor and top show different values. * Our code uses top's implementation because: * - it is apple's tool * - professional projects such as osquery follow it * - Activity Monitor seems to be hiding the whole truth (e.g. for being user * friendly) * * STEPS: * - get stolen pages count * Occasionally host_statistics64 doesn't return correct values (see * https://stackoverflow.com/questions/14789672/why-does-host-statistics64-return-inconsistent-results) * We need to get the count of stolen pages and add it to wired pages count. * This is a known bug and apple has implemented the function * update_pages_stolen(). * * - use vm_stat.free_count instead of the sum of wired, active and inactive * Based on * https://stackoverflow.com/questions/63166/how-to-determine-cpu-and-memory-consumption-from-inside-a-process * summing up wired, active and inactive is what we should do BUT, based on * top, this is incorrect. Seems like apple keeps some info "secret"! */ info.mem = physical_memory - (tsamp->vm_stat.free_count * page_size / 1024); /* rest memory related variables */ info.memwithbuffers = info.mem; info.memeasyfree = info.memfree = info.memmax - info.mem; if ((swapmode(&swap_avail, &swap_free)) >= 0) { info.swapmax = swap_avail; info.swap = (swap_avail - swap_free); info.swapfree = swap_free; } else { info.swapmax = 0; info.swap = 0; info.swapfree = 0; } return 0; } #ifdef BUILD_WLAN void update_wlan_stats(struct net_stat *ns) { CWWiFiClient *client = [CWWiFiClient sharedWiFiClient]; CWInterface *interface = [client interfaceWithName:[NSString stringWithUTF8String:ns->dev]]; if (!interface) return; const char *essid = (ns->up) ? [interface ssid].UTF8String : "off/any"; const char *freq = "Unknown"; const char *bitrate = [NSString stringWithFormat:@"%f", [interface transmitRate]].UTF8String; const char *mode = "Unknown"; const char *ap = [interface hardwareAddress].UTF8String; if (essid == nullptr || bitrate == nullptr || ap == nullptr) return; /* * Freq */ switch ([interface wlanChannel].channelBand) { case kCWChannelBand2GHz: freq = "2 GHz"; break; case kCWChannelBand5GHz: freq = "5 GHz"; break; case kCWChannelBandUnknown: default: break; } /* * Mode */ switch ([interface interfaceMode]) { case kCWInterfaceModeStation: mode = "Managed"; break; case kCWInterfaceModeIBSS: mode = "Ad-Hoc"; break; case kCWInterfaceModeHostAP: mode = "Master"; break; case kCWInterfaceModeNone: default: break; } /* * Setup */ memcpy(ns->essid, essid, sizeof(char)*strlen(essid)); ns->channel = interface.wlanChannel.channelNumber; memcpy(ns->freq, freq, sizeof(char)*strlen(freq)); memcpy(ns->bitrate, bitrate, sizeof(char)*strlen(bitrate)); memcpy(ns->mode, mode, sizeof(char)*strlen(mode)); ns->link_qual = 0; ns->link_qual_max = 0; memcpy(ns->ap, ap, sizeof(char)*strlen(ap)); } #endif /* BUILD_WLAN */ int update_net_stats() { struct net_stat *ns; double delta; long long r, t, last_recv, last_trans; struct ifaddrs *ifap, *ifa; struct if_data *ifd; /* get delta */ delta = current_update_time - last_update_time; if (delta <= 0.0001) { return 0; } if (getifaddrs(&ifap) < 0) { return 0; } for (ifa = ifap; ifa != nullptr; ifa = ifa->ifa_next) { ns = get_net_stat((const char *)ifa->ifa_name, nullptr, nullptr); if ((ifa->ifa_flags & IFF_UP) != 0u) { struct ifaddrs *iftmp; #ifdef BUILD_WLAN update_wlan_stats(ns); #endif ns->up = 1; last_recv = ns->recv; last_trans = ns->trans; if (ifa->ifa_addr->sa_family != AF_LINK) { continue; } for (iftmp = ifa->ifa_next; iftmp != nullptr && strcmp(ifa->ifa_name, iftmp->ifa_name) == 0; iftmp = iftmp->ifa_next) { if (iftmp->ifa_addr->sa_family == AF_INET) { memcpy(&(ns->addr), iftmp->ifa_addr, iftmp->ifa_addr->sa_len); } } ifd = static_cast(ifa->ifa_data); r = ifd->ifi_ibytes; t = ifd->ifi_obytes; if (r < ns->last_read_recv) { ns->recv += (static_cast(4294967295U) - ns->last_read_recv) + r; } else { ns->recv += (r - ns->last_read_recv); } ns->last_read_recv = r; if (t < ns->last_read_trans) { ns->trans += (static_cast(4294967295U) - ns->last_read_trans) + t; } else { ns->trans += (t - ns->last_read_trans); } ns->last_read_trans = t; /* calculate speeds */ ns->recv_speed = (ns->recv - last_recv) / delta; ns->trans_speed = (ns->trans - last_trans) / delta; } else { ns->up = 0; } } freeifaddrs(ifap); return 0; } int update_threads() { helper_update_threads_processes(); return 0; } /* * XXX This seems to be wrong... We must first find the threads (using * thread_info() ) * * Get list of all processes. * Foreach process check its state. * If it is RUNNING it means that it actually has some threads * that are in TH_STATE_RUNNING. * Foreach pid and foreach pid's threads check their state and increment * the run_threads counter accordingly. */ int update_running_threads() { struct kinfo_proc *p = nullptr; int proc_count = 0; int run_threads = 0; proc_count = helper_get_proc_list(&p); if (proc_count == -1) { return 0; } for (int i = 0; i < proc_count; i++) { if ((p[i].kp_proc.p_stat & SRUN) != 0) { pid_t pid = 0; struct proc_taskinfo pti {}; struct proc_threadinfo pthi {}; int num_threads = 0; pid = p[i].kp_proc.p_pid; /* get total number of threads this pid has */ if (sizeof(pti) == proc_pidinfo(pid, PROC_PIDTASKINFO, 0, &pti, sizeof(pti))) { num_threads = pti.pti_threadnum; } else { continue; } /* foreach thread check its state */ for (int i = 0; i < num_threads; i++) { if (sizeof(pthi) == proc_pidinfo(pid, PROC_PIDTHREADINFO, i, &pthi, sizeof(pthi))) { if (pthi.pth_run_state == TH_STATE_RUNNING) { run_threads++; } } else { continue; } } } } free(p); info.run_threads = run_threads; return 0; } int update_total_processes() { helper_update_threads_processes(); return 0; /* * WARNING: You may stumble upon this implementation: * https://stackoverflow.com/questions/8141913/is-there-a-lightweight-way-to-obtain-the-current-number-of-processes-in-linux * * This method DOESN'T find the correct number of tasks. * * This is probably (??) because on macOS there is no option for * KERN_PROC_KTHREAD like there is in FreeBSD * * In FreeBSD's sysctl.h we can see the following: * * KERN_PROC_KTHREAD all processes (user-level plus kernel threads) * KERN_PROC_ALL all user-level processes * KERN_PROC_PID processes with process ID arg * KERN_PROC_PGRP processes with process group arg * KERN_PROC_SESSION processes with session arg * KERN_PROC_TTY processes with tty(4) arg * KERN_PROC_UID processes with effective user ID arg * KERN_PROC_RUID processes with real user ID arg * * Though in macOS's sysctl.h there are only: * * KERN_PROC_ALL everything * KERN_PROC_PID by process id * KERN_PROC_PGRP by process group id * KERN_PROC_SESSION by session of pid * KERN_PROC_TTY by controlling tty * KERN_PROC_UID by effective uid * KERN_PROC_RUID by real uid * KERN_PROC_LCID by login context id * * Probably by saying "everything" they mean that KERN_PROC_ALL gives all * processes (user-level plus kernel threads) ( So basically this is the * problem with the old implementation ) */ } int update_running_processes() { struct kinfo_proc *p = nullptr; int proc_count = 0; int run_procs = 0; proc_count = helper_get_proc_list(&p); if (proc_count == -1) { return 0; } for (int i = 0; i < proc_count; i++) { int state = p[i].kp_proc.p_stat; if (state == SRUN) { // XXX this check needs to be fixed... run_procs++; } } free(p); info.run_procs = run_procs; return 0; } /* * get_cpu_count * * The macOS implementation gets the number of active cpus * in compliance with linux implementation. */ void get_cpu_count() { int cpu_count = 0; if (GETSYSCTL("hw.activecpu", cpu_count) == 0) { info.cpu_count = cpu_count; } else { fprintf(stderr, "Cannot get hw.activecpu\n"); info.cpu_count = 0; } if (info.cpu_usage == nullptr) { /* * Allocate ncpus+1 slots because cpu_usage[0] is overall usage. */ info.cpu_usage = static_cast(malloc((info.cpu_count + 1) * sizeof(float))); if (info.cpu_usage == nullptr) { CRIT_ERR(nullptr, nullptr, "malloc"); } } } /* * used by update_cpu_usage() */ struct cpu_info { long oldtotal; long oldused; }; int update_cpu_usage() { static bool cpu_setup = 0; long used, total; static struct cpu_info *cpu = nullptr; unsigned int malloc_cpu_size = 0; extern void *global_cpu; static struct cpusample *sample = nullptr; static pthread_mutex_t last_stat_update_mutex = PTHREAD_MUTEX_INITIALIZER; static double last_stat_update = 0.0; /* since we use wrappers for this function, the update machinery * can't eliminate double invocations of this function. Check for * them here, otherwise cpu_usage counters are freaking out. */ pthread_mutex_lock(&last_stat_update_mutex); if (last_stat_update == current_update_time) { pthread_mutex_unlock(&last_stat_update_mutex); return 0; } last_stat_update = current_update_time; pthread_mutex_unlock(&last_stat_update_mutex); /* add check for !info.cpu_usage since that mem is freed on a SIGUSR1 */ if ((static_cast(cpu_setup) == 0) || (info.cpu_usage == nullptr)) { get_cpu_count(); cpu_setup = 1; } if (global_cpu == nullptr) { /* * Allocate ncpus+1 slots because cpu_usage[0] is overall usage. */ malloc_cpu_size = (info.cpu_count + 1) * sizeof(struct cpu_info); cpu = static_cast(malloc(malloc_cpu_size)); memset(cpu, 0, malloc_cpu_size); global_cpu = cpu; } allocate_cpu_sample(&sample); get_cpu_sample(&sample); /* * Setup conky's structs for-each core */ for (unsigned int i = 1; i < info.cpu_count + 1; i++) { unsigned int j = i - 1; total = sample[i].totalUserTime + sample[i].totalIdleTime + sample[i].totalSystemTime; used = total - sample[i].totalIdleTime; if ((total - cpu[j].oldtotal) != 0) { info.cpu_usage[j] = (static_cast(used - cpu[j].oldused)) / static_cast(total - cpu[j].oldtotal); } else { info.cpu_usage[j] = 0; } cpu[j].oldused = used; cpu[j].oldtotal = total; } return 0; } int update_load_average() { double v[3]; getloadavg(v, 3); info.loadavg[0] = v[0]; info.loadavg[1] = v[1]; info.loadavg[2] = v[2]; return 0; } double get_acpi_temperature(int /*fd*/) { printf("get_acpi_temperature: STUB\n"); return 0.0; } void get_battery_stuff(char * /*buf*/, unsigned int /*n*/, const char * /*bat*/, int /*item*/) { printf("get_battery_stuff: STUB\n"); } int get_battery_perct(const char * /*bat*/) { printf("get_battery_perct: STUB\n"); return 1; } double get_battery_perct_bar(struct text_object * /*obj*/) { printf("get_battery_perct_bar: STUB\n"); return 0.0; } int open_acpi_temperature(const char *name) { printf("open_acpi_temperature: STUB\n"); (void)name; /* Not applicable for FreeBSD. */ return 0; } void get_acpi_ac_adapter(char * /*p_client_buffer*/, size_t /*client_buffer_size*/, const char * /*adapter*/) { printf("get_acpi_ac_adapter: STUB\n"); } void get_acpi_fan(char * /*p_client_buffer*/, size_t /*client_buffer_size*/) { printf("get_acpi_fan: STUB\n"); } /* void */ char get_freq(char *p_client_buffer, size_t client_buffer_size, const char *p_format, int divisor, unsigned int cpu) { (void)cpu; if ((p_client_buffer == nullptr) || client_buffer_size <= 0 || (p_format == nullptr) || divisor <= 0) { return 0; } #ifdef BUILD_IPGFREQ /* * Our data is always the same for every core, so ignore |cpu| argument. */ static bool initialised = false; if (!initialised) { IntelEnergyLibInitialize(); initialised = true; } int freq = 0; GetIAFrequency(cpu, &freq); snprintf(p_client_buffer, client_buffer_size, p_format, static_cast(freq) / divisor); #else /* * We get the factory cpu frequency, not **current** cpu frequency * (Also, it is always the same for every core, so ignore |cpu| argument) * Enable BUILD_IPGFREQ for getting current frequency. */ int mib[2]; unsigned int freq; size_t len; mib[0] = CTL_HW; mib[1] = HW_CPU_FREQ; len = sizeof(freq); if (sysctl(mib, 2, &freq, &len, nullptr, 0) == 0) { /* * convert to MHz */ divisor *= 1000000; snprintf(p_client_buffer, client_buffer_size, p_format, static_cast(freq) / divisor); } else { snprintf(p_client_buffer, client_buffer_size, p_format, 0.0f); return 0; } #endif return 1; } int update_diskio() { printf("update_diskio: STUB\n"); return 0; } void get_battery_short_status(char * /*buffer*/, unsigned int /*n*/, const char * /*bat*/) { printf("get_battery_short_status: STUB\n"); } int get_entropy_avail(const unsigned int *val) { (void)val; return 1; } int get_entropy_poolsize(const unsigned int *val) { (void)val; return 1; } /****************************************** * get top info section * ******************************************/ /* * Calculate a process' cpu usage percentage */ static void calc_cpu_usage_for_proc(struct process *proc, uint64_t total) { float mul = 100.0; if (top_cpu_separate.get(*state)) { mul *= info.cpu_count; } proc->amount = mul * (proc->user_time + proc->kernel_time) / static_cast(total); } /* * calculate total CPU usage based on total CPU usage * of previous iteration stored inside |process| struct */ static void calc_cpu_total(struct process *proc, uint64_t *total) { uint64_t current_total = 0; /* of current iteration */ struct cpusample *sample = nullptr; allocate_cpu_sample(&sample); get_cpu_sample(&sample); current_total = sample[0].totalUserTime + sample[0].totalIdleTime + sample[0].totalSystemTime; *total = current_total - proc->previous_total_cpu_time; proc->previous_total_cpu_time = current_total; *total = ((*total / sysconf(_SC_CLK_TCK)) * 100) / info.cpu_count; } /* * calc_cpu_time_for_proc * * calculates user_time and kernel_time and sets the contents of the |process| * struct excessively based on process_parse_stat() from linux.cc */ static void calc_cpu_time_for_proc(struct process *process, const struct proc_taskinfo *pti) { unsigned long long user_time = 0; unsigned long long kernel_time = 0; process->user_time = pti->pti_total_user; process->kernel_time = pti->pti_total_system; /* user_time and kernel_time are in nanoseconds, total_cpu_time in * centiseconds. Therefore we divide by 10^7 . */ process->user_time /= 10000000; process->kernel_time /= 10000000; process->total_cpu_time = process->user_time + process->kernel_time; if (process->previous_user_time == ULONG_MAX) { process->previous_user_time = process->user_time; } if (process->previous_kernel_time == ULONG_MAX) { process->previous_kernel_time = process->kernel_time; } /* store the difference of the user_time */ user_time = process->user_time - process->previous_user_time; kernel_time = process->kernel_time - process->previous_kernel_time; /* backup the process->user_time for next time around */ process->previous_user_time = process->user_time; process->previous_kernel_time = process->kernel_time; /* store only the difference of the user_time here... */ process->user_time = user_time; process->kernel_time = kernel_time; } /* * finds top-information only for one process which is represented by a * kinfo_proc struct this function is called multiple types ( one foreach * process ) to implement get_top_info() */ static void get_top_info_for_kinfo_proc(struct kinfo_proc *p) { struct process *proc = nullptr; struct proc_taskinfo pti {}; pid_t pid; pid = p->kp_proc.p_pid; proc = get_process(pid); free_and_zero(proc->name); free_and_zero(proc->basename); proc->name = strndup(p->kp_proc.p_comm, text_buffer_size.get(*state)); proc->basename = strndup(p->kp_proc.p_comm, text_buffer_size.get(*state)); proc->uid = p->kp_eproc.e_pcred.p_ruid; proc->time_stamp = g_time; if (sizeof(pti) == proc_pidinfo(pid, PROC_PIDTASKINFO, 0, &pti, sizeof(pti))) { /* vsize, rss are in bytes thus we dont have to convert */ proc->vsize = pti.pti_virtual_size; proc->rss = pti.pti_resident_size; __block uint64_t t = 0; __block bool calc_cpu_total_finished = false; __block bool calc_proc_total_finished = false; dispatch_async( dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ /* calc CPU time for process */ calc_cpu_time_for_proc(proc, &pti); calc_proc_total_finished = true; }); dispatch_async( dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ /* calc total CPU time (considering current process) */ calc_cpu_total(proc, &t); calc_cpu_total_finished = true; }); /* * wait until done */ while (!(calc_cpu_total_finished && calc_proc_total_finished)) { usleep(500); } /* calc the amount(%) of CPU the process used */ calc_cpu_usage_for_proc(proc, t); } } /* While topless is obviously better, top is also not bad. */ void get_top_info() { int proc_count = 0; struct kinfo_proc *p = nullptr; /* * See #16 */ get_cpu_count(); /* * get processes count * and create the processes list */ proc_count = helper_get_proc_list(&p); if (proc_count == -1) { return; } /* * get top info for-each process */ for (int i = 0; i < proc_count; i++) { if ((((p[i].kp_proc.p_flag & P_SYSTEM)) == 0) && *p[i].kp_proc.p_comm != '\0') { get_top_info_for_kinfo_proc(&p[i]); } } free(p); } /********************************************************************************************* * System Integrity Protection * *********************************************************************************************/ #if (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_9) /* * Check if a flag is enabled based on the csr_config variable * Also, flip the result on occasion */ bool _csr_check(int aMask, bool aFlipflag) { bool bit = (info.csr_config & aMask) != 0u; if (aFlipflag) { return !bit; } return bit; } /* * Extract info from the csr_config variable and set the flags struct */ void fill_csr_config_flags_struct() { info.csr_config_flags.csr_allow_apple_internal = _csr_check(CSR_ALLOW_APPLE_INTERNAL, 0); info.csr_config_flags.csr_allow_untrusted_kexts = _csr_check(CSR_ALLOW_UNTRUSTED_KEXTS, 1); info.csr_config_flags.csr_allow_task_for_pid = _csr_check(CSR_ALLOW_TASK_FOR_PID, 1); info.csr_config_flags.csr_allow_unrestricted_fs = _csr_check(CSR_ALLOW_UNRESTRICTED_FS, 1); info.csr_config_flags.csr_allow_kernel_debugger = _csr_check(CSR_ALLOW_KERNEL_DEBUGGER, 1); info.csr_config_flags.csr_allow_unrestricted_dtrace = _csr_check(CSR_ALLOW_UNRESTRICTED_DTRACE, 1); info.csr_config_flags.csr_allow_unrestricted_nvram = _csr_check(CSR_ALLOW_UNRESTRICTED_NVRAM, 1); info.csr_config_flags.csr_allow_device_configuration = _csr_check(CSR_ALLOW_DEVICE_CONFIGURATION, 0); info.csr_config_flags.csr_allow_any_recovery_os = _csr_check(CSR_ALLOW_ANY_RECOVERY_OS, 1); info.csr_config_flags.csr_allow_user_approved_kexts = _csr_check(CSR_ALLOW_UNAPPROVED_KEXTS, 1); } /* * Get SIP configuration ( sets csr_config and csr_config_flags ) */ int get_sip_status() { if (csr_get_active_config == nullptr) /* check if weakly linked symbol exists */ { NORM_ERR("$sip_status will not work on this version of macOS\n"); return 0; } csr_get_active_config(&info.csr_config); fill_csr_config_flags_struct(); return 0; } /* * Prints SIP status or a specific SIP feature status depending on the argument * passed to $sip_status command * * Variables that can be passed to $sip_status command * * nothing --> print enabled / disabled * 0 --> apple internal * 1 --> forbid untrusted kexts * 2 --> forbid task-for-pid * 3 --> restrict filesystem * 4 --> forbid kernel-debugger * 5 --> restrict dtrace * 6 --> restrict nvram * 7 --> forbid device-configuration * 8 --> forbid any-recovery-os * 9 --> forbid user-approved-kexts * a --> check if unsupported configuration ---> this is not an apple SIP * flag. This is for us. * * The print function is designed to show 'YES' if a specific protection * measure is ENABLED. For example, if SIP is configured to disallow untrusted * kexts, then our function will print 'YES'. * * For this reason, your conkyrc should say for example: Untrusted Kexts * Protection: ${sip_status 1} You should not write: "Allow Untrusted Kexts", * this is wrong. */ void print_sip_status(struct text_object *obj, char *p, unsigned int p_max_size) { if (csr_get_active_config == nullptr) /* check if weakly linked symbol exists */ { snprintf(p, p_max_size, "%s", "unsupported"); NORM_ERR("$sip_status will not work on this version of macOS\n"); return; } /* conky window output */ (void)obj; if (obj->data.s == nullptr) { return; } if (strlen(obj->data.s) == 0) { snprintf(p, p_max_size, "%s", (info.csr_config == CSR_VALID_FLAGS) ? "disabled" : "enabled"); } else if (strlen(obj->data.s) == 1) { switch (obj->data.s[0]) { case '0': snprintf(p, p_max_size, "%s", info.csr_config_flags.csr_allow_apple_internal ? "YES" : "NO"); break; case '1': snprintf( p, p_max_size, "%s", info.csr_config_flags.csr_allow_untrusted_kexts ? "YES" : "NO"); break; case '2': snprintf(p, p_max_size, "%s", info.csr_config_flags.csr_allow_task_for_pid ? "YES" : "NO"); break; case '3': snprintf( p, p_max_size, "%s", info.csr_config_flags.csr_allow_unrestricted_fs ? "YES" : "NO"); break; case '4': snprintf( p, p_max_size, "%s", info.csr_config_flags.csr_allow_kernel_debugger ? "YES" : "NO"); break; case '5': snprintf( p, p_max_size, "%s", info.csr_config_flags.csr_allow_unrestricted_dtrace ? "YES" : "NO"); break; case '6': snprintf( p, p_max_size, "%s", info.csr_config_flags.csr_allow_unrestricted_nvram ? "YES" : "NO"); break; case '7': snprintf(p, p_max_size, "%s", info.csr_config_flags.csr_allow_device_configuration ? "YES" : "NO"); break; case '8': snprintf( p, p_max_size, "%s", info.csr_config_flags.csr_allow_any_recovery_os ? "YES" : "NO"); break; case '9': snprintf( p, p_max_size, "%s", info.csr_config_flags.csr_allow_user_approved_kexts ? "YES" : "NO"); break; case 'a': snprintf(p, p_max_size, "%s", ((info.csr_config != 0u) && (info.csr_config != CSR_ALLOW_APPLE_INTERNAL)) ? "unsupported configuration, beware!" : "configuration is ok"); break; default: snprintf(p, p_max_size, "%s", "unsupported"); NORM_ERR( "print_sip_status: unsupported argument passed to $sip_status"); break; } } else { /* bad argument */ snprintf(p, p_max_size, "%s", "unsupported"); NORM_ERR("print_sip_status: unsupported argument passed to $sip_status"); } } #else /* Mavericks and before */ /* * Versions prior to Yosemite DONT EVEN DEFINE csr_get_active_config() * function. Thus we must avoid calling this function! */ int get_sip_status(void) { /* Does not do anything intentionally */ return 0; } void print_sip_status(struct text_object *obj, char *p, int p_max_size) { /* conky window output */ (void)obj; if (!obj->data.s) return; if (strlen(obj->data.s) == 0) { snprintf(p, p_max_size, "%s", "error unsupported"); } else if (strlen(obj->data.s) == 1) { switch (obj->data.s[0]) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'a': snprintf(p, p_max_size, "%s", "error unsupported"); break; default: snprintf(p, p_max_size, "%s", "unsupported"); NORM_ERR( "print_sip_status: unsupported argument passed to $sip_status"); break; } } else { /* bad argument */ snprintf(p, p_max_size, "%s", "unsupported"); NORM_ERR("print_sip_status: unsupported argument passed to $sip_status"); } } #endif conky-1.12.2/src/darwin_sip.h000066400000000000000000000045021404127277500160310ustar00rootroot00000000000000/* * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2018-2019, npyl * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ // // Defines for System Integrity Protection monitoring // based on csrstat tool by Pike R. Alpha. // https://github.com/Piker-Alpha/csrstat // #ifndef DARWIN_SIP_H #define DARWIN_SIP_H /* Rootless configuration flags */ #define CSR_ALLOW_UNTRUSTED_KEXTS (1 << 0) // 1 #define CSR_ALLOW_UNRESTRICTED_FS (1 << 1) // 2 #define CSR_ALLOW_TASK_FOR_PID (1 << 2) // 4 #define CSR_ALLOW_KERNEL_DEBUGGER (1 << 3) // 8 #define CSR_ALLOW_APPLE_INTERNAL (1 << 4) // 16 #define CSR_ALLOW_UNRESTRICTED_DTRACE (1 << 5) // 32 #define CSR_ALLOW_UNRESTRICTED_NVRAM (1 << 6) // 64 #define CSR_ALLOW_DEVICE_CONFIGURATION (1 << 7) // 128 #define CSR_ALLOW_ANY_RECOVERY_OS (1 << 8) // 256 #define CSR_ALLOW_UNAPPROVED_KEXTS (1 << 9) // 512 #define CSR_VALID_FLAGS \ (CSR_ALLOW_UNTRUSTED_KEXTS | CSR_ALLOW_UNRESTRICTED_FS | \ CSR_ALLOW_TASK_FOR_PID | CSR_ALLOW_KERNEL_DEBUGGER | \ CSR_ALLOW_APPLE_INTERNAL | CSR_ALLOW_UNRESTRICTED_DTRACE | \ CSR_ALLOW_UNRESTRICTED_NVRAM | CSR_ALLOW_DEVICE_CONFIGURATION | \ CSR_ALLOW_ANY_RECOVERY_OS | CSR_ALLOW_UNAPPROVED_KEXTS) /* Syscalls */ // mark these symbols as weakly linked, as they may not be available // at runtime on older OS X versions. extern "C" { int csr_get_active_config(information::csr_config_t* config) __attribute__((weak_import)); }; #endif conky-1.12.2/src/data-source.cc000066400000000000000000000121111404127277500162320ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (C) 2010 Pavel Labath et al. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include "data-source.hh" #include #include #include namespace conky { namespace { /* * Returned when there is no data available. * An alternative would be to throw an exception, but if we don't want to react * too aggressively when the user e.g. uses a nonexisting variable, then * returning NaN will do just fine. */ float NaN = std::numeric_limits::quiet_NaN(); typedef std::unordered_map data_sources_t; /* * We cannot construct this object statically, because order of object * construction in different modules is not defined, so register_source could be * called before this object is constructed. Therefore, we create it on the * first call to register_source. */ data_sources_t *data_sources; data_source_base &get_data_source(lua::state *l) { if (l->gettop() != 1) { throw std::runtime_error("Wrong number of parameters"); } l->rawgetfield(lua::REGISTRYINDEX, priv::data_source_metatable); if (!l->getmetatable(-2) || !l->rawequal(-1, -2)) { throw std::runtime_error("Invalid parameter"); } return *static_cast(l->touserdata(1)); } int data_source_asnumber(lua::state *l) { double x = get_data_source(l).get_number(); l->pushnumber(x); return 1; } int data_source_astext(lua::state *l) { std::string x = get_data_source(l).get_text(); l->pushstring(x); return 1; } const char data_source__index[] = "local table, key = ...;\n" "if key == 'num' then\n" " return conky.asnumber(table);\n" "elseif key == 'text' then\n" " return conky.astext(table);\n" "else\n" " print(string.format([[Invalid data source operation: '%s']], key));\n" " return 0/0;\n" "end\n"; } // namespace namespace priv { void do_register_data_source(const std::string &name, const lua::cpp_function &fn) { struct data_source_constructor { data_source_constructor() { data_sources = new data_sources_t(); } ~data_source_constructor() { delete data_sources; data_sources = nullptr; } }; static data_source_constructor constructor; bool inserted = data_sources->insert({name, fn}).second; if (!inserted) { throw std::logic_error("Data source with name '" + name + "' already registered"); } } disabled_data_source::disabled_data_source(lua::state *l, const std::string &name, const std::string &setting) : simple_numeric_source(l, name, &NaN) { // XXX some generic way of reporting errors? NORM_ERR? std::cerr << "Support for variable '" << name << "' has been disabled during compilation. Please recompile with '" << setting << "'" << std::endl; } } // namespace priv double data_source_base::get_number() const { return NaN; } std::string data_source_base::get_text() const { std::ostringstream s; s << get_number(); return s.str(); } register_disabled_data_source::register_disabled_data_source( const std::string &name, const std::string &setting) : register_data_source(name, setting) {} // at least one data source should always be registered, so data_sources will // not be null void export_data_sources(lua::state &l) { lua::stack_sentry s(l); l.checkstack(2); l.newmetatable(priv::data_source_metatable); { l.pushboolean(false); l.rawsetfield(-2, "__metatable"); l.pushdestructor(); l.rawsetfield(-2, "__gc"); l.loadstring(data_source__index); l.rawsetfield(-2, "__index"); } l.pop(); l.newtable(); { for (auto &data_source : *data_sources) { l.pushfunction(data_source.second); l.rawsetfield(-2, data_source.first.c_str()); } } l.rawsetfield(-2, "variables"); l.pushfunction(data_source_asnumber); l.rawsetfield(-2, "asnumber"); l.pushfunction(data_source_astext); l.rawsetfield(-2, "astext"); } } // namespace conky /////////// example data sources, remove after real data sources are available ////////// int asdf_ = 47; conky::register_data_source> asdf("asdf", &asdf_); conky::register_disabled_data_source zxcv("zxcv", "BUILD_ZXCV"); conky-1.12.2/src/data-source.hh000066400000000000000000000105761404127277500162610ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (C) 2010 Pavel Labath et al. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef DATA_SOURCE_HH #define DATA_SOURCE_HH #include #include #include #include "luamm.hh" namespace conky { /* * A base class for all data sources. * API consists of two functions: * - get_number should return numeric representation of the data (if available). * This can then be used when drawing graphs, bars, ... The default * implementation returns NaN. * - get_text should return textual representation of the data. This is used * when simple displaying the value of the data source. The default * implementation converts get_number() to a string, but you can override to * return anything (e.g. add units) */ class data_source_base { public: const std::string name; explicit data_source_base(const std::string &name_) : name(name_) {} virtual ~data_source_base() {} virtual double get_number() const; virtual std::string get_text() const; }; /* * A simple data source that returns the value of some variable. It ignores the * lua table. The source variable can be specified as a fixed parameter to the * register_data_source constructor, or one can create a subclass and then set * the source from the subclass constructor. */ template class simple_numeric_source : public data_source_base { static_assert(std::is_convertible::value, "T must be convertible to double"); const T *source; public: simple_numeric_source(lua::state *, const std::string &name_, const T *source_) : data_source_base(name_), source(source_) {} virtual double get_number() const { return *source; } }; /* * This is a part of the implementation, but it cannot be in .cc file because * the template functions below call it */ namespace priv { const char data_source_metatable[] = "conky::data_source_metatable"; void do_register_data_source(const std::string &name, const lua::cpp_function &fn); class disabled_data_source : public simple_numeric_source { public: disabled_data_source(lua::state *l, const std::string &name, const std::string &setting); }; } // namespace priv /* * Declaring an object of this type at global scope will register a data source * with the given name. Any additional parameters are passed on to the data * source constructor. */ template class register_data_source { template static int factory(lua::state *l, const std::string &name, const Args &...args) { T *t = static_cast(l->newuserdata(sizeof(T))); l->insert(1); new (t) T(l, name, args...); l->settop(1); l->rawgetfield(lua::REGISTRYINDEX, priv::data_source_metatable); l->setmetatable(-2); return 1; } public: template explicit register_data_source(const std::string &name, Args &&...args) { priv::do_register_data_source( name, std::bind(&factory, std::placeholders::_1, name, args...)); } }; /* * Use this to declare a data source that has been disabled during compilation. * We can then print a nice error message telling the used which setting to * enable. */ class register_disabled_data_source : public register_data_source { public: register_disabled_data_source(const std::string &name, const std::string &setting); }; /* * It expects to have a table at the top of lua stack. It then exports all the * data sources into that table (actually, into a "variables" subtable). */ void export_data_sources(lua::state &l); } // namespace conky #endif /* DATA_SOURCE_HH */ conky-1.12.2/src/diskio.cc000066400000000000000000000162741404127277500153230ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "diskio.h" #include #include #include #include "common.h" #include "config.h" #include "conky.h" /* text_buffer_size */ #include "core.h" #include "logging.h" #include "specials.h" #include "text_object.h" /* this is the root of all per disk stats, * also containing the totals. */ struct diskio_stat stats; void clear_diskio_stats() { struct diskio_stat *cur; while (stats.next != nullptr) { cur = stats.next; stats.next = stats.next->next; free_and_zero(cur->dev); free(cur); } } struct diskio_stat *prepare_diskio_stat(const char *s) { struct stat sb {}; std::vector stat_name(text_buffer_size.get(*state)), device_name(text_buffer_size.get(*state)), device_s(text_buffer_size.get(*state)); struct diskio_stat *cur = &stats; char *rpbuf; char rpbuf2[256]; if (s == nullptr) { return &stats; } if (strncmp(s, "label:", 6) == 0) { snprintf(&(device_name[0]), text_buffer_size.get(*state), "/dev/disk/by-label/%s", s + 6); rpbuf = realpath(&(device_name[0]), nullptr); } else if (0 == (strncmp(s, "partuuid:", 9))) { snprintf(&(device_name[0]), text_buffer_size.get(*state), "/dev/disk/by-partuuid/%s", s + 9); rpbuf = realpath(&device_name[0], nullptr); snprintf(rpbuf2, 255, "%s", rpbuf); } else { rpbuf = realpath(s, nullptr); } if (rpbuf != nullptr) { strncpy(&device_s[0], rpbuf, text_buffer_size.get(*state)); free(rpbuf); } else { strncpy(&device_s[0], s, text_buffer_size.get(*state)); } #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__linux__) if (strncmp(&device_s[0], "/dev/", 5) == 0) { device_s.erase(device_s.begin(), device_s.begin() + 5); } #endif strncpy(&(device_name[0]), &device_s[0], text_buffer_size.get(*state)); #if !defined(__sun) /* * On Solaris we currently don't use the name of disk's special file so * this test is useless. */ if (strncmp(s, "label:", 6) == 0) { snprintf(&(stat_name[0]), text_buffer_size.get(*state), "/dev/%s", &(device_name[0])); if ((stat(&(stat_name[0]), &sb) != 0) || !S_ISBLK(sb.st_mode)) { NORM_ERR("diskio device '%s' does not exist", &device_s[0]); } } else if ((0 == (strncmp(s, "partuuid:", 9))) && ((stat(rpbuf2, &sb) != 0) || !S_ISBLK(sb.st_mode))) { NORM_ERR("diskio device '%s' does not exist", &device_s[0]); } #endif /* lookup existing */ while (cur->next != nullptr) { cur = cur->next; if (strcmp(cur->dev, &(device_name[0])) == 0) { return cur; } } /* no existing found, make a new one */ cur->next = new diskio_stat; cur = cur->next; cur->dev = strndup(&(device_s[0]), text_buffer_size.get(*state)); cur->last = UINT_MAX; cur->last_read = UINT_MAX; cur->last_write = UINT_MAX; return cur; } void parse_diskio_arg(struct text_object *obj, const char *arg) { obj->data.opaque = prepare_diskio_stat(arg); } /* dir indicates the direction: * -1: read * 0: read + write * 1: write */ static void print_diskio_dir(struct text_object *obj, int dir, char *p, unsigned int p_max_size) { auto *diskio = static_cast(obj->data.opaque); double val; if (diskio == nullptr) { return; } if (dir < 0) { val = diskio->current_read; } else if (dir == 0) { val = diskio->current; } else { val = diskio->current_write; } /* TODO: move this correction from kB to kB/s elsewhere * (or get rid of it??) */ human_readable((val / active_update_interval()) * 1024LL, p, p_max_size); } void print_diskio(struct text_object *obj, char *p, unsigned int p_max_size) { print_diskio_dir(obj, 0, p, p_max_size); } void print_diskio_read(struct text_object *obj, char *p, unsigned int p_max_size) { print_diskio_dir(obj, -1, p, p_max_size); } void print_diskio_write(struct text_object *obj, char *p, unsigned int p_max_size) { print_diskio_dir(obj, 1, p, p_max_size); } #ifdef BUILD_X11 void parse_diskiograph_arg(struct text_object *obj, const char *arg) { char *buf = nullptr; buf = scan_graph(obj, arg, 0); obj->data.opaque = prepare_diskio_stat(dev_name(buf)); free_and_zero(buf); } double diskiographval(struct text_object *obj) { auto *diskio = static_cast(obj->data.opaque); return (diskio != nullptr ? diskio->current : 0); } double diskiographval_read(struct text_object *obj) { auto *diskio = static_cast(obj->data.opaque); return (diskio != nullptr ? diskio->current_read : 0); } double diskiographval_write(struct text_object *obj) { auto *diskio = static_cast(obj->data.opaque); return (diskio != nullptr ? diskio->current_write : 0); } #endif /* BUILD_X11 */ void update_diskio_values(struct diskio_stat *ds, unsigned int reads, unsigned int writes) { int i; double sum = 0, sum_r = 0, sum_w = 0; if (reads < ds->last_read || writes < ds->last_write) { /* counter overflow or reset - rebase to sane values */ ds->last = reads + writes; ds->last_read = reads; ds->last_write = writes; } /* since the values in /proc/diskstats are absolute, we have to subtract * our last reading. The numbers stand for "sectors read", and we therefore * have to divide by two to get KB */ ds->sample_read[0] = (reads - ds->last_read) / 2; ds->sample_write[0] = (writes - ds->last_write) / 2; ds->sample[0] = ds->sample_read[0] + ds->sample_write[0]; /* compute averages */ int samples = diskio_avg_samples.get(*state); for (i = 0; i < samples; i++) { sum += ds->sample[i]; sum_r += ds->sample_read[i]; sum_w += ds->sample_write[i]; } ds->current = sum / static_cast(samples); ds->current_read = sum_r / static_cast(samples); ds->current_write = sum_w / static_cast(samples); /* shift sample history */ for (i = samples - 1; i > 0; i--) { ds->sample[i] = ds->sample[i - 1]; ds->sample_read[i] = ds->sample_read[i - 1]; ds->sample_write[i] = ds->sample_write[i - 1]; } /* save last */ ds->last_read = reads; ds->last_write = writes; ds->last = ds->last_read + ds->last_write; } conky-1.12.2/src/diskio.h000066400000000000000000000047041404127277500151600ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef DISKIO_H_ #define DISKIO_H_ #include #include struct diskio_stat { diskio_stat() : next(nullptr), current(0), current_read(0), current_write(0), last(UINT_MAX), last_read(UINT_MAX), last_write(UINT_MAX) { std::memset(sample, 0, sizeof(sample)); std::memset(sample_read, 0, sizeof(sample_read)); std::memset(sample_write, 0, sizeof(sample_write)); } struct diskio_stat *next; char *dev; double sample[15]; double sample_read[15]; double sample_write[15]; double current; double current_read; double current_write; double last; double last_read; double last_write; }; extern struct diskio_stat stats; struct diskio_stat *prepare_diskio_stat(const char *); int update_diskio(void); void clear_diskio_stats(void); void update_diskio_values(struct diskio_stat *, unsigned int, unsigned int); void parse_diskio_arg(struct text_object *, const char *); void print_diskio(struct text_object *, char *, unsigned int); void print_diskio_read(struct text_object *, char *, unsigned int); void print_diskio_write(struct text_object *, char *, unsigned int); #ifdef BUILD_X11 void parse_diskiograph_arg(struct text_object *, const char *); double diskiographval(struct text_object *); double diskiographval_read(struct text_object *); double diskiographval_write(struct text_object *); #endif /* BUILD_X11 */ #endif /* DISKIO_H_ */ conky-1.12.2/src/dragonfly.cc000066400000000000000000000526071404127277500160260ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2011 Andrea Magliano * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "conky.h" #include "diskio.h" #include "dragonfly.h" #include "logging.h" #include "net_stat.h" #include "top.h" #define GETSYSCTL(name, var) getsysctl(name, &(var), sizeof(var)) #define KELVTOC(x) ((x - 2732) / 10.0) #define MAXSHOWDEVS 16 static short cpu_setup = 0; static int getsysctl(const char *name, void *ptr, size_t len) { size_t nlen = len; if (sysctlbyname(name, ptr, &nlen, nullptr, 0) == -1) { fprintf(stderr, "getsysctl(): %s failed '%s'\n", name, strerror(errno)); return -1; } if (nlen != len && errno == ENOMEM) { fprintf(stderr, "getsysctl(): %s failed %zu != %zu\n", name, nlen, len); return -1; } return 0; } static int swapmode(unsigned long *retavail, unsigned long *retfree) { int total, used; size_t len = sizeof(int); if (sysctlbyname("vm.swap_size", &total, &len, nullptr, 0) == -1) perror("vm_swap_usage(): vm.swap_size"); else if (sysctlbyname("vm.swap_anon_use", &used, &len, nullptr, 0) == -1) perror("vm_swap_usage(): vm.swap_anon_use"); else { int size = getpagesize(); #define CONVERT(v) ((quad_t)(v) * (size / 1024)) *retavail = CONVERT(total); *retfree = CONVERT(total - used); return (int)((double)used * 100.0 / (double)total); } return 0; } void prepare_update(void) {} int update_uptime(void) { int mib[2] = {CTL_KERN, KERN_BOOTTIME}; struct timeval boottime; time_t now; size_t size = sizeof(boottime); if ((sysctl(mib, 2, &boottime, &size, nullptr, 0) != -1) && boottime.tv_sec) { time(&now); info.uptime = now - boottime.tv_sec; } else { fprintf(stderr, "Could not get uptime\n"); info.uptime = 0; } return 0; } int check_mount(char *s) { struct statfs *mntbuf; int i, mntsize; mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); for (i = mntsize - 1; i >= 0; i--) { if (strcmp(mntbuf[i].f_mntonname, s) == 0) { return 1; } } return 0; } int update_meminfo(void) { u_int total_pages, inactive_pages, free_pages; unsigned long swap_avail, swap_free; int pagesize = getpagesize(); if (GETSYSCTL("vm.stats.vm.v_page_count", total_pages)) { fprintf(stderr, "Cannot read sysctl \"vm.stats.vm.v_page_count\"\n"); } if (GETSYSCTL("vm.stats.vm.v_free_count", free_pages)) { fprintf(stderr, "Cannot read sysctl \"vm.stats.vm.v_free_count\"\n"); } if (GETSYSCTL("vm.stats.vm.v_inactive_count", inactive_pages)) { fprintf(stderr, "Cannot read sysctl \"vm.stats.vm.v_inactive_count\"\n"); } info.memmax = total_pages * (pagesize >> 10); info.mem = (total_pages - free_pages - inactive_pages) * (pagesize >> 10); info.memeasyfree = info.memfree = info.memmax - info.mem; info.legacymem = info.mem; if ((swapmode(&swap_avail, &swap_free)) >= 0) { info.swapmax = swap_avail; info.swap = (swap_avail - swap_free); info.swapfree = swap_free; } else { info.swapmax = 0; info.swap = 0; info.swapfree = 0; } return 0; } int update_net_stats(void) { struct net_stat *ns; double delta; long long r, t, last_recv, last_trans; struct ifaddrs *ifap, *ifa; struct if_data *ifd; /* get delta */ delta = current_update_time - last_update_time; if (delta <= 0.0001) { return 0; } if (getifaddrs(&ifap) < 0) { return 0; } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { ns = get_net_stat((const char *)ifa->ifa_name, nullptr, NULL); if (ifa->ifa_flags & IFF_UP) { struct ifaddrs *iftmp; ns->up = 1; last_recv = ns->recv; last_trans = ns->trans; if (ifa->ifa_addr->sa_family != AF_LINK) { continue; } for (iftmp = ifa->ifa_next; iftmp != nullptr && strcmp(ifa->ifa_name, iftmp->ifa_name) == 0; iftmp = iftmp->ifa_next) { if (iftmp->ifa_addr->sa_family == AF_INET) { memcpy(&(ns->addr), iftmp->ifa_addr, iftmp->ifa_addr->sa_len); } } ifd = (struct if_data *)ifa->ifa_data; r = ifd->ifi_ibytes; t = ifd->ifi_obytes; if (r < ns->last_read_recv) { ns->recv += ((long long)4294967295U - ns->last_read_recv) + r; } else { ns->recv += (r - ns->last_read_recv); } ns->last_read_recv = r; if (t < ns->last_read_trans) { ns->trans += ((long long)4294967295U - ns->last_read_trans) + t; } else { ns->trans += (t - ns->last_read_trans); } ns->last_read_trans = t; /* calculate speeds */ ns->recv_speed = (ns->recv - last_recv) / delta; ns->trans_speed = (ns->trans - last_trans) / delta; } else { ns->up = 0; } } freeifaddrs(ifap); return 0; } static int kern_proc_all_n() { size_t len = 0; if (sysctlbyname("kern.proc.all_lwp", nullptr, &len, NULL, 0) == -1) { perror("kern.proc.all_lwp"); return -1; } if (len % sizeof(struct kinfo_proc)) { fprintf(stderr, "kern_proc(): " "len %% sizeof(struct kinfo_proc) != 0"); return -1; } return len / sizeof(struct kinfo_proc); } static struct kinfo_proc *kern_proc_all(size_t proc_n) { if (proc_n > 0) { size_t len = proc_n * sizeof(struct kinfo_proc); struct kinfo_proc *kp = (struct kinfo_proc *)malloc(len); if (kp) { if (sysctlbyname("kern.proc.all_lwp", kp, &len, nullptr, 0) == -1) perror("kern_proc(): kern.proc.all_lwp"); else return kp; free(kp); } else perror("malloc"); } return nullptr; } void get_cpu_count(void) { int cpu_count = 0; if (GETSYSCTL("hw.ncpu", cpu_count) == 0) { info.cpu_count = cpu_count; } else { fprintf(stderr, "Cannot get hw.ncpu\n"); info.cpu_count = 0; } info.cpu_usage = (float *)malloc((info.cpu_count + 1) * sizeof(float)); if (info.cpu_usage == nullptr) { CRIT_ERR(nullptr, NULL, "malloc"); } } struct cpu_info { long oldtotal; long oldused; }; PCPU_STATISTICS_FUNC(cputime, struct kinfo_cputime, uint64_t); static void stat_cpu(struct cpu_info *cpu, struct kinfo_cputime *percpu, float *usage) { long int used = (percpu->cp_user + percpu->cp_nice + percpu->cp_sys + percpu->cp_intr), total = used + percpu->cp_idle; *usage = (total - cpu->oldtotal) && cpu->oldtotal ? ((float)(used - cpu->oldused)) / (total - cpu->oldtotal) : 0; cpu->oldused = used; cpu->oldtotal = total; } int update_cpu_usage(void) { static struct cpu_info *cpu = nullptr; extern void *global_cpu; /* add check for !info.cpu_usage since that mem is freed on a SIGUSR1 */ if ((cpu_setup == 0) || (!info.cpu_usage)) { get_cpu_count(); cpu_setup = 1; } if (!global_cpu) { if (!cpu) cpu = (struct cpu_info *)calloc(sizeof(struct cpu_info), info.cpu_count + 1); global_cpu = cpu; } { size_t percpu_n = info.cpu_count * sizeof(struct kinfo_cputime); struct kinfo_cputime *percpu = (struct kinfo_cputime *)malloc( info.cpu_count * sizeof(struct kinfo_cputime)); if (percpu) { if (sysctlbyname("kern.cputime", percpu, &percpu_n, nullptr, 0) == -1 && errno != ENOMEM) { printf("update_cpu_usage(): with %d cpu(s) ", info.cpu_count); perror("kern.cputime"); } else { struct kinfo_cputime total; cputime_pcpu_statistics(&percpu[0], &total, info.cpu_count); { int i; for (i = 0; i < info.cpu_count; i++) stat_cpu(&cpu[i + 1], &percpu[i], &info.cpu_usage[i + 1]); } stat_cpu(&cpu[0], &total, &info.cpu_usage[0]); } free(percpu); } } return 0; } void free_cpu(struct text_object *) { /* no-op */ } int update_load_average(void) { double v[3]; getloadavg(v, 3); info.loadavg[0] = (double)v[0]; info.loadavg[1] = (double)v[1]; info.loadavg[2] = (double)v[2]; return 0; } double get_acpi_temperature(int fd) { int temp; (void)fd; if (GETSYSCTL("hw.acpi.thermal.tz0.temperature", temp)) { fprintf(stderr, "Cannot read sysctl \"hw.acpi.thermal.tz0.temperature\"\n"); return 0.0; } return KELVTOC(temp); } static void get_battery_stats(int *battime, int *batcapacity, int *batstate, int *ac) { if (battime && GETSYSCTL("hw.acpi.battery.time", *battime)) { fprintf(stderr, "Cannot read sysctl \"hw.acpi.battery.time\"\n"); } if (batcapacity && GETSYSCTL("hw.acpi.battery.life", *batcapacity)) { fprintf(stderr, "Cannot read sysctl \"hw.acpi.battery.life\"\n"); } if (batstate && GETSYSCTL("hw.acpi.battery.state", *batstate)) { fprintf(stderr, "Cannot read sysctl \"hw.acpi.battery.state\"\n"); } if (ac && GETSYSCTL("hw.acpi.acline", *ac)) { fprintf(stderr, "Cannot read sysctl \"hw.acpi.acline\"\n"); } } void get_battery_stuff(char *buf, unsigned int n, const char *bat, int item) { int battime, batcapacity, batstate, ac; (void)bat; get_battery_stats(&battime, &batcapacity, &batstate, &ac); if (batstate != 1 && batstate != 2 && batstate != 0 && batstate != 7) fprintf(stderr, "Unknown battery state %d!\n", batstate); else if (batstate != 1 && ac == 0) fprintf(stderr, "Battery charging while not on AC!\n"); else if (batstate == 1 && ac == 1) fprintf(stderr, "Battery discharing while on AC!\n"); switch (item) { case BATTERY_TIME: if (batstate == 1 && battime != -1) snprintf(buf, n, "%d:%2.2d", battime / 60, battime % 60); break; case BATTERY_STATUS: if (batstate == 1) // Discharging snprintf(buf, n, "remaining %d%%", batcapacity); else snprintf(buf, n, batstate == 2 ? "charging (%d%%)" : (batstate == 7 ? "absent/on AC" : "charged (%d%%)"), batcapacity); break; default: fprintf(stderr, "Unknown requested battery stat %d\n", item); } } static int check_bat(const char *bat) { int batnum, numbatts; char *endptr; if (GETSYSCTL("hw.acpi.battery.units", numbatts)) { fprintf(stderr, "Cannot read sysctl \"hw.acpi.battery.units\"\n"); return -1; } if (numbatts <= 0) { fprintf(stderr, "No battery unit detected\n"); return -1; } if (!bat || (batnum = strtol(bat, &endptr, 10)) < 0 || bat == endptr || batnum > numbatts) { fprintf(stderr, "Wrong battery unit %s requested\n", bat ? bat : ""); return -1; } return batnum; } int get_battery_perct(const char *bat) { union acpi_battery_ioctl_arg battio; int batnum, acpifd; int designcap, lastfulcap, batperct; if ((battio.unit = batnum = check_bat(bat)) < 0) return 0; if ((acpifd = open("/dev/acpi", O_RDONLY)) < 0) { fprintf(stderr, "Can't open ACPI device\n"); return 0; } if (ioctl(acpifd, ACPIIO_BATT_GET_BIF, &battio) == -1) { fprintf(stderr, "Unable to get info for battery unit %d\n", batnum); return 0; } close(acpifd); designcap = battio.bif.dcap; lastfulcap = battio.bif.lfcap; batperct = (designcap > 0 && lastfulcap > 0) ? (((float)lastfulcap / designcap) * 100) : 0; return batperct > 100 ? 100 : batperct; } double get_battery_perct_bar(struct text_object *obj) { int batperct = get_battery_perct(obj->data.s); return batperct * 2.56 - 1; } int open_acpi_temperature(const char *name) { (void)name; /* Not applicable for FreeBSD. */ return 0; } void get_acpi_ac_adapter(char *p_client_buffer, size_t client_buffer_size, const char *adapter) { int state; (void)adapter; // only linux uses this if (!p_client_buffer || client_buffer_size <= 0) { return; } if (GETSYSCTL("hw.acpi.acline", state)) { fprintf(stderr, "Cannot read sysctl \"hw.acpi.acline\"\n"); return; } if (state) { strncpy(p_client_buffer, "Running on AC Power", client_buffer_size); } else { strncpy(p_client_buffer, "Running on battery", client_buffer_size); } } void get_acpi_fan(char *p_client_buffer, size_t client_buffer_size) { /* not implemented */ if (p_client_buffer && client_buffer_size > 0) { memset(p_client_buffer, 0, client_buffer_size); } } /* void */ char get_freq(char *p_client_buffer, size_t client_buffer_size, const char *p_format, int divisor, unsigned int cpu) { int64_t freq; if (p_client_buffer && client_buffer_size > 0 && p_format && divisor > 0) { if (GETSYSCTL("hw.tsc_frequency", freq) == 0) { snprintf(p_client_buffer, client_buffer_size, p_format, (float)freq / (divisor * 1000000)); } else { snprintf(p_client_buffer, client_buffer_size, p_format, 0.0f); } return 1; } return 0; } #if 0 void update_wifi_stats(void) { struct ifreq ifr; /* interface stats */ struct wi_req wireq; struct net_stat *ns; struct ifaddrs *ifap, *ifa; struct ifmediareq ifmr; int s; /* Get iface table */ if (getifaddrs(&ifap) < 0) { return; } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { ns = get_net_stat((const char *) ifa->ifa_name, nullptr, NULL); s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); /* Get media type */ bzero(&ifmr, sizeof(ifmr)); strlcpy(ifmr.ifm_name, ifa->ifa_name, IFNAMSIZ); if (ioctl(s, SIOCGIFMEDIA, (caddr_t) &ifmr) < 0) { close(s); return; } /* We can monitor only wireless interfaces * which are not in hostap mode */ if ((ifmr.ifm_active & IFM_IEEE80211) && !(ifmr.ifm_active & IFM_IEEE80211_HOSTAP)) { /* Get wi status */ bzero(&ifr, sizeof(ifr)); strlcpy(ifr.ifr_name, ifa->ifa_name, IFNAMSIZ); wireq.wi_type = WI_RID_COMMS_QUALITY; wireq.wi_len = WI_MAX_DATALEN; ifr.ifr_data = (void *) &wireq; if (ioctl(s, SIOCGWAVELAN, (caddr_t) &ifr) < 0) { perror("ioctl (getting wi status)"); exit(1); } /* wi_val[0] = quality * wi_val[1] = signal * wi_val[2] = noise */ ns->linkstatus = (int) wireq.wi_val[1]; } cleanup: close(s); } } #endif int update_diskio(void) { int devs_count, num_selected, num_selections, dn; struct device_selection *dev_select = nullptr; long select_generation; static struct statinfo statinfo_cur; char device_name[DEFAULT_TEXT_BUFFER_SIZE]; struct diskio_stat *cur; unsigned int reads, writes; unsigned int total_reads = 0, total_writes = 0; memset(&statinfo_cur, 0, sizeof(statinfo_cur)); statinfo_cur.dinfo = (struct devinfo *)calloc(1, sizeof(struct devinfo)); stats.current = stats.current_read = stats.current_write = 0; if (getdevs(&statinfo_cur) < 0) { free(statinfo_cur.dinfo); return 0; } devs_count = statinfo_cur.dinfo->numdevs; if (selectdevs(&dev_select, &num_selected, &num_selections, &select_generation, statinfo_cur.dinfo->generation, statinfo_cur.dinfo->devices, devs_count, nullptr, 0, NULL, 0, DS_SELECT_ONLY, MAXSHOWDEVS, 1) >= 0) { for (dn = 0; dn < devs_count; dn++) { int di; struct devstat *dev; di = dev_select[dn].position; dev = &statinfo_cur.dinfo->devices[di]; snprintf(device_name, DEFAULT_TEXT_BUFFER_SIZE, "%s%d", dev_select[dn].device_name, dev_select[dn].unit_number); total_reads += (reads = dev->bytes_read / 512); total_writes += (writes = dev->bytes_written / 512); for (cur = stats.next; cur; cur = cur->next) { if (cur->dev && !strcmp(device_name, cur->dev)) { update_diskio_values(cur, reads, writes); break; } } } update_diskio_values(&stats, total_reads, total_writes); free(dev_select); } free(statinfo_cur.dinfo); return 0; } static int proc_rusage(struct kinfo_proc *p) { struct kinfo_lwp *lwp = &p->kp_lwp; struct rusage *cru = &p->kp_cru; return (lwp->kl_uticks + lwp->kl_sticks + lwp->kl_iticks) + (cru->ru_stime.tv_sec + cru->ru_utime.tv_sec) * 1000000; } static void proc_count(struct kinfo_proc *kp, size_t proc_n) { size_t i, act = 0, run = 0; for (i = 0; i < proc_n; i++) { struct kinfo_proc *p = &kp[i]; if (!(p->kp_flags & P_SYSTEM)) { struct kinfo_lwp *lwp = &p->kp_lwp; if (!lwp->kl_tid) act++; if (lwp->kl_stat == LSRUN) run++; } } info.procs = act; info.run_procs = run; } static void proc_fill(struct kinfo_proc *kp, size_t proc_n) { size_t i, f = getpagesize(); static long prev_ticks = 0; /* safe as long as in same thread */ for (i = 0; i < proc_n; i++) { struct kinfo_proc *p = &kp[i]; struct kinfo_lwp *lwp = &p->kp_lwp; if (!(p->kp_flags & P_SYSTEM) && p->kp_comm && *p->kp_comm && /* just to be sure */ !lwp->kl_tid) { /* 'main' lwp, the real process (observed) */ struct process *my = get_process(p->kp_pid); long ticks = proc_rusage(p); my->time_stamp = g_time; free_and_zero(my->name); my->name = strdup(p->kp_comm); my->amount = 100.0 * lwp->kl_pctcpu / FSCALE; my->vsize = p->kp_vm_map_size; my->rss = p->kp_vm_rssize * f; my->total_cpu_time = ticks - prev_ticks; prev_ticks = ticks; // printf("\tmy[%p]: %s(%u) %d %d 0x%x 0x%x %f\n", p, // my->name, my->pid, my->vsize, my->rss, // p->kp_flags, lwp->kl_stat, my->amount); } } } void get_top_info(void) { size_t proc_n = kern_proc_all_n(); struct kinfo_proc *kp = kern_proc_all(proc_n); if (kp) { proc_count(kp, proc_n); proc_fill(kp, proc_n); free(kp); } } #if defined(i386) || defined(__i386__) #define APMDEV "/dev/apm" #define APM_UNKNOWN 255 int apm_getinfo(int fd, apm_info_t aip) { if (ioctl(fd, APMIO_GETINFO, aip) == -1) { return -1; } return 0; } char *get_apm_adapter(void) { int fd; struct apm_info a_info; char *out; out = (char *)calloc(16, sizeof(char)); fd = open(APMDEV, O_RDONLY); if (fd < 0) { strncpy(out, "ERR", 16); return out; } if (apm_getinfo(fd, &a_info) != 0) { close(fd); strncpy(out, "ERR", 16); return out; } close(fd); switch (a_info.ai_acline) { case 0: strncpy(out, "off-line", 16); return out; break; case 1: if (a_info.ai_batt_stat == 3) { strncpy(out, "charging", 16); return out; } else { strncpy(out, "on-line", 16); return out; } break; default: strncpy(out, "unknown", 16); return out; break; } } char *get_apm_battery_life(void) { int fd; u_int batt_life; struct apm_info a_info; char *out; out = (char *)calloc(16, sizeof(char)); fd = open(APMDEV, O_RDONLY); if (fd < 0) { strncpy(out, "ERR", 16); return out; } if (apm_getinfo(fd, &a_info) != 0) { close(fd); strncpy(out, "ERR", 16); return out; } close(fd); batt_life = a_info.ai_batt_life; if (batt_life == APM_UNKNOWN) { strncpy(out, "unknown", 16); } else if (batt_life <= 100) { snprintf(out, 16, "%d%%", batt_life); return out; } else { strncpy(out, "ERR", 16); } return out; } char *get_apm_battery_time(void) { int fd; int batt_time; int h, m, s; struct apm_info a_info; char *out; out = (char *)calloc(16, sizeof(char)); fd = open(APMDEV, O_RDONLY); if (fd < 0) { strncpy(out, "ERR", 16); return out; } if (apm_getinfo(fd, &a_info) != 0) { close(fd); strncpy(out, "ERR", 16); return out; } close(fd); batt_time = a_info.ai_batt_time; if (batt_time == -1) { strncpy(out, "unknown", 16); } else { h = batt_time; s = h % 60; h /= 60; m = h % 60; h /= 60; snprintf(out, 16, "%2d:%02d:%02d", h, m, s); } return out; } #endif void get_battery_short_status(char *buffer, unsigned int n, const char *bat) { get_battery_stuff(buffer, n, bat, BATTERY_STATUS); if (0 == strncmp("charging", buffer, 8)) { buffer[0] = 'C'; memmove(buffer + 1, buffer + 8, n - 8); } else if (0 == strncmp("discharging", buffer, 11)) { buffer[0] = 'D'; memmove(buffer + 1, buffer + 11, n - 11); } else if (0 == strncmp("absent/on AC", buffer, 12)) { buffer[0] = 'A'; memmove(buffer + 1, buffer + 12, n - 12); } } int get_entropy_avail(unsigned int *val) { /* Not applicable for FreeBSD as it uses the yarrow prng. */ (void)val; return 1; } int get_entropy_poolsize(unsigned int *val) { /* Not applicable for FreeBSD as it uses the yarrow prng. */ (void)val; return 1; } conky-1.12.2/src/dragonfly.h000066400000000000000000000005771404127277500156670ustar00rootroot00000000000000/* */ #ifndef DRAGONFLY_H_ #define DRAGONFLY_H_ #include #include #include #include #include #include "common.h" #if (defined(i386) || defined(__i386__)) #include #endif /* i386 || __i386__ */ int get_entropy_avail(unsigned int *); int get_entropy_poolsize(unsigned int *); #endif /*DRAGONFLY_H_*/ conky-1.12.2/src/entropy.cc000066400000000000000000000060071404127277500155320ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include "config.h" #include "conky.h" #include "text_object.h" /* check for OS and include appropriate headers */ #if defined(__linux__) #include "linux.h" #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include "freebsd.h" #elif defined(__DragonFly__) #include "dragonfly.h" #elif defined(__OpenBSD__) #include "openbsd.h" #elif defined(__sun) #include "solaris.h" #elif defined(__HAIKU__) #include "haiku.h" #elif defined(__APPLE__) && defined(__MACH__) #include "darwin.h" #endif struct _entropy { _entropy() = default; unsigned int avail{0}; unsigned int poolsize{0}; }; static _entropy entropy; int update_entropy() { get_entropy_avail(&entropy.avail); get_entropy_poolsize(&entropy.poolsize); return 0; } void print_entropy_avail(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; snprintf(p, p_max_size, "%u", entropy.avail); } uint8_t entropy_percentage(struct text_object *obj) { (void)obj; return round_to_positive_int(static_cast(entropy.avail) * 100.0 / static_cast(entropy.poolsize)); } void print_entropy_poolsize(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; snprintf(p, p_max_size, "%u", entropy.poolsize); } double entropy_barval(struct text_object *obj) { (void)obj; return static_cast(entropy.avail) / entropy.poolsize; } void print_password(struct text_object *obj, char *p, unsigned int p_max_size) { time_t t; static const char letters[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~!@#$%^&*(" ")_"; static const int len = static_cast(sizeof(letters)) - 1; uintmax_t x = strtoumax(obj->data.s, (char **)NULL, 10); uintmax_t z = 0; if (-1 == (t = time(NULL))) { return; } srandom(static_cast(t)); for (; z < x && p_max_size - 1 > z; z++) { *p++ = letters[random() % len]; } *p = '\0'; } conky-1.12.2/src/entropy.h000066400000000000000000000026501404127277500153740ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _ENTROPY_H #define _ENTROPY_H int update_entropy(void); void print_entropy_avail(struct text_object *, char *, unsigned int); uint8_t entropy_percentage(struct text_object *); void print_entropy_poolsize(struct text_object *, char *, unsigned int); double entropy_barval(struct text_object *); void print_password(struct text_object *, char *, unsigned int); #endif /* _ENTROPY_H */ conky-1.12.2/src/exec.cc000066400000000000000000000261121404127277500147550ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "exec.h" #include #include #include #include #include #include #include #include "conky.h" #include "core.h" #include "logging.h" #include "specials.h" #include "text_object.h" #include "update-cb.hh" struct execi_data { float interval{0}; char *cmd{nullptr}; execi_data() = default; }; static const int cmd_len = 256; static char cmd[cmd_len]; static char *remove_excess_quotes(const char *); static char *remove_excess_quotes(const char *command) { char *cmd_ptr = cmd; const char *command_ptr = command; int skip = 0; if ((cmd_len - 1) < (strlen(command) - 1)) { snprintf(cmd, cmd_len - 1, "%s", command); return cmd; } if (*command_ptr == '"' || *command_ptr == '\'') { skip = 1; command_ptr++; } for (; *command_ptr; command_ptr++) { if ('\0' == *(command_ptr + 1) && 1 == skip && (*command_ptr == '"' || *command_ptr == '\'')) { continue; } *cmd_ptr++ = *command_ptr; } *cmd_ptr = '\0'; return cmd; } // our own implementation of popen, the difference : the value of 'childpid' // will be filled with the pid of the running 'command'. This is useful if want // to kill it when it hangs while reading or writing to it. We have to kill it // because pclose will wait until the process dies by itself static FILE *pid_popen(const char *command, const char *mode, pid_t *child) { int ends[2]; int parentend, childend; // by running pipe after the strcmp's we make sure that we don't have to // create a pipe and close the ends if mode is something illegal if (strcmp(mode, "r") == 0) { if (pipe(ends) != 0) { return nullptr; } parentend = ends[0]; childend = ends[1]; } else if (strcmp(mode, "w") == 0) { if (pipe(ends) != 0) { return nullptr; } parentend = ends[1]; childend = ends[0]; } else { return nullptr; } *child = fork(); if (*child == -1) { close(parentend); close(childend); return nullptr; } if (*child > 0) { close(childend); waitpid(*child, nullptr, 0); } else { // don't read from both stdin and pipe or write to both stdout and pipe if (childend == ends[0]) { close(0); } else { close(1); } close(parentend); // by dupping childend, the returned fd will have close-on-exec turned off if (fcntl(childend, F_DUPFD, 0) == -1) { perror("fcntl()"); } close(childend); execl("/bin/sh", "sh", "-c", remove_excess_quotes(command), (char *)nullptr); _exit(EXIT_FAILURE); // child should die here, (normally execl will take // care of this but it can fail) } return fdopen(parentend, mode); } /** * Executes a command and stores the result * * This function is called automatically, either once every update * interval, or at specific intervals in the case of execi commands. * conky::run_all_callbacks() handles this. In order for this magic to * happen, we must register a callback with conky::register_cb() * and store it somewhere, such as obj->exec_handle. To retrieve the * results, use the stored callback to call get_result_copy(), which * returns a std::string. */ void exec_cb::work() { pid_t childpid; std::string buf; std::shared_ptr fp; char b[0x1000]; if (FILE *t = pid_popen(std::get<0>(tuple).c_str(), "r", &childpid)) { fp.reset(t, fclose); } else { return; } while ((feof(fp.get()) == 0) && (ferror(fp.get()) == 0)) { int length = fread(b, 1, sizeof b, fp.get()); buf.append(b, length); } if (*buf.rbegin() == '\n') { buf.resize(buf.size() - 1); } std::lock_guard l(result_mutex); result = buf; } // remove backspaced chars, example: "dog^H^H^Hcat" becomes "cat" // string has to end with \0 and it's length should fit in a int #define BACKSPACE 8 static void remove_deleted_chars(char *string, unsigned int p_max_size) { int i = 0; while (string[i] != 0) { if (string[i] == BACKSPACE) { if (i != 0) { strncpy(&(string[i - 1]), &(string[i + 1]), strnlen(string, p_max_size) - i + 1); i--; } else { strncpy(&(string[i]), &(string[i + 1]), strnlen(string, p_max_size) - i); // necessary for ^H's at the start of a string } } else { i++; } } } /** * Parses command output to find a number between 0.0 and 100.0. * Used by ${exec[i]{bar,gauge,graph}}. * * @param[in] buf output of a command executed by an exec_cb object * @return number between 0.0 and 100.0 */ static inline double get_barnum(const char *buf) { double barnum; if (sscanf(buf, "%lf", &barnum) != 1) { NORM_ERR( "reading exec value failed (perhaps it's not the " "correct format?)"); return 0.0; } if (barnum > 100.0 || barnum < 0.0) { NORM_ERR( "your exec value is not between 0 and 100, " "therefore it will be ignored"); return 0.0; } return barnum; } /** * Store command output in p. For execp objects, we process the output * in case it contains special commands like ${color} * * @param[in] buffer the output of a command * @param[in] obj text_object that specifies whether or not to parse * @param[out] p the string in which we store command output * @param[in] p_max_size the maximum size of p... */ void fill_p(const char *buffer, struct text_object *obj, char *p, unsigned int p_max_size) { if (obj->parse) { evaluate(buffer, p, p_max_size); } else { snprintf(p, p_max_size, "%s", buffer); } remove_deleted_chars(p, p_max_size); } /** * Parses arg to find the command to be run, as well as special options * like height, width, color, and update interval * * @param[out] obj stores the command and an execi_data structure (if * applicable) * @param[in] arg the argument to an ${exec*} object * @param[in] execflag bitwise flag used to specify the exec variant we need to * process */ void scan_exec_arg(struct text_object *obj, const char *arg, unsigned int execflag) { const char *cmd = arg; char *orig_cmd = nullptr; struct execi_data *ed; /* in case we have an execi object, we need to parse out the interval */ if ((execflag & EF_EXECI) != 0u) { ed = new execi_data; int n; /* store the interval in ed->interval */ if (sscanf(arg, "%f %n", &ed->interval, &n) <= 0) { NORM_ERR("missing execi interval: ${execi* command}"); delete ed; ed = nullptr; return; } /* set cmd to everything after the interval */ cmd = strndup(arg + n, text_buffer_size.get(*state)); orig_cmd = const_cast(cmd); } /* parse any special options for the graphical exec types */ if ((execflag & EF_BAR) != 0u) { cmd = scan_bar(obj, cmd, 100); #ifdef BUILD_X11 } else if ((execflag & EF_GAUGE) != 0u) { cmd = scan_gauge(obj, cmd, 100); } else if ((execflag & EF_GRAPH) != 0u) { cmd = scan_graph(obj, cmd, 100); if (cmd == nullptr) { NORM_ERR("error parsing arguments to execgraph object"); } #endif /* BUILD_X11 */ } /* finally, store the resulting command, or an empty string if something went * wrong */ if ((execflag & EF_EXEC) != 0u) { obj->data.s = strndup(cmd != nullptr ? cmd : "", text_buffer_size.get(*state)); } else if ((execflag & EF_EXECI) != 0u) { ed->cmd = strndup(cmd != nullptr ? cmd : "", text_buffer_size.get(*state)); obj->data.opaque = ed; } free_and_zero(orig_cmd); } /** * Register an exec_cb object using the command that we have parsed * * @param[out] obj stores the callback handle */ void register_exec(struct text_object *obj) { if ((obj->data.s != nullptr) && (obj->data.s[0] != 0)) { obj->exec_handle = new conky::callback_handle( conky::register_cb(1, true, obj->data.s)); } else { DBGP("unable to register exec callback"); } } /** * Register an exec_cb object using the command that we have parsed. * * This version takes care of execi intervals. Note that we depend on * obj->thread, so be sure to run this function *after* setting obj->thread. * * @param[out] obj stores the callback handle */ void register_execi(struct text_object *obj) { auto *ed = static_cast(obj->data.opaque); if ((ed != nullptr) && (ed->cmd != nullptr) && (ed->cmd[0] != 0)) { uint32_t period = std::max(lround(ed->interval / active_update_interval()), 1l); obj->exec_handle = new conky::callback_handle( conky::register_cb(period, !obj->thread, ed->cmd)); } else { DBGP("unable to register execi callback"); } } /** * Get the results of an exec_cb object (command output) * * @param[in] obj holds an exec_handle, assuming one was registered * @param[out] p the string in which we store command output * @param[in] p_max_size the maximum size of p... */ void print_exec(struct text_object *obj, char *p, unsigned int p_max_size) { if (obj->exec_handle != nullptr) { fill_p((*obj->exec_handle)->get_result_copy().c_str(), obj, p, p_max_size); } } /** * Get the results of a graphical (bar, gauge, graph) exec_cb object * * @param[in] obj hold an exec_handle, assuming one was registered * @return a value between 0.0 and 100.0 */ double execbarval(struct text_object *obj) { if (obj->exec_handle != nullptr) { return get_barnum((*obj->exec_handle)->get_result_copy().c_str()); } return 0.0; } /** * Free up any dynamically allocated data * * @param[in] obj holds the data that we need to free up */ void free_exec(struct text_object *obj) { free_and_zero(obj->data.s); delete obj->exec_handle; obj->exec_handle = nullptr; } /** * Free up any dynamically allocated data, specifically for execi objects * * @param[in] obj holds the data that we need to free up */ void free_execi(struct text_object *obj) { auto *ed = static_cast(obj->data.opaque); /* if ed is nullptr, there is nothing to do */ if (ed == nullptr) { return; } delete obj->exec_handle; obj->exec_handle = nullptr; free_and_zero(ed->cmd); delete ed; ed = nullptr; obj->data.opaque = nullptr; } conky-1.12.2/src/exec.h000066400000000000000000000053221404127277500146170ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _EXEC_H #define _EXEC_H #include "update-cb.hh" /** * A callback that executes a command and stores the output as a std::string. * * Important note: if more than one exec callback uses the same command, * then only ONE callback is actually stored. This saves space. However, * suppose we have the following ${exec} objects in our conky.text: * * ${exec ~/bin/foo.sh} * ${execi 10 ~/bin/foo.sh} * * To the callback system, these are identical! Furthermore, the callback * with the smallest period/interval is the one that is stored. So the execi * command will in fact run on every update interval, rather than every * ten seconds as one would expect. */ class exec_cb : public conky::callback { typedef conky::callback Base; protected: virtual void work(); public: exec_cb(uint32_t period, bool wait, const std::string &cmd) : Base(period, wait, Base::Tuple(cmd)) {} }; /** * Flags used to identify the different types of exec commands during * parsing by scan_exec_arg(). These can be used individually or combined. * For example, to parse an ${execgraph} object, we pass EF_EXEC | EF_GRAPH * as the last argument to scan_exec_arg(). */ enum { EF_EXEC = (1 << 0), EF_EXECI = (1 << 1), EF_BAR = (1 << 2), EF_GRAPH = (1 << 3), EF_GAUGE = (1 << 4) }; void scan_exec_arg(struct text_object *, const char *, unsigned int); void register_exec(struct text_object *); void register_execi(struct text_object *); void print_exec(struct text_object *, char *, unsigned int); double execbarval(struct text_object *); void free_exec(struct text_object *); void free_execi(struct text_object *); #endif /* _EXEC_H */ conky-1.12.2/src/fonts.cc000066400000000000000000000155501404127277500151660ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "fonts.h" #include "logging.h" unsigned int selected_font = 0; std::vector fonts; char fontloaded = 0; void font_setting::lua_setter(lua::state &l, bool init) { lua::stack_sentry s(l, -2); Base::lua_setter(l, init); if (init && out_to_x.get(*state)) { if (fonts.empty()) { fonts.resize(1); } fonts[0].name = do_convert(l, -1).first; } ++s; } font_setting font; conky::simple_config_setting font_template[10] = { {"font0", ""}, {"font1", ""}, {"font2", ""}, {"font3", ""}, {"font4", ""}, {"font5", ""}, {"font6", ""}, {"font7", ""}, {"font8", ""}, {"font9", ""}}; #ifdef BUILD_XFT namespace { class xftalpha_setting : public conky::simple_config_setting { using Base = conky::simple_config_setting; protected: void lua_setter(lua::state &l, bool init) override { lua::stack_sentry s(l, -2); Base::lua_setter(l, init); if (init && out_to_x.get(*state)) { fonts[0].font_alpha = do_convert(l, -1).first * 0xffff; } ++s; } public: xftalpha_setting() : Base("xftalpha", 1.0, false) {} }; xftalpha_setting xftalpha; } // namespace #endif /* BUILD_XFT */ void set_font() { #ifdef BUILD_XFT if (use_xft.get(*state)) { return; } #endif /* BUILD_XFT */ if (fonts.size() > selected_font && fonts[selected_font].font != nullptr && window.gc != nullptr) { XSetFont(display, window.gc, fonts[selected_font].font->fid); } } void setup_fonts() { DBGP2("setting up fonts"); if (!out_to_x.get(*state)) { return; } #ifdef BUILD_XFT if (use_xft.get(*state)) { if (window.xftdraw != nullptr) { XftDrawDestroy(window.xftdraw); window.xftdraw = nullptr; } window.xftdraw = XftDrawCreate(display, window.drawable, window.visual, window.colourmap); } #endif /* BUILD_XFT */ set_font(); } int add_font(const char *data_in) { if (!out_to_x.get(*state)) { return 0; } fonts.emplace_back(); fonts.rbegin()->name = data_in; return fonts.size() - 1; } void free_fonts(bool utf8) { if (!out_to_x.get(*state)) { return; } for (auto &font : fonts) { #ifdef BUILD_XFT if (use_xft.get(*state)) { /* * Do we not need to close fonts with Xft? Unsure. Not freeing the * fonts seems to incur a slight memory leak, but it also prevents * a crash. * * XftFontClose(display, fonts[i].xftfont); */ } else #endif /* BUILD_XFT */ { if (font.font != nullptr) { XFreeFont(display, font.font); } if (utf8 && (font.fontset != nullptr)) { XFreeFontSet(display, font.fontset); } } } fonts.clear(); selected_font = 0; #ifdef BUILD_XFT if (window.xftdraw != nullptr) { XftDrawDestroy(window.xftdraw); window.xftdraw = nullptr; } #endif /* BUILD_XFT */ } void load_fonts(bool utf8) { DBGP2("loading fonts"); if (!out_to_x.get(*state)) { return; } for (auto &font : fonts) { #ifdef BUILD_XFT /* load Xft font */ if (use_xft.get(*state)) { if (font.xftfont == nullptr) { font.xftfont = XftFontOpenName(display, screen, font.name.c_str()); } if (font.xftfont != nullptr) { continue; } NORM_ERR("can't load Xft font '%s'", font.name.c_str()); if ((font.xftfont = XftFontOpenName(display, screen, "courier-12")) != nullptr) { continue; } CRIT_ERR(nullptr, nullptr, "can't load Xft font '%s'", "courier-12"); continue; } #endif if (utf8 && font.fontset == nullptr) { char **missing; int missingnum; char *missingdrawn; font.fontset = XCreateFontSet(display, font.name.c_str(), &missing, &missingnum, &missingdrawn); XFreeStringList(missing); if (font.fontset == nullptr) { NORM_ERR("can't load font '%s'", font.name.c_str()); font.fontset = XCreateFontSet(display, "fixed", &missing, &missingnum, &missingdrawn); if (font.fontset == nullptr) { CRIT_ERR(nullptr, nullptr, "can't load font '%s'", "fixed"); } } } /* load normal font */ if ((font.font == nullptr) && (font.font = XLoadQueryFont(display, font.name.c_str())) == nullptr) { NORM_ERR("can't load font '%s'", font.name.c_str()); if ((font.font = XLoadQueryFont(display, "fixed")) == nullptr) { CRIT_ERR(nullptr, nullptr, "can't load font '%s'", "fixed"); } } } } #ifdef BUILD_XFT int font_height() { if (!out_to_x.get(*state)) { return 0; } assert(selected_font < fonts.size()); if (use_xft.get(*state)) { return fonts[selected_font].xftfont->ascent + fonts[selected_font].xftfont->descent; } else { return fonts[selected_font].font->max_bounds.ascent + fonts[selected_font].font->max_bounds.descent; } } int font_ascent() { if (!out_to_x.get(*state)) { return 0; } assert(selected_font < fonts.size()); if (use_xft.get(*state)) { return fonts[selected_font].xftfont->ascent; } else { return fonts[selected_font].font->max_bounds.ascent; } } int font_descent() { if (!out_to_x.get(*state)) { return 0; } assert(selected_font < fonts.size()); if (use_xft.get(*state)) { return fonts[selected_font].xftfont->descent; } else { return fonts[selected_font].font->max_bounds.descent; } } #else int font_height() { if (!out_to_x.get(*state)) { return 0; } assert(selected_font < fonts.size()); return fonts[selected_font].font->max_bounds.ascent + fonts[selected_font].font->max_bounds.descent; } int font_ascent() { if (!out_to_x.get(*state)) { return 0; } assert(selected_font < fonts.size()); return fonts[selected_font].font->max_bounds.ascent; } int font_descent() { if (!out_to_x.get(*state)) { return 0; } assert(selected_font < fonts.size()); return fonts[selected_font].font->max_bounds.descent; } #endif conky-1.12.2/src/fonts.h000066400000000000000000000042131404127277500150220ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _FONTS_H #define _FONTS_H #include #include "conky.h" #include "x11.h" /* for fonts */ struct font_list { std::string name; XFontStruct *font; XFontSet fontset; #ifdef BUILD_XFT XftFont *xftfont; int font_alpha; #endif font_list() : name(), font(nullptr), fontset(nullptr) #ifdef BUILD_XFT , xftfont(nullptr), font_alpha(0xffff) #endif { } }; /* direct access to registered fonts (FIXME: bad encapsulation) */ extern std::vector fonts; extern unsigned int selected_font; int font_height(); int font_ascent(); int font_descent(); void setup_fonts(void); void set_font(void); int add_font(const char *); void free_fonts(bool utf8); void load_fonts(bool utf8); class font_setting : public conky::simple_config_setting { typedef conky::simple_config_setting Base; protected: virtual void lua_setter(lua::state &l, bool init); public: font_setting() : Base("font", "6x10", false) {} }; extern font_setting font; extern conky::simple_config_setting font_template[10]; #endif /* _FONTS_H */ conky-1.12.2/src/freebsd.cc000066400000000000000000000455531404127277500154550ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if 0 #include #endif #include #include "conky.h" #include "diskio.h" #include "freebsd.h" #include "logging.h" #include "net_stat.h" #include "text_object.h" #include "top.h" #define GETSYSCTL(name, var) getsysctl(name, &(var), sizeof(var)) #define KELVTOC(x) ((x - 2732) / 10.0) #define MAXSHOWDEVS 16 #if 0 #define FREEBSD_DEBUG #endif kvm_t *kd; std::mutex kvm_proc_mutex; __attribute__((gnu_inline)) inline void proc_find_top(struct process **cpu, struct process **mem, struct process **time); static short conky_cpu_setup = 0; static int getsysctl(const char *name, void *ptr, size_t len) { size_t nlen = len; if (sysctlbyname(name, ptr, &nlen, nullptr, 0) == -1) { return -1; } if (nlen != len && errno == ENOMEM) { return -1; } return 0; } struct ifmibdata *data = nullptr; size_t len = 0; static int swapmode(unsigned long *retavail, unsigned long *retfree) { int n; unsigned long pagesize = getpagesize(); struct kvm_swap swapary[1]; *retavail = 0; *retfree = 0; #define CONVERT(v) ((quad_t)(v) * (pagesize / 1024)) n = kvm_getswapinfo(kd, swapary, 1, 0); if (n < 0 || swapary[0].ksw_total == 0) { return 0; } *retavail = CONVERT(swapary[0].ksw_total); *retfree = CONVERT(swapary[0].ksw_total - swapary[0].ksw_used); n = (int)((double)swapary[0].ksw_used * 100.0 / (double)swapary[0].ksw_total); return n; } void prepare_update(void) {} int update_uptime(void) { int mib[2] = {CTL_KERN, KERN_BOOTTIME}; struct timeval boottime; time_t now; size_t size = sizeof(boottime); if ((sysctl(mib, 2, &boottime, &size, nullptr, 0) != -1) && (boottime.tv_sec != 0)) { time(&now); info.uptime = now - boottime.tv_sec; } else { fprintf(stderr, "Could not get uptime\n"); info.uptime = 0; } return 0; } int check_mount(struct text_object *obj) { struct statfs *mntbuf; int i, mntsize; if (!obj->data.s) return 0; mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); for (i = mntsize - 1; i >= 0; i--) { if (strcmp(mntbuf[i].f_mntonname, obj->data.s) == 0) { return 1; } } return 0; } int update_meminfo(void) { u_int total_pages, inactive_pages, free_pages; unsigned long swap_avail, swap_free; int pagesize = getpagesize(); if (GETSYSCTL("vm.stats.vm.v_page_count", total_pages)) { fprintf(stderr, "Cannot read sysctl \"vm.stats.vm.v_page_count\"\n"); } if (GETSYSCTL("vm.stats.vm.v_free_count", free_pages)) { fprintf(stderr, "Cannot read sysctl \"vm.stats.vm.v_free_count\"\n"); } if (GETSYSCTL("vm.stats.vm.v_inactive_count", inactive_pages)) { fprintf(stderr, "Cannot read sysctl \"vm.stats.vm.v_inactive_count\"\n"); } info.memmax = total_pages * (pagesize >> 10); info.mem = (total_pages - free_pages - inactive_pages) * (pagesize >> 10); info.memwithbuffers = info.mem; info.memeasyfree = info.memfree = info.memmax - info.mem; info.legacymem = info.mem; if ((swapmode(&swap_avail, &swap_free)) >= 0) { info.swapmax = swap_avail; info.swap = (swap_avail - swap_free); info.swapfree = swap_free; } else { info.swapmax = 0; info.swap = 0; info.swapfree = 0; } return 0; } int update_net_stats(void) { struct net_stat *ns; double delta; long long r, t, last_recv, last_trans; struct ifaddrs *ifap, *ifa; struct if_data *ifd; /* get delta */ delta = current_update_time - last_update_time; if (delta <= 0.0001) { return 0; } if (getifaddrs(&ifap) < 0) { return 0; } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { ns = get_net_stat((const char *)ifa->ifa_name, nullptr, NULL); if (ifa->ifa_flags & IFF_UP) { struct ifaddrs *iftmp; ns->up = 1; last_recv = ns->recv; last_trans = ns->trans; if (ifa->ifa_addr->sa_family != AF_LINK) { continue; } for (iftmp = ifa->ifa_next; iftmp != nullptr && strcmp(ifa->ifa_name, iftmp->ifa_name) == 0; iftmp = iftmp->ifa_next) { if (iftmp->ifa_addr->sa_family == AF_INET) { memcpy(&(ns->addr), iftmp->ifa_addr, iftmp->ifa_addr->sa_len); } } ifd = (struct if_data *)ifa->ifa_data; r = ifd->ifi_ibytes; t = ifd->ifi_obytes; if (r < ns->last_read_recv) { ns->recv += ((long long)4294967295U - ns->last_read_recv) + r; } else { ns->recv += (r - ns->last_read_recv); } ns->last_read_recv = r; if (t < ns->last_read_trans) { ns->trans += ((long long)4294967295U - ns->last_read_trans) + t; } else { ns->trans += (t - ns->last_read_trans); } ns->last_read_trans = t; /* calculate speeds */ ns->recv_speed = (ns->recv - last_recv) / delta; ns->trans_speed = (ns->trans - last_trans) / delta; } else { ns->up = 0; } } freeifaddrs(ifap); return 0; } int update_total_processes(void) { int n_processes; std::lock_guard guard(kvm_proc_mutex); kvm_getprocs(kd, KERN_PROC_ALL, 0, &n_processes); info.procs = n_processes; return 0; } int update_running_processes(void) { struct kinfo_proc *p; int n_processes; int i, cnt = 0; std::lock_guard guard(kvm_proc_mutex); p = kvm_getprocs(kd, KERN_PROC_ALL, 0, &n_processes); for (i = 0; i < n_processes; i++) { if (p[i].ki_stat == SRUN) { cnt++; } } info.run_procs = cnt; return 0; } void get_cpu_count(void) { int cpu_count = 0; if (GETSYSCTL("hw.ncpu", cpu_count) == 0) { info.cpu_count = cpu_count; } else { fprintf(stderr, "Cannot get hw.ncpu\n"); info.cpu_count = 0; } info.cpu_usage = (float *)malloc((info.cpu_count + 1) * sizeof(float)); if (info.cpu_usage == nullptr) { CRIT_ERR(nullptr, NULL, "malloc"); } } struct cpu_info { long oldtotal; long oldused; }; int update_cpu_usage(void) { int i, j = 0; long used, total; long *cp_time = nullptr; size_t cp_len; static struct cpu_info *cpu = nullptr; unsigned int malloc_cpu_size = 0; extern void *global_cpu; /* add check for !info.cpu_usage since that mem is freed on a SIGUSR1 */ if ((conky_cpu_setup == 0) || (!info.cpu_usage)) { get_cpu_count(); conky_cpu_setup = 1; } if (!global_cpu) { malloc_cpu_size = (info.cpu_count + 1) * sizeof(struct cpu_info); cpu = (cpu_info *)malloc(malloc_cpu_size); memset(cpu, 0, malloc_cpu_size); global_cpu = cpu; } /* cpu[0] is overall stats, get it from separate sysctl */ cp_len = CPUSTATES * sizeof(long); cp_time = (long int *)malloc(cp_len); if (sysctlbyname("kern.cp_time", cp_time, &cp_len, nullptr, 0) < 0) { fprintf(stderr, "Cannot get kern.cp_time\n"); } total = 0; for (j = 0; j < CPUSTATES; j++) total += cp_time[j]; used = total - cp_time[CP_IDLE]; if ((total - cpu[0].oldtotal) != 0) { info.cpu_usage[0] = ((double)(used - cpu[0].oldused)) / (double)(total - cpu[0].oldtotal); } else { info.cpu_usage[0] = 0; } cpu[0].oldused = used; cpu[0].oldtotal = total; free(cp_time); /* per-core stats */ cp_len = CPUSTATES * sizeof(long) * info.cpu_count; cp_time = (long int *)malloc(cp_len); /* on e.g. i386 SMP we may have more values than actual cpus; this will just * drop extra values */ if (sysctlbyname("kern.cp_times", cp_time, &cp_len, nullptr, 0) < 0 && errno != ENOMEM) { fprintf(stderr, "Cannot get kern.cp_times\n"); } for (i = 0; i < (int)info.cpu_count; i++) { total = 0; for (j = 0; j < CPUSTATES; j++) total += cp_time[i * CPUSTATES + j]; used = total - cp_time[i * CPUSTATES + CP_IDLE]; if ((total - cpu[i + 1].oldtotal) != 0) { info.cpu_usage[i + 1] = ((double)(used - cpu[i + 1].oldused)) / (double)(total - cpu[i + 1].oldtotal); } else { info.cpu_usage[i + 1] = 0; } cpu[i + 1].oldused = used; cpu[i + 1].oldtotal = total; } free(cp_time); return 0; } void free_cpu(struct text_object *) { /* no-op */ } int update_load_average(void) { double v[3]; getloadavg(v, 3); info.loadavg[0] = (double)v[0]; info.loadavg[1] = (double)v[1]; info.loadavg[2] = (double)v[2]; return 0; } double get_acpi_temperature(int fd) { int temp; (void)fd; if (GETSYSCTL("hw.acpi.thermal.tz0.temperature", temp) == 0) { return KELVTOC(temp); } else if (GETSYSCTL("dev.cpu.0.temperature", temp) == 0) { return KELVTOC(temp); } else if (GETSYSCTL("dev.amdtemp.0.core0.sensor0", temp) == 0) { return KELVTOC(temp); } fprintf(stderr, "Cannot get temperature from sysctl\n"); return 0.0; } static void get_battery_stats(int *battime, int *batcapacity, int *batstate, int *ac) { if (battime && GETSYSCTL("hw.acpi.battery.time", *battime)) { fprintf(stderr, "Cannot read sysctl \"hw.acpi.battery.time\"\n"); } if (batcapacity && GETSYSCTL("hw.acpi.battery.life", *batcapacity)) { fprintf(stderr, "Cannot read sysctl \"hw.acpi.battery.life\"\n"); } if (batstate && GETSYSCTL("hw.acpi.battery.state", *batstate)) { fprintf(stderr, "Cannot read sysctl \"hw.acpi.battery.state\"\n"); } if (ac && GETSYSCTL("hw.acpi.acline", *ac)) { fprintf(stderr, "Cannot read sysctl \"hw.acpi.acline\"\n"); } } void get_battery_stuff(char *buf, unsigned int n, const char *bat, int item) { int battime, batcapacity, batstate, ac; (void)bat; get_battery_stats(&battime, &batcapacity, &batstate, &ac); if (batstate != 1 && batstate != 2 && batstate != 0 && batstate != 7) fprintf(stderr, "Unknown battery state %d!\n", batstate); else if (batstate != 1 && ac == 0) fprintf(stderr, "Battery charging while not on AC!\n"); else if (batstate == 1 && ac == 1) fprintf(stderr, "Battery discharing while on AC!\n"); switch (item) { case BATTERY_TIME: if (batstate == 1 && battime != -1) snprintf(buf, n, "%d:%2.2d", battime / 60, battime % 60); break; case BATTERY_STATUS: if (batstate == 1) // Discharging snprintf(buf, n, "remaining (%d%%)", batcapacity); else snprintf(buf, n, batstate == 2 ? "charging (%d%%)" : (batstate == 7 ? "absent/on AC" : "charged (%d%%)"), batcapacity); break; default: fprintf(stderr, "Unknown requested battery stat %d\n", item); } } int get_battery_perct(const char *) { int batcapacity; get_battery_stats(nullptr, &batcapacity, NULL, NULL); return batcapacity; } double get_battery_perct_bar(struct text_object *obj) { int batperct = get_battery_perct(obj->data.s); return batperct; } int open_acpi_temperature(const char *name) { (void)name; /* Not applicable for FreeBSD. */ return 0; } void get_acpi_ac_adapter(char *p_client_buffer, size_t client_buffer_size, const char *adapter) { int state; (void)adapter; // only linux uses this if (!p_client_buffer || client_buffer_size <= 0) { return; } if (GETSYSCTL("hw.acpi.acline", state)) { fprintf(stderr, "Cannot read sysctl \"hw.acpi.acline\"\n"); return; } if (state) { strncpy(p_client_buffer, "Running on AC Power", client_buffer_size); } else { strncpy(p_client_buffer, "Running on battery", client_buffer_size); } } void get_acpi_fan(char *p_client_buffer, size_t client_buffer_size) { /* not implemented */ if (p_client_buffer && client_buffer_size > 0) { memset(p_client_buffer, 0, client_buffer_size); } } /* void */ char get_freq(char *p_client_buffer, size_t client_buffer_size, const char *p_format, int divisor, unsigned int cpu) { int freq; char *freq_sysctl; if (!p_client_buffer || client_buffer_size <= 0 || !p_format || divisor <= 0) { return 0; } freq_sysctl = (char *)calloc(16, sizeof(char)); if (freq_sysctl == nullptr) { exit(-1); } snprintf(freq_sysctl, 16, "dev.cpu.%d.freq", (cpu - 1)); if (GETSYSCTL(freq_sysctl, freq) == 0) { snprintf(p_client_buffer, client_buffer_size, p_format, (float)freq / divisor); } else { snprintf(p_client_buffer, client_buffer_size, p_format, 0.0f); } free(freq_sysctl); return 1; } #if 0 void update_wifi_stats(void) { struct ifreq ifr; /* interface stats */ struct wi_req wireq; struct net_stat *ns; struct ifaddrs *ifap, *ifa; struct ifmediareq ifmr; int s; /* Get iface table */ if (getifaddrs(&ifap) < 0) { return; } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { ns = get_net_stat((const char *) ifa->ifa_name, nullptr, NULL); s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); /* Get media type */ bzero(&ifmr, sizeof(ifmr)); strlcpy(ifmr.ifm_name, ifa->ifa_name, IFNAMSIZ); if (ioctl(s, SIOCGIFMEDIA, (caddr_t) &ifmr) < 0) { close(s); return; } /* We can monitor only wireless interfaces * which are not in hostap mode */ if ((ifmr.ifm_active & IFM_IEEE80211) && !(ifmr.ifm_active & IFM_IEEE80211_HOSTAP)) { /* Get wi status */ bzero(&ifr, sizeof(ifr)); strlcpy(ifr.ifr_name, ifa->ifa_name, IFNAMSIZ); wireq.wi_type = WI_RID_COMMS_QUALITY; wireq.wi_len = WI_MAX_DATALEN; ifr.ifr_data = (void *) &wireq; if (ioctl(s, SIOCGWAVELAN, (caddr_t) &ifr) < 0) { perror("ioctl (getting wi status)"); exit(1); } /* wi_val[0] = quality * wi_val[1] = signal * wi_val[2] = noise */ ns->linkstatus = (int) wireq.wi_val[1]; } cleanup: close(s); } } #endif int update_diskio(void) { int devs_count, num_selected, num_selections, dn; struct device_selection *dev_select = nullptr; long select_generation; static struct statinfo statinfo_cur; char device_name[DEFAULT_TEXT_BUFFER_SIZE]; struct diskio_stat *cur; unsigned int reads, writes; unsigned int total_reads = 0, total_writes = 0; memset(&statinfo_cur, 0, sizeof(statinfo_cur)); statinfo_cur.dinfo = (struct devinfo *)calloc(1, sizeof(struct devinfo)); stats.current = stats.current_read = stats.current_write = 0; if (devstat_getdevs(nullptr, &statinfo_cur) < 0) { free(statinfo_cur.dinfo); return 0; } devs_count = statinfo_cur.dinfo->numdevs; if (devstat_selectdevs(&dev_select, &num_selected, &num_selections, &select_generation, statinfo_cur.dinfo->generation, statinfo_cur.dinfo->devices, devs_count, nullptr, 0, NULL, 0, DS_SELECT_ONLY, MAXSHOWDEVS, 1) >= 0) { for (dn = 0; dn < devs_count; dn++) { int di; struct devstat *dev; di = dev_select[dn].position; dev = &statinfo_cur.dinfo->devices[di]; snprintf(device_name, DEFAULT_TEXT_BUFFER_SIZE, "%s%d", dev_select[dn].device_name, dev_select[dn].unit_number); total_reads += (reads = dev->bytes[DEVSTAT_READ] / 512); total_writes += (writes = dev->bytes[DEVSTAT_WRITE] / 512); for (cur = stats.next; cur; cur = cur->next) { if (cur->dev && !strcmp(device_name, cur->dev)) { update_diskio_values(cur, reads, writes); break; } } } update_diskio_values(&stats, total_reads, total_writes); free(dev_select); } if (statinfo_cur.dinfo->mem_ptr) { free(statinfo_cur.dinfo->mem_ptr); } free(statinfo_cur.dinfo); return 0; } /* While topless is obviously better, top is also not bad. */ void get_top_info(void) { struct kinfo_proc *p; struct process *proc; int n_processes; int i; std::lock_guard guard(kvm_proc_mutex); p = kvm_getprocs(kd, KERN_PROC_PROC, 0, &n_processes); for (i = 0; i < n_processes; i++) { if (!(p[i].ki_flag & P_SYSTEM)) { proc = get_process(p[i].ki_pid); proc->time_stamp = g_time; proc->name = strndup(p[i].ki_comm, text_buffer_size.get(*state)); proc->basename = strndup(p[i].ki_comm, text_buffer_size.get(*state)); proc->amount = 100.0 * p[i].ki_pctcpu / FSCALE; proc->vsize = p[i].ki_size; proc->rss = (p[i].ki_rssize * getpagesize()); /* ki_runtime is in microseconds, total_cpu_time in centiseconds. * Therefore we divide by 10000. */ proc->total_cpu_time = p[i].ki_runtime / 10000; } } } void get_battery_short_status(char *buffer, unsigned int n, const char *bat) { get_battery_stuff(buffer, n, bat, BATTERY_STATUS); if (0 == strncmp("charging", buffer, 8)) { buffer[0] = 'C'; memmove(buffer + 1, buffer + 8, n - 8); } else if (0 == strncmp("remaining", buffer, 9)) { buffer[0] = 'D'; memmove(buffer + 1, buffer + 9, n - 9); } else if (0 == strncmp("charged", buffer, 7)) { buffer[0] = 'F'; memmove(buffer + 1, buffer + 7, n - 7); } else if (0 == strncmp("absent/on AC", buffer, 12)) { buffer[0] = 'N'; memmove(buffer + 1, buffer + 12, n - 12); } } int get_entropy_avail(unsigned int *val) { /* Not applicable for FreeBSD as it uses the yarrow prng. */ (void)val; return 1; } int get_entropy_poolsize(unsigned int *val) { /* Not applicable for FreeBSD as it uses the yarrow prng. */ (void)val; return 1; } void print_sysctlbyname(struct text_object *obj, char *p, unsigned int p_max_size) { u_int val[3] = {0}; char buf[256] = {""}; size_t len = sizeof(val); size_t len2 = sizeof(buf); if (0 == strcmp(obj->data.s, "")) { snprintf(p, p_max_size, "%s", "sysctlbyname takes an argument"); return; } if (0 != sysctlbyname(obj->data.s, &val, &len, NULL, 0)) { if (0 != sysctlbyname(obj->data.s, &buf, &len2, NULL, 0)) { snprintf(p, p_max_size, "%s", ""); return; } } if (0 != strcmp(buf, "")) { snprintf(p, p_max_size, "%s", buf); } else { snprintf(p, p_max_size, "%lu", (unsigned long)val[0]); } } conky-1.12.2/src/freebsd.h000066400000000000000000000027751404127277500153160ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef FREEBSD_H_ #define FREEBSD_H_ #include #include #include #include #include #include #include "common.h" #if (defined(i386) || defined(__i386__)) #include #endif /* i386 || __i386__ */ extern kvm_t *kd; int get_entropy_avail(unsigned int *); int get_entropy_poolsize(unsigned int *); void print_sysctlbyname(struct text_object *, char *, unsigned int); #endif /*FREEBSD_H_*/ conky-1.12.2/src/fs.cc000066400000000000000000000167521404127277500144520ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "fs.h" #include #include #include #include #include #include "conky.h" #include "logging.h" #include "specials.h" #include "text_object.h" #ifdef HAVE_SYS_STATFS_H #include #endif #if defined(__sun) #include #include #endif #if defined(__FreeBSD__) #include "freebsd.h" #elif defined(__DragonFly__) #include "dragonfly.h" #elif defined(__HAIKU__) #include "haiku.h" #elif defined(__APPLE__) && defined(__MACH__) #include "darwin.h" #endif #if !defined(HAVE_STRUCT_STATFS_F_FSTYPENAME) && !defined(__OpenBSD__) && \ !defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__sun) && \ !defined(__HAIKU__) && !(defined(__APPLE__) && defined(__MACH__)) #include #endif #define MAX_FS_STATS 64 static struct fs_stat fs_stats_[MAX_FS_STATS]; struct fs_stat *fs_stats = fs_stats_; static void update_fs_stat(struct fs_stat *fs); void get_fs_type(const char *path, char *result); int update_fs_stats() { unsigned i; static double last_fs_update = 0.0; if (current_update_time - last_fs_update < 13) { return 0; } for (i = 0; i < MAX_FS_STATS; ++i) { if (fs_stats[i].set != 0) { update_fs_stat(&fs_stats[i]); } } last_fs_update = current_update_time; return 0; } void clear_fs_stats() { unsigned i; for (i = 0; i < MAX_FS_STATS; ++i) { memset(&fs_stats[i], 0, sizeof(struct fs_stat)); } } struct fs_stat *prepare_fs_stat(const char *s) { struct fs_stat *next = nullptr; unsigned i; /* lookup existing or get new */ for (i = 0; i < MAX_FS_STATS; ++i) { if (fs_stats[i].set != 0) { if (strncmp(fs_stats[i].path, s, DEFAULT_TEXT_BUFFER_SIZE) == 0) { return &fs_stats[i]; } } else { next = &fs_stats[i]; } } /* new path */ if (next == nullptr) { NORM_ERR("too many fs stats"); return nullptr; } strncpy(next->path, s, DEFAULT_TEXT_BUFFER_SIZE); next->set = 1; update_fs_stat(next); return next; } #if defined(__APPLE__) #define statfs_func statfs #define statfs_struct statfs #else #define statfs_func statfs64 #define statfs_struct statfs64 #endif /* defined(__APPLE__) */ static void update_fs_stat(struct fs_stat *fs) { #if defined(__sun) struct statvfs s; if (statvfs(fs->path, &s) == 0) { fs->size = (long long)s.f_blocks * s.f_frsize; fs->avail = (long long)s.f_bavail * s.f_frsize; fs->free = (long long)s.f_bfree * s.f_frsize; (void)strncpy(fs->type, s.f_basetype, sizeof(fs->type)); #else struct statfs_struct s {}; if (statfs_func(fs->path, &s) == 0) { fs->size = static_cast(s.f_blocks) * s.f_bsize; /* bfree (root) or bavail (non-roots) ? */ fs->avail = static_cast(s.f_bavail) * s.f_bsize; fs->free = static_cast(s.f_bfree) * s.f_bsize; get_fs_type(fs->path, fs->type); #endif } else { NORM_ERR("statfs '%s': %s", fs->path, strerror(errno)); fs->size = 0; fs->avail = 0; fs->free = 0; strncpy(fs->type, "unknown", DEFAULT_TEXT_BUFFER_SIZE); } } void get_fs_type(const char *path, char *result) { #if defined(HAVE_STRUCT_STATFS_F_FSTYPENAME) || defined(__FreeBSD__) || \ defined(__OpenBSD__) || defined(__DragonFly__) || defined(__HAIKU__) || \ (defined(__APPLE__) && defined(__MACH__)) struct statfs_struct s {}; if (statfs_func(path, &s) == 0) { strncpy(result, s.f_fstypename, DEFAULT_TEXT_BUFFER_SIZE); } else { NORM_ERR("statfs '%s': %s", path, strerror(errno)); } return; #elif defined(__sun) assert(0); /* not used - see update_fs_stat() */ #else /* HAVE_STRUCT_STATFS_F_FSTYPENAME */ struct mntent *me; FILE *mtab = setmntent("/proc/mounts", "r"); char *search_path; int match; char *slash; if (mtab == nullptr) { NORM_ERR("setmntent /proc/mounts: %s", strerror(errno)); strncpy(result, "unknown", DEFAULT_TEXT_BUFFER_SIZE); return; } me = getmntent(mtab); // find our path in the mtab search_path = strdup(path); do { while ((match = strcmp(search_path, me->mnt_dir)) && getmntent(mtab)) ; if (!match) break; fseek(mtab, 0, SEEK_SET); slash = strrchr(search_path, '/'); if (slash == nullptr) { CRIT_ERR(NULL, NULL, "invalid path '%s'", path); } else { if (strlen(slash) == 1) /* trailing slash */ *(slash) = '\0'; else if (strlen(slash) > 1) *(slash + 1) = '\0'; else CRIT_ERR(nullptr, NULL, "found a crack in the matrix!"); } } while (strlen(search_path) > 0); free(search_path); endmntent(mtab); if (me && !match) { strncpy(result, me->mnt_type, DEFAULT_TEXT_BUFFER_SIZE); return; } #endif /* HAVE_STRUCT_STATFS_F_FSTYPENAME */ strncpy(result, "unknown", DEFAULT_TEXT_BUFFER_SIZE); } void init_fs_bar(struct text_object *obj, const char *arg) { arg = scan_bar(obj, arg, 1); if (arg != nullptr) { while (isspace(static_cast(*arg)) != 0) { arg++; } if (*arg == '\0') { arg = "/"; } } else { arg = "/"; } obj->data.opaque = prepare_fs_stat(arg); } static double get_fs_perc(struct text_object *obj, bool get_free) { auto *fs = static_cast(obj->data.opaque); double ret = 0.0; if ((fs != nullptr) && (fs->size != 0)) { if (get_free) { ret = fs->avail; } else { ret = fs->size - fs->free; } ret /= fs->size; } return ret; } double fs_barval(struct text_object *obj) { return get_fs_perc(obj, false); } double fs_free_barval(struct text_object *obj) { return get_fs_perc(obj, true); } void init_fs(struct text_object *obj, const char *arg) { obj->data.opaque = prepare_fs_stat(arg != nullptr ? arg : "/"); } uint8_t fs_free_percentage(struct text_object *obj) { return get_fs_perc(obj, true) * 100; } uint8_t fs_used_percentage(struct text_object *obj) { return get_fs_perc(obj, false) * 100; } #define HUMAN_PRINT_FS_GENERATOR(name, expr) \ void print_fs_##name(struct text_object *obj, char *p, \ unsigned int p_max_size) { \ struct fs_stat *fs = (struct fs_stat *)obj->data.opaque; \ if (fs) human_readable(expr, p, p_max_size); \ } HUMAN_PRINT_FS_GENERATOR(free, fs->avail) HUMAN_PRINT_FS_GENERATOR(size, fs->size) HUMAN_PRINT_FS_GENERATOR(used, fs->size - fs->free) void print_fs_type(struct text_object *obj, char *p, unsigned int p_max_size) { auto *fs = static_cast(obj->data.opaque); if (fs != nullptr) { snprintf(p, p_max_size, "%s", fs->type); } } conky-1.12.2/src/fs.h000066400000000000000000000040551404127277500143050ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _FS_H #define _FS_H #include "conky.h" /* DEFAULT_TEXT_BUFFER_SIZE */ /* needed here and by fs.c */ struct fs_stat { char path[DEFAULT_TEXT_BUFFER_SIZE]; char type[DEFAULT_TEXT_BUFFER_SIZE]; long long size; long long avail; long long free; char set; }; /* forward declare to make gcc happy (fs.h <-> text_object.h include) */ struct text_object; void init_fs_bar(struct text_object *, const char *); double fs_barval(struct text_object *); double fs_free_barval(struct text_object *); void init_fs(struct text_object *, const char *); uint8_t fs_free_percentage(struct text_object *); uint8_t fs_used_percentage(struct text_object *); void print_fs_free(struct text_object *, char *, unsigned int); void print_fs_size(struct text_object *, char *, unsigned int); void print_fs_used(struct text_object *, char *, unsigned int); void print_fs_type(struct text_object *, char *, unsigned int); int update_fs_stats(void); struct fs_stat *prepare_fs_stat(const char *s); void clear_fs_stats(void); #endif /* _FS_H */ conky-1.12.2/src/haiku.cc000066400000000000000000000141011404127277500151250ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include "conky.h" #include "haiku.h" #include "net_stat.h" #include "top.h" static short cpu_setup = 0; void prepare_update() {} int update_uptime() { info.uptime = (double)system_time() / 1000000.0; return 0; } int check_mount(struct text_object *obj) { /* stub */ (void)obj; return 0; } int update_meminfo() { system_info si; if (get_system_info(&si) != B_OK) { fprintf(stderr, "Cannot get_system_info\n"); return 1; } info.memmax = si.max_pages * (B_PAGE_SIZE >> 10); info.mem = si.used_pages * (B_PAGE_SIZE >> 10); // TODO: we have some more info... info.memwithbuffers = info.mem; info.memeasyfree = info.memfree = info.memmax - info.mem; info.legacymem = info.mem; info.swapmax = si.max_swap_pages * (B_PAGE_SIZE >> 10); info.swapfree = si.free_swap_pages * (B_PAGE_SIZE >> 10); info.swap = (info.swapmax - info.swapfree); return 0; } int update_net_stats() { // TODO return 1; } int update_total_processes() { // TODO return 0; } int update_running_processes() { // TODO return 1; } void get_cpu_count(void) { system_info si; if (get_system_info(&si) != B_OK) { fprintf(stderr, "Cannot get_system_info\n"); info.cpu_count = 0; return; } info.cpu_count = si.cpu_count; info.cpu_usage = (float *)malloc((info.cpu_count + 1) * sizeof(float)); if (info.cpu_usage == nullptr) { CRIT_ERR(nullptr, NULL, "malloc"); } } int update_cpu_usage() { // TODO static bigtime_t prev = 0; static cpu_info *prev_cpuinfo = nullptr; bigtime_t now; cpu_info *cpuinfo; /* add check for !info.cpu_usage since that mem is freed on a SIGUSR1 */ if ((cpu_setup == 0) || (!info.cpu_usage)) { get_cpu_count(); cpu_setup = 1; } int malloc_cpu_size = sizeof(cpu_info) * (info.cpu_count + 1); if (!prev_cpuinfo) { prev_cpuinfo = (cpu_info *)malloc(malloc_cpu_size); if (prev_cpuinfo == nullptr) { CRIT_ERR(nullptr, NULL, "malloc"); } memset(prev_cpuinfo, 0, malloc_cpu_size); } cpuinfo = (cpu_info *)malloc(malloc_cpu_size); memset(cpuinfo, 0, malloc_cpu_size); if (cpuinfo == nullptr) { CRIT_ERR(nullptr, NULL, "malloc"); } now = system_time(); if (get_cpu_info(0, info.cpu_count, &cpuinfo[1]) == B_OK) { for (int i = 1; i <= info.cpu_count; i++) cpuinfo[0].active_time += cpuinfo[i].active_time; cpuinfo[0].active_time /= info.cpu_count; for (int i = 0; i <= info.cpu_count; i++) { double period = (double)(now - prev); info.cpu_usage[i] = ((double)(cpuinfo[i].active_time - prev_cpuinfo[i].active_time)) / period; } } memcpy(prev_cpuinfo, cpuinfo, malloc_cpu_size); prev = now; free(cpuinfo); return 1; } void free_cpu(struct text_object *) { /* no-op */ } int update_load_average() { // TODO return 1; } double get_acpi_temperature(int fd) { return -1; } void get_battery_stuff(char *buf, unsigned int n, const char *bat, int item) { // TODO } int get_battery_perct(const char *bat) { /* int batcapacity; get_battery_stats(nullptr, &batcapacity, NULL, NULL); return batcapacity; */ // TODO return 0; } double get_battery_perct_bar(struct text_object *obj) { int batperct = get_battery_perct(obj->data.s); return batperct; } int open_acpi_temperature(const char *name) { return -1; } void get_acpi_ac_adapter(char *p_client_buffer, size_t client_buffer_size, const char *adapter) { (void)adapter; // only linux uses this if (!p_client_buffer || client_buffer_size <= 0) { return; } /* not implemented */ memset(p_client_buffer, 0, client_buffer_size); } /* char *get_acpi_fan() */ void get_acpi_fan(char *p_client_buffer, size_t client_buffer_size) { if (!p_client_buffer || client_buffer_size <= 0) { return; } /* not implemented */ memset(p_client_buffer, 0, client_buffer_size); } /* void */ char get_freq(char *p_client_buffer, size_t client_buffer_size, const char *p_format, int divisor, unsigned int cpu) { int freq; char *freq_sysctl; if (!p_client_buffer || client_buffer_size <= 0 || !p_format || divisor <= 0) { return 0; } return 0; // TODO // return 1; } int update_diskio(void) { return 1; } void get_top_info(void) { int32 tmcookie = 0; team_info tm; struct process *proc; while (get_next_team_info(&tmcookie, &tm) == B_NO_ERROR) { team_usage_info ti; if (get_team_usage_info(tm.team, B_TEAM_USAGE_SELF, &ti) != B_OK) continue; proc = get_process(tm.team); proc->time_stamp = g_time; proc->name = strndup(tm.args, sizeof(tm.args)); proc->basename = strndup(tm.args, sizeof(tm.args)); // proc->amount = 100.0 * p[i].ki_pctcpu / FSCALE; proc->vsize = 0; proc->rss = 0; /* bigtime_t is in microseconds, total_cpu_time in centiseconds. * Therefore we divide by 10000. */ proc->total_cpu_time = (ti.user_time + ti.kernel_time) / 10000; } } void get_battery_short_status(char *buffer, unsigned int n, const char *bat) { // TODO } int get_entropy_avail(unsigned int *val) { return 1; } int get_entropy_poolsize(unsigned int *val) { return 1; } conky-1.12.2/src/haiku.h000066400000000000000000000013441404127277500147740ustar00rootroot00000000000000/* */ #ifndef HAIKU_H_ #define HAIKU_H_ #include #include #include #include #include #include #include #include #include #include #include #include "common.h" #include "conky.h" int get_entropy_avail(unsigned int *); int get_entropy_poolsize(unsigned int *); /* let's just mimic statfs64 */ struct statfs : public fs_info {}; inline int statfs(const char *path, struct statfs *buf) { return fs_stat_dev(dev_for_path(path), buf); } #define f_blocks total_blocks #define f_bsize block_size #define f_bavail free_blocks #define f_bfree free_blocks #define f_fstypename fsh_name #endif /*HAIKU_H_*/ conky-1.12.2/src/hddtemp.cc000066400000000000000000000137721404127277500154660ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include #include #include #include #include "conky.h" #include "logging.h" #include "temphelper.h" #include "text_object.h" #define BUFLEN 512 static conky::simple_config_setting hddtemp_host("hddtemp_host", "localhost", false); static conky::simple_config_setting hddtemp_port("hddtemp_port", "7634", false); class hdd_info { public: hdd_info() : next(0) {} hdd_info *next; char *dev; short temp; char unit; void reset() { next = 0; dev = 0; temp = 0; unit = 0; } }; hdd_info hdd_info_head; static void __free_hddtemp_info(hdd_info *hdi) { if (hdi->next) __free_hddtemp_info(hdi->next); free(hdi->dev); delete hdi; } static void free_hddtemp_info(void) { DBGP("free_hddtemp_info() called"); if (!hdd_info_head.next) return; __free_hddtemp_info(hdd_info_head.next); hdd_info_head.next = nullptr; } static void add_hddtemp_info(char *dev, short temp, char unit) { hdd_info *hdi = &hdd_info_head; DBGP("add_hddtemp_info(%s, %d, %c) being called", dev, temp, unit); while (hdi->next) hdi = hdi->next; hdi->next = new hdd_info; hdi->next->reset(); hdi->next->dev = strdup(dev); hdi->next->temp = temp; hdi->next->unit = unit; } static char *fetch_hddtemp_output(void) { int sockfd; char *buf = nullptr; int buflen, offset = 0, rlen; struct addrinfo hints, *result, *rp; int i; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_INET; /* XXX: hddtemp has no ipv6 support (yet?) */ hints.ai_socktype = SOCK_STREAM; if ((i = getaddrinfo(hddtemp_host.get(*state).c_str(), hddtemp_port.get(*state).c_str(), &hints, &result))) { NORM_ERR("getaddrinfo(): %s", gai_strerror(i)); return nullptr; } for (rp = result; rp; rp = rp->ai_next) { sockfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); if (sockfd == -1) continue; if (connect(sockfd, rp->ai_addr, rp->ai_addrlen) != -1) break; close(sockfd); } if (!rp) { NORM_ERR("could not connect to hddtemp host"); goto GET_OUT; } buflen = 1024; buf = (char *)malloc(buflen); while ((rlen = recv(sockfd, buf + offset, buflen - offset - 1, 0)) > 0) { offset += rlen; if (buflen - offset < 1) { buflen += 1024; buf = (char *)realloc(buf, buflen); } } if (rlen < 0) perror("recv"); buf[offset] = '\0'; close(sockfd); GET_OUT: freeaddrinfo(result); return buf; } /* this is an iterator: * set line to nullptr in consecutive calls to get the next field * note that exhausing iteration is assumed - otherwise *saveptr * is not being freed! */ static int read_hdd_val(const char *line, char **dev, short *val, char *unit, char **saveptr) { char *line_s, *cval, *endptr; static char *p = 0; if (line) { *saveptr = strdup(line); p = *saveptr; } line_s = *saveptr; again: if (!*p) goto out_fail; /* read the device */ *dev = ++p; if (!(p = strchr(p, line_s[0]))) goto out_fail; *(p++) = '\0'; /* jump over the devname */ if (!(p = strchr(p, line_s[0]))) goto out_fail; /* read the value */ cval = ++p; if (!(p = strchr(p, line_s[0]))) goto out_fail; *(p++) = '\0'; *unit = *(p++); *val = strtol(cval, &endptr, 10); if (*endptr) { if (!(p = strchr(p, line_s[0]))) goto out_fail; p++; goto again; } /* preset p for next call */ p++; return 0; out_fail: free(*saveptr); return 1; } int update_hddtemp(void) { char *data, *dev, unit, *saveptr; short val; static double last_hddtemp_update = 0.0; /* limit tcp connection overhead */ if (current_update_time - last_hddtemp_update < 5) return 0; last_hddtemp_update = current_update_time; free_hddtemp_info(); if (!(data = fetch_hddtemp_output())) return 0; if (read_hdd_val(data, &dev, &val, &unit, &saveptr)) { free(data); return 0; } do { add_hddtemp_info(dev, val, unit); } while (!read_hdd_val(nullptr, &dev, &val, &unit, &saveptr)); free(data); return 0; } void free_hddtemp(struct text_object *obj) { free_hddtemp_info(); free_and_zero(obj->data.s); } static int get_hddtemp_info(const char *dev, short *val, char *unit) { hdd_info *hdi = hdd_info_head.next; /* if no dev is given, just use hdd_info_head->next */ while (dev && hdi) { if (!strcmp(dev, hdi->dev)) break; hdi = hdi->next; } if (!hdi) return 1; *val = hdi->temp; *unit = hdi->unit; return 0; } void print_hddtemp(struct text_object *obj, char *p, unsigned int p_max_size) { short val; char unit; if (get_hddtemp_info(obj->data.s, &val, &unit)) { snprintf(p, p_max_size, "%s", "N/A"); } else { temp_print(p, p_max_size, (double)val, (unit == 'C' ? TEMP_CELSIUS : TEMP_FAHRENHEIT), 1); } } conky-1.12.2/src/hddtemp.h000066400000000000000000000020671404127277500153230ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2007 Toni Spets * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef HDDTEMP_H_ #define HDDTEMP_H_ int update_hddtemp(void); void free_hddtemp(struct text_object *); void print_hddtemp(struct text_object *, char *, unsigned int); #endif /*HDDTEMP_H_*/ conky-1.12.2/src/hsv_gradient.cc000066400000000000000000000142371404127277500165130ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "hsv_gradient.h" #include "colours.h" #include "conky.h" #include "logging.h" #ifdef BUILD_X11 #include "x11.h" #endif /* BUILD_X11 */ #define CONST_SCALE 512L #define CONST_SCALE_HALF (CONST_SCALE / 2) #define CONST_SCALE2 (CONST_SCALE * 2L) #define CONST_SCALE4 (CONST_SCALE * 4L) #define CONST_SCALE6 (CONST_SCALE * 6L) #define CONST_SCALE60 (CONST_SCALE * 60L) #define CONST_SCALE120 (CONST_SCALE * 120L) #define CONST_SCALE180 (CONST_SCALE * 180L) #define CONST_SCALE240 (CONST_SCALE * 240L) #define CONST_SCALE300 (CONST_SCALE * 300L) #define CONST_SCALE360 (CONST_SCALE * 360L) long to_decimal_scale(long value, long max_value) { if (value == 0) { return 0; } else if (value > 0) { return (value * CONST_SCALE + max_value - 1) / max_value; } return -((std::abs(value) * CONST_SCALE + max_value - 1) / max_value); } long from_decimal_scale(long value, long max_value) { if (value == 0) { return 0; } else if (value > 0) { return (value * max_value + CONST_SCALE_HALF) / CONST_SCALE; } return -((std::abs(value) * max_value + CONST_SCALE_HALF) / CONST_SCALE); } void scaled_rgb_to_scaled_hsv(long *const rgb, long *hsv) { long val = rgb[0] > rgb[1] ? std::max(rgb[0], rgb[2]) : std::max(rgb[1], rgb[2]); long cmin = rgb[0] < rgb[1] ? std::min(rgb[0], rgb[2]) : std::min(rgb[1], rgb[2]); long delta = val - cmin; long hue; if (delta == 0) { hue = 0; } else { long d; long offset; if (rgb[0] == val) { d = rgb[1] - rgb[2]; offset = 0; } else if (rgb[1] == val) { d = rgb[2] - rgb[0]; offset = CONST_SCALE2; } else { d = rgb[0] - rgb[1]; offset = CONST_SCALE4; } long h = (CONST_SCALE * d + delta / 2) / delta + offset; hue = 60L * ((CONST_SCALE6 + h) % CONST_SCALE6); } long sat; if (val == 0) { sat = 0; } else { sat = (CONST_SCALE * delta + val / 2) / val; } hsv[0] = hue; hsv[1] = sat; hsv[2] = val; } void scaled_hsv_to_scaled_rgb(long *const hsv, long *rgb) { long c = (hsv[2] * hsv[1] + CONST_SCALE_HALF) / CONST_SCALE; long hue = hsv[0] % CONST_SCALE360; long x = (c * (CONST_SCALE - std::abs(((hue + 30L) / 60L) % CONST_SCALE2 - CONST_SCALE)) + CONST_SCALE_HALF) / CONST_SCALE; long m = hsv[2] - c; rgb[0] = m; rgb[1] = m; rgb[2] = m; if (hue < CONST_SCALE60) { rgb[0] += c; rgb[1] += x; } else if (hue < CONST_SCALE120) { rgb[0] += x; rgb[1] += c; } else if (hue < CONST_SCALE180) { rgb[1] += c; rgb[2] += x; } else if (hue < CONST_SCALE240) { rgb[1] += x; rgb[2] += c; } else if (hue < CONST_SCALE300) { rgb[2] += c; rgb[0] += x; } else { rgb[2] += x; rgb[0] += c; } } /* this function returns the next colour between two colours in hsv space for a * gradient */ std::unique_ptr do_hsv_gradient(int width, unsigned long first_colour, unsigned long last_colour) { long rgb1[3], rgb2[3], rgb3[3]; long hsv1[3], hsv2[3]; long hueDiff, satDiff, valDiff; int redshift = (2 * colour_depth / 3 + colour_depth % 3); int greenshift = (colour_depth / 3); // Make sure the width is always at least 2 width = std::max(2, width); std::unique_ptr colours(new unsigned long[width]); if (colour_depth == 0) { set_up_gradient(); } rgb1[0] = to_decimal_scale((first_colour & redmask) >> redshift, redmask >> redshift); rgb1[1] = to_decimal_scale((first_colour & greenmask) >> greenshift, greenmask >> greenshift); rgb1[2] = to_decimal_scale(first_colour & bluemask, bluemask); rgb2[0] = to_decimal_scale((last_colour & redmask) >> redshift, redmask >> redshift); rgb2[1] = to_decimal_scale((last_colour & greenmask) >> greenshift, greenmask >> greenshift); rgb2[2] = to_decimal_scale(last_colour & bluemask, bluemask); scaled_rgb_to_scaled_hsv(rgb1, hsv1); scaled_rgb_to_scaled_hsv(rgb2, hsv2); hueDiff = hsv2[0] - hsv1[0]; // use shortest hue path if (hueDiff > CONST_SCALE180) { hueDiff = hueDiff - CONST_SCALE360; } else if (hueDiff < -CONST_SCALE180) { hueDiff = hueDiff + CONST_SCALE360; } satDiff = hsv2[1] - hsv1[1]; valDiff = hsv2[2] - hsv1[2]; colours[0] = first_colour; colours[width - 1] = last_colour; for (int i = 1; i < (width - 1); i++) { long k; long divisor = width - i; k = (hueDiff + divisor / 2) / divisor; hueDiff -= k; long h = hsv1[0] + k; if (h < 0) { hsv1[0] = CONST_SCALE360 + h; } else { hsv1[0] = h; } k = (satDiff + divisor / 2) / divisor; satDiff -= k; hsv1[1] += k; k = (valDiff + divisor / 2) / divisor; valDiff -= k; hsv1[2] += k; scaled_hsv_to_scaled_rgb(hsv1, rgb3); long red3 = from_decimal_scale(rgb3[0], bluemask); long green3 = from_decimal_scale(rgb3[1], bluemask); long blue3 = from_decimal_scale(rgb3[2], bluemask); colours[i] = (red3 << redshift) | (green3 << greenshift) | blue3; } return colours; } conky-1.12.2/src/hsv_gradient.h000066400000000000000000000031361404127277500163510ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _HSV_GRADIENT_H #define _HSV_GRADIENT_H #include // needed by hsv_gradient extern short colour_depth; extern long redmask, greenmask, bluemask; extern void set_up_gradient(); std::unique_ptr do_hsv_gradient(int, unsigned long, unsigned long); long to_decimal_scale(long value, long max_value); long from_decimal_scale(long value, long max_value); void scaled_rgb_to_scaled_hsv(long *const rgb, long *hsv); void scaled_hsv_to_scaled_rgb(long *const hsv, long *rgb); #endif /* _COLOURS_H */ conky-1.12.2/src/i18n.h000066400000000000000000000020261404127277500144500ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef I18N_H_ #define I18N_H_ #define _nop(string) string #ifdef BUILD_I18N #include #define _(string) gettext(string) #else #define _(string) string #endif #endif /*I18N_H_*/ conky-1.12.2/src/i8k.cc000066400000000000000000000111161404127277500145220ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2007 Toni Spets * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include "conky.h" #include "logging.h" #include "temphelper.h" #include "text_object.h" struct _i8k { char *version; char *bios; char *serial; char *cpu_temp; char *left_fan_status; char *right_fan_status; char *left_fan_rpm; char *right_fan_rpm; char *ac_status; char *buttons_status; } i8k; /* FIXME: there should be an ioctl interface to request specific data */ #define PROC_I8K "/proc/i8k" #define I8K_DELIM " " static char *i8k_procbuf = nullptr; int update_i8k(void) { FILE *fp; if (!i8k_procbuf) { i8k_procbuf = (char *)malloc(128 * sizeof(char)); } if ((fp = fopen(PROC_I8K, "r")) == nullptr) { free_and_zero(i8k_procbuf); /*THREAD_CRIT_ERR(nullptr, NULL, "/proc/i8k doesn't exist! use insmod to make sure the kernel " "driver is loaded...");*/ NORM_ERR( "/proc/i8k doesn't exist! use insmod to make sure the kernel driver is " "loaded..."); clean_up_without_threads(nullptr, NULL); return 1; } memset(&i8k_procbuf[0], 0, 128); if (fread(&i8k_procbuf[0], sizeof(char), 128, fp) == 0) { NORM_ERR("something wrong with /proc/i8k..."); } fclose(fp); DBGP("read `%s' from /proc/i8k\n", i8k_procbuf); i8k.version = strtok(&i8k_procbuf[0], I8K_DELIM); i8k.bios = strtok(nullptr, I8K_DELIM); i8k.serial = strtok(nullptr, I8K_DELIM); i8k.cpu_temp = strtok(nullptr, I8K_DELIM); i8k.left_fan_status = strtok(nullptr, I8K_DELIM); i8k.right_fan_status = strtok(nullptr, I8K_DELIM); i8k.left_fan_rpm = strtok(nullptr, I8K_DELIM); i8k.right_fan_rpm = strtok(nullptr, I8K_DELIM); i8k.ac_status = strtok(nullptr, I8K_DELIM); i8k.buttons_status = strtok(nullptr, I8K_DELIM); return 0; } static void print_i8k_fan_status(char *p, int p_max_size, const char *status) { static const char *status_arr[] = {"off", "low", "high", "error"}; int i = status ? atoi(status) : 3; if (i < 0 || i > 3) i = 3; snprintf(p, p_max_size, "%s", status_arr[i]); } void print_i8k_left_fan_status(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; print_i8k_fan_status(p, p_max_size, i8k.left_fan_status); } void print_i8k_cpu_temp(struct text_object *obj, char *p, unsigned int p_max_size) { int cpu_temp; (void)obj; sscanf(i8k.cpu_temp, "%d", &cpu_temp); temp_print(p, p_max_size, (double)cpu_temp, TEMP_CELSIUS, 1); } void print_i8k_right_fan_status(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; print_i8k_fan_status(p, p_max_size, i8k.right_fan_status); } void print_i8k_ac_status(struct text_object *obj, char *p, unsigned int p_max_size) { int ac_status; (void)obj; sscanf(i8k.ac_status, "%d", &ac_status); if (ac_status == -1) { snprintf(p, p_max_size, "%s", "disabled (read i8k docs)"); } if (ac_status == 0) { snprintf(p, p_max_size, "%s", "off"); } if (ac_status == 1) { snprintf(p, p_max_size, "%s", "on"); } } #define I8K_PRINT_GENERATOR(name) \ void print_i8k_##name(struct text_object *obj, char *p, \ unsigned int p_max_size) { \ (void)obj; \ snprintf(p, p_max_size, "%s", i8k.name); \ } I8K_PRINT_GENERATOR(version) I8K_PRINT_GENERATOR(bios) I8K_PRINT_GENERATOR(serial) I8K_PRINT_GENERATOR(left_fan_rpm) I8K_PRINT_GENERATOR(right_fan_rpm) I8K_PRINT_GENERATOR(buttons_status) #undef I8K_PRINT_GENERATOR conky-1.12.2/src/i8k.h000066400000000000000000000035231404127277500143670ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2007 Toni Spets * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _I8K_H #define _I8K_H int update_i8k(void); void print_i8k_left_fan_status(struct text_object *, char *, unsigned int); void print_i8k_cpu_temp(struct text_object *, char *, unsigned int); void print_i8k_right_fan_status(struct text_object *, char *, unsigned int); void print_i8k_ac_status(struct text_object *, char *, unsigned int); void print_i8k_version(struct text_object *, char *, unsigned int); void print_i8k_bios(struct text_object *, char *, unsigned int); void print_i8k_serial(struct text_object *, char *, unsigned int); void print_i8k_left_fan_rpm(struct text_object *, char *, unsigned int); void print_i8k_right_fan_rpm(struct text_object *, char *, unsigned int); void print_i8k_buttons_status(struct text_object *, char *, unsigned int); #endif /* _I8K_H */ conky-1.12.2/src/ibm.cc000066400000000000000000000205551404127277500146050ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2007 Toni Spets * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "ibm.h" #include #include #include #include #include #include "config.h" #include "conky.h" #include "logging.h" #include "temphelper.h" static int ibm_acpi_temps[8]; /* Here come the IBM ACPI-specific things. For reference, see * http://ibm-acpi.sourceforge.net/README * If IBM ACPI is installed, /proc/acpi/ibm contains the following files: bay beep bluetooth brightness cmos dock driver ecdump fan hotkey led light thermal video volume * The content of these files is described in detail in the aforementioned * README - some of them also in the following functions accessing them. * Peter Tarjan (ptarjan@citromail.hu) */ #define IBM_ACPI_DIR "/proc/acpi/ibm" /* get fan speed on IBM/Lenovo laptops running the ibm acpi. * /proc/acpi/ibm/fan looks like this (3 lines): status: disabled speed: 2944 commands: enable, disable * Peter Tarjan (ptarjan@citromail.hu) */ void get_ibm_acpi_fan(struct text_object *obj, char *p, unsigned int p_max_size) { FILE *fp; unsigned int speed = 0; char fan[128]; (void)obj; if (!p || p_max_size <= 0) { return; } snprintf(fan, 127, "%s/fan", IBM_ACPI_DIR); fp = fopen(fan, "r"); if (fp != nullptr) { while (!feof(fp)) { char line[256]; if (fgets(line, 255, fp) == nullptr) { break; } if (sscanf(line, "speed: %u", &speed)) { break; } } } else { CRIT_ERR(nullptr, NULL, "can't open '%s': %s\nYou are not using the IBM ACPI. Remove " "ibm* from your " PACKAGE_NAME " config file.", fan, strerror(errno)); } fclose(fp); snprintf(p, p_max_size, "%d", speed); } /* get the measured temperatures from the temperature sensors * on IBM/Lenovo laptops running the ibm acpi. * There are 8 values in /proc/acpi/ibm/thermal, and according to * http://ibm-acpi.sourceforge.net/README * these mean the following (at least on an IBM R51...) * 0: CPU (also on the T series laptops) * 1: Mini PCI Module (?) * 2: HDD (?) * 3: GPU (also on the T series laptops) * 4: Battery (?) * 5: N/A * 6: Battery (?) * 7: N/A * I'm not too sure about those with the question mark, but the values I'm * reading from *my* thermal file (on a T42p) look realistic for the * hdd and the battery. * #5 and #7 are always -128. * /proc/acpi/ibm/thermal looks like this (1 line): temperatures: 41 43 31 46 33 -128 29 -128 * Peter Tarjan (ptarjan@citromail.hu) */ int get_ibm_acpi_temps(void) { FILE *fp; char thermal[128]; snprintf(thermal, 127, "%s/thermal", IBM_ACPI_DIR); fp = fopen(thermal, "r"); if (fp != nullptr) { while (!feof(fp)) { char line[256]; if (fgets(line, 255, fp) == nullptr) { break; } if (sscanf(line, "temperatures: %d %d %d %d %d %d %d %d", &ibm_acpi_temps[0], &ibm_acpi_temps[1], &ibm_acpi_temps[2], &ibm_acpi_temps[3], &ibm_acpi_temps[4], &ibm_acpi_temps[5], &ibm_acpi_temps[6], &ibm_acpi_temps[7])) { break; } } } else { CRIT_ERR(nullptr, NULL, "can't open '%s': %s\nYou are not using the IBM ACPI. Remove " "ibm* from your " PACKAGE_NAME " config file.", thermal, strerror(errno)); } fclose(fp); return 0; } /* get volume (0-14) on IBM/Lenovo laptops running the ibm acpi. * "Volume" here is none of the mixer volumes, but a "master of masters" * volume adjusted by the IBM volume keys. * /proc/acpi/ibm/fan looks like this (4 lines): level: 4 mute: off commands: up, down, mute commands: level ( is 0-15) * Peter Tarjan (ptarjan@citromail.hu) */ void get_ibm_acpi_volume(struct text_object *obj, char *p, unsigned int p_max_size) { FILE *fp; char volume[128]; unsigned int vol = -1; char mute[3] = ""; (void)obj; if (!p || p_max_size <= 0) { return; } snprintf(volume, 127, "%s/volume", IBM_ACPI_DIR); fp = fopen(volume, "r"); if (fp != nullptr) { while (!feof(fp)) { char line[256]; unsigned int read_vol = -1; if (fgets(line, 255, fp) == nullptr) { break; } if (sscanf(line, "level: %u", &read_vol)) { vol = read_vol; continue; } if (sscanf(line, "mute: %s", mute)) { break; } } } else { CRIT_ERR(nullptr, NULL, "can't open '%s': %s\nYou are not using the IBM ACPI. Remove " "ibm* from your " PACKAGE_NAME " config file.", volume, strerror(errno)); } fclose(fp); if (strcmp(mute, "on") == 0) snprintf(p, p_max_size, "%s", "mute"); else snprintf(p, p_max_size, "%d", vol); } /* static FILE *fp = nullptr; */ /* get LCD brightness on IBM/Lenovo laptops running the ibm acpi. * /proc/acpi/ibm/brightness looks like this (3 lines): level: 7 commands: up, down commands: level ( is 0-7) * Peter Tarjan (ptarjan@citromail.hu) */ void get_ibm_acpi_brightness(struct text_object *obj, char *p, unsigned int p_max_size) { FILE *fp; unsigned int brightness = 0; char filename[128]; (void)obj; if (!p || p_max_size <= 0) { return; } snprintf(filename, 127, "%s/brightness", IBM_ACPI_DIR); fp = fopen(filename, "r"); if (fp != nullptr) { while (!feof(fp)) { char line[256]; if (fgets(line, 255, fp) == nullptr) { break; } if (sscanf(line, "level: %u", &brightness)) { break; } } } else { CRIT_ERR(nullptr, NULL, "can't open '%s': %s\nYou are not using the IBM ACPI. Remove " "ibm* from your " PACKAGE_NAME " config file.", filename, strerror(errno)); } fclose(fp); snprintf(p, p_max_size, "%d", brightness); } /* get ThinkLight status on IBM/Lenovo laptops running the ibm acpi. * /proc/acpi/ibm/light looks like this (2 lines): status: off commands: on, off * http://ibm-acpi.sourceforge.net/README reports that it's also possible to * get "unknown" for a few models that do not make the status available. * Lluis Esquerda (eskerda@gmail.com) */ void get_ibm_acpi_thinklight(struct text_object *obj, char *p, unsigned int p_max_size) { FILE *fp; char thinklight[8]; char filename[128]; (void)obj; if (!p || p_max_size <= 0) { return; } snprintf(filename, 127, "%s/light", IBM_ACPI_DIR); fp = fopen(filename, "r"); if (fp != nullptr) { while (!feof(fp)) { char line[256]; if (fgets(line, 255, fp) == nullptr) { break; } if (sscanf(line, "status: %s", thinklight)) { break; } } } else { CRIT_ERR(nullptr, NULL, "can't open '%s': %s\nYou are not using the IBM " "ACPI. Remove ibm* from your " PACKAGE_NAME " config file.", filename, strerror(errno)); } fclose(fp); snprintf(p, p_max_size, "%s", thinklight); } void parse_ibm_temps_arg(struct text_object *obj, const char *arg) { if (!isdigit(arg[0]) || strlen(arg) > 1 || atoi(&arg[0]) >= 8) { obj->data.l = 0; NORM_ERR( "Invalid temperature sensor! Sensor number must be 0 to 7. " "Using 0 (CPU temp sensor)."); } else obj->data.l = atoi(arg); } void print_ibm_temps(struct text_object *obj, char *p, unsigned int p_max_size) { temp_print(p, p_max_size, ibm_acpi_temps[obj->data.l], TEMP_CELSIUS, 1); } conky-1.12.2/src/ibm.h000066400000000000000000000025051404127277500144420ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _IBM_H #define _IBM_H void get_ibm_acpi_fan(struct text_object *, char *, unsigned int); int get_ibm_acpi_temps(void); void get_ibm_acpi_volume(struct text_object *, char *, unsigned int); void get_ibm_acpi_brightness(struct text_object *, char *, unsigned int); void get_ibm_acpi_thinklight(struct text_object *, char *, unsigned int); void parse_ibm_temps_arg(struct text_object *, const char *); void print_ibm_temps(struct text_object *, char *, unsigned int); #endif /* _IBM_H */ conky-1.12.2/src/ical.cc000066400000000000000000000133011404127277500147350ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include "conky.h" #include "logging.h" struct ical_event { icaltimetype start; icalcomponent *event; ical_event *next, *prev; }; struct obj_ical { struct ical_event *list; icalcomponent *comps; icalparser *parser; unsigned int num; }; char *read_stream(char *s, size_t size, void *d) { return fgets(s, size, (FILE *)d); } struct ical_event *add_event(struct ical_event *listend, icalcomponent *new_ev) { struct ical_event *ev_new, *ev_cur; icaltimetype start; start = icalcomponent_get_dtstart(new_ev); if (icaltime_compare( start, icaltime_from_timet_with_zone(time(nullptr), 0, NULL)) <= 0) { icalproperty *rrule = icalcomponent_get_first_property(new_ev, ICAL_RRULE_PROPERTY); if (rrule) { icalrecur_iterator *ritr = icalrecur_iterator_new(icalproperty_get_rrule(rrule), start); icaltimetype nexttime = icalrecur_iterator_next(ritr); while (!icaltime_is_null_time(nexttime)) { if (icaltime_compare(nexttime, icaltime_from_timet_with_zone( time(nullptr), 0, NULL)) > 0) { start = nexttime; break; } nexttime = icalrecur_iterator_next(ritr); } icalrecur_iterator_free(ritr); } else return nullptr; } ev_new = (struct ical_event *)malloc(sizeof(struct ical_event)); memset(ev_new, 0, sizeof(struct ical_event)); ev_new->event = new_ev; ev_new->start = start; if (listend) { // list already contains events ev_cur = listend; while (icaltime_compare(ev_new->start, ev_cur->start) <= 0) { if (!ev_cur->prev) { // ev_new starts first ev_new->next = ev_cur; ev_cur->prev = ev_new; return listend; } ev_cur = ev_cur->prev; } if (ev_cur == listend) { // ev_new starts last ev_cur->next = ev_new; ev_new->prev = ev_cur; return ev_new; } // ev_new somewhere in the middle ev_new->prev = ev_cur; ev_new->next = ev_cur->next; ev_cur->next->prev = ev_new; ev_cur->next = ev_new; return listend; } return ev_new; } void parse_ical_args(struct text_object *obj, const char *arg, void *free_at_crash, void *free_at_crash2) { char *filename = strdup(arg); FILE *file; icalparser *parser; icalcomponent *allc, *curc; struct ical_event *ll_start, *ll_end, *ll_new; struct obj_ical *opaque; unsigned int num; if (sscanf(arg, "%d %s", &num, filename) != 2) { free(filename); free(obj); CRIT_ERR(free_at_crash, free_at_crash2, "wrong number of arguments for $ical"); } file = fopen(filename, "r"); if (!file) { free(obj); free(free_at_crash); CRIT_ERR(filename, free_at_crash2, "Can't read file %s", filename); return; } free(filename); parser = icalparser_new(); icalparser_set_gen_data(parser, file); allc = icalparser_parse(parser, read_stream); fclose(file); curc = icalcomponent_get_first_component(allc, ICAL_VEVENT_COMPONENT); if (!curc) { icalparser_free(parser); icalcomponent_free(allc); NORM_ERR("No ical events available"); return; } ll_start = add_event(nullptr, curc); ll_end = ll_start; while (1) { curc = icalcomponent_get_next_component(allc, ICAL_VEVENT_COMPONENT); if (!curc) break; ll_new = add_event(ll_end, curc); if (!ll_start) { // first component was not added ll_start = ll_new; ll_end = ll_new; } else if (ll_start->prev) { ll_start = ll_start->prev; } else if (ll_end->next) { ll_end = ll_end->next; } } opaque = (struct obj_ical *)malloc(sizeof(struct obj_ical)); opaque->list = ll_start; opaque->parser = parser; opaque->comps = allc; opaque->num = num; obj->data.opaque = opaque; free(opaque); } void print_ical(struct text_object *obj, char *p, unsigned int p_max_size) { struct obj_ical *ical_obj = (struct obj_ical *)obj->data.opaque; struct ical_event *ll_current; if (!ical_obj) return; ll_current = ical_obj->list; unsigned int i = 1; while (1) { if (!ll_current) return; if (i > ical_obj->num) return; if (i == ical_obj->num) break; if (i < ical_obj->num) { ll_current = ll_current->next; i++; } } snprintf(p, p_max_size, "%s", icalproperty_get_summary(icalcomponent_get_first_property( ll_current->event, ICAL_SUMMARY_PROPERTY))); } void free_ical(struct text_object *obj) { struct obj_ical *ical_free_me = (struct obj_ical *)obj->data.opaque; if (!ical_free_me) return; icalcomponent_free(ical_free_me->comps); icalparser_free(ical_free_me->parser); while (ical_free_me->list) { if (ical_free_me->list->next) { ical_free_me->list = ical_free_me->list->next; free_and_zero(ical_free_me->list->prev); } else free_and_zero(ical_free_me->list); } free(obj->data.opaque); } conky-1.12.2/src/ical.h000066400000000000000000000020671404127277500146060ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef ICAL_H_ #define ICAL_H_ void parse_ical_args(struct text_object *, const char *, void *, void *); void print_ical(struct text_object *, char *, unsigned int); void free_ical(struct text_object *); #endif /*ICAL_H_*/ conky-1.12.2/src/iconv_tools.cc000066400000000000000000000100261404127277500163640ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include #include "config.h" #include "logging.h" #include "text_object.h" #define ICONV_CODEPAGE_LENGTH 20 static long iconv_selected; static long iconv_count = 0; static char iconv_converting = 0; static iconv_t **iconv_cd = 0; int register_iconv(iconv_t *new_iconv) { iconv_cd = (void ***)realloc(iconv_cd, sizeof(iconv_t *) * (iconv_count + 1)); if (!iconv_cd) { CRIT_ERR(nullptr, NULL, "Out of memory"); } iconv_cd[iconv_count] = (void **)malloc(sizeof(iconv_t)); if (!iconv_cd[iconv_count]) { CRIT_ERR(nullptr, NULL, "Out of memory"); } memcpy(iconv_cd[iconv_count], new_iconv, sizeof(iconv_t)); iconv_count++; return iconv_count; } void free_iconv(struct text_object *obj) { long i; (void)obj; if (!iconv_cd) return; for (i = 0; i < iconv_count; i++) { if (iconv_cd[i]) { iconv_close(*iconv_cd[i]); free(iconv_cd[i]); } } free(iconv_cd); iconv_cd = 0; } void iconv_convert(size_t *a, char *buff_in, char *p, size_t p_max_size) { int bytes; size_t dummy1, dummy2; #if defined(__DragonFly__) const char *ptr = buff_in; #else char *ptr = buff_in; #endif char *outptr = p; if (*a <= 0 || !iconv_converting || iconv_selected <= 0 || iconv_cd[iconv_selected - 1] == (iconv_t)(-1)) return; dummy1 = dummy2 = *a; strncpy(buff_in, p, p_max_size); iconv(*iconv_cd[iconv_selected - 1], nullptr, NULL, NULL, NULL); while (dummy1 > 0) { bytes = iconv(*iconv_cd[iconv_selected - 1], &ptr, &dummy1, &outptr, &dummy2); if (bytes == -1) { NORM_ERR("Iconv codeset conversion failed"); break; } } /* It is necessary when we are converting from multibyte to * singlebyte codepage */ // a = outptr - p; //(*a) = *a - dummy2; (*a) = outptr - p; } void init_iconv_start(struct text_object *obj, void *free_at_crash, const char *arg) { char iconv_from[ICONV_CODEPAGE_LENGTH]; char iconv_to[ICONV_CODEPAGE_LENGTH]; if (iconv_converting) { CRIT_ERR(obj, free_at_crash, "You must stop your last iconv conversion before " "starting another"); } if (sscanf(arg, "%s %s", iconv_from, iconv_to) != 2) { CRIT_ERR(obj, free_at_crash, "Invalid arguments for iconv_start"); } else { iconv_t new_iconv; new_iconv = iconv_open(iconv_to, iconv_from); if (new_iconv == (iconv_t)(-1)) { NORM_ERR("Can't convert from %s to %s.", iconv_from, iconv_to); } else { obj->data.i = register_iconv(&new_iconv); iconv_converting = 1; } } } void init_iconv_stop(void) { iconv_converting = 0; } void print_iconv_start(struct text_object *obj, char *p, unsigned int p_max_size) { (void)p; (void)p_max_size; iconv_converting = 1; iconv_selected = obj->data.i; } void print_iconv_stop(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; (void)p; (void)p_max_size; iconv_converting = 0; iconv_selected = 0; } conky-1.12.2/src/iconv_tools.h000066400000000000000000000026561404127277500162400ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _ICONV_TOOLS_H #define _ICONV_TOOLS_H void free_iconv(struct text_object *); void iconv_convert(size_t *, char *, char *, size_t); void init_iconv_start(struct text_object *, void *, const char *); void init_iconv_stop(void); void print_iconv_start(struct text_object *, char *, unsigned int); void print_iconv_stop(struct text_object *, char *, unsigned int); #endif /* _ICONV_TOOLS_H */ conky-1.12.2/src/imlib2.cc000066400000000000000000000203371404127277500152120ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, et. al. * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "imlib2.h" #include "config.h" #include "conky.h" #include "logging.h" #include "text_object.h" #include #include #include #include #include #include #include "x11.h" struct image_list_s { char name[1024]; Imlib_Image image; int x, y, w, h; int wh_set; char no_cache; int flush_interval; struct image_list_s *next; }; struct image_list_s *image_list_start, *image_list_end; /* areas to update */ Imlib_Updates updates, current_update; /* our virtual framebuffer image we draw into */ Imlib_Image buffer, image; namespace { Imlib_Context context; conky::range_config_setting imlib_cache_flush_interval( "imlib_cache_flush_interval", 0, std::numeric_limits::max(), 0, true); unsigned int cimlib_cache_flush_last = 0; conky::simple_config_setting draw_blended("draw_blended", true, true); } // namespace void imlib_cache_size_setting::lua_setter(lua::state &l, bool init) { lua::stack_sentry s(l, -2); Base::lua_setter(l, init); if (init && out_to_x.get(l)) { image_list_start = image_list_end = nullptr; context = imlib_context_new(); imlib_context_push(context); imlib_set_cache_size(do_convert(l, -1).first); /* set the maximum number of colors to allocate for 8bpp and less to 256 */ imlib_set_color_usage(256); /* dither for depths < 24bpp */ imlib_context_set_dither(1); /* set the display , visual, colormap and drawable we are using */ imlib_context_set_display(display); imlib_context_set_visual(window.visual); imlib_context_set_colormap(window.colourmap); imlib_context_set_drawable(window.drawable); } ++s; } void imlib_cache_size_setting::cleanup(lua::state &l) { lua::stack_sentry s(l, -1); if (out_to_x.get(l)) { cimlib_cleanup(); imlib_context_disconnect_display(); imlib_context_pop(); imlib_context_free(context); } } void cimlib_cleanup() { struct image_list_s *cur = image_list_start, *last = nullptr; while (cur != nullptr) { last = cur; cur = last->next; free(last); } image_list_start = image_list_end = nullptr; } void cimlib_add_image(const char *args) { struct image_list_s *cur = nullptr; const char *tmp; cur = new struct image_list_s[sizeof(struct image_list_s)]; memset(cur, 0, sizeof(struct image_list_s)); if (sscanf(args, "%1023s", cur->name) == 0) { NORM_ERR( "Invalid args for $image. Format is: ' (-p" "x,y) (-s WxH) (-n) (-f interval)' (got '%s')", args); delete[] cur; return; } strncpy(cur->name, to_real_path(cur->name).c_str(), 1024); cur->name[1023] = 0; // // now we check for optional args tmp = strstr(args, "-p "); if (tmp != nullptr) { tmp += 3; sscanf(tmp, "%i,%i", &cur->x, &cur->y); #ifdef BUILD_XFT cur->x = xft_dpi_scale(cur->x); cur->y = xft_dpi_scale(cur->y); #endif /* BUILD_XFT */ } tmp = strstr(args, "-s "); if (tmp != nullptr) { tmp += 3; if (sscanf(tmp, "%ix%i", &cur->w, &cur->h) != 0) { cur->wh_set = 1; } #ifdef BUILD_XFT cur->w = xft_dpi_scale(cur->w); cur->h = xft_dpi_scale(cur->h); #endif /* BUILD_XFT */ } tmp = strstr(args, "-n"); if (tmp != nullptr) { cur->no_cache = 1; } tmp = strstr(args, "-f "); if (tmp != nullptr) { tmp += 3; if (sscanf(tmp, "%d", &cur->flush_interval) != 0) { cur->no_cache = 0; } } tmp = strstr(args, "-i "); if (tmp != nullptr) { tmp += 3; int i; if (sscanf(tmp, "%d", &i) == 1) { cur->x = get_saved_coordinates_x(i); cur->y = get_saved_coordinates_y(i); } } if (cur->flush_interval < 0) { NORM_ERR("Imlib2: flush interval should be >= 0"); cur->flush_interval = 0; } if (image_list_end != nullptr) { image_list_end->next = cur; image_list_end = cur; } else { image_list_start = image_list_end = cur; } } static void cimlib_draw_image(struct image_list_s *cur, int *clip_x, int *clip_y, int *clip_x2, int *clip_y2) { int w, h; time_t now = time(nullptr); static int rep = 0; if (imlib_context_get_drawable() != window.drawable) { imlib_context_set_drawable(window.drawable); } image = imlib_load_image(cur->name); if (image == nullptr) { if (rep == 0) { NORM_ERR("Unable to load image '%s'", cur->name); } rep = 1; return; } rep = 0; /* reset so disappearing images are reported */ DBGP( "Drawing image '%s' at (%i,%i) scaled to %ix%i, " "caching interval set to %i (with -n opt %i)", cur->name, cur->x, cur->y, cur->w, cur->h, cur->flush_interval, cur->no_cache); imlib_context_set_image(image); /* turn alpha channel on */ imlib_image_set_has_alpha(1); w = imlib_image_get_width(); h = imlib_image_get_height(); if (cur->wh_set == 0) { cur->w = xft_dpi_scale(w); cur->h = xft_dpi_scale(h); } imlib_context_set_image(buffer); imlib_blend_image_onto_image(image, 1, 0, 0, w, h, cur->x, cur->y, cur->w, cur->h); imlib_context_set_image(image); if ((cur->no_cache != 0) || ((cur->flush_interval != 0) && now % cur->flush_interval == 0)) { imlib_free_image_and_decache(); } else { imlib_free_image(); } if (cur->x < *clip_x) { *clip_x = cur->x; } if (cur->y < *clip_y) { *clip_y = cur->y; } if (cur->x + cur->w > *clip_x2) { *clip_x2 = cur->x + cur->w; } if (cur->y + cur->h > *clip_y2) { *clip_y2 = cur->y + cur->h; } } static void cimlib_draw_all(int *clip_x, int *clip_y, int *clip_x2, int *clip_y2) { struct image_list_s *cur = image_list_start; while (cur != nullptr) { cimlib_draw_image(cur, clip_x, clip_y, clip_x2, clip_y2); cur = cur->next; } } void cimlib_render(int x, int y, int width, int height) { int clip_x = INT_MAX, clip_y = INT_MAX; int clip_x2 = 0, clip_y2 = 0; time_t now; if (image_list_start == nullptr) { return; /* are we actually drawing anything? */ } /* cheque if it's time to flush our cache */ now = time(nullptr); if ((imlib_cache_flush_interval.get(*state) != 0u) && now - imlib_cache_flush_interval.get(*state) > cimlib_cache_flush_last) { int size = imlib_get_cache_size(); imlib_set_cache_size(0); imlib_set_cache_size(size); cimlib_cache_flush_last = now; DBGP("Flushing Imlib2 cache (%li)\n", now); } /* take all the little rectangles to redraw and merge them into * something sane for rendering */ buffer = imlib_create_image(width, height); /* clear our buffer */ imlib_context_set_image(buffer); imlib_image_clear(); /* check if we should blend when rendering */ if (draw_blended.get(*state)) { /* we can blend stuff now */ imlib_context_set_blend(1); } else { imlib_context_set_blend(0); } /* turn alpha channel on */ imlib_image_set_has_alpha(1); cimlib_draw_all(&clip_x, &clip_y, &clip_x2, &clip_y2); /* set the buffer image as our current image */ imlib_context_set_image(buffer); /* setup our clip rect */ if (clip_x == INT_MAX) { clip_x = 0; } if (clip_y == INT_MAX) { clip_y = 0; } /* render the image at 0, 0 */ imlib_render_image_part_on_drawable_at_size( clip_x, clip_y, clip_x2 - clip_x, clip_y2 - clip_y, x + clip_x, y + clip_y, clip_x2 - clip_x, clip_y2 - clip_y); /* don't need that temporary buffer image anymore */ imlib_free_image(); } void print_image_callback(struct text_object *obj, char *, unsigned int) { cimlib_add_image(obj->data.s); } conky-1.12.2/src/imlib2.h000066400000000000000000000033271404127277500150540ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, et. al. * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _CONKY_IMBLI2_H_ #define _CONKY_IMBLI2_H_ #include "conky.h" #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wvariadic-macros" #include #pragma GCC diagnostic pop void cimlib_add_image(const char *args); void cimlib_set_cache_size(long size); void cimlib_set_cache_flush_interval(long interval); void cimlib_render(int x, int y, int width, int height); void cimlib_cleanup(void); void print_image_callback(struct text_object *, char *, unsigned int); class imlib_cache_size_setting : public conky::range_config_setting { typedef conky::range_config_setting Base; protected: virtual void lua_setter(lua::state &l, bool init); virtual void cleanup(lua::state &l); public: imlib_cache_size_setting() : Base("imlib_cache_size", 0, std::numeric_limits::max(), 4096 * 1024, true) {} }; #endif /* _CONKY_IMBLI2_H_ */ conky-1.12.2/src/intel_backlight.cc000066400000000000000000000060561404127277500171610ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo. * * Any original torsmo code is licensed under the BSD license. * All code written since the fork of torsmo is licensed under the GPL. * Please see COPYING for details. * * Copyright (c) 2021 Rogier Reerink * (See AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "intel_backlight.h" #include "logging.h" #define FS_BRIGHTNESS_MAX "/sys/class/backlight/intel_backlight/max_brightness" #define FS_BRIGHTNESS_CURRENT "/sys/class/backlight/intel_backlight/brightness" struct backlight { FILE *fp_max; unsigned max; FILE *fp_current; unsigned current; }; void open_backlight(struct backlight *bl) { bl->fp_max = fopen(FS_BRIGHTNESS_MAX, "r"); if (bl->fp_max == NULL) { NORM_ERR("Failed to open file: '" FS_BRIGHTNESS_MAX "'."); } bl->fp_current = fopen(FS_BRIGHTNESS_CURRENT, "r"); if (bl->fp_current == NULL) { NORM_ERR("Failed to open file: '" FS_BRIGHTNESS_CURRENT "'."); } } void read_backlight(struct backlight *bl) { FILE *fp_max, *fp_current; fp_max = bl->fp_max; if (fp_max != NULL) { rewind(fp_max); fflush(fp_max); if (fscanf(fp_max, "%u", &(bl->max)) < 0) { NORM_ERR("Failed to read maximum brightness."); } } else { bl->max = 0; } fp_current = bl->fp_current; if (fp_current != NULL) { rewind(fp_current); fflush(fp_current); if (fscanf(fp_current, "%u", &(bl->current)) < 0) { NORM_ERR("Failed to read current brightness."); } } else { bl->current = 0; } } unsigned get_backlight_percent(struct backlight *bl) { read_backlight(bl); if (bl->max == 0) { return 0; } else { return bl->current * 100.0 / bl->max + 0.5; } } void close_backlight(struct backlight *bl) { if (bl->fp_max != NULL) { fclose(bl->fp_max); } if (bl->fp_current != NULL) { fclose(bl->fp_current); } } void init_intel_backlight(struct text_object *obj) { struct backlight *bl = (struct backlight *)malloc(sizeof(struct backlight)); open_backlight(bl); obj->data.opaque = bl; } void free_intel_backlight(struct text_object *obj) { struct backlight *bl = (struct backlight *)obj->data.opaque; close_backlight(bl); free(bl); } void print_intel_backlight(struct text_object *obj, char *p, unsigned int p_max_size) { struct backlight *bl = (struct backlight *)obj->data.opaque; unsigned percent = get_backlight_percent(bl); snprintf(p, p_max_size, "%d", percent); }conky-1.12.2/src/intel_backlight.h000066400000000000000000000024421404127277500170160ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo. * * Any original torsmo code is licensed under the BSD license. * All code written since the fork of torsmo is licensed under the GPL. * Please see COPYING for details. * * Copyright (c) 2021 Rogier Reerink * (See AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _INTEL_BACKLIGHT_H #define _INTEL_BACKLIGHT_H #include "conky.h" #include "text_object.h" void init_intel_backlight(struct text_object *obj); void free_intel_backlight(struct text_object *obj); void print_intel_backlight(struct text_object *obj, char *p, unsigned int p_max_size); #endif /* _INTEL_BACKLIGHT_H */conky-1.12.2/src/irc.cc000066400000000000000000000157541404127277500146200ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include #include "conky.h" #include "logging.h" #include "text_object.h" struct ll_text { char *text; struct ll_text *next; }; struct obj_irc { pthread_t *thread; irc_session_t *session; char *arg; }; struct ctx { char *chan; int max_msg_lines; struct ll_text *messages; }; void ev_connected(irc_session_t *session, const char *, const char *, const char **, unsigned int) { struct ctx *ctxptr = (struct ctx *)irc_get_ctx(session); if (irc_cmd_join(session, ctxptr->chan, nullptr) != 0) { NORM_ERR("irc: %s", irc_strerror(irc_errno(session))); } } void addmessage(struct ctx *ctxptr, char *nick, const char *text) { struct ll_text *lastmsg = ctxptr->messages; struct ll_text *newmsg = (struct ll_text *)malloc(sizeof(struct ll_text)); newmsg->text = (char *)malloc(strlen(nick) + strlen(text) + 4); // 4 = ": \n" snprintf(newmsg->text, strlen(nick) + strlen(text) + 4, "%s: %s\n", nick, text); newmsg->next = nullptr; int msgcnt = 1; if (!lastmsg) { ctxptr->messages = newmsg; } else { msgcnt++; while (lastmsg->next) { lastmsg = lastmsg->next; msgcnt++; if (msgcnt < 0) { NORM_ERR("irc: too many messages, discarding the last one."); free(newmsg->text); free(newmsg); return; } } lastmsg->next = newmsg; } if (ctxptr->max_msg_lines > 0) { newmsg = ctxptr->messages; msgcnt -= ctxptr->max_msg_lines; while ((msgcnt > 0) && (ctxptr->messages)) { msgcnt--; newmsg = ctxptr->messages->next; free(ctxptr->messages->text); free(ctxptr->messages); ctxptr->messages = newmsg; } } } void ev_talkinchan(irc_session_t *session, const char *, const char *origin, const char **params, unsigned int) { char nickname[64]; struct ctx *ctxptr = (struct ctx *)irc_get_ctx(session); irc_target_get_nick(origin, nickname, sizeof(nickname)); addmessage(ctxptr, nickname, params[1]); } void ev_num(irc_session_t *session, unsigned int event, const char *, const char **params, unsigned int) { char attachment[4] = "_00"; if (event == 433) { // nick in use int len = strlen(params[1]) + 4; char *newnick = (char *)malloc(len); strncpy(newnick, params[1], len); attachment[1] += rand() % 10; attachment[2] += rand() % 10; strncat(newnick, attachment, len - 1); irc_cmd_nick(session, newnick); free(newnick); } } #define IRCSYNTAX \ "The correct syntax is ${irc server(:port) #channel (max_msg_lines)}" #define IRCPORT 6667 #define IRCNICK "conky" #define IRCSERVERPASS nullptr #define IRCUSER nullptr #define IRCREAL nullptr void *ircclient(void *ptr) { struct obj_irc *ircobj = (struct obj_irc *)ptr; struct ctx *ctxptr = (struct ctx *)malloc(sizeof(struct ctx)); irc_callbacks_t callbacks; char *server; char *strport; char *str_max_msg_lines; unsigned int port; memset(&callbacks, 0, sizeof(callbacks)); callbacks.event_connect = ev_connected; callbacks.event_channel = ev_talkinchan; callbacks.event_numeric = ev_num; ircobj->session = irc_create_session(&callbacks); server = strtok(ircobj->arg, " "); ctxptr->chan = strtok(nullptr, " "); if (!ctxptr->chan) { NORM_ERR("irc: %s", IRCSYNTAX); } str_max_msg_lines = strtok(nullptr, " "); if (str_max_msg_lines) { ctxptr->max_msg_lines = strtol(str_max_msg_lines, nullptr, 10); } ctxptr->messages = nullptr; irc_set_ctx(ircobj->session, ctxptr); server = strtok(server, ":"); strport = strtok(nullptr, ":"); if (strport) { port = strtol(strport, nullptr, 10); if (port < 1 || port > 65535) port = IRCPORT; } else { port = IRCPORT; } int err = irc_connect(ircobj->session, server, port, IRCSERVERPASS, IRCNICK, IRCUSER, IRCREAL); if (err != 0) { err = irc_errno(ircobj->session); } #ifdef BUILD_IPV6 if (err == LIBIRC_ERR_RESOLV) { err = irc_connect6(ircobj->session, server, port, IRCSERVERPASS, IRCNICK, IRCUSER, IRCREAL); if (err != 0) { err = irc_errno(ircobj->session); } } #endif /* BUILD_IPV6 */ if (err != 0) { NORM_ERR("irc: %s", irc_strerror(err)); } if (irc_run(ircobj->session) != 0) { int ircerror = irc_errno(ircobj->session); if (irc_is_connected(ircobj->session)) { NORM_ERR("irc: %s", irc_strerror(ircerror)); } else { NORM_ERR("irc: disconnected"); } } free(ircobj->arg); free(ctxptr); return nullptr; } void parse_irc_args(struct text_object *obj, const char *arg) { struct obj_irc *opaque = (struct obj_irc *)malloc(sizeof(struct obj_irc)); opaque->thread = (pthread_t *)malloc(sizeof(pthread_t)); srand(time(nullptr)); opaque->session = nullptr; opaque->arg = strdup(arg); pthread_create(opaque->thread, nullptr, ircclient, opaque); obj->data.opaque = opaque; } void print_irc(struct text_object *obj, char *p, unsigned int p_max_size) { struct obj_irc *ircobj = (struct obj_irc *)obj->data.opaque; struct ctx *ctxptr; struct ll_text *nextmsg, *curmsg; if (!ircobj->session) return; if (!irc_is_connected(ircobj->session)) return; ctxptr = (struct ctx *)irc_get_ctx(ircobj->session); curmsg = ctxptr->messages; while (curmsg) { nextmsg = curmsg->next; strncat(p, curmsg->text, p_max_size - strlen(p) - 1); if (!ctxptr->max_msg_lines) { free(curmsg->text); free(curmsg); } curmsg = nextmsg; } if (p[0] != 0) { p[strlen(p) - 1] = 0; } if (!ctxptr->max_msg_lines) { ctxptr->messages = nullptr; } } void free_irc(struct text_object *obj) { struct obj_irc *ircobj = (struct obj_irc *)obj->data.opaque; struct ctx *ctxptr; struct ll_text *nextmsg, *curmsg = nullptr; if (ircobj->session) { if (irc_is_connected(ircobj->session)) { ctxptr = (struct ctx *)irc_get_ctx(ircobj->session); curmsg = ctxptr->messages; irc_disconnect(ircobj->session); } pthread_join(*(ircobj->thread), nullptr); irc_destroy_session(ircobj->session); } free(ircobj->thread); free(obj->data.opaque); while (curmsg) { nextmsg = curmsg->next; free(curmsg->text); free(curmsg); curmsg = nextmsg; } } conky-1.12.2/src/irc.h000066400000000000000000000020411404127277500144430ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef IRC_H_ #define IRC_H_ void parse_irc_args(struct text_object *, const char *); void print_irc(struct text_object *, char *, unsigned int); void free_irc(struct text_object *); #endif /*IRC_H_*/ conky-1.12.2/src/journal.cc000066400000000000000000000125251404127277500155060ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include #include #include #include "common.h" #include "config.h" #include "conky.h" #include "logging.h" #include "text_object.h" #define MAX_JOURNAL_LINES 200 class journal { public: int wantedlines; int flags; journal() : wantedlines(0), flags(SD_JOURNAL_LOCAL_ONLY) {} }; void free_journal(struct text_object *obj) { journal *j = (journal *)obj->data.opaque; obj->data.opaque = nullptr; delete j; } void init_journal(const char *type, const char *arg, struct text_object *obj, void *free_at_crash) { unsigned int args; journal *j = new journal; std::unique_ptr tmp(new char[DEFAULT_TEXT_BUFFER_SIZE]); memset(tmp.get(), 0, DEFAULT_TEXT_BUFFER_SIZE); args = sscanf(arg, "%d %6s", &j->wantedlines, tmp.get()); if (args < 1 || args > 2) { free_journal(obj); CRIT_ERR(obj, free_at_crash, "%s a number of lines as 1st argument and optionally a journal " "type as 2nd argument", type); } if (j->wantedlines > 0 && j->wantedlines <= MAX_JOURNAL_LINES) { if (args > 1) { if (strcmp(tmp.get(), "system") == 0) { j->flags |= SD_JOURNAL_SYSTEM; #ifdef SD_JOURNAL_CURRENT_USER // not present in older version of systemd } else if (strcmp(tmp.get(), "user") == 0) { j->flags |= SD_JOURNAL_CURRENT_USER; #endif /* SD_JOURNAL_CURRENT_USER */ } else { free_journal(obj); CRIT_ERR(obj, free_at_crash, "invalid arg for %s, type must be 'system' or 'user'", type); } } else { NORM_ERR("You should type a 'user' or 'system' as an argument"); } } else { free_journal(obj); CRIT_ERR(obj, free_at_crash, "invalid arg for %s, number of lines must be between 1 and %d", type, MAX_JOURNAL_LINES); } obj->data.opaque = j; } static int print_field(sd_journal *jh, const char *field, char spacer, size_t *read, char *p, unsigned int p_max_size) { const void *get; size_t length; size_t fieldlen = strlen(field) + 1; int ret = sd_journal_get_data(jh, field, &get, &length); if (ret == -ENOENT) goto out; if (ret < 0 || length + *read > p_max_size) return -1; memcpy(p + *read, (const char *)get + fieldlen, length - fieldlen); *read += length - fieldlen; out: if (spacer) { if (p_max_size < *read) { *read = p_max_size - 1; } else { p[(*read)++] = spacer; } } return length ? length - fieldlen : 0; } bool read_log(size_t *read, size_t *length, time_t *time, uint64_t *timestamp, sd_journal *jh, char *p, unsigned int p_max_size) { struct tm tm; if (sd_journal_get_realtime_usec(jh, timestamp) < 0) return false; *time = *timestamp / 1000000; localtime_r(time, &tm); if ((*length = strftime(p + *read, p_max_size - *read, "%b %d %H:%M:%S", &tm)) <= 0) return false; *read += *length; if (p_max_size < *read) { *read = p_max_size - 1; return false; } p[*read++] = ' '; if (print_field(jh, "_HOSTNAME", ' ', read, p, p_max_size) < 0) return false; if (print_field(jh, "SYSLOG_IDENTIFIER", '[', read, p, p_max_size) < 0) return false; if (print_field(jh, "_PID", ']', read, p, p_max_size) < 0) return false; if (p_max_size < *read) { *read = p_max_size - 1; return false; } p[*read++] = ':'; if (p_max_size < *read) { *read = p_max_size - 1; return false; } p[*read++] = ' '; if (print_field(jh, "MESSAGE", '\n', read, p, p_max_size) < 0) return false; return true; } void print_journal(struct text_object *obj, char *p, unsigned int p_max_size) { journal *j = (journal *)obj->data.opaque; sd_journal *jh = nullptr; size_t read = 0; size_t length; time_t time; uint64_t timestamp; if (sd_journal_open(&jh, j->flags) != 0) { NORM_ERR("unable to open journal"); goto out; } if (sd_journal_seek_tail(jh) < 0) { NORM_ERR("unable to seek to end of journal"); goto out; } if (sd_journal_previous_skip(jh, j->wantedlines) < 0) { NORM_ERR("unable to seek back %d lines", j->wantedlines); goto out; } while (read_log(&read, &length, &time, ×tamp, jh, p, p_max_size) && sd_journal_next(jh)) ; out: if (jh) sd_journal_close(jh); p[read] = '\0'; } conky-1.12.2/src/journal.h000066400000000000000000000024241404127277500153450ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _JOURNAL_H #define _JOURNAL_H void free_journal(struct text_object *); void init_journal(const char *, const char *, struct text_object *, void *); void print_journal(struct text_object *, char *, unsigned int); #endif /* _JOURNAL_H */ conky-1.12.2/src/libmpdclient.cc000066400000000000000000001727371404127277500165160ustar00rootroot00000000000000/* * * libmpdclient * (c)2003-2006 by Warren Dukes (warren.dukes@gmail.com) * This project's homepage is: http://www.musicpd.org * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * - Neither the name of the Music Player Daemon nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #include "libmpdclient.h" #include "conky.h" #include #include #include #include #include #include #include #ifdef WIN32 #include #include #else #include #include #include #include #include #endif #ifndef SUN_LEN #define SUN_LEN(a) sizeof(a) #endif #ifndef SOCK_CLOEXEC #define SOCK_CLOEXEC O_CLOEXEC #endif /* SOCK_CLOEXEC */ /* (bits + 1) / 3 (plus the sign character) */ #define INTLEN ((sizeof(int) * CHAR_BIT + 1) / 3 + 1) #define LONGLONGLEN ((sizeof(long long) * CHAR_BIT + 1) / 3 + 1) #define COMMAND_LIST 1 #define COMMAND_LIST_OK 2 #ifndef MPD_NO_GAI #ifdef AI_ADDRCONFIG #define MPD_HAVE_GAI #endif #endif #ifndef MSG_DONTWAIT #define MSG_DONTWAIT 0 #endif #ifdef WIN32 #define SELECT_ERRNO_IGNORE (errno == WSAEINTR || errno == WSAEINPROGRESS) #define SENDRECV_ERRNO_IGNORE SELECT_ERRNO_IGNORE #else #define SELECT_ERRNO_IGNORE (errno == EINTR) #define SENDRECV_ERRNO_IGNORE (errno == EINTR || errno == EAGAIN) #define winsock_dll_error(c) 0 #define closesocket(s) close(s) #define WSACleanup() \ do { /* nothing */ \ } while (0) #endif #ifdef WIN32 static int winsock_dll_error(mpd_Connection *connection) { WSADATA wsaData; if ((WSAStartup(MAKEWORD(2, 2), &wsaData)) != 0 || LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 2) { strncpy(connection->errorStr, "Could not find usable WinSock DLL.", MPD_ERRORSTR_MAX_LENGTH); connection->error = MPD_ERROR_SYSTEM; return 1; } return 0; } static int do_connect_fail(mpd_Connection *connection, const struct sockaddr *serv_addr, int addrlen) { int iMode = 1; /* 0 = blocking, else non-blocking */ ioctlsocket(connection->sock, FIONBIO, (u_long FAR *)&iMode); return (connect(connection->sock, serv_addr, addrlen) == SOCKET_ERROR && WSAGetLastError() != WSAEWOULDBLOCK); } #else /* !WIN32 (sane operating systems) */ static int do_connect_fail(mpd_Connection *connection, const struct sockaddr *serv_addr, int addrlen) { int flags = fcntl(connection->sock, F_GETFL, 0); fcntl(connection->sock, F_SETFL, flags | O_NONBLOCK); return static_cast(connect(connection->sock, serv_addr, addrlen) < 0 && errno != EINPROGRESS); } #endif /* !WIN32 */ static int uds_connect(mpd_Connection *connection, const char *host, float timeout) { struct sockaddr_un addr {}; strncpy(addr.sun_path, host, sizeof(addr.sun_path) - 1); addr.sun_family = AF_UNIX; addr.sun_path[sizeof(addr.sun_path) - 1] = 0; connection->sock = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0); if (connection->sock < 0) { snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "problems creating socket: %s", strerror(errno)); connection->error = MPD_ERROR_SYSTEM; return -1; } mpd_setConnectionTimeout(connection, timeout); /* connect stuff */ if (do_connect_fail(connection, reinterpret_cast(&addr), SUN_LEN(&addr)) != 0) { snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "problems connecting socket: %s", strerror(errno)); closesocket(connection->sock); connection->sock = -1; connection->error = MPD_ERROR_SYSTEM; return -1; } return 0; } #ifdef MPD_HAVE_GAI static int mpd_connect(mpd_Connection *connection, const char *host, int port, float timeout) { int error; char service[INTLEN + 1]; struct addrinfo hints {}; struct addrinfo *res = nullptr; struct addrinfo *addrinfo = nullptr; if (*host == '/') { return uds_connect(connection, host, timeout); } /* Setup hints */ hints.ai_flags = AI_ADDRCONFIG; hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; hints.ai_addrlen = 0; hints.ai_addr = nullptr; hints.ai_canonname = nullptr; hints.ai_next = nullptr; snprintf(service, sizeof(service), "%i", port); error = getaddrinfo(host, service, &hints, &addrinfo); if (error != 0) { snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "host \"%s\" not found: %s", host, gai_strerror(error)); connection->error = MPD_ERROR_UNKHOST; return -1; } for (res = addrinfo; res != nullptr; res = res->ai_next) { /* create socket */ if (connection->sock > -1) { closesocket(connection->sock); } connection->sock = socket(res->ai_family, SOCK_STREAM | SOCK_CLOEXEC, res->ai_protocol); if (connection->sock < 0) { snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "problems creating socket: %s", strerror(errno)); connection->error = MPD_ERROR_SYSTEM; freeaddrinfo(addrinfo); return -1; } mpd_setConnectionTimeout(connection, timeout); /* connect stuff */ if (do_connect_fail(connection, res->ai_addr, res->ai_addrlen) != 0) { /* try the next address family */ closesocket(connection->sock); connection->sock = -1; continue; } } freeaddrinfo(addrinfo); if (connection->sock < 0) { snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "problems connecting to \"%s\" on port %i: %s", host, port, strerror(errno)); connection->error = MPD_ERROR_CONNPORT; return -1; } return 0; } #else /* !MPD_HAVE_GAI */ static int mpd_connect(mpd_Connection *connection, const char *host, int port, float timeout) { struct hostent he, *he_res = 0; int he_errno; char hostbuff[2048]; struct sockaddr *dest; int destlen; struct sockaddr_in sin; if (*host == '/') return uds_connect(connection, host, timeout); #ifdef HAVE_GETHOSTBYNAME_R if (gethostbyname_r(host, &he, hostbuff, sizeof(hostbuff), &he_res, &he_errno)) { // get the host info snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "%s ('%s')", hstrerror(h_errno), host); connection->error = MPD_ERROR_UNKHOST; return -1; } #else /* HAVE_GETHOSTBYNAME_R */ if (!(he_res = gethostbyname(host))) { snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "host \"%s\" not found", host); connection->error = MPD_ERROR_UNKHOST; return -1; } #endif /* HAVE_GETHOSTBYNAME_R */ memset(&sin, 0, sizeof(struct sockaddr_in)); /* dest.sin_family = he_res->h_addrtype; */ sin.sin_family = AF_INET; sin.sin_port = htons(port); switch (he_res->h_addrtype) { case AF_INET: memcpy((char *)&sin.sin_addr.s_addr, (char *)he_res->h_addr, he_res->h_length); dest = (struct sockaddr *)&sin; destlen = sizeof(struct sockaddr_in); break; default: strncpy(connection->errorStr, "address type is not IPv4", MPD_ERRORSTR_MAX_LENGTH); connection->error = MPD_ERROR_SYSTEM; return -1; break; } if (connection->sock > -1) { closesocket(connection->sock); } if ((connection->sock = socket(dest->sa_family, SOCK_STREAM, 0)) < 0) { strncpy(connection->errorStr, "problems creating socket", MPD_ERRORSTR_MAX_LENGTH); connection->error = MPD_ERROR_SYSTEM; return -1; } mpd_setConnectionTimeout(connection, timeout); /* connect stuff */ if (do_connect_fail(connection, dest, destlen)) { snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "problems connecting to \"%s\" on port %i", host, port); connection->error = MPD_ERROR_CONNPORT; return -1; } return 0; } #endif /* !MPD_HAVE_GAI */ const char *mpdTagItemKeys[MPD_TAG_NUM_OF_ITEM_TYPES] = { "Artist", "Album", "Title", "Track", "Name", "Genre", "Date", "Composer", "Performer", "Comment", "Disc", "Filename", "Any"}; static char *mpd_sanitizeArg(const char *arg) { size_t i; char *ret; const char *c; char *rc; /* instead of counting in that loop above, * just use a bit more memory and halve running time */ ret = static_cast(malloc(strlen(arg) * 2 + 1)); c = arg; rc = ret; for (i = strlen(arg) + 1; i != 0; --i) { if (*c == '"' || *c == '\\') { *rc++ = '\\'; } *(rc++) = *(c++); } return ret; } static mpd_ReturnElement *mpd_newReturnElement(const char *name, const char *value) { auto *ret = static_cast(malloc(sizeof(mpd_ReturnElement))); ret->name = strndup(name, text_buffer_size.get(*state)); ret->value = strndup(value, text_buffer_size.get(*state)); return ret; } static void mpd_freeReturnElement(mpd_ReturnElement *re) { free(re->name); free(re->value); free(re); } void mpd_setConnectionTimeout(mpd_Connection *connection, float timeout) { connection->timeout.tv_sec = static_cast(timeout); connection->timeout.tv_usec = static_cast((timeout - connection->timeout.tv_sec) * 1e6 + 0.5); } static int mpd_parseWelcome(mpd_Connection *connection, const char *host, int port, /* char *rt, */ char *output) { char *tmp; char *test; int i; if (static_cast(strncmp(output, MPD_WELCOME_MESSAGE, strlen(MPD_WELCOME_MESSAGE)) != 0) != 0) { snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "mpd not running on port %i on host \"%s\"", port, host); connection->error = MPD_ERROR_NOTMPD; return 1; } tmp = &output[strlen(MPD_WELCOME_MESSAGE)]; for (i = 0; i < 3; i++) { if (tmp != nullptr) { connection->version[i] = strtol(tmp, &test, 10); } if ((tmp == nullptr) || (test[0] != '.' && test[0] != '\0')) { snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "error parsing version number at \"%s\"", &output[strlen(MPD_WELCOME_MESSAGE)]); connection->error = MPD_ERROR_NOTMPD; return 1; } tmp = ++test; } return 0; } mpd_Connection *mpd_newConnection(const char *host, int port, float timeout) { int err; char *rt; char *output = nullptr; auto *connection = static_cast(malloc(sizeof(mpd_Connection))); struct timeval tv {}; fd_set fds; strncpy(connection->buffer, "", 1); connection->buflen = 0; connection->bufstart = 0; strncpy(connection->errorStr, "", MPD_ERRORSTR_MAX_LENGTH); connection->error = 0; connection->doneProcessing = 0; connection->commandList = 0; connection->listOks = 0; connection->doneListOk = 0; connection->sock = -1; connection->returnElement = nullptr; connection->request = nullptr; if (winsock_dll_error(connection)) { return connection; } if (mpd_connect(connection, host, port, timeout) < 0) { return connection; } while ((rt = strstr(connection->buffer, "\n")) == nullptr) { tv.tv_sec = connection->timeout.tv_sec; tv.tv_usec = connection->timeout.tv_usec; FD_ZERO(&fds); FD_SET(connection->sock, &fds); if ((err = select(connection->sock + 1, &fds, nullptr, nullptr, &tv)) == 1) { int readed; readed = recv(connection->sock, &(connection->buffer[connection->buflen]), MPD_BUFFER_MAX_LENGTH - connection->buflen, 0); if (readed <= 0) { snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "problems getting a response from \"%s\" on port %i : %s", host, port, strerror(errno)); connection->error = MPD_ERROR_NORESPONSE; return connection; } connection->buflen += readed; connection->buffer[connection->buflen] = '\0'; } else if (err < 0) { if SELECT_ERRNO_IGNORE { continue; } snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "problems connecting to \"%s\" on port %i", host, port); connection->error = MPD_ERROR_CONNPORT; return connection; } else { snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "timeout in attempting to get a response from \"%s\" on " "port %i", host, port); connection->error = MPD_ERROR_NORESPONSE; return connection; } } *rt = '\0'; output = strndup(connection->buffer, text_buffer_size.get(*state)); strncpy(connection->buffer, rt + 1, MPD_BUFFER_MAX_LENGTH); connection->buflen = strlen(connection->buffer); if (mpd_parseWelcome(connection, host, port, /* rt, */ output) == 0) { connection->doneProcessing = 1; } free(output); return connection; } void mpd_clearError(mpd_Connection *connection) { connection->error = 0; connection->errorStr[0] = '\0'; } void mpd_closeConnection(mpd_Connection *connection) { if (connection != nullptr) { closesocket(connection->sock); free_and_zero(connection->returnElement); free_and_zero(connection->request); free(connection); } WSACleanup(); } static void mpd_executeCommand(mpd_Connection *connection, const char *command) { int ret; struct timeval tv {}; fd_set fds; const char *commandPtr = command; int commandLen = strlen(command); if ((connection->doneProcessing == 0) && (connection->commandList == 0)) { strncpy(connection->errorStr, "not done processing current command", MPD_ERRORSTR_MAX_LENGTH); connection->error = 1; return; } mpd_clearError(connection); FD_ZERO(&fds); FD_SET(connection->sock, &fds); tv.tv_sec = connection->timeout.tv_sec; tv.tv_usec = connection->timeout.tv_usec; do { ret = static_cast( select(connection->sock + 1, nullptr, &fds, nullptr, &tv)); if (ret != 1 && !SELECT_ERRNO_IGNORE) { break; } ret = send(connection->sock, commandPtr, commandLen, MSG_DONTWAIT); if (ret <= 0) { if SENDRECV_ERRNO_IGNORE { continue; } snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "problems giving command \"%s\"", command); connection->error = MPD_ERROR_SENDING; return; } commandPtr += ret; commandLen -= ret; } while (commandLen > 0); if (commandLen > 0) { perror(""); snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "timeout sending command \"%s\"", command); connection->error = MPD_ERROR_TIMEOUT; return; } if (connection->commandList == 0) { connection->doneProcessing = 0; } else if (connection->commandList == COMMAND_LIST_OK) { connection->listOks++; } } static void mpd_getNextReturnElement(mpd_Connection *connection) { char *output = nullptr; char *rt = nullptr; char *name = nullptr; char *value = nullptr; fd_set fds; struct timeval tv {}; char *tok = nullptr; int readed; char *bufferCheck = nullptr; int err; int pos; if (connection->returnElement != nullptr) { mpd_freeReturnElement(connection->returnElement); } connection->returnElement = nullptr; if ((connection->doneProcessing != 0) || ((connection->listOks != 0) && (connection->doneListOk != 0))) { strncpy(connection->errorStr, "already done processing current command", MPD_ERRORSTR_MAX_LENGTH); connection->error = 1; return; } bufferCheck = connection->buffer + connection->bufstart; while (connection->bufstart >= connection->buflen || ((rt = strchr(bufferCheck, '\n')) == nullptr)) { if (connection->buflen >= MPD_BUFFER_MAX_LENGTH) { memmove(connection->buffer, connection->buffer + connection->bufstart, connection->buflen - connection->bufstart + 1); connection->buflen -= connection->bufstart; connection->bufstart = 0; } if (connection->buflen >= MPD_BUFFER_MAX_LENGTH) { strncpy(connection->errorStr, "buffer overrun", MPD_ERRORSTR_MAX_LENGTH); connection->error = MPD_ERROR_BUFFEROVERRUN; connection->doneProcessing = 1; connection->doneListOk = 0; return; } bufferCheck = connection->buffer + connection->buflen; tv.tv_sec = connection->timeout.tv_sec; tv.tv_usec = connection->timeout.tv_usec; FD_ZERO(&fds); FD_SET(connection->sock, &fds); if ((err = static_cast(select(connection->sock + 1, &fds, nullptr, nullptr, &tv) == 1)) != 0) { readed = recv(connection->sock, connection->buffer + connection->buflen, MPD_BUFFER_MAX_LENGTH - connection->buflen, MSG_DONTWAIT); if (readed < 0 && SENDRECV_ERRNO_IGNORE) { continue; } if (readed <= 0) { strncpy(connection->errorStr, "connection closed", MPD_ERRORSTR_MAX_LENGTH); connection->error = MPD_ERROR_CONNCLOSED; connection->doneProcessing = 1; connection->doneListOk = 0; return; } connection->buflen += readed; connection->buffer[connection->buflen] = '\0'; } else { strncpy(connection->errorStr, "connection timeout", MPD_ERRORSTR_MAX_LENGTH); connection->error = MPD_ERROR_TIMEOUT; connection->doneProcessing = 1; connection->doneListOk = 0; return; } } *rt = '\0'; output = connection->buffer + connection->bufstart; connection->bufstart = rt - connection->buffer + 1; if (strcmp(output, "OK") == 0) { if (connection->listOks > 0) { strncpy(connection->errorStr, "expected more list_OK's", MPD_ERRORSTR_MAX_LENGTH); connection->error = 1; } connection->listOks = 0; connection->doneProcessing = 1; connection->doneListOk = 0; return; } if (strcmp(output, "list_OK") == 0) { if (connection->listOks == 0) { strncpy(connection->errorStr, "got an unexpected list_OK", MPD_ERRORSTR_MAX_LENGTH); connection->error = 1; } else { connection->doneListOk = 1; connection->listOks--; } return; } if (strncmp(output, "ACK", strlen("ACK")) == 0) { char *test; char *needle; int val; strncpy(connection->errorStr, output, MPD_ERRORSTR_MAX_LENGTH); connection->error = MPD_ERROR_ACK; connection->errorCode = MPD_ACK_ERROR_UNK; connection->errorAt = MPD_ERROR_AT_UNK; connection->doneProcessing = 1; connection->doneListOk = 0; needle = strchr(output, '['); if (needle == nullptr) { return; } val = strtol(needle + 1, &test, 10); if (*test != '@') { return; } connection->errorCode = val; val = strtol(test + 1, &test, 10); if (*test != ']') { return; } connection->errorAt = val; return; } tok = strchr(output, ':'); if (tok == nullptr) { return; } pos = tok - output; value = ++tok; name = output; name[pos] = '\0'; if (value[0] == ' ') { connection->returnElement = mpd_newReturnElement(name, &(value[1])); } else { snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "error parsing: %s:%s", name, value); connection->error = 1; } } void mpd_finishCommand(mpd_Connection *connection) { while ((connection != nullptr) && (connection->doneProcessing == 0)) { if (connection->doneListOk != 0) { connection->doneListOk = 0; } mpd_getNextReturnElement(connection); } } static void mpd_finishListOkCommand(mpd_Connection *connection) { while ((connection->doneProcessing == 0) && (connection->listOks != 0) && (connection->doneListOk == 0)) { mpd_getNextReturnElement(connection); } } int mpd_nextListOkCommand(mpd_Connection *connection) { mpd_finishListOkCommand(connection); if (connection->doneProcessing == 0) { connection->doneListOk = 0; } if (connection->listOks == 0 || (connection->doneProcessing != 0)) { return -1; } return 0; } void mpd_sendStatusCommand(mpd_Connection *connection) { mpd_executeCommand(connection, "status\n"); } mpd_Status *mpd_getStatus(mpd_Connection *connection) { mpd_Status *status; /* mpd_executeCommand(connection, "status\n"); if (connection->error) { return nullptr; } */ if ((connection->doneProcessing != 0) || ((connection->listOks != 0) && (connection->doneListOk != 0))) { return nullptr; } if (connection->returnElement == nullptr) { mpd_getNextReturnElement(connection); } status = static_cast(malloc(sizeof(mpd_Status))); status->volume = -1; status->repeat = 0; status->random = 0; status->playlist = -1; status->playlistLength = -1; status->state = -1; status->song = 0; status->songid = 0; status->elapsedTime = 0; status->totalTime = 0; status->bitRate = 0; status->sampleRate = 0; status->bits = 0; status->channels = 0; status->crossfade = -1; status->error = nullptr; status->updatingDb = 0; if (connection->error != 0) { free(status); return nullptr; } while (connection->returnElement != nullptr) { mpd_ReturnElement *re = connection->returnElement; if (strcmp(re->name, "volume") == 0) { status->volume = atoi(re->value); } else if (strcmp(re->name, "repeat") == 0) { status->repeat = atoi(re->value); } else if (strcmp(re->name, "random") == 0) { status->random = atoi(re->value); } else if (strcmp(re->name, "playlist") == 0) { status->playlist = strtol(re->value, nullptr, 10); } else if (strcmp(re->name, "playlistlength") == 0) { status->playlistLength = atoi(re->value); } else if (strcmp(re->name, "bitrate") == 0) { status->bitRate = atoi(re->value); } else if (strcmp(re->name, "state") == 0) { if (strcmp(re->value, "play") == 0) { status->state = MPD_STATUS_STATE_PLAY; } else if (strcmp(re->value, "stop") == 0) { status->state = MPD_STATUS_STATE_STOP; } else if (strcmp(re->value, "pause") == 0) { status->state = MPD_STATUS_STATE_PAUSE; } else { status->state = MPD_STATUS_STATE_UNKNOWN; } } else if (strcmp(re->name, "song") == 0) { status->song = atoi(re->value); } else if (strcmp(re->name, "songid") == 0) { status->songid = atoi(re->value); } else if (strcmp(re->name, "time") == 0) { char *tok = strchr(re->value, ':'); /* the second strchr below is a safety check */ if ((tok != nullptr) && (strchr(tok, 0) > (tok + 1))) { /* atoi stops at the first non-[0-9] char: */ status->elapsedTime = atoi(re->value); status->totalTime = atoi(tok + 1); } } else if (strcmp(re->name, "error") == 0) { status->error = strndup(re->value, text_buffer_size.get(*state)); } else if (strcmp(re->name, "xfade") == 0) { status->crossfade = atoi(re->value); } else if (strcmp(re->name, "updating_db") == 0) { status->updatingDb = atoi(re->value); } else if (strcmp(re->name, "audio") == 0) { char *tok = strchr(re->value, ':'); if ((tok != nullptr) && (strchr(tok, 0) > (tok + 1))) { status->sampleRate = atoi(re->value); status->bits = atoi(++tok); tok = strchr(tok, ':'); if ((tok != nullptr) && (strchr(tok, 0) > (tok + 1))) { status->channels = atoi(tok + 1); } } } mpd_getNextReturnElement(connection); if (connection->error != 0) { free(status); return nullptr; } } if (connection->error != 0) { free(status); return nullptr; } if (status->state < 0) { strncpy(connection->errorStr, "state not found", MPD_ERRORSTR_MAX_LENGTH); connection->error = 1; free(status); return nullptr; } return status; } void mpd_freeStatus(mpd_Status *status) { free_and_zero(status->error); free(status); } void mpd_sendStatsCommand(mpd_Connection *connection) { mpd_executeCommand(connection, "stats\n"); } mpd_Stats *mpd_getStats(mpd_Connection *connection) { mpd_Stats *stats; /* mpd_executeCommand(connection, "stats\n"); if (connection->error) { return nullptr; } */ if ((connection->doneProcessing != 0) || ((connection->listOks != 0) && (connection->doneListOk != 0))) { return nullptr; } if (connection->returnElement == nullptr) { mpd_getNextReturnElement(connection); } stats = static_cast(malloc(sizeof(mpd_Stats))); stats->numberOfArtists = 0; stats->numberOfAlbums = 0; stats->numberOfSongs = 0; stats->uptime = 0; stats->dbUpdateTime = 0; stats->playTime = 0; stats->dbPlayTime = 0; if (connection->error != 0) { free(stats); return nullptr; } while (connection->returnElement != nullptr) { mpd_ReturnElement *re = connection->returnElement; if (strcmp(re->name, "artists") == 0) { stats->numberOfArtists = atoi(re->value); } else if (strcmp(re->name, "albums") == 0) { stats->numberOfAlbums = atoi(re->value); } else if (strcmp(re->name, "songs") == 0) { stats->numberOfSongs = atoi(re->value); } else if (strcmp(re->name, "uptime") == 0) { stats->uptime = strtol(re->value, nullptr, 10); } else if (strcmp(re->name, "db_update") == 0) { stats->dbUpdateTime = strtol(re->value, nullptr, 10); } else if (strcmp(re->name, "playtime") == 0) { stats->playTime = strtol(re->value, nullptr, 10); } else if (strcmp(re->name, "db_playtime") == 0) { stats->dbPlayTime = strtol(re->value, nullptr, 10); } mpd_getNextReturnElement(connection); if (connection->error != 0) { free(stats); return nullptr; } } if (connection->error != 0) { free(stats); return nullptr; } return stats; } void mpd_freeStats(mpd_Stats *stats) { free(stats); } mpd_SearchStats *mpd_getSearchStats(mpd_Connection *connection) { mpd_SearchStats *stats; mpd_ReturnElement *re; if ((connection->doneProcessing != 0) || ((connection->listOks != 0) && (connection->doneListOk != 0))) { return nullptr; } if (connection->returnElement == nullptr) { mpd_getNextReturnElement(connection); } if (connection->error != 0) { return nullptr; } stats = static_cast(malloc(sizeof(mpd_SearchStats))); stats->numberOfSongs = 0; stats->playTime = 0; while (connection->returnElement != nullptr) { re = connection->returnElement; if (strcmp(re->name, "songs") == 0) { stats->numberOfSongs = atoi(re->value); } else if (strcmp(re->name, "playtime") == 0) { stats->playTime = strtol(re->value, nullptr, 10); } mpd_getNextReturnElement(connection); if (connection->error != 0) { free(stats); return nullptr; } } if (connection->error != 0) { free(stats); return nullptr; } return stats; } void mpd_freeSearchStats(mpd_SearchStats *stats) { free(stats); } static void mpd_initSong(mpd_Song *song) { song->file = nullptr; song->artist = nullptr; song->albumartist = nullptr; song->album = nullptr; song->track = nullptr; song->title = nullptr; song->name = nullptr; song->date = nullptr; /* added by Qball */ song->genre = nullptr; song->composer = nullptr; song->performer = nullptr; song->disc = nullptr; song->comment = nullptr; song->time = MPD_SONG_NO_TIME; song->pos = MPD_SONG_NO_NUM; song->id = MPD_SONG_NO_ID; } static void mpd_finishSong(mpd_Song *song) { free_and_zero(song->file); free_and_zero(song->artist); free_and_zero(song->albumartist); free_and_zero(song->album); free_and_zero(song->title); free_and_zero(song->track); free_and_zero(song->name); free_and_zero(song->date); free_and_zero(song->genre); free_and_zero(song->composer); free_and_zero(song->disc); free_and_zero(song->comment); } mpd_Song *mpd_newSong() { auto *ret = static_cast(malloc(sizeof(mpd_Song))); mpd_initSong(ret); return ret; } void mpd_freeSong(mpd_Song *song) { mpd_finishSong(song); free(song); } mpd_Song *mpd_songDup(mpd_Song *song) { mpd_Song *ret = mpd_newSong(); if (song->file != nullptr) { ret->file = strndup(song->file, text_buffer_size.get(*state)); } if (song->artist != nullptr) { ret->artist = strndup(song->artist, text_buffer_size.get(*state)); } if (song->albumartist != nullptr) { ret->artist = strndup(song->albumartist, text_buffer_size.get(*state)); } if (song->album != nullptr) { ret->album = strndup(song->album, text_buffer_size.get(*state)); } if (song->title != nullptr) { ret->title = strndup(song->title, text_buffer_size.get(*state)); } if (song->track != nullptr) { ret->track = strndup(song->track, text_buffer_size.get(*state)); } if (song->name != nullptr) { ret->name = strndup(song->name, text_buffer_size.get(*state)); } if (song->date != nullptr) { ret->date = strndup(song->date, text_buffer_size.get(*state)); } if (song->genre != nullptr) { ret->genre = strndup(song->genre, text_buffer_size.get(*state)); } if (song->composer != nullptr) { ret->composer = strndup(song->composer, text_buffer_size.get(*state)); } if (song->disc != nullptr) { ret->disc = strndup(song->disc, text_buffer_size.get(*state)); } if (song->comment != nullptr) { ret->comment = strndup(song->comment, text_buffer_size.get(*state)); } ret->time = song->time; ret->pos = song->pos; ret->id = song->id; return ret; } static void mpd_initDirectory(mpd_Directory *directory) { directory->path = nullptr; } static void mpd_finishDirectory(mpd_Directory *directory) { free_and_zero(directory->path); } mpd_Directory *mpd_newDirectory() { auto *directory = static_cast(malloc(sizeof(mpd_Directory))); mpd_initDirectory(directory); return directory; } void mpd_freeDirectory(mpd_Directory *directory) { mpd_finishDirectory(directory); free(directory); } mpd_Directory *mpd_directoryDup(mpd_Directory *directory) { mpd_Directory *ret = mpd_newDirectory(); if (directory->path != nullptr) { ret->path = strndup(directory->path, text_buffer_size.get(*state)); } return ret; } static void mpd_initPlaylistFile(mpd_PlaylistFile *playlist) { playlist->path = nullptr; } static void mpd_finishPlaylistFile(mpd_PlaylistFile *playlist) { free_and_zero(playlist->path); } mpd_PlaylistFile *mpd_newPlaylistFile() { auto *playlist = static_cast(malloc(sizeof(mpd_PlaylistFile))); mpd_initPlaylistFile(playlist); return playlist; } void mpd_freePlaylistFile(mpd_PlaylistFile *playlist) { mpd_finishPlaylistFile(playlist); free(playlist); } mpd_PlaylistFile *mpd_playlistFileDup(mpd_PlaylistFile *playlist) { mpd_PlaylistFile *ret = mpd_newPlaylistFile(); if (playlist->path != nullptr) { ret->path = strndup(playlist->path, text_buffer_size.get(*state)); } return ret; } static void mpd_initInfoEntity(mpd_InfoEntity *entity) { entity->info.directory = nullptr; } static void mpd_finishInfoEntity(mpd_InfoEntity *entity) { if (entity->info.directory != nullptr) { if (entity->type == MPD_INFO_ENTITY_TYPE_DIRECTORY) { mpd_freeDirectory(entity->info.directory); } else if (entity->type == MPD_INFO_ENTITY_TYPE_SONG) { mpd_freeSong(entity->info.song); } else if (entity->type == MPD_INFO_ENTITY_TYPE_PLAYLISTFILE) { mpd_freePlaylistFile(entity->info.playlistFile); } } } mpd_InfoEntity *mpd_newInfoEntity() { auto *entity = static_cast(malloc(sizeof(mpd_InfoEntity))); mpd_initInfoEntity(entity); return entity; } void mpd_freeInfoEntity(mpd_InfoEntity *entity) { mpd_finishInfoEntity(entity); free(entity); } static void mpd_sendInfoCommand(mpd_Connection *connection, char *command) { mpd_executeCommand(connection, command); } mpd_InfoEntity *mpd_getNextInfoEntity(mpd_Connection *connection) { mpd_InfoEntity *entity = nullptr; if ((connection->doneProcessing != 0) || ((connection->listOks != 0) && (connection->doneListOk != 0))) { return nullptr; } if (connection->returnElement == nullptr) { mpd_getNextReturnElement(connection); } if (connection->returnElement != nullptr) { if (strcmp(connection->returnElement->name, "file") == 0) { entity = mpd_newInfoEntity(); entity->type = MPD_INFO_ENTITY_TYPE_SONG; entity->info.song = mpd_newSong(); entity->info.song->file = strndup(connection->returnElement->value, text_buffer_size.get(*state)); } else if (strcmp(connection->returnElement->name, "directory") == 0) { entity = mpd_newInfoEntity(); entity->type = MPD_INFO_ENTITY_TYPE_DIRECTORY; entity->info.directory = mpd_newDirectory(); entity->info.directory->path = strndup(connection->returnElement->value, text_buffer_size.get(*state)); } else if (strcmp(connection->returnElement->name, "playlist") == 0) { entity = mpd_newInfoEntity(); entity->type = MPD_INFO_ENTITY_TYPE_PLAYLISTFILE; entity->info.playlistFile = mpd_newPlaylistFile(); entity->info.playlistFile->path = strndup( connection->returnElement->value, text_buffer_size.get(*state)); } else if (strcmp(connection->returnElement->name, "cpos") == 0) { entity = mpd_newInfoEntity(); entity->type = MPD_INFO_ENTITY_TYPE_SONG; entity->info.song = mpd_newSong(); entity->info.song->pos = atoi(connection->returnElement->value); } else { connection->error = 1; strncpy(connection->errorStr, "problem parsing song info", MPD_ERRORSTR_MAX_LENGTH); return nullptr; } } else { return nullptr; } mpd_getNextReturnElement(connection); while (connection->returnElement != nullptr) { mpd_ReturnElement *re = connection->returnElement; if (strcmp(re->name, "file") == 0) { return entity; } if (strcmp(re->name, "directory") == 0) { return entity; } if (strcmp(re->name, "playlist") == 0) { return entity; } if (strcmp(re->name, "cpos") == 0) { return entity; } if (entity->type == MPD_INFO_ENTITY_TYPE_SONG && (strlen(re->value) != 0u)) { if ((entity->info.song->artist == nullptr) && strcmp(re->name, "Artist") == 0) { entity->info.song->artist = strndup(re->value, text_buffer_size.get(*state)); } else if ((entity->info.song->albumartist == nullptr) && strcmp(re->name, "AlbumArtist") == 0) { entity->info.song->albumartist = strndup(re->value, text_buffer_size.get(*state)); } else if ((entity->info.song->album == nullptr) && strcmp(re->name, "Album") == 0) { entity->info.song->album = strndup(re->value, text_buffer_size.get(*state)); } else if ((entity->info.song->title == nullptr) && strcmp(re->name, "Title") == 0) { entity->info.song->title = strndup(re->value, text_buffer_size.get(*state)); } else if ((entity->info.song->track == nullptr) && strcmp(re->name, "Track") == 0) { entity->info.song->track = strndup(re->value, text_buffer_size.get(*state)); } else if ((entity->info.song->name == nullptr) && strcmp(re->name, "Name") == 0) { entity->info.song->name = strndup(re->value, text_buffer_size.get(*state)); } else if (entity->info.song->time == MPD_SONG_NO_TIME && strcmp(re->name, "Time") == 0) { entity->info.song->time = atoi(re->value); } else if (entity->info.song->pos == MPD_SONG_NO_NUM && strcmp(re->name, "Pos") == 0) { entity->info.song->pos = atoi(re->value); } else if (entity->info.song->id == MPD_SONG_NO_ID && strcmp(re->name, "Id") == 0) { entity->info.song->id = atoi(re->value); } else if ((entity->info.song->date == nullptr) && strcmp(re->name, "Date") == 0) { entity->info.song->date = strndup(re->value, text_buffer_size.get(*state)); } else if ((entity->info.song->genre == nullptr) && strcmp(re->name, "Genre") == 0) { entity->info.song->genre = strndup(re->value, text_buffer_size.get(*state)); } else if ((entity->info.song->composer == nullptr) && strcmp(re->name, "Composer") == 0) { entity->info.song->composer = strndup(re->value, text_buffer_size.get(*state)); } else if ((entity->info.song->performer == nullptr) && strcmp(re->name, "Performer") == 0) { entity->info.song->performer = strndup(re->value, text_buffer_size.get(*state)); } else if ((entity->info.song->disc == nullptr) && strcmp(re->name, "Disc") == 0) { entity->info.song->disc = strndup(re->value, text_buffer_size.get(*state)); } else if ((entity->info.song->comment == nullptr) && strcmp(re->name, "Comment") == 0) { entity->info.song->comment = strndup(re->value, text_buffer_size.get(*state)); } } else if (entity->type == MPD_INFO_ENTITY_TYPE_DIRECTORY) { } else if (entity->type == MPD_INFO_ENTITY_TYPE_PLAYLISTFILE) { } mpd_getNextReturnElement(connection); } return entity; } static char *mpd_getNextReturnElementNamed(mpd_Connection *connection, const char *name) { if ((connection->doneProcessing != 0) || ((connection->listOks != 0) && (connection->doneListOk != 0))) { return nullptr; } mpd_getNextReturnElement(connection); while (connection->returnElement != nullptr) { mpd_ReturnElement *re = connection->returnElement; if (strcmp(re->name, name) == 0) { return strndup(re->value, text_buffer_size.get(*state)); } mpd_getNextReturnElement(connection); } return nullptr; } char *mpd_getNextTag(mpd_Connection *connection, int type) { if (type < 0 || type >= MPD_TAG_NUM_OF_ITEM_TYPES || type == MPD_TAG_ITEM_ANY) { return nullptr; } if (type == MPD_TAG_ITEM_FILENAME) { return mpd_getNextReturnElementNamed(connection, "file"); } return mpd_getNextReturnElementNamed(connection, mpdTagItemKeys[type]); } char *mpd_getNextArtist(mpd_Connection *connection) { return mpd_getNextReturnElementNamed(connection, "Artist"); } char *mpd_getNextAlbum(mpd_Connection *connection) { return mpd_getNextReturnElementNamed(connection, "Album"); } void mpd_sendPlaylistInfoCommand(mpd_Connection *connection, int songPos) { int len = strlen("playlistinfo") + 2 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "playlistinfo \"%i\"\n", songPos); mpd_sendInfoCommand(connection, string); free(string); } void mpd_sendPlaylistIdCommand(mpd_Connection *connection, int id) { int len = strlen("playlistid") + 2 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "playlistid \"%i\"\n", id); mpd_sendInfoCommand(connection, string); free(string); } void mpd_sendPlChangesCommand(mpd_Connection *connection, long long playlist) { int len = strlen("plchanges") + 2 + LONGLONGLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "plchanges \"%lld\"\n", playlist); mpd_sendInfoCommand(connection, string); free(string); } void mpd_sendPlChangesPosIdCommand(mpd_Connection *connection, long long playlist) { int len = strlen("plchangesposid") + 2 + LONGLONGLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "plchangesposid \"%lld\"\n", playlist); mpd_sendInfoCommand(connection, string); free(string); } void mpd_sendListallCommand(mpd_Connection *connection, const char *dir) { char *sDir = mpd_sanitizeArg(dir); int len = strlen("listall") + 2 + strlen(sDir) + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "listall \"%s\"\n", sDir); mpd_sendInfoCommand(connection, string); free(string); free(sDir); } void mpd_sendListallInfoCommand(mpd_Connection *connection, const char *dir) { char *sDir = mpd_sanitizeArg(dir); int len = strlen("listallinfo") + 2 + strlen(sDir) + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "listallinfo \"%s\"\n", sDir); mpd_sendInfoCommand(connection, string); free(string); free(sDir); } void mpd_sendLsInfoCommand(mpd_Connection *connection, const char *dir) { char *sDir = mpd_sanitizeArg(dir); int len = strlen("lsinfo") + 2 + strlen(sDir) + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "lsinfo \"%s\"\n", sDir); mpd_sendInfoCommand(connection, string); free(string); free(sDir); } void mpd_sendCurrentSongCommand(mpd_Connection *connection) { mpd_executeCommand(connection, "currentsong\n"); } void mpd_sendSearchCommand(mpd_Connection *connection, int table, const char *str) { mpd_startSearch(connection, 0); mpd_addConstraintSearch(connection, table, str); mpd_commitSearch(connection); } void mpd_sendFindCommand(mpd_Connection *connection, int table, const char *str) { mpd_startSearch(connection, 1); mpd_addConstraintSearch(connection, table, str); mpd_commitSearch(connection); } void mpd_sendListCommand(mpd_Connection *connection, int table, const char *arg1) { char st[7]; int len; char *string; if (table == MPD_TABLE_ARTIST) { strncpy(st, "artist", strlen("artist") + 1); } else if (table == MPD_TABLE_ALBUM) { strncpy(st, "album", strlen("album") + 1); } else { connection->error = 1; strncpy(connection->errorStr, "unknown table for list", MPD_ERRORSTR_MAX_LENGTH); return; } if (arg1 != nullptr) { char *sanitArg1 = mpd_sanitizeArg(arg1); len = strlen("list") + 1 + strlen(sanitArg1) + 2 + strlen(st) + 3; string = static_cast(malloc(len)); snprintf(string, len, "list %s \"%s\"\n", st, sanitArg1); free(sanitArg1); } else { len = strlen("list") + 1 + strlen(st) + 2; string = static_cast(malloc(len)); snprintf(string, len, "list %s\n", st); } mpd_sendInfoCommand(connection, string); free(string); } void mpd_sendAddCommand(mpd_Connection *connection, const char *file) { char *sFile = mpd_sanitizeArg(file); int len = strlen("add") + 2 + strlen(sFile) + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "add \"%s\"\n", sFile); mpd_executeCommand(connection, string); free(string); free(sFile); } int mpd_sendAddIdCommand(mpd_Connection *connection, const char *file) { int retval = -1; char *sFile = mpd_sanitizeArg(file); int len = strlen("addid") + 2 + strlen(sFile) + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "addid \"%s\"\n", sFile); mpd_sendInfoCommand(connection, string); free(string); free(sFile); string = mpd_getNextReturnElementNamed(connection, "Id"); if (string != nullptr) { retval = atoi(string); free(string); } return retval; } void mpd_sendDeleteCommand(mpd_Connection *connection, int songPos) { int len = strlen("delete") + 2 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "delete \"%i\"\n", songPos); mpd_sendInfoCommand(connection, string); free(string); } void mpd_sendDeleteIdCommand(mpd_Connection *connection, int id) { int len = strlen("deleteid") + 2 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "deleteid \"%i\"\n", id); mpd_sendInfoCommand(connection, string); free(string); } void mpd_sendSaveCommand(mpd_Connection *connection, const char *name) { char *sName = mpd_sanitizeArg(name); int len = strlen("save") + 2 + strlen(sName) + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "save \"%s\"\n", sName); mpd_executeCommand(connection, string); free(string); free(sName); } void mpd_sendLoadCommand(mpd_Connection *connection, const char *name) { char *sName = mpd_sanitizeArg(name); int len = strlen("load") + 2 + strlen(sName) + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "load \"%s\"\n", sName); mpd_executeCommand(connection, string); free(string); free(sName); } void mpd_sendRmCommand(mpd_Connection *connection, const char *name) { char *sName = mpd_sanitizeArg(name); int len = strlen("rm") + 2 + strlen(sName) + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "rm \"%s\"\n", sName); mpd_executeCommand(connection, string); free(string); free(sName); } void mpd_sendRenameCommand(mpd_Connection *connection, const char *from, const char *to) { char *sFrom = mpd_sanitizeArg(from); char *sTo = mpd_sanitizeArg(to); int len = strlen("rename") + 2 + strlen(sFrom) + 3 + strlen(sTo) + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "rename \"%s\" \"%s\"\n", sFrom, sTo); mpd_executeCommand(connection, string); free(string); free(sFrom); free(sTo); } void mpd_sendShuffleCommand(mpd_Connection *connection) { mpd_executeCommand(connection, "shuffle\n"); } void mpd_sendClearCommand(mpd_Connection *connection) { mpd_executeCommand(connection, "clear\n"); } void mpd_sendPlayCommand(mpd_Connection *connection, int songPos) { int len = strlen("play") + 2 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "play \"%i\"\n", songPos); mpd_sendInfoCommand(connection, string); free(string); } void mpd_sendPlayIdCommand(mpd_Connection *connection, int id) { int len = strlen("playid") + 2 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "playid \"%i\"\n", id); mpd_sendInfoCommand(connection, string); free(string); } void mpd_sendStopCommand(mpd_Connection *connection) { mpd_executeCommand(connection, "stop\n"); } void mpd_sendPauseCommand(mpd_Connection *connection, int pauseMode) { int len = strlen("pause") + 2 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "pause \"%i\"\n", pauseMode); mpd_executeCommand(connection, string); free(string); } void mpd_sendNextCommand(mpd_Connection *connection) { mpd_executeCommand(connection, "next\n"); } void mpd_sendMoveCommand(mpd_Connection *connection, int from, int to) { int len = strlen("move") + 2 + INTLEN + 3 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "move \"%i\" \"%i\"\n", from, to); mpd_sendInfoCommand(connection, string); free(string); } void mpd_sendMoveIdCommand(mpd_Connection *connection, int id, int to) { int len = strlen("moveid") + 2 + INTLEN + 3 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "moveid \"%i\" \"%i\"\n", id, to); mpd_sendInfoCommand(connection, string); free(string); } void mpd_sendSwapCommand(mpd_Connection *connection, int song1, int song2) { int len = strlen("swap") + 2 + INTLEN + 3 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "swap \"%i\" \"%i\"\n", song1, song2); mpd_sendInfoCommand(connection, string); free(string); } void mpd_sendSwapIdCommand(mpd_Connection *connection, int id1, int id2) { int len = strlen("swapid") + 2 + INTLEN + 3 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "swapid \"%i\" \"%i\"\n", id1, id2); mpd_sendInfoCommand(connection, string); free(string); } void mpd_sendSeekCommand(mpd_Connection *connection, int song, int seek_time) { int len = strlen("seek") + 2 + INTLEN + 3 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "seek \"%i\" \"%i\"\n", song, seek_time); mpd_sendInfoCommand(connection, string); free(string); } void mpd_sendSeekIdCommand(mpd_Connection *connection, int id, int seek_time) { int len = strlen("seekid") + 2 + INTLEN + 3 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "seekid \"%i\" \"%i\"\n", id, seek_time); mpd_sendInfoCommand(connection, string); free(string); } void mpd_sendUpdateCommand(mpd_Connection *connection, char *path) { char *sPath = mpd_sanitizeArg(path); int len = strlen("update") + 2 + strlen(sPath) + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "update \"%s\"\n", sPath); mpd_sendInfoCommand(connection, string); free(string); free(sPath); } int mpd_getUpdateId(mpd_Connection *connection) { char *jobid; int ret = 0; jobid = mpd_getNextReturnElementNamed(connection, "updating_db"); if (jobid != nullptr) { ret = atoi(jobid); free(jobid); } return ret; } void mpd_sendPrevCommand(mpd_Connection *connection) { mpd_executeCommand(connection, "previous\n"); } void mpd_sendRepeatCommand(mpd_Connection *connection, int repeatMode) { int len = strlen("repeat") + 2 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "repeat \"%i\"\n", repeatMode); mpd_executeCommand(connection, string); free(string); } void mpd_sendRandomCommand(mpd_Connection *connection, int randomMode) { int len = strlen("random") + 2 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "random \"%i\"\n", randomMode); mpd_executeCommand(connection, string); free(string); } void mpd_sendSetvolCommand(mpd_Connection *connection, int volumeChange) { int len = strlen("setvol") + 2 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "setvol \"%i\"\n", volumeChange); mpd_executeCommand(connection, string); free(string); } void mpd_sendVolumeCommand(mpd_Connection *connection, int volumeChange) { int len = strlen("volume") + 2 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "volume \"%i\"\n", volumeChange); mpd_executeCommand(connection, string); free(string); } void mpd_sendCrossfadeCommand(mpd_Connection *connection, int seconds) { int len = strlen("crossfade") + 2 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "crossfade \"%i\"\n", seconds); mpd_executeCommand(connection, string); free(string); } void mpd_sendPasswordCommand(mpd_Connection *connection, const char *pass) { char *sPass = mpd_sanitizeArg(pass); int len = strlen("password") + 2 + strlen(sPass) + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "password \"%s\"\n", sPass); mpd_executeCommand(connection, string); free(string); free(sPass); } void mpd_sendCommandListBegin(mpd_Connection *connection) { if (connection->commandList != 0) { strncpy(connection->errorStr, "already in command list mode", MPD_ERRORSTR_MAX_LENGTH); connection->error = 1; return; } connection->commandList = COMMAND_LIST; mpd_executeCommand(connection, "command_list_begin\n"); } void mpd_sendCommandListOkBegin(mpd_Connection *connection) { if (connection->commandList != 0) { strncpy(connection->errorStr, "already in command list mode", MPD_ERRORSTR_MAX_LENGTH); connection->error = 1; return; } connection->commandList = COMMAND_LIST_OK; mpd_executeCommand(connection, "command_list_ok_begin\n"); connection->listOks = 0; } void mpd_sendCommandListEnd(mpd_Connection *connection) { if (connection->commandList == 0) { strncpy(connection->errorStr, "not in command list mode", MPD_ERRORSTR_MAX_LENGTH); connection->error = 1; return; } connection->commandList = 0; mpd_executeCommand(connection, "command_list_end\n"); } void mpd_sendOutputsCommand(mpd_Connection *connection) { mpd_executeCommand(connection, "outputs\n"); } mpd_OutputEntity *mpd_getNextOutput(mpd_Connection *connection) { mpd_OutputEntity *output = nullptr; if ((connection->doneProcessing != 0) || ((connection->listOks != 0) && (connection->doneListOk != 0))) { return nullptr; } if (connection->error != 0) { return nullptr; } output = static_cast(malloc(sizeof(mpd_OutputEntity))); output->id = -10; output->name = nullptr; output->enabled = 0; if (connection->returnElement == nullptr) { mpd_getNextReturnElement(connection); } while (connection->returnElement != nullptr) { mpd_ReturnElement *re = connection->returnElement; if (strcmp(re->name, "outputid") == 0) { if (output != nullptr && output->id >= 0) { return output; } output->id = atoi(re->value); } else if (strcmp(re->name, "outputname") == 0) { output->name = strndup(re->value, text_buffer_size.get(*state)); } else if (strcmp(re->name, "outputenabled") == 0) { output->enabled = atoi(re->value); } mpd_getNextReturnElement(connection); if (connection->error != 0) { free(output); return nullptr; } } return output; } void mpd_sendEnableOutputCommand(mpd_Connection *connection, int outputId) { int len = strlen("enableoutput") + 2 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "enableoutput \"%i\"\n", outputId); mpd_executeCommand(connection, string); free(string); } void mpd_sendDisableOutputCommand(mpd_Connection *connection, int outputId) { int len = strlen("disableoutput") + 2 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "disableoutput \"%i\"\n", outputId); mpd_executeCommand(connection, string); free(string); } void mpd_freeOutputElement(mpd_OutputEntity *output) { free(output->name); free(output); } /** odd naming, but it gets the not allowed commands */ void mpd_sendNotCommandsCommand(mpd_Connection *connection) { mpd_executeCommand(connection, "notcommands\n"); } /** odd naming, but it gets the allowed commands */ void mpd_sendCommandsCommand(mpd_Connection *connection) { mpd_executeCommand(connection, "commands\n"); } /** Get the next returned command */ char *mpd_getNextCommand(mpd_Connection *connection) { return mpd_getNextReturnElementNamed(connection, "command"); } void mpd_sendUrlHandlersCommand(mpd_Connection *connection) { mpd_executeCommand(connection, "urlhandlers\n"); } char *mpd_getNextHandler(mpd_Connection *connection) { return mpd_getNextReturnElementNamed(connection, "handler"); } void mpd_sendTagTypesCommand(mpd_Connection *connection) { mpd_executeCommand(connection, "tagtypes\n"); } char *mpd_getNextTagType(mpd_Connection *connection) { return mpd_getNextReturnElementNamed(connection, "tagtype"); } void mpd_startSearch(mpd_Connection *connection, int exact) { if (connection->request != nullptr) { strncpy(connection->errorStr, "search already in progress", MPD_ERRORSTR_MAX_LENGTH); connection->error = 1; return; } if (exact != 0) { connection->request = strndup("find", text_buffer_size.get(*state)); } else { connection->request = strndup("search", text_buffer_size.get(*state)); } } void mpd_startStatsSearch(mpd_Connection *connection) { if (connection->request != nullptr) { strncpy(connection->errorStr, "search already in progress", MPD_ERRORSTR_MAX_LENGTH); connection->error = 1; return; } connection->request = strndup("count", text_buffer_size.get(*state)); } void mpd_startPlaylistSearch(mpd_Connection *connection, int exact) { if (connection->request != nullptr) { strncpy(connection->errorStr, "search already in progress", MPD_ERRORSTR_MAX_LENGTH); connection->error = 1; return; } if (exact != 0) { connection->request = strndup("playlistfind", text_buffer_size.get(*state)); } else { connection->request = strndup("playlistsearch", text_buffer_size.get(*state)); } } void mpd_startFieldSearch(mpd_Connection *connection, int type) { const char *strtype; int len; if (connection->request != nullptr) { strncpy(connection->errorStr, "search already in progress", MPD_ERRORSTR_MAX_LENGTH); connection->error = 1; return; } if (type < 0 || type >= MPD_TAG_NUM_OF_ITEM_TYPES) { strncpy(connection->errorStr, "invalid type specified", MPD_ERRORSTR_MAX_LENGTH); connection->error = 1; return; } strtype = mpdTagItemKeys[type]; len = 5 + strlen(strtype) + 1; connection->request = static_cast(malloc(len)); snprintf(connection->request, len, "list %c%s", tolower(static_cast(strtype[0])), strtype + 1); } void mpd_addConstraintSearch(mpd_Connection *connection, int type, const char *name) { const char *strtype; char *arg; int len; char *string; if (connection->request == nullptr) { strncpy(connection->errorStr, "no search in progress", MPD_ERRORSTR_MAX_LENGTH); connection->error = 1; return; } if (type < 0 || type >= MPD_TAG_NUM_OF_ITEM_TYPES) { strncpy(connection->errorStr, "invalid type specified", MPD_ERRORSTR_MAX_LENGTH); connection->error = 1; return; } if (name == nullptr) { strncpy(connection->errorStr, "no name specified", MPD_ERRORSTR_MAX_LENGTH); connection->error = 1; return; } string = strndup(connection->request, text_buffer_size.get(*state)); strtype = mpdTagItemKeys[type]; arg = mpd_sanitizeArg(name); len = strlen(string) + 1 + strlen(strtype) + 2 + strlen(arg) + 2; connection->request = static_cast(realloc(connection->request, len)); snprintf(connection->request, len, "%s %c%s \"%s\"", string, tolower(static_cast(strtype[0])), strtype + 1, arg); free(string); free(arg); } void mpd_commitSearch(mpd_Connection *connection) { int len; if (connection->request == nullptr) { strncpy(connection->errorStr, "no search in progress", MPD_ERRORSTR_MAX_LENGTH); connection->error = 1; return; } len = strlen(connection->request) + 2; connection->request = static_cast(realloc(connection->request, len)); connection->request[len - 2] = '\n'; connection->request[len - 1] = '\0'; mpd_sendInfoCommand(connection, connection->request); free_and_zero(connection->request); } /** * @param connection a MpdConnection * @param path the path to the playlist. * * List the content, with full metadata, of a stored playlist. */ void mpd_sendListPlaylistInfoCommand(mpd_Connection *connection, char *path) { char *arg = mpd_sanitizeArg(path); int len = strlen("listplaylistinfo") + 2 + strlen(arg) + 3; auto *query = static_cast(malloc(len)); snprintf(query, len, "listplaylistinfo \"%s\"\n", arg); mpd_sendInfoCommand(connection, query); free(arg); free(query); } /** * @param connection a MpdConnection * @param path the path to the playlist. * * List the content of a stored playlist. */ void mpd_sendListPlaylistCommand(mpd_Connection *connection, char *path) { char *arg = mpd_sanitizeArg(path); int len = strlen("listplaylist") + 2 + strlen(arg) + 3; auto *query = static_cast(malloc(len)); snprintf(query, len, "listplaylist \"%s\"\n", arg); mpd_sendInfoCommand(connection, query); free(arg); free(query); } void mpd_sendPlaylistClearCommand(mpd_Connection *connection, char *path) { char *sPath = mpd_sanitizeArg(path); int len = strlen("playlistclear") + 2 + strlen(sPath) + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "playlistclear \"%s\"\n", sPath); mpd_executeCommand(connection, string); free(sPath); free(string); } void mpd_sendPlaylistAddCommand(mpd_Connection *connection, char *playlist, char *path) { char *sPlaylist = mpd_sanitizeArg(playlist); char *sPath = mpd_sanitizeArg(path); int len = strlen("playlistadd") + 2 + strlen(sPlaylist) + 3 + strlen(sPath) + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "playlistadd \"%s\" \"%s\"\n", sPlaylist, sPath); mpd_executeCommand(connection, string); free(sPlaylist); free(sPath); free(string); } void mpd_sendPlaylistMoveCommand(mpd_Connection *connection, char *playlist, int from, int to) { char *sPlaylist = mpd_sanitizeArg(playlist); int len = strlen("playlistmove") + 2 + strlen(sPlaylist) + 3 + INTLEN + 3 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "playlistmove \"%s\" \"%i\" \"%i\"\n", sPlaylist, from, to); mpd_executeCommand(connection, string); free(sPlaylist); free(string); } void mpd_sendPlaylistDeleteCommand(mpd_Connection *connection, char *playlist, int pos) { char *sPlaylist = mpd_sanitizeArg(playlist); int len = strlen("playlistdelete") + 2 + strlen(sPlaylist) + 3 + INTLEN + 3; auto *string = static_cast(malloc(len)); snprintf(string, len, "playlistdelete \"%s\" \"%i\"\n", sPlaylist, pos); mpd_executeCommand(connection, string); free(sPlaylist); free(string); } conky-1.12.2/src/libmpdclient.h000066400000000000000000000477651404127277500163620ustar00rootroot00000000000000/* * * libmpdclient * (c)2003-2006 by Warren Dukes (warren.dukes@gmail.com) * This project's homepage is: http://www.musicpd.org * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * - Neither the name of the Music Player Daemon nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef LIBMPDCLIENT_H #define LIBMPDCLIENT_H #ifdef WIN32 #define __W32API_USE_DLLIMPORT__ 1 #endif #include #include #define MPD_BUFFER_MAX_LENGTH 50000 #define MPD_ERRORSTR_MAX_LENGTH 1000 #define MPD_WELCOME_MESSAGE "OK MPD " #define MPD_ERROR_TIMEOUT 10 /* timeout trying to talk to mpd */ #define MPD_ERROR_SYSTEM 11 /* system error */ #define MPD_ERROR_UNKHOST 12 /* unknown host */ #define MPD_ERROR_CONNPORT 13 /* problems connecting to port on host */ #define MPD_ERROR_NOTMPD 14 /* mpd not running on port at host */ #define MPD_ERROR_NORESPONSE 15 /* no response on attempting to connect */ #define MPD_ERROR_SENDING 16 /* error sending command */ #define MPD_ERROR_CONNCLOSED 17 /* connection closed by mpd */ #define MPD_ERROR_ACK 18 /* ACK returned! */ #define MPD_ERROR_BUFFEROVERRUN 19 /* Buffer was overrun! */ #define MPD_ACK_ERROR_UNK -1 #define MPD_ERROR_AT_UNK -1 #define MPD_ACK_ERROR_NOT_LIST 1 #define MPD_ACK_ERROR_ARG 2 #define MPD_ACK_ERROR_PASSWORD 3 #define MPD_ACK_ERROR_PERMISSION 4 #define MPD_ACK_ERROR_UNKNOWN_CMD 5 #define MPD_ACK_ERROR_NO_EXIST 50 #define MPD_ACK_ERROR_PLAYLIST_MAX 51 #define MPD_ACK_ERROR_SYSTEM 52 #define MPD_ACK_ERROR_PLAYLIST_LOAD 53 #define MPD_ACK_ERROR_UPDATE_ALREADY 54 #define MPD_ACK_ERROR_PLAYER_SYNC 55 #define MPD_ACK_ERROR_EXIST 56 typedef enum mpd_TagItems { MPD_TAG_ITEM_ARTIST, MPD_TAG_ITEM_ALBUMARTIST, MPD_TAG_ITEM_ALBUM, MPD_TAG_ITEM_TITLE, MPD_TAG_ITEM_TRACK, MPD_TAG_ITEM_NAME, MPD_TAG_ITEM_GENRE, MPD_TAG_ITEM_DATE, MPD_TAG_ITEM_COMPOSER, MPD_TAG_ITEM_PERFORMER, MPD_TAG_ITEM_COMMENT, MPD_TAG_ITEM_DISC, MPD_TAG_ITEM_FILENAME, MPD_TAG_ITEM_ANY, MPD_TAG_NUM_OF_ITEM_TYPES } mpd_TagItems; extern const char *mpdTagItemKeys[MPD_TAG_NUM_OF_ITEM_TYPES]; /* internal stuff don't touch this struct */ typedef struct _mpd_ReturnElement { char *name; char *value; } mpd_ReturnElement; /* mpd_Connection * holds info about connection to mpd * use error, and errorStr to detect errors */ typedef struct _mpd_Connection { /* use this to check the version of mpd */ int version[3]; /* IMPORTANT, you want to get the error messages from here */ char errorStr[MPD_ERRORSTR_MAX_LENGTH + 1]; int errorCode; int errorAt; /* this will be set to MPD_ERROR_* if there is an error, 0 if not */ int error; /* DON'T TOUCH any of the rest of this stuff */ int sock; char buffer[MPD_BUFFER_MAX_LENGTH + 1]; int buflen; int bufstart; int doneProcessing; int listOks; int doneListOk; int commandList; mpd_ReturnElement *returnElement; struct timeval timeout; char *request; } mpd_Connection; /* mpd_newConnection * use this to open a new connection * you should use mpd_closeConnection when you're done with the connection, * even if an error has occurred * _timeout_ is the connection timeout period in seconds */ mpd_Connection *mpd_newConnection(const char *host, int port, float timeout); void mpd_setConnectionTimeout(mpd_Connection *connection, float timeout); /* mpd_closeConnection * use this to close a connection and free subsequent memory */ void mpd_closeConnection(mpd_Connection *connection); /* mpd_clearError * clears error */ void mpd_clearError(mpd_Connection *connection); /* STATUS STUFF */ /* use these with status.state to determine what state the player is in */ #define MPD_STATUS_STATE_UNKNOWN 0 #define MPD_STATUS_STATE_STOP 1 #define MPD_STATUS_STATE_PLAY 2 #define MPD_STATUS_STATE_PAUSE 3 /* use this with status.volume to determine if mpd has volume support */ #define MPD_STATUS_NO_VOLUME -1 /* mpd_Status * holds info return from status command */ typedef struct mpd_Status { /* 0-100, or MPD_STATUS_NO_VOLUME when there is no volume support */ int volume; /* 1 if repeat is on, 0 otherwise */ int repeat; /* 1 if random is on, 0 otherwise */ int random; /* playlist length */ int playlistLength; /* playlist, use this to determine when the playlist has changed */ long long playlist; /* use with MPD_STATUS_STATE_* to determine state of player */ int state; /* crossfade setting in seconds */ int crossfade; /* if a song is currently selected (always the case when state is PLAY * or PAUSE), this is the position of the currently playing song in the * playlist, beginning with 0 */ int song; /* Song ID of the currently selected song */ int songid; /* time in seconds that have elapsed in the currently playing/paused song */ int elapsedTime; /* length in seconds of the currently playing/paused song */ int totalTime; /* current bit rate in kbs */ int bitRate; /* audio sample rate */ unsigned int sampleRate; /* audio bits */ int bits; /* audio channels */ int channels; /* 1 if mpd is updating, 0 otherwise */ int updatingDb; /* error */ char *error; } mpd_Status; void mpd_sendStatusCommand(mpd_Connection *connection); /* mpd_getStatus * returns status info, be sure to free it with mpd_freeStatus() * call this after mpd_sendStatusCommand() */ mpd_Status *mpd_getStatus(mpd_Connection *connection); /* mpd_freeStatus * free's status info malloc'd and returned by mpd_getStatus */ void mpd_freeStatus(mpd_Status *status); typedef struct _mpd_Stats { int numberOfArtists; int numberOfAlbums; int numberOfSongs; unsigned long uptime; unsigned long dbUpdateTime; unsigned long playTime; unsigned long dbPlayTime; } mpd_Stats; typedef struct _mpd_SearchStats { int numberOfSongs; unsigned long playTime; } mpd_SearchStats; void mpd_sendStatsCommand(mpd_Connection *connection); mpd_Stats *mpd_getStats(mpd_Connection *connection); void mpd_freeStats(mpd_Stats *stats); mpd_SearchStats *mpd_getSearchStats(mpd_Connection *connection); void mpd_freeSearchStats(mpd_SearchStats *stats); /* SONG STUFF */ #define MPD_SONG_NO_TIME -1 #define MPD_SONG_NO_NUM -1 #define MPD_SONG_NO_ID -1 /* mpd_Song * for storing song info returned by mpd */ typedef struct _mpd_Song { /* filename of song */ char *file; /* artist, maybe nullptr if there is no tag */ char *artist; /* albumartist, maybe nullptr if there is no tag */ char *albumartist; /* title, maybe nullptr if there is no tag */ char *title; /* album, maybe nullptr if there is no tag */ char *album; /* track, maybe nullptr if there is no tag */ char *track; /* name, maybe nullptr if there is no tag; it's the name of the current song, * f.e. the icyName of the stream */ char *name; /* date */ char *date; /* added by qball */ /* Genre */ char *genre; /* Composer */ char *composer; /* Performer */ char *performer; /* Disc */ char *disc; /* Comment */ char *comment; /* length of song in seconds, check that it is not MPD_SONG_NO_TIME */ int time; /* if plchanges/playlistinfo/playlistid used, is the position of the song * in the playlist */ int pos; /* song id for a song in the playlist */ int id; } mpd_Song; /* mpd_newSong * use to allocate memory for a new mpd_Song * file, artist, etc all initialized to nullptr * if you're going to assign values to file, artist, etc., be sure to * malloc or strdup the memory * use mpd_freeSong to free the memory for the mpd_Song, it will also * free memory for file, artist, etc, so don't do it yourself */ mpd_Song *mpd_newSong(void); /* mpd_freeSong * use to free memory allocated by mpd_newSong * also it will free memory pointed to by file, artist, etc, so be careful */ void mpd_freeSong(mpd_Song *song); /* mpd_songDup * works like strDup, but for a mpd_Song */ mpd_Song *mpd_songDup(mpd_Song *song); /* DIRECTORY STUFF */ /* mpd_Directory * used to store info from directory (right now just the path) */ typedef struct _mpd_Directory { char *path; } mpd_Directory; /* mpd_newDirectory * allocates memory for a new directory * use mpd_freeDirectory to free this memory */ mpd_Directory *mpd_newDirectory(void); /* mpd_freeDirectory * used to free memory allocated with mpd_newDirectory, and it frees * path of mpd_Directory, so be careful */ void mpd_freeDirectory(mpd_Directory *directory); /* mpd_directoryDup * works like strdup, but for mpd_Directory */ mpd_Directory *mpd_directoryDup(mpd_Directory *directory); /* PLAYLISTFILE STUFF */ /* mpd_PlaylistFile * stores info about playlist file returned by lsinfo */ typedef struct _mpd_PlaylistFile { char *path; } mpd_PlaylistFile; /* mpd_newPlaylistFile * allocates memory for new mpd_PlaylistFile, path is set to nullptr * free this memory with mpd_freePlaylistFile */ mpd_PlaylistFile *mpd_newPlaylistFile(void); /* mpd_freePlaylist * free memory allocated for freePlaylistFile * will also free path, so be careful */ void mpd_freePlaylistFile(mpd_PlaylistFile *playlist); /* mpd_playlistFileDup * works like strdup, but for mpd_PlaylistFile */ mpd_PlaylistFile *mpd_playlistFileDup(mpd_PlaylistFile *playlist); /* INFO ENTITY STUFF */ /* the type of entity returned from one of the commands that generates info * use in conjunction with mpd_InfoEntity.type */ #define MPD_INFO_ENTITY_TYPE_DIRECTORY 0 #define MPD_INFO_ENTITY_TYPE_SONG 1 #define MPD_INFO_ENTITY_TYPE_PLAYLISTFILE 2 /* mpd_InfoEntity * stores info on stuff returned info commands */ typedef struct mpd_InfoEntity { /* the type of entity, use with MPD_INFO_ENTITY_TYPE_* to determine * what this entity is (song, directory, etc...) */ int type; /* the actual data you want, mpd_Song, mpd_Directory, etc */ union { mpd_Directory *directory; mpd_Song *song; mpd_PlaylistFile *playlistFile; } info; } mpd_InfoEntity; mpd_InfoEntity *mpd_newInfoEntity(void); void mpd_freeInfoEntity(mpd_InfoEntity *entity); /* INFO COMMANDS AND STUFF */ /* use this function to loop over after calling Info/Listall functions */ mpd_InfoEntity *mpd_getNextInfoEntity(mpd_Connection *connection); /* fetches the currently selected song (the song referenced by status->song * and status->songid */ void mpd_sendCurrentSongCommand(mpd_Connection *connection); /* songNum of -1, means to display the whole list */ void mpd_sendPlaylistInfoCommand(mpd_Connection *connection, int songPos); /* songId of -1, means to display the whole list */ void mpd_sendPlaylistIdCommand(mpd_Connection *connection, int id); /* use this to get the changes in the playlist since version _playlist_ */ void mpd_sendPlChangesCommand(mpd_Connection *connection, long long playlist); /** * @param connection: A valid and connected mpd_Connection. * @param playlist: The playlist version you want the diff with. * * A more bandwidth efficient version of the mpd_sendPlChangesCommand. * It only returns the pos+id of the changes song. */ void mpd_sendPlChangesPosIdCommand(mpd_Connection *connection, long long playlist); /* recursively fetches all songs/dir/playlists in "dir* * (no metadata is returned) */ void mpd_sendListallCommand(mpd_Connection *connection, const char *dir); /* same as sendListallCommand, but also metadata is returned */ void mpd_sendListallInfoCommand(mpd_Connection *connection, const char *dir); /* non-recursive version of ListallInfo */ void mpd_sendLsInfoCommand(mpd_Connection *connection, const char *dir); #define MPD_TABLE_ARTIST MPD_TAG_ITEM_ARTIST #define MPD_TABLE_ALBUM MPD_TAG_ITEM_ALBUM #define MPD_TABLE_TITLE MPD_TAG_ITEM_TITLE #define MPD_TABLE_FILENAME MPD_TAG_ITEM_FILENAME void mpd_sendSearchCommand(mpd_Connection *connection, int table, const char *str); void mpd_sendFindCommand(mpd_Connection *connection, int table, const char *str); /* LIST TAG COMMANDS */ /* use this function fetch next artist entry, be sure to free the * returned string. * nullptr means there are no more. * Best used with sendListArtists */ char *mpd_getNextArtist(mpd_Connection *connection); char *mpd_getNextAlbum(mpd_Connection *connection); char *mpd_getNextTag(mpd_Connection *connection, int type); /* list artist or albums by artist * arg1 should be set to the artist if listing albums by a artist * otherwise nullptr for listing all artists or albums */ void mpd_sendListCommand(mpd_Connection *connection, int table, const char *arg1); /* SIMPLE COMMANDS */ void mpd_sendAddCommand(mpd_Connection *connection, const char *file); int mpd_sendAddIdCommand(mpd_Connection *connection, const char *file); void mpd_sendDeleteCommand(mpd_Connection *connection, int songPos); void mpd_sendDeleteIdCommand(mpd_Connection *connection, int id); void mpd_sendSaveCommand(mpd_Connection *connection, const char *name); void mpd_sendLoadCommand(mpd_Connection *connection, const char *name); void mpd_sendRmCommand(mpd_Connection *connection, const char *name); void mpd_sendRenameCommand(mpd_Connection *connection, const char *from, const char *to); void mpd_sendShuffleCommand(mpd_Connection *connection); void mpd_sendClearCommand(mpd_Connection *connection); /* use this to start playing at the beginning, useful when in random mode */ #define MPD_PLAY_AT_BEGINNING -1 void mpd_sendPlayCommand(mpd_Connection *connection, int songPos); void mpd_sendPlayIdCommand(mpd_Connection *connection, int id); void mpd_sendStopCommand(mpd_Connection *connection); void mpd_sendPauseCommand(mpd_Connection *connection, int pauseMode); void mpd_sendNextCommand(mpd_Connection *connection); void mpd_sendPrevCommand(mpd_Connection *connection); void mpd_sendMoveCommand(mpd_Connection *connection, int from, int to); void mpd_sendMoveIdCommand(mpd_Connection *connection, int id, int to); void mpd_sendSwapCommand(mpd_Connection *connection, int song1, int song2); void mpd_sendSwapIdCommand(mpd_Connection *connection, int id1, int id2); void mpd_sendSeekCommand(mpd_Connection *connection, int song, int seek_time); void mpd_sendSeekIdCommand(mpd_Connection *connection, int id, int seek_time); void mpd_sendRepeatCommand(mpd_Connection *connection, int repeatMode); void mpd_sendRandomCommand(mpd_Connection *connection, int randomMode); void mpd_sendSetvolCommand(mpd_Connection *connection, int volumeChange); /* WARNING: don't use volume command, its deprecated */ void mpd_sendVolumeCommand(mpd_Connection *connection, int volumeChange); void mpd_sendCrossfadeCommand(mpd_Connection *connection, int seconds); void mpd_sendUpdateCommand(mpd_Connection *connection, char *path); /* returns the update job id, call this after a update command */ int mpd_getUpdateId(mpd_Connection *connection); void mpd_sendPasswordCommand(mpd_Connection *connection, const char *pass); /* after executing a command, when you're done with it to get its status * (you want to check connection->error for an error) */ void mpd_finishCommand(mpd_Connection *connection); /* command list stuff, use this to do things like add files very quickly */ void mpd_sendCommandListBegin(mpd_Connection *connection); void mpd_sendCommandListOkBegin(mpd_Connection *connection); void mpd_sendCommandListEnd(mpd_Connection *connection); /* advance to the next listOk * returns 0 if advanced to the next list_OK, * returns -1 if it advanced to an OK or ACK */ int mpd_nextListOkCommand(mpd_Connection *connection); typedef struct _mpd_OutputEntity { int id; char *name; int enabled; } mpd_OutputEntity; void mpd_sendOutputsCommand(mpd_Connection *connection); mpd_OutputEntity *mpd_getNextOutput(mpd_Connection *connection); void mpd_sendEnableOutputCommand(mpd_Connection *connection, int outputId); void mpd_sendDisableOutputCommand(mpd_Connection *connection, int outputId); void mpd_freeOutputElement(mpd_OutputEntity *output); /** * @param connection a #mpd_Connection * * Queries mpd for the allowed commands */ void mpd_sendCommandsCommand(mpd_Connection *connection); /** * @param connection a #mpd_Connection * * Queries mpd for the not allowed commands */ void mpd_sendNotCommandsCommand(mpd_Connection *connection); /** * @param connection a #mpd_Connection * * returns the next supported command. * * @returns a string, needs to be freed */ char *mpd_getNextCommand(mpd_Connection *connection); void mpd_sendUrlHandlersCommand(mpd_Connection *connection); char *mpd_getNextHandler(mpd_Connection *connection); void mpd_sendTagTypesCommand(mpd_Connection *connection); char *mpd_getNextTagType(mpd_Connection *connection); /** * @param connection a MpdConnection * @param path the path to the playlist. * * List the content, with full metadata, of a stored playlist. */ void mpd_sendListPlaylistInfoCommand(mpd_Connection *connection, char *path); /** * @param connection a MpdConnection * @param path the path to the playlist. * * List the content of a stored playlist. */ void mpd_sendListPlaylistCommand(mpd_Connection *connection, char *path); /** * @param connection a #mpd_Connection * @param exact if to match exact * * starts a search * use mpd_addConstraintSearch to add a constraint to the search * use mpd_commitSearch to do the actual search */ void mpd_startSearch(mpd_Connection *connection, int exact); /** * @param connection a #mpd_Connection * @param type * @param name */ void mpd_addConstraintSearch(mpd_Connection *connection, int type, const char *name); /** * @param connection a #mpd_Connection */ void mpd_commitSearch(mpd_Connection *connection); /** * @param connection a #mpd_Connection * @param type The type to search for * * starts a search for fields... f.e. get a list of artists would be: * @code * mpd_startFieldSearch(connection, MPD_TAG_ITEM_ARTIST); * mpd_commitSearch(connection); * @endcode * * or get a list of artist in genre "jazz" would be: * @code * mpd_startFieldSearch(connection, MPD_TAG_ITEM_ARTIST); * mpd_addConstraintSearch(connection, MPD_TAG_ITEM_GENRE, "jazz") * mpd_commitSearch(connection); * @endcode * * mpd_startSearch will return a list of songs * (and you need mpd_getNextInfoEntity) * this will return a list of only one field (the one specified with type) * you need mpd_getNextTag to get the results */ void mpd_startFieldSearch(mpd_Connection *connection, int type); void mpd_startPlaylistSearch(mpd_Connection *connection, int exact); void mpd_startStatsSearch(mpd_Connection *connection); void mpd_sendPlaylistClearCommand(mpd_Connection *connection, char *path); void mpd_sendPlaylistAddCommand(mpd_Connection *connection, char *playlist, char *path); void mpd_sendPlaylistMoveCommand(mpd_Connection *connection, char *playlist, int from, int to); void mpd_sendPlaylistDeleteCommand(mpd_Connection *connection, char *playlist, int pos); #endif conky-1.12.2/src/libtcp-portmon.cc000066400000000000000000000405541404127277500170100ustar00rootroot00000000000000/* * * libtcp-portmon.c: tcp port monitoring library. * * Copyright (C) 2005-2007 Philip Kovacs pkovacs@users.sourceforge.net * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA. * */ #ifdef HAVE_CONFIG_H #include #endif #include "libtcp-portmon.h" #include #include #include #include /* ------------------------------------------------------------------- * IMPLEMENTATION INTERFACE * * Implementation-specific interface begins here. Clients should not * manipulate these structures directly, nor call the defined helper * functions. Use the "Client interface" functions defined at bottom. * ------------------------------------------------------------------- */ namespace { /* ------------------------------------------------------------------------ * A single tcp connection * ------------------------------------------------------------------------ */ struct tcp_connection_t { /* connection's key in monitor hash */ struct in6_addr local_addr; struct in6_addr remote_addr; in_port_t local_port; in_port_t remote_port; }; /* hash function for tcp connections */ struct tcp_connection_hash { size_t operator()(const tcp_connection_t &a) const { size_t hash = 0; size_t i; hash = hash * 47 + a.local_port; hash = hash * 47 + a.remote_port; for (i = 0; i < sizeof(a.local_addr.s6_addr); ++i) hash = hash * 47 + a.local_addr.s6_addr[i]; for (i = 0; i < sizeof(a.remote_addr.s6_addr); ++i) hash = hash * 47 + a.remote_addr.s6_addr[i]; return hash; } }; /* comparison function for tcp connections */ bool operator==(const tcp_connection_t &a, const tcp_connection_t &b) { return a.local_port == b.local_port && a.remote_port == b.remote_port && !std::memcmp(&a.local_addr, &b.local_addr, sizeof(a.local_addr)) && !std::memcmp(&a.remote_addr.s6_addr, &b.remote_addr, sizeof(a.remote_addr)); } /* ------------------------------------------------------------------------ * A hash table containing tcp connection * * The second parameter provides the mechanism for removing connections if * they are not seen again in subsequent update cycles. * ------------------------------------------------------------------------ */ typedef std::unordered_map connection_hash_t; /* start and end of port monitor range. Set start=end to monitor a single port */ typedef std::pair port_range_t; /* hash function for port ranges */ struct port_range_hash { size_t operator()(const port_range_t &a) const { return a.first * 47 + a.second; } }; typedef std::unordered_map monitor_hash_t; } // namespace /* -------------- * A port monitor * -------------- */ struct _tcp_port_monitor_t { /* hash table of pointers into connection list */ connection_hash_t hash; /* array of connection pointers for O(1) peeking * these point into the hash table*/ std::vector p_peek; _tcp_port_monitor_t(int max_connections) : hash(), p_peek(max_connections, static_cast(nullptr)) {} _tcp_port_monitor_t(const _tcp_port_monitor_t &other) : hash(other.hash), p_peek(other.p_peek.size(), static_cast(nullptr)) { // we must rebuild the peek table because the pointers are no longer valid rebuild_peek_table(); } void rebuild_peek_table() { /* Run through the monitor's connections and rebuild the peek table of * connection pointers. This is done so peeking into the monitor can be * done in O(1) time instead of O(n) time for each peek. */ /* zero out the peek array */ std::fill(p_peek.begin(), p_peek.end(), static_cast(nullptr)); size_t i = 0; for (connection_hash_t::iterator j = hash.begin(); j != hash.end(); ++j, ++i) { p_peek[i] = &j->first; } } private: // we don't need this atm const _tcp_port_monitor_t &operator=(const _tcp_port_monitor_t &); }; /* ----------------------------- * A tcp port monitor collection * ----------------------------- */ struct _tcp_port_monitor_collection_t { /* hash table of monitors */ monitor_hash_t hash; }; namespace { /* --------------------------------------- * A port monitor utility function typedef * --------------------------------------- */ typedef void (*tcp_port_monitor_function_ptr_t)( monitor_hash_t::value_type &monitor, void *p_void); void age_tcp_port_monitor(monitor_hash_t::value_type &monitor, void *p_void) { /* Run through the monitor's connections and decrement the age variable. * If the age goes negative, we remove the connection from the monitor. * Function takes O(n) time on the number of connections. */ if (p_void) { /* p_void should be nullptr in this context */ return; } for (connection_hash_t::iterator i = monitor.second.hash.begin(); i != monitor.second.hash.end();) { if (--i->second >= 0) ++i; else { /* connection is old. remove connection from the hash. */ /* erase shouldn't invalidate iterators */ monitor.second.hash.erase(i++); } } } void rebuild_tcp_port_monitor_peek_table(monitor_hash_t::value_type &monitor, void *p_void) { if (p_void) { /* p_void should be nullptr in this context */ return; } monitor.second.rebuild_peek_table(); } void show_connection_to_tcp_port_monitor(monitor_hash_t::value_type &monitor, void *p_void) { /* The monitor gets to look at each connection to see if it falls within * the monitor's port range of interest. Connections of interest are first * looked up in the hash to see if they are already there. If they are, we * reset the age of the connection so it is not deleted. If the connection * is not in the hash, we add it, but only if we haven't exceeded the * maximum connection limit for the monitor. * The function takes O(1) time. */ tcp_connection_t *p_connection; if (!p_void) { return; } /* This p_connection is on caller's stack and not the heap. * If we are interested, we will create a copy of the connection * (on the heap) and add it to our list. */ p_connection = (tcp_connection_t *)p_void; /* inspect the local port number of the connection to see if we're * interested. */ if ((monitor.first.first <= p_connection->local_port) && (p_connection->local_port <= monitor.first.second)) { /* the connection is in the range of the monitor. */ /* first check the hash to see if the connection is already there. */ connection_hash_t::iterator i = monitor.second.hash.find(*p_connection); if (i != monitor.second.hash.end()) { /* it's already in the hash. reset the age of the connection. */ i->second = TCP_CONNECTION_STARTING_AGE; return; } /* Connection is not yet in the hash. * Add it if max_connections not exceeded. */ if (monitor.second.hash.size() < monitor.second.p_peek.size()) { monitor.second.hash.insert(connection_hash_t::value_type( *p_connection, TCP_CONNECTION_STARTING_AGE)); } } } /* ------------------------------------------------------------------------ * Apply a tcp_port_monitor_function_ptr_t function to each port monitor in * the collection. * ------------------------------------------------------------------------ */ void for_each_tcp_port_monitor_in_collection( tcp_port_monitor_collection_t *p_collection, tcp_port_monitor_function_ptr_t p_function, void *p_function_args) { if (!p_collection || !p_function) { return; } /* for each monitor in the collection */ for (monitor_hash_t::iterator i = p_collection->hash.begin(); i != p_collection->hash.end(); ++i) { /* apply the function with the given arguments */ p_function(*i, p_function_args); } } const unsigned char prefix_4on6[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff}; union sockaddr_in46 { struct sockaddr_in sa4; struct sockaddr_in6 sa6; struct sockaddr sa; }; /* checks whether the address is a IPv4-mapped IPv6 address */ bool is_4on6(const struct in6_addr *addr) { return !std::memcmp(&addr->s6_addr, prefix_4on6, sizeof(prefix_4on6)); } /* converts the address to appropriate textual representation (IPv6, IPv4 or * fqdn) */ void print_host(char *p_buffer, size_t buffer_size, const struct in6_addr *addr, int fqdn) { union sockaddr_in46 sa; socklen_t slen; std::memset(&sa, 0, sizeof(sa)); if (is_4on6(addr)) { sa.sa4.sin_family = AF_INET; std::memcpy(&sa.sa4.sin_addr.s_addr, &addr->s6_addr[12], 4); slen = sizeof(sa.sa4); } else { sa.sa6.sin6_family = AF_INET6; std::memcpy(&sa.sa6.sin6_addr, addr, sizeof(struct in6_addr)); slen = sizeof(sa.sa6); } getnameinfo(&sa.sa, slen, p_buffer, buffer_size, nullptr, 0, fqdn ? 0 : NI_NUMERICHOST); } /* converts the textual representation of an IPv4 or IPv6 address to struct * in6_addr */ void string_to_addr(struct in6_addr *addr, const char *p_buffer) { size_t i; if (std::strlen(p_buffer) < 32) { // IPv4 address i = sizeof(prefix_4on6); std::memcpy(addr->s6_addr, prefix_4on6, i); } else { i = 0; } for (; i < sizeof(addr->s6_addr); i += 4, p_buffer += 8) { std::sscanf(p_buffer, "%8x", (unsigned *)&addr->s6_addr[i]); } } /* adds connections from file to the collection */ void process_file(tcp_port_monitor_collection_t *p_collection, const char *file) { std::FILE *fp; char buf[256]; char local_addr[40]; char remote_addr[40]; tcp_connection_t conn; unsigned long inode, uid, state; if ((fp = std::fopen(file, "r")) == nullptr) { return; } /* ignore field name line */ if (std::fgets(buf, 255, fp) == nullptr) { std::fclose(fp); return; } /* read all tcp connections */ while (std::fgets(buf, sizeof(buf), fp) != nullptr) { if (std::sscanf(buf, "%*d: %39[0-9a-fA-F]:%hx %39[0-9a-fA-F]:%hx %lx %*x:%*x " "%*x:%*x %*x %lu %*d %lu", local_addr, &conn.local_port, remote_addr, &conn.remote_port, (unsigned long *)&state, (unsigned long *)&uid, (unsigned long *)&inode) != 7) { std::fprintf(stderr, "%s: bad file format\n", file); } /** TCP_ESTABLISHED equals 1, but is not (always??) included **/ // if ((inode == 0) || (state != TCP_ESTABLISHED)) { if ((inode == 0) || (state != 1)) { continue; } string_to_addr(&conn.local_addr, local_addr); string_to_addr(&conn.remote_addr, remote_addr); /* show the connection to each port monitor. */ for_each_tcp_port_monitor_in_collection( p_collection, &show_connection_to_tcp_port_monitor, (void *)&conn); } std::fclose(fp); } } // namespace /* ---------------------------------------------------------------------- * CLIENT INTERFACE * * Clients should call only those functions below this line. * ---------------------------------------------------------------------- */ /* ---------------------------------- * Client operations on port monitors * ---------------------------------- */ /* Clients use this function to get connection data from the indicated * port monitor. * The requested monitor value is copied into a client-supplied char buffer. * Returns 0 on success, -1 otherwise. */ int peek_tcp_port_monitor(const tcp_port_monitor_t *p_monitor, int item, int connection_index, char *p_buffer, size_t buffer_size) { struct sockaddr_in sa; if (!p_monitor || !p_buffer || connection_index < 0) { return -1; } std::memset(p_buffer, 0, buffer_size); std::memset(&sa, 0, sizeof(sa)); sa.sin_family = AF_INET; /* if the connection index is out of range, we simply return with no error, * having first cleared the client-supplied buffer. */ if ((item != COUNT) && (connection_index >= ssize_t(p_monitor->hash.size()))) { return 0; } switch (item) { case COUNT: std::snprintf(p_buffer, buffer_size, "%u", unsigned(p_monitor->hash.size())); break; case REMOTEIP: print_host(p_buffer, buffer_size, &p_monitor->p_peek[connection_index]->remote_addr, 0); break; case REMOTEHOST: print_host(p_buffer, buffer_size, &p_monitor->p_peek[connection_index]->remote_addr, 1); break; case REMOTEPORT: std::snprintf(p_buffer, buffer_size, "%d", p_monitor->p_peek[connection_index]->remote_port); break; case REMOTESERVICE: sa.sin_port = htons(p_monitor->p_peek[connection_index]->remote_port); getnameinfo((struct sockaddr *)&sa, sizeof(struct sockaddr_in), nullptr, 0, p_buffer, buffer_size, NI_NUMERICHOST); break; case LOCALIP: print_host(p_buffer, buffer_size, &p_monitor->p_peek[connection_index]->local_addr, 0); break; case LOCALHOST: print_host(p_buffer, buffer_size, &p_monitor->p_peek[connection_index]->local_addr, 1); break; case LOCALPORT: std::snprintf(p_buffer, buffer_size, "%d", p_monitor->p_peek[connection_index]->local_port); break; case LOCALSERVICE: sa.sin_port = htons(p_monitor->p_peek[connection_index]->local_port); getnameinfo((struct sockaddr *)&sa, sizeof(struct sockaddr_in), nullptr, 0, p_buffer, buffer_size, NI_NUMERICHOST); break; default: return -1; } return 0; } /* -------------------------------- * Client operations on collections * -------------------------------- */ /* Create a monitor collection. Do this one first. */ tcp_port_monitor_collection_t *create_tcp_port_monitor_collection(void) { return new tcp_port_monitor_collection_t(); } /* Destroy the monitor collection (and the monitors inside). * Do this one last. */ void destroy_tcp_port_monitor_collection( tcp_port_monitor_collection_t *p_collection) { delete p_collection; } /* Updates the tcp statistics for all monitors within a collection */ void update_tcp_port_monitor_collection( tcp_port_monitor_collection_t *p_collection) { if (!p_collection) { return; } process_file(p_collection, "/proc/net/tcp"); process_file(p_collection, "/proc/net/tcp6"); /* age the connections in all port monitors. */ for_each_tcp_port_monitor_in_collection(p_collection, &age_tcp_port_monitor, nullptr); /* rebuild the connection peek tables of all monitors * so clients can peek in O(1) time */ for_each_tcp_port_monitor_in_collection( p_collection, &rebuild_tcp_port_monitor_peek_table, nullptr); } /* Creation of redundant monitors is silently ignored */ int insert_new_tcp_port_monitor_into_collection( tcp_port_monitor_collection_t *p_collection, in_port_t port_range_begin, in_port_t port_range_end, tcp_port_monitor_args_t *p_creation_args) { if (!p_collection) { return -1; } p_collection->hash.insert(monitor_hash_t::value_type( port_range_t(port_range_begin, port_range_end), tcp_port_monitor_t(p_creation_args->max_port_monitor_connections))); return 0; } /* Clients need a way to find monitors */ tcp_port_monitor_t *find_tcp_port_monitor( tcp_port_monitor_collection_t *p_collection, in_port_t port_range_begin, in_port_t port_range_end) { if (!p_collection) { return nullptr; } /* is monitor in hash? */ monitor_hash_t::iterator i = p_collection->hash.find(port_range_t(port_range_begin, port_range_end)); return i == p_collection->hash.end() ? nullptr : &i->second; } conky-1.12.2/src/libtcp-portmon.h000066400000000000000000000112671404127277500166510ustar00rootroot00000000000000/* * * libtcp-portmon.h: tcp port monitoring library. * * Copyright (C) 2005-2007 Philip Kovacs pkovacs@users.sourceforge.net * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA. */ #ifndef LIBTCP_PORTMON_H #define LIBTCP_PORTMON_H #include #include #include #include #include #include /* connection deleted if unseen again after this # of refreshes */ #define TCP_CONNECTION_STARTING_AGE 1 #define BUILD_PORT_MONITORS_HASH_KEY_SIZE 12 #define MAX_PORT_MONITOR_CONNECTIONS_DEFAULT 256 /* ------------------------------------------------------------------- * IMPLEMENTATION INTERFACE * * Implementation-specific interface begins here. Clients should not * manipulate these structures directly, nor call the defined helper * functions. Use the "Client interface" functions defined at bottom. * ------------------------------------------------------------------- */ /* The inventory of peekable items within the port monitor. */ enum tcp_port_monitor_peekables { COUNT = 0, REMOTEIP, REMOTEHOST, REMOTEPORT, REMOTESERVICE, LOCALIP, LOCALHOST, LOCALPORT, LOCALSERVICE }; /* ------------------------------------------------------------ * A port monitor * * The definition of the struct is hidden because it contains * C++-specific stuff and we want to #include this from C code. * ------------------------------------------------------------ */ typedef struct _tcp_port_monitor_t tcp_port_monitor_t; /* ------------------------------------------------------------ * A tcp port monitor collection * * The definition of the struct is hidden because it contains * C++-specific stuff and we want to #include this from C code. * ------------------------------------------------------------ */ typedef struct _tcp_port_monitor_collection_t tcp_port_monitor_collection_t; /* ---------------------------------------------------------------------- * CLIENT INTERFACE * * Clients should call only those functions below this line. * ---------------------------------------------------------------------- */ /* struct to hold monitor creation arguments */ typedef struct _tcp_port_monitor_args_t { /* monitor supports tracking at most this many connections */ int max_port_monitor_connections; } tcp_port_monitor_args_t; /* ---------------------------------- * Client operations on port monitors * ---------------------------------- */ /* Clients use this function to get connection data from * the indicated port monitor. * The requested monitor value is copied into a client-supplied char buffer. * Returns 0 on success, -1 otherwise. */ int peek_tcp_port_monitor( const tcp_port_monitor_t *p_monitor, /* (item of interest, from tcp_port_monitor_peekables enum) */ int item, /* (0 to number of connections in monitor - 1) */ int connection_index, /* buffer to receive requested value */ char *p_buffer, /* size of p_buffer */ size_t buffer_size); /* -------------------------------- * Client operations on collections * -------------------------------- */ /* Create a monitor collection. Do this one first. */ tcp_port_monitor_collection_t *create_tcp_port_monitor_collection(void); /* Destroy the monitor collection (and everything it contains). * Do this one last. */ void destroy_tcp_port_monitor_collection( tcp_port_monitor_collection_t *p_collection); /* Updates the tcp statistics for all monitors within a collection */ void update_tcp_port_monitor_collection( tcp_port_monitor_collection_t *p_collection); /* Creation of redundant monitors is silently ignored * Returns 0 on success, -1 otherwise. */ int insert_new_tcp_port_monitor_into_collection( tcp_port_monitor_collection_t *p_collection, in_port_t port_range_begin, in_port_t port_range_end, tcp_port_monitor_args_t *p_creation_args); /* Clients need a way to find monitors */ tcp_port_monitor_t *find_tcp_port_monitor( tcp_port_monitor_collection_t *p_collection, in_port_t port_range_begin, in_port_t port_range_end); #endif conky-1.12.2/src/linux.cc000066400000000000000000002657401404127277500152040ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2007 Toni Spets * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "linux.h" #include #include #include #include #include #include #include #include #include "common.h" #include "conky.h" #include "diskio.h" #include "logging.h" #include "net_stat.h" #include "proc.h" #include "temphelper.h" #ifndef HAVE_CLOCK_GETTIME #include #endif #include #include // #include #include #include #include "setting.hh" #include "top.h" #include #include #include #include #include #include #ifdef _NET_IF_H #define _LINUX_IF_H #endif #include #include #include #include #include #include /* The following ifdefs were adapted from gkrellm */ #include #if !defined(MD_MAJOR) #define MD_MAJOR 9 #endif #if !defined(LVM_BLK_MAJOR) #define LVM_BLK_MAJOR 58 #endif #if !defined(NBD_MAJOR) #define NBD_MAJOR 43 #endif #if !defined(DM_MAJOR) #define DM_MAJOR 253 #endif #ifdef BUILD_WLAN #include #endif struct sysfs { int fd; int arg; char devtype[256]; char type[64]; float factor, offset; }; /* To be used inside upspeed/f downspeed/f as ${gw_iface} variable */ char e_iface[50]; /* To use ${iface X} where X is a number and will * return the current X NIC name */ static const unsigned int iface_len = 64U; char interfaces_arr[MAX_NET_INTERFACES][iface_len] = {""}; #define SHORTSTAT_TEMPL "%*s %llu %llu %llu" #define LONGSTAT_TEMPL "%*s %llu %llu %llu " static conky::simple_config_setting top_cpu_separate("top_cpu_separate", false, true); /* This flag tells the linux routines to use the /proc system where possible, * even if other api's are available, e.g. sysinfo() or getloadavg(). * the reason for this is to allow for /proc-based distributed monitoring. * using a flag in this manner creates less confusing code. */ static int prefer_proc = 0; /* To tell 'print_sysfs_sensor' whether to print the temperature * in int or float */ static const char *temp2 = "empty"; void prepare_update(void) {} int update_uptime(void) { #ifdef HAVE_SYSINFO if (!prefer_proc) { struct sysinfo s_info; sysinfo(&s_info); info.uptime = (double)s_info.uptime; } else #endif { static int reported = 0; FILE *fp; if (!(fp = open_file("/proc/uptime", &reported))) { info.uptime = 0.0; return 0; } if (fscanf(fp, "%lf", &info.uptime) <= 0) info.uptime = 0; fclose(fp); } return 0; } int check_mount(struct text_object *obj) { int ret = 0; FILE *mtab; if (!obj->data.s) return 0; if ((mtab = fopen("/proc/mounts", "r"))) { char buf1[256], buf2[129]; while (fgets(buf1, 256, mtab)) { sscanf(buf1, "%*s %128s", buf2); if (!strcmp(obj->data.s, buf2)) { ret = 1; break; } } fclose(mtab); } else { NORM_ERR("Could not open mtab"); } return ret; } /* these things are also in sysinfo except Buffers: * (that's why I'm reading them from proc) */ int update_meminfo(void) { FILE *meminfo_fp; static int reported = 0; /* unsigned int a; */ char buf[256]; /* With multi-threading, calculations that require * multiple steps to reach a final result can cause havok * if the intermediary calculations are directly assigned to the * information struct (they may be read by other functions in the meantime). * These variables keep the calculations local to the function and finish off * the function by assigning the results to the information struct */ unsigned long long shmem = 0, sreclaimable = 0, curmem = 0, curbufmem = 0, cureasyfree = 0, memavail = 0; info.memmax = info.memdirty = info.swap = info.swapfree = info.swapmax = info.memwithbuffers = info.buffers = info.cached = info.memfree = info.memeasyfree = info.legacymem = 0; if (!(meminfo_fp = open_file("/proc/meminfo", &reported))) { return 0; } while (!feof(meminfo_fp)) { if (fgets(buf, 255, meminfo_fp) == nullptr) { break; } if (strncmp(buf, "MemTotal:", 9) == 0) { sscanf(buf, "%*s %llu", &info.memmax); } else if (strncmp(buf, "MemFree:", 8) == 0) { sscanf(buf, "%*s %llu", &info.memfree); } else if (strncmp(buf, "SwapTotal:", 10) == 0) { sscanf(buf, "%*s %llu", &info.swapmax); } else if (strncmp(buf, "SwapFree:", 9) == 0) { sscanf(buf, "%*s %llu", &info.swapfree); } else if (strncmp(buf, "Buffers:", 8) == 0) { sscanf(buf, "%*s %llu", &info.buffers); } else if (strncmp(buf, "Cached:", 7) == 0) { sscanf(buf, "%*s %llu", &info.cached); } else if (strncmp(buf, "Dirty:", 6) == 0) { sscanf(buf, "%*s %llu", &info.memdirty); } else if (strncmp(buf, "MemAvailable:", 13) == 0) { sscanf(buf, "%*s %llu", &memavail); } else if (strncmp(buf, "Shmem:", 6) == 0) { sscanf(buf, "%*s %llu", &shmem); } else if (strncmp(buf, "SReclaimable:", 13) == 0) { sscanf(buf, "%*s %llu", &sreclaimable); } } curmem = info.memwithbuffers = info.memmax - info.memfree; cureasyfree = info.memfree; info.swap = info.swapmax - info.swapfree; /* Reclaimable memory: does not include shared memory, which is part of cached but unreclaimable. Includes the reclaimable part of the Slab cache though. Note: when shared memory is swapped out, shmem decreases and swapfree decreases - we want this. */ curbufmem = (info.cached - shmem) + info.buffers + sreclaimable; /* Calculate the memory usage. * * The Linux Kernel introduced a new field for memory available, * when possible, use that. * https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773 */ if (no_buffers.get(*state)) { #if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 14, 0) /* Now ('info.mem' - 'info.bufmem') is the *really used* (aka unreclaimable) memory. When this value reaches the size of the physical RAM, and swap is full or non-present, OOM happens. Therefore this is the value users want to monitor, regarding their RAM. */ curmem -= curbufmem; cureasyfree += curbufmem; #else /* LINUX_VERSION_CODE <= KERNEL_VERSION(3, 14, 0) */ curmem = info.memmax - memavail; cureasyfree += curbufmem; #endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(3, 14, 0) */ } /* Now that we know that every calculation is finished we can wrap up * by assigning the values to the information structure */ info.mem = curmem; info.bufmem = curbufmem; info.memeasyfree = cureasyfree; info.legacymem = info.memmax - (info.memfree + info.buffers + info.cached + sreclaimable); fclose(meminfo_fp); return 0; } void print_laptop_mode(struct text_object *obj, char *p, unsigned int p_max_size) { FILE *fp; int val = -1; (void)obj; if ((fp = fopen("/proc/sys/vm/laptop_mode", "r")) != nullptr) { if (fscanf(fp, "%d\n", &val) <= 0) val = 0; fclose(fp); } snprintf(p, p_max_size, "%d", val); } /* my system says: * # cat /sys/block/sda/queue/scheduler * noop [anticipatory] cfq */ void print_ioscheduler(struct text_object *obj, char *p, unsigned int p_max_size) { FILE *fp; char buf[128]; if (!obj->data.s) goto out_fail; snprintf(buf, 127, "/sys/block/%s/queue/scheduler", obj->data.s); if ((fp = fopen(buf, "r")) == nullptr) goto out_fail; while (fscanf(fp, "%127s", buf) == 1) { if (buf[0] == '[') { buf[strlen(buf) - 1] = '\0'; snprintf(p, p_max_size, "%s", buf + 1); fclose(fp); return; } } fclose(fp); out_fail: snprintf(p, p_max_size, "%s", "n/a"); return; } class gw_info_s { public: gw_info_s() : iface(nullptr), ip(nullptr), count(0) {} char *iface; char *ip; std::atomic count; std::mutex mutex; void reset() { std::lock_guard lock(mutex); free_and_zero(iface); free_and_zero(ip); } }; static gw_info_s gw_info; char *save_set_string(char *x, char *y) { if (x != nullptr && strcmp((char *)x, (char *)y)) { free_and_zero(x); x = strndup("multiple", text_buffer_size.get(*state)); } else if (x == nullptr && y != nullptr) { x = strndup(y, text_buffer_size.get(*state)); } return x; } void update_gateway_info_failure(const char *reason) { if (reason != nullptr) { perror(reason); } // 2 pointers to 1 location causes a crash when we try to free them both std::unique_lock lock(gw_info.mutex); free_and_zero(gw_info.iface); free_and_zero(gw_info.ip); gw_info.iface = strndup("failed", text_buffer_size.get(*state)); gw_info.ip = strndup("failed", text_buffer_size.get(*state)); } /* Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT */ #define RT_ENTRY_FORMAT "%63s %lx %lx %x %*d %*d %*d %lx %*d %*d %*d\n" FILE *check_procroute() { FILE *fp; if ((fp = fopen("/proc/net/route", "r")) == nullptr) { update_gateway_info_failure("fopen()"); return nullptr; } /* skip over the table header line, which is always present */ if (fscanf(fp, "%*[^\n]\n") < 0) { fclose(fp); return nullptr; } return fp; } int update_gateway_info2(void) { FILE *fp; char iface[iface_len]; unsigned long dest; unsigned long gate; unsigned long mask; unsigned int flags; unsigned int x = 1; unsigned int z = 1; int strcmpreturn; if ((fp = check_procroute()) != nullptr) { while (!feof(fp)) { strcmpreturn = 1; if (fscanf(fp, RT_ENTRY_FORMAT, iface, &dest, &gate, &flags, &mask) != 5) { update_gateway_info_failure("fscanf()"); break; } if (!(dest || mask) && ((flags & RTF_GATEWAY) || !gate)) { snprintf(e_iface, 49, "%s", iface); } if (1U == x) { snprintf(interfaces_arr[x++], iface_len - 1, "%s", iface); continue; } else if (0 == strcmp(iface, interfaces_arr[x - 1])) { continue; } for (z = 1; z < iface_len - 1 && strcmpreturn == 1; z++) { strcmpreturn = strcmp(iface, interfaces_arr[z]); } if (strcmpreturn == 1) { snprintf(interfaces_arr[x++], iface_len - 1, "%s", iface); } } fclose(fp); } return 0; } int update_gateway_info(void) { FILE *fp; struct in_addr ina; char iface[iface_len]; unsigned long dest, gate, mask; unsigned int flags; gw_info.reset(); gw_info.count = 0; if ((fp = check_procroute()) != nullptr) { while (!feof(fp)) { if (fscanf(fp, RT_ENTRY_FORMAT, iface, &dest, &gate, &flags, &mask) != 5) { update_gateway_info_failure("fscanf()"); break; } if (!(dest || mask) && ((flags & RTF_GATEWAY) || !gate)) { gw_info.count++; snprintf(e_iface, 49, "%s", iface); std::unique_lock lock(gw_info.mutex); gw_info.iface = save_set_string(gw_info.iface, iface); ina.s_addr = gate; gw_info.ip = save_set_string(gw_info.ip, inet_ntoa(ina)); } } fclose(fp); } return 0; } void free_gateway_info(struct text_object *obj) { (void)obj; gw_info.reset(); } int gateway_exists(struct text_object *obj) { (void)obj; return !!gw_info.count; } void print_gateway_iface(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; std::lock_guard lock(gw_info.mutex); snprintf(p, p_max_size, "%s", gw_info.iface); } void print_gateway_iface2(struct text_object *obj, char *p, unsigned int p_max_size) { long int z = 0; unsigned int x = 1; unsigned int found = 0; char buf[iface_len * iface_len] = {""}; char *buf_ptr = buf; if (0 == strcmp(obj->data.s, "")) { for (; x < iface_len - 1; x++) { if (0 == strcmp("", interfaces_arr[x])) { break; } buf_ptr += snprintf(buf_ptr, iface_len - 1, "%s, ", interfaces_arr[x]); found = 1; } if (1 == found) { --buf_ptr; *(--buf_ptr) = '\0'; } snprintf(p, p_max_size, "%s", buf); return; } z = strtol(obj->data.s, (char **)NULL, 10); if ((iface_len - 1) > z) { snprintf(p, p_max_size, "%s", interfaces_arr[z]); } } void print_gateway_ip(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; std::lock_guard lock(gw_info.mutex); snprintf(p, p_max_size, "%s", gw_info.ip); } void update_net_interfaces(FILE *net_dev_fp, bool is_first_update, double time_between_updates) { /* read each interface */ #ifdef BUILD_WLAN // wireless info variables struct wireless_info *winfo; struct iwreq wrq; #endif for (int i = 0; i < MAX_NET_INTERFACES; i++) { struct net_stat *ns; char *s, *p; long long r, t, last_recv, last_trans; /* quit only after all non-header lines from /proc/net/dev parsed */ // FIXME: arbitrary size chosen to keep code simple. char buf[256]; if (fgets(buf, 255, net_dev_fp) == nullptr) { break; } p = buf; /* change char * p to first non-space character, which is the beginning * of the interface name */ while (*p != '\0' && isspace((unsigned char)*p)) { p++; } s = p; /* increment p until the end of the interface name has been reached */ while (*p != '\0' && *p != ':') { p++; } if (*p == '\0') { continue; } /* replace ':' with '\0' in output of /proc/net/dev */ *p = '\0'; p++; /* get pointer to interface statistics with the interface name in s */ ns = get_net_stat(s, nullptr, NULL); ns->up = 1; memset(&(ns->addr.sa_data), 0, 14); memset(ns->addrs, 0, 17 * MAX_NET_INTERFACES + 1); /* Up to 17 chars per ip, max MAX_NET_INTERFACES interfaces. Nasty memory usage... */ /* bytes packets errs drop fifo frame compressed multicast|bytes ... */ sscanf(p, "%lld %*d %*d %*d %*d %*d %*d %*d %lld", &r, &t); /* if the interface is parsed the first time, then set recv and trans * to currently received, meaning the change in network traffic is 0 */ if (ns->last_read_recv == -1) { ns->recv = r; is_first_update = true; ns->last_read_recv = r; } if (ns->last_read_trans == -1) { ns->trans = t; is_first_update = true; ns->last_read_trans = t; } /* move current traffic statistic to last thereby obsoleting the * current statistic */ last_recv = ns->recv; last_trans = ns->trans; /* If recv or trans is less than last time, an overflow happened. * In that case set the last traffic to the current one, don't set * it to 0, else a spike in the download and upload speed will occur! */ if (r < ns->last_read_recv) { last_recv = r; } else { ns->recv += (r - ns->last_read_recv); } ns->last_read_recv = r; if (t < ns->last_read_trans) { last_trans = t; } else { ns->trans += (t - ns->last_read_trans); } ns->last_read_trans = t; /*** ip addr patch ***/ int file_descriptor = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP); struct ifconf conf; conf.ifc_buf = (char *)malloc(sizeof(struct ifreq) * MAX_NET_INTERFACES); conf.ifc_len = sizeof(struct ifreq) * MAX_NET_INTERFACES; memset(conf.ifc_buf, 0, conf.ifc_len); ioctl(file_descriptor, SIOCGIFCONF, &conf); for (unsigned int k = 0; k < conf.ifc_len / sizeof(struct ifreq); k++) { struct net_stat *ns2; if (!(((struct ifreq *)conf.ifc_buf) + k)) break; ns2 = get_net_stat(((struct ifreq *)conf.ifc_buf)[k].ifr_ifrn.ifrn_name, nullptr, NULL); ns2->addr = ((struct ifreq *)conf.ifc_buf)[k].ifr_ifru.ifru_addr; char temp_addr[18]; snprintf(temp_addr, sizeof(temp_addr), "%u.%u.%u.%u, ", ns2->addr.sa_data[2] & 255, ns2->addr.sa_data[3] & 255, ns2->addr.sa_data[4] & 255, ns2->addr.sa_data[5] & 255); if (nullptr == strstr(ns2->addrs, temp_addr)) strncpy(ns2->addrs + strlen(ns2->addrs), temp_addr, 17); } close(file_descriptor); free(conf.ifc_buf); /*** end ip addr patch ***/ if (!is_first_update) { /* calculate instantaneous speeds */ ns->net_rec[0] = (ns->recv - last_recv) / time_between_updates; ns->net_trans[0] = (ns->trans - last_trans) / time_between_updates; } unsigned int curtmp1 = 0; unsigned int curtmp2 = 0; /* get an average over the last speed samples */ int samples = net_avg_samples.get(*state); /* is OpenMP actually useful here? How large is samples? > 1000 ? */ #ifdef HAVE_OPENMP #pragma omp parallel for reduction(+ : curtmp1, curtmp2) schedule(dynamic, 10) #endif /* HAVE_OPENMP */ for (int j = 0; j < samples; j++) { curtmp1 = curtmp1 + ns->net_rec[j]; curtmp2 = curtmp2 + ns->net_trans[j]; } ns->recv_speed = curtmp1 / (double)samples; ns->trans_speed = curtmp2 / (double)samples; if (samples > 1) { #ifdef HAVE_OPENMP #pragma omp parallel for schedule(dynamic, 10) #endif /* HAVE_OPENMP */ for (int j = samples; j > 1; j--) { ns->net_rec[j - 1] = ns->net_rec[j - 2]; ns->net_trans[j - 1] = ns->net_trans[j - 2]; } } #ifdef BUILD_WLAN /* update wireless info */ winfo = (struct wireless_info *)malloc(sizeof(struct wireless_info)); memset(winfo, 0, sizeof(struct wireless_info)); int skfd = iw_sockets_open(); if (iw_get_basic_config(skfd, s, &(winfo->b)) > -1) { // set present winfo variables if (iw_get_range_info(skfd, s, &(winfo->range)) >= 0) { winfo->has_range = 1; } if (iw_get_stats(skfd, s, &(winfo->stats), &winfo->range, winfo->has_range) >= 0) { winfo->has_stats = 1; } if (iw_get_ext(skfd, s, SIOCGIWAP, &wrq) >= 0) { winfo->has_ap_addr = 1; memcpy(&(winfo->ap_addr), &(wrq.u.ap_addr), sizeof(sockaddr)); } // get bitrate if (iw_get_ext(skfd, s, SIOCGIWRATE, &wrq) >= 0) { memcpy(&(winfo->bitrate), &(wrq.u.bitrate), sizeof(iwparam)); iw_print_bitrate(ns->bitrate, 16, winfo->bitrate.value); } // get link quality if (winfo->has_range && winfo->has_stats) { bool has_qual_level = (winfo->stats.qual.level != 0) || (winfo->stats.qual.updated & IW_QUAL_DBM); if (has_qual_level && !(winfo->stats.qual.updated & IW_QUAL_QUAL_INVALID)) { ns->link_qual = winfo->stats.qual.qual; if (winfo->range.max_qual.qual > 0) { ns->link_qual_max = winfo->range.max_qual.qual; } } } // get ap mac if (winfo->has_ap_addr) { iw_sawap_ntop(&winfo->ap_addr, ns->ap); } // get essid if (winfo->b.has_essid) { if (winfo->b.essid_on) { snprintf(ns->essid, 34, "%s", winfo->b.essid); } else { snprintf(ns->essid, 34, "%s", "off/any"); } } // get channel and freq if (winfo->b.has_freq) { if (winfo->has_range == 1) { ns->channel = iw_freq_to_channel(winfo->b.freq, &(winfo->range)); iw_print_freq_value(ns->freq, 16, winfo->b.freq); } else { ns->channel = 0; ns->freq[0] = 0; } } snprintf(ns->mode, 16, "%s", iw_operation_mode[winfo->b.mode]); } iw_sockets_close(skfd); free(winfo); #endif } } #ifdef BUILD_IPV6 void update_ipv6_net_stats() { FILE *file; char v6addr[33]; char devname[21]; unsigned int netmask, scope; struct net_stat *ns; struct v6addr *lastv6; // remove the old v6 addresses otherwise they are listed multiple times for (unsigned int i = 0; i < MAX_NET_INTERFACES; i++) { ns = &netstats[i]; while (ns->v6addrs != nullptr) { lastv6 = ns->v6addrs; ns->v6addrs = ns->v6addrs->next; free(lastv6); } } if ((file = fopen(PROCDIR "/net/if_inet6", "r")) == nullptr) { return; } while (fscanf(file, "%32s %*02x %02x %02x %*02x %20s\n", v6addr, &netmask, &scope, devname) != EOF) { ns = get_net_stat(devname, nullptr, NULL); if (ns->v6addrs == nullptr) { lastv6 = (struct v6addr *)malloc(sizeof(struct v6addr)); ns->v6addrs = lastv6; } else { lastv6 = ns->v6addrs; while (lastv6->next) lastv6 = lastv6->next; lastv6->next = (struct v6addr *)malloc(sizeof(struct v6addr)); lastv6 = lastv6->next; } for (int i = 0; i < 16; i++) sscanf(v6addr + 2 * i, "%2hhx", &(lastv6->addr.s6_addr[i])); lastv6->netmask = netmask; switch (scope) { case 0: // global lastv6->scope = 'G'; break; case 16: // host-local lastv6->scope = 'H'; break; case 32: // link-local lastv6->scope = 'L'; break; case 64: // site-local lastv6->scope = 'S'; break; case 128: // compat lastv6->scope = 'C'; break; default: lastv6->scope = '?'; } lastv6->next = nullptr; } fclose(file); } #endif /* BUILD_IPV6 */ /** * Parses information from /proc/net/dev and stores them in ??? * * For the output format of /proc/net/dev @see http://linux.die.net/man/5/proc * * @return always returns 0. May change in the future, e.g. returning non zero * if some error happened **/ int update_net_stats(void) { update_gateway_info(); update_gateway_info2(); FILE *net_dev_fp; static int reported = 0; /* variable to notify the parts averaging the download speed, that this * is the first call ever to this function. This variable can't be used * to decide if this is the first time an interface was parsed as there * are many interfaces, which can be activated and deactivated at arbitrary * times */ static bool is_first_update = true; // FIXME: arbitrary size chosen to keep code simple. char buf[256]; double time_between_updates; /* get delta */ time_between_updates = current_update_time - last_update_time; if (time_between_updates <= 0.0001) { return 0; } /* open file /proc/net/dev. If not something went wrong, clear all * network statistics */ if (!(net_dev_fp = open_file("/proc/net/dev", &reported))) { clear_net_stats(); return 0; } /* ignore first two header lines in file /proc/net/dev. If somethings * goes wrong, e.g. end of file reached, quit. * (Why isn't clear_net_stats called for this case ??? */ char *one = fgets(buf, 255, net_dev_fp); char *two = fgets(buf, 255, net_dev_fp); if (!one || /* garbage */ !two) { /* garbage (field names) */ fclose(net_dev_fp); return 0; } update_net_interfaces(net_dev_fp, is_first_update, time_between_updates); #ifdef BUILD_IPV6 update_ipv6_net_stats(); #endif /* BUILD_IPV6 */ is_first_update = false; fclose(net_dev_fp); return 0; } int result; int update_total_processes(void) { DIR *dir; struct dirent *entry; int ignore1; char ignore2; info.procs = 0; dir = opendir("/proc"); if (dir) { while ((entry = readdir(dir))) { if (sscanf(entry->d_name, "%d%c", &ignore1, &ignore2) == 1) { info.procs++; } } closedir(dir); } return 0; } int update_threads(void) { #ifdef HAVE_SYSINFO if (!prefer_proc) { struct sysinfo s_info; sysinfo(&s_info); info.threads = s_info.procs; } else #endif { static int reported = 0; FILE *fp; if (!(fp = open_file("/proc/loadavg", &reported))) { info.threads = 0; return 0; } if (fscanf(fp, "%*f %*f %*f %*d/%hu", &info.threads) <= 0) info.threads = 0; fclose(fp); } return 0; } #define CPU_SAMPLE_COUNT 15 struct cpu_info { unsigned long long cpu_user; unsigned long long cpu_system; unsigned long long cpu_nice; unsigned long long cpu_idle; unsigned long long cpu_iowait; unsigned long long cpu_irq; unsigned long long cpu_softirq; unsigned long long cpu_steal; unsigned long long cpu_total; unsigned long long cpu_active_total; unsigned long long cpu_last_total; unsigned long long cpu_last_active_total; double cpu_val[CPU_SAMPLE_COUNT]; }; static short cpu_setup = 0; /* Determine if this kernel gives us "extended" statistics information in * /proc/stat. * Kernels around 2.5 and earlier only reported user, system, nice, and * idle values in proc stat. * Kernels around 2.6 and greater report these PLUS iowait, irq, softirq, * and steal */ void determine_longstat(char *buf) { unsigned long long iowait = 0; KFLAG_SETOFF(KFLAG_IS_LONGSTAT); /* scanf will either return -1 or 1 because there is only 1 assignment */ if (sscanf(buf, "%*s %*d %*d %*d %*d %llu", &iowait) > 0) { KFLAG_SETON(KFLAG_IS_LONGSTAT); } } void determine_longstat_file(void) { #define MAX_PROCSTAT_LINELEN 255 FILE *stat_fp; static int reported = 0; char buf[MAX_PROCSTAT_LINELEN + 1]; if (!(stat_fp = open_file("/proc/stat", &reported))) return; while (!feof(stat_fp) && fgets(buf, MAX_PROCSTAT_LINELEN, stat_fp) != nullptr) { if (strncmp(buf, "cpu", 3) == 0) { determine_longstat(buf); break; } } fclose(stat_fp); } void get_cpu_count(void) { FILE *stat_fp; static int reported = 0; char buf[256]; char *str1, *str2, *token, *subtoken; char *saveptr1, *saveptr2; int subtoken1 = -1; int subtoken2 = -1; if (info.cpu_usage) { return; } if (!(stat_fp = open_file("/sys/devices/system/cpu/present", &reported))) { return; } info.cpu_count = 0; while (!feof(stat_fp)) { if (fgets(buf, 255, stat_fp) == nullptr) { break; } // Do some parsing here to handle skipped cpu numbers. For example, // for an AMD FX(tm)-6350 Six-Core Processor /sys/.../present reports // "0,3-7". I assume that chip is really an 8-core die with two cores // disabled... Presumably you could also get "0,3-4,6", and other // combos too... for (str1 = buf;; str1 = nullptr) { token = strtok_r(str1, ",", &saveptr1); if (token == nullptr) break; ++info.cpu_count; subtoken1 = -1; subtoken2 = -1; for (str2 = token;; str2 = nullptr) { subtoken = strtok_r(str2, "-", &saveptr2); if (subtoken == nullptr) break; if (subtoken1 < 0) subtoken1 = atoi(subtoken); else subtoken2 = atoi(subtoken); } if (subtoken2 > 0) info.cpu_count += subtoken2 - subtoken1; } } info.cpu_usage = (float *)malloc((info.cpu_count + 1) * sizeof(float)); fclose(stat_fp); } #define TMPL_LONGSTAT "%*s %llu %llu %llu %llu %llu %llu %llu %llu" #define TMPL_SHORTSTAT "%*s %llu %llu %llu %llu" int update_stat(void) { FILE *stat_fp; static int reported = 0; struct cpu_info *cpu = nullptr; char buf[256]; int i; unsigned int idx; double curtmp; const char *stat_template = nullptr; unsigned int malloc_cpu_size = 0; extern void *global_cpu; static pthread_mutex_t last_stat_update_mutex = PTHREAD_MUTEX_INITIALIZER; static double last_stat_update = 0.0; float cur_total = 0.0; /* since we use wrappers for this function, the update machinery * can't eliminate double invocations of this function. Check for * them here, otherwise cpu_usage counters are freaking out. */ pthread_mutex_lock(&last_stat_update_mutex); if (last_stat_update == current_update_time) { pthread_mutex_unlock(&last_stat_update_mutex); return 0; } last_stat_update = current_update_time; pthread_mutex_unlock(&last_stat_update_mutex); /* add check for !info.cpu_usage since that mem is freed on a SIGUSR1 */ if (!cpu_setup || !info.cpu_usage) { get_cpu_count(); cpu_setup = 1; } if (!stat_template) { stat_template = KFLAG_ISSET(KFLAG_IS_LONGSTAT) ? TMPL_LONGSTAT : TMPL_SHORTSTAT; } if (global_cpu) { cpu = reinterpret_cast(global_cpu); } else { malloc_cpu_size = (info.cpu_count + 1) * sizeof(struct cpu_info); cpu = (struct cpu_info *)malloc(malloc_cpu_size); memset(cpu, 0, malloc_cpu_size); global_cpu = cpu; } if (!(stat_fp = open_file("/proc/stat", &reported))) { info.run_threads = 0; if (info.cpu_usage) { memset(info.cpu_usage, 0, info.cpu_count * sizeof(float)); } return 0; } idx = 0; while (!feof(stat_fp)) { if (fgets(buf, 255, stat_fp) == nullptr) { break; } if (strncmp(buf, "procs_running ", 14) == 0) { sscanf(buf, "%*s %hu", &info.run_threads); } else if (strncmp(buf, "cpu", 3) == 0) { double delta; if (isdigit((unsigned char)buf[3])) { idx++; // just increment here since the CPU index can skip numbers } else { idx = 0; } if (idx > info.cpu_count) { continue; } sscanf(buf, stat_template, &(cpu[idx].cpu_user), &(cpu[idx].cpu_nice), &(cpu[idx].cpu_system), &(cpu[idx].cpu_idle), &(cpu[idx].cpu_iowait), &(cpu[idx].cpu_irq), &(cpu[idx].cpu_softirq), &(cpu[idx].cpu_steal)); cpu[idx].cpu_total = cpu[idx].cpu_user + cpu[idx].cpu_nice + cpu[idx].cpu_system + cpu[idx].cpu_idle + cpu[idx].cpu_iowait + cpu[idx].cpu_irq + cpu[idx].cpu_softirq + cpu[idx].cpu_steal; cpu[idx].cpu_active_total = cpu[idx].cpu_total - (cpu[idx].cpu_idle + cpu[idx].cpu_iowait); delta = current_update_time - last_update_time; if (delta <= 0.001) { break; } cur_total = (float)(cpu[idx].cpu_total - cpu[idx].cpu_last_total); if (cur_total == 0.0) { cpu[idx].cpu_val[0] = 1.0; } else { cpu[idx].cpu_val[0] = (cpu[idx].cpu_active_total - cpu[idx].cpu_last_active_total) / cur_total; } curtmp = 0; int samples = std::min(cpu_avg_samples.get(*state), CPU_SAMPLE_COUNT); for (i = 0; i < samples; i++) { curtmp = curtmp + cpu[idx].cpu_val[i]; } info.cpu_usage[idx] = curtmp / samples; cpu[idx].cpu_last_total = cpu[idx].cpu_total; cpu[idx].cpu_last_active_total = cpu[idx].cpu_active_total; for (i = samples - 1; i > 0 && i < CPU_SAMPLE_COUNT; i--) { cpu[idx].cpu_val[i] = cpu[idx].cpu_val[i - 1]; } } } fclose(stat_fp); return 0; } int update_running_processes(void) { update_stat(); return 0; } int update_cpu_usage(void) { struct timespec tc = {0L, 100L * 1000000L}; update_stat(); if (-1 == (nanosleep(&tc, NULL))) { NORM_ERR("update_cpu_usage(): nanosleep() failed"); return 0; } update_stat(); return 0; } void free_cpu(struct text_object *) { /* no-op */ } // fscanf() that reads floats with points even if you are using a locale where // floats are with commas int fscanf_no_i18n(FILE *stream, const char *format, ...) { int returncode; va_list ap; #ifdef BUILD_I18N char *oldlocale = strdup(setlocale(LC_NUMERIC, nullptr)); setlocale(LC_NUMERIC, "C"); #endif va_start(ap, format); returncode = vfscanf(stream, format, ap); va_end(ap); #ifdef BUILD_I18N setlocale(LC_NUMERIC, oldlocale); free(oldlocale); #endif return returncode; } int update_load_average(void) { #ifdef HAVE_GETLOADAVG if (!prefer_proc) { double v[3]; getloadavg(v, 3); info.loadavg[0] = (float)v[0]; info.loadavg[1] = (float)v[1]; info.loadavg[2] = (float)v[2]; } else #endif { static int reported = 0; FILE *fp; if (!(fp = open_file("/proc/loadavg", &reported))) { info.loadavg[0] = info.loadavg[1] = info.loadavg[2] = 0.0; return 0; } if (fscanf_no_i18n(fp, "%f %f %f", &info.loadavg[0], &info.loadavg[1], &info.loadavg[2]) < 0) info.loadavg[0] = info.loadavg[1] = info.loadavg[2] = 0.0; fclose(fp); } return 0; } /***********************************************************/ /***********************************************************/ /***********************************************************/ static int no_dots(const struct dirent *d) { if (d->d_name[0] == '.') { return 0; } return 1; } static int get_first_file_in_a_directory(const char *dir, char *s, int *reported) { struct dirent **namelist; int i, n; n = scandir(dir, &namelist, no_dots, alphasort); if (n < 0) { if (!reported || !*reported) { NORM_ERR("scandir for %s: %s", dir, strerror(errno)); if (reported) { *reported = 1; } } return 0; } else { if (n == 0) { return 0; } strncpy(s, namelist[0]->d_name, 255); s[255] = '\0'; for (i = 0; i < n; i++) { free(namelist[i]); } free(namelist); return 1; } } /* * Convert @dev "0" (hwmon number) or "k10temp" (hwmon name) to "hwmon2/device" */ static void get_dev_path(const char *dir, const char *dev, char *out_buf) { struct dirent **namelist; char path[256] = {'\0'}; char name[256] = {'\0'}; bool found = false; size_t size; int name_fd; int i; int n; int ret; /* "0" numbered case */ ret = sscanf(dev, "%d", &n); if (ret == 1) { snprintf(out_buf, 255, "hwmon%d/device", n); return; } /* "k10temp" name case, need to search hwmon*->name to find a match */ n = scandir(dir, &namelist, no_dots, alphasort); if (n < 0) { NORM_ERR("scandir for %s: %s", dir, strerror(errno)); goto not_found; } if (n == 0) goto not_found; /* Search each hwmon%s/name */ for (i = 0; i < n; i++) { if (found) continue; snprintf(path, 256, "%s%s/name", dir, namelist[i]->d_name); name_fd = open(path, O_RDONLY); if (name_fd < 0) continue; size = read(name_fd, name, strlen(dev)); if (size < strlen(dev)) { close(name_fd); continue; } ret = strncmp(dev, name, strlen(dev)); if (!ret) { found = true; snprintf(out_buf, 255, "%s/device", namelist[i]->d_name); } close(name_fd); } /* cleanup */ for (i = 0; i < n; i++) free(namelist[i]); free(namelist); if (found) return; not_found: out_buf[0] = '\0'; return; } static int open_sysfs_sensor(const char *dir, const char *dev, const char *type, int n, int *divisor, char *devtype) { char path[256]; char buf[256]; int fd; int divfd; memset(buf, 0, sizeof(buf)); /* if device is nullptr or *, get first */ if (dev == nullptr || strcmp(dev, "*") == 0) { static int reported = 0; if (!get_first_file_in_a_directory(dir, buf, &reported)) { return -1; } dev = buf; } if (strcmp(dir, "/sys/class/hwmon/") == 0) { if (*buf) { /* buf holds result from get_first_file_in_a_directory() above, * e.g. "hwmon0" -- append "/device" */ strncat(buf, "/device", 255 - strnlen(buf, 255)); } else { /* * @dev holds device number N or hwmon name as a string, * convert them as: * "0" -> "hwmon0/device" * "k10temp" -> "hwmon2/device", where hwmon2/name is "k10temp" */ get_dev_path(dir, dev, buf); /* Not found */ if (buf[0] == '\0') { NORM_ERR("can't parse device \"%s\"", dev); return -1; } dev = buf; } } /* change vol to in, tempf to temp */ if (strcmp(type, "vol") == 0) { type = "in"; } else if (strcmp(type, "tempf") == 0) { type = "temp"; } else if (strcmp(type, "temp2") == 0) { type = "temp"; } DBGP("%s: dir=%s dev=%s type=%s n=%d\n", __func__, dir, dev, type, n); /* construct path */ snprintf(path, 255, "%s%s/%s%d_input", dir, dev, type, n); /* first, attempt to open file in /device */ fd = open(path, O_RDONLY); if (fd < 0) { /* if it fails, strip the /device from dev and attempt again */ size_t len_to_trunc = std::max((size_t)7, strnlen(buf, 255)) - 7; buf[len_to_trunc] = 0; snprintf(path, 255, "%s%s/%s%d_input", dir, dev, type, n); fd = open(path, O_RDONLY); if (fd < 0) { NORM_ERR( "can't open '%s': %s\nplease check your device or remove this " "var from " PACKAGE_NAME, path, strerror(errno)); } } strncpy(devtype, path, 255); if (strcmp(type, "in") == 0 || strcmp(type, "temp") == 0 || strcmp(type, "tempf") == 0) { *divisor = 1; } else { *divisor = 0; } /* fan does not use *_div as a read divisor */ if (strcmp("fan", type) == 0) { return fd; } /* test if *_div file exist, open it and use it as divisor */ if (strcmp(type, "tempf") == 0) { snprintf(path, 255, "%s%s/%s%d_div", dir, "one", "two", n); } else { snprintf(path, 255, "%s%s/%s%d_div", dir, dev, type, n); } divfd = open(path, O_RDONLY); if (divfd > 0) { /* read integer */ char divbuf[64]; int divn; divn = read(divfd, divbuf, 63); /* should read until n == 0 but I doubt that kernel will give these * in multiple pieces. :) */ if (divn < 0) { NORM_ERR("open_sysfs_sensor(): can't read from sysfs"); } else { divbuf[divn] = '\0'; *divisor = atoi(divbuf); } close(divfd); } return fd; } static double get_sysfs_info(int *fd, int divisor, char *devtype, char *type) { int val = 0; if (*fd <= 0) { return 0; } lseek(*fd, 0, SEEK_SET); /* read integer */ { char buf[64]; int n; n = read(*fd, buf, 63); /* should read until n == 0 but I doubt that kernel will give these * in multiple pieces. :) */ if (n < 0) { NORM_ERR("get_sysfs_info(): read from %s failed\n", devtype); } else { buf[n] = '\0'; val = atoi(buf); } } close(*fd); /* open file */ *fd = open(devtype, O_RDONLY); if (*fd < 0) { NORM_ERR("can't open '%s': %s", devtype, strerror(errno)); } /* My dirty hack for computing CPU value * Filedil, from forums.gentoo.org */ /* if (strstr(devtype, "temp1_input") != nullptr) { return -15.096 + 1.4893 * (val / 1000.0); } */ /* divide voltage and temperature by 1000 */ /* or if any other divisor is given, use that */ if (0 == (strcmp(type, "temp2"))) { temp2 = "temp2"; } else { temp2 = "empty"; } if (strcmp(type, "tempf") == 0) { if (divisor > 1) { return ((val / divisor + 40) * 9.0 / 5) - 40; } else if (divisor) { return ((val / 1000.0 + 40) * 9.0 / 5) - 40; } else { return ((val + 40) * 9.0 / 5) - 40; } } else { if (divisor > 1) { return val / divisor; } else if (divisor) { return val / 1000.0; } else { return val; } } } #define HWMON_RESET() \ { \ buf1[0] = 0; \ factor = 1.0; \ offset = 0.0; \ } static void parse_sysfs_sensor(struct text_object *obj, const char *arg, const char *path, const char *type) { char buf1[64], buf2[64]; float factor, offset; int n, found = 0; struct sysfs *sf; memset(buf1, 0, 64); memset(buf2, 0, 64); if (sscanf(arg, "%63s %d %f %f", buf2, &n, &factor, &offset) == 4) found = 1; else HWMON_RESET(); if (!found && sscanf(arg, "%63s %63s %d %f %f", buf1, buf2, &n, &factor, &offset) == 5) found = 1; else if (!found) HWMON_RESET(); if (!found && sscanf(arg, "%63s %63s %d", buf1, buf2, &n) == 3) found = 1; else if (!found) HWMON_RESET(); if (!found && sscanf(arg, "%63s %d", buf2, &n) == 2) found = 1; else if (!found) HWMON_RESET(); if (!found) { obj_be_plain_text(obj, "fail"); return; } DBGP("parsed %s args: '%s' '%s' %d %f %f\n", type, buf1, buf2, n, factor, offset); sf = (struct sysfs *)malloc(sizeof(struct sysfs)); memset(sf, 0, sizeof(struct sysfs)); sf->fd = open_sysfs_sensor(path, (*buf1) ? buf1 : 0, buf2, n, &sf->arg, sf->devtype); strncpy(sf->type, buf2, 63); sf->factor = factor; sf->offset = offset; obj->data.opaque = sf; } #define PARSER_GENERATOR(name, path) \ void parse_##name##_sensor(struct text_object *obj, const char *arg) { \ parse_sysfs_sensor(obj, arg, path, #name); \ } PARSER_GENERATOR(i2c, "/sys/bus/i2c/devices/") PARSER_GENERATOR(hwmon, "/sys/class/hwmon/") PARSER_GENERATOR(platform, "/sys/bus/platform/devices/") void print_sysfs_sensor(struct text_object *obj, char *p, unsigned int p_max_size) { double r; struct sysfs *sf = (struct sysfs *)obj->data.opaque; if (!sf || sf->fd < 0) return; r = get_sysfs_info(&sf->fd, sf->arg, sf->devtype, sf->type); r = r * sf->factor + sf->offset; if (0 == (strcmp(temp2, "temp2"))) { temp_print(p, p_max_size, r, TEMP_CELSIUS, 0); } else if (!strncmp(sf->type, "temp", 4)) { temp_print(p, p_max_size, r, TEMP_CELSIUS, 1); } else if (r >= 100.0 || r == 0) { snprintf(p, p_max_size, "%d", (int)r); } else { snprintf(p, p_max_size, "%.1f", r); } } void free_sysfs_sensor(struct text_object *obj) { struct sysfs *sf = (struct sysfs *)obj->data.opaque; if (!sf) return; if (sf->fd >= 0) close(sf->fd); free_and_zero(obj->data.opaque); } #define CPUFREQ_PREFIX "/sys/devices/system/cpu" #define CPUFREQ_POSTFIX "cpufreq/scaling_cur_freq" /* return system frequency in MHz (use divisor=1) or GHz (use divisor=1000) */ char get_freq(char *p_client_buffer, size_t client_buffer_size, const char *p_format, int divisor, unsigned int cpu) { FILE *f; static int reported = 0; char frequency[32]; char s[256]; double freq = 0; if (!p_client_buffer || client_buffer_size <= 0 || !p_format || divisor <= 0) { return 0; } if (!prefer_proc) { char current_freq_file[128]; snprintf(current_freq_file, 127, "%s/cpu%d/%s", CPUFREQ_PREFIX, cpu - 1, CPUFREQ_POSTFIX); f = fopen(current_freq_file, "r"); if (f) { /* if there's a cpufreq /sys node, read the current frequency from * this node and divide by 1000 to get Mhz. */ if (fgets(s, sizeof(s), f)) { s[strlen(s) - 1] = '\0'; freq = strtod(s, nullptr); } fclose(f); snprintf(p_client_buffer, client_buffer_size, p_format, (freq / 1000) / divisor); return 1; } } // open the CPU information file f = open_file("/proc/cpuinfo", &reported); if (!f) { perror(PACKAGE_NAME ": Failed to access '/proc/cpuinfo' at get_freq()"); return 0; } // read the file while (fgets(s, sizeof(s), f) != nullptr) { #if defined(__i386) || defined(__x86_64) // and search for the cpu mhz if (strncmp(s, "cpu MHz", 7) == 0 && cpu == 0) { #else #if defined(__alpha) // different on alpha if (strncmp(s, "cycle frequency [Hz]", 20) == 0 && cpu == 0) { #else // this is different on ppc for some reason if (strncmp(s, "clock", 5) == 0 && cpu == 0) { #endif // defined(__alpha) #endif // defined(__i386) || defined(__x86_64) // copy just the number strncpy(frequency, strchr(s, ':') + 2, 32); #if defined(__alpha) // strip " est.\n" frequency[strlen(frequency) - 6] = '\0'; // kernel reports in Hz freq = strtod(frequency, nullptr) / 1000000; #else // strip \n frequency[strlen(frequency) - 1] = '\0'; freq = strtod(frequency, nullptr); #endif break; } if (strncmp(s, "processor", 9) == 0) { cpu--; continue; } } fclose(f); snprintf(p_client_buffer, client_buffer_size, p_format, (float)freq / divisor); return 1; } #define CPUFREQ_VOLTAGE "cpufreq/scaling_voltages" /* /sys/devices/system/cpu/cpu0/cpufreq/scaling_voltages looks something * like this: # frequency voltage 1800000 1340 1600000 1292 1400000 1100 1200000 988 1000000 1116 800000 1004 600000 988 * Peter Tarjan (ptarjan@citromail.hu) */ /* return cpu voltage in mV (use divisor=1) or V (use divisor=1000) */ static char get_voltage(char *p_client_buffer, size_t client_buffer_size, const char *p_format, int divisor, unsigned int cpu) { FILE *f; char s[256]; int freq = 0; int voltage = 0; char current_freq_file[128]; int freq_comp = 0; /* build the voltage file name */ cpu--; snprintf(current_freq_file, 127, "%s/cpu%d/%s", CPUFREQ_PREFIX, cpu, CPUFREQ_POSTFIX); if (!p_client_buffer || client_buffer_size <= 0 || !p_format || divisor <= 0) { return 0; } /* read the current cpu frequency from the /sys node */ f = fopen(current_freq_file, "r"); if (f) { if (fgets(s, sizeof(s), f)) { s[strlen(s) - 1] = '\0'; freq = strtod(s, nullptr); } fclose(f); } else { fprintf(stderr, PACKAGE_NAME ": Failed to access '%s' at ", current_freq_file); perror("get_voltage()"); return 0; } snprintf(current_freq_file, 127, "%s/cpu%d/%s", CPUFREQ_PREFIX, cpu, CPUFREQ_VOLTAGE); /* use the current cpu frequency to find the corresponding voltage */ f = fopen(current_freq_file, "r"); if (f) { while (!feof(f)) { char line[256]; if (fgets(line, 255, f) == nullptr) { break; } sscanf(line, "%d %d", &freq_comp, &voltage); if (freq_comp == freq) { break; } } fclose(f); } else { fprintf(stderr, PACKAGE_NAME ": Failed to access '%s' at ", current_freq_file); perror("get_voltage()"); return 0; } snprintf(p_client_buffer, client_buffer_size, p_format, (float)voltage / divisor); return 1; } void print_voltage_mv(struct text_object *obj, char *p, unsigned int p_max_size) { static int ok = 1; if (ok) { ok = get_voltage(p, p_max_size, "%.0f", 1, obj->data.i); } } void print_voltage_v(struct text_object *obj, char *p, unsigned int p_max_size) { static int ok = 1; if (ok) { ok = get_voltage(p, p_max_size, "%'.3f", 1000, obj->data.i); } } #define ACPI_FAN_DIR "/proc/acpi/fan/" void get_acpi_fan(char *p_client_buffer, size_t client_buffer_size) { static int reported = 0; char buf[256]; char buf2[256]; FILE *fp; if (!p_client_buffer || client_buffer_size <= 0) { return; } /* yeah, slow... :/ */ if (!get_first_file_in_a_directory(ACPI_FAN_DIR, buf, &reported)) { snprintf(p_client_buffer, client_buffer_size, "%s", "no fans?"); return; } snprintf(buf2, sizeof(buf2), "%s%s/state", ACPI_FAN_DIR, buf); fp = open_file(buf2, &reported); if (!fp) { snprintf(p_client_buffer, client_buffer_size, "%s", "can't open fan's state file"); return; } memset(buf, 0, sizeof(buf)); if (fscanf(fp, "%*s %99s", buf) <= 0) perror("fscanf()"); fclose(fp); snprintf(p_client_buffer, client_buffer_size, "%s", buf); } #define SYSFS_AC_ADAPTER_DIR "/sys/class/power_supply" #define ACPI_AC_ADAPTER_DIR "/proc/acpi/ac_adapter/" /* Linux 2.6.25 onwards ac adapter info is in /sys/class/power_supply/AC/ On my system I get the following. /sys/class/power_supply/AC/uevent: PHYSDEVPATH=/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:01/PNP0C09:00/ACPI0003:00 PHYSDEVBUS=acpi PHYSDEVDRIVER=ac POWER_SUPPLY_NAME=AC POWER_SUPPLY_TYPE=Mains POWER_SUPPLY_ONLINE=1 Update: it seems the folder name is hardware-dependent. We add an additional adapter argument, specifying the folder name. Update: on some systems it's /sys/class/power_supply/ADP1 instead of /sys/class/power_supply/AC */ void get_acpi_ac_adapter(char *p_client_buffer, size_t client_buffer_size, const char *adapter) { static int reported = 0; char buf[256]; char buf2[256]; struct stat sb; FILE *fp; if (!p_client_buffer || client_buffer_size <= 0) { return; } if (adapter) snprintf(buf2, sizeof(buf2), "%s/%s/uevent", SYSFS_AC_ADAPTER_DIR, adapter); else { snprintf(buf2, sizeof(buf2), "%s/AC/uevent", SYSFS_AC_ADAPTER_DIR); if (stat(buf2, &sb) == -1) snprintf(buf2, sizeof(buf2), "%s/ADP1/uevent", SYSFS_AC_ADAPTER_DIR); } if (stat(buf2, &sb) == 0) fp = open_file(buf2, &reported); else fp = 0; if (fp) { /* sysfs processing */ while (!feof(fp)) { if (fgets(buf, sizeof(buf), fp) == nullptr) break; if (strncmp(buf, "POWER_SUPPLY_ONLINE=", 20) == 0) { int online = 0; sscanf(buf, "POWER_SUPPLY_ONLINE=%d", &online); snprintf(p_client_buffer, client_buffer_size, "%s-line", (online ? "on" : "off")); break; } } fclose(fp); } else { /* yeah, slow... :/ */ if (!get_first_file_in_a_directory(ACPI_AC_ADAPTER_DIR, buf, &reported)) { snprintf(p_client_buffer, client_buffer_size, "%s", "no ac_adapters?"); return; } snprintf(buf2, sizeof(buf2), "%s%s/state", ACPI_AC_ADAPTER_DIR, buf); fp = open_file(buf2, &reported); if (!fp) { snprintf(p_client_buffer, client_buffer_size, "%s", "No ac adapter found.... where is it?"); return; } memset(buf, 0, sizeof(buf)); if (fscanf(fp, "%*s %99s", buf) <= 0) perror("fscanf()"); fclose(fp); snprintf(p_client_buffer, client_buffer_size, "%s", buf); } } /* /proc/acpi/thermal_zone/THRM/cooling_mode cooling mode: active /proc/acpi/thermal_zone/THRM/polling_frequency /proc/acpi/thermal_zone/THRM/state state: ok /proc/acpi/thermal_zone/THRM/temperature temperature: 45 C /proc/acpi/thermal_zone/THRM/trip_points critical (S5): 73 C passive: 73 C: tc1=4 tc2=3 tsp=40 devices=0xcdf6e6c0 */ #define ACPI_THERMAL_ZONE_DEFAULT "thermal_zone0" #define ACPI_THERMAL_FORMAT "/sys/class/thermal/%s/temp" int open_acpi_temperature(const char *name) { char path[256]; int fd; if (name == nullptr || strcmp(name, "*") == 0) { snprintf(path, 255, ACPI_THERMAL_FORMAT, ACPI_THERMAL_ZONE_DEFAULT); } else { snprintf(path, 255, ACPI_THERMAL_FORMAT, name); } fd = open(path, O_RDONLY); if (fd < 0) { NORM_ERR("can't open '%s': %s", path, strerror(errno)); } return fd; } static double last_acpi_temp; static double last_acpi_temp_time; // the maximum length of the string inside a ACPI_THERMAL_FORMAT file including // the ending 0 #define MAXTHERMZONELEN 6 double get_acpi_temperature(int fd) { if (fd <= 0) { return 0; } /* don't update acpi temperature too often */ if (current_update_time - last_acpi_temp_time < 11.32) { return last_acpi_temp; } last_acpi_temp_time = current_update_time; /* seek to beginning */ lseek(fd, 0, SEEK_SET); /* read */ { char buf[MAXTHERMZONELEN]; int n; n = read(fd, buf, MAXTHERMZONELEN - 1); if (n < 0) { NORM_ERR("can't read fd %d: %s", fd, strerror(errno)); } else { buf[n] = '\0'; sscanf(buf, "%lf", &last_acpi_temp); last_acpi_temp /= 1000; } } return last_acpi_temp; } /* hipo@lepakko hipo $ cat /proc/acpi/battery/BAT1/info present: yes design capacity: 4400 mAh last full capacity: 4064 mAh battery technology: rechargeable design voltage: 14800 mV design capacity warning: 300 mAh design capacity low: 200 mAh capacity granularity 1: 32 mAh capacity granularity 2: 32 mAh model number: 02KT serial number: 16922 battery type: LION OEM info: SANYO */ /* hipo@lepakko conky $ cat /proc/acpi/battery/BAT1/state present: yes capacity state: ok charging state: unknown present rate: 0 mA remaining capacity: 4064 mAh present voltage: 16608 mV */ /* 2213<@jupetkellari> jupet@lagi-unstable:~$ cat /proc/apm 2213<@jupetkellari> 1.16 1.2 0x03 0x01 0xff 0x10 -1% -1 ? 2213<@jupetkellari> (-1 ollee ei akkua kiinni, koska akku on pydll) 2214<@jupetkellari> jupet@lagi-unstable:~$ cat /proc/apm 2214<@jupetkellari> 1.16 1.2 0x03 0x01 0x03 0x09 98% -1 ? 2238<@jupetkellari> 1.16 1.2 0x03 0x00 0x00 0x01 100% -1 ? ilman verkkovirtaa 2239<@jupetkellari> 1.16 1.2 0x03 0x01 0x00 0x01 99% -1 ? verkkovirralla 2240<@jupetkellari> 1.16 1.2 0x03 0x01 0x03 0x09 100% -1 ? verkkovirralla ja monitori pll 2241<@jupetkellari> 1.16 1.2 0x03 0x00 0x00 0x01 99% -1 ? monitori pll mutta ilman verkkovirtaa */ /* Kapil Hari Paranjape Linux 2.6.24 onwards battery info is in /sys/class/power_supply/BAT0/ On my system I get the following. /sys/class/power_supply/BAT0/uevent: PHYSDEVPATH=/devices/LNXSYSTM:00/device:00/PNP0A03:00/device:01/PNP0C09:00/PNP0C0A:00 PHYSDEVBUS=acpi PHYSDEVDRIVER=battery POWER_SUPPLY_NAME=BAT0 POWER_SUPPLY_TYPE=Battery POWER_SUPPLY_STATUS=Discharging POWER_SUPPLY_PRESENT=1 POWER_SUPPLY_TECHNOLOGY=Li-ion POWER_SUPPLY_VOLTAGE_MIN_DESIGN=10800000 POWER_SUPPLY_VOLTAGE_NOW=10780000 POWER_SUPPLY_CURRENT_NOW=13970000 POWER_SUPPLY_ENERGY_FULL_DESIGN=47510000 POWER_SUPPLY_ENERGY_FULL=27370000 POWER_SUPPLY_ENERGY_NOW=11810000 POWER_SUPPLY_MODEL_NAME=IBM-92P1060 POWER_SUPPLY_MANUFACTURER=Panasonic On some systems POWER_SUPPLY_ENERGY_* is replaced by POWER_SUPPLY_CHARGE_* */ /* Tiago Marques Vale Regarding the comment above, since kernel 2.6.36.1 I have POWER_SUPPLY_POWER_NOW instead of POWER_SUPPLY_CURRENT_NOW See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532000 */ #define SYSFS_BATTERY_BASE_PATH "/sys/class/power_supply" #define ACPI_BATTERY_BASE_PATH "/proc/acpi/battery" #define APM_PATH "/proc/apm" #define MAX_BATTERY_COUNT 4 static FILE *sysfs_bat_fp[MAX_BATTERY_COUNT] = {nullptr, NULL, NULL, NULL}; static FILE *acpi_bat_fp[MAX_BATTERY_COUNT] = {nullptr, NULL, NULL, NULL}; static FILE *apm_bat_fp[MAX_BATTERY_COUNT] = {nullptr, NULL, NULL, NULL}; static int batteries_initialized = 0; static char batteries[MAX_BATTERY_COUNT][32]; static int acpi_last_full[MAX_BATTERY_COUNT]; static int acpi_design_capacity[MAX_BATTERY_COUNT]; /* e.g. "charging 75%" */ static char last_battery_str[MAX_BATTERY_COUNT][64]; /* e.g. "3h 15m" */ static char last_battery_time_str[MAX_BATTERY_COUNT][64]; static double last_battery_time[MAX_BATTERY_COUNT]; static int last_battery_perct[MAX_BATTERY_COUNT]; static double last_battery_perct_time[MAX_BATTERY_COUNT]; void init_batteries(void) { int idx; if (batteries_initialized) { return; } #ifdef HAVE_OPENMP #pragma omp parallel for schedule(dynamic, 10) #endif /* HAVE_OPENMP */ for (idx = 0; idx < MAX_BATTERY_COUNT; idx++) { batteries[idx][0] = '\0'; } batteries_initialized = 1; } int get_battery_idx(const char *bat) { int idx; for (idx = 0; idx < MAX_BATTERY_COUNT; idx++) { if (!strlen(batteries[idx]) || !strcmp(batteries[idx], bat)) { break; } } /* if not found, enter a new entry */ if (!strlen(batteries[idx])) { snprintf(batteries[idx], 31, "%s", bat); } return idx; } void set_return_value(char *buffer, unsigned int n, int item, int idx); void get_battery_stuff(char *buffer, unsigned int n, const char *bat, int item) { static int idx, rep = 0, rep1 = 0, rep2 = 0; char acpi_path[128]; char sysfs_path[128]; snprintf(acpi_path, 127, ACPI_BATTERY_BASE_PATH "/%s/state", bat); snprintf(sysfs_path, 127, SYSFS_BATTERY_BASE_PATH "/%s/uevent", bat); init_batteries(); idx = get_battery_idx(bat); /* don't update battery too often */ if (current_update_time - last_battery_time[idx] < 29.5) { set_return_value(buffer, n, item, idx); return; } last_battery_time[idx] = current_update_time; memset(last_battery_str[idx], 0, sizeof(last_battery_str[idx])); memset(last_battery_time_str[idx], 0, sizeof(last_battery_time_str[idx])); /* first try SYSFS if that fails try ACPI */ if (sysfs_bat_fp[idx] == nullptr && acpi_bat_fp[idx] == NULL && apm_bat_fp[idx] == nullptr) { sysfs_bat_fp[idx] = open_file(sysfs_path, &rep); } if (sysfs_bat_fp[idx] == nullptr && acpi_bat_fp[idx] == NULL && apm_bat_fp[idx] == nullptr) { acpi_bat_fp[idx] = open_file(acpi_path, &rep1); } if (sysfs_bat_fp[idx] != nullptr) { /* SYSFS */ int present_rate = -1; int remaining_capacity = -1; char charging_state[64]; char present[4]; strncpy(charging_state, "unknown", 64); while (!feof(sysfs_bat_fp[idx])) { char buf[256]; if (fgets(buf, 256, sysfs_bat_fp[idx]) == nullptr) break; /* let's just hope units are ok */ if (strncmp(buf, "POWER_SUPPLY_PRESENT=1", 22) == 0) strncpy(present, "yes", 4); else if (strncmp(buf, "POWER_SUPPLY_PRESENT=0", 22) == 0) strncpy(present, "no", 4); else if (strncmp(buf, "POWER_SUPPLY_STATUS=", 20) == 0) sscanf(buf, "POWER_SUPPLY_STATUS=%63s", charging_state); /* present_rate is not the same as the current flowing now but it * is the same value which was used in the past. so we continue the * tradition! */ else if (strncmp(buf, "POWER_SUPPLY_CURRENT_NOW=", 25) == 0) sscanf(buf, "POWER_SUPPLY_CURRENT_NOW=%d", &present_rate); else if (strncmp(buf, "POWER_SUPPLY_POWER_NOW=", 23) == 0) sscanf(buf, "POWER_SUPPLY_POWER_NOW=%d", &present_rate); else if (strncmp(buf, "POWER_SUPPLY_ENERGY_NOW=", 24) == 0) sscanf(buf, "POWER_SUPPLY_ENERGY_NOW=%d", &remaining_capacity); else if (strncmp(buf, "POWER_SUPPLY_ENERGY_FULL=", 25) == 0) sscanf(buf, "POWER_SUPPLY_ENERGY_FULL=%d", &acpi_last_full[idx]); else if (strncmp(buf, "POWER_SUPPLY_CHARGE_NOW=", 24) == 0) sscanf(buf, "POWER_SUPPLY_CHARGE_NOW=%d", &remaining_capacity); else if (strncmp(buf, "POWER_SUPPLY_CHARGE_FULL=", 25) == 0) sscanf(buf, "POWER_SUPPLY_CHARGE_FULL=%d", &acpi_last_full[idx]); } fclose(sysfs_bat_fp[idx]); sysfs_bat_fp[idx] = nullptr; /* Hellf[i]re notes that remaining capacity can exceed acpi_last_full */ if (remaining_capacity > acpi_last_full[idx]) acpi_last_full[idx] = remaining_capacity; /* normalize to 100% */ /* not present */ if (strcmp(present, "No") == 0) { strncpy(last_battery_str[idx], "not present", 64); } /* charging */ else if (strcmp(charging_state, "Charging") == 0) { if (acpi_last_full[idx] != 0 && present_rate > 0) { /* e.g. charging 75% */ snprintf( last_battery_str[idx], sizeof(last_battery_str[idx]) - 1, "charging %i%%", (int)(((float)remaining_capacity / acpi_last_full[idx]) * 100)); /* e.g. 2h 37m */ format_seconds( last_battery_time_str[idx], sizeof(last_battery_time_str[idx]) - 1, (long)(((float)(acpi_last_full[idx] - remaining_capacity) / present_rate) * 3600)); } else if (acpi_last_full[idx] != 0 && present_rate <= 0) { snprintf( last_battery_str[idx], sizeof(last_battery_str[idx]) - 1, "charging %d%%", (int)(((float)remaining_capacity / acpi_last_full[idx]) * 100)); snprintf(last_battery_time_str[idx], sizeof(last_battery_time_str[idx]) - 1, "%s", "unknown"); } else { strncpy(last_battery_str[idx], "charging", sizeof(last_battery_str[idx]) - 1); snprintf(last_battery_time_str[idx], sizeof(last_battery_time_str[idx]) - 1, "%s", "unknown"); } } /* discharging */ else if (strncmp(charging_state, "Discharging", 64) == 0) { if (present_rate > 0) { /* e.g. discharging 35% */ snprintf( last_battery_str[idx], sizeof(last_battery_str[idx]) - 1, "discharging %i%%", (int)(((float)remaining_capacity / acpi_last_full[idx]) * 100)); /* e.g. 1h 12m */ format_seconds( last_battery_time_str[idx], sizeof(last_battery_time_str[idx]) - 1, (long)(((float)remaining_capacity / present_rate) * 3600)); } else if (present_rate == 0) { /* Thanks to Nexox for this one */ snprintf(last_battery_str[idx], sizeof(last_battery_str[idx]) - 1, "full"); snprintf(last_battery_time_str[idx], sizeof(last_battery_time_str[idx]) - 1, "%s", "unknown"); } else { snprintf( last_battery_str[idx], sizeof(last_battery_str[idx]) - 1, "discharging %d%%", (int)(((float)remaining_capacity / acpi_last_full[idx]) * 100)); snprintf(last_battery_time_str[idx], sizeof(last_battery_time_str[idx]) - 1, "%s", "unknown"); } } /* charged */ /* thanks to Lukas Zapletal */ else if (strncmp(charging_state, "Charged", 64) == 0 || strncmp(charging_state, "Full", 64) == 0) { /* Below happens with the second battery on my X40, * when the second one is empty and the first one * being charged. */ if (remaining_capacity == 0) strncpy(last_battery_str[idx], "empty", 64); else strncpy(last_battery_str[idx], "charged", 64); } /* unknown, probably full / AC */ else { if (acpi_last_full[idx] != 0 && remaining_capacity != acpi_last_full[idx]) snprintf( last_battery_str[idx], 64, "unknown %d%%", (int)(((float)remaining_capacity / acpi_last_full[idx]) * 100)); else strncpy(last_battery_str[idx], "not present", 64); } } else if (acpi_bat_fp[idx] != nullptr) { /* ACPI */ int present_rate = -1; int remaining_capacity = -1; char charging_state[64]; char present[5]; /* read last full capacity if it's zero */ if (acpi_last_full[idx] == 0) { static int rep3 = 0; char path[128]; FILE *fp; snprintf(path, 127, ACPI_BATTERY_BASE_PATH "/%s/info", bat); fp = open_file(path, &rep3); if (fp != nullptr) { while (!feof(fp)) { char b[256]; if (fgets(b, 256, fp) == nullptr) { break; } if (sscanf(b, "last full capacity: %d", &acpi_last_full[idx]) != 0) { break; } } fclose(fp); } } fseek(acpi_bat_fp[idx], 0, SEEK_SET); strncpy(charging_state, "unknown", 8); while (!feof(acpi_bat_fp[idx])) { char buf[256]; if (fgets(buf, 256, acpi_bat_fp[idx]) == nullptr) { break; } /* let's just hope units are ok */ if (strncmp(buf, "present:", 8) == 0) { sscanf(buf, "present: %4s", present); } else if (strncmp(buf, "charging state:", 15) == 0) { sscanf(buf, "charging state: %63s", charging_state); } else if (strncmp(buf, "present rate:", 13) == 0) { sscanf(buf, "present rate: %d", &present_rate); } else if (strncmp(buf, "remaining capacity:", 19) == 0) { sscanf(buf, "remaining capacity: %d", &remaining_capacity); } } /* Hellf[i]re notes that remaining capacity can exceed acpi_last_full */ if (remaining_capacity > acpi_last_full[idx]) { /* normalize to 100% */ acpi_last_full[idx] = remaining_capacity; } /* not present */ if (strcmp(present, "no") == 0) { strncpy(last_battery_str[idx], "not present", 64); /* charging */ } else if (strcmp(charging_state, "charging") == 0) { if (acpi_last_full[idx] != 0 && present_rate > 0) { /* e.g. charging 75% */ snprintf(last_battery_str[idx], sizeof(last_battery_str[idx]) - 1, "charging %i%%", (int)((remaining_capacity * 100) / acpi_last_full[idx])); /* e.g. 2h 37m */ format_seconds( last_battery_time_str[idx], sizeof(last_battery_time_str[idx]) - 1, (long)(((acpi_last_full[idx] - remaining_capacity) * 3600) / present_rate)); } else if (acpi_last_full[idx] != 0 && present_rate <= 0) { snprintf(last_battery_str[idx], sizeof(last_battery_str[idx]) - 1, "charging %d%%", (int)((remaining_capacity * 100) / acpi_last_full[idx])); snprintf(last_battery_time_str[idx], sizeof(last_battery_time_str[idx]) - 1, "%s", "unknown"); } else { strncpy(last_battery_str[idx], "charging", sizeof(last_battery_str[idx]) - 1); snprintf(last_battery_time_str[idx], sizeof(last_battery_time_str[idx]) - 1, "%s", "unknown"); } /* discharging */ } else if (strncmp(charging_state, "discharging", 64) == 0) { if (present_rate > 0) { /* e.g. discharging 35% */ snprintf(last_battery_str[idx], sizeof(last_battery_str[idx]) - 1, "discharging %i%%", (int)((remaining_capacity * 100) / acpi_last_full[idx])); /* e.g. 1h 12m */ format_seconds(last_battery_time_str[idx], sizeof(last_battery_time_str[idx]) - 1, (long)((remaining_capacity * 3600) / present_rate)); } else if (present_rate == 0) { /* Thanks to Nexox for this one */ snprintf(last_battery_str[idx], sizeof(last_battery_str[idx]) - 1, "charged"); snprintf(last_battery_time_str[idx], sizeof(last_battery_time_str[idx]) - 1, "%s", "unknown"); } else { snprintf(last_battery_str[idx], sizeof(last_battery_str[idx]) - 1, "discharging %d%%", (int)((remaining_capacity * 100) / acpi_last_full[idx])); snprintf(last_battery_time_str[idx], sizeof(last_battery_time_str[idx]) - 1, "%s", "unknown"); } /* charged */ } else if (strncmp(charging_state, "charged", 64) == 0) { /* thanks to Lukas Zapletal */ /* Below happens with the second battery on my X40, * when the second one is empty and the first one being charged. */ if (remaining_capacity == 0) { strncpy(last_battery_str[idx], "empty", 6); } else { strncpy(last_battery_str[idx], "charged", 8); } /* unknown, probably full / AC */ } else { if (strncmp(charging_state, "Full", 64) == 0) { strncpy(last_battery_str[idx], "charged", 64); } else if (acpi_last_full[idx] != 0 && remaining_capacity != acpi_last_full[idx]) { snprintf(last_battery_str[idx], 64, "unknown %d%%", (int)((remaining_capacity * 100) / acpi_last_full[idx])); } else { strncpy(last_battery_str[idx], "not present", 64); } } fclose(acpi_bat_fp[idx]); acpi_bat_fp[idx] = nullptr; } else { /* APM */ if (apm_bat_fp[idx] == nullptr) { apm_bat_fp[idx] = open_file(APM_PATH, &rep2); } if (apm_bat_fp[idx] != nullptr) { unsigned int ac, status, flag; int life; if (fscanf(apm_bat_fp[idx], "%*s %*s %*x %x %x %x %d%%", &ac, &status, &flag, &life) <= 0) goto read_bat_fp_end; if (life == -1) { /* could check now that there is ac */ snprintf(last_battery_str[idx], 64, "%s", "not present"); /* could check that status == 3 here? */ } else if (ac && life != 100) { snprintf(last_battery_str[idx], 64, "charging %d%%", life); } else { snprintf(last_battery_str[idx], 64, "%d%%", life); } read_bat_fp_end: /* it seemed to buffer it so file must be closed (or could use * syscalls directly but I don't feel like coding it now) */ fclose(apm_bat_fp[idx]); apm_bat_fp[idx] = nullptr; } } set_return_value(buffer, n, item, idx); } void set_return_value(char *buffer, unsigned int n, int item, int idx) { switch (item) { case BATTERY_STATUS: snprintf(buffer, n, "%s", last_battery_str[idx]); break; case BATTERY_TIME: snprintf(buffer, n, "%s", last_battery_time_str[idx]); break; default: break; } } void get_battery_short_status(char *buffer, unsigned int n, const char *bat) { get_battery_stuff(buffer, n, bat, BATTERY_STATUS); if (0 == strncmp("charging", buffer, 8)) { buffer[0] = 'C'; memmove(buffer + 1, buffer + 8, n - 8); } else if (0 == strncmp("discharging", buffer, 11)) { buffer[0] = 'D'; memmove(buffer + 1, buffer + 11, n - 11); } else if (0 == strncmp("charged", buffer, 7)) { buffer[0] = 'F'; memmove(buffer + 1, buffer + 7, n - 7); } else if (0 == strncmp("not present", buffer, 11)) { buffer[0] = 'N'; memmove(buffer + 1, buffer + 11, n - 11); } else if (0 == strncmp("empty", buffer, 5)) { buffer[0] = 'E'; memmove(buffer + 1, buffer + 5, n - 5); } else if (0 == strncmp("unknown", buffer, 7)) { buffer[0] = 'U'; memmove(buffer + 1, buffer + 7, n - 7); } // Otherwise, don't shorten. } int _get_battery_perct(const char *bat) { static int reported = 0; int idx; char acpi_path[128]; char sysfs_path[128]; int remaining_capacity = -1; snprintf(acpi_path, 127, ACPI_BATTERY_BASE_PATH "/%s/state", bat); snprintf(sysfs_path, 127, SYSFS_BATTERY_BASE_PATH "/%s/uevent", bat); idx = get_battery_idx(bat); /* don't update battery too often */ if (current_update_time - last_battery_perct_time[idx] < 30) { return last_battery_perct[idx]; } last_battery_perct_time[idx] = current_update_time; /* Only check for SYSFS or ACPI */ if (sysfs_bat_fp[idx] == nullptr && acpi_bat_fp[idx] == NULL && apm_bat_fp[idx] == nullptr) { sysfs_bat_fp[idx] = open_file(sysfs_path, &reported); reported = 0; } if (sysfs_bat_fp[idx] == nullptr && acpi_bat_fp[idx] == NULL && apm_bat_fp[idx] == nullptr) { acpi_bat_fp[idx] = open_file(acpi_path, &reported); } if (sysfs_bat_fp[idx] != nullptr) { /* SYSFS */ while (!feof(sysfs_bat_fp[idx])) { char buf[256]; if (fgets(buf, 256, sysfs_bat_fp[idx]) == nullptr) break; if (strncmp(buf, "POWER_SUPPLY_CHARGE_NOW=", 24) == 0) { sscanf(buf, "POWER_SUPPLY_CHARGE_NOW=%d", &remaining_capacity); } else if (strncmp(buf, "POWER_SUPPLY_CHARGE_FULL=", 25) == 0) { sscanf(buf, "POWER_SUPPLY_CHARGE_FULL=%d", &acpi_design_capacity[idx]); } else if (strncmp(buf, "POWER_SUPPLY_ENERGY_NOW=", 24) == 0) { sscanf(buf, "POWER_SUPPLY_ENERGY_NOW=%d", &remaining_capacity); } else if (strncmp(buf, "POWER_SUPPLY_ENERGY_FULL=", 25) == 0) { sscanf(buf, "POWER_SUPPLY_ENERGY_FULL=%d", &acpi_design_capacity[idx]); } } fclose(sysfs_bat_fp[idx]); sysfs_bat_fp[idx] = nullptr; } else if (acpi_bat_fp[idx] != nullptr) { /* ACPI */ /* read last full capacity if it's zero */ if (acpi_design_capacity[idx] == 0) { static int rep2; char path[128]; FILE *fp; snprintf(path, 127, ACPI_BATTERY_BASE_PATH "/%s/info", bat); fp = open_file(path, &rep2); if (fp != nullptr) { while (!feof(fp)) { char b[256]; if (fgets(b, 256, fp) == nullptr) { break; } if (sscanf(b, "last full capacity: %d", &acpi_design_capacity[idx]) != 0) { break; } } fclose(fp); } } fseek(acpi_bat_fp[idx], 0, SEEK_SET); while (!feof(acpi_bat_fp[idx])) { char buf[256]; if (fgets(buf, 256, acpi_bat_fp[idx]) == nullptr) { break; } if (buf[0] == 'r') { sscanf(buf, "remaining capacity: %d", &remaining_capacity); } } } if (remaining_capacity < 0) { return 0; } /* compute the battery percentage */ last_battery_perct[idx] = (int)(((float)remaining_capacity / acpi_design_capacity[idx]) * 100); if (last_battery_perct[idx] > 100) last_battery_perct[idx] = 100; return last_battery_perct[idx]; } int get_battery_perct(const char *bat) { int idx, n = 0, total_capacity = 0, remaining_capacity; ; #define BATTERY_LEN 8 char battery[BATTERY_LEN]; init_batteries(); /* Check if user asked for the mean percentage of all batteries. */ if (!strcmp(bat, "all")) { for (idx = 0; idx < MAX_BATTERY_COUNT; idx++) { snprintf(battery, BATTERY_LEN - 1, "BAT%d", idx); #undef BATTERY_LEN remaining_capacity = _get_battery_perct(battery); if (remaining_capacity > 0) { total_capacity += remaining_capacity; n++; } } if (n == 0) return 0; else return total_capacity / n; } else { return _get_battery_perct(bat); } } double get_battery_perct_bar(struct text_object *obj) { int idx; get_battery_perct(obj->data.s); idx = get_battery_idx(obj->data.s); return last_battery_perct[idx]; } /* On Apple powerbook and ibook: $ cat /proc/pmu/battery_0 flags : 00000013 charge : 3623 max_charge : 3720 current : 388 voltage : 16787 time rem. : 900 $ cat /proc/pmu/info PMU driver version : 2 PMU firmware version : 0c AC Power : 1 Battery count : 1 */ /* defines as in */ #define PMU_BATT_PRESENT 0x00000001 #define PMU_BATT_CHARGING 0x00000002 static FILE *pmu_battery_fp; static FILE *pmu_info_fp; static char pb_battery_info[3][32]; static double pb_battery_info_update; void powerbook_update_status(unsigned int flags, int ac); void powerbook_update_percentage(long timeval, unsigned int flags, int ac, int charge, int max_charge); void powerbook_update_time(long timeval); #define PMU_PATH "/proc/pmu" void get_powerbook_batt_info(struct text_object *obj, char *buffer, unsigned int n) { static int reported = 0; const char *batt_path = PMU_PATH "/battery_0"; const char *info_path = PMU_PATH "/info"; unsigned int flags = 0; int charge = 0; int max_charge = 1; int ac = -1; long timeval = -1; /* don't update battery too often */ if (current_update_time - pb_battery_info_update < 29.5) { snprintf(buffer, n, "%s", pb_battery_info[obj->data.i]); return; } pb_battery_info_update = current_update_time; if (pmu_battery_fp == nullptr) { pmu_battery_fp = open_file(batt_path, &reported); if (pmu_battery_fp == nullptr) { return; } } rewind(pmu_battery_fp); while (!feof(pmu_battery_fp)) { char buf[32]; if (fgets(buf, sizeof(buf), pmu_battery_fp) == nullptr) { break; } if (buf[0] == 'f') { sscanf(buf, "flags : %8x", &flags); } else if (buf[0] == 'c' && buf[1] == 'h') { sscanf(buf, "charge : %d", &charge); } else if (buf[0] == 'm') { sscanf(buf, "max_charge : %d", &max_charge); } else if (buf[0] == 't') { sscanf(buf, "time rem. : %ld", &timeval); } } pmu_info_fp = open_file(info_path, &reported); if (pmu_info_fp == nullptr) { return; } rewind(pmu_info_fp); while (!feof(pmu_info_fp)) { char buf[32]; if (fgets(buf, sizeof(buf), pmu_info_fp) == nullptr) { break; } if (buf[0] == 'A') { sscanf(buf, "AC Power : %d", &ac); } } powerbook_update_status(flags, ac); powerbook_update_percentage(timeval, flags, ac, charge, max_charge); powerbook_update_time(timeval); snprintf(buffer, n, "%s", pb_battery_info[obj->data.i]); } void powerbook_update_status(unsigned int flags, int ac) { /* update status string */ if ((ac && !(flags & PMU_BATT_PRESENT))) { strncpy(pb_battery_info[PB_BATT_STATUS], "AC", sizeof(pb_battery_info[PB_BATT_STATUS])); } else if (ac && (flags & PMU_BATT_PRESENT) && !(flags & PMU_BATT_CHARGING)) { strncpy(pb_battery_info[PB_BATT_STATUS], "charged", sizeof(pb_battery_info[PB_BATT_STATUS])); } else if ((flags & PMU_BATT_PRESENT) && (flags & PMU_BATT_CHARGING)) { strncpy(pb_battery_info[PB_BATT_STATUS], "charging", sizeof(pb_battery_info[PB_BATT_STATUS])); } else { strncpy(pb_battery_info[PB_BATT_STATUS], "discharging", sizeof(pb_battery_info[PB_BATT_STATUS])); } } void powerbook_update_percentage(long timeval, unsigned int flags, int ac, int charge, int max_charge) { /* update percentage string */ if (timeval == 0 && ac && (flags & PMU_BATT_PRESENT) && !(flags & PMU_BATT_CHARGING)) { snprintf(pb_battery_info[PB_BATT_PERCENT], sizeof(pb_battery_info[PB_BATT_PERCENT]), "%s", "100%%"); } else if (timeval == 0) { snprintf(pb_battery_info[PB_BATT_PERCENT], sizeof(pb_battery_info[PB_BATT_PERCENT]), "%s", "unknown"); } else { snprintf(pb_battery_info[PB_BATT_PERCENT], sizeof(pb_battery_info[PB_BATT_PERCENT]), "%d%%", (charge * 100) / max_charge); } } void powerbook_update_time(long timeval) { /* update time string */ if (timeval == 0) { /* fully charged or battery not present */ snprintf(pb_battery_info[PB_BATT_TIME], sizeof(pb_battery_info[PB_BATT_TIME]), "%s", "unknown"); } else if (timeval < 60 * 60) { /* don't show secs */ format_seconds_short(pb_battery_info[PB_BATT_TIME], sizeof(pb_battery_info[PB_BATT_TIME]), timeval); } else { format_seconds(pb_battery_info[PB_BATT_TIME], sizeof(pb_battery_info[PB_BATT_TIME]), timeval); } } #define ENTROPY_AVAIL_PATH "/proc/sys/kernel/random/entropy_avail" int get_entropy_avail(unsigned int *val) { static int reported = 0; FILE *fp; if (!(fp = open_file(ENTROPY_AVAIL_PATH, &reported))) return 1; if (fscanf(fp, "%u", val) != 1) return 1; fclose(fp); return 0; } #define ENTROPY_POOLSIZE_PATH "/proc/sys/kernel/random/poolsize" int get_entropy_poolsize(unsigned int *val) { static int reported = 0; FILE *fp; if (!(fp = open_file(ENTROPY_POOLSIZE_PATH, &reported))) return 1; if (fscanf(fp, "%u", val) != 1) return 1; fclose(fp); return 0; } void print_disk_protect_queue(struct text_object *obj, char *p, unsigned int p_max_size) { FILE *fp; char path[128]; int state; snprintf(path, 127, "/sys/block/%s/device/unload_heads", obj->data.s); if (access(path, F_OK)) { snprintf(path, 127, "/sys/block/%s/queue/protect", obj->data.s); } if ((fp = fopen(path, "r")) == nullptr) { snprintf(p, p_max_size, "%s", "n/a "); return; } if (fscanf(fp, "%d\n", &state) != 1) { fclose(fp); snprintf(p, p_max_size, "%s", "failed"); return; } fclose(fp); snprintf(p, p_max_size, "%s", (state > 0) ? "frozen" : "free "); } std::unordered_map dev_list; /* Same as sf #2942117 but memoized using a linked list */ int is_disk(char *dev) { std::string orig(dev); std::string syspath("/sys/block/"); char *slash; auto i = dev_list.find(orig); if (i != dev_list.end()) return i->second; while ((slash = strchr(dev, '/'))) *slash = '!'; syspath += dev; return dev_list[orig] = !(access(syspath.c_str(), F_OK)); } int update_diskio(void) { FILE *fp; static int reported = 0; char buf[512], devbuf[64]; unsigned int major, minor; int col_count = 0; struct diskio_stat *cur; unsigned int reads, writes; unsigned int total_reads = 0, total_writes = 0; stats.current = 0; stats.current_read = 0; stats.current_write = 0; if (!(fp = open_file("/proc/diskstats", &reported))) { return 0; } /* read reads and writes from all disks (minor = 0), including cd-roms * and floppies, and sum them up */ while (fgets(buf, 512, fp)) { col_count = sscanf(buf, "%u %u %s %*u %*u %u %*u %*u %*u %u", &major, &minor, devbuf, &reads, &writes); /* ignore subdevices (they have only 3 matching entries in their line) * and virtual devices (LVM, network block devices, RAM disks, Loopback) * * XXX: ignore devices which are part of a SW RAID (MD_MAJOR) */ if (col_count == 5 && major != LVM_BLK_MAJOR && major != NBD_MAJOR && major != RAMDISK_MAJOR && major != LOOP_MAJOR && major != DM_MAJOR) { /* check needed for kernel >= 2.6.31, see sf #2942117 */ if (is_disk(devbuf)) { total_reads += reads; total_writes += writes; } } else { col_count = sscanf(buf, "%u %u %s %*u %u %*u %u", &major, &minor, devbuf, &reads, &writes); if (col_count != 5) { continue; } } cur = stats.next; while (cur && strcmp(devbuf, cur->dev)) cur = cur->next; if (cur) update_diskio_values(cur, reads, writes); } update_diskio_values(&stats, total_reads, total_writes); fclose(fp); return 0; } void print_distribution(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; int i, bytes_read; char *buf; struct stat sb; if (stat("/etc/arch-release", &sb) == 0) { snprintf(p, p_max_size, "%s", "Arch Linux"); return; } snprintf(p, p_max_size, "Unknown"); buf = readfile("/proc/version", &bytes_read, 1); if (buf) { /* I am assuming the distribution name is the first string in /proc/version that: - is preceded by a '(' - starts with a capital - is followed by a space and a number but i am not sure if this is always true... */ for (i = 1; i < bytes_read; i++) { if (buf[i - 1] == '(' && buf[i] >= 'A' && buf[i] <= 'Z') break; } if (i < bytes_read) { snprintf(p, p_max_size, "%s", &buf[i]); for (i = 1; p[i]; i++) { if (p[i - 1] == ' ' && p[i] >= '0' && p[i] <= '9') { p[i - 1] = 0; break; } } } free(buf); } } /****************************************** * Calculate cpu total * ******************************************/ #define TMPL_SHORTPROC "%*s %llu %llu %llu %llu" #define TMPL_LONGPROC "%*s %llu %llu %llu %llu %llu %llu %llu %llu" static unsigned long long calc_cpu_total(void) { static unsigned long long previous_total = 0; unsigned long long total = 0; unsigned long long t = 0; int rc; int ps; char line[BUFFER_LEN] = {0}; unsigned long long cpu = 0; unsigned long long niceval = 0; unsigned long long systemval = 0; unsigned long long idle = 0; unsigned long long iowait = 0; unsigned long long irq = 0; unsigned long long softirq = 0; unsigned long long steal = 0; const char *template_ = KFLAG_ISSET(KFLAG_IS_LONGSTAT) ? TMPL_LONGPROC : TMPL_SHORTPROC; ps = open("/proc/stat", O_RDONLY); rc = read(ps, line, BUFFER_LEN - 1); close(ps); if (rc < 0) { return 0; } sscanf(line, template_, &cpu, &niceval, &systemval, &idle, &iowait, &irq, &softirq, &steal); total = cpu + niceval + systemval + idle + iowait + irq + softirq + steal; t = total - previous_total; previous_total = total; return t; } /****************************************** * Calculate each processes cpu * ******************************************/ inline static void calc_cpu_each(unsigned long long total) { float mul = 100.0; if (top_cpu_separate.get(*state)) mul *= info.cpu_count; for (struct process *p = first_process; p; p = p->next) p->amount = mul * (p->user_time + p->kernel_time) / (float)total; } #ifdef BUILD_IOSTATS static void calc_io_each(void) { struct process *p; unsigned long long sum = 0; for (p = first_process; p; p = p->next) sum += p->read_bytes + p->write_bytes; if (sum == 0) sum = 1; /* to avoid having NANs if no I/O occurred */ for (p = first_process; p; p = p->next) p->io_perc = 100.0 * (p->read_bytes + p->write_bytes) / (float)sum; } #endif /* BUILD_IOSTATS */ /****************************************** * Extract information from /proc * ******************************************/ #define PROCFS_TEMPLATE "/proc/%d/stat" #define PROCFS_CMDLINE_TEMPLATE "/proc/%d/cmdline" /* These are the guts that extract information out of /proc. * Anyone hoping to port wmtop should look here first. */ static void process_parse_stat(struct process *process) { char line[BUFFER_LEN] = {0}, filename[BUFFER_LEN], procname[BUFFER_LEN]; char cmdline[BUFFER_LEN] = {0}, cmdline_filename[BUFFER_LEN], cmdline_procname[BUFFER_LEN]; char basename[BUFFER_LEN] = {0}; char tmpstr[BUFFER_LEN] = {0}; char state[4]; int ps, cmdline_ps; unsigned long user_time = 0; unsigned long kernel_time = 0; int rc; int endl; int nice_val; char *lparen, *rparen; struct stat process_stat; snprintf(filename, sizeof(filename), PROCFS_TEMPLATE, process->pid); snprintf(cmdline_filename, sizeof(cmdline_filename), PROCFS_CMDLINE_TEMPLATE, process->pid); ps = open(filename, O_RDONLY); if (ps == -1) { /* The process must have finished in the last few jiffies! */ return; } if (fstat(ps, &process_stat) != 0) { close(ps); return; } process->uid = process_stat.st_uid; /* Mark process as up-to-date. */ process->time_stamp = g_time; rc = read(ps, line, BUFFER_LEN - 1); close(ps); if (rc < 0) { return; } /* Read /proc//cmdline */ cmdline_ps = open(cmdline_filename, O_RDONLY); if (cmdline_ps < 0) { /* The process must have finished in the last few jiffies! */ return; } endl = read(cmdline_ps, cmdline, BUFFER_LEN - 1); close(cmdline_ps); if (endl < 0) { return; } /* Some processes have null-separated arguments (see proc(5)); let's fix it */ int i = endl; while (i && cmdline[i - 1] == 0) { /* Skip past any trailing null characters */ --i; } while (i--) { /* Replace null character between arguments with a space */ if (cmdline[i] == 0) { cmdline[i] = ' '; } } cmdline[endl] = 0; /* We want to transform for example "/usr/bin/python program.py" to "python * program.py" * 1. search for first space * 2. search for last / before first space * 3. copy string from its position */ char *space_ptr = strchr(cmdline, ' '); if (space_ptr == nullptr) { strncpy(tmpstr, cmdline, BUFFER_LEN); } else { long int space_pos = space_ptr - cmdline; strncpy(tmpstr, cmdline, space_pos); tmpstr[space_pos] = 0; } char *slash_ptr = strrchr(tmpstr, '/'); if (slash_ptr == nullptr) { strncpy(cmdline_procname, cmdline, BUFFER_LEN); } else { long int slash_pos = slash_ptr - tmpstr; strncpy(cmdline_procname, cmdline + slash_pos + 1, BUFFER_LEN - slash_pos); cmdline_procname[BUFFER_LEN - slash_pos] = 0; } /* Extract cpu times from data in /proc filesystem */ lparen = strchr(line, '('); rparen = strrchr(line, ')'); if (!lparen || !rparen || rparen < lparen) return; // this should not happen rc = MIN((unsigned)(rparen - lparen - 1), sizeof(procname) - 1); strncpy(procname, lparen + 1, rc); procname[rc] = '\0'; strncpy(basename, procname, strlen(procname) + 1); if (strlen(procname) < strlen(cmdline_procname)) strncpy(procname, cmdline_procname, strlen(cmdline_procname) + 1); rc = sscanf(rparen + 1, "%3s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %lu " "%lu %*s %*s %*s %d %*s %*s %*s %llu %llu", state, &process->user_time, &process->kernel_time, &nice_val, &process->vsize, &process->rss); if (rc < 6) { NORM_ERR("scanning data for %s failed, got only %d fields", procname, rc); return; } if (state[0] == 'R') ++info.run_procs; free_and_zero(process->name); free_and_zero(process->basename); process->name = strndup(procname, text_buffer_size.get(*::state)); process->basename = strndup(basename, text_buffer_size.get(*::state)); process->rss *= getpagesize(); process->total_cpu_time = process->user_time + process->kernel_time; if (process->previous_user_time == ULONG_MAX) { process->previous_user_time = process->user_time; } if (process->previous_kernel_time == ULONG_MAX) { process->previous_kernel_time = process->kernel_time; } /* strangely, the values aren't monotonous */ if (process->previous_user_time > process->user_time) process->previous_user_time = process->user_time; if (process->previous_kernel_time > process->kernel_time) process->previous_kernel_time = process->kernel_time; /* store the difference of the user_time */ user_time = process->user_time - process->previous_user_time; kernel_time = process->kernel_time - process->previous_kernel_time; /* backup the process->user_time for next time around */ process->previous_user_time = process->user_time; process->previous_kernel_time = process->kernel_time; /* store only the difference of the user_time here... */ process->user_time = user_time; process->kernel_time = kernel_time; } #ifdef BUILD_IOSTATS #define PROCFS_TEMPLATE_IO "/proc/%d/io" static void process_parse_io(struct process *process) { static const char *read_bytes_str = "read_bytes:"; static const char *write_bytes_str = "write_bytes:"; char line[BUFFER_LEN] = {0}, filename[BUFFER_LEN]; int ps; int rc; char *pos, *endpos; unsigned long long read_bytes, write_bytes; snprintf(filename, sizeof(filename), PROCFS_TEMPLATE_IO, process->pid); ps = open(filename, O_RDONLY); if (ps < 0) { /* The process must have finished in the last few jiffies! * Or, the kernel doesn't support I/O accounting. */ return; } rc = read(ps, line, BUFFER_LEN - 1); close(ps); if (rc < 0) { return; } pos = strstr(line, read_bytes_str); if (pos == nullptr) { /* these should not happen (unless the format of the file changes) */ return; } pos += strlen(read_bytes_str); process->read_bytes = strtoull(pos, &endpos, 10); if (endpos == pos) { return; } pos = strstr(line, write_bytes_str); if (pos == nullptr) { return; } pos += strlen(write_bytes_str); process->write_bytes = strtoull(pos, &endpos, 10); if (endpos == pos) { return; } if (process->previous_read_bytes == ULLONG_MAX) { process->previous_read_bytes = process->read_bytes; } if (process->previous_write_bytes == ULLONG_MAX) { process->previous_write_bytes = process->write_bytes; } /* store the difference of the byte counts */ read_bytes = process->read_bytes - process->previous_read_bytes; write_bytes = process->write_bytes - process->previous_write_bytes; /* backup the counts for next time around */ process->previous_read_bytes = process->read_bytes; process->previous_write_bytes = process->write_bytes; /* store only the difference here... */ process->read_bytes = read_bytes; process->write_bytes = write_bytes; } #endif /* BUILD_IOSTATS */ /****************************************** * Get process structure for process pid * ******************************************/ /* This function seems to hog all of the CPU time. * I can't figure out why - it doesn't do much. */ static void calculate_stats(struct process *process) { /* compute each process cpu usage by reading /proc//stat */ process_parse_stat(process); #ifdef BUILD_IOSTATS process_parse_io(process); #endif /* BUILD_IOSTATS */ /* * Check name against the exclusion list */ /* if (process->counted && exclusion_expression && * !regexec(exclusion_expression, process->name, 0, 0, 0)) * process->counted = 0; */ } /****************************************** * Update process table * ******************************************/ static void update_process_table(void) { DIR *dir; struct dirent *entry; if (!(dir = opendir("/proc"))) { return; } info.run_procs = 0; /* Get list of processes from /proc directory */ while ((entry = readdir(dir))) { pid_t pid; if (sscanf(entry->d_name, "%d", &pid) > 0) { /* compute each process cpu usage */ calculate_stats(get_process(pid)); } } closedir(dir); } void get_top_info(void) { unsigned long long total = 0; total = calc_cpu_total(); /* calculate the total of the processor */ update_process_table(); /* update the table with process list */ calc_cpu_each(total); /* and then the percentage for each task */ #ifdef BUILD_IOSTATS calc_io_each(); /* percentage of I/O for each task */ #endif /* BUILD_IOSTATS */ } conky-1.12.2/src/linux.h000066400000000000000000000043741404127277500150400ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _LINUX_H #define _LINUX_H #include "common.h" void print_disk_protect_queue(struct text_object *, char *, unsigned int); void print_ioscheduler(struct text_object *, char *, unsigned int); void print_laptop_mode(struct text_object *, char *, unsigned int); int update_gateway_info(void); int update_gateway_info2(void); void free_gateway_info(struct text_object *obj); int gateway_exists(struct text_object *); void print_gateway_iface(struct text_object *, char *, unsigned int); void print_gateway_iface2(struct text_object *, char *, unsigned int); void print_gateway_ip(struct text_object *, char *, unsigned int); void print_battery_status(struct text_object *, char *, unsigned int); enum { PB_BATT_STATUS, PB_BATT_PERCENT, PB_BATT_TIME }; void get_powerbook_batt_info(struct text_object *, char *, unsigned int); void parse_i2c_sensor(struct text_object *, const char *); void parse_hwmon_sensor(struct text_object *, const char *); void parse_platform_sensor(struct text_object *, const char *); void print_sysfs_sensor(struct text_object *, char *, unsigned int); void free_sysfs_sensor(struct text_object *); int get_entropy_avail(unsigned int *); int get_entropy_poolsize(unsigned int *); int update_stat(void); void print_distribution(struct text_object *, char *, unsigned int); void determine_longstat_file(void); extern char e_iface[50]; extern char interfaces_arr[MAX_NET_INTERFACES][64]; #endif /* _LINUX_H */ conky-1.12.2/src/llua.cc000066400000000000000000000375171404127277500150010ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Copyright (c) 2009 Toni Spets * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "llua.h" #include #include "build.h" #include "conky.h" #include "logging.h" extern "C" { #include } #ifdef HAVE_SYS_INOTIFY_H #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wc99-extensions" #include #pragma clang diagnostic pop void llua_append_notify(const char *name); void llua_rm_notifies(void); static int llua_block_notify = 0; #endif /* HAVE_SYS_INOTIFY_H */ static void llua_load(const char *script); lua_State *lua_L = nullptr; namespace { class lua_load_setting : public conky::simple_config_setting { using Base = conky::simple_config_setting; protected: void lua_setter(lua::state &l, bool init) override { lua::stack_sentry s(l, -2); Base::lua_setter(l, init); if (init) { std::string files = do_convert(l, -1).first; while (!files.empty()) { std::string::size_type pos = files.find(' '); if (pos > 0) { std::string file(files, 0, pos); llua_load(file.c_str()); } files.erase(0, pos == std::string::npos ? pos : pos + 1); } } ++s; } void cleanup(lua::state &l) override { lua::stack_sentry s(l, -1); #ifdef HAVE_SYS_INOTIFY_H llua_rm_notifies(); #endif /* HAVE_SYS_INOTIFY_H */ if (lua_L == nullptr) { return; } lua_close(lua_L); lua_L = nullptr; } public: lua_load_setting() : Base("lua_load", std::string(), false) {} }; lua_load_setting lua_load; conky::simple_config_setting lua_startup_hook("lua_startup_hook", std::string(), true); conky::simple_config_setting lua_shutdown_hook("lua_shutdown_hook", std::string(), true); #ifdef BUILD_X11 conky::simple_config_setting lua_draw_hook_pre("lua_draw_hook_pre", std::string(), true); conky::simple_config_setting lua_draw_hook_post( "lua_draw_hook_post", std::string(), true); #endif } // namespace static int llua_conky_parse(lua_State *L) { int n = lua_gettop(L); /* number of arguments */ char *str; auto *buf = static_cast(calloc(1, max_user_text.get(*state))); if (n != 1) { lua_pushstring( L, "incorrect arguments, conky_parse(string) takes exactly 1 argument"); lua_error(L); } if (lua_isstring(L, 1) == 0) { lua_pushstring(L, "incorrect argument (expecting a string)"); lua_error(L); } str = strdup(lua_tostring(L, 1)); evaluate(str, buf, max_user_text.get(*state)); lua_pushstring(L, buf); free(str); free(buf); return 1; /* number of results */ } static int llua_conky_set_update_interval(lua_State *L) { int n = lua_gettop(L); /* number of arguments */ if (n != 1) { lua_pushstring(L, "incorrect arguments, conky_set_update_interval(number) " "takes exactly 1 argument"); lua_error(L); } if (lua_isnumber(L, 1) == 0) { lua_pushstring(L, "incorrect argument (expecting a number)"); lua_error(L); } state->pushnumber(lua_tonumber(L, 1)); update_interval.lua_set(*state); return 0; /* number of results */ } void llua_init() { std::string libs(PACKAGE_LIBDIR "/lib?.so;"); std::string old_path, new_path; if (lua_L != nullptr) { return; } lua_L = luaL_newstate(); /* add our library path to the lua package.cpath global var */ luaL_openlibs(lua_L); lua_getglobal(lua_L, "package"); lua_getfield(lua_L, -1, "cpath"); old_path = std::string(lua_tostring(lua_L, -1)); new_path = libs + old_path; lua_pushstring(lua_L, new_path.c_str()); lua_setfield(lua_L, -3, "cpath"); lua_pop(lua_L, 2); lua_pushstring(lua_L, PACKAGE_NAME " " VERSION " compiled " BUILD_DATE " for " BUILD_ARCH); lua_setglobal(lua_L, "conky_build_info"); lua_pushstring(lua_L, VERSION); lua_setglobal(lua_L, "conky_version"); lua_pushstring(lua_L, BUILD_DATE); lua_setglobal(lua_L, "conky_build_date"); lua_pushstring(lua_L, BUILD_ARCH); lua_setglobal(lua_L, "conky_build_arch"); lua_pushstring(lua_L, current_config.c_str()); lua_setglobal(lua_L, "conky_config"); lua_pushcfunction(lua_L, &llua_conky_parse); lua_setglobal(lua_L, "conky_parse"); lua_pushcfunction(lua_L, &llua_conky_set_update_interval); lua_setglobal(lua_L, "conky_set_update_interval"); #if defined(BUILD_X11) /* register tolua++ user types */ tolua_open(lua_L); tolua_usertype(lua_L, "Drawable"); tolua_usertype(lua_L, "Visual"); tolua_usertype(lua_L, "Display"); #endif /* BUILD_X11 */ } void llua_load(const char *script) { int error; llua_init(); std::string path = to_real_path(script); error = luaL_dofile(lua_L, path.c_str()); if (error != 0) { NORM_ERR("llua_load: %s", lua_tostring(lua_L, -1)); lua_pop(lua_L, 1); #ifdef HAVE_SYS_INOTIFY_H } else if (!llua_block_notify && inotify_fd != -1) { llua_append_notify(path.c_str()); #endif /* HAVE_SYS_INOTIFY_H */ } } /* * Returns the first space-delimited token of the string starting at position * *len. On return *len contains the length of the token. Spaces inside brackets * are ignored, so that eg. '${foo bar}' is treated as a single token. Sets *len * to zero and *str points to the end of the string when there are no more * tokens. */ static const char *tokenize(const char *str, size_t *len) { str += *len; *len = 0; while ((str != nullptr) && (isspace(static_cast(*str)) != 0)) { ++str; } size_t level = 0; while ((str != nullptr) && (str[*len] != 0) && (level > 0 || (isspace(static_cast(str[*len])) == 0))) { switch (str[*len]) { case '{': ++level; break; case '}': --level; break; } ++*len; } if (str != nullptr && (str[*len] == 0) && level > 0) { NORM_ERR("tokenize: improperly nested token: %s", str); } return str; } /* llua_do_call does a flexible call to any Lua function string: [par1] [par2...] retc: the number of return values expected */ static char *llua_do_call(const char *string, int retc) { static char func[64]; int argc = 0; size_t len = 0; const char *ptr = tokenize(string, &len); /* proceed only if the function name is present */ if (len == 0U) { return nullptr; } /* call only conky_ prefixed functions */ if (strncmp(ptr, LUAPREFIX, strlen(LUAPREFIX)) != 0) { snprintf(func, sizeof func, "%s", LUAPREFIX); } else { *func = 0; } strncat(func, ptr, std::min(len, sizeof(func) - strlen(func) - 1)); /* push the function name to stack */ lua_getglobal(lua_L, func); /* parse all function parameters from args and push them to the stack */ while (ptr = tokenize(ptr, &len), len != 0u) { lua_pushlstring(lua_L, ptr, len); argc++; } if (lua_pcall(lua_L, argc, retc, 0) != 0) { NORM_ERR("llua_do_call: function %s execution failed: %s", func, lua_tostring(lua_L, -1)); lua_pop(lua_L, -1); return nullptr; } return func; } #if 0 /* * same as llua_do_call() except passes everything after func as one arg. */ static char *llua_do_read_call(const char *function, const char *arg, int retc) { static char func[64]; snprintf(func, 64, "conky_%s", function); /* push the function name to stack */ lua_getglobal(lua_L, func); /* push function parameter to the stack */ lua_pushstring(lua_L, arg); if (lua_pcall(lua_L, 1, retc, 0) != 0) { NORM_ERR("llua_do_call: function %s execution failed: %s", func, lua_tostring(lua_L, -1)); lua_pop(lua_L, -1); return nullptr; } return func; } #endif /* call a function with args, and return a string from it (must be free'd) */ static char *llua_getstring(const char *args) { char *func; char *ret = nullptr; if (lua_L == nullptr) { return nullptr; } func = llua_do_call(args, 1); if (func != nullptr) { if (lua_isstring(lua_L, -1) == 0) { NORM_ERR( "llua_getstring: function %s didn't return a string, result " "discarded", func); } else { ret = strdup(lua_tostring(lua_L, -1)); lua_pop(lua_L, 1); } } return ret; } #if 0 /* call a function with args, and return a string from it (must be free'd) */ static char *llua_getstring_read(const char *function, const char *arg) { char *func; char *ret = nullptr; if(!lua_L) return nullptr; func = llua_do_read_call(function, arg, 1); if (func) { if(!lua_isstring(lua_L, -1)) { NORM_ERR("llua_getstring_read: function %s didn't return a string, result discarded", func); } else { ret = strdup(lua_tostring(lua_L, -1)); lua_pop(lua_L, 1); } } return ret; } #endif /* call a function with args, and put the result in ret */ static int llua_getnumber(const char *args, double *ret) { char *func; if (lua_L == nullptr) { return 0; } func = llua_do_call(args, 1); if (func != nullptr) { if (lua_isnumber(lua_L, -1) == 0) { NORM_ERR( "llua_getnumber: function %s didn't return a number, result " "discarded", func); } else { *ret = lua_tonumber(lua_L, -1); lua_pop(lua_L, 1); return 1; } } return 0; } #ifdef HAVE_SYS_INOTIFY_H struct _lua_notify_s { int wd; char name[DEFAULT_TEXT_BUFFER_SIZE]; struct _lua_notify_s *next; }; static struct _lua_notify_s *lua_notifies = 0; static struct _lua_notify_s *llua_notify_list_do_alloc(const char *name) { struct _lua_notify_s *ret = (struct _lua_notify_s *)malloc(sizeof(struct _lua_notify_s)); memset(ret, 0, sizeof(struct _lua_notify_s)); strncpy(ret->name, name, DEFAULT_TEXT_BUFFER_SIZE); return ret; } void llua_append_notify(const char *name) { /* do it */ struct _lua_notify_s *new_tail = 0; if (!lua_notifies) { /* empty, fresh new digs */ new_tail = lua_notifies = llua_notify_list_do_alloc(name); } else { struct _lua_notify_s *tail = lua_notifies; while (tail->next) { tail = tail->next; } // should be @ the end now new_tail = llua_notify_list_do_alloc(name); tail->next = new_tail; } new_tail->wd = inotify_add_watch(inotify_fd, new_tail->name, IN_MODIFY); } void llua_rm_notifies(void) { /* git 'er done */ struct _lua_notify_s *head = lua_notifies; struct _lua_notify_s *next = 0; if (!lua_notifies) return; inotify_rm_watch(inotify_fd, head->wd); if (head->next) next = head->next; free(head); while (next) { head = next; next = head->next; inotify_rm_watch(inotify_fd, head->wd); free(head); } lua_notifies = 0; } void llua_inotify_query(int wd, int mask) { struct _lua_notify_s *head = lua_notifies; if (mask & IN_MODIFY || mask & IN_IGNORED) { /* for whatever reason, i keep getting IN_IGNORED when the file is * modified */ while (head) { if (head->wd == wd) { llua_block_notify = 1; llua_load(head->name); llua_block_notify = 0; NORM_ERR("Lua script '%s' reloaded", head->name); if (mask & IN_IGNORED) { /* for some reason we get IN_IGNORED here * sometimes, so we need to re-add the watch */ head->wd = inotify_add_watch(inotify_fd, head->name, IN_MODIFY); } return; } head = head->next; } } } #endif /* HAVE_SYS_INOTIFY_H */ void llua_set_number(const char *key, double value) { lua_pushnumber(lua_L, value); lua_setfield(lua_L, -2, key); } void llua_startup_hook() { if ((lua_L == nullptr) || lua_startup_hook.get(*state).empty()) { return; } llua_do_call(lua_startup_hook.get(*state).c_str(), 0); } void llua_shutdown_hook() { if ((lua_L == nullptr) || lua_shutdown_hook.get(*state).empty()) { return; } llua_do_call(lua_shutdown_hook.get(*state).c_str(), 0); } #ifdef BUILD_X11 void llua_draw_pre_hook() { if ((lua_L == nullptr) || lua_draw_hook_pre.get(*state).empty()) { return; } llua_do_call(lua_draw_hook_pre.get(*state).c_str(), 0); } void llua_draw_post_hook() { if ((lua_L == nullptr) || lua_draw_hook_post.get(*state).empty()) { return; } llua_do_call(lua_draw_hook_post.get(*state).c_str(), 0); } void llua_set_userdata(const char *key, const char *type, void *value) { tolua_pushusertype(lua_L, value, type); lua_setfield(lua_L, -2, key); } void llua_setup_window_table(int text_start_x, int text_start_y, int text_width, int text_height) { if (lua_L == nullptr) { return; } lua_newtable(lua_L); if (out_to_x.get(*state)) { llua_set_userdata("drawable", "Drawable", (void *)&window.drawable); llua_set_userdata("visual", "Visual", window.visual); llua_set_userdata("display", "Display", display); llua_set_number("width", window.width); llua_set_number("height", window.height); llua_set_number("border_inner_margin", border_inner_margin.get(*state)); llua_set_number("border_outer_margin", border_outer_margin.get(*state)); llua_set_number("border_width", border_width.get(*state)); llua_set_number("text_start_x", text_start_x); llua_set_number("text_start_y", text_start_y); llua_set_number("text_width", text_width); llua_set_number("text_height", text_height); lua_setglobal(lua_L, "conky_window"); } } void llua_update_window_table(int text_start_x, int text_start_y, int text_width, int text_height) { if (lua_L == nullptr) { return; } lua_getglobal(lua_L, "conky_window"); if (lua_isnil(lua_L, -1)) { /* window table isn't populated yet */ lua_pop(lua_L, 1); return; } llua_set_number("width", window.width); llua_set_number("height", window.height); llua_set_number("text_start_x", text_start_x); llua_set_number("text_start_y", text_start_y); llua_set_number("text_width", text_width); llua_set_number("text_height", text_height); lua_setglobal(lua_L, "conky_window"); } #endif /* BUILD_X11 */ void llua_setup_info(struct information *i, double u_interval) { if (lua_L == nullptr) { return; } lua_newtable(lua_L); llua_set_number("update_interval", u_interval); llua_set_number("cpu_count", i->cpu_count); lua_setglobal(lua_L, "conky_info"); } void llua_update_info(struct information *i, double u_interval) { if (lua_L == nullptr) { return; } lua_getglobal(lua_L, "conky_info"); if (lua_isnil(lua_L, -1)) { /* window table isn't populated yet */ lua_pop(lua_L, 1); return; } llua_set_number("update_interval", u_interval); (void)i; lua_setglobal(lua_L, "conky_info"); } void print_lua(struct text_object *obj, char *p, unsigned int p_max_size) { char *str = llua_getstring(obj->data.s); if (str != nullptr) { snprintf(p, p_max_size, "%s", str); free(str); } } void print_lua_parse(struct text_object *obj, char *p, unsigned int p_max_size) { char *str = llua_getstring(obj->data.s); if (str != nullptr) { evaluate(str, p, p_max_size); free(str); } } double lua_barval(struct text_object *obj) { double per; if (llua_getnumber(obj->data.s, &per) != 0) { return per; } return 0; } conky-1.12.2/src/llua.h000066400000000000000000000036241404127277500146330ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Copyright (c) 2009 Toni Spets * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef LUA_H_ #define LUA_H_ extern "C" { #include #include #include } #include #ifdef BUILD_X11 #include "x11.h" #endif /* BUILD_X11 */ #define LUAPREFIX "conky_" #ifdef HAVE_SYS_INOTIFY_H /* check our lua inotify status */ void llua_inotify_query(int wd, int mask); #endif /* HAVE_SYS_INOTIFY_H */ void llua_startup_hook(void); void llua_shutdown_hook(void); #ifdef BUILD_X11 void llua_draw_pre_hook(void); void llua_draw_post_hook(void); void llua_setup_window_table(int text_start_x, int text_start_y, int text_width, int text_height); void llua_update_window_table(int text_start_x, int text_start_y, int text_width, int text_height); #endif /* BUILD_X11 */ void llua_setup_info(struct information *i, double u_interval); void llua_update_info(struct information *i, double u_interval); void print_lua(struct text_object *, char *, unsigned int); void print_lua_parse(struct text_object *, char *, unsigned int); double lua_barval(struct text_object *); #endif /* LUA_H_*/ conky-1.12.2/src/logging.h000066400000000000000000000077231404127277500153300ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _LOGGING_H #define _LOGGING_H #include #include #include "config.h" #include "i18n.h" class fork_throw : public std::runtime_error { public: fork_throw() : std::runtime_error("Fork happened") {} fork_throw(const std::string &msg) : std::runtime_error(msg) {} }; class unknown_arg_throw : public std::runtime_error { public: unknown_arg_throw() : std::runtime_error("Unknown argumunt given") {} unknown_arg_throw(const std::string &msg) : std::runtime_error(msg) {} }; class combine_needs_2_args_error : public std::runtime_error { public: combine_needs_2_args_error() : std::runtime_error("combine needs arguments: ") {} combine_needs_2_args_error(const std::string &msg) : std::runtime_error(msg) {} }; class obj_create_error : public std::runtime_error { public: obj_create_error() : std::runtime_error("Failed to create object") {} obj_create_error(const std::string &msg) : std::runtime_error(msg) {} }; void clean_up(void *memtofree1, void *memtofree2); void clean_up_without_threads(void *memtofree1, void *memtofree2); template inline void gettextize_format(const char *format, Args &&...args) { fprintf(stderr, _(format), args...); } // explicit specialization for no arguments to avoid the // "format not a string literal and no format arguments" warning inline void gettextize_format(const char *format) { fputs(_(format), stderr); } template void NORM_ERR(const char *format, Args &&...args) { fprintf(stderr, PACKAGE_NAME ": "); gettextize_format(format, args...); fputs("\n", stderr); } /* critical error */ template inline void CRIT_ERR(void *memtofree1, void *memtofree2, const char *format, Args &&...args) { NORM_ERR(format, args...); clean_up(memtofree1, memtofree2); exit(EXIT_FAILURE); } template inline void THREAD_CRIT_ERR(void *memtofree1, void *memtofree2, const char *format, Args &&...args) { NORM_ERR(format, args...); clean_up_without_threads(memtofree1, memtofree2); return; } namespace conky { class error : public std::runtime_error { public: error(const std::string &msg) : std::runtime_error(msg) {} }; } // namespace conky /* debugging output */ extern int global_debug_level; #define __DBGP(level, ...) \ do { \ if (global_debug_level > level) { \ fprintf(stderr, "DEBUG(%d) [" __FILE__ ":%d]: ", level, __LINE__); \ gettextize_format(__VA_ARGS__); \ fputs("\n", stderr); \ } \ } while (0) #define DBGP(...) __DBGP(0, __VA_ARGS__) #define DBGP2(...) __DBGP(1, __VA_ARGS__) #endif /* _LOGGING_H */ conky-1.12.2/src/lua-config.cc000066400000000000000000000021571404127277500160600ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (C) 2010 Pavel Labath et al. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include "lua-config.hh" #include "data-source.hh" #include "setting.hh" namespace conky { void export_symbols(lua::state &l) { lua::stack_sentry s(l); l.checkstack(3); l.newtable(); { export_data_sources(l); l.newtable(); l.rawsetfield(-2, "config"); } l.setglobal("conky"); } } // namespace conky conky-1.12.2/src/lua-config.hh000066400000000000000000000016501404127277500160670ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (C) 2010 Pavel Labath et al. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef LUA_CONFIG_HH #define LUA_CONFIG_HH #include "luamm.hh" namespace conky { void export_symbols(lua::state &l); } #endif /* LUA_CONFIG_HH */ conky-1.12.2/src/luamm.cc000066400000000000000000000300471404127277500151460ustar00rootroot00000000000000/* * * luamm: C++ binding for lua * * Copyright (C) 2010 Pavel Labath et al. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include "luamm.hh" namespace lua { namespace { #if LUA_VERSION_NUM >= 502 // These two functions were deprecated in 5.2. Limited backwards compatibility // is provided by macros. We want them as real functions, because we take their // addresses. #undef lua_equal int lua_equal(lua_State *L, int index1, int index2) { return lua_compare(L, index1, index2, LUA_OPEQ); } #undef lua_lessthan int lua_lessthan(lua_State *L, int index1, int index2) { return lua_compare(L, index1, index2, LUA_OPLT); } #endif // keys for storing values in lua registry const char cpp_exception_metatable[] = "lua::cpp_exception_metatable"; const char cpp_function_metatable[] = "lua::cpp_function_metatable"; const char lua_exception_namespace[] = "lua::lua_exception_namespace"; const char this_cpp_object[] = "lua::this_cpp_object"; // converts C++ exceptions to strings, so lua can do something with them int exception_to_string(lua_State *l) { auto *ptr = static_cast(lua_touserdata(l, -1)); assert(ptr); try { std::rethrow_exception(*ptr); } catch (std::exception &e) { lua_pushstring(l, e.what()); } catch (...) { lua_pushstring(l, typeid(*ptr).name()); } return 1; } int absindex(lua_State *l, int index) { return index < 0 && -index <= lua_gettop(l) ? lua_gettop(l) + 1 + index : index; } // Just like getfield(), only without calling metamethods (or throwing random // exceptions) inline void rawgetfield(lua_State *l, int index, const char *k) { index = absindex(l, index); if (lua_checkstack(l, 1) == 0) { throw std::bad_alloc(); } lua_pushstring(l, k); lua_rawget(l, index); } // Just like setfield(), only without calling metamethods (or throwing random // exceptions) inline void rawsetfield(lua_State *l, int index, const char *k) { index = absindex(l, index); if (lua_checkstack(l, 2) == 0) { throw std::bad_alloc(); } lua_pushstring(l, k); lua_insert(l, -2); lua_rawset(l, index); } int closure_trampoline(lua_State *l) { lua_checkstack(l, 2); rawgetfield(l, REGISTRYINDEX, this_cpp_object); assert(lua_islightuserdata(l, -1)); auto *L = static_cast(lua_touserdata(l, -1)); lua_pop(l, 1); try { auto *fn = static_cast(L->touserdata(lua_upvalueindex(1))); assert(fn); return (*fn)(L); } catch (lua::exception &e) { // rethrow lua errors as such e.push_lua_error(L); } catch (...) { // C++ exceptions (pointers to them, actually) are stored as lua userdata // and then thrown L->createuserdata(std::current_exception()); L->rawgetfield(REGISTRYINDEX, cpp_exception_metatable); L->setmetatable(-2); } // lua_error does longjmp(), so destructors for objects in this function will // not be called return lua_error(l); } /* * This function is called when lua encounters an error outside of any protected * environment * Throwing the exception through lua code appears to work, even if it was * compiled without -fexceptions. If it turns out, it fails in some conditions, * it could be replaced with some longjmp() magic. But that shouldn't be * necessary, as this function will not be called under normal conditions (we * execute everything in protected mode). */ int panic_throw(lua_State *l) { if (lua_checkstack(l, 1) == 0) { throw std::bad_alloc(); } rawgetfield(l, REGISTRYINDEX, this_cpp_object); assert(lua_islightuserdata(l, -1)); auto *L = static_cast(lua_touserdata(l, -1)); lua_pop(l, 1); throw lua::exception(L); } // protected mode wrappers for various lua functions int safe_concat_trampoline(lua_State *l) { lua_concat(l, lua_gettop(l)); return 1; } template int safe_compare_trampoline(lua_State *l) { int r = compare(l, 1, 2); lua_pop(l, 2); lua_pushinteger(l, r); return 1; } int safe_gc_trampoline(lua_State *l) { int what = lua_tointeger(l, -2); int data = lua_tointeger(l, -1); lua_pop(l, 2); lua_pushinteger(l, lua_gc(l, what, data)); return 1; } template int safe_misc_trampoline(lua_State *l) { misc(l, 1); return nresults; } // Overloaded for Lua 5.3+ as lua_gettable and others return an int template int safe_misc_trampoline(lua_State *l) { misc(l, 1); return nresults; } int safe_next_trampoline(lua_State *l) { int r = lua_next(l, 1); lua_checkstack(l, 1); lua_pushinteger(l, r); return r != 0 ? 3 : 1; } } // namespace std::string exception::get_error_msg(state *L) { static const std::string default_msg("Unknown lua exception"); try { return L->tostring(-1); } catch (not_string_error &e) { return default_msg; } } exception::exception(state *l) : std::runtime_error(get_error_msg(l)), L(l) { L->checkstack(1); L->rawgetfield(REGISTRYINDEX, lua_exception_namespace); L->insert(-2); key = L->ref(-2); L->pop(1); } exception::~exception() { if (L == nullptr) { return; } L->checkstack(1); L->rawgetfield(REGISTRYINDEX, lua_exception_namespace); L->unref(-1, key); L->pop(); } void exception::push_lua_error(state *l) { if (l != L) { throw std::runtime_error( "Cannot transfer exceptions between different lua contexts"); } l->checkstack(2); l->rawgetfield(REGISTRYINDEX, lua_exception_namespace); l->rawgeti(-1, key); l->replace(-2); } state::state() { if (lua_State *l = luaL_newstate()) { cobj.reset(l, &lua_close); } else { // docs say this can happen only in case of a memory allocation error throw std::bad_alloc(); } // set our panic function lua_atpanic(cobj.get(), panic_throw); checkstack(2); // store a pointer to ourselves pushlightuserdata(this); rawsetfield(REGISTRYINDEX, this_cpp_object); // a metatable for C++ exceptions travelling through lua code newmetatable(cpp_exception_metatable); lua_pushcfunction(cobj.get(), &exception_to_string); rawsetfield(-2, "__tostring"); pushboolean(false); rawsetfield(-2, "__metatable"); pushdestructor(); rawsetfield(-2, "__gc"); pop(); // a metatable for C++ functions callable from lua code newmetatable(cpp_function_metatable); pushboolean(false); rawsetfield(-2, "__metatable"); pushdestructor(); rawsetfield(-2, "__gc"); pop(); // while they're travelling through C++ code, lua exceptions will reside here newtable(); rawsetfield(REGISTRYINDEX, lua_exception_namespace); luaL_openlibs(cobj.get()); } void state::call(int nargs, int nresults, int errfunc) { int r = lua_pcall(cobj.get(), nargs, nresults, errfunc); if (r == 0) { return; } if (r == LUA_ERRMEM) { // memory allocation error, cross your fingers throw std::bad_alloc(); } checkstack(3); rawgetfield(REGISTRYINDEX, cpp_exception_metatable); if (getmetatable(-2)) { if (rawequal(-1, -2)) { // it's a C++ exception, rethrow it auto *ptr = static_cast(touserdata(-3)); assert(ptr); /* * we create a copy, so we can pop the object without fearing the * exception will be collected by lua's GC */ std::exception_ptr t(*ptr); ptr = nullptr; pop(3); std::rethrow_exception(t); } pop(2); } // it's a lua exception, wrap it if (r == LUA_ERRERR) { throw lua::errfunc_error(this); } { throw lua::exception(this); } } void state::checkstack(int extra) { if (lua_checkstack(cobj.get(), extra) == 0) { throw std::bad_alloc(); } } void state::concat(int n) { assert(n >= 0); checkstack(1); lua_pushcfunction(cobj.get(), safe_concat_trampoline); insert(-n - 1); call(n, 1, 0); } bool state::equal(int index1, int index2) { // avoid pcall overhead in trivial cases if (rawequal(index1, index2)) { return true; } return safe_compare(&safe_compare_trampoline, index1, index2); } int state::gc(int what, int data) { checkstack(3); lua_pushcfunction(cobj.get(), safe_gc_trampoline); pushinteger(what); pushinteger(data); call(2, 1, 0); assert(state::_isnumber(-1)); int r = tointeger(-1); pop(); return r; } void state::getfield(int index, const char *k) { checkstack(1); index = absindex(index); pushstring(k); gettable(index); } void state::getglobal(const char *name) { #if LUA_VERSION_NUM >= 502 checkstack(1); pushinteger(LUA_RIDX_GLOBALS); gettable(REGISTRYINDEX); getfield(-1, name); replace(-2); #else getfield(LUA_GLOBALSINDEX, name); #endif } void state::gettable(int index) { checkstack(2); pushvalue(index); insert(-2); lua_pushcfunction(cobj.get(), (&safe_misc_trampoline<&lua_gettable, 1>)); insert(-3); call(2, 1, 0); } bool state::lessthan(int index1, int index2) { return safe_compare(&safe_compare_trampoline<&lua_lessthan>, index1, index2); } void state::loadfile(const char *filename) { switch (luaL_loadfile(cobj.get(), filename)) { case 0: return; case LUA_ERRSYNTAX: throw lua::syntax_error(this); case LUA_ERRFILE: throw lua::file_error(this); case LUA_ERRMEM: throw std::bad_alloc(); default: assert(0); } } void state::loadstring(const char *s) { switch (luaL_loadstring(cobj.get(), s)) { case 0: return; case LUA_ERRSYNTAX: throw lua::syntax_error(this); case LUA_ERRMEM: throw std::bad_alloc(); default: assert(0); } } bool state::next(int index) { checkstack(2); pushvalue(index); insert(-2); lua_pushcfunction(cobj.get(), &safe_next_trampoline); insert(-3); call(2, MULTRET, 0); assert(state::_isnumber(-1)); int r = tointeger(-1); pop(); return r != 0; } void state::pushclosure(const cpp_function &fn, int n) { checkstack(2); createuserdata(fn); rawgetfield(REGISTRYINDEX, cpp_function_metatable); setmetatable(-2); insert(-n - 1); lua_pushcclosure(cobj.get(), &closure_trampoline, n + 1); } void state::rawgetfield(int index, const char *k) { lua::rawgetfield(cobj.get(), index, k); } void state::rawsetfield(int index, const char *k) { lua::rawsetfield(cobj.get(), index, k); } bool state::safe_compare(lua_CFunction trampoline, int index1, int index2) { // if one of the indexes is invalid, return false if (isnone(index1) || isnone(index2)) { return false; } // convert relative indexes into absolute index1 = absindex(index1); index2 = absindex(index2); checkstack(3); lua_pushcfunction(cobj.get(), trampoline); pushvalue(index1); pushvalue(index2); call(2, 1, 0); assert(state::_isnumber(-1)); int r = tointeger(-1); pop(); return r != 0; } void state::setfield(int index, const char *k) { checkstack(1); index = absindex(index); pushstring(k); insert(-2); settable(index); } void state::setglobal(const char *name) { #if LUA_VERSION_NUM >= 502 stack_sentry s(*this, -1); checkstack(1); pushinteger(LUA_RIDX_GLOBALS); gettable(REGISTRYINDEX); insert(-2); setfield(-2, name); pop(); #else setfield(LUA_GLOBALSINDEX, name); #endif } void state::settable(int index) { checkstack(2); pushvalue(index); insert(-3); lua_pushcfunction(cobj.get(), (&safe_misc_trampoline<&lua_settable, 0>)); insert(-4); call(3, 0, 0); } std::string state::tostring(int index) { size_t len; const char *str = lua_tolstring(cobj.get(), index, &len); if (str == nullptr) { throw not_string_error(); } return std::string(str, len); } } // namespace lua conky-1.12.2/src/luamm.hh000066400000000000000000000317241404127277500151630ustar00rootroot00000000000000/* * * luamm: C++ binding for lua * * Copyright (C) 2010 Pavel Labath et al. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef LUAMM_HH #define LUAMM_HH #include #include #include #include #include #include #include #include namespace lua { class state; typedef lua_Integer integer; typedef lua_Number number; typedef std::function cpp_function; enum { REGISTRYINDEX = LUA_REGISTRYINDEX }; enum { GCSTOP = LUA_GCSTOP, GCRESTART = LUA_GCRESTART, GCCOLLECT = LUA_GCCOLLECT, GCCOUNT = LUA_GCCOUNT, GCCOUNTB = LUA_GCCOUNTB, GCSTEP = LUA_GCSTEP, GCSETPAUSE = LUA_GCSETPAUSE, GCSETSTEPMUL = LUA_GCSETSTEPMUL }; enum { MULTRET = LUA_MULTRET }; enum Type { TBOOLEAN = LUA_TBOOLEAN, TFUNCTION = LUA_TFUNCTION, TLIGHTUSERDATA = LUA_TLIGHTUSERDATA, TNIL = LUA_TNIL, TNONE = LUA_TNONE, TNUMBER = LUA_TNUMBER, TSTRING = LUA_TSTRING, TTABLE = LUA_TTABLE, TTHREAD = LUA_TTHREAD, TUSERDATA = LUA_TUSERDATA }; // we reserve one upvalue for the function pointer inline int upvalueindex(int n) { return lua_upvalueindex(n + 1); } /* * Lua error()s are wrapped in this class when rethrown into C++ code. what() * returns the error message. push_lua_error() pushes the error onto lua stack. * The error can only be pushed into the same state it was generated in. */ class exception : public std::runtime_error { /* * We only allow moving, to avoid complications with multiple references. It * shouldn't be difficult to modify this to work with copying, if that proves * unavoidable. */ state *L; int key; static std::string get_error_msg(state *L); exception(const exception &) = delete; const exception &operator=(const exception &) = delete; public: exception(exception &&other) : std::runtime_error(std::move(other)), L(other.L), key(other.key) { other.L = nullptr; } explicit exception(state *l); virtual ~exception(); void push_lua_error(state *l); }; class not_string_error : public std::runtime_error { public: not_string_error() : std::runtime_error("Cannot convert value to a string") {} }; // the name says it all class syntax_error : public lua::exception { syntax_error(const syntax_error &) = delete; const syntax_error &operator=(const syntax_error &) = delete; public: explicit syntax_error(state *L) : lua::exception(L) {} syntax_error(syntax_error &&other) : lua::exception(std::move(other)) {} }; // loadfile() encountered an error while opening/reading the file class file_error : public lua::exception { file_error(const file_error &) = delete; const file_error &operator=(const file_error &) = delete; public: explicit file_error(state *L) : lua::exception(L) {} file_error(file_error &&other) : lua::exception(std::move(other)) {} }; // double fault, lua encountered an error while running the error handler // function class errfunc_error : public lua::exception { errfunc_error(const errfunc_error &) = delete; const errfunc_error &operator=(const errfunc_error &) = delete; public: explicit errfunc_error(state *L) : lua::exception(L) {} errfunc_error(errfunc_error &&other) : lua::exception(std::move(other)) {} }; // a fancy wrapper around lua_State class state : private std::mutex { std::shared_ptr cobj; // destructor for C++ objects stored as lua userdata template static int destroy_cpp_object(lua_State *l) { T *ptr = static_cast(lua_touserdata(l, -1)); assert(ptr); try { // throwing exceptions in destructors is a bad idea // but we catch (and ignore) them, just in case ptr->~T(); } catch (...) {} return 0; } bool safe_compare(lua_CFunction trampoline, int index1, int index2); public: state(); /* * Lua functions come in three flavours * a) functions that never throw an exception * b) functions that throw only in case of a memory allocation error * c) functions that throw other kinds of errors * * Calls to type a functions are simply forwarded to the C api. * Type c functions are executed in protected mode, to make sure they don't * longjmp() over us (and our destructors). This add a certain amount * overhead. If you care about performance, try using the raw versions (if * possible). Type b functions are not executed in protected mode atm. as * memory allocation errors don't happen that often (as opposed to the type c, * where the user get deliberately set a metamethod that throws an error). * That means those errors will do something undefined, but hopefully that * won't be a problem. * * Semantics are mostly identical to those of the underlying C api. Any * deviation is noted in the respective functions comment. The most important * difference is that instead of return values, we use exceptions to indicate * errors. The lua and C++ exception mechanisms are integrated. That means * one can throw a C++ exception and catch it in lua (with pcall). Lua * error()s can be caught in C++ as exceptions of type lua::exception. */ // type a, never throw int absindex(int index) throw() { return index < 0 && -index <= gettop() ? gettop() + 1 + index : index; } bool getmetatable(int index) throw() { return lua_getmetatable(cobj.get(), index); } int gettop() throw() { return lua_gettop(cobj.get()); } void insert(int index) throw() { lua_insert(cobj.get(), index); } bool isboolean(int index) throw() { return lua_isboolean(cobj.get(), index); } bool isfunction(int index) throw() { return lua_isfunction(cobj.get(), index); } bool islightuserdata(int index) throw() { return lua_islightuserdata(cobj.get(), index); } bool isnil(int index) throw() { return lua_isnil(cobj.get(), index); } bool isnone(int index) throw() { return lua_isnone(cobj.get(), index); } /* isnumber conflicts with some headers on BSD systems */ bool _isnumber(int index) throw() { return lua_isnumber(cobj.get(), index); } bool isstring(int index) throw() { return lua_isstring(cobj.get(), index); } void pop(int n = 1) throw() { lua_pop(cobj.get(), n); } void pushboolean(bool b) throw() { lua_pushboolean(cobj.get(), b); } void pushinteger(integer n) throw() { lua_pushinteger(cobj.get(), n); } void pushlightuserdata(void *p) throw() { lua_pushlightuserdata(cobj.get(), p); } void pushnil() throw() { lua_pushnil(cobj.get()); } void pushnumber(number n) throw() { lua_pushnumber(cobj.get(), n); } void pushvalue(int index) throw() { lua_pushvalue(cobj.get(), index); } void rawget(int index) throw() { lua_rawget(cobj.get(), index); } void rawgeti(int index, int n) throw() { lua_rawgeti(cobj.get(), index, n); } bool rawequal(int index1, int index2) throw() { return lua_rawequal(cobj.get(), index1, index2); } void replace(int index) throw() { lua_replace(cobj.get(), index); } // lua_setmetatable returns int, but docs don't specify it's meaning :/ int setmetatable(int index) throw() { return lua_setmetatable(cobj.get(), index); } void settop(int index) throw() { return lua_settop(cobj.get(), index); } bool toboolean(int index) throw() { return lua_toboolean(cobj.get(), index); } integer tointeger(int index) throw() { return lua_tointeger(cobj.get(), index); } number tonumber(int index) throw() { return lua_tonumber(cobj.get(), index); } void *touserdata(int index) throw() { return lua_touserdata(cobj.get(), index); } Type type(int index) throw() { return static_cast(lua_type(cobj.get(), index)); } // typename is a reserved word :/ const char *type_name(Type tp) throw() { return lua_typename(cobj.get(), tp); } void unref(int t, int ref) throw() { return luaL_unref(cobj.get(), t, ref); } // type b, throw only on memory allocation errors // checkstack correctly throws bad_alloc, because lua_checkstack kindly // informs us of that sitution void checkstack(int extra); const char *gsub(const char *s, const char *p, const char *r) { return luaL_gsub(cobj.get(), s, p, r); } bool newmetatable(const char *tname) { return luaL_newmetatable(cobj.get(), tname); } void newtable() { lua_newtable(cobj.get()); } void *newuserdata(size_t size) { return lua_newuserdata(cobj.get(), size); } // cpp_function can be anything that std::function can handle, everything else // remains identical void pushclosure(const cpp_function &fn, int n); void pushfunction(const cpp_function &fn) { pushclosure(fn, 0); } void pushstring(const char *s) { lua_pushstring(cobj.get(), s); } void pushstring(const char *s, size_t len) { lua_pushlstring(cobj.get(), s, len); } void pushstring(const std::string &s) { lua_pushlstring(cobj.get(), s.c_str(), s.size()); } void rawgetfield(int index, const char *k); void rawset(int index) { lua_rawset(cobj.get(), index); } void rawsetfield(int index, const char *k); int ref(int t) { return luaL_ref(cobj.get(), t); } // len receives length, if not null. Returned value may contain '\0' const char *tocstring(int index, size_t *len = nullptr) { return lua_tolstring(cobj.get(), index, len); } // Don't use pushclosure() to create a __gc function. The problem is that lua // calls them in an unspecified order, and we may end up destroying the object // holding the std::function before we get a chance to call it. This pushes a // function that simply calls ~T when the time comes. Only set it as __gc on // userdata of type T. template void pushdestructor() { lua_pushcfunction(cobj.get(), &destroy_cpp_object); } // type c, throw everything but the kitchen sink // call() is a protected mode call, we don't allow unprotected calls void call(int nargs, int nresults, int errfunc = 0); void concat(int n); bool equal(int index1, int index2); int gc(int what, int data); void getfield(int index, const char *k); void getglobal(const char *name); void gettable(int index); bool lessthan(int index1, int index2); void loadfile(const char *filename); void loadstring(const char *s); bool next(int index); // register is a reserved word :/ void register_fn(const char *name, const cpp_function &f) { pushfunction(f); setglobal(name); } void setfield(int index, const char *k); void setglobal(const char *name); void settable(int index); // lua_tostring uses nullptr to indicate conversion error, since there is no // such thing as a nullptr std::string, we throw an exception. Returned value // may contain '\0' std::string tostring(int index); // allocate a new lua userdata of appropriate size, and create a object in it // pushes the userdata on stack and returns the pointer template T *createuserdata(Args &&...args); using std::mutex::lock; using std::mutex::try_lock; using std::mutex::unlock; }; /* * Can be used to automatically pop temporary values off the lua stack on exit * from the function/block (e.g. via an exception). It's destructor makes sure * the stack contains exactly n items. The constructor initializes n to * l.gettop()+n_, but that can be later changed with the overloaded operators. * It is an error if stack contains less than n elements at entry into the * destructor. * * Proposed stack discipline for functions is this: * - called function always pops parameters off the stack. * - if functions returns normally, it's return values are on the stack. * - if function throws an exception, there are no return values on the stack. * The last point differs from lua C api, which return an error message on the * stack. But since we have exception.what() for that, putting the message on * the stack is not necessary. */ class stack_sentry { state *L; int n; stack_sentry(const stack_sentry &) = delete; const stack_sentry &operator=(const stack_sentry &) = delete; public: explicit stack_sentry(state &l, int n_ = 0) : L(&l), n(l.gettop() + n_) { assert(n >= 0); } ~stack_sentry() { assert(L->gettop() >= n); L->settop(n); } void operator++() { ++n; } void operator--() { --n; assert(n >= 0); } void operator+=(int n_) { n += n_; } void operator-=(int n_) { n -= n_; assert(n >= 0); } }; template T *state::createuserdata(Args &&...args) { stack_sentry s(*this); void *t = newuserdata(sizeof(T)); new (t) T(std::forward(args)...); ++s; return static_cast(t); } } // namespace lua #endif /* LUAMM_HH */ conky-1.12.2/src/mail.cc000066400000000000000000000675571404127277500147750ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "config.h" #include "mail.h" #include "common.h" #include "conky.h" #include "logging.h" #include "text_object.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "update-cb.hh" struct local_mail_s { char *mbox; int mail_count; int new_mail_count; int seen_mail_count; int unseen_mail_count; int flagged_mail_count; int unflagged_mail_count; int forwarded_mail_count; int unforwarded_mail_count; int replied_mail_count; int unreplied_mail_count; int draft_mail_count; int trashed_mail_count; float interval; time_t last_mtime; time_t last_ctime; /* needed for mutt at least */ double last_update; }; class mail_fail : public std::runtime_error { public: explicit mail_fail(const std::string &what_arg) : runtime_error(what_arg) {} }; std::pair priv::current_mail_spool_setting::do_convert( lua::state &l, int index) { auto ret = Base::do_convert(l, index); if (ret.second) { ret.first = variable_substitute(ret.first); } return ret; } priv::current_mail_spool_setting current_mail_spool; namespace { enum { DEFAULT_MAIL_INTERVAL = 300 /*seconds*/ }; enum { MP_USER, MP_PASS, MP_FOLDER, MP_COMMAND, MP_HOST, MP_PORT }; struct mail_result { unsigned long unseen{0}; unsigned long used{0}; unsigned long messages{0}; mail_result() = default; }; class mail_cb : public conky::callback { typedef conky::callback Base; protected: addrinfo *ai; uint16_t fail; uint16_t retries; void resolve_host() { struct addrinfo hints {}; char portbuf[8]; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; snprintf(portbuf, 8, "%" SCNu16, get()); if (int res = getaddrinfo(get().c_str(), portbuf, &hints, &ai)) { throw mail_fail(std::string("IMAP getaddrinfo: ") + gai_strerror(res)); } } int connect() { for (struct addrinfo *rp = ai; rp != nullptr; rp = rp->ai_next) { int sockfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); if (sockfd == -1) { continue; } if (::connect(sockfd, rp->ai_addr, rp->ai_addrlen) != -1) { return sockfd; } close(sockfd); } throw mail_fail("Unable to connect to mail server"); } void merge(callback_base &&other) override { auto &&o = dynamic_cast(other); if (retries < o.retries) { retries = o.retries; fail = 0; } Base::merge(std::move(other)); } mail_cb(uint32_t period, const Tuple &tuple, uint16_t retries_) : Base(period, false, tuple, true), ai(nullptr), fail(0), retries(retries_) {} ~mail_cb() override { if (ai != nullptr) { freeaddrinfo(ai); } } }; struct mail_param_ex : public mail_cb::Tuple { uint16_t retries{0}; uint32_t period{1}; mail_param_ex() = default; }; class imap_cb : public mail_cb { using Base = mail_cb; void check_status(char *recvbuf); void unseen_command(unsigned long old_unseen, unsigned long old_messages); protected: void work() override; public: imap_cb(uint32_t period, const Tuple &tuple, uint16_t retries_) : Base(period, tuple, retries_) {} }; class pop3_cb : public mail_cb { using Base = mail_cb; protected: void work() override; public: pop3_cb(uint32_t period, const Tuple &tuple, uint16_t retries_) : Base(period, tuple, retries_) {} }; struct mail_param_ex *global_mail; } // namespace static void update_mail_count(struct local_mail_s *mail) { struct stat st {}; if (mail == nullptr) { return; } /* TODO: use that fine file modification notify on Linux 2.4 */ /* don't check mail so often (9.5s is minimum interval) */ if (current_update_time - mail->last_update < 9.5) { return; } mail->last_update = current_update_time; if (stat(mail->mbox, &st) != 0) { static int rep = 0; if (rep == 0) { NORM_ERR("can't stat %s: %s", mail->mbox, strerror(errno)); rep = 1; } return; } #if HAVE_DIRENT_H /* maildir format */ if (S_ISDIR(st.st_mode)) { DIR *dir; std::string dirname(mail->mbox); struct dirent *dirent; char *mailflags; mail->mail_count = mail->new_mail_count = 0; mail->seen_mail_count = mail->unseen_mail_count = 0; mail->flagged_mail_count = mail->unflagged_mail_count = 0; mail->forwarded_mail_count = mail->unforwarded_mail_count = 0; mail->replied_mail_count = mail->unreplied_mail_count = 0; mail->draft_mail_count = mail->trashed_mail_count = 0; /* checking the cur subdirectory */ dirname = dirname + "/cur"; dir = opendir(dirname.c_str()); if (dir == nullptr) { NORM_ERR("cannot open directory"); return; } dirent = readdir(dir); while (dirent != nullptr) { /* . and .. are skipped */ if (dirent->d_name[0] != '.') { mail->mail_count++; mailflags = static_cast( malloc(sizeof(char) * strlen(strrchr(dirent->d_name, ',')))); if (mailflags == nullptr) { NORM_ERR("malloc"); return; } strncpy(mailflags, strrchr(dirent->d_name, ','), strlen(strrchr(dirent->d_name, ','))); if (strchr(mailflags, 'T') == nullptr) { /* The message is not in the trash */ if (strchr(mailflags, 'S') != nullptr) { /*The message has been seen */ mail->seen_mail_count++; } else { mail->unseen_mail_count++; } if (strchr(mailflags, 'F') != nullptr) { /*The message was flagged */ mail->flagged_mail_count++; } else { mail->unflagged_mail_count++; } if (strchr(mailflags, 'P') != nullptr) { /*The message was forwarded */ mail->forwarded_mail_count++; } else { mail->unforwarded_mail_count++; } if (strchr(mailflags, 'R') != nullptr) { /*The message was replied */ mail->replied_mail_count++; } else { mail->unreplied_mail_count++; } if (strchr(mailflags, 'D') != nullptr) { /*The message is a draft */ mail->draft_mail_count++; } } else { mail->trashed_mail_count++; } free(mailflags); } dirent = readdir(dir); } closedir(dir); dirname.resize(dirname.size() - 3); dirname = dirname + "new"; dir = opendir(dirname.c_str()); if (dir == nullptr) { NORM_ERR("cannot open directory"); return; } dirent = readdir(dir); while (dirent != nullptr) { /* . and .. are skipped */ if (dirent->d_name[0] != '.') { mail->new_mail_count++; mail->mail_count++; mail->unseen_mail_count++; /* new messages cannot have been seen */ } dirent = readdir(dir); } closedir(dir); return; } #endif /* mbox format */ if (st.st_mtime != mail->last_mtime || st.st_ctime != mail->last_ctime) { /* yippee, modification time has changed, let's read mail count! */ static int rep; FILE *fp; int reading_status = 0; /* could lock here but I don't think it's really worth it because * this isn't going to write mail spool */ mail->new_mail_count = mail->mail_count = 0; /* these flags are not supported for mbox */ mail->seen_mail_count = mail->unseen_mail_count = -1; mail->flagged_mail_count = mail->unflagged_mail_count = -1; mail->forwarded_mail_count = mail->unforwarded_mail_count = -1; mail->replied_mail_count = mail->unreplied_mail_count = -1; mail->draft_mail_count = mail->trashed_mail_count = -1; fp = open_file(mail->mbox, &rep); if (fp == nullptr) { return; } /* NOTE: adds mail as new if there isn't Status-field at all */ while (feof(fp) == 0) { char buf[128]; if (fgets(buf, 128, fp) == nullptr) { break; } if (strncmp(buf, "From ", 5) == 0) { /* ignore MAILER-DAEMON */ if (strncmp(buf + 5, "MAILER-DAEMON ", 14) != 0) { mail->mail_count++; if (reading_status == 1) { mail->new_mail_count++; } else { reading_status = 1; } } } else { if (reading_status == 1 && strncmp(buf, "X-Mozilla-Status:", 17) == 0) { int xms = strtol(buf + 17, nullptr, 16); /* check that mail isn't marked for deletion */ if ((xms & 0x0008) != 0) { mail->trashed_mail_count++; reading_status = 0; /* Don't check whether the trashed email is unread */ continue; } /* check that mail isn't already read */ if ((xms & 0x0001) == 0) { mail->new_mail_count++; } /* check for an additional X-Status header */ reading_status = 2; continue; } if (reading_status == 1 && strncmp(buf, "Status:", 7) == 0) { /* check that mail isn't already read */ if (strchr(buf + 7, 'R') == nullptr) { mail->new_mail_count++; } reading_status = 2; continue; } if (reading_status >= 1 && strncmp(buf, "X-Status:", 9) == 0) { /* check that mail isn't marked for deletion */ if (strchr(buf + 9, 'D') != nullptr) { mail->trashed_mail_count++; } reading_status = 0; continue; } } /* skip until \n */ while (strchr(buf, '\n') == nullptr && (feof(fp) == 0)) { if (fgets(buf, 128, fp) == nullptr) { break; } } } fclose(fp); if (reading_status != 0) { mail->new_mail_count++; } mail->last_mtime = st.st_mtime; mail->last_ctime = st.st_ctime; } } void parse_local_mail_args(struct text_object *obj, const char *arg) { float n1; char mbox[256]; struct local_mail_s *locmail; if (arg == nullptr) { n1 = 9.5; strncpy(mbox, current_mail_spool.get(*state).c_str(), sizeof(mbox)); } else { if (sscanf(arg, "%s %f", mbox, &n1) != 2) { n1 = 9.5; strncpy(mbox, arg, sizeof(mbox)); } } std::string dst = variable_substitute(mbox); locmail = static_cast(malloc(sizeof(struct local_mail_s))); memset(locmail, 0, sizeof(struct local_mail_s)); locmail->mbox = strndup(dst.c_str(), text_buffer_size.get(*state)); locmail->interval = n1; obj->data.opaque = locmail; } #define PRINT_MAILS_GENERATOR(x) \ void print_##x##mails(struct text_object *obj, char *p, \ unsigned int p_max_size) { \ struct local_mail_s *locmail = (struct local_mail_s *)obj->data.opaque; \ if (!locmail) return; \ update_mail_count(locmail); \ snprintf(p, p_max_size, "%d", locmail->x##mail_count); \ } PRINT_MAILS_GENERATOR() PRINT_MAILS_GENERATOR(new_) PRINT_MAILS_GENERATOR(seen_) PRINT_MAILS_GENERATOR(unseen_) PRINT_MAILS_GENERATOR(flagged_) PRINT_MAILS_GENERATOR(unflagged_) PRINT_MAILS_GENERATOR(forwarded_) PRINT_MAILS_GENERATOR(unforwarded_) PRINT_MAILS_GENERATOR(replied_) PRINT_MAILS_GENERATOR(unreplied_) PRINT_MAILS_GENERATOR(draft_) PRINT_MAILS_GENERATOR(trashed_) void free_local_mails(struct text_object *obj) { auto *locmail = static_cast(obj->data.opaque); if (locmail == nullptr) { return; } free_and_zero(locmail->mbox); free_and_zero(obj->data.opaque); } #define MAXDATASIZE 1000 namespace { enum mail_type { POP3_TYPE, IMAP_TYPE }; } // namespace std::unique_ptr parse_mail_args(mail_type type, const char *arg) { using std::get; std::unique_ptr mail; char *tmp; char host[129]; char user[129]; char pass[129]; if (sscanf(arg, "%128s %128s %128s", host, user, pass) != 3) { if (type == POP3_TYPE) { NORM_ERR("Scanning POP3 args failed"); } else if (type == IMAP_TYPE) { NORM_ERR("Scanning IMAP args failed"); } return mail; } // see if password needs prompting if (pass[0] == '*' && pass[1] == '\0') { int fp = fileno(stdin); struct termios term {}; tcgetattr(fp, &term); term.c_lflag &= ~ECHO; tcsetattr(fp, TCSANOW, &term); printf("Enter mailbox password (%s@%s): ", user, host); if (scanf("%128s", pass) != 1) { pass[0] = 0; } printf("\n"); term.c_lflag |= ECHO; tcsetattr(fp, TCSANOW, &term); } mail = std::make_unique(); get(*mail) = host; get(*mail) = user; get(*mail) = pass; // now we check for optional args tmp = const_cast(strstr(arg, "-r ")); if (tmp != nullptr) { tmp += 3; sscanf(tmp, "%" SCNu16, &mail->retries); } else { mail->retries = 5; // 5 retries after failure } float interval = DEFAULT_MAIL_INTERVAL; tmp = const_cast(strstr(arg, "-i ")); if (tmp != nullptr) { tmp += 3; sscanf(tmp, "%f", &interval); } mail->period = std::max(lround(interval / active_update_interval()), 1l); tmp = const_cast(strstr(arg, "-p ")); if (tmp != nullptr) { tmp += 3; sscanf(tmp, "%" SCNu16, &get(*mail)); } else { if (type == POP3_TYPE) { get(*mail) = 110; // default pop3 port } else if (type == IMAP_TYPE) { get(*mail) = 143; // default imap port } } if (type == IMAP_TYPE) { tmp = const_cast(strstr(arg, "-f ")); if (tmp != nullptr) { int len = 0; tmp += 3; if (tmp[0] == '\'') { len = strstr(tmp + 1, "'") - tmp - 1; tmp++; } get(*mail).assign(tmp, len); } else { get(*mail) = "INBOX"; // default imap inbox } } tmp = const_cast(strstr(arg, "-e ")); if (tmp != nullptr) { int len = 0; tmp += 3; if (tmp[0] == '\'') { len = strstr(tmp + 1, "'") - tmp - 1; } get(*mail).assign(tmp + 1, len); } return mail; } void parse_imap_mail_args(struct text_object *obj, const char *arg) { static int rep = 0; if (arg == nullptr) { if ((global_mail == nullptr) && (rep == 0)) { // something is wrong, warn once then stop NORM_ERR( "There's a problem with your mail settings. " "Check that the global mail settings are properly defined" " (line %li).", obj->line); rep = 1; return; } obj->data.opaque = global_mail; return; } // process obj->data.opaque = parse_mail_args(IMAP_TYPE, arg).release(); } void parse_pop3_mail_args(struct text_object *obj, const char *arg) { static int rep = 0; if (arg == nullptr) { if ((global_mail == nullptr) && (rep == 0)) { // something is wrong, warn once then stop NORM_ERR( "There's a problem with your mail settings. " "Check that the global mail settings are properly defined" " (line %li).", obj->line); rep = 1; return; } obj->data.opaque = global_mail; return; } // process obj->data.opaque = parse_mail_args(POP3_TYPE, arg).release(); } namespace { class mail_setting : public conky::simple_config_setting { using Base = conky::simple_config_setting; mail_type type; protected: void lua_setter(lua::state &l, bool init) override { lua::stack_sentry s(l, -2); Base::lua_setter(l, init); if (init && (global_mail == nullptr)) { const std::string &t = do_convert(l, -1).first; if (static_cast(!t.empty()) != 0u) { global_mail = parse_mail_args(type, t.c_str()).release(); } } ++s; } void cleanup(lua::state &l) override { lua::stack_sentry s(l, -1); delete global_mail; global_mail = nullptr; l.pop(); } public: mail_setting(const std::string &name, mail_type type_) : Base(name), type(type_) {} }; mail_setting imap("imap", IMAP_TYPE); mail_setting pop3("pop3", POP3_TYPE); } // namespace void free_mail_obj(struct text_object *obj) { if (obj->data.opaque == nullptr) { return; } if (obj->data.opaque != global_mail) { auto *mail = static_cast(obj->data.opaque); delete mail; obj->data.opaque = nullptr; } } static void command(int sockfd, const std::string &cmd, char *response, const char *verify) { struct timeval fetchtimeout {}; fd_set fdset; ssize_t total = 0; int numbytes = 0; if (send(sockfd, cmd.c_str(), cmd.length(), 0) == -1) { throw mail_fail("send: " + strerror_r(errno)); } DBGP2("command() command: %s", cmd.c_str()); while (1) { fetchtimeout.tv_sec = 60; // 60 second timeout i guess fetchtimeout.tv_usec = 0; FD_ZERO(&fdset); FD_SET(sockfd, &fdset); if (select(sockfd + 1, &fdset, nullptr, nullptr, &fetchtimeout) == 0) { throw mail_fail("select: read timeout"); } if ((numbytes = recv(sockfd, response + total, MAXDATASIZE - 1 - total, 0)) == -1) { throw mail_fail("recv: " + strerror_r(errno)); } total += numbytes; response[total] = '\0'; DBGP2("command() received: %s", response); if (strstr(response, verify) != nullptr) { return; } if (numbytes == 0) { throw mail_fail("Unexpected response from server"); } } } void imap_cb::check_status(char *recvbuf) { char *reply; reply = strstr(recvbuf, " (MESSAGES "); if ((reply == nullptr) || strlen(reply) < 2) { throw mail_fail("Unexpected response from server"); } reply += 2; *strchr(reply, ')') = '\0'; std::lock_guard lock(result_mutex); if (sscanf(reply, "MESSAGES %lu UNSEEN %lu", &result.messages, &result.unseen) != 2) { throw mail_fail(std::string("Error parsing response: ") + recvbuf); } } void imap_cb::unseen_command(unsigned long old_unseen, unsigned long old_messages) { if (!get().empty() && (result.unseen > old_unseen || (result.messages > old_messages && result.unseen > 0)) && system(get().c_str()) == -1) { perror("system()"); } } void imap_cb::work() { int sockfd, numbytes; char recvbuf[MAXDATASIZE]; unsigned long old_unseen = ULONG_MAX; unsigned long old_messages = ULONG_MAX; bool has_idle = false; while (fail < retries) { struct timeval fetchtimeout {}; int res; fd_set fdset; if (ai == nullptr) { resolve_host(); } try { sockfd = connect(); command(sockfd, "", recvbuf, "* OK"); command(sockfd, "abc CAPABILITY\r\n", recvbuf, "abc OK"); if (strstr(recvbuf, " IDLE ") != nullptr) { has_idle = true; } std::ostringstream str; str << "a1 login " << get() << " {" << get().length() << "}\r\n"; command(sockfd, str.str(), recvbuf, "+"); command(sockfd, get() + "\r\n", recvbuf, "a1 OK"); command(sockfd, "a2 STATUS \"" + get() + "\" (MESSAGES UNSEEN)\r\n", recvbuf, "a2 OK"); check_status(recvbuf); unseen_command(old_unseen, old_messages); fail = 0; old_unseen = result.unseen; old_messages = result.messages; if (!has_idle) { try { command(sockfd, "a3 LOGOUT\r\n", recvbuf, "a3 OK"); } catch (mail_fail &e) { NORM_ERR("Error while communicating with IMAP server: %s", e.what()); } close(sockfd); return; } command(sockfd, "a4 SELECT \"" + get() + "\"\r\n", recvbuf, "a4 OK"); command(sockfd, "a5 IDLE\r\n", recvbuf, "+ idling"); recvbuf[0] = '\0'; while (1) { /* * RFC 2177 says we have to re-idle every 29 minutes. * We'll do it every 20 minutes to be safe. */ fetchtimeout.tv_sec = 1200; fetchtimeout.tv_usec = 0; DBGP2("idling..."); FD_ZERO(&fdset); FD_SET(sockfd, &fdset); FD_SET(donefd(), &fdset); res = select(std::max(sockfd, donefd()) + 1, &fdset, nullptr, nullptr, &fetchtimeout); if ((res == -1 && errno == EINTR) || FD_ISSET(donefd(), &fdset)) { try { command(sockfd, "DONE\r\n", recvbuf, "a5 OK"); command(sockfd, "a3 LOGOUT\r\n", recvbuf, "a3 OK"); } catch (mail_fail &e) { NORM_ERR("Error while communicating with IMAP server: %s", e.what()); } close(sockfd); return; } if (res > 0) { if ((numbytes = recv(sockfd, recvbuf, MAXDATASIZE - 1, 0)) == -1) { throw mail_fail("recv idling"); } } else { throw mail_fail(""); } recvbuf[numbytes] = '\0'; DBGP2("imap_thread() received: %s", recvbuf); unsigned long messages, recent = 0; bool force_check = 0; if (strlen(recvbuf) > 2) { char *buf = recvbuf; buf = strstr(buf, "EXISTS"); while ((buf != nullptr) && strlen(buf) > 1 && (strstr(buf + 1, "EXISTS") != nullptr)) { buf = strstr(buf + 1, "EXISTS"); } if (buf != nullptr) { // back up until we reach '*' while (buf >= recvbuf && buf < (recvbuf + MAXDATASIZE) - 1 && buf[0] != '*') { buf--; } if (sscanf(buf, "* %lu EXISTS\r\n", &messages) == 1) { std::lock_guard lock(result_mutex); if (result.messages != messages) { force_check = 1; result.messages = messages; } } } buf = recvbuf; buf = strstr(buf, "RECENT"); while ((buf != nullptr) && strlen(buf) > 1 && (strstr(buf + 1, "RECENT") != nullptr)) { buf = strstr(buf + 1, "RECENT"); } if (buf != nullptr) { // back up until we reach '*' while (buf >= recvbuf && buf < (recvbuf + MAXDATASIZE) - 1 && buf[0] != '*') { buf--; } if (sscanf(buf, "* %lu RECENT\r\n", &recent) != 1) { recent = 0; } } } /* check if we got a BYE from server */ if (strstr(recvbuf, "* BYE") != nullptr) { // need to re-connect throw mail_fail(""); } /* * check if we got a FETCH from server, recent was * something other than 0, or we had a timeout */ if (recent > 0 || (strstr(recvbuf, " FETCH ") != nullptr) || fetchtimeout.tv_sec == 0 || force_check) { // re-check messages and unseen command(sockfd, "DONE\r\n", recvbuf, "a5 OK"); command( sockfd, "a2 STATUS \"" + get() + "\" (MESSAGES UNSEEN)\r\n", recvbuf, "a2 OK"); check_status(recvbuf); command(sockfd, "a5 IDLE\r\n", recvbuf, "+ idling"); } unseen_command(old_unseen, old_messages); fail = 0; old_unseen = result.unseen; old_messages = result.messages; } } catch (mail_fail &e) { if (sockfd != -1) { close(sockfd); } freeaddrinfo(ai); ai = nullptr; ++fail; if (*e.what() != 0) { NORM_ERR("Error while communicating with IMAP server: %s", e.what()); } NORM_ERR("Trying IMAP connection again for %s@%s (try %u/%u)", get().c_str(), get().c_str(), fail + 1, retries); sleep(fail); /* sleep more for the more failures we have */ } if (is_done()) { return; } } } void print_imap_unseen(struct text_object *obj, char *p, unsigned int p_max_size) { auto *mail = static_cast(obj->data.opaque); if (mail == nullptr) { return; } auto cb = conky::register_cb(mail->period, *mail, mail->retries); snprintf(p, p_max_size, "%lu", cb->get_result_copy().unseen); } void print_imap_messages(struct text_object *obj, char *p, unsigned int p_max_size) { auto *mail = static_cast(obj->data.opaque); if (mail == nullptr) { return; } auto cb = conky::register_cb(mail->period, *mail, mail->retries); snprintf(p, p_max_size, "%lu", cb->get_result_copy().messages); } void pop3_cb::work() { int sockfd; char recvbuf[MAXDATASIZE]; char *reply; unsigned long old_unseen = ULONG_MAX; while (fail < retries) { if (ai == nullptr) { resolve_host(); } try { sockfd = connect(); command(sockfd, "", recvbuf, "+OK "); command(sockfd, "USER " + get() + "\r\n", recvbuf, "+OK "); command(sockfd, "PASS " + get() + "\r\n", recvbuf, "+OK "); command(sockfd, "STAT\r\n", recvbuf, "+OK "); // now we get the data reply = recvbuf + 4; { std::lock_guard lock(result_mutex); sscanf(reply, "%lu %lu", &result.unseen, &result.used); } command(sockfd, "QUIT\r\n", recvbuf, "+OK"); if (get().length() > 1 && result.unseen > old_unseen && system(get().c_str()) == -1) { perror("system()"); } fail = 0; return; } catch (mail_fail &e) { if (sockfd != -1) { close(sockfd); } freeaddrinfo(ai); ai = nullptr; ++fail; if (*e.what() != 0) { NORM_ERR("Error while communicating with POP3 server: %s", e.what()); } NORM_ERR("Trying POP3 connection again for %s@%s (try %u/%u)", get().c_str(), get().c_str(), fail + 1, retries); sleep(fail); /* sleep more for the more failures we have */ } if (is_done()) { return; } } } void print_pop3_unseen(struct text_object *obj, char *p, unsigned int p_max_size) { auto *mail = static_cast(obj->data.opaque); if (mail == nullptr) { return; } auto cb = conky::register_cb(mail->period, *mail, mail->retries); snprintf(p, p_max_size, "%lu", cb->get_result_copy().unseen); } void print_pop3_used(struct text_object *obj, char *p, unsigned int p_max_size) { auto *mail = static_cast(obj->data.opaque); if (mail == nullptr) { return; } auto cb = conky::register_cb(mail->period, *mail, mail->retries); snprintf(p, p_max_size, "%.1f", cb->get_result_copy().used / 1024.0 / 1024.0); } conky-1.12.2/src/mail.h000066400000000000000000000050131404127277500146120ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _MAIL_H #define _MAIL_H #include "setting.hh" void parse_local_mail_args(struct text_object *, const char *); #define PRINT_MAILS_PROTO_GENERATOR(x) \ void print_##x##mails(struct text_object *, char *, unsigned int); PRINT_MAILS_PROTO_GENERATOR() PRINT_MAILS_PROTO_GENERATOR(new_) PRINT_MAILS_PROTO_GENERATOR(seen_) PRINT_MAILS_PROTO_GENERATOR(unseen_) PRINT_MAILS_PROTO_GENERATOR(flagged_) PRINT_MAILS_PROTO_GENERATOR(unflagged_) PRINT_MAILS_PROTO_GENERATOR(forwarded_) PRINT_MAILS_PROTO_GENERATOR(unforwarded_) PRINT_MAILS_PROTO_GENERATOR(replied_) PRINT_MAILS_PROTO_GENERATOR(unreplied_) PRINT_MAILS_PROTO_GENERATOR(draft_) PRINT_MAILS_PROTO_GENERATOR(trashed_) void free_local_mails(struct text_object *obj); void parse_global_imap_mail_args(const char *); void parse_global_pop3_mail_args(const char *); void parse_imap_mail_args(struct text_object *, const char *); void parse_pop3_mail_args(struct text_object *, const char *); void free_mail_obj(struct text_object *); void print_imap_unseen(struct text_object *, char *, unsigned int); void print_imap_messages(struct text_object *, char *, unsigned int); void print_pop3_unseen(struct text_object *, char *, unsigned int); void print_pop3_used(struct text_object *, char *, unsigned int); namespace priv { class current_mail_spool_setting : public conky::simple_config_setting { typedef conky::simple_config_setting Base; protected: virtual std::pair do_convert(lua::state &l, int index); public: current_mail_spool_setting() : Base("current_mail_spool", "$MAIL", true) {} }; } // namespace priv extern priv::current_mail_spool_setting current_mail_spool; #endif /* _MAIL_H */ conky-1.12.2/src/main.cc000066400000000000000000000260071404127277500147600ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include "build.h" #include "config.h" #include "conky.h" #include "lua-config.hh" #ifdef BUILD_X11 #include "x11.h" #endif /* BUILD_X11 */ #ifdef BUILD_CURL #include "ccurl_thread.h" #endif /* BUILD_CURL */ #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include "freebsd.h" #endif /* FreeBSD */ #ifdef BUILD_BUILTIN_CONFIG #include "defconfig.h" #ifdef BUILD_OLD_CONFIG #include "convertconf.h" #endif /* BUILD_OLD_CONFIG */ #endif /* BUILD_BUILTIN_CONFIG */ static void print_version() { std::cout << _(PACKAGE_NAME " " VERSION " compiled " BUILD_DATE " for " BUILD_ARCH "\n" "\nCompiled in features:\n\n" "System config file: " SYSTEM_CONFIG_FILE "\n" "Package library path: " PACKAGE_LIBDIR "\n\n") << _("\n General:\n") #ifdef HAVE_OPENMP << _(" * OpenMP\n") #endif /* HAVE_OPENMP */ #ifdef BUILD_MATH << _(" * math\n") #endif /* BUILD_MATH */ #ifdef BUILD_HDDTEMP << _(" * hddtemp\n") #endif /* BUILD_HDDTEMP */ #ifdef BUILD_PORT_MONITORS << _(" * portmon\n") #endif /* BUILD_PORT_MONITORS */ #ifdef BUILD_HTTP << _(" * HTTP\n") #endif /* BUILD_HTTP */ #ifdef BUILD_IPV6 << _(" * IPv6\n") #endif /* BUILD_IPV6 */ #ifdef BUILD_IRC << _(" * IRC\n") #endif #ifdef BUILD_CURL << _(" * Curl\n") #endif /* BUILD_CURL */ #ifdef BUILD_RSS << _(" * RSS\n") #endif /* BUILD_RSS */ #ifdef BUILD_ICAL << _(" * ICal\n") #endif /* BUILD_ICAL */ #ifdef BUILD_ICONV << _(" * iconv\n") #endif /* BUILD_ICONV */ #ifdef BUILD_MYSQL << _(" * MySQL\n") #endif /* BUILD_MYSQL */ #ifdef BUILD_WEATHER_METAR << _(" * Weather (METAR)\n") #endif /* BUILD_WEATHER_METAR */ #ifdef BUILD_WLAN << _(" * wireless\n") #endif /* BUILD_WLAN */ #ifdef BUILD_IBM << _(" * support for IBM/Lenovo notebooks\n") #endif /* BUILD_IBM */ #ifdef BUILD_NVIDIA << _(" * nvidia\n") #endif /* BUILD_NVIDIA */ #ifdef BUILD_BUILTIN_CONFIG << _(" * builtin default configuration\n") #endif /* BUILD_BUILTIN_CONFIG */ #ifdef BUILD_OLD_CONFIG << _(" * old configuration syntax\n") #endif /* BUILD_OLD_CONFIG */ #ifdef BUILD_IMLIB2 << _(" * Imlib2\n") #endif /* BUILD_IMLIB2 */ #ifdef HAVE_SOME_SOUNDCARD_H << _(" * OSS mixer support\n") #endif /* HAVE_SOME_SOUNDCARD_H */ #ifdef BUILD_MIXER_ALSA << _(" * ALSA mixer support\n") #endif /* BUILD_MIXER_ALSA */ #ifdef BUILD_APCUPSD << _(" * apcupsd\n") #endif /* BUILD_APCUPSD */ #ifdef BUILD_IOSTATS << _(" * iostats\n") #endif /* BUILD_IOSTATS */ #ifdef BUILD_NCURSES << _(" * ncurses\n") #endif /* BUILD_NCURSES */ #ifdef BUILD_I18N << _(" * Internationalization support\n") #endif #ifdef BUILD_PULSEAUDIO << _(" * PulseAudio\n") #endif /* BUIL_PULSEAUDIO */ #ifdef DEBUG << _(" * Debugging extensions\n") #endif #if defined BUILD_LUA_CAIRO || defined BUILD_LUA_IMLIB2 || BUILD_LUA_RSVG << _("\n Lua bindings:\n") #endif #ifdef BUILD_LUA_CAIRO << _(" * Cairo\n") #endif /* BUILD_LUA_CAIRO */ #ifdef BUILD_LUA_IMLIB2 << _(" * Imlib2\n") #endif /* BUILD_LUA_IMLIB2 */ #ifdef BUILD_LUA_RSVG << _(" * RSVG\n") #endif /* BUILD_LUA_RSVG */ #ifdef BUILD_X11 << _(" X11:\n") #ifdef BUILD_XDAMAGE << _(" * Xdamage extension\n") #endif /* BUILD_XDAMAGE */ #ifdef BUILD_XINERAMA << _(" * Xinerama extension (virtual display)\n") #endif /* BUILD_XINERAMA */ #ifdef BUILD_XSHAPE << _(" * Xshape extension (click through)\n") #endif /* BUILD_XSHAPE */ #ifdef BUILD_XDBE << _(" * XDBE (double buffer extension)\n") #endif /* BUILD_XDBE */ #ifdef BUILD_XFT << _(" * Xft\n") #endif /* BUILD_XFT */ #ifdef BUILD_ARGB << _(" * ARGB visual\n") #endif /* BUILD_ARGB */ #ifdef OWN_WINDOW << _(" * Own window\n") #endif #endif /* BUILD_X11 */ #ifdef BUILD_HSV_GRADIENT << _(" * HSV Gradient\n") #endif /* BUILD_HSV_GRADIENT */ #if defined BUILD_AUDACIOUS || defined BUILD_CMUS || defined BUILD_MPD || \ defined BUILD_MOC || defined BUILD_XMMS2 << _("\n Music detection:\n") #endif #ifdef BUILD_AUDACIOUS << _(" * Audacious\n") #endif /* BUILD_AUDACIOUS */ #ifdef BUILD_CMUS << _(" * CMUS\n") #endif /* BUILD_CMUS */ #ifdef BUILD_MPD << _(" * MPD\n") #endif /* BUILD_MPD */ #ifdef BUILD_MOC << _(" * MOC\n") #endif /* BUILD_MOC */ #ifdef BUILD_XMMS2 << _(" * XMMS2\n") #endif /* BUILD_XMMS2 */ << _("\n Default values:\n") << " * Netdevice: " DEFAULTNETDEV "\n" << " * Local configfile: " CONFIG_FILE "\n" #ifdef BUILD_I18N << " * Localedir: " LOCALE_DIR "\n" #endif /* BUILD_I18N */ #ifdef BUILD_HTTP << " * HTTP-port: " << HTTPPORT << "\n" #endif /* BUILD_HTTP */ << " * Maximum netdevices: " << MAX_NET_INTERFACES << "\n" << " * Maximum text size: " << MAX_USER_TEXT_DEFAULT << "\n" << " * Size text buffer: " << DEFAULT_TEXT_BUFFER_SIZE << "\n"; } static void print_help(const char *prog_name) { printf("Usage: %s [OPTION]...\n" PACKAGE_NAME " is a system monitor that renders text on desktop or to own " "transparent\n" "window. Command line options will override configurations defined in " "config\n" "file.\n" " -v, --version version\n" " -q, --quiet quiet mode\n" " -D, --debug increase debugging output, ie. -DD for " "more debugging\n" " -c, --config=FILE config file to load\n" #ifdef BUILD_BUILTIN_CONFIG " -C, --print-config print the builtin default config to " "stdout\n" " e.g. 'conky -C > ~/.conkyrc' will " "create a new default config\n" #endif " -d, --daemonize daemonize, fork to background\n" " -h, --help help\n" #ifdef BUILD_X11 " -a, --alignment=ALIGNMENT text alignment on screen, " "{top,bottom,middle}_{left,right,middle}\n" " -X, --display=DISPLAY X11 display to use\n" " -m, --xinerama-head=N Xinerama monitor index (0=first)\n" " -f, --font=FONT font to use\n" #ifdef OWN_WINDOW " -o, --own-window create own window to draw\n" #endif " -b, --double-buffer double buffer (prevents flickering)\n" " -w, --window-id=WIN_ID window id to draw\n" " -x X x position\n" " -y Y y position\n" #endif /* BUILD_X11 */ " -t, --text=TEXT text to render, remember single quotes, " "like -t '$uptime'\n" " -u, --interval=SECS update interval\n" " -i COUNT number of times to update " PACKAGE_NAME " (and quit)\n" " -p, --pause=SECS pause for SECS seconds at startup " "before doing anything\n", prog_name); } inline void reset_optind() { #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) optind = optreset = 1; #else optind = 0; #endif } int main(int argc, char **argv) { #ifdef BUILD_I18N setlocale(LC_ALL, ""); bindtextdomain(PACKAGE_NAME, LOCALE_DIR); textdomain(PACKAGE_NAME); #endif argc_copy = argc; argv_copy = argv; g_sigterm_pending = 0; g_sighup_pending = 0; g_sigusr2_pending = 0; #ifdef BUILD_CURL struct curl_global_initializer { curl_global_initializer() { if (curl_global_init(CURL_GLOBAL_ALL)) { NORM_ERR( "curl_global_init() failed, you may not be able to use curl " "variables"); } } ~curl_global_initializer() { curl_global_cleanup(); } }; curl_global_initializer curl_global; #endif /* handle command line parameters that don't change configs */ #ifdef BUILD_X11 if (!setlocale(LC_CTYPE, "")) { NORM_ERR("Can't set the specified locale!\nCheck LANG, LC_CTYPE, LC_ALL."); } #endif /* BUILD_X11 */ while (1) { int c = getopt_long(argc, argv, getopt_string, longopts, nullptr); if (c == -1) { break; } switch (c) { case 'D': global_debug_level++; break; case 'v': case 'V': print_version(); return EXIT_SUCCESS; case 'c': current_config = optarg; break; case 'q': if (freopen("/dev/null", "w", stderr) == nullptr) { CRIT_ERR(nullptr, nullptr, "could not open /dev/null as stderr!"); } break; case 'h': print_help(argv[0]); return 0; #ifdef BUILD_BUILTIN_CONFIG case 'C': std::cout << defconfig; return 0; #endif #ifdef BUILD_X11 case 'w': window.window = strtol(optarg, nullptr, 0); break; #endif /* BUILD_X11 */ case '?': return EXIT_FAILURE; } } try { set_current_config(); state = std::make_unique(); conky::export_symbols(*state); setup_inotify(); initialisation(argc, argv); first_pass = 0; /* don't ever call fork() again */ main_loop(); } catch (fork_throw &e) { return EXIT_SUCCESS; } catch (unknown_arg_throw &e) { return EXIT_FAILURE; } catch (obj_create_error &e) { std::cerr << e.what() << std::endl; clean_up(nullptr, nullptr); return EXIT_FAILURE; } catch (std::exception &e) { std::cerr << PACKAGE_NAME ": " << e.what() << std::endl; return EXIT_FAILURE; } #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) kvm_close(kd); #endif #ifdef LEAKFREE_NCURSES _nc_free_and_exit(0); // hide false memleaks #endif return 0; } conky-1.12.2/src/main.h000066400000000000000000000020311404127277500146110ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _main_h_ #define _main_h_ #endif /* _main_h_ */ conky-1.12.2/src/mboxscan.cc000066400000000000000000000262571404127277500156550ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2006 Marco Candrian * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include #include "conky.h" #include "logging.h" #include "mail.h" #include "text_object.h" #define FROM_WIDTH 10 #define SUBJECT_WIDTH 22 #define PRINT_MAILS 5 #define TIME_DELAY 5 struct ring_list { char *from; char *subject; struct ring_list *previous; struct ring_list *next; }; static time_t last_ctime; /* needed for mutt at least */ static time_t last_mtime; /* not sure what to test: testing both now */ static double last_update; static int args_ok = 0; static int from_width; static int subject_width; static int print_num_mails; static int time_delay; static char mbox_mail_spool[DEFAULT_TEXT_BUFFER_SIZE]; static void mbox_scan(char *args, char *output, size_t max_len) { int i, u, flag; int force_rescan = 0; std::unique_ptr buf_(new char[text_buffer_size.get(*state)]); char *buf = buf_.get(); struct stat statbuf {}; struct ring_list *curr = nullptr, *prev = nullptr, *startlist = nullptr; FILE *fp; /* output was set to 1 after malloc'ing in conky.c */ /* -> being able to test it here for catching SIGUSR1 */ if (output[0] == 1) { force_rescan = 1; output[0] = '\0'; } if ((args_ok == 0) || (force_rescan != 0)) { char *substr = strstr(args, "-n"); if (substr != nullptr) { if (sscanf(substr, "-n %i", &print_num_mails) != 1) { print_num_mails = PRINT_MAILS; } } else { print_num_mails = PRINT_MAILS; } if (print_num_mails < 1) { print_num_mails = 1; } substr = strstr(args, "-t"); if (substr != nullptr) { if (sscanf(substr, "-t %i", &time_delay) != 1) { time_delay = TIME_DELAY; } } else { time_delay = TIME_DELAY; } substr = strstr(args, "-fw"); if (substr != nullptr) { if (sscanf(substr, "-fw %i", &from_width) != 1) { from_width = FROM_WIDTH; } } else { from_width = FROM_WIDTH; } substr = strstr(args, "-sw"); if (substr != nullptr) { if (sscanf(substr, "-sw %i", &subject_width) != 1) { subject_width = SUBJECT_WIDTH; } } else { subject_width = SUBJECT_WIDTH; } /* encapsulated with "'s find first occurrence of " */ if (args[strlen(args) - 1] == '"') { char *start; strncpy(mbox_mail_spool, args, DEFAULT_TEXT_BUFFER_SIZE); start = strchr(mbox_mail_spool, '"') + 1; start[(strrchr(mbox_mail_spool, '"') - start)] = '\0'; strncpy(mbox_mail_spool, start, DEFAULT_TEXT_BUFFER_SIZE); } else { char *copy_args = strndup(args, text_buffer_size.get(*state)); char *tmp = strtok(copy_args, " "); char *start = tmp; while (tmp != nullptr) { tmp = strtok(nullptr, " "); if (tmp != nullptr) { start = tmp; } } if (start != nullptr) { strncpy(mbox_mail_spool, start, DEFAULT_TEXT_BUFFER_SIZE); } free(copy_args); } if (strlen(mbox_mail_spool) < 1) { CRIT_ERR(nullptr, nullptr, "Usage: ${mboxscan [-n ] " "[-fw ] [-sw ] " "[-t mbox]}"); } /* allowing $MAIL in the config */ if (strcmp(mbox_mail_spool, "$MAIL") == 0) { strncpy(mbox_mail_spool, current_mail_spool.get(*state).c_str(), DEFAULT_TEXT_BUFFER_SIZE); } if (stat(mbox_mail_spool, &statbuf) != 0) { CRIT_ERR(nullptr, nullptr, "can't stat %s: %s", mbox_mail_spool, strerror(errno)); } args_ok = 1; /* args-computing necessary only once */ } /* if time_delay not yet reached, then return */ if (current_update_time - last_update < time_delay && (force_rescan == 0)) { return; } last_update = current_update_time; /* mbox still exists? and get stat-infos */ if (stat(mbox_mail_spool, &statbuf) != 0) { NORM_ERR("can't stat %s: %s", mbox_mail_spool, strerror(errno)); output[0] = '\0'; /* delete any output */ return; } /* modification time has not changed, so skip scanning the box */ if (statbuf.st_ctime == last_ctime && statbuf.st_mtime == last_mtime && (force_rescan == 0)) { return; } last_ctime = statbuf.st_ctime; last_mtime = statbuf.st_mtime; /* build up double-linked ring-list to hold data, while scanning down the * mbox */ for (i = 0; i < print_num_mails; i++) { curr = static_cast(malloc(sizeof(struct ring_list))); curr->from = static_cast(malloc(from_width + 1)); curr->subject = static_cast(malloc(subject_width + 1)); curr->from[0] = '\0'; curr->subject[0] = '\0'; if (i == 0) { startlist = curr; } if (i > 0) { curr->previous = prev; prev->next = curr; } prev = curr; } if (startlist == nullptr) { return; } /* connect end to start for an endless loop-ring */ startlist->previous = curr; curr->next = startlist; /* mbox */ fp = fopen(mbox_mail_spool, "re"); if (fp == nullptr) { return; } /* first find a "From " to set it to 0 for header-sarchings */ flag = 1; while (feof(fp) == 0) { if (fgets(buf, text_buffer_size.get(*state), fp) == nullptr) { break; } if (strncmp(buf, "From ", 5) == 0) { curr = curr->next; /* skip until \n */ while (strchr(buf, '\n') == nullptr && (feof(fp) == 0)) { if (fgets(buf, text_buffer_size.get(*state), fp) == nullptr) { break; } } flag = 0; /* in the headers now */ continue; } if (flag == 1) { /* in the body, so skip */ continue; } if (buf[0] == '\n') { /* beyond the headers now (empty line), skip until \n */ /* then search for new mail ("From ") */ while (strchr(buf, '\n') == nullptr && (feof(fp) == 0)) { if (fgets(buf, text_buffer_size.get(*state), fp) == nullptr) { break; } } flag = 1; /* in the body now */ continue; } if ((strncmp(buf, "X-Status: ", 10) == 0) || (strncmp(buf, "Status: R", 9) == 0)) { /* Mail was read or something, so skip that message */ flag = 1; /* search for next From */ curr->subject[0] = '\0'; curr->from[0] = '\0'; /* (will get current again on new 'From ' finding) */ curr = curr->previous; /* Skip until \n */ while (strchr(buf, '\n') == nullptr && (feof(fp) == 0)) { if (fgets(buf, text_buffer_size.get(*state), fp) == nullptr) { break; } } continue; } /* that covers ^From: and ^from: ^From: */ if (strncmp(buf + 1, "rom:", 4) == 0) { i = 0; u = 6; /* no "From: " string needed, so skip */ while (1) { if (buf[u] == '"') { /* no quotes around names */ u++; continue; } /* some are: From: */ if (buf[u] == '<' && i > 1) { curr->from[i] = '\0'; /* skip until \n */ while (strchr(buf, '\n') == nullptr && (feof(fp) == 0)) { if (fgets(buf, text_buffer_size.get(*state), fp) == nullptr) { break; } } break; } if (buf[u] == '\n') { curr->from[i] = '\0'; break; } if (buf[u] == '\0') { curr->from[i] = '\0'; break; } if (i >= from_width) { curr->from[i] = '\0'; /* skip until \n */ while (strchr(buf, '\n') == nullptr && (feof(fp) == 0)) { if (fgets(buf, text_buffer_size.get(*state), fp) == nullptr) { break; } } break; } /* nothing special so just set it */ curr->from[i++] = buf[u++]; } } /* that covers ^Subject: and ^subject: and ^Subjec: */ if (strncmp(buf + 1, "ubject:", 7) == 0) { i = 0; u = 9; /* no "Subject: " string needed, so skip */ while (1) { if (buf[u] == '\n') { curr->subject[i] = '\0'; break; } if (buf[u] == '\0') { curr->subject[i] = '\0'; break; } if (i >= subject_width) { curr->subject[i] = '\0'; /* skip until \n */ while (strchr(buf, '\n') == nullptr && (feof(fp) == 0)) { if (fgets(buf, text_buffer_size.get(*state), fp) == nullptr) { break; } } break; } /* nothing special so just set it */ curr->subject[i++] = buf[u++]; } } } fclose(fp); output[0] = '\0'; i = print_num_mails; while (i != 0) { struct ring_list *tmp; if (curr->from[0] != '\0') { if (i != print_num_mails) { snprintf(buf, text_buffer_size.get(*state), "\nF: %-*s S: %-*s", from_width, curr->from, subject_width, curr->subject); } else { /* first time - no \n in front */ snprintf(buf, text_buffer_size.get(*state), "F: %-*s S: %-*s", from_width, curr->from, subject_width, curr->subject); } } else { snprintf(buf, text_buffer_size.get(*state), "%s", "\n"); } strncat(output, buf, max_len - strlen(output)); tmp = curr->previous; free(curr->from); free(curr->subject); free(curr); curr = tmp; i--; } } struct mboxscan_data { char *args; char *output; }; void parse_mboxscan_arg(struct text_object *obj, const char *arg) { struct mboxscan_data *msd; msd = static_cast(malloc(sizeof(struct mboxscan_data))); memset(msd, 0, sizeof(struct mboxscan_data)); msd->args = strndup(arg, text_buffer_size.get(*state)); msd->output = static_cast(malloc(text_buffer_size.get(*state))); /* if '1' (in mboxscan.c) then there was SIGUSR1, hmm */ msd->output[0] = 1; obj->data.opaque = msd; } void print_mboxscan(struct text_object *obj, char *p, unsigned int p_max_size) { auto *msd = static_cast(obj->data.opaque); if (msd == nullptr) { return; } mbox_scan(msd->args, msd->output, text_buffer_size.get(*state)); snprintf(p, p_max_size, "%s", msd->output); } void free_mboxscan(struct text_object *obj) { auto *msd = static_cast(obj->data.opaque); if (msd == nullptr) { return; } free_and_zero(msd->args); free_and_zero(msd->output); free_and_zero(obj->data.opaque); } conky-1.12.2/src/mboxscan.h000066400000000000000000000024031404127277500155020ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2006 Marco Candrian * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _MBOXSCAN_H_ #define _MBOXSCAN_H_ void parse_mboxscan_arg(struct text_object *, const char *); void print_mboxscan(struct text_object *, char *, unsigned int); void free_mboxscan(struct text_object *); #endif /* _MBOXSCAN_H_ */ conky-1.12.2/src/misc.cc000066400000000000000000000074101404127277500147640ustar00rootroot00000000000000/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- * vim: ts=4 sw=4 noet ai cindent syntax=c * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2010 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include #include #include #include "conky.h" #include "core.h" #include "logging.h" #include "specials.h" #include "text_object.h" static inline void read_file(const char *data, char *buf, const int size) { FILE *fp; memset(buf, 0, size); if (!data) return; fp = fopen(data, "r"); if (fp) { int length; length = fread(buf, 1, size - 1, fp); fclose(fp); buf[length] = '\0'; if (length > 0 && buf[length - 1] == '\n') { buf[length - 1] = '\0'; } } else { buf[0] = '\0'; } } static inline unsigned int file_buffer_size(const char *data, const unsigned int maxsize) { struct stat buf; if (stat(data, &buf)) return maxsize; if (buf.st_size < 0 || buf.st_size > maxsize) return maxsize; if (buf.st_size < 10) return 10; return buf.st_size + 1; } void print_cat(struct text_object *obj, char *p, unsigned int p_max_size) { read_file(obj->data.s, p, p_max_size); } void print_catp(struct text_object *obj, char *p, unsigned int p_max_size) { const unsigned int sz = file_buffer_size(obj->data.s, text_buffer_size.get(*state)); char *buf = new char[sz]; read_file(obj->data.s, buf, sz); evaluate(buf, p, p_max_size); delete[] buf; } void print_startcase(struct text_object *obj, char *p, unsigned int p_max_size) { evaluate(obj->data.s, p, p_max_size); for (unsigned int x = 0, z = 0; x < p_max_size - 1 && p[x]; x++) { if (isspace(p[x])) { z = 0; } else { p[x] = z ? tolower(p[x]) : toupper(p[x]); z++; } } } void print_lowercase(struct text_object *obj, char *p, unsigned int p_max_size) { evaluate(obj->data.s, p, p_max_size); for (unsigned int x = 0; x < p_max_size - 1 && p[x]; x++) p[x] = tolower(p[x]); } void print_uppercase(struct text_object *obj, char *p, unsigned int p_max_size) { evaluate(obj->data.s, p, p_max_size); for (unsigned int x = 0; x < p_max_size - 1 && p[x]; x++) p[x] = toupper(p[x]); } void strip_trailing_whitespace(struct text_object *obj, char *p, unsigned int p_max_size) { evaluate(obj->data.s, p, p_max_size); for (unsigned int x = p_max_size - 2;; x--) { if (p[x] && !isspace(p[x])) { p[x + 1] = '\0'; break; } else if (x == 0) { p[x] = '\0'; break; } } } long long int apply_base_multiplier(const char *s, long long int num) { long long int base = 1024LL; if (*s && (0 == (strcmp(s, "si")))) { base = 1000LL; } return (num * base); } conky-1.12.2/src/misc.h000066400000000000000000000032561404127277500146320ustar00rootroot00000000000000/* -*- mode: c++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- * vim: ts=4 sw=4 noet ai cindent syntax=cpp * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2012 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _MISC_H #define _MISC_H #include "text_object.h" void print_cat(struct text_object *, char *, unsigned int); void print_catp(struct text_object *, char *, unsigned int); void print_startcase(struct text_object *, char *, unsigned int); void print_lowercase(struct text_object *, char *, unsigned int); void print_uppercase(struct text_object *, char *, unsigned int); void strip_trailing_whitespace(struct text_object *, char *, unsigned int); long long apply_base_multiplier(const char *, long long int); #endif /* _MISC_H */ conky-1.12.2/src/mixer.cc000066400000000000000000000072321404127277500151570ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include #include "conky.h" #include "logging.h" #include "specials.h" #include "text_object.h" #ifdef HAVE_LINUX_SOUNDCARD_H #include #else #ifdef __OpenBSD__ #include #else #include #endif /* __OpenBSD__ */ #endif /* HAVE_LINUX_SOUNDCARD_H */ #if defined(__sun) #include #include #endif #define MIXER_DEV "/dev/mixer" static int mixer_fd; static const char *devs[] = SOUND_DEVICE_NAMES; int mixer_init(const char *name) { unsigned int i; if (name == 0 || name[0] == '\0') { name = "vol"; } /* open mixer */ if (mixer_fd <= 0) { mixer_fd = open(MIXER_DEV, O_RDONLY); if (mixer_fd == -1) { NORM_ERR("can't open %s: %s", MIXER_DEV, strerror(errno)); return -1; } } for (i = 0; i < sizeof(devs) / sizeof(const char *); i++) { if (strcasecmp(devs[i], name) == 0) { return i; } } return -1; } static int mixer_get(int i) { static char rep = 0; int val = -1; if (ioctl(mixer_fd, MIXER_READ(i), &val) == -1) { if (!rep) { NORM_ERR("mixer ioctl: %s", strerror(errno)); } rep = 1; return 0; } rep = 0; return val; } static int mixer_get_avg(int i) { int v = mixer_get(i); return ((v >> 8) + (v & 0xFF)) / 2; } static int mixer_get_left(int i) { return mixer_get(i) >> 8; } static int mixer_get_right(int i) { return mixer_get(i) & 0xFF; } int mixer_is_mute(int i) { return !mixer_get(i); } #define mixer_to_255(i, x) x void parse_mixer_arg(struct text_object *obj, const char *arg) { obj->data.l = mixer_init(arg); } uint8_t mixer_percentage(struct text_object *obj) { return mixer_get_avg(obj->data.l); } uint8_t mixerl_percentage(struct text_object *obj) { return mixer_get_left(obj->data.l); } uint8_t mixerr_percentage(struct text_object *obj) { return mixer_get_right(obj->data.l); } int check_mixer_muted(struct text_object *obj) { if (!mixer_is_mute(obj->data.l)) return 0; return 1; } void scan_mixer_bar(struct text_object *obj, const char *arg) { char buf1[64]; int n; if (arg && sscanf(arg, "%63s %n", buf1, &n) >= 1) { obj->data.i = mixer_init(buf1); scan_bar(obj, arg + n, 100); } else { obj->data.i = mixer_init(nullptr); scan_bar(obj, arg, 100); } } double mixer_barval(struct text_object *obj) { return mixer_to_255(obj->data.i, mixer_get_avg(obj->data.i)); } double mixerl_barval(struct text_object *obj) { return mixer_to_255(obj->data.i, mixer_get_left(obj->data.i)); } double mixerr_barval(struct text_object *obj) { return mixer_to_255(obj->data.i, mixer_get_right(obj->data.i)); } conky-1.12.2/src/mixer.h000066400000000000000000000030661404127277500150220ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2007 Toni Spets * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef MIXER_H_ #define MIXER_H_ void parse_mixer_arg(struct text_object *, const char *); uint8_t mixer_percentage(struct text_object *obj); uint8_t mixerl_percentage(struct text_object *obj); uint8_t mixerr_percentage(struct text_object *obj); int check_mixer_muted(struct text_object *); void scan_mixer_bar(struct text_object *, const char *); double mixer_barval(struct text_object *); double mixerl_barval(struct text_object *); double mixerr_barval(struct text_object *); #endif /*MIXER_H_*/ conky-1.12.2/src/moc.cc000066400000000000000000000102041404127277500146020ustar00rootroot00000000000000/* * * MOC Conky integration * * Please see COPYING for details * * Copyright (c) 2008, Henri Häkkinen * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "conky.h" #include "logging.h" #include "text_object.h" #include #include #include #include #include #include "update-cb.hh" namespace { struct moc_result { std::string state; std::string file; std::string title; std::string artist; std::string song; std::string album; std::string totaltime; std::string timeleft; std::string curtime; std::string bitrate; std::string rate; }; class moc_cb : public conky::callback { using Base = conky::callback; protected: void work() override; public: explicit moc_cb(uint32_t period) : Base(period, false, Tuple()) {} }; void moc_cb::work() { moc_result moc; FILE *fp; fp = popen("mocp -i", "r"); if (fp == nullptr) { moc.state = "Can't run 'mocp -i'"; } else { while (1) { char line[100]; char *p; /* Read a line from the pipe and strip the possible '\n'. */ if (fgets(line, 100, fp) == nullptr) { break; } if ((p = strrchr(line, '\n')) != nullptr) { *p = '\0'; } /* Parse infos. */ if (strncmp(line, "State:", 6) == 0) { moc.state = line + 7; } else if (strncmp(line, "File:", 5) == 0) { moc.file = line + 6; } else if (strncmp(line, "Title:", 6) == 0) { moc.title = line + 7; } else if (strncmp(line, "Artist:", 7) == 0) { moc.artist = line + 8; } else if (strncmp(line, "SongTitle:", 10) == 0) { moc.song = line + 11; } else if (strncmp(line, "Album:", 6) == 0) { moc.album = line + 7; } else if (strncmp(line, "TotalTime:", 10) == 0) { moc.totaltime = line + 11; } else if (strncmp(line, "TimeLeft:", 9) == 0) { moc.timeleft = line + 10; } else if (strncmp(line, "CurrentTime:", 12) == 0) { moc.curtime = line + 13; } else if (strncmp(line, "Bitrate:", 8) == 0) { moc.bitrate = line + 9; } else if (strncmp(line, "Rate:", 5) == 0) { moc.rate = line + 6; } } } pclose(fp); std::lock_guard l(result_mutex); result = moc; } } // namespace #define MOC_PRINT_GENERATOR(type, alt) \ void print_moc_##type(struct text_object *obj, char *p, \ unsigned int p_max_size) { \ (void)obj; \ uint32_t period = std::max( \ lround(music_player_interval.get(*state) / active_update_interval()), \ 1l); \ const moc_result &moc = \ conky::register_cb(period)->get_result_copy(); \ snprintf(p, p_max_size, "%s", \ (moc.type.length() ? moc.type.c_str() : (alt))); \ } MOC_PRINT_GENERATOR(state, "??") MOC_PRINT_GENERATOR(file, "no file") MOC_PRINT_GENERATOR(title, "no title") MOC_PRINT_GENERATOR(artist, "no artist") MOC_PRINT_GENERATOR(song, "no song") MOC_PRINT_GENERATOR(album, "no album") MOC_PRINT_GENERATOR(totaltime, "0:00") MOC_PRINT_GENERATOR(timeleft, "0:00") MOC_PRINT_GENERATOR(curtime, "0:00") MOC_PRINT_GENERATOR(bitrate, "0Kbps") MOC_PRINT_GENERATOR(rate, "0KHz") #undef MOC_PRINT_GENERATOR conky-1.12.2/src/moc.h000066400000000000000000000030171404127277500144500ustar00rootroot00000000000000/* * * MOC Conky integration * * Please see COPYING for details * * Copyright (c) 2008, Henri Häkkinen * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef MOC_H_ #define MOC_H_ void print_moc_state(struct text_object *, char *, unsigned int); void print_moc_file(struct text_object *, char *, unsigned int); void print_moc_title(struct text_object *, char *, unsigned int); void print_moc_artist(struct text_object *, char *, unsigned int); void print_moc_song(struct text_object *, char *, unsigned int); void print_moc_album(struct text_object *, char *, unsigned int); void print_moc_totaltime(struct text_object *, char *, unsigned int); void print_moc_timeleft(struct text_object *, char *, unsigned int); void print_moc_curtime(struct text_object *, char *, unsigned int); void print_moc_bitrate(struct text_object *, char *, unsigned int); void print_moc_rate(struct text_object *, char *, unsigned int); #endif /* MOC_H_ */ conky-1.12.2/src/mpd.cc000066400000000000000000000263041404127277500146140ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "mpd.h" #include #include #include "conky.h" #include "libmpdclient.h" #include "logging.h" #include "timeinfo.h" #include "update-cb.hh" namespace { /* this is true if the current host was set from MPD_HOST */ bool mpd_environment_host = false; class mpd_host_setting : public conky::simple_config_setting { using Base = conky::simple_config_setting; protected: void lua_setter(lua::state &l, bool init) override; public: mpd_host_setting() : Base("mpd_host", "localhost", false) {} }; void mpd_host_setting::lua_setter(lua::state &l, bool init) { lua::stack_sentry s(l, -2); if (l.isnil(-2)) { // get the value from environment mpd_environment_host = true; const char *t = getenv("MPD_HOST"); if (t != nullptr) { l.checkstack(1); const char *h = strchr(t, '@'); if (h != nullptr) { if (h[1] != 0) { l.pushstring(h + 1); } } else { l.pushstring(t); } l.replace(-3); } } Base::lua_setter(l, init); ++s; } class mpd_password_setting : public conky::simple_config_setting { using Base = conky::simple_config_setting; protected: void lua_setter(lua::state &l, bool init) override; public: mpd_password_setting() : Base("mpd_password", std::string(), false) {} }; void mpd_password_setting::lua_setter(lua::state &l, bool init) { lua::stack_sentry s(l, -2); /* for security, dont use environment password when user specifies host in * config */ if (l.isnil(-2) && mpd_environment_host) { // get the value from environment const char *t = getenv("MPD_HOST"); if (t != nullptr) { const char *p = strchr(t, '@'); if (p != nullptr) { l.checkstack(1); l.pushstring(t, p - t); l.replace(-3); } } } Base::lua_setter(l, init); ++s; } conky::range_config_setting mpd_port("mpd_port", 1, 65535, 6600, false); mpd_host_setting mpd_host; mpd_password_setting mpd_password; struct mpd_result { float progress{}; int bitrate{}; int elapsed{}; int is_playing{}; int length{}; int vol{}; std::string album; std::string albumartist; std::string artist; std::string comment; std::string date; std::string file; std::string name; std::string random; std::string repeat; std::string status; std::string title; std::string track; }; class mpd_cb : public conky::callback { using Base = conky::callback; mpd_Connection *conn; protected: void work() override; public: explicit mpd_cb(uint32_t period) : Base(period, false, Tuple()), conn(nullptr) {} ~mpd_cb() override { if (conn != nullptr) { mpd_closeConnection(conn); } } }; void mpd_cb::work() { mpd_Status *status; mpd_InfoEntity *entity; mpd_result mpd_info; do { if (conn == nullptr) { conn = mpd_newConnection(mpd_host.get(*state).c_str(), mpd_port.get(*state), 10); } if (static_cast(!mpd_password.get(*state).empty()) != 0u) { mpd_sendPasswordCommand(conn, mpd_password.get(*state).c_str()); mpd_finishCommand(conn); } if (conn->error != 0) { NORM_ERR("MPD error: %s\n", conn->errorStr); mpd_closeConnection(conn); conn = nullptr; mpd_info.status = "MPD not responding"; break; } mpd_sendStatusCommand(conn); if ((status = mpd_getStatus(conn)) == nullptr) { NORM_ERR("MPD error: %s\n", conn->errorStr); mpd_closeConnection(conn); conn = nullptr; mpd_info.status = "MPD not responding"; break; } mpd_finishCommand(conn); if ((conn == nullptr) || (conn->error != 0)) { // fprintf(stderr, "%s\n", conn->errorStr); mpd_closeConnection(conn); conn = nullptr; break; } mpd_info.vol = status->volume; if (status->random == 0) { mpd_info.random = "Off"; } else if (status->random == 1) { mpd_info.random = "On"; } else { mpd_info.random = ""; } if (status->repeat == 0) { mpd_info.repeat = "Off"; } else if (status->repeat == 1) { mpd_info.repeat = "On"; } else { mpd_info.repeat = ""; } /* if (status->error) { printf("error: %s\n", status->error); } */ switch (status->state) { case MPD_STATUS_STATE_PLAY: mpd_info.status = "Playing"; break; case MPD_STATUS_STATE_STOP: mpd_info.status = "Stopped"; break; case MPD_STATUS_STATE_PAUSE: mpd_info.status = "Paused"; break; default: mpd_info.status = ""; break; } if (status->state == MPD_STATUS_STATE_PLAY || status->state == MPD_STATUS_STATE_PAUSE) { mpd_info.is_playing = 1; mpd_info.bitrate = status->bitRate; mpd_info.progress = ((0 != status->totalTime) ? static_cast(status->elapsedTime) / status->totalTime : 0.0); mpd_info.elapsed = status->elapsedTime; mpd_info.length = status->totalTime; } else { mpd_info.progress = 0; mpd_info.is_playing = 0; mpd_info.elapsed = 0; } if (conn->error != 0) { // fprintf(stderr, "%s\n", conn->errorStr); mpd_closeConnection(conn); conn = nullptr; break; } mpd_sendCurrentSongCommand(conn); while ((entity = mpd_getNextInfoEntity(conn)) != nullptr) { mpd_Song *song = entity->info.song; if (entity->type != MPD_INFO_ENTITY_TYPE_SONG) { mpd_freeInfoEntity(entity); continue; } #define SETSTRING(a, b) \ if (b) \ (a) = b; \ else \ (a) = ""; SETSTRING(mpd_info.album, song->album); SETSTRING(mpd_info.albumartist, song->albumartist); SETSTRING(mpd_info.artist, song->artist); SETSTRING(mpd_info.comment, song->comment); SETSTRING(mpd_info.date, song->date); SETSTRING(mpd_info.file, song->file); SETSTRING(mpd_info.name, song->name); SETSTRING(mpd_info.title, song->title); SETSTRING(mpd_info.track, song->track); if (entity != nullptr) { mpd_freeInfoEntity(entity); entity = nullptr; } } mpd_finishCommand(conn); if ((conn != nullptr) && (conn->error != 0)) { // fprintf(stderr, "%s\n", conn->errorStr); mpd_closeConnection(conn); conn = nullptr; break; } if (conn->error != 0) { // fprintf(stderr, "%s\n", conn->errorStr); mpd_closeConnection(conn); conn = nullptr; break; } mpd_freeStatus(status); /* if (conn) { mpd_closeConnection(conn); conn = 0; } */ } while (0); std::lock_guard lock(Base::result_mutex); result = mpd_info; // don't forget to save results! } mpd_result get_mpd() { uint32_t period = std::max( lround(music_player_interval.get(*state) / active_update_interval()), 1l); return conky::register_cb(period)->get_result_copy(); } } // namespace static inline void format_media_player_time(char *buf, const int size, int seconds) { int days, hours, minutes; if (times_in_seconds.get(*state)) { snprintf(buf, size, "%d", seconds); return; } days = seconds / (24 * 60 * 60); seconds %= (24 * 60 * 60); hours = seconds / (60 * 60); seconds %= (60 * 60); minutes = seconds / 60; seconds %= 60; if (days > 0) { snprintf(buf, size, "%i days %i:%02i:%02i", days, hours, minutes, seconds); } else if (hours > 0) { snprintf(buf, size, "%i:%02i:%02i", hours, minutes, seconds); } else { snprintf(buf, size, "%i:%02i", minutes, seconds); } } void print_mpd_elapsed(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; format_media_player_time(p, p_max_size, get_mpd().elapsed); } void print_mpd_length(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; format_media_player_time(p, p_max_size, get_mpd().length); } uint8_t mpd_percentage(struct text_object *obj) { (void)obj; return round_to_positive_int(get_mpd().progress * 100.0f); } double mpd_barval(struct text_object *obj) { (void)obj; return get_mpd().progress; } void print_mpd_smart(struct text_object *obj, char *p, unsigned int p_max_size) { const mpd_result &mpd_info = get_mpd(); int len = obj->data.i; if (len == 0 || static_cast(len) > p_max_size) { len = p_max_size; } memset(p, 0, p_max_size); if ((static_cast(!mpd_info.artist.empty()) != 0u) && (static_cast(!mpd_info.title.empty()) != 0u)) { snprintf(p, len, "%s - %s", mpd_info.artist.c_str(), mpd_info.title.c_str()); } else if (static_cast(!get_mpd().title.empty()) != 0u) { snprintf(p, len, "%s", mpd_info.title.c_str()); } else if (static_cast(!mpd_info.artist.empty()) != 0u) { snprintf(p, len, "%s", mpd_info.artist.c_str()); } else if (static_cast(!mpd_info.file.empty()) != 0u) { snprintf(p, len, "%s", mpd_info.file.c_str()); } else { *p = 0; } } int check_mpd_playing(struct text_object *obj) { (void)obj; return get_mpd().is_playing; } #define MPD_PRINT_GENERATOR(name, fmt, acc) \ void print_mpd_##name(struct text_object *obj, char *p, \ unsigned int p_max_size) { \ if (obj->data.i && (unsigned int)obj->data.i < p_max_size) \ p_max_size = obj->data.i; \ snprintf(p, p_max_size, fmt, get_mpd().name acc); \ } MPD_PRINT_GENERATOR(album, "%s", .c_str()) MPD_PRINT_GENERATOR(albumartist, "%s", .c_str()) MPD_PRINT_GENERATOR(artist, "%s", .c_str()) MPD_PRINT_GENERATOR(bitrate, "%d", ) MPD_PRINT_GENERATOR(comment, "%s", .c_str()) MPD_PRINT_GENERATOR(date, "%s", .c_str()) MPD_PRINT_GENERATOR(file, "%s", .c_str()) MPD_PRINT_GENERATOR(name, "%s", .c_str()) MPD_PRINT_GENERATOR(random, "%s", .c_str()) MPD_PRINT_GENERATOR(repeat, "%s", .c_str()) MPD_PRINT_GENERATOR(status, "%s", .c_str()) MPD_PRINT_GENERATOR(title, "%s", .c_str()) MPD_PRINT_GENERATOR(track, "%s", .c_str()) MPD_PRINT_GENERATOR(vol, "%d", ) #undef MPD_PRINT_GENERATOR conky-1.12.2/src/mpd.h000066400000000000000000000042511404127277500144530ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef MPD_H_ #define MPD_H_ #include /* text object functions */ double mpd_barval(struct text_object *); int check_mpd_playing(struct text_object *); uint8_t mpd_percentage(struct text_object *); void print_mpd_album(struct text_object *, char *, unsigned int); void print_mpd_albumartist(struct text_object *, char *, unsigned int); void print_mpd_artist(struct text_object *, char *, unsigned int); void print_mpd_bitrate(struct text_object *, char *, unsigned int); void print_mpd_comment(struct text_object *, char *, unsigned int); void print_mpd_date(struct text_object *, char *, unsigned int); void print_mpd_elapsed(struct text_object *, char *, unsigned int); void print_mpd_file(struct text_object *, char *, unsigned int); void print_mpd_length(struct text_object *, char *, unsigned int); void print_mpd_name(struct text_object *, char *, unsigned int); void print_mpd_random(struct text_object *, char *, unsigned int); void print_mpd_repeat(struct text_object *, char *, unsigned int); void print_mpd_smart(struct text_object *, char *, unsigned int); void print_mpd_status(struct text_object *, char *, unsigned int); void print_mpd_title(struct text_object *, char *, unsigned int); void print_mpd_track(struct text_object *, char *, unsigned int); void print_mpd_vol(struct text_object *, char *, unsigned int); #endif /*MPD_H_*/ conky-1.12.2/src/mysql.cc000066400000000000000000000054331404127277500152010ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "mysql.h" #include "conky.h" #include "logging.h" #include #include "setting.hh" namespace { conky::simple_config_setting host("mysql_host", "localhost", false); conky::range_config_setting port("mysql_port", 0, 0xffff, 0, false); conky::simple_config_setting user("mysql_user", "root", false); conky::simple_config_setting password("mysql_password", std::string(), false); conky::simple_config_setting db("mysql_db", "mysql", false); } // namespace void mysql_finish(MYSQL *conn, MYSQL_RES *res) { if (nullptr != res) { mysql_free_result(res); } mysql_close(conn); mysql_library_end(); } void print_mysql(struct text_object *obj, char *p, unsigned int p_max_size) { MYSQL *conn = mysql_init(nullptr); MYSQL_RES *res = nullptr; if (conn == nullptr) { NORM_ERR("Can't initialize MySQL"); mysql_library_end(); return; } if (!mysql_real_connect(conn, host.get(*state).c_str(), user.get(*state).c_str(), password.get(*state).c_str(), db.get(*state).c_str(), port.get(*state), nullptr, 0)) { NORM_ERR("MySQL: %s", mysql_error(conn)); mysql_finish(conn, res); return; } if (mysql_query(conn, obj->data.s)) { NORM_ERR("MySQL: %s", mysql_error(conn)); mysql_finish(conn, res); return; } res = mysql_use_result(conn); if (res == nullptr) { NORM_ERR("MySQL: %s", mysql_error(conn)); mysql_finish(conn, res); return; } MYSQL_ROW row = mysql_fetch_row(res); if (row) { snprintf(p, p_max_size, "%s", row[0]); } else { NORM_ERR("MySQL: '%s' returned no results", obj->data.s); } mysql_finish(conn, res); } conky-1.12.2/src/mysql.h000066400000000000000000000017131404127277500150400ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef MYSQL_H_ #define MYSQL_H_ void print_mysql(struct text_object *, char *, unsigned int); #endif /*MYSQL_H_*/ conky-1.12.2/src/nc.cc000066400000000000000000000031111404127277500144230ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include "nc.h" #ifdef BUILD_NCURSES WINDOW *ncurses_window; #endif namespace priv { void out_to_ncurses_setting::lua_setter(lua::state &l, bool init) { lua::stack_sentry s(l, -2); Base::lua_setter(l, init); if (init && do_convert(l, -1).first) { ncurses_window = initscr(); start_color(); } ++s; } void out_to_ncurses_setting::cleanup(lua::state &l) { lua::stack_sentry s(l, -1); if (do_convert(l, -1).first) { endwin(); } l.pop(); } } // namespace priv priv::out_to_ncurses_setting out_to_ncurses; conky-1.12.2/src/nc.h000066400000000000000000000032131404127277500142700ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #if defined(BUILD_NCURSES) && !defined(CONKY_NC_H) #define CONKY_NC_H #include #include "setting.hh" #ifdef LEAKFREE_NCURSES extern "C" { void _nc_free_and_exit(int); } #endif namespace priv { class out_to_ncurses_setting : public conky::simple_config_setting { typedef conky::simple_config_setting Base; protected: virtual void lua_setter(lua::state &l, bool init); virtual void cleanup(lua::state &l); public: out_to_ncurses_setting() : Base("out_to_ncurses", false, false) {} }; } // namespace priv extern priv::out_to_ncurses_setting out_to_ncurses; #endif /* CONKY_NC_H */ conky-1.12.2/src/net_stat.cc000066400000000000000000000433041404127277500156540ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "net_stat.h" #include #include #include #include #include #include #include "conky.h" #include "logging.h" #include "net/if.h" #include "specials.h" #include "text_object.h" #if defined(__sun) #include #endif #if defined(__HAIKU__) #include #define IFF_RUNNING IFF_LINK #endif #ifndef SOCK_CLOEXEC #define SOCK_CLOEXEC O_CLOEXEC #endif /* SOCK_CLOEXEC */ #if defined(__linux__) #include "linux.h" #else static char e_iface[50] = "empty"; static char interfaces_arr[MAX_NET_INTERFACES][64] = {""}; #endif /* __linux__ */ /* network interface stuff */ enum if_up_strictness_ { IFUP_UP, IFUP_LINK, IFUP_ADDR }; template <> conky::lua_traits::Map conky::lua_traits::map = { {"up", IFUP_UP}, {"link", IFUP_LINK}, {"address", IFUP_ADDR}}; static conky::simple_config_setting if_up_strictness( "if_up_strictness", IFUP_UP, true); /** * global array of structs containing network statistics for each interface **/ struct net_stat netstats[MAX_NET_INTERFACES]; struct net_stat foo_netstats; /** * Returns pointer to specified interface in netstats array. * If not found then add the specified interface to the array. * The added interface will have all its members initialized to 0, * because clear_net_stats() is called from main() in conky.cc! * * @param[in] dev device / interface name. Silently ignores char * == nullptr **/ struct net_stat *get_net_stat(const char *dev, void * /*free_at_crash1*/, void * /*free_at_crash2*/) { unsigned int i; if (dev == nullptr) { return nullptr; } /* find interface stat */ for (i = 0; i < MAX_NET_INTERFACES; i++) { if ((netstats[i].dev != nullptr) && strcmp(netstats[i].dev, dev) == 0) { return &netstats[i]; } } /* wasn't found? add it */ for (i = 0; i < MAX_NET_INTERFACES; i++) { if (netstats[i].dev == nullptr) { netstats[i].dev = strndup(dev, text_buffer_size.get(*state)); /* initialize last_read_recv and last_read_trans to -1 denoting * that they were never read before */ netstats[i].last_read_recv = -1; netstats[i].last_read_trans = -1; return &netstats[i]; } } clear_net_stats(&foo_netstats); foo_netstats.dev = strndup(dev, text_buffer_size.get(*state)); /* initialize last_read_recv and last_read_trans to -1 denoting * that they were never read before */ foo_netstats.last_read_recv = -1; foo_netstats.last_read_trans = -1; return &foo_netstats; } void parse_net_stat_arg(struct text_object *obj, const char *arg, void *free_at_crash) { #ifdef BUILD_IPV6 bool shownetmask = false; bool showscope = false; #endif /* BUILD_IPV6 */ char nextarg[21]; // longest arg possible is a devname (max 20 chars) int i = 0; struct net_stat *netstat = nullptr; long int x = 0; unsigned int found = 0; char *arg_ptr = const_cast(arg); char buf[64]; char *buf_ptr = buf; if (arg == nullptr) { arg = DEFAULTNETDEV; } if (0 == (strcmp("$gw_iface", arg)) || 0 == (strcmp("${gw_iface}", arg))) { arg = e_iface; } if (0 == strncmp(arg, "${iface", 7)) { if (nullptr != arg_ptr) { for (; *arg_ptr; arg_ptr++) { if (isdigit(static_cast(*arg_ptr))) { *buf_ptr++ = *arg_ptr; found = 1; } } } if (1U == found) { *buf_ptr = '\0'; x = strtol(buf, (char **)NULL, 10); if (63L > x) { arg = interfaces_arr[x]; } } } while (sscanf(arg + i, " %20s", nextarg) == 1) { #ifdef BUILD_IPV6 if (strcmp(nextarg, "-n") == 0 || strcmp(nextarg, "--netmask") == 0) { shownetmask = true; } else if (strcmp(nextarg, "-s") == 0 || strcmp(nextarg, "--scope") == 0) { showscope = true; } else if (nextarg[0] == '-') { // multiple flags in 1 arg for (int j = 1; nextarg[j] != 0; j++) { if (nextarg[j] == 'n') { shownetmask = true; } if (nextarg[j] == 's') { showscope = true; } } } else { #endif /* BUILD_IPV6 */ netstat = get_net_stat(nextarg, obj, free_at_crash); #ifdef BUILD_IPV6 } #endif /* BUILD_IPV6 */ i += strlen(nextarg); // skip this arg while ( !((isspace(static_cast(arg[i])) != 0) || arg[i] == 0)) { i++; // and skip the spaces in front of it } } if (netstat == nullptr) { netstat = get_net_stat(DEFAULTNETDEV, obj, free_at_crash); } #ifdef BUILD_IPV6 netstat->v6show_nm = shownetmask; netstat->v6show_sc = showscope; #endif /* BUILD_IPV6 */ obj->data.opaque = netstat; } void parse_net_stat_bar_arg(struct text_object *obj, const char *arg, void *free_at_crash) { if (arg != nullptr) { arg = scan_bar(obj, arg, 1); obj->data.opaque = get_net_stat(arg, obj, free_at_crash); } else { // default to DEFAULTNETDEV char *buf = strndup(DEFAULTNETDEV, text_buffer_size.get(*state)); obj->data.opaque = get_net_stat(buf, obj, free_at_crash); free(buf); } } void print_downspeed(struct text_object *obj, char *p, unsigned int p_max_size) { auto *ns = static_cast(obj->data.opaque); if (ns == nullptr) { return; } human_readable(ns->recv_speed, p, p_max_size); } void print_downspeedf(struct text_object *obj, char *p, unsigned int p_max_size) { auto *ns = static_cast(obj->data.opaque); if (ns == nullptr) { return; } spaced_print(p, p_max_size, "%.1f", 8, ns->recv_speed / 1024.0); } void print_upspeed(struct text_object *obj, char *p, unsigned int p_max_size) { auto *ns = static_cast(obj->data.opaque); if (ns == nullptr) { return; } human_readable(ns->trans_speed, p, p_max_size); } void print_upspeedf(struct text_object *obj, char *p, unsigned int p_max_size) { auto *ns = static_cast(obj->data.opaque); if (ns == nullptr) { return; } spaced_print(p, p_max_size, "%.1f", 8, ns->trans_speed / 1024.0); } void print_totaldown(struct text_object *obj, char *p, unsigned int p_max_size) { auto *ns = static_cast(obj->data.opaque); if (ns == nullptr) { return; } human_readable(ns->recv, p, p_max_size); } void print_totalup(struct text_object *obj, char *p, unsigned int p_max_size) { auto *ns = static_cast(obj->data.opaque); if (ns == nullptr) { return; } human_readable(ns->trans, p, p_max_size); } void print_addr(struct text_object *obj, char *p, unsigned int p_max_size) { auto *ns = static_cast(obj->data.opaque); if (ns == nullptr) { return; } if ((ns->addr.sa_data[2] & 255) == 0 && (ns->addr.sa_data[3] & 255) == 0 && (ns->addr.sa_data[4] & 255) == 0 && (ns->addr.sa_data[5] & 255) == 0) { snprintf(p, p_max_size, "%s", "No Address"); } else { snprintf(p, p_max_size, "%u.%u.%u.%u", ns->addr.sa_data[2] & 255, ns->addr.sa_data[3] & 255, ns->addr.sa_data[4] & 255, ns->addr.sa_data[5] & 255); } } #ifdef __linux__ void print_addrs(struct text_object *obj, char *p, unsigned int p_max_size) { struct net_stat *ns = (struct net_stat *)obj->data.opaque; if (!ns) return; if (0 != ns->addrs[0] && strlen(ns->addrs) > 2) { ns->addrs[strlen(ns->addrs) - 2] = 0; /* remove ", " from end of string */ strncpy(p, ns->addrs, p_max_size); } else { strncpy(p, "0.0.0.0", p_max_size); } } #ifdef BUILD_IPV6 void print_v6addrs(struct text_object *obj, char *p, unsigned int p_max_size) { struct net_stat *ns = (struct net_stat *)obj->data.opaque; char tempaddress[INET6_ADDRSTRLEN]; struct v6addr *current_v6 = ns->v6addrs; if (p_max_size == 0) return; if (!ns->v6addrs) { snprintf(p, p_max_size, "%s", "No Address"); return; } *p = 0; while (current_v6) { inet_ntop(AF_INET6, &(current_v6->addr), tempaddress, INET6_ADDRSTRLEN); strncat(p, tempaddress, p_max_size); // netmask if (ns->v6show_nm) { char netmaskstr[5]; // max 5 chars (/128 + null-terminator) snprintf(netmaskstr, sizeof(netmaskstr), "/%u", current_v6->netmask); strncat(p, netmaskstr, p_max_size); } // scope if (ns->v6show_sc) { char scopestr[4]; snprintf(scopestr, sizeof(scopestr), "(%c)", current_v6->scope); strncat(p, scopestr, p_max_size); } // next (or last) address current_v6 = current_v6->next; if (current_v6) strncat(p, ", ", p_max_size); } } #endif /* BUILD_IPV6 */ #endif /* __linux__ */ #ifdef BUILD_X11 /** * This function is called periodically to update the download and upload graphs * * - evaluates argument strings like 'eth0 50,120 #FFFFFF #FF0000 0 -l' * - sets the obj->data.opaque pointer to the interface specified * * @param[out] obj struct which will hold evaluated arguments * @param[in] arg argument string to evaluate **/ void parse_net_stat_graph_arg(struct text_object *obj, const char *arg, void *free_at_crash) { /* scan arguments and get interface name back */ char *buf = nullptr; buf = scan_graph(obj, arg, 0); // default to DEFAULTNETDEV if (buf != nullptr) { obj->data.opaque = get_net_stat(buf, obj, free_at_crash); free(buf); return; } obj->data.opaque = get_net_stat(DEFAULTNETDEV, obj, free_at_crash); } /** * returns the download speed in B/s for the interface referenced by obj * * @param[in] obj struct containing a member data, which is a struct * containing a void * to a net_stat struct **/ double downspeedgraphval(struct text_object *obj) { auto *ns = static_cast(obj->data.opaque); return (ns != nullptr ? ns->recv_speed : 0); } double upspeedgraphval(struct text_object *obj) { auto *ns = static_cast(obj->data.opaque); return (ns != nullptr ? ns->trans_speed : 0); } #endif /* BUILD_X11 */ #ifdef BUILD_WLAN void print_wireless_essid(struct text_object *obj, char *p, unsigned int p_max_size) { struct net_stat *ns = (struct net_stat *)obj->data.opaque; if (!ns) { for (unsigned int i = 0; *(netstats[i].dev) != 0; i++) { if (*(netstats[i].essid) != 0) { snprintf(p, p_max_size, "%s", netstats[i].essid); return; } } return; } snprintf(p, p_max_size, "%s", ns->essid); } void print_wireless_mode(struct text_object *obj, char *p, unsigned int p_max_size) { struct net_stat *ns = (struct net_stat *)obj->data.opaque; if (!ns) return; snprintf(p, p_max_size, "%s", ns->mode); } void print_wireless_channel(struct text_object *obj, char *p, unsigned int p_max_size) { struct net_stat *ns = (struct net_stat *)obj->data.opaque; if (!ns) return; if (ns->channel != 0) { snprintf(p, p_max_size, "%i", ns->channel); } else { snprintf(p, p_max_size, "%s", "/"); } } void print_wireless_frequency(struct text_object *obj, char *p, unsigned int p_max_size) { struct net_stat *ns = (struct net_stat *)obj->data.opaque; if (!ns) return; if (ns->freq[0] != 0) { snprintf(p, p_max_size, "%s", ns->freq); } else { snprintf(p, p_max_size, "/"); } } void print_wireless_bitrate(struct text_object *obj, char *p, unsigned int p_max_size) { struct net_stat *ns = (struct net_stat *)obj->data.opaque; if (!ns) return; snprintf(p, p_max_size, "%s", ns->bitrate); } void print_wireless_ap(struct text_object *obj, char *p, unsigned int p_max_size) { struct net_stat *ns = (struct net_stat *)obj->data.opaque; if (!ns) return; snprintf(p, p_max_size, "%s", ns->ap); } void print_wireless_link_qual(struct text_object *obj, char *p, unsigned int p_max_size) { struct net_stat *ns = (struct net_stat *)obj->data.opaque; if (!ns) return; spaced_print(p, p_max_size, "%d", 4, ns->link_qual); } void print_wireless_link_qual_max(struct text_object *obj, char *p, unsigned int p_max_size) { struct net_stat *ns = (struct net_stat *)obj->data.opaque; if (!ns) return; spaced_print(p, p_max_size, "%d", 4, ns->link_qual_max); } void print_wireless_link_qual_perc(struct text_object *obj, char *p, unsigned int p_max_size) { struct net_stat *ns = (struct net_stat *)obj->data.opaque; if (!ns) return; if (ns->link_qual_max > 0) { spaced_print(p, p_max_size, "%.0f", 5, (double)ns->link_qual / ns->link_qual_max * 100); } else { spaced_print(p, p_max_size, "unk", 5); } } double wireless_link_barval(struct text_object *obj) { struct net_stat *ns = (struct net_stat *)obj->data.opaque; if (!ns) return 0; return (double)ns->link_qual / ns->link_qual_max; } #endif /* BUILD_WLAN */ /** * Clears the global array of net_stat structs which contains networks * statistics for every interface. **/ void clear_net_stats() { #ifdef BUILD_IPV6 struct v6addr *nextv6; #endif /* BUILD_IPV6 */ int i; for (i = 0; i < MAX_NET_INTERFACES; i++) { free_and_zero(netstats[i].dev); #ifdef BUILD_IPV6 while (netstats[i].v6addrs) { nextv6 = netstats[i].v6addrs; netstats[i].v6addrs = netstats[i].v6addrs->next; free_and_zero(nextv6); } #endif /* BUILD_IPV6 */ } memset(netstats, 0, sizeof(netstats)); } void clear_net_stats(net_stat *in) { #ifdef BUILD_IPV6 struct v6addr *nextv6; #endif /* BUILD_IPV6 */ free_and_zero(in->dev); #ifdef BUILD_IPV6 while (in->v6addrs) { nextv6 = in->v6addrs; in->v6addrs = in->v6addrs->next; free_and_zero(nextv6); } #endif /* BUILD_IPV6 */ } void parse_if_up_arg(struct text_object *obj, const char *arg) { obj->data.opaque = strndup(arg, text_buffer_size.get(*state)); } void free_if_up(struct text_object *obj) { free_and_zero(obj->data.opaque); } /* We should check if this is ok with OpenBSD and NetBSD as well. */ int interface_up(struct text_object *obj) { int fd; struct ifreq ifr {}; auto *dev = static_cast(obj->data.opaque); if (dev == nullptr) { return 0; } #if defined(__APPLE__) && defined(__MACH__) if ((fd = socket(PF_INET, SOCK_DGRAM, 0)) < 0) { #else if ((fd = socket(PF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0) { #endif CRIT_ERR(nullptr, nullptr, "could not create sockfd"); return 0; } strncpy(ifr.ifr_name, dev, IFNAMSIZ); if (ioctl(fd, SIOCGIFFLAGS, &ifr) != 0) { /* if device does not exist, treat like not up */ if (errno != ENODEV && errno != ENXIO) { perror("SIOCGIFFLAGS"); } goto END_FALSE; } if ((ifr.ifr_flags & IFF_UP) == 0) { /* iface is not up */ goto END_FALSE; } if (if_up_strictness.get(*state) == IFUP_UP) { goto END_TRUE; } #ifdef IFF_RUNNING if ((ifr.ifr_flags & IFF_RUNNING) == 0) { goto END_FALSE; } #endif if (if_up_strictness.get(*state) == IFUP_LINK) { goto END_TRUE; } if (ioctl(fd, SIOCGIFADDR, &ifr) != 0) { perror("SIOCGIFADDR"); goto END_FALSE; } if ((reinterpret_cast(&(ifr.ifr_addr))) ->sin_addr.s_addr != 0u) { goto END_TRUE; } END_FALSE: close(fd); return 0; END_TRUE: close(fd); return 1; } class _dns_data { public: _dns_data() = default; int nscount{0}; char **ns_list{nullptr}; void reset() { nscount = 0; ns_list = nullptr; } }; static _dns_data dns_data; void free_dns_data(struct text_object *obj) { int i; (void)obj; for (i = 0; i < dns_data.nscount; i++) { free(dns_data.ns_list[i]); } free(dns_data.ns_list); dns_data.reset(); } int update_dns_data() { FILE *fp; char line[256]; // static double last_dns_update = 0.0; /* maybe updating too often causes higher load because of /etc lying on a real FS if (current_update_time - last_dns_update < 10.0) return 0; last_dns_update = current_update_time; */ free_dns_data(nullptr); if ((fp = fopen("/etc/resolv.conf", "re")) == nullptr) { return 0; } while (feof(fp) == 0) { if (fgets(line, 255, fp) == nullptr) { break; } if (strncmp(line, "nameserver ", 11) == 0) { line[strlen(line) - 1] = '\0'; // remove trailing newline dns_data.nscount++; dns_data.ns_list = static_cast( realloc(dns_data.ns_list, dns_data.nscount * sizeof(char *))); dns_data.ns_list[dns_data.nscount - 1] = strndup(line + 11, text_buffer_size.get(*state)); } } fclose(fp); return 0; } void parse_nameserver_arg(struct text_object *obj, const char *arg) { obj->data.l = arg != nullptr ? atoi(arg) : 0; } void print_nameserver(struct text_object *obj, char *p, unsigned int p_max_size) { if (dns_data.nscount > obj->data.l) { snprintf(p, p_max_size, "%s", dns_data.ns_list[obj->data.l]); } } conky-1.12.2/src/net_stat.h000066400000000000000000000114761404127277500155230ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _NET_STAT_H #define _NET_STAT_H #include /* struct in6_addr */ #include /* struct sockaddr */ #include "config.h" #ifdef BUILD_IPV6 struct v6addr { struct in6_addr addr; unsigned int netmask; char scope; struct v6addr *next; }; #endif /* BUILD_IPV6 */ struct net_stat { /* interface name, e.g. wlan0, eth0, ... */ char *dev; /* set to 1, if interface is up */ int up; /* network traffic read on last call in order to calculate how much * was received or transmitted since the last call. contains -1 if * it was never read before. in bytes */ long long last_read_recv, last_read_trans; /* total received and transmitted data statistics in bytes */ long long recv, trans; /* averaged network speed in bytes / second */ double recv_speed, trans_speed; /* struct with at least the member sa_data which is a const * containing * the socket address. * @see http://pubs.opengroup.org/onlinepubs/7908799/xns/syssocket.h.html */ struct sockaddr addr; #ifdef BUILD_IPV6 struct v6addr *v6addrs; bool v6show_nm; bool v6show_sc; #endif /* BUILD_IPV6 */ #if defined(__linux__) char addrs[17 * MAX_NET_INTERFACES + 1]; #endif /* __linux__ */ /* network speeds between two conky calls in bytes per second. * An average over these samples is calculated in recv_speed and * trans_speed */ double net_rec[15], net_trans[15]; // wireless extensions char essid[35]; int channel; char freq[16]; char bitrate[16]; char mode[16]; int link_qual; int link_qual_max; char ap[18]; }; extern struct net_stat netstats[]; struct net_stat *get_net_stat(const char *, void *, void *); void parse_net_stat_arg(struct text_object *, const char *, void *); void parse_net_stat_bar_arg(struct text_object *, const char *, void *); void print_downspeed(struct text_object *, char *, unsigned int); void print_downspeedf(struct text_object *, char *, unsigned int); void print_upspeed(struct text_object *, char *, unsigned int); void print_upspeedf(struct text_object *, char *, unsigned int); void print_totaldown(struct text_object *, char *, unsigned int); void print_totalup(struct text_object *, char *, unsigned int); void print_addr(struct text_object *, char *, unsigned int); #ifdef __linux__ void print_addrs(struct text_object *, char *, unsigned int); #ifdef BUILD_IPV6 void print_v6addrs(struct text_object *, char *, unsigned int); #endif /* BUILD_IPV6 */ #endif /* __linux__ */ #ifdef BUILD_X11 void parse_net_stat_graph_arg(struct text_object *, const char *, void *); double downspeedgraphval(struct text_object *); double upspeedgraphval(struct text_object *); #endif /* BUILD_X11 */ #ifdef BUILD_WLAN void print_wireless_essid(struct text_object *, char *, unsigned int); void print_wireless_channel(struct text_object *, char *, unsigned int); void print_wireless_frequency(struct text_object *, char *, unsigned int); void print_wireless_mode(struct text_object *, char *, unsigned int); void print_wireless_bitrate(struct text_object *, char *, unsigned int); void print_wireless_ap(struct text_object *, char *, unsigned int); void print_wireless_link_qual(struct text_object *, char *, unsigned int); void print_wireless_link_qual_max(struct text_object *, char *, unsigned int); void print_wireless_link_qual_perc(struct text_object *, char *, unsigned int); double wireless_link_barval(struct text_object *); #endif /* BUILD_WLAN */ void clear_net_stats(void); void clear_net_stats(net_stat *); void parse_if_up_arg(struct text_object *, const char *); int interface_up(struct text_object *); void free_if_up(struct text_object *); void free_dns_data(struct text_object *); int update_dns_data(void); void parse_nameserver_arg(struct text_object *, const char *); void print_nameserver(struct text_object *, char *, unsigned int); #endif /* _NET_STAT_H */ conky-1.12.2/src/netbsd.cc000066400000000000000000000202461404127277500153120ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "netbsd.h" #include "net_stat.h" static kvm_t *kd = nullptr; int kd_init = 0, nkd_init = 0; u_int32_t sensvalue; char errbuf[_POSIX2_LINE_MAX]; static int init_kvm(void) { if (kd_init) { return 0; } kd = kvm_openfiles(nullptr, NULL, NULL, KVM_NO_FILES, errbuf); if (kd == nullptr) { warnx("cannot kvm_openfiles: %s", errbuf); return -1; } kd_init = 1; return 0; } static int swapmode(int *retavail, int *retfree) { int n; struct swapent *sep; *retavail = 0; *retfree = 0; n = swapctl(SWAP_NSWAP, 0, 0); if (n < 1) { warn("could not get swap information"); return 0; } sep = (struct swapent *)malloc(n * (sizeof(*sep))); if (sep == nullptr) { warn("memory allocation failed"); return 0; } if (swapctl(SWAP_STATS, (void *)sep, n) < n) { warn("could not get swap stats"); return 0; } for (; n > 0; n--) { *retavail += (int)dbtob(sep[n - 1].se_nblks); *retfree += (int)dbtob(sep[n - 1].se_nblks - sep[n - 1].se_inuse); } *retavail = (int)(*retavail / 1024); *retfree = (int)(*retfree / 1024); return 1; } void prepare_update() {} void update_uptime() { int mib[2] = {CTL_KERN, KERN_BOOTTIME}; struct timeval boottime; time_t now; int size = sizeof(boottime); if ((sysctl(mib, 2, &boottime, &size, nullptr, 0) != -1) && (boottime.tv_sec != 0)) { time(&now); info.uptime = now - boottime.tv_sec; } else { warn("could not get uptime"); info.uptime = 0; } } int check_mount(struct text_object *obj) { /* stub */ (void)obj; return 0; } void update_meminfo() { int mib[] = {CTL_VM, VM_UVMEXP2}; int total_pages, inactive_pages, free_pages; int swap_avail, swap_free; const int pagesize = getpagesize(); struct uvmexp_sysctl uvmexp; size_t size = sizeof(uvmexp); if (sysctl(mib, 2, &uvmexp, &size, nullptr, 0) < 0) { warn("could not get memory info"); return; } total_pages = uvmexp.npages; free_pages = uvmexp.free; inactive_pages = uvmexp.inactive; info.memmax = (total_pages * pagesize) >> 10; info.mem = ((total_pages - free_pages - inactive_pages) * pagesize) >> 10; info.memwithbuffers = info.mem; info.memeasyfree = info.memfree = info.memmax - info.mem; info.legacymem = info.mem; if (swapmode(&swap_avail, &swap_free) >= 0) { info.swapmax = swap_avail; info.swap = (swap_avail - swap_free); info.swapfree = swap_free; } } void update_net_stats() { int i; double delta; struct ifnet ifnet; struct ifnet_head ifhead; /* interfaces are in a tail queue */ u_long ifnetaddr; static struct nlist namelist[] = {{"_ifnet"}, {nullptr}}; static kvm_t *nkd; if (!nkd_init) { nkd = kvm_openfiles(nullptr, NULL, NULL, O_RDONLY, errbuf); if (nkd == nullptr) { warnx("cannot kvm_openfiles: %s", errbuf); warnx("maybe you need to setgid kmem this program?"); return; } else if (kvm_nlist(nkd, namelist) != 0) { warn("cannot kvm_nlist"); return; } else { nkd_init = 1; } } if (kvm_read(nkd, (u_long)namelist[0].n_value, (void *)&ifhead, sizeof(ifhead)) < 0) { warn("cannot kvm_read"); return; } /* get delta */ delta = current_update_time - last_update_time; if (delta <= 0.0001) { return; } for (i = 0, ifnetaddr = (u_long)ifhead.tqh_first; ifnet.if_list.tqe_next && i < 16; ifnetaddr = (u_long)ifnet.if_list.tqe_next, i++) { struct net_stat *ns; long long last_recv, last_trans; kvm_read(nkd, (u_long)ifnetaddr, (void *)&ifnet, sizeof(ifnet)); ns = get_net_stat(ifnet.if_xname, nullptr, NULL); ns->up = 1; last_recv = ns->recv; last_trans = ns->trans; if (ifnet.if_ibytes < ns->last_read_recv) { ns->recv += ((long long)4294967295U - ns->last_read_recv) + ifnet.if_ibytes; } else { ns->recv += (ifnet.if_ibytes - ns->last_read_recv); } ns->last_read_recv = ifnet.if_ibytes; if (ifnet.if_obytes < ns->last_read_trans) { ns->trans += ((long long)4294967295U - ns->last_read_trans) + ifnet.if_obytes; } else { ns->trans += (ifnet.if_obytes - ns->last_read_trans); } ns->last_read_trans = ifnet.if_obytes; ns->recv += (ifnet.if_ibytes - ns->last_read_recv); ns->last_read_recv = ifnet.if_ibytes; ns->trans += (ifnet.if_obytes - ns->last_read_trans); ns->last_read_trans = ifnet.if_obytes; ns->recv_speed = (ns->recv - last_recv) / delta; ns->trans_speed = (ns->trans - last_trans) / delta; } } int update_total_processes() { /* It's easier to use kvm here than sysctl */ int n_processes; info.procs = 0; if (init_kvm() < 0) { return; } else { kvm_getproc2(kd, KERN_PROC_ALL, 0, sizeof(struct kinfo_proc2), &n_processes); } info.procs = n_processes; return 0; } void update_running_processes() { struct kinfo_proc2 *p; int n_processes; int i, cnt = 0; info.run_procs = 0; if (init_kvm() < 0) { return; } else { p = kvm_getproc2(kd, KERN_PROC_ALL, 0, sizeof(struct kinfo_proc2), &n_processes); for (i = 0; i < n_processes; i++) { if (p[i].p_stat == LSRUN || p[i].p_stat == LSIDL || p[i].p_stat == LSONPROC) { cnt++; } } } info.run_procs = cnt; } struct cpu_load_struct { unsigned long load[5]; }; struct cpu_load_struct fresh = {{0, 0, 0, 0, 0}}; long cpu_used, oldtotal, oldused; void update_cpu_usage() { long used, total; static u_int64_t cp_time[CPUSTATES]; size_t len = sizeof(cp_time); info.cpu_usage = 0; if (sysctlbyname("kern.cp_time", &cp_time, &len, nullptr, 0) < 0) { warn("cannot get kern.cp_time"); } fresh.load[0] = cp_time[CP_USER]; fresh.load[1] = cp_time[CP_NICE]; fresh.load[2] = cp_time[CP_SYS]; fresh.load[3] = cp_time[CP_IDLE]; fresh.load[4] = cp_time[CP_IDLE]; used = fresh.load[0] + fresh.load[1] + fresh.load[2]; total = fresh.load[0] + fresh.load[1] + fresh.load[2] + fresh.load[3]; if ((total - oldtotal) != 0) { info.cpu_usage = ((double)(used - oldused)) / (double)(total - oldtotal); } else { info.cpu_usage = 0; } oldused = used; oldtotal = total; } void free_cpu(struct text_object *) { /* no-op */ } void update_load_average() { double v[3]; getloadavg(v, 3); info.loadavg[0] = (float)v[0]; info.loadavg[1] = (float)v[1]; info.loadavg[2] = (float)v[2]; } double get_acpi_temperature(int fd) { return -1; } void get_battery_stuff(char *buf, unsigned int n, const char *bat, int item) {} int open_acpi_temperature(const char *name) { return -1; } void get_acpi_ac_adapter(char *p_client_buffer, size_t client_buffer_size, const char *adapter) { (void)adapter; // only linux uses this if (!p_client_buffer || client_buffer_size <= 0) { return; } /* not implemented */ memset(p_client_buffer, 0, client_buffer_size); } /* char *get_acpi_fan() */ void get_acpi_fan(char *p_client_buffer, size_t client_buffer_size) { if (!p_client_buffer || client_buffer_size <= 0) { return; } /* not implemented */ memset(p_client_buffer, 0, client_buffer_size); } int get_entropy_avail(unsigned int *val) { return 1; } int get_entropy_poolsize(unsigned int *val) { return 1; } conky-1.12.2/src/netbsd.h000066400000000000000000000011301404127277500151430ustar00rootroot00000000000000/* */ #ifndef NETBSD_H_ #define NETBSD_H_ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "common.h" #include "conky.h" int get_entropy_avail(unsigned int *); int get_entropy_poolsize(unsigned int *); #endif /*NETBSD_H_*/ conky-1.12.2/src/nvidia.cc000066400000000000000000001110021404127277500152740ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2008 Markus Meissner * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ /* * * Author: * Fonic * * Things to do: * - Move decoding of GPU/MEM freqs to print_nvidia_value() using QUERY_SPECIAL * so that all quirks are located there * - Implement nvs->print_type to allow control over how the value is printed * (int, float, temperature...) * * Showcase (conky.conf): * --==| NVIDIA | ==-- * GPU ${nvidia gpufreq [target_id]}MHz (${nvidia gpufreqmin * [target_id]}-${nvidia gpufreqmax [target_id]}MHz) MEM ${nvidia memfreq * [target_id]}MHz (${nvidia memfreqmin [target_id]}-${nvidia memfreqmax * [target_id]}MHz) MTR ${nvidia mtrfreq [target_id]}MHz (${nvidia mtrfreqmin * [target_id]}-${nvidia mtrfreqmax [target_id]}MHz) PERF Level ${nvidia * perflevel [target_id]} (${nvidia perflevelmin [target_id]}-${nvidia * perflevelmax [target_id]}), Mode: ${nvidia perfmode [target_id]} VRAM * ${nvidia memutil [target_id]}% (${nvidia memused [target_id]}MB/${nvidia * memtotal [target_id]}MB) LOAD GPU ${nvidia gpuutil [target_id]}%, RAM * ${nvidia membwutil [target_id]}%, VIDEO ${nvidia videoutil [target_id]}%, * PCIe ${nvidia pcieutil [target_id]}% TEMP GPU ${nvidia gputemp * [target_id]}°C (${nvidia gputempthreshold [target_id]}°C max.), SYS ${nvidia * ambienttemp [target_id]}°C FAN ${nvidia fanspeed [target_id]} RPM * (${nvidia fanlevel [target_id]}%) * * Miscellaneous: * OPENGL ${nvidia imagequality [target_id]} * GPU ${nvidia modelname [target_id]} * DRIVER ${nvidia driverversion [target_id]} * * --==| NVIDIA Bars |==-- * LOAD ${nvidiabar [height][,width] gpuutil [target_id]} * VRAM ${nvidiabar [height][,width] memutil [target_id]} * RAM ${nvidiabar [height][,width] membwutil [target_id]} * VIDEO ${nvidiabar [height][,width] videoutil [target_id]} * PCIe ${nvidiabar [height][,width] pcieutil [target_id]} * Fan ${nvidiabar [height][,width] fanlevel [target_id]} * TEMP ${nvidiabar [height][,width] gputemp [target_id]} * * --==| NVIDIA Gauge |==-- * LOAD ${nvidiagauge [height][,width] gpuutil [target_id]} * VRAM ${nvidiagauge [height][,width] memutil [target_id]} * RAM ${nvidiagauge [height][,width] membwutil [target_id]} * VIDEO ${nvidiagauge [height][,width] videoutil [target_id]} * PCIe ${nvidiagauge [height][,width] pcieutil [target_id]} * Fan ${nvidiagauge [height][,width] fanlevel [target_id]} * TEMP ${nvidiagauge [height][,width] gputemp [target_id]} * * --==| NVIDIA Graph |==-- (target_id is not optional in this case) * LOAD ${nvidiagraph gpuutil [height][,width] [gradient color 1] [gradient * color 2] [scale] [-t] [-l] target_id} VRAM ${nvidiagraph memutil * [height][,width] [gradient color 1] [gradient color 2] [scale] [-t] [-l] * target_id} RAM ${nvidiagraph membwutil [height][,width] [gradient color 1] * [gradient color 2] [scale] [-t] [-l] target_id} VIDEO ${nvidiagraph videoutil * [height][,width] [gradient color 1] [gradient color 2] [scale] [-t] [-l] * target_id} PCIe ${nvidiagraph pcieutil [height][,width] [gradient color 1] * [gradient color 2] [scale] [-t] [-l] target_id} Fan ${nvidiagraph fanlevel * [height][,width] [gradient color 1] [gradient color 2] [scale] [-t] [-l] * target_id} TEMP ${nvidiagraph gputemp [height][,width] [gradient color 1] * [gradient color 2] [scale] [-t] [-l] target_id} */ #include "nvidia.h" #include #include "NVCtrl/NVCtrl.h" #include "NVCtrl/NVCtrlLib.h" #include "conky.h" #include "logging.h" #include "temphelper.h" #include "x11.h" // Separators for nvidia string parsing // (sample: "perf=0, nvclock=324, nvclockmin=324, nvclockmax=324 ; perf=1, // nvclock=549, nvclockmin=549, nvclockmax=549") #define NV_KVPAIR_SEPARATORS ", ;" #define NV_KEYVAL_SEPARATORS "=" // Module arguments const char *translate_module_argument[] = { "temp", // Temperatures "gputemp", "threshold", "gputempthreshold", "ambient", "ambienttemp", "gpufreq", // GPU frequency "gpufreqcur", "gpufreqmin", "gpufreqmax", "memfreq", // Memory frequency "memfreqcur", "memfreqmin", "memfreqmax", "mtrfreq", // Memory transfer rate frequency "mtrfreqcur", "mtrfreqmin", "mtrfreqmax", "perflevel", // Performance levels "perflevelcur", "perflevelmin", "perflevelmax", "perfmode", "gpuutil", // Load/utilization "membwutil", // NOTE: this is the memory _bandwidth_ utilization, not the // percentage of used/available memory! "videoutil", "pcieutil", "mem", // RAM statistics "memused", "memfree", "memavail", "memmax", "memtotal", "memutil", "memperc", "fanspeed", // Fan/cooler "fanlevel", "imagequality", // Miscellaneous "modelname", "driverversion"}; // Enum for module arguments typedef enum _ARG_ID { ARG_TEMP, ARG_GPU_TEMP, ARG_THRESHOLD, ARG_GPU_TEMP_THRESHOLD, ARG_AMBIENT, ARG_AMBIENT_TEMP, ARG_GPU_FREQ, ARG_GPU_FREQ_CUR, ARG_GPU_FREQ_MIN, ARG_GPU_FREQ_MAX, ARG_MEM_FREQ, ARG_MEM_FREQ_CUR, ARG_MEM_FREQ_MIN, ARG_MEM_FREQ_MAX, ARG_MTR_FREQ, ARG_MTR_FREQ_CUR, ARG_MTR_FREQ_MIN, ARG_MTR_FREQ_MAX, ARG_PERF_LEVEL, ARG_PERF_LEVEL_CUR, ARG_PERF_LEVEL_MIN, ARG_PERF_LEVEL_MAX, ARG_PERF_MODE, ARG_GPU_UTIL, ARG_MEM_BW_UTIL, ARG_VIDEO_UTIL, ARG_PCIE_UTIL, ARG_MEM, ARG_MEM_USED, ARG_MEM_FREE, ARG_MEM_AVAIL, ARG_MEM_MAX, ARG_MEM_TOTAL, ARG_MEM_UTIL, ARG_MEM_PERC, ARG_FAN_SPEED, ARG_FAN_LEVEL, ARG_IMAGEQUALITY, ARG_MODEL_NAME, ARG_DRIVER_VERSION, ARG_UNKNOWN } ARG_ID; // Nvidia query targets const int translate_nvidia_target[] = { NV_CTRL_TARGET_TYPE_X_SCREEN, NV_CTRL_TARGET_TYPE_GPU, NV_CTRL_TARGET_TYPE_FRAMELOCK, NV_CTRL_TARGET_TYPE_VCSC, NV_CTRL_TARGET_TYPE_GVI, NV_CTRL_TARGET_TYPE_COOLER, NV_CTRL_TARGET_TYPE_THERMAL_SENSOR, NV_CTRL_TARGET_TYPE_3D_VISION_PRO_TRANSCEIVER, NV_CTRL_TARGET_TYPE_DISPLAY, }; // Enum for nvidia query targets typedef enum _TARGET_ID { TARGET_SCREEN, TARGET_GPU, TARGET_FRAMELOCK, TARGET_VCSC, TARGET_GVI, TARGET_COOLER, TARGET_THERMAL, TARGET_3DVISION, TARGET_DISPLAY } TARGET_ID; // Nvidia query attributes const int translate_nvidia_attribute[] = { NV_CTRL_GPU_CORE_TEMPERATURE, NV_CTRL_GPU_CORE_THRESHOLD, NV_CTRL_AMBIENT_TEMPERATURE, NV_CTRL_GPU_CURRENT_CLOCK_FREQS, NV_CTRL_GPU_CURRENT_CLOCK_FREQS, NV_CTRL_STRING_PERFORMANCE_MODES, NV_CTRL_STRING_GPU_CURRENT_CLOCK_FREQS, NV_CTRL_GPU_POWER_MIZER_MODE, NV_CTRL_STRING_GPU_UTILIZATION, NV_CTRL_USED_DEDICATED_GPU_MEMORY, 0, NV_CTRL_TOTAL_DEDICATED_GPU_MEMORY, // NOTE: NV_CTRL_TOTAL_GPU_MEMORY would // be better, but returns KB instead of // MB 0, NV_CTRL_THERMAL_COOLER_SPEED, NV_CTRL_THERMAL_COOLER_LEVEL, NV_CTRL_GPU_CURRENT_PERFORMANCE_LEVEL, NV_CTRL_IMAGE_SETTINGS, NV_CTRL_STRING_PRODUCT_NAME, NV_CTRL_STRING_NVIDIA_DRIVER_VERSION, }; // Enum for nvidia query attributes typedef enum _ATTR_ID { ATTR_GPU_TEMP, ATTR_GPU_TEMP_THRESHOLD, ATTR_AMBIENT_TEMP, ATTR_GPU_FREQ, ATTR_MEM_FREQ, ATTR_PERFMODES_STRING, ATTR_FREQS_STRING, ATTR_PERF_MODE, ATTR_UTILS_STRING, ATTR_MEM_USED, ATTR_MEM_FREE, ATTR_MEM_TOTAL, ATTR_MEM_UTIL, ATTR_FAN_SPEED, ATTR_FAN_LEVEL, ATTR_PERF_LEVEL, ATTR_IMAGE_QUALITY, ATTR_MODEL_NAME, ATTR_DRIVER_VERSION, } ATTR_ID; // Enum for query type typedef enum _QUERY_ID { QUERY_VALUE, QUERY_STRING, QUERY_STRING_VALUE, QUERY_SPECIAL } QUERY_ID; // Enum for string token search mode typedef enum _SEARCH_ID { SEARCH_FIRST, SEARCH_LAST, SEARCH_MIN, SEARCH_MAX } SEARCH_ID; // Translate special_type into command string const char *translate_nvidia_special_type[] = { "nvidia", // NONSPECIAL "", // HORIZONTAL_LINE "", // STIPPLED_HR "nvidiabar", // BAR "", // FG "", // BG "", // OUTLINE "", // ALIGNR "", // ALIGNC "nvidiagague", // GAUGE "nvidiagraph", // GRAPH "", // OFFSET "", // VOFFSET "", // SAVE_COORDINATES "", // FONT "", // GOTO "" // TAB }; // Global struct to keep track of queries class nvidia_s { public: nvidia_s() : command(0), arg(0), query(QUERY_VALUE), target(TARGET_SCREEN), attribute(ATTR_GPU_TEMP), token(0), search(SEARCH_FIRST), target_id(0) {} const char *command; const char *arg; QUERY_ID query; TARGET_ID target; ATTR_ID attribute; char *token; SEARCH_ID search; // added new field for GPU id int target_id; }; // Cache by value struct nvidia_c_value { int memtotal = -1; int gputempthreshold = -1; }; // Cache by string struct nvidia_c_string { int nvclockmin = -1; int nvclockmax = -1; int memclockmin = -1; int memclockmax = -1; int memTransferRatemin = -1; int memTransferRatemax = -1; int perfmin = -1; int perfmax = -1; }; static Display *nvdisplay = nullptr; // Maximum number of GPU connected: // For cache default value: choosed a model of direct access to array instead of // list for speed improvement value based on the incoming quad Naples tech // having 256 PCIe lanes available const int MAXNUMGPU = 64; namespace { class nvidia_display_setting : public conky::simple_config_setting { typedef conky::simple_config_setting Base; protected: virtual void lua_setter(lua::state &l, bool init); virtual void cleanup(lua::state &l); public: nvidia_display_setting() : Base("nvidia_display", std::string(), false) {} }; void nvidia_display_setting::lua_setter(lua::state &l, bool init) { lua::stack_sentry s(l, -2); Base::lua_setter(l, init); std::string str = do_convert(l, -1).first; if (!str.empty()) { nvdisplay = XOpenDisplay(str.c_str()); if (nvdisplay == nullptr) { CRIT_ERR(nullptr, NULL, "can't open nvidia display: %s", XDisplayName(str.c_str())); } } ++s; } // namespace void nvidia_display_setting::cleanup(lua::state &l) { lua::stack_sentry s(l, -1); if (nvdisplay && nvdisplay != display) { XCloseDisplay(nvdisplay); nvdisplay = nullptr; } l.pop(); } nvidia_display_setting nvidia_display; } // namespace // Evaluate module parameters and prepare query int set_nvidia_query(struct text_object *obj, const char *arg, unsigned int special_type) { nvidia_s *nvs; int aid; int ilen; // Initialize global struct nvs = new nvidia_s(); obj->data.opaque = nvs; // Added new parameter parsing GPU_ID as 0,1,2,.. // if no GPU_ID parameter then default to 0 nvs->target_id = 0; char *strbuf = strdup(arg); char *p = strrchr(strbuf, ' '); if (p && *(p + 1)) { nvs->target_id = atoi(p + 1); if ((nvs->target_id > 0) || !strcmp(p + 1, "0")) { ilen = strlen(strbuf); ilen = ilen - strlen(p); strbuf[ilen] = 0; arg = strbuf; } } // If the value is negative it is set to 0 if (nvs->target_id < 0) nvs->target_id = 0; // Extract arguments for nvidiabar, etc, and run set_nvidia_query switch (special_type) { case BAR: arg = scan_bar(obj, arg, 100); break; case GRAPH: arg = scan_graph(obj, arg, 100); break; case GAUGE: arg = scan_gauge(obj, arg, 100); break; default: break; } // Return error if no argument // (sometimes scan_graph gets excited and eats the whole string! if (!arg) { free_and_zero(strbuf); return 1; } // Translate parameter to id for (aid = 0; aid < ARG_UNKNOWN; aid++) { if (strcmp(arg, translate_module_argument[aid]) == 0) break; } // free the string buffer after arg is not anymore needed if (strbuf != nullptr) free_and_zero(strbuf); // Save pointers to the arg and command strings for debugging and printing nvs->arg = translate_module_argument[aid]; nvs->command = translate_nvidia_special_type[special_type]; // Evaluate parameter switch (aid) { case ARG_TEMP: // GPU temperature case ARG_GPU_TEMP: nvs->query = QUERY_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_GPU_TEMP; break; case ARG_THRESHOLD: // GPU temperature threshold case ARG_GPU_TEMP_THRESHOLD: nvs->query = QUERY_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_GPU_TEMP_THRESHOLD; break; case ARG_AMBIENT: // Ambient temperature case ARG_AMBIENT_TEMP: nvs->query = QUERY_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_AMBIENT_TEMP; break; case ARG_GPU_FREQ: // Current GPU clock case ARG_GPU_FREQ_CUR: nvs->query = QUERY_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_GPU_FREQ; break; case ARG_GPU_FREQ_MIN: // Minimum GPU clock nvs->query = QUERY_STRING_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_PERFMODES_STRING; nvs->token = (char *)"nvclockmin"; nvs->search = SEARCH_MIN; break; case ARG_GPU_FREQ_MAX: // Maximum GPU clock nvs->query = QUERY_STRING_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_PERFMODES_STRING; nvs->token = (char *)"nvclockmax"; nvs->search = SEARCH_MAX; break; case ARG_MEM_FREQ: // Current memory clock case ARG_MEM_FREQ_CUR: nvs->query = QUERY_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_MEM_FREQ; break; case ARG_MEM_FREQ_MIN: // Minimum memory clock nvs->query = QUERY_STRING_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_PERFMODES_STRING; nvs->token = (char *)"memclockmin"; nvs->search = SEARCH_MIN; break; case ARG_MEM_FREQ_MAX: // Maximum memory clock nvs->query = QUERY_STRING_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_PERFMODES_STRING; nvs->token = (char *)"memclockmax"; nvs->search = SEARCH_MAX; break; case ARG_MTR_FREQ: // Current memory transfer rate clock case ARG_MTR_FREQ_CUR: nvs->query = QUERY_STRING_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_FREQS_STRING; nvs->token = (char *)"memTransferRate"; nvs->search = SEARCH_FIRST; break; case ARG_MTR_FREQ_MIN: // Minimum memory transfer rate clock nvs->query = QUERY_STRING_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_PERFMODES_STRING; nvs->token = (char *)"memTransferRatemin"; nvs->search = SEARCH_MIN; break; case ARG_MTR_FREQ_MAX: // Maximum memory transfer rate clock nvs->query = QUERY_STRING_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_PERFMODES_STRING; nvs->token = (char *)"memTransferRatemax"; nvs->search = SEARCH_MAX; break; case ARG_PERF_LEVEL: // Current performance level case ARG_PERF_LEVEL_CUR: nvs->query = QUERY_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_PERF_LEVEL; break; case ARG_PERF_LEVEL_MIN: // Lowest performance level nvs->query = QUERY_STRING_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_PERFMODES_STRING; nvs->token = (char *)"perf"; nvs->search = SEARCH_MIN; break; case ARG_PERF_LEVEL_MAX: // Highest performance level nvs->query = QUERY_STRING_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_PERFMODES_STRING; nvs->token = (char *)"perf"; nvs->search = SEARCH_MAX; break; case ARG_PERF_MODE: // Performance mode nvs->query = QUERY_SPECIAL; nvs->target = TARGET_GPU; nvs->attribute = ATTR_PERF_MODE; break; case ARG_GPU_UTIL: // GPU utilization % nvs->query = QUERY_STRING_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_UTILS_STRING; nvs->token = (char *)"graphics"; nvs->search = SEARCH_FIRST; break; case ARG_MEM_BW_UTIL: // Memory bandwidth utilization % nvs->query = QUERY_STRING_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_UTILS_STRING; nvs->token = (char *)"memory"; nvs->search = SEARCH_FIRST; break; case ARG_VIDEO_UTIL: // Video engine utilization % nvs->query = QUERY_STRING_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_UTILS_STRING; nvs->token = (char *)"video"; nvs->search = SEARCH_FIRST; break; case ARG_PCIE_UTIL: // PCIe bandwidth utilization % nvs->query = QUERY_STRING_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_UTILS_STRING; nvs->token = (char *)"PCIe"; nvs->search = SEARCH_FIRST; break; case ARG_MEM: // Amount of used memory case ARG_MEM_USED: nvs->query = QUERY_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_MEM_USED; break; case ARG_MEM_FREE: // Amount of free memory case ARG_MEM_AVAIL: nvs->query = QUERY_SPECIAL; nvs->target = TARGET_GPU; nvs->attribute = ATTR_MEM_FREE; break; case ARG_MEM_MAX: // Total amount of memory case ARG_MEM_TOTAL: nvs->query = QUERY_VALUE; nvs->target = TARGET_GPU; nvs->attribute = ATTR_MEM_TOTAL; break; case ARG_MEM_UTIL: // Memory utilization % case ARG_MEM_PERC: nvs->query = QUERY_SPECIAL; nvs->target = TARGET_GPU; nvs->attribute = ATTR_MEM_UTIL; break; case ARG_FAN_SPEED: // Fan speed nvs->query = QUERY_VALUE; nvs->target = TARGET_COOLER; nvs->attribute = ATTR_FAN_SPEED; break; case ARG_FAN_LEVEL: // Fan level % nvs->query = QUERY_VALUE; nvs->target = TARGET_COOLER; nvs->attribute = ATTR_FAN_LEVEL; break; case ARG_IMAGEQUALITY: // Image quality nvs->query = QUERY_VALUE; nvs->target = TARGET_SCREEN; nvs->attribute = ATTR_IMAGE_QUALITY; break; case ARG_MODEL_NAME: nvs->query = QUERY_STRING; nvs->target = TARGET_GPU; nvs->attribute = ATTR_MODEL_NAME; break; case ARG_DRIVER_VERSION: nvs->query = QUERY_STRING; nvs->target = TARGET_GPU; nvs->attribute = ATTR_DRIVER_VERSION; break; default: // Unknown/invalid argument // Error printed by core.cc return 1; } return 0; } // Return the amount of targets present or raise error) static inline int get_nvidia_target_count(Display *dpy, TARGET_ID tid) { int num_tgts; if (!XNVCTRLQueryTargetCount(dpy, translate_nvidia_target[tid], &num_tgts)) { num_tgts = -1; } if (num_tgts < 1 && tid == TARGET_GPU) { // Print error and exit if there's no NVIDIA's GPU NORM_ERR(nullptr, NULL, "%s:" "\n Trying to query Nvidia target failed (using the " "proprietary drivers)." "\n Are you sure they are installed correctly and a " "Nvidia GPU is in use?" "\n (display: %d,Nvidia target_count: %d)", __func__, dpy, num_tgts); } return num_tgts; } static int cache_nvidia_value(TARGET_ID tid, ATTR_ID aid, Display *dpy, int *value, int gid, const char *arg) { static nvidia_c_value ac_value[MAXNUMGPU]; if (aid == ATTR_MEM_TOTAL) { if (ac_value[gid].memtotal < 0) { if (!dpy || !XNVCTRLQueryTargetAttribute( dpy, translate_nvidia_target[tid], gid, 0, translate_nvidia_attribute[aid], value)) { NORM_ERR( "%s: Something went wrong running nvidia query (arg: %s tid: %d, " "aid: %d)", __func__, arg, tid, aid); return -1; } ac_value[gid].memtotal = *value; } else { *value = ac_value[gid].memtotal; } } else if (aid == ATTR_GPU_TEMP_THRESHOLD) { if (ac_value[gid].gputempthreshold < 0) { if (!dpy || !XNVCTRLQueryTargetAttribute( dpy, translate_nvidia_target[tid], gid, 0, translate_nvidia_attribute[aid], value)) { NORM_ERR( "%s: Something went wrong running nvidia query (arg: %s, tid: " "%d, aid: %d)", __func__, arg, tid, aid); return -1; } ac_value[gid].gputempthreshold = *value; } else { *value = ac_value[gid].gputempthreshold; } } return 0; } // Retrieve attribute value via nvidia interface static int get_nvidia_value(TARGET_ID tid, ATTR_ID aid, int gid, const char *arg) { Display *dpy = nvdisplay ? nvdisplay : display; int value; // Check if the aid is cacheable if (aid == ATTR_MEM_TOTAL || aid == ATTR_GPU_TEMP_THRESHOLD) { if (cache_nvidia_value(tid, aid, dpy, &value, gid, arg)) { return -1; } // If not, then query it } else { if (!dpy || !XNVCTRLQueryTargetAttribute(dpy, translate_nvidia_target[tid], gid, 0, translate_nvidia_attribute[aid], &value)) { NORM_ERR( "%s: Something went wrong running nvidia query (arg: %s, tid: %d, " "aid: %d)", __func__, arg, tid, aid); return -1; } } // Unpack clock values (see NVCtrl.h for details) if (aid == ATTR_GPU_FREQ) return value >> 16; if (aid == ATTR_MEM_FREQ) return value & 0xFFFF; // Return value return value; } // Retrieve attribute string via nvidia interface static char *get_nvidia_string(TARGET_ID tid, ATTR_ID aid, int gid, const char *arg) { Display *dpy = nvdisplay ? nvdisplay : display; char *str; // Query nvidia interface if (!dpy || !XNVCTRLQueryTargetStringAttribute( dpy, translate_nvidia_target[tid], gid, 0, translate_nvidia_attribute[aid], &str)) { NORM_ERR( "%s: Something went wrong running nvidia string query (arg, tid: %d, " "aid: " "%d, GPU %d)", __func__, arg, tid, aid, gid); return nullptr; } return str; } void cache_nvidia_string_value_update(nvidia_c_string *ac_string, char *token, SEARCH_ID search, int *value, int gid) { if (strcmp(token, (char *)"nvclockmin") == 0 && ac_string[gid].nvclockmin < 0) { ac_string[gid].nvclockmin = *value; } else if (strcmp(token, (char *)"nvclockmax") == 0 && ac_string[gid].nvclockmax < 0) { ac_string[gid].nvclockmax = *value; } else if (strcmp(token, (char *)"memclockmin") == 0 && ac_string[gid].memclockmin < 0) { ac_string[gid].memclockmin = *value; } else if (strcmp(token, (char *)"memclockmax") == 0 && ac_string[gid].memclockmax < 0) { ac_string[gid].memclockmax = *value; } else if (strcmp(token, (char *)"memTransferRatemin") == 0 && ac_string[gid].memTransferRatemin < 0) { ac_string[gid].memTransferRatemin = *value; } else if (strcmp(token, (char *)"memTransferRatemax") == 0 && ac_string[gid].memTransferRatemax < 0) { ac_string[gid].memTransferRatemax = *value; } else if (strcmp(token, (char *)"perf") == 0 && ac_string[gid].memTransferRatemax < 0) { if (search == SEARCH_MIN) { ac_string[gid].perfmin = *value; } else if (search == SEARCH_MAX) { ac_string[gid].perfmax = *value; } } } void cache_nvidia_string_value_noupdate(nvidia_c_string *ac_string, char *token, SEARCH_ID search, int *value, int gid) { if (strcmp(token, (char *)"nvclockmin") == 0) { *value = ac_string[gid].nvclockmin; } else if (strcmp(token, (char *)"nvclockmax") == 0) { *value = ac_string[gid].nvclockmax; } else if (strcmp(token, (char *)"memclockmin") == 0) { *value = ac_string[gid].memclockmin; } else if (strcmp(token, (char *)"memclockmax") == 0) { *value = ac_string[gid].memclockmax; } else if (strcmp(token, (char *)"memTransferRatemin") == 0) { *value = ac_string[gid].memTransferRatemin; } else if (strcmp(token, (char *)"memTransferRatemax") == 0) { *value = ac_string[gid].memTransferRatemax; } else if (strcmp(token, (char *)"perf") == 0) { if (search == SEARCH_MIN) { *value = ac_string[gid].perfmin; } else if (search == SEARCH_MAX) { *value = ac_string[gid].perfmax; } } } static int cache_nvidia_string_value(TARGET_ID tid, ATTR_ID aid, char *token, SEARCH_ID search, int *value, int update, int gid) { static nvidia_c_string ac_string[MAXNUMGPU]; (void)tid; (void)aid; if (update) { cache_nvidia_string_value_update(ac_string, token, search, value, gid); } else { cache_nvidia_string_value_noupdate(ac_string, token, search, value, gid); } return 0; } // Retrieve token value from nvidia string static int get_nvidia_string_value(TARGET_ID tid, ATTR_ID aid, char *token, SEARCH_ID search, int gid, const char *arg) { char *str; char *kvp; char *key; char *val; char *saveptr1; char *saveptr2; int temp; int value = -1; // Checks if the value is cacheable and is already loaded cache_nvidia_string_value(tid, aid, token, search, &value, 0, gid); if (value != -1) { return value; } // Get string via nvidia interface str = get_nvidia_string(tid, aid, gid, arg); // Split string into 'key=value' substrings, split substring // into key and value, from value, check if token was found, // convert value to int, evaluate value according to specified // token search mode kvp = strtok_r(str, NV_KVPAIR_SEPARATORS, &saveptr1); while (kvp) { key = strtok_r(kvp, NV_KEYVAL_SEPARATORS, &saveptr2); val = strtok_r(nullptr, NV_KEYVAL_SEPARATORS, &saveptr2); if (key && val && (strcmp(token, key) == 0)) { temp = (int)strtol(val, nullptr, 0); if (search == SEARCH_FIRST) { value = temp; break; } else if (search == SEARCH_LAST) { value = temp; } else if (search == SEARCH_MIN) { if ((value == -1) || (temp < value)) value = temp; } else if (search == SEARCH_MAX) { if (temp > value) value = temp; } else { value = -1; break; } } kvp = strtok_r(nullptr, NV_KVPAIR_SEPARATORS, &saveptr1); } // This call updated the cache for the cacheable values cache_nvidia_string_value(tid, aid, token, search, &value, 1, gid); // Free string, return value free_and_zero(str); return value; } bool validate_target_id(Display *dpy, int target_id, ATTR_ID attribute) { // num_GPU and num_COOLER calculated only once based on the physical target static int num_GPU = get_nvidia_target_count(dpy, TARGET_GPU) - 1; static int num_COOLER = get_nvidia_target_count(dpy, TARGET_COOLER) - 1; if (target_id < 0) return false; switch (attribute) { case ATTR_FAN_LEVEL: case ATTR_FAN_SPEED: if (target_id > num_COOLER) return false; break; default: if (target_id > num_GPU) return false; break; } return true; } // Perform query and print result void print_nvidia_value(struct text_object *obj, char *p, unsigned int p_max_size) { nvidia_s *nvs = static_cast(obj->data.opaque); int value; int temp1; int temp2; int result; char *str; int event_base; int error_base; Display *dpy = nvdisplay ? nvdisplay : display; if (!dpy) { NORM_ERR("%s: no display set (try setting nvidia_display)", __func__); return; } if (!XNVCTRLQueryExtension(dpy, &event_base, &error_base)) { NORM_ERR("%s: NV-CONTROL X extension not present", __func__); return; } // Assume failure value = -1; str = nullptr; // Perform query if the query exists and isnt stupid if (nvs != nullptr && validate_target_id(dpy, nvs->target_id, nvs->attribute)) { // Execute switch by query type switch (nvs->query) { case QUERY_VALUE: value = get_nvidia_value(nvs->target, nvs->attribute, nvs->target_id, nvs->arg); break; case QUERY_STRING: str = get_nvidia_string(nvs->target, nvs->attribute, nvs->target_id, nvs->arg); break; case QUERY_STRING_VALUE: value = get_nvidia_string_value(nvs->target, nvs->attribute, nvs->token, nvs->search, nvs->target_id, nvs->arg); break; case QUERY_SPECIAL: switch (nvs->attribute) { case ATTR_PERF_MODE: temp1 = get_nvidia_value(nvs->target, nvs->attribute, nvs->target_id, nvs->arg); switch (temp1) { case NV_CTRL_GPU_POWER_MIZER_MODE_ADAPTIVE: result = asprintf(&str, "Adaptive"); break; case NV_CTRL_GPU_POWER_MIZER_MODE_PREFER_MAXIMUM_PERFORMANCE: result = asprintf(&str, "Max. Perf."); break; case NV_CTRL_GPU_POWER_MIZER_MODE_AUTO: result = asprintf(&str, "Auto"); break; case NV_CTRL_GPU_POWER_MIZER_MODE_PREFER_CONSISTENT_PERFORMANCE: result = asprintf(&str, "Consistent"); break; default: result = asprintf(&str, "Unknown (%d)", value); break; } if (result < 0) { str = nullptr; } break; case ATTR_MEM_FREE: temp1 = get_nvidia_value(nvs->target, ATTR_MEM_USED, nvs->target_id, nvs->arg); temp2 = get_nvidia_value(nvs->target, ATTR_MEM_TOTAL, nvs->target_id, nvs->arg); value = temp2 - temp1; break; case ATTR_MEM_UTIL: temp1 = get_nvidia_value(nvs->target, ATTR_MEM_USED, nvs->target_id, nvs->arg); temp2 = get_nvidia_value(nvs->target, ATTR_MEM_TOTAL, nvs->target_id, nvs->arg); value = ((float)temp1 * 100 / (float)temp2) + 0.5; break; default: break; } break; default: break; } } // Print result if (value != -1) { snprintf(p, p_max_size, "%d", value); } else if (str != nullptr) { snprintf(p, p_max_size, "%s", str); free_and_zero(str); } else { snprintf(p, p_max_size, "%s", "N/A"); } } double get_nvidia_barval(struct text_object *obj) { nvidia_s *nvs = static_cast(obj->data.opaque); int temp1; int temp2; double value; int event_base; int error_base; Display *dpy = nvdisplay ? nvdisplay : display; if (!dpy) { NORM_ERR("%s: no display set (try setting nvidia_display)", __func__); return 0; } if (!XNVCTRLQueryExtension(dpy, &event_base, &error_base)) { NORM_ERR("%s: NV-CONTROL X extension not present", __func__); return 0; } // Assume failure value = 0; // Convert query_result to a percentage using ((val-min)÷(max-min)×100)+0.5 if // needed. if (nvs != nullptr && validate_target_id(dpy, nvs->target_id, nvs->attribute)) { switch (nvs->attribute) { case ATTR_UTILS_STRING: // one of the percentage utils (gpuutil, // membwutil, videoutil and pcieutil) value = get_nvidia_string_value(nvs->target, ATTR_UTILS_STRING, nvs->token, nvs->search, nvs->target_id, nvs->arg); break; case ATTR_MEM_UTIL: // memutil case ATTR_MEM_USED: temp1 = get_nvidia_value(nvs->target, ATTR_MEM_USED, nvs->target_id, nvs->arg); temp2 = get_nvidia_value(nvs->target, ATTR_MEM_TOTAL, nvs->target_id, nvs->arg); value = ((float)temp1 * 100 / (float)temp2) + 0.5; break; case ATTR_MEM_FREE: // memfree temp1 = get_nvidia_value(nvs->target, ATTR_MEM_USED, nvs->target_id, nvs->arg); temp2 = get_nvidia_value(nvs->target, ATTR_MEM_TOTAL, nvs->target_id, nvs->arg); value = temp2 - temp1; break; case ATTR_FAN_SPEED: // fanspeed: Warn user we are using fanlevel NORM_ERR( "%s: invalid argument specified: '%s' (using 'fanlevel' instead).", nvs->command, nvs->arg); /* falls through */ case ATTR_FAN_LEVEL: // fanlevel value = get_nvidia_value(nvs->target, ATTR_FAN_LEVEL, nvs->target_id, nvs->arg); break; case ATTR_GPU_TEMP: // gputemp (calculate out of gputempthreshold) temp1 = get_nvidia_value(nvs->target, ATTR_GPU_TEMP, nvs->target_id, nvs->arg); temp2 = get_nvidia_value(nvs->target, ATTR_GPU_TEMP_THRESHOLD, nvs->target_id, nvs->arg); value = ((float)temp1 * 100 / (float)temp2) + 0.5; break; case ATTR_AMBIENT_TEMP: // ambienttemp (calculate out of gputempthreshold // for consistency) temp1 = get_nvidia_value(nvs->target, ATTR_AMBIENT_TEMP, nvs->target_id, nvs->arg); temp2 = get_nvidia_value(nvs->target, ATTR_GPU_TEMP_THRESHOLD, nvs->target_id, nvs->arg); value = ((float)temp1 * 100 / (float)temp2) + 0.5; break; case ATTR_GPU_FREQ: // gpufreq (calculate out of gpufreqmax) temp1 = get_nvidia_value(nvs->target, ATTR_GPU_FREQ, nvs->target_id, nvs->arg); temp2 = get_nvidia_string_value(nvs->target, ATTR_PERFMODES_STRING, (char *)"nvclockmax", SEARCH_MAX, nvs->target_id, nvs->arg); value = ((float)temp1 * 100 / (float)temp2) + 0.5; break; case ATTR_MEM_FREQ: // memfreq (calculate out of memfreqmax) temp1 = get_nvidia_value(nvs->target, ATTR_MEM_FREQ, nvs->target_id, nvs->arg); temp2 = get_nvidia_string_value(nvs->target, ATTR_PERFMODES_STRING, (char *)"memclockmax", SEARCH_MAX, nvs->target_id, nvs->arg); value = ((float)temp1 * 100 / (float)temp2) + 0.5; break; case ATTR_FREQS_STRING: // mtrfreq (calculate out of memfreqmax) if (strcmp(nvs->token, "memTransferRate") != 0) { // Just in case error for silly devs CRIT_ERR(nullptr, NULL, "%s: attribute is 'ATTR_FREQS_STRING' but token is not " "\"memTransferRate\" (arg: '%s')", nvs->command, nvs->arg); return 0; } temp1 = get_nvidia_string_value(nvs->target, ATTR_FREQS_STRING, nvs->token, SEARCH_MAX, nvs->target_id, nvs->arg); temp2 = get_nvidia_string_value(nvs->target, ATTR_PERFMODES_STRING, (char *)"memTransferRatemax", SEARCH_MAX, nvs->target_id, nvs->arg); if (temp2 > temp1) temp1 = temp2; // extra safe here value = ((float)temp1 * 100 / (float)temp2) + 0.5; break; case ATTR_IMAGE_QUALITY: // imagequality value = get_nvidia_value(nvs->target, ATTR_IMAGE_QUALITY, nvs->target_id, nvs->arg); break; default: // Throw error if unsupported args are used CRIT_ERR(nullptr, NULL, "%s: invalid argument specified: '%s'", nvs->command, nvs->arg); } } // Return the percentage return value; } // Cleanup void free_nvidia(struct text_object *obj) { nvidia_s *nvs = static_cast(obj->data.opaque); delete nvs; obj->data.opaque = nullptr; } conky-1.12.2/src/nvidia.h000066400000000000000000000024421404127277500151450ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2008 Markus Meissner * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef NVIDIA_CONKY_H #define NVIDIA_CONKY_H int set_nvidia_query(struct text_object *, const char *, unsigned int); void print_nvidia_value(struct text_object *, char *, unsigned int); double get_nvidia_barval(struct text_object *); void free_nvidia(struct text_object *); #endif conky-1.12.2/src/openbsd.cc000066400000000000000000000411331404127277500154630ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2007 Toni Spets * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "conky.h" #include "diskio.h" #include "logging.h" #include "net_stat.h" #include "openbsd.h" #include "top.h" #define MAXSHOWDEVS 16 #define LOG1024 10 #define pagetok(size) ((size) << pageshift) inline void proc_find_top(struct process **cpu, struct process **mem); static short cpu_setup = 0; static kvm_t *kd = 0; struct ifmibdata *data = nullptr; size_t len = 0; int init_kvm = 0; int init_sensors = 0; static int kvm_init() { if (init_kvm) { return 1; } kd = kvm_open(nullptr, NULL, NULL, KVM_NO_FILES, NULL); if (kd == nullptr) { NORM_ERR("error opening kvm"); } else { init_kvm = 1; } return 1; } /* note: swapmode taken from 'top' source */ /* swapmode is rewritten by Tobias Weingartner * to be based on the new swapctl(2) system call. */ static int swapmode(int *used, int *total) { struct swapent *swdev; int nswap, rnswap, i; nswap = swapctl(SWAP_NSWAP, 0, 0); if (nswap == 0) { return 0; } swdev = malloc(nswap * sizeof(*swdev)); if (swdev == nullptr) { return 0; } rnswap = swapctl(SWAP_STATS, swdev, nswap); if (rnswap == -1) { free(swdev); return 0; } /* if rnswap != nswap, then what? */ /* Total things up */ *total = *used = 0; for (i = 0; i < nswap; i++) { if (swdev[i].se_flags & SWF_ENABLE) { *used += (swdev[i].se_inuse / (1024 / DEV_BSIZE)); *total += (swdev[i].se_nblks / (1024 / DEV_BSIZE)); } } free(swdev); return 1; } int check_mount(struct text_object *obj) { /* stub */ (void)obj; return 0; } void update_uptime() { int mib[2] = {CTL_KERN, KERN_BOOTTIME}; struct timeval boottime; time_t now; size_t size = sizeof(boottime); if ((sysctl(mib, 2, &boottime, &size, nullptr, 0) != -1) && (boottime.tv_sec != 0)) { time(&now); info.uptime = now - boottime.tv_sec; } else { NORM_ERR("Could not get uptime"); info.uptime = 0; } } void update_meminfo() { static int mib[2] = {CTL_VM, VM_METER}; struct vmtotal vmtotal; size_t size; int pagesize, pageshift, swap_avail, swap_used; pagesize = getpagesize(); pageshift = 0; while (pagesize > 1) { pageshift++; pagesize >>= 1; } /* we only need the amount of log(2)1024 for our conversion */ pageshift -= LOG1024; /* get total -- systemwide main memory usage structure */ size = sizeof(vmtotal); if (sysctl(mib, 2, &vmtotal, &size, nullptr, 0) < 0) { warn("sysctl failed"); bzero(&vmtotal, sizeof(vmtotal)); } info.memmax = pagetok(vmtotal.t_rm) + pagetok(vmtotal.t_free); info.mem = info.memwithbuffers = pagetok(vmtotal.t_rm); info.memeasyfree = info.memfree = info.memmax - info.mem; info.legacymem = info.mem; if ((swapmode(&swap_used, &swap_avail)) >= 0) { info.swapmax = swap_avail; info.swap = swap_used; info.swapfree = swap_avail - swap_used; } else { info.swapmax = 0; info.swap = 0; info.swapfree = 0; } } void update_net_stats() { struct net_stat *ns; double delta; long long r, t, last_recv, last_trans; struct ifaddrs *ifap, *ifa; struct if_data *ifd; /* get delta */ delta = current_update_time - last_update_time; if (delta <= 0.0001) { return; } if (getifaddrs(&ifap) < 0) { return; } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { ns = get_net_stat((const char *)ifa->ifa_name, nullptr, NULL); if (ifa->ifa_flags & IFF_UP) { struct ifaddrs *iftmp; ns->up = 1; last_recv = ns->recv; last_trans = ns->trans; if (ifa->ifa_addr->sa_family != AF_LINK) { continue; } for (iftmp = ifa->ifa_next; iftmp != nullptr && strcmp(ifa->ifa_name, iftmp->ifa_name) == 0; iftmp = iftmp->ifa_next) { if (iftmp->ifa_addr->sa_family == AF_INET) { memcpy(&(ns->addr), iftmp->ifa_addr, iftmp->ifa_addr->sa_len); } } ifd = (struct if_data *)ifa->ifa_data; r = ifd->ifi_ibytes; t = ifd->ifi_obytes; if (r < ns->last_read_recv) { ns->recv += ((long long)4294967295U - ns->last_read_recv) + r; } else { ns->recv += (r - ns->last_read_recv); } ns->last_read_recv = r; if (t < ns->last_read_trans) { ns->trans += (long long)4294967295U - ns->last_read_trans + t; } else { ns->trans += (t - ns->last_read_trans); } ns->last_read_trans = t; /* calculate speeds */ ns->recv_speed = (ns->recv - last_recv) / delta; ns->trans_speed = (ns->trans - last_trans) / delta; } else { ns->up = 0; } } freeifaddrs(ifap); } int update_total_processes() { int n_processes; kvm_init(); kvm_getprocs(kd, KERN_PROC_ALL, 0, &n_processes); info.procs = n_processes; return 0; } void update_running_processes() { struct kinfo_proc2 *p; int n_processes; int i, cnt = 0; kvm_init(); int max_size = sizeof(struct kinfo_proc2); p = kvm_getproc2(kd, KERN_PROC_ALL, 0, max_size, &n_processes); for (i = 0; i < n_processes; i++) { if (p[i].p_stat == SRUN) { cnt++; } } info.run_procs = cnt; } /* new SMP code can be enabled by commenting the following line */ #define OLDCPU #ifdef OLDCPU struct cpu_load_struct { unsigned long load[5]; }; struct cpu_load_struct fresh = {{0, 0, 0, 0, 0}}; long cpu_used, oldtotal, oldused; #else #include int64_t *fresh = nullptr; /* XXX is 8 enough? - What's the constant for MAXCPU? */ /* allocate this with malloc would be better */ int64_t oldtotal[8], oldused[8]; #endif void get_cpu_count() { int cpu_count = 1; /* default to 1 cpu */ #ifndef OLDCPU int mib[2] = {CTL_HW, HW_NCPU}; size_t len = sizeof(cpu_count); if (sysctl(mib, 2, &cpu_count, &len, nullptr, 0) != 0) { NORM_ERR("error getting cpu count, defaulting to 1"); } #endif info.cpu_count = cpu_count; info.cpu_usage = malloc(info.cpu_count * sizeof(float)); if (info.cpu_usage == nullptr) { CRIT_ERR(nullptr, NULL, "malloc"); } #ifndef OLDCPU assert(fresh == nullptr); /* XXX Is this leaking memory? */ /* XXX Where shall I free this? */ if (nullptr == (fresh = calloc(cpu_count, sizeof(int64_t) * CPUSTATES))) { CRIT_ERR(nullptr, NULL, "calloc"); } #endif } void update_cpu_usage() { #ifdef OLDCPU int mib[2] = {CTL_KERN, KERN_CPTIME}; long used, total; long cp_time[CPUSTATES]; size_t len = sizeof(cp_time); #else size_t size; unsigned int i; #endif /* add check for !info.cpu_usage since that mem is freed on a SIGUSR1 */ if ((cpu_setup == 0) || (!info.cpu_usage)) { get_cpu_count(); cpu_setup = 1; } #ifdef OLDCPU if (sysctl(mib, 2, &cp_time, &len, nullptr, 0) < 0) { NORM_ERR("Cannot get kern.cp_time"); } fresh.load[0] = cp_time[CP_USER]; fresh.load[1] = cp_time[CP_NICE]; fresh.load[2] = cp_time[CP_SYS]; fresh.load[3] = cp_time[CP_IDLE]; fresh.load[4] = cp_time[CP_IDLE]; used = fresh.load[0] + fresh.load[1] + fresh.load[2]; total = fresh.load[0] + fresh.load[1] + fresh.load[2] + fresh.load[3]; if ((total - oldtotal) != 0) { info.cpu_usage[0] = ((double)(used - oldused)) / (double)(total - oldtotal); } else { info.cpu_usage[0] = 0; } oldused = used; oldtotal = total; #else if (info.cpu_count > 1) { size = CPUSTATES * sizeof(int64_t); for (i = 0; i < info.cpu_count; i++) { int cp_time_mib[] = {CTL_KERN, KERN_CPTIME2, i}; if (sysctl(cp_time_mib, 3, &(fresh[i * CPUSTATES]), &size, nullptr, 0) < 0) { NORM_ERR("sysctl kern.cp_time2 failed"); } } } else { int cp_time_mib[] = {CTL_KERN, KERN_CPTIME}; long cp_time_tmp[CPUSTATES]; size = sizeof(cp_time_tmp); if (sysctl(cp_time_mib, 2, cp_time_tmp, &size, nullptr, 0) < 0) { NORM_ERR("sysctl kern.cp_time failed"); } for (i = 0; i < CPUSTATES; i++) { fresh[i] = (int64_t)cp_time_tmp[i]; } } /* XXX Do sg with this int64_t => long => double ? float hell. */ for (i = 0; i < info.cpu_count; i++) { int64_t used, total; int at = i * CPUSTATES; used = fresh[at + CP_USER] + fresh[at + CP_NICE] + fresh[at + CP_SYS]; total = used + fresh[at + CP_IDLE]; if ((total - oldtotal[i]) != 0) { info.cpu_usage[i] = ((double)(used - oldused[i])) / (double)(total - oldtotal[i]); } else { info.cpu_usage[i] = 0; } oldused[i] = used; oldtotal[i] = total; } #endif } void free_cpu(struct text_object *) { /* no-op */ } void update_load_average() { double v[3]; getloadavg(v, 3); info.loadavg[0] = (float)v[0]; info.loadavg[1] = (float)v[1]; info.loadavg[2] = (float)v[2]; } #define OBSD_MAX_SENSORS 256 static struct obsd_sensors_struct { int device; float temp[MAXSENSORDEVICES][OBSD_MAX_SENSORS]; unsigned int fan[MAXSENSORDEVICES][OBSD_MAX_SENSORS]; float volt[MAXSENSORDEVICES][OBSD_MAX_SENSORS]; } obsd_sensors; static conky::simple_config_setting sensor_device("sensor_device", 0, false); /* read sensors from sysctl */ void update_obsd_sensors() { int sensor_cnt, dev, numt, mib[5] = {CTL_HW, HW_SENSORS, 0, 0, 0}; struct sensor sensor; struct sensordev sensordev; size_t slen, sdlen; enum sensor_type type; slen = sizeof(sensor); sdlen = sizeof(sensordev); sensor_cnt = 0; dev = obsd_sensors.device; // FIXME: read more than one device /* for (dev = 0; dev < MAXSENSORDEVICES; dev++) { */ mib[2] = dev; if (sysctl(mib, 3, &sensordev, &sdlen, nullptr, 0) == -1) { if (errno != ENOENT) { warn("sysctl"); } return; // continue; } for (type = 0; type < SENSOR_MAX_TYPES; type++) { mib[3] = type; for (numt = 0; numt < sensordev.maxnumt[type]; numt++) { mib[4] = numt; if (sysctl(mib, 5, &sensor, &slen, nullptr, 0) == -1) { if (errno != ENOENT) { warn("sysctl"); } continue; } if (sensor.flags & SENSOR_FINVALID) { continue; } switch (type) { case SENSOR_TEMP: obsd_sensors.temp[dev][sensor.numt] = (sensor.value - 273150000) / 1000000.0; break; case SENSOR_FANRPM: obsd_sensors.fan[dev][sensor.numt] = sensor.value; break; case SENSOR_VOLTS_DC: obsd_sensors.volt[dev][sensor.numt] = sensor.value / 1000000.0; break; default: break; } sensor_cnt++; } } /* } */ init_sensors = 1; } void parse_obsd_sensor(struct text_object *obj, const char *arg) { if (!isdigit((unsigned char)arg[0]) || atoi(&arg[0]) < 0 || atoi(&arg[0]) > OBSD_MAX_SENSORS - 1) { obj->data.l = 0; NORM_ERR("Invalid sensor number!"); } else obj->data.l = atoi(&arg[0]); } void print_obsd_sensors_temp(struct text_object *obj, char *p, int p_max_size) { obsd_sensors.device = sensor_device.get(*state); update_obsd_sensors(); temp_print(p, p_max_size, obsd_sensors.temp[obsd_sensors.device][obj->data.l], TEMP_CELSIUS, 1); } void print_obsd_sensors_fan(struct text_object *obj, char *p, int p_max_size) { obsd_sensors.device = sensor_device.get(*state); update_obsd_sensors(); snprintf(p, p_max_size, "%d", obsd_sensors.fan[obsd_sensors.device][obj->data.l]); } void print_obsd_sensors_volt(struct text_object *obj, char *p, int p_max_size) { obsd_sensors.device = sensor_device.get(*state); update_obsd_sensors(); snprintf(p, p_max_size, "%.2f", obsd_sensors.volt[obsd_sensors.device][obj->data.l]); } /* chipset vendor */ void get_obsd_vendor(struct text_object *obj, char *buf, size_t client_buffer_size) { int mib[2]; char vendor[64]; size_t size = sizeof(vendor); (void)obj; mib[0] = CTL_HW; mib[1] = HW_VENDOR; if (sysctl(mib, 2, vendor, &size, nullptr, 0) == -1) { NORM_ERR("error reading vendor"); snprintf(buf, client_buffer_size, "%s", "unknown"); } else { snprintf(buf, client_buffer_size, "%s", vendor); } } /* chipset name */ void get_obsd_product(struct text_object *obj, char *buf, size_t client_buffer_size) { int mib[2]; char product[64]; size_t size = sizeof(product); (void)obj; mib[0] = CTL_HW; mib[1] = HW_PRODUCT; if (sysctl(mib, 2, product, &size, nullptr, 0) == -1) { NORM_ERR("error reading product"); snprintf(buf, client_buffer_size, "%s", "unknown"); } else { snprintf(buf, client_buffer_size, "%s", product); } } /* void */ char get_freq(char *p_client_buffer, size_t client_buffer_size, const char *p_format, int divisor, unsigned int cpu) { int freq = cpu; int mib[2] = {CTL_HW, HW_CPUSPEED}; if (!p_client_buffer || client_buffer_size <= 0 || !p_format || divisor <= 0) { return 0; } size_t size = sizeof(freq); if (sysctl(mib, 2, &freq, &size, nullptr, 0) == 0) { snprintf(p_client_buffer, client_buffer_size, p_format, (float)freq / divisor); } else { snprintf(p_client_buffer, client_buffer_size, p_format, 0.0f); } return 1; } #if 0 /* deprecated, will rewrite this soon in update_net_stats() -hifi */ void update_wifi_stats() { struct net_stat *ns; struct ifaddrs *ifap, *ifa; struct ifmediareq ifmr; struct ieee80211_nodereq nr; struct ieee80211_bssid bssid; int s, ibssid; /* Get iface table */ if (getifaddrs(&ifap) < 0) { return; } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { ns = get_net_stat((const char *) ifa->ifa_name); s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); /* Get media type */ bzero(&ifmr, sizeof(ifmr)); strlcpy(ifmr.ifm_name, ifa->ifa_name, IFNAMSIZ); if (ioctl(s, SIOCGIFMEDIA, (caddr_t) &ifmr) < 0) { close(s); return; } /* We can monitor only wireless interfaces * which are not in hostap mode */ if ((ifmr.ifm_active & IFM_IEEE80211) && !(ifmr.ifm_active & IFM_IEEE80211_HOSTAP)) { /* Get wi status */ memset(&bssid, 0, sizeof(bssid)); strlcpy(bssid.i_name, ifa->ifa_name, sizeof(bssid.i_name)); ibssid = ioctl(s, SIOCG80211BSSID, &bssid); bzero(&nr, sizeof(nr)); bcopy(bssid.i_bssid, &nr.nr_macaddr, sizeof(nr.nr_macaddr)); strlcpy(nr.nr_ifname, ifa->ifa_name, sizeof(nr.nr_ifname)); if (ioctl(s, SIOCG80211NODE, &nr) == 0 && nr.nr_rssi) { ns->linkstatus = nr.nr_rssi; } } cleanup: close(s); } } #endif void clear_diskio_stats() {} struct diskio_stat *prepare_diskio_stat(const char *s) {} void update_diskio() { return; /* XXX: implement? hifi: not sure how */ } /* While topless is obviously better, top is also not bad. */ void get_top_info(void) { struct kinfo_proc2 *p; struct process *proc; int n_processes; int i; kvm_init(); p = kvm_getproc2(kd, KERN_PROC_ALL, 0, sizeof(struct kinfo_proc2), &n_processes); for (i = 0; i < n_processes; i++) { if (!((p[i].p_flag & P_SYSTEM)) && p[i].p_comm != nullptr) { proc = find_process(p[i].p_pid); if (!proc) proc = new_process(p[i].p_pid); proc->time_stamp = g_time; proc->name = strndup(p[i].p_comm, text_buffer_size); proc->amount = 100.0 * p[i].p_pctcpu / FSCALE; /* TODO: vsize, rss, total_cpu_time */ } } } /* empty stubs so conky links */ void prepare_update() {} int get_entropy_avail(unsigned int *val) { return 1; } int get_entropy_poolsize(unsigned int *val) { return 1; } conky-1.12.2/src/openbsd.h000066400000000000000000000014701404127277500153250ustar00rootroot00000000000000/* */ #ifndef OPENBSD_H_ #define OPENBSD_H_ #include #include #include #include #include "common.h" void parse_obsd_sensor(struct text_object *, const char *); void print_obsd_sensors_temp(struct text_object *, char *, int); void print_obsd_sensors_fan(struct text_object *, char *, int); void print_obsd_sensors_volt(struct text_object *, char *, int); void get_obsd_vendor(struct text_object *, char *buf, size_t client_buffer_size); void get_obsd_product(struct text_object *, char *buf, size_t client_buffer_size); #if defined(i386) || defined(__i386__) typedef struct apm_power_info *apm_info_t; #endif int get_entropy_avail(unsigned int *); int get_entropy_poolsize(unsigned int *); #endif /*OPENBSD_H_*/ conky-1.12.2/src/prioqueue.cc000066400000000000000000000130431404127277500160460ustar00rootroot00000000000000/* * * prioqueue: a simple priority queue implementation * * The queue organises it's data internally using a doubly linked * list, into which elements are inserted at the right position. This * is definitely not the best algorithm for a priority queue, but it * fits best for the given purpose, i.e. the top process sorting. * This means we have a rather little amount of total elements (~200 * on a normal system), which are to be inserted into a queue of only * the few top-most elements (10 at the current state). Additionally, * at each update interval, the queue is drained completely and * refilled from scratch. * * Copyright (C) 2009 Phil Sutter * * Initially based on the former implementation of sorted processes in * top.c, Copyright (C) 2005 David Carter * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include /* INT_MAX */ #include #include #include "conky.h" struct prio_elem { struct prio_elem *next, *prev; void *data; }; struct prio_queue { /* Compare a and b. Return: * <0 if a should come before b, * >0 if b should come before a, * 0 if don't care */ int (*compare)(void *a, void *b); /* Free element payload. Called when dropping elements. */ void (*free)(void *a); /* Maximum size of queue. The first * elements in the list take precedence. */ int max_size; /* The pointers to the actual list. */ struct prio_elem *head, *tail; /* The current number of elements in the list. */ int cur_size; }; /* nop callback to save us from conditional calling */ static void pq_free_nop(void *a) { (void)a; } struct prio_queue *init_prio_queue() { struct prio_queue *retval; retval = static_cast(malloc(sizeof(struct prio_queue))); memset(retval, 0, sizeof(struct prio_queue)); /* use pq_free_nop by default */ retval->free = &pq_free_nop; /* Default to maximum possible size as restricted * by the used data type. This also saves us from * checking if caller has set this field or not. */ retval->max_size = INT_MAX; return retval; } void pq_set_compare(struct prio_queue *queue, int (*pqcompare)(void *a, void *b)) { if (pqcompare != nullptr) { queue->compare = pqcompare; } } void pq_set_free(struct prio_queue *queue, void (*pqfree)(void *a)) { if (pqfree != nullptr) { queue->free = pqfree; } } void pq_set_max_size(struct prio_queue *queue, int max_size) { if (max_size >= 0) { queue->max_size = max_size; } } int pq_get_cur_size(struct prio_queue *queue) { return queue->cur_size; } static struct prio_elem *init_prio_elem(void *data) { struct prio_elem *retval; retval = static_cast(malloc(sizeof(struct prio_elem))); memset(retval, 0, sizeof(struct prio_elem)); retval->data = data; return retval; } void insert_prio_elem(struct prio_queue *queue, void *data) { struct prio_elem *cur; /* queue->compare is a must-have */ if (queue->compare == nullptr) { return; } /* empty queue, insert the first item */ if (queue->cur_size == 0) { queue->cur_size++; queue->head = queue->tail = init_prio_elem(data); return; } /* short-cut 1: new item is lower than all others */ if (queue->compare(queue->tail->data, data) <= 0) { if (queue->cur_size < queue->max_size) { queue->cur_size++; queue->tail->next = init_prio_elem(data); queue->tail->next->prev = queue->tail; queue->tail = queue->tail->next; } else { /* list was already full */ (*queue->free)(data); } return; } /* short-cut 2: we have a new maximum */ if (queue->compare(queue->head->data, data) >= 0) { queue->cur_size++; queue->head->prev = init_prio_elem(data); queue->head->prev->next = queue->head; queue->head = queue->head->prev; goto check_cur_size; } /* find the actual position if short-cuts failed */ for (cur = queue->head->next; cur != nullptr; cur = cur->next) { if (queue->compare(cur->data, data) >= 0) { queue->cur_size++; cur->prev->next = init_prio_elem(data); cur->prev->next->prev = cur->prev; cur->prev->next->next = cur; cur->prev = cur->prev->next; break; } } check_cur_size: /* drop the lowest item if queue overrun */ if (queue->cur_size > queue->max_size) { queue->cur_size--; queue->tail = queue->tail->prev; (*queue->free)(queue->tail->next->data); free_and_zero(queue->tail->next); } } void *pop_prio_elem(struct prio_queue *queue) { struct prio_elem *tmp; void *data; if (queue->cur_size <= 0) { return nullptr; } tmp = queue->head; data = tmp->data; queue->head = queue->head->next; queue->cur_size--; if (queue->head != nullptr) { queue->head->prev = nullptr; } else { /* list is now empty */ queue->tail = nullptr; } free(tmp); return data; } void free_prio_queue(struct prio_queue *queue) { void *data; while ((data = pop_prio_elem(queue)) != nullptr) { (*queue->free)(data); } free(queue); } conky-1.12.2/src/prioqueue.h000066400000000000000000000041751404127277500157160ustar00rootroot00000000000000/* * * prioqueue: a simple priority queue implementation * * Copyright (C) 2009 Phil Sutter * * Initially based on the former implementation of sorted processes in * top.c, Copyright (C) 2005 David Carter * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _PRIOQUEUE_H #define _PRIOQUEUE_H /* forward-define for private data */ struct prio_queue; /* typedef for a distinct prioqueue object */ typedef struct prio_queue *prio_queue_t; /* initialise a prioqueue object (mandatory) */ prio_queue_t init_prio_queue(void); /* set the compare function (mandatory) * (*compare) shall return: * <0 if a should come before b, * >0 if b should come before a, * 0 if doesn't matter */ void pq_set_compare(prio_queue_t, int (*compare)(void *a, void *b)); /* set the data free function (optional) * (*free) will be called when: * - dropping elements from the end of a limited size queue and * - free_prio_queue() finds leftover elements in the given queue */ void pq_set_free(prio_queue_t, void (*free)(void *)); /* set a maximum queue size (optional) (defaults to INT_MAX) */ void pq_set_max_size(prio_queue_t, int); /* insert an element into the given queue */ void insert_prio_elem(prio_queue_t, void *); /* return the number of elements in the queue */ int pq_get_cur_size(prio_queue_t queue); /* pop the top-most element from the queue * returns nullptr if queue is empty */ void *pop_prio_elem(prio_queue_t); /* clear and free the given queue */ void free_prio_queue(prio_queue_t); #endif /* _PRIOQUEUE_H */ conky-1.12.2/src/proc.cc000066400000000000000000000701741404127277500150030ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "proc.h" #include #include #include #include #include #include "conky.h" #include "core.h" #include "logging.h" char *readfile(const char *filename, int *total_read, char showerror) { FILE *file; char *buf = nullptr; int bytes_read; *total_read = 0; file = fopen(filename, "re"); if (file != nullptr) { do { buf = static_cast(realloc(buf, *total_read + READSIZE + 1)); bytes_read = fread(buf + *total_read, 1, READSIZE, file); *total_read += bytes_read; buf[*total_read] = 0; } while (bytes_read != 0); fclose(file); } else if (showerror != 0) { NORM_ERR(READERR, filename); } return buf; } void pid_readlink(const char *file, char *p, unsigned int p_max_size) { std::unique_ptr buf(new char[p_max_size]); memset(buf.get(), 0, p_max_size); if (readlink(file, buf.get(), p_max_size) >= 0) { snprintf(p, p_max_size, "%s", buf.get()); } else { NORM_ERR(READERR, file); } } struct ll_string { char *string; struct ll_string *next; }; struct ll_string *addnode(struct ll_string *end, char *string) { auto *current = static_cast(malloc(sizeof(struct ll_string))); current->string = strdup(string); current->next = nullptr; if (end != nullptr) { end->next = current; } return current; } void freelist(struct ll_string *front) { if (front != nullptr) { free(front->string); if (front->next != nullptr) { freelist(front->next); } free(front); } } int inlist(struct ll_string *front, char *string) { struct ll_string *current; for (current = front; current != nullptr; current = current->next) { if (strcmp(current->string, string) == 0) { return 1; } } return 0; } void print_pid_chroot(struct text_object *obj, char *p, unsigned int p_max_size) { std::ostringstream pathstream; std::unique_ptr buf(new char[max_user_text.get(*state)]); generate_text_internal(buf.get(), max_user_text.get(*state), *obj->sub); pathstream << PROCDIR "/" << buf.get() << "/root"; pid_readlink(pathstream.str().c_str(), p, p_max_size); } void print_pid_cmdline(struct text_object *obj, char *p, unsigned int p_max_size) { char *buf; int i, bytes_read; std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); if (*(objbuf.get()) != 0) { pathstream << PROCDIR "/" << objbuf.get() << "/cmdline"; buf = readfile(pathstream.str().c_str(), &bytes_read, 1); if (buf != nullptr) { for (i = 0; i < bytes_read - 1; i++) { if (buf[i] == 0) { buf[i] = ' '; } } snprintf(p, p_max_size, "%s", buf); free(buf); } } else { NORM_ERR("$pid_cmdline didn't receive a argument"); } } void print_pid_cwd(struct text_object *obj, char *p, unsigned int p_max_size) { std::unique_ptr buf(new char[p_max_size]); int bytes_read; std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); pathstream << PROCDIR "/" << objbuf.get() << "/cwd"; bytes_read = readlink(pathstream.str().c_str(), buf.get(), p_max_size); if (bytes_read != -1) { buf[bytes_read] = 0; snprintf(p, p_max_size, "%s", buf.get()); } else { NORM_ERR(READERR, pathstream.str().c_str()); } } void print_pid_environ(struct text_object *obj, char *p, unsigned int p_max_size) { int i, total_read; pid_t pid; std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); char *buf, *var = strdup(obj->data.s); ; generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); if (sscanf(objbuf.get(), "%d %s", &pid, var) == 2) { for (i = 0; var[i] != 0; i++) { var[i] = toupper(static_cast(var[i])); } pathstream << PROCDIR "/" << pid << "/cwd"; buf = readfile(pathstream.str().c_str(), &total_read, 1); if (buf != nullptr) { for (i = 0; i < total_read; i += strlen(buf + i) + 1) { if (strncmp(buf + i, var, strlen(var)) == 0 && *(buf + i + strlen(var)) == '=') { snprintf(p, p_max_size, "%s", buf + i + strlen(var) + 1); free(buf); free(var); return; } } free(buf); } *p = 0; } free(var); } void print_pid_environ_list(struct text_object *obj, char *p, unsigned int p_max_size) { char *buf = nullptr; char *buf2; int bytes_read, total_read; int i = 0; std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); pathstream << PROCDIR "/" << objbuf.get() << "/environ"; buf = readfile(pathstream.str().c_str(), &total_read, 1); if (buf != nullptr) { for (bytes_read = 0; bytes_read < total_read; buf[i - 1] = ';') { buf2 = strdup(buf + bytes_read); bytes_read += strlen(buf2) + 1; sscanf(buf2, "%[^=]", buf + i); free(buf2); i = strlen(buf) + 1; } buf[i - 1] = 0; snprintf(p, p_max_size, "%s", buf); free(buf); } } void print_pid_exe(struct text_object *obj, char *p, unsigned int p_max_size) { std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); pathstream << PROCDIR "/" << objbuf.get() << "/exe"; pid_readlink(pathstream.str().c_str(), p, p_max_size); } void print_pid_nice(struct text_object *obj, char *p, unsigned int p_max_size) { char *buf = nullptr; int bytes_read; long int nice_value; std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); if (!obj->data.s) { pathstream << PROCDIR "/" << objbuf.get() << "/stat"; buf = readfile(pathstream.str().c_str(), &bytes_read, 1); if (buf != nullptr) { sscanf(buf, "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %*u %*u %*d " "%*d %*d %ld", &nice_value); snprintf(p, p_max_size, "%ld", nice_value); free(buf); } } else { NORM_ERR("$pid_nice didn't receive a argument"); } } void print_pid_openfiles(struct text_object *obj, char *p, unsigned int p_max_size) { DIR *dir; struct dirent *entry; std::unique_ptr buf(new char[p_max_size]); int length, totallength = 0; struct ll_string *files_front = nullptr; struct ll_string *files_back = nullptr; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); dir = opendir(objbuf.get()); if (dir != nullptr) { while ((entry = readdir(dir)) != nullptr) { if (entry->d_name[0] != '.') { snprintf(buf.get(), p_max_size, "%s/%s", objbuf.get(), entry->d_name); length = readlink(buf.get(), buf.get(), p_max_size); buf[length] = 0; if (inlist(files_front, buf.get()) == 0) { files_back = addnode(files_back, buf.get()); snprintf(p + totallength, p_max_size - totallength, "%s; ", buf.get()); totallength += length + strlen("; "); } if (files_front == nullptr) { files_front = files_back; } } } closedir(dir); freelist(files_front); p[totallength - strlen("; ")] = 0; } else { p[0] = 0; } } void print_pid_parent(struct text_object *obj, char *p, unsigned int p_max_size) { #define PARENT_ENTRY "PPid:\t" #define PARENTNOTFOUND "Can't find the process parent in '%s'" char *begin, *end, *buf = nullptr; int bytes_read; std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); pathstream << PROCDIR "/" << objbuf.get() << "/status"; buf = readfile(pathstream.str().c_str(), &bytes_read, 1); if (buf != nullptr) { begin = strstr(buf, PARENT_ENTRY); if (begin != nullptr) { begin += strlen(PARENT_ENTRY); end = strchr(begin, '\n'); if (end != nullptr) { *(end) = 0; } snprintf(p, p_max_size, "%s", begin); } else { NORM_ERR(PARENTNOTFOUND, pathstream.str().c_str()); } free(buf); } } void print_pid_priority(struct text_object *obj, char *p, unsigned int p_max_size) { char *buf = nullptr; int bytes_read; long int priority; std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); if (*(objbuf.get()) != 0) { pathstream << PROCDIR "/" << objbuf.get() << "/stat"; buf = readfile(pathstream.str().c_str(), &bytes_read, 1); if (buf != nullptr) { sscanf(buf, "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %*u %*u %*d " "%*d %ld", &priority); snprintf(p, p_max_size, "%ld", priority); free(buf); } } else { NORM_ERR("$pid_priority didn't receive a argument"); } } void print_pid_state(struct text_object *obj, char *p, unsigned int p_max_size) { #define STATE_ENTRY "State:\t" #define STATENOTFOUND "Can't find the process state in '%s'" char *begin, *end, *buf = nullptr; int bytes_read; std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); pathstream << PROCDIR "/" << objbuf.get() << "/status"; buf = readfile(pathstream.str().c_str(), &bytes_read, 1); if (buf != nullptr) { begin = strstr(buf, STATE_ENTRY); if (begin != nullptr) { begin += strlen(STATE_ENTRY) + 3; // +3 will strip the char representing the short state and // the space and '(' that follow end = strchr(begin, '\n'); if (end != nullptr) { *(end - 1) = 0; // -1 strips the ')' } snprintf(p, p_max_size, "%s", begin); } else { NORM_ERR(STATENOTFOUND, pathstream.str().c_str()); } free(buf); } } void print_pid_state_short(struct text_object *obj, char *p, unsigned int p_max_size) { char *begin, *buf = nullptr; int bytes_read; std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); pathstream << PROCDIR "/" << objbuf.get() << "/status"; buf = readfile(pathstream.str().c_str(), &bytes_read, 1); if (buf != nullptr) { begin = strstr(buf, STATE_ENTRY); if (begin != nullptr) { snprintf(p, p_max_size, "%c", *begin); } else { NORM_ERR(STATENOTFOUND, pathstream.str().c_str()); } free(buf); } } void print_pid_stderr(struct text_object *obj, char *p, unsigned int p_max_size) { std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); pathstream << PROCDIR "/" << objbuf.get() << "/fd/2"; pid_readlink(pathstream.str().c_str(), p, p_max_size); } void print_pid_stdin(struct text_object *obj, char *p, unsigned int p_max_size) { std::unique_ptr objbuf(new char[max_user_text.get(*state)]); std::ostringstream pathstream; generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); pathstream << PROCDIR "/" << objbuf.get() << "/fd/0"; pid_readlink(pathstream.str().c_str(), p, p_max_size); } void print_pid_stdout(struct text_object *obj, char *p, unsigned int p_max_size) { std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); pathstream << PROCDIR "/" << objbuf.get() << "/fd/1"; pid_readlink(pathstream.str().c_str(), p, p_max_size); } void scan_cmdline_to_pid_arg(struct text_object *obj, const char *arg, void *free_at_crash) { unsigned int i; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); /* FIXME */ generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); if (strlen(arg) > 0) { obj->data.s = strdup(arg); for (i = 0; obj->data.s[i] != 0; i++) { while (obj->data.s[i] == ' ' && obj->data.s[i + 1] == ' ') { memmove(obj->data.s + i, obj->data.s + i + 1, strlen(obj->data.s + i + 1) + 1); } } if (obj->data.s[i - 1] == ' ') { obj->data.s[i - 1] = 0; } } else { CRIT_ERR(obj, free_at_crash, "${cmdline_to_pid commandline}"); } } void print_cmdline_to_pid(struct text_object *obj, char *p, unsigned int p_max_size) { DIR *dir; struct dirent *entry; char *buf; int bytes_read, i; std::ostringstream pathstream; dir = opendir(PROCDIR); if (dir != nullptr) { while ((entry = readdir(dir)) != nullptr) { pathstream << PROCDIR "/" << entry->d_name << "/cmdline"; buf = readfile(pathstream.str().c_str(), &bytes_read, 0); if (buf != nullptr) { for (i = 0; i < bytes_read - 1; i++) { if (buf[i] == 0) { buf[i] = ' '; } } if (strstr(buf, obj->data.s) != nullptr) { snprintf(p, p_max_size, "%s", entry->d_name); free(buf); closedir(dir); return; } free(buf); } } closedir(dir); } else { NORM_ERR(READERR, PROCDIR); } } void print_pid_threads(struct text_object *obj, char *p, unsigned int p_max_size) { #define THREADS_ENTRY "Threads:\t" #define THREADSNOTFOUND \ "Can't find the number of the threads of the process in '%s'" char *begin, *end, *buf = nullptr; int bytes_read; std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); pathstream << PROCDIR "/" << objbuf.get() << "/status"; buf = readfile(pathstream.str().c_str(), &bytes_read, 1); if (buf != nullptr) { begin = strstr(buf, THREADS_ENTRY); if (begin != nullptr) { begin += strlen(THREADS_ENTRY); end = strchr(begin, '\n'); if (end != nullptr) { *(end) = 0; } snprintf(p, p_max_size, "%s", begin); } else { NORM_ERR(THREADSNOTFOUND, pathstream.str().c_str()); } free(buf); } } void print_pid_thread_list(struct text_object *obj, char *p, unsigned int p_max_size) { DIR *dir; struct dirent *entry; int totallength = 0; std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); pathstream << PROCDIR "/" << objbuf.get() << "/task"; dir = opendir(pathstream.str().c_str()); if (dir != nullptr) { while ((entry = readdir(dir)) != nullptr) { if (entry->d_name[0] != '.') { snprintf(p + totallength, p_max_size - totallength, "%s,", entry->d_name); totallength += strlen(entry->d_name) + 1; } } closedir(dir); if (totallength > 0 && p[totallength - 1] == ',') { p[totallength - 1] = 0; } } else { p[0] = 0; } } void print_pid_time_kernelmode(struct text_object *obj, char *p, unsigned int p_max_size) { char *buf = nullptr; int bytes_read; unsigned long int umtime; std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); if (*(objbuf.get()) != 0) { pathstream << PROCDIR "/" << objbuf.get() << "/stat"; buf = readfile(pathstream.str().c_str(), &bytes_read, 1); if (buf != nullptr) { sscanf(buf, "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %lu", &umtime); snprintf(p, p_max_size, "%.2f", static_cast(umtime) / 100); free(buf); } } else { NORM_ERR("$pid_time_kernelmode didn't receive a argument"); } } void print_pid_time_usermode(struct text_object *obj, char *p, unsigned int p_max_size) { char *buf = nullptr; int bytes_read; unsigned long int kmtime; std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); if (*(objbuf.get()) != 0) { pathstream << PROCDIR "/" << objbuf.get() << "/stat"; buf = readfile(pathstream.str().c_str(), &bytes_read, 1); if (buf != nullptr) { sscanf(buf, "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %*u %lu", &kmtime); snprintf(p, p_max_size, "%.2f", static_cast(kmtime) / 100); free(buf); } } else { NORM_ERR("$pid_time_usermode didn't receive a argument"); } } void print_pid_time(struct text_object *obj, char *p, unsigned int p_max_size) { char *buf = nullptr; int bytes_read; unsigned long int umtime, kmtime; std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); if (*(objbuf.get()) != 0) { pathstream << PROCDIR "/" << objbuf.get() << "/stat"; buf = readfile(pathstream.str().c_str(), &bytes_read, 1); if (buf != nullptr) { sscanf(buf, "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %lu %lu", &umtime, &kmtime); snprintf(p, p_max_size, "%.2f", static_cast(umtime + kmtime) / 100); free(buf); } } else { NORM_ERR("$pid_time didn't receive a argument"); } } enum xid_type { egid, euid, fsgid, fsuid, gid, sgid, suid, uid }; void print_pid_Xid(struct text_object *obj, char *p, int p_max_size, xid_type type) { char *begin, *end, *buf = nullptr; int bytes_read; std::ostringstream pathstream; std::string errorstring; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); pathstream << PROCDIR "/" << objbuf.get() << "/status"; buf = readfile(pathstream.str().c_str(), &bytes_read, 1); if (buf != nullptr) { switch (type) { case egid: begin = strstr(buf, "Gid:\t"); break; case euid: begin = strstr(buf, "Uid:\t"); break; case fsgid: begin = strstr(buf, "Gid:\t"); break; case fsuid: begin = strstr(buf, "Uid:\t"); break; case gid: begin = strstr(buf, "Gid:\t"); break; case sgid: begin = strstr(buf, "Gid:\t"); break; case suid: begin = strstr(buf, "Uid:\t"); break; case uid: begin = strstr(buf, "Uid:\t"); break; default: break; } if (begin != nullptr) { switch (type) { case gid: begin += strlen("Gid:\t"); break; case uid: begin += strlen("Uid:\t"); break; case egid: case euid: begin = strchr(begin, '\t'); begin++; begin = strchr(begin, '\t'); begin++; break; case sgid: case suid: begin = strchr(begin, '\t'); begin++; begin = strchr(begin, '\t'); begin++; begin = strchr(begin, '\t'); begin++; break; case fsgid: case fsuid: begin = strchr(begin, '\t'); begin++; begin = strchr(begin, '\t'); begin++; begin = strchr(begin, '\t'); begin++; begin = strchr(begin, '\t'); begin++; break; default: break; } if (type == fsgid || type == fsuid) { end = strchr(begin, '\n'); } else { end = strchr(begin, '\t'); } if (end != nullptr) { *(end) = 0; } snprintf(p, p_max_size, "%s", begin); } else { errorstring = "Can't find the process "; switch (type) { case egid: errorstring.append("effective gid"); break; case euid: errorstring.append("effective uid"); break; case fsgid: errorstring.append("process file system gid"); break; case fsuid: errorstring.append("process file system uid"); break; case gid: errorstring.append("real gid"); break; case sgid: errorstring.append("saved set gid"); break; case suid: errorstring.append("saved set uid"); break; case uid: errorstring.append("real uid"); break; default: break; } errorstring.append(" in '%s'"); NORM_ERR(errorstring.c_str(), pathstream.str().c_str()); } free(buf); } } void print_pid_egid(struct text_object *obj, char *p, unsigned int p_max_size) { print_pid_Xid(obj, p, p_max_size, egid); } void print_pid_euid(struct text_object *obj, char *p, unsigned int p_max_size) { print_pid_Xid(obj, p, p_max_size, euid); } void print_pid_fsgid(struct text_object *obj, char *p, unsigned int p_max_size) { print_pid_Xid(obj, p, p_max_size, fsgid); } void print_pid_fsuid(struct text_object *obj, char *p, unsigned int p_max_size) { print_pid_Xid(obj, p, p_max_size, fsuid); } void print_pid_gid(struct text_object *obj, char *p, unsigned int p_max_size) { print_pid_Xid(obj, p, p_max_size, gid); } void print_pid_sgid(struct text_object *obj, char *p, unsigned int p_max_size) { print_pid_Xid(obj, p, p_max_size, sgid); } void print_pid_suid(struct text_object *obj, char *p, unsigned int p_max_size) { print_pid_Xid(obj, p, p_max_size, suid); } void print_pid_uid(struct text_object *obj, char *p, unsigned int p_max_size) { print_pid_Xid(obj, p, p_max_size, uid); } void internal_print_pid_vm(struct text_object *obj, char *p, int p_max_size, const char *entry, const char *errorstring) { char *begin, *end, *buf = nullptr; int bytes_read; std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); pathstream << PROCDIR "/" << objbuf.get() << "/status"; buf = readfile(pathstream.str().c_str(), &bytes_read, 1); if (buf != nullptr) { begin = strstr(buf, entry); if (begin != nullptr) { begin += strlen(entry); while (*begin == '\t' || *begin == ' ') { begin++; } end = strchr(begin, '\n'); if (end != nullptr) { *(end) = 0; } snprintf(p, p_max_size, "%s", begin); } else { NORM_ERR(errorstring, pathstream.str().c_str()); } free(buf); } } void print_pid_vmpeak(struct text_object *obj, char *p, unsigned int p_max_size) { internal_print_pid_vm( obj, p, p_max_size, "VmPeak:\t", "Can't find the process peak virtual memory size in '%s'"); } void print_pid_vmsize(struct text_object *obj, char *p, unsigned int p_max_size) { internal_print_pid_vm(obj, p, p_max_size, "VmSize:\t", "Can't find the process virtual memory size in '%s'"); } void print_pid_vmlck(struct text_object *obj, char *p, unsigned int p_max_size) { internal_print_pid_vm(obj, p, p_max_size, "VmLck:\t", "Can't find the process locked memory size in '%s'"); } void print_pid_vmhwm(struct text_object *obj, char *p, unsigned int p_max_size) { internal_print_pid_vm( obj, p, p_max_size, "VmHWM:\t", "Can't find the process peak resident set size in '%s'"); } void print_pid_vmrss(struct text_object *obj, char *p, unsigned int p_max_size) { internal_print_pid_vm(obj, p, p_max_size, "VmHWM:\t", "Can't find the process resident set size in '%s'"); } void print_pid_vmdata(struct text_object *obj, char *p, unsigned int p_max_size) { internal_print_pid_vm(obj, p, p_max_size, "VmData:\t", "Can't find the process data segment size in '%s'"); } void print_pid_vmstk(struct text_object *obj, char *p, unsigned int p_max_size) { internal_print_pid_vm(obj, p, p_max_size, "VmData:\t", "Can't find the process stack segment size in '%s'"); } void print_pid_vmexe(struct text_object *obj, char *p, unsigned int p_max_size) { internal_print_pid_vm(obj, p, p_max_size, "VmData:\t", "Can't find the process text segment size in '%s'"); } void print_pid_vmlib(struct text_object *obj, char *p, unsigned int p_max_size) { internal_print_pid_vm( obj, p, p_max_size, "VmLib:\t", "Can't find the process shared library code size in '%s'"); } void print_pid_vmpte(struct text_object *obj, char *p, unsigned int p_max_size) { internal_print_pid_vm( obj, p, p_max_size, "VmPTE:\t", "Can't find the process page table entries size in '%s'"); } #define READ_ENTRY "read_bytes: " #define READNOTFOUND "Can't find the amount of bytes read in '%s'" void print_pid_read(struct text_object *obj, char *p, unsigned int p_max_size) { char *begin, *end, *buf = nullptr; int bytes_read; std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); pathstream << PROCDIR "/" << objbuf.get() << "/io"; buf = readfile(pathstream.str().c_str(), &bytes_read, 1); if (buf != nullptr) { begin = strstr(buf, READ_ENTRY); if (begin != nullptr) { end = strchr(begin, '\n'); if (end != nullptr) { *(end) = 0; } snprintf(p, p_max_size, "%s", begin); } else { NORM_ERR(READNOTFOUND, pathstream.str().c_str()); } free(buf); } } #define WRITE_ENTRY "write_bytes: " #define WRITENOTFOUND "Can't find the amount of bytes written in '%s'" void print_pid_write(struct text_object *obj, char *p, unsigned int p_max_size) { char *begin, *end, *buf = nullptr; int bytes_read; std::ostringstream pathstream; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); pathstream << PROCDIR "/" << objbuf.get() << "/io"; buf = readfile(pathstream.str().c_str(), &bytes_read, 1); if (buf != nullptr) { begin = strstr(buf, WRITE_ENTRY); if (begin != nullptr) { end = strchr(begin, '\n'); if (end != nullptr) { *(end) = 0; } snprintf(p, p_max_size, "%s", begin); } else { NORM_ERR(WRITENOTFOUND, pathstream.str().c_str()); } free(buf); } } conky-1.12.2/src/proc.h000066400000000000000000000120211404127277500146300ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef CONKY_PROC_H #define CONKY_PROC_H #define PROCDIR "/proc" #define READERR "Can't read '%s'" #define READSIZE 128 void print_pid_chroot(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_cmdline(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_cwd(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_environ(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_environ_list(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_exe(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_nice(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_openfiles(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_parent(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_priority(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_state(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_state_short(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_stderr(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_stdin(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_stdout(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_threads(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_thread_list(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_time_kernelmode(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_time_usermode(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_time(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_uid(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_euid(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_suid(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_fsuid(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_gid(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_egid(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_sgid(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_fsgid(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_read(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_vmpeak(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_vmsize(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_vmlck(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_vmhwm(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_vmrss(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_vmdata(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_vmstk(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_vmexe(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_vmlib(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_vmpte(struct text_object *obj, char *p, unsigned int p_max_size); void print_pid_write(struct text_object *obj, char *p, unsigned int p_max_size); void scan_cmdline_to_pid_arg(struct text_object *obj, const char *arg, void *free_at_crash); void print_cmdline_to_pid(struct text_object *obj, char *p, unsigned int p_max_size); #endif /* CONKY_PROC_H */ conky-1.12.2/src/prss.cc000066400000000000000000000141601404127277500150200ustar00rootroot00000000000000/* * * Copyright (c) 2007 Mikko Sysikaski * Toni Spets * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ #include "prss.h" #include #include #include "conky.h" #include "logging.h" #ifndef PARSE_OPTIONS #define PARSE_OPTIONS 0 #endif void prss_parse_doc(PRSS *result, xmlDocPtr doc); PRSS::PRSS(const std::string &xml_data) : version(nullptr), title(nullptr), link(nullptr), description(nullptr), language(nullptr), generator(nullptr), managingEditor(nullptr), webMaster(nullptr), docs(nullptr), lastBuildDate(nullptr), pubDate(nullptr), copyright(nullptr), ttl(nullptr), items(nullptr), item_count(0) { std::unique_ptr doc( xmlReadMemory(xml_data.c_str(), xml_data.length(), "", nullptr, PARSE_OPTIONS), xmlFreeDoc); if (!doc) throw std::runtime_error("Unable to parse rss data"); prss_parse_doc(this, doc.get()); } void free_rss_items(PRSS *data) { int i; if (data->items) { for (i = 0; i < data->item_count; i++) { #define CLEAR(a) free_and_zero(data->items[i].a); CLEAR(title); CLEAR(link); CLEAR(description); CLEAR(category); CLEAR(pubDate); CLEAR(guid); #undef CLEAR } free_and_zero(data->items); data->item_count = 0; } } PRSS::~PRSS() { free_rss_items(this); free(version); free(title); free(link); free(description); free(language); free(pubDate); free(lastBuildDate); free(generator); free(docs); free(managingEditor); free(webMaster); free(copyright); free(ttl); } static inline void prss_null_item(PRSS_Item *i) { if (i != nullptr) { memset(i, 0, sizeof(*i)); } } static inline void read_item(PRSS_Item *res, xmlNodePtr data) { prss_null_item(res); for (; data; data = data->next) { xmlNodePtr child; if (data->type != XML_ELEMENT_NODE) { continue; } child = data->children; if (!child) { continue; } #define ASSIGN(a) \ if (strcasecmp((const char *)data->name, #a) == EQUAL) { \ free_and_zero(res->a); \ res->a = strdup((const char *)child->content); \ continue; \ } ASSIGN(title); ASSIGN(link); ASSIGN(description); ASSIGN(category); ASSIGN(pubDate); ASSIGN(guid); #undef ASSIGN } } static inline void read_element(PRSS *res, xmlNodePtr n) { xmlNodePtr child; if (n->type != XML_ELEMENT_NODE) { return; } child = n->children; if (!child) { return; } #define ASSIGN(a) \ if (strcasecmp((const char *)n->name, #a) == EQUAL) { \ free_and_zero(res->a); \ res->a = strdup((const char *)child->content); \ return; \ } ASSIGN(title); ASSIGN(link); ASSIGN(description); ASSIGN(language); ASSIGN(pubDate); ASSIGN(lastBuildDate); ASSIGN(generator); ASSIGN(docs); ASSIGN(managingEditor); ASSIGN(webMaster); ASSIGN(copyright); ASSIGN(ttl); #undef ASSIGN if (!strcasecmp((const char *)n->name, "item")) { read_item(&res->items[res->item_count++], n->children); } } static inline int parse_rss_2_0(PRSS *res, xmlNodePtr root) { xmlNodePtr channel = root->children; xmlNodePtr n; int items = 0; DBGP("parsing rss 2.0 or <1 doc"); while (channel && (channel->type != XML_ELEMENT_NODE || strcmp((const char *)channel->name, "channel"))) { channel = channel->next; } if (!channel) { return 0; } for (n = channel->children; n; n = n->next) { if (n->type == XML_ELEMENT_NODE && !strcmp((const char *)n->name, "item")) { ++items; } } free_and_zero(res->version); res->version = strndup("2.0", text_buffer_size.get(*state)); free_rss_items(res); res->items = (PRSS_Item *)malloc(items * sizeof(PRSS_Item)); res->item_count = 0; for (n = channel->children; n; n = n->next) { read_element(res, n); } return 1; } static inline int parse_rss_1_0(PRSS *res, xmlNodePtr root) { int items = 0; xmlNodePtr n; DBGP("parsing rss 1.0 doc"); for (n = root->children; n; n = n->next) { if (n->type == XML_ELEMENT_NODE) { if (!strcmp((const char *)n->name, "item")) { ++items; } else if (!strcmp((const char *)n->name, "channel")) { xmlNodePtr i; for (i = n->children; i; i = i->next) { read_element(res, i); } } } } free_and_zero(res->version); res->version = strndup("1.0", text_buffer_size.get(*state)); free_rss_items(res); res->items = (PRSS_Item *)malloc(items * sizeof(PRSS_Item)); res->item_count = 0; for (n = root->children; n; n = n->next) { if (n->type == XML_ELEMENT_NODE && !strcmp((const char *)n->name, "item")) { read_item(&res->items[res->item_count++], n->children); } } return 1; } void prss_parse_doc(PRSS *result, xmlDocPtr doc) { xmlNodePtr root = xmlDocGetRootElement(doc); do { if (root->type == XML_ELEMENT_NODE) { if (!strcmp((const char *)root->name, "RDF")) { // RSS 1.0 document parse_rss_1_0(result, root); return; } else if (!strcmp((const char *)root->name, "rss")) { // RSS 2.0 or <1.0 document parse_rss_2_0(result, root); return; } } root = root->next; } while (root); return; } conky-1.12.2/src/prss.h000066400000000000000000000026431404127277500146650ustar00rootroot00000000000000/* * * Copyright (c) 2007 Mikko Sysikaski * Toni Spets * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef PRSS_H #define PRSS_H #include #include typedef struct PRSS_Item_ { char *title; char *link; char *description; char *category; char *pubDate; char *guid; } PRSS_Item; class PRSS { public: char *version; char *title; char *link; char *description; char *language; char *generator; char *managingEditor; char *webMaster; char *docs; char *lastBuildDate; char *pubDate; char *copyright; char *ttl; PRSS_Item *items; int item_count; explicit PRSS(const std::string &xml_data); ~PRSS(); }; #endif /* PRSS_H */ conky-1.12.2/src/pulseaudio.cc000066400000000000000000000274101404127277500162050ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "pulseaudio.h" #include #include #include "common.h" #include "config.h" #include "conky.h" #include "core.h" #include "logging.h" #include "specials.h" #include "text_object.h" struct pulseaudio_default_results get_result_copy(); const struct pulseaudio_default_results pulseaudio_result0 = {std::string(), std::string(), std::string(), std::string(), 0, 0, 0, 0, std::string(), std::string(), 0}; pulseaudio_c *pulseaudio = nullptr; void pa_sink_info_callback(pa_context *c, const pa_sink_info *i, int eol, void *data) { if (i != nullptr && data) { struct pulseaudio_default_results *pdr = (struct pulseaudio_default_results *)data; pdr->sink_description.assign(i->description); pdr->sink_mute = i->mute; pdr->sink_card = i->card; pdr->sink_index = i->index; if (i->active_port != nullptr) { pdr->sink_active_port_name.assign(i->active_port->name); pdr->sink_active_port_description.assign(i->active_port->description); } else { pdr->sink_active_port_name.erase(); pdr->sink_active_port_description.erase(); } pdr->sink_volume = round_to_positive_int( 100.0f * (float)pa_cvolume_avg(&(i->volume)) / (float)PA_VOLUME_NORM); pa_threaded_mainloop_signal(pulseaudio->mainloop, 0); } (void)c; ++eol; } void pa_server_info_callback(pa_context *c, const pa_server_info *i, void *userdata) { if (i != nullptr) { struct pulseaudio_default_results *pdr = (struct pulseaudio_default_results *)userdata; pdr->sink_name.assign(i->default_sink_name); pa_threaded_mainloop_signal(pulseaudio->mainloop, 0); } (void)c; } void pa_server_sink_info_callback(pa_context *c, const pa_server_info *i, void *userdata) { if (i != nullptr) { struct pulseaudio_default_results *pdr = (struct pulseaudio_default_results *)userdata; pdr->sink_name.assign(i->default_sink_name); if (pdr->sink_name.empty()) return; pa_operation *op; if (!(op = pa_context_get_sink_info_by_name(c, pdr->sink_name.c_str(), pa_sink_info_callback, pdr))) { NORM_ERR("pa_context_get_sink_info_by_index() failed"); return; } pa_operation_unref(op); } (void)c; } void pa_card_info_callback(pa_context *c, const pa_card_info *card, int eol, void *userdata) { if (card) { struct pulseaudio_default_results *pdr = (struct pulseaudio_default_results *)userdata; pdr->card_name.assign(card->name); pdr->card_index = card->index; pdr->card_active_profile_description.assign( card->active_profile->description); pa_threaded_mainloop_signal(pulseaudio->mainloop, 0); } (void)c; eol++; } void context_state_cb(pa_context *c, void *userdata) { pulseaudio_c *puau_int = static_cast(userdata); switch (pa_context_get_state(c)) { case PA_CONTEXT_UNCONNECTED: case PA_CONTEXT_CONNECTING: case PA_CONTEXT_AUTHORIZING: case PA_CONTEXT_SETTING_NAME: break; case PA_CONTEXT_READY: { puau_int->cstate = PULSE_CONTEXT_READY; break; } case PA_CONTEXT_FAILED: case PA_CONTEXT_TERMINATED: { puau_int->cstate = PULSE_CONTEXT_FINISHED; break; } default: return; } } #define PULSEAUDIO_OP(command, error_msg) \ if (!(op = command)) { \ NORM_ERR(error_msg); \ return; \ } \ pa_operation_unref(op); void subscribe_cb(pa_context *c, pa_subscription_event_type_t t, uint32_t index, void *userdata) { struct pulseaudio_default_results *res = (struct pulseaudio_default_results *)userdata; switch (t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) { case PA_SUBSCRIPTION_EVENT_SINK: { if (res->sink_name.empty()) return; pa_operation *op; PULSEAUDIO_OP(pa_context_get_sink_info_by_name( c, res->sink_name.c_str(), pa_sink_info_callback, res), "pa_context_get_sink_info_by_name failed"); } break; case PA_SUBSCRIPTION_EVENT_CARD: if (index == res->card_index && res->card_index != (uint32_t)-1) { pa_operation *op; PULSEAUDIO_OP(pa_context_get_card_info_by_index( c, index, pa_card_info_callback, res), "pa_context_get_card_info_by_index() failed") } break; case PA_SUBSCRIPTION_EVENT_SERVER: { pa_operation *op; PULSEAUDIO_OP( pa_context_get_server_info(c, pa_server_sink_info_callback, res), "pa_context_get_server_info() failed"); } break; } } #define PULSEAUDIO_WAIT(COMMAND) \ { \ op = COMMAND; \ while (pa_operation_get_state(op) == PA_OPERATION_RUNNING) { \ pa_threaded_mainloop_wait(pulseaudio->mainloop); \ } \ pa_operation_unref(op); \ } void init_pulseaudio(struct text_object *obj) { // already initialized (void)obj; if (pulseaudio != nullptr && pulseaudio->cstate == PULSE_CONTEXT_READY) { pulseaudio->ninits++; obj->data.opaque = (void *)pulseaudio; return; } pulseaudio = new pulseaudio_c(); obj->data.opaque = (void *)pulseaudio; pulseaudio->ninits++; // Create a mainloop API and connection to the default server pulseaudio->mainloop = pa_threaded_mainloop_new(); if (!pulseaudio->mainloop) NORM_ERR("Cannot create pulseaudio mainloop"); pulseaudio->mainloop_api = pa_threaded_mainloop_get_api(pulseaudio->mainloop); if (!pulseaudio->mainloop_api) NORM_ERR("Cannot get mainloop api"); pulseaudio->context = pa_context_new(pulseaudio->mainloop_api, "Conky Infos"); // This function defines a callback so the server will tell us its state. pa_context_set_state_callback(pulseaudio->context, context_state_cb, pulseaudio); // This function connects to the pulse server if (pa_context_connect(pulseaudio->context, nullptr, (pa_context_flags_t)0, nullptr) < 0) { CRIT_ERR(nullptr, NULL, "Cannot connect to pulseaudio"); return; } pa_threaded_mainloop_start(pulseaudio->mainloop); while (pulseaudio->cstate != PULSE_CONTEXT_READY) { struct timespec req; struct timespec rem; req.tv_sec = 1; req.tv_nsec = 200000; nanosleep(&req, &rem); } // Initial parameters update pa_operation *op; PULSEAUDIO_WAIT(pa_context_get_server_info( pulseaudio->context, pa_server_info_callback, &pulseaudio->result)); if (pulseaudio->result.sink_name.empty()) return; PULSEAUDIO_WAIT(pa_context_get_sink_info_by_name( pulseaudio->context, pulseaudio->result.sink_name.c_str(), pa_sink_info_callback, &pulseaudio->result)); if (pulseaudio->result.sink_name.empty()) { NORM_ERR("Incorrect pulseaudio sink information."); return; } if (pulseaudio->result.sink_card != (uint32_t)-1) PULSEAUDIO_WAIT(pa_context_get_card_info_by_index( pulseaudio->context, pulseaudio->result.sink_card, pa_card_info_callback, &pulseaudio->result)); // get notification when something changes in PA pa_context_set_subscribe_callback(pulseaudio->context, subscribe_cb, &pulseaudio->result); if (!(op = pa_context_subscribe( pulseaudio->context, (pa_subscription_mask_t)(PA_SUBSCRIPTION_MASK_SINK | PA_SUBSCRIPTION_MASK_SERVER | PA_SUBSCRIPTION_MASK_CARD), nullptr, NULL))) { NORM_ERR("pa_context_subscribe() failed"); return; } pa_operation_unref(op); } void free_pulseaudio(struct text_object *obj) { pulseaudio_c *puau_int = static_cast(obj->data.opaque); if (!puau_int) return; if (--puau_int->ninits > 0) { obj->data.opaque = nullptr; return; } puau_int->cstate = PULSE_CONTEXT_FINISHED; if (puau_int->context) { pa_context_set_state_callback(puau_int->context, nullptr, NULL); pa_context_disconnect(puau_int->context); pa_context_unref(puau_int->context); } if (puau_int->mainloop) { pa_threaded_mainloop_stop(puau_int->mainloop); pa_threaded_mainloop_free(puau_int->mainloop); } delete puau_int; puau_int = nullptr; } struct pulseaudio_default_results get_pulseaudio(struct text_object *obj) { pulseaudio_c *puau_int = static_cast(obj->data.opaque); if (puau_int && puau_int->cstate == PULSE_CONTEXT_READY) return puau_int->result; return pulseaudio_result0; } uint8_t puau_vol(struct text_object *obj) { return get_pulseaudio(obj).sink_volume; } int puau_muted(struct text_object *obj) { return get_pulseaudio(obj).sink_mute; } void print_puau_sink_description(struct text_object *obj, char *p, unsigned int p_max_size) { snprintf(p, p_max_size, "%s", get_pulseaudio(obj).sink_description.c_str()); } void print_puau_sink_active_port_name(struct text_object *obj, char *p, unsigned int p_max_size) { snprintf(p, p_max_size, "%s", get_pulseaudio(obj).sink_active_port_name.c_str()); } void print_puau_sink_active_port_description(struct text_object *obj, char *p, unsigned int p_max_size) { snprintf(p, p_max_size, "%s", get_pulseaudio(obj).sink_active_port_description.c_str()); } void print_puau_card_active_profile(struct text_object *obj, char *p, unsigned int p_max_size) { snprintf(p, p_max_size, "%s", get_pulseaudio(obj).card_active_profile_description.c_str()); } void print_puau_card_name(struct text_object *obj, char *p, unsigned int p_max_size) { snprintf(p, p_max_size, "%s", get_pulseaudio(obj).card_name.c_str()); } double puau_volumebarval(struct text_object *obj) { return get_pulseaudio(obj).sink_volume / 100.0f; } conky-1.12.2/src/pulseaudio.h000066400000000000000000000061111404127277500160420ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _PULSEAUDIO_H #define _PULSEAUDIO_H #include #include "text_object.h" void init_pulseaudio(struct text_object *obj); void free_pulseaudio(struct text_object *obj); uint8_t puau_vol(struct text_object *); // preserve pa_* for libpulse void print_puau_sink_description(struct text_object *obj, char *p, unsigned int p_max_size); void print_puau_sink_active_port_name(struct text_object *obj, char *p, unsigned int p_max_size); void print_puau_sink_active_port_description(struct text_object *obj, char *p, unsigned int p_max_size); void print_puau_card_name(struct text_object *obj, char *p, unsigned int p_max_size); void print_puau_card_active_profile(struct text_object *obj, char *p, unsigned int p_max_size); double puau_volumebarval(struct text_object *obj); int puau_muted(struct text_object *obj); struct pulseaudio_default_results { // default sink std::string sink_name; std::string sink_description; std::string sink_active_port_name; std::string sink_active_port_description; uint32_t sink_card; int sink_mute; uint32_t sink_index; unsigned int sink_volume; // percentage // default card std::string card_active_profile_description; std::string card_name; uint32_t card_index; }; enum pulseaudio_state { PULSE_CONTEXT_INITIALIZING, PULSE_CONTEXT_READY, PULSE_CONTEXT_FINISHED }; class pulseaudio_c { public: pa_threaded_mainloop *mainloop; pa_mainloop_api *mainloop_api; pa_context *context; volatile enum pulseaudio_state cstate; int ninits; struct pulseaudio_default_results result; pulseaudio_c() : mainloop(nullptr), mainloop_api(nullptr), context(nullptr), cstate(PULSE_CONTEXT_INITIALIZING), ninits(0), result({std::string(), std::string(), std::string(), std::string(), 0, 0, 0, 0, std::string(), std::string(), 0}){}; }; #endif /* _PULSEAUDIO_H */ conky-1.12.2/src/read_tcpip.cc000066400000000000000000000167271404127277500161560ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include #include #include #include #include #include #include "conky.h" #include "logging.h" #include "text_object.h" #ifndef SOCK_CLOEXEC #define SOCK_CLOEXEC O_CLOEXEC #endif /* SOCK_CLOEXEC */ struct read_tcpip_data { char *host; unsigned int port; }; void parse_read_tcpip_arg(struct text_object *obj, const char *arg, void *free_at_crash) { struct read_tcpip_data *rtd; rtd = static_cast( malloc(sizeof(struct read_tcpip_data))); memset(rtd, 0, sizeof(struct read_tcpip_data)); rtd->host = static_cast(malloc(text_buffer_size.get(*state))); sscanf(arg, "%s", rtd->host); sscanf(arg + strlen(rtd->host), "%u", &(rtd->port)); if (rtd->port == 0) { rtd->port = atoi(rtd->host); strncpy(rtd->host, "localhost", 10); } if (rtd->port < 1 || rtd->port > 65535) { CRIT_ERR(obj, free_at_crash, "read_tcp and read_udp need a port from 1 to 65535 as argument"); } obj->data.opaque = rtd; } void parse_tcp_ping_arg(struct text_object *obj, const char *arg, void *free_at_crash) { #define DEFAULT_TCP_PING_PORT 80 struct sockaddr_in *addr; char *hostname; struct hostent *he; addr = static_cast(malloc(sizeof(struct sockaddr_in))); obj->data.opaque = addr; memset(addr, 0, sizeof(struct sockaddr_in)); hostname = static_cast(malloc(strlen(arg) + 1)); switch (sscanf(arg, "%s %" SCNu16, hostname, &(addr->sin_port))) { case 1: addr->sin_port = DEFAULT_TCP_PING_PORT; break; case 2: break; default: // this point should never be reached free(hostname); CRIT_ERR(obj, free_at_crash, "tcp_ping: Reading arguments failed"); } if ((he = gethostbyname(hostname)) == nullptr) { NORM_ERR("tcp_ping: Problem with resolving '%s', using 'localhost' instead", hostname); if ((he = gethostbyname("localhost")) == nullptr) { free(hostname); CRIT_ERR(obj, free_at_crash, "tcp_ping: Resolving 'localhost' also failed"); } } if (he != nullptr) { free(hostname); addr->sin_port = htons(addr->sin_port); addr->sin_family = he->h_addrtype; memcpy(&(addr->sin_addr), he->h_addr, he->h_length); } } void print_tcp_ping(struct text_object *obj, char *p, unsigned int p_max_size) { struct timeval tv1 { }, tv2{}, timeout{}; auto *addr = static_cast(obj->data.opaque); int addrlen = sizeof(struct sockaddr); int sock = socket(addr->sin_family, SOCK_STREAM | SOCK_CLOEXEC, IPPROTO_TCP); unsigned long long usecdiff; fd_set writefds; if (sock != -1) { fcntl(sock, F_SETFL, O_NONBLOCK | fcntl(sock, F_GETFL)); FD_ZERO(&writefds); FD_SET(sock, &writefds); #define TCP_PING_TIMEOUT 10 timeout.tv_sec = TCP_PING_TIMEOUT; timeout.tv_usec = (TCP_PING_TIMEOUT - timeout.tv_sec) * 1000000; connect(sock, reinterpret_cast(addr), addrlen); // this will "fail" because sock is non-blocking if (errno == EINPROGRESS) { // but EINPROGRESS is only a "false fail" gettimeofday(&tv1, nullptr); if (select(sock + 1, nullptr, &writefds, nullptr, &timeout) != -1) { gettimeofday(&tv2, nullptr); usecdiff = ((tv2.tv_sec - tv1.tv_sec) * 1000000) + tv2.tv_usec - tv1.tv_usec; if (usecdiff <= TCP_PING_TIMEOUT * 1000000) { snprintf(p, p_max_size, "%llu", (usecdiff / 1000U)); } else { #define TCP_PING_FAILED "down" snprintf(p, p_max_size, "%s", TCP_PING_FAILED); } } else { NORM_ERR("tcp_ping: Couldn't wait on the 'pong'"); } } else { NORM_ERR("tcp_ping: Couldn't start connection"); } close(sock); } else { NORM_ERR("tcp_ping: Couldn't create socket"); } } void print_read_tcpip(struct text_object *obj, char *p, int p_max_size, int protocol) { int sock, received; fd_set readfds; struct timeval tv {}; auto *rtd = static_cast(obj->data.opaque); struct addrinfo hints {}; struct addrinfo *airesult, *rp; char portbuf[8]; if (rtd == nullptr) { return; } memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = protocol == IPPROTO_TCP ? SOCK_STREAM : SOCK_DGRAM; hints.ai_flags = 0; hints.ai_protocol = protocol; snprintf(portbuf, 8, "%u", rtd->port); if (getaddrinfo(rtd->host, portbuf, &hints, &airesult) != 0) { NORM_ERR("%s: Problem with resolving the hostname", protocol == IPPROTO_TCP ? "read_tcp" : "read_udp"); return; } for (rp = airesult; rp != nullptr; rp = rp->ai_next) { sock = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); if (sock == -1) { continue; } if (connect(sock, rp->ai_addr, rp->ai_addrlen) != -1) { break; } close(sock); return; } freeaddrinfo(airesult); if (rp == nullptr) { if (protocol == IPPROTO_TCP) { NORM_ERR("read_tcp: Couldn't create a connection"); } else { NORM_ERR("read_udp: Couldn't listen"); // other error because udp is // connectionless } return; } if (protocol == IPPROTO_UDP) { // when using udp send a zero-length packet to let the other end know of our // existence if (write(sock, nullptr, 0) < 0) { NORM_ERR("read_udp: Couldn't create a empty package"); } } FD_ZERO(&readfds); FD_SET(sock, &readfds); tv.tv_sec = 1; tv.tv_usec = 0; if (select(sock + 1, &readfds, nullptr, nullptr, &tv) > 0) { received = recv(sock, p, p_max_size, 0); if (received != -1) { p[received] = 0; } else { p[0] = 0; } } close(sock); } void print_read_tcp(struct text_object *obj, char *p, unsigned int p_max_size) { print_read_tcpip(obj, p, p_max_size, IPPROTO_TCP); } void print_read_udp(struct text_object *obj, char *p, unsigned int p_max_size) { print_read_tcpip(obj, p, p_max_size, IPPROTO_UDP); } void free_read_tcpip(struct text_object *obj) { auto *rtd = static_cast(obj->data.opaque); if (rtd == nullptr) { return; } free_and_zero(rtd->host); free_and_zero(obj->data.opaque); } void free_tcp_ping(struct text_object *obj) { auto *addr = static_cast(obj->data.opaque); if (addr == nullptr) { return; } free_and_zero(obj->data.opaque); } conky-1.12.2/src/read_tcpip.h000066400000000000000000000030611404127277500160030ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _READ_TCP_H #define _READ_TCP_H void parse_read_tcpip_arg(struct text_object *, const char *, void *); void parse_tcp_ping_arg(struct text_object *obj, const char *arg, void *free_at_crash); void print_read_tcp(struct text_object *, char *, unsigned int); void print_read_udp(struct text_object *, char *, unsigned int); void print_tcp_ping(struct text_object *, char *, unsigned int); void free_read_tcpip(struct text_object *); void free_tcp_ping(struct text_object *); #endif /* _READ_TCP_H */ conky-1.12.2/src/rss.cc000066400000000000000000000124051404127277500146400ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2007 Toni Spets * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include #include "ccurl_thread.h" #include "conky.h" #include "logging.h" #include "prss.h" #include "text_object.h" struct rss_data { char uri[128]; char action[64]; int act_par; float interval; unsigned int nrspaces; }; namespace { class rss_cb : public curl_callback> { typedef curl_callback> Base; protected: virtual void process_data() { try { std::shared_ptr tmp(new PRSS(data)); std::unique_lock lock(Base::result_mutex); Base::result = tmp; } catch (std::runtime_error &e) { NORM_ERR("%s", e.what()); } } public: rss_cb(uint32_t period, const std::string &uri) : Base(period, Base::Tuple(uri)) {} }; } // namespace static void rss_process_info(char *p, int p_max_size, const std::string &uri, char *action, int act_par, int interval, unsigned int nrspaces) { char *str; uint32_t period = std::max(lround(interval / active_update_interval()), 1l); auto cb = conky::register_cb(period, uri); assert(act_par >= 0 && action); std::shared_ptr data = cb->get_result_copy(); if (!data || data->item_count < 1) { *p = 0; } else { /* * XXX: Refactor this so that we can retrieve any of the fields in the * PRSS struct (in prss.h). */ if (strcmp(action, "feed_title") == EQUAL) { str = data->title; if (str && strlen(str) > 0) { // remove trailing new line if one exists if (str[strlen(str) - 1] == '\n') { str[strlen(str) - 1] = 0; } snprintf(p, p_max_size, "%s", str); } } else if (strcmp(action, "item_title") == EQUAL) { if (act_par < data->item_count) { str = data->items[act_par].title; // remove trailing new line if one exists if (str && strlen(str) > 0) { if (str[strlen(str) - 1] == '\n') { str[strlen(str) - 1] = 0; } snprintf(p, p_max_size, "%s", str); } } } else if (strcmp(action, "item_desc") == EQUAL) { if (act_par < data->item_count) { str = data->items[act_par].description; // remove trailing new line if one exists if (str && strlen(str) > 0) { if (str[strlen(str) - 1] == '\n') { str[strlen(str) - 1] = 0; } snprintf(p, p_max_size, "%s", str); } } } else if (strcmp(action, "item_titles") == EQUAL) { if (data->item_count > 0) { int itmp; int show; //'tmpspaces' is a string with spaces too be placed in front of each // title char *tmpspaces = (char *)malloc(nrspaces + 1); memset(tmpspaces, ' ', nrspaces); tmpspaces[nrspaces] = 0; if (act_par > data->item_count) { show = data->item_count; } else { show = act_par; } for (itmp = 0; itmp < show; itmp++) { PRSS_Item *item = &data->items[itmp]; str = item->title; if (str) { // don't add new line before first item if (itmp > 0) { strncat(p, "\n", p_max_size); } /* remove trailing new line if one exists, * we have our own */ if (strlen(str) > 0 && str[strlen(str) - 1] == '\n') { str[strlen(str) - 1] = 0; } strncat(p, tmpspaces, p_max_size); strncat(p, str, p_max_size); } } free(tmpspaces); } } else { NORM_ERR("rss: Invalid action '%s'", action); } } } void rss_scan_arg(struct text_object *obj, const char *arg) { int argc; struct rss_data *rd; rd = (struct rss_data *)malloc(sizeof(struct rss_data)); memset(rd, 0, sizeof(struct rss_data)); argc = sscanf(arg, "%127s %f %63s %d %u", rd->uri, &rd->interval, rd->action, &rd->act_par, &rd->nrspaces); if (argc < 3) { NORM_ERR("wrong number of arguments for $rss"); free(rd); return; } obj->data.opaque = rd; } void rss_print_info(struct text_object *obj, char *p, unsigned int p_max_size) { struct rss_data *rd = (struct rss_data *)obj->data.opaque; if (!rd) { NORM_ERR("error processing RSS data"); return; } rss_process_info(p, p_max_size, rd->uri, rd->action, rd->act_par, rd->interval, rd->nrspaces); } void rss_free_obj_info(struct text_object *obj) { free_and_zero(obj->data.opaque); } conky-1.12.2/src/rss.h000066400000000000000000000020551404127277500145020ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef RSS_H_ #define RSS_H_ void rss_scan_arg(struct text_object *, const char *); void rss_print_info(struct text_object *, char *, unsigned int); void rss_free_obj_info(struct text_object *); #endif /*RSS_H_*/ conky-1.12.2/src/scroll.cc000066400000000000000000000226741404127277500153400ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include "conky.h" #include "core.h" #include "logging.h" #include "specials.h" #include "text_object.h" #include "x11.h" /** * Length of a character in bytes. * @param c first byte of the character */ inline int scroll_character_length(char c) { #ifdef BUILD_X11 if (utf8_mode.get(*state)) { auto uc = static_cast(c); int len = 0; if (c == -1) { return 1; } if ((uc & 0x80) == 0) { return 1; } while (len < 7 && (uc & (0x80 >> len)) != 0) { ++len; } return len; } #else /* BUILD_X11 */ (void)c; #endif /* BUILD_X11 */ return 1; } /** * Check if a byte should be skipped when counting characters to scroll text to * right. */ inline bool scroll_check_skip_byte(char c) { #ifdef BUILD_X11 // Check if byte matches UTF-8 continuation byte pattern (0b10xxxxxx) if (utf8_mode.get(*state) && (c & 0xC0) == 0x80) { return true; } #endif return SPECIAL_CHAR == c; } #define SCROLL_LEFT 1 #define SCROLL_RIGHT 2 #define SCROLL_WAIT 3 struct scroll_data { char *text; unsigned int show; unsigned int step; int wait; unsigned int wait_arg; signed int start; long resetcolor; int direction; }; /** * Get count of characters to right from (sd->start) position. */ static unsigned int scroll_count_characters_to_right( struct scroll_data *sd, const std::vector &buf) { unsigned int n = 0; unsigned int offset = sd->start; while ('\0' != buf[offset] && offset < buf.size()) { offset += scroll_character_length(buf[offset]); ++n; } return n; } static void scroll_scroll_left(struct scroll_data *sd, const std::vector &buf, unsigned int amount) { for (unsigned int i = 0; (i < amount) && (buf[sd->start] != '\0') && (static_cast(sd->start) < buf.size()); ++i) { sd->start += scroll_character_length(buf[sd->start]); } if (buf[sd->start] == 0 || static_cast(sd->start) > strlen(buf.data())) { sd->start = 0; } } static void scroll_scroll_right(struct scroll_data *sd, const std::vector &buf, unsigned int amount) { for (unsigned int i = 0; i < amount; ++i) { if (sd->start <= 0) { sd->start = static_cast(strlen(&(buf[0]))); } while (--(sd->start) >= 0) { if (!scroll_check_skip_byte(buf[sd->start])) { break; } } } } void parse_scroll_arg(struct text_object *obj, const char *arg, void *free_at_crash, char *free_at_crash2) { struct scroll_data *sd; int n1 = 0, n2 = 0; char dirarg[6]; sd = static_cast(malloc(sizeof(struct scroll_data))); memset(sd, 0, sizeof(struct scroll_data)); sd->resetcolor = get_current_text_color(); sd->step = 1; sd->direction = SCROLL_LEFT; if ((arg != nullptr) && sscanf(arg, "%5s %n", dirarg, &n1) == 1) { if (strcasecmp(dirarg, "right") == 0 || strcasecmp(dirarg, "r") == 0) { sd->direction = SCROLL_RIGHT; } else if (strcasecmp(dirarg, "wait") == 0 || strcasecmp(dirarg, "w") == 0) { sd->direction = SCROLL_WAIT; } else if (strcasecmp(dirarg, "left") != 0 && strcasecmp(dirarg, "l") != 0) { n1 = 0; } } if ((arg == nullptr) || sscanf(arg + n1, "%u %n", &sd->show, &n2) <= 0) { free(sd); #ifdef BUILD_X11 free(obj->next); #endif free(free_at_crash2); CRIT_ERR(obj, free_at_crash, "scroll needs arguments: [left|right|wait] [] " "[interval] "); } n1 += n2; if (sscanf(arg + n1, "%u %n", &sd->step, &n2) == 1) { n1 += n2; } else { sd->step = 1; } if (sscanf(arg + n1, "%u %n", &sd->wait_arg, &n2) == 1) { n1 += n2; sd->wait = sd->wait_arg; } else { sd->wait_arg = sd->wait = 0; } sd->text = static_cast(malloc(strlen(arg + n1) + sd->show + 1)); if (strlen(arg) > sd->show && sd->direction != SCROLL_WAIT) { for (n2 = 0; static_cast(n2) < sd->show; n2++) { sd->text[n2] = ' '; } sd->text[n2] = 0; } else { sd->text[0] = 0; } strncat(sd->text, arg + n1, strlen(arg + n1)); sd->start = sd->direction == SCROLL_WAIT ? strlen(sd->text) : 0; obj->sub = static_cast(malloc(sizeof(struct text_object))); extract_variable_text_internal(obj->sub, sd->text); obj->data.opaque = sd; #ifdef BUILD_X11 /* add a color object right after scroll to reset any color changes */ #endif /* BUILD_X11 */ } void print_scroll(struct text_object *obj, char *p, unsigned int p_max_size) { auto *sd = static_cast(obj->data.opaque); unsigned int j, colorchanges = 0, frontcolorchanges = 0, visibcolorchanges = 0; std::vector buf(max_user_text.get(*state), static_cast(0)); if (sd == nullptr) { return; } generate_text_internal(&(buf[0]), max_user_text.get(*state), *obj->sub); for (j = 0; buf[j] != 0; j++) { if (buf[j] == '\n') { // place all the lines behind each other with LINESEPARATOR between them #define LINESEPARATOR '|' buf[j] = LINESEPARATOR; } else if (buf[j] == SPECIAL_CHAR) { colorchanges++; } } // no scrolling necessary if the length of the text to scroll is too short if (strlen(&(buf[0])) - colorchanges <= sd->show) { snprintf(p, p_max_size, "%s", &(buf[0])); return; } // if length of text changed to shorter so the (sd->start) is already // outside of actual text then reset (sd->start) if (static_cast(sd->start) >= strlen(&(buf[0]))) { sd->start = 0; } // make sure a colorchange at the front is not part of the string we are going // to show while (buf[sd->start] == SPECIAL_CHAR) { sd->start++; } // place all chars that should be visible in p, including colorchanges unsigned int visiblechars; for (j = 0, visiblechars = 0; visiblechars < sd->show;) { char c = buf[sd->start + j]; p[j] = c; if (0 == c) { break; } ++j; if (SPECIAL_CHAR == c) { ++visibcolorchanges; } else { int l = scroll_character_length(c); while (--l != 0) { p[j] = buf[sd->start + j]; ++j; } ++visiblechars; } } for (; visiblechars < sd->show; j++, visiblechars++) { p[j] = ' '; } p[j] = 0; // count colorchanges in front of the visible part and place that many // colorchanges in front of the visible part for (j = 0; j < static_cast(sd->start); j++) { if (buf[j] == SPECIAL_CHAR) { frontcolorchanges++; } } int pwithcolors_len = strlen(p) + 4 + colorchanges - visibcolorchanges; char *pwithcolors = static_cast(malloc(pwithcolors_len)); for (j = 0; j < frontcolorchanges; j++) { pwithcolors[j] = SPECIAL_CHAR; } pwithcolors[j] = 0; strncat(pwithcolors, p, pwithcolors_len); unsigned int strend = strlen(pwithcolors); // and place the colorchanges not in front or in the visible part behind the // visible part for (j = 0; j < colorchanges - frontcolorchanges - visibcolorchanges; j++) { pwithcolors[strend + j] = SPECIAL_CHAR; } pwithcolors[strend + j] = 0; strncpy(p, pwithcolors, p_max_size); free(pwithcolors); // scroll if (sd->direction == SCROLL_LEFT) { scroll_scroll_left(sd, buf, sd->step); } else if (sd->direction == SCROLL_WAIT) { unsigned int charsleft = scroll_count_characters_to_right(sd, buf); if (sd->show >= charsleft) { if (sd->wait_arg == 0) { sd->start = 0; } else { sd->wait--; if (sd->wait <= 0 && sd->wait_arg != 1) { sd->wait = sd->wait_arg; } else { sd->start = 0; } } } else { if (sd->wait_arg == 0 || sd->wait_arg == 1 || sd->wait <= 0) { sd->wait = 0; if (sd->step < charsleft) { scroll_scroll_left(sd, buf, sd->step); } else { scroll_scroll_left(sd, buf, charsleft); } } else { sd->wait--; } } } else { scroll_scroll_right(sd, buf, sd->step); } #ifdef BUILD_X11 // reset color when scroll is finished if (out_to_x.get(*state)) { new_special(p + strlen(p), FG)->arg = sd->resetcolor; } #endif } void free_scroll(struct text_object *obj) { auto *sd = static_cast(obj->data.opaque); if (sd == nullptr) { return; } free_and_zero(sd->text); free_text_objects(obj->sub); free_and_zero(obj->sub); free_and_zero(obj->data.opaque); } conky-1.12.2/src/scroll.h000066400000000000000000000024141404127277500151700ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _SCROLL_H #define _SCROLL_H void parse_scroll_arg(struct text_object *, const char *, void *, char *); void print_scroll(struct text_object *, char *, unsigned int); void free_scroll(struct text_object *); #endif /* _SCROLL_H */ conky-1.12.2/src/semaphore.hh000066400000000000000000000051151404127277500160260ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (C) 2010 Pavel Labath et al. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef SEMAPHORE_HH #define SEMAPHORE_HH #include #include #include #include #if defined(__APPLE__) && defined(__MACH__) /* * On Darwin, unnamed semaphores are not supported! * The only close equivalent to unnamed semaphores is using * GCD! */ #include class semaphore { dispatch_semaphore_t sem; semaphore(const semaphore &) = delete; semaphore &operator=(const semaphore &) = delete; public: explicit semaphore(unsigned int value = 0) { sem = dispatch_semaphore_create(value); if (!sem) throw std::logic_error(strerror(errno)); } ~semaphore() { dispatch_release(sem); } void post() { dispatch_semaphore_signal(sem); } void wait() { dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); } bool trywait() { /* XXX Quick patch */ #define DISPATCH_EAGAIN 49 int ret = dispatch_semaphore_wait(sem, DISPATCH_TIME_NOW); while (ret > 0) { if (ret == DISPATCH_EAGAIN) { return false; } else if (errno != EINTR) { abort(); } } return true; } }; #else #include class semaphore { sem_t sem; semaphore(const semaphore &) = delete; semaphore &operator=(const semaphore &) = delete; public: semaphore(unsigned int value = 0) { if (sem_init(&sem, 0, value)) throw std::logic_error(strerror(errno)); } ~semaphore() { sem_destroy(&sem); } void post() { if (sem_post(&sem)) throw std::overflow_error(strerror(errno)); } void wait() { while (sem_wait(&sem)) { if (errno != EINTR) abort(); } } bool trywait() { while (sem_trywait(&sem)) { if (errno == EAGAIN) return false; else if (errno != EINTR) abort(); } return true; } }; #endif /* defined(__APPLE__) && defined(__MACH__) */ #endif conky-1.12.2/src/setting.cc000066400000000000000000000147311404127277500155120ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (C) 2010 Pavel Labath et al. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include "setting.hh" #include #include #include #include #include namespace conky { namespace { typedef std::unordered_map settings_map; using settings_vector = std::vector; /* * We cannot construct this object statically, because order of object * construction in different modules is not defined, so config_setting_base * could be called before this object is constructed. Therefore, we create it on * the first call to config_setting_base constructor. */ settings_map *settings; /* * Returns the setting record corresponding to the value at the specified index. * If the value is not valid, returns nullptr and prints an error. */ priv::config_setting_base *get_setting(lua::state &l, int index) { lua::Type type = l.type(index); if (type != lua::TSTRING) { NORM_ERR("invalid setting of type '%s'", l.type_name(type)); return nullptr; } const std::string &name = l.tostring(index); auto iter = settings->find(name); if (iter == settings->end()) { NORM_ERR("Unknown setting '%s'", name.c_str()); return nullptr; } return iter->second; } // returns a vector of all settings, sorted in order of registration settings_vector make_settings_vector() { settings_vector ret; ret.reserve(settings->size()); for (auto &setting : *settings) { ret.push_back(setting.second); } sort(ret.begin(), ret.end(), &priv::config_setting_base::seq_compare); return ret; } /* * Returns the seq_no for the new setting object. Also constructs settings * object if needed. */ size_t get_next_seq_no() { struct settings_constructor { settings_constructor() { settings = new settings_map; } ~settings_constructor() { delete settings; settings = nullptr; } }; static settings_constructor constructor; return settings->size(); } } // namespace namespace priv { config_setting_base::config_setting_base(std::string name_) : name(std::move(name_)), seq_no(get_next_seq_no()) { bool inserted = settings->insert({name, this}).second; if (!inserted) { throw std::logic_error("Setting with name '" + name + "' already registered"); } } void config_setting_base::lua_set(lua::state &l) { std::lock_guard guard(l); lua::stack_sentry s(l, -1); l.checkstack(2); l.getglobal("conky"); l.rawgetfield(-1, "config"); l.replace(-2); l.insert(-2); l.setfield(-2, name.c_str()); l.pop(); } /* * Performs the actual assignment of settings. Calls the setting-specific setter * after some sanity-checking. stack on entry: | ..., new_config_table, key, * value, old_value | stack on exit: | ..., new_config_table | */ void config_setting_base::process_setting(lua::state &l, bool init) { lua::stack_sentry s(l, -3); config_setting_base *ptr = get_setting(l, -3); if (ptr == nullptr) { return; } ptr->lua_setter(l, init); l.pushvalue(-2); l.insert(-2); l.rawset(-4); } /* * Called when user sets a new value for a setting * stack on entry: | config_table, key, value | * stack on exit: | | */ int config_setting_base::config__newindex(lua::state *l) { lua::stack_sentry s(*l, -3); l->checkstack(1); l->getmetatable(-3); l->replace(-4); l->pushvalue(-2); l->rawget(-4); process_setting(*l, false); return 0; } /* * conky.config will not be a table, but a userdata with some metamethods we do * this because we want to control access to the settings we use the metatable * for storing the settings, that means having a setting whose name starts with * "__" is a bad idea stack on entry: | ... | stack on exit: | ... * new_config_table | */ void config_setting_base::make_conky_config(lua::state &l) { lua::stack_sentry s(l); l.checkstack(3); l.newuserdata(1); l.newtable(); { l.pushboolean(false); l.rawsetfield(-2, "__metatable"); l.pushvalue(-1); l.rawsetfield(-2, "__index"); l.pushfunction(&priv::config_setting_base::config__newindex); l.rawsetfield(-2, "__newindex"); } l.setmetatable(-2); ++s; } } // namespace priv void set_config_settings(lua::state &l) { lua::stack_sentry s(l); l.checkstack(6); // Force creation of settings map. In the off chance we have no settings. get_next_seq_no(); l.getglobal("conky"); { if (l.type(-1) != lua::TTABLE) { throw std::runtime_error("conky must be a table"); } l.rawgetfield(-1, "config"); { if (l.type(-1) != lua::TTABLE) { throw std::runtime_error("conky.config must be a table"); } priv::config_setting_base::make_conky_config(l); l.rawsetfield(-3, "config"); l.rawgetfield(-2, "config"); l.getmetatable(-1); l.replace(-2); { const settings_vector &v = make_settings_vector(); for (auto i : v) { l.pushstring(i->name); l.rawgetfield(-3, i->name.c_str()); l.pushnil(); priv::config_setting_base::process_setting(l, true); } } l.pop(); // print error messages for unknown settings l.pushnil(); while (l.next(-2)) { l.pop(); get_setting(l, -1); } } l.pop(); } l.pop(); } void cleanup_config_settings(lua::state &l) { lua::stack_sentry s(l); l.checkstack(2); l.getglobal("conky"); l.rawgetfield(-1, "config"); l.replace(-2); const settings_vector &v = make_settings_vector(); for (size_t i = v.size(); i > 0; --i) { l.getfield(-1, v[i - 1]->name.c_str()); v[i - 1]->cleanup(l); } l.pop(); } /////////// example settings, remove after real settings are available /////// range_config_setting asdf("asdf", 42, 47, 45, true); } // namespace conky conky-1.12.2/src/setting.hh000066400000000000000000000264561404127277500155330ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (C) 2010 Pavel Labath et al. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef SETTING_HH #define SETTING_HH #include #include #include #include "logging.h" #include "luamm.hh" namespace conky { /* * Checks settings, and does initial calls to the setters. * Should be called after reading the user config. * stack on entry: | ... | * stack on exit: | ... | */ void set_config_settings(lua::state &l); /* * Calls cleanup functions. * Should be called before exit/restart. * stack on entry: | ... | * stack on exit: | ... | */ void cleanup_config_settings(lua::state &l); template ::value, bool floating_point = std::is_floating_point::value, bool is_enum = std::is_enum::value> struct lua_traits { // integral is here to force the compiler to evaluate the assert at // instantiation time static_assert(is_integral && false, "Only specializations for enum, string, integral and floating " "point types are available"); }; // specialization for integral types template struct lua_traits { static const lua::Type type = lua::TNUMBER; typedef lua::integer Type; static inline std::pair convert(lua::state &l, int index, const std::string &) { return {l.tointeger(index), true}; } }; // specialization for floating point types template struct lua_traits { static const lua::Type type = lua::TNUMBER; typedef lua::number Type; static inline std::pair convert(lua::state &l, int index, const std::string &) { return {l.tonumber(index), true}; } }; // specialization for std::string template <> struct lua_traits { static const lua::Type type = lua::TSTRING; typedef std::string Type; static inline std::pair convert(lua::state &l, int index, const std::string &) { return {l.tostring(index), true}; } }; // specialization for bool template <> struct lua_traits { static const lua::Type type = lua::TBOOLEAN; typedef bool Type; static inline std::pair convert(lua::state &l, int index, const std::string &) { return {l.toboolean(index), true}; } }; // specialization for enums // to use this, one first has to declare string<->value map template struct lua_traits { static const lua::Type type = lua::TSTRING; typedef T Type; typedef std::initializer_list> Map; static Map map; static std::pair convert(lua::state &l, int index, const std::string &name) { std::string val = l.tostring(index); for (auto i = map.begin(); i != map.end(); ++i) { if (i->first == val) return {i->second, true}; } std::string msg = "Invalid value '" + val + "' for setting '" + name + "'. Valid values are: "; for (auto i = map.begin(); i != map.end(); ++i) { if (i != map.begin()) msg += ", "; msg += "'" + i->first + "'"; } msg += "."; NORM_ERR("%s", msg.c_str()); return {T(), false}; } }; namespace priv { class config_setting_base { private: static void process_setting(lua::state &l, bool init); static int config__newindex(lua::state *l); static void make_conky_config(lua::state &l); // copying is a REALLY bad idea config_setting_base(const config_setting_base &) = delete; config_setting_base &operator=(const config_setting_base &) = delete; protected: /* * Set the setting, if the value is sane * stack on entry: | ... potential_new_value old_value | * stack on exit: | ... real_new_value | * real_new_value can be the old value if the new value doesn't make sense */ virtual void lua_setter(lua::state &l, bool init) = 0; /* * Called on exit/restart. * stack on entry: | ... new_value | * stack on exit: | ... | */ virtual void cleanup(lua::state &l) { l.pop(); } public: const std::string name; const size_t seq_no; static bool seq_compare(const config_setting_base *a, const config_setting_base *b) { return a->seq_no < b->seq_no; } explicit config_setting_base(std::string name_); virtual ~config_setting_base() {} /* * Set the setting manually. * stack on entry: | ... new_value | * stack on exit: | ... | */ void lua_set(lua::state &l); friend void conky::set_config_settings(lua::state &l); friend void conky::cleanup_config_settings(lua::state &l); }; } // namespace priv // If you need some very exotic setting, derive it from this class. Otherwise, // scroll down. template class config_setting_template : public priv::config_setting_base { public: explicit config_setting_template(const std::string &name_) : config_setting_base(name_) {} // get the value of the setting as a C++ type T get(lua::state &l); protected: /* * Convert the value into a C++ type. * stack on entry: | ... value | * stack on exit: | ... | */ virtual T getter(lua::state &l) = 0; }; template T config_setting_template::get(lua::state &l) { std::lock_guard guard(l); lua::stack_sentry s(l); l.checkstack(2); l.getglobal("conky"); l.getfield(-1, "config"); l.replace(-2); l.getfield(-1, name.c_str()); l.replace(-2); return getter(l); } /* * Declares a setting in the conky.config table. * Getter function is used to translate the lua value into C++. It receives the * value on the lua stack. It should pop it and return the C++ value. In case * the value is nil, it should return a predefined default value. Translation * into basic types works with the help of lua_traits template above The * lua_setter function is called when someone tries to set the value. It * receives the new and the old value on the stack (old one is on top). It * should return the new value for the setting. It doesn't have to be the value * the user set, if e.g. the value doesn't make sense. The second parameter is * true if the assignment occurs during the initial parsing of the config file, * and false afterwards. Some settings obviously cannot be changed (easily?) * when conky is running, but some (e.g. x/y position of the window) can. */ template > class simple_config_setting : public config_setting_template { typedef config_setting_template Base; public: explicit simple_config_setting(const std::string &name_, const T &default_value_ = T(), bool modifiable_ = false) : Base(name_), default_value(default_value_), modifiable(modifiable_) {} simple_config_setting(const char *name_, const T &default_value_ = T(), bool modifiable_ = false) : Base(std::string(name_)), default_value(default_value_), modifiable(modifiable_) {} protected: const T default_value; const bool modifiable; virtual std::pair do_convert(lua::state &l, int index); virtual void lua_setter(lua::state &l, bool init); virtual T getter(lua::state &l) { lua::stack_sentry s(l, -1); auto ret = do_convert(l, -1); l.pop(); // setter function should make sure the value is valid assert(ret.second); return ret.first; } }; template std::pair simple_config_setting::do_convert(lua::state &l, int index) { if (l.isnil(index)) return {default_value, true}; if (l.type(index) != Traits::type) { NORM_ERR( "Invalid value of type '%s' for setting '%s'. " "Expected value of type '%s'.", l.type_name(l.type(index)), Base::name.c_str(), l.type_name(Traits::type)); return {default_value, false}; } return Traits::convert(l, index, Base::name); } template void simple_config_setting::lua_setter(lua::state &l, bool init) { lua::stack_sentry s(l, -2); bool ok = true; if (!init && !modifiable) { NORM_ERR("Setting '%s' is not modifiable", Base::name.c_str()); ok = false; } if (ok && do_convert(l, -2).second) { l.pop(); } else { l.replace(-2); } ++s; } template bool between(Signed1 value, Signed2 min, typename std::enable_if::value, Signed2>::type max) { return value >= min && value <= max; } template bool between(Signed1 value, Unsigned2 min, typename std::enable_if::value, Unsigned2>::type max) { return value >= 0 && static_cast::type>(value) >= min && static_cast::type>(value) <= max; } // Just like simple_config_setting, except that in only accepts value in the // [min, max] range template > class range_config_setting : public simple_config_setting { typedef simple_config_setting Base; const T min; const T max; public: explicit range_config_setting(const std::string &name_, const T &min_ = std::numeric_limits::min(), const T &max_ = std::numeric_limits::max(), const T &default_value_ = T(), bool modifiable_ = false) : Base(name_, default_value_, modifiable_), min(min_), max(max_) { assert(min <= Base::default_value && Base::default_value <= max); } protected: virtual std::pair do_convert(lua::state &l, int index) { auto ret = Base::do_convert(l, index); if (ret.second && !between(ret.first, min, max)) { NORM_ERR("Value is out of range for setting '%s'", Base::name.c_str()); // we ignore out-of-range values. an alternative would be to clamp them. // do we want to do that? ret.second = false; } return ret; } }; /////////// example settings, remove after real settings are available /////// extern range_config_setting asdf; } // namespace conky #endif /* SETTING_HH */ conky-1.12.2/src/smapi.cc000066400000000000000000000120331404127277500151370ustar00rootroot00000000000000/* * * smapi.c: conky support for IBM Thinkpad smapi * * Copyright (C) 2007 Phil Sutter * * This library 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. * * This library 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. * * You should have received a copy of the GNU General Public License * along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA. * */ #include #include #include #include #include #include #include "conky.h" /* text_buffer_size, PACKAGE_NAME, maybe more */ #include "logging.h" #include "temphelper.h" #define SYS_SMAPI_PATH "/sys/devices/platform/smapi" static int smapi_read_int(const char *path) { FILE *fp; int i = 0; if ((fp = fopen(path, "r"))) { if (fscanf(fp, "%i\n", &i) < 0) perror("fscanf()"); fclose(fp); } return i; } static int smapi_bat_installed_internal(int idx) { char path[128]; struct stat sb; int ret = 0; snprintf(path, 127, SYS_SMAPI_PATH "/BAT%i", idx); if (!stat(path, &sb) && (sb.st_mode & S_IFMT) == S_IFDIR) { snprintf(path, 127, SYS_SMAPI_PATH "/BAT%i/installed", idx); ret = (smapi_read_int(path) == 1) ? 1 : 0; } return ret; } static char *smapi_read_str(const char *path) { FILE *fp; char str[256] = "failed"; if ((fp = fopen(path, "r")) != nullptr) { if (fscanf(fp, "%255s\n", str) < 0) perror("fscanf()"); fclose(fp); } return strndup(str, text_buffer_size.get(*state)); } static char *smapi_get_str(const char *fname) { char path[128]; if (snprintf(path, 127, SYS_SMAPI_PATH "/%s", fname) < 0) return nullptr; return smapi_read_str(path); } static char *smapi_get_bat_str(int idx, const char *fname) { char path[128]; if (snprintf(path, 127, SYS_SMAPI_PATH "/BAT%i/%s", idx, fname) < 0) return nullptr; return smapi_read_str(path); } static int smapi_get_bat_int(int idx, const char *fname) { char path[128]; if (snprintf(path, 127, SYS_SMAPI_PATH "/BAT%i/%s", idx, fname) < 0) return 0; return smapi_read_int(path); } static char *smapi_get_bat_val(const char *args) { char fname[128]; int idx, cnt; if (sscanf(args, "%i %n", &idx, &cnt) <= 0 || snprintf(fname, 127, "%s", (args + cnt)) < 0) { NORM_ERR("smapi: wrong arguments, should be 'bat,,'"); return nullptr; } if (!smapi_bat_installed_internal(idx)) return nullptr; return smapi_get_bat_str(idx, fname); } static char *smapi_get_val(const char *args) { char str[128]; if (!args || sscanf(args, "%127s", str) <= 0) return nullptr; if (!strcmp(str, "bat")) return smapi_get_bat_val(args + 4); return smapi_get_str(str); } void print_smapi(struct text_object *obj, char *p, unsigned int p_max_size) { char *s; if (!obj->data.s) return; s = smapi_get_val(obj->data.s); snprintf(p, p_max_size, "%s", s); free(s); } uint8_t smapi_bat_percentage(struct text_object *obj) { int idx, val = 0; if (obj->data.s && sscanf(obj->data.s, "%i", &idx) == 1) { val = smapi_bat_installed_internal(idx) ? smapi_get_bat_int(idx, "remaining_percent") : 0; } else NORM_ERR("argument to smapi_bat_perc must be an integer"); return val; } void print_smapi_bat_temp(struct text_object *obj, char *p, unsigned int p_max_size) { int idx, val; if (obj->data.s && sscanf(obj->data.s, "%i", &idx) == 1) { val = smapi_bat_installed_internal(idx) ? smapi_get_bat_int(idx, "temperature") : 0; /* temperature is in milli degree celsius */ temp_print(p, p_max_size, val / 1000, TEMP_CELSIUS, 1); } else NORM_ERR("argument to smapi_bat_temp must be an integer"); } void print_smapi_bat_power(struct text_object *obj, char *p, unsigned int p_max_size) { int idx, val; if (obj->data.s && sscanf(obj->data.s, "%i", &idx) == 1) { val = smapi_bat_installed_internal(idx) ? smapi_get_bat_int(idx, "power_now") : 0; /* power_now is in mW, set to W with one digit precision */ snprintf(p, p_max_size, "%.1f", ((double)val / 1000)); } else NORM_ERR("argument to smapi_bat_power must be an integer"); } double smapi_bat_barval(struct text_object *obj) { if (obj->data.i >= 0 && smapi_bat_installed_internal(obj->data.i)) return smapi_get_bat_int(obj->data.i, "remaining_percent"); return 0; } int smapi_bat_installed(struct text_object *obj) { int idx; if (obj->data.s && sscanf(obj->data.s, "%i", &idx) == 1) { if (!smapi_bat_installed_internal(idx)) { return 0; } } else NORM_ERR("argument to if_smapi_bat_installed must be an integer"); return 1; } conky-1.12.2/src/smapi.h000066400000000000000000000023371404127277500150070ustar00rootroot00000000000000/* * * smapi.h: conky support for IBM Thinkpad smapi * * Copyright (C) 2007 Phil Sutter * * This library 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. * * This library 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. * * You should have received a copy of the GNU General Public License * along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA. * */ #ifndef _SMAPI_H #define _SMAPI_H void print_smapi(struct text_object *, char *, unsigned int); uint8_t smapi_bat_percentage(struct text_object *); void print_smapi_bat_temp(struct text_object *, char *, unsigned int); void print_smapi_bat_power(struct text_object *, char *, unsigned int); double smapi_bat_barval(struct text_object *); int smapi_bat_installed(struct text_object *obj); #endif /* _SMAPI_H */ conky-1.12.2/src/solaris.cc000066400000000000000000000331411404127277500155050ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "common.h" #include "conky.h" #include "diskio.h" #include "top.h" #include #include "net_stat.h" #include "solaris.h" static kstat_ctl_t *kstat; static time_t kstat_updated; static int pageshift = INT_MAX; static pthread_mutex_t kstat_mtx = PTHREAD_MUTEX_INITIALIZER; static int pagetok(int pages) { if (pageshift == INT_MAX) { int pagesize = sysconf(_SC_PAGESIZE); pageshift = 0; while ((pagesize >>= 1) > 0) pageshift++; pageshift -= 10; /* 2^10 = 1024 */ } return (pageshift > 0 ? pages << pageshift : pages >> -pageshift); } static void update_kstat() { time_t now; pthread_mutex_lock(&kstat_mtx); now = time(nullptr); if (kstat == nullptr) { if ((kstat = kstat_open()) == nullptr) { pthread_mutex_unlock(&kstat_mtx); NORM_ERR("can't open kstat: %s", strerror(errno)); return; } kstat_updated = 0; } if (now - kstat_updated < 2) { /* Do not update kstats too often */ pthread_mutex_unlock(&kstat_mtx); return; } if (kstat_chain_update(kstat) == -1) { pthread_mutex_unlock(&kstat_mtx); perror("kstat_chain_update"); return; } kstat_updated = now; pthread_mutex_unlock(&kstat_mtx); } static kstat_named_t *get_kstat(const char *module, int inst, const char *name, const char *stat) { kstat_t *ksp; update_kstat(); pthread_mutex_lock(&kstat_mtx); ksp = kstat_lookup(kstat, (char *)module, inst, (char *)name); if (ksp == nullptr) { NORM_ERR("cannot lookup kstat %s:%d:%s:%s %s", module, inst, name, stat, strerror(errno)); pthread_mutex_unlock(&kstat_mtx); return nullptr; } if (kstat_read(kstat, ksp, nullptr) >= 0) { if (ksp->ks_type == KSTAT_TYPE_NAMED || ksp->ks_type == KSTAT_TYPE_TIMER) { kstat_named_t *knp = (kstat_named_t *)kstat_data_lookup(ksp, (char *)stat); pthread_mutex_unlock(&kstat_mtx); return knp; } else { NORM_ERR("kstat %s:%d:%s:%s has unexpected type %d", module, inst, name, stat, ksp->ks_type); pthread_mutex_unlock(&kstat_mtx); return nullptr; } } NORM_ERR("cannot read kstat %s:%d:%s:%s", module, inst, name, stat); pthread_mutex_unlock(&kstat_mtx); return nullptr; } void prepare_update() { kstat_updated = 0; } int update_meminfo() { kstat_named_t *knp; int nswap = swapctl(SC_GETNSWP, 0); struct swaptable *swt; struct swapent *swe; char path[PATH_MAX]; unsigned long stp, sfp; /* RAM stats */ knp = get_kstat("unix", -1, "system_pages", "freemem"); if (knp != nullptr) info.memfree = pagetok(knp->value.ui32); info.memmax = pagetok(sysconf(_SC_PHYS_PAGES)); if (info.memmax > info.memfree) info.mem = info.memmax - info.memfree; else /* for non-global zones with capped memory */ info.mem = info.memmax; /* Swap stats */ if (nswap < 1) return 0; /* for swapctl(2) */ swt = (struct swaptable *)malloc(nswap * sizeof(struct swapent) + sizeof(int)); if (swt == nullptr) return 0; swt->swt_n = nswap; swe = &(swt->swt_ent[0]); /* We are not interested in ste_path */ for (int i = 0; i < nswap; i++) swe[i].ste_path = path; nswap = swapctl(SC_LIST, swt); swe = &(swt->swt_ent[0]); stp = sfp = 0; for (int i = 0; i < nswap; i++) { if ((swe[i].ste_flags & ST_INDEL) || (swe[i].ste_flags & ST_DOINGDEL)) continue; stp += swe->ste_pages; sfp += swe->ste_free; } free(swt); info.swapfree = pagetok(sfp); info.swapmax = pagetok(stp); info.swap = info.swapmax - info.swapfree; return 0; } int check_mount(struct text_object *obj) { /* stub */ (void)obj; return 0; } double get_battery_perct_bar(struct text_object *obj) { /* Not implemented */ (void)obj; return 100.0; } double get_acpi_temperature(int fd) { /* Not implemented */ (void)fd; return 0.0; } int update_total_processes(void) { kstat_named_t *knp = get_kstat("unix", -1, "system_misc", "nproc"); if (knp != nullptr) info.procs = knp->value.ui32; return 0; } void get_battery_stuff(char *buf, unsigned int n, const char *bat, int item) { /* Not implemented */ } int update_running_processes(void) { /* There is no kstat for this, see update_proc_entry() */ return 0; } int update_net_stats(void) { struct ifconf ifc; int sockfd; char buf[1024]; double d = current_update_time - last_update_time; if (d < 0.1) return 0; /* Find all active net interfaces */ if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { NORM_ERR("cannot create socket: %s", strerror(errno)); return 0; } ifc.ifc_buf = buf; ifc.ifc_len = sizeof(buf); if (ioctl(sockfd, SIOCGIFCONF, &ifc) < 0) { NORM_ERR("ioctl(SIOCGIFCONF) failed: %s", strerror(errno)); (void)close(sockfd); return 0; } (void)close(sockfd); /* Collect stats for all active interfaces */ for (int i = 0; i < ifc.ifc_len / sizeof(struct ifreq); i++) { struct net_stat *ns; struct ifreq *ifr = &ifc.ifc_req[i]; long long last_recv, last_trans; long long r, t; kstat_named_t *knp; ns = get_net_stat((const char *)ifr->ifr_name, nullptr, NULL); ns->up = 1; memcpy(&(ns->addr), &ifr->ifr_addr, sizeof(ifr->ifr_addr)); /* Skip the loopback interface, it does not have kstat data */ if (ifr->ifr_flags & IFF_LOOPBACK || strcmp(ifr->ifr_name, "lo0") == 0) continue; last_recv = ns->recv; last_trans = ns->trans; /* Get received bytes */ knp = get_kstat("link", -1, ifr->ifr_name, "rbytes"); if (knp == nullptr) { NORM_ERR("cannot read rbytes for %s\n", ifr->ifr_name); continue; } r = (long long)knp->value.ui32; if (r <= ns->last_read_recv) { ns->recv += ((long long)4294967295U - ns->last_read_recv) + r; } else { ns->recv += (r - ns->last_read_recv); } ns->last_read_recv = r; /* Get transceived bytes */ knp = get_kstat("link", -1, ifr->ifr_name, "obytes"); if (knp == nullptr) { NORM_ERR("cannot read obytes for %s\n", ifr->ifr_name); continue; } t = (long long)knp->value.ui32; if (t < ns->last_read_trans) { ns->trans += ((long long)4294967295U - ns->last_read_trans) + t; } else { ns->trans += (t - ns->last_read_trans); } ns->last_read_trans = t; ns->recv_speed = (ns->recv - last_recv) / d; ns->trans_speed = (ns->trans - last_trans) / d; } return 0; } int update_cpu_usage(void) { static int last_cpu_cnt = 0; static int *last_cpu_use = nullptr; double d = current_update_time - last_update_time; double total_cpu_usage = 0; int cpu; if (d < 0.1) return 0; update_kstat(); info.cpu_count = sysconf(_SC_NPROCESSORS_ONLN); /* (Re)allocate the array with previous values */ if (last_cpu_cnt != info.cpu_count || last_cpu_use == nullptr) { last_cpu_use = (int *)realloc(last_cpu_use, (info.cpu_count + 1) * sizeof(int)); last_cpu_cnt = info.cpu_count; if (last_cpu_use == nullptr) return 0; } info.cpu_usage = (float *)malloc((info.cpu_count + 1) * sizeof(float)); pthread_mutex_lock(&kstat_mtx); for (cpu = 1; cpu <= info.cpu_count; cpu++) { char stat_name[PATH_MAX]; unsigned long cpu_user, cpu_nice, cpu_system, cpu_idle; unsigned long cpu_use; cpu_stat_t *cs; kstat_t *ksp; snprintf(stat_name, PATH_MAX, "cpu_stat%d", cpu - 1); ksp = kstat_lookup(kstat, (char *)"cpu_stat", cpu - 1, stat_name); if (ksp == nullptr) continue; if (kstat_read(kstat, ksp, nullptr) == -1) continue; cs = (cpu_stat_t *)ksp->ks_data; cpu_idle = cs->cpu_sysinfo.cpu[CPU_IDLE]; cpu_user = cs->cpu_sysinfo.cpu[CPU_USER]; cpu_nice = cs->cpu_sysinfo.cpu[CPU_WAIT]; cpu_system = cs->cpu_sysinfo.cpu[CPU_KERNEL]; cpu_use = cpu_user + cpu_nice + cpu_system; info.cpu_usage[cpu] = (double)(cpu_use - last_cpu_use[cpu]) / d / 100.0; total_cpu_usage += info.cpu_usage[cpu]; last_cpu_use[cpu] = cpu_use; } pthread_mutex_unlock(&kstat_mtx); info.cpu_usage[0] = total_cpu_usage / info.cpu_count; return 0; } void free_cpu(struct text_object *) { /* no-op */ } void update_proc_entry(struct process *p) { psinfo_t proc; int fd; char pfn[PATH_MAX]; snprintf(pfn, PATH_MAX, "/proc/%d/psinfo", p->pid); /* Ignore errors here as the process can be gone */ if ((fd = open(pfn, O_RDONLY)) < 0) return; if (pread(fd, &proc, sizeof(psinfo_t), 0) != sizeof(psinfo_t)) { (void)close(fd); return; } (void)close(fd); free_and_zero(p->name); free_and_zero(p->basename); p->name = strndup(proc.pr_fname, text_buffer_size.get(*::state)); p->basename = strndup(proc.pr_fname, text_buffer_size.get(*::state)); p->uid = proc.pr_uid; /* see proc(4) */ p->amount = (double)proc.pr_pctcpu / (double)0x8000 * 100.0; p->rss = proc.pr_rssize * 1024; /* to bytes */ p->vsize = proc.pr_size * 1024; /* to bytes */ p->total_cpu_time = proc.pr_time.tv_sec * 100; /* to hundredths of secs */ if (proc.pr_lwp.pr_sname == 'O' || proc.pr_lwp.pr_sname == 'R') info.run_procs++; p->time_stamp = g_time; } void get_top_info(void) { DIR *dir; struct dirent *entry; if (!(dir = opendir("/proc"))) { return; } info.run_procs = 0; while ((entry = readdir(dir))) { pid_t pid; if (entry == nullptr) break; if (sscanf(entry->d_name, "%u", &pid) != 1) continue; update_proc_entry(get_process(pid)); } (void)closedir(dir); } /* * Because Solaris systems often have 100s or 1000s of disks, we don't collect * data for all of them but only for those mentioned in conkyrc. * Instead of disk's special file in SVR4 format, we use the driver name and * and the instance number to specify the disk or partition. For example: sd0, * ssd3, or sd5,b. */ int update_diskio(void) { unsigned int tot_read = 0; unsigned int tot_written = 0; update_kstat(); pthread_mutex_lock(&kstat_mtx); for (struct diskio_stat *cur = &stats; cur; cur = cur->next) { unsigned int read, written; kstat_io_t *ksio; kstat_t *ksp; if (cur->dev == nullptr) continue; if ((ksp = kstat_lookup(kstat, nullptr, -1, cur->dev)) == NULL) continue; if (kstat_read(kstat, ksp, nullptr) == -1) continue; ksio = (kstat_io_t *)ksp->ks_data; tot_read += read = (unsigned int)(ksio->nread / 512); tot_written += written = (unsigned int)(ksio->nwritten / 512); update_diskio_values(cur, read, written); } update_diskio_values(&stats, tot_read, tot_written); pthread_mutex_unlock(&kstat_mtx); return 0; } void get_battery_short_status(char *buffer, unsigned int n, const char *bat) { /* Not implemented */ (void)bat; if (buffer && n > 0) memset(buffer, 0, n); } void get_acpi_fan(char *p_client_buffer, size_t client_buffer_size) { /* Not implemented */ if (p_client_buffer && client_buffer_size > 0) memset(p_client_buffer, 0, client_buffer_size); } void get_acpi_ac_adapter(char *p_client_buffer, size_t client_buffer_size, const char *adapter) { /* Not implemented */ if (p_client_buffer && client_buffer_size > 0) memset(p_client_buffer, 0, client_buffer_size); } int get_battery_perct(const char *bat) { /* Not implemented */ (void)bat; return 1; } int get_entropy_poolsize(unsigned int *val) { /* Not implemented */ (void)val; return 1; } char get_freq(char *p_client_buffer, size_t client_buffer_size, const char *p_format, int divisor, unsigned int cpu) { char stat_name[PATH_MAX]; kstat_named_t *knp; snprintf(stat_name, PATH_MAX, "cpu_info%d", cpu - 1); knp = get_kstat("cpu_info", cpu - 1, stat_name, "current_clock_Hz"); if (knp == nullptr) return 0; snprintf(p_client_buffer, client_buffer_size, p_format, (float)knp->value.ui32 / divisor / 1000000.0); return 1; } int update_uptime(void) { kstat_named_t *knp; knp = get_kstat("unix", -1, "system_misc", "boot_time"); if (knp == nullptr) return 0; info.uptime = time(nullptr) - knp->value.ui32; return 1; } int open_acpi_temperature(const char *name) { /* Not implemented */ (void)name; return 1; } int get_entropy_avail(unsigned int *val) { /* Not implemented */ (void)val; return 1; } int update_load_average(void) { double load[3]; getloadavg(load, 3); info.loadavg[0] = (float)load[0]; info.loadavg[1] = (float)load[1]; info.loadavg[2] = (float)load[2]; return 0; } void get_cpu_count(void) { kstat_named_t *knp = get_kstat("unix", -1, "system_misc", "ncpus"); if (knp != nullptr) info.cpu_count = knp->value.ui32; } conky-1.12.2/src/solaris.h000066400000000000000000000002171404127277500153450ustar00rootroot00000000000000#ifndef SOLARIS_H_ #define SOLARIS_H_ int get_entropy_avail(unsigned int *); int get_entropy_poolsize(unsigned int *); #endif /*SOLARIS_H_*/ conky-1.12.2/src/sony.cc000066400000000000000000000045441404127277500150260ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * Copyright (c) 2009 Yeon-Hyeong Yang * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ /* conky support for information from sony_laptop kernel module * information from sony_laptop kernel module * /sys/devices/platform/sony-laptop * I mimicked the methods from ibm.c * Yeon-Hyeong Yang */ #include "sony.h" #include #include #include #include #include "config.h" #include "conky.h" #include "logging.h" #include "text_object.h" #define SONY_LAPTOP_DIR "/sys/devices/platform/sony-laptop" /* fanspeed in SONY_LAPTOP_DIR contains an integer value for fanspeed (0~255). * I don't know the exact measurement unit, though. I may assume that 0 for * 'fan stopped' and 255 for 'maximum fan speed'. */ void get_sony_fanspeed(struct text_object *obj, char *p_client_buffer, unsigned int client_buffer_size) { FILE *fp; unsigned int speed = 0; char fan[128]; (void)obj; if (!p_client_buffer || client_buffer_size <= 0) { return; } snprintf(fan, 127, "%s/fanspeed", SONY_LAPTOP_DIR); fp = fopen(fan, "r"); if (fp != nullptr) { while (!feof(fp)) { char line[256]; if (fgets(line, 255, fp) == nullptr) { break; } if (sscanf(line, "%u", &speed)) { break; } } } else { CRIT_ERR(nullptr, NULL, "can't open '%s': %s\nEnable sony support or remove " "sony* from your " PACKAGE_NAME " config file.", fan, strerror(errno)); } fclose(fp); snprintf(p_client_buffer, client_buffer_size, "%d", speed); } conky-1.12.2/src/sony.h000066400000000000000000000023641404127277500146660ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * Copyright (c) 2009 Yeon-Hyeong Yang * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ /* conky support for information from sony_laptop kernel module * information from sony_laptop kernel module * /sys/devices/platform/sony-laptop * I mimicked the methods from ibm.c * Yeon-Hyeong Yang */ #ifndef _SONY_H #define _SONY_H void get_sony_fanspeed(struct text_object *, char *, unsigned int); #endif /* _SONY_H */ conky-1.12.2/src/specials.cc000066400000000000000000000567641404127277500156540ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "conky.h" #ifdef BUILD_X11 #include "fonts.h" #endif /* BUILD_X11 */ #include #include "logging.h" #include "nc.h" #include "specials.h" #ifdef HAVE_SYS_PARAM_H #include #endif /* HAVE_SYS_PARAM_H */ #include #include #include #include "colours.h" #include "common.h" #include "conky.h" struct special_t *specials = nullptr; int special_count; int graph_count = 0; std::map graphs; namespace { conky::range_config_setting default_bar_width( "default_bar_width", 0, std::numeric_limits::max(), 0, false); conky::range_config_setting default_bar_height( "default_bar_height", 0, std::numeric_limits::max(), 6, false); #ifdef BUILD_X11 conky::range_config_setting default_graph_width( "default_graph_width", 0, std::numeric_limits::max(), 0, false); conky::range_config_setting default_graph_height( "default_graph_height", 0, std::numeric_limits::max(), 25, false); conky::range_config_setting default_gauge_width( "default_gauge_width", 0, std::numeric_limits::max(), 40, false); conky::range_config_setting default_gauge_height( "default_gauge_height", 0, std::numeric_limits::max(), 25, false); #endif /* BUILD_X11 */ conky::simple_config_setting console_graph_ticks( "console_graph_ticks", " ,_,=,#", false); } // namespace /* special data types flags */ #define SF_SCALED (1 << 0) #define SF_SHOWLOG (1 << 1) /* * Special data typedefs */ struct bar { char flags; int width, height; double scale; }; struct gauge { char flags; int width, height; double scale; }; struct graph { int id; char flags; int width, height; unsigned int first_colour, last_colour; double scale; char tempgrad; }; struct stippled_hr { int height, arg; }; struct tab { int width, arg; }; /* * Scanning arguments to various special text objects */ #ifdef BUILD_X11 const char *scan_gauge(struct text_object *obj, const char *args, double scale) { struct gauge *g; g = static_cast(malloc(sizeof(struct gauge))); memset(g, 0, sizeof(struct gauge)); /*width and height*/ g->width = default_gauge_width.get(*state); g->height = default_gauge_height.get(*state); if (scale != 0.0) { g->scale = scale; } else { g->flags |= SF_SCALED; } /* gauge's argument is either height or height,width */ if (args != nullptr) { int n = 0; if (sscanf(args, "%d,%d %n", &g->height, &g->width, &n) <= 1) { if (sscanf(args, "%d %n", &g->height, &n) == 2) { g->width = g->height; /*square gauge*/ } } args += n; } obj->special_data = g; return args; } #endif const char *scan_bar(struct text_object *obj, const char *args, double scale) { struct bar *b; b = static_cast(malloc(sizeof(struct bar))); memset(b, 0, sizeof(struct bar)); /* zero width means all space that is available */ b->width = default_bar_width.get(*state); b->height = default_bar_height.get(*state); if (scale != 0.0) { b->scale = scale; } else { b->flags |= SF_SCALED; } /* bar's argument is either height or height,width */ if (args != nullptr) { int n = 0; if (sscanf(args, "%d,%d %n", &b->height, &b->width, &n) <= 1) { sscanf(args, "%d %n", &b->height, &n); } args += n; } obj->special_data = b; return args; } #ifdef BUILD_X11 void scan_font(struct text_object *obj, const char *args) { if ((args != nullptr) && (*args != 0)) { obj->data.s = strndup(args, DEFAULT_TEXT_BUFFER_SIZE); } } /** * parses for [height,width] [color1 color2] [scale] [-t] [-l] * * -l will set the showlog flag, enabling logarithmic graph scales * -t will set the tempgrad member to true, enabling temperature gradient colors * * @param[out] obj struct in which to save width, height and other options * @param[in] args argument string to parse * @param[in] defscale default scale if no scale argument given * @return string to the command argument, nullptr if argument didn't start with * a string, but a number or if invalid argument string **/ char *scan_graph(struct text_object *obj, const char *args, double defscale) { char quoted_cmd[1024] = {'\0'}; /* double-quoted execgraph command */ char argstr[1024] = {'\0'}; /* args minus quoted_cmd */ char buf[1024] = {'\0'}; /* first unquoted string argument in argstr */ auto *g = static_cast(malloc(sizeof(struct graph))); memset(g, 0, sizeof(struct graph)); obj->special_data = g; /* zero width means all space that is available */ g->id = ++graph_count; g->width = default_graph_width.get(*state); g->height = default_graph_height.get(*state); g->first_colour = 0; g->last_colour = 0; g->scale = defscale; g->tempgrad = FALSE; if (args != nullptr) { /* extract double-quoted command in case of execgraph */ if (*args == '"') { char *_ptr; size_t _size; if (((_ptr = const_cast(strrchr(args, '"'))) != nullptr) && _ptr != args) { _size = _ptr - args - 1; } else { NORM_ERR("mismatched double-quote in execgraph object"); return nullptr; } _size = _size < 1024 ? _size : 1023; strncpy(quoted_cmd, args + 1, _size); quoted_cmd[_size] = '\0'; /* copy everything after the last quote into argstr */ if (_size + 2 < strlen(args)) { strncpy(argstr, args + _size + 2, 1023); } } else { /* redundant, but simplifies the code below */ strncpy(argstr, args, 1023); } /* set tempgrad to true, if '-t' specified. * It doesn#t matter where the argument is exactly. */ if ((strstr(argstr, " " TEMPGRAD) != nullptr) || strncmp(argstr, TEMPGRAD, strlen(TEMPGRAD)) == 0) { g->tempgrad = TRUE; } /* set showlog-flag, if '-l' specified * It doesn#t matter where the argument is exactly. */ if ((strstr(argstr, " " LOGGRAPH) != nullptr) || strncmp(argstr, LOGGRAPH, strlen(LOGGRAPH)) == 0) { g->flags |= SF_SHOWLOG; } /* all the following functions try to interpret the beginning of a * a string with different formaters. If successfully the return from * this whole function */ /* interpret the beginning(!) of the argument string as: * '[height],[width] [color1] [color2] [scale]' * This means parameters like -t and -l may not be in the beginning */ if (sscanf(argstr, "%d,%d %x %x %lf", &g->height, &g->width, &g->first_colour, &g->last_colour, &g->scale) == 5) { return *quoted_cmd != 0 ? strndup(quoted_cmd, text_buffer_size.get(*state)) : nullptr; } /* [height],[width] [color1] [color2] */ g->scale = defscale; if (sscanf(argstr, "%d,%d %x %x", &g->height, &g->width, &g->first_colour, &g->last_colour) == 4) { return *quoted_cmd != 0 ? strndup(quoted_cmd, text_buffer_size.get(*state)) : nullptr; } /* [command] [height],[width] [color1] [color2] [scale] */ if (sscanf(argstr, "%1023s %d,%d %x %x %lf", buf, &g->height, &g->width, &g->first_colour, &g->last_colour, &g->scale) == 6) { return strndup(buf, text_buffer_size.get(*state)); } g->scale = defscale; if (sscanf(argstr, "%1023s %d,%d %x %x", buf, &g->height, &g->width, &g->first_colour, &g->last_colour) == 5) { return strndup(buf, text_buffer_size.get(*state)); } buf[0] = '\0'; g->height = default_graph_height.get(*state); g->width = default_graph_width.get(*state); if (sscanf(argstr, "%x %x %lf", &g->first_colour, &g->last_colour, &g->scale) == 3) { return *quoted_cmd != 0 ? strndup(quoted_cmd, text_buffer_size.get(*state)) : nullptr; } g->scale = defscale; if (sscanf(argstr, "%x %x", &g->first_colour, &g->last_colour) == 2) { return *quoted_cmd != 0 ? strndup(quoted_cmd, text_buffer_size.get(*state)) : nullptr; } if (sscanf(argstr, "%1023s %x %x %lf", buf, &g->first_colour, &g->last_colour, &g->scale) == 4) { return strndup(buf, text_buffer_size.get(*state)); } g->scale = defscale; if (sscanf(argstr, "%1023s %x %x", buf, &g->first_colour, &g->last_colour) == 3) { return strndup(buf, text_buffer_size.get(*state)); } buf[0] = '\0'; g->first_colour = 0; g->last_colour = 0; if (sscanf(argstr, "%d,%d %lf", &g->height, &g->width, &g->scale) == 3) { return *quoted_cmd != 0 ? strndup(quoted_cmd, text_buffer_size.get(*state)) : nullptr; } g->scale = defscale; if (sscanf(argstr, "%d,%d", &g->height, &g->width) == 2) { return *quoted_cmd != 0 ? strndup(quoted_cmd, text_buffer_size.get(*state)) : nullptr; } if (sscanf(argstr, "%1023s %d,%d %lf", buf, &g->height, &g->width, &g->scale) < 4) { g->scale = defscale; // TODO(brenden): check the return value and throw an error? sscanf(argstr, "%1023s %d,%d", buf, &g->height, &g->width); } if ((*quoted_cmd == 0) && (*buf == 0)) { return nullptr; } return strndup(*quoted_cmd != 0 ? quoted_cmd : buf, text_buffer_size.get(*state)); } return nullptr; } #endif /* BUILD_X11 */ /* * Printing various special text objects */ struct special_t *new_special_t_node() { auto *newnode = new special_t; memset(newnode, 0, sizeof *newnode); return newnode; } /** * expands the current global linked list specials to special_count elements * * increases special_count * @param[out] buf is set to "\x01\x00" not sure why ??? * @param[in] t special type enum, e.g. alignc, alignr, fg, bg, ... * @return pointer to the newly inserted special of type t **/ struct special_t *new_special(char *buf, enum special_types t) { special_t *current; buf[0] = SPECIAL_CHAR; buf[1] = '\0'; if (specials == nullptr) { specials = new_special_t_node(); } current = specials; /* allocate special_count linked list elements */ for (int i = 0; i < special_count; i++) { if (current->next == nullptr) { current->next = new_special_t_node(); } current = current->next; } current->type = t; special_count++; return current; } void new_gauge_in_shell(struct text_object *obj, char *p, unsigned int p_max_size, double usage) { static const char *gaugevals[] = {"_. ", "\\. ", " | ", " ./", " ._"}; auto *g = static_cast(obj->special_data); snprintf(p, p_max_size, "%s", gaugevals[round_to_positive_int(usage * 4 / g->scale)]); } #ifdef BUILD_X11 void new_gauge_in_x11(struct text_object *obj, char *buf, double usage) { struct special_t *s = nullptr; auto *g = static_cast(obj->special_data); if (!out_to_x.get(*state)) { return; } if (g == nullptr) { return; } s = new_special(buf, GAUGE); s->arg = usage; s->width = xft_dpi_scale(g->width); s->height = xft_dpi_scale(g->height); s->scale = g->scale; } #endif /* BUILD_X11 */ void new_gauge(struct text_object *obj, char *p, unsigned int p_max_size, double usage) { auto *g = static_cast(obj->special_data); if ((p_max_size == 0) || (g == nullptr)) { return; } if ((g->flags & SF_SCALED) != 0) { g->scale = std::max(g->scale, usage); } else { usage = std::min(g->scale, usage); } #ifdef BUILD_X11 if (out_to_x.get(*state)) { new_gauge_in_x11(obj, p, usage); } if (out_to_stdout.get(*state)) { new_gauge_in_shell(obj, p, p_max_size, usage); } #else /* BUILD_X11 */ new_gauge_in_shell(obj, p, p_max_size, usage); #endif /* BUILD_X11 */ } #ifdef BUILD_X11 void new_font(struct text_object *obj, char *p, unsigned int p_max_size) { struct special_t *s; unsigned int tmp = selected_font; if (!out_to_x.get(*state)) { return; } if (p_max_size == 0) { return; } s = new_special(p, FONT); if (obj->data.s != nullptr) { if (s->font_added >= static_cast(fonts.size()) || (s->font_added == 0) || obj->data.s != fonts[s->font_added].name) { selected_font = s->font_added = add_font(obj->data.s); selected_font = tmp; } } else { selected_font = s->font_added = 0; selected_font = tmp; } } /** * Adds value f to graph possibly truncating and scaling the graph **/ static void graph_append(struct special_t *graph, double f, char showaslog) { int i; /* do nothing if we don't even have a graph yet */ if (graph->graph == nullptr) { return; } if (showaslog != 0) { #ifdef BUILD_MATH f = log10(f + 1); #endif } if ((graph->scaled == 0) && f > graph->scale) { f = graph->scale; } /* shift all the data by 1 */ for (i = graph->graph_allocated - 1; i > 0; i--) { graph->graph[i] = graph->graph[i - 1]; } graph->graph[0] = f; /* add new data */ if (graph->scaled != 0) { graph->scale = *std::max_element(graph->graph + 0, graph->graph + graph->graph_width); if (graph->scale < 1e-47) { /* avoid NaN's when the graph is all-zero (e.g. before the first update) * there is nothing magical about 1e-47 here */ graph->scale = 1e-47; } } } void new_graph_in_shell(struct special_t *s, char *buf, int buf_max_size) { // Split config string on comma to avoid the hassle of dealing with the // idiosyncrasies of multi-byte unicode on different platforms. // TODO(brenden): Parse config string once and cache result. const std::string ticks = console_graph_ticks.get(*state); std::stringstream ss(ticks); std::string tickitem; std::vector tickitems; while (std::getline(ss, tickitem, ',')) { tickitems.push_back(tickitem); } char *p = buf; char *buf_max = buf + (sizeof(char) * buf_max_size); double scale = (tickitems.size() - 1) / s->scale; for (int i = s->graph_allocated - 1; i >= 0; i--) { const unsigned int v = round_to_positive_int(s->graph[i] * scale); const char *tick = tickitems[v].c_str(); size_t itemlen = tickitems[v].size(); for (unsigned int j = 0; j < itemlen; j++) { *p++ = tick[j]; if (p == buf_max) { goto graph_buf_end; } } } graph_buf_end: *p = '\0'; } double *copy_graph(double *original_graph, int graph_width) { double *new_graph = static_cast(malloc(graph_width * sizeof(double))); memcpy(new_graph, original_graph, graph_width * sizeof(double)); return new_graph; } double *retrieve_graph(int graph_id, int graph_width) { if (graphs.find(graph_id) == graphs.end()) { return static_cast(calloc(1, graph_width * sizeof(double))); } else { return copy_graph(graphs[graph_id], graph_width); } } void store_graph(int graph_id, struct special_t *s) { if (s->graph == nullptr) { graphs[graph_id] = nullptr; } else { if (graphs.find(graph_id) != graphs.end()) { free(graphs[graph_id]); } graphs[graph_id] = s->graph; } } /** * Creates a visual graph and/or appends val to the graph / plot * * @param[in] obj struct containing all relevant flags like width, height, ... * @param[in] buf buffer for ascii art graph in console * @param[in] buf_max_size maximum length of buf * @param[in] val value to plot i.e. to add to plot **/ void new_graph(struct text_object *obj, char *buf, int buf_max_size, double val) { struct special_t *s = nullptr; auto *g = static_cast(obj->special_data); if ((g == nullptr) || (buf_max_size == 0)) { return; } s = new_special(buf, GRAPH); /* set graph (special) width to width in obj */ s->width = xft_dpi_scale(g->width); if (s->width != 0) { s->graph_width = s->width; } if (s->graph_width != s->graph_allocated) { auto *graph = static_cast( realloc(s->graph, s->graph_width * sizeof(double))); DBGP("reallocing graph from %d to %d", s->graph_allocated, s->graph_width); if (s->graph == nullptr) { /* initialize */ std::fill_n(graph, s->graph_width, 0.0); s->scale = 100; } else if (graph != nullptr) { if (s->graph_width > s->graph_allocated) { /* initialize the new region */ std::fill(graph + s->graph_allocated, graph + s->graph_width, 0.0); } } else { DBGP("reallocing FAILED"); graph = s->graph; s->graph_width = s->graph_allocated; } s->graph = graph; s->graph_allocated = s->graph_width; graphs[g->id] = graph; } s->height = xft_dpi_scale(g->height); s->first_colour = adjust_colours(g->first_colour); s->last_colour = adjust_colours(g->last_colour); if (g->scale != 0) { s->scaled = 0; s->scale = g->scale; s->show_scale = 0; } else { s->scaled = 1; s->scale = 1; s->show_scale = 1; } s->tempgrad = g->tempgrad; #ifdef BUILD_MATH if ((g->flags & SF_SHOWLOG) != 0) { s->scale_log = 1; s->scale = log10(s->scale + 1); } #endif int graph_id = ((struct graph *)obj->special_data)->id; s->graph = retrieve_graph(graph_id, s->graph_width); graph_append(s, val, g->flags); store_graph(graph_id, s); if (out_to_stdout.get(*state)) { new_graph_in_shell(s, buf, buf_max_size); } } void new_hr(struct text_object *obj, char *p, unsigned int p_max_size) { if (!out_to_x.get(*state)) { return; } if (p_max_size == 0) { return; } new_special(p, HORIZONTAL_LINE)->height = xft_dpi_scale(obj->data.l); } void scan_stippled_hr(struct text_object *obj, const char *arg) { struct stippled_hr *sh; sh = static_cast(malloc(sizeof(struct stippled_hr))); memset(sh, 0, sizeof(struct stippled_hr)); sh->arg = stippled_borders.get(*state); sh->height = 1; if (arg != nullptr) { if (sscanf(arg, "%d %d", &sh->arg, &sh->height) != 2) { sscanf(arg, "%d", &sh->height); } } if (sh->arg <= 0) { sh->arg = 1; } obj->special_data = sh; } void new_stippled_hr(struct text_object *obj, char *p, unsigned int p_max_size) { struct special_t *s = nullptr; auto *sh = static_cast(obj->special_data); if (!out_to_x.get(*state)) { return; } if ((sh == nullptr) || (p_max_size == 0)) { return; } s = new_special(p, STIPPLED_HR); s->height = xft_dpi_scale(sh->height); s->arg = xft_dpi_scale(sh->arg); } #endif /* BUILD_X11 */ void new_fg(struct text_object *obj, char *p, unsigned int p_max_size) { #ifdef BUILD_X11 if (out_to_x.get(*state)) { new_special(p, FG)->arg = obj->data.l; } #endif /* BUILD_X11 */ #ifdef BUILD_NCURSES if (out_to_ncurses.get(*state)) { new_special(p, FG)->arg = obj->data.l; } #endif /* BUILD_NCURSES */ UNUSED(obj); UNUSED(p); UNUSED(p_max_size); } #ifdef BUILD_X11 void new_bg(struct text_object *obj, char *p, unsigned int p_max_size) { if (!out_to_x.get(*state)) { return; } if (p_max_size == 0) { return; } new_special(p, BG)->arg = obj->data.l; } #endif /* BUILD_X11 */ static void new_bar_in_shell(struct text_object *obj, char *buffer, unsigned int buf_max_size, double usage) { auto *b = static_cast(obj->special_data); unsigned int width, i, scaledusage; if (b == nullptr) { return; } width = b->width; if (width == 0) { width = DEFAULT_BAR_WIDTH_NO_X; } if (width > buf_max_size) { width = buf_max_size; } scaledusage = round_to_positive_int(usage * width / b->scale); for (i = 0; i < scaledusage; i++) { buffer[i] = *(bar_fill.get(*state).c_str()); } for (; i < width; i++) { buffer[i] = *(bar_unfill.get(*state).c_str()); } buffer[i] = 0; } #ifdef BUILD_X11 static void new_bar_in_x11(struct text_object *obj, char *buf, double usage) { struct special_t *s = nullptr; auto *b = static_cast(obj->special_data); if (!out_to_x.get(*state)) { return; } if (b == nullptr) { return; } s = new_special(buf, BAR); s->arg = usage; s->width = xft_dpi_scale(b->width); s->height = xft_dpi_scale(b->height); s->scale = b->scale; } #endif /* BUILD_X11 */ /* usage is in range [0,255] */ void new_bar(struct text_object *obj, char *p, unsigned int p_max_size, double usage) { auto *b = static_cast(obj->special_data); if ((p_max_size == 0) || (b == nullptr)) { return; } if ((b->flags & SF_SCALED) != 0) { b->scale = std::max(b->scale, usage); } else { usage = std::min(b->scale, usage); } #ifdef BUILD_X11 if (out_to_x.get(*state)) { new_bar_in_x11(obj, p, usage); } if (out_to_stdout.get(*state)) { new_bar_in_shell(obj, p, p_max_size, usage); } #else /* BUILD_X11 */ new_bar_in_shell(obj, p, p_max_size, usage); #endif /* BUILD_X11 */ } void new_outline(struct text_object *obj, char *p, unsigned int p_max_size) { if (p_max_size == 0) { return; } new_special(p, OUTLINE)->arg = obj->data.l; } void new_offset(struct text_object *obj, char *p, unsigned int p_max_size) { if (p_max_size == 0) { return; } new_special(p, OFFSET)->arg = xft_dpi_scale(obj->data.l); } void new_voffset(struct text_object *obj, char *p, unsigned int p_max_size) { if (p_max_size == 0) { return; } new_special(p, VOFFSET)->arg = xft_dpi_scale(obj->data.l); } void new_save_coordinates(struct text_object *obj, char *p, unsigned int p_max_size) { if (p_max_size == 0) { return; } new_special(p, SAVE_COORDINATES)->arg = obj->data.l; } void new_alignr(struct text_object *obj, char *p, unsigned int p_max_size) { if (p_max_size == 0) { return; } new_special(p, ALIGNR)->arg = xft_dpi_scale(obj->data.l); } // A positive offset pushes the text further left void new_alignc(struct text_object *obj, char *p, unsigned int p_max_size) { if (p_max_size == 0) { return; } new_special(p, ALIGNC)->arg = xft_dpi_scale(obj->data.l); } void new_goto(struct text_object *obj, char *p, unsigned int p_max_size) { if (p_max_size == 0) { return; } new_special(p, GOTO)->arg = xft_dpi_scale(obj->data.l); } void scan_tab(struct text_object *obj, const char *arg) { struct tab *t; t = static_cast(malloc(sizeof(struct tab))); memset(t, 0, sizeof(struct tab)); t->width = 10; t->arg = 0; if (arg != nullptr) { if (sscanf(arg, "%d %d", &t->width, &t->arg) != 2) { sscanf(arg, "%d", &t->arg); } } if (t->width <= 0) { t->width = 1; } obj->special_data = t; } void new_tab(struct text_object *obj, char *p, unsigned int p_max_size) { struct special_t *s = nullptr; auto *t = static_cast(obj->special_data); if ((t == nullptr) || (p_max_size == 0)) { return; } s = new_special(p, TAB); s->width = xft_dpi_scale(t->width); s->arg = xft_dpi_scale(t->arg); } void clear_stored_graphs() { graph_count = 0; graphs.clear(); } conky-1.12.2/src/specials.h000066400000000000000000000071421404127277500155000ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _SPECIALS_H #define _SPECIALS_H /* special stuff in text_buffer */ #define SPECIAL_CHAR '\x01' // don't use spaces in LOGGRAPH or NORMGRAPH if you change them #define LOGGRAPH "-l" #define TEMPGRAD "-t" enum special_types { NONSPECIAL = 0, HORIZONTAL_LINE = 1, STIPPLED_HR, BAR, FG, BG, OUTLINE, ALIGNR, ALIGNC, GAUGE, GRAPH, OFFSET, VOFFSET, SAVE_COORDINATES, FONT, GOTO, TAB }; struct special_t { int type; short height; short width; double arg; double *graph; double scale; /* maximum value */ short show_scale; int graph_width; int graph_allocated; int scaled; /* auto adjust maximum */ int scale_log; unsigned long first_colour; // for graph gradient unsigned long last_colour; short font_added; char tempgrad; struct special_t *next; }; /* direct access to the registered specials (FIXME: bad encapsulation) */ extern struct special_t *specials; extern int special_count; /* forward declare to avoid mutual inclusion between specials.h and * text_object.h */ struct text_object; /* scanning special arguments */ const char *scan_bar(struct text_object *, const char *, double); const char *scan_gauge(struct text_object *, const char *, double); #ifdef BUILD_X11 void scan_font(struct text_object *, const char *); char *scan_graph(struct text_object *, const char *, double); void scan_tab(struct text_object *, const char *); void scan_stippled_hr(struct text_object *, const char *); /* printing specials */ void new_font(struct text_object *, char *, unsigned int); void new_graph(struct text_object *, char *, int, double); void new_hr(struct text_object *, char *, unsigned int); void new_stippled_hr(struct text_object *, char *, unsigned int); #endif /* BUILD_X11 */ void new_gauge(struct text_object *, char *, unsigned int, double); void new_bar(struct text_object *, char *, unsigned int, double); void new_fg(struct text_object *, char *, unsigned int); void new_bg(struct text_object *, char *, unsigned int); void new_outline(struct text_object *, char *, unsigned int); void new_offset(struct text_object *, char *, unsigned int); void new_voffset(struct text_object *, char *, unsigned int); void new_save_coordinates(struct text_object *, char *, unsigned int); void new_alignr(struct text_object *, char *, unsigned int); void new_alignc(struct text_object *, char *, unsigned int); void new_goto(struct text_object *, char *, unsigned int); void new_tab(struct text_object *, char *, unsigned int); void clear_stored_graphs(); struct special_t *new_special(char *buf, enum special_types t); #endif /* _SPECIALS_H */ conky-1.12.2/src/tailhead.cc000066400000000000000000000161471404127277500156130ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include #include #include #include "common.h" #include "config.h" #include "conky.h" #include "logging.h" #include "text_object.h" #define MAX_HEADTAIL_LINES 30 #define DEFAULT_MAX_HEADTAIL_USES 2 struct headtail { int wantedlines{0}; std::string logfile; char *buffer{nullptr}; int current_use{0}; int max_uses{0}; int reported{0}; headtail() = default; ~headtail() { free(buffer); } }; static void tailstring(char *string, int endofstring, int wantedlines) { int i, linescounted = 0; string[endofstring] = 0; if (endofstring > 0) { if (string[endofstring - 1] == '\n') { // work with or without \n at end of file string[endofstring - 1] = 0; } for (i = endofstring - 1; i >= 0 && linescounted < wantedlines; i--) { if (string[i] == '\n') { linescounted++; } } if (i > 0) { strfold(string, i + 2); } } } void free_tailhead(struct text_object *obj) { auto *ht = static_cast(obj->data.opaque); obj->data.opaque = nullptr; delete ht; } void init_tailhead(const char *type, const char *arg, struct text_object *obj, void *free_at_crash) { unsigned int args; auto *ht = new headtail; std::unique_ptr tmp(new char[DEFAULT_TEXT_BUFFER_SIZE]); memset(tmp.get(), 0, DEFAULT_TEXT_BUFFER_SIZE); ht->max_uses = DEFAULT_MAX_HEADTAIL_USES; // XXX: Buffer overflow ? args = sscanf(arg, "%s %d %d", tmp.get(), &ht->wantedlines, &ht->max_uses); if (args < 2 || args > 3) { free_tailhead(obj); CRIT_ERR(obj, free_at_crash, "%s needs a file as 1st and a number of lines as 2nd argument", type); } if (ht->max_uses < 1) { free_tailhead(obj); CRIT_ERR(obj, free_at_crash, "invalid arg for %s, next_check must be larger than 0", type); } if (ht->wantedlines > 0 && ht->wantedlines <= MAX_HEADTAIL_LINES) { ht->logfile = to_real_path(tmp.get()); ht->buffer = nullptr; ht->current_use = 0; } else { free_tailhead(obj); CRIT_ERR(obj, free_at_crash, "invalid arg for %s, number of lines must be between 1 and %d", type, MAX_HEADTAIL_LINES); } obj->data.opaque = ht; } static void print_tailhead(const char *type, struct text_object *obj, char *p, unsigned int p_max_size) { int fd, i, endofstring = 0, linescounted = 0; FILE *fp; struct stat st {}; auto *ht = static_cast(obj->data.opaque); if (ht == nullptr) { return; } // empty the buffer and reset the counter if we used it the max number of // times if ((ht->buffer != nullptr) && ht->current_use >= ht->max_uses - 1) { free_and_zero(ht->buffer); ht->current_use = 0; } // use the buffer if possible if (ht->buffer != nullptr) { strncpy(p, ht->buffer, p_max_size); ht->current_use++; } else { // otherwise find the needed data if (stat(ht->logfile.c_str(), &st) == 0) { if (S_ISFIFO(st.st_mode)) { fd = open_fifo(ht->logfile.c_str(), &ht->reported); if (fd != -1) { if (strcmp(type, "head") == 0) { for (i = 0; linescounted < ht->wantedlines; i++) { if (read(fd, p + i, 1) <= 0) { break; } if (p[i] == '\n') { linescounted++; } } p[i] = 0; } else if (strcmp(type, "tail") == 0) { i = read(fd, p, p_max_size - 1); tailstring(p, i, ht->wantedlines); } else { CRIT_ERR(nullptr, nullptr, "If you are seeing this then there is a bug in the code, " "report it !"); } } close(fd); } else { fp = open_file(ht->logfile.c_str(), &ht->reported); if (fp != nullptr) { if (strcmp(type, "head") == 0) { for (i = 0; i < ht->wantedlines; i++) { if (fgets(p + endofstring, p_max_size - endofstring, fp) == nullptr) { break; } endofstring = strlen(p); } } else if (strcmp(type, "tail") == 0) { fseek(fp, -static_cast(p_max_size), SEEK_END); i = fread(p, 1, p_max_size - 1, fp); tailstring(p, i, ht->wantedlines); } else { CRIT_ERR(nullptr, nullptr, "If you are seeing this then there is a bug in the code, " "report it !"); } fclose(fp); } } ht->buffer = strdup(p); } else { CRIT_ERR(nullptr, nullptr, "$%s can't find information about %s", type, ht->logfile.c_str()); } } } void print_head(struct text_object *obj, char *p, unsigned int p_max_size) { print_tailhead("head", obj, p, p_max_size); } void print_tail(struct text_object *obj, char *p, unsigned int p_max_size) { print_tailhead("tail", obj, p, p_max_size); } /* FIXME: use something more general (see also tail.c, head.c */ #define BUFSZ 0x1000 void print_lines(struct text_object *obj, char *p, unsigned int p_max_size) { static int rep = 0; FILE *fp = open_file(obj->data.s, &rep); char buf[BUFSZ]; int j, lines; if (fp == nullptr) { snprintf(p, p_max_size, "%s", "File Unreadable"); return; } lines = 0; while (fgets(buf, BUFSZ, fp) != nullptr) { for (j = 0; buf[j] != 0; j++) { if (buf[j] == '\n') { lines++; } } } snprintf(p, p_max_size, "%d", lines); fclose(fp); } void print_words(struct text_object *obj, char *p, unsigned int p_max_size) { static int rep = 0; FILE *fp = open_file(obj->data.s, &rep); char buf[BUFSZ]; int j, words; char inword = 0; if (fp == nullptr) { snprintf(p, p_max_size, "%s", "File Unreadable"); return; } words = 0; while (fgets(buf, BUFSZ, fp) != nullptr) { for (j = 0; buf[j] != 0; j++) { if (isspace(static_cast(buf[j])) == 0) { if (inword == 0) { words++; inword = 1; } } else { inword = 0; } } } snprintf(p, p_max_size, "%d", words); fclose(fp); } conky-1.12.2/src/tailhead.h000066400000000000000000000027201404127277500154450ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _TAILHEAD_H #define _TAILHEAD_H void free_tailhead(struct text_object *); void init_tailhead(const char *, const char *, struct text_object *, void *); void print_head(struct text_object *, char *, unsigned int); void print_tail(struct text_object *, char *, unsigned int); void print_lines(struct text_object *, char *, unsigned int); void print_words(struct text_object *, char *, unsigned int); #endif /* _TAILHEAD_H */ conky-1.12.2/src/tcp-portmon.cc000066400000000000000000000123511404127277500163130ustar00rootroot00000000000000/* * * tcp-portmon.c - libtcp-portmon hooks * * Copyright (C) 2008 Phil Sutter * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "tcp-portmon.h" #include "conky.h" #include "libtcp-portmon.h" #include "logging.h" #include "text_object.h" static tcp_port_monitor_collection_t *pmc = nullptr; static conky::range_config_setting max_port_monitor_connections( "max_port_monitor_connections", 0, std::numeric_limits::max(), MAX_PORT_MONITOR_CONNECTIONS_DEFAULT, false); int tcp_portmon_init(struct text_object *obj, const char *arg) { int item = -1; int argc; int port_begin; int port_end; int connection_index; char itembuf[32]; struct tcp_port_monitor_data *pmd; memset(itembuf, 0, sizeof(itembuf)); connection_index = 0; /* massive argument checking */ argc = sscanf(arg, "%d %d %31s %d", &port_begin, &port_end, itembuf, &connection_index); if ((argc != 3) && (argc != 4)) { CRIT_ERR(nullptr, NULL, "tcp_portmon: requires 3 or 4 arguments"); } if ((port_begin < 1) || (port_begin > 65535) || (port_end < 1) || (port_end > 65535)) { CRIT_ERR(nullptr, NULL, "tcp_portmon: port values must be from 1 to 65535"); } if (port_begin > port_end) { CRIT_ERR(nullptr, NULL, "tcp_portmon: starting port must be <= ending port"); } if (strncmp(itembuf, "count", 31) == EQUAL) { item = COUNT; } else if (strncmp(itembuf, "rip", 31) == EQUAL) { item = REMOTEIP; } else if (strncmp(itembuf, "rhost", 31) == EQUAL) { item = REMOTEHOST; } else if (strncmp(itembuf, "rport", 31) == EQUAL) { item = REMOTEPORT; } else if (strncmp(itembuf, "rservice", 31) == EQUAL) { item = REMOTESERVICE; } else if (strncmp(itembuf, "lip", 31) == EQUAL) { item = LOCALIP; } else if (strncmp(itembuf, "lhost", 31) == EQUAL) { item = LOCALHOST; } else if (strncmp(itembuf, "lport", 31) == EQUAL) { item = LOCALPORT; } else if (strncmp(itembuf, "lservice", 31) == EQUAL) { item = LOCALSERVICE; } else { CRIT_ERR(nullptr, NULL, "tcp_portmon: invalid item specified"); } if ((argc == 3) && (item != COUNT)) { CRIT_ERR(nullptr, NULL, "tcp_portmon: 3 argument form valid only for \"count\" " "item"); } if ((argc == 4) && (connection_index < 0)) { CRIT_ERR(nullptr, NULL, "tcp_portmon: connection index must be non-negative"); } /* ok, args looks good. save the text object data */ pmd = (tcp_port_monitor_data *)malloc(sizeof(struct tcp_port_monitor_data)); memset(pmd, 0, sizeof(struct tcp_port_monitor_data)); pmd->port_range_begin = (in_port_t)port_begin; pmd->port_range_end = (in_port_t)port_end; pmd->item = item; pmd->connection_index = connection_index; obj->data.opaque = pmd; /* if the port monitor collection hasn't been created, * we must create it */ if (!pmc) { pmc = create_tcp_port_monitor_collection(); if (!pmc) { CRIT_ERR(nullptr, NULL, "tcp_portmon: unable to create port monitor " "collection"); } } /* if a port monitor for this port does not exist, * create one and add it to the collection */ if (find_tcp_port_monitor(pmc, port_begin, port_end) == nullptr) { tcp_port_monitor_args_t pma; memset(&pma, 0, sizeof pma); pma.max_port_monitor_connections = max_port_monitor_connections.get(*state); /* add the newly created monitor to the collection */ if (insert_new_tcp_port_monitor_into_collection(pmc, port_begin, port_end, &pma) != 0) { CRIT_ERR(nullptr, NULL, "tcp_portmon: unable to add port monitor to " "collection"); } } return 0; } void tcp_portmon_action(struct text_object *obj, char *p, unsigned int p_max_size) { struct tcp_port_monitor_data *pmd = (tcp_port_monitor_data *)obj->data.opaque; tcp_port_monitor_t *p_monitor; if (!pmd) return; /* grab a pointer to this port monitor */ p_monitor = find_tcp_port_monitor(pmc, pmd->port_range_begin, pmd->port_range_end); if (!p_monitor) { snprintf(p, p_max_size, "%s", "monitor not found"); return; } /* now grab the text of interest */ if (peek_tcp_port_monitor(p_monitor, pmd->item, pmd->connection_index, p, p_max_size) != 0) { snprintf(p, p_max_size, "%s", "monitor peek error"); } } int tcp_portmon_update(void) { update_tcp_port_monitor_collection(pmc); return 0; } int tcp_portmon_clear(void) { destroy_tcp_port_monitor_collection(pmc); pmc = nullptr; return 0; } void tcp_portmon_free(struct text_object *obj) { free_and_zero(obj->data.opaque); } conky-1.12.2/src/tcp-portmon.h000066400000000000000000000026321404127277500161560ustar00rootroot00000000000000/* * * tcp-portmon.h - libtcp-portmon hooks prototypes * * Copyright (C) 2008 Phil Sutter * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _TCP_PORTMON_H #define _TCP_PORTMON_H #include "libtcp-portmon.h" struct tcp_port_monitor_data { /* starting port to monitor */ in_port_t port_range_begin; /* ending port to monitor */ in_port_t port_range_end; /* enum from libtcp-portmon.h, e.g. COUNT, etc. */ int item; /* 0 to n-1 connections. */ int connection_index; }; /* forward declare to make gcc happy */ struct text_object; int tcp_portmon_init(struct text_object *, const char *); void tcp_portmon_action(struct text_object *, char *, unsigned int); int tcp_portmon_update(void); int tcp_portmon_clear(void); void tcp_portmon_free(struct text_object *); #endif /* _TCP_PORTMON_H */ conky-1.12.2/src/temphelper.cc000066400000000000000000000043571404127277500162050ustar00rootroot00000000000000/* * * temphelper.c: aid in converting temperature units * * Copyright (C) 2008 Phil Sutter * * This library 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. * * This library 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. * * You should have received a copy of the GNU General Public License * along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA. * */ #include "temphelper.h" #include #include #include #include #include #include "config.h" #include "conky.h" template <> conky::lua_traits::Map conky::lua_traits::map = { {"celsius", TEMP_CELSIUS}, {"fahrenheit", TEMP_FAHRENHEIT}}; static conky::simple_config_setting output_unit("temperature_unit", TEMP_CELSIUS, true); static double fahrenheit_to_celsius(double n) { return ((n - 32) * 5 / 9); } static double celsius_to_fahrenheit(double n) { return ((n * 9 / 5) + 32); } static double convert_temp_output(double n, enum TEMP_UNIT input_unit) { if (input_unit == output_unit.get(*state)) { return n; } switch (output_unit.get(*state)) { case TEMP_CELSIUS: return fahrenheit_to_celsius(n); case TEMP_FAHRENHEIT: return celsius_to_fahrenheit(n); } /* NOT REACHED */ return 0.0; } int temp_print(char *p, size_t p_max_size, double n, enum TEMP_UNIT input_unit, int to_int) { int i_out = 0; float f_out = 0.0; size_t plen = 0; if (1 == to_int) { i_out = round_to_int_temp(convert_temp_output(n, input_unit)); plen = spaced_print(p, p_max_size, "%d", 3, i_out); } else { f_out = convert_temp_output(n, input_unit); plen = spaced_print(p, p_max_size, "%.2f", 3, f_out); } return static_cast(!(plen >= p_max_size)); } conky-1.12.2/src/temphelper.h000066400000000000000000000020261404127277500160360ustar00rootroot00000000000000/* * * temphelper.h: aid in converting temperature units * * Copyright (C) 2008 Phil Sutter * * This library 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. * * This library 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. * * You should have received a copy of the GNU General Public License * along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA. * */ #ifndef TEMPHELPER_H #define TEMPHELPER_H #include enum TEMP_UNIT { TEMP_CELSIUS, TEMP_FAHRENHEIT }; int temp_print(char *, std::size_t, double, enum TEMP_UNIT, int); #endif /* TEMPHELPER_H */ conky-1.12.2/src/template.cc000066400000000000000000000167321404127277500156530ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include "conky.h" #include "logging.h" namespace { conky::simple_config_setting _template[10] = { {"template0", std::string(), true}, {"template1", std::string(), true}, {"template2", std::string(), true}, {"template3", std::string(), true}, {"template4", std::string(), true}, {"template5", std::string(), true}, {"template6", std::string(), true}, {"template7", std::string(), true}, {"template8", std::string(), true}, {"template9", std::string(), true}}; } // namespace /* backslash_escape - do the actual substitution task for template objects * * The field templates is used for substituting the \N occurrences. Set it to * nullptr to leave them as they are. */ static char *backslash_escape(const char *src, char **templates, unsigned int template_count) { char *src_dup; const char *p; unsigned int dup_idx = 0, dup_len; dup_len = strlen(src) + 1; src_dup = static_cast(malloc(dup_len * sizeof(char))); p = src; while (*p != 0) { switch (*p) { case '\\': if (*(p + 1) == 0) { break; } if (*(p + 1) == '\\') { src_dup[dup_idx++] = '\\'; p++; } else if (*(p + 1) == ' ') { src_dup[dup_idx++] = ' '; p++; } else if (*(p + 1) == 'n') { src_dup[dup_idx++] = '\n'; p++; } else if (templates != nullptr) { unsigned int tmpl_num; int digits; if ((sscanf(p + 1, "%u%n", &tmpl_num, &digits) <= 0) || (tmpl_num > template_count)) { break; } if (tmpl_num == 0) { CRIT_ERR( nullptr, nullptr, "invalid template argument \\0; arguments must start at \\1"); } dup_len += strlen(templates[tmpl_num - 1]); src_dup = static_cast(realloc(src_dup, dup_len * sizeof(char))); snprintf(src_dup + dup_idx, dup_len - dup_idx, "%s", templates[tmpl_num - 1]); dup_idx += strlen(templates[tmpl_num - 1]); p += digits; } break; default: src_dup[dup_idx++] = *p; break; } p++; } src_dup[dup_idx++] = '\0'; src_dup = static_cast(realloc(src_dup, dup_idx * sizeof(char))); return src_dup; } /* handle_template_object - core logic of the template object * * use config variables like this: * template1 = "$\1\2" * template2 = "\1: ${fs_bar 4,100 \2} ${fs_used \2} / ${fs_size \2}" * * and use them like this: * ${template1 node name} * ${template2 root /} * ${template2 cdrom /mnt/cdrom} */ static char *handle_template(const char *tmpl, const char *args) { char *args_dup = nullptr; char *p, *p_old; char **argsp = nullptr; unsigned int argcnt = 0, template_idx, i; char *eval_text; if ((sscanf(tmpl, "template%u", &template_idx) != 1) || (template_idx >= MAX_TEMPLATES)) { return nullptr; } if (args != nullptr) { args_dup = strdup(args); p = args_dup; while (*p != 0) { while ((*p != 0) && (*p == ' ' && (p == args_dup || *(p - 1) != '\\'))) { p++; } if (p > args_dup && *(p - 1) == '\\') { p--; } p_old = p; while ((*p != 0) && (*p != ' ' || (p > args_dup && *(p - 1) == '\\'))) { p++; } if (*p != 0) { (*p) = '\0'; p++; } argsp = static_cast(realloc(argsp, ++argcnt * sizeof(char *))); argsp[argcnt - 1] = p_old; } for (i = 0; i < argcnt; i++) { char *tmp; tmp = backslash_escape(argsp[i], nullptr, 0); DBGP2("%s: substituted arg '%s' to '%s'", tmpl, argsp[i], tmp); argsp[i] = tmp; } } eval_text = backslash_escape(_template[template_idx].get(*state).c_str(), argsp, argcnt); DBGP("substituted %s, output is '%s'", tmpl, eval_text); free(args_dup); for (i = 0; i < argcnt; i++) { free(argsp[i]); } free(argsp); return eval_text; } /* Search inbuf and replace all found template object references * with the substituted value. */ char *find_and_replace_templates(const char *inbuf) { char *outbuf, *indup, *p, *o, *templ, *args, *tmpl_out; int stack, outlen; outlen = strlen(inbuf) + 1; o = outbuf = static_cast(calloc(outlen, sizeof(char))); memset(outbuf, 0, outlen * sizeof(char)); p = indup = strdup(inbuf); while (*p != 0) { while ((*p != 0) && *p != '$') { *(o++) = *(p++); } if ((*p) == 0) { break; } if ((static_cast(strncmp(p, "$template", strlen("$template")) != 0) != 0) && (strncmp(p, "${template", strlen("${template")) != 0)) { *(o++) = *(p++); continue; } if (*(p + 1) == '{') { p += 2; templ = p; while ((*p != 0) && (isspace(static_cast(*p)) == 0) && *p != '{' && *p != '}') { p++; } if (*p == '}') { args = nullptr; } else { args = p; } stack = 1; while ((*p != 0) && stack > 0) { if (*p == '{') { stack++; } else if (*p == '}') { stack--; } p++; } if (stack == 0) { // stack is empty. that means the previous char was }, so we zero it *(p - 1) = '\0'; } else { // we ran into the end of string without finding a closing }, bark CRIT_ERR(nullptr, nullptr, "cannot find a closing '}' in template expansion"); } } else { templ = p + 1; p += strlen("$template"); while ((*p != 0) && (isdigit(static_cast(*p)) != 0)) { p++; } args = nullptr; } tmpl_out = handle_template(templ, args); if (tmpl_out != nullptr) { int len = strlen(tmpl_out); outlen += len; *o = '\0'; outbuf = static_cast(realloc(outbuf, outlen * sizeof(char))); strncat(outbuf, tmpl_out, len); free(tmpl_out); o = outbuf + strlen(outbuf); } else { NORM_ERR("failed to handle template '%s' with args '%s'", templ, args); } } *o = '\0'; outbuf = static_cast(realloc(outbuf, (strlen(outbuf) + 1) * sizeof(char))); free(indup); return outbuf; } /* check text for any template object references */ int text_contains_templates(const char *text) { if (strcasestr(text, "${template") != nullptr) { return 1; } if (strcasestr(text, "$template") != nullptr) { return 1; } return 0; } conky-1.12.2/src/template.h000066400000000000000000000022741404127277500155110ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _TEMPLATE_H #define _TEMPLATE_H char *find_and_replace_templates(const char *); int text_contains_templates(const char *); #endif /* _TEMPLATE_H */ conky-1.12.2/src/text_object.cc000066400000000000000000000135261404127277500163500ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "text_object.h" #include #include #include #include "config.h" #include "conky.h" #include "logging.h" void gen_free_opaque(struct text_object *obj) { free_and_zero(obj->data.opaque); } int gen_false_iftest(struct text_object *) { return 0; } void gen_print_nothing(struct text_object *, char *, unsigned int) { // literally does nothing } void gen_print_obj_data_s(struct text_object *obj, char *p, unsigned int p_max_size) { if (obj->data.s == nullptr) { return; } snprintf(p, p_max_size, "%s", obj->data.s); } /* text_object_list * * this list is special. it looks like this: * nullptr <-- obj1 <--> obj2 <--> ... <--> objN --> NULL * ^-------root_object----------^ * directions are reversed here * * why this is cool: * - root_object points both to the start and end of the list * - while traversing, the end of the list is always a nullptr pointer * (this works in BOTH directions) */ /* append an object or list of objects to the given root object's list */ int append_object(struct text_object *root, struct text_object *obj) { struct text_object *end; /* hook in start of list to append */ end = root->prev; obj->prev = end; /* update pointers of the list to append to */ if (end != nullptr) { if (end->next != nullptr) { CRIT_ERR(nullptr, nullptr, "huston, we have a lift-off"); } end->next = obj; } else { root->next = obj; } /* find end of appended list to point root->prev there */ while (obj->next != nullptr) { obj = obj->next; } root->prev = obj; return 0; } /* ifblock handlers for the object list * * - each if points to it's else or endif * - each else points to it's endif * */ /* possible ifblock types * only used internally, so no need to make this public */ enum ifblock_type { IFBLOCK_IF = 1, IFBLOCK_ELSE, IFBLOCK_ENDIF }; /* linked list of ifblock objects, building a stack * only used internally, so no need to make this public */ struct ifblock_stack_obj { enum ifblock_type type; struct text_object *obj; struct ifblock_stack_obj *next; }; /* push an ifblock object onto the stack * in fact, this does a lot more: * - IFBLOCK_IF is just pushed onto the stack * - IFBLOCK_ELSE updates the "next" pointer of the upmost * object in the stack and is then pushed onto the stack * - IFBLOCK_ENDIF updates the "next" pointer of the upmost * object in the stack and then triggers stack popping of * any optional IFBLOCK_ELSE along with it's IFBLOCK_IF */ static int push_ifblock(struct ifblock_stack_obj **ifblock_stack_top, struct text_object *obj, enum ifblock_type type) { struct ifblock_stack_obj *stackobj; switch (type) { case IFBLOCK_ENDIF: if ((*ifblock_stack_top) == nullptr) { CRIT_ERR(nullptr, nullptr, "got an endif without matching if"); } (*ifblock_stack_top)->obj->ifblock_next = obj; /* if there's some else in between, remove and free it */ if ((*ifblock_stack_top)->type == IFBLOCK_ELSE) { stackobj = *ifblock_stack_top; *ifblock_stack_top = stackobj->next; free(stackobj); } /* finally remove and free the if object */ stackobj = *ifblock_stack_top; *ifblock_stack_top = stackobj->next; free(stackobj); break; case IFBLOCK_ELSE: if ((*ifblock_stack_top) == nullptr) { CRIT_ERR(nullptr, nullptr, "got an else without matching if"); } (*ifblock_stack_top)->obj->ifblock_next = obj; /* falls through */ case IFBLOCK_IF: stackobj = static_cast( malloc(sizeof(struct ifblock_stack_obj))); stackobj->type = type; stackobj->obj = obj; stackobj->next = *ifblock_stack_top; *ifblock_stack_top = stackobj; break; default: CRIT_ERR(nullptr, nullptr, "push_ifblock() misuse detected!"); } return 0; } /* public functions for client use */ int obj_be_ifblock_if(void **opaque, struct text_object *obj) { return push_ifblock(reinterpret_cast(opaque), obj, IFBLOCK_IF); } int obj_be_ifblock_else(void **opaque, struct text_object *obj) { return push_ifblock(reinterpret_cast(opaque), obj, IFBLOCK_ELSE); } int obj_be_ifblock_endif(void **opaque, struct text_object *obj) { return push_ifblock(reinterpret_cast(opaque), obj, IFBLOCK_ENDIF); } /* check if ifblock stack is empty * if so, return true (!= 0) */ int ifblock_stack_empty(void **opaque) { return static_cast(*opaque == nullptr); } void obj_be_plain_text(struct text_object *obj, const char *text) { obj->data.s = strdup(text); memset(&obj->callbacks, 0, sizeof(obj->callbacks)); obj->callbacks.print = &gen_print_obj_data_s; obj->callbacks.free = &gen_free_opaque; } conky-1.12.2/src/text_object.h000066400000000000000000000121411404127277500162020ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _TEXT_OBJECT_H #define _TEXT_OBJECT_H #include /* uint8_t */ #include "config.h" /* for the defines */ #include "exec.h" #include "specials.h" /* enum special_types */ /* text object callbacks */ struct obj_cb { /* text object: print obj's output to p */ void (*print)(struct text_object *obj, char *p, unsigned int p_max_size); /* ifblock object: return zero to trigger jumping */ int (*iftest)(struct text_object *obj); /* meter objects: * The following functions return the current meter-type value * in a range between 0 and the value passed to the appropriate * scan_* function. Or, if named function has been called with * a value of 0, make use of auto-scaling (i.e., scaling to the * maximum value seen so far). */ double (*barval)(struct text_object *obj); double (*gaugeval)(struct text_object *obj); double (*graphval)(struct text_object *obj); /* percentage object: return value in range [0, 100] */ uint8_t (*percentage)(struct text_object *obj); /* free obj's data */ void (*free)(struct text_object *obj); }; /* generic free opaque callback * can be used to simply free obj->data.opaque or obj->data.s */ void gen_free_opaque(struct text_object *); /* generic iftest returning false (i.e. trigger jumping) * used for the else object */ int gen_false_iftest(struct text_object *); /* generic nothing printer callback printing nothing * used for the endif object */ void gen_print_nothing(struct text_object *, char *, unsigned int); /* generic obj->data.s printer * used by the $text object */ void gen_print_obj_data_s(struct text_object *, char *, unsigned int); class legacy_cb : public conky::callback { typedef conky::callback Base; protected: virtual void work() { std::get<0>(tuple)(); } public: legacy_cb(uint32_t period, int (*fn)()) : Base(period, true, Base::Tuple(fn)) {} }; typedef conky::callback_handle legacy_cb_handle; typedef conky::callback_handle exec_cb_handle; /** * This is where Conky collects information on the conky.text objects in your * config * * During startup and reload, objects are parsed and callbacks are set. Note * that there are currently two types of callback: obj_cb (old style) and * conky::callback (new style). On each update interval, * generate_text_internal() in conky.cc traverses the list of text_objects and * calls the old callbacks. The new style callbacks are run separately by * conky::run_all_callbacks(). */ struct text_object { struct text_object *next, *prev; /* doubly linked list of text objects */ struct text_object *sub; /* for objects parsing text into objects */ struct text_object *ifblock_next; /* jump target for ifblock objects */ union { void *opaque; /* new style generic per object data */ char *s; /* some string */ int i; /* some integer */ long l; /* some long integer */ } data; void *special_data; long line; bool parse; /* if true then data.s should still be parsed */ bool thread; /* if true then data.s should be set by a separate thread */ struct obj_cb callbacks; /* Each _cb_handle is a std::shared_ptr with very tight restrictions on * construction. For now, it is necessary to store them here as regular * pointers so we can instantiate them later. */ exec_cb_handle *exec_handle; legacy_cb_handle *cb_handle; }; /* text object list helpers */ int append_object(struct text_object *root, struct text_object *obj); /* ifblock helpers * * Opaque is a pointer to the address of the ifblock stack's top object. * Calling clients should pass the address of a defined void pointer which * was initialised to nullptr (empty stack). * */ int obj_be_ifblock_if(void **opaque, struct text_object *); int obj_be_ifblock_else(void **opaque, struct text_object *); int obj_be_ifblock_endif(void **opaque, struct text_object *); int ifblock_stack_empty(void **opaque); /* make the given object be a plain text object printing given string */ void obj_be_plain_text(struct text_object *, const char *); #endif /* _TEXT_OBJECT_H */ conky-1.12.2/src/timeinfo.cc000066400000000000000000000240211404127277500156400ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "config.h" #include "timeinfo.h" #include #include #include #include #include "conky.h" #include "logging.h" #include "text_object.h" #include struct tztime_s { char *tz; /* timezone variable */ char *fmt; /* time display formatting */ }; conky::simple_config_setting times_in_seconds("times_in_seconds", false, false); void scan_time(struct text_object *obj, const char *arg) { obj->data.opaque = strndup(arg != nullptr ? arg : "%F %T", text_buffer_size.get(*state)); } void scan_tztime(struct text_object *obj, const char *arg) { char buf1[256], buf2[256], *fmt, *tz; struct tztime_s *ts; fmt = tz = nullptr; if (arg != nullptr) { int nArgs = sscanf(arg, "%255s %255[^\n]", buf1, buf2); if (nArgs == 2) { fmt = buf2; tz = buf1; } else if (nArgs == 1) { tz = buf1; } } ts = static_cast(malloc(sizeof(struct tztime_s))); memset(ts, 0, sizeof(struct tztime_s)); ts->fmt = strndup(fmt != nullptr ? fmt : "%F %T", text_buffer_size.get(*state)); ts->tz = tz != nullptr ? strndup(tz, text_buffer_size.get(*state)) : nullptr; obj->data.opaque = ts; } void print_time(struct text_object *obj, char *p, unsigned int p_max_size) { time_t t = time(nullptr); struct tm *tm = localtime(&t); setlocale(LC_TIME, ""); strftime(p, p_max_size, static_cast(obj->data.opaque), tm); } void print_utime(struct text_object *obj, char *p, unsigned int p_max_size) { time_t t = time(nullptr); struct tm *tm = gmtime(&t); setlocale(LC_TIME, ""); strftime(p, p_max_size, static_cast(obj->data.opaque), tm); } void print_tztime(struct text_object *obj, char *p, unsigned int p_max_size) { char *oldTZ = nullptr; time_t t; struct tm *tm; auto *ts = static_cast(obj->data.opaque); if (ts == nullptr) { return; } if (ts->tz != nullptr) { oldTZ = getenv("TZ"); setenv("TZ", ts->tz, 1); tzset(); } t = time(nullptr); tm = localtime(&t); setlocale(LC_TIME, ""); strftime(p, p_max_size, ts->fmt, tm); if (oldTZ != nullptr) { setenv("TZ", oldTZ, 1); tzset(); } else { unsetenv("TZ"); } // Needless to free oldTZ since getenv gives ptr to static data } void free_time(struct text_object *obj) { free_and_zero(obj->data.opaque); } void free_tztime(struct text_object *obj) { auto *ts = static_cast(obj->data.opaque); if (ts == nullptr) { return; } free_and_zero(ts->tz); free_and_zero(ts->fmt); free_and_zero(obj->data.opaque); } /* a safer asprintf() * - no need to check for errors * - exit conky on memory allocation failure * - XXX: no return value at all, otherwise this * could be used globally */ #define safe_asprintf(bufp, ...) \ { \ int __v; \ if ((__v = asprintf(bufp, __VA_ARGS__)) == -1) { \ fprintf(stderr, "%s: memory allocation failed\n", __func__); \ exit(__v); \ } \ } // all chars after the ending " and between the seconds and the starting " are // silently ignored, this is wanted behavior, not a bug, so don't "fix" this. static void do_format_time(struct text_object *obj, char *p, unsigned int p_max_size) { double seconds; char *currentchar, *temp; unsigned int output_length = 0; int minutes, hours, days, weeks; char show_minutes = 0, show_hours = 0, show_days = 0, show_weeks = 0, hidestring; if (!times_in_seconds.get(*state)) { NORM_ERR("Enable \"times_in_seconds\" to use $format_time"); return; } errno = 0; seconds = strtod(obj->data.s, ¤tchar); if (errno == 0 && obj->data.s != currentchar) { while (*currentchar != 0 && *currentchar != '"') { currentchar++; } if (*currentchar != 0) { currentchar++; minutes = seconds / 60; seconds -= minutes * 60; hours = minutes / 60; minutes %= 60; days = hours / 24; hours %= 24; weeks = days / 7; days %= 7; for (temp = currentchar; *temp != 0 && *temp != '"'; temp++) { if (*temp == '\\') { switch (*(temp + 1)) { case '\\': temp++; break; case 'w': show_weeks = 1; break; case 'd': show_days = 1; break; case 'h': show_hours = 1; break; case 'm': show_minutes = 1; break; } } } if (show_weeks == 0) { days += weeks * 7; } if (show_days == 0) { hours += days * 24; } if (show_hours == 0) { minutes += hours * 60; } if (show_minutes == 0) { seconds += minutes * 60; } hidestring = 0; while (output_length < p_max_size - 1) { if (*currentchar != 0 && *currentchar != '"') { temp = nullptr; if (*currentchar == '\\' && hidestring == 0) { currentchar++; switch (*currentchar) { case 'w': safe_asprintf(&temp, "%d", weeks); break; case 'd': safe_asprintf(&temp, "%d", days); break; case 'h': safe_asprintf(&temp, "%d", hours); break; case 'm': safe_asprintf(&temp, "%d", minutes); break; case 's': safe_asprintf(&temp, "%d", (int)seconds); break; case 'S': currentchar++; if (*currentchar >= '0' && *currentchar <= '9') { safe_asprintf(&temp, "%.*f", (*currentchar) - '0', seconds); } else if (*currentchar == 'x') { if (seconds == static_cast(seconds)) { safe_asprintf(&temp, "%d", (int)seconds); } else { safe_asprintf(&temp, "%.9f", seconds); while (*(temp + strlen(temp) - 1) == '0' || *(temp + strlen(temp) - 1) == '.') { *(temp + strlen(temp) - 1) = 0; } } } else { currentchar--; NORM_ERR( "$format_time needs a digit behind 'S' to specify " "precision"); } break; case '\\': case '(': case ')': p[output_length] = *currentchar; output_length++; break; default: NORM_ERR("$format_time doesn't have a special char '%c'", *currentchar); } } else if (*currentchar == '(') { for (temp = currentchar + 1; *temp != 0 && *temp != ')'; temp++) { if (*(temp - 1) == '\\') { switch (*temp) { case 'w': if (weeks == 0) { hidestring = 1; } break; case 'd': if (days == 0) { hidestring = 1; } break; case 'h': if (hours == 0) { hidestring = 1; } break; case 'm': if (minutes == 0) { hidestring = 1; } break; case 's': case 'S': if (seconds == 0) { hidestring = 1; } break; } } } temp = nullptr; } else if (*currentchar == ')') { hidestring = 0; } else if (hidestring == 0) { p[output_length] = *currentchar; output_length++; } if (temp != nullptr) { if (output_length + strlen(temp) < p_max_size - 1) { strncpy(p + output_length, temp, p_max_size - output_length + strlen(temp)); output_length += strlen(temp); } else { NORM_ERR("The format string for $format_time is too long"); } free(temp); } currentchar++; } else { break; } } p[output_length] = 0; } else { NORM_ERR( "$format_time needs a output-format starting with a \"-char as 2nd " "argument"); } } else { NORM_ERR("$format_time didn't receive a time in seconds as first argument"); } } void print_format_time(struct text_object *obj, char *p, unsigned int p_max_size) { std::unique_ptr buf(new char[max_user_text.get(*state)]); generate_text_internal(buf.get(), max_user_text.get(*state), *obj->sub); obj->data.s = buf.get(); do_format_time(obj, p, p_max_size); } conky-1.12.2/src/timeinfo.h000066400000000000000000000035271404127277500155120ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _TIMEINFO_H #define _TIMEINFO_H #include "setting.hh" extern conky::simple_config_setting times_in_seconds; /* since time and utime are quite equal, certain functions * are shared in between both text object types. */ /* parse args passed to *time objects */ void scan_time(struct text_object *, const char *); void scan_tztime(struct text_object *, const char *); /* print the time */ void print_time(struct text_object *, char *, unsigned int); void print_utime(struct text_object *, char *, unsigned int); void print_tztime(struct text_object *, char *, unsigned int); void print_format_time(struct text_object *obj, char *p, unsigned int p_max_size); /* free object data */ void free_time(struct text_object *); void free_tztime(struct text_object *); #endif /* _TIMEINFO_H */ conky-1.12.2/src/top.cc000066400000000000000000000460231404127277500146360ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2005 Adi Zaimi, Dan Piponi , * Dave Clark * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "top.h" #include "logging.h" #include "prioqueue.h" /* hash table size - always a power of 2 */ #define HTABSIZE 256 struct process *first_process = nullptr; unsigned long g_time = 0; /* a simple hash table to speed up find_process() */ struct proc_hash_entry { struct proc_hash_entry *next; struct process *proc; }; static struct proc_hash_entry proc_hash_table[HTABSIZE]; static void hash_process(struct process *p) { struct proc_hash_entry *phe; static char first_run = 1; int bucket; /* better make sure all next pointers are zero upon first access */ if (first_run != 0) { memset(proc_hash_table, 0, sizeof(struct proc_hash_entry) * HTABSIZE); first_run = 0; } /* get the bucket index */ bucket = p->pid & (HTABSIZE - 1); /* insert a new element on bucket's top */ phe = static_cast( malloc(sizeof(struct proc_hash_entry))); phe->proc = p; phe->next = proc_hash_table[bucket].next; proc_hash_table[bucket].next = phe; } static void unhash_process(struct process *p) { struct proc_hash_entry *phe, *tmp; /* get the bucket head */ phe = &proc_hash_table[p->pid & (HTABSIZE - 1)]; /* find the entry pointing to p and drop it */ while (phe->next != nullptr) { if (phe->next->proc == p) { tmp = phe->next; phe->next = phe->next->next; free(tmp); return; } phe = phe->next; } } static void __unhash_all_processes(struct proc_hash_entry *phe) { if (phe->next != nullptr) { __unhash_all_processes(phe->next); } free(phe->next); } static void unhash_all_processes() { int i; for (i = 0; i < HTABSIZE; i++) { __unhash_all_processes(&proc_hash_table[i]); proc_hash_table[i].next = nullptr; } } struct process *get_first_process() { return first_process; } void free_all_processes() { struct process *next = nullptr, *pr = first_process; while (pr != nullptr) { next = pr->next; free_and_zero(pr->name); free_and_zero(pr->basename); free(pr); pr = next; } first_process = nullptr; /* drop the whole hash table */ unhash_all_processes(); } struct process *get_process_by_name(const char *name) { struct process *p = first_process; while (p != nullptr) { /* Try matching against the full command line first. If that fails, * fall back to the basename. */ if (((p->name != nullptr) && (strcmp(p->name, name) == 0)) || ((p->basename != nullptr) && (strcmp(p->basename, name) == 0))) { return p; } p = p->next; } return nullptr; } static struct process *find_process(pid_t pid) { struct proc_hash_entry *phe; phe = &proc_hash_table[pid & (HTABSIZE - 1)]; while (phe->next != nullptr) { if (phe->next->proc->pid == pid) { return phe->next->proc; } phe = phe->next; } return nullptr; } static struct process *new_process(pid_t pid) { auto *p = static_cast(malloc(sizeof(struct process))); /* Do stitching necessary for doubly linked list */ p->previous = nullptr; p->next = first_process; if (p->next != nullptr) { p->next->previous = p; } first_process = p; p->pid = pid; p->name = nullptr; p->basename = nullptr; p->amount = 0; p->user_time = 0; p->total = 0; p->kernel_time = 0; p->previous_user_time = ULONG_MAX; p->previous_kernel_time = ULONG_MAX; p->total_cpu_time = 0; p->vsize = 0; p->rss = 0; #ifdef BUILD_IOSTATS p->read_bytes = 0; p->previous_read_bytes = ULLONG_MAX; p->write_bytes = 0; p->previous_write_bytes = ULLONG_MAX; p->io_perc = 0; #endif /* BUILD_IOSTATS */ p->time_stamp = 0; p->counted = 1; p->changed = 0; /* process_find_name(p); */ /* add the process to the hash table */ hash_process(p); return p; } /* Get / create a new process object and insert it into the process list */ struct process *get_process(pid_t pid) { struct process *p = find_process(pid); return p != nullptr ? p : new_process(pid); } /****************************************** * Functions * ******************************************/ /****************************************** * Destroy and remove a process * ******************************************/ static void delete_process(struct process *p) { #if defined(PARANOID) assert(p->id == 0x0badfeed); /* * Ensure that deleted processes aren't reused. */ p->id = 0x007babe; #endif /* defined(PARANOID) */ /* * Maintain doubly linked list. */ if (p->next != nullptr) { p->next->previous = p->previous; } if (p->previous != nullptr) { p->previous->next = p->next; } else { first_process = p->next; } free_and_zero(p->name); free_and_zero(p->basename); /* remove the process from the hash table */ unhash_process(p); free(p); } /****************************************** * Strip dead process entries * ******************************************/ static void process_cleanup() { struct process *p = first_process; while (p != nullptr) { struct process *current = p; #if defined(PARANOID) assert(p->id == 0x0badfeed); #endif /* defined(PARANOID) */ p = p->next; /* Delete processes that have died */ if (current->time_stamp != g_time) { delete_process(current); if (current == first_process) { first_process = nullptr; } current = nullptr; } } } /****************************************** * Find the top processes * ******************************************/ /* cpu comparison function for prio queue */ static int compare_cpu(void *va, void *vb) { auto *a = static_cast(va), *b = static_cast(vb); if (b->amount > a->amount) { return 1; } if (a->amount > b->amount) { return -1; } return 0; } /* mem comparison function for prio queue */ static int compare_mem(void *va, void *vb) { auto *a = static_cast(va), *b = static_cast(vb); if (b->rss > a->rss) { return 1; } if (a->rss > b->rss) { return -1; } return 0; } /* CPU time comparison function for prio queue */ static int compare_time(void *va, void *vb) { auto *a = static_cast(va), *b = static_cast(vb); if (b->total_cpu_time > a->total_cpu_time) { return 1; } if (b->total_cpu_time < a->total_cpu_time) { return -1; } return 0; } #ifdef BUILD_IOSTATS /* I/O comparison function for prio queue */ static int compare_io(void *va, void *vb) { auto *a = static_cast(va), *b = static_cast(vb); if (b->io_perc > a->io_perc) { return 1; } if (a->io_perc > b->io_perc) { return -1; } return 0; } #endif /* BUILD_IOSTATS */ /* ****************************************************************** * * Get a sorted list of the top cpu hogs and top mem hogs. * Results are stored * in the cpu,mem arrays in decreasing order[0-9]. * * ****************************************************************** */ static void process_find_top(struct process **cpu, struct process **mem, struct process **ptime #ifdef BUILD_IOSTATS , struct process **io #endif /* BUILD_IOSTATS */ ) { prio_queue_t cpu_queue, mem_queue, time_queue; #ifdef BUILD_IOSTATS prio_queue_t io_queue; #endif struct process *cur_proc = nullptr; int i; if ((top_cpu == 0) && (top_mem == 0) && (top_time == 0) #ifdef BUILD_IOSTATS && (top_io == 0) #endif /* BUILD_IOSTATS */ && (top_running == 0)) { return; } cpu_queue = init_prio_queue(); pq_set_compare(cpu_queue, &compare_cpu); pq_set_max_size(cpu_queue, MAX_SP); mem_queue = init_prio_queue(); pq_set_compare(mem_queue, &compare_mem); pq_set_max_size(mem_queue, MAX_SP); time_queue = init_prio_queue(); pq_set_compare(time_queue, &compare_time); pq_set_max_size(time_queue, MAX_SP); #ifdef BUILD_IOSTATS io_queue = init_prio_queue(); pq_set_compare(io_queue, &compare_io); pq_set_max_size(io_queue, MAX_SP); #endif /* g_time is the time_stamp entry for process. It is updated when the * process information is updated to indicate that the process is still * alive (and must not be removed from the process list in * process_cleanup()) */ ++g_time; /* OS-specific function updating process list */ get_top_info(); process_cleanup(); /* cleanup list from exited processes */ cur_proc = first_process; while (cur_proc != nullptr) { if (top_cpu != 0) { insert_prio_elem(cpu_queue, cur_proc); } if (top_mem != 0) { insert_prio_elem(mem_queue, cur_proc); } if (top_time != 0) { insert_prio_elem(time_queue, cur_proc); } #ifdef BUILD_IOSTATS if (top_io != 0) { insert_prio_elem(io_queue, cur_proc); } #endif /* BUILD_IOSTATS */ cur_proc = cur_proc->next; } for (i = 0; i < MAX_SP; i++) { if (top_cpu != 0) { cpu[i] = static_cast(pop_prio_elem(cpu_queue)); } if (top_mem != 0) { mem[i] = static_cast(pop_prio_elem(mem_queue)); } if (top_time != 0) { ptime[i] = static_cast(pop_prio_elem(time_queue)); } #ifdef BUILD_IOSTATS if (top_io != 0) { io[i] = static_cast(pop_prio_elem(io_queue)); } #endif /* BUILD_IOSTATS */ } free_prio_queue(cpu_queue); free_prio_queue(mem_queue); free_prio_queue(time_queue); #ifdef BUILD_IOSTATS free_prio_queue(io_queue); #endif /* BUILD_IOSTATS */ } int update_top() { process_find_top(info.cpu, info.memu, info.time #ifdef BUILD_IOSTATS , info.io #endif ); info.first_process = get_first_process(); return 0; } static char *format_time(unsigned long timeval, const int width) { char buf[10]; unsigned long nt; // narrow time, for speed on 32-bit unsigned cc; // centiseconds unsigned nn; // multi-purpose whatever nt = timeval; cc = nt % 100; // centiseconds past second nt /= 100; // total seconds nn = nt % 60; // seconds past the minute nt /= 60; // total minutes if (width >= snprintf(buf, sizeof buf, "%lu:%02u.%02u", nt, nn, cc)) { return strndup(buf, text_buffer_size.get(*state)); } if (width >= snprintf(buf, sizeof buf, "%lu:%02u", nt, nn)) { return strndup(buf, text_buffer_size.get(*state)); } nn = nt % 60; // minutes past the hour nt /= 60; // total hours if (width >= snprintf(buf, sizeof buf, "%lu,%02u", nt, nn)) { return strndup(buf, text_buffer_size.get(*state)); } nn = nt; // now also hours if (width >= snprintf(buf, sizeof buf, "%uh", nn)) { return strndup(buf, text_buffer_size.get(*state)); } nn /= 24; // now days if (width >= snprintf(buf, sizeof buf, "%ud", nn)) { return strndup(buf, text_buffer_size.get(*state)); } nn /= 7; // now weeks if (width >= snprintf(buf, sizeof buf, "%uw", nn)) { return strndup(buf, text_buffer_size.get(*state)); } // well shoot, this outta' fit... return strndup("", text_buffer_size.get(*state)); } struct top_data { struct process **list; int num; int was_parsed; char *s; }; static conky::range_config_setting top_name_width( "top_name_width", 0, std::numeric_limits::max(), 15, true); static conky::simple_config_setting top_name_verbose("top_name_verbose", false, true); static void print_top_name(struct text_object *obj, char *p, unsigned int p_max_size) { auto *td = static_cast(obj->data.opaque); int width; if ((td == nullptr) || (td->list == nullptr) || (td->list[td->num] == nullptr)) { return; } width = std::min(p_max_size, static_cast(top_name_width.get(*state)) + 1); if (top_name_verbose.get(*state)) { /* print the full command line */ snprintf(p, width + 1, "%-*s", width, td->list[td->num]->name); } else { /* print only the basename (i.e. executable name) */ snprintf(p, width + 1, "%-*s", width, td->list[td->num]->basename); } } static void print_top_mem(struct text_object *obj, char *p, unsigned int p_max_size) { auto *td = static_cast(obj->data.opaque); int width; if ((td == nullptr) || (td->list == nullptr) || (td->list[td->num] == nullptr)) { return; } width = std::min(p_max_size, static_cast(7)); snprintf(p, width, "%6.2f", (static_cast(td->list[td->num]->rss) / info.memmax) / 10); } static void print_top_time(struct text_object *obj, char *p, unsigned int p_max_size) { auto *td = static_cast(obj->data.opaque); int width; char *timeval; if ((td == nullptr) || (td->list == nullptr) || (td->list[td->num] == nullptr)) { return; } width = std::min(p_max_size, static_cast(10)); timeval = format_time(td->list[td->num]->total_cpu_time, 9); snprintf(p, width, "%9s", timeval); free(timeval); } static void print_top_user(struct text_object *obj, char *p, unsigned int p_max_size) { auto *td = static_cast(obj->data.opaque); struct passwd *pw; if ((td == nullptr) || (td->list == nullptr) || (td->list[td->num] == nullptr)) { return; } pw = getpwuid(td->list[td->num]->uid); if (pw != nullptr) { snprintf(p, p_max_size, "%.8s", pw->pw_name); } else { snprintf(p, p_max_size, "%d", td->list[td->num]->uid); } } #define PRINT_TOP_GENERATOR(name, width, fmt, field) \ static void print_top_##name(struct text_object *obj, char *p, \ unsigned int p_max_size) { \ struct top_data *td = (struct top_data *)obj->data.opaque; \ if (!td || !td->list || !td->list[td->num]) return; \ snprintf(p, std::min(p_max_size, width), fmt, td->list[td->num]->field); \ } #define PRINT_TOP_HR_GENERATOR(name, field, denom) \ static void print_top_##name(struct text_object *obj, char *p, \ unsigned int p_max_size) { \ struct top_data *td = (struct top_data *)obj->data.opaque; \ if (!td || !td->list || !td->list[td->num]) return; \ human_readable(td->list[td->num]->field / (denom), p, p_max_size); \ } PRINT_TOP_GENERATOR(cpu, (unsigned int)7, "%6.2f", amount) PRINT_TOP_GENERATOR(pid, (unsigned int)8, "%7i", pid) PRINT_TOP_GENERATOR(uid, (unsigned int)6, "%5i", uid) PRINT_TOP_HR_GENERATOR(mem_res, rss, 1) PRINT_TOP_HR_GENERATOR(mem_vsize, vsize, 1) #ifdef BUILD_IOSTATS PRINT_TOP_HR_GENERATOR(read_bytes, read_bytes, active_update_interval()) PRINT_TOP_HR_GENERATOR(write_bytes, write_bytes, active_update_interval()) PRINT_TOP_GENERATOR(io_perc, (unsigned int)7, "%6.2f", io_perc) #endif /* BUILD_IOSTATS */ static void free_top(struct text_object *obj) { auto *td = static_cast(obj->data.opaque); if (td == nullptr) { return; } free_and_zero(td->s); free_and_zero(obj->data.opaque); } int parse_top_args(const char *s, const char *arg, struct text_object *obj) { struct top_data *td; char buf[64]; int n; if (arg == nullptr) { NORM_ERR("top needs arguments"); return 0; } obj->data.opaque = td = static_cast(malloc(sizeof(struct top_data))); memset(td, 0, sizeof(struct top_data)); if (s[3] == 0) { td->list = info.cpu; top_cpu = 1; } else if (strcmp(&s[3], "_mem") == EQUAL) { td->list = info.memu; top_mem = 1; } else if (strcmp(&s[3], "_time") == EQUAL) { td->list = info.time; top_time = 1; #ifdef BUILD_IOSTATS } else if (strcmp(&s[3], "_io") == EQUAL) { td->list = info.io; top_io = 1; #endif /* BUILD_IOSTATS */ } else { #ifdef BUILD_IOSTATS NORM_ERR("Must be top, top_mem, top_time or top_io"); #else /* BUILD_IOSTATS */ NORM_ERR("Must be top, top_mem or top_time"); #endif /* BUILD_IOSTATS */ free_and_zero(obj->data.opaque); return 0; } td->s = strndup(arg, text_buffer_size.get(*state)); if (sscanf(arg, "%63s %i", buf, &n) == 2) { if (strcmp(buf, "name") == EQUAL) { obj->callbacks.print = &print_top_name; } else if (strcmp(buf, "cpu") == EQUAL) { obj->callbacks.print = &print_top_cpu; } else if (strcmp(buf, "pid") == EQUAL) { obj->callbacks.print = &print_top_pid; } else if (strcmp(buf, "mem") == EQUAL) { obj->callbacks.print = &print_top_mem; } else if (strcmp(buf, "time") == EQUAL) { obj->callbacks.print = &print_top_time; } else if (strcmp(buf, "mem_res") == EQUAL) { obj->callbacks.print = &print_top_mem_res; } else if (strcmp(buf, "mem_vsize") == EQUAL) { obj->callbacks.print = &print_top_mem_vsize; } else if (strcmp(buf, "uid") == EQUAL) { obj->callbacks.print = &print_top_uid; } else if (strcmp(buf, "user") == EQUAL) { obj->callbacks.print = &print_top_user; #ifdef BUILD_IOSTATS } else if (strcmp(buf, "io_read") == EQUAL) { obj->callbacks.print = &print_top_read_bytes; } else if (strcmp(buf, "io_write") == EQUAL) { obj->callbacks.print = &print_top_write_bytes; } else if (strcmp(buf, "io_perc") == EQUAL) { obj->callbacks.print = &print_top_io_perc; #endif /* BUILD_IOSTATS */ } else { NORM_ERR("invalid type arg for top"); #ifdef BUILD_IOSTATS NORM_ERR( "must be one of: name, cpu, pid, mem, time, mem_res, mem_vsize, " "io_read, io_write, io_perc"); #else /* BUILD_IOSTATS */ NORM_ERR("must be one of: name, cpu, pid, mem, time, mem_res, mem_vsize"); #endif /* BUILD_IOSTATS */ free_and_zero(td->s); free_and_zero(obj->data.opaque); return 0; } if (n < 1 || n > MAX_SP) { NORM_ERR("invalid num arg for top. Must be between 1 and %d.", MAX_SP); free_and_zero(td->s); free_and_zero(obj->data.opaque); return 0; } td->num = n - 1; } else { NORM_ERR("invalid argument count for top"); free_and_zero(td->s); free_and_zero(obj->data.opaque); return 0; } obj->callbacks.free = &free_top; return 1; } conky-1.12.2/src/top.h000066400000000000000000000067671404127277500145130ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2005 Adi Zaimi, Dan Piponi , * Dave Clark * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _top_h_ #define _top_h_ /* Ensure there's an operating system defined. * compile with gcc -DOS ... * There is *no* default because every OS has it's own way of revealing * CPU/memory usage. */ /****************************************** * Includes * ******************************************/ #include "conky.h" #include "text_object.h" #define CPU_THRESHHOLD 0 /* threshold for the cpu diff to appear */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /****************************************** * Defines * ******************************************/ /* XXX: I shouldn't really use this BUFFER_LEN variable but scanf is so lame * and it'll take me a while to write a replacement. */ #define BUFFER_LEN 1024 #define MAX_SP 10 // number of elements to sort /****************************************** * Process class * ******************************************/ struct process { struct process *next; struct process *previous; pid_t pid; char *name; char *basename; uid_t uid; float amount; // User and kernel times are in hundredths of seconds unsigned long user_time; unsigned long total; unsigned long kernel_time; unsigned long previous_user_time; unsigned long previous_kernel_time; unsigned long total_cpu_time; unsigned long previous_total_cpu_time; unsigned long long vsize; unsigned long long rss; #ifdef BUILD_IOSTATS unsigned long long read_bytes; unsigned long long previous_read_bytes; unsigned long long write_bytes; unsigned long long previous_write_bytes; float io_perc; #endif unsigned int time_stamp; unsigned int counted; unsigned int changed; }; struct sorted_process { struct sorted_process *greater; struct sorted_process *less; struct process *proc; }; /* lookup a program by it's name */ struct process *get_process_by_name(const char *); int parse_top_args(const char *s, const char *arg, struct text_object *obj); int update_top(void); void get_top_info(void); extern struct process *first_process; extern unsigned long g_time; struct process *get_process(pid_t pid); #endif /* _top_h_ */ conky-1.12.2/src/update-cb.cc000066400000000000000000000100031404127277500156650ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (C) 2010 Pavel Labath et al. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "config.h" #include "logging.h" #include "update-cb.hh" #include #include namespace conky { namespace { semaphore sem_wait; enum { UNUSED_MAX = 5 }; } // namespace namespace priv { callback_base::~callback_base() { stop(); } void callback_base::stop() { if (thread != nullptr) { done = true; sem_start.post(); if (pipefd.second >= 0) { if (write(pipefd.second, "X", 1) != 1) { NORM_ERR("can't write 'X' to pipefd %d: %s", pipefd.second, strerror(errno)); } } thread->join(); delete thread; thread = nullptr; } if (pipefd.first >= 0) { close(pipefd.first); pipefd.first = -1; } if (pipefd.second >= 0) { close(pipefd.second); pipefd.second = -1; } } inline size_t callback_base::get_hash(const handle &h) { return h->hash; } inline bool callback_base::is_equal(const handle &a, const handle &b) { if (a->hash != b->hash) { return false; } #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpotentially-evaluated-expression" if (typeid(*a) != typeid(*b)) { return false; } #pragma clang diagnostic pop return *a == *b; } /* * If a callback is not successfully inserted into the set, it must have * the same hash as an existing callback. If this is so, merge the incoming * callback with the one that prevented insertion. Keep the smaller of the * two periods. */ void callback_base::merge(callback_base &&other) { if (other.period < period) { period = other.period; remaining = 0; } assert(wait == other.wait); unused = 0; } /* * Register a callback (i.e. insert it into the callbacks set) */ callback_base::handle callback_base::do_register_cb(const handle &h) { const auto &p = callbacks.insert(h); /* insertion failed; callback already exists */ if (!p.second) { (*p.first)->merge(std::move(*h)); } return *p.first; } void callback_base::run() { if (thread == nullptr) { thread = new std::thread(&callback_base::start_routine, this); } sem_start.post(); } void callback_base::start_routine() { for (;;) { sem_start.wait(); if (done) { return; } // clear any remaining posts in case the previous iteration was very slow // (this should only happen if wait == false) while (sem_start.trywait()) { // do nothing } work(); if (wait) { sem_wait.post(); } } } callback_base::Callbacks callback_base::callbacks(1, get_hash, is_equal); } // namespace priv void run_all_callbacks() { using priv::callback_base; size_t wait = 0; for (auto i = callback_base::callbacks.begin(); i != callback_base::callbacks.end();) { callback_base &cb = **i; /* check whether enough update intervals have elapsed (up to period) */ if (cb.remaining-- == 0) { /* run the callback as long as someone holds a pointer to it; * if no one owns the callback, run it at most UNUSED_MAX times */ if (!i->unique() || ++cb.unused < UNUSED_MAX) { cb.remaining = cb.period - 1; cb.run(); if (cb.wait) { ++wait; } } } if (cb.unused == UNUSED_MAX) { auto t = i; ++i; callback_base::callbacks.erase(t); } else { ++i; } } while (wait-- > 0) { sem_wait.wait(); } } } // namespace conky conky-1.12.2/src/update-cb.hh000066400000000000000000000176201404127277500157130ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (C) 2010 Pavel Labath et al. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef UPDATE_CB_HH #define UPDATE_CB_HH #include #include #include // the following probably requires a is-gcc-4.7.0 check #include #include #include #include #include "c++wrap.hh" #include "semaphore.hh" namespace conky { // forward declarations template class callback_handle; void run_all_callbacks(); template callback_handle register_cb(uint32_t period, Params &&...params); namespace priv { class callback_base { typedef callback_handle handle; typedef std::unordered_set Callbacks; semaphore sem_start; std::thread *thread; const size_t hash; /* used to determined callback uniqueness */ uint32_t period; /* how often to run a callback */ uint32_t remaining; /* update intervals remaining until we can run a callback */ std::pair pipefd; const bool wait; /* whether or not to wait for a callback to finish */ bool done; /* if true, callback is being stopped and destroyed */ uint8_t unused; /* number of update intervals during which no one owns a callback */ callback_base(const callback_base &) = delete; callback_base &operator=(const callback_base &) = delete; virtual bool operator==(const callback_base &) = 0; void run(); void start_routine(); void stop(); static void deleter(callback_base *ptr) { ptr->stop(); delete ptr; } // a list of registered callbacks static Callbacks callbacks; // used by the callbacks list static inline size_t get_hash(const handle &h); static inline bool is_equal(const handle &a, const handle &b); static handle do_register_cb(const handle &h); template friend callback_handle conky::register_cb(uint32_t period, Params &&...params); friend void conky::run_all_callbacks(); template friend class conky::callback_handle; protected: callback_base(size_t hash_, uint32_t period_, bool wait_, bool use_pipe) : thread(nullptr), hash(hash_), period(period_), remaining(0), pipefd(use_pipe ? pipe2(O_CLOEXEC) : std::pair(-1, -1)), wait(wait_), done(false), unused(0) {} int donefd() { return pipefd.first; } bool is_done() { return done; } // to be implemented by descendant classes virtual void work() = 0; // called when two registered objects evaluate as equal, the latter is removed // afterwards virtual void merge(callback_base &&); public: std::mutex result_mutex; virtual ~callback_base(); }; } // namespace priv template class callback_handle : private std::shared_ptr { typedef std::shared_ptr Base; callback_handle(Callback *ptr) : Base(ptr, &priv::callback_base::deleter) {} callback_handle(Base &&ptr) : Base(std::move(ptr)) {} public: using Base::operator->; using Base::operator*; friend void conky::run_all_callbacks(); template friend callback_handle register_cb(uint32_t period, Params &&...params); }; template callback_handle register_cb(uint32_t period, Params &&...params) { return std::dynamic_pointer_cast( priv::callback_base::do_register_cb(priv::callback_base::handle( new Callback(period, std::forward(params)...)))); } /* * Callback uniqueness is determined by the hash computed here. */ namespace priv { template struct hash_tuple { typedef std::tuple Tuple; typedef typename std::tuple_element::type Element; static inline size_t hash(const Tuple &tuple) { return std::hash()(std::get(tuple)) + 47 * hash_tuple::hash(tuple); } }; template struct hash_tuple<0, Elements...> { static inline size_t hash(const std::tuple &) { return 0; } }; } // namespace priv /* * To create a callback, inherit from this class. The Result template parameter * should be the type of your output, so that your users can retrieve it with * the get_result* functions. * * get_result() returns a reference to the internal variable. It can be used * without locking if the object has wait set to true (wait=true means that the * run_all_callbacks() waits for the callback to finish work()ing before * returning). If object has wait=false then the user must first lock the * result_mutex. * * get_result_copy() returns a copy of the result object and it handles the * necessary locking. Don't call it if you hold a lock on the result_mutex. * * You should implement the work() function to do the actual updating and store * the result in the result variable (lock the mutex while you are doing it, * especially if you have wait=false). * * The Keys... template parameters are parameters for your work function. E.g., * a curl callback can have one parameter - the url to retrieve,. hddtemp may * have two - host and port number of the hddtemp server, etc. The register_cb() * function make sure that there exists only one object (of the same type) with * the same values for all the keys. * * Callbacks are registered with the register_cb() function. You pass the class * name as the template parameter, and any additional parameters to the * constructor as function parameters. The period parameter specifies how often * the callback will run. It should be left for the user to decide that. * register_cb() returns a pointer to the newly created object. As long as * someone holds a pointer to the object, the callback will be run. * * run_all_callbacks() runs the registered callbacks (with the specified * periodicity). It should be called from somewhere inside the main loop, * according to the update_interval setting. It waits for the callbacks which * have wait=true. It leaves the rest to run in background. */ template class callback : public priv::callback_base { virtual bool operator==(const callback_base &other) { return tuple == dynamic_cast(other).tuple; } public: typedef std::tuple Tuple; protected: const Tuple tuple; Result result; template typename std::add_lvalue_reference< const typename std::tuple_element::type>::type get() { return std::get(tuple); } public: callback(uint32_t period_, bool wait_, const Tuple &tuple_, bool use_pipe = false) : callback_base(priv::hash_tuple::hash(tuple_), period_, wait_, use_pipe), tuple(tuple_) {} const Result &get_result() { return result; } Result get_result_copy() { std::lock_guard l(result_mutex); return result; } }; } // namespace conky #endif /* UPDATE_CB_HH */ conky-1.12.2/src/user.cc000066400000000000000000000046641404127277500150170ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include #include #include "conky.h" #include "logging.h" void print_uid_name(struct text_object *obj, char *p, unsigned int p_max_size) { struct passwd *pw; uid_t uid; char *firstinvalid; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); errno = 0; uid = strtol(objbuf.get(), &firstinvalid, 10); if (errno == 0 && objbuf.get() != firstinvalid) { pw = getpwuid(uid); if (pw != nullptr) { snprintf(p, p_max_size, "%s", pw->pw_name); } else { NORM_ERR("The uid %d doesn't exist", uid); } } else { NORM_ERR("$uid_name didn't receive a uid as argument"); } } void print_gid_name(struct text_object *obj, char *p, unsigned int p_max_size) { struct group *grp; gid_t gid; char *firstinvalid; std::unique_ptr objbuf(new char[max_user_text.get(*state)]); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); errno = 0; gid = strtol(objbuf.get(), &firstinvalid, 10); if (errno == 0 && objbuf.get() != firstinvalid) { grp = getgrgid(gid); if (grp != nullptr) { snprintf(p, p_max_size, "%s", grp->gr_name); } else { NORM_ERR("The gid %d doesn't exist", gid); } } else { NORM_ERR("$gid_name didn't receive a gid as argument"); } } conky-1.12.2/src/user.h000066400000000000000000000023671404127277500146570ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _USER_H #define _USER_H void print_gid_name(struct text_object *obj, char *p, unsigned int p_max_size); void print_uid_name(struct text_object *obj, char *p, unsigned int p_max_size); #endif /* _USER_H */ conky-1.12.2/src/users.cc000066400000000000000000000154601404127277500151760ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include "conky.h" #define BUFLEN 512 static void user_name(char *ptr) { const struct utmp *usr = 0; setutent(); while ((usr = getutent()) != nullptr) { if (usr->ut_type == USER_PROCESS) { if (strlen(ptr) + strnlen(usr->ut_name, UT_NAMESIZE - 1) + 1 <= BUFLEN) { strncat(ptr, usr->ut_name, UT_NAMESIZE); } } } } static void user_num(int *ptr) { const struct utmp *usr; int users_num = 0; setutent(); while ((usr = getutent()) != nullptr) { if (usr->ut_type == USER_PROCESS) { ++users_num; } } *ptr = users_num; } static void user_term(char *ptr) { const struct utmp *usr; setutent(); while ((usr = getutent()) != nullptr) { if (usr->ut_type == USER_PROCESS) { if (strlen(ptr) + strnlen(usr->ut_line, UT_LINESIZE) + 1 <= BUFLEN) { strncat(ptr, usr->ut_line, UT_LINESIZE); } } } } static void user_time(char *ptr) { const struct utmp *usr; time_t log_in, real, diff; char buf[BUFLEN] = ""; setutent(); while ((usr = getutent()) != nullptr) { if (usr->ut_type == USER_PROCESS) { log_in = usr->ut_time; time(&real); diff = difftime(real, log_in); format_seconds(buf, BUFLEN, diff); if (strlen(ptr) + strlen(buf) + 1 <= BUFLEN) { strncat(ptr, buf, BUFLEN - strlen(ptr) - 1); } } } } static void tty_user_time(char *ptr, char *tty) { time_t real, diff, log_in; char buf[BUFLEN] = ""; struct utmp *usr, line; setutent(); strncpy(line.ut_line, tty, UT_LINESIZE); usr = getutline(&line); if (usr == nullptr) { return; } log_in = usr->ut_time; time(&real); diff = difftime(real, log_in); format_seconds(buf, BUFLEN, diff); strncpy(ptr, buf, BUFLEN - 1); } static void users_alloc(struct information *ptr) { if (ptr->users.names == nullptr) { ptr->users.names = (char *)malloc(text_buffer_size.get(*state)); } if (ptr->users.terms == nullptr) { ptr->users.terms = (char *)malloc(text_buffer_size.get(*state)); } if (ptr->users.times == nullptr) { ptr->users.times = (char *)malloc(text_buffer_size.get(*state)); } } static void update_user_time(char *tty) { struct information *current_info = &info; char temp[BUFLEN] = ""; if (current_info->users.ctime == nullptr) { current_info->users.ctime = (char *)malloc(text_buffer_size.get(*state)); } tty_user_time(temp, tty); if (*temp != 0) { free_and_zero(current_info->users.ctime); current_info->users.ctime = (char *)malloc(text_buffer_size.get(*state)); strncpy(current_info->users.ctime, temp, text_buffer_size.get(*state)); } else { free_and_zero(current_info->users.ctime); current_info->users.ctime = (char *)malloc(text_buffer_size.get(*state)); strncpy(current_info->users.ctime, "broken", text_buffer_size.get(*state)); } } int update_users(void) { struct information *current_info = &info; char temp[BUFLEN] = ""; int t; users_alloc(current_info); user_name(temp); if (*temp != 0) { free_and_zero(current_info->users.names); current_info->users.names = (char *)malloc(text_buffer_size.get(*state)); strncpy(current_info->users.names, temp, text_buffer_size.get(*state)); } else { free_and_zero(current_info->users.names); current_info->users.names = (char *)malloc(text_buffer_size.get(*state)); strncpy(current_info->users.names, "broken", text_buffer_size.get(*state)); } user_num(&t); if (t != 0) { if (current_info->users.number) { current_info->users.number = 0; } current_info->users.number = t; } else { current_info->users.number = 0; } temp[0] = 0; user_term(temp); if (*temp != 0) { free_and_zero(current_info->users.terms); current_info->users.terms = (char *)malloc(text_buffer_size.get(*state)); strncpy(current_info->users.terms, temp, text_buffer_size.get(*state)); } else { free_and_zero(current_info->users.terms); current_info->users.terms = (char *)malloc(text_buffer_size.get(*state)); strncpy(current_info->users.terms, "broken", text_buffer_size.get(*state)); } user_time(temp); if (*temp != 0) { free_and_zero(current_info->users.times); current_info->users.times = (char *)malloc(text_buffer_size.get(*state)); strncpy(current_info->users.times, temp, text_buffer_size.get(*state)); } else { free_and_zero(current_info->users.times); current_info->users.times = (char *)malloc(text_buffer_size.get(*state)); strncpy(current_info->users.times, "broken", text_buffer_size.get(*state)); } return 0; } void print_user_names(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; snprintf(p, p_max_size, "%s", info.users.names); } void print_user_terms(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; snprintf(p, p_max_size, "%s", info.users.terms); } void print_user_times(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; snprintf(p, p_max_size, "%s", info.users.times); } void print_user_time(struct text_object *obj, char *p, unsigned int p_max_size) { update_user_time(obj->data.s); snprintf(p, p_max_size, "%s", info.users.ctime); } void print_user_number(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; snprintf(p, p_max_size, "%d", info.users.number); } void free_user_names(struct text_object *obj) { (void)obj; free_and_zero(info.users.names); } void free_user_terms(struct text_object *obj) { (void)obj; free_and_zero(info.users.terms); } void free_user_times(struct text_object *obj) { (void)obj; free_and_zero(info.users.times); } void free_user_time(struct text_object *obj) { free_and_zero(info.users.ctime); free_and_zero(obj->data.s); } conky-1.12.2/src/users.h000066400000000000000000000031601404127277500150320ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef _USERS_H #define _USERS_H int update_users(void); void print_user_names(struct text_object *, char *, unsigned int); void print_user_terms(struct text_object *, char *, unsigned int); void print_user_times(struct text_object *, char *, unsigned int); void print_user_time(struct text_object *, char *, unsigned int); void print_user_number(struct text_object *, char *, unsigned int); void free_user_names(struct text_object *); void free_user_terms(struct text_object *); void free_user_times(struct text_object *); void free_user_time(struct text_object *); #endif /* _USERS_H */ conky-1.12.2/src/weather.cc000066400000000000000000000023401404127277500154650ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "weather.h" #include #include #include #include #include #include #include "ccurl_thread.h" #include "config.h" #include "conky.h" #include "logging.h" #include "temphelper.h" #include "text_object.h" void print_weather(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; strncpy(p, "TODO...", p_max_size); } conky-1.12.2/src/weather.h000066400000000000000000000022361404127277500153330ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef WEATHER_H_ #define WEATHER_H_ void print_weather(struct text_object *, char *, unsigned int); #endif /* WEATHER_H_ */ conky-1.12.2/src/x11.cc000066400000000000000000001211251404127277500144420ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "common.h" #include "config.h" #include "conky.h" #include "logging.h" #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wvariadic-macros" #pragma GCC diagnostic ignored "-Wregister" #include #pragma GCC diagnostic pop #include #include #include #include #include "x11.h" #ifdef BUILD_IMLIB2 #include "imlib2.h" #endif /* BUILD_IMLIB2 */ #ifndef OWN_WINDOW #include #endif #ifdef BUILD_XFT #include #endif #ifdef BUILD_XINERAMA #include #endif #ifdef BUILD_XSHAPE #include #endif /* BUILD_XSHAPE */ #ifdef BUILD_ARGB bool have_argb_visual; #endif /* BUILD_ARGB */ /* some basic X11 stuff */ Display *display = nullptr; int display_width; int display_height; int screen; /* workarea from _NET_WORKAREA, this is where window / text is aligned */ int workarea[4]; /* Window stuff */ struct conky_window window; char window_created = 0; /* local prototypes */ static void update_workarea(); static Window find_desktop_window(Window *p_root, Window *p_desktop); static Window find_subwindow(Window win, int w, int h); static void init_X11(); static void deinit_X11(); static void init_window(lua::state &l, bool own); /********************* ************************/ namespace priv { void out_to_x_setting::lua_setter(lua::state &l, bool init) { lua::stack_sentry s(l, -2); Base::lua_setter(l, init); if (init && do_convert(l, -1).first) { init_X11(); } ++s; } void out_to_x_setting::cleanup(lua::state &l) { lua::stack_sentry s(l, -1); if (do_convert(l, -1).first) { deinit_X11(); } l.pop(); } void own_window_setting::lua_setter(lua::state &l, bool init) { lua::stack_sentry s(l, -2); Base::lua_setter(l, init); if (init) { if (do_convert(l, -1).first) { #ifndef OWN_WINDOW std::cerr << "Support for the own_window setting has been " "disabled during compilation\n"; l.pop(); l.pushboolean(false); #endif } if (out_to_x.get(l)) { init_window(l, do_convert(l, -1).first); } else { // own_window makes no sense when not drawing to X l.pop(); l.pushboolean(false); } } ++s; } #ifdef BUILD_XDBE bool use_xdbe_setting::set_up(lua::state &l) { // double_buffer makes no sense when not drawing to X if (!out_to_x.get(l)) { return false; } int major, minor; if (XdbeQueryExtension(display, &major, &minor) == 0) { NORM_ERR("No compatible double buffer extension found"); return false; } window.back_buffer = XdbeAllocateBackBufferName(display, window.window, XdbeBackground); if (window.back_buffer != None) { window.drawable = window.back_buffer; } else { NORM_ERR("Failed to allocate back buffer"); return false; } XFlush(display); return true; } void use_xdbe_setting::lua_setter(lua::state &l, bool init) { lua::stack_sentry s(l, -2); Base::lua_setter(l, init); if (init && do_convert(l, -1).first) { if (!set_up(l)) { l.pop(); l.pushboolean(false); } fprintf(stderr, PACKAGE_NAME ": drawing to %s buffer\n", do_convert(l, -1).first ? "double" : "single"); } ++s; } #else bool use_xpmdb_setting::set_up(lua::state &l) { // double_buffer makes no sense when not drawing to X if (!out_to_x.get(l)) return false; window.back_buffer = XCreatePixmap(display, window.window, window.width + 1, window.height + 1, DefaultDepth(display, screen)); if (window.back_buffer != None) { window.drawable = window.back_buffer; } else { NORM_ERR("Failed to allocate back buffer"); return false; } XFlush(display); return true; } void use_xpmdb_setting::lua_setter(lua::state &l, bool init) { lua::stack_sentry s(l, -2); Base::lua_setter(l, init); if (init && do_convert(l, -1).first) { if (!set_up(l)) { l.pop(); l.pushboolean(false); } fprintf(stderr, PACKAGE_NAME ": drawing to %s buffer\n", do_convert(l, -1).first ? "double" : "single"); } ++s; } #endif void colour_setting::lua_setter(lua::state &l, bool init) { lua::stack_sentry s(l, -2); if (!out_to_x.get(l)) { // ignore if we're not using X l.replace(-2); } else { Base::lua_setter(l, init); } ++s; } } // namespace priv template <> conky::lua_traits::Map conky::lua_traits::map = { {"top_left", TOP_LEFT}, {"top_right", TOP_RIGHT}, {"top_middle", TOP_MIDDLE}, {"bottom_left", BOTTOM_LEFT}, {"bottom_right", BOTTOM_RIGHT}, {"bottom_middle", BOTTOM_MIDDLE}, {"middle_left", MIDDLE_LEFT}, {"middle_middle", MIDDLE_MIDDLE}, {"middle_right", MIDDLE_RIGHT}, {"tl", TOP_LEFT}, {"tr", TOP_RIGHT}, {"tm", TOP_MIDDLE}, {"bl", BOTTOM_LEFT}, {"br", BOTTOM_RIGHT}, {"bm", BOTTOM_MIDDLE}, {"ml", MIDDLE_LEFT}, {"mm", MIDDLE_MIDDLE}, {"mr", MIDDLE_RIGHT}, {"none", NONE}}; #ifdef OWN_WINDOW template <> conky::lua_traits::Map conky::lua_traits::map = { {"normal", TYPE_NORMAL}, {"dock", TYPE_DOCK}, {"panel", TYPE_PANEL}, {"desktop", TYPE_DESKTOP}, {"override", TYPE_OVERRIDE}}; template <> conky::lua_traits::Map conky::lua_traits::map = { {"undecorated", HINT_UNDECORATED}, {"below", HINT_BELOW}, {"above", HINT_ABOVE}, {"sticky", HINT_STICKY}, {"skip_taskbar", HINT_SKIP_TASKBAR}, {"skip_pager", HINT_SKIP_PAGER}}; std::pair window_hints_traits::convert( lua::state &l, int index, const std::string &name) { lua::stack_sentry s(l); l.checkstack(1); std::string hints = l.tostring(index); // add a sentinel to simplify the following loop hints += ','; size_t pos = 0; size_t newpos; uint16_t ret = 0; while ((newpos = hints.find_first_of(", ", pos)) != std::string::npos) { if (newpos > pos) { l.pushstring(hints.substr(pos, newpos - pos)); auto t = conky::lua_traits::convert(l, -1, name); if (!t.second) { return {0, false}; } SET_HINT(ret, t.first); l.pop(); } pos = newpos + 1; } return {ret, true}; } #endif #ifdef OWN_WINDOW namespace { // used to set the default value for own_window_title std::string gethostnamecxx() { update_uname(); return info.uname_s.nodename; } } // namespace #endif /* OWN_WINDOW */ /* * The order of these settings cannot be completely arbitrary. Some of them * depend on others, and the setters are called in the order in which they are * defined. The order should be: display_name -> out_to_x -> everything colour * related * -> border_*, own_window_*, etc -> own_window -> * double_buffer -> imlib_cache_size */ conky::simple_config_setting text_alignment("alignment", BOTTOM_LEFT, false); conky::simple_config_setting display_name("display", std::string(), false); conky::simple_config_setting head_index("xinerama_head", 0, true); priv::out_to_x_setting out_to_x; priv::colour_setting color[10] = {{"color0", 0xffffff}, {"color1", 0xffffff}, {"color2", 0xffffff}, {"color3", 0xffffff}, {"color4", 0xffffff}, {"color5", 0xffffff}, {"color6", 0xffffff}, {"color7", 0xffffff}, {"color8", 0xffffff}, {"color9", 0xffffff}}; priv::colour_setting default_color("default_color", 0xffffff); priv::colour_setting default_shade_color("default_shade_color", 0x000000); priv::colour_setting default_outline_color("default_outline_color", 0x000000); conky::range_config_setting border_inner_margin( "border_inner_margin", 0, std::numeric_limits::max(), 3, true); conky::range_config_setting border_outer_margin( "border_outer_margin", 0, std::numeric_limits::max(), 1, true); conky::range_config_setting border_width("border_width", 0, std::numeric_limits::max(), 1, true); #ifdef BUILD_XFT conky::simple_config_setting use_xft("use_xft", false, false); #endif conky::simple_config_setting forced_redraw("forced_redraw", false, false); #ifdef OWN_WINDOW conky::simple_config_setting set_transparent("own_window_transparent", false, false); conky::simple_config_setting own_window_class("own_window_class", PACKAGE_NAME, false); conky::simple_config_setting own_window_title( "own_window_title", PACKAGE_NAME " (" + gethostnamecxx() + ")", false); conky::simple_config_setting own_window_type("own_window_type", TYPE_NORMAL, false); conky::simple_config_setting own_window_hints( "own_window_hints", 0, false); priv::colour_setting background_colour("own_window_colour", 0); #ifdef BUILD_ARGB conky::simple_config_setting use_argb_visual("own_window_argb_visual", false, false); conky::range_config_setting own_window_argb_value("own_window_argb_value", 0, 255, 255, false); #endif /* BUILD_ARGB */ #endif /* OWN_WINDOW */ priv::own_window_setting own_window; #ifdef BUILD_XDBE priv::use_xdbe_setting use_xdbe; #else priv::use_xpmdb_setting use_xpmdb; #endif #ifdef BUILD_IMLIB2 /* * the only reason this is not in imlib2.cc is so that we can be sure it's * setter executes after use_xdbe */ imlib_cache_size_setting imlib_cache_size; #endif /******************** ************************/ /* WARNING, this type not in Xlib spec */ static int __attribute__((noreturn)) x11_error_handler(Display *d, XErrorEvent *err) { NORM_ERR( "X Error: type %i Display %lx XID %li serial %lu error_code %i " "request_code %i minor_code %i other Display: %lx\n", err->type, (long unsigned)err->display, static_cast(err->resourceid), err->serial, err->error_code, err->request_code, err->minor_code, (long unsigned)d); abort(); } static int __attribute__((noreturn)) x11_ioerror_handler(Display *d) { NORM_ERR("X Error: Display %lx\n", (long unsigned)d); exit(1); } /* X11 initializer */ static void init_X11() { DBGP("enter init_X11()"); if (display == nullptr) { const std::string &dispstr = display_name.get(*state); // passing nullptr to XOpenDisplay should open the default display const char *disp = static_cast(!dispstr.empty()) != 0u ? dispstr.c_str() : nullptr; if ((display = XOpenDisplay(disp)) == nullptr) { throw std::runtime_error(std::string("can't open display: ") + XDisplayName(disp)); } } info.x11.monitor.number = 1; info.x11.monitor.current = 0; info.x11.desktop.current = 1; info.x11.desktop.number = 1; info.x11.desktop.all_names.clear(); info.x11.desktop.name.clear(); screen = DefaultScreen(display); display_width = DisplayWidth(display, screen); display_height = DisplayHeight(display, screen); get_x11_desktop_info(display, 0); update_workarea(); /* WARNING, this type not in Xlib spec */ XSetErrorHandler(&x11_error_handler); XSetIOErrorHandler(&x11_ioerror_handler); DBGP("leave init_X11()"); } static void deinit_X11() { DBGP("deinit_X11()"); XCloseDisplay(display); display = nullptr; } static void update_workarea() { /* default work area is display */ workarea[0] = 0; workarea[1] = 0; workarea[2] = display_width; workarea[3] = display_height; #ifdef BUILD_XINERAMA /* if xinerama is being used, adjust workarea to the head's area */ int useless1, useless2; if (XineramaQueryExtension(display, &useless1, &useless2) == 0) { return; /* doesn't even have xinerama */ } if (XineramaIsActive(display) == 0) { return; /* has xinerama but isn't using it */ } int heads = 0; XineramaScreenInfo *si = XineramaQueryScreens(display, &heads); if (si == nullptr) { NORM_ERR( "warning: XineramaQueryScreen returned nullptr, ignoring head " "settings"); return; /* queryscreens failed? */ } int i = head_index.get(*state); if (i < 0 || i >= heads) { NORM_ERR("warning: invalid head index, ignoring head settings"); return; } XineramaScreenInfo *ps = &si[i]; workarea[0] = ps->x_org; workarea[1] = ps->y_org; workarea[2] = workarea[0] + ps->width; workarea[3] = workarea[1] + ps->height; XFree(si); DBGP("Fixed xinerama area to: %d %d %d %d", workarea[0], workarea[1], workarea[2], workarea[3]); #endif } /* Find root window and desktop window. * Return desktop window on success, * and set root and desktop byref return values. * Return 0 on failure. */ static Window find_desktop_window(Window *p_root, Window *p_desktop) { Atom type; int format, i; unsigned long nitems, bytes; unsigned int n; Window root = RootWindow(display, screen); Window win; Window troot, parent, *children; unsigned char *buf = nullptr; if ((p_root == nullptr) || (p_desktop == nullptr)) { return 0; } /* some window managers set __SWM_VROOT to some child of root window */ XQueryTree(display, root, &troot, &parent, &children, &n); for (i = 0; i < static_cast(n); i++) { if (XGetWindowProperty(display, children[i], ATOM(__SWM_VROOT), 0, 1, False, XA_WINDOW, &type, &format, &nitems, &bytes, &buf) == Success && type == XA_WINDOW) { win = *reinterpret_cast(buf); XFree(buf); XFree(children); fprintf(stderr, PACKAGE_NAME ": desktop window (%lx) found from __SWM_VROOT property\n", win); fflush(stderr); *p_root = win; *p_desktop = win; return win; } if (buf != nullptr) { XFree(buf); buf = nullptr; } } XFree(children); /* get subwindows from root */ win = find_subwindow(root, -1, -1); update_workarea(); win = find_subwindow(win, workarea[2], workarea[3]); if (buf != nullptr) { XFree(buf); buf = nullptr; } if (win != root) { fprintf(stderr, PACKAGE_NAME ": desktop window (%lx) is subwindow of root window (%lx)\n", win, root); } else { fprintf(stderr, PACKAGE_NAME ": desktop window (%lx) is root window\n", win); } fflush(stderr); *p_root = root; *p_desktop = win; return win; } #ifdef OWN_WINDOW namespace { /* helper function for set_transparent_background() */ void do_set_background(Window win, int argb) { unsigned long colour = background_colour.get(*state) | (argb << 24); XSetWindowBackground(display, win, colour); } } // namespace /* if no argb visual is configured sets background to ParentRelative for the Window and all parents, else real transparency is used */ void set_transparent_background(Window win) { #ifdef BUILD_ARGB if (have_argb_visual) { // real transparency do_set_background(win, set_transparent.get(*state) ? 0 : own_window_argb_value.get(*state)); } else { #endif /* BUILD_ARGB */ // pseudo transparency if (set_transparent.get(*state)) { Window parent = win; unsigned int i; for (i = 0; i < 50 && parent != RootWindow(display, screen); i++) { Window r, *children; unsigned int n; XSetWindowBackgroundPixmap(display, parent, ParentRelative); XQueryTree(display, parent, &r, &parent, &children, &n); XFree(children); } } else { do_set_background(win, 0); } #ifdef BUILD_ARGB } #endif /* BUILD_ARGB */ } #endif #ifdef BUILD_ARGB static int get_argb_visual(Visual **visual, int *depth) { /* code from gtk project, gdk_screen_get_rgba_visual */ XVisualInfo visual_template; XVisualInfo *visual_list; int nxvisuals = 0, i; visual_template.screen = screen; visual_list = XGetVisualInfo(display, VisualScreenMask, &visual_template, &nxvisuals); for (i = 0; i < nxvisuals; i++) { if (visual_list[i].depth == 32 && (visual_list[i].red_mask == 0xff0000 && visual_list[i].green_mask == 0x00ff00 && visual_list[i].blue_mask == 0x0000ff)) { *visual = visual_list[i].visual; *depth = visual_list[i].depth; DBGP("Found ARGB Visual"); XFree(visual_list); return 1; } } // no argb visual available DBGP("No ARGB Visual found"); XFree(visual_list); return 0; } #endif /* BUILD_ARGB */ void destroy_window() { #ifdef BUILD_XFT if (window.xftdraw != nullptr) { XftDrawDestroy(window.xftdraw); } #endif /* BUILD_XFT */ if (window.gc != nullptr) { XFreeGC(display, window.gc); } memset(&window, 0, sizeof(struct conky_window)); } static void init_window(lua::state &l __attribute__((unused)), bool own) { DBGP("enter init_window()"); // own is unused if OWN_WINDOW is not defined (void)own; window_created = 1; #ifdef OWN_WINDOW if (own) { int depth = 0, flags = CWOverrideRedirect | CWBackingStore; Visual *visual = nullptr; if (find_desktop_window(&window.root, &window.desktop) == 0U) { return; } #ifdef BUILD_ARGB if (use_argb_visual.get(l) && (get_argb_visual(&visual, &depth) != 0)) { have_argb_visual = true; window.visual = visual; window.colourmap = XCreateColormap(display, DefaultRootWindow(display), window.visual, AllocNone); } else { #endif /* BUILD_ARGB */ window.visual = DefaultVisual(display, screen); window.colourmap = DefaultColormap(display, screen); depth = CopyFromParent; visual = CopyFromParent; #ifdef BUILD_ARGB } #endif /* BUILD_ARGB */ int b = border_inner_margin.get(l) + border_width.get(l) + border_outer_margin.get(l); /* Sanity check to avoid making an invalid 0x0 window */ if (b == 0) { b = 1; } XClassHint classHint; // class_name must be a named local variable, so that c_str() remains // valid until we call XmbSetWMProperties() or XSetClassHint. We use // const_cast because, for whatever reason, res_name is not declared as // const char *. XmbSetWMProperties hopefully doesn't modify the value // (hell, even their own example app assigns a literal string constant to // the field) const std::string &class_name = own_window_class.get(l); classHint.res_name = const_cast(class_name.c_str()); classHint.res_class = classHint.res_name; if (own_window_type.get(l) == TYPE_OVERRIDE) { /* An override_redirect True window. * No WM hints or button processing needed. */ XSetWindowAttributes attrs = {ParentRelative, 0L, 0, 0L, 0, 0, Always, 0L, 0L, False, StructureNotifyMask | ExposureMask, 0L, True, 0, 0}; #ifdef BUILD_ARGB if (have_argb_visual) { attrs.colormap = window.colourmap; flags |= CWBorderPixel | CWColormap; } else { #endif /* BUILD_ARGB */ flags |= CWBackPixel; #ifdef BUILD_ARGB } #endif /* BUILD_ARGB */ /* Parent is desktop window (which might be a child of root) */ window.window = XCreateWindow(display, window.desktop, window.x, window.y, b, b, 0, depth, InputOutput, visual, flags, &attrs); XLowerWindow(display, window.window); XSetClassHint(display, window.window, &classHint); fprintf(stderr, PACKAGE_NAME ": window type - override\n"); fflush(stderr); } else { /* own_window_type.get(l) != TYPE_OVERRIDE */ /* A window managed by the window manager. * Process hints and buttons. */ XSetWindowAttributes attrs = {ParentRelative, 0L, 0, 0L, 0, 0, Always, 0L, 0L, False, StructureNotifyMask | ExposureMask | ButtonPressMask | ButtonReleaseMask, 0L, False, 0, 0}; XWMHints wmHint; Atom xa; #ifdef BUILD_ARGB if (have_argb_visual) { attrs.colormap = window.colourmap; flags |= CWBorderPixel | CWColormap; } else { #endif /* BUILD_ARGB */ flags |= CWBackPixel; #ifdef BUILD_ARGB } #endif /* BUILD_ARGB */ if (own_window_type.get(l) == TYPE_DOCK) { window.x = window.y = 0; } /* Parent is root window so WM can take control */ window.window = XCreateWindow(display, window.root, window.x, window.y, b, b, 0, depth, InputOutput, visual, flags, &attrs); uint16_t hints = own_window_hints.get(l); wmHint.flags = InputHint | StateHint; /* allow decorated windows to be given input focus by WM */ wmHint.input = TEST_HINT(hints, HINT_UNDECORATED) ? False : True; #ifdef BUILD_XSHAPE if (!wmHint.input) { /* allow only decorated windows to be given mouse input */ int major_version; int minor_version; if (XShapeQueryVersion(display, &major_version, &minor_version) == 0) { NORM_ERR("Input shapes are not supported"); } else { if (own_window.get(*state) && (own_window_type.get(*state) != TYPE_NORMAL || ((TEST_HINT(own_window_hints.get(*state), HINT_UNDECORATED)) != 0))) { XShapeCombineRectangles(display, window.window, ShapeInput, 0, 0, nullptr, 0, ShapeSet, Unsorted); } } } #endif /* BUILD_XSHAPE */ if (own_window_type.get(l) == TYPE_DOCK || own_window_type.get(l) == TYPE_PANEL) { wmHint.initial_state = WithdrawnState; } else { wmHint.initial_state = NormalState; } XmbSetWMProperties(display, window.window, nullptr, nullptr, argv_copy, argc_copy, nullptr, &wmHint, &classHint); XStoreName(display, window.window, own_window_title.get(l).c_str()); /* Sets an empty WM_PROTOCOLS property */ XSetWMProtocols(display, window.window, nullptr, 0); /* Set window type */ if ((xa = ATOM(_NET_WM_WINDOW_TYPE)) != None) { Atom prop; switch (own_window_type.get(l)) { case TYPE_DESKTOP: prop = ATOM(_NET_WM_WINDOW_TYPE_DESKTOP); fprintf(stderr, PACKAGE_NAME ": window type - desktop\n"); fflush(stderr); break; case TYPE_DOCK: prop = ATOM(_NET_WM_WINDOW_TYPE_DOCK); fprintf(stderr, PACKAGE_NAME ": window type - dock\n"); fflush(stderr); break; case TYPE_PANEL: prop = ATOM(_NET_WM_WINDOW_TYPE_DOCK); fprintf(stderr, PACKAGE_NAME ": window type - panel\n"); fflush(stderr); break; case TYPE_NORMAL: default: prop = ATOM(_NET_WM_WINDOW_TYPE_NORMAL); fprintf(stderr, PACKAGE_NAME ": window type - normal\n"); fflush(stderr); break; } XChangeProperty(display, window.window, xa, XA_ATOM, 32, PropModeReplace, reinterpret_cast(&prop), 1); } /* Set desired hints */ /* Window decorations */ if (TEST_HINT(hints, HINT_UNDECORATED)) { /* fprintf(stderr, PACKAGE_NAME": hint - undecorated\n"); fflush(stderr); */ xa = ATOM(_MOTIF_WM_HINTS); if (xa != None) { long prop[5] = {2, 0, 0, 0, 0}; XChangeProperty(display, window.window, xa, xa, 32, PropModeReplace, reinterpret_cast(prop), 5); } } /* Below other windows */ if (TEST_HINT(hints, HINT_BELOW)) { /* fprintf(stderr, PACKAGE_NAME": hint - below\n"); fflush(stderr); */ xa = ATOM(_WIN_LAYER); if (xa != None) { long prop = 0; XChangeProperty(display, window.window, xa, XA_CARDINAL, 32, PropModeAppend, reinterpret_cast(&prop), 1); } xa = ATOM(_NET_WM_STATE); if (xa != None) { Atom xa_prop = ATOM(_NET_WM_STATE_BELOW); XChangeProperty(display, window.window, xa, XA_ATOM, 32, PropModeAppend, reinterpret_cast(&xa_prop), 1); } } /* Above other windows */ if (TEST_HINT(hints, HINT_ABOVE)) { /* fprintf(stderr, PACKAGE_NAME": hint - above\n"); fflush(stderr); */ xa = ATOM(_WIN_LAYER); if (xa != None) { long prop = 6; XChangeProperty(display, window.window, xa, XA_CARDINAL, 32, PropModeAppend, reinterpret_cast(&prop), 1); } xa = ATOM(_NET_WM_STATE); if (xa != None) { Atom xa_prop = ATOM(_NET_WM_STATE_ABOVE); XChangeProperty(display, window.window, xa, XA_ATOM, 32, PropModeAppend, reinterpret_cast(&xa_prop), 1); } } /* Sticky */ if (TEST_HINT(hints, HINT_STICKY)) { /* fprintf(stderr, PACKAGE_NAME": hint - sticky\n"); fflush(stderr); */ xa = ATOM(_NET_WM_DESKTOP); if (xa != None) { CARD32 xa_prop = 0xFFFFFFFF; XChangeProperty(display, window.window, xa, XA_CARDINAL, 32, PropModeAppend, reinterpret_cast(&xa_prop), 1); } xa = ATOM(_NET_WM_STATE); if (xa != None) { Atom xa_prop = ATOM(_NET_WM_STATE_STICKY); XChangeProperty(display, window.window, xa, XA_ATOM, 32, PropModeAppend, reinterpret_cast(&xa_prop), 1); } } /* Skip taskbar */ if (TEST_HINT(hints, HINT_SKIP_TASKBAR)) { /* fprintf(stderr, PACKAGE_NAME": hint - skip_taskbar\n"); fflush(stderr); */ xa = ATOM(_NET_WM_STATE); if (xa != None) { Atom xa_prop = ATOM(_NET_WM_STATE_SKIP_TASKBAR); XChangeProperty(display, window.window, xa, XA_ATOM, 32, PropModeAppend, reinterpret_cast(&xa_prop), 1); } } /* Skip pager */ if (TEST_HINT(hints, HINT_SKIP_PAGER)) { /* fprintf(stderr, PACKAGE_NAME": hint - skip_pager\n"); fflush(stderr); */ xa = ATOM(_NET_WM_STATE); if (xa != None) { Atom xa_prop = ATOM(_NET_WM_STATE_SKIP_PAGER); XChangeProperty(display, window.window, xa, XA_ATOM, 32, PropModeAppend, reinterpret_cast(&xa_prop), 1); } } } fprintf(stderr, PACKAGE_NAME ": drawing to created window (0x%lx)\n", window.window); fflush(stderr); XMapWindow(display, window.window); } else #endif /* OWN_WINDOW */ { XWindowAttributes attrs; if (window.window == 0u) { window.window = find_desktop_window(&window.root, &window.desktop); } window.visual = DefaultVisual(display, screen); window.colourmap = DefaultColormap(display, screen); if (XGetWindowAttributes(display, window.window, &attrs) != 0) { window.width = attrs.width; window.height = attrs.height; } fprintf(stderr, PACKAGE_NAME ": drawing to desktop window\n"); } /* Drawable is same as window. This may be changed by double buffering. */ window.drawable = window.window; XFlush(display); XSelectInput(display, window.window, ExposureMask | PropertyChangeMask #ifdef OWN_WINDOW | (own_window.get(l) ? (StructureNotifyMask | ButtonPressMask | ButtonReleaseMask) : 0) #endif ); DBGP("leave init_window()"); } static Window find_subwindow(Window win, int w, int h) { unsigned int i, j; Window troot, parent, *children; unsigned int n; /* search subwindows with same size as display or work area */ for (i = 0; i < 10; i++) { XQueryTree(display, win, &troot, &parent, &children, &n); for (j = 0; j < n; j++) { XWindowAttributes attrs; if (XGetWindowAttributes(display, children[j], &attrs) != 0) { /* Window must be mapped and same size as display or * work space */ if (attrs.map_state != 0 && ((attrs.width == display_width && attrs.height == display_height) || (attrs.width == w && attrs.height == h))) { win = children[j]; break; } } } XFree(children); if (j == n) { break; } } return win; } void create_gc() { XGCValues values; values.graphics_exposures = 0; values.function = GXcopy; window.gc = XCreateGC(display, window.drawable, GCFunction | GCGraphicsExposures, &values); } // Get current desktop number static inline void get_x11_desktop_current(Display *current_display, Window root, Atom atom) { Atom actual_type; int actual_format; unsigned long nitems; unsigned long bytes_after; unsigned char *prop = nullptr; struct information *current_info = &info; if (atom == None) { return; } if ((XGetWindowProperty(current_display, root, atom, 0, 1L, False, XA_CARDINAL, &actual_type, &actual_format, &nitems, &bytes_after, &prop) == Success) && (actual_type == XA_CARDINAL) && (nitems == 1L) && (actual_format == 32)) { current_info->x11.desktop.current = prop[0] + 1; } if (prop != nullptr) { XFree(prop); } } // Get total number of available desktops static inline void get_x11_desktop_number(Display *current_display, Window root, Atom atom) { Atom actual_type; int actual_format; unsigned long nitems; unsigned long bytes_after; unsigned char *prop = nullptr; struct information *current_info = &info; if (atom == None) { return; } if ((XGetWindowProperty(current_display, root, atom, 0, 1L, False, XA_CARDINAL, &actual_type, &actual_format, &nitems, &bytes_after, &prop) == Success) && (actual_type == XA_CARDINAL) && (nitems == 1L) && (actual_format == 32)) { current_info->x11.desktop.number = prop[0]; } if (prop != nullptr) { XFree(prop); } } // Get all desktop names static inline void get_x11_desktop_names(Display *current_display, Window root, Atom atom) { Atom actual_type; int actual_format; unsigned long nitems; unsigned long bytes_after; unsigned char *prop = nullptr; struct information *current_info = &info; if (atom == None) { return; } if ((XGetWindowProperty(current_display, root, atom, 0, (~0L), False, ATOM(UTF8_STRING), &actual_type, &actual_format, &nitems, &bytes_after, &prop) == Success) && (actual_type == ATOM(UTF8_STRING)) && (nitems > 0L) && (actual_format == 8)) { current_info->x11.desktop.all_names.assign( reinterpret_cast(prop), nitems); } if (prop != nullptr) { XFree(prop); } } // Get current desktop name static inline void get_x11_desktop_current_name(const std::string &names) { struct information *current_info = &info; unsigned int i = 0, j = 0; int k = 0; while (i < names.size()) { if (names[i++] == '\0') { if (++k == current_info->x11.desktop.current) { current_info->x11.desktop.name.assign(names.c_str() + j); break; } j = i; } } } void get_x11_desktop_info(Display *current_display, Atom atom) { Window root; static Atom atom_current, atom_number, atom_names; struct information *current_info = &info; XWindowAttributes window_attributes; root = RootWindow(current_display, current_info->x11.monitor.current); /* Check if we initialise else retrieve changed property */ if (atom == 0) { atom_current = XInternAtom(current_display, "_NET_CURRENT_DESKTOP", True); atom_number = XInternAtom(current_display, "_NET_NUMBER_OF_DESKTOPS", True); atom_names = XInternAtom(current_display, "_NET_DESKTOP_NAMES", True); get_x11_desktop_current(current_display, root, atom_current); get_x11_desktop_number(current_display, root, atom_number); get_x11_desktop_names(current_display, root, atom_names); get_x11_desktop_current_name(current_info->x11.desktop.all_names); /* Set the PropertyChangeMask on the root window, if not set */ XGetWindowAttributes(display, root, &window_attributes); if ((window_attributes.your_event_mask & PropertyChangeMask) == 0) { XSetWindowAttributes attributes; attributes.event_mask = window_attributes.your_event_mask | PropertyChangeMask; XChangeWindowAttributes(display, root, CWEventMask, &attributes); XGetWindowAttributes(display, root, &window_attributes); } } else { if (atom == atom_current) { get_x11_desktop_current(current_display, root, atom_current); get_x11_desktop_current_name(current_info->x11.desktop.all_names); } else if (atom == atom_number) { get_x11_desktop_number(current_display, root, atom_number); } else if (atom == atom_names) { get_x11_desktop_names(current_display, root, atom_names); get_x11_desktop_current_name(current_info->x11.desktop.all_names); } } } static const char NOT_IN_X[] = "Not running in X"; void print_monitor(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; if (!out_to_x.get(*state)) { strncpy(p, NOT_IN_X, p_max_size); return; } snprintf(p, p_max_size, "%d", XDefaultScreen(display)); } void print_monitor_number(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; if (!out_to_x.get(*state)) { strncpy(p, NOT_IN_X, p_max_size); return; } snprintf(p, p_max_size, "%d", XScreenCount(display)); } void print_desktop(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; if (!out_to_x.get(*state)) { strncpy(p, NOT_IN_X, p_max_size); return; } snprintf(p, p_max_size, "%d", info.x11.desktop.current); } void print_desktop_number(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; if (!out_to_x.get(*state)) { strncpy(p, NOT_IN_X, p_max_size); return; } snprintf(p, p_max_size, "%d", info.x11.desktop.number); } void print_desktop_name(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; if (!out_to_x.get(*state)) { strncpy(p, NOT_IN_X, p_max_size); } else { strncpy(p, info.x11.desktop.name.c_str(), p_max_size); } } #ifdef OWN_WINDOW /* reserve window manager space */ void set_struts(int sidenum) { Atom strut; if ((strut = ATOM(_NET_WM_STRUT)) != None) { /* reserve space at left, right, top, bottom */ signed long sizes[12] = {0}; int i; /* define strut depth */ switch (sidenum) { case 0: /* left side */ sizes[0] = window.x + window.width; break; case 1: /* right side */ sizes[1] = display_width - window.x; break; case 2: /* top side */ sizes[2] = window.y + window.height; break; case 3: /* bottom side */ sizes[3] = display_height - window.y; break; } /* define partial strut length */ if (sidenum <= 1) { sizes[4 + (sidenum * 2)] = window.y; sizes[5 + (sidenum * 2)] = window.y + window.height; } else if (sidenum <= 3) { sizes[4 + (sidenum * 2)] = window.x; sizes[5 + (sidenum * 2)] = window.x + window.width; } /* check constraints */ for (i = 0; i < 12; i++) { if (sizes[i] < 0) { sizes[i] = 0; } else { if (i <= 1 || i >= 8) { if (sizes[i] > display_width) { sizes[i] = display_width; } } else { if (sizes[i] > display_height) { sizes[i] = display_height; } } } } XChangeProperty(display, window.window, strut, XA_CARDINAL, 32, PropModeReplace, reinterpret_cast(&sizes), 4); if ((strut = ATOM(_NET_WM_STRUT_PARTIAL)) != None) { XChangeProperty(display, window.window, strut, XA_CARDINAL, 32, PropModeReplace, reinterpret_cast(&sizes), 12); } } } #endif /* OWN_WINDOW */ #ifdef BUILD_XDBE void xdbe_swap_buffers() { if (use_xdbe.get(*state)) { XdbeSwapInfo swap; swap.swap_window = window.window; swap.swap_action = XdbeBackground; XdbeSwapBuffers(display, &swap, 1); } } #else void xpmdb_swap_buffers(void) { if (use_xpmdb.get(*state)) { XCopyArea(display, window.back_buffer, window.window, window.gc, 0, 0, window.width, window.height, 0, 0); XSetForeground(display, window.gc, 0); XFillRectangle(display, window.drawable, window.gc, 0, 0, window.width, window.height); XFlush(display); } } #endif /* BUILD_XDBE */ void print_kdb_led(const int keybit, char *p, unsigned int p_max_size) { XKeyboardState x; XGetKeyboardControl(display, &x); snprintf(p, p_max_size, "%s", (x.led_mask & keybit ? "On" : "Off")); } void print_key_caps_lock(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; print_kdb_led(1, p, p_max_size); } void print_key_num_lock(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; print_kdb_led(2, p, p_max_size); } void print_key_scroll_lock(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; print_kdb_led(4, p, p_max_size); } void print_keyboard_layout(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; char *group = NULL; XkbStateRec state; XkbDescPtr desc; XkbGetState(display, XkbUseCoreKbd, &state); desc = XkbGetKeyboard(display, XkbAllComponentsMask, XkbUseCoreKbd); group = XGetAtomName(display, desc->names->groups[state.group]); snprintf(p, p_max_size, "%s", (group != NULL ? group : "unknown")); XFree(group); XkbFreeKeyboard(desc, XkbGBN_AllComponentsMask, True); } void print_mouse_speed(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; int acc_num = 0; int acc_denom = 0; int threshold = 0; XGetPointerControl(display, &acc_num, &acc_denom, &threshold); snprintf(p, p_max_size, "%d%%", (110 - threshold)); } conky-1.12.2/src/x11.h000066400000000000000000000157401404127277500143110ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifdef BUILD_X11 #ifndef X11_H_ #define X11_H_ #include #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wvariadic-macros" #include #pragma GCC diagnostic pop #ifdef BUILD_XFT #include #endif #ifdef BUILD_XDBE #include #endif #include "colours.h" #include "setting.hh" #define ATOM(a) XInternAtom(display, #a, False) #ifdef OWN_WINDOW enum window_type { TYPE_NORMAL = 0, TYPE_DOCK, TYPE_PANEL, TYPE_DESKTOP, TYPE_OVERRIDE }; enum window_hints { HINT_UNDECORATED = 0, HINT_BELOW, HINT_ABOVE, HINT_STICKY, HINT_SKIP_TASKBAR, HINT_SKIP_PAGER }; #define SET_HINT(mask, hint) (mask |= (1 << (hint))) #define TEST_HINT(mask, hint) (mask & (1 << (hint))) #endif struct conky_window { Window root, window, desktop; Drawable drawable; Visual *visual; Colormap colourmap; GC gc; #ifdef BUILD_XDBE XdbeBackBuffer back_buffer; #else Pixmap back_buffer; #endif #ifdef BUILD_XFT XftDraw *xftdraw; #endif int width; int height; #ifdef OWN_WINDOW int x; int y; #endif }; #if defined(BUILD_ARGB) && defined(OWN_WINDOW) /* true if use_argb_visual=true and argb visual was found*/ extern bool have_argb_visual; #endif extern Display *display; extern int display_width; extern int display_height; extern int screen; extern int workarea[4]; extern struct conky_window window; extern char window_created; void destroy_window(void); void create_gc(void); void set_transparent_background(Window win); void get_x11_desktop_info(Display *current_display, Atom atom); void set_struts(int); void print_monitor(struct text_object *, char *, unsigned int); void print_monitor_number(struct text_object *, char *, unsigned int); void print_desktop(struct text_object *, char *, unsigned int); void print_desktop_number(struct text_object *, char *, unsigned int); void print_desktop_name(struct text_object *, char *, unsigned int); /* Num lock, Scroll lock, Caps Lock */ void print_key_num_lock(struct text_object *, char *, unsigned int); void print_key_caps_lock(struct text_object *, char *, unsigned int); void print_key_scroll_lock(struct text_object *, char *, unsigned int); /* Keyboard layout and mouse speed in percentage */ void print_keyboard_layout(struct text_object *, char *, unsigned int); void print_mouse_speed(struct text_object *, char *, unsigned int); #ifdef BUILD_XDBE void xdbe_swap_buffers(void); #else void xpmdb_swap_buffers(void); #endif /* BUILD_XDBE */ /* alignments */ enum alignment { TOP_LEFT, TOP_RIGHT, TOP_MIDDLE, BOTTOM_LEFT, BOTTOM_RIGHT, BOTTOM_MIDDLE, MIDDLE_LEFT, MIDDLE_MIDDLE, MIDDLE_RIGHT, NONE }; extern conky::simple_config_setting text_alignment; namespace priv { class out_to_x_setting : public conky::simple_config_setting { typedef conky::simple_config_setting Base; protected: virtual void lua_setter(lua::state &l, bool init); virtual void cleanup(lua::state &l); public: out_to_x_setting() : Base("out_to_x", true, false) {} }; class own_window_setting : public conky::simple_config_setting { typedef conky::simple_config_setting Base; protected: virtual void lua_setter(lua::state &l, bool init); public: own_window_setting() : Base("own_window", false, false) {} }; #ifdef BUILD_XDBE class use_xdbe_setting : public conky::simple_config_setting { typedef conky::simple_config_setting Base; bool set_up(lua::state &l); protected: virtual void lua_setter(lua::state &l, bool init); public: use_xdbe_setting() : Base("double_buffer", false, false) {} }; #else class use_xpmdb_setting : public conky::simple_config_setting { typedef conky::simple_config_setting Base; bool set_up(lua::state &l); protected: virtual void lua_setter(lua::state &l, bool init); public: use_xpmdb_setting() : Base("double_buffer", false, false) {} }; #endif struct colour_traits { static const lua::Type type = lua::TSTRING; typedef unsigned long Type; static inline std::pair convert(lua::state &l, int index, const std::string &) { return {get_x11_color(l.tostring(index)), true}; } }; class colour_setting : public conky::simple_config_setting { typedef conky::simple_config_setting Base; protected: virtual void lua_setter(lua::state &l, bool init); public: colour_setting(const std::string &name_, unsigned long default_value_ = 0) : Base(name_, default_value_, true) {} }; } // namespace priv extern priv::out_to_x_setting out_to_x; extern conky::simple_config_setting display_name; extern conky::simple_config_setting head_index; extern priv::colour_setting color[10]; extern priv::colour_setting default_color; extern priv::colour_setting default_shade_color; extern priv::colour_setting default_outline_color; extern conky::range_config_setting border_inner_margin; extern conky::range_config_setting border_outer_margin; extern conky::range_config_setting border_width; extern conky::simple_config_setting forced_redraw; #ifdef BUILD_XFT extern conky::simple_config_setting use_xft; #endif #ifdef OWN_WINDOW extern conky::simple_config_setting set_transparent; extern conky::simple_config_setting own_window_class; extern conky::simple_config_setting own_window_title; extern conky::simple_config_setting own_window_type; struct window_hints_traits { static const lua::Type type = lua::TSTRING; typedef uint16_t Type; static std::pair convert(lua::state &l, int index, const std::string &name); }; extern conky::simple_config_setting own_window_hints; #ifdef BUILD_ARGB extern conky::simple_config_setting use_argb_visual; /* range of 0-255 for alpha */ extern conky::range_config_setting own_window_argb_value; #endif #endif /*OWN_WINDOW*/ extern priv::own_window_setting own_window; #ifdef BUILD_XDBE extern priv::use_xdbe_setting use_xdbe; #else extern priv::use_xpmdb_setting use_xpmdb; #endif #endif /*X11_H_*/ #endif /* BUILD_X11 */ conky-1.12.2/src/xmms2.cc000066400000000000000000000314201404127277500150750ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "conky.h" xmmsc_connection_t *xmms2_conn; #define CONN_INIT 0 #define CONN_OK 1 #define CONN_NO 2 static void xmms_alloc(struct information *ptr) { if (ptr->xmms2.artist == nullptr) { ptr->xmms2.artist = (char *)malloc(text_buffer_size.get(*state)); } if (ptr->xmms2.album == nullptr) { ptr->xmms2.album = (char *)malloc(text_buffer_size.get(*state)); } if (ptr->xmms2.title == nullptr) { ptr->xmms2.title = (char *)malloc(text_buffer_size.get(*state)); } if (ptr->xmms2.genre == nullptr) { ptr->xmms2.genre = (char *)malloc(text_buffer_size.get(*state)); } if (ptr->xmms2.comment == nullptr) { ptr->xmms2.comment = (char *)malloc(text_buffer_size.get(*state)); } if (ptr->xmms2.url == nullptr) { ptr->xmms2.url = (char *)malloc(text_buffer_size.get(*state)); } if (ptr->xmms2.date == nullptr) { ptr->xmms2.date = (char *)malloc(text_buffer_size.get(*state)); } ptr->xmms2.artist[0] = '\0'; ptr->xmms2.album[0] = '\0'; ptr->xmms2.title[0] = '\0'; ptr->xmms2.genre[0] = '\0'; ptr->xmms2.comment[0] = '\0'; ptr->xmms2.url[0] = '\0'; ptr->xmms2.date[0] = '\0'; ptr->xmms2.tracknr = 0; ptr->xmms2.id = 0; ptr->xmms2.bitrate = 0; ptr->xmms2.duration = 0; ptr->xmms2.elapsed = 0; ptr->xmms2.size = 0; ptr->xmms2.progress = 0; ptr->xmms2.timesplayed = -1; } void free_xmms2(struct text_object *obj) { (void)obj; free_and_zero(info.xmms2.artist); free_and_zero(info.xmms2.album); free_and_zero(info.xmms2.title); free_and_zero(info.xmms2.genre); free_and_zero(info.xmms2.comment); free_and_zero(info.xmms2.url); free_and_zero(info.xmms2.date); free_and_zero(info.xmms2.status); free_and_zero(info.xmms2.playlist); } void connection_lost(void *p) { struct information *ptr = (struct information *)p; ptr->xmms2.conn_state = CONN_NO; fprintf(stderr, "XMMS2 connection failed. %s\n", xmmsc_get_last_error(xmms2_conn)); xmms_alloc(ptr); strncpy(ptr->xmms2.status, "Disconnected", text_buffer_size.get(*state) - 1); ptr->xmms2.playlist[0] = '\0'; ptr->xmms2.id = 0; } int handle_curent_id(xmmsv_t *value, void *p) { struct information *ptr = (struct information *)p; xmmsv_t *val, *infos, *dict_entry; xmmsc_result_t *res; const char *errbuf; int current_id; const char *charval; int intval; if (xmmsv_get_error(value, &errbuf)) { fprintf(stderr, "XMMS2 server error. %s\n", errbuf); return TRUE; } if (xmmsv_get_int(value, ¤t_id) && current_id > 0) { res = xmmsc_medialib_get_info(xmms2_conn, current_id); xmmsc_result_wait(res); val = xmmsc_result_get_value(res); if (xmmsv_get_error(val, &errbuf)) { fprintf(stderr, "XMMS2 server error. %s\n", errbuf); return TRUE; } xmms_alloc(ptr); ptr->xmms2.id = current_id; infos = xmmsv_propdict_to_dict(val, nullptr); if (xmmsv_dict_get(infos, "artist", &dict_entry) && xmmsv_get_string(dict_entry, &charval)) strncpy(ptr->xmms2.artist, charval, text_buffer_size.get(*state) - 1); if (xmmsv_dict_get(infos, "title", &dict_entry) && xmmsv_get_string(dict_entry, &charval)) strncpy(ptr->xmms2.title, charval, text_buffer_size.get(*state) - 1); if (xmmsv_dict_get(infos, "album", &dict_entry) && xmmsv_get_string(dict_entry, &charval)) strncpy(ptr->xmms2.album, charval, text_buffer_size.get(*state) - 1); if (xmmsv_dict_get(infos, "genre", &dict_entry) && xmmsv_get_string(dict_entry, &charval)) strncpy(ptr->xmms2.genre, charval, text_buffer_size.get(*state) - 1); if (xmmsv_dict_get(infos, "comment", &dict_entry) && xmmsv_get_string(dict_entry, &charval)) strncpy(ptr->xmms2.comment, charval, text_buffer_size.get(*state) - 1); if (xmmsv_dict_get(infos, "url", &dict_entry) && xmmsv_get_string(dict_entry, &charval)) strncpy(ptr->xmms2.url, charval, text_buffer_size.get(*state) - 1); if (xmmsv_dict_get(infos, "date", &dict_entry) && xmmsv_get_string(dict_entry, &charval)) strncpy(ptr->xmms2.date, charval, text_buffer_size.get(*state) - 1); if (xmmsv_dict_get(infos, "tracknr", &dict_entry) && xmmsv_get_int(dict_entry, &intval)) ptr->xmms2.tracknr = intval; if (xmmsv_dict_get(infos, "duration", &dict_entry) && xmmsv_get_int(dict_entry, &intval)) ptr->xmms2.duration = intval; if (xmmsv_dict_get(infos, "bitrate", &dict_entry) && xmmsv_get_int(dict_entry, &intval)) ptr->xmms2.bitrate = intval / 1000; if (xmmsv_dict_get(infos, "size", &dict_entry) && xmmsv_get_int(dict_entry, &intval)) ptr->xmms2.size = (float)intval / 1048576; if (xmmsv_dict_get(infos, "timesplayed", &dict_entry) && xmmsv_get_int(dict_entry, &intval)) ptr->xmms2.timesplayed = intval; xmmsv_unref(infos); xmmsc_result_unref(res); } return TRUE; } int handle_playtime(xmmsv_t *value, void *p) { struct information *ptr = (struct information *)p; int play_time; const char *errbuf; if (xmmsv_get_error(value, &errbuf)) { fprintf(stderr, "XMMS2 server error. %s\n", errbuf); return TRUE; } if (xmmsv_get_int(value, &play_time)) { ptr->xmms2.elapsed = play_time; ptr->xmms2.progress = (float)play_time / ptr->xmms2.duration; ptr->xmms2.percent = (int)(ptr->xmms2.progress * 100); } return TRUE; } int handle_playback_state_change(xmmsv_t *value, void *p) { struct information *ptr = (struct information *)p; int pb_state = 0; const char *errbuf; if (xmmsv_get_error(value, &errbuf)) { fprintf(stderr, "XMMS2 server error. %s\n", errbuf); return TRUE; } if (ptr->xmms2.status == nullptr) { ptr->xmms2.status = (char *)malloc(text_buffer_size.get(*state)); ptr->xmms2.status[0] = '\0'; } if (xmmsv_get_int(value, &pb_state)) { switch (pb_state) { case XMMS_PLAYBACK_STATUS_PLAY: strncpy(ptr->xmms2.status, "Playing", text_buffer_size.get(*state) - 1); break; case XMMS_PLAYBACK_STATUS_PAUSE: strncpy(ptr->xmms2.status, "Paused", text_buffer_size.get(*state) - 1); break; case XMMS_PLAYBACK_STATUS_STOP: strncpy(ptr->xmms2.status, "Stopped", text_buffer_size.get(*state) - 1); ptr->xmms2.elapsed = ptr->xmms2.progress = ptr->xmms2.percent = 0; break; default: strncpy(ptr->xmms2.status, "Unknown", text_buffer_size.get(*state) - 1); } } return TRUE; } int handle_playlist_loaded(xmmsv_t *value, void *p) { struct information *ptr = (struct information *)p; const char *c, *errbuf; if (xmmsv_get_error(value, &errbuf)) { fprintf(stderr, "XMMS2 server error. %s\n", errbuf); return TRUE; } if (ptr->xmms2.playlist == nullptr) { ptr->xmms2.playlist = (char *)malloc(text_buffer_size.get(*state)); ptr->xmms2.playlist[0] = '\0'; } if (xmmsv_get_string(value, &c)) { strncpy(ptr->xmms2.playlist, c, text_buffer_size.get(*state) - 1); } return TRUE; } int handle_medialib_changed(xmmsv_t *value, void *p) { struct information *ptr = (struct information *)p; const char *errbuf; int current_id; if (xmmsv_get_error(value, &errbuf)) { fprintf(stderr, "XMMS2 server error. %s\n", errbuf); return TRUE; } if (xmmsv_get_int(value, ¤t_id) && current_id > 0 && ptr->xmms2.id == (unsigned int)current_id) { return handle_curent_id(value, ptr); } return TRUE; } int update_xmms2(void) { struct information *current_info = &info; /* initialize connection */ if (current_info->xmms2.conn_state == CONN_INIT) { if (xmms2_conn == nullptr) { xmms2_conn = xmmsc_init(PACKAGE_NAME); } /* did init fail? */ if (xmms2_conn == nullptr) { fprintf(stderr, "XMMS2 init failed. %s\n", xmmsc_get_last_error(xmms2_conn)); return 0; } /* init ok but not connected yet.. */ current_info->xmms2.conn_state = CONN_NO; /* clear all values */ xmms_alloc(current_info); } /* connect */ if (current_info->xmms2.conn_state == CONN_NO) { char *path = getenv("XMMS_PATH"); if (!xmmsc_connect(xmms2_conn, path)) { fprintf(stderr, "XMMS2 connection failed. %s\n", xmmsc_get_last_error(xmms2_conn)); current_info->xmms2.conn_state = CONN_NO; return 0; } /* set callbacks */ xmmsc_disconnect_callback_set(xmms2_conn, connection_lost, current_info); XMMS_CALLBACK_SET(xmms2_conn, xmmsc_broadcast_playback_current_id, handle_curent_id, current_info); XMMS_CALLBACK_SET(xmms2_conn, xmmsc_signal_playback_playtime, handle_playtime, current_info); XMMS_CALLBACK_SET(xmms2_conn, xmmsc_broadcast_playback_status, handle_playback_state_change, current_info); XMMS_CALLBACK_SET(xmms2_conn, xmmsc_broadcast_playlist_loaded, handle_playlist_loaded, current_info); XMMS_CALLBACK_SET(xmms2_conn, xmmsc_broadcast_medialib_entry_changed, handle_medialib_changed, current_info); /* get playback status, current id and active playlist */ XMMS_CALLBACK_SET(xmms2_conn, xmmsc_playback_current_id, handle_curent_id, current_info); XMMS_CALLBACK_SET(xmms2_conn, xmmsc_playback_status, handle_playback_state_change, current_info); XMMS_CALLBACK_SET(xmms2_conn, xmmsc_playlist_current_active, handle_playlist_loaded, current_info); /* everything seems to be ok */ current_info->xmms2.conn_state = CONN_OK; } /* handle callbacks */ if (current_info->xmms2.conn_state == CONN_OK) { xmmsc_io_in_handle(xmms2_conn); if (xmmsc_io_want_out(xmms2_conn)) xmmsc_io_out_handle(xmms2_conn); } return 0; } void print_xmms2_tracknr(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; if (info.xmms2.tracknr != -1) { snprintf(p, p_max_size, "%i", info.xmms2.tracknr); } } void print_xmms2_elapsed(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; snprintf(p, p_max_size, "%02d:%02d", info.xmms2.elapsed / 60000, (info.xmms2.elapsed / 1000) % 60); } void print_xmms2_duration(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; snprintf(p, p_max_size, "%02d:%02d", info.xmms2.duration / 60000, (info.xmms2.duration / 1000) % 60); } double xmms2_barval(struct text_object *obj) { (void)obj; return info.xmms2.progress; } void print_xmms2_smart(struct text_object *obj, char *p, unsigned int p_max_size) { (void)obj; int artist_len = strlen(info.xmms2.artist); int title_len = strlen(info.xmms2.title); if (artist_len < 2 && title_len < 2) { snprintf(p, p_max_size, "%s", info.xmms2.url); } else if (artist_len < 1) { snprintf(p, p_max_size, "%s", info.xmms2.title); } else { snprintf(p, p_max_size, "%s - %s", info.xmms2.artist, info.xmms2.title); } } #define XMMS2_PRINT_GENERATOR(name, fmt) \ void print_xmms2_##name(struct text_object *obj, char *p, \ unsigned int p_max_size) { \ (void)obj; \ snprintf(p, p_max_size, fmt, info.xmms2.name); \ } XMMS2_PRINT_GENERATOR(artist, "%s") XMMS2_PRINT_GENERATOR(album, "%s") XMMS2_PRINT_GENERATOR(title, "%s") XMMS2_PRINT_GENERATOR(genre, "%s") XMMS2_PRINT_GENERATOR(comment, "%s") XMMS2_PRINT_GENERATOR(url, "%s") XMMS2_PRINT_GENERATOR(status, "%s") XMMS2_PRINT_GENERATOR(date, "%s") XMMS2_PRINT_GENERATOR(bitrate, "%i") XMMS2_PRINT_GENERATOR(id, "%u") XMMS2_PRINT_GENERATOR(size, "%2.1f") XMMS2_PRINT_GENERATOR(playlist, "%s") XMMS2_PRINT_GENERATOR(timesplayed, "%i") XMMS2_PRINT_GENERATOR(percent, "%i") #undef XMMS2_PRINT_GENERATOR int if_xmms2_connected(struct text_object *obj) { (void)obj; return info.xmms2.conn_state == CONN_OK; } conky-1.12.2/src/xmms2.h000066400000000000000000000053641404127277500147470ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef XMMS2_H_ #define XMMS2_H_ #include struct xmms2_s { char *artist; char *album; char *title; char *genre; char *comment; char *url; char *date; char *playlist; int tracknr; int bitrate; unsigned int id; int duration; int elapsed; int timesplayed; float size; float progress; int percent; char *status; int conn_state; }; int update_xmms2(void); void print_xmms2_tracknr(struct text_object *, char *, unsigned int); void print_xmms2_elapsed(struct text_object *, char *, unsigned int); void print_xmms2_duration(struct text_object *, char *, unsigned int); double xmms2_barval(struct text_object *); void print_xmms2_smart(struct text_object *, char *, unsigned int); void print_xmms2_artist(struct text_object *, char *, unsigned int); void print_xmms2_album(struct text_object *, char *, unsigned int); void print_xmms2_title(struct text_object *, char *, unsigned int); void print_xmms2_genre(struct text_object *, char *, unsigned int); void print_xmms2_comment(struct text_object *, char *, unsigned int); void print_xmms2_url(struct text_object *, char *, unsigned int); void print_xmms2_status(struct text_object *, char *, unsigned int); void print_xmms2_date(struct text_object *, char *, unsigned int); void print_xmms2_bitrate(struct text_object *, char *, unsigned int); void print_xmms2_id(struct text_object *, char *, unsigned int); void print_xmms2_size(struct text_object *, char *, unsigned int); void print_xmms2_playlist(struct text_object *, char *, unsigned int); void print_xmms2_timesplayed(struct text_object *, char *, unsigned int); void print_xmms2_percent(struct text_object *, char *, unsigned int); int if_xmms2_connected(struct text_object *); void free_xmms2(struct text_object *); #endif /*XMMS2_H_*/ conky-1.12.2/tests/000077500000000000000000000000001404127277500140735ustar00rootroot00000000000000conky-1.12.2/tests/CMakeLists.txt000066400000000000000000000032431404127277500166350ustar00rootroot00000000000000include(CTest) include_directories(${CMAKE_SOURCE_DIR}/src) include_directories(${CMAKE_BINARY_DIR}) include_directories(${conky_includes}) set(test_srcs "test-conky.cc") if(OS_LINUX) set(test_srcs ${test_srcs} test-linux.cc) endif() if(OS_DARWIN) set(test_srcs ${test_srcs} test-darwin.cc) endif() set(test_srcs ${test_srcs} test-core.cc) set(test_srcs ${test_srcs} test-diskio.cc) set(test_srcs ${test_srcs} test-fs.cc) if(BUILD_HSV_GRADIENT) set(test_srcs ${test_srcs} test-hsv.cc) endif(BUILD_HSV_GRADIENT) add_executable(test-conky test-common.cc ${test_srcs}) target_link_libraries(test-conky conky_core) catch_discover_tests(test-conky) if(USING_CLANG) set(COVERAGE_LCOV_EXCLUDES "*/include/c++/v1/*" "/usr/include/*" "/usr/lib/*" "/usr/local/Cellar/*" "/usr/local/include/*" "/usr/local/lib/*" "/usr/include/libkern/i386/*" "/usr/include/sys/_types/*" "/usr/local/opt/gettext/include/*" "${CMAKE_CURRENT_SOURCE_DIR}/*" "${CMAKE_CURRENT_SOURCE_DIR}/catch2/*" "${CMAKE_SOURCE_DIR}/3rdparty/*") setup_target_for_coverage_lcov_html(NAME test-conky-coverage-html EXECUTABLE test-conky DEPENDENCIES test-conky) setup_target_for_coverage_lcov_txt(NAME test-conky-coverage-txt EXECUTABLE test-conky DEPENDENCIES test-conky) endif() conky-1.12.2/tests/catch2/000077500000000000000000000000001404127277500152375ustar00rootroot00000000000000conky-1.12.2/tests/catch2/catch.hpp000066400000000000000000015666261404127277500170600ustar00rootroot00000000000000/* * Catch v2.5.0 * Generated: 2018-11-26 20:46:12.165372 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it * directly Copyright (c) 2018 Two Blue Cubes Ltd. All rights reserved. * * Distributed under the Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED #define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED // start catch.hpp #define CATCH_VERSION_MAJOR 2 #define CATCH_VERSION_MINOR 5 #define CATCH_VERSION_PATCH 0 #ifdef __clang__ #pragma clang system_header #elif defined __GNUC__ #pragma GCC system_header #endif // start catch_suppress_warnings.h #ifdef __clang__ #ifdef __ICC // icpc defines the __clang__ macro #pragma warning(push) #pragma warning(disable : 161 1682) #else // __ICC #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpadded" #pragma clang diagnostic ignored "-Wswitch-enum" #pragma clang diagnostic ignored "-Wcovered-switch-default" #endif #elif defined __GNUC__ // GCC likes to warn on REQUIREs, and we cannot suppress them // locally because g++'s support for _Pragma is lacking in older, // still supported, versions #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-variable" #pragma GCC diagnostic ignored "-Wpadded" #endif // end catch_suppress_warnings.h #if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER) #define CATCH_IMPL #define CATCH_CONFIG_ALL_PARTS #endif // In the impl file, we want to have access to all parts of the headers // Can also be used to sanely support PCHs #if defined(CATCH_CONFIG_ALL_PARTS) #define CATCH_CONFIG_EXTERNAL_INTERFACES #if defined(CATCH_CONFIG_DISABLE_MATCHERS) #undef CATCH_CONFIG_DISABLE_MATCHERS #endif #if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER) #define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER #endif #endif #if !defined(CATCH_CONFIG_IMPL_ONLY) // start catch_platform.h #ifdef __APPLE__ #include #if TARGET_OS_OSX == 1 #define CATCH_PLATFORM_MAC #elif TARGET_OS_IPHONE == 1 #define CATCH_PLATFORM_IPHONE #endif #elif defined(linux) || defined(__linux) || defined(__linux__) #define CATCH_PLATFORM_LINUX #elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || \ defined(_MSC_VER) || defined(__MINGW32__) #define CATCH_PLATFORM_WINDOWS #endif // end catch_platform.h #ifdef CATCH_IMPL #ifndef CLARA_CONFIG_MAIN #define CLARA_CONFIG_MAIN_NOT_DEFINED #define CLARA_CONFIG_MAIN #endif #endif // start catch_user_interfaces.h namespace Catch { unsigned int rngSeed(); } // end catch_user_interfaces.h // start catch_tag_alias_autoregistrar.h // start catch_common.h // start catch_compiler_capabilities.h // Detect a number of compiler features - by compiler // The following features are defined: // // CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported? // CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported? // CATCH_CONFIG_POSIX_SIGNALS : are POSIX signals supported? // CATCH_CONFIG_DISABLE_EXCEPTIONS : Are exceptions enabled? // **************** // Note to maintainers: if new toggles are added please document them // in configuration.md, too // **************** // In general each macro has a _NO_ form // (e.g. CATCH_CONFIG_NO_POSIX_SIGNALS) which disables the feature. // Many features, at point of detection, define an _INTERNAL_ macro, so they // can be combined, en-mass, with the _NO_ forms later. #ifdef __cplusplus #if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) #define CATCH_CPP14_OR_GREATER #endif #if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) #define CATCH_CPP17_OR_GREATER #endif /* Disable C++17 on older GCC versions. */ #if defined(__GNUC__) && !defined(_GLIBCXX_RELEASE) #undef CATCH_CPP17_OR_GREATER #endif #endif #if defined(CATCH_CPP17_OR_GREATER) #define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS #endif #ifdef __clang__ #define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Wexit-time-destructors\"") \ _Pragma("clang diagnostic ignored \"-Wglobal-constructors\"") #define CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS \ _Pragma("clang diagnostic pop") #define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Wparentheses\"") #define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \ _Pragma("clang diagnostic pop") #define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Wunused-variable\"") #define CATCH_INTERNAL_UNSUPPRESS_UNUSED_WARNINGS \ _Pragma("clang diagnostic pop") #endif // __clang__ //////////////////////////////////////////////////////////////////////////////// // Assume that non-Windows platforms support posix signals by default #if !defined(CATCH_PLATFORM_WINDOWS) #define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS #endif //////////////////////////////////////////////////////////////////////////////// // We know some environments not to support full POSIX signals #if defined(__CYGWIN__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || \ defined(__DJGPP__) #define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS #endif #ifdef __OS400__ #define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS #define CATCH_CONFIG_COLOUR_NONE #endif //////////////////////////////////////////////////////////////////////////////// // Android somehow still does not support std::to_string #if defined(__ANDROID__) #define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING #endif //////////////////////////////////////////////////////////////////////////////// // Not all Windows environments support SEH properly #if defined(__MINGW32__) #define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH #endif //////////////////////////////////////////////////////////////////////////////// // PS4 #if defined(__ORBIS__) #define CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE #endif //////////////////////////////////////////////////////////////////////////////// // Cygwin #ifdef __CYGWIN__ // Required for some versions of Cygwin to declare gettimeofday // see: // http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin #define _BSD_SOURCE // some versions of cygwin (most) do not support std::to_string. Use the libstd // check. // https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html // line 2812-2813 #if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) && \ !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)) #define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING #endif #endif // __CYGWIN__ //////////////////////////////////////////////////////////////////////////////// // Visual C++ #ifdef _MSC_VER #if _MSC_VER >= 1900 // Visual Studio 2015 or newer #define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS #endif // Universal Windows platform does not support SEH // Or console colours (or console at all...) #if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) #define CATCH_CONFIG_COLOUR_NONE #else #define CATCH_INTERNAL_CONFIG_WINDOWS_SEH #endif // MSVC traditional preprocessor needs some workaround for __VA_ARGS__ // _MSVC_TRADITIONAL == 0 means new conformant preprocessor // _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor #if !defined(_MSVC_TRADITIONAL) || \ (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL) #define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #endif #endif // _MSC_VER //////////////////////////////////////////////////////////////////////////////// // Check if we are compiled with -fno-exceptions or equivalent #if defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND) #define CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED #endif //////////////////////////////////////////////////////////////////////////////// // DJGPP #ifdef __DJGPP__ #define CATCH_INTERNAL_CONFIG_NO_WCHAR #endif // __DJGPP__ //////////////////////////////////////////////////////////////////////////////// // Embarcadero C++Build #if defined(__BORLANDC__) #define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN #endif //////////////////////////////////////////////////////////////////////////////// // Use of __COUNTER__ is suppressed during code analysis in // CLion/AppCode 2017.2.x and former, because __COUNTER__ is not properly // handled by it. // Otherwise all supported compilers support COUNTER macro, // but user still might want to turn it off #if (!defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L) #define CATCH_INTERNAL_CONFIG_COUNTER #endif //////////////////////////////////////////////////////////////////////////////// // Check if string_view is available and usable // The check is split apart to work around v140 (VS2015) preprocessor issue... #if defined(__has_include) #if __has_include() && defined(CATCH_CPP17_OR_GREATER) #define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW #endif #endif //////////////////////////////////////////////////////////////////////////////// // Check if variant is available and usable #if defined(__has_include) #if __has_include() && defined(CATCH_CPP17_OR_GREATER) #if defined(__clang__) && (__clang_major__ < 8) // work around clang bug with libstdc++ // https://bugs.llvm.org/show_bug.cgi?id=31852 fix should be in clang 8, // workaround in libstdc++ 8.2 #include #if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) #define CATCH_CONFIG_NO_CPP17_VARIANT #else #define CATCH_INTERNAL_CONFIG_CPP17_VARIANT #endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && // (_GLIBCXX_RELEASE < 9) #endif // defined(__clang__) && (__clang_major__ < 8) #endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) #endif // __has_include #if defined(CATCH_INTERNAL_CONFIG_COUNTER) && \ !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) #define CATCH_CONFIG_COUNTER #endif #if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && \ !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && \ !defined(CATCH_CONFIG_WINDOWS_SEH) && \ !defined(CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH) #define CATCH_CONFIG_WINDOWS_SEH #endif // This is set by default, because we assume that unix compilers are // posix-signal-compatible by default. #if defined(CATCH_INTERNAL_CONFIG_POSIX_SIGNALS) && \ !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && \ !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && \ !defined(CATCH_CONFIG_POSIX_SIGNALS) #define CATCH_CONFIG_POSIX_SIGNALS #endif // This is set by default, because we assume that compilers with no wchar_t // support are just rare exceptions. #if !defined(CATCH_INTERNAL_CONFIG_NO_WCHAR) && \ !defined(CATCH_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_WCHAR) #define CATCH_CONFIG_WCHAR #endif #if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && \ !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && \ !defined(CATCH_CONFIG_CPP11_TO_STRING) #define CATCH_CONFIG_CPP11_TO_STRING #endif #if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) && \ !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) && \ !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) #define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS #endif #if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && \ !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && \ !defined(CATCH_CONFIG_CPP17_STRING_VIEW) #define CATCH_CONFIG_CPP17_STRING_VIEW #endif #if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && \ !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && \ !defined(CATCH_CONFIG_CPP17_VARIANT) #define CATCH_CONFIG_CPP17_VARIANT #endif #if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT) #define CATCH_INTERNAL_CONFIG_NEW_CAPTURE #endif #if defined(CATCH_INTERNAL_CONFIG_NEW_CAPTURE) && \ !defined(CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE) && \ !defined(CATCH_CONFIG_NO_NEW_CAPTURE) && \ !defined(CATCH_CONFIG_NEW_CAPTURE) #define CATCH_CONFIG_NEW_CAPTURE #endif #if !defined(CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED) && \ !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) #define CATCH_CONFIG_DISABLE_EXCEPTIONS #endif #if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && \ !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && \ !defined(CATCH_CONFIG_POLYFILL_ISNAN) #define CATCH_CONFIG_POLYFILL_ISNAN #endif #if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) #define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS #define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS #endif #if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS) #define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS #define CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS #endif #if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS) #define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS #define CATCH_INTERNAL_UNSUPPRESS_UNUSED_WARNINGS #endif #if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) #define CATCH_TRY if ((true)) #define CATCH_CATCH_ALL if ((false)) #define CATCH_CATCH_ANON(type) if ((false)) #else #define CATCH_TRY try #define CATCH_CATCH_ALL catch (...) #define CATCH_CATCH_ANON(type) catch (type) #endif #if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && \ !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && \ !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) #define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #endif // end catch_compiler_capabilities.h #define INTERNAL_CATCH_UNIQUE_NAME_LINE2(name, line) name##line #define INTERNAL_CATCH_UNIQUE_NAME_LINE(name, line) \ INTERNAL_CATCH_UNIQUE_NAME_LINE2(name, line) #ifdef CATCH_CONFIG_COUNTER #define INTERNAL_CATCH_UNIQUE_NAME(name) \ INTERNAL_CATCH_UNIQUE_NAME_LINE(name, __COUNTER__) #else #define INTERNAL_CATCH_UNIQUE_NAME(name) \ INTERNAL_CATCH_UNIQUE_NAME_LINE(name, __LINE__) #endif #include #include #include // We need a dummy global operator<< so we can bring it into Catch namespace // later struct Catch_global_namespace_dummy {}; std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy); namespace Catch { struct CaseSensitive { enum Choice { Yes, No }; }; class NonCopyable { NonCopyable(NonCopyable const&) = delete; NonCopyable(NonCopyable&&) = delete; NonCopyable& operator=(NonCopyable const&) = delete; NonCopyable& operator=(NonCopyable&&) = delete; protected: NonCopyable(); virtual ~NonCopyable(); }; struct SourceLineInfo { SourceLineInfo() = delete; SourceLineInfo(char const* _file, std::size_t _line) noexcept : file(_file), line(_line) {} SourceLineInfo(SourceLineInfo const& other) = default; SourceLineInfo(SourceLineInfo&&) = default; SourceLineInfo& operator=(SourceLineInfo const&) = default; SourceLineInfo& operator=(SourceLineInfo&&) = default; bool empty() const noexcept; bool operator==(SourceLineInfo const& other) const noexcept; bool operator<(SourceLineInfo const& other) const noexcept; char const* file; std::size_t line; }; std::ostream& operator<<(std::ostream& os, SourceLineInfo const& info); // Bring in operator<< from global namespace into Catch namespace // This is necessary because the overload of operator<< above makes // lookup stop at namespace Catch using ::operator<<; // Use this in variadic streaming macros to allow // >> +StreamEndStop // as well as // >> stuff +StreamEndStop struct StreamEndStop { std::string operator+() const; }; template T const& operator+(T const& value, StreamEndStop) { return value; } } // namespace Catch #define CATCH_INTERNAL_LINEINFO \ ::Catch::SourceLineInfo(__FILE__, static_cast(__LINE__)) // end catch_common.h namespace Catch { struct RegistrarForTagAliases { RegistrarForTagAliases(char const* alias, char const* tag, SourceLineInfo const& lineInfo); }; } // end namespace Catch #define CATCH_REGISTER_TAG_ALIAS(alias, spec) \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ namespace { \ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( \ AutoRegisterTagAlias)(alias, spec, CATCH_INTERNAL_LINEINFO); \ } \ CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS // end catch_tag_alias_autoregistrar.h // start catch_test_registry.h // start catch_interfaces_testcase.h #include #include namespace Catch { class TestSpec; struct ITestInvoker { virtual void invoke() const = 0; virtual ~ITestInvoker(); }; using ITestCasePtr = std::shared_ptr; class TestCase; struct IConfig; struct ITestCaseRegistry { virtual ~ITestCaseRegistry(); virtual std::vector const& getAllTests() const = 0; virtual std::vector const& getAllTestsSorted( IConfig const& config) const = 0; }; bool matchTest(TestCase const& testCase, TestSpec const& testSpec, IConfig const& config); std::vector filterTests(std::vector const& testCases, TestSpec const& testSpec, IConfig const& config); std::vector const& getAllTestCasesSorted(IConfig const& config); } // namespace Catch // end catch_interfaces_testcase.h // start catch_stringref.h #include #include #include namespace Catch { class StringData; /// A non-owning string class (similar to the forthcoming std::string_view) /// Note that, because a StringRef may be a substring of another string, /// it may not be null terminated. c_str() must return a null terminated /// string, however, and so the StringRef will internally take ownership /// (taking a copy), if necessary. In theory this ownership is not externally /// visible - but it does mean (substring) StringRefs should not be shared /// between threads. class StringRef { public: using size_type = std::size_t; private: friend struct StringRefTestAccess; char const* m_start; size_type m_size; char* m_data = nullptr; void takeOwnership(); static constexpr char const* const s_empty = ""; public: // construction/ assignment StringRef() noexcept : StringRef(s_empty, 0) {} StringRef(StringRef const& other) noexcept : m_start(other.m_start), m_size(other.m_size) {} StringRef(StringRef&& other) noexcept : m_start(other.m_start), m_size(other.m_size), m_data(other.m_data) { other.m_data = nullptr; } StringRef(char const* rawChars) noexcept; StringRef(char const* rawChars, size_type size) noexcept : m_start(rawChars), m_size(size) {} StringRef(std::string const& stdString) noexcept : m_start(stdString.c_str()), m_size(stdString.size()) {} ~StringRef() noexcept { delete[] m_data; } auto operator=(StringRef const& other) noexcept -> StringRef& { delete[] m_data; m_data = nullptr; m_start = other.m_start; m_size = other.m_size; return *this; } operator std::string() const; void swap(StringRef& other) noexcept; public: // operators auto operator==(StringRef const& other) const noexcept -> bool; auto operator!=(StringRef const& other) const noexcept -> bool; auto operator[](size_type index) const noexcept -> char; public: // named queries auto empty() const noexcept -> bool { return m_size == 0; } auto size() const noexcept -> size_type { return m_size; } auto numberOfCharacters() const noexcept -> size_type; auto c_str() const -> char const*; public: // substrings and searches auto substr(size_type start, size_type size) const noexcept -> StringRef; // Returns the current start pointer. // Note that the pointer can change when if the StringRef is a substring auto currentData() const noexcept -> char const*; private: // ownership queries - may not be consistent between calls auto isOwned() const noexcept -> bool; auto isSubstring() const noexcept -> bool; }; auto operator+(StringRef const& lhs, StringRef const& rhs) -> std::string; auto operator+(StringRef const& lhs, char const* rhs) -> std::string; auto operator+(char const* lhs, StringRef const& rhs) -> std::string; auto operator+=(std::string& lhs, StringRef const& sr) -> std::string&; auto operator<<(std::ostream& os, StringRef const& sr) -> std::ostream&; inline auto operator"" _sr(char const* rawChars, std::size_t size) noexcept -> StringRef { return StringRef(rawChars, size); } } // namespace Catch inline auto operator"" _catch_sr(char const* rawChars, std::size_t size) noexcept -> Catch::StringRef { return Catch::StringRef(rawChars, size); } // end catch_stringref.h // start catch_type_traits.hpp namespace Catch { #ifdef CATCH_CPP17_OR_GREATER template inline constexpr auto is_unique = std::true_type{}; template inline constexpr auto is_unique = std::bool_constant<(!std::is_same_v && ...) && is_unique>{}; #else template struct is_unique : std::true_type {}; template struct is_unique : std::integral_constant::value && is_unique::value && is_unique::value> {}; #endif } // namespace Catch // end catch_type_traits.hpp // start catch_preprocessor.hpp #define CATCH_RECURSION_LEVEL0(...) __VA_ARGS__ #define CATCH_RECURSION_LEVEL1(...) \ CATCH_RECURSION_LEVEL0( \ CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(__VA_ARGS__))) #define CATCH_RECURSION_LEVEL2(...) \ CATCH_RECURSION_LEVEL1( \ CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(__VA_ARGS__))) #define CATCH_RECURSION_LEVEL3(...) \ CATCH_RECURSION_LEVEL2( \ CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(__VA_ARGS__))) #define CATCH_RECURSION_LEVEL4(...) \ CATCH_RECURSION_LEVEL3( \ CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(__VA_ARGS__))) #define CATCH_RECURSION_LEVEL5(...) \ CATCH_RECURSION_LEVEL4( \ CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(__VA_ARGS__))) #ifdef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_EXPAND_VARGS(...) __VA_ARGS__ // MSVC needs more evaluations #define CATCH_RECURSION_LEVEL6(...) \ CATCH_RECURSION_LEVEL5( \ CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(__VA_ARGS__))) #define CATCH_RECURSE(...) \ CATCH_RECURSION_LEVEL6(CATCH_RECURSION_LEVEL6(__VA_ARGS__)) #else #define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL5(__VA_ARGS__) #endif #define CATCH_REC_END(...) #define CATCH_REC_OUT #define CATCH_EMPTY() #define CATCH_DEFER(id) id CATCH_EMPTY() #define CATCH_REC_GET_END2() 0, CATCH_REC_END #define CATCH_REC_GET_END1(...) CATCH_REC_GET_END2 #define CATCH_REC_GET_END(...) CATCH_REC_GET_END1 #define CATCH_REC_NEXT0(test, next, ...) next CATCH_REC_OUT #define CATCH_REC_NEXT1(test, next) CATCH_DEFER(CATCH_REC_NEXT0)(test, next, 0) #define CATCH_REC_NEXT(test, next) CATCH_REC_NEXT1(CATCH_REC_GET_END test, next) #define CATCH_REC_LIST0(f, x, peek, ...) \ , f(x) CATCH_DEFER(CATCH_REC_NEXT(peek, CATCH_REC_LIST1))(f, peek, \ __VA_ARGS__) #define CATCH_REC_LIST1(f, x, peek, ...) \ , f(x) CATCH_DEFER(CATCH_REC_NEXT(peek, CATCH_REC_LIST0))(f, peek, \ __VA_ARGS__) #define CATCH_REC_LIST2(f, x, peek, ...) \ f(x) CATCH_DEFER(CATCH_REC_NEXT(peek, CATCH_REC_LIST1))(f, peek, __VA_ARGS__) #define CATCH_REC_LIST0_UD(f, userdata, x, peek, ...) \ , f(userdata, x) CATCH_DEFER(CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD))( \ f, userdata, peek, __VA_ARGS__) #define CATCH_REC_LIST1_UD(f, userdata, x, peek, ...) \ , f(userdata, x) CATCH_DEFER(CATCH_REC_NEXT(peek, CATCH_REC_LIST0_UD))( \ f, userdata, peek, __VA_ARGS__) #define CATCH_REC_LIST2_UD(f, userdata, x, peek, ...) \ f(userdata, x) CATCH_DEFER(CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD))( \ f, userdata, peek, __VA_ARGS__) // Applies the function macro `f` to each of the remaining parameters, inserts // commas between the results, and passes userdata as the first parameter to // each invocation, e.g. CATCH_REC_LIST_UD(f, x, a, b, c) evaluates to f(x, a), // f(x, b), f(x, c) #define CATCH_REC_LIST_UD(f, userdata, ...) \ CATCH_RECURSE( \ CATCH_REC_LIST2_UD(f, userdata, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) #define CATCH_REC_LIST(f, ...) \ CATCH_RECURSE(CATCH_REC_LIST2(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) #define INTERNAL_CATCH_EXPAND1(param) INTERNAL_CATCH_EXPAND2(param) #define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO##__VA_ARGS__ #define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__ #define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF #define INTERNAL_CATCH_REMOVE_PARENS(...) \ INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF __VA_ARGS__) #define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME2(Name, ...) \ INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME3(Name, __VA_ARGS__) #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME3(Name, ...) Name " - " #__VA_ARGS__ #define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME(Name, ...) \ INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME2( \ Name, INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__)) #else // MSVC is adding extra space and needs more calls to properly remove () #define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME3(Name, ...) Name " -" #__VA_ARGS__ #define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME1(Name, ...) \ INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME2(Name, __VA_ARGS__) #define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME(Name, ...) \ INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME1( \ Name, \ INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))) #endif // end catch_preprocessor.hpp namespace Catch { template class TestInvokerAsMethod : public ITestInvoker { void (C::*m_testAsMethod)(); public: TestInvokerAsMethod(void (C::*testAsMethod)()) noexcept : m_testAsMethod(testAsMethod) {} void invoke() const override { C obj; (obj.*m_testAsMethod)(); } }; auto makeTestInvoker(void (*testAsFunction)()) noexcept -> ITestInvoker*; template auto makeTestInvoker(void (C::*testAsMethod)()) noexcept -> ITestInvoker* { return new (std::nothrow) TestInvokerAsMethod(testAsMethod); } struct NameAndTags { NameAndTags(StringRef const& name_ = StringRef(), StringRef const& tags_ = StringRef()) noexcept; StringRef name; StringRef tags; }; struct AutoReg : NonCopyable { AutoReg(ITestInvoker* invoker, SourceLineInfo const& lineInfo, StringRef const& classOrMethod, NameAndTags const& nameAndTags) noexcept; ~AutoReg(); }; } // end namespace Catch #if defined(CATCH_CONFIG_DISABLE) #define INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(TestName, ...) \ static void TestName() #define INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(TestName, ClassName, \ ...) \ namespace { \ struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \ void test(); \ }; \ } \ void TestName::test() #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(TestName, ...) \ template \ static void TestName() #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( \ TestName, ClassName, ...) \ namespace { \ template \ struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \ void test(); \ }; \ } \ template \ void TestName::test() #endif /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TESTCASE2(TestName, ...) \ static void TestName(); \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ namespace { \ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME(autoRegistrar)( \ Catch::makeTestInvoker(&TestName), CATCH_INTERNAL_LINEINFO, \ Catch::StringRef(), Catch::NameAndTags{__VA_ARGS__}); \ } /* NOLINT */ \ CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS \ static void TestName() #define INTERNAL_CATCH_TESTCASE(...) \ INTERNAL_CATCH_TESTCASE2( \ INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____T_E_S_T____), __VA_ARGS__) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_METHOD_AS_TEST_CASE(QualifiedMethod, ...) \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ namespace { \ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME(autoRegistrar)( \ Catch::makeTestInvoker(&QualifiedMethod), CATCH_INTERNAL_LINEINFO, \ "&" #QualifiedMethod, Catch::NameAndTags{__VA_ARGS__}); \ } /* NOLINT */ \ CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TEST_CASE_METHOD2(TestName, ClassName, ...) \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ namespace { \ struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \ void test(); \ }; \ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME(autoRegistrar)( \ Catch::makeTestInvoker(&TestName::test), CATCH_INTERNAL_LINEINFO, \ #ClassName, Catch::NameAndTags{__VA_ARGS__}); /* NOLINT */ \ } \ CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS \ void TestName::test() #define INTERNAL_CATCH_TEST_CASE_METHOD(ClassName, ...) \ INTERNAL_CATCH_TEST_CASE_METHOD2( \ INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____T_E_S_T____), ClassName, \ __VA_ARGS__) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_REGISTER_TESTCASE(Function, ...) \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME(autoRegistrar)( \ Catch::makeTestInvoker(Function), CATCH_INTERNAL_LINEINFO, \ Catch::StringRef(), Catch::NameAndTags{__VA_ARGS__}); /* NOLINT */ \ CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_2(TestName, TestFunc, Name, Tags, \ ...) \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ template \ static void TestFunc(); \ namespace { \ template \ struct TestName { \ template \ TestName(Ts... names) { \ CATCH_INTERNAL_CHECK_UNIQUE_TYPES( \ CATCH_REC_LIST(INTERNAL_CATCH_REMOVE_PARENS, __VA_ARGS__)) \ using expander = int[]; \ (void)expander{ \ (Catch::AutoReg(Catch::makeTestInvoker(&TestFunc), \ CATCH_INTERNAL_LINEINFO, Catch::StringRef(), \ Catch::NameAndTags{names, Tags}), \ 0)...}; /* NOLINT */ \ } \ }; \ INTERNAL_CATCH_TEMPLATE_REGISTRY_INITIATE(TestName, Name, __VA_ARGS__) \ } \ CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS \ template \ static void TestFunc() #if defined(CATCH_CPP17_OR_GREATER) #define CATCH_INTERNAL_CHECK_UNIQUE_TYPES(...) \ static_assert( \ Catch::is_unique<__VA_ARGS__>, \ "Duplicate type detected in declaration of template test case"); #else #define CATCH_INTERNAL_CHECK_UNIQUE_TYPES(...) \ static_assert( \ Catch::is_unique<__VA_ARGS__>::value, \ "Duplicate type detected in declaration of template test case"); #endif #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \ INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( \ INTERNAL_CATCH_UNIQUE_NAME( \ ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____), \ INTERNAL_CATCH_UNIQUE_NAME( \ ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____), \ Name, Tags, __VA_ARGS__) #else #define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \ INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( \ INTERNAL_CATCH_UNIQUE_NAME( \ ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____), \ INTERNAL_CATCH_UNIQUE_NAME( \ ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____), \ Name, Tags, __VA_ARGS__)) #endif #define INTERNAL_CATCH_TEMPLATE_REGISTRY_INITIATE(TestName, Name, ...) \ static int INTERNAL_CATCH_UNIQUE_NAME(globalRegistrar) = []() { \ TestName( \ CATCH_REC_LIST_UD(INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME, Name, \ __VA_ARGS__)); \ return 0; \ }(); #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2(TestNameClass, TestName, \ ClassName, Name, Tags, ...) \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ namespace { \ template \ struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \ void test(); \ }; \ template \ struct TestNameClass { \ template \ TestNameClass(Ts... names) { \ CATCH_INTERNAL_CHECK_UNIQUE_TYPES( \ CATCH_REC_LIST(INTERNAL_CATCH_REMOVE_PARENS, __VA_ARGS__)) \ using expander = int[]; \ (void)expander{ \ (Catch::AutoReg(Catch::makeTestInvoker(&TestName::test), \ CATCH_INTERNAL_LINEINFO, #ClassName, \ Catch::NameAndTags{names, Tags}), \ 0)...}; /* NOLINT */ \ } \ }; \ INTERNAL_CATCH_TEMPLATE_REGISTRY_INITIATE(TestNameClass, Name, __VA_ARGS__) \ } \ CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS \ template \ void TestName::test() #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD(ClassName, Name, Tags, ...) \ INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( \ INTERNAL_CATCH_UNIQUE_NAME( \ ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____), \ INTERNAL_CATCH_UNIQUE_NAME( \ ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____), \ ClassName, Name, Tags, __VA_ARGS__) #else #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD(ClassName, Name, Tags, ...) \ INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( \ INTERNAL_CATCH_UNIQUE_NAME( \ ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____), \ INTERNAL_CATCH_UNIQUE_NAME( \ ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____), \ ClassName, Name, Tags, __VA_ARGS__)) #endif // end catch_test_registry.h // start catch_capture.hpp // start catch_assertionhandler.h // start catch_assertioninfo.h // start catch_result_type.h namespace Catch { // ResultWas::OfType enum struct ResultWas { enum OfType { Unknown = -1, Ok = 0, Info = 1, Warning = 2, FailureBit = 0x10, ExpressionFailed = FailureBit | 1, ExplicitFailure = FailureBit | 2, Exception = 0x100 | FailureBit, ThrewException = Exception | 1, DidntThrowException = Exception | 2, FatalErrorCondition = 0x200 | FailureBit }; }; bool isOk(ResultWas::OfType resultType); bool isJustInfo(int flags); // ResultDisposition::Flags enum struct ResultDisposition { enum Flags { Normal = 0x01, ContinueOnFailure = 0x02, // Failures fail test, but execution continues FalseTest = 0x04, // Prefix expression with ! SuppressFail = 0x08 // Failures are reported but do not fail the test }; }; ResultDisposition::Flags operator|(ResultDisposition::Flags lhs, ResultDisposition::Flags rhs); bool shouldContinueOnFailure(int flags); inline bool isFalseTest(int flags) { return (flags & ResultDisposition::FalseTest) != 0; } bool shouldSuppressFailure(int flags); } // end namespace Catch // end catch_result_type.h namespace Catch { struct AssertionInfo { StringRef macroName; SourceLineInfo lineInfo; StringRef capturedExpression; ResultDisposition::Flags resultDisposition; // We want to delete this constructor but a compiler bug in 4.8 means // the struct is then treated as non-aggregate // AssertionInfo() = delete; }; } // end namespace Catch // end catch_assertioninfo.h // start catch_decomposer.h // start catch_tostring.h #include #include #include #include // start catch_stream.h #include #include #include namespace Catch { std::ostream& cout(); std::ostream& cerr(); std::ostream& clog(); class StringRef; struct IStream { virtual ~IStream(); virtual std::ostream& stream() const = 0; }; auto makeStream(StringRef const& filename) -> IStream const*; class ReusableStringStream { std::size_t m_index; std::ostream* m_oss; public: ReusableStringStream(); ~ReusableStringStream(); auto str() const -> std::string; template auto operator<<(T const& value) -> ReusableStringStream& { *m_oss << value; return *this; } auto get() -> std::ostream& { return *m_oss; } }; } // namespace Catch // end catch_stream.h #ifdef CATCH_CONFIG_CPP17_STRING_VIEW #include #endif #ifdef __OBJC__ // start catch_objc_arc.hpp #import #ifdef __has_feature #define CATCH_ARC_ENABLED __has_feature(objc_arc) #else #define CATCH_ARC_ENABLED 0 #endif void arcSafeRelease(NSObject* obj); id performOptionalSelector(id obj, SEL sel); #if !CATCH_ARC_ENABLED inline void arcSafeRelease(NSObject* obj) { [obj release]; } inline id performOptionalSelector(id obj, SEL sel) { if ([obj respondsToSelector:sel]) return [obj performSelector:sel]; return nil; } #define CATCH_UNSAFE_UNRETAINED #define CATCH_ARC_STRONG #else inline void arcSafeRelease(NSObject*) {} inline id performOptionalSelector(id obj, SEL sel) { #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Warc-performSelector-leaks" #endif if ([obj respondsToSelector:sel]) return [obj performSelector:sel]; #ifdef __clang__ #pragma clang diagnostic pop #endif return nil; } #define CATCH_UNSAFE_UNRETAINED __unsafe_unretained #define CATCH_ARC_STRONG __strong #endif // end catch_objc_arc.hpp #endif #ifdef _MSC_VER #pragma warning(push) #pragma warning( \ disable : 4180) // We attempt to stream a function (address) by const&, // which MSVC complains about but is harmless #endif namespace Catch { namespace Detail { extern const std::string unprintableString; std::string rawMemoryToString(const void* object, std::size_t size); template std::string rawMemoryToString(const T& object) { return rawMemoryToString(&object, sizeof(object)); } template class IsStreamInsertable { template static auto test(int) -> decltype(std::declval() << std::declval(), std::true_type()); template static auto test(...) -> std::false_type; public: static const bool value = decltype(test(0))::value; }; template std::string convertUnknownEnumToString(E e); template typename std::enable_if::value && !std::is_base_of::value, std::string>::type convertUnstreamable(T const&) { return Detail::unprintableString; } template typename std::enable_if::value && std::is_base_of::value, std::string>::type convertUnstreamable(T const& ex) { return ex.what(); } template typename std::enable_if::value, std::string>::type convertUnstreamable(T const& value) { return convertUnknownEnumToString(value); } #if defined(_MANAGED) //! Convert a CLR string to a utf8 std::string template std::string clrReferenceToString(T ^ ref) { if (ref == nullptr) return std::string("null"); auto bytes = System::Text::Encoding::UTF8->GetBytes(ref->ToString()); cli::pin_ptr p = &bytes[0]; return std::string(reinterpret_cast(p), bytes->Length); } #endif } // namespace Detail // If we decide for C++14, change these to enable_if_ts template struct StringMaker { template static typename std::enable_if<::Catch::Detail::IsStreamInsertable::value, std::string>::type convert(const Fake& value) { ReusableStringStream rss; // NB: call using the function-like syntax to avoid ambiguity with // user-defined templated operator<< under clang. rss.operator<<(value); return rss.str(); } template static typename std::enable_if::value, std::string>::type convert(const Fake& value) { #if !defined(CATCH_CONFIG_FALLBACK_STRINGIFIER) return Detail::convertUnstreamable(value); #else return CATCH_CONFIG_FALLBACK_STRINGIFIER(value); #endif } }; namespace Detail { // This function dispatches all stringification requests inside of Catch. // Should be preferably called fully qualified, like ::Catch::Detail::stringify template std::string stringify(const T& e) { return ::Catch::StringMaker::type>::type>::convert(e); } template std::string convertUnknownEnumToString(E e) { return ::Catch::Detail::stringify( static_cast::type>(e)); } #if defined(_MANAGED) template std::string stringify(T ^ e) { return ::Catch::StringMaker::convert(e); } #endif } // namespace Detail // Some predefined specializations template <> struct StringMaker { static std::string convert(const std::string& str); }; #ifdef CATCH_CONFIG_CPP17_STRING_VIEW template <> struct StringMaker { static std::string convert(std::string_view str); }; #endif template <> struct StringMaker { static std::string convert(char const* str); }; template <> struct StringMaker { static std::string convert(char* str); }; #ifdef CATCH_CONFIG_WCHAR template <> struct StringMaker { static std::string convert(const std::wstring& wstr); }; #ifdef CATCH_CONFIG_CPP17_STRING_VIEW template <> struct StringMaker { static std::string convert(std::wstring_view str); }; #endif template <> struct StringMaker { static std::string convert(wchar_t const* str); }; template <> struct StringMaker { static std::string convert(wchar_t* str); }; #endif // TBD: Should we use `strnlen` to ensure that we don't go out of the buffer, // while keeping string semantics? template struct StringMaker { static std::string convert(char const* str) { return ::Catch::Detail::stringify(std::string{str}); } }; template struct StringMaker { static std::string convert(signed char const* str) { return ::Catch::Detail::stringify( std::string{reinterpret_cast(str)}); } }; template struct StringMaker { static std::string convert(unsigned char const* str) { return ::Catch::Detail::stringify( std::string{reinterpret_cast(str)}); } }; template <> struct StringMaker { static std::string convert(int value); }; template <> struct StringMaker { static std::string convert(long value); }; template <> struct StringMaker { static std::string convert(long long value); }; template <> struct StringMaker { static std::string convert(unsigned int value); }; template <> struct StringMaker { static std::string convert(unsigned long value); }; template <> struct StringMaker { static std::string convert(unsigned long long value); }; template <> struct StringMaker { static std::string convert(bool b); }; template <> struct StringMaker { static std::string convert(char c); }; template <> struct StringMaker { static std::string convert(signed char c); }; template <> struct StringMaker { static std::string convert(unsigned char c); }; template <> struct StringMaker { static std::string convert(std::nullptr_t); }; template <> struct StringMaker { static std::string convert(float value); }; template <> struct StringMaker { static std::string convert(double value); }; template struct StringMaker { template static std::string convert(U* p) { if (p) { return ::Catch::Detail::rawMemoryToString(p); } else { return "nullptr"; } } }; template struct StringMaker { static std::string convert(R C::*p) { if (p) { return ::Catch::Detail::rawMemoryToString(p); } else { return "nullptr"; } } }; #if defined(_MANAGED) template struct StringMaker { static std::string convert(T ^ ref) { return ::Catch::Detail::clrReferenceToString(ref); } }; #endif namespace Detail { template std::string rangeToString(InputIterator first, InputIterator last) { ReusableStringStream rss; rss << "{ "; if (first != last) { rss << ::Catch::Detail::stringify(*first); for (++first; first != last; ++first) rss << ", " << ::Catch::Detail::stringify(*first); } rss << " }"; return rss.str(); } } // namespace Detail #ifdef __OBJC__ template <> struct StringMaker { static std::string convert(NSString* nsstring) { if (!nsstring) return "nil"; return std::string("@") + [nsstring UTF8String]; } }; template <> struct StringMaker { static std::string convert(NSObject* nsObject) { return ::Catch::Detail::stringify([nsObject description]); } }; namespace Detail { inline std::string stringify(NSString* nsstring) { return StringMaker::convert(nsstring); } } // namespace Detail #endif // __OBJC__ } // namespace Catch ////////////////////////////////////////////////////// // Separate std-lib types stringification, so it can be selectively enabled // This means that we do not bring in #if defined(CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS) #define CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER #define CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER #define CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER #define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER #endif // Separate std::pair specialization #if defined(CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER) #include namespace Catch { template struct StringMaker> { static std::string convert(const std::pair& pair) { ReusableStringStream rss; rss << "{ " << ::Catch::Detail::stringify(pair.first) << ", " << ::Catch::Detail::stringify(pair.second) << " }"; return rss.str(); } }; } // namespace Catch #endif // CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER // Separate std::tuple specialization #if defined(CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER) #include namespace Catch { namespace Detail { template ::value)> struct TupleElementPrinter { static void print(const Tuple& tuple, std::ostream& os) { os << (N ? ", " : " ") << ::Catch::Detail::stringify(std::get(tuple)); TupleElementPrinter::print(tuple, os); } }; template struct TupleElementPrinter { static void print(const Tuple&, std::ostream&) {} }; } // namespace Detail template struct StringMaker> { static std::string convert(const std::tuple& tuple) { ReusableStringStream rss; rss << '{'; Detail::TupleElementPrinter>::print(tuple, rss.get()); rss << " }"; return rss.str(); } }; } // namespace Catch #endif // CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER #if defined(CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER) && \ defined(CATCH_CONFIG_CPP17_VARIANT) #include namespace Catch { template <> struct StringMaker { static std::string convert(const std::monostate&) { return "{ }"; } }; template struct StringMaker> { static std::string convert(const std::variant& variant) { if (variant.valueless_by_exception()) { return "{valueless variant}"; } else { return std::visit( [](const auto& value) { return ::Catch::Detail::stringify(value); }, variant); } } }; } // namespace Catch #endif // CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER namespace Catch { struct not_this_one { }; // Tag type for detecting which begin/ end are being selected // Import begin/ end from std here so they are considered alongside the fallback // (...) overloads in this namespace using std::begin; using std::end; not_this_one begin(...); not_this_one end(...); template struct is_range { static const bool value = !std::is_same())), not_this_one>::value && !std::is_same())), not_this_one>::value; }; #if defined(_MANAGED) // Managed types are never ranges template struct is_range { static const bool value = false; }; #endif template std::string rangeToString(Range const& range) { return ::Catch::Detail::rangeToString(begin(range), end(range)); } // Handle vector specially template std::string rangeToString(std::vector const& v) { ReusableStringStream rss; rss << "{ "; bool first = true; for (bool b : v) { if (first) first = false; else rss << ", "; rss << ::Catch::Detail::stringify(b); } rss << " }"; return rss.str(); } template struct StringMaker::value && !::Catch::Detail::IsStreamInsertable::value>::type> { static std::string convert(R const& range) { return rangeToString(range); } }; template struct StringMaker { static std::string convert(T const (&arr)[SZ]) { return rangeToString(arr); } }; } // namespace Catch // Separate std::chrono::duration specialization #if defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER) #include #include #include namespace Catch { template struct ratio_string { static std::string symbol(); }; template std::string ratio_string::symbol() { Catch::ReusableStringStream rss; rss << '[' << Ratio::num << '/' << Ratio::den << ']'; return rss.str(); } template <> struct ratio_string { static std::string symbol(); }; template <> struct ratio_string { static std::string symbol(); }; template <> struct ratio_string { static std::string symbol(); }; template <> struct ratio_string { static std::string symbol(); }; template <> struct ratio_string { static std::string symbol(); }; template <> struct ratio_string { static std::string symbol(); }; //////////// // std::chrono::duration specializations template struct StringMaker> { static std::string convert( std::chrono::duration const& duration) { ReusableStringStream rss; rss << duration.count() << ' ' << ratio_string::symbol() << 's'; return rss.str(); } }; template struct StringMaker>> { static std::string convert( std::chrono::duration> const& duration) { ReusableStringStream rss; rss << duration.count() << " s"; return rss.str(); } }; template struct StringMaker>> { static std::string convert( std::chrono::duration> const& duration) { ReusableStringStream rss; rss << duration.count() << " m"; return rss.str(); } }; template struct StringMaker>> { static std::string convert( std::chrono::duration> const& duration) { ReusableStringStream rss; rss << duration.count() << " h"; return rss.str(); } }; //////////// // std::chrono::time_point specialization // Generic time_point cannot be specialized, only // std::chrono::time_point template struct StringMaker> { static std::string convert( std::chrono::time_point const& time_point) { return ::Catch::Detail::stringify(time_point.time_since_epoch()) + " since epoch"; } }; // std::chrono::time_point specialization template struct StringMaker< std::chrono::time_point> { static std::string convert( std::chrono::time_point const& time_point) { auto converted = std::chrono::system_clock::to_time_t(time_point); #ifdef _MSC_VER std::tm timeInfo = {}; gmtime_s(&timeInfo, &converted); #else std::tm* timeInfo = std::gmtime(&converted); #endif auto const timeStampSize = sizeof("2017-01-16T17:06:45Z"); char timeStamp[timeStampSize]; const char* const fmt = "%Y-%m-%dT%H:%M:%SZ"; #ifdef _MSC_VER std::strftime(timeStamp, timeStampSize, fmt, &timeInfo); #else std::strftime(timeStamp, timeStampSize, fmt, timeInfo); #endif return std::string(timeStamp); } }; } // namespace Catch #endif // CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER #ifdef _MSC_VER #pragma warning(pop) #endif // end catch_tostring.h #include #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4389) // '==' : signed/unsigned mismatch #pragma warning(disable : 4018) // more "signed/unsigned mismatch" #pragma warning(disable : 4312) // Converting int to T* using reinterpret_cast // (issue on x64 platform) #pragma warning( \ disable : 4180) // qualifier applied to function type has no meaning #endif namespace Catch { struct ITransientExpression { auto isBinaryExpression() const -> bool { return m_isBinaryExpression; } auto getResult() const -> bool { return m_result; } virtual void streamReconstructedExpression(std::ostream& os) const = 0; ITransientExpression(bool isBinaryExpression, bool result) : m_isBinaryExpression(isBinaryExpression), m_result(result) {} // We don't actually need a virtual destructor, but many static analysers // complain if it's not here :-( virtual ~ITransientExpression(); bool m_isBinaryExpression; bool m_result; }; void formatReconstructedExpression(std::ostream& os, std::string const& lhs, StringRef op, std::string const& rhs); template class BinaryExpr : public ITransientExpression { LhsT m_lhs; StringRef m_op; RhsT m_rhs; void streamReconstructedExpression(std::ostream& os) const override { formatReconstructedExpression(os, Catch::Detail::stringify(m_lhs), m_op, Catch::Detail::stringify(m_rhs)); } public: BinaryExpr(bool comparisonResult, LhsT lhs, StringRef op, RhsT rhs) : ITransientExpression{true, comparisonResult}, m_lhs(lhs), m_op(op), m_rhs(rhs) {} }; template class UnaryExpr : public ITransientExpression { LhsT m_lhs; void streamReconstructedExpression(std::ostream& os) const override { os << Catch::Detail::stringify(m_lhs); } public: explicit UnaryExpr(LhsT lhs) : ITransientExpression{false, lhs ? true : false}, m_lhs(lhs) {} }; // Specialised comparison functions to handle equality comparisons between ints // and pointers (NULL deduces as an int) template auto compareEqual(LhsT const& lhs, RhsT const& rhs) -> bool { return static_cast(lhs == rhs); } template auto compareEqual(T* const& lhs, int rhs) -> bool { return lhs == reinterpret_cast(rhs); } template auto compareEqual(T* const& lhs, long rhs) -> bool { return lhs == reinterpret_cast(rhs); } template auto compareEqual(int lhs, T* const& rhs) -> bool { return reinterpret_cast(lhs) == rhs; } template auto compareEqual(long lhs, T* const& rhs) -> bool { return reinterpret_cast(lhs) == rhs; } template auto compareNotEqual(LhsT const& lhs, RhsT&& rhs) -> bool { return static_cast(lhs != rhs); } template auto compareNotEqual(T* const& lhs, int rhs) -> bool { return lhs != reinterpret_cast(rhs); } template auto compareNotEqual(T* const& lhs, long rhs) -> bool { return lhs != reinterpret_cast(rhs); } template auto compareNotEqual(int lhs, T* const& rhs) -> bool { return reinterpret_cast(lhs) != rhs; } template auto compareNotEqual(long lhs, T* const& rhs) -> bool { return reinterpret_cast(lhs) != rhs; } template class ExprLhs { LhsT m_lhs; public: explicit ExprLhs(LhsT lhs) : m_lhs(lhs) {} template auto operator==(RhsT const& rhs) -> BinaryExpr const { return {compareEqual(m_lhs, rhs), m_lhs, "==", rhs}; } auto operator==(bool rhs) -> BinaryExpr const { return {m_lhs == rhs, m_lhs, "==", rhs}; } template auto operator!=(RhsT const& rhs) -> BinaryExpr const { return {compareNotEqual(m_lhs, rhs), m_lhs, "!=", rhs}; } auto operator!=(bool rhs) -> BinaryExpr const { return {m_lhs != rhs, m_lhs, "!=", rhs}; } template auto operator>(RhsT const& rhs) -> BinaryExpr const { return {static_cast(m_lhs > rhs), m_lhs, ">", rhs}; } template auto operator<(RhsT const& rhs) -> BinaryExpr const { return {static_cast(m_lhs < rhs), m_lhs, "<", rhs}; } template auto operator>=(RhsT const& rhs) -> BinaryExpr const { return {static_cast(m_lhs >= rhs), m_lhs, ">=", rhs}; } template auto operator<=(RhsT const& rhs) -> BinaryExpr const { return {static_cast(m_lhs <= rhs), m_lhs, "<=", rhs}; } auto makeUnaryExpr() const -> UnaryExpr { return UnaryExpr{m_lhs}; } }; void handleExpression(ITransientExpression const& expr); template void handleExpression(ExprLhs const& expr) { handleExpression(expr.makeUnaryExpr()); } struct Decomposer { template auto operator<=(T const& lhs) -> ExprLhs { return ExprLhs{lhs}; } auto operator<=(bool value) -> ExprLhs { return ExprLhs{value}; } }; } // end namespace Catch #ifdef _MSC_VER #pragma warning(pop) #endif // end catch_decomposer.h // start catch_interfaces_capture.h #include namespace Catch { class AssertionResult; struct AssertionInfo; struct SectionInfo; struct SectionEndInfo; struct MessageInfo; struct Counts; struct BenchmarkInfo; struct BenchmarkStats; struct AssertionReaction; struct SourceLineInfo; struct ITransientExpression; struct IGeneratorTracker; struct IResultCapture { virtual ~IResultCapture(); virtual bool sectionStarted(SectionInfo const& sectionInfo, Counts& assertions) = 0; virtual void sectionEnded(SectionEndInfo const& endInfo) = 0; virtual void sectionEndedEarly(SectionEndInfo const& endInfo) = 0; virtual auto acquireGeneratorTracker(SourceLineInfo const& lineInfo) -> IGeneratorTracker& = 0; virtual void benchmarkStarting(BenchmarkInfo const& info) = 0; virtual void benchmarkEnded(BenchmarkStats const& stats) = 0; virtual void pushScopedMessage(MessageInfo const& message) = 0; virtual void popScopedMessage(MessageInfo const& message) = 0; virtual void handleFatalErrorCondition(StringRef message) = 0; virtual void handleExpr(AssertionInfo const& info, ITransientExpression const& expr, AssertionReaction& reaction) = 0; virtual void handleMessage(AssertionInfo const& info, ResultWas::OfType resultType, StringRef const& message, AssertionReaction& reaction) = 0; virtual void handleUnexpectedExceptionNotThrown( AssertionInfo const& info, AssertionReaction& reaction) = 0; virtual void handleUnexpectedInflightException( AssertionInfo const& info, std::string const& message, AssertionReaction& reaction) = 0; virtual void handleIncomplete(AssertionInfo const& info) = 0; virtual void handleNonExpr(AssertionInfo const& info, ResultWas::OfType resultType, AssertionReaction& reaction) = 0; virtual bool lastAssertionPassed() = 0; virtual void assertionPassed() = 0; // Deprecated, do not use: virtual std::string getCurrentTestName() const = 0; virtual const AssertionResult* getLastResult() const = 0; virtual void exceptionEarlyReported() = 0; }; IResultCapture& getResultCapture(); } // namespace Catch // end catch_interfaces_capture.h namespace Catch { struct TestFailureException {}; struct AssertionResultData; struct IResultCapture; class RunContext; class LazyExpression { friend class AssertionHandler; friend struct AssertionStats; friend class RunContext; ITransientExpression const* m_transientExpression = nullptr; bool m_isNegated; public: LazyExpression(bool isNegated); LazyExpression(LazyExpression const& other); LazyExpression& operator=(LazyExpression const&) = delete; explicit operator bool() const; friend auto operator<<(std::ostream& os, LazyExpression const& lazyExpr) -> std::ostream&; }; struct AssertionReaction { bool shouldDebugBreak = false; bool shouldThrow = false; }; class AssertionHandler { AssertionInfo m_assertionInfo; AssertionReaction m_reaction; bool m_completed = false; IResultCapture& m_resultCapture; public: AssertionHandler(StringRef const& macroName, SourceLineInfo const& lineInfo, StringRef capturedExpression, ResultDisposition::Flags resultDisposition); ~AssertionHandler() { if (!m_completed) { m_resultCapture.handleIncomplete(m_assertionInfo); } } template void handleExpr(ExprLhs const& expr) { handleExpr(expr.makeUnaryExpr()); } void handleExpr(ITransientExpression const& expr); void handleMessage(ResultWas::OfType resultType, StringRef const& message); void handleExceptionThrownAsExpected(); void handleUnexpectedExceptionNotThrown(); void handleExceptionNotThrownAsExpected(); void handleThrowingCallSkipped(); void handleUnexpectedInflightException(); void complete(); void setCompleted(); // query auto allowThrows() const -> bool; }; void handleExceptionMatchExpr(AssertionHandler& handler, std::string const& str, StringRef const& matcherString); } // namespace Catch // end catch_assertionhandler.h // start catch_message.h #include #include namespace Catch { struct MessageInfo { MessageInfo(StringRef const& _macroName, SourceLineInfo const& _lineInfo, ResultWas::OfType _type); StringRef macroName; std::string message; SourceLineInfo lineInfo; ResultWas::OfType type; unsigned int sequence; bool operator==(MessageInfo const& other) const; bool operator<(MessageInfo const& other) const; private: static unsigned int globalCount; }; struct MessageStream { template MessageStream& operator<<(T const& value) { m_stream << value; return *this; } ReusableStringStream m_stream; }; struct MessageBuilder : MessageStream { MessageBuilder(StringRef const& macroName, SourceLineInfo const& lineInfo, ResultWas::OfType type); template MessageBuilder& operator<<(T const& value) { m_stream << value; return *this; } MessageInfo m_info; }; class ScopedMessage { public: explicit ScopedMessage(MessageBuilder const& builder); ~ScopedMessage(); MessageInfo m_info; }; class Capturer { std::vector m_messages; IResultCapture& m_resultCapture = getResultCapture(); size_t m_captured = 0; public: Capturer(StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names); ~Capturer(); void captureValue(size_t index, std::string const& value); template void captureValues(size_t index, T const& value) { captureValue(index, Catch::Detail::stringify(value)); } template void captureValues(size_t index, T const& value, Ts const&... values) { captureValue(index, Catch::Detail::stringify(value)); captureValues(index + 1, values...); } }; } // end namespace Catch // end catch_message.h #if !defined(CATCH_CONFIG_DISABLE) #if !defined(CATCH_CONFIG_DISABLE_STRINGIFICATION) #define CATCH_INTERNAL_STRINGIFY(...) #__VA_ARGS__ #else #define CATCH_INTERNAL_STRINGIFY(...) \ "Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION" #endif #if defined(CATCH_CONFIG_FAST_COMPILE) || \ defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) /////////////////////////////////////////////////////////////////////////////// // Another way to speed-up compilation is to omit local try-catch for REQUIRE* // macros. #define INTERNAL_CATCH_TRY #define INTERNAL_CATCH_CATCH(capturer) #else // CATCH_CONFIG_FAST_COMPILE #define INTERNAL_CATCH_TRY try #define INTERNAL_CATCH_CATCH(handler) \ catch (...) { \ handler.handleUnexpectedInflightException(); \ } #endif #define INTERNAL_CATCH_REACT(handler) handler.complete(); /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TEST(macroName, resultDisposition, ...) \ do { \ Catch::AssertionHandler catchAssertionHandler( \ macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, \ CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition); \ INTERNAL_CATCH_TRY { \ CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ catchAssertionHandler.handleExpr(Catch::Decomposer() <= __VA_ARGS__); \ CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \ } \ INTERNAL_CATCH_CATCH(catchAssertionHandler) \ INTERNAL_CATCH_REACT(catchAssertionHandler) \ } while ((void)0, \ false && static_cast( \ !!(__VA_ARGS__))) // the expression here is never // evaluated at runtime but it forces // the compiler to give it a look // The double negation silences MSVC's C4800 warning, the static_cast forces // short-circuit evaluation if the type has overloaded &&. /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_IF(macroName, resultDisposition, ...) \ INTERNAL_CATCH_TEST(macroName, resultDisposition, __VA_ARGS__); \ if (Catch::getResultCapture().lastAssertionPassed()) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_ELSE(macroName, resultDisposition, ...) \ INTERNAL_CATCH_TEST(macroName, resultDisposition, __VA_ARGS__); \ if (!Catch::getResultCapture().lastAssertionPassed()) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_NO_THROW(macroName, resultDisposition, ...) \ do { \ Catch::AssertionHandler catchAssertionHandler( \ macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, \ CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition); \ try { \ static_cast(__VA_ARGS__); \ catchAssertionHandler.handleExceptionNotThrownAsExpected(); \ } catch (...) { \ catchAssertionHandler.handleUnexpectedInflightException(); \ } \ INTERNAL_CATCH_REACT(catchAssertionHandler) \ } while (false) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_THROWS(macroName, resultDisposition, ...) \ do { \ Catch::AssertionHandler catchAssertionHandler( \ macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, \ CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition); \ if (catchAssertionHandler.allowThrows()) try { \ static_cast(__VA_ARGS__); \ catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \ } catch (...) { \ catchAssertionHandler.handleExceptionThrownAsExpected(); \ } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ INTERNAL_CATCH_REACT(catchAssertionHandler) \ } while (false) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_THROWS_AS(macroName, exceptionType, resultDisposition, \ expr) \ do { \ Catch::AssertionHandler catchAssertionHandler( \ macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, \ CATCH_INTERNAL_STRINGIFY(expr) ", " CATCH_INTERNAL_STRINGIFY( \ exceptionType), \ resultDisposition); \ if (catchAssertionHandler.allowThrows()) try { \ static_cast(expr); \ catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \ } catch (exceptionType const&) { \ catchAssertionHandler.handleExceptionThrownAsExpected(); \ } catch (...) { \ catchAssertionHandler.handleUnexpectedInflightException(); \ } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ INTERNAL_CATCH_REACT(catchAssertionHandler) \ } while (false) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_MSG(macroName, messageType, resultDisposition, ...) \ do { \ Catch::AssertionHandler catchAssertionHandler( \ macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::StringRef(), \ resultDisposition); \ catchAssertionHandler.handleMessage( \ messageType, \ (Catch::MessageStream() << __VA_ARGS__ + ::Catch::StreamEndStop()) \ .m_stream.str()); \ INTERNAL_CATCH_REACT(catchAssertionHandler) \ } while (false) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_CAPTURE(varName, macroName, ...) \ auto varName = Catch::Capturer(macroName, CATCH_INTERNAL_LINEINFO, \ Catch::ResultWas::Info, #__VA_ARGS__); \ varName.captureValues(0, __VA_ARGS__) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_INFO(macroName, log) \ Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME(scopedMessage)( \ Catch::MessageBuilder(macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, \ Catch::ResultWas::Info) \ << log); /////////////////////////////////////////////////////////////////////////////// // Although this is matcher-based, it can be used with just a string #define INTERNAL_CATCH_THROWS_STR_MATCHES(macroName, resultDisposition, \ matcher, ...) \ do { \ Catch::AssertionHandler catchAssertionHandler( \ macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, \ CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY( \ matcher), \ resultDisposition); \ if (catchAssertionHandler.allowThrows()) try { \ static_cast(__VA_ARGS__); \ catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \ } catch (...) { \ Catch::handleExceptionMatchExpr(catchAssertionHandler, matcher, \ #matcher##_catch_sr); \ } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ INTERNAL_CATCH_REACT(catchAssertionHandler) \ } while (false) #endif // CATCH_CONFIG_DISABLE // end catch_capture.hpp // start catch_section.h // start catch_section_info.h // start catch_totals.h #include namespace Catch { struct Counts { Counts operator-(Counts const& other) const; Counts& operator+=(Counts const& other); std::size_t total() const; bool allPassed() const; bool allOk() const; std::size_t passed = 0; std::size_t failed = 0; std::size_t failedButOk = 0; }; struct Totals { Totals operator-(Totals const& other) const; Totals& operator+=(Totals const& other); Totals delta(Totals const& prevTotals) const; int error = 0; Counts assertions; Counts testCases; }; } // namespace Catch // end catch_totals.h #include namespace Catch { struct SectionInfo { SectionInfo(SourceLineInfo const& _lineInfo, std::string const& _name); // Deprecated SectionInfo(SourceLineInfo const& _lineInfo, std::string const& _name, std::string const&) : SectionInfo(_lineInfo, _name) {} std::string name; std::string description; // !Deprecated: this will always be empty SourceLineInfo lineInfo; }; struct SectionEndInfo { SectionInfo sectionInfo; Counts prevAssertions; double durationInSeconds; }; } // end namespace Catch // end catch_section_info.h // start catch_timer.h #include namespace Catch { auto getCurrentNanosecondsSinceEpoch() -> uint64_t; auto getEstimatedClockResolution() -> uint64_t; class Timer { uint64_t m_nanoseconds = 0; public: void start(); auto getElapsedNanoseconds() const -> uint64_t; auto getElapsedMicroseconds() const -> uint64_t; auto getElapsedMilliseconds() const -> unsigned int; auto getElapsedSeconds() const -> double; }; } // namespace Catch // end catch_timer.h #include namespace Catch { class Section : NonCopyable { public: Section(SectionInfo const& info); ~Section(); // This indicates whether the section should be executed or not explicit operator bool() const; private: SectionInfo m_info; std::string m_name; Counts m_assertions; bool m_sectionIncluded; Timer m_timer; }; } // end namespace Catch #define INTERNAL_CATCH_SECTION(...) \ CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \ if (Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( \ catch_internal_Section) = \ Catch::SectionInfo(CATCH_INTERNAL_LINEINFO, __VA_ARGS__)) \ CATCH_INTERNAL_UNSUPPRESS_UNUSED_WARNINGS #define INTERNAL_CATCH_DYNAMIC_SECTION(...) \ CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \ if (Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( \ catch_internal_Section) = \ Catch::SectionInfo( \ CATCH_INTERNAL_LINEINFO, \ (Catch::ReusableStringStream() << __VA_ARGS__).str())) \ CATCH_INTERNAL_UNSUPPRESS_UNUSED_WARNINGS // end catch_section.h // start catch_benchmark.h #include #include namespace Catch { class BenchmarkLooper { std::string m_name; std::size_t m_count = 0; std::size_t m_iterationsToRun = 1; uint64_t m_resolution; Timer m_timer; static auto getResolution() -> uint64_t; public: // Keep most of this inline as it's on the code path that is being timed BenchmarkLooper(StringRef name) : m_name(name), m_resolution(getResolution()) { reportStart(); m_timer.start(); } explicit operator bool() { if (m_count < m_iterationsToRun) return true; return needsMoreIterations(); } void increment() { ++m_count; } void reportStart(); auto needsMoreIterations() -> bool; }; } // end namespace Catch #define BENCHMARK(name) \ for (Catch::BenchmarkLooper looper(name); looper; looper.increment()) // end catch_benchmark.h // start catch_interfaces_exception.h // start catch_interfaces_registry_hub.h #include #include namespace Catch { class TestCase; struct ITestCaseRegistry; struct IExceptionTranslatorRegistry; struct IExceptionTranslator; struct IReporterRegistry; struct IReporterFactory; struct ITagAliasRegistry; class StartupExceptionRegistry; using IReporterFactoryPtr = std::shared_ptr; struct IRegistryHub { virtual ~IRegistryHub(); virtual IReporterRegistry const& getReporterRegistry() const = 0; virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0; virtual ITagAliasRegistry const& getTagAliasRegistry() const = 0; virtual IExceptionTranslatorRegistry const& getExceptionTranslatorRegistry() const = 0; virtual StartupExceptionRegistry const& getStartupExceptionRegistry() const = 0; }; struct IMutableRegistryHub { virtual ~IMutableRegistryHub(); virtual void registerReporter(std::string const& name, IReporterFactoryPtr const& factory) = 0; virtual void registerListener(IReporterFactoryPtr const& factory) = 0; virtual void registerTest(TestCase const& testInfo) = 0; virtual void registerTranslator(const IExceptionTranslator* translator) = 0; virtual void registerTagAlias(std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo) = 0; virtual void registerStartupException() noexcept = 0; }; IRegistryHub const& getRegistryHub(); IMutableRegistryHub& getMutableRegistryHub(); void cleanUp(); std::string translateActiveException(); } // namespace Catch // end catch_interfaces_registry_hub.h #if defined(CATCH_CONFIG_DISABLE) #define INTERNAL_CATCH_TRANSLATE_EXCEPTION_NO_REG(translatorName, signature) \ static std::string translatorName(signature) #endif #include #include #include namespace Catch { using exceptionTranslateFunction = std::string (*)(); struct IExceptionTranslator; using ExceptionTranslators = std::vector>; struct IExceptionTranslator { virtual ~IExceptionTranslator(); virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd) const = 0; }; struct IExceptionTranslatorRegistry { virtual ~IExceptionTranslatorRegistry(); virtual std::string translateActiveException() const = 0; }; class ExceptionTranslatorRegistrar { template class ExceptionTranslator : public IExceptionTranslator { public: ExceptionTranslator(std::string (*translateFunction)(T&)) : m_translateFunction(translateFunction) {} std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd) const override { try { if (it == itEnd) std::rethrow_exception(std::current_exception()); else return (*it)->translate(it + 1, itEnd); } catch (T& ex) { return m_translateFunction(ex); } } protected: std::string (*m_translateFunction)(T&); }; public: template ExceptionTranslatorRegistrar(std::string (*translateFunction)(T&)) { getMutableRegistryHub().registerTranslator( new ExceptionTranslator(translateFunction)); } }; } // namespace Catch /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TRANSLATE_EXCEPTION2(translatorName, signature) \ static std::string translatorName(signature); \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ namespace { \ Catch::ExceptionTranslatorRegistrar INTERNAL_CATCH_UNIQUE_NAME( \ catch_internal_ExceptionRegistrar)(&translatorName); \ } \ CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS \ static std::string translatorName(signature) #define INTERNAL_CATCH_TRANSLATE_EXCEPTION(signature) \ INTERNAL_CATCH_TRANSLATE_EXCEPTION2( \ INTERNAL_CATCH_UNIQUE_NAME(catch_internal_ExceptionTranslator), \ signature) // end catch_interfaces_exception.h // start catch_approx.h #include namespace Catch { namespace Detail { class Approx { private: bool equalityComparisonImpl(double other) const; // Validates the new margin (margin >= 0) // out-of-line to avoid including stdexcept in the header void setMargin(double margin); // Validates the new epsilon (0 < epsilon < 1) // out-of-line to avoid including stdexcept in the header void setEpsilon(double epsilon); public: explicit Approx(double value); static Approx custom(); Approx operator-() const; template ::value>::type> Approx operator()(T const& value) { Approx approx(static_cast(value)); approx.m_epsilon = m_epsilon; approx.m_margin = m_margin; approx.m_scale = m_scale; return approx; } template ::value>::type> explicit Approx(T const& value) : Approx(static_cast(value)) {} template ::value>::type> friend bool operator==(const T& lhs, Approx const& rhs) { auto lhs_v = static_cast(lhs); return rhs.equalityComparisonImpl(lhs_v); } template ::value>::type> friend bool operator==(Approx const& lhs, const T& rhs) { return operator==(rhs, lhs); } template ::value>::type> friend bool operator!=(T const& lhs, Approx const& rhs) { return !operator==(lhs, rhs); } template ::value>::type> friend bool operator!=(Approx const& lhs, T const& rhs) { return !operator==(rhs, lhs); } template ::value>::type> friend bool operator<=(T const& lhs, Approx const& rhs) { return static_cast(lhs) < rhs.m_value || lhs == rhs; } template ::value>::type> friend bool operator<=(Approx const& lhs, T const& rhs) { return lhs.m_value < static_cast(rhs) || lhs == rhs; } template ::value>::type> friend bool operator>=(T const& lhs, Approx const& rhs) { return static_cast(lhs) > rhs.m_value || lhs == rhs; } template ::value>::type> friend bool operator>=(Approx const& lhs, T const& rhs) { return lhs.m_value > static_cast(rhs) || lhs == rhs; } template ::value>::type> Approx& epsilon(T const& newEpsilon) { double epsilonAsDouble = static_cast(newEpsilon); setEpsilon(epsilonAsDouble); return *this; } template ::value>::type> Approx& margin(T const& newMargin) { double marginAsDouble = static_cast(newMargin); setMargin(marginAsDouble); return *this; } template ::value>::type> Approx& scale(T const& newScale) { m_scale = static_cast(newScale); return *this; } std::string toString() const; private: double m_epsilon; double m_margin; double m_scale; double m_value; }; } // end namespace Detail namespace literals { Detail::Approx operator"" _a(long double val); Detail::Approx operator"" _a(unsigned long long val); } // end namespace literals template <> struct StringMaker { static std::string convert(Catch::Detail::Approx const& value); }; } // end namespace Catch // end catch_approx.h // start catch_string_manip.h #include #include namespace Catch { bool startsWith(std::string const& s, std::string const& prefix); bool startsWith(std::string const& s, char prefix); bool endsWith(std::string const& s, std::string const& suffix); bool endsWith(std::string const& s, char suffix); bool contains(std::string const& s, std::string const& infix); void toLowerInPlace(std::string& s); std::string toLower(std::string const& s); std::string trim(std::string const& str); bool replaceInPlace(std::string& str, std::string const& replaceThis, std::string const& withThis); struct pluralise { pluralise(std::size_t count, std::string const& label); friend std::ostream& operator<<(std::ostream& os, pluralise const& pluraliser); std::size_t m_count; std::string m_label; }; } // namespace Catch // end catch_string_manip.h #ifndef CATCH_CONFIG_DISABLE_MATCHERS // start catch_capture_matchers.h // start catch_matchers.h #include #include namespace Catch { namespace Matchers { namespace Impl { template struct MatchAllOf; template struct MatchAnyOf; template struct MatchNotOf; class MatcherUntypedBase { public: MatcherUntypedBase() = default; MatcherUntypedBase(MatcherUntypedBase const&) = default; MatcherUntypedBase& operator=(MatcherUntypedBase const&) = delete; std::string toString() const; protected: virtual ~MatcherUntypedBase(); virtual std::string describe() const = 0; mutable std::string m_cachedToString; }; #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wnon-virtual-dtor" #endif template struct MatcherMethod { virtual bool match(ObjectT const& arg) const = 0; }; #ifdef __clang__ #pragma clang diagnostic pop #endif template struct MatcherBase : MatcherUntypedBase, MatcherMethod { MatchAllOf operator&&(MatcherBase const& other) const; MatchAnyOf operator||(MatcherBase const& other) const; MatchNotOf operator!() const; }; template struct MatchAllOf : MatcherBase { bool match(ArgT const& arg) const override { for (auto matcher : m_matchers) { if (!matcher->match(arg)) return false; } return true; } std::string describe() const override { std::string description; description.reserve(4 + m_matchers.size() * 32); description += "( "; bool first = true; for (auto matcher : m_matchers) { if (first) first = false; else description += " and "; description += matcher->toString(); } description += " )"; return description; } MatchAllOf& operator&&(MatcherBase const& other) { m_matchers.push_back(&other); return *this; } std::vector const*> m_matchers; }; template struct MatchAnyOf : MatcherBase { bool match(ArgT const& arg) const override { for (auto matcher : m_matchers) { if (matcher->match(arg)) return true; } return false; } std::string describe() const override { std::string description; description.reserve(4 + m_matchers.size() * 32); description += "( "; bool first = true; for (auto matcher : m_matchers) { if (first) first = false; else description += " or "; description += matcher->toString(); } description += " )"; return description; } MatchAnyOf& operator||(MatcherBase const& other) { m_matchers.push_back(&other); return *this; } std::vector const*> m_matchers; }; template struct MatchNotOf : MatcherBase { MatchNotOf(MatcherBase const& underlyingMatcher) : m_underlyingMatcher(underlyingMatcher) {} bool match(ArgT const& arg) const override { return !m_underlyingMatcher.match(arg); } std::string describe() const override { return "not " + m_underlyingMatcher.toString(); } MatcherBase const& m_underlyingMatcher; }; template MatchAllOf MatcherBase::operator&&(MatcherBase const& other) const { return MatchAllOf() && *this && other; } template MatchAnyOf MatcherBase::operator||(MatcherBase const& other) const { return MatchAnyOf() || *this || other; } template MatchNotOf MatcherBase::operator!() const { return MatchNotOf(*this); } } // namespace Impl } // namespace Matchers using namespace Matchers; using Matchers::Impl::MatcherBase; } // namespace Catch // end catch_matchers.h // start catch_matchers_floating.h #include #include namespace Catch { namespace Matchers { namespace Floating { enum class FloatingPointKind : uint8_t; struct WithinAbsMatcher : MatcherBase { WithinAbsMatcher(double target, double margin); bool match(double const& matchee) const override; std::string describe() const override; private: double m_target; double m_margin; }; struct WithinUlpsMatcher : MatcherBase { WithinUlpsMatcher(double target, int ulps, FloatingPointKind baseType); bool match(double const& matchee) const override; std::string describe() const override; private: double m_target; int m_ulps; FloatingPointKind m_type; }; } // namespace Floating // The following functions create the actual matcher objects. // This allows the types to be inferred Floating::WithinUlpsMatcher WithinULP(double target, int maxUlpDiff); Floating::WithinUlpsMatcher WithinULP(float target, int maxUlpDiff); Floating::WithinAbsMatcher WithinAbs(double target, double margin); } // namespace Matchers } // namespace Catch // end catch_matchers_floating.h // start catch_matchers_generic.hpp #include #include namespace Catch { namespace Matchers { namespace Generic { namespace Detail { std::string finalizeDescription(const std::string& desc); } template class PredicateMatcher : public MatcherBase { std::function m_predicate; std::string m_description; public: PredicateMatcher(std::function const& elem, std::string const& descr) : m_predicate(std::move(elem)), m_description(Detail::finalizeDescription(descr)) {} bool match(T const& item) const override { return m_predicate(item); } std::string describe() const override { return m_description; } }; } // namespace Generic // The following functions create the actual matcher objects. // The user has to explicitly specify type to the function, because // inferring std::function is hard (but possible) and // requires a lot of TMP. template Generic::PredicateMatcher Predicate( std::function const& predicate, std::string const& description = "") { return Generic::PredicateMatcher(predicate, description); } } // namespace Matchers } // namespace Catch // end catch_matchers_generic.hpp // start catch_matchers_string.h #include namespace Catch { namespace Matchers { namespace StdString { struct CasedString { CasedString(std::string const& str, CaseSensitive::Choice caseSensitivity); std::string adjustString(std::string const& str) const; std::string caseSensitivitySuffix() const; CaseSensitive::Choice m_caseSensitivity; std::string m_str; }; struct StringMatcherBase : MatcherBase { StringMatcherBase(std::string const& operation, CasedString const& comparator); std::string describe() const override; CasedString m_comparator; std::string m_operation; }; struct EqualsMatcher : StringMatcherBase { EqualsMatcher(CasedString const& comparator); bool match(std::string const& source) const override; }; struct ContainsMatcher : StringMatcherBase { ContainsMatcher(CasedString const& comparator); bool match(std::string const& source) const override; }; struct StartsWithMatcher : StringMatcherBase { StartsWithMatcher(CasedString const& comparator); bool match(std::string const& source) const override; }; struct EndsWithMatcher : StringMatcherBase { EndsWithMatcher(CasedString const& comparator); bool match(std::string const& source) const override; }; struct RegexMatcher : MatcherBase { RegexMatcher(std::string regex, CaseSensitive::Choice caseSensitivity); bool match(std::string const& matchee) const override; std::string describe() const override; private: std::string m_regex; CaseSensitive::Choice m_caseSensitivity; }; } // namespace StdString // The following functions create the actual matcher objects. // This allows the types to be inferred StdString::EqualsMatcher Equals( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes); StdString::ContainsMatcher Contains( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes); StdString::EndsWithMatcher EndsWith( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes); StdString::StartsWithMatcher StartsWith( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes); StdString::RegexMatcher Matches( std::string const& regex, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes); } // namespace Matchers } // namespace Catch // end catch_matchers_string.h // start catch_matchers_vector.h #include namespace Catch { namespace Matchers { namespace Vector { namespace Detail { template size_t count(InputIterator first, InputIterator last, T const& item) { size_t cnt = 0; for (; first != last; ++first) { if (*first == item) { ++cnt; } } return cnt; } template bool contains(InputIterator first, InputIterator last, T const& item) { for (; first != last; ++first) { if (*first == item) { return true; } } return false; } } // namespace Detail template struct ContainsElementMatcher : MatcherBase> { ContainsElementMatcher(T const& comparator) : m_comparator(comparator) {} bool match(std::vector const& v) const override { for (auto const& el : v) { if (el == m_comparator) { return true; } } return false; } std::string describe() const override { return "Contains: " + ::Catch::Detail::stringify(m_comparator); } T const& m_comparator; }; template struct ContainsMatcher : MatcherBase> { ContainsMatcher(std::vector const& comparator) : m_comparator(comparator) {} bool match(std::vector const& v) const override { // !TBD: see note in EqualsMatcher if (m_comparator.size() > v.size()) return false; for (auto const& comparator : m_comparator) { auto present = false; for (const auto& el : v) { if (el == comparator) { present = true; break; } } if (!present) { return false; } } return true; } std::string describe() const override { return "Contains: " + ::Catch::Detail::stringify(m_comparator); } std::vector const& m_comparator; }; template struct EqualsMatcher : MatcherBase> { EqualsMatcher(std::vector const& comparator) : m_comparator(comparator) {} bool match(std::vector const& v) const override { // !TBD: This currently works if all elements can be compared using != // - a more general approach would be via a compare template that defaults // to using !=. but could be specialised for, e.g. std::vector etc // - then just call that directly if (m_comparator.size() != v.size()) return false; for (std::size_t i = 0; i < v.size(); ++i) if (m_comparator[i] != v[i]) return false; return true; } std::string describe() const override { return "Equals: " + ::Catch::Detail::stringify(m_comparator); } std::vector const& m_comparator; }; template struct UnorderedEqualsMatcher : MatcherBase> { UnorderedEqualsMatcher(std::vector const& target) : m_target(target) {} bool match(std::vector const& vec) const override { // Note: This is a reimplementation of std::is_permutation, // because I don't want to include inside the common path if (m_target.size() != vec.size()) { return false; } auto lfirst = m_target.begin(), llast = m_target.end(); auto rfirst = vec.begin(), rlast = vec.end(); // Cut common prefix to optimize checking of permuted parts while (lfirst != llast && *lfirst == *rfirst) { ++lfirst; ++rfirst; } if (lfirst == llast) { return true; } for (auto mid = lfirst; mid != llast; ++mid) { // Skip already counted items if (Detail::contains(lfirst, mid, *mid)) { continue; } size_t num_vec = Detail::count(rfirst, rlast, *mid); if (num_vec == 0 || Detail::count(lfirst, llast, *mid) != num_vec) { return false; } } return true; } std::string describe() const override { return "UnorderedEquals: " + ::Catch::Detail::stringify(m_target); } private: std::vector const& m_target; }; } // namespace Vector // The following functions create the actual matcher objects. // This allows the types to be inferred template Vector::ContainsMatcher Contains(std::vector const& comparator) { return Vector::ContainsMatcher(comparator); } template Vector::ContainsElementMatcher VectorContains(T const& comparator) { return Vector::ContainsElementMatcher(comparator); } template Vector::EqualsMatcher Equals(std::vector const& comparator) { return Vector::EqualsMatcher(comparator); } template Vector::UnorderedEqualsMatcher UnorderedEquals( std::vector const& target) { return Vector::UnorderedEqualsMatcher(target); } } // namespace Matchers } // namespace Catch // end catch_matchers_vector.h namespace Catch { template class MatchExpr : public ITransientExpression { ArgT const& m_arg; MatcherT m_matcher; StringRef m_matcherString; public: MatchExpr(ArgT const& arg, MatcherT const& matcher, StringRef const& matcherString) : ITransientExpression{true, matcher.match(arg)}, m_arg(arg), m_matcher(matcher), m_matcherString(matcherString) {} void streamReconstructedExpression(std::ostream& os) const override { auto matcherAsString = m_matcher.toString(); os << Catch::Detail::stringify(m_arg) << ' '; if (matcherAsString == Detail::unprintableString) os << m_matcherString; else os << matcherAsString; } }; using StringMatcher = Matchers::Impl::MatcherBase; void handleExceptionMatchExpr(AssertionHandler& handler, StringMatcher const& matcher, StringRef const& matcherString); template auto makeMatchExpr(ArgT const& arg, MatcherT const& matcher, StringRef const& matcherString) -> MatchExpr { return MatchExpr(arg, matcher, matcherString); } } // namespace Catch /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CHECK_THAT(macroName, matcher, resultDisposition, arg) \ do { \ Catch::AssertionHandler catchAssertionHandler( \ macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, \ CATCH_INTERNAL_STRINGIFY(arg) ", " CATCH_INTERNAL_STRINGIFY(matcher), \ resultDisposition); \ INTERNAL_CATCH_TRY { \ catchAssertionHandler.handleExpr( \ Catch::makeMatchExpr(arg, matcher, #matcher##_catch_sr)); \ } \ INTERNAL_CATCH_CATCH(catchAssertionHandler) \ INTERNAL_CATCH_REACT(catchAssertionHandler) \ } while (false) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_THROWS_MATCHES(macroName, exceptionType, \ resultDisposition, matcher, ...) \ do { \ Catch::AssertionHandler catchAssertionHandler( \ macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, \ CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY( \ exceptionType) ", " CATCH_INTERNAL_STRINGIFY(matcher), \ resultDisposition); \ if (catchAssertionHandler.allowThrows()) try { \ static_cast(__VA_ARGS__); \ catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \ } catch (exceptionType const& ex) { \ catchAssertionHandler.handleExpr( \ Catch::makeMatchExpr(ex, matcher, #matcher##_catch_sr)); \ } catch (...) { \ catchAssertionHandler.handleUnexpectedInflightException(); \ } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ INTERNAL_CATCH_REACT(catchAssertionHandler) \ } while (false) // end catch_capture_matchers.h #endif // start catch_generators.hpp // start catch_interfaces_generatortracker.h #include namespace Catch { namespace Generators { class GeneratorBase { protected: size_t m_size = 0; public: GeneratorBase(size_t size) : m_size(size) {} virtual ~GeneratorBase(); auto size() const -> size_t { return m_size; } }; using GeneratorBasePtr = std::unique_ptr; } // namespace Generators struct IGeneratorTracker { virtual ~IGeneratorTracker(); virtual auto hasGenerator() const -> bool = 0; virtual auto getGenerator() const -> Generators::GeneratorBasePtr const& = 0; virtual void setGenerator(Generators::GeneratorBasePtr&& generator) = 0; virtual auto getIndex() const -> std::size_t = 0; }; } // namespace Catch // end catch_interfaces_generatortracker.h // start catch_enforce.h #include namespace Catch { #if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) template [[noreturn]] void throw_exception(Ex const& e) { throw e; } #else // ^^ Exceptions are enabled // Exceptions are disabled vv [[noreturn]] void throw_exception(std::exception const& e); #endif } // namespace Catch #define CATCH_PREPARE_EXCEPTION(type, msg) \ type((Catch::ReusableStringStream() << msg).str()) #define CATCH_INTERNAL_ERROR(msg) \ Catch::throw_exception(CATCH_PREPARE_EXCEPTION( \ std::logic_error, \ CATCH_INTERNAL_LINEINFO << ": Internal Catch error: " << msg)) #define CATCH_ERROR(msg) \ Catch::throw_exception(CATCH_PREPARE_EXCEPTION(std::domain_error, msg)) #define CATCH_RUNTIME_ERROR(msg) \ Catch::throw_exception(CATCH_PREPARE_EXCEPTION(std::runtime_error, msg)) #define CATCH_ENFORCE(condition, msg) \ do { \ if (!(condition)) CATCH_ERROR(msg); \ } while (false) // end catch_enforce.h #include #include #include #include namespace Catch { namespace Generators { // !TBD move this into its own location? namespace pf { template std::unique_ptr make_unique(Args&&... args) { return std::unique_ptr(new T(std::forward(args)...)); } } // namespace pf template struct IGenerator { virtual ~IGenerator() {} virtual auto get(size_t index) const -> T = 0; }; template class SingleValueGenerator : public IGenerator { T m_value; public: SingleValueGenerator(T const& value) : m_value(value) {} auto get(size_t) const -> T override { return m_value; } }; template class FixedValuesGenerator : public IGenerator { std::vector m_values; public: FixedValuesGenerator(std::initializer_list values) : m_values(values) {} auto get(size_t index) const -> T override { return m_values[index]; } }; template class RangeGenerator : public IGenerator { T const m_first; T const m_last; public: RangeGenerator(T const& first, T const& last) : m_first(first), m_last(last) { assert(m_last > m_first); } auto get(size_t index) const -> T override { // ToDo:: introduce a safe cast to catch potential overflows return static_cast(m_first + index); } }; template struct NullGenerator : IGenerator { auto get(size_t) const -> T override { CATCH_INTERNAL_ERROR("A Null Generator is always empty"); } }; template class Generator { std::unique_ptr> m_generator; size_t m_size; public: Generator(size_t size, std::unique_ptr> generator) : m_generator(std::move(generator)), m_size(size) {} auto size() const -> size_t { return m_size; } auto operator[](size_t index) const -> T { assert(index < m_size); return m_generator->get(index); } }; std::vector randomiseIndices(size_t selectionSize, size_t sourceSize); template class GeneratorRandomiser : public IGenerator { Generator m_baseGenerator; std::vector m_indices; public: GeneratorRandomiser(Generator&& baseGenerator, size_t numberOfItems) : m_baseGenerator(std::move(baseGenerator)), m_indices(randomiseIndices(numberOfItems, m_baseGenerator.size())) {} auto get(size_t index) const -> T override { return m_baseGenerator[m_indices[index]]; } }; template struct RequiresASpecialisationFor; template auto all() -> Generator { return RequiresASpecialisationFor(); } template <> auto all() -> Generator; template auto range(T const& first, T const& last) -> Generator { return Generator((last - first), pf::make_unique>(first, last)); } template auto random(T const& first, T const& last) -> Generator { auto gen = range(first, last); auto size = gen.size(); return Generator( size, pf::make_unique>(std::move(gen), size)); } template auto random(size_t size) -> Generator { return Generator(size, pf::make_unique>(all(), size)); } template auto values(std::initializer_list values) -> Generator { return Generator(values.size(), pf::make_unique>(values)); } template auto value(T const& val) -> Generator { return Generator(1, pf::make_unique>(val)); } template auto as() -> Generator { return Generator(0, pf::make_unique>()); } template auto table(std::initializer_list>&& tuples) -> Generator> { return values>( std::forward>>(tuples)); } template struct Generators : GeneratorBase { std::vector> m_generators; using type = T; Generators() : GeneratorBase(0) {} void populate(T&& val) { m_size += 1; m_generators.emplace_back(value(std::move(val))); } template void populate(U&& val) { populate(T(std::move(val))); } void populate(Generator&& generator) { m_size += generator.size(); m_generators.emplace_back(std::move(generator)); } template void populate(U&& valueOrGenerator, Gs... moreGenerators) { populate(std::forward(valueOrGenerator)); populate(std::forward(moreGenerators)...); } auto operator[](size_t index) const -> T { size_t sizes = 0; for (auto const& gen : m_generators) { auto localIndex = index - sizes; sizes += gen.size(); if (index < sizes) return gen[localIndex]; } CATCH_INTERNAL_ERROR("Index '" << index << "' is out of range (" << sizes << ')'); } }; template auto makeGenerators(Generator&& generator, Gs... moreGenerators) -> Generators { Generators generators; generators.m_generators.reserve(1 + sizeof...(Gs)); generators.populate(std::move(generator), std::forward(moreGenerators)...); return generators; } template auto makeGenerators(Generator&& generator) -> Generators { Generators generators; generators.populate(std::move(generator)); return generators; } template auto makeGenerators(T&& val, Gs... moreGenerators) -> Generators { return makeGenerators(value(std::forward(val)), std::forward(moreGenerators)...); } template auto makeGenerators(U&& val, Gs... moreGenerators) -> Generators { return makeGenerators(value(T(std::forward(val))), std::forward(moreGenerators)...); } auto acquireGeneratorTracker(SourceLineInfo const& lineInfo) -> IGeneratorTracker&; template // Note: The type after -> is weird, because VS2015 cannot parse // the expression used in the typedef inside, when it is in // return type. Yeah, ¯\_(ツ)_/¯ auto generate(SourceLineInfo const& lineInfo, L const& generatorExpression) -> decltype(std::declval()[0]) { using UnderlyingType = typename decltype(generatorExpression())::type; IGeneratorTracker& tracker = acquireGeneratorTracker(lineInfo); if (!tracker.hasGenerator()) tracker.setGenerator( pf::make_unique>(generatorExpression())); auto const& generator = static_cast const&>(*tracker.getGenerator()); return generator[tracker.getIndex()]; } } // namespace Generators } // namespace Catch #define GENERATE(...) \ Catch::Generators::generate(CATCH_INTERNAL_LINEINFO, [] { \ using namespace Catch::Generators; \ return makeGenerators(__VA_ARGS__); \ }) // end catch_generators.hpp // These files are included here so the single_include script doesn't put them // in the conditionally compiled sections // start catch_test_case_info.h #include #include #include #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpadded" #endif namespace Catch { struct ITestInvoker; struct TestCaseInfo { enum SpecialProperties { None = 0, IsHidden = 1 << 1, ShouldFail = 1 << 2, MayFail = 1 << 3, Throws = 1 << 4, NonPortable = 1 << 5, Benchmark = 1 << 6 }; TestCaseInfo(std::string const& _name, std::string const& _className, std::string const& _description, std::vector const& _tags, SourceLineInfo const& _lineInfo); friend void setTags(TestCaseInfo& testCaseInfo, std::vector tags); bool isHidden() const; bool throws() const; bool okToFail() const; bool expectedToFail() const; std::string tagsAsString() const; std::string name; std::string className; std::string description; std::vector tags; std::vector lcaseTags; SourceLineInfo lineInfo; SpecialProperties properties; }; class TestCase : public TestCaseInfo { public: TestCase(ITestInvoker* testCase, TestCaseInfo&& info); TestCase withName(std::string const& _newName) const; void invoke() const; TestCaseInfo const& getTestCaseInfo() const; bool operator==(TestCase const& other) const; bool operator<(TestCase const& other) const; private: std::shared_ptr test; }; TestCase makeTestCase(ITestInvoker* testCase, std::string const& className, NameAndTags const& nameAndTags, SourceLineInfo const& lineInfo); } // namespace Catch #ifdef __clang__ #pragma clang diagnostic pop #endif // end catch_test_case_info.h // start catch_interfaces_runner.h namespace Catch { struct IRunner { virtual ~IRunner(); virtual bool aborting() const = 0; }; } // namespace Catch // end catch_interfaces_runner.h #ifdef __OBJC__ // start catch_objc.hpp #import #include // NB. Any general catch headers included here must be included // in catch.hpp first to make sure they are included by the single // header for non obj-usage /////////////////////////////////////////////////////////////////////////////// // This protocol is really only here for (self) documenting purposes, since // all its methods are optional. @protocol OcFixture @optional - (void)setUp; - (void)tearDown; @end namespace Catch { class OcMethod : public ITestInvoker { public: OcMethod(Class cls, SEL sel) : m_cls(cls), m_sel(sel) {} virtual void invoke() const { id obj = [[m_cls alloc] init]; performOptionalSelector(obj, @selector(setUp)); performOptionalSelector(obj, m_sel); performOptionalSelector(obj, @selector(tearDown)); arcSafeRelease(obj); } private: virtual ~OcMethod() {} Class m_cls; SEL m_sel; }; namespace Detail { inline std::string getAnnotation(Class cls, std::string const& annotationName, std::string const& testCaseName) { NSString* selStr = [[NSString alloc] initWithFormat:@"Catch_%s_%s", annotationName.c_str(), testCaseName.c_str()]; SEL sel = NSSelectorFromString(selStr); arcSafeRelease(selStr); id value = performOptionalSelector(cls, sel); if (value) return [(NSString*)value UTF8String]; return ""; } } // namespace Detail inline std::size_t registerTestMethods() { std::size_t noTestMethods = 0; int noClasses = objc_getClassList(nullptr, 0); Class* classes = (CATCH_UNSAFE_UNRETAINED Class*)malloc(sizeof(Class) * noClasses); objc_getClassList(classes, noClasses); for (int c = 0; c < noClasses; c++) { Class cls = classes[c]; { u_int count; Method* methods = class_copyMethodList(cls, &count); for (u_int m = 0; m < count; m++) { SEL selector = method_getName(methods[m]); std::string methodName = sel_getName(selector); if (startsWith(methodName, "Catch_TestCase_")) { std::string testCaseName = methodName.substr(15); std::string name = Detail::getAnnotation(cls, "Name", testCaseName); std::string desc = Detail::getAnnotation(cls, "Description", testCaseName); const char* className = class_getName(cls); getMutableRegistryHub().registerTest(makeTestCase( new OcMethod(cls, selector), className, NameAndTags(name.c_str(), desc.c_str()), SourceLineInfo("", 0))); noTestMethods++; } } free(methods); } } return noTestMethods; } #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) namespace Matchers { namespace Impl { namespace NSStringMatchers { struct StringHolder : MatcherBase { StringHolder(NSString* substr) : m_substr([substr copy]) {} StringHolder(StringHolder const& other) : m_substr([other.m_substr copy]) {} StringHolder() { arcSafeRelease(m_substr); } bool match(NSString* arg) const override { return false; } NSString* CATCH_ARC_STRONG m_substr; }; struct Equals : StringHolder { Equals(NSString* substr) : StringHolder(substr) {} bool match(NSString* str) const override { return (str != nil || m_substr == nil) && [str isEqualToString:m_substr]; } std::string describe() const override { return "equals string: " + Catch::Detail::stringify(m_substr); } }; struct Contains : StringHolder { Contains(NSString* substr) : StringHolder(substr) {} bool match(NSString* str) const { return (str != nil || m_substr == nil) && [str rangeOfString:m_substr].location != NSNotFound; } std::string describe() const override { return "contains string: " + Catch::Detail::stringify(m_substr); } }; struct StartsWith : StringHolder { StartsWith(NSString* substr) : StringHolder(substr) {} bool match(NSString* str) const override { return (str != nil || m_substr == nil) && [str rangeOfString:m_substr].location == 0; } std::string describe() const override { return "starts with: " + Catch::Detail::stringify(m_substr); } }; struct EndsWith : StringHolder { EndsWith(NSString* substr) : StringHolder(substr) {} bool match(NSString* str) const override { return (str != nil || m_substr == nil) && [str rangeOfString:m_substr].location == [str length] - [m_substr length]; } std::string describe() const override { return "ends with: " + Catch::Detail::stringify(m_substr); } }; } // namespace NSStringMatchers } // namespace Impl inline Impl::NSStringMatchers::Equals Equals(NSString* substr) { return Impl::NSStringMatchers::Equals(substr); } inline Impl::NSStringMatchers::Contains Contains(NSString* substr) { return Impl::NSStringMatchers::Contains(substr); } inline Impl::NSStringMatchers::StartsWith StartsWith(NSString* substr) { return Impl::NSStringMatchers::StartsWith(substr); } inline Impl::NSStringMatchers::EndsWith EndsWith(NSString* substr) { return Impl::NSStringMatchers::EndsWith(substr); } } // namespace Matchers using namespace Matchers; #endif // CATCH_CONFIG_DISABLE_MATCHERS } // namespace Catch /////////////////////////////////////////////////////////////////////////////// #define OC_MAKE_UNIQUE_NAME(root, uniqueSuffix) root##uniqueSuffix #define OC_TEST_CASE2(name, desc, uniqueSuffix) \ +(NSString*)OC_MAKE_UNIQUE_NAME(Catch_Name_test_, uniqueSuffix) { \ return @name; \ } \ +(NSString*)OC_MAKE_UNIQUE_NAME(Catch_Description_test_, uniqueSuffix) { \ return @desc; \ } \ -(void)OC_MAKE_UNIQUE_NAME(Catch_TestCase_test_, uniqueSuffix) #define OC_TEST_CASE(name, desc) OC_TEST_CASE2(name, desc, __LINE__) // end catch_objc.hpp #endif #ifdef CATCH_CONFIG_EXTERNAL_INTERFACES // start catch_external_interfaces.h // start catch_reporter_bases.hpp // start catch_interfaces_reporter.h // start catch_config.hpp // start catch_test_spec_parser.h #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpadded" #endif // start catch_test_spec.h #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpadded" #endif // start catch_wildcard_pattern.h namespace Catch { class WildcardPattern { enum WildcardPosition { NoWildcard = 0, WildcardAtStart = 1, WildcardAtEnd = 2, WildcardAtBothEnds = WildcardAtStart | WildcardAtEnd }; public: WildcardPattern(std::string const& pattern, CaseSensitive::Choice caseSensitivity); virtual ~WildcardPattern() = default; virtual bool matches(std::string const& str) const; private: std::string adjustCase(std::string const& str) const; CaseSensitive::Choice m_caseSensitivity; WildcardPosition m_wildcard = NoWildcard; std::string m_pattern; }; } // namespace Catch // end catch_wildcard_pattern.h #include #include #include namespace Catch { class TestSpec { struct Pattern { virtual ~Pattern(); virtual bool matches(TestCaseInfo const& testCase) const = 0; }; using PatternPtr = std::shared_ptr; class NamePattern : public Pattern { public: NamePattern(std::string const& name); virtual ~NamePattern(); virtual bool matches(TestCaseInfo const& testCase) const override; private: WildcardPattern m_wildcardPattern; }; class TagPattern : public Pattern { public: TagPattern(std::string const& tag); virtual ~TagPattern(); virtual bool matches(TestCaseInfo const& testCase) const override; private: std::string m_tag; }; class ExcludedPattern : public Pattern { public: ExcludedPattern(PatternPtr const& underlyingPattern); virtual ~ExcludedPattern(); virtual bool matches(TestCaseInfo const& testCase) const override; private: PatternPtr m_underlyingPattern; }; struct Filter { std::vector m_patterns; bool matches(TestCaseInfo const& testCase) const; }; public: bool hasFilters() const; bool matches(TestCaseInfo const& testCase) const; private: std::vector m_filters; friend class TestSpecParser; }; } // namespace Catch #ifdef __clang__ #pragma clang diagnostic pop #endif // end catch_test_spec.h // start catch_interfaces_tag_alias_registry.h #include namespace Catch { struct TagAlias; struct ITagAliasRegistry { virtual ~ITagAliasRegistry(); // Nullptr if not present virtual TagAlias const* find(std::string const& alias) const = 0; virtual std::string expandAliases( std::string const& unexpandedTestSpec) const = 0; static ITagAliasRegistry const& get(); }; } // end namespace Catch // end catch_interfaces_tag_alias_registry.h namespace Catch { class TestSpecParser { enum Mode { None, Name, QuotedName, Tag, EscapedName }; Mode m_mode = None; bool m_exclusion = false; std::size_t m_start = std::string::npos, m_pos = 0; std::string m_arg; std::vector m_escapeChars; TestSpec::Filter m_currentFilter; TestSpec m_testSpec; ITagAliasRegistry const* m_tagAliases = nullptr; public: TestSpecParser(ITagAliasRegistry const& tagAliases); TestSpecParser& parse(std::string const& arg); TestSpec testSpec(); private: void visitChar(char c); void startNewMode(Mode mode, std::size_t start); void escape(); std::string subString() const; template void addPattern() { std::string token = subString(); for (std::size_t i = 0; i < m_escapeChars.size(); ++i) token = token.substr(0, m_escapeChars[i] - m_start - i) + token.substr(m_escapeChars[i] - m_start - i + 1); m_escapeChars.clear(); if (startsWith(token, "exclude:")) { m_exclusion = true; token = token.substr(8); } if (!token.empty()) { TestSpec::PatternPtr pattern = std::make_shared(token); if (m_exclusion) pattern = std::make_shared(pattern); m_currentFilter.m_patterns.push_back(pattern); } m_exclusion = false; m_mode = None; } void addFilter(); }; TestSpec parseTestSpec(std::string const& arg); } // namespace Catch #ifdef __clang__ #pragma clang diagnostic pop #endif // end catch_test_spec_parser.h // start catch_interfaces_config.h #include #include #include #include namespace Catch { enum class Verbosity { Quiet = 0, Normal, High }; struct WarnAbout { enum What { Nothing = 0x00, NoAssertions = 0x01, NoTests = 0x02 }; }; struct ShowDurations { enum OrNot { DefaultForReporter, Always, Never }; }; struct RunTests { enum InWhatOrder { InDeclarationOrder, InLexicographicalOrder, InRandomOrder }; }; struct UseColour { enum YesOrNo { Auto, Yes, No }; }; struct WaitForKeypress { enum When { Never, BeforeStart = 1, BeforeExit = 2, BeforeStartAndExit = BeforeStart | BeforeExit }; }; class TestSpec; struct IConfig : NonCopyable { virtual ~IConfig(); virtual bool allowThrows() const = 0; virtual std::ostream& stream() const = 0; virtual std::string name() const = 0; virtual bool includeSuccessfulResults() const = 0; virtual bool shouldDebugBreak() const = 0; virtual bool warnAboutMissingAssertions() const = 0; virtual bool warnAboutNoTests() const = 0; virtual int abortAfter() const = 0; virtual bool showInvisibles() const = 0; virtual ShowDurations::OrNot showDurations() const = 0; virtual TestSpec const& testSpec() const = 0; virtual bool hasTestFilters() const = 0; virtual RunTests::InWhatOrder runOrder() const = 0; virtual unsigned int rngSeed() const = 0; virtual int benchmarkResolutionMultiple() const = 0; virtual UseColour::YesOrNo useColour() const = 0; virtual std::vector const& getSectionsToRun() const = 0; virtual Verbosity verbosity() const = 0; }; using IConfigPtr = std::shared_ptr; } // namespace Catch // end catch_interfaces_config.h // Libstdc++ doesn't like incomplete classes for unique_ptr #include #include #include #ifndef CATCH_CONFIG_CONSOLE_WIDTH #define CATCH_CONFIG_CONSOLE_WIDTH 80 #endif namespace Catch { struct IStream; struct ConfigData { bool listTests = false; bool listTags = false; bool listReporters = false; bool listTestNamesOnly = false; bool showSuccessfulTests = false; bool shouldDebugBreak = false; bool noThrow = false; bool showHelp = false; bool showInvisibles = false; bool filenamesAsTags = false; bool libIdentify = false; int abortAfter = -1; unsigned int rngSeed = 0; int benchmarkResolutionMultiple = 100; Verbosity verbosity = Verbosity::Normal; WarnAbout::What warnings = WarnAbout::Nothing; ShowDurations::OrNot showDurations = ShowDurations::DefaultForReporter; RunTests::InWhatOrder runOrder = RunTests::InDeclarationOrder; UseColour::YesOrNo useColour = UseColour::Auto; WaitForKeypress::When waitForKeypress = WaitForKeypress::Never; std::string outputFilename; std::string name; std::string processName; #ifndef CATCH_CONFIG_DEFAULT_REPORTER #define CATCH_CONFIG_DEFAULT_REPORTER "console" #endif std::string reporterName = CATCH_CONFIG_DEFAULT_REPORTER; #undef CATCH_CONFIG_DEFAULT_REPORTER std::vector testsOrTags; std::vector sectionsToRun; }; class Config : public IConfig { public: Config() = default; Config(ConfigData const& data); virtual ~Config() = default; std::string const& getFilename() const; bool listTests() const; bool listTestNamesOnly() const; bool listTags() const; bool listReporters() const; std::string getProcessName() const; std::string const& getReporterName() const; std::vector const& getTestsOrTags() const; std::vector const& getSectionsToRun() const override; virtual TestSpec const& testSpec() const override; bool hasTestFilters() const override; bool showHelp() const; // IConfig interface bool allowThrows() const override; std::ostream& stream() const override; std::string name() const override; bool includeSuccessfulResults() const override; bool warnAboutMissingAssertions() const override; bool warnAboutNoTests() const override; ShowDurations::OrNot showDurations() const override; RunTests::InWhatOrder runOrder() const override; unsigned int rngSeed() const override; int benchmarkResolutionMultiple() const override; UseColour::YesOrNo useColour() const override; bool shouldDebugBreak() const override; int abortAfter() const override; bool showInvisibles() const override; Verbosity verbosity() const override; private: IStream const* openStream(); ConfigData m_data; std::unique_ptr m_stream; TestSpec m_testSpec; bool m_hasTestFilters = false; }; } // end namespace Catch // end catch_config.hpp // start catch_assertionresult.h #include namespace Catch { struct AssertionResultData { AssertionResultData() = delete; AssertionResultData(ResultWas::OfType _resultType, LazyExpression const& _lazyExpression); std::string message; mutable std::string reconstructedExpression; LazyExpression lazyExpression; ResultWas::OfType resultType; std::string reconstructExpression() const; }; class AssertionResult { public: AssertionResult() = delete; AssertionResult(AssertionInfo const& info, AssertionResultData const& data); bool isOk() const; bool succeeded() const; ResultWas::OfType getResultType() const; bool hasExpression() const; bool hasMessage() const; std::string getExpression() const; std::string getExpressionInMacro() const; bool hasExpandedExpression() const; std::string getExpandedExpression() const; std::string getMessage() const; SourceLineInfo getSourceInfo() const; StringRef getTestMacroName() const; // protected: AssertionInfo m_info; AssertionResultData m_resultData; }; } // end namespace Catch // end catch_assertionresult.h // start catch_option.hpp namespace Catch { // An optional type template class Option { public: Option() : nullableValue(nullptr) {} Option(T const& _value) : nullableValue(new (storage) T(_value)) {} Option(Option const& _other) : nullableValue(_other ? new (storage) T(*_other) : nullptr) {} ~Option() { reset(); } Option& operator=(Option const& _other) { if (&_other != this) { reset(); if (_other) nullableValue = new (storage) T(*_other); } return *this; } Option& operator=(T const& _value) { reset(); nullableValue = new (storage) T(_value); return *this; } void reset() { if (nullableValue) nullableValue->~T(); nullableValue = nullptr; } T& operator*() { return *nullableValue; } T const& operator*() const { return *nullableValue; } T* operator->() { return nullableValue; } const T* operator->() const { return nullableValue; } T valueOr(T const& defaultValue) const { return nullableValue ? *nullableValue : defaultValue; } bool some() const { return nullableValue != nullptr; } bool none() const { return nullableValue == nullptr; } bool operator!() const { return nullableValue == nullptr; } explicit operator bool() const { return some(); } private: T* nullableValue; alignas(alignof(T)) char storage[sizeof(T)]; }; } // end namespace Catch // end catch_option.hpp #include #include #include #include #include namespace Catch { struct ReporterConfig { explicit ReporterConfig(IConfigPtr const& _fullConfig); ReporterConfig(IConfigPtr const& _fullConfig, std::ostream& _stream); std::ostream& stream() const; IConfigPtr fullConfig() const; private: std::ostream* m_stream; IConfigPtr m_fullConfig; }; struct ReporterPreferences { bool shouldRedirectStdOut = false; bool shouldReportAllAssertions = false; }; template struct LazyStat : Option { LazyStat& operator=(T const& _value) { Option::operator=(_value); used = false; return *this; } void reset() { Option::reset(); used = false; } bool used = false; }; struct TestRunInfo { TestRunInfo(std::string const& _name); std::string name; }; struct GroupInfo { GroupInfo(std::string const& _name, std::size_t _groupIndex, std::size_t _groupsCount); std::string name; std::size_t groupIndex; std::size_t groupsCounts; }; struct AssertionStats { AssertionStats(AssertionResult const& _assertionResult, std::vector const& _infoMessages, Totals const& _totals); AssertionStats(AssertionStats const&) = default; AssertionStats(AssertionStats&&) = default; AssertionStats& operator=(AssertionStats const&) = default; AssertionStats& operator=(AssertionStats&&) = default; virtual ~AssertionStats(); AssertionResult assertionResult; std::vector infoMessages; Totals totals; }; struct SectionStats { SectionStats(SectionInfo const& _sectionInfo, Counts const& _assertions, double _durationInSeconds, bool _missingAssertions); SectionStats(SectionStats const&) = default; SectionStats(SectionStats&&) = default; SectionStats& operator=(SectionStats const&) = default; SectionStats& operator=(SectionStats&&) = default; virtual ~SectionStats(); SectionInfo sectionInfo; Counts assertions; double durationInSeconds; bool missingAssertions; }; struct TestCaseStats { TestCaseStats(TestCaseInfo const& _testInfo, Totals const& _totals, std::string const& _stdOut, std::string const& _stdErr, bool _aborting); TestCaseStats(TestCaseStats const&) = default; TestCaseStats(TestCaseStats&&) = default; TestCaseStats& operator=(TestCaseStats const&) = default; TestCaseStats& operator=(TestCaseStats&&) = default; virtual ~TestCaseStats(); TestCaseInfo testInfo; Totals totals; std::string stdOut; std::string stdErr; bool aborting; }; struct TestGroupStats { TestGroupStats(GroupInfo const& _groupInfo, Totals const& _totals, bool _aborting); TestGroupStats(GroupInfo const& _groupInfo); TestGroupStats(TestGroupStats const&) = default; TestGroupStats(TestGroupStats&&) = default; TestGroupStats& operator=(TestGroupStats const&) = default; TestGroupStats& operator=(TestGroupStats&&) = default; virtual ~TestGroupStats(); GroupInfo groupInfo; Totals totals; bool aborting; }; struct TestRunStats { TestRunStats(TestRunInfo const& _runInfo, Totals const& _totals, bool _aborting); TestRunStats(TestRunStats const&) = default; TestRunStats(TestRunStats&&) = default; TestRunStats& operator=(TestRunStats const&) = default; TestRunStats& operator=(TestRunStats&&) = default; virtual ~TestRunStats(); TestRunInfo runInfo; Totals totals; bool aborting; }; struct BenchmarkInfo { std::string name; }; struct BenchmarkStats { BenchmarkInfo info; std::size_t iterations; uint64_t elapsedTimeInNanoseconds; }; struct IStreamingReporter { virtual ~IStreamingReporter() = default; // Implementing class must also provide the following static methods: // static std::string getDescription(); // static std::set getSupportedVerbosities() virtual ReporterPreferences getPreferences() const = 0; virtual void noMatchingTestCases(std::string const& spec) = 0; virtual void testRunStarting(TestRunInfo const& testRunInfo) = 0; virtual void testGroupStarting(GroupInfo const& groupInfo) = 0; virtual void testCaseStarting(TestCaseInfo const& testInfo) = 0; virtual void sectionStarting(SectionInfo const& sectionInfo) = 0; // *** experimental *** virtual void benchmarkStarting(BenchmarkInfo const&) {} virtual void assertionStarting(AssertionInfo const& assertionInfo) = 0; // The return value indicates if the messages buffer should be cleared: virtual bool assertionEnded(AssertionStats const& assertionStats) = 0; // *** experimental *** virtual void benchmarkEnded(BenchmarkStats const&) {} virtual void sectionEnded(SectionStats const& sectionStats) = 0; virtual void testCaseEnded(TestCaseStats const& testCaseStats) = 0; virtual void testGroupEnded(TestGroupStats const& testGroupStats) = 0; virtual void testRunEnded(TestRunStats const& testRunStats) = 0; virtual void skipTest(TestCaseInfo const& testInfo) = 0; // Default empty implementation provided virtual void fatalErrorEncountered(StringRef name); virtual bool isMulti() const; }; using IStreamingReporterPtr = std::unique_ptr; struct IReporterFactory { virtual ~IReporterFactory(); virtual IStreamingReporterPtr create(ReporterConfig const& config) const = 0; virtual std::string getDescription() const = 0; }; using IReporterFactoryPtr = std::shared_ptr; struct IReporterRegistry { using FactoryMap = std::map; using Listeners = std::vector; virtual ~IReporterRegistry(); virtual IStreamingReporterPtr create(std::string const& name, IConfigPtr const& config) const = 0; virtual FactoryMap const& getFactories() const = 0; virtual Listeners const& getListeners() const = 0; }; } // end namespace Catch // end catch_interfaces_reporter.h #include #include #include #include #include #include #include namespace Catch { void prepareExpandedExpression(AssertionResult& result); // Returns double formatted as %.3f (format expected on output) std::string getFormattedDuration(double duration); template struct StreamingReporterBase : IStreamingReporter { StreamingReporterBase(ReporterConfig const& _config) : m_config(_config.fullConfig()), stream(_config.stream()) { m_reporterPrefs.shouldRedirectStdOut = false; if (!DerivedT::getSupportedVerbosities().count(m_config->verbosity())) CATCH_ERROR("Verbosity level not supported by this reporter"); } ReporterPreferences getPreferences() const override { return m_reporterPrefs; } static std::set getSupportedVerbosities() { return {Verbosity::Normal}; } ~StreamingReporterBase() override = default; void noMatchingTestCases(std::string const&) override {} void testRunStarting(TestRunInfo const& _testRunInfo) override { currentTestRunInfo = _testRunInfo; } void testGroupStarting(GroupInfo const& _groupInfo) override { currentGroupInfo = _groupInfo; } void testCaseStarting(TestCaseInfo const& _testInfo) override { currentTestCaseInfo = _testInfo; } void sectionStarting(SectionInfo const& _sectionInfo) override { m_sectionStack.push_back(_sectionInfo); } void sectionEnded(SectionStats const& /* _sectionStats */) override { m_sectionStack.pop_back(); } void testCaseEnded(TestCaseStats const& /* _testCaseStats */) override { currentTestCaseInfo.reset(); } void testGroupEnded(TestGroupStats const& /* _testGroupStats */) override { currentGroupInfo.reset(); } void testRunEnded(TestRunStats const& /* _testRunStats */) override { currentTestCaseInfo.reset(); currentGroupInfo.reset(); currentTestRunInfo.reset(); } void skipTest(TestCaseInfo const&) override { // Don't do anything with this by default. // It can optionally be overridden in the derived class. } IConfigPtr m_config; std::ostream& stream; LazyStat currentTestRunInfo; LazyStat currentGroupInfo; LazyStat currentTestCaseInfo; std::vector m_sectionStack; ReporterPreferences m_reporterPrefs; }; template struct CumulativeReporterBase : IStreamingReporter { template struct Node { explicit Node(T const& _value) : value(_value) {} virtual ~Node() {} using ChildNodes = std::vector>; T value; ChildNodes children; }; struct SectionNode { explicit SectionNode(SectionStats const& _stats) : stats(_stats) {} virtual ~SectionNode() = default; bool operator==(SectionNode const& other) const { return stats.sectionInfo.lineInfo == other.stats.sectionInfo.lineInfo; } bool operator==(std::shared_ptr const& other) const { return operator==(*other); } SectionStats stats; using ChildSections = std::vector>; using Assertions = std::vector; ChildSections childSections; Assertions assertions; std::string stdOut; std::string stdErr; }; struct BySectionInfo { BySectionInfo(SectionInfo const& other) : m_other(other) {} BySectionInfo(BySectionInfo const& other) : m_other(other.m_other) {} bool operator()(std::shared_ptr const& node) const { return ((node->stats.sectionInfo.name == m_other.name) && (node->stats.sectionInfo.lineInfo == m_other.lineInfo)); } void operator=(BySectionInfo const&) = delete; private: SectionInfo const& m_other; }; using TestCaseNode = Node; using TestGroupNode = Node; using TestRunNode = Node; CumulativeReporterBase(ReporterConfig const& _config) : m_config(_config.fullConfig()), stream(_config.stream()) { m_reporterPrefs.shouldRedirectStdOut = false; if (!DerivedT::getSupportedVerbosities().count(m_config->verbosity())) CATCH_ERROR("Verbosity level not supported by this reporter"); } ~CumulativeReporterBase() override = default; ReporterPreferences getPreferences() const override { return m_reporterPrefs; } static std::set getSupportedVerbosities() { return {Verbosity::Normal}; } void testRunStarting(TestRunInfo const&) override {} void testGroupStarting(GroupInfo const&) override {} void testCaseStarting(TestCaseInfo const&) override {} void sectionStarting(SectionInfo const& sectionInfo) override { SectionStats incompleteStats(sectionInfo, Counts(), 0, false); std::shared_ptr node; if (m_sectionStack.empty()) { if (!m_rootSection) m_rootSection = std::make_shared(incompleteStats); node = m_rootSection; } else { SectionNode& parentNode = *m_sectionStack.back(); auto it = std::find_if(parentNode.childSections.begin(), parentNode.childSections.end(), BySectionInfo(sectionInfo)); if (it == parentNode.childSections.end()) { node = std::make_shared(incompleteStats); parentNode.childSections.push_back(node); } else node = *it; } m_sectionStack.push_back(node); m_deepestSection = std::move(node); } void assertionStarting(AssertionInfo const&) override {} bool assertionEnded(AssertionStats const& assertionStats) override { assert(!m_sectionStack.empty()); // AssertionResult holds a pointer to a temporary DecomposedExpression, // which getExpandedExpression() calls to build the expression string. // Our section stack copy of the assertionResult will likely outlive the // temporary, so it must be expanded or discarded now to avoid calling // a destroyed object later. prepareExpandedExpression( const_cast(assertionStats.assertionResult)); SectionNode& sectionNode = *m_sectionStack.back(); sectionNode.assertions.push_back(assertionStats); return true; } void sectionEnded(SectionStats const& sectionStats) override { assert(!m_sectionStack.empty()); SectionNode& node = *m_sectionStack.back(); node.stats = sectionStats; m_sectionStack.pop_back(); } void testCaseEnded(TestCaseStats const& testCaseStats) override { auto node = std::make_shared(testCaseStats); assert(m_sectionStack.size() == 0); node->children.push_back(m_rootSection); m_testCases.push_back(node); m_rootSection.reset(); assert(m_deepestSection); m_deepestSection->stdOut = testCaseStats.stdOut; m_deepestSection->stdErr = testCaseStats.stdErr; } void testGroupEnded(TestGroupStats const& testGroupStats) override { auto node = std::make_shared(testGroupStats); node->children.swap(m_testCases); m_testGroups.push_back(node); } void testRunEnded(TestRunStats const& testRunStats) override { auto node = std::make_shared(testRunStats); node->children.swap(m_testGroups); m_testRuns.push_back(node); testRunEndedCumulative(); } virtual void testRunEndedCumulative() = 0; void skipTest(TestCaseInfo const&) override {} IConfigPtr m_config; std::ostream& stream; std::vector m_assertions; std::vector>> m_sections; std::vector> m_testCases; std::vector> m_testGroups; std::vector> m_testRuns; std::shared_ptr m_rootSection; std::shared_ptr m_deepestSection; std::vector> m_sectionStack; ReporterPreferences m_reporterPrefs; }; template char const* getLineOfChars() { static char line[CATCH_CONFIG_CONSOLE_WIDTH] = {0}; if (!*line) { std::memset(line, C, CATCH_CONFIG_CONSOLE_WIDTH - 1); line[CATCH_CONFIG_CONSOLE_WIDTH - 1] = 0; } return line; } struct TestEventListenerBase : StreamingReporterBase { TestEventListenerBase(ReporterConfig const& _config); static std::set getSupportedVerbosities(); void assertionStarting(AssertionInfo const&) override; bool assertionEnded(AssertionStats const&) override; }; } // end namespace Catch // end catch_reporter_bases.hpp // start catch_console_colour.h namespace Catch { struct Colour { enum Code { None = 0, White, Red, Green, Blue, Cyan, Yellow, Grey, Bright = 0x10, BrightRed = Bright | Red, BrightGreen = Bright | Green, LightGrey = Bright | Grey, BrightWhite = Bright | White, BrightYellow = Bright | Yellow, // By intention FileName = LightGrey, Warning = BrightYellow, ResultError = BrightRed, ResultSuccess = BrightGreen, ResultExpectedFailure = Warning, Error = BrightRed, Success = Green, OriginalExpression = Cyan, ReconstructedExpression = BrightYellow, SecondaryText = LightGrey, Headers = White }; // Use constructed object for RAII guard Colour(Code _colourCode); Colour(Colour&& other) noexcept; Colour& operator=(Colour&& other) noexcept; ~Colour(); // Use static method for one-shot changes static void use(Code _colourCode); private: bool m_moved = false; }; std::ostream& operator<<(std::ostream& os, Colour const&); } // end namespace Catch // end catch_console_colour.h // start catch_reporter_registrars.hpp namespace Catch { template class ReporterRegistrar { class ReporterFactory : public IReporterFactory { virtual IStreamingReporterPtr create( ReporterConfig const& config) const override { return std::unique_ptr(new T(config)); } virtual std::string getDescription() const override { return T::getDescription(); } }; public: explicit ReporterRegistrar(std::string const& name) { getMutableRegistryHub().registerReporter( name, std::make_shared()); } }; template class ListenerRegistrar { class ListenerFactory : public IReporterFactory { virtual IStreamingReporterPtr create( ReporterConfig const& config) const override { return std::unique_ptr(new T(config)); } virtual std::string getDescription() const override { return std::string(); } }; public: ListenerRegistrar() { getMutableRegistryHub().registerListener( std::make_shared()); } }; } // namespace Catch #if !defined(CATCH_CONFIG_DISABLE) #define CATCH_REGISTER_REPORTER(name, reporterType) \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ namespace { \ Catch::ReporterRegistrar \ catch_internal_RegistrarFor##reporterType(name); \ } \ CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS #define CATCH_REGISTER_LISTENER(listenerType) \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ namespace { \ Catch::ListenerRegistrar \ catch_internal_RegistrarFor##listenerType; \ } \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS #else // CATCH_CONFIG_DISABLE #define CATCH_REGISTER_REPORTER(name, reporterType) #define CATCH_REGISTER_LISTENER(listenerType) #endif // CATCH_CONFIG_DISABLE // end catch_reporter_registrars.hpp // Allow users to base their work off existing reporters // start catch_reporter_compact.h namespace Catch { struct CompactReporter : StreamingReporterBase { using StreamingReporterBase::StreamingReporterBase; ~CompactReporter() override; static std::string getDescription(); ReporterPreferences getPreferences() const override; void noMatchingTestCases(std::string const& spec) override; void assertionStarting(AssertionInfo const&) override; bool assertionEnded(AssertionStats const& _assertionStats) override; void sectionEnded(SectionStats const& _sectionStats) override; void testRunEnded(TestRunStats const& _testRunStats) override; }; } // end namespace Catch // end catch_reporter_compact.h // start catch_reporter_console.h #if defined(_MSC_VER) #pragma warning(push) #pragma warning(disable : 4061) // Not all labels are EXPLICITLY handled in // switch Note that 4062 (not all labels are // handled and default is missing) is enabled #endif namespace Catch { // Fwd decls struct SummaryColumn; class TablePrinter; struct ConsoleReporter : StreamingReporterBase { std::unique_ptr m_tablePrinter; ConsoleReporter(ReporterConfig const& config); ~ConsoleReporter() override; static std::string getDescription(); void noMatchingTestCases(std::string const& spec) override; void assertionStarting(AssertionInfo const&) override; bool assertionEnded(AssertionStats const& _assertionStats) override; void sectionStarting(SectionInfo const& _sectionInfo) override; void sectionEnded(SectionStats const& _sectionStats) override; void benchmarkStarting(BenchmarkInfo const& info) override; void benchmarkEnded(BenchmarkStats const& stats) override; void testCaseEnded(TestCaseStats const& _testCaseStats) override; void testGroupEnded(TestGroupStats const& _testGroupStats) override; void testRunEnded(TestRunStats const& _testRunStats) override; private: void lazyPrint(); void lazyPrintWithoutClosingBenchmarkTable(); void lazyPrintRunInfo(); void lazyPrintGroupInfo(); void printTestCaseAndSectionHeader(); void printClosedHeader(std::string const& _name); void printOpenHeader(std::string const& _name); // if string has a : in first line will set indent to follow it on // subsequent lines void printHeaderString(std::string const& _string, std::size_t indent = 0); void printTotals(Totals const& totals); void printSummaryRow(std::string const& label, std::vector const& cols, std::size_t row); void printTotalsDivider(Totals const& totals); void printSummaryDivider(); private: bool m_headerPrinted = false; }; } // end namespace Catch #if defined(_MSC_VER) #pragma warning(pop) #endif // end catch_reporter_console.h // start catch_reporter_junit.h // start catch_xmlwriter.h #include namespace Catch { class XmlEncode { public: enum ForWhat { ForTextNodes, ForAttributes }; XmlEncode(std::string const& str, ForWhat forWhat = ForTextNodes); void encodeTo(std::ostream& os) const; friend std::ostream& operator<<(std::ostream& os, XmlEncode const& xmlEncode); private: std::string m_str; ForWhat m_forWhat; }; class XmlWriter { public: class ScopedElement { public: ScopedElement(XmlWriter* writer); ScopedElement(ScopedElement&& other) noexcept; ScopedElement& operator=(ScopedElement&& other) noexcept; ~ScopedElement(); ScopedElement& writeText(std::string const& text, bool indent = true); template ScopedElement& writeAttribute(std::string const& name, T const& attribute) { m_writer->writeAttribute(name, attribute); return *this; } private: mutable XmlWriter* m_writer = nullptr; }; XmlWriter(std::ostream& os = Catch::cout()); ~XmlWriter(); XmlWriter(XmlWriter const&) = delete; XmlWriter& operator=(XmlWriter const&) = delete; XmlWriter& startElement(std::string const& name); ScopedElement scopedElement(std::string const& name); XmlWriter& endElement(); XmlWriter& writeAttribute(std::string const& name, std::string const& attribute); XmlWriter& writeAttribute(std::string const& name, bool attribute); template XmlWriter& writeAttribute(std::string const& name, T const& attribute) { ReusableStringStream rss; rss << attribute; return writeAttribute(name, rss.str()); } XmlWriter& writeText(std::string const& text, bool indent = true); XmlWriter& writeComment(std::string const& text); void writeStylesheetRef(std::string const& url); XmlWriter& writeBlankLine(); void ensureTagClosed(); private: void writeDeclaration(); void newlineIfNecessary(); bool m_tagIsOpen = false; bool m_needsNewline = false; std::vector m_tags; std::string m_indent; std::ostream& m_os; }; } // namespace Catch // end catch_xmlwriter.h namespace Catch { class JunitReporter : public CumulativeReporterBase { public: JunitReporter(ReporterConfig const& _config); ~JunitReporter() override; static std::string getDescription(); void noMatchingTestCases(std::string const& /*spec*/) override; void testRunStarting(TestRunInfo const& runInfo) override; void testGroupStarting(GroupInfo const& groupInfo) override; void testCaseStarting(TestCaseInfo const& testCaseInfo) override; bool assertionEnded(AssertionStats const& assertionStats) override; void testCaseEnded(TestCaseStats const& testCaseStats) override; void testGroupEnded(TestGroupStats const& testGroupStats) override; void testRunEndedCumulative() override; void writeGroup(TestGroupNode const& groupNode, double suiteTime); void writeTestCase(TestCaseNode const& testCaseNode); void writeSection(std::string const& className, std::string const& rootName, SectionNode const& sectionNode); void writeAssertions(SectionNode const& sectionNode); void writeAssertion(AssertionStats const& stats); XmlWriter xml; Timer suiteTimer; std::string stdOutForSuite; std::string stdErrForSuite; unsigned int unexpectedExceptions = 0; bool m_okToFail = false; }; } // end namespace Catch // end catch_reporter_junit.h // start catch_reporter_xml.h namespace Catch { class XmlReporter : public StreamingReporterBase { public: XmlReporter(ReporterConfig const& _config); ~XmlReporter() override; static std::string getDescription(); virtual std::string getStylesheetRef() const; void writeSourceInfo(SourceLineInfo const& sourceInfo); public: // StreamingReporterBase void noMatchingTestCases(std::string const& s) override; void testRunStarting(TestRunInfo const& testInfo) override; void testGroupStarting(GroupInfo const& groupInfo) override; void testCaseStarting(TestCaseInfo const& testInfo) override; void sectionStarting(SectionInfo const& sectionInfo) override; void assertionStarting(AssertionInfo const&) override; bool assertionEnded(AssertionStats const& assertionStats) override; void sectionEnded(SectionStats const& sectionStats) override; void testCaseEnded(TestCaseStats const& testCaseStats) override; void testGroupEnded(TestGroupStats const& testGroupStats) override; void testRunEnded(TestRunStats const& testRunStats) override; private: Timer m_testCaseTimer; XmlWriter m_xml; int m_sectionDepth = 0; }; } // end namespace Catch // end catch_reporter_xml.h // end catch_external_interfaces.h #endif #endif // ! CATCH_CONFIG_IMPL_ONLY #ifdef CATCH_IMPL // start catch_impl.hpp #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wweak-vtables" #endif // Keep these here for external reporters // start catch_test_case_tracker.h #include #include #include namespace Catch { namespace TestCaseTracking { struct NameAndLocation { std::string name; SourceLineInfo location; NameAndLocation(std::string const& _name, SourceLineInfo const& _location); }; struct ITracker; using ITrackerPtr = std::shared_ptr; struct ITracker { virtual ~ITracker(); // static queries virtual NameAndLocation const& nameAndLocation() const = 0; // dynamic queries virtual bool isComplete() const = 0; // Successfully completed or failed virtual bool isSuccessfullyCompleted() const = 0; virtual bool isOpen() const = 0; // Started but not complete virtual bool hasChildren() const = 0; virtual ITracker& parent() = 0; // actions virtual void close() = 0; // Successfully complete virtual void fail() = 0; virtual void markAsNeedingAnotherRun() = 0; virtual void addChild(ITrackerPtr const& child) = 0; virtual ITrackerPtr findChild(NameAndLocation const& nameAndLocation) = 0; virtual void openChild() = 0; // Debug/ checking virtual bool isSectionTracker() const = 0; virtual bool isIndexTracker() const = 0; }; class TrackerContext { enum RunState { NotStarted, Executing, CompletedCycle }; ITrackerPtr m_rootTracker; ITracker* m_currentTracker = nullptr; RunState m_runState = NotStarted; public: static TrackerContext& instance(); ITracker& startRun(); void endRun(); void startCycle(); void completeCycle(); bool completedCycle() const; ITracker& currentTracker(); void setCurrentTracker(ITracker* tracker); }; class TrackerBase : public ITracker { protected: enum CycleState { NotStarted, Executing, ExecutingChildren, NeedsAnotherRun, CompletedSuccessfully, Failed }; using Children = std::vector; NameAndLocation m_nameAndLocation; TrackerContext& m_ctx; ITracker* m_parent; Children m_children; CycleState m_runState = NotStarted; public: TrackerBase(NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent); NameAndLocation const& nameAndLocation() const override; bool isComplete() const override; bool isSuccessfullyCompleted() const override; bool isOpen() const override; bool hasChildren() const override; void addChild(ITrackerPtr const& child) override; ITrackerPtr findChild(NameAndLocation const& nameAndLocation) override; ITracker& parent() override; void openChild() override; bool isSectionTracker() const override; bool isIndexTracker() const override; void open(); void close() override; void fail() override; void markAsNeedingAnotherRun() override; private: void moveToParent(); void moveToThis(); }; class SectionTracker : public TrackerBase { std::vector m_filters; public: SectionTracker(NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent); bool isSectionTracker() const override; static SectionTracker& acquire(TrackerContext& ctx, NameAndLocation const& nameAndLocation); void tryOpen(); void addInitialFilters(std::vector const& filters); void addNextFilters(std::vector const& filters); }; class IndexTracker : public TrackerBase { int m_size; int m_index = -1; public: IndexTracker(NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent, int size); bool isIndexTracker() const override; void close() override; static IndexTracker& acquire(TrackerContext& ctx, NameAndLocation const& nameAndLocation, int size); int index() const; void moveNext(); }; } // namespace TestCaseTracking using TestCaseTracking::IndexTracker; using TestCaseTracking::ITracker; using TestCaseTracking::SectionTracker; using TestCaseTracking::TrackerContext; } // namespace Catch // end catch_test_case_tracker.h // start catch_leak_detector.h namespace Catch { struct LeakDetector { LeakDetector(); ~LeakDetector(); }; } // namespace Catch // end catch_leak_detector.h // Cpp files will be included in the single-header file here // start catch_approx.cpp #include #include namespace { // Performs equivalent check of std::fabs(lhs - rhs) <= margin // But without the subtraction to allow for INFINITY in comparison bool marginComparison(double lhs, double rhs, double margin) { return (lhs + margin >= rhs) && (rhs + margin >= lhs); } } // namespace namespace Catch { namespace Detail { Approx::Approx(double value) : m_epsilon(std::numeric_limits::epsilon() * 100), m_margin(0.0), m_scale(0.0), m_value(value) {} Approx Approx::custom() { return Approx(0); } Approx Approx::operator-() const { auto temp(*this); temp.m_value = -temp.m_value; return temp; } std::string Approx::toString() const { ReusableStringStream rss; rss << "Approx( " << ::Catch::Detail::stringify(m_value) << " )"; return rss.str(); } bool Approx::equalityComparisonImpl(const double other) const { // First try with fixed margin, then compute margin based on epsilon, scale // and Approx's value Thanks to Richard Harris for his help refining the // scaled margin value return marginComparison(m_value, other, m_margin) || marginComparison(m_value, other, m_epsilon * (m_scale + std::fabs(m_value))); } void Approx::setMargin(double margin) { CATCH_ENFORCE(margin >= 0, "Invalid Approx::margin: " << margin << '.' << " Approx::Margin has to be non-negative."); m_margin = margin; } void Approx::setEpsilon(double epsilon) { CATCH_ENFORCE( epsilon >= 0 && epsilon <= 1.0, "Invalid Approx::epsilon: " << epsilon << '.' << " Approx::epsilon has to be in [0, 1]"); m_epsilon = epsilon; } } // end namespace Detail namespace literals { Detail::Approx operator"" _a(long double val) { return Detail::Approx(val); } Detail::Approx operator"" _a(unsigned long long val) { return Detail::Approx(val); } } // end namespace literals std::string StringMaker::convert( Catch::Detail::Approx const& value) { return value.toString(); } } // end namespace Catch // end catch_approx.cpp // start catch_assertionhandler.cpp // start catch_context.h #include namespace Catch { struct IResultCapture; struct IRunner; struct IConfig; struct IMutableContext; using IConfigPtr = std::shared_ptr; struct IContext { virtual ~IContext(); virtual IResultCapture* getResultCapture() = 0; virtual IRunner* getRunner() = 0; virtual IConfigPtr const& getConfig() const = 0; }; struct IMutableContext : IContext { virtual ~IMutableContext(); virtual void setResultCapture(IResultCapture* resultCapture) = 0; virtual void setRunner(IRunner* runner) = 0; virtual void setConfig(IConfigPtr const& config) = 0; private: static IMutableContext* currentContext; friend IMutableContext& getCurrentMutableContext(); friend void cleanUpContext(); static void createContext(); }; inline IMutableContext& getCurrentMutableContext() { if (!IMutableContext::currentContext) IMutableContext::createContext(); return *IMutableContext::currentContext; } inline IContext& getCurrentContext() { return getCurrentMutableContext(); } void cleanUpContext(); } // namespace Catch // end catch_context.h // start catch_debugger.h namespace Catch { bool isDebuggerActive(); } #ifdef CATCH_PLATFORM_MAC #define CATCH_TRAP() __asm__("int $3\n" : :) /* NOLINT */ #elif defined(CATCH_PLATFORM_LINUX) // If we can use inline assembler, do it because this allows us to break // directly at the location of the failing check instead of breaking inside // raise() called from it, i.e. one stack frame below. #if defined(__GNUC__) && (defined(__i386) || defined(__x86_64)) #define CATCH_TRAP() asm volatile("int $3") /* NOLINT */ #else // Fall back to the generic way. #include #define CATCH_TRAP() raise(SIGTRAP) #endif #elif defined(_MSC_VER) #define CATCH_TRAP() __debugbreak() #elif defined(__MINGW32__) extern "C" __declspec(dllimport) void __stdcall DebugBreak(); #define CATCH_TRAP() DebugBreak() #endif #ifdef CATCH_TRAP #define CATCH_BREAK_INTO_DEBUGGER() \ if (Catch::isDebuggerActive()) { CATCH_TRAP(); } #else namespace Catch { inline void doNothing() {} } // namespace Catch #define CATCH_BREAK_INTO_DEBUGGER() Catch::doNothing() #endif // end catch_debugger.h // start catch_run_context.h // start catch_fatal_condition.h // start catch_windows_h_proxy.h #if defined(CATCH_PLATFORM_WINDOWS) #if !defined(NOMINMAX) && !defined(CATCH_CONFIG_NO_NOMINMAX) #define CATCH_DEFINED_NOMINMAX #define NOMINMAX #endif #if !defined(WIN32_LEAN_AND_MEAN) && \ !defined(CATCH_CONFIG_NO_WIN32_LEAN_AND_MEAN) #define CATCH_DEFINED_WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #ifdef __AFXDLL #include #else #include #endif #ifdef CATCH_DEFINED_NOMINMAX #undef NOMINMAX #endif #ifdef CATCH_DEFINED_WIN32_LEAN_AND_MEAN #undef WIN32_LEAN_AND_MEAN #endif #endif // defined(CATCH_PLATFORM_WINDOWS) // end catch_windows_h_proxy.h #if defined(CATCH_CONFIG_WINDOWS_SEH) namespace Catch { struct FatalConditionHandler { static LONG CALLBACK handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo); FatalConditionHandler(); static void reset(); ~FatalConditionHandler(); private: static bool isSet; static ULONG guaranteeSize; static PVOID exceptionHandlerHandle; }; } // namespace Catch #elif defined(CATCH_CONFIG_POSIX_SIGNALS) #include namespace Catch { struct FatalConditionHandler { static bool isSet; static struct sigaction oldSigActions[]; static stack_t oldSigStack; static char altStackMem[]; static void handleSignal(int sig); FatalConditionHandler(); ~FatalConditionHandler(); static void reset(); }; } // namespace Catch #else namespace Catch { struct FatalConditionHandler { void reset(); }; } // namespace Catch #endif // end catch_fatal_condition.h #include namespace Catch { struct IMutableContext; /////////////////////////////////////////////////////////////////////////// class RunContext : public IResultCapture, public IRunner { public: RunContext(RunContext const&) = delete; RunContext& operator=(RunContext const&) = delete; explicit RunContext(IConfigPtr const& _config, IStreamingReporterPtr&& reporter); ~RunContext() override; void testGroupStarting(std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount); void testGroupEnded(std::string const& testSpec, Totals const& totals, std::size_t groupIndex, std::size_t groupsCount); Totals runTest(TestCase const& testCase); IConfigPtr config() const; IStreamingReporter& reporter() const; public: // IResultCapture // Assertion handlers void handleExpr(AssertionInfo const& info, ITransientExpression const& expr, AssertionReaction& reaction) override; void handleMessage(AssertionInfo const& info, ResultWas::OfType resultType, StringRef const& message, AssertionReaction& reaction) override; void handleUnexpectedExceptionNotThrown(AssertionInfo const& info, AssertionReaction& reaction) override; void handleUnexpectedInflightException(AssertionInfo const& info, std::string const& message, AssertionReaction& reaction) override; void handleIncomplete(AssertionInfo const& info) override; void handleNonExpr(AssertionInfo const& info, ResultWas::OfType resultType, AssertionReaction& reaction) override; bool sectionStarted(SectionInfo const& sectionInfo, Counts& assertions) override; void sectionEnded(SectionEndInfo const& endInfo) override; void sectionEndedEarly(SectionEndInfo const& endInfo) override; auto acquireGeneratorTracker(SourceLineInfo const& lineInfo) -> IGeneratorTracker& override; void benchmarkStarting(BenchmarkInfo const& info) override; void benchmarkEnded(BenchmarkStats const& stats) override; void pushScopedMessage(MessageInfo const& message) override; void popScopedMessage(MessageInfo const& message) override; std::string getCurrentTestName() const override; const AssertionResult* getLastResult() const override; void exceptionEarlyReported() override; void handleFatalErrorCondition(StringRef message) override; bool lastAssertionPassed() override; void assertionPassed() override; public: // !TBD We need to do this another way! bool aborting() const final; private: void runCurrentTest(std::string& redirectedCout, std::string& redirectedCerr); void invokeActiveTestCase(); void resetAssertionInfo(); bool testForMissingAssertions(Counts& assertions); void assertionEnded(AssertionResult const& result); void reportExpr(AssertionInfo const& info, ResultWas::OfType resultType, ITransientExpression const* expr, bool negated); void populateReaction(AssertionReaction& reaction); private: void handleUnfinishedSections(); TestRunInfo m_runInfo; IMutableContext& m_context; TestCase const* m_activeTestCase = nullptr; ITracker* m_testCaseTracker; Option m_lastResult; IConfigPtr m_config; Totals m_totals; IStreamingReporterPtr m_reporter; std::vector m_messages; AssertionInfo m_lastAssertionInfo; std::vector m_unfinishedSections; std::vector m_activeSections; TrackerContext m_trackerContext; bool m_lastAssertionPassed = false; bool m_shouldReportUnexpected = true; bool m_includeSuccessfulResults; }; } // end namespace Catch // end catch_run_context.h namespace Catch { namespace { auto operator<<(std::ostream& os, ITransientExpression const& expr) -> std::ostream& { expr.streamReconstructedExpression(os); return os; } } // namespace LazyExpression::LazyExpression(bool isNegated) : m_isNegated(isNegated) {} LazyExpression::LazyExpression(LazyExpression const& other) : m_isNegated(other.m_isNegated) {} LazyExpression::operator bool() const { return m_transientExpression != nullptr; } auto operator<<(std::ostream& os, LazyExpression const& lazyExpr) -> std::ostream& { if (lazyExpr.m_isNegated) os << "!"; if (lazyExpr) { if (lazyExpr.m_isNegated && lazyExpr.m_transientExpression->isBinaryExpression()) os << "(" << *lazyExpr.m_transientExpression << ")"; else os << *lazyExpr.m_transientExpression; } else { os << "{** error - unchecked empty expression requested **}"; } return os; } AssertionHandler::AssertionHandler(StringRef const& macroName, SourceLineInfo const& lineInfo, StringRef capturedExpression, ResultDisposition::Flags resultDisposition) : m_assertionInfo{macroName, lineInfo, capturedExpression, resultDisposition}, m_resultCapture(getResultCapture()) {} void AssertionHandler::handleExpr(ITransientExpression const& expr) { m_resultCapture.handleExpr(m_assertionInfo, expr, m_reaction); } void AssertionHandler::handleMessage(ResultWas::OfType resultType, StringRef const& message) { m_resultCapture.handleMessage(m_assertionInfo, resultType, message, m_reaction); } auto AssertionHandler::allowThrows() const -> bool { return getCurrentContext().getConfig()->allowThrows(); } void AssertionHandler::complete() { setCompleted(); if (m_reaction.shouldDebugBreak) { // If you find your debugger stopping you here then go one level up on the // call-stack for the code that caused it (typically a failed assertion) // (To go back to the test and change execution, jump over the throw, next) CATCH_BREAK_INTO_DEBUGGER(); } if (m_reaction.shouldThrow) { #if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) throw Catch::TestFailureException(); #else CATCH_ERROR("Test failure requires aborting test!"); #endif } } void AssertionHandler::setCompleted() { m_completed = true; } void AssertionHandler::handleUnexpectedInflightException() { m_resultCapture.handleUnexpectedInflightException( m_assertionInfo, Catch::translateActiveException(), m_reaction); } void AssertionHandler::handleExceptionThrownAsExpected() { m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction); } void AssertionHandler::handleExceptionNotThrownAsExpected() { m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction); } void AssertionHandler::handleUnexpectedExceptionNotThrown() { m_resultCapture.handleUnexpectedExceptionNotThrown(m_assertionInfo, m_reaction); } void AssertionHandler::handleThrowingCallSkipped() { m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction); } // This is the overload that takes a string and infers the Equals matcher from // it The more general overload, that takes any string matcher, is in // catch_capture_matchers.cpp void handleExceptionMatchExpr(AssertionHandler& handler, std::string const& str, StringRef const& matcherString) { handleExceptionMatchExpr(handler, Matchers::Equals(str), matcherString); } } // namespace Catch // end catch_assertionhandler.cpp // start catch_assertionresult.cpp namespace Catch { AssertionResultData::AssertionResultData(ResultWas::OfType _resultType, LazyExpression const& _lazyExpression) : lazyExpression(_lazyExpression), resultType(_resultType) {} std::string AssertionResultData::reconstructExpression() const { if (reconstructedExpression.empty()) { if (lazyExpression) { ReusableStringStream rss; rss << lazyExpression; reconstructedExpression = rss.str(); } } return reconstructedExpression; } AssertionResult::AssertionResult(AssertionInfo const& info, AssertionResultData const& data) : m_info(info), m_resultData(data) {} // Result was a success bool AssertionResult::succeeded() const { return Catch::isOk(m_resultData.resultType); } // Result was a success, or failure is suppressed bool AssertionResult::isOk() const { return Catch::isOk(m_resultData.resultType) || shouldSuppressFailure(m_info.resultDisposition); } ResultWas::OfType AssertionResult::getResultType() const { return m_resultData.resultType; } bool AssertionResult::hasExpression() const { return m_info.capturedExpression[0] != 0; } bool AssertionResult::hasMessage() const { return !m_resultData.message.empty(); } std::string AssertionResult::getExpression() const { if (isFalseTest(m_info.resultDisposition)) return "!(" + m_info.capturedExpression + ")"; else return m_info.capturedExpression; } std::string AssertionResult::getExpressionInMacro() const { std::string expr; if (m_info.macroName[0] == 0) expr = m_info.capturedExpression; else { expr.reserve(m_info.macroName.size() + m_info.capturedExpression.size() + 4); expr += m_info.macroName; expr += "( "; expr += m_info.capturedExpression; expr += " )"; } return expr; } bool AssertionResult::hasExpandedExpression() const { return hasExpression() && getExpandedExpression() != getExpression(); } std::string AssertionResult::getExpandedExpression() const { std::string expr = m_resultData.reconstructExpression(); return expr.empty() ? getExpression() : expr; } std::string AssertionResult::getMessage() const { return m_resultData.message; } SourceLineInfo AssertionResult::getSourceInfo() const { return m_info.lineInfo; } StringRef AssertionResult::getTestMacroName() const { return m_info.macroName; } } // end namespace Catch // end catch_assertionresult.cpp // start catch_benchmark.cpp namespace Catch { auto BenchmarkLooper::getResolution() -> uint64_t { return getEstimatedClockResolution() * getCurrentContext().getConfig()->benchmarkResolutionMultiple(); } void BenchmarkLooper::reportStart() { getResultCapture().benchmarkStarting({m_name}); } auto BenchmarkLooper::needsMoreIterations() -> bool { auto elapsed = m_timer.getElapsedNanoseconds(); // Exponentially increasing iterations until we're confident in our timer // resolution if (elapsed < m_resolution) { m_iterationsToRun *= 10; return true; } getResultCapture().benchmarkEnded({{m_name}, m_count, elapsed}); return false; } } // end namespace Catch // end catch_benchmark.cpp // start catch_capture_matchers.cpp namespace Catch { using StringMatcher = Matchers::Impl::MatcherBase; // This is the general overload that takes a any string matcher // There is another overload, in catch_assertionhandler.h/.cpp, that only takes // a string and infers the Equals matcher (so the header does not mention // matchers) void handleExceptionMatchExpr(AssertionHandler& handler, StringMatcher const& matcher, StringRef const& matcherString) { std::string exceptionMessage = Catch::translateActiveException(); MatchExpr expr(exceptionMessage, matcher, matcherString); handler.handleExpr(expr); } } // namespace Catch // end catch_capture_matchers.cpp // start catch_commandline.cpp // start catch_commandline.h // start catch_clara.h // Use Catch's value for console width (store Clara's off to the side, if // present) #ifdef CLARA_CONFIG_CONSOLE_WIDTH #define CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH \ CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH #undef CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH #endif #define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CATCH_CONFIG_CONSOLE_WIDTH - 1 #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wweak-vtables" #pragma clang diagnostic ignored "-Wexit-time-destructors" #pragma clang diagnostic ignored "-Wshadow" #endif // start clara.hpp // Copyright 2017 Two Blue Cubes Ltd. All rights reserved. // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // See https://github.com/philsquared/Clara for more details // Clara v1.1.5 #ifndef CATCH_CLARA_CONFIG_CONSOLE_WIDTH #define CATCH_CLARA_CONFIG_CONSOLE_WIDTH 80 #endif #ifndef CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH #define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH \ CATCH_CLARA_CONFIG_CONSOLE_WIDTH #endif #ifndef CLARA_CONFIG_OPTIONAL_TYPE #ifdef __has_include #if __has_include() && __cplusplus >= 201703L #include #define CLARA_CONFIG_OPTIONAL_TYPE std::optional #endif #endif #endif // ----------- #included from clara_textflow.hpp ----------- // TextFlowCpp // // A single-header library for wrapping and laying out basic text, by Phil Nash // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // This project is hosted at https://github.com/philsquared/textflowcpp #include #include #include #include #ifndef CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH #define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH 80 #endif namespace Catch { namespace clara { namespace TextFlow { inline auto isWhitespace(char c) -> bool { static std::string chars = " \t\n\r"; return chars.find(c) != std::string::npos; } inline auto isBreakableBefore(char c) -> bool { static std::string chars = "[({<|"; return chars.find(c) != std::string::npos; } inline auto isBreakableAfter(char c) -> bool { static std::string chars = "])}>.,:;*+-=&/\\"; return chars.find(c) != std::string::npos; } class Columns; class Column { std::vector m_strings; size_t m_width = CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH; size_t m_indent = 0; size_t m_initialIndent = std::string::npos; public: class iterator { friend Column; Column const& m_column; size_t m_stringIndex = 0; size_t m_pos = 0; size_t m_len = 0; size_t m_end = 0; bool m_suffix = false; iterator(Column const& column, size_t stringIndex) : m_column(column), m_stringIndex(stringIndex) {} auto line() const -> std::string const& { return m_column.m_strings[m_stringIndex]; } auto isBoundary(size_t at) const -> bool { assert(at > 0); assert(at <= line().size()); return at == line().size() || (isWhitespace(line()[at]) && !isWhitespace(line()[at - 1])) || isBreakableBefore(line()[at]) || isBreakableAfter(line()[at - 1]); } void calcLength() { assert(m_stringIndex < m_column.m_strings.size()); m_suffix = false; auto width = m_column.m_width - indent(); m_end = m_pos; while (m_end < line().size() && line()[m_end] != '\n') ++m_end; if (m_end < m_pos + width) { m_len = m_end - m_pos; } else { size_t len = width; while (len > 0 && !isBoundary(m_pos + len)) --len; while (len > 0 && isWhitespace(line()[m_pos + len - 1])) --len; if (len > 0) { m_len = len; } else { m_suffix = true; m_len = width - 1; } } } auto indent() const -> size_t { auto initial = m_pos == 0 && m_stringIndex == 0 ? m_column.m_initialIndent : std::string::npos; return initial == std::string::npos ? m_column.m_indent : initial; } auto addIndentAndSuffix(std::string const& plain) const -> std::string { return std::string(indent(), ' ') + (m_suffix ? plain + "-" : plain); } public: using difference_type = std::ptrdiff_t; using value_type = std::string; using pointer = value_type*; using reference = value_type&; using iterator_category = std::forward_iterator_tag; explicit iterator(Column const& column) : m_column(column) { assert(m_column.m_width > m_column.m_indent); assert(m_column.m_initialIndent == std::string::npos || m_column.m_width > m_column.m_initialIndent); calcLength(); if (m_len == 0) m_stringIndex++; // Empty string } auto operator*() const -> std::string { assert(m_stringIndex < m_column.m_strings.size()); assert(m_pos <= m_end); return addIndentAndSuffix(line().substr(m_pos, m_len)); } auto operator++() -> iterator& { m_pos += m_len; if (m_pos < line().size() && line()[m_pos] == '\n') m_pos += 1; else while (m_pos < line().size() && isWhitespace(line()[m_pos])) ++m_pos; if (m_pos == line().size()) { m_pos = 0; ++m_stringIndex; } if (m_stringIndex < m_column.m_strings.size()) calcLength(); return *this; } auto operator++(int) -> iterator { iterator prev(*this); operator++(); return prev; } auto operator==(iterator const& other) const -> bool { return m_pos == other.m_pos && m_stringIndex == other.m_stringIndex && &m_column == &other.m_column; } auto operator!=(iterator const& other) const -> bool { return !operator==(other); } }; using const_iterator = iterator; explicit Column(std::string const& text) { m_strings.push_back(text); } auto width(size_t newWidth) -> Column& { assert(newWidth > 0); m_width = newWidth; return *this; } auto indent(size_t newIndent) -> Column& { m_indent = newIndent; return *this; } auto initialIndent(size_t newIndent) -> Column& { m_initialIndent = newIndent; return *this; } auto width() const -> size_t { return m_width; } auto begin() const -> iterator { return iterator(*this); } auto end() const -> iterator { return {*this, m_strings.size()}; } inline friend std::ostream& operator<<(std::ostream& os, Column const& col) { bool first = true; for (auto line : col) { if (first) first = false; else os << "\n"; os << line; } return os; } auto operator+(Column const& other) -> Columns; auto toString() const -> std::string { std::ostringstream oss; oss << *this; return oss.str(); } }; class Spacer : public Column { public: explicit Spacer(size_t spaceWidth) : Column("") { width(spaceWidth); } }; class Columns { std::vector m_columns; public: class iterator { friend Columns; struct EndTag {}; std::vector const& m_columns; std::vector m_iterators; size_t m_activeIterators; iterator(Columns const& columns, EndTag) : m_columns(columns.m_columns), m_activeIterators(0) { m_iterators.reserve(m_columns.size()); for (auto const& col : m_columns) m_iterators.push_back(col.end()); } public: using difference_type = std::ptrdiff_t; using value_type = std::string; using pointer = value_type*; using reference = value_type&; using iterator_category = std::forward_iterator_tag; explicit iterator(Columns const& columns) : m_columns(columns.m_columns), m_activeIterators(m_columns.size()) { m_iterators.reserve(m_columns.size()); for (auto const& col : m_columns) m_iterators.push_back(col.begin()); } auto operator==(iterator const& other) const -> bool { return m_iterators == other.m_iterators; } auto operator!=(iterator const& other) const -> bool { return m_iterators != other.m_iterators; } auto operator*() const -> std::string { std::string row, padding; for (size_t i = 0; i < m_columns.size(); ++i) { auto width = m_columns[i].width(); if (m_iterators[i] != m_columns[i].end()) { std::string col = *m_iterators[i]; row += padding + col; if (col.size() < width) padding = std::string(width - col.size(), ' '); else padding = ""; } else { padding += std::string(width, ' '); } } return row; } auto operator++() -> iterator& { for (size_t i = 0; i < m_columns.size(); ++i) { if (m_iterators[i] != m_columns[i].end()) ++m_iterators[i]; } return *this; } auto operator++(int) -> iterator { iterator prev(*this); operator++(); return prev; } }; using const_iterator = iterator; auto begin() const -> iterator { return iterator(*this); } auto end() const -> iterator { return {*this, iterator::EndTag()}; } auto operator+=(Column const& col) -> Columns& { m_columns.push_back(col); return *this; } auto operator+(Column const& col) -> Columns { Columns combined = *this; combined += col; return combined; } inline friend std::ostream& operator<<(std::ostream& os, Columns const& cols) { bool first = true; for (auto line : cols) { if (first) first = false; else os << "\n"; os << line; } return os; } auto toString() const -> std::string { std::ostringstream oss; oss << *this; return oss.str(); } }; inline auto Column::operator+(Column const& other) -> Columns { Columns cols; cols += *this; cols += other; return cols; } } // namespace TextFlow } // namespace clara } // namespace Catch // ----------- end of #include from clara_textflow.hpp ----------- // ........... back in clara.hpp #include #include #include #include #if !defined(CATCH_PLATFORM_WINDOWS) && \ (defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || \ defined(_MSC_VER)) #define CATCH_PLATFORM_WINDOWS #endif namespace Catch { namespace clara { namespace detail { // Traits for extracting arg and return type of lambdas (for single argument // lambdas) template struct UnaryLambdaTraits : UnaryLambdaTraits {}; template struct UnaryLambdaTraits { static const bool isValid = false; }; template struct UnaryLambdaTraits { static const bool isValid = true; using ArgType = typename std::remove_const< typename std::remove_reference::type>::type; using ReturnType = ReturnT; }; class TokenStream; // Transport for raw args (copied from main args, or supplied via init list for // testing) class Args { friend TokenStream; std::string m_exeName; std::vector m_args; public: Args(int argc, char const* const* argv) : m_exeName(argv[0]), m_args(argv + 1, argv + argc) {} Args(std::initializer_list args) : m_exeName(*args.begin()), m_args(args.begin() + 1, args.end()) {} auto exeName() const -> std::string { return m_exeName; } }; // Wraps a token coming from a token stream. These may not directly correspond // to strings as a single string may encode an option + its argument if the : or // = form is used enum class TokenType { Option, Argument }; struct Token { TokenType type; std::string token; }; inline auto isOptPrefix(char c) -> bool { return c == '-' #ifdef CATCH_PLATFORM_WINDOWS || c == '/' #endif ; } // Abstracts iterators into args as a stream of tokens, with option arguments // uniformly handled class TokenStream { using Iterator = std::vector::const_iterator; Iterator it; Iterator itEnd; std::vector m_tokenBuffer; void loadBuffer() { m_tokenBuffer.resize(0); // Skip any empty strings while (it != itEnd && it->empty()) ++it; if (it != itEnd) { auto const& next = *it; if (isOptPrefix(next[0])) { auto delimiterPos = next.find_first_of(" :="); if (delimiterPos != std::string::npos) { m_tokenBuffer.push_back( {TokenType::Option, next.substr(0, delimiterPos)}); m_tokenBuffer.push_back( {TokenType::Argument, next.substr(delimiterPos + 1)}); } else { if (next[1] != '-' && next.size() > 2) { std::string opt = "- "; for (size_t i = 1; i < next.size(); ++i) { opt[1] = next[i]; m_tokenBuffer.push_back({TokenType::Option, opt}); } } else { m_tokenBuffer.push_back({TokenType::Option, next}); } } } else { m_tokenBuffer.push_back({TokenType::Argument, next}); } } } public: explicit TokenStream(Args const& args) : TokenStream(args.m_args.begin(), args.m_args.end()) {} TokenStream(Iterator it, Iterator itEnd) : it(it), itEnd(itEnd) { loadBuffer(); } explicit operator bool() const { return !m_tokenBuffer.empty() || it != itEnd; } auto count() const -> size_t { return m_tokenBuffer.size() + (itEnd - it); } auto operator*() const -> Token { assert(!m_tokenBuffer.empty()); return m_tokenBuffer.front(); } auto operator->() const -> Token const* { assert(!m_tokenBuffer.empty()); return &m_tokenBuffer.front(); } auto operator++() -> TokenStream& { if (m_tokenBuffer.size() >= 2) { m_tokenBuffer.erase(m_tokenBuffer.begin()); } else { if (it != itEnd) ++it; loadBuffer(); } return *this; } }; class ResultBase { public: enum Type { Ok, LogicError, RuntimeError }; protected: ResultBase(Type type) : m_type(type) {} virtual ~ResultBase() = default; virtual void enforceOk() const = 0; Type m_type; }; template class ResultValueBase : public ResultBase { public: auto value() const -> T const& { enforceOk(); return m_value; } protected: ResultValueBase(Type type) : ResultBase(type) {} ResultValueBase(ResultValueBase const& other) : ResultBase(other) { if (m_type == ResultBase::Ok) new (&m_value) T(other.m_value); } ResultValueBase(Type, T const& value) : ResultBase(Ok) { new (&m_value) T(value); } auto operator=(ResultValueBase const& other) -> ResultValueBase& { if (m_type == ResultBase::Ok) m_value.~T(); ResultBase::operator=(other); if (m_type == ResultBase::Ok) new (&m_value) T(other.m_value); return *this; } ~ResultValueBase() override { if (m_type == Ok) m_value.~T(); } union { T m_value; }; }; template <> class ResultValueBase : public ResultBase { protected: using ResultBase::ResultBase; }; template class BasicResult : public ResultValueBase { public: template explicit BasicResult(BasicResult const& other) : ResultValueBase(other.type()), m_errorMessage(other.errorMessage()) { assert(type() != ResultBase::Ok); } template static auto ok(U const& value) -> BasicResult { return {ResultBase::Ok, value}; } static auto ok() -> BasicResult { return {ResultBase::Ok}; } static auto logicError(std::string const& message) -> BasicResult { return {ResultBase::LogicError, message}; } static auto runtimeError(std::string const& message) -> BasicResult { return {ResultBase::RuntimeError, message}; } explicit operator bool() const { return m_type == ResultBase::Ok; } auto type() const -> ResultBase::Type { return m_type; } auto errorMessage() const -> std::string { return m_errorMessage; } protected: void enforceOk() const override { // Errors shouldn't reach this point, but if they do // the actual error message will be in m_errorMessage assert(m_type != ResultBase::LogicError); assert(m_type != ResultBase::RuntimeError); if (m_type != ResultBase::Ok) std::abort(); } std::string m_errorMessage; // Only populated if resultType is an error BasicResult(ResultBase::Type type, std::string const& message) : ResultValueBase(type), m_errorMessage(message) { assert(m_type != ResultBase::Ok); } using ResultValueBase::ResultValueBase; using ResultBase::m_type; }; enum class ParseResultType { Matched, NoMatch, ShortCircuitAll, ShortCircuitSame }; class ParseState { public: ParseState(ParseResultType type, TokenStream const& remainingTokens) : m_type(type), m_remainingTokens(remainingTokens) {} auto type() const -> ParseResultType { return m_type; } auto remainingTokens() const -> TokenStream { return m_remainingTokens; } private: ParseResultType m_type; TokenStream m_remainingTokens; }; using Result = BasicResult; using ParserResult = BasicResult; using InternalParseResult = BasicResult; struct HelpColumns { std::string left; std::string right; }; template inline auto convertInto(std::string const& source, T& target) -> ParserResult { std::stringstream ss; ss << source; ss >> target; if (ss.fail()) return ParserResult::runtimeError("Unable to convert '" + source + "' to destination type"); else return ParserResult::ok(ParseResultType::Matched); } inline auto convertInto(std::string const& source, std::string& target) -> ParserResult { target = source; return ParserResult::ok(ParseResultType::Matched); } inline auto convertInto(std::string const& source, bool& target) -> ParserResult { std::string srcLC = source; std::transform(srcLC.begin(), srcLC.end(), srcLC.begin(), [](char c) { return static_cast(::tolower(c)); }); if (srcLC == "y" || srcLC == "1" || srcLC == "true" || srcLC == "yes" || srcLC == "on") target = true; else if (srcLC == "n" || srcLC == "0" || srcLC == "false" || srcLC == "no" || srcLC == "off") target = false; else return ParserResult::runtimeError( "Expected a boolean value but did not recognise: '" + source + "'"); return ParserResult::ok(ParseResultType::Matched); } #ifdef CLARA_CONFIG_OPTIONAL_TYPE template inline auto convertInto(std::string const& source, CLARA_CONFIG_OPTIONAL_TYPE& target) -> ParserResult { T temp; auto result = convertInto(source, temp); if (result) target = std::move(temp); return result; } #endif // CLARA_CONFIG_OPTIONAL_TYPE struct NonCopyable { NonCopyable() = default; NonCopyable(NonCopyable const&) = delete; NonCopyable(NonCopyable&&) = delete; NonCopyable& operator=(NonCopyable const&) = delete; NonCopyable& operator=(NonCopyable&&) = delete; }; struct BoundRef : NonCopyable { virtual ~BoundRef() = default; virtual auto isContainer() const -> bool { return false; } virtual auto isFlag() const -> bool { return false; } }; struct BoundValueRefBase : BoundRef { virtual auto setValue(std::string const& arg) -> ParserResult = 0; }; struct BoundFlagRefBase : BoundRef { virtual auto setFlag(bool flag) -> ParserResult = 0; virtual auto isFlag() const -> bool { return true; } }; template struct BoundValueRef : BoundValueRefBase { T& m_ref; explicit BoundValueRef(T& ref) : m_ref(ref) {} auto setValue(std::string const& arg) -> ParserResult override { return convertInto(arg, m_ref); } }; template struct BoundValueRef> : BoundValueRefBase { std::vector& m_ref; explicit BoundValueRef(std::vector& ref) : m_ref(ref) {} auto isContainer() const -> bool override { return true; } auto setValue(std::string const& arg) -> ParserResult override { T temp; auto result = convertInto(arg, temp); if (result) m_ref.push_back(temp); return result; } }; struct BoundFlagRef : BoundFlagRefBase { bool& m_ref; explicit BoundFlagRef(bool& ref) : m_ref(ref) {} auto setFlag(bool flag) -> ParserResult override { m_ref = flag; return ParserResult::ok(ParseResultType::Matched); } }; template struct LambdaInvoker { static_assert(std::is_same::value, "Lambda must return void or clara::ParserResult"); template static auto invoke(L const& lambda, ArgType const& arg) -> ParserResult { return lambda(arg); } }; template <> struct LambdaInvoker { template static auto invoke(L const& lambda, ArgType const& arg) -> ParserResult { lambda(arg); return ParserResult::ok(ParseResultType::Matched); } }; template inline auto invokeLambda(L const& lambda, std::string const& arg) -> ParserResult { ArgType temp{}; auto result = convertInto(arg, temp); return !result ? result : LambdaInvoker::ReturnType>::invoke( lambda, temp); } template struct BoundLambda : BoundValueRefBase { L m_lambda; static_assert(UnaryLambdaTraits::isValid, "Supplied lambda must take exactly one argument"); explicit BoundLambda(L const& lambda) : m_lambda(lambda) {} auto setValue(std::string const& arg) -> ParserResult override { return invokeLambda::ArgType>(m_lambda, arg); } }; template struct BoundFlagLambda : BoundFlagRefBase { L m_lambda; static_assert(UnaryLambdaTraits::isValid, "Supplied lambda must take exactly one argument"); static_assert( std::is_same::ArgType, bool>::value, "flags must be boolean"); explicit BoundFlagLambda(L const& lambda) : m_lambda(lambda) {} auto setFlag(bool flag) -> ParserResult override { return LambdaInvoker::ReturnType>::invoke( m_lambda, flag); } }; enum class Optionality { Optional, Required }; struct Parser; class ParserBase { public: virtual ~ParserBase() = default; virtual auto validate() const -> Result { return Result::ok(); } virtual auto parse(std::string const& exeName, TokenStream const& tokens) const -> InternalParseResult = 0; virtual auto cardinality() const -> size_t { return 1; } auto parse(Args const& args) const -> InternalParseResult { return parse(args.exeName(), TokenStream(args)); } }; template class ComposableParserImpl : public ParserBase { public: template auto operator|(T const& other) const -> Parser; template auto operator+(T const& other) const -> Parser; }; // Common code and state for Args and Opts template class ParserRefImpl : public ComposableParserImpl { protected: Optionality m_optionality = Optionality::Optional; std::shared_ptr m_ref; std::string m_hint; std::string m_description; explicit ParserRefImpl(std::shared_ptr const& ref) : m_ref(ref) {} public: template ParserRefImpl(T& ref, std::string const& hint) : m_ref(std::make_shared>(ref)), m_hint(hint) {} template ParserRefImpl(LambdaT const& ref, std::string const& hint) : m_ref(std::make_shared>(ref)), m_hint(hint) {} auto operator()(std::string const& description) -> DerivedT& { m_description = description; return static_cast(*this); } auto optional() -> DerivedT& { m_optionality = Optionality::Optional; return static_cast(*this); }; auto required() -> DerivedT& { m_optionality = Optionality::Required; return static_cast(*this); }; auto isOptional() const -> bool { return m_optionality == Optionality::Optional; } auto cardinality() const -> size_t override { if (m_ref->isContainer()) return 0; else return 1; } auto hint() const -> std::string { return m_hint; } }; class ExeName : public ComposableParserImpl { std::shared_ptr m_name; std::shared_ptr m_ref; template static auto makeRef(LambdaT const& lambda) -> std::shared_ptr { return std::make_shared>(lambda); } public: ExeName() : m_name(std::make_shared("")) {} explicit ExeName(std::string& ref) : ExeName() { m_ref = std::make_shared>(ref); } template explicit ExeName(LambdaT const& lambda) : ExeName() { m_ref = std::make_shared>(lambda); } // The exe name is not parsed out of the normal tokens, but is handled // specially auto parse(std::string const&, TokenStream const& tokens) const -> InternalParseResult override { return InternalParseResult::ok( ParseState(ParseResultType::NoMatch, tokens)); } auto name() const -> std::string { return *m_name; } auto set(std::string const& newName) -> ParserResult { auto lastSlash = newName.find_last_of("\\/"); auto filename = (lastSlash == std::string::npos) ? newName : newName.substr(lastSlash + 1); *m_name = filename; if (m_ref) return m_ref->setValue(filename); else return ParserResult::ok(ParseResultType::Matched); } }; class Arg : public ParserRefImpl { public: using ParserRefImpl::ParserRefImpl; auto parse(std::string const&, TokenStream const& tokens) const -> InternalParseResult override { auto validationResult = validate(); if (!validationResult) return InternalParseResult(validationResult); auto remainingTokens = tokens; auto const& token = *remainingTokens; if (token.type != TokenType::Argument) return InternalParseResult::ok( ParseState(ParseResultType::NoMatch, remainingTokens)); assert(!m_ref->isFlag()); auto valueRef = static_cast(m_ref.get()); auto result = valueRef->setValue(remainingTokens->token); if (!result) return InternalParseResult(result); else return InternalParseResult::ok( ParseState(ParseResultType::Matched, ++remainingTokens)); } }; inline auto normaliseOpt(std::string const& optName) -> std::string { #ifdef CATCH_PLATFORM_WINDOWS if (optName[0] == '/') return "-" + optName.substr(1); else #endif return optName; } class Opt : public ParserRefImpl { protected: std::vector m_optNames; public: template explicit Opt(LambdaT const& ref) : ParserRefImpl(std::make_shared>(ref)) {} explicit Opt(bool& ref) : ParserRefImpl(std::make_shared(ref)) {} template Opt(LambdaT const& ref, std::string const& hint) : ParserRefImpl(ref, hint) {} template Opt(T& ref, std::string const& hint) : ParserRefImpl(ref, hint) {} auto operator[](std::string const& optName) -> Opt& { m_optNames.push_back(optName); return *this; } auto getHelpColumns() const -> std::vector { std::ostringstream oss; bool first = true; for (auto const& opt : m_optNames) { if (first) first = false; else oss << ", "; oss << opt; } if (!m_hint.empty()) oss << " <" << m_hint << ">"; return {{oss.str(), m_description}}; } auto isMatch(std::string const& optToken) const -> bool { auto normalisedToken = normaliseOpt(optToken); for (auto const& name : m_optNames) { if (normaliseOpt(name) == normalisedToken) return true; } return false; } using ParserBase::parse; auto parse(std::string const&, TokenStream const& tokens) const -> InternalParseResult override { auto validationResult = validate(); if (!validationResult) return InternalParseResult(validationResult); auto remainingTokens = tokens; if (remainingTokens && remainingTokens->type == TokenType::Option) { auto const& token = *remainingTokens; if (isMatch(token.token)) { if (m_ref->isFlag()) { auto flagRef = static_cast(m_ref.get()); auto result = flagRef->setFlag(true); if (!result) return InternalParseResult(result); if (result.value() == ParseResultType::ShortCircuitAll) return InternalParseResult::ok( ParseState(result.value(), remainingTokens)); } else { auto valueRef = static_cast(m_ref.get()); ++remainingTokens; if (!remainingTokens) return InternalParseResult::runtimeError( "Expected argument following " + token.token); auto const& argToken = *remainingTokens; if (argToken.type != TokenType::Argument) return InternalParseResult::runtimeError( "Expected argument following " + token.token); auto result = valueRef->setValue(argToken.token); if (!result) return InternalParseResult(result); if (result.value() == ParseResultType::ShortCircuitAll) return InternalParseResult::ok( ParseState(result.value(), remainingTokens)); } return InternalParseResult::ok( ParseState(ParseResultType::Matched, ++remainingTokens)); } } return InternalParseResult::ok( ParseState(ParseResultType::NoMatch, remainingTokens)); } auto validate() const -> Result override { if (m_optNames.empty()) return Result::logicError("No options supplied to Opt"); for (auto const& name : m_optNames) { if (name.empty()) return Result::logicError("Option name cannot be empty"); #ifdef CATCH_PLATFORM_WINDOWS if (name[0] != '-' && name[0] != '/') return Result::logicError("Option name must begin with '-' or '/'"); #else if (name[0] != '-') return Result::logicError("Option name must begin with '-'"); #endif } return ParserRefImpl::validate(); } }; struct Help : Opt { Help(bool& showHelpFlag) : Opt([&](bool flag) { showHelpFlag = flag; return ParserResult::ok(ParseResultType::ShortCircuitAll); }) { static_cast (*this)("display usage information")["-?"]["-h"]["--help"] .optional(); } }; struct Parser : ParserBase { mutable ExeName m_exeName; std::vector m_options; std::vector m_args; auto operator|=(ExeName const& exeName) -> Parser& { m_exeName = exeName; return *this; } auto operator|=(Arg const& arg) -> Parser& { m_args.push_back(arg); return *this; } auto operator|=(Opt const& opt) -> Parser& { m_options.push_back(opt); return *this; } auto operator|=(Parser const& other) -> Parser& { m_options.insert(m_options.end(), other.m_options.begin(), other.m_options.end()); m_args.insert(m_args.end(), other.m_args.begin(), other.m_args.end()); return *this; } template auto operator|(T const& other) const -> Parser { return Parser(*this) |= other; } // Forward deprecated interface with '+' instead of '|' template auto operator+=(T const& other) -> Parser& { return operator|=(other); } template auto operator+(T const& other) const -> Parser { return operator|(other); } auto getHelpColumns() const -> std::vector { std::vector cols; for (auto const& o : m_options) { auto childCols = o.getHelpColumns(); cols.insert(cols.end(), childCols.begin(), childCols.end()); } return cols; } void writeToStream(std::ostream& os) const { if (!m_exeName.name().empty()) { os << "usage:\n" << " " << m_exeName.name() << " "; bool required = true, first = true; for (auto const& arg : m_args) { if (first) first = false; else os << " "; if (arg.isOptional() && required) { os << "["; required = false; } os << "<" << arg.hint() << ">"; if (arg.cardinality() == 0) os << " ... "; } if (!required) os << "]"; if (!m_options.empty()) os << " options"; os << "\n\nwhere options are:" << std::endl; } auto rows = getHelpColumns(); size_t consoleWidth = CATCH_CLARA_CONFIG_CONSOLE_WIDTH; size_t optWidth = 0; for (auto const& cols : rows) optWidth = (std::max)(optWidth, cols.left.size() + 2); optWidth = (std::min)(optWidth, consoleWidth / 2); for (auto const& cols : rows) { auto row = TextFlow::Column(cols.left).width(optWidth).indent(2) + TextFlow::Spacer(4) + TextFlow::Column(cols.right).width(consoleWidth - 7 - optWidth); os << row << std::endl; } } friend auto operator<<(std::ostream& os, Parser const& parser) -> std::ostream& { parser.writeToStream(os); return os; } auto validate() const -> Result override { for (auto const& opt : m_options) { auto result = opt.validate(); if (!result) return result; } for (auto const& arg : m_args) { auto result = arg.validate(); if (!result) return result; } return Result::ok(); } using ParserBase::parse; auto parse(std::string const& exeName, TokenStream const& tokens) const -> InternalParseResult override { struct ParserInfo { ParserBase const* parser = nullptr; size_t count = 0; }; const size_t totalParsers = m_options.size() + m_args.size(); assert(totalParsers < 512); // ParserInfo parseInfos[totalParsers]; // <-- this is what we really want // to do ParserInfo parseInfos[512]; { size_t i = 0; for (auto const& opt : m_options) parseInfos[i++].parser = &opt; for (auto const& arg : m_args) parseInfos[i++].parser = &arg; } m_exeName.set(exeName); auto result = InternalParseResult::ok(ParseState(ParseResultType::NoMatch, tokens)); while (result.value().remainingTokens()) { bool tokenParsed = false; for (size_t i = 0; i < totalParsers; ++i) { auto& parseInfo = parseInfos[i]; if (parseInfo.parser->cardinality() == 0 || parseInfo.count < parseInfo.parser->cardinality()) { result = parseInfo.parser->parse(exeName, result.value().remainingTokens()); if (!result) return result; if (result.value().type() != ParseResultType::NoMatch) { tokenParsed = true; ++parseInfo.count; break; } } } if (result.value().type() == ParseResultType::ShortCircuitAll) return result; if (!tokenParsed) return InternalParseResult::runtimeError( "Unrecognised token: " + result.value().remainingTokens()->token); } // !TBD Check missing required options return result; } }; template template auto ComposableParserImpl::operator|(T const& other) const -> Parser { return Parser() | static_cast(*this) | other; } } // namespace detail // A Combined parser using detail::Parser; // A parser for options using detail::Opt; // A parser for arguments using detail::Arg; // Wrapper for argc, argv from main() using detail::Args; // Specifies the name of the executable using detail::ExeName; // Convenience wrapper for option parser that specifies the help option using detail::Help; // enum of result types from a parse using detail::ParseResultType; // Result type for parser operation using detail::ParserResult; } // namespace clara } // namespace Catch // end clara.hpp #ifdef __clang__ #pragma clang diagnostic pop #endif // Restore Clara's value for console width, if present #ifdef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH #define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH \ CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH #undef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH #endif // end catch_clara.h namespace Catch { clara::Parser makeCommandLineParser(ConfigData& config); } // end namespace Catch // end catch_commandline.h #include #include namespace Catch { clara::Parser makeCommandLineParser(ConfigData& config) { using namespace clara; auto const setWarning = [&](std::string const& warning) { auto warningSet = [&]() { if (warning == "NoAssertions") return WarnAbout::NoAssertions; if (warning == "NoTests") return WarnAbout::NoTests; return WarnAbout::Nothing; }(); if (warningSet == WarnAbout::Nothing) return ParserResult::runtimeError("Unrecognised warning: '" + warning + "'"); config.warnings = static_cast(config.warnings | warningSet); return ParserResult::ok(ParseResultType::Matched); }; auto const loadTestNamesFromFile = [&](std::string const& filename) { std::ifstream f(filename.c_str()); if (!f.is_open()) return ParserResult::runtimeError("Unable to load input file: '" + filename + "'"); std::string line; while (std::getline(f, line)) { line = trim(line); if (!line.empty() && !startsWith(line, '#')) { if (!startsWith(line, '"')) line = '"' + line + '"'; config.testsOrTags.push_back(line + ','); } } return ParserResult::ok(ParseResultType::Matched); }; auto const setTestOrder = [&](std::string const& order) { if (startsWith("declared", order)) config.runOrder = RunTests::InDeclarationOrder; else if (startsWith("lexical", order)) config.runOrder = RunTests::InLexicographicalOrder; else if (startsWith("random", order)) config.runOrder = RunTests::InRandomOrder; else return clara::ParserResult::runtimeError("Unrecognised ordering: '" + order + "'"); return ParserResult::ok(ParseResultType::Matched); }; auto const setRngSeed = [&](std::string const& seed) { if (seed != "time") return clara::detail::convertInto(seed, config.rngSeed); config.rngSeed = static_cast(std::time(nullptr)); return ParserResult::ok(ParseResultType::Matched); }; auto const setColourUsage = [&](std::string const& useColour) { auto mode = toLower(useColour); if (mode == "yes") config.useColour = UseColour::Yes; else if (mode == "no") config.useColour = UseColour::No; else if (mode == "auto") config.useColour = UseColour::Auto; else return ParserResult::runtimeError( "colour mode must be one of: auto, yes or no. '" + useColour + "' not recognised"); return ParserResult::ok(ParseResultType::Matched); }; auto const setWaitForKeypress = [&](std::string const& keypress) { auto keypressLc = toLower(keypress); if (keypressLc == "start") config.waitForKeypress = WaitForKeypress::BeforeStart; else if (keypressLc == "exit") config.waitForKeypress = WaitForKeypress::BeforeExit; else if (keypressLc == "both") config.waitForKeypress = WaitForKeypress::BeforeStartAndExit; else return ParserResult::runtimeError( "keypress argument must be one of: start, exit or both. '" + keypress + "' not recognised"); return ParserResult::ok(ParseResultType::Matched); }; auto const setVerbosity = [&](std::string const& verbosity) { auto lcVerbosity = toLower(verbosity); if (lcVerbosity == "quiet") config.verbosity = Verbosity::Quiet; else if (lcVerbosity == "normal") config.verbosity = Verbosity::Normal; else if (lcVerbosity == "high") config.verbosity = Verbosity::High; else return ParserResult::runtimeError("Unrecognised verbosity, '" + verbosity + "'"); return ParserResult::ok(ParseResultType::Matched); }; auto const setReporter = [&](std::string const& reporter) { IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); auto lcReporter = toLower(reporter); auto result = factories.find(lcReporter); if (factories.end() != result) config.reporterName = lcReporter; else return ParserResult::runtimeError( "Unrecognized reporter, '" + reporter + "'. Check available with --list-reporters"); return ParserResult::ok(ParseResultType::Matched); }; auto cli = ExeName(config.processName) | Help(config.showHelp) | Opt(config.listTests)["-l"]["--list-tests"]( "list all/matching test cases") | Opt(config.listTags)["-t"]["--list-tags"]("list all/matching tags") | Opt(config.showSuccessfulTests)["-s"]["--success"]( "include successful tests in output") | Opt(config.shouldDebugBreak)["-b"]["--break"]( "break into debugger on failure") | Opt(config.noThrow)["-e"]["--nothrow"]("skip exception tests") | Opt(config.showInvisibles)["-i"]["--invisibles"]( "show invisibles (tabs, newlines)") | Opt(config.outputFilename, "filename")["-o"]["--out"]("output filename") | Opt(setReporter, "name")["-r"]["--reporter"]("reporter to use (defaults to console)") | Opt(config.name, "name")["-n"]["--name"]("suite name") | Opt([&](bool) { config.abortAfter = 1; })["-a"]["--abort"]("abort at first failure") | Opt([&](int x) { config.abortAfter = x; }, "no. failures")["-x"]["--abortx"]("abort after x failures") | Opt(setWarning, "warning name")["-w"]["--warn"]("enable warnings") | Opt( [&](bool flag) { config.showDurations = flag ? ShowDurations::Always : ShowDurations::Never; }, "yes|no")["-d"]["--durations"]("show test durations") | Opt(loadTestNamesFromFile, "filename")["-f"]["--input-file"]( "load test names to run from a file") | Opt(config.filenamesAsTags)["-#"]["--filenames-as-tags"]( "adds a tag for the filename") | Opt(config.sectionsToRun, "section name")["-c"]["--section"]("specify section to run") | Opt(setVerbosity, "quiet|normal|high")["-v"]["--verbosity"]("set output verbosity") | Opt(config.listTestNamesOnly)["--list-test-names-only"]( "list all/matching test cases names only") | Opt(config.listReporters)["--list-reporters"]("list all reporters") | Opt(setTestOrder, "decl|lex|rand")["--order"]("test case order (defaults to decl)") | Opt(setRngSeed, "'time'|number")["--rng-seed"]( "set a specific seed for random numbers") | Opt(setColourUsage, "yes|no")["--use-colour"]("should output be colourised") | Opt(config.libIdentify)["--libidentify"]( "report name and version according to libidentify standard") | Opt(setWaitForKeypress, "start|exit|both")["--wait-for-keypress"]( "waits for a keypress before exiting") | Opt(config.benchmarkResolutionMultiple, "multiplier")["--benchmark-resolution-multiple"]( "multiple of clock resolution to run benchmarks") | Arg(config.testsOrTags, "test name|pattern|tags")("which test or tests to use"); return cli; } } // end namespace Catch // end catch_commandline.cpp // start catch_common.cpp #include #include namespace Catch { bool SourceLineInfo::empty() const noexcept { return file[0] == '\0'; } bool SourceLineInfo::operator==(SourceLineInfo const& other) const noexcept { return line == other.line && (file == other.file || std::strcmp(file, other.file) == 0); } bool SourceLineInfo::operator<(SourceLineInfo const& other) const noexcept { // We can assume that the same file will usually have the same pointer. // Thus, if the pointers are the same, there is no point in calling the strcmp return line < other.line || (line == other.line && file != other.file && (std::strcmp(file, other.file) < 0)); } std::ostream& operator<<(std::ostream& os, SourceLineInfo const& info) { #ifndef __GNUG__ os << info.file << '(' << info.line << ')'; #else os << info.file << ':' << info.line; #endif return os; } std::string StreamEndStop::operator+() const { return std::string(); } NonCopyable::NonCopyable() = default; NonCopyable::~NonCopyable() = default; } // namespace Catch // end catch_common.cpp // start catch_config.cpp namespace Catch { Config::Config(ConfigData const& data) : m_data(data), m_stream(openStream()) { TestSpecParser parser(ITagAliasRegistry::get()); if (data.testsOrTags.empty()) { parser.parse("~[.]"); // All not hidden tests } else { m_hasTestFilters = true; for (auto const& testOrTags : data.testsOrTags) parser.parse(testOrTags); } m_testSpec = parser.testSpec(); } std::string const& Config::getFilename() const { return m_data.outputFilename; } bool Config::listTests() const { return m_data.listTests; } bool Config::listTestNamesOnly() const { return m_data.listTestNamesOnly; } bool Config::listTags() const { return m_data.listTags; } bool Config::listReporters() const { return m_data.listReporters; } std::string Config::getProcessName() const { return m_data.processName; } std::string const& Config::getReporterName() const { return m_data.reporterName; } std::vector const& Config::getTestsOrTags() const { return m_data.testsOrTags; } std::vector const& Config::getSectionsToRun() const { return m_data.sectionsToRun; } TestSpec const& Config::testSpec() const { return m_testSpec; } bool Config::hasTestFilters() const { return m_hasTestFilters; } bool Config::showHelp() const { return m_data.showHelp; } // IConfig interface bool Config::allowThrows() const { return !m_data.noThrow; } std::ostream& Config::stream() const { return m_stream->stream(); } std::string Config::name() const { return m_data.name.empty() ? m_data.processName : m_data.name; } bool Config::includeSuccessfulResults() const { return m_data.showSuccessfulTests; } bool Config::warnAboutMissingAssertions() const { return !!(m_data.warnings & WarnAbout::NoAssertions); } bool Config::warnAboutNoTests() const { return !!(m_data.warnings & WarnAbout::NoTests); } ShowDurations::OrNot Config::showDurations() const { return m_data.showDurations; } RunTests::InWhatOrder Config::runOrder() const { return m_data.runOrder; } unsigned int Config::rngSeed() const { return m_data.rngSeed; } int Config::benchmarkResolutionMultiple() const { return m_data.benchmarkResolutionMultiple; } UseColour::YesOrNo Config::useColour() const { return m_data.useColour; } bool Config::shouldDebugBreak() const { return m_data.shouldDebugBreak; } int Config::abortAfter() const { return m_data.abortAfter; } bool Config::showInvisibles() const { return m_data.showInvisibles; } Verbosity Config::verbosity() const { return m_data.verbosity; } IStream const* Config::openStream() { return Catch::makeStream(m_data.outputFilename); } } // end namespace Catch // end catch_config.cpp // start catch_console_colour.cpp #if defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wexit-time-destructors" #endif // start catch_errno_guard.h namespace Catch { class ErrnoGuard { public: ErrnoGuard(); ~ErrnoGuard(); private: int m_oldErrno; }; } // namespace Catch // end catch_errno_guard.h #include namespace Catch { namespace { struct IColourImpl { virtual ~IColourImpl() = default; virtual void use(Colour::Code _colourCode) = 0; }; struct NoColourImpl : IColourImpl { void use(Colour::Code) {} static IColourImpl* instance() { static NoColourImpl s_instance; return &s_instance; } }; } // namespace } // namespace Catch #if !defined(CATCH_CONFIG_COLOUR_NONE) && \ !defined(CATCH_CONFIG_COLOUR_WINDOWS) && \ !defined(CATCH_CONFIG_COLOUR_ANSI) #ifdef CATCH_PLATFORM_WINDOWS #define CATCH_CONFIG_COLOUR_WINDOWS #else #define CATCH_CONFIG_COLOUR_ANSI #endif #endif #if defined( \ CATCH_CONFIG_COLOUR_WINDOWS) ///////////////////////////////////////// namespace Catch { namespace { class Win32ColourImpl : public IColourImpl { public: Win32ColourImpl() : stdoutHandle(GetStdHandle(STD_OUTPUT_HANDLE)) { CONSOLE_SCREEN_BUFFER_INFO csbiInfo; GetConsoleScreenBufferInfo(stdoutHandle, &csbiInfo); originalForegroundAttributes = csbiInfo.wAttributes & ~(BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_INTENSITY); originalBackgroundAttributes = csbiInfo.wAttributes & ~(FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY); } virtual void use(Colour::Code _colourCode) override { switch (_colourCode) { case Colour::None: return setTextAttribute(originalForegroundAttributes); case Colour::White: return setTextAttribute(FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE); case Colour::Red: return setTextAttribute(FOREGROUND_RED); case Colour::Green: return setTextAttribute(FOREGROUND_GREEN); case Colour::Blue: return setTextAttribute(FOREGROUND_BLUE); case Colour::Cyan: return setTextAttribute(FOREGROUND_BLUE | FOREGROUND_GREEN); case Colour::Yellow: return setTextAttribute(FOREGROUND_RED | FOREGROUND_GREEN); case Colour::Grey: return setTextAttribute(0); case Colour::LightGrey: return setTextAttribute(FOREGROUND_INTENSITY); case Colour::BrightRed: return setTextAttribute(FOREGROUND_INTENSITY | FOREGROUND_RED); case Colour::BrightGreen: return setTextAttribute(FOREGROUND_INTENSITY | FOREGROUND_GREEN); case Colour::BrightWhite: return setTextAttribute(FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE); case Colour::BrightYellow: return setTextAttribute(FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN); case Colour::Bright: CATCH_INTERNAL_ERROR("not a colour"); default: CATCH_ERROR("Unknown colour requested"); } } private: void setTextAttribute(WORD _textAttribute) { SetConsoleTextAttribute(stdoutHandle, _textAttribute | originalBackgroundAttributes); } HANDLE stdoutHandle; WORD originalForegroundAttributes; WORD originalBackgroundAttributes; }; IColourImpl* platformColourInstance() { static Win32ColourImpl s_instance; IConfigPtr config = getCurrentContext().getConfig(); UseColour::YesOrNo colourMode = config ? config->useColour() : UseColour::Auto; if (colourMode == UseColour::Auto) colourMode = UseColour::Yes; return colourMode == UseColour::Yes ? &s_instance : NoColourImpl::instance(); } } // namespace } // end namespace Catch #elif defined(CATCH_CONFIG_COLOUR_ANSI) ////////////////////////////////////// #include namespace Catch { namespace { // use POSIX/ ANSI console terminal codes // Thanks to Adam Strzelecki for original contribution // (http://github.com/nanoant) // https://github.com/philsquared/Catch/pull/131 class PosixColourImpl : public IColourImpl { public: virtual void use(Colour::Code _colourCode) override { switch (_colourCode) { case Colour::None: case Colour::White: return setColour("[0m"); case Colour::Red: return setColour("[0;31m"); case Colour::Green: return setColour("[0;32m"); case Colour::Blue: return setColour("[0;34m"); case Colour::Cyan: return setColour("[0;36m"); case Colour::Yellow: return setColour("[0;33m"); case Colour::Grey: return setColour("[1;30m"); case Colour::LightGrey: return setColour("[0;37m"); case Colour::BrightRed: return setColour("[1;31m"); case Colour::BrightGreen: return setColour("[1;32m"); case Colour::BrightWhite: return setColour("[1;37m"); case Colour::BrightYellow: return setColour("[1;33m"); case Colour::Bright: CATCH_INTERNAL_ERROR("not a colour"); default: CATCH_INTERNAL_ERROR("Unknown colour requested"); } } static IColourImpl* instance() { static PosixColourImpl s_instance; return &s_instance; } private: void setColour(const char* _escapeCode) { Catch::cout() << '\033' << _escapeCode; } }; bool useColourOnPlatform() { return #ifdef CATCH_PLATFORM_MAC !isDebuggerActive() && #endif #if !(defined(__DJGPP__) && defined(__STRICT_ANSI__)) isatty(STDOUT_FILENO) #else false #endif ; } IColourImpl* platformColourInstance() { ErrnoGuard guard; IConfigPtr config = getCurrentContext().getConfig(); UseColour::YesOrNo colourMode = config ? config->useColour() : UseColour::Auto; if (colourMode == UseColour::Auto) colourMode = useColourOnPlatform() ? UseColour::Yes : UseColour::No; return colourMode == UseColour::Yes ? PosixColourImpl::instance() : NoColourImpl::instance(); } } // namespace } // end namespace Catch #else // not Windows or ANSI /////////////////////////////////////////////// namespace Catch { static IColourImpl* platformColourInstance() { return NoColourImpl::instance(); } } // end namespace Catch #endif // Windows/ ANSI/ None namespace Catch { Colour::Colour(Code _colourCode) { use(_colourCode); } Colour::Colour(Colour&& rhs) noexcept { m_moved = rhs.m_moved; rhs.m_moved = true; } Colour& Colour::operator=(Colour&& rhs) noexcept { m_moved = rhs.m_moved; rhs.m_moved = true; return *this; } Colour::~Colour() { if (!m_moved) use(None); } void Colour::use(Code _colourCode) { static IColourImpl* impl = platformColourInstance(); impl->use(_colourCode); } std::ostream& operator<<(std::ostream& os, Colour const&) { return os; } } // end namespace Catch #if defined(__clang__) #pragma clang diagnostic pop #endif // end catch_console_colour.cpp // start catch_context.cpp namespace Catch { class Context : public IMutableContext, NonCopyable { public: // IContext virtual IResultCapture* getResultCapture() override { return m_resultCapture; } virtual IRunner* getRunner() override { return m_runner; } virtual IConfigPtr const& getConfig() const override { return m_config; } virtual ~Context() override; public: // IMutableContext virtual void setResultCapture(IResultCapture* resultCapture) override { m_resultCapture = resultCapture; } virtual void setRunner(IRunner* runner) override { m_runner = runner; } virtual void setConfig(IConfigPtr const& config) override { m_config = config; } friend IMutableContext& getCurrentMutableContext(); private: IConfigPtr m_config; IRunner* m_runner = nullptr; IResultCapture* m_resultCapture = nullptr; }; IMutableContext* IMutableContext::currentContext = nullptr; void IMutableContext::createContext() { currentContext = new Context(); } void cleanUpContext() { delete IMutableContext::currentContext; IMutableContext::currentContext = nullptr; } IContext::~IContext() = default; IMutableContext::~IMutableContext() = default; Context::~Context() = default; } // namespace Catch // end catch_context.cpp // start catch_debug_console.cpp // start catch_debug_console.h #include namespace Catch { void writeToDebugConsole(std::string const& text); } // end catch_debug_console.h #ifdef CATCH_PLATFORM_WINDOWS namespace Catch { void writeToDebugConsole(std::string const& text) { ::OutputDebugStringA(text.c_str()); } } // namespace Catch #else namespace Catch { void writeToDebugConsole(std::string const& text) { // !TBD: Need a version for Mac/ XCode and other IDEs Catch::cout() << text; } } // namespace Catch #endif // Platform // end catch_debug_console.cpp // start catch_debugger.cpp #ifdef CATCH_PLATFORM_MAC #include #include #include #include #include #include #include namespace Catch { // The following function is taken directly from the following technical note: // http://developer.apple.com/library/mac/#qa/qa2004/qa1361.html // Returns true if the current process is being debugged (either // running under the debugger or has a debugger attached post facto). bool isDebuggerActive() { int mib[4]; struct kinfo_proc info; std::size_t size; // Initialize the flags so that, if sysctl fails for some bizarre // reason, we get a predictable result. info.kp_proc.p_flag = 0; // Initialize mib, which tells sysctl the info we want, in this case // we're looking for information about a specific process ID. mib[0] = CTL_KERN; mib[1] = KERN_PROC; mib[2] = KERN_PROC_PID; mib[3] = getpid(); // Call sysctl. size = sizeof(info); if (sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, nullptr, 0) != 0) { Catch::cerr() << "\n** Call to sysctl failed - unable to determine if " "debugger is active **\n" << std::endl; return false; } // We're being debugged if the P_TRACED flag is set. return ((info.kp_proc.p_flag & P_TRACED) != 0); } } // namespace Catch #elif defined(CATCH_PLATFORM_LINUX) #include #include namespace Catch { // The standard POSIX way of detecting a debugger is to attempt to // ptrace() the process, but this needs to be done from a child and not // this process itself to still allow attaching to this process later // if wanted, so is rather heavy. Under Linux we have the PID of the // "debugger" (which doesn't need to be gdb, of course, it could also // be strace, for example) in /proc/$PID/status, so just get it from // there instead. bool isDebuggerActive() { // Libstdc++ has a bug, where std::ifstream sets errno to 0 // This way our users can properly assert over errno values ErrnoGuard guard; std::ifstream in("/proc/self/status"); for (std::string line; std::getline(in, line);) { static const int PREFIX_LEN = 11; if (line.compare(0, PREFIX_LEN, "TracerPid:\t") == 0) { // We're traced if the PID is not 0 and no other PID starts // with 0 digit, so it's enough to check for just a single // character. return line.length() > PREFIX_LEN && line[PREFIX_LEN] != '0'; } } return false; } } // namespace Catch #elif defined(_MSC_VER) extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent(); namespace Catch { bool isDebuggerActive() { return IsDebuggerPresent() != 0; } } // namespace Catch #elif defined(__MINGW32__) extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent(); namespace Catch { bool isDebuggerActive() { return IsDebuggerPresent() != 0; } } // namespace Catch #else namespace Catch { bool isDebuggerActive() { return false; } } // namespace Catch #endif // Platform // end catch_debugger.cpp // start catch_decomposer.cpp namespace Catch { ITransientExpression::~ITransientExpression() = default; void formatReconstructedExpression(std::ostream& os, std::string const& lhs, StringRef op, std::string const& rhs) { if (lhs.size() + rhs.size() < 40 && lhs.find('\n') == std::string::npos && rhs.find('\n') == std::string::npos) os << lhs << " " << op << " " << rhs; else os << lhs << "\n" << op << "\n" << rhs; } } // namespace Catch // end catch_decomposer.cpp // start catch_enforce.cpp namespace Catch { #if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) && \ !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS_CUSTOM_HANDLER) [[noreturn]] void throw_exception(std::exception const& e) { Catch::cerr() << "Catch will terminate because it needed to throw an exception.\n" << "The message was: " << e.what() << '\n'; std::terminate(); } #endif } // namespace Catch // end catch_enforce.cpp // start catch_errno_guard.cpp #include namespace Catch { ErrnoGuard::ErrnoGuard() : m_oldErrno(errno) {} ErrnoGuard::~ErrnoGuard() { errno = m_oldErrno; } } // namespace Catch // end catch_errno_guard.cpp // start catch_exception_translator_registry.cpp // start catch_exception_translator_registry.h #include #include #include namespace Catch { class ExceptionTranslatorRegistry : public IExceptionTranslatorRegistry { public: ~ExceptionTranslatorRegistry(); virtual void registerTranslator(const IExceptionTranslator* translator); virtual std::string translateActiveException() const override; std::string tryTranslators() const; private: std::vector> m_translators; }; } // namespace Catch // end catch_exception_translator_registry.h #ifdef __OBJC__ #import "Foundation/Foundation.h" #endif namespace Catch { ExceptionTranslatorRegistry::~ExceptionTranslatorRegistry() {} void ExceptionTranslatorRegistry::registerTranslator( const IExceptionTranslator* translator) { m_translators.push_back( std::unique_ptr(translator)); } #if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) std::string ExceptionTranslatorRegistry::translateActiveException() const { try { #ifdef __OBJC__ // In Objective-C try objective-c exceptions first @try { return tryTranslators(); } @catch (NSException* exception) { return Catch::Detail::stringify([exception description]); } #else // Compiling a mixed mode project with MSVC means that CLR // exceptions will be caught in (...) as well. However, these // do not fill-in std::current_exception and thus lead to crash // when attempting rethrow. // /EHa switch also causes structured exceptions to be caught // here, but they fill-in current_exception properly, so // at worst the output should be a little weird, instead of // causing a crash. if (std::current_exception() == nullptr) { return "Non C++ exception. Possibly a CLR exception."; } return tryTranslators(); #endif } catch (TestFailureException&) { std::rethrow_exception(std::current_exception()); } catch (std::exception& ex) { return ex.what(); } catch (std::string& msg) { return msg; } catch (const char* msg) { return msg; } catch (...) { return "Unknown exception"; } } #else // ^^ Exceptions are enabled // Exceptions are disabled vv std::string ExceptionTranslatorRegistry::translateActiveException() const { CATCH_INTERNAL_ERROR( "Attempted to translate active exception under " "CATCH_CONFIG_DISABLE_EXCEPTIONS!"); } #endif std::string ExceptionTranslatorRegistry::tryTranslators() const { if (m_translators.empty()) std::rethrow_exception(std::current_exception()); else return m_translators[0]->translate(m_translators.begin() + 1, m_translators.end()); } } // namespace Catch // end catch_exception_translator_registry.cpp // start catch_fatal_condition.cpp #if defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmissing-field-initializers" #endif #if defined(CATCH_CONFIG_WINDOWS_SEH) || defined(CATCH_CONFIG_POSIX_SIGNALS) namespace { // Report the error condition void reportFatal(char const* const message) { Catch::getCurrentContext().getResultCapture()->handleFatalErrorCondition( message); } } // namespace #endif // signals/SEH handling #if defined(CATCH_CONFIG_WINDOWS_SEH) namespace Catch { struct SignalDefs { DWORD id; const char* name; }; // There is no 1-1 mapping between signals and windows exceptions. // Windows can easily distinguish between SO and SigSegV, // but SigInt, SigTerm, etc are handled differently. static SignalDefs signalDefs[] = { {EXCEPTION_ILLEGAL_INSTRUCTION, "SIGILL - Illegal instruction signal"}, {EXCEPTION_STACK_OVERFLOW, "SIGSEGV - Stack overflow"}, {EXCEPTION_ACCESS_VIOLATION, "SIGSEGV - Segmentation violation signal"}, {EXCEPTION_INT_DIVIDE_BY_ZERO, "Divide by zero error"}, }; LONG CALLBACK FatalConditionHandler::handleVectoredException( PEXCEPTION_POINTERS ExceptionInfo) { for (auto const& def : signalDefs) { if (ExceptionInfo->ExceptionRecord->ExceptionCode == def.id) { reportFatal(def.name); } } // If its not an exception we care about, pass it along. // This stops us from eating debugger breaks etc. return EXCEPTION_CONTINUE_SEARCH; } FatalConditionHandler::FatalConditionHandler() { isSet = true; // 32k seems enough for Catch to handle stack overflow, // but the value was found experimentally, so there is no strong guarantee guaranteeSize = 32 * 1024; exceptionHandlerHandle = nullptr; // Register as first handler in current chain exceptionHandlerHandle = AddVectoredExceptionHandler(1, handleVectoredException); // Pass in guarantee size to be filled SetThreadStackGuarantee(&guaranteeSize); } void FatalConditionHandler::reset() { if (isSet) { RemoveVectoredExceptionHandler(exceptionHandlerHandle); SetThreadStackGuarantee(&guaranteeSize); exceptionHandlerHandle = nullptr; isSet = false; } } FatalConditionHandler::~FatalConditionHandler() { reset(); } bool FatalConditionHandler::isSet = false; ULONG FatalConditionHandler::guaranteeSize = 0; PVOID FatalConditionHandler::exceptionHandlerHandle = nullptr; } // namespace Catch #elif defined(CATCH_CONFIG_POSIX_SIGNALS) namespace Catch { struct SignalDefs { int id; const char* name; }; // 32kb for the alternate stack seems to be sufficient. However, this value // is experimentally determined, so that's not guaranteed. constexpr static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ; static SignalDefs signalDefs[] = { {SIGINT, "SIGINT - Terminal interrupt signal"}, {SIGILL, "SIGILL - Illegal instruction signal"}, {SIGFPE, "SIGFPE - Floating point error signal"}, {SIGSEGV, "SIGSEGV - Segmentation violation signal"}, {SIGTERM, "SIGTERM - Termination request signal"}, {SIGABRT, "SIGABRT - Abort (abnormal termination) signal"}}; void FatalConditionHandler::handleSignal(int sig) { char const* name = ""; for (auto const& def : signalDefs) { if (sig == def.id) { name = def.name; break; } } reset(); reportFatal(name); raise(sig); } FatalConditionHandler::FatalConditionHandler() { isSet = true; stack_t sigStack; sigStack.ss_sp = altStackMem; sigStack.ss_size = sigStackSize; sigStack.ss_flags = 0; sigaltstack(&sigStack, &oldSigStack); struct sigaction sa = {}; sa.sa_handler = handleSignal; sa.sa_flags = SA_ONSTACK; for (std::size_t i = 0; i < sizeof(signalDefs) / sizeof(SignalDefs); ++i) { sigaction(signalDefs[i].id, &sa, &oldSigActions[i]); } } FatalConditionHandler::~FatalConditionHandler() { reset(); } void FatalConditionHandler::reset() { if (isSet) { // Set signals back to previous values -- hopefully nobody overwrote them in // the meantime for (std::size_t i = 0; i < sizeof(signalDefs) / sizeof(SignalDefs); ++i) { sigaction(signalDefs[i].id, &oldSigActions[i], nullptr); } // Return the old stack sigaltstack(&oldSigStack, nullptr); isSet = false; } } bool FatalConditionHandler::isSet = false; struct sigaction FatalConditionHandler::oldSigActions[sizeof(signalDefs) / sizeof(SignalDefs)] = {}; stack_t FatalConditionHandler::oldSigStack = {}; char FatalConditionHandler::altStackMem[sigStackSize] = {}; } // namespace Catch #else namespace Catch { void FatalConditionHandler::reset() {} } // namespace Catch #endif // signals/SEH handling #if defined(__GNUC__) #pragma GCC diagnostic pop #endif // end catch_fatal_condition.cpp // start catch_generators.cpp // start catch_random_number_generator.h #include #include namespace Catch { struct IConfig; std::mt19937& rng(); void seedRng(IConfig const& config); unsigned int rngSeed(); } // namespace Catch // end catch_random_number_generator.h #include #include namespace Catch { IGeneratorTracker::~IGeneratorTracker() {} namespace Generators { GeneratorBase::~GeneratorBase() {} std::vector randomiseIndices(size_t selectionSize, size_t sourceSize) { assert(selectionSize <= sourceSize); std::vector indices; indices.reserve(selectionSize); std::uniform_int_distribution uid(0, sourceSize - 1); std::set seen; // !TBD: improve this algorithm while (indices.size() < selectionSize) { auto index = uid(rng()); if (seen.insert(index).second) indices.push_back(index); } return indices; } auto acquireGeneratorTracker(SourceLineInfo const& lineInfo) -> IGeneratorTracker& { return getResultCapture().acquireGeneratorTracker(lineInfo); } template <> auto all() -> Generator { return range(std::numeric_limits::min(), std::numeric_limits::max()); } } // namespace Generators } // namespace Catch // end catch_generators.cpp // start catch_interfaces_capture.cpp namespace Catch { IResultCapture::~IResultCapture() = default; } // end catch_interfaces_capture.cpp // start catch_interfaces_config.cpp namespace Catch { IConfig::~IConfig() = default; } // end catch_interfaces_config.cpp // start catch_interfaces_exception.cpp namespace Catch { IExceptionTranslator::~IExceptionTranslator() = default; IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() = default; } // namespace Catch // end catch_interfaces_exception.cpp // start catch_interfaces_registry_hub.cpp namespace Catch { IRegistryHub::~IRegistryHub() = default; IMutableRegistryHub::~IMutableRegistryHub() = default; } // namespace Catch // end catch_interfaces_registry_hub.cpp // start catch_interfaces_reporter.cpp // start catch_reporter_listening.h namespace Catch { class ListeningReporter : public IStreamingReporter { using Reporters = std::vector; Reporters m_listeners; IStreamingReporterPtr m_reporter = nullptr; ReporterPreferences m_preferences; public: ListeningReporter(); void addListener(IStreamingReporterPtr&& listener); void addReporter(IStreamingReporterPtr&& reporter); public: // IStreamingReporter ReporterPreferences getPreferences() const override; void noMatchingTestCases(std::string const& spec) override; static std::set getSupportedVerbosities(); void benchmarkStarting(BenchmarkInfo const& benchmarkInfo) override; void benchmarkEnded(BenchmarkStats const& benchmarkStats) override; void testRunStarting(TestRunInfo const& testRunInfo) override; void testGroupStarting(GroupInfo const& groupInfo) override; void testCaseStarting(TestCaseInfo const& testInfo) override; void sectionStarting(SectionInfo const& sectionInfo) override; void assertionStarting(AssertionInfo const& assertionInfo) override; // The return value indicates if the messages buffer should be cleared: bool assertionEnded(AssertionStats const& assertionStats) override; void sectionEnded(SectionStats const& sectionStats) override; void testCaseEnded(TestCaseStats const& testCaseStats) override; void testGroupEnded(TestGroupStats const& testGroupStats) override; void testRunEnded(TestRunStats const& testRunStats) override; void skipTest(TestCaseInfo const& testInfo) override; bool isMulti() const override; }; } // end namespace Catch // end catch_reporter_listening.h namespace Catch { ReporterConfig::ReporterConfig(IConfigPtr const& _fullConfig) : m_stream(&_fullConfig->stream()), m_fullConfig(_fullConfig) {} ReporterConfig::ReporterConfig(IConfigPtr const& _fullConfig, std::ostream& _stream) : m_stream(&_stream), m_fullConfig(_fullConfig) {} std::ostream& ReporterConfig::stream() const { return *m_stream; } IConfigPtr ReporterConfig::fullConfig() const { return m_fullConfig; } TestRunInfo::TestRunInfo(std::string const& _name) : name(_name) {} GroupInfo::GroupInfo(std::string const& _name, std::size_t _groupIndex, std::size_t _groupsCount) : name(_name), groupIndex(_groupIndex), groupsCounts(_groupsCount) {} AssertionStats::AssertionStats(AssertionResult const& _assertionResult, std::vector const& _infoMessages, Totals const& _totals) : assertionResult(_assertionResult), infoMessages(_infoMessages), totals(_totals) { assertionResult.m_resultData.lazyExpression.m_transientExpression = _assertionResult.m_resultData.lazyExpression.m_transientExpression; if (assertionResult.hasMessage()) { // Copy message into messages list. // !TBD This should have been done earlier, somewhere MessageBuilder builder(assertionResult.getTestMacroName(), assertionResult.getSourceInfo(), assertionResult.getResultType()); builder << assertionResult.getMessage(); builder.m_info.message = builder.m_stream.str(); infoMessages.push_back(builder.m_info); } } AssertionStats::~AssertionStats() = default; SectionStats::SectionStats(SectionInfo const& _sectionInfo, Counts const& _assertions, double _durationInSeconds, bool _missingAssertions) : sectionInfo(_sectionInfo), assertions(_assertions), durationInSeconds(_durationInSeconds), missingAssertions(_missingAssertions) {} SectionStats::~SectionStats() = default; TestCaseStats::TestCaseStats(TestCaseInfo const& _testInfo, Totals const& _totals, std::string const& _stdOut, std::string const& _stdErr, bool _aborting) : testInfo(_testInfo), totals(_totals), stdOut(_stdOut), stdErr(_stdErr), aborting(_aborting) {} TestCaseStats::~TestCaseStats() = default; TestGroupStats::TestGroupStats(GroupInfo const& _groupInfo, Totals const& _totals, bool _aborting) : groupInfo(_groupInfo), totals(_totals), aborting(_aborting) {} TestGroupStats::TestGroupStats(GroupInfo const& _groupInfo) : groupInfo(_groupInfo), aborting(false) {} TestGroupStats::~TestGroupStats() = default; TestRunStats::TestRunStats(TestRunInfo const& _runInfo, Totals const& _totals, bool _aborting) : runInfo(_runInfo), totals(_totals), aborting(_aborting) {} TestRunStats::~TestRunStats() = default; void IStreamingReporter::fatalErrorEncountered(StringRef) {} bool IStreamingReporter::isMulti() const { return false; } IReporterFactory::~IReporterFactory() = default; IReporterRegistry::~IReporterRegistry() = default; } // end namespace Catch // end catch_interfaces_reporter.cpp // start catch_interfaces_runner.cpp namespace Catch { IRunner::~IRunner() = default; } // end catch_interfaces_runner.cpp // start catch_interfaces_testcase.cpp namespace Catch { ITestInvoker::~ITestInvoker() = default; ITestCaseRegistry::~ITestCaseRegistry() = default; } // namespace Catch // end catch_interfaces_testcase.cpp // start catch_leak_detector.cpp #ifdef CATCH_CONFIG_WINDOWS_CRTDBG #include namespace Catch { LeakDetector::LeakDetector() { int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); flag |= _CRTDBG_LEAK_CHECK_DF; flag |= _CRTDBG_ALLOC_MEM_DF; _CrtSetDbgFlag(flag); _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); // Change this to leaking allocation's number to break there _CrtSetBreakAlloc(-1); } } // namespace Catch #else Catch::LeakDetector::LeakDetector() {} #endif Catch::LeakDetector::~LeakDetector() { Catch::cleanUp(); } // end catch_leak_detector.cpp // start catch_list.cpp // start catch_list.h #include namespace Catch { std::size_t listTests(Config const& config); std::size_t listTestsNamesOnly(Config const& config); struct TagInfo { void add(std::string const& spelling); std::string all() const; std::set spellings; std::size_t count = 0; }; std::size_t listTags(Config const& config); std::size_t listReporters(); Option list(Config const& config); } // end namespace Catch // end catch_list.h // start catch_text.h namespace Catch { using namespace clara::TextFlow; } // end catch_text.h #include #include #include namespace Catch { std::size_t listTests(Config const& config) { TestSpec testSpec = config.testSpec(); if (config.hasTestFilters()) Catch::cout() << "Matching test cases:\n"; else { Catch::cout() << "All available test cases:\n"; } auto matchedTestCases = filterTests(getAllTestCasesSorted(config), testSpec, config); for (auto const& testCaseInfo : matchedTestCases) { Colour::Code colour = testCaseInfo.isHidden() ? Colour::SecondaryText : Colour::None; Colour colourGuard(colour); Catch::cout() << Column(testCaseInfo.name).initialIndent(2).indent(4) << "\n"; if (config.verbosity() >= Verbosity::High) { Catch::cout() << Column(Catch::Detail::stringify(testCaseInfo.lineInfo)).indent(4) << std::endl; std::string description = testCaseInfo.description; if (description.empty()) description = "(NO DESCRIPTION)"; Catch::cout() << Column(description).indent(4) << std::endl; } if (!testCaseInfo.tags.empty()) Catch::cout() << Column(testCaseInfo.tagsAsString()).indent(6) << "\n"; } if (!config.hasTestFilters()) Catch::cout() << pluralise(matchedTestCases.size(), "test case") << '\n' << std::endl; else Catch::cout() << pluralise(matchedTestCases.size(), "matching test case") << '\n' << std::endl; return matchedTestCases.size(); } std::size_t listTestsNamesOnly(Config const& config) { TestSpec testSpec = config.testSpec(); std::size_t matchedTests = 0; std::vector matchedTestCases = filterTests(getAllTestCasesSorted(config), testSpec, config); for (auto const& testCaseInfo : matchedTestCases) { matchedTests++; if (startsWith(testCaseInfo.name, '#')) Catch::cout() << '"' << testCaseInfo.name << '"'; else Catch::cout() << testCaseInfo.name; if (config.verbosity() >= Verbosity::High) Catch::cout() << "\t@" << testCaseInfo.lineInfo; Catch::cout() << std::endl; } return matchedTests; } void TagInfo::add(std::string const& spelling) { ++count; spellings.insert(spelling); } std::string TagInfo::all() const { std::string out; for (auto const& spelling : spellings) out += "[" + spelling + "]"; return out; } std::size_t listTags(Config const& config) { TestSpec testSpec = config.testSpec(); if (config.hasTestFilters()) Catch::cout() << "Tags for matching test cases:\n"; else { Catch::cout() << "All available tags:\n"; } std::map tagCounts; std::vector matchedTestCases = filterTests(getAllTestCasesSorted(config), testSpec, config); for (auto const& testCase : matchedTestCases) { for (auto const& tagName : testCase.getTestCaseInfo().tags) { std::string lcaseTagName = toLower(tagName); auto countIt = tagCounts.find(lcaseTagName); if (countIt == tagCounts.end()) countIt = tagCounts.insert(std::make_pair(lcaseTagName, TagInfo())).first; countIt->second.add(tagName); } } for (auto const& tagCount : tagCounts) { ReusableStringStream rss; rss << " " << std::setw(2) << tagCount.second.count << " "; auto str = rss.str(); auto wrapper = Column(tagCount.second.all()) .initialIndent(0) .indent(str.size()) .width(CATCH_CONFIG_CONSOLE_WIDTH - 10); Catch::cout() << str << wrapper << '\n'; } Catch::cout() << pluralise(tagCounts.size(), "tag") << '\n' << std::endl; return tagCounts.size(); } std::size_t listReporters() { Catch::cout() << "Available reporters:\n"; IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); std::size_t maxNameLen = 0; for (auto const& factoryKvp : factories) maxNameLen = (std::max)(maxNameLen, factoryKvp.first.size()); for (auto const& factoryKvp : factories) { Catch::cout() << Column(factoryKvp.first + ":").indent(2).width(5 + maxNameLen) + Column(factoryKvp.second->getDescription()) .initialIndent(0) .indent(2) .width(CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen - 8) << "\n"; } Catch::cout() << std::endl; return factories.size(); } Option list(Config const& config) { Option listedCount; if (config.listTests()) listedCount = listedCount.valueOr(0) + listTests(config); if (config.listTestNamesOnly()) listedCount = listedCount.valueOr(0) + listTestsNamesOnly(config); if (config.listTags()) listedCount = listedCount.valueOr(0) + listTags(config); if (config.listReporters()) listedCount = listedCount.valueOr(0) + listReporters(); return listedCount; } } // end namespace Catch // end catch_list.cpp // start catch_matchers.cpp namespace Catch { namespace Matchers { namespace Impl { std::string MatcherUntypedBase::toString() const { if (m_cachedToString.empty()) m_cachedToString = describe(); return m_cachedToString; } MatcherUntypedBase::~MatcherUntypedBase() = default; } // namespace Impl } // namespace Matchers using namespace Matchers; using Matchers::Impl::MatcherBase; } // namespace Catch // end catch_matchers.cpp // start catch_matchers_floating.cpp // start catch_polyfills.hpp namespace Catch { bool isnan(float f); bool isnan(double d); } // namespace Catch // end catch_polyfills.hpp // start catch_to_string.hpp #include namespace Catch { template std::string to_string(T const& t) { #if defined(CATCH_CONFIG_CPP11_TO_STRING) return std::to_string(t); #else ReusableStringStream rss; rss << t; return rss.str(); #endif } } // end namespace Catch // end catch_to_string.hpp #include #include #include namespace Catch { namespace Matchers { namespace Floating { enum class FloatingPointKind : uint8_t { Float, Double }; } } // namespace Matchers } // namespace Catch namespace { template struct Converter; template <> struct Converter { static_assert(sizeof(float) == sizeof(int32_t), "Important ULP matcher assumption violated"); Converter(float f) { std::memcpy(&i, &f, sizeof(f)); } int32_t i; }; template <> struct Converter { static_assert(sizeof(double) == sizeof(int64_t), "Important ULP matcher assumption violated"); Converter(double d) { std::memcpy(&i, &d, sizeof(d)); } int64_t i; }; template auto convert(T t) -> Converter { return Converter(t); } template bool almostEqualUlps(FP lhs, FP rhs, int maxUlpDiff) { // Comparison with NaN should always be false. // This way we can rule it out before getting into the ugly details if (Catch::isnan(lhs) || Catch::isnan(rhs)) { return false; } auto lc = convert(lhs); auto rc = convert(rhs); if ((lc.i < 0) != (rc.i < 0)) { // Potentially we can have +0 and -0 return lhs == rhs; } auto ulpDiff = std::abs(lc.i - rc.i); return ulpDiff <= maxUlpDiff; } } // namespace namespace Catch { namespace Matchers { namespace Floating { WithinAbsMatcher::WithinAbsMatcher(double target, double margin) : m_target{target}, m_margin{margin} { CATCH_ENFORCE( margin >= 0, "Invalid margin: " << margin << '.' << " Margin has to be non-negative."); } // Performs equivalent check of std::fabs(lhs - rhs) <= margin // But without the subtraction to allow for INFINITY in comparison bool WithinAbsMatcher::match(double const& matchee) const { return (matchee + m_margin >= m_target) && (m_target + m_margin >= matchee); } std::string WithinAbsMatcher::describe() const { return "is within " + ::Catch::Detail::stringify(m_margin) + " of " + ::Catch::Detail::stringify(m_target); } WithinUlpsMatcher::WithinUlpsMatcher(double target, int ulps, FloatingPointKind baseType) : m_target{target}, m_ulps{ulps}, m_type{baseType} { CATCH_ENFORCE(ulps >= 0, "Invalid ULP setting: " << ulps << '.' << " ULPs have to be non-negative."); } #if defined(__clang__) #pragma clang diagnostic push // Clang <3.5 reports on the default branch in the switch below #pragma clang diagnostic ignored "-Wunreachable-code" #endif bool WithinUlpsMatcher::match(double const& matchee) const { switch (m_type) { case FloatingPointKind::Float: return almostEqualUlps(static_cast(matchee), static_cast(m_target), m_ulps); case FloatingPointKind::Double: return almostEqualUlps(matchee, m_target, m_ulps); default: CATCH_INTERNAL_ERROR("Unknown FloatingPointKind value"); } } #if defined(__clang__) #pragma clang diagnostic pop #endif std::string WithinUlpsMatcher::describe() const { return "is within " + Catch::to_string(m_ulps) + " ULPs of " + ::Catch::Detail::stringify(m_target) + ((m_type == FloatingPointKind::Float) ? "f" : ""); } } // namespace Floating Floating::WithinUlpsMatcher WithinULP(double target, int maxUlpDiff) { return Floating::WithinUlpsMatcher(target, maxUlpDiff, Floating::FloatingPointKind::Double); } Floating::WithinUlpsMatcher WithinULP(float target, int maxUlpDiff) { return Floating::WithinUlpsMatcher(target, maxUlpDiff, Floating::FloatingPointKind::Float); } Floating::WithinAbsMatcher WithinAbs(double target, double margin) { return Floating::WithinAbsMatcher(target, margin); } } // namespace Matchers } // namespace Catch // end catch_matchers_floating.cpp // start catch_matchers_generic.cpp std::string Catch::Matchers::Generic::Detail::finalizeDescription( const std::string& desc) { if (desc.empty()) { return "matches undescribed predicate"; } else { return "matches predicate: \"" + desc + '"'; } } // end catch_matchers_generic.cpp // start catch_matchers_string.cpp #include namespace Catch { namespace Matchers { namespace StdString { CasedString::CasedString(std::string const& str, CaseSensitive::Choice caseSensitivity) : m_caseSensitivity(caseSensitivity), m_str(adjustString(str)) {} std::string CasedString::adjustString(std::string const& str) const { return m_caseSensitivity == CaseSensitive::No ? toLower(str) : str; } std::string CasedString::caseSensitivitySuffix() const { return m_caseSensitivity == CaseSensitive::No ? " (case insensitive)" : std::string(); } StringMatcherBase::StringMatcherBase(std::string const& operation, CasedString const& comparator) : m_comparator(comparator), m_operation(operation) {} std::string StringMatcherBase::describe() const { std::string description; description.reserve(5 + m_operation.size() + m_comparator.m_str.size() + m_comparator.caseSensitivitySuffix().size()); description += m_operation; description += ": \""; description += m_comparator.m_str; description += "\""; description += m_comparator.caseSensitivitySuffix(); return description; } EqualsMatcher::EqualsMatcher(CasedString const& comparator) : StringMatcherBase("equals", comparator) {} bool EqualsMatcher::match(std::string const& source) const { return m_comparator.adjustString(source) == m_comparator.m_str; } ContainsMatcher::ContainsMatcher(CasedString const& comparator) : StringMatcherBase("contains", comparator) {} bool ContainsMatcher::match(std::string const& source) const { return contains(m_comparator.adjustString(source), m_comparator.m_str); } StartsWithMatcher::StartsWithMatcher(CasedString const& comparator) : StringMatcherBase("starts with", comparator) {} bool StartsWithMatcher::match(std::string const& source) const { return startsWith(m_comparator.adjustString(source), m_comparator.m_str); } EndsWithMatcher::EndsWithMatcher(CasedString const& comparator) : StringMatcherBase("ends with", comparator) {} bool EndsWithMatcher::match(std::string const& source) const { return endsWith(m_comparator.adjustString(source), m_comparator.m_str); } RegexMatcher::RegexMatcher(std::string regex, CaseSensitive::Choice caseSensitivity) : m_regex(std::move(regex)), m_caseSensitivity(caseSensitivity) {} bool RegexMatcher::match(std::string const& matchee) const { auto flags = std::regex::ECMAScript; // ECMAScript is the default syntax option anyway if (m_caseSensitivity == CaseSensitive::Choice::No) { flags |= std::regex::icase; } auto reg = std::regex(m_regex, flags); return std::regex_match(matchee, reg); } std::string RegexMatcher::describe() const { return "matches " + ::Catch::Detail::stringify(m_regex) + ((m_caseSensitivity == CaseSensitive::Choice::Yes) ? " case sensitively" : " case insensitively"); } } // namespace StdString StdString::EqualsMatcher Equals(std::string const& str, CaseSensitive::Choice caseSensitivity) { return StdString::EqualsMatcher(StdString::CasedString(str, caseSensitivity)); } StdString::ContainsMatcher Contains(std::string const& str, CaseSensitive::Choice caseSensitivity) { return StdString::ContainsMatcher( StdString::CasedString(str, caseSensitivity)); } StdString::EndsWithMatcher EndsWith(std::string const& str, CaseSensitive::Choice caseSensitivity) { return StdString::EndsWithMatcher( StdString::CasedString(str, caseSensitivity)); } StdString::StartsWithMatcher StartsWith(std::string const& str, CaseSensitive::Choice caseSensitivity) { return StdString::StartsWithMatcher( StdString::CasedString(str, caseSensitivity)); } StdString::RegexMatcher Matches(std::string const& regex, CaseSensitive::Choice caseSensitivity) { return StdString::RegexMatcher(regex, caseSensitivity); } } // namespace Matchers } // namespace Catch // end catch_matchers_string.cpp // start catch_message.cpp // start catch_uncaught_exceptions.h namespace Catch { bool uncaught_exceptions(); } // end namespace Catch // end catch_uncaught_exceptions.h #include #include namespace Catch { MessageInfo::MessageInfo(StringRef const& _macroName, SourceLineInfo const& _lineInfo, ResultWas::OfType _type) : macroName(_macroName), lineInfo(_lineInfo), type(_type), sequence(++globalCount) {} bool MessageInfo::operator==(MessageInfo const& other) const { return sequence == other.sequence; } bool MessageInfo::operator<(MessageInfo const& other) const { return sequence < other.sequence; } // This may need protecting if threading support is added unsigned int MessageInfo::globalCount = 0; //////////////////////////////////////////////////////////////////////////// Catch::MessageBuilder::MessageBuilder(StringRef const& macroName, SourceLineInfo const& lineInfo, ResultWas::OfType type) : m_info(macroName, lineInfo, type) {} //////////////////////////////////////////////////////////////////////////// ScopedMessage::ScopedMessage(MessageBuilder const& builder) : m_info(builder.m_info) { m_info.message = builder.m_stream.str(); getResultCapture().pushScopedMessage(m_info); } ScopedMessage::~ScopedMessage() { if (!uncaught_exceptions()) { getResultCapture().popScopedMessage(m_info); } } Capturer::Capturer(StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names) { auto trimmed = [&](size_t start, size_t end) { while (names[start] == ',' || isspace(names[start])) { ++start; } while (names[end] == ',' || isspace(names[end])) { --end; } return names.substr(start, end - start + 1); }; size_t start = 0; std::stack openings; for (size_t pos = 0; pos < names.size(); ++pos) { char c = names[pos]; switch (c) { case '[': case '{': case '(': // It is basically impossible to disambiguate between // comparison and start of template args in this context // case '<': openings.push(c); break; case ']': case '}': case ')': // case '>': openings.pop(); break; case ',': if (start != pos && openings.size() == 0) { m_messages.emplace_back(macroName, lineInfo, resultType); m_messages.back().message = trimmed(start, pos); m_messages.back().message += " := "; start = pos; } } } assert(openings.size() == 0 && "Mismatched openings"); m_messages.emplace_back(macroName, lineInfo, resultType); m_messages.back().message = trimmed(start, names.size() - 1); m_messages.back().message += " := "; } Capturer::~Capturer() { if (!uncaught_exceptions()) { assert(m_captured == m_messages.size()); for (size_t i = 0; i < m_captured; ++i) m_resultCapture.popScopedMessage(m_messages[i]); } } void Capturer::captureValue(size_t index, std::string const& value) { assert(index < m_messages.size()); m_messages[index].message += value; m_resultCapture.pushScopedMessage(m_messages[index]); m_captured++; } } // end namespace Catch // end catch_message.cpp // start catch_output_redirect.cpp // start catch_output_redirect.h #ifndef TWOBLUECUBES_CATCH_OUTPUT_REDIRECT_H #define TWOBLUECUBES_CATCH_OUTPUT_REDIRECT_H #include #include #include namespace Catch { class RedirectedStream { std::ostream& m_originalStream; std::ostream& m_redirectionStream; std::streambuf* m_prevBuf; public: RedirectedStream(std::ostream& originalStream, std::ostream& redirectionStream); ~RedirectedStream(); }; class RedirectedStdOut { ReusableStringStream m_rss; RedirectedStream m_cout; public: RedirectedStdOut(); auto str() const -> std::string; }; // StdErr has two constituent streams in C++, std::cerr and std::clog // This means that we need to redirect 2 streams into 1 to keep proper // order of writes class RedirectedStdErr { ReusableStringStream m_rss; RedirectedStream m_cerr; RedirectedStream m_clog; public: RedirectedStdErr(); auto str() const -> std::string; }; #if defined(CATCH_CONFIG_NEW_CAPTURE) // Windows's implementation of std::tmpfile is terrible (it tries // to create a file inside system folder, thus requiring elevated // privileges for the binary), so we have to use tmpnam(_s) and // create the file ourselves there. class TempFile { public: TempFile(TempFile const&) = delete; TempFile& operator=(TempFile const&) = delete; TempFile(TempFile&&) = delete; TempFile& operator=(TempFile&&) = delete; TempFile(); ~TempFile(); std::FILE* getFile(); std::string getContents(); private: std::FILE* m_file = nullptr; #if defined(_MSC_VER) char m_buffer[L_tmpnam] = {0}; #endif }; class OutputRedirect { public: OutputRedirect(OutputRedirect const&) = delete; OutputRedirect& operator=(OutputRedirect const&) = delete; OutputRedirect(OutputRedirect&&) = delete; OutputRedirect& operator=(OutputRedirect&&) = delete; OutputRedirect(std::string& stdout_dest, std::string& stderr_dest); ~OutputRedirect(); private: int m_originalStdout = -1; int m_originalStderr = -1; TempFile m_stdoutFile; TempFile m_stderrFile; std::string& m_stdoutDest; std::string& m_stderrDest; }; #endif } // end namespace Catch #endif // TWOBLUECUBES_CATCH_OUTPUT_REDIRECT_H // end catch_output_redirect.h #include #include #include #include #include #if defined(CATCH_CONFIG_NEW_CAPTURE) #if defined(_MSC_VER) #include //_dup and _dup2 #define dup _dup #define dup2 _dup2 #define fileno _fileno #else #include // dup and dup2 #endif #endif namespace Catch { RedirectedStream::RedirectedStream(std::ostream& originalStream, std::ostream& redirectionStream) : m_originalStream(originalStream), m_redirectionStream(redirectionStream), m_prevBuf(m_originalStream.rdbuf()) { m_originalStream.rdbuf(m_redirectionStream.rdbuf()); } RedirectedStream::~RedirectedStream() { m_originalStream.rdbuf(m_prevBuf); } RedirectedStdOut::RedirectedStdOut() : m_cout(Catch::cout(), m_rss.get()) {} auto RedirectedStdOut::str() const -> std::string { return m_rss.str(); } RedirectedStdErr::RedirectedStdErr() : m_cerr(Catch::cerr(), m_rss.get()), m_clog(Catch::clog(), m_rss.get()) {} auto RedirectedStdErr::str() const -> std::string { return m_rss.str(); } #if defined(CATCH_CONFIG_NEW_CAPTURE) #if defined(_MSC_VER) TempFile::TempFile() { if (tmpnam_s(m_buffer)) { CATCH_RUNTIME_ERROR("Could not get a temp filename"); } if (fopen_s(&m_file, m_buffer, "w")) { char buffer[100]; if (strerror_s(buffer, errno)) { CATCH_RUNTIME_ERROR("Could not translate errno to a string"); } CATCH_RUNTIME_ERROR("Coul dnot open the temp file: '" << m_buffer << "' because: " << buffer); } } #else TempFile::TempFile() { m_file = std::tmpfile(); if (!m_file) { CATCH_RUNTIME_ERROR("Could not create a temp file."); } } #endif TempFile::~TempFile() { // TBD: What to do about errors here? std::fclose(m_file); // We manually create the file on Windows only, on Linux // it will be autodeleted #if defined(_MSC_VER) std::remove(m_buffer); #endif } FILE* TempFile::getFile() { return m_file; } std::string TempFile::getContents() { std::stringstream sstr; char buffer[100] = {}; std::rewind(m_file); while (std::fgets(buffer, sizeof(buffer), m_file)) { sstr << buffer; } return sstr.str(); } OutputRedirect::OutputRedirect(std::string& stdout_dest, std::string& stderr_dest) : m_originalStdout(dup(1)), m_originalStderr(dup(2)), m_stdoutDest(stdout_dest), m_stderrDest(stderr_dest) { dup2(fileno(m_stdoutFile.getFile()), 1); dup2(fileno(m_stderrFile.getFile()), 2); } OutputRedirect::~OutputRedirect() { Catch::cout() << std::flush; fflush(stdout); // Since we support overriding these streams, we flush cerr // even though std::cerr is unbuffered Catch::cerr() << std::flush; Catch::clog() << std::flush; fflush(stderr); dup2(m_originalStdout, 1); dup2(m_originalStderr, 2); m_stdoutDest += m_stdoutFile.getContents(); m_stderrDest += m_stderrFile.getContents(); } #endif // CATCH_CONFIG_NEW_CAPTURE } // namespace Catch #if defined(CATCH_CONFIG_NEW_CAPTURE) #if defined(_MSC_VER) #undef dup #undef dup2 #undef fileno #endif #endif // end catch_output_redirect.cpp // start catch_polyfills.cpp #include namespace Catch { #if !defined(CATCH_CONFIG_POLYFILL_ISNAN) bool isnan(float f) { return std::isnan(f); } bool isnan(double d) { return std::isnan(d); } #else // For now we only use this for embarcadero bool isnan(float f) { return std::_isnan(f); } bool isnan(double d) { return std::_isnan(d); } #endif } // end namespace Catch // end catch_polyfills.cpp // start catch_random_number_generator.cpp namespace Catch { std::mt19937& rng() { static std::mt19937 s_rng; return s_rng; } void seedRng(IConfig const& config) { if (config.rngSeed() != 0) { std::srand(config.rngSeed()); rng().seed(config.rngSeed()); } } unsigned int rngSeed() { return getCurrentContext().getConfig()->rngSeed(); } } // namespace Catch // end catch_random_number_generator.cpp // start catch_registry_hub.cpp // start catch_test_case_registry_impl.h #include #include #include #include namespace Catch { class TestCase; struct IConfig; std::vector sortTests(IConfig const& config, std::vector const& unsortedTestCases); bool matchTest(TestCase const& testCase, TestSpec const& testSpec, IConfig const& config); void enforceNoDuplicateTestCases(std::vector const& functions); std::vector filterTests(std::vector const& testCases, TestSpec const& testSpec, IConfig const& config); std::vector const& getAllTestCasesSorted(IConfig const& config); class TestRegistry : public ITestCaseRegistry { public: virtual ~TestRegistry() = default; virtual void registerTest(TestCase const& testCase); std::vector const& getAllTests() const override; std::vector const& getAllTestsSorted( IConfig const& config) const override; private: std::vector m_functions; mutable RunTests::InWhatOrder m_currentSortOrder = RunTests::InDeclarationOrder; mutable std::vector m_sortedFunctions; std::size_t m_unnamedCount = 0; std::ios_base::Init m_ostreamInit; // Forces cout/ cerr to be initialised }; /////////////////////////////////////////////////////////////////////////// class TestInvokerAsFunction : public ITestInvoker { void (*m_testAsFunction)(); public: TestInvokerAsFunction(void (*testAsFunction)()) noexcept; void invoke() const override; }; std::string extractClassName(StringRef const& classOrQualifiedMethodName); /////////////////////////////////////////////////////////////////////////// } // end namespace Catch // end catch_test_case_registry_impl.h // start catch_reporter_registry.h #include namespace Catch { class ReporterRegistry : public IReporterRegistry { public: ~ReporterRegistry() override; IStreamingReporterPtr create(std::string const& name, IConfigPtr const& config) const override; void registerReporter(std::string const& name, IReporterFactoryPtr const& factory); void registerListener(IReporterFactoryPtr const& factory); FactoryMap const& getFactories() const override; Listeners const& getListeners() const override; private: FactoryMap m_factories; Listeners m_listeners; }; } // namespace Catch // end catch_reporter_registry.h // start catch_tag_alias_registry.h // start catch_tag_alias.h #include namespace Catch { struct TagAlias { TagAlias(std::string const& _tag, SourceLineInfo _lineInfo); std::string tag; SourceLineInfo lineInfo; }; } // end namespace Catch // end catch_tag_alias.h #include namespace Catch { class TagAliasRegistry : public ITagAliasRegistry { public: ~TagAliasRegistry() override; TagAlias const* find(std::string const& alias) const override; std::string expandAliases( std::string const& unexpandedTestSpec) const override; void add(std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo); private: std::map m_registry; }; } // end namespace Catch // end catch_tag_alias_registry.h // start catch_startup_exception_registry.h #include #include namespace Catch { class StartupExceptionRegistry { public: void add(std::exception_ptr const& exception) noexcept; std::vector const& getExceptions() const noexcept; private: std::vector m_exceptions; }; } // end namespace Catch // end catch_startup_exception_registry.h // start catch_singletons.hpp namespace Catch { struct ISingleton { virtual ~ISingleton(); }; void addSingleton(ISingleton* singleton); void cleanupSingletons(); template class Singleton : SingletonImplT, public ISingleton { static auto getInternal() -> Singleton* { static Singleton* s_instance = nullptr; if (!s_instance) { s_instance = new Singleton; addSingleton(s_instance); } return s_instance; } public: static auto get() -> InterfaceT const& { return *getInternal(); } static auto getMutable() -> MutableInterfaceT& { return *getInternal(); } }; } // namespace Catch // end catch_singletons.hpp namespace Catch { namespace { class RegistryHub : public IRegistryHub, public IMutableRegistryHub, private NonCopyable { public: // IRegistryHub RegistryHub() = default; IReporterRegistry const& getReporterRegistry() const override { return m_reporterRegistry; } ITestCaseRegistry const& getTestCaseRegistry() const override { return m_testCaseRegistry; } IExceptionTranslatorRegistry const& getExceptionTranslatorRegistry() const override { return m_exceptionTranslatorRegistry; } ITagAliasRegistry const& getTagAliasRegistry() const override { return m_tagAliasRegistry; } StartupExceptionRegistry const& getStartupExceptionRegistry() const override { return m_exceptionRegistry; } public: // IMutableRegistryHub void registerReporter(std::string const& name, IReporterFactoryPtr const& factory) override { m_reporterRegistry.registerReporter(name, factory); } void registerListener(IReporterFactoryPtr const& factory) override { m_reporterRegistry.registerListener(factory); } void registerTest(TestCase const& testInfo) override { m_testCaseRegistry.registerTest(testInfo); } void registerTranslator(const IExceptionTranslator* translator) override { m_exceptionTranslatorRegistry.registerTranslator(translator); } void registerTagAlias(std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo) override { m_tagAliasRegistry.add(alias, tag, lineInfo); } void registerStartupException() noexcept override { m_exceptionRegistry.add(std::current_exception()); } private: TestRegistry m_testCaseRegistry; ReporterRegistry m_reporterRegistry; ExceptionTranslatorRegistry m_exceptionTranslatorRegistry; TagAliasRegistry m_tagAliasRegistry; StartupExceptionRegistry m_exceptionRegistry; }; } // namespace using RegistryHubSingleton = Singleton; IRegistryHub const& getRegistryHub() { return RegistryHubSingleton::get(); } IMutableRegistryHub& getMutableRegistryHub() { return RegistryHubSingleton::getMutable(); } void cleanUp() { cleanupSingletons(); cleanUpContext(); } std::string translateActiveException() { return getRegistryHub() .getExceptionTranslatorRegistry() .translateActiveException(); } } // end namespace Catch // end catch_registry_hub.cpp // start catch_reporter_registry.cpp namespace Catch { ReporterRegistry::~ReporterRegistry() = default; IStreamingReporterPtr ReporterRegistry::create(std::string const& name, IConfigPtr const& config) const { auto it = m_factories.find(name); if (it == m_factories.end()) return nullptr; return it->second->create(ReporterConfig(config)); } void ReporterRegistry::registerReporter(std::string const& name, IReporterFactoryPtr const& factory) { m_factories.emplace(name, factory); } void ReporterRegistry::registerListener(IReporterFactoryPtr const& factory) { m_listeners.push_back(factory); } IReporterRegistry::FactoryMap const& ReporterRegistry::getFactories() const { return m_factories; } IReporterRegistry::Listeners const& ReporterRegistry::getListeners() const { return m_listeners; } } // namespace Catch // end catch_reporter_registry.cpp // start catch_result_type.cpp namespace Catch { bool isOk(ResultWas::OfType resultType) { return (resultType & ResultWas::FailureBit) == 0; } bool isJustInfo(int flags) { return flags == ResultWas::Info; } ResultDisposition::Flags operator|(ResultDisposition::Flags lhs, ResultDisposition::Flags rhs) { return static_cast(static_cast(lhs) | static_cast(rhs)); } bool shouldContinueOnFailure(int flags) { return (flags & ResultDisposition::ContinueOnFailure) != 0; } bool shouldSuppressFailure(int flags) { return (flags & ResultDisposition::SuppressFail) != 0; } } // end namespace Catch // end catch_result_type.cpp // start catch_run_context.cpp #include #include #include namespace Catch { namespace Generators { struct GeneratorTracker : TestCaseTracking::TrackerBase, IGeneratorTracker { size_t m_index = static_cast(-1); GeneratorBasePtr m_generator; GeneratorTracker(TestCaseTracking::NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent) : TrackerBase(nameAndLocation, ctx, parent) {} ~GeneratorTracker(); static GeneratorTracker& acquire( TrackerContext& ctx, TestCaseTracking::NameAndLocation const& nameAndLocation) { std::shared_ptr tracker; ITracker& currentTracker = ctx.currentTracker(); if (TestCaseTracking::ITrackerPtr childTracker = currentTracker.findChild(nameAndLocation)) { assert(childTracker); assert(childTracker->isIndexTracker()); tracker = std::static_pointer_cast(childTracker); } else { tracker = std::make_shared(nameAndLocation, ctx, ¤tTracker); currentTracker.addChild(tracker); } if (!ctx.completedCycle() && !tracker->isComplete()) { if (tracker->m_runState != ExecutingChildren && tracker->m_runState != NeedsAnotherRun) tracker->moveNext(); tracker->open(); } return *tracker; } void moveNext() { m_index++; m_children.clear(); } // TrackerBase interface bool isIndexTracker() const override { return true; } auto hasGenerator() const -> bool override { return !!m_generator; } void close() override { TrackerBase::close(); if (m_runState == CompletedSuccessfully && m_index < m_generator->size() - 1) m_runState = Executing; } // IGeneratorTracker interface auto getGenerator() const -> GeneratorBasePtr const& override { return m_generator; } void setGenerator(GeneratorBasePtr&& generator) override { m_generator = std::move(generator); } auto getIndex() const -> size_t override { return m_index; } }; GeneratorTracker::~GeneratorTracker() {} } // namespace Generators RunContext::RunContext(IConfigPtr const& _config, IStreamingReporterPtr&& reporter) : m_runInfo(_config->name()), m_context(getCurrentMutableContext()), m_config(_config), m_reporter(std::move(reporter)), m_lastAssertionInfo{StringRef(), SourceLineInfo("", 0), StringRef(), ResultDisposition::Normal}, m_includeSuccessfulResults( m_config->includeSuccessfulResults() || m_reporter->getPreferences().shouldReportAllAssertions) { m_context.setRunner(this); m_context.setConfig(m_config); m_context.setResultCapture(this); m_reporter->testRunStarting(m_runInfo); } RunContext::~RunContext() { m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, aborting())); } void RunContext::testGroupStarting(std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount) { m_reporter->testGroupStarting(GroupInfo(testSpec, groupIndex, groupsCount)); } void RunContext::testGroupEnded(std::string const& testSpec, Totals const& totals, std::size_t groupIndex, std::size_t groupsCount) { m_reporter->testGroupEnded(TestGroupStats( GroupInfo(testSpec, groupIndex, groupsCount), totals, aborting())); } Totals RunContext::runTest(TestCase const& testCase) { Totals prevTotals = m_totals; std::string redirectedCout; std::string redirectedCerr; auto const& testInfo = testCase.getTestCaseInfo(); m_reporter->testCaseStarting(testInfo); m_activeTestCase = &testCase; ITracker& rootTracker = m_trackerContext.startRun(); assert(rootTracker.isSectionTracker()); static_cast(rootTracker) .addInitialFilters(m_config->getSectionsToRun()); do { m_trackerContext.startCycle(); m_testCaseTracker = &SectionTracker::acquire( m_trackerContext, TestCaseTracking::NameAndLocation(testInfo.name, testInfo.lineInfo)); runCurrentTest(redirectedCout, redirectedCerr); } while (!m_testCaseTracker->isSuccessfullyCompleted() && !aborting()); Totals deltaTotals = m_totals.delta(prevTotals); if (testInfo.expectedToFail() && deltaTotals.testCases.passed > 0) { deltaTotals.assertions.failed++; deltaTotals.testCases.passed--; deltaTotals.testCases.failed++; } m_totals.testCases += deltaTotals.testCases; m_reporter->testCaseEnded(TestCaseStats(testInfo, deltaTotals, redirectedCout, redirectedCerr, aborting())); m_activeTestCase = nullptr; m_testCaseTracker = nullptr; return deltaTotals; } IConfigPtr RunContext::config() const { return m_config; } IStreamingReporter& RunContext::reporter() const { return *m_reporter; } void RunContext::assertionEnded(AssertionResult const& result) { if (result.getResultType() == ResultWas::Ok) { m_totals.assertions.passed++; m_lastAssertionPassed = true; } else if (!result.isOk()) { m_lastAssertionPassed = false; if (m_activeTestCase->getTestCaseInfo().okToFail()) m_totals.assertions.failedButOk++; else m_totals.assertions.failed++; } else { m_lastAssertionPassed = true; } // We have no use for the return value (whether messages should be cleared), // because messages were made scoped and should be let to clear themselves // out. static_cast( m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals))); // Reset working state resetAssertionInfo(); m_lastResult = result; } void RunContext::resetAssertionInfo() { m_lastAssertionInfo.macroName = StringRef(); m_lastAssertionInfo.capturedExpression = "{Unknown expression after the reported line}"_sr; } bool RunContext::sectionStarted(SectionInfo const& sectionInfo, Counts& assertions) { ITracker& sectionTracker = SectionTracker::acquire( m_trackerContext, TestCaseTracking::NameAndLocation( sectionInfo.name, sectionInfo.lineInfo)); if (!sectionTracker.isOpen()) return false; m_activeSections.push_back(§ionTracker); m_lastAssertionInfo.lineInfo = sectionInfo.lineInfo; m_reporter->sectionStarting(sectionInfo); assertions = m_totals.assertions; return true; } auto RunContext::acquireGeneratorTracker(SourceLineInfo const& lineInfo) -> IGeneratorTracker& { using namespace Generators; GeneratorTracker& tracker = GeneratorTracker::acquire( m_trackerContext, TestCaseTracking::NameAndLocation("generator", lineInfo)); assert(tracker.isOpen()); m_lastAssertionInfo.lineInfo = lineInfo; return tracker; } bool RunContext::testForMissingAssertions(Counts& assertions) { if (assertions.total() != 0) return false; if (!m_config->warnAboutMissingAssertions()) return false; if (m_trackerContext.currentTracker().hasChildren()) return false; m_totals.assertions.failed++; assertions.failed++; return true; } void RunContext::sectionEnded(SectionEndInfo const& endInfo) { Counts assertions = m_totals.assertions - endInfo.prevAssertions; bool missingAssertions = testForMissingAssertions(assertions); if (!m_activeSections.empty()) { m_activeSections.back()->close(); m_activeSections.pop_back(); } m_reporter->sectionEnded(SectionStats(endInfo.sectionInfo, assertions, endInfo.durationInSeconds, missingAssertions)); m_messages.clear(); } void RunContext::sectionEndedEarly(SectionEndInfo const& endInfo) { if (m_unfinishedSections.empty()) m_activeSections.back()->fail(); else m_activeSections.back()->close(); m_activeSections.pop_back(); m_unfinishedSections.push_back(endInfo); } void RunContext::benchmarkStarting(BenchmarkInfo const& info) { m_reporter->benchmarkStarting(info); } void RunContext::benchmarkEnded(BenchmarkStats const& stats) { m_reporter->benchmarkEnded(stats); } void RunContext::pushScopedMessage(MessageInfo const& message) { m_messages.push_back(message); } void RunContext::popScopedMessage(MessageInfo const& message) { m_messages.erase(std::remove(m_messages.begin(), m_messages.end(), message), m_messages.end()); } std::string RunContext::getCurrentTestName() const { return m_activeTestCase ? m_activeTestCase->getTestCaseInfo().name : std::string(); } const AssertionResult* RunContext::getLastResult() const { return &(*m_lastResult); } void RunContext::exceptionEarlyReported() { m_shouldReportUnexpected = false; } void RunContext::handleFatalErrorCondition(StringRef message) { // First notify reporter that bad things happened m_reporter->fatalErrorEncountered(message); // Don't rebuild the result -- the stringification itself can cause more fatal // errors Instead, fake a result data. AssertionResultData tempResult(ResultWas::FatalErrorCondition, {false}); tempResult.message = message; AssertionResult result(m_lastAssertionInfo, tempResult); assertionEnded(result); handleUnfinishedSections(); // Recreate section for test case (as we will lose the one that was in scope) auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo(); SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name); Counts assertions; assertions.failed = 1; SectionStats testCaseSectionStats(testCaseSection, assertions, 0, false); m_reporter->sectionEnded(testCaseSectionStats); auto const& testInfo = m_activeTestCase->getTestCaseInfo(); Totals deltaTotals; deltaTotals.testCases.failed = 1; deltaTotals.assertions.failed = 1; m_reporter->testCaseEnded(TestCaseStats(testInfo, deltaTotals, std::string(), std::string(), false)); m_totals.testCases.failed++; testGroupEnded(std::string(), m_totals, 1, 1); m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, false)); } bool RunContext::lastAssertionPassed() { return m_lastAssertionPassed; } void RunContext::assertionPassed() { m_lastAssertionPassed = true; ++m_totals.assertions.passed; resetAssertionInfo(); } bool RunContext::aborting() const { return m_totals.assertions.failed >= static_cast(m_config->abortAfter()); } void RunContext::runCurrentTest(std::string& redirectedCout, std::string& redirectedCerr) { auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo(); SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name); m_reporter->sectionStarting(testCaseSection); Counts prevAssertions = m_totals.assertions; double duration = 0; m_shouldReportUnexpected = true; m_lastAssertionInfo = {"TEST_CASE"_sr, testCaseInfo.lineInfo, StringRef(), ResultDisposition::Normal}; seedRng(*m_config); Timer timer; CATCH_TRY { if (m_reporter->getPreferences().shouldRedirectStdOut) { #if !defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT) RedirectedStdOut redirectedStdOut; RedirectedStdErr redirectedStdErr; timer.start(); invokeActiveTestCase(); redirectedCout += redirectedStdOut.str(); redirectedCerr += redirectedStdErr.str(); #else OutputRedirect r(redirectedCout, redirectedCerr); timer.start(); invokeActiveTestCase(); #endif } else { timer.start(); invokeActiveTestCase(); } duration = timer.getElapsedSeconds(); } CATCH_CATCH_ANON(TestFailureException&) { // This just means the test was aborted due to failure } CATCH_CATCH_ALL { // Under CATCH_CONFIG_FAST_COMPILE, unexpected exceptions under REQUIRE // assertions are reported without translation at the point of origin. if (m_shouldReportUnexpected) { AssertionReaction dummyReaction; handleUnexpectedInflightException( m_lastAssertionInfo, translateActiveException(), dummyReaction); } } Counts assertions = m_totals.assertions - prevAssertions; bool missingAssertions = testForMissingAssertions(assertions); m_testCaseTracker->close(); handleUnfinishedSections(); m_messages.clear(); SectionStats testCaseSectionStats(testCaseSection, assertions, duration, missingAssertions); m_reporter->sectionEnded(testCaseSectionStats); } void RunContext::invokeActiveTestCase() { FatalConditionHandler fatalConditionHandler; // Handle signals m_activeTestCase->invoke(); fatalConditionHandler.reset(); } void RunContext::handleUnfinishedSections() { // If sections ended prematurely due to an exception we stored their // infos here so we can tear them down outside the unwind process. for (auto it = m_unfinishedSections.rbegin(), itEnd = m_unfinishedSections.rend(); it != itEnd; ++it) sectionEnded(*it); m_unfinishedSections.clear(); } void RunContext::handleExpr(AssertionInfo const& info, ITransientExpression const& expr, AssertionReaction& reaction) { m_reporter->assertionStarting(info); bool negated = isFalseTest(info.resultDisposition); bool result = expr.getResult() != negated; if (result) { if (!m_includeSuccessfulResults) { assertionPassed(); } else { reportExpr(info, ResultWas::Ok, &expr, negated); } } else { reportExpr(info, ResultWas::ExpressionFailed, &expr, negated); populateReaction(reaction); } } void RunContext::reportExpr(AssertionInfo const& info, ResultWas::OfType resultType, ITransientExpression const* expr, bool negated) { m_lastAssertionInfo = info; AssertionResultData data(resultType, LazyExpression(negated)); AssertionResult assertionResult{info, data}; assertionResult.m_resultData.lazyExpression.m_transientExpression = expr; assertionEnded(assertionResult); } void RunContext::handleMessage(AssertionInfo const& info, ResultWas::OfType resultType, StringRef const& message, AssertionReaction& reaction) { m_reporter->assertionStarting(info); m_lastAssertionInfo = info; AssertionResultData data(resultType, LazyExpression(false)); data.message = message; AssertionResult assertionResult{m_lastAssertionInfo, data}; assertionEnded(assertionResult); if (!assertionResult.isOk()) populateReaction(reaction); } void RunContext::handleUnexpectedExceptionNotThrown( AssertionInfo const& info, AssertionReaction& reaction) { handleNonExpr(info, Catch::ResultWas::DidntThrowException, reaction); } void RunContext::handleUnexpectedInflightException( AssertionInfo const& info, std::string const& message, AssertionReaction& reaction) { m_lastAssertionInfo = info; AssertionResultData data(ResultWas::ThrewException, LazyExpression(false)); data.message = message; AssertionResult assertionResult{info, data}; assertionEnded(assertionResult); populateReaction(reaction); } void RunContext::populateReaction(AssertionReaction& reaction) { reaction.shouldDebugBreak = m_config->shouldDebugBreak(); reaction.shouldThrow = aborting() || (m_lastAssertionInfo.resultDisposition & ResultDisposition::Normal); } void RunContext::handleIncomplete(AssertionInfo const& info) { m_lastAssertionInfo = info; AssertionResultData data(ResultWas::ThrewException, LazyExpression(false)); data.message = "Exception translation was disabled by CATCH_CONFIG_FAST_COMPILE"; AssertionResult assertionResult{info, data}; assertionEnded(assertionResult); } void RunContext::handleNonExpr(AssertionInfo const& info, ResultWas::OfType resultType, AssertionReaction& reaction) { m_lastAssertionInfo = info; AssertionResultData data(resultType, LazyExpression(false)); AssertionResult assertionResult{info, data}; assertionEnded(assertionResult); if (!assertionResult.isOk()) populateReaction(reaction); } IResultCapture& getResultCapture() { if (auto* capture = getCurrentContext().getResultCapture()) return *capture; else CATCH_INTERNAL_ERROR("No result capture instance"); } } // namespace Catch // end catch_run_context.cpp // start catch_section.cpp namespace Catch { Section::Section(SectionInfo const& info) : m_info(info), m_sectionIncluded( getResultCapture().sectionStarted(m_info, m_assertions)) { m_timer.start(); } Section::~Section() { if (m_sectionIncluded) { SectionEndInfo endInfo{m_info, m_assertions, m_timer.getElapsedSeconds()}; if (uncaught_exceptions()) getResultCapture().sectionEndedEarly(endInfo); else getResultCapture().sectionEnded(endInfo); } } // This indicates whether the section should be executed or not Section::operator bool() const { return m_sectionIncluded; } } // end namespace Catch // end catch_section.cpp // start catch_section_info.cpp namespace Catch { SectionInfo::SectionInfo(SourceLineInfo const& _lineInfo, std::string const& _name) : name(_name), lineInfo(_lineInfo) {} } // end namespace Catch // end catch_section_info.cpp // start catch_session.cpp // start catch_session.h #include namespace Catch { class Session : NonCopyable { public: Session(); ~Session() override; void showHelp() const; void libIdentify(); int applyCommandLine(int argc, char const* const* argv); #if defined(CATCH_CONFIG_WCHAR) && defined(WIN32) && defined(UNICODE) int applyCommandLine(int argc, wchar_t const* const* argv); #endif void useConfigData(ConfigData const& configData); template int run(int argc, CharT const* const argv[]) { if (m_startupExceptions) return 1; int returnCode = applyCommandLine(argc, argv); if (returnCode == 0) returnCode = run(); return returnCode; } int run(); clara::Parser const& cli() const; void cli(clara::Parser const& newParser); ConfigData& configData(); Config& config(); private: int runInternal(); clara::Parser m_cli; ConfigData m_configData; std::shared_ptr m_config; bool m_startupExceptions = false; }; } // end namespace Catch // end catch_session.h // start catch_version.h #include namespace Catch { // Versioning information struct Version { Version(Version const&) = delete; Version& operator=(Version const&) = delete; Version(unsigned int _majorVersion, unsigned int _minorVersion, unsigned int _patchNumber, char const* const _branchName, unsigned int _buildNumber); unsigned int const majorVersion; unsigned int const minorVersion; unsigned int const patchNumber; // buildNumber is only used if branchName is not null char const* const branchName; unsigned int const buildNumber; friend std::ostream& operator<<(std::ostream& os, Version const& version); }; Version const& libraryVersion(); } // namespace Catch // end catch_version.h #include #include namespace Catch { namespace { const int MaxExitCode = 255; IStreamingReporterPtr createReporter(std::string const& reporterName, IConfigPtr const& config) { auto reporter = Catch::getRegistryHub().getReporterRegistry().create( reporterName, config); CATCH_ENFORCE(reporter, "No reporter registered with name: '" << reporterName << "'"); return reporter; } IStreamingReporterPtr makeReporter(std::shared_ptr const& config) { if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()) { return createReporter(config->getReporterName(), config); } auto multi = std::unique_ptr(new ListeningReporter); auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners(); for (auto const& listener : listeners) { multi->addListener(listener->create(Catch::ReporterConfig(config))); } multi->addReporter(createReporter(config->getReporterName(), config)); return std::move(multi); } Catch::Totals runTests(std::shared_ptr const& config) { auto reporter = makeReporter(config); RunContext context(config, std::move(reporter)); Totals totals; context.testGroupStarting(config->name(), 1, 1); TestSpec testSpec = config->testSpec(); auto const& allTestCases = getAllTestCasesSorted(*config); for (auto const& testCase : allTestCases) { if (!context.aborting() && matchTest(testCase, testSpec, *config)) totals += context.runTest(testCase); else context.reporter().skipTest(testCase); } if (config->warnAboutNoTests() && totals.testCases.total() == 0) { ReusableStringStream testConfig; bool first = true; for (const auto& input : config->getTestsOrTags()) { if (!first) { testConfig << ' '; } first = false; testConfig << input; } context.reporter().noMatchingTestCases(testConfig.str()); totals.error = -1; } context.testGroupEnded(config->name(), totals, 1, 1); return totals; } void applyFilenamesAsTags(Catch::IConfig const& config) { auto& tests = const_cast&>(getAllTestCasesSorted(config)); for (auto& testCase : tests) { auto tags = testCase.tags; std::string filename = testCase.lineInfo.file; auto lastSlash = filename.find_last_of("\\/"); if (lastSlash != std::string::npos) { filename.erase(0, lastSlash); filename[0] = '#'; } auto lastDot = filename.find_last_of('.'); if (lastDot != std::string::npos) { filename.erase(lastDot); } tags.push_back(std::move(filename)); setTags(testCase, tags); } } } // namespace Session::Session() { static bool alreadyInstantiated = false; if (alreadyInstantiated) { CATCH_TRY { CATCH_INTERNAL_ERROR( "Only one instance of Catch::Session can ever be used"); } CATCH_CATCH_ALL { getMutableRegistryHub().registerStartupException(); } } // There cannot be exceptions at startup in no-exception mode. #if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) const auto& exceptions = getRegistryHub().getStartupExceptionRegistry().getExceptions(); if (!exceptions.empty()) { m_startupExceptions = true; Colour colourGuard(Colour::Red); Catch::cerr() << "Errors occurred during startup!" << '\n'; // iterate over all exceptions and notify user for (const auto& ex_ptr : exceptions) { try { std::rethrow_exception(ex_ptr); } catch (std::exception const& ex) { Catch::cerr() << Column(ex.what()).indent(2) << '\n'; } } } #endif alreadyInstantiated = true; m_cli = makeCommandLineParser(m_configData); } Session::~Session() { Catch::cleanUp(); } void Session::showHelp() const { Catch::cout() << "\nCatch v" << libraryVersion() << "\n" << m_cli << std::endl << "For more detailed usage please see the project docs\n" << std::endl; } void Session::libIdentify() { Catch::cout() << std::left << std::setw(16) << "description: " << "A Catch test executable\n" << std::left << std::setw(16) << "category: " << "testframework\n" << std::left << std::setw(16) << "framework: " << "Catch Test\n" << std::left << std::setw(16) << "version: " << libraryVersion() << std::endl; } int Session::applyCommandLine(int argc, char const* const* argv) { if (m_startupExceptions) return 1; auto result = m_cli.parse(clara::Args(argc, argv)); if (!result) { Catch::cerr() << Colour(Colour::Red) << "\nError(s) in input:\n" << Column(result.errorMessage()).indent(2) << "\n\n"; Catch::cerr() << "Run with -? for usage\n" << std::endl; return MaxExitCode; } if (m_configData.showHelp) showHelp(); if (m_configData.libIdentify) libIdentify(); m_config.reset(); return 0; } #if defined(CATCH_CONFIG_WCHAR) && defined(WIN32) && defined(UNICODE) int Session::applyCommandLine(int argc, wchar_t const* const* argv) { char** utf8Argv = new char*[argc]; for (int i = 0; i < argc; ++i) { int bufSize = WideCharToMultiByte(CP_UTF8, 0, argv[i], -1, NULL, 0, NULL, NULL); utf8Argv[i] = new char[bufSize]; WideCharToMultiByte(CP_UTF8, 0, argv[i], -1, utf8Argv[i], bufSize, NULL, NULL); } int returnCode = applyCommandLine(argc, utf8Argv); for (int i = 0; i < argc; ++i) delete[] utf8Argv[i]; delete[] utf8Argv; return returnCode; } #endif void Session::useConfigData(ConfigData const& configData) { m_configData = configData; m_config.reset(); } int Session::run() { if ((m_configData.waitForKeypress & WaitForKeypress::BeforeStart) != 0) { Catch::cout() << "...waiting for enter/ return before starting" << std::endl; static_cast(std::getchar()); } int exitCode = runInternal(); if ((m_configData.waitForKeypress & WaitForKeypress::BeforeExit) != 0) { Catch::cout() << "...waiting for enter/ return before exiting, with code: " << exitCode << std::endl; static_cast(std::getchar()); } return exitCode; } clara::Parser const& Session::cli() const { return m_cli; } void Session::cli(clara::Parser const& newParser) { m_cli = newParser; } ConfigData& Session::configData() { return m_configData; } Config& Session::config() { if (!m_config) m_config = std::make_shared(m_configData); return *m_config; } int Session::runInternal() { if (m_startupExceptions) return 1; if (m_configData.showHelp || m_configData.libIdentify) { return 0; } CATCH_TRY { config(); // Force config to be constructed seedRng(*m_config); if (m_configData.filenamesAsTags) applyFilenamesAsTags(*m_config); // Handle list request if (Option listed = list(config())) return static_cast(*listed); auto totals = runTests(m_config); // Note that on unices only the lower 8 bits are usually used, clamping // the return value to 255 prevents false negative when some multiple // of 256 tests has failed return (std::min)( MaxExitCode, (std::max)(totals.error, static_cast(totals.assertions.failed))); } #if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) catch (std::exception& ex) { Catch::cerr() << ex.what() << std::endl; return MaxExitCode; } #endif } } // end namespace Catch // end catch_session.cpp // start catch_singletons.cpp #include namespace Catch { namespace { static auto getSingletons() -> std::vector*& { static std::vector* g_singletons = nullptr; if (!g_singletons) g_singletons = new std::vector(); return g_singletons; } } // namespace ISingleton::~ISingleton() {} void addSingleton(ISingleton* singleton) { getSingletons()->push_back(singleton); } void cleanupSingletons() { auto& singletons = getSingletons(); for (auto singleton : *singletons) delete singleton; delete singletons; singletons = nullptr; } } // namespace Catch // end catch_singletons.cpp // start catch_startup_exception_registry.cpp namespace Catch { void StartupExceptionRegistry::add( std::exception_ptr const& exception) noexcept { CATCH_TRY { m_exceptions.push_back(exception); } CATCH_CATCH_ALL { // If we run out of memory during start-up there's really not a lot more we // can do about it std::terminate(); } } std::vector const& StartupExceptionRegistry::getExceptions() const noexcept { return m_exceptions; } } // end namespace Catch // end catch_startup_exception_registry.cpp // start catch_stream.cpp #include #include #include #include #include #include namespace Catch { Catch::IStream::~IStream() = default; namespace detail { namespace { template class StreamBufImpl : public std::streambuf { char data[bufferSize]; WriterF m_writer; public: StreamBufImpl() { setp(data, data + sizeof(data)); } ~StreamBufImpl() noexcept { StreamBufImpl::sync(); } private: int overflow(int c) override { sync(); if (c != EOF) { if (pbase() == epptr()) m_writer(std::string(1, static_cast(c))); else sputc(static_cast(c)); } return 0; } int sync() override { if (pbase() != pptr()) { m_writer(std::string( pbase(), static_cast(pptr() - pbase()))); setp(pbase(), epptr()); } return 0; } }; /////////////////////////////////////////////////////////////////////////// struct OutputDebugWriter { void operator()(std::string const& str) { writeToDebugConsole(str); } }; /////////////////////////////////////////////////////////////////////////// class FileStream : public IStream { mutable std::ofstream m_ofs; public: FileStream(StringRef filename) { m_ofs.open(filename.c_str()); CATCH_ENFORCE(!m_ofs.fail(), "Unable to open file: '" << filename << "'"); } ~FileStream() override = default; public: // IStream std::ostream& stream() const override { return m_ofs; } }; /////////////////////////////////////////////////////////////////////////// class CoutStream : public IStream { mutable std::ostream m_os; public: // Store the streambuf from cout up-front because // cout may get redirected when running tests CoutStream() : m_os(Catch::cout().rdbuf()) {} ~CoutStream() override = default; public: // IStream std::ostream& stream() const override { return m_os; } }; /////////////////////////////////////////////////////////////////////////// class DebugOutStream : public IStream { std::unique_ptr> m_streamBuf; mutable std::ostream m_os; public: DebugOutStream() : m_streamBuf(new StreamBufImpl()), m_os(m_streamBuf.get()) {} ~DebugOutStream() override = default; public: // IStream std::ostream& stream() const override { return m_os; } }; } // namespace } // namespace detail /////////////////////////////////////////////////////////////////////////// auto makeStream(StringRef const& filename) -> IStream const* { if (filename.empty()) return new detail::CoutStream(); else if (filename[0] == '%') { if (filename == "%debug") return new detail::DebugOutStream(); else CATCH_ERROR("Unrecognised stream: '" << filename << "'"); } else return new detail::FileStream(filename); } // This class encapsulates the idea of a pool of ostringstreams that can be // reused. struct StringStreams { std::vector> m_streams; std::vector m_unused; std::ostringstream m_referenceStream; // Used for copy state/ flags from auto add() -> std::size_t { if (m_unused.empty()) { m_streams.push_back( std::unique_ptr(new std::ostringstream)); return m_streams.size() - 1; } else { auto index = m_unused.back(); m_unused.pop_back(); return index; } } void release(std::size_t index) { m_streams[index]->copyfmt( m_referenceStream); // Restore initial flags and other state m_unused.push_back(index); } }; ReusableStringStream::ReusableStringStream() : m_index(Singleton::getMutable().add()), m_oss(Singleton::getMutable().m_streams[m_index].get()) {} ReusableStringStream::~ReusableStringStream() { static_cast(m_oss)->str(""); m_oss->clear(); Singleton::getMutable().release(m_index); } auto ReusableStringStream::str() const -> std::string { return static_cast(m_oss)->str(); } /////////////////////////////////////////////////////////////////////////// #ifndef CATCH_CONFIG_NOSTDOUT // If you #define this you must implement these // functions std::ostream& cout() { return std::cout; } std::ostream& cerr() { return std::cerr; } std::ostream& clog() { return std::clog; } #endif } // namespace Catch // end catch_stream.cpp // start catch_string_manip.cpp #include #include #include #include namespace Catch { namespace { char toLowerCh(char c) { return static_cast(std::tolower(c)); } } // namespace bool startsWith(std::string const& s, std::string const& prefix) { return s.size() >= prefix.size() && std::equal(prefix.begin(), prefix.end(), s.begin()); } bool startsWith(std::string const& s, char prefix) { return !s.empty() && s[0] == prefix; } bool endsWith(std::string const& s, std::string const& suffix) { return s.size() >= suffix.size() && std::equal(suffix.rbegin(), suffix.rend(), s.rbegin()); } bool endsWith(std::string const& s, char suffix) { return !s.empty() && s[s.size() - 1] == suffix; } bool contains(std::string const& s, std::string const& infix) { return s.find(infix) != std::string::npos; } void toLowerInPlace(std::string& s) { std::transform(s.begin(), s.end(), s.begin(), toLowerCh); } std::string toLower(std::string const& s) { std::string lc = s; toLowerInPlace(lc); return lc; } std::string trim(std::string const& str) { static char const* whitespaceChars = "\n\r\t "; std::string::size_type start = str.find_first_not_of(whitespaceChars); std::string::size_type end = str.find_last_not_of(whitespaceChars); return start != std::string::npos ? str.substr(start, 1 + end - start) : std::string(); } bool replaceInPlace(std::string& str, std::string const& replaceThis, std::string const& withThis) { bool replaced = false; std::size_t i = str.find(replaceThis); while (i != std::string::npos) { replaced = true; str = str.substr(0, i) + withThis + str.substr(i + replaceThis.size()); if (i < str.size() - withThis.size()) i = str.find(replaceThis, i + withThis.size()); else i = std::string::npos; } return replaced; } pluralise::pluralise(std::size_t count, std::string const& label) : m_count(count), m_label(label) {} std::ostream& operator<<(std::ostream& os, pluralise const& pluraliser) { os << pluraliser.m_count << ' ' << pluraliser.m_label; if (pluraliser.m_count != 1) os << 's'; return os; } } // namespace Catch // end catch_string_manip.cpp // start catch_stringref.cpp #if defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wexit-time-destructors" #endif #include #include #include namespace { const uint32_t byte_2_lead = 0xC0; const uint32_t byte_3_lead = 0xE0; const uint32_t byte_4_lead = 0xF0; } // namespace namespace Catch { StringRef::StringRef(char const* rawChars) noexcept : StringRef(rawChars, static_cast(std::strlen(rawChars))) {} StringRef::operator std::string() const { return std::string(m_start, m_size); } void StringRef::swap(StringRef& other) noexcept { std::swap(m_start, other.m_start); std::swap(m_size, other.m_size); std::swap(m_data, other.m_data); } auto StringRef::c_str() const -> char const* { if (isSubstring()) const_cast(this)->takeOwnership(); return m_start; } auto StringRef::currentData() const noexcept -> char const* { return m_start; } auto StringRef::isOwned() const noexcept -> bool { return m_data != nullptr; } auto StringRef::isSubstring() const noexcept -> bool { return m_start[m_size] != '\0'; } void StringRef::takeOwnership() { if (!isOwned()) { m_data = new char[m_size + 1]; memcpy(m_data, m_start, m_size); m_data[m_size] = '\0'; m_start = m_data; } } auto StringRef::substr(size_type start, size_type size) const noexcept -> StringRef { if (start < m_size) return StringRef(m_start + start, size); else return StringRef(); } auto StringRef::operator==(StringRef const& other) const noexcept -> bool { return size() == other.size() && (std::strncmp(m_start, other.m_start, size()) == 0); } auto StringRef::operator!=(StringRef const& other) const noexcept -> bool { return !operator==(other); } auto StringRef::operator[](size_type index) const noexcept -> char { return m_start[index]; } auto StringRef::numberOfCharacters() const noexcept -> size_type { size_type noChars = m_size; // Make adjustments for uft encodings for (size_type i = 0; i < m_size; ++i) { char c = m_start[i]; if ((c & byte_2_lead) == byte_2_lead) { noChars--; if ((c & byte_3_lead) == byte_3_lead) noChars--; if ((c & byte_4_lead) == byte_4_lead) noChars--; } } return noChars; } auto operator+(StringRef const& lhs, StringRef const& rhs) -> std::string { std::string str; str.reserve(lhs.size() + rhs.size()); str += lhs; str += rhs; return str; } auto operator+(StringRef const& lhs, const char* rhs) -> std::string { return std::string(lhs) + std::string(rhs); } auto operator+(char const* lhs, StringRef const& rhs) -> std::string { return std::string(lhs) + std::string(rhs); } auto operator<<(std::ostream& os, StringRef const& str) -> std::ostream& { return os.write(str.currentData(), str.size()); } auto operator+=(std::string& lhs, StringRef const& rhs) -> std::string& { lhs.append(rhs.currentData(), rhs.size()); return lhs; } } // namespace Catch #if defined(__clang__) #pragma clang diagnostic pop #endif // end catch_stringref.cpp // start catch_tag_alias.cpp namespace Catch { TagAlias::TagAlias(std::string const& _tag, SourceLineInfo _lineInfo) : tag(_tag), lineInfo(_lineInfo) {} } // namespace Catch // end catch_tag_alias.cpp // start catch_tag_alias_autoregistrar.cpp namespace Catch { RegistrarForTagAliases::RegistrarForTagAliases(char const* alias, char const* tag, SourceLineInfo const& lineInfo) { CATCH_TRY { getMutableRegistryHub().registerTagAlias(alias, tag, lineInfo); } CATCH_CATCH_ALL { // Do not throw when constructing global objects, instead register the // exception to be processed later getMutableRegistryHub().registerStartupException(); } } } // namespace Catch // end catch_tag_alias_autoregistrar.cpp // start catch_tag_alias_registry.cpp #include namespace Catch { TagAliasRegistry::~TagAliasRegistry() {} TagAlias const* TagAliasRegistry::find(std::string const& alias) const { auto it = m_registry.find(alias); if (it != m_registry.end()) return &(it->second); else return nullptr; } std::string TagAliasRegistry::expandAliases( std::string const& unexpandedTestSpec) const { std::string expandedTestSpec = unexpandedTestSpec; for (auto const& registryKvp : m_registry) { std::size_t pos = expandedTestSpec.find(registryKvp.first); if (pos != std::string::npos) { expandedTestSpec = expandedTestSpec.substr(0, pos) + registryKvp.second.tag + expandedTestSpec.substr(pos + registryKvp.first.size()); } } return expandedTestSpec; } void TagAliasRegistry::add(std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo) { CATCH_ENFORCE(startsWith(alias, "[@") && endsWith(alias, ']'), "error: tag alias, '" << alias << "' is not of the form [@alias name].\n" << lineInfo); CATCH_ENFORCE( m_registry.insert(std::make_pair(alias, TagAlias(tag, lineInfo))).second, "error: tag alias, '" << alias << "' already registered.\n" << "\tFirst seen at: " << find(alias)->lineInfo << "\n" << "\tRedefined at: " << lineInfo); } ITagAliasRegistry::~ITagAliasRegistry() {} ITagAliasRegistry const& ITagAliasRegistry::get() { return getRegistryHub().getTagAliasRegistry(); } } // end namespace Catch // end catch_tag_alias_registry.cpp // start catch_test_case_info.cpp #include #include #include #include namespace Catch { namespace { TestCaseInfo::SpecialProperties parseSpecialTag(std::string const& tag) { if (startsWith(tag, '.') || tag == "!hide") return TestCaseInfo::IsHidden; else if (tag == "!throws") return TestCaseInfo::Throws; else if (tag == "!shouldfail") return TestCaseInfo::ShouldFail; else if (tag == "!mayfail") return TestCaseInfo::MayFail; else if (tag == "!nonportable") return TestCaseInfo::NonPortable; else if (tag == "!benchmark") return static_cast( TestCaseInfo::Benchmark | TestCaseInfo::IsHidden); else return TestCaseInfo::None; } bool isReservedTag(std::string const& tag) { return parseSpecialTag(tag) == TestCaseInfo::None && tag.size() > 0 && !std::isalnum(static_cast(tag[0])); } void enforceNotReservedTag(std::string const& tag, SourceLineInfo const& _lineInfo) { CATCH_ENFORCE(!isReservedTag(tag), "Tag name: [" << tag << "] is not allowed.\n" << "Tag names starting with non alpha-numeric " "characters are reserved\n" << _lineInfo); } } // namespace TestCase makeTestCase(ITestInvoker* _testCase, std::string const& _className, NameAndTags const& nameAndTags, SourceLineInfo const& _lineInfo) { bool isHidden = false; // Parse out tags std::vector tags; std::string desc, tag; bool inTag = false; std::string _descOrTags = nameAndTags.tags; for (char c : _descOrTags) { if (!inTag) { if (c == '[') inTag = true; else desc += c; } else { if (c == ']') { TestCaseInfo::SpecialProperties prop = parseSpecialTag(tag); if ((prop & TestCaseInfo::IsHidden) != 0) isHidden = true; else if (prop == TestCaseInfo::None) enforceNotReservedTag(tag, _lineInfo); tags.push_back(tag); tag.clear(); inTag = false; } else tag += c; } } if (isHidden) { tags.push_back("."); } TestCaseInfo info(nameAndTags.name, _className, desc, tags, _lineInfo); return TestCase(_testCase, std::move(info)); } void setTags(TestCaseInfo& testCaseInfo, std::vector tags) { std::sort(begin(tags), end(tags)); tags.erase(std::unique(begin(tags), end(tags)), end(tags)); testCaseInfo.lcaseTags.clear(); for (auto const& tag : tags) { std::string lcaseTag = toLower(tag); testCaseInfo.properties = static_cast( testCaseInfo.properties | parseSpecialTag(lcaseTag)); testCaseInfo.lcaseTags.push_back(lcaseTag); } testCaseInfo.tags = std::move(tags); } TestCaseInfo::TestCaseInfo(std::string const& _name, std::string const& _className, std::string const& _description, std::vector const& _tags, SourceLineInfo const& _lineInfo) : name(_name), className(_className), description(_description), lineInfo(_lineInfo), properties(None) { setTags(*this, _tags); } bool TestCaseInfo::isHidden() const { return (properties & IsHidden) != 0; } bool TestCaseInfo::throws() const { return (properties & Throws) != 0; } bool TestCaseInfo::okToFail() const { return (properties & (ShouldFail | MayFail)) != 0; } bool TestCaseInfo::expectedToFail() const { return (properties & (ShouldFail)) != 0; } std::string TestCaseInfo::tagsAsString() const { std::string ret; // '[' and ']' per tag std::size_t full_size = 2 * tags.size(); for (const auto& tag : tags) { full_size += tag.size(); } ret.reserve(full_size); for (const auto& tag : tags) { ret.push_back('['); ret.append(tag); ret.push_back(']'); } return ret; } TestCase::TestCase(ITestInvoker* testCase, TestCaseInfo&& info) : TestCaseInfo(std::move(info)), test(testCase) {} TestCase TestCase::withName(std::string const& _newName) const { TestCase other(*this); other.name = _newName; return other; } void TestCase::invoke() const { test->invoke(); } bool TestCase::operator==(TestCase const& other) const { return test.get() == other.test.get() && name == other.name && className == other.className; } bool TestCase::operator<(TestCase const& other) const { return name < other.name; } TestCaseInfo const& TestCase::getTestCaseInfo() const { return *this; } } // end namespace Catch // end catch_test_case_info.cpp // start catch_test_case_registry_impl.cpp #include namespace Catch { std::vector sortTests( IConfig const& config, std::vector const& unsortedTestCases) { std::vector sorted = unsortedTestCases; switch (config.runOrder()) { case RunTests::InLexicographicalOrder: std::sort(sorted.begin(), sorted.end()); break; case RunTests::InRandomOrder: seedRng(config); std::shuffle(sorted.begin(), sorted.end(), rng()); break; case RunTests::InDeclarationOrder: // already in declaration order break; } return sorted; } bool matchTest(TestCase const& testCase, TestSpec const& testSpec, IConfig const& config) { return testSpec.matches(testCase) && (config.allowThrows() || !testCase.throws()); } void enforceNoDuplicateTestCases(std::vector const& functions) { std::set seenFunctions; for (auto const& function : functions) { auto prev = seenFunctions.insert(function); CATCH_ENFORCE(prev.second, "error: TEST_CASE( \"" << function.name << "\" ) already defined.\n" << "\tFirst seen at " << prev.first->getTestCaseInfo().lineInfo << "\n" << "\tRedefined at " << function.getTestCaseInfo().lineInfo); } } std::vector filterTests(std::vector const& testCases, TestSpec const& testSpec, IConfig const& config) { std::vector filtered; filtered.reserve(testCases.size()); for (auto const& testCase : testCases) if (matchTest(testCase, testSpec, config)) filtered.push_back(testCase); return filtered; } std::vector const& getAllTestCasesSorted(IConfig const& config) { return getRegistryHub().getTestCaseRegistry().getAllTestsSorted(config); } void TestRegistry::registerTest(TestCase const& testCase) { std::string name = testCase.getTestCaseInfo().name; if (name.empty()) { ReusableStringStream rss; rss << "Anonymous test case " << ++m_unnamedCount; return registerTest(testCase.withName(rss.str())); } m_functions.push_back(testCase); } std::vector const& TestRegistry::getAllTests() const { return m_functions; } std::vector const& TestRegistry::getAllTestsSorted( IConfig const& config) const { if (m_sortedFunctions.empty()) enforceNoDuplicateTestCases(m_functions); if (m_currentSortOrder != config.runOrder() || m_sortedFunctions.empty()) { m_sortedFunctions = sortTests(config, m_functions); m_currentSortOrder = config.runOrder(); } return m_sortedFunctions; } /////////////////////////////////////////////////////////////////////////// TestInvokerAsFunction::TestInvokerAsFunction(void (*testAsFunction)()) noexcept : m_testAsFunction(testAsFunction) {} void TestInvokerAsFunction::invoke() const { m_testAsFunction(); } std::string extractClassName(StringRef const& classOrQualifiedMethodName) { std::string className = classOrQualifiedMethodName; if (startsWith(className, '&')) { std::size_t lastColons = className.rfind("::"); std::size_t penultimateColons = className.rfind("::", lastColons - 1); if (penultimateColons == std::string::npos) penultimateColons = 1; className = className.substr(penultimateColons, lastColons - penultimateColons); } return className; } } // end namespace Catch // end catch_test_case_registry_impl.cpp // start catch_test_case_tracker.cpp #include #include #include #include #include #if defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wexit-time-destructors" #endif namespace Catch { namespace TestCaseTracking { NameAndLocation::NameAndLocation(std::string const& _name, SourceLineInfo const& _location) : name(_name), location(_location) {} ITracker::~ITracker() = default; TrackerContext& TrackerContext::instance() { static TrackerContext s_instance; return s_instance; } ITracker& TrackerContext::startRun() { m_rootTracker = std::make_shared( NameAndLocation("{root}", CATCH_INTERNAL_LINEINFO), *this, nullptr); m_currentTracker = nullptr; m_runState = Executing; return *m_rootTracker; } void TrackerContext::endRun() { m_rootTracker.reset(); m_currentTracker = nullptr; m_runState = NotStarted; } void TrackerContext::startCycle() { m_currentTracker = m_rootTracker.get(); m_runState = Executing; } void TrackerContext::completeCycle() { m_runState = CompletedCycle; } bool TrackerContext::completedCycle() const { return m_runState == CompletedCycle; } ITracker& TrackerContext::currentTracker() { return *m_currentTracker; } void TrackerContext::setCurrentTracker(ITracker* tracker) { m_currentTracker = tracker; } TrackerBase::TrackerBase(NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent) : m_nameAndLocation(nameAndLocation), m_ctx(ctx), m_parent(parent) {} NameAndLocation const& TrackerBase::nameAndLocation() const { return m_nameAndLocation; } bool TrackerBase::isComplete() const { return m_runState == CompletedSuccessfully || m_runState == Failed; } bool TrackerBase::isSuccessfullyCompleted() const { return m_runState == CompletedSuccessfully; } bool TrackerBase::isOpen() const { return m_runState != NotStarted && !isComplete(); } bool TrackerBase::hasChildren() const { return !m_children.empty(); } void TrackerBase::addChild(ITrackerPtr const& child) { m_children.push_back(child); } ITrackerPtr TrackerBase::findChild(NameAndLocation const& nameAndLocation) { auto it = std::find_if(m_children.begin(), m_children.end(), [&nameAndLocation](ITrackerPtr const& tracker) { return tracker->nameAndLocation().location == nameAndLocation.location && tracker->nameAndLocation().name == nameAndLocation.name; }); return (it != m_children.end()) ? *it : nullptr; } ITracker& TrackerBase::parent() { assert(m_parent); // Should always be non-null except for root return *m_parent; } void TrackerBase::openChild() { if (m_runState != ExecutingChildren) { m_runState = ExecutingChildren; if (m_parent) m_parent->openChild(); } } bool TrackerBase::isSectionTracker() const { return false; } bool TrackerBase::isIndexTracker() const { return false; } void TrackerBase::open() { m_runState = Executing; moveToThis(); if (m_parent) m_parent->openChild(); } void TrackerBase::close() { // Close any still open children (e.g. generators) while (&m_ctx.currentTracker() != this) m_ctx.currentTracker().close(); switch (m_runState) { case NeedsAnotherRun: break; case Executing: m_runState = CompletedSuccessfully; break; case ExecutingChildren: if (m_children.empty() || m_children.back()->isComplete()) m_runState = CompletedSuccessfully; break; case NotStarted: case CompletedSuccessfully: case Failed: CATCH_INTERNAL_ERROR("Illogical state: " << m_runState); default: CATCH_INTERNAL_ERROR("Unknown state: " << m_runState); } moveToParent(); m_ctx.completeCycle(); } void TrackerBase::fail() { m_runState = Failed; if (m_parent) m_parent->markAsNeedingAnotherRun(); moveToParent(); m_ctx.completeCycle(); } void TrackerBase::markAsNeedingAnotherRun() { m_runState = NeedsAnotherRun; } void TrackerBase::moveToParent() { assert(m_parent); m_ctx.setCurrentTracker(m_parent); } void TrackerBase::moveToThis() { m_ctx.setCurrentTracker(this); } SectionTracker::SectionTracker(NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent) : TrackerBase(nameAndLocation, ctx, parent) { if (parent) { while (!parent->isSectionTracker()) parent = &parent->parent(); SectionTracker& parentSection = static_cast(*parent); addNextFilters(parentSection.m_filters); } } bool SectionTracker::isSectionTracker() const { return true; } SectionTracker& SectionTracker::acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation) { std::shared_ptr section; ITracker& currentTracker = ctx.currentTracker(); if (ITrackerPtr childTracker = currentTracker.findChild(nameAndLocation)) { assert(childTracker); assert(childTracker->isSectionTracker()); section = std::static_pointer_cast(childTracker); } else { section = std::make_shared(nameAndLocation, ctx, ¤tTracker); currentTracker.addChild(section); } if (!ctx.completedCycle()) section->tryOpen(); return *section; } void SectionTracker::tryOpen() { if (!isComplete() && (m_filters.empty() || m_filters[0].empty() || m_filters[0] == m_nameAndLocation.name)) open(); } void SectionTracker::addInitialFilters( std::vector const& filters) { if (!filters.empty()) { m_filters.push_back(""); // Root - should never be consulted m_filters.push_back(""); // Test Case - not a section filter m_filters.insert(m_filters.end(), filters.begin(), filters.end()); } } void SectionTracker::addNextFilters(std::vector const& filters) { if (filters.size() > 1) m_filters.insert(m_filters.end(), ++filters.begin(), filters.end()); } IndexTracker::IndexTracker(NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent, int size) : TrackerBase(nameAndLocation, ctx, parent), m_size(size) {} bool IndexTracker::isIndexTracker() const { return true; } IndexTracker& IndexTracker::acquire(TrackerContext& ctx, NameAndLocation const& nameAndLocation, int size) { std::shared_ptr tracker; ITracker& currentTracker = ctx.currentTracker(); if (ITrackerPtr childTracker = currentTracker.findChild(nameAndLocation)) { assert(childTracker); assert(childTracker->isIndexTracker()); tracker = std::static_pointer_cast(childTracker); } else { tracker = std::make_shared(nameAndLocation, ctx, ¤tTracker, size); currentTracker.addChild(tracker); } if (!ctx.completedCycle() && !tracker->isComplete()) { if (tracker->m_runState != ExecutingChildren && tracker->m_runState != NeedsAnotherRun) tracker->moveNext(); tracker->open(); } return *tracker; } int IndexTracker::index() const { return m_index; } void IndexTracker::moveNext() { m_index++; m_children.clear(); } void IndexTracker::close() { TrackerBase::close(); if (m_runState == CompletedSuccessfully && m_index < m_size - 1) m_runState = Executing; } } // namespace TestCaseTracking using TestCaseTracking::IndexTracker; using TestCaseTracking::ITracker; using TestCaseTracking::SectionTracker; using TestCaseTracking::TrackerContext; } // namespace Catch #if defined(__clang__) #pragma clang diagnostic pop #endif // end catch_test_case_tracker.cpp // start catch_test_registry.cpp namespace Catch { auto makeTestInvoker(void (*testAsFunction)()) noexcept -> ITestInvoker* { return new (std::nothrow) TestInvokerAsFunction(testAsFunction); } NameAndTags::NameAndTags(StringRef const& name_, StringRef const& tags_) noexcept : name(name_), tags(tags_) {} AutoReg::AutoReg(ITestInvoker* invoker, SourceLineInfo const& lineInfo, StringRef const& classOrMethod, NameAndTags const& nameAndTags) noexcept { CATCH_TRY { getMutableRegistryHub().registerTest(makeTestCase( invoker, extractClassName(classOrMethod), nameAndTags, lineInfo)); } CATCH_CATCH_ALL { // Do not throw when constructing global objects, instead register the // exception to be processed later getMutableRegistryHub().registerStartupException(); } } AutoReg::~AutoReg() = default; } // namespace Catch // end catch_test_registry.cpp // start catch_test_spec.cpp #include #include #include #include namespace Catch { TestSpec::Pattern::~Pattern() = default; TestSpec::NamePattern::~NamePattern() = default; TestSpec::TagPattern::~TagPattern() = default; TestSpec::ExcludedPattern::~ExcludedPattern() = default; TestSpec::NamePattern::NamePattern(std::string const& name) : m_wildcardPattern(toLower(name), CaseSensitive::No) {} bool TestSpec::NamePattern::matches(TestCaseInfo const& testCase) const { return m_wildcardPattern.matches(toLower(testCase.name)); } TestSpec::TagPattern::TagPattern(std::string const& tag) : m_tag(toLower(tag)) {} bool TestSpec::TagPattern::matches(TestCaseInfo const& testCase) const { return std::find(begin(testCase.lcaseTags), end(testCase.lcaseTags), m_tag) != end(testCase.lcaseTags); } TestSpec::ExcludedPattern::ExcludedPattern(PatternPtr const& underlyingPattern) : m_underlyingPattern(underlyingPattern) {} bool TestSpec::ExcludedPattern::matches(TestCaseInfo const& testCase) const { return !m_underlyingPattern->matches(testCase); } bool TestSpec::Filter::matches(TestCaseInfo const& testCase) const { // All patterns in a filter must match for the filter to be a match for (auto const& pattern : m_patterns) { if (!pattern->matches(testCase)) return false; } return true; } bool TestSpec::hasFilters() const { return !m_filters.empty(); } bool TestSpec::matches(TestCaseInfo const& testCase) const { // A TestSpec matches if any filter matches for (auto const& filter : m_filters) if (filter.matches(testCase)) return true; return false; } } // namespace Catch // end catch_test_spec.cpp // start catch_test_spec_parser.cpp namespace Catch { TestSpecParser::TestSpecParser(ITagAliasRegistry const& tagAliases) : m_tagAliases(&tagAliases) {} TestSpecParser& TestSpecParser::parse(std::string const& arg) { m_mode = None; m_exclusion = false; m_start = std::string::npos; m_arg = m_tagAliases->expandAliases(arg); m_escapeChars.clear(); for (m_pos = 0; m_pos < m_arg.size(); ++m_pos) visitChar(m_arg[m_pos]); if (m_mode == Name) addPattern(); return *this; } TestSpec TestSpecParser::testSpec() { addFilter(); return m_testSpec; } void TestSpecParser::visitChar(char c) { if (m_mode == None) { switch (c) { case ' ': return; case '~': m_exclusion = true; return; case '[': return startNewMode(Tag, ++m_pos); case '"': return startNewMode(QuotedName, ++m_pos); case '\\': return escape(); default: startNewMode(Name, m_pos); break; } } if (m_mode == Name) { if (c == ',') { addPattern(); addFilter(); } else if (c == '[') { if (subString() == "exclude:") m_exclusion = true; else addPattern(); startNewMode(Tag, ++m_pos); } else if (c == '\\') escape(); } else if (m_mode == EscapedName) m_mode = Name; else if (m_mode == QuotedName && c == '"') addPattern(); else if (m_mode == Tag && c == ']') addPattern(); } void TestSpecParser::startNewMode(Mode mode, std::size_t start) { m_mode = mode; m_start = start; } void TestSpecParser::escape() { if (m_mode == None) m_start = m_pos; m_mode = EscapedName; m_escapeChars.push_back(m_pos); } std::string TestSpecParser::subString() const { return m_arg.substr(m_start, m_pos - m_start); } void TestSpecParser::addFilter() { if (!m_currentFilter.m_patterns.empty()) { m_testSpec.m_filters.push_back(m_currentFilter); m_currentFilter = TestSpec::Filter(); } } TestSpec parseTestSpec(std::string const& arg) { return TestSpecParser(ITagAliasRegistry::get()).parse(arg).testSpec(); } } // namespace Catch // end catch_test_spec_parser.cpp // start catch_timer.cpp #include static const uint64_t nanosecondsInSecond = 1000000000; namespace Catch { auto getCurrentNanosecondsSinceEpoch() -> uint64_t { return std::chrono::duration_cast( std::chrono::high_resolution_clock::now().time_since_epoch()) .count(); } namespace { auto estimateClockResolution() -> uint64_t { uint64_t sum = 0; static const uint64_t iterations = 1000000; auto startTime = getCurrentNanosecondsSinceEpoch(); for (std::size_t i = 0; i < iterations; ++i) { uint64_t ticks; uint64_t baseTicks = getCurrentNanosecondsSinceEpoch(); do { ticks = getCurrentNanosecondsSinceEpoch(); } while (ticks == baseTicks); auto delta = ticks - baseTicks; sum += delta; // If we have been calibrating for over 3 seconds -- the clock // is terrible and we should move on. // TBD: How to signal that the measured resolution is probably wrong? if (ticks > startTime + 3 * nanosecondsInSecond) { return sum / i; } } // We're just taking the mean, here. To do better we could take the std. dev // and exclude outliers // - and potentially do more iterations if there's a high variance. return sum / iterations; } } // namespace auto getEstimatedClockResolution() -> uint64_t { static auto s_resolution = estimateClockResolution(); return s_resolution; } void Timer::start() { m_nanoseconds = getCurrentNanosecondsSinceEpoch(); } auto Timer::getElapsedNanoseconds() const -> uint64_t { return getCurrentNanosecondsSinceEpoch() - m_nanoseconds; } auto Timer::getElapsedMicroseconds() const -> uint64_t { return getElapsedNanoseconds() / 1000; } auto Timer::getElapsedMilliseconds() const -> unsigned int { return static_cast(getElapsedMicroseconds() / 1000); } auto Timer::getElapsedSeconds() const -> double { return getElapsedMicroseconds() / 1000000.0; } } // namespace Catch // end catch_timer.cpp // start catch_tostring.cpp #if defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wexit-time-destructors" #pragma clang diagnostic ignored "-Wglobal-constructors" #endif // Enable specific decls locally #if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER) #define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER #endif #include #include namespace Catch { namespace Detail { const std::string unprintableString = "{?}"; namespace { const int hexThreshold = 255; struct Endianness { enum Arch { Big, Little }; static Arch which() { union _ { int asInt; char asChar[sizeof(int)]; } u; u.asInt = 1; return (u.asChar[sizeof(int) - 1] == 1) ? Big : Little; } }; } // namespace std::string rawMemoryToString(const void* object, std::size_t size) { // Reverse order for little endian architectures int i = 0, end = static_cast(size), inc = 1; if (Endianness::which() == Endianness::Little) { i = end - 1; end = inc = -1; } unsigned char const* bytes = static_cast(object); ReusableStringStream rss; rss << "0x" << std::setfill('0') << std::hex; for (; i != end; i += inc) rss << std::setw(2) << static_cast(bytes[i]); return rss.str(); } } // namespace Detail template std::string fpToString(T value, int precision) { if (Catch::isnan(value)) { return "nan"; } ReusableStringStream rss; rss << std::setprecision(precision) << std::fixed << value; std::string d = rss.str(); std::size_t i = d.find_last_not_of('0'); if (i != std::string::npos && i != d.size() - 1) { if (d[i] == '.') i++; d = d.substr(0, i + 1); } return d; } //// ======================================================= //// // // Out-of-line defs for full specialization of StringMaker // //// ======================================================= //// std::string StringMaker::convert(const std::string& str) { if (!getCurrentContext().getConfig()->showInvisibles()) { return '"' + str + '"'; } std::string s("\""); for (char c : str) { switch (c) { case '\n': s.append("\\n"); break; case '\t': s.append("\\t"); break; default: s.push_back(c); break; } } s.append("\""); return s; } #ifdef CATCH_CONFIG_CPP17_STRING_VIEW std::string StringMaker::convert(std::string_view str) { return ::Catch::Detail::stringify(std::string{str}); } #endif std::string StringMaker::convert(char const* str) { if (str) { return ::Catch::Detail::stringify(std::string{str}); } else { return {"{null string}"}; } } std::string StringMaker::convert(char* str) { if (str) { return ::Catch::Detail::stringify(std::string{str}); } else { return {"{null string}"}; } } #ifdef CATCH_CONFIG_WCHAR std::string StringMaker::convert(const std::wstring& wstr) { std::string s; s.reserve(wstr.size()); for (auto c : wstr) { s += (c <= 0xff) ? static_cast(c) : '?'; } return ::Catch::Detail::stringify(s); } #ifdef CATCH_CONFIG_CPP17_STRING_VIEW std::string StringMaker::convert(std::wstring_view str) { return StringMaker::convert(std::wstring(str)); } #endif std::string StringMaker::convert(wchar_t const* str) { if (str) { return ::Catch::Detail::stringify(std::wstring{str}); } else { return {"{null string}"}; } } std::string StringMaker::convert(wchar_t* str) { if (str) { return ::Catch::Detail::stringify(std::wstring{str}); } else { return {"{null string}"}; } } #endif std::string StringMaker::convert(int value) { return ::Catch::Detail::stringify(static_cast(value)); } std::string StringMaker::convert(long value) { return ::Catch::Detail::stringify(static_cast(value)); } std::string StringMaker::convert(long long value) { ReusableStringStream rss; rss << value; if (value > Detail::hexThreshold) { rss << " (0x" << std::hex << value << ')'; } return rss.str(); } std::string StringMaker::convert(unsigned int value) { return ::Catch::Detail::stringify(static_cast(value)); } std::string StringMaker::convert(unsigned long value) { return ::Catch::Detail::stringify(static_cast(value)); } std::string StringMaker::convert(unsigned long long value) { ReusableStringStream rss; rss << value; if (value > Detail::hexThreshold) { rss << " (0x" << std::hex << value << ')'; } return rss.str(); } std::string StringMaker::convert(bool b) { return b ? "true" : "false"; } std::string StringMaker::convert(signed char value) { if (value == '\r') { return "'\\r'"; } else if (value == '\f') { return "'\\f'"; } else if (value == '\n') { return "'\\n'"; } else if (value == '\t') { return "'\\t'"; } else if ('\0' <= value && value < ' ') { return ::Catch::Detail::stringify(static_cast(value)); } else { char chstr[] = "' '"; chstr[1] = value; return chstr; } } std::string StringMaker::convert(char c) { return ::Catch::Detail::stringify(static_cast(c)); } std::string StringMaker::convert(unsigned char c) { return ::Catch::Detail::stringify(static_cast(c)); } std::string StringMaker::convert(std::nullptr_t) { return "nullptr"; } std::string StringMaker::convert(float value) { return fpToString(value, 5) + 'f'; } std::string StringMaker::convert(double value) { return fpToString(value, 10); } std::string ratio_string::symbol() { return "a"; } std::string ratio_string::symbol() { return "f"; } std::string ratio_string::symbol() { return "p"; } std::string ratio_string::symbol() { return "n"; } std::string ratio_string::symbol() { return "u"; } std::string ratio_string::symbol() { return "m"; } } // end namespace Catch #if defined(__clang__) #pragma clang diagnostic pop #endif // end catch_tostring.cpp // start catch_totals.cpp namespace Catch { Counts Counts::operator-(Counts const& other) const { Counts diff; diff.passed = passed - other.passed; diff.failed = failed - other.failed; diff.failedButOk = failedButOk - other.failedButOk; return diff; } Counts& Counts::operator+=(Counts const& other) { passed += other.passed; failed += other.failed; failedButOk += other.failedButOk; return *this; } std::size_t Counts::total() const { return passed + failed + failedButOk; } bool Counts::allPassed() const { return failed == 0 && failedButOk == 0; } bool Counts::allOk() const { return failed == 0; } Totals Totals::operator-(Totals const& other) const { Totals diff; diff.assertions = assertions - other.assertions; diff.testCases = testCases - other.testCases; return diff; } Totals& Totals::operator+=(Totals const& other) { assertions += other.assertions; testCases += other.testCases; return *this; } Totals Totals::delta(Totals const& prevTotals) const { Totals diff = *this - prevTotals; if (diff.assertions.failed > 0) ++diff.testCases.failed; else if (diff.assertions.failedButOk > 0) ++diff.testCases.failedButOk; else ++diff.testCases.passed; return diff; } } // namespace Catch // end catch_totals.cpp // start catch_uncaught_exceptions.cpp #include namespace Catch { bool uncaught_exceptions() { #if defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) return std::uncaught_exceptions() > 0; #else return std::uncaught_exception(); #endif } } // end namespace Catch // end catch_uncaught_exceptions.cpp // start catch_version.cpp #include namespace Catch { Version::Version(unsigned int _majorVersion, unsigned int _minorVersion, unsigned int _patchNumber, char const* const _branchName, unsigned int _buildNumber) : majorVersion(_majorVersion), minorVersion(_minorVersion), patchNumber(_patchNumber), branchName(_branchName), buildNumber(_buildNumber) {} std::ostream& operator<<(std::ostream& os, Version const& version) { os << version.majorVersion << '.' << version.minorVersion << '.' << version.patchNumber; // branchName is never null -> 0th char is \0 if it is empty if (version.branchName[0]) { os << '-' << version.branchName << '.' << version.buildNumber; } return os; } Version const& libraryVersion() { static Version version(2, 5, 0, "", 0); return version; } } // namespace Catch // end catch_version.cpp // start catch_wildcard_pattern.cpp #include namespace Catch { WildcardPattern::WildcardPattern(std::string const& pattern, CaseSensitive::Choice caseSensitivity) : m_caseSensitivity(caseSensitivity), m_pattern(adjustCase(pattern)) { if (startsWith(m_pattern, '*')) { m_pattern = m_pattern.substr(1); m_wildcard = WildcardAtStart; } if (endsWith(m_pattern, '*')) { m_pattern = m_pattern.substr(0, m_pattern.size() - 1); m_wildcard = static_cast(m_wildcard | WildcardAtEnd); } } bool WildcardPattern::matches(std::string const& str) const { switch (m_wildcard) { case NoWildcard: return m_pattern == adjustCase(str); case WildcardAtStart: return endsWith(adjustCase(str), m_pattern); case WildcardAtEnd: return startsWith(adjustCase(str), m_pattern); case WildcardAtBothEnds: return contains(adjustCase(str), m_pattern); default: CATCH_INTERNAL_ERROR("Unknown enum"); } } std::string WildcardPattern::adjustCase(std::string const& str) const { return m_caseSensitivity == CaseSensitive::No ? toLower(str) : str; } } // namespace Catch // end catch_wildcard_pattern.cpp // start catch_xmlwriter.cpp #include using uchar = unsigned char; namespace Catch { namespace { size_t trailingBytes(unsigned char c) { if ((c & 0xE0) == 0xC0) { return 2; } if ((c & 0xF0) == 0xE0) { return 3; } if ((c & 0xF8) == 0xF0) { return 4; } CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered"); } uint32_t headerValue(unsigned char c) { if ((c & 0xE0) == 0xC0) { return c & 0x1F; } if ((c & 0xF0) == 0xE0) { return c & 0x0F; } if ((c & 0xF8) == 0xF0) { return c & 0x07; } CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered"); } void hexEscapeChar(std::ostream& os, unsigned char c) { os << "\\x" << std::uppercase << std::hex << std::setfill('0') << std::setw(2) << static_cast(c); } } // anonymous namespace XmlEncode::XmlEncode(std::string const& str, ForWhat forWhat) : m_str(str), m_forWhat(forWhat) {} void XmlEncode::encodeTo(std::ostream& os) const { // Apostrophe escaping not necessary if we always use " to write attributes // (see: http://www.w3.org/TR/xml/#syntax) for (std::size_t idx = 0; idx < m_str.size(); ++idx) { uchar c = m_str[idx]; switch (c) { case '<': os << "<"; break; case '&': os << "&"; break; case '>': // See: http://www.w3.org/TR/xml/#syntax if (idx > 2 && m_str[idx - 1] == ']' && m_str[idx - 2] == ']') os << ">"; else os << c; break; case '\"': if (m_forWhat == ForAttributes) os << """; else os << c; break; default: // Check for control characters and invalid utf-8 // Escape control characters in standard ascii // see // http://stackoverflow.com/questions/404107/why-are-control-characters-illegal-in-xml-1-0 if (c < 0x09 || (c > 0x0D && c < 0x20) || c == 0x7F) { hexEscapeChar(os, c); break; } // Plain ASCII: Write it to stream if (c < 0x7F) { os << c; break; } // UTF-8 territory // Check if the encoding is valid and if it is not, hex escape bytes. // Important: We do not check the exact decoded values for validity, // only the encoding format First check that this bytes is a valid lead // byte: This means that it is not encoded as 1111 1XXX Or as 10XX XXXX if (c < 0xC0 || c >= 0xF8) { hexEscapeChar(os, c); break; } auto encBytes = trailingBytes(c); // Are there enough bytes left to avoid accessing out-of-bounds memory? if (idx + encBytes - 1 >= m_str.size()) { hexEscapeChar(os, c); break; } // The header is valid, check data // The next encBytes bytes must together be a valid utf-8 // This means: bitpattern 10XX XXXX and the extracted value is sane // (ish) bool valid = true; uint32_t value = headerValue(c); for (std::size_t n = 1; n < encBytes; ++n) { uchar nc = m_str[idx + n]; valid &= ((nc & 0xC0) == 0x80); value = (value << 6) | (nc & 0x3F); } if ( // Wrong bit pattern of following bytes (!valid) || // Overlong encodings (value < 0x80) || (0x80 <= value && value < 0x800 && encBytes > 2) || (0x800 < value && value < 0x10000 && encBytes > 3) || // Encoded value out of range (value >= 0x110000)) { hexEscapeChar(os, c); break; } // If we got here, this is in fact a valid(ish) utf-8 sequence for (std::size_t n = 0; n < encBytes; ++n) { os << m_str[idx + n]; } idx += encBytes - 1; break; } } } std::ostream& operator<<(std::ostream& os, XmlEncode const& xmlEncode) { xmlEncode.encodeTo(os); return os; } XmlWriter::ScopedElement::ScopedElement(XmlWriter* writer) : m_writer(writer) {} XmlWriter::ScopedElement::ScopedElement(ScopedElement&& other) noexcept : m_writer(other.m_writer) { other.m_writer = nullptr; } XmlWriter::ScopedElement& XmlWriter::ScopedElement::operator=( ScopedElement&& other) noexcept { if (m_writer) { m_writer->endElement(); } m_writer = other.m_writer; other.m_writer = nullptr; return *this; } XmlWriter::ScopedElement::~ScopedElement() { if (m_writer) m_writer->endElement(); } XmlWriter::ScopedElement& XmlWriter::ScopedElement::writeText( std::string const& text, bool indent) { m_writer->writeText(text, indent); return *this; } XmlWriter::XmlWriter(std::ostream& os) : m_os(os) { writeDeclaration(); } XmlWriter::~XmlWriter() { while (!m_tags.empty()) endElement(); } XmlWriter& XmlWriter::startElement(std::string const& name) { ensureTagClosed(); newlineIfNecessary(); m_os << m_indent << '<' << name; m_tags.push_back(name); m_indent += " "; m_tagIsOpen = true; return *this; } XmlWriter::ScopedElement XmlWriter::scopedElement(std::string const& name) { ScopedElement scoped(this); startElement(name); return scoped; } XmlWriter& XmlWriter::endElement() { newlineIfNecessary(); m_indent = m_indent.substr(0, m_indent.size() - 2); if (m_tagIsOpen) { m_os << "/>"; m_tagIsOpen = false; } else { m_os << m_indent << ""; } m_os << std::endl; m_tags.pop_back(); return *this; } XmlWriter& XmlWriter::writeAttribute(std::string const& name, std::string const& attribute) { if (!name.empty() && !attribute.empty()) m_os << ' ' << name << "=\"" << XmlEncode(attribute, XmlEncode::ForAttributes) << '"'; return *this; } XmlWriter& XmlWriter::writeAttribute(std::string const& name, bool attribute) { m_os << ' ' << name << "=\"" << (attribute ? "true" : "false") << '"'; return *this; } XmlWriter& XmlWriter::writeText(std::string const& text, bool indent) { if (!text.empty()) { bool tagWasOpen = m_tagIsOpen; ensureTagClosed(); if (tagWasOpen && indent) m_os << m_indent; m_os << XmlEncode(text); m_needsNewline = true; } return *this; } XmlWriter& XmlWriter::writeComment(std::string const& text) { ensureTagClosed(); m_os << m_indent << ""; m_needsNewline = true; return *this; } void XmlWriter::writeStylesheetRef(std::string const& url) { m_os << "\n"; } XmlWriter& XmlWriter::writeBlankLine() { ensureTagClosed(); m_os << '\n'; return *this; } void XmlWriter::ensureTagClosed() { if (m_tagIsOpen) { m_os << ">" << std::endl; m_tagIsOpen = false; } } void XmlWriter::writeDeclaration() { m_os << "\n"; } void XmlWriter::newlineIfNecessary() { if (m_needsNewline) { m_os << std::endl; m_needsNewline = false; } } } // namespace Catch // end catch_xmlwriter.cpp // start catch_reporter_bases.cpp #include #include #include #include #include namespace Catch { void prepareExpandedExpression(AssertionResult& result) { result.getExpandedExpression(); } // Because formatting using c++ streams is stateful, drop down to C is required // Alternatively we could use stringstream, but its performance is... not good. std::string getFormattedDuration(double duration) { // Max exponent + 1 is required to represent the whole part // + 1 for decimal point // + 3 for the 3 decimal places // + 1 for null terminator const std::size_t maxDoubleSize = DBL_MAX_10_EXP + 1 + 1 + 3 + 1; char buffer[maxDoubleSize]; // Save previous errno, to prevent sprintf from overwriting it ErrnoGuard guard; #ifdef _MSC_VER sprintf_s(buffer, "%.3f", duration); #else sprintf(buffer, "%.3f", duration); #endif return std::string(buffer); } TestEventListenerBase::TestEventListenerBase(ReporterConfig const& _config) : StreamingReporterBase(_config) {} std::set TestEventListenerBase::getSupportedVerbosities() { return {Verbosity::Quiet, Verbosity::Normal, Verbosity::High}; } void TestEventListenerBase::assertionStarting(AssertionInfo const&) {} bool TestEventListenerBase::assertionEnded(AssertionStats const&) { return false; } } // end namespace Catch // end catch_reporter_bases.cpp // start catch_reporter_compact.cpp namespace { #ifdef CATCH_PLATFORM_MAC const char* failedString() { return "FAILED"; } const char* passedString() { return "PASSED"; } #else const char* failedString() { return "failed"; } const char* passedString() { return "passed"; } #endif // Colour::LightGrey Catch::Colour::Code dimColour() { return Catch::Colour::FileName; } std::string bothOrAll(std::size_t count) { return count == 1 ? std::string() : count == 2 ? "both " : "all "; } } // namespace namespace Catch { namespace { // Colour, message variants: // - white: No tests ran. // - red: Failed [both/all] N test cases, failed [both/all] M assertions. // - white: Passed [both/all] N test cases (no assertions). // - red: Failed N tests cases, failed M assertions. // - green: Passed [both/all] N tests cases with M assertions. void printTotals(std::ostream& out, const Totals& totals) { if (totals.testCases.total() == 0) { out << "No tests ran."; } else if (totals.testCases.failed == totals.testCases.total()) { Colour colour(Colour::ResultError); const std::string qualify_assertions_failed = totals.assertions.failed == totals.assertions.total() ? bothOrAll(totals.assertions.failed) : std::string(); out << "Failed " << bothOrAll(totals.testCases.failed) << pluralise(totals.testCases.failed, "test case") << ", " "failed " << qualify_assertions_failed << pluralise(totals.assertions.failed, "assertion") << '.'; } else if (totals.assertions.total() == 0) { out << "Passed " << bothOrAll(totals.testCases.total()) << pluralise(totals.testCases.total(), "test case") << " (no assertions)."; } else if (totals.assertions.failed) { Colour colour(Colour::ResultError); out << "Failed " << pluralise(totals.testCases.failed, "test case") << ", " "failed " << pluralise(totals.assertions.failed, "assertion") << '.'; } else { Colour colour(Colour::ResultSuccess); out << "Passed " << bothOrAll(totals.testCases.passed) << pluralise(totals.testCases.passed, "test case") << " with " << pluralise(totals.assertions.passed, "assertion") << '.'; } } // Implementation of CompactReporter formatting class AssertionPrinter { public: AssertionPrinter& operator=(AssertionPrinter const&) = delete; AssertionPrinter(AssertionPrinter const&) = delete; AssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages) : stream(_stream), result(_stats.assertionResult), messages(_stats.infoMessages), itMessage(_stats.infoMessages.begin()), printInfoMessages(_printInfoMessages) {} void print() { printSourceInfo(); itMessage = messages.begin(); switch (result.getResultType()) { case ResultWas::Ok: printResultType(Colour::ResultSuccess, passedString()); printOriginalExpression(); printReconstructedExpression(); if (!result.hasExpression()) printRemainingMessages(Colour::None); else printRemainingMessages(); break; case ResultWas::ExpressionFailed: if (result.isOk()) printResultType(Colour::ResultSuccess, failedString() + std::string(" - but was ok")); else printResultType(Colour::Error, failedString()); printOriginalExpression(); printReconstructedExpression(); printRemainingMessages(); break; case ResultWas::ThrewException: printResultType(Colour::Error, failedString()); printIssue("unexpected exception with message:"); printMessage(); printExpressionWas(); printRemainingMessages(); break; case ResultWas::FatalErrorCondition: printResultType(Colour::Error, failedString()); printIssue("fatal error condition with message:"); printMessage(); printExpressionWas(); printRemainingMessages(); break; case ResultWas::DidntThrowException: printResultType(Colour::Error, failedString()); printIssue("expected exception, got none"); printExpressionWas(); printRemainingMessages(); break; case ResultWas::Info: printResultType(Colour::None, "info"); printMessage(); printRemainingMessages(); break; case ResultWas::Warning: printResultType(Colour::None, "warning"); printMessage(); printRemainingMessages(); break; case ResultWas::ExplicitFailure: printResultType(Colour::Error, failedString()); printIssue("explicitly"); printRemainingMessages(Colour::None); break; // These cases are here to prevent compiler warnings case ResultWas::Unknown: case ResultWas::FailureBit: case ResultWas::Exception: printResultType(Colour::Error, "** internal error **"); break; } } private: void printSourceInfo() const { Colour colourGuard(Colour::FileName); stream << result.getSourceInfo() << ':'; } void printResultType(Colour::Code colour, std::string const& passOrFail) const { if (!passOrFail.empty()) { { Colour colourGuard(colour); stream << ' ' << passOrFail; } stream << ':'; } } void printIssue(std::string const& issue) const { stream << ' ' << issue; } void printExpressionWas() { if (result.hasExpression()) { stream << ';'; { Colour colour(dimColour()); stream << " expression was:"; } printOriginalExpression(); } } void printOriginalExpression() const { if (result.hasExpression()) { stream << ' ' << result.getExpression(); } } void printReconstructedExpression() const { if (result.hasExpandedExpression()) { { Colour colour(dimColour()); stream << " for: "; } stream << result.getExpandedExpression(); } } void printMessage() { if (itMessage != messages.end()) { stream << " '" << itMessage->message << '\''; ++itMessage; } } void printRemainingMessages(Colour::Code colour = dimColour()) { if (itMessage == messages.end()) return; // using messages.end() directly yields (or auto) compilation error: std::vector::const_iterator itEnd = messages.end(); const std::size_t N = static_cast(std::distance(itMessage, itEnd)); { Colour colourGuard(colour); stream << " with " << pluralise(N, "message") << ':'; } for (; itMessage != itEnd;) { // If this assertion is a warning ignore any INFO messages if (printInfoMessages || itMessage->type != ResultWas::Info) { stream << " '" << itMessage->message << '\''; if (++itMessage != itEnd) { Colour colourGuard(dimColour()); stream << " and"; } } } } private: std::ostream& stream; AssertionResult const& result; std::vector messages; std::vector::const_iterator itMessage; bool printInfoMessages; }; } // namespace std::string CompactReporter::getDescription() { return "Reports test results on a single line, suitable for IDEs"; } ReporterPreferences CompactReporter::getPreferences() const { return m_reporterPrefs; } void CompactReporter::noMatchingTestCases(std::string const& spec) { stream << "No test cases matched '" << spec << '\'' << std::endl; } void CompactReporter::assertionStarting(AssertionInfo const&) {} bool CompactReporter::assertionEnded(AssertionStats const& _assertionStats) { AssertionResult const& result = _assertionStats.assertionResult; bool printInfoMessages = true; // Drop out if result was successful and we're not printing those if (!m_config->includeSuccessfulResults() && result.isOk()) { if (result.getResultType() != ResultWas::Warning) return false; printInfoMessages = false; } AssertionPrinter printer(stream, _assertionStats, printInfoMessages); printer.print(); stream << std::endl; return true; } void CompactReporter::sectionEnded(SectionStats const& _sectionStats) { if (m_config->showDurations() == ShowDurations::Always) { stream << getFormattedDuration(_sectionStats.durationInSeconds) << " s: " << _sectionStats.sectionInfo.name << std::endl; } } void CompactReporter::testRunEnded(TestRunStats const& _testRunStats) { printTotals(stream, _testRunStats.totals); stream << '\n' << std::endl; StreamingReporterBase::testRunEnded(_testRunStats); } CompactReporter::~CompactReporter() {} CATCH_REGISTER_REPORTER("compact", CompactReporter) } // end namespace Catch // end catch_reporter_compact.cpp // start catch_reporter_console.cpp #include #include #if defined(_MSC_VER) #pragma warning(push) #pragma warning(disable : 4061) // Not all labels are EXPLICITLY handled in // switch Note that 4062 (not all labels are // handled and default is missing) is enabled #endif namespace Catch { namespace { // Formatter impl for ConsoleReporter class ConsoleAssertionPrinter { public: ConsoleAssertionPrinter& operator=(ConsoleAssertionPrinter const&) = delete; ConsoleAssertionPrinter(ConsoleAssertionPrinter const&) = delete; ConsoleAssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages) : stream(_stream), stats(_stats), result(_stats.assertionResult), colour(Colour::None), message(result.getMessage()), messages(_stats.infoMessages), printInfoMessages(_printInfoMessages) { switch (result.getResultType()) { case ResultWas::Ok: colour = Colour::Success; passOrFail = "PASSED"; // if( result.hasMessage() ) if (_stats.infoMessages.size() == 1) messageLabel = "with message"; if (_stats.infoMessages.size() > 1) messageLabel = "with messages"; break; case ResultWas::ExpressionFailed: if (result.isOk()) { colour = Colour::Success; passOrFail = "FAILED - but was ok"; } else { colour = Colour::Error; passOrFail = "FAILED"; } if (_stats.infoMessages.size() == 1) messageLabel = "with message"; if (_stats.infoMessages.size() > 1) messageLabel = "with messages"; break; case ResultWas::ThrewException: colour = Colour::Error; passOrFail = "FAILED"; messageLabel = "due to unexpected exception with "; if (_stats.infoMessages.size() == 1) messageLabel += "message"; if (_stats.infoMessages.size() > 1) messageLabel += "messages"; break; case ResultWas::FatalErrorCondition: colour = Colour::Error; passOrFail = "FAILED"; messageLabel = "due to a fatal error condition"; break; case ResultWas::DidntThrowException: colour = Colour::Error; passOrFail = "FAILED"; messageLabel = "because no exception was thrown where one was expected"; break; case ResultWas::Info: messageLabel = "info"; break; case ResultWas::Warning: messageLabel = "warning"; break; case ResultWas::ExplicitFailure: passOrFail = "FAILED"; colour = Colour::Error; if (_stats.infoMessages.size() == 1) messageLabel = "explicitly with message"; if (_stats.infoMessages.size() > 1) messageLabel = "explicitly with messages"; break; // These cases are here to prevent compiler warnings case ResultWas::Unknown: case ResultWas::FailureBit: case ResultWas::Exception: passOrFail = "** internal error **"; colour = Colour::Error; break; } } void print() const { printSourceInfo(); if (stats.totals.assertions.total() > 0) { printResultType(); printOriginalExpression(); printReconstructedExpression(); } else { stream << '\n'; } printMessage(); } private: void printResultType() const { if (!passOrFail.empty()) { Colour colourGuard(colour); stream << passOrFail << ":\n"; } } void printOriginalExpression() const { if (result.hasExpression()) { Colour colourGuard(Colour::OriginalExpression); stream << " "; stream << result.getExpressionInMacro(); stream << '\n'; } } void printReconstructedExpression() const { if (result.hasExpandedExpression()) { stream << "with expansion:\n"; Colour colourGuard(Colour::ReconstructedExpression); stream << Column(result.getExpandedExpression()).indent(2) << '\n'; } } void printMessage() const { if (!messageLabel.empty()) stream << messageLabel << ':' << '\n'; for (auto const& msg : messages) { // If this assertion is a warning ignore any INFO messages if (printInfoMessages || msg.type != ResultWas::Info) stream << Column(msg.message).indent(2) << '\n'; } } void printSourceInfo() const { Colour colourGuard(Colour::FileName); stream << result.getSourceInfo() << ": "; } std::ostream& stream; AssertionStats const& stats; AssertionResult const& result; Colour::Code colour; std::string passOrFail; std::string messageLabel; std::string message; std::vector messages; bool printInfoMessages; }; std::size_t makeRatio(std::size_t number, std::size_t total) { std::size_t ratio = total > 0 ? CATCH_CONFIG_CONSOLE_WIDTH * number / total : 0; return (ratio == 0 && number > 0) ? 1 : ratio; } std::size_t& findMax(std::size_t& i, std::size_t& j, std::size_t& k) { if (i > j && i > k) return i; else if (j > k) return j; else return k; } struct ColumnInfo { enum Justification { Left, Right }; std::string name; int width; Justification justification; }; struct ColumnBreak {}; struct RowBreak {}; class Duration { enum class Unit { Auto, Nanoseconds, Microseconds, Milliseconds, Seconds, Minutes }; static const uint64_t s_nanosecondsInAMicrosecond = 1000; static const uint64_t s_nanosecondsInAMillisecond = 1000 * s_nanosecondsInAMicrosecond; static const uint64_t s_nanosecondsInASecond = 1000 * s_nanosecondsInAMillisecond; static const uint64_t s_nanosecondsInAMinute = 60 * s_nanosecondsInASecond; uint64_t m_inNanoseconds; Unit m_units; public: explicit Duration(uint64_t inNanoseconds, Unit units = Unit::Auto) : m_inNanoseconds(inNanoseconds), m_units(units) { if (m_units == Unit::Auto) { if (m_inNanoseconds < s_nanosecondsInAMicrosecond) m_units = Unit::Nanoseconds; else if (m_inNanoseconds < s_nanosecondsInAMillisecond) m_units = Unit::Microseconds; else if (m_inNanoseconds < s_nanosecondsInASecond) m_units = Unit::Milliseconds; else if (m_inNanoseconds < s_nanosecondsInAMinute) m_units = Unit::Seconds; else m_units = Unit::Minutes; } } auto value() const -> double { switch (m_units) { case Unit::Microseconds: return m_inNanoseconds / static_cast(s_nanosecondsInAMicrosecond); case Unit::Milliseconds: return m_inNanoseconds / static_cast(s_nanosecondsInAMillisecond); case Unit::Seconds: return m_inNanoseconds / static_cast(s_nanosecondsInASecond); case Unit::Minutes: return m_inNanoseconds / static_cast(s_nanosecondsInAMinute); default: return static_cast(m_inNanoseconds); } } auto unitsAsString() const -> std::string { switch (m_units) { case Unit::Nanoseconds: return "ns"; case Unit::Microseconds: return "µs"; case Unit::Milliseconds: return "ms"; case Unit::Seconds: return "s"; case Unit::Minutes: return "m"; default: return "** internal error **"; } } friend auto operator<<(std::ostream& os, Duration const& duration) -> std::ostream& { return os << duration.value() << " " << duration.unitsAsString(); } }; } // namespace class TablePrinter { std::ostream& m_os; std::vector m_columnInfos; std::ostringstream m_oss; int m_currentColumn = -1; bool m_isOpen = false; public: TablePrinter(std::ostream& os, std::vector columnInfos) : m_os(os), m_columnInfos(std::move(columnInfos)) {} auto columnInfos() const -> std::vector const& { return m_columnInfos; } void open() { if (!m_isOpen) { m_isOpen = true; *this << RowBreak(); for (auto const& info : m_columnInfos) *this << info.name << ColumnBreak(); *this << RowBreak(); m_os << Catch::getLineOfChars<'-'>() << "\n"; } } void close() { if (m_isOpen) { *this << RowBreak(); m_os << std::endl; m_isOpen = false; } } template friend TablePrinter& operator<<(TablePrinter& tp, T const& value) { tp.m_oss << value; return tp; } friend TablePrinter& operator<<(TablePrinter& tp, ColumnBreak) { auto colStr = tp.m_oss.str(); // This takes account of utf8 encodings auto strSize = Catch::StringRef(colStr).numberOfCharacters(); tp.m_oss.str(""); tp.open(); if (tp.m_currentColumn == static_cast(tp.m_columnInfos.size() - 1)) { tp.m_currentColumn = -1; tp.m_os << "\n"; } tp.m_currentColumn++; auto colInfo = tp.m_columnInfos[tp.m_currentColumn]; auto padding = (strSize + 2 < static_cast(colInfo.width)) ? std::string(colInfo.width - (strSize + 2), ' ') : std::string(); if (colInfo.justification == ColumnInfo::Left) tp.m_os << colStr << padding << " "; else tp.m_os << padding << colStr << " "; return tp; } friend TablePrinter& operator<<(TablePrinter& tp, RowBreak) { if (tp.m_currentColumn > 0) { tp.m_os << "\n"; tp.m_currentColumn = -1; } return tp; } }; ConsoleReporter::ConsoleReporter(ReporterConfig const& config) : StreamingReporterBase(config), m_tablePrinter(new TablePrinter( config.stream(), {{"benchmark name", CATCH_CONFIG_CONSOLE_WIDTH - 32, ColumnInfo::Left}, {"iters", 8, ColumnInfo::Right}, {"elapsed ns", 14, ColumnInfo::Right}, {"average", 14, ColumnInfo::Right}})) {} ConsoleReporter::~ConsoleReporter() = default; std::string ConsoleReporter::getDescription() { return "Reports test results as plain lines of text"; } void ConsoleReporter::noMatchingTestCases(std::string const& spec) { stream << "No test cases matched '" << spec << '\'' << std::endl; } void ConsoleReporter::assertionStarting(AssertionInfo const&) {} bool ConsoleReporter::assertionEnded(AssertionStats const& _assertionStats) { AssertionResult const& result = _assertionStats.assertionResult; bool includeResults = m_config->includeSuccessfulResults() || !result.isOk(); // Drop out if result was successful but we're not printing them. if (!includeResults && result.getResultType() != ResultWas::Warning) return false; lazyPrint(); ConsoleAssertionPrinter printer(stream, _assertionStats, includeResults); printer.print(); stream << std::endl; return true; } void ConsoleReporter::sectionStarting(SectionInfo const& _sectionInfo) { m_headerPrinted = false; StreamingReporterBase::sectionStarting(_sectionInfo); } void ConsoleReporter::sectionEnded(SectionStats const& _sectionStats) { m_tablePrinter->close(); if (_sectionStats.missingAssertions) { lazyPrint(); Colour colour(Colour::ResultError); if (m_sectionStack.size() > 1) stream << "\nNo assertions in section"; else stream << "\nNo assertions in test case"; stream << " '" << _sectionStats.sectionInfo.name << "'\n" << std::endl; } if (m_config->showDurations() == ShowDurations::Always) { stream << getFormattedDuration(_sectionStats.durationInSeconds) << " s: " << _sectionStats.sectionInfo.name << std::endl; } if (m_headerPrinted) { m_headerPrinted = false; } StreamingReporterBase::sectionEnded(_sectionStats); } void ConsoleReporter::benchmarkStarting(BenchmarkInfo const& info) { lazyPrintWithoutClosingBenchmarkTable(); auto nameCol = Column(info.name).width( static_cast(m_tablePrinter->columnInfos()[0].width - 2)); bool firstLine = true; for (auto line : nameCol) { if (!firstLine) (*m_tablePrinter) << ColumnBreak() << ColumnBreak() << ColumnBreak(); else firstLine = false; (*m_tablePrinter) << line << ColumnBreak(); } } void ConsoleReporter::benchmarkEnded(BenchmarkStats const& stats) { Duration average(stats.elapsedTimeInNanoseconds / stats.iterations); (*m_tablePrinter) << stats.iterations << ColumnBreak() << stats.elapsedTimeInNanoseconds << ColumnBreak() << average << ColumnBreak(); } void ConsoleReporter::testCaseEnded(TestCaseStats const& _testCaseStats) { m_tablePrinter->close(); StreamingReporterBase::testCaseEnded(_testCaseStats); m_headerPrinted = false; } void ConsoleReporter::testGroupEnded(TestGroupStats const& _testGroupStats) { if (currentGroupInfo.used) { printSummaryDivider(); stream << "Summary for group '" << _testGroupStats.groupInfo.name << "':\n"; printTotals(_testGroupStats.totals); stream << '\n' << std::endl; } StreamingReporterBase::testGroupEnded(_testGroupStats); } void ConsoleReporter::testRunEnded(TestRunStats const& _testRunStats) { printTotalsDivider(_testRunStats.totals); printTotals(_testRunStats.totals); stream << std::endl; StreamingReporterBase::testRunEnded(_testRunStats); } void ConsoleReporter::lazyPrint() { m_tablePrinter->close(); lazyPrintWithoutClosingBenchmarkTable(); } void ConsoleReporter::lazyPrintWithoutClosingBenchmarkTable() { if (!currentTestRunInfo.used) lazyPrintRunInfo(); if (!currentGroupInfo.used) lazyPrintGroupInfo(); if (!m_headerPrinted) { printTestCaseAndSectionHeader(); m_headerPrinted = true; } } void ConsoleReporter::lazyPrintRunInfo() { stream << '\n' << getLineOfChars<'~'>() << '\n'; Colour colour(Colour::SecondaryText); stream << currentTestRunInfo->name << " is a Catch v" << libraryVersion() << " host application.\n" << "Run with -? for options\n\n"; if (m_config->rngSeed() != 0) stream << "Randomness seeded to: " << m_config->rngSeed() << "\n\n"; currentTestRunInfo.used = true; } void ConsoleReporter::lazyPrintGroupInfo() { if (!currentGroupInfo->name.empty() && currentGroupInfo->groupsCounts > 1) { printClosedHeader("Group: " + currentGroupInfo->name); currentGroupInfo.used = true; } } void ConsoleReporter::printTestCaseAndSectionHeader() { assert(!m_sectionStack.empty()); printOpenHeader(currentTestCaseInfo->name); if (m_sectionStack.size() > 1) { Colour colourGuard(Colour::Headers); auto it = m_sectionStack.begin() + 1, // Skip first section (test case) itEnd = m_sectionStack.end(); for (; it != itEnd; ++it) printHeaderString(it->name, 2); } SourceLineInfo lineInfo = m_sectionStack.back().lineInfo; if (!lineInfo.empty()) { stream << getLineOfChars<'-'>() << '\n'; Colour colourGuard(Colour::FileName); stream << lineInfo << '\n'; } stream << getLineOfChars<'.'>() << '\n' << std::endl; } void ConsoleReporter::printClosedHeader(std::string const& _name) { printOpenHeader(_name); stream << getLineOfChars<'.'>() << '\n'; } void ConsoleReporter::printOpenHeader(std::string const& _name) { stream << getLineOfChars<'-'>() << '\n'; { Colour colourGuard(Colour::Headers); printHeaderString(_name); } } // if string has a : in first line will set indent to follow it on // subsequent lines void ConsoleReporter::printHeaderString(std::string const& _string, std::size_t indent) { std::size_t i = _string.find(": "); if (i != std::string::npos) i += 2; else i = 0; stream << Column(_string).indent(indent + i).initialIndent(indent) << '\n'; } struct SummaryColumn { SummaryColumn(std::string _label, Colour::Code _colour) : label(std::move(_label)), colour(_colour) {} SummaryColumn addRow(std::size_t count) { ReusableStringStream rss; rss << count; std::string row = rss.str(); for (auto& oldRow : rows) { while (oldRow.size() < row.size()) oldRow = ' ' + oldRow; while (oldRow.size() > row.size()) row = ' ' + row; } rows.push_back(row); return *this; } std::string label; Colour::Code colour; std::vector rows; }; void ConsoleReporter::printTotals(Totals const& totals) { if (totals.testCases.total() == 0) { stream << Colour(Colour::Warning) << "No tests ran\n"; } else if (totals.assertions.total() > 0 && totals.testCases.allPassed()) { stream << Colour(Colour::ResultSuccess) << "All tests passed"; stream << " (" << pluralise(totals.assertions.passed, "assertion") << " in " << pluralise(totals.testCases.passed, "test case") << ')' << '\n'; } else { std::vector columns; columns.push_back(SummaryColumn("", Colour::None) .addRow(totals.testCases.total()) .addRow(totals.assertions.total())); columns.push_back(SummaryColumn("passed", Colour::Success) .addRow(totals.testCases.passed) .addRow(totals.assertions.passed)); columns.push_back(SummaryColumn("failed", Colour::ResultError) .addRow(totals.testCases.failed) .addRow(totals.assertions.failed)); columns.push_back( SummaryColumn("failed as expected", Colour::ResultExpectedFailure) .addRow(totals.testCases.failedButOk) .addRow(totals.assertions.failedButOk)); printSummaryRow("test cases", columns, 0); printSummaryRow("assertions", columns, 1); } } void ConsoleReporter::printSummaryRow(std::string const& label, std::vector const& cols, std::size_t row) { for (auto col : cols) { std::string value = col.rows[row]; if (col.label.empty()) { stream << label << ": "; if (value != "0") stream << value; else stream << Colour(Colour::Warning) << "- none -"; } else if (value != "0") { stream << Colour(Colour::LightGrey) << " | "; stream << Colour(col.colour) << value << ' ' << col.label; } } stream << '\n'; } void ConsoleReporter::printTotalsDivider(Totals const& totals) { if (totals.testCases.total() > 0) { std::size_t failedRatio = makeRatio(totals.testCases.failed, totals.testCases.total()); std::size_t failedButOkRatio = makeRatio(totals.testCases.failedButOk, totals.testCases.total()); std::size_t passedRatio = makeRatio(totals.testCases.passed, totals.testCases.total()); while (failedRatio + failedButOkRatio + passedRatio < CATCH_CONFIG_CONSOLE_WIDTH - 1) findMax(failedRatio, failedButOkRatio, passedRatio)++; while (failedRatio + failedButOkRatio + passedRatio > CATCH_CONFIG_CONSOLE_WIDTH - 1) findMax(failedRatio, failedButOkRatio, passedRatio)--; stream << Colour(Colour::Error) << std::string(failedRatio, '='); stream << Colour(Colour::ResultExpectedFailure) << std::string(failedButOkRatio, '='); if (totals.testCases.allPassed()) stream << Colour(Colour::ResultSuccess) << std::string(passedRatio, '='); else stream << Colour(Colour::Success) << std::string(passedRatio, '='); } else { stream << Colour(Colour::Warning) << std::string(CATCH_CONFIG_CONSOLE_WIDTH - 1, '='); } stream << '\n'; } void ConsoleReporter::printSummaryDivider() { stream << getLineOfChars<'-'>() << '\n'; } CATCH_REGISTER_REPORTER("console", ConsoleReporter) } // end namespace Catch #if defined(_MSC_VER) #pragma warning(pop) #endif // end catch_reporter_console.cpp // start catch_reporter_junit.cpp #include #include #include #include namespace Catch { namespace { std::string getCurrentTimestamp() { // Beware, this is not reentrant because of backward compatibility issues // Also, UTC only, again because of backward compatibility (%z is C++11) time_t rawtime; std::time(&rawtime); auto const timeStampSize = sizeof("2017-01-16T17:06:45Z"); #ifdef _MSC_VER std::tm timeInfo = {}; gmtime_s(&timeInfo, &rawtime); #else std::tm* timeInfo; timeInfo = std::gmtime(&rawtime); #endif char timeStamp[timeStampSize]; const char* const fmt = "%Y-%m-%dT%H:%M:%SZ"; #ifdef _MSC_VER std::strftime(timeStamp, timeStampSize, fmt, &timeInfo); #else std::strftime(timeStamp, timeStampSize, fmt, timeInfo); #endif return std::string(timeStamp); } std::string fileNameTag(const std::vector& tags) { auto it = std::find_if(begin(tags), end(tags), [](std::string const& tag) { return tag.front() == '#'; }); if (it != tags.end()) return it->substr(1); return std::string(); } } // anonymous namespace JunitReporter::JunitReporter(ReporterConfig const& _config) : CumulativeReporterBase(_config), xml(_config.stream()) { m_reporterPrefs.shouldRedirectStdOut = true; m_reporterPrefs.shouldReportAllAssertions = true; } JunitReporter::~JunitReporter() {} std::string JunitReporter::getDescription() { return "Reports test results in an XML format that looks like Ant's " "junitreport target"; } void JunitReporter::noMatchingTestCases(std::string const& /*spec*/) {} void JunitReporter::testRunStarting(TestRunInfo const& runInfo) { CumulativeReporterBase::testRunStarting(runInfo); xml.startElement("testsuites"); } void JunitReporter::testGroupStarting(GroupInfo const& groupInfo) { suiteTimer.start(); stdOutForSuite.clear(); stdErrForSuite.clear(); unexpectedExceptions = 0; CumulativeReporterBase::testGroupStarting(groupInfo); } void JunitReporter::testCaseStarting(TestCaseInfo const& testCaseInfo) { m_okToFail = testCaseInfo.okToFail(); } bool JunitReporter::assertionEnded(AssertionStats const& assertionStats) { if (assertionStats.assertionResult.getResultType() == ResultWas::ThrewException && !m_okToFail) unexpectedExceptions++; return CumulativeReporterBase::assertionEnded(assertionStats); } void JunitReporter::testCaseEnded(TestCaseStats const& testCaseStats) { stdOutForSuite += testCaseStats.stdOut; stdErrForSuite += testCaseStats.stdErr; CumulativeReporterBase::testCaseEnded(testCaseStats); } void JunitReporter::testGroupEnded(TestGroupStats const& testGroupStats) { double suiteTime = suiteTimer.getElapsedSeconds(); CumulativeReporterBase::testGroupEnded(testGroupStats); writeGroup(*m_testGroups.back(), suiteTime); } void JunitReporter::testRunEndedCumulative() { xml.endElement(); } void JunitReporter::writeGroup(TestGroupNode const& groupNode, double suiteTime) { XmlWriter::ScopedElement e = xml.scopedElement("testsuite"); TestGroupStats const& stats = groupNode.value; xml.writeAttribute("name", stats.groupInfo.name); xml.writeAttribute("errors", unexpectedExceptions); xml.writeAttribute("failures", stats.totals.assertions.failed - unexpectedExceptions); xml.writeAttribute("tests", stats.totals.assertions.total()); xml.writeAttribute("hostname", "tbd"); // !TBD if (m_config->showDurations() == ShowDurations::Never) xml.writeAttribute("time", ""); else xml.writeAttribute("time", suiteTime); xml.writeAttribute("timestamp", getCurrentTimestamp()); // Write test cases for (auto const& child : groupNode.children) writeTestCase(*child); xml.scopedElement("system-out").writeText(trim(stdOutForSuite), false); xml.scopedElement("system-err").writeText(trim(stdErrForSuite), false); } void JunitReporter::writeTestCase(TestCaseNode const& testCaseNode) { TestCaseStats const& stats = testCaseNode.value; // All test cases have exactly one section - which represents the // test case itself. That section may have 0-n nested sections assert(testCaseNode.children.size() == 1); SectionNode const& rootSection = *testCaseNode.children.front(); std::string className = stats.testInfo.className; if (className.empty()) { className = fileNameTag(stats.testInfo.tags); if (className.empty()) className = "global"; } if (!m_config->name().empty()) className = m_config->name() + "." + className; writeSection(className, "", rootSection); } void JunitReporter::writeSection(std::string const& className, std::string const& rootName, SectionNode const& sectionNode) { std::string name = trim(sectionNode.stats.sectionInfo.name); if (!rootName.empty()) name = rootName + '/' + name; if (!sectionNode.assertions.empty() || !sectionNode.stdOut.empty() || !sectionNode.stdErr.empty()) { XmlWriter::ScopedElement e = xml.scopedElement("testcase"); if (className.empty()) { xml.writeAttribute("classname", name); xml.writeAttribute("name", "root"); } else { xml.writeAttribute("classname", className); xml.writeAttribute("name", name); } xml.writeAttribute("time", ::Catch::Detail::stringify( sectionNode.stats.durationInSeconds)); writeAssertions(sectionNode); if (!sectionNode.stdOut.empty()) xml.scopedElement("system-out") .writeText(trim(sectionNode.stdOut), false); if (!sectionNode.stdErr.empty()) xml.scopedElement("system-err") .writeText(trim(sectionNode.stdErr), false); } for (auto const& childNode : sectionNode.childSections) if (className.empty()) writeSection(name, "", *childNode); else writeSection(className, name, *childNode); } void JunitReporter::writeAssertions(SectionNode const& sectionNode) { for (auto const& assertion : sectionNode.assertions) writeAssertion(assertion); } void JunitReporter::writeAssertion(AssertionStats const& stats) { AssertionResult const& result = stats.assertionResult; if (!result.isOk()) { std::string elementName; switch (result.getResultType()) { case ResultWas::ThrewException: case ResultWas::FatalErrorCondition: elementName = "error"; break; case ResultWas::ExplicitFailure: elementName = "failure"; break; case ResultWas::ExpressionFailed: elementName = "failure"; break; case ResultWas::DidntThrowException: elementName = "failure"; break; // We should never see these here: case ResultWas::Info: case ResultWas::Warning: case ResultWas::Ok: case ResultWas::Unknown: case ResultWas::FailureBit: case ResultWas::Exception: elementName = "internalError"; break; } XmlWriter::ScopedElement e = xml.scopedElement(elementName); xml.writeAttribute("message", result.getExpandedExpression()); xml.writeAttribute("type", result.getTestMacroName()); ReusableStringStream rss; if (!result.getMessage().empty()) rss << result.getMessage() << '\n'; for (auto const& msg : stats.infoMessages) if (msg.type == ResultWas::Info) rss << msg.message << '\n'; rss << "at " << result.getSourceInfo(); xml.writeText(rss.str(), false); } } CATCH_REGISTER_REPORTER("junit", JunitReporter) } // end namespace Catch // end catch_reporter_junit.cpp // start catch_reporter_listening.cpp #include namespace Catch { ListeningReporter::ListeningReporter() { // We will assume that listeners will always want all assertions m_preferences.shouldReportAllAssertions = true; } void ListeningReporter::addListener(IStreamingReporterPtr&& listener) { m_listeners.push_back(std::move(listener)); } void ListeningReporter::addReporter(IStreamingReporterPtr&& reporter) { assert(!m_reporter && "Listening reporter can wrap only 1 real reporter"); m_reporter = std::move(reporter); m_preferences.shouldRedirectStdOut = m_reporter->getPreferences().shouldRedirectStdOut; } ReporterPreferences ListeningReporter::getPreferences() const { return m_preferences; } std::set ListeningReporter::getSupportedVerbosities() { return std::set{}; } void ListeningReporter::noMatchingTestCases(std::string const& spec) { for (auto const& listener : m_listeners) { listener->noMatchingTestCases(spec); } m_reporter->noMatchingTestCases(spec); } void ListeningReporter::benchmarkStarting(BenchmarkInfo const& benchmarkInfo) { for (auto const& listener : m_listeners) { listener->benchmarkStarting(benchmarkInfo); } m_reporter->benchmarkStarting(benchmarkInfo); } void ListeningReporter::benchmarkEnded(BenchmarkStats const& benchmarkStats) { for (auto const& listener : m_listeners) { listener->benchmarkEnded(benchmarkStats); } m_reporter->benchmarkEnded(benchmarkStats); } void ListeningReporter::testRunStarting(TestRunInfo const& testRunInfo) { for (auto const& listener : m_listeners) { listener->testRunStarting(testRunInfo); } m_reporter->testRunStarting(testRunInfo); } void ListeningReporter::testGroupStarting(GroupInfo const& groupInfo) { for (auto const& listener : m_listeners) { listener->testGroupStarting(groupInfo); } m_reporter->testGroupStarting(groupInfo); } void ListeningReporter::testCaseStarting(TestCaseInfo const& testInfo) { for (auto const& listener : m_listeners) { listener->testCaseStarting(testInfo); } m_reporter->testCaseStarting(testInfo); } void ListeningReporter::sectionStarting(SectionInfo const& sectionInfo) { for (auto const& listener : m_listeners) { listener->sectionStarting(sectionInfo); } m_reporter->sectionStarting(sectionInfo); } void ListeningReporter::assertionStarting(AssertionInfo const& assertionInfo) { for (auto const& listener : m_listeners) { listener->assertionStarting(assertionInfo); } m_reporter->assertionStarting(assertionInfo); } // The return value indicates if the messages buffer should be cleared: bool ListeningReporter::assertionEnded(AssertionStats const& assertionStats) { for (auto const& listener : m_listeners) { static_cast(listener->assertionEnded(assertionStats)); } return m_reporter->assertionEnded(assertionStats); } void ListeningReporter::sectionEnded(SectionStats const& sectionStats) { for (auto const& listener : m_listeners) { listener->sectionEnded(sectionStats); } m_reporter->sectionEnded(sectionStats); } void ListeningReporter::testCaseEnded(TestCaseStats const& testCaseStats) { for (auto const& listener : m_listeners) { listener->testCaseEnded(testCaseStats); } m_reporter->testCaseEnded(testCaseStats); } void ListeningReporter::testGroupEnded(TestGroupStats const& testGroupStats) { for (auto const& listener : m_listeners) { listener->testGroupEnded(testGroupStats); } m_reporter->testGroupEnded(testGroupStats); } void ListeningReporter::testRunEnded(TestRunStats const& testRunStats) { for (auto const& listener : m_listeners) { listener->testRunEnded(testRunStats); } m_reporter->testRunEnded(testRunStats); } void ListeningReporter::skipTest(TestCaseInfo const& testInfo) { for (auto const& listener : m_listeners) { listener->skipTest(testInfo); } m_reporter->skipTest(testInfo); } bool ListeningReporter::isMulti() const { return true; } } // end namespace Catch // end catch_reporter_listening.cpp // start catch_reporter_xml.cpp #if defined(_MSC_VER) #pragma warning(push) #pragma warning(disable : 4061) // Not all labels are EXPLICITLY handled in // switch Note that 4062 (not all labels are // handled and default is missing) is enabled #endif namespace Catch { XmlReporter::XmlReporter(ReporterConfig const& _config) : StreamingReporterBase(_config), m_xml(_config.stream()) { m_reporterPrefs.shouldRedirectStdOut = true; m_reporterPrefs.shouldReportAllAssertions = true; } XmlReporter::~XmlReporter() = default; std::string XmlReporter::getDescription() { return "Reports test results as an XML document"; } std::string XmlReporter::getStylesheetRef() const { return std::string(); } void XmlReporter::writeSourceInfo(SourceLineInfo const& sourceInfo) { m_xml.writeAttribute("filename", sourceInfo.file) .writeAttribute("line", sourceInfo.line); } void XmlReporter::noMatchingTestCases(std::string const& s) { StreamingReporterBase::noMatchingTestCases(s); } void XmlReporter::testRunStarting(TestRunInfo const& testInfo) { StreamingReporterBase::testRunStarting(testInfo); std::string stylesheetRef = getStylesheetRef(); if (!stylesheetRef.empty()) m_xml.writeStylesheetRef(stylesheetRef); m_xml.startElement("Catch"); if (!m_config->name().empty()) m_xml.writeAttribute("name", m_config->name()); if (m_config->rngSeed() != 0) m_xml.scopedElement("Randomness") .writeAttribute("seed", m_config->rngSeed()); } void XmlReporter::testGroupStarting(GroupInfo const& groupInfo) { StreamingReporterBase::testGroupStarting(groupInfo); m_xml.startElement("Group").writeAttribute("name", groupInfo.name); } void XmlReporter::testCaseStarting(TestCaseInfo const& testInfo) { StreamingReporterBase::testCaseStarting(testInfo); m_xml.startElement("TestCase") .writeAttribute("name", trim(testInfo.name)) .writeAttribute("description", testInfo.description) .writeAttribute("tags", testInfo.tagsAsString()); writeSourceInfo(testInfo.lineInfo); if (m_config->showDurations() == ShowDurations::Always) m_testCaseTimer.start(); m_xml.ensureTagClosed(); } void XmlReporter::sectionStarting(SectionInfo const& sectionInfo) { StreamingReporterBase::sectionStarting(sectionInfo); if (m_sectionDepth++ > 0) { m_xml.startElement("Section").writeAttribute("name", trim(sectionInfo.name)); writeSourceInfo(sectionInfo.lineInfo); m_xml.ensureTagClosed(); } } void XmlReporter::assertionStarting(AssertionInfo const&) {} bool XmlReporter::assertionEnded(AssertionStats const& assertionStats) { AssertionResult const& result = assertionStats.assertionResult; bool includeResults = m_config->includeSuccessfulResults() || !result.isOk(); if (includeResults || result.getResultType() == ResultWas::Warning) { // Print any info messages in tags. for (auto const& msg : assertionStats.infoMessages) { if (msg.type == ResultWas::Info && includeResults) { m_xml.scopedElement("Info").writeText(msg.message); } else if (msg.type == ResultWas::Warning) { m_xml.scopedElement("Warning").writeText(msg.message); } } } // Drop out if result was successful but we're not printing them. if (!includeResults && result.getResultType() != ResultWas::Warning) return true; // Print the expression if there is one. if (result.hasExpression()) { m_xml.startElement("Expression") .writeAttribute("success", result.succeeded()) .writeAttribute("type", result.getTestMacroName()); writeSourceInfo(result.getSourceInfo()); m_xml.scopedElement("Original").writeText(result.getExpression()); m_xml.scopedElement("Expanded").writeText(result.getExpandedExpression()); } // And... Print a result applicable to each result type. switch (result.getResultType()) { case ResultWas::ThrewException: m_xml.startElement("Exception"); writeSourceInfo(result.getSourceInfo()); m_xml.writeText(result.getMessage()); m_xml.endElement(); break; case ResultWas::FatalErrorCondition: m_xml.startElement("FatalErrorCondition"); writeSourceInfo(result.getSourceInfo()); m_xml.writeText(result.getMessage()); m_xml.endElement(); break; case ResultWas::Info: m_xml.scopedElement("Info").writeText(result.getMessage()); break; case ResultWas::Warning: // Warning will already have been written break; case ResultWas::ExplicitFailure: m_xml.startElement("Failure"); writeSourceInfo(result.getSourceInfo()); m_xml.writeText(result.getMessage()); m_xml.endElement(); break; default: break; } if (result.hasExpression()) m_xml.endElement(); return true; } void XmlReporter::sectionEnded(SectionStats const& sectionStats) { StreamingReporterBase::sectionEnded(sectionStats); if (--m_sectionDepth > 0) { XmlWriter::ScopedElement e = m_xml.scopedElement("OverallResults"); e.writeAttribute("successes", sectionStats.assertions.passed); e.writeAttribute("failures", sectionStats.assertions.failed); e.writeAttribute("expectedFailures", sectionStats.assertions.failedButOk); if (m_config->showDurations() == ShowDurations::Always) e.writeAttribute("durationInSeconds", sectionStats.durationInSeconds); m_xml.endElement(); } } void XmlReporter::testCaseEnded(TestCaseStats const& testCaseStats) { StreamingReporterBase::testCaseEnded(testCaseStats); XmlWriter::ScopedElement e = m_xml.scopedElement("OverallResult"); e.writeAttribute("success", testCaseStats.totals.assertions.allOk()); if (m_config->showDurations() == ShowDurations::Always) e.writeAttribute("durationInSeconds", m_testCaseTimer.getElapsedSeconds()); if (!testCaseStats.stdOut.empty()) m_xml.scopedElement("StdOut").writeText(trim(testCaseStats.stdOut), false); if (!testCaseStats.stdErr.empty()) m_xml.scopedElement("StdErr").writeText(trim(testCaseStats.stdErr), false); m_xml.endElement(); } void XmlReporter::testGroupEnded(TestGroupStats const& testGroupStats) { StreamingReporterBase::testGroupEnded(testGroupStats); // TODO: Check testGroupStats.aborting and act accordingly. m_xml.scopedElement("OverallResults") .writeAttribute("successes", testGroupStats.totals.assertions.passed) .writeAttribute("failures", testGroupStats.totals.assertions.failed) .writeAttribute("expectedFailures", testGroupStats.totals.assertions.failedButOk); m_xml.endElement(); } void XmlReporter::testRunEnded(TestRunStats const& testRunStats) { StreamingReporterBase::testRunEnded(testRunStats); m_xml.scopedElement("OverallResults") .writeAttribute("successes", testRunStats.totals.assertions.passed) .writeAttribute("failures", testRunStats.totals.assertions.failed) .writeAttribute("expectedFailures", testRunStats.totals.assertions.failedButOk); m_xml.endElement(); } CATCH_REGISTER_REPORTER("xml", XmlReporter) } // end namespace Catch #if defined(_MSC_VER) #pragma warning(pop) #endif // end catch_reporter_xml.cpp namespace Catch { LeakDetector leakDetector; } #ifdef __clang__ #pragma clang diagnostic pop #endif // end catch_impl.hpp #endif #ifdef CATCH_CONFIG_MAIN // start catch_default_main.hpp #ifndef __OBJC__ #if defined(CATCH_CONFIG_WCHAR) && defined(WIN32) && defined(_UNICODE) && \ !defined(DO_NOT_USE_WMAIN) // Standard C/C++ Win32 Unicode wmain entry point extern "C" int wmain(int argc, wchar_t* argv[], wchar_t*[]) { #else // Standard C/C++ main entry point int main(int argc, char* argv[]) { #endif return Catch::Session().run(argc, argv); } #else // __OBJC__ // Objective-C entry point int main(int argc, char* const argv[]) { #if !CATCH_ARC_ENABLED NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; #endif Catch::registerTestMethods(); int result = Catch::Session().run(argc, (char**)argv); #if !CATCH_ARC_ENABLED [pool drain]; #endif return result; } #endif // __OBJC__ // end catch_default_main.hpp #endif #if !defined(CATCH_CONFIG_IMPL_ONLY) #ifdef CLARA_CONFIG_MAIN_NOT_DEFINED #undef CLARA_CONFIG_MAIN #endif #if !defined(CATCH_CONFIG_DISABLE) ////// // If this config identifier is defined then all CATCH macros are prefixed with // CATCH_ #ifdef CATCH_CONFIG_PREFIX_ALL #define CATCH_REQUIRE(...) \ INTERNAL_CATCH_TEST("CATCH_REQUIRE", Catch::ResultDisposition::Normal, \ __VA_ARGS__) #define CATCH_REQUIRE_FALSE(...) \ INTERNAL_CATCH_TEST( \ "CATCH_REQUIRE_FALSE", \ Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, \ __VA_ARGS__) #define CATCH_REQUIRE_THROWS(...) \ INTERNAL_CATCH_THROWS("CATCH_REQUIRE_THROWS", \ Catch::ResultDisposition::Normal, "", __VA_ARGS__) #define CATCH_REQUIRE_THROWS_AS(expr, exceptionType) \ INTERNAL_CATCH_THROWS_AS("CATCH_REQUIRE_THROWS_AS", exceptionType, \ Catch::ResultDisposition::Normal, expr) #define CATCH_REQUIRE_THROWS_WITH(expr, matcher) \ INTERNAL_CATCH_THROWS_STR_MATCHES("CATCH_REQUIRE_THROWS_WITH", \ Catch::ResultDisposition::Normal, matcher, \ expr) #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) #define CATCH_REQUIRE_THROWS_MATCHES(expr, exceptionType, matcher) \ INTERNAL_CATCH_THROWS_MATCHES("CATCH_REQUIRE_THROWS_MATCHES", exceptionType, \ Catch::ResultDisposition::Normal, matcher, \ expr) #endif // CATCH_CONFIG_DISABLE_MATCHERS #define CATCH_REQUIRE_NOTHROW(...) \ INTERNAL_CATCH_NO_THROW("CATCH_REQUIRE_NOTHROW", \ Catch::ResultDisposition::Normal, __VA_ARGS__) #define CATCH_CHECK(...) \ INTERNAL_CATCH_TEST( \ "CATCH_CHECK", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__) #define CATCH_CHECK_FALSE(...) \ INTERNAL_CATCH_TEST("CATCH_CHECK_FALSE", \ Catch::ResultDisposition::ContinueOnFailure | \ Catch::ResultDisposition::FalseTest, \ __VA_ARGS__) #define CATCH_CHECKED_IF(...) \ INTERNAL_CATCH_IF("CATCH_CHECKED_IF", \ Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__) #define CATCH_CHECKED_ELSE(...) \ INTERNAL_CATCH_ELSE("CATCH_CHECKED_ELSE", \ Catch::ResultDisposition::ContinueOnFailure, \ __VA_ARGS__) #define CATCH_CHECK_NOFAIL(...) \ INTERNAL_CATCH_TEST("CATCH_CHECK_NOFAIL", \ Catch::ResultDisposition::ContinueOnFailure | \ Catch::ResultDisposition::SuppressFail, \ __VA_ARGS__) #define CATCH_CHECK_THROWS(...) \ INTERNAL_CATCH_THROWS("CATCH_CHECK_THROWS", \ Catch::ResultDisposition::ContinueOnFailure, "", \ __VA_ARGS__) #define CATCH_CHECK_THROWS_AS(expr, exceptionType) \ INTERNAL_CATCH_THROWS_AS("CATCH_CHECK_THROWS_AS", exceptionType, \ Catch::ResultDisposition::ContinueOnFailure, expr) #define CATCH_CHECK_THROWS_WITH(expr, matcher) \ INTERNAL_CATCH_THROWS_STR_MATCHES( \ "CATCH_CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, \ matcher, expr) #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) #define CATCH_CHECK_THROWS_MATCHES(expr, exceptionType, matcher) \ INTERNAL_CATCH_THROWS_MATCHES("CATCH_CHECK_THROWS_MATCHES", exceptionType, \ Catch::ResultDisposition::ContinueOnFailure, \ matcher, expr) #endif // CATCH_CONFIG_DISABLE_MATCHERS #define CATCH_CHECK_NOTHROW(...) \ INTERNAL_CATCH_NO_THROW("CATCH_CHECK_NOTHROW", \ Catch::ResultDisposition::ContinueOnFailure, \ __VA_ARGS__) #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) #define CATCH_CHECK_THAT(arg, matcher) \ INTERNAL_CHECK_THAT("CATCH_CHECK_THAT", matcher, \ Catch::ResultDisposition::ContinueOnFailure, arg) #define CATCH_REQUIRE_THAT(arg, matcher) \ INTERNAL_CHECK_THAT("CATCH_REQUIRE_THAT", matcher, \ Catch::ResultDisposition::Normal, arg) #endif // CATCH_CONFIG_DISABLE_MATCHERS #define CATCH_INFO(msg) INTERNAL_CATCH_INFO("CATCH_INFO", msg) #define CATCH_WARN(msg) \ INTERNAL_CATCH_MSG("CATCH_WARN", Catch::ResultWas::Warning, \ Catch::ResultDisposition::ContinueOnFailure, msg) #define CATCH_CAPTURE(...) \ INTERNAL_CATCH_CAPTURE(INTERNAL_CATCH_UNIQUE_NAME(capturer), \ "CATCH_CAPTURE", __VA_ARGS__) #define CATCH_TEST_CASE(...) INTERNAL_CATCH_TESTCASE(__VA_ARGS__) #define CATCH_TEST_CASE_METHOD(className, ...) \ INTERNAL_CATCH_TEST_CASE_METHOD(className, __VA_ARGS__) #define CATCH_METHOD_AS_TEST_CASE(method, ...) \ INTERNAL_CATCH_METHOD_AS_TEST_CASE(method, __VA_ARGS__) #define CATCH_REGISTER_TEST_CASE(Function, ...) \ INTERNAL_CATCH_REGISTER_TESTCASE(Function, __VA_ARGS__) #define CATCH_SECTION(...) INTERNAL_CATCH_SECTION(__VA_ARGS__) #define CATCH_DYNAMIC_SECTION(...) INTERNAL_CATCH_DYNAMIC_SECTION(__VA_ARGS__) #define CATCH_FAIL(...) \ INTERNAL_CATCH_MSG("CATCH_FAIL", Catch::ResultWas::ExplicitFailure, \ Catch::ResultDisposition::Normal, __VA_ARGS__) #define CATCH_FAIL_CHECK(...) \ INTERNAL_CATCH_MSG("CATCH_FAIL_CHECK", Catch::ResultWas::ExplicitFailure, \ Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__) #define CATCH_SUCCEED(...) \ INTERNAL_CATCH_MSG("CATCH_SUCCEED", Catch::ResultWas::Ok, \ Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__) #define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE() #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define CATCH_TEMPLATE_TEST_CASE(...) \ INTERNAL_CATCH_TEMPLATE_TEST_CASE(__VA_ARGS__) #define CATCH_TEMPLATE_TEST_CASE_METHOD(className, ...) \ INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD(className, __VA_ARGS__) #else #define CATCH_TEMPLATE_TEST_CASE(...) \ INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_TEMPLATE_TEST_CASE(__VA_ARGS__)) #define CATCH_TEMPLATE_TEST_CASE_METHOD(className, ...) \ INTERNAL_CATCH_EXPAND_VARGS( \ INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD(className, __VA_ARGS__)) #endif #if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE) #define CATCH_STATIC_REQUIRE(...) \ static_assert(__VA_ARGS__, #__VA_ARGS__); \ CATCH_SUCCEED(#__VA_ARGS__) #define CATCH_STATIC_REQUIRE_FALSE(...) \ static_assert(!(__VA_ARGS__), "!(" #__VA_ARGS__ ")"); \ CATCH_SUCCEED(#__VA_ARGS__) #else #define CATCH_STATIC_REQUIRE(...) CATCH_REQUIRE(__VA_ARGS__) #define CATCH_STATIC_REQUIRE_FALSE(...) CATCH_REQUIRE_FALSE(__VA_ARGS__) #endif // "BDD-style" convenience wrappers #define CATCH_SCENARIO(...) CATCH_TEST_CASE("Scenario: " __VA_ARGS__) #define CATCH_SCENARIO_METHOD(className, ...) \ INTERNAL_CATCH_TEST_CASE_METHOD(className, "Scenario: " __VA_ARGS__) #define CATCH_GIVEN(desc) INTERNAL_CATCH_DYNAMIC_SECTION(" Given: " << desc) #define CATCH_AND_GIVEN(desc) \ INTERNAL_CATCH_DYNAMIC_SECTION("And given: " << desc) #define CATCH_WHEN(desc) INTERNAL_CATCH_DYNAMIC_SECTION(" When: " << desc) #define CATCH_AND_WHEN(desc) \ INTERNAL_CATCH_DYNAMIC_SECTION(" And when: " << desc) #define CATCH_THEN(desc) INTERNAL_CATCH_DYNAMIC_SECTION(" Then: " << desc) #define CATCH_AND_THEN(desc) \ INTERNAL_CATCH_DYNAMIC_SECTION(" And: " << desc) // If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not // required #else #define REQUIRE(...) \ INTERNAL_CATCH_TEST("REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__) #define REQUIRE_FALSE(...) \ INTERNAL_CATCH_TEST( \ "REQUIRE_FALSE", \ Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, \ __VA_ARGS__) #define REQUIRE_THROWS(...) \ INTERNAL_CATCH_THROWS("REQUIRE_THROWS", Catch::ResultDisposition::Normal, \ __VA_ARGS__) #define REQUIRE_THROWS_AS(expr, exceptionType) \ INTERNAL_CATCH_THROWS_AS("REQUIRE_THROWS_AS", exceptionType, \ Catch::ResultDisposition::Normal, expr) #define REQUIRE_THROWS_WITH(expr, matcher) \ INTERNAL_CATCH_THROWS_STR_MATCHES( \ "REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr) #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) #define REQUIRE_THROWS_MATCHES(expr, exceptionType, matcher) \ INTERNAL_CATCH_THROWS_MATCHES("REQUIRE_THROWS_MATCHES", exceptionType, \ Catch::ResultDisposition::Normal, matcher, \ expr) #endif // CATCH_CONFIG_DISABLE_MATCHERS #define REQUIRE_NOTHROW(...) \ INTERNAL_CATCH_NO_THROW("REQUIRE_NOTHROW", Catch::ResultDisposition::Normal, \ __VA_ARGS__) #define CHECK(...) \ INTERNAL_CATCH_TEST("CHECK", Catch::ResultDisposition::ContinueOnFailure, \ __VA_ARGS__) #define CHECK_FALSE(...) \ INTERNAL_CATCH_TEST("CHECK_FALSE", \ Catch::ResultDisposition::ContinueOnFailure | \ Catch::ResultDisposition::FalseTest, \ __VA_ARGS__) #define CHECKED_IF(...) \ INTERNAL_CATCH_IF("CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure, \ __VA_ARGS__) #define CHECKED_ELSE(...) \ INTERNAL_CATCH_ELSE("CHECKED_ELSE", \ Catch::ResultDisposition::ContinueOnFailure, \ __VA_ARGS__) #define CHECK_NOFAIL(...) \ INTERNAL_CATCH_TEST("CHECK_NOFAIL", \ Catch::ResultDisposition::ContinueOnFailure | \ Catch::ResultDisposition::SuppressFail, \ __VA_ARGS__) #define CHECK_THROWS(...) \ INTERNAL_CATCH_THROWS("CHECK_THROWS", \ Catch::ResultDisposition::ContinueOnFailure, \ __VA_ARGS__) #define CHECK_THROWS_AS(expr, exceptionType) \ INTERNAL_CATCH_THROWS_AS("CHECK_THROWS_AS", exceptionType, \ Catch::ResultDisposition::ContinueOnFailure, expr) #define CHECK_THROWS_WITH(expr, matcher) \ INTERNAL_CATCH_THROWS_STR_MATCHES( \ "CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, \ matcher, expr) #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) #define CHECK_THROWS_MATCHES(expr, exceptionType, matcher) \ INTERNAL_CATCH_THROWS_MATCHES("CHECK_THROWS_MATCHES", exceptionType, \ Catch::ResultDisposition::ContinueOnFailure, \ matcher, expr) #endif // CATCH_CONFIG_DISABLE_MATCHERS #define CHECK_NOTHROW(...) \ INTERNAL_CATCH_NO_THROW("CHECK_NOTHROW", \ Catch::ResultDisposition::ContinueOnFailure, \ __VA_ARGS__) #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) #define CHECK_THAT(arg, matcher) \ INTERNAL_CHECK_THAT("CHECK_THAT", matcher, \ Catch::ResultDisposition::ContinueOnFailure, arg) #define REQUIRE_THAT(arg, matcher) \ INTERNAL_CHECK_THAT("REQUIRE_THAT", matcher, \ Catch::ResultDisposition::Normal, arg) #endif // CATCH_CONFIG_DISABLE_MATCHERS #define INFO(msg) INTERNAL_CATCH_INFO("INFO", msg) #define WARN(msg) \ INTERNAL_CATCH_MSG("WARN", Catch::ResultWas::Warning, \ Catch::ResultDisposition::ContinueOnFailure, msg) #define CAPTURE(...) \ INTERNAL_CATCH_CAPTURE(INTERNAL_CATCH_UNIQUE_NAME(capturer), "CAPTURE", \ __VA_ARGS__) #define TEST_CASE(...) INTERNAL_CATCH_TESTCASE(__VA_ARGS__) #define TEST_CASE_METHOD(className, ...) \ INTERNAL_CATCH_TEST_CASE_METHOD(className, __VA_ARGS__) #define METHOD_AS_TEST_CASE(method, ...) \ INTERNAL_CATCH_METHOD_AS_TEST_CASE(method, __VA_ARGS__) #define REGISTER_TEST_CASE(Function, ...) \ INTERNAL_CATCH_REGISTER_TESTCASE(Function, __VA_ARGS__) #define SECTION(...) INTERNAL_CATCH_SECTION(__VA_ARGS__) #define DYNAMIC_SECTION(...) INTERNAL_CATCH_DYNAMIC_SECTION(__VA_ARGS__) #define FAIL(...) \ INTERNAL_CATCH_MSG("FAIL", Catch::ResultWas::ExplicitFailure, \ Catch::ResultDisposition::Normal, __VA_ARGS__) #define FAIL_CHECK(...) \ INTERNAL_CATCH_MSG("FAIL_CHECK", Catch::ResultWas::ExplicitFailure, \ Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__) #define SUCCEED(...) \ INTERNAL_CATCH_MSG("SUCCEED", Catch::ResultWas::Ok, \ Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__) #define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE() #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define TEMPLATE_TEST_CASE(...) INTERNAL_CATCH_TEMPLATE_TEST_CASE(__VA_ARGS__) #define TEMPLATE_TEST_CASE_METHOD(className, ...) \ INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD(className, __VA_ARGS__) #else #define TEMPLATE_TEST_CASE(...) \ INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_TEMPLATE_TEST_CASE(__VA_ARGS__)) #define TEMPLATE_TEST_CASE_METHOD(className, ...) \ INTERNAL_CATCH_EXPAND_VARGS( \ INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD(className, __VA_ARGS__)) #endif #if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE) #define STATIC_REQUIRE(...) \ static_assert(__VA_ARGS__, #__VA_ARGS__); \ SUCCEED(#__VA_ARGS__) #define STATIC_REQUIRE_FALSE(...) \ static_assert(!(__VA_ARGS__), "!(" #__VA_ARGS__ ")"); \ SUCCEED("!(" #__VA_ARGS__ ")") #else #define STATIC_REQUIRE(...) REQUIRE(__VA_ARGS__) #define STATIC_REQUIRE_FALSE(...) REQUIRE_FALSE(__VA_ARGS__) #endif #endif #define CATCH_TRANSLATE_EXCEPTION(signature) \ INTERNAL_CATCH_TRANSLATE_EXCEPTION(signature) // "BDD-style" convenience wrappers #define SCENARIO(...) TEST_CASE("Scenario: " __VA_ARGS__) #define SCENARIO_METHOD(className, ...) \ INTERNAL_CATCH_TEST_CASE_METHOD(className, "Scenario: " __VA_ARGS__) #define GIVEN(desc) INTERNAL_CATCH_DYNAMIC_SECTION(" Given: " << desc) #define AND_GIVEN(desc) INTERNAL_CATCH_DYNAMIC_SECTION("And given: " << desc) #define WHEN(desc) INTERNAL_CATCH_DYNAMIC_SECTION(" When: " << desc) #define AND_WHEN(desc) INTERNAL_CATCH_DYNAMIC_SECTION(" And when: " << desc) #define THEN(desc) INTERNAL_CATCH_DYNAMIC_SECTION(" Then: " << desc) #define AND_THEN(desc) INTERNAL_CATCH_DYNAMIC_SECTION(" And: " << desc) using Catch::Detail::Approx; #else // CATCH_CONFIG_DISABLE ////// // If this config identifier is defined then all CATCH macros are prefixed with // CATCH_ #ifdef CATCH_CONFIG_PREFIX_ALL #define CATCH_REQUIRE(...) (void)(0) #define CATCH_REQUIRE_FALSE(...) (void)(0) #define CATCH_REQUIRE_THROWS(...) (void)(0) #define CATCH_REQUIRE_THROWS_AS(expr, exceptionType) (void)(0) #define CATCH_REQUIRE_THROWS_WITH(expr, matcher) (void)(0) #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) #define CATCH_REQUIRE_THROWS_MATCHES(expr, exceptionType, matcher) (void)(0) #endif // CATCH_CONFIG_DISABLE_MATCHERS #define CATCH_REQUIRE_NOTHROW(...) (void)(0) #define CATCH_CHECK(...) (void)(0) #define CATCH_CHECK_FALSE(...) (void)(0) #define CATCH_CHECKED_IF(...) if (__VA_ARGS__) #define CATCH_CHECKED_ELSE(...) if (!(__VA_ARGS__)) #define CATCH_CHECK_NOFAIL(...) (void)(0) #define CATCH_CHECK_THROWS(...) (void)(0) #define CATCH_CHECK_THROWS_AS(expr, exceptionType) (void)(0) #define CATCH_CHECK_THROWS_WITH(expr, matcher) (void)(0) #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) #define CATCH_CHECK_THROWS_MATCHES(expr, exceptionType, matcher) (void)(0) #endif // CATCH_CONFIG_DISABLE_MATCHERS #define CATCH_CHECK_NOTHROW(...) (void)(0) #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) #define CATCH_CHECK_THAT(arg, matcher) (void)(0) #define CATCH_REQUIRE_THAT(arg, matcher) (void)(0) #endif // CATCH_CONFIG_DISABLE_MATCHERS #define CATCH_INFO(msg) (void)(0) #define CATCH_WARN(msg) (void)(0) #define CATCH_CAPTURE(msg) (void)(0) #define CATCH_TEST_CASE(...) \ INTERNAL_CATCH_TESTCASE_NO_REGISTRATION( \ INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____T_E_S_T____)) #define CATCH_TEST_CASE_METHOD(className, ...) \ INTERNAL_CATCH_TESTCASE_NO_REGISTRATION( \ INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____T_E_S_T____)) #define CATCH_METHOD_AS_TEST_CASE(method, ...) #define CATCH_REGISTER_TEST_CASE(Function, ...) (void)(0) #define CATCH_SECTION(...) #define CATCH_DYNAMIC_SECTION(...) #define CATCH_FAIL(...) (void)(0) #define CATCH_FAIL_CHECK(...) (void)(0) #define CATCH_SUCCEED(...) (void)(0) #define CATCH_ANON_TEST_CASE() \ INTERNAL_CATCH_TESTCASE_NO_REGISTRATION( \ INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____T_E_S_T____)) #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define CATCH_TEMPLATE_TEST_CASE(...) \ INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION( \ INTERNAL_CATCH_UNIQUE_NAME( \ ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____)) #define CATCH_TEMPLATE_TEST_CASE_METHOD(className, ...) \ INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( \ INTERNAL_CATCH_UNIQUE_NAME( \ ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____), \ className) #else #define CATCH_TEMPLATE_TEST_CASE(...) \ INTERNAL_CATCH_EXPAND_VARGS( \ INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION( \ INTERNAL_CATCH_UNIQUE_NAME( \ ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____))) #define CATCH_TEMPLATE_TEST_CASE_METHOD(className, ...) \ INTERNAL_CATCH_EXPAND_VARGS( \ INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( \ INTERNAL_CATCH_UNIQUE_NAME( \ ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____), \ className)) #endif // "BDD-style" convenience wrappers #define CATCH_SCENARIO(...) \ INTERNAL_CATCH_TESTCASE_NO_REGISTRATION( \ INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____T_E_S_T____)) #define CATCH_SCENARIO_METHOD(className, ...) \ INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION( \ INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____T_E_S_T____), className) #define CATCH_GIVEN(desc) #define CATCH_AND_GIVEN(desc) #define CATCH_WHEN(desc) #define CATCH_AND_WHEN(desc) #define CATCH_THEN(desc) #define CATCH_AND_THEN(desc) #define CATCH_STATIC_REQUIRE(...) (void)(0) #define CATCH_STATIC_REQUIRE_FALSE(...) (void)(0) // If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not // required #else #define REQUIRE(...) (void)(0) #define REQUIRE_FALSE(...) (void)(0) #define REQUIRE_THROWS(...) (void)(0) #define REQUIRE_THROWS_AS(expr, exceptionType) (void)(0) #define REQUIRE_THROWS_WITH(expr, matcher) (void)(0) #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) #define REQUIRE_THROWS_MATCHES(expr, exceptionType, matcher) (void)(0) #endif // CATCH_CONFIG_DISABLE_MATCHERS #define REQUIRE_NOTHROW(...) (void)(0) #define CHECK(...) (void)(0) #define CHECK_FALSE(...) (void)(0) #define CHECKED_IF(...) if (__VA_ARGS__) #define CHECKED_ELSE(...) if (!(__VA_ARGS__)) #define CHECK_NOFAIL(...) (void)(0) #define CHECK_THROWS(...) (void)(0) #define CHECK_THROWS_AS(expr, exceptionType) (void)(0) #define CHECK_THROWS_WITH(expr, matcher) (void)(0) #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) #define CHECK_THROWS_MATCHES(expr, exceptionType, matcher) (void)(0) #endif // CATCH_CONFIG_DISABLE_MATCHERS #define CHECK_NOTHROW(...) (void)(0) #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) #define CHECK_THAT(arg, matcher) (void)(0) #define REQUIRE_THAT(arg, matcher) (void)(0) #endif // CATCH_CONFIG_DISABLE_MATCHERS #define INFO(msg) (void)(0) #define WARN(msg) (void)(0) #define CAPTURE(msg) (void)(0) #define TEST_CASE(...) \ INTERNAL_CATCH_TESTCASE_NO_REGISTRATION( \ INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____T_E_S_T____)) #define TEST_CASE_METHOD(className, ...) \ INTERNAL_CATCH_TESTCASE_NO_REGISTRATION( \ INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____T_E_S_T____)) #define METHOD_AS_TEST_CASE(method, ...) #define REGISTER_TEST_CASE(Function, ...) (void)(0) #define SECTION(...) #define DYNAMIC_SECTION(...) #define FAIL(...) (void)(0) #define FAIL_CHECK(...) (void)(0) #define SUCCEED(...) (void)(0) #define ANON_TEST_CASE() \ INTERNAL_CATCH_TESTCASE_NO_REGISTRATION( \ INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____T_E_S_T____)) #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define TEMPLATE_TEST_CASE(...) \ INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION( \ INTERNAL_CATCH_UNIQUE_NAME( \ ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____)) #define TEMPLATE_TEST_CASE_METHOD(className, ...) \ INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( \ INTERNAL_CATCH_UNIQUE_NAME( \ ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____), \ className) #else #define TEMPLATE_TEST_CASE(...) \ INTERNAL_CATCH_EXPAND_VARGS( \ INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION( \ INTERNAL_CATCH_UNIQUE_NAME( \ ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____))) #define TEMPLATE_TEST_CASE_METHOD(className, ...) \ INTERNAL_CATCH_EXPAND_VARGS( \ INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( \ INTERNAL_CATCH_UNIQUE_NAME( \ ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____), \ className)) #endif #define STATIC_REQUIRE(...) (void)(0) #define STATIC_REQUIRE_FALSE(...) (void)(0) #endif #define CATCH_TRANSLATE_EXCEPTION(signature) \ INTERNAL_CATCH_TRANSLATE_EXCEPTION_NO_REG( \ INTERNAL_CATCH_UNIQUE_NAME(catch_internal_ExceptionTranslator), \ signature) // "BDD-style" convenience wrappers #define SCENARIO(...) \ INTERNAL_CATCH_TESTCASE_NO_REGISTRATION( \ INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____T_E_S_T____)) #define SCENARIO_METHOD(className, ...) \ INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION( \ INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____T_E_S_T____), className) #define GIVEN(desc) #define AND_GIVEN(desc) #define WHEN(desc) #define AND_WHEN(desc) #define THEN(desc) #define AND_THEN(desc) using Catch::Detail::Approx; #endif #endif // ! CATCH_CONFIG_IMPL_ONLY // start catch_reenable_warnings.h #ifdef __clang__ #ifdef __ICC // icpc defines the __clang__ macro #pragma warning(pop) #else #pragma clang diagnostic pop #endif #elif defined __GNUC__ #pragma GCC diagnostic pop #endif // end catch_reenable_warnings.h // end catch.hpp #endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED conky-1.12.2/tests/dockerfiles/000077500000000000000000000000001404127277500163655ustar00rootroot00000000000000conky-1.12.2/tests/dockerfiles/Dockerfile.alpine-base000066400000000000000000000005261404127277500225410ustar00rootroot00000000000000FROM alpine:latest RUN apk add --no-cache \ binutils \ cmake \ curl-dev \ docbook2x \ gettext-tiny-dev \ git \ icu-dev \ imlib2-dev \ iw \ libmicrohttpd-dev \ libpulse \ libxdamage-dev \ libxext-dev \ libxft-dev \ libxinerama-dev \ linux-headers \ lua5.3-dev \ make \ musl-dev \ ncurses-dev \ patch conky-1.12.2/tests/dockerfiles/Dockerfile.alpine-clang000066400000000000000000000001751404127277500227130ustar00rootroot00000000000000ARG IMAGE=registry.gitlab.com/brndnmtthws-oss/conky FROM ${IMAGE}/builder/arch-base:latest RUN apk add --no-cache \ clang conky-1.12.2/tests/dockerfiles/Dockerfile.alpine-gcc000066400000000000000000000002051404127277500223550ustar00rootroot00000000000000ARG IMAGE=registry.gitlab.com/brndnmtthws-oss/conky FROM ${IMAGE}/builder/alpine-base:latest RUN apk add --no-cache \ g++ \ gcc conky-1.12.2/tests/dockerfiles/Dockerfile.archlinux-base000066400000000000000000000013771404127277500232730ustar00rootroot00000000000000FROM archlinux:base # Fix from https://www.reddit.com/r/archlinux/comments/lek2ba/arch_linux_on_docker_ci_could_not_find_or_read/ RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst && \ curl -LO "https://repo.archlinuxcn.org/x86_64/$patched_glibc" && \ bsdtar -C / -xvf "$patched_glibc" RUN pacman -Syu --noconfirm --needed \ cairo \ cmake \ docbook2x \ git \ glib2 \ imlib2 \ iw \ libical \ libircclient \ libmicrohttpd \ libpulse \ librsvg \ libxdamage \ libxext \ libxft \ libxinerama \ libxnvctrl \ lua \ make \ man-db \ mariadb-libs \ patch \ pkg-config \ wireless_tools \ && git clone https://github.com/linux-test-project/lcov.git \ && cd lcov \ && make install \ && cd .. \ && rm -rf lcov conky-1.12.2/tests/dockerfiles/Dockerfile.archlinux-clang000066400000000000000000000002331404127277500234330ustar00rootroot00000000000000ARG IMAGE=registry.gitlab.com/brndnmtthws-oss/conky FROM ${IMAGE}/builder/archlinux-base:latest RUN pacman -Syu --noconfirm --needed \ clang \ libc++ conky-1.12.2/tests/dockerfiles/Dockerfile.archlinux-gcc000066400000000000000000000002161404127277500231040ustar00rootroot00000000000000ARG IMAGE=registry.gitlab.com/brndnmtthws-oss/conky FROM ${IMAGE}/builder/archlinux-base:latest RUN pacman -Syu --noconfirm --needed \ gcc conky-1.12.2/tests/dockerfiles/Dockerfile.fedora-31-base000066400000000000000000000011341404127277500227460ustar00rootroot00000000000000FROM fedora:31 RUN dnf update -y -q \ && dnf -y -q install \ audacious-devel \ cairo-devel \ cmake \ dbus-glib-devel \ docbook2X \ freetype-devel \ git \ imlib2-devel \ lcov \ libcurl-devel \ libical-devel \ libircclient-devel \ libmicrohttpd-devel \ librsvg2-devel \ libX11-devel \ libXdamage-devel \ libXext-devel \ libXft-devel \ libXinerama-devel \ libxml2-devel \ libXNVCtrl-devel \ lua-devel \ make \ man \ mysql-devel \ ncurses-devel \ openssl-devel \ patch \ pulseaudio-libs-devel \ readline-devel \ systemd-devel \ xmms2-devel conky-1.12.2/tests/dockerfiles/Dockerfile.fedora-31-clang-8000066400000000000000000000003531404127277500232670ustar00rootroot00000000000000ARG IMAGE=registry.gitlab.com/brndnmtthws-oss/conky FROM ${IMAGE}/builder/fedora-31-base:latest RUN dnf -y -q install \ llvm \ clang \ libcxx-devel \ libcxxabi-devel \ npm \ && dnf clean all \ && npm cache clean --force conky-1.12.2/tests/dockerfiles/Dockerfile.fedora-32-base000066400000000000000000000011331404127277500227460ustar00rootroot00000000000000FROM fedora:32 RUN dnf update -y -q \ && dnf -y -q install \ audacious-devel \ cairo-devel \ cmake \ dbus-glib-devel \ docbook2X \ freetype-devel \ git \ imlib2-devel \ lcov \ libcurl-devel \ libical-devel \ libircclient-devel \ libmicrohttpd-devel \ librsvg2-devel \ libX11-devel \ libXdamage-devel \ libXext-devel \ libXft-devel \ libXinerama-devel \ libxml2-devel \ libXNVCtrl-devel \ lua-devel \ make \ man \ mysql-devel \ ncurses-devel \ openssl-devel \ patch \ pulseaudio-libs-devel \ readline-devel \ systemd-devel \ xmms2-devel conky-1.12.2/tests/dockerfiles/Dockerfile.fedora-32-clang-10000066400000000000000000000003531404127277500233410ustar00rootroot00000000000000ARG IMAGE=registry.gitlab.com/brndnmtthws-oss/conky FROM ${IMAGE}/builder/fedora-32-base:latest RUN dnf -y -q install \ llvm \ clang \ libcxx-devel \ libcxxabi-devel \ npm \ && dnf clean all \ && npm cache clean --force conky-1.12.2/tests/dockerfiles/Dockerfile.fedora-33-base000066400000000000000000000011331404127277500227470ustar00rootroot00000000000000FROM fedora:33 RUN dnf update -y -q \ && dnf -y -q install \ audacious-devel \ cairo-devel \ cmake \ dbus-glib-devel \ docbook2X \ freetype-devel \ git \ imlib2-devel \ lcov \ libcurl-devel \ libical-devel \ libircclient-devel \ libmicrohttpd-devel \ librsvg2-devel \ libX11-devel \ libXdamage-devel \ libXext-devel \ libXft-devel \ libXinerama-devel \ libxml2-devel \ libXNVCtrl-devel \ lua-devel \ make \ man \ mysql-devel \ ncurses-devel \ openssl-devel \ patch \ pulseaudio-libs-devel \ readline-devel \ systemd-devel \ xmms2-devel conky-1.12.2/tests/dockerfiles/Dockerfile.fedora-33-clang-11000066400000000000000000000004301404127277500233370ustar00rootroot00000000000000ARG IMAGE=registry.gitlab.com/brndnmtthws-oss/conky FROM ${IMAGE}/builder/fedora-33-base:latest RUN dnf -y -q install \ clang \ gcovr \ libcxx-devel \ libcxxabi-devel \ llvm \ npm \ && dnf clean all \ && npm install -g lcov-summary \ && npm cache clean --force conky-1.12.2/tests/dockerfiles/Dockerfile.ubuntu-base000066400000000000000000000012621404127277500226110ustar00rootroot00000000000000FROM ubuntu:focal RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive \ apt-get install -qy --no-install-recommends \ audacious-dev \ build-essential \ cmake \ docbook2x \ git \ gpg \ gpg-agent \ lcov \ less \ libaudclient-dev \ libcairo2-dev \ libcurl4-openssl-dev \ libical-dev \ libimlib2-dev \ libircclient-dev \ libiw-dev \ liblua5.3-dev \ libmicrohttpd-dev \ libmysqlclient-dev \ libpulse-dev \ librsvg2-dev \ libssl-dev \ libsystemd-dev \ libxdamage-dev \ libxext-dev \ libxft-dev \ libxinerama-dev \ libxml2-dev \ libxmmsclient-dev \ libxnvctrl-dev \ man \ ncurses-dev \ software-properties-common \ wget conky-1.12.2/tests/dockerfiles/Dockerfile.ubuntu-clang-10000066400000000000000000000010501404127277500231740ustar00rootroot00000000000000ARG IMAGE=registry.gitlab.com/brndnmtthws-oss/conky FROM ${IMAGE}/builder/ubuntu-base:latest RUN wget -q https://apt.llvm.org/llvm-snapshot.gpg.key \ && apt-key add llvm-snapshot.gpg.key \ && add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main' \ && DEBIAN_FRONTEND=noninteractive \ apt-get install -qy --no-install-recommends \ clang-10 \ lldb-10 \ lld-10 \ libc++-10-dev \ libc++abi-10-dev \ clang-tools-10 \ clang-format-10 \ clang-tidy-10 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* conky-1.12.2/tests/dockerfiles/Dockerfile.ubuntu-clang-11000066400000000000000000000012231404127277500231770ustar00rootroot00000000000000ARG IMAGE=registry.gitlab.com/brndnmtthws-oss/conky FROM ${IMAGE}/builder/ubuntu-base:latest RUN wget -q https://apt.llvm.org/llvm-snapshot.gpg.key \ && apt-key add llvm-snapshot.gpg.key \ && add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' \ && DEBIAN_FRONTEND=noninteractive \ apt-get install -qy --no-install-recommends \ clang-11 \ clang-format-11 \ clang-tidy-11 \ clang-tools-11 \ gcovr \ libc++-11-dev \ libc++abi-11-dev \ lld-11 \ lldb-11 \ llvm-11 \ nodejs \ npm \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ && npm install -g lcov-summary \ && npm cache clean --force conky-1.12.2/tests/dockerfiles/Dockerfile.ubuntu-clang-9000066400000000000000000000010371404127277500231310ustar00rootroot00000000000000ARG IMAGE=registry.gitlab.com/brndnmtthws-oss/conky FROM ${IMAGE}/builder/ubuntu-base:latest RUN wget -q https://apt.llvm.org/llvm-snapshot.gpg.key \ && apt-key add llvm-snapshot.gpg.key \ && add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-9 main' \ && DEBIAN_FRONTEND=noninteractive \ apt-get install -qy --no-install-recommends \ clang-9 \ lldb-9 \ lld-9 \ libc++-9-dev \ libc++abi-9-dev \ clang-tools-9 \ clang-format-9 \ clang-tidy-9 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* conky-1.12.2/tests/dockerfiles/Dockerfile.ubuntu-gcc-10000066400000000000000000000006151404127277500226520ustar00rootroot00000000000000ARG IMAGE=registry.gitlab.com/brndnmtthws-oss/conky FROM ${IMAGE}/builder/ubuntu-base:latest RUN wget -q https://apt.llvm.org/llvm-snapshot.gpg.key \ && apt-key add llvm-snapshot.gpg.key \ && add-apt-repository ppa:ubuntu-toolchain-r/test \ && DEBIAN_FRONTEND=noninteractive \ apt-get install -qy --no-install-recommends \ g++-10 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* conky-1.12.2/tests/dockerfiles/Dockerfile.ubuntu-gcc-7000066400000000000000000000006141404127277500225770ustar00rootroot00000000000000ARG IMAGE=registry.gitlab.com/brndnmtthws-oss/conky FROM ${IMAGE}/builder/ubuntu-base:latest RUN wget -q https://apt.llvm.org/llvm-snapshot.gpg.key \ && apt-key add llvm-snapshot.gpg.key \ && add-apt-repository ppa:ubuntu-toolchain-r/test \ && DEBIAN_FRONTEND=noninteractive \ apt-get install -qy --no-install-recommends \ g++-7 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* conky-1.12.2/tests/dockerfiles/Dockerfile.ubuntu-gcc-8000066400000000000000000000006141404127277500226000ustar00rootroot00000000000000ARG IMAGE=registry.gitlab.com/brndnmtthws-oss/conky FROM ${IMAGE}/builder/ubuntu-base:latest RUN wget -q https://apt.llvm.org/llvm-snapshot.gpg.key \ && apt-key add llvm-snapshot.gpg.key \ && add-apt-repository ppa:ubuntu-toolchain-r/test \ && DEBIAN_FRONTEND=noninteractive \ apt-get install -qy --no-install-recommends \ g++-8 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* conky-1.12.2/tests/dockerfiles/Dockerfile.ubuntu-gcc-9000066400000000000000000000006141404127277500226010ustar00rootroot00000000000000ARG IMAGE=registry.gitlab.com/brndnmtthws-oss/conky FROM ${IMAGE}/builder/ubuntu-base:latest RUN wget -q https://apt.llvm.org/llvm-snapshot.gpg.key \ && apt-key add llvm-snapshot.gpg.key \ && add-apt-repository ppa:ubuntu-toolchain-r/test \ && DEBIAN_FRONTEND=noninteractive \ apt-get install -qy --no-install-recommends \ g++-9 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* conky-1.12.2/tests/llvm-gcov.sh000077500000000000000000000013771404127277500163500ustar00rootroot00000000000000#!/usr/bin/env bash if hash llvm-cov-11 2>/dev/null; then llvm_cov="llvm-cov-11" elif hash llvm-cov110 2>/dev/null; then llvm_cov="llvm-cov110" elif hash llvm-cov100 2>/dev/null; then llvm_cov="llvm-cov100" elif hash llvm-cov-10 2>/dev/null; then llvm_cov="llvm-cov-10" elif hash llvm-cov90 2>/dev/null; then llvm_cov="llvm-cov90" elif hash llvm-cov-9 2>/dev/null; then llvm_cov="llvm-cov-9" elif hash llvm-cov80 2>/dev/null; then llvm_cov="llvm-cov80" elif hash llvm-cov-8 2>/dev/null; then llvm_cov="llvm-cov-8" elif hash llvm-cov70 2>/dev/null; then llvm_cov="llvm-cov70" elif hash llvm-cov-7 2>/dev/null; then llvm_cov="llvm-cov-7" elif hash llvm-cov 2>/dev/null; then llvm_cov="llvm-cov" fi exec $llvm_cov gcov "$@" conky-1.12.2/tests/test-common.cc000066400000000000000000000171361404127277500166570ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do // this in one cpp file #include "catch2/catch.hpp" #include #include extern char **environ; std::string get_valid_environment_variable_name() { if (getenv("HOME") != nullptr) { return "HOME"; } // If HOME is not a valid environment variable name, try to get a valid one. char *env_var = *environ; for (int i = 1; env_var; i++) { std::string variable_name(env_var); int variable_name_length = variable_name.find('='); variable_name = variable_name.substr(0, variable_name_length); if (getenv(variable_name.c_str()) != nullptr) { return variable_name; } env_var = *(environ + i); } return ""; } std::string get_invalid_environment_variable_name() { std::string variable_name = "INVALIDVARIABLENAME"; while (getenv(variable_name.c_str()) != nullptr) { variable_name += std::to_string(variable_name.length()); } return variable_name; } TEST_CASE("to_real_path becomes homedir", "[to_real_path]") { REQUIRE(to_real_path("~/test") == std::string(getenv("HOME")) + "/test"); } TEST_CASE("environment variables are substituted correctly", "[variable_substitute]") { std::string valid_name = get_valid_environment_variable_name(); std::string valid_value = getenv(valid_name.c_str()); std::string invalid_name = get_invalid_environment_variable_name(); SECTION("an empty string input returns an empty string") { REQUIRE(variable_substitute("") == ""); } SECTION("string in with no $ returns same string") { std::string string_alpha = "abcdefghijklmnopqrstuvwxyz"; std::string string_numbers = "1234567890"; std::string string_special = "`~!@#$%^&*()-=_+[]{}\\|;:'\",<.>/?"; std::string string_valid_name = valid_name; REQUIRE(variable_substitute(string_alpha) == string_alpha); REQUIRE(variable_substitute(string_numbers) == string_numbers); REQUIRE(variable_substitute(string_special) == string_special); REQUIRE(variable_substitute(string_valid_name) == string_valid_name); } SECTION("invalid variables are removed from return string") { std::string string_in_1 = "a$" + invalid_name + " z"; std::string string_in_2 = "a${" + invalid_name + "} z"; std::string string_in_3 = "a${" + invalid_name + " " + valid_name + "} z"; std::string string_in_4 = "a${ " + valid_name + "} z"; std::string string_in_5 = "a${" + valid_name + " } z"; std::string string_in_6 = "a$" + valid_name + "z z"; std::string string_in_7 = "a$" + invalid_name + "# z"; REQUIRE(variable_substitute(string_in_1) == "a z"); REQUIRE(variable_substitute(string_in_2) == "a z"); REQUIRE(variable_substitute(string_in_3) == "a z"); REQUIRE(variable_substitute(string_in_4) == "a z"); REQUIRE(variable_substitute(string_in_5) == "a z"); REQUIRE(variable_substitute(string_in_6) == "a z"); REQUIRE(variable_substitute(string_in_7) == "a# z"); } SECTION("valid variable gets replaced in the return string") { std::string string_in_1 = "a$" + valid_name + " z"; std::string string_in_2 = "a${" + valid_name + "} z"; std::string string_in_3 = "a$" + valid_name + "# z"; std::string string_var_replaced_1 = "a" + valid_value + " z"; std::string string_var_replaced_2 = "a" + valid_value + " z"; std::string string_var_replaced_3 = "a" + valid_value + "# z"; REQUIRE(variable_substitute(string_in_1) == string_var_replaced_1); REQUIRE(variable_substitute(string_in_2) == string_var_replaced_2); REQUIRE(variable_substitute(string_in_3) == string_var_replaced_3); } SECTION("$ without variable is ignored") { std::string string_in_1 = "a$#z"; std::string string_in_2 = "a$2z"; REQUIRE(variable_substitute(string_in_1) == string_in_1); REQUIRE(variable_substitute(string_in_2) == string_in_2); } SECTION("double $ gets converted to single $ and is passed over") { std::string string_in_1 = "a$$sz"; std::string string_in_2 = "a$$" + valid_name + "z"; std::string string_out_1 = "a$sz"; std::string string_out_2 = "a$" + valid_name + "z"; REQUIRE(variable_substitute(string_in_1) == string_out_1); REQUIRE(variable_substitute(string_in_2) == string_out_2); } SECTION("incomplete variable does not get replaced in return string") { std::string string_in = "a${" + valid_name + " z"; REQUIRE(variable_substitute(string_in) == string_in); } } TEST_CASE("cpu_percentage and cpu_barval return correct values") { struct text_object obj0; obj0.data.i = 0; struct text_object obj1; obj1.data.i = 1; // struct text_object obj2; // obj2.data.i = 2; info.cpu_count = 1; // SECTION("for non-existent cpu") { // info.cpu_usage = new float[2]; // info.cpu_usage[0] = 0.253; // info.cpu_usage[1] = 0.507; // This does not exist in Catch2, but would be nice to have since that's // what happens in this case. // REQUIRE_EXIT(cpu_percentage(&obj2)); // REQUIRE_EXIT(cpu_barval(&obj2)); // delete[] info.cpu_usage; // } SECTION("for cpu_usage == nullptr") { info.cpu_usage = nullptr; REQUIRE(cpu_percentage(&obj0) == 0); REQUIRE(cpu_barval(&obj0) == 0); REQUIRE(cpu_percentage(&obj1) == 0); REQUIRE(cpu_barval(&obj1) == 0); } SECTION("for cpu_usage has data") { info.cpu_usage = new float[2]; info.cpu_usage[0] = 0.253; info.cpu_usage[1] = 0.507; REQUIRE(cpu_percentage(&obj0) == 25); REQUIRE(cpu_barval(&obj0) == Approx(0.253)); REQUIRE(cpu_percentage(&obj1) == 51); REQUIRE(cpu_barval(&obj1) == Approx(0.507)); delete[] info.cpu_usage; } } TEST_CASE("mem_percentage and mem_barval return correct values") { info.mem = 6; SECTION("for memmax == 0") { info.memmax = 0; REQUIRE(mem_percentage(nullptr) == 0); REQUIRE(mem_barval(nullptr) == 0); } SECTION("for memmax > 0") { info.memmax = 24; REQUIRE(mem_percentage(nullptr) == 25); REQUIRE(mem_barval(nullptr) == Approx(0.25)); } } TEST_CASE("mem_with_buffers_barval returns correct value") { info.memwithbuffers = 6; SECTION("for memmax == 0") { info.memmax = 0; REQUIRE(mem_with_buffers_barval(nullptr) == 0); } SECTION("for memmax > 0") { info.memmax = 24; REQUIRE(mem_with_buffers_barval(nullptr) == Approx(0.25)); } } TEST_CASE("swap_percentage and swap_barval return correct values") { info.swap = 6; SECTION("for swapmax == 0") { info.swapmax = 0; REQUIRE(swap_percentage(nullptr) == 0); REQUIRE(swap_barval(nullptr) == 0); } SECTION("for swapmax > 0") { info.swapmax = 24; REQUIRE(swap_percentage(nullptr) == 25); REQUIRE(swap_barval(nullptr) == Approx(0.25)); } } conky-1.12.2/tests/test-conky.cc000066400000000000000000000027051404127277500165060ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "catch2/catch.hpp" #include "conky.h" #include "lua-config.hh" TEST_CASE("Expressions can be evaluated", "[evaluate]") { state = std::make_unique(); conky::export_symbols(*state); SECTION("Simple expressions without substitutions can be evaluated") { constexpr int kMaxSize = 10; const char input[kMaxSize] = "text"; char result[kMaxSize]{'\0'}; evaluate(input, result, kMaxSize); REQUIRE(strncmp(input, result, kMaxSize) == 0); } } conky-1.12.2/tests/test-core.cc000066400000000000000000000037001404127277500163070ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "catch2/catch.hpp" #include TEST_CASE("remove_comments returns correct value") { SECTION("for no comments") { char text[] = "test text\n"; size_t removed_chars = remove_comments(text); REQUIRE(removed_chars == 0); } SECTION("for no comments but with backslashes") { char text[] = "te\\st t\\ext\n"; size_t removed_chars = remove_comments(text); REQUIRE(removed_chars == 0); } SECTION("for single line of comment") { char text_with_newline[] = "#test text\n"; char text_no_newline[] = "#test text"; size_t removed_chars_with_newline = remove_comments(text_with_newline); size_t removed_chars_no_newline = remove_comments(text_no_newline); REQUIRE(removed_chars_with_newline == 11); REQUIRE(removed_chars_no_newline == 10); } SECTION("for comment starting in middle of line") { char text[] = "test #text\n"; size_t removed_chars = remove_comments(text); REQUIRE(removed_chars == 6); } } conky-1.12.2/tests/test-darwin.cc000066400000000000000000000022351404127277500166450ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "catch2/catch.hpp" #include TEST_CASE("get_entropy_avail returns 1", "[get_entropy_avail]") { unsigned int unused = 0; REQUIRE(get_entropy_avail(&unused) == 1); } conky-1.12.2/tests/test-diskio.cc000066400000000000000000000025551404127277500166500ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "catch2/catch.hpp" #include #include #include #if BUILD_X11 TEST_CASE("diskiographval returns correct value") { struct text_object obj; SECTION("for valid data") { diskio_stat *diskio = new diskio_stat; diskio->current = 2.5; obj.data.opaque = diskio; REQUIRE(diskiographval(&obj) == Approx(2.5)); delete diskio; } } #endif conky-1.12.2/tests/test-fs.cc000066400000000000000000000030141404127277500157650ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "catch2/catch.hpp" #include TEST_CASE("fs_free_percentage returns correct value") { struct text_object obj; SECTION("for fs size == 0") { fs_stat *fs = new fs_stat; fs->size = 0; fs->avail = 17; fs->free = 97; obj.data.opaque = fs; REQUIRE(fs_free_percentage(&obj) == 0); delete fs; } SECTION("for valid data") { fs_stat *fs = new fs_stat; fs->size = 68; fs->avail = 17; fs->free = 97; obj.data.opaque = fs; REQUIRE(fs_free_percentage(&obj) == 25); delete fs; } } conky-1.12.2/tests/test-hsv.cc000066400000000000000000000041111404127277500161540ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "catch2/catch.hpp" #include #include #include int testColor(long *rgb, int scale) { long hsv[3]; long rgb1[3]; long rgb2[3]; long rgb3[3]; rgb1[0] = to_decimal_scale(rgb[0], scale); rgb1[1] = to_decimal_scale(rgb[1], scale); rgb1[2] = to_decimal_scale(rgb[2], scale); scaled_rgb_to_scaled_hsv(rgb1, hsv); scaled_hsv_to_scaled_rgb(hsv, rgb2); rgb3[0] = from_decimal_scale(rgb2[0], scale); rgb3[1] = from_decimal_scale(rgb2[1], scale); rgb3[2] = from_decimal_scale(rgb2[2], scale); return (rgb[0] != rgb3[0] || rgb[1] != rgb3[1] || rgb[2] != rgb3[2]); } TEST_CASE("hsv gradient tests") { SECTION("rgb -> hsv -> rgb should returns original value") { int failedCount = 0; long rgb1[3]; for (int i = 0; i < 256 && failedCount < 10; i++) { for (int j = 0; j < 256 && failedCount < 10; j++) { for (int k = 0; k < 256 && failedCount < 10; k++) { rgb1[0] = i; rgb1[1] = j; rgb1[2] = k; failedCount += testColor(rgb1, 255); } } } REQUIRE(failedCount == 0); } } conky-1.12.2/tests/test-linux.cc000066400000000000000000000022341404127277500165170ustar00rootroot00000000000000/* * * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * * All code written since the fork of torsmo is licensed under the GPL * * Please see COPYING for details * * Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * * 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 3 of the License, or * (at your option) any later version. * * 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. * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "catch2/catch.hpp" #include TEST_CASE("get_entropy_avail returns 0", "[get_entropy_avail]") { unsigned int unused = 0; REQUIRE(get_entropy_avail(&unused) == 0); }