Skip to content

Commit

Permalink
Update diz_c0 for Far 3.0 build 4245
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximus5 committed Apr 2, 2015
1 parent f80c33d commit e29d560
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 20 deletions.
24 changes: 13 additions & 11 deletions Col0/diz_c0/diz.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,27 @@
<_ProjectFileVersion>12.0.30501.0</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_C0|Win32'">
<OutDir>C:\Temp\CE\$(ProjectName).$(Platform).$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)\$(Platform).$(Configuration)\</OutDir>
<IntDir>C:\Temp\CE\$(ProjectName).$(Platform).$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
<EmbedManifest>false</EmbedManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_C0|x64'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)\$(Platform).$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_C0|Win32'">
<OutDir>C:\Temp\CE\$(ProjectName).$(Platform).$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)\$(Platform).$(Configuration)\</OutDir>
<IntDir>C:\Temp\CE\$(ProjectName).$(Platform).$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
<TargetName>diz_c0</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_C0|x64'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)\$(Platform).$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
<TargetName>diz_c0_x64</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_C0|Win32'">
<ClCompile>
Expand Down Expand Up @@ -114,7 +116,7 @@
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN64;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>FAR_UNICODE=4040;WIN64;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
Expand All @@ -125,7 +127,7 @@
<Link>
<AdditionalDependencies>version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>\\WIN7X64\FAR\FAR2x64\Plugins\ConEmu\Thumbs\diz.t64</OutputFile>
<ModuleDefinitionFile>diz.def</ModuleDefinitionFile>
<ModuleDefinitionFile>diz_c0.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX64</TargetMachine>
Expand All @@ -136,7 +138,7 @@
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;verc0_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>FAR_UNICODE=4040;WIN32;NDEBUG;_WINDOWS;_USRDLL;verc0_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>true</BufferSecurityCheck>
Expand All @@ -147,7 +149,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>diz_c0.dll</OutputFile>
<OutputFile>$(OutputPath)$(TargetFileName)</OutputFile>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<ModuleDefinitionFile>diz_c0.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
Expand All @@ -167,7 +169,7 @@
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;diz_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>FAR_UNICODE=4040;WIN32;NDEBUG;_WINDOWS;_USRDLL;diz_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader />
Expand All @@ -176,9 +178,9 @@
</ClCompile>
<Link>
<AdditionalDependencies>version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>..\..\plugins\ConEmu\Thumbs\diz.t64</OutputFile>
<OutputFile>$(OutputPath)$(TargetFileName)</OutputFile>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<ModuleDefinitionFile>diz.def</ModuleDefinitionFile>
<ModuleDefinitionFile>diz_c0.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
Expand Down
46 changes: 41 additions & 5 deletions Col0/diz_c0/diz_c0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,35 @@ void WINAPI GetPluginInfoW(struct PluginInfo *Info)
Info->Flags = PF_PRELOAD;
}

int WINAPI GetCustomDataW(const wchar_t *FilePath, wchar_t **CustomData)
intptr_t WINAPI GetContentFieldsW(const struct GetContentFieldsInfo *Info)
{
*CustomData = NULL;
for (size_t i = 0; i < Info->Count; i++)
{
if (!fsf.LStricmp(Info->Names[i], L"diz")
|| !fsf.LStricmp(Info->Names[i], L"C0"))
return 1;
}
return 0;
}

intptr_t WINAPI GetContentDataW(struct GetContentDataInfo *Info)
{
if (!Info)
return FALSE;
LPCWSTR FilePath = Info->FilePath;
wchar_t** CustomData = NULL;

for (size_t i = 0; i < Info->Count; i++)
{
if (!fsf.LStricmp(Info->Names[i], L"diz")
|| !fsf.LStricmp(Info->Names[i], L"C0"))
{
CustomData = (wchar_t**)(Info->Values + i);
}
}

if (!FilePath || !CustomData)
return FALSE;

const wchar_t* pszSlash = wcsrchr(FilePath, L'\\');
if (!pszSlash || pszSlash <= FilePath) return FALSE;
Expand Down Expand Up @@ -166,8 +192,18 @@ int WINAPI GetCustomDataW(const wchar_t *FilePath, wchar_t **CustomData)
return TRUE;
}

void WINAPI FreeCustomDataW(wchar_t *CustomData)
void WINAPI FreeContentDataW(const struct GetContentDataInfo *Info)
{
if (CustomData)
free(CustomData);
for (size_t i = 0; i < Info->Count; i++)
{
if (!fsf.LStricmp(Info->Names[i], L"diz")
|| !fsf.LStricmp(Info->Names[i], L"C0"))
{
if (Info->Values[i])
{
wchar_t* ptr = (wchar_t*)Info->Values[i];
if (ptr) free(ptr);
}
}
}
}
5 changes: 3 additions & 2 deletions Col0/diz_c0/diz_c0.def
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ EXPORTS
GetGlobalInfoW
GetPluginInfoW
SetStartupInfoW
GetCustomDataW
FreeCustomDataW
GetContentFieldsW
GetContentDataW
FreeContentDataW
2 changes: 1 addition & 1 deletion Col0/diz_c0/farwinapi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "../common/pluginW3.hpp"
#include "../../common/plugin.h"
#include "UnicodeString.hpp"

#define NT_MAX_PATH 32768
Expand Down
2 changes: 1 addition & 1 deletion Col0/diz_c0/headers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ inline const T Round(const T &a, const T &b) { return a/b+(a%b*2>b?1:0); }
#include "UnicodeString.hpp"
#include "format.hpp"
#include "local.hpp"
#include "../common/pluginW3.hpp"
#include "../../common/plugin.h"
#include "farwinapi.hpp"
#include "cvtname.hpp"
#endif // __cplusplus
Expand Down

0 comments on commit e29d560

Please sign in to comment.