|
@@ -25,21 +25,34 @@
|
|
*/
|
|
*/
|
|
|
|
|
|
#include <Kernel/CommandLine.h>
|
|
#include <Kernel/CommandLine.h>
|
|
|
|
+#include <Kernel/StdLib.h>
|
|
|
|
|
|
namespace Kernel {
|
|
namespace Kernel {
|
|
|
|
|
|
|
|
+static char s_cmd_line[1024];
|
|
static CommandLine* s_the;
|
|
static CommandLine* s_the;
|
|
|
|
|
|
|
|
+void CommandLine::early_initialize(const char* cmd_line)
|
|
|
|
+{
|
|
|
|
+ if (!cmd_line)
|
|
|
|
+ return;
|
|
|
|
+ size_t length = strlen(cmd_line);
|
|
|
|
+ if (length >= sizeof(s_cmd_line))
|
|
|
|
+ length = sizeof(s_cmd_line) -1;
|
|
|
|
+ memcpy(s_cmd_line, cmd_line, length);
|
|
|
|
+ s_cmd_line[length] = '\0';
|
|
|
|
+}
|
|
|
|
+
|
|
const CommandLine& kernel_command_line()
|
|
const CommandLine& kernel_command_line()
|
|
{
|
|
{
|
|
ASSERT(s_the);
|
|
ASSERT(s_the);
|
|
return *s_the;
|
|
return *s_the;
|
|
}
|
|
}
|
|
|
|
|
|
-void CommandLine::initialize(const String& string)
|
|
|
|
|
|
+void CommandLine::initialize()
|
|
{
|
|
{
|
|
ASSERT(!s_the);
|
|
ASSERT(!s_the);
|
|
- s_the = new CommandLine(string);
|
|
|
|
|
|
+ s_the = new CommandLine(s_cmd_line);
|
|
}
|
|
}
|
|
|
|
|
|
CommandLine::CommandLine(const String& string)
|
|
CommandLine::CommandLine(const String& string)
|