diff -Nru gamemode-1.6/CHANGELOG.md gamemode-1.6.1/CHANGELOG.md --- gamemode-1.6/CHANGELOG.md 2020-09-01 15:21:05.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.6/data/io.github.feralinteractive.gamemode.metainfo.xml gamemode-1.6.1/data/io.github.feralinteractive.gamemode.metainfo.xml --- gamemode-1.6/data/io.github.feralinteractive.gamemode.metainfo.xml 2020-09-01 15:21:05.000000000 +0000 +++ gamemode-1.6.1/data/io.github.feralinteractive.gamemode.metainfo.xml 2021-02-18 19:00:12.000000000 +0000 @@ -1,11 +1,13 @@ - + io.github.feralinteractive.gamemode gamemode daemon that allows games to request a set of optimizations be temporarily applied Feral Interactive + + FSFAP BSD-3-Clause @@ -29,12 +31,9 @@ + Utility Game - - - gamemoderun - diff -Nru gamemode-1.6/data/meson.build gamemode-1.6.1/data/meson.build --- gamemode-1.6/data/meson.build 2020-09-01 15:21:05.000000000 +0000 +++ gamemode-1.6.1/data/meson.build 2021-02-18 19:00:12.000000000 +0000 @@ -54,7 +54,7 @@ install_man( gamemoded_manpage, - install_dir: path_mandir, + install_dir: join_paths(path_mandir, 'man8') ) gamemoderun_manpage = configure_file( @@ -65,7 +65,7 @@ install_man( gamemoderun_manpage, - install_dir: path_mandir, + install_dir: join_paths(path_mandir, 'man1') ) if with_examples @@ -77,7 +77,7 @@ install_man( example_manpage, - install_dir: path_mandir, + install_dir: join_paths(path_mandir, 'man1') ) endif diff -Nru gamemode-1.6/debian/changelog gamemode-1.6.1/debian/changelog --- gamemode-1.6/debian/changelog 2020-09-11 21:41:51.000000000 +0000 +++ gamemode-1.6.1/debian/changelog 2021-02-19 11:59:15.000000000 +0000 @@ -1,3 +1,11 @@ +gamemode (1.6.1-1) unstable; urgency=medium + + * New upstream version 1.6.1 + * Set Multi-Arch: allowed for package gamemode + * Make packages cross-arch binNMU safe + + -- Stephan Lachnit Fri, 19 Feb 2021 12:59:15 +0100 + gamemode (1.6-1) unstable; urgency=medium * New upstream release. diff -Nru gamemode-1.6/debian/clean gamemode-1.6.1/debian/clean --- gamemode-1.6/debian/clean 2020-09-11 21:41:51.000000000 +0000 +++ gamemode-1.6.1/debian/clean 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -builddir/ diff -Nru gamemode-1.6/debian/control gamemode-1.6.1/debian/control --- gamemode-1.6/debian/control 2020-09-11 21:41:51.000000000 +0000 +++ gamemode-1.6.1/debian/control 2020-11-29 08:18:40.000000000 +0000 @@ -13,21 +13,21 @@ pkg-config, 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: no +Multi-Arch: allowed Depends: ${misc:Depends}, ${shlibs:Depends}, - gamemode-daemon (= ${binary:Version}), - libgamemode0 (= ${binary:Version}), - libgamemodeauto0 (= ${binary:Version}), -Recommends: libgamemode0:i386 (= ${binary:Version}) [amd64], - libgamemodeauto0:i386 (= ${binary:Version}) [amd64], + 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 @@ -88,7 +88,7 @@ Multi-Arch: same Depends: ${misc:Depends}, ${shlibs:Depends}, - gamemode-daemon (= ${binary:Version}), + 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. @@ -145,7 +145,8 @@ Multi-Arch: same Depends: ${misc:Depends}, libgamemodeauto0 (= ${binary:Version}), -Recommends: gamemode (= ${binary:Version}), +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. diff -Nru gamemode-1.6/debian/gamemode-daemon.install gamemode-1.6.1/debian/gamemode-daemon.install --- gamemode-1.6/debian/gamemode-daemon.install 2020-09-11 21:41:51.000000000 +0000 +++ gamemode-1.6.1/debian/gamemode-daemon.install 2020-11-28 16:17:49.000000000 +0000 @@ -4,5 +4,5 @@ usr/lib/systemd/ usr/share/dbus-1/ usr/share/polkit-1/ -usr/share/man/gamemoded.8 usr/share/man/man8 +usr/share/man/man8/gamemoded.8 usr/share/gamemode/gamemode.ini diff -Nru gamemode-1.6/debian/gamemode.install gamemode-1.6.1/debian/gamemode.install --- gamemode-1.6/debian/gamemode.install 2020-09-11 21:41:51.000000000 +0000 +++ gamemode-1.6.1/debian/gamemode.install 2020-11-28 16:17:19.000000000 +0000 @@ -1,5 +1,5 @@ usr/bin/gamemoderun usr/games/ usr/bin/gamemode-simulate-game usr/games/ -usr/share/man/gamemoderun.1 usr/share/man/man1 -usr/share/man/gamemode-simulate-game.1 usr/share/man/man1 +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.6/debian/gbp.conf gamemode-1.6.1/debian/gbp.conf --- gamemode-1.6/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.6/debian/libgamemode0.lintian-overrides gamemode-1.6.1/debian/libgamemode0.lintian-overrides --- gamemode-1.6/debian/libgamemode0.lintian-overrides 2020-09-11 21:41:51.000000000 +0000 +++ gamemode-1.6.1/debian/libgamemode0.lintian-overrides 2020-11-29 08:15:51.000000000 +0000 @@ -1,2 +1,2 @@ -# libgamemode isn't designed to be linked against +# libgamemode.so can be loaded as a fallback from libgamemodeauto link-to-shared-library-in-wrong-package diff -Nru gamemode-1.6/debian/libgamemode0.symbols gamemode-1.6.1/debian/libgamemode0.symbols --- gamemode-1.6/debian/libgamemode0.symbols 2020-09-11 21:41:51.000000000 +0000 +++ gamemode-1.6.1/debian/libgamemode0.symbols 2020-11-29 08:15:51.000000000 +0000 @@ -1,5 +1,5 @@ libgamemode.so.0 libgamemode0 #MINVER# -* Build-Depends-Package: libgamemode-dev +* 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.6/debian/libgamemodeauto0.symbols gamemode-1.6.1/debian/libgamemodeauto0.symbols --- gamemode-1.6/debian/libgamemodeauto0.symbols 2020-09-11 21:41:51.000000000 +0000 +++ gamemode-1.6.1/debian/libgamemodeauto0.symbols 2020-11-29 08:15:51.000000000 +0000 @@ -1,4 +1,4 @@ libgamemodeauto.so.0 libgamemodeauto0 #MINVER# -* Build-Depends-Package: libgamemode-dev +* Build-Depends-Package: gamemode-dev gamemode_request_end@Base 1.5 gamemode_request_start@Base 1.5 diff -Nru gamemode-1.6/debian/patches/0001-gamemoded-test-fix.patch gamemode-1.6.1/debian/patches/0001-gamemoded-test-fix.patch --- gamemode-1.6/debian/patches/0001-gamemoded-test-fix.patch 2020-09-11 21:41:51.000000000 +0000 +++ gamemode-1.6.1/debian/patches/0001-gamemoded-test-fix.patch 2021-02-19 11:58:34.000000000 +0000 @@ -3,9 +3,9 @@ Forwarded: not-needed Last-Update: 2020-09-11 ---- gamemode-1.6.orig/daemon/gamemode-tests.c -+++ gamemode-1.6/daemon/gamemode-tests.c -@@ -268,7 +268,7 @@ static int run_gamemoderun_and_reaper_te +--- 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 */ diff -Nru gamemode-1.6/debian/watch gamemode-1.6.1/debian/watch --- gamemode-1.6/debian/watch 2020-09-11 21:41:51.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\S+)\.tar\.gz/gamemode-$1\.tar\.gz/" \ - https://github.com/FeralInteractive/gamemode/tags \ - .*/v?(\d\S+)\.tar\.gz debian uupdate + https://github.com/FeralInteractive/gamemode/tags .*/v?(\d\S+)\.tar\.gz diff -Nru gamemode-1.6/LICENSE.txt gamemode-1.6.1/LICENSE.txt --- gamemode-1.6/LICENSE.txt 2020-09-01 15:21:05.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.6/meson.build gamemode-1.6.1/meson.build --- gamemode-1.6/meson.build 2020-09-01 15:21:05.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.6-dev', + version: '1.6.1', license: 'BSD', ) diff -Nru gamemode-1.6/README.md gamemode-1.6.1/README.md --- gamemode-1.6/README.md 2020-09-01 15:21:05.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. @@ -90,7 +90,7 @@ ``` #### Arch ```bash -pacman -S meson systemd git dbus +pacman -S meson systemd git dbus libinih ``` #### Fedora ```bash @@ -107,12 +107,12 @@ ``` ### 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 ``` @@ -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.6/scripts/mkrelease.sh gamemode-1.6.1/scripts/mkrelease.sh --- gamemode-1.6/scripts/mkrelease.sh 2020-09-01 15:21:05.000000000 +0000 +++ gamemode-1.6.1/scripts/mkrelease.sh 2021-02-18 19:00:12.000000000 +0000 @@ -13,7 +13,7 @@ # 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/ +tar -rf ${NAME}-${VERSION}.tar --exclude-vcs --transform="s,^subprojects,${NAME}-$VERSION/subprojects," subprojects/inih-r53/ # compress archive xz -9 "${NAME}-${VERSION}.tar" diff -Nru gamemode-1.6/subprojects/inih/cpp/INIReader.cpp gamemode-1.6.1/subprojects/inih/cpp/INIReader.cpp --- gamemode-1.6/subprojects/inih/cpp/INIReader.cpp 2020-09-11 18:16:25.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.6/subprojects/inih/cpp/INIReader.h gamemode-1.6.1/subprojects/inih/cpp/INIReader.h --- gamemode-1.6/subprojects/inih/cpp/INIReader.h 2020-09-11 18:16:25.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.6/subprojects/inih/examples/config.def gamemode-1.6.1/subprojects/inih/examples/config.def --- gamemode-1.6/subprojects/inih/examples/config.def 2020-09-11 18:16:25.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.6/subprojects/inih/examples/cpptest.sh gamemode-1.6.1/subprojects/inih/examples/cpptest.sh --- gamemode-1.6/subprojects/inih/examples/cpptest.sh 2020-09-11 18:16:25.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.6/subprojects/inih/examples/cpptest.txt gamemode-1.6.1/subprojects/inih/examples/cpptest.txt --- gamemode-1.6/subprojects/inih/examples/cpptest.txt 2020-09-11 18:16:25.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.6/subprojects/inih/examples/ini_dump.c gamemode-1.6.1/subprojects/inih/examples/ini_dump.c --- gamemode-1.6/subprojects/inih/examples/ini_dump.c 2020-09-11 18:16:25.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.6/subprojects/inih/examples/ini_example.c gamemode-1.6.1/subprojects/inih/examples/ini_example.c --- gamemode-1.6/subprojects/inih/examples/ini_example.c 2020-09-11 18:16:25.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.6/subprojects/inih/examples/INIReaderExample.cpp gamemode-1.6.1/subprojects/inih/examples/INIReaderExample.cpp --- gamemode-1.6/subprojects/inih/examples/INIReaderExample.cpp 2020-09-11 18:16:25.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.6/subprojects/inih/examples/ini_xmacros.c gamemode-1.6.1/subprojects/inih/examples/ini_xmacros.c --- gamemode-1.6/subprojects/inih/examples/ini_xmacros.c 2020-09-11 18:16:25.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.6/subprojects/inih/examples/test.ini gamemode-1.6.1/subprojects/inih/examples/test.ini --- gamemode-1.6/subprojects/inih/examples/test.ini 2020-09-11 18:16:25.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.6/subprojects/inih/ini.c gamemode-1.6.1/subprojects/inih/ini.c --- gamemode-1.6/subprojects/inih/ini.c 2020-09-11 18:16:25.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.6/subprojects/inih/ini.h gamemode-1.6.1/subprojects/inih/ini.h --- gamemode-1.6/subprojects/inih/ini.h 2020-09-11 18:16:25.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.6/subprojects/inih/LICENSE.txt gamemode-1.6.1/subprojects/inih/LICENSE.txt --- gamemode-1.6/subprojects/inih/LICENSE.txt 2020-09-11 18:16:25.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.6/subprojects/inih/meson.build gamemode-1.6.1/subprojects/inih/meson.build --- gamemode-1.6/subprojects/inih/meson.build 2020-09-11 18:16:25.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/meson.build 1970-01-01 00:00:00.000000000 +0000 @@ -1,115 +0,0 @@ -project('inih', - ['c','cpp'], - default_options : ['default_library=static'], - license : 'BSD-3-Clause', - version : '49' -) - -#### options #### - -arg_static = [] -distro_install = get_option('distro_install') - -if distro_install - pkg = import('pkgconfig') -else - if not get_option('multi-line_entries') - arg_static += ['-DINI_ALLOW_MULTILINE=0'] - endif - if not get_option('utf-8_bom') - arg_static += ['-DINI_ALLOW_BOM=0'] - endif - if not get_option('inline_comments') - arg_static += ['-DINI_ALLOW_INLINE_COMMENTS=0'] - endif - inline_comment_prefix = get_option('inline_comment_prefix') - if inline_comment_prefix != ';' - arg_static += ['-DINI_INLINE_COMMENT_PREFIXES="' + inline_comment_prefix + '"'] - endif - sol_comment_prefix = get_option('start-of-line_comment_prefix') - if sol_comment_prefix != ';#' - arg_static += ['-DINI_START_COMMENT_PREFIXES="' + start-of-line_comment_prefix + '"'] - endif - if get_option('allow_no_value') - arg_static += ['-DINI_ALLOW_NO_VALUE=1'] - endif - if get_option('stop_on_first_error') - arg_static += ['-DINI_STOP_ON_FIRST_ERROR=1'] - endif - if get_option('report_line_numbers') - arg_static += ['-DINI_HANDLER_LINENO=1'] - endif - if get_option('call_handler_on_new_section') - arg_static += ['-DINI_CALL_HANDLER_ON_NEW_SECTION=1'] - endif - if get_option('use_heap') - arg_static += ['-DINI_USE_STACK=0'] - endif - max_line_length = get_option('max_line_length') - if max_line_length != 200 - arg_static += ['-DINI_MAX_LINE=' + str(max_line_length)] - endif - initial_malloc_size = get_option('initial_malloc_size') - if initial_malloc_size != 200 - arg_static += ['-DINI_INITIAL_ALLOC=' + str(initial_malloc_size)] - endif - if get_option('allow_realloc') - arg_static += ['-DINI_ALLOW_REALLOC=1'] - endif -endif - -#### inih #### -inc_inih = include_directories('.') - -lib_inih = library('inih', - ['ini.c'], - include_directories : inc_inih, - c_args : arg_static, - install : distro_install, - version : meson.project_version(), - soversion : '0' -) - -if distro_install - install_headers('ini.h') - - pkg.generate(lib_inih, - name : 'inih', - description : 'simple .INI file parser', - version : meson.project_version() - ) -endif - -inih_dep = declare_dependency( - link_with : lib_inih, - include_directories : inc_inih -) - -#### INIReader #### -if get_option('with_INIReader') - inc_INIReader = include_directories('cpp') - - lib_INIReader = library('INIReader', - ['cpp/INIReader.cpp'], - include_directories : inc_INIReader, - dependencies : inih_dep, - install : distro_install, - version : meson.project_version(), - soversion : '0' - ) - - if distro_install - install_headers('cpp/INIReader.h') - - pkg.generate(lib_INIReader, - name : 'INIReader', - description : 'simple .INI file parser for C++', - version : meson.project_version() - ) - endif - - INIReader_dep = declare_dependency( - link_with : lib_INIReader, - include_directories : inc_INIReader - ) -endif diff -Nru gamemode-1.6/subprojects/inih/meson_options.txt gamemode-1.6.1/subprojects/inih/meson_options.txt --- gamemode-1.6/subprojects/inih/meson_options.txt 2020-09-11 18:16:25.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/meson_options.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -option('distro_install', - type : 'boolean', - value : false, - description : 'install shared libs, headers and pkg-config entries' -) -option('with_INIReader', - type : 'boolean', - value : false, - description : 'compile and (if selected) install INIReader' -) -option('multi-line_entries', - type : 'boolean', - value : true, - description : 'support for multi-line entries in the style of Python\'s ConfigParser' -) -option('utf-8_bom', - type : 'boolean', - value : true, - description : 'allow a UTF-8 BOM sequence (0xEF 0xBB 0xBF) at the start of INI files' -) -option('inline_comments', - type : 'boolean', - value : true, - description : 'allow inline comments with the comment prefix character' -) -option('inline_comment_prefix', - type : 'string', - value : ';', - description : 'character(s) to start an inline comment (if enabled)' -) -option('start-of-line_comment_prefix', - type : 'string', - value : ';#', - description : 'character(s) to start a comment at the beginning of a line' -) -option('allow_no_value', - type : 'boolean', - value : false, - description : 'allow name with no value' -) -option('stop_on_first_error', - type : 'boolean', - value : false, - description : 'stop parsing after an error' -) -option('report_line_numbers', - type : 'boolean', - value : false, - description : 'report line number on ini_handler callback' -) -option('call_handler_on_new_section', - type : 'boolean', - value : false, - description : 'call the handler each time a new section is encountered' -) -option('use_heap', - type : 'boolean', - value : false, - description : 'allocate memory on the heap using malloc instead using a fixed-sized line buffer on the stack' -) -option('max_line_length', - type : 'integer', - value : 200, - description : 'maximum line length in bytes' -) -option('initial_malloc_size', - type : 'integer', - value : 200, - description : 'initial malloc size in bytes (when using the heap)' -) -option('allow_realloc', - type : 'boolean', - value : false, - description : 'allow initial malloc size to grow to max line length (when using the heap)' -) diff -Nru gamemode-1.6/subprojects/inih/README.md gamemode-1.6.1/subprojects/inih/README.md --- gamemode-1.6/subprojects/inih/README.md 2020-09-11 18:16:25.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih/README.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,157 +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). - * **Initial malloc size:** `INI_INITIAL_ALLOC` specifies the initial malloc size when using the heap. It defaults to 200 bytes. - * **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`. - -## 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 not required to use or compile inih, its main purpose is for distributions. -* By default Meson only creates a static library for inih, but Meson can be used to configure this behavior: -* with `-Ddefault_library=shared` a shared library is build. -* with `-Ddistro_install=true` the library will be installed with the header and a pkg-config entry, you may want to set `-Ddefault_library=shared` when using this. -* with `-Dwith_INIReader` you can build (and install if selected) the C++ library. -* all compile-time options are implemented in Meson as well, you can take a look at [meson_options.txt](https://github.com/benhoyt/inih/blob/master/meson_options.txt) for their definition. These won't work if `distro_install` is set to `true`. -* If you want to use inih for programs which may be shipped in a distro, consider linking against the shared libraries. The pkg-config entries are `inih` and `INIReader`. -* In case you use inih as a subproject, you can use the `inih_dep` and `INIReader_dep` dependency variables. - -## Building from vcpkg ## - -You can build and install inih using [vcpkg](https://github.com/microsoft/vcpkg/) dependency manager: - - git clone https://github.com/Microsoft/vcpkg.git - cd vcpkg - ./bootstrap-vcpkg.sh - ./vcpkg integrate install - ./vcpkg install inih - -The inih port in vcpkg is kept up to date by microsoft team members and community contributors. -If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. - -## Related links ## - -* [Conan package for inih](https://github.com/mohamedghita/conan-inih) (Conan is a C/C++ package manager) diff -Nru gamemode-1.6/subprojects/inih/tests/bad_comment.ini gamemode-1.6.1/subprojects/inih/tests/bad_comment.ini --- gamemode-1.6/subprojects/inih/tests/bad_comment.ini 2020-09-11 18:16:25.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.6/subprojects/inih/tests/bad_multi.ini gamemode-1.6.1/subprojects/inih/tests/bad_multi.ini --- gamemode-1.6/subprojects/inih/tests/bad_multi.ini 2020-09-11 18:16:25.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.6/subprojects/inih/tests/bad_section.ini gamemode-1.6.1/subprojects/inih/tests/bad_section.ini --- gamemode-1.6/subprojects/inih/tests/bad_section.ini 2020-09-11 18:16:25.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.6/subprojects/inih/tests/baseline_allow_no_value.txt gamemode-1.6.1/subprojects/inih/tests/baseline_allow_no_value.txt --- gamemode-1.6/subprojects/inih/tests/baseline_allow_no_value.txt 2020-09-11 18:16:25.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.6/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.6/subprojects/inih/tests/baseline_call_handler_on_new_section.txt 2020-09-11 18:16:25.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.6/subprojects/inih/tests/baseline_disallow_inline_comments.txt gamemode-1.6.1/subprojects/inih/tests/baseline_disallow_inline_comments.txt --- gamemode-1.6/subprojects/inih/tests/baseline_disallow_inline_comments.txt 2020-09-11 18:16:25.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.6/subprojects/inih/tests/baseline_handler_lineno.txt gamemode-1.6.1/subprojects/inih/tests/baseline_handler_lineno.txt --- gamemode-1.6/subprojects/inih/tests/baseline_handler_lineno.txt 2020-09-11 18:16:25.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.6/subprojects/inih/tests/baseline_heap_max_line.txt gamemode-1.6.1/subprojects/inih/tests/baseline_heap_max_line.txt --- gamemode-1.6/subprojects/inih/tests/baseline_heap_max_line.txt 2020-09-11 18:16:25.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.6/subprojects/inih/tests/baseline_heap_realloc_max_line.txt gamemode-1.6.1/subprojects/inih/tests/baseline_heap_realloc_max_line.txt --- gamemode-1.6/subprojects/inih/tests/baseline_heap_realloc_max_line.txt 2020-09-11 18:16:25.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.6/subprojects/inih/tests/baseline_heap_realloc.txt gamemode-1.6.1/subprojects/inih/tests/baseline_heap_realloc.txt --- gamemode-1.6/subprojects/inih/tests/baseline_heap_realloc.txt 2020-09-11 18:16:25.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.6/subprojects/inih/tests/baseline_heap_string.txt gamemode-1.6.1/subprojects/inih/tests/baseline_heap_string.txt --- gamemode-1.6/subprojects/inih/tests/baseline_heap_string.txt 2020-09-11 18:16:25.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.6/subprojects/inih/tests/baseline_heap.txt gamemode-1.6.1/subprojects/inih/tests/baseline_heap.txt --- gamemode-1.6/subprojects/inih/tests/baseline_heap.txt 2020-09-11 18:16:25.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.6/subprojects/inih/tests/baseline_multi_max_line.txt gamemode-1.6.1/subprojects/inih/tests/baseline_multi_max_line.txt --- gamemode-1.6/subprojects/inih/tests/baseline_multi_max_line.txt 2020-09-11 18:16:25.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.6/subprojects/inih/tests/baseline_multi.txt gamemode-1.6.1/subprojects/inih/tests/baseline_multi.txt --- gamemode-1.6/subprojects/inih/tests/baseline_multi.txt 2020-09-11 18:16:25.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.6/subprojects/inih/tests/baseline_single.txt gamemode-1.6.1/subprojects/inih/tests/baseline_single.txt --- gamemode-1.6/subprojects/inih/tests/baseline_single.txt 2020-09-11 18:16:25.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.6/subprojects/inih/tests/baseline_stop_on_first_error.txt gamemode-1.6.1/subprojects/inih/tests/baseline_stop_on_first_error.txt --- gamemode-1.6/subprojects/inih/tests/baseline_stop_on_first_error.txt 2020-09-11 18:16:25.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.6/subprojects/inih/tests/baseline_string.txt gamemode-1.6.1/subprojects/inih/tests/baseline_string.txt --- gamemode-1.6/subprojects/inih/tests/baseline_string.txt 2020-09-11 18:16:25.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.6/subprojects/inih/tests/bom.ini gamemode-1.6.1/subprojects/inih/tests/bom.ini --- gamemode-1.6/subprojects/inih/tests/bom.ini 2020-09-11 18:16:25.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.6/subprojects/inih/tests/duplicate_sections.ini gamemode-1.6.1/subprojects/inih/tests/duplicate_sections.ini --- gamemode-1.6/subprojects/inih/tests/duplicate_sections.ini 2020-09-11 18:16:25.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.6/subprojects/inih/tests/multi_line.ini gamemode-1.6.1/subprojects/inih/tests/multi_line.ini --- gamemode-1.6/subprojects/inih/tests/multi_line.ini 2020-09-11 18:16:25.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.6/subprojects/inih/tests/normal.ini gamemode-1.6.1/subprojects/inih/tests/normal.ini --- gamemode-1.6/subprojects/inih/tests/normal.ini 2020-09-11 18:16:25.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.6/subprojects/inih/tests/no_value.ini gamemode-1.6.1/subprojects/inih/tests/no_value.ini --- gamemode-1.6/subprojects/inih/tests/no_value.ini 2020-09-11 18:16:25.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.6/subprojects/inih/tests/unittest.bat gamemode-1.6.1/subprojects/inih/tests/unittest.bat --- gamemode-1.6/subprojects/inih/tests/unittest.bat 2020-09-11 18:16:25.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.6/subprojects/inih/tests/unittest.c gamemode-1.6.1/subprojects/inih/tests/unittest.c --- gamemode-1.6/subprojects/inih/tests/unittest.c 2020-09-11 18:16:25.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.6/subprojects/inih/tests/unittest.sh gamemode-1.6.1/subprojects/inih/tests/unittest.sh --- gamemode-1.6/subprojects/inih/tests/unittest.sh 2020-09-11 18:16:25.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.6/subprojects/inih/tests/unittest_string.c gamemode-1.6.1/subprojects/inih/tests/unittest_string.c --- gamemode-1.6/subprojects/inih/tests/unittest_string.c 2020-09-11 18:16:25.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.6/subprojects/inih/tests/user_error.ini gamemode-1.6.1/subprojects/inih/tests/user_error.ini --- gamemode-1.6/subprojects/inih/tests/user_error.ini 2020-09-11 18:16:25.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.6/subprojects/inih/.travis.yml gamemode-1.6.1/subprojects/inih/.travis.yml --- gamemode-1.6/subprojects/inih/.travis.yml 2020-09-11 18:16:25.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.6/subprojects/inih.wrap gamemode-1.6.1/subprojects/inih.wrap --- gamemode-1.6/subprojects/inih.wrap 2020-09-01 15:21:05.000000000 +0000 +++ gamemode-1.6.1/subprojects/inih.wrap 2021-02-18 19:00:12.000000000 +0000 @@ -1,3 +1,13 @@ -[wrap-git] -url = https://github.com/benhoyt/inih.git -revision = r49 +[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 +