diff --git a/cmake/define.inc b/cmake/define.inc index 73d4ccb37e0335e21b5a8c507fcdeef6622c2e5b..b1e8f097beb45a199f1d2490211154b215ea0960 100755 --- a/cmake/define.inc +++ b/cmake/define.inc @@ -121,6 +121,7 @@ IF (TD_WINDOWS) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/iconv) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/regex) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/wepoll/inc) + INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/MsvcLibX/include) ENDIF () IF (TD_WINDOWS_64) diff --git a/cmake/install.inc b/cmake/install.inc index 8d3acde45d1f614657b23ec563a511a0c67a9f20..98a60ace7b9fe1a9a83df7b9c5f9e69306d5b663 100755 --- a/cmake/install.inc +++ b/cmake/install.inc @@ -27,7 +27,7 @@ ELSEIF (TD_WINDOWS_64) #INSTALL(TARGETS taos RUNTIME DESTINATION driver) #INSTALL(TARGETS shell RUNTIME DESTINATION .) IF (TD_MVN_INSTALLED) - INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos-jdbcdriver-1.0.2-dist.jar DESTINATION connector/jdbc) + INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos-jdbcdriver-2.0.0-dist.jar DESTINATION connector/jdbc) ENDIF () ELSE () INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/libtaos.dll DESTINATION driver) diff --git a/deps/MsvcLibX/CMakeLists.txt b/deps/MsvcLibX/CMakeLists.txt index 7f24d34dd5f311967d1292beadb63b9136aabd52..fc77a3b447d337cf0b1e4343c9fb2f9d97fd423c 100644 --- a/deps/MsvcLibX/CMakeLists.txt +++ b/deps/MsvcLibX/CMakeLists.txt @@ -1,30 +1,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) -IF (TD_WINDOWS_64) - SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) - - include(FindWindowsSDK) - get_mywindowssdk_include_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_INCLUDE_DIR) - get_ucrt_include_dirs(${WINDOWSSDK_PREFERRED_DIR} UCRT_INCLUDE_DIR) - - Add_Definitions("-DWSDKINCLUDE=${WINSDK_INCLUDE_DIR}") - - include(FindMSVC) - Add_Definitions("-DMSVCINCLUDE=${VC_INCLUDE_DIR}") - - IF ((NOT DEFINED UCRT_INCLUDE_DIR) OR (UCRT_INCLUDE_DIR STREQUAL "NOTFOUND")) - Message(STATUS "UCRT_INCLUDE_DIR notu found, set it to vc incude dir") - SET(UCRT_INCLUDE_DIR "${VC_INCLUDE_DIR}") - Add_Definitions("-DUCRTINCLUDE=${VC_INCLUDE_DIR}") - ELSE () - Add_Definitions("-DUCRTINCLUDE=${UCRT_INCLUDE_DIR}") - ENDIF () - - Message(STATUS "WINSDK_INCLUDE_DIR: ${WINSDK_INCLUDE_DIR}") - Message(STATUS "UCRT_INCLUDE_DIR: ${UCRT_INCLUDE_DIR}") - Message(STATUS "VC_INCLUDE_DIR: ${VC_INCLUDE_DIR}") - +IF (TD_WINDOWS) INCLUDE_DIRECTORIES(include) AUX_SOURCE_DIRECTORY(src SRC) ADD_LIBRARY(MsvcLibXw64 ${SRC}) diff --git a/deps/MsvcLibX/README.md b/deps/MsvcLibX/README.md deleted file mode 100644 index 8f689412cbd1e1d4c4b5b89e69865998964c159f..0000000000000000000000000000000000000000 --- a/deps/MsvcLibX/README.md +++ /dev/null @@ -1,820 +0,0 @@ -MsvcLibX - A set of MSVC Library eXtensions -=========================================== - - -Introduction ------------- - -The MsvcLibX library is built upon 30 years of work. -It exists because the Microsoft Visual C/C++ library is only a subset of the -standard C library, and I wanted to port to DOS and Windows programs using some -of the missing parts. -Initially Microsoft C compilers for MS-DOS tried to be as compliant as possible -with the standard C library. Then Microsoft rewrote their library for Windows. -But when the WIN32 API became prevalent, Microsoft apparently lost interest, -and stopped porting to MS-DOS and Windows the new C include files and library -routines that got standardized over the years. -To the point that's it's now impossible to rebuild any recent Posix/Unix/Linux -program using the MSVC library. - -MsvcLibX adds a number of standard include files and library routines that I've -needed over the years. For example the directory access routines defined in -dirent.h, or the symbolic link support in unistd.h. -It also includes a number of useful routines and macros, either needed -internally to implement and debug the above, or made necessary by irresolvable -incompatibilities between Unix and Windows. - -Other major features of the MsvcLibX library are: - -* A powerful make system, based on Microsoft nmake files, that allow building - multiple versions of the same program (Ex: DOS/WIN32/WIN64) with one simple - command. And in most cases without having to write any dedicated make file. -* Support for UTF-8 sources, allowing to build programs working in any code page. -* Support for NTFS symlinks and junctions. -* Support for DOS, and Windows 95 targets, for targeting old computers. -* Support for bound DOS+Windows programs, for truly universal executables that - work in *all* versions of DOS and Windows. - -An obvious alternative exists for building Windows programs: MinGW. -But I started all this before MinGW even existed. And, surprisingly, even MinGW -still has holes in 2014, where MsvcLibX in significantly more advanced. -Another alternative is CygWin. This one is more complete, but also much more -heavyweight. Using programs built with CygWin requires installing CygWin DLLs. -Copying the program .exe from one system to the next is not sufficient. In that -sense, MinGW or MsvcLibX are much better. - -Contrary to MinGW and CygWin, MsvcLibX does not attempt to be complete, and is -unlikely to ever be. But any contribution of improvements is welcome. -Likewise, any help at contributing unique MsvcLibX features to MinGW is welcome. - -Jean-François Larvoire -2016-09-29 - - -Building the MsvcLibX library ------------------------------ - -On a recent Windows PC, with Microsoft Visual C++ compilers installed: - -- Select a base work directory. I'll call it %BASEDIR% in the examples below: - - set "HOME=%HOMEDRIVE%%HOMEPATH%" - set "BASEDIR=%HOME%\Documents\SRC" - md "%BASEDIR%" - cd "%BASEDIR%" - -- Extract the MsvcLibX archive into a work subdirectory. Ex: %BASEDIR%\MsvcLibX\ - This will put files in several subdirectories: include, src - -- Open a cmd window, and run: - - cd "%BASEDIR%\MsvcLibX\src" - configure - make - -The configure.bat script will locate your MSVC tools, and generate a config -file. It needs to be run once initially, then again if new MSVC tool versions -are installed. -The make.bat script should take care of everything, and rebuild normal and debug -versions of the MsvcLibX.lib library for all operating systems your tools support. -In the end, it defines system environment variable MSVCLIBX, necessary for -building programs using the MsvcLibX.lib library. - -Requirements: - -- Microsoft Visual C++ compiler and linker for Windows 32 and 64 bits targets. -- Microsoft Windows SDK. (May be installed along with Visual C++) - -As of 2015-12-10, I've tested the make.bat script and make files with Visual C++ -2005, 2008, 2012, and 2015, and Windows SDK 5.2, 8.1, and 10. -Support for older versions is still built-in, but I've not tested it for long. -Support for newer versions will require minor tweaks in configure.bat. -Note that configure.bat does not depend on MSVC's vcvars.bat. It will attempt -to locate and use the latest usable version of MSVC it finds in Program Files. - -Optional: - -- Microsoft Visual C++ 1.52 compiler and linker for MS-DOS targets. - If present in C:\MSVC, make.bat will also generate libraries for DOS. - Note that generating DOS versions is still more useful than it looks: - Experience has shown that the severe memory constraints under DOS are a very - good revelator of memory leaks, and other bad pointer issues. Build your - programs for DOS too if you can, and test them in a VM with Windows XP. - This takes a very small extra build time. And it'll be very much worth the time - if the Windows version appears to work, but the DOS version does not. - Visual C++ 1.52 is available on the Visual Studio 2005 CD. -- The Visual C++ 8 compiler and tools from Microsoft Visual Studio 2005. - This is the last version that allowed building programs for Windows 95/NT4. - -The MsvcLibX.lib libraries are generated in subdirectories of src, then copied -into the %BASEDIR%\MsvcLibX\lib directory, and renamed as shown in this table: - -Subdirectory | Description | Renamed as ----------------- | -------------------------------------- | ---------------- -DOS\BIN\T\ | DOS normal version, tiny memory model | MsvcLibXdt.lib -DOS\DEBUG\BIN\T\ | DOS debug version, tiny memory model | MsvcLibXdtd.lib -DOS\BIN\S\ | DOS normal version, small memory model | MsvcLibXds.lib -DOS\DEBUG\BIN\S\ | DOS debug version, small memory model | MsvcLibXdsd.lib -DOS\BIN\L\ | DOS normal version, large memory model | MsvcLibXdl.lib -DOS\DEBUG\BIN\L\ | DOS debug version, large memory model | MsvcLibXdld.lib -WIN95\ | WIN32 normal version for Windows 95 | MsvcLibXw32.lib -WIN95\DEBUG\ | WIN32 debug version for Windows 95 | MsvcLibXw32d.lib -WIN32\ | WIN32 (X86) normal version | MsvcLibXw32.lib -WIN32\DEBUG\ | WIN32 (X86) debug version | MsvcLibXw32d.lib -WIN64\ | WIN64 (AMD64) normal version | MsvcLibXw64.lib -WIN64\DEBUG\ | WIN64 (AMD64) debug version | MsvcLibXw64d.lib - - -Building programs using the MsvcLibX library --------------------------------------------- - -Create a work directory, distinct from the MsvcLibX directories. Ex: - - set "HOME=%HOMEDRIVE%%HOMEPATH%" - set "BASEDIR=%HOME%\Documents\SRC" - md "%BASEDIR%\MyTools" - cd "%BASEDIR%\MyTools" - :# Define a variable giving the location of the MsvcLibX base directory - :# (Automatically defined if you built the library already on that same system.) - set "MSVCLIBX=%BASEDIR%\MsvcLibX" - :# Get batch files and make files from MsvcLibX sources - copy "%MSVCLIBX%\src\*.bat" - copy "%MSVCLIBX%\src\*.mak" - :# Create the configuration file (To be done just once) - configure - :# Compile and link your C or C++ program. - :# Ex, for the dirc.c sample, to create all dirc.exe versions, type: - make dirc.exe - :# If there is any error, the dirc.log file will pop up. - :# If there's no error, it's possible to check for warnings by reading dirc.log: - notepad dirc.log - :# All generated object files, listings, executables, etc, are in - :# target-OS-specific subdirectories, like for the MsvcLibX builds above. - :# They're automatically linked with the corresponding (renamed) MsvcLibX*.lib. - -make.bat will generate WIN32 (X86) and WIN64 (AMD64) versions by default, -and put them respectively in the WIN32\ and WIN64\ subdirectories. -It will also generate a DOS version in DOS\ if MSVC 1.52 is installed. -It will also generate a WIN95 version in WIN95\ if MSVC 8 (aka. 2005) is installed. -Run `make -?` get a help screen for make.bat. - -Note that the configure.bat and make.bat scripts are actually independent of the -rest of the MsvcLibX library. They can be used to easily build any console -programs for DOS and Windows, without loading the Visual Studio GUI. - -An exe.bat script is a front-end to make.bat, saving a few characters to type: -`exe dirc` <==> `make dirc.exe` - - -Building Linux versions of the same programs --------------------------------------------- - -Install virtual machines with Linux, and give them access to the host's file -system, for example in the /c directory. -Then execute the following commands, adapting the paths as needed: - - # Go to the work directory - BASEDIR=/c/Users/YOURNAME/Documents/SRC - mkdir $BASEDIR/MyTools - cd $BASEDIR/MyTools - # Get a bash script to build Linux versions using similar directory outputs - cp $BASEDIR/MsvcLibX/src/exe . - # Make sure the Linux C compiler finds MsvcLibX debug macros, but not other MsvcLibX include files. - # Important: Do not point C_INCLUDE_PATH at MsvcLibX/include, as this directory - # contains duplicates for standard include files (Ex: stdio.h), that will fail - # to compile in Linux. - mkdir ~/include - cp $BASEDIR/MsvcLibX/include/debugm.h ~/include - export C_INCLUDE_PATH=~/include - # Make sure that variable is defined in all future sessions - echo "export C_INCLUDE_PATH=~/include" >>~/.bashrc - # Compile your sample dirc.c program (which uses MsvcLibX debug macros) - ./exe dirc - # The output will be in subdirectories such as Linux.i686/ or Linux.x86_64/. - # (The exact name depends on `echo "$(uname -s).$(uname -m)"` output) - - -Adding new files to the library -------------------------------- - -All new files should have headers and comments similar to the existing ones. - -To add a new source file (let's call it newfile.c) into the library: - -- Put newfile.c in the %MSVCLIBX%\src directory. -- Add a +newfile.obj entry to the OBJECTS list in %MSVCLIBX%\src\Files.mak -- Also add a rule with newfile.c include files dependencies in src\Files.mak. -- Rebuild the library, and make sure there are no errors nor warnings. - -To add a new include file into the library: - -- All new include file names should be standard C library include files names! -- Put it in the include or include\sys subdirectory. - -To add an include file overriding an homonym one in the MSVC library: - -- The trick is to make it include MSVC's one, then define its own extensions. - As MSVC compilers do not support the #include_next directive, I've implemented - a mechanism for including MSVC include files using their full pathname. - As an example, see include/direct.h or include/sys/stat.h. - - -The make file system --------------------- - -Microsoft Visual Studio tools contain a build tool called nmake, very similar -to, but slightly incompatible with, Unix make. -MsvcLibX's make.bat is designed to give a similar feel to Unix make. -It uses internally a number of make files: - -Make file | Description ------------ | ---------------------------------------------------------------- -NMakefile | Default make file to use, if none is specified. -DOS.mak | Generic rules for building MS-DOS programs into the DOS subdir. -WIN32.mak | Generic rules for building 32-bits Windows programs into WIN32. -WIN64.mak | Generic rules for building 64-bits Windows programs into WIN64. -WIN95.mak | Generic rules for building Windows 95 programs into WIN95. -All.mak | Generic rules for building one or more of the above. -Files.mak | Application-specific source file dependancy rules. Intended to be includable from both Windows' nmakefile and Linux' makefile. - -DOS.mak, WIN32.mak, WIN64.mak, and All.mak are pretty stable, and should not -be changed. The only likely case where a change is needed would be to add extra -libraries to link with _all_ programs. -To add a library for one particular program, it'd be better to add a specific -rule in its own make file, as described below. -In all cases, see the detailed notes in each make file header. - -Specific make files: - -To build a target called program.exe, the 5 make files with generic rules -(DOS.mak, WIN32.mak, WIN64.mak, WIN95.mak, and All.mak) first look for a -specific make file called program.mak. They include it if present. This allows -defining application-specific rules. -These rules should use macros defined in the 4 make files to specify the -build environment and parameters. Here's a list of the most useful ones: - -Macro | Description ---------- | ---------------------------------------------------------------- -T | Target OS. One of DOS, WIN32, WIN64, WIN95. -S | Path of the source files -O | Path where to put the object files -B | Path where to put the binary executable files -L | Path where to put the listings -CFLAGS | Flags for Microsoft C compiler -INCLUDE | List of C include file paths, serarated by ';' -LFLAGS | Flags for Microsoft linker -PROGRAM | The program base name, infered from the target name. -SOURCES | The list of sources for the program. Default: PROGRAM.c or .cpp -OBJECTS | The list of objects to link. Default: PROGRAM.obj - -Scripts: - -Script | Description ---------------------- | -------------------------------------------------------- -make.bat | The main build tool. Invokes nmake. -config.%HOSTNAME%.bat | Defines paths to all tools used by make. Do not edit. -configure.bat | Analyses your system, and generates a config.%HOSTNAME%.bat file. -configure.*.bat | Define user or task-specific extensions to configure.bat. -exe.bat | Front end to make.bat, generating multiple goals. -exe | Linux shell script, invoking cc with multiple goals. -src2objs.bat | Internal script used by make files to convert SOURCES to OBJECTS - -configure.bat with search for configure.*.bat scripts in %windir%, then in %HOME%, -then in the current directory. -Put configuration scripts with your global preferences in %windir% for example. -Within each directory, the files are called in the alphabetic order, allowing -to manage predictable dependancies. - -Example 1: The 2clip program has no MS-DOS version. To prevent the make system -from attempting to build a DOS version (Only necessary if you DO have MSVC 1.52 -installed), create a 2clip.mak file with this content: - - !IF "$(T)"=="DOS" - complain: - @echo>con There's no DOS version of this program. - - dirs $(O)\2clip.obj $(B)\2clip.exe: complain - @rem Do nothing - !ENDIF - -Example 2: Porting to Windows a resize.c program manipulating jpeg images, -and using the libjpeg library. Create a resize.mak file with lines like these: - - INCLUDE=$(INCLUDE);C:\JFL\SRC\Libs\libjpeg;C:\JFL\SRC\Libs\libjpeg\jpeg-8d - LFLAGS=$(LFLAGS) C:\JFL\SRC\Libs\libjpeg\$(B)\libjpeg.lib - -Example 3: Some Windows programs need to include additional resources, defined -in a .rc file. Ex: The update program uses a manifest to control its rights. -Create an update.mak file with directives like this: - - !IF "$(T)"=="WIN32" || "$(T)"=="WIN64" - SOURCES=update.c update.rc - LFLAGS=$(LFLAGS) /MANIFEST - !ENDIF - - -The debug system ----------------- - -The MsvcLibX library makes it easy to build two versions of each program: - -- A release version, small lean and fast. -- A debug version, with additional code to help developers debug the program. - -It follows Microsoft's convention of defining the macro _DEBUG when compiling -a C/C++ source for a debug build. -But it goes much further, by providing in debugm.h a set of macros to assist -debugging. - -The general principle is that by default, the debug version operates exactly -like the release version. (Except possibly for performance) -Then, if the "debug mode" is enabled, it outputs debug messages on stdout. -A major property of the MsvcLibX debugging output is that is is intended by -function call depth. This makes it considerably easier to read the debug output. - -The MsvcLibX library itself is built in debug and release versions. -The make.bat system will link the release version of your program with the -release version of the MsvcLibX library, and likewise for the debug versions. -To use it, include debugm.h in your main module, and add to your main() routine -a command-line option (-d or --debug maybe?) that calls DEBUG_ON(). -There's also an "extra debug mode", displaying even more details than the -debug mode. It is enabled by calling DEBUG_ON() twice. ==> Invoke with -d -d. - -Debug macros: - -Macro | Description ---------------------------- | ------------------------------------------------ -DEBUG_ON() | Enable the debug mode. -DEBUG_CODE(...) | The code within parentheses is only compiled in the debug version -DEBUG_PRINTF((format, ...)) | Generates a printf instruction in the debug version only, that prints only if debug mode is enabled, with the output indented by call depth. -DEBUG_ENTER((format, ...)) | Like DEBUG_PRINTF, but for use at the beginning of a function. Increases the indent level. -DEBUG_LEAVE((format, ...)) | Like DEBUG_PRINTF, but for use before returning from a function. Decreases the indent level. - -Note that every use of DEBUG_ENTER must be matched by one DEBUG_LEAVE. So if a -function has several return instructions, every return must be preceded by a -DEBUG_LEAVE. - -DEBUG_LEAVE alternatives: -To further simplify the source, a pair DEBUG_LEAVE()/return can be replaced by -one of the following macros: - -Macro | Simplified description ------------------------------ | ------------------------------------------------ -RETURN_INT(i) | DEBUG_LEAVE(("return %d\n", i)); return i; -RETURN_INT_COMMENT(i, (args)) | Idem, plus prints a comment behind the return -RETURN_BOOL(b) | DEBUG_LEAVE(("return %s\n", b?"TRUE":"FALSE")); return b; -RETURN_BOOL_COMMENT(b, (...)) | Idem, plus prints a comment behind the return -RETURN_CHAR(c) | DEBUG_LEAVE(("return %c\n", c)); return c; -RETURN_STRING(s) | DEBUG_LEAVE(("return %s\n", s)); return s; - -For all the above, the release version just does return retValue; - -Example for a recursive function factorial: - - int fact(int n) { - DEBUG_ENTER((__FUNCTION__ "(%d);\n", n)); - if (n) n *= fact(n-1); else n = 1; - RETURN_INT(n); - } - -The debug version, in debug mode, invoked with argument 4, prints: - - fact(4); - fact(3); - fact(2); - fact(1); - fact(0); - return 1; - return 1; - return 2; - return 6; - return 24; - - -Support for UTF-8 sources -------------------------- - -The MsvcLibX library supports writing C programs using 8-bit characters, -with strings encoded as UTF-8, and that will work for any cmd.exe code page. -This makes the sources much more simple and readable that using full-fledged -Unicode, with 16-bits wchar_t or WCHAR and L"strings" or _T("strings"). - -Note: The cmd.exe code page can be read and changed with the CHCP command. -The most common code pages are: - -CP | Description ------ | ---------------------------------------------------------------------------- -437 | MS-DOS OEM code page, still used by cmd.exe in US and west-European systems. -1252 | Windows "ANSI" code page, used by most GUI programs, like notepad.exe. -65001 | UTF-8 code page. Allows display any Unicode character. - -Important: Changing the code page will only work correctly if cmd.exe is using -a TrueType font. The default "Raster" font supports code page 437 only. - -To enable that UTF-8 support: - -1. Set the C or C++ source encoding to UTF-8 with BOM. (BOM = Byte-Order Mark) -Having a BOM is important, as without it some Windows editors will incorrectly -detect the encoding, and then sometimes corrupt the source. -2. Define one of the following constants in the .c source, _before_ including -any .h include files: - - #define _BSD_SOURCE 1 /* Defined by many standard BSD-Unix programs */ - #define _GNU_SOURCE 1 /* Defined by many standard GNU-Unix/Linux programs */ - #define _UTF8_SOURCE 1 /* MsvcLibX-specific */ - -Note that most modern Linux compilers do expect C sources encoded as UTF-8, -and will silently ignore the UTF-8 BOM if present. - -Internally, MsvcLibX extends Microsoft's convention of having two ANSI and Wide -versions of each routine, respectively with an 'A' and a 'W' suffix. Ex: -FindFirstFile() being an alias to either FindFirstFileA() or FindFirstFileW(). -MsvcLibX uses two additional suffixes: 'U' for the UTF-8 version, and 'M' for -the common MultiByte subroutine used by both the 'A' and 'U' versions. Ex: - -Function | Description ----------- | --------------------------------------------------------------- -readlinkW | Posix routine readlink - Wide char version -readlinkM | MultiByte char sub-routine, used by the next two routines. -readlinkA | Posix routine readlink - ANSI version -readlinkU | Posix routine readlink - UTF-8 version -readlink | Posix routine readlink - Alias to either readlinkA or readlinkU - -Note that the M version has one additional argument: The code page to use for -converting strings to and from Unicode. In that sense, it's not Posix-compliant. - -Gotcha: As of 2014-03-25, most file I/O and enumeration routines have been -restructured this way, but a few have not yet been: -scandir() and lstat() only support UTF-8 file names, not ANSI names. - -Gotcha: As of 2014-03-25, there's a potential issue with the C main() routine: -Supporting UTF-8 file names is not just supporting UTF-8 strings in library -functions. It's also necessary to process the command line, so that command line -arguments are passed in to the main() routine as UTF-8 strings. -Currently this is implemented as a macro that redefines the main token, so -that it generates a main() routine just calling a _mainU0() routine from -MsvcLibX.lib, followed by another local _mainU() routine with the body intended -for your main routine. Ex: - - int main(int argc, char *argv[]) { /* your main body */ } - -Becomes: - - int main(int argc, char *argv[]) {return _mainU0()} - int _mainU(int argc, char *argv[]) { /* your main body */ } - -The _mainU0() routine from MsvcLibX.lib reprocesses the Win32 command line as -UTF-8 argv[] arguments, then calls _mainU(argc, argv[]). -This works well and transparently, except in one case: -If one of your sources or include files contain a prototype for the main() -routine, then MsvcLibX' main macro will break that prototype, and cause -compilation and/or link errors. -If this happens, simply remove the main() prototype, which is useless anyway. - - -Support for NTFS symlinks and junctions ---------------------------------------- - -Posix defines only a single kind of symbolic links, usable for any kind of -targets, whether they're files, directories, or further symbolic links. -The standard C library defines functions for managing symbolic links: - -Function | Description ----------- | ---------------------------------------------------------------- -readlink() | Read a link target -symlink() | Create a link, or change its target -lstat() | Read the metadata (timestamp, access rights) for the link itself -lchmod() | Change the link access rights -lchown() | Change the link owner -realpath() | Generate an absolute path, with all links resolved - -Windows defines three types of links: - -Type | Description ---------- | --------------------------------------------------------------- -SYMLINK | Symbolic link to a file -SYMLINKD | Symbolic link to a directory -JUNCTION | Mount point, often used as a symbolic link to another directory - -All three types can be created in Vista and later by the mklink command. -JUNCTIONS can also be created in 2000 and later by Microsoft's SysInternal's -junction command. -One important difference is that JUNCTIONs can be created with normal user -rights, whereas SYMLINKs and SYMLINKDs require administrator rights in an -elevated command window. -A second important difference is that on networks, SYMLINKs and SYMLINKDs are -interpreted on the client side, whereas JUNCTIONs are interpreted on the server -side (despite having their target readable from the client side). - -The MsvcLibcX library tries to hide that complexity, and implements the standard -functions as if there were only one kind of link. -It also provides non-standard functions symlinkd() and junction() to -specifically create SYMLINKDs and JUNCTIONs respectively. - -Notes about readlink(): -For SYMLINKs and SYMLINKDs, the case is straightforward. -For JUNCTIONs, there are two problems: - -- The target is stored as an absolute path, even when the JUNCTION was created - with a relative path. readlink() tries to convert the absolute path to a - relative path, so that file copying utilities can clone trees with internal - JUNCTIONs. -- When the JUNCTION is on a network drive, the target refers to the absolute - path on the server. This may not be accessible from the client through the - existing mounted shares. Even when this is accessible, it's not always easy - to map the server path to a valid client path. - readlink() uses heuristics which always work for drives shared at the drive - level. Ex: a C: drive shared as C$, a D: drive shared as D$, etc. - The heuristic also very likely works for drives shared at the root or first - directory level. Ex: C:\ shared as CROOT, or C:\Public shared as PUBLIC. - As of 2014-03-25, it'll fail in any other case. Ex: - C:\Users\YOURNAME shared as YOURHOME, - or a C:\Public share mounted through its subdirectory C:\Public\Temp - -Notes about symlink(): -symlink() will attempt to create a SYMLINK or a SYMLINKD, depending on the type -of the target. This works well when the target exists. But when it does not -(which is legal), it will create a SYMLINK by default, or a SYMLINKD if the -target ends with a '/' or a '\'. Posix allows, but does not require, providing -a trailing '/', so the link type may possibly be incorrect. -junction() will have the same issues as readlink() above. - -Notes about junction(): -The problem for junction() is to convert a client-side target pathname provided -by the program running on the client, to a server-side pathname, necessary for -junctions to work. -For full-drive shares (i.e. any share named like D$), this is easy. -For non-full-drive shares (i.e. anything else), it will assume this is a -first level shared directory on the C: drive. Ex: A link on share PUBLIC -will be targeted at C:\PUBLIC. -Problem: The junction will not work if the share actually resides anywhere else -on the server. But, surprisingly, there's an easy workaround: -Simply create manually on the server itself, a junction called C:\PUBLIC, -pointing at the actual directory shared as PUBLIC. -This way the junctions created from the client side will work correctly, both -on the client and on the server side, after being resolved on the server side -through that second junction. - - -Support for Windows 95/98 -------------------------- - -The configure.bat script searches for old versions of the Visual C++ compiler, -which can build WIN32 programs that can run in Windows 95/98/ME/NT4. -The most recent of these is Visual C++ 8, from Visual Studio 2005. -The make.bat script can then use rules in win95.mak to builds WIN32 programs -that will run in any version of Windows from Windown 95 to Windows 10. - -Note however that Windows 95/98/ME only have a very limited support for Unicode -built in. The rest of this section mentions 95, but applies to 98 & ME as well. -The MsvcLibX library uses a number of Unicode functions not available in default -installations of Windows 95. This includes all file management functions. -Thus most of our WIN95 executables will not work by default in Windows 95. -To allow them to work, it is necessary to download from Microsoft a "Microsoft -Layer for Unicode on Windows 95/98/ME Systems" (MSLU for short), and install it -on the Windows 95 system. See the following links for details: -https://en.wikipedia.org/wiki/Microsoft_Layer_for_Unicode -https://msdn.microsoft.com/en-us/goglobal/bb688166.aspx -MSLU installation procedure: - -- Download the MSLU redistributable setup (unicows.exe) from: - http://go.microsoft.com/fwlink/?LinkId=14851 -- Extract unicows.dll from the unicows.exe archive. -- Copy that unicows.dll to the Windows 95 system, into %windir%\System. - -Testing WIN95 executables in a Windows 95 VM -VMWare Player does not have Windows 95 drivers for the HGFS file system. -This prevents accessing the host's files directly as network files, as is -usually done for Windows XP and later versions of Windows. -It is not possible to use network shares either, as Windows 95 only supports -the SMB 1 protocol, which is actively blocked by Windows Vista and later hosts. -It is possible, but inconvenient, to transit through a web server, and download -the files in the Windows 95 VM using Internet Explorer 4. -The best solution probably is to transit through a floppy or CD image, and -mount that image in the VM Player. Many tools, including our own HpMkIso.exe -can create CD images. A very convenient shareware called WinImage allows to -create floppy images. -Another solution is to install a Web server on the host PC, and use Internet -Explorer 4 in Windows 95 to download the executable files into the VM. - - -Support for DOS, and bound DOS+Windows programs ------------------------------------------------ - -- If Visual C++ 1.52 is installed, configure.bat will setup the make system -for building the MS-DOS version of your programs. (Output in the DOS directory) -- If Visual C++ 8 is installed, configure.bat will setup the make system -for building 32-bits versions of your programs compatible with Windows 95 -and all later versions, including 64-bits ones. (Output in the WIN95 directory) - -Both are available as part of the Visual Studio 2005 CD, still available for -download for MSDN subscribers from the MSDN web site. - -Win32 programs have an "MS-DOS stub", that runs when the Windows program is -executed under MS-DOS. -The default stub used by the Win32 linker if a tiny DOS program that displays -an error message such as: "This program can only run in Windows" - -When it builds the WIN95 or WIN32 version of a program, and when it has built -the DOS version already, the MsvcLibX make system uses that DOS version as the -stub for the Windows version. -This allows building executables that work in *all* versions of DOS and Windows! - -- When run in MS-DOS, it's the DOS stub of the exe that runs. -- When run in Windows (even 64-bits versions), it's the Win32 part that runs. - -Note that the make system will build such bound executables for any WIN32 -build made with more recent compilers. But these recent compilers generate -executables that cannot run in old versions of Windows. For example, the -Visual C++ 14 compiler can only target Windows Vista and later systems. -Having an executable that can run in DOS and Windows 7, but not in Windows XP, -is not very useful. Make sure to install the Visual C++ 8 compiler in parallel -with Visual C++ 1.52, and the latest compiler (Visual C++ 14 at the time of -this writing), to generate truly universal WIN95 builds, that run in -DOS/95/98/ME/2000/XP/Vista/7/8/10. - - -History -------- - -**1986** - -I (Jean-François Larvoire) started writing command-line tools for MS-DOS. -Some were enumerating files, using inline assembly language to make MS-DOS -interrupt 21h system calls: update, dirsize, redo, backnum, which, dirc... -To make it simple I factored these out in subroutines srch1st and srchnext, -that I manually copied from one program to the next. -Things got a bit tricky to support recursion, which was not straightforward -in MS-DOS. - - -**1992** - -We got an OS/2 server, and I started porting the above programs to OS/2. -MS-DOS was still important, so I used conditional compilation to support -both operating systems with the same source. -I wrote a second version of srch1st and srchnext for OS/2, and had to -include a new routine srchdone due to OS/2 API constraints. -dirc was the first program I ported, then I slowly duplicated the code into -the other programs. Synchronizing bug fixes became more difficult. -A nice trick was the OS/2 supported dual-mode EXEs, with both the DOS and -OS/2 version bound in the same .exe file. - - -**1995** - -We ditched the OS/2 server, and got a new one running Windows NT. -Again, I created a third conditionally compiled version of srch1st/srchnext/ -srchdone for WIN32, for use in dirc. -Manually back porting the updates and bug fixes to all programs became -really painful, and took several years. -Like OS/2, Windows supported dual-mode EXEs, and I updated my make files -to include both the DOS and Windows version in the same file. - - -**2005** - -I started working on Linux projects. Despite the bonanza of command-line -tools available, I couldn't find one equivalent to dirc. -So, yet another time, I created a fourth conditionally compiled version of -srch1st/srchnext/srchdone for Linux, and obtained a Linux version of dirc. -I also ported it and a couple of other programs to Tru64, which was the -first 64-bits OS I worked with. This exposed a few unsuspected bugs. -The thing became so complex than porting the changes and updates to the -other programs was a nightmare. I did it for a few of them, but never -got the time to port them all. - - -**2010** - -Building WIN64 versions was relatively easier due to the Tru64 precedent, -but added yet another set of conditional compilations. -The porting nightmare worsened. - - -**2012** - -I tried porting some unrelated Linux programs to Windows, and hit a wall: -Many include files and standard C library routines were missing in MSVC. -I then tried using MinGW, but it too was missing many required features! -I considered contributing updates to MinGW, but that project was too -complex and ill-documented at that time, and I eventually gave up. -Instead, I started writing my own "libc-ext" library of include files and -routines to supplement MSVC. -Ex: stdint.h, inttypes.h, fnmatch.h/fnmatch.c, ... -Also it became obvious that multiplying conditional compilations and -duplicating directory access code everywhere was wrong. Instead I had to -write standard dirent.h/dirent.c routines for DOS/OS2/Windows, and -rewrite all my programs around these standard routines. -I did it for DOS and Windows versions, and left stubs of the OS/2 versions, -for the unlikely case where somebody wants to revive them. - -**2013** - -The restructuration was over for dirc, dirsize, which, backnum, update. -The library got its final name, "MsvcLibX", to better match it purpose: -An extension of the Microsoft Visual C library, not of the standard libc. -As the library grew, debugging it became more difficult, and I decided to -use my debugm.h within the library: This file contains a set of debugging -macros I had developed for other programs. -I started thinking about sorely needed improvements: - -- There was no support for Windows symlinks and junctions. -- The Windows versions of the programs output ANSI file names into a - cmd.exe window using the OEM character set. This caused all files with - French names to be shown as garbage. -- Worse still, I had a few files and directories with non-ANSI names - (In Russian and Chinese), that caused the programs to fail! - -The Linux version of the program did not have these issues, as all recent -versions of Linux use the UTF-8 encoding, and this works transparently -even for old programs using 8-bits characters like mine. - - -**2014** - -I got a bit more time, and started working on a redesign of MsvcLibX's -dirent.c/dirent.h, and added lstat.c, symlink.c, readlink.c, etc, to -support symlinks, junctions, and UTF-8 file names. -This proved to be much more work than I initially thought, but the result -was worth the effort: dirc, update got easily adapted, with remarkably -few changes to their source. Adding recursion to update was easy. -I'm now able to use update to backup all files on my system, including -symbolic links, and junctions used as poor man's links. And the programs -now display names correctly in any code page with the right font. -A seventh program, truename, joined the collection using dirent.h routines. -Later in the year, I made significant other changes: - -- Split make.bat into a generic make.bat/configure.bat pair of scripts. - configure.bat needs to be run once, plus everytime the environment - changes. (Such as if a new MSVC version is installed.) - Project-specific definitions are moved to new files, such as our - configure.MsvcLibX.bat. -- Added a general mechanism for defining extensions to existing MSVC - include files. This allowed defining our own homonym include files, - containing just the missing definitions. Which in turn allowed to move - many such definitions, that were initially stored in unistd.h for lack - of an alternative, to their standard location. -- Updated all file functions to support WIN32 pathnames > 260 characters. - (The basic WIN32 functions that I used until then had that limitation; - I'm now using extended functions supporting path lengths up to 64K.) - -All tools like dirc, dirsize, which, backnum, update, truename, redo -benefit from that last change. - -**2015** - -A major improvement was the addition of support for new operating systems -and processor targets. This required redesigning several things: -The OS-specific definition macros have been renamed to more generic names. -The DosWin.mak file has been replaced by a more generic All.mak, -supporting the old dos.mak, win32.mak, and win64.mak, plus the new... - -- bios.mak Allows building 16-bits programs that can run in BIOS option - ROMs. These programs are based on the BiosLib library, - documented separately. -- win95.mak Allows building win32 programs that run in Windows 95. -- ia64.mak Allows building 64-bits programs that run in IA64 versions - of Windows. Not tested. -- arm.mak Allows building win32 programs for Windows RT. - Tests failed so far, due to a missing "ARM Desktop SDK". - -All.mak also skips building versions for which no tools are available; -This prevents problems in the normal case when people only have the latest -version of MSVC. In this case, it just builds the WIN32 and WIN64 versions. -The support for Windows 95 required fixing numerous issues with old -Microsoft tools and Windows SDKs. -Conversely, the support for Visual Studio 15 also required fixing lots of -issues, as the MSVC library has been completely redesigned, and split into -two parts: - -- A compiler-specific part, part of the compiler tree as before. -- A generic part, called Universal C runtime (UCRT) that's now part of - the windows SDK. - -And of course there were also issues with MsvcLibX recent improvements, -like Unicode support and symlink support, which had never been tested, -and of course did not work, in Windows 95 and XP. - - -**2016** - -Many significant changes and improvements this year: - -- Changed the UTF-8 C source support to require a UTF-8 BOM. - This is to prevent problems with Windows tools that tend to corrupt files - without a UTF-8 BOM, but with other UTF-8 characters. - This required changing all C/C++ compilation rules to first remove the - UTF-8 BOM, as MS compilers do not react correctly when they find one. -- Added a windows.h extension. - Just like Standard C library APIs, windows 8-bit APIs can be overriden to - refer to custom routines that support UTF-8 strings. - The MsvcLibX library was beginning to use a significant number of these - custom routines internally. They're now accessible directly to outside - UTF-8 programs targeting only Windows. -- Finished implementing support for the OUTDIR variable. (Started in 2015.) - All make files now optionally create output files in an %OUTDIR% directory. - This is intended for testing builds in VMs, with shared sources on the - host, but the output locally in the VM, avoiding to overwrite the main - version on the host. IF %OUTDIR% is not defined, the default output - still goes below the source directory as before. diff --git a/deps/MsvcLibX/config.DESKTOP-U79TD6T.bat b/deps/MsvcLibX/config.DESKTOP-U79TD6T.bat deleted file mode 100644 index b1b68e1540ff11bfd8fd1eee985bb28d0f439044..0000000000000000000000000000000000000000 --- a/deps/MsvcLibX/config.DESKTOP-U79TD6T.bat +++ /dev/null @@ -1,146 +0,0 @@ -:# config.DESKTOP-U79TD6T.bat generated by configure.bat on 2020/05/19 ܶ 7:49:05.47 -:# -:# If changes are needeed, do not edit this file, but instead create a new script -:# called configure.YOURCHOICE.bat. This new script will be invoked automatically -:# by configure.bat while creating this file. Then your script can write extra -:# definitions, or change some of the variables before configure.bat writes them. -:# -:# Invoke configure.bat manually if anything changes in the tools config, such as -:# installing a Visual Studio update, or updating a configure.XXX.bat script. - -set "HAS_STINCLUDE=1" &:# Found the System Tools global C includes -set "STINCLUDE=C:\Users\admin\Desktop\temp\MyGitHub\C\include" &:# System Tools global C includes -set "HAS_SDK_FLAGS=/DHAS_STINCLUDE=1" &:# SDK detection flags for the C compiler - -SET "PF32=C:\Program Files (x86)" &:# 32-bits Program Files -SET "PF64=C:\Program Files" &:# 64-bits Program Files -SET "ARCH=AMD64" &:# PROCESSOR_ARCHITECTURE - -SET "MASM=" &:# Microsoft 16-bits Assembler base path -SET "MSVC=" &:# Microsoft 16-bits Visual C++ base path -SET "MAPSYM=" &:# 16-bits debugging symbols generator - -SET "VSTUDIOLONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0" &:# Microsoft Visual Studio (Long path) -SET "VSTUDIO=C:\PROGRA~2\MICROS~2.0" &:# Microsoft Visual Studio (Short path) -SET "VSCOMMONLONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7" &:# Microsoft Visual Studio Common Files (Long path) -SET "VSCOMMON=C:\PROGRA~2\MICROS~2.0\Common7" &:# Microsoft Visual Studio Common Files (Short path) -SET "VSIDELONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE" &:# Microsoft Visual Studio IDE Files (Long path) -SET "VSIDE=C:\PROGRA~2\MICROS~2.0\Common7\IDE" &:# Microsoft Visual Studio IDE Files (Short path) -SET "VSTOOLSLONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools" &:# Microsoft Visual Studio Tools (Long paths) -SET "VSTOOLS=C:\PROGRA~2\MICROS~2.0\Common7\Tools" &:# Microsoft Visual Studio Tools (Short paths) -SET "MSVC32LONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC" &:# Microsoft Visual C++ 32/64 bits (Long path) -SET "MSVC32=C:\PROGRA~2\MICROS~2.0\VC" &:# Microsoft Visual C++ 32/64 bits (Short path) - -SET "WIN_CP=936" &:# Windows Code Page -SET "WIN_CS=gb2312" &:# Windows Character Set -SET "DOS_CP=936" &:# DOS Code Page -SET "DOS_CS=gb2312" &:# DOS Character Set - -SET "AS=" &:# Assembler -SET "CC=" &:# C compiler -SET "INCLUDE=C:\Users\admin\Desktop\temp\MyGitHub\C\include" &:# Include paths. Define USER_INCLUDE if needed. -SET "LK=" &:# Linker -SET "LIB=" &:# Libraries paths. Define USER_LIBS if needed. -SET "LB=" &:# Library manager -SET "RC=" &:# Resource compiler -SET "MT=" &:# Manifest tool - -SET "DOS_CC=" &:# Microsoft Visual C++ 16-bits compiler -SET "DOS_AS=" &:# Microsoft 16-bits assembler -SET "DOS_LK=" &:# Microsoft 16-bits linker -SET "DOS_LB=" &:# Microsoft 16-bits librarian -SET "DOS_RC=" &:# Microsoft 16-bits resource compiler -SET "DOS_MT=" &:# Microsoft 16-bits manifest tool -SET "DOS_PATH=;C:\Windows\System32;C:\Windows" &:# All tools paths for 16-bits compilation -SET "DOS_VCINC=" &:# Visual C++ 16-bits compiler include dir for MsvcLibX include_next -SET "DOS_CRTINC=" &:# Visual C++ 16-bits CRT library include dir for MsvcLibX include_next -SET "DOS_INCPATH=" &:# Include paths for 16-bits compilation -SET "DOS_LIBPATH=" &:# Libraries paths for 16-bits linking -SET "DOS_WINSDK=" &:# Microsoft Windows 16-bits SDK -SET "DOS_WINSDKINC=" &:# Microsoft Windows 16-bits SDK Include directory - -SET "WIN95_CC=" &:# Microsoft Visual C++ 32-bits compiler -SET "WIN95_AS=" &:# Microsoft 32-bits assembler -SET "WIN95_LK=" &:# Microsoft 32-bits linker -SET "WIN95_LB=" &:# Microsoft 32-bits librarian -SET "WIN95_RC=" &:# Microsoft 32-bits resource compiler -SET "WIN95_MT=" &:# Microsoft 32-bits manifest tool -SET "WIN95_PATH=;C:\Windows\System32;C:\Windows" &:# All tools paths for 32-bits compilation -SET "WIN95_VCINC=" &:# Visual C++ 32-bits compiler include dir for MsvcLibX include_next -SET "WIN95_CRTINC=" &:# Visual C++ 32-bits CRT library include dir for MsvcLibX include_next -SET "WIN95_INCPATH=" &:# Include paths for 32-bits compilation -SET "WIN95_LIBPATH=" &:# Libraries paths for 32-bits linking -SET "WIN95_WINSDK=" &:# Microsoft Windows 32-bits SDK -SET "WIN95_WINSDKINC=" &:# Microsoft Windows 32-bits SDK Include directory - -SET "WIN32_CC="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.EXE"" &:# Microsoft Visual C++ 32-bits compiler -SET "WIN32_AS="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\ML.EXE"" &:# Microsoft 32-bits assembler -SET "WIN32_LK="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\LINK.EXE"" &:# Microsoft 32-bits linker -SET "WIN32_LB="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\LIB.EXE"" &:# Microsoft 32-bits librarian -SET "WIN32_RC=" &:# Microsoft 32-bits resource compiler -SET "WIN32_MT=" &:# Microsoft 32-bits manifest tool -SET "WIN32_PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Windows\System32;C:\Windows" &:# All tools paths for 32-bits compilation -SET "WIN32_VCINC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" &:# Visual C++ 32-bits compiler include dir for MsvcLibX include_next -SET "WIN32_CRTINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt" &:# Visual C++ 32-bits CRT library include dir for MsvcLibX include_next -SET "WIN32_INCPATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\winrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\winrt" &:# Include paths for 32-bits compilation -SET "WIN32_LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86" &:# Libraries paths for 32-bits linking -SET "WIN32_WINSDK=C:\Program Files (x86)\Windows Kits\10" &:# Microsoft Windows 32-bits SDK -SET "WIN32_WINSDKINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0" &:# Microsoft Windows 32-bits SDK Include directory - -SET "IA64_CC=" &:# Microsoft Visual C++ IA64 compiler -SET "IA64_AS=" &:# Microsoft IA64 assembler -SET "IA64_LK=" &:# Microsoft IA64 linker -SET "IA64_LB=" &:# Microsoft IA64 librarian -SET "IA64_RC=" &:# Microsoft IA64 resource compiler -SET "IA64_MT=" &:# Microsoft IA64 manifest tool -SET "IA64_PATH=;C:\Windows\System32;C:\Windows" &:# All tools paths for IA64 compilation -SET "IA64_VCINC=" &:# Visual C++ IA64 compiler include dir for MsvcLibX include_next -SET "IA64_CRTINC=" &:# Visual C++ IA64 CRT library include dir for MsvcLibX include_next -SET "IA64_INCPATH=" &:# Include paths for IA64 compilation -SET "IA64_LIBPATH=" &:# Libraries paths for IA64 linking -SET "IA64_WINSDK=" &:# Microsoft Windows IA64 SDK -SET "IA64_WINSDKINC=" &:# Microsoft Windows IA64 SDK Include directory - -SET "WIN64_CC="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\CL.EXE"" &:# Microsoft Visual C++ 64-bits compiler -SET "WIN64_AS="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\ML64.EXE"" &:# Microsoft 64-bits assembler -SET "WIN64_LK="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\LINK.EXE"" &:# Microsoft 64-bits linker -SET "WIN64_LB="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\LIB.EXE"" &:# Microsoft 64-bits librarian -SET "WIN64_RC=" &:# Microsoft 64-bits resource compiler -SET "WIN64_MT=" &:# Microsoft 64-bits manifest tool -SET "WIN64_PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Windows\System32;C:\Windows" &:# All tools paths for 64-bits compilation -SET "WIN64_VCINC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" &:# Visual C++ 64-bits compiler include dir for MsvcLibX include_next -SET "WIN64_CRTINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt" &:# Visual C++ 64-bits CRT library include dir for MsvcLibX include_next -SET "WIN64_INCPATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\winrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\winrt" &:# Include paths for 64-bits compilation -SET "WIN64_LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\amd64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64" &:# Libraries paths for 64-bits linking -SET "WIN64_WINSDK=C:\Program Files (x86)\Windows Kits\10" &:# Microsoft Windows 64-bits SDK -SET "WIN64_WINSDKINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0" &:# Microsoft Windows 64-bits SDK Include directory - -SET "ARM_CC="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm\CL.EXE"" &:# Microsoft Visual C++ ARM compiler -SET "ARM_AS="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm\ARMASM.EXE"" &:# Microsoft ARM assembler -SET "ARM_LK="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm\LINK.EXE"" &:# Microsoft ARM linker -SET "ARM_LB="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm\LIB.EXE"" &:# Microsoft ARM librarian -SET "ARM_RC=" &:# Microsoft ARM resource compiler -SET "ARM_MT=" &:# Microsoft ARM manifest tool -SET "ARM_PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Windows\System32;C:\Windows" &:# All tools paths for ARM compilation -SET "ARM_VCINC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" &:# Visual C++ ARM compiler include dir for MsvcLibX include_next -SET "ARM_CRTINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt" &:# Visual C++ ARM CRT library include dir for MsvcLibX include_next -SET "ARM_INCPATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\winrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\winrt" &:# Include paths for ARM compilation -SET "ARM_LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm" &:# Libraries paths for ARM linking -SET "ARM_WINSDK=C:\Program Files (x86)\Windows Kits\10" &:# Microsoft Windows ARM SDK -SET "ARM_WINSDKINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0" &:# Microsoft Windows ARM SDK Include directory - -SET "ARM64_CC=" &:# Microsoft Visual C++ ARM64 compiler -SET "ARM64_AS=" &:# Microsoft ARM64 assembler -SET "ARM64_LK=" &:# Microsoft ARM64 linker -SET "ARM64_LB=" &:# Microsoft ARM64 librarian -SET "ARM64_RC=" &:# Microsoft ARM64 resource compiler -SET "ARM64_MT=" &:# Microsoft ARM64 manifest tool -SET "ARM64_PATH=;C:\Windows\System32;C:\Windows" &:# All tools paths for ARM64 compilation -SET "ARM64_VCINC=" &:# Visual C++ ARM64 compiler include dir for MsvcLibX include_next -SET "ARM64_CRTINC=" &:# Visual C++ ARM64 CRT library include dir for MsvcLibX include_next -SET "ARM64_INCPATH=" &:# Include paths for ARM64 compilation -SET "ARM64_LIBPATH=" &:# Libraries paths for ARM64 linking -SET "ARM64_WINSDK=" &:# Microsoft Windows ARM64 SDK -SET "ARM64_WINSDKINC=" &:# Microsoft Windows ARM64 SDK Include directory - -exit /b 0 &:# Configuration done successfully diff --git a/deps/MsvcLibX/configure.bat b/deps/MsvcLibX/configure.bat deleted file mode 100644 index 7037eb92afccbfe2e0d6872a108799d56538c490..0000000000000000000000000000000000000000 --- a/deps/MsvcLibX/configure.bat +++ /dev/null @@ -1,35 +0,0 @@ -@echo off -:#***************************************************************************** -:# * -:# Filename: configure.bat * -:# * -:# Description: Detect system-specific settings and create config.*.bat * -:# * -:# Notes: Proxy script for %STINCLUDE%\configure.bat. * -:# * -:# Make any change needed in %STINCLUDE%\configure.bat. * -:# * -:# History: * -:# 2016-10-10 JFL jf.larvoire@hpe.com created this file. * -:# 2016-12-15 JFL Search for the real make.bat in [.|..|../..]\include. * -:# * -:# Copyright 2016 Hewlett Packard Enterprise Development LP * -:# Licensed under the Apache 2.0 license www.apache.org/licenses/LICENSE-2.0 * -:#***************************************************************************** - -:# Get the full pathname of the STINCLUDE library directory -if defined STINCLUDE if not exist "%STINCLUDE%\make.bat" set "STINCLUDE=" &:# Allow overriding with another alias name, but ignore invalid overrides -for %%p in (. .. ..\..) do if not defined STINCLUDE if exist %%p\include\make.bat ( :# Default: Search it the current directory, and 2 levels above. - for /f "delims=" %%d in ('"pushd %%p\include & cd & popd"') do SET "STINCLUDE=%%d" -) -if not defined STINCLUDE ( :# Try getting the copy in the master environment - for /f "tokens=3" %%v in ('reg query "HKCU\Environment" /v STINCLUDE 2^>NUL') do set "STINCLUDE=%%v" -) - -if not exist %STINCLUDE%\make.bat ( - >&2 echo %0 Error: Cannot find SysToolsLib's global C include directory. Please define variable STINCLUDE. - exit /b 1 -) - -if [%1]==[-d] echo "%STINCLUDE%\configure.bat" %* -"%STINCLUDE%\configure.bat" %* diff --git a/deps/MsvcLibX/include/debugm.h b/deps/MsvcLibX/include/msvcDebugm.h similarity index 96% rename from deps/MsvcLibX/include/debugm.h rename to deps/MsvcLibX/include/msvcDebugm.h index b20a7035c696864324e9a496cfaf5e777f5d0cd1..5b3c38f45be3168b6d3b52a9600fd98e0e524c15 100644 --- a/deps/MsvcLibX/include/debugm.h +++ b/deps/MsvcLibX/include/msvcDebugm.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: debugm.h * * * @@ -44,7 +44,7 @@ * 2016-10-04 JFL Added macros DEBUG_OFF(), DEBUG_MORE(), DEBUG_LESS(). * * Allow using DEBUG_ON()/MORE()/LESS()/OFF() in release mode. * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/direct.h b/deps/MsvcLibX/include/msvcDirect.h similarity index 79% rename from deps/MsvcLibX/include/direct.h rename to deps/MsvcLibX/include/msvcDirect.h index 7cedc1cf7dbc5db620efb1d8e41d2ab8afca3ab7..31017ce50cfc36457176d148f9188bc3c15cb067 100644 --- a/deps/MsvcLibX/include/direct.h +++ b/deps/MsvcLibX/include/msvcDirect.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: direct.h * * * @@ -10,7 +10,7 @@ * 2014-03-24 JFL Created this file, with content moved from unistd.h. * * 2015-11-15 JFL Visual Studio 2015 moved this file to the Windows Kit UCRT. * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -19,7 +19,7 @@ #include "msvclibx.h" -#include UCRT_INCLUDE_FILE(direct.h) /* Include MSVC's own file */ +#include /* Include MSVC's own file */ #undef mkdir /* This MSVC macro is incompatible with mkdir() function in unistd.h */ diff --git a/deps/MsvcLibX/include/dirent.h b/deps/MsvcLibX/include/msvcDirent.h similarity index 96% rename from deps/MsvcLibX/include/dirent.h rename to deps/MsvcLibX/include/msvcDirent.h index ac702e01dd62d897405bb94e455bd950e832c640..db146a599811d52c0f94ddf937dc74c961598d74 100644 --- a/deps/MsvcLibX/include/dirent.h +++ b/deps/MsvcLibX/include/msvcDirent.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: dirent.h * * * @@ -24,7 +24,7 @@ * 2015-12-07 JFL Added the conditional definition of symlink constants, so * * that our code builds even in XP and older Windows SDKs. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/error.h b/deps/MsvcLibX/include/msvcError.h similarity index 83% rename from deps/MsvcLibX/include/error.h rename to deps/MsvcLibX/include/msvcError.h index e8edad7c678524ada087e0c69eb35c647416ad10..9a0a790a9af3caeb761abc6aa06cc152b6fb889a 100644 --- a/deps/MsvcLibX/include/error.h +++ b/deps/MsvcLibX/include/msvcError.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: error.h * * * @@ -11,7 +11,7 @@ * History: * * 2012-10-21 JFL Created this file. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/fadvise.h b/deps/MsvcLibX/include/msvcFadvise.h similarity index 85% rename from deps/MsvcLibX/include/fadvise.h rename to deps/MsvcLibX/include/msvcFadvise.h index 37d4c310f053cf61e25343db6f65dfdad048343b..89600ebd058cd59b52278ef1bdcfdc191a08eaff 100644 --- a/deps/MsvcLibX/include/fadvise.h +++ b/deps/MsvcLibX/include/msvcFadvise.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: fadvise.h * * * @@ -10,7 +10,7 @@ * History: * * 2012-10-17 JFL Created this file. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/fcntl.h b/deps/MsvcLibX/include/msvcFcntl.h similarity index 82% rename from deps/MsvcLibX/include/fcntl.h rename to deps/MsvcLibX/include/msvcFcntl.h index 735287c0d4b9973de79c649541371f98dd42cddb..fc981b5fc9304e1d5f8f8656aadd3f8b36e9bef5 100644 --- a/deps/MsvcLibX/include/fcntl.h +++ b/deps/MsvcLibX/include/msvcFcntl.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: fcntl.h * * * @@ -9,7 +9,7 @@ * History: * * 2017-02-16 JFL Created this file. * * * -* Copyright 2017 Hewlett Packard Enterprise Development LP * +* Copyright 2017 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -18,7 +18,7 @@ #include "msvclibx.h" -#include UCRT_INCLUDE_FILE(fcntl.h) /* Include MSVC's own file */ +#include /* Include MSVC's own file */ /* Microsoft defines _open() in io.h */ #include diff --git a/deps/MsvcLibX/include/fnmatch.h b/deps/MsvcLibX/include/msvcFnmatch.h similarity index 89% rename from deps/MsvcLibX/include/fnmatch.h rename to deps/MsvcLibX/include/msvcFnmatch.h index b41a2b5305112835996fc0e0aba66b37f1147554..4b7d15b2e8c9e12abab7a3d5b21726ffb99c694e 100644 --- a/deps/MsvcLibX/include/fnmatch.h +++ b/deps/MsvcLibX/include/msvcFnmatch.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: fnmatch.h * * * @@ -10,7 +10,7 @@ * History: * * 2012-01-17 JFL Created this file. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/getopt.h b/deps/MsvcLibX/include/msvcGetopt.h similarity index 96% rename from deps/MsvcLibX/include/getopt.h rename to deps/MsvcLibX/include/msvcGetopt.h index ad4b2f2baac299c5f0b252d4eb0f1dde26929a58..fa0d75b3ff6a95ab7054fefb691c97f44ba6b429 100644 --- a/deps/MsvcLibX/include/getopt.h +++ b/deps/MsvcLibX/include/msvcGetopt.h @@ -1,4 +1,4 @@ -/*- +/*- * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. * diff --git a/deps/MsvcLibX/include/iconv.h b/deps/MsvcLibX/include/msvcIconv.h similarity index 87% rename from deps/MsvcLibX/include/iconv.h rename to deps/MsvcLibX/include/msvcIconv.h index 396296fb53be88713f390309cb10d5d3b58dd1c9..8ad5e2f67f47941ed5f08d4d7549c8a74118912a 100644 --- a/deps/MsvcLibX/include/iconv.h +++ b/deps/MsvcLibX/include/msvcIconv.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename iconv.h * * * @@ -10,7 +10,7 @@ * History: * * 2014-02-27 JFL Created this file. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/inttypes.h b/deps/MsvcLibX/include/msvcInttypes.h similarity index 94% rename from deps/MsvcLibX/include/inttypes.h rename to deps/MsvcLibX/include/msvcInttypes.h index 51740fade3119b1a5ff1bba5d2f2050130e2fe1f..addc380ed0e0e65ab9209454589639da2dce49de 100644 --- a/deps/MsvcLibX/include/inttypes.h +++ b/deps/MsvcLibX/include/msvcInttypes.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename inttypes.h * * * @@ -10,7 +10,7 @@ * 2014-02-07 JFL Added definitions for PRIdMAX and PRIiMAX. * * 2016-01-07 JFL Restructured and improved support for MS-DOS. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/libgen.h b/deps/MsvcLibX/include/msvcLibgen.h similarity index 83% rename from deps/MsvcLibX/include/libgen.h rename to deps/MsvcLibX/include/msvcLibgen.h index f7ce9feff4144884d203cd5bd4d23eedcc589cc2..c3051a2fb2c828fe3215e1ef0b42812cf5fc5625 100644 --- a/deps/MsvcLibX/include/libgen.h +++ b/deps/MsvcLibX/include/msvcLibgen.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: libgen.h * * * @@ -9,7 +9,7 @@ * History: * * 2016-09-08 JFL Created this file. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/limits.h b/deps/MsvcLibX/include/msvcLimits.h similarity index 87% rename from deps/MsvcLibX/include/limits.h rename to deps/MsvcLibX/include/msvcLimits.h index d4a9e09d5e76241ea985ad88a5e0fa7434e234f9..496fe9f24c6250cf29cce0c0878c853a5ca48a19 100644 --- a/deps/MsvcLibX/include/limits.h +++ b/deps/MsvcLibX/include/msvcLimits.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: limits.h * * * @@ -9,7 +9,7 @@ * History: * * 2014-06-30 JFL Created this file. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -18,7 +18,7 @@ #include "msvclibx.h" -#include MSVC_INCLUDE_FILE(limits.h) /* Include MSVC's own file */ +#include /* Include MSVC's own file */ /************************ MS-DOS-specific definitions ************************/ diff --git a/deps/MsvcLibX/include/netdb.h b/deps/MsvcLibX/include/msvcNetdb.h similarity index 86% rename from deps/MsvcLibX/include/netdb.h rename to deps/MsvcLibX/include/msvcNetdb.h index 417150afc8c3df16594bff21f8de9fd45d86b9e2..cc874580e1eb894349db36502a3c547bb71e9945 100644 --- a/deps/MsvcLibX/include/netdb.h +++ b/deps/MsvcLibX/include/msvcNetdb.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: netdb.h * * * @@ -9,7 +9,7 @@ * History: * * 2012-01-24 JFL Created this file. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/process.h b/deps/MsvcLibX/include/msvcProcess.h similarity index 82% rename from deps/MsvcLibX/include/process.h rename to deps/MsvcLibX/include/msvcProcess.h index 105b71669b1d885dd1c5e9c6a45d267ec60eb33c..66cf94de144045c0b0124d44ea13ae297d71c43c 100644 --- a/deps/MsvcLibX/include/process.h +++ b/deps/MsvcLibX/include/msvcProcess.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: process.h * * * @@ -10,7 +10,7 @@ * 2014-03-27 JFL Created this file. * * 2015-11-15 JFL Visual Studio 2015 moved this file to the Windows Kit UCRT. * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -19,7 +19,7 @@ #include "msvclibx.h" -#include UCRT_INCLUDE_FILE(process.h) /* Include MSVC's own file */ +#include /* Include MSVC's own file */ #if defined(_WIN32) extern intptr_t _spawnvpU(int iMode, const char *pszCommand, char *const *argv); diff --git a/deps/MsvcLibX/include/regex.h b/deps/MsvcLibX/include/msvcRegex.h similarity index 95% rename from deps/MsvcLibX/include/regex.h rename to deps/MsvcLibX/include/msvcRegex.h index 82158c7b2e0d22039928279e4dfa6e6c0a420f70..66dd78fbc350f38564497d27aa964bbaab181155 100644 --- a/deps/MsvcLibX/include/regex.h +++ b/deps/MsvcLibX/include/msvcRegex.h @@ -1,4 +1,4 @@ -#ifndef _HSREGEX_H_ +#ifndef _HSREGEX_H_ #define _HSREGEX_H_ #ifndef _HSREGEX_H #define _HSREGEX_H /* never again */ diff --git a/deps/MsvcLibX/include/reparsept.h b/deps/MsvcLibX/include/msvcReparsept.h similarity index 94% rename from deps/MsvcLibX/include/reparsept.h rename to deps/MsvcLibX/include/msvcReparsept.h index 1f2f7bea0c97db5f1c805d21d716ab348ada6c00..04ba02f9a2010e4e3ebe5db820bd26f91d050bad 100644 --- a/deps/MsvcLibX/include/reparsept.h +++ b/deps/MsvcLibX/include/msvcReparsept.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: reparsept.h * * * @@ -9,7 +9,7 @@ * History: * * 2014-02-28 JFL Created this file. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/stdbool.h b/deps/MsvcLibX/include/msvcStdbool.h similarity index 83% rename from deps/MsvcLibX/include/stdbool.h rename to deps/MsvcLibX/include/msvcStdbool.h index 4697fd52556c739768095a15d5df1b39663b0ded..85b42c6585de680810816c6cbe5375ac2e8d09e3 100644 --- a/deps/MsvcLibX/include/stdbool.h +++ b/deps/MsvcLibX/include/msvcStdbool.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: stdbool.h * * * @@ -9,7 +9,7 @@ * History: * * 2012-10-17 JFL Created this file. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/stdint.h b/deps/MsvcLibX/include/msvcStdint.h similarity index 96% rename from deps/MsvcLibX/include/stdint.h rename to deps/MsvcLibX/include/msvcStdint.h index db321df86a6f130afae8cdf4b4ca7c23c00413f0..55b75fe46f2592f0d6a99912749e587bcd8e87a3 100644 --- a/deps/MsvcLibX/include/stdint.h +++ b/deps/MsvcLibX/include/msvcStdint.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename stdint.h * * * diff --git a/deps/MsvcLibX/include/stdio.h b/deps/MsvcLibX/include/msvcStdio.h similarity index 91% rename from deps/MsvcLibX/include/stdio.h rename to deps/MsvcLibX/include/msvcStdio.h index e819d131898e94c6587f701676efaa4b533e1578..65af04340d2f7036b0ad5d3702710f30fb1f7cae 100644 --- a/deps/MsvcLibX/include/stdio.h +++ b/deps/MsvcLibX/include/msvcStdio.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: stdio.h * * * @@ -11,7 +11,7 @@ * 2015-11-15 JFL Visual Studio 2015 moved this file to the Windows Kit UCRT. * 2015-12-09 JFL Alias fputs to fputsU, and vfprintf to vfprintfU. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -20,7 +20,7 @@ #include "msvclibx.h" -#include UCRT_INCLUDE_FILE(stdio.h) /* Include MSVC's own file */ +#include /* Include MSVC's own file */ #include diff --git a/deps/MsvcLibX/include/stdlib.h b/deps/MsvcLibX/include/msvcStdlib.h similarity index 84% rename from deps/MsvcLibX/include/stdlib.h rename to deps/MsvcLibX/include/msvcStdlib.h index 110641d4273e18ab310b1fe794754824467c54ba..b9bcc83f2dd9c46ba6ad4f1c3f931bdbd012ccd0 100644 --- a/deps/MsvcLibX/include/stdlib.h +++ b/deps/MsvcLibX/include/msvcStdlib.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: stdlib.h * * * @@ -9,7 +9,7 @@ * History: * * 2016-09-13 JFL Created this file. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -18,7 +18,7 @@ #include "msvclibx.h" -#include UCRT_INCLUDE_FILE(stdlib.h) /* Include MSVC's own file */ +#include /* Include MSVC's own file */ #ifdef __cplusplus extern "C" { diff --git a/deps/MsvcLibX/include/msvcSystem.h b/deps/MsvcLibX/include/msvcSystem.h new file mode 100644 index 0000000000000000000000000000000000000000..59c875b11467822bfc6cb79af0e2448b4332303d --- /dev/null +++ b/deps/MsvcLibX/include/msvcSystem.h @@ -0,0 +1,2 @@ +/* CoreUtils global system configuration definitions */ + diff --git a/deps/MsvcLibX/include/time.h b/deps/MsvcLibX/include/msvcTime.h similarity index 78% rename from deps/MsvcLibX/include/time.h rename to deps/MsvcLibX/include/msvcTime.h index f95ec6ddfa5905e822fe20c7d466624a4ad4ea74..1897da58570cf503b05502d0a15c899f1f126015 100644 --- a/deps/MsvcLibX/include/time.h +++ b/deps/MsvcLibX/include/msvcTime.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: time.h * * * @@ -10,7 +10,7 @@ * 2014-06-04 JFL Created this file. * * 2015-11-15 JFL Visual Studio 2015 moved this file to the Windows Kit UCRT. * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -19,8 +19,8 @@ #include "msvclibx.h" -#include WINSDK_INCLUDE_FILE(winsock2.h) -#include UCRT_INCLUDE_FILE(time.h) /* Include MSVC's own file */ +#include +#include /* Include MSVC's own file */ #ifdef _MSDOS @@ -33,7 +33,7 @@ #ifdef _WIN32 -#include "sys\time.h" /* for struct timespec */ +#include "sys\msvcTime.h" /* for struct timespec */ typedef int clockid_t; /* Supported values for clockid_t */ diff --git a/deps/MsvcLibX/include/unistd.h b/deps/MsvcLibX/include/msvcUnistd.h similarity index 95% rename from deps/MsvcLibX/include/unistd.h rename to deps/MsvcLibX/include/msvcUnistd.h index 748de62d2425fca989637d53a5e16a19d739b5a8..9ad60625e07be8e9b749d1951375a3a501832366 100644 --- a/deps/MsvcLibX/include/unistd.h +++ b/deps/MsvcLibX/include/msvcUnistd.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: unistd.h * * * @@ -18,7 +18,7 @@ * 2014-06-30 JFL Moved PATH_MAX definition to limits.h. * * 2016-08-25 JFL Implemented ResolveLinksA(). * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -30,8 +30,8 @@ #endif #include "msvclibx.h" /* Generate a library search record to load MsvcLibX.lib. */ -#include "sys/types.h" /* Define pid_t and getppid(). */ -#include "dirent.h" /* Define pid_t and getppid(). */ +#include "sys/msvcTypes.h" /* Define pid_t and getppid(). */ +#include "msvcDirent.h" /* Define pid_t and getppid(). */ #include /* For functions like _chdir() and _getcwd() */ #include /* For _getpid() */ diff --git a/deps/MsvcLibX/include/utime.h b/deps/MsvcLibX/include/msvcUtime.h similarity index 91% rename from deps/MsvcLibX/include/utime.h rename to deps/MsvcLibX/include/msvcUtime.h index e6771fa7a88d25b0a4312a4630108e63507aedf2..ec846871675fc619fc5da690b5690168996e5bec 100644 --- a/deps/MsvcLibX/include/utime.h +++ b/deps/MsvcLibX/include/msvcUtime.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: utime.h * * * @@ -11,7 +11,7 @@ * History: * * 2014-12-13 JFL Created this file. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/windows.h b/deps/MsvcLibX/include/msvcWindows.h similarity index 86% rename from deps/MsvcLibX/include/windows.h rename to deps/MsvcLibX/include/msvcWindows.h index 03404d7653490866dc7ea34c7b4442bcc57b42df..1c2d72554b25289113ed37aa1ce3a350889289aa 100644 --- a/deps/MsvcLibX/include/windows.h +++ b/deps/MsvcLibX/include/msvcWindows.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: windows.h * * * @@ -9,7 +9,7 @@ * History: * * 2016-09-12 JFL Created this file. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -20,7 +20,7 @@ #ifdef _WIN32 -#include WINSDK_INCLUDE_FILE(windows.h) /* Include Windows SDK's own windows.h */ +#include /* Include Windows SDK's own windows.h */ /****************** Define UTF-8 versions of WIN32 routines ******************/ diff --git a/deps/MsvcLibX/include/xfreopen.h b/deps/MsvcLibX/include/msvcXfreopen.h similarity index 83% rename from deps/MsvcLibX/include/xfreopen.h rename to deps/MsvcLibX/include/msvcXfreopen.h index 9ec6e493e9eb7df361fff0b425623d08ca00f018..89fb5425640709419e882d1a67516b4ee342718b 100644 --- a/deps/MsvcLibX/include/xfreopen.h +++ b/deps/MsvcLibX/include/msvcXfreopen.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: error.h * * * @@ -9,7 +9,7 @@ * History: * * 2014-02-10 JFL Created this file. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/msvclibx.h b/deps/MsvcLibX/include/msvclibx.h index 6395737f4baed2f9e963b1a0304bfed12d38d445..4f5fc2733b7ee766603ff82803a24486c3f9d108 100644 --- a/deps/MsvcLibX/include/msvclibx.h +++ b/deps/MsvcLibX/include/msvclibx.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename MsvcLibX.h * * * @@ -15,7 +15,7 @@ * 2016-09-28 JFL Can also be included by MS' Resource Compiler. * * 2017-02-05 JFL Changed the UTF-8 programs initialization method. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -58,7 +58,7 @@ /* Generate the OS-and-debug-mode-specific library name */ #define _MSVCLIBX_LIB "MsvcLibX" _MSVCLIBX_LIB_OS_SUFFIX _MSVCLIBX_LIB_DBG_SUFFIX ".lib" -#pragma message("Adding pragma comment(lib, \"" _MSVCLIBX_LIB "\")") +//#pragma message("Adding pragma comment(lib, \"" _MSVCLIBX_LIB "\")") #pragma comment(lib, _MSVCLIBX_LIB) /* Library-specific routine used internally by many standard routines */ diff --git a/deps/MsvcLibX/include/stdio--.h b/deps/MsvcLibX/include/stdio--.h deleted file mode 100644 index 66b7e6e326c14cdfa74e06ff80cf71de9a765a75..0000000000000000000000000000000000000000 --- a/deps/MsvcLibX/include/stdio--.h +++ /dev/null @@ -1,17 +0,0 @@ -/*****************************************************************************\ -* * -* Filename: stdio--.h * -* * -* Description: front-end to stdio.h that redefines some unsafe functions * -* * -* Notes: This header is part of the GNU CoreUtils library. * -* msvclibx: Pass through to the standard stdio.h. * -* * -* History: * -* 2012-10-17 JFL Created this file. * -* * -* Copyright 2016 Hewlett Packard Enterprise Development LP * -* Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * -\*****************************************************************************/ - -#include diff --git a/deps/MsvcLibX/include/sys/param.h b/deps/MsvcLibX/include/sys/msvcParam.h similarity index 85% rename from deps/MsvcLibX/include/sys/param.h rename to deps/MsvcLibX/include/sys/msvcParam.h index ebb0430fc98893503d0baee11af57e9f8736bb6c..096af578cd86c4ca7b0c2c6eb3acf1876dac526c 100644 --- a/deps/MsvcLibX/include/sys/param.h +++ b/deps/MsvcLibX/include/sys/msvcParam.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename sys/param.h * * * @@ -9,7 +9,7 @@ * History * * 2014-06-10 JFL Created this file. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/sys/stat.h b/deps/MsvcLibX/include/sys/msvcStat.h similarity index 95% rename from deps/MsvcLibX/include/sys/stat.h rename to deps/MsvcLibX/include/sys/msvcStat.h index 2cbe7151481a408b008cc9485672c9507289b050..b2b82d0be8fc68f0d2e2391a2d494bc25e6b9607 100644 --- a/deps/MsvcLibX/include/sys/stat.h +++ b/deps/MsvcLibX/include/sys/msvcStat.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: stat.h * * * @@ -19,7 +19,7 @@ * 2015-11-15 JFL Visual Studio 2015 moved this file to the Windows Kit UCRT. * 2016-09-15 JFL Fixed a warning in Visual Studio 2015. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -28,11 +28,11 @@ #include "msvclibx.h" -#include -#include UCRT_INCLUDE_FILE(sys\stat.h) /* Include MSVC's own file */ -#include /* For dirent2stat() arguments definitions */ -#include /* for time_t definition */ -#include /* for timespec definition */ +#include "sys/msvcTypes.h" +#include /* Include MSVC's own file */ +#include "msvcDirent.h" /* For dirent2stat() arguments definitions */ +#include "msvcTime.h" /* for time_t definition */ +#include "sys/msvcTime.h" /* for timespec definition */ /* Include MsvcLibX's override, to avoid conflict with the standard mkdir defined here, should be manually included later on in the C source */ #include @@ -154,7 +154,7 @@ extern char *Filetime2String(uint16_t date, uint16_t time, char *pBuf, size_t nB if we were to use MsvcLibX extended stat structures and routines */ #define _LIBX_stat _CONCAT(_MSVC_stat,_ns) #define _LIBX_stat64 _CONCAT(_MSVC_stat64,_ns) -#include "debugm.h" +#include "msvcDebugm.h" #pragma message("Defining type struct " VALUEIZE(_LIBX_stat)) struct _LIBX_stat { /* MSVC standard stat structure fields */ diff --git a/deps/MsvcLibX/include/sys/time.h b/deps/MsvcLibX/include/sys/msvcTime.h similarity index 94% rename from deps/MsvcLibX/include/sys/time.h rename to deps/MsvcLibX/include/sys/msvcTime.h index 2dd8f4a5e439147d91f3ee1af28ce9f55de7d3d0..d538f6aa7646864cda3482fd2dcd2acfba8dda3e 100644 --- a/deps/MsvcLibX/include/sys/time.h +++ b/deps/MsvcLibX/include/sys/msvcTime.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename sys/time.h * * * @@ -21,7 +21,7 @@ * Added macros TIMEVAL_TO_TIMESPEC & TIMESPEC_TO_TIMEVAL. * * 2016-07-06 JFL Avoid error if winsocks2.h has been previously included. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/sys/utsname.h b/deps/MsvcLibX/include/sys/msvcTsname.h similarity index 86% rename from deps/MsvcLibX/include/sys/utsname.h rename to deps/MsvcLibX/include/sys/msvcTsname.h index 4b2a85527ffdaf8c2c3cede3350b70e37996d77b..41d97a3719e9f615024f5f20f703a6d7082b1184 100644 --- a/deps/MsvcLibX/include/sys/utsname.h +++ b/deps/MsvcLibX/include/sys/msvcTsname.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: sys/utsname.h * * * @@ -9,7 +9,7 @@ * History: * * 2014-05-30 JFL Created this file. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/sys/types.h b/deps/MsvcLibX/include/sys/msvcTypes.h similarity index 89% rename from deps/MsvcLibX/include/sys/types.h rename to deps/MsvcLibX/include/sys/msvcTypes.h index 5b0f4133229721c9eb1cd86e0723a5f8f4238120..bde2ac9a8a168465bbea940c0505c4a9654c4d51 100644 --- a/deps/MsvcLibX/include/sys/types.h +++ b/deps/MsvcLibX/include/sys/msvcTypes.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: sys/types.h * * * @@ -11,7 +11,7 @@ * 2014-06-06 JFL Moved mode_t & off*_t definitions here, from sys\stat.h. * * 2015-11-15 JFL Visual Studio 2015 moved this file to the Windows Kit UCRT. * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -20,7 +20,7 @@ #include "msvclibx.h" -#include UCRT_INCLUDE_FILE(sys\types.h) /* Include MSVC's own file */ +#include /* Include MSVC's own file */ /************************ MS-DOS-specific definitions ************************/ @@ -90,6 +90,7 @@ typedef int uid_t; /* MsvcLibX uses mode_t in sys/stat.h */ typedef int mode_t; +#define HAVE_MODE_T /* File link counts type (not used by MsvcLibX so far) */ typedef int nlink_t; /* Is short in some Unix versions */ diff --git a/deps/MsvcLibX/include/system.h b/deps/MsvcLibX/include/system.h deleted file mode 100644 index 56f102c33d4d0185fc0ba3bf22bf60d1a168a8a4..0000000000000000000000000000000000000000 --- a/deps/MsvcLibX/include/system.h +++ /dev/null @@ -1,2 +0,0 @@ -/* CoreUtils global system configuration definitions */ - diff --git a/deps/MsvcLibX/make.bat b/deps/MsvcLibX/make.bat deleted file mode 100644 index 7a272561228129410dcba670dee0ddb723553647..0000000000000000000000000000000000000000 --- a/deps/MsvcLibX/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@echo off -:#***************************************************************************** -:# * -:# Filename: make.bat * -:# * -:# Description: Build DOS and Windows targets * -:# * -:# Notes: Proxy script for %STINCLUDE%\make.bat. * -:# * -:# If any change is needed, put it in %STINCLUDE%\make.bat. * -:# * -:# History: * -:# 2016-10-10 JFL jf.larvoire@hpe.com created this file. * -:# 2016-12-15 JFL Search for the real make.bat in [.|..|../..]\include. * -:# * -:# Copyright 2016 Hewlett Packard Enterprise Development LP * -:# Licensed under the Apache 2.0 license www.apache.org/licenses/LICENSE-2.0 * -:#***************************************************************************** - -:# Get the full pathname of the STINCLUDE library directory -if defined STINCLUDE if not exist "%STINCLUDE%\make.bat" set "STINCLUDE=" &:# Allow overriding with another alias name, but ignore invalid overrides -for %%p in (. .. ..\..) do if not defined STINCLUDE if exist %%p\include\make.bat ( :# Default: Search it the current directory, and 2 levels above. - for /f "delims=" %%d in ('"pushd %%p\include & cd & popd"') do SET "STINCLUDE=%%d" -) -if not defined STINCLUDE ( :# Try getting the copy in the master environment - for /f "tokens=3" %%v in ('reg query "HKCU\Environment" /v STINCLUDE 2^>NUL') do set "STINCLUDE=%%v" -) - -if not exist %STINCLUDE%\make.bat ( - >&2 echo %0 Error: Cannot find SysToolsLib's global C include directory. Please define variable STINCLUDE. - exit /b 1 -) - -if [%1]==[-d] echo "%STINCLUDE%\make.bat" %* -"%STINCLUDE%\make.bat" %* diff --git a/deps/MsvcLibX/src/Files.mak b/deps/MsvcLibX/src/Files.mak deleted file mode 100644 index 0b9ad8ee8c8c7476d02c089f4eb9c8157df4b518..0000000000000000000000000000000000000000 --- a/deps/MsvcLibX/src/Files.mak +++ /dev/null @@ -1,261 +0,0 @@ -############################################################################### -# # -# File name Files.mak # -# # -# Description MsvcLibX Specific file dependancies # -# # -# Notes # -# # -# History # -# 2012-10-21 JFL Initial version # -# 2013-03-27 JFL Added debugv.obj and getppid.obj. # -# 2014-02-03 JFL Added readlink.obj. # -# 2014-02-05 JFL Added symlink.obj. # -# 2014-02-06 JFL Added lstat*.obj. # -# 2014-02-10 JFL Added realpath.obj. # -# 2014-02-17 JFL Added err2errno.obj. # -# 2014-02-26 JFL Added filetime.obj. # -# 2014-02-27 JFL Added iconv.obj. # -# 2014-02-28 JFL Added chdir.obj and getcwd.obj. # -# 2014-03-04 JFL Added fopen.obj. # -# 2014-03-06 JFL Added strerror.obj. # -# 2014-03-24 JFL Added access.obj. # -# 2014-03-27 JFL Added spawn.obj. # -# 2014-05-30 JFL Moved here the OBJECTS macro definition from NMakeFile. # -# Added uname.obj and utimes.obj. # -# 2014-06-04 JFL Added clock_gettime.obj and gettimeofday.obj. # -# 2014-06-24 JFL Added fstat64.obj and fstat64i32.obj. # -# 2014-07-01 JFL Added mb2wpath.obj. # -# 2016-09-08 JFL Added basename.obj and dirname.obj. # -# 2016-09-12 JFL Added WIN32_OBJECTS, and several WIN32 UTF-8 routines. # -# 2016-10-11 JFL moved debugm.h to SysToolsLib global C include dir. # -# 2017-02-16 JFL Added open.obj. # -# # -# Copyright 2016 Hewlett Packard Enterprise Development LP # -# Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 # -############################################################################### - -# List of object files to build and include in the MsvcLibX library -# IMPORTANT NOTE: Every time you add an object file in the list here, also -# store its specific source file dependancies below. -OBJECTS = \ - +access.obj \ - +basename.obj \ - +chdir.obj \ - +clock_gettime.obj \ - +debugv.obj \ - +dirent.obj \ - +dirname.obj \ - +err2errno.obj \ - +filetime.obj \ - +fnmatch.obj \ - +fopen.obj \ - +fstat64i32.obj \ - +fstat64.obj \ - +getcwd.obj \ - +getopt.obj \ - +getppid.obj \ - +gettimeofday.obj \ - +iconv.obj \ - +lstat64i32.obj \ - +lstat64.obj \ - +main.obj \ - +mb2wpath.obj \ - +mkdir.obj \ - +mkdtemp.obj \ - +mkstemp.obj \ - +open.obj \ - +readlink.obj \ - +realpath.obj \ - +spawn.obj \ - +strerror.obj \ - +strndup.obj \ - +strptime.obj \ - +symlink.obj \ - +uname.obj \ - +utime.obj \ - +utimes.obj \ - +xfreopen.obj \ -# +lstat32.obj \ -# +lstat32i64.obj \ - -# WIN32 UTF-8 extension routines, used for implementing UTF-8 support for WIN32 libc. -WIN32_OBJECTS = \ - +GetFileAttributes.obj \ - +GetFileAttributesEx.obj \ - +GetFullPathName.obj \ - +GetLongPathName.obj \ - +fullpath.obj \ - -# GnuLib routines that I mistakenly defined here -REMOVED_OBJECTS = \ - +error.obj \ - +initmain.obj \ - +xnmalloc.obj \ - -############################################################################### -# Include files dependancies # -############################################################################### - -I=..\include -CI=$(STINCLUDE) - -$(I)\chdir.h: $(I)\unistd.h $(I)\iconv.h $(CI)\debugm.h - -$(I)\config.h: $(I)\msvclibx.h $(I)\stdbool.h $(I)\unistd.h - -$(I)\direct.h: $(I)\msvclibx.h - -$(I)\dirent.h: $(I)\inttypes.h $(I)\sys\stat.h - -$(I)\error.h: $(I)\msvclibx.h - -# $(I)\fadvise.h: - -$(I)\fcntl.h: $(I)\msvclibx.h - -$(I)\fnmatch.h: $(I)\msvclibx.h - -$(I)\getcwd.h: $(I)\unistd.h $(CI)\debugm.h - -# $(I)\getopt.h: - -$(I)\grp.h: $(I)\msvclibx.h - -# $(I)\inttypes.h: - -# $(I)\msvclibx.h: - -# $(I)\netdb.h: - -$(I)\process.h: $(I)\msvclibx.h - -$(I)\pwd.h: $(I)\msvclibx.h - -# $(I)\regex.h: - -$(I)\sys\stat.h: $(I)\msvclibx.h $(I)\sys\types.h - -# $(I)\stdbool.h: - -# $(I)\stdint.h: - -$(I)\stdio.h: $(I)\msvclibx.h - -# $(I)\stdio--.h: - -$(I)\stdlib.h: $(I)\msvclibx.h - -# $(I)\system.h: - -$(I)\unistd.h: $(I)\msvclibx.h $(I)\dirent.h - -# $(I)\utime.h: - -$(I)\windowsU.h: $(I)\msvclibx.h - -$(I)\xfreopen.h: $(I)\msvclibx.h - -$(I)\sys\types.h: $(I)\msvclibx.h - - -############################################################################### -# Source files dependancies # -############################################################################### - -access.c: $(I)\MsvcLibX.h $(CI)\debugm.h - -basename.c: $(I)\libgen.h - -chdir.c: $(CI)\debugm.h $(I)\iconv.h $(I)\unistd.h - -clock_gettime.c: $(I)\MsvcLibX.h $(I)\time.h $(I)\sys\stat.h - -debugv.c: $(CI)\debugm.h - -dirent.c: $(CI)\debugm.h $(I)\dirent.h $(I)\sys\stat.h $(I)\unistd.h - -dirname.c: $(I)\libgen.h - -err2errno.c: $(I)\MsvcLibX.h $(CI)\debugm.h - -error.c: $(I)\config.h $(I)\error.h - -filetime.c: $(I)\sys\stat.h - -fnmatch.c: $(CI)\debugm.h $(I)\fnmatch.h - -fopen.c: $(I)\MsvcLibX.h - -fstat64.c: fstat.c $(CI)\debugm.h $(I)\dirent.h $(I)\MsvcLibX.h $(I)\sys\stat.h $(I)\stdint.h - -fstat64i32.c: fstat.c $(CI)\debugm.h $(I)\dirent.h $(I)\MsvcLibX.h $(I)\sys\stat.h $(I)\stdint.h - -fullpath.c: $(I)\stdlib.h $(I)\limits.h - -getcwd.c: $(CI)\debugm.h $(I)\unistd.h - -GetFileAttributesU.c: $(I)\windowsU.h $(I)\limits.h - -GetFileAttributesExU.c: $(I)\windowsU.h $(I)\limits.h - -GetFullPathNameU.c: $(I)\windowsU.h $(I)\limits.h - -GetLongPathNameU.c: $(I)\windowsU.h $(I)\limits.h - -getopt.c: $(I)\getopt.h - -# getppid.c: - -gettimeofday.c: $(I)\MsvcLibX.h $(I)\time.h $(I)\sys\time.h - -grp.c: $(I)\grp.h - -iconv.c: $(I)\iconv.h - -initmain.c: $(I)\config.h - -lstat32.c: lstat.c $(CI)\debugm.h $(I)\dirent.h $(I)\MsvcLibX.h $(I)\sys\stat.h $(I)\stdint.h $(I)\unistd.h - -lstat32i64.c: lstat.c $(CI)\debugm.h $(I)\dirent.h $(I)\MsvcLibX.h $(I)\sys\stat.h $(I)\stdint.h $(I)\unistd.h - -lstat64.c: lstat.c $(CI)\debugm.h $(I)\dirent.h $(I)\MsvcLibX.h $(I)\sys\stat.h $(I)\stdint.h $(I)\unistd.h - -lstat64i32.c: lstat.c $(CI)\debugm.h $(I)\dirent.h $(I)\MsvcLibX.h $(I)\sys\stat.h $(I)\stdint.h $(I)\unistd.h - -main.c: $(I)\MsvcLibX.h - -mb2wpath.c: $(I)\MsvcLibX.h $(CI)\debugm.h - -mkdir.c: $(I)\MsvcLibX.h $(I)\sys\stat.h - -mkdtemp.c: $(I)\unistd.h - -mkstemp.c: $(I)\unistd.h - -open.c: $(I)\MsvcLibX.h $(I)\fcntl.h $(CI)\debugm.h - -pwd.c: $(I)\pwd.h - -readlink.c: $(CI)\debugm.h $(I)\unistd.h $(I)\reparsept.h - -realpath.c: $(CI)\debugm.h $(I)\unistd.h - -spawm.c: $(CI)\debugm.h $(I)\MsvcLibX.h $(I)\process.h - -strerror.c: $(I)\MsvcLibX.h - -# strndup.c: - -# strptime.c: - -symlink.c: $(CI)\debugm.h $(I)\reparsept.h $(I)\unistd.h - -uname.c: $(I)\MsvcLibX.h $(I)\sys\utsname.h - -utime.c: $(CI)\debugm.h $(I)\unistd.h $(I)\utime.h $(I)\sys\time.h - -xfreopen.c: $(I)\xfreopen.h - -xnmalloc.c: $(I)\config.h - diff --git a/deps/MsvcLibX/src/GetFileAttributes.c b/deps/MsvcLibX/src/GetFileAttributes.c index 8bf3a53e8699b76e24c0ca0f6804c237d37fc5ad..386114ed70d1fd7ab50b5b027b7f469f8a6b33cd 100644 --- a/deps/MsvcLibX/src/GetFileAttributes.c +++ b/deps/MsvcLibX/src/GetFileAttributes.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename GetFileAttributes.c * * * @@ -9,14 +9,14 @@ * History: * * 2016-09-12 JFL Created this file. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #ifdef _WIN32 /* Automatically defined when targeting a Win32 application */ #include /* Also includes MsvcLibX' WIN32 UTF-8 extensions */ -#include +#include "msvcLimits.h" /*---------------------------------------------------------------------------*\ * * diff --git a/deps/MsvcLibX/src/GetFileAttributesEx.c b/deps/MsvcLibX/src/GetFileAttributesEx.c index c24664e8fa89f8be324e7d5ab2bb66aa8bc1b714..caf3c27342eab0b09e9b2e00eb0b22dd80d5ea37 100644 --- a/deps/MsvcLibX/src/GetFileAttributesEx.c +++ b/deps/MsvcLibX/src/GetFileAttributesEx.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename GetFileAttributesEx.c * * * @@ -9,14 +9,14 @@ * History: * * 2016-09-12 JFL Created this file. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #ifdef _WIN32 /* Automatically defined when targeting a Win32 application */ #include /* Also includes MsvcLibX' WIN32 UTF-8 extensions */ -#include +#include "msvcLimits.h" /*---------------------------------------------------------------------------*\ * * diff --git a/deps/MsvcLibX/src/GetFullPathName.c b/deps/MsvcLibX/src/GetFullPathName.c index 2f87f36fdf17b21b2e1ebb084c3ca469622a9f87..4e9afeec3e9f197d66bdc587bddeeff98b24da8d 100644 --- a/deps/MsvcLibX/src/GetFullPathName.c +++ b/deps/MsvcLibX/src/GetFullPathName.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename GetFullPathName.c * * * @@ -9,15 +9,15 @@ * History: * * 2016-09-12 JFL Created this file, from the routine in truename.c. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #ifdef _WIN32 /* Automatically defined when targeting a Win32 application */ #include /* Also includes MsvcLibX' WIN32 UTF-8 extensions */ -#include -#include "debugm.h" /* MsvcLibX debugging macros */ +#include "msvcLimits.h" +#include "msvcDebugm.h" /* MsvcLibX debugging macros */ /*---------------------------------------------------------------------------*\ * * diff --git a/deps/MsvcLibX/src/GetLongPathName.c b/deps/MsvcLibX/src/GetLongPathName.c index 58a10b616e5a661fa5a8064ca89dc97e0bcd3a20..b0bbc245d94ebe0aa5f50ba37b394daa0d97f3e8 100644 --- a/deps/MsvcLibX/src/GetLongPathName.c +++ b/deps/MsvcLibX/src/GetLongPathName.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename GetLongPathName.c * * * @@ -9,15 +9,15 @@ * History: * * 2016-09-12 JFL Created this file, from the routine in truename.c. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #ifdef _WIN32 /* Automatically defined when targeting a Win32 application */ #include /* Also includes MsvcLibX' WIN32 UTF-8 extensions */ -#include -#include "debugm.h" /* MsvcLibX debugging macros */ +#include "msvcLimits.h" +#include "msvcDebugm.h" /* MsvcLibX debugging macros */ /*---------------------------------------------------------------------------*\ * * diff --git a/deps/MsvcLibX/src/NMakefile b/deps/MsvcLibX/src/NMakefile deleted file mode 100644 index 398576c9156516db9f85b677b4ac6a39b8f7c177..0000000000000000000000000000000000000000 --- a/deps/MsvcLibX/src/NMakefile +++ /dev/null @@ -1,239 +0,0 @@ -############################################################################### -# # -# File name NMakefile # -# # -# Description An NMake file for making all MsvcLibX library versions # -# # -# Notes make.bat looks for a default nmake file called nmakefile. # -# # -# History # -# 2012-10-21 JFL Initial version # -# 2014-03-05 JFL Generate the DOS version only if DOS tools are present. # -# 2014-04-22 JFL Fixed the clean target to work even without 16-bits tools.# -# 2014-05-30 JFL Moved the OBJECTS macro definition to Files.mak. # -# 2014-12-03 JFL Fixed the zip target creation. # -# 2015-11-06 JFL Added support for a Win95 version. # -# 2016-01-11 JFL Added a rule to create the common ..\lib directory. # -# 2016-07-05 JFL Fixed a typo preventing the build of DOS S Debug version. # -# 2016-09-26 JFL Added macro LIBDIR, depending on OUTDIR. # -# Copy the include files to $(OUTDIR). # -# 2016-10-04 JFL Make sure nothing is displayed when doing a make clean. # -# 2016-10-06 JFL Added targets mostlyclean & distclean. # -# 2016-10-11 JFL Adapted for use with make files in the global include dir.# -# 2016-10-13 JFL Added target cleanenv. # -# 2016-11-03 JFL Added target config. # -# Updated the cleanenv: script to display the reg command # -# it uses to delete the global environment variable. # -# 2016-11-07 JFL Place LIBDIR in the parent directory even if OUTDIR defnd.# -# Do not copy include files to OUTDIR anymore. # -# 2016-11-16 JFL Removed the rule for copying INCDIR, not used anymore. # -# 2017-02-16 JFL Default goals now depend on the existence of their # -# corresponding make file. # -# # -# Copyright 2016 Hewlett Packard Enterprise Development LP # -# Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 # -############################################################################### - -!IF DEFINED(MESSAGES) -!MESSAGE Started MsvcLibX/src/NMakefile in $(MAKEDIR) # Display this make file name -!ENDIF - -!IF DEFINED(OUTDIR) -OD=$(OUTDIR)^\ -!IF "$(OUTDIR:\=)"=="$(OUTDIR)" -LIBDIR=..\$(OUTDIR)\lib # If OUTDIR is relative, put it in MsvcLibX top directory -!ELSE -LIBDIR=$(OUTDIR)\lib # If OUTDIR is absolute, use it as is -!ENDIF -!ELSE -OD= -LIBDIR=..\lib -!ENDIF - -MSG=>con echo # Command for writing a progress message on the console -HEADLINE=$(MSG).&$(MSG) # Output a blank line, then a message - -# Default goal: Generate all versions -all: headline \ -!IF DEFINED(DOS_CC) && EXIST("$(STINCLUDE)\DOS.mak") - $(OD)DOS\MsvcLibX.lib \ -!ENDIF -!IF DEFINED(WIN95_CC) && EXIST("$(STINCLUDE)\WIN95.mak") - $(OD)WIN95\MsvcLibX.lib \ -!ENDIF -!IF DEFINED(WIN32_CC) && EXIST("$(STINCLUDE)\WIN32.mak") - $(OD)WIN32\MsvcLibX.lib \ -!ENDIF -!IF DEFINED(WIN64_CC) && EXIST("$(STINCLUDE)\WIN64.mak") - $(OD)WIN64\MsvcLibX.lib \ -!ENDIF -!IF DEFINED(DOS_CC) && EXIST("$(STINCLUDE)\DOS.mak") - $(OD)DOS\DEBUG\MsvcLibX.lib \ -!ENDIF -!IF DEFINED(WIN95_CC) && EXIST("$(STINCLUDE)\WIN95.mak") - $(OD)WIN95\DEBUG\MsvcLibX.lib \ -!ENDIF -!IF DEFINED(WIN32_CC) && EXIST("$(STINCLUDE)\WIN32.mak") - $(OD)WIN32\DEBUG\MsvcLibX.lib \ -!ENDIF -!IF DEFINED(WIN64_CC) && EXIST("$(STINCLUDE)\WIN64.mak") - $(OD)WIN64\DEBUG\MsvcLibX.lib \ -!ENDIF - -headline: - $(HEADLINE) Building all MsvcLibX library versions - -# Define the OBJECTS macro = the list of object files to include in the library -!INCLUDE "Files.mak" - -# Create the common libs directory -$(LIBDIR): - $(HEADLINE) Creating directory $(LIBDIR:..=MsvcLibX) - md $(LIBDIR) - -# Rules for building specific versions of the MsvcLibX library -$(OD)DOS\MsvcLibX.lib: $(OD)DOS\BIN\T\MsvcLibX.lib $(OD)DOS\BIN\S\MsvcLibX.lib $(OD)DOS\BIN\L\MsvcLibX.lib - @echo Done building all DOS release libraries - -$(OD)DOS\DEBUG\MsvcLibX.lib: $(OD)DOS\DEBUG\BIN\T\MsvcLibX.lib $(OD)DOS\DEBUG\BIN\S\MsvcLibX.lib $(OD)DOS\DEBUG\BIN\L\MsvcLibX.lib - @echo Done building all DOS debug libraries - -$(OD)DOS\BIN\T\MsvcLibX.lib: $(LIBDIR) NUL - $(HEADLINE) Building MsvcLibX library DOS tiny release version - set OBJECTS=$(OBJECTS) - $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\DOS.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\OBJ\T\%" "MEM=T" dirs $@ - if exist $@ copy $@ $(LIBDIR)\MsvcLibXdt.lib - -$(OD)DOS\BIN\S\MsvcLibX.lib: $(LIBDIR) NUL - $(HEADLINE) Building MsvcLibX library DOS small release version - set OBJECTS=$(OBJECTS) - $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\DOS.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\OBJ\S\%" "MEM=S" dirs $@ - if exist $@ copy $@ $(LIBDIR)\MsvcLibXds.lib - -$(OD)DOS\BIN\L\MsvcLibX.lib: $(LIBDIR) NUL - $(HEADLINE) Building MsvcLibX library DOS large release version - set OBJECTS=$(OBJECTS) - $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\DOS.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\OBJ\L\%" "MEM=L" dirs $@ - if exist $@ copy $@ $(LIBDIR)\MsvcLibXdl.lib - -$(OD)WIN95\MsvcLibX.lib: $(LIBDIR) NUL - $(HEADLINE) Building MsvcLibX library WIN95 release version - set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS) - $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\WIN95.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN95\OBJ\%" dirs $@ - if exist $@ copy $@ $(LIBDIR)\MsvcLibXw95.lib - -$(OD)WIN32\MsvcLibX.lib: $(LIBDIR) NUL - $(HEADLINE) Building MsvcLibX library WIN32 release version - set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS) - set OD=$(OD) - $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\WIN32.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN32\OBJ\%" dirs $@ - if exist $@ copy $@ $(LIBDIR)\MsvcLibXw32.lib - -$(OD)WIN64\MsvcLibX.lib: $(LIBDIR) NUL - $(HEADLINE) Building MsvcLibX library WIN64 release version - set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS) - $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\WIN64.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN64\OBJ\%" dirs $@ - if exist $@ copy $@ $(LIBDIR)\MsvcLibXw64.lib - -$(OD)DOS\DEBUG\BIN\T\MsvcLibX.lib: $(LIBDIR) NUL - $(HEADLINE) Building MsvcLibX library DOS tiny debug version - set OBJECTS=$(OBJECTS) - $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\DOS.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\DEBUG\OBJ\T\%" "MEM=T" dirs $@ - if exist $@ copy $@ $(LIBDIR)\MsvcLibXdtd.lib - -$(OD)DOS\DEBUG\BIN\S\MsvcLibX.lib: $(LIBDIR) NUL - $(HEADLINE) Building MsvcLibX library DOS small debug version - set OBJECTS=$(OBJECTS) - $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\DOS.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\DEBUG\OBJ\S\%" "MEM=S" dirs $@ - if exist $@ copy $@ $(LIBDIR)\MsvcLibXdsd.lib - -$(OD)DOS\DEBUG\BIN\L\MsvcLibX.lib: $(LIBDIR) NUL - $(HEADLINE) Building MsvcLibX library DOS large debug version - set OBJECTS=$(OBJECTS) - $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\DOS.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\DEBUG\OBJ\L\%" "MEM=L" dirs $@ - if exist $@ copy $@ $(LIBDIR)\MsvcLibXdld.lib - -$(OD)WIN95\DEBUG\MsvcLibX.lib: $(LIBDIR) NUL - $(HEADLINE) Building MsvcLibX library WIN95 debug version - set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS) - $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\WIN95.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN95\DEBUG\OBJ\%" dirs $@ - if exist $@ copy $@ $(LIBDIR)\MsvcLibXw95d.lib - -$(OD)WIN32\DEBUG\MsvcLibX.lib: $(LIBDIR) NUL - $(HEADLINE) Building MsvcLibX library WIN32 debug version - set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS) - $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\WIN32.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN32\DEBUG\OBJ\%" dirs $@ - if exist $@ copy $@ $(LIBDIR)\MsvcLibXw32d.lib - -$(OD)WIN64\DEBUG\MsvcLibX.lib: $(LIBDIR) NUL - $(HEADLINE) Building MsvcLibX library WIN64 debug version - set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS) - $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\WIN64.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN64\DEBUG\OBJ\%" dirs $@ - if exist $@ copy $@ $(LIBDIR)\MsvcLibXw64d.lib - -# Erase all global environment variables created by this build -VARS=MSVCLIBX # Global environment variables generated here -cleanenv: - call <<"$(TMP)\cleanenv-$(PID).bat" &:# Delete variables created here - @echo off - setlocal EnableExtensions EnableDelayedExpansion - set "KEY=HKCU\Environment" - if not "$(VARS)"=="" for %%v in ($(VARS)) do @( - >>"$(TMP)\cleanenv-$(PID).lst" (echo %%v) &:# Pass the name back to make.bat, for deleting it in the current shell environment - set "VALUE=" - for /f "tokens=1,3" %%a in ('reg query "%KEY%" ^| findstr /i /b /r /c:" *%%v "') do set VALUE="%%b" - if defined VALUE ( :# The global environment variable exists. Delete it, using its actual name with the correct case. - set CMD=reg delete "%KEY%" /v %%v /f - echo !CMD! - !CMD! >NUL - ) - ) -<< - -# Dummy target, to delete all files built by these make files -clean mostlyclean distclean: - rem # Delete temporary files - -for /f "delims=" %f in ('dir /b /s *~ *.bak #*# 2^>NUL') do @del "%f" - rem # Delete files built by this nmakefile - -for /f "delims=" %f in ('dir /b /s ..\*.zip *.log 2^>NUL') do @del "%f" - rem # Delete files built by the DOS.mak, WIN32.mak, WIN64.mak make files - rem # But make DOS.mak will fail if 16-bit tools are missing. Workaround: - -if exist $(STINCLUDE)\DOS.mak $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\DOS.mak clean - if exist $(OD)DOS rd /s /q $(OD)DOS - rem # No such problem with the others, but just in case, do the same. - -if exist $(STINCLUDE)\WIN95.mak $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\WIN95.mak clean - if exist $(OD)WIN95 rd /s /q $(OD)WIN95 - -if exist $(STINCLUDE)\WIN32.mak $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\WIN32.mak clean - if exist $(OD)WIN32 rd /s /q $(OD)WIN32 - -if exist $(STINCLUDE)\WIN64.mak $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\WIN64.mak clean - if exist $(OD)WIN64 rd /s /q $(OD)WIN64 -!IF DEFINED(OUTDIR) - -rd /S /Q $(OUTDIR) >NUL 2>&1 -!ENDIF - -if "$@"=="distclean" del /Q config.*.bat >NUL 2>&1 - -# Dummy target, to build a source archive -dist zip: - $(MSG) Building ..\MsvcLibX.zip - cd .. - if exist MsvcLibX.zip del MsvcLibX.zip - set PATH=$(PATH);C:\Program Files\7-zip - 7z.exe a MsvcLibX.zip *.txt src\*.bat src\*.mak src\*makefile src\exe src\*.c -r include\*.h lib\ - rem # Delete files that got dragged in by wild cards, but that we don't want in the source zip. - 7z.exe d MsvcLibX.zip src\config.*.bat lib\*.lib - cd src - -# Run the configure.bat script in every subdirectory -config: - rem Nothing to do in $(MAKEDIR) as there is no further child level - -# Dummy target, to display a help screen -help: - type << -Targets: - all Rebuild all library versions (Default) - clean Delete all files built here, and all backup files - distclean Do a clean, then delete config.*.bat files - zip Build a source archive in ..\MsvcLibX.zip. Requires 7-zip. -<= 260 characters. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #define _CRT_SECURE_NO_WARNINGS 1 /* Avoid Visual C++ security warnings */ -#include #include #include +#include "msvcStdio.h" #include "msvclibx.h" -#include "debugm.h" +#include "msvcDebugm.h" +#include "msvcLimits.h" #ifdef _WIN32 diff --git a/deps/MsvcLibX/src/basename.c b/deps/MsvcLibX/src/basename.c index f89aa22e1f2d8def34c9f770eb6519b9bfbd103f..c442a40626e61c441bb38c44ff61d09ce495370f 100644 --- a/deps/MsvcLibX/src/basename.c +++ b/deps/MsvcLibX/src/basename.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename basename.c * * * @@ -12,7 +12,7 @@ * History * * 2016-09-08 JFL Created this file. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -20,11 +20,11 @@ #define _CRT_SECURE_NO_WARNINGS 1 /* Avoid Visual C++ 2005 security warnings */ -#include #include #include -#include -#include +#include "msvcStdlib.h" +#include "msvcLibgen.h" +#include "msvcLimits.h" #define TRUE 1 #define FALSE 0 diff --git a/deps/MsvcLibX/src/chdir.c b/deps/MsvcLibX/src/chdir.c index 48ab62fe06f4a461e6100fb7778c375907937c2a..8d562f885f6ac5071e554916dba49671e5c65260 100644 --- a/deps/MsvcLibX/src/chdir.c +++ b/deps/MsvcLibX/src/chdir.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename chdir.c * * * @@ -10,7 +10,7 @@ * 2014-02-28 JFL Created this module. * * 2014-07-02 JFL Added support for pathnames >= 260 characters. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -18,12 +18,14 @@ /* Microsoft C libraries include files */ #include -#include #include /* MsvcLibX library extensions */ -#include -#include -#include "debugm.h" +#include "msvcStdio.h" +#include "msvcUnistd.h" +#include "msvcIconv.h" +#include "msvcDebugm.h" +#include "msvcLimits.h" +#include "sys/msvcTypes.h" #if defined(_MSDOS) diff --git a/deps/MsvcLibX/src/clock_gettime.c b/deps/MsvcLibX/src/clock_gettime.c index 02202e5d2e44e56d73848875e9fd007289749268..fee7532e2e552ec08b615e61e3f4d79276ea6cfc 100644 --- a/deps/MsvcLibX/src/clock_gettime.c +++ b/deps/MsvcLibX/src/clock_gettime.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: clock_gettime.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-06-04 JFL Created this file. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -31,8 +31,8 @@ #define WIN32_LEAN_AND_MEAN /* Avoid lots of unnecessary inclusions */ #include - -#include /* For MsvcLibX's Filetime2Timespec */ +#include "msvcTime.h" +#include "sys/msvcStat.h" /* For MsvcLibX's Filetime2Timespec */ int clock_gettime(clockid_t clock_id, struct timespec *pTS) { FILETIME ft; diff --git a/deps/MsvcLibX/src/config.DESKTOP-U79TD6T.bat b/deps/MsvcLibX/src/config.DESKTOP-U79TD6T.bat deleted file mode 100644 index 6d57a1358a82104a40218466707cd066352f159d..0000000000000000000000000000000000000000 --- a/deps/MsvcLibX/src/config.DESKTOP-U79TD6T.bat +++ /dev/null @@ -1,151 +0,0 @@ -:# config.DESKTOP-U79TD6T.bat generated by configure.bat on 2020/05/19 ܶ 7:50:15.02 -:# -:# If changes are needeed, do not edit this file, but instead create a new script -:# called configure.YOURCHOICE.bat. This new script will be invoked automatically -:# by configure.bat while creating this file. Then your script can write extra -:# definitions, or change some of the variables before configure.bat writes them. -:# -:# Invoke configure.bat manually if anything changes in the tools config, such as -:# installing a Visual Studio update, or updating a configure.XXX.bat script. - -set "HAS_STINCLUDE=1" &:# Found the System Tools global C includes -set "STINCLUDE=C:\Users\admin\Desktop\temp\MyGitHub\C\include" &:# System Tools global C includes -set "HAS_MSVCLIBX=1" &:# Found the MSVC Library eXtensions library -set "MSVCLIBX=C:\Users\admin\Desktop\temp\MyGitHub\C\MsvcLibX" &:# MSVC Library eXtensions library -set "HAS_SDK_FLAGS=/DHAS_STINCLUDE=1 /DHAS_MSVCLIBX=1" &:# SDK detection flags for the C compiler - -SET "PF32=C:\Program Files (x86)" &:# 32-bits Program Files -SET "PF64=C:\Program Files" &:# 64-bits Program Files -SET "ARCH=AMD64" &:# PROCESSOR_ARCHITECTURE - -SET "MASM=" &:# Microsoft 16-bits Assembler base path -SET "MSVC=" &:# Microsoft 16-bits Visual C++ base path -SET "MAPSYM=" &:# 16-bits debugging symbols generator - -SET "VSTUDIOLONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0" &:# Microsoft Visual Studio (Long path) -SET "VSTUDIO=C:\PROGRA~2\MICROS~2.0" &:# Microsoft Visual Studio (Short path) -SET "VSCOMMONLONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7" &:# Microsoft Visual Studio Common Files (Long path) -SET "VSCOMMON=C:\PROGRA~2\MICROS~2.0\Common7" &:# Microsoft Visual Studio Common Files (Short path) -SET "VSIDELONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE" &:# Microsoft Visual Studio IDE Files (Long path) -SET "VSIDE=C:\PROGRA~2\MICROS~2.0\Common7\IDE" &:# Microsoft Visual Studio IDE Files (Short path) -SET "VSTOOLSLONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools" &:# Microsoft Visual Studio Tools (Long paths) -SET "VSTOOLS=C:\PROGRA~2\MICROS~2.0\Common7\Tools" &:# Microsoft Visual Studio Tools (Short paths) -SET "MSVC32LONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC" &:# Microsoft Visual C++ 32/64 bits (Long path) -SET "MSVC32=C:\PROGRA~2\MICROS~2.0\VC" &:# Microsoft Visual C++ 32/64 bits (Short path) - -SET "WIN_CP=936" &:# Windows Code Page -SET "WIN_CS=gb2312" &:# Windows Character Set -SET "DOS_CP=936" &:# DOS Code Page -SET "DOS_CS=gb2312" &:# DOS Character Set - -SET "AS=" &:# Assembler -SET "CC=" &:# C compiler -SET "INCLUDE=C:\Users\admin\Desktop\temp\MyGitHub\C\include" &:# Include paths. Define USER_INCLUDE if needed. -SET "LK=" &:# Linker -SET "LIB=" &:# Libraries paths. Define USER_LIBS if needed. -SET "LB=" &:# Library manager -SET "RC=" &:# Resource compiler -SET "MT=" &:# Manifest tool - -SET "DOS_CC=" &:# Microsoft Visual C++ 16-bits compiler -SET "DOS_AS=" &:# Microsoft 16-bits assembler -SET "DOS_LK=" &:# Microsoft 16-bits linker -SET "DOS_LB=" &:# Microsoft 16-bits librarian -SET "DOS_RC=" &:# Microsoft 16-bits resource compiler -SET "DOS_MT=" &:# Microsoft 16-bits manifest tool -SET "DOS_PATH=;C:\Windows\System32;C:\Windows" &:# All tools paths for 16-bits compilation -SET "DOS_VCINC=" &:# Visual C++ 16-bits compiler include dir for MsvcLibX include_next -SET "DOS_CRTINC=" &:# Visual C++ 16-bits CRT library include dir for MsvcLibX include_next -SET "DOS_INCPATH=" &:# Include paths for 16-bits compilation -SET "DOS_LIBPATH=" &:# Libraries paths for 16-bits linking -SET "DOS_WINSDK=" &:# Microsoft Windows 16-bits SDK -SET "DOS_WINSDKINC=" &:# Microsoft Windows 16-bits SDK Include directory - -SET "WIN95_CC=" &:# Microsoft Visual C++ 32-bits compiler -SET "WIN95_AS=" &:# Microsoft 32-bits assembler -SET "WIN95_LK=" &:# Microsoft 32-bits linker -SET "WIN95_LB=" &:# Microsoft 32-bits librarian -SET "WIN95_RC=" &:# Microsoft 32-bits resource compiler -SET "WIN95_MT=" &:# Microsoft 32-bits manifest tool -SET "WIN95_PATH=;C:\Windows\System32;C:\Windows" &:# All tools paths for 32-bits compilation -SET "WIN95_VCINC=" &:# Visual C++ 32-bits compiler include dir for MsvcLibX include_next -SET "WIN95_CRTINC=" &:# Visual C++ 32-bits CRT library include dir for MsvcLibX include_next -SET "WIN95_INCPATH=" &:# Include paths for 32-bits compilation -SET "WIN95_LIBPATH=" &:# Libraries paths for 32-bits linking -SET "WIN95_WINSDK=" &:# Microsoft Windows 32-bits SDK -SET "WIN95_WINSDKINC=" &:# Microsoft Windows 32-bits SDK Include directory - -SET "WIN32_CC="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.EXE"" &:# Microsoft Visual C++ 32-bits compiler -SET "WIN32_AS="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\ML.EXE"" &:# Microsoft 32-bits assembler -SET "WIN32_LK="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\LINK.EXE"" &:# Microsoft 32-bits linker -SET "WIN32_LB="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\LIB.EXE"" &:# Microsoft 32-bits librarian -SET "WIN32_RC=" &:# Microsoft 32-bits resource compiler -SET "WIN32_MT=" &:# Microsoft 32-bits manifest tool -SET "WIN32_PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Windows\System32;C:\Windows" &:# All tools paths for 32-bits compilation -SET "WIN32_VCINC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" &:# Visual C++ 32-bits compiler include dir for MsvcLibX include_next -SET "WIN32_CRTINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt" &:# Visual C++ 32-bits CRT library include dir for MsvcLibX include_next -SET "WIN32_INCPATH=C:\Users\admin\Desktop\temp\MyGitHub\C\MsvcLibX\include;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\winrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\winrt" &:# Include paths for 32-bits compilation -SET "WIN32_LIBPATH=C:\Users\admin\Desktop\temp\MyGitHub\C\MsvcLibX\lib;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86" &:# Libraries paths for 32-bits linking -SET "WIN32_WINSDK=C:\Program Files (x86)\Windows Kits\10" &:# Microsoft Windows 32-bits SDK -SET "WIN32_WINSDKINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0" &:# Microsoft Windows 32-bits SDK Include directory - -SET "IA64_CC=" &:# Microsoft Visual C++ IA64 compiler -SET "IA64_AS=" &:# Microsoft IA64 assembler -SET "IA64_LK=" &:# Microsoft IA64 linker -SET "IA64_LB=" &:# Microsoft IA64 librarian -SET "IA64_RC=" &:# Microsoft IA64 resource compiler -SET "IA64_MT=" &:# Microsoft IA64 manifest tool -SET "IA64_PATH=;C:\Windows\System32;C:\Windows" &:# All tools paths for IA64 compilation -SET "IA64_VCINC=" &:# Visual C++ IA64 compiler include dir for MsvcLibX include_next -SET "IA64_CRTINC=" &:# Visual C++ IA64 CRT library include dir for MsvcLibX include_next -SET "IA64_INCPATH=" &:# Include paths for IA64 compilation -SET "IA64_LIBPATH=" &:# Libraries paths for IA64 linking -SET "IA64_WINSDK=" &:# Microsoft Windows IA64 SDK -SET "IA64_WINSDKINC=" &:# Microsoft Windows IA64 SDK Include directory - -SET "WIN64_CC="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\CL.EXE"" &:# Microsoft Visual C++ 64-bits compiler -SET "WIN64_AS="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\ML64.EXE"" &:# Microsoft 64-bits assembler -SET "WIN64_LK="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\LINK.EXE"" &:# Microsoft 64-bits linker -SET "WIN64_LB="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\LIB.EXE"" &:# Microsoft 64-bits librarian -SET "WIN64_RC=" &:# Microsoft 64-bits resource compiler -SET "WIN64_MT=" &:# Microsoft 64-bits manifest tool -SET "WIN64_PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Windows\System32;C:\Windows" &:# All tools paths for 64-bits compilation -SET "WIN64_VCINC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" &:# Visual C++ 64-bits compiler include dir for MsvcLibX include_next -SET "WIN64_CRTINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt" &:# Visual C++ 64-bits CRT library include dir for MsvcLibX include_next -SET "WIN64_INCPATH=C:\Users\admin\Desktop\temp\MyGitHub\C\MsvcLibX\include;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\winrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\winrt" &:# Include paths for 64-bits compilation -SET "WIN64_LIBPATH=C:\Users\admin\Desktop\temp\MyGitHub\C\MsvcLibX\lib;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\amd64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64" &:# Libraries paths for 64-bits linking -SET "WIN64_WINSDK=C:\Program Files (x86)\Windows Kits\10" &:# Microsoft Windows 64-bits SDK -SET "WIN64_WINSDKINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0" &:# Microsoft Windows 64-bits SDK Include directory - -SET "ARM_CC="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm\CL.EXE"" &:# Microsoft Visual C++ ARM compiler -SET "ARM_AS="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm\ARMASM.EXE"" &:# Microsoft ARM assembler -SET "ARM_LK="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm\LINK.EXE"" &:# Microsoft ARM linker -SET "ARM_LB="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm\LIB.EXE"" &:# Microsoft ARM librarian -SET "ARM_RC=" &:# Microsoft ARM resource compiler -SET "ARM_MT=" &:# Microsoft ARM manifest tool -SET "ARM_PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Windows\System32;C:\Windows" &:# All tools paths for ARM compilation -SET "ARM_VCINC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" &:# Visual C++ ARM compiler include dir for MsvcLibX include_next -SET "ARM_CRTINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt" &:# Visual C++ ARM CRT library include dir for MsvcLibX include_next -SET "ARM_INCPATH=C:\Users\admin\Desktop\temp\MyGitHub\C\MsvcLibX\include;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\winrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\winrt" &:# Include paths for ARM compilation -SET "ARM_LIBPATH=C:\Users\admin\Desktop\temp\MyGitHub\C\MsvcLibX\lib;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm" &:# Libraries paths for ARM linking -SET "ARM_WINSDK=C:\Program Files (x86)\Windows Kits\10" &:# Microsoft Windows ARM SDK -SET "ARM_WINSDKINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0" &:# Microsoft Windows ARM SDK Include directory - -SET "ARM64_CC=" &:# Microsoft Visual C++ ARM64 compiler -SET "ARM64_AS=" &:# Microsoft ARM64 assembler -SET "ARM64_LK=" &:# Microsoft ARM64 linker -SET "ARM64_LB=" &:# Microsoft ARM64 librarian -SET "ARM64_RC=" &:# Microsoft ARM64 resource compiler -SET "ARM64_MT=" &:# Microsoft ARM64 manifest tool -SET "ARM64_PATH=;C:\Windows\System32;C:\Windows" &:# All tools paths for ARM64 compilation -SET "ARM64_VCINC=" &:# Visual C++ ARM64 compiler include dir for MsvcLibX include_next -SET "ARM64_CRTINC=" &:# Visual C++ ARM64 CRT library include dir for MsvcLibX include_next -SET "ARM64_INCPATH=" &:# Include paths for ARM64 compilation -SET "ARM64_LIBPATH=" &:# Libraries paths for ARM64 linking -SET "ARM64_WINSDK=" &:# Microsoft Windows ARM64 SDK -SET "ARM64_WINSDKINC=" &:# Microsoft Windows ARM64 SDK Include directory - -:# List of commands to run when make.bat exits -SET "POST_MAKE_ACTIONS=set "MSVCLIBX=C:\Users\admin\Desktop\temp\MyGitHub\C\MsvcLibX"" - -exit /b 0 &:# Configuration done successfully diff --git a/deps/MsvcLibX/src/configure.MsvcLibX.bat b/deps/MsvcLibX/src/configure.MsvcLibX.bat deleted file mode 100644 index 767225480ace29ec7306d771560d9a416f3174bf..0000000000000000000000000000000000000000 --- a/deps/MsvcLibX/src/configure.MsvcLibX.bat +++ /dev/null @@ -1,36 +0,0 @@ -@echo off -:#***************************************************************************** -:# * -:# Filename: configure.MsvcLibX.bat * -:# * -:# Description: Special make actions for rebuilding the MsvcLibX library * -:# * -:# Notes: * -:# * -:# History: * -:# 2015-11-06 JFL Created this script. * -:# 2016-09-27 JFL Correct the final MSVCLIBX if there's a different OUTDIR. * -:# 2016-11-03 JFL Removed the side effect creating %OUTDIR%. * -:# 2016-11-07 JFL Removed the dependency on OUTDIR. * -:# Immediately set the system environment. * -:# 2016-11-16 JFL Allow using a predefined alias for this lib base path. * -:# 2016-12-16 JFL Only use setx if requested by user, with PERSISTENT_VARS. * -:# * -:# Copyright 2016 Hewlett Packard Enterprise Development LP * -:# Licensed under the Apache 2.0 license www.apache.org/licenses/LICENSE-2.0 * -:#***************************************************************************** - -:# Get the full pathname of the MsvcLibX library base directory -if defined MSVCLIBX if not exist "%MSVCLIBX%\include\msvclibx.h" set "MSVCLIBX=" &:# Allow overriding with another alias name, but ignore invalid overrides -if not defined MSVCLIBX for /f "delims=" %%d in ('"pushd .. & cd & popd"') do SET "MSVCLIBX=%%d" &:# Default: Use the current directory - -:# Declare the SDKs and libraries we need -%BEGIN_SDK_DEFS% -%USE_SDK% MSVCLIBX &:# Triggers the emission of a %CONFIG% record for MSVCLIBX -%END_SDK_DEFS% - -:# Set the local environment variable just before make exits, so that future commands in this CMD window have it. -%ADD_POST_MAKE_ACTION% set "MSVCLIBX=%MSVCLIBX%" - -:# Set the system environment variable, so that other CMD windows opened later on inherit it -if defined PERSISTENT_VARS setx MSVCLIBX "%MSVCLIBX%" >NUL diff --git a/deps/MsvcLibX/src/configure.bat b/deps/MsvcLibX/src/configure.bat deleted file mode 100644 index 7037eb92afccbfe2e0d6872a108799d56538c490..0000000000000000000000000000000000000000 --- a/deps/MsvcLibX/src/configure.bat +++ /dev/null @@ -1,35 +0,0 @@ -@echo off -:#***************************************************************************** -:# * -:# Filename: configure.bat * -:# * -:# Description: Detect system-specific settings and create config.*.bat * -:# * -:# Notes: Proxy script for %STINCLUDE%\configure.bat. * -:# * -:# Make any change needed in %STINCLUDE%\configure.bat. * -:# * -:# History: * -:# 2016-10-10 JFL jf.larvoire@hpe.com created this file. * -:# 2016-12-15 JFL Search for the real make.bat in [.|..|../..]\include. * -:# * -:# Copyright 2016 Hewlett Packard Enterprise Development LP * -:# Licensed under the Apache 2.0 license www.apache.org/licenses/LICENSE-2.0 * -:#***************************************************************************** - -:# Get the full pathname of the STINCLUDE library directory -if defined STINCLUDE if not exist "%STINCLUDE%\make.bat" set "STINCLUDE=" &:# Allow overriding with another alias name, but ignore invalid overrides -for %%p in (. .. ..\..) do if not defined STINCLUDE if exist %%p\include\make.bat ( :# Default: Search it the current directory, and 2 levels above. - for /f "delims=" %%d in ('"pushd %%p\include & cd & popd"') do SET "STINCLUDE=%%d" -) -if not defined STINCLUDE ( :# Try getting the copy in the master environment - for /f "tokens=3" %%v in ('reg query "HKCU\Environment" /v STINCLUDE 2^>NUL') do set "STINCLUDE=%%v" -) - -if not exist %STINCLUDE%\make.bat ( - >&2 echo %0 Error: Cannot find SysToolsLib's global C include directory. Please define variable STINCLUDE. - exit /b 1 -) - -if [%1]==[-d] echo "%STINCLUDE%\configure.bat" %* -"%STINCLUDE%\configure.bat" %* diff --git a/deps/MsvcLibX/src/debugv.c b/deps/MsvcLibX/src/debugv.c index a0a757032ca51429f33b5685ad5f6bb0be67b1a7..5d410c1309f8e1f99d133865b0d0272958e766ce 100644 --- a/deps/MsvcLibX/src/debugv.c +++ b/deps/MsvcLibX/src/debugv.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: debugv.c * * * @@ -9,11 +9,11 @@ * History: * * 2013-03-27 JFL jf.larvoire@hp.com created this file. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ -#include "debugm.h" +#include "msvcDebugm.h" #if defined(_DEBUG) diff --git a/deps/MsvcLibX/src/dirent.c b/deps/MsvcLibX/src/dirent.c index 5fbf3be6cabb38bf2dd75836aa27a4a4964661da..1ab2e9c002d67f4c0c703f8294e997d9e4b5b641 100644 --- a/deps/MsvcLibX/src/dirent.c +++ b/deps/MsvcLibX/src/dirent.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: dirent.c * * * @@ -30,7 +30,7 @@ * 2015-12-14 JFL Bug fix: WIN32 readdirW always read the root on "D:". * * Bug fix: DOS opendir failed on root dirs, like "D:\". * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -38,7 +38,7 @@ #define _UTF8_SOURCE /* Generate the UTF-8 version of WIN32 printf & scandir */ -#include "dirent.h" /* Include our associated .h, in the same dir as this .c. Do not use <>. */ +#include "msvcDirent.h" /* Include our associated .h, in the same dir as this .c. Do not use <>. */ #ifndef _DIRENT_FOR_DOS_WINDOWS #error "This requires MsvcLibX own version of dirent.h for DOS/Windows" #endif @@ -49,9 +49,10 @@ #include #include /* MsvcLibX library extensions */ -#include /* For readlink() */ -#include /* For Filetime2String() */ -#include "debugm.h" /* Use our house debugging framework */ +#include "msvcUnistd.h" /* For readlink() */ +#include "sys/msvcStat.h" /* For Filetime2String() */ +#include "msvcDebugm.h" /* Use our house debugging framework */ +#include "msvcLimits.h" /* Use our house debugging framework */ /*****************************************************************************\ * * diff --git a/deps/MsvcLibX/src/dirname.c b/deps/MsvcLibX/src/dirname.c index 97fffcfe8c98ee111800bf3f790d2138313b3a5b..1bdc9d9ba3e42f7afffc20cf3f7a988ae791450c 100644 --- a/deps/MsvcLibX/src/dirname.c +++ b/deps/MsvcLibX/src/dirname.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename dirname.c * * * @@ -12,7 +12,7 @@ * History * * 2016-09-08 JFL Created this file. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -23,8 +23,8 @@ #include #include #include -#include -#include +#include "msvcLibgen.h" +#include "msvcLimits.h" #define TRUE 1 #define FALSE 0 diff --git a/deps/MsvcLibX/src/err2errno.c b/deps/MsvcLibX/src/err2errno.c index ec4260df0b1e59422e3802d770c4805cab910499..306160f66432a5c8e2e5ddcdaaa3809f773db737 100644 --- a/deps/MsvcLibX/src/err2errno.c +++ b/deps/MsvcLibX/src/err2errno.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename err2errno.c * * * @@ -12,7 +12,7 @@ * Removed a few useless special cases, and added EZERO case.* * Make sure the global errno is _not_ changed by this funct.* * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -20,7 +20,7 @@ #include #include /* MsvcLibX library extensions */ -#include "debugm.h" +#include "msvcDebugm.h" #ifdef _WIN32 @@ -65,7 +65,6 @@ int _get_errno_from_oserr(unsigned long dwErr) { return errno; } #else -#pragma message("Using the default " MSVCLIBX_STRINGIZE(_get_errno_from_oserr) "()") /* Equivalent function in MSVC library. Does not know about symlink errors. */ extern int __cdecl _get_errno_from_oserr(unsigned long oserrno); #endif diff --git a/deps/MsvcLibX/src/exe b/deps/MsvcLibX/src/exe deleted file mode 100644 index 0afeaf5d6bc239ffe1178b6dad8efead29490228..0000000000000000000000000000000000000000 --- a/deps/MsvcLibX/src/exe +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/bash -#*****************************************************************************# -# # -# Filename: exe # -# # -# Description: Build simple C/C++ programs for Unix/Linux # -# # -# Notes: Usage: ./exe PROGRAM # -# # -# Stores the executables in $OS.$PROC/[Debug/] for # -# consistency with the Windows build tools. # -# This allows sharing sources in a host system, and # -# using VMs for building the various Windows and Linux # -# versions in a set of OS-specific subdirectories. # -# # -# History: # -# 2013-12-16 JFL Added support for MinGW64. # -# 2015-12-12 JFL Help now displays the output directory name. # -# 2016-01-07 JFL Added compilation option -Wall. # -# # -# Copyright 2016 Hewlett Packard Enterprise Development LP # -# Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 # -#*****************************************************************************# - -FileNoCase() # Case-independant search for a file. -{ - find . -type f | grep -i -E "./$1$" | sed s=./== -} - -# Identify the OS -OS=`uname -s` -PROC=`uname -p` -if [[ "$OS" == "OSF1" && "`uname -m`" == "alpha" ]] ; then - OS=Tru64 -fi -if [[ "$OS" == "WindowsNT" ]] ; then - OS=WIN32 -fi -OUTDIR=$OS.$PROC -if [[ "${OS:0:7}" == "MINGW32" ]] ; then # Ex: "MINGW32_NT-6.1" - OUTDIR=MINGW32 # MigGW shell if NOT case sensitive - # 2013-12-16 Actually, the 64-bits tool chain also reports MINGW32_NT-6.1 - # So distinguish the two by whether /mingw is mounted on C:\MinGW or C:\MinGW64 - if mount | grep /mingw | grep 64 > /dev/null ; then - OUTDIR=MINGW64 # MigGW shell if NOT case sensitive - fi -fi -if [[ "${OS:0:7}" == "MINGW64" ]] ; then # Ex: ? - OUTDIR=MINGW64 -fi -if [[ "${OS:0:6}" == "CYGWIN" ]] ; then # Ex: "CYGWIN_NT-6.1-WOW64" - OUTDIR=cygwin # Cygwin shell if case sensitive, so use lower case -fi - -# Command line analysis. -case "$1" in - "" | "-h" | "-?" | --help) - echo "Build simple C/C++ programs, storing the executables in $OUTDIR/" - echo "Usage: ./exe PROGRAM" - exit 0 - ;; -esac - -# Identify the source file and program to build. -PROGRAM=$1 -shift -SOURCES=`FileNoCase ${PROGRAM}.c` -CFLAGS="-std=c99 -Wall" # Force compilation in C, even if there are // comments. -if [[ "${SOURCES}" == "" ]] ; then - SOURCES=`FileNoCase ${PROGRAM}.cpp` - CFLAGS="-std=gnu++98 -lstdc++" # Force compilation in C++, even if plain C. - # -lstdc++ prevents error "undefined reference to '__gxx_personality_v0'" -fi -if [[ "${SOURCES}" == "" ]] ; then - echo "Failed to find ${PROGRAM} source." - exit 1 -fi - -# Make sure our include directories are accessible -if [[ -d "/u/JFL/SRC/Include" ]] ; then - if [[ ":$C_INCLUDE_PATH:" != *:/u/JFL/SRC/Include:* ]] ; then - if [[ "$C_INCLUDE_PATH" == "" ]] ; then - export C_INCLUDE_PATH="/u/JFL/SRC/Include" - else - export C_INCLUDE_PATH="$C_INCLUDE_PATH:/u/JFL/SRC/Include" - fi - fi -fi -echo "# C_INCLUDE_PATH=\"$C_INCLUDE_PATH\"" - -# Build it. -# gmake CC=gcc CFLAGS="$CFLAGS" SOURCES="$SOURCES" PROGRAM="$PROGRAM" OS="$OS" $* -mkdir -p $OUTDIR -echo "gcc $CFLAGS -U_DEBUG $SOURCES -o $OUTDIR/$PROGRAM" -gcc $CFLAGS -U_DEBUG $SOURCES -o $OUTDIR/$PROGRAM -mkdir -p $OUTDIR/debug -echo "gcc $CFLAGS -D_DEBUG $SOURCES -o $OUTDIR/debug/$PROGRAM" -gcc $CFLAGS -D_DEBUG $SOURCES -o $OUTDIR/debug/$PROGRAM - diff --git a/deps/MsvcLibX/src/exe.bat b/deps/MsvcLibX/src/exe.bat deleted file mode 100644 index f93d6ba3993fbf425ae8c778b60df6abd4589cb1..0000000000000000000000000000000000000000 --- a/deps/MsvcLibX/src/exe.bat +++ /dev/null @@ -1,82 +0,0 @@ -@echo off -:#***************************************************************************** -:# * -:# Filename: exe.bat * -:# * -:# Description: Front end to make.bat, to simply build multiple targets * -:# * -:# Arguments: Use option -? to display a help screen * -:# * -:# Notes: Builds the 16-bits MS-DOS version if Visual C++ 1.52 is * -:# installed in its default location in C:\MSVC. * -:# * -:# History: * -:# 2003-03-31 JFL Adapted from previous projects * -:# 2014-03-21 JFL Builds the 16-bits MS-DOS version if Visual C++ 1.52 is * -:# installed in its default location in C:\MSVC. * -:# 2014-03-27 JFL Changed option -f to use nmake option /A. * -:# Added option -r for completeness. * -:# 2015-11-13 JFL Adapted to the new multitarget make system. * -:# * -:# Copyright 2016 Hewlett Packard Enterprise Development LP * -:# Licensed under the Apache 2.0 license www.apache.org/licenses/LICENSE-2.0 * -:#***************************************************************************** - -setlocal enableextensions enabledelayedexpansion -goto main - -:main -set "FORCE=0" -set "ACTION=default" -set "EXEC=" -set "MAKEOPTS=" - -goto get_arg -:next_arg -shift -:get_arg -if .%1.==.-?. goto help -if .%1.==./?. goto help -if .%1.==.-a. set "ACTION=all" & goto next_arg -if .%1.==.-d. set "ACTION=debug" & goto next_arg -if .%1.==.-f. set "FORCE=1" & goto next_arg -if .%1.==.-r. set "ACTION=release" & goto next_arg -if .%1.==.-X. set "EXEC=echo" & goto next_arg -set MAKEOPTS=%2 %3 %4 %5 %6 %7 %8 %9 -if "%FORCE%"=="1" set "MAKEOPTS=%MAKEOPTS% /A" -goto %ACTION% - -:help -echo. -echo..exe program builder from a C or C++ source -echo. -echo.Usage: exe [options] program [nmake_options] -echo. -echo.Options: -echo. -echo. -? Display this help page -echo. -a Builds all release ^& debug versions (default) -echo. -d Builds all debug versions only -echo. -f Force building all program targets, irrespective of file dates -echo. -r Builds all release versions only -echo. -X Display the make command generated and exit -echo. -echo.Notes: -echo.* exe myprog ^<==^> make myprog.exe debug\myprog.exe -echo.* This builds all possible OS targets -echo.* To force rebuilding all targets, irrespective of their date, -echo. use nmake option /A. So: exe -f myprog ^<==^> exe myprog /A -goto :eof - -:release -%EXEC% make %MAKEOPTS% %1.exe -goto :eof - -:debug -%EXEC% make %MAKEOPTS% debug\%1.exe -goto :eof - -:default -:all -%EXEC% make %MAKEOPTS% %1.exe debug\%1.exe -goto :eof diff --git a/deps/MsvcLibX/src/filetime.c b/deps/MsvcLibX/src/filetime.c index 7531ba3daa9aee9c2653559dd1b5d2da3bc1cf84..084b5eef671c0cc17135746bd7d7e7fb6ed68156 100644 --- a/deps/MsvcLibX/src/filetime.c +++ b/deps/MsvcLibX/src/filetime.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename filetime.c * * * @@ -9,17 +9,17 @@ * History: * * 2014-02-26 JFL Created this module. * * 2014-03-24 JFL Renamed "statx.h" as the standard . * -* 2014-07-03 JFL Filetime2String: Output time with s precision if possib. * +* 2014-07-03 JFL Filetime2String: Output time with �s precision if possib. * * 2016-09-13 JFL Fixed a warning. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #define _CRT_SECURE_NO_WARNINGS 1 /* Avoid Visual C++ security warnings */ -#include /* Define time_t */ -#include +#include "msvcTime.h" /* Define time_t */ +#include "sys/msvcStat.h" #ifdef _MSDOS @@ -230,7 +230,7 @@ struct tm *LocalFileTime(const time_t *pt) { } /* Generate a string with the local file time, in the ISO 8601 date/time format */ -/* 2014-07-03 Output time with s precision if possible */ +/* 2014-07-03 Output time with �s precision if possible */ char *Filetime2String(const FILETIME *pFT, char *pBuf, size_t nBufSize) { FILETIME lft; SYSTEMTIME sTime; @@ -246,7 +246,7 @@ char *Filetime2String(const FILETIME *pFT, char *pBuf, size_t nBufSize) { uli.LowPart = lft.dwLowDateTime; uli.HighPart = lft.dwHighDateTime; iFraction = (int)(uli.QuadPart % 10000000); /* FILETIME has 100ns resolution */ - iFraction /= 10; /* Convert 100ns resolution to 1s resolution */ + iFraction /= 10; /* Convert 100ns resolution to 1�s resolution */ wsprintf(pBuf+19, ".%06d", iFraction); } else if (nBufSize >= 24) { wsprintf(pBuf+19, ".%03d", sTime.wMilliseconds); diff --git a/deps/MsvcLibX/src/fnmatch.c b/deps/MsvcLibX/src/fnmatch.c index 20c22560089ea0383dbc9f72690585fc5a663e3d..d6f640f4c0529122b46b2826c0ded6e3d933e63e 100644 --- a/deps/MsvcLibX/src/fnmatch.c +++ b/deps/MsvcLibX/src/fnmatch.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: fnmatch.c * * * @@ -16,7 +16,7 @@ * 2014-02-28 JFL Added support for UTF-8 pathnames. * * 2014-03-05 JFL In debug mode, hide recursive calls. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -26,8 +26,8 @@ #include #include -#include "fnmatch.h" /* Include our associated .h, in the same dir as this .c. Do not use <>. */ -#include "debugm.h" +#include "msvcFnmatch.h" /* Include our associated .h, in the same dir as this .c. Do not use <>. */ +#include "msvcDebugm.h" #ifndef TRUE #define TRUE 1 diff --git a/deps/MsvcLibX/src/fstat.c b/deps/MsvcLibX/src/fstat.c index ba6a635bb0939fd9d7d187dba3accf3b9b329766..124eda81195c777f19cff89a08018cca13eb006e 100644 --- a/deps/MsvcLibX/src/fstat.c +++ b/deps/MsvcLibX/src/fstat.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename fstat.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-06-24 JFL Created this module. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -21,10 +21,10 @@ #include #include #include -/* MsvcLibX library extensions */ -#include -#include "debugm.h" #include +/* MsvcLibX library extensions */ +#include "sys/msvcStat.h" +#include "msvcDebugm.h" #if defined(_MSDOS) diff --git a/deps/MsvcLibX/src/fstat64.c b/deps/MsvcLibX/src/fstat64.c index de6a2c6dcd6cc817224baf414bd4bb978d87c092..5a54962c8833f24aa64e9b41038d2c91851f8da4 100644 --- a/deps/MsvcLibX/src/fstat64.c +++ b/deps/MsvcLibX/src/fstat64.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename fstat64.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-06-24 JFL Created this module. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/src/fstat64i32.c b/deps/MsvcLibX/src/fstat64i32.c index 6275260720a63d13d39c28dda82627851684866e..cb1dfd445dde9faeb69c6fda2b119d71579c487d 100644 --- a/deps/MsvcLibX/src/fstat64i32.c +++ b/deps/MsvcLibX/src/fstat64i32.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename fstat64i32.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-06-24 JFL Created this module. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/src/fullpath.c b/deps/MsvcLibX/src/fullpath.c index 8d94d159db4857c0c8a7176d94ff70080f8435af..1cc2bf42712c65912298168ddd39094e5bef4363 100644 --- a/deps/MsvcLibX/src/fullpath.c +++ b/deps/MsvcLibX/src/fullpath.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename fullpath.c * * * @@ -9,7 +9,7 @@ * History * * 2016-09-13 JFL Created this module with routine from truename.c. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -18,12 +18,12 @@ #define _UTF8_SOURCE /* Generate the UTF-8 version of routines */ #include -#include #include +#include "msvcLimits.h" #ifdef _WIN32 /* Automatically defined when targeting a Win32 application */ -#include /* Also includes MsvcLibX' WIN32 UTF-8 extensions */ +#include "msvcWindows.h" /* Also includes MsvcLibX' WIN32 UTF-8 extensions */ /*---------------------------------------------------------------------------*\ * * diff --git a/deps/MsvcLibX/src/getcwd.c b/deps/MsvcLibX/src/getcwd.c index b04127c211a7acd4bab0fb4c841a48b9aed180c3..314c59504a4ff9e299a02ecf8ce0880925803ff5 100644 --- a/deps/MsvcLibX/src/getcwd.c +++ b/deps/MsvcLibX/src/getcwd.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename getcwd.c * * * @@ -10,7 +10,7 @@ * 2014-02-28 JFL Created this module. * * 2014-07-02 JFL Added support for pathnames >= 260 characters. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -20,8 +20,9 @@ #include #include /* MsvcLibX library extensions */ -#include -#include "debugm.h" +#include "msvcUnistd.h" +#include "msvcDebugm.h" +#include "msvcLimits.h" #if defined(_MSDOS) diff --git a/deps/MsvcLibX/src/getopt.c b/deps/MsvcLibX/src/getopt.c index 81976204ccd3cd5eba6d62536dbae9abaf90f3f6..ba0b2ccb33eed34944fcb503c4ae5a763ed09fc2 100644 --- a/deps/MsvcLibX/src/getopt.c +++ b/deps/MsvcLibX/src/getopt.c @@ -1,4 +1,4 @@ -/*- +/*- * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. * @@ -40,7 +40,7 @@ #include #include #include -#include "getopt.h" +#include "msvcGetopt.h" #ifndef _DIAGASSERT #ifdef NDEBUG diff --git a/deps/MsvcLibX/src/getppid.c b/deps/MsvcLibX/src/getppid.c index 73f66e51443339e2e3768a96e7166f661a18e5ac..062beff3b040a1138767df727c1124a8b1db11cb 100644 --- a/deps/MsvcLibX/src/getppid.c +++ b/deps/MsvcLibX/src/getppid.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename getppid.c * * * @@ -17,11 +17,11 @@ * History: * * 2013-03-27 JFL Created this module. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ -#include +#include "msvcUnistd.h" #ifdef _WIN32 diff --git a/deps/MsvcLibX/src/gettimeofday.c b/deps/MsvcLibX/src/gettimeofday.c index 9cc548366b3602b662570889060f7e2ed976859f..b485edeb9ea805c06f119c7ce2dfa6d47850db29 100644 --- a/deps/MsvcLibX/src/gettimeofday.c +++ b/deps/MsvcLibX/src/gettimeofday.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename gettimeofday.c * * * @@ -9,14 +9,14 @@ * History * * 2014-06-04 JFL Created this file. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #include "msvclibx.h" -#include -#include +#include "msvcTime.h" +#include "sys/msvcTime.h" #ifdef _MSDOS /* MS-DOS only has a 1-second resolution on system time. diff --git a/deps/MsvcLibX/src/iconv.c b/deps/MsvcLibX/src/iconv.c index b60ed61029559ec87e8ba12990c216fc6c97165a..40b6e6462d9d0a6dc53509e8645cfba50b446256 100644 --- a/deps/MsvcLibX/src/iconv.c +++ b/deps/MsvcLibX/src/iconv.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename iconv.c * * * @@ -12,7 +12,7 @@ * 2015-12-09 JFL Added routines fputsU and vfprintfU. * * 2016-09-13 JFL Fixed warnings in fputsU. Do not change the input buffer. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -23,8 +23,9 @@ #include #include /* MsvcLibX library extensions */ -#include "iconv.h" -#include "debugm.h" +#include "msvcIconv.h" +#include "msvcDebugm.h" +#include "msvcLimits.h" #if defined(_MSDOS) diff --git a/deps/MsvcLibX/src/lstat.c b/deps/MsvcLibX/src/lstat.c index bd688c13b9166f0f716d7e27fecfa1dc69ed3796..e107fd87063a85b87d4ddc57d3b72f0c0ec880e6 100644 --- a/deps/MsvcLibX/src/lstat.c +++ b/deps/MsvcLibX/src/lstat.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename lstat.c * * * @@ -17,7 +17,7 @@ * 2014-03-24 JFL Renamed "statx.h" as the standard . * * 2014-06-30 JFL Added support for 32K Unicode paths. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -29,13 +29,14 @@ #include #include #include +#include /* MsvcLibX library extensions */ #include "msvclibx.h" -#include -#include -#include /* For ResolveLinks() definition */ -#include "debugm.h" -#include +#include +#include "msvcDirent.h" +#include "msvcUnistd.h" /* For ResolveLinks() definition */ +#include "msvcDebugm.h" +#include "msvcLimits.h" #if defined(_MSDOS) /* Make sure it's only defined it in one of the lstatxxx versions */ diff --git a/deps/MsvcLibX/src/lstat32.c b/deps/MsvcLibX/src/lstat32.c index 5486f45b8eb1e2698a9c33e26f938e4e30f21cef..67023ea2bd2ddf1fe3accd8086168ffee99d3944 100644 --- a/deps/MsvcLibX/src/lstat32.c +++ b/deps/MsvcLibX/src/lstat32.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename lstat32.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-02-14 JFL Created this module. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/src/lstat32i64.c b/deps/MsvcLibX/src/lstat32i64.c index 8eafed1d3eb5ec83cb6189ab8cc9146fe0be4762..483ff471a2253f333ecca71fc42302d8fec1e83a 100644 --- a/deps/MsvcLibX/src/lstat32i64.c +++ b/deps/MsvcLibX/src/lstat32i64.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename lstat32i64.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-02-14 JFL Created this module. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/src/lstat64.c b/deps/MsvcLibX/src/lstat64.c index b84b3271e34eb6f2bdc64f0901d006baf551524a..56cd0e91a9b143b647b46fac5219ea7099e5bced 100644 --- a/deps/MsvcLibX/src/lstat64.c +++ b/deps/MsvcLibX/src/lstat64.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename lstat.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-02-14 JFL Created this module. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/src/lstat64i32.c b/deps/MsvcLibX/src/lstat64i32.c index f5325d18327d18d9a3673fdaaf52742944cc7453..6c86979191aa96f6234635e2252bd443b338b090 100644 --- a/deps/MsvcLibX/src/lstat64i32.c +++ b/deps/MsvcLibX/src/lstat64i32.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename lstat64i32.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-02-14 JFL Created this module. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/src/main.c b/deps/MsvcLibX/src/main.c index 7c87c7fb7edf7d961110e32efeb4d076781cad75..f366b081ad688e15dc62dd0c8a7ccf9bb409afe0 100644 --- a/deps/MsvcLibX/src/main.c +++ b/deps/MsvcLibX/src/main.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename main.c * * * @@ -12,20 +12,20 @@ * 2017-02-05 JFL Redesigned to override libc's _setargv(). This avoids * * having to encapsulate the main() routine with one here. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #define _UTF8_SOURCE #define _CRT_SECURE_NO_WARNINGS /* Avoid depreciation warnings */ -#include #include "msvclibx.h" +#include "msvcStdio.h" #ifdef _WIN32 #include -#include /* For MsvcLibX' codePage global variable */ +#include "msvcIconv.h" /* For MsvcLibX' codePage global variable */ /*---------------------------------------------------------------------------*\ * * diff --git a/deps/MsvcLibX/src/make.bat b/deps/MsvcLibX/src/make.bat deleted file mode 100644 index 7a272561228129410dcba670dee0ddb723553647..0000000000000000000000000000000000000000 --- a/deps/MsvcLibX/src/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@echo off -:#***************************************************************************** -:# * -:# Filename: make.bat * -:# * -:# Description: Build DOS and Windows targets * -:# * -:# Notes: Proxy script for %STINCLUDE%\make.bat. * -:# * -:# If any change is needed, put it in %STINCLUDE%\make.bat. * -:# * -:# History: * -:# 2016-10-10 JFL jf.larvoire@hpe.com created this file. * -:# 2016-12-15 JFL Search for the real make.bat in [.|..|../..]\include. * -:# * -:# Copyright 2016 Hewlett Packard Enterprise Development LP * -:# Licensed under the Apache 2.0 license www.apache.org/licenses/LICENSE-2.0 * -:#***************************************************************************** - -:# Get the full pathname of the STINCLUDE library directory -if defined STINCLUDE if not exist "%STINCLUDE%\make.bat" set "STINCLUDE=" &:# Allow overriding with another alias name, but ignore invalid overrides -for %%p in (. .. ..\..) do if not defined STINCLUDE if exist %%p\include\make.bat ( :# Default: Search it the current directory, and 2 levels above. - for /f "delims=" %%d in ('"pushd %%p\include & cd & popd"') do SET "STINCLUDE=%%d" -) -if not defined STINCLUDE ( :# Try getting the copy in the master environment - for /f "tokens=3" %%v in ('reg query "HKCU\Environment" /v STINCLUDE 2^>NUL') do set "STINCLUDE=%%v" -) - -if not exist %STINCLUDE%\make.bat ( - >&2 echo %0 Error: Cannot find SysToolsLib's global C include directory. Please define variable STINCLUDE. - exit /b 1 -) - -if [%1]==[-d] echo "%STINCLUDE%\make.bat" %* -"%STINCLUDE%\make.bat" %* diff --git a/deps/MsvcLibX/src/mb2wpath.c b/deps/MsvcLibX/src/mb2wpath.c index a41ff75d94f578dc9eff8e3fdb94c638268dfff3..097d3e736717dd54b9e9558f18fca51707bef1d3 100644 --- a/deps/MsvcLibX/src/mb2wpath.c +++ b/deps/MsvcLibX/src/mb2wpath.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename mb2wpath.c * * * @@ -10,14 +10,14 @@ * History: * * 2014-07-01 JFL Created this module. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #define _UTF8_SOURCE /* Generate the UTF-8 version of printf routines */ #include "msvclibx.h" -#include "debugm.h" +#include "msvcDebugm.h" #if defined(_WIN32) diff --git a/deps/MsvcLibX/src/mkdir.c b/deps/MsvcLibX/src/mkdir.c index e83f4c1773cff3134f6852501f2864ba61f152dc..24e98a52ba806374b584d79730e2449295bd4380 100644 --- a/deps/MsvcLibX/src/mkdir.c +++ b/deps/MsvcLibX/src/mkdir.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename mkdir.c * * * @@ -11,7 +11,7 @@ * 2014-03-24 JFL Renamed "statx.h" as the standard . * * 2014-07-02 JFL Added support for pathnames >= 260 characters. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -22,8 +22,9 @@ #include /* For _mkdir() */ #include /* MsvcLibX library extensions */ -#include +#include #include "msvclibx.h" +#include "msvcLimits.h" #ifdef _WIN32 diff --git a/deps/MsvcLibX/src/mkdtemp.c b/deps/MsvcLibX/src/mkdtemp.c index 602cdd4b5524d03fe28846a8cb8cfa22bd808b46..86bfbf25cfb2a825f1d2d90aeb8d54ba9506088d 100644 --- a/deps/MsvcLibX/src/mkdtemp.c +++ b/deps/MsvcLibX/src/mkdtemp.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename mkdtemp.c * * * @@ -9,15 +9,15 @@ * History: * * 2014-02-13 JFL Created this module. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ -#include #include #include #include #include +#include "msvcUnistd.h" char *mkdtemp(char *pszName) { char *pszXXX, *pc; diff --git a/deps/MsvcLibX/src/mkstemp.c b/deps/MsvcLibX/src/mkstemp.c index ab576b65421b18a24deb6eafe89de24e870dbdd5..f587cff48d35a631dd2e963468f5e32cd32a8396 100644 --- a/deps/MsvcLibX/src/mkstemp.c +++ b/deps/MsvcLibX/src/mkstemp.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename mkstemp.c * * * @@ -9,13 +9,13 @@ * History: * * 2014-03-03 JFL Created this module. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #define _CRT_SECURE_NO_WARNINGS 1 /* Avoid Visual C++ security warnings */ -#include +#include "msvcUnistd.h" #include #include #include diff --git a/deps/MsvcLibX/src/open.c b/deps/MsvcLibX/src/open.c index 8876ff43eb2f248e7f4c3e551ba1d1e609308f62..dd70409410f6db9b03f2496e12831364139bad3a 100644 --- a/deps/MsvcLibX/src/open.c +++ b/deps/MsvcLibX/src/open.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename open.c * * * @@ -9,7 +9,7 @@ * History: * * 2017-02-16 JFL Created this module. * * * -* Copyright 2017 Hewlett Packard Enterprise Development LP * +* Copyright 2017 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -19,8 +19,9 @@ #include #include "msvclibx.h" -#include "fcntl.h" -#include "debugm.h" +#include "msvcFcntl.h" +#include "msvcDebugm.h" +#include "msvcLimits.h" #ifdef _WIN32 diff --git a/deps/MsvcLibX/src/readlink.c b/deps/MsvcLibX/src/readlink.c index d7c728c9fc6bfcba32b77e68cd997ba325e5635c..4abc91e8e22acef502236c530423b54683652913 100644 --- a/deps/MsvcLibX/src/readlink.c +++ b/deps/MsvcLibX/src/readlink.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename readlink.c * * * @@ -19,7 +19,7 @@ * 2014-07-03 JFL Added support for pathnames >= 260 characters. * * 2016-09-09 JFL Fixed a crash in debug mode, due to stack overflows. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -27,16 +27,17 @@ #define _UTF8_SOURCE /* Generate the UTF-8 version of routines */ -#include +#include "msvcUnistd.h" #pragma comment(lib, "Mpr.lib") #include -#include "debugm.h" +#include "msvcDebugm.h" +#include "msvcLimits.h" #ifdef _WIN32 #include -#include "reparsept.h" +#include "msvcReparsept.h" /* Get the Reparse Point Tag for a mount point - Wide char version */ /* See http://msdn.microsoft.com/en-us/library/windows/desktop/aa365511(v=vs.85).aspx */ diff --git a/deps/MsvcLibX/src/realpath.c b/deps/MsvcLibX/src/realpath.c index 8d60c9f554367ad79aa7d778471d06c030378197..5fbcf773a24d0950ac8099cd9274fcbb3157a954 100644 --- a/deps/MsvcLibX/src/realpath.c +++ b/deps/MsvcLibX/src/realpath.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename realpath.c * * * @@ -23,7 +23,7 @@ * Convert short WIN32 paths to long paths. * * 2016-09-13 JFL Resize output buffers, to avoid wasting lots of memory. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -31,13 +31,15 @@ #define _UTF8_SOURCE /* Generate the UTF-8 version of routines */ -#include #include #include #include #include /* For _getdcwd() */ #include /* For toupper() */ -#include "debugm.h" +#include "msvcDebugm.h" +#include "msvcLimits.h" +#include "msvcUnistd.h" +#include "msvcWindows.h" #define TRUE 1 #define FALSE 0 diff --git a/deps/MsvcLibX/src/spawn.c b/deps/MsvcLibX/src/spawn.c index ab70172b3e0e3212c990c013bfee6e94a3ac3125..1dede9b712c7f12597ff9a61238ba9c4ea461089 100644 --- a/deps/MsvcLibX/src/spawn.c +++ b/deps/MsvcLibX/src/spawn.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename spawn.c * * * @@ -10,7 +10,7 @@ * 2014-03-27 JFL Created this module. * * 2014-07-03 JFL Added support for pathnames >= 260 characters. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -19,8 +19,9 @@ /* Microsoft C libraries include files */ #include /* MsvcLibX library extensions */ -#include "debugm.h" +#include "msvcDebugm.h" #include "msvclibx.h" +#include "msvcLimits.h" #ifdef _WIN32 diff --git a/deps/MsvcLibX/src/src2objs.bat b/deps/MsvcLibX/src/src2objs.bat deleted file mode 100644 index b840e308c4f6a6c824bda023eb3907665f95f0d2..0000000000000000000000000000000000000000 --- a/deps/MsvcLibX/src/src2objs.bat +++ /dev/null @@ -1,125 +0,0 @@ -@echo off -:****************************************************************************** -:* * -:* Filename: src2objs.bat * -:* * -:* Description: Generate object files names from source files names * -:* * -:* Notes: * -:* * -:* History: * -:* 2010-04-07 JFL Created this batch. * -:* * -:# Copyright 2016 Hewlett Packard Enterprise Development LP * -:# Licensed under the Apache 2.0 license www.apache.org/licenses/LICENSE-2.0 * -:****************************************************************************** - -setlocal 2>NUL -set ARG0=%0 - -:# Mechanism for calling subroutines. Done by {call %0 _call_ label [arguments]}. -if .%1.==._call_. shift /2 & goto %2 -set CALL=call %0 _call_ -set RETURN=goto end -:# Silent return. Used for routines silently called via call :label. -set _RETURN=goto _end -set PUTVARS=call :putvars - -:# Set global defaults -setlocal -set OUTFILE=obj\objects.mak -set OUTPATH=obj -set NO_EXEC=0 -goto get_args - -:help -echo Generate object files names from source files names -echo. -echo Usage: %ARG0% [options] source ... -echo. -echo Options: -echo -?^|-h This help -echo -o {pathname} Output file pathname. Default: %OUTFILE% -echo -X Display object files names, but do not create the output file -goto end - -:get_args -if .%1.==.. goto help -if .%1.==.-?. goto help -if .%1.==./?. goto help -if %1==-o shift & goto set_out -if %1==-X shift & goto no_exec -goto go - -:set_out -set OUTFILE=%1 -:# Split the path. Uses a fake drive @ to prevent prepending the current path on an existing drive. -for %%F in (@:"%OUTFILE%") do ( - set "OUTPATH=%%~dpF" -) -:# Remove the head "@:\ and tail \ to the path -set "OUTPATH=%OUTPATH:~4,-1%" -shift -goto get_args - -:no_exec -set NO_EXEC=1 -goto get_args - -:# Check prerequisites -:check -verify other 2>nul -setlocal enableextensions -if errorlevel 1 ( - echo>&2 Error: Unable to enable command extensions. - exit /b 1 -) -set VAR=before -if "%VAR%" == "before" ( - set VAR=after - if not "!VAR!" == "after" ( - echo>&2 Error: Delayed environment variable expansion must be enabled. - echo>&2 Please restart your cmd.exe shell with the /V option, - echo>&2 or set HKLM\Software\Microsoft\Command Processor\DelayedExpansion=1 - exit /b 1 - ) -) -%_RETURN% - -:go -%CALL% check -if errorlevel 1 exit /b 1 -set OBJECTS= -:next -if .%1.==.. goto done -for %%s in (%1) do ( - set EXT=%%~xs - set OBJ= - if .!EXT!.==..c. set OBJ=obj - if .!EXT!.==..C. set OBJ=obj - if .!EXT!.==..cpp. set OBJ=obj - if .!EXT!.==..CPP. set OBJ=obj - if .!EXT!.==..asm. set OBJ=obj - if .!EXT!.==..ASM. set OBJ=obj - if .!EXT!.==..rc. set OBJ=res - if .!EXT!.==..RC. set OBJ=res - if .!OBJ!.==.. ( - echo>&2 Error: Unsupported source type: !EXT! - echo>&2 Please add a conversion rule in %ARG0% - ) else ( - if .!OBJECTS!.==.. ( - set OBJECTS=%OUTPATH%\%%~ns.!OBJ! - ) else ( - set OBJECTS=!OBJECTS! %OUTPATH%\%%~ns.!OBJ! - ) - ) -) -shift -goto next -:done -echo OBJECTS=%OBJECTS% -if %NO_EXEC%==0 echo>%OUTFILE% OBJECTS=%OBJECTS% - -:end -:_end - diff --git a/deps/MsvcLibX/src/strerror.c b/deps/MsvcLibX/src/strerror.c index 2f8f3248290738c7c0819aa33308101e23209d48..a10fc45753bae73043e051cedc434204eeb832b8 100644 --- a/deps/MsvcLibX/src/strerror.c +++ b/deps/MsvcLibX/src/strerror.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename strerror.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-03-06 JFL Created this module. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/src/strndup.c b/deps/MsvcLibX/src/strndup.c index 5f68b8e5fcbace69990d0e0dd1a20fe7ade46162..2c75cb9ed58b946620dd43875d2f72245d810145 100644 --- a/deps/MsvcLibX/src/strndup.c +++ b/deps/MsvcLibX/src/strndup.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename strndup.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-02-13 JFL Created this module. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/src/strptime.c b/deps/MsvcLibX/src/strptime.c index 142a2408ddd94521dd33d23d24f20b9695be4fca..716b573a345884b76b73e4b6c006846bcce371cf 100644 --- a/deps/MsvcLibX/src/strptime.c +++ b/deps/MsvcLibX/src/strptime.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename strptime.c * * * diff --git a/deps/MsvcLibX/src/symlink.c b/deps/MsvcLibX/src/symlink.c index e791cea35aa15725e7e94125fe300e4bce1b6a32..ce2bbe58a26deb1a61936b9d0ef5a26d24cf7731 100644 --- a/deps/MsvcLibX/src/symlink.c +++ b/deps/MsvcLibX/src/symlink.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename symlink.c * * * @@ -19,7 +19,7 @@ * do not support symlinks. * * 2016-08-25 JFL Fixed two warnings. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -27,17 +27,18 @@ #define _UTF8_SOURCE /* Generate the UTF-8 version of routines */ -#include +#include "msvcUnistd.h" #pragma comment(lib, "Mpr.lib") #include -#include "debugm.h" +#include "msvcDebugm.h" +#include "msvcLimits.h" #ifdef _WIN32 #include -#include "reparsept.h" +#include "msvcReparsept.h" /*---------------------------------------------------------------------------*\ * * diff --git a/deps/MsvcLibX/src/uname.c b/deps/MsvcLibX/src/uname.c index 10baef0fe62de87498d3c11788ee679dc8ccaf13..afa2ef0d5e0b25e4ba7c04f71f2fe3b8c2a10cf3 100644 --- a/deps/MsvcLibX/src/uname.c +++ b/deps/MsvcLibX/src/uname.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: uname.c * * * @@ -17,11 +17,11 @@ * History: * * 2014-05-30 JFL Created this file. * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ -#include "sys/utsname.h" +#include "sys/msvcTsname.h" #include /* For itoa() */ static char major[4] = {0}; diff --git a/deps/MsvcLibX/src/utime.c b/deps/MsvcLibX/src/utime.c index c365ae9f60f1713f455648336958e8c32eedeb42..cbddfecb01f9dd858a9ef03d9da7107c7116de15 100644 --- a/deps/MsvcLibX/src/utime.c +++ b/deps/MsvcLibX/src/utime.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename utime.c * * * @@ -13,7 +13,7 @@ * 2014-07-02 JFL Added support for pathnames >= 260 characters. * * 2016-08-25 JFL Added missing routine utimeA(). * * * -* Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -22,10 +22,10 @@ #define _CRT_SECURE_NO_WARNINGS 1 /* Avoid Visual C++ security warnings */ #include -#include /* Must be included before any direct or indirect inclusion */ -#include - -#include "debugm.h" +#include "sys/msvcTime.h" /* Must be included before any direct or indirect inclusion */ +#include "msvcUtime.h" +#include "msvcDebugm.h" +#include "msvcLimits.h" #if defined(_DEBUG) #include @@ -35,7 +35,7 @@ #include #include /* For MSVC's _get_osfhandle() */ -#include /* For MsvcLibX's ResolveLinks() */ +#include "msvcUnistd.h" /* For MsvcLibX's ResolveLinks() */ /* Convert a Windows FILETIME to a Unix time_t. A FILETIME is the number of 100-nanosecond intervals since January 1, 1601. diff --git a/deps/MsvcLibX/src/utimes.c b/deps/MsvcLibX/src/utimes.c index 482883b87b9fbebab6cad7b0cd1a1391746aaae6..9326bb5f74283abb59389a44300f621f2b79ff52 100644 --- a/deps/MsvcLibX/src/utimes.c +++ b/deps/MsvcLibX/src/utimes.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename utimes.c * * * @@ -14,7 +14,7 @@ * 2014-06-04 JFL Added handling of UTIME_NOW and UTIME_OMIT. * * 2014-07-02 JFL Added support for pathnames >= 260 characters. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -23,10 +23,10 @@ #define _CRT_SECURE_NO_WARNINGS 1 /* Avoid Visual C++ security warnings */ #include -#include /* Must be included before any direct or indirect inclusion */ -#include - -#include "debugm.h" +#include "sys/msvcTime.h" /* Must be included before any direct or indirect inclusion */ +#include "sys/msvcStat.h" +#include "msvcDebugm.h" +#include "msvcLimits.h" #if defined(_DEBUG) #include @@ -36,7 +36,7 @@ #include #include /* For MSVC's _get_osfhandle() */ -#include /* For MsvcLibX's ResolveLinks() */ +#include "msvcUnistd.h" /* For MsvcLibX's ResolveLinks() */ DEBUG_CODE( int Timeval2String(char *buf, size_t bufsize, const struct timeval *tvp) { @@ -64,7 +64,7 @@ void Filetime2Timeval(const FILETIME *pFT, struct timeval *ptv) { ULARGE_INTEGER ull; ull.LowPart = pFT->dwLowDateTime; ull.HighPart = pFT->dwHighDateTime; - ptv->tv_sec = ull.QuadPart / 10000000ULL - 11644473600ULL; + ptv->tv_sec = (long)(ull.QuadPart / 10000000ULL - 11644473600ULL); ptv->tv_usec = (int32_t)((ull.QuadPart % 10000000ULL)/10); } diff --git a/deps/MsvcLibX/src/xfreopen.c b/deps/MsvcLibX/src/xfreopen.c index 724fb8e13b4e09119e23cb37692e8c2ca9eb6d3a..80311bbac6d1e1900785bb2fde3fc570e3808fbd 100644 --- a/deps/MsvcLibX/src/xfreopen.c +++ b/deps/MsvcLibX/src/xfreopen.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename xfreopen.c * * * @@ -18,7 +18,7 @@ #include #include #include -#include "xfreopen.h" +#include "msvcXfreopen.h" FILE *xfreopen(const char *filename, const char *mode, FILE *stream) { int iMode = 0; diff --git a/deps/iconv/relocatable.c b/deps/iconv/relocatable.c index 79906a399c7af9a1e078c4a3e53bd52d0efe8537..5676eb703faac0e2b9511586df3f0f772c0fce6e 100644 --- a/deps/iconv/relocatable.c +++ b/deps/iconv/relocatable.c @@ -360,7 +360,7 @@ find_shared_library_fullname () ungetc (c, fp); shared_library_fullname = NULL; size = 0; - len = getline (&shared_library_fullname, &size, fp); + len = getline(&shared_library_fullname, &size, fp); if (len >= 0) { /* Success: filled shared_library_fullname. */ diff --git a/deps/pthread/pthread.h b/deps/pthread/pthread.h index e08bf22abcdfc003505e1a3055c84b0d8fd5cd58..87673398d029fd7804f40746308288720a490ba6 100644 --- a/deps/pthread/pthread.h +++ b/deps/pthread/pthread.h @@ -228,6 +228,8 @@ typedef unsigned long ULONG_PTR; #include "config.h" #endif /* HAVE_PTW32_CONFIG_H */ +#include "msvcTime.h" + #if !defined(NEED_FTIME) #include #else /* NEED_FTIME */ diff --git a/deps/pthread/sched.h b/deps/pthread/sched.h index 8c1096d887a0ddb35bb5adea0e557075f0a95bf7..d9bcc2d27f02080434365e0619cc5e54f7fe8b78 100644 --- a/deps/pthread/sched.h +++ b/deps/pthread/sched.h @@ -100,18 +100,19 @@ #endif #endif /* PTW32_SCHED_LEVEL >= PTW32_SCHED_LEVEL_MAX */ -#if (defined(__MINGW64__) || defined(__MINGW32__)) || defined(_UWIN) -# if PTW32_SCHED_LEVEL >= PTW32_SCHED_LEVEL_MAX -/* For pid_t */ -# include -/* Required by Unix 98 */ -# include -# else - typedef int pid_t; -# endif -#else - typedef int pid_t; -#endif +// #if (defined(__MINGW64__) || defined(__MINGW32__)) || defined(_UWIN) +// # if PTW32_SCHED_LEVEL >= PTW32_SCHED_LEVEL_MAX +// /* For pid_t */ +// # include +// /* Required by Unix 98 */ +// # include +// # else +// typedef int pid_t; +// # endif +// #else +// typedef int pid_t; +// #endif +#include /* Thread scheduling policies */ diff --git a/deps/pthread/semaphore.h b/deps/pthread/semaphore.h index ecc29fc33d289c6c1caff0e57dbd33b321ada563..9714365b613badd1371a1731c0d421f43f633b24 100644 --- a/deps/pthread/semaphore.h +++ b/deps/pthread/semaphore.h @@ -99,6 +99,8 @@ #endif #endif /* PTW32_SEMAPHORE_LEVEL >= PTW32_SEMAPHORE_LEVEL_MAX */ +#include "sys/msvcTypes.h" + #define _POSIX_SEMAPHORES #if defined(__cplusplus) diff --git a/documentation20/webdocs/markdowndocs/TAOS SQL-ch.md b/documentation20/webdocs/markdowndocs/TAOS SQL-ch.md index 3cf811ab66b3280f7ee8194acfbc9864d98cc90e..6c6a3afb6031d095db12fc52297c205a2bafd3c3 100644 --- a/documentation20/webdocs/markdowndocs/TAOS SQL-ch.md +++ b/documentation20/webdocs/markdowndocs/TAOS SQL-ch.md @@ -157,7 +157,7 @@ TDengine缺省的时间戳是毫秒精度,但通过修改配置参数enableMic ```mysql DROP TABLE [IF EXISTS] stb_name; ``` - 删除STable会自动删除通过STable创建的字表。 + 删除STable会自动删除通过STable创建的子表。 - **显示当前数据库下的所有超级表信息** @@ -206,7 +206,7 @@ TDengine缺省的时间戳是毫秒精度,但通过修改配置参数enableMic ``` 修改超级表的标签名,从超级表修改某个标签名后,该超级表下的所有子表也会自动更新该标签名。 -- **修改字表标签值** +- **修改子表标签值** ```mysql ALTER TABLE tb_name SET TAG tag_name=new_tag_value; diff --git a/src/client/inc/tscUtil.h b/src/client/inc/tscUtil.h index 590f205e1da87d3bc434f374b6c173905a46c184..b15286fe80fb2eb58237e1feec52b1b5e4238c57 100644 --- a/src/client/inc/tscUtil.h +++ b/src/client/inc/tscUtil.h @@ -53,12 +53,18 @@ typedef struct SParsedDataColInfo { bool hasVal[TSDB_MAX_COLUMNS]; } SParsedDataColInfo; +#pragma pack(push,1) +// this struct is transfered as binary, padding two bytes to avoid +// an 'uid' whose low bytes is 0xff being recoginized as NULL, +// and set 'pack' to 1 to avoid break existing code. typedef struct STidTags { + int16_t padding; int64_t uid; int32_t tid; int32_t vgId; char tag[]; } STidTags; +#pragma pack(pop) typedef struct SJoinSupporter { SSubqueryState* pState; @@ -224,6 +230,7 @@ int32_t tscAddSubqueryInfo(SSqlCmd *pCmd); void tscInitQueryInfo(SQueryInfo* pQueryInfo); void tscClearSubqueryInfo(SSqlCmd* pCmd); +void tscFreeVgroupTableInfo(SArray* pVgroupTables); int tscGetSTableVgroupInfo(SSqlObj* pSql, int32_t clauseIndex); int tscGetTableMeta(SSqlObj* pSql, STableMetaInfo* pTableMetaInfo); diff --git a/src/client/src/tscFunctionImpl.c b/src/client/src/tscFunctionImpl.c index d1f5b510a4917e7de83191e0dd3d8f8802a5cf0c..9c0951cdd6b65c9682203c75f76756fc963e75f9 100644 --- a/src/client/src/tscFunctionImpl.c +++ b/src/client/src/tscFunctionImpl.c @@ -169,7 +169,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI // (uid, tid) + VGID + TAGSIZE + VARSTR_HEADER_SIZE if (functionId == TSDB_FUNC_TID_TAG) { // todo use struct *type = TSDB_DATA_TYPE_BINARY; - *bytes = (int16_t)(dataBytes + sizeof(int64_t) + sizeof(int32_t) + sizeof(int32_t) + VARSTR_HEADER_SIZE); + *bytes = (int16_t)(dataBytes + sizeof(int16_t) + sizeof(int64_t) + sizeof(int32_t) + sizeof(int32_t) + VARSTR_HEADER_SIZE); *interBytes = *bytes; return TSDB_CODE_SUCCESS; } diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 4d4254fa46b83af5cb2ab28c822964a650f952e5..33907104723df6a1a7fa6705a3cd024b9b282554 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -912,7 +912,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) { pSql->cmd.msgType = TSDB_MSG_TYPE_QUERY; pQueryMsg->head.contLen = htonl(msgLen); - assert(msgLen + minMsgSize() <= size); + assert(msgLen + minMsgSize() <= (int32_t)pCmd->allocSize); return TSDB_CODE_SUCCESS; } diff --git a/src/client/src/tscSub.c b/src/client/src/tscSub.c index 81d73236a4e9972ac4401ebbb7a5815ebe0feb4b..e9f2c1dc1dfbd975ccdefb759bdf120d805cb335 100644 --- a/src/client/src/tscSub.c +++ b/src/client/src/tscSub.c @@ -230,6 +230,19 @@ static SArray* getTableList( SSqlObj* pSql ) { return result; } +static int32_t compareTidTag(const void* p1, const void* p2) { + const STidTags* t1 = (const STidTags*)p1; + const STidTags* t2 = (const STidTags*)p2; + + if (t1->vgId != t2->vgId) { + return (t1->vgId > t2->vgId) ? 1 : -1; + } + if (t1->tid != t2->tid) { + return (t1->tid > t2->tid) ? 1 : -1; + } + return 0; +} + static int tscUpdateSubscription(STscObj* pObj, SSub* pSub) { SSqlObj* pSql = pSub->pSql; @@ -270,7 +283,8 @@ static int tscUpdateSubscription(STscObj* pObj, SSub* pSub) { pSub->progress = progress; if (UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo)) { - taosArraySort( tables, tscCompareTidTags ); + taosArraySort( tables, compareTidTag ); + tscFreeVgroupTableInfo(pTableMetaInfo->pVgroupTables); tscBuildVgroupTableInfo(pSql, pTableMetaInfo, tables); } taosArrayDestroy(tables); @@ -410,6 +424,9 @@ TAOS_RES *taos_consume(TAOS_SUB *tsub) { } } + size_t size = taosArrayGetSize(pSub->progress) * sizeof(STableIdInfo); + size += sizeof(SQueryTableMsg) + 4096; + tscAllocPayload(&pSql->cmd, (int)size); for (int retry = 0; retry < 3; retry++) { tscRemoveFromSqlList(pSql); diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c index 878fdd500f378ea9059e357868d20a81b7e65f6f..c742db42ab530f23d49db86d8221d9c4b4b4da6f 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -164,7 +164,8 @@ void taos_cleanup() { taosCleanUpScheduler(tscQhandle); tscQhandle = NULL; } - + + taosCleanupKeywordsTable(); taosCloseLog(); taosTmrCleanUp(tscTmr); diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index c74cc82f85b2cc784a17ade8a53eca6286d41707..1b6d18be0cdb4b9e6978d8855f7069522de3a064 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -1556,12 +1556,22 @@ void tscClearSubqueryInfo(SSqlCmd* pCmd) { } } +void tscFreeVgroupTableInfo(SArray* pVgroupTables) { + if (pVgroupTables != NULL) { + for (size_t i = 0; i < taosArrayGetSize(pVgroupTables); i++) { + SVgroupTableInfo* pInfo = taosArrayGet(pVgroupTables, i); + taosArrayDestroy(pInfo->itemList); + } + taosArrayDestroy(pVgroupTables); + } +} + void clearAllTableMetaInfo(SQueryInfo* pQueryInfo, const char* address, bool removeFromCache) { tscDebug("%p deref the table meta in cache, numOfTables:%d", address, pQueryInfo->numOfTables); for(int32_t i = 0; i < pQueryInfo->numOfTables; ++i) { STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, i); - + tscFreeVgroupTableInfo(pTableMetaInfo->pVgroupTables); tscClearTableMetaInfo(pTableMetaInfo, removeFromCache); free(pTableMetaInfo); } @@ -1931,6 +1941,7 @@ int16_t tscGetJoinTagColIdByUid(STagCond* pTagCond, uint64_t uid) { return pTagCond->joinInfo.right.tagColId; } else { assert(0); + return -1; } } diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index c20061d11b76c452b5c64dba337a59f3466b6759..0d7df38b832b03fdc5e4cdf5ab0bc684e3d1d8e8 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -147,12 +147,12 @@ int32_t tsMonitorInterval = 30; // seconds // internal int32_t tscEmbedded = 0; -char configDir[TSDB_FILENAME_LEN] = "/etc/taos"; +char configDir[TSDB_FILENAME_LEN] = {0}; char tsVnodeDir[TSDB_FILENAME_LEN] = {0}; char tsDnodeDir[TSDB_FILENAME_LEN] = {0}; char tsMnodeDir[TSDB_FILENAME_LEN] = {0}; -char tsDataDir[TSDB_FILENAME_LEN] = "/var/lib/taos"; -char tsScriptDir[TSDB_FILENAME_LEN] = "/etc/taos"; +char tsDataDir[TSDB_FILENAME_LEN] = {0}; +char tsScriptDir[TSDB_FILENAME_LEN] = {0}; char tsVnodeBakDir[TSDB_FILENAME_LEN] = {0}; /* @@ -295,6 +295,7 @@ bool taosCfgDynamicOptions(char *msg) { } static void doInitGlobalConfig(void) { + osInit(); SGlobalCfg cfg = {0}; // ip address diff --git a/src/kit/shell/src/shellDarwin.c b/src/kit/shell/src/shellDarwin.c index 3cb324abe93416dc11fbd7ee00d2db3b73d906d3..ce41827462366777d249a2e58c5fd6fec3fbb0e3 100644 --- a/src/kit/shell/src/shellDarwin.c +++ b/src/kit/shell/src/shellDarwin.c @@ -62,7 +62,7 @@ void printHelp() { exit(EXIT_SUCCESS); } -void shellParseArgument(int argc, char *argv[], struct arguments *arguments) { +void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { wordexp_t full_path; for (int i = 1; i < argc; i++) { // for host diff --git a/src/kit/shell/src/shellEngine.c b/src/kit/shell/src/shellEngine.c index 5d877ba6f06135bfaee12fe1bbd1bbf6739a1dce..750335a0379f3c1474ca15f823d15f43cd99224e 100644 --- a/src/kit/shell/src/shellEngine.c +++ b/src/kit/shell/src/shellEngine.c @@ -577,7 +577,7 @@ static int verticalPrintResult(TAOS_RES* tres) { int maxColNameLen = 0; for (int col = 0; col < num_fields; col++) { - int len = strlen(fields[col].name); + int len = (int)strlen(fields[col].name); if (len > maxColNameLen) { maxColNameLen = len; } @@ -604,9 +604,8 @@ static int verticalPrintResult(TAOS_RES* tres) { return numOfRows; } - static int calcColWidth(TAOS_FIELD* field, int precision) { - int width = strlen(field->name); + int width = (int)strlen(field->name); switch (field->type) { case TSDB_DATA_TYPE_BOOL: @@ -741,7 +740,7 @@ void read_history() { return; } - while ((read_size = getline(&line, &line_size, f)) != -1) { + while ((read_size = taosGetline(&line, &line_size, f)) != -1) { line[read_size - 1] = '\0'; history.hist[history.hend] = strdup(line); @@ -822,7 +821,7 @@ void source_file(TAOS *con, char *fptr) { return; } - while ((read_len = getline(&line, &line_len, f)) != -1) { + while ((read_len = taosGetline(&line, &line_len, f)) != -1) { if (read_len >= tsMaxSQLStringLen) continue; line[--read_len] = '\0'; diff --git a/src/kit/shell/src/shellWindows.c b/src/kit/shell/src/shellWindows.c index 8a7996d6825626e7bd8ed51c429916cba541ac79..7297f2393143fc935109b1e7bac5fac7b6910c80 100644 --- a/src/kit/shell/src/shellWindows.c +++ b/src/kit/shell/src/shellWindows.c @@ -9,12 +9,16 @@ * * ****************************************************************/ -#include "shell.h" #include #include #include +#include "os.h" +#include "shell.h" +#include "taos.h" #include "shellCommand.h" +extern char configDir[]; + void printHelp() { char indent[10] = " "; printf("taos shell is used to test the TDEngine database\n"); @@ -43,7 +47,7 @@ void printHelp() { exit(EXIT_SUCCESS); } -void shellParseArgument(int argc, char *argv[], struct arguments *arguments) { +void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { for (int i = 1; i < argc; i++) { // for host if (strcmp(argv[i], "-h") == 0) { @@ -81,7 +85,7 @@ void shellParseArgument(int argc, char *argv[], struct arguments *arguments) { fprintf(stderr, "config file path: %s overflow max len %d\n", argv[i], TSDB_FILENAME_LEN - 1); exit(EXIT_FAILURE); } - strcpy(configDir, argv[i]); + strcpy(configDir, argv[++i]); } else { fprintf(stderr, "Option -c requires an argument\n"); exit(EXIT_FAILURE); diff --git a/src/kit/taosdemo/CMakeLists.txt b/src/kit/taosdemo/CMakeLists.txt index a13bb767fcf8f78bac4f79217992a4d30413d761..1698c8591541157a8ecb2339a19273a375c03a40 100644 --- a/src/kit/taosdemo/CMakeLists.txt +++ b/src/kit/taosdemo/CMakeLists.txt @@ -13,5 +13,8 @@ IF (TD_LINUX) # ELSE () # TARGET_LINK_LIBRARIES(taosdemo taos_static) # ENDIF () - +ELSEIF (TD_WINDOWS) + AUX_SOURCE_DIRECTORY(. SRC) + ADD_EXECUTABLE(taosdemo ${SRC}) + TARGET_LINK_LIBRARIES(taosdemo taos_static) ENDIF () diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index 21e5b963c8a57d4a84297663e60ab5142109bda6..9d46ac505551aae46178eabf43f6e4f25a99ec5a 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2019 TAOS Data, Inc. * * This program is free software: you can use, redistribute, and/or modify @@ -15,24 +15,31 @@ #define _GNU_SOURCE -#include -#include -#include - -#ifndef _ALPINE -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#ifdef LINUX + #include "os.h" + #include + #include + #include + #ifndef _ALPINE + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#else + #include + #include + #include + #include "os.h" +#endif #include "taos.h" #include "tutil.h" @@ -48,32 +55,6 @@ extern char configDir[]; #define STRING_LEN 60000 #define MAX_PREPARED_RAND 1000000 -/* The options we understand. */ -static struct argp_option options[] = { - {0, 'h', "host", 0, "The host to connect to TDEngine. Default is localhost.", 0}, - {0, 'p', "port", 0, "The TCP/IP port number to use for the connection. Default is 0.", 1}, - {0, 'u', "user", 0, "The TDEngine user name to use when connecting to the server. Default is 'root'.", 2}, - {0, 'P', "password", 0, "The password to use when connecting to the server. Default is 'taosdata'.", 3}, - {0, 'd', "database", 0, "Destination database. Default is 'test'.", 3}, - {0, 'm', "table_prefix", 0, "Table prefix name. Default is 't'.", 3}, - {0, 's', "sql file", 0, "The select sql file.", 3}, - {0, 'M', 0, 0, "Use metric flag.", 13}, - {0, 'o', "outputfile", 0, "Direct output to the named file. Default is './output.txt'.", 14}, - {0, 'q', "query_mode", 0, "Query mode--0: SYNC, 1: ASYNC. Default is SYNC.", 6}, - {0, 'b', "type_of_cols", 0, "The data_type of columns: 'INT', 'TINYINT', 'SMALLINT', 'BIGINT', 'FLOAT', 'DOUBLE', 'BINARY'. Default is 'INT'.", 7}, - {0, 'w', "length_of_binary", 0, "The length of data_type 'BINARY'. Only applicable when type of cols is 'BINARY'. Default is 8", 8}, - {0, 'l', "num_of_cols_per_record", 0, "The number of columns per record. Default is 3.", 8}, - {0, 'T', "num_of_threads", 0, "The number of threads. Default is 10.", 9}, - {0, 'r', "num_of_records_per_req", 0, "The number of records per request. Default is 1000.", 10}, - {0, 't', "num_of_tables", 0, "The number of tables. Default is 10000.", 11}, - {0, 'n', "num_of_records_per_table", 0, "The number of records per table. Default is 100000.", 12}, - {0, 'c', "config_directory", 0, "Configuration directory. Default is '/etc/taos/'.", 14}, - {0, 'x', 0, 0, "Insert only flag.", 13}, - {0, 'O', "order", 0, "Insert mode--0: In order, 1: Out of order. Default is in order.", 14}, - {0, 'R', "rate", 0, "Out of order data's rate--if order=1 Default 10, min: 0, max: 50.", 14}, - {0, 'D', "delete table", 0, "Delete data methods——0: don't delete, 1: delete by table, 2: delete by stable, 3: delete by database", 14}, - {0}}; - /* Used by main to communicate with parse_opt. */ typedef struct DemoArguments { char *host; @@ -101,143 +82,337 @@ typedef struct DemoArguments { char **arg_list; } SDemoArguments; -/* Parse a single option. */ -static error_t parse_opt(int key, char *arg, struct argp_state *state) { - /* Get the input argument from argp_parse, which we - know is a pointer to our arguments structure. */ - SDemoArguments *arguments = state->input; - wordexp_t full_path; - char **sptr; - switch (key) { - case 'h': - arguments->host = arg; - break; - case 'p': - arguments->port = atoi(arg); - break; - case 'u': - arguments->user = arg; - break; - case 'P': - arguments->password = arg; - break; - case 'o': - arguments->output_file = arg; - break; - case 's': - arguments->sqlFile = arg; - break; - case 'q': - arguments->mode = atoi(arg); - break; - case 'T': - arguments->num_of_threads = atoi(arg); - break; - case 'r': - arguments->num_of_RPR = atoi(arg); - break; - case 't': - arguments->num_of_tables = atoi(arg); - break; - case 'n': - arguments->num_of_DPT = atoi(arg); - break; - case 'd': - arguments->database = arg; - break; - case 'l': - arguments->num_of_CPR = atoi(arg); - break; - case 'b': - sptr = arguments->datatype; - if (strstr(arg, ",") == NULL) { - if (strcasecmp(arg, "INT") != 0 && strcasecmp(arg, "FLOAT") != 0 && - strcasecmp(arg, "TINYINT") != 0 && strcasecmp(arg, "BOOL") != 0 && - strcasecmp(arg, "SMALLINT") != 0 && - strcasecmp(arg, "BIGINT") != 0 && strcasecmp(arg, "DOUBLE") != 0 && - strcasecmp(arg, "BINARY") && strcasecmp(arg, "NCHAR")) { - argp_error(state, "Invalid data_type!"); - } - sptr[0] = arg; - } else { - int index = 0; - char *dupstr = strdup(arg); - char *running = dupstr; - char *token = strsep(&running, ","); - while (token != NULL) { - if (strcasecmp(token, "INT") != 0 && - strcasecmp(token, "FLOAT") != 0 && - strcasecmp(token, "TINYINT") != 0 && - strcasecmp(token, "BOOL") != 0 && - strcasecmp(token, "SMALLINT") != 0 && - strcasecmp(token, "BIGINT") != 0 && - strcasecmp(token, "DOUBLE") != 0 && strcasecmp(token, "BINARY") && strcasecmp(token, "NCHAR")) { +#ifdef LINUX + /* The options we understand. */ + static struct argp_option options[] = { + {0, 'h', "host", 0, "The host to connect to TDEngine. Default is localhost.", 0}, + {0, 'p', "port", 0, "The TCP/IP port number to use for the connection. Default is 0.", 1}, + {0, 'u', "user", 0, "The TDEngine user name to use when connecting to the server. Default is 'root'.", 2}, + {0, 'P', "password", 0, "The password to use when connecting to the server. Default is 'taosdata'.", 3}, + {0, 'd', "database", 0, "Destination database. Default is 'test'.", 3}, + {0, 'm', "table_prefix", 0, "Table prefix name. Default is 't'.", 3}, + {0, 's', "sql file", 0, "The select sql file.", 3}, + {0, 'M', 0, 0, "Use metric flag.", 13}, + {0, 'o', "outputfile", 0, "Direct output to the named file. Default is './output.txt'.", 14}, + {0, 'q', "query_mode", 0, "Query mode--0: SYNC, 1: ASYNC. Default is SYNC.", 6}, + {0, 'b', "type_of_cols", 0, "The data_type of columns: 'INT', 'TINYINT', 'SMALLINT', 'BIGINT', 'FLOAT', 'DOUBLE', 'BINARY'. Default is 'INT'.", 7}, + {0, 'w', "length_of_binary", 0, "The length of data_type 'BINARY'. Only applicable when type of cols is 'BINARY'. Default is 8", 8}, + {0, 'l', "num_of_cols_per_record", 0, "The number of columns per record. Default is 3.", 8}, + {0, 'T', "num_of_threads", 0, "The number of threads. Default is 10.", 9}, + {0, 'r', "num_of_records_per_req", 0, "The number of records per request. Default is 1000.", 10}, + {0, 't', "num_of_tables", 0, "The number of tables. Default is 10000.", 11}, + {0, 'n', "num_of_records_per_table", 0, "The number of records per table. Default is 100000.", 12}, + {0, 'c', "config_directory", 0, "Configuration directory. Default is '/etc/taos/'.", 14}, + {0, 'x', 0, 0, "Insert only flag.", 13}, + {0, 'O', "order", 0, "Insert mode--0: In order, 1: Out of order. Default is in order.", 14}, + {0, 'R', "rate", 0, "Out of order data's rate--if order=1 Default 10, min: 0, max: 50.", 14}, + {0, 'D', "delete table", 0, "Delete data methods——0: don't delete, 1: delete by table, 2: delete by stable, 3: delete by database", 14}, + {0}}; + + /* Parse a single option. */ + static error_t parse_opt(int key, char *arg, struct argp_state *state) { + /* Get the input argument from argp_parse, which we + know is a pointer to our arguments structure. */ + SDemoArguments *arguments = state->input; + wordexp_t full_path; + char **sptr; + switch (key) { + case 'h': + arguments->host = arg; + break; + case 'p': + arguments->port = atoi(arg); + break; + case 'u': + arguments->user = arg; + break; + case 'P': + arguments->password = arg; + break; + case 'o': + arguments->output_file = arg; + break; + case 's': + arguments->sqlFile = arg; + break; + case 'q': + arguments->mode = atoi(arg); + break; + case 'T': + arguments->num_of_threads = atoi(arg); + break; + case 'r': + arguments->num_of_RPR = atoi(arg); + break; + case 't': + arguments->num_of_tables = atoi(arg); + break; + case 'n': + arguments->num_of_DPT = atoi(arg); + break; + case 'd': + arguments->database = arg; + break; + case 'l': + arguments->num_of_CPR = atoi(arg); + break; + case 'b': + sptr = arguments->datatype; + if (strstr(arg, ",") == NULL) { + if (strcasecmp(arg, "INT") != 0 && strcasecmp(arg, "FLOAT") != 0 && + strcasecmp(arg, "TINYINT") != 0 && strcasecmp(arg, "BOOL") != 0 && + strcasecmp(arg, "SMALLINT") != 0 && + strcasecmp(arg, "BIGINT") != 0 && strcasecmp(arg, "DOUBLE") != 0 && + strcasecmp(arg, "BINARY") && strcasecmp(arg, "NCHAR")) { argp_error(state, "Invalid data_type!"); } - sptr[index++] = token; - token = strsep(&running, ","); - if (index >= MAX_NUM_DATATYPE) break; + sptr[0] = arg; + } else { + int index = 0; + char *dupstr = strdup(arg); + char *running = dupstr; + char *token = strsep(&running, ","); + while (token != NULL) { + if (strcasecmp(token, "INT") != 0 && + strcasecmp(token, "FLOAT") != 0 && + strcasecmp(token, "TINYINT") != 0 && + strcasecmp(token, "BOOL") != 0 && + strcasecmp(token, "SMALLINT") != 0 && + strcasecmp(token, "BIGINT") != 0 && + strcasecmp(token, "DOUBLE") != 0 && strcasecmp(token, "BINARY") && strcasecmp(token, "NCHAR")) { + argp_error(state, "Invalid data_type!"); + } + sptr[index++] = token; + token = strsep(&running, ","); + if (index >= MAX_NUM_DATATYPE) break; + } } - } - break; - case 'w': - arguments->len_of_binary = atoi(arg); - break; - case 'm': - arguments->tb_prefix = arg; - break; - case 'M': - arguments->use_metric = false; - break; - case 'x': - arguments->insert_only = false; - break; - case 'c': - if (wordexp(arg, &full_path, 0) != 0) { - fprintf(stderr, "Invalid path %s\n", arg); - return -1; - } - taos_options(TSDB_OPTION_CONFIGDIR, full_path.we_wordv[0]); - wordfree(&full_path); - break; - case 'O': - arguments->order = atoi(arg); - if (arguments->order > 1 || arguments->order < 0) - { - arguments->order = 0; - } else if (arguments->order == 1) - { - arguments->rate = 10; - } - break; - case 'R': - arguments->rate = atoi(arg); - if (arguments->order == 1 && (arguments->rate > 50 || arguments->rate <= 0)) - { - arguments->rate = 10; - } - break; - case 'D': - arguments->method_of_delete = atoi(arg); - if (arguments->method_of_delete < 0 || arguments->method_of_delete > 3) - { - arguments->method_of_delete = 0; - } - break; - case OPT_ABORT: - arguments->abort = 1; - break; - case ARGP_KEY_ARG: - /*arguments->arg_list = &state->argv[state->next-1]; - state->next = state->argc;*/ - argp_usage(state); - break; + break; + case 'w': + arguments->len_of_binary = atoi(arg); + break; + case 'm': + arguments->tb_prefix = arg; + break; + case 'M': + arguments->use_metric = false; + break; + case 'x': + arguments->insert_only = false; + break; + case 'c': + if (wordexp(arg, &full_path, 0) != 0) { + fprintf(stderr, "Invalid path %s\n", arg); + return -1; + } + taos_options(TSDB_OPTION_CONFIGDIR, full_path.we_wordv[0]); + wordfree(&full_path); + break; + case 'O': + arguments->order = atoi(arg); + if (arguments->order > 1 || arguments->order < 0) + { + arguments->order = 0; + } else if (arguments->order == 1) + { + arguments->rate = 10; + } + break; + case 'R': + arguments->rate = atoi(arg); + if (arguments->order == 1 && (arguments->rate > 50 || arguments->rate <= 0)) + { + arguments->rate = 10; + } + break; + case 'D': + arguments->method_of_delete = atoi(arg); + if (arguments->method_of_delete < 0 || arguments->method_of_delete > 3) + { + arguments->method_of_delete = 0; + } + break; + case OPT_ABORT: + arguments->abort = 1; + break; + case ARGP_KEY_ARG: + /*arguments->arg_list = &state->argv[state->next-1]; + state->next = state->argc;*/ + argp_usage(state); + break; - default: - return ARGP_ERR_UNKNOWN; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; } - return 0; -} + + static struct argp argp = {options, parse_opt, 0, 0}; + + void parse_args(int argc, char *argv[], SDemoArguments *arguments) { + argp_parse(&argp, argc, argv, 0, 0, &arguments); + if (arguments->abort) { + #ifndef _ALPINE + error(10, 0, "ABORTED"); + #else + abort(); + #endif + } + } + +#else + void printHelp() { + char indent[10] = " "; + printf("%s%s\n", indent, "-h"); + printf("%s%s%s\n", indent, indent, "host, The host to connect to TDEngine. Default is localhost."); + printf("%s%s\n", indent, "-p"); + printf("%s%s%s\n", indent, indent, "port, The TCP/IP port number to use for the connection. Default is 0."); + printf("%s%s\n", indent, "-u"); + printf("%s%s%s\n", indent, indent, "user, The TDEngine user name to use when connecting to the server. Default is 'root'."); + printf("%s%s\n", indent, "-p"); + printf("%s%s%s\n", indent, indent, "password, The password to use when connecting to the server. Default is 'taosdata'."); + printf("%s%s\n", indent, "-d"); + printf("%s%s%s\n", indent, indent, "database, Destination database. Default is 'test'."); + printf("%s%s\n", indent, "-m"); + printf("%s%s%s\n", indent, indent, "table_prefix, Table prefix name. Default is 't'."); + printf("%s%s\n", indent, "-s"); + printf("%s%s%s\n", indent, indent, "sql file, The select sql file."); + printf("%s%s\n", indent, "-M"); + printf("%s%s%s\n", indent, indent, "meteric, Use metric flag."); + printf("%s%s\n", indent, "-o"); + printf("%s%s%s\n", indent, indent, "outputfile, Direct output to the named file. Default is './output.txt'."); + printf("%s%s\n", indent, "-q"); + printf("%s%s%s\n", indent, indent, "query_mode, Query mode--0: SYNC, 1: ASYNC. Default is SYNC."); + printf("%s%s\n", indent, "-b"); + printf("%s%s%s\n", indent, indent, "type_of_cols, data_type of columns: 'INT', 'TINYINT', 'SMALLINT', 'BIGINT', 'FLOAT', 'DOUBLE', 'BINARY'. Default is 'INT'."); + printf("%s%s\n", indent, "-w"); + printf("%s%s%s\n", indent, indent, "length_of_binary, The length of data_type 'BINARY'. Only applicable when type of cols is 'BINARY'. Default is 8"); + printf("%s%s\n", indent, "-l"); + printf("%s%s%s\n", indent, indent, "num_of_cols_per_record, The number of columns per record. Default is 3."); + printf("%s%s\n", indent, "-T"); + printf("%s%s%s\n", indent, indent, "num_of_threads, The number of threads. Default is 10."); + printf("%s%s\n", indent, "-r"); + printf("%s%s%s\n", indent, indent, "num_of_records_per_req, The number of records per request. Default is 1000."); + printf("%s%s\n", indent, "-t"); + printf("%s%s%s\n", indent, indent, "num_of_tables, The number of tables. Default is 10000."); + printf("%s%s\n", indent, "-n"); + printf("%s%s%s\n", indent, indent, "num_of_records_per_table, The number of records per table. Default is 100000."); + printf("%s%s\n", indent, "-c"); + printf("%s%s%s\n", indent, indent, "config_directory, Configuration directory. Default is '/etc/taos/'."); + printf("%s%s\n", indent, "-x"); + printf("%s%s%s\n", indent, indent, "flag, Insert only flag."); + printf("%s%s\n", indent, "-O"); + printf("%s%s%s\n", indent, indent, "order, Insert mode--0: In order, 1: Out of order. Default is in order."); + printf("%s%s\n", indent, "-R"); + printf("%s%s%s\n", indent, indent, "rate, Out of order data's rate--if order=1 Default 10, min: 0, max: 50."); + printf("%s%s\n", indent, "-D"); + printf("%s%s%s\n", indent, indent, "Delete data methods——0: don't delete, 1: delete by table, 2: delete by stable, 3: delete by database."); + } + + void parse_args(int argc, char *argv[], SDemoArguments *arguments) { + char **sptr; + for (int i = 1; i < argc; i++) { + if (strcmp(argv[i], "-h") == 0) { + arguments->host = argv[++i]; + } else if (strcmp(argv[i], "-p") == 0) { + arguments->port = atoi(argv[++i]); + } else if (strcmp(argv[i], "-u") == 0) { + arguments->user = argv[++i]; + } else if (strcmp(argv[i], "-P") == 0) { + arguments->password = argv[++i]; + } else if (strcmp(argv[i], "-o") == 0) { + arguments->output_file = argv[++i]; + } else if (strcmp(argv[i], "-s") == 0) { + arguments->sqlFile = argv[++i]; + } else if (strcmp(argv[i], "-q") == 0) { + arguments->mode = atoi(argv[++i]); + } else if (strcmp(argv[i], "-T") == 0) { + arguments->num_of_threads = atoi(argv[++i]); + } else if (strcmp(argv[i], "-r") == 0) { + arguments->num_of_RPR = atoi(argv[++i]); + } else if (strcmp(argv[i], "-t") == 0) { + arguments->num_of_tables = atoi(argv[++i]); + } else if (strcmp(argv[i], "-n") == 0) { + arguments->num_of_DPT = atoi(argv[++i]); + } else if (strcmp(argv[i], "-d") == 0) { + arguments->database = argv[++i]; + } else if (strcmp(argv[i], "-l") == 0) { + arguments->num_of_CPR = atoi(argv[++i]); + } else if (strcmp(argv[i], "-b") == 0) { + sptr = arguments->datatype; + ++i; + if (strstr(argv[i], ",") == NULL) { + if (strcasecmp(argv[i], "INT") != 0 && strcasecmp(argv[i], "FLOAT") != 0 && + strcasecmp(argv[i], "TINYINT") != 0 && strcasecmp(argv[i], "BOOL") != 0 && + strcasecmp(argv[i], "SMALLINT") != 0 && + strcasecmp(argv[i], "BIGINT") != 0 && strcasecmp(argv[i], "DOUBLE") != 0 && + strcasecmp(argv[i], "BINARY") && strcasecmp(argv[i], "NCHAR")) { + fprintf(stderr, "Invalid data_type!\n"); + printHelp(); + exit(EXIT_FAILURE); + } + sptr[0] = argv[i]; + } else { + int index = 0; + char *dupstr = strdup(argv[i]); + char *running = dupstr; + char *token = strsep(&running, ","); + while (token != NULL) { + if (strcasecmp(token, "INT") != 0 && + strcasecmp(token, "FLOAT") != 0 && + strcasecmp(token, "TINYINT") != 0 && + strcasecmp(token, "BOOL") != 0 && + strcasecmp(token, "SMALLINT") != 0 && + strcasecmp(token, "BIGINT") != 0 && + strcasecmp(token, "DOUBLE") != 0 && strcasecmp(token, "BINARY") && strcasecmp(token, "NCHAR")) { + fprintf(stderr, "Invalid data_type!\n"); + printHelp(); + exit(EXIT_FAILURE); + } + sptr[index++] = token; + token = strsep(&running, ","); + if (index >= MAX_NUM_DATATYPE) break; + } + } + } else if (strcmp(argv[i], "-w") == 0) { + arguments->len_of_binary = atoi(argv[++i]); + } else if (strcmp(argv[i], "-m") == 0) { + arguments->tb_prefix = argv[++i]; + } else if (strcmp(argv[i], "-M") == 0) { + arguments->use_metric = false; + } else if (strcmp(argv[i], "-x") == 0) { + arguments->insert_only = false; + } else if (strcmp(argv[i], "-c") == 0) { + strcpy(configDir, argv[++i]); + } else if (strcmp(argv[i], "-O") == 0) { + arguments->order = atoi(argv[++i]); + if (arguments->order > 1 || arguments->order < 0) { + arguments->order = 0; + } else if (arguments->order == 1) { + arguments->rate = 10; + } + } else if (strcmp(argv[i], "-R") == 0) { + arguments->rate = atoi(argv[++i]); + if (arguments->order == 1 && (arguments->rate > 50 || arguments->rate <= 0)) { + arguments->rate = 10; + } + } else if (strcmp(argv[i], "-D") == 0) { + arguments->method_of_delete = atoi(argv[++i]); + if (arguments->method_of_delete < 0 || arguments->method_of_delete > 3) { + arguments->method_of_delete = 0; + } + } else if (strcmp(argv[i], "--help") == 0) { + printHelp(); + exit(EXIT_FAILURE); + } else { + fprintf(stderr, "wrong options\n"); + printHelp(); + exit(EXIT_FAILURE); + } + } + } + +#endif /* ******************************* Structure * definition******************************* */ @@ -293,9 +468,6 @@ typedef struct { * variables******************************* */ char *aggreFunc[] = {"*", "count(*)", "avg(f1)", "sum(f1)", "max(f1)", "min(f1)", "first(f1)", "last(f1)"}; -/* ******************************* Global - * functions******************************* */ -static struct argp argp = {options, parse_opt, 0, 0}; void queryDB(TAOS *taos, char *command); @@ -368,15 +540,7 @@ int main(int argc, char *argv[]) { arguments.insert_only = true; // end change - argp_parse(&argp, argc, argv, 0, 0, &arguments); - - if (arguments.abort) { - #ifndef _ALPINE - error(10, 0, "ABORTED"); - #else - abort(); - #endif - } + parse_args(argc, argv, &arguments); enum MODE query_mode = arguments.mode; char *ip_addr = arguments.host; @@ -438,7 +602,7 @@ int main(int argc, char *argv[]) { printf("# Use metric: %s\n", use_metric ? "true" : "false"); printf("# Datatype of Columns: %s\n", dataString); printf("# Binary Length(If applicable): %d\n", - (strcasestr(dataString, "BINARY") != NULL || strcasestr(dataString, "NCHAR") != NULL ) ? len_of_binary : -1); + (strncasecmp(dataString, "BINARY", 6) == 0 || strncasecmp(dataString, "NCHAR", 5) == 0) ? len_of_binary : -1); printf("# Number of Columns per record: %d\n", ncols_per_record); printf("# Number of Threads: %d\n", threads); printf("# Number of Tables: %d\n", ntables); @@ -466,7 +630,7 @@ int main(int argc, char *argv[]) { fprintf(fp, "# Use metric: %s\n", use_metric ? "true" : "false"); fprintf(fp, "# Datatype of Columns: %s\n", dataString); fprintf(fp, "# Binary Length(If applicable): %d\n", - (strcasestr(dataString, "BINARY") != NULL || strcasestr(dataString, "NCHAR") != NULL ) ? len_of_binary : -1); + (strncasecmp(dataString, "BINARY", 6) == 0 || strncasecmp(dataString, "NCHAR", 5) == 0) ? len_of_binary : -1); fprintf(fp, "# Number of Columns per record: %d\n", ncols_per_record); fprintf(fp, "# Number of Threads: %d\n", threads); fprintf(fp, "# Number of Tables: %d\n", ntables); @@ -753,7 +917,7 @@ void querySqlFile(TAOS* taos, char* sqlFile) double t = getCurrentTime(); - while ((read_len = getline(&line, &line_len, fp)) != -1) { + while ((read_len = taosGetline(&line, &line_len, fp)) != -1) { if (read_len >= MAX_SQL_SIZE) continue; line[--read_len] = '\0'; @@ -1035,7 +1199,7 @@ void *syncWrite(void *sarg) { char **data_type = winfo->datatype; int len_of_binary = winfo->len_of_binary; int ncols_per_record = winfo->ncols_per_record; - srand(time(NULL)); + srand((uint32_t)time(NULL)); int64_t time_counter = winfo->start_time; for (int i = 0; i < winfo->nrecords_per_table;) { for (int tID = winfo->start_table_id; tID <= winfo->end_table_id; tID++) { @@ -1049,7 +1213,7 @@ void *syncWrite(void *sarg) { int rand_num = rand() % 100; int len = -1; if (winfo->data_of_order ==1 && rand_num < winfo->data_of_rate) { - long d = tmp_time - rand() % 1000000 + rand_num; + int64_t d = tmp_time - rand() % 1000000 + rand_num; len = generateData(data, data_type, ncols_per_record, d, len_of_binary); } else { len = generateData(data, data_type, ncols_per_record, tmp_time += 1000, len_of_binary); @@ -1144,7 +1308,7 @@ void callBack(void *param, TAOS_RES *res, int code) { int rand_num = rand() % 100; if (tb_info->data_of_order ==1 && rand_num < tb_info->data_of_rate) { - long d = tmp_time - rand() % 1000000 + rand_num; + int64_t d = tmp_time - rand() % 1000000 + rand_num; generateData(data, datatype, ncols_per_record, d, len_of_binary); } else { @@ -1269,13 +1433,15 @@ int32_t generateData(char *res, char **data_type, int num_of_cols, int64_t times bool b = rand() & 1; pstr += sprintf(pstr, ", %s", b ? "true" : "false"); } else if (strcasecmp(data_type[i % c], "binary") == 0) { - char s[len_of_binary]; + char *s = malloc(len_of_binary); rand_string(s, len_of_binary); pstr += sprintf(pstr, ", \"%s\"", s); + free(s); }else if (strcasecmp(data_type[i % c], "nchar") == 0) { - char s[len_of_binary]; + char *s = malloc(len_of_binary); rand_string(s, len_of_binary); pstr += sprintf(pstr, ", \"%s\"", s); + free(s); } if (pstr - res > MAX_DATA_SIZE) { @@ -1286,7 +1452,7 @@ int32_t generateData(char *res, char **data_type, int num_of_cols, int64_t times pstr += sprintf(pstr, ")"); - return pstr - res; + return (int32_t)(pstr - res); } static const char charset[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJK1234567890"; diff --git a/src/os/inc/osFile.h b/src/os/inc/osFile.h index e99c64c2e04165bb42006935385c7f06395a8ac1..dc19c8177c62307ca110486c130f6a6b56047ef4 100644 --- a/src/os/inc/osFile.h +++ b/src/os/inc/osFile.h @@ -56,18 +56,6 @@ int32_t taosFileRename(char *fullPath, char *suffix, char delimiter, char **dstP // TAOS_OS_FUNC_FILE_GETTMPFILEPATH void taosGetTmpfilePath(const char *fileNamePrefix, char *dstPath); -#ifdef TAOS_OS_FUNC_FILE_ISDIR - #define S_ISDIR(m) (((m) & 0170000) == (0040000)) -#endif - -#ifdef TAOS_OS_FUNC_FILE_ISREG - #define S_ISREG(m) !(S_ISDIR(m)) -#endif - -#ifdef TAOS_OS_FUNC_FILE_ISLNK - #define S_ISLNK(m) 0 -#endif - #ifndef TAOS_OS_FUNC_FILE_FTRUNCATE #define taosFtruncate ftruncate #endif diff --git a/src/os/inc/osSocket.h b/src/os/inc/osSocket.h index b9be39307ce9c2d6e75b67fa00bc0f365ea5f5ec..58f95c3c2da4394321f63db9171005f6f1547b1c 100644 --- a/src/os/inc/osSocket.h +++ b/src/os/inc/osSocket.h @@ -33,7 +33,11 @@ extern "C" { } \ } typedef int SOCKET; -#endif +#endif + +#ifndef TAOS_OS_DEF_EPOLL + #define TAOS_EPOLL_WAIT_TIME -1 +#endif #define taosClose(x) taosCloseSocket(x) diff --git a/src/os/inc/osWindows.h b/src/os/inc/osWindows.h index bdfb4acb5bb2ae2f3be1e6fa7c930377e1f975a9..caab61536e0aeca6fd0acca0fa5cc52362043b8b 100644 --- a/src/os/inc/osWindows.h +++ b/src/os/inc/osWindows.h @@ -18,9 +18,7 @@ #include #include -#include #include -#include #include #include #include @@ -35,15 +33,18 @@ #include #include #include -#include -#include -#include -#include #include "winsock2.h" #include #include #include -#include +#include +#include +#include "msvcProcess.h" +#include "msvcDirect.h" +#include "msvcFcntl.h" +#include "msvcStdio.h" +#include "sys/msvcStat.h" +#include "sys/msvcTypes.h" #ifdef __cplusplus extern "C" { @@ -93,6 +94,9 @@ extern "C" { typedef SOCKET eventfd_t; #define eventfd(a, b) -1 +#define TAOS_OS_DEF_EPOLL + #define TAOS_EPOLL_WAIT_TIME 100 + #define TAOS_OS_FUNC_STRING_WCHAR int twcslen(const wchar_t *wcs); #define TAOS_OS_FUNC_STRING_GETLINE @@ -126,7 +130,6 @@ char *stpncpy (char *dest, const char *src, size_t n); typedef int (*__compar_fn_t)(const void *, const void *); #define ssize_t int #define bzero(ptr, size) memset((ptr), 0, (size)) -#define mkdir(pathname, mode) _mkdir(pathname) #define strcasecmp _stricmp #define strncasecmp _strnicmp #define wcsncasecmp _wcsnicmp @@ -138,7 +141,6 @@ typedef int (*__compar_fn_t)(const void *, const void *); #define twrite write #define getpid _getpid -int gettimeofday(struct timeval *tv, struct timezone *tz); struct tm *localtime_r(const time_t *timep, struct tm *result); char * strptime(const char *buf, const char *fmt, struct tm *tm); char * strsep(char **stringp, const char *delim); @@ -146,11 +148,8 @@ char * getpass(const char *prefix); int flock(int fd, int option); int fsync(int filedes); char * strndup(const char *s, size_t n); - -// for function open in stat.h -#define S_IRWXU _S_IREAD -#define S_IRWXG _S_IWRITE -#define S_IRWXO _S_IWRITE +char * dirname(char *pszPathname); +int gettimeofday(struct timeval *ptv, void *pTimeZone); // for access function in io.h #define F_OK 00 //Existence only diff --git a/src/os/src/alpine/alpineEnv.c b/src/os/src/alpine/alpineEnv.c index 4f84412075766dae66e9e55831b4bf290af987e2..811d98ad7f8c34851e70ccbd190a13b74d865703 100644 --- a/src/os/src/alpine/alpineEnv.c +++ b/src/os/src/alpine/alpineEnv.c @@ -18,7 +18,10 @@ #include "tglobal.h" void osInit() { - strcpy(configDir, "/etc/taos"); + if (configDir[0] == 0) { + strcpy(configDir, "/etc/taos"); + } + strcpy(tsVnodeDir, ""); strcpy(tsDnodeDir, ""); strcpy(tsMnodeDir, ""); diff --git a/src/os/src/darwin/darwinEnv.c b/src/os/src/darwin/darwinEnv.c index 7e1031a5af6e2ed59fae7fa607d1ce7fc3790043..6adebabec01ae378a4c5f3d82389508334210972 100644 --- a/src/os/src/darwin/darwinEnv.c +++ b/src/os/src/darwin/darwinEnv.c @@ -18,7 +18,10 @@ #include "tglobal.h" void osInit() { - strcpy(configDir, "~/TDengine/cfg"); + if (configDir[0] == 0) { + strcpy(configDir, "~/TDengine/cfg"); + } + strcpy(tsVnodeDir, ""); strcpy(tsDnodeDir, ""); strcpy(tsMnodeDir, ""); diff --git a/src/os/src/linux64/linuxEnv.c b/src/os/src/linux64/linuxEnv.c index 4f84412075766dae66e9e55831b4bf290af987e2..811d98ad7f8c34851e70ccbd190a13b74d865703 100644 --- a/src/os/src/linux64/linuxEnv.c +++ b/src/os/src/linux64/linuxEnv.c @@ -18,7 +18,10 @@ #include "tglobal.h" void osInit() { - strcpy(configDir, "/etc/taos"); + if (configDir[0] == 0) { + strcpy(configDir, "/etc/taos"); + } + strcpy(tsVnodeDir, ""); strcpy(tsDnodeDir, ""); strcpy(tsMnodeDir, ""); diff --git a/src/os/src/windows/CMakeLists.txt b/src/os/src/windows/CMakeLists.txt index 131533c5c5d92acc9478807762c86029f01b2167..588d3b7f68ea6f54051d4723a0730b9316f53157 100644 --- a/src/os/src/windows/CMakeLists.txt +++ b/src/os/src/windows/CMakeLists.txt @@ -4,4 +4,4 @@ PROJECT(TDengine) AUX_SOURCE_DIRECTORY(. SRC) ADD_LIBRARY(os ${SRC}) -TARGET_LINK_LIBRARIES(os winmm IPHLPAPI ws2_32) +TARGET_LINK_LIBRARIES(os winmm IPHLPAPI ws2_32 MsvcLibXw64) diff --git a/src/os/src/windows/w64Env.c b/src/os/src/windows/w64Env.c index 840a8d9f7a80c382e2eda40806093b2ff2d36f2b..c6046ecae7e369c7ae3c9198ee0727b2d3c4c653 100644 --- a/src/os/src/windows/w64Env.c +++ b/src/os/src/windows/w64Env.c @@ -18,8 +18,13 @@ #include "tglobal.h" #include "tulog.h" +extern void taosWinSocketInit(); + void osInit() { - strcpy(configDir, "C:/TDengine/cfg"); + if (configDir[0] == 0) { + strcpy(configDir, "~/TDengine/cfg"); + } + strcpy(tsVnodeDir, "C:/TDengine/data"); strcpy(tsDnodeDir, ""); strcpy(tsMnodeDir, ""); @@ -27,4 +32,5 @@ void osInit() { strcpy(tsLogDir, "C:/TDengine/log"); strcpy(tsScriptDir, "C:/TDengine/script"); strcpy(tsOsName, "Windows"); + taosWinSocketInit(); } \ No newline at end of file diff --git a/src/plugins/http/src/httpServer.c b/src/plugins/http/src/httpServer.c index 5c910a331124813e15bb35dffc983f0ca9a3aae6..8ee92be31c004843a9c03342bf20d99dd02118ff 100644 --- a/src/plugins/http/src/httpServer.c +++ b/src/plugins/http/src/httpServer.c @@ -38,6 +38,7 @@ static void httpStopThread(HttpThread* pThread) { eventfd_t fd = eventfd(1, 0); if (fd == -1) { httpError("%s, failed to create eventfd, will call pthread_cancel instead, which may result in data corruption: %s", pThread->label, strerror(errno)); + pThread->stop = true; pthread_cancel(pThread->thread); } else if (epoll_ctl(pThread->pollFd, EPOLL_CTL_ADD, fd, &event) < 0) { httpError("%s, failed to call epoll_ctl, will call pthread_cancel instead, which may result in data corruption: %s", pThread->label, strerror(errno)); diff --git a/src/plugins/monitor/src/monitorMain.c b/src/plugins/monitor/src/monitorMain.c index 8bf9277a43da1c2e5b21c309479ceeb8f5220be0..6c7ecbb9511701ed5cedea4db1d5f28d24fe1b20 100644 --- a/src/plugins/monitor/src/monitorMain.c +++ b/src/plugins/monitor/src/monitorMain.c @@ -131,7 +131,10 @@ static void monitorInitConn(void *para, void *unused) { } static void monitorInitConnCb(void *param, TAOS_RES *result, int32_t code) { - if (code < 0) { + // free it firstly in any cases. + taos_free_result(result); + + if (code != TSDB_CODE_SUCCESS) { monitorError("monitor:%p, connect to database failed, reason:%s", tsMonitorConn.conn, tstrerror(code)); taos_close(tsMonitorConn.conn); tsMonitorConn.conn = NULL; @@ -214,7 +217,7 @@ static void monitorInitDatabase() { } static void monitorInitDatabaseCb(void *param, TAOS_RES *result, int32_t code) { - if (-code == TSDB_CODE_MND_TABLE_ALREADY_EXIST || -code == TSDB_CODE_MND_DB_ALREADY_EXIST || code >= 0) { + if (code == TSDB_CODE_MND_TABLE_ALREADY_EXIST || code == TSDB_CODE_MND_DB_ALREADY_EXIST || code >= 0) { monitorDebug("monitor:%p, sql success, reason:%s, %s", tsMonitorConn.conn, tstrerror(code), tsMonitorConn.sql); if (tsMonitorConn.cmdIndex == MONITOR_CMD_CREATE_TB_LOG) { monitorInfo("dnode:%s is started", tsLocalEp); @@ -226,6 +229,8 @@ static void monitorInitDatabaseCb(void *param, TAOS_RES *result, int32_t code) { tsMonitorConn.state = MONITOR_STATE_UN_INIT; monitorStartSystemRetry(); } + + taos_free_result(result); } void monitorStopSystem() { @@ -238,6 +243,8 @@ void monitorStopSystem() { if (tsMonitorConn.timer != NULL) { taosTmrStopA(&(tsMonitorConn.timer)); } + + taos_close(tsMonitorConn.conn); } void monitorCleanUpSystem() { @@ -250,13 +257,16 @@ static void monitorStartTimer() { } static void dnodeMontiorLogCallback(void *param, TAOS_RES *result, int32_t code) { - if (code < 0) { - monitorError("monitor:%p, save %s failed, reason:%s", tsMonitorConn.conn, (char *)param, tstrerror(code)); - } else if (code == 0) { - monitorError("monitor:%p, save %s failed, affect rows:%d", tsMonitorConn.conn, (char *)param, code); + int32_t c = taos_errno(result); + + if (c != TSDB_CODE_SUCCESS) { + monitorError("monitor:%p, save %s failed, reason:%s", tsMonitorConn.conn, (char *)param, tstrerror(c)); } else { - monitorDebug("monitor:%p, save %s info success, reason:%s", tsMonitorConn.conn, (char *)param, tstrerror(code)); + int32_t rows = taos_affected_rows(result); + monitorDebug("monitor:%p, save %s succ, rows:%d", tsMonitorConn.conn, (char *)param, rows); } + + taos_free_result(result); } // unit is MB diff --git a/src/query/CMakeLists.txt b/src/query/CMakeLists.txt index b9e7ff59e5f8a2bb28b570918385302465a1acc7..e2bee4285fd94fc71899247f7d2ed94849f30a93 100644 --- a/src/query/CMakeLists.txt +++ b/src/query/CMakeLists.txt @@ -13,5 +13,5 @@ IF (TD_LINUX) TARGET_LINK_LIBRARIES(query tsdb tutil m rt) ADD_SUBDIRECTORY(tests) ELSEIF (TD_WINDOWS) - TARGET_LINK_LIBRARIES(query tutil) + TARGET_LINK_LIBRARIES(query tsdb tutil) ENDIF () diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 22c2bb5c9a39a8eec40b3fbd2645ef3ec79b68bf..be3d476be5df11bf9155634ad665ede5a460d76f 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -6549,12 +6549,15 @@ static void buildTagQueryResult(SQInfo* pQInfo) { int32_t i = pQInfo->tableIndex++; STableQueryInfo *item = taosArrayGetP(pa, i); - char *output = pQuery->sdata[0]->data + i * rsize; + char *output = pQuery->sdata[0]->data + count * rsize; varDataSetLen(output, rsize - VARSTR_HEADER_SIZE); output = varDataVal(output); STableId* id = TSDB_TABLEID(item->pTable); + *(int16_t *)output = 0; + output += sizeof(int16_t); + *(int64_t *)output = id->uid; // memory align problem, todo serialize output += sizeof(id->uid); diff --git a/src/query/src/qTokenizer.c b/src/query/src/qTokenizer.c index d0191ec7324a664e2e5454b96c44291b66b7b59e..d730b3cab0f9774ba250f055f48db76fc6dc54d6 100644 --- a/src/query/src/qTokenizer.c +++ b/src/query/src/qTokenizer.c @@ -659,3 +659,7 @@ SSQLToken tStrGetToken(char* str, int32_t* i, bool isPrevOptr, uint32_t numOfIgn } bool isKeyWord(const char* z, int32_t len) { return (tSQLKeywordCode((char*)z, len) != TK_ID); } + +void taosCleanupKeywordsTable() { + taosHashCleanup(KeywordHashTable); +} \ No newline at end of file diff --git a/src/rpc/src/rpcMain.c b/src/rpc/src/rpcMain.c index 37bf9c3f340d28ab651a78c1060520a74ed2e9f4..70e5713ee6bf3d93270719e98b55bfad7df2143f 100644 --- a/src/rpc/src/rpcMain.c +++ b/src/rpc/src/rpcMain.c @@ -322,6 +322,8 @@ void *rpcMallocCont(int contLen) { if (start == NULL) { tError("failed to malloc msg, size:%d", size); return NULL; + } else { + tDebug("malloc mem: %p", start); } return start + sizeof(SRpcReqContext) + sizeof(SRpcHead); @@ -331,7 +333,7 @@ void rpcFreeCont(void *cont) { if ( cont ) { char *temp = ((char *)cont) - sizeof(SRpcHead) - sizeof(SRpcReqContext); free(temp); - // tTrace("free mem: %p", temp); + tDebug("free mem: %p", temp); } } @@ -551,7 +553,7 @@ static void rpcFreeMsg(void *msg) { if ( msg ) { char *temp = (char *)msg - sizeof(SRpcReqContext); free(temp); - // tTrace("free mem: %p", temp); + tDebug("free mem: %p", temp); } } @@ -1098,10 +1100,15 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead) { } if (pHead->code == TSDB_CODE_RPC_REDIRECT) { - pContext->redirect++; - if (pContext->redirect > TSDB_MAX_REPLICA) { - pHead->code = TSDB_CODE_RPC_NETWORK_UNAVAIL; - tWarn("%s, too many redirects, quit", pConn->info); + if (rpcMsg.contLen < sizeof(SRpcEpSet)) { + // if EpSet is not included in the msg, treat it as NOT_READY + pHead->code = TSDB_CODE_RPC_NOT_READY; + } else { + pContext->redirect++; + if (pContext->redirect > TSDB_MAX_REPLICA) { + pHead->code = TSDB_CODE_RPC_NETWORK_UNAVAIL; + tWarn("%s, too many redirects, quit", pConn->info); + } } } diff --git a/src/rpc/src/rpcTcp.c b/src/rpc/src/rpcTcp.c index ac617edfc322b08299ff998a2f42df9577f613d3..9da11831e56b4098d7a7856e3eb9744cf77ad23b 100644 --- a/src/rpc/src/rpcTcp.c +++ b/src/rpc/src/rpcTcp.c @@ -174,6 +174,7 @@ static void taosStopTcpThread(SThreadObj* pThreadObj) { if (fd == -1) { // failed to create eventfd, call pthread_cancel instead, which may result in data corruption: tError("%s, failed to create eventfd(%s)", pThreadObj->label, strerror(errno)); + pThreadObj->stop = true; pthread_cancel(pThreadObj->thread); } else if (epoll_ctl(pThreadObj->pollFd, EPOLL_CTL_ADD, fd, &event) < 0) { // failed to call epoll_ctl, call pthread_cancel instead, which may result in data corruption: @@ -464,7 +465,7 @@ static void *taosProcessTcpData(void *param) { SRecvInfo recvInfo; while (1) { - int fdNum = epoll_wait(pThreadObj->pollFd, events, maxEvents, -1); + int fdNum = epoll_wait(pThreadObj->pollFd, events, maxEvents, TAOS_EPOLL_WAIT_TIME); if (pThreadObj->stop) { tDebug("%s TCP thread get stop event, exiting...", pThreadObj->label); break; diff --git a/src/sync/src/taosTcpPool.c b/src/sync/src/taosTcpPool.c index 88c2c53be4de906cc8d9ac71922e3213ffeee2a1..b523728bf9357e17602c75e3822284c2871e8511 100644 --- a/src/sync/src/taosTcpPool.c +++ b/src/sync/src/taosTcpPool.c @@ -184,7 +184,7 @@ static void *taosProcessTcpData(void *param) { while (1) { if (pThread->stop) break; - int fdNum = epoll_wait(pThread->pollFd, events, maxEvents, -1); + int fdNum = epoll_wait(pThread->pollFd, events, maxEvents, TAOS_EPOLL_WAIT_TIME); if (pThread->stop) { uDebug("%p TCP epoll thread is exiting...", pThread); break; @@ -313,6 +313,7 @@ static void taosStopPoolThread(SThreadObj* pThread) { // failed to create eventfd, call pthread_cancel instead, which may result in data corruption uError("failed to create eventfd(%s)", strerror(errno)); pthread_cancel(pThread->thread); + pThread->stop = true; } else if (epoll_ctl(pThread->pollFd, EPOLL_CTL_ADD, fd, &event) < 0) { // failed to call epoll_ctl, call pthread_cancel instead, which may result in data corruption uError("failed to call epoll_ctl(%s)", strerror(errno)); diff --git a/src/tsdb/src/tsdbFile.c b/src/tsdb/src/tsdbFile.c index d30377ad9f5827089ac70767d8420e6644470d00..b913070e8a3428abb3986e375e240b42ca914d52 100644 --- a/src/tsdb/src/tsdbFile.c +++ b/src/tsdb/src/tsdbFile.c @@ -18,6 +18,7 @@ #include "tchecksum.h" #include "tsdbMain.h" #include "tutil.h" + #define TAOS_RANDOM_FILE_FAIL_TEST const char *tsdbFileSuffix[] = {".head", ".data", ".last", ".stat", ".h", ".d", ".l", ".s"}; @@ -197,7 +198,7 @@ void tsdbSeekFileGroupIter(SFileGroupIter *pIter, int fid) { pIter->index = -1; pIter->fileId = -1; } else { - pIter->index = POINTER_DISTANCE(ptr, pFileH->pFGroup) / sizeof(SFileGroup); + pIter->index = (int)(POINTER_DISTANCE(ptr, pFileH->pFGroup) / sizeof(SFileGroup)); pIter->fileId = ((SFileGroup *)ptr)->fileId; } } @@ -300,8 +301,8 @@ void tsdbFitRetention(STsdbRepo *pRepo) { STsdbFileH *pFileH = pRepo->tsdbFileH; SFileGroup *pGroup = pFileH->pFGroup; - int mfid = TSDB_KEY_FILEID(taosGetTimestamp(pCfg->precision), pCfg->daysPerFile, pCfg->precision) - - TSDB_MAX_FILE(pCfg->keep, pCfg->daysPerFile); + int mfid = (int)(TSDB_KEY_FILEID(taosGetTimestamp(pCfg->precision), pCfg->daysPerFile, pCfg->precision) - + TSDB_MAX_FILE(pCfg->keep, pCfg->daysPerFile)); pthread_rwlock_wrlock(&(pFileH->fhlock)); @@ -366,7 +367,7 @@ void tsdbRemoveFileGroup(STsdbRepo *pRepo, SFileGroup *pFGroup) { SFileGroup fileGroup = *pFGroup; - int nFilesLeft = pFileH->nFGroups - (POINTER_DISTANCE(pFGroup, pFileH->pFGroup) / sizeof(SFileGroup) + 1); + int nFilesLeft = pFileH->nFGroups - (int)(POINTER_DISTANCE(pFGroup, pFileH->pFGroup) / sizeof(SFileGroup) + 1); if (nFilesLeft > 0) { memmove((void *)pFGroup, POINTER_SHIFT(pFGroup, sizeof(SFileGroup)), sizeof(SFileGroup) * nFilesLeft); } diff --git a/src/tsdb/src/tsdbMain.c b/src/tsdb/src/tsdbMain.c index 46801d0788cb8c8cf29b1113c26098cf6b78bbad..3acad055042a2479cf3293baa16ce2fabf1c7a71 100644 --- a/src/tsdb/src/tsdbMain.c +++ b/src/tsdb/src/tsdbMain.c @@ -211,7 +211,7 @@ uint32_t tsdbGetFileInfo(TSDB_REPO_T *repo, char *name, uint32_t *index, uint32_ char *sdup = strdup(pRepo->rootDir); char *prefix = dirname(sdup); - int prefixLen = strlen(prefix); + int prefixLen = (int)strlen(prefix); taosTFree(sdup); if (name[0] == 0) { // get the file from index or after, but not larger than eindex @@ -232,7 +232,7 @@ uint32_t tsdbGetFileInfo(TSDB_REPO_T *repo, char *name, uint32_t *index, uint32_ fname = strdup(pFGroup->files[(*index) % TSDB_FILE_TYPE_MAX].fname); magic = pFGroup->files[(*index) % TSDB_FILE_TYPE_MAX].info.magic; } else { - if ((pFGroup->fileId + 1) * TSDB_FILE_TYPE_MAX - 1 < eindex) { + if ((pFGroup->fileId + 1) * TSDB_FILE_TYPE_MAX - 1 < (int)eindex) { fname = strdup(pFGroup->files[0].fname); *index = pFGroup->fileId * TSDB_FILE_TYPE_MAX; magic = pFGroup->files[0].info.magic; @@ -327,7 +327,7 @@ void tsdbReportStat(void *repo, int64_t *totalPoints, int64_t *totalStorage, int // ----------------- INTERNAL FUNCTIONS ----------------- char *tsdbGetMetaFileName(char *rootDir) { - int tlen = strlen(rootDir) + strlen(TSDB_META_FILE_NAME) + 2; + int tlen = (int)(strlen(rootDir) + strlen(TSDB_META_FILE_NAME) + 2); char *fname = calloc(1, tlen); if (fname == NULL) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; @@ -366,7 +366,7 @@ int tsdbUnlockRepo(STsdbRepo *pRepo) { } char *tsdbGetDataDirName(char *rootDir) { - int tlen = strlen(rootDir) + strlen(TSDB_DATA_DIR_NAME) + 2; + int tlen = (int)(strlen(rootDir) + strlen(TSDB_DATA_DIR_NAME) + 2); char *fname = calloc(1, tlen); if (fname == NULL) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; @@ -627,7 +627,7 @@ _err: } static char *tsdbGetCfgFname(char *rootDir) { - int tlen = strlen(rootDir) + strlen(TSDB_CFG_FILE_NAME) + 2; + int tlen = (int)(strlen(rootDir) + strlen(TSDB_CFG_FILE_NAME) + 2); char *fname = calloc(1, tlen); if (fname == NULL) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; @@ -853,8 +853,8 @@ static int tsdbAlterKeep(STsdbRepo *pRepo, int32_t keep) { return -1; } - int mfid = TSDB_KEY_FILEID(taosGetTimestamp(pCfg->precision), pCfg->daysPerFile, pCfg->precision) - - TSDB_MAX_FILE(keep, pCfg->daysPerFile); + int mfid = (int)(TSDB_KEY_FILEID(taosGetTimestamp(pCfg->precision), pCfg->daysPerFile, pCfg->precision) - + TSDB_MAX_FILE(keep, pCfg->daysPerFile)); int i = 0; for (; i < pFileH->nFGroups; i++) { diff --git a/src/tsdb/src/tsdbMemTable.c b/src/tsdb/src/tsdbMemTable.c index 04b8b64e062dfedecd994162c194e037f4469c16..cd5f223f3da5c7595e3c267590b0be3047181daf 100644 --- a/src/tsdb/src/tsdbMemTable.c +++ b/src/tsdb/src/tsdbMemTable.c @@ -307,7 +307,7 @@ int tsdbLoadDataFromCache(STable *pTable, SSkipListIterator *pIter, TSKEY maxKey keyNext = tsdbNextIterKey(pIter); if (keyNext < 0 || keyNext > maxKey) return numOfRows; void *ptr = taosbsearch((void *)(&keyNext), (void *)filterKeys, nFilterKeys, sizeof(TSKEY), compTSKEY, TD_GE); - filterIter = (ptr == NULL) ? nFilterKeys : (POINTER_DISTANCE(ptr, filterKeys) / sizeof(TSKEY)); + filterIter = (ptr == NULL) ? nFilterKeys : (int)((POINTER_DISTANCE(ptr, filterKeys) / sizeof(TSKEY))); } do { @@ -364,7 +364,7 @@ static void tsdbFreeBytes(STsdbRepo *pRepo, void *ptr, int bytes) { tsdbTrace("vgId:%d free %d bytes to TSDB buffer pool, nBlocks %d offset %d remain %d", REPO_ID(pRepo), bytes, listNEles(pRepo->mem->bufBlockList), pBufBlock->offset, pBufBlock->remain); } else { - SListNode *pNode = (SListNode *)POINTER_SHIFT(ptr, -sizeof(SListNode)); + SListNode *pNode = (SListNode *)POINTER_SHIFT(ptr, -(int)(sizeof(SListNode))); ASSERT(listTail(pRepo->mem->extraBuffList) == pNode); tdListPopNode(pRepo->mem->extraBuffList, pNode); free(pNode); @@ -495,8 +495,8 @@ static void *tsdbCommitData(void *arg) { goto _exit; } - int sfid = TSDB_KEY_FILEID(pMem->keyFirst, pCfg->daysPerFile, pCfg->precision); - int efid = TSDB_KEY_FILEID(pMem->keyLast, pCfg->daysPerFile, pCfg->precision); + int sfid = (int)(TSDB_KEY_FILEID(pMem->keyFirst, pCfg->daysPerFile, pCfg->precision)); + int efid = (int)(TSDB_KEY_FILEID(pMem->keyLast, pCfg->daysPerFile, pCfg->precision)); // Loop to commit to each file for (int fid = sfid; fid <= efid; fid++) { diff --git a/src/tsdb/src/tsdbMeta.c b/src/tsdb/src/tsdbMeta.c index c0d58f6332136058aa33939e2ec06567a7aee868..eb1f1fc340d7f28d8b9d0713dac25ba94802f008 100644 --- a/src/tsdb/src/tsdbMeta.c +++ b/src/tsdb/src/tsdbMeta.c @@ -443,7 +443,7 @@ STsdbMeta *tsdbNewMeta(STsdbCfg *pCfg) { goto _err; } - pMeta->uidMap = taosHashInit(TSDB_INIT_NTABLES * 1.1, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false); + pMeta->uidMap = taosHashInit((size_t)(TSDB_INIT_NTABLES * 1.1), taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false); if (pMeta->uidMap == NULL) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; goto _err; @@ -672,7 +672,7 @@ static STable *tsdbNewTable(STableCfg *pCfg, bool isSuper) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; goto _err; } - STR_WITH_SIZE_TO_VARSTR(pTable->name, pCfg->sname, tsize); + STR_WITH_SIZE_TO_VARSTR(pTable->name, pCfg->sname, (VarDataLenT)tsize); TABLE_UID(pTable) = pCfg->superUid; TABLE_TID(pTable) = -1; TABLE_SUID(pTable) = -1; @@ -690,7 +690,7 @@ static STable *tsdbNewTable(STableCfg *pCfg, bool isSuper) { } pTable->tagVal = NULL; STColumn *pCol = schemaColAt(pTable->tagSchema, DEFAULT_TAG_INDEX_COLUMN); - pTable->pIndex = tSkipListCreate(TSDB_SUPER_TABLE_SL_LEVEL, colType(pCol), colBytes(pCol), 1, 0, 1, getTagIndexKey); + pTable->pIndex = tSkipListCreate(TSDB_SUPER_TABLE_SL_LEVEL, colType(pCol), (uint8_t)(colBytes(pCol)), 1, 0, 1, getTagIndexKey); if (pTable->pIndex == NULL) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; goto _err; @@ -703,7 +703,7 @@ static STable *tsdbNewTable(STableCfg *pCfg, bool isSuper) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; goto _err; } - STR_WITH_SIZE_TO_VARSTR(pTable->name, pCfg->name, tsize); + STR_WITH_SIZE_TO_VARSTR(pTable->name, pCfg->name, (VarDataLenT)tsize); TABLE_UID(pTable) = pCfg->tableId.uid; TABLE_TID(pTable) = pCfg->tableId.tid; @@ -1165,7 +1165,7 @@ static void *tsdbDecodeTable(void *buf, STable **pRTable) { buf = tdDecodeSchema(buf, &(pTable->tagSchema)); STColumn *pCol = schemaColAt(pTable->tagSchema, DEFAULT_TAG_INDEX_COLUMN); pTable->pIndex = - tSkipListCreate(TSDB_SUPER_TABLE_SL_LEVEL, colType(pCol), colBytes(pCol), 1, 0, 1, getTagIndexKey); + tSkipListCreate(TSDB_SUPER_TABLE_SL_LEVEL, colType(pCol), (uint8_t)(colBytes(pCol)), 1, 0, 1, getTagIndexKey); if (pTable->pIndex == NULL) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; tsdbFreeTable(pTable); @@ -1191,7 +1191,7 @@ static int tsdbGetTableEncodeSize(int8_t act, STable *pTable) { tlen = sizeof(SListNode) + sizeof(SActObj) + sizeof(SActCont) + tsdbEncodeTable(NULL, pTable) + sizeof(TSCKSUM); } else { if (TABLE_TYPE(pTable) == TSDB_SUPER_TABLE) { - tlen = (sizeof(SListNode) + sizeof(SActObj)) * (tSkipListGetSize(pTable->pIndex) + 1); + tlen = (int)((sizeof(SListNode) + sizeof(SActObj)) * (tSkipListGetSize(pTable->pIndex) + 1)); } else { tlen = sizeof(SListNode) + sizeof(SActObj); } diff --git a/src/tsdb/src/tsdbRWHelper.c b/src/tsdb/src/tsdbRWHelper.c index a00ed8998a424634fe20bd4390d16e68b0418483..d30a060c2be05679d6ee2aee92eba698546102a5 100644 --- a/src/tsdb/src/tsdbRWHelper.c +++ b/src/tsdb/src/tsdbRWHelper.c @@ -280,7 +280,7 @@ int tsdbCommitTableData(SRWHelper *pHelper, SCommitIter *pCommitIter, SDataCols if (tsdbLoadCompInfo(pHelper, NULL) < 0) return -1; while (true) { - ASSERT(blkIdx <= pIdx->numOfBlocks); + ASSERT(blkIdx <= (int)pIdx->numOfBlocks); TSKEY keyFirst = tsdbNextIterKey(pCommitIter->pIter); if (keyFirst < 0 || keyFirst > maxKey) break; // iter over @@ -383,7 +383,7 @@ int tsdbWriteCompInfo(SRWHelper *pHelper) { pIdx->tid = pHelper->tableInfo.tid; ASSERT(pIdx->offset >= TSDB_FILE_HEAD_SIZE); - if (taosTWrite(pFile->fd, (void *)(pHelper->pCompInfo), pIdx->len) < pIdx->len) { + if (taosTWrite(pFile->fd, (void *)(pHelper->pCompInfo), pIdx->len) < (int)pIdx->len) { tsdbError("vgId:%d failed to write %d bytes to file %s since %s", REPO_ID(pHelper->pRepo), pIdx->len, pFile->fname, strerror(errno)); terrno = TAOS_SYSTEM_ERROR(errno); @@ -435,7 +435,7 @@ int tsdbWriteCompIdx(SRWHelper *pHelper) { ASSERT(offset == pFile->info.size); - if (taosTWrite(pFile->fd, (void *)pHelper->pWIdx, pFile->info.len) < pFile->info.len) { + if (taosTWrite(pFile->fd, (void *)pHelper->pWIdx, pFile->info.len) < (int)pFile->info.len) { tsdbError("vgId:%d failed to write %d bytes to file %s since %s", REPO_ID(pHelper->pRepo), pFile->info.len, pFile->fname, strerror(errno)); terrno = TAOS_SYSTEM_ERROR(errno); @@ -468,7 +468,7 @@ int tsdbLoadCompIdx(SRWHelper *pHelper, void *target) { return -1; } - if (taosTRead(fd, (void *)(pHelper->pBuffer), pFile->info.len) < pFile->info.len) { + if (taosTRead(fd, (void *)(pHelper->pBuffer), pFile->info.len) < (int)pFile->info.len) { tsdbError("vgId:%d failed to read %d bytes from file %s since %s", REPO_ID(pHelper->pRepo), pFile->info.len, pFile->fname, strerror(errno)); terrno = TAOS_SYSTEM_ERROR(errno); @@ -485,7 +485,7 @@ int tsdbLoadCompIdx(SRWHelper *pHelper, void *target) { // Decode it pHelper->idxH.numOfIdx = 0; void *ptr = pHelper->pBuffer; - while (POINTER_DISTANCE(ptr, pHelper->pBuffer) < (pFile->info.len - sizeof(TSCKSUM))) { + while (POINTER_DISTANCE(ptr, pHelper->pBuffer) < (int)(pFile->info.len - sizeof(TSCKSUM))) { size_t tlen = taosTSizeof(pHelper->idxH.pIdxArray); pHelper->idxH.numOfIdx++; @@ -508,7 +508,7 @@ int tsdbLoadCompIdx(SRWHelper *pHelper, void *target) { ASSERT(pHelper->idxH.numOfIdx == 1 || pHelper->idxH.pIdxArray[pHelper->idxH.numOfIdx - 1].tid > pHelper->idxH.pIdxArray[pHelper->idxH.numOfIdx - 2].tid); - ASSERT(POINTER_DISTANCE(ptr, pHelper->pBuffer) <= pFile->info.len - sizeof(TSCKSUM)); + ASSERT(POINTER_DISTANCE(ptr, pHelper->pBuffer) <= (int)(pFile->info.len - sizeof(TSCKSUM))); } } } @@ -539,7 +539,7 @@ int tsdbLoadCompInfo(SRWHelper *pHelper, void *target) { } pHelper->pCompInfo = taosTRealloc((void *)pHelper->pCompInfo, pIdx->len); - if (taosTRead(fd, (void *)(pHelper->pCompInfo), pIdx->len) < pIdx->len) { + if (taosTRead(fd, (void *)(pHelper->pCompInfo), pIdx->len) < (int)pIdx->len) { tsdbError("vgId:%d failed to read %d bytes from file %s since %s", REPO_ID(pHelper->pRepo), pIdx->len, helperHeadF(pHelper)->fname, strerror(errno)); terrno = TAOS_SYSTEM_ERROR(errno); @@ -567,7 +567,7 @@ int tsdbLoadCompData(SRWHelper *pHelper, SCompBlock *pCompBlock, void *target) { ASSERT(pCompBlock->numOfSubBlocks <= 1); SFile *pFile = (pCompBlock->last) ? helperLastF(pHelper) : helperDataF(pHelper); - if (lseek(pFile->fd, pCompBlock->offset, SEEK_SET) < 0) { + if (lseek(pFile->fd, (off_t)pCompBlock->offset, SEEK_SET) < 0) { tsdbError("vgId:%d failed to lseek file %s since %s", REPO_ID(pHelper->pRepo), pFile->fname, strerror(errno)); terrno = TAOS_SYSTEM_ERROR(errno); return -1; @@ -587,7 +587,7 @@ int tsdbLoadCompData(SRWHelper *pHelper, SCompBlock *pCompBlock, void *target) { return -1; } - if (!taosCheckChecksumWhole((uint8_t *)pHelper->pCompData, tsize)) { + if (!taosCheckChecksumWhole((uint8_t *)pHelper->pCompData, (uint32_t)tsize)) { tsdbError("vgId:%d file %s is broken, offset %" PRId64 " size %zu", REPO_ID(pHelper->pRepo), pFile->fname, (int64_t)pCompBlock->offset, tsize); terrno = TSDB_CODE_TDB_FILE_CORRUPTED; @@ -760,8 +760,8 @@ static int tsdbWriteBlockToFile(SRWHelper *pHelper, SFile *pFile, SDataCols *pDa } flen = (*(tDataTypeDesc[pDataCol->type].compFunc))((char *)pDataCol->pData, tlen, rowsToWrite, tptr, - taosTSizeof(pHelper->pBuffer) - lsize, pCfg->compression, - pHelper->compBuffer, taosTSizeof(pHelper->compBuffer)); + (int32_t)taosTSizeof(pHelper->pBuffer) - lsize, pCfg->compression, + pHelper->compBuffer, (int32_t)taosTSizeof(pHelper->compBuffer)); } else { flen = tlen; memcpy(tptr, pDataCol->pData, flen); @@ -855,7 +855,7 @@ static int tsdbAdjustInfoSizeIfNeeded(SRWHelper *pHelper, size_t esize) { static int tsdbInsertSuperBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int blkIdx) { SCompIdx *pIdx = &(pHelper->curCompIdx); - ASSERT(blkIdx >= 0 && blkIdx <= pIdx->numOfBlocks); + ASSERT(blkIdx >= 0 && blkIdx <= (int)pIdx->numOfBlocks); ASSERT(pCompBlock->numOfSubBlocks == 1); // Adjust memory if no more room @@ -863,7 +863,7 @@ static int tsdbInsertSuperBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int if (tsdbAdjustInfoSizeIfNeeded(pHelper, pIdx->len + sizeof(SCompInfo)) < 0) goto _err; // Change the offset - for (int i = 0; i < pIdx->numOfBlocks; i++) { + for (uint32_t i = 0; i < pIdx->numOfBlocks; i++) { SCompBlock *pTCompBlock = &pHelper->pCompInfo->blocks[i]; if (pTCompBlock->numOfSubBlocks > 1) pTCompBlock->offset += sizeof(SCompBlock); } @@ -882,7 +882,7 @@ static int tsdbInsertSuperBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int pIdx->len += sizeof(SCompBlock); ASSERT(pIdx->len <= taosTSizeof(pHelper->pCompInfo)); pIdx->maxKey = blockAtIdx(pHelper, pIdx->numOfBlocks - 1)->keyLast; - pIdx->hasLast = blockAtIdx(pHelper, pIdx->numOfBlocks - 1)->last; + pIdx->hasLast = (uint32_t)blockAtIdx(pHelper, pIdx->numOfBlocks - 1)->last; if (pIdx->numOfBlocks > 1) { ASSERT(pHelper->pCompInfo->blocks[0].keyLast < pHelper->pCompInfo->blocks[1].keyFirst); @@ -901,7 +901,7 @@ static int tsdbAddSubBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int blkId ASSERT(pCompBlock->numOfSubBlocks == 0); SCompIdx *pIdx = &(pHelper->curCompIdx); - ASSERT(blkIdx >= 0 && blkIdx < pIdx->numOfBlocks); + ASSERT(blkIdx >= 0 && blkIdx < (int)pIdx->numOfBlocks); SCompBlock *pSCompBlock = pHelper->pCompInfo->blocks + blkIdx; ASSERT(pSCompBlock->numOfSubBlocks >= 1 && pSCompBlock->numOfSubBlocks < TSDB_MAX_SUBBLOCKS); @@ -919,7 +919,7 @@ static int tsdbAddSubBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int blkId memmove((void *)((char *)(pHelper->pCompInfo) + pSCompBlock->offset + pSCompBlock->len + sizeof(SCompBlock)), (void *)((char *)(pHelper->pCompInfo) + pSCompBlock->offset + pSCompBlock->len), tsize); - for (int i = blkIdx + 1; i < pIdx->numOfBlocks; i++) { + for (uint32_t i = blkIdx + 1; i < pIdx->numOfBlocks; i++) { SCompBlock *pTCompBlock = &pHelper->pCompInfo->blocks[i]; if (pTCompBlock->numOfSubBlocks > 1) pTCompBlock->offset += sizeof(SCompBlock); } @@ -936,7 +936,7 @@ static int tsdbAddSubBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int blkId pIdx->len += sizeof(SCompBlock); } else { // Need to create two sub-blocks void *ptr = NULL; - for (int i = blkIdx + 1; i < pIdx->numOfBlocks; i++) { + for (uint32_t i = blkIdx + 1; i < pIdx->numOfBlocks; i++) { SCompBlock *pTCompBlock = pHelper->pCompInfo->blocks + i; if (pTCompBlock->numOfSubBlocks > 1) { ptr = POINTER_SHIFT(pHelper->pCompInfo, pTCompBlock->offset); @@ -949,7 +949,7 @@ static int tsdbAddSubBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int blkId size_t tsize = pIdx->len - ((char *)ptr - (char *)(pHelper->pCompInfo)); if (tsize > 0) { memmove(POINTER_SHIFT(ptr, sizeof(SCompBlock) * 2), ptr, tsize); - for (int i = blkIdx + 1; i < pIdx->numOfBlocks; i++) { + for (uint32_t i = blkIdx + 1; i < pIdx->numOfBlocks; i++) { SCompBlock *pTCompBlock = pHelper->pCompInfo->blocks + i; if (pTCompBlock->numOfSubBlocks > 1) pTCompBlock->offset += (sizeof(SCompBlock) * 2); } @@ -971,7 +971,7 @@ static int tsdbAddSubBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int blkId } pIdx->maxKey = pHelper->pCompInfo->blocks[pIdx->numOfBlocks - 1].keyLast; - pIdx->hasLast = pHelper->pCompInfo->blocks[pIdx->numOfBlocks - 1].last; + pIdx->hasLast = (uint32_t)pHelper->pCompInfo->blocks[pIdx->numOfBlocks - 1].last; tsdbDebug("vgId:%d tid:%d a subblock is added at index %d", REPO_ID(pHelper->pRepo), pHelper->tableInfo.tid, blkIdx); @@ -986,7 +986,7 @@ static int tsdbUpdateSuperBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int SCompIdx *pIdx = &(pHelper->curCompIdx); - ASSERT(blkIdx >= 0 && blkIdx < pIdx->numOfBlocks); + ASSERT(blkIdx >= 0 && blkIdx < (int)pIdx->numOfBlocks); SCompBlock *pSCompBlock = pHelper->pCompInfo->blocks + blkIdx; @@ -1000,7 +1000,7 @@ static int tsdbUpdateSuperBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int POINTER_SHIFT(pHelper->pCompInfo, pSCompBlock->offset + pSCompBlock->len), tsize); } - for (int i = blkIdx + 1; i < pIdx->numOfBlocks; i++) { + for (uint32_t i = blkIdx + 1; i < pIdx->numOfBlocks; i++) { SCompBlock *pTCompBlock = &pHelper->pCompInfo->blocks[i]; if (pTCompBlock->numOfSubBlocks > 1) pTCompBlock->offset -= (sizeof(SCompBlock) * pSCompBlock->numOfSubBlocks); } @@ -1011,7 +1011,7 @@ static int tsdbUpdateSuperBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int *pSCompBlock = *pCompBlock; pIdx->maxKey = blockAtIdx(pHelper, pIdx->numOfBlocks - 1)->keyLast; - pIdx->hasLast = blockAtIdx(pHelper, pIdx->numOfBlocks - 1)->last; + pIdx->hasLast = (uint32_t)blockAtIdx(pHelper, pIdx->numOfBlocks - 1)->last; tsdbDebug("vgId:%d tid:%d a super block is updated at index %d", REPO_ID(pHelper->pRepo), pHelper->tableInfo.tid, blkIdx); @@ -1169,7 +1169,7 @@ static int tsdbLoadColData(SRWHelper *pHelper, SFile *pFile, SCompBlock *pCompBl } int64_t offset = pCompBlock->offset + TSDB_GET_COMPCOL_LEN(pCompBlock->numOfCols) + pCompCol->offset; - if (lseek(pFile->fd, offset, SEEK_SET) < 0) { + if (lseek(pFile->fd, (off_t)offset, SEEK_SET) < 0) { tsdbError("vgId:%d failed to lseek file %s since %s", REPO_ID(pHelper->pRepo), pFile->fname, strerror(errno)); terrno = TAOS_SYSTEM_ERROR(errno); return -1; @@ -1184,7 +1184,7 @@ static int tsdbLoadColData(SRWHelper *pHelper, SFile *pFile, SCompBlock *pCompBl if (tsdbCheckAndDecodeColumnData(pDataCol, pHelper->pBuffer, pCompCol->len, pCompBlock->algorithm, pCompBlock->numOfRows, pHelper->pRepo->config.maxRowsPerFileBlock, - pHelper->compBuffer, taosTSizeof(pHelper->compBuffer)) < 0) { + pHelper->compBuffer, (int32_t)taosTSizeof(pHelper->compBuffer)) < 0) { tsdbError("vgId:%d file %s is broken at column %d offset %" PRId64, REPO_ID(pHelper->pRepo), pFile->fname, pCompCol->colId, offset); return -1; @@ -1284,7 +1284,7 @@ static int tsdbLoadBlockDataImpl(SRWHelper *pHelper, SCompBlock *pCompBlock, SDa SCompData *pCompData = (SCompData *)pHelper->pBuffer; int fd = pFile->fd; - if (lseek(fd, pCompBlock->offset, SEEK_SET) < 0) { + if (lseek(fd, (off_t)pCompBlock->offset, SEEK_SET) < 0) { tsdbError("vgId:%d tid:%d failed to lseek file %s since %s", REPO_ID(pHelper->pRepo), pHelper->tableInfo.tid, pFile->fname, strerror(errno)); terrno = TAOS_SYSTEM_ERROR(errno); @@ -1347,7 +1347,7 @@ static int tsdbLoadBlockDataImpl(SRWHelper *pHelper, SCompBlock *pCompBlock, SDa } if (tsdbCheckAndDecodeColumnData(pDataCol, (char *)pCompData + tsize + toffset, tlen, pCompBlock->algorithm, pCompBlock->numOfRows, pDataCols->maxPoints, pHelper->compBuffer, - taosTSizeof(pHelper->compBuffer)) < 0) { + (int32_t)taosTSizeof(pHelper->compBuffer)) < 0) { tsdbError("vgId:%d file %s is broken at column %d block offset %" PRId64 " column offset %d", REPO_ID(pHelper->pRepo), pFile->fname, tcolId, (int64_t)pCompBlock->offset, toffset); goto _err; @@ -1471,7 +1471,7 @@ static int tsdbProcessMergeCommit(SRWHelper *pHelper, SCommitIter *pCommitIter, SCompBlock *pCompBlock = taosbsearch((void *)(&keyFirst), (void *)blockAtIdx(pHelper, *blkIdx), pIdx->numOfBlocks - *blkIdx, sizeof(SCompBlock), compareKeyBlock, TD_GE); ASSERT(pCompBlock != NULL); - int tblkIdx = TSDB_GET_COMPBLOCK_IDX(pHelper, pCompBlock); + int tblkIdx = (int32_t)(TSDB_GET_COMPBLOCK_IDX(pHelper, pCompBlock)); if (pCompBlock->last) { ASSERT(pCompBlock->numOfRows < pCfg->minRowsPerFileBlock && tblkIdx == pIdx->numOfBlocks - 1); diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index a34216d2fba7ca22351938b0bd593c7b3444d645..17b0239e3be23c49ff75f9da696dc8fab65055aa 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -235,9 +235,10 @@ TsdbQueryHandleT* tsdbQueryTables(TSDB_REPO_T* tsdb, STsdbQueryCond* pCond, STab STableCheckInfo info = { .lastKey = pQueryHandle->window.skey, - .tableId = pTable->tableId, + //.tableId = pTable->tableId, .pTableObj = pTable, }; + info.tableId = pTable->tableId; assert(info.pTableObj != NULL && (info.pTableObj->type == TSDB_NORMAL_TABLE || info.pTableObj->type == TSDB_CHILD_TABLE || info.pTableObj->type == TSDB_STREAM_TABLE)); @@ -523,7 +524,7 @@ static int32_t getFileIdFromKey(TSKEY key, int32_t daysPerFile, int32_t precisio fid = INT32_MAX; } - return fid; + return (int32_t)fid; } static int32_t binarySearchForBlock(SCompBlock* pBlock, int32_t numOfBlocks, TSKEY skey, int32_t order) { @@ -571,7 +572,7 @@ static int32_t getFileCompInfo(STsdbQueryHandle* pQueryHandle, int32_t* numOfBlo continue; // no data blocks in the file belongs to pCheckInfo->pTable } - if (pCheckInfo->compSize < compIndex->len) { + if (pCheckInfo->compSize < (int32_t)compIndex->len) { assert(compIndex->len > 0); char* t = realloc(pCheckInfo->pCompInfo, compIndex->len); @@ -604,7 +605,7 @@ static int32_t getFileCompInfo(STsdbQueryHandle* pQueryHandle, int32_t* numOfBlo } // todo speedup the procedure of located end block - while (end < compIndex->numOfBlocks && (pCompInfo->blocks[end].keyFirst <= e)) { + while (end < (int32_t)compIndex->numOfBlocks && (pCompInfo->blocks[end].keyFirst <= e)) { end += 1; } @@ -644,7 +645,7 @@ static bool doLoadFileDataBlock(STsdbQueryHandle* pQueryHandle, SCompBlock* pBlo tdInitDataCols(pQueryHandle->rhelper.pDataCols[1], pSchema); int16_t* colIds = pQueryHandle->defaultLoadColumn->pData; - int32_t ret = tsdbLoadBlockDataCols(&(pQueryHandle->rhelper), pBlock, pCheckInfo->pCompInfo, colIds, QH_GET_NUM_OF_COLS(pQueryHandle)); + int32_t ret = tsdbLoadBlockDataCols(&(pQueryHandle->rhelper), pBlock, pCheckInfo->pCompInfo, colIds, (int)(QH_GET_NUM_OF_COLS(pQueryHandle))); if (ret == TSDB_CODE_SUCCESS) { SDataBlockLoadInfo* pBlockLoadInfo = &pQueryHandle->dataBlockLoadInfo; @@ -846,7 +847,7 @@ static int32_t copyDataFromFileBlock(STsdbQueryHandle* pQueryHandle, int32_t cap return numOfRows; } - int32_t requiredNumOfCols = taosArrayGetSize(pQueryHandle->pColumns); + int32_t requiredNumOfCols = (int32_t)taosArrayGetSize(pQueryHandle->pColumns); //data in buffer has greater timestamp, copy data in file block int32_t i = 0, j = 0; @@ -862,15 +863,15 @@ static int32_t copyDataFromFileBlock(STsdbQueryHandle* pQueryHandle, int32_t cap int32_t bytes = pColInfo->info.bytes; if (ASCENDING_TRAVERSE(pQueryHandle->order)) { - pData = pColInfo->pData + numOfRows * pColInfo->info.bytes; + pData = (char*)pColInfo->pData + numOfRows * pColInfo->info.bytes; } else { - pData = pColInfo->pData + (capacity - numOfRows - num) * pColInfo->info.bytes; + pData = (char*)pColInfo->pData + (capacity - numOfRows - num) * pColInfo->info.bytes; } if (pColInfo->info.colId == src->colId) { if (pColInfo->info.type != TSDB_DATA_TYPE_BINARY && pColInfo->info.type != TSDB_DATA_TYPE_NCHAR) { - memmove(pData, src->pData + bytes * start, bytes * num); + memmove(pData, (char*)src->pData + bytes * start, bytes * num); } else { // handle the var-string char* dst = pData; @@ -902,9 +903,9 @@ static int32_t copyDataFromFileBlock(STsdbQueryHandle* pQueryHandle, int32_t cap while (i < requiredNumOfCols) { // the remain columns are all null data SColumnInfoData* pColInfo = taosArrayGet(pQueryHandle->pColumns, i); if (ASCENDING_TRAVERSE(pQueryHandle->order)) { - pData = pColInfo->pData + numOfRows * pColInfo->info.bytes; + pData = (char*)pColInfo->pData + numOfRows * pColInfo->info.bytes; } else { - pData = pColInfo->pData + (capacity - numOfRows - num) * pColInfo->info.bytes; + pData = (char*)pColInfo->pData + (capacity - numOfRows - num) * pColInfo->info.bytes; } if (pColInfo->info.type == TSDB_DATA_TYPE_BINARY || pColInfo->info.type == TSDB_DATA_TYPE_NCHAR) { @@ -944,13 +945,13 @@ static void copyOneRowFromMem(STsdbQueryHandle* pQueryHandle, int32_t capacity, } if (ASCENDING_TRAVERSE(pQueryHandle->order)) { - pData = pColInfo->pData + numOfRows * pColInfo->info.bytes; + pData = (char*)pColInfo->pData + numOfRows * pColInfo->info.bytes; } else { - pData = pColInfo->pData + (capacity - numOfRows - 1) * pColInfo->info.bytes; + pData = (char*)pColInfo->pData + (capacity - numOfRows - 1) * pColInfo->info.bytes; } if (pSchema->columns[j].colId == pColInfo->info.colId) { - void* value = tdGetRowDataOfCol(row, pColInfo->info.type, TD_DATA_ROW_HEAD_SIZE + pSchema->columns[j].offset); + void* value = tdGetRowDataOfCol(row, (int8_t)pColInfo->info.type, TD_DATA_ROW_HEAD_SIZE + pSchema->columns[j].offset); if (pColInfo->info.type == TSDB_DATA_TYPE_BINARY || pColInfo->info.type == TSDB_DATA_TYPE_NCHAR) { memcpy(pData, value, varDataTLen(value)); } else { @@ -972,9 +973,9 @@ static void copyOneRowFromMem(STsdbQueryHandle* pQueryHandle, int32_t capacity, while (i < numOfCols) { // the remain columns are all null data SColumnInfoData* pColInfo = taosArrayGet(pQueryHandle->pColumns, i); if (ASCENDING_TRAVERSE(pQueryHandle->order)) { - pData = pColInfo->pData + numOfRows * pColInfo->info.bytes; + pData = (char*)pColInfo->pData + numOfRows * pColInfo->info.bytes; } else { - pData = pColInfo->pData + (capacity - numOfRows - 1) * pColInfo->info.bytes; + pData = (char*)pColInfo->pData + (capacity - numOfRows - 1) * pColInfo->info.bytes; } if (pColInfo->info.type == TSDB_DATA_TYPE_BINARY || pColInfo->info.type == TSDB_DATA_TYPE_NCHAR) { @@ -997,7 +998,7 @@ static void moveDataToFront(STsdbQueryHandle* pQueryHandle, int32_t numOfRows, i int32_t emptySize = pQueryHandle->outputCapacity - numOfRows; for(int32_t i = 0; i < numOfCols; ++i) { SColumnInfoData* pColInfo = taosArrayGet(pQueryHandle->pColumns, i); - memmove(pColInfo->pData, pColInfo->pData + emptySize * pColInfo->info.bytes, numOfRows * pColInfo->info.bytes); + memmove((char*)pColInfo->pData, (char*)pColInfo->pData + emptySize * pColInfo->info.bytes, numOfRows * pColInfo->info.bytes); } } } @@ -1075,7 +1076,7 @@ static void doMergeTwoLevelData(STsdbQueryHandle* pQueryHandle, STableCheckInfo* int32_t order = (pQueryHandle->order == TSDB_ORDER_ASC)? TSDB_ORDER_DESC:TSDB_ORDER_ASC; int32_t step = ASCENDING_TRAVERSE(pQueryHandle->order)? 1:-1; - int32_t numOfCols = QH_GET_NUM_OF_COLS(pQueryHandle); + int32_t numOfCols = (int32_t)(QH_GET_NUM_OF_COLS(pQueryHandle)); STable* pTable = pCheckInfo->pTableObj; int32_t endPos = cur->pos; @@ -1326,7 +1327,7 @@ static int32_t createDataBlocksInfo(STsdbQueryHandle* pQueryHandle, int32_t numO size_t size = sizeof(STableBlockInfo) * numOfBlocks; if (pQueryHandle->allocSize < size) { - pQueryHandle->allocSize = size; + pQueryHandle->allocSize = (int32_t)size; char* tmp = realloc(pQueryHandle->pDataBlockInfo, pQueryHandle->allocSize); if (tmp == NULL) { return TSDB_CODE_TDB_OUT_OF_MEMORY; @@ -1338,7 +1339,7 @@ static int32_t createDataBlocksInfo(STsdbQueryHandle* pQueryHandle, int32_t numO memset(pQueryHandle->pDataBlockInfo, 0, size); *numOfAllocBlocks = numOfBlocks; - int32_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo); + int32_t numOfTables = (int32_t)taosArrayGetSize(pQueryHandle->pTableCheckInfo); SBlockOrderSupporter sup = {0}; sup.numOfTables = numOfTables; @@ -1445,7 +1446,7 @@ static int32_t getDataBlocksInFilesImpl(STsdbQueryHandle* pQueryHandle, bool* ex int32_t code = TSDB_CODE_SUCCESS; int32_t numOfBlocks = 0; - int32_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo); + int32_t numOfTables = (int32_t)taosArrayGetSize(pQueryHandle->pTableCheckInfo); STsdbCfg* pCfg = &pQueryHandle->pTsdb->config; STimeWindow win = TSWINDOW_INITIALIZER; @@ -1615,10 +1616,10 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) { if (pQueryHandle->cur.win.ekey == pQueryHandle->window.skey) { // data already retrieve, discard other data rows and return - int32_t numOfCols = QH_GET_NUM_OF_COLS(pQueryHandle); + int32_t numOfCols = (int32_t)(QH_GET_NUM_OF_COLS(pQueryHandle)); for (int32_t i = 0; i < numOfCols; ++i) { SColumnInfoData* pCol = taosArrayGet(pQueryHandle->pColumns, i); - memcpy(pCol->pData, pCol->pData + pCol->info.bytes * (pQueryHandle->cur.rows-1), pCol->info.bytes); + memcpy((char*)pCol->pData, (char*)pCol->pData + pCol->info.bytes * (pQueryHandle->cur.rows - 1), pCol->info.bytes); } pQueryHandle->cur.win = (STimeWindow){pQueryHandle->window.skey, pQueryHandle->window.skey}; @@ -1646,7 +1647,7 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) { tsdbTakeMemSnapshot(pSecQueryHandle->pTsdb, &pSecQueryHandle->mem, &pSecQueryHandle->imem); // allocate buffer in order to load data blocks from file - int32_t numOfCols = QH_GET_NUM_OF_COLS(pQueryHandle); + int32_t numOfCols = (int32_t)(QH_GET_NUM_OF_COLS(pQueryHandle)); pSecQueryHandle->statis = calloc(numOfCols, sizeof(SDataStatis)); pSecQueryHandle->pColumns = taosArrayInit(numOfCols, sizeof(SColumnInfoData)); @@ -1669,9 +1670,10 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) { STableCheckInfo* pCheckInfo = (STableCheckInfo*) taosArrayGet(pQueryHandle->pTableCheckInfo, j); STableCheckInfo info = { .lastKey = pSecQueryHandle->window.skey, - .tableId = pCheckInfo->tableId, + //.tableId = pCheckInfo->tableId, .pTableObj = pCheckInfo->pTableObj, }; + info.tableId = pCheckInfo->tableId; taosArrayPush(pSecQueryHandle->pTableCheckInfo, &info); } @@ -1688,12 +1690,12 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) { for (int32_t i = 0; i < numOfCols; ++i) { SColumnInfoData* pCol = taosArrayGet(pQueryHandle->pColumns, i); - memcpy(pCol->pData, pCol->pData + pCol->info.bytes * (pQueryHandle->cur.rows-1), pCol->info.bytes); + memcpy((char*)pCol->pData, (char*)pCol->pData + pCol->info.bytes * (pQueryHandle->cur.rows - 1), pCol->info.bytes); SColumnInfoData* pCol1 = taosArrayGet(pSecQueryHandle->pColumns, i); assert(pCol->info.colId == pCol1->info.colId); - memcpy(pCol->pData + pCol->info.bytes, pCol1->pData, pCol1->info.bytes); + memcpy((char*)pCol->pData + pCol->info.bytes, pCol1->pData, pCol1->info.bytes); } SColumnInfoData* pTSCol = taosArrayGet(pQueryHandle->pColumns, 0); @@ -1839,7 +1841,7 @@ static void changeQueryHandleForInterpQuery(TsdbQueryHandleT pHandle) { static int tsdbReadRowsFromCache(STableCheckInfo* pCheckInfo, TSKEY maxKey, int maxRowsToRead, STimeWindow* win, STsdbQueryHandle* pQueryHandle) { int numOfRows = 0; - int32_t numOfCols = taosArrayGetSize(pQueryHandle->pColumns); + int32_t numOfCols = (int32_t)taosArrayGetSize(pQueryHandle->pColumns); win->skey = TSKEY_INITIAL_VAL; int64_t st = taosGetTimestampUs(); @@ -1881,7 +1883,7 @@ static int tsdbReadRowsFromCache(STableCheckInfo* pCheckInfo, TSKEY maxKey, int for(int32_t i = 0; i < numOfCols; ++i) { SColumnInfoData* pColInfo = taosArrayGet(pQueryHandle->pColumns, i); - memmove(pColInfo->pData, pColInfo->pData + emptySize * pColInfo->info.bytes, numOfRows * pColInfo->info.bytes); + memmove((char*)pColInfo->pData, (char*)pColInfo->pData + emptySize * pColInfo->info.bytes, numOfRows * pColInfo->info.bytes); } } @@ -1910,7 +1912,7 @@ void tsdbRetrieveDataBlockInfo(TsdbQueryHandleT* pQueryHandle, SDataBlockInfo* p pDataBlockInfo->tid = pTable->tableId.tid; pDataBlockInfo->rows = cur->rows; pDataBlockInfo->window = cur->win; - pDataBlockInfo->numOfCols = QH_GET_NUM_OF_COLS(pHandle); + pDataBlockInfo->numOfCols = (int32_t)(QH_GET_NUM_OF_COLS(pHandle)); } /* @@ -1945,7 +1947,7 @@ int32_t tsdbRetrieveDataBlockStatisInfo(TsdbQueryHandleT* pQueryHandle, SDataSta pHandle->statis[i].colId = colIds[i]; } - tsdbGetDataStatis(&pHandle->rhelper, pHandle->statis, numOfCols); + tsdbGetDataStatis(&pHandle->rhelper, pHandle->statis, (int)numOfCols); // always load the first primary timestamp column data SDataStatis* pPrimaryColStatis = &pHandle->statis[0]; @@ -2010,11 +2012,11 @@ SArray* tsdbRetrieveDataBlock(TsdbQueryHandleT* pQueryHandle, SArray* pIdList) { // if the buffer is not full in case of descending order query, move the data in the front of the buffer if (!ASCENDING_TRAVERSE(pHandle->order) && numOfRows < pHandle->outputCapacity) { int32_t emptySize = pHandle->outputCapacity - numOfRows; - int32_t reqNumOfCols = taosArrayGetSize(pHandle->pColumns); + int32_t reqNumOfCols = (int32_t)taosArrayGetSize(pHandle->pColumns); for(int32_t i = 0; i < reqNumOfCols; ++i) { SColumnInfoData* pColInfo = taosArrayGet(pHandle->pColumns, i); - memmove(pColInfo->pData, pColInfo->pData + emptySize * pColInfo->info.bytes, numOfRows * pColInfo->info.bytes); + memmove((char*)pColInfo->pData, (char*)pColInfo->pData + emptySize * pColInfo->info.bytes, numOfRows * pColInfo->info.bytes); } } @@ -2332,7 +2334,7 @@ int32_t tsdbQuerySTableByTagCond(TSDB_REPO_T* tsdb, uint64_t uid, const char* pT THROW( TSDB_CODE_TDB_OUT_OF_MEMORY ); } expr->nodeType = TSQL_NODE_EXPR; - expr->_node.optr = tagNameRelType; + expr->_node.optr = (uint8_t)tagNameRelType; expr->_node.pLeft = tagExpr; expr->_node.pRight = tbnameExpr; } @@ -2442,11 +2444,8 @@ void tsdbCleanupQueryHandle(TsdbQueryHandleT queryHandle) { STableCheckInfo* pTableCheckInfo = taosArrayGet(pQueryHandle->pTableCheckInfo, i); destroyTableMemIterator(pTableCheckInfo); - if (pTableCheckInfo->pDataCols != NULL) { - taosTFree(pTableCheckInfo->pDataCols->buf); - } - - taosTFree(pTableCheckInfo->pDataCols); + tdFreeDataCols(pTableCheckInfo->pDataCols); + pTableCheckInfo->pDataCols = NULL; taosTFree(pTableCheckInfo->pCompInfo); } taosArrayDestroy(pQueryHandle->pTableCheckInfo); diff --git a/src/util/inc/tscompression.h b/src/util/inc/tscompression.h index 9398ff82439445692b2e1c90041fd0595bbc27c7..bd1ccf3ca5fd52cb8e6f596ff955579389cd249f 100644 --- a/src/util/inc/tscompression.h +++ b/src/util/inc/tscompression.h @@ -56,6 +56,7 @@ static FORCE_INLINE int tsCompressTinyint(const char *const input, int inputSize return tsCompressStringImp(buffer, len, output, outputSize); } else { assert(0); + return -1; } } @@ -68,6 +69,7 @@ static FORCE_INLINE int tsDecompressTinyint(const char *const input, int compres return tsDecompressINTImp(buffer, nelements, output, TSDB_DATA_TYPE_TINYINT); } else { assert(0); + return -1; } } @@ -80,6 +82,7 @@ static FORCE_INLINE int tsCompressSmallint(const char *const input, int inputSiz return tsCompressStringImp(buffer, len, output, outputSize); } else { assert(0); + return -1; } } @@ -92,6 +95,7 @@ static FORCE_INLINE int tsDecompressSmallint(const char *const input, int compre return tsDecompressINTImp(buffer, nelements, output, TSDB_DATA_TYPE_SMALLINT); } else { assert(0); + return -1; } } @@ -104,6 +108,7 @@ static FORCE_INLINE int tsCompressInt(const char *const input, int inputSize, co return tsCompressStringImp(buffer, len, output, outputSize); } else { assert(0); + return -1; } } @@ -116,6 +121,7 @@ static FORCE_INLINE int tsDecompressInt(const char *const input, int compressedS return tsDecompressINTImp(buffer, nelements, output, TSDB_DATA_TYPE_INT); } else { assert(0); + return -1; } } @@ -128,6 +134,7 @@ static FORCE_INLINE int tsCompressBigint(const char *const input, int inputSize, return tsCompressStringImp(buffer, len, output, outputSize); } else { assert(0); + return -1; } } @@ -140,6 +147,7 @@ static FORCE_INLINE int tsDecompressBigint(const char *const input, int compress return tsDecompressINTImp(buffer, nelements, output, TSDB_DATA_TYPE_BIGINT); } else { assert(0); + return -1; } } @@ -152,6 +160,7 @@ static FORCE_INLINE int tsCompressBool(const char *const input, int inputSize, c return tsCompressStringImp(buffer, len, output, outputSize); } else { assert(0); + return -1; } } @@ -164,6 +173,7 @@ static FORCE_INLINE int tsDecompressBool(const char *const input, int compressed return tsDecompressBoolImp(buffer, nelements, output); } else { assert(0); + return -1; } } @@ -186,6 +196,7 @@ static FORCE_INLINE int tsCompressFloat(const char *const input, int inputSize, return tsCompressStringImp(buffer, len, output, outputSize); } else { assert(0); + return -1; } } @@ -198,6 +209,7 @@ static FORCE_INLINE int tsDecompressFloat(const char *const input, int compresse return tsDecompressFloatImp(buffer, nelements, output); } else { assert(0); + return -1; } } @@ -210,6 +222,7 @@ static FORCE_INLINE int tsCompressDouble(const char *const input, int inputSize, return tsCompressStringImp(buffer, len, output, outputSize); } else { assert(0); + return -1; } } @@ -222,6 +235,7 @@ static FORCE_INLINE int tsDecompressDouble(const char *const input, int compress return tsDecompressDoubleImp(buffer, nelements, output); } else { assert(0); + return -1; } } @@ -234,6 +248,7 @@ static FORCE_INLINE int tsCompressTimestamp(const char *const input, int inputSi return tsCompressStringImp(buffer, len, output, outputSize); } else { assert(0); + return -1; } } @@ -246,6 +261,7 @@ static FORCE_INLINE int tsDecompressTimestamp(const char *const input, int compr return tsDecompressTimestampImp(buffer, nelements, output); } else { assert(0); + return -1; } } diff --git a/src/util/inc/tstoken.h b/src/util/inc/tstoken.h index 258e62cf8a7808393493bf57eff46d7541dd2279..705c52af47f98bf17c47b8c73c55af8ca47a9cc2 100644 --- a/src/util/inc/tstoken.h +++ b/src/util/inc/tstoken.h @@ -182,6 +182,8 @@ static FORCE_INLINE int32_t isValidNumber(const SSQLToken* pToken) { return (i < pToken->n)? TK_ILLEGAL:type; } +void taosCleanupKeywordsTable(); + #ifdef __cplusplus } #endif diff --git a/src/util/src/tcompression.c b/src/util/src/tcompression.c index c20ba59ac9b351445cf9f97134ae08fd1e45f0f7..8c5828d32d2323cbdc7a05687c3e64e4e61a29af 100644 --- a/src/util/src/tcompression.c +++ b/src/util/src/tcompression.c @@ -591,6 +591,7 @@ int tsDecompressTimestampImp(const char *const input, const int nelements, char } else { assert(0); + return -1; } } /* --------------------------------------------Double Compression diff --git a/tests/comparisonTest/opentsdb/opentsdbtest/src/main/java/com/opentsdb/test/OpentsdbTest.java b/tests/comparisonTest/opentsdb/opentsdbtest/src/main/java/com/opentsdb/test/OpentsdbTest.java index 4d02922766d6a3424a21b127ebe888b4b582dbab..0e82c480ece8063bd78090d4bb67d87ffa698cc3 100644 --- a/tests/comparisonTest/opentsdb/opentsdbtest/src/main/java/com/opentsdb/test/OpentsdbTest.java +++ b/tests/comparisonTest/opentsdb/opentsdbtest/src/main/java/com/opentsdb/test/OpentsdbTest.java @@ -198,7 +198,7 @@ public class OpentsdbTest{ case "q2": //count startTime = System.currentTimeMillis(); - get_url = "http://192.168.1.114:4242/api/query?"; + get_url = "http://127.0.0.1:4242/api/query?"; httpPost = new HttpPost(get_url); qjson = " {\n" + " \"start\": 1563249700,\n" + @@ -351,7 +351,7 @@ public class OpentsdbTest{ break; case "q3": startTime = System.currentTimeMillis(); - get_url = "http://192.168.1.114:4242/api/query?"; + get_url = "http://127.0.0.1:4242/api/query?"; httpPost = new HttpPost(get_url); qjson = " {\n" + " \"start\": 1563249700,\n" + @@ -411,7 +411,7 @@ public class OpentsdbTest{ break; case "q4": startTime = System.currentTimeMillis(); - get_url = "http://192.168.1.114:4242/api/query?"; + get_url = "http://127.0.0.1:4242/api/query?"; httpPost = new HttpPost(get_url); qjson = " {\n" + " \"start\": 1563249700,\n" + diff --git a/tests/examples/c/subscribe.c b/tests/examples/c/subscribe.c index f9acf2bb10d36740dc5b82704e18256c4421ba5e..db5ad34ee7064978a888fc0e1cedc62aabc5a6a3 100644 --- a/tests/examples/c/subscribe.c +++ b/tests/examples/c/subscribe.c @@ -7,28 +7,31 @@ #include // include TDengine header file #include +int nTotalRows; + void print_result(TAOS_RES* res, int blockFetch) { TAOS_ROW row = NULL; int num_fields = taos_num_fields(res); TAOS_FIELD* fields = taos_fetch_fields(res); int nRows = 0; + char buf[4096]; + if (blockFetch) { nRows = taos_fetch_block(res, &row); for (int i = 0; i < nRows; i++) { - char temp[256]; - taos_print_row(temp, row + i, fields, num_fields); - puts(temp); + taos_print_row(buf, row + i, fields, num_fields); + puts(buf); } } else { while ((row = taos_fetch_row(res))) { - char temp[256]; - taos_print_row(temp, row, fields, num_fields); - puts(temp); + taos_print_row(buf, row, fields, num_fields); + puts(buf); nRows++; } } + nTotalRows += nRows; printf("%d rows consumed.\n", nRows); } @@ -52,47 +55,52 @@ void check_row_count(int line, TAOS_RES* res, int expected) { } +void do_query(TAOS* taos, const char* sql) { + TAOS_RES* res = taos_query(taos, "drop database if exists test;"); + taos_free_result(res); +} + + void run_test(TAOS* taos) { - taos_query(taos, "drop database if exists test;"); + do_query(taos, "drop database if exists test;"); usleep(100000); - //taos_query(taos, "create database test tables 5;"); - taos_query(taos, "create database test;"); + do_query(taos, "create database test;"); usleep(100000); - taos_query(taos, "use test;"); + do_query(taos, "use test;"); usleep(100000); - taos_query(taos, "create table meters(ts timestamp, a int) tags(area int);"); - - taos_query(taos, "create table t0 using meters tags(0);"); - taos_query(taos, "create table t1 using meters tags(1);"); - taos_query(taos, "create table t2 using meters tags(2);"); - taos_query(taos, "create table t3 using meters tags(3);"); - taos_query(taos, "create table t4 using meters tags(4);"); - taos_query(taos, "create table t5 using meters tags(5);"); - taos_query(taos, "create table t6 using meters tags(6);"); - taos_query(taos, "create table t7 using meters tags(7);"); - taos_query(taos, "create table t8 using meters tags(8);"); - taos_query(taos, "create table t9 using meters tags(9);"); - - taos_query(taos, "insert into t0 values('2020-01-01 00:00:00.000', 0);"); - taos_query(taos, "insert into t0 values('2020-01-01 00:01:00.000', 0);"); - taos_query(taos, "insert into t0 values('2020-01-01 00:02:00.000', 0);"); - taos_query(taos, "insert into t1 values('2020-01-01 00:00:00.000', 0);"); - taos_query(taos, "insert into t1 values('2020-01-01 00:01:00.000', 0);"); - taos_query(taos, "insert into t1 values('2020-01-01 00:02:00.000', 0);"); - taos_query(taos, "insert into t1 values('2020-01-01 00:03:00.000', 0);"); - taos_query(taos, "insert into t2 values('2020-01-01 00:00:00.000', 0);"); - taos_query(taos, "insert into t2 values('2020-01-01 00:01:00.000', 0);"); - taos_query(taos, "insert into t2 values('2020-01-01 00:01:01.000', 0);"); - taos_query(taos, "insert into t2 values('2020-01-01 00:01:02.000', 0);"); - taos_query(taos, "insert into t3 values('2020-01-01 00:01:02.000', 0);"); - taos_query(taos, "insert into t4 values('2020-01-01 00:01:02.000', 0);"); - taos_query(taos, "insert into t5 values('2020-01-01 00:01:02.000', 0);"); - taos_query(taos, "insert into t6 values('2020-01-01 00:01:02.000', 0);"); - taos_query(taos, "insert into t7 values('2020-01-01 00:01:02.000', 0);"); - taos_query(taos, "insert into t8 values('2020-01-01 00:01:02.000', 0);"); - taos_query(taos, "insert into t9 values('2020-01-01 00:01:02.000', 0);"); + do_query(taos, "create table meters(ts timestamp, a int) tags(area int);"); + + do_query(taos, "create table t0 using meters tags(0);"); + do_query(taos, "create table t1 using meters tags(1);"); + do_query(taos, "create table t2 using meters tags(2);"); + do_query(taos, "create table t3 using meters tags(3);"); + do_query(taos, "create table t4 using meters tags(4);"); + do_query(taos, "create table t5 using meters tags(5);"); + do_query(taos, "create table t6 using meters tags(6);"); + do_query(taos, "create table t7 using meters tags(7);"); + do_query(taos, "create table t8 using meters tags(8);"); + do_query(taos, "create table t9 using meters tags(9);"); + + do_query(taos, "insert into t0 values('2020-01-01 00:00:00.000', 0);"); + do_query(taos, "insert into t0 values('2020-01-01 00:01:00.000', 0);"); + do_query(taos, "insert into t0 values('2020-01-01 00:02:00.000', 0);"); + do_query(taos, "insert into t1 values('2020-01-01 00:00:00.000', 0);"); + do_query(taos, "insert into t1 values('2020-01-01 00:01:00.000', 0);"); + do_query(taos, "insert into t1 values('2020-01-01 00:02:00.000', 0);"); + do_query(taos, "insert into t1 values('2020-01-01 00:03:00.000', 0);"); + do_query(taos, "insert into t2 values('2020-01-01 00:00:00.000', 0);"); + do_query(taos, "insert into t2 values('2020-01-01 00:01:00.000', 0);"); + do_query(taos, "insert into t2 values('2020-01-01 00:01:01.000', 0);"); + do_query(taos, "insert into t2 values('2020-01-01 00:01:02.000', 0);"); + do_query(taos, "insert into t3 values('2020-01-01 00:01:02.000', 0);"); + do_query(taos, "insert into t4 values('2020-01-01 00:01:02.000', 0);"); + do_query(taos, "insert into t5 values('2020-01-01 00:01:02.000', 0);"); + do_query(taos, "insert into t6 values('2020-01-01 00:01:02.000', 0);"); + do_query(taos, "insert into t7 values('2020-01-01 00:01:02.000', 0);"); + do_query(taos, "insert into t8 values('2020-01-01 00:01:02.000', 0);"); + do_query(taos, "insert into t9 values('2020-01-01 00:01:02.000', 0);"); // super tables subscription usleep(1000000); @@ -104,23 +112,23 @@ void run_test(TAOS* taos) { res = taos_consume(tsub); check_row_count(__LINE__, res, 0); - taos_query(taos, "insert into t0 values('2020-01-01 00:02:00.001', 0);"); - taos_query(taos, "insert into t8 values('2020-01-01 00:01:03.000', 0);"); + do_query(taos, "insert into t0 values('2020-01-01 00:02:00.001', 0);"); + do_query(taos, "insert into t8 values('2020-01-01 00:01:03.000', 0);"); res = taos_consume(tsub); check_row_count(__LINE__, res, 2); - taos_query(taos, "insert into t2 values('2020-01-01 00:01:02.001', 0);"); - taos_query(taos, "insert into t1 values('2020-01-01 00:03:00.001', 0);"); + do_query(taos, "insert into t2 values('2020-01-01 00:01:02.001', 0);"); + do_query(taos, "insert into t1 values('2020-01-01 00:03:00.001', 0);"); res = taos_consume(tsub); check_row_count(__LINE__, res, 2); - taos_query(taos, "insert into t1 values('2020-01-01 00:03:00.002', 0);"); + do_query(taos, "insert into t1 values('2020-01-01 00:03:00.002', 0);"); res = taos_consume(tsub); check_row_count(__LINE__, res, 1); // keep progress information and restart subscription taos_unsubscribe(tsub, 1); - taos_query(taos, "insert into t0 values('2020-01-01 00:04:00.000', 0);"); + do_query(taos, "insert into t0 values('2020-01-01 00:04:00.000', 0);"); tsub = taos_subscribe(taos, 1, "test", "select * from meters;", NULL, NULL, 0); res = taos_consume(tsub); check_row_count(__LINE__, res, 24); @@ -147,7 +155,7 @@ void run_test(TAOS* taos) { res = taos_consume(tsub); check_row_count(__LINE__, res, 0); - taos_query(taos, "insert into t0 values('2020-01-01 00:04:00.001', 0);"); + do_query(taos, "insert into t0 values('2020-01-01 00:04:00.001', 0);"); res = taos_consume(tsub); check_row_count(__LINE__, res, 1); @@ -223,7 +231,7 @@ int main(int argc, char *argv[]) { exit(0); } - taos_query(taos, "use test;"); + taos_select_db(taos, "test"); TAOS_SUB* tsub = NULL; if (async) { // create an asynchronized subscription, the callback function will be called every 1s @@ -251,6 +259,7 @@ int main(int argc, char *argv[]) { } } + printf("total rows consumed: %d\n", nTotalRows); taos_unsubscribe(tsub, keep); taos_close(taos); diff --git a/tests/perftest-scripts/influxdbTestWriteLoop.sh b/tests/perftest-scripts/influxdbTestWriteLoop.sh new file mode 100755 index 0000000000000000000000000000000000000000..a9b10ac45d7f56514ae0141ae4cf9f1c668de351 --- /dev/null +++ b/tests/perftest-scripts/influxdbTestWriteLoop.sh @@ -0,0 +1,84 @@ +#!/bin/bash + +DATA_DIR=/mnt/root/testdata +NUM_LOOP=1 +NUM_OF_FILES=100 + +rowsPerRequest=(1 100 500 1000 2000) + +function printTo { + if $verbose ; then + echo $1 + fi +} + +function runTest { + printf "R/R, " + for c in `seq 1 $clients`; do + if [ "$c" == "1" ]; then + printf "$c client, " + else + printf "$c clients, " + fi + done + printf "\n" + + for r in ${rowsPerRequest[@]}; do + printf "$r, " + for c in `seq 1 $clients`; do + totalRPR=0 + OUTPUT_FILE=influxdbTestWrite-RPR$r-clients$c.out + for i in `seq 1 $NUM_LOOP`; do + printTo "loop i:$i, $INF_TEST_DIR/influxdbTest \ + -dataDir $DATA_DIR \ + -numOfFiles $NUM_OF_FILES \ + -writeClients $c \ + -rowsPerRequest $r" + $INF_TEST_DIR/influxdbTest \ + -dataDir $DATA_DIR \ + -numOfFiles $NUM_OF_FILES \ + -writeClients $c \ + -rowsPerRequest $r 2>&1 \ + | tee $OUTPUT_FILE + RPR=`cat $OUTPUT_FILE | grep speed | awk '{print $(NF-1)}'` + totalRPR=`echo "scale=4; $totalRPR + $RPR" | bc` + printTo "rows:$r, clients:$c, i:$i RPR:$RPR" + done + avgRPR=`echo "scale=4; $totalRPR / $NUM_LOOP" | bc` + printf "$avgRPR, " + done + printf "\n" + done +} + +################ Main ################ + +verbose=false +clients=1 + +while : ; do + case $1 in + -v) + verbose=true + shift ;; + + -n) + NUM_LOOP=$2 + shift 2;; + + -c) + clients=$2 + shift 2;; + + *) + break ;; + esac +done + +WORK_DIR=/mnt/root/TDengine + +INF_TEST_DIR=$WORK_DIR/tests/comparisonTest/influxdb + +runTest + +echo "Test done!" diff --git a/tests/perftest-scripts/opentsdbTestQ1Loop.sh b/tests/perftest-scripts/opentsdbTestQ1Loop.sh new file mode 100755 index 0000000000000000000000000000000000000000..2f9ca0dfdb7b851739e97c0d056017255292e288 --- /dev/null +++ b/tests/perftest-scripts/opentsdbTestQ1Loop.sh @@ -0,0 +1,99 @@ +#!/bin/bash + +NUM_LOOP=5 + +function printTo { + if $verbose ; then + echo $1 + fi +} + +TSDBTESTQ1OUT=opentsdbTestQ1.out + +function runTest { + totalG0=0 + totalG10=0 + totalG20=0 + totalG30=0 + totalG40=0 + totalG50=0 + totalG60=0 + totalG70=0 + totalG80=0 + totalG90=0 + for i in `seq 1 $NUM_LOOP`; do + printTo "loop i:$i, java -jar \ + $TSDBTEST_DIR/opentsdbtest/target/opentsdbtest-1.0-SNAPSHOT-jar-with-dependencies.jar \ + -sql q1" + java -jar \ + $TSDBTEST_DIR/opentsdbtest/target/opentsdbtest-1.0-SNAPSHOT-jar-with-dependencies.jar \ + -sql q1 2>&1 \ + | tee $TSDBTESTQ1OUT + G0=`grep "devgroup = 0" $TSDBTESTQ1OUT| awk '{print $2}'` + totalG0=`echo "scale=4; $totalG0 + $G0" | bc` + G10=`grep "devgroup = 10" $TSDBTESTQ1OUT| awk '{print $2}'` + totalG10=`echo "scale=4; $totalG10 + $G10" | bc` + G20=`grep "devgroup = 20" $TSDBTESTQ1OUT| awk '{print $2}'` + totalG20=`echo "scale=4; $totalG20 + $G20" | bc` + G30=`grep "devgroup = 30" $TSDBTESTQ1OUT| awk '{print $2}'` + totalG30=`echo "scale=4; $totalG30 + $G30" | bc` + G40=`grep "devgroup = 40" $TSDBTESTQ1OUT| awk '{print $2}'` + totalG40=`echo "scale=4; $totalG40 + $G40" | bc` + G50=`grep "devgroup = 50" $TSDBTESTQ1OUT| awk '{print $2}'` + totalG50=`echo "scale=4; $totalG50 + $G50" | bc` + G60=`grep "devgroup = 60" $TSDBTESTQ1OUT| awk '{print $2}'` + totalG60=`echo "scale=4; $totalG60 + $G60" | bc` + G70=`grep "devgroup = 70" $TSDBTESTQ1OUT| awk '{print $2}'` + totalG70=`echo "scale=4; $totalG70 + $G70" | bc` + G80=`grep "devgroup = 80" $TSDBTESTQ1OUT| awk '{print $2}'` + totalG80=`echo "scale=4; $totalG80 + $G80" | bc` + G90=`grep "devgroup = 90" $TSDBTESTQ1OUT| awk '{print $2}'` + totalG90=`echo "scale=4; $totalG90 + $G90" | bc` + done + avgG0=`echo "scale=4; x = $totalG0 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG10=`echo "scale=4; x = $totalG10 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG20=`echo "scale=4; x = $totalG20 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG30=`echo "scale=4; x = $totalG30 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG40=`echo "scale=4; x = $totalG40 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG50=`echo "scale=4; x = $totalG50 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG60=`echo "scale=4; x = $totalG60 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG70=`echo "scale=4; x = $totalG70 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG80=`echo "scale=4; x = $totalG80 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG90=`echo "scale=4; x = $totalG90 / $NUM_LOOP; if(x<1) print 0; x" | bc` + echo "Latency, G-0, G-10, G-20, G-30, G-40, G-50, G-60, G-70, G-80, G-90" + echo "OpenTSDB, $avgG0, $avgG10, $avgG20, $avgG30, $avgG40, $avgG50, $avgG60, $avgG70, $avgG80, $avgG90" +} + +################ Main ################ + +master=false +develop=true +verbose=false + +clients=1 + +while : ; do + case $1 in + -v) + verbose=true + shift ;; + + -c) + clients=$2 + shift 2;; + + -n) + NUM_LOOP=$2 + shift 2;; + + *) + break ;; + esac +done + +WORK_DIR=/mnt/root/TDengine +TSDBTEST_DIR=$WORK_DIR/tests/comparisonTest/opentsdb + +runTest + +printTo "Test done!" diff --git a/tests/perftest-scripts/opentsdbTestQ2Loop.sh b/tests/perftest-scripts/opentsdbTestQ2Loop.sh new file mode 100755 index 0000000000000000000000000000000000000000..db2d0435a3322e10a27f3cbe4a52ea8d623e6690 --- /dev/null +++ b/tests/perftest-scripts/opentsdbTestQ2Loop.sh @@ -0,0 +1,276 @@ +#!/bin/bash + +NUM_LOOP=5 + +function printTo { + if $verbose ; then + echo $1 + fi +} + +TSDBTESTQ2OUT=opentsdbTestQ2.out + +function runTest { + totalCount10=0 + totalCount20=0 + totalCount30=0 + totalCount40=0 + totalCount50=0 + totalCount60=0 + totalCount70=0 + totalCount80=0 + totalCount90=0 + totalCount100=0 + + totalAvg10=0 + totalAvg20=0 + totalAvg30=0 + totalAvg40=0 + totalAvg50=0 + totalAvg60=0 + totalAvg70=0 + totalAvg80=0 + totalAvg90=0 + totalAvg100=0 + + totalSum10=0 + totalSum20=0 + totalSum30=0 + totalSum40=0 + totalSum50=0 + totalSum60=0 + totalSum70=0 + totalSum80=0 + totalSum90=0 + totalSum100=0 + + totalMax10=0 + totalMax20=0 + totalMax30=0 + totalMax40=0 + totalMax50=0 + totalMax60=0 + totalMax70=0 + totalMax80=0 + totalMax90=0 + totalMax100=0 + + totalMin10=0 + totalMin20=0 + totalMin30=0 + totalMin40=0 + totalMin50=0 + totalMin60=0 + totalMin70=0 + totalMin80=0 + totalMin90=0 + totalMin100=0 + + for i in `seq 1 $NUM_LOOP`; do + printTo "loop i:$i, java -jar \ + $TSDBTEST_DIR/opentsdbtest/target/opentsdbtest-1.0-SNAPSHOT-jar-with-dependencies.jar \ + -sql q2" + java -jar \ + $TSDBTEST_DIR/opentsdbtest/target/opentsdbtest-1.0-SNAPSHOT-jar-with-dependencies.jar \ + -sql q2 2>&1 \ + | tee $TSDBTESTQ2OUT + + Count10=`cat $TSDBTESTQ2OUT | grep count | grep "devgroup < 10" | awk '{print $2}'` + totalCount10=`echo "scale=4; $totalCount10 + $Count10" | bc` + Count20=`cat $TSDBTESTQ2OUT | grep count | grep "devgroup < 20" | awk '{print $2}'` + totalCount20=`echo "scale=4; $totalCount20 + $Count20" | bc` + Count30=`cat $TSDBTESTQ2OUT | grep count | grep "devgroup < 30" | awk '{print $2}'` + totalCount30=`echo "scale=4; $totalCount30 + $Count30" | bc` + Count40=`cat $TSDBTESTQ2OUT | grep count | grep "devgroup < 40" | awk '{print $2}'` + totalCount40=`echo "scale=4; $totalCount40 + $Count40" | bc` + Count50=`cat $TSDBTESTQ2OUT | grep count | grep "devgroup < 50" | awk '{print $2}'` + totalCount50=`echo "scale=4; $totalCount50 + $Count50" | bc` + Count60=`cat $TSDBTESTQ2OUT | grep count | grep "devgroup < 60" | awk '{print $2}'` + totalCount60=`echo "scale=4; $totalCount60 + $Count60" | bc` + Count70=`cat $TSDBTESTQ2OUT | grep count | grep "devgroup < 70" | awk '{print $2}'` + totalCount70=`echo "scale=4; $totalCount70 + $Count70" | bc` + Count80=`cat $TSDBTESTQ2OUT | grep count | grep "devgroup < 80" | awk '{print $2}'` + totalCount80=`echo "scale=4; $totalCount80 + $Count80" | bc` + Count90=`cat $TSDBTESTQ2OUT | grep count | grep "devgroup < 90" | awk '{print $2}'` + totalCount90=`echo "scale=4; $totalCount90 + $Count90" | bc` + Count100=`cat $TSDBTESTQ2OUT | grep count | grep "devgroup < 100" | awk '{print $2}'` + totalCount100=`echo "scale=4; $totalCount100 + $Count100" | bc` + + Avg10=`cat $TSDBTESTQ2OUT | grep avg | grep "devgroup < 10" | awk '{print $2}'` + totalAvg10=`echo "scale=4; $totalAvg10 + $Avg10" | bc` + Avg20=`cat $TSDBTESTQ2OUT | grep avg | grep "devgroup < 20" | awk '{print $2}'` + totalAvg20=`echo "scale=4; $totalAvg20 + $Avg20" | bc` + Avg30=`cat $TSDBTESTQ2OUT | grep avg | grep "devgroup < 30" | awk '{print $2}'` + totalAvg30=`echo "scale=4; $totalAvg30 + $Avg30" | bc` + Avg40=`cat $TSDBTESTQ2OUT | grep avg | grep "devgroup < 40" | awk '{print $2}'` + totalAvg40=`echo "scale=4; $totalAvg40 + $Avg40" | bc` + Avg50=`cat $TSDBTESTQ2OUT | grep avg | grep "devgroup < 50" | awk '{print $2}'` + totalAvg50=`echo "scale=4; $totalAvg50 + $Avg50" | bc` + Avg60=`cat $TSDBTESTQ2OUT | grep avg | grep "devgroup < 60" | awk '{print $2}'` + totalAvg60=`echo "scale=4; $totalAvg60 + $Avg60" | bc` + Avg70=`cat $TSDBTESTQ2OUT | grep avg | grep "devgroup < 70" | awk '{print $2}'` + totalAvg70=`echo "scale=4; $totalAvg70 + $Avg70" | bc` + Avg80=`cat $TSDBTESTQ2OUT | grep avg | grep "devgroup < 80" | awk '{print $2}'` + totalAvg80=`echo "scale=4; $totalAvg80 + $Avg80" | bc` + Avg90=`cat $TSDBTESTQ2OUT | grep avg | grep "devgroup < 90" | awk '{print $2}'` + totalAvg90=`echo "scale=4; $totalAvg90 + $Avg90" | bc` + Avg100=`cat $TSDBTESTQ2OUT | grep avg | grep "devgroup < 100" | awk '{print $2}'` + totalAvg100=`echo "scale=4; $totalAvg100 + $Avg100" | bc` + + Sum10=`cat $TSDBTESTQ2OUT | grep sum | grep "devgroup < 10" | awk '{print $2}'` + totalSum10=`echo "scale=4; $totalSum10 + $Sum10" | bc` + Sum20=`cat $TSDBTESTQ2OUT | grep sum | grep "devgroup < 20" | awk '{print $2}'` + totalSum20=`echo "scale=4; $totalSum20 + $Sum20" | bc` + Sum30=`cat $TSDBTESTQ2OUT | grep sum | grep "devgroup < 30" | awk '{print $2}'` + totalSum30=`echo "scale=4; $totalSum30 + $Sum30" | bc` + Sum40=`cat $TSDBTESTQ2OUT | grep sum | grep "devgroup < 40" | awk '{print $2}'` + totalSum40=`echo "scale=4; $totalSum40 + $Sum40" | bc` + Sum50=`cat $TSDBTESTQ2OUT | grep sum | grep "devgroup < 50" | awk '{print $2}'` + totalSum50=`echo "scale=4; $totalSum50 + $Sum50" | bc` + Sum60=`cat $TSDBTESTQ2OUT | grep sum | grep "devgroup < 60" | awk '{print $2}'` + totalSum60=`echo "scale=4; $totalSum60 + $Sum60" | bc` + Sum70=`cat $TSDBTESTQ2OUT | grep sum | grep "devgroup < 70" | awk '{print $2}'` + totalSum70=`echo "scale=4; $totalSum70 + $Sum70" | bc` + Sum80=`cat $TSDBTESTQ2OUT | grep sum | grep "devgroup < 80" | awk '{print $2}'` + totalSum80=`echo "scale=4; $totalSum80 + $Sum80" | bc` + Sum90=`cat $TSDBTESTQ2OUT | grep sum | grep "devgroup < 90" | awk '{print $2}'` + totalSum90=`echo "scale=4; $totalSum90 + $Sum90" | bc` + Sum100=`cat $TSDBTESTQ2OUT | grep sum | grep "devgroup < 100" | awk '{print $2}'` + totalSum100=`echo "scale=4; $totalSum100 + $Sum100" | bc` + + Max10=`cat $TSDBTESTQ2OUT | grep max | grep "devgroup < 10" | awk '{print $2}'` + totalMax10=`echo "scale=4; $totalMax10 + $Max10" | bc` + Max20=`cat $TSDBTESTQ2OUT | grep max | grep "devgroup < 20" | awk '{print $2}'` + totalMax20=`echo "scale=4; $totalMax20 + $Max20" | bc` + Max30=`cat $TSDBTESTQ2OUT | grep max | grep "devgroup < 30" | awk '{print $2}'` + totalMax30=`echo "scale=4; $totalMax30 + $Max30" | bc` + Max40=`cat $TSDBTESTQ2OUT | grep max | grep "devgroup < 40" | awk '{print $2}'` + totalMax40=`echo "scale=4; $totalMax40 + $Max40" | bc` + Max50=`cat $TSDBTESTQ2OUT | grep max | grep "devgroup < 50" | awk '{print $2}'` + totalMax50=`echo "scale=4; $totalMax50 + $Max50" | bc` + Max60=`cat $TSDBTESTQ2OUT | grep max | grep "devgroup < 60" | awk '{print $2}'` + totalMax60=`echo "scale=4; $totalMax60 + $Max60" | bc` + Max70=`cat $TSDBTESTQ2OUT | grep max | grep "devgroup < 70" | awk '{print $2}'` + totalMax70=`echo "scale=4; $totalMax70 + $Max70" | bc` + Max80=`cat $TSDBTESTQ2OUT | grep max | grep "devgroup < 80" | awk '{print $2}'` + totalMax80=`echo "scale=4; $totalMax80 + $Max80" | bc` + Max90=`cat $TSDBTESTQ2OUT | grep max | grep "devgroup < 90" | awk '{print $2}'` + totalMax90=`echo "scale=4; $totalMax90 + $Max90" | bc` + Max100=`cat $TSDBTESTQ2OUT | grep max | grep "devgroup < 100" | awk '{print $2}'` + totalMax100=`echo "scale=4; $totalMax100 + $Max100" | bc` + + Min10=`cat $TSDBTESTQ2OUT | grep min | grep "devgroup < 10" | awk '{print $2}'` + totalMin10=`echo "scale=4; $totalMin10 + $Min10" | bc` + Min20=`cat $TSDBTESTQ2OUT | grep min | grep "devgroup < 20" | awk '{print $2}'` + totalMin20=`echo "scale=4; $totalMin20 + $Min20" | bc` + Min30=`cat $TSDBTESTQ2OUT | grep min | grep "devgroup < 30" | awk '{print $2}'` + totalMin30=`echo "scale=4; $totalMin30 + $Min30" | bc` + Min40=`cat $TSDBTESTQ2OUT | grep min | grep "devgroup < 40" | awk '{print $2}'` + totalMin40=`echo "scale=4; $totalMin40 + $Min40" | bc` + Min50=`cat $TSDBTESTQ2OUT | grep min | grep "devgroup < 50" | awk '{print $2}'` + totalMin50=`echo "scale=4; $totalMin50 + $Min50" | bc` + Min60=`cat $TSDBTESTQ2OUT | grep min | grep "devgroup < 60" | awk '{print $2}'` + totalMin60=`echo "scale=4; $totalMin60 + $Min60" | bc` + Min70=`cat $TSDBTESTQ2OUT | grep min | grep "devgroup < 70" | awk '{print $2}'` + totalMin70=`echo "scale=4; $totalMin70 + $Min70" | bc` + Min80=`cat $TSDBTESTQ2OUT | grep min | grep "devgroup < 80" | awk '{print $2}'` + totalMin80=`echo "scale=4; $totalMin80 + $Min80" | bc` + Min90=`cat $TSDBTESTQ2OUT | grep min | grep "devgroup < 90" | awk '{print $2}'` + totalMin90=`echo "scale=4; $totalMin90 + $Min90" | bc` + Min100=`cat $TSDBTESTQ2OUT | grep min | grep "devgroup < 100" | awk '{print $2}'` + totalMin100=`echo "scale=4; $totalMin100 + $Min100" | bc` + + done + avgCount10=`echo "scale=4; x = $totalCount10 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgCount20=`echo "scale=4; x = $totalCount20 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgCount30=`echo "scale=4; x = $totalCount30 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgCount40=`echo "scale=4; x = $totalCount40 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgCount50=`echo "scale=4; x = $totalCount50 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgCount60=`echo "scale=4; x = $totalCount60 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgCount70=`echo "scale=4; x = $totalCount70 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgCount80=`echo "scale=4; x = $totalCount80 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgCount90=`echo "scale=4; x = $totalCount90 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgCount100=`echo "scale=4; x = $totalCount100 / $NUM_LOOP; if(x<1) print 0; x" | bc` + + avgAvg10=`echo "scale=4; x = $totalAvg10 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgAvg20=`echo "scale=4; x = $totalAvg20 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgAvg30=`echo "scale=4; x = $totalAvg30 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgAvg40=`echo "scale=4; x = $totalAvg40 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgAvg50=`echo "scale=4; x = $totalAvg50 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgAvg60=`echo "scale=4; x = $totalAvg60 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgAvg70=`echo "scale=4; x = $totalAvg70 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgAvg80=`echo "scale=4; x = $totalAvg80 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgAvg90=`echo "scale=4; x = $totalAvg90 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgAvg100=`echo "scale=4; x = $totalAvg100 / $NUM_LOOP; if(x<1) print 0; x" | bc` + + avgSum10=`echo "scale=4; x = $totalSum10 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSum20=`echo "scale=4; x = $totalSum20 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSum30=`echo "scale=4; x = $totalSum30 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSum40=`echo "scale=4; x = $totalSum40 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSum50=`echo "scale=4; x = $totalSum50 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSum60=`echo "scale=4; x = $totalSum60 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSum70=`echo "scale=4; x = $totalSum70 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSum80=`echo "scale=4; x = $totalSum80 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSum90=`echo "scale=4; x = $totalSum90 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSum100=`echo "scale=4; x = $totalSum100 / $NUM_LOOP; if(x<1) print 0; x" | bc` + + avgMax10=`echo "scale=4; x = $totalMax10 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMax20=`echo "scale=4; x = $totalMax20 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMax30=`echo "scale=4; x = $totalMax30 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMax40=`echo "scale=4; x = $totalMax40 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMax50=`echo "scale=4; x = $totalMax50 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMax60=`echo "scale=4; x = $totalMax60 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMax70=`echo "scale=4; x = $totalMax70 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMax80=`echo "scale=4; x = $totalMax80 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMax90=`echo "scale=4; x = $totalMax90 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMax100=`echo "scale=4; x = $totalMax100 / $NUM_LOOP; if(x<1) print 0; x" | bc` + + avgMin10=`echo "scale=4; x = $totalMin10 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMin20=`echo "scale=4; x = $totalMin20 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMin30=`echo "scale=4; x = $totalMin30 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMin40=`echo "scale=4; x = $totalMin40 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMin50=`echo "scale=4; x = $totalMin50 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMin60=`echo "scale=4; x = $totalMin60 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMin70=`echo "scale=4; x = $totalMin70 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMin80=`echo "scale=4; x = $totalMin80 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMin90=`echo "scale=4; x = $totalMin90 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMin100=`echo "scale=4; x = $totalMin100 / $NUM_LOOP; if(x<1) print 0; x" | bc` + + echo "Latency, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%" + echo "Count, $avgCount10, $avgCount20, $avgCount30, $avgCount40, $avgCount50, $avgCount60, $avgCount70, $avgCount80, $avgCount90, $avgCount100" + echo "Avg, $avgAvg10, $avgAvg20, $avgAvg30, $avgAvg40, $avgAvg50, $avgAvg60, $avgAvg70, $avgAvg80, $avgAvg90, $avgAvg100" + echo "Sum, $avgSum10, $avgSum20, $avgSum30, $avgSum40, $avgSum50, $avgSum60, $avgSum70, $avgSum80, $avgSum90, $avgSum100" + echo "Max, $avgMax10, $avgMax20, $avgMax30, $avgMax40, $avgMax50, $avgMax60, $avgMax70, $avgMax80, $avgMax90, $avgMax100" + echo "Min, $avgMin10, $avgMin20, $avgMin30, $avgMin40, $avgMin50, $avgMin60, $avgMin70, $avgMin80, $avgMin90, $avgMin100" +} + +################ Main ################ + +verbose=false + +for arg in "$@" +do + case $arg in + -v) + verbose=true + shift ;; + + -c) + clients=$2 + shift 2;; + + -n) + NUM_LOOP=$2 + shift 2;; + + *) + ;; + esac +done + +WORK_DIR=/mnt/root/TDengine +TSDBTEST_DIR=$WORK_DIR/tests/comparisonTest/opentsdb + +runTest + +printTo "Test done!" diff --git a/tests/perftest-scripts/opentsdbTestQ3Loop.sh b/tests/perftest-scripts/opentsdbTestQ3Loop.sh new file mode 100755 index 0000000000000000000000000000000000000000..6f69cf85a0d9d3a196991b40655d9c90e6865253 --- /dev/null +++ b/tests/perftest-scripts/opentsdbTestQ3Loop.sh @@ -0,0 +1,96 @@ +#!/bin/bash + +NUM_LOOP=5 + +function printTo { + if $verbose ; then + echo $1 + fi +} + +TSDBTESTQ3OUT=opentsdbTestQ3.out + +function runTest { + totalG10=0 + totalG20=0 + totalG30=0 + totalG40=0 + totalG50=0 + totalG60=0 + totalG70=0 + totalG80=0 + totalG90=0 + totalG100=0 + for i in `seq 1 $NUM_LOOP`; do + printTo "loop i:$i, java -jar \ + $TSDBTEST_DIR/opentsdbtest/target/opentsdbtest-1.0-SNAPSHOT-jar-with-dependencies.jar \ + -sql q3" + java -jar \ + $TSDBTEST_DIR/opentsdbtest/target/opentsdbtest-1.0-SNAPSHOT-jar-with-dependencies.jar \ + -sql q3 2>&1 \ + | tee $TSDBTESTQ3OUT + G10=`grep -w "devgroup < 10" $TSDBTESTQ3OUT| awk '{print $2}'` + totalG10=`echo "scale=4; $totalG10 + $G10" | bc` + G20=`grep -w "devgroup < 20" $TSDBTESTQ3OUT| awk '{print $2}'` + totalG20=`echo "scale=4; $totalG20 + $G20" | bc` + G30=`grep -w "devgroup < 30" $TSDBTESTQ3OUT| awk '{print $2}'` + totalG30=`echo "scale=4; $totalG30 + $G30" | bc` + G40=`grep -w "devgroup < 40" $TSDBTESTQ3OUT| awk '{print $2}'` + totalG40=`echo "scale=4; $totalG40 + $G40" | bc` + G50=`grep -w "devgroup < 50" $TSDBTESTQ3OUT| awk '{print $2}'` + totalG50=`echo "scale=4; $totalG50 + $G50" | bc` + G60=`grep -w "devgroup < 60" $TSDBTESTQ3OUT| awk '{print $2}'` + totalG60=`echo "scale=4; $totalG60 + $G60" | bc` + G70=`grep -w "devgroup < 70" $TSDBTESTQ3OUT| awk '{print $2}'` + totalG70=`echo "scale=4; $totalG70 + $G70" | bc` + G80=`grep -w "devgroup < 80" $TSDBTESTQ3OUT| awk '{print $2}'` + totalG80=`echo "scale=4; $totalG80 + $G80" | bc` + G90=`grep -w "devgroup < 90" $TSDBTESTQ3OUT| awk '{print $2}'` + totalG90=`echo "scale=4; $totalG90 + $G90" | bc` + G100=`grep -w "devgroup < 100" $TSDBTESTQ3OUT| awk '{print $2}'` + totalG100=`echo "scale=4; $totalG100 + $G100" | bc` + done + avgG10=`echo "scale=4; x = $totalG10 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG20=`echo "scale=4; x = $totalG20 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG30=`echo "scale=4; x = $totalG30 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG40=`echo "scale=4; x = $totalG40 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG50=`echo "scale=4; x = $totalG50 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG60=`echo "scale=4; x = $totalG60 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG70=`echo "scale=4; x = $totalG70 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG80=`echo "scale=4; x = $totalG80 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG90=`echo "scale=4; x = $totalG90 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG100=`echo "scale=4; x = $totalG100 / $NUM_LOOP; if(x<1) print 0; x" | bc` + echo "Latency, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%" + echo "OpenTSDB, $avgG10, $avgG20, $avgG30, $avgG40, $avgG50, $avgG60, $avgG70, $avgG80, $avgG90, $avgG100" +} + +################ Main ################ + +verbose=false + +for arg in "$@" +do + case $arg in + -v) + verbose=true + shift ;; + + -c) + clients=$2 + shift 2;; + + -n) + NUM_LOOP=$2 + shift 2;; + + *) + ;; + esac +done + +WORK_DIR=/mnt/root/TDengine +TSDBTEST_DIR=$WORK_DIR/tests/comparisonTest/opentsdb + +runTest + +printTo "Test done!" diff --git a/tests/perftest-scripts/opentsdbTestQ4Loop.sh b/tests/perftest-scripts/opentsdbTestQ4Loop.sh new file mode 100755 index 0000000000000000000000000000000000000000..4341f2165ce05da20d268b991f596d6636f3bdb2 --- /dev/null +++ b/tests/perftest-scripts/opentsdbTestQ4Loop.sh @@ -0,0 +1,103 @@ +#!/bin/bash + +DATA_DIR=/mnt/root/testdata +NUM_LOOP=5 + +function printTo { + if $verbose ; then + echo $1 + fi +} + +TSDBTESTQ4OUT=opentsdbTestQ4.out + +function runTest { + totalG10=0 + totalG20=0 + totalG30=0 + totalG40=0 + totalG50=0 + totalG60=0 + totalG70=0 + totalG80=0 + totalG90=0 + totalG100=0 + for i in `seq 1 $NUM_LOOP`; do + printTo "loop i:$i, java -jar \ + $TSDBTEST_DIR/opentsdbtest/target/opentsdbtest-1.0-SNAPSHOT-jar-with-dependencies.jar \ + -sql q4" + + java -jar \ + $TSDBTEST_DIR/opentsdbtest/target/opentsdbtest-1.0-SNAPSHOT-jar-with-dependencies.jar \ + -sql q4 2>&1 | + tee $TSDBTESTQ4OUT + G10=`grep -w "devgroup < 10" $TSDBTESTQ4OUT| awk '{print $2}'` + totalG10=`echo "scale=4; $totalG10 + $G10" | bc` + G20=`grep -w "devgroup < 20" $TSDBTESTQ4OUT| awk '{print $2}'` + totalG20=`echo "scale=4; $totalG20 + $G20" | bc` + G30=`grep -w "devgroup < 30" $TSDBTESTQ4OUT| awk '{print $2}'` + totalG30=`echo "scale=4; $totalG30 + $G30" | bc` + G40=`grep -w "devgroup < 40" $TSDBTESTQ4OUT| awk '{print $2}'` + totalG40=`echo "scale=4; $totalG40 + $G40" | bc` + G50=`grep -w "devgroup < 50" $TSDBTESTQ4OUT| awk '{print $2}'` + totalG50=`echo "scale=4; $totalG50 + $G50" | bc` + G60=`grep -w "devgroup < 60" $TSDBTESTQ4OUT| awk '{print $2}'` + totalG60=`echo "scale=4; $totalG60 + $G60" | bc` + G70=`grep -w "devgroup < 70" $TSDBTESTQ4OUT| awk '{print $2}'` + totalG70=`echo "scale=4; $totalG70 + $G70" | bc` + G80=`grep -w "devgroup < 80" $TSDBTESTQ4OUT| awk '{print $2}'` + totalG80=`echo "scale=4; $totalG80 + $G80" | bc` + G90=`grep -w "devgroup < 90" $TSDBTESTQ4OUT| awk '{print $2}'` + totalG90=`echo "scale=4; $totalG90 + $G90" | bc` + G100=`grep -w "devgroup < 100" $TSDBTESTQ4OUT| awk '{print $2}'` + totalG100=`echo "scale=4; $totalG100 + $G100" | bc` + done + avgG10=`echo "scale=4; x = $totalG10 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG20=`echo "scale=4; x = $totalG20 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG30=`echo "scale=4; x = $totalG30 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG40=`echo "scale=4; x = $totalG40 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG50=`echo "scale=4; x = $totalG50 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG60=`echo "scale=4; x = $totalG60 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG70=`echo "scale=4; x = $totalG70 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG80=`echo "scale=4; x = $totalG80 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG90=`echo "scale=4; x = $totalG90 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG100=`echo "scale=4; x = $totalG100 / $NUM_LOOP; if(x<1) print 0; x" | bc` + echo "Latency, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%" + echo "OpenTSDB, $avgG10, $avgG20, $avgG30, $avgG40, $avgG50, $avgG60, $avgG70, $avgG80, $avgG90, $avgG100" +} + +################ Main ################ + +verbose=false +regeneratedata=false + +for arg in "$@" +do + case $arg in + -v) + verbose=true + shift ;; + + -c) + clients=$2 + shift 2;; + + -r) + regeneratedata=true + ;; + + -n) + NUM_LOOP=$2 + shift 2;; + + *) + ;; + esac +done + +WORK_DIR=/mnt/root/TDengine +TSDBTEST_DIR=$WORK_DIR/tests/comparisonTest/opentsdb + +runTest + +printTo "Test done!" diff --git a/tests/pytest/subscribe/stability.py b/tests/pytest/subscribe/stability.py new file mode 100644 index 0000000000000000000000000000000000000000..ddd8b3282a01843f912ce8e19b4baa790aa32bfa --- /dev/null +++ b/tests/pytest/subscribe/stability.py @@ -0,0 +1,93 @@ +################################################################### + # Copyright (c) 2020 by TAOS Technologies, Inc. + # All rights reserved. + # + # This file is proprietary and confidential to TAOS Technologies. + # No part of this file may be reproduced, stored, transmitted, + # disclosed or used in any form or by any means other than as + # expressly provided by the written permission from Jianhui Tao + # +################################################################### + +# -*- coding: utf-8 -*- + +import sys +import taos +import time +import random +import string +from util.log import * +from util.cases import * +from util.sql import * +from util.sub import * + +class TDTestCase: + maxTables = 10000 + maxCols = 50 + rowsPerSecond = 1000 + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdLog.notice("NOTE: this case does not stop automatically, Ctrl+C to stop") + tdSql.init(conn.cursor(), logSql) + self.conn = conn + + + def generateString(self, length): + chars = string.ascii_uppercase + string.ascii_lowercase + v = "" + for i in range(length): + v += random.choice(chars) + return v + + + def insert(self): + id = random.randint(0, self.maxTables - 1) + cola = self.generateString(40) + sql = "insert into car%d values(now, '%s', %f, %d" % (id, cola, random.random()*100, random.randint(0, 2)) + for i in range(self.maxCols): + sql += ", %d" % random.randint(0, self.maxTables) + sql += ")" + tdSql.execute(sql) + + + def prepare(self): + tdLog.info("prepare database: test") + tdSql.execute('reset query cache') + tdSql.execute('drop database if exists test') + tdSql.execute('create database test') + tdSql.execute('use test') + + def run(self): + self.prepare() + + sql = "create table cars (ts timestamp, a binary(50), b float, c bool" + for i in range(self.maxCols): + sql += ", c%d int" % i + sql += ") tags(id int, category binary(30), brand binary(30));" + tdSql.execute(sql) + + for i in range(self.maxTables): + tdSql.execute("create table car%d using cars tags(%d, 'category%d', 'brand%d')" % (i, i, i % 30, i // 30)) + + time.sleep(0.1) + + total = 0 + while True: + start = time.time() + for i in range(self.rowsPerSecond): + self.insert() + total = total + 1 + d = time.time() - start + tdLog.info("%d rows inserted in %f seconds, total %d" % (self.rowsPerSecond, d, total)) + if d < 1: + time.sleep(1 - d) + + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) diff --git a/tests/pytest/subscribe/supertable.py b/tests/pytest/subscribe/supertable.py index c6cc2969aa57848bf2c43163a26608117e82ad90..ee3aa225bd79a6709a06672df76d7e7163f7a831 100644 --- a/tests/pytest/subscribe/supertable.py +++ b/tests/pytest/subscribe/supertable.py @@ -31,16 +31,19 @@ class TDTestCase: now = int(time.time() * 1000) tdSql.prepare() - tdLog.info("create a super table and 10 sub-tables, then insert 5 rows into each sub-table.") + numTables = 2000 + rowsPerTable = 5 + totalRows = numTables * rowsPerTable + tdLog.info("create a super table and %d sub-tables, then insert %d rows into each sub-table." % (numTables, rowsPerTable)) tdSql.execute("create table meters(ts timestamp, a int, b int) tags(area int, loc binary(20));") - for i in range(0, 10): - for j in range(0, 5): + for i in range(0, numTables): + for j in range(0, rowsPerTable): tdSql.execute("insert into t%d using meters tags(%d, 'area%d') values (%d, %d, %d);" % (i, i, i, now + j, j, j)) tdLog.info("consumption 01.") tdSub.init(self.conn.subscribe(True, topic, sqlstr, 0)) tdSub.consume() - tdSub.checkRows(50) + tdSub.checkRows(totalRows) tdLog.info("consumption 02: no new rows inserted") tdSub.consume() @@ -61,17 +64,17 @@ class TDTestCase: tdSub.close(False) tdSub.init(self.conn.subscribe(False, topic, sqlstr, 0)) tdSub.consume() - tdSub.checkRows(51) + tdSub.checkRows(totalRows + 1) tdLog.info("consumption 06: keep progress and restart the subscription") tdSub.close(True) tdSub.init(self.conn.subscribe(True, topic, sqlstr, 0)) tdSub.consume() - tdSub.checkRows(51) + tdSub.checkRows(totalRows + 1) tdLog.info("consumption 07: insert one row to two table then remove one table") tdSql.execute("insert into t0 values (%d, 11, 11);" % (now + 11)) - tdSql.execute("insert into t1 values (%d, 11, 11);" % (now + 11)) + tdSql.execute("insert into t%d values (%d, 11, 11);" % ((numTables-1), (now + 11))) tdSql.execute("drop table t0") tdSub.consume() tdSub.checkRows(1) @@ -80,7 +83,7 @@ class TDTestCase: tdSub.close(False) tdSub.init(self.conn.subscribe(True, topic, sqlstr + " where ts > %d" % now, 0)) tdSub.consume() - tdSub.checkRows(37) + tdSub.checkRows((numTables-1) * (rowsPerTable-1) + 1) tdLog.info("consumption 09: insert large timestamp to t2 then insert smaller timestamp to t1") tdSql.execute("insert into t2 values (%d, 100, 100);" % (now + 100)) @@ -101,10 +104,15 @@ class TDTestCase: tdLog.info("consumption 11: two vnodes") tdSql.execute("insert into t2 values (%d, 102, 100);" % (now + 104)) - tdSql.execute("insert into t9 values (%d, 102, 100);" % (now + 104)) + tdSql.execute("insert into t1299 values (%d, 102, 100);" % (now + 104)) tdSub.consume() tdSub.checkRows(2) + tdLog.info("consumption 12: create a new table") + tdSql.execute("insert into t%d using meters tags(%d, 'area%d') values (%d, 102, 100);" % (numTables, numTables, numTables, now + 105)) + tdSub.consume() + tdSub.checkRows(1) + def stop(self): tdSub.close(False) tdSql.close() diff --git a/tests/script/windows/account/authority.sim b/tests/script/windows/account/authority.sim deleted file mode 100644 index a352faf23bc9ea2979abcb337c8bae6794b91890..0000000000000000000000000000000000000000 --- a/tests/script/windows/account/authority.sim +++ /dev/null @@ -1,317 +0,0 @@ -sql connect -sleep 3000 - -print ============= step1 - -sql create user read pass 'taosdata' -sql create user write pass 'taosdata' -sql create user manage pass 'taosdata' - -sql create user a PASS 'ade' privilege -x step11 - return -1 -step11: - -sql create user a PASS 'ade' privilege a -x step12 - return -1 -step12: - -sql create user a PASS 'ade' privilege read -x step13 - return -1 -step13: - -sql show users -if $rows != 6 then - return -1 -endi - -sql alter user read privilege read -sql alter user write privilege write -sql alter user manage privilege super - -print ============= step2 -sql close -sql connect write -sleep 2000 - -sql create database d1 -sql create database d2 -sql create table d1.t1 (ts timestamp, i int) -sql create table d2.t2 (ts timestamp, i int) -sql insert into d1.t1 values(now, 1) -sql insert into d2.t2 values(now, 1) -sql insert into d2.t2 values(now+1s, 2) - -sql show users -if $rows != 6 then - return -1 -endi -sql show databases -if $rows != 2 then - return -1 -endi -sql select * from d1.t1 -if $rows != 1 then - return -1 -endi -sql select * from d2.t2 -if $rows != 2 then - return -1 -endi - -sql create account t1 pass 'taosdata' -x step21 - return -1 -step21: - -sql create user t1 pass 'taosdata' -x step22 - return -1 -step22: - -sql alter user read pass 'taosdata' -x step23 - return -1 -step23: - -sql create dnode $hostname2 -x step24 - return -1 -step24: - -sql drop dnode $hostname2 -x step25 - return -1 -step25: - -sql create mnode 192.168.0.2 -x step26 - return -1 -step26: - -sql drop mnode 192.168.0.2 -x step27 - return -1 -step27: - -sql drop account root -x step28 - return -1 -step28: - -sql alter user write pass 'taosdata' - -print ============= step3 -sql close -sql connect read -sleep 2000 - -sql create database d3 -x step31 - return -1 -step31: - -sql create table d1.t3 (ts timestamp, i int) -x step32 - return -1 -step32: - -#sql insert into d1.t1 values(now, 2) -x step33 -# return -1 -#step33: - -sql show accounts -if $rows != 1 then - return -1 -endi -sql show users -if $rows != 6 then - return -1 -endi -sql show databases -if $rows != 2 then - return -1 -endi -sql select * from d1.t1 -if $rows != 1 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 2 then - return -1 -endi - -sql sql create account t1 pass 'taosdata' -x step34 - return -1 -step34: - -sql sql create user t1 pass 'taosdata' -x step35 - return -1 -step35: - -print ============= step4 -sql close -sql connect manage -sleep 2000 - -sql create database d3 -sql create database d4 -sql create table d3.t3 (ts timestamp, i int) -sql create table d4.t4 (ts timestamp, i int) - -sql show accounts -if $rows != 1 then - return -1 -endi -sql show users -if $rows != 6 then - return -1 -endi -sql show databases -if $rows != 4 then - return -1 -endi -sql select * from d1.t1 -if $rows != 1 then - return -1 -endi -sql select * from d2.t2 -if $rows != 2 then - return -1 -endi - -sql create account other pass 'taosdata' -x step41 - return -1 -step41: - -sql close -sql connect -sleep 2000 -sql create account other pass 'taosdata' - -print ============= step5 -sql close -sql connect other -sleep 2000 -sql create user read pass 'taosdata' -x step51 - return -1 -step51: -sql create other write pass 'taosdata' -x step52 - return -1 -step52: - -sql create user oread pass 'taosdata' -sql create user owrite pass 'taosdata' -sql create user omanage pass 'taosdata' - -sql show users -print show users $rows -if $rows != 5 then - return -1 -endi - -sql alter user oread privilege read -sql alter user owrite privilege write -sql alter user oroot privilege super -x step53 - return -1 -step53: -sql alter user read privilege read -x step54 - return -1 -step54: - -print ============= step6 -sql close -sql connect owrite -sleep 2000 - -sql create database d1 -sql create database d3 -sql create table d1.t1 (ts timestamp, i int) -sql create table d3.t3 (ts timestamp, i int) -sql insert into d1.t1 values(now, 11) -sql insert into d3.t3 values(now, 11) -sql insert into d3.t3 values(now+1s, 12) - -sql show databases -if $rows != 2 then - return -1 -endi -sql select * from d1.t1 -if $rows != 1 then - return -1 -endi -sql select * from d2.t2 -x step6 - return -1 -step6: -sql select * from d3.t3 -if $rows != 2 then - return -1 -endi - -sql sql create user t1 pass 'taosdata' -x step62 - return -1 -step62: - -print ============= step7 -sql close -sql connect oread -sleep 2000 - -sql create database d7 -x step71 - return -1 -step71: - -sql show databases -if $rows != 2 then - return -1 -endi -sql select * from d1.t1 -if $rows != 1 then - return -1 -endi -sql select * from d2.t2 -x step72 - return -1 -step72: -sql select * from d3.t3 -if $rows != 2 then - return -1 -endi - -sql sql create user t1 pass 'taosdata' -x step74 - return -1 -step74: - -print ============= step8 -sql close -sql connect omanage -sleep 2000 - -sql create database d4 -sql create table d4.t4 (ts timestamp, i int) - -sql show databases -if $rows != 3 then - return -1 -endi -sql select * from d1.t1 -if $rows != 1 then - return -1 -endi -sql select * from d2.t2 -x step82 - return -1 -step82: -sql select * from d3.t3 -if $rows != 2 then - return -1 -endi - -print ============= step9 -sql close -sql connect -sleep 2000 -sql show databases -if $rows != 4 then - return -1 -endi - -sql drop user read -sql drop user manage -sql drop user write - -sql close -sql connect -sleep 2000 -sql drop database d1 -sql drop database d2 -sql drop database d3 -sql drop database d4 diff --git a/tests/script/windows/account/user_create.sim b/tests/script/windows/account/user_create.sim deleted file mode 100644 index 6dc9ab05b3baf7ffa01540b51918cb18715f5eb1..0000000000000000000000000000000000000000 --- a/tests/script/windows/account/user_create.sim +++ /dev/null @@ -1,80 +0,0 @@ -sql connect -sleep 3000 - -print =============== step1 -sql show users -if $rows != 3 then - return -1 -endi - -sql create user read PASS 'pass123' -sql create user read PASS 'pass123' -x step1 - return -1 -step1: - -sql show users -if $rows != 4 then - return -1 -endi - -sql alter user read PASS 'taosdata' - -print =============== step2 -sql close -sql connect read -sleep 2000 - -sql alter user read PASS 'taosdata' - -print =============== step3 -sql drop user read -x step31 - return -1 -step31: -sql drop user _root -x step32 - return -1 -step32: -sql drop user monitor -x step33 - return -1 -step33: - -print =============== step4 -sql close -sql connect -sleep 2000 - -sql alter user read privilege read -sql show users -if $data1_read != read then - return -1 -endi - -sql alter user read privilege super -sql show users -if $data1_read != super then - return -1 -endi - -sql alter user read privilege write -sql show users -if $data1_read != write then - return -1 -endi - -sql alter user read privilege 1 -x step43 - return -1 -step43: - -sql drop user _root -x step41 - return -1 -step41: - -sql drop user monitor -x step42 - return -1 -step42: - -sql drop user read - - - - - diff --git a/tests/script/windows/account/user_len.sim b/tests/script/windows/account/user_len.sim deleted file mode 100644 index b4a344fe8d9bedf54f307d13fba07976b95d9110..0000000000000000000000000000000000000000 --- a/tests/script/windows/account/user_len.sim +++ /dev/null @@ -1,81 +0,0 @@ -sql connect -sleep 3000 - -$i = 0 -$dbPrefix = lm_us_db -$tbPrefix = lm_us_tb -$db = $dbPrefix . $i -$tb = $tbPrefix . $i - -print =============== step1 -sql drop user ac -x step0 - return -1 -step0: - -sql create user PASS '123' -x step1 - return -1 -step1: - -sql show users -if $rows != 3 then - return -1 -endi - -print =============== step2 -sql drop user a -x step2 -step2: -sql create user a PASS '123' -sql show users -if $rows != 4 then - return -1 -endi - -sql drop user a -sql show users -if $rows != 3 then - return -1 -endi - -print =============== step3 -sql drop user abc01234567890123456789 -x step3 -step3: - -sql create user abc01234567890123456789 PASS '123' -sql show users -if $rows != 4 then - return -1 -endi - -sql drop user abc01234567890123456789 -sql show users -if $rows != 3 then - return -1 -endi - -print =============== step4 -sql create user abcd0123456789012345678901234567890111 PASS '123' -x step4 - return -1 -step4: -sql show users -if $rows != 3 then - return -1 -endi - -print =============== step5 -sql drop user 123 -x step5 -step5: -sql create user 123 PASS '123' -x step61 - return -1 -step61: - -sql create user a123 PASS '123' -sql show users -if $rows != 4 then - return -1 -endi - -sql drop user a123 -sql show users -if $rows != 3 then - return -1 -endi diff --git a/tests/script/windows/alter/metrics.sim b/tests/script/windows/alter/metrics.sim index 323e150d41410c780680bf41b7e8c7f2c5aaee66..3717d8c1ed766a0a80d22cbb1965af934b570746 100644 --- a/tests/script/windows/alter/metrics.sim +++ b/tests/script/windows/alter/metrics.sim @@ -35,7 +35,6 @@ endi print ======== step2 sql alter table mt add column b smallint -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -64,7 +63,6 @@ endi print ======== step3 sql alter table mt add column c tinyint -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -99,7 +97,6 @@ endi print ======== step4 sql alter table mt add column d int -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -140,7 +137,6 @@ endi print ======== step5 sql alter table mt add column e bigint -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -187,7 +183,6 @@ endi print ======== step6 sql alter table mt add column f float -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -240,7 +235,6 @@ endi print ======== step7 sql alter table mt add column g double -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -299,7 +293,6 @@ endi print ======== step8 sql alter table mt add column h binary(10) -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -461,7 +454,6 @@ print ======== step11 print ======== step12 sql alter table mt drop column b -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -523,7 +515,6 @@ endi print ======== step13 sql alter table mt drop column c -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -579,7 +570,6 @@ endi print ======== step14 sql alter table mt drop column d -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -629,7 +619,6 @@ endi print ======== step15 sql alter table mt drop column e -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -673,7 +662,6 @@ endi print ======== step16 sql alter table mt drop column f -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -711,7 +699,6 @@ endi print ======== step17 sql alter table mt drop column g -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -743,7 +730,6 @@ endi print ============= step18 sql alter table mt drop column h -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -763,7 +749,7 @@ endi if $data21 != INT then return -1 endi -if $data30 != NULL then +if $data30 != null then return -1 endi diff --git a/tests/script/windows/alter/table.sim b/tests/script/windows/alter/table.sim index e6b5d695510cf66ee4accc0a329fe44597f1cdce..3b811a065ee28bbc9cf8e1a72bd9e9b656139c83 100644 --- a/tests/script/windows/alter/table.sim +++ b/tests/script/windows/alter/table.sim @@ -28,7 +28,6 @@ endi print ======== step2 sql alter table tb add column b smallint -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -51,7 +50,6 @@ endi print ======== step3 sql alter table tb add column c tinyint -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -80,7 +78,6 @@ endi print ======== step4 sql alter table tb add column d int -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -115,7 +112,6 @@ endi print ======== step5 sql alter table tb add column e bigint -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -156,7 +152,6 @@ endi print ======== step6 sql alter table tb add column f float -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -203,7 +198,6 @@ endi print ======== step7 sql alter table tb add column g double -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -256,7 +250,6 @@ endi print ======== step8 sql alter table tb add column h binary(10) -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -406,7 +399,6 @@ step115: print ======== step12 sql alter table tb drop column b -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -462,7 +454,6 @@ endi print ======== step13 sql alter table tb drop column c -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -512,7 +503,6 @@ endi print ======== step14 sql alter table tb drop column d -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -556,7 +546,6 @@ endi print ======== step15 sql alter table tb drop column e -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -594,7 +583,6 @@ endi print ======== step16 sql alter table tb drop column f -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -626,7 +614,6 @@ endi print ======== step17 sql alter table tb drop column g -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -652,7 +639,6 @@ endi print ============= step18 sql alter table tb drop column h -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -666,7 +652,7 @@ endi if $data11 != INT then return -1 endi -if $data20 != NULL then +if $data20 != null then return -1 endi diff --git a/tests/script/windows/compute/diff.sim b/tests/script/windows/compute/diff.sim index e9d76f8c78128f38a9248dcb832628d99a0e0408..6c2829872a02fa1de829df7b5089c6d06bbb581e 100644 --- a/tests/script/windows/compute/diff.sim +++ b/tests/script/windows/compute/diff.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_di_db $tbPrefix = m_di_tb diff --git a/tests/script/windows/compute/first.sim b/tests/script/windows/compute/first.sim index 7b6a8310045afbcf2c2fda9f6f3e11e1a337581e..9a0c02fe4b972383d9a9247291635a814410cded 100644 --- a/tests/script/windows/compute/first.sim +++ b/tests/script/windows/compute/first.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_fi_db $tbPrefix = m_fi_tb diff --git a/tests/script/windows/compute/interval.sim b/tests/script/windows/compute/interval.sim index d40c6ad0c9ce98f401e2e144e279e2b48b2b96ea..365c6d9d312ae25539664747ca2410e55cf9e067 100644 --- a/tests/script/windows/compute/interval.sim +++ b/tests/script/windows/compute/interval.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_in_db $tbPrefix = m_in_tb diff --git a/tests/script/windows/compute/last.sim b/tests/script/windows/compute/last.sim index 4b686766ae547b4b6d7dc99c2a2c714a5aa4934a..aa9699778f4526783a3c425bea2dddf096ba01eb 100644 --- a/tests/script/windows/compute/last.sim +++ b/tests/script/windows/compute/last.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_la_db $tbPrefix = m_la_tb diff --git a/tests/script/windows/compute/leastsquare.sim b/tests/script/windows/compute/leastsquare.sim index 81f37c32287fdc1a10e15a1856c659564e666056..bb7404edd0eefb06851c24aaf7de6f97e2e9f60f 100644 --- a/tests/script/windows/compute/leastsquare.sim +++ b/tests/script/windows/compute/leastsquare.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_le_db $tbPrefix = m_le_tb @@ -15,7 +15,7 @@ $mt = $mtPrefix . $i sql drop database $db -x step1 step1: -sql create database $db +sql create database $db keep 36500 sql use $db sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) @@ -43,41 +43,41 @@ $tb = $tbPrefix . $i sql select leastsquares(tbcol, 1, 1) from $tb print ===> $data00 -if $data00 != @(1.000000, 1.000000)@ then +if $data00 != @{slop:1.000000, intercept:1.000000}@ then return -1 endi print =============== step3 sql select leastsquares(tbcol, 1, 1) from $tb where ts < now + 4m print ===> $data00 -if $data00 != @(1.000000, 1.000000)@ then +if $data00 != @{slop:1.000000, intercept:1.000000}@ then return -1 endi print =============== step4 sql select leastsquares(tbcol, 1, 1) as b from $tb print ===> $data00 -if $data00 != @(1.000000, 1.000000)@ then +if $data00 != @{slop:1.000000, intercept:1.000000}@ then return -1 endi print =============== step5 sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1m) print ===> $data01 -if $data01 != @(1.000000, 1.000000)@ then +if $data01 != @{slop:1.000000, intercept:1.000000}@ then return -1 endi sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1d) print ===> $data01 -if $data01 != @(1.000000, 1.000000)@ then +if $data01 != @{slop:1.000000, intercept:1.000000}@ then return -1 endi print =============== step6 sql select leastsquares(tbcol, 1, 1) as b from $tb where ts < now + 4m interval(1m) print ===> $data01 -if $data01 != @(1.000000, 1.000000)@ then +if $data01 != @{slop:1.000000, intercept:1.000000}@ then return -1 endi print ===> $rows @@ -90,4 +90,4 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi diff --git a/tests/script/windows/compute/max.sim b/tests/script/windows/compute/max.sim index 60147358b362dd5f39a99002cdaebb71036cc6a3..a19d122ecdbc1344cd62d558b83c0879d88b2d3b 100644 --- a/tests/script/windows/compute/max.sim +++ b/tests/script/windows/compute/max.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_ma_db $tbPrefix = m_ma_tb diff --git a/tests/script/windows/compute/min.sim b/tests/script/windows/compute/min.sim index 928404babc39201267fc5579b0611be01e1be4b1..216f2061d757ea6388b5c053251c0a0ec29a2721 100644 --- a/tests/script/windows/compute/min.sim +++ b/tests/script/windows/compute/min.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_mi_db $tbPrefix = m_mi_tb diff --git a/tests/script/windows/compute/percentile.sim b/tests/script/windows/compute/percentile.sim index 6068722b549cb213399aae8bc7c48d100e167993..20b2740d6e19c7b2584a0081d321a0a4baa7e0d8 100644 --- a/tests/script/windows/compute/percentile.sim +++ b/tests/script/windows/compute/percentile.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_pe_db $tbPrefix = m_pe_tb diff --git a/tests/script/windows/compute/stddev.sim b/tests/script/windows/compute/stddev.sim index b5ba704bef35a4a9f1b4d00f7b6170e4228cac2b..c02b3e4ab36522de224e630f94b27c73ff329f43 100644 --- a/tests/script/windows/compute/stddev.sim +++ b/tests/script/windows/compute/stddev.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_st_db $tbPrefix = m_st_tb diff --git a/tests/script/windows/compute/sum.sim b/tests/script/windows/compute/sum.sim index 39eb771f34226b3cb54754735aa6381133f5ff3f..04af1d457a4121307618fd6f5950ca04d1f49e83 100644 --- a/tests/script/windows/compute/sum.sim +++ b/tests/script/windows/compute/sum.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_su_db $tbPrefix = m_su_tb diff --git a/tests/script/windows/compute/top.sim b/tests/script/windows/compute/top.sim index b64c24b03f594e11b73a821c275aecbe1cd3aee1..b3c698c0648e8e6267e340b3930cca0193369569 100644 --- a/tests/script/windows/compute/top.sim +++ b/tests/script/windows/compute/top.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_to_db $tbPrefix = m_to_tb diff --git a/tests/script/windows/db/basic.sim b/tests/script/windows/db/basic.sim index 4222cfe3b2cda0943e6cdd19ab2f7190d2ffad7e..f1e18d15a54df35dd172bc35413912d95f9e9c24 100644 --- a/tests/script/windows/db/basic.sim +++ b/tests/script/windows/db/basic.sim @@ -1,5 +1,6 @@ -sql connect sleep 3000 +sql connect + print ============================ dnode1 start $i = 0 @@ -9,7 +10,7 @@ $db = $dbPrefix . $i $tb = $tbPrefix . $i print =============== step1 -sql create database $db replica 1 days 20 keep 2000 +sql create database $db replica 1 days 20 keep 2000 cache 16 sql show databases print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 if $data00 != $db then @@ -24,10 +25,10 @@ endi if $data04 != 1 then return -1 endi -if $data05 != 20 then +if $data06 != 20 then return -1 endi -if $data07 != 1000 then +if $data08 != 16 then return -1 endi @@ -46,7 +47,7 @@ if $rows != 0 then endi print =============== step4 -sql drop database $db +sql_error drop database $db print =============== step5 sql create database $db replica 1 days 15 keep 1500 @@ -64,14 +65,10 @@ endi if $data04 != 1 then return -1 endi -if $data05 != 15 then +if $data06 != 15 then return -1 endi -if $data07 != 1000 then - return -1 -endi - print =============== step6 sql use $db sql create table $tb (ts timestamp, speed int) @@ -95,9 +92,7 @@ $db = $dbPrefix . $i $tb = $tbPrefix . $i sql create database $db sql use $db -sql create table $tb (ts timestamp, speed int) -x step6 - return -1 -step6: +sql create table $tb (ts timestamp, speed int) print =============== step7 $i = 0 diff --git a/tests/script/windows/db/len.sim b/tests/script/windows/db/len.sim index 32f647617792f3f72cdb6ed630f2db7c9b38f296..f922e7e05a6060890448467f5dbb123b81eb5cb2 100644 --- a/tests/script/windows/db/len.sim +++ b/tests/script/windows/db/len.sim @@ -1,8 +1,8 @@ -sql connect sleep 3000 +sql connect print =============== step1 -sql drop database dd +sql_error drop database dd sql create database -x step1 return -1 @@ -40,7 +40,7 @@ if $rows != 0 then endi print =============== step4 -sql create database a012345678901201234567890120123456789012 -x step4 +sql create database a012345678901201234567890120123456789012a012345678901201234567890120123456789012 -x step4 return -1 step4: sql show databases diff --git a/tests/script/windows/field/binary.sim b/tests/script/windows/field/binary.sim index cd75b6381441402f4997400a1803b4a28fd1bd30..8b86c4dbeaaa02a1a8d31b22bf3d112ca87435e2 100644 --- a/tests/script/windows/field/binary.sim +++ b/tests/script/windows/field/binary.sim @@ -55,17 +55,10 @@ if $rows != 75 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' group by tgcol -x step13 - return -1 -step13: - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = '1' group by tgcol -x step14 - return -1 -step14: - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' interval(1d) group by tgcol -x step15 - return -1 -step15: +print select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' +sql_error select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' group by tgcol +sql_error select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = '1' group by tgcol +sql_error select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' interval(1d) group by tgcol #can't filter binary fields diff --git a/tests/script/windows/import/basic.sim b/tests/script/windows/import/basic.sim index 0621721a6b88f3badb46532d1417f185b33cd595..c20378ee88c69c6ded52198339a8fe0bcfc74a9c 100644 --- a/tests/script/windows/import/basic.sim +++ b/tests/script/windows/import/basic.sim @@ -6,111 +6,112 @@ sql use ibadb sql create table tb(ts timestamp, i int) print ================= step1 -sql import into tb values(10000, 10000) + +sql import into tb values(1564641710000, 10000) sql select * from tb; if $rows != 1 then return -1 endi print ================= step2 -sql insert into tb values(8000, 8000) +sql insert into tb values(1564641708000, 8000) sql select * from tb; -if $rows != 1 then +if $rows != 2 then return -1 endi print ================= step3 -sql insert into tb values(20000, 20000) +sql insert into tb values(1564641720000, 20000) sql select * from tb; -if $rows != 2 then +if $rows != 3 then return -1 endi print ================= step4 -sql import into tb values(8000, 8000) -sql import into tb values(15000, 15000) -sql import into tb values(30000, 30000) +sql import into tb values(1564641708000, 8000) +sql import into tb values(1564641715000, 15000) +sql import into tb values(1564641730000, 30000) sql select * from tb; if $rows != 5 then return -1 endi print ================= step5 -sql insert into tb values(8000, 8000) -sql insert into tb values(14000, 14000) -sql insert into tb values(25000, 25000) -sql insert into tb values(40000, 40000) +sql insert into tb values(1564641708000, 8000) +sql insert into tb values(1564641714000, 14000) +sql insert into tb values(1564641725000, 25000) +sql insert into tb values(1564641740000, 40000) sql select * from tb; -if $rows != 6 then +if $rows != 8 then return -1 endi print ================= step6 -sql import into tb values(7000, 7000) -sql import into tb values(12000, 12000) -sql import into tb values(23000, 23000) -sql import into tb values(34000, 34000) -sql import into tb values(50000, 50000) +sql import into tb values(1564641707000, 7000) +sql import into tb values(1564641712000, 12000) +sql import into tb values(1564641723000, 23000) +sql import into tb values(1564641734000, 34000) +sql import into tb values(1564641750000, 50000) sql select * from tb; -if $rows != 11 then +if $rows != 13 then return -1 endi print ================= step7 -sql import into tb values(7001, 7001) -sql import into tb values(12001, 12001) -sql import into tb values(23001, 23001) -sql import into tb values(34001, 34001) -sql import into tb values(50001, 50001) +sql import into tb values(1564641707001, 7001) +sql import into tb values(1564641712001, 12001) +sql import into tb values(1564641723001, 23001) +sql import into tb values(1564641734001, 34001) +sql import into tb values(1564641750001, 50001) sql select * from tb; -if $rows != 16 then +if $rows != 18 then return -1 endi print ================= step8 -sql insert into tb values(8002, 8002) -sql insert into tb values(14002, 14002) -sql insert into tb values(25002, 25002) -sql insert into tb values(200000, 60000) +sql insert into tb values(1564641708002, 8002) +sql insert into tb values(1564641714002, 14002) +sql insert into tb values(1564641725002, 25002) +sql insert into tb values(1564641900000, 200000) sql select * from tb; -if $rows != 17 then +if $rows != 22 then return -1 endi print ================= step9 only insert last one -sql import into tb values(5000, 5000)(18000, 18000)(700000, 700000) +sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 700000) sql select * from tb; -if $rows != 18 then +if $rows != 25 then return -1 endi print ================= step10 -sql import into tb values(5000, 5000)(18000, 18000)(700000, 70000) +sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 70000) sql select * from tb; -if $rows != 19 then +if $rows != 25 then return -1 endi print ================= step11 -sql import into tb values(700000, 700000) +sql import into tb values(1564642400000, 700000) sql select * from tb; -if $rows != 19 then +if $rows != 25 then return -1 endi print ================= step12 -sql import into tb values(9527, 9527)(9527, 9528) +sql import into tb values(1564641709527, 9527)(1564641709527, 9528) sql select * from tb; print rows=> $rows -if $rows != 21 then +if $rows != 26 then return -1 endi print ================= step13 -sql import into tb values(9898, 9898)(9897, 9897) +sql import into tb values(1564641709898, 9898)(1564641709897, 9897) sql select * from tb; print rows=> $rows -if $rows != 23 then +if $rows != 28 then return -1 endi diff --git a/tests/script/windows/insert/basic.sim b/tests/script/windows/insert/basic.sim index 42fdf87098f626cd7cbe215c60b064d0ac53ccad..be0980a2d4a60d8c94152f9fd57e6187cb788198 100644 --- a/tests/script/windows/insert/basic.sim +++ b/tests/script/windows/insert/basic.sim @@ -22,20 +22,20 @@ while $x < 10 endw print =============== step 2 -sql insert into $tb values (now - 5m , 10) -x error_insert -sql insert into $tb values (now - 6m , 10) -x error_insert -sql insert into $tb values (now - 7m , 10) -x error_insert -sql insert into $tb values (now - 8m , 10) -x error_insert -error_insert: +sql insert into $tb values (now - 5m , 10) +sql insert into $tb values (now - 6m , 10) +sql insert into $tb values (now - 7m , 10) +sql insert into $tb values (now - 8m , 10) sql select * from $tb print $rows points data are retrieved -if $rows != 10 then +if $rows != 14 then return -1 endi sql drop database $db +sleep 1000 sql show databases if $rows != 0 then return -1 diff --git a/tests/script/windows/insert/query_multi_file.sim b/tests/script/windows/insert/query_multi_file.sim index 3170b435824113bb82f150d8dbba9dc8c3486a91..84c091fb213bfe61184de3e765fba04f5b7dadac 100644 --- a/tests/script/windows/insert/query_multi_file.sim +++ b/tests/script/windows/insert/query_multi_file.sim @@ -27,7 +27,7 @@ $N = 20000 $x = 0 while $x < $N - $ms = $x . m + $ms = $x . s #print insert into $tb values (now + $ms , $x ) sql insert into $tb values (now + $ms , $x ) -x error_insert $x = $x + 1 diff --git a/tests/script/windows/table/binary.sim b/tests/script/windows/table/binary.sim index 1f3df987bb9c33ad1cada10f929f16efe819c449..69354ed5c8ec5f4f938f755c29ce22a7e01bdfbd 100644 --- a/tests/script/windows/table/binary.sim +++ b/tests/script/windows/table/binary.sim @@ -38,7 +38,8 @@ if $data00 != 23456 then endi print =============== step4 -sql insert into $tb values (now+3a, '345678') +sql_error insert into $tb values (now+3a, '345678') +sql insert into $tb values (now+3a, '34567') sql select speed from $tb order by ts desc if $rows != 3 then return -1 diff --git a/tests/script/windows/table/bool.sim b/tests/script/windows/table/bool.sim index afaaf46f518dba54e35510212f8df7d41db9b64d..9e434d801a21fe58d05b83b5e52b5d24581bc29f 100644 --- a/tests/script/windows/table/bool.sim +++ b/tests/script/windows/table/bool.sim @@ -19,7 +19,7 @@ if $rows != 1 then return -1 endi -if $data01 != true then +if $data01 != 1 then return -1 endi @@ -30,7 +30,7 @@ if $rows != 2 then return -1 endi -if $data01 != true then +if $data01 != 1 then return -1 endi @@ -41,7 +41,7 @@ if $rows != 3 then return -1 endi -if $data01 != true then +if $data01 != 1 then return -1 endi @@ -52,7 +52,7 @@ if $rows != 4 then return -1 endi -if $data01 != false then +if $data01 != 0 then return -1 endi @@ -63,7 +63,7 @@ if $rows != 5 then return -1 endi -if $data01 != true then +if $data01 != 1 then return -1 endi @@ -74,7 +74,7 @@ if $rows != 6 then return -1 endi -if $data01 != false then +if $data01 != 0 then return -1 endi diff --git a/tests/script/windows/table/column_value.sim b/tests/script/windows/table/column_value.sim index d3b120d08e8d35a95fbec81875afdc1da6b72b47..9dbaf7ceabef3bfa2d02be8f3cfb004f944d65bd 100644 --- a/tests/script/windows/table/column_value.sim +++ b/tests/script/windows/table/column_value.sim @@ -29,13 +29,12 @@ if $rows != 0 then endi print =============== step2 -sql create table $tb (ts timestamp, speed bigint, v1 binary(1500), v2 binary(1500), v3 binary(1500), v4 binary(500), v5 binary(500)) -x step2 - return -1 -step2: +sql create table $tb (ts timestamp, speed bigint, v1 binary(1500), v2 binary(1500), v3 binary(1500), v4 binary(500), v5 binary(500)) sql show tables -if $rows != 0 then +if $rows != 1 then return -1 endi +sql drop table $tb print =============== step3 sql create table $tb (ts timestamp, speed float, v1 binary(100), v2 binary(100), v3 binary(100), v4 binary(100), v5 binary(100)) @@ -56,11 +55,9 @@ if $rows != 0 then endi print =============== step4 -sql create table $tb (ts timestamp, speed double, v1 binary(1500), v2 binary(1500), v3 binary(1500), v4 binary(500), v5 binary(500)) -x step4 - return -1 -step4: +sql create table $tb (ts timestamp, speed double, v1 binary(1500), v2 binary(1500), v3 binary(1500), v4 binary(500), v5 binary(500)) sql show tables -if $rows != 0 then +if $rows != 1 then return -1 endi diff --git a/tests/script/windows/table/float.sim b/tests/script/windows/table/float.sim index 4188f62166a4899c18cb963c82cb14079047eb4b..57b626f8659aace50f459f8fd185d2c64be2c0df 100644 --- a/tests/script/windows/table/float.sim +++ b/tests/script/windows/table/float.sim @@ -31,7 +31,7 @@ sql select * from $tb order by ts desc if $rows != 1 then return -1 endi -if $data01 != 2.8500 then +if $data01 != 2.85000 then return -1 endi @@ -41,7 +41,7 @@ sql select * from $tb order by ts desc if $rows != 2 then return -1 endi -if $data01 != 3.4000 then +if $data01 != 3.40000 then return -1 endi @@ -54,7 +54,7 @@ sql select * from $tb order by ts desc if $rows != 3 then return -1 endi -if $data01 != 0.0000 then +if $data01 != 0.00000 then return -1 endi @@ -67,7 +67,7 @@ sql select * from $tb order by ts desc if $rows != 4 then return -1 endi -if $data01 != 2.0000 then +if $data01 != 2.00000 then return -1 endi @@ -80,7 +80,7 @@ sql select * from $tb order by ts desc if $rows != 5 then return -1 endi -if $data01 != 2.0000 then +if $data01 != 2.00000 then return -1 endi diff --git a/tests/script/windows/table/table.sim b/tests/script/windows/table/table.sim index fe93fec6cd82f9eff014dd51b269ef170b889393..55be8af85145cd88f84d2d5194bb41d2a9c6afb1 100644 --- a/tests/script/windows/table/table.sim +++ b/tests/script/windows/table/table.sim @@ -58,7 +58,7 @@ sql create table $tb (ts timestamp, val float, val2 float) sql insert into $tb values(now, 5, 5) sql select * from $tb print ==> $data01 $data02 -if $data01 != 5.0000 then +if $data01 != 5.00000 then return -1 endi @@ -162,7 +162,7 @@ endi sql insert into $tb values(now, 5, 5) sql select * from $tb print ==> $data01 $data02 -if $data01 != 5.0000 then +if $data01 != 5.00000 then return -1 endi diff --git a/tests/script/windows/table/table_len.sim b/tests/script/windows/table/table_len.sim index b792044b40c1603a1ede5cf72dc20f6dfe2c198b..cdd1f3173137ad881034feb1267bd08883dd4723 100644 --- a/tests/script/windows/table/table_len.sim +++ b/tests/script/windows/table/table_len.sim @@ -51,7 +51,7 @@ if $rows != 0 then endi print =============== step4 -sql create table ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789 (ts timestamp, speed int) -x step4 +sql create table ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789 (ts timestamp, speed int) -x step4 return -1 step4: sql show tables diff --git a/tests/script/windows/tag/add.sim b/tests/script/windows/tag/add.sim index adcff4f62d8551f287d34e626396a7173f112665..2c72d019551d78e4b3eba710621d36d57bf75b76 100644 --- a/tests/script/windows/tag/add.sim +++ b/tests/script/windows/tag/add.sim @@ -30,7 +30,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -40,7 +40,7 @@ endi sql alter table $mt drop tag tgcol2 sql alter table $mt add tag tgcol4 int sql reset query cache -sql alter table $tb set tgcol4 =4 +sql alter table $tb set tag tgcol4 =4 sql reset query cache sql select * from $mt where tgcol4 = 4 @@ -51,7 +51,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 4 then @@ -86,7 +86,7 @@ endi sql alter table $mt drop tag tgcol2 sql alter table $mt add tag tgcol4 tinyint sql reset query cache -sql alter table $tb set tgcol4=4 +sql alter table $tb set tag tgcol4=4 sql reset query cache sql select * from $mt where tgcol4 = 4 @@ -125,28 +125,29 @@ endi if $data02 != 1 then return -1 endi -if $data03 != 2.0000 then +if $data03 != 2.00000 then return -1 endi sql describe $tb +print sql describe $tb if $data21 != BIGINT then return -1 endi if $data31 != FLOAT then return -1 endi -if $data23 != 1 then +if $data23 != TAG then return -1 endi -if $data33 != 2.000000 then +if $data33 != TAG then return -1 endi sql alter table $mt drop tag tgcol2 sql alter table $mt add tag tgcol4 float sql reset query cache -sql alter table $tb set tgcol4=4 +sql alter table $tb set tag tgcol4=4 sql reset query cache sql select * from $mt where tgcol4 = 4 @@ -160,7 +161,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != 4.0000 then +if $data03 != 4.00000 then return -1 endi @@ -192,7 +193,7 @@ endi sql alter table $mt drop tag tgcol2 sql alter table $mt add tag tgcol4 smallint sql reset query cache -sql alter table $tb set tgcol4=4 +sql alter table $tb set tag tgcol4=4 sql reset query cache sql select * from $mt where tgcol4 = 4 @@ -228,7 +229,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -245,9 +246,9 @@ sql alter table $mt add tag tgcol5 binary(10) sql alter table $mt add tag tgcol6 binary(10) sql reset query cache -sql alter table $tb set tgcol4=false -sql alter table $tb set tgcol5=5 -sql alter table $tb set tgcol6=6 +sql alter table $tb set tag tgcol4=false +sql alter table $tb set tag tgcol5=5 +sql alter table $tb set tag tgcol6=6 sql reset query cache sql select * from $mt where tgcol5 = '5' @@ -258,7 +259,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != false then +if $data02 != 0 then return -1 endi if $data03 != 5 then @@ -276,7 +277,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != false then +if $data02 != 0 then return -1 endi if $data03 != 5 then @@ -325,9 +326,9 @@ sql alter table $mt add tag tgcol5 bigint sql alter table $mt add tag tgcol6 tinyint sql reset query cache -sql alter table $tb set tgcol4=4 -sql alter table $tb set tgcol5=5 -sql alter table $tb set tgcol6=6 +sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol5=5 +sql alter table $tb set tag tgcol6=6 sql reset query cache sql select * from $mt where tgcol6 = 6 @@ -372,7 +373,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != 2.0000 then +if $data03 != 2.00000 then return -1 endi if $data04 != 3 then @@ -385,9 +386,9 @@ sql alter table $mt drop tag tgcol3 sql alter table $mt add tag tgcol5 binary(17) sql alter table $mt add tag tgcol6 bool sql reset query cache -sql alter table $tb set tgcol4=4 -sql alter table $tb set tgcol5=5 -sql alter table $tb set tgcol6=true +sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol5=5 +sql alter table $tb set tag tgcol6=1 sql reset query cache sql select * from $mt where tgcol5 = '5' @@ -405,7 +406,7 @@ endi if $data03 != 5 then return -1 endi -if $data04 != true then +if $data04 != 1 then return -1 endi @@ -447,12 +448,12 @@ sql alter table $mt add tag tgcol5 bool sql alter table $mt add tag tgcol6 float sql reset query cache -sql alter table $tb set tgcol4=4 -sql alter table $tb set tgcol5=true -sql alter table $tb set tgcol6=6 +sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol5=1 +sql alter table $tb set tag tgcol6=6 sql reset query cache -sql select * from $mt where tgcol5 = true +sql select * from $mt where tgcol5 = 1 print $data01 $data02 $data03 if $rows != 1 then return -1 @@ -463,10 +464,10 @@ endi if $data02 != 4.000000000 then return -1 endi -if $data03 != true then +if $data03 != 1 then return -1 endi -if $data04 != 6.0000 then +if $data04 != 6.00000 then return -1 endi @@ -516,8 +517,8 @@ sql alter table $mt add tag tgcol4 binary(10) sql alter table $mt add tag tgcol5 bool sql reset query cache -sql alter table $tb set tgcol4=4 -sql alter table $tb set tgcol5=false +sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol5=false sql reset query cache sql select * from $mt where tgcol4 = '4' @@ -534,10 +535,10 @@ endi if $data03 != 4 then return -1 endi -if $data04 != false then +if $data04 != 0 then return -1 endi -if $data05 != NULL then +if $data05 != null then return -1 endi @@ -562,7 +563,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -571,7 +572,7 @@ endi if $data04 != 3 then return -1 endi -if $data05 != 4.0000 then +if $data05 != 4.00000 then return -1 endi if $data06 != 5 then @@ -594,11 +595,11 @@ sql alter table $mt add tag tgcol7 bigint sql alter table $mt add tag tgcol8 smallint sql reset query cache -sql alter table $tb set tgcol4=4 -sql alter table $tb set tgcol5=5 -sql alter table $tb set tgcol6=6 -sql alter table $tb set tgcol7=7 -sql alter table $tb set tgcol8=8 +sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol5=5 +sql alter table $tb set tag tgcol6=6 +sql alter table $tb set tag tgcol7=7 +sql alter table $tb set tag tgcol8=8 sql reset query cache sql select * from $mt where tgcol5 =5 @@ -609,7 +610,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 4 then @@ -652,13 +653,13 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then return -1 endi -if $data04 != 3.0000 then +if $data04 != 3.00000 then return -1 endi if $data05 != 4.000000000 then @@ -682,12 +683,12 @@ sql alter table $mt add tag tgcol4 binary(10) sql alter table $mt add tag tgcol5 bigint sql reset query cache -sql alter table $tb set tgcol1=false -sql alter table $tb set tgcol2=5 -sql alter table $tb set tgcol3=4 -sql alter table $tb set tgcol4=3 -sql alter table $tb set tgcol5=2 -sql alter table $tb set tgcol6=1 +sql alter table $tb set tag tgcol1=false +sql alter table $tb set tag tgcol2=5 +sql alter table $tb set tag tgcol3=4 +sql alter table $tb set tag tgcol4=3 +sql alter table $tb set tag tgcol5=2 +sql alter table $tb set tag tgcol6=1 sql reset query cache sql select * from $mt where tgcol4 = '3' @@ -698,7 +699,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != false then +if $data02 != 0 then return -1 endi if $data03 != 1 then @@ -779,12 +780,12 @@ sql alter table $mt add tag tgcol4 int sql alter table $mt add tag tgcol6 bigint sql reset query cache -sql alter table $tb set tgcol1=7 -sql alter table $tb set tgcol2=8 -sql alter table $tb set tgcol3=9 -sql alter table $tb set tgcol4=10 -sql alter table $tb set tgcol5=11 -sql alter table $tb set tgcol6=12 +sql alter table $tb set tag tgcol1=7 +sql alter table $tb set tag tgcol2=8 +sql alter table $tb set tag tgcol3=9 +sql alter table $tb set tag tgcol4=10 +sql alter table $tb set tag tgcol5=11 +sql alter table $tb set tag tgcol6=12 sql reset query cache sql select * from $mt where tgcol2 = '8' @@ -826,6 +827,8 @@ sql alter table $mt add tag tgcol3 binary(10) sql alter table $mt add tag tgcol4 int sql alter table $mt add tag tgcol5 bigint sql alter table $mt add tag tgcol6 bigint + +return sql alter table $mt add tag tgcol7 bigint -x step141 return -1 step141: diff --git a/tests/script/windows/tag/change.sim b/tests/script/windows/tag/change.sim index 95a767da496b336d65e140203b51850235ec8433..2901842190ba5acfe3dc85ea50cdb89a589263ea 100644 --- a/tests/script/windows/tag/change.sim +++ b/tests/script/windows/tag/change.sim @@ -30,7 +30,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -43,9 +43,9 @@ step21: sql alter table $mt change tag tgcol1 tgcol2 -x step22 return -1 step22: -sql alter table $mt change tag tgcol1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -x step20 - return -1 -step20: +#sql alter table $mt change tag tgcol1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -x step20 +# return -1 +#step20: sql alter table $mt change tag tgcol1 tgcol3 sql alter table $mt change tag tgcol2 tgcol4 @@ -94,7 +94,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != 2.0000 then +if $data03 != 2.00000 then return -1 endi @@ -191,7 +191,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -206,7 +206,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -278,22 +278,22 @@ endi if $data02 != 1 then return -1 endi -if $data03 != 2.0000 then +if $data03 != 2.00000 then return -1 endi sql select * from $mt where tgcol4 = 2 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2.0000 then +if $data03 != 2.00000 then return -1 endi @@ -386,7 +386,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -413,7 +413,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -440,7 +440,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -467,7 +467,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -494,7 +494,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -503,4 +503,4 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi diff --git a/tests/script/windows/tag/create.sim b/tests/script/windows/tag/create.sim index e7f716316019efc7796ade5dbc3f7d66178b75a5..5beba21727ebf842269aca8b9b760e68bb2470b4 100644 --- a/tests/script/windows/tag/create.sim +++ b/tests/script/windows/tag/create.sim @@ -126,7 +126,8 @@ if $data01 != 1 then return -1 endi sql select * from $mt where tgcol = 0 -if $rows != 0 then +if $rows != 0 then + print expect 0, actual: $rows return -1 endi @@ -176,7 +177,8 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 bool) sql create table $tb using $mt tags( 1, 2 ) sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then + print expect 1, actual: $rows return -1 endi if $data01 != 1 then @@ -569,7 +571,7 @@ $i = 30 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(250), tgcol2 binary(250), tgcol3 binary(30)) -x step30 - return -1 +# return -1 step30: print =============== step31 @@ -577,7 +579,8 @@ $i = 31 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(5)) -sql create table $tb using $mt tags('1234567') +sql_error create table $tb using $mt tags('1234567') +sql create table $tb using $mt tags('12345') sql insert into $tb values(now, 1) sql select * from $mt print sql select * from $mt diff --git a/tests/script/windows/tag/delete.sim b/tests/script/windows/tag/delete.sim index 75702fe9eee4eb22a0dc90b17805f01ae182fd8e..e2395c8f976aca6309bf32a273d20f44eb4951b0 100644 --- a/tests/script/windows/tag/delete.sim +++ b/tests/script/windows/tag/delete.sim @@ -30,7 +30,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -79,7 +79,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != 2.0000 then +if $data03 != 2.00000 then return -1 endi @@ -90,7 +90,7 @@ endi if $data31 != FLOAT then return -1 endi -if $data23 != 1 then +if $data23 != TAG then return -1 endi @@ -139,7 +139,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -195,13 +195,13 @@ endi if $data42 != 10 then return -1 endi -if $data23 != 1 then +if $data23 != TAG then return -1 endi -if $data33 != 2 then +if $data33 != TAG then return -1 endi -if $data43 != 3 then +if $data43 != TAG then return -1 endi @@ -225,7 +225,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != 2.0000 then +if $data03 != 2.00000 then return -1 endi if $data04 != 3 then @@ -307,7 +307,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -316,7 +316,7 @@ endi if $data04 != 3 then return -1 endi -if $data05 != 4.0000 then +if $data05 != 4.00000 then return -1 endi if $data06 != 5 then @@ -341,13 +341,13 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then return -1 endi -if $data04 != 3.0000 then +if $data04 != 3.00000 then return -1 endi if $data05 != 4.000000000 then @@ -417,10 +417,10 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi -if $data03 != NULL then +if $data03 != null then return -1 endi @@ -444,7 +444,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != NULL then +if $data03 != null then return -1 endi @@ -468,7 +468,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != NULL then +if $data03 != null then return -1 endi @@ -492,7 +492,7 @@ endi if $data02 != 1.000000000 then return -1 endi -if $data03 != NULL then +if $data03 != null then return -1 endi @@ -513,13 +513,13 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi -if $data03 != NULL then +if $data03 != null then return -1 endi -if $data04 != NULL then +if $data04 != null then return -1 endi @@ -546,10 +546,10 @@ endi if $data02 != 1 then return -1 endi -if $data03 != NULL then +if $data03 != null then return -1 endi -if $data04 != NULL then +if $data04 != null then return -1 endi @@ -576,10 +576,10 @@ endi if $data02 != 1 then return -1 endi -if $data03 != NULL then +if $data03 != null then return -1 endi -if $data04 != NULL then +if $data04 != null then return -1 endi @@ -606,10 +606,10 @@ endi if $data02 != 1.000000000 then return -1 endi -if $data03 != NULL then +if $data03 != null then return -1 endi -if $data04 != NULL then +if $data04 != null then return -1 endi @@ -636,13 +636,13 @@ endi if $data02 != 1 then return -1 endi -if $data03 != NULL then +if $data03 != null then return -1 endi -if $data04 != NULL then +if $data04 != null then return -1 endi -if $data05 != NULL then +if $data05 != null then return -1 endi @@ -669,19 +669,19 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi -if $data03 != 4.0000 then +if $data03 != 4.00000 then return -1 endi -if $data04 != NULL then +if $data04 != null then return -1 endi -if $data05 != NULL then +if $data05 != null then return -1 endi -if $data06 != NULL then +if $data06 != null then return -1 endi @@ -708,22 +708,22 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 4.000000000 then return -1 endi -if $data04 != NULL then +if $data04 != null then return -1 endi -if $data05 != NULL then +if $data05 != null then return -1 endi -if $data06 != NULL then +if $data06 != null then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -763,13 +763,13 @@ endi if $data04 != 5.000000000 then return -1 endi -if $data05 != NULL then +if $data05 != null then return -1 endi -if $data06 != NULL then +if $data06 != null then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi diff --git a/tests/script/windows/tag/filter.sim b/tests/script/windows/tag/filter.sim index 72a8e39dc8e91e8cb095a600ba8fe4a87d130188..b70e56fdb6cd45b7c1e4e0c20acdf337ba1d320a 100644 --- a/tests/script/windows/tag/filter.sim +++ b/tests/script/windows/tag/filter.sim @@ -85,9 +85,7 @@ sql select count(tgcol), avg(tgcol), sum(tgcol), min(tgcol), max(tgcol), first(t step7: print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tbcol -x step8 - return -1 -step8: +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tbcol print =============== step9 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by noexist -x step9 @@ -102,9 +100,7 @@ if $data00 != 100 then endi print =============== step11 -sql select count(tbcol) as c from $mt group by tbcol -x step11 - return -1 -step11: +sql select count(tbcol) as c from $mt group by tbcol print =============== step12 sql select count(tbcol) as c from $mt group by noexist -x step12 @@ -121,7 +117,8 @@ endi print =============== step14 sql select count(tbcol) as c from $mt where ts > 1000 group by tgcol print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +if $data00 != 100 then + print expect 100, actual $data00 return -1 endi diff --git a/tests/script/windows/tag/set.sim b/tests/script/windows/tag/set.sim index b264164604cf09f37938c51d3186b5f79e9a49f4..580f91cb4945df5952f205e50520345b277d5a86 100644 --- a/tests/script/windows/tag/set.sim +++ b/tests/script/windows/tag/set.sim @@ -30,7 +30,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -40,8 +40,8 @@ endi sql alter table $tb set tag tagcx 1 -x step21 return -1 step21: -sql alter table $tb set tgcol1=false -sql alter table $tb set tgcol2=4 +sql alter table $tb set tag tgcol1=false +sql alter table $tb set tag tgcol2=4 sql reset query cache @@ -53,7 +53,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != false then +if $data02 != 0 then return -1 endi if $data03 != 4 then @@ -68,7 +68,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != false then +if $data02 != 0 then return -1 endi if $data03 != 4 then @@ -83,10 +83,10 @@ endi if $data31 != INT then return -1 endi -if $data23 != false then +if $data23 != TAG then return -1 endi -if $data33 != 4 then +if $data33 != TAG then return -1 endi @@ -111,8 +111,8 @@ if $data03 != 2 then return -1 endi -sql alter table $tb set tgcol1=3 -sql alter table $tb set tgcol2=4 +sql alter table $tb set tag tgcol1=3 +sql alter table $tb set tag tgcol2=4 sql reset query cache @@ -169,12 +169,12 @@ endi if $data02 != 1 then return -1 endi -if $data03 != 2.0000 then +if $data03 != 2.00000 then return -1 endi -sql alter table $tb set tgcol1=3 -sql alter table $tb set tgcol2=4 +sql alter table $tb set tag tgcol1=3 +sql alter table $tb set tag tgcol2=4 sql reset query cache @@ -189,7 +189,7 @@ endi if $data02 != 3 then return -1 endi -if $data03 != 4.0000 then +if $data03 != 4.00000 then return -1 endi @@ -204,7 +204,7 @@ endi if $data02 != 3 then return -1 endi -if $data03 != 4.0000 then +if $data03 != 4.00000 then return -1 endi @@ -230,8 +230,8 @@ if $data03 != 2 then return -1 endi -sql alter table $tb set tgcol1=3 -sql alter table $tb set tgcol2='4' +sql alter table $tb set tag tgcol1=3 +sql alter table $tb set tag tgcol2='4' sql reset query cache @@ -299,11 +299,11 @@ if $data07 != 6 then endi sql alter table $mt drop tag tgcol3 -sql alter table $tb set tgcol1='7' -sql alter table $tb set tgcol2=8 -sql alter table $tb set tgcol4='9' -sql alter table $tb set tgcol5=10 -sql alter table $tb set tgcol6='11' +sql alter table $tb set tag tgcol1='7' +sql alter table $tb set tag tgcol2=8 +sql alter table $tb set tag tgcol4='9' +sql alter table $tb set tag tgcol5=10 +sql alter table $tb set tag tgcol6='11' sql reset query cache @@ -330,7 +330,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -357,7 +357,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -384,7 +384,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -411,7 +411,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -438,7 +438,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi diff --git a/tests/script/windows/testSuite.sim b/tests/script/windows/testSuite.sim index 9aa7147ef698d79bbf9fb0af26ddb0bc44b914c4..e372217b620fcf0735e3645fa96872ca11450225 100644 --- a/tests/script/windows/testSuite.sim +++ b/tests/script/windows/testSuite.sim @@ -1,97 +1,93 @@ -run windows/account/user_create.sim -run windows/account/user_len.sim - -run windows/db/len.sim - -run windows/table/table.sim -run windows/table/table_len.sim -run windows/table/column_num.sim -run windows/table/column_name.sim -run windows/table/column_value.sim -run windows/table/binary.sim -run windows/table/bool.sim -run windows/table/double.sim -run windows/table/float.sim -run windows/table/db.table.sim - -run windows/import/basic.sim - run windows/alter/table.sim run windows/alter/metrics.sim -run windows/compute/count.sim run windows/compute/avg.sim -run windows/compute/sum.sim -run windows/compute/min.sim -run windows/compute/max.sim +run windows/compute/bottom.sim +run windows/compute/count.sim +run windows/compute/diff.sim run windows/compute/first.sim +run windows/compute/interval.sim run windows/compute/last.sim +run windows/compute/leastsquare.sim +run windows/compute/max.sim +run windows/compute/min.sim +run windows/compute/percentile.sim run windows/compute/stddev.sim -#run windows/compute/leastsquare.sim +run windows/compute/sum.sim run windows/compute/top.sim -run windows/compute/bottom.sim -run windows/compute/percentile.sim -run windows/compute/diff.sim -run windows/compute/interval.sim - -run windows/field/single.sim -run windows/field/bool.sim -run windows/field/smallint.sim -run windows/field/tinyint.sim -run windows/field/int.sim -run windows/field/bigint.sim -run windows/field/float.sim -run windows/field/double.sim -run windows/field/binary.sim + +run windows/db/basic.sim +run windows/db/len.sim + run windows/field/2.sim run windows/field/3.sim run windows/field/4.sim run windows/field/5.sim run windows/field/6.sim +run windows/field/bigint.sim +run windows/field/binary.sim +run windows/field/bool.sim +run windows/field/double.sim +run windows/field/float.sim +run windows/field/int.sim +run windows/field/single.sim +run windows/field/smallint.sim +run windows/field/tinyint.sim + +run windows/import/basic.sim + +run windows/insert/basic.sim +run windows/insert/query_block1_file.sim +run windows/insert/query_block1_memory.sim +run windows/insert/query_block2_file.sim +run windows/insert/query_block2_memory.sim +run windows/insert/query_file_memory.sim +run windows/insert/query_multi_file.sim + +run windows/table/binary.sim +run windows/table/bool.sim +run windows/table/column_num.sim +run windows/table/column_name.sim +run windows/table/column_value.sim +run windows/table/db.table.sim +run windows/table/double.sim +run windows/table/float.sim +run windows/table/table_len.sim +run windows/table/table.sim -run windows/tag/filter.sim -run windows/tag/column.sim -run windows/tag/bool.sim -run windows/tag/smallint.sim -run windows/tag/tinyint.sim -run windows/tag/int.sim -run windows/tag/bigint.sim -run windows/tag/float.sim -run windows/tag/double.sim -run windows/tag/binary.sim -run windows/tag/bool_int.sim -run windows/tag/bool_binary.sim -run windows/tag/int_float.sim -run windows/tag/int_binary.sim -run windows/tag/binary_binary.sim run windows/tag/3.sim run windows/tag/4.sim run windows/tag/5.sim run windows/tag/6.sim +run windows/tag/add.sim +run windows/tag/bigint.sim +run windows/tag/binary_binary.sim +run windows/tag/binary.sim +run windows/tag/bool_binary.sim +run windows/tag/bool_int.sim +run windows/tag/bool.sim +run windows/tag/change.sim +run windows/tag/column.sim run windows/tag/create.sim -#run windows/tag/delete.sim - -#run windows/tag/set.sim -#run windows/tag/add.sim +run windows/tag/delete.sim +run windows/tag/double.sim +run windows/tag/filter.sim +run windows/tag/float.sim +run windows/tag/int_binary.sim +run windows/tag/int_float.sim +run windows/tag/int.sim +run windows/tag/set.sim +run windows/tag/smallint.sim +run windows/tag/tinyint.sim -run windows/vector/single.sim -run windows/vector/multi.sim -run windows/vector/table_query.sim -run windows/vector/table_time.sim -run windows/vector/table_field.sim -run windows/vector/table_mix.sim +run windows/vector/metrics_field.sim +run windows/vector/metrics_mix.sim run windows/vector/metrics_query.sim run windows/vector/metrics_tag.sim run windows/vector/metrics_time.sim -run windows/vector/metrics_field.sim -run windows/vector/metrics_mix.sim - -run windows/insert/basic.sim -run windows/insert/query_block1_memory.sim -run windows/insert/query_block2_memory.sim -run windows/insert/query_block1_file.sim -#run windows/insert/query_block2_file.sim -#run windows/insert/query_file_memory.sim -#run windows/insert/query_multi_file.sim - -run windows/tag/change.sim +run windows/vector/multi.sim +run windows/vector/single.sim +run windows/vector/table_field.sim +run windows/vector/table_mix.sim +run windows/vector/table_query.sim +run windows/vector/table_time.sim diff --git a/tests/script/windows/vector/multi.sim b/tests/script/windows/vector/multi.sim index 969ba5aa19cdf9e3fbc4ce125efc652310eb9266..adcc94db3be4976580e6a7c607d8ebcb613db88c 100644 --- a/tests/script/windows/vector/multi.sim +++ b/tests/script/windows/vector/multi.sim @@ -200,7 +200,6 @@ sql select a + f from $tb where g = 2 and ts > now + 4m order by ts asc -x step return -1 step74: - print =============== clear sql drop database $db sql show databases diff --git a/tests/tsim/CMakeLists.txt b/tests/tsim/CMakeLists.txt index 64adce59454472cc765bfc194d5ab58b287465d4..50b42941aff12ec6762b2da904675e6fa0183cad 100644 --- a/tests/tsim/CMakeLists.txt +++ b/tests/tsim/CMakeLists.txt @@ -4,10 +4,6 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/cJson/inc) INCLUDE_DIRECTORIES(inc) -IF (TD_WINDOWS) - INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/pthread) -ENDIF () - AUX_SOURCE_DIRECTORY(src SRC) ADD_EXECUTABLE(tsim ${SRC}) TARGET_LINK_LIBRARIES(tsim taos_static trpc tutil pthread cJson) diff --git a/tests/tsim/src/simExe.c b/tests/tsim/src/simExe.c index 1078b329810f902e4884810a2572f8b760b0263f..8bc9a76545d749b698d9dcac5bc8d2a48aa9b103 100644 --- a/tests/tsim/src/simExe.c +++ b/tests/tsim/src/simExe.c @@ -313,7 +313,9 @@ bool simExecuteSystemCmd(SScript *script, char *option) { simError("script:%s, failed to execute %s , code %d, errno:%d %s, repeatTimes:%d", script->fileName, buf, code, errno, strerror(errno), repeatTimes); taosMsleep(1000); +#ifdef LINUX signal(SIGCHLD, SIG_DFL); +#endif if (repeatTimes++ >= 10) { exit(0); } @@ -418,14 +420,14 @@ void simVisuallizeOption(SScript *script, char *src, char *dst) { var = strchr(src, '$'); if (var == NULL) break; if (var && ((var - src - 1) > 0) && *(var - 1) == '\\') { - srcLen = var - src - 1; + srcLen = (int)(var - src - 1); memcpy(dst + dstLen, src, srcLen); dstLen += srcLen; src = var; break; } - srcLen = var - src; + srcLen = (int)(var - src); memcpy(dst + dstLen, src, srcLen); dstLen += srcLen; @@ -433,7 +435,7 @@ void simVisuallizeOption(SScript *script, char *src, char *dst) { value = simGetVariable(script, token, tokenLen); strcpy(dst + dstLen, value); - dstLen += strlen(value); + dstLen += (int)strlen(value); } strcpy(dst + dstLen, src); @@ -455,9 +457,9 @@ void simCloseNativeConnect(SScript *script) { void simCloseTaosdConnect(SScript *script) { if (simAsyncQuery) { - return simCloseRestFulConnect(script); + simCloseRestFulConnect(script); } else { - return simCloseNativeConnect(script); + simCloseNativeConnect(script); } } // {"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"} @@ -575,7 +577,7 @@ int simExecuteRestFulCommand(SScript *script, char *command) { while (!feof(fp)) { int availSize = mallocSize - alreadyReadSize; - int len = fread(content + alreadyReadSize, 1, availSize, fp); + int len = (int)fread(content + alreadyReadSize, 1, availSize, fp); if (len >= availSize) { alreadyReadSize += len; mallocSize *= 2; diff --git a/tests/tsim/src/simParse.c b/tests/tsim/src/simParse.c index 2528fde9f5cfdd7cbbd390a8bf46b33baa9bad1e..f201f149a14381cb1f068bc3132ab14feafd637c 100644 --- a/tests/tsim/src/simParse.c +++ b/tests/tsim/src/simParse.c @@ -105,7 +105,7 @@ void simAddCmdIntoHash(SCommand *pCmd) { int hash; SCommand *node; - hash = simHashCmd(pCmd->name, strlen(pCmd->name)); + hash = simHashCmd(pCmd->name, (int)strlen(pCmd->name)); node = cmdHashList[hash]; pCmd->next = node; cmdHashList[hash] = pCmd; @@ -199,7 +199,7 @@ SScript *simParseScript(char *fileName) { if (fgets(buffer, sizeof(buffer), fd) == NULL) continue; lineNum++; - int cmdlen = strlen(buffer); + int cmdlen = (int)strlen(buffer); if (buffer[cmdlen - 1] == '\r' || buffer[cmdlen - 1] == '\n') buffer[cmdlen - 1] = 0; rest = buffer; @@ -294,10 +294,10 @@ int simCheckExpression(char *exp) { rest = paGetToken(rest, &op, &opLen); - if (opLen == 0) return rest - exp; + if (opLen == 0) return (int)(rest - exp); /* if it is key word "then" */ - if (strncmp(op, "then", 4) == 0) return op - exp; + if (strncmp(op, "then", 4) == 0) return (int)(op - exp); rest = paGetToken(rest, &op2, &op2Len); if (op2Len == 0) { @@ -312,7 +312,7 @@ int simCheckExpression(char *exp) { if (op[0] == '+' || op[0] == '-' || op[0] == '*' || op[0] == '/' || op[0] == '.') { - return rest - exp; + return (int)(rest - exp); } return -1; @@ -655,7 +655,7 @@ bool simParsePrintCmd(char *rest, SCommand *pCmd, int lineNum) { cmdLine[numOfLines].cmdno = SIM_CMD_PRINT; cmdLine[numOfLines].lineNum = lineNum; cmdLine[numOfLines].optionOffset = optionOffset; - expLen = strlen(rest); + expLen = (int)strlen(rest); memcpy(optionBuffer + optionOffset, rest, expLen); optionOffset += expLen + 1; *(optionBuffer + optionOffset - 1) = 0; @@ -690,7 +690,7 @@ bool simParseSqlCmd(char *rest, SCommand *pCmd, int lineNum) { cmdLine[numOfLines].cmdno = SIM_CMD_SQL; cmdLine[numOfLines].lineNum = lineNum; cmdLine[numOfLines].optionOffset = optionOffset; - expLen = strlen(rest); + expLen = (int)strlen(rest); memcpy(optionBuffer + optionOffset, rest, expLen); optionOffset += expLen + 1; *(optionBuffer + optionOffset - 1) = 0; @@ -706,7 +706,7 @@ bool simParseSqlErrorCmd(char *rest, SCommand *pCmd, int lineNum) { cmdLine[numOfLines].cmdno = SIM_CMD_SQL_ERROR; cmdLine[numOfLines].lineNum = lineNum; cmdLine[numOfLines].optionOffset = optionOffset; - expLen = strlen(rest); + expLen = (int)strlen(rest); memcpy(optionBuffer + optionOffset, rest, expLen); optionOffset += expLen + 1; *(optionBuffer + optionOffset - 1) = 0; @@ -728,7 +728,7 @@ bool simParseSystemCmd(char *rest, SCommand *pCmd, int lineNum) { cmdLine[numOfLines].cmdno = SIM_CMD_SYSTEM; cmdLine[numOfLines].lineNum = lineNum; cmdLine[numOfLines].optionOffset = optionOffset; - expLen = strlen(rest); + expLen = (int)strlen(rest); memcpy(optionBuffer + optionOffset, rest, expLen); optionOffset += expLen + 1; *(optionBuffer + optionOffset - 1) = 0; @@ -840,14 +840,14 @@ void simInitsimCmdList() { cmdno = SIM_CMD_EXP; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "exp"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = NULL; simCmdList[cmdno].executeCmd = simExecuteExpCmd; cmdno = SIM_CMD_IF; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "if"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseIfCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -855,7 +855,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_ELIF; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "elif"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseElifCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -863,7 +863,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_ELSE; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "else"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseElseCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -871,7 +871,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_ENDI; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "endi"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseEndiCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -879,7 +879,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_WHILE; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "while"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseWhileCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -887,7 +887,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_ENDW; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "endw"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseEndwCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -895,7 +895,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_SWITCH; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "switch"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseSwitchCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -903,7 +903,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_CASE; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "case"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseCaseCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -911,7 +911,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_DEFAULT; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "default"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseDefaultCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -919,7 +919,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_BREAK; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "break"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseBreakCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -927,7 +927,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_CONTINUE; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "continue"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseContinueCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -935,7 +935,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_ENDS; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "ends"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseEndsCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -943,7 +943,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_SLEEP; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "sleep"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseSleepCmd; simCmdList[cmdno].executeCmd = simExecuteSleepCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -951,7 +951,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_GOTO; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "goto"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseGotoCmd; simCmdList[cmdno].executeCmd = simExecuteGotoCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -959,7 +959,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_RUN; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "run"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseRunCmd; simCmdList[cmdno].executeCmd = simExecuteRunCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -967,7 +967,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_RUN_BACK; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "run_back"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseRunBackCmd; simCmdList[cmdno].executeCmd = simExecuteRunBackCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -975,7 +975,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_SYSTEM; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "system"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseSystemCmd; simCmdList[cmdno].executeCmd = simExecuteSystemCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -983,7 +983,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_SYSTEM_CONTENT; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "system_content"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseSystemContentCmd; simCmdList[cmdno].executeCmd = simExecuteSystemContentCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -991,7 +991,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_PRINT; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "print"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParsePrintCmd; simCmdList[cmdno].executeCmd = simExecutePrintCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -999,7 +999,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_SQL; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "sql"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseSqlCmd; simCmdList[cmdno].executeCmd = simExecuteSqlCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -1007,7 +1007,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_SQL_ERROR; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "sql_error"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseSqlErrorCmd; simCmdList[cmdno].executeCmd = simExecuteSqlErrorCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -1015,7 +1015,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_SQL_SLOW; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "sql_slow"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseSqlSlowCmd; simCmdList[cmdno].executeCmd = simExecuteSqlSlowCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -1024,14 +1024,14 @@ void simInitsimCmdList() { cmdno = SIM_CMD_TEST; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "test"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = NULL; simCmdList[cmdno].executeCmd = simExecuteTestCmd; cmdno = SIM_CMD_RETURN; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "return"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseReturnCmd; simCmdList[cmdno].executeCmd = simExecuteReturnCmd; simAddCmdIntoHash(&(simCmdList[cmdno]));