mirror of
https://github.com/mirror/tinycc.git
synced 2025-02-04 06:30:10 +08:00
Remove misc. files
- from win32/include/winapi: various .h The winapi header set cannot be complete no matter what. So lets have just the minimal set necessary to compile the examples. - remove CMake support (hard to keep up to date) - some other files Also, drop useless changes in win32/lib/(win)crt1.c
This commit is contained in:
parent
766ba3694d
commit
8637c1d0ad
@ -1 +0,0 @@
|
||||
language: c
|
293
CMakeLists.txt
293
CMakeLists.txt
@ -1,293 +0,0 @@
|
||||
project(tcc C)
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
enable_testing()
|
||||
|
||||
# Detect native platform
|
||||
if(WIN32)
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM")
|
||||
set(TCC_NATIVE_TARGET "WinCE")
|
||||
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(TCC_NATIVE_TARGET "Win64")
|
||||
else()
|
||||
set(TCC_NATIVE_TARGET "Win32")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
|
||||
set(TCC_NATIVE_TARGET "ARM")
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^armv5")
|
||||
set(TCC_ARM_VERSION_DEFAULT 5)
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^armv6")
|
||||
set(TCC_ARM_VERSION_DEFAULT 6)
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^armv7")
|
||||
set(TCC_ARM_VERSION_DEFAULT 7)
|
||||
else()
|
||||
set(TCC_ARM_VERSION_DEFAULT 4)
|
||||
endif()
|
||||
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(TCC_NATIVE_TARGET "x86_64")
|
||||
set(TCC_ARCH_DIR "x86_64-linux-gnu")
|
||||
else()
|
||||
set(TCC_NATIVE_TARGET "i386")
|
||||
set(TCC_ARCH_DIR "i386-linux-gnu")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(EXE_PATH ".")
|
||||
set(TCC_LIB_PATH lib)
|
||||
set(NATIVE_LIB_PATH)
|
||||
set(DOC_PATH doc)
|
||||
else()
|
||||
set(EXE_PATH bin)
|
||||
set(TCC_LIB_PATH lib/tcc)
|
||||
set(NATIVE_LIB_PATH lib)
|
||||
set(DOC_PATH share/doc/tcc)
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
if(EXISTS /usr/lib/${TCC_ARCH_DIR}/crti.o)
|
||||
set(CONFIG_LDDIR lib/${TCC_ARCH_DIR})
|
||||
set(CONFIG_MULTIARCHDIR ${TCC_ARCH_DIR})
|
||||
elseif(EXISTS /usr/lib64/crti.o)
|
||||
set(CONFIG_LDDIR lib64)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Use two variables to keep CMake configuration variable names consistent
|
||||
set(TCC_BCHECK OFF CACHE BOOL "Enable bounds checking")
|
||||
set(CONFIG_TCC_BCHECK ${TCC_BCHECK})
|
||||
set(TCC_ASSERT OFF CACHE BOOL "Enable assertions")
|
||||
set(CONFIG_TCC_ASSERT ${TCC_ASSERT})
|
||||
|
||||
set(TCC_BUILD_NATIVE ON CACHE BOOL "Build native compiler")
|
||||
set(TCC_BUILD_I386 OFF CACHE BOOL "Build i386 cross compiler")
|
||||
set(TCC_BUILD_X64 OFF CACHE BOOL "Build x86-64 cross compiler")
|
||||
set(TCC_BUILD_WIN32 OFF CACHE BOOL "Build Windows i386 cross compiler")
|
||||
set(TCC_BUILD_WIN64 OFF CACHE BOOL "Build Windows x86-64 cross compiler")
|
||||
set(TCC_BUILD_WINCE OFF CACHE BOOL "Build Windows CE cross compiler")
|
||||
set(TCC_BUILD_ARM_FPA OFF CACHE BOOL "Build arm-fpa cross compiler")
|
||||
set(TCC_BUILD_ARM_FPA_LD OFF CACHE BOOL "Build arm-fpa-ld cross compiler")
|
||||
set(TCC_BUILD_ARM_VFP OFF CACHE BOOL "Build arm-vfp cross compiler")
|
||||
set(TCC_BUILD_ARM_EABI OFF CACHE BOOL "Build ARM EABI cross compiler")
|
||||
set(TCC_BUILD_ARM_EABIHF OFF CACHE BOOL "Build ARM EABI hardware float cross compiler")
|
||||
set(TCC_BUILD_ARM OFF CACHE BOOL "Build ARM cross compiler")
|
||||
set(TCC_BUILD_C67 OFF CACHE BOOL "Build C67 cross compiler")
|
||||
|
||||
set(TCC_ARM_VERSION ${TCC_ARM_VERSION_DEFAULT} CACHE STRING "ARM target CPU version")
|
||||
set_property(CACHE TCC_ARM_VERSION PROPERTY STRINGS 4 5 6 7)
|
||||
|
||||
if(WIN32)
|
||||
set(CONFIG_TCCDIR ${CMAKE_INSTALL_PREFIX})
|
||||
else()
|
||||
set(CONFIG_TCCDIR ${CMAKE_INSTALL_PREFIX}/lib/tcc)
|
||||
endif()
|
||||
|
||||
file(STRINGS "VERSION" TCC_VERSION)
|
||||
list(GET TCC_VERSION 0 TCC_VERSION)
|
||||
include_directories(${CMAKE_BINARY_DIR})
|
||||
configure_file(config.h.in config.h)
|
||||
configure_file(config.texi.in config.texi)
|
||||
|
||||
# Utility variables
|
||||
set(I386_SOURCES i386-gen.c i386-asm.c i386-asm.h i386-tok.h)
|
||||
set(X86_64_SOURCES x86_64-gen.c i386-asm.c x86_64-asm.h)
|
||||
set(ARM_SOURCES arm_gen.c)
|
||||
|
||||
set(LIBTCC1_I386_SOURCES lib/alloca86.S lib/alloca86-bt.S)
|
||||
set(LIBTCC1_WIN_SOURCES win32/lib/crt1.c win32/lib/wincrt1.c win32/lib/dllcrt1.c win32/lib/dllmain.c win32/lib/chkstk.S)
|
||||
if(NOT WIN32)
|
||||
set(LIBTCC1_I386_SOURCES ${LIBTCC1_I386_SOURCES} lib/bcheck.c)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
add_executable(tiny_impdef win32/tools/tiny_impdef.c)
|
||||
endif()
|
||||
add_executable(tiny_libmaker_32 win32/tools/tiny_libmaker.c)
|
||||
set_target_properties(tiny_libmaker_32 PROPERTIES COMPILE_DEFINITIONS TCC_TARGET_I386)
|
||||
add_executable(tiny_libmaker_64 win32/tools/tiny_libmaker.c)
|
||||
set_target_properties(tiny_libmaker_64 PROPERTIES COMPILE_DEFINITIONS TCC_TARGET_X86_64)
|
||||
|
||||
macro(make_libtcc1 prefix xcc xar defs includes sources)
|
||||
set(libtcc1_prefix)
|
||||
if("${prefix}" STRGREATER "")
|
||||
set(libtcc1_prefix ${prefix}-)
|
||||
endif()
|
||||
set(libtcc1_flags -I${CMAKE_SOURCE_DIR}/include)
|
||||
foreach(i ${defs})
|
||||
set(libtcc1_flags ${libtcc1_flags} -D${i})
|
||||
endforeach()
|
||||
foreach(i ${includes})
|
||||
set(libtcc1_flags ${libtcc1_flags} -I${CMAKE_SOURCE_DIR}/${i})
|
||||
endforeach()
|
||||
set(libtcc1_objects)
|
||||
foreach(libtcc1_c lib/libtcc1.c ${sources})
|
||||
string(REGEX MATCH "[^/]+$" libtcc1_o ${libtcc1_c})
|
||||
string(REGEX MATCH "^[^.]+" libtcc1_o ${libtcc1_o})
|
||||
set(libtcc1_o ${libtcc1_prefix}${libtcc1_o}.o)
|
||||
add_custom_command(OUTPUT ${libtcc1_o}
|
||||
COMMAND ${xcc} ${libtcc1_flags} -c ${CMAKE_SOURCE_DIR}/${libtcc1_c} -o ${libtcc1_o}
|
||||
DEPENDS ${xcc} ${CMAKE_SOURCE_DIR}/${libtcc1_c}
|
||||
)
|
||||
list(APPEND libtcc1_objects ${libtcc1_o})
|
||||
endforeach()
|
||||
add_custom_command(OUTPUT ${libtcc1_prefix}libtcc1.a
|
||||
COMMAND ${xar} ${libtcc1_prefix}libtcc1.a ${libtcc1_objects}
|
||||
DEPENDS ${xar} ${libtcc1_objects}
|
||||
)
|
||||
add_custom_target(${libtcc1_prefix}libtcc1 ALL DEPENDS ${libtcc1_prefix}libtcc1.a)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${libtcc1_prefix}libtcc1.a
|
||||
DESTINATION ${TCC_LIB_PATH}/${prefix} RENAME libtcc1.a)
|
||||
endmacro()
|
||||
|
||||
macro(make_tcc native_name cross_name cross_enabled definitions tcc_sources libtcc_ar libtcc_sources libtcc_includes)
|
||||
if (xx${native_name} STREQUAL xx${TCC_NATIVE_TARGET})
|
||||
set(TCC_NATIVE_DEFINITIONS ${definitions})
|
||||
if("${CONFIG_MULTIARCHDIR}" STRGREATER "")
|
||||
set(TCC_NATIVE_DEFINITIONS ${TCC_NATIVE_DEFINITIONS} CONFIG_MULTIARCHDIR="${CONFIG_MULTIARCHDIR}")
|
||||
endif()
|
||||
if("${CONFIG_LDDIR}" STRGREATER "")
|
||||
set(TCC_NATIVE_DEFINITIONS ${TCC_NATIVE_DEFINITIONS} CONFIG_LDDIR="${CONFIG_LDDIR}")
|
||||
endif()
|
||||
|
||||
set(TCC_NATIVE_FLAGS)
|
||||
foreach(make_tcc_def ${TCC_NATIVE_DEFINITIONS})
|
||||
set(TCC_NATIVE_FLAGS ${TCC_NATIVE_FLAGS} -D${make_tcc_def})
|
||||
endforeach()
|
||||
|
||||
if (TCC_BUILD_NATIVE)
|
||||
add_library(libtcc
|
||||
libtcc.c
|
||||
tccpp.c
|
||||
tccgen.c
|
||||
tccelf.c
|
||||
tccasm.c
|
||||
tccrun.c
|
||||
tcc.h
|
||||
libtcc.h
|
||||
tcctok.h
|
||||
${tcc_sources}
|
||||
)
|
||||
set_target_properties(libtcc PROPERTIES OUTPUT_NAME tcc PREFIX lib)
|
||||
if(WIN32)
|
||||
set_target_properties(libtcc PROPERTIES LINK_FLAGS "-Wl,--output-def,libtcc.def")
|
||||
endif()
|
||||
add_executable(tcc tcc.c)
|
||||
target_link_libraries(tcc libtcc)
|
||||
if(NOT WIN32)
|
||||
target_link_libraries(tcc dl)
|
||||
endif()
|
||||
install(TARGETS tcc libtcc RUNTIME DESTINATION ${EXE_PATH} LIBRARY DESTINATION ${NATIVE_LIB_PATH} ARCHIVE DESTINATION ${NATIVE_LIB_PATH})
|
||||
set_target_properties(tcc libtcc PROPERTIES COMPILE_DEFINITIONS "${TCC_NATIVE_DEFINITIONS}")
|
||||
|
||||
if("${libtcc_sources}" STRGREATER "")
|
||||
make_libtcc1("" tcc "${libtcc_ar}" "${TCC_NATIVE_DEFINITIONS}" "${libtcc_includes}" "${libtcc_sources}")
|
||||
endif()
|
||||
endif()
|
||||
elseif(${cross_enabled})
|
||||
add_executable(${cross_name}-tcc tcc.c)
|
||||
set_target_properties(${cross_name}-tcc PROPERTIES COMPILE_DEFINITIONS "ONE_SOURCE;${definitions}")
|
||||
install(TARGETS ${cross_name}-tcc RUNTIME DESTINATION ${EXE_PATH})
|
||||
|
||||
if("${libtcc_sources}" STRGREATER "")
|
||||
make_libtcc1(${cross_name} "${cross_name}-tcc" "${libtcc_ar}" "${definitions}" "${libtcc_includes}" "${libtcc_sources}")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
make_tcc("Win32" i386-w64-mingw32 TCC_BUILD_WIN32
|
||||
"TCC_TARGET_I386;TCC_TARGET_PE"
|
||||
"${I386_SOURCES};tccpe.c"
|
||||
tiny_libmaker_32 "${LIBTCC1_I386_SOURCES};${LIBTCC1_WIN_SOURCES}" "win32/include;win32/include/winapi"
|
||||
)
|
||||
make_tcc("Win64" x86_64-w64-mingw32 TCC_BUILD_WIN64
|
||||
"TCC_TARGET_X86_64;TCC_TARGET_PE"
|
||||
"${X86_64_SOURCES};tccpe.c"
|
||||
tiny_libmaker_64 "lib/alloca86_64.S;${LIBTCC1_WIN_SOURCES}" "win32/include;win32/include/winapi"
|
||||
)
|
||||
make_tcc("WinCE" arm-wince-mingw32ce TCC_BUILD_WINCE
|
||||
"TCC_TARGET_ARM;TCC_ARM_VERSION=${TCC_ARM_VERSION};TCC_TARGET_PE"
|
||||
"${ARM_SOURCES};tccpe.c"
|
||||
"" "" ""
|
||||
)
|
||||
make_tcc("i386" i386-linux-gnu TCC_BUILD_I386
|
||||
TCC_TARGET_I386
|
||||
"${I386_SOURCES}"
|
||||
tiny_libmaker_32 "${LIBTCC1_I386_SOURCES}" ""
|
||||
)
|
||||
make_tcc("x86_64" x86_64-linux-gnu TCC_BUILD_X64
|
||||
TCC_TARGET_X86_64
|
||||
"${X86_64_SOURCES}"
|
||||
tiny_libmaker_64 "lib/alloca86_64.S" ""
|
||||
)
|
||||
set(ARM_DEFINITIONS TCC_TARGET_ARM TCC_ARM_VERSION=${TCC_ARM_VERSION})
|
||||
make_tcc("" arm-linux-gnueabihf TCC_BUILD_ARM_EABIHF
|
||||
"${ARM_DEFINITIONS};TCC_ARM_EABI;TCC_ARM_HARDFLOAT"
|
||||
"${ARM_SOURCES}"
|
||||
"" "" ""
|
||||
)
|
||||
make_tcc("" arm-linux-gnueabi TCC_BUILD_ARM_EABI
|
||||
"${ARM_DEFINITIONS};TCC_ARM_EABI"
|
||||
"${ARM_SOURCES}"
|
||||
"" "" ""
|
||||
)
|
||||
make_tcc("" arm-linux-fpa TCC_BUILD_ARM_FPA
|
||||
"${ARM_DEFINITIONS}"
|
||||
"${ARM_SOURCES}"
|
||||
"" "" ""
|
||||
)
|
||||
make_tcc("" arm-linux-fpa-ld TCC_BUILD_ARM_FPA_LD
|
||||
"${ARM_DEFINITIONS};LDOUBLE_SIZE=12"
|
||||
"${ARM_SOURCES}"
|
||||
"" "" ""
|
||||
)
|
||||
make_tcc("" arm-linux-gnu TCC_BUILD_ARM_VFP
|
||||
"${ARM_DEFINITIONS};TCC_ARM_VFP"
|
||||
"${ARM_SOURCES}"
|
||||
"" "" ""
|
||||
)
|
||||
make_tcc("" c67 TCC_BUILD_C67
|
||||
TCC_TARGET_C67
|
||||
"c67-gen.c;tcccoff.c"
|
||||
"" "" ""
|
||||
)
|
||||
|
||||
add_subdirectory(tests)
|
||||
|
||||
find_program(MAKEINFO NAMES makeinfo PATHS C:/MinGW/MSYS/1.0/bin)
|
||||
if(MAKEINFO)
|
||||
add_custom_command(OUTPUT tcc-doc.html
|
||||
COMMAND ${MAKEINFO} --no-split --html -o tcc-doc.html ${CMAKE_CURRENT_SOURCE_DIR}/tcc-doc.texi
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tcc-doc.texi
|
||||
)
|
||||
set(TCC_DOC_FILES tcc-doc.html)
|
||||
if(NOT WIN32)
|
||||
add_custom_command(OUTPUT tcc-doc.info
|
||||
COMMAND ${MAKEINFO} -o tcc-doc.info ${CMAKE_CURRENT_SOURCE_DIR}/tcc-doc.texi
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tcc-doc.texi
|
||||
)
|
||||
set(TCC_DOC_FILES ${TCC_DOC_FILES} tcc-doc.info)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tcc-doc.info DESTINATION share/info)
|
||||
endif()
|
||||
add_custom_target(tcc-doc ALL DEPENDS ${TCC_DOC_FILES})
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tcc-doc.html DESTINATION ${DOC_PATH})
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
file(GLOB WIN32_DEFS win32/lib/*.def)
|
||||
install(FILES ${WIN32_DEFS} DESTINATION lib)
|
||||
install(FILES tcclib.h DESTINATION include)
|
||||
install(DIRECTORY include/ DESTINATION include)
|
||||
install(DIRECTORY win32/include/ DESTINATION include)
|
||||
install(DIRECTORY win32/examples/ DESTINATION examples)
|
||||
install(FILES win32/tcc-win32.txt DESTINATION doc)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/libtcc.def DESTINATION libtcc)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/libtcc.dll.a DESTINATION libtcc RENAME libtcc.a)
|
||||
install(FILES libtcc.h DESTINATION libtcc)
|
||||
else()
|
||||
install(FILES libtcc.h tcclib.h DESTINATION include)
|
||||
install(DIRECTORY include/ DESTINATION lib/tcc/include)
|
||||
install(DIRECTORY win32/include/ DESTINATION lib/tcc/win32/include)
|
||||
install(DIRECTORY include/ DESTINATION lib/tcc/win32/include)
|
||||
endif()
|
||||
|
125
README.md
125
README.md
@ -1,125 +0,0 @@
|
||||
**TinyCC** (or tcc) is short for Tiny C Compiler.
|
||||
|
||||
This a clone of the mob development repo at http://repo.or.cz/tinycc.git
|
||||
|
||||
|Branch |Status |
|
||||
|------------|---------|
|
||||
|mob | [![Build Status](https://travis-ci.org/wqweto/tinycc.svg?branch=mob)](https://travis-ci.org/wqweto/tinycc) |
|
||||
|dev | [![Build Status](https://travis-ci.org/wqweto/tinycc.svg?branch=dev)](https://travis-ci.org/wqweto/tinycc) |
|
||||
|
||||
### License
|
||||
|
||||
Tiny C Compiler project is licensed under [LGPL](https://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License) but currently there is an effort to relicense the project under [MIT License](https://en.wikipedia.org/wiki/MIT_License). See RELICENSING file in root for current status.
|
||||
|
||||
### Branch Policy
|
||||
|
||||
The "dev" branch is the one where all contributions will be merged before reaching "mob". If you plan to propose a patch, please commit into the "dev" branch or its own feature branch. Direct commit to "mob" are not permitted.
|
||||
|
||||
### Original Fabrice Bellard readme
|
||||
|
||||
```
|
||||
Tiny C Compiler - C Scripting Everywhere - The Smallest ANSI C compiler
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
Features:
|
||||
--------
|
||||
|
||||
- SMALL! You can compile and execute C code everywhere, for example on
|
||||
rescue disks.
|
||||
|
||||
- FAST! tcc generates optimized x86 code. No byte code
|
||||
overhead. Compile, assemble and link about 7 times faster than 'gcc
|
||||
-O0'.
|
||||
|
||||
- UNLIMITED! Any C dynamic library can be used directly. TCC is
|
||||
heading torward full ISOC99 compliance. TCC can of course compile
|
||||
itself.
|
||||
|
||||
- SAFE! tcc includes an optional memory and bound checker. Bound
|
||||
checked code can be mixed freely with standard code.
|
||||
|
||||
- Compile and execute C source directly. No linking or assembly
|
||||
necessary. Full C preprocessor included.
|
||||
|
||||
- C script supported : just add '#!/usr/local/bin/tcc -run' at the first
|
||||
line of your C source, and execute it directly from the command
|
||||
line.
|
||||
|
||||
Documentation:
|
||||
-------------
|
||||
|
||||
1) Installation on a i386/x86_64/arm Linux/OSX/FreeBSD host (for Windows read tcc-win32.txt)
|
||||
|
||||
Note: For OSX and FreeBSD, gmake should be used instead of make.
|
||||
|
||||
./configure
|
||||
make
|
||||
make test
|
||||
make install
|
||||
|
||||
Alternatively, out-of-tree builds are supported: you may use different
|
||||
directories to hold build objects, kept separate from your source tree:
|
||||
|
||||
mkdir _build
|
||||
cd _build
|
||||
../configure
|
||||
make
|
||||
make test
|
||||
make install
|
||||
|
||||
Texi2html must be installed to compile the doc.
|
||||
By default, tcc is installed in /usr/local/bin.
|
||||
./configure --help shows configuration options.
|
||||
|
||||
|
||||
2) Introduction
|
||||
|
||||
We assume here that you know ANSI C. Look at the example ex1.c to know
|
||||
what the programs look like.
|
||||
|
||||
The include file <tcclib.h> can be used if you want a small basic libc
|
||||
include support (especially useful for floppy disks). Of course, you
|
||||
can also use standard headers, although they are slower to compile.
|
||||
|
||||
You can begin your C script with '#!/usr/local/bin/tcc -run' on the first
|
||||
line and set its execute bits (chmod a+x your_script). Then, you can
|
||||
launch the C code as a shell or perl script :-) The command line
|
||||
arguments are put in 'argc' and 'argv' of the main functions, as in
|
||||
ANSI C.
|
||||
|
||||
3) Examples
|
||||
|
||||
ex1.c: simplest example (hello world). Can also be launched directly
|
||||
as a script: './ex1.c'.
|
||||
|
||||
ex2.c: more complicated example: find a number with the four
|
||||
operations given a list of numbers (benchmark).
|
||||
|
||||
ex3.c: compute fibonacci numbers (benchmark).
|
||||
|
||||
ex4.c: more complicated: X11 program. Very complicated test in fact
|
||||
because standard headers are being used ! As for ex1.c, can also be launched
|
||||
directly as a script: './ex4.c'.
|
||||
|
||||
ex5.c: 'hello world' with standard glibc headers.
|
||||
|
||||
tcc.c: TCC can of course compile itself. Used to check the code
|
||||
generator.
|
||||
|
||||
tcctest.c: auto test for TCC which tests many subtle possible bugs. Used
|
||||
when doing 'make test'.
|
||||
|
||||
4) Full Documentation
|
||||
|
||||
Please read tcc-doc.html to have all the features of TCC.
|
||||
|
||||
Additional information is available for the Windows port in tcc-win32.txt.
|
||||
|
||||
License:
|
||||
-------
|
||||
|
||||
TCC is distributed under the GNU Lesser General Public License (see
|
||||
COPYING file).
|
||||
|
||||
Fabrice Bellard.
|
||||
```
|
@ -1,7 +0,0 @@
|
||||
#define CONFIG_TCCDIR "${CONFIG_TCCDIR}"
|
||||
#define TCC_VERSION "${TCC_VERSION}"
|
||||
|
||||
#cmakedefine CONFIG_WIN32
|
||||
#cmakedefine CONFIG_WIN64
|
||||
#cmakedefine CONFIG_TCC_BCHECK
|
||||
#cmakedefine CONFIG_TCC_ASSERT
|
@ -1 +0,0 @@
|
||||
@set VERSION ${TCC_VERSION}
|
@ -1,138 +0,0 @@
|
||||
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
|
||||
|
||||
set(TCC_CFLAGS -I${CMAKE_SOURCE_DIR} -I${CMAKE_SOURCE_DIR}/include -B${CMAKE_BINARY_DIR})
|
||||
if(WIN32)
|
||||
set(TCC_CFLAGS ${TCC_CFLAGS} -I${CMAKE_SOURCE_DIR}/win32/include)
|
||||
else()
|
||||
set(TCC_MATH_LDFLAGS -lm)
|
||||
set(LIBTCC_EXTRA_LIBS dl)
|
||||
set(LIBTCC_LDFLAGS -ldl -lm -Wl,-rpath=${CMAKE_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
add_executable(abitest-cc abitest.c)
|
||||
target_link_libraries(abitest-cc libtcc ${LIBTCC_EXTRA_LIBS})
|
||||
add_test(NAME abitest-cc WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND abitest-cc lib_path=${CMAKE_BINARY_DIR} include=${CMAKE_SOURCE_DIR}/include)
|
||||
|
||||
set(ABITEST_TCC abitest-tcc${CMAKE_EXECUTABLE_SUFFIX})
|
||||
get_property(LIBTCC_LIB TARGET libtcc PROPERTY LOCATION)
|
||||
add_custom_command(OUTPUT ${ABITEST_TCC} COMMAND tcc ${TCC_CFLAGS} -g ${CMAKE_CURRENT_SOURCE_DIR}/abitest.c ${LIBTCC_LDFLAGS} ${LIBTCC_LIB} -o ${ABITEST_TCC} DEPENDS tcc ${CMAKE_CURRENT_SOURCE_DIR}/abitest.c)
|
||||
add_custom_target(abitest-tcc-exe ALL DEPENDS ${ABITEST_TCC})
|
||||
|
||||
add_test(NAME abitest-tcc WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${ABITEST_TCC} lib_path=${CMAKE_BINARY_DIR} include=${CMAKE_SOURCE_DIR}/include)
|
||||
|
||||
set(VLA_TEST vla_test${CMAKE_EXECUTABLE_SUFFIX})
|
||||
add_custom_command(OUTPUT ${VLA_TEST} COMMAND tcc ${TCC_CFLAGS} -g ${CMAKE_CURRENT_SOURCE_DIR}/vla_test.c -o ${VLA_TEST} DEPENDS tcc ${CMAKE_CURRENT_SOURCE_DIR}/vla_test.c)
|
||||
add_custom_target(vla_test-exe ALL DEPENDS ${VLA_TEST})
|
||||
add_test(vla_test vla_test)
|
||||
|
||||
add_executable(tcctest-cc tcctest.c)
|
||||
target_link_libraries(tcctest-cc libtcc)
|
||||
set_target_properties(tcctest-cc PROPERTIES COMPILE_FLAGS -std=gnu99)
|
||||
|
||||
find_package(PythonInterp)
|
||||
if(PYTHONINTERP_FOUND)
|
||||
set(TCC_TEST_CFLAGS ${TCC_CFLAGS} -B${CMAKE_BINARY_DIR} -I${CMAKE_BINARY_DIR})
|
||||
if(WIN32)
|
||||
set(TCC_TEST_CFLAGS ${TCC_TEST_CFLAGS} -I${CMAKE_SOURCE_DIR}/win32/include/winapi)
|
||||
endif()
|
||||
set(TCC_TEST_SOURCE ${TCC_TEST_CFLAGS} ${TCC_MATH_LDFLAGS} -run ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.c)
|
||||
set(TCC_TEST_RUN ${TCC_TEST_CFLAGS} ${TCC_NATIVE_FLAGS} -DONE_SOURCE -run ${CMAKE_SOURCE_DIR}/tcc.c)
|
||||
get_property(TCC TARGET tcc PROPERTY LOCATION)
|
||||
get_property(TCCTESTCC TARGET tcctest-cc PROPERTY LOCATION)
|
||||
set(TCCTEST_PY ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.py ${TCCTESTCC})
|
||||
add_test(test1 ${TCCTEST_PY} ${TCC} ${TCC_TEST_SOURCE})
|
||||
add_test(test2 ${TCCTEST_PY} ${TCC} ${TCC_TEST_RUN} ${TCC_TEST_SOURCE})
|
||||
add_test(test3 ${TCCTEST_PY} ${TCC} ${TCC_TEST_RUN} ${TCC_TEST_RUN} ${TCC_TEST_SOURCE})
|
||||
|
||||
# Object + link output
|
||||
set(TEST4 test4${CMAKE_EXECUTABLE_SUFFIX})
|
||||
add_custom_command(OUTPUT test4.o COMMAND tcc ${TCC_TEST_CFLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.c -c -o test4.o DEPENDS tcc ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.c)
|
||||
add_custom_command(OUTPUT ${TEST4} COMMAND tcc ${TCC_TEST_CFLAGS} test4.o -o ${TEST4} DEPENDS tcc test4.o)
|
||||
add_custom_target(test4-exe ALL DEPENDS ${TEST4})
|
||||
add_test(test4 ${TCCTEST_PY} ${CMAKE_CURRENT_BINARY_DIR}/${TEST4})
|
||||
|
||||
# Dynamic output
|
||||
set(TEST5 test5${CMAKE_EXECUTABLE_SUFFIX})
|
||||
add_custom_command(OUTPUT ${TEST5} COMMAND tcc ${TCC_TEST_CFLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.c -o ${TEST5} DEPENDS tcc ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.c)
|
||||
add_custom_target(test5-exe ALL DEPENDS ${TEST5})
|
||||
add_test(test5 ${TCCTEST_PY} ${CMAKE_CURRENT_BINARY_DIR}/${TEST5})
|
||||
|
||||
if(TCC_BCHECK)
|
||||
# Dynamic output + bound check
|
||||
set(TEST6 test6${CMAKE_EXECUTABLE_SUFFIX})
|
||||
add_custom_command(OUTPUT ${TEST6} COMMAND tcc ${TCC_TEST_CFLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.c -b -o ${TEST6} DEPENDS tcc ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.c)
|
||||
add_custom_target(test6-exe ALL DEPENDS ${TEST6})
|
||||
add_test(test6 ${TCCTEST_PY} ${CMAKE_CURRENT_BINARY_DIR}/${TEST6})
|
||||
endif()
|
||||
|
||||
if(0)
|
||||
# Static output
|
||||
set(TEST7 test7${CMAKE_EXECUTABLE_SUFFIX})
|
||||
add_custom_command(OUTPUT ${TEST7} COMMAND tcc ${TCC_TEST_CFLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.c -static -o ${TEST7} DEPENDS tcc ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.c)
|
||||
add_custom_target(test7-exe ALL DEPENDS ${TEST7})
|
||||
add_test(test7 ${TCCTEST_PY} ${CMAKE_CURRENT_BINARY_DIR}/${TEST7})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(MORETESTS
|
||||
00_assignment
|
||||
01_comment
|
||||
02_printf
|
||||
03_struct
|
||||
04_for
|
||||
05_array
|
||||
06_case
|
||||
07_function
|
||||
08_while
|
||||
09_do_while
|
||||
10_pointer
|
||||
11_precedence
|
||||
12_hashdefine
|
||||
13_integer_literals
|
||||
14_if
|
||||
15_recursion
|
||||
16_nesting
|
||||
17_enum
|
||||
18_include
|
||||
19_pointer_arithmetic
|
||||
20_pointer_comparison
|
||||
21_char_array
|
||||
22_floating_point
|
||||
23_type_coercion
|
||||
24_math_library
|
||||
25_quicksort
|
||||
26_character_constants
|
||||
27_sizeof
|
||||
28_strings
|
||||
29_array_address
|
||||
31_args
|
||||
32_led
|
||||
33_ternary_op
|
||||
35_sizeof
|
||||
36_array_initialisers
|
||||
37_sprintf
|
||||
38_multiple_array_index
|
||||
39_typedef
|
||||
40_stdio
|
||||
41_hashif
|
||||
42_function_pointer
|
||||
43_void_param
|
||||
44_scoped_declarations
|
||||
45_empty_for
|
||||
47_switch_return
|
||||
48_nested_break
|
||||
49_bracket_evaluation
|
||||
50_logical_second_arg
|
||||
51_static
|
||||
52_unnamed_enum
|
||||
54_goto
|
||||
55_lshift_type
|
||||
)
|
||||
if(WIN32)
|
||||
list(REMOVE_ITEM MORETESTS 24_math_library)
|
||||
list(REMOVE_ITEM MORETESTS 28_strings)
|
||||
endif()
|
||||
foreach(testfile ${MORETESTS})
|
||||
add_test(NAME ${testfile} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests2
|
||||
COMMAND tcc ${TCC_CFLAGS} ${TCC_MATH_LDFLAGS} -run ${testfile}.c - arg1 arg2 arg3 arg4 | ${DIFF} - ${testfile}.expect)
|
||||
endforeach()
|
@ -1,22 +0,0 @@
|
||||
@echo off
|
||||
|
||||
@rem Compute 10th Fibonacci number
|
||||
tcc fib.c
|
||||
fib 10
|
||||
del fib.exe
|
||||
|
||||
@rem hello_win.c
|
||||
tcc hello_win.c
|
||||
hello_win
|
||||
del hello_win.exe
|
||||
|
||||
@rem 'Hello DLL' example
|
||||
tcc -shared dll.c
|
||||
tcc hello_dll.c dll.def
|
||||
hello_dll
|
||||
del hello_dll.exe dll.def dll.dll
|
||||
|
||||
@rem a console threaded program
|
||||
tcc taxi_simulator.c
|
||||
taxi_simulator
|
||||
del taxi_simulator.exe
|
@ -1,948 +0,0 @@
|
||||
/* A Windows console program: taxi and passengers simulator */
|
||||
|
||||
#include <windows.h>
|
||||
#include <wincon.h>
|
||||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
void init_scr();
|
||||
void restore_scr();
|
||||
void clrscr();
|
||||
void write_console(const char *msg, DWORD len, COORD coords, DWORD attr);
|
||||
|
||||
int add_br (int n, int addon);
|
||||
|
||||
DWORD WINAPI Si1 (LPVOID parm); // a passengers thread
|
||||
DWORD WINAPI Si2 (LPVOID parm);
|
||||
DWORD WINAPI Si3 (LPVOID parm);
|
||||
DWORD WINAPI Si4 (LPVOID parm);
|
||||
DWORD WINAPI Taxi (LPVOID parm); // a taxi thread
|
||||
|
||||
HANDLE hstdout;
|
||||
HANDLE hproc[5], htaxi, hproc2[5], hproc3[5], hproc4[5], ht2;
|
||||
|
||||
HANDLE hs_br; // a semaphor for br[]
|
||||
HANDLE hs_wc; // a semaphor for write_console()
|
||||
HANDLE hs_ds; // a semaphor for draw_statistics()
|
||||
HANDLE hs_st; // a semaphor for draw_station()
|
||||
|
||||
int br[5]; // a number of the passengers on the taxi stations
|
||||
int w; // a number of the passengers on the taxi, used in taxi()
|
||||
|
||||
DWORD si_attr = FOREGROUND_GREEN | FOREGROUND_INTENSITY;
|
||||
DWORD st_attr = FOREGROUND_GREEN;
|
||||
DWORD tx_attr = FOREGROUND_RED;
|
||||
|
||||
static
|
||||
void draw_statistics()
|
||||
{
|
||||
char msg[100];
|
||||
COORD coords;
|
||||
|
||||
WaitForSingleObject (hs_ds, INFINITE);
|
||||
|
||||
coords.X = 0;
|
||||
coords.Y = 0;
|
||||
|
||||
sprintf (msg, "station1=%d \n", br[1]);
|
||||
write_console (msg, strlen(msg), coords, si_attr);
|
||||
|
||||
coords.Y++;
|
||||
sprintf (msg, "station2=%d \n", br[2]);
|
||||
write_console (msg, strlen(msg), coords, si_attr);
|
||||
|
||||
coords.Y++;
|
||||
sprintf (msg, "station3=%d \n", br[3]);
|
||||
write_console (msg, strlen(msg), coords, si_attr);
|
||||
|
||||
coords.Y++;
|
||||
sprintf (msg, "station4=%d \n", br[4]);
|
||||
write_console (msg, strlen(msg), coords, si_attr);
|
||||
|
||||
coords.Y++;
|
||||
sprintf (msg, "taxi=%d \n", w);
|
||||
write_console (msg, strlen(msg), coords, si_attr);
|
||||
|
||||
ReleaseSemaphore (hs_ds, 1, NULL);
|
||||
}
|
||||
|
||||
static
|
||||
void draw_station(int station)
|
||||
{
|
||||
char msg[100];
|
||||
COORD coords;
|
||||
int j;
|
||||
|
||||
WaitForSingleObject (hs_st, INFINITE);
|
||||
|
||||
if (station == 1)
|
||||
{
|
||||
int br1, n, c;
|
||||
|
||||
coords.X = 34;
|
||||
coords.Y = 3;
|
||||
write_console (" st1 ", 5, coords, st_attr);
|
||||
coords.Y++;
|
||||
write_console ("-----", 5, coords, st_attr);
|
||||
|
||||
br1 = add_br (1, 0);
|
||||
coords.X = 40;
|
||||
c = 3;
|
||||
while (c-- > 0)
|
||||
{
|
||||
n = 5;
|
||||
if (br1 < 5)
|
||||
n = br1;
|
||||
|
||||
if (n != 0)
|
||||
for (j = 5; j > 5-n; j--)
|
||||
{
|
||||
coords.Y = j - 1;
|
||||
write_console ("*", 1, coords, si_attr);
|
||||
}
|
||||
|
||||
if (n != 5)
|
||||
for (j = 5-n; j > 0; j--)
|
||||
{
|
||||
coords.Y = j - 1;
|
||||
write_console (" ", 1, coords, si_attr);
|
||||
}
|
||||
|
||||
coords.X++;
|
||||
br1 -= n;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (station == 3)
|
||||
{
|
||||
int br3, n, c;
|
||||
|
||||
coords.X = 34;
|
||||
coords.Y = 20;
|
||||
write_console (" st3 ", 5, coords, st_attr);
|
||||
coords.Y--;
|
||||
write_console ("-----", 5, coords, st_attr);
|
||||
|
||||
br3 = add_br (3, 0);
|
||||
coords.X = 33;
|
||||
c = 3;
|
||||
while (c-- > 0)
|
||||
{
|
||||
n = 5;
|
||||
if (br3 < 5)
|
||||
n = br3;
|
||||
|
||||
if (n != 0)
|
||||
for (j = 0; j < n; j++)
|
||||
{
|
||||
coords.Y = 20 + j;
|
||||
write_console ("*", 1, coords, si_attr);
|
||||
}
|
||||
|
||||
if (n != 5)
|
||||
for (j = n; j < 5; j++)
|
||||
{
|
||||
coords.Y = 20 + j;
|
||||
write_console (" ", 1, coords, si_attr);
|
||||
}
|
||||
|
||||
coords.X--;
|
||||
br3 -= n;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (station == 2)
|
||||
{
|
||||
int br2, n, c;
|
||||
|
||||
coords.X = 69;
|
||||
coords.Y = 11;
|
||||
write_console ("st2", 3, coords, st_attr);
|
||||
coords.X -= 2;
|
||||
for (j = 14; j >= 10; j--)
|
||||
{
|
||||
coords.Y = j;
|
||||
write_console ("|", 1, coords, st_attr);
|
||||
}
|
||||
|
||||
br2 = add_br (2, 0);
|
||||
coords.Y = 13;
|
||||
c = 3;
|
||||
while (c-- > 0)
|
||||
{
|
||||
n = 5;
|
||||
if (br2 < 5)
|
||||
n = br2;
|
||||
|
||||
coords.X = 79;
|
||||
write_console (" ", 1, coords, si_attr);
|
||||
|
||||
coords.Y++;
|
||||
coords.X = 68;
|
||||
write_console ("*****", br2, coords, si_attr);
|
||||
|
||||
coords.X = 68+n;
|
||||
write_console (" ", 11-n, coords, si_attr);
|
||||
|
||||
coords.Y++;
|
||||
coords.X = 79;
|
||||
write_console (" ", 1, coords, si_attr);
|
||||
|
||||
coords.Y--;
|
||||
br2 -= n;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (station == 4)
|
||||
{
|
||||
int br4, n, c;
|
||||
|
||||
coords.X = 7;
|
||||
coords.Y = 13;
|
||||
write_console ("st4", 3, coords, st_attr);
|
||||
coords.X += 4;
|
||||
for (j = 10; j <= 14; j++)
|
||||
{
|
||||
coords.Y = j;
|
||||
write_console ("|", 1, coords, st_attr);
|
||||
}
|
||||
|
||||
coords.Y = 9;
|
||||
br4 = add_br (4, 0);
|
||||
c = 3;
|
||||
while (c-- > 0)
|
||||
{
|
||||
n = 5;
|
||||
if (br4 < 5)
|
||||
n = br4;
|
||||
|
||||
coords.X = 0;
|
||||
write_console (" ", 1, coords, si_attr);
|
||||
|
||||
coords.Y++;
|
||||
write_console (" ", 10, coords, si_attr);
|
||||
|
||||
coords.X = 10 - n;
|
||||
write_console ("**********", n, coords, si_attr);
|
||||
|
||||
coords.Y++;
|
||||
coords.X = 0;
|
||||
write_console (" ", 1, coords, si_attr);
|
||||
|
||||
coords.Y--;
|
||||
br4 -= n;
|
||||
}
|
||||
}
|
||||
|
||||
ReleaseSemaphore (hs_st, 1, NULL);
|
||||
}
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
int N; // a passengers on the all stations
|
||||
int i, j;
|
||||
COORD coords; // a cursor coords
|
||||
DWORD len;
|
||||
int br1, br2, br3, br4; // a passengers on the station X
|
||||
|
||||
init_scr();
|
||||
|
||||
printf ("Taxi and passengers simulator:\n");
|
||||
while (1)
|
||||
{
|
||||
printf (" enter a max passengers number on the stations (0..20) = ");
|
||||
scanf ("%d", &N);
|
||||
if ((N >= 0) && (N<=20))
|
||||
break;
|
||||
}
|
||||
while (1)
|
||||
{
|
||||
printf (" enter a passengers on the taxi (0..10) = ");
|
||||
scanf ("%d", &w);
|
||||
if ((w >= 0) && (w<=10))
|
||||
break;
|
||||
}
|
||||
init_scr();
|
||||
|
||||
srand (time (0));
|
||||
br1 = rand () % 6; // passngers on the station1, 0..5
|
||||
if (br1 > N)
|
||||
br1 = N;
|
||||
|
||||
br2 = rand () % 6;
|
||||
if (br2 > N - br1)
|
||||
br2 = N - br1;
|
||||
|
||||
br3 = rand () % 6;
|
||||
if (br3 > N - br1 - br2)
|
||||
br3 = N - br1 - br2;
|
||||
|
||||
br4 = N - br1 - br2 - br3;
|
||||
while (br4 > 5)
|
||||
{
|
||||
br4--;
|
||||
if (br1 < 5) { br1++; continue; }
|
||||
if (br2 < 5) { br2++; continue; }
|
||||
if (br3 < 5) { br3++; continue; }
|
||||
}
|
||||
|
||||
hs_br = CreateSemaphore (NULL, 1, 1, NULL);
|
||||
hs_wc = CreateSemaphore (NULL, 1, 1, NULL);
|
||||
hs_ds = CreateSemaphore (NULL, 1, 1, NULL);
|
||||
hs_st = CreateSemaphore (NULL, 1, 1, NULL);
|
||||
|
||||
draw_statistics();
|
||||
for (i=1; i<=4; i++)
|
||||
draw_station(i);
|
||||
|
||||
htaxi = CreateThread (NULL, 4096, Taxi, NULL, 0, NULL);
|
||||
|
||||
for (i = 0; i < br1; i++) {
|
||||
srand(time(0));
|
||||
Sleep(600*(4+rand()%10));
|
||||
hproc[i] = CreateThread (NULL, 4096, Si1, NULL, 0, NULL);
|
||||
}
|
||||
|
||||
for (i = 0; i < br2; i++) {
|
||||
srand(time(0));
|
||||
Sleep(400*(4+rand()%10));
|
||||
hproc2[i] = CreateThread (NULL, 4096, Si2, NULL, 0, NULL);
|
||||
}
|
||||
|
||||
for (i = 0; i < br3; i++) {
|
||||
srand(time(0));
|
||||
Sleep(600*(4+rand()%10));
|
||||
hproc3[i] = CreateThread (NULL, 4096, Si3, NULL, 0, NULL);
|
||||
}
|
||||
|
||||
for (i = 0; i < br4; i++) {
|
||||
srand(time(0));
|
||||
Sleep(600*(4+rand()%10));
|
||||
hproc4[i] = CreateThread (NULL, 4096, Si4, NULL, 0, NULL);
|
||||
}
|
||||
|
||||
getch ();
|
||||
restore_scr();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
void draw_taxi (int orientation, COORD coords)
|
||||
{
|
||||
static int old_orientation;
|
||||
static COORD old_coords;
|
||||
|
||||
if (orientation != 0) {
|
||||
old_orientation = orientation;
|
||||
old_coords = coords;
|
||||
}
|
||||
else {
|
||||
orientation = old_orientation;
|
||||
coords = old_coords;
|
||||
}
|
||||
|
||||
if (orientation == 1)
|
||||
{
|
||||
int f, b, ii;
|
||||
f = 5;
|
||||
if (w < 5)
|
||||
f = w;
|
||||
b = w - f;
|
||||
|
||||
write_console (" ----- ", 8, coords, tx_attr);
|
||||
|
||||
coords.Y++;
|
||||
write_console (" | |", 8, coords, tx_attr);
|
||||
coords.X += 2 + 5 - b;
|
||||
write_console ( "ooooo", b, coords, tx_attr);
|
||||
coords.X -= 2 + 5 - b;
|
||||
|
||||
coords.Y++;
|
||||
write_console (" | |", 8, coords, tx_attr);
|
||||
coords.X += 2 + 5 - f;
|
||||
write_console ( "ooooo", f, coords, tx_attr);
|
||||
coords.X -= 2 + 5 - f;
|
||||
|
||||
coords.Y++;
|
||||
write_console (" ----- ", 8, coords, tx_attr);
|
||||
|
||||
for (ii=0; ii<5; ii++)
|
||||
{
|
||||
coords.Y++;
|
||||
write_console (" ", 8, coords, tx_attr);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (orientation == 2)
|
||||
{
|
||||
COORD coords2;
|
||||
int f, b, ii;
|
||||
|
||||
f = 5;
|
||||
if (f > w)
|
||||
f = w;
|
||||
b = w - f;
|
||||
|
||||
coords2.X = coords.X;
|
||||
coords.Y--;
|
||||
write_console (" ", 7, coords, tx_attr);
|
||||
coords.Y++;
|
||||
write_console (" -- ", 7, coords, tx_attr);
|
||||
|
||||
for (ii=0; ii < 5; ii++)
|
||||
{
|
||||
coords2.Y = coords.Y + 5 - ii;
|
||||
if (f && b) {
|
||||
write_console (" |oo| ", 7, coords2, tx_attr);
|
||||
f--; b--;
|
||||
}
|
||||
else
|
||||
if (f) {
|
||||
write_console (" |o | ", 7, coords2, tx_attr);
|
||||
f--;
|
||||
}
|
||||
else {
|
||||
write_console (" | | ", 7, coords2, tx_attr);
|
||||
}
|
||||
}
|
||||
|
||||
coords.Y += 6;
|
||||
write_console (" -- ", 7, coords, tx_attr);
|
||||
}
|
||||
else
|
||||
if (orientation == 3)
|
||||
{
|
||||
int ii;
|
||||
for (ii=0; ii < 4; ii++)
|
||||
{
|
||||
write_console (" ", 8, coords, tx_attr);
|
||||
coords.Y++;
|
||||
}
|
||||
|
||||
write_console (" ----- ", 8, coords, tx_attr);
|
||||
|
||||
coords.Y++;
|
||||
write_console ("| | ", 8, coords, tx_attr);
|
||||
coords.X++;
|
||||
ii = 5;
|
||||
if (w < 5)
|
||||
ii = w;
|
||||
write_console ( "ooooo", ii, coords, tx_attr);
|
||||
coords.X--;
|
||||
|
||||
coords.Y++;
|
||||
write_console ("| | ", 8, coords, tx_attr);
|
||||
coords.X++;
|
||||
ii = w - ii;
|
||||
write_console ( "ooooo", ii, coords, tx_attr);
|
||||
coords.X--;
|
||||
|
||||
coords.Y++;
|
||||
write_console (" ----- ", 8, coords, tx_attr);
|
||||
}
|
||||
else
|
||||
if (orientation == 4)
|
||||
{
|
||||
int f, b, ii;
|
||||
|
||||
f = 5;
|
||||
if (f > w)
|
||||
f = w;
|
||||
b = w - f;
|
||||
|
||||
write_console (" -- ", 7, coords, tx_attr);
|
||||
|
||||
for (ii=0; ii < 5; ii++)
|
||||
{
|
||||
coords.Y++;
|
||||
if (f && b) {
|
||||
write_console (" |oo| ", 7, coords, tx_attr);
|
||||
f--; b--;
|
||||
}
|
||||
else
|
||||
if (f) {
|
||||
write_console (" | o| ", 7, coords, tx_attr);
|
||||
f--;
|
||||
}
|
||||
else
|
||||
write_console (" | | ", 7, coords, tx_attr);
|
||||
}
|
||||
|
||||
coords.Y++;
|
||||
write_console (" -- ", 7, coords, tx_attr);
|
||||
|
||||
coords.Y++;
|
||||
write_console (" ", 7, coords, tx_attr);
|
||||
}
|
||||
}
|
||||
|
||||
DWORD WINAPI
|
||||
Taxi (LPVOID _unused_thread_parm)
|
||||
{
|
||||
int i, ii, j, k, f, b;
|
||||
int empty_st;
|
||||
COORD coords;
|
||||
DWORD len;
|
||||
char msg[100];
|
||||
|
||||
for (j = 0; j < 48; j++) // taxi left
|
||||
{
|
||||
coords.X = 59 - j;
|
||||
coords.Y = 11;
|
||||
draw_taxi (3, coords);
|
||||
|
||||
if (j == 23) // station 3 for a passengers exit
|
||||
{
|
||||
int br3 = add_br (3, 0);
|
||||
empty_st = (br3 == 0);
|
||||
|
||||
srand (time (0));
|
||||
f = rand () % (16 - br3); // passengers can be on the station
|
||||
|
||||
if (w)
|
||||
{
|
||||
while(f)
|
||||
{
|
||||
if (w==0)
|
||||
break;
|
||||
|
||||
f--;
|
||||
w--;
|
||||
add_br (3, 1);
|
||||
draw_statistics();
|
||||
draw_station(3);
|
||||
draw_taxi(0, coords);
|
||||
Sleep (300);
|
||||
}
|
||||
Sleep (3000);
|
||||
}
|
||||
}
|
||||
|
||||
if (j == 28) // station 3 for enter
|
||||
{
|
||||
int br3 = add_br (3, 0);
|
||||
f = rand () % (11 - w); // passengers into taxi
|
||||
|
||||
|
||||
if (br3 && !empty_st)
|
||||
{
|
||||
while (br3 > 0 && f > 0)
|
||||
{
|
||||
f--;
|
||||
w++;
|
||||
br3 = add_br (3, -1);
|
||||
|
||||
draw_statistics();
|
||||
draw_station(3);
|
||||
draw_taxi(0, coords);
|
||||
Sleep (300);
|
||||
}
|
||||
Sleep (3000);
|
||||
}
|
||||
}
|
||||
Sleep (300);
|
||||
}
|
||||
|
||||
for (i = 0; i < 10; i++) // taxi up
|
||||
{
|
||||
coords.X = 12;
|
||||
coords.Y = 15 - i;
|
||||
draw_taxi(4, coords);
|
||||
|
||||
if (i == 4) // station 4 for exit
|
||||
{
|
||||
int br4 = add_br (4, 0);
|
||||
empty_st = (br4 == 0);
|
||||
|
||||
srand (time (0));
|
||||
f = rand () % (16 - br4);
|
||||
|
||||
if (w)
|
||||
{
|
||||
while(f)
|
||||
{
|
||||
if (w==0)
|
||||
break;
|
||||
|
||||
f--;
|
||||
w--;
|
||||
add_br (4, 1);
|
||||
draw_statistics();
|
||||
draw_station(4);
|
||||
draw_taxi(0, coords);
|
||||
Sleep (300);
|
||||
}
|
||||
Sleep (3000);
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 7) // station 4 for enter
|
||||
{
|
||||
int br4 = add_br (4, 0);
|
||||
f = rand () % (11 - w);
|
||||
|
||||
|
||||
if (br4 && !empty_st)
|
||||
{
|
||||
while (br4 > 0 && f > 0)
|
||||
{
|
||||
f--;
|
||||
w++;
|
||||
br4 = add_br (4, -1);
|
||||
|
||||
draw_statistics();
|
||||
draw_station(4);
|
||||
draw_taxi(0, coords);
|
||||
Sleep (300);
|
||||
}
|
||||
Sleep (3000);
|
||||
}
|
||||
}
|
||||
Sleep (300);
|
||||
}
|
||||
|
||||
for (k = 0; k < 48; k++) // taxi rigth
|
||||
{
|
||||
coords.X = 12 + k;
|
||||
coords.Y = 5;
|
||||
draw_taxi (1, coords);
|
||||
|
||||
if (k == 19) // station 1 for exit
|
||||
{
|
||||
int br1 = add_br (1, 0);
|
||||
empty_st = (br1 == 0);
|
||||
|
||||
srand (time (0));
|
||||
f = rand () % (16 - br1);
|
||||
|
||||
if (w)
|
||||
{
|
||||
while(f)
|
||||
{
|
||||
if (w==0)
|
||||
break;
|
||||
|
||||
f--;
|
||||
w--;
|
||||
add_br (1, 1);
|
||||
draw_statistics();
|
||||
draw_station(1);
|
||||
draw_taxi(0, coords);
|
||||
Sleep (300);
|
||||
}
|
||||
Sleep (3000);
|
||||
}
|
||||
}
|
||||
|
||||
if (k == 23) // station 1 for enter
|
||||
{
|
||||
int br1 = add_br (1, 0);
|
||||
f = rand () % (11 - w);
|
||||
|
||||
if (br1 && !empty_st)
|
||||
{
|
||||
while (br1 > 0 && f > 0)
|
||||
{
|
||||
f--;
|
||||
w++;
|
||||
br1 = add_br (1, -1);
|
||||
|
||||
draw_statistics();
|
||||
draw_station(1);
|
||||
draw_taxi(0, coords);
|
||||
Sleep (300);
|
||||
}
|
||||
Sleep (3000);
|
||||
}
|
||||
}
|
||||
Sleep (300);
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; i++) // taxi down
|
||||
{
|
||||
coords.X = 60;
|
||||
coords.Y = 3 + i;
|
||||
draw_taxi (2, coords);
|
||||
|
||||
if (i == 4) // station 2 for exit
|
||||
{
|
||||
int br2 = add_br (2, 0);
|
||||
empty_st = (br2 == 0);
|
||||
|
||||
srand (time (0));
|
||||
f = rand () % (16 - br2);
|
||||
|
||||
if (w)
|
||||
{
|
||||
while(f)
|
||||
{
|
||||
if (w==0)
|
||||
break;
|
||||
|
||||
f--;
|
||||
w--;
|
||||
add_br (2, 1);
|
||||
draw_statistics();
|
||||
draw_station(2);
|
||||
draw_taxi(0, coords);
|
||||
Sleep (300);
|
||||
}
|
||||
Sleep (3000);
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 6) // station 2 for enter
|
||||
{
|
||||
int br2 = add_br (2, 0);
|
||||
f = rand () % (11 - w);
|
||||
|
||||
if (br2 && !empty_st)
|
||||
{
|
||||
while (br2 > 0 && f > 0)
|
||||
{
|
||||
f--;
|
||||
w++;
|
||||
br2 = add_br (2, -1);
|
||||
|
||||
draw_statistics();
|
||||
draw_station(2);
|
||||
draw_taxi(0, coords);
|
||||
Sleep (300);
|
||||
}
|
||||
Sleep (3000);
|
||||
}
|
||||
}
|
||||
|
||||
Sleep (300);
|
||||
}
|
||||
|
||||
ht2 = CreateThread (NULL, 4096, Taxi, NULL, 0, NULL); // endless loop
|
||||
return 0;
|
||||
}
|
||||
|
||||
DWORD WINAPI
|
||||
Si1 (LPVOID _unused_thread_parm) // a passengers thread for the station 1
|
||||
{
|
||||
int a, j, n;
|
||||
COORD coords;
|
||||
|
||||
srand (time (0));
|
||||
a = 6 + rand () % 74; // a new passengers number, 6..79
|
||||
|
||||
while (a != 40)
|
||||
{
|
||||
if (a < 40)
|
||||
a++;
|
||||
else
|
||||
a--;
|
||||
|
||||
coords.X = a;
|
||||
coords.Y = 0;
|
||||
|
||||
if (a < 40)
|
||||
write_console (" *", 2, coords, si_attr);
|
||||
else
|
||||
write_console ("* ", 2, coords, si_attr);
|
||||
|
||||
Sleep (1000);
|
||||
}
|
||||
|
||||
add_br (1, 1);
|
||||
draw_station(1);
|
||||
draw_statistics();
|
||||
|
||||
Sleep (1000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
DWORD WINAPI
|
||||
Si3 (LPVOID _unused_thread_parm) // a passengers thread for the station 3
|
||||
{
|
||||
int b, j, n;
|
||||
COORD coords;
|
||||
|
||||
srand (time (0));
|
||||
b = 1 + rand () % 79;
|
||||
|
||||
while (b != 33)
|
||||
{
|
||||
if (b < 33)
|
||||
b++;
|
||||
else
|
||||
b--;
|
||||
|
||||
coords.X = b;
|
||||
coords.Y = 24;
|
||||
|
||||
if (b < 33)
|
||||
write_console (" *", 2, coords, si_attr);
|
||||
else
|
||||
write_console ("* ", 2, coords, si_attr);
|
||||
|
||||
Sleep (1000);
|
||||
}
|
||||
|
||||
add_br (3, 1);
|
||||
draw_station(3);
|
||||
draw_statistics();
|
||||
|
||||
Sleep (1000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
DWORD WINAPI
|
||||
Si4 (LPVOID _unused_thread_parm) // a passengers thread for the station 4
|
||||
{
|
||||
|
||||
int c, j, n;
|
||||
COORD coords;
|
||||
|
||||
srand (time (0));
|
||||
c = 6 + rand () % 19; // a new passengers number, 6..24
|
||||
|
||||
coords.X = 0;
|
||||
while (c != 10)
|
||||
{
|
||||
coords.Y = c;
|
||||
write_console ("*", 1, coords, si_attr);
|
||||
|
||||
if (c < 10) {
|
||||
c++;
|
||||
coords.Y--;
|
||||
}
|
||||
else {
|
||||
c--;
|
||||
coords.Y++;
|
||||
}
|
||||
write_console (" ", 1, coords, si_attr);
|
||||
|
||||
Sleep (1000);
|
||||
}
|
||||
|
||||
add_br (4, 1);
|
||||
draw_station(4);
|
||||
draw_statistics();
|
||||
|
||||
Sleep (1000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
DWORD WINAPI
|
||||
Si2 (LPVOID _unused_thread_parm) // a passengers thread for the station 2
|
||||
{
|
||||
int d, j, n;
|
||||
COORD coords;
|
||||
|
||||
srand (time (0));
|
||||
d = 1 + rand () % 24; // a new passengers number, 1..24
|
||||
|
||||
coords.X = 79;
|
||||
while (d != 14)
|
||||
{
|
||||
coords.Y = d;
|
||||
write_console ("*", 1, coords, si_attr);
|
||||
if (d < 14)
|
||||
{
|
||||
d++;
|
||||
coords.Y--;
|
||||
}
|
||||
else
|
||||
{
|
||||
d--;
|
||||
coords.Y++;
|
||||
}
|
||||
write_console (" ", 1, coords, si_attr);
|
||||
Sleep (1000);
|
||||
}
|
||||
|
||||
add_br (2, 1);
|
||||
draw_station(2);
|
||||
draw_statistics();
|
||||
|
||||
Sleep (1000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
UINT oldcp; // CodePage on the program start
|
||||
CONSOLE_CURSOR_INFO old_ci;
|
||||
|
||||
void init_scr()
|
||||
{
|
||||
hstdout = GetStdHandle (STD_OUTPUT_HANDLE);
|
||||
if (hstdout == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
printf ("Error, can't get console handle\n");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
if (oldcp == 0)
|
||||
{
|
||||
oldcp = GetConsoleOutputCP();
|
||||
SetConsoleOutputCP(CP_UTF8);
|
||||
|
||||
GetConsoleCursorInfo (hstdout, &old_ci);
|
||||
}
|
||||
else
|
||||
{
|
||||
CONSOLE_CURSOR_INFO new_ci;
|
||||
|
||||
new_ci.bVisible = FALSE;
|
||||
new_ci.dwSize = old_ci.dwSize;
|
||||
SetConsoleCursorInfo (hstdout, &new_ci);
|
||||
}
|
||||
|
||||
clrscr ();
|
||||
}
|
||||
|
||||
void restore_scr()
|
||||
{
|
||||
SetConsoleOutputCP(oldcp);
|
||||
SetConsoleCursorInfo (hstdout, &old_ci);
|
||||
clrscr ();
|
||||
}
|
||||
|
||||
void clrscr()
|
||||
{
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
DWORD nocw;
|
||||
COORD coords;
|
||||
|
||||
SetConsoleTextAttribute (hstdout, FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_GREEN);
|
||||
GetConsoleScreenBufferInfo (hstdout, &csbi);
|
||||
|
||||
// printf ("csbi.dwSize.X=%u csbi.dwSize.Y=%u\n",
|
||||
// csbi.dwSize.X, csbi.dwSize.Y);
|
||||
// getch ();
|
||||
|
||||
coords.X=0; coords.Y=0;
|
||||
SetConsoleCursorPosition (hstdout, coords);
|
||||
FillConsoleOutputCharacterA(hstdout, ' ', csbi.dwSize.X * csbi.dwSize.Y, coords, &nocw);
|
||||
}
|
||||
|
||||
void write_console(const char *msg, DWORD len, COORD coords, DWORD attr)
|
||||
{
|
||||
DWORD len2;
|
||||
|
||||
WaitForSingleObject (hs_wc, INFINITE);
|
||||
|
||||
SetConsoleTextAttribute (hstdout, attr);
|
||||
SetConsoleCursorPosition (hstdout, coords);
|
||||
WriteConsole (hstdout, msg, len, &len2, NULL);
|
||||
|
||||
ReleaseSemaphore (hs_wc, 1, NULL);
|
||||
}
|
||||
|
||||
int add_br (int n, int addon)
|
||||
{
|
||||
int new;
|
||||
|
||||
WaitForSingleObject (hs_br, INFINITE);
|
||||
br[n] += addon;
|
||||
new = br[n];
|
||||
ReleaseSemaphore (hs_br, 1, NULL);
|
||||
|
||||
return new;
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
#ifndef _BSDTYPES_DEFINED
|
||||
#define _BSDTYPES_DEFINED
|
||||
|
||||
typedef unsigned char u_char;
|
||||
typedef unsigned short u_short;
|
||||
typedef unsigned int u_int;
|
||||
typedef unsigned long u_long;
|
||||
#if defined(__GNUC__) || \
|
||||
defined(__GNUG__)
|
||||
__extension__
|
||||
#endif /* gcc / g++ */
|
||||
typedef unsigned long long u_int64;
|
||||
|
||||
#endif /* _BSDTYPES_DEFINED */
|
||||
|
@ -1,33 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
#if !defined(_INC_CRT_UNICODE_MACROS)
|
||||
/* _INC_CRT_UNICODE_MACROS defined based on UNICODE flag */
|
||||
|
||||
#if defined(UNICODE)
|
||||
# define _INC_CRT_UNICODE_MACROS 1
|
||||
# define __MINGW_NAME_AW(func) func##W
|
||||
# define __MINGW_NAME_AW_EXT(func,ext) func##W##ext
|
||||
# define __MINGW_NAME_UAW(func) func##_W
|
||||
# define __MINGW_NAME_UAW_EXT(func,ext) func##_W_##ext
|
||||
# define __MINGW_STRING_AW(str) L##str /* same as TEXT() from winnt.h */
|
||||
# define __MINGW_PROCNAMEEXT_AW "W"
|
||||
#else
|
||||
# define _INC_CRT_UNICODE_MACROS 2
|
||||
# define __MINGW_NAME_AW(func) func##A
|
||||
# define __MINGW_NAME_AW_EXT(func,ext) func##A##ext
|
||||
# define __MINGW_NAME_UAW(func) func##_A
|
||||
# define __MINGW_NAME_UAW_EXT(func,ext) func##_A_##ext
|
||||
# define __MINGW_STRING_AW(str) str /* same as TEXT() from winnt.h */
|
||||
# define __MINGW_PROCNAMEEXT_AW "A"
|
||||
#endif
|
||||
|
||||
#define __MINGW_TYPEDEF_AW(type) \
|
||||
typedef __MINGW_NAME_AW(type) type;
|
||||
#define __MINGW_TYPEDEF_UAW(type) \
|
||||
typedef __MINGW_NAME_UAW(type) type;
|
||||
|
||||
#endif /* !defined(_INC_CRT_UNICODE_MACROS) */
|
@ -1,23 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
#ifndef _TIMEVAL_DEFINED
|
||||
#define _TIMEVAL_DEFINED
|
||||
|
||||
struct timeval
|
||||
{
|
||||
long tv_sec;
|
||||
long tv_usec;
|
||||
};
|
||||
|
||||
#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
|
||||
#define timercmp(tvp,uvp,cmp) \
|
||||
((tvp)->tv_sec cmp (uvp)->tv_sec || \
|
||||
((tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec))
|
||||
#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
|
||||
|
||||
#endif /* _TIMEVAL_DEFINED */
|
||||
|
@ -1,28 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
#ifndef s6_addr
|
||||
|
||||
#include <_bsd_types.h>
|
||||
|
||||
typedef struct in6_addr {
|
||||
union {
|
||||
u_char Byte[16];
|
||||
u_short Word[8];
|
||||
} u;
|
||||
} IN6_ADDR, *PIN6_ADDR, *LPIN6_ADDR;
|
||||
|
||||
#define in_addr6 in6_addr
|
||||
|
||||
#define _S6_un u
|
||||
#define _S6_u8 Byte
|
||||
#define s6_addr _S6_un._S6_u8
|
||||
|
||||
#define s6_bytes u.Byte
|
||||
#define s6_words u.Word
|
||||
|
||||
#endif /* s6_addr */
|
||||
|
@ -1,27 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
#ifndef s_addr
|
||||
|
||||
#include <_bsd_types.h>
|
||||
|
||||
typedef struct in_addr {
|
||||
union {
|
||||
struct { u_char s_b1, s_b2, s_b3, s_b4; } S_un_b;
|
||||
struct { u_short s_w1, s_w2; } S_un_w;
|
||||
u_long S_addr;
|
||||
} S_un;
|
||||
} IN_ADDR, *PIN_ADDR, *LPIN_ADDR;
|
||||
|
||||
#define s_addr S_un.S_addr
|
||||
#define s_host S_un.S_un_b.s_b2
|
||||
#define s_net S_un.S_un_b.s_b1
|
||||
#define s_imp S_un.S_un_w.s_w2
|
||||
#define s_impno S_un.S_un_b.s_b4
|
||||
#define s_lh S_un.S_un_b.s_b3
|
||||
|
||||
#endif /* s_addr */
|
||||
|
@ -1,195 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
#ifndef _MSTCPIP_
|
||||
#define _MSTCPIP_
|
||||
|
||||
#include <_mingw_unicode.h>
|
||||
|
||||
struct tcp_keepalive {
|
||||
u_long onoff;
|
||||
u_long keepalivetime;
|
||||
u_long keepaliveinterval;
|
||||
};
|
||||
|
||||
#define SIO_RCVALL _WSAIOW(IOC_VENDOR,1)
|
||||
#define SIO_RCVALL_MCAST _WSAIOW(IOC_VENDOR,2)
|
||||
#define SIO_RCVALL_IGMPMCAST _WSAIOW(IOC_VENDOR,3)
|
||||
#define SIO_KEEPALIVE_VALS _WSAIOW(IOC_VENDOR,4)
|
||||
#define SIO_ABSORB_RTRALERT _WSAIOW(IOC_VENDOR,5)
|
||||
#define SIO_UCAST_IF _WSAIOW(IOC_VENDOR,6)
|
||||
#define SIO_LIMIT_BROADCASTS _WSAIOW(IOC_VENDOR,7)
|
||||
#define SIO_INDEX_BIND _WSAIOW(IOC_VENDOR,8)
|
||||
#define SIO_INDEX_MCASTIF _WSAIOW(IOC_VENDOR,9)
|
||||
#define SIO_INDEX_ADD_MCAST _WSAIOW(IOC_VENDOR,10)
|
||||
#define SIO_INDEX_DEL_MCAST _WSAIOW(IOC_VENDOR,11)
|
||||
|
||||
#define RCVALL_OFF 0
|
||||
#define RCVALL_ON 1
|
||||
#define RCVALL_SOCKETLEVELONLY 2
|
||||
|
||||
#if (_WIN32_WINNT >= 0x0502)
|
||||
#define SOCKET_SETTINGS_GUARANTEE_ENCRYPTION 0x00000001
|
||||
#define SOCKET_SETTINGS_ALLOW_INSECURE 0x00000002
|
||||
|
||||
typedef enum _SOCKET_SECURITY_PROTOCOL {
|
||||
SOCKET_SECURITY_PROTOCOL_DEFAULT,
|
||||
SOCKET_SECURITY_PROTOCOL_IPSEC,
|
||||
SOCKET_SECURITY_PROTOCOL_INVALID
|
||||
} SOCKET_SECURITY_PROTOCOL;
|
||||
|
||||
typedef enum _SOCKET_USAGE_TYPE {
|
||||
SYSTEM_CRITICAL_SOCKET = 1
|
||||
} SOCKET_USAGE_TYPE;
|
||||
|
||||
typedef struct _SOCKET_PEER_TARGET_NAME {
|
||||
SOCKET_SECURITY_PROTOCOL SecurityProtocol;
|
||||
SOCKADDR_STORAGE PeerAddress;
|
||||
ULONG PeerTargetNameStringLen;
|
||||
wchar_t AllStrings[];
|
||||
} SOCKET_PEER_TARGET_NAME;
|
||||
|
||||
#define SOCKET_INFO_CONNECTION_SECURED 0x00000001
|
||||
#define SOCKET_INFO_CONNECTION_ENCRYPTED 0x00000002
|
||||
#define SOCKET_INFO_CONNECTION_IMPERSONATED 0x00000004
|
||||
|
||||
typedef struct _SOCKET_SECURITY_QUERY_INFO {
|
||||
SOCKET_SECURITY_PROTOCOL SecurityProtocol;
|
||||
ULONG Flags;
|
||||
UINT64 PeerApplicationAccessTokenHandle;
|
||||
UINT64 PeerMachineAccessTokenHandle;
|
||||
} SOCKET_SECURITY_QUERY_INFO;
|
||||
|
||||
typedef struct _SOCKET_SECURITY_QUERY_TEMPLATE {
|
||||
SOCKET_SECURITY_PROTOCOL SecurityProtocol;
|
||||
SOCKADDR_STORAGE PeerAddress;
|
||||
ULONG PeerTokenAccessMask;
|
||||
} SOCKET_SECURITY_QUERY_TEMPLATE;
|
||||
|
||||
typedef struct _SOCKET_SECURITY_SETTINGS {
|
||||
SOCKET_SECURITY_PROTOCOL SecurityProtocol;
|
||||
ULONG SecurityFlags;
|
||||
} SOCKET_SECURITY_SETTINGS;
|
||||
|
||||
#define SOCKET_SETTINGS_IPSEC_SKIP_FILTER_INSTANTIATION 0x00000001
|
||||
|
||||
typedef struct _SOCKET_SECURITY_SETTINGS_IPSEC {
|
||||
SOCKET_SECURITY_PROTOCOL SecurityProtocol;
|
||||
ULONG SecurityFlags;
|
||||
ULONG IpsecFlags;
|
||||
GUID AuthipMMPolicyKey;
|
||||
GUID AuthipQMPolicyKey;
|
||||
GUID Reserved;
|
||||
UINT64 Reserved2;
|
||||
ULONG UserNameStringLen;
|
||||
ULONG DomainNameStringLen;
|
||||
ULONG PasswordStringLen;
|
||||
wchar_t AllStrings[];
|
||||
} SOCKET_SECURITY_SETTINGS_IPSEC;
|
||||
|
||||
#define RtlIpv6AddressToString __MINGW_NAME_AW(RtlIpv6AddressToString)
|
||||
#define RtlIpv6AddressToStringEx __MINGW_NAME_AW(RtlIpv6AddressToStringEx)
|
||||
|
||||
LPWSTR NTAPI RtlIpv6AddressToStringA(
|
||||
const IN6_ADDR *Addr,
|
||||
LPSTR S
|
||||
);
|
||||
|
||||
LPSTR NTAPI RtlIpv6AddressToStringW(
|
||||
const IN6_ADDR *Addr,
|
||||
LPWSTR S
|
||||
);
|
||||
|
||||
LONG NTAPI RtlIpv6AddressToStringExA(
|
||||
const IN6_ADDR *Address,
|
||||
ULONG ScopeId,
|
||||
USHORT Port,
|
||||
LPSTR AddressString,
|
||||
PULONG AddressStringLength
|
||||
);
|
||||
|
||||
LONG NTAPI RtlIpv6AddressToStringExW(
|
||||
const IN6_ADDR *Address,
|
||||
ULONG ScopeId,
|
||||
USHORT Port,
|
||||
LPWSTR AddressString,
|
||||
PULONG AddressStringLength
|
||||
);
|
||||
|
||||
#define RtlIpv4AddressToString __MINGW_NAME_AW(RtlIpv4AddressToString)
|
||||
LPTSTR NTAPI RtlIpv4AddressToStringA(
|
||||
const IN_ADDR *Addr,
|
||||
LPSTR S
|
||||
);
|
||||
|
||||
LPTSTR NTAPI RtlIpv4AddressToStringW(
|
||||
const IN_ADDR *Addr,
|
||||
LPWSTR S
|
||||
);
|
||||
|
||||
#define RtlIpv4AddressToStringEx __MINGW_NAME_AW(RtlIpv4AddressToStringEx)
|
||||
LONG NTAPI RtlIpv4AddressToStringExA(
|
||||
const IN_ADDR *Address,
|
||||
USHORT Port,
|
||||
LPSTR AddressString,
|
||||
PULONG AddressStringLength
|
||||
);
|
||||
|
||||
LONG NTAPI RtlIpv4AddressToStringExW(
|
||||
const IN_ADDR *Address,
|
||||
USHORT Port,
|
||||
LPWSTR AddressString,
|
||||
PULONG AddressStringLength
|
||||
);
|
||||
|
||||
#define RtlIpv4StringToAddress __MINGW_NAME_AW(RtlIpv4StringToAddress)
|
||||
LONG NTAPI RtlIpv4StringToAddressA(
|
||||
PCSTR S,
|
||||
BOOLEAN Strict,
|
||||
LPSTR *Terminator,
|
||||
IN_ADDR *Addr
|
||||
);
|
||||
|
||||
LONG NTAPI RtlIpv4StringToAddressW(
|
||||
PCWSTR S,
|
||||
BOOLEAN Strict,
|
||||
LPWSTR *Terminator,
|
||||
IN_ADDR *Addr
|
||||
);
|
||||
|
||||
#define RtlIpv4StringToAddressEx __MINGW_NAME_AW(RtlIpv4StringToAddressEx)
|
||||
LONG NTAPI RtlIpv4StringToAddressExA(
|
||||
PCSTR AddressString,
|
||||
BOOLEAN Strict,
|
||||
IN_ADDR *Address,
|
||||
PUSHORT Port
|
||||
);
|
||||
|
||||
LONG NTAPI RtlIpv4StringToAddressExW(
|
||||
PCWSTR AddressString,
|
||||
BOOLEAN Strict,
|
||||
IN_ADDR *Address,
|
||||
PUSHORT Port
|
||||
);
|
||||
|
||||
#define RtlIpv6StringToAddressEx __MINGW_NAME_AW(RtlIpv6StringToAddressEx)
|
||||
LONG NTAPI RtlIpv6StringToAddressExA(
|
||||
PCSTR AddressString,
|
||||
IN6_ADDR *Address,
|
||||
PULONG ScopeId,
|
||||
PUSHORT Port
|
||||
);
|
||||
|
||||
LONG NTAPI RtlIpv6StringToAddressExW(
|
||||
PCSTR AddressString,
|
||||
IN6_ADDR *Address,
|
||||
PULONG ScopeId,
|
||||
PUSHORT Port
|
||||
);
|
||||
|
||||
#endif /*(_WIN32_WINNT >= 0x0502)*/
|
||||
|
||||
#endif /* _MSTCPIP_ */
|
||||
|
@ -1,193 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the mingw-w64 runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
#ifndef _MSWSOCK_
|
||||
#define _MSWSOCK_
|
||||
|
||||
#include <winsock2.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SO_CONNDATA 0x7000
|
||||
#define SO_CONNOPT 0x7001
|
||||
#define SO_DISCDATA 0x7002
|
||||
#define SO_DISCOPT 0x7003
|
||||
#define SO_CONNDATALEN 0x7004
|
||||
#define SO_CONNOPTLEN 0x7005
|
||||
#define SO_DISCDATALEN 0x7006
|
||||
#define SO_DISCOPTLEN 0x7007
|
||||
|
||||
#define SO_OPENTYPE 0x7008
|
||||
|
||||
#define SO_SYNCHRONOUS_ALERT 0x10
|
||||
#define SO_SYNCHRONOUS_NONALERT 0x20
|
||||
|
||||
#define SO_MAXDG 0x7009
|
||||
#define SO_MAXPATHDG 0x700A
|
||||
#define SO_UPDATE_ACCEPT_CONTEXT 0x700B
|
||||
#define SO_CONNECT_TIME 0x700C
|
||||
#define SO_UPDATE_CONNECT_CONTEXT 0x7010
|
||||
|
||||
#define TCP_BSDURGENT 0x7000
|
||||
|
||||
#define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12)
|
||||
#if (_WIN32_WINNT < 0x0600) && (_WIN32_WINNT >= 0x0501)
|
||||
#define SIO_SOCKET_CLOSE_NOTIFY _WSAIOW(IOC_VENDOR,13)
|
||||
#endif /* >= XP && < VISTA */
|
||||
#if (_WIN32_WINNT >= 0x0600)
|
||||
#define SIO_BSP_HANDLE _WSAIOR(IOC_WS2,27)
|
||||
#define SIO_BSP_HANDLE_SELECT _WSAIOR(IOC_WS2,28)
|
||||
#define SIO_BSP_HANDLE_POLL _WSAIOR(IOC_WS2,29)
|
||||
|
||||
#define SIO_EXT_SELECT _WSAIORW(IOC_WS2,30)
|
||||
#define SIO_EXT_POLL _WSAIORW(IOC_WS2,31)
|
||||
#define SIO_EXT_SENDMSG _WSAIORW(IOC_WS2,32)
|
||||
|
||||
#define SIO_BASE_HANDLE _WSAIOR(IOC_WS2,34)
|
||||
#endif /* _WIN32_WINNT >= 0x0600 */
|
||||
|
||||
#ifndef __MSWSOCK_WS1_SHARED
|
||||
int WINAPI WSARecvEx(SOCKET s,char *buf,int len,int *flags);
|
||||
#endif /* __MSWSOCK_WS1_SHARED */
|
||||
|
||||
#define TF_DISCONNECT 0x01
|
||||
#define TF_REUSE_SOCKET 0x02
|
||||
#define TF_WRITE_BEHIND 0x04
|
||||
#define TF_USE_DEFAULT_WORKER 0x00
|
||||
#define TF_USE_SYSTEM_THREAD 0x10
|
||||
#define TF_USE_KERNEL_APC 0x20
|
||||
|
||||
#include <psdk_inc/_xmitfile.h>
|
||||
#ifndef __MSWSOCK_WS1_SHARED
|
||||
WINBOOL WINAPI TransmitFile(SOCKET hSocket,HANDLE hFile,DWORD nNumberOfBytesToWrite,DWORD nNumberOfBytesPerSend,LPOVERLAPPED lpOverlapped,LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers,DWORD dwReserved);
|
||||
WINBOOL WINAPI AcceptEx(SOCKET sListenSocket,SOCKET sAcceptSocket,PVOID lpOutputBuffer,DWORD dwReceiveDataLength,DWORD dwLocalAddressLength,DWORD dwRemoteAddressLength,LPDWORD lpdwBytesReceived,LPOVERLAPPED lpOverlapped);
|
||||
VOID WINAPI GetAcceptExSockaddrs(PVOID lpOutputBuffer,DWORD dwReceiveDataLength,DWORD dwLocalAddressLength,DWORD dwRemoteAddressLength,struct sockaddr **LocalSockaddr,LPINT LocalSockaddrLength,struct sockaddr **RemoteSockaddr,LPINT RemoteSockaddrLength);
|
||||
#endif /* __MSWSOCK_WS1_SHARED */
|
||||
|
||||
typedef WINBOOL (WINAPI *LPFN_TRANSMITFILE)(SOCKET hSocket,HANDLE hFile,DWORD nNumberOfBytesToWrite,DWORD nNumberOfBytesPerSend,LPOVERLAPPED lpOverlapped,LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers,DWORD dwReserved);
|
||||
|
||||
#define WSAID_TRANSMITFILE {0xb5367df0,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
|
||||
|
||||
typedef WINBOOL (WINAPI *LPFN_ACCEPTEX)(SOCKET sListenSocket,SOCKET sAcceptSocket,PVOID lpOutputBuffer,DWORD dwReceiveDataLength,DWORD dwLocalAddressLength,DWORD dwRemoteAddressLength,LPDWORD lpdwBytesReceived,LPOVERLAPPED lpOverlapped);
|
||||
|
||||
#define WSAID_ACCEPTEX {0xb5367df1,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
|
||||
|
||||
typedef VOID (WINAPI *LPFN_GETACCEPTEXSOCKADDRS)(PVOID lpOutputBuffer,DWORD dwReceiveDataLength,DWORD dwLocalAddressLength,DWORD dwRemoteAddressLength,struct sockaddr **LocalSockaddr,LPINT LocalSockaddrLength,struct sockaddr **RemoteSockaddr,LPINT RemoteSockaddrLength);
|
||||
|
||||
#define WSAID_GETACCEPTEXSOCKADDRS {0xb5367df2,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
|
||||
|
||||
typedef struct _TRANSMIT_PACKETS_ELEMENT {
|
||||
ULONG dwElFlags;
|
||||
#define TP_ELEMENT_MEMORY 1
|
||||
#define TP_ELEMENT_FILE 2
|
||||
#define TP_ELEMENT_EOP 4
|
||||
ULONG cLength;
|
||||
__C89_NAMELESS union {
|
||||
__C89_NAMELESS struct {
|
||||
LARGE_INTEGER nFileOffset;
|
||||
HANDLE hFile;
|
||||
};
|
||||
PVOID pBuffer;
|
||||
};
|
||||
} TRANSMIT_PACKETS_ELEMENT,*PTRANSMIT_PACKETS_ELEMENT,*LPTRANSMIT_PACKETS_ELEMENT;
|
||||
|
||||
#define TP_DISCONNECT TF_DISCONNECT
|
||||
#define TP_REUSE_SOCKET TF_REUSE_SOCKET
|
||||
#define TP_USE_DEFAULT_WORKER TF_USE_DEFAULT_WORKER
|
||||
#define TP_USE_SYSTEM_THREAD TF_USE_SYSTEM_THREAD
|
||||
#define TP_USE_KERNEL_APC TF_USE_KERNEL_APC
|
||||
|
||||
typedef WINBOOL (WINAPI *LPFN_TRANSMITPACKETS) (SOCKET hSocket,LPTRANSMIT_PACKETS_ELEMENT lpPacketArray,DWORD nElementCount,DWORD nSendSize,LPOVERLAPPED lpOverlapped,DWORD dwFlags);
|
||||
|
||||
#define WSAID_TRANSMITPACKETS {0xd9689da0,0x1f90,0x11d3,{0x99,0x71,0x00,0xc0,0x4f,0x68,0xc8,0x76}}
|
||||
|
||||
typedef WINBOOL (WINAPI *LPFN_CONNECTEX)(SOCKET s,const struct sockaddr *name,int namelen,PVOID lpSendBuffer,DWORD dwSendDataLength,LPDWORD lpdwBytesSent,LPOVERLAPPED lpOverlapped);
|
||||
|
||||
#define WSAID_CONNECTEX {0x25a207b9,0xddf3,0x4660,{0x8e,0xe9,0x76,0xe5,0x8c,0x74,0x06,0x3e}}
|
||||
|
||||
typedef WINBOOL (WINAPI *LPFN_DISCONNECTEX)(SOCKET s,LPOVERLAPPED lpOverlapped,DWORD dwFlags,DWORD dwReserved);
|
||||
|
||||
#define WSAID_DISCONNECTEX {0x7fda2e11,0x8630,0x436f,{0xa0,0x31,0xf5,0x36,0xa6,0xee,0xc1,0x57}}
|
||||
|
||||
#define DE_REUSE_SOCKET TF_REUSE_SOCKET
|
||||
|
||||
#define NLA_NAMESPACE_GUID {0x6642243a,0x3ba8,0x4aa6,{0xba,0xa5,0x2e,0xb,0xd7,0x1f,0xdd,0x83}}
|
||||
|
||||
#define NLA_SERVICE_CLASS_GUID {0x37e515,0xb5c9,0x4a43,{0xba,0xda,0x8b,0x48,0xa8,0x7a,0xd2,0x39}}
|
||||
|
||||
#define NLA_ALLUSERS_NETWORK 0x00000001
|
||||
#define NLA_FRIENDLY_NAME 0x00000002
|
||||
|
||||
typedef enum _NLA_BLOB_DATA_TYPE {
|
||||
NLA_RAW_DATA = 0,NLA_INTERFACE = 1,NLA_802_1X_LOCATION = 2,NLA_CONNECTIVITY = 3,NLA_ICS = 4
|
||||
} NLA_BLOB_DATA_TYPE,*PNLA_BLOB_DATA_TYPE;
|
||||
|
||||
typedef enum _NLA_CONNECTIVITY_TYPE {
|
||||
NLA_NETWORK_AD_HOC = 0,NLA_NETWORK_MANAGED = 1,NLA_NETWORK_UNMANAGED = 2,NLA_NETWORK_UNKNOWN = 3
|
||||
} NLA_CONNECTIVITY_TYPE,*PNLA_CONNECTIVITY_TYPE;
|
||||
|
||||
typedef enum _NLA_INTERNET {
|
||||
NLA_INTERNET_UNKNOWN = 0,NLA_INTERNET_NO = 1,NLA_INTERNET_YES = 2
|
||||
} NLA_INTERNET,*PNLA_INTERNET;
|
||||
|
||||
typedef struct _NLA_BLOB {
|
||||
struct {
|
||||
NLA_BLOB_DATA_TYPE type;
|
||||
DWORD dwSize;
|
||||
DWORD nextOffset;
|
||||
} header;
|
||||
union {
|
||||
CHAR rawData[1];
|
||||
struct {
|
||||
DWORD dwType;
|
||||
DWORD dwSpeed;
|
||||
CHAR adapterName[1];
|
||||
} interfaceData;
|
||||
struct {
|
||||
CHAR information[1];
|
||||
} locationData;
|
||||
struct {
|
||||
NLA_CONNECTIVITY_TYPE type;
|
||||
NLA_INTERNET internet;
|
||||
} connectivity;
|
||||
struct {
|
||||
struct {
|
||||
DWORD speed;
|
||||
DWORD type;
|
||||
DWORD state;
|
||||
WCHAR machineName[256];
|
||||
WCHAR sharedAdapterName[256];
|
||||
} remote;
|
||||
} ICS;
|
||||
} data;
|
||||
} NLA_BLOB,*PNLA_BLOB,*LPNLA_BLOB;
|
||||
|
||||
typedef struct _WSACMSGHDR {
|
||||
SIZE_T cmsg_len;
|
||||
INT cmsg_level;
|
||||
INT cmsg_type;
|
||||
} WSACMSGHDR,*PWSACMSGHDR,*LPWSACMSGHDR;
|
||||
|
||||
#define WSA_CMSGHDR_ALIGN(length) (((length) + TYPE_ALIGNMENT(WSACMSGHDR)-1) & (~(TYPE_ALIGNMENT(WSACMSGHDR)-1)))
|
||||
#define WSA_CMSGDATA_ALIGN(length) (((length) + MAX_NATURAL_ALIGNMENT-1) & (~(MAX_NATURAL_ALIGNMENT-1)))
|
||||
#define WSA_CMSG_FIRSTHDR(msg) (((msg)->Control.len >= sizeof(WSACMSGHDR)) ? (LPWSACMSGHDR)(msg)->Control.buf : (LPWSACMSGHDR)NULL)
|
||||
#define WSA_CMSG_NXTHDR(msg,cmsg) ((!(cmsg)) ? WSA_CMSG_FIRSTHDR(msg) : ((((u_char *)(cmsg) + WSA_CMSGHDR_ALIGN((cmsg)->cmsg_len) + sizeof(WSACMSGHDR)) > (u_char *)((msg)->Control.buf) + (msg)->Control.len) ? (LPWSACMSGHDR)NULL : (LPWSACMSGHDR)((u_char *)(cmsg) + WSA_CMSGHDR_ALIGN((cmsg)->cmsg_len))))
|
||||
#define WSA_CMSG_DATA(cmsg) ((u_char *)(cmsg) + WSA_CMSGDATA_ALIGN(sizeof(WSACMSGHDR)))
|
||||
#define WSA_CMSG_SPACE(length) (WSA_CMSGDATA_ALIGN(sizeof(WSACMSGHDR) + WSA_CMSGHDR_ALIGN(length)))
|
||||
#define WSA_CMSG_LEN(length) (WSA_CMSGDATA_ALIGN(sizeof(WSACMSGHDR)) + length)
|
||||
|
||||
#define MSG_TRUNC 0x0100
|
||||
#define MSG_CTRUNC 0x0200
|
||||
#define MSG_BCAST 0x0400
|
||||
#define MSG_MCAST 0x0800
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _MSWSOCK_ */
|
@ -1,26 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
#ifndef ___WSA_FD_TYPES_H
|
||||
#define ___WSA_FD_TYPES_H
|
||||
|
||||
#include <psdk_inc/_socket_types.h>
|
||||
|
||||
#ifndef FD_SETSIZE
|
||||
#define FD_SETSIZE 64
|
||||
#endif
|
||||
typedef struct fd_set
|
||||
{
|
||||
u_int fd_count;
|
||||
SOCKET fd_array[FD_SETSIZE];
|
||||
} fd_set;
|
||||
|
||||
typedef struct fd_set FD_SET;
|
||||
typedef struct fd_set *PFD_SET;
|
||||
typedef struct fd_set *LPFD_SET;
|
||||
|
||||
#endif /* ___WSA_FD_TYPES_H */
|
||||
|
@ -1,18 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
#ifndef _MINGW_IP_MREQ1_H
|
||||
#define _MINGW_IP_MREQ1_H
|
||||
|
||||
#include <inaddr.h>
|
||||
|
||||
struct ip_mreq {
|
||||
struct in_addr imr_multiaddr;
|
||||
struct in_addr imr_interface;
|
||||
};
|
||||
|
||||
#endif /* _MINGW_IP_MREQ1_H */
|
||||
|
@ -1,104 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
#ifndef _MINGW_IP_TYPES_H
|
||||
#define _MINGW_IP_TYPES_H
|
||||
|
||||
#include <_bsd_types.h>
|
||||
|
||||
#define h_addr h_addr_list[0]
|
||||
|
||||
struct hostent {
|
||||
char *h_name;
|
||||
char **h_aliases;
|
||||
short h_addrtype;
|
||||
short h_length;
|
||||
char **h_addr_list;
|
||||
};
|
||||
|
||||
struct netent {
|
||||
char *n_name;
|
||||
char **n_aliases;
|
||||
short n_addrtype;
|
||||
u_long n_net;
|
||||
};
|
||||
|
||||
struct servent {
|
||||
char *s_name;
|
||||
char **s_aliases;
|
||||
#ifdef _WIN64
|
||||
char *s_proto;
|
||||
short s_port;
|
||||
#else
|
||||
short s_port;
|
||||
char *s_proto;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct protoent {
|
||||
char *p_name;
|
||||
char **p_aliases;
|
||||
short p_proto;
|
||||
};
|
||||
|
||||
typedef struct hostent HOSTENT;
|
||||
typedef struct hostent *PHOSTENT;
|
||||
typedef struct hostent *LPHOSTENT;
|
||||
|
||||
typedef struct servent SERVENT;
|
||||
typedef struct servent *PSERVENT;
|
||||
typedef struct servent *LPSERVENT;
|
||||
|
||||
typedef struct protoent PROTOENT;
|
||||
typedef struct protoent *PPROTOENT;
|
||||
typedef struct protoent *LPPROTOENT;
|
||||
|
||||
|
||||
#include <inaddr.h>
|
||||
|
||||
struct sockaddr_in {
|
||||
short sin_family;
|
||||
u_short sin_port;
|
||||
struct in_addr sin_addr;
|
||||
char sin_zero[8];
|
||||
};
|
||||
|
||||
struct sockaddr {
|
||||
u_short sa_family;
|
||||
char sa_data[14];
|
||||
};
|
||||
|
||||
struct sockproto {
|
||||
u_short sp_family;
|
||||
u_short sp_protocol;
|
||||
};
|
||||
|
||||
struct linger {
|
||||
u_short l_onoff;
|
||||
u_short l_linger;
|
||||
};
|
||||
|
||||
typedef struct sockaddr SOCKADDR;
|
||||
typedef struct sockaddr *PSOCKADDR;
|
||||
typedef struct sockaddr *LPSOCKADDR;
|
||||
|
||||
typedef struct sockaddr_in SOCKADDR_IN;
|
||||
typedef struct sockaddr_in *PSOCKADDR_IN;
|
||||
typedef struct sockaddr_in *LPSOCKADDR_IN;
|
||||
|
||||
typedef struct linger LINGER;
|
||||
typedef struct linger *PLINGER;
|
||||
typedef struct linger *LPLINGER;
|
||||
|
||||
|
||||
#include <_timeval.h>
|
||||
|
||||
typedef struct timeval TIMEVAL;
|
||||
typedef struct timeval *PTIMEVAL;
|
||||
typedef struct timeval *LPTIMEVAL;
|
||||
|
||||
#endif /* _MINGW_IP_TYPES_H */
|
||||
|
@ -1,20 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
#ifndef ___WSA_SOCKET_TYPES_H
|
||||
#define ___WSA_SOCKET_TYPES_H
|
||||
|
||||
#if 1
|
||||
typedef UINT_PTR SOCKET;
|
||||
#else
|
||||
typedef INT_PTR SOCKET;
|
||||
#endif
|
||||
|
||||
#define INVALID_SOCKET (SOCKET)(~0)
|
||||
#define SOCKET_ERROR (-1)
|
||||
|
||||
#endif /* ___WSA_SOCKET_TYPES_H */
|
||||
|
@ -1,248 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
#undef FD_CLR
|
||||
#undef FD_ZERO
|
||||
#undef FD_ISSET
|
||||
#undef FD_SET
|
||||
|
||||
#undef IOCPARM_MASK
|
||||
#undef IOC_VOID
|
||||
#undef IOC_OUT
|
||||
#undef IOC_IN
|
||||
#undef IOC_INOUT
|
||||
|
||||
#undef _IO
|
||||
#undef _IOR
|
||||
#undef _IOW
|
||||
|
||||
#undef FIONREAD
|
||||
#undef FIONBIO
|
||||
#undef FIOASYNC
|
||||
|
||||
#undef SIOCSHIWAT
|
||||
#undef SIOCGHIWAT
|
||||
#undef SIOCSLOWAT
|
||||
#undef SIOCGLOWAT
|
||||
#undef SIOCATMARK
|
||||
|
||||
#undef IPPROTO_IP
|
||||
#undef IPPROTO_ICMP
|
||||
#undef IPPROTO_IGMP
|
||||
#undef IPPROTO_GGP
|
||||
#undef IPPROTO_TCP
|
||||
#undef IPPROTO_PUP
|
||||
#undef IPPROTO_UDP
|
||||
#undef IPPROTO_IDP
|
||||
#undef IPPROTO_ND
|
||||
|
||||
#undef IPPROTO_RAW
|
||||
#undef IPPROTO_MAX
|
||||
|
||||
#undef IPPORT_ECHO
|
||||
#undef IPPORT_DISCARD
|
||||
#undef IPPORT_SYSTAT
|
||||
#undef IPPORT_DAYTIME
|
||||
#undef IPPORT_NETSTAT
|
||||
#undef IPPORT_FTP
|
||||
#undef IPPORT_TELNET
|
||||
#undef IPPORT_SMTP
|
||||
#undef IPPORT_TIMESERVER
|
||||
#undef IPPORT_NAMESERVER
|
||||
#undef IPPORT_WHOIS
|
||||
#undef IPPORT_MTP
|
||||
|
||||
#undef IPPORT_TFTP
|
||||
#undef IPPORT_RJE
|
||||
#undef IPPORT_FINGER
|
||||
#undef IPPORT_TTYLINK
|
||||
#undef IPPORT_SUPDUP
|
||||
|
||||
#undef IPPORT_EXECSERVER
|
||||
#undef IPPORT_LOGINSERVER
|
||||
#undef IPPORT_CMDSERVER
|
||||
#undef IPPORT_EFSSERVER
|
||||
|
||||
#undef IPPORT_BIFFUDP
|
||||
#undef IPPORT_WHOSERVER
|
||||
#undef IPPORT_ROUTESERVER
|
||||
|
||||
#undef IPPORT_RESERVED
|
||||
|
||||
#undef IMPLINK_IP
|
||||
#undef IMPLINK_LOWEXPER
|
||||
#undef IMPLINK_HIGHEXPER
|
||||
|
||||
#undef IN_CLASSA
|
||||
#undef IN_CLASSA_NET
|
||||
#undef IN_CLASSA_NSHIFT
|
||||
#undef IN_CLASSA_HOST
|
||||
#undef IN_CLASSA_MAX
|
||||
|
||||
#undef IN_CLASSB
|
||||
#undef IN_CLASSB_NET
|
||||
#undef IN_CLASSB_NSHIFT
|
||||
#undef IN_CLASSB_HOST
|
||||
#undef IN_CLASSB_MAX
|
||||
|
||||
#undef IN_CLASSC
|
||||
#undef IN_CLASSC_NET
|
||||
#undef IN_CLASSC_NSHIFT
|
||||
#undef IN_CLASSC_HOST
|
||||
|
||||
#undef INADDR_ANY
|
||||
#undef INADDR_LOOPBACK
|
||||
#undef INADDR_BROADCAST
|
||||
#undef INADDR_NONE
|
||||
|
||||
#undef IP_OPTIONS
|
||||
#undef IP_MULTICAST_IF
|
||||
#undef IP_MULTICAST_TTL
|
||||
#undef IP_MULTICAST_LOOP
|
||||
#undef IP_ADD_MEMBERSHIP
|
||||
#undef IP_DROP_MEMBERSHIP
|
||||
#undef IP_TTL
|
||||
#undef IP_TOS
|
||||
#undef IP_DONTFRAGMENT
|
||||
|
||||
#undef IP_DEFAULT_MULTICAST_TTL
|
||||
#undef IP_DEFAULT_MULTICAST_LOOP
|
||||
#undef IP_MAX_MEMBERSHIPS
|
||||
|
||||
#undef SOCK_STREAM
|
||||
#undef SOCK_DGRAM
|
||||
#undef SOCK_RAW
|
||||
#undef SOCK_RDM
|
||||
#undef SOCK_SEQPACKET
|
||||
|
||||
#undef SO_DEBUG
|
||||
#undef SO_ACCEPTCONN
|
||||
#undef SO_REUSEADDR
|
||||
#undef SO_KEEPALIVE
|
||||
#undef SO_DONTROUTE
|
||||
#undef SO_BROADCAST
|
||||
#undef SO_USELOOPBACK
|
||||
#undef SO_LINGER
|
||||
#undef SO_OOBINLINE
|
||||
|
||||
#undef SO_DONTLINGER
|
||||
|
||||
#undef SO_SNDBUF
|
||||
#undef SO_RCVBUF
|
||||
#undef SO_SNDLOWAT
|
||||
#undef SO_RCVLOWAT
|
||||
#undef SO_SNDTIMEO
|
||||
#undef SO_RCVTIMEO
|
||||
#undef SO_ERROR
|
||||
#undef SO_TYPE
|
||||
|
||||
#undef SO_CONNDATA
|
||||
#undef SO_CONNOPT
|
||||
#undef SO_DISCDATA
|
||||
#undef SO_DISCOPT
|
||||
#undef SO_CONNDATALEN
|
||||
#undef SO_CONNOPTLEN
|
||||
#undef SO_DISCDATALEN
|
||||
#undef SO_DISCOPTLEN
|
||||
|
||||
#undef SO_OPENTYPE
|
||||
|
||||
#undef SO_SYNCHRONOUS_ALERT
|
||||
#undef SO_SYNCHRONOUS_NONALERT
|
||||
|
||||
#undef SO_MAXDG
|
||||
#undef SO_MAXPATHDG
|
||||
#undef SO_UPDATE_ACCEPT_CONTEXT
|
||||
#undef SO_CONNECT_TIME
|
||||
|
||||
#undef TCP_NODELAY
|
||||
#undef TCP_BSDURGENT
|
||||
|
||||
#undef AF_UNSPEC
|
||||
#undef AF_UNIX
|
||||
#undef AF_INET
|
||||
#undef AF_IMPLINK
|
||||
#undef AF_PUP
|
||||
#undef AF_CHAOS
|
||||
#undef AF_IPX
|
||||
#undef AF_NS
|
||||
#undef AF_ISO
|
||||
#undef AF_OSI
|
||||
#undef AF_ECMA
|
||||
#undef AF_DATAKIT
|
||||
#undef AF_CCITT
|
||||
#undef AF_SNA
|
||||
#undef AF_DECnet
|
||||
#undef AF_DLI
|
||||
#undef AF_LAT
|
||||
#undef AF_HYLINK
|
||||
#undef AF_APPLETALK
|
||||
#undef AF_NETBIOS
|
||||
#undef AF_VOICEVIEW
|
||||
#undef AF_FIREFOX
|
||||
#undef AF_UNKNOWN1
|
||||
#undef AF_BAN
|
||||
|
||||
#undef AF_MAX
|
||||
|
||||
#undef PF_UNSPEC
|
||||
#undef PF_UNIX
|
||||
#undef PF_INET
|
||||
#undef PF_IMPLINK
|
||||
#undef PF_PUP
|
||||
#undef PF_CHAOS
|
||||
#undef PF_NS
|
||||
#undef PF_IPX
|
||||
#undef PF_ISO
|
||||
#undef PF_OSI
|
||||
#undef PF_ECMA
|
||||
#undef PF_DATAKIT
|
||||
#undef PF_CCITT
|
||||
#undef PF_SNA
|
||||
#undef PF_DECnet
|
||||
#undef PF_DLI
|
||||
#undef PF_LAT
|
||||
#undef PF_HYLINK
|
||||
#undef PF_APPLETALK
|
||||
#undef PF_VOICEVIEW
|
||||
#undef PF_FIREFOX
|
||||
#undef PF_UNKNOWN1
|
||||
#undef PF_BAN
|
||||
|
||||
#undef PF_MAX
|
||||
|
||||
#undef SOL_SOCKET
|
||||
|
||||
#undef SOMAXCONN
|
||||
|
||||
#undef MSG_OOB
|
||||
#undef MSG_PEEK
|
||||
#undef MSG_DONTROUTE
|
||||
|
||||
#undef MSG_MAXIOVLEN
|
||||
|
||||
#undef MSG_PARTIAL
|
||||
|
||||
#undef MAXGETHOSTSTRUCT
|
||||
|
||||
#undef FD_READ
|
||||
#undef FD_WRITE
|
||||
#undef FD_OOB
|
||||
#undef FD_ACCEPT
|
||||
#undef FD_CONNECT
|
||||
#undef FD_CLOSE
|
||||
|
||||
#undef TF_DISCONNECT
|
||||
#undef TF_REUSE_SOCKET
|
||||
#undef TF_WRITE_BEHIND
|
||||
|
||||
#undef WSAMAKEASYNCREPLY
|
||||
#undef WSAMAKESELECTREPLY
|
||||
#undef WSAGETASYNCBUFLEN
|
||||
#undef WSAGETASYNCERROR
|
||||
#undef WSAGETSELECTEVENT
|
||||
#undef WSAGETSELECTERROR
|
||||
|
@ -1,225 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
#ifndef WSABASEERR
|
||||
|
||||
#define WSABASEERR 10000
|
||||
|
||||
#define WSAEINTR (WSABASEERR + 4 )
|
||||
#define WSAEBADF (WSABASEERR + 9 )
|
||||
#define WSAEACCES (WSABASEERR + 13 )
|
||||
#define WSAEFAULT (WSABASEERR + 14 )
|
||||
#define WSAEINVAL (WSABASEERR + 22 )
|
||||
#define WSAEMFILE (WSABASEERR + 24 )
|
||||
|
||||
#define WSAEWOULDBLOCK (WSABASEERR + 35 )
|
||||
#define WSAEINPROGRESS (WSABASEERR + 36 )
|
||||
#define WSAEALREADY (WSABASEERR + 37 )
|
||||
#define WSAENOTSOCK (WSABASEERR + 38 )
|
||||
#define WSAEDESTADDRREQ (WSABASEERR + 39 )
|
||||
#define WSAEMSGSIZE (WSABASEERR + 40 )
|
||||
#define WSAEPROTOTYPE (WSABASEERR + 41 )
|
||||
#define WSAENOPROTOOPT (WSABASEERR + 42 )
|
||||
#define WSAEPROTONOSUPPORT (WSABASEERR + 43 )
|
||||
#define WSAESOCKTNOSUPPORT (WSABASEERR + 44 )
|
||||
#define WSAEOPNOTSUPP (WSABASEERR + 45 )
|
||||
#define WSAEPFNOSUPPORT (WSABASEERR + 46 )
|
||||
#define WSAEAFNOSUPPORT (WSABASEERR + 47 )
|
||||
#define WSAEADDRINUSE (WSABASEERR + 48 )
|
||||
#define WSAEADDRNOTAVAIL (WSABASEERR + 49 )
|
||||
#define WSAENETDOWN (WSABASEERR + 50 )
|
||||
#define WSAENETUNREACH (WSABASEERR + 51 )
|
||||
#define WSAENETRESET (WSABASEERR + 52 )
|
||||
#define WSAECONNABORTED (WSABASEERR + 53 )
|
||||
#define WSAECONNRESET (WSABASEERR + 54 )
|
||||
#define WSAENOBUFS (WSABASEERR + 55 )
|
||||
#define WSAEISCONN (WSABASEERR + 56 )
|
||||
#define WSAENOTCONN (WSABASEERR + 57 )
|
||||
#define WSAESHUTDOWN (WSABASEERR + 58 )
|
||||
#define WSAETOOMANYREFS (WSABASEERR + 59 )
|
||||
#define WSAETIMEDOUT (WSABASEERR + 60 )
|
||||
#define WSAECONNREFUSED (WSABASEERR + 61 )
|
||||
#define WSAELOOP (WSABASEERR + 62 )
|
||||
#define WSAENAMETOOLONG (WSABASEERR + 63 )
|
||||
#define WSAEHOSTDOWN (WSABASEERR + 64 )
|
||||
#define WSAEHOSTUNREACH (WSABASEERR + 65 )
|
||||
#define WSAENOTEMPTY (WSABASEERR + 66 )
|
||||
#define WSAEPROCLIM (WSABASEERR + 67 )
|
||||
#define WSAEUSERS (WSABASEERR + 68 )
|
||||
#define WSAEDQUOT (WSABASEERR + 69 )
|
||||
#define WSAESTALE (WSABASEERR + 70 )
|
||||
#define WSAEREMOTE (WSABASEERR + 71 )
|
||||
|
||||
#define WSASYSNOTREADY (WSABASEERR + 91 )
|
||||
#define WSAVERNOTSUPPORTED (WSABASEERR + 92 )
|
||||
#define WSANOTINITIALISED (WSABASEERR + 93 )
|
||||
|
||||
#define WSAEDISCON (WSABASEERR + 101 )
|
||||
|
||||
#ifndef WSAHOST_NOT_FOUND
|
||||
#define WSAHOST_NOT_FOUND (WSABASEERR + 1001)
|
||||
#endif
|
||||
#ifndef WSATRY_AGAIN
|
||||
#define WSATRY_AGAIN (WSABASEERR + 1002)
|
||||
#endif
|
||||
#ifndef WSANO_RECOVERY
|
||||
#define WSANO_RECOVERY (WSABASEERR + 1003)
|
||||
#endif
|
||||
#ifndef WSANO_DATA
|
||||
#define WSANO_DATA (WSABASEERR + 1004)
|
||||
#endif
|
||||
|
||||
#endif /* WSABASEERR */
|
||||
|
||||
#ifdef _WINSOCK2API_
|
||||
|
||||
#ifndef WSAENOMORE
|
||||
#define WSAENOMORE (WSABASEERR + 102)
|
||||
#endif
|
||||
#ifndef WSAECANCELLED
|
||||
#define WSAECANCELLED (WSABASEERR + 103)
|
||||
#endif
|
||||
#ifndef WSAEINVALIDPROCTABLE
|
||||
#define WSAEINVALIDPROCTABLE (WSABASEERR + 104)
|
||||
#endif
|
||||
#ifndef WSAEINVALIDPROVIDER
|
||||
#define WSAEINVALIDPROVIDER (WSABASEERR + 105)
|
||||
#endif
|
||||
#ifndef WSAEPROVIDERFAILEDINIT
|
||||
#define WSAEPROVIDERFAILEDINIT (WSABASEERR + 106)
|
||||
#endif
|
||||
#ifndef WSASYSCALLFAILURE
|
||||
#define WSASYSCALLFAILURE (WSABASEERR + 107)
|
||||
#endif
|
||||
#ifndef WSASERVICE_NOT_FOUND
|
||||
#define WSASERVICE_NOT_FOUND (WSABASEERR + 108)
|
||||
#endif
|
||||
#ifndef WSATYPE_NOT_FOUND
|
||||
#define WSATYPE_NOT_FOUND (WSABASEERR + 109)
|
||||
#endif
|
||||
#ifndef WSA_E_NO_MORE
|
||||
#define WSA_E_NO_MORE (WSABASEERR + 110)
|
||||
#endif
|
||||
#ifndef WSA_E_CANCELLED
|
||||
#define WSA_E_CANCELLED (WSABASEERR + 111)
|
||||
#endif
|
||||
#ifndef WSAEREFUSED
|
||||
#define WSAEREFUSED (WSABASEERR + 112)
|
||||
#endif
|
||||
#ifndef WSA_QOS_RECEIVERS
|
||||
#define WSA_QOS_RECEIVERS (WSABASEERR + 1005)
|
||||
#endif
|
||||
#ifndef WSA_QOS_SENDERS
|
||||
#define WSA_QOS_SENDERS (WSABASEERR + 1006)
|
||||
#endif
|
||||
#ifndef WSA_QOS_NO_SENDERS
|
||||
#define WSA_QOS_NO_SENDERS (WSABASEERR + 1007)
|
||||
#define WSA_QOS_NO_RECEIVERS (WSABASEERR + 1008)
|
||||
#define WSA_QOS_REQUEST_CONFIRMED (WSABASEERR + 1009)
|
||||
#define WSA_QOS_ADMISSION_FAILURE (WSABASEERR + 1010)
|
||||
#define WSA_QOS_POLICY_FAILURE (WSABASEERR + 1011)
|
||||
#define WSA_QOS_BAD_STYLE (WSABASEERR + 1012)
|
||||
#define WSA_QOS_BAD_OBJECT (WSABASEERR + 1013)
|
||||
#define WSA_QOS_TRAFFIC_CTRL_ERROR (WSABASEERR + 1014)
|
||||
#define WSA_QOS_GENERIC_ERROR (WSABASEERR + 1015)
|
||||
#define WSA_QOS_ESERVICETYPE (WSABASEERR + 1016)
|
||||
#define WSA_QOS_EFLOWSPEC (WSABASEERR + 1017)
|
||||
#define WSA_QOS_EPROVSPECBUF (WSABASEERR + 1018)
|
||||
#endif
|
||||
#ifndef WSA_QOS_EFILTERSTYLE
|
||||
#define WSA_QOS_EFILTERSTYLE (WSABASEERR + 1019)
|
||||
#endif
|
||||
#ifndef WSA_QOS_EFILTERTYPE
|
||||
#define WSA_QOS_EFILTERTYPE (WSABASEERR + 1020)
|
||||
#endif
|
||||
#ifndef WSA_QOS_EFILTERCOUNT
|
||||
#define WSA_QOS_EFILTERCOUNT (WSABASEERR + 1021)
|
||||
#endif
|
||||
#ifndef WSA_QOS_EOBJLENGTH
|
||||
#define WSA_QOS_EOBJLENGTH (WSABASEERR + 1022)
|
||||
#endif
|
||||
#ifndef WSA_QOS_EFLOWCOUNT
|
||||
#define WSA_QOS_EFLOWCOUNT (WSABASEERR + 1023)
|
||||
#endif
|
||||
#ifndef WSA_QOS_EUNKNOWNPSOBJ
|
||||
#define WSA_QOS_EUNKNOWNPSOBJ (WSABASEERR + 1024)
|
||||
#endif
|
||||
#ifndef WSA_QOS_EPOLICYOBJ
|
||||
#define WSA_QOS_EPOLICYOBJ (WSABASEERR + 1025)
|
||||
#endif
|
||||
#ifndef WSA_QOS_EFLOWDESC
|
||||
#define WSA_QOS_EFLOWDESC (WSABASEERR + 1026)
|
||||
#endif
|
||||
#ifndef WSA_QOS_EPSFLOWSPEC
|
||||
#define WSA_QOS_EPSFLOWSPEC (WSABASEERR + 1027)
|
||||
#endif
|
||||
#ifndef WSA_QOS_EPSFILTERSPEC
|
||||
#define WSA_QOS_EPSFILTERSPEC (WSABASEERR + 1028)
|
||||
#endif
|
||||
#ifndef WSA_QOS_ESDMODEOBJ
|
||||
#define WSA_QOS_ESDMODEOBJ (WSABASEERR + 1029)
|
||||
#endif
|
||||
#ifndef WSA_QOS_ESHAPERATEOBJ
|
||||
#define WSA_QOS_ESHAPERATEOBJ (WSABASEERR + 1030)
|
||||
#endif
|
||||
#ifndef WSA_QOS_RESERVED_PETYPE
|
||||
#define WSA_QOS_RESERVED_PETYPE (WSABASEERR + 1031)
|
||||
#endif
|
||||
|
||||
#endif /* _WINSOCK2API_ */
|
||||
|
||||
#ifndef __WSA_ERR_MACROS_DEFINED
|
||||
#define __WSA_ERR_MACROS_DEFINED
|
||||
#define h_errno WSAGetLastError()
|
||||
#define HOST_NOT_FOUND WSAHOST_NOT_FOUND
|
||||
#define TRY_AGAIN WSATRY_AGAIN
|
||||
#define NO_RECOVERY WSANO_RECOVERY
|
||||
#define NO_DATA WSANO_DATA
|
||||
|
||||
#define WSANO_ADDRESS WSANO_DATA
|
||||
#define NO_ADDRESS WSANO_ADDRESS
|
||||
#endif /* __WSA_ERR_MACROS_DEFINED */
|
||||
|
||||
#if 0
|
||||
#define EWOULDBLOCK WSAEWOULDBLOCK
|
||||
#define EINPROGRESS WSAEINPROGRESS
|
||||
#define EALREADY WSAEALREADY
|
||||
#define ENOTSOCK WSAENOTSOCK
|
||||
#define EDESTADDRREQ WSAEDESTADDRREQ
|
||||
#define EMSGSIZE WSAEMSGSIZE
|
||||
#define EPROTOTYPE WSAEPROTOTYPE
|
||||
#define ENOPROTOOPT WSAENOPROTOOPT
|
||||
#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
|
||||
#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
|
||||
#define EOPNOTSUPP WSAEOPNOTSUPP
|
||||
#define EPFNOSUPPORT WSAEPFNOSUPPORT
|
||||
#define EAFNOSUPPORT WSAEAFNOSUPPORT
|
||||
#define EADDRINUSE WSAEADDRINUSE
|
||||
#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
|
||||
#define ENETDOWN WSAENETDOWN
|
||||
#define ENETUNREACH WSAENETUNREACH
|
||||
#define ENETRESET WSAENETRESET
|
||||
#define ECONNABORTED WSAECONNABORTED
|
||||
#define ECONNRESET WSAECONNRESET
|
||||
#define ENOBUFS WSAENOBUFS
|
||||
#define EISCONN WSAEISCONN
|
||||
#define ENOTCONN WSAENOTCONN
|
||||
#define ESHUTDOWN WSAESHUTDOWN
|
||||
#define ETOOMANYREFS WSAETOOMANYREFS
|
||||
#define ETIMEDOUT WSAETIMEDOUT
|
||||
#define ECONNREFUSED WSAECONNREFUSED
|
||||
#define ELOOP WSAELOOP
|
||||
#define ENAMETOOLONG WSAENAMETOOLONG
|
||||
#define EHOSTDOWN WSAEHOSTDOWN
|
||||
#define EHOSTUNREACH WSAEHOSTUNREACH
|
||||
#define ENOTEMPTY WSAENOTEMPTY
|
||||
#define EPROCLIM WSAEPROCLIM
|
||||
#define EUSERS WSAEUSERS
|
||||
#define EDQUOT WSAEDQUOT
|
||||
#define ESTALE WSAESTALE
|
||||
#define EREMOTE WSAEREMOTE
|
||||
#endif /* #if 0 */
|
||||
|
@ -1,32 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
#ifndef __MINGW_WSADATA_H
|
||||
#define __MINGW_WSADATA_H
|
||||
|
||||
#define WSADESCRIPTION_LEN 256
|
||||
#define WSASYS_STATUS_LEN 128
|
||||
|
||||
typedef struct WSAData {
|
||||
WORD wVersion;
|
||||
WORD wHighVersion;
|
||||
#ifdef _WIN64
|
||||
unsigned short iMaxSockets;
|
||||
unsigned short iMaxUdpDg;
|
||||
char *lpVendorInfo;
|
||||
char szDescription[WSADESCRIPTION_LEN+1];
|
||||
char szSystemStatus[WSASYS_STATUS_LEN+1];
|
||||
#else
|
||||
char szDescription[WSADESCRIPTION_LEN+1];
|
||||
char szSystemStatus[WSASYS_STATUS_LEN+1];
|
||||
unsigned short iMaxSockets;
|
||||
unsigned short iMaxUdpDg;
|
||||
char *lpVendorInfo;
|
||||
#endif
|
||||
} WSADATA, *LPWSADATA;
|
||||
|
||||
#endif /* __MINGW_WSADATA_H */
|
||||
|
@ -1,18 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the mingw-w64 runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
#ifndef __MINGW_TRANSMIT_FILE_H
|
||||
#define __MINGW_TRANSMIT_FILE_H
|
||||
|
||||
typedef struct _TRANSMIT_FILE_BUFFERS {
|
||||
LPVOID Head;
|
||||
DWORD HeadLength;
|
||||
LPVOID Tail;
|
||||
DWORD TailLength;
|
||||
} TRANSMIT_FILE_BUFFERS, *PTRANSMIT_FILE_BUFFERS, *LPTRANSMIT_FILE_BUFFERS;
|
||||
|
||||
#endif /* __MINGW_TRANSMIT_FILE_H */
|
||||
|
@ -1,72 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
#ifndef __QOS_H_
|
||||
#define __QOS_H_
|
||||
|
||||
typedef ULONG SERVICETYPE;
|
||||
|
||||
#define SERVICETYPE_NOTRAFFIC 0x00000000
|
||||
#define SERVICETYPE_BESTEFFORT 0x00000001
|
||||
#define SERVICETYPE_CONTROLLEDLOAD 0x00000002
|
||||
#define SERVICETYPE_GUARANTEED 0x00000003
|
||||
|
||||
#define SERVICETYPE_NETWORK_UNAVAILABLE 0x00000004
|
||||
#define SERVICETYPE_GENERAL_INFORMATION 0x00000005
|
||||
#define SERVICETYPE_NOCHANGE 0x00000006
|
||||
#define SERVICETYPE_NONCONFORMING 0x00000009
|
||||
#define SERVICETYPE_NETWORK_CONTROL 0x0000000A
|
||||
#define SERVICETYPE_QUALITATIVE 0x0000000D
|
||||
|
||||
#define SERVICE_BESTEFFORT 0x80010000
|
||||
#define SERVICE_CONTROLLEDLOAD 0x80020000
|
||||
#define SERVICE_GUARANTEED 0x80040000
|
||||
#define SERVICE_QUALITATIVE 0x80200000
|
||||
|
||||
#define SERVICE_NO_TRAFFIC_CONTROL 0x81000000
|
||||
|
||||
#define SERVICE_NO_QOS_SIGNALING 0x40000000
|
||||
|
||||
typedef struct _flowspec {
|
||||
ULONG TokenRate;
|
||||
ULONG TokenBucketSize;
|
||||
ULONG PeakBandwidth;
|
||||
ULONG Latency;
|
||||
ULONG DelayVariation;
|
||||
SERVICETYPE ServiceType;
|
||||
ULONG MaxSduSize;
|
||||
ULONG MinimumPolicedSize;
|
||||
} FLOWSPEC,*PFLOWSPEC,*LPFLOWSPEC;
|
||||
|
||||
#define QOS_NOT_SPECIFIED 0xFFFFFFFF
|
||||
#define POSITIVE_INFINITY_RATE 0xFFFFFFFE
|
||||
|
||||
typedef struct _QOS_OBJECT_HDR {
|
||||
ULONG ObjectType;
|
||||
ULONG ObjectLength;
|
||||
} QOS_OBJECT_HDR, *LPQOS_OBJECT_HDR;
|
||||
|
||||
#define QOS_GENERAL_ID_BASE 2000
|
||||
#define QOS_OBJECT_END_OF_LIST (0x00000001 + QOS_GENERAL_ID_BASE)
|
||||
#define QOS_OBJECT_SD_MODE (0x00000002 + QOS_GENERAL_ID_BASE)
|
||||
#define QOS_OBJECT_SHAPING_RATE (0x00000003 + QOS_GENERAL_ID_BASE)
|
||||
#define QOS_OBJECT_DESTADDR (0x00000004 + QOS_GENERAL_ID_BASE)
|
||||
|
||||
typedef struct _QOS_SD_MODE {
|
||||
QOS_OBJECT_HDR ObjectHdr;
|
||||
ULONG ShapeDiscardMode;
|
||||
} QOS_SD_MODE, *LPQOS_SD_MODE;
|
||||
|
||||
#define TC_NONCONF_BORROW 0
|
||||
#define TC_NONCONF_SHAPE 1
|
||||
#define TC_NONCONF_DISCARD 2
|
||||
#define TC_NONCONF_BORROW_PLUS 3
|
||||
|
||||
typedef struct _QOS_SHAPING_RATE {
|
||||
QOS_OBJECT_HDR ObjectHdr;
|
||||
ULONG ShapingRate;
|
||||
} QOS_SHAPING_RATE, *LPQOS_SHAPING_RATE;
|
||||
|
||||
#endif
|
@ -1,904 +0,0 @@
|
||||
/**
|
||||
* This file is part of the mingw-w64 runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER within this package.
|
||||
*/
|
||||
|
||||
#ifndef _INC_SHELLAPI
|
||||
#define _INC_SHELLAPI
|
||||
|
||||
#include <_mingw_unicode.h>
|
||||
#include <specstrings.h>
|
||||
|
||||
#ifndef WINSHELLAPI
|
||||
#ifndef _SHELL32_
|
||||
#define WINSHELLAPI DECLSPEC_IMPORT
|
||||
#else
|
||||
#define WINSHELLAPI
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef SHSTDAPI
|
||||
#ifndef _SHELL32_
|
||||
#ifdef __cplusplus
|
||||
#define SHSTDAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
|
||||
#define SHSTDAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
|
||||
#else
|
||||
#define SHSTDAPI DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
|
||||
#define SHSTDAPI_(type) DECLSPEC_IMPORT type STDAPICALLTYPE
|
||||
#endif
|
||||
#else
|
||||
#define SHSTDAPI STDAPI
|
||||
#define SHSTDAPI_(type) STDAPI_(type)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef SHDOCAPI
|
||||
#ifndef _SHDOCVW_
|
||||
#ifdef __cplusplus
|
||||
#define SHDOCAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
|
||||
#define SHDOCAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
|
||||
#else
|
||||
#define SHDOCAPI DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
|
||||
#define SHDOCAPI_(type) DECLSPEC_IMPORT type STDAPICALLTYPE
|
||||
#endif
|
||||
#else
|
||||
#define SHDOCAPI STDAPI
|
||||
#define SHDOCAPI_(type) STDAPI_(type)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _WIN64
|
||||
#include <pshpack1.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
|
||||
DECLARE_HANDLE (HDROP);
|
||||
|
||||
#define DragQueryFile __MINGW_NAME_AW(DragQueryFile)
|
||||
#define ShellExecute __MINGW_NAME_AW(ShellExecute)
|
||||
#define FindExecutable __MINGW_NAME_AW(FindExecutable)
|
||||
#define ShellAbout __MINGW_NAME_AW(ShellAbout)
|
||||
#define ExtractAssociatedIcon __MINGW_NAME_AW(ExtractAssociatedIcon)
|
||||
#define ExtractAssociatedIconEx __MINGW_NAME_AW(ExtractAssociatedIconEx)
|
||||
#define ExtractIcon __MINGW_NAME_AW(ExtractIcon)
|
||||
|
||||
SHSTDAPI_(UINT) DragQueryFileA (HDROP hDrop, UINT iFile, LPSTR lpszFile, UINT cch);
|
||||
SHSTDAPI_(UINT) DragQueryFileW (HDROP hDrop, UINT iFile, LPWSTR lpszFile, UINT cch);
|
||||
SHSTDAPI_(WINBOOL) DragQueryPoint (HDROP hDrop, POINT *ppt);
|
||||
SHSTDAPI_(void) DragFinish (HDROP hDrop);
|
||||
SHSTDAPI_(void) DragAcceptFiles (HWND hWnd, WINBOOL fAccept);
|
||||
SHSTDAPI_(HINSTANCE) ShellExecuteA (HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT nShowCmd);
|
||||
SHSTDAPI_(HINSTANCE) ShellExecuteW (HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd);
|
||||
SHSTDAPI_(HINSTANCE) FindExecutableA (LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResult);
|
||||
SHSTDAPI_(HINSTANCE) FindExecutableW (LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpResult);
|
||||
SHSTDAPI_(LPWSTR *) CommandLineToArgvW (LPCWSTR lpCmdLine, int *pNumArgs);
|
||||
SHSTDAPI_(INT) ShellAboutA (HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon);
|
||||
SHSTDAPI_(INT) ShellAboutW (HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon);
|
||||
SHSTDAPI_(HICON) DuplicateIcon (HINSTANCE hInst, HICON hIcon);
|
||||
SHSTDAPI_(HICON) ExtractAssociatedIconA (HINSTANCE hInst, LPSTR pszIconPath, WORD *piIcon);
|
||||
SHSTDAPI_(HICON) ExtractAssociatedIconW (HINSTANCE hInst, LPWSTR pszIconPath, WORD *piIcon);
|
||||
SHSTDAPI_(HICON) ExtractAssociatedIconExA (HINSTANCE hInst, LPSTR pszIconPath, WORD *piIconIndex, WORD *piIconId);
|
||||
SHSTDAPI_(HICON) ExtractAssociatedIconExW (HINSTANCE hInst, LPWSTR pszIconPath, WORD *piIconIndex, WORD *piIconId);
|
||||
SHSTDAPI_(HICON) ExtractIconA (HINSTANCE hInst, LPCSTR pszExeFileName, UINT nIconIndex);
|
||||
SHSTDAPI_(HICON) ExtractIconW (HINSTANCE hInst, LPCWSTR pszExeFileName, UINT nIconIndex);
|
||||
|
||||
typedef struct _DRAGINFOA {
|
||||
UINT uSize;
|
||||
POINT pt;
|
||||
WINBOOL fNC;
|
||||
LPSTR lpFileList;
|
||||
DWORD grfKeyState;
|
||||
} DRAGINFOA,*LPDRAGINFOA;
|
||||
|
||||
typedef struct _DRAGINFOW {
|
||||
UINT uSize;
|
||||
POINT pt;
|
||||
WINBOOL fNC;
|
||||
LPWSTR lpFileList;
|
||||
DWORD grfKeyState;
|
||||
} DRAGINFOW,*LPDRAGINFOW;
|
||||
|
||||
__MINGW_TYPEDEF_AW(DRAGINFO)
|
||||
__MINGW_TYPEDEF_AW(LPDRAGINFO)
|
||||
|
||||
#define ABM_NEW 0x00000000
|
||||
#define ABM_REMOVE 0x00000001
|
||||
#define ABM_QUERYPOS 0x00000002
|
||||
#define ABM_SETPOS 0x00000003
|
||||
#define ABM_GETSTATE 0x00000004
|
||||
#define ABM_GETTASKBARPOS 0x00000005
|
||||
#define ABM_ACTIVATE 0x00000006
|
||||
#define ABM_GETAUTOHIDEBAR 0x00000007
|
||||
#define ABM_SETAUTOHIDEBAR 0x00000008
|
||||
|
||||
#define ABM_WINDOWPOSCHANGED 0x0000009
|
||||
#define ABM_SETSTATE 0x0000000a
|
||||
#if NTDDI_VERSION >= 0x06020000
|
||||
#define ABM_GETAUTOHIDEBAREX 0x0000000b
|
||||
#define ABM_SETAUTOHIDEBAREX 0x0000000c
|
||||
#endif
|
||||
|
||||
#define ABN_STATECHANGE 0x0000000
|
||||
#define ABN_POSCHANGED 0x0000001
|
||||
#define ABN_FULLSCREENAPP 0x0000002
|
||||
#define ABN_WINDOWARRANGE 0x0000003
|
||||
|
||||
#define ABS_AUTOHIDE 0x0000001
|
||||
#define ABS_ALWAYSONTOP 0x0000002
|
||||
|
||||
#define ABE_LEFT 0
|
||||
#define ABE_TOP 1
|
||||
#define ABE_RIGHT 2
|
||||
#define ABE_BOTTOM 3
|
||||
|
||||
typedef struct _AppBarData {
|
||||
DWORD cbSize;
|
||||
HWND hWnd;
|
||||
UINT uCallbackMessage;
|
||||
UINT uEdge;
|
||||
RECT rc;
|
||||
LPARAM lParam;
|
||||
} APPBARDATA,*PAPPBARDATA;
|
||||
|
||||
SHSTDAPI_(UINT_PTR) SHAppBarMessage (DWORD dwMessage, PAPPBARDATA pData);
|
||||
SHSTDAPI_(DWORD) DoEnvironmentSubstA (LPSTR pszSrc, UINT cchSrc);
|
||||
SHSTDAPI_(DWORD) DoEnvironmentSubstW (LPWSTR pszSrc, UINT cchSrc);
|
||||
SHSTDAPI_(UINT) ExtractIconExA (LPCSTR lpszFile, int nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons);
|
||||
SHSTDAPI_(UINT) ExtractIconExW (LPCWSTR lpszFile, int nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons);
|
||||
|
||||
#define DoEnvironmentSubst __MINGW_NAME_AW(DoEnvironmentSubst)
|
||||
#define ExtractIconEx __MINGW_NAME_AW(ExtractIconEx)
|
||||
|
||||
#define EIRESID(x) (-1 * (int)(x))
|
||||
|
||||
#define FO_MOVE 0x1
|
||||
#define FO_COPY 0x2
|
||||
#define FO_DELETE 0x3
|
||||
#define FO_RENAME 0x4
|
||||
|
||||
#define FOF_MULTIDESTFILES 0x1
|
||||
#define FOF_CONFIRMMOUSE 0x2
|
||||
#define FOF_SILENT 0x4
|
||||
#define FOF_RENAMEONCOLLISION 0x8
|
||||
#define FOF_NOCONFIRMATION 0x10
|
||||
#define FOF_WANTMAPPINGHANDLE 0x20
|
||||
#define FOF_ALLOWUNDO 0x40
|
||||
#define FOF_FILESONLY 0x80
|
||||
#define FOF_SIMPLEPROGRESS 0x100
|
||||
#define FOF_NOCONFIRMMKDIR 0x200
|
||||
#define FOF_NOERRORUI 0x400
|
||||
#define FOF_NOCOPYSECURITYATTRIBS 0x800
|
||||
#define FOF_NORECURSION 0x1000
|
||||
#define FOF_NO_CONNECTED_ELEMENTS 0x2000
|
||||
#define FOF_WANTNUKEWARNING 0x4000
|
||||
#define FOF_NORECURSEREPARSE 0x8000
|
||||
|
||||
#define FOF_NO_UI (FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NOCONFIRMMKDIR)
|
||||
|
||||
typedef WORD FILEOP_FLAGS;
|
||||
|
||||
#define PO_DELETE 0x0013
|
||||
#define PO_RENAME 0x0014
|
||||
#define PO_PORTCHANGE 0x0020
|
||||
|
||||
#define PO_REN_PORT 0x0034
|
||||
|
||||
typedef WORD PRINTEROP_FLAGS;
|
||||
|
||||
typedef struct _SHFILEOPSTRUCTA {
|
||||
HWND hwnd;
|
||||
UINT wFunc;
|
||||
LPCSTR pFrom;
|
||||
LPCSTR pTo;
|
||||
FILEOP_FLAGS fFlags;
|
||||
WINBOOL fAnyOperationsAborted;
|
||||
LPVOID hNameMappings;
|
||||
PCSTR lpszProgressTitle;
|
||||
} SHFILEOPSTRUCTA,*LPSHFILEOPSTRUCTA;
|
||||
|
||||
typedef struct _SHFILEOPSTRUCTW {
|
||||
HWND hwnd;
|
||||
UINT wFunc;
|
||||
LPCWSTR pFrom;
|
||||
LPCWSTR pTo;
|
||||
FILEOP_FLAGS fFlags;
|
||||
WINBOOL fAnyOperationsAborted;
|
||||
LPVOID hNameMappings;
|
||||
PCWSTR lpszProgressTitle;
|
||||
} SHFILEOPSTRUCTW,*LPSHFILEOPSTRUCTW;
|
||||
|
||||
__MINGW_TYPEDEF_AW(SHFILEOPSTRUCT)
|
||||
__MINGW_TYPEDEF_AW(LPSHFILEOPSTRUCT)
|
||||
|
||||
SHSTDAPI_(int) SHFileOperationA (LPSHFILEOPSTRUCTA lpFileOp);
|
||||
SHSTDAPI_(int) SHFileOperationW (LPSHFILEOPSTRUCTW lpFileOp);
|
||||
|
||||
#define SHFileOperation __MINGW_NAME_AW(SHFileOperation)
|
||||
|
||||
SHSTDAPI_(void) SHFreeNameMappings (HANDLE hNameMappings);
|
||||
|
||||
typedef struct _SHNAMEMAPPINGA {
|
||||
LPSTR pszOldPath;
|
||||
LPSTR pszNewPath;
|
||||
int cchOldPath;
|
||||
int cchNewPath;
|
||||
} SHNAMEMAPPINGA,*LPSHNAMEMAPPINGA;
|
||||
|
||||
typedef struct _SHNAMEMAPPINGW {
|
||||
LPWSTR pszOldPath;
|
||||
LPWSTR pszNewPath;
|
||||
int cchOldPath;
|
||||
int cchNewPath;
|
||||
} SHNAMEMAPPINGW,*LPSHNAMEMAPPINGW;
|
||||
|
||||
|
||||
__MINGW_TYPEDEF_AW(SHNAMEMAPPING)
|
||||
__MINGW_TYPEDEF_AW(LPSHNAMEMAPPING)
|
||||
|
||||
#define SE_ERR_FNF 2
|
||||
#define SE_ERR_PNF 3
|
||||
#define SE_ERR_ACCESSDENIED 5
|
||||
#define SE_ERR_OOM 8
|
||||
#define SE_ERR_DLLNOTFOUND 32
|
||||
|
||||
#define SE_ERR_SHARE 26
|
||||
#define SE_ERR_ASSOCINCOMPLETE 27
|
||||
#define SE_ERR_DDETIMEOUT 28
|
||||
#define SE_ERR_DDEFAIL 29
|
||||
#define SE_ERR_DDEBUSY 30
|
||||
#define SE_ERR_NOASSOC 31
|
||||
|
||||
#define SEE_MASK_DEFAULT 0x0
|
||||
#define SEE_MASK_CLASSNAME 0x1
|
||||
#define SEE_MASK_CLASSKEY 0x3
|
||||
|
||||
#define SEE_MASK_IDLIST 0x4
|
||||
#define SEE_MASK_INVOKEIDLIST 0xc
|
||||
#if NTDDI_VERSION < 0x06000000
|
||||
#define SEE_MASK_ICON 0x10
|
||||
#endif
|
||||
#define SEE_MASK_HOTKEY 0x20
|
||||
#define SEE_MASK_NOCLOSEPROCESS 0x40
|
||||
#define SEE_MASK_CONNECTNETDRV 0x80
|
||||
#define SEE_MASK_NOASYNC 0x100
|
||||
#define SEE_MASK_FLAG_DDEWAIT SEE_MASK_NOASYNC
|
||||
#define SEE_MASK_DOENVSUBST 0x200
|
||||
#define SEE_MASK_FLAG_NO_UI 0x400
|
||||
#define SEE_MASK_UNICODE 0x4000
|
||||
#define SEE_MASK_NO_CONSOLE 0x8000
|
||||
#define SEE_MASK_ASYNCOK 0x100000
|
||||
#define SEE_MASK_HMONITOR 0x200000
|
||||
#define SEE_MASK_NOZONECHECKS 0x800000
|
||||
#define SEE_MASK_NOQUERYCLASSSTORE 0x1000000
|
||||
#define SEE_MASK_WAITFORINPUTIDLE 0x2000000
|
||||
#define SEE_MASK_FLAG_LOG_USAGE 0x4000000
|
||||
#if NTDDI_VERSION >= 0x06020000
|
||||
#define SEE_MASK_FLAG_HINST_IS_SITE 0x8000000
|
||||
#endif
|
||||
|
||||
#ifndef DUMMYUNIONNAME
|
||||
#ifdef NONAMELESSUNION
|
||||
#define DUMMYUNIONNAME u
|
||||
#define DUMMYUNIONNAME2 u2
|
||||
#define DUMMYUNIONNAME3 u3
|
||||
#define DUMMYUNIONNAME4 u4
|
||||
#define DUMMYUNIONNAME5 u5
|
||||
#else
|
||||
#define DUMMYUNIONNAME
|
||||
#define DUMMYUNIONNAME2
|
||||
#define DUMMYUNIONNAME3
|
||||
#define DUMMYUNIONNAME4
|
||||
#define DUMMYUNIONNAME5
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
|
||||
|
||||
typedef struct _SHELLEXECUTEINFOA {
|
||||
DWORD cbSize;
|
||||
ULONG fMask;
|
||||
HWND hwnd;
|
||||
LPCSTR lpVerb;
|
||||
LPCSTR lpFile;
|
||||
LPCSTR lpParameters;
|
||||
LPCSTR lpDirectory;
|
||||
int nShow;
|
||||
HINSTANCE hInstApp;
|
||||
void *lpIDList;
|
||||
LPCSTR lpClass;
|
||||
HKEY hkeyClass;
|
||||
DWORD dwHotKey;
|
||||
__C89_NAMELESS union {
|
||||
HANDLE hIcon;
|
||||
HANDLE hMonitor;
|
||||
} DUMMYUNIONNAME;
|
||||
HANDLE hProcess;
|
||||
} SHELLEXECUTEINFOA,*LPSHELLEXECUTEINFOA;
|
||||
|
||||
typedef struct _SHELLEXECUTEINFOW {
|
||||
DWORD cbSize;
|
||||
ULONG fMask;
|
||||
HWND hwnd;
|
||||
LPCWSTR lpVerb;
|
||||
LPCWSTR lpFile;
|
||||
LPCWSTR lpParameters;
|
||||
LPCWSTR lpDirectory;
|
||||
int nShow;
|
||||
HINSTANCE hInstApp;
|
||||
void *lpIDList;
|
||||
LPCWSTR lpClass;
|
||||
HKEY hkeyClass;
|
||||
DWORD dwHotKey;
|
||||
__C89_NAMELESS union {
|
||||
HANDLE hIcon;
|
||||
HANDLE hMonitor;
|
||||
} DUMMYUNIONNAME;
|
||||
HANDLE hProcess;
|
||||
} SHELLEXECUTEINFOW,*LPSHELLEXECUTEINFOW;
|
||||
|
||||
__MINGW_TYPEDEF_AW(SHELLEXECUTEINFO)
|
||||
__MINGW_TYPEDEF_AW(LPSHELLEXECUTEINFO)
|
||||
|
||||
SHSTDAPI_(WINBOOL) ShellExecuteExA (SHELLEXECUTEINFOA *pExecInfo);
|
||||
SHSTDAPI_(WINBOOL) ShellExecuteExW (SHELLEXECUTEINFOW *pExecInfo);
|
||||
|
||||
#define ShellExecuteEx __MINGW_NAME_AW(ShellExecuteEx)
|
||||
|
||||
typedef struct _SHCREATEPROCESSINFOW {
|
||||
DWORD cbSize;
|
||||
ULONG fMask;
|
||||
HWND hwnd;
|
||||
LPCWSTR pszFile;
|
||||
LPCWSTR pszParameters;
|
||||
LPCWSTR pszCurrentDirectory;
|
||||
HANDLE hUserToken;
|
||||
LPSECURITY_ATTRIBUTES lpProcessAttributes;
|
||||
LPSECURITY_ATTRIBUTES lpThreadAttributes;
|
||||
WINBOOL bInheritHandles;
|
||||
DWORD dwCreationFlags;
|
||||
LPSTARTUPINFOW lpStartupInfo;
|
||||
LPPROCESS_INFORMATION lpProcessInformation;
|
||||
} SHCREATEPROCESSINFOW,*PSHCREATEPROCESSINFOW;
|
||||
|
||||
SHSTDAPI_(WINBOOL) SHCreateProcessAsUserW (PSHCREATEPROCESSINFOW pscpi);
|
||||
|
||||
#if NTDDI_VERSION >= 0x06000000
|
||||
SHSTDAPI SHEvaluateSystemCommandTemplate (PCWSTR pszCmdTemplate, PWSTR *ppszApplication, PWSTR *ppszCommandLine, PWSTR *ppszParameters);
|
||||
|
||||
typedef enum ASSOCCLASS {
|
||||
ASSOCCLASS_SHELL_KEY = 0,
|
||||
ASSOCCLASS_PROGID_KEY,
|
||||
ASSOCCLASS_PROGID_STR,
|
||||
ASSOCCLASS_CLSID_KEY,
|
||||
ASSOCCLASS_CLSID_STR,
|
||||
ASSOCCLASS_APP_KEY,
|
||||
ASSOCCLASS_APP_STR,
|
||||
ASSOCCLASS_SYSTEM_STR,
|
||||
ASSOCCLASS_FOLDER,
|
||||
ASSOCCLASS_STAR,
|
||||
#if NTDDI_VERSION >= 0x06020000
|
||||
ASSOCCLASS_FIXED_PROGID_STR,
|
||||
ASSOCCLASS_PROTOCOL_STR,
|
||||
#endif
|
||||
} ASSOCCLASS;
|
||||
|
||||
typedef struct ASSOCIATIONELEMENT {
|
||||
ASSOCCLASS ac;
|
||||
HKEY hkClass;
|
||||
PCWSTR pszClass;
|
||||
} ASSOCIATIONELEMENT;
|
||||
|
||||
SHSTDAPI AssocCreateForClasses (const ASSOCIATIONELEMENT *rgClasses, ULONG cClasses, REFIID riid, void **ppv);
|
||||
#endif
|
||||
|
||||
typedef struct _SHQUERYRBINFO {
|
||||
DWORD cbSize;
|
||||
__MINGW_EXTENSION __int64 i64Size;
|
||||
__MINGW_EXTENSION __int64 i64NumItems;
|
||||
} SHQUERYRBINFO,*LPSHQUERYRBINFO;
|
||||
|
||||
#define SHERB_NOCONFIRMATION 0x00000001
|
||||
#define SHERB_NOPROGRESSUI 0x00000002
|
||||
#define SHERB_NOSOUND 0x00000004
|
||||
|
||||
SHSTDAPI SHQueryRecycleBinA (LPCSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo);
|
||||
SHSTDAPI SHQueryRecycleBinW (LPCWSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo);
|
||||
|
||||
#define SHQueryRecycleBin __MINGW_NAME_AW(SHQueryRecycleBin)
|
||||
|
||||
SHSTDAPI SHEmptyRecycleBinA (HWND hwnd, LPCSTR pszRootPath, DWORD dwFlags);
|
||||
SHSTDAPI SHEmptyRecycleBinW (HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags);
|
||||
|
||||
#define SHEmptyRecycleBin __MINGW_NAME_AW(SHEmptyRecycleBin)
|
||||
|
||||
#if NTDDI_VERSION >= 0x06000000
|
||||
typedef enum {
|
||||
QUNS_NOT_PRESENT = 1,
|
||||
QUNS_BUSY = 2,
|
||||
QUNS_RUNNING_D3D_FULL_SCREEN = 3,
|
||||
QUNS_PRESENTATION_MODE = 4,
|
||||
QUNS_ACCEPTS_NOTIFICATIONS = 5
|
||||
#if NTDDI_VERSION >= 0x06010000
|
||||
, QUNS_QUIET_TIME = 6
|
||||
#endif
|
||||
#if NTDDI_VERSION >= 0x06020000
|
||||
, QUNS_APP = 7
|
||||
#endif
|
||||
} QUERY_USER_NOTIFICATION_STATE;
|
||||
|
||||
SHSTDAPI SHQueryUserNotificationState (QUERY_USER_NOTIFICATION_STATE *pquns);
|
||||
#endif
|
||||
|
||||
#if NTDDI_VERSION >= 0x06010000
|
||||
SHSTDAPI SHGetPropertyStoreForWindow (HWND hwnd, REFIID riid, void **ppv);
|
||||
#endif
|
||||
|
||||
#endif /* WINAPI_PARTITION_DESKTOP. */
|
||||
|
||||
typedef struct _NOTIFYICONDATAA {
|
||||
DWORD cbSize;
|
||||
HWND hWnd;
|
||||
UINT uID;
|
||||
UINT uFlags;
|
||||
UINT uCallbackMessage;
|
||||
HICON hIcon;
|
||||
CHAR szTip[128];
|
||||
DWORD dwState;
|
||||
DWORD dwStateMask;
|
||||
CHAR szInfo[256];
|
||||
__C89_NAMELESS union {
|
||||
UINT uTimeout;
|
||||
UINT uVersion;
|
||||
} DUMMYUNIONNAME;
|
||||
CHAR szInfoTitle[64];
|
||||
DWORD dwInfoFlags;
|
||||
GUID guidItem;
|
||||
#if NTDDI_VERSION >= 0x06000000
|
||||
HICON hBalloonIcon;
|
||||
#endif
|
||||
} NOTIFYICONDATAA,*PNOTIFYICONDATAA;
|
||||
|
||||
typedef struct _NOTIFYICONDATAW {
|
||||
DWORD cbSize;
|
||||
HWND hWnd;
|
||||
UINT uID;
|
||||
UINT uFlags;
|
||||
UINT uCallbackMessage;
|
||||
HICON hIcon;
|
||||
WCHAR szTip[128];
|
||||
DWORD dwState;
|
||||
DWORD dwStateMask;
|
||||
WCHAR szInfo[256];
|
||||
__C89_NAMELESS union {
|
||||
UINT uTimeout;
|
||||
UINT uVersion;
|
||||
} DUMMYUNIONNAME;
|
||||
WCHAR szInfoTitle[64];
|
||||
DWORD dwInfoFlags;
|
||||
GUID guidItem;
|
||||
#if NTDDI_VERSION >= 0x06000000
|
||||
HICON hBalloonIcon;
|
||||
#endif
|
||||
} NOTIFYICONDATAW,*PNOTIFYICONDATAW;
|
||||
|
||||
__MINGW_TYPEDEF_AW(NOTIFYICONDATA)
|
||||
__MINGW_TYPEDEF_AW(PNOTIFYICONDATA)
|
||||
|
||||
#define NOTIFYICONDATAA_V1_SIZE FIELD_OFFSET (NOTIFYICONDATAA, szTip[64])
|
||||
#define NOTIFYICONDATAW_V1_SIZE FIELD_OFFSET (NOTIFYICONDATAW, szTip[64])
|
||||
#define NOTIFYICONDATAA_V2_SIZE FIELD_OFFSET (NOTIFYICONDATAA, guidItem)
|
||||
#define NOTIFYICONDATAW_V2_SIZE FIELD_OFFSET (NOTIFYICONDATAW, guidItem)
|
||||
#define NOTIFYICONDATAA_V3_SIZE FIELD_OFFSET (NOTIFYICONDATAA, hBalloonIcon)
|
||||
#define NOTIFYICONDATAW_V3_SIZE FIELD_OFFSET (NOTIFYICONDATAW, hBalloonIcon)
|
||||
|
||||
#define NOTIFYICONDATA_V1_SIZE __MINGW_NAME_AW_EXT(NOTIFYICONDATA,_V1_SIZE)
|
||||
#define NOTIFYICONDATA_V2_SIZE __MINGW_NAME_AW_EXT(NOTIFYICONDATA,_V2_SIZE)
|
||||
#define NOTIFYICONDATA_V3_SIZE __MINGW_NAME_AW_EXT(NOTIFYICONDATA,_V3_SIZE)
|
||||
|
||||
#define NIN_SELECT (WM_USER + 0)
|
||||
#define NINF_KEY 0x1
|
||||
#define NIN_KEYSELECT (NIN_SELECT | NINF_KEY)
|
||||
|
||||
#define NIN_BALLOONSHOW (WM_USER + 2)
|
||||
#define NIN_BALLOONHIDE (WM_USER + 3)
|
||||
#define NIN_BALLOONTIMEOUT (WM_USER + 4)
|
||||
#define NIN_BALLOONUSERCLICK (WM_USER + 5)
|
||||
#if NTDDI_VERSION >= 0x06000000
|
||||
#define NIN_POPUPOPEN (WM_USER + 6)
|
||||
#define NIN_POPUPCLOSE (WM_USER + 7)
|
||||
#endif
|
||||
|
||||
#define NIM_ADD 0x00000000
|
||||
#define NIM_MODIFY 0x00000001
|
||||
#define NIM_DELETE 0x00000002
|
||||
#define NIM_SETFOCUS 0x00000003
|
||||
#define NIM_SETVERSION 0x00000004
|
||||
|
||||
#define NOTIFYICON_VERSION 3
|
||||
#if NTDDI_VERSION >= 0x06000000
|
||||
#define NOTIFYICON_VERSION_4 4
|
||||
#endif
|
||||
|
||||
#define NIF_MESSAGE 0x00000001
|
||||
#define NIF_ICON 0x00000002
|
||||
#define NIF_TIP 0x00000004
|
||||
#define NIF_STATE 0x00000008
|
||||
#define NIF_INFO 0x00000010
|
||||
#if _WIN32_IE >= 0x600
|
||||
#define NIF_GUID 0x00000020
|
||||
#endif
|
||||
#if NTDDI_VERSION >= 0x06000000
|
||||
#define NIF_REALTIME 0x00000040
|
||||
#define NIF_SHOWTIP 0x00000080
|
||||
#endif
|
||||
|
||||
#define NIS_HIDDEN 0x00000001
|
||||
#define NIS_SHAREDICON 0x00000002
|
||||
|
||||
#define NIIF_NONE 0x00000000
|
||||
#define NIIF_INFO 0x00000001
|
||||
#define NIIF_WARNING 0x00000002
|
||||
#define NIIF_ERROR 0x00000003
|
||||
#define NIIF_USER 0x00000004
|
||||
#define NIIF_ICON_MASK 0x0000000f
|
||||
#define NIIF_NOSOUND 0x00000010
|
||||
#if NTDDI_VERSION >= 0x06000000
|
||||
#define NIIF_LARGE_ICON 0x00000020
|
||||
#endif
|
||||
#if NTDDI_VERSION >= 0x06010000
|
||||
#define NIIF_RESPECT_QUIET_TIME 0x00000080
|
||||
#endif
|
||||
|
||||
typedef struct _NOTIFYICONIDENTIFIER {
|
||||
DWORD cbSize;
|
||||
HWND hWnd;
|
||||
UINT uID;
|
||||
GUID guidItem;
|
||||
} NOTIFYICONIDENTIFIER,*PNOTIFYICONIDENTIFIER;
|
||||
|
||||
SHSTDAPI_(WINBOOL) Shell_NotifyIconA (DWORD dwMessage, PNOTIFYICONDATAA lpData);
|
||||
SHSTDAPI_(WINBOOL) Shell_NotifyIconW (DWORD dwMessage, PNOTIFYICONDATAW lpData);
|
||||
|
||||
#define Shell_NotifyIcon __MINGW_NAME_AW(Shell_NotifyIcon)
|
||||
|
||||
#if NTDDI_VERSION >= 0x06010000
|
||||
SHSTDAPI Shell_NotifyIconGetRect (const NOTIFYICONIDENTIFIER *identifier, RECT *iconLocation);
|
||||
#endif
|
||||
|
||||
#ifndef SHFILEINFO_DEFINED
|
||||
#define SHFILEINFO_DEFINED
|
||||
|
||||
typedef struct _SHFILEINFOA {
|
||||
HICON hIcon;
|
||||
int iIcon;
|
||||
DWORD dwAttributes;
|
||||
CHAR szDisplayName[MAX_PATH];
|
||||
CHAR szTypeName[80];
|
||||
} SHFILEINFOA;
|
||||
|
||||
typedef struct _SHFILEINFOW {
|
||||
HICON hIcon;
|
||||
int iIcon;
|
||||
DWORD dwAttributes;
|
||||
WCHAR szDisplayName[MAX_PATH];
|
||||
WCHAR szTypeName[80];
|
||||
} SHFILEINFOW;
|
||||
|
||||
__MINGW_TYPEDEF_AW(SHFILEINFO)
|
||||
#endif
|
||||
|
||||
#define SHGFI_ICON 0x000000100
|
||||
#define SHGFI_DISPLAYNAME 0x000000200
|
||||
#define SHGFI_TYPENAME 0x000000400
|
||||
#define SHGFI_ATTRIBUTES 0x000000800
|
||||
#define SHGFI_ICONLOCATION 0x000001000
|
||||
#define SHGFI_EXETYPE 0x000002000
|
||||
#define SHGFI_SYSICONINDEX 0x000004000
|
||||
#define SHGFI_LINKOVERLAY 0x000008000
|
||||
#define SHGFI_SELECTED 0x000010000
|
||||
#define SHGFI_ATTR_SPECIFIED 0x000020000
|
||||
|
||||
#define SHGFI_LARGEICON 0x000000000
|
||||
#define SHGFI_SMALLICON 0x000000001
|
||||
#define SHGFI_OPENICON 0x000000002
|
||||
#define SHGFI_SHELLICONSIZE 0x000000004
|
||||
#define SHGFI_PIDL 0x000000008
|
||||
#define SHGFI_USEFILEATTRIBUTES 0x000000010
|
||||
|
||||
#define SHGFI_ADDOVERLAYS 0x000000020
|
||||
#define SHGFI_OVERLAYINDEX 0x000000040
|
||||
|
||||
SHSTDAPI_(DWORD_PTR) SHGetFileInfoA (LPCSTR pszPath, DWORD dwFileAttributes, SHFILEINFOA *psfi, UINT cbFileInfo, UINT uFlags);
|
||||
SHSTDAPI_(DWORD_PTR) SHGetFileInfoW (LPCWSTR pszPath, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT cbFileInfo, UINT uFlags);
|
||||
|
||||
#define SHGetFileInfo __MINGW_NAME_AW(SHGetFileInfo)
|
||||
|
||||
#if NTDDI_VERSION >= 0x06000000
|
||||
typedef struct _SHSTOCKICONINFO {
|
||||
DWORD cbSize;
|
||||
HICON hIcon;
|
||||
int iSysImageIndex;
|
||||
int iIcon;
|
||||
WCHAR szPath[MAX_PATH];
|
||||
} SHSTOCKICONINFO;
|
||||
|
||||
#define SHGSI_ICONLOCATION 0
|
||||
#define SHGSI_ICON SHGFI_ICON
|
||||
#define SHGSI_SYSICONINDEX SHGFI_SYSICONINDEX
|
||||
#define SHGSI_LINKOVERLAY SHGFI_LINKOVERLAY
|
||||
#define SHGSI_SELECTED SHGFI_SELECTED
|
||||
#define SHGSI_LARGEICON SHGFI_LARGEICON
|
||||
#define SHGSI_SMALLICON SHGFI_SMALLICON
|
||||
#define SHGSI_SHELLICONSIZE SHGFI_SHELLICONSIZE
|
||||
|
||||
typedef enum SHSTOCKICONID {
|
||||
SIID_DOCNOASSOC = 0,
|
||||
SIID_DOCASSOC = 1,
|
||||
SIID_APPLICATION = 2,
|
||||
SIID_FOLDER = 3,
|
||||
SIID_FOLDEROPEN = 4,
|
||||
SIID_DRIVE525 = 5,
|
||||
SIID_DRIVE35 = 6,
|
||||
SIID_DRIVEREMOVE = 7,
|
||||
SIID_DRIVEFIXED = 8,
|
||||
SIID_DRIVENET = 9,
|
||||
SIID_DRIVENETDISABLED = 10,
|
||||
SIID_DRIVECD = 11,
|
||||
SIID_DRIVERAM = 12,
|
||||
SIID_WORLD = 13,
|
||||
SIID_SERVER = 15,
|
||||
SIID_PRINTER = 16,
|
||||
SIID_MYNETWORK = 17,
|
||||
SIID_FIND = 22,
|
||||
SIID_HELP = 23,
|
||||
SIID_SHARE = 28,
|
||||
SIID_LINK = 29,
|
||||
SIID_SLOWFILE = 30,
|
||||
SIID_RECYCLER = 31,
|
||||
SIID_RECYCLERFULL = 32,
|
||||
SIID_MEDIACDAUDIO = 40,
|
||||
SIID_LOCK = 47,
|
||||
SIID_AUTOLIST = 49,
|
||||
SIID_PRINTERNET = 50,
|
||||
SIID_SERVERSHARE = 51,
|
||||
SIID_PRINTERFAX = 52,
|
||||
SIID_PRINTERFAXNET = 53,
|
||||
SIID_PRINTERFILE = 54,
|
||||
SIID_STACK = 55,
|
||||
SIID_MEDIASVCD = 56,
|
||||
SIID_STUFFEDFOLDER = 57,
|
||||
SIID_DRIVEUNKNOWN = 58,
|
||||
SIID_DRIVEDVD = 59,
|
||||
SIID_MEDIADVD = 60,
|
||||
SIID_MEDIADVDRAM = 61,
|
||||
SIID_MEDIADVDRW = 62,
|
||||
SIID_MEDIADVDR = 63,
|
||||
SIID_MEDIADVDROM = 64,
|
||||
SIID_MEDIACDAUDIOPLUS = 65,
|
||||
SIID_MEDIACDRW = 66,
|
||||
SIID_MEDIACDR = 67,
|
||||
SIID_MEDIACDBURN = 68,
|
||||
SIID_MEDIABLANKCD = 69,
|
||||
SIID_MEDIACDROM = 70,
|
||||
SIID_AUDIOFILES = 71,
|
||||
SIID_IMAGEFILES = 72,
|
||||
SIID_VIDEOFILES = 73,
|
||||
SIID_MIXEDFILES = 74,
|
||||
SIID_FOLDERBACK = 75,
|
||||
SIID_FOLDERFRONT = 76,
|
||||
SIID_SHIELD = 77,
|
||||
SIID_WARNING = 78,
|
||||
SIID_INFO = 79,
|
||||
SIID_ERROR = 80,
|
||||
SIID_KEY = 81,
|
||||
SIID_SOFTWARE = 82,
|
||||
SIID_RENAME = 83,
|
||||
SIID_DELETE = 84,
|
||||
SIID_MEDIAAUDIODVD = 85,
|
||||
SIID_MEDIAMOVIEDVD = 86,
|
||||
SIID_MEDIAENHANCEDCD = 87,
|
||||
SIID_MEDIAENHANCEDDVD = 88,
|
||||
SIID_MEDIAHDDVD = 89,
|
||||
SIID_MEDIABLURAY = 90,
|
||||
SIID_MEDIAVCD = 91,
|
||||
SIID_MEDIADVDPLUSR = 92,
|
||||
SIID_MEDIADVDPLUSRW = 93,
|
||||
SIID_DESKTOPPC = 94,
|
||||
SIID_MOBILEPC = 95,
|
||||
SIID_USERS = 96,
|
||||
SIID_MEDIASMARTMEDIA = 97,
|
||||
SIID_MEDIACOMPACTFLASH = 98,
|
||||
SIID_DEVICECELLPHONE = 99,
|
||||
SIID_DEVICECAMERA = 100,
|
||||
SIID_DEVICEVIDEOCAMERA = 101,
|
||||
SIID_DEVICEAUDIOPLAYER = 102,
|
||||
SIID_NETWORKCONNECT = 103,
|
||||
SIID_INTERNET = 104,
|
||||
SIID_ZIPFILE = 105,
|
||||
SIID_SETTINGS = 106,
|
||||
|
||||
SIID_DRIVEHDDVD = 132,
|
||||
SIID_DRIVEBD = 133,
|
||||
SIID_MEDIAHDDVDROM = 134,
|
||||
SIID_MEDIAHDDVDR = 135,
|
||||
SIID_MEDIAHDDVDRAM = 136,
|
||||
SIID_MEDIABDROM = 137,
|
||||
SIID_MEDIABDR = 138,
|
||||
SIID_MEDIABDRE = 139,
|
||||
SIID_CLUSTEREDDRIVE = 140,
|
||||
|
||||
SIID_MAX_ICONS = 175
|
||||
} SHSTOCKICONID;
|
||||
|
||||
#define SIID_INVALID ((SHSTOCKICONID)-1)
|
||||
|
||||
SHSTDAPI SHGetStockIconInfo (SHSTOCKICONID siid, UINT uFlags, SHSTOCKICONINFO *psii);
|
||||
#endif
|
||||
|
||||
#define SHGetDiskFreeSpace SHGetDiskFreeSpaceEx
|
||||
|
||||
SHSTDAPI_(WINBOOL) SHGetDiskFreeSpaceExA (LPCSTR pszDirectoryName, ULARGE_INTEGER *pulFreeBytesAvailableToCaller, ULARGE_INTEGER *pulTotalNumberOfBytes, ULARGE_INTEGER *pulTotalNumberOfFreeBytes);
|
||||
SHSTDAPI_(WINBOOL) SHGetDiskFreeSpaceExW (LPCWSTR pszDirectoryName, ULARGE_INTEGER *pulFreeBytesAvailableToCaller, ULARGE_INTEGER *pulTotalNumberOfBytes, ULARGE_INTEGER *pulTotalNumberOfFreeBytes);
|
||||
SHSTDAPI_(WINBOOL) SHGetNewLinkInfoA (LPCSTR pszLinkTo, LPCSTR pszDir, LPSTR pszName, WINBOOL *pfMustCopy, UINT uFlags);
|
||||
SHSTDAPI_(WINBOOL) SHGetNewLinkInfoW (LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, WINBOOL *pfMustCopy, UINT uFlags);
|
||||
|
||||
#define SHGetDiskFreeSpaceEx __MINGW_NAME_AW(SHGetDiskFreeSpaceEx)
|
||||
#define SHGetNewLinkInfo __MINGW_NAME_AW(SHGetNewLinkInfo)
|
||||
|
||||
#define SHGNLI_PIDL 0x000000001
|
||||
#define SHGNLI_PREFIXNAME 0x000000002
|
||||
#define SHGNLI_NOUNIQUE 0x000000004
|
||||
#define SHGNLI_NOLNK 0x000000008
|
||||
#if _WIN32_IE >= 0x0600
|
||||
#define SHGNLI_NOLOCNAME 0x000000010
|
||||
#endif
|
||||
#if NTDDI_VERSION >= 0x06010000
|
||||
#define SHGNLI_USEURLEXT 0x000000020
|
||||
#endif
|
||||
|
||||
#define PRINTACTION_OPEN 0
|
||||
#define PRINTACTION_PROPERTIES 1
|
||||
#define PRINTACTION_NETINSTALL 2
|
||||
#define PRINTACTION_NETINSTALLLINK 3
|
||||
#define PRINTACTION_TESTPAGE 4
|
||||
#define PRINTACTION_OPENNETPRN 5
|
||||
#define PRINTACTION_DOCUMENTDEFAULTS 6
|
||||
#define PRINTACTION_SERVERPROPERTIES 7
|
||||
|
||||
SHSTDAPI_(WINBOOL) SHInvokePrinterCommandA (HWND hwnd, UINT uAction, LPCSTR lpBuf1, LPCSTR lpBuf2, WINBOOL fModal);
|
||||
SHSTDAPI_(WINBOOL) SHInvokePrinterCommandW (HWND hwnd, UINT uAction, LPCWSTR lpBuf1, LPCWSTR lpBuf2, WINBOOL fModal);
|
||||
|
||||
#define SHInvokePrinterCommand __MINGW_NAME_AW(SHInvokePrinterCommand)
|
||||
|
||||
#if NTDDI_VERSION >= 0x06000000
|
||||
typedef struct _OPEN_PRINTER_PROPS_INFOA {
|
||||
DWORD dwSize;
|
||||
LPSTR pszSheetName;
|
||||
UINT uSheetIndex;
|
||||
DWORD dwFlags;
|
||||
WINBOOL bModal;
|
||||
} OPEN_PRINTER_PROPS_INFOA,*POPEN_PRINTER_PROPS_INFOA;
|
||||
|
||||
typedef struct _OPEN_PRINTER_PROPS_INFOW {
|
||||
DWORD dwSize;
|
||||
LPWSTR pszSheetName;
|
||||
UINT uSheetIndex;
|
||||
DWORD dwFlags;
|
||||
WINBOOL bModal;
|
||||
} OPEN_PRINTER_PROPS_INFOW,*POPEN_PRINTER_PROPS_INFOW;
|
||||
|
||||
__MINGW_TYPEDEF_AW(OPEN_PRINTER_PROPS_INFO)
|
||||
__MINGW_TYPEDEF_AW(POPEN_PRINTER_PROPS_INFO)
|
||||
#define PRINT_PROP_FORCE_NAME 0x01
|
||||
#endif
|
||||
|
||||
SHSTDAPI SHLoadNonloadedIconOverlayIdentifiers (void);
|
||||
SHSTDAPI SHIsFileAvailableOffline (PCWSTR pwszPath, DWORD *pdwStatus);
|
||||
|
||||
#define OFFLINE_STATUS_LOCAL 0x0001
|
||||
#define OFFLINE_STATUS_REMOTE 0x0002
|
||||
#define OFFLINE_STATUS_INCOMPLETE 0x0004
|
||||
|
||||
SHSTDAPI SHSetLocalizedName (PCWSTR pszPath, PCWSTR pszResModule, int idsRes);
|
||||
|
||||
#if NTDDI_VERSION >= 0x06000000
|
||||
SHSTDAPI SHRemoveLocalizedName (PCWSTR pszPath);
|
||||
SHSTDAPI SHGetLocalizedName (PCWSTR pszPath, PWSTR pszResModule, UINT cch, int *pidsRes);
|
||||
#endif
|
||||
|
||||
#ifndef _SHLWAPI_
|
||||
#define LWSTDAPIV_(type) EXTERN_C DECLSPEC_IMPORT type STDAPIVCALLTYPE
|
||||
#else
|
||||
#define LWSTDAPIV_(type) STDAPIV_ (type)
|
||||
#endif
|
||||
|
||||
LWSTDAPIV_ (int) ShellMessageBoxA (HINSTANCE hAppInst, HWND hWnd, LPCSTR lpcText, LPCSTR lpcTitle, UINT fuStyle,...);
|
||||
LWSTDAPIV_ (int) ShellMessageBoxW (HINSTANCE hAppInst, HWND hWnd, LPCWSTR lpcText, LPCWSTR lpcTitle, UINT fuStyle,...);
|
||||
|
||||
#define ShellMessageBox __MINGW_NAME_AW(ShellMessageBox)
|
||||
|
||||
SHSTDAPI_(WINBOOL) IsLFNDriveA (LPCSTR pszPath);
|
||||
SHSTDAPI_(WINBOOL) IsLFNDriveW (LPCWSTR pszPath);
|
||||
|
||||
#define IsLFNDrive __MINGW_NAME_AW(IsLFNDrive)
|
||||
|
||||
#if _WIN32_IE >= 0x0600
|
||||
STDAPI SHEnumerateUnreadMailAccountsA (HKEY hKeyUser, DWORD dwIndex, LPSTR pszMailAddress, int cchMailAddress);
|
||||
STDAPI SHEnumerateUnreadMailAccountsW (HKEY hKeyUser, DWORD dwIndex, LPWSTR pszMailAddress, int cchMailAddress);
|
||||
STDAPI SHGetUnreadMailCountA (HKEY hKeyUser, LPCSTR pszMailAddress, DWORD *pdwCount, FILETIME *pFileTime, LPSTR pszShellExecuteCommand, int cchShellExecuteCommand);
|
||||
STDAPI SHGetUnreadMailCountW (HKEY hKeyUser, LPCWSTR pszMailAddress, DWORD *pdwCount, FILETIME *pFileTime, LPWSTR pszShellExecuteCommand, int cchShellExecuteCommand);
|
||||
STDAPI SHSetUnreadMailCountA (LPCSTR pszMailAddress, DWORD dwCount, LPCSTR pszShellExecuteCommand);
|
||||
STDAPI SHSetUnreadMailCountW (LPCWSTR pszMailAddress, DWORD dwCount, LPCWSTR pszShellExecuteCommand);
|
||||
|
||||
#define SHEnumerateUnreadMailAccounts __MINGW_NAME_AW(SHEnumerateUnreadMailAccounts)
|
||||
#define SHGetUnreadMailCount __MINGW_NAME_AW(SHGetUnreadMailCount)
|
||||
#define SHSetUnreadMailCount __MINGW_NAME_AW(SHSetUnreadMailCount)
|
||||
|
||||
#endif
|
||||
#if _WIN32_IE >= 0x0601
|
||||
STDAPI_ (WINBOOL) SHTestTokenMembership (HANDLE hToken, ULONG ulRID);
|
||||
#endif
|
||||
|
||||
#if _WIN32_IE >= 0x0600
|
||||
SHSTDAPI SHGetImageList (int iImageList, REFIID riid, void **ppvObj);
|
||||
|
||||
#define SHIL_LARGE 0
|
||||
#define SHIL_SMALL 1
|
||||
#define SHIL_EXTRALARGE 2
|
||||
#define SHIL_SYSSMALL 3
|
||||
#if NTDDI_VERSION >= 0x06000000
|
||||
#define SHIL_JUMBO 4
|
||||
#define SHIL_LAST SHIL_JUMBO
|
||||
#else
|
||||
#define SHIL_LAST SHIL_SYSSMALL
|
||||
#endif
|
||||
|
||||
typedef HRESULT (STDMETHODCALLTYPE *PFNCANSHAREFOLDERW) (PCWSTR pszPath);
|
||||
typedef HRESULT (STDMETHODCALLTYPE *PFNSHOWSHAREFOLDERUIW) (HWND hwndParent, PCWSTR pszPath);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef _WIN64
|
||||
#include <poppack.h>
|
||||
#endif
|
||||
|
||||
#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
|
||||
#if NTDDI_VERSION >= 0x06000000
|
||||
|
||||
#define WC_NETADDRESS L"msctls_netaddress"
|
||||
|
||||
SHSTDAPI_(WINBOOL) InitNetworkAddressControl (void);
|
||||
|
||||
#define NCM_GETADDRESS (WM_USER+1)
|
||||
#define NetAddr_GetAddress(hwnd, pv) (HRESULT)SNDMSG (hwnd, NCM_GETADDRESS, 0,(LPARAM)pv)
|
||||
|
||||
typedef struct tagNC_ADDRESS {
|
||||
struct NET_ADDRESS_INFO_ *pAddrInfo;
|
||||
USHORT PortNumber;
|
||||
BYTE PrefixLength;
|
||||
} NC_ADDRESS,*PNC_ADDRESS;
|
||||
|
||||
#define NCM_SETALLOWTYPE (WM_USER+2)
|
||||
#define NetAddr_SetAllowType(hwnd, addrMask) (HRESULT)SNDMSG (hwnd, NCM_SETALLOWTYPE,(WPARAM)addrMask, 0)
|
||||
|
||||
#define NCM_GETALLOWTYPE (WM_USER+3)
|
||||
#define NetAddr_GetAllowType(hwnd) (DWORD)SNDMSG (hwnd, NCM_GETALLOWTYPE, 0, 0)
|
||||
|
||||
#define NCM_DISPLAYERRORTIP (WM_USER+4)
|
||||
#define NetAddr_DisplayErrorTip(hwnd) (HRESULT)SNDMSG (hwnd, NCM_DISPLAYERRORTIP, 0, 0)
|
||||
#endif
|
||||
|
||||
#if NTDDI_VERSION >= 0x06000000
|
||||
STDAPI SHGetDriveMedia (PCWSTR pszDrive, DWORD *pdwMediaContent);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
@ -1,79 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER within this package.
|
||||
*/
|
||||
#ifndef __TVOUT__
|
||||
#define __TVOUT__
|
||||
|
||||
#include <guiddef.h>
|
||||
|
||||
typedef struct _VIDEOPARAMETERS {
|
||||
GUID Guid;
|
||||
ULONG dwOffset;
|
||||
ULONG dwCommand;
|
||||
ULONG dwFlags;
|
||||
ULONG dwMode;
|
||||
ULONG dwTVStandard;
|
||||
ULONG dwAvailableModes;
|
||||
ULONG dwAvailableTVStandard;
|
||||
ULONG dwFlickerFilter;
|
||||
ULONG dwOverScanX;
|
||||
ULONG dwOverScanY;
|
||||
ULONG dwMaxUnscaledX;
|
||||
ULONG dwMaxUnscaledY;
|
||||
ULONG dwPositionX;
|
||||
ULONG dwPositionY;
|
||||
ULONG dwBrightness;
|
||||
ULONG dwContrast;
|
||||
ULONG dwCPType;
|
||||
ULONG dwCPCommand;
|
||||
ULONG dwCPStandard;
|
||||
ULONG dwCPKey;
|
||||
ULONG bCP_APSTriggerBits;
|
||||
UCHAR bOEMCopyProtection[256];
|
||||
} VIDEOPARAMETERS,*PVIDEOPARAMETERS,*LPVIDEOPARAMETERS;
|
||||
|
||||
#define VP_COMMAND_GET 0x0001
|
||||
#define VP_COMMAND_SET 0x0002
|
||||
|
||||
#define VP_FLAGS_TV_MODE 0x0001
|
||||
#define VP_FLAGS_TV_STANDARD 0x0002
|
||||
#define VP_FLAGS_FLICKER 0x0004
|
||||
#define VP_FLAGS_OVERSCAN 0x0008
|
||||
#define VP_FLAGS_MAX_UNSCALED 0x0010
|
||||
#define VP_FLAGS_POSITION 0x0020
|
||||
#define VP_FLAGS_BRIGHTNESS 0x0040
|
||||
#define VP_FLAGS_CONTRAST 0x0080
|
||||
#define VP_FLAGS_COPYPROTECT 0x0100
|
||||
|
||||
#define VP_MODE_WIN_GRAPHICS 0x0001
|
||||
#define VP_MODE_TV_PLAYBACK 0x0002
|
||||
|
||||
#define VP_TV_STANDARD_NTSC_M 0x0001
|
||||
#define VP_TV_STANDARD_NTSC_M_J 0x0002
|
||||
#define VP_TV_STANDARD_PAL_B 0x0004
|
||||
#define VP_TV_STANDARD_PAL_D 0x0008
|
||||
#define VP_TV_STANDARD_PAL_H 0x0010
|
||||
#define VP_TV_STANDARD_PAL_I 0x0020
|
||||
#define VP_TV_STANDARD_PAL_M 0x0040
|
||||
#define VP_TV_STANDARD_PAL_N 0x0080
|
||||
#define VP_TV_STANDARD_SECAM_B 0x0100
|
||||
#define VP_TV_STANDARD_SECAM_D 0x0200
|
||||
#define VP_TV_STANDARD_SECAM_G 0x0400
|
||||
#define VP_TV_STANDARD_SECAM_H 0x0800
|
||||
#define VP_TV_STANDARD_SECAM_K 0x1000
|
||||
#define VP_TV_STANDARD_SECAM_K1 0x2000
|
||||
#define VP_TV_STANDARD_SECAM_L 0x4000
|
||||
#define VP_TV_STANDARD_WIN_VGA 0x8000
|
||||
#define VP_TV_STANDARD_NTSC_433 0x00010000
|
||||
#define VP_TV_STANDARD_PAL_G 0x00020000
|
||||
#define VP_TV_STANDARD_PAL_60 0x00040000
|
||||
#define VP_TV_STANDARD_SECAM_L1 0x00080000
|
||||
|
||||
#define VP_CP_TYPE_APS_TRIGGER 0x0001
|
||||
#define VP_CP_TYPE_MACROVISION 0x0002
|
||||
#define VP_CP_CMD_ACTIVATE 0x0001
|
||||
#define VP_CP_CMD_DEACTIVATE 0x0002
|
||||
#define VP_CP_CMD_CHANGE 0x0004
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
@ -4870,7 +4870,7 @@ extern "C" {
|
||||
#define CDS_RESET 0x40000000
|
||||
#define CDS_NORESET 0x10000000
|
||||
|
||||
#include <tvout.h>
|
||||
//gr #include <tvout.h>
|
||||
|
||||
#define DISP_CHANGE_SUCCESSFUL 0
|
||||
#define DISP_CHANGE_RESTART 1
|
||||
|
@ -1,39 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
#ifndef _WS2DEF_
|
||||
#define _WS2DEF_
|
||||
|
||||
#include <_mingw.h>
|
||||
|
||||
/* FIXME FIXME FIXME FIXME FIXME: Much more data need moving here.
|
||||
* This holds only SCOPE_LEVEL and SCOPE_ID so that compilations
|
||||
* do not fail.
|
||||
*/
|
||||
|
||||
typedef enum _SCOPE_LEVEL {
|
||||
ScopeLevelInterface = 1,
|
||||
ScopeLevelLink = 2,
|
||||
ScopeLevelSubnet = 3,
|
||||
ScopeLevelAdmin = 4,
|
||||
ScopeLevelSite = 5,
|
||||
ScopeLevelOrganization = 8,
|
||||
ScopeLevelGlobal = 14,
|
||||
ScopeLevelCount = 16
|
||||
} SCOPE_LEVEL;
|
||||
|
||||
typedef struct _SCOPE_ID {
|
||||
__C89_NAMELESS union {
|
||||
__C89_NAMELESS struct {
|
||||
ULONG Zone : 28;
|
||||
ULONG Level : 4;
|
||||
};
|
||||
ULONG Value;
|
||||
};
|
||||
} SCOPE_ID, *PSCOPE_ID;
|
||||
|
||||
#endif /* _WS2DEF_ */
|
||||
|
@ -1,96 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
#ifndef _INC_WS2IPDEF
|
||||
#define _INC_WS2IPDEF
|
||||
|
||||
#include <in6addr.h>
|
||||
#include <ws2def.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct ipv6_mreq {
|
||||
struct in6_addr ipv6mr_multiaddr;
|
||||
unsigned int ipv6mr_interface;
|
||||
} IPV6_MREQ;
|
||||
|
||||
struct sockaddr_in6_old {
|
||||
short sin6_family;
|
||||
u_short sin6_port;
|
||||
u_long sin6_flowinfo;
|
||||
struct in6_addr sin6_addr;
|
||||
};
|
||||
|
||||
typedef union sockaddr_gen {
|
||||
struct sockaddr Address;
|
||||
struct sockaddr_in AddressIn;
|
||||
struct sockaddr_in6_old AddressIn6;
|
||||
} sockaddr_gen;
|
||||
|
||||
struct sockaddr_in6 {
|
||||
short sin6_family;
|
||||
u_short sin6_port;
|
||||
u_long sin6_flowinfo;
|
||||
struct in6_addr sin6_addr;
|
||||
__C89_NAMELESS union {
|
||||
u_long sin6_scope_id;
|
||||
SCOPE_ID sin6_scope_struct;
|
||||
};
|
||||
};
|
||||
|
||||
typedef struct sockaddr_in6 SOCKADDR_IN6;
|
||||
typedef struct sockaddr_in6 *PSOCKADDR_IN6;
|
||||
typedef struct sockaddr_in6 *LPSOCKADDR_IN6;
|
||||
typedef u_short ADDRESS_FAMILY;
|
||||
|
||||
typedef struct _INTERFACE_INFO {
|
||||
u_long iiFlags;
|
||||
sockaddr_gen iiAddress;
|
||||
sockaddr_gen iiBroadcastAddress;
|
||||
sockaddr_gen iiNetmask;
|
||||
} INTERFACE_INFO,*LPINTERFACE_INFO;
|
||||
|
||||
typedef enum _MULTICAST_MODE_TYPE {
|
||||
MCAST_INCLUDE = 0,
|
||||
MCAST_EXCLUDE
|
||||
} MULTICAST_MODE_TYPE;
|
||||
|
||||
typedef struct _sockaddr_in6_pair {
|
||||
PSOCKADDR_IN6 SourceAddress;
|
||||
PSOCKADDR_IN6 DestinationAddress;
|
||||
} SOCKADDR_IN6_PAIR, *PSOCKADDR_IN6_PAIR;
|
||||
|
||||
typedef union _SOCKADDR_INET {
|
||||
SOCKADDR_IN Ipv4;
|
||||
SOCKADDR_IN6 Ipv6;
|
||||
ADDRESS_FAMILY si_family;
|
||||
} SOCKADDR_INET, *PSOCKADDR_INET;
|
||||
|
||||
typedef struct group_filter {
|
||||
ULONG gf_interface;
|
||||
SOCKADDR_STORAGE gf_group;
|
||||
MULTICAST_MODE_TYPE gf_fmode;
|
||||
ULONG gf_numsrc;
|
||||
SOCKADDR_STORAGE gf_slist[1];
|
||||
} GROUP_FILTER, *PGROUP_FILTER;
|
||||
|
||||
typedef struct group_req {
|
||||
ULONG gr_interface;
|
||||
SOCKADDR_STORAGE gr_group;
|
||||
} GROUP_REQ, *PGROUP_REQ;
|
||||
|
||||
typedef struct group_source_req {
|
||||
ULONG gsr_interface;
|
||||
SOCKADDR_STORAGE gsr_group;
|
||||
SOCKADDR_STORAGE gsr_source;
|
||||
} GROUP_SOURCE_REQ, *PGROUP_SOURCE_REQ;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*_INC_WS2IPDEF*/
|
@ -1,437 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
#ifndef _WS2TCPIP_H_
|
||||
#define _WS2TCPIP_H_
|
||||
|
||||
#include <_mingw_unicode.h>
|
||||
|
||||
#include <winsock2.h>
|
||||
#include <psdk_inc/_ip_mreq1.h>
|
||||
|
||||
struct ip_mreq_source {
|
||||
struct in_addr imr_multiaddr;
|
||||
struct in_addr imr_sourceaddr;
|
||||
struct in_addr imr_interface;
|
||||
};
|
||||
|
||||
struct ip_msfilter {
|
||||
struct in_addr imsf_multiaddr;
|
||||
struct in_addr imsf_interface;
|
||||
u_long imsf_fmode;
|
||||
u_long imsf_numsrc;
|
||||
struct in_addr imsf_slist[1];
|
||||
};
|
||||
|
||||
#define IP_MSFILTER_SIZE(numsrc) (sizeof(struct ip_msfilter)-sizeof(struct in_addr) + (numsrc)*sizeof(struct in_addr))
|
||||
|
||||
#define SIO_GET_INTERFACE_LIST _IOR('t',127,u_long)
|
||||
|
||||
#define SIO_GET_INTERFACE_LIST_EX _IOR('t',126,u_long)
|
||||
#define SIO_SET_MULTICAST_FILTER _IOW('t',125,u_long)
|
||||
#define SIO_GET_MULTICAST_FILTER _IOW('t',124 | IOC_IN,u_long)
|
||||
|
||||
#define IP_OPTIONS 1
|
||||
#define IP_HDRINCL 2
|
||||
#define IP_TOS 3
|
||||
#define IP_TTL 4
|
||||
#define IP_MULTICAST_IF 9
|
||||
#define IP_MULTICAST_TTL 10
|
||||
#define IP_MULTICAST_LOOP 11
|
||||
#define IP_ADD_MEMBERSHIP 12
|
||||
#define IP_DROP_MEMBERSHIP 13
|
||||
#define IP_DONTFRAGMENT 14
|
||||
#define IP_ADD_SOURCE_MEMBERSHIP 15
|
||||
#define IP_DROP_SOURCE_MEMBERSHIP 16
|
||||
#define IP_BLOCK_SOURCE 17
|
||||
#define IP_UNBLOCK_SOURCE 18
|
||||
#define IP_PKTINFO 19
|
||||
#define IP_RECEIVE_BROADCAST 22
|
||||
|
||||
#define IPV6_HDRINCL 2
|
||||
#define IPV6_UNICAST_HOPS 4
|
||||
#define IPV6_MULTICAST_IF 9
|
||||
#define IPV6_MULTICAST_HOPS 10
|
||||
#define IPV6_MULTICAST_LOOP 11
|
||||
#define IPV6_ADD_MEMBERSHIP 12
|
||||
#define IPV6_DROP_MEMBERSHIP 13
|
||||
#define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP
|
||||
#define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP
|
||||
#define IPV6_PKTINFO 19
|
||||
#define IPV6_HOPLIMIT 21
|
||||
#define IPV6_PROTECTION_LEVEL 23
|
||||
|
||||
#define PROTECTION_LEVEL_UNRESTRICTED 10
|
||||
#define PROTECTION_LEVEL_DEFAULT 20
|
||||
#define PROTECTION_LEVEL_RESTRICTED 30
|
||||
|
||||
#define UDP_NOCHECKSUM 1
|
||||
#define UDP_CHECKSUM_COVERAGE 20
|
||||
|
||||
#define TCP_EXPEDITED_1122 0x0002
|
||||
|
||||
|
||||
#include <ws2ipdef.h>
|
||||
|
||||
|
||||
#define SS_PORT(ssp) (((struct sockaddr_in*)(ssp))->sin_port)
|
||||
|
||||
#define IN6ADDR_ANY_INIT { 0 }
|
||||
#define IN6ADDR_LOOPBACK_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern const struct in6_addr in6addr_any;
|
||||
extern const struct in6_addr in6addr_loopback;
|
||||
|
||||
#define WS2TCPIP_INLINE __CRT_INLINE
|
||||
|
||||
int IN6_ADDR_EQUAL(const struct in6_addr *,const struct in6_addr *);
|
||||
int IN6_IS_ADDR_UNSPECIFIED(const struct in6_addr *);
|
||||
int IN6_IS_ADDR_LOOPBACK(const struct in6_addr *);
|
||||
int IN6_IS_ADDR_MULTICAST(const struct in6_addr *);
|
||||
int IN6_IS_ADDR_LINKLOCAL(const struct in6_addr *);
|
||||
int IN6_IS_ADDR_SITELOCAL(const struct in6_addr *);
|
||||
int IN6_IS_ADDR_V4MAPPED(const struct in6_addr *);
|
||||
int IN6_IS_ADDR_V4COMPAT(const struct in6_addr *);
|
||||
int IN6_IS_ADDR_MC_NODELOCAL(const struct in6_addr *);
|
||||
int IN6_IS_ADDR_MC_LINKLOCAL(const struct in6_addr *);
|
||||
int IN6_IS_ADDR_MC_SITELOCAL(const struct in6_addr *);
|
||||
int IN6_IS_ADDR_MC_ORGLOCAL(const struct in6_addr *);
|
||||
int IN6_IS_ADDR_MC_GLOBAL(const struct in6_addr *);
|
||||
int IN6ADDR_ISANY(const struct sockaddr_in6 *);
|
||||
int IN6ADDR_ISLOOPBACK(const struct sockaddr_in6 *);
|
||||
void IN6_SET_ADDR_UNSPECIFIED(struct in6_addr *);
|
||||
void IN6_SET_ADDR_LOOPBACK(struct in6_addr *);
|
||||
void IN6ADDR_SETANY(struct sockaddr_in6 *);
|
||||
void IN6ADDR_SETLOOPBACK(struct sockaddr_in6 *);
|
||||
|
||||
#ifndef __CRT__NO_INLINE
|
||||
WS2TCPIP_INLINE int IN6_ADDR_EQUAL(const struct in6_addr *a,const struct in6_addr *b) { return (memcmp(a,b,sizeof(struct in6_addr))==0); }
|
||||
WS2TCPIP_INLINE int IN6_IS_ADDR_UNSPECIFIED(const struct in6_addr *a) { return ((a->s6_words[0]==0) && (a->s6_words[1]==0) && (a->s6_words[2]==0) && (a->s6_words[3]==0) && (a->s6_words[4]==0) && (a->s6_words[5]==0) && (a->s6_words[6]==0) && (a->s6_words[7]==0)); }
|
||||
WS2TCPIP_INLINE int IN6_IS_ADDR_LOOPBACK(const struct in6_addr *a) { return ((a->s6_words[0]==0) && (a->s6_words[1]==0) && (a->s6_words[2]==0) && (a->s6_words[3]==0) && (a->s6_words[4]==0) && (a->s6_words[5]==0) && (a->s6_words[6]==0) && (a->s6_words[7]==0x0100)); }
|
||||
WS2TCPIP_INLINE int IN6_IS_ADDR_MULTICAST(const struct in6_addr *a) { return (a->s6_bytes[0]==0xff); }
|
||||
WS2TCPIP_INLINE int IN6_IS_ADDR_LINKLOCAL(const struct in6_addr *a) { return ((a->s6_bytes[0]==0xfe) && ((a->s6_bytes[1] & 0xc0)==0x80)); }
|
||||
WS2TCPIP_INLINE int IN6_IS_ADDR_SITELOCAL(const struct in6_addr *a) { return ((a->s6_bytes[0]==0xfe) && ((a->s6_bytes[1] & 0xc0)==0xc0)); }
|
||||
WS2TCPIP_INLINE int IN6_IS_ADDR_V4MAPPED(const struct in6_addr *a) { return ((a->s6_words[0]==0) && (a->s6_words[1]==0) && (a->s6_words[2]==0) && (a->s6_words[3]==0) && (a->s6_words[4]==0) && (a->s6_words[5]==0xffff)); }
|
||||
WS2TCPIP_INLINE int IN6_IS_ADDR_V4COMPAT(const struct in6_addr *a) { return ((a->s6_words[0]==0) && (a->s6_words[1]==0) && (a->s6_words[2]==0) && (a->s6_words[3]==0) && (a->s6_words[4]==0) && (a->s6_words[5]==0) && !((a->s6_words[6]==0) && (a->s6_addr[14]==0) && ((a->s6_addr[15]==0) || (a->s6_addr[15]==1)))); }
|
||||
WS2TCPIP_INLINE int IN6_IS_ADDR_MC_NODELOCAL(const struct in6_addr *a) { return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_bytes[1] & 0xf)==1); }
|
||||
WS2TCPIP_INLINE int IN6_IS_ADDR_MC_LINKLOCAL(const struct in6_addr *a) { return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_bytes[1] & 0xf)==2); }
|
||||
WS2TCPIP_INLINE int IN6_IS_ADDR_MC_SITELOCAL(const struct in6_addr *a) { return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_bytes[1] & 0xf)==5); }
|
||||
WS2TCPIP_INLINE int IN6_IS_ADDR_MC_ORGLOCAL(const struct in6_addr *a) { return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_bytes[1] & 0xf)==8); }
|
||||
WS2TCPIP_INLINE int IN6_IS_ADDR_MC_GLOBAL(const struct in6_addr *a) { return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_bytes[1] & 0xf)==0xe); }
|
||||
WS2TCPIP_INLINE int IN6ADDR_ISANY(const struct sockaddr_in6 *a) { return ((a->sin6_family==AF_INET6) && IN6_IS_ADDR_UNSPECIFIED(&a->sin6_addr)); }
|
||||
WS2TCPIP_INLINE int IN6ADDR_ISLOOPBACK(const struct sockaddr_in6 *a) { return ((a->sin6_family==AF_INET6) && IN6_IS_ADDR_LOOPBACK(&a->sin6_addr)); }
|
||||
WS2TCPIP_INLINE void IN6_SET_ADDR_UNSPECIFIED(struct in6_addr *a) { memset(a->s6_bytes,0,sizeof(struct in6_addr)); }
|
||||
WS2TCPIP_INLINE void IN6_SET_ADDR_LOOPBACK(struct in6_addr *a) {
|
||||
memset(a->s6_bytes,0,sizeof(struct in6_addr));
|
||||
a->s6_bytes[15] = 1;
|
||||
}
|
||||
WS2TCPIP_INLINE void IN6ADDR_SETANY(struct sockaddr_in6 *a) {
|
||||
a->sin6_family = AF_INET6;
|
||||
a->sin6_port = 0;
|
||||
a->sin6_flowinfo = 0;
|
||||
IN6_SET_ADDR_UNSPECIFIED(&a->sin6_addr);
|
||||
a->sin6_scope_id = 0;
|
||||
}
|
||||
WS2TCPIP_INLINE void IN6ADDR_SETLOOPBACK(struct sockaddr_in6 *a) {
|
||||
a->sin6_family = AF_INET6;
|
||||
a->sin6_port = 0;
|
||||
a->sin6_flowinfo = 0;
|
||||
IN6_SET_ADDR_LOOPBACK(&a->sin6_addr);
|
||||
a->sin6_scope_id = 0;
|
||||
}
|
||||
#endif /* !__CRT__NO_INLINE */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
typedef struct _INTERFACE_INFO_EX {
|
||||
u_long iiFlags;
|
||||
SOCKET_ADDRESS iiAddress;
|
||||
SOCKET_ADDRESS iiBroadcastAddress;
|
||||
SOCKET_ADDRESS iiNetmask;
|
||||
} INTERFACE_INFO_EX,*LPINTERFACE_INFO_EX;
|
||||
|
||||
#define IFF_UP 0x00000001
|
||||
#define IFF_BROADCAST 0x00000002
|
||||
#define IFF_LOOPBACK 0x00000004
|
||||
#define IFF_POINTTOPOINT 0x00000008
|
||||
#define IFF_MULTICAST 0x00000010
|
||||
|
||||
typedef struct in_pktinfo {
|
||||
IN_ADDR ipi_addr;
|
||||
UINT ipi_ifindex;
|
||||
} IN_PKTINFO;
|
||||
|
||||
C_ASSERT(sizeof(IN_PKTINFO)==8);
|
||||
|
||||
typedef struct in6_pktinfo {
|
||||
IN6_ADDR ipi6_addr;
|
||||
UINT ipi6_ifindex;
|
||||
} IN6_PKTINFO;
|
||||
|
||||
C_ASSERT(sizeof(IN6_PKTINFO)==20);
|
||||
|
||||
#define EAI_AGAIN WSATRY_AGAIN
|
||||
#define EAI_BADFLAGS WSAEINVAL
|
||||
#define EAI_FAIL WSANO_RECOVERY
|
||||
#define EAI_FAMILY WSAEAFNOSUPPORT
|
||||
#define EAI_MEMORY WSA_NOT_ENOUGH_MEMORY
|
||||
|
||||
#define EAI_NONAME WSAHOST_NOT_FOUND
|
||||
#define EAI_SERVICE WSATYPE_NOT_FOUND
|
||||
#define EAI_SOCKTYPE WSAESOCKTNOSUPPORT
|
||||
|
||||
#define EAI_NODATA EAI_NONAME
|
||||
|
||||
typedef struct addrinfo {
|
||||
int ai_flags;
|
||||
int ai_family;
|
||||
int ai_socktype;
|
||||
int ai_protocol;
|
||||
size_t ai_addrlen;
|
||||
char *ai_canonname;
|
||||
struct sockaddr *ai_addr;
|
||||
struct addrinfo *ai_next;
|
||||
} ADDRINFOA,*PADDRINFOA;
|
||||
|
||||
typedef struct addrinfoW {
|
||||
int ai_flags;
|
||||
int ai_family;
|
||||
int ai_socktype;
|
||||
int ai_protocol;
|
||||
size_t ai_addrlen;
|
||||
PWSTR ai_canonname;
|
||||
struct sockaddr *ai_addr;
|
||||
struct addrinfoW *ai_next;
|
||||
} ADDRINFOW,*PADDRINFOW;
|
||||
|
||||
typedef __MINGW_NAME_AW(ADDRINFO) ADDRINFOT,*PADDRINFOT;
|
||||
|
||||
typedef ADDRINFOA ADDRINFO,*LPADDRINFO;
|
||||
|
||||
#define AI_PASSIVE 0x1
|
||||
#define AI_CANONNAME 0x2
|
||||
#define AI_NUMERICHOST 0x4
|
||||
#if (_WIN32_WINNT >= 0x0600)
|
||||
#define AI_ADDRCONFIG 0x0400
|
||||
#define AI_NON_AUTHORITATIVE 0x04000
|
||||
#define AI_SECURE 0x08000
|
||||
#define AI_RETURN_PREFERRED_NAMES 0x010000
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define GetAddrInfo __MINGW_NAME_AW(GetAddrInfo)
|
||||
|
||||
WINSOCK_API_LINKAGE int WSAAPI getaddrinfo(const char *nodename,const char *servname,const struct addrinfo *hints,struct addrinfo **res);
|
||||
WINSOCK_API_LINKAGE int WSAAPI GetAddrInfoW(PCWSTR pNodeName,PCWSTR pServiceName,const ADDRINFOW *pHints,PADDRINFOW *ppResult);
|
||||
|
||||
#define GetAddrInfoA getaddrinfo
|
||||
|
||||
#if INCL_WINSOCK_API_TYPEDEFS
|
||||
typedef int (WSAAPI *LPFN_GETADDRINFO)(const char *nodename,const char *servname,const struct addrinfo *hints,struct addrinfo **res);
|
||||
typedef int (WSAAPI *LPFN_GETADDRINFOW)(PCWSTR pNodeName,PCWSTR pServiceName,const ADDRINFOW *pHints,PADDRINFOW *ppResult);
|
||||
|
||||
#define LPFN_GETADDRINFOA LPFN_GETADDRINFO
|
||||
|
||||
#define LPFN_GETADDRINFOT __MINGW_NAME_AW(LPFN_GETADDRINFO)
|
||||
#endif
|
||||
|
||||
#define FreeAddrInfo __MINGW_NAME_AW(FreeAddrInfo)
|
||||
|
||||
WINSOCK_API_LINKAGE void WSAAPI freeaddrinfo(LPADDRINFO pAddrInfo);
|
||||
WINSOCK_API_LINKAGE void WSAAPI FreeAddrInfoW(PADDRINFOW pAddrInfo);
|
||||
|
||||
#define FreeAddrInfoA freeaddrinfo
|
||||
|
||||
#if INCL_WINSOCK_API_TYPEDEFS
|
||||
typedef void (WSAAPI *LPFN_FREEADDRINFO)(struct addrinfo *ai);
|
||||
typedef void (WSAAPI *LPFN_FREEADDRINFOW)(PADDRINFOW pAddrInfo);
|
||||
|
||||
#define LPFN_FREEADDRINFOA LPFN_FREEADDRINFO
|
||||
|
||||
#define LPFN_FREEADDRINFOT __MINGW_NAME_AW(LPFN_FREEADDRINFO)
|
||||
#endif
|
||||
|
||||
typedef int socklen_t;
|
||||
|
||||
#define GetNameInfo __MINGW_NAME_AW(GetNameInfo)
|
||||
|
||||
WINSOCK_API_LINKAGE int WSAAPI getnameinfo(const struct sockaddr *sa,socklen_t salen,char *host,DWORD hostlen,char *serv,DWORD servlen,int flags);
|
||||
WINSOCK_API_LINKAGE INT WSAAPI GetNameInfoW(const SOCKADDR *pSockaddr,socklen_t SockaddrLength,PWCHAR pNodeBuffer,DWORD NodeBufferSize,PWCHAR pServiceBuffer,DWORD ServiceBufferSize,INT Flags);
|
||||
|
||||
#define GetNameInfoA getnameinfo
|
||||
|
||||
#if INCL_WINSOCK_API_TYPEDEFS
|
||||
typedef int (WSAAPI *LPFN_GETNAMEINFO)(const struct sockaddr *sa,socklen_t salen,char *host,DWORD hostlen,char *serv,DWORD servlen,int flags);
|
||||
typedef INT (WSAAPI *LPFN_GETNAMEINFOW)(const SOCKADDR *pSockaddr,socklen_t SockaddrLength,PWCHAR pNodeBuffer,DWORD NodeBufferSize,PWCHAR pServiceBuffer,DWORD ServiceBufferSize,INT Flags);
|
||||
|
||||
#define LPFN_GETNAMEINFOA LPFN_GETNAMEINFO
|
||||
|
||||
#define LPFN_GETNAMEINFOT __MINGW_NAME_AW(LPFN_GETNAMEINFO)
|
||||
#endif
|
||||
|
||||
#define gai_strerror __MINGW_NAME_AW(gai_strerror)
|
||||
|
||||
#define GAI_STRERROR_BUFFER_SIZE 1024
|
||||
|
||||
char *gai_strerrorA (int);
|
||||
WCHAR *gai_strerrorW(int);
|
||||
|
||||
#define NI_MAXHOST 1025
|
||||
#define NI_MAXSERV 32
|
||||
|
||||
#define INET_ADDRSTRLEN 22
|
||||
#define INET6_ADDRSTRLEN 65
|
||||
|
||||
#define NI_NOFQDN 0x01
|
||||
#define NI_NUMERICHOST 0x02
|
||||
#define NI_NAMEREQD 0x04
|
||||
#define NI_NUMERICSERV 0x08
|
||||
#define NI_DGRAM 0x10
|
||||
|
||||
#include <mstcpip.h>
|
||||
|
||||
#if (_WIN32_WINNT >= 0x0600)
|
||||
#define addrinfoEx __MINGW_NAME_AW(addrinfoEx)
|
||||
#define PADDRINFOEX __MINGW_NAME_AW(PADDRINFOEX)
|
||||
#define GetAddrInfoEx __MINGW_NAME_AW(GetAddrInfoEx)
|
||||
#define SetAddrInfoEx __MINGW_NAME_AW(SetAddrInfoEx)
|
||||
#define FreeAddrInfoEx __MINGW_NAME_AW(FreeAddrInfoEx)
|
||||
|
||||
typedef struct addrinfoExA {
|
||||
int ai_flags;
|
||||
int ai_family;
|
||||
int ai_socktype;
|
||||
int ai_protocol;
|
||||
size_t ai_addrlen;
|
||||
LPCSTR ai_canonname;
|
||||
struct sockaddr *ai_addr;
|
||||
void *ai_blob;
|
||||
size_t ai_bloblen;
|
||||
LPGUID ai_provider;
|
||||
struct addrinfoexA *ai_next;
|
||||
} ADDRINFOEXA, *PADDRINFOEXA;
|
||||
|
||||
typedef struct addrinfoExW {
|
||||
int ai_flags;
|
||||
int ai_family;
|
||||
int ai_socktype;
|
||||
int ai_protocol;
|
||||
size_t ai_addrlen;
|
||||
LPCWSTR ai_canonname;
|
||||
struct sockaddr *ai_addr;
|
||||
void *ai_blob;
|
||||
size_t ai_bloblen;
|
||||
LPGUID ai_provider;
|
||||
struct addrinfoexW *ai_next;
|
||||
} ADDRINFOEXW, *PADDRINFOEXW;
|
||||
|
||||
typedef PVOID LPLOOKUPSERVICE_COMPLETION_ROUTINE; /*reserved*/
|
||||
|
||||
WINSOCK_API_LINKAGE int WSAAPI GetAddrInfoExA(PCSTR pName, PCSTR pServiceName, DWORD dwNameSpace,
|
||||
LPGUID lpNspId,const ADDRINFOEXA *pHints,PADDRINFOEXA *ppResult,
|
||||
struct timeval *timeout,LPOVERLAPPED lpOverlapped,
|
||||
LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
|
||||
LPHANDLE lpNameHandle);
|
||||
WINSOCK_API_LINKAGE int WSAAPI GetAddrInfoExW(PCWSTR pName,PCWSTR pServiceName,DWORD dwNameSpace,
|
||||
LPGUID lpNspId,const ADDRINFOEXW *pHints,PADDRINFOEXW *ppResult,
|
||||
struct timeval *timeout,LPOVERLAPPED lpOverlapped,
|
||||
LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
|
||||
LPHANDLE lpNameHandle);
|
||||
|
||||
WINSOCK_API_LINKAGE int WSAAPI SetAddrInfoExA(PCSTR pName, PCSTR pServiceName, SOCKET_ADDRESS *pAddresses,
|
||||
DWORD dwAddressCount,LPBLOB lpBlob,DWORD dwFlags,DWORD dwNameSpace,
|
||||
LPGUID lpNspId,struct timeval *timeout,LPOVERLAPPED lpOverlapped,
|
||||
LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
|
||||
LPHANDLE lpNameHandle);
|
||||
WINSOCK_API_LINKAGE int WSAAPI SetAddrInfoExW(PCWSTR pName,PCWSTR pServiceName,SOCKET_ADDRESS *pAddresses,
|
||||
DWORD dwAddressCount,LPBLOB lpBlob,DWORD dwFlags,DWORD dwNameSpace,
|
||||
LPGUID lpNspId,struct timeval *timeout,LPOVERLAPPED lpOverlapped,
|
||||
LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
|
||||
LPHANDLE lpNameHandle);
|
||||
|
||||
WINSOCK_API_LINKAGE void WSAAPI FreeAddrInfoExA(PADDRINFOEXA pAddrInfo);
|
||||
WINSOCK_API_LINKAGE void WSAAPI FreeAddrInfoExW(PADDRINFOEXW pAddrInfo);
|
||||
|
||||
#if INCL_WINSOCK_API_TYPEDEFS
|
||||
#define LPFN_GETADDRINFOEX __MINGW_NAME_AW(LPFN_GETADDRINFOEX)
|
||||
typedef int (WSAAPI *LPFN_GETADDRINFOEXA)(PCSTR pName, PCSTR pServiceName, DWORD dwNameSpace,
|
||||
LPGUID lpNspId,const ADDRINFOEXA *pHints,PADDRINFOEXA *ppResult,
|
||||
struct timeval *timeout,LPOVERLAPPED lpOverlapped,
|
||||
LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
|
||||
LPHANDLE lpNameHandle);
|
||||
typedef int (WSAAPI *LPFN_GETADDRINFOEXW)(PCWSTR pName,PCWSTR pServiceName,DWORD dwNameSpace,
|
||||
LPGUID lpNspId,const ADDRINFOEXW *pHints,PADDRINFOEXW *ppResult,
|
||||
struct timeval *timeout,LPOVERLAPPED lpOverlapped,
|
||||
LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
|
||||
LPHANDLE lpNameHandle);
|
||||
|
||||
#define LPFN_SETADDRINFOEX __MINGW_NAME_AW(LPFN_SETADDRINFOEX)
|
||||
typedef int (WSAAPI *LPFN_SETADDRINFOEXA)(PCSTR pName, PCSTR pServiceName, SOCKET_ADDRESS *pAddresses,
|
||||
DWORD dwAddressCount,LPBLOB lpBlob,DWORD dwFlags,DWORD dwNameSpace,
|
||||
LPGUID lpNspId,struct timeval *timeout,LPOVERLAPPED lpOverlapped,
|
||||
LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
|
||||
LPHANDLE lpNameHandle);
|
||||
typedef int (WSAAPI *LPFN_SETADDRINFOEXW)(PCWSTR pName,PCWSTR pServiceName,SOCKET_ADDRESS *pAddresses,
|
||||
DWORD dwAddressCount,LPBLOB lpBlob,DWORD dwFlags,DWORD dwNameSpace,
|
||||
LPGUID lpNspId,struct timeval *timeout,LPOVERLAPPED lpOverlapped,
|
||||
LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
|
||||
LPHANDLE lpNameHandle);
|
||||
|
||||
#define LPFN_FREEADDRINFOEX __MINGW_NAME_AW(LPFN_FREEADDRINFOEX)
|
||||
typedef void (WSAAPI *LPFN_FREEADDRINFOEXA)(PADDRINFOEXA pAddrInfo);
|
||||
typedef void (WSAAPI *LPFN_FREEADDRINFOEXW)(PADDRINFOEXW pAddrInfo);
|
||||
#endif /* INCL_WINSOCK_API_TYPEDEFS */
|
||||
|
||||
|
||||
WINSOCK_API_LINKAGE int WSAAPI WSAImpersonateSocketPeer(
|
||||
SOCKET Socket,
|
||||
const struct sockaddr *PeerAddress,
|
||||
ULONG peerAddressLen
|
||||
);
|
||||
|
||||
WINSOCK_API_LINKAGE int WSAAPI WSAQuerySocketSecurity(
|
||||
SOCKET Socket,
|
||||
const SOCKET_SECURITY_QUERY_TEMPLATE *SecurityQueryTemplate,
|
||||
ULONG SecurityQueryTemplateLen,
|
||||
SOCKET_SECURITY_QUERY_INFO *SecurityQueryInfo,
|
||||
ULONG *SecurityQueryInfoLen,
|
||||
LPWSAOVERLAPPED Overlapped,
|
||||
LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine
|
||||
);
|
||||
|
||||
WINSOCK_API_LINKAGE int WSAAPI WSARevertImpersonation(void);
|
||||
|
||||
WINSOCK_API_LINKAGE int WSAAPI WSASetSocketPeerTargetName(
|
||||
SOCKET Socket,
|
||||
const SOCKET_PEER_TARGET_NAME *PeerTargetName,
|
||||
ULONG PeerTargetNameLen,
|
||||
LPWSAOVERLAPPED Overlapped,
|
||||
LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine
|
||||
);
|
||||
|
||||
WINSOCK_API_LINKAGE int WSAAPI WSASetSocketSecurity(
|
||||
SOCKET Socket,
|
||||
const SOCKET_SECURITY_SETTINGS *SecuritySettings,
|
||||
ULONG SecuritySettingsLen,
|
||||
LPWSAOVERLAPPED Overlapped,
|
||||
LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine
|
||||
);
|
||||
|
||||
#endif /*(_WIN32_WINNT >= 0x0600)*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _WS2TCPIP_H_ */
|
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,6 @@
|
||||
// =============================================
|
||||
// crt1.c
|
||||
|
||||
// For ExitProcess
|
||||
// windows.h header file should be included before any other library include
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@ -16,47 +13,23 @@
|
||||
#define _PC_53 0x00010000 // 53 bits
|
||||
#define _PC_64 0x00000000 // 64 bits
|
||||
|
||||
#ifndef __TRY__
|
||||
#ifdef _WIN64
|
||||
#define __TRY__
|
||||
#else
|
||||
#define __TRY__ void __try__(void**), *_sehrec[6]; __try__(_sehrec);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int newmode;
|
||||
} _startupinfo;
|
||||
|
||||
// Prototype of __getmainargs:
|
||||
// in msvcrt v6.x : returns void (windows 98, 2000)
|
||||
// in msvcrt v7.x : returns int (windows xp and above)
|
||||
// Using the last for check the result. A negative value means no success.
|
||||
// These are the test results of call to __getmainargs with the heap fully:
|
||||
// win 98, 2000 :
|
||||
// program termination with error code 255 after call _amsg_exit(8)
|
||||
// prints: "runtime error R6008\r\n- not enough space for arguments\r\n"
|
||||
// win xp :
|
||||
// returns -1
|
||||
// win 7, 8 :
|
||||
// program termination with error code -1 after call ExitProcess(-1)
|
||||
//
|
||||
// Checking the return of this function also works on windows 98 and 2000
|
||||
// because internally it sets to eax the value of the third parameter.
|
||||
// In this case is &env and at that point it is not a negative value.
|
||||
|
||||
int __cdecl __getmainargs(int *pargc, char ***pargv, char ***penv, int globb, _startupinfo*);
|
||||
void __cdecl __set_app_type(int apptype);
|
||||
unsigned int __cdecl _controlfp(unsigned int new_value, unsigned int mask);
|
||||
|
||||
void _start(void);
|
||||
int main(int argc, char * argv[], char * env[]);
|
||||
|
||||
/* Allow command-line globbing with "int _dowildcard = 1;" in the user source */
|
||||
int _dowildcard;
|
||||
|
||||
void _start(void)
|
||||
{
|
||||
__TRY__
|
||||
int argc;
|
||||
int argc, ret;
|
||||
char **argv;
|
||||
char **env;
|
||||
_startupinfo start_info;
|
||||
@ -67,20 +40,14 @@ void _start(void)
|
||||
// Set default FP precision to 53 bits (8-byte double)
|
||||
// _MCW_PC (Precision control) is not supported on
|
||||
// the ARM and x64 architectures
|
||||
#if defined(_X86_) && !defined(__x86_64)
|
||||
#ifdef __i386
|
||||
_controlfp(_PC_53, _MCW_PC);
|
||||
#endif
|
||||
|
||||
start_info.newmode = 0;
|
||||
if ( __getmainargs( &argc, &argv, &env, 0, &start_info ) < 0 )
|
||||
{
|
||||
ExitProcess(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
exit( main(argc, argv, env) );
|
||||
}
|
||||
|
||||
__getmainargs( &argc, &argv, &env, _dowildcard, &start_info);
|
||||
ret = main(argc, argv, env);
|
||||
exit(ret);
|
||||
}
|
||||
|
||||
// =============================================
|
||||
|
@ -9,14 +9,6 @@
|
||||
void __set_app_type(int);
|
||||
void _controlfp(unsigned a, unsigned b);
|
||||
|
||||
#ifndef __TRY__
|
||||
#ifdef _WIN64
|
||||
#define __TRY__
|
||||
#else
|
||||
#define __TRY__ void __try__(void**), *_sehrec[6]; __try__(_sehrec);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int _winstart(void)
|
||||
{
|
||||
__TRY__
|
||||
|
Loading…
Reference in New Issue
Block a user