- kdevelop3 project files
[lightOS.git] / kernel / cmdline.cpp
blob0b0b3df38e0e90d6ac6bc1fe182fbb43bb25a734
1 /*
2 lightOS kernel
3 Copyright (C) 2009 Jörg Pfähler
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 #include <kernel/cmdline.hpp>
20 #include <kernel/log.hpp>
22 static const char* skip_param(const char* cmdline)
24 // Skip a parameter
25 while (*cmdline != '\0' && *cmdline != ' ')
26 ++cmdline;
27 while (*cmdline != '\0' && *cmdline == ' ')
28 ++cmdline;
29 return cmdline;
32 void kernel::parse_cmdline(const char* cmdline,
33 bool (*arch_callback)(const char*))
35 // Skip the kernel name
36 cmdline = skip_param(cmdline);
38 while (*cmdline != '\0')
40 if (!arch_callback(cmdline) &&
41 !kernel::cmdline_args(cmdline))
43 // Unknown command line option
44 FATAL("Unkown commandline option \"" << cmdline << "\".");
47 // Skip the processed parameter
48 cmdline = skip_param(cmdline);
52 bool kernel::cmdline_args(const char* arg)
54 // NOTE: architecture independant arguments here
55 return false;