diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-05-26 02:42:30 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-05-26 02:42:30 -0500 |
commit | 8b00a5779ace2b919f6d9f31fb50d37086a78914 (patch) | |
tree | ae07a14086aead37138c494207515e8e2ee914c4 /hscript/script_i.hh | |
parent | 441543b73cffd6c589e4c848113dd126d984e07f (diff) | |
download | horizon-8b00a5779ace2b919f6d9f31fb50d37086a78914.tar.gz horizon-8b00a5779ace2b919f6d9f31fb50d37086a78914.tar.bz2 horizon-8b00a5779ace2b919f6d9f31fb50d37086a78914.tar.xz horizon-8b00a5779ace2b919f6d9f31fb50d37086a78914.zip |
hscript: Implement (undocumented, untested) 'version' key
Diffstat (limited to 'hscript/script_i.hh')
-rw-r--r-- | hscript/script_i.hh | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/hscript/script_i.hh b/hscript/script_i.hh index 2a86d71..b219579 100644 --- a/hscript/script_i.hh +++ b/hscript/script_i.hh @@ -3,7 +3,7 @@ * libhscript, the HorizonScript library for * Project Horizon * - * Copyright (c) 2019 Adélie Linux and contributors. All rights reserved. + * Copyright (c) 2019-2020 Adélie Linux and contributors. All rights reserved. * This code is licensed under the AGPL 3.0 license, as noted in the * LICENSE-code file in the root directory of this repository. * @@ -61,6 +61,8 @@ struct Script::ScriptPrivate { std::unique_ptr<Keymap> keymap; /*! The system timezone. */ std::unique_ptr<Timezone> tzone; + /*! The version of Adélie to install. */ + std::unique_ptr<Version> version; /*! Network addressing configuration */ std::vector< std::unique_ptr<NetAddress> > addresses; @@ -264,6 +266,17 @@ struct Script::ScriptPrivate { return true; } + bool store_version(Key *obj, const ScriptLocation &pos, int *errors, int *, + const ScriptOptions &) { + if(version) { + DUPLICATE_ERROR(version, "version", version->value()) + return false; + } + std::unique_ptr<Version> v(dynamic_cast<Version *>(obj)); + version = std::move(v); + return true; + } + bool store_username(Key *obj, const ScriptLocation &pos, int *errors, int *, const ScriptOptions &) { if(accounts.size() >= 255) { |