mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-07-18 14:59:51 +02:00
Compare commits
6 Commits
master
...
5e75547fcd
Author | SHA1 | Date | |
---|---|---|---|
5e75547fcd | |||
c44d18bfb7 | |||
6bd096d90b | |||
02d062d965 | |||
fe2c59b53a | |||
5dd6a2cb14 |
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
@ -13,7 +13,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty" ]
|
luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty" ]
|
||||||
platform: [ "ubuntu-22.04", "macos-14", "windows-2022" ]
|
platform: [ "ubuntu-22.04", "macos-11", "windows-2022" ]
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -22,13 +22,11 @@ jobs:
|
|||||||
if: ${{ startsWith(matrix.platform, 'windows') && !startsWith(matrix.luaVersion, 'luajit') }}
|
if: ${{ startsWith(matrix.platform, 'windows') && !startsWith(matrix.luaVersion, 'luajit') }}
|
||||||
uses: ilammy/msvc-dev-cmd@v1
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
- name: Setup ‘lua’
|
- name: Setup ‘lua’
|
||||||
uses: luarocks/gh-actions-lua@v10
|
uses: leso-kn/gh-actions-lua@v11-staging
|
||||||
with:
|
with:
|
||||||
luaVersion: ${{ matrix.luaVersion }}
|
luaVersion: ${{ matrix.luaVersion }}
|
||||||
buildCache: false
|
|
||||||
- name: Setup ‘luarocks’
|
- name: Setup ‘luarocks’
|
||||||
# master branch until tagged release has luajit & msvcrt fixes
|
uses: hishamhm/gh-actions-luarocks@master
|
||||||
uses: luarocks/gh-actions-luarocks@master
|
|
||||||
- name: Make and install
|
- name: Make and install
|
||||||
run: |
|
run: |
|
||||||
luarocks make -- luasocket-scm-3.rockspec
|
luarocks make -- luasocket-scm-3.rockspec
|
||||||
|
@ -37,30 +37,70 @@ Installation">
|
|||||||
|
|
||||||
<!-- installation ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
<!-- installation ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
||||||
|
|
||||||
<h2>Installation via luarocks</h2>
|
<h2>Installation</h2>
|
||||||
|
|
||||||
|
<p> Here we describe the standard distribution. If the
|
||||||
|
standard doesn't meet your needs, we refer you to the Lua
|
||||||
|
discussion list, where any question about the package scheme
|
||||||
|
will likely already have been answered. </p>
|
||||||
|
|
||||||
|
<h3>Directory structure</h3>
|
||||||
|
|
||||||
<p>LuaSocket can be easily installed using <a href="https://luarocks.org/" target="_blank">LuaRocks</a>, the Lua package manager.</p>
|
<p> On Unix systems, the standard distribution uses two base
|
||||||
|
directories, one for system dependent files, and another for system
|
||||||
|
independent files. Let's call these directories <tt><CDIR></tt>
|
||||||
|
and <tt><LDIR></tt>, respectively.
|
||||||
|
For example, in my laptp, Lua 5.1 is configured to
|
||||||
|
use '<tt>/usr/local/lib/lua/5.1</tt>' for
|
||||||
|
<tt><CDIR></tt> and '<tt>/usr/local/share/lua/5.1</tt>' for
|
||||||
|
<tt><LDIR></tt>. On Windows, <tt><CDIR></tt>
|
||||||
|
usually points to the directory where the Lua executable is
|
||||||
|
found, and <tt><LDIR></tt> points to a
|
||||||
|
<tt>lua/</tt> directory inside <tt><CDIR></tt>. (These
|
||||||
|
settings can be overridden by environment variables
|
||||||
|
<tt>LUA_PATH</tt> and <tt>LUA_CPATH</tt>. See the Lua
|
||||||
|
documentation for details.) Here is the standard LuaSocket
|
||||||
|
distribution directory structure:</p>
|
||||||
|
|
||||||
<h3>Installing via LuaRocks</h3>
|
|
||||||
|
|
||||||
<p>Run the following command in your terminal:</p>
|
|
||||||
<pre class=example>
|
<pre class=example>
|
||||||
luarocks install luasocket
|
<LDIR>/ltn12.lua
|
||||||
|
<LDIR>/socket.lua
|
||||||
|
<CDIR>/socket/core.dll
|
||||||
|
<LDIR>/socket/http.lua
|
||||||
|
<LDIR>/socket/tp.lua
|
||||||
|
<LDIR>/socket/ftp.lua
|
||||||
|
<LDIR>/socket/smtp.lua
|
||||||
|
<LDIR>/socket/url.lua
|
||||||
|
<LDIR>/mime.lua
|
||||||
|
<CDIR>/mime/core.dll
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Verification</h3>
|
<p> Naturally, on Unix systems, <tt>core.dll</tt>
|
||||||
<p>To verify that LuaSocket is installed correctly, open Lua and run:</p>
|
would be replaced by <tt>core.so</tt>.
|
||||||
<pre class=example><code>
|
</p>
|
||||||
local socket = require("socket")
|
|
||||||
print(socket._VERSION)
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>If you see output like <strong>LuaSocket 3.0</strong>, the installation was successful.</p>
|
<h3>Using LuaSocket</h3>
|
||||||
|
|
||||||
<h3>More Information</h3>
|
<p> With the above setup, and an interpreter with shared library support,
|
||||||
<p>For more details, visit the <a href="https://github.com/lunarmodules/luasocket" target="_blank">LuaSocket GitHub repository</a>.</p>
|
it should be easy to use LuaSocket. Just fire the interpreter and use the
|
||||||
|
<tt>require</tt> function to gain access to whatever module you need:</p>
|
||||||
|
|
||||||
|
<pre class=example>
|
||||||
|
Lua 5.2.2 Copyright (C) 1994-2013 Lua.org, PUC-Rio
|
||||||
|
> socket = require("socket")
|
||||||
|
> print(socket._VERSION)
|
||||||
|
--> LuaSocket 3.1.0
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<p> Each module loads their dependencies automatically, so you only need to
|
||||||
|
load the modules you directly depend upon: </p>
|
||||||
|
|
||||||
|
<pre class=example>
|
||||||
|
Lua 5.2.2 Copyright (C) 1994-2013 Lua.org, PUC-Rio
|
||||||
|
> http = require("socket.http")
|
||||||
|
> print(http.request("http://www.impa.br/~diego/software/luasocket"))
|
||||||
|
--> homepage gets dumped to terminal
|
||||||
|
</pre>
|
||||||
|
|
||||||
<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
||||||
|
|
||||||
|
@ -149,8 +149,8 @@ wild-card address).
|
|||||||
<!-- gettimeout +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
<!-- gettimeout +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
||||||
|
|
||||||
<p class="name" id="gettimeout">
|
<p class="name" id="gettimeout">
|
||||||
connected:<b>gettimeout()</b><br>
|
connected:<b>settimeout(</b>value<b>)</b><br>
|
||||||
unconnected:<b>gettimeout()</b>
|
unconnected:<b>settimeout(</b>value<b>)</b>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p class="description">
|
<p class="description">
|
||||||
|
@ -56,6 +56,20 @@ local function make_plat(plat)
|
|||||||
defines = defines[plat],
|
defines = defines[plat],
|
||||||
incdir = "/src"
|
incdir = "/src"
|
||||||
},
|
},
|
||||||
|
["socket.unix"] = {
|
||||||
|
sources = {
|
||||||
|
"src/buffer.c"
|
||||||
|
, "src/compat.c"
|
||||||
|
, "src/auxiliar.c"
|
||||||
|
, "src/options.c"
|
||||||
|
, "src/timeout.c"
|
||||||
|
, "src/io.c"
|
||||||
|
, "src/unix.c"
|
||||||
|
, "src/unixdgram.c"
|
||||||
|
, "src/unixstream.c" },
|
||||||
|
defines = defines[plat],
|
||||||
|
incdir = "/src"
|
||||||
|
},
|
||||||
["mime.core"] = {
|
["mime.core"] = {
|
||||||
sources = { "src/mime.c", "src/compat.c" },
|
sources = { "src/mime.c", "src/compat.c" },
|
||||||
defines = defines[plat],
|
defines = defines[plat],
|
||||||
@ -77,24 +91,10 @@ local function make_plat(plat)
|
|||||||
or plat == "haiku"
|
or plat == "haiku"
|
||||||
then
|
then
|
||||||
modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/usocket.c"
|
modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/usocket.c"
|
||||||
|
modules["socket.unix"].sources[#modules["socket.unix"].sources+1] = "src/usocket.c"
|
||||||
if plat == "haiku" then
|
if plat == "haiku" then
|
||||||
modules["socket.core"].libraries = {"network"}
|
modules["socket.core"].libraries = {"network"}
|
||||||
end
|
end
|
||||||
modules["socket.unix"] = {
|
|
||||||
sources = {
|
|
||||||
"src/buffer.c"
|
|
||||||
, "src/compat.c"
|
|
||||||
, "src/auxiliar.c"
|
|
||||||
, "src/options.c"
|
|
||||||
, "src/timeout.c"
|
|
||||||
, "src/io.c"
|
|
||||||
, "src/usocket.c"
|
|
||||||
, "src/unix.c"
|
|
||||||
, "src/unixdgram.c"
|
|
||||||
, "src/unixstream.c" },
|
|
||||||
defines = defines[plat],
|
|
||||||
incdir = "/src"
|
|
||||||
}
|
|
||||||
modules["socket.serial"] = {
|
modules["socket.serial"] = {
|
||||||
sources = {
|
sources = {
|
||||||
"src/buffer.c"
|
"src/buffer.c"
|
||||||
@ -115,6 +115,10 @@ local function make_plat(plat)
|
|||||||
modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/wsocket.c"
|
modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/wsocket.c"
|
||||||
modules["socket.core"].libraries = { "ws2_32" }
|
modules["socket.core"].libraries = { "ws2_32" }
|
||||||
modules["socket.core"].libdirs = {}
|
modules["socket.core"].libdirs = {}
|
||||||
|
modules["socket.unix"].sources[#modules["socket.unix"].sources+1] = "src/wsocket.c"
|
||||||
|
modules["socket.unix"].sources[#modules["socket.unix"].sources+1] = "src/inet.c"
|
||||||
|
modules["socket.unix"].libraries = { "ws2_32" }
|
||||||
|
modules["socket.unix"].libdirs = {}
|
||||||
end
|
end
|
||||||
return { modules = modules }
|
return { modules = modules }
|
||||||
end
|
end
|
||||||
|
@ -4,6 +4,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "socket", "socket.vcxproj",
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime", "mime.vcxproj", "{128E8BD0-174A-48F0-8771-92B1E8D18713}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime", "mime.vcxproj", "{128E8BD0-174A-48F0-8771-92B1E8D18713}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unix", "unix.vcxproj", "{1390FB7F-6D39-4F0A-BBC0-0EAC022D827A}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Win32 = Debug|Win32
|
Debug|Win32 = Debug|Win32
|
||||||
@ -28,6 +30,14 @@ Global
|
|||||||
{128E8BD0-174A-48F0-8771-92B1E8D18713}.Release|Win32.Build.0 = Release|Win32
|
{128E8BD0-174A-48F0-8771-92B1E8D18713}.Release|Win32.Build.0 = Release|Win32
|
||||||
{128E8BD0-174A-48F0-8771-92B1E8D18713}.Release|x64.ActiveCfg = Release|x64
|
{128E8BD0-174A-48F0-8771-92B1E8D18713}.Release|x64.ActiveCfg = Release|x64
|
||||||
{128E8BD0-174A-48F0-8771-92B1E8D18713}.Release|x64.Build.0 = Release|x64
|
{128E8BD0-174A-48F0-8771-92B1E8D18713}.Release|x64.Build.0 = Release|x64
|
||||||
|
{1390FB7F-6D39-4F0A-BBC0-0EAC022D827A}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
|
{1390FB7F-6D39-4F0A-BBC0-0EAC022D827A}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
|
{1390FB7F-6D39-4F0A-BBC0-0EAC022D827A}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{1390FB7F-6D39-4F0A-BBC0-0EAC022D827A}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{1390FB7F-6D39-4F0A-BBC0-0EAC022D827A}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
|
{1390FB7F-6D39-4F0A-BBC0-0EAC022D827A}.Release|Win32.Build.0 = Release|Win32
|
||||||
|
{1390FB7F-6D39-4F0A-BBC0-0EAC022D827A}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{1390FB7F-6D39-4F0A-BBC0-0EAC022D827A}.Release|x64.Build.0 = Release|x64
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
2
makefile
Normal file → Executable file
2
makefile
Normal file → Executable file
@ -10,7 +10,7 @@
|
|||||||
# print print the build settings
|
# print print the build settings
|
||||||
|
|
||||||
PLAT?= linux
|
PLAT?= linux
|
||||||
PLATS= macosx linux win32 win64 mingw freebsd solaris ucrt64
|
PLATS= macosx linux win32 win64 mingw freebsd solaris
|
||||||
|
|
||||||
all: $(PLAT)
|
all: $(PLAT)
|
||||||
|
|
||||||
|
0
mime.vcxproj
Normal file → Executable file
0
mime.vcxproj
Normal file → Executable file
0
socket.vcxproj
Normal file → Executable file
0
socket.vcxproj
Normal file → Executable file
0
src/inet.c
Normal file → Executable file
0
src/inet.c
Normal file → Executable file
0
src/luasocket.c
Normal file → Executable file
0
src/luasocket.c
Normal file → Executable file
36
src/makefile
Normal file → Executable file
36
src/makefile
Normal file → Executable file
@ -74,13 +74,6 @@ LUAPREFIX_mingw?=/usr
|
|||||||
CDIR_mingw?=lua/$(LUAV)
|
CDIR_mingw?=lua/$(LUAV)
|
||||||
LDIR_mingw?=lua/$(LUAV)/lua
|
LDIR_mingw?=lua/$(LUAV)/lua
|
||||||
|
|
||||||
# where lua headers are found for ucrt64 builds
|
|
||||||
# LUAINC_ucrt64:
|
|
||||||
LUAINC_ucrt64?=/ucrt64/include
|
|
||||||
LUALIB_ucrt64?=/ucrt64/bin/lua$(subst .,,$(LUAV)).dll
|
|
||||||
LUAPREFIX_ucrt64?=/ucrt64
|
|
||||||
CDIR_ucrt64?=lib/lua/$(LUAV)
|
|
||||||
LDIR_ucrt64?=share/lua/$(LUAV)
|
|
||||||
|
|
||||||
# LUAINC_win32:
|
# LUAINC_win32:
|
||||||
# LUALIB_win32:
|
# LUALIB_win32:
|
||||||
@ -160,7 +153,7 @@ print:
|
|||||||
#------
|
#------
|
||||||
# Supported platforms
|
# Supported platforms
|
||||||
#
|
#
|
||||||
PLATS= macosx linux win32 win64 mingw solaris ucrt64
|
PLATS= macosx linux win32 win64 mingw solaris
|
||||||
|
|
||||||
#------
|
#------
|
||||||
# Compiler and linker settings
|
# Compiler and linker settings
|
||||||
@ -226,21 +219,6 @@ LDFLAGS_mingw= $(LUALIB) -shared -Wl,-s -lws2_32 -o
|
|||||||
LD_mingw=gcc
|
LD_mingw=gcc
|
||||||
SOCKET_mingw=wsocket.o
|
SOCKET_mingw=wsocket.o
|
||||||
|
|
||||||
#------
|
|
||||||
# Compiler and linker settings
|
|
||||||
# for ucrt64
|
|
||||||
SO_ucrt64=dll
|
|
||||||
O_ucrt64=o
|
|
||||||
CC_ucrt64=gcc
|
|
||||||
DEF_ucrt64= -DLUASOCKET_$(DEBUG) \
|
|
||||||
-DWINVER=0x0501
|
|
||||||
CFLAGS_ucrt64= -I$(LUAINC) $(DEF) -Wall -O2 -fno-common
|
|
||||||
# \
|
|
||||||
-fvisibility=hidden
|
|
||||||
LDFLAGS_ucrt64= $(LUALIB) -shared -Wl,-s -lws2_32 -o
|
|
||||||
LD_ucrt64=gcc
|
|
||||||
SOCKET_ucrt64=wsocket.o
|
|
||||||
|
|
||||||
|
|
||||||
#------
|
#------
|
||||||
# Compiler and linker settings
|
# Compiler and linker settings
|
||||||
@ -346,8 +324,9 @@ UNIX_OBJS=\
|
|||||||
auxiliar.$(O) \
|
auxiliar.$(O) \
|
||||||
options.$(O) \
|
options.$(O) \
|
||||||
timeout.$(O) \
|
timeout.$(O) \
|
||||||
|
inet.$(O) \
|
||||||
io.$(O) \
|
io.$(O) \
|
||||||
usocket.$(O) \
|
$(SOCKET) \
|
||||||
unixstream.$(O) \
|
unixstream.$(O) \
|
||||||
unixdgram.$(O) \
|
unixdgram.$(O) \
|
||||||
compat.$(O) \
|
compat.$(O) \
|
||||||
@ -406,9 +385,6 @@ linux:
|
|||||||
mingw:
|
mingw:
|
||||||
$(MAKE) all PLAT=mingw
|
$(MAKE) all PLAT=mingw
|
||||||
|
|
||||||
ucrt64:
|
|
||||||
$(MAKE) all PLAT=ucrt64
|
|
||||||
|
|
||||||
solaris:
|
solaris:
|
||||||
$(MAKE) all-unix PLAT=solaris
|
$(MAKE) all-unix PLAT=solaris
|
||||||
|
|
||||||
@ -418,7 +394,7 @@ none:
|
|||||||
@echo "where PLATFORM is one of these:"
|
@echo "where PLATFORM is one of these:"
|
||||||
@echo " $(PLATS)"
|
@echo " $(PLATS)"
|
||||||
|
|
||||||
all: $(SOCKET_SO) $(MIME_SO)
|
all: $(SOCKET_SO) $(MIME_SO) $(UNIX_SO)
|
||||||
|
|
||||||
$(SOCKET_SO): $(SOCKET_OBJS)
|
$(SOCKET_SO): $(SOCKET_OBJS)
|
||||||
$(LD) $(SOCKET_OBJS) $(LDFLAGS)$@
|
$(LD) $(SOCKET_OBJS) $(LDFLAGS)$@
|
||||||
@ -426,11 +402,11 @@ $(SOCKET_SO): $(SOCKET_OBJS)
|
|||||||
$(MIME_SO): $(MIME_OBJS)
|
$(MIME_SO): $(MIME_OBJS)
|
||||||
$(LD) $(MIME_OBJS) $(LDFLAGS)$@
|
$(LD) $(MIME_OBJS) $(LDFLAGS)$@
|
||||||
|
|
||||||
all-unix: all $(UNIX_SO) $(SERIAL_SO)
|
|
||||||
|
|
||||||
$(UNIX_SO): $(UNIX_OBJS)
|
$(UNIX_SO): $(UNIX_OBJS)
|
||||||
$(LD) $(UNIX_OBJS) $(LDFLAGS)$@
|
$(LD) $(UNIX_OBJS) $(LDFLAGS)$@
|
||||||
|
|
||||||
|
all-unix: all $(SERIAL_SO)
|
||||||
|
|
||||||
$(SERIAL_SO): $(SERIAL_OBJS)
|
$(SERIAL_SO): $(SERIAL_OBJS)
|
||||||
$(LD) $(SERIAL_OBJS) $(LDFLAGS)$@
|
$(LD) $(SERIAL_OBJS) $(LDFLAGS)$@
|
||||||
|
|
||||||
|
0
src/mime.c
Normal file → Executable file
0
src/mime.c
Normal file → Executable file
0
src/socket.h
Normal file → Executable file
0
src/socket.h
Normal file → Executable file
26
src/unixdef.h
Normal file
26
src/unixdef.h
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#ifndef UNIXDEF_H
|
||||||
|
#define UNIXDEF_H
|
||||||
|
/*=========================================================================*\
|
||||||
|
* Unix domain defines
|
||||||
|
* LuaSocket toolkit
|
||||||
|
*
|
||||||
|
* Provides sockaddr_un on Windows and Unix.
|
||||||
|
\*=========================================================================*/
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
/* Technically it's possible to include <afunix.h> but it's only available
|
||||||
|
on Windows SDK 17134 (Windows 10 1803). */
|
||||||
|
#ifndef AF_UNIX
|
||||||
|
#define AF_UNIX 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct sockaddr_un
|
||||||
|
{
|
||||||
|
unsigned short sun_family;
|
||||||
|
char sun_path[108];
|
||||||
|
};
|
||||||
|
#else
|
||||||
|
#include <sys/un.h>
|
||||||
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
|
#endif /* UNIXDEF_H */
|
@ -8,14 +8,20 @@
|
|||||||
#include "socket.h"
|
#include "socket.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
#include "unix.h"
|
#include "unix.h"
|
||||||
|
#include "unixdef.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <sys/un.h>
|
|
||||||
|
|
||||||
#define UNIXDGRAM_DATAGRAMSIZE 8192
|
#define UNIXDGRAM_DATAGRAMSIZE 8192
|
||||||
|
|
||||||
|
/* provide a SUN_LEN macro if sys/un.h doesn't (e.g. Android) */
|
||||||
|
#ifndef SUN_LEN
|
||||||
|
#define SUN_LEN(ptr) \
|
||||||
|
((size_t) (((struct sockaddr_un *) 0)->sun_path) \
|
||||||
|
+ strlen ((ptr)->sun_path))
|
||||||
|
#endif
|
||||||
|
|
||||||
/*=========================================================================*\
|
/*=========================================================================*\
|
||||||
* Internal function prototypes
|
* Internal function prototypes
|
||||||
\*=========================================================================*/
|
\*=========================================================================*/
|
||||||
@ -35,8 +41,8 @@ static int meth_receivefrom(lua_State *L);
|
|||||||
static int meth_sendto(lua_State *L);
|
static int meth_sendto(lua_State *L);
|
||||||
static int meth_getsockname(lua_State *L);
|
static int meth_getsockname(lua_State *L);
|
||||||
|
|
||||||
static const char *unixdgram_tryconnect(p_unix un, const char *path, size_t len);
|
static const char *unixdgram_tryconnect(p_unix un, const char *path);
|
||||||
static const char *unixdgram_trybind(p_unix un, const char *path, size_t len);
|
static const char *unixdgram_trybind(p_unix un, const char *path);
|
||||||
|
|
||||||
/* unixdgram object methods */
|
/* unixdgram object methods */
|
||||||
static luaL_Reg unixdgram_methods[] = {
|
static luaL_Reg unixdgram_methods[] = {
|
||||||
@ -126,12 +132,13 @@ static int meth_send(lua_State *L)
|
|||||||
static int meth_sendto(lua_State *L)
|
static int meth_sendto(lua_State *L)
|
||||||
{
|
{
|
||||||
p_unix un = (p_unix) auxiliar_checkclass(L, "unixdgram{unconnected}", 1);
|
p_unix un = (p_unix) auxiliar_checkclass(L, "unixdgram{unconnected}", 1);
|
||||||
size_t count, sent, len = 0;
|
size_t count, sent = 0;
|
||||||
const char *data = luaL_checklstring(L, 2, &count);
|
const char *data = luaL_checklstring(L, 2, &count);
|
||||||
const char *path = luaL_checklstring(L, 3, &len);
|
const char *path = luaL_checkstring(L, 3);
|
||||||
p_timeout tm = &un->tm;
|
p_timeout tm = &un->tm;
|
||||||
int err;
|
int err;
|
||||||
struct sockaddr_un remote;
|
struct sockaddr_un remote;
|
||||||
|
size_t len = strlen(path);
|
||||||
|
|
||||||
if (len >= sizeof(remote.sun_path)) {
|
if (len >= sizeof(remote.sun_path)) {
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
@ -140,7 +147,7 @@ static int meth_sendto(lua_State *L)
|
|||||||
}
|
}
|
||||||
|
|
||||||
memset(&remote, 0, sizeof(remote));
|
memset(&remote, 0, sizeof(remote));
|
||||||
memcpy(remote.sun_path, path, len);
|
strcpy(remote.sun_path, path);
|
||||||
remote.sun_family = AF_UNIX;
|
remote.sun_family = AF_UNIX;
|
||||||
timeout_markstart(tm);
|
timeout_markstart(tm);
|
||||||
#ifdef UNIX_HAS_SUN_LEN
|
#ifdef UNIX_HAS_SUN_LEN
|
||||||
@ -256,22 +263,18 @@ static int meth_dirty(lua_State *L) {
|
|||||||
/*-------------------------------------------------------------------------*\
|
/*-------------------------------------------------------------------------*\
|
||||||
* Binds an object to an address
|
* Binds an object to an address
|
||||||
\*-------------------------------------------------------------------------*/
|
\*-------------------------------------------------------------------------*/
|
||||||
static const char *unixdgram_trybind(p_unix un, const char *path, size_t len) {
|
static const char *unixdgram_trybind(p_unix un, const char *path) {
|
||||||
struct sockaddr_un local;
|
struct sockaddr_un local;
|
||||||
int err;
|
size_t len = strlen(path);
|
||||||
if (len >= sizeof(local.sun_path)) return "path too long";
|
if (len >= sizeof(local.sun_path)) return "path too long";
|
||||||
memset(&local, 0, sizeof(local));
|
memset(&local, 0, sizeof(local));
|
||||||
memcpy(local.sun_path, path, len);
|
strcpy(local.sun_path, path);
|
||||||
local.sun_family = AF_UNIX;
|
local.sun_family = AF_UNIX;
|
||||||
|
size_t addrlen = SUN_LEN(&local);
|
||||||
#ifdef UNIX_HAS_SUN_LEN
|
#ifdef UNIX_HAS_SUN_LEN
|
||||||
local.sun_len = sizeof(local.sun_family) + sizeof(local.sun_len)
|
local.sun_len = addrlen + 1;
|
||||||
+ len + 1;
|
|
||||||
err = socket_bind(&un->sock, (SA *) &local, local.sun_len);
|
|
||||||
|
|
||||||
#else
|
|
||||||
err = socket_bind(&un->sock, (SA *) &local,
|
|
||||||
sizeof(local.sun_family) + len);
|
|
||||||
#endif
|
#endif
|
||||||
|
int err = socket_bind(&un->sock, (SA *) &local, addrlen);
|
||||||
if (err != IO_DONE) socket_destroy(&un->sock);
|
if (err != IO_DONE) socket_destroy(&un->sock);
|
||||||
return socket_strerror(err);
|
return socket_strerror(err);
|
||||||
}
|
}
|
||||||
@ -279,9 +282,8 @@ static const char *unixdgram_trybind(p_unix un, const char *path, size_t len) {
|
|||||||
static int meth_bind(lua_State *L)
|
static int meth_bind(lua_State *L)
|
||||||
{
|
{
|
||||||
p_unix un = (p_unix) auxiliar_checkclass(L, "unixdgram{unconnected}", 1);
|
p_unix un = (p_unix) auxiliar_checkclass(L, "unixdgram{unconnected}", 1);
|
||||||
size_t len;
|
const char *path = luaL_checkstring(L, 2);
|
||||||
const char *path = luaL_checklstring(L, 2, &len);
|
const char *err = unixdgram_trybind(un, path);
|
||||||
const char *err = unixdgram_trybind(un, path, len);
|
|
||||||
if (err) {
|
if (err) {
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
lua_pushstring(L, err);
|
lua_pushstring(L, err);
|
||||||
@ -310,23 +312,20 @@ static int meth_getsockname(lua_State *L)
|
|||||||
/*-------------------------------------------------------------------------*\
|
/*-------------------------------------------------------------------------*\
|
||||||
* Turns a master unixdgram object into a client object.
|
* Turns a master unixdgram object into a client object.
|
||||||
\*-------------------------------------------------------------------------*/
|
\*-------------------------------------------------------------------------*/
|
||||||
static const char *unixdgram_tryconnect(p_unix un, const char *path, size_t len)
|
static const char *unixdgram_tryconnect(p_unix un, const char *path)
|
||||||
{
|
{
|
||||||
struct sockaddr_un remote;
|
struct sockaddr_un remote;
|
||||||
int err;
|
size_t len = strlen(path);
|
||||||
if (len >= sizeof(remote.sun_path)) return "path too long";
|
if (len >= sizeof(remote.sun_path)) return "path too long";
|
||||||
memset(&remote, 0, sizeof(remote));
|
memset(&remote, 0, sizeof(remote));
|
||||||
memcpy(remote.sun_path, path, len);
|
strcpy(remote.sun_path, path);
|
||||||
remote.sun_family = AF_UNIX;
|
remote.sun_family = AF_UNIX;
|
||||||
timeout_markstart(&un->tm);
|
timeout_markstart(&un->tm);
|
||||||
|
size_t addrlen = SUN_LEN(&remote);
|
||||||
#ifdef UNIX_HAS_SUN_LEN
|
#ifdef UNIX_HAS_SUN_LEN
|
||||||
remote.sun_len = sizeof(remote.sun_family) + sizeof(remote.sun_len)
|
remote.sun_len = addrlen + 1;
|
||||||
+ len + 1;
|
|
||||||
err = socket_connect(&un->sock, (SA *) &remote, remote.sun_len, &un->tm);
|
|
||||||
#else
|
|
||||||
err = socket_connect(&un->sock, (SA *) &remote,
|
|
||||||
sizeof(remote.sun_family) + len, &un->tm);
|
|
||||||
#endif
|
#endif
|
||||||
|
int err = socket_connect(&un->sock, (SA *) &remote, addrlen, &un->tm);
|
||||||
if (err != IO_DONE) socket_destroy(&un->sock);
|
if (err != IO_DONE) socket_destroy(&un->sock);
|
||||||
return socket_strerror(err);
|
return socket_strerror(err);
|
||||||
}
|
}
|
||||||
@ -334,9 +333,8 @@ static const char *unixdgram_tryconnect(p_unix un, const char *path, size_t len)
|
|||||||
static int meth_connect(lua_State *L)
|
static int meth_connect(lua_State *L)
|
||||||
{
|
{
|
||||||
p_unix un = (p_unix) auxiliar_checkgroup(L, "unixdgram{any}", 1);
|
p_unix un = (p_unix) auxiliar_checkgroup(L, "unixdgram{any}", 1);
|
||||||
size_t len;
|
const char *path = luaL_checkstring(L, 2);
|
||||||
const char *path = luaL_checklstring(L, 2, &len);
|
const char *err = unixdgram_tryconnect(un, path);
|
||||||
const char *err = unixdgram_tryconnect(un, path, len);
|
|
||||||
if (err) {
|
if (err) {
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
lua_pushstring(L, err);
|
lua_pushstring(L, err);
|
||||||
|
@ -7,10 +7,10 @@
|
|||||||
#include "auxiliar.h"
|
#include "auxiliar.h"
|
||||||
#include "socket.h"
|
#include "socket.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
|
#include "unixdef.h"
|
||||||
#include "unixstream.h"
|
#include "unixstream.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/un.h>
|
|
||||||
|
|
||||||
/*=========================================================================*\
|
/*=========================================================================*\
|
||||||
* Internal function prototypes
|
* Internal function prototypes
|
||||||
@ -33,8 +33,8 @@ static int meth_getstats(lua_State *L);
|
|||||||
static int meth_setstats(lua_State *L);
|
static int meth_setstats(lua_State *L);
|
||||||
static int meth_getsockname(lua_State *L);
|
static int meth_getsockname(lua_State *L);
|
||||||
|
|
||||||
static const char *unixstream_tryconnect(p_unix un, const char *path, size_t len);
|
static const char *unixstream_tryconnect(p_unix un, const char *path);
|
||||||
static const char *unixstream_trybind(p_unix un, const char *path, size_t len);
|
static const char *unixstream_trybind(p_unix un, const char *path);
|
||||||
|
|
||||||
/* unixstream object methods */
|
/* unixstream object methods */
|
||||||
static luaL_Reg unixstream_methods[] = {
|
static luaL_Reg unixstream_methods[] = {
|
||||||
@ -181,12 +181,13 @@ static int meth_accept(lua_State *L) {
|
|||||||
/*-------------------------------------------------------------------------*\
|
/*-------------------------------------------------------------------------*\
|
||||||
* Binds an object to an address
|
* Binds an object to an address
|
||||||
\*-------------------------------------------------------------------------*/
|
\*-------------------------------------------------------------------------*/
|
||||||
static const char *unixstream_trybind(p_unix un, const char *path, size_t len) {
|
static const char *unixstream_trybind(p_unix un, const char *path) {
|
||||||
struct sockaddr_un local;
|
struct sockaddr_un local;
|
||||||
|
size_t len = strlen(path);
|
||||||
int err;
|
int err;
|
||||||
if (len >= sizeof(local.sun_path)) return "path too long";
|
if (len >= sizeof(local.sun_path)) return "path too long";
|
||||||
memset(&local, 0, sizeof(local));
|
memset(&local, 0, sizeof(local));
|
||||||
memcpy(local.sun_path, path, len);
|
strcpy(local.sun_path, path);
|
||||||
local.sun_family = AF_UNIX;
|
local.sun_family = AF_UNIX;
|
||||||
#ifdef UNIX_HAS_SUN_LEN
|
#ifdef UNIX_HAS_SUN_LEN
|
||||||
local.sun_len = sizeof(local.sun_family) + sizeof(local.sun_len)
|
local.sun_len = sizeof(local.sun_family) + sizeof(local.sun_len)
|
||||||
@ -203,9 +204,8 @@ static const char *unixstream_trybind(p_unix un, const char *path, size_t len) {
|
|||||||
|
|
||||||
static int meth_bind(lua_State *L) {
|
static int meth_bind(lua_State *L) {
|
||||||
p_unix un = (p_unix) auxiliar_checkclass(L, "unixstream{master}", 1);
|
p_unix un = (p_unix) auxiliar_checkclass(L, "unixstream{master}", 1);
|
||||||
size_t len;
|
const char *path = luaL_checkstring(L, 2);
|
||||||
const char *path = luaL_checklstring(L, 2, &len);
|
const char *err = unixstream_trybind(un, path);
|
||||||
const char *err = unixstream_trybind(un, path, len);
|
|
||||||
if (err) {
|
if (err) {
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
lua_pushstring(L, err);
|
lua_pushstring(L, err);
|
||||||
@ -234,13 +234,14 @@ static int meth_getsockname(lua_State *L)
|
|||||||
/*-------------------------------------------------------------------------*\
|
/*-------------------------------------------------------------------------*\
|
||||||
* Turns a master unixstream object into a client object.
|
* Turns a master unixstream object into a client object.
|
||||||
\*-------------------------------------------------------------------------*/
|
\*-------------------------------------------------------------------------*/
|
||||||
static const char *unixstream_tryconnect(p_unix un, const char *path, size_t len)
|
static const char *unixstream_tryconnect(p_unix un, const char *path)
|
||||||
{
|
{
|
||||||
struct sockaddr_un remote;
|
struct sockaddr_un remote;
|
||||||
int err;
|
int err;
|
||||||
|
size_t len = strlen(path);
|
||||||
if (len >= sizeof(remote.sun_path)) return "path too long";
|
if (len >= sizeof(remote.sun_path)) return "path too long";
|
||||||
memset(&remote, 0, sizeof(remote));
|
memset(&remote, 0, sizeof(remote));
|
||||||
memcpy(remote.sun_path, path, len);
|
strcpy(remote.sun_path, path);
|
||||||
remote.sun_family = AF_UNIX;
|
remote.sun_family = AF_UNIX;
|
||||||
timeout_markstart(&un->tm);
|
timeout_markstart(&un->tm);
|
||||||
#ifdef UNIX_HAS_SUN_LEN
|
#ifdef UNIX_HAS_SUN_LEN
|
||||||
@ -258,9 +259,8 @@ static const char *unixstream_tryconnect(p_unix un, const char *path, size_t len
|
|||||||
static int meth_connect(lua_State *L)
|
static int meth_connect(lua_State *L)
|
||||||
{
|
{
|
||||||
p_unix un = (p_unix) auxiliar_checkclass(L, "unixstream{master}", 1);
|
p_unix un = (p_unix) auxiliar_checkclass(L, "unixstream{master}", 1);
|
||||||
size_t len;
|
const char *path = luaL_checkstring(L, 2);
|
||||||
const char *path = luaL_checklstring(L, 2, &len);
|
const char *err = unixstream_tryconnect(un, path);
|
||||||
const char *err = unixstream_tryconnect(un, path, len);
|
|
||||||
if (err) {
|
if (err) {
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
lua_pushstring(L, err);
|
lua_pushstring(L, err);
|
||||||
|
0
src/wsocket.c
Normal file → Executable file
0
src/wsocket.c
Normal file → Executable file
214
unix.vcxproj
Normal file
214
unix.vcxproj
Normal file
@ -0,0 +1,214 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\auxiliar.c" />
|
||||||
|
<ClCompile Include="src\buffer.c" />
|
||||||
|
<ClCompile Include="src\compat.c" />
|
||||||
|
<ClCompile Include="src\inet.c" />
|
||||||
|
<ClCompile Include="src\io.c" />
|
||||||
|
<ClCompile Include="src\options.c" />
|
||||||
|
<ClCompile Include="src\timeout.c" />
|
||||||
|
<ClCompile Include="src\unix.c" />
|
||||||
|
<ClCompile Include="src\unixstream.c" />
|
||||||
|
<ClCompile Include="src\unixdgram.c" />
|
||||||
|
<ClCompile Include="src\wsocket.c" />
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>{1390FB7F-6D39-4F0A-BBC0-0EAC022D827A}</ProjectGuid>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||||
|
<Import Project="Lua.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||||
|
<Import Project="Lua.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||||
|
<Import Project="Lua.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||||
|
<Import Project="Lua.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<_ProjectFileVersion>11.0.50727.1</_ProjectFileVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<OutDir>$(Configuration)\socket\</OutDir>
|
||||||
|
<IntDir>$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<TargetName>unix</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<TargetName>unix</TargetName>
|
||||||
|
<OutDir>$(Platform)\$(Configuration)\socket\</OutDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<OutDir>$(Configuration)\socket\</OutDir>
|
||||||
|
<IntDir>$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<TargetName>unix</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<OutDir>$(Platform)\$(Configuration)\socket\</OutDir>
|
||||||
|
<TargetName>unix</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>$(LUAINC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LUASOCKET_API=__declspec(dllexport);_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<PrecompiledHeader />
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||||
|
<ProgramDataBaseFileName>$(IntDir)$(TargetName)$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>$(LUALIBNAME);ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>$(OutDir)$(TargetName).dll</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>$(LUALIB);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>$(OutDir)unix.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||||
|
<DataExecutionPrevention />
|
||||||
|
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>$(LUAINC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LUASOCKET_API=__declspec(dllexport);_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<PrecompiledHeader>
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<ProgramDataBaseFileName>$(IntDir)$(TargetName)$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>$(LUALIBNAME);ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>$(OutDir)$(TargetName).dll</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>$(LUALIB);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>$(OutDir)unix.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||||
|
<DataExecutionPrevention>
|
||||||
|
</DataExecutionPrevention>
|
||||||
|
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<AdditionalIncludeDirectories>$(LUAINC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LUASOCKET_API=__declspec(dllexport);_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
<PrecompiledHeader />
|
||||||
|
<WarningLevel>Level4</WarningLevel>
|
||||||
|
<DebugInformationFormat />
|
||||||
|
<ProgramDataBaseFileName>$(IntDir)$(TargetName)$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>$(LUALIBNAME);ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>$(OutDir)$(TargetName).dll</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>$(LUALIB);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||||
|
<DataExecutionPrevention />
|
||||||
|
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<AdditionalIncludeDirectories>$(LUAINC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LUASOCKET_API=__declspec(dllexport);_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
<PrecompiledHeader>
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level4</WarningLevel>
|
||||||
|
<DebugInformationFormat>
|
||||||
|
</DebugInformationFormat>
|
||||||
|
<ProgramDataBaseFileName>$(IntDir)$(TargetName)$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>$(LUALIBNAME);ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>$(OutDir)$(TargetName).dll</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>$(LUALIB);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||||
|
<DataExecutionPrevention>
|
||||||
|
</DataExecutionPrevention>
|
||||||
|
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
Reference in New Issue
Block a user