-#include "device-handler.h"
-
-#define buf_size 1024
-
-struct kboot_context {
- struct discover_context *discover;
-
- char *buf;
-
- struct global_option {
- char *name;
- char *value;
- } *global_options;
- int n_global_options;
-};
-
-static int param_is_ignored(const char *param)
-{
- static const char *ignored_options[] =
- { "message", "timeout", "default", NULL };
- const char **str;
-
- for (str = ignored_options; *str; str++)
- if (streq(*str, param))
- return 1;
- return 0;
-}
-
-/**
- * Splits a name=value pair, with value terminated by @term (or nul). if there
- * is no '=', then only the value is populated, and *name is set to NULL. The
- * string is modified in place.
- *
- * Returns the next byte to process, or null if we've hit the end of the
- * string.
- *
- * */
-static char *get_param_pair(char *str, char **name_out, char **value_out,
- char terminator)
-{
- char *sep, *tmp, *name, *value;
-
- /* terminate the value */
- tmp = strchr(str, terminator);
- if (tmp)
- *tmp = 0;
- else
- tmp = NULL;
-
- sep = strchr(str, '=');
- if (!sep) {
- *name_out = NULL;
- *value_out = str;
- return tmp ? tmp + 1 : NULL;
- }
-
- /* terminate the name */
- *sep = 0;
-
- /* remove leading spaces */
- for (name = str; isspace(*name); name++);
- for (value = sep + 1; isspace(*value); value++);
-
- /* .. and trailing ones.. */
- for (sep--; isspace(*sep); sep--)
- *sep = 0;
- for (sep = value + strlen(value) - 1; isspace(*sep); sep--)
- *sep = 0;
-
- *name_out = name;
- *value_out = value;
-
- return tmp ? tmp + 1 : NULL;
-}
-
-static struct global_option global_options[] = {
- { .name = "root" },
- { .name = "initrd" },
- { .name = "video" },
- { .name = NULL }
-};