diff --git a/Btree/btree_header.c b/Btree/btree_header.c --- a/Btree/btree_header.c +++ b/Btree/btree_header.c @@ -1,243 +1,244 @@ /** * @file btree_header.c B+Tree header functions * * $Id: btree_header.c,v 1.14 2002/06/23 10:28:05 chipx86 Exp $ * * @Copyright (C) 1999-2002 The GNUpdate Project. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include "db_internal.h" #include "config.h" +#include void * btreeReadHeader(GdbBlock *block, const char *buffer, void *extra) { BTree *tree; int counter = 0; MEM_CHECK_RET_ZERO(tree = (BTree *)malloc(sizeof(BTree))); memset(tree, 0, sizeof(BTree)); tree->block = block; tree->order = gdbGet8(buffer, &counter); tree->size = gdbGet32(buffer, &counter); tree->root = gdbGet32(buffer, &counter); tree->leftLeaf = gdbGet32(buffer, &counter); tree->minLeaf = (tree->order / 2); tree->minInt = ((tree->order + 1) / 2) - 1; return tree; } void btreeWriteHeader(GdbBlock *block, char **buffer, unsigned long *size) { int counter = 0; BTree *tree; tree = (BTree *)block->detail; *size = BTREE_HEADER_DATA_SIZE; MEM_CHECK(*buffer = (char *)malloc(BTREE_HEADER_DATA_SIZE)); gdbPut8(*buffer, &counter, tree->order); gdbPut32(*buffer, &counter, tree->size); gdbPut32(*buffer, &counter, tree->root); gdbPut32(*buffer, &counter, tree->leftLeaf); } void * btreeCreateHeader(GdbBlock *block, void *extra) { BTree *tree; MEM_CHECK_RET_ZERO(tree = (BTree *)malloc(sizeof(BTree))); memset(tree, 0, sizeof(BTree)); tree->block = block; tree->order = 19; tree->minLeaf = (tree->order / 2); tree->minInt = ((tree->order + 1) / 2) - 1; return tree; } void btreeDestroyHeader(void *tree) { if (tree == NULL) return; free(tree); } void btreeSetRootNode(BTree *tree, offset_t offset) { FILE *fp; GdbBlock *block; if (tree == NULL) return; block = tree->block; fp = block->db->fp; tree->root = offset; //printf("%s:%i - setting root = %i\n", __FILE__, __LINE__, offset); fseek(fp, block->offset + GDB_BLOCK_HEADER_SIZE + BTREE_ROOT_OFFSET, SEEK_SET); fwrite(&offset, sizeof(offset_t), 1, fp); fflush(fp); } void btreeSetLeftLeaf(BTree *tree, offset_t offset) { FILE *fp; GdbBlock *block; if (tree == NULL) return; block = tree->block; fp = block->db->fp; tree->leftLeaf = offset; fseek(fp, block->offset + GDB_BLOCK_HEADER_SIZE + BTREE_LEFT_LEAF_OFFSET, SEEK_SET); fwrite(&offset, sizeof(offset_t), 1, fp); fflush(fp); } void btreeSetTreeSize(BTree *tree, unsigned long size) { FILE *fp; GdbBlock *block; if (tree == NULL) return; block = tree->block; fp = block->db->fp; tree->size = size; fseek(fp, block->offset + GDB_BLOCK_HEADER_SIZE + BTREE_SIZE_OFFSET, SEEK_SET); fwrite(&size, sizeof(unsigned long), 1, fp); fflush(fp); } offset_t btreeGetRootNode(BTree *tree) { FILE *fp; GdbBlock *block; if (tree == NULL) return 0; block = tree->block; fp = block->db->fp; tree->root = 0; // GDB_BLOCK_HEADER_SIZE = 15 // BTREE_ROOT_OFFSET = 5 int r = fseek(fp, block->offset + GDB_BLOCK_HEADER_SIZE + BTREE_ROOT_OFFSET, SEEK_SET); if (r < 0) { btreeSetError("Error: B+Tree: Unable to fseekt to the root node offset."); return 0; } if (fread(&tree->root, sizeof(offset_t), 1, fp) != 1) { btreeSetError("Error: B+Tree: Unable to read the root node offset."); return 0; } return tree->root; } offset_t btreeGetLeftLeaf(BTree *tree) { FILE *fp; GdbBlock *block; if (tree == NULL) return 0; block = tree->block; fp = block->db->fp; fseek(fp, block->offset + GDB_BLOCK_HEADER_SIZE + BTREE_LEFT_LEAF_OFFSET, SEEK_SET); if (fread(&tree->leftLeaf, sizeof(offset_t), 1, fp) != 1) { btreeSetError("Error: B+Tree: Unable to read the left leaf offset."); return 0; } return tree->leftLeaf; } unsigned long btreeGetTreeSize(BTree *tree) { FILE *fp; GdbBlock *block; if (tree == NULL) return 0; block = tree->block; fp = block->db->fp; fseek(fp, block->offset + GDB_BLOCK_HEADER_SIZE + BTREE_SIZE_OFFSET, SEEK_SET); if (fread(&tree->size, sizeof(unsigned long), 1, fp) != 1) { btreeSetError("Error: B+Tree: Unable to read the tree size."); return 0; } return tree->size; } diff --git a/aspell-0.60.6.1/linux/Makefile.linux b/aspell-0.60.6.1/linux/Makefile.linux --- a/aspell-0.60.6.1/linux/Makefile.linux +++ b/aspell-0.60.6.1/linux/Makefile.linux @@ -1,150 +1,153 @@ #!/usr/bin/make # # This makefile generated by LgiIde # http://www.memecode.com/lgi.php # .SILENT : CC = gcc CPP = g++ Target = aspell-dist-060 ifndef Build Build = Debug endif MakeDir := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) BuildDir = $(Build) -Flags = -fPIC -fno-inline -fpermissive -Wno-format-truncation +CFlags = -MMD -MP -g -fPIC -fno-inline +CppFlags = $CFlags -fpermissive -std=c++14 ifeq ($(Build),Debug) - Flags += -MMD -MP -g -std=c++14 + CFlags += -g + CppFlags += -g Tag = d Defs = -D_DEBUG -DLINUX -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DPOSIX -DASPELL060_EXPORTS -DASPELLDIST060_EXPORTS Libs = Inc = \ -I../modules/speller/default \ -I./ \ -I../interfaces/cc \ -I../gen \ -I../common \ -I./ else - Flags += -MMD -MP -s -Os -std=c++14 + CFlags += -s -Os + CppFlags += -s -Os Defs = -DLINUX -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DPOSIX -DASPELL060_EXPORTS -DASPELLDIST060_EXPORTS Libs = Inc = \ -I../modules/speller/default \ -I./ \ -I../interfaces/cc \ -I../gen \ -I../common \ -I./ endif # Dependencies Source = ../win32/api-glue.cpp \ ../prog/prezip.c \ ../modules/tokenizer/basic.cpp \ ../modules/speller/default/writable.cpp \ ../modules/speller/default/typo_editdist.cpp \ ../modules/speller/default/suggest.cpp \ ../modules/speller/default/speller_impl.cpp \ ../modules/speller/default/readonly_ws.cpp \ ../modules/speller/default/primes.cpp \ ../modules/speller/default/phonetic.cpp \ ../modules/speller/default/phonet.cpp \ ../modules/speller/default/multi_ws.cpp \ ../modules/speller/default/leditdist.cpp \ ../modules/speller/default/language.cpp \ ../modules/speller/default/editdist.cpp \ ../modules/speller/default/data.cpp \ ../modules/speller/default/affix.cpp \ ../modules/filter/url.cpp \ ../modules/filter/texinfo.cpp \ ../modules/filter/tex.cpp \ ../modules/filter/sgml.cpp \ ../modules/filter/nroff.cpp \ ../modules/filter/email.cpp \ ../modules/filter/context.cpp \ ../lib/word_list-c.cpp \ ../lib/string_enumeration-c.cpp \ ../lib/speller-c.cpp \ ../lib/new_fmode.cpp \ ../lib/new_filter.cpp \ ../lib/new_config.cpp \ ../lib/new_checker.cpp \ ../lib/info-c.cpp \ ../lib/find_speller.cpp \ ../lib/config-c.cpp \ ../lib/can_have_error-c.cpp \ ../common/tokenizer.cpp \ ../common/strtonum.cpp \ ../common/string_map.cpp \ ../common/string_list.cpp \ ../common/string.cpp \ ../common/speller.cpp \ ../common/posib_err.cpp \ ../common/objstack.cpp \ ../common/itemize.cpp \ ../common/iostream.cpp \ ../common/info.cpp \ ../common/gettext_init.cpp \ ../common/getdata.cpp \ ../common/fstream.cpp \ ../common/filter.cpp \ ../common/file_util.cpp \ ../common/file_data_util.cpp \ ../common/errors.cpp \ ../common/error.cpp \ ../common/document_checker.cpp \ ../common/convert.cpp \ ../common/config.cpp \ ../common/can_have_error.cpp \ ../common/cache.cpp SourceC := $(filter %.c,$(Source)) ObjectsC := $(SourceC:.c=.o) SourceCpp := $(filter %.cpp,$(Source)) ObjectsCpp := $(SourceCpp:.cpp=.o) Objects := $(notdir $(ObjectsC) $(ObjectsCpp)) Objects := $(addprefix $(BuildDir)/,$(Objects)) Deps := $(patsubst %.o,%.d,$(Objects)) $(BuildDir)/%.o: %.c mkdir -p $(@D) echo $(notdir $<) [$(Build)] - $(CC) $(Inc) $(Flags) $(Defs) -c $< -o $@ + $(CC) $(Inc) $(CFlags) $(Defs) -c $< -o $@ $(BuildDir)/%.o: %.cpp mkdir -p $(@D) echo $(notdir $<) [$(Build)] - $(CPP) $(Inc) $(Flags) $(Defs) -c $< -o $@ + $(CPP) $(Inc) $(CppFlags) $(Defs) -c $< -o $@ # Target TargetFile = lib$(Target)$(Tag).so $(TargetFile) : $(Objects) mkdir -p $(BuildDir) @echo Linking $(TargetFile) [$(Build)]... $(CPP)$s -shared \ \ -o $(BuildDir)/$(TargetFile) \ $(Objects) \ $(Libs) @echo Done. -include $(Objects:.o=.d) # Clean out targets clean : rm -rf $(BuildDir) @echo Cleaned $(BuildDir) VPATH=$(BuildDir) \ ../win32 \ ../prog \ ../modules/tokenizer \ ../modules/speller/default \ ../modules/filter \ ../lib \ ../common diff --git a/bzip2-1.0.6/linux/Makefile.linux b/bzip2-1.0.6/linux/Makefile.linux --- a/bzip2-1.0.6/linux/Makefile.linux +++ b/bzip2-1.0.6/linux/Makefile.linux @@ -1,78 +1,81 @@ #!/usr/bin/make # # This makefile generated by LgiIde # http://www.memecode.com/lgi.php # .SILENT : CC = gcc CPP = g++ Target = bzip2 ifndef Build Build = Debug endif MakeDir := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) BuildDir = $(Build) -Flags = -fPIC -fno-inline -fpermissive -Wno-format-truncation +CFlags = -MMD -MP -g -fPIC -fno-inline +CppFlags = $CFlags -fpermissive -std=c++14 ifeq ($(Build),Debug) - Flags += -MMD -MP -g -std=c++14 + CFlags += -g + CppFlags += -g Tag = d Defs = -D_DEBUG -DLINUX -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DPOSIX Libs = Inc = \ -I../ else - Flags += -MMD -MP -s -Os -std=c++14 + CFlags += -s -Os + CppFlags += -s -Os Defs = -DLINUX -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DPOSIX Libs = Inc = \ -I../ endif # Dependencies Source = ../randtable.c \ ../huffman.c \ ../decompress.c \ ../crctable.c \ ../compress.c \ ../bzlib.c \ ../blocksort.c SourceC := $(filter %.c,$(Source)) ObjectsC := $(SourceC:.c=.o) SourceCpp := $(filter %.cpp,$(Source)) ObjectsCpp := $(SourceCpp:.cpp=.o) Objects := $(notdir $(ObjectsC) $(ObjectsCpp)) Objects := $(addprefix $(BuildDir)/,$(Objects)) Deps := $(patsubst %.o,%.d,$(Objects)) $(BuildDir)/%.o: %.c mkdir -p $(@D) echo $(notdir $<) [$(Build)] - $(CC) $(Inc) $(Flags) $(Defs) -c $< -o $@ + $(CC) $(Inc) $(CFlags) $(Defs) -c $< -o $@ $(BuildDir)/%.o: %.cpp mkdir -p $(@D) echo $(notdir $<) [$(Build)] - $(CPP) $(Inc) $(Flags) $(Defs) -c $< -o $@ + $(CPP) $(Inc) $(CppFlags) $(Defs) -c $< -o $@ # Target TargetFile = lib$(Target)$(Tag).a $(TargetFile) : $(Objects) mkdir -p $(BuildDir) @echo Linking $(TargetFile) [$(Build)]... ar rcs $(BuildDir)/$(TargetFile) $(Objects) @echo Done. -include $(Objects:.o=.d) # Clean out targets clean : rm -rf $(BuildDir) @echo Cleaned $(BuildDir) VPATH=$(BuildDir) \ ../