1
0
This commit is contained in:
2025-10-10 02:17:07 +02:00
commit ee9f86004b
48 changed files with 2161 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
// Uso de _CRT_SECURE_NO_WARNINGS. Ver https://t.ly/aZuv
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <locale.h>
/* Definiciones válidas
*
* void main()
* int main() con return
* int main(int argc, char* argv[])
*
*/
int main(int argc, char* argv[], char* envp[])
{
setlocale(LC_ALL, "Spanish");
printf("\Hola mundo!\n");
printf("\nPor favor, pulse la tecla ENTRAR para terminar ...\n");
(void)getchar();
return 0;
}

View File

@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" 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>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{77cc3bb4-6597-4cd4-be06-96ad21d43458}</ProjectGuid>
<RootNamespace>smt4497P0</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</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" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="smt4497-P0.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="smt4497-P0.cpp" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

View File

@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35303.130
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smt4497-P0", "smt4497-P0\smt4497-P0.vcxproj", "{77CC3BB4-6597-4CD4-BE06-96AD21D43458}"
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
{77CC3BB4-6597-4CD4-BE06-96AD21D43458}.Debug|x64.ActiveCfg = Debug|x64
{77CC3BB4-6597-4CD4-BE06-96AD21D43458}.Debug|x64.Build.0 = Debug|x64
{77CC3BB4-6597-4CD4-BE06-96AD21D43458}.Debug|x86.ActiveCfg = Debug|Win32
{77CC3BB4-6597-4CD4-BE06-96AD21D43458}.Debug|x86.Build.0 = Debug|Win32
{77CC3BB4-6597-4CD4-BE06-96AD21D43458}.Release|x64.ActiveCfg = Release|x64
{77CC3BB4-6597-4CD4-BE06-96AD21D43458}.Release|x64.Build.0 = Release|x64
{77CC3BB4-6597-4CD4-BE06-96AD21D43458}.Release|x86.ActiveCfg = Release|Win32
{77CC3BB4-6597-4CD4-BE06-96AD21D43458}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {90421DA3-D208-47B9-B342-97D7AC022EFB}
EndGlobalSection
EndGlobal

31
P1/P1.sln Normal file
View File

@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35303.130
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smt4497-P1", "smt4497-P1\smt4497-P1.vcxproj", "{BE550ACF-1308-4287-B9D9-01ACC6935D03}"
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
{BE550ACF-1308-4287-B9D9-01ACC6935D03}.Debug|x64.ActiveCfg = Debug|x64
{BE550ACF-1308-4287-B9D9-01ACC6935D03}.Debug|x64.Build.0 = Debug|x64
{BE550ACF-1308-4287-B9D9-01ACC6935D03}.Debug|x86.ActiveCfg = Debug|Win32
{BE550ACF-1308-4287-B9D9-01ACC6935D03}.Debug|x86.Build.0 = Debug|Win32
{BE550ACF-1308-4287-B9D9-01ACC6935D03}.Release|x64.ActiveCfg = Release|x64
{BE550ACF-1308-4287-B9D9-01ACC6935D03}.Release|x64.Build.0 = Release|x64
{BE550ACF-1308-4287-B9D9-01ACC6935D03}.Release|x86.ActiveCfg = Release|Win32
{BE550ACF-1308-4287-B9D9-01ACC6935D03}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FB74D9CC-E610-4A76-B2DB-3A3BA54988C8}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,24 @@
#include "smt4497-P1.h"
void LeeFabricanteCPU(char fabricante[], int tamfabricante)
{
int info[4];
__cpuid(info, 0);
int* p;
p = (int*) fabricante;
//usando puntero interpretando como int
p[0] = info[1];
p[1] = info[3];
p[2] = info[2];
//p[3] = 0; // puede ser un error porque "rellena mas 0's"
//usando memcpy interpretando como char
//memcpy(&fabricante[0], &info[1], 4); // == &fabricante
//memcpy(&fabricante[4], &info[3], 4);
//memcpy(&fabricante[8], &info[2], 4);
fabricante[12] = 0;
}

View File

@@ -0,0 +1,30 @@
#include "smt4497-P1.h"
#define TAM_NOMBRE_FABRICANTE 37
/*int main(int argc, char* argv[], char* emvp[])
{
setlocale(LC_ALL, "Spanish");
char nombreFabricante[TAM_NOMBRE_FABRICANTE];
LeeFabricanteCPU(nombreFabricante, TAM_NOMBRE_FABRICANTE);
printf("Fabricante: %s\n", nombreFabricante);
printf("Por favor pulse la tecla ENTER para terminar ... \n");
(void)getchar();
return 0;
}*/
int main(int argc, char* argv[], char* emvp[])
{
setlocale(LC_ALL, "Spanish");
for (int i = 0; i < argc; i++)
{
printf("Arg %d: %s\n", i, argv[i]);
}
printf("Por favor pulse la tecla ENTER para terminar ... \n");
(void)getchar();
return 0;
}

View File

@@ -0,0 +1,11 @@
#pragma once
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <conio.h>
#include <windows.h>
#include <intrin.h>
#include <locale.h>
int esperaPulseTecla(int toutMs);
void LeeFabricanteCPU(char fabricante[], int tamfabricante);

View File

@@ -0,0 +1,140 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" 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>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{be550acf-1308-4287-b9d9-01acc6935d03}</ProjectGuid>
<RootNamespace>smt4497P1</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</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" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="smt4497-P1-matrices.cpp" />
<ClCompile Include="smt4497-P1.cpp" />
<ClCompile Include="smt4497-P1a.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="smt4497-P1.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Archivos de origen">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Archivos de encabezado">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Archivos de recursos">
<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>
<ClCompile Include="smt4497-P1a.cpp">
<Filter>Archivos de origen</Filter>
</ClCompile>
<ClCompile Include="smt4497-P1.cpp">
<Filter>Archivos de origen</Filter>
</ClCompile>
<ClCompile Include="smt4497-P1-matrices.cpp">
<Filter>Archivos de origen</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="smt4497-P1.h">
<Filter>Archivos de encabezado</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerCommandArguments>
</LocalDebuggerCommandArguments>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,21 @@
#include "smt4497-P1.h"
int esperaPulseTecla(int toutMs)
{
int res = 0;
int antes = GetTickCount();
int ahora;
do {
if (_kbhit())
{
res = _getch();
break;
}
if (toutMs > 0)
Sleep(1);
ahora = GetTickCount();
} while (ahora - antes < toutMs);
return res;
}

View File

@@ -0,0 +1,14 @@
#include "smt4497-P1.h"
int ej1_8()
{
printf("Pulsa una tecla para salir \n");
int contador = 0;
int tecla = 0;
printf("Tam. contador: %d bytes\n", sizeof(contador));
while (tecla = 0)
{
printf("\r%d ", ++contador);
tecla = esperaPulseTecla(0);
}
}

31
P2/P2.sln Normal file
View File

@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35303.130
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smt4497-P2", "smt4497-P2\smt4497-P2.vcxproj", "{F2876C30-95C1-42D2-B434-6CE7CA561024}"
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
{F2876C30-95C1-42D2-B434-6CE7CA561024}.Debug|x64.ActiveCfg = Debug|x64
{F2876C30-95C1-42D2-B434-6CE7CA561024}.Debug|x64.Build.0 = Debug|x64
{F2876C30-95C1-42D2-B434-6CE7CA561024}.Debug|x86.ActiveCfg = Debug|Win32
{F2876C30-95C1-42D2-B434-6CE7CA561024}.Debug|x86.Build.0 = Debug|Win32
{F2876C30-95C1-42D2-B434-6CE7CA561024}.Release|x64.ActiveCfg = Release|x64
{F2876C30-95C1-42D2-B434-6CE7CA561024}.Release|x64.Build.0 = Release|x64
{F2876C30-95C1-42D2-B434-6CE7CA561024}.Release|x86.ActiveCfg = Release|Win32
{F2876C30-95C1-42D2-B434-6CE7CA561024}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {46966ECB-4E2E-4549-94F4-D4DA31B33174}
EndGlobalSection
EndGlobal

66
P2/smt4497-P2/Crono.cpp Normal file
View File

@@ -0,0 +1,66 @@
#include "Crono.h"
// agrupación de clases, funciones y variables globales
namespace ss {
Crono::Crono() // constructor
{
// Paso 1: Obtiene la frecuencia del timer del PC en tics/segundo usando QueryPerformanceFrequency
if (_ticsPorSegundoDelTimerDelPC < 0) {
// No se ha calculado la frecuencia aún. Se calcula ahora
LARGE_INTEGER frecuencia;
char _cadDbg[TAM_CADENA_DEBUG]; // snprintf almacena en una matriz intermedia y al pasar
// _cadDbg es un puntero a _cadDbg[0]
if (QueryPerformanceFrequency(&frecuencia)) {
_ticsPorSegundoDelTimerDelPC = frecuencia.QuadPart;
snprintf(_cadDbg, sizeof(_cadDbg), "La frecuencia del contador del PC es %d Hz\n",
_ticsPorSegundoDelTimerDelPC);
OutputDebugStringA(_cadDbg);
}
else {
OutputDebugStringA("Error al ejecutar QueryPerformanceFrequency en " __FUNCTION__);
}
}
}
Crono::~Crono() // destructor
{
}
bool Crono::Inicio()
{
bool res = false;
if (_ticsPorSegundoDelTimerDelPC > 0) {
// Paso 2: guarda el valor actual del timer del PC en tics usando QueryPerformanceCounter
LARGE_INTEGER ticks;
if (QueryPerformanceCounter(&ticks)) {
_ticsAntes = ticks.QuadPart;
res = true;
}
else {
OutputDebugStringA("Error al ejecutar QueryPerformanceCounter en " __FUNCTION__);
}
}
return res;
}
double Crono::Lee()
{
double segundos = -1.0;
// Paso 3: Obtiene el valor actual del timer del PC en tics usando QueryPerformanceCounter
LARGE_INTEGER ticks;
if (QueryPerformanceCounter(&ticks)) {
int64_t ahora = ticks.QuadPart;
segundos = (double)(ahora - _ticsAntes) / _ticsPorSegundoDelTimerDelPC;
}
else {
printf("Error al ejecutar QueryPerformanceCounter en " __FUNCTION__);
}
return segundos;
}
}

21
P2/smt4497-P2/Crono.h Normal file
View File

@@ -0,0 +1,21 @@
#pragma once
#include <stdint.h>
#include <stdio.h>
#include <stdarg.h>
#include <Windows.h>
namespace ss {
class Crono {
private: // por defecto todo es private
int64_t _ticsAntes = 0;
int64_t _ticsPorSegundoDelTimerDelPC = -1;
static const int TAM_CADENA_DEBUG = 64;
public:
Crono();
~Crono();
bool Inicio();
double Lee();
};
}

View File

@@ -0,0 +1,11 @@
#include "smt4497-P2.h"
int p2_classes()
{
ss::Crono crono;
crono.Inicio();
Sleep(10000);
double segs = crono.Lee();
printf("Segundos: %f\n", segs);
return 0;
}

View File

@@ -0,0 +1,34 @@
#include "smt4497-P2.h"
int p2_struct_union()
{
setlocale(LC_ALL, "spanish");
printf("\nEstructuras | PR<50>CTICA 2 | SS\n");
printf("---------------------------------\n");
struct {
int entero;
char car;
} vEstructura = { 256, 1 }; // Define + inicializa la estructura
union {
int entero;
unsigned char car[4];
} vUnion = { 256 }; // Define + inicializa la uni<6E>n
vUnion.entero = 0x89abcdef; // byte 0: 0xef, byte 1: 0xcd, byte 2: 0xab, byte 3: 0x89
printf("vUnion.entero vale 0x%x\n", vUnion.entero);
printf("El valor del byte 2 de vUnion.entero es: 0x%x\n",
// (vUnion.entero & 0x00ff0000) >> 16); tambi<62>n es v<>lido hacer primero la m<>scara y luego shift
(vUnion.entero >> (8 * 2) & 0xff));
printf("El valor del byte 2 de vUnion.entero es: 0x%x\n",
vUnion.car[2]);
// printf("Estructura: %d Tam: %d\n", vEstructura.entero, sizeof(vEstructura));
// printf("Union: %d Tam: %d\n", vUnion.entero, sizeof(vUnion));
return 0;
}

View File

@@ -0,0 +1,25 @@
#include "smt4497-P2.h"
typedef struct {
int entero;
char car;
} tEstructura_t;
tEstructura_t var1 = { 100, 1 };
tEstructura_t var2 = { 100, 1 };
int p2_typedef()
{
printf("\nEstructuras Personalizadas | PR<50>CTICA 2 | SS\n");
printf("------------------------------------------------\n");
tEstructura_t var3 = { 100, 1 };
int comparacion = memcmp(&var1, &var2, sizeof(tEstructura_t));
printf("resultado de comparar var1 y var2: %d\n", comparacion);
comparacion = memcmp(&var1, &var3, sizeof(tEstructura_t));
printf("resultado de comparar var1 y var3: %d\n", comparacion);
return 0;
}

View File

@@ -0,0 +1,12 @@
#include "smt4497-P2.h"
int main(int argc, char* argv[], char* envp[])
{
setlocale(LC_ALL, "Spanish");
// p2_struct_union();
// p2_typedef();
p2_classes();
return 0;
}

View File

@@ -0,0 +1,11 @@
#pragma once
#include <stdio.h>
#include <locale.h>
#include <Windows.h>
#include "Crono.h"
int p2_struct_union();
int p2_typedef();
int p2_crono();
int p2_classes();

View File

@@ -0,0 +1,143 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" 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>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{f2876c30-95c1-42d2-b434-6ce7ca561024}</ProjectGuid>
<RootNamespace>smt4497P2</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</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" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Crono.cpp" />
<ClCompile Include="smt4497-P2-classes.cpp" />
<ClCompile Include="smt4497-P2.cpp" />
<ClCompile Include="smt4497-P2-struct-union.cpp" />
<ClCompile Include="smt4497-P2-typedef.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Crono.h" />
<ClInclude Include="smt4497-P2.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Archivos de origen">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Archivos de encabezado">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Archivos de recursos">
<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>
<ClCompile Include="smt4497-P2.cpp">
<Filter>Archivos de origen</Filter>
</ClCompile>
<ClCompile Include="smt4497-P2-typedef.cpp">
<Filter>Archivos de origen</Filter>
</ClCompile>
<ClCompile Include="Crono.cpp">
<Filter>Archivos de origen</Filter>
</ClCompile>
<ClCompile Include="smt4497-P2-struct-union.cpp">
<Filter>Archivos de origen</Filter>
</ClCompile>
<ClCompile Include="smt4497-P2-classes.cpp">
<Filter>Archivos de origen</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="smt4497-P2.h">
<Filter>Archivos de encabezado</Filter>
</ClInclude>
<ClInclude Include="Crono.h">
<Filter>Archivos de encabezado</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

31
P3/P3.sln Normal file
View File

@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35303.130
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smt4497-P3", "smt4497-P3\smt4497-P3.vcxproj", "{EF4E367F-B23F-4DDC-B32E-2493139B05C2}"
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
{EF4E367F-B23F-4DDC-B32E-2493139B05C2}.Debug|x64.ActiveCfg = Debug|x64
{EF4E367F-B23F-4DDC-B32E-2493139B05C2}.Debug|x64.Build.0 = Debug|x64
{EF4E367F-B23F-4DDC-B32E-2493139B05C2}.Debug|x86.ActiveCfg = Debug|Win32
{EF4E367F-B23F-4DDC-B32E-2493139B05C2}.Debug|x86.Build.0 = Debug|Win32
{EF4E367F-B23F-4DDC-B32E-2493139B05C2}.Release|x64.ActiveCfg = Release|x64
{EF4E367F-B23F-4DDC-B32E-2493139B05C2}.Release|x64.Build.0 = Release|x64
{EF4E367F-B23F-4DDC-B32E-2493139B05C2}.Release|x86.ActiveCfg = Release|Win32
{EF4E367F-B23F-4DDC-B32E-2493139B05C2}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B77201B5-D64F-4728-842F-CA7B8D01EC82}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,27 @@
#include "smt4497-P3.h"
#include <sslib\SSLib.h>
using namespace ss;
int main(int argc, char* argv[], char* envp[])
{
setlocale(LC_ALL, "Spanish");
Dbg dbg(true, true);
dbg.CheckError(argc < 2,
"Error: Debe indicar el nombre del directorio a procesar\n");
DWORD atributos = GetFileAttributesA(argv[1]);
printf("Mostrando los archivos del directorio:\n%s\n\n", argv[1]);
dbg.CheckError(atributos == INVALID_FILE_ATTRIBUTES,
"Error: No se ha dado un nombre de directorio correcto:\n(%s)\n");
dbg.CheckError((atributos & FILE_ATTRIBUTE_DIRECTORY) != 0,
"Error: No es un directorio:\n(%s)\n", argv[1]);
printf("\nPor favor pulse ENTRAR para terminar...\n");
(void)getchar();
return 0;
}

View File

@@ -0,0 +1,3 @@
#include <stdio.h>
#include <locale.h>
#include <Windows.h>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" 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>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{ef4e367f-b23f-4ddc-b32e-2493139b05c2}</ProjectGuid>
<RootNamespace>smt4497P3</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</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|x64'">
<IncludePath>$(AAComm)inc\</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IncludePath>$(AAComm)inc\</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>$(AAComm)inc\</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(AAComm)inc\</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>$(AAComm)lib\sslib\x64\SSLib.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>$(AAComm)lib\sslib\x64\SSLib.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="smt4497-P3.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="smt4497-P3.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Archivos de origen">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Archivos de encabezado">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Archivos de recursos">
<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>
<ClCompile Include="smt4497-P3.cpp">
<Filter>Archivos de origen</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="smt4497-P3.h">
<Filter>Archivos de encabezado</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerEnvironment>PATH=$(AAComm)bin\sslib\x64\;PATH
$(LocalDebuggerEnvironment)</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LocalDebuggerEnvironment>PATH=$(AAComm)bin\sslib\x64\;PATH
$(LocalDebuggerEnvironment)</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>

31
P4/P4.sln Normal file
View File

@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35327.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smt4497-P4", "smt4497-P4\smt4497-P4.vcxproj", "{26268DC2-B4EF-4EB4-A028-7FCE3264D50D}"
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
{26268DC2-B4EF-4EB4-A028-7FCE3264D50D}.Debug|x64.ActiveCfg = Debug|x64
{26268DC2-B4EF-4EB4-A028-7FCE3264D50D}.Debug|x64.Build.0 = Debug|x64
{26268DC2-B4EF-4EB4-A028-7FCE3264D50D}.Debug|x86.ActiveCfg = Debug|Win32
{26268DC2-B4EF-4EB4-A028-7FCE3264D50D}.Debug|x86.Build.0 = Debug|Win32
{26268DC2-B4EF-4EB4-A028-7FCE3264D50D}.Release|x64.ActiveCfg = Release|x64
{26268DC2-B4EF-4EB4-A028-7FCE3264D50D}.Release|x64.Build.0 = Release|x64
{26268DC2-B4EF-4EB4-A028-7FCE3264D50D}.Release|x86.ActiveCfg = Release|Win32
{26268DC2-B4EF-4EB4-A028-7FCE3264D50D}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {03E5163E-88C0-4721-A68B-5902660D19FD}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,180 @@
#include "smt4497-P4.h"
using namespace ss;
using namespace std;
extern Dbg _dbg(true);
static size_t accSize = 0;
int main(int argc, char* argv[], char* envp[])
{
setlocale(LC_ALL, "spanish");
const char* pDir = argv[1];
int found;
char** pfileList;
static FileSys fs;
pfileList = fs.ArchivosEnDirectorio(&found, pDir, false);
_dbg.CheckError(argc < 2, 1, "Error en argumentos\n");
SearchTextInFile(argv[1], argv[2]);
printf("\nPor favor, pulse la tecla ENTRAR para terminar...\n");
(void)getchar();
return 0;
}
BOOL ShowFilesInDirectory(int found, char* pName)
{
BOOL res = FALSE;
CHAR buffer[MAX_PATH];
DWORD win32APIResponse = GetFullPathNameA(pName, sizeof(buffer), buffer, NULL);
if (!_dbg.CheckError(win32APIResponse == 0, "Error al llamar a GetFullPathNameA()"))
{
res = TRUE;
printf("Se han encontrado %d archivos en la carpeta %s\n", found, buffer);
}
return res;
}
size_t GetFileSize(char* pfileName)
{
WIN32_FILE_ATTRIBUTE_DATA info;
BOOL attrs = GetFileAttributesExA(pfileName, GetFileExInfoStandard, &info);
return info.nFileSizeLow + ((int64_t)info.nFileSizeHigh << 32);
}
VOID PrintFilesInDirectory(char* pfileList[])
{
int i = 0;
// prints file list while a null pointer isn't found
while (pfileList[i] != nullptr)
{
CHAR buffer[64];
PSTR formatted = StrFormatByteSize64A(GetFileSize(pfileList[i]), buffer, sizeof(buffer));
printf("#%d: %s (%s)\n", i, pfileList[i], formatted);
i++;
}
}
static size_t BytesInFile(char* listaArchivos[], int nroArchivos)
{
size_t total = 0;
int i = 0;
WIN32_FILE_ATTRIBUTE_DATA info;
for (i = 0; i < nroArchivos; i++) {
if (_dbg.CheckError(FALSE ==
GetFileAttributesExA(listaArchivos[i], GetFileExInfoStandard, &info),
"Error en GetFileAttributesExA para el archivo %s\n", listaArchivos[i]))
continue; // Salta a la siguiente iteraci<63>n del bucle si hay error
int64_t tam = ((int64_t)info.nFileSizeHigh >> 32) + info.nFileSizeLow;
total += tam;
}
return total;
}
static size_t BytesInFileThread(char* listaArchivos[], int nroArchivos, size_t* pTotal)
{
size_t total = 0;
int i = 0;
WIN32_FILE_ATTRIBUTE_DATA info;
for (i = 0; i < nroArchivos; i++) {
if (_dbg.CheckError(FALSE ==
GetFileAttributesExA(listaArchivos[i], GetFileExInfoStandard, &info),
"Error en GetFileAttributesExA para el archivo %s\n", listaArchivos[i]))
continue; // Salta a la siguiente iteraci<63>n del bucle si hay error
int64_t tam = ((int64_t)info.nFileSizeHigh >> 32) + info.nFileSizeLow;
total += tam;
}
*pTotal += total;
return total;
}
static size_t BytesInFileMultithread(char* path,
unsigned int additionalThreads, bool useLastSearch)
{
static FileSys fs;
static int found = 0;
static char** pfileList = nullptr;
if (!useLastSearch)
{
pfileList = fs.ArchivosEnDirectorio(&found, path, false);
if (!ShowFilesInDirectory(found, path))
{
return 0;
printf("\t\tLa b<>squeda de archivos ha tardado %f segs\n", fs.TiempoUltimoMetodo());
}
}
_dbg.CronoInicio();
size_t totalSize = 0;
if (additionalThreads == 0)
{
totalSize = BytesInFile(pfileList, found);
}
else
{
thread* threads = new thread[additionalThreads];
for (int i = 0; i < additionalThreads; i++)
{
threads[i] = thread(BytesInFileThread, pfileList, found, &totalSize);
_dbg.CheckError(threads[i].native_handle() == NULL, "Error creando hilo %d", i);
}
for (int i = 0; i < additionalThreads; i++)
{
threads[i].join();
}
delete[] threads;
}
auto secs = _dbg.CronoLee();
printf("\tCalculados %lld bytes\n", totalSize);
printf("\t\tCalculado en: %f segs por %s (%d hilos adicionales).\n\n", secs, __FUNCTION__, additionalThreads);
return totalSize;
}
static int SearchTextInFile(const char* dirBusqueda, const char* textoABuscar) {
Dbg dbg;
FileSys fs;
int ocurrencias, encontrados = 0, nroArchivos, idxMarca = 0;
char** listaArchivos = fs.ArchivosEnDirectorio(&nroArchivos, dirBusqueda, false);
if (dbg.CheckError(listaArchivos == nullptr, "No se han encontrado archivos en la carpeta %s\n", dirBusqueda)) {
return -1;
}
char marcasAvance[] = "-\\|/"; // Para animaci<63>n simple
size_t bytesTotal, bytesAcumulados = 0;
bytesTotal = BytesInFile(listaArchivos, nroArchivos);
if (dbg.CheckError(bytesTotal == 0, "No se han encontrado archivos en la carpeta %s\n", dirBusqueda)) {
return -1;
}
ShowFilesInDirectory(nroArchivos, (char*)dirBusqueda);
printf("\nBuscando texto \"%s\" en %lld bytes\n", textoABuscar, bytesTotal);
dbg.CronoInicio();
for (int i = 0; i < nroArchivos; i++) {
// Busca el texto en el archivo usando un m<>todo de FileSys
ocurrencias = fs.BuscaDatoEnArchivo(textoABuscar, strlen(textoABuscar),
listaArchivos[i], &bytesAcumulados, 10000);
if (ocurrencias > 0) {
encontrados++;
dbg.DbgPrint("#%d: %d ocurrencias en %s\n", encontrados, ocurrencias, listaArchivos[i]);
}
else if (ocurrencias < 0) {
dbg.DbgPrint("Error %s\n", listaArchivos[i]);
}
// Muestra el avance del proceso
if (i == nroArchivos - 1)
bytesAcumulados = bytesTotal; // Para que muestre 100% al final, aunque no sea exacto
printf("\r%c %.02f %% %d/%d ", marcasAvance[idxMarca++ % (sizeof(marcasAvance) - 1)],
(double)bytesAcumulados * 100 / bytesTotal, i + 1, nroArchivos);
}
double segs = dbg.CronoLee();
printf("\nSe han encontrado %d archivos con el texto\n", encontrados, textoABuscar, dirBusqueda);
printf("\t\tCalculado en: %f segs por %s\n", segs, __FUNCTION__);
return encontrados;
}

View File

@@ -0,0 +1,18 @@
#pragma once
#include <stdio.h>
#include <locale.h>
#include <Shlwapi.h>
#include <thread>
#include <sslib\SSLib.h>
#pragma comment(lib, "Shlwapi.lib") // Link against Shlwapi.lib
static BOOL ShowFilesInDirectory(int found, char* pdirName);
static void PrintFilesInDirectory(char* fileList[]);
static size_t GetFileSize(char* pfileName);
static size_t BytesInFile(char* listaArchivos[], int nroArchivos);
static size_t BytesInFileThread(char* listaArchivos[], int nroArchivos, size_t* pTotal);
static size_t BytesInFileMultithread(char* path, unsigned int additionalThreads, bool useLastSearch);
static int SearchTextInFile(const char* dirBusqueda, const char* textoABuscar);

View File

@@ -0,0 +1,154 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" 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>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{26268dc2-b4ef-4eb4-a028-7fce3264d50d}</ProjectGuid>
<RootNamespace>smt4497P4</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</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'">
<IncludePath>$(AAComm)inc;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>$(AAComm)inc;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>$(AAComm)inc;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(AAComm)inc;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>$(AAComm)lib\sslib\x86\SSLib.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>$(AAComm)lib\sslib\x86\SSLib.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>$(AAComm)lib\sslib\x64\SSLib.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>$(AAComm)lib\sslib\x64\SSLib.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="smt4497-P4.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="smt4497-P4.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="smt4497-P4.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="smt4497-P4.h" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerEnvironment>PATH=$(AAComm)bin\sslib\$(PlatformTarget);%PATH%</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>. BuscaTextoEnArchivos</LocalDebuggerCommandArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerEnvironment>PATH=$(AAComm)bin\sslib\$(PlatformTarget);%PATH%</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>. BuscaTextoEnArchivos</LocalDebuggerCommandArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerEnvironment>PATH=$(AAComm)bin\sslib\$(PlatformTarget);%PATH%</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>. BuscaTextoEnArchivos</LocalDebuggerCommandArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LocalDebuggerEnvironment>PATH=$(AAComm)bin\sslib\$(PlatformTarget);%PATH%</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>. BuscaTextoEnArchivos</LocalDebuggerCommandArguments>
</PropertyGroup>
</Project>

31
P5/P5.sln Normal file
View File

@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35327.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smt4497-P5", "smt4497-P5\smt4497-P5.vcxproj", "{B823A30A-0FA2-4E84-99F8-5A5B241871FD}"
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
{B823A30A-0FA2-4E84-99F8-5A5B241871FD}.Debug|x64.ActiveCfg = Debug|x64
{B823A30A-0FA2-4E84-99F8-5A5B241871FD}.Debug|x64.Build.0 = Debug|x64
{B823A30A-0FA2-4E84-99F8-5A5B241871FD}.Debug|x86.ActiveCfg = Debug|Win32
{B823A30A-0FA2-4E84-99F8-5A5B241871FD}.Debug|x86.Build.0 = Debug|Win32
{B823A30A-0FA2-4E84-99F8-5A5B241871FD}.Release|x64.ActiveCfg = Release|x64
{B823A30A-0FA2-4E84-99F8-5A5B241871FD}.Release|x64.Build.0 = Release|x64
{B823A30A-0FA2-4E84-99F8-5A5B241871FD}.Release|x86.ActiveCfg = Release|Win32
{B823A30A-0FA2-4E84-99F8-5A5B241871FD}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A5FD762A-271B-490E-9D8C-A719EDCC3EF4}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,129 @@
#include "smt4497-p5.h"
#define INCREMENTS (100*1000)
#define THREADS 20
#define ITERATIONS 100
using namespace ss;
static HANDLE mutex;
static HANDLE* turn_events;
static Dbg _dbg(true);
int main(int argc, char* argv[], char* envp[])
{
setlocale(LC_ALL, "Spanish");
/*printf("\nEmpezando sin mutex...\n");
for (int i = 1; i <= ITERATIONS; i++)
{
test_simple_non_reentrant_thread(INCREMENTS, THREADS);
}
printf("\nEmpezando con mutex...\n");
for (int i = 1; i <= ITERATIONS; i++)
{
test_simple_non_reentrant_thread_mutex(INCREMENTS, THREADS);
}*/
test_thread_turns(THREADS);
printf("\nPor favor pulse ENTER para terminar...");
(void)getchar();
return 0;
}
VOID simple_non_reentrant_thread(int times, int* pCounter)
{
for (int i = 0; i < times; i++)
{
*pCounter += times + 1;
*pCounter -= times + 1;
}
}
static BOOL test_simple_non_reentrant_thread(int increments, int threads_number)
{
int counter = 0;
_dbg.CronoInicio();
thread* threads = new thread[threads_number];
for (int i = 0; i < threads_number; i++)
{
threads[i] = thread(simple_non_reentrant_thread, increments, &counter);
_dbg.CheckError(threads[i].native_handle() == NULL, "No se pudo crear el hilo");
}
for (int i = 0; i < threads_number; i++)
threads[i].join();
double secs = _dbg.CronoLee();
printf("[SIN MUTEX] Contador vale: %d (calculado con %d hilos, en %f segundos)\n", counter, threads_number, secs);
return counter == 0;
}
VOID simple_non_reentrant_thread_mutex(int times, int* pCounter)
{
DWORD res = WaitForSingleObject(mutex, INFINITE); // critical section begins
_dbg.CheckError(res != 0, 2, "Error en el bloqueo\n");
for (int i = 0; i < times; i++)
{
*pCounter += times + 1;
*pCounter -= times + 1;
}
_dbg.CheckError(ReleaseMutex(mutex) == FALSE, 1, "Error liberando mutex\n"); // critical section ends
}
static BOOL test_simple_non_reentrant_thread_mutex(int increments, int threads_number)
{
int counter = 0;
_dbg.CronoInicio();
mutex = CreateMutexA(NULL, FALSE, NULL);
_dbg.CheckError(mutex == NULL, 1, "Error creando el mutex\n");
thread* threads = new thread[threads_number];
for (int i = 0; i < threads_number; i++)
{
threads[i] = thread(simple_non_reentrant_thread_mutex, increments, &counter);
_dbg.CheckError(threads[i].native_handle() == NULL, "No se pudo crear el hilo");
}
for (int i = 0; i < threads_number; i++)
threads[i].join();
double secs = _dbg.CronoLee();
printf("[CON MUTEX] Contador vale: %d (calculado con %d hilos, en %f segundos)\n", counter, threads_number, secs);
return counter == 0;
}
static VOID thread_turns(int thread_number)
{
WaitForSingleObject(turn_events[thread_number], INFINITE);
for (int i = 0; i < thread_number; i++)
printf(" ");
printf("hilo %i iniciado >>", thread_number);
for (int i = 0; i < thread_number; i++)
printf(" ");
printf("<< hilo %i finalizado\n", thread_number);
SetEvent(turn_events[thread_number + 1]);
}
static VOID test_thread_turns(int thread_numbers)
{
turn_events = new HANDLE[thread_numbers + 1];
for (int i = 0; i <= thread_numbers; i++)
{
turn_events[i] = CreateEventA(NULL, FALSE, FALSE, NULL);
_dbg.CheckError(turn_events[i] == NULL, 1, "Error creando el evento\n");
}
thread* threads = new thread[thread_numbers];
for (int i = 0; i < thread_numbers; i++)
{
threads[i] = thread(thread_turns, i);
_dbg.CheckError(threads[i].native_handle() == NULL, "No se pudo crear el hilo");
}
SetEvent(turn_events[0]);
for (int i = 0; i < thread_numbers; i++)
threads[i].join();
for (int i = 0; i <= thread_numbers; i++)
CloseHandle(turn_events[i]);
delete[] turn_events;
delete[] threads;
}

View File

@@ -0,0 +1,154 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" 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>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{b823a30a-0fa2-4e84-99f8-5a5b241871fd}</ProjectGuid>
<RootNamespace>smt4497P5</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</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|x64'">
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(AAComm)inc</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(AAComm)inc</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(AAComm)inc</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(AAComm)inc</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>$(AAComm)lib\sslib\x86\SSLib.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>$(AAComm)lib\sslib\x86\SSLib.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>$(AAComm)lib\sslib\x64\SSLib.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>$(AAComm)lib\sslib\x64\SSLib.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="smt4497-P5.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="smt4497-p5.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="smt4497-P5.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="smt4497-p5.h" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerEnvironment>PATH=$(AAComm)bin\sslib\$(PlatformTarget);%PATH%$(LocalDebuggerEnvironment)</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerEnvironment>PATH=$(AAComm)bin\sslib\$(PlatformTarget);%PATH%$(LocalDebuggerEnvironment)</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerEnvironment>PATH=$(AAComm)bin\sslib\$(PlatformTarget);%PATH%$(LocalDebuggerEnvironment)</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LocalDebuggerEnvironment>PATH=$(AAComm)bin\sslib\$(PlatformTarget);%PATH%$(LocalDebuggerEnvironment)</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,14 @@
#pragma once
#include <windows.h>
#include <thread>
#include <stdio.h>
#include <sslib\SSLib.h>
#include <locale.h>
VOID simple_non_reentrant_thread(int times, int* pCounter);
VOID simple_non_reentrant_thread_mutex(int times, int* pCounter);
static BOOL test_simple_non_reentrant_thread(int increments, int threads_number);
static BOOL test_simple_non_reentrant_thread_mutex(int increments, int threads_number);
static VOID thread_turns(int thread_number);
static VOID test_thread_turns(int thread_numbers);

1
README.md Normal file
View File

@@ -0,0 +1 @@
# Software de Sistemas. Curso 2024/25.

81
SSRepo/SSRepo.sln Normal file
View File

@@ -0,0 +1,81 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35327.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smt4497-P0", "..\P0\smt4497-P0\smt4497-P0\smt4497-P0.vcxproj", "{77CC3BB4-6597-4CD4-BE06-96AD21D43458}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smt4497-P1", "..\P1\smt4497-P1\smt4497-P1.vcxproj", "{BE550ACF-1308-4287-B9D9-01ACC6935D03}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smt4497-P2", "..\P2\smt4497-P2\smt4497-P2.vcxproj", "{F2876C30-95C1-42D2-B434-6CE7CA561024}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smt4497-P3", "..\P3\smt4497-P3\smt4497-P3.vcxproj", "{EF4E367F-B23F-4DDC-B32E-2493139B05C2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smt4497-P4", "..\P4\smt4497-P4\smt4497-P4.vcxproj", "{26268DC2-B4EF-4EB4-A028-7FCE3264D50D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smt4497-P5", "..\P5\smt4497-P5\smt4497-P5.vcxproj", "{B823A30A-0FA2-4E84-99F8-5A5B241871FD}"
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
{77CC3BB4-6597-4CD4-BE06-96AD21D43458}.Debug|x64.ActiveCfg = Debug|x64
{77CC3BB4-6597-4CD4-BE06-96AD21D43458}.Debug|x64.Build.0 = Debug|x64
{77CC3BB4-6597-4CD4-BE06-96AD21D43458}.Debug|x86.ActiveCfg = Debug|Win32
{77CC3BB4-6597-4CD4-BE06-96AD21D43458}.Debug|x86.Build.0 = Debug|Win32
{77CC3BB4-6597-4CD4-BE06-96AD21D43458}.Release|x64.ActiveCfg = Release|x64
{77CC3BB4-6597-4CD4-BE06-96AD21D43458}.Release|x64.Build.0 = Release|x64
{77CC3BB4-6597-4CD4-BE06-96AD21D43458}.Release|x86.ActiveCfg = Release|Win32
{77CC3BB4-6597-4CD4-BE06-96AD21D43458}.Release|x86.Build.0 = Release|Win32
{BE550ACF-1308-4287-B9D9-01ACC6935D03}.Debug|x64.ActiveCfg = Debug|x64
{BE550ACF-1308-4287-B9D9-01ACC6935D03}.Debug|x64.Build.0 = Debug|x64
{BE550ACF-1308-4287-B9D9-01ACC6935D03}.Debug|x86.ActiveCfg = Debug|Win32
{BE550ACF-1308-4287-B9D9-01ACC6935D03}.Debug|x86.Build.0 = Debug|Win32
{BE550ACF-1308-4287-B9D9-01ACC6935D03}.Release|x64.ActiveCfg = Release|x64
{BE550ACF-1308-4287-B9D9-01ACC6935D03}.Release|x64.Build.0 = Release|x64
{BE550ACF-1308-4287-B9D9-01ACC6935D03}.Release|x86.ActiveCfg = Release|Win32
{BE550ACF-1308-4287-B9D9-01ACC6935D03}.Release|x86.Build.0 = Release|Win32
{F2876C30-95C1-42D2-B434-6CE7CA561024}.Debug|x64.ActiveCfg = Debug|x64
{F2876C30-95C1-42D2-B434-6CE7CA561024}.Debug|x64.Build.0 = Debug|x64
{F2876C30-95C1-42D2-B434-6CE7CA561024}.Debug|x86.ActiveCfg = Debug|Win32
{F2876C30-95C1-42D2-B434-6CE7CA561024}.Debug|x86.Build.0 = Debug|Win32
{F2876C30-95C1-42D2-B434-6CE7CA561024}.Release|x64.ActiveCfg = Release|x64
{F2876C30-95C1-42D2-B434-6CE7CA561024}.Release|x64.Build.0 = Release|x64
{F2876C30-95C1-42D2-B434-6CE7CA561024}.Release|x86.ActiveCfg = Release|Win32
{F2876C30-95C1-42D2-B434-6CE7CA561024}.Release|x86.Build.0 = Release|Win32
{EF4E367F-B23F-4DDC-B32E-2493139B05C2}.Debug|x64.ActiveCfg = Debug|x64
{EF4E367F-B23F-4DDC-B32E-2493139B05C2}.Debug|x64.Build.0 = Debug|x64
{EF4E367F-B23F-4DDC-B32E-2493139B05C2}.Debug|x86.ActiveCfg = Debug|Win32
{EF4E367F-B23F-4DDC-B32E-2493139B05C2}.Debug|x86.Build.0 = Debug|Win32
{EF4E367F-B23F-4DDC-B32E-2493139B05C2}.Release|x64.ActiveCfg = Release|x64
{EF4E367F-B23F-4DDC-B32E-2493139B05C2}.Release|x64.Build.0 = Release|x64
{EF4E367F-B23F-4DDC-B32E-2493139B05C2}.Release|x86.ActiveCfg = Release|Win32
{EF4E367F-B23F-4DDC-B32E-2493139B05C2}.Release|x86.Build.0 = Release|Win32
{26268DC2-B4EF-4EB4-A028-7FCE3264D50D}.Debug|x64.ActiveCfg = Debug|x64
{26268DC2-B4EF-4EB4-A028-7FCE3264D50D}.Debug|x64.Build.0 = Debug|x64
{26268DC2-B4EF-4EB4-A028-7FCE3264D50D}.Debug|x86.ActiveCfg = Debug|Win32
{26268DC2-B4EF-4EB4-A028-7FCE3264D50D}.Debug|x86.Build.0 = Debug|Win32
{26268DC2-B4EF-4EB4-A028-7FCE3264D50D}.Release|x64.ActiveCfg = Release|x64
{26268DC2-B4EF-4EB4-A028-7FCE3264D50D}.Release|x64.Build.0 = Release|x64
{26268DC2-B4EF-4EB4-A028-7FCE3264D50D}.Release|x86.ActiveCfg = Release|Win32
{26268DC2-B4EF-4EB4-A028-7FCE3264D50D}.Release|x86.Build.0 = Release|Win32
{B823A30A-0FA2-4E84-99F8-5A5B241871FD}.Debug|x64.ActiveCfg = Debug|x64
{B823A30A-0FA2-4E84-99F8-5A5B241871FD}.Debug|x64.Build.0 = Debug|x64
{B823A30A-0FA2-4E84-99F8-5A5B241871FD}.Debug|x86.ActiveCfg = Debug|Win32
{B823A30A-0FA2-4E84-99F8-5A5B241871FD}.Debug|x86.Build.0 = Debug|Win32
{B823A30A-0FA2-4E84-99F8-5A5B241871FD}.Release|x64.ActiveCfg = Release|x64
{B823A30A-0FA2-4E84-99F8-5A5B241871FD}.Release|x64.Build.0 = Release|x64
{B823A30A-0FA2-4E84-99F8-5A5B241871FD}.Release|x86.ActiveCfg = Release|Win32
{B823A30A-0FA2-4E84-99F8-5A5B241871FD}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {36DF339F-5BA3-4543-BC69-8F515A45EC97}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" 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>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{d1f696b6-4f15-430e-b752-73c602d4464d}</ProjectGuid>
<RootNamespace>SSRepo</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</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" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup></ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>