#include <log/log.h>
#include <types/types.h>
#include <talloc/talloc.h>
-#include <array-size/array-size.h>
+#include <util/util.h>
#include "grub2.h"
}
}
+ op = argv[0];
*consumed = 1;
return strlen(op) > 0;
}
return rc ? 0 : 1;
}
+static int builtin_true(struct grub2_script *script __attribute__((unused)),
+ void *data __attribute__((unused)),
+ int argc __attribute__((unused)),
+ char *argv[] __attribute__((unused)))
+{
+ return 0;
+}
+
+static int builtin_false(struct grub2_script *script __attribute__((unused)),
+ void *data __attribute__((unused)),
+ int argc __attribute__((unused)),
+ char *argv[] __attribute__((unused)))
+{
+ return 1;
+}
+
static int builtin_nop(struct grub2_script *script __attribute__((unused)),
void *data __attribute__((unused)),
int argc __attribute__((unused)),
return 0;
}
+extern int builtin_load_env(struct grub2_script *script,
+ void *data __attribute__((unused)),
+ int argc, char *argv[]);
+int builtin_save_env(struct grub2_script *script,
+ void *data __attribute__((unused)),
+ int argc, char *argv[]);
+
+
static struct {
const char *name;
grub2_function fn;
.name = "test",
.fn = builtin_test,
},
+ {
+ .name = "true",
+ .fn = builtin_true,
+ },
+ {
+ .name = "false",
+ .fn = builtin_false,
+ },
+ {
+ .name = "load_env",
+ .fn = builtin_load_env,
+ },
+ {
+ .name = "save_env",
+ .fn = builtin_save_env,
+ },
};
static const char *nops[] = {