├── .editorconfig ├── .env ├── .gitattributes ├── .github └── workflows │ ├── main.yml │ └── pack.yml ├── .gitignore ├── .gitmodules ├── .vscode ├── launch.json ├── settings.json └── tasks.json ├── CMakeLists.txt ├── Dockerfile ├── LICENCE ├── README.md ├── bin └── config.json ├── dependencies ├── MySQL │ ├── CREDITS │ ├── LICENSE │ ├── dll │ │ ├── 32bit │ │ │ └── libmariadb.dll │ │ └── 64bit │ │ │ └── libmariadb.dll │ ├── include │ │ ├── config-win.h │ │ ├── dbug.h │ │ ├── errmsg.h │ │ ├── getopt.h │ │ ├── hash.h │ │ ├── m_ctype.h │ │ ├── m_string.h │ │ ├── ma_common.h │ │ ├── ma_dyncol.h │ │ ├── ma_secure.h │ │ ├── my_alarm.h │ │ ├── my_base.h │ │ ├── my_config.h.in │ │ ├── my_dir.h │ │ ├── my_global.h │ │ ├── my_list.h │ │ ├── my_net.h │ │ ├── my_no_pthread.h │ │ ├── my_pthread.h │ │ ├── my_stmt.h │ │ ├── my_sys.h │ │ ├── mysql.h │ │ ├── mysql │ │ │ ├── client_plugin.h │ │ │ ├── plugin_auth.h │ │ │ └── plugin_auth_common.h │ │ ├── mysql_com.h │ │ ├── mysql_io.h │ │ ├── mysql_mm.h │ │ ├── mysql_priv.h │ │ ├── mysql_version.h │ │ ├── mysql_wireprotocol.h │ │ ├── mysqld_error.h │ │ ├── mysys_err.h │ │ ├── sha1.h │ │ ├── thr_alarm.h │ │ └── violite.h │ └── lib │ │ ├── libmariadb.lib │ │ └── libmariadb32.lib ├── OpenSSL │ └── LICENSE.txt ├── StrFormat │ ├── BasicAdaptor.h │ ├── CharBuffer.h │ ├── ExtendedFormat.h │ ├── FloatRenderer.h │ ├── FormatDesc.h │ ├── IntegerRenderer.h │ ├── IntegerRendererHelpers.h │ ├── LICENSE.htm │ ├── MODIFICATION │ ├── StrFormat.h │ ├── StringRenderer.h │ ├── TimedateRenderer.h │ ├── generic_exception.h │ └── printf.h └── curl │ ├── LICENSE │ ├── dll │ ├── 32bit │ │ └── libcurl.dll │ └── 64bit │ │ └── libcurl.dll │ ├── include │ ├── Makefile.am │ ├── Makefile.in │ ├── README │ └── curl │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── curl.h │ │ ├── curlbuild.h │ │ ├── curlbuild.h.cmake │ │ ├── curlbuild.h.in │ │ ├── curlrules.h │ │ ├── curlver.h │ │ ├── easy.h │ │ ├── mprintf.h │ │ ├── multi.h │ │ ├── stdcheaders.h │ │ └── typecheck-gcc.h │ └── lib │ ├── CMakeLists.txt │ ├── Makefile.Watcom │ ├── Makefile.am │ ├── Makefile.b32 │ ├── Makefile.in │ ├── Makefile.inc │ ├── Makefile.m32 │ ├── Makefile.netware │ ├── Makefile.vc10 │ ├── Makefile.vc6 │ ├── Makefile.vc8 │ ├── Makefile.vc9 │ ├── Makefile.vxworks │ ├── README.ares │ ├── README.curl_off_t │ ├── README.curlx │ ├── README.encoding │ ├── README.hostip │ ├── README.httpauth │ ├── README.memoryleak │ ├── README.multi_socket │ ├── README.pingpong │ ├── README.pipelining │ ├── amigaos.c │ ├── amigaos.h │ ├── arpa_telnet.h │ ├── asyn-ares.c │ ├── asyn-thread.c │ ├── asyn.h │ ├── axtls.c │ ├── axtls.h │ ├── base64.c │ ├── bundles.c │ ├── bundles.h │ ├── checksrc.pl │ ├── config-amigaos.h │ ├── config-dos.h │ ├── config-mac.h │ ├── config-os400.h │ ├── config-riscos.h │ ├── config-symbian.h │ ├── config-tpf.h │ ├── config-vxworks.h │ ├── config-win32.h │ ├── config-win32ce.h │ ├── conncache.c │ ├── conncache.h │ ├── connect.c │ ├── connect.h │ ├── content_encoding.c │ ├── content_encoding.h │ ├── cookie.c │ ├── cookie.h │ ├── curl_addrinfo.c │ ├── curl_addrinfo.h │ ├── curl_base64.h │ ├── curl_config.h.cmake │ ├── curl_config.h.in │ ├── curl_darwinssl.c │ ├── curl_darwinssl.h │ ├── curl_fnmatch.c │ ├── curl_fnmatch.h │ ├── curl_gethostname.c │ ├── curl_gethostname.h │ ├── curl_gssapi.c │ ├── curl_gssapi.h │ ├── curl_hmac.h │ ├── curl_ldap.h │ ├── curl_md4.h │ ├── curl_md5.h │ ├── curl_memory.h │ ├── curl_memrchr.c │ ├── curl_memrchr.h │ ├── curl_multibyte.c │ ├── curl_multibyte.h │ ├── curl_ntlm.c │ ├── curl_ntlm.h │ ├── curl_ntlm_core.c │ ├── curl_ntlm_core.h │ ├── curl_ntlm_msgs.c │ ├── curl_ntlm_msgs.h │ ├── curl_ntlm_wb.c │ ├── curl_ntlm_wb.h │ ├── curl_rand.c │ ├── curl_rand.h │ ├── curl_rtmp.c │ ├── curl_rtmp.h │ ├── curl_sasl.c │ ├── curl_sasl.h │ ├── curl_schannel.c │ ├── curl_schannel.h │ ├── curl_setup.h │ ├── curl_setup_once.h │ ├── curl_sspi.c │ ├── curl_sspi.h │ ├── curl_threads.c │ ├── curl_threads.h │ ├── curlx.h │ ├── cyassl.c │ ├── cyassl.h │ ├── dict.c │ ├── dict.h │ ├── easy.c │ ├── easyif.h │ ├── escape.c │ ├── escape.h │ ├── file.c │ ├── file.h │ ├── fileinfo.c │ ├── fileinfo.h │ ├── firefox-db2pem.sh │ ├── formdata.c │ ├── formdata.h │ ├── ftp.c │ ├── ftp.h │ ├── ftplistparser.c │ ├── ftplistparser.h │ ├── getenv.c │ ├── getinfo.c │ ├── getinfo.h │ ├── gopher.c │ ├── gopher.h │ ├── gtls.c │ ├── gtls.h │ ├── hash.c │ ├── hash.h │ ├── hmac.c │ ├── hostasyn.c │ ├── hostcheck.c │ ├── hostcheck.h │ ├── hostip.c │ ├── hostip.h │ ├── hostip4.c │ ├── hostip6.c │ ├── hostsyn.c │ ├── http.c │ ├── http.h │ ├── http_chunks.c │ ├── http_chunks.h │ ├── http_digest.c │ ├── http_digest.h │ ├── http_negotiate.c │ ├── http_negotiate.h │ ├── http_negotiate_sspi.c │ ├── http_proxy.c │ ├── http_proxy.h │ ├── idn_win32.c │ ├── if2ip.c │ ├── if2ip.h │ ├── imap.c │ ├── imap.h │ ├── inet_ntop.c │ ├── inet_ntop.h │ ├── inet_pton.c │ ├── inet_pton.h │ ├── krb4.c │ ├── krb4.h │ ├── krb5.c │ ├── ldap.c │ ├── libcurl.lib │ ├── libcurl.plist │ ├── libcurl.rc │ ├── libcurl.vers.in │ ├── libcurl32.lib │ ├── llist.c │ ├── llist.h │ ├── makefile.amiga │ ├── makefile.dj │ ├── md4.c │ ├── md5.c │ ├── memdebug.c │ ├── memdebug.h │ ├── mk-ca-bundle.pl │ ├── mk-ca-bundle.vbs │ ├── mprintf.c │ ├── multi.c │ ├── multihandle.h │ ├── multiif.h │ ├── netrc.c │ ├── netrc.h │ ├── non-ascii.c │ ├── non-ascii.h │ ├── nonblock.c │ ├── nonblock.h │ ├── nss.c │ ├── nssg.h │ ├── nwlib.c │ ├── nwos.c │ ├── objnames-test08.sh │ ├── objnames-test10.sh │ ├── objnames.inc │ ├── openldap.c │ ├── parsedate.c │ ├── parsedate.h │ ├── pingpong.c │ ├── pingpong.h │ ├── pipeline.c │ ├── pipeline.h │ ├── polarssl.c │ ├── polarssl.h │ ├── polarssl_threadlock.c │ ├── polarssl_threadlock.h │ ├── pop3.c │ ├── pop3.h │ ├── progress.c │ ├── progress.h │ ├── qssl.c │ ├── qssl.h │ ├── rawstr.c │ ├── rawstr.h │ ├── rtsp.c │ ├── rtsp.h │ ├── security.c │ ├── select.c │ ├── select.h │ ├── sendf.c │ ├── sendf.h │ ├── setup-os400.h │ ├── setup-vms.h │ ├── share.c │ ├── share.h │ ├── slist.c │ ├── slist.h │ ├── smtp.c │ ├── smtp.h │ ├── sockaddr.h │ ├── socks.c │ ├── socks.h │ ├── socks_gssapi.c │ ├── socks_sspi.c │ ├── speedcheck.c │ ├── speedcheck.h │ ├── splay.c │ ├── splay.h │ ├── ssh.c │ ├── ssh.h │ ├── sslgen.c │ ├── sslgen.h │ ├── ssluse.c │ ├── ssluse.h │ ├── strdup.c │ ├── strdup.h │ ├── strequal.c │ ├── strequal.h │ ├── strerror.c │ ├── strerror.h │ ├── strtok.c │ ├── strtok.h │ ├── strtoofft.c │ ├── strtoofft.h │ ├── telnet.c │ ├── telnet.h │ ├── tftp.c │ ├── tftp.h │ ├── timeval.c │ ├── timeval.h │ ├── transfer.c │ ├── transfer.h │ ├── url.c │ ├── url.h │ ├── urldata.h │ ├── version.c │ ├── warnless.c │ ├── warnless.h │ ├── wildcard.c │ └── wildcard.h ├── docker-compose.yml ├── include └── pp │ ├── Common.h │ ├── performance │ ├── Beatmap.h │ ├── CURL.h │ ├── DDog.h │ ├── Processor.h │ ├── Score.h │ ├── UUID.h │ ├── User.h │ ├── catch │ │ └── CatchScore.h │ ├── mania │ │ └── ManiaScore.h │ ├── osu │ │ └── OsuScore.h │ └── taiko │ │ └── TaikoScore.h │ └── shared │ ├── Active.h │ ├── DatabaseConnection.h │ ├── QueryResult.h │ ├── SharedQueue.h │ ├── Threading.h │ ├── Types.h │ └── UpdateBatch.h ├── scripts ├── docker-entrypoint.sh ├── dump_sample_tables.sh ├── wrapper_all.sh └── wrapper_new.sh └── src ├── CMakeLists.txt ├── Common.cpp ├── performance ├── Beatmap.cpp ├── CURL.cpp ├── DDog.cpp ├── Processor.cpp ├── Score.cpp ├── UUID.cpp ├── User.cpp ├── catch │ └── CatchScore.cpp ├── main.cpp ├── mania │ └── ManiaScore.cpp ├── osu │ └── OsuScore.cpp └── taiko │ └── TaikoScore.cpp └── shared ├── Active.cpp ├── DatabaseConnection.cpp ├── QueryResult.cpp ├── Threading.cpp └── UpdateBatch.cpp /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | indent_style = tab 7 | trim_trailing_whitespace = true 8 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | MYSQL_RANDOM_ROOT_PASSWORD=yes 2 | MYSQL_DATABASE=osu 3 | MYSQL_USER=osu 4 | MYSQL_PASSWORD=osu 5 | MYSQL_HOST=db 6 | MYSQL_PORT=3306 7 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Autodetect text files and ensure that we normalise their 2 | # line endings to lf internally. When checked out they may 3 | # use different line endings. 4 | * text=auto 5 | 6 | # Check out with lf (UNIX) line endings 7 | *.c text diff=cpp eol=lf 8 | *.cpp text diff=cpp eol=lf 9 | *.h text diff=cpp eol=lf 10 | *.hpp text diff=cpp eol=lf 11 | *.cmake text eol=lf 12 | *.cfg text eol=lf 13 | *.txt text eol=lf 14 | *.sh text eol=lf 15 | *.md text eol=lf 16 | .gitignore text eol=lf 17 | .gitattributes text eol=lf 18 | .travis.yml text eol=lf 19 | .appveyor.yml text eol=lf 20 | .editorconfig text eol=lf 21 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | build_linux: 13 | name: Build on linux systems 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v1 18 | with: 19 | submodules: recursive 20 | - name: Install dependencies 21 | run: sudo apt-get update && sudo apt-get install libmysqlclient-dev libcurl4-openssl-dev 22 | - name: CMake 23 | run: cmake . 24 | - name: Build 25 | run: make -j 26 | 27 | build_macos: 28 | name: Build on macOS 29 | runs-on: macos-latest 30 | 31 | steps: 32 | - uses: actions/checkout@v1 33 | with: 34 | submodules: recursive 35 | - name: Install dependencies 36 | run: brew install mysql-connector-c 37 | - name: CMake 38 | run: cmake . 39 | - name: Build 40 | run: make -j 41 | 42 | build_windows: 43 | name: Build on Windows 44 | runs-on: windows-latest 45 | 46 | steps: 47 | - uses: actions/checkout@v1 48 | with: 49 | submodules: recursive 50 | 51 | - name: Setup MSBuild.exe 52 | uses: microsoft/setup-msbuild@v1.0.2 53 | 54 | - name: CMake 55 | run: cmake . 56 | - name: Build 57 | run: msbuild /v:m /p:Configuration=Release osu-performance.sln 58 | -------------------------------------------------------------------------------- /.github/workflows/pack.yml: -------------------------------------------------------------------------------- 1 | name: Build and publish 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | - release 8 | tags: 9 | - '*' 10 | 11 | jobs: 12 | push_to_registry: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - 16 | name: Checkout 17 | uses: actions/checkout@v2 18 | with: 19 | submodules: recursive 20 | - 21 | name: Docker meta 22 | id: meta 23 | uses: docker/metadata-action@v3 24 | with: 25 | # list of Docker images to use as base name for tags 26 | images: | 27 | pppy/osu-performance 28 | # generate Docker tags based on the following events/attributes 29 | # on tag event: tag using git tag, and as latest if the tag doesn't contain hyphens (pre-releases) 30 | # on push event: tag using git sha, branch name and as latest-dev 31 | tags: | 32 | type=raw,value=latest,enable=${{ github.ref_type == 'tag' && !contains(github.ref_name, '-') }} 33 | type=raw,value=latest-dev,enable=${{ github.ref_type == 'branch' && github.ref_name == 'master' }} 34 | type=raw,value=${{ github.ref_name }} 35 | type=raw,value=${{ github.sha }},enable=${{ github.ref_type == 'branch' }} 36 | flavor: | 37 | latest=false 38 | - 39 | name: Set up Docker Buildx 40 | uses: docker/setup-buildx-action@v1 41 | - 42 | name: Login to DockerHub 43 | uses: docker/login-action@v1 44 | with: 45 | username: ${{ secrets.DOCKER_USERNAME }} 46 | password: ${{ secrets.DOCKER_PASSWORD }} 47 | - 48 | name: Build and push 49 | uses: docker/build-push-action@v2 50 | with: 51 | context: . 52 | file: ./Dockerfile 53 | platforms: linux/amd64 54 | push: true 55 | tags: ${{ steps.meta.outputs.tags }} 56 | labels: ${{ steps.meta.outputs.labels }} 57 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | osu!.tmproj 2 | *.pfx 3 | *.user 4 | *DS_Store* 5 | */obj/ 6 | */Build/ 7 | *ReSharper* 8 | *resharper* 9 | *.suo 10 | *.tmproj 11 | *.idea 12 | *.dmg 13 | osu!installer/output/ 14 | osu!-iPhone/Osu.xcodeproj/ 15 | osu!-iPhone/build/ 16 | osu!-iPhone/skins/ 17 | osu!common/Properties/Strings.*.txt 18 | osu!/Properties/Strings.*.txt 19 | osu!/Constants/General_Version.cs 20 | 21 | # Build artifacts 22 | /build 23 | /bin/osu-performance* 24 | /bin/*.dll 25 | 26 | # MSVC auxiliary build files 27 | /Win32 28 | /x64 29 | 30 | *.docstates 31 | 32 | Staging/ 33 | *.sublime-project 34 | *.sublime-workspace 35 | 36 | Tools/CheatSignatureCreator/bin 37 | Tools/CheatSignatureCreator/obj 38 | Tools/IRCLoadTester/bin 39 | Tools/PacketAnalyser/obj 40 | Tools/IRCLoadTester/obj 41 | Tools/OsuXnbCreator/obj 42 | 43 | Tools/OsuXnbCreator/bin/ 44 | Tools/PacketAnalyser/bin/ 45 | osu!.userprefs 46 | .dropbox 47 | *desktop.ini 48 | *Icon 49 | 50 | *.dpkg-dist 51 | *.ucf-dist 52 | 53 | .SyncID 54 | .SyncIgnore 55 | .SyncArchive/ 56 | 57 | .dropbox.attr 58 | packages/* 59 | !packages/repositories.config 60 | .vs/* 61 | 62 | # Database dump (for use with Docker Compose) 63 | dump/ 64 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "dependencies/args"] 2 | path = dependencies/args 3 | url = https://github.com/Taywee/args 4 | [submodule "dependencies/tinylogger"] 5 | path = dependencies/tinylogger 6 | url = https://github.com/Tom94/tinylogger 7 | [submodule "dependencies/json"] 8 | path = dependencies/json 9 | url = https://github.com/nlohmann/json 10 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [{ 7 | "name": "Debug", 8 | "type": "cppdbg", 9 | "request": "launch", 10 | "preLaunchTask": "Build", 11 | "program": "${workspaceFolder}/bin/osu-performance", 12 | "args": [ 13 | "${input:pickCommand}", 14 | "-m", 15 | "${input:pickMode}" 16 | ], 17 | "stopAtEntry": false, 18 | "cwd": "${workspaceFolder}/bin", 19 | "environment": [], 20 | "externalConsole": false, 21 | "MIMode": "lldb" 22 | }], 23 | "inputs": [{ 24 | "id": "pickCommand", 25 | "description": "Enter the command (all, new, scores, users)", 26 | "default": "all", 27 | "type": "promptString" 28 | }, 29 | { 30 | "id": "pickMode", 31 | "description": "Enter the ruleset (osu, taiko, catch, mania)", 32 | "default": "osu", 33 | "type": "promptString" 34 | } 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "__config": "cpp", 4 | "__nullptr": "cpp", 5 | "cstddef": "cpp", 6 | "exception": "cpp", 7 | "initializer_list": "cpp", 8 | "new": "cpp", 9 | "stdexcept": "cpp", 10 | "type_traits": "cpp", 11 | "typeinfo": "cpp", 12 | "algorithm": "cpp", 13 | "chrono": "cpp", 14 | "__locale": "cpp", 15 | "iosfwd": "cpp", 16 | "__bit_reference": "cpp", 17 | "bitset": "cpp", 18 | "map": "cpp", 19 | "set": "cpp", 20 | "unordered_map": "cpp", 21 | "unordered_set": "cpp", 22 | "iterator": "cpp", 23 | "__hash_table": "cpp", 24 | "__split_buffer": "cpp", 25 | "__tree": "cpp", 26 | "array": "cpp", 27 | "deque": "cpp", 28 | "list": "cpp", 29 | "queue": "cpp", 30 | "random": "cpp", 31 | "regex": "cpp", 32 | "string": "cpp", 33 | "string_view": "cpp", 34 | "utility": "cpp", 35 | "valarray": "cpp", 36 | "vector": "cpp", 37 | "system_error": "cpp", 38 | "__functional_base": "cpp", 39 | "atomic": "cpp", 40 | "functional": "cpp", 41 | "limits": "cpp", 42 | "locale": "cpp", 43 | "memory": "cpp", 44 | "ratio": "cpp", 45 | "tuple": "cpp", 46 | "sstream": "cpp", 47 | "__string": "cpp", 48 | "forward_list": "cpp" 49 | } 50 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [{ 6 | "label": "cmake", 7 | "type": "shell", 8 | "options": { 9 | "cwd": "${workspaceFolder}/Build" 10 | }, 11 | "command": "cmake", 12 | "args": [ 13 | "${workspaceFolder}" 14 | ], 15 | }, 16 | { 17 | "label": "Build", 18 | "type": "shell", 19 | "dependsOn": "cmake", 20 | "options": { 21 | "cwd": "${workspaceFolder}/Build" 22 | }, 23 | "command": "make", 24 | "args": [ 25 | "-j" 26 | ] 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | project(osu-performance) 4 | 5 | set(BIN ${CMAKE_CURRENT_SOURCE_DIR}/bin) 6 | set(EXTERNAL ${CMAKE_CURRENT_SOURCE_DIR}/dependencies) 7 | 8 | if (MSVC) 9 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_WARNINGS") 10 | elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") 11 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") 12 | endif() 13 | 14 | # Tells the compilers to put the binaries in the BIN folder 15 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BIN}) 16 | 17 | # Set a default configuration if none was specified 18 | if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 19 | message(STATUS "No release type specified. Setting to 'Release'.") 20 | set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) 21 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo") 22 | endif() 23 | 24 | message(STATUS "Build configuration: ${CMAKE_BUILD_TYPE}") 25 | 26 | # Necessary so all shared source files can have the unified #include statement. 27 | # MSVC would complain if some use "../Shared" and some "Shared" without having those exact names specified 28 | # per .cpp file. 29 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) 30 | 31 | # External include directories 32 | include_directories(${EXTERNAL}/args) 33 | include_directories(${EXTERNAL}/curl/include) 34 | include_directories(${EXTERNAL}/json/include) 35 | include_directories(${EXTERNAL}/MySQL/include) 36 | include_directories(${EXTERNAL}/StrFormat) 37 | include_directories(${EXTERNAL}/tinylogger) 38 | 39 | # External library directories 40 | if (WIN32) 41 | link_directories(${EXTERNAL}/curl/lib) 42 | link_directories(${EXTERNAL}/MySQL/lib) 43 | elseif(APPLE) 44 | link_directories(/usr/local/opt/mysql-client/lib) 45 | endif() 46 | 47 | add_subdirectory(src) 48 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 as builder 2 | 3 | RUN apt-get update 4 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake libmysqlclient-dev libcurl4-openssl-dev 5 | 6 | WORKDIR /src 7 | COPY dependencies/ /src/dependencies/ 8 | COPY include/ /src/include/ 9 | COPY src/ /src/src/ 10 | COPY CMakeLists.txt /src/ 11 | 12 | RUN mkdir build && cd build && cmake .. && make -j 13 | 14 | FROM ubuntu:20.04 15 | 16 | RUN apt-get update 17 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libmysqlclient21 libcurl4 jq 18 | 19 | WORKDIR /srv 20 | COPY --from=builder /src/bin/osu-performance /srv/osu-performance 21 | COPY ./scripts/docker-entrypoint.sh /srv/docker-entrypoint.sh 22 | RUN chown -R 1000:1000 /srv 23 | 24 | USER 1000:1000 25 | 26 | ENTRYPOINT [ "/srv/docker-entrypoint.sh" ] 27 | -------------------------------------------------------------------------------- /bin/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "mysql.master.host" : "127.0.0.1", 3 | "mysql.master.port" : 3306, 4 | "mysql.master.username" : "root", 5 | "mysql.master.password" : "", 6 | "mysql.master.database" : "osu" 7 | } 8 | -------------------------------------------------------------------------------- /dependencies/MySQL/CREDITS: -------------------------------------------------------------------------------- 1 | MariaDB is brought to you by the MariaDB foundation, a USA non profit 2 | organization. 3 | 4 | The current main members and sponsors of the MariaDB foundation are: 5 | 6 | Automattic http://automattic.com (2014) 7 | SkySQL Ab http://www.skysql.com (2013, 2014) 8 | Booking.com http://www.booking.com (2013) 9 | Parallels http://www.parallels.com/products/plesk (2013) 10 | 11 | For a full list of supporters and sponsors see 12 | https://mariadb.org/en/supporters/ 13 | 14 | You can also do this by doing SHOW CONTRIBUTORS. 15 | 16 | For all corporate memberships and sponsorships please contact the 17 | MariaDB foundation Board via foundation@mariadb.org. 18 | 19 | The MariaDB foundation is responsible for the MariaDB source 20 | repository, the official MariaDB binaries and http://mariadb.org. 21 | 22 | The MariaDB foundation provides also, among other things, the 23 | following services to the MariaDB community: 24 | 25 | - Code reviews and applying patches for MariaDB 26 | - QA and testing of the MariaDB server 27 | - Merging MySQL patches into MariaDB 28 | - Bug fixing in MariaDB (for bugs that affects a large part of the community) 29 | - Building the official MariaDB binaries 30 | - Maintaining http://mariadb.org 31 | 32 | To be able to do the above we need help from cooperations and individuals! 33 | 34 | You can help support MariaDB by be becoming a MariaDB developer or a 35 | member or sponsor of the MariaDB foundation! 36 | 37 | You can get a list of all main authors of MariaDB / MySQL by doing 38 | SHOW AUTHORS; 39 | 40 | You can get a list sponsors and contributors by doing 41 | SHOW CONTRIBUTORS; 42 | 43 | You can read more about the MariaDB foundation at: 44 | https://mariadb.org/en/foundation/ 45 | -------------------------------------------------------------------------------- /dependencies/MySQL/dll/32bit/libmariadb.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ppy/osu-performance/9f638e05d6ed6a2086b5b115510b1f79ebd39258/dependencies/MySQL/dll/32bit/libmariadb.dll -------------------------------------------------------------------------------- /dependencies/MySQL/dll/64bit/libmariadb.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ppy/osu-performance/9f638e05d6ed6a2086b5b115510b1f79ebd39258/dependencies/MySQL/dll/64bit/libmariadb.dll -------------------------------------------------------------------------------- /dependencies/MySQL/include/m_ctype.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB 2 | 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Library General Public 5 | License as published by the Free Software Foundation; either 6 | version 2 of the License, or (at your option) any later version. 7 | 8 | This library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | Library General Public License for more details. 12 | 13 | You should have received a copy of the GNU Library General Public 14 | License along with this library; if not, write to the Free 15 | Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 16 | MA 02111-1301, USA */ 17 | 18 | /* 19 | A better inplementation of the UNIX ctype(3) library. 20 | Notes: my_global.h should be included before ctype.h 21 | */ 22 | 23 | #ifndef _m_ctype_h 24 | #define _m_ctype_h 25 | 26 | #include 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | #define CHARSET_DIR "charsets/" 33 | #define MY_CS_NAME_SIZE 32 34 | 35 | #define MADB_DEFAULT_CHARSET_NAME "latin1" 36 | #define MADB_DEFAULT_COLLATION_NAME "latin1_swedish_ci" 37 | 38 | /* we use the mysqlnd implementation */ 39 | typedef struct charset_info_st 40 | { 41 | unsigned int nr; /* so far only 1 byte for charset */ 42 | unsigned int state; 43 | char *csname; 44 | char *name; 45 | char *dir; 46 | unsigned int codepage; 47 | char *encoding; 48 | unsigned int char_minlen; 49 | unsigned int char_maxlen; 50 | unsigned int (*mb_charlen)(unsigned int c); 51 | unsigned int (*mb_valid)(const char *start, const char *end); 52 | } CHARSET_INFO; 53 | 54 | extern const CHARSET_INFO compiled_charsets[]; 55 | extern CHARSET_INFO *default_charset_info; 56 | extern CHARSET_INFO *my_charset_bin; 57 | extern CHARSET_INFO *my_charset_latin1; 58 | extern CHARSET_INFO *my_charset_utf8_general_ci; 59 | 60 | CHARSET_INFO *find_compiled_charset(unsigned int cs_number); 61 | CHARSET_INFO *find_compiled_charset_by_name(const char *name); 62 | 63 | size_t mysql_cset_escape_quotes(const CHARSET_INFO *cset, char *newstr, const char *escapestr, size_t escapestr_len); 64 | size_t mysql_cset_escape_slashes(const CHARSET_INFO *cset, char *newstr, const char *escapestr, size_t escapestr_len); 65 | char* madb_get_os_character_set(void); 66 | #ifdef _WIN32 67 | int madb_get_windows_cp(const char *charset); 68 | #endif 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /dependencies/MySQL/include/ma_common.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2013 by MontyProgram AB 2 | 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Library General Public 5 | License as published by the Free Software Foundation; either 6 | version 2 of the License, or (at your option) any later version. 7 | 8 | This library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | Library General Public License for more details. 12 | 13 | You should have received a copy of the GNU Library General Public 14 | License along with this library; if not, write to the Free 15 | Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 16 | MA 02111-1301, USA */ 17 | 18 | /* defines for the libmariadb library */ 19 | 20 | #ifndef _ma_common_h 21 | #define _ma_common_h 22 | 23 | #include 24 | #include 25 | 26 | 27 | typedef struct st_mariadb_db_driver 28 | { 29 | struct st_mariadb_client_plugin_DB *plugin; 30 | char *name; 31 | void *buffer; 32 | } MARIADB_DB_DRIVER; 33 | 34 | struct mysql_async_context; 35 | 36 | struct st_mysql_options_extension { 37 | char *plugin_dir; 38 | char *default_auth; 39 | char *ssl_crl; 40 | char *ssl_crlpath; 41 | char *server_public_key_path; 42 | struct mysql_async_context *async_context; 43 | HASH connect_attrs; 44 | size_t connect_attrs_len; 45 | void (*report_progress)(const MYSQL *mysql, 46 | unsigned int stage, 47 | unsigned int max_stage, 48 | double progress, 49 | const char *proc_info, 50 | unsigned int proc_info_length); 51 | MARIADB_DB_DRIVER *db_driver; 52 | char *ssl_fp; /* finger print of server certificate */ 53 | char *ssl_fp_list; /* white list of finger prints */ 54 | int (*verify_local_infile)(void *data, const char *filename); 55 | }; 56 | 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /dependencies/MySQL/include/ma_secure.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | Copyright (C) 2012 Monty Program AB 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this library; if not see 16 | or write to the Free Software Foundation, Inc., 17 | 51 Franklin St., Fifth Floor, Boston, MA 02110, USA 18 | 19 | Part of this code includes code from the PHP project which 20 | is freely available from http://www.php.net 21 | *************************************************************************************/ 22 | #ifndef _ma_secure_h_ 23 | #define _ma_secure_h_ 24 | 25 | #ifdef HAVE_OPENSSL 26 | #include 27 | #include /* SSL and SSL_CTX */ 28 | #include /* error reporting */ 29 | #include 30 | 31 | struct MYSQL; 32 | 33 | size_t my_ssl_read(Vio *vio, uchar* buf, size_t size); 34 | int my_ssl_close(Vio *vio); 35 | size_t my_ssl_write(Vio *vio, const uchar* buf, size_t size); 36 | SSL *my_ssl_init(MYSQL *mysql); 37 | int my_ssl_connect(SSL *ssl); 38 | int my_ssl_verify_server_cert(SSL *ssl); 39 | int ma_ssl_verify_fingerprint(SSL *ssl); 40 | 41 | int my_ssl_start(MYSQL *mysql); 42 | void my_ssl_end(void); 43 | 44 | #endif /* HAVE_OPENSSL */ 45 | #endif /* _ma_secure_h_ */ 46 | -------------------------------------------------------------------------------- /dependencies/MySQL/include/my_alarm.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB 2 | 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Library General Public 5 | License as published by the Free Software Foundation; either 6 | version 2 of the License, or (at your option) any later version. 7 | 8 | This library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | Library General Public License for more details. 12 | 13 | You should have received a copy of the GNU Library General Public 14 | License along with this library; if not, write to the Free 15 | Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 16 | MA 02111-1301, USA */ 17 | 18 | /* 19 | File to include when we want to use alarm or a loop_counter to display 20 | some information when a program is running 21 | */ 22 | #ifndef _my_alarm_h 23 | #define _my_alarm_h 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | extern int volatile my_have_got_alarm; 29 | extern ulong my_time_to_wait_for_lock; 30 | 31 | #if defined(HAVE_ALARM) && !defined(NO_ALARM_LOOP) 32 | #include 33 | #define ALARM_VARIABLES uint alarm_old=0; \ 34 | sig_return alarm_signal=0 35 | #define ALARM_INIT my_have_got_alarm=0 ; \ 36 | alarm_old=(uint) alarm(MY_HOW_OFTEN_TO_ALARM); \ 37 | alarm_signal=signal(SIGALRM,my_set_alarm_variable); 38 | #define ALARM_END VOID(signal(SIGALRM,alarm_signal)); \ 39 | VOID(alarm(alarm_old)); 40 | #define ALARM_TEST my_have_got_alarm 41 | #ifdef DONT_REMEMBER_SIGNAL 42 | #define ALARM_REINIT VOID(alarm(MY_HOW_OFTEN_TO_ALARM)); \ 43 | VOID(signal(SIGALRM,my_set_alarm_variable));\ 44 | my_have_got_alarm=0; 45 | #else 46 | #define ALARM_REINIT VOID(alarm((uint) MY_HOW_OFTEN_TO_ALARM)); \ 47 | my_have_got_alarm=0; 48 | #endif /* DONT_REMEMBER_SIGNAL */ 49 | #else 50 | #define ALARM_VARIABLES long alarm_pos=0,alarm_end_pos=MY_HOW_OFTEN_TO_WRITE-1 51 | #define ALARM_INIT 52 | #define ALARM_END 53 | #define ALARM_TEST (alarm_pos++ >= alarm_end_pos) 54 | #define ALARM_REINIT alarm_end_pos+=MY_HOW_OFTEN_TO_WRITE 55 | #endif /* HAVE_ALARM */ 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | #endif 61 | -------------------------------------------------------------------------------- /dependencies/MySQL/include/my_list.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB 2 | 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Library General Public 5 | License as published by the Free Software Foundation; either 6 | version 2 of the License, or (at your option) any later version. 7 | 8 | This library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | Library General Public License for more details. 12 | 13 | You should have received a copy of the GNU Library General Public 14 | License along with this library; if not, write to the Free 15 | Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 16 | MA 02111-1301, USA */ 17 | 18 | #ifndef _list_h_ 19 | #define _list_h_ 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | typedef struct st_list { 26 | struct st_list *prev,*next; 27 | void *data; 28 | } LIST; 29 | 30 | typedef int (*list_walk_action)(void *,void *); 31 | 32 | extern LIST *list_add(LIST *root,LIST *element); 33 | extern LIST *list_delete(LIST *root,LIST *element); 34 | extern LIST *list_cons(void *data,LIST *root); 35 | extern LIST *list_reverse(LIST *root); 36 | extern void list_free(LIST *root,unsigned int free_data); 37 | extern unsigned int list_length(LIST *list); 38 | extern int list_walk(LIST *list,list_walk_action action,gptr argument); 39 | 40 | #define rest(a) ((a)->next) 41 | #define list_push(a,b) (a)=list_cons((b),(a)) 42 | #define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old) ; my_free((gptr) old,MYF(MY_FAE)); } 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | #endif 48 | -------------------------------------------------------------------------------- /dependencies/MySQL/include/my_net.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB 2 | 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Library General Public 5 | License as published by the Free Software Foundation; either 6 | version 2 of the License, or (at your option) any later version. 7 | 8 | This library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | Library General Public License for more details. 12 | 13 | You should have received a copy of the GNU Library General Public 14 | License along with this library; if not, write to the Free 15 | Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 16 | MA 02111-1301, USA */ 17 | 18 | /* thread safe version of some common functions */ 19 | 20 | /* for thread safe my_inet_ntoa */ 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif /* __cplusplus */ 24 | 25 | #if !defined(MSDOS) && !defined(_WIN32) && !defined(__BEOS__) 26 | #ifdef HAVE_SYS_SOCKET_H 27 | #include 28 | #endif 29 | #ifdef HAVE_NETINET_IN_H 30 | #include 31 | #endif 32 | #ifdef HAVE_ARPA_INET_H 33 | #include 34 | #endif 35 | #endif /* !defined(MSDOS) && !defined(_WIN32) */ 36 | 37 | 38 | /* On SCO you get a link error when refering to h_errno */ 39 | #ifdef SCO 40 | #undef h_errno 41 | #define h_errno errno 42 | #endif 43 | 44 | void my_inet_ntoa(struct in_addr in, char *buf); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | -------------------------------------------------------------------------------- /dependencies/MySQL/include/my_no_pthread.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB 2 | 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Library General Public 5 | License as published by the Free Software Foundation; either 6 | version 2 of the License, or (at your option) any later version. 7 | 8 | This library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | Library General Public License for more details. 12 | 13 | You should have received a copy of the GNU Library General Public 14 | License along with this library; if not, write to the Free 15 | Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 16 | MA 02111-1301, USA */ 17 | 18 | /* 19 | This undefs some pthread mutex locks when one isn't using threads 20 | to make thread safe code, that should also work in single thread 21 | environment, easier to use. 22 | */ 23 | 24 | #if !defined(_my_no_pthread_h) && !defined(THREAD) 25 | #define _my_no_pthread_h 26 | 27 | #define pthread_mutex_init(A,B) 28 | #define pthread_mutex_lock(A) 29 | #define pthread_mutex_unlock(A) 30 | #define pthread_mutex_destroy(A) 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /dependencies/MySQL/include/mysql_io.h: -------------------------------------------------------------------------------- 1 | /* 2 | +----------------------------------------------------------------------+ 3 | | PHP Version 6 | 4 | +----------------------------------------------------------------------+ 5 | | Copyright (c) 2006-2007 The PHP Group | 6 | +----------------------------------------------------------------------+ 7 | | This source file is subject to version 3.01 of the PHP license, | 8 | | that is bundled with this package in the file LICENSE, and is | 9 | | available through the world-wide-web at the following url: | 10 | | http://www.php.net/license/3_01.txt | 11 | | If you did not receive a copy of the PHP license and are unable to | 12 | | obtain it through the world-wide-web, please send a note to | 13 | | license@php.net so we can mail you a copy immediately. | 14 | +----------------------------------------------------------------------+ 15 | | Authors: | 16 | +----------------------------------------------------------------------+ 17 | */ 18 | 19 | #ifndef MYSQL_IO_H 20 | #define MYSQL_IO_H 21 | 22 | #ifdef _WIN32 23 | void mysql_io_win_init(void); 24 | #endif 25 | 26 | MYSQL_STREAM * mysql_io_open(const char *name, size_t namelen); 27 | size_t mysql_io_read(MYSQL_STREAM *stream, char *buf, size_t size); 28 | size_t mysql_io_write(MYSQL_STREAM *stream, const char *buf, size_t count); 29 | void mysql_io_close(MYSQL_STREAM *stream); 30 | 31 | #endif /* MYSQLND_IO_H */ 32 | -------------------------------------------------------------------------------- /dependencies/MySQL/include/mysql_mm.h: -------------------------------------------------------------------------------- 1 | /* 2 | +----------------------------------------------------------------------+ 3 | | PHP Version 6 | 4 | +----------------------------------------------------------------------+ 5 | | Copyright (c) 2006-2007 The PHP Group | 6 | +----------------------------------------------------------------------+ 7 | | This source file is subject to version 3.01 of the PHP license, | 8 | | that is bundled with this package in the file LICENSE, and is | 9 | | available through the world-wide-web at the following url: | 10 | | http://www.php.net/license/3_01.txt | 11 | | If you did not receive a copy of the PHP license and are unable to | 12 | | obtain it through the world-wide-web, please send a note to | 13 | | license@php.net so we can mail you a copy immediately. | 14 | +----------------------------------------------------------------------+ 15 | | Authors: Georg Richter | 16 | | Andrey Hristov | 17 | | Ulf Wendel | 18 | +----------------------------------------------------------------------+ 19 | */ 20 | 21 | #ifndef MYSQLND_MM_H 22 | #define MYSQLND_MM_H 23 | #include 24 | 25 | 26 | char * mnd_strndup(const char *s, size_t length); 27 | char * mnd_strdup(const char *src); 28 | 29 | 30 | #define mnd_malloc(size) malloc((size)) 31 | #define mnd_calloc(nmemb, size) calloc((nmemb), (size)) 32 | #define mnd_realloc(ptr, new_size) realloc((ptr), (new_size)) 33 | #define mnd_free(ptr) free((ptr)) 34 | 35 | #endif /* MYSQLND_MM_H */ 36 | 37 | /* 38 | * Local variables: 39 | * tab-width: 4 40 | * c-basic-offset: 4 41 | * End: 42 | * vim600: noet sw=4 ts=4 fdm=marker 43 | * vim<600: noet sw=4 ts=4 44 | */ 45 | -------------------------------------------------------------------------------- /dependencies/MySQL/include/mysql_priv.h: -------------------------------------------------------------------------------- 1 | /* internal functions */ 2 | MYSQL_DATA *read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields, uint fields); 3 | void free_rows(MYSQL_DATA *cur); 4 | MYSQL_FIELD * unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, my_bool default_value, my_bool long_flag_protocol); 5 | -------------------------------------------------------------------------------- /dependencies/MySQL/include/mysql_version.h: -------------------------------------------------------------------------------- 1 | /* Copyright Abandoned 1996, 1999, 2001 MySQL AB 2 | This file is public domain and comes with NO WARRANTY of any kind */ 3 | 4 | /* Version numbers for protocol & mysqld */ 5 | 6 | #ifdef _CUSTOMCONFIG_ 7 | #include 8 | #else 9 | #define PROTOCOL_VERSION 10 10 | #define MYSQL_CLIENT_VERSION "5.5.1" 11 | #define MYSQL_SERVER_VERSION "5.5.1" 12 | #define MYSQL_SERVER_SUFFIX "" 13 | #define FRM_VER 14 | #define MYSQL_VERSION_ID 50501 15 | #define MYSQL_PORT 3306 16 | #define MYSQL_UNIX_ADDR "/tmp/mysql.sock" 17 | #define MYSQL_CONFIG_NAME "my" 18 | 19 | #define MARIADB_PACKAGE_VERSION "2.3.5" 20 | #define MARIADB_PACKAGE_VERSION_ID 20305 21 | #define MARIADB_SYSTEM_TYPE "Windows" 22 | #define MARIADB_MACHINE_TYPE "AMD64" 23 | 24 | /* mysqld compile time options */ 25 | #ifndef MYSQL_CHARSET 26 | #define MYSQL_CHARSET "" 27 | #endif 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /dependencies/MySQL/include/mysys_err.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB 2 | 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Library General Public 5 | License as published by the Free Software Foundation; either 6 | version 2 of the License, or (at your option) any later version. 7 | 8 | This library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | Library General Public License for more details. 12 | 13 | You should have received a copy of the GNU Library General Public 14 | License along with this library; if not, write to the Free 15 | Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 16 | MA 02111-1301, USA */ 17 | 18 | #ifndef _mysys_err_h 19 | #define _mysys_err_h 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | #define GLOB 0 /* Error maps */ 25 | #define GLOBERRS EE_LASTERROR - EE_FIRSTERROR + 1 /* Max number of error messages in map's */ 26 | #define EE(X) globerrs[ (X) - EE_FIRSTERROR ] /* Defines to add error to right map */ 27 | 28 | extern const char * NEAR globerrs[]; /* my_error_messages is here */ 29 | 30 | /* Error message numbers in global map 31 | 32 | */ 33 | #define EE_FIRSTERROR 1 34 | #define EE_CANTCREATEFILE 1 35 | #define EE_READ 2 36 | #define EE_WRITE 3 37 | #define EE_BADCLOSE 4 38 | #define EE_OUTOFMEMORY 5 39 | #define EE_DELETE 6 40 | #define EE_LINK 7 41 | #define EE_EOFERR 9 42 | #define EE_CANTLOCK 10 43 | #define EE_CANTUNLOCK 11 44 | #define EE_DIR 12 45 | #define EE_STAT 13 46 | #define EE_CANT_CHSIZE 14 47 | #define EE_CANT_OPEN_STREAM 15 48 | #define EE_GETWD 16 49 | #define EE_SETWD 17 50 | #define EE_LINK_WARNING 18 51 | #define EE_OPEN_WARNING 19 52 | #define EE_DISK_FULL 20 53 | #define EE_CANT_MKDIR 21 54 | #define EE_UNKNOWN_CHARSET 22 55 | #define EE_OUT_OF_FILERESOURCES 23 56 | #define EE_CANT_READLINK 24 57 | #define EE_CANT_SYMLINK 25 58 | #define EE_REALPATH 26 59 | #define EE_SYNC 27 60 | #define EE_UNKNOWN_COLLATION 28 61 | #define EE_FILENOTFOUND 29 62 | #define EE_FILE_NOT_CLOSED 30 63 | #define EE_CANT_CHMOD 31 64 | #define EE_LASTERROR 31 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | #endif 70 | -------------------------------------------------------------------------------- /dependencies/MySQL/include/sha1.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (C) 2012 Monty Program AB 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this library; if not see 16 | or write to the Free Software Foundation, Inc., 17 | 51 Franklin St., Fifth Floor, Boston, MA 02110, USA 18 | *****************************************************************************/ 19 | 20 | /* This code came from the PHP project, initially written by 21 | Stefan Esser */ 22 | 23 | #ifndef SHA1_H 24 | #define SHA1_H 25 | 26 | #define SHA1_MAX_LENGTH 20 27 | #define SCRAMBLE_LENGTH 20 28 | #define SCRAMBLE_LENGTH_323 8 29 | 30 | /* SHA1 context. */ 31 | typedef struct { 32 | uint32 state[5]; /* state (ABCD) */ 33 | uint32 count[2]; /* number of bits, modulo 2^64 (lsb first) */ 34 | unsigned char buffer[64]; /* input buffer */ 35 | } MYSQL_SHA1_CTX; 36 | 37 | void MYSQL_SHA1Init(MYSQL_SHA1_CTX *); 38 | void MYSQL_SHA1Update(MYSQL_SHA1_CTX *, const unsigned char *, size_t); 39 | void MYSQL_SHA1Final(unsigned char[20], MYSQL_SHA1_CTX *); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /dependencies/MySQL/lib/libmariadb.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ppy/osu-performance/9f638e05d6ed6a2086b5b115510b1f79ebd39258/dependencies/MySQL/lib/libmariadb.lib -------------------------------------------------------------------------------- /dependencies/MySQL/lib/libmariadb32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ppy/osu-performance/9f638e05d6ed6a2086b5b115510b1f79ebd39258/dependencies/MySQL/lib/libmariadb32.lib -------------------------------------------------------------------------------- /dependencies/StrFormat/BasicAdaptor.h: -------------------------------------------------------------------------------- 1 | // Type-safe C++0x printf library 2 | // Copyright (c) 2011 HHD Software Ltd. http://www.hhdsoftware.com 3 | // Written by Alexander Bessonov 4 | 5 | // Distributed under the terms of The Code Project Open License (http://www.codeproject.com) 6 | 7 | #pragma once 8 | 9 | namespace ts_printf 10 | { 11 | namespace _details 12 | { 13 | template 14 | struct is_char_type 15 | { 16 | enum 17 | { 18 | value = std::is_same::value || 19 | std::is_same::value || 20 | std::is_same::value || 21 | std::is_same::value 22 | }; 23 | }; 24 | 25 | // all output adaptors need to derive from this basic_adaptor struct. 26 | // it is used to properly match candidate function 27 | 28 | class CBasicAdaptor 29 | { 30 | }; 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /dependencies/StrFormat/CharBuffer.h: -------------------------------------------------------------------------------- 1 | // Type-safe C++0x printf library 2 | // Copyright (c) 2011 HHD Software Ltd. http://www.hhdsoftware.com 3 | // Written by Alexander Bessonov 4 | 5 | // Distributed under the terms of The Code Project Open License (http://www.codeproject.com) 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | // _details::character_buffer class implements temporary storage for renderers 12 | // It uses BELT_TSP_MAX_TEMPORARY_CHARS_ON_STACK characters on stack, if it is not enough, it allocates memory from heap 13 | 14 | #ifndef BELT_TSP_MAX_TEMPORARY_CHARS_ON_STACK 15 | #define BELT_TSP_MAX_TEMPORARY_CHARS_ON_STACK 128 16 | #endif 17 | 18 | namespace ts_printf 19 | { 20 | namespace _details 21 | { 22 | template 23 | class CCharBuffer 24 | { 25 | public: 26 | CCharBuffer() 27 | : 28 | m_Allocated(BELT_TSP_MAX_TEMPORARY_CHARS_ON_STACK), 29 | m_Used(0) 30 | { 31 | } 32 | 33 | void SetLength(size_t Length) 34 | { 35 | m_Length = Length; 36 | } 37 | 38 | size_t GetLength() 39 | { 40 | return m_Length; 41 | } 42 | 43 | void SetOffset(size_t Offset) 44 | { 45 | m_Offset = Offset; 46 | } 47 | 48 | size_t GetOffset() 49 | { 50 | return m_Offset; 51 | } 52 | 53 | void Clear() 54 | { 55 | m_Length = 0; 56 | m_Offset = 0; // Reset offset, so anyone can assumed, that the buffer is -truly- cleared 57 | } 58 | 59 | 60 | CharType* GetData() 61 | { 62 | return 63 | m_Allocated > BELT_TSP_MAX_TEMPORARY_CHARS_ON_STACK ? 64 | m_Heap.get() : m_Stack.data(); 65 | } 66 | 67 | CharType* Allocate(size_t Size) 68 | { 69 | if(Size > m_Allocated) 70 | { 71 | m_Heap.reset(new CharType[Size]); 72 | m_Allocated = Size; 73 | } 74 | 75 | m_Used = Size; 76 | return GetData(); 77 | } 78 | 79 | 80 | 81 | size_t GetSize() const 82 | { 83 | return m_Used; 84 | } 85 | 86 | 87 | private: 88 | 89 | std::array m_Stack; 90 | std::unique_ptr m_Heap; 91 | 92 | 93 | size_t m_Allocated; 94 | size_t m_Used; 95 | 96 | size_t m_Length; 97 | size_t m_Offset; 98 | 99 | 100 | }; 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /dependencies/StrFormat/FormatDesc.h: -------------------------------------------------------------------------------- 1 | // Type-safe C++0x printf library 2 | // Copyright (c) 2011 HHD Software Ltd. http://www.hhdsoftware.com 3 | // Written by Alexander Bessonov 4 | 5 | // Distributed under the terms of The Code Project Open License (http://www.codeproject.com) 6 | 7 | #pragma once 8 | 9 | namespace ts_printf 10 | { 11 | namespace _details 12 | { 13 | struct SBaseFormatter {}; 14 | 15 | enum class E_ALIGNMENT : u16 16 | { 17 | LEFT, 18 | CENTER, 19 | RIGHT, 20 | }; 21 | 22 | // Format flags 23 | enum E_FORMATFLAGS : u32 24 | { 25 | NORMAL = 0x00, 26 | ELLIPSIS = 0x01, // add … when clipping 27 | ALWAYSPLUS = 0x02, // always add + to positive numbers 28 | LOWHEX = 0x04, // use lowercase 29 | FORCECHAR = 0x08, // display integer as character 30 | THOUSANDS = 0x10, // display thousand separators 31 | TIMEFORMAT = 0x20, // time format has been specified 32 | NUMBERPREFIX = 0x40, // "0x" or "0X" must be rendered before hexadecimal number 33 | 34 | FORMATSTRING = 0x80, // a reference to an original format string 35 | }; 36 | 37 | template 38 | struct SFormatDesc 39 | { 40 | // Constructor for text-formats 41 | SFormatDesc(const CharType* begin, const CharType* end, bool bHasEscapedChars_) throw() 42 | : Flags(E_FORMATFLAGS::FORMATSTRING), Begin(begin), End(end), bHasEscapedChars(bHasEscapedChars_) 43 | { 44 | } 45 | 46 | // Constructor for param-formats 47 | SFormatDesc() throw() 48 | : 49 | Flags(E_FORMATFLAGS::NORMAL), 50 | ParamIndex(0), 51 | Alignment(E_ALIGNMENT::LEFT), 52 | MinWidth(0), 53 | MaxWidth(0), 54 | Precision(0), 55 | PaddingChar(static_cast(' ')), 56 | Base(10) 57 | { 58 | } 59 | 60 | E_FORMATFLAGS Flags; // see FF_* constants. Only BYTE is currently used, but DWORD is chosen for better structure alignment 61 | 62 | union 63 | { 64 | struct 65 | { 66 | const CharType *tmfBegin; // the beginning of the time format string 67 | const CharType *tmfEnd; // the end of the time format string 68 | 69 | u16 ParamIndex; // index of the parameter 70 | E_ALIGNMENT Alignment; 71 | u16 MinWidth; 72 | u16 MaxWidth; 73 | u16 Precision; // used for floating-point only 74 | CharType PaddingChar; // character used for padding 75 | byte Base; // used for integer only 76 | }; 77 | struct 78 | { 79 | const CharType* Begin; 80 | const CharType* End; 81 | bool bHasEscapedChars; 82 | }; 83 | }; 84 | }; 85 | }; 86 | }; 87 | 88 | -------------------------------------------------------------------------------- /dependencies/StrFormat/LICENSE.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ppy/osu-performance/9f638e05d6ed6a2086b5b115510b1f79ebd39258/dependencies/StrFormat/LICENSE.htm -------------------------------------------------------------------------------- /dependencies/StrFormat/MODIFICATION: -------------------------------------------------------------------------------- 1 | The Standard Version (according to CPOL terms) has been modified to allow printing additional types such as enums and to fix various bugs with the original implementation. -------------------------------------------------------------------------------- /dependencies/StrFormat/StrFormat.h: -------------------------------------------------------------------------------- 1 | // Type-safe C++0x printf library 2 | // Copyright (c) 2011 HHD Software Ltd. http://www.hhdsoftware.com 3 | // Written by Alexander Bessonov 4 | 5 | // Distributed under the terms of The Code Project Open License (http://www.codeproject.com) 6 | 7 | #pragma once 8 | 9 | #include "printf.h" 10 | #include "BasicAdaptor.h" 11 | 12 | namespace ts_printf 13 | { 14 | namespace _details 15 | { 16 | template 17 | class CStringAdaptor : CBasicAdaptor 18 | { 19 | public: 20 | typedef std::basic_string CString; 21 | 22 | CStringAdaptor() 23 | { 24 | } 25 | 26 | void Write(CharType Char, size_t Count) 27 | { 28 | m_Result.append(Count, Char); 29 | } 30 | 31 | void Write(const CharType* szString, size_t Length) 32 | { 33 | m_Result.append(szString, Length); 34 | } 35 | 36 | CString& GetResult() 37 | { 38 | return m_Result; 39 | } 40 | 41 | private: 42 | CString m_Result; 43 | CStringAdaptor &operator =(const CStringAdaptor &); 44 | }; 45 | } 46 | }; 47 | 48 | // Render from format. 49 | template 50 | auto StrFormat(const CFormat&& Format, A&& ... Args) -> 51 | std::basic_string 52 | { 53 | ts_printf::_details::CStringAdaptor Adaptor; 54 | 55 | Format.render(Adaptor, std::forward(Args)...); 56 | return Adaptor.GetResult(); 57 | } 58 | 59 | // Create format object & render for zero terminated string pointers 60 | template 61 | auto StrFormat(CharPointer&& CharPtr, A&& ... Args) -> 62 | std::enable_if_t < !std::is_base_of < ts_printf::_details::SBaseFormatter, std::decay_t> ::value, 63 | decltype(StrFormat(ts_printf::Format(std::forward(CharPtr)), std::forward(Args)...)) 64 | > 65 | { 66 | return StrFormat(ts_printf::Format(std::forward(CharPtr)), std::forward(Args)...); 67 | } 68 | 69 | // Create format object & render for string references 70 | template 71 | auto StrFormat(CString& FormatString, A && ... Args) -> 72 | typename std::enable_if < !std::is_base_of < ts_printf::_details::SBaseFormatter, std::decay_t> ::value && 73 | !std::is_pod>::value, 74 | decltype(StrFormat(ts_printf::Format(std::forward(FormatString)), std::forward(Args)...)) 75 | > ::type 76 | { 77 | return StrFormat(ts_printf::Format(std::forward(FormatString)), std::forward(Args)...); 78 | }; 79 | -------------------------------------------------------------------------------- /dependencies/StrFormat/TimedateRenderer.h: -------------------------------------------------------------------------------- 1 | // Type-safe C++0x printf library 2 | // Copyright (c) 2011 HHD Software Ltd. http://www.hhdsoftware.com 3 | // Written by Alexander Bessonov 4 | 5 | // Distributed under the terms of The Code Project Open License (http://www.codeproject.com) 6 | 7 | #pragma once 8 | 9 | #ifndef BELT_TSP_MAX_TIMEDATE_STRING_LENGTH 10 | #define BELT_TSP_MAX_TIMEDATE_STRING_LENGTH 40 11 | #endif 12 | 13 | #include 14 | 15 | namespace ts_printf 16 | { 17 | struct time_t 18 | { 19 | ::time_t v; 20 | 21 | time_t(::time_t v_) : v(v_) 22 | {} 23 | 24 | const ::time_t &get() const 25 | { 26 | return v; 27 | } 28 | }; 29 | 30 | namespace _details 31 | { 32 | template 33 | class timedate_renderer 34 | { 35 | typedef FormatDesc FormatDesc; 36 | typedef character_buffer character_buffer; 37 | 38 | static const std::locale &get_locale() 39 | { 40 | static std::locale loc(""); 41 | return loc; 42 | } 43 | 44 | protected: 45 | static void irender_parameter(const FormatDesc &fd,const std::tm &value,character_buffer &buffer) 46 | { 47 | if (fd.flags&FF_TIMEFORMAT) 48 | { 49 | char_type *begin=buffer.allocate(BELT_TSP_MAX_TIMEDATE_STRING_LENGTH); 50 | buffer.set_result( 51 | begin, 52 | std::use_facet>(get_locale()).put(begin,*(std::ios_base *) nullptr,fd.pad,&value,fd.tmfBegin,fd.tmfEnd) 53 | ); 54 | } 55 | } 56 | 57 | static void irender_parameter(const FormatDesc &fd,const ts_printf::time_t &value,character_buffer &buffer) 58 | { 59 | std::tm tm; 60 | if(!localtime_s(&tm, &value.get())) 61 | irender_parameter(fd,tm,buffer); 62 | } 63 | 64 | #if defined(_WIN32) && defined(_FILETIME_) 65 | static void irender_parameter(const FormatDesc &fd,const FILETIME &ftime,character_buffer &buffer) // in UTC! 66 | { 67 | const unsigned long long EpochBias=116444736000000000ull; 68 | 69 | irender_parameter(fd,(ts_printf::time_t)(((const unsigned long long &)(ftime) - EpochBias) / 10000000ull),buffer); 70 | } 71 | #endif 72 | }; 73 | }; 74 | }; 75 | -------------------------------------------------------------------------------- /dependencies/StrFormat/generic_exception.h: -------------------------------------------------------------------------------- 1 | // Type-safe C++0x printf library 2 | // Copyright (c) 2011 HHD Software Ltd. http://www.hhdsoftware.com 3 | // Written by Alexander Bessonov 4 | 5 | // Distributed under the terms of The Code Project Open License (http://www.codeproject.com) 6 | 7 | #pragma once 8 | 9 | namespace ts_printf 10 | { 11 | // base class for all library exceptions 12 | struct generic_exception 13 | { 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /dependencies/curl/LICENSE: -------------------------------------------------------------------------------- 1 | COPYRIGHT AND PERMISSION NOTICE 2 | 3 | Copyright (c) 1996 - 2015, Daniel Stenberg, daniel@haxx.se. 4 | 5 | All rights reserved. 6 | 7 | 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. 8 | 9 | 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 OF THIRD PARTY RIGHTS. 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. 10 | 11 | Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder. 12 | -------------------------------------------------------------------------------- /dependencies/curl/dll/32bit/libcurl.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ppy/osu-performance/9f638e05d6ed6a2086b5b115510b1f79ebd39258/dependencies/curl/dll/32bit/libcurl.dll -------------------------------------------------------------------------------- /dependencies/curl/dll/64bit/libcurl.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ppy/osu-performance/9f638e05d6ed6a2086b5b115510b1f79ebd39258/dependencies/curl/dll/64bit/libcurl.dll -------------------------------------------------------------------------------- /dependencies/curl/include/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = curl 2 | 3 | EXTRA_DIST = README 4 | 5 | AUTOMAKE_OPTIONS = foreign no-dependencies 6 | -------------------------------------------------------------------------------- /dependencies/curl/include/curl/Makefile.am: -------------------------------------------------------------------------------- 1 | #*************************************************************************** 2 | # _ _ ____ _ 3 | # Project ___| | | | _ \| | 4 | # / __| | | | |_) | | 5 | # | (__| |_| | _ <| |___ 6 | # \___|\___/|_| \_\_____| 7 | # 8 | # Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. 9 | # 10 | # This software is licensed as described in the file COPYING, which 11 | # you should have received as part of this distribution. The terms 12 | # are also available at http://curl.haxx.se/docs/copyright.html. 13 | # 14 | # You may opt to use, copy, modify, merge, publish, distribute and/or sell 15 | # copies of the Software, and permit persons to whom the Software is 16 | # furnished to do so, under the terms of the COPYING file. 17 | # 18 | # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 19 | # KIND, either express or implied. 20 | # 21 | ########################################################################### 22 | pkginclude_HEADERS = \ 23 | curl.h curlver.h easy.h mprintf.h stdcheaders.h multi.h \ 24 | typecheck-gcc.h curlbuild.h curlrules.h 25 | 26 | pkgincludedir= $(includedir)/curl 27 | 28 | # curlbuild.h does not exist in the git tree. When the original libcurl 29 | # source code distribution archive file is created, curlbuild.h.dist is 30 | # renamed to curlbuild.h and included in the tarball so that it can be 31 | # used directly on non-configure systems. 32 | # 33 | # The distributed curlbuild.h will be overwritten on configure systems 34 | # when the configure script runs, with one that is suitable and specific 35 | # to the library being configured and built. 36 | # 37 | # curlbuild.h.in is the distributed template file from which the configure 38 | # script creates curlbuild.h at library configuration time, overwiting the 39 | # one included in the distribution archive. 40 | # 41 | # curlbuild.h.dist is not included in the source code distribution archive. 42 | 43 | EXTRA_DIST = curlbuild.h.in 44 | 45 | DISTCLEANFILES = curlbuild.h 46 | 47 | checksrc: 48 | @@PERL@ $(top_srcdir)/lib/checksrc.pl -Wcurlbuild.h -D$(top_srcdir)/include/curl $(pkginclude_HEADERS) $(EXTRA_DIST) 49 | 50 | if CURLDEBUG 51 | # for debug builds, we scan the sources on all regular make invokes 52 | all-local: checksrc 53 | endif 54 | -------------------------------------------------------------------------------- /dependencies/curl/include/curl/stdcheaders.h: -------------------------------------------------------------------------------- 1 | #ifndef __STDC_HEADERS_H 2 | #define __STDC_HEADERS_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include 26 | 27 | size_t fread (void *, size_t, size_t, FILE *); 28 | size_t fwrite (const void *, size_t, size_t, FILE *); 29 | 30 | int strcasecmp(const char *, const char *); 31 | int strncasecmp(const char *, const char *, size_t); 32 | 33 | #endif /* __STDC_HEADERS_H */ 34 | -------------------------------------------------------------------------------- /dependencies/curl/lib/README.ares: -------------------------------------------------------------------------------- 1 | _ _ ____ _ 2 | ___| | | | _ \| | 3 | / __| | | | |_) | | 4 | | (__| |_| | _ <| |___ 5 | \___|\___/|_| \_\_____| 6 | 7 | How To Build libcurl to Use c-ares For Asynch Name Resolves 8 | =========================================================== 9 | 10 | c-ares: 11 | http://c-ares.haxx.se/ 12 | 13 | NOTE 14 | The latest libcurl version requires c-ares 1.6.0 or later. 15 | 16 | Once upon the time libcurl built fine with the "original" ares. That is no 17 | longer true. You need to use c-ares. 18 | 19 | Build c-ares 20 | ============ 21 | 22 | 1. unpack the c-ares archive 23 | 2. cd c-ares-dir 24 | 3. ./configure 25 | 4. make 26 | 5. make install 27 | 28 | Build libcurl to use c-ares in the curl source tree 29 | =================================================== 30 | 31 | 1. name or symlink the c-ares source directory 'ares' in the curl source 32 | directory 33 | 2. ./configure --enable-ares 34 | 35 | Optionally, you can point out the c-ares install tree root with the the 36 | --enable-ares option. 37 | 38 | 3. make 39 | 40 | Build libcurl to use an installed c-ares 41 | ======================================== 42 | 43 | 1. ./configure --enable-ares=/path/to/ares/install 44 | 2. make 45 | 46 | c-ares on win32 47 | =============== 48 | (description brought by Dominick Meglio) 49 | 50 | First I compiled c-ares. I changed the default C runtime library to be the 51 | single-threaded rather than the multi-threaded (this seems to be required to 52 | prevent linking errors later on). Then I simply build the areslib project (the 53 | other projects adig/ahost seem to fail under MSVC). 54 | 55 | Next was libcurl. I opened lib/config-win32.h and I added a: 56 | #define USE_ARES 1 57 | 58 | Next thing I did was I added the path for the ares includes to the include 59 | path, and the libares.lib to the libraries. 60 | 61 | Lastly, I also changed libcurl to be single-threaded rather than 62 | multi-threaded, again this was to prevent some duplicate symbol errors. I'm 63 | not sure why I needed to change everything to single-threaded, but when I 64 | didn't I got redefinition errors for several CRT functions (malloc, stricmp, 65 | etc.) 66 | 67 | I would have modified the MSVC++ project files, but I only have VC.NET and it 68 | uses a different format than VC6.0 so I didn't want to go and change 69 | everything and remove VC6.0 support from libcurl. 70 | -------------------------------------------------------------------------------- /dependencies/curl/lib/README.curlx: -------------------------------------------------------------------------------- 1 | _ _ ____ _ 2 | ___| | | | _ \| | 3 | / __| | | | |_) | | 4 | | (__| |_| | _ <| |___ 5 | \___|\___/|_| \_\_____| 6 | 7 | Source Code Functions Apps Might Use 8 | ==================================== 9 | 10 | The libcurl source code offers a few functions by source only. They are not 11 | part of the official libcurl API, but the source files might be useful for 12 | others so apps can optionally compile/build with these sources to gain 13 | additional functions. 14 | 15 | We provide them through a single header file for easy access for apps: 16 | "curlx.h" 17 | 18 | curlx_strtoofft() 19 | 20 | A macro that converts a string containing a number to a curl_off_t number. 21 | This might use the curlx_strtoll() function which is provided as source 22 | code in strtoofft.c. Note that the function is only provided if no 23 | strtoll() (or equivalent) function exist on your platform. If curl_off_t 24 | is only a 32 bit number on your platform, this macro uses strtol(). 25 | 26 | curlx_tvnow() 27 | 28 | returns a struct timeval for the current time. 29 | 30 | curlx_tvdiff() 31 | 32 | returns the difference between two timeval structs, in number of 33 | milliseconds. 34 | 35 | curlx_tvdiff_secs() 36 | 37 | returns the same as curlx_tvdiff but with full usec resolution (as a 38 | double) 39 | 40 | FUTURE 41 | ====== 42 | 43 | Several functions will be removed from the public curl_ name space in a 44 | future libcurl release. They will then only become available as curlx_ 45 | functions instead. To make the transition easier, we already today provide 46 | these functions with the curlx_ prefix to allow sources to get built properly 47 | with the new function names. The functions this concerns are: 48 | 49 | curlx_getenv 50 | curlx_strequal 51 | curlx_strnequal 52 | curlx_mvsnprintf 53 | curlx_msnprintf 54 | curlx_maprintf 55 | curlx_mvaprintf 56 | curlx_msprintf 57 | curlx_mprintf 58 | curlx_mfprintf 59 | curlx_mvsprintf 60 | curlx_mvprintf 61 | curlx_mvfprintf 62 | -------------------------------------------------------------------------------- /dependencies/curl/lib/README.hostip: -------------------------------------------------------------------------------- 1 | hostip.c explained 2 | ================== 3 | 4 | The main COMPILE-TIME DEFINES to keep in mind when reading the host*.c 5 | source file are these: 6 | 7 | CURLRES_IPV6 - this host has getaddrinfo() and family, and thus we use 8 | that. The host may not be able to resolve IPv6, but we don't really have to 9 | take that into account. Hosts that aren't IPv6-enabled have CURLRES_IPV4 10 | defined. 11 | 12 | CURLRES_ARES - is defined if libcurl is built to use c-ares for asynchronous 13 | name resolves. It cannot have ENABLE_IPV6 defined at the same time, as c-ares 14 | has no ipv6 support. This can be Windows or *nix. 15 | 16 | CURLRES_THREADED - is defined if libcurl is built to run under (native) 17 | Windows, and then the name resolve will be done in a new thread, and the 18 | supported asynch API will be the same as for ares-builds. 19 | 20 | If any of the two previous are defined, CURLRES_ASYNCH is defined too. If 21 | libcurl is not built to use an asynchronous resolver, CURLRES_SYNCH is 22 | defined. 23 | 24 | The host*.c sources files are split up like this: 25 | 26 | hostip.c - method-independent resolver functions and utility functions 27 | hostasyn.c - functions for asynchronous name resolves 28 | hostsyn.c - functions for synchronous name resolves 29 | hostares.c - functions for ares-using name resolves 30 | hostthre.c - functions for threaded name resolves 31 | hostip4.c - ipv4-specific functions 32 | hostip6.c - ipv6-specific functions 33 | 34 | The hostip.h is the single united header file for all this. It defines the 35 | CURLRES_* defines based on the config*.h and curl_setup.h defines. 36 | -------------------------------------------------------------------------------- /dependencies/curl/lib/README.memoryleak: -------------------------------------------------------------------------------- 1 | _ _ ____ _ 2 | ___| | | | _ \| | 3 | / __| | | | |_) | | 4 | | (__| |_| | _ <| |___ 5 | \___|\___/|_| \_\_____| 6 | 7 | How To Track Down Suspected Memory Leaks in libcurl 8 | =================================================== 9 | 10 | Single-threaded 11 | 12 | Please note that this memory leak system is not adjusted to work in more 13 | than one thread. If you want/need to use it in a multi-threaded app. Please 14 | adjust accordingly. 15 | 16 | 17 | Build 18 | 19 | Rebuild libcurl with -DCURLDEBUG (usually, rerunning configure with 20 | --enable-debug fixes this). 'make clean' first, then 'make' so that all 21 | files actually are rebuilt properly. It will also make sense to build 22 | libcurl with the debug option (usually -g to the compiler) so that debugging 23 | it will be easier if you actually do find a leak in the library. 24 | 25 | This will create a library that has memory debugging enabled. 26 | 27 | Modify Your Application 28 | 29 | Add a line in your application code: 30 | 31 | curl_memdebug("dump"); 32 | 33 | This will make the malloc debug system output a full trace of all resource 34 | using functions to the given file name. Make sure you rebuild your program 35 | and that you link with the same libcurl you built for this purpose as 36 | described above. 37 | 38 | Run Your Application 39 | 40 | Run your program as usual. Watch the specified memory trace file grow. 41 | 42 | Make your program exit and use the proper libcurl cleanup functions etc. So 43 | that all non-leaks are returned/freed properly. 44 | 45 | Analyze the Flow 46 | 47 | Use the tests/memanalyze.pl perl script to analyze the dump file: 48 | 49 | tests/memanalyze.pl dump 50 | 51 | This now outputs a report on what resources that were allocated but never 52 | freed etc. This report is very fine for posting to the list! 53 | 54 | If this doesn't produce any output, no leak was detected in libcurl. Then 55 | the leak is mostly likely to be in your code. 56 | -------------------------------------------------------------------------------- /dependencies/curl/lib/README.pingpong: -------------------------------------------------------------------------------- 1 | Date: December 5, 2009 2 | 3 | Pingpong 4 | ======== 5 | 6 | Pingpong is just my (Daniel's) jestful collective name on the protocols that 7 | share a very similar kind of back-and-forth procedure with command and 8 | responses to and from the server. FTP was previously the only protocol in 9 | that family that libcurl supported, but when POP3, IMAP and SMTP joined the 10 | team I moved some of the internals into a separate pingpong module to be 11 | easier to get used by all these protocols to reduce code duplication and ease 12 | code re-use between these protocols. 13 | 14 | FTP 15 | 16 | In 7.20.0 we converted code to use the new pingpong code from previously 17 | having been all "native" FTP code. 18 | 19 | POP3 20 | 21 | There's no support in the documented URL format to specify the exact mail to 22 | get, but we support that as the path specified in the URL. 23 | 24 | IMAP 25 | 26 | SMTP 27 | 28 | There's no official URL syntax defined for SMTP, but we use only the generic 29 | one and we provide two additional libcurl options to specify receivers and 30 | sender of the actual mail. 31 | -------------------------------------------------------------------------------- /dependencies/curl/lib/README.pipelining: -------------------------------------------------------------------------------- 1 | HTTP Pipelining with libcurl 2 | ============================ 3 | 4 | Background 5 | 6 | Since pipelining implies that one or more requests are sent to a server before 7 | the previous response(s) have been received, we only support it for multi 8 | interface use. 9 | 10 | Considerations 11 | 12 | When using the multi interface, you create one easy handle for each transfer. 13 | Bascially any number of handles can be created, added and used with the multi 14 | interface - simultaneously. It is an interface designed to allow many 15 | simultaneous transfers while still using a single thread. Pipelining does not 16 | change any of these details. 17 | 18 | API 19 | 20 | We've added a new option to curl_multi_setopt() called CURLMOPT_PIPELINING 21 | that enables "attempted pipelining" and then all easy handles used on that 22 | handle will attempt to use an existing pipeline. 23 | 24 | Details 25 | 26 | - A pipeline is only created if a previous connection exists to the same IP 27 | address that the new request is being made to use. 28 | 29 | - Pipelines are only supported for HTTP(S) as no other currently supported 30 | protocol has features resemembling this, but we still name this feature 31 | plain 'pipelining' to possibly one day support it for other protocols as 32 | well. 33 | 34 | - HTTP Pipelining is for GET and HEAD requests only. 35 | 36 | - When a pipeline is in use, we must take precautions so that when used easy 37 | handles (i.e those who still wait for a response) are removed from the multi 38 | handle, we must deal with the outstanding response nicely. 39 | 40 | - Explicitly asking for pipelining handle X and handle Y won't be supported. 41 | It isn't easy for an app to do this association. The lib should probably 42 | still resolve the second one properly to make sure that they actually _can_ 43 | be considered for pipelining. Also, asking for explicit pipelining on handle 44 | X may be tricky when handle X get a closed connection. 45 | -------------------------------------------------------------------------------- /dependencies/curl/lib/amigaos.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * _ _ ____ _ 3 | * Project ___| | | | _ \| | 4 | * / __| | | | |_) | | 5 | * | (__| |_| | _ <| |___ 6 | * \___|\___/|_| \_\_____| 7 | * 8 | * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. 9 | * 10 | * This software is licensed as described in the file COPYING, which 11 | * you should have received as part of this distribution. The terms 12 | * are also available at http://curl.haxx.se/docs/copyright.html. 13 | * 14 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 15 | * copies of the Software, and permit persons to whom the Software is 16 | * furnished to do so, under the terms of the COPYING file. 17 | * 18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 19 | * KIND, either express or implied. 20 | * 21 | ***************************************************************************/ 22 | 23 | #include "curl_setup.h" 24 | 25 | #if defined(__AMIGA__) && !defined(__ixemul__) 26 | 27 | #include 28 | 29 | #include "amigaos.h" 30 | 31 | struct Library *SocketBase = NULL; 32 | extern int errno, h_errno; 33 | 34 | #ifdef __libnix__ 35 | #include 36 | void __request(const char *msg); 37 | #else 38 | # define __request( msg ) Printf( msg "\n\a") 39 | #endif 40 | 41 | void Curl_amiga_cleanup() 42 | { 43 | if(SocketBase) { 44 | CloseLibrary(SocketBase); 45 | SocketBase = NULL; 46 | } 47 | } 48 | 49 | bool Curl_amiga_init() 50 | { 51 | if(!SocketBase) 52 | SocketBase = OpenLibrary("bsdsocket.library", 4); 53 | 54 | if(!SocketBase) { 55 | __request("No TCP/IP Stack running!"); 56 | return FALSE; 57 | } 58 | 59 | if(SocketBaseTags(SBTM_SETVAL(SBTC_ERRNOPTR(sizeof(errno))), (ULONG) &errno, 60 | SBTM_SETVAL(SBTC_LOGTAGPTR), (ULONG) "cURL", 61 | TAG_DONE)) { 62 | __request("SocketBaseTags ERROR"); 63 | return FALSE; 64 | } 65 | 66 | #ifndef __libnix__ 67 | atexit(Curl_amiga_cleanup); 68 | #endif 69 | 70 | return TRUE; 71 | } 72 | 73 | #ifdef __libnix__ 74 | ADD2EXIT(Curl_amiga_cleanup,-50); 75 | #endif 76 | 77 | #endif /* __AMIGA__ && ! __ixemul__ */ 78 | -------------------------------------------------------------------------------- /dependencies/curl/lib/amigaos.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_AMIGAOS_H 2 | #define HEADER_CURL_AMIGAOS_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | #include "curl_setup.h" 25 | 26 | #if defined(__AMIGA__) && !defined(__ixemul__) 27 | 28 | bool Curl_amiga_init(); 29 | void Curl_amiga_cleanup(); 30 | 31 | #else 32 | 33 | #define Curl_amiga_init() 1 34 | #define Curl_amiga_cleanup() Curl_nop_stmt 35 | 36 | #endif 37 | 38 | #endif /* HEADER_CURL_AMIGAOS_H */ 39 | 40 | -------------------------------------------------------------------------------- /dependencies/curl/lib/bundles.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_BUNDLES_H 2 | #define HEADER_CURL_BUNDLES_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 2012, Linus Nielsen Feltzing, 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | struct connectbundle { 26 | bool server_supports_pipelining; /* TRUE if server supports pipelining, 27 | set after first response */ 28 | size_t num_connections; /* Number of connections in the bundle */ 29 | struct curl_llist *conn_list; /* The connectdata members of the bundle */ 30 | }; 31 | 32 | CURLcode Curl_bundle_create(struct SessionHandle *data, 33 | struct connectbundle **cb_ptr); 34 | 35 | void Curl_bundle_destroy(struct connectbundle *cb_ptr); 36 | 37 | CURLcode Curl_bundle_add_conn(struct connectbundle *cb_ptr, 38 | struct connectdata *conn); 39 | 40 | int Curl_bundle_remove_conn(struct connectbundle *cb_ptr, 41 | struct connectdata *conn); 42 | 43 | 44 | #endif /* HEADER_CURL_BUNDLES_H */ 45 | 46 | -------------------------------------------------------------------------------- /dependencies/curl/lib/conncache.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_CONNCACHE_H 2 | #define HEADER_CURL_CONNCACHE_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 2012, 2013, Linus Nielsen Feltzing, 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | struct conncache { 26 | struct curl_hash *hash; 27 | size_t num_connections; 28 | }; 29 | 30 | struct conncache *Curl_conncache_init(void); 31 | 32 | void Curl_conncache_destroy(struct conncache *connc); 33 | 34 | struct connectbundle *Curl_conncache_find_bundle(struct conncache *connc, 35 | char *hostname); 36 | 37 | CURLcode Curl_conncache_add_conn(struct conncache *connc, 38 | struct connectdata *conn); 39 | 40 | void Curl_conncache_remove_conn(struct conncache *connc, 41 | struct connectdata *conn); 42 | 43 | void Curl_conncache_foreach(struct conncache *connc, 44 | void *param, 45 | int (*func)(struct connectdata *conn, 46 | void *param)); 47 | 48 | struct connectdata * 49 | Curl_conncache_find_first_connection(struct conncache *connc); 50 | 51 | void Curl_conncache_print(struct conncache *connc); 52 | 53 | #endif /* HEADER_CURL_CONNCACHE_H */ 54 | -------------------------------------------------------------------------------- /dependencies/curl/lib/content_encoding.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_CONTENT_ENCODING_H 2 | #define HEADER_CURL_CONTENT_ENCODING_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | #include "curl_setup.h" 25 | 26 | /* 27 | * Comma-separated list all supported Content-Encodings ('identity' is implied) 28 | */ 29 | #ifdef HAVE_LIBZ 30 | #define ALL_CONTENT_ENCODINGS "deflate, gzip" 31 | /* force a cleanup */ 32 | void Curl_unencode_cleanup(struct connectdata *conn); 33 | #else 34 | #define ALL_CONTENT_ENCODINGS "identity" 35 | #define Curl_unencode_cleanup(x) Curl_nop_stmt 36 | #endif 37 | 38 | CURLcode Curl_unencode_deflate_write(struct connectdata *conn, 39 | struct SingleRequest *req, 40 | ssize_t nread); 41 | 42 | CURLcode 43 | Curl_unencode_gzip_write(struct connectdata *conn, 44 | struct SingleRequest *k, 45 | ssize_t nread); 46 | 47 | 48 | #endif /* HEADER_CURL_CONTENT_ENCODING_H */ 49 | -------------------------------------------------------------------------------- /dependencies/curl/lib/cookie.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ppy/osu-performance/9f638e05d6ed6a2086b5b115510b1f79ebd39258/dependencies/curl/lib/cookie.c -------------------------------------------------------------------------------- /dependencies/curl/lib/curl_base64.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_BASE64_H 2 | #define HEADER_CURL_BASE64_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | CURLcode Curl_base64_encode(struct SessionHandle *data, 26 | const char *inputbuff, size_t insize, 27 | char **outptr, size_t *outlen); 28 | 29 | CURLcode Curl_base64_decode(const char *src, 30 | unsigned char **outptr, size_t *outlen); 31 | 32 | #endif /* HEADER_CURL_BASE64_H */ 33 | -------------------------------------------------------------------------------- /dependencies/curl/lib/curl_fnmatch.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_FNMATCH_H 2 | #define HEADER_CURL_FNMATCH_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #define CURL_FNMATCH_MATCH 0 26 | #define CURL_FNMATCH_NOMATCH 1 27 | #define CURL_FNMATCH_FAIL 2 28 | 29 | /* default pattern matching function 30 | * ================================= 31 | * Implemented with recursive backtracking, if you want to use Curl_fnmatch, 32 | * please note that there is not implemented UTF/UNICODE support. 33 | * 34 | * Implemented features: 35 | * '?' notation, does not match UTF characters 36 | * '*' can also work with UTF string 37 | * [a-zA-Z0-9] enumeration support 38 | * 39 | * keywords: alnum, digit, xdigit, alpha, print, blank, lower, graph, space 40 | * and upper (use as "[[:alnum:]]") 41 | */ 42 | int Curl_fnmatch(void *ptr, const char *pattern, const char *string); 43 | 44 | #endif /* HEADER_CURL_FNMATCH_H */ 45 | -------------------------------------------------------------------------------- /dependencies/curl/lib/curl_gethostname.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_GETHOSTNAME_H 2 | #define HEADER_CURL_GETHOSTNAME_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | /* Hostname buffer size */ 26 | #define HOSTNAME_MAX 1024 27 | 28 | /* This returns the local machine's un-qualified hostname */ 29 | int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen); 30 | 31 | #endif /* HEADER_CURL_GETHOSTNAME_H */ 32 | -------------------------------------------------------------------------------- /dependencies/curl/lib/curl_gssapi.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_GSSAPI_H 2 | #define HEADER_CURL_GSSAPI_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 2011, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include "curl_setup.h" 26 | #include "urldata.h" 27 | 28 | #ifdef HAVE_GSSAPI 29 | 30 | #ifdef HAVE_GSSGNU 31 | # include 32 | #elif defined HAVE_GSSMIT 33 | /* MIT style */ 34 | # include 35 | # include 36 | # include 37 | #else 38 | /* Heimdal-style */ 39 | # include 40 | #endif 41 | 42 | 43 | /* Common method for using gss api */ 44 | 45 | OM_uint32 Curl_gss_init_sec_context( 46 | struct SessionHandle *data, 47 | OM_uint32 * minor_status, 48 | gss_ctx_id_t * context, 49 | gss_name_t target_name, 50 | gss_channel_bindings_t input_chan_bindings, 51 | gss_buffer_t input_token, 52 | gss_buffer_t output_token, 53 | OM_uint32 * ret_flags); 54 | 55 | #endif /* HAVE_GSSAPI */ 56 | 57 | #endif /* HEADER_CURL_GSSAPI_H */ 58 | -------------------------------------------------------------------------------- /dependencies/curl/lib/curl_ldap.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_LDAP_H 2 | #define HEADER_CURL_LDAP_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | #ifndef CURL_DISABLE_LDAP 25 | extern const struct Curl_handler Curl_handler_ldap; 26 | 27 | #if !defined(CURL_DISABLE_LDAPS) && \ 28 | ((defined(USE_OPENLDAP) && defined(USE_SSL)) || \ 29 | (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL))) 30 | extern const struct Curl_handler Curl_handler_ldaps; 31 | #endif 32 | 33 | #endif 34 | #endif /* HEADER_CURL_LDAP_H */ 35 | 36 | -------------------------------------------------------------------------------- /dependencies/curl/lib/curl_md4.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_MD4_H 2 | #define HEADER_CURL_MD4_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include "curl_setup.h" 26 | 27 | /* NSS crypto library does not provide the MD4 hash algorithm, so that we have 28 | * a local implementation of it */ 29 | #ifdef USE_NSS 30 | void Curl_md4it(unsigned char *output, const unsigned char *input, size_t len); 31 | #endif /* USE_NSS */ 32 | 33 | #endif /* HEADER_CURL_MD4_H */ 34 | -------------------------------------------------------------------------------- /dependencies/curl/lib/curl_memrchr.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * _ _ ____ _ 3 | * Project ___| | | | _ \| | 4 | * / __| | | | |_) | | 5 | * | (__| |_| | _ <| |___ 6 | * \___|\___/|_| \_\_____| 7 | * 8 | * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. 9 | * 10 | * This software is licensed as described in the file COPYING, which 11 | * you should have received as part of this distribution. The terms 12 | * are also available at http://curl.haxx.se/docs/copyright.html. 13 | * 14 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 15 | * copies of the Software, and permit persons to whom the Software is 16 | * furnished to do so, under the terms of the COPYING file. 17 | * 18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 19 | * KIND, either express or implied. 20 | * 21 | ***************************************************************************/ 22 | 23 | #include "curl_setup.h" 24 | 25 | #include "curl_memrchr.h" 26 | 27 | #define _MPRINTF_REPLACE /* use our functions only */ 28 | #include 29 | 30 | #include "curl_memory.h" 31 | /* The last #include file should be: */ 32 | #include "memdebug.h" 33 | 34 | #ifndef HAVE_MEMRCHR 35 | 36 | /* 37 | * Curl_memrchr() 38 | * 39 | * Our memrchr() function clone for systems which lack this function. The 40 | * memrchr() function is like the memchr() function, except that it searches 41 | * backwards from the end of the n bytes pointed to by s instead of forward 42 | * from the beginning. 43 | */ 44 | 45 | void * 46 | Curl_memrchr(const void *s, int c, size_t n) 47 | { 48 | const unsigned char *p = s; 49 | const unsigned char *q = s; 50 | 51 | p += n - 1; 52 | 53 | while(p >= q) { 54 | if(*p == (unsigned char)c) 55 | return (void *)p; 56 | p--; 57 | } 58 | 59 | return NULL; 60 | } 61 | 62 | #endif /* HAVE_MEMRCHR */ 63 | -------------------------------------------------------------------------------- /dependencies/curl/lib/curl_memrchr.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_MEMRCHR_H 2 | #define HEADER_CURL_MEMRCHR_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include "curl_setup.h" 26 | 27 | #ifdef HAVE_MEMRCHR 28 | 29 | #ifdef HAVE_STRING_H 30 | # include 31 | #endif 32 | #ifdef HAVE_STRINGS_H 33 | # include 34 | #endif 35 | 36 | #else /* HAVE_MEMRCHR */ 37 | 38 | void *Curl_memrchr(const void *s, int c, size_t n); 39 | 40 | #define memrchr(x,y,z) Curl_memrchr((x),(y),(z)) 41 | 42 | #endif /* HAVE_MEMRCHR */ 43 | 44 | #endif /* HEADER_CURL_MEMRCHR_H */ 45 | -------------------------------------------------------------------------------- /dependencies/curl/lib/curl_ntlm.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_NTLM_H 2 | #define HEADER_CURL_NTLM_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include "curl_setup.h" 26 | 27 | #ifdef USE_NTLM 28 | 29 | /* this is for ntlm header input */ 30 | CURLcode Curl_input_ntlm(struct connectdata *conn, bool proxy, 31 | const char *header); 32 | 33 | /* this is for creating ntlm header output */ 34 | CURLcode Curl_output_ntlm(struct connectdata *conn, bool proxy); 35 | 36 | void Curl_http_ntlm_cleanup(struct connectdata *conn); 37 | 38 | #else 39 | 40 | #define Curl_http_ntlm_cleanup(a) Curl_nop_stmt 41 | 42 | #endif 43 | 44 | #endif /* HEADER_CURL_NTLM_H */ 45 | -------------------------------------------------------------------------------- /dependencies/curl/lib/curl_ntlm_wb.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_NTLM_WB_H 2 | #define HEADER_CURL_NTLM_WB_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include "curl_setup.h" 26 | 27 | #if defined(USE_NTLM) && defined(NTLM_WB_ENABLED) 28 | 29 | /* this is for creating ntlm header output by delegating challenge/response 30 | to Samba's winbind daemon helper ntlm_auth */ 31 | CURLcode Curl_output_ntlm_wb(struct connectdata *conn, bool proxy); 32 | 33 | void Curl_ntlm_wb_cleanup(struct connectdata *conn); 34 | 35 | #endif /* USE_NTLM && NTLM_WB_ENABLED */ 36 | 37 | #endif /* HEADER_CURL_NTLM_WB_H */ 38 | -------------------------------------------------------------------------------- /dependencies/curl/lib/curl_rand.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * _ _ ____ _ 3 | * Project ___| | | | _ \| | 4 | * / __| | | | |_) | | 5 | * | (__| |_| | _ <| |___ 6 | * \___|\___/|_| \_\_____| 7 | * 8 | * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. 9 | * 10 | * This software is licensed as described in the file COPYING, which 11 | * you should have received as part of this distribution. The terms 12 | * are also available at http://curl.haxx.se/docs/copyright.html. 13 | * 14 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 15 | * copies of the Software, and permit persons to whom the Software is 16 | * furnished to do so, under the terms of the COPYING file. 17 | * 18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 19 | * KIND, either express or implied. 20 | * 21 | ***************************************************************************/ 22 | 23 | #include "curl_setup.h" 24 | 25 | #include 26 | 27 | #include "curl_rand.h" 28 | 29 | #define _MPRINTF_REPLACE /* use our functions only */ 30 | #include 31 | 32 | #include "curl_memory.h" 33 | /* The last #include file should be: */ 34 | #include "memdebug.h" 35 | 36 | /* Private pseudo-random number seed. Unsigned integer >= 32bit. Threads 37 | mutual exclusion is not implemented to acess it since we do not require 38 | high quality random numbers (only used in form boudary generation). */ 39 | 40 | static unsigned int randseed; 41 | 42 | /* Pseudo-random number support. */ 43 | 44 | unsigned int Curl_rand(void) 45 | { 46 | unsigned int r; 47 | /* Return an unsigned 32-bit pseudo-random number. */ 48 | r = randseed = randseed * 1103515245 + 12345; 49 | return (r << 16) | ((r >> 16) & 0xFFFF); 50 | } 51 | 52 | void Curl_srand(void) 53 | { 54 | /* Randomize pseudo-random number sequence. */ 55 | 56 | randseed = (unsigned int) time(NULL); 57 | Curl_rand(); 58 | Curl_rand(); 59 | Curl_rand(); 60 | } 61 | 62 | -------------------------------------------------------------------------------- /dependencies/curl/lib/curl_rand.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_RAND_H 2 | #define HEADER_CURL_RAND_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | void Curl_srand(void); 26 | 27 | unsigned int Curl_rand(void); 28 | 29 | #endif /* HEADER_CURL_RAND_H */ 30 | -------------------------------------------------------------------------------- /dependencies/curl/lib/curl_rtmp.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_RTMP_H 2 | #define HEADER_CURL_RTMP_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 2010, Howard Chu, 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | #ifdef USE_LIBRTMP 25 | extern const struct Curl_handler Curl_handler_rtmp; 26 | extern const struct Curl_handler Curl_handler_rtmpt; 27 | extern const struct Curl_handler Curl_handler_rtmpe; 28 | extern const struct Curl_handler Curl_handler_rtmpte; 29 | extern const struct Curl_handler Curl_handler_rtmps; 30 | extern const struct Curl_handler Curl_handler_rtmpts; 31 | #endif 32 | 33 | #endif /* HEADER_CURL_RTMP_H */ 34 | -------------------------------------------------------------------------------- /dependencies/curl/lib/curl_threads.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_THREADS_H 2 | #define HEADER_CURL_THREADS_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | #include "curl_setup.h" 25 | 26 | #if defined(USE_THREADS_POSIX) 27 | # define CURL_STDCALL 28 | # define curl_mutex_t pthread_mutex_t 29 | # define curl_thread_t pthread_t 30 | # define curl_thread_t_null (pthread_t)0 31 | # define Curl_mutex_init(m) pthread_mutex_init(m, NULL) 32 | # define Curl_mutex_acquire(m) pthread_mutex_lock(m) 33 | # define Curl_mutex_release(m) pthread_mutex_unlock(m) 34 | # define Curl_mutex_destroy(m) pthread_mutex_destroy(m) 35 | #elif defined(USE_THREADS_WIN32) 36 | # define CURL_STDCALL __stdcall 37 | # define curl_mutex_t CRITICAL_SECTION 38 | # define curl_thread_t HANDLE 39 | # define curl_thread_t_null (HANDLE)0 40 | # define Curl_mutex_init(m) InitializeCriticalSection(m) 41 | # define Curl_mutex_acquire(m) EnterCriticalSection(m) 42 | # define Curl_mutex_release(m) LeaveCriticalSection(m) 43 | # define Curl_mutex_destroy(m) DeleteCriticalSection(m) 44 | #endif 45 | 46 | #if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) 47 | 48 | curl_thread_t Curl_thread_create(unsigned int (CURL_STDCALL *func) (void*), 49 | void *arg); 50 | 51 | void Curl_thread_destroy(curl_thread_t hnd); 52 | 53 | int Curl_thread_join(curl_thread_t *hnd); 54 | 55 | #endif /* USE_THREADS_POSIX || USE_THREADS_WIN32 */ 56 | 57 | #endif /* HEADER_CURL_THREADS_H */ 58 | -------------------------------------------------------------------------------- /dependencies/curl/lib/dict.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_DICT_H 2 | #define HEADER_CURL_DICT_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #ifndef CURL_DISABLE_DICT 26 | extern const struct Curl_handler Curl_handler_dict; 27 | #endif 28 | 29 | #endif /* HEADER_CURL_DICT_H */ 30 | -------------------------------------------------------------------------------- /dependencies/curl/lib/easyif.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_EASYIF_H 2 | #define HEADER_CURL_EASYIF_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | /* 26 | * Prototypes for library-wide functions provided by easy.c 27 | */ 28 | void Curl_easy_addmulti(struct SessionHandle *data, void *multi); 29 | 30 | void Curl_easy_initHandleData(struct SessionHandle *data); 31 | 32 | #endif /* HEADER_CURL_EASYIF_H */ 33 | 34 | -------------------------------------------------------------------------------- /dependencies/curl/lib/escape.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_ESCAPE_H 2 | #define HEADER_CURL_ESCAPE_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | /* Escape and unescape URL encoding in strings. The functions return a new 25 | * allocated string or NULL if an error occurred. */ 26 | 27 | CURLcode Curl_urldecode(struct SessionHandle *data, 28 | const char *string, size_t length, 29 | char **ostring, size_t *olen, 30 | bool reject_crlf); 31 | 32 | #endif /* HEADER_CURL_ESCAPE_H */ 33 | 34 | -------------------------------------------------------------------------------- /dependencies/curl/lib/file.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_FILE_H 2 | #define HEADER_CURL_FILE_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | 26 | /**************************************************************************** 27 | * FILE unique setup 28 | ***************************************************************************/ 29 | struct FILEPROTO { 30 | char *path; /* the path we operate on */ 31 | char *freepath; /* pointer to the allocated block we must free, this might 32 | differ from the 'path' pointer */ 33 | int fd; /* open file descriptor to read from! */ 34 | }; 35 | 36 | #ifndef CURL_DISABLE_FILE 37 | extern const struct Curl_handler Curl_handler_file; 38 | #endif 39 | 40 | #endif /* HEADER_CURL_FILE_H */ 41 | 42 | -------------------------------------------------------------------------------- /dependencies/curl/lib/fileinfo.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * _ _ ____ _ 3 | * Project ___| | | | _ \| | 4 | * / __| | | | |_) | | 5 | * | (__| |_| | _ <| |___ 6 | * \___|\___/|_| \_\_____| 7 | * 8 | * Copyright (C) 2010-2011, Daniel Stenberg, , et al. 9 | * 10 | * This software is licensed as described in the file COPYING, which 11 | * you should have received as part of this distribution. The terms 12 | * are also available at http://curl.haxx.se/docs/copyright.html. 13 | * 14 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 15 | * copies of the Software, and permit persons to whom the Software is 16 | * furnished to do so, under the terms of the COPYING file. 17 | * 18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 19 | * KIND, either express or implied. 20 | * 21 | ***************************************************************************/ 22 | 23 | #include "curl_setup.h" 24 | 25 | #include "strdup.h" 26 | #include "fileinfo.h" 27 | 28 | #define _MPRINTF_REPLACE /* use our functions only */ 29 | #include 30 | 31 | #include "curl_memory.h" 32 | /* The last #include file should be: */ 33 | #include "memdebug.h" 34 | 35 | struct curl_fileinfo *Curl_fileinfo_alloc(void) 36 | { 37 | struct curl_fileinfo *tmp = malloc(sizeof(struct curl_fileinfo)); 38 | if(!tmp) 39 | return NULL; 40 | memset(tmp, 0, sizeof(struct curl_fileinfo)); 41 | return tmp; 42 | } 43 | 44 | void Curl_fileinfo_dtor(void *user, void *element) 45 | { 46 | struct curl_fileinfo *finfo = element; 47 | (void) user; 48 | if(!finfo) 49 | return; 50 | 51 | Curl_safefree(finfo->b_data); 52 | 53 | free(finfo); 54 | } 55 | -------------------------------------------------------------------------------- /dependencies/curl/lib/fileinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_FILEINFO_H 2 | #define HEADER_CURL_FILEINFO_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 2010, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include 26 | 27 | struct curl_fileinfo *Curl_fileinfo_alloc(void); 28 | 29 | void Curl_fileinfo_dtor(void *, void *); 30 | 31 | struct curl_fileinfo *Curl_fileinfo_dup(const struct curl_fileinfo *src); 32 | 33 | #endif /* HEADER_CURL_FILEINFO_H */ 34 | -------------------------------------------------------------------------------- /dependencies/curl/lib/firefox-db2pem.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # *************************************************************************** 3 | # * _ _ ____ _ 4 | # * Project ___| | | | _ \| | 5 | # * / __| | | | |_) | | 6 | # * | (__| |_| | _ <| |___ 7 | # * \___|\___/|_| \_\_____| 8 | # * 9 | # * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. 10 | # * 11 | # * This software is licensed as described in the file COPYING, which 12 | # * you should have received as part of this distribution. The terms 13 | # * are also available at http://curl.haxx.se/docs/copyright.html. 14 | # * 15 | # * You may opt to use, copy, modify, merge, publish, distribute and/or sell 16 | # * copies of the Software, and permit persons to whom the Software is 17 | # * furnished to do so, under the terms of the COPYING file. 18 | # * 19 | # * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 20 | # * KIND, either express or implied. 21 | # * 22 | # *************************************************************************** 23 | # This shell script creates a fresh ca-bundle.crt file for use with libcurl. 24 | # It extracts all ca certs it finds in the local Firefox database and converts 25 | # them all into PEM format. 26 | # 27 | db=`ls -1d $HOME/.mozilla/firefox/*default` 28 | out=$1 29 | 30 | if test -z "$out"; then 31 | out="ca-bundle.crt" # use a sensible default 32 | fi 33 | 34 | currentdate=`date` 35 | 36 | cat >$out <> $out 54 | 55 | -------------------------------------------------------------------------------- /dependencies/curl/lib/ftplistparser.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_FTPLISTPARSER_H 2 | #define HEADER_CURL_FTPLISTPARSER_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | #include "curl_setup.h" 25 | 26 | #ifndef CURL_DISABLE_FTP 27 | 28 | /* WRITEFUNCTION callback for parsing LIST responses */ 29 | size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb, 30 | void *connptr); 31 | 32 | struct ftp_parselist_data; /* defined inside ftplibparser.c */ 33 | 34 | CURLcode Curl_ftp_parselist_geterror(struct ftp_parselist_data *pl_data); 35 | 36 | struct ftp_parselist_data *Curl_ftp_parselist_data_alloc(void); 37 | 38 | void Curl_ftp_parselist_data_free(struct ftp_parselist_data **pl_data); 39 | 40 | #endif /* CURL_DISABLE_FTP */ 41 | #endif /* HEADER_CURL_FTPLISTPARSER_H */ 42 | -------------------------------------------------------------------------------- /dependencies/curl/lib/getenv.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * _ _ ____ _ 3 | * Project ___| | | | _ \| | 4 | * / __| | | | |_) | | 5 | * | (__| |_| | _ <| |___ 6 | * \___|\___/|_| \_\_____| 7 | * 8 | * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. 9 | * 10 | * This software is licensed as described in the file COPYING, which 11 | * you should have received as part of this distribution. The terms 12 | * are also available at http://curl.haxx.se/docs/copyright.html. 13 | * 14 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 15 | * copies of the Software, and permit persons to whom the Software is 16 | * furnished to do so, under the terms of the COPYING file. 17 | * 18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 19 | * KIND, either express or implied. 20 | * 21 | ***************************************************************************/ 22 | 23 | #include "curl_setup.h" 24 | 25 | #include 26 | #include "curl_memory.h" 27 | 28 | #include "memdebug.h" 29 | 30 | static 31 | char *GetEnv(const char *variable) 32 | { 33 | #ifdef _WIN32_WCE 34 | return NULL; 35 | #else 36 | #ifdef WIN32 37 | char env[MAX_PATH]; /* MAX_PATH is from windef.h */ 38 | char *temp = getenv(variable); 39 | env[0] = '\0'; 40 | if(temp != NULL) 41 | ExpandEnvironmentStringsA(temp, env, sizeof(env)); 42 | return (env[0] != '\0')?strdup(env):NULL; 43 | #else 44 | char *env = getenv(variable); 45 | return (env && env[0])?strdup(env):NULL; 46 | #endif 47 | #endif 48 | } 49 | 50 | char *curl_getenv(const char *v) 51 | { 52 | return GetEnv(v); 53 | } 54 | -------------------------------------------------------------------------------- /dependencies/curl/lib/getinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_GETINFO_H 2 | #define HEADER_CURL_GETINFO_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...); 25 | CURLcode Curl_initinfo(struct SessionHandle *data); 26 | 27 | #endif /* HEADER_CURL_GETINFO_H */ 28 | -------------------------------------------------------------------------------- /dependencies/curl/lib/gopher.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_GOPHER_H 2 | #define HEADER_CURL_GOPHER_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #ifndef CURL_DISABLE_GOPHER 26 | extern const struct Curl_handler Curl_handler_gopher; 27 | #endif 28 | 29 | #endif /* HEADER_CURL_GOPHER_H */ 30 | -------------------------------------------------------------------------------- /dependencies/curl/lib/hostcheck.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_HOSTCHECK_H 2 | #define HEADER_CURL_HOSTCHECK_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include 26 | 27 | #define CURL_HOST_NOMATCH 0 28 | #define CURL_HOST_MATCH 1 29 | int Curl_cert_hostcheck(const char *match_pattern, const char *hostname); 30 | 31 | #endif /* HEADER_CURL_HOSTCHECK_H */ 32 | 33 | -------------------------------------------------------------------------------- /dependencies/curl/lib/hostsyn.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * _ _ ____ _ 3 | * Project ___| | | | _ \| | 4 | * / __| | | | |_) | | 5 | * | (__| |_| | _ <| |___ 6 | * \___|\___/|_| \_\_____| 7 | * 8 | * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. 9 | * 10 | * This software is licensed as described in the file COPYING, which 11 | * you should have received as part of this distribution. The terms 12 | * are also available at http://curl.haxx.se/docs/copyright.html. 13 | * 14 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 15 | * copies of the Software, and permit persons to whom the Software is 16 | * furnished to do so, under the terms of the COPYING file. 17 | * 18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 19 | * KIND, either express or implied. 20 | * 21 | ***************************************************************************/ 22 | 23 | #include "curl_setup.h" 24 | 25 | #ifdef HAVE_NETINET_IN_H 26 | #include 27 | #endif 28 | #ifdef HAVE_NETDB_H 29 | #include 30 | #endif 31 | #ifdef HAVE_ARPA_INET_H 32 | #include 33 | #endif 34 | #ifdef __VMS 35 | #include 36 | #include 37 | #endif 38 | 39 | #ifdef HAVE_PROCESS_H 40 | #include 41 | #endif 42 | 43 | #include "urldata.h" 44 | #include "sendf.h" 45 | #include "hostip.h" 46 | #include "hash.h" 47 | #include "share.h" 48 | #include "strerror.h" 49 | #include "url.h" 50 | 51 | #define _MPRINTF_REPLACE /* use our functions only */ 52 | #include 53 | 54 | #include "curl_memory.h" 55 | /* The last #include file should be: */ 56 | #include "memdebug.h" 57 | 58 | /*********************************************************************** 59 | * Only for builds using synchronous name resolves 60 | **********************************************************************/ 61 | #ifdef CURLRES_SYNCH 62 | 63 | /* 64 | * Function provided by the resolver backend to set DNS servers to use. 65 | */ 66 | CURLcode Curl_set_dns_servers(struct SessionHandle *data, 67 | char *servers) 68 | { 69 | (void)data; 70 | (void)servers; 71 | return CURLE_NOT_BUILT_IN; 72 | 73 | } 74 | 75 | #endif /* truly sync */ 76 | -------------------------------------------------------------------------------- /dependencies/curl/lib/http_digest.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_HTTP_DIGEST_H 2 | #define HEADER_CURL_HTTP_DIGEST_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | #include "curl_setup.h" 25 | 26 | typedef enum { 27 | CURLDIGEST_NONE, /* not a digest */ 28 | CURLDIGEST_BAD, /* a digest, but one we don't like */ 29 | CURLDIGEST_BADALGO, /* unsupported algorithm requested */ 30 | CURLDIGEST_NOMEM, 31 | CURLDIGEST_FINE, /* a digest we act on */ 32 | 33 | CURLDIGEST_LAST /* last entry in this enum, don't use */ 34 | } CURLdigest; 35 | 36 | enum { 37 | CURLDIGESTALGO_MD5, 38 | CURLDIGESTALGO_MD5SESS 39 | }; 40 | 41 | /* this is for digest header input */ 42 | CURLdigest Curl_input_digest(struct connectdata *conn, 43 | bool proxy, const char *header); 44 | 45 | /* this is for creating digest header output */ 46 | CURLcode Curl_output_digest(struct connectdata *conn, 47 | bool proxy, 48 | const unsigned char *request, 49 | const unsigned char *uripath); 50 | 51 | #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_CRYPTO_AUTH) 52 | void Curl_digest_cleanup(struct SessionHandle *data); 53 | #else 54 | #define Curl_digest_cleanup(x) Curl_nop_stmt 55 | #endif 56 | 57 | #endif /* HEADER_CURL_HTTP_DIGEST_H */ 58 | -------------------------------------------------------------------------------- /dependencies/curl/lib/http_negotiate.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_HTTP_NEGOTIATE_H 2 | #define HEADER_CURL_HTTP_NEGOTIATE_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #ifdef USE_HTTP_NEGOTIATE 26 | 27 | /* this is for Negotiate header input */ 28 | int Curl_input_negotiate(struct connectdata *conn, bool proxy, 29 | const char *header); 30 | 31 | /* this is for creating Negotiate header output */ 32 | CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy); 33 | 34 | void Curl_cleanup_negotiate(struct SessionHandle *data); 35 | 36 | #ifdef USE_WINDOWS_SSPI 37 | #define GSS_ERROR(status) (status & 0x80000000) 38 | #endif 39 | 40 | #endif /* USE_HTTP_NEGOTIATE */ 41 | 42 | #endif /* HEADER_CURL_HTTP_NEGOTIATE_H */ 43 | -------------------------------------------------------------------------------- /dependencies/curl/lib/http_proxy.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_HTTP_PROXY_H 2 | #define HEADER_CURL_HTTP_PROXY_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP) 26 | /* ftp can use this as well */ 27 | CURLcode Curl_proxyCONNECT(struct connectdata *conn, 28 | int tunnelsocket, 29 | const char *hostname, unsigned short remote_port); 30 | 31 | /* Default proxy timeout in milliseconds */ 32 | #define PROXY_TIMEOUT (3600*1000) 33 | 34 | CURLcode Curl_proxy_connect(struct connectdata *conn); 35 | 36 | #else 37 | #define Curl_proxyCONNECT(x,y,z,w) CURLE_NOT_BUILT_IN 38 | #define Curl_proxy_connect(x) CURLE_OK 39 | #endif 40 | 41 | #endif /* HEADER_CURL_HTTP_PROXY_H */ 42 | -------------------------------------------------------------------------------- /dependencies/curl/lib/inet_ntop.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_INET_NTOP_H 2 | #define HEADER_CURL_INET_NTOP_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include "curl_setup.h" 26 | 27 | char *Curl_inet_ntop(int af, const void *addr, char *buf, size_t size); 28 | 29 | #ifdef HAVE_INET_NTOP 30 | #ifdef HAVE_ARPA_INET_H 31 | #include 32 | #endif 33 | #define Curl_inet_ntop(af,addr,buf,size) \ 34 | inet_ntop(af,addr,buf,(curl_socklen_t)size) 35 | #endif 36 | 37 | #endif /* HEADER_CURL_INET_NTOP_H */ 38 | 39 | -------------------------------------------------------------------------------- /dependencies/curl/lib/inet_pton.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_INET_PTON_H 2 | #define HEADER_CURL_INET_PTON_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include "curl_setup.h" 26 | 27 | int Curl_inet_pton(int, const char *, void *); 28 | 29 | #ifdef HAVE_INET_PTON 30 | #ifdef HAVE_ARPA_INET_H 31 | #include 32 | #endif 33 | #define Curl_inet_pton(x,y,z) inet_pton(x,y,z) 34 | #endif 35 | 36 | #endif /* HEADER_CURL_INET_PTON_H */ 37 | 38 | -------------------------------------------------------------------------------- /dependencies/curl/lib/krb4.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ppy/osu-performance/9f638e05d6ed6a2086b5b115510b1f79ebd39258/dependencies/curl/lib/krb4.c -------------------------------------------------------------------------------- /dependencies/curl/lib/krb4.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_KRB4_H 2 | #define HEADER_CURL_KRB4_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | struct Curl_sec_client_mech { 26 | const char *name; 27 | size_t size; 28 | int (*init)(void *); 29 | int (*auth)(void *, struct connectdata *); 30 | void (*end)(void *); 31 | int (*check_prot)(void *, int); 32 | int (*overhead)(void *, int, int); 33 | int (*encode)(void *, const void*, int, int, void**, struct connectdata *); 34 | int (*decode)(void *, void*, int, int, struct connectdata *); 35 | }; 36 | 37 | 38 | #define AUTH_OK 0 39 | #define AUTH_CONTINUE 1 40 | #define AUTH_ERROR 2 41 | 42 | #ifdef HAVE_KRB4 43 | extern struct Curl_sec_client_mech Curl_krb4_client_mech; 44 | #endif 45 | #ifdef HAVE_GSSAPI 46 | extern struct Curl_sec_client_mech Curl_krb5_client_mech; 47 | #endif 48 | 49 | CURLcode Curl_krb_kauth(struct connectdata *conn); 50 | int Curl_sec_read_msg (struct connectdata *conn, char *, 51 | enum protection_level); 52 | void Curl_sec_end (struct connectdata *); 53 | CURLcode Curl_sec_login (struct connectdata *); 54 | int Curl_sec_request_prot (struct connectdata *conn, const char *level); 55 | 56 | #endif /* HEADER_CURL_KRB4_H */ 57 | 58 | -------------------------------------------------------------------------------- /dependencies/curl/lib/krb5.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ppy/osu-performance/9f638e05d6ed6a2086b5b115510b1f79ebd39258/dependencies/curl/lib/krb5.c -------------------------------------------------------------------------------- /dependencies/curl/lib/libcurl.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ppy/osu-performance/9f638e05d6ed6a2086b5b115510b1f79ebd39258/dependencies/curl/lib/libcurl.lib -------------------------------------------------------------------------------- /dependencies/curl/lib/libcurl.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleInfoDictionaryVersion 6 | 6.0 7 | 8 | CFBundleDevelopmentRegion 9 | English 10 | 11 | CFBundleExecutable 12 | curl 13 | 14 | CFBundleIdentifier 15 | se.haxx.curl.libcurl 16 | 17 | CFBundleVersion 18 | 7.30.0 19 | 20 | CFBundleName 21 | libcurl 22 | 23 | CFBundlePackageType 24 | FMWK 25 | 26 | CFBundleSignature 27 | ???? 28 | 29 | CFBundleShortVersionString 30 | libcurl 7.30.0 31 | 32 | CFBundleGetInfoString 33 | libcurl.plist 7.30.0 34 | 35 | 36 | -------------------------------------------------------------------------------- /dependencies/curl/lib/libcurl.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ppy/osu-performance/9f638e05d6ed6a2086b5b115510b1f79ebd39258/dependencies/curl/lib/libcurl.rc -------------------------------------------------------------------------------- /dependencies/curl/lib/libcurl.vers.in: -------------------------------------------------------------------------------- 1 | HIDDEN 2 | { 3 | local: 4 | __*; 5 | _rest*; 6 | _save*; 7 | }; 8 | 9 | CURL_@CURL_LT_SHLIB_VERSIONED_FLAVOUR@4 10 | { 11 | global: curl_*; 12 | local: *; 13 | }; 14 | -------------------------------------------------------------------------------- /dependencies/curl/lib/libcurl32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ppy/osu-performance/9f638e05d6ed6a2086b5b115510b1f79ebd39258/dependencies/curl/lib/libcurl32.lib -------------------------------------------------------------------------------- /dependencies/curl/lib/llist.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_LLIST_H 2 | #define HEADER_CURL_LLIST_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include "curl_setup.h" 26 | #include 27 | 28 | typedef void (*curl_llist_dtor)(void *, void *); 29 | 30 | struct curl_llist_element { 31 | void *ptr; 32 | 33 | struct curl_llist_element *prev; 34 | struct curl_llist_element *next; 35 | }; 36 | 37 | struct curl_llist { 38 | struct curl_llist_element *head; 39 | struct curl_llist_element *tail; 40 | 41 | curl_llist_dtor dtor; 42 | 43 | size_t size; 44 | }; 45 | 46 | struct curl_llist *Curl_llist_alloc(curl_llist_dtor); 47 | int Curl_llist_insert_next(struct curl_llist *, struct curl_llist_element *, 48 | const void *); 49 | int Curl_llist_remove(struct curl_llist *, struct curl_llist_element *, 50 | void *); 51 | size_t Curl_llist_count(struct curl_llist *); 52 | void Curl_llist_destroy(struct curl_llist *, void *); 53 | int Curl_llist_move(struct curl_llist *, struct curl_llist_element *, 54 | struct curl_llist *, struct curl_llist_element *); 55 | 56 | #endif /* HEADER_CURL_LLIST_H */ 57 | 58 | -------------------------------------------------------------------------------- /dependencies/curl/lib/makefile.amiga: -------------------------------------------------------------------------------- 1 | # 2 | # libcurl Makefile for AmigaOS ... 3 | # 4 | 5 | # change the follow to where you have the AmiTCP SDK v4.3 includes: 6 | 7 | ATCPSDKI= /GG/netinclude 8 | 9 | 10 | CC = m68k-amigaos-gcc 11 | CFLAGS = -I$(ATCPSDKI) -m68020-60 -O2 -msoft-float -noixemul -g -I. -I../include -W -Wall 12 | 13 | include Makefile.inc 14 | OBJS = $(CSOURCES:.c=.o) 15 | 16 | all: $(OBJS) 17 | ar cru libcurl.a $(OBJS) 18 | ranlib libcurl.a 19 | 20 | install: 21 | $(INSTALL) -c ./libcurl.a /lib/libcurl.a 22 | -------------------------------------------------------------------------------- /dependencies/curl/lib/makefile.dj: -------------------------------------------------------------------------------- 1 | # 2 | # Adapted for djgpp2 / Watt-32 / DOS by 3 | # Gisle Vanem 4 | # 5 | 6 | DEPEND_PREREQ = curl_config.h 7 | TOPDIR = .. 8 | 9 | include ../packages/DOS/common.dj 10 | include Makefile.inc 11 | 12 | OBJECTS := $(patsubst %.c,$(OBJ_DIR)/%.o,$(strip $(CSOURCES))) 13 | 14 | CURL_LIB = libcurl.a 15 | 16 | # NOTE: if ../include/curl/curlbuild.h is missing, you're probably building 17 | # this from a git checkout and then you need to run buildconf.bat first. 18 | 19 | all: $(OBJ_DIR) curl_config.h $(CURL_LIB) 20 | 21 | $(CURL_LIB): $(OBJECTS) 22 | ar rs $@ $? 23 | 24 | curl_config.h: config-dos.h 25 | $(COPY) $^ $@ 26 | 27 | # clean generated files 28 | # 29 | genclean: 30 | - $(DELETE) curl_config.h 31 | 32 | # clean object files and subdir 33 | # 34 | objclean: genclean 35 | - $(DELETE) $(OBJ_DIR)$(DS)*.o 36 | - $(RMDIR) $(OBJ_DIR) 37 | 38 | # clean without removing built library 39 | # 40 | clean: objclean 41 | - $(DELETE) depend.dj 42 | 43 | # clean everything 44 | # 45 | realclean vclean: clean 46 | - $(DELETE) $(CURL_LIB) 47 | 48 | -include depend.dj 49 | 50 | -------------------------------------------------------------------------------- /dependencies/curl/lib/netrc.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_NETRC_H 2 | #define HEADER_CURL_NETRC_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | /* Make sure we have room for at least this size: */ 26 | #define LOGINSIZE 64 27 | #define PASSWORDSIZE 64 28 | 29 | /* returns -1 on failure, 0 if the host is found, 1 is the host isn't found */ 30 | int Curl_parsenetrc(const char *host, 31 | char *login, 32 | char *password, 33 | char *filename); 34 | /* Assume: password[0]=0, host[0] != 0. 35 | * If login[0] = 0, search for login and password within a machine section 36 | * in the netrc. 37 | * If login[0] != 0, search for password within machine and login. 38 | */ 39 | 40 | #endif /* HEADER_CURL_NETRC_H */ 41 | -------------------------------------------------------------------------------- /dependencies/curl/lib/nonblock.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_NONBLOCK_H 2 | #define HEADER_CURL_NONBLOCK_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include /* for curl_socket_t */ 26 | 27 | int curlx_nonblock(curl_socket_t sockfd, /* operate on this */ 28 | int nonblock /* TRUE or FALSE */); 29 | 30 | #endif /* HEADER_CURL_NONBLOCK_H */ 31 | 32 | -------------------------------------------------------------------------------- /dependencies/curl/lib/parsedate.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_PARSEDATE_H 2 | #define HEADER_CURL_PARSEDATE_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | extern const char * const Curl_wkday[7]; 26 | extern const char * const Curl_month[12]; 27 | 28 | CURLcode Curl_gmtime(time_t intime, struct tm *store); 29 | 30 | #endif /* HEADER_CURL_PARSEDATE_H */ 31 | 32 | -------------------------------------------------------------------------------- /dependencies/curl/lib/pipeline.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_PIPELINE_H 2 | #define HEADER_CURL_PIPELINE_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 2013, Linus Nielsen Feltzing, 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | CURLcode Curl_add_handle_to_pipeline(struct SessionHandle *handle, 26 | struct connectdata *conn); 27 | void Curl_move_handle_from_send_to_recv_pipe(struct SessionHandle *handle, 28 | struct connectdata *conn); 29 | bool Curl_pipeline_penalized(struct SessionHandle *data, 30 | struct connectdata *conn); 31 | 32 | bool Curl_pipeline_site_blacklisted(struct SessionHandle *handle, 33 | struct connectdata *conn); 34 | 35 | CURLMcode Curl_pipeline_set_site_blacklist(char **sites, 36 | struct curl_llist **list_ptr); 37 | 38 | bool Curl_pipeline_server_blacklisted(struct SessionHandle *handle, 39 | char *server_name); 40 | 41 | CURLMcode Curl_pipeline_set_server_blacklist(char **servers, 42 | struct curl_llist **list_ptr); 43 | 44 | void print_pipeline(struct connectdata *conn); 45 | 46 | #endif /* HEADER_CURL_PIPELINE_H */ 47 | -------------------------------------------------------------------------------- /dependencies/curl/lib/polarssl_threadlock.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_POLARSSL_THREADLOCK_H 2 | #define HEADER_CURL_POLARSSL_THREADLOCK_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 2010, Hoi-Ho Chan, 11 | * Copyright (C) 2013, Daniel Stenberg, , et al. 12 | * 13 | * This software is licensed as described in the file COPYING, which 14 | * you should have received as part of this distribution. The terms 15 | * are also available at http://curl.haxx.se/docs/copyright.html. 16 | * 17 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 18 | * copies of the Software, and permit persons to whom the Software is 19 | * furnished to do so, under the terms of the COPYING file. 20 | * 21 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 22 | * KIND, either express or implied. 23 | * 24 | ***************************************************************************/ 25 | #include "curl_setup.h" 26 | 27 | #ifdef USE_POLARSSL 28 | 29 | #if defined(USE_THREADS_POSIX) 30 | # define POLARSSL_MUTEX_T pthread_mutex_t 31 | #elif defined(USE_THREADS_WIN32) 32 | # define POLARSSL_MUTEX_T HANDLE 33 | #endif 34 | 35 | #if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) 36 | 37 | int polarsslthreadlock_thread_setup(void); 38 | int polarsslthreadlock_thread_cleanup(void); 39 | int polarsslthreadlock_lock_function(int n); 40 | int polarsslthreadlock_unlock_function(int n); 41 | 42 | #else 43 | 44 | #define polarsslthreadlock_thread_setup() 1 45 | #define polarsslthreadlock_thread_cleanup() 1 46 | #define polarsslthreadlock_lock_function(x) 1 47 | #define polarsslthreadlock_unlock_function(x) 1 48 | 49 | #endif /* USE_THREADS_POSIX || USE_THREADS_WIN32 */ 50 | 51 | #endif /* USE_POLARSSL */ 52 | 53 | #endif /* HEADER_CURL_POLARSSL_THREADLOCK_H */ 54 | -------------------------------------------------------------------------------- /dependencies/curl/lib/qssl.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_QSSL_H 2 | #define HEADER_CURL_QSSL_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | #include "curl_setup.h" 25 | 26 | /* 27 | * This header should only be needed to get included by sslgen.c and qssl.c 28 | */ 29 | 30 | #include "urldata.h" 31 | 32 | #ifdef USE_QSOSSL 33 | int Curl_qsossl_init(void); 34 | void Curl_qsossl_cleanup(void); 35 | CURLcode Curl_qsossl_connect(struct connectdata * conn, int sockindex); 36 | void Curl_qsossl_close(struct connectdata *conn, int sockindex); 37 | int Curl_qsossl_close_all(struct SessionHandle * data); 38 | int Curl_qsossl_shutdown(struct connectdata * conn, int sockindex); 39 | 40 | size_t Curl_qsossl_version(char * buffer, size_t size); 41 | int Curl_qsossl_check_cxn(struct connectdata * cxn); 42 | 43 | /* API setup for QsoSSL */ 44 | #define curlssl_init Curl_qsossl_init 45 | #define curlssl_cleanup Curl_qsossl_cleanup 46 | #define curlssl_connect Curl_qsossl_connect 47 | 48 | /* No session handling for QsoSSL */ 49 | #define curlssl_session_free(x) Curl_nop_stmt 50 | #define curlssl_close_all Curl_qsossl_close_all 51 | #define curlssl_close Curl_qsossl_close 52 | #define curlssl_shutdown(x,y) Curl_qsossl_shutdown(x,y) 53 | #define curlssl_set_engine(x,y) CURLE_NOT_BUILT_IN 54 | #define curlssl_set_engine_default(x) CURLE_NOT_BUILT_IN 55 | #define curlssl_engines_list(x) NULL 56 | #define curlssl_version Curl_qsossl_version 57 | #define curlssl_check_cxn(x) Curl_qsossl_check_cxn(x) 58 | #define curlssl_data_pending(x,y) 0 59 | #endif /* USE_QSOSSL */ 60 | 61 | #endif /* HEADER_CURL_QSSL_H */ 62 | -------------------------------------------------------------------------------- /dependencies/curl/lib/rawstr.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_RAWSTR_H 2 | #define HEADER_CURL_RAWSTR_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include 26 | 27 | /* 28 | * Curl_raw_equal() is for doing "raw" case insensitive strings. This is meant 29 | * to be locale independent and only compare strings we know are safe for 30 | * this. 31 | * 32 | * The function is capable of comparing a-z case insensitively even for 33 | * non-ascii. 34 | */ 35 | int Curl_raw_equal(const char *first, const char *second); 36 | int Curl_raw_nequal(const char *first, const char *second, size_t max); 37 | 38 | char Curl_raw_toupper(char in); 39 | 40 | /* checkprefix() is a shorter version of the above, used when the first 41 | argument is zero-byte terminated */ 42 | #define checkprefix(a,b) Curl_raw_nequal(a,b,strlen(a)) 43 | 44 | void Curl_strntoupper(char *dest, const char *src, size_t n); 45 | 46 | #endif /* HEADER_CURL_RAWSTR_H */ 47 | 48 | -------------------------------------------------------------------------------- /dependencies/curl/lib/rtsp.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_RTSP_H 2 | #define HEADER_CURL_RTSP_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | #ifndef CURL_DISABLE_RTSP 25 | 26 | extern const struct Curl_handler Curl_handler_rtsp; 27 | 28 | bool Curl_rtsp_connisdead(struct connectdata *check); 29 | CURLcode Curl_rtsp_parseheader(struct connectdata *conn, char *header); 30 | 31 | #else 32 | /* disabled */ 33 | #define Curl_rtsp_parseheader(x,y) CURLE_NOT_BUILT_IN 34 | #define Curl_rtsp_connisdead(x) TRUE 35 | 36 | #endif /* CURL_DISABLE_RTSP */ 37 | 38 | /* 39 | * RTSP Connection data 40 | * 41 | * Currently, only used for tracking incomplete RTP data reads 42 | */ 43 | struct rtsp_conn { 44 | char *rtp_buf; 45 | ssize_t rtp_bufsize; 46 | int rtp_channel; 47 | }; 48 | 49 | /**************************************************************************** 50 | * RTSP unique setup 51 | ***************************************************************************/ 52 | struct RTSP { 53 | /* 54 | * http_wrapper MUST be the first element of this structure for the wrap 55 | * logic to work. In this way, we get a cheap polymorphism because 56 | * &(data->state.proto.rtsp) == &(data->state.proto.http) per the C spec 57 | * 58 | * HTTP functions can safely treat this as an HTTP struct, but RTSP aware 59 | * functions can also index into the later elements. 60 | */ 61 | struct HTTP http_wrapper; /*wrap HTTP to do the heavy lifting */ 62 | 63 | long CSeq_sent; /* CSeq of this request */ 64 | long CSeq_recv; /* CSeq received */ 65 | }; 66 | 67 | 68 | #endif /* HEADER_CURL_RTSP_H */ 69 | 70 | -------------------------------------------------------------------------------- /dependencies/curl/lib/security.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ppy/osu-performance/9f638e05d6ed6a2086b5b115510b1f79ebd39258/dependencies/curl/lib/security.c -------------------------------------------------------------------------------- /dependencies/curl/lib/share.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_SHARE_H 2 | #define HEADER_CURL_SHARE_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include "curl_setup.h" 26 | #include 27 | #include "cookie.h" 28 | #include "urldata.h" 29 | 30 | /* SalfordC says "A structure member may not be volatile". Hence: 31 | */ 32 | #ifdef __SALFORDC__ 33 | #define CURL_VOLATILE 34 | #else 35 | #define CURL_VOLATILE volatile 36 | #endif 37 | 38 | /* this struct is libcurl-private, don't export details */ 39 | struct Curl_share { 40 | unsigned int specifier; 41 | CURL_VOLATILE unsigned int dirty; 42 | 43 | curl_lock_function lockfunc; 44 | curl_unlock_function unlockfunc; 45 | void *clientdata; 46 | 47 | struct curl_hash *hostcache; 48 | #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) 49 | struct CookieInfo *cookies; 50 | #endif 51 | 52 | struct curl_ssl_session *sslsession; 53 | size_t max_ssl_sessions; 54 | long sessionage; 55 | }; 56 | 57 | CURLSHcode Curl_share_lock (struct SessionHandle *, curl_lock_data, 58 | curl_lock_access); 59 | CURLSHcode Curl_share_unlock (struct SessionHandle *, curl_lock_data); 60 | 61 | #endif /* HEADER_CURL_SHARE_H */ 62 | -------------------------------------------------------------------------------- /dependencies/curl/lib/slist.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_SLIST_H 2 | #define HEADER_CURL_SLIST_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | /* 26 | * Curl_slist_duplicate() duplicates a linked list. It always returns the 27 | * address of the first record of the cloned list or NULL in case of an 28 | * error (or if the input list was NULL). 29 | */ 30 | struct curl_slist *Curl_slist_duplicate(struct curl_slist *inlist); 31 | 32 | #endif /* HEADER_CURL_SLIST_H */ 33 | 34 | -------------------------------------------------------------------------------- /dependencies/curl/lib/sockaddr.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_SOCKADDR_H 2 | #define HEADER_CURL_SOCKADDR_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include "curl_setup.h" 26 | 27 | struct Curl_sockaddr_storage { 28 | union { 29 | struct sockaddr sa; 30 | struct sockaddr_in sa_in; 31 | #ifdef ENABLE_IPV6 32 | struct sockaddr_in6 sa_in6; 33 | #endif 34 | #ifdef HAVE_STRUCT_SOCKADDR_STORAGE 35 | struct sockaddr_storage sa_stor; 36 | #else 37 | char cbuf[256]; /* this should be big enough to fit a lot */ 38 | #endif 39 | } buffer; 40 | }; 41 | 42 | #endif /* HEADER_CURL_SOCKADDR_H */ 43 | 44 | -------------------------------------------------------------------------------- /dependencies/curl/lib/speedcheck.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_SPEEDCHECK_H 2 | #define HEADER_CURL_SPEEDCHECK_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include "curl_setup.h" 26 | 27 | #include "timeval.h" 28 | 29 | void Curl_speedinit(struct SessionHandle *data); 30 | CURLcode Curl_speedcheck(struct SessionHandle *data, 31 | struct timeval now); 32 | 33 | #endif /* HEADER_CURL_SPEEDCHECK_H */ 34 | -------------------------------------------------------------------------------- /dependencies/curl/lib/strdup.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * _ _ ____ _ 3 | * Project ___| | | | _ \| | 4 | * / __| | | | |_) | | 5 | * | (__| |_| | _ <| |___ 6 | * \___|\___/|_| \_\_____| 7 | * 8 | * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. 9 | * 10 | * This software is licensed as described in the file COPYING, which 11 | * you should have received as part of this distribution. The terms 12 | * are also available at http://curl.haxx.se/docs/copyright.html. 13 | * 14 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 15 | * copies of the Software, and permit persons to whom the Software is 16 | * furnished to do so, under the terms of the COPYING file. 17 | * 18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 19 | * KIND, either express or implied. 20 | * 21 | ***************************************************************************/ 22 | /* 23 | * This file is 'mem-include-scan' clean. See test 1132. 24 | */ 25 | #include "curl_setup.h" 26 | 27 | #include "strdup.h" 28 | 29 | #ifndef HAVE_STRDUP 30 | char *curlx_strdup(const char *str) 31 | { 32 | size_t len; 33 | char *newstr; 34 | 35 | if(!str) 36 | return (char *)NULL; 37 | 38 | len = strlen(str); 39 | 40 | if(len >= ((size_t)-1) / sizeof(char)) 41 | return (char *)NULL; 42 | 43 | newstr = malloc((len+1)*sizeof(char)); 44 | if(!newstr) 45 | return (char *)NULL; 46 | 47 | memcpy(newstr,str,(len+1)*sizeof(char)); 48 | 49 | return newstr; 50 | 51 | } 52 | #endif 53 | -------------------------------------------------------------------------------- /dependencies/curl/lib/strdup.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_STRDUP_H 2 | #define HEADER_CURL_STRDUP_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | #include "curl_setup.h" 25 | 26 | #ifndef HAVE_STRDUP 27 | extern char *curlx_strdup(const char *str); 28 | #endif 29 | 30 | #endif /* HEADER_CURL_STRDUP_H */ 31 | -------------------------------------------------------------------------------- /dependencies/curl/lib/strequal.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * _ _ ____ _ 3 | * Project ___| | | | _ \| | 4 | * / __| | | | |_) | | 5 | * | (__| |_| | _ <| |___ 6 | * \___|\___/|_| \_\_____| 7 | * 8 | * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. 9 | * 10 | * This software is licensed as described in the file COPYING, which 11 | * you should have received as part of this distribution. The terms 12 | * are also available at http://curl.haxx.se/docs/copyright.html. 13 | * 14 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 15 | * copies of the Software, and permit persons to whom the Software is 16 | * furnished to do so, under the terms of the COPYING file. 17 | * 18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 19 | * KIND, either express or implied. 20 | * 21 | ***************************************************************************/ 22 | 23 | #include "curl_setup.h" 24 | 25 | #ifdef HAVE_STRINGS_H 26 | #include 27 | #endif 28 | 29 | #include "strequal.h" 30 | 31 | /* 32 | * @unittest: 1301 33 | */ 34 | int curl_strequal(const char *first, const char *second) 35 | { 36 | #if defined(HAVE_STRCASECMP) 37 | return !(strcasecmp)(first, second); 38 | #elif defined(HAVE_STRCMPI) 39 | return !(strcmpi)(first, second); 40 | #elif defined(HAVE_STRICMP) 41 | return !(stricmp)(first, second); 42 | #else 43 | while(*first && *second) { 44 | if(toupper(*first) != toupper(*second)) { 45 | break; 46 | } 47 | first++; 48 | second++; 49 | } 50 | return toupper(*first) == toupper(*second); 51 | #endif 52 | } 53 | 54 | /* 55 | * @unittest: 1301 56 | */ 57 | int curl_strnequal(const char *first, const char *second, size_t max) 58 | { 59 | #if defined(HAVE_STRNCASECMP) 60 | return !strncasecmp(first, second, max); 61 | #elif defined(HAVE_STRNCMPI) 62 | return !strncmpi(first, second, max); 63 | #elif defined(HAVE_STRNICMP) 64 | return !strnicmp(first, second, max); 65 | #else 66 | while(*first && *second && max) { 67 | if(toupper(*first) != toupper(*second)) { 68 | break; 69 | } 70 | max--; 71 | first++; 72 | second++; 73 | } 74 | if(0 == max) 75 | return 1; /* they are equal this far */ 76 | 77 | return toupper(*first) == toupper(*second); 78 | #endif 79 | } 80 | -------------------------------------------------------------------------------- /dependencies/curl/lib/strequal.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_STREQUAL_H 2 | #define HEADER_CURL_STREQUAL_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include 26 | 27 | #define strequal(a,b) curl_strequal(a,b) 28 | #define strnequal(a,b,c) curl_strnequal(a,b,c) 29 | 30 | #endif /* HEADER_CURL_STREQUAL_H */ 31 | 32 | -------------------------------------------------------------------------------- /dependencies/curl/lib/strerror.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_STRERROR_H 2 | #define HEADER_CURL_STRERROR_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include "urldata.h" 26 | 27 | const char *Curl_strerror (struct connectdata *conn, int err); 28 | 29 | #ifdef USE_LIBIDN 30 | const char *Curl_idn_strerror (struct connectdata *conn, int err); 31 | #endif 32 | 33 | #ifdef USE_WINDOWS_SSPI 34 | const char *Curl_sspi_strerror (struct connectdata *conn, int err); 35 | #endif 36 | 37 | #endif /* HEADER_CURL_STRERROR_H */ 38 | -------------------------------------------------------------------------------- /dependencies/curl/lib/strtok.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * _ _ ____ _ 3 | * Project ___| | | | _ \| | 4 | * / __| | | | |_) | | 5 | * | (__| |_| | _ <| |___ 6 | * \___|\___/|_| \_\_____| 7 | * 8 | * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. 9 | * 10 | * This software is licensed as described in the file COPYING, which 11 | * you should have received as part of this distribution. The terms 12 | * are also available at http://curl.haxx.se/docs/copyright.html. 13 | * 14 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 15 | * copies of the Software, and permit persons to whom the Software is 16 | * furnished to do so, under the terms of the COPYING file. 17 | * 18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 19 | * KIND, either express or implied. 20 | * 21 | ***************************************************************************/ 22 | 23 | #include "curl_setup.h" 24 | 25 | #ifndef HAVE_STRTOK_R 26 | #include 27 | 28 | #include "strtok.h" 29 | 30 | char * 31 | Curl_strtok_r(char *ptr, const char *sep, char **end) 32 | { 33 | if(!ptr) 34 | /* we got NULL input so then we get our last position instead */ 35 | ptr = *end; 36 | 37 | /* pass all letters that are including in the separator string */ 38 | while(*ptr && strchr(sep, *ptr)) 39 | ++ptr; 40 | 41 | if(*ptr) { 42 | /* so this is where the next piece of string starts */ 43 | char *start = ptr; 44 | 45 | /* set the end pointer to the first byte after the start */ 46 | *end = start + 1; 47 | 48 | /* scan through the string to find where it ends, it ends on a 49 | null byte or a character that exists in the separator string */ 50 | while(**end && !strchr(sep, **end)) 51 | ++*end; 52 | 53 | if(**end) { 54 | /* the end is not a null byte */ 55 | **end = '\0'; /* zero terminate it! */ 56 | ++*end; /* advance the last pointer to beyond the null byte */ 57 | } 58 | 59 | return start; /* return the position where the string starts */ 60 | } 61 | 62 | /* we ended up on a null byte, there are no more strings to find! */ 63 | return NULL; 64 | } 65 | 66 | #endif /* this was only compiled if strtok_r wasn't present */ 67 | -------------------------------------------------------------------------------- /dependencies/curl/lib/strtok.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_STRTOK_H 2 | #define HEADER_CURL_STRTOK_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | #include "curl_setup.h" 25 | #include 26 | 27 | #ifndef HAVE_STRTOK_R 28 | char *Curl_strtok_r(char *s, const char *delim, char **last); 29 | #define strtok_r Curl_strtok_r 30 | #else 31 | #include 32 | #endif 33 | 34 | #endif /* HEADER_CURL_STRTOK_H */ 35 | -------------------------------------------------------------------------------- /dependencies/curl/lib/telnet.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_TELNET_H 2 | #define HEADER_CURL_TELNET_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | #ifndef CURL_DISABLE_TELNET 25 | extern const struct Curl_handler Curl_handler_telnet; 26 | #endif 27 | 28 | #endif /* HEADER_CURL_TELNET_H */ 29 | 30 | -------------------------------------------------------------------------------- /dependencies/curl/lib/tftp.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_TFTP_H 2 | #define HEADER_CURL_TFTP_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | #ifndef CURL_DISABLE_TFTP 25 | extern const struct Curl_handler Curl_handler_tftp; 26 | #endif 27 | 28 | #endif /* HEADER_CURL_TFTP_H */ 29 | 30 | -------------------------------------------------------------------------------- /dependencies/curl/lib/timeval.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_TIMEVAL_H 2 | #define HEADER_CURL_TIMEVAL_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | /* 26 | * CAUTION: this header is designed to work when included by the app-side 27 | * as well as the library. Do not mix with library internals! 28 | */ 29 | 30 | #include "curl_setup.h" 31 | 32 | struct timeval curlx_tvnow(void); 33 | 34 | /* 35 | * Make sure that the first argument (t1) is the more recent time and t2 is 36 | * the older time, as otherwise you get a weird negative time-diff back... 37 | * 38 | * Returns: the time difference in number of milliseconds. 39 | */ 40 | long curlx_tvdiff(struct timeval t1, struct timeval t2); 41 | 42 | /* 43 | * Same as curlx_tvdiff but with full usec resolution. 44 | * 45 | * Returns: the time difference in seconds with subsecond resolution. 46 | */ 47 | double curlx_tvdiff_secs(struct timeval t1, struct timeval t2); 48 | 49 | long Curl_tvlong(struct timeval t1); 50 | 51 | /* These two defines below exist to provide the older API for library 52 | internals only. */ 53 | #define Curl_tvnow() curlx_tvnow() 54 | #define Curl_tvdiff(x,y) curlx_tvdiff(x,y) 55 | #define Curl_tvdiff_secs(x,y) curlx_tvdiff_secs(x,y) 56 | 57 | #endif /* HEADER_CURL_TIMEVAL_H */ 58 | 59 | -------------------------------------------------------------------------------- /dependencies/curl/lib/wildcard.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * _ _ ____ _ 3 | * Project ___| | | | _ \| | 4 | * / __| | | | |_) | | 5 | * | (__| |_| | _ <| |___ 6 | * \___|\___/|_| \_\_____| 7 | * 8 | * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. 9 | * 10 | * This software is licensed as described in the file COPYING, which 11 | * you should have received as part of this distribution. The terms 12 | * are also available at http://curl.haxx.se/docs/copyright.html. 13 | * 14 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 15 | * copies of the Software, and permit persons to whom the Software is 16 | * furnished to do so, under the terms of the COPYING file. 17 | * 18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 19 | * KIND, either express or implied. 20 | * 21 | ***************************************************************************/ 22 | 23 | #include "curl_setup.h" 24 | 25 | #include "wildcard.h" 26 | #include "llist.h" 27 | #include "fileinfo.h" 28 | 29 | #define _MPRINTF_REPLACE /* use our functions only */ 30 | #include 31 | 32 | #include "curl_memory.h" 33 | /* The last #include file should be: */ 34 | #include "memdebug.h" 35 | 36 | CURLcode Curl_wildcard_init(struct WildcardData *wc) 37 | { 38 | DEBUGASSERT(wc->filelist == NULL); 39 | /* now allocate only wc->filelist, everything else 40 | will be allocated if it is needed. */ 41 | wc->filelist = Curl_llist_alloc(Curl_fileinfo_dtor); 42 | if(!wc->filelist) {; 43 | return CURLE_OUT_OF_MEMORY; 44 | } 45 | return CURLE_OK; 46 | } 47 | 48 | void Curl_wildcard_dtor(struct WildcardData *wc) 49 | { 50 | if(!wc) 51 | return; 52 | 53 | if(wc->tmp_dtor) { 54 | wc->tmp_dtor(wc->tmp); 55 | wc->tmp_dtor = ZERO_NULL; 56 | wc->tmp = NULL; 57 | } 58 | DEBUGASSERT(wc->tmp == NULL); 59 | 60 | if(wc->filelist) { 61 | Curl_llist_destroy(wc->filelist, NULL); 62 | wc->filelist = NULL; 63 | } 64 | 65 | if(wc->path) { 66 | free(wc->path); 67 | wc->path = NULL; 68 | } 69 | 70 | if(wc->pattern) { 71 | free(wc->pattern); 72 | wc->pattern = NULL; 73 | } 74 | 75 | wc->customptr = NULL; 76 | wc->state = CURLWC_INIT; 77 | } 78 | -------------------------------------------------------------------------------- /dependencies/curl/lib/wildcard.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CURL_WILDCARD_H 2 | #define HEADER_CURL_WILDCARD_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 2010 - 2013, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include 26 | 27 | /* list of wildcard process states */ 28 | typedef enum { 29 | CURLWC_INIT = 0, 30 | CURLWC_MATCHING, /* library is trying to get list of addresses for 31 | downloading */ 32 | CURLWC_DOWNLOADING, 33 | CURLWC_CLEAN, /* deallocate resources and reset settings */ 34 | CURLWC_SKIP, /* skip over concrete file */ 35 | CURLWC_ERROR, /* error cases */ 36 | CURLWC_DONE /* if is wildcard->state == CURLWC_DONE wildcard loop 37 | will end */ 38 | } curl_wildcard_states; 39 | 40 | typedef void (*curl_wildcard_tmp_dtor)(void *ptr); 41 | 42 | /* struct keeping information about wildcard download process */ 43 | struct WildcardData { 44 | curl_wildcard_states state; 45 | char *path; /* path to the directory, where we trying wildcard-match */ 46 | char *pattern; /* wildcard pattern */ 47 | struct curl_llist *filelist; /* llist with struct Curl_fileinfo */ 48 | void *tmp; /* pointer to protocol specific temporary data */ 49 | curl_wildcard_tmp_dtor tmp_dtor; 50 | void *customptr; /* for CURLOPT_CHUNK_DATA pointer */ 51 | }; 52 | 53 | CURLcode Curl_wildcard_init(struct WildcardData *wc); 54 | void Curl_wildcard_dtor(struct WildcardData *wc); 55 | 56 | struct SessionHandle; 57 | 58 | #endif /* HEADER_CURL_WILDCARD_H */ 59 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | volumes: 3 | mysql-data: 4 | driver: local 5 | 6 | services: 7 | osu-performance: 8 | build: . 9 | env_file: .env 10 | command: all 11 | db: 12 | image: mysql:8 13 | volumes: 14 | - mysql-data:/var/lib/mysql 15 | - ./dump:/docker-entrypoint-initdb.d 16 | env_file: .env 17 | ports: 18 | - 127.0.0.1:3306:3306/tcp 19 | phpmyadmin: 20 | image: phpmyadmin 21 | ports: 22 | - 127.0.0.1:3380:80/tcp 23 | environment: 24 | - PMA_USER=osu 25 | - PMA_PASSWORD=osu 26 | -------------------------------------------------------------------------------- /include/pp/performance/Beatmap.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | PP_NAMESPACE_BEGIN 8 | 9 | DEFINE_EXCEPTION(BeatmapException); 10 | 11 | class Beatmap 12 | { 13 | public: 14 | Beatmap(s32 id); 15 | 16 | enum EDifficultyAttributeType : byte 17 | { 18 | Aim = 0, 19 | Speed, 20 | OD, 21 | AR, 22 | MaxCombo, 23 | Strain, 24 | HitWindow300, 25 | ScoreMultiplier, 26 | Flashlight, 27 | SliderFactor, 28 | SpeedNoteCount, 29 | 30 | NumTypes, 31 | }; 32 | 33 | enum ERankedStatus : s32 34 | { 35 | Ranked = 1, 36 | Approved = 2, 37 | Qualified = 3, 38 | Loved = 4, 39 | }; 40 | 41 | enum EScoreVersion : s32 42 | { 43 | ScoreV1 = 1, 44 | ScoreV2 = 2, 45 | }; 46 | 47 | s32 Id() const { return _id; } 48 | 49 | ERankedStatus RankedStatus() const { return _rankedStatus; } 50 | EScoreVersion ScoreVersion() const { return _scoreVersion; } 51 | s32 NumHitCircles() const { return _numHitCircles; } 52 | s32 NumSliders() const { return _numSliders; } 53 | s32 NumSpinners() const { return _numSpinners; } 54 | f32 DifficultyAttribute(EMods mods, EDifficultyAttributeType type) const; 55 | 56 | void SetRankedStatus(ERankedStatus rankedStatus) { _rankedStatus = rankedStatus; } 57 | void SetScoreVersion(EScoreVersion scoreVersion) { _scoreVersion = scoreVersion; } 58 | void SetNumHitCircles(s32 numHitCircles) { _numHitCircles = numHitCircles; } 59 | void SetNumSliders(s32 numSliders) { _numSliders = numSliders; } 60 | void SetNumSpinners(s32 numSpinners) { _numSpinners = numSpinners; } 61 | void SetDifficultyAttribute(EMods mods, EDifficultyAttributeType type, f32 value); 62 | void SetMode(EGamemode mode) { _mode = mode; } 63 | 64 | static bool ContainsAttribute(const std::string &difficultyAttributeName) 65 | { 66 | return s_difficultyAttributes.find(difficultyAttributeName) != s_difficultyAttributes.end(); 67 | } 68 | 69 | static EDifficultyAttributeType DifficultyAttributeFromName(const std::string &difficultyAttributeName) 70 | { 71 | return s_difficultyAttributes.at(difficultyAttributeName); 72 | } 73 | 74 | private: 75 | static const std::unordered_map s_difficultyAttributes; 76 | 77 | // General information 78 | s32 _id; 79 | EGamemode _mode = EGamemode::Osu; 80 | 81 | // Calculated difficulty 82 | using difficulty_t = std::unordered_map< 83 | std::underlying_type_t, 84 | std::array>; 85 | 86 | difficulty_t _difficulty; 87 | 88 | // Additional info required for processor 89 | ERankedStatus _rankedStatus; 90 | EScoreVersion _scoreVersion; 91 | s32 _numHitCircles = 0; 92 | s32 _numSliders = 0; 93 | s32 _numSpinners = 0; 94 | }; 95 | 96 | PP_NAMESPACE_END 97 | -------------------------------------------------------------------------------- /include/pp/performance/CURL.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | typedef void CURL; 8 | 9 | PP_NAMESPACE_BEGIN 10 | 11 | class CURL 12 | { 13 | public: 14 | CURL(); 15 | 16 | void SendToSlack( 17 | std::string domain, 18 | std::string key, 19 | std::string username, 20 | std::string iconURL, 21 | std::string channel, 22 | std::string message 23 | ); 24 | 25 | void SendToSentry( 26 | std::string domain, 27 | s32 projectID, 28 | std::string publicKey, 29 | std::string secretKey, 30 | Exception& e, 31 | std::string mode, 32 | bool warning = false 33 | ); 34 | 35 | private: 36 | std::unique_ptr<::CURL, decltype(&curl_easy_cleanup)> _pCURL; 37 | }; 38 | 39 | PP_NAMESPACE_END 40 | -------------------------------------------------------------------------------- /include/pp/performance/DDog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | #ifdef _WIN32 8 | #define NOMINMAX 9 | #include 10 | #undef NOMINMAX 11 | #else 12 | #include 13 | #endif 14 | 15 | PP_NAMESPACE_BEGIN 16 | 17 | class DDog 18 | { 19 | public: 20 | DDog(std::string host, s16 port); 21 | 22 | void Increment(std::string metric, s64 amount = 1, std::vector tags = {}, f32 sampleRate = 1); 23 | void Decrement(std::string metric, s64 amount = 1, std::vector tags = {}, f32 sampleRate = 1); 24 | void Timing(std::string metric, s64 value, std::vector tags = {}, f32 sampleRate = 1); 25 | void Gauge(std::string metric, s64 value, std::vector tags = {}, f32 sampleRate = 1); 26 | void Histogram(std::string metric, s64 value, std::vector tags = {}, f32 sampleRate = 1); 27 | void Set(std::string metric, s64 value, std::vector tags = {}, f32 sampleRate = 1); 28 | 29 | private: 30 | void addTags(std::string& message, const std::vector& tags); 31 | 32 | void updateStats(std::string metric, s64 delta, const std::vector& tags, f32 sampleRate); 33 | void send(std::string data, const std::vector& tags, f32 sampleRate); 34 | 35 | std::string _host; 36 | s16 _port; 37 | 38 | sockaddr_in _server; 39 | }; 40 | 41 | PP_NAMESPACE_END 42 | -------------------------------------------------------------------------------- /include/pp/performance/Score.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | PP_NAMESPACE_BEGIN 7 | 8 | class UpdateBatch; 9 | 10 | class Score 11 | { 12 | public: 13 | struct PPRecord 14 | { 15 | s64 ScoreId; 16 | s32 BeatmapId; 17 | f32 Value; 18 | f32 Accuracy; 19 | }; 20 | 21 | Score( 22 | s64 scoreId, 23 | EGamemode mode, 24 | s64 userId, 25 | s32 beatmapId, 26 | s32 score, 27 | s32 maxCombo, 28 | s32 num300, 29 | s32 num100, 30 | s32 num50, 31 | s32 numMiss, 32 | s32 numGeki, 33 | s32 numKatu, 34 | EMods mods 35 | ); 36 | 37 | s64 Id() const { return _scoreId; } 38 | s64 UserId() const { return _userId; } 39 | s32 BeatmapId() const { return _beatmapId; } 40 | 41 | virtual f32 TotalValue() const = 0; 42 | virtual f32 Accuracy() const = 0; 43 | virtual s32 TotalHits() const = 0; 44 | virtual s32 TotalSuccessfulHits() const = 0; 45 | 46 | void AppendToUpdateBatch(UpdateBatch& batch) const; 47 | 48 | PPRecord CreatePPRecord() { return PPRecord{_scoreId, _beatmapId, TotalValue(), Accuracy()}; } 49 | 50 | protected: 51 | s64 _scoreId; 52 | EGamemode _mode; 53 | s64 _userId; 54 | s32 _beatmapId; 55 | 56 | s32 _score; 57 | s32 _maxCombo; 58 | s32 _num300; 59 | s32 _num100; 60 | s32 _num50; 61 | s32 _numMiss; 62 | 63 | s32 _numGeki; 64 | s32 _numKatu; 65 | 66 | EMods _mods; 67 | }; 68 | 69 | PP_NAMESPACE_END 70 | -------------------------------------------------------------------------------- /include/pp/performance/UUID.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | PP_NAMESPACE_BEGIN 6 | 7 | class UUID 8 | { 9 | public: 10 | static UUID V4(); 11 | 12 | std::string ToString(); 13 | 14 | private: 15 | uint8_t _bytes[16]; 16 | }; 17 | 18 | PP_NAMESPACE_END 19 | -------------------------------------------------------------------------------- /include/pp/performance/User.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | PP_NAMESPACE_BEGIN 9 | 10 | class User 11 | { 12 | public: 13 | User(s64 id) : _id{id} 14 | { 15 | } 16 | 17 | struct PPRecord 18 | { 19 | f64 Value = 0; 20 | f64 Accuracy = 0; 21 | }; 22 | 23 | void AddScorePPRecord(Score::PPRecord score) 24 | { 25 | _scores.push_back(score); 26 | } 27 | 28 | s64 Id() const { return _id; } 29 | 30 | size_t NumScores() const { return _scores.size(); } 31 | 32 | const std::vector& Scores() const { return _scores; } 33 | 34 | void ComputePPRecord(); 35 | 36 | const PPRecord& GetPPRecord() const { return _rating; } 37 | 38 | Score::PPRecord XthBestScorePPRecord(unsigned int i); 39 | 40 | private: 41 | s64 _id; 42 | PPRecord _rating; 43 | std::vector _scores; 44 | }; 45 | 46 | PP_NAMESPACE_END 47 | -------------------------------------------------------------------------------- /include/pp/performance/catch/CatchScore.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | PP_NAMESPACE_BEGIN 7 | 8 | class CatchScore : public Score 9 | { 10 | public: 11 | CatchScore( 12 | s64 scoreId, 13 | EGamemode mode, 14 | s64 userId, 15 | s32 beatmapId, 16 | s32 score, 17 | s32 maxCombo, 18 | s32 num300, 19 | s32 num100, 20 | s32 num50, 21 | s32 numMiss, 22 | s32 numGeki, 23 | s32 numKatu, 24 | EMods mods, 25 | const Beatmap& beatmap 26 | ); 27 | 28 | f32 TotalValue() const override; 29 | f32 Accuracy() const override; 30 | s32 TotalHits() const override; 31 | s32 TotalSuccessfulHits() const override; 32 | 33 | private: 34 | f32 _value; 35 | s32 totalComboHits() const; 36 | }; 37 | 38 | PP_NAMESPACE_END 39 | -------------------------------------------------------------------------------- /include/pp/performance/mania/ManiaScore.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | PP_NAMESPACE_BEGIN 7 | 8 | class ManiaScore : public Score 9 | { 10 | public: 11 | ManiaScore( 12 | s64 scoreId, 13 | EGamemode mode, 14 | s64 userId, 15 | s32 beatmapId, 16 | s32 score, 17 | s32 maxCombo, 18 | s32 num300, 19 | s32 num100, 20 | s32 num50, 21 | s32 numMiss, 22 | s32 numGeki, 23 | s32 numKatu, 24 | EMods mods, 25 | const Beatmap &beatmap); 26 | 27 | f32 TotalValue() const override; 28 | f32 Accuracy() const override; 29 | s32 TotalHits() const override; 30 | s32 TotalSuccessfulHits() const override; 31 | 32 | private: 33 | void computeTotalValue(); 34 | f32 _totalValue; 35 | 36 | void computeDifficultyValue(const Beatmap &beatmap); 37 | 38 | f32 customAccuracy() const; 39 | f32 _difficultyValue; 40 | }; 41 | 42 | PP_NAMESPACE_END 43 | -------------------------------------------------------------------------------- /include/pp/performance/osu/OsuScore.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | PP_NAMESPACE_BEGIN 7 | 8 | class OsuScore : public Score 9 | { 10 | public: 11 | OsuScore( 12 | s64 scoreId, 13 | EGamemode mode, 14 | s64 userId, 15 | s32 beatmapId, 16 | s32 score, 17 | s32 maxCombo, 18 | s32 num300, 19 | s32 num100, 20 | s32 num50, 21 | s32 numMiss, 22 | s32 numGeki, 23 | s32 numKatu, 24 | EMods mods, 25 | const Beatmap &beatmap); 26 | 27 | f32 TotalValue() const override; 28 | f32 Accuracy() const override; 29 | s32 TotalHits() const override; 30 | s32 TotalSuccessfulHits() const override; 31 | 32 | private: 33 | f32 _aimValue; 34 | f32 _speedValue; 35 | f32 _accuracyValue; 36 | f32 _flashlightValue; 37 | f32 _effectiveMissCount; 38 | 39 | void computeTotalValue(const Beatmap &beatmap); 40 | f32 _totalValue; 41 | 42 | void computeEffectiveMissCount(const Beatmap &beatmap); 43 | void computeAimValue(const Beatmap &beatmap); 44 | void computeSpeedValue(const Beatmap &beatmap); 45 | void computeAccuracyValue(const Beatmap &beatmap); 46 | void computeFlashlightValue(const Beatmap &beatmap); 47 | 48 | f32 getComboScalingFactor(const Beatmap &beatmap); 49 | }; 50 | 51 | PP_NAMESPACE_END 52 | -------------------------------------------------------------------------------- /include/pp/performance/taiko/TaikoScore.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | PP_NAMESPACE_BEGIN 7 | 8 | class TaikoScore : public Score 9 | { 10 | public: 11 | TaikoScore( 12 | s64 scoreId, 13 | EGamemode mode, 14 | s64 userId, 15 | s32 beatmapId, 16 | s32 score, 17 | s32 maxCombo, 18 | s32 num300, 19 | s32 num100, 20 | s32 num50, 21 | s32 numMiss, 22 | s32 numGeki, 23 | s32 numKatu, 24 | EMods mods, 25 | const Beatmap &beatmap); 26 | 27 | f32 TotalValue() const override; 28 | f32 Accuracy() const override; 29 | s32 TotalHits() const override; 30 | s32 TotalSuccessfulHits() const override; 31 | 32 | private: 33 | void computeTotalValue(); 34 | f32 _totalValue; 35 | f32 _effectiveMissCount; 36 | 37 | void computeDifficultyValue(const Beatmap &beatmap); 38 | void computeAccuracyValue(const Beatmap &beatmap); 39 | 40 | f32 _difficultyValue; 41 | f32 _accuracyValue; 42 | }; 43 | 44 | PP_NAMESPACE_END 45 | -------------------------------------------------------------------------------- /include/pp/shared/Active.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | PP_NAMESPACE_BEGIN 10 | 11 | DEFINE_EXCEPTION(ActiveException); 12 | 13 | class Active 14 | { 15 | public: 16 | Active(const Active&) = delete; 17 | Active& operator=(const Active&) = delete; 18 | 19 | virtual ~Active(); 20 | 21 | void Send(std::function callback); 22 | static std::unique_ptr Create(); 23 | 24 | size_t NumPending() const; 25 | bool IsBusy() const; 26 | 27 | private: 28 | // See Create 29 | Active(); 30 | void run(); 31 | 32 | void send(std::function callback, bool checkForException); 33 | 34 | SharedQueue> _tasks; 35 | 36 | std::thread _thread; 37 | std::atomic _isDone; 38 | 39 | mutable std::exception_ptr _activeException = nullptr; 40 | 41 | void doDone(); 42 | void checkForAndThrowException() const; 43 | }; 44 | 45 | PP_NAMESPACE_END 46 | -------------------------------------------------------------------------------- /include/pp/shared/DatabaseConnection.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | PP_NAMESPACE_BEGIN 10 | 11 | DEFINE_EXCEPTION(DatabaseException); 12 | 13 | class DatabaseConnection 14 | { 15 | public: 16 | DatabaseConnection( 17 | std::string host, 18 | s32 port, 19 | std::string username, 20 | std::string password, 21 | std::string database 22 | ); 23 | 24 | DatabaseConnection& operator=(const DatabaseConnection&) = delete; 25 | DatabaseConnection(const DatabaseConnection&) = delete; 26 | 27 | DatabaseConnection& operator=(DatabaseConnection&& other); 28 | DatabaseConnection(DatabaseConnection&& other); 29 | 30 | ~DatabaseConnection(); 31 | 32 | void NonQueryBackground(const std::string& queryString); 33 | void NonQuery(const std::string& queryString); 34 | QueryResult Query(const std::string& queryString); 35 | 36 | //returns error messages 37 | const char* Error(); 38 | 39 | //returns the number of rows e.g. returned by a SELECT 40 | u32 AffectedRows(); 41 | 42 | size_t NumPendingQueries() const { return _pActive->NumPending(); } 43 | 44 | private: 45 | void connect(); 46 | 47 | std::unique_ptr _pActive; 48 | std::recursive_mutex _dbMutex; 49 | 50 | std::string _host; 51 | s32 _port; 52 | std::string _username; 53 | std::string _password; 54 | std::string _database; 55 | 56 | bool _isInitialized = false; 57 | MYSQL _mySQL; 58 | }; 59 | 60 | PP_NAMESPACE_END 61 | -------------------------------------------------------------------------------- /include/pp/shared/QueryResult.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | PP_NAMESPACE_BEGIN 8 | 9 | DEFINE_EXCEPTION(QueryResultException); 10 | 11 | class QueryResult 12 | { 13 | public: 14 | bool NextRow(); 15 | 16 | inline s32 NumRows() { return (s32)mysql_num_rows(_pRes.get()); } 17 | inline s32 NumCols() { return (s32)mysql_num_fields(_pRes.get()); } 18 | 19 | // Entire current row - array of zero terminated strings 20 | inline char** CurrentRow() { return _row; } 21 | 22 | // Column entries of the current row 23 | inline bool IsNull(size_t i) const { return !_row[i]; } 24 | 25 | private: 26 | class Field 27 | { 28 | public: 29 | Field(char* data) : _data{data} {} 30 | 31 | explicit operator const char*() const { return _data; } 32 | operator std::string() const { return (const char*)*this; } 33 | 34 | operator s32() const { return atoi(_data); } 35 | operator u32() const { return strtoul(_data, 0, 0); } 36 | 37 | operator s64() const { return strtoll(_data, 0, 0); } 38 | operator u64() const { return strtoull(_data, 0, 0); } 39 | 40 | operator f32() const { return (f32)(f64)*this; } 41 | operator f64() const { return atof(_data); } 42 | 43 | operator bool() const { return (s32)*this != 0; } 44 | 45 | template>::value>...> 46 | operator T(){ 47 | return static_cast(static_cast>>(*this)); 48 | } 49 | 50 | private: 51 | char* _data; 52 | }; 53 | 54 | public: 55 | Field operator[](size_t i) const 56 | { 57 | if (IsNull(i)) 58 | throw QueryResultException{SRC_POS, StrFormat("Attempted to interpret null result at {0}.", i)}; 59 | return Field{_row[i]}; 60 | } 61 | 62 | private: 63 | QueryResult(MYSQL_RES* pRes); 64 | 65 | std::unique_ptr _pRes; 66 | MYSQL_ROW _row; 67 | 68 | friend class DatabaseConnection; 69 | }; 70 | 71 | PP_NAMESPACE_END 72 | -------------------------------------------------------------------------------- /include/pp/shared/SharedQueue.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | PP_NAMESPACE_BEGIN 10 | 11 | template 12 | class SharedQueue 13 | { 14 | public: 15 | bool Empty() const 16 | { 17 | std::lock_guard lock{ _mutex }; 18 | return _rawQueue.empty(); 19 | } 20 | 21 | size_t Size() const 22 | { 23 | std::lock_guard lock{ _mutex }; 24 | return _rawQueue.size(); 25 | } 26 | 27 | void Push(T& NewElem) 28 | { 29 | std::lock_guard lock{ _mutex }; 30 | _rawQueue.push_back(NewElem); 31 | _dataCondition.notify_one(); 32 | } 33 | 34 | T WaitAndPop() 35 | { 36 | std::unique_lock lock{ _mutex }; 37 | 38 | while (_rawQueue.empty()) 39 | { 40 | _dataCondition.wait(lock); 41 | } 42 | 43 | T result = std::move(_rawQueue.front()); 44 | _rawQueue.pop_front(); 45 | 46 | return result; 47 | } 48 | 49 | private: 50 | std::deque _rawQueue; 51 | mutable std::mutex _mutex; 52 | std::condition_variable _dataCondition; 53 | }; 54 | 55 | PP_NAMESPACE_END 56 | -------------------------------------------------------------------------------- /include/pp/shared/UpdateBatch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | PP_NAMESPACE_BEGIN 8 | 9 | class DatabaseConnection; 10 | 11 | class UpdateBatch 12 | { 13 | public: 14 | UpdateBatch(std::shared_ptr pDB, u32 sizeThreshold); 15 | ~UpdateBatch(); 16 | 17 | UpdateBatch& operator=(UpdateBatch&& other); 18 | UpdateBatch(UpdateBatch&& other); 19 | 20 | void AppendAndCommit(const std::string& values); 21 | void AppendAndCommitNonThreadsafe(const std::string& values); 22 | 23 | std::mutex& Mutex() { return _batchMutex; } 24 | 25 | private: 26 | void append(const std::string& values) 27 | { 28 | _empty = false; 29 | _query += values; 30 | } 31 | 32 | void reset(); 33 | const std::string& query(); 34 | 35 | u32 Size() const { return (u32)_query.size(); } 36 | 37 | void execute(); 38 | 39 | u32 _sizeThreshold; 40 | 41 | bool _empty = true; 42 | 43 | std::shared_ptr _pDB; 44 | std::mutex _batchMutex; 45 | 46 | std::string _query; 47 | }; 48 | 49 | PP_NAMESPACE_END 50 | -------------------------------------------------------------------------------- /scripts/wrapper_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd "$(dirname ${BASH_SOURCE[0]})/../Bin" 4 | ./osu-performance all "$@" 5 | while [ $? -ne 0 ]; do 6 | echo "osu-performance terminated. Restarting in 5 seconds..." 7 | sleep 5s 8 | ./osu-performance all "$@" -c 9 | done 10 | -------------------------------------------------------------------------------- /scripts/wrapper_new.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd "$(dirname ${BASH_SOURCE[0]})/../Bin" 4 | while : ; do 5 | ./osu-performance new "$@" 6 | echo "osu-performance terminated. Restarting in 5 seconds..." 7 | sleep 5s 8 | done 9 | -------------------------------------------------------------------------------- /src/performance/Beatmap.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | PP_NAMESPACE_BEGIN 5 | 6 | const std::unordered_map Beatmap::s_difficultyAttributes{ 7 | {"Aim", Aim}, 8 | {"Speed", Speed}, 9 | {"OD", OD}, 10 | {"AR", AR}, 11 | {"Max combo", MaxCombo}, 12 | {"Strain", Strain}, 13 | {"Hit window 300", HitWindow300}, 14 | {"Score multiplier", ScoreMultiplier}, 15 | {"Flashlight", Flashlight}, 16 | {"Slider factor", SliderFactor}, 17 | {"Speed note count", SpeedNoteCount}, 18 | }; 19 | 20 | Beatmap::Beatmap(s32 id) 21 | : _id{id} 22 | { 23 | } 24 | 25 | f32 Beatmap::DifficultyAttribute(EMods mods, EDifficultyAttributeType type) const 26 | { 27 | auto difficultyIt = _difficulty.find(MaskRelevantDifficultyMods(_mode, mods)); 28 | return difficultyIt == std::end(_difficulty) ? 0.0f : difficultyIt->second[type]; 29 | } 30 | 31 | void Beatmap::SetDifficultyAttribute(EMods mods, EDifficultyAttributeType type, f32 value) 32 | { 33 | _difficulty[MaskRelevantDifficultyMods(_mode, mods)][type] = value; 34 | } 35 | 36 | PP_NAMESPACE_END 37 | -------------------------------------------------------------------------------- /src/performance/Score.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | PP_NAMESPACE_BEGIN 7 | 8 | Score::Score( 9 | s64 scoreId, 10 | EGamemode mode, 11 | s64 userId, 12 | s32 beatmapId, 13 | s32 score, 14 | s32 maxCombo, 15 | s32 num300, 16 | s32 num100, 17 | s32 num50, 18 | s32 numMiss, 19 | s32 numGeki, 20 | s32 numKatu, 21 | EMods mods 22 | ) 23 | : 24 | _scoreId{scoreId}, 25 | _mode{mode}, 26 | _userId{userId}, 27 | _beatmapId{beatmapId}, 28 | _score{std::max(0, score)}, 29 | _maxCombo{std::max(0, maxCombo)}, 30 | _num300{std::max(0, num300)}, 31 | _num100{std::max(0, num100)}, 32 | _num50{std::max(0, num50)}, 33 | _numMiss{std::max(0, numMiss)}, 34 | _numGeki{std::max(0, numGeki)}, 35 | _numKatu{std::max(0, numKatu)}, 36 | _mods{mods} 37 | { 38 | } 39 | 40 | void Score::AppendToUpdateBatch(UpdateBatch& batch) const 41 | { 42 | batch.AppendAndCommitNonThreadsafe(StrFormat( 43 | "UPDATE `osu_scores{0}_high` " 44 | "SET `pp`={1} " 45 | "WHERE `score_id`={2};", 46 | GamemodeSuffix(_mode), 47 | TotalValue(), 48 | _scoreId 49 | )); 50 | 51 | batch.AppendAndCommitNonThreadsafe(StrFormat("UPDATE `score_process_queue` SET `status` = 1 WHERE `mode` = {0} AND `score_id` = {1};", static_cast(_mode), _scoreId)); 52 | } 53 | 54 | PP_NAMESPACE_END 55 | -------------------------------------------------------------------------------- /src/performance/UUID.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | PP_NAMESPACE_BEGIN 5 | 6 | uint32_t rand32() 7 | { 8 | // we need to do this, because there is no 9 | // gaurantee that RAND_MAX is >= 0xffffffff 10 | // in fact, it is LIKELY to be 0x7fffffff 11 | const uint32_t r1 = rand() & 0x0ff; 12 | const uint32_t r2 = rand() & 0xfff; 13 | const uint32_t r3 = rand() & 0xfff; 14 | 15 | return (r3 << 20) | (r2 << 8) | r1; 16 | } 17 | 18 | UUID UUID::V4() 19 | { 20 | static const uint16_t c[] = { 21 | 0x8000, 22 | 0x9000, 23 | 0xa000, 24 | 0xb000, 25 | }; 26 | 27 | UUID uuid; 28 | 29 | const uint32_t rand_1 = (rand32() & 0xffffffff); 30 | const uint32_t rand_2 = (rand32() & 0xffff0fff) | 0x4000; 31 | const uint32_t rand_3 = (rand32() & 0xffff0fff) | c[rand() & 0x03]; 32 | const uint32_t rand_4 = (rand32() & 0xffffffff); 33 | 34 | uuid._bytes[0x00] = (rand_1 >> 24) & 0xff; 35 | uuid._bytes[0x01] = (rand_1 >> 16) & 0xff; 36 | uuid._bytes[0x02] = (rand_1 >> 8) & 0xff; 37 | uuid._bytes[0x03] = (rand_1)& 0xff; 38 | 39 | uuid._bytes[0x04] = (rand_2 >> 24) & 0xff; 40 | uuid._bytes[0x05] = (rand_2 >> 16) & 0xff; 41 | uuid._bytes[0x06] = (rand_2 >> 8) & 0xff; 42 | uuid._bytes[0x07] = (rand_2)& 0xff; 43 | 44 | uuid._bytes[0x08] = (rand_3 >> 24) & 0xff; 45 | uuid._bytes[0x09] = (rand_3 >> 16) & 0xff; 46 | uuid._bytes[0x0a] = (rand_3 >> 8) & 0xff; 47 | uuid._bytes[0x0b] = (rand_3)& 0xff; 48 | 49 | uuid._bytes[0x0c] = (rand_4 >> 24) & 0xff; 50 | uuid._bytes[0x0d] = (rand_4 >> 16) & 0xff; 51 | uuid._bytes[0x0e] = (rand_4 >> 8) & 0xff; 52 | uuid._bytes[0x0f] = (rand_4)& 0xff; 53 | 54 | return uuid; 55 | } 56 | 57 | std::string UUID::ToString() 58 | { 59 | std::stringstream ss; 60 | ss << std::hex; 61 | 62 | for (unsigned int i = 0; i < 16; ++i) 63 | ss << std::setw(2) << std::setfill('0') << (int)_bytes[i]; 64 | 65 | return ss.str(); 66 | } 67 | 68 | PP_NAMESPACE_END 69 | -------------------------------------------------------------------------------- /src/performance/User.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | PP_NAMESPACE_BEGIN 5 | 6 | // Our own implementation of unique ensures that the first unique element 7 | // (in our case the highest pp-giving score) is always kept 8 | template 9 | ForwardIt highestUnique(ForwardIt first, ForwardIt last, BinaryPredicate p) 10 | { 11 | if (first == last) 12 | return last; 13 | 14 | ForwardIt result = first; 15 | while (++first != last) 16 | if (!p(*result, *first)) 17 | *(++result) = *first; 18 | 19 | return ++result; 20 | } 21 | 22 | void User::ComputePPRecord() 23 | { 24 | // Eliminate duplicate beatmaps with lower pp 25 | std::sort(std::begin(_scores), std::end(_scores), [](const Score::PPRecord& a, const Score::PPRecord& b) 26 | { 27 | return a.BeatmapId < b.BeatmapId || (a.BeatmapId == b.BeatmapId && b.Value < a.Value); 28 | }); 29 | 30 | _scores.erase( 31 | highestUnique( 32 | _scores.begin(), 33 | _scores.end(), 34 | [](const Score::PPRecord& a, const Score::PPRecord& b) { return a.BeatmapId == b.BeatmapId; } 35 | ), 36 | _scores.end() 37 | ); 38 | 39 | // Sort values in descending order 40 | std::sort(std::begin(_scores), std::end(_scores), [](const Score::PPRecord& a, const Score::PPRecord& b) 41 | { 42 | return b.Value < a.Value; 43 | }); 44 | 45 | _rating = PPRecord{}; 46 | 47 | // Build the diminishing sum 48 | f64 factor = 1; 49 | 50 | for (const auto& score : _scores) 51 | { 52 | _rating.Value += score.Value * factor; 53 | _rating.Accuracy += score.Accuracy * factor; 54 | factor *= 0.95; 55 | } 56 | 57 | // This weird factor is to keep legacy compatibility with the diminishing bonus of 0.25 by 0.9994 each score 58 | _rating.Value += (417.0 - 1.0 / 3.0) * (1.0 - pow(0.9994, _scores.size())); 59 | 60 | // We want our accuracy to be normalized. 61 | if (_scores.size() > 0) 62 | // We want the percentage, not a factor in [0, 1], hence we divide 20 by 100 63 | _rating.Accuracy *= 100.0 / (20 * (1 - pow(0.95, _scores.size()))); 64 | } 65 | 66 | Score::PPRecord User::XthBestScorePPRecord(unsigned int i) 67 | { 68 | if (i >= _scores.size()) 69 | return Score::PPRecord{0, 0, 0, 0}; 70 | 71 | return _scores[i]; 72 | } 73 | 74 | PP_NAMESPACE_END 75 | -------------------------------------------------------------------------------- /src/shared/Active.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | PP_NAMESPACE_BEGIN 5 | 6 | Active::~Active() 7 | { 8 | if (!_isDone) 9 | send(std::bind(&Active::doDone, this), false); 10 | 11 | if (_thread.joinable()) 12 | _thread.join(); 13 | } 14 | 15 | void Active::Send(std::function callback) 16 | { 17 | send(callback, true); 18 | } 19 | 20 | std::unique_ptr Active::Create() 21 | { 22 | auto pActive = std::unique_ptr{ new Active{} }; 23 | pActive->_thread = std::thread(&Active::run, pActive.get()); 24 | return pActive; 25 | } 26 | 27 | size_t Active::NumPending() const 28 | { 29 | checkForAndThrowException(); 30 | return _tasks.Size(); 31 | } 32 | 33 | bool Active::IsBusy() const 34 | { 35 | return NumPending() > 0; 36 | } 37 | 38 | Active::Active() 39 | { 40 | // This is required here, because atomic doesn't allow 41 | // copy construction. 42 | _isDone = false; 43 | } 44 | 45 | void Active::run() 46 | { 47 | try 48 | { 49 | while (!_isDone) 50 | // Wait for a task, pop it and execute it. Hence the double ()() 51 | _tasks.WaitAndPop()(); 52 | } 53 | catch (...) 54 | { 55 | _activeException = std::current_exception(); 56 | _isDone = true; 57 | } 58 | } 59 | 60 | void Active::send(std::function callback, bool checkForException) 61 | { 62 | if (checkForException) 63 | checkForAndThrowException(); 64 | 65 | _tasks.Push(callback); 66 | } 67 | 68 | void Active::doDone() 69 | { 70 | _isDone = true; 71 | } 72 | 73 | void Active::checkForAndThrowException() const 74 | { 75 | if (_isDone) 76 | { 77 | if (std::exception_ptr exception = _activeException) 78 | { 79 | _activeException = nullptr; 80 | std::rethrow_exception(exception); 81 | } 82 | else 83 | throw ActiveException{SRC_POS, "Active object is already done."}; 84 | } 85 | } 86 | 87 | PP_NAMESPACE_END 88 | -------------------------------------------------------------------------------- /src/shared/QueryResult.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | PP_NAMESPACE_BEGIN 7 | 8 | QueryResult::QueryResult(MYSQL_RES* pRes) 9 | : _pRes{pRes, &mysql_free_result}, _row{nullptr} 10 | { 11 | } 12 | 13 | bool QueryResult::NextRow() 14 | { 15 | // Don't bother executing the SQL func... we don't have a valid result anyways! 16 | if (!_pRes) 17 | return false; 18 | 19 | // Return wether we actually HAVE any more (or any) rows 20 | return ((_row = mysql_fetch_row(_pRes.get())) != nullptr); 21 | } 22 | 23 | PP_NAMESPACE_END 24 | -------------------------------------------------------------------------------- /src/shared/UpdateBatch.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | PP_NAMESPACE_BEGIN 6 | 7 | UpdateBatch::UpdateBatch(std::shared_ptr pDB, u32 sizeThreshold) 8 | : _pDB{std::move(pDB)}, _sizeThreshold{sizeThreshold} 9 | { 10 | reset(); 11 | } 12 | 13 | UpdateBatch::~UpdateBatch() 14 | { 15 | // If we are not empty we want to commit what's left in here 16 | if (!_empty) 17 | execute(); 18 | } 19 | 20 | UpdateBatch::UpdateBatch(UpdateBatch&& other) 21 | { 22 | *this = std::move(other); 23 | } 24 | 25 | UpdateBatch& UpdateBatch::operator=(UpdateBatch&& other) 26 | { 27 | std::lock_guard otherLock{other._batchMutex}; 28 | std::lock_guard lock{_batchMutex}; 29 | 30 | _sizeThreshold = other._sizeThreshold; 31 | _empty = other._empty; 32 | _pDB = std::move(other._pDB); 33 | _query = std::move(other._query); 34 | 35 | return *this; 36 | } 37 | 38 | void UpdateBatch::AppendAndCommit(const std::string& values) 39 | { 40 | std::lock_guard lock{_batchMutex}; 41 | AppendAndCommitNonThreadsafe(values); 42 | } 43 | 44 | void UpdateBatch::AppendAndCommitNonThreadsafe(const std::string& values) 45 | { 46 | append(values); 47 | 48 | if (Size() > _sizeThreshold) 49 | { 50 | execute(); 51 | reset(); 52 | } 53 | } 54 | 55 | void UpdateBatch::reset() 56 | { 57 | _query = "";//"START TRANSACTION;"; 58 | _empty = true; 59 | } 60 | 61 | const std::string& UpdateBatch::query() 62 | { 63 | //m_Query += "COMMIT;"; 64 | return _query; 65 | } 66 | 67 | void UpdateBatch::execute() 68 | { 69 | _pDB->NonQueryBackground(query()); 70 | 71 | /*FILE* pFile = fopen("./updates.log", "ab"); 72 | 73 | if(pFile != nullptr) 74 | { 75 | fputs(m_Query.c_str(), pFile); 76 | fclose(pFile); 77 | }*/ 78 | } 79 | 80 | PP_NAMESPACE_END 81 | --------------------------------------------------------------------------------