Software /
code /
prosody
Comparison
util-src/windows.c @ 6418:ae798314347c
Merge 0.10->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 18 Sep 2014 02:22:48 +0200 |
parent | 6413:a552f4170aed |
child | 6615:8e4572a642cb |
comparison
equal
deleted
inserted
replaced
6410:d782cbb46c2a | 6418:ae798314347c |
---|---|
16 #include <windows.h> | 16 #include <windows.h> |
17 #include <windns.h> | 17 #include <windns.h> |
18 | 18 |
19 #include "lua.h" | 19 #include "lua.h" |
20 #include "lauxlib.h" | 20 #include "lauxlib.h" |
21 | |
22 #if (LUA_VERSION_NUM == 502) | |
23 #define luaL_register(L, N, R) luaL_setfuncs(L, R, 0) | |
24 #endif | |
21 | 25 |
22 static int Lget_nameservers(lua_State *L) { | 26 static int Lget_nameservers(lua_State *L) { |
23 char stack_buffer[1024]; // stack allocated buffer | 27 char stack_buffer[1024]; // stack allocated buffer |
24 IP4_ARRAY* ips = (IP4_ARRAY*) stack_buffer; | 28 IP4_ARRAY* ips = (IP4_ARRAY*) stack_buffer; |
25 DWORD len = sizeof(stack_buffer); | 29 DWORD len = sizeof(stack_buffer); |
79 { "set_consolecolor", Lset_consolecolor }, | 83 { "set_consolecolor", Lset_consolecolor }, |
80 { NULL, NULL } | 84 { NULL, NULL } |
81 }; | 85 }; |
82 | 86 |
83 LUALIB_API int luaopen_util_windows(lua_State *L) { | 87 LUALIB_API int luaopen_util_windows(lua_State *L) { |
84 luaL_register(L, "windows", Reg); | 88 lua_newtable(L); |
85 lua_pushliteral(L, "version"); /** version */ | 89 luaL_register(L, NULL, Reg); |
86 lua_pushliteral(L, "-3.14"); | 90 lua_pushliteral(L, "-3.14"); |
87 lua_settable(L,-3); | 91 lua_setfield(L, -2, "version"); |
88 return 1; | 92 return 1; |
89 } | 93 } |