/* X-Chat 2.0 PERL Plugin * Copyright (C) 1998-2002 Peter Zelezny. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #ifdef ENABLE_NLS #include #endif #ifdef WIN32 #include #else #include #endif #undef PACKAGE #ifdef WIN32 #include "../../config-win32.h" /* for #define OLD_PERL */ #else #include "../../config.h" #endif #include "hexchat-plugin.h" static hexchat_plugin *ph; /* plugin handle */ static int perl_load_file (char *script_name); #ifdef WIN32 /* STRINGIFY is from perl's CORE/config.h */ #ifndef PERL_REQUIRED_VERSION #define PERL_REQUIRED_VERSION STRINGIFY(PERL_REVISION) "." STRINGIFY(PERL_VERSION) #endif #ifndef PERL_DLL #define PERL_DLL "perl" STRINGIFY(PERL_REVISION) STRINGIFY(PERL_VERSION) ".dll" #endif static DWORD child (char *str) { MessageBoxA (0, str, "Perl DLL Error", MB_OK | MB_ICONHAND | MB_SETFOREGROUND | MB_TASKMODAL); return 0; } static void thread_mbox (char *str) { DWORD tid; CloseHandle (CreateThread (NULL, 0, (LPTHREAD_START_ROUTINE) child, str, 0, &tid)); } #endif /* leave this before XSUB.h, to avoid readdir() being redefined */ #ifdef WIN32 static void perl_auto_load_from_path (const char *path) { WIN32_FIND_DATA find_data; HANDLE find_handle; char *search_path; int path_len = strlen (path); /* +6 for \*.pl and \0 */ search_path = malloc(path_len + 6); sprintf (search_path, "%s\\*.pl", path); find_handle = FindFirstFile (search_path, &find_data); if (find_handle != INVALID_HANDLE_VALUE) { do { if (!(find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ||find_data.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)) { char *full_path = malloc (path_len + strlen (find_data.cFileName) + 2); sprintf (full_path, "%s\\%s", path, find_data.cFileName); perl_load_file (full_path); free (full_path); } } while (FindNextFile (find_handle, &find_data) != 0); FindClose (find_handle); } free (search_path); } #else static void perl_auto_load_from_path (const char *path) { DIR *dir; struct dirent *ent; dir = opendir (path); if (dir) { while ((ent = readdir (dir))) { int len = strlen (ent->d_name); if (len > 3 && strcasecmp (".pl", ent->d_name + len - 3) == 0) { char *file = malloc (len + strlen (path) + 2); sprintf (file, "%s/%s", path, ent->d_name); perl_load_file (file); free (file); } } closedir (dir); } } #endif static int perl_auto_load (void *unused) { const char *xdir; char *sub_dir; #ifdef WIN32 int copied = 0; char *slash = NULL; #endif /* get the dir in local filesystem encoding (what opendir() expects!) */ xdir = hexchat_get_info (ph, "configdir"); /* don't pollute the filesystem with script files, this only causes misuse of the folders * only use ~/.config/hexchat/addons/ and %APPDATA%\HexChat\addons */ #if 0 /* autoload from ~/.config/hexchat/ or %APPDATA%\HexChat\ on win32 */ perl_auto_load_from_path (xdir); #endif sub_dir = malloc (strlen (xdir) + 8); strcpy (sub_dir, xdir); strcat (sub_dir, "/addons"); perl_auto_load_from_path (sub_dir); free (sub_dir); #if 0 #ifdef WIN32 /* autoload from C:\Program Files\HexChat\plugins\ */ sub_dir = malloc (1025 + 9); copied = GetModuleFileName( 0, sub_dir, 1024 ); sub_dir[copied] = '\0'; slash = strrchr( sub_dir, '\\' ); if( slash != NULL ) { *slash = '\0'; } perl_auto_load_from_path ( strncat (sub_dir, "\\plugins", 9)); free (sub_dir); #endif #endif return 0; } #include #define WIN32IOP_H #include #include typedef struct { SV *callback; SV *userdata; hexchat_hook *hook; /* required for timers */ hexchat_context *ctx; /* allow timers to remember their context */ SV *package; /* need to track the package name when removing hooks by returning REMOVE */ unsigned int depth; } HookData; static PerlInterpreter *my_perl = NULL; extern void boot_DynaLoader (pTHX_ CV * cv); /* this is used for autoload and shutdown callbacks */ static int execute_perl (SV * function, char *args) { int count, ret_value = 1; dSP; ENTER; SAVETMPS; PUSHMARK (SP); XPUSHs (sv_2mortal (newSVpv (args, 0))); PUTBACK; count = call_sv (function, G_EVAL | G_SCALAR); SPAGAIN; if (SvTRUE (ERRSV)) { hexchat_printf(ph, "Perl error: %s\n", SvPV_nolen (ERRSV)); if (!SvOK (POPs)) {} /* remove undef from the top of the stack */ } else if (count != 1) { hexchat_printf (ph, "Perl error: expected 1 value from %s, " "got: %d\n", SvPV_nolen (function), count); } else { ret_value = POPi; } PUTBACK; FREETMPS; LEAVE; return ret_value; } static char * get_filename (char *word[], char *word_eol[]) { int len; char *file; len = strlen (word[2]); /* if called as /load "filename.pl" the only difference between word and * word_eol will be the two quotes */ if (strchr (word[2], ' ') != NULL || (strlen (word_eol[2]) - strlen(word[2])) == 2 ) { file = word[2]; } else { file = word_eol[2]; } len = strlen (file); if (len > 3 && strncasecmp (".pl", file + len - 3, 3) == 0) { return file; } return NULL; } static SV * list_item_to_sv ( hexchat_list *list, const char *const *fields ) { HV *hash = newHV(); SV *field_value; const char *field; int field_index = 0; const char *field_name; int name_len; while (fields[field_index] != NULL) { field_name = fields[field_index] + 1; name_len = strlen (field_name); switch (fields[field_index][0]) { case 's': field = hexchat_list_str (ph, list, field_name); if (field != NULL) { field_value = newSVpvn (field, strlen (field)); } else { field_value = &PL_sv_undef; } break; case 'p': field_value = newSViv (PTR2IV (hexchat_list_str (ph, list, field_name))); break; case 'i': field_value = newSVuv (hexchat_list_int (ph, list, field_name)); break; case 't': field_value = newSVnv (hexchat_list_time (ph, list, field_name)); break; default: field_value = &PL_sv_undef; } (void)hv_store (hash, field_name, name_len, field_value, 0); field_index++; } return sv_2mortal (newRV_noinc ((SV *) hash)); } static AV * array2av (char *array[]) { int count = 0; SV *temp = NULL; AV *av = newAV(); sv_2mortal ((SV *)av); for ( count = 1; count < 32 && array[count] != NULL && array[count][0] != 0; count++ ) { temp = newSVpv (array[count], 0); SvUTF8_on (temp); av_push (av, temp); } return av; } /* sets $Xchat::Embed::current_package */ static void set_current_package (SV *package) { SV *current_package = get_sv ("Xchat::Embed::current_package", 1); SvSetSV_nosteal (current_package, package); } static int fd_cb (int fd, int flags, void *userdata) { HookData *data = (HookData *) userdata; int retVal = 0; int count = 0; dSP; ENTER; SAVETMPS; PUSHMARK (SP); XPUSHs (data->userdata); PUTBACK; set_current_package (data->package); count = call_sv (data->callback, G_EVAL); set_current_package (&PL_sv_undef); SPAGAIN; if (SvTRUE (ERRSV)) { hexchat_printf (ph, "Error in fd callback %s", SvPV_nolen (ERRSV)); if (!SvOK (POPs)) {} /* remove undef from the top of the stack */ retVal = HEXCHAT_EAT_ALL; } else { if (count != 1) { hexchat_print (ph, "Fd handler should only return 1 value."); retVal = HEXCHAT_EAT_NONE; } else { retVal = POPi; if (retVal == 0) { /* if 0 is returned, the fd is going to get unhooked */ PUSHMARK (SP); XPUSHs (sv_2mortal (newSViv (PTR2IV (data->hook)))); PUTBACK; call_pv ("Xchat::unhook", G_EVAL); SPAGAIN; SvREFCNT_dec (data->callback); if (data->userdata) { SvREFCNT_dec (data->userdata); } free (data); } } } PUTBACK; FREETMPS; LEAVE; return retVal; } static int timer_cb (void *userdata) { HookData *data = (HookData *) userdata; int retVal = 0; int count = 0; dSP; ENTER; SAVETMPS; PUSHMARK (SP); XPUSHs (data->userdata); PUTBACK; if (data->ctx) { hexchat_set_context (ph, data->ctx); } set_current_package (data->package); count = call_sv (data->callback, G_EVAL); set_current_package (&PL_sv_undef); SPAGAIN; if (SvTRUE (ERRSV)) { hexchat_printf (ph, "Error in timer callback %s", SvPV_nolen (ERRSV)); if (!SvOK (POPs)) {} /* remove undef from the top of the stack */ retVal = HEXCHAT_EAT_ALL; } else { if (count != 1) { hexchat_print (ph, "Timer handler should only return 1 value."); retVal = HEXCHAT_EAT_NONE; } else { retVal = POPi; if (retVal == 0) { /* if 0 is return the timer is going to get unhooked */ PUSHMARK (SP); XPUSHs (sv_2mortal (newSViv (PTR2IV (data->hook)))); XPUSHs (sv_mortalcopy (data->package)); PUTBACK; call_pv ("Xchat::unhook", G_EVAL); SPAGAIN; } } } PUTBACK; FREETMPS; LEAVE; return retVal; } static int server_cb (char *word[], char *word_eol[], void *userdata) { HookData *data = (HookData *) userdata; int retVal = 0; int count = 0; dSP; ENTER; SAVETMPS; if (data->depth) return HEXCHAT_EAT_NONE; /* hexchat_printf (ph, */ /* "Recieved %d words in server callback", av_len (wd)); */ PUSHMARK (SP); XPUSHs (newRV_noinc ((SV *) array2av (word))); XPUSHs (newRV_noinc ((SV *) array2av (word_eol))); XPUSHs (data->userdata); PUTBACK; data->depth++; set_current_package (data->package); count = call_sv (data->callback, G_EVAL); set_current_package (&PL_sv_undef); data->depth--; SPAGAIN; if (SvTRUE (ERRSV)) { hexchat_printf (ph, "Error in server callback %s", SvPV_nolen (ERRSV)); if (!SvOK (POPs)) {} /* remove undef from the top of the stack */ retVal = HEXCHAT_EAT_NONE; } else { if (count != 1) { hexchat_print (ph, "Server handler should only return 1 value."); retVal = HEXCHAT_EAT_NONE; } else { retVal = POPi; } } PUTBACK; FREETMPS; LEAVE; return retVal; } static int command_cb (char *word[], char *word_eol[], void *userdata) { HookData *data = (HookData *) userdata; int retVal = 0; int count = 0; dSP; ENTER; SAVETMPS; if (data->depth) return HEXCHAT_EAT_NONE; /* hexchat_printf (ph, "Recieved %d words in command callback", */ /* av_len (wd)); */ PUSHMARK (SP); XPUSHs (newRV_noinc ((SV *) array2av (word))); XPUSHs (newRV_noinc ((SV *) array2av (word_eol))); XPUSHs (data->userdata); PUTBACK; data->depth++; set_current_package (data->package); count = call_sv (data->callback, G_EVAL); set_current_package (&PL_sv_undef); data->depth--; SPAGAIN; if (SvTRUE (ERRSV)) { hexchat_printf (ph, "Error in command callback %s", SvPV_nolen (ERRSV)); if (!SvOK (POPs)) {} /* remove undef from the top of the stack */ retVal = HEXCHAT_EAT_HEXCHAT; } else { if (count != 1) { hexchat_print (ph, "Command handler should only return 1 value."); retVal = HEXCHAT_EAT_NONE; } else { retVal = POPi; } } PUTBACK; FREETMPS; LEAVE; return retVal; } static int print_cb (char *word[], void *userdata) { HookData *data = (HookData *) userdata; SV *temp = NULL; int retVal = 0; int count = 1; int last_index = 31; /* must be initialized after SAVETMPS */ AV *wd = NULL; dSP; ENTER; SAVETMPS; if (data->depth) return HEXCHAT_EAT_NONE; wd = newAV (); sv_2mortal ((SV *) wd); /* need to scan backwards to find the index of the last element since some events such as "DCC Timeout" can have NULL elements in between non NULL elements */ while (last_index >= 0 && (word[last_index] == NULL || word[last_index][0] == 0)) { last_index--; } for (count = 1; count <= last_index; count++) { if (word[count] == NULL) { av_push (wd, &PL_sv_undef); } else if (word[count][0] == 0) { av_push (wd, newSVpvn ("",0)); } else { temp = newSVpv (word[count], 0); SvUTF8_on (temp); av_push (wd, temp); } } /*hexchat_printf (ph, "Recieved %d words in print callback", av_len (wd)+1); */ PUSHMARK (SP); XPUSHs (newRV_noinc ((SV *) wd)); XPUSHs (data->userdata); PUTBACK; data->depth++; set_current_package (data->package); count = call_sv (data->callback, G_EVAL); set_current_package (&PL_sv_undef); data->depth--; SPAGAIN; if (SvTRUE (ERRSV)) { hexchat_printf (ph, "Error in print callback %s", SvPV_nolen (ERRSV)); if (!SvOK (POPs)) {} /* remove undef from the top of the stack */ retVal = HEXCHAT_EAT_NONE; } else { if (count != 1) { hexchat_print (ph, "Print handler should only return 1 value."); retVal = HEXCHAT_EAT_NONE; } else { retVal = POPi; } } PUTBACK; FREETMPS; LEAVE; return retVal; } /* custom IRC perl functions for scripting */ /* Xchat::Internal::register (scriptname, version, desc, shutdowncallback, filename) * */ static XS (XS_Xchat_register) { char *name, *version, *desc, *filename; void *gui_entry; dXSARGS; if (items != 4) { hexchat_printf (ph, "Usage: Xchat::Internal::register(scriptname, version, desc, filename)"); } else { name = SvPV_nolen (ST (0)); version = SvPV_nolen (ST (1)); desc = SvPV_nolen (ST (2)); filename = SvPV_nolen (ST (3)); gui_entry = hexchat_plugingui_add (ph, fi
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.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="Debug|x64">
      <Configuration>Debug</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|x64">
      <Configuration>Release</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Template|Win32">
      <Configuration>Template</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Template|x64">
      <Configuration>Template</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <SccProjectName />
    <SccLocalPath />
    <ProjectGuid>{D1B1EA84-A917-44E2-8CEE-170C5A4B3B15}</ProjectGuid>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <UseOfMfc>false</UseOfMfc>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <UseOfMfc>false</UseOfMfc>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <UseOfMfc>false</UseOfMfc>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <UseOfMfc>false</UseOfMfc>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <ImportGroup Label="ExtensionSettings">
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <OutDir>.\..\win32\bin\Debug\</OutDir>
    <IntDir>.\..\win32\tmp\Debug\</IntDir>
    <LinkIncremental>true</LinkIncremental>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <LinkIncremental>true</LinkIncremental>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <OutDir>.\..\win32\bin\Release\</OutDir>
    <IntDir>.\..\win32\tmp\Release\</IntDir>
    <LinkIncremental>false</LinkIncremental>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <LinkIncremental>false</LinkIncremental>
  </PropertyGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <ClCompile>
      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
      <FunctionLevelLinking>false</FunctionLevelLinking>
      <Optimization>Disabled</Optimization>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <WarningLevel>Level3</WarningLevel>
      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
      <PreprocessorDefinitions>_DEBUG;COMPILED_FROM_DSP;WIN32;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <AssemblerListingLocation>.\..\win32\tmp\Debug\</AssemblerListingLocation>
      <BrowseInformation>true</BrowseInformation>
      <PrecompiledHeaderOutputFile>.\..\win32\tmp\Debug\expat.pch</PrecompiledHeaderOutputFile>
      <ObjectFileName>.\..\win32\tmp\Debug\</ObjectFileName>
      <ProgramDataBaseFileName>.\..\win32\tmp\Debug\</ProgramDataBaseFileName>
      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
    </ClCompile>
    <Midl>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <TypeLibraryName>.\..\win32\bin\Debug\expat.tlb</TypeLibraryName>
      <MkTypLibCompatible>true</MkTypLibCompatible>
      <TargetEnvironment>Win32</TargetEnvironment>
    </Midl>
    <ResourceCompile>
      <Culture>0x0409</Culture>
      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ResourceCompile>
    <Bscmake>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <OutputFile>.\..\win32\bin\Debug\expat.bsc</OutputFile>
    </Bscmake>
    <Link>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <LinkDLL>true</LinkDLL>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <SubSystem>Console</SubSystem>
      <OutputFile>..\win32\bin\Debug\libexpat.dll</OutputFile>
      <ImportLibrary>.\..\win32\bin\Debug\libexpat.lib</ImportLibrary>
      <ModuleDefinitionFile>.\libexpat.def</ModuleDefinitionFile>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <ClCompile>
      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
      <FunctionLevelLinking>false</FunctionLevelLinking>
      <Optimization>Disabled</Optimization>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <WarningLevel>Level3</WarningLevel>
      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
      <PreprocessorDefinitions>_DEBUG;COMPILED_FROM_DSP;WIN32;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <AssemblerListingLocation>.\..\win32\tmp\Debug\</AssemblerListingLocation>
      <BrowseInformation>true</BrowseInformation>
      <PrecompiledHeaderOutputFile>.\..\win32\tmp\Debug\expat.pch</PrecompiledHeaderOutputFile>
      <ObjectFileName>.\..\win32\tmp\Debug\</ObjectFileName>
      <ProgramDataBaseFileName>.\..\win32\tmp\Debug\</ProgramDataBaseFileName>
      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
    </ClCompile>
    <Midl>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <TypeLibraryName>.\..\win32\bin\Debug\expat.tlb</TypeLibraryName>
      <MkTypLibCompatible>true</MkTypLibCompatible>
    </Midl>
    <ResourceCompile>
      <Culture>0x0409</Culture>
      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ResourceCompile>
    <Bscmake>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <OutputFile>.\..\win32\bin\Debug\expat.bsc</OutputFile>
    </Bscmake>
    <Link>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <LinkDLL>true</LinkDLL>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <SubSystem>Console</SubSystem>
      <OutputFile>..\win32\bin\Debug\libexpat.dll</OutputFile>
      <ImportLibrary>.\..\win32\bin\Debug\libexpat.lib</ImportLibrary>
      <ModuleDefinitionFile>.\libexpat.def</ModuleDefinitionFile>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <ClCompile>
      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
      <StringPooling>true</StringPooling>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <Optimization>MaxSpeed</Optimization>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <WarningLevel>Level3</WarningLevel>
      <PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;_USRDLL;COMPILED_FROM_DSP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <AssemblerListingLocation>.\..\win32\tmp\Release\</AssemblerListingLocation>
      <PrecompiledHeaderOutputFile>.\..\win32\tmp\Release\expat.pch</PrecompiledHeaderOutputFile>
      <PrecompiledHeader />
      <ObjectFileName>.\..\win32\tmp\Release\</ObjectFileName>
      <ProgramDataBaseFileName>.\..\win32\tmp\Release\</ProgramDataBaseFileName>
    </ClCompile>
    <Midl>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <TypeLibraryName>.\..\win32\bin\Release\expat.tlb</TypeLibraryName>
      <MkTypLibCompatible>true</MkTypLibCompatible>
      <TargetEnvironment>Win32</TargetEnvironment>
    </Midl>
    <ResourceCompile>
      <Culture>0x0409</Culture>
      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ResourceCompile>
    <Bscmake>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <OutputFile>.\..\win32\bin\Release\expat.bsc</OutputFile>
    </Bscmake>
    <Link>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <LinkDLL>true</LinkDLL>
      <SubSystem>Console</SubSystem>
      <OutputFile>..\win32\bin\Release\libexpat.dll</OutputFile>
      <ImportLibrary>.\..\win32\bin\Release\libexpat.lib</ImportLibrary>
      <ModuleDefinitionFile>.\libexpat.def</ModuleDefinitionFile>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <ClCompile>
      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
      <StringPooling>true</StringPooling>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <Optimization>MaxSpeed</Optimization>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <WarningLevel>Level3</WarningLevel>
      <PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;_USRDLL;COMPILED_FROM_DSP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <AssemblerListingLocation>.\..\win32\tmp\Release\</AssemblerListingLocation>
      <PrecompiledHeaderOutputFile>.\..\win32\tmp\Release\expat.pch</PrecompiledHeaderOutputFile>
      <PrecompiledHeader>
      </PrecompiledHeader>
      <ObjectFileName>.\..\win32\tmp\Release\</ObjectFileName>
      <ProgramDataBaseFileName>.\..\win32\tmp\Release\</ProgramDataBaseFileName>
    </ClCompile>
    <Midl>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <TypeLibraryName>.\..\win32\bin\Release\expat.tlb</TypeLibraryName>
      <MkTypLibCompatible>true</MkTypLibCompatible>
    </Midl>
    <ResourceCompile>
      <Culture>0x0409</Culture>
      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ResourceCompile>
    <Bscmake>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <OutputFile>.\..\win32\bin\Relea