+static int lua_sethost(lua_State *ps) {
+ char *ident, *host;
+ nick *np;
+
+ if(!lua_islong(ps, 1) || !lua_isstring(ps, 2) || !lua_isstring(ps, 3))
+ LUA_RETURN(ps, LUA_FAIL);
+
+ np = getnickbynumeric(lua_tolong(ps, 1));
+ if(!np)
+ LUA_RETURN(ps, LUA_FAIL);
+
+ ident = (char *)lua_tostring(ps, 2);
+ host = (char *)lua_tostring(ps, 3);
+ if(!lua_lineok(ident) || !lua_lineok(host))
+ LUA_RETURN(ps, LUA_FAIL);
+
+ sethostuser(np, ident, host);
+
+ LUA_RETURN(ps, LUA_OK);
+}
+
+static int lua_getvisiblehostmask(lua_State *l) {
+ nick *np;
+ char buf[HOSTLEN+USERLEN+NICKLEN+REALLEN+10];
+
+ if(!lua_islong(l, 1))
+ return 0;
+
+ np = getnickbynumeric(lua_tolong(l, 1));
+ if(!np)
+ return 0;
+
+ lua_pushstring(l, visiblehostmask(np, buf));
+ return 1;
+}
+