summaryrefslogtreecommitdiff
path: root/sys/modules/lua/luavar.h
diff options
context:
space:
mode:
authormbalmer <mbalmer@NetBSD.org>2013-10-16 19:44:57 +0000
committermbalmer <mbalmer@NetBSD.org>2013-10-16 19:44:57 +0000
commite0fe45ce9c35c204a7c19d5a5291ca64b47b2452 (patch)
treee871dc37f16f51aff76180bb26119b0ced6630a4 /sys/modules/lua/luavar.h
parenta1bd524499a4e93e3f6f934dc1e6f644595e0a89 (diff)
welcome lua(4), a devide driver that can create and control Lua states inside the kernel
Diffstat (limited to 'sys/modules/lua/luavar.h')
-rw-r--r--sys/modules/lua/luavar.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/sys/modules/lua/luavar.h b/sys/modules/lua/luavar.h
new file mode 100644
index 00000000000..a63500b6e41
--- /dev/null
+++ b/sys/modules/lua/luavar.h
@@ -0,0 +1,49 @@
+/* $NetBSD: luavar.h,v 1.1 2013/10/16 19:44:57 mbalmer Exp $ */
+
+/*
+ * Copyright (c) 2011, Marc Balmer <mbalmer@NetBSD.org>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the Author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _LUA_VAR_
+#define _LUA_VAR_
+
+struct lua_module {
+ char mod_name[LUA_MAX_MODNAME];
+ int (*open)(void *);
+ int refcount;
+ LIST_ENTRY(lua_module) mod_next;
+};
+
+struct lua_state {
+ char lua_name[MAX_LUA_NAME];
+ char lua_desc[MAX_LUA_DESC];
+ klua_State *K;
+ LIST_HEAD(, lua_module) lua_modules;
+ LIST_ENTRY(lua_state) lua_next;
+};
+
+#endif /* _LUA_VAR_ */