diff options
Diffstat (limited to 'protocols/Telegram/tgl/tl-parser/contrib/vs')
6 files changed, 495 insertions, 0 deletions
diff --git a/protocols/Telegram/tgl/tl-parser/contrib/vs/config.bat b/protocols/Telegram/tgl/tl-parser/contrib/vs/config.bat new file mode 100644 index 0000000000..f71d87518d --- /dev/null +++ b/protocols/Telegram/tgl/tl-parser/contrib/vs/config.bat @@ -0,0 +1,107 @@ +@echo off +setlocal enabledelayedexpansion + +set PACKAGE_NAME="tl-parser" +set PACKAGE_TARNAME="tl-parser" +set PACKAGE_VERSION="1.0" +set PACKAGE_STRING="tl-parser %PACKAGE_VERSION:~1%" +set PACKAGE_BUGREPORT="" +set PACKAGE_URL="" + +set CONFIG_HEADER_IN=..\..\config.h.in +set CONFIG_HEADER=config.h +set DEFAULT_OUT_FOLDER=build +set OUT_PATH="" +set SOURCE_LIST=() + +:rem Parse Args +for %%a in (%*) do ( + if defined arg ( + if /I "-o"=="!arg!" set OUT_PATH=%%a + set set arg= + ) + if /I "%%a" geq "-" ( + set arg=%%a + ) else ( + set set arg= + ) +) +if %OUT_PATH%=="" ( + set OUT_PATH=%DEFAULT_OUT_FOLDER% +) + +:rem Make output folder if not exists +if not exist !OUT_PATH! mkdir !OUT_PATH! + +:rem Copy source files to the output folder +for %%i in %SOURCE_LIST% do ( + if not exist %OUT_PATH%\%%i ( + echo |set /p=Copying file: %%i + copy %%i "%OUT_PATH%\%%i" 1>NUL && ( + echo Done + ) || ( + echo Failed + ) + ) +) + +set OUT_PATH="%OUT_PATH%\%CONFIG_HEADER%" +if exist %OUT_PATH% exit /B 0 + +:rem Copy config.h.in to the output folder +echo |set /p=Copying file: %CONFIG_HEADER% +copy %CONFIG_HEADER_IN% %OUT_PATH% 1>NUL && ( + echo Done +) || ( + echo Failed + exit /B %ERRORLEVEL% +) + +:rem Configure config.h +echo |set /p=Configurating file: config.h +call :find_and_replace "#undef PACKAGE_BUGREPORT" "#define PACKAGE_BUGREPORT %PACKAGE_BUGREPORT%" +call :find_and_replace "#undef PACKAGE_NAME" "#define PACKAGE_NAME %PACKAGE_NAME%" +call :find_and_replace "#undef PACKAGE_STRING" "#define PACKAGE_STRING %PACKAGE_STRING%" +call :find_and_replace "#undef PACKAGE_TARNAME" "#define PACKAGE_TARNAME %PACKAGE_TARNAME%" +call :find_and_replace "#undef PACKAGE_URL" "#define PACKAGE_URL %PACKAGE_URL%" +call :find_and_replace "#undef PACKAGE_VERSION" "#define PACKAGE_VERSION %PACKAGE_VERSION%" + +call :find_and_replace "#undef HAVE_FCNTL_H" "#define HAVE_FCNTL_H 1" +call :find_and_replace "#undef HAVE_INTTYPES_H" "#define HAVE_INTTYPES_H 1" +call :find_and_replace "#undef HAVE_LIBZ" "#define HAVE_LIBZ 1" +call :find_and_replace "#undef HAVE_MALLOC" "#define HAVE_MALLOC 1" +call :find_and_replace "#undef HAVE_MEMORY_H" "#define HAVE_MEMORY_H 1" +call :find_and_replace "#undef HAVE_MEMSET" "#define HAVE_MEMSET 1" +call :find_and_replace "#undef HAVE_REALLOC" "#define HAVE_REALLOC 1" +call :find_and_replace "#undef HAVE_STDINT_H" "#define HAVE_STDINT_H 1" +call :find_and_replace "#undef HAVE_STDLIB_H" "#define HAVE_STDLIB_H 1" +call :find_and_replace "#undef HAVE_STRDUP" "#define HAVE_STRDUP 1" +call :find_and_replace "#undef HAVE_STRING_H" "#define HAVE_STRING_H 1" +call :find_and_replace "#undef HAVE_SYS_STAT_H" "#define HAVE_SYS_STAT_H 1" +call :find_and_replace "#undef HAVE_SYS_TYPES_H" "#define HAVE_SYS_TYPES_H 1" +call :find_and_replace "#undef STDC_HEADERS" "#define STDC_HEADERS 1" +call :find_and_replace "#undef inline" "#define inline __inline" +call :find_and_replace "#undef" "// #undef" + +if %ERRORLEVEL% == 0 echo Done +if not %ERRORLEVEL% == 0 ( + echo Failed + if exist %OUT_PATH% del /q /f %OUT_PATH% +) +exit /B %ERRORLEVEL% + +:find_and_replace +set FIND_STR=%1 +set "FIND_STR=!FIND_STR:~1,-1!" +set REPLACE_STR=%2 %3 +set "REPLACE_STR=!REPLACE_STR:~1,-2!" + +for /f "delims=" %%i in ('type "%OUT_PATH%" ^| find /n /v "" ^& break ^> "%OUT_PATH%" ') do ( + set "line=%%i" + setlocal enableDelayedExpansion + set "line=!line:*]%FIND_STR%=%REPLACE_STR%!" + set "line=!line:*]=!" + >>"%OUT_PATH%" echo(!line! + endlocal +) +exit /B %ERRORLEVEL% diff --git a/protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.sln b/protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.sln new file mode 100644 index 0000000000..8365b797fd --- /dev/null +++ b/protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tl-parser", "tl-parser.vcxproj", "{14022761-9F27-4A2D-B7EA-F41FB9B3274C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Debug|x64.ActiveCfg = Debug|x64 + {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Debug|x64.Build.0 = Debug|x64 + {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Debug|x86.ActiveCfg = Debug|Win32 + {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Debug|x86.Build.0 = Debug|Win32 + {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Release|x64.ActiveCfg = Release|x64 + {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Release|x64.Build.0 = Release|x64 + {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Release|x86.ActiveCfg = Release|Win32 + {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.vcxproj b/protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.vcxproj new file mode 100644 index 0000000000..f6b557def8 --- /dev/null +++ b/protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.vcxproj @@ -0,0 +1,198 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\portable_endian.h" />
+ <ClInclude Include="..\..\tl-parser-tree.h" />
+ <ClInclude Include="..\..\tl-parser.h" />
+ <ClInclude Include="..\..\tl-tl.h" />
+ <ClInclude Include="config.h" />
+ <ClInclude Include="wingetopt.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\tl-parser.c" />
+ <ClCompile Include="..\..\tlc.c" />
+ <ClCompile Include="wingetopt.c" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{14022761-9F27-4A2D-B7EA-F41FB9B3274C}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>tlparser</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140_xp</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LinkIncremental>true</LinkIncremental>
+ <OutDir>build\$(Configuration)\</OutDir>
+ <IntDir>build\$(Configuration)\build\</IntDir>
+ <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(IntDir);$(ProjectDir);</IncludePath>
+ <ExtensionsToDeleteOnClean>*.h;$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LinkIncremental>true</LinkIncremental>
+ <OutDir>build\$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>build\$(Platform)\$(Configuration)\build\</IntDir>
+ <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(IntDir);$(ProjectDir);</IncludePath>
+ <ExtensionsToDeleteOnClean>*.h;$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>build\$(Configuration)\</OutDir>
+ <IntDir>build\$(Configuration)\build\</IntDir>
+ <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(IntDir);$(ProjectDir);</IncludePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>build\$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>build\$(Platform)\$(Configuration)\build\</IntDir>
+ <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(IntDir);$(ProjectDir);</IncludePath>
+ <ExtensionsToDeleteOnClean>*.h;$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>
+ </AdditionalIncludeDirectories>
+ <DisableLanguageExtensions>false</DisableLanguageExtensions>
+ <CompileAs>CompileAsC</CompileAs>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalLibraryDirectories>
+ </AdditionalLibraryDirectories>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PreBuildEvent>
+ <Command>config.bat -o $(IntDir)</Command>
+ <Message>
+ </Message>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ <PreBuildEvent>
+ <Command>config.bat -o $(IntDir)</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Full</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;_CONSOLE;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalLibraryDirectories>..\..\..\zlib\contrib\vstudio\vc11\x86\ZlibStatReleaseWithoutAsm\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>zlibstat.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PreBuildEvent>
+ <Command>config.bat -o $(IntDir)</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>
+ </AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ <PreBuildEvent>
+ <Command>config.bat -o $(IntDir)</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.vcxproj.filters b/protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.vcxproj.filters new file mode 100644 index 0000000000..2ba314f975 --- /dev/null +++ b/protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\portable_endian.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tl-parser.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tl-parser-tree.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tl-tl.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="config.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="wingetopt.h"> + <Filter>Header Files</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\tlc.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tl-parser.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="wingetopt.c"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/protocols/Telegram/tgl/tl-parser/contrib/vs/wingetopt.c b/protocols/Telegram/tgl/tl-parser/contrib/vs/wingetopt.c new file mode 100644 index 0000000000..09dac17a4f --- /dev/null +++ b/protocols/Telegram/tgl/tl-parser/contrib/vs/wingetopt.c @@ -0,0 +1,82 @@ +/* +POSIX getopt for Windows + +AT&T Public License + +Code given out at the 1985 UNIFORUM conference in Dallas. +*/ + +#ifndef __GNUC__ + +#include "wingetopt.h" +#include <stdio.h> +#include <string.h> + +#ifndef NULL +#define NULL 0 +#endif +#define EOF (-1) +#define ERR(s, c) if(opterr){\ + char errbuf[2];\ + errbuf[0] = c; errbuf[1] = '\n';\ + fputs(argv[0], stderr);\ + fputs(s, stderr);\ + fputc(c, stderr);} +//(void) write(2, argv[0], (unsigned)strlen(argv[0]));\ + //(void) write(2, s, (unsigned)strlen(s));\ + //(void) write(2, errbuf, 2);} + +int opterr = 1; +int optind = 1; +int optopt; +char *optarg; + +int +getopt(argc, argv, opts) +int argc; +char **argv, *opts; +{ + static int sp = 1; + register int c; + register char *cp; + + if (sp == 1) + if (optind >= argc || + argv[optind][0] != '-' || argv[optind][1] == '\0') + return(EOF); + else if (strcmp(argv[optind], "--") == (int)NULL) { + optind++; + return(EOF); + } + optopt = c = argv[optind][sp]; + if (c == ':' || (cp = strchr(opts, c)) == NULL) { + ERR(": illegal option -- ", c); + if (argv[optind][++sp] == '\0') { + optind++; + sp = 1; + } + return('?'); + } + if (*++cp == ':') { + if (argv[optind][sp + 1] != '\0') + optarg = &argv[optind++][sp + 1]; + else if (++optind >= argc) { + ERR(": option requires an argument -- ", c); + sp = 1; + return('?'); + } + else + optarg = argv[optind++]; + sp = 1; + } + else { + if (argv[optind][++sp] == '\0') { + sp = 1; + optind++; + } + optarg = NULL; + } + return(c); +} + +#endif /* __GNUC__ */
\ No newline at end of file diff --git a/protocols/Telegram/tgl/tl-parser/contrib/vs/wingetopt.h b/protocols/Telegram/tgl/tl-parser/contrib/vs/wingetopt.h new file mode 100644 index 0000000000..4372c66011 --- /dev/null +++ b/protocols/Telegram/tgl/tl-parser/contrib/vs/wingetopt.h @@ -0,0 +1,32 @@ +/* +POSIX getopt for Windows + +AT&T Public License + +Code given out at the 1985 UNIFORUM conference in Dallas. +*/ + +#ifdef __GNUC__ +#include <getopt.h> +#endif +#ifndef __GNUC__ + +#ifndef _WINGETOPT_H_ +#define _WINGETOPT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + extern int opterr; + extern int optind; + extern int optopt; + extern char *optarg; + extern int getopt(int argc, char **argv, char *opts); + +#ifdef __cplusplus +} +#endif + +#endif /* _GETOPT_H_ */ +#endif /* __GNUC__ */
\ No newline at end of file |
