diff -Nru gamemode-1.5.1/bootstrap.sh gamemode-1.6.1/bootstrap.sh --- gamemode-1.5.1/bootstrap.sh 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/bootstrap.sh 2021-02-18 19:00:12.000000000 +0000 @@ -26,9 +26,8 @@ # Echo the rest so it's obvious set -x -meson --prefix=$prefix build --buildtype debugoptimized -Dwith-systemd-user-unit-dir=/etc/systemd/user "$@" -cd build -ninja +meson builddir --prefix=$prefix --buildtype debugoptimized -Dwith-systemd-user-unit-dir=/etc/systemd/user "$@" +ninja -C builddir # Verify user wants to install set +x @@ -38,7 +37,7 @@ fi set -x -sudo ninja install +sudo ninja install -C builddir # Restart polkit so we don't get pop-ups whenever we pkexec if systemctl list-unit-files |grep -q polkit.service; then diff -Nru gamemode-1.5.1/CHANGELOG.md gamemode-1.6.1/CHANGELOG.md --- gamemode-1.5.1/CHANGELOG.md 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/CHANGELOG.md 2021-02-18 19:00:12.000000000 +0000 @@ -1,3 +1,33 @@ +## 1.6.1 + +### Changes +* Use inih r53 +* Packaging changes for Arch +* Minor metainfo improvements + +### Contributors + +* Stephan Lachnit @stephanlachnit +* Alberto Oporto Ames @otreblan + +## 1.6 + +### Changes +* Created new manpages for `gamemoderun` and the example, now called `gamemode-simulate-game` +* Add ability to change lib directory of `gamemoderun` +* Add option to use `elogind` +* Copy default config file to the correct location +* Allow `LD_PRELOAD` to be overridden in `$GAMEMODERUNEXEC` +* Various minor bugfixes +* Improvements to dependency management + +### Contributors + +* Stephan Lachnit @stephanlachnit +* Rafał Mikrut @qarmin +* Niels Thykier @nthykier +* Stéphane Gleizes @sgleizes + ## 1.5.1 ### Changes diff -Nru gamemode-1.5.1/common/common-governors.c gamemode-1.6.1/common/common-governors.c --- gamemode-1.5.1/common/common-governors.c 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/common/common-governors.c 2021-02-18 19:00:12.000000000 +0000 @@ -122,22 +122,29 @@ long length = ftell(f); fseek(f, 0, SEEK_SET); - char contents[length]; + if (length == -1) + { + LOG_ERROR("Failed to seek file %s\n", gov); + } + else + { + char contents[length]; - if (fread(contents, 1, (size_t)length, f) > 0) { - /* Files have a newline */ - strtok(contents, "\n"); - if (strlen(governor) > 0 && strncmp(governor, contents, 64) != 0) { - /* Don't handle the mixed case, this shouldn't ever happen - * But it is a clear sign we shouldn't carry on */ - LOG_ERROR("Governors malformed: got \"%s\", expected \"%s\"", contents, governor); - fclose(f); - return "malformed"; - } + if (fread(contents, 1, (size_t)length, f) > 0) { + /* Files have a newline */ + strtok(contents, "\n"); + if (strlen(governor) > 0 && strncmp(governor, contents, 64) != 0) { + /* Don't handle the mixed case, this shouldn't ever happen + * But it is a clear sign we shouldn't carry on */ + LOG_ERROR("Governors malformed: got \"%s\", expected \"%s\"", contents, governor); + fclose(f); + return "malformed"; + } - strncpy(governor, contents, sizeof(governor) - 1); - } else { - LOG_ERROR("Failed to read contents of %s\n", gov); + strncpy(governor, contents, sizeof(governor) - 1); + } else { + LOG_ERROR("Failed to read contents of %s\n", gov); + } } fclose(f); diff -Nru gamemode-1.5.1/common/common-pidfds.c gamemode-1.6.1/common/common-pidfds.c --- gamemode-1.5.1/common/common-pidfds.c 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/common/common-pidfds.c 2021-02-18 19:00:12.000000000 +0000 @@ -196,12 +196,5 @@ /* misc directory helpers */ int open_fdinfo_dir(void) { - int fd; - - fd = open("/proc/self/fdinfo", O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC | O_NOCTTY); - - if (fd == -1) - return errno; - - return fd; + return open("/proc/self/fdinfo", O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC | O_NOCTTY); } diff -Nru gamemode-1.5.1/daemon/gamemode-context.c gamemode-1.6.1/daemon/gamemode-context.c --- gamemode-1.5.1/daemon/gamemode-context.c 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/daemon/gamemode-context.c 2021-02-18 19:00:12.000000000 +0000 @@ -1006,7 +1006,7 @@ static void game_mode_execute_scripts(char scripts[CONFIG_LIST_MAX][CONFIG_VALUE_MAX], int timeout) { unsigned int i = 0; - while (*scripts[i] != '\0' && i < CONFIG_LIST_MAX) { + while (i < CONFIG_LIST_MAX && *scripts[i] != '\0') { LOG_MSG("Executing script [%s]\n", scripts[i]); int err; const char *args[] = { "/bin/sh", "-c", scripts[i], NULL }; diff -Nru gamemode-1.5.1/daemon/gamemode-dbus.c gamemode-1.6.1/daemon/gamemode-dbus.c --- gamemode-1.5.1/daemon/gamemode-dbus.c 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/daemon/gamemode-dbus.c 2021-02-18 19:00:12.000000000 +0000 @@ -36,8 +36,13 @@ #include "common-logging.h" #include "common-pidfds.h" +#ifdef USE_ELOGIND +#include +#include +#else #include #include +#endif #include #include diff -Nru gamemode-1.5.1/daemon/gamemoded.c gamemode-1.6.1/daemon/gamemoded.c --- gamemode-1.5.1/daemon/gamemoded.c 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/daemon/gamemoded.c 2021-02-18 19:00:12.000000000 +0000 @@ -72,7 +72,7 @@ " When no PID given, queries the status globally\n" \ " -d, --daemonize Daemonize self after launch\n" \ " -l, --log-to-syslog Log to syslog\n" \ - " -r, --test Run tests\n" \ + " -t, --test Run tests\n" \ " -h, --help Print this help\n" \ " -v, --version Print version\n" \ "\n" \ @@ -132,11 +132,19 @@ /* replace standard file descriptors by /dev/null */ int devnull_r = open("/dev/null", O_RDONLY); int devnull_w = open("/dev/null", O_WRONLY); - dup2(devnull_r, STDIN_FILENO); - dup2(devnull_w, STDOUT_FILENO); - dup2(devnull_w, STDERR_FILENO); - close(devnull_r); - close(devnull_w); + + if (devnull_r == -1 || devnull_w == -1) + { + LOG_ERROR("Failed to redirect standard input and output to /dev/null\n"); + } + else + { + dup2(devnull_r, STDIN_FILENO); + dup2(devnull_w, STDOUT_FILENO); + dup2(devnull_w, STDERR_FILENO); + close(devnull_r); + close(devnull_w); + } } /** diff -Nru gamemode-1.5.1/daemon/gamemode-tests.c gamemode-1.6.1/daemon/gamemode-tests.c --- gamemode-1.5.1/daemon/gamemode-tests.c 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/daemon/gamemode-tests.c 2021-02-18 19:00:12.000000000 +0000 @@ -370,7 +370,7 @@ if (startscripts[0][0] != '\0') { int i = 0; - while (*startscripts[i] != '\0' && i < CONFIG_LIST_MAX) { + while (i < CONFIG_LIST_MAX && *startscripts[i] != '\0') { LOG_MSG(":::: Running start script [%s]\n", startscripts[i]); const char *args[] = { "/bin/sh", "-c", startscripts[i], NULL }; @@ -393,7 +393,7 @@ if (endscripts[0][0] != '\0') { int i = 0; - while (*endscripts[i] != '\0' && i < CONFIG_LIST_MAX) { + while (i < CONFIG_LIST_MAX && *endscripts[i] != '\0') { LOG_MSG(":::: Running end script [%s]\n", endscripts[i]); const char *args[] = { "/bin/sh", "-c", endscripts[i], NULL }; diff -Nru gamemode-1.5.1/daemon/gamemode-wine.c gamemode-1.6.1/daemon/gamemode-wine.c --- gamemode-1.5.1/daemon/gamemode-wine.c 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/daemon/gamemode-wine.c 2021-02-18 19:00:12.000000000 +0000 @@ -224,7 +224,8 @@ goto fail; error_cleanup: - game_mode_close_proc(proc_fd); + if (proc_fd != INVALID_PROCFD) + game_mode_close_proc(proc_fd); free(wineprefix); return wine_exe; diff -Nru gamemode-1.5.1/daemon/meson.build gamemode-1.6.1/daemon/meson.build --- gamemode-1.5.1/daemon/meson.build 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/daemon/meson.build 2021-02-18 19:00:12.000000000 +0000 @@ -11,16 +11,17 @@ 'gamemode-config.c', ] -gamemoded_includes = libgamemode_includes +gamemoded_includes = gamemode_headers_includes gamemoded_includes += config_h_dir -executable( +gamemoded = executable( 'gamemoded', sources: daemon_sources, + c_args: sd_bus_args, dependencies: [ link_daemon_common, dep_threads, - dep_systemd, + sd_bus_dep, inih_dependency, libdl, ], @@ -28,4 +29,11 @@ gamemoded_includes, ], install: true, -) \ No newline at end of file +) + +# verify gamemoded compiled properly +test( + 'validate gamemoded compiled properly', + gamemoded, + args: ['-v'], +) diff -Nru gamemode-1.5.1/daemon/README.md gamemode-1.6.1/daemon/README.md --- gamemode-1.5.1/daemon/README.md 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/daemon/README.md 2021-02-18 19:00:12.000000000 +0000 @@ -11,7 +11,7 @@ When no PID given, queries the status globally -d, --daemonize Daemonize self after launch -l, --log-to-syslog Log to syslog - -r, --test Run tests + -t, --test Run tests -h, --help Print this help -v, --version Print version ``` diff -Nru gamemode-1.5.1/data/gamemoded.8.in gamemode-1.6.1/data/gamemoded.8.in --- gamemode-1.5.1/data/gamemoded.8.in 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/data/gamemoded.8.in 2021-02-18 19:00:12.000000000 +0000 @@ -1,8 +1,8 @@ .\" Manpage for gamemoded. .\" Contact linux-contact@feralinteractive.com to correct errors or typos. -.TH gamemoded 8 "3 Mar 2020" "1.5.1" "gamemoded man page" +.TH gamemoded 8 "4 May 2020" "@GAMEMODE_VERSION@" "gamemoded man page" .SH NAME -gamemoded \- optimises system performance on demand +gamemoded \- daemon that optimises system performance on demand .SH SYNOPSIS \fBgamemoded\fR [OPTIONS...] .SH DESCRIPTION @@ -38,31 +38,7 @@ Print the version .SH USAGE -\fBlibgamemodeauto.so.0\fR can be pre-loaded into any program to request \fBgamemoded\fR begin or end the mode, like so: - -.RS 4 -gamemoderun \./game -.RE - -Or by setting the Steam launch options for a game: - -.RS 4 -gamemoderun %command% -.RE - -The library can be manually preloaded if needed: - -.RS 4 -LD_PRELOAD=$LD_PRELOAD:/usr/\e$LIB/libgamemodeauto.so.0 ./game -.RE - -It is possible to set additional start commands to gamemoderun by setting the environment variable: - -.RS 4 -GAMEMODERUNEXEC="command" -.RE - -When this is set, gamemoderun will execute the command given by that environment variable, and the command line passed to gamemoderun will be passed as arguments to that command. GameMode will not be applied to the wrapper command, just the game itself. +\fBlibgamemodeauto.so.0\fR can be pre-loaded into any program to request \fBgamemoded\fR begin or end the mode. See gamemoderun(1) for details. The \fBgamemode_client.h\fR header can be used by developers to build the requests into a program: @@ -118,7 +94,7 @@ .RE .SH SEE ALSO -systemd(1) +gamemoderun(1), systemd(1) .SH ABOUT GameMode source can be found at \fIhttps://github.com/FeralInteractive/gamemode.git\fR diff -Nru gamemode-1.5.1/data/gamemoderun gamemode-1.6.1/data/gamemoderun --- gamemode-1.5.1/data/gamemoderun 1970-01-01 00:00:00.000000000 +0000 +++ gamemode-1.6.1/data/gamemoderun 2021-02-18 19:00:12.000000000 +0000 @@ -0,0 +1,9 @@ +#!/bin/bash +# Helper script to launch games with gamemode + +GAMEMODEAUTO_NAME="libgamemodeauto.so.0" + +# ld will find the right path to load the library, including for 32-bit apps. +LD_PRELOAD="${GAMEMODEAUTO_NAME}${LD_PRELOAD:+:$LD_PRELOAD}" + +exec env LD_PRELOAD="${LD_PRELOAD}" $GAMEMODERUNEXEC "$@" diff -Nru gamemode-1.5.1/data/gamemoderun.1.in gamemode-1.6.1/data/gamemoderun.1.in --- gamemode-1.5.1/data/gamemoderun.1.in 1970-01-01 00:00:00.000000000 +0000 +++ gamemode-1.6.1/data/gamemoderun.1.in 2021-02-18 19:00:12.000000000 +0000 @@ -0,0 +1,50 @@ +.\" Manpage for gamemoderun. +.\" Contact linux-contact@feralinteractive.com to correct errors or typos. +.TH gamemoderun 1 "4 May 2020" "@GAMEMODE_VERSION@" "gamemoderun man page" +.SH NAME +gamemoderun \- invoke gamemode into any program +.SH SYNOPSIS +\fBgamemoderun\fR PROGRAM +.SH DESCRIPTION +\fBGameMode\fR is a daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS. + +The design has a clear cut abstraction between the host daemon and library (\fBgamemoded\fR and \fBlibgamemode\fR), and the client loaders (\fBlibgamemodeauto\fR and \fBgamemode_client.h\fR) that allows for safe usage without worrying about whether the daemon is installed or running. This design also means that while the host library currently relies on systemd for exchanging messages with the daemon, it's entirely possible to implement other internals that still work with the same clients. + +\fBGameMode\fR was designed primarily as a stop-gap solution to problems with the Intel and AMD CPU powersave or ondemand governors, but is intended to be expanded beyond just CPU governor states, as there are a wealth of automation tasks one might want to apply. + +.SH USAGE +\fBlibgamemodeauto.so.0\fR can be pre-loaded into any program to request \fBgamemoded\fR begin or end the mode, like so: + +.RS 4 +gamemoderun \./game +.RE + +Or by setting the Steam launch options for a game: + +.RS 4 +gamemoderun %command% +.RE + +The library can be manually preloaded if needed: + +.RS 4 +LD_PRELOAD=$LD_PRELOAD:/usr/\e$LIB/libgamemodeauto.so.0 ./game +.RE + +.SH CONFIG +It is possible to set additional start commands to gamemoderun by setting the environment variable: + +.RS 4 +GAMEMODERUNEXEC="command" +.RE + +When this is set, gamemoderun will execute the command given by that environment variable, and the command line passed to gamemoderun will be passed as arguments to that command. GameMode will not be applied to the wrapper command, just the game itself. + +.SH SEE ALSO +gamemoded(8) + +.SH ABOUT +GameMode source can be found at \fIhttps://github.com/FeralInteractive/gamemode.git\fR + +.SH AUTHOR +Feral Interactive (linux-contact@feralinteractive.com) diff -Nru gamemode-1.5.1/data/gamemoderun.in gamemode-1.6.1/data/gamemoderun.in --- gamemode-1.5.1/data/gamemoderun.in 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/data/gamemoderun.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -#!/bin/bash -# Helper script to launch games with gamemode - -# Path to installed libgamemodeauto. ld.so will substitute "\$LIB" to get the -# appropriate path depending on whether the app is 32- or 64-bit. -GAMEMODEAUTO="@GAMEMODE_PREFIX@/\$LIB/libgamemodeauto.so.0" - -LD_PRELOAD="${GAMEMODEAUTO}${LD_PRELOAD:+:$LD_PRELOAD}" - -exec $GAMEMODERUNEXEC env LD_PRELOAD="${LD_PRELOAD}" "$@" diff -Nru gamemode-1.5.1/data/gamemode-simulate-game.1.in gamemode-1.6.1/data/gamemode-simulate-game.1.in --- gamemode-1.5.1/data/gamemode-simulate-game.1.in 1970-01-01 00:00:00.000000000 +0000 +++ gamemode-1.6.1/data/gamemode-simulate-game.1.in 2021-02-18 19:00:12.000000000 +0000 @@ -0,0 +1,33 @@ +.\" Manpage for gamemode-simulate-game. +.\" Contact linux-contact@feralinteractive.com to correct errors or typos. +.TH gamemode-simulate-game 1 "26 May 2020" "@GAMEMODE_VERSION@" "gamemode-simulate-game man page" +.SH NAME +gamemode-simulate-game \- simulate a game using gamemode +.SH SYNOPSIS +\fBgamemode-simulate-game\fR +.SH DESCRIPTION +\fBGameMode\fR is a daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS. + +The design has a clear cut abstraction between the host daemon and library (\fBgamemoded\fR and \fBlibgamemode\fR), and the client loaders (\fBlibgamemodeauto\fR and \fBgamemode_client.h\fR) that allows for safe usage without worrying about whether the daemon is installed or running. This design also means that while the host library currently relies on systemd for exchanging messages with the daemon, it's entirely possible to implement other internals that still work with the same clients. + +\fBGameMode\fR was designed primarily as a stop-gap solution to problems with the Intel and AMD CPU powersave or ondemand governors, but is intended to be expanded beyond just CPU governor states, as there are a wealth of automation tasks one might want to apply. + +.SH USAGE +The executable starts gamemode, sleeps for 10 seconds and stops it. It will exit with zero if everything works fine, else it will print an error and exit with one. + +To use this with a CI you might need to start a dbus session by hand. This can be done with: + +.RS 4 +dbus-run-session -- gamemode-simulate-game +.RE + +Note that this might output to stderr, even if it exits with zero. + +.SH SEE ALSO +gamemoded(8), gamemoderun(1), dbus-run-session(1) + +.SH ABOUT +GameMode source can be found at \fIhttps://github.com/FeralInteractive/gamemode.git\fR + +.SH AUTHOR +Feral Interactive (linux-contact@feralinteractive.com) diff -Nru gamemode-1.5.1/data/io.github.feralinteractive.gamemode.metainfo.xml gamemode-1.6.1/data/io.github.feralinteractive.gamemode.metainfo.xml --- gamemode-1.5.1/data/io.github.feralinteractive.gamemode.metainfo.xml 1970-01-01 00:00:00.000000000 +0000 +++ gamemode-1.6.1/data/io.github.feralinteractive.gamemode.metainfo.xml 2021-02-18 19:00:12.000000000 +0000 @@ -0,0 +1,39 @@ + + + io.github.feralinteractive.gamemode + + gamemode + daemon that allows games to request a set of optimizations be temporarily applied + Feral Interactive + + + + FSFAP + BSD-3-Clause + + +

+ GameMode is a daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS and/or a game process. +

+

+ It was designed primarily as a stop-gap solution to problems with the Intel and AMD CPU powersave or ondemand governors, but is now host to a range of optimisation features and configurations. +

+

Currently GameMode includes support for optimisations including:

+
    +
  • CPU governor
  • +
  • I/O priority
  • +
  • Process niceness
  • +
  • Kernel scheduler (SCHED_ISO)
  • +
  • Screensaver inhibiting
  • +
  • GPU performance mode (NVIDIA and AMD)
  • +
  • GPU overclocking (NVIDIA)
  • +
  • Custom scripts
  • +
+
+ + + + Utility + Game + +
diff -Nru gamemode-1.5.1/data/meson.build gamemode-1.6.1/data/meson.build --- gamemode-1.5.1/data/meson.build 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/data/meson.build 2021-02-18 19:00:12.000000000 +0000 @@ -2,6 +2,7 @@ data_conf.set('BINDIR', path_bindir) data_conf.set('LIBEXECDIR', path_libexecdir) data_conf.set('GAMEMODE_PREFIX', path_prefix) +data_conf.set('GAMEMODE_VERSION', meson.project_version()) # Pull in the example config config_example = run_command( @@ -10,7 +11,7 @@ ).stdout().strip() data_conf.set('GAMEMODE_EXAMPLE_CONFIG', config_example) -if with_systemd == true +if sd_bus_provider == 'systemd' # Install systemd user unit configure_file( input: 'gamemoded.service.in', @@ -38,18 +39,65 @@ ) # Install the helper run script -configure_file( - input: 'gamemoderun.in', - output: 'gamemoderun', - configuration: data_conf, +install_data( + files('gamemoderun'), install_dir: path_bindir, install_mode: 'rwxr-xr-x', ) -# Configure and install the man page -manpage = configure_file( +# Configure and install man pages +gamemoded_manpage = configure_file( input: files('gamemoded.8.in'), output: 'gamemoded.8', configuration: data_conf, ) -install_man(manpage) + +install_man( + gamemoded_manpage, + install_dir: join_paths(path_mandir, 'man8') +) + +gamemoderun_manpage = configure_file( + input: files('gamemoderun.1.in'), + output: 'gamemoderun.1', + configuration: data_conf, +) + +install_man( + gamemoderun_manpage, + install_dir: join_paths(path_mandir, 'man1') +) + +if with_examples + example_manpage = configure_file( + input: files('gamemode-simulate-game.1.in'), + output: 'gamemode-simulate-game.1', + configuration: data_conf, + ) + + install_man( + example_manpage, + install_dir: join_paths(path_mandir, 'man1') + ) +endif + +# Install metainfo +metainfo_file = files('io.github.feralinteractive.gamemode.metainfo.xml') + +install_data( + metainfo_file, + install_dir: path_metainfo, +) + +# Validate metainfo +appstreamcli = find_program( + 'appstreamcli', + required: false +) +if appstreamcli.found() + test( + 'validate metainfo file', + appstreamcli, + args: ['validate', '--no-net', '--pedantic', metainfo_file], + ) +endif diff -Nru gamemode-1.5.1/debian/changelog gamemode-1.6.1/debian/changelog --- gamemode-1.5.1/debian/changelog 2020-06-25 15:58:01.000000000 +0000 +++ gamemode-1.6.1/debian/changelog 2021-02-19 11:59:15.000000000 +0000 @@ -1,64 +1,86 @@ -gamemode (1.5.1-0ubuntu6) groovy; urgency=medium +gamemode (1.6.1-1) unstable; urgency=medium - * debian/*.install: - - use the correct paths for other architectures + * New upstream version 1.6.1 + * Set Multi-Arch: allowed for package gamemode + * Make packages cross-arch binNMU safe - -- Sebastien Bacher Thu, 25 Jun 2020 17:58:01 +0200 + -- Stephan Lachnit Fri, 19 Feb 2021 12:59:15 +0100 -gamemode (1.5.1-0ubuntu5) groovy; urgency=medium +gamemode (1.6-1) unstable; urgency=medium - * Backport some improvements from Debian - * debian/control, debian/rules: - - build on other architectures now (lp: #1883253) - - set multiarch informations - - recommend 32bit libs on amd64 - * debian/patches/rename-example-to-gamemode-simulate-game: - - rename the example with a patch rather than in the rules + * New upstream release. + * Drop upstreamed patches. + * Rename libgamemode-dev package to gamemode-dev. + * Add patch to fix gamemoded --test on Debian. - -- Sebastien Bacher Thu, 25 Jun 2020 17:29:27 +0200 + -- Stephan Lachnit Fri, 11 Sep 2020 23:41:51 +0200 -gamemode (1.5.1-0ubuntu4) groovy; urgency=medium +gamemode (1.5.1-5) unstable; urgency=medium - * debian/patches/git_default_gov.patch: - - revert to previous governor instead of "powersave" when exiting - (lp: #1875740) + * libgamemodeauto depends on libgamemode + * improve descriptions of the libraries + * recommend 32bit libs on amd64 + * put libgamemode.so in libgamemode0 package - -- Sebastien Bacher Mon, 18 May 2020 15:05:23 +0200 + -- Stephan Lachnit Wed, 17 Jun 2020 10:48:04 +0200 -gamemode (1.5.1-0ubuntu3) focal; urgency=medium +gamemode (1.5.1-4) unstable; urgency=medium - * debian/patches/revert_libinih_depends.patch: - - revert the recent changes from 1.5.1 which made the package use the - libinih library, that is currently in universe + * fix autopkgtest + * fix metadata + * move gamemoderun out of daemon package + * mark libgamemode-dev as Multi-Arch: same - -- Sebastien Bacher Mon, 20 Apr 2020 11:07:30 +0200 + -- Stephan Lachnit Wed, 13 May 2020 15:29:59 +0200 -gamemode (1.5.1-0ubuntu2) focal; urgency=medium +gamemode (1.5.1-3) unstable; urgency=medium - * debian/gamemode.postinst, debian/rules: - - use 'dh_installsystemduser --no-enable', the service is dbus - activated when needed. Also clean state for upgrades + * Upgrade to debhelper-compat (= 13) + * Fix disabling the autostart of the daemon + * Put daemon in a separate package for proper mutliarch + * Add Multi-Arch entries in control file + * Now reverts to previous cpu govenour instead of powersave + * Preparing autopkgtest via gamemode-simulate-game - -- Sebastien Bacher Fri, 27 Mar 2020 11:20:27 +0100 + -- Stephan Lachnit Fri, 01 May 2020 22:30:38 +0200 -gamemode (1.5.1-0ubuntu1) focal; urgency=medium +gamemode (1.5.1-2) unstable; urgency=medium - * New upstream version - * debian/lib.symbols, debian/rules: - - include symbols versioning for the libraries - * debian/control: - - libgamemode0 Recommends gamemode since the library talks to the - service and isn't really useful without it installed - - libgamemodeauto-dev Depends on libgamemode-dev - - updated libinih requirement + [ Stephan Lachnit ] + * Remove README.debian + * Rename example to gamemode-simulate-game as patch for multiarch + * Clean up debian/rules file + * Remove debian/clean file again (debclean works fine) + * Remove lintian override for man-page to follow Debian Policy + * Remove TODO.debian + + [ Jonathan Carter ] + * Add symbol files + (Merged from MR#8, thanks seb128) + * Reduce number of -dev packages generated + (Merged from MR#9, thanks seb128) + * Deal with upgrades from previous buggy versions + where service was autostarted + (Merged from MR#10, thanks seb128) + * Manually merge changes from Stephan above + (Merged from MR11, thanks stephanlachnit) + * Suggest gnome-shell-extension-gamemode in the package description + and add to Suggests field. + + -- Jonathan Carter Thu, 30 Apr 2020 13:44:10 +0200 + +gamemode (1.5.1-1) unstable; urgency=medium + + * New upstream release + * Remove README.debian (no longer relevant) - -- Sebastien Bacher Mon, 23 Mar 2020 15:07:08 +0100 + -- Jonathan Carter Sat, 28 Mar 2020 11:39:55 +0200 gamemode (1.5-1) unstable; urgency=medium [ Stephan Lachnit ] * New upstream release - * Update standards version to 4.5 + * Update standards version to 4.5.0 * Add Rules-Require-Root: no * Add debian/clean file and remove debian/.gitignore diff -Nru gamemode-1.5.1/debian/clean gamemode-1.6.1/debian/clean --- gamemode-1.5.1/debian/clean 2020-06-25 14:59:40.000000000 +0000 +++ gamemode-1.6.1/debian/clean 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -/obj-x86_64-linux-gnu/ diff -Nru gamemode-1.5.1/debian/control gamemode-1.6.1/debian/control --- gamemode-1.5.1/debian/control 2020-06-25 15:01:49.000000000 +0000 +++ gamemode-1.6.1/debian/control 2020-11-29 08:18:40.000000000 +0000 @@ -1,28 +1,34 @@ Source: gamemode -Section: libs +Section: games Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Jonathan Carter -Build-Depends: debhelper-compat (= 12), - git, +Maintainer: Debian Games Team +Uploaders: Jonathan Carter , + Stephan Lachnit , +Build-Depends: debhelper-compat (= 13), libdbus-1-dev, - libinih-dev (>= 48), - libinih1, + libinih-dev, libsystemd-dev, meson, ninja-build, pkg-config, - systemd + systemd, Rules-Requires-Root: no -Standards-Version: 4.5.0 +Standards-Version: 4.5.1 Homepage: https://github.com/FeralInteractive/gamemode Vcs-Git: https://salsa.debian.org/games-team/gamemode.git Vcs-Browser: https://salsa.debian.org/games-team/gamemode Package: gamemode Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, ${shlibs:Depends}, libgamemode0, libgamemodeauto0 +Multi-Arch: allowed +Depends: ${misc:Depends}, + ${shlibs:Depends}, + gamemode-daemon, + libgamemode0, + libgamemodeauto0, +Recommends: libgamemode0:i386 [amd64], + libgamemodeauto0:i386 [amd64], +Suggests: gnome-shell-extension-gamemode, Description: Optimise Linux system performance on demand GameMode is a daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS. @@ -40,18 +46,24 @@ be expanded beyond just CPU governor states, as there are a wealth of automation tasks one might want to apply. . - This package includes a program called '/usr/libexec/gamemode-simulate-game', - which invokes gamemode, sleeps for 10 seconds and then exits. This allows you - to test whether gamemode is working properly on your system, it will - return gamemode's error message if something went wrong, otherwise it - will exit with a 0 status. + This package is a metapackage including everything that is necessary to run + gamemode-enabled games or to enable it by hand for applications. It includes + a program called '/usr/games/gamemoderun', which can invoke gamemode into any + application. It also includes '/usr/games/gamemode-simulate-game', which + invokes gamemode, sleeps for 10 seconds and then exits. This allows you to + test whether gamemode is working properly on your system, it will return + gamemode's error message if something went wrong, otherwise it will exit with + a 0 status. -Package: libgamemode0 +Package: gamemode-daemon +Section: misc Architecture: any -Multi-Arch: same -Depends: ${misc:Depends}, ${shlibs:Depends} -Recommends: gamemode -Description: Optimise Linux system performance on demand (libraries) +Multi-Arch: foreign +Breaks: gamemode (<< 1.5.1-3), + libgamemode0 (<< 1.5.1-3), +Depends: ${misc:Depends}, + ${shlibs:Depends}, +Description: Optimise Linux system performance on demand (daemon) GameMode is a daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS. . @@ -68,16 +80,16 @@ be expanded beyond just CPU governor states, as there are a wealth of automation tasks one might want to apply. . - This package provides the base library for gamemode. + This package provides the daemon and helper files. -Package: libgamemode-dev -Replaces: libgamemode0-dev -Breaks: libgamemode0-dev -Section: libdevel +Package: libgamemode0 +Section: libs Architecture: any Multi-Arch: same -Depends: ${misc:Depends}, ${shlibs:Depends}, libgamemode0 (= ${binary:Version}) -Description: Optimise Linux system performance on demand (dev files) +Depends: ${misc:Depends}, + ${shlibs:Depends}, + gamemode-daemon, +Description: Optimise Linux system performance on demand (host library) GameMode is a daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS. . @@ -94,14 +106,17 @@ be expanded beyond just CPU governor states, as there are a wealth of automation tasks one might want to apply. . - This package provides the development files for the base library - for gamemode. + This package provides the host library for gamemode. It is an internal + library which communicates with the daemon. Package: libgamemodeauto0 +Section: libs Architecture: any Multi-Arch: same -Depends: ${misc:Depends}, ${shlibs:Depends} -Description: Automatically optimise Linux system performance on demand +Depends: ${misc:Depends}, + ${shlibs:Depends}, +Recommends: libgamemode0 (= ${binary:Version}), +Description: Optimise Linux system performance on demand (client library) GameMode is a daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS. . @@ -118,19 +133,21 @@ be expanded beyond just CPU governor states, as there are a wealth of automation tasks one might want to apply. . - This package provides the libgamemodeauto library. + This package provides the libgamemodeauto library. It is a client library + which loads libgamemode if installed. The library can also be used to inject + gamemode into any program with the LD_PRELOAD environment variable. -Package: libgamemodeauto-dev -Replaces: libgamemodeauto0-dev -Breaks: libgamemodeauto0-dev +Package: gamemode-dev +Replaces: libgamemode-dev, libgamemode0-dev, libgamemodeauto-dev +Breaks: libgamemode-dev, libgamemode0-dev, libgamemodeauto-dev Section: libdevel Architecture: any Multi-Arch: same -Depends: ${misc:Depends}, - ${shlibs:Depends}, +Depends: ${misc:Depends}, libgamemodeauto0 (= ${binary:Version}), - libgamemode-dev, -Description: Automatically optimise system performance on demand (dev files) +Recommends: libgamemode0 (= ${binary:Version}), + gamemode:any, +Description: Optimise Linux system performance on demand (dev files) GameMode is a daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS. . @@ -147,4 +164,4 @@ be expanded beyond just CPU governor states, as there are a wealth of automation tasks one might want to apply. . - This package provides the libgamemodeauto library development files. + This package provides the development files for gamemode. diff -Nru gamemode-1.5.1/debian/copyright gamemode-1.6.1/debian/copyright --- gamemode-1.5.1/debian/copyright 2020-06-25 14:59:40.000000000 +0000 +++ gamemode-1.6.1/debian/copyright 2020-11-28 15:49:27.000000000 +0000 @@ -1,19 +1,20 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: gamemode +Upstream-Contact: Feral Interactive Source: https://github.com/FeralInteractive/gamemode Files: * Copyright: 2017-2020 Feral Interactive License: BSD-3-clause +Files: data/io.github.feralinteractive.gamemode.metainfo.xml +Copyright: 2020 Feral Interactive +License: FSFAP + Files: debian/* Copyright: 2018-2020 Jonathan Carter License: BSD-3-clause -Files: subprojects/inih/* -Copyright: 2018 Ben Hoyt -License: BSD-3-clause - License: BSD-3-clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -38,3 +39,8 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: FSFAP + Copying and distribution of this file, with or without modification, are + permitted in any medium without royalty provided the copyright notice and this + notice are preserved. This file is offered as-is, without any warranty. diff -Nru gamemode-1.5.1/debian/gamemode-daemon.install gamemode-1.6.1/debian/gamemode-daemon.install --- gamemode-1.5.1/debian/gamemode-daemon.install 1970-01-01 00:00:00.000000000 +0000 +++ gamemode-1.6.1/debian/gamemode-daemon.install 2020-11-28 16:17:49.000000000 +0000 @@ -0,0 +1,8 @@ +usr/bin/gamemoded +usr/libexec/cpugovctl +usr/libexec/gpuclockctl +usr/lib/systemd/ +usr/share/dbus-1/ +usr/share/polkit-1/ +usr/share/man/man8/gamemoded.8 +usr/share/gamemode/gamemode.ini diff -Nru gamemode-1.5.1/debian/gamemode-dev.install gamemode-1.6.1/debian/gamemode-dev.install --- gamemode-1.5.1/debian/gamemode-dev.install 1970-01-01 00:00:00.000000000 +0000 +++ gamemode-1.6.1/debian/gamemode-dev.install 2020-11-28 15:49:27.000000000 +0000 @@ -0,0 +1,5 @@ +usr/include/ +usr/lib/*/pkgconfig/gamemode.pc +usr/lib/*/pkgconfig/libgamemodeauto.pc +usr/lib/*/libgamemodeauto.so +usr/lib/*/libgamemodeauto.a diff -Nru gamemode-1.5.1/debian/gamemode.install gamemode-1.6.1/debian/gamemode.install --- gamemode-1.5.1/debian/gamemode.install 2020-06-25 14:59:40.000000000 +0000 +++ gamemode-1.6.1/debian/gamemode.install 2020-11-28 16:17:19.000000000 +0000 @@ -1,7 +1,5 @@ -usr/bin -usr/lib/systemd -usr/share/dbus-1 -usr/share/polkit-1 -usr/share/man -obj-*/example/gamemode-simulate-game usr/libexec -example/gamemode.ini etc +usr/bin/gamemoderun usr/games/ +usr/bin/gamemode-simulate-game usr/games/ +usr/share/man/man1/gamemoderun.1 +usr/share/man/man1/gamemode-simulate-game.1 +usr/share/metainfo/io.github.feralinteractive.gamemode.metainfo.xml diff -Nru gamemode-1.5.1/debian/gamemode.postinst gamemode-1.6.1/debian/gamemode.postinst --- gamemode-1.5.1/debian/gamemode.postinst 2020-06-25 14:59:40.000000000 +0000 +++ gamemode-1.6.1/debian/gamemode.postinst 2020-11-28 15:49:25.000000000 +0000 @@ -1,10 +1,10 @@ -#! /bin/sh +#!/bin/sh set -e case "$1" in configure) # Disable the job by default for users updating from a buggy version - if dpkg --compare-versions "$2" lt-nl 1.5.1-0ubuntu2; then + if dpkg --compare-versions "$2" lt-nl 1.5.1-3; then if deb-systemd-helper --user --quiet was-enabled 'gamemoded.service'; then printf "Disable user unit that shouldn't have been auto enabled\n" deb-systemd-helper --user disable 'gamemoded.service' >/dev/null || true @@ -17,4 +17,3 @@ esac #DEBHELPER# - diff -Nru gamemode-1.5.1/debian/gbp.conf gamemode-1.6.1/debian/gbp.conf --- gamemode-1.5.1/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 +++ gamemode-1.6.1/debian/gbp.conf 2020-11-28 15:54:55.000000000 +0000 @@ -0,0 +1,3 @@ +[DEFAULT] +upstream-branch = upstream/latest +debian-branch = debian/latest diff -Nru gamemode-1.5.1/debian/libgamemode0.install gamemode-1.6.1/debian/libgamemode0.install --- gamemode-1.5.1/debian/libgamemode0.install 2020-06-25 15:57:28.000000000 +0000 +++ gamemode-1.6.1/debian/libgamemode0.install 2020-11-28 15:49:26.000000000 +0000 @@ -1,2 +1,2 @@ usr/lib/*/libgamemode.so.* -usr/libexec/*ctl +usr/lib/*/libgamemode.so diff -Nru gamemode-1.5.1/debian/libgamemode0.lintian-overrides gamemode-1.6.1/debian/libgamemode0.lintian-overrides --- gamemode-1.5.1/debian/libgamemode0.lintian-overrides 2020-06-25 14:59:40.000000000 +0000 +++ gamemode-1.6.1/debian/libgamemode0.lintian-overrides 2020-11-29 08:15:51.000000000 +0000 @@ -1 +1,2 @@ -libgamemode0: no-symbols-control-file +# libgamemode.so can be loaded as a fallback from libgamemodeauto +link-to-shared-library-in-wrong-package diff -Nru gamemode-1.5.1/debian/libgamemode0.symbols gamemode-1.6.1/debian/libgamemode0.symbols --- gamemode-1.5.1/debian/libgamemode0.symbols 2020-06-25 14:59:40.000000000 +0000 +++ gamemode-1.6.1/debian/libgamemode0.symbols 2020-11-29 08:15:51.000000000 +0000 @@ -1,4 +1,5 @@ libgamemode.so.0 libgamemode0 #MINVER# +* Build-Depends-Package: gamemode-dev open_fdinfo_dir@Base 1.5 open_pidfds@Base 1.5 pidfds_to_pids@Base 1.5 diff -Nru gamemode-1.5.1/debian/libgamemodeauto0.lintian-overrides gamemode-1.6.1/debian/libgamemodeauto0.lintian-overrides --- gamemode-1.5.1/debian/libgamemodeauto0.lintian-overrides 2020-06-25 14:59:40.000000000 +0000 +++ gamemode-1.6.1/debian/libgamemodeauto0.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -libgamemodeauto0: no-symbols-control-file diff -Nru gamemode-1.5.1/debian/libgamemodeauto0.symbols gamemode-1.6.1/debian/libgamemodeauto0.symbols --- gamemode-1.5.1/debian/libgamemodeauto0.symbols 2020-06-25 14:59:40.000000000 +0000 +++ gamemode-1.6.1/debian/libgamemodeauto0.symbols 2020-11-29 08:15:51.000000000 +0000 @@ -1,3 +1,4 @@ libgamemodeauto.so.0 libgamemodeauto0 #MINVER# +* Build-Depends-Package: gamemode-dev gamemode_request_end@Base 1.5 gamemode_request_start@Base 1.5 diff -Nru gamemode-1.5.1/debian/libgamemodeauto-dev.install gamemode-1.6.1/debian/libgamemodeauto-dev.install --- gamemode-1.5.1/debian/libgamemodeauto-dev.install 2020-06-25 15:57:43.000000000 +0000 +++ gamemode-1.6.1/debian/libgamemodeauto-dev.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -usr/lib/*/libgamemodeauto.so -usr/lib/*/pkgconfig/gamemode-auto.pc diff -Nru gamemode-1.5.1/debian/libgamemode-dev.install gamemode-1.6.1/debian/libgamemode-dev.install --- gamemode-1.5.1/debian/libgamemode-dev.install 2020-06-25 15:57:53.000000000 +0000 +++ gamemode-1.6.1/debian/libgamemode-dev.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -usr/include/ -usr/lib/*/libgamemode.so -usr/lib/*/pkgconfig/gamemode.pc diff -Nru gamemode-1.5.1/debian/lintian-overrides gamemode-1.6.1/debian/lintian-overrides --- gamemode-1.5.1/debian/lintian-overrides 2020-06-25 14:59:40.000000000 +0000 +++ gamemode-1.6.1/debian/lintian-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -# Trivial programs without options, may add manpages for them at a later stage -gamemode: binary-without-manpage usr/bin/gamemoderun diff -Nru gamemode-1.5.1/debian/patches/0001-gamemoded-test-fix.patch gamemode-1.6.1/debian/patches/0001-gamemoded-test-fix.patch --- gamemode-1.5.1/debian/patches/0001-gamemoded-test-fix.patch 1970-01-01 00:00:00.000000000 +0000 +++ gamemode-1.6.1/debian/patches/0001-gamemoded-test-fix.patch 2021-02-19 11:58:34.000000000 +0000 @@ -0,0 +1,16 @@ +Description: adjust location of gamemoderun for Debian +Author: Stephan Lachnit +Forwarded: not-needed +Last-Update: 2020-09-11 + +--- a/daemon/gamemode-tests.c ++++ b/daemon/gamemode-tests.c +@@ -268,7 +268,7 @@ + /* Close stdout, we don't care if sh prints anything */ + fclose(stdout); + /* Preload into sh and then kill it */ +- if (execl("/usr/bin/gamemoderun", "/usr/bin/gamemoderun", "sleep", "5", (char *)NULL) == ++ if (execl("/usr/games/gamemoderun", "/usr/games/gamemoderun", "sleep", "5", (char *)NULL) == + -1) { + LOG_ERROR("failed to launch gamemoderun with execl: %s\n", strerror(errno)); + return -1; diff -Nru gamemode-1.5.1/debian/patches/git_default_gov.patch gamemode-1.6.1/debian/patches/git_default_gov.patch --- gamemode-1.5.1/debian/patches/git_default_gov.patch 2020-06-25 14:59:40.000000000 +0000 +++ gamemode-1.6.1/debian/patches/git_default_gov.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -From 1c9cd2de5bd47c04a124445eb5b567f37ec3e85f Mon Sep 17 00:00:00 2001 -From: Anjune <64501721+Anjune@users.noreply.github.com> -Date: Tue, 28 Apr 2020 23:40:24 +0200 -Subject: [PATCH] Make system revert to previous governor instead of - "powersave" - -See issue 214. ---- - example/gamemode.ini | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/example/gamemode.ini b/example/gamemode.ini -index 9c59857..a5bb248 100644 ---- a/example/gamemode.ini -+++ b/example/gamemode.ini -@@ -5,7 +5,7 @@ reaper_freq=5 - ; The desired governor is used when entering GameMode instead of "performance" - desiredgov=performance - ; The default governer is used when leaving GameMode instead of restoring the original value --defaultgov=powersave -+;defaultgov=powersave - - ; The iGPU desired governor is used when the integrated GPU is under heavy load - igpu_desiredgov=powersave - diff -Nru gamemode-1.5.1/debian/patches/rename-example-to-gamemode-simulate-game gamemode-1.6.1/debian/patches/rename-example-to-gamemode-simulate-game --- gamemode-1.5.1/debian/patches/rename-example-to-gamemode-simulate-game 2020-06-25 15:02:20.000000000 +0000 +++ gamemode-1.6.1/debian/patches/rename-example-to-gamemode-simulate-game 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -Description: Rename `example` to `gamemode-simulate-game` -Forwarded: https://github.com/FeralInteractive/gamemode/pull/212 -Author: Stephan Lachnit - ---- a/example/meson.build -+++ b/example/meson.build -@@ -1,6 +1,6 @@ - # An example game - executable( -- 'example', -+ 'gamemode-simulate-game', - sources: [ - 'main.c', - ], diff -Nru gamemode-1.5.1/debian/patches/revert_libinih_depends.patch gamemode-1.6.1/debian/patches/revert_libinih_depends.patch --- gamemode-1.5.1/debian/patches/revert_libinih_depends.patch 2020-06-25 14:59:40.000000000 +0000 +++ gamemode-1.6.1/debian/patches/revert_libinih_depends.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,945 +0,0 @@ -# Description: revert the 1.5.1 libinih changes, they create a depends -# on the shared library but that one is in Universe at the moment -# We will revert and properly MIR the library next cycle -Index: gamemode-1.5.1/subprojects/inih/cpp/INIReader.cpp -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/cpp/INIReader.cpp -+++ gamemode-1.5.1/subprojects/inih/cpp/INIReader.cpp -@@ -1,9 +1,5 @@ - // Read an INI file into easy-to-access name/value pairs. - --// SPDX-License-Identifier: BSD-3-Clause -- --// Copyright (C) 2009-2020, Ben Hoyt -- - // inih and INIReader are released under the New BSD license (see LICENSE.txt). - // Go to the project home page for more info: - // -@@ -22,12 +18,6 @@ INIReader::INIReader(const string& filen - _error = ini_parse(filename.c_str(), ValueHandler, this); - } - --INIReader::INIReader(const char *buffer, size_t buffer_size) --{ -- string content(buffer, buffer_size); -- _error = ini_parse_string(content.c_str(), ValueHandler, this); --} -- - int INIReader::ParseError() const - { - return _error; -@@ -40,12 +30,6 @@ string INIReader::Get(const string& sect - return _values.count(key) ? _values.find(key)->second : default_value; - } - --string INIReader::GetString(const string& section, const string& name, const string& default_value) const --{ -- const string str = Get(section, name, ""); -- return str.empty() ? default_value : str; --} -- - long INIReader::GetInteger(const string& section, const string& name, long default_value) const - { - string valstr = Get(section, name, ""); -@@ -78,22 +62,6 @@ bool INIReader::GetBoolean(const string& - return default_value; - } - --bool INIReader::HasSection(const string& section) const --{ -- const string key = MakeKey(section, ""); -- std::map::const_iterator pos = _values.lower_bound(key); -- if (pos == _values.end()) -- return false; -- // Does the key at the lower_bound pos start with "section"? -- return pos->first.compare(0, key.length(), key) == 0; --} -- --bool INIReader::HasValue(const string& section, const string& name) const --{ -- string key = MakeKey(section, name); -- return _values.count(key); --} -- - string INIReader::MakeKey(const string& section, const string& name) - { - string key = section + "=" + name; -@@ -105,12 +73,10 @@ string INIReader::MakeKey(const string& - int INIReader::ValueHandler(void* user, const char* section, const char* name, - const char* value) - { -- if (!name) // Happens when INI_CALL_HANDLER_ON_NEW_SECTION enabled -- return 1; -- INIReader* reader = static_cast(user); -+ INIReader* reader = (INIReader*)user; - string key = MakeKey(section, name); - if (reader->_values[key].size() > 0) - reader->_values[key] += "\n"; -- reader->_values[key] += value ? value : ""; -+ reader->_values[key] += value; - return 1; - } -Index: gamemode-1.5.1/subprojects/inih/cpp/INIReader.h -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/cpp/INIReader.h -+++ gamemode-1.5.1/subprojects/inih/cpp/INIReader.h -@@ -1,9 +1,5 @@ - // Read an INI file into easy-to-access name/value pairs. - --// SPDX-License-Identifier: BSD-3-Clause -- --// Copyright (C) 2009-2020, Ben Hoyt -- - // inih and INIReader are released under the New BSD license (see LICENSE.txt). - // Go to the project home page for more info: - // -@@ -22,11 +18,7 @@ class INIReader - public: - // Construct INIReader and parse given filename. See ini.h for more info - // about the parsing. -- explicit INIReader(const std::string& filename); -- -- // Construct INIReader and parse given buffer. See ini.h for more info -- // about the parsing. -- explicit INIReader(const char *buffer, size_t buffer_size); -+ INIReader(const std::string& filename); - - // Return the result of ini_parse(), i.e., 0 on success, line number of - // first error on parse error, or -1 on file open error. -@@ -36,11 +28,6 @@ public: - std::string Get(const std::string& section, const std::string& name, - const std::string& default_value) const; - -- // Get a string value from INI file, returning default_value if not found, -- // empty, or contains only whitespace. -- std::string GetString(const std::string& section, const std::string& name, -- const std::string& default_value) const; -- - // Get an integer (long) value from INI file, returning default_value if - // not found or not a valid integer (decimal "1234", "-1234", or hex "0x4d2"). - long GetInteger(const std::string& section, const std::string& name, long default_value) const; -@@ -55,13 +42,6 @@ public: - // and valid false values are "false", "no", "off", "0" (not case sensitive). - bool GetBoolean(const std::string& section, const std::string& name, bool default_value) const; - -- // Return true if the given section exists (section must contain at least -- // one name=value pair). -- bool HasSection(const std::string& section) const; -- -- // Return true if a value exists with the given section and field names. -- bool HasValue(const std::string& section, const std::string& name) const; -- - private: - int _error; - std::map _values; -Index: gamemode-1.5.1/subprojects/inih/examples/cpptest.sh -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/examples/cpptest.sh -+++ /dev/null -@@ -1,5 +0,0 @@ --#!/usr/bin/env bash -- --g++ INIReaderExample.cpp ../cpp/INIReader.cpp ../ini.c -o INIReaderExample --./INIReaderExample > cpptest.txt --rm INIReaderExample -Index: gamemode-1.5.1/subprojects/inih/examples/cpptest.txt -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/examples/cpptest.txt -+++ /dev/null -@@ -1,3 +0,0 @@ --Config loaded from 'test.ini': version=6, name=Bob Smith, email=bob@smith.com, pi=3.14159, active=1 --Has values: user.name=1, user.nose=0 --Has sections: user=1, fizz=0 -Index: gamemode-1.5.1/subprojects/inih/examples/ini_example.c -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/examples/ini_example.c -+++ gamemode-1.5.1/subprojects/inih/examples/ini_example.c -@@ -40,9 +40,5 @@ int main(int argc, char* argv[]) - } - printf("Config loaded from 'test.ini': version=%d, name=%s, email=%s\n", - config.version, config.name, config.email); -- -- free((void*)config.name); -- free((void*)config.email); -- - return 0; - } -Index: gamemode-1.5.1/subprojects/inih/examples/INIReaderExample.cpp -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/examples/INIReaderExample.cpp -+++ gamemode-1.5.1/subprojects/inih/examples/INIReaderExample.cpp -@@ -17,9 +17,5 @@ int main() - << reader.Get("user", "email", "UNKNOWN") << ", pi=" - << reader.GetReal("user", "pi", -1) << ", active=" - << reader.GetBoolean("user", "active", true) << "\n"; -- std::cout << "Has values: user.name=" << reader.HasValue("user", "name") -- << ", user.nose=" << reader.HasValue("user", "nose") << "\n"; -- std::cout << "Has sections: user=" << reader.HasSection("user") -- << ", fizz=" << reader.HasSection("fizz") << "\n"; - return 0; - } -Index: gamemode-1.5.1/subprojects/inih/extra/Makefile.static -=================================================================== ---- /dev/null -+++ gamemode-1.5.1/subprojects/inih/extra/Makefile.static -@@ -0,0 +1,19 @@ -+# Simple makefile to build inih as a static library using g++ -+ -+SRC = ../ini.c -+OBJ = $(SRC:.c=.o) -+OUT = libinih.a -+INCLUDES = -I.. -+CCFLAGS = -g -O2 -+CC = g++ -+ -+default: $(OUT) -+ -+.c.o: -+ $(CC) $(INCLUDES) $(CCFLAGS) $(EXTRACCFLAGS) -c $< -o $@ -+ -+$(OUT): $(OBJ) -+ ar rcs $(OUT) $(OBJ) $(EXTRAARFLAGS) -+ -+clean: -+ rm -f $(OBJ) $(OUT) -Index: gamemode-1.5.1/subprojects/inih/.git -=================================================================== ---- /dev/null -+++ gamemode-1.5.1/subprojects/inih/.git -@@ -0,0 +1 @@ -+gitdir: ../../.git/modules/subprojects/inih -Index: gamemode-1.5.1/subprojects/inih/ini.c -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/ini.c -+++ gamemode-1.5.1/subprojects/inih/ini.c -@@ -1,9 +1,5 @@ - /* inih -- simple .INI file parser - --SPDX-License-Identifier: BSD-3-Clause -- --Copyright (C) 2009-2020, Ben Hoyt -- - inih is released under the New BSD license (see LICENSE.txt). Go to the project - home page for more info: - -@@ -74,7 +70,7 @@ static char* find_chars_or_comment(const - /* Version of strncpy that ensures dest (size bytes) is null-terminated. */ - static char* strncpy0(char* dest, const char* src, size_t size) - { -- strncpy(dest, src, size - 1); -+ strncpy(dest, src, size); - dest[size - 1] = '\0'; - return dest; - } -@@ -89,11 +85,11 @@ int ini_parse_stream(ini_reader reader, - int max_line = INI_MAX_LINE; - #else - char* line; -- size_t max_line = INI_INITIAL_ALLOC; -+ int max_line = INI_INITIAL_ALLOC; - #endif --#if INI_ALLOW_REALLOC && !INI_USE_STACK -+#if INI_ALLOW_REALLOC - char* new_line; -- size_t offset; -+ int offset; - #endif - char section[MAX_SECTION] = ""; - char prev_name[MAX_NAME] = ""; -@@ -119,8 +115,8 @@ int ini_parse_stream(ini_reader reader, - #endif - - /* Scan through stream line by line */ -- while (reader(line, (int)max_line, stream) != NULL) { --#if INI_ALLOW_REALLOC && !INI_USE_STACK -+ while (reader(line, max_line, stream) != NULL) { -+#if INI_ALLOW_REALLOC - offset = strlen(line); - while (offset == max_line - 1 && line[offset - 1] != '\n') { - max_line *= 2; -@@ -132,7 +128,7 @@ int ini_parse_stream(ini_reader reader, - return -2; - } - line = new_line; -- if (reader(line + offset, (int)(max_line - offset), stream) == NULL) -+ if (reader(line + offset, max_line - offset, stream) == NULL) - break; - if (max_line >= INI_MAX_LINE) - break; -@@ -170,10 +166,6 @@ int ini_parse_stream(ini_reader reader, - *end = '\0'; - strncpy0(section, start + 1, sizeof(section)); - *prev_name = '\0'; --#if INI_CALL_HANDLER_ON_NEW_SECTION -- if (!HANDLER(user, section, NULL, NULL) && !error) -- error = lineno; --#endif - } - else if (!error) { - /* No ']' found on section line */ -@@ -202,14 +194,7 @@ int ini_parse_stream(ini_reader reader, - } - else if (!error) { - /* No '=' or ':' found on name[=:]value line */ --#if INI_ALLOW_NO_VALUE -- *end = '\0'; -- name = rstrip(start); -- if (!HANDLER(user, section, name, NULL) && !error) -- error = lineno; --#else - error = lineno; --#endif - } - } - -Index: gamemode-1.5.1/subprojects/inih/ini.h -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/ini.h -+++ gamemode-1.5.1/subprojects/inih/ini.h -@@ -1,9 +1,5 @@ - /* inih -- simple .INI file parser - --SPDX-License-Identifier: BSD-3-Clause -- --Copyright (C) 2009-2020, Ben Hoyt -- - inih is released under the New BSD license (see LICENSE.txt). Go to the project - home page for more info: - -@@ -77,7 +73,7 @@ int ini_parse_string(const char* string, - #endif - - /* Nonzero to allow a UTF-8 BOM sequence (0xEF 0xBB 0xBF) at the start of -- the file. See https://github.com/benhoyt/inih/issues/21 */ -+ the file. See http://code.google.com/p/inih/issues/detail?id=21 */ - #ifndef INI_ALLOW_BOM - #define INI_ALLOW_BOM 1 - #endif -@@ -127,20 +123,6 @@ int ini_parse_string(const char* string, - #define INI_STOP_ON_FIRST_ERROR 0 - #endif - --/* Nonzero to call the handler at the start of each new section (with -- name and value NULL). Default is to only call the handler on -- each name=value pair. */ --#ifndef INI_CALL_HANDLER_ON_NEW_SECTION --#define INI_CALL_HANDLER_ON_NEW_SECTION 0 --#endif -- --/* Nonzero to allow a name without a value (no '=' or ':' on the line) and -- call the handler with value NULL in this case. Default is to treat -- no-value lines as an error. */ --#ifndef INI_ALLOW_NO_VALUE --#define INI_ALLOW_NO_VALUE 0 --#endif -- - #ifdef __cplusplus - } - #endif -Index: gamemode-1.5.1/subprojects/inih/meson.build -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/meson.build -+++ gamemode-1.5.1/subprojects/inih/meson.build -@@ -1,58 +1,18 @@ --project('inih', -- ['c','cpp'], -- meson_version : '>= 0.46.0', -- default_options : ['default_library=both'], -- license : 'BSD-3-Clause', -- version : '48' --) -- --pkg = import('pkgconfig') -- --#### inih #### --install_headers('ini.h') -- --inc_inih = include_directories('.') -- --lib_inih = library('inih', -- ['ini.c'], -- include_directories : inc_inih, -- install : true, -- version : meson.project_version(), -- soversion : '0' --) -- --pkg.generate(lib_inih, -- name : 'inih', -- description : 'simple .INI file parser', -- version : meson.project_version() --) -+# Simple meson build -+project('inih', 'c') - --inih_dep = declare_dependency( -- link_with : lib_inih, -- include_directories : inc_inih --) -- --#### INIReader #### --install_headers('cpp/INIReader.h') -- --inc_INIReader = include_directories('cpp') -- --lib_INIReader = library('INIReader', -- ['cpp/INIReader.cpp'], -- include_directories : inc_INIReader, -- dependencies : inih_dep, -- install : true, -- version : meson.project_version(), -- soversion : '0' --) -- --pkg.generate(lib_INIReader, -- name : 'INIReader', -- description : 'simple .INI file parser for C++', -- version : meson.project_version() --) -+inih_includes = include_directories('.') - --INIReader_dep = declare_dependency( -- link_with : lib_inih, -- include_directories : inc_INIReader -+inih = static_library( -+ 'inih', -+ sources: [ -+ 'ini.c', -+ ], -+ include_directories: inih_includes, -+ install: false, -+) -+ -+inih_dependency = declare_dependency( -+ include_directories: inih_includes, -+ link_with: inih - ) -Index: gamemode-1.5.1/subprojects/inih/README.md -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/README.md -+++ gamemode-1.5.1/subprojects/inih/README.md -@@ -1,7 +1,3 @@ --# inih (INI Not Invented Here) -- --[![TravisCI Build](https://travis-ci.org/benhoyt/inih.svg)](https://travis-ci.org/benhoyt/inih) -- - **inih (INI Not Invented Here)** is a simple [.INI file](http://en.wikipedia.org/wiki/INI_file) parser written in C. It's only a couple of pages of code, and it was designed to be _small and simple_, so it's good for embedded systems. It's also more or less compatible with Python's [ConfigParser](http://docs.python.org/library/configparser.html) style of .INI files, including RFC 822-style multi-line syntax and `name: value` entries. - - To use it, just give `ini_parse()` an INI file, and it will call a callback for every `name=value` pair parsed, giving you strings for the section, name, and value. It's done this way ("SAX style") because it works well on low-memory embedded systems, but also because it makes for a KISS implementation. -@@ -21,13 +17,11 @@ You can control various aspects of inih - * **UTF-8 BOM:** By default, inih allows a UTF-8 BOM sequence (0xEF 0xBB 0xBF) at the start of INI files. To disable, add `-DINI_ALLOW_BOM=0`. - * **Inline comments:** By default, inih allows inline comments with the `;` character. To disable, add `-DINI_ALLOW_INLINE_COMMENTS=0`. You can also specify which character(s) start an inline comment using `INI_INLINE_COMMENT_PREFIXES`. - * **Start-of-line comments:** By default, inih allows both `;` and `#` to start a comment at the beginning of a line. You can override this by changing `INI_START_COMMENT_PREFIXES`. -- * **Allow no value:** By default, inih treats a name with no value (no `=` or `:` on the line) as an error. To allow names with no values, add `-DINI_ALLOW_NO_VALUE=1`, and inih will call your handler function with value set to NULL. - - ### Parsing options ### - - * **Stop on first error:** By default, inih keeps parsing the rest of the file after an error. To stop parsing on the first error, add `-DINI_STOP_ON_FIRST_ERROR=1`. - * **Report line numbers:** By default, the `ini_handler` callback doesn't receive the line number as a parameter. If you need that, add `-DINI_HANDLER_LINENO=1`. -- * **Call handler on new section:** By default, inih only calls the handler on each `name=value` pair. To detect new sections (e.g., the INI file has multiple sections with the same name), add `-DINI_CALL_HANDLER_ON_NEW_SECTION=1`. Your handler function will then be called each time a new section is encountered, with `section` set to the new section name but `name` and `value` set to NULL. - - ### Memory options ### - -@@ -127,13 +121,3 @@ Some differences between inih and Python - ## Platform-specific notes ## - - * Windows/Win32 uses UTF-16 filenames natively, so to handle Unicode paths you need to call `_wfopen()` to open a file and then `ini_parse_file()` to parse it; inih does not include `wchar_t` or Unicode handling. -- --## Meson notes ## -- --* The `meson.build` file is intended to build libraries which can be installed on a system. This is not required to use or compile inih. --* If you want to use inih for programs which may be shipped in a distro, consider linking against the shared library. Meson adds entries for pkg-config (`inih` and `INIReader`). --* In case you use inih as a subproject, you can use the `inih_dep` and `INIReader_dep` dependency variables. -- --## Related links ## -- --* [Conan package for inih](https://github.com/mohamedghita/conan-inih) (Conan is a C/C++ package manager) -Index: gamemode-1.5.1/subprojects/inih/tests/baseline_allow_no_value.txt -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/tests/baseline_allow_no_value.txt -+++ /dev/null -@@ -1,69 +0,0 @@ --no_file.ini: e=-1 user=0 --... [section1] --... one=This is a test; --... two=1234; --... [ section 2 ] --... happy=4; --... sad=; --... [comment_test] --... test1=1;2;3; --... test2=2;3;4;this won't be a comment, needs whitespace before ';'; --... test;3=345; --... test4=4#5#6; --... test7=; --... test8=; not a comment, needs whitespace before ';'; --... [colon_tests] --... Content-Type=text/html; --... foo=bar; --... adams=42; --... funny1=with = equals; --... funny2=with : colons; --... funny3=two = equals; --... funny4=two : colons; --normal.ini: e=0 user=101 --... [section1] --... name1=value1; --... name2=value2; --bad_section.ini: e=3 user=102 --... This is an error; --bad_comment.ini: e=0 user=103 --... [section] --... a=b; --... user=parse_error; --... c=d; --user_error.ini: e=3 user=104 --... [section1] --... single1=abc; --... multi=this is a; --... multi=multi-line value; --... single2=xyz; --... [section2] --... multi=a; --... multi=b; --... multi=c; --... [section3] --... single=ghi; --... multi=the quick; --... multi=brown fox; --... name=bob smith; --multi_line.ini: e=0 user=105 --... indented; --bad_multi.ini: e=0 user=106 --... [bom_section] --... bom_name=bom_value; --... key“=value“; --bom.ini: e=0 user=107 --... [section1] --... single1=abc; --... single2=xyz; --... single1=def; --... single2=qrs; --duplicate_sections.ini: e=0 user=108 --... [section_list] --... section0; --... section1; --... [section0] --... key0=val0; --... [section1] --... key1=val1; --no_value.ini: e=0 user=109 -Index: gamemode-1.5.1/subprojects/inih/tests/baseline_call_handler_on_new_section.txt -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/tests/baseline_call_handler_on_new_section.txt -+++ /dev/null -@@ -1,67 +0,0 @@ --no_file.ini: e=-1 user=0 --... [section1] --... one=This is a test; --... two=1234; --... [ section 2 ] --... happy=4; --... sad=; --... [empty] --... [comment_test] --... test1=1;2;3; --... test2=2;3;4;this won't be a comment, needs whitespace before ';'; --... test;3=345; --... test4=4#5#6; --... test7=; --... test8=; not a comment, needs whitespace before ';'; --... [colon_tests] --... Content-Type=text/html; --... foo=bar; --... adams=42; --... funny1=with = equals; --... funny2=with : colons; --... funny3=two = equals; --... funny4=two : colons; --normal.ini: e=0 user=101 --... [section1] --... name1=value1; --... name2=value2; --bad_section.ini: e=3 user=102 --bad_comment.ini: e=1 user=102 --... [section] --... a=b; --... user=parse_error; --... c=d; --user_error.ini: e=3 user=104 --... [section1] --... single1=abc; --... multi=this is a; --... multi=multi-line value; --... single2=xyz; --... [section2] --... multi=a; --... multi=b; --... multi=c; --... [section3] --... single=ghi; --... multi=the quick; --... multi=brown fox; --... name=bob smith; --multi_line.ini: e=0 user=105 --bad_multi.ini: e=1 user=105 --... [bom_section] --... bom_name=bom_value; --... key“=value“; --bom.ini: e=0 user=107 --... [section1] --... single1=abc; --... single2=xyz; --... [section1] --... single1=def; --... single2=qrs; --duplicate_sections.ini: e=0 user=108 --... [section_list] --... [section0] --... key0=val0; --... [section1] --... key1=val1; --no_value.ini: e=2 user=109 -Index: gamemode-1.5.1/subprojects/inih/tests/baseline_disallow_inline_comments.txt -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/tests/baseline_disallow_inline_comments.txt -+++ gamemode-1.5.1/subprojects/inih/tests/baseline_disallow_inline_comments.txt -@@ -52,14 +52,3 @@ bad_multi.ini: e=1 user=105 - ... bom_name=bom_value; - ... key“=value“; - bom.ini: e=0 user=107 --... [section1] --... single1=abc; --... single2=xyz; --... single1=def; --... single2=qrs; --duplicate_sections.ini: e=0 user=108 --... [section0] --... key0=val0; --... [section1] --... key1=val1; --no_value.ini: e=2 user=109 -Index: gamemode-1.5.1/subprojects/inih/tests/baseline_handler_lineno.txt -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/tests/baseline_handler_lineno.txt -+++ gamemode-1.5.1/subprojects/inih/tests/baseline_handler_lineno.txt -@@ -51,14 +51,3 @@ bad_multi.ini: e=1 user=105 - ... bom_name=bom_value; line 2 - ... key“=value“; line 3 - bom.ini: e=0 user=107 --... [section1] --... single1=abc; line 2 --... single2=xyz; line 3 --... single1=def; line 5 --... single2=qrs; line 6 --duplicate_sections.ini: e=0 user=108 --... [section0] --... key0=val0; line 6 --... [section1] --... key1=val1; line 9 --no_value.ini: e=2 user=109 -Index: gamemode-1.5.1/subprojects/inih/tests/baseline_heap_max_line.txt -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/tests/baseline_heap_max_line.txt -+++ gamemode-1.5.1/subprojects/inih/tests/baseline_heap_max_line.txt -@@ -55,14 +55,3 @@ bad_multi.ini: e=1 user=105 - ... bom_name=bom_value; - ... key“=value“; - bom.ini: e=0 user=107 --... [section1] --... single1=abc; --... single2=xyz; --... single1=def; --... single2=qrs; --duplicate_sections.ini: e=0 user=108 --... [section0] --... key0=val0; --... [section1] --... key1=val1; --no_value.ini: e=2 user=109 -Index: gamemode-1.5.1/subprojects/inih/tests/baseline_heap_realloc_max_line.txt -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/tests/baseline_heap_realloc_max_line.txt -+++ gamemode-1.5.1/subprojects/inih/tests/baseline_heap_realloc_max_line.txt -@@ -55,14 +55,3 @@ bad_multi.ini: e=1 user=105 - ... bom_name=bom_value; - ... key“=value“; - bom.ini: e=0 user=107 --... [section1] --... single1=abc; --... single2=xyz; --... single1=def; --... single2=qrs; --duplicate_sections.ini: e=0 user=108 --... [section0] --... key0=val0; --... [section1] --... key1=val1; --no_value.ini: e=2 user=109 -Index: gamemode-1.5.1/subprojects/inih/tests/baseline_heap_realloc.txt -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/tests/baseline_heap_realloc.txt -+++ gamemode-1.5.1/subprojects/inih/tests/baseline_heap_realloc.txt -@@ -51,14 +51,3 @@ bad_multi.ini: e=1 user=105 - ... bom_name=bom_value; - ... key“=value“; - bom.ini: e=0 user=107 --... [section1] --... single1=abc; --... single2=xyz; --... single1=def; --... single2=qrs; --duplicate_sections.ini: e=0 user=108 --... [section0] --... key0=val0; --... [section1] --... key1=val1; --no_value.ini: e=2 user=109 -Index: gamemode-1.5.1/subprojects/inih/tests/baseline_heap.txt -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/tests/baseline_heap.txt -+++ gamemode-1.5.1/subprojects/inih/tests/baseline_heap.txt -@@ -51,14 +51,3 @@ bad_multi.ini: e=1 user=105 - ... bom_name=bom_value; - ... key“=value“; - bom.ini: e=0 user=107 --... [section1] --... single1=abc; --... single2=xyz; --... single1=def; --... single2=qrs; --duplicate_sections.ini: e=0 user=108 --... [section0] --... key0=val0; --... [section1] --... key1=val1; --no_value.ini: e=2 user=109 -Index: gamemode-1.5.1/subprojects/inih/tests/baseline_multi_max_line.txt -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/tests/baseline_multi_max_line.txt -+++ gamemode-1.5.1/subprojects/inih/tests/baseline_multi_max_line.txt -@@ -55,14 +55,3 @@ bad_multi.ini: e=1 user=105 - ... bom_name=bom_value; - ... key“=value“; - bom.ini: e=0 user=107 --... [section1] --... single1=abc; --... single2=xyz; --... single1=def; --... single2=qrs; --duplicate_sections.ini: e=0 user=108 --... [section0] --... key0=val0; --... [section1] --... key1=val1; --no_value.ini: e=2 user=109 -Index: gamemode-1.5.1/subprojects/inih/tests/baseline_multi.txt -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/tests/baseline_multi.txt -+++ gamemode-1.5.1/subprojects/inih/tests/baseline_multi.txt -@@ -51,14 +51,3 @@ bad_multi.ini: e=1 user=105 - ... bom_name=bom_value; - ... key“=value“; - bom.ini: e=0 user=107 --... [section1] --... single1=abc; --... single2=xyz; --... single1=def; --... single2=qrs; --duplicate_sections.ini: e=0 user=108 --... [section0] --... key0=val0; --... [section1] --... key1=val1; --no_value.ini: e=2 user=109 -Index: gamemode-1.5.1/subprojects/inih/tests/baseline_single.txt -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/tests/baseline_single.txt -+++ gamemode-1.5.1/subprojects/inih/tests/baseline_single.txt -@@ -47,14 +47,3 @@ bad_multi.ini: e=1 user=105 - ... bom_name=bom_value; - ... key“=value“; - bom.ini: e=0 user=107 --... [section1] --... single1=abc; --... single2=xyz; --... single1=def; --... single2=qrs; --duplicate_sections.ini: e=0 user=108 --... [section0] --... key0=val0; --... [section1] --... key1=val1; --no_value.ini: e=2 user=109 -Index: gamemode-1.5.1/subprojects/inih/tests/baseline_stop_on_first_error.txt -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/tests/baseline_stop_on_first_error.txt -+++ gamemode-1.5.1/subprojects/inih/tests/baseline_stop_on_first_error.txt -@@ -49,10 +49,3 @@ bad_multi.ini: e=1 user=105 - ... bom_name=bom_value; - ... key“=value“; - bom.ini: e=0 user=107 --... [section1] --... single1=abc; --... single2=xyz; --... single1=def; --... single2=qrs; --duplicate_sections.ini: e=0 user=108 --no_value.ini: e=2 user=108 -Index: gamemode-1.5.1/subprojects/inih/tests/duplicate_sections.ini -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/tests/duplicate_sections.ini -+++ /dev/null -@@ -1,6 +0,0 @@ --[section1] --single1 = abc --single2 = xyz --[section1] --single1 = def --single2 = qrs -\ No newline at end of file -Index: gamemode-1.5.1/subprojects/inih/tests/no_value.ini -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/tests/no_value.ini -+++ /dev/null -@@ -1,9 +0,0 @@ --[section_list] --section0 --section1 -- --[section0] --key0=val0 -- --[section1] --key1=val1 -Index: gamemode-1.5.1/subprojects/inih/tests/unittest.bat -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/tests/unittest.bat -+++ gamemode-1.5.1/subprojects/inih/tests/unittest.bat -@@ -9,5 +9,3 @@ - @call tcc ..\ini.c -I..\ -DINI_USE_STACK=0 -DINI_ALLOW_REALLOC=1 -DINI_INITIAL_ALLOC=5 -run unittest.c > baseline_heap_realloc.txt - @call tcc ..\ini.c -I..\ -DINI_USE_STACK=0 -DINI_MAX_LINE=20 -DINI_ALLOW_REALLOC=1 -DINI_INITIAL_ALLOC=5 -run unittest.c > baseline_heap_realloc_max_line.txt - @call tcc ..\ini.c -I..\ -DINI_USE_STACK=0 -DINI_MAX_LINE=20 -DINI_INITIAL_ALLOC=20 -run unittest.c > baseline_heap_string.txt --@call tcc ..\ini.c -I..\ -DINI_CALL_HANDLER_ON_NEW_SECTION=1 -run unittest.c > baseline_call_handler_on_new_section.txt --@call tcc ..\ini.c -I..\ -DINI_ALLOW_NO_VALUE=1 -run unittest.c > baseline_allow_no_value.txt -Index: gamemode-1.5.1/subprojects/inih/tests/unittest.c -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/tests/unittest.c -+++ gamemode-1.5.1/subprojects/inih/tests/unittest.c -@@ -27,19 +27,16 @@ int dumper(void* user, const char* secti - #endif - { - User = *((int*)user); -- if (!name || strcmp(section, Prev_section)) { -+ if (strcmp(section, Prev_section)) { - printf("... [%s]\n", section); - strncpy(Prev_section, section, sizeof(Prev_section)); - Prev_section[sizeof(Prev_section) - 1] = '\0'; - } -- if (!name) { -- return 1; -- } - - #if INI_HANDLER_LINENO -- printf("... %s%s%s; line %d\n", name, value ? "=" : "", value ? value : "", lineno); -+ printf("... %s=%s; line %d\n", name, value, lineno); - #else -- printf("... %s%s%s;\n", name, value ? "=" : "", value ? value : ""); -+ printf("... %s=%s;\n", name, value); - #endif - - return strcmp(name, "user")==0 && strcmp(value, "parse_error")==0 ? 0 : 1; -@@ -65,7 +62,5 @@ int main(void) - parse("multi_line.ini"); - parse("bad_multi.ini"); - parse("bom.ini"); -- parse("duplicate_sections.ini"); -- parse("no_value.ini"); - return 0; - } -Index: gamemode-1.5.1/subprojects/inih/tests/unittest.sh -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/tests/unittest.sh -+++ gamemode-1.5.1/subprojects/inih/tests/unittest.sh -@@ -47,11 +47,3 @@ rm -f unittest_heap_realloc_max_line - gcc ../ini.c -DINI_USE_STACK=0 -DINI_MAX_LINE=20 -DINI_INITIAL_ALLOC=20 unittest_string.c -o unittest_heap_string - ./unittest_heap_string > baseline_heap_string.txt - rm -f unittest_heap_string -- --gcc ../ini.c -DINI_CALL_HANDLER_ON_NEW_SECTION=1 unittest.c -o unittest_call_handler_on_new_section --./unittest_call_handler_on_new_section > baseline_call_handler_on_new_section.txt --rm -f unittest_call_handler_on_new_section -- --gcc ../ini.c -DINI_ALLOW_NO_VALUE=1 unittest.c -o unittest_allow_no_value --./unittest_allow_no_value > baseline_allow_no_value.txt --rm -f unittest_allow_no_value -Index: gamemode-1.5.1/subprojects/inih/.travis.yml -=================================================================== ---- gamemode-1.5.1.orig/subprojects/inih/.travis.yml -+++ /dev/null -@@ -1,13 +0,0 @@ --language: c -- --# Setting sudo access to false will let Travis CI use containers --# rather than VMs to run the tests. For more details see: --# https://docs.travis-ci.com/user/reference/overview/ --sudo: false -- --script: -- - cd tests -- - ./unittest.sh -- - cd ../examples -- - ./cpptest.sh -- - git diff --exit-code -Index: gamemode-1.5.1/daemon/gamemode-config.c -=================================================================== ---- gamemode-1.5.1.orig/daemon/gamemode-config.c -+++ gamemode-1.5.1/daemon/gamemode-config.c -@@ -36,7 +36,7 @@ POSSIBILITY OF SUCH DAMAGE. - #include "common-logging.h" - - /* Ben Hoyt's inih library */ --#include -+#include "ini.h" - - #include - #include -Index: gamemode-1.5.1/.gitmodules -=================================================================== ---- gamemode-1.5.1.orig/.gitmodules -+++ gamemode-1.5.1/.gitmodules -@@ -1,3 +1,3 @@ - [submodule "subprojects/inih"] - path = subprojects/inih -- url = https://github.com/benhoyt/inih.git -+ url = https://github.com/FeralInteractive/inih.git -Index: gamemode-1.5.1/meson.build -=================================================================== ---- gamemode-1.5.1.orig/meson.build -+++ gamemode-1.5.1/meson.build -@@ -157,10 +157,8 @@ endif - # main library - if with_daemon == true - # inih currently only needed by the daemon -- inih_dependency = dependency( -- 'inih', -- fallback : ['inih', 'inih_dep'] -- ) -+ inih = subproject('inih') -+ inih_dependency = inih.get_variable('inih_dependency') - - subdir('daemon') - -Index: gamemode-1.5.1/README.md -=================================================================== ---- gamemode-1.5.1.orig/README.md -+++ gamemode-1.5.1/README.md -@@ -85,7 +85,7 @@ GameMode depends on `meson` for building - - #### Ubuntu/Debian (you may also need `dbus-user-session`) - ```bash --apt install meson libsystemd-dev pkg-config ninja-build git libdbus-1-dev libinih-dev -+apt install meson libsystemd-dev pkg-config ninja-build git libdbus-1-dev - ``` - #### Arch - ```bash diff -Nru gamemode-1.5.1/debian/patches/series gamemode-1.6.1/debian/patches/series --- gamemode-1.5.1/debian/patches/series 2020-06-25 15:02:46.000000000 +0000 +++ gamemode-1.6.1/debian/patches/series 2020-11-28 15:49:27.000000000 +0000 @@ -1,3 +1 @@ -revert_libinih_depends.patch -git_default_gov.patch -rename-example-to-gamemode-simulate-game +0001-gamemoded-test-fix.patch diff -Nru gamemode-1.5.1/debian/README.debian gamemode-1.6.1/debian/README.debian --- gamemode-1.5.1/debian/README.debian 2020-06-25 14:59:40.000000000 +0000 +++ gamemode-1.6.1/debian/README.debian 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -# Upstream tarball created by: - -git clone --recurse-submodules https://github.com/FeralInteractive/gamemode.git -rm -rf gamemode/.git -mv gamemode gamemode-1.5 -tar -c gamemode-1.5 | xz -9 > gamemode_1.5.orig.tar.xz -rm -rf gamemode-1.5 diff -Nru gamemode-1.5.1/debian/salsa-ci.yml gamemode-1.6.1/debian/salsa-ci.yml --- gamemode-1.5.1/debian/salsa-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ gamemode-1.6.1/debian/salsa-ci.yml 2020-11-28 15:49:26.000000000 +0000 @@ -0,0 +1,4 @@ +--- +include: + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml diff -Nru gamemode-1.5.1/debian/source/options gamemode-1.6.1/debian/source/options --- gamemode-1.5.1/debian/source/options 2020-06-25 14:59:40.000000000 +0000 +++ gamemode-1.6.1/debian/source/options 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -extend-diff-ignore=subprojects/inih/* diff -Nru gamemode-1.5.1/debian/tests/control gamemode-1.6.1/debian/tests/control --- gamemode-1.5.1/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ gamemode-1.6.1/debian/tests/control 2020-11-28 15:49:26.000000000 +0000 @@ -0,0 +1,3 @@ +Tests: gamemode-simulate-game.sh +Depends: @ +Restrictions: allow-stderr diff -Nru gamemode-1.5.1/debian/tests/gamemode-simulate-game.sh gamemode-1.6.1/debian/tests/gamemode-simulate-game.sh --- gamemode-1.5.1/debian/tests/gamemode-simulate-game.sh 1970-01-01 00:00:00.000000000 +0000 +++ gamemode-1.6.1/debian/tests/gamemode-simulate-game.sh 2020-11-28 15:49:26.000000000 +0000 @@ -0,0 +1,5 @@ +#!/bin/sh + +# this is needed for the CI +dbus-run-session -- /usr/games/gamemode-simulate-game +return $? diff -Nru gamemode-1.5.1/debian/TODO gamemode-1.6.1/debian/TODO --- gamemode-1.5.1/debian/TODO 2020-06-25 14:59:40.000000000 +0000 +++ gamemode-1.6.1/debian/TODO 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -* /build/example contains a .desktop file where users can invoke gamemode, - would be nice if it had an icon before we add it. - diff -Nru gamemode-1.5.1/debian/upstream/metadata gamemode-1.6.1/debian/upstream/metadata --- gamemode-1.5.1/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ gamemode-1.6.1/debian/upstream/metadata 2020-11-28 15:49:26.000000000 +0000 @@ -0,0 +1,4 @@ +Bug-Database: https://github.com/FeralInteractive/gamemode/issues +Bug-Submit: https://github.com/FeralInteractive/gamemode/issues/new +Repository: https://github.com/FeralInteractive/gamemode.git +Repository-Browse: https://github.com/FeralInteractive/gamemode diff -Nru gamemode-1.5.1/debian/watch gamemode-1.6.1/debian/watch --- gamemode-1.5.1/debian/watch 2020-06-25 14:59:40.000000000 +0000 +++ gamemode-1.6.1/debian/watch 2020-11-28 15:55:31.000000000 +0000 @@ -1,4 +1,3 @@ version=4 -opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%gamemode-$1.tar.gz%" \ - https://github.com/FeralInteractive/gamemode/tags \ - (?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate +opts="filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/gamemode-$1\.tar\.gz/" \ + https://github.com/FeralInteractive/gamemode/tags .*/v?(\d\S+)\.tar\.gz diff -Nru gamemode-1.5.1/example/archlinux/gamemode-git/PKGBUILD gamemode-1.6.1/example/archlinux/gamemode-git/PKGBUILD --- gamemode-1.5.1/example/archlinux/gamemode-git/PKGBUILD 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/example/archlinux/gamemode-git/PKGBUILD 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -# Maintainer: Ysblokje -pkgname=('gamemode-git') -pkgver='1.5.1' -pkgrel=1 -pkgdesc="GameMode is a daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS." -arch=('x86_64') -url="https://github.com/FeralInteractive/gamemode.git" -license=('MIT') -depends=('systemd' 'polkit') -makedepends=('meson' 'pkg-config') -provides=('gamemode') -source=("git+https://github.com/FeralInteractive/gamemode.git") -sha256sums=('SKIP') - -pkgver() { - cd gamemode - echo $(git rev-parse --short HEAD) -} - -build() { - cd gamemode - arch-meson build - cd build - ninja -} - -package() { - cd gamemode/build - DESTDIR=$pkgdir ninja install -} diff -Nru gamemode-1.5.1/example/archlinux/readme.txt gamemode-1.6.1/example/archlinux/readme.txt --- gamemode-1.5.1/example/archlinux/readme.txt 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/example/archlinux/readme.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -The following folders contain PKGBUILD file for arch(like) distro's. You can use those as starting point for your own packages. - -Regards, -Minze Zwerver diff -Nru gamemode-1.5.1/example/gamemoded.desktop gamemode-1.6.1/example/gamemoded.desktop --- gamemode-1.5.1/example/gamemoded.desktop 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/example/gamemoded.desktop 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -[Desktop Entry] -Name=gamemoded -Exec=systemctl --user restart gamemoded.service -Type=Application -Terminal=false diff -Nru gamemode-1.5.1/example/gamemode.ini gamemode-1.6.1/example/gamemode.ini --- gamemode-1.5.1/example/gamemode.ini 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/example/gamemode.ini 2021-02-18 19:00:12.000000000 +0000 @@ -4,8 +4,8 @@ ; The desired governor is used when entering GameMode instead of "performance" desiredgov=performance -; The default governer is used when leaving GameMode instead of restoring the original value -defaultgov=powersave +; The default governor is used when leaving GameMode instead of restoring the original value +;defaultgov=powersave ; The iGPU desired governor is used when the integrated GPU is under heavy load igpu_desiredgov=powersave diff -Nru gamemode-1.5.1/example/main.c gamemode-1.6.1/example/main.c --- gamemode-1.5.1/example/main.c 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/example/main.c 2021-02-18 19:00:12.000000000 +0000 @@ -32,6 +32,7 @@ #include "gamemode_client.h" #include +#include #include int main(void) @@ -39,6 +40,7 @@ /* Request we start game mode */ if (gamemode_request_start() != 0) { fprintf(stderr, "Failed to request gamemode start: %s...\n", gamemode_error_string()); + return EXIT_FAILURE; } /* Simulate running a game */ @@ -47,5 +49,8 @@ /* Request we end game mode (optional) */ if (gamemode_request_end() != 0) { fprintf(stderr, "Failed to request gamemode end: %s...\n", gamemode_error_string()); + return EXIT_FAILURE; } + + return EXIT_SUCCESS; } diff -Nru gamemode-1.5.1/example/meson.build gamemode-1.6.1/example/meson.build --- gamemode-1.5.1/example/meson.build 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/example/meson.build 2021-02-18 19:00:12.000000000 +0000 @@ -1,11 +1,18 @@ # An example game executable( - 'example', + 'gamemode-simulate-game', sources: [ 'main.c', ], - include_directories: libgamemode_includes, dependencies: [ - libdl, + gamemode_dep, ], + install: true, + install_dir: path_bindir, +) + +# An example configuration +install_data( + files('gamemode.ini'), + install_dir: path_sysconfdir, ) diff -Nru gamemode-1.5.1/.gitignore gamemode-1.6.1/.gitignore --- gamemode-1.5.1/.gitignore 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -build/ -*.swp diff -Nru gamemode-1.5.1/.gitmodules gamemode-1.6.1/.gitmodules --- gamemode-1.5.1/.gitmodules 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/.gitmodules 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[submodule "subprojects/inih"] - path = subprojects/inih - url = https://github.com/benhoyt/inih.git diff -Nru gamemode-1.5.1/lib/meson.build gamemode-1.6.1/lib/meson.build --- gamemode-1.5.1/lib/meson.build 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/lib/meson.build 2021-02-18 19:00:12.000000000 +0000 @@ -6,7 +6,7 @@ lt_version = '@0@.@1@.@2@'.format(lt_current, lt_age, lt_revision) # Main client library to message the daemon -gamemode = shared_library( +libgamemode = shared_library( 'gamemode', sources: [ 'client_impl.c', @@ -20,12 +20,12 @@ version: lt_version, ) -libgamemode_includes = [ +gamemode_headers_includes = [ include_directories('.'), ] # Small library to automatically use gamemode -gamemodeauto = shared_library( +libgamemodeauto = both_libraries( 'gamemodeauto', sources: [ 'client_loader.c', @@ -43,7 +43,10 @@ 'gamemode_client.h', ] -install_headers(gamemode_headers) +install_headers( + gamemode_headers, + install_dir: path_includedir, +) # Generate a pkg-config files pkg = import('pkgconfig') @@ -59,13 +62,18 @@ ) pkg.generate( - name: 'gamemode', + name: 'libgamemodeauto', description: desc, - filebase: 'gamemode-auto', - libraries: gamemodeauto, + filebase: 'libgamemodeauto', + libraries: libgamemodeauto, version: meson.project_version(), - libraries_private: [ - libdl - ], ) +# Dependency objects +gamemode_dep = declare_dependency( + include_directories: gamemode_headers_includes, + dependencies: libdl, +) +libgamemodeauto_dep = declare_dependency( + link_with: libgamemodeauto, +) diff -Nru gamemode-1.5.1/LICENSE.txt gamemode-1.6.1/LICENSE.txt --- gamemode-1.5.1/LICENSE.txt 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/LICENSE.txt 2021-02-18 19:00:12.000000000 +0000 @@ -1,4 +1,4 @@ -Copyright (c) 2017-2020, Feral Interactive +Copyright (c) 2017-2021, Feral Interactive All rights reserved. Redistribution and use in source and binary forms, with or without diff -Nru gamemode-1.5.1/meson.build gamemode-1.6.1/meson.build --- gamemode-1.5.1/meson.build 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/meson.build 2021-02-18 19:00:12.000000000 +0000 @@ -2,7 +2,7 @@ 'gamemode', 'c', default_options : ['c_std=c11', 'warning_level=3'], - version: '1.5.1', + version: '1.6.1', license: 'BSD', ) @@ -77,10 +77,21 @@ path_includedir = join_paths(path_prefix, get_option('includedir')) path_libdir = join_paths(path_prefix, get_option('libdir')) path_libexecdir = join_paths(path_prefix, get_option('libexecdir')) - -# Find systemd via pkgconfig -with_systemd = get_option('with-systemd') -dep_systemd = dependency('libsystemd') +path_mandir = join_paths(path_prefix, get_option('mandir')) +path_metainfo = join_paths(path_datadir, 'metainfo') +path_sysconfdir = join_paths(path_datadir, 'gamemode') + +# Find systemd / elogind via pkgconfig +sd_bus_provider = get_option('with-sd-bus-provider') + +sd_bus_args = [] +sd_bus_dep = [] +if sd_bus_provider == 'systemd' + sd_bus_dep = dependency('libsystemd') +elif sd_bus_provider == 'elogind' + sd_bus_args += ['-DUSE_ELOGIND'] + sd_bus_dep = dependency('libelogind') +endif # For the client, libdbus is used dep_dbus = dependency('dbus-1') @@ -92,7 +103,7 @@ libdl = cc.find_library('dl', required: false) # Determine the location for the systemd unit -if with_systemd == true +if sd_bus_provider == 'systemd' # If the path isn't explicitly set, ask systemd for the systemd user unit directory path_systemd_unit_dir = get_option('with-systemd-user-unit-dir') if path_systemd_unit_dir == '' @@ -123,7 +134,6 @@ path_polkit_action_dir = join_paths(path_datadir, 'polkit-1', 'actions') -with_daemon = get_option('with-daemon') with_examples = get_option('with-examples') with_util = get_option('with-util') @@ -155,7 +165,7 @@ # The daemon can be disabled if necessary, allowing multilib builds of the # main library -if with_daemon == true +if sd_bus_provider != 'no-daemon' # inih currently only needed by the daemon inih_dependency = dependency( 'inih', @@ -186,7 +196,7 @@ ' includedir: @0@'.format(path_includedir), ] -if with_systemd == true +if sd_bus_provider == 'systemd' report += [ ' systemd user unit directory: @0@'.format(path_systemd_unit_dir), ] @@ -202,10 +212,9 @@ ' Options:', ' ========', '', - ' daemon: @0@'.format(with_daemon), + ' sd-bus provier: @0@'.format(sd_bus_provider), ' examples: @0@'.format(with_examples), ' util: @0@'.format(with_util), - ' systemd: @0@'.format(with_systemd), ] # Output some stuff to validate the build config diff -Nru gamemode-1.5.1/meson_options.txt gamemode-1.6.1/meson_options.txt --- gamemode-1.5.1/meson_options.txt 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/meson_options.txt 2021-02-18 19:00:12.000000000 +0000 @@ -1,8 +1,9 @@ -option('with-systemd', type: 'boolean', description: 'Use systemd support (unit, etc)', value: 'true') - # limits.d option('with-pam-group', type: 'string', description: 'Install the limits.d configuration file to allow renicing as an unpriviledged user being part of the specified group') +# sd-bus provider +option('with-sd-bus-provider', type: 'combo', choices: ['systemd', 'elogind', 'no-daemon'], value: 'systemd') + # systemd specific option('with-systemd-user-unit-dir', type: 'string', description: 'Explicitly set the systemd user unit directory') @@ -11,5 +12,4 @@ # General options option('with-examples', type: 'boolean', description: 'Build sample programs', value: 'true') -option('with-daemon', type: 'boolean', description: 'Build the daemon', value: 'true') option('with-util', type: 'boolean', description: 'Build the utilities', value: 'true') diff -Nru gamemode-1.5.1/README.md gamemode-1.6.1/README.md --- gamemode-1.5.1/README.md 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/README.md 2021-02-18 19:00:12.000000000 +0000 @@ -12,7 +12,7 @@ * GPU performance mode (NVIDIA and AMD), GPU overclocking (NVIDIA) * Custom scripts -GameMode packages are available for Ubuntu, Debian, Solus, the AUR, Gentoo, Fedora, OpenSUSE, Mageia and possibly more. +GameMode packages are available for Ubuntu, Debian, Solus, Arch, Gentoo, Fedora, OpenSUSE, Mageia and possibly more. Issues with GameMode should be reported here in the issues section, and not reported to Feral directly. @@ -52,7 +52,7 @@ It's not possible to integrate commands like optirun automatically inside GameMode, since the GameMode request is made once the game has already started. However it is possible to use a hybrid GPU wrapper like optirun by starting the game with `gamemoderun`. -You can do this by setting the environment variable `GAMEMODERUNEXEC` to your wrapper's launch command, so for example `GAMEMODERUNEXEC=optirun` or `GAMEMODERUNEXEC="env DRI_PRIME=1"`. This environment variable can be set globally, so that the same prefix command does not have to be duplicated everywhere you want to use `gamemoderun`. +You can do this by setting the environment variable `GAMEMODERUNEXEC` to your wrapper's launch command, so for example `GAMEMODERUNEXEC=optirun`, `GAMEMODERUNEXEC="env DRI_PRIME=1"`, or `GAMEMODERUNEXEC="env __NV_PRIME_RENDER_OFFLOAD=1 env __GLX_VENDOR_LIBRARY_NAME=nvidia env __VK_LAYER_NV_optimus=NVIDIA_only"`. This environment variable can be set globally (e.g. in /etc/environment), so that the same prefix command does not have to be duplicated everywhere you want to use `gamemoderun`. GameMode will not be injected to the wrapper. @@ -64,12 +64,13 @@ * DiRT 4 * Rise of the Tomb Raider * Shadow of the Tomb Raider +* Total War Saga: Thrones of Britannia * Total War: Three Kingdoms * Total War: WARHAMMER II -* Total War Saga: Thrones of Britannia ### Others Other apps which can integrate with GameMode include: +* [ATLauncher](https://atlauncher.com/downloads) Minecraft launcher * GNOME Shell ([via extension](https://github.com/gicmo/gamemode-extension)) - indicates when GameMode is active in the top panel. * Lutris - Enables GameMode for all games by default if available (must have both 32- and 64-bit GameMode libraries installed), configurable in preferences. @@ -89,7 +90,7 @@ ``` #### Arch ```bash -pacman -S meson systemd git dbus +pacman -S meson systemd git dbus libinih ``` #### Fedora ```bash @@ -106,20 +107,19 @@ ``` ### Build and Install GameMode -Then clone, build and install a release version of GameMode at 1.5.1: +Then clone, build and install a release version of GameMode at 1.6.1: ```bash git clone https://github.com/FeralInteractive/gamemode.git cd gamemode -git checkout 1.5.1 # omit to build the master branch +git checkout 1.6.1 # omit to build the master branch ./bootstrap.sh ``` To uninstall: ```bash systemctl --user stop gamemoded.service -cd build/ -ninja uninstall +ninja uninstall -C builddir ``` ### Pull Requests @@ -136,7 +136,7 @@ --- ## License -Copyright © 2017-2020 Feral Interactive +Copyright © 2017-2021 Feral Interactive GameMode is available under the terms of the BSD 3-Clause License (Revised) diff -Nru gamemode-1.5.1/scripts/format-check.sh gamemode-1.6.1/scripts/format-check.sh --- gamemode-1.5.1/scripts/format-check.sh 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/scripts/format-check.sh 2021-02-18 19:00:12.000000000 +0000 @@ -4,24 +4,17 @@ # Ensure we are at the project root cd "$(dirname $0)"/.. -wget -Nq -T3 -t1 https://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/git-clang-format - -if chmod +x git-clang-format; then - if [[ "$1" == "--pre-commit" ]]; then - # used via .git/hooks/pre-commit: - # exec "$(dirname $0)"/../../scripts/format-check.sh --pre-commit - ./git-clang-format - exit - fi - CLANG_FORMAT_OUTPUT=$(./git-clang-format HEAD^ HEAD --diff) - if [[ ! ${CLANG_FORMAT_OUTPUT} == "no modified files to format" ]] && [[ ! -z ${CLANG_FORMAT_OUTPUT} ]]; then - echo "Failed clang format check:" - echo "${CLANG_FORMAT_OUTPUT}" - exit 1 - else - echo "Passed clang format check" - fi -else - echo "git-clang-format not downloaded" +if [[ "$1" == "--pre-commit" ]]; then + # used via .git/hooks/pre-commit: + # exec "$(dirname $0)"/../../scripts/format-check.sh --pre-commit + git-clang-format + exit +fi +CLANG_FORMAT_OUTPUT=$(git-clang-format HEAD^ HEAD --diff) +if [[ ! ${CLANG_FORMAT_OUTPUT} == "no modified files to format" ]] && [[ ! -z ${CLANG_FORMAT_OUTPUT} ]]; then + echo "Failed clang format check:" + echo "${CLANG_FORMAT_OUTPUT}" exit 1 +else + echo "Passed clang format check" fi diff -Nru gamemode-1.5.1/scripts/git-archive-all.sh gamemode-1.6.1/scripts/git-archive-all.sh --- gamemode-1.5.1/scripts/git-archive-all.sh 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/scripts/git-archive-all.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,313 +0,0 @@ -#!/bin/bash - -# -# File: git-archive-all.sh -# -# Description: A utility script that builds an archive file(s) of all -# git repositories and submodules in the current path. -# Useful for creating a single tarfile of a git super- -# project that contains other submodules. -# -# Examples: Use git-archive-all.sh to create archive distributions -# from git repositories. To use, simply do: -# -# cd $GIT_DIR; git-archive-all.sh -# -# where $GIT_DIR is the root of your git superproject. -# -# License: GPL3+ -# -############################################################################### -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# -############################################################################### - -# DEBUGGING -set -e -set -C # noclobber - -# TRAP SIGNALS -trap 'cleanup' QUIT EXIT - -# For security reasons, explicitly set the internal field separator -# to newline, space, tab -OLD_IFS=$IFS -IFS="$(printf '\n \t')" - -function cleanup () { - rm -f $TMPFILE - rm -f $TMPLIST - rm -f $TOARCHIVE - IFS="$OLD_IFS" -} - -function usage () { - echo "Usage is as follows:" - echo - echo "$PROGRAM <--version>" - echo " Prints the program version number on a line by itself and exits." - echo - echo "$PROGRAM <--usage|--help|-?>" - echo " Prints this usage output and exits." - echo - echo "$PROGRAM [--format ] [--prefix ] [--verbose|-v] [--separate|-s]" - echo " [--worktree-attributes] [--tree-ish|-t ] [output_file]" - echo " Creates an archive for the entire git superproject, and its submodules" - echo " using the passed parameters, described below." - echo - echo " If '--format' is specified, the archive is created with the named" - echo " git archiver backend. Obviously, this must be a backend that git archive" - echo " understands. The format defaults to 'tar' if not specified." - echo - echo " If '--prefix' is specified, the archive's superproject and all submodules" - echo " are created with the prefix named. The default is to not use one." - echo - echo " If '--worktree-attributes' is specified, the invidual archive commands will" - echo " look for attributes in .gitattributes in the working directory too." - echo - echo " If '--separate' or '-s' is specified, individual archives will be created" - echo " for each of the superproject itself and its submodules. The default is to" - echo " concatenate individual archives into one larger archive." - echo - echo " If '--tree-ish' is specified, the archive will be created based on whatever" - echo " you define the tree-ish to be. Branch names, commit hash, etc. are acceptable." - echo " Defaults to HEAD if not specified. See git archive's documentation for more" - echo " information on what a tree-ish is." - echo - echo " If 'output_file' is specified, the resulting archive is created as the" - echo " file named. This parameter is essentially a path that must be writeable." - echo " When combined with '--separate' ('-s') this path must refer to a directory." - echo " Without this parameter or when combined with '--separate' the resulting" - echo " archive(s) are named with a dot-separated path of the archived directory and" - echo " a file extension equal to their format (e.g., 'superdir.submodule1dir.tar')." - echo - echo " The special value '-' (single dash) is treated as STDOUT and, when used, the" - echo " --separate option is ignored. Use a double-dash to separate the outfile from" - echo " the value of previous options. For example, to write a .zip file to STDOUT:" - echo - echo " ./$PROGRAM --format zip -- -" - echo - echo " If '--verbose' or '-v' is specified, progress will be printed." -} - -function version () { - echo "$PROGRAM version $VERSION" -} - -# Internal variables and initializations. -readonly PROGRAM=`basename "$0"` -readonly VERSION=0.3 - -SEPARATE=0 -VERBOSE=0 - -TARCMD=`command -v gtar || command -v gnutar || command -v tar` -FORMAT=tar -PREFIX= -TREEISH=HEAD -ARCHIVE_OPTS= - -# RETURN VALUES/EXIT STATUS CODES -readonly E_BAD_OPTION=254 -readonly E_UNKNOWN=255 - -# Process command-line arguments. -while test $# -gt 0; do - if [ x"$1" == x"--" ]; then - # detect argument termination - shift - break - fi - case $1 in - --format ) - shift - FORMAT="$1" - shift - ;; - - --prefix ) - shift - PREFIX="$1" - shift - ;; - - --worktree-attributes ) - ARCHIVE_OPTS+=" $1" - shift - ;; - - --separate | -s ) - shift - SEPARATE=1 - ;; - - --tree-ish | -t ) - shift - TREEISH="$1" - shift - ;; - - --version ) - version - exit - ;; - - --verbose | -v ) - shift - VERBOSE=1 - ;; - - -? | --usage | --help ) - usage - exit - ;; - - -* ) - echo "Unrecognized option: $1" >&2 - usage - exit $E_BAD_OPTION - ;; - - * ) - break - ;; - esac -done - -OLD_PWD="`pwd`" -TMPDIR=${TMPDIR:-/tmp} -TMPFILE=`mktemp "$TMPDIR/$PROGRAM.XXXXXX"` # Create a place to store our work's progress -TMPLIST=`mktemp "$TMPDIR/$PROGRAM.submodules.XXXXXX"` -TOARCHIVE=`mktemp "$TMPDIR/$PROGRAM.toarchive.XXXXXX"` -OUT_FILE=$OLD_PWD # assume "this directory" without a name change by default - -if [ ! -z "$1" ]; then - OUT_FILE="$1" - if [ "-" == "$OUT_FILE" ]; then - SEPARATE=0 - fi - shift -fi - -# Validate parameters; error early, error often. -if [ "-" == "$OUT_FILE" -o $SEPARATE -ne 1 ] && [ "$FORMAT" == "tar" -a `$TARCMD --help | grep -q -- "--concatenate"; echo $?` -ne 0 ]; then - echo "Your 'tar' does not support the '--concatenate' option, which we need" - echo "to produce a single tarfile. Either install a compatible tar (such as" - echo "gnutar), or invoke $PROGRAM with the '--separate' option." - exit -elif [ $SEPARATE -eq 1 -a ! -d "$OUT_FILE" ]; then - echo "When creating multiple archives, your destination must be a directory." - echo "If it's not, you risk being surprised when your files are overwritten." - exit -elif [ `git config -l | grep -q '^core\.bare=true'; echo $?` -eq 0 ]; then - echo "$PROGRAM must be run from a git working copy (i.e., not a bare repository)." - exit -fi - -# Create the superproject's git-archive -if [ $VERBOSE -eq 1 ]; then - echo -n "creating superproject archive..." -fi -git archive --format=$FORMAT --prefix="$PREFIX" $ARCHIVE_OPTS $TREEISH > $TMPDIR/$(basename "$(pwd)").$FORMAT -if [ $VERBOSE -eq 1 ]; then - echo "done" -fi -echo $TMPDIR/$(basename "$(pwd)").$FORMAT >| $TMPFILE # clobber on purpose -superfile=`head -n 1 $TMPFILE` - -if [ $VERBOSE -eq 1 ]; then - echo -n "looking for subprojects..." -fi -# find all '.git' dirs, these show us the remaining to-be-archived dirs -# we only want directories that are below the current directory -find . -mindepth 2 -name '.git' -type d -print | sed -e 's/^\.\///' -e 's/\.git$//' >> $TOARCHIVE -# as of version 1.7.8, git places the submodule .git directories under the superprojects .git dir -# the submodules get a .git file that points to their .git dir. we need to find all of these too -find . -mindepth 2 -name '.git' -type f -print | xargs grep -l "gitdir" | sed -e 's/^\.\///' -e 's/\.git$//' >> $TOARCHIVE -if [ $VERBOSE -eq 1 ]; then - echo "done" - echo " found:" - cat $TOARCHIVE | while read arch - do - echo " $arch" - done -fi - -if [ $VERBOSE -eq 1 ]; then - echo -n "archiving submodules..." -fi -git submodule >>"$TMPLIST" -while read path; do - TREEISH=$(grep "^ .*${path%/} " "$TMPLIST" | cut -d ' ' -f 2) # git submodule does not list trailing slashes in $path - cd "$path" - git archive --format=$FORMAT --prefix="${PREFIX}$path" $ARCHIVE_OPTS ${TREEISH:-HEAD} > "$TMPDIR"/"$(echo "$path" | sed -e 's/\//./g')"$FORMAT - if [ $FORMAT == 'zip' ]; then - # delete the empty directory entry; zipped submodules won't unzip if we don't do this - zip -d "$(tail -n 1 $TMPFILE)" "${PREFIX}${path%/}" >/dev/null # remove trailing '/' - fi - echo "$TMPDIR"/"$(echo "$path" | sed -e 's/\//./g')"$FORMAT >> $TMPFILE - cd "$OLD_PWD" -done < $TOARCHIVE -if [ $VERBOSE -eq 1 ]; then - echo "done" -fi - -if [ $VERBOSE -eq 1 ]; then - echo -n "concatenating archives into single archive..." -fi -# Concatenate archives into a super-archive. -if [ $SEPARATE -eq 0 -o "-" == "$OUT_FILE" ]; then - if [ $FORMAT == 'tar.gz' ]; then - gunzip $superfile - superfile=${superfile:0: -3} # Remove '.gz' - sed -e '1d' $TMPFILE | while read file; do - gunzip $file - file=${file:0: -3} - $TARCMD --concatenate -f "$superfile" "$file" && rm -f "$file" - done - gzip $superfile - superfile=$superfile.gz - elif [ $FORMAT == 'tar' ]; then - sed -e '1d' $TMPFILE | while read file; do - $TARCMD --concatenate -f "$superfile" "$file" && rm -f "$file" - done - elif [ $FORMAT == 'zip' ]; then - sed -e '1d' $TMPFILE | while read file; do - # zip incorrectly stores the full path, so cd and then grow - cd `dirname "$file"` - zip -g "$superfile" `basename "$file"` && rm -f "$file" - done - cd "$OLD_PWD" - fi - - echo "$superfile" >| $TMPFILE # clobber on purpose -fi -if [ $VERBOSE -eq 1 ]; then - echo "done" -fi - -if [ $VERBOSE -eq 1 ]; then - echo -n "moving archive to $OUT_FILE..." -fi -while read file; do - if [ "-" == "$OUT_FILE" ]; then - cat "$file" && rm -f "$file" - else - mv "$file" "$OUT_FILE" - fi -done < $TMPFILE -if [ $VERBOSE -eq 1 ]; then - echo "done" -fi diff -Nru gamemode-1.5.1/scripts/mkrelease.sh gamemode-1.6.1/scripts/mkrelease.sh --- gamemode-1.5.1/scripts/mkrelease.sh 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/scripts/mkrelease.sh 2021-02-18 19:00:12.000000000 +0000 @@ -2,15 +2,19 @@ set -e # Simple script to construct a redistributable and complete tarball of the -# gamemode tree, including the git submodules, so that it can be trivially +# gamemode tree, including the subprojects, so that it can be trivially # packaged by distributions banning networking during build. -git submodule init - -# Bump in tandem with meson.build, run script once new tag is up. -VERSION="1.5.1" NAME="gamemode" -./scripts/git-archive-all.sh --format tar --prefix ${NAME}-${VERSION}/ --verbose -t HEAD ${NAME}-${VERSION}.tar +VERSION=$(git describe --tags --dirty) + +# get code in this repo +git archive HEAD --format=tar --prefix=${NAME}-${VERSION}/ --output=${NAME}-${VERSION}.tar +# get code from subprojects +meson subprojects download +meson subprojects update +tar -rf ${NAME}-${VERSION}.tar --exclude-vcs --transform="s,^subprojects,${NAME}-$VERSION/subprojects," subprojects/inih-r53/ +# compress archive xz -9 "${NAME}-${VERSION}.tar" # Automatically sign the tarball with GPG key of user running this script diff -Nru gamemode-1.5.1/scripts/static-analyser-check.sh gamemode-1.6.1/scripts/static-analyser-check.sh --- gamemode-1.5.1/scripts/static-analyser-check.sh 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/scripts/static-analyser-check.sh 2021-02-18 19:00:12.000000000 +0000 @@ -3,11 +3,8 @@ # Exit on failure set -e -# Build directly -cd build/ - # Collect scan-build output -ninja scan-build | tee /tmp/scan-build-results.txt +ninja scan-build -C builddir | tee /tmp/scan-build-results.txt # Invert the output - if this string exists it's a fail ! grep -E '[0-9]+ bugs? found.' /tmp/scan-build-results.txt diff -Nru gamemode-1.5.1/subprojects/inih/cpp/INIReader.cpp gamemode-1.6.1/subprojects/inih/cpp/INIReader.cpp --- gamemode-1.5.1/subprojects/inih/cpp/INIReader.cpp 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/cpp/INIReader.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ -// Read an INI file into easy-to-access name/value pairs. - -// SPDX-License-Identifier: BSD-3-Clause - -// Copyright (C) 2009-2020, Ben Hoyt - -// inih and INIReader are released under the New BSD license (see LICENSE.txt). -// Go to the project home page for more info: -// -// https://github.com/benhoyt/inih - -#include -#include -#include -#include "../ini.h" -#include "INIReader.h" - -using std::string; - -INIReader::INIReader(const string& filename) -{ - _error = ini_parse(filename.c_str(), ValueHandler, this); -} - -INIReader::INIReader(const char *buffer, size_t buffer_size) -{ - string content(buffer, buffer_size); - _error = ini_parse_string(content.c_str(), ValueHandler, this); -} - -int INIReader::ParseError() const -{ - return _error; -} - -string INIReader::Get(const string& section, const string& name, const string& default_value) const -{ - string key = MakeKey(section, name); - // Use _values.find() here instead of _values.at() to support pre C++11 compilers - return _values.count(key) ? _values.find(key)->second : default_value; -} - -string INIReader::GetString(const string& section, const string& name, const string& default_value) const -{ - const string str = Get(section, name, ""); - return str.empty() ? default_value : str; -} - -long INIReader::GetInteger(const string& section, const string& name, long default_value) const -{ - string valstr = Get(section, name, ""); - const char* value = valstr.c_str(); - char* end; - // This parses "1234" (decimal) and also "0x4D2" (hex) - long n = strtol(value, &end, 0); - return end > value ? n : default_value; -} - -double INIReader::GetReal(const string& section, const string& name, double default_value) const -{ - string valstr = Get(section, name, ""); - const char* value = valstr.c_str(); - char* end; - double n = strtod(value, &end); - return end > value ? n : default_value; -} - -bool INIReader::GetBoolean(const string& section, const string& name, bool default_value) const -{ - string valstr = Get(section, name, ""); - // Convert to lower case to make string comparisons case-insensitive - std::transform(valstr.begin(), valstr.end(), valstr.begin(), ::tolower); - if (valstr == "true" || valstr == "yes" || valstr == "on" || valstr == "1") - return true; - else if (valstr == "false" || valstr == "no" || valstr == "off" || valstr == "0") - return false; - else - return default_value; -} - -bool INIReader::HasSection(const string& section) const -{ - const string key = MakeKey(section, ""); - std::map::const_iterator pos = _values.lower_bound(key); - if (pos == _values.end()) - return false; - // Does the key at the lower_bound pos start with "section"? - return pos->first.compare(0, key.length(), key) == 0; -} - -bool INIReader::HasValue(const string& section, const string& name) const -{ - string key = MakeKey(section, name); - return _values.count(key); -} - -string INIReader::MakeKey(const string& section, const string& name) -{ - string key = section + "=" + name; - // Convert to lower case to make section/name lookups case-insensitive - std::transform(key.begin(), key.end(), key.begin(), ::tolower); - return key; -} - -int INIReader::ValueHandler(void* user, const char* section, const char* name, - const char* value) -{ - if (!name) // Happens when INI_CALL_HANDLER_ON_NEW_SECTION enabled - return 1; - INIReader* reader = static_cast(user); - string key = MakeKey(section, name); - if (reader->_values[key].size() > 0) - reader->_values[key] += "\n"; - reader->_values[key] += value ? value : ""; - return 1; -} diff -Nru gamemode-1.5.1/subprojects/inih/cpp/INIReader.h gamemode-1.6.1/subprojects/inih/cpp/INIReader.h --- gamemode-1.5.1/subprojects/inih/cpp/INIReader.h 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/cpp/INIReader.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -// Read an INI file into easy-to-access name/value pairs. - -// SPDX-License-Identifier: BSD-3-Clause - -// Copyright (C) 2009-2020, Ben Hoyt - -// inih and INIReader are released under the New BSD license (see LICENSE.txt). -// Go to the project home page for more info: -// -// https://github.com/benhoyt/inih - -#ifndef __INIREADER_H__ -#define __INIREADER_H__ - -#include -#include - -// Read an INI file into easy-to-access name/value pairs. (Note that I've gone -// for simplicity here rather than speed, but it should be pretty decent.) -class INIReader -{ -public: - // Construct INIReader and parse given filename. See ini.h for more info - // about the parsing. - explicit INIReader(const std::string& filename); - - // Construct INIReader and parse given buffer. See ini.h for more info - // about the parsing. - explicit INIReader(const char *buffer, size_t buffer_size); - - // Return the result of ini_parse(), i.e., 0 on success, line number of - // first error on parse error, or -1 on file open error. - int ParseError() const; - - // Get a string value from INI file, returning default_value if not found. - std::string Get(const std::string& section, const std::string& name, - const std::string& default_value) const; - - // Get a string value from INI file, returning default_value if not found, - // empty, or contains only whitespace. - std::string GetString(const std::string& section, const std::string& name, - const std::string& default_value) const; - - // Get an integer (long) value from INI file, returning default_value if - // not found or not a valid integer (decimal "1234", "-1234", or hex "0x4d2"). - long GetInteger(const std::string& section, const std::string& name, long default_value) const; - - // Get a real (floating point double) value from INI file, returning - // default_value if not found or not a valid floating point value - // according to strtod(). - double GetReal(const std::string& section, const std::string& name, double default_value) const; - - // Get a boolean value from INI file, returning default_value if not found or if - // not a valid true/false value. Valid true values are "true", "yes", "on", "1", - // and valid false values are "false", "no", "off", "0" (not case sensitive). - bool GetBoolean(const std::string& section, const std::string& name, bool default_value) const; - - // Return true if the given section exists (section must contain at least - // one name=value pair). - bool HasSection(const std::string& section) const; - - // Return true if a value exists with the given section and field names. - bool HasValue(const std::string& section, const std::string& name) const; - -private: - int _error; - std::map _values; - static std::string MakeKey(const std::string& section, const std::string& name); - static int ValueHandler(void* user, const char* section, const char* name, - const char* value); -}; - -#endif // __INIREADER_H__ diff -Nru gamemode-1.5.1/subprojects/inih/examples/config.def gamemode-1.6.1/subprojects/inih/examples/config.def --- gamemode-1.5.1/subprojects/inih/examples/config.def 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/examples/config.def 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -// CFG(section, name, default) - -CFG(protocol, version, "0") - -CFG(user, name, "Fatty Lumpkin") -CFG(user, email, "fatty@lumpkin.com") - -#undef CFG diff -Nru gamemode-1.5.1/subprojects/inih/examples/cpptest.sh gamemode-1.6.1/subprojects/inih/examples/cpptest.sh --- gamemode-1.5.1/subprojects/inih/examples/cpptest.sh 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/examples/cpptest.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -g++ INIReaderExample.cpp ../cpp/INIReader.cpp ../ini.c -o INIReaderExample -./INIReaderExample > cpptest.txt -rm INIReaderExample diff -Nru gamemode-1.5.1/subprojects/inih/examples/cpptest.txt gamemode-1.6.1/subprojects/inih/examples/cpptest.txt --- gamemode-1.5.1/subprojects/inih/examples/cpptest.txt 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/examples/cpptest.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -Config loaded from 'test.ini': version=6, name=Bob Smith, email=bob@smith.com, pi=3.14159, active=1 -Has values: user.name=1, user.nose=0 -Has sections: user=1, fizz=0 diff -Nru gamemode-1.5.1/subprojects/inih/examples/ini_dump.c gamemode-1.6.1/subprojects/inih/examples/ini_dump.c --- gamemode-1.5.1/subprojects/inih/examples/ini_dump.c 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/examples/ini_dump.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/* ini.h example that simply dumps an INI file without comments */ - -#include -#include -#include "../ini.h" - -static int dumper(void* user, const char* section, const char* name, - const char* value) -{ - static char prev_section[50] = ""; - - if (strcmp(section, prev_section)) { - printf("%s[%s]\n", (prev_section[0] ? "\n" : ""), section); - strncpy(prev_section, section, sizeof(prev_section)); - prev_section[sizeof(prev_section) - 1] = '\0'; - } - printf("%s = %s\n", name, value); - return 1; -} - -int main(int argc, char* argv[]) -{ - int error; - - if (argc <= 1) { - printf("Usage: ini_dump filename.ini\n"); - return 1; - } - - error = ini_parse(argv[1], dumper, NULL); - if (error < 0) { - printf("Can't read '%s'!\n", argv[1]); - return 2; - } - else if (error) { - printf("Bad config file (first error on line %d)!\n", error); - return 3; - } - return 0; -} diff -Nru gamemode-1.5.1/subprojects/inih/examples/ini_example.c gamemode-1.6.1/subprojects/inih/examples/ini_example.c --- gamemode-1.5.1/subprojects/inih/examples/ini_example.c 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/examples/ini_example.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -/* Example: parse a simple configuration file */ - -#include -#include -#include -#include "../ini.h" - -typedef struct -{ - int version; - const char* name; - const char* email; -} configuration; - -static int handler(void* user, const char* section, const char* name, - const char* value) -{ - configuration* pconfig = (configuration*)user; - - #define MATCH(s, n) strcmp(section, s) == 0 && strcmp(name, n) == 0 - if (MATCH("protocol", "version")) { - pconfig->version = atoi(value); - } else if (MATCH("user", "name")) { - pconfig->name = strdup(value); - } else if (MATCH("user", "email")) { - pconfig->email = strdup(value); - } else { - return 0; /* unknown section/name, error */ - } - return 1; -} - -int main(int argc, char* argv[]) -{ - configuration config; - - if (ini_parse("test.ini", handler, &config) < 0) { - printf("Can't load 'test.ini'\n"); - return 1; - } - printf("Config loaded from 'test.ini': version=%d, name=%s, email=%s\n", - config.version, config.name, config.email); - - free((void*)config.name); - free((void*)config.email); - - return 0; -} diff -Nru gamemode-1.5.1/subprojects/inih/examples/INIReaderExample.cpp gamemode-1.6.1/subprojects/inih/examples/INIReaderExample.cpp --- gamemode-1.5.1/subprojects/inih/examples/INIReaderExample.cpp 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/examples/INIReaderExample.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -// Example that shows simple usage of the INIReader class - -#include -#include "../cpp/INIReader.h" - -int main() -{ - INIReader reader("../examples/test.ini"); - - if (reader.ParseError() < 0) { - std::cout << "Can't load 'test.ini'\n"; - return 1; - } - std::cout << "Config loaded from 'test.ini': version=" - << reader.GetInteger("protocol", "version", -1) << ", name=" - << reader.Get("user", "name", "UNKNOWN") << ", email=" - << reader.Get("user", "email", "UNKNOWN") << ", pi=" - << reader.GetReal("user", "pi", -1) << ", active=" - << reader.GetBoolean("user", "active", true) << "\n"; - std::cout << "Has values: user.name=" << reader.HasValue("user", "name") - << ", user.nose=" << reader.HasValue("user", "nose") << "\n"; - std::cout << "Has sections: user=" << reader.HasSection("user") - << ", fizz=" << reader.HasSection("fizz") << "\n"; - return 0; -} diff -Nru gamemode-1.5.1/subprojects/inih/examples/ini_xmacros.c gamemode-1.6.1/subprojects/inih/examples/ini_xmacros.c --- gamemode-1.5.1/subprojects/inih/examples/ini_xmacros.c 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/examples/ini_xmacros.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -/* Parse a configuration file into a struct using X-Macros */ - -#include -#include -#include "../ini.h" - -/* define the config struct type */ -typedef struct { - #define CFG(s, n, default) char *s##_##n; - #include "config.def" -} config; - -/* create one and fill in its default values */ -config Config = { - #define CFG(s, n, default) default, - #include "config.def" -}; - -/* process a line of the INI file, storing valid values into config struct */ -int handler(void *user, const char *section, const char *name, - const char *value) -{ - config *cfg = (config *)user; - - if (0) ; - #define CFG(s, n, default) else if (strcmp(section, #s)==0 && \ - strcmp(name, #n)==0) cfg->s##_##n = strdup(value); - #include "config.def" - - return 1; -} - -/* print all the variables in the config, one per line */ -void dump_config(config *cfg) -{ - #define CFG(s, n, default) printf("%s_%s = %s\n", #s, #n, cfg->s##_##n); - #include "config.def" -} - -int main(int argc, char* argv[]) -{ - if (ini_parse("test.ini", handler, &Config) < 0) - printf("Can't load 'test.ini', using defaults\n"); - dump_config(&Config); - return 0; -} diff -Nru gamemode-1.5.1/subprojects/inih/examples/test.ini gamemode-1.6.1/subprojects/inih/examples/test.ini --- gamemode-1.5.1/subprojects/inih/examples/test.ini 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/examples/test.ini 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -; Test config file for ini_example.c and INIReaderTest.cpp - -[protocol] ; Protocol configuration -version=6 ; IPv6 - -[user] -name = Bob Smith ; Spaces around '=' are stripped -email = bob@smith.com ; And comments (like this) ignored -active = true ; Test a boolean -pi = 3.14159 ; Test a floating point number diff -Nru gamemode-1.5.1/subprojects/inih/ini.c gamemode-1.6.1/subprojects/inih/ini.c --- gamemode-1.5.1/subprojects/inih/ini.c 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/ini.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,284 +0,0 @@ -/* inih -- simple .INI file parser - -SPDX-License-Identifier: BSD-3-Clause - -Copyright (C) 2009-2020, Ben Hoyt - -inih is released under the New BSD license (see LICENSE.txt). Go to the project -home page for more info: - -https://github.com/benhoyt/inih - -*/ - -#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) -#define _CRT_SECURE_NO_WARNINGS -#endif - -#include -#include -#include - -#include "ini.h" - -#if !INI_USE_STACK -#include -#endif - -#define MAX_SECTION 50 -#define MAX_NAME 50 - -/* Used by ini_parse_string() to keep track of string parsing state. */ -typedef struct { - const char* ptr; - size_t num_left; -} ini_parse_string_ctx; - -/* Strip whitespace chars off end of given string, in place. Return s. */ -static char* rstrip(char* s) -{ - char* p = s + strlen(s); - while (p > s && isspace((unsigned char)(*--p))) - *p = '\0'; - return s; -} - -/* Return pointer to first non-whitespace char in given string. */ -static char* lskip(const char* s) -{ - while (*s && isspace((unsigned char)(*s))) - s++; - return (char*)s; -} - -/* Return pointer to first char (of chars) or inline comment in given string, - or pointer to null at end of string if neither found. Inline comment must - be prefixed by a whitespace character to register as a comment. */ -static char* find_chars_or_comment(const char* s, const char* chars) -{ -#if INI_ALLOW_INLINE_COMMENTS - int was_space = 0; - while (*s && (!chars || !strchr(chars, *s)) && - !(was_space && strchr(INI_INLINE_COMMENT_PREFIXES, *s))) { - was_space = isspace((unsigned char)(*s)); - s++; - } -#else - while (*s && (!chars || !strchr(chars, *s))) { - s++; - } -#endif - return (char*)s; -} - -/* Version of strncpy that ensures dest (size bytes) is null-terminated. */ -static char* strncpy0(char* dest, const char* src, size_t size) -{ - strncpy(dest, src, size - 1); - dest[size - 1] = '\0'; - return dest; -} - -/* See documentation in header file. */ -int ini_parse_stream(ini_reader reader, void* stream, ini_handler handler, - void* user) -{ - /* Uses a fair bit of stack (use heap instead if you need to) */ -#if INI_USE_STACK - char line[INI_MAX_LINE]; - int max_line = INI_MAX_LINE; -#else - char* line; - size_t max_line = INI_INITIAL_ALLOC; -#endif -#if INI_ALLOW_REALLOC && !INI_USE_STACK - char* new_line; - size_t offset; -#endif - char section[MAX_SECTION] = ""; - char prev_name[MAX_NAME] = ""; - - char* start; - char* end; - char* name; - char* value; - int lineno = 0; - int error = 0; - -#if !INI_USE_STACK - line = (char*)malloc(INI_INITIAL_ALLOC); - if (!line) { - return -2; - } -#endif - -#if INI_HANDLER_LINENO -#define HANDLER(u, s, n, v) handler(u, s, n, v, lineno) -#else -#define HANDLER(u, s, n, v) handler(u, s, n, v) -#endif - - /* Scan through stream line by line */ - while (reader(line, (int)max_line, stream) != NULL) { -#if INI_ALLOW_REALLOC && !INI_USE_STACK - offset = strlen(line); - while (offset == max_line - 1 && line[offset - 1] != '\n') { - max_line *= 2; - if (max_line > INI_MAX_LINE) - max_line = INI_MAX_LINE; - new_line = realloc(line, max_line); - if (!new_line) { - free(line); - return -2; - } - line = new_line; - if (reader(line + offset, (int)(max_line - offset), stream) == NULL) - break; - if (max_line >= INI_MAX_LINE) - break; - offset += strlen(line + offset); - } -#endif - - lineno++; - - start = line; -#if INI_ALLOW_BOM - if (lineno == 1 && (unsigned char)start[0] == 0xEF && - (unsigned char)start[1] == 0xBB && - (unsigned char)start[2] == 0xBF) { - start += 3; - } -#endif - start = lskip(rstrip(start)); - - if (strchr(INI_START_COMMENT_PREFIXES, *start)) { - /* Start-of-line comment */ - } -#if INI_ALLOW_MULTILINE - else if (*prev_name && *start && start > line) { - /* Non-blank line with leading whitespace, treat as continuation - of previous name's value (as per Python configparser). */ - if (!HANDLER(user, section, prev_name, start) && !error) - error = lineno; - } -#endif - else if (*start == '[') { - /* A "[section]" line */ - end = find_chars_or_comment(start + 1, "]"); - if (*end == ']') { - *end = '\0'; - strncpy0(section, start + 1, sizeof(section)); - *prev_name = '\0'; -#if INI_CALL_HANDLER_ON_NEW_SECTION - if (!HANDLER(user, section, NULL, NULL) && !error) - error = lineno; -#endif - } - else if (!error) { - /* No ']' found on section line */ - error = lineno; - } - } - else if (*start) { - /* Not a comment, must be a name[=:]value pair */ - end = find_chars_or_comment(start, "=:"); - if (*end == '=' || *end == ':') { - *end = '\0'; - name = rstrip(start); - value = end + 1; -#if INI_ALLOW_INLINE_COMMENTS - end = find_chars_or_comment(value, NULL); - if (*end) - *end = '\0'; -#endif - value = lskip(value); - rstrip(value); - - /* Valid name[=:]value pair found, call handler */ - strncpy0(prev_name, name, sizeof(prev_name)); - if (!HANDLER(user, section, name, value) && !error) - error = lineno; - } - else if (!error) { - /* No '=' or ':' found on name[=:]value line */ -#if INI_ALLOW_NO_VALUE - *end = '\0'; - name = rstrip(start); - if (!HANDLER(user, section, name, NULL) && !error) - error = lineno; -#else - error = lineno; -#endif - } - } - -#if INI_STOP_ON_FIRST_ERROR - if (error) - break; -#endif - } - -#if !INI_USE_STACK - free(line); -#endif - - return error; -} - -/* See documentation in header file. */ -int ini_parse_file(FILE* file, ini_handler handler, void* user) -{ - return ini_parse_stream((ini_reader)fgets, file, handler, user); -} - -/* See documentation in header file. */ -int ini_parse(const char* filename, ini_handler handler, void* user) -{ - FILE* file; - int error; - - file = fopen(filename, "r"); - if (!file) - return -1; - error = ini_parse_file(file, handler, user); - fclose(file); - return error; -} - -/* An ini_reader function to read the next line from a string buffer. This - is the fgets() equivalent used by ini_parse_string(). */ -static char* ini_reader_string(char* str, int num, void* stream) { - ini_parse_string_ctx* ctx = (ini_parse_string_ctx*)stream; - const char* ctx_ptr = ctx->ptr; - size_t ctx_num_left = ctx->num_left; - char* strp = str; - char c; - - if (ctx_num_left == 0 || num < 2) - return NULL; - - while (num > 1 && ctx_num_left != 0) { - c = *ctx_ptr++; - ctx_num_left--; - *strp++ = c; - if (c == '\n') - break; - num--; - } - - *strp = '\0'; - ctx->ptr = ctx_ptr; - ctx->num_left = ctx_num_left; - return str; -} - -/* See documentation in header file. */ -int ini_parse_string(const char* string, ini_handler handler, void* user) { - ini_parse_string_ctx ctx; - - ctx.ptr = string; - ctx.num_left = strlen(string); - return ini_parse_stream((ini_reader)ini_reader_string, &ctx, handler, - user); -} diff -Nru gamemode-1.5.1/subprojects/inih/ini.h gamemode-1.6.1/subprojects/inih/ini.h --- gamemode-1.5.1/subprojects/inih/ini.h 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/ini.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,148 +0,0 @@ -/* inih -- simple .INI file parser - -SPDX-License-Identifier: BSD-3-Clause - -Copyright (C) 2009-2020, Ben Hoyt - -inih is released under the New BSD license (see LICENSE.txt). Go to the project -home page for more info: - -https://github.com/benhoyt/inih - -*/ - -#ifndef __INI_H__ -#define __INI_H__ - -/* Make this header file easier to include in C++ code */ -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/* Nonzero if ini_handler callback should accept lineno parameter. */ -#ifndef INI_HANDLER_LINENO -#define INI_HANDLER_LINENO 0 -#endif - -/* Typedef for prototype of handler function. */ -#if INI_HANDLER_LINENO -typedef int (*ini_handler)(void* user, const char* section, - const char* name, const char* value, - int lineno); -#else -typedef int (*ini_handler)(void* user, const char* section, - const char* name, const char* value); -#endif - -/* Typedef for prototype of fgets-style reader function. */ -typedef char* (*ini_reader)(char* str, int num, void* stream); - -/* Parse given INI-style file. May have [section]s, name=value pairs - (whitespace stripped), and comments starting with ';' (semicolon). Section - is "" if name=value pair parsed before any section heading. name:value - pairs are also supported as a concession to Python's configparser. - - For each name=value pair parsed, call handler function with given user - pointer as well as section, name, and value (data only valid for duration - of handler call). Handler should return nonzero on success, zero on error. - - Returns 0 on success, line number of first error on parse error (doesn't - stop on first error), -1 on file open error, or -2 on memory allocation - error (only when INI_USE_STACK is zero). -*/ -int ini_parse(const char* filename, ini_handler handler, void* user); - -/* Same as ini_parse(), but takes a FILE* instead of filename. This doesn't - close the file when it's finished -- the caller must do that. */ -int ini_parse_file(FILE* file, ini_handler handler, void* user); - -/* Same as ini_parse(), but takes an ini_reader function pointer instead of - filename. Used for implementing custom or string-based I/O (see also - ini_parse_string). */ -int ini_parse_stream(ini_reader reader, void* stream, ini_handler handler, - void* user); - -/* Same as ini_parse(), but takes a zero-terminated string with the INI data -instead of a file. Useful for parsing INI data from a network socket or -already in memory. */ -int ini_parse_string(const char* string, ini_handler handler, void* user); - -/* Nonzero to allow multi-line value parsing, in the style of Python's - configparser. If allowed, ini_parse() will call the handler with the same - name for each subsequent line parsed. */ -#ifndef INI_ALLOW_MULTILINE -#define INI_ALLOW_MULTILINE 1 -#endif - -/* Nonzero to allow a UTF-8 BOM sequence (0xEF 0xBB 0xBF) at the start of - the file. See https://github.com/benhoyt/inih/issues/21 */ -#ifndef INI_ALLOW_BOM -#define INI_ALLOW_BOM 1 -#endif - -/* Chars that begin a start-of-line comment. Per Python configparser, allow - both ; and # comments at the start of a line by default. */ -#ifndef INI_START_COMMENT_PREFIXES -#define INI_START_COMMENT_PREFIXES ";#" -#endif - -/* Nonzero to allow inline comments (with valid inline comment characters - specified by INI_INLINE_COMMENT_PREFIXES). Set to 0 to turn off and match - Python 3.2+ configparser behaviour. */ -#ifndef INI_ALLOW_INLINE_COMMENTS -#define INI_ALLOW_INLINE_COMMENTS 1 -#endif -#ifndef INI_INLINE_COMMENT_PREFIXES -#define INI_INLINE_COMMENT_PREFIXES ";" -#endif - -/* Nonzero to use stack for line buffer, zero to use heap (malloc/free). */ -#ifndef INI_USE_STACK -#define INI_USE_STACK 1 -#endif - -/* Maximum line length for any line in INI file (stack or heap). Note that - this must be 3 more than the longest line (due to '\r', '\n', and '\0'). */ -#ifndef INI_MAX_LINE -#define INI_MAX_LINE 200 -#endif - -/* Nonzero to allow heap line buffer to grow via realloc(), zero for a - fixed-size buffer of INI_MAX_LINE bytes. Only applies if INI_USE_STACK is - zero. */ -#ifndef INI_ALLOW_REALLOC -#define INI_ALLOW_REALLOC 0 -#endif - -/* Initial size in bytes for heap line buffer. Only applies if INI_USE_STACK - is zero. */ -#ifndef INI_INITIAL_ALLOC -#define INI_INITIAL_ALLOC 200 -#endif - -/* Stop parsing on first error (default is to keep parsing). */ -#ifndef INI_STOP_ON_FIRST_ERROR -#define INI_STOP_ON_FIRST_ERROR 0 -#endif - -/* Nonzero to call the handler at the start of each new section (with - name and value NULL). Default is to only call the handler on - each name=value pair. */ -#ifndef INI_CALL_HANDLER_ON_NEW_SECTION -#define INI_CALL_HANDLER_ON_NEW_SECTION 0 -#endif - -/* Nonzero to allow a name without a value (no '=' or ':' on the line) and - call the handler with value NULL in this case. Default is to treat - no-value lines as an error. */ -#ifndef INI_ALLOW_NO_VALUE -#define INI_ALLOW_NO_VALUE 0 -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __INI_H__ */ diff -Nru gamemode-1.5.1/subprojects/inih/LICENSE.txt gamemode-1.6.1/subprojects/inih/LICENSE.txt --- gamemode-1.5.1/subprojects/inih/LICENSE.txt 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/LICENSE.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ - -The "inih" library is distributed under the New BSD license: - -Copyright (c) 2009, Ben Hoyt -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Ben Hoyt nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY BEN HOYT ''AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL BEN HOYT BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -Nru gamemode-1.5.1/subprojects/inih/meson.build gamemode-1.6.1/subprojects/inih/meson.build --- gamemode-1.5.1/subprojects/inih/meson.build 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/meson.build 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -project('inih', - ['c','cpp'], - meson_version : '>= 0.46.0', - default_options : ['default_library=both'], - license : 'BSD-3-Clause', - version : '48' -) - -pkg = import('pkgconfig') - -#### inih #### -install_headers('ini.h') - -inc_inih = include_directories('.') - -lib_inih = library('inih', - ['ini.c'], - include_directories : inc_inih, - install : true, - version : meson.project_version(), - soversion : '0' -) - -pkg.generate(lib_inih, - name : 'inih', - description : 'simple .INI file parser', - version : meson.project_version() -) - -inih_dep = declare_dependency( - link_with : lib_inih, - include_directories : inc_inih -) - -#### INIReader #### -install_headers('cpp/INIReader.h') - -inc_INIReader = include_directories('cpp') - -lib_INIReader = library('INIReader', - ['cpp/INIReader.cpp'], - include_directories : inc_INIReader, - dependencies : inih_dep, - install : true, - version : meson.project_version(), - soversion : '0' -) - -pkg.generate(lib_INIReader, - name : 'INIReader', - description : 'simple .INI file parser for C++', - version : meson.project_version() -) - -INIReader_dep = declare_dependency( - link_with : lib_inih, - include_directories : inc_INIReader -) diff -Nru gamemode-1.5.1/subprojects/inih/README.md gamemode-1.6.1/subprojects/inih/README.md --- gamemode-1.5.1/subprojects/inih/README.md 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/README.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,139 +0,0 @@ -# inih (INI Not Invented Here) - -[![TravisCI Build](https://travis-ci.org/benhoyt/inih.svg)](https://travis-ci.org/benhoyt/inih) - -**inih (INI Not Invented Here)** is a simple [.INI file](http://en.wikipedia.org/wiki/INI_file) parser written in C. It's only a couple of pages of code, and it was designed to be _small and simple_, so it's good for embedded systems. It's also more or less compatible with Python's [ConfigParser](http://docs.python.org/library/configparser.html) style of .INI files, including RFC 822-style multi-line syntax and `name: value` entries. - -To use it, just give `ini_parse()` an INI file, and it will call a callback for every `name=value` pair parsed, giving you strings for the section, name, and value. It's done this way ("SAX style") because it works well on low-memory embedded systems, but also because it makes for a KISS implementation. - -You can also call `ini_parse_file()` to parse directly from a `FILE*` object, `ini_parse_string()` to parse data from a string, or `ini_parse_stream()` to parse using a custom fgets-style reader function for custom I/O. - -Download a release, browse the source, or read about [how to use inih in a DRY style](http://blog.brush.co.nz/2009/08/xmacros/) with X-Macros. - - -## Compile-time options ## - -You can control various aspects of inih using preprocessor defines: - -### Syntax options ### - - * **Multi-line entries:** By default, inih supports multi-line entries in the style of Python's ConfigParser. To disable, add `-DINI_ALLOW_MULTILINE=0`. - * **UTF-8 BOM:** By default, inih allows a UTF-8 BOM sequence (0xEF 0xBB 0xBF) at the start of INI files. To disable, add `-DINI_ALLOW_BOM=0`. - * **Inline comments:** By default, inih allows inline comments with the `;` character. To disable, add `-DINI_ALLOW_INLINE_COMMENTS=0`. You can also specify which character(s) start an inline comment using `INI_INLINE_COMMENT_PREFIXES`. - * **Start-of-line comments:** By default, inih allows both `;` and `#` to start a comment at the beginning of a line. You can override this by changing `INI_START_COMMENT_PREFIXES`. - * **Allow no value:** By default, inih treats a name with no value (no `=` or `:` on the line) as an error. To allow names with no values, add `-DINI_ALLOW_NO_VALUE=1`, and inih will call your handler function with value set to NULL. - -### Parsing options ### - - * **Stop on first error:** By default, inih keeps parsing the rest of the file after an error. To stop parsing on the first error, add `-DINI_STOP_ON_FIRST_ERROR=1`. - * **Report line numbers:** By default, the `ini_handler` callback doesn't receive the line number as a parameter. If you need that, add `-DINI_HANDLER_LINENO=1`. - * **Call handler on new section:** By default, inih only calls the handler on each `name=value` pair. To detect new sections (e.g., the INI file has multiple sections with the same name), add `-DINI_CALL_HANDLER_ON_NEW_SECTION=1`. Your handler function will then be called each time a new section is encountered, with `section` set to the new section name but `name` and `value` set to NULL. - -### Memory options ### - - * **Stack vs heap:** By default, inih creates a fixed-sized line buffer on the stack. To allocate on the heap using `malloc` instead, specify `-DINI_USE_STACK=0`. - * **Maximum line length:** The default maximum line length (for stack or heap) is 200 bytes. To override this, add something like `-DINI_MAX_LINE=1000`. Note that `INI_MAX_LINE` must be 3 more than the longest line (due to `\r`, `\n`, and the NUL). - * **Allow realloc:** By default when using the heap (`-DINI_USE_STACK=0`), inih allocates a fixed-sized buffer of `INI_INITIAL_ALLOC` bytes. To allow this to grow to `INI_MAX_LINE` bytes, doubling if needed, set `-DINI_ALLOW_REALLOC=1`. - * **Initial malloc size:** `INI_INITIAL_ALLOC` specifies the initial malloc size when using the heap. It defaults to 200 bytes. - -## Simple example in C ## - -```c -#include -#include -#include -#include "../ini.h" - -typedef struct -{ - int version; - const char* name; - const char* email; -} configuration; - -static int handler(void* user, const char* section, const char* name, - const char* value) -{ - configuration* pconfig = (configuration*)user; - - #define MATCH(s, n) strcmp(section, s) == 0 && strcmp(name, n) == 0 - if (MATCH("protocol", "version")) { - pconfig->version = atoi(value); - } else if (MATCH("user", "name")) { - pconfig->name = strdup(value); - } else if (MATCH("user", "email")) { - pconfig->email = strdup(value); - } else { - return 0; /* unknown section/name, error */ - } - return 1; -} - -int main(int argc, char* argv[]) -{ - configuration config; - - if (ini_parse("test.ini", handler, &config) < 0) { - printf("Can't load 'test.ini'\n"); - return 1; - } - printf("Config loaded from 'test.ini': version=%d, name=%s, email=%s\n", - config.version, config.name, config.email); - return 0; -} -``` - - -## C++ example ## - -If you're into C++ and the STL, there is also an easy-to-use [INIReader class](https://github.com/benhoyt/inih/blob/master/cpp/INIReader.h) that stores values in a `map` and lets you `Get()` them: - -```cpp -#include -#include "INIReader.h" - -int main() -{ - INIReader reader("../examples/test.ini"); - - if (reader.ParseError() < 0) { - std::cout << "Can't load 'test.ini'\n"; - return 1; - } - std::cout << "Config loaded from 'test.ini': version=" - << reader.GetInteger("protocol", "version", -1) << ", name=" - << reader.Get("user", "name", "UNKNOWN") << ", email=" - << reader.Get("user", "email", "UNKNOWN") << ", pi=" - << reader.GetReal("user", "pi", -1) << ", active=" - << reader.GetBoolean("user", "active", true) << "\n"; - return 0; -} -``` - -This simple C++ API works fine, but it's not very fully-fledged. I'm not planning to work more on the C++ API at the moment, so if you want a bit more power (for example `GetSections()` and `GetFields()` functions), see these forks: - - * https://github.com/Blandinium/inih - * https://github.com/OSSystems/inih - - -## Differences from ConfigParser ## - -Some differences between inih and Python's [ConfigParser](http://docs.python.org/library/configparser.html) standard library module: - -* INI name=value pairs given above any section headers are treated as valid items with no section (section name is an empty string). In ConfigParser having no section is an error. -* Line continuations are handled with leading whitespace on continued lines (like ConfigParser). However, instead of concatenating continued lines together, they are treated as separate values for the same key (unlike ConfigParser). - - -## Platform-specific notes ## - -* Windows/Win32 uses UTF-16 filenames natively, so to handle Unicode paths you need to call `_wfopen()` to open a file and then `ini_parse_file()` to parse it; inih does not include `wchar_t` or Unicode handling. - -## Meson notes ## - -* The `meson.build` file is intended to build libraries which can be installed on a system. This is not required to use or compile inih. -* If you want to use inih for programs which may be shipped in a distro, consider linking against the shared library. Meson adds entries for pkg-config (`inih` and `INIReader`). -* In case you use inih as a subproject, you can use the `inih_dep` and `INIReader_dep` dependency variables. - -## Related links ## - -* [Conan package for inih](https://github.com/mohamedghita/conan-inih) (Conan is a C/C++ package manager) diff -Nru gamemode-1.5.1/subprojects/inih/tests/bad_comment.ini gamemode-1.6.1/subprojects/inih/tests/bad_comment.ini --- gamemode-1.5.1/subprojects/inih/tests/bad_comment.ini 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/bad_comment.ini 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -This is an error diff -Nru gamemode-1.5.1/subprojects/inih/tests/bad_multi.ini gamemode-1.6.1/subprojects/inih/tests/bad_multi.ini --- gamemode-1.5.1/subprojects/inih/tests/bad_multi.ini 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/bad_multi.ini 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ - indented diff -Nru gamemode-1.5.1/subprojects/inih/tests/bad_section.ini gamemode-1.6.1/subprojects/inih/tests/bad_section.ini --- gamemode-1.5.1/subprojects/inih/tests/bad_section.ini 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/bad_section.ini 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -[section1] -name1=value1 -[section2 -[section3 ; comment ] -name2=value2 diff -Nru gamemode-1.5.1/subprojects/inih/tests/baseline_allow_no_value.txt gamemode-1.6.1/subprojects/inih/tests/baseline_allow_no_value.txt --- gamemode-1.5.1/subprojects/inih/tests/baseline_allow_no_value.txt 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/baseline_allow_no_value.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -no_file.ini: e=-1 user=0 -... [section1] -... one=This is a test; -... two=1234; -... [ section 2 ] -... happy=4; -... sad=; -... [comment_test] -... test1=1;2;3; -... test2=2;3;4;this won't be a comment, needs whitespace before ';'; -... test;3=345; -... test4=4#5#6; -... test7=; -... test8=; not a comment, needs whitespace before ';'; -... [colon_tests] -... Content-Type=text/html; -... foo=bar; -... adams=42; -... funny1=with = equals; -... funny2=with : colons; -... funny3=two = equals; -... funny4=two : colons; -normal.ini: e=0 user=101 -... [section1] -... name1=value1; -... name2=value2; -bad_section.ini: e=3 user=102 -... This is an error; -bad_comment.ini: e=0 user=103 -... [section] -... a=b; -... user=parse_error; -... c=d; -user_error.ini: e=3 user=104 -... [section1] -... single1=abc; -... multi=this is a; -... multi=multi-line value; -... single2=xyz; -... [section2] -... multi=a; -... multi=b; -... multi=c; -... [section3] -... single=ghi; -... multi=the quick; -... multi=brown fox; -... name=bob smith; -multi_line.ini: e=0 user=105 -... indented; -bad_multi.ini: e=0 user=106 -... [bom_section] -... bom_name=bom_value; -... key“=value“; -bom.ini: e=0 user=107 -... [section1] -... single1=abc; -... single2=xyz; -... single1=def; -... single2=qrs; -duplicate_sections.ini: e=0 user=108 -... [section_list] -... section0; -... section1; -... [section0] -... key0=val0; -... [section1] -... key1=val1; -no_value.ini: e=0 user=109 diff -Nru gamemode-1.5.1/subprojects/inih/tests/baseline_call_handler_on_new_section.txt gamemode-1.6.1/subprojects/inih/tests/baseline_call_handler_on_new_section.txt --- gamemode-1.5.1/subprojects/inih/tests/baseline_call_handler_on_new_section.txt 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/baseline_call_handler_on_new_section.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -no_file.ini: e=-1 user=0 -... [section1] -... one=This is a test; -... two=1234; -... [ section 2 ] -... happy=4; -... sad=; -... [empty] -... [comment_test] -... test1=1;2;3; -... test2=2;3;4;this won't be a comment, needs whitespace before ';'; -... test;3=345; -... test4=4#5#6; -... test7=; -... test8=; not a comment, needs whitespace before ';'; -... [colon_tests] -... Content-Type=text/html; -... foo=bar; -... adams=42; -... funny1=with = equals; -... funny2=with : colons; -... funny3=two = equals; -... funny4=two : colons; -normal.ini: e=0 user=101 -... [section1] -... name1=value1; -... name2=value2; -bad_section.ini: e=3 user=102 -bad_comment.ini: e=1 user=102 -... [section] -... a=b; -... user=parse_error; -... c=d; -user_error.ini: e=3 user=104 -... [section1] -... single1=abc; -... multi=this is a; -... multi=multi-line value; -... single2=xyz; -... [section2] -... multi=a; -... multi=b; -... multi=c; -... [section3] -... single=ghi; -... multi=the quick; -... multi=brown fox; -... name=bob smith; -multi_line.ini: e=0 user=105 -bad_multi.ini: e=1 user=105 -... [bom_section] -... bom_name=bom_value; -... key“=value“; -bom.ini: e=0 user=107 -... [section1] -... single1=abc; -... single2=xyz; -... [section1] -... single1=def; -... single2=qrs; -duplicate_sections.ini: e=0 user=108 -... [section_list] -... [section0] -... key0=val0; -... [section1] -... key1=val1; -no_value.ini: e=2 user=109 diff -Nru gamemode-1.5.1/subprojects/inih/tests/baseline_disallow_inline_comments.txt gamemode-1.6.1/subprojects/inih/tests/baseline_disallow_inline_comments.txt --- gamemode-1.5.1/subprojects/inih/tests/baseline_disallow_inline_comments.txt 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/baseline_disallow_inline_comments.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -no_file.ini: e=-1 user=0 -... [section1] -... one=This is a test ; name=value comment; -... two=1234; -... [ section 2 ] -... happy=4; -... sad=; -... [comment_test] -... test1=1;2;3 ; only this will be a comment; -... test2=2;3;4;this won't be a comment, needs whitespace before ';'; -... test;3=345 ; key should be "test;3"; -... test4=4#5#6 ; '#' only starts a comment at start of line; -... test7=; blank value, except if inline comments disabled; -... test8=; not a comment, needs whitespace before ';'; -... [colon_tests] -... Content-Type=text/html; -... foo=bar; -... adams=42; -... funny1=with = equals; -... funny2=with : colons; -... funny3=two = equals; -... funny4=two : colons; -normal.ini: e=0 user=101 -... [section1] -... name1=value1; -... [section3 ; comment ] -... name2=value2; -bad_section.ini: e=3 user=102 -bad_comment.ini: e=1 user=102 -... [section] -... a=b; -... user=parse_error; -... c=d; -user_error.ini: e=3 user=104 -... [section1] -... single1=abc; -... multi=this is a; -... multi=multi-line value; -... single2=xyz; -... [section2] -... multi=a; -... multi=b; -... multi=c; -... [section3] -... single=ghi; -... multi=the quick; -... multi=brown fox; -... name=bob smith ; comment line 1; -multi_line.ini: e=0 user=105 -bad_multi.ini: e=1 user=105 -... [bom_section] -... bom_name=bom_value; -... key“=value“; -bom.ini: e=0 user=107 -... [section1] -... single1=abc; -... single2=xyz; -... single1=def; -... single2=qrs; -duplicate_sections.ini: e=0 user=108 -... [section0] -... key0=val0; -... [section1] -... key1=val1; -no_value.ini: e=2 user=109 diff -Nru gamemode-1.5.1/subprojects/inih/tests/baseline_handler_lineno.txt gamemode-1.6.1/subprojects/inih/tests/baseline_handler_lineno.txt --- gamemode-1.5.1/subprojects/inih/tests/baseline_handler_lineno.txt 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/baseline_handler_lineno.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -no_file.ini: e=-1 user=0 -... [section1] -... one=This is a test; line 3 -... two=1234; line 4 -... [ section 2 ] -... happy=4; line 8 -... sad=; line 9 -... [comment_test] -... test1=1;2;3; line 15 -... test2=2;3;4;this won't be a comment, needs whitespace before ';'; line 16 -... test;3=345; line 17 -... test4=4#5#6; line 18 -... test7=; line 21 -... test8=; not a comment, needs whitespace before ';'; line 22 -... [colon_tests] -... Content-Type=text/html; line 25 -... foo=bar; line 26 -... adams=42; line 27 -... funny1=with = equals; line 28 -... funny2=with : colons; line 29 -... funny3=two = equals; line 30 -... funny4=two : colons; line 31 -normal.ini: e=0 user=101 -... [section1] -... name1=value1; line 2 -... name2=value2; line 5 -bad_section.ini: e=3 user=102 -bad_comment.ini: e=1 user=102 -... [section] -... a=b; line 2 -... user=parse_error; line 3 -... c=d; line 4 -user_error.ini: e=3 user=104 -... [section1] -... single1=abc; line 2 -... multi=this is a; line 3 -... multi=multi-line value; line 4 -... single2=xyz; line 5 -... [section2] -... multi=a; line 7 -... multi=b; line 8 -... multi=c; line 9 -... [section3] -... single=ghi; line 11 -... multi=the quick; line 12 -... multi=brown fox; line 13 -... name=bob smith; line 14 -multi_line.ini: e=0 user=105 -bad_multi.ini: e=1 user=105 -... [bom_section] -... bom_name=bom_value; line 2 -... key“=value“; line 3 -bom.ini: e=0 user=107 -... [section1] -... single1=abc; line 2 -... single2=xyz; line 3 -... single1=def; line 5 -... single2=qrs; line 6 -duplicate_sections.ini: e=0 user=108 -... [section0] -... key0=val0; line 6 -... [section1] -... key1=val1; line 9 -no_value.ini: e=2 user=109 diff -Nru gamemode-1.5.1/subprojects/inih/tests/baseline_heap_max_line.txt gamemode-1.6.1/subprojects/inih/tests/baseline_heap_max_line.txt --- gamemode-1.5.1/subprojects/inih/tests/baseline_heap_max_line.txt 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/baseline_heap_max_line.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -no_file.ini: e=-1 user=0 -... [section1] -... one=This is a test; -... two=1234; -... [ section 2 ] -... happy=4; -... sad=; -... [comment_test] -... test1=1;2;3; -... test2=2;3;4;this; -... test2=needs whitespace b; -... test;3=345; -... test4=4#5#6; -... test4=only starts a comm; -... test7=; -... test8=; not a comm; -... [colon_tests] -... Content-Type=text/; -... foo=bar; -... adams=42; -... funny1=with = equ; -... funny2=with : col; -... funny3=two = equa; -... funny4=two : colo; -normal.ini: e=2 user=101 -... [section1] -... name1=value1; -... name2=value2; -bad_section.ini: e=3 user=102 -bad_comment.ini: e=1 user=102 -... [section] -... a=b; -... user=parse_error; -... c=d; -user_error.ini: e=3 user=104 -... [section1] -... single1=abc; -... multi=this is a; -... multi=multi-line; -... single2=xyz; -... [section2] -... multi=a; -... multi=b; -... multi=c; -... [section3] -... single=ghi; -... multi=the quick; -... multi=brown fox; -... name=bob smith; -... name=comment line 1; -... name=comment line 2; -multi_line.ini: e=5 user=105 -bad_multi.ini: e=1 user=105 -... [bom_section] -... bom_name=bom_value; -... key“=value“; -bom.ini: e=0 user=107 -... [section1] -... single1=abc; -... single2=xyz; -... single1=def; -... single2=qrs; -duplicate_sections.ini: e=0 user=108 -... [section0] -... key0=val0; -... [section1] -... key1=val1; -no_value.ini: e=2 user=109 diff -Nru gamemode-1.5.1/subprojects/inih/tests/baseline_heap_realloc_max_line.txt gamemode-1.6.1/subprojects/inih/tests/baseline_heap_realloc_max_line.txt --- gamemode-1.5.1/subprojects/inih/tests/baseline_heap_realloc_max_line.txt 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/baseline_heap_realloc_max_line.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -no_file.ini: e=-1 user=0 -... [section1] -... one=This is a test; -... two=1234; -... [ section 2 ] -... happy=4; -... sad=; -... [comment_test] -... test1=1;2;3; -... test2=2;3;4;this; -... test2=needs whitespace b; -... test;3=345; -... test4=4#5#6; -... test4=only starts a comm; -... test7=; -... test8=; not a comm; -... [colon_tests] -... Content-Type=text/; -... foo=bar; -... adams=42; -... funny1=with = equ; -... funny2=with : col; -... funny3=two = equa; -... funny4=two : colo; -normal.ini: e=2 user=101 -... [section1] -... name1=value1; -... name2=value2; -bad_section.ini: e=3 user=102 -bad_comment.ini: e=1 user=102 -... [section] -... a=b; -... user=parse_error; -... c=d; -user_error.ini: e=3 user=104 -... [section1] -... single1=abc; -... multi=this is a; -... multi=multi-line; -... single2=xyz; -... [section2] -... multi=a; -... multi=b; -... multi=c; -... [section3] -... single=ghi; -... multi=the quick; -... multi=brown fox; -... name=bob smith; -... name=comment line 1; -... name=comment line 2; -multi_line.ini: e=5 user=105 -bad_multi.ini: e=1 user=105 -... [bom_section] -... bom_name=bom_value; -... key“=value“; -bom.ini: e=0 user=107 -... [section1] -... single1=abc; -... single2=xyz; -... single1=def; -... single2=qrs; -duplicate_sections.ini: e=0 user=108 -... [section0] -... key0=val0; -... [section1] -... key1=val1; -no_value.ini: e=2 user=109 diff -Nru gamemode-1.5.1/subprojects/inih/tests/baseline_heap_realloc.txt gamemode-1.6.1/subprojects/inih/tests/baseline_heap_realloc.txt --- gamemode-1.5.1/subprojects/inih/tests/baseline_heap_realloc.txt 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/baseline_heap_realloc.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -no_file.ini: e=-1 user=0 -... [section1] -... one=This is a test; -... two=1234; -... [ section 2 ] -... happy=4; -... sad=; -... [comment_test] -... test1=1;2;3; -... test2=2;3;4;this won't be a comment, needs whitespace before ';'; -... test;3=345; -... test4=4#5#6; -... test7=; -... test8=; not a comment, needs whitespace before ';'; -... [colon_tests] -... Content-Type=text/html; -... foo=bar; -... adams=42; -... funny1=with = equals; -... funny2=with : colons; -... funny3=two = equals; -... funny4=two : colons; -normal.ini: e=0 user=101 -... [section1] -... name1=value1; -... name2=value2; -bad_section.ini: e=3 user=102 -bad_comment.ini: e=1 user=102 -... [section] -... a=b; -... user=parse_error; -... c=d; -user_error.ini: e=3 user=104 -... [section1] -... single1=abc; -... multi=this is a; -... multi=multi-line value; -... single2=xyz; -... [section2] -... multi=a; -... multi=b; -... multi=c; -... [section3] -... single=ghi; -... multi=the quick; -... multi=brown fox; -... name=bob smith; -multi_line.ini: e=0 user=105 -bad_multi.ini: e=1 user=105 -... [bom_section] -... bom_name=bom_value; -... key“=value“; -bom.ini: e=0 user=107 -... [section1] -... single1=abc; -... single2=xyz; -... single1=def; -... single2=qrs; -duplicate_sections.ini: e=0 user=108 -... [section0] -... key0=val0; -... [section1] -... key1=val1; -no_value.ini: e=2 user=109 diff -Nru gamemode-1.5.1/subprojects/inih/tests/baseline_heap_string.txt gamemode-1.6.1/subprojects/inih/tests/baseline_heap_string.txt --- gamemode-1.5.1/subprojects/inih/tests/baseline_heap_string.txt 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/baseline_heap_string.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -empty string: e=0 user=0 -... [section] -... foo=bar; -... bazz=buzz quxx; -basic: e=0 user=101 -... [section] -... hello=world; -... forty_two=42; -crlf: e=0 user=102 -... [sec] -... foo=0123456789012; -... bar=4321; -long line: e=3 user=103 -... [sec] -... foo=0123456789012; -... bix=1234; -long continued: e=0 user=104 -... [s] -... a=1; -... c=3; -error: e=3 user=105 diff -Nru gamemode-1.5.1/subprojects/inih/tests/baseline_heap.txt gamemode-1.6.1/subprojects/inih/tests/baseline_heap.txt --- gamemode-1.5.1/subprojects/inih/tests/baseline_heap.txt 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/baseline_heap.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -no_file.ini: e=-1 user=0 -... [section1] -... one=This is a test; -... two=1234; -... [ section 2 ] -... happy=4; -... sad=; -... [comment_test] -... test1=1;2;3; -... test2=2;3;4;this won't be a comment, needs whitespace before ';'; -... test;3=345; -... test4=4#5#6; -... test7=; -... test8=; not a comment, needs whitespace before ';'; -... [colon_tests] -... Content-Type=text/html; -... foo=bar; -... adams=42; -... funny1=with = equals; -... funny2=with : colons; -... funny3=two = equals; -... funny4=two : colons; -normal.ini: e=0 user=101 -... [section1] -... name1=value1; -... name2=value2; -bad_section.ini: e=3 user=102 -bad_comment.ini: e=1 user=102 -... [section] -... a=b; -... user=parse_error; -... c=d; -user_error.ini: e=3 user=104 -... [section1] -... single1=abc; -... multi=this is a; -... multi=multi-line value; -... single2=xyz; -... [section2] -... multi=a; -... multi=b; -... multi=c; -... [section3] -... single=ghi; -... multi=the quick; -... multi=brown fox; -... name=bob smith; -multi_line.ini: e=0 user=105 -bad_multi.ini: e=1 user=105 -... [bom_section] -... bom_name=bom_value; -... key“=value“; -bom.ini: e=0 user=107 -... [section1] -... single1=abc; -... single2=xyz; -... single1=def; -... single2=qrs; -duplicate_sections.ini: e=0 user=108 -... [section0] -... key0=val0; -... [section1] -... key1=val1; -no_value.ini: e=2 user=109 diff -Nru gamemode-1.5.1/subprojects/inih/tests/baseline_multi_max_line.txt gamemode-1.6.1/subprojects/inih/tests/baseline_multi_max_line.txt --- gamemode-1.5.1/subprojects/inih/tests/baseline_multi_max_line.txt 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/baseline_multi_max_line.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -no_file.ini: e=-1 user=0 -... [section1] -... one=This is a test; -... two=1234; -... [ section 2 ] -... happy=4; -... sad=; -... [comment_test] -... test1=1;2;3; -... test2=2;3;4;this; -... test2=needs whitespace b; -... test;3=345; -... test4=4#5#6; -... test4=only starts a comm; -... test7=; -... test8=; not a comm; -... [colon_tests] -... Content-Type=text/; -... foo=bar; -... adams=42; -... funny1=with = equ; -... funny2=with : col; -... funny3=two = equa; -... funny4=two : colo; -normal.ini: e=2 user=101 -... [section1] -... name1=value1; -... name2=value2; -bad_section.ini: e=3 user=102 -bad_comment.ini: e=1 user=102 -... [section] -... a=b; -... user=parse_error; -... c=d; -user_error.ini: e=3 user=104 -... [section1] -... single1=abc; -... multi=this is a; -... multi=multi-line; -... single2=xyz; -... [section2] -... multi=a; -... multi=b; -... multi=c; -... [section3] -... single=ghi; -... multi=the quick; -... multi=brown fox; -... name=bob smith; -... name=comment line 1; -... name=comment line 2; -multi_line.ini: e=5 user=105 -bad_multi.ini: e=1 user=105 -... [bom_section] -... bom_name=bom_value; -... key“=value“; -bom.ini: e=0 user=107 -... [section1] -... single1=abc; -... single2=xyz; -... single1=def; -... single2=qrs; -duplicate_sections.ini: e=0 user=108 -... [section0] -... key0=val0; -... [section1] -... key1=val1; -no_value.ini: e=2 user=109 diff -Nru gamemode-1.5.1/subprojects/inih/tests/baseline_multi.txt gamemode-1.6.1/subprojects/inih/tests/baseline_multi.txt --- gamemode-1.5.1/subprojects/inih/tests/baseline_multi.txt 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/baseline_multi.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -no_file.ini: e=-1 user=0 -... [section1] -... one=This is a test; -... two=1234; -... [ section 2 ] -... happy=4; -... sad=; -... [comment_test] -... test1=1;2;3; -... test2=2;3;4;this won't be a comment, needs whitespace before ';'; -... test;3=345; -... test4=4#5#6; -... test7=; -... test8=; not a comment, needs whitespace before ';'; -... [colon_tests] -... Content-Type=text/html; -... foo=bar; -... adams=42; -... funny1=with = equals; -... funny2=with : colons; -... funny3=two = equals; -... funny4=two : colons; -normal.ini: e=0 user=101 -... [section1] -... name1=value1; -... name2=value2; -bad_section.ini: e=3 user=102 -bad_comment.ini: e=1 user=102 -... [section] -... a=b; -... user=parse_error; -... c=d; -user_error.ini: e=3 user=104 -... [section1] -... single1=abc; -... multi=this is a; -... multi=multi-line value; -... single2=xyz; -... [section2] -... multi=a; -... multi=b; -... multi=c; -... [section3] -... single=ghi; -... multi=the quick; -... multi=brown fox; -... name=bob smith; -multi_line.ini: e=0 user=105 -bad_multi.ini: e=1 user=105 -... [bom_section] -... bom_name=bom_value; -... key“=value“; -bom.ini: e=0 user=107 -... [section1] -... single1=abc; -... single2=xyz; -... single1=def; -... single2=qrs; -duplicate_sections.ini: e=0 user=108 -... [section0] -... key0=val0; -... [section1] -... key1=val1; -no_value.ini: e=2 user=109 diff -Nru gamemode-1.5.1/subprojects/inih/tests/baseline_single.txt gamemode-1.6.1/subprojects/inih/tests/baseline_single.txt --- gamemode-1.5.1/subprojects/inih/tests/baseline_single.txt 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/baseline_single.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -no_file.ini: e=-1 user=0 -... [section1] -... one=This is a test; -... two=1234; -... [ section 2 ] -... happy=4; -... sad=; -... [comment_test] -... test1=1;2;3; -... test2=2;3;4;this won't be a comment, needs whitespace before ';'; -... test;3=345; -... test4=4#5#6; -... test7=; -... test8=; not a comment, needs whitespace before ';'; -... [colon_tests] -... Content-Type=text/html; -... foo=bar; -... adams=42; -... funny1=with = equals; -... funny2=with : colons; -... funny3=two = equals; -... funny4=two : colons; -normal.ini: e=0 user=101 -... [section1] -... name1=value1; -... name2=value2; -bad_section.ini: e=3 user=102 -bad_comment.ini: e=1 user=102 -... [section] -... a=b; -... user=parse_error; -... c=d; -user_error.ini: e=3 user=104 -... [section1] -... single1=abc; -... multi=this is a; -... single2=xyz; -... [section2] -... multi=a; -... [section3] -... single=ghi; -... multi=the quick; -... name=bob smith; -multi_line.ini: e=4 user=105 -bad_multi.ini: e=1 user=105 -... [bom_section] -... bom_name=bom_value; -... key“=value“; -bom.ini: e=0 user=107 -... [section1] -... single1=abc; -... single2=xyz; -... single1=def; -... single2=qrs; -duplicate_sections.ini: e=0 user=108 -... [section0] -... key0=val0; -... [section1] -... key1=val1; -no_value.ini: e=2 user=109 diff -Nru gamemode-1.5.1/subprojects/inih/tests/baseline_stop_on_first_error.txt gamemode-1.6.1/subprojects/inih/tests/baseline_stop_on_first_error.txt --- gamemode-1.5.1/subprojects/inih/tests/baseline_stop_on_first_error.txt 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/baseline_stop_on_first_error.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -no_file.ini: e=-1 user=0 -... [section1] -... one=This is a test; -... two=1234; -... [ section 2 ] -... happy=4; -... sad=; -... [comment_test] -... test1=1;2;3; -... test2=2;3;4;this won't be a comment, needs whitespace before ';'; -... test;3=345; -... test4=4#5#6; -... test7=; -... test8=; not a comment, needs whitespace before ';'; -... [colon_tests] -... Content-Type=text/html; -... foo=bar; -... adams=42; -... funny1=with = equals; -... funny2=with : colons; -... funny3=two = equals; -... funny4=two : colons; -normal.ini: e=0 user=101 -... [section1] -... name1=value1; -bad_section.ini: e=3 user=102 -bad_comment.ini: e=1 user=102 -... [section] -... a=b; -... user=parse_error; -user_error.ini: e=3 user=104 -... [section1] -... single1=abc; -... multi=this is a; -... multi=multi-line value; -... single2=xyz; -... [section2] -... multi=a; -... multi=b; -... multi=c; -... [section3] -... single=ghi; -... multi=the quick; -... multi=brown fox; -... name=bob smith; -multi_line.ini: e=0 user=105 -bad_multi.ini: e=1 user=105 -... [bom_section] -... bom_name=bom_value; -... key“=value“; -bom.ini: e=0 user=107 -... [section1] -... single1=abc; -... single2=xyz; -... single1=def; -... single2=qrs; -duplicate_sections.ini: e=0 user=108 -no_value.ini: e=2 user=108 diff -Nru gamemode-1.5.1/subprojects/inih/tests/baseline_string.txt gamemode-1.6.1/subprojects/inih/tests/baseline_string.txt --- gamemode-1.5.1/subprojects/inih/tests/baseline_string.txt 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/baseline_string.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -empty string: e=0 user=0 -... [section] -... foo=bar; -... bazz=buzz quxx; -basic: e=0 user=101 -... [section] -... hello=world; -... forty_two=42; -crlf: e=0 user=102 -... [sec] -... foo=0123456789012; -... bar=4321; -long line: e=3 user=103 -... [sec] -... foo=0123456789012; -... bix=1234; -long continued: e=0 user=104 -... [s] -... a=1; -... c=3; -error: e=3 user=105 diff -Nru gamemode-1.5.1/subprojects/inih/tests/bom.ini gamemode-1.6.1/subprojects/inih/tests/bom.ini --- gamemode-1.5.1/subprojects/inih/tests/bom.ini 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/bom.ini 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[bom_section] -bom_name=bom_value -key“ = value“ diff -Nru gamemode-1.5.1/subprojects/inih/tests/duplicate_sections.ini gamemode-1.6.1/subprojects/inih/tests/duplicate_sections.ini --- gamemode-1.5.1/subprojects/inih/tests/duplicate_sections.ini 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/duplicate_sections.ini 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -[section1] -single1 = abc -single2 = xyz -[section1] -single1 = def -single2 = qrs \ No newline at end of file diff -Nru gamemode-1.5.1/subprojects/inih/tests/multi_line.ini gamemode-1.6.1/subprojects/inih/tests/multi_line.ini --- gamemode-1.5.1/subprojects/inih/tests/multi_line.ini 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/multi_line.ini 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -[section1] -single1 = abc -multi = this is a - multi-line value -single2 = xyz -[section2] -multi = a - b - c -[section3] -single: ghi -multi: the quick - brown fox -name = bob smith ; comment line 1 - ; comment line 2 diff -Nru gamemode-1.5.1/subprojects/inih/tests/normal.ini gamemode-1.6.1/subprojects/inih/tests/normal.ini --- gamemode-1.5.1/subprojects/inih/tests/normal.ini 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/normal.ini 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -; This is an INI file -[section1] ; section comment -one=This is a test ; name=value comment -two = 1234 -; x=y - -[ section 2 ] -happy = 4 -sad = - -[empty] -; do nothing - -[comment_test] -test1 = 1;2;3 ; only this will be a comment -test2 = 2;3;4;this won't be a comment, needs whitespace before ';' -test;3 = 345 ; key should be "test;3" -test4 = 4#5#6 ; '#' only starts a comment at start of line -#test5 = 567 ; entire line commented - # test6 = 678 ; entire line commented, except in MULTILINE mode -test7 = ; blank value, except if inline comments disabled -test8 =; not a comment, needs whitespace before ';' - -[colon_tests] -Content-Type: text/html -foo:bar -adams : 42 -funny1 : with = equals -funny2 = with : colons -funny3 = two = equals -funny4 : two : colons diff -Nru gamemode-1.5.1/subprojects/inih/tests/no_value.ini gamemode-1.6.1/subprojects/inih/tests/no_value.ini --- gamemode-1.5.1/subprojects/inih/tests/no_value.ini 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/no_value.ini 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -[section_list] -section0 -section1 - -[section0] -key0=val0 - -[section1] -key1=val1 diff -Nru gamemode-1.5.1/subprojects/inih/tests/unittest.bat gamemode-1.6.1/subprojects/inih/tests/unittest.bat --- gamemode-1.5.1/subprojects/inih/tests/unittest.bat 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/unittest.bat 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -@call tcc ..\ini.c -I..\ -run unittest.c > baseline_multi.txt -@call tcc ..\ini.c -I..\ -DINI_MAX_LINE=20 -run unittest.c > baseline_multi_max_line.txt -@call tcc ..\ini.c -I..\ -DINI_ALLOW_MULTILINE=0 -run unittest.c > baseline_single.txt -@call tcc ..\ini.c -I..\ -DINI_ALLOW_INLINE_COMMENTS=0 -run unittest.c > baseline_disallow_inline_comments.txt -@call tcc ..\ini.c -I..\ -DINI_STOP_ON_FIRST_ERROR=1 -run unittest.c > baseline_stop_on_first_error.txt -@call tcc ..\ini.c -I..\ -DINI_HANDLER_LINENO=1 -run unittest.c > baseline_handler_lineno.txt -@call tcc ..\ini.c -I..\ -DINI_USE_STACK=0 -run unittest.c > baseline_heap.txt -@call tcc ..\ini.c -I..\ -DINI_USE_STACK=0 -DINI_MAX_LINE=20 -DINI_INITIAL_ALLOC=20 -run unittest.c > baseline_heap_max_line.txt -@call tcc ..\ini.c -I..\ -DINI_USE_STACK=0 -DINI_ALLOW_REALLOC=1 -DINI_INITIAL_ALLOC=5 -run unittest.c > baseline_heap_realloc.txt -@call tcc ..\ini.c -I..\ -DINI_USE_STACK=0 -DINI_MAX_LINE=20 -DINI_ALLOW_REALLOC=1 -DINI_INITIAL_ALLOC=5 -run unittest.c > baseline_heap_realloc_max_line.txt -@call tcc ..\ini.c -I..\ -DINI_USE_STACK=0 -DINI_MAX_LINE=20 -DINI_INITIAL_ALLOC=20 -run unittest.c > baseline_heap_string.txt -@call tcc ..\ini.c -I..\ -DINI_CALL_HANDLER_ON_NEW_SECTION=1 -run unittest.c > baseline_call_handler_on_new_section.txt -@call tcc ..\ini.c -I..\ -DINI_ALLOW_NO_VALUE=1 -run unittest.c > baseline_allow_no_value.txt diff -Nru gamemode-1.5.1/subprojects/inih/tests/unittest.c gamemode-1.6.1/subprojects/inih/tests/unittest.c --- gamemode-1.5.1/subprojects/inih/tests/unittest.c 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/unittest.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -/* inih -- unit tests - -This works simply by dumping a bunch of info to standard output, which is -redirected to an output file (baseline_*.txt) and checked into the Subversion -repository. This baseline file is the test output, so the idea is to check it -once, and if it changes -- look at the diff and see which tests failed. - -See unittest.bat and unittest.sh for how to run this (with tcc and gcc, -respectively). - -*/ - -#include -#include -#include -#include "../ini.h" - -int User; -char Prev_section[50]; - -#if INI_HANDLER_LINENO -int dumper(void* user, const char* section, const char* name, - const char* value, int lineno) -#else -int dumper(void* user, const char* section, const char* name, - const char* value) -#endif -{ - User = *((int*)user); - if (!name || strcmp(section, Prev_section)) { - printf("... [%s]\n", section); - strncpy(Prev_section, section, sizeof(Prev_section)); - Prev_section[sizeof(Prev_section) - 1] = '\0'; - } - if (!name) { - return 1; - } - -#if INI_HANDLER_LINENO - printf("... %s%s%s; line %d\n", name, value ? "=" : "", value ? value : "", lineno); -#else - printf("... %s%s%s;\n", name, value ? "=" : "", value ? value : ""); -#endif - - return strcmp(name, "user")==0 && strcmp(value, "parse_error")==0 ? 0 : 1; -} - -void parse(const char* fname) { - static int u = 100; - int e; - - *Prev_section = '\0'; - e = ini_parse(fname, dumper, &u); - printf("%s: e=%d user=%d\n", fname, e, User); - u++; -} - -int main(void) -{ - parse("no_file.ini"); - parse("normal.ini"); - parse("bad_section.ini"); - parse("bad_comment.ini"); - parse("user_error.ini"); - parse("multi_line.ini"); - parse("bad_multi.ini"); - parse("bom.ini"); - parse("duplicate_sections.ini"); - parse("no_value.ini"); - return 0; -} diff -Nru gamemode-1.5.1/subprojects/inih/tests/unittest.sh gamemode-1.6.1/subprojects/inih/tests/unittest.sh --- gamemode-1.5.1/subprojects/inih/tests/unittest.sh 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/unittest.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -#!/usr/bin/env bash - -gcc ../ini.c unittest.c -o unittest_multi -./unittest_multi > baseline_multi.txt -rm -f unittest_multi - -gcc ../ini.c -DINI_MAX_LINE=20 unittest.c -o unittest_multi_max_line -./unittest_multi_max_line > baseline_multi_max_line.txt -rm -f unittest_multi_max_line - -gcc ../ini.c -DINI_ALLOW_MULTILINE=0 unittest.c -o unittest_single -./unittest_single > baseline_single.txt -rm -f unittest_single - -gcc ../ini.c -DINI_ALLOW_INLINE_COMMENTS=0 unittest.c -o unittest_disallow_inline_comments -./unittest_disallow_inline_comments > baseline_disallow_inline_comments.txt -rm -f unittest_disallow_inline_comments - -gcc ../ini.c -DINI_STOP_ON_FIRST_ERROR=1 unittest.c -o unittest_stop_on_first_error -./unittest_stop_on_first_error > baseline_stop_on_first_error.txt -rm -f unittest_stop_on_first_error - -gcc ../ini.c -DINI_HANDLER_LINENO=1 unittest.c -o unittest_handler_lineno -./unittest_handler_lineno > baseline_handler_lineno.txt -rm -f unittest_handler_lineno - -gcc ../ini.c -DINI_MAX_LINE=20 unittest_string.c -o unittest_string -./unittest_string > baseline_string.txt -rm -f unittest_string - -gcc ../ini.c -DINI_USE_STACK=0 unittest.c -o unittest_heap -./unittest_heap > baseline_heap.txt -rm -f unittest_heap - -gcc ../ini.c -DINI_USE_STACK=0 -DINI_MAX_LINE=20 -DINI_INITIAL_ALLOC=20 unittest.c -o unittest_heap_max_line -./unittest_heap_max_line > baseline_heap_max_line.txt -rm -f unittest_heap_max_line - -gcc ../ini.c -DINI_USE_STACK=0 -DINI_ALLOW_REALLOC=1 -DINI_INITIAL_ALLOC=5 unittest.c -o unittest_heap_realloc -./unittest_heap_realloc > baseline_heap_realloc.txt -rm -f unittest_heap_realloc - -gcc ../ini.c -DINI_USE_STACK=0 -DINI_MAX_LINE=20 -DINI_ALLOW_REALLOC=1 -DINI_INITIAL_ALLOC=5 unittest.c -o unittest_heap_realloc_max_line -./unittest_heap_realloc_max_line > baseline_heap_realloc_max_line.txt -rm -f unittest_heap_realloc_max_line - -gcc ../ini.c -DINI_USE_STACK=0 -DINI_MAX_LINE=20 -DINI_INITIAL_ALLOC=20 unittest_string.c -o unittest_heap_string -./unittest_heap_string > baseline_heap_string.txt -rm -f unittest_heap_string - -gcc ../ini.c -DINI_CALL_HANDLER_ON_NEW_SECTION=1 unittest.c -o unittest_call_handler_on_new_section -./unittest_call_handler_on_new_section > baseline_call_handler_on_new_section.txt -rm -f unittest_call_handler_on_new_section - -gcc ../ini.c -DINI_ALLOW_NO_VALUE=1 unittest.c -o unittest_allow_no_value -./unittest_allow_no_value > baseline_allow_no_value.txt -rm -f unittest_allow_no_value diff -Nru gamemode-1.5.1/subprojects/inih/tests/unittest_string.c gamemode-1.6.1/subprojects/inih/tests/unittest_string.c --- gamemode-1.5.1/subprojects/inih/tests/unittest_string.c 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/unittest_string.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/* inih -- unit tests for ini_parse_string() */ - -#include -#include -#include -#include "../ini.h" - -int User; -char Prev_section[50]; - -int dumper(void* user, const char* section, const char* name, - const char* value) -{ - User = *((int*)user); - if (strcmp(section, Prev_section)) { - printf("... [%s]\n", section); - strncpy(Prev_section, section, sizeof(Prev_section)); - Prev_section[sizeof(Prev_section) - 1] = '\0'; - } - printf("... %s=%s;\n", name, value); - return 1; -} - -void parse(const char* name, const char* string) { - static int u = 100; - int e; - - *Prev_section = '\0'; - e = ini_parse_string(string, dumper, &u); - printf("%s: e=%d user=%d\n", name, e, User); - u++; -} - -int main(void) -{ - parse("empty string", ""); - parse("basic", "[section]\nfoo = bar\nbazz = buzz quxx"); - parse("crlf", "[section]\r\nhello = world\r\nforty_two = 42\r\n"); - parse("long line", "[sec]\nfoo = 01234567890123456789\nbar=4321\n"); - parse("long continued", "[sec]\nfoo = 0123456789012bix=1234\n"); - parse("error", "[s]\na=1\nb\nc=3"); - return 0; -} diff -Nru gamemode-1.5.1/subprojects/inih/tests/user_error.ini gamemode-1.6.1/subprojects/inih/tests/user_error.ini --- gamemode-1.5.1/subprojects/inih/tests/user_error.ini 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/tests/user_error.ini 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -[section] -a = b -user = parse_error -c = d diff -Nru gamemode-1.5.1/subprojects/inih/.travis.yml gamemode-1.6.1/subprojects/inih/.travis.yml --- gamemode-1.5.1/subprojects/inih/.travis.yml 2020-03-01 06:31:28.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/.travis.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -language: c - -# Setting sudo access to false will let Travis CI use containers -# rather than VMs to run the tests. For more details see: -# https://docs.travis-ci.com/user/reference/overview/ -sudo: false - -script: - - cd tests - - ./unittest.sh - - cd ../examples - - ./cpptest.sh - - git diff --exit-code diff -Nru gamemode-1.5.1/subprojects/inih.wrap gamemode-1.6.1/subprojects/inih.wrap --- gamemode-1.5.1/subprojects/inih.wrap 1970-01-01 00:00:00.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih.wrap 2021-02-18 19:00:12.000000000 +0000 @@ -0,0 +1,13 @@ +[wrap-file] +directory = inih-r53 +source_url = https://github.com/benhoyt/inih/archive/r53.tar.gz +source_filename = inih-r53.tar.gz +source_hash = 01b0366fdfdf6363efc070c2f856f1afa33e7a6546548bada5456ad94a516241 +patch_url = https://wrapdb.mesonbuild.com/v1/projects/inih/r53/1/get_zip +patch_filename = inih-r53-1-wrap.zip +patch_hash = 9a53348e4ed9180a52aafc092fda080ddc70102c9fc55686990e461b22e6e1e7 + +[provide] +inih = inih_dep +inireader = inireader_dep + diff -Nru gamemode-1.5.1/.travis.yml gamemode-1.6.1/.travis.yml --- gamemode-1.5.1/.travis.yml 2020-03-03 16:18:48.000000000 +0000 +++ gamemode-1.6.1/.travis.yml 2021-02-18 19:00:12.000000000 +0000 @@ -1,28 +1,25 @@ -dist: xenial +os: linux +dist: focal language: c compiler: gcc -sudo: false + addons: apt: packages: + - appstream - clang - clang-format - - python3-pip - - python3-setuptools - - libsystemd-dev - - ninja-build + - libinih-dev - libdbus-1-dev + - libsystemd-dev + - meson artifacts: paths: - $(git ls-files -o | tr "\n" ":") -before_script: - - pip3 install wheel - - pip3 install --upgrade 'meson==0.52.0' - - meson --version - script: - ./scripts/format-check.sh - ./bootstrap.sh -Dwith-examples=true - - gamemoded -v + - meson test -C builddir + - dbus-run-session -- gamemode-simulate-game - ./scripts/static-analyser-check.sh