Merge pull request #8 from Timerix22/pull_network_without_network

Pull network without network
This commit is contained in:
Timerix22 2022-08-24 13:58:55 +06:00 committed by GitHub
commit 11c5b57856
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 29 additions and 33 deletions

View File

@ -32,16 +32,13 @@
<ClCompile Include="src\HashFunctions\hash.c" /> <ClCompile Include="src\HashFunctions\hash.c" />
<ClCompile Include="src\Hashtable\Hashtable.c" /> <ClCompile Include="src\Hashtable\Hashtable.c" />
<ClCompile Include="src\Hashtable\KeyValuePair.c" /> <ClCompile Include="src\Hashtable\KeyValuePair.c" />
<ClCompile Include="src\Network\knSocket.c" />
<ClCompile Include="src\SearchTree\SearchTree.c" /> <ClCompile Include="src\SearchTree\SearchTree.c" />
<ClCompile Include="src\String\string.c" /> <ClCompile Include="src\String\string.c" />
<ClCompile Include="src\String\StringBuilder.c" /> <ClCompile Include="src\String\StringBuilder.c" />
<ClCompile Include="tests\main.cpp" /> <ClCompile Include="tests\main.cpp" />
<ClCompile Include="tests\test_autoarr.c" /> <ClCompile Include="tests\test_autoarr.c" />
<ClCompile Include="tests\test_autoarr2.cpp" />
<ClCompile Include="tests\test_dtsod.c" /> <ClCompile Include="tests\test_dtsod.c" />
<ClCompile Include="tests\test_hashtable.c" /> <ClCompile Include="tests\test_hashtable.c" />
<ClCompile Include="tests\test_hashtable2.cpp" />
<ClCompile Include="tests\test_hash_functions.c" /> <ClCompile Include="tests\test_hash_functions.c" />
<ClCompile Include="tests\test_marshalling.c" /> <ClCompile Include="tests\test_marshalling.c" />
<ClCompile Include="tests\test_safethrow.c" /> <ClCompile Include="tests\test_safethrow.c" />
@ -49,7 +46,6 @@
<ClCompile Include="tests\test_string.c" /> <ClCompile Include="tests\test_string.c" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="src\Autoarr2\Autoarr2.hpp" />
<ClInclude Include="src\Autoarr\Autoarr.h" /> <ClInclude Include="src\Autoarr\Autoarr.h" />
<ClInclude Include="src\Autoarr\Autoarr_declare.h" /> <ClInclude Include="src\Autoarr\Autoarr_declare.h" />
<ClInclude Include="src\Autoarr\Autoarr_define.h" /> <ClInclude Include="src\Autoarr\Autoarr_define.h" />
@ -61,10 +57,8 @@
<ClInclude Include="src\base\types.h" /> <ClInclude Include="src\base\types.h" />
<ClInclude Include="src\DtsodParser\DtsodV24.h" /> <ClInclude Include="src\DtsodParser\DtsodV24.h" />
<ClInclude Include="src\HashFunctions\hash.h" /> <ClInclude Include="src\HashFunctions\hash.h" />
<ClInclude Include="src\Hashtable2\Hashtable2.hpp" />
<ClInclude Include="src\Hashtable\Hashtable.h" /> <ClInclude Include="src\Hashtable\Hashtable.h" />
<ClInclude Include="src\Hashtable\KeyValuePair.h" /> <ClInclude Include="src\Hashtable\KeyValuePair.h" />
<ClInclude Include="src\Network\network.h" />
<ClInclude Include="src\SearchTree\SearchTree.h" /> <ClInclude Include="src\SearchTree\SearchTree.h" />
<ClInclude Include="src\String\string.h" /> <ClInclude Include="src\String\string.h" />
<ClInclude Include="src\String\StringBuilder.h" /> <ClInclude Include="src\String\StringBuilder.h" />
@ -75,7 +69,7 @@
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<ProjectGuid>{52f0bd29-a3cb-47ce-b25d-ceaf5dfb2d73}</ProjectGuid> <ProjectGuid>{52f0bd29-a3cb-47ce-b25d-ceaf5dfb2d73}</ProjectGuid>
<RootNamespace>kerep</RootNamespace> <RootNamespace>kerep</RootNamespace>
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@ -162,9 +156,9 @@
<LanguageStandard_C>stdc17</LanguageStandard_C> <LanguageStandard_C>stdc17</LanguageStandard_C>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<PrecompiledHeaderOutputFile /> <PrecompiledHeaderOutputFile />
<AdditionalOptions>/Zc:twoPhase- /MP %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:twoPhase- /MP -fms-compatibility-version=14 %(AdditionalOptions)</AdditionalOptions>
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<LanguageStandard>stdcpp20</LanguageStandard> <LanguageStandard>stdcpp17</LanguageStandard>
<DebugInformationFormat>None</DebugInformationFormat> <DebugInformationFormat>None</DebugInformationFormat>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
</ClCompile> </ClCompile>
@ -188,10 +182,10 @@
<LanguageStandard_C>stdc17</LanguageStandard_C> <LanguageStandard_C>stdc17</LanguageStandard_C>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<PrecompiledHeaderOutputFile /> <PrecompiledHeaderOutputFile />
<AdditionalOptions>/Zc:twoPhase- /MP %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:twoPhase- /MP -fms-compatibility-version=14 %(AdditionalOptions)</AdditionalOptions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<LanguageStandard>stdcpp20</LanguageStandard> <LanguageStandard>stdcpp17</LanguageStandard>
<DebugInformationFormat>None</DebugInformationFormat> <DebugInformationFormat>None</DebugInformationFormat>
</ClCompile> </ClCompile>
<Link> <Link>
@ -214,10 +208,12 @@
<LanguageStandard_C>stdc17</LanguageStandard_C> <LanguageStandard_C>stdc17</LanguageStandard_C>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<PrecompiledHeaderOutputFile /> <PrecompiledHeaderOutputFile />
<AdditionalOptions>/Zc:twoPhase- /MP %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:twoPhase- /MP -fms-compatibility-version=14 %(AdditionalOptions)</AdditionalOptions>
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<LanguageStandard>stdcpp20</LanguageStandard> <LanguageStandard>stdcpp17</LanguageStandard>
<DebugInformationFormat>None</DebugInformationFormat> <DebugInformationFormat>None</DebugInformationFormat>
<TreatAngleIncludeAsExternal>true</TreatAngleIncludeAsExternal>
<DisableAnalyzeExternal>true</DisableAnalyzeExternal>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
@ -239,10 +235,10 @@
<LanguageStandard_C>stdc17</LanguageStandard_C> <LanguageStandard_C>stdc17</LanguageStandard_C>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<PrecompiledHeaderOutputFile /> <PrecompiledHeaderOutputFile />
<AdditionalOptions>/Zc:twoPhase- /MP %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/Zc:twoPhase- /MP -fms-compatibility-version=14 %(AdditionalOptions)</AdditionalOptions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<CompileAs>Default</CompileAs> <CompileAs>Default</CompileAs>
<LanguageStandard>stdcpp20</LanguageStandard> <LanguageStandard>stdcpp17</LanguageStandard>
<DebugInformationFormat>None</DebugInformationFormat> <DebugInformationFormat>None</DebugInformationFormat>
</ClCompile> </ClCompile>
<Link> <Link>
@ -256,4 +252,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project> </Project>

View File

@ -1,9 +1,9 @@
#include "Autoarr.h" #include "Autoarr.h"
Autoarr_define(uint8) Autoarr_define(uint8);
Autoarr_define(int8) Autoarr_define(int8);
Autoarr_define(uint16) Autoarr_define(uint16);
Autoarr_define(int16) Autoarr_define(int16);
Autoarr_define(uint32); Autoarr_define(uint32);
Autoarr_define(int32); Autoarr_define(int32);
Autoarr_define(uint64); Autoarr_define(uint64);

View File

@ -35,6 +35,7 @@ extern "C" {
#pragma GCC error "unknown compiler" #pragma GCC error "unknown compiler"
#endif #endif
#ifdef _MSC_VER #ifdef _MSC_VER
#define IFWIN(YES, NO) YES #define IFWIN(YES, NO) YES
#define IFMSC(YES, NO) YES #define IFMSC(YES, NO) YES
@ -48,9 +49,6 @@ extern "C" {
#pragma GCC error "unknown compiler" #pragma GCC error "unknown compiler"
#endif #endif
#ifndef NULL
#define NULL ((void*)0)
#endif
#if __cplusplus #if __cplusplus
} }

View File

@ -24,9 +24,9 @@ typedef enum __attribute__((__packed__)) my_type {
UniversalType, UniversalType,
AutoarrInt8Ptr, AutoarrUInt8Ptr, AutoarrInt16Ptr, AutoarrUInt16Ptr, AutoarrInt8Ptr, AutoarrUInt8Ptr, AutoarrInt16Ptr, AutoarrUInt16Ptr,
AutoarrInt32Ptr, AutoarrUInt32Ptr, AutoarrInt64Ptr, AutoarrUInt64Ptr, AutoarrInt32Ptr, AutoarrUInt32Ptr, AutoarrInt64Ptr, AutoarrUInt64Ptr,
AutoarrUnitypePtr, AutoarrKVPairPtr AutoarrUnitypePtr, AutoarrKVPairPtr, knSocketPtr
} my_type; } my_type;
#define my_type_last AutoarrKVPairPtr #define my_type_last knSocketPtr
const char* my_type_name(my_type t); const char* my_type_name(my_type t);

View File

@ -33,7 +33,7 @@ void print_dtsod(Hashtable* dtsod){
} }
void test_dtsod(){ void test_dtsod(){
//optime(__func__,1,({ optime(__func__,1,({
printf("\e[96m-------------[test_dtsod]-------------\n"); printf("\e[96m-------------[test_dtsod]-------------\n");
Hashtable* dtsod; Hashtable* dtsod;
char* s; char* s;
@ -61,5 +61,5 @@ void test_dtsod(){
})); }));
free(s); free(s);
//})); }));
} }

View File

@ -63,7 +63,7 @@ Unitype gett(Hashtable* ht){
void test_hashtable(){ void test_hashtable(){
optime("test_hashtable",1,({ optime("test_hashtable",1,({
printf("\e[96m-----------[test_hashtable]------------\n"); printf("\e[96m-----------[test_hashtable]-----------\n");
Hashtable* ht=Hashtable_create(); Hashtable* ht=Hashtable_create();
printf("\e[92mhashtable created\n"); printf("\e[92mhashtable created\n");
print_hashtable(ht); print_hashtable(ht);

View File

@ -7,7 +7,7 @@ void printstnode(STNode* node){
"\n address: %p\n value: ",sizeof(STNode),node); "\n address: %p\n value: ",sizeof(STNode),node);
printuni(node->value); printuni(node->value);
// prints pointers to all existing branches // prints pointers to all existing branches
printf("\n branches: %p\n", node->branches); /* printf("\n branches: %p\n", node->branches);
if(node->branches) for(uint8 i=0;i<8;i++){ if(node->branches) for(uint8 i=0;i<8;i++){
printf(" \e[90m[%u]=%p\n",i,node->branches[i]); printf(" \e[90m[%u]=%p\n",i,node->branches[i]);
if(node->branches[i]) if(node->branches[i])
@ -18,12 +18,12 @@ void printstnode(STNode* node){
printf(" \e[90m[%u]=%p\n",iii,node->branches[i][ii][iii]); printf(" \e[90m[%u]=%p\n",iii,node->branches[i][ii][iii]);
} }
} } */
} }
void test_searchtree(){ void test_searchtree(){
optime("test_searchtree",1,({ optime("test_searchtree",1,({
printf("\e[96m-----------[test_searchtree]-----------\n"); printf("\e[96m-----------[test_searchtree]----------\n");
STNode* node=STNode_create(); STNode* node=STNode_create();
printf("\e[92mnode created\n"); printf("\e[92mnode created\n");
printf("push:\e[94m\n "); printf("push:\e[94m\n ");

View File

@ -3,7 +3,7 @@
void test_string(){ void test_string(){
optime(__func__,1,({ optime(__func__,1,({
printf("\e[96m-------------[test_string]-------------\n"); printf("\e[96m-------------[test_string]------------\n");
char c[]="0123456789abcdef"; char c[]="0123456789abcdef";
string s={.ptr=c, .length=cptr_length(c)}; string s={.ptr=c, .length=cptr_length(c)};
if(s.length!=sizeof(c)-1) throw("string created with incorrect length"); if(s.length!=sizeof(c)-1) throw("string created with incorrect length");

View File

@ -14,6 +14,8 @@ void test_hash_functions();
void test_hashtable(); void test_hashtable();
void test_dtsod(); void test_dtsod();
#define PRINT_SIZEOF(T) printf("\e[94m" #T " size: \e[96m" IFWIN("%llu", "%lu") "\n", sizeof(T))
#if __cplusplus #if __cplusplus
} }
#endif #endif