.
17 |
18 | lua.pc
19 | pkg-config data for Lua
20 |
21 | luavs.bat
22 | Script to build Lua under "Visual Studio .NET Command Prompt".
23 | Run it from the toplevel as etc\luavs.bat.
24 |
25 | min.c
26 | A minimal Lua interpreter.
27 | Good for learning and for starting your own.
28 | Do "make min" for a demo.
29 |
30 | noparser.c
31 | Linking with noparser.o avoids loading the parsing modules in lualib.a.
32 | Do "make noparser" for a demo.
33 |
34 | strict.lua
35 | Traps uses of undeclared global variables.
36 | Do "make strict" for a demo.
37 |
38 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/deps/lua/etc/luavs.bat:
--------------------------------------------------------------------------------
1 | @rem Script to build Lua under "Visual Studio .NET Command Prompt".
2 | @rem Do not run from this directory; run it from the toplevel: etc\luavs.bat .
3 | @rem It creates lua51.dll, lua51.lib, lua.exe, and luac.exe in src.
4 | @rem (contributed by David Manura and Mike Pall)
5 |
6 | @setlocal
7 | @set MYCOMPILE=cl /nologo /MD /O2 /W3 /c /D_CRT_SECURE_NO_DEPRECATE
8 | @set MYLINK=link /nologo
9 | @set MYMT=mt /nologo
10 |
11 | cd src
12 | %MYCOMPILE% /DLUA_BUILD_AS_DLL l*.c
13 | del lua.obj luac.obj
14 | %MYLINK% /DLL /out:lua51.dll l*.obj
15 | if exist lua51.dll.manifest^
16 | %MYMT% -manifest lua51.dll.manifest -outputresource:lua51.dll;2
17 | %MYCOMPILE% /DLUA_BUILD_AS_DLL lua.c
18 | %MYLINK% /out:lua.exe lua.obj lua51.lib
19 | if exist lua.exe.manifest^
20 | %MYMT% -manifest lua.exe.manifest -outputresource:lua.exe
21 | %MYCOMPILE% l*.c print.c
22 | del lua.obj linit.obj lbaselib.obj ldblib.obj liolib.obj lmathlib.obj^
23 | loslib.obj ltablib.obj lstrlib.obj loadlib.obj
24 | %MYLINK% /out:luac.exe *.obj
25 | if exist luac.exe.manifest^
26 | %MYMT% -manifest luac.exe.manifest -outputresource:luac.exe
27 | del *.obj *.manifest
28 | cd ..
29 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/deps/lua/src/ldebug.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: ldebug.h,v 2.3.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Auxiliary functions from Debug Interface module
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef ldebug_h
8 | #define ldebug_h
9 |
10 |
11 | #include "lstate.h"
12 |
13 |
14 | #define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1)
15 |
16 | #define getline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0)
17 |
18 | #define resethookcount(L) (L->hookcount = L->basehookcount)
19 |
20 |
21 | LUAI_FUNC void luaG_typeerror (lua_State *L, const TValue *o,
22 | const char *opname);
23 | LUAI_FUNC void luaG_concaterror (lua_State *L, StkId p1, StkId p2);
24 | LUAI_FUNC void luaG_aritherror (lua_State *L, const TValue *p1,
25 | const TValue *p2);
26 | LUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1,
27 | const TValue *p2);
28 | LUAI_FUNC void luaG_runerror (lua_State *L, const char *fmt, ...);
29 | LUAI_FUNC void luaG_errormsg (lua_State *L);
30 | LUAI_FUNC int luaG_checkcode (const Proto *pt);
31 | LUAI_FUNC int luaG_checkopenop (Instruction i);
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/deps/lua/src/ltm.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: ltm.h,v 2.6.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Tag methods
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef ltm_h
8 | #define ltm_h
9 |
10 |
11 | #include "lobject.h"
12 |
13 |
14 | /*
15 | * WARNING: if you change the order of this enumeration,
16 | * grep "ORDER TM"
17 | */
18 | typedef enum {
19 | TM_INDEX,
20 | TM_NEWINDEX,
21 | TM_GC,
22 | TM_MODE,
23 | TM_EQ, /* last tag method with `fast' access */
24 | TM_ADD,
25 | TM_SUB,
26 | TM_MUL,
27 | TM_DIV,
28 | TM_MOD,
29 | TM_POW,
30 | TM_UNM,
31 | TM_LEN,
32 | TM_LT,
33 | TM_LE,
34 | TM_CONCAT,
35 | TM_CALL,
36 | TM_N /* number of elements in the enum */
37 | } TMS;
38 |
39 |
40 |
41 | #define gfasttm(g,et,e) ((et) == NULL ? NULL : \
42 | ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e]))
43 |
44 | #define fasttm(l,et,e) gfasttm(G(l), et, e)
45 |
46 | LUAI_DATA const char *const luaT_typenames[];
47 |
48 |
49 | LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename);
50 | LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o,
51 | TMS event);
52 | LUAI_FUNC void luaT_init (lua_State *L);
53 |
54 | #endif
55 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/deps/lua/src/lfunc.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lfunc.h,v 2.4.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Auxiliary functions to manipulate prototypes and closures
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef lfunc_h
8 | #define lfunc_h
9 |
10 |
11 | #include "lobject.h"
12 |
13 |
14 | #define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \
15 | cast(int, sizeof(TValue)*((n)-1)))
16 |
17 | #define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \
18 | cast(int, sizeof(TValue *)*((n)-1)))
19 |
20 |
21 | LUAI_FUNC Proto *luaF_newproto (lua_State *L);
22 | LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e);
23 | LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e);
24 | LUAI_FUNC UpVal *luaF_newupval (lua_State *L);
25 | LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level);
26 | LUAI_FUNC void luaF_close (lua_State *L, StkId level);
27 | LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f);
28 | LUAI_FUNC void luaF_freeclosure (lua_State *L, Closure *c);
29 | LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv);
30 | LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number,
31 | int pc);
32 |
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/deps/lua/src/lualib.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lualib.h,v 1.36.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Lua standard libraries
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 |
8 | #ifndef lualib_h
9 | #define lualib_h
10 |
11 | #include "lua.h"
12 |
13 |
14 | /* Key to file-handle type */
15 | #define LUA_FILEHANDLE "FILE*"
16 |
17 |
18 | #define LUA_COLIBNAME "coroutine"
19 | LUALIB_API int (luaopen_base) (lua_State *L);
20 |
21 | #define LUA_TABLIBNAME "table"
22 | LUALIB_API int (luaopen_table) (lua_State *L);
23 |
24 | #define LUA_IOLIBNAME "io"
25 | LUALIB_API int (luaopen_io) (lua_State *L);
26 |
27 | #define LUA_OSLIBNAME "os"
28 | LUALIB_API int (luaopen_os) (lua_State *L);
29 |
30 | #define LUA_STRLIBNAME "string"
31 | LUALIB_API int (luaopen_string) (lua_State *L);
32 |
33 | #define LUA_MATHLIBNAME "math"
34 | LUALIB_API int (luaopen_math) (lua_State *L);
35 |
36 | #define LUA_DBLIBNAME "debug"
37 | LUALIB_API int (luaopen_debug) (lua_State *L);
38 |
39 | #define LUA_LOADLIBNAME "package"
40 | LUALIB_API int (luaopen_package) (lua_State *L);
41 |
42 |
43 | /* open all previous libraries */
44 | LUALIB_API void (luaL_openlibs) (lua_State *L);
45 |
46 |
47 |
48 | #ifndef lua_assert
49 | #define lua_assert(x) ((void)0)
50 | #endif
51 |
52 |
53 | #endif
54 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/deps/lua/test/README:
--------------------------------------------------------------------------------
1 | These are simple tests for Lua. Some of them contain useful code.
2 | They are meant to be run to make sure Lua is built correctly and also
3 | to be read, to see how Lua programs look.
4 |
5 | Here is a one-line summary of each program:
6 |
7 | bisect.lua bisection method for solving non-linear equations
8 | cf.lua temperature conversion table (celsius to farenheit)
9 | echo.lua echo command line arguments
10 | env.lua environment variables as automatic global variables
11 | factorial.lua factorial without recursion
12 | fib.lua fibonacci function with cache
13 | fibfor.lua fibonacci numbers with coroutines and generators
14 | globals.lua report global variable usage
15 | hello.lua the first program in every language
16 | life.lua Conway's Game of Life
17 | luac.lua bare-bones luac
18 | printf.lua an implementation of printf
19 | readonly.lua make global variables readonly
20 | sieve.lua the sieve of of Eratosthenes programmed with coroutines
21 | sort.lua two implementations of a sort function
22 | table.lua make table, grouping all data for the same item
23 | trace-calls.lua trace calls
24 | trace-globals.lua trace assigments to global variables
25 | xd.lua hex dump
26 |
27 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/deps/lua/src/lvm.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lvm.h,v 2.5.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Lua virtual machine
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef lvm_h
8 | #define lvm_h
9 |
10 |
11 | #include "ldo.h"
12 | #include "lobject.h"
13 | #include "ltm.h"
14 |
15 |
16 | #define tostring(L,o) ((ttype(o) == LUA_TSTRING) || (luaV_tostring(L, o)))
17 |
18 | #define tonumber(o,n) (ttype(o) == LUA_TNUMBER || \
19 | (((o) = luaV_tonumber(o,n)) != NULL))
20 |
21 | #define equalobj(L,o1,o2) \
22 | (ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2))
23 |
24 |
25 | LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r);
26 | LUAI_FUNC int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2);
27 | LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n);
28 | LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj);
29 | LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key,
30 | StkId val);
31 | LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key,
32 | StkId val);
33 | LUAI_FUNC void luaV_execute (lua_State *L, int nexeccalls);
34 | LUAI_FUNC void luaV_concat (lua_State *L, int total, int last);
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/deps/lua/src/ltable.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: ltable.h,v 2.10.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Lua tables (hash)
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef ltable_h
8 | #define ltable_h
9 |
10 | #include "lobject.h"
11 |
12 |
13 | #define gnode(t,i) (&(t)->node[i])
14 | #define gkey(n) (&(n)->i_key.nk)
15 | #define gval(n) (&(n)->i_val)
16 | #define gnext(n) ((n)->i_key.nk.next)
17 |
18 | #define key2tval(n) (&(n)->i_key.tvk)
19 |
20 |
21 | LUAI_FUNC const TValue *luaH_getnum (Table *t, int key);
22 | LUAI_FUNC TValue *luaH_setnum (lua_State *L, Table *t, int key);
23 | LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
24 | LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key);
25 | LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
26 | LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key);
27 | LUAI_FUNC Table *luaH_new (lua_State *L, int narray, int lnhash);
28 | LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize);
29 | LUAI_FUNC void luaH_free (lua_State *L, Table *t);
30 | LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key);
31 | LUAI_FUNC int luaH_getn (Table *t);
32 |
33 |
34 | #if defined(LUA_DEBUG)
35 | LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);
36 | LUAI_FUNC int luaH_isdummy (Node *n);
37 | #endif
38 |
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.23107.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hiredis", "hiredis\hiredis.vcxproj", "{7BA9DFB0-A50B-4020-B356-AFBCF9E3F312}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|x64 = Debug|x64
11 | Debug|x86 = Debug|x86
12 | Release|x64 = Release|x64
13 | Release|x86 = Release|x86
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {7BA9DFB0-A50B-4020-B356-AFBCF9E3F312}.Debug|x64.ActiveCfg = Debug|x64
17 | {7BA9DFB0-A50B-4020-B356-AFBCF9E3F312}.Debug|x64.Build.0 = Debug|x64
18 | {7BA9DFB0-A50B-4020-B356-AFBCF9E3F312}.Debug|x86.ActiveCfg = Debug|Win32
19 | {7BA9DFB0-A50B-4020-B356-AFBCF9E3F312}.Debug|x86.Build.0 = Debug|Win32
20 | {7BA9DFB0-A50B-4020-B356-AFBCF9E3F312}.Release|x64.ActiveCfg = Release|x64
21 | {7BA9DFB0-A50B-4020-B356-AFBCF9E3F312}.Release|x64.Build.0 = Release|x64
22 | {7BA9DFB0-A50B-4020-B356-AFBCF9E3F312}.Release|x86.ActiveCfg = Release|Win32
23 | {7BA9DFB0-A50B-4020-B356-AFBCF9E3F312}.Release|x86.Build.0 = Release|Win32
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/deps/lua/etc/noparser.c:
--------------------------------------------------------------------------------
1 | /*
2 | * The code below can be used to make a Lua core that does not contain the
3 | * parsing modules (lcode, llex, lparser), which represent 35% of the total core.
4 | * You'll only be able to load binary files and strings, precompiled with luac.
5 | * (Of course, you'll have to build luac with the original parsing modules!)
6 | *
7 | * To use this module, simply compile it ("make noparser" does that) and list
8 | * its object file before the Lua libraries. The linker should then not load
9 | * the parsing modules. To try it, do "make luab".
10 | *
11 | * If you also want to avoid the dump module (ldump.o), define NODUMP.
12 | * #define NODUMP
13 | */
14 |
15 | #define LUA_CORE
16 |
17 | #include "llex.h"
18 | #include "lparser.h"
19 | #include "lzio.h"
20 |
21 | LUAI_FUNC void luaX_init (lua_State *L) {
22 | UNUSED(L);
23 | }
24 |
25 | LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) {
26 | UNUSED(z);
27 | UNUSED(buff);
28 | UNUSED(name);
29 | lua_pushliteral(L,"parser not loaded");
30 | lua_error(L);
31 | return NULL;
32 | }
33 |
34 | #ifdef NODUMP
35 | #include "lundump.h"
36 |
37 | LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip) {
38 | UNUSED(f);
39 | UNUSED(w);
40 | UNUSED(data);
41 | UNUSED(strip);
42 | #if 1
43 | UNUSED(L);
44 | return 0;
45 | #else
46 | lua_pushliteral(L,"dumper not loaded");
47 | lua_error(L);
48 | #endif
49 | }
50 | #endif
51 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # MT5_to_Python
2 |
3 | the repository show 2 ways to transfer data from mt5 to python.
4 | description will be in Russian, if necessary, use Google translate
5 |
6 |
7 | ## MT5
8 | в папке /mt5/MQL5/ все необходимое для работы, со всеми исходниками!
9 |
10 | терминал от Alpari MT5 Version 5.00 build 1940
11 |
12 |
13 |
14 |
15 |
16 | * Советник отправляет данные при изменении Close по выбранным инструментам
17 | * Если список инструментов оставить пустым - будет слать по всем парам из обзора рынка
18 |
19 |
20 | ## Python
21 | сделал 2 примера:
22 | 1) непосредственного получения и обработки данных
23 | 2) и тест скорости отправки. у меня по сокетам и по редис время, от отправки из терминала, до получения в питоне быстрее 0,001 sec (те Очень быстро и разницы на таком уровне нету)
24 |
25 |
26 |
   
27 |
28 |
29 |
30 | Сам я остановился на варианте с Redis тк:
31 | + достаточно одного терминала на множество скриптов. (работа идет как с единым БД).
32 | + по скорости, для моих нужд, более чем быстро и не уступает socket
33 |
34 | ## Install
35 | ### Redis
36 | Если под винды: https://github.com/MicrosoftArchive/redis/releases
37 |
38 | ## Contacts
39 | Telegram: @Lxbinary
40 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/deps/lua/README:
--------------------------------------------------------------------------------
1 | README for Lua 5.1
2 |
3 | See INSTALL for installation instructions.
4 | See HISTORY for a summary of changes since the last released version.
5 |
6 | * What is Lua?
7 | ------------
8 | Lua is a powerful, light-weight programming language designed for extending
9 | applications. Lua is also frequently used as a general-purpose, stand-alone
10 | language. Lua is free software.
11 |
12 | For complete information, visit Lua's web site at http://www.lua.org/ .
13 | For an executive summary, see http://www.lua.org/about.html .
14 |
15 | Lua has been used in many different projects around the world.
16 | For a short list, see http://www.lua.org/uses.html .
17 |
18 | * Availability
19 | ------------
20 | Lua is freely available for both academic and commercial purposes.
21 | See COPYRIGHT and http://www.lua.org/license.html for details.
22 | Lua can be downloaded at http://www.lua.org/download.html .
23 |
24 | * Installation
25 | ------------
26 | Lua is implemented in pure ANSI C, and compiles unmodified in all known
27 | platforms that have an ANSI C compiler. In most Unix-like platforms, simply
28 | do "make" with a suitable target. See INSTALL for detailed instructions.
29 |
30 | * Origin
31 | ------
32 | Lua is developed at Lua.org, a laboratory of the Department of Computer
33 | Science of PUC-Rio (the Pontifical Catholic University of Rio de Janeiro
34 | in Brazil).
35 | For more information about the authors, see http://www.lua.org/authors.html .
36 |
37 | (end of README)
38 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/Win32_Interop/EventLog.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | //
3 | // Values are 32 bit values laid out as follows:
4 | //
5 | // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
6 | // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
7 | // +---+-+-+-----------------------+-------------------------------+
8 | // |Sev|C|R| Facility | Code |
9 | // +---+-+-+-----------------------+-------------------------------+
10 | //
11 | // where
12 | //
13 | // Sev - is the severity code
14 | //
15 | // 00 - Success
16 | // 01 - Informational
17 | // 10 - Warning
18 | // 11 - Error
19 | //
20 | // C - is the Customer code flag
21 | //
22 | // R - is a reserved bit
23 | //
24 | // Facility - is the facility code
25 | //
26 | // Code - is the facility's status code
27 | //
28 | //
29 | // Define the facility codes
30 | //
31 |
32 |
33 | //
34 | // Define the severity codes
35 | //
36 |
37 |
38 | //
39 | // MessageId: MSG_INFO_1
40 | //
41 | // MessageText:
42 | //
43 | // %1
44 | //
45 | #define MSG_INFO_1 0x60000000L
46 |
47 | //
48 | // MessageId: MSG_WARNING_1
49 | //
50 | // MessageText:
51 | //
52 | // %1
53 | //
54 | #define MSG_WARNING_1 0xA0000001L
55 |
56 | //
57 | // MessageId: MSG_ERROR_1
58 | //
59 | // MessageText:
60 | //
61 | // %1
62 | //
63 | #define MSG_ERROR_1 0xE0000002L
64 |
65 | //
66 | // MessageId: MSG_SUCCESS_1
67 | //
68 | // MessageText:
69 | //
70 | // %1
71 | //
72 | #define MSG_SUCCESS_1 0x20000003L
73 |
74 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/deps/lua/COPYRIGHT:
--------------------------------------------------------------------------------
1 | Lua License
2 | -----------
3 |
4 | Lua is licensed under the terms of the MIT license reproduced below.
5 | This means that Lua is free software and can be used for both academic
6 | and commercial purposes at absolutely no cost.
7 |
8 | For details and rationale, see http://www.lua.org/license.html .
9 |
10 | ===============================================================================
11 |
12 | Copyright (C) 1994-2012 Lua.org, PUC-Rio.
13 |
14 | Permission is hereby granted, free of charge, to any person obtaining a copy
15 | of this software and associated documentation files (the "Software"), to deal
16 | in the Software without restriction, including without limitation the rights
17 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18 | copies of the Software, and to permit persons to whom the Software is
19 | furnished to do so, subject to the following conditions:
20 |
21 | The above copyright notice and this permission notice shall be included in
22 | all copies or substantial portions of the Software.
23 |
24 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
30 | THE SOFTWARE.
31 |
32 | ===============================================================================
33 |
34 | (end of COPYRIGHT)
35 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/Win32_Interop/Win32_StackTrace.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c), Microsoft Open Technologies, Inc.
3 | * All rights reserved.
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions are met:
6 | * - Redistributions of source code must retain the above copyright notice,
7 | * this list of conditions and the following disclaimer.
8 | * - Redistributions in binary form must reproduce the above copyright notice,
9 | * this list of conditions and the following disclaimer in the documentation
10 | * and/or other materials provided with the distribution.
11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
12 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
13 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
14 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
15 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
16 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
17 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
18 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
20 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 | */
22 |
23 | #pragma once
24 |
25 | #include "win32_types.h"
26 | #include
27 |
28 | void StackTraceInit(void);
29 |
30 | extern "C" typedef char *sds;
31 | //extern "C" sds genRedisInfoString(char *section);
32 | //extern "C" void bugReportStart(void);
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/deps/lua/src/lmem.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lmem.h,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Interface to Memory Manager
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef lmem_h
8 | #define lmem_h
9 |
10 |
11 | #include
12 |
13 | #include "llimits.h"
14 | #include "lua.h"
15 |
16 | #define MEMERRMSG "not enough memory"
17 |
18 |
19 | #define luaM_reallocv(L,b,on,n,e) \
20 | ((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \
21 | luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \
22 | luaM_toobig(L))
23 |
24 | #define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0)
25 | #define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0)
26 | #define luaM_freearray(L, b, n, t) luaM_reallocv(L, (b), n, 0, sizeof(t))
27 |
28 | #define luaM_malloc(L,t) luaM_realloc_(L, NULL, 0, (t))
29 | #define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t)))
30 | #define luaM_newvector(L,n,t) \
31 | cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
32 |
33 | #define luaM_growvector(L,v,nelems,size,t,limit,e) \
34 | if ((nelems)+1 > (size)) \
35 | ((v)=cast(t *, luaM_growaux_(L,v,&(size),sizeof(t),limit,e)))
36 |
37 | #define luaM_reallocvector(L, v,oldn,n,t) \
38 | ((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t))))
39 |
40 |
41 | LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize,
42 | size_t size);
43 | LUAI_FUNC void *luaM_toobig (lua_State *L);
44 | LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size,
45 | size_t size_elem, int limit,
46 | const char *errormsg);
47 |
48 | #endif
49 |
50 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/Win32_Interop/Win32_PThread.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | #include
4 | #include
5 |
6 | #ifndef _SIGSET_T_
7 | #define _SIGSET_T_
8 | typedef size_t _sigset_t;
9 | #define sigset_t _sigset_t
10 | #endif /* _SIGSET_T_ */
11 |
12 | #ifndef SIG_SETMASK
13 | #define SIG_SETMASK (0)
14 | #define SIG_BLOCK (1)
15 | #define SIG_UNBLOCK (2)
16 | #endif /* SIG_SETMASK */
17 |
18 | /* threads avoiding pthread.h */
19 | #define pthread_mutex_t CRITICAL_SECTION
20 | #define pthread_attr_t ssize_t
21 |
22 | #define pthread_mutex_init(a,b) (InitializeCriticalSectionAndSpinCount((a), 0x80000400),0)
23 | #define pthread_mutex_destroy(a) DeleteCriticalSection((a))
24 | #define pthread_mutex_lock EnterCriticalSection
25 | #define pthread_mutex_unlock LeaveCriticalSection
26 |
27 | #define pthread_equal(t1, t2) ((t1) == (t2))
28 |
29 | #define pthread_attr_init(x) (*(x) = 0)
30 | #define pthread_attr_getstacksize(x, y) (*(y) = *(x))
31 | #define pthread_attr_setstacksize(x, y) (*(x) = y)
32 |
33 | #define pthread_t unsigned int
34 |
35 | int pthread_create(pthread_t *thread, const void *unused, void *(*start_routine)(void*), void *arg);
36 |
37 | pthread_t pthread_self(void);
38 |
39 | typedef struct {
40 | CRITICAL_SECTION waiters_lock;
41 | LONG waiters;
42 | int was_broadcast;
43 | HANDLE sema;
44 | HANDLE continue_broadcast;
45 | } pthread_cond_t;
46 |
47 | int pthread_cond_init(pthread_cond_t *cond, const void *unused);
48 | int pthread_cond_destroy(pthread_cond_t *cond);
49 | int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
50 | int pthread_cond_signal(pthread_cond_t *cond);
51 |
52 | int pthread_detach(pthread_t thread);
53 | int pthread_sigmask(int how, const sigset_t *set, sigset_t *oldset);
54 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | *.egg-info/
24 | .installed.cfg
25 | *.egg
26 | MANIFEST
27 |
28 | # PyInstaller
29 | # Usually these files are written by a python script from a template
30 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
31 | *.manifest
32 | *.spec
33 |
34 | # Installer logs
35 | pip-log.txt
36 | pip-delete-this-directory.txt
37 |
38 | # Unit test / coverage reports
39 | htmlcov/
40 | .tox/
41 | .coverage
42 | .coverage.*
43 | .cache
44 | nosetests.xml
45 | coverage.xml
46 | *.cover
47 | .hypothesis/
48 | .pytest_cache/
49 |
50 | # Translations
51 | *.mo
52 | *.pot
53 |
54 | # Django stuff:
55 | *.log
56 | local_settings.py
57 | db.sqlite3
58 |
59 | # Flask stuff:
60 | instance/
61 | .webassets-cache
62 |
63 | # Scrapy stuff:
64 | .scrapy
65 |
66 | # Sphinx documentation
67 | docs/_build/
68 |
69 | # PyBuilder
70 | target/
71 |
72 | # Jupyter Notebook
73 | .ipynb_checkpoints
74 |
75 | # pyenv
76 | .python-version
77 |
78 | # celery beat schedule file
79 | celerybeat-schedule
80 |
81 | # SageMath parsed files
82 | *.sage.py
83 |
84 | # Environments
85 | .env
86 | .venv
87 | env/
88 | venv/
89 | ENV/
90 | env.bak/
91 | venv.bak/
92 |
93 | # Spyder project settings
94 | .spyderproject
95 | .spyproject
96 |
97 | # Rope project settings
98 | .ropeproject
99 |
100 | # mkdocs documentation
101 | /site
102 |
103 | # mypy
104 | .mypy_cache/
105 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/Win32_Interop/Win32_Service.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c), Microsoft Open Technologies, Inc.
3 | * All rights reserved.
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions are met:
6 | * - Redistributions of source code must retain the above copyright notice,
7 | * this list of conditions and the following disclaimer.
8 | * - Redistributions in binary form must reproduce the above copyright notice,
9 | * this list of conditions and the following disclaimer in the documentation
10 | * and/or other materials provided with the distribution.
11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
12 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
13 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
14 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
15 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
16 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
17 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
18 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
20 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 | */
22 |
23 | #pragma once
24 |
25 | #ifdef __cplusplus
26 | extern "C"
27 | {
28 | #endif
29 |
30 | BOOL RunningAsService();
31 | const char* GetServiceName();
32 | BOOL HandleServiceCommands(int argc, char **argv);
33 | BOOL ServiceStopIssued();
34 | DWORD ServiceWorkerThread(LPVOID lpParam);
35 |
36 | #ifdef __cplusplus
37 | }
38 | #endif
39 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/deps/lua/test/sort.lua:
--------------------------------------------------------------------------------
1 | -- two implementations of a sort function
2 | -- this is an example only. Lua has now a built-in function "sort"
3 |
4 | -- extracted from Programming Pearls, page 110
5 | function qsort(x,l,u,f)
6 | if ly end)
58 | show("after reverse selection sort",x)
59 | qsort(x,1,n,function (x,y) return x
26 | #include
27 | #include // for _O_BINARY
28 | #include // for INT_MAX
29 |
30 | #include "Win32_APIs.h"
31 | #include "Win32_FDAPI.h"
32 |
33 | #define WNOHANG 1
34 |
35 | /* file mapping */
36 | #define PROT_READ 1
37 | #define PROT_WRITE 2
38 |
39 | #define MAP_FAILED (void *) -1
40 |
41 | #define MAP_SHARED 1
42 | #define MAP_PRIVATE 2
43 |
44 | #if _MSC_VER < 1800
45 | #ifndef ECONNRESET
46 | #define ECONNRESET WSAECONNRESET
47 | #endif
48 |
49 | #ifndef EINPROGRESS
50 | #define EINPROGRESS WSAEINPROGRESS
51 | #endif
52 |
53 | #ifndef ETIMEDOUT
54 | #define ETIMEDOUT WSAETIMEDOUT
55 | #endif
56 | #endif
57 |
58 | #ifdef __cplusplus
59 | extern "C"
60 | {
61 | #endif
62 |
63 | /* strtod does not handle Inf and Nan, we need to do the check before calling strtod */
64 | #undef strtod
65 | #define strtod(nptr, eptr) wstrtod((nptr), (eptr))
66 |
67 | double wstrtod(const char *nptr, char **eptr);
68 |
69 | #ifdef __cplusplus
70 | }
71 | #endif
72 |
73 | // access check for executable uses X_OK. For Windows use READ access.
74 | #ifndef X_OK
75 | #define X_OK 4
76 | #endif
77 |
78 | #ifndef STDOUT_FILENO
79 | #define STDOUT_FILENO 1
80 | #endif
81 |
82 | #endif /* WIN32FIXES_H */
83 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/deps/lua/src/lzio.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lzio.h,v 1.21.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Buffered streams
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 |
8 | #ifndef lzio_h
9 | #define lzio_h
10 |
11 | #include "lua.h"
12 |
13 | #include "lmem.h"
14 |
15 |
16 | #define EOZ (-1) /* end of stream */
17 |
18 | typedef struct Zio ZIO;
19 |
20 | #define char2int(c) cast(int, cast(unsigned char, (c)))
21 |
22 | #define zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z))
23 |
24 | typedef struct Mbuffer {
25 | char *buffer;
26 | size_t n;
27 | size_t buffsize;
28 | } Mbuffer;
29 |
30 | #define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0)
31 |
32 | #define luaZ_buffer(buff) ((buff)->buffer)
33 | #define luaZ_sizebuffer(buff) ((buff)->buffsize)
34 | #define luaZ_bufflen(buff) ((buff)->n)
35 |
36 | #define luaZ_resetbuffer(buff) ((buff)->n = 0)
37 |
38 |
39 | #define luaZ_resizebuffer(L, buff, size) \
40 | (luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \
41 | (buff)->buffsize = size)
42 |
43 | #define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0)
44 |
45 |
46 | LUAI_FUNC char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n);
47 | LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader,
48 | void *data);
49 | LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */
50 | LUAI_FUNC int luaZ_lookahead (ZIO *z);
51 |
52 |
53 |
54 | /* --------- Private Part ------------------ */
55 |
56 | struct Zio {
57 | size_t n; /* bytes still unread */
58 | const char *p; /* current position in buffer */
59 | lua_Reader reader;
60 | void* data; /* additional data */
61 | lua_State *L; /* Lua state (for reader) */
62 | };
63 |
64 |
65 | LUAI_FUNC int luaZ_fill (ZIO *z);
66 |
67 | #endif
68 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/Win32_Interop/Win32_ThreadControl.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c), Microsoft Open Technologies, Inc.
3 | * All rights reserved.
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions are met:
6 | * - Redistributions of source code must retain the above copyright notice,
7 | * this list of conditions and the following disclaimer.
8 | * - Redistributions in binary form must reproduce the above copyright notice,
9 | * this list of conditions and the following disclaimer in the documentation
10 | * and/or other materials provided with the distribution.
11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
12 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
13 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
14 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
15 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
16 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
17 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
18 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
20 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 | */
22 |
23 | #pragma once
24 |
25 | #ifdef __cplusplus
26 | extern "C" {
27 | #endif
28 |
29 |
30 | void InitThreadControl();
31 | void IncrementWorkerThreadCount();
32 | void DecrementWorkerThreadCount();
33 | void RequestSuspension();
34 | BOOL SuspensionCompleted();
35 | void ResumeFromSuspension();
36 |
37 | void WorkerThread_EnterSafeMode();
38 | void WorkerThread_ExitSafeMode();
39 |
40 |
41 | #ifdef __cplusplus
42 | }
43 | #endif
44 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/rand.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009-2012, Salvatore Sanfilippo
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of Redis nor the names of its contributors may be used
14 | * to endorse or promote products derived from this software without
15 | * specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #ifndef REDIS_RANDOM_H
31 | #define REDIS_RANDOM_H
32 |
33 | int32_t redisLrand48();
34 | void redisSrand48(int32_t seedval);
35 |
36 | #define REDIS_LRAND48_MAX INT32_MAX
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/Win32_Interop/Win32_QFork_impl.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c), Microsoft Open Technologies, Inc.
3 | * All rights reserved.
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions are met:
6 | * - Redistributions of source code must retain the above copyright notice,
7 | * this list of conditions and the following disclaimer.
8 | * - Redistributions in binary form must reproduce the above copyright notice,
9 | * this list of conditions and the following disclaimer in the documentation
10 | * and/or other materials provided with the distribution.
11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
12 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
13 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
14 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
15 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
16 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
17 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
18 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
20 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 | */
22 |
23 | #pragma once
24 |
25 | #ifdef __cplusplus
26 | extern "C" {
27 | #endif
28 |
29 | void SetupRedisGlobals(LPVOID redisData, size_t redisDataSize, uint32_t dictHashKey);
30 | int do_rdbSave(char* filename);
31 | int do_aofSave(char* filename, int aof_pipe_read_ack, int aof_pipe_read_data, int aof_pipe_write_ack);
32 | int do_socketSave(int *fds, int numfds, uint64_t *clientids, int pipe_write_fd);
33 |
34 | #ifdef __cplusplus
35 | }
36 | #endif
37 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/Win32_Interop/Win32_Error.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c), Microsoft Open Technologies, Inc.
3 | * All rights reserved.
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions are met:
6 | * - Redistributions of source code must retain the above copyright notice,
7 | * this list of conditions and the following disclaimer.
8 | * - Redistributions in binary form must reproduce the above copyright notice,
9 | * this list of conditions and the following disclaimer in the documentation
10 | * and/or other materials provided with the distribution.
11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
12 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
13 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
14 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
15 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
16 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
17 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
18 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
20 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 | */
22 |
23 | #ifndef WIN32_INTEROP_ERROR_H
24 | #define WIN32_INTEROP_ERROR_H
25 |
26 | #include
27 |
28 | #ifdef __cplusplus
29 | extern "C"
30 | {
31 | #endif
32 |
33 | /* Converts error codes returned by GetLastError/WSAGetLastError to errno codes */
34 | int translate_sys_error(int sys_error);
35 | void set_errno_from_last_error();
36 |
37 | //int strerror_r(int err, char* buf, size_t buflen);
38 | char *wsa_strerror(int err);
39 |
40 | #ifdef __cplusplus
41 | }
42 | #endif
43 |
44 | #endif
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/deps/lua/src/ltm.c:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: ltm.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Tag methods
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 |
8 | #include
9 |
10 | #define ltm_c
11 | #define LUA_CORE
12 |
13 | #include "lua.h"
14 |
15 | #include "lobject.h"
16 | #include "lstate.h"
17 | #include "lstring.h"
18 | #include "ltable.h"
19 | #include "ltm.h"
20 |
21 |
22 |
23 | const char *const luaT_typenames[] = {
24 | "nil", "boolean", "userdata", "number",
25 | "string", "table", "function", "userdata", "thread",
26 | "proto", "upval"
27 | };
28 |
29 |
30 | void luaT_init (lua_State *L) {
31 | static const char *const luaT_eventname[] = { /* ORDER TM */
32 | "__index", "__newindex",
33 | "__gc", "__mode", "__eq",
34 | "__add", "__sub", "__mul", "__div", "__mod",
35 | "__pow", "__unm", "__len", "__lt", "__le",
36 | "__concat", "__call"
37 | };
38 | int i;
39 | for (i=0; itmname[i] = luaS_new(L, luaT_eventname[i]);
41 | luaS_fix(G(L)->tmname[i]); /* never collect these names */
42 | }
43 | }
44 |
45 |
46 | /*
47 | ** function to be used with macro "fasttm": optimized for absence of
48 | ** tag methods
49 | */
50 | const TValue *luaT_gettm (Table *events, TMS event, TString *ename) {
51 | const TValue *tm = luaH_getstr(events, ename);
52 | lua_assert(event <= TM_EQ);
53 | if (ttisnil(tm)) { /* no tag method? */
54 | events->flags |= cast_byte(1u<metatable;
66 | break;
67 | case LUA_TUSERDATA:
68 | mt = uvalue(o)->metatable;
69 | break;
70 | default:
71 | mt = G(L)->mt[ttype(o)];
72 | }
73 | return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject);
74 | }
75 |
76 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/deps/lua/src/lzio.c:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lzio.c,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** a generic input stream interface
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 |
8 | #include
9 |
10 | #define lzio_c
11 | #define LUA_CORE
12 |
13 | #include "lua.h"
14 |
15 | #include "llimits.h"
16 | #include "lmem.h"
17 | #include "lstate.h"
18 | #include "lzio.h"
19 |
20 |
21 | int luaZ_fill (ZIO *z) {
22 | size_t size;
23 | lua_State *L = z->L;
24 | const char *buff;
25 | lua_unlock(L);
26 | buff = z->reader(L, z->data, &size);
27 | lua_lock(L);
28 | if (buff == NULL || size == 0) return EOZ;
29 | z->n = size - 1;
30 | z->p = buff;
31 | return char2int(*(z->p++));
32 | }
33 |
34 |
35 | int luaZ_lookahead (ZIO *z) {
36 | if (z->n == 0) {
37 | if (luaZ_fill(z) == EOZ)
38 | return EOZ;
39 | else {
40 | z->n++; /* luaZ_fill removed first byte; put back it */
41 | z->p--;
42 | }
43 | }
44 | return char2int(*z->p);
45 | }
46 |
47 |
48 | void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data) {
49 | z->L = L;
50 | z->reader = reader;
51 | z->data = data;
52 | z->n = 0;
53 | z->p = NULL;
54 | }
55 |
56 |
57 | /* --------------------------------------------------------------- read --- */
58 | size_t luaZ_read (ZIO *z, void *b, size_t n) {
59 | while (n) {
60 | size_t m;
61 | if (luaZ_lookahead(z) == EOZ)
62 | return n; /* return number of missing bytes */
63 | m = (n <= z->n) ? n : z->n; /* min. between n and z->n */
64 | memcpy(b, z->p, m);
65 | z->n -= m;
66 | z->p += m;
67 | b = (char *)b + m;
68 | n -= m;
69 | }
70 | return 0;
71 | }
72 |
73 | /* ------------------------------------------------------------------------ */
74 | char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n) {
75 | if (n > buff->buffsize) {
76 | if (n < LUA_MINBUFFER) n = LUA_MINBUFFER;
77 | luaZ_resizebuffer(L, buff, n);
78 | }
79 | return buff->buffer;
80 | }
81 |
82 |
83 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/Win32_Interop/Win32_ANSI.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c), Microsoft Open Technologies, Inc.
3 | * All rights reserved.
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions are met:
6 | * - Redistributions of source code must retain the above copyright notice,
7 | * this list of conditions and the following disclaimer.
8 | * - Redistributions in binary form must reproduce the above copyright notice,
9 | * this list of conditions and the following disclaimer in the documentation
10 | * and/or other materials provided with the distribution.
11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
12 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
13 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
14 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
15 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
16 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
17 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
18 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
20 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 | */
22 |
23 |
24 | #ifndef WIN32_INTEROPA_ANSI_H
25 | #define WIN32_INTEROPA_ANSI_H
26 |
27 | #include
28 |
29 | #ifdef __cplusplus
30 | extern "C" {
31 | #endif
32 |
33 | BOOL ParseAndPrintANSIString(HANDLE hDev, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten);
34 | void ANSI_printf(char *format, ...);
35 |
36 | // include this file after stdio.h in order to redirect printf to the one that supports ANSI escape sequences
37 | #define printf ANSI_printf
38 |
39 | #ifdef __cplusplus
40 | }
41 | #endif
42 |
43 | #endif
44 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/Win32_Interop/Win32_Time.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c), Microsoft Open Technologies, Inc.
3 | * All rights reserved.
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions are met:
6 | * - Redistributions of source code must retain the above copyright notice,
7 | * this list of conditions and the following disclaimer.
8 | * - Redistributions in binary form must reproduce the above copyright notice,
9 | * this list of conditions and the following disclaimer in the documentation
10 | * and/or other materials provided with the distribution.
11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
12 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
13 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
14 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
15 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
16 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
17 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
18 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
20 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 | */
22 |
23 | /* Credits Henry Rawas (henryr@schakra.com) */
24 |
25 | #ifndef WIN32_INTEROP_TIME_H
26 | #define WIN32_INTEROP_TIME_H
27 |
28 | #if (_MSC_VER > 1800)
29 | #include
30 | #endif
31 | #include
32 |
33 | #define gettimeofday gettimeofday_highres
34 |
35 | void InitTimeFunctions();
36 | uint64_t GetHighResRelativeTime(double scale);
37 | time_t gettimeofdaysecs(unsigned int *usec);
38 | int gettimeofday_highres(struct timeval *tv, struct timezone *tz);
39 | char* ctime_r(const time_t *clock, char *buf);
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/Win32_Interop/win32fixes.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Modified by Henry Rawas (henryr@schakra.com)
3 | * - make it compatible with Visual Studio builds
4 | * - added wstrtod to handle INF, NAN
5 | * - added gettimeofday routine
6 | * - modified rename to retry after failure
7 | */
8 |
9 | #include
10 | #include
11 | #include
12 | #include
13 | #if _MSC_VER < 1800
14 | #define isnan _isnan
15 | #define isfinite _finite
16 | #define isinf(x) (!_finite(x))
17 | #else
18 | #include
19 | #endif
20 |
21 | static _locale_t clocale = NULL;
22 | double wstrtod(const char *nptr, char **eptr) {
23 | double d;
24 | char *leptr;
25 | if (clocale == NULL) {
26 | clocale = _create_locale(LC_ALL, "C");
27 | }
28 | d = _strtod_l(nptr, &leptr, clocale);
29 | /* if 0, check if input was inf */
30 | if (d == 0 && nptr == leptr) {
31 | int neg = 0;
32 | while (isspace(*nptr)) {
33 | nptr++;
34 | }
35 | if (*nptr == '+') {
36 | nptr++;
37 | } else if (*nptr == '-') {
38 | nptr++;
39 | neg = 1;
40 | }
41 |
42 | if (_strnicmp("INF", nptr, 3) == 0) {
43 | if (eptr != NULL) {
44 | if ((_strnicmp("INFINITE", nptr, 8) == 0) || (_strnicmp("INFINITY", nptr, 8) == 0)) {
45 | *eptr = (char*) (nptr + 8);
46 | } else {
47 | *eptr = (char*) (nptr + 3);
48 | }
49 | }
50 | if (neg == 1) {
51 | return -HUGE_VAL;
52 | } else {
53 | return HUGE_VAL;
54 | }
55 | } else if (_strnicmp("NAN", nptr, 3) == 0) {
56 | if (eptr != NULL) {
57 | *eptr = (char*) (nptr + 3);
58 | }
59 | /* create a NaN : 0 * infinity*/
60 | d = HUGE_VAL;
61 | return d * 0;
62 | }
63 | }
64 | if (eptr != NULL) {
65 | *eptr = leptr;
66 | }
67 | return d;
68 | }
69 |
70 |
71 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/pqsort.h:
--------------------------------------------------------------------------------
1 | /* The following is the NetBSD libc qsort implementation modified in order to
2 | * support partial sorting of ranges for Redis.
3 | *
4 | * Copyright (c) 2009-2012, Salvatore Sanfilippo
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are met:
9 | *
10 | * * Redistributions of source code must retain the above copyright notice,
11 | * this list of conditions and the following disclaimer.
12 | * * Redistributions in binary form must reproduce the above copyright
13 | * notice, this list of conditions and the following disclaimer in the
14 | * documentation and/or other materials provided with the distribution.
15 | * * Neither the name of Redis nor the names of its contributors may be used
16 | * to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | *
31 | * See the pqsort.c file for the original copyright notice. */
32 |
33 | #ifndef __PQSORT_H
34 | #define __PQSORT_H
35 |
36 | void
37 | pqsort(void *a, size_t n, size_t es,
38 | int (*cmp) (const void *, const void *), size_t lrange, size_t rrange);
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/deps/lua/src/ldo.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: ldo.h,v 2.7.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Stack and Call structure of Lua
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef ldo_h
8 | #define ldo_h
9 |
10 |
11 | #include "lobject.h"
12 | #include "lstate.h"
13 | #include "lzio.h"
14 |
15 |
16 | #define luaD_checkstack(L,n) \
17 | if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \
18 | luaD_growstack(L, n); \
19 | else condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1));
20 |
21 |
22 | #define incr_top(L) {luaD_checkstack(L,1); L->top++;}
23 |
24 | #define savestack(L,p) ((char *)(p) - (char *)L->stack)
25 | #define restorestack(L,n) ((TValue *)((char *)L->stack + (n)))
26 |
27 | #define saveci(L,p) ((char *)(p) - (char *)L->base_ci)
28 | #define restoreci(L,n) ((CallInfo *)((char *)L->base_ci + (n)))
29 |
30 |
31 | /* results from luaD_precall */
32 | #define PCRLUA 0 /* initiated a call to a Lua function */
33 | #define PCRC 1 /* did a call to a C function */
34 | #define PCRYIELD 2 /* C funtion yielded */
35 |
36 |
37 | /* type of protected functions, to be ran by `runprotected' */
38 | typedef void (*Pfunc) (lua_State *L, void *ud);
39 |
40 | LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name);
41 | LUAI_FUNC void luaD_callhook (lua_State *L, int event, int line);
42 | LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults);
43 | LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults);
44 | LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u,
45 | ptrdiff_t oldtop, ptrdiff_t ef);
46 | LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult);
47 | LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize);
48 | LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
49 | LUAI_FUNC void luaD_growstack (lua_State *L, int n);
50 |
51 | LUAI_FUNC void luaD_throw (lua_State *L, int errcode);
52 | LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud);
53 |
54 | LUAI_FUNC void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop);
55 |
56 | #endif
57 |
58 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/bio.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009-2012, Salvatore Sanfilippo
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of Redis nor the names of its contributors may be used
14 | * to endorse or promote products derived from this software without
15 | * specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | /* Exported API */
31 | void bioInit(void);
32 | void bioCreateBackgroundJob(int type, void *arg1, void *arg2, void *arg3);
33 | PORT_ULONGLONG bioPendingJobsOfType(int type);
34 | void bioWaitPendingJobsLE(int type, PORT_ULONGLONG num);
35 | time_t bioOlderJobOfType(int type);
36 | void bioKillThreads(void);
37 |
38 | /* Background job opcodes */
39 | #define BIO_CLOSE_FILE 0 /* Deferred close(2) syscall. */
40 | #define BIO_AOF_FSYNC 1 /* Deferred AOF fsync. */
41 | #define BIO_NUM_OPS 2
42 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/Win32_Interop/Win32_fdapi_crt.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c), Microsoft Open Technologies, Inc.
3 | * All rights reserved.
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions are met:
6 | * - Redistributions of source code must retain the above copyright notice,
7 | * this list of conditions and the following disclaimer.
8 | * - Redistributions in binary form must reproduce the above copyright notice,
9 | * this list of conditions and the following disclaimer in the documentation
10 | * and/or other materials provided with the distribution.
11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
12 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
13 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
14 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
15 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
16 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
17 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
18 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
20 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 | */
22 |
23 | #pragma once
24 |
25 | #include
26 | #include
27 |
28 | int crt_pipe(int *pfds, unsigned int psize, int textmode);
29 | int crt_close(int fd);
30 | int crt_read(int fd, void *buffer, unsigned int count);
31 | int crt_write(int fd, const void *buffer, unsigned int count);
32 | int crt_open(const char *filename, int oflag, int pmode);
33 | int crt_open_osfhandle(intptr_t osfhandle, int flags);
34 | intptr_t crt_get_osfhandle(int fd);
35 | int crt_setmode(int fd, int mode);
36 | size_t crt_fwrite(const void *buffer, size_t size, size_t count, FILE *file);
37 | int crt_fclose(FILE* file);
38 | int crt_fileno(FILE* file);
39 | int crt_isatty(int fd);
40 | int crt_access(const char *pathname, int mode);
41 | __int64 crt_lseek64(int fd, __int64 offset, int origin);
42 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/sdsalloc.h:
--------------------------------------------------------------------------------
1 | /* SDSLib 2.0 -- A C dynamic strings library
2 | *
3 | * Copyright (c) 2006-2015, Salvatore Sanfilippo
4 | * Copyright (c) 2015, Redis Labs, Inc
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are met:
9 | *
10 | * * Redistributions of source code must retain the above copyright notice,
11 | * this list of conditions and the following disclaimer.
12 | * * Redistributions in binary form must reproduce the above copyright
13 | * notice, this list of conditions and the following disclaimer in the
14 | * documentation and/or other materials provided with the distribution.
15 | * * Neither the name of Redis nor the names of its contributors may be used
16 | * to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | /* SDS allocator selection.
33 | *
34 | * This file is used in order to change the SDS allocator at compile time.
35 | * Just define the following defines to what you want to use. Also add
36 | * the include of your alternate allocator if needed (not needed in order
37 | * to use the default libc allocator). */
38 |
39 | #include "zmalloc.h"
40 | #define s_malloc zmalloc
41 | #define s_realloc zrealloc
42 | #define s_free zfree
43 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/sdsalloc.h:
--------------------------------------------------------------------------------
1 | /* SDSLib 2.0 -- A C dynamic strings library
2 | *
3 | * Copyright (c) 2006-2015, Salvatore Sanfilippo
4 | * Copyright (c) 2015, Redis Labs, Inc
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are met:
9 | *
10 | * * Redistributions of source code must retain the above copyright notice,
11 | * this list of conditions and the following disclaimer.
12 | * * Redistributions in binary form must reproduce the above copyright
13 | * notice, this list of conditions and the following disclaimer in the
14 | * documentation and/or other materials provided with the distribution.
15 | * * Neither the name of Redis nor the names of its contributors may be used
16 | * to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | /* SDS allocator selection.
33 | *
34 | * This file is used in order to change the SDS allocator at compile time.
35 | * Just define the following defines to what you want to use. Also add
36 | * the include of your alternate allocator if needed (not needed in order
37 | * to use the default libc allocator). */
38 |
39 | #include "zmalloc.h"
40 | #define s_malloc zmalloc
41 | #define s_realloc zrealloc
42 | #define s_free zfree
43 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/Win32_Interop/Win32_RedisLog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c), Microsoft Open Technologies, Inc.
3 | * All rights reserved.
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions are met:
6 | * - Redistributions of source code must retain the above copyright notice,
7 | * this list of conditions and the following disclaimer.
8 | * - Redistributions in binary form must reproduce the above copyright notice,
9 | * this list of conditions and the following disclaimer in the documentation
10 | * and/or other materials provided with the distribution.
11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
12 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
13 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
14 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
15 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
16 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
17 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
18 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
20 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 | */
22 | #pragma once
23 |
24 | /* Log levels */
25 | #define LL_DEBUG 0
26 | #define LL_VERBOSE 1
27 | #define LL_NOTICE 2
28 | #define LL_WARNING 3
29 | #define LL_RAW (1<<10) /* Modifier to log without timestamp */
30 | #define CONFIG_DEFAULT_VERBOSITY LL_NOTICE
31 | /*
32 | * Default maximum length of syslog messages.
33 | * Empirical results show that 1024 is also the maximum size that WriteFile can
34 | * write atomically.
35 | */
36 | #define LOG_MAX_LEN 1024
37 |
38 | #ifdef __cplusplus
39 | extern "C" {
40 | #endif
41 |
42 | void setLogVerbosityLevel(int level);
43 | void setLogFile(const char* filename);
44 | const char* getLogFilename();
45 | void serverLogRaw(int level, const char *msg);
46 | void serverLog(int level, const char *fmt, ...);
47 | void serverLogFromHandler(int level, const char *msg);
48 |
49 | #ifdef __cplusplus
50 | }
51 | #endif
52 |
53 |
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/Win32_Interop/win32_wsiocp2.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c), Microsoft Open Technologies, Inc.
3 | * All rights reserved.
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions are met:
6 | * - Redistributions of source code must retain the above copyright notice,
7 | * this list of conditions and the following disclaimer.
8 | * - Redistributions in binary form must reproduce the above copyright notice,
9 | * this list of conditions and the following disclaimer in the documentation
10 | * and/or other materials provided with the distribution.
11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
12 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
13 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
14 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
15 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
16 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
17 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
18 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
20 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 | */
22 |
23 | #ifndef WIN32_INTEROP_WSIOCP2_H
24 | #define WIN32_INTEROP_WSIOCP2_H
25 |
26 | #include // For SOCKADDR_STORAGE
27 | #include "WS2tcpip.h" // For socklen_t
28 |
29 | /* need callback on write complete. WSIOCP_Request is used to pass parameters */
30 | typedef struct WSIOCP_Request {
31 | void *client;
32 | void *data;
33 | char *buf;
34 | int len;
35 | } WSIOCP_Request;
36 |
37 | int WSIOCP_QueueNextRead(int rfd);
38 | int WSIOCP_SocketSend(int rfd, char *buf, int len, void *eventLoop, void *client, void *data, void *proc);
39 | int WSIOCP_Listen(int rfd, int backlog);
40 | int WSIOCP_Accept(int rfd, struct sockaddr *sa, socklen_t *len);
41 | int WSIOCP_SocketConnect(int rfd, const SOCKADDR_STORAGE *ss);
42 | int WSIOCP_SocketConnectBind(int rfd, const SOCKADDR_STORAGE *ss, const char* source_addr);
43 |
44 | #endif
--------------------------------------------------------------------------------
/mt5/source/hiredis/hiredis/src/Win32_Interop/Win32_variadicFunctor.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c), Microsoft Open Technologies, Inc.
3 | * All rights reserved.
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions are met:
6 | * - Redistributions of source code must retain the above copyright notice,
7 | * this list of conditions and the following disclaimer.
8 | * - Redistributions in binary form must reproduce the above copyright notice,
9 | * this list of conditions and the following disclaimer in the documentation
10 | * and/or other materials provided with the distribution.
11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
12 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
13 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
14 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
15 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
16 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
17 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
18 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
20 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 | */
22 | #pragma once
23 |
24 | #include
25 | #include
26 | #include