util.windows: Convert from Windows line endings
authorMatthew Wild <mwild1@gmail.com>
Mon, 22 Mar 2010 17:16:28 +0000 (17:16 +0000)
committerMatthew Wild <mwild1@gmail.com>
Mon, 22 Mar 2010 17:16:28 +0000 (17:16 +0000)
util-src/windows.c

index 5b1b088a93f27780c94e305b9b0cd145c782419a..12bd7ce9623259a05ddd83bbcc9f66f69f9fe966 100644 (file)
@@ -1,58 +1,58 @@
-/* Prosody IM\r
--- Copyright (C) 2008-2010 Matthew Wild\r
--- Copyright (C) 2008-2010 Waqas Hussain\r
--- \r
--- This project is MIT/X11 licensed. Please see the\r
--- COPYING file in the source package for more information.\r
---\r
-*/\r
-\r
-/*\r
-* windows.c\r
-* Windows support functions for Lua\r
-*/\r
-\r
-#include <stdio.h>\r
-#include <windows.h>\r
-#include <windns.h>\r
-\r
-#include "lua.h"\r
-#include "lauxlib.h"\r
-\r
-static int Lget_nameservers(lua_State *L) {\r
-       char stack_buffer[1024]; // stack allocated buffer\r
-       IP4_ARRAY* ips = (IP4_ARRAY*) stack_buffer;\r
-       DWORD len = sizeof(stack_buffer);\r
-       DNS_STATUS status;\r
-\r
-       status = DnsQueryConfig(DnsConfigDnsServerList, FALSE, NULL, NULL, ips, &len);\r
-       if (status == 0) {\r
-               DWORD i;\r
-               lua_createtable(L, ips->AddrCount, 0);\r
-               for (i = 0; i < ips->AddrCount; i++) {\r
-                       DWORD ip = ips->AddrArray[i];\r
-                       char ip_str[16] = "";\r
-                       sprintf_s(ip_str, sizeof(ip_str), "%d.%d.%d.%d", (ip >> 0) & 255, (ip >> 8) & 255, (ip >> 16) & 255, (ip >> 24) & 255);\r
-                       lua_pushstring(L, ip_str);\r
-                       lua_rawseti(L, -2, i+1);\r
-               }\r
-               return 1;\r
-       } else {\r
-               luaL_error(L, "DnsQueryConfig returned %d", status);\r
-               return 0; // unreachable, but prevents a compiler warning\r
-       }\r
-}\r
-\r
-static const luaL_Reg Reg[] =\r
-{\r
-       { "get_nameservers",    Lget_nameservers        },\r
-       { NULL,         NULL    }\r
-};\r
-\r
-LUALIB_API int luaopen_util_windows(lua_State *L) {\r
-       luaL_register(L, "windows", Reg);\r
-       lua_pushliteral(L, "version");                  /** version */\r
-       lua_pushliteral(L, "-3.14");\r
-       lua_settable(L,-3);\r
-       return 1;\r
-}\r
+/* Prosody IM
+-- Copyright (C) 2008-2010 Matthew Wild
+-- Copyright (C) 2008-2010 Waqas Hussain
+-- 
+-- This project is MIT/X11 licensed. Please see the
+-- COPYING file in the source package for more information.
+--
+*/
+
+/*
+* windows.c
+* Windows support functions for Lua
+*/
+
+#include <stdio.h>
+#include <windows.h>
+#include <windns.h>
+
+#include "lua.h"
+#include "lauxlib.h"
+
+static int Lget_nameservers(lua_State *L) {
+       char stack_buffer[1024]; // stack allocated buffer
+       IP4_ARRAY* ips = (IP4_ARRAY*) stack_buffer;
+       DWORD len = sizeof(stack_buffer);
+       DNS_STATUS status;
+
+       status = DnsQueryConfig(DnsConfigDnsServerList, FALSE, NULL, NULL, ips, &len);
+       if (status == 0) {
+               DWORD i;
+               lua_createtable(L, ips->AddrCount, 0);
+               for (i = 0; i < ips->AddrCount; i++) {
+                       DWORD ip = ips->AddrArray[i];
+                       char ip_str[16] = "";
+                       sprintf_s(ip_str, sizeof(ip_str), "%d.%d.%d.%d", (ip >> 0) & 255, (ip >> 8) & 255, (ip >> 16) & 255, (ip >> 24) & 255);
+                       lua_pushstring(L, ip_str);
+                       lua_rawseti(L, -2, i+1);
+               }
+               return 1;
+       } else {
+               luaL_error(L, "DnsQueryConfig returned %d", status);
+               return 0; // unreachable, but prevents a compiler warning
+       }
+}
+
+static const luaL_Reg Reg[] =
+{
+       { "get_nameservers",    Lget_nameservers        },
+       { NULL,         NULL    }
+};
+
+LUALIB_API int luaopen_util_windows(lua_State *L) {
+       luaL_register(L, "windows", Reg);
+       lua_pushliteral(L, "version");                  /** version */
+       lua_pushliteral(L, "-3.14");
+       lua_settable(L,-3);
+       return 1;
+}