summary refs log blame commit diff stats
path: root/src/common/tree.h
blob: 848f5abfa54e634421edc14f4354b242fbc00e85 (plain) (tree)


















                                                                            

                      







                                                                             
                                                                                     
                                               
                                            

                                                                  

                                      

      
/* HexChat
 * Copyright (C) 1998-2010 Peter Zelezny.
 * Copyright (C) 2009-2013 Berke Viktor.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

#ifndef HEXCHAT_TREE_H
#define HEXCHAT_TREE_H

typedef struct _tree tree;

typedef int (tree_cmp_func) (const void *keya, const void *keyb, void *data);
typedef int (tree_traverse_func) (const void *key, void *data);

tree *tree_new (tree_cmp_func *cmp, void *data);
void tree_destroy (tree *t);
void *tree_find (tree *t, const void *key, tree_cmp_func *cmp, void *data, int *pos);
int tree_remove (tree *t, void *key, int *pos);
void *tree_remove_at_pos (tree *t, int pos);
void tree_foreach (tree *t, tree_traverse_func *func, void *data);
int tree_insert (tree *t, void *key);
void tree_append (tree* t, void *key);
int tree_size (tree *t);

#endif
n32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|x64"> <Configuration>Release</Configuration> <Platform>x64</Platform> </ProjectConfiguration> </ItemGroup> <ItemGroup> <ClInclude Include="printevents.h" /> <ClInclude Include="tclplugin.h" /> </ItemGroup> <ItemGroup> <ClCompile Include="tclplugin.c" /> </ItemGroup> <ItemGroup> <None Include="tcl.def" /> </ItemGroup> <PropertyGroup Label="Globals"> <ProjectGuid>{2773666A-8CFC-4533-A043-EAD59F16A1C7}</ProjectGuid> <Keyword>Win32Proj</Keyword> <RootNamespace>tcl</RootNamespace> <ProjectName>tcl</ProjectName> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>MultiByte</CharacterSet> <PlatformToolset>WDK7</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>MultiByte</CharacterSet> <PlatformToolset>WDK7</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> </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" /> <Import Project="..\..\win32\hexchat-xp.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="..\..\win32\hexchat-xp.props" /> </ImportGroup> <PropertyGroup Label="UserMacros" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <LinkIncremental>false</LinkIncremental> <TargetName>$(TclOutput)</TargetName> <OutDir>$(HexChatBin)</OutDir> <IntDir>$(HexChatObj)$(ProjectName)\</IntDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <LinkIncremental>false</LinkIncremental> <TargetName>$(TclOutput)</TargetName> <OutDir>$(HexChatBin)</OutDir> <IntDir>$(HexChatObj)$(ProjectName)\</IntDir> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> <PrecompiledHeader>NotUsing</PrecompiledHeader> <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;TCL_EXPORTS;TCL_DLL="$(TclLib).dll";$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>$(TclPath)\include;..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <MultiProcessorCompilation>true</MultiProcessorCompilation> </ClCompile> <Link> <SubSystem>Windows</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> <AdditionalLibraryDirectories>$(TclPath)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalDependencies>"$(TclLib).lib";%(AdditionalDependencies)</AdditionalDependencies> <ModuleDefinitionFile>tcl.def</ModuleDefinitionFile> <DelayLoadDLLs>$(TclLib).dll;%(DelayLoadDLLs)</DelayLoadDLLs> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ClCompile> <PrecompiledHeader>NotUsing</PrecompiledHeader> <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;TCL_EXPORTS;TCL_DLL="$(TclLib).dll";$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>$(TclPath)\include;..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <MultiProcessorCompilation>true</MultiProcessorCompilation> </ClCompile> <Link> <SubSystem>Windows</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> <AdditionalLibraryDirectories>$(TclPath)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalDependencies>"$(TclLib).lib";%(AdditionalDependencies)</AdditionalDependencies> <ModuleDefinitionFile>tcl.def</ModuleDefinitionFile> <DelayLoadDLLs>$(TclLib).dll;%(DelayLoadDLLs)</DelayLoadDLLs> </Link> </ItemDefinitionGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> </Project>