Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys lua(4): using lua_CFunction
details: https://anonhg.NetBSD.org/src/rev/b1d752d72dab
branches: trunk
changeset: 330728:b1d752d72dab
user: lneto <lneto%NetBSD.org@localhost>
date: Sat Jul 19 17:14:40 2014 +0000
description:
lua(4): using lua_CFunction
diffstat:
sys/modules/lua/lua.c | 4 ++--
sys/modules/lua/luavar.h | 6 ++++--
sys/modules/luapmf/luapmf.c | 5 ++---
sys/modules/luasystm/luasystm.c | 5 ++---
sys/sys/lua.h | 4 ++--
5 files changed, 12 insertions(+), 12 deletions(-)
diffs (98 lines):
diff -r c51b4f1f6be3 -r b1d752d72dab sys/modules/lua/lua.c
--- a/sys/modules/lua/lua.c Sat Jul 19 17:13:22 2014 +0000
+++ b/sys/modules/lua/lua.c Sat Jul 19 17:14:40 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lua.c,v 1.9 2014/07/19 17:13:22 lneto Exp $ */
+/* $NetBSD: lua.c,v 1.10 2014/07/19 17:14:40 lneto Exp $ */
/*
* Copyright (c) 2014 by Lourival Vieira Neto <lneto%NetBSD.org@localhost>.
@@ -588,7 +588,7 @@
}
int
-lua_mod_register(const char *name, int (*open)(void *))
+lua_mod_register(const char *name, lua_CFunction open)
{
struct lua_module *m;
diff -r c51b4f1f6be3 -r b1d752d72dab sys/modules/lua/luavar.h
--- a/sys/modules/lua/luavar.h Sat Jul 19 17:13:22 2014 +0000
+++ b/sys/modules/lua/luavar.h Sat Jul 19 17:14:40 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: luavar.h,v 1.1 2013/10/16 19:44:57 mbalmer Exp $ */
+/* $NetBSD: luavar.h,v 1.2 2014/07/19 17:14:40 lneto Exp $ */
/*
* Copyright (c) 2011, Marc Balmer <mbalmer%NetBSD.org@localhost>.
@@ -31,9 +31,11 @@
#ifndef _LUA_VAR_
#define _LUA_VAR_
+#include <lua.h>
+
struct lua_module {
char mod_name[LUA_MAX_MODNAME];
- int (*open)(void *);
+ lua_CFunction open;
int refcount;
LIST_ENTRY(lua_module) mod_next;
};
diff -r c51b4f1f6be3 -r b1d752d72dab sys/modules/luapmf/luapmf.c
--- a/sys/modules/luapmf/luapmf.c Sat Jul 19 17:13:22 2014 +0000
+++ b/sys/modules/luapmf/luapmf.c Sat Jul 19 17:14:40 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: luapmf.c,v 1.3 2013/12/16 23:35:48 lneto Exp $ */
+/* $NetBSD: luapmf.c,v 1.4 2014/07/19 17:14:40 lneto Exp $ */
/*
* Copyright (c) 2011, 2013 Marc Balmer <mbalmer%NetBSD.org@localhost>.
@@ -82,9 +82,8 @@
}
static int
-luaopen_pmf(void *ls)
+luaopen_pmf(lua_State *L)
{
- lua_State *L = (lua_State *)ls;
const luaL_Reg pmf_lib[ ] = {
{ "system_shutdown", system_shutdown },
{ "set_platform", set_platform },
diff -r c51b4f1f6be3 -r b1d752d72dab sys/modules/luasystm/luasystm.c
--- a/sys/modules/luasystm/luasystm.c Sat Jul 19 17:13:22 2014 +0000
+++ b/sys/modules/luasystm/luasystm.c Sat Jul 19 17:14:40 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: luasystm.c,v 1.2 2014/03/24 20:21:02 christos Exp $ */
+/* $NetBSD: luasystm.c,v 1.3 2014/07/19 17:14:40 lneto Exp $ */
/*
* Copyright (c) 2011, 2013 Marc Balmer <mbalmer%NetBSD.org@localhost>.
@@ -159,9 +159,8 @@
/* mutexes */
static int
-luaopen_systm(void *ls)
+luaopen_systm(lua_State *L)
{
- lua_State *L = (lua_State *)ls;
const luaL_Reg systm_lib[ ] = {
{ "print", print },
{ "print_nolog", print_nolog },
diff -r c51b4f1f6be3 -r b1d752d72dab sys/sys/lua.h
--- a/sys/sys/lua.h Sat Jul 19 17:13:22 2014 +0000
+++ b/sys/sys/lua.h Sat Jul 19 17:14:40 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lua.h,v 1.4 2014/07/19 17:13:22 lneto Exp $ */
+/* $NetBSD: lua.h,v 1.5 2014/07/19 17:14:40 lneto Exp $ */
/*
* Copyright (c) 2014 by Lourival Vieira Neto <lneto%NetBSD.org@localhost>.
@@ -80,7 +80,7 @@
#define LUALOAD _IOWR('l', 4, struct lua_load)
#ifdef _KERNEL
-extern int lua_mod_register(const char *, int (*)(void *));
+extern int lua_mod_register(const char *, lua_CFunction);
extern int lua_mod_unregister(const char *);
typedef struct _klua_State {
Home |
Main Index |
Thread Index |
Old Index