summary refs log blame commit diff stats
path: root/src/common/common.vcxproj
blob: 1d1fc570624b12846e57f3a863b45b048e5df944 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
                                          
                                                                                                                 
                                        
                                            
                                                         
                   




                                                   



                                                 

               





                                       


                                      
                                                   
                                    


                                       
                                            





                                           
                                              
                                   

                                                      
                                   
                                      


                                       


                                             






                                       
                                            

                                      
                                                   
                                    








                                           
                                                    
                                   



                                       
                                      
               
              
                                               
                                                  
               





                                                                      
                                                            



                                                                                                                                                                                  
                   

                                                                                    
                                                                                                                  
                                                                                                                                                    
                 
                         

                                                                                  
                                                                                                                                 
                                                                                                                                                    
                                                                                         
                 
                         
                                                              

                        
                         
                                  



                                                                                                                                   

                    

                         
           
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup Label="Configuration">
    <PlatformToolset>v140</PlatformToolset>
    <ConfigurationType>StaticLibrary</ConfigurationType>
  </PropertyGroup>
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|x64">
      <Configuration>Release</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="cfgfiles.h" />
    <ClInclude Include="chanopt.h" />
    <ClInclude Include="ctcp.h" />
    <ClInclude Include="dcc.h" />
    <ClInclude Include="fe.h" />
    <ClInclude Include="history.h" />
    <ClInclude Include="ignore.h" />
    <ClInclude Include="inbound.h" />
    <ClInclude Include="inet.h" />
    <ClInclude Include="$(HexChatLib)marshal.h" />
    <ClInclude Include="modes.h" />
    <ClInclude Include="network.h" />
    <ClInclude Include="notify.h" />
    <ClInclude Include="outbound.h" />
    <ClInclude Include="plugin-identd.h" />
    <ClInclude Include="plugin-timer.h" />
    <ClInclude Include="plugin.h" />
    <ClInclude Include="proto-irc.h" />
    <ClInclude Include="server.h" />
    <ClInclude Include="servlist.h" />
    <ClInclude Include="ssl.h" />
    <ClInclude Include="sysinfo\sysinfo.h" />
    <ClInclude Include="text.h" />
    <ClInclude Include="$(HexChatLib)textenums.h" />
    <ClInclude Include="$(HexChatLib)textevents.h" />
    <ClInclude Include="tree.h" />
    <ClInclude Include="typedef.h" />
    <ClInclude Include="url.h" />
    <ClInclude Include="userlist.h" />
    <ClInclude Include="util.h" />
    <ClInclude Include="hexchat-plugin.h" />
    <ClInclude Include="hexchat.h" />
    <ClInclude Include="hexchatc.h" />
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="cfgfiles.c" />
    <ClCompile Include="chanopt.c" />
    <ClCompile Include="ctcp.c" />
    <ClCompile Include="dcc.c" />
    <ClCompile Include="history.c" />
    <ClCompile Include="plugin-identd.c" />
    <ClCompile Include="ignore.c" />
    <ClCompile Include="inbound.c" />
    <ClCompile Include="$(HexChatLib)marshal.c" />
    <ClCompile Include="modes.c" />
    <ClCompile Include="network.c" />
    <ClCompile Include="notify.c" />
    <ClCompile Include="outbound.c" />
    <ClCompile Include="plugin-timer.c" />
    <ClCompile Include="plugin.c" />
    <ClCompile Include="proto-irc.c" />
    <ClCompile Include="server.c" />
    <ClCompile Include="servlist.c" />
    <ClCompile Include="ssl.c" />
    <ClCompile Include="sysinfo\win32\backend.c" />
    <ClCompile Include="text.c" />
    <ClCompile Include="tree.c" />
    <ClCompile Include="url.c" />
    <ClCompile Include="userlist.c" />
    <ClCompile Include="util.c" />
    <ClCompile Include="hexchat.c" />
  </ItemGroup>
  <ItemGroup>
    <None Include="..\..\win32\config.h.tt" />
    <ClInclude Include="$(HexChatLib)config.h" />
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <ProjectGuid>{87554B59-006C-4D94-9714-897B27067BA3}</ProjectGuid>
    <Keyword>Win32Proj</Keyword>
    <RootNamespace>common</RootNamespace>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  <Import Project="..\..\win32\hexchat.props" />
  <PropertyGroup>
    <OutDir>$(HexChatLib)</OutDir>
  </PropertyGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <ClCompile>
      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <AdditionalIncludeDirectories>$(HexChatLib);$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    </ClCompile>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <ClCompile>
      <PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <AdditionalIncludeDirectories>$(HexChatLib);$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <DisableSpecificWarnings>4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
    </ClCompile>
  </ItemDefinitionGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  <ItemDefinitionGroup>
    <PreBuildEvent>
      <Command><![CDATA[
SET SOLUTIONDIR=$(SolutionDir)..\
"$(HexChatLib)make-te.exe" < "$(ProjectDir)textevents.in" > "$(HexChatLib)textevents.h" 2> "$(HexChatLib)textenums.h"
powershell -File "$(SolutionDir)..\win32\version-template.ps1" "$(SolutionDir)..\win32\config.h.tt" "$(HexChatLib)config.h"
"$(DepsRoot)\bin\glib-genmarshal.exe" --prefix=_hexchat_marshal --header "$(ProjectDir)marshalers.list" > "$(HexChatLib)marshal.h"
"$(DepsRoot)\bin\glib-genmarshal.exe" --prefix=_hexchat_marshal --body "$(ProjectDir)marshalers.list" > "$(HexChatLib)marshal.c"

      ]]></Command>
    </PreBuildEvent>
  </ItemDefinitionGroup>
</Project>
ass="p">; time_t start; double timeElapsed; HANDLE readPipe; HANDLE writePipe; STARTUPINFO sInfo; PROCESS_INFORMATION pInfo; SECURITY_ATTRIBUTES secattr; ZeroMemory (&secattr, sizeof (secattr)); secattr.nLength = sizeof (secattr); secattr.bInheritHandle = TRUE; timeElapsed = 0.0; if (strlen (word[2]) > 0) { strcpy (commandLine, "cmd.exe /c "); if (!stricmp("-O", word[2])) { /*strcat (commandLine, word_eol[3]);*/ hexchat_printf (ph, "Printing Exec output to others is not supported yet.\n"); return HEXCHAT_EAT_HEXCHAT; } else { strcat (commandLine, word_eol[2]); } CreatePipe (&readPipe, &writePipe, &secattr, 0); /* might be replaced with MyCreatePipeEx */ ZeroMemory (&sInfo, sizeof (sInfo)); ZeroMemory (&pInfo, sizeof (pInfo)); sInfo.cb = sizeof (sInfo); sInfo.dwFlags = STARTF_USESTDHANDLES; sInfo.hStdInput = NULL; sInfo.hStdOutput = writePipe; sInfo.hStdError = writePipe; CreateProcess (0, commandLine, 0, 0, TRUE, NORMAL_PRIORITY_CLASS | CREATE_NO_WINDOW, 0, 0, &sInfo, &pInfo); CloseHandle (writePipe); start = time (0); while (PeekNamedPipe (readPipe, buffer, 1, &dwRead, &dwAvail, &dwLeft) && timeElapsed < 10) { if (dwRead) { if (ReadFile (readPipe, buffer, sizeof (buffer) - 1, &dwRead, NULL) && dwRead != 0 ) { /* avoid garbage */ buffer[dwRead] = '\0'; hexchat_printf (ph, "%s", buffer); } } else { /* this way we'll more likely get full lines */ SleepEx (100, TRUE); } timeElapsed = difftime (time (0), start); } } /* display a newline to separate things */ hexchat_printf (ph, "\n"); if (timeElapsed >= 10) { hexchat_printf (ph, "Command took too much time to run, execution aborted.\n"); } CloseHandle (readPipe); CloseHandle (pInfo.hProcess); CloseHandle (pInfo.hThread); return HEXCHAT_EAT_HEXCHAT; } int hexchat_plugin_init (hexchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg) { ph = plugin_handle; *plugin_name = name; *plugin_desc = desc; *plugin_version = version; hexchat_hook_command (ph, "EXEC", HEXCHAT_PRI_NORM, run_command, "Usage: /EXEC [-O] - execute commands inside HexChat", 0); hexchat_printf (ph, "%s plugin loaded\n", name); return 1; /* return 1 for success */ } int hexchat_plugin_deinit (void) { hexchat_printf (ph, "%s plugin unloaded\n", name); return 1; }