From e6915fb6dd715e39e37702a6d69c220c0f1798bf Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Wed, 31 Jul 2024 17:16:21 -0400 Subject: remove argc, argv; arguments will be passed via environment variables --- kernel/include/hilbert/kernel/application.hpp | 10 ++++++++-- kernel/include/hilbert/kernel/utility.hpp | 7 ++++++- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'kernel/include') diff --git a/kernel/include/hilbert/kernel/application.hpp b/kernel/include/hilbert/kernel/application.hpp index e7c7d2e..9c2e851 100644 --- a/kernel/include/hilbert/kernel/application.hpp +++ b/kernel/include/hilbert/kernel/application.hpp @@ -104,6 +104,7 @@ namespace hilbert::kernel::application { utility::id_allocator open_streams; utility::id_allocator running_socket_listeners; + public: struct string_pair { utility::string a; utility::string b; @@ -111,6 +112,9 @@ namespace hilbert::kernel::application { utility::list environment_variables; + private: + string_pair *find_environment_variable(const utility::string &name); + public: utility::string name; @@ -126,10 +130,12 @@ namespace hilbert::kernel::application { process(app_memory *memory, const utility::string &name); ~process(); - //arguments are utility::move'd - void add_environment_variable( + void set_environment_variable( utility::string &&name, utility::string &&value); + void set_environment_variable( + const utility::string &name, const utility::string &value); + //null if unset utility::string *get_environment_variable(const utility::string &name); diff --git a/kernel/include/hilbert/kernel/utility.hpp b/kernel/include/hilbert/kernel/utility.hpp index b0ced32..3fe14b0 100644 --- a/kernel/include/hilbert/kernel/utility.hpp +++ b/kernel/include/hilbert/kernel/utility.hpp @@ -212,7 +212,12 @@ namespace hilbert::kernel::utility { buffer[i] = other.buffer[i]; } - vector(vector &&other) = delete; + vector(vector &&other) + : buffer(other.buffer), + buffer_len(other.buffer_len), + count(other.count) { + other.buffer = 0; + } ~vector() { if (buffer) -- cgit v1.2.3