diff options
author | Benji Dial <benji@benjidial.net> | 2024-07-31 17:16:21 -0400 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2024-07-31 17:16:21 -0400 |
commit | e6915fb6dd715e39e37702a6d69c220c0f1798bf (patch) | |
tree | 2e3b59335f70f2725802d254168ceaee85faf891 /kernel/include | |
parent | b1cf9e5dfbc8967bd7cb2a22ec1e5e521f4e0e6e (diff) | |
download | hilbert-os-e6915fb6dd715e39e37702a6d69c220c0f1798bf.tar.gz |
remove argc, argv; arguments will be passed via environment variables
Diffstat (limited to 'kernel/include')
-rw-r--r-- | kernel/include/hilbert/kernel/application.hpp | 10 | ||||
-rw-r--r-- | kernel/include/hilbert/kernel/utility.hpp | 7 |
2 files changed, 14 insertions, 3 deletions
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<generic_stream_ptr> open_streams; utility::id_allocator<socket_listener *> running_socket_listeners; + public: struct string_pair { utility::string a; utility::string b; @@ -111,6 +112,9 @@ namespace hilbert::kernel::application { utility::list<string_pair> 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) |