This commit is contained in:
MapleSign 2018-08-03 11:39:16 +08:00
parent 6e9af90670
commit 6b5dd60ea3
8 changed files with 285 additions and 70 deletions

View File

@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="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>15.0</VCProjectVersion>
<ProjectGuid>{77936A90-7A47-462C-BB65-1F4297AA853C}</ProjectGuid>
<RootNamespace>ZEStandardLibraries</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.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>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</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 />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="communicate\communicate.h" />
<ClInclude Include="error\error.h" />
<ClInclude Include="graph\graph.h" />
<ClInclude Include="id\id.h" />
<ClInclude Include="list\list.h" />
<ClInclude Include="list\list_expand.h" />
<ClInclude Include="stack\stack.h" />
<ClInclude Include="stack\stack_expand.h" />
<ClInclude Include="test.h" />
<ClInclude Include="tree\tree.h" />
<ClInclude Include="tree\tree_expand.h" />
<ClInclude Include="type\type.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="communicate\communicate.c" />
<ClCompile Include="error\error.c" />
<ClCompile Include="graph\graph.c" />
<ClCompile Include="id\id.c" />
<ClCompile Include="list\list.c" />
<ClCompile Include="list\list_expand.c" />
<ClCompile Include="stack\stack.c" />
<ClCompile Include="stack\stack_expand.c" />
<ClCompile Include="test.c" />
<ClCompile Include="tree\tree.c" />
<ClCompile Include="tree\tree_expand.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<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>
<ClInclude Include="communicate\communicate.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="error\error.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="graph\graph.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="id\id.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="list\list.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="list\list_expand.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="stack\stack.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="stack\stack_expand.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="tree\tree.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="tree\tree_expand.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="type\type.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="test.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="communicate\communicate.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="error\error.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="graph\graph.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="id\id.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="list\list.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="list\list_expand.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="stack\stack.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="stack\stack_expand.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="tree\tree.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="tree\tree_expand.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="test.c">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

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

10
id/id.c
View File

@ -1,11 +1,3 @@
//
// id.c
// ZE-Standard-Libraries
//
// Created by 胡一兵 on 2018/7/25.
// Copyright © 2018年 ZE. All rights reserved.
//
#include "id.h"
void init_rand(void) {
@ -247,4 +239,4 @@ int freeS_id(SID *s_id){
}
free(s_id);
return 0;
}
}

12
id/id.h
View File

@ -1,11 +1,3 @@
//
// id.h
// ZE-Standard-Libraries
//
// Created by 胡一兵 on 2018/7/25.
// Copyright © 2018年 ZE. All rights reserved.
//
#ifndef id_h
#define id_h
@ -23,11 +15,9 @@ typedef struct s_id{
unsigned int deep;
}SID;
/*有关id的函数*/
void init_rand(void);
unsigned long long getId(void);
/*有关s_id函数*/
SID *getS_id(unsigned int type ,unsigned int deep_level);
int fitS_id(const SID *fs_id, const SID *ss_id);
@ -39,4 +29,4 @@ SID *asciiStringToS_id(const char *string);
SID *initS_id(unsigned int deep_level);
int freeS_id(SID *s_id);
#endif /* id_h */
#endif /* id_h */

View File

@ -71,4 +71,4 @@ static int if_safeModeForNode;
static List *node_list; //储存声明过的节点.
static List *list_list; //储存声明过的链表.
#endif
#endif

View File

@ -1,42 +1,42 @@
#ifndef LIST_EXPAND_H
#define LIST_EXPAND_H
#include "list.c"
Node *nodeWithInt(int);//快速初始化一个单一值节点并赋值
Node *nodeWithDouble(double);//快速初始化一个节单一值点并赋值
Node *nodeWithString(const char *);//快速初始化一个单一值节点并赋值
Node *nodeWithPointer(void *);//快速初始化一个单一值节点并赋值
Node *nodeWithComplex(void);//快速初始化一个复合值节点并赋值
int addValueForComplex(Node *, int type, void *value);//为复合节点添加值
int addIntForComplex(Node *, int);//为复合节点添加一个特定类型的值
int addDoubleForComplex(Node *, double);//为复合节点添加一个特定类型的值
int addStringForComplex(Node *, char *);//为复合节点添加一个特定类型的值
int addPointerForComplex(Node *, void *);//为复合节点添加一个特定类型的值
Node *findByIndexForNode(List *, unsigned long long);//根据位置查找一个节点
Node *findByIntForNode(List *, int);//依照特定类型查找一个节点
Node *findByDoubleForNode(List *, double);//依照特定类型查找一个节点
Node *findByStringForNode(List *, char *);//依照特定类型查找一个节点
Node *findByPointerForNode(List *, void *);//依照特定类型查找一个节点
List *m_findByIntForNode(List*, int);//根据位置查找所有匹配的节点
List *m_findByDoubleForNode(List*, double);//根据位置查找所有匹配的节点
List *m_findByStringForNode(List*, char *);//根据位置查找所有匹配的节点
List *m_findByPointerForNode(List*, void *);//根据位置查找所有匹配的节点
void printListInfo(List *p_list,int priority);//打印列表的详细信息
void printNodeInfo(Node *p_node,int priority);//打印节点的详细信息
void printList(List *);//打印列表
void printNode(Node *p_node);//打印节点
int getByIntForNode(Node *);//直接得到节点的值
double getByDoubleForNode(Node *);//直接得到节点的值
char *getByStringForNode(Node *);//直接得到节点的值
void *getByPointerForNode(Node *);//直接得到节点的值
unsigned long long getIndexByNode(List *p_list,Node *p_node);
int listThrough(List *p_list, int (*p_func)(unsigned int type, void *value));//遍历链表并不断调用目标函数。目标函数将接受节点储存值的指针及其类型。
#ifndef LIST_EXPAND_H
#define LIST_EXPAND_H
#include "list.c"
Node *nodeWithInt(int);//快速初始化一个单一值节点并赋值
Node *nodeWithDouble(double);//快速初始化一个节单一值点并赋值
Node *nodeWithString(const char *);//快速初始化一个单一值节点并赋值
Node *nodeWithPointer(void *);//快速初始化一个单一值节点并赋值
Node *nodeWithComplex(void);//快速初始化一个复合值节点并赋值
int addValueForComplex(Node *, int type, void *value);//为复合节点添加值
int addIntForComplex(Node *, int);//为复合节点添加一个特定类型的值
int addDoubleForComplex(Node *, double);//为复合节点添加一个特定类型的值
int addStringForComplex(Node *, char *);//为复合节点添加一个特定类型的值
int addPointerForComplex(Node *, void *);//为复合节点添加一个特定类型的值
Node *findByIndexForNode(List *, unsigned long long);//根据位置查找一个节点
Node *findByIntForNode(List *, int);//依照特定类型查找一个节点
Node *findByDoubleForNode(List *, double);//依照特定类型查找一个节点
Node *findByStringForNode(List *, char *);//依照特定类型查找一个节点
Node *findByPointerForNode(List *, void *);//依照特定类型查找一个节点
List *m_findByIntForNode(List*, int);//根据位置查找所有匹配的节点
List *m_findByDoubleForNode(List*, double);//根据位置查找所有匹配的节点
List *m_findByStringForNode(List*, char *);//根据位置查找所有匹配的节点
List *m_findByPointerForNode(List*, void *);//根据位置查找所有匹配的节点
void printListInfo(List *p_list,int priority);//打印列表的详细信息
void printNodeInfo(Node *p_node,int priority);//打印节点的详细信息
void printList(List *);//打印列表
void printNode(Node *p_node);//打印节点
int getByIntForNode(Node *);//直接得到节点的值
double getByDoubleForNode(Node *);//直接得到节点的值
char *getByStringForNode(Node *);//直接得到节点的值
void *getByPointerForNode(Node *);//直接得到节点的值
unsigned long long getIndexByNode(List *p_list,Node *p_node);
int listThrough(List *p_list, int (*p_func)(unsigned int type, void *value));//遍历链表并不断调用目标函数。目标函数将接受节点储存值的指针及其类型。
unsigned long long calListMemory(List *);
#endif
#endif

View File

@ -1,11 +1,3 @@
//
// type.h
// ZE-Standard-Libraries
//
// Created by 胡一兵 on 2018/7/23.
// Copyright © 2018年 ZE. All rights reserved.
//
#ifndef type_h
#define type_h
@ -33,4 +25,4 @@
#define DATA_BIT 5
#endif /* type_h */
#endif /* type_h */