summaryrefslogtreecommitdiffstats
path: root/generator/lua.ml
diff options
context:
space:
mode:
Diffstat (limited to 'generator/lua.ml')
-rw-r--r--generator/lua.ml15
1 files changed, 15 insertions, 0 deletions
diff --git a/generator/lua.ml b/generator/lua.ml
index fbb4e93a..2b3e4a57 100644
--- a/generator/lua.ml
+++ b/generator/lua.ml
@@ -729,6 +729,16 @@ push_event (lua_State *L, uint64_t event)
pr " abort (); /* should never happen */
}
+static const char *event_all[] = {
+";
+
+ List.iter (
+ fun (event, _) -> pr " \"%s\",\n" event
+ ) events;
+
+ pr " NULL
+};
+
";
(* Code to push structs. *)
@@ -839,6 +849,11 @@ luaopen_guestfs (lua_State *L)
lua_pushvalue (L, -1);
lua_setfield (L, -1, \"__index\");
+ /* Globals in the Guestfs.* namespace. */
+ lua_pushliteral (L, \"event_all\");
+ push_string_list (L, (char **) event_all);
+ lua_settable (L, -3);
+
/* Add _COPYRIGHT, etc. fields to the metatable. */
lua_pushliteral (L, \"_COPYRIGHT\");
lua_pushliteral (L, \"Copyright (C) %s Red Hat Inc.\");