pdatabase-cvs Mailing List for pdb
Brought to you by:
paralizer
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(17) |
Feb
(30) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(5) |
Oct
(2) |
Nov
|
Dec
|
From: Michael L. <par...@us...> - 2005-10-01 05:53:36
|
Update of /cvsroot/pdatabase/pdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2022/src Modified Files: Makefile Log Message: Updated makefile to handle target clean better Index: Makefile =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile 3 Mar 2005 20:52:20 -0000 1.6 +++ Makefile 1 Oct 2005 01:16:54 -0000 1.7 @@ -29,11 +29,20 @@ OBJS = $(SRC_FILES:%.c=%.o) DOBJS = $(OBJS:%.o=d_%.o) +# Need this for the 'clean' target. +EXISTING_OBJS = $(wildcard *.o) + all: $(BIN) debug: $(DBIN) clean: - @rm *.o + @if [ ! -z "$(EXISTING_OBJS)" ]; \ + then \ + rm *.o ; \ + echo "Cleaned files."; \ + else \ + echo "No files to clean."; \ + fi $(BIN): $(OBJS) $(CC) $(FLAGS) $(LDFLAGS) $(OBJS) -o $(BIN) |
From: Michael L. <par...@us...> - 2005-10-01 05:11:28
|
Update of /cvsroot/pdatabase/pdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2022 Modified Files: pdb.pws Log Message: Updated makefile to handle target clean better Index: pdb.pws =================================================================== RCS file: /cvsroot/pdatabase/pdb/pdb.pws,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- pdb.pws 23 Sep 2005 02:24:36 -0000 1.20 +++ pdb.pws 1 Oct 2005 01:16:54 -0000 1.21 @@ -6,7 +6,7 @@ clean before build=false [filenumbers] -0=68 +0=355 1=36 2=132 3=49 |
From: Michael L. <par...@us...> - 2005-09-23 02:24:44
|
Update of /cvsroot/pdatabase/pdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7569 Modified Files: pdb.pws Log Message: removed unused variable i Index: pdb.pws =================================================================== RCS file: /cvsroot/pdatabase/pdb/pdb.pws,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- pdb.pws 27 Feb 2005 02:39:06 -0000 1.19 +++ pdb.pws 23 Sep 2005 02:24:36 -0000 1.20 @@ -6,11 +6,11 @@ clean before build=false [filenumbers] -0=177 -1=1 -2=389 -3=1 -4=455 +0=68 +1=36 +2=132 +3=49 +4=275 5=28 6=28 @@ -29,9 +29,9 @@ filter.dir.ignore.hidden=0 [filelist] -0=/home/para/Projects/pdb/include/pdb.h -1=/home/para/Projects/pdb/include/pdb_types.h -2=/home/para/Projects/pdb/src/binarytree.c +0=/home/para/Projects/pdb/src/pdb_parse.c +1=/home/para/Projects/pdb/include/pdb.h +2=/home/para/Projects/pdb/include/pdb_types.h 3=/home/para/Projects/pdb/src/pdb.c 4=/home/para/Projects/pdb/src/pdb_types.c 5=/home/para/Projects/pdb/src/str.c |
From: Michael L. <par...@us...> - 2005-09-23 02:24:44
|
Update of /cvsroot/pdatabase/pdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7569/src Modified Files: pdb_parse.c Log Message: removed unused variable i Index: pdb_parse.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/pdb_parse.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- pdb_parse.c 22 Sep 2005 00:38:23 -0000 1.7 +++ pdb_parse.c 23 Sep 2005 02:24:36 -0000 1.8 @@ -316,7 +316,7 @@ /* * If the byte is a comment, skip comment. - * Return 1 if it is a commant, 0 if not. + * Return 1 if it is a comment, 0 if not. */ #ifdef PDB_ENABLE_COMMENTS int pdb_parse_comment(FILE* fptr, int* line, char byte) { @@ -324,10 +324,8 @@ /* * Feed to EOL. */ - int i = 0; while (!feof(fptr)) { byte = fgetc(fptr); - ++i; if (byte == '\n') { (*line)++; return 1; |
From: Michael L. <par...@us...> - 2005-09-22 00:39:26
|
Update of /cvsroot/pdatabase/pdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2227/src Modified Files: pdb.c Log Message: fixed bug with hash comment falling back to parent node Index: pdb.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/pdb.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- pdb.c 22 Sep 2005 00:38:23 -0000 1.17 +++ pdb.c 22 Sep 2005 00:39:19 -0000 1.18 @@ -34,7 +34,7 @@ #include "list.h" #include "binarytree.h" -int main(int argc, char** argv) { +/*int main(int argc, char** argv) { printf(PDB_COMPILE_INFO); printf("\n--LOAD--\n\n"); @@ -46,7 +46,7 @@ if (dbptr) pdb_unload(dbptr); return 0; -} +}*/ /* |
From: Michael L. <par...@us...> - 2005-09-22 00:38:33
|
Update of /cvsroot/pdatabase/pdb/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2031/include Modified Files: pdb_types.h Log Message: fixed bug with hash comment falling back to parent node Index: pdb_types.h =================================================================== RCS file: /cvsroot/pdatabase/pdb/include/pdb_types.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- pdb_types.h 24 Feb 2005 16:48:38 -0000 1.8 +++ pdb_types.h 22 Sep 2005 00:38:23 -0000 1.9 @@ -78,6 +78,7 @@ */ struct pdb_node_types_t { int bitmask; + char* str; /* string name */ char* open_token; char* close_token; create_cb_t create_cb; @@ -128,6 +129,7 @@ DLLEXP int pdb_free_node(struct pdb_node_t* nptr); int pdb_standard_write_node(struct pdb* dbptr, FILE* fptr, struct pdb_node_t* nptr, int tabs); +char* pdb_node_type_name(int type); /* * Binary tree |
From: Michael L. <par...@us...> - 2005-09-22 00:38:33
|
Update of /cvsroot/pdatabase/pdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2031/src Modified Files: pdb.c pdb_parse.c pdb_types.c Log Message: fixed bug with hash comment falling back to parent node Index: pdb_types.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/pdb_types.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- pdb_types.c 27 Feb 2005 02:39:06 -0000 1.14 +++ pdb_types.c 22 Sep 2005 00:38:23 -0000 1.15 @@ -56,6 +56,7 @@ { /* Binary Tree */ TREE_NODE_TYPE, + "TREE_NODE", "{", "}", pdb_create_tree_node_cb, @@ -72,6 +73,7 @@ { /* Link List */ LIST_NODE_TYPE, + "LIST_NODE", "(", ")", pdb_create_list_node_cb, @@ -88,6 +90,7 @@ { /* Hash table */ HASH_NODE_TYPE, + "HASH_NODE", "[", "]", pdb_create_hash_node_cb, @@ -104,6 +107,7 @@ { /* String */ STRING_NODE_TYPE, + "STRING_NODE", NULL, /* standard load type (fallback) */ NULL, /* standard load type (fallback) */ pdb_create_string_node_cb, @@ -120,6 +124,7 @@ { /* Integer type */ INT_NODE_TYPE, + "INT_NODE", "'", "'", pdb_create_int_node_cb, @@ -136,6 +141,7 @@ { /* Abstract type */ ABSTRACT_NODE_TYPE, + "ABSTRACT_NODE", NULL, /* no loading from disk */ NULL, /* no loading from disk */ pdb_create_abstract_node_cb, @@ -156,6 +162,7 @@ * the last type in the array. */ LINK_NODE_TYPE, + "LINK_NODE", NULL, /* no loading from disk */ NULL, /* no loading from disk */ pdb_create_link_node_cb, @@ -171,7 +178,7 @@ }, { /* Terminating Entry */ - NO_NODE_TYPE, NULL, NULL, NULL, + NO_NODE_TYPE, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 } @@ -555,6 +562,15 @@ } + +/* + * Return string name of the node type. + */ +char* pdb_node_type_name(int type) { + return (pdb_types[type - 1].str); +} + + /****************** ****************** ****************** Binary Tree Node Type Index: pdb.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/pdb.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- pdb.c 24 Feb 2005 16:48:38 -0000 1.16 +++ pdb.c 22 Sep 2005 00:38:23 -0000 1.17 @@ -34,30 +34,19 @@ #include "list.h" #include "binarytree.h" -/*int main(int argc, char** argv) { +int main(int argc, char** argv) { printf(PDB_COMPILE_INFO); printf("\n--LOAD--\n\n"); - struct pdb* dbptr = pdb_load("/home/para/para.db"); + struct pdb* dbptr = pdb_load("/home/para/tmp.conf"); printf("\n--DEBUG--\n\n"); - struct pdb_node_t* nptr = pdb_query_node(dbptr, "modules"); - printf("%i ? %i\n", nptr->type, LIST_NODE_TYPE); - struct linkList* lptr = nptr->data; - struct linkNode* lnptr = lptr->root; - while (lnptr) { - nptr = lnptr->data; - printf("[%s]\n", nptr->id); - lnptr = lnptr->next; - } - - printf("\n--UNLOAD--\n\n"); if (dbptr) pdb_unload(dbptr); return 0; -}*/ +} /* Index: pdb_parse.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/pdb_parse.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- pdb_parse.c 8 Feb 2005 15:10:18 -0000 1.6 +++ pdb_parse.c 22 Sep 2005 00:38:23 -0000 1.7 @@ -75,8 +75,14 @@ * If comment (and enabled), skip token. */ #ifdef PDB_ENABLE_COMMENTS - if (!(quotes % 2) &&(pdb_parse_comment(fptr, line, byte))) + if (!(quotes % 2) && (pdb_parse_comment(fptr, line, byte))) { + /* + * Since comments cannot be in string literals, + * we can safely skip any following whitespaces. + */ + ws_end = 0; continue; + } #endif /* PDB_ENABLE_COMMENTS */ @@ -110,8 +116,9 @@ if (tptr) { if (*type != tptr->bitmask) { fprintf(stderr, "pdb_parse.c: pdb_get_token(): Invalid " - "closing block token on line %i. Closing type %i for " - "type %i.\n", *line, tptr->bitmask, *type); + "closing block token on line %i. Closing type %s for " + "type %s.\n", *line, pdb_node_type_name(tptr->bitmask), + pdb_node_type_name(*type)); free(sbuf); return NULL; } @@ -309,16 +316,18 @@ /* * If the byte is a comment, skip comment. - * Return 1 if it is a command, 0 if not. + * Return 1 if it is a commant, 0 if not. */ #ifdef PDB_ENABLE_COMMENTS int pdb_parse_comment(FILE* fptr, int* line, char byte) { - if (byte == '#') { + if (byte == PDB_COMMENT_CHAR) { /* * Feed to EOL. */ + int i = 0; while (!feof(fptr)) { byte = fgetc(fptr); + ++i; if (byte == '\n') { (*line)++; return 1; |
From: Michael L. <par...@us...> - 2005-03-03 20:52:47
|
Update of /cvsroot/pdatabase/pdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10710/src Modified Files: Makefile Log Message: Using new makefiles. Index: Makefile =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile 13 Feb 2005 19:20:55 -0000 1.5 +++ Makefile 3 Mar 2005 20:52:20 -0000 1.6 @@ -1,34 +1,48 @@ # Minimal Makefile # # By: Michael Laforest <paralizer -AT- users -DOT- sourceforge -DOT- net> +# +# $Header$ CC = gcc -CFLAGS = -Wall -g +# Universal cflags +CFLAGS = -Wall -pipe + +# Object flags +FLAGS = $(CFLAGS) -fPIC -O2 + +# Debug object flags +DFLAGS = $(CFLAGS) -fPIC -g + +# Linking flags LDFLAGS = -shared -DEPFLAGS = -fPIC -# Needed to recognize .c as a file suffix -.SUFFIXES: $(SUFFIXES) . +# Target binaries (always created as BIN) +BIN = pdb.so +DBIN = pdb-debug.so -BIN = pdb INCLUDES = -I. -I../include -OBJS = binarytree.o \ - hash.o \ - list.o \ - pdb.o \ - pdb_file.o \ - pdb_parse.o \ - pdb_types.o \ - str.o \ + +SRC_FILES = $(wildcard *.c) + +OBJS = $(SRC_FILES:%.c=%.o) +DOBJS = $(OBJS:%.o=d_%.o) all: $(BIN) +debug: $(DBIN) clean: - rm *.o + @rm *.o $(BIN): $(OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $(BIN) + $(CC) $(FLAGS) $(LDFLAGS) $(OBJS) -o $(BIN) -.c.o: - $(CC) $(CFLAGS) $(DEPFLAGS) $(INCLUDES) -c $*.c +$(DBIN): $(DOBJS) + $(CC) $(DEBUG_FLAGS) $(LDFLAGS) $(DOBJS) -o $(BIN) + +%.o: %.c + $(CC) $(FLAGS) $(INCLUDES) -c $< + +d_%.o: %.c + $(CC) $(DFLAGS) $(INCLUDES) -c $< -o $@ |
From: Michael L. <par...@us...> - 2005-03-03 20:52:47
|
Update of /cvsroot/pdatabase/pdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10710 Modified Files: Makefile Log Message: Using new makefiles. Index: Makefile =================================================================== RCS file: /cvsroot/pdatabase/pdb/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile 13 Feb 2005 19:20:55 -0000 1.5 +++ Makefile 3 Mar 2005 20:52:12 -0000 1.6 @@ -4,14 +4,20 @@ # # This Makefile will invoke the Makefile in # the src/ subdirectory. +# +# $Header$ BIN = pdb +DBIN = pdb-debug all: $(BIN) +debug: $(DBIN) $(BIN): - cd src && make + cd src/ && $(MAKE) -clean: - cd src && make clean +$(DBIN): + cd src/ && $(MAKE) debug +clean: + cd src/ && $(MAKE) clean |
From: Michael L. <par...@us...> - 2005-02-27 02:39:31
|
Update of /cvsroot/pdatabase/pdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23686 Modified Files: pdb.pws Log Message: link nodes no longer have their data deleted Index: pdb.pws =================================================================== RCS file: /cvsroot/pdatabase/pdb/pdb.pws,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- pdb.pws 24 Feb 2005 16:48:37 -0000 1.18 +++ pdb.pws 27 Feb 2005 02:39:06 -0000 1.19 @@ -6,12 +6,12 @@ clean before build=false [filenumbers] -0=1 -1=196 -2=1 -3=389 -4=1 -5=14 +0=177 +1=1 +2=389 +3=1 +4=455 +5=28 6=28 [filemarkers] @@ -29,13 +29,12 @@ filter.dir.ignore.hidden=0 [filelist] -0=/home/para/Projects/pdb_temp/api_src/pdb.c -1=/home/para/Projects/pdb_temp/include/pdb.h -2=/home/para/Projects/pdb/include/pdb_types.h -3=/home/para/Projects/pdb/src/binarytree.c -4=/home/para/Projects/pdb/src/pdb.c -5=/home/para/Projects/pdb/src/pdb_types.c -6=/home/para/Projects/pdb/src/str.c +0=/home/para/Projects/pdb/include/pdb.h +1=/home/para/Projects/pdb/include/pdb_types.h +2=/home/para/Projects/pdb/src/binarytree.c +3=/home/para/Projects/pdb/src/pdb.c +4=/home/para/Projects/pdb/src/pdb_types.c +5=/home/para/Projects/pdb/src/str.c [Project Tree] 0=0 |
From: Michael L. <par...@us...> - 2005-02-27 02:39:31
|
Update of /cvsroot/pdatabase/pdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23686/src Modified Files: pdb_types.c Log Message: link nodes no longer have their data deleted Index: pdb_types.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/pdb_types.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- pdb_types.c 24 Feb 2005 16:48:38 -0000 1.13 +++ pdb_types.c 27 Feb 2005 02:39:06 -0000 1.14 @@ -431,16 +431,22 @@ return 0; /* - * Free data container. + * Only free the container if it is + * not of type LINK_NODE_TYPE. */ - if (nptr->custom_free_cb) { + if (nptr->type != LINK_NODE_TYPE) { /* - * Use the custom free callback rather than the default. + * Free data container. */ - ret = nptr->custom_free_cb(nptr); - } else { - tiptr = pdb_get_type_info(nptr->type); - ret = tiptr->free_cb(nptr); + if (nptr->custom_free_cb) { + /* + * Use the custom free callback rather than the default. + */ + ret = nptr->custom_free_cb(nptr); + } else { + tiptr = pdb_get_type_info(nptr->type); + ret = tiptr->free_cb(nptr); + } } nptr->data = NULL; |
From: Michael L. <par...@us...> - 2005-02-24 16:50:37
|
Update of /cvsroot/pdatabase/pdb/msvc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11915/msvc Added Files: .cvsignore pdb.dsp pdb.dsw pdb.rc resource.h Log Message: Added Microsoft Visual C++ 6.0 project files --- NEW FILE: .cvsignore --- Debug Release pdb.aps pdb.opt pdb.ncb --- NEW FILE: pdb.dsw --- Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "pdb"=.\pdb.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### --- NEW FILE: resource.h --- //{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. // Used by pdb.rc // // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 101 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif --- NEW FILE: pdb.dsp --- # Microsoft Developer Studio Project File - Name="pdb" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=pdb - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "pdb.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "pdb.mak" CFG="pdb - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "pdb - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "pdb - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "pdb - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PDB_EXPORTS" /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PDB_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 !ELSEIF "$(CFG)" == "pdb - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PDB_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PDB_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "pdb - Win32 Release" # Name "pdb - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;def;hpj;bat" # Begin Source File SOURCE=..\src\binarytree.c # End Source File # Begin Source File SOURCE=..\src\hash.c # End Source File # Begin Source File SOURCE=..\src\list.c # End Source File # Begin Source File SOURCE=..\src\pdb.c # End Source File # Begin Source File SOURCE=..\src\pdb_file.c # End Source File # Begin Source File SOURCE=..\src\pdb_parse.c # End Source File # Begin Source File SOURCE=..\src\pdb_types.c # End Source File # Begin Source File SOURCE=..\src\str.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\include\binarytree.h # End Source File # Begin Source File SOURCE=..\config.h # End Source File # Begin Source File SOURCE=..\include\hash.h # End Source File # Begin Source File SOURCE=..\include\list.h # End Source File # Begin Source File SOURCE=..\include\pdb.h # End Source File # Begin Source File SOURCE=..\include\pdb_file.h # End Source File # Begin Source File SOURCE=..\include\pdb_parse.h # End Source File # Begin Source File SOURCE=..\include\pdb_types.h # End Source File # Begin Source File SOURCE=..\include\str.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;r;odl;idl;rc;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # Begin Source File SOURCE=.\pdb.rc # End Source File # End Group # End Target # End Project --- NEW FILE: pdb.rc --- //Microsoft Developer Studio generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) #endif //_WIN32 #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END 2 TEXTINCLUDE DISCARDABLE BEGIN "#include ""afxres.h""\r\n" "\0" END 3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED #ifndef _MAC ///////////////////////////////////////////////////////////////////////////// // // Version // VS_VERSION_INFO VERSIONINFO FILEVERSION 1,0,0,0 PRODUCTVERSION 1,0,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x0L #endif FILEOS 0x40004L FILETYPE 0x2L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN VALUE "Comments", "pdatabase function library\0" VALUE "CompanyName", " \0" VALUE "FileDescription", "pdb\0" VALUE "FileVersion", "1, 0, 0, 0\0" VALUE "InternalName", "pdb\0" VALUE "LegalCopyright", "Copyright © 2005\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "pdb.dll\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "pdb\0" VALUE "ProductVersion", "1, 0, 0, 0\0" VALUE "SpecialBuild", "\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END #endif // !_MAC #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED |
From: Michael L. <par...@us...> - 2005-02-24 16:49:11
|
Update of /cvsroot/pdatabase/pdb/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11142/include Modified Files: pdb.h pdb_types.h str.h Log Message: Added some win32 porting updates by CyberMind Index: pdb.h =================================================================== RCS file: /cvsroot/pdatabase/pdb/include/pdb.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- pdb.h 10 Feb 2005 02:51:06 -0000 1.10 +++ pdb.h 24 Feb 2005 16:48:38 -0000 1.11 @@ -25,6 +25,17 @@ /* * Handy macros. */ +#ifdef WIN32 + #define __FUNCTION__ "FuncNA" +#endif + +/* + * Comment this if you do not wish to compile + * pdb as a library (shared object). + */ +#define PDB_COMPILE_AS_LIB + + #define ERROR(msg) fprintf(stderr, "Error: %s:%s():%i: %s\n", __FILE__, \ __FUNCTION__, __LINE__, msg); #define WARNING(msg) fprintf(stderr, "Warning: %s:%s():%i: %s\n", __FILE__, \ @@ -173,35 +184,42 @@ { #endif -struct pdb* pdb_load(char* file); -int pdb_unload(struct pdb* dbptr); +#if defined(WIN32) && defined(PDB_COMPILE_AS_LIB) + #define DLLEXP __declspec(dllexport) +#endif +#ifndef DLLEXP + #define DLLEXP +#endif -void pdb_enable(struct pdb* dbptr, int settings); -void pdb_disable(struct pdb* dbptr, int settings); -int pdb_is_set(struct pdb* dbptr, int setting); +DLLEXP struct pdb* pdb_load(char* file); +DLLEXP int pdb_unload(struct pdb* dbptr); -int pdb_create_link(struct pdb* dbptr, char* path, char* key, +DLLEXP void pdb_enable(struct pdb* dbptr, int settings); +DLLEXP void pdb_disable(struct pdb* dbptr, int settings); +DLLEXP int pdb_is_set(struct pdb* dbptr, int setting); + +DLLEXP int pdb_create_link(struct pdb* dbptr, char* path, char* key, struct pdb_node_t* tnptr); -struct pdb_node_t* pdb_query_node(struct pdb* dbptr, char* path); -void* pdb_query(struct pdb* dbptr, char* path); +DLLEXP struct pdb_node_t* pdb_query_node(struct pdb* dbptr, char* path); +DLLEXP void* pdb_query(struct pdb* dbptr, char* path); -struct pdb_node_t* pdb_set(struct pdb* dbptr, char* path, char* key, +DLLEXP struct pdb_node_t* pdb_set(struct pdb* dbptr, char* path, char* key, void* data); -struct pdb_node_t* pdb_set_node(struct pdb* dbptr, char* path, char* key, +DLLEXP struct pdb_node_t* pdb_set_node(struct pdb* dbptr, char* path, char* key, void* data, int type); -int pdb_del(struct pdb* dbptr, char* path); +DLLEXP int pdb_del(struct pdb* dbptr, char* path); -char* pdb_trace(struct pdb_node_t* nptr); +DLLEXP char* pdb_trace(struct pdb_node_t* nptr); -void pdb_set_write_interval(struct pdb* dbptr, int seconds); -int pdb_need_write(struct pdb* dbptr); -int pdb_write(struct pdb* dbptr, char* file); +DLLEXP void pdb_set_write_interval(struct pdb* dbptr, int seconds); +DLLEXP int pdb_need_write(struct pdb* dbptr); +DLLEXP int pdb_write(struct pdb* dbptr, char* file); -void pdb_set_free_method(struct pdb* dbptr, struct pdb_node_t* nptr, +DLLEXP void pdb_set_free_method(struct pdb* dbptr, struct pdb_node_t* nptr, void* free_cb); -int pdb_count_children(struct pdb* dbptr, char* path); +DLLEXP int pdb_count_children(struct pdb* dbptr, char* path); #ifdef __cplusplus } Index: pdb_types.h =================================================================== RCS file: /cvsroot/pdatabase/pdb/include/pdb_types.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- pdb_types.h 25 Jan 2005 02:29:41 -0000 1.7 +++ pdb_types.h 24 Feb 2005 16:48:38 -0000 1.8 @@ -104,13 +104,19 @@ { #endif -struct pdb_node_t* pdb_create_tree(struct pdb* dbptr, char* path, char* key); -struct pdb_node_t* pdb_create_list(struct pdb* dbptr, char* path, char* key); -struct pdb_node_t* pdb_create_hash(struct pdb* dbptr, char* path, char* key, +#ifdef WIN32 + #define DLLEXP __declspec(dllexport) +#else + #define DLLEXP +#endif + +DLLEXP struct pdb_node_t* pdb_create_tree(struct pdb* dbptr, char* path, char* key); +DLLEXP struct pdb_node_t* pdb_create_list(struct pdb* dbptr, char* path, char* key); +DLLEXP struct pdb_node_t* pdb_create_hash(struct pdb* dbptr, char* path, char* key, int size); -struct pdb_node_t* pdb_create_abstract(struct pdb* dbptr, char* path, +DLLEXP struct pdb_node_t* pdb_create_abstract(struct pdb* dbptr, char* path, char* key, void* data, void* free_cb); -struct pdb_node_t* pdb_set_int(struct pdb* dbptr, char* path, +DLLEXP struct pdb_node_t* pdb_set_int(struct pdb* dbptr, char* path, char* key, int data); struct pdb_node_types_t* pdb_get_type_info(int type); @@ -119,7 +125,7 @@ int pdb_standard_load_node(FILE* fptr, struct pdb_node_t* pptr, char** tok_arr, int* line); -int pdb_free_node(struct pdb_node_t* nptr); +DLLEXP int pdb_free_node(struct pdb_node_t* nptr); int pdb_standard_write_node(struct pdb* dbptr, FILE* fptr, struct pdb_node_t* nptr, int tabs); Index: str.h =================================================================== RCS file: /cvsroot/pdatabase/pdb/include/str.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- str.h 25 Jan 2005 02:29:41 -0000 1.4 +++ str.h 24 Feb 2005 16:48:38 -0000 1.5 @@ -25,6 +25,10 @@ #define int_to_char(x) ((char)(x + 48)) +#ifdef WIN32 +#define vsnprintf _vsnprintf +#endif + #ifdef __cplusplus extern "C" { @@ -69,8 +73,6 @@ int str_starts_with(char* str, char* tok); -char* itoa(int i); - #ifdef __cplusplus } #endif |
From: Michael L. <par...@us...> - 2005-02-24 16:49:11
|
Update of /cvsroot/pdatabase/pdb/api_src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11142/api_src Modified Files: pdb.c pdb.h Log Message: Added some win32 porting updates by CyberMind Index: pdb.h =================================================================== RCS file: /cvsroot/pdatabase/pdb/api_src/pdb.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- pdb.h 8 Feb 2005 21:17:02 -0000 1.3 +++ pdb.h 24 Feb 2005 16:48:38 -0000 1.4 @@ -20,25 +20,18 @@ * * * This header is used in conjunction with pdb - * compiled as a shared library. + * compiled as a shared library. * You can download pdb at http://pdatabase.sourceforge.net/ * */ - + #ifndef __PDB_H #define __PDB_H /* - * Windows or POSIX? - */ -#ifndef WIN32 - #define POSIX -#endif - -/* * Enable verbose loading/unloading messages. */ -#define _PDB_VERBOSE +//#define _PDB_VERBOSE /* @@ -55,7 +48,7 @@ * differ from node to node. */ struct pdb_node_t; -typedef int (*custom_free_cb_t)(void* nptr); +typedef int (*pdb_custom_free_cb_t)(void* nptr); /* @@ -66,7 +59,7 @@ char* id; void* data; struct pdb_node_t* parent; - custom_free_cb_t custom_free_cb; + pdb_custom_free_cb_t custom_free_cb; }; @@ -89,14 +82,14 @@ * PDB types. */ enum { - NO_NODE_TYPE, - TREE_NODE_TYPE, - LIST_NODE_TYPE, - HASH_NODE_TYPE, - STRING_NODE_TYPE, - INT_NODE_TYPE, - ABSTRACT_NODE_TYPE, - LINK_NODE_TYPE + PDB_NO_NODE_TYPE, + PDB_TREE_NODE_TYPE, + PDB_LIST_NODE_TYPE, + PDB_HASH_NODE_TYPE, + PDB_STRING_NODE_TYPE, + PDB_INT_NODE_TYPE, + PDB_ABSTRACT_NODE_TYPE, + PDB_LINK_NODE_TYPE }; /* @@ -108,41 +101,49 @@ #define PDB_THREAD_SAFE 8 #ifdef WIN32 - #define dlsym(obj, func) \ - GetProcAddress((HMODULE)obj, func) + #define pdb_dlopen(file,x) \ + (void*)LoadLibrary(file) + #define pdb_dlsym(obj, func) \ + (void*)GetProcAddress((HMODULE)obj, func) + #define pdb_dlclose(obj) \ + !FreeLibrary((HMODULE)obj) +#else + #define pdb_dlopen dlopen + #define pdb_dlsym dlsym + #define pdb_dlclose dlclose #endif struct _pdb_funcs_t { struct pdb* (*_pdb_load_fptr)(char* file); int (*_pdb_unload_fptr)(struct pdb* dbptr); - + void (*_pdb_enable_fptr)(struct pdb* dbptr, int settings); void (*_pdb_disable_fptr)(struct pdb* dbptr, int settings); int (*_pdb_is_set_fptr)(struct pdb* dbptr, int setting); - + int (*_pdb_create_link_fptr)(struct pdb* dbptr, char* path, char* key, struct pdb_node_t* tnptr); - + struct pdb_node_t* (*_pdb_query_node_fptr)(struct pdb* dbptr, char* path); void* (*_pdb_query_fptr)(struct pdb* dbptr, char* path); - + struct pdb_node_t* (*_pdb_set_fptr)(struct pdb* dbptr, char* path, char* key, void* data); struct pdb_node_t* (*_pdb_set_node_fptr)(struct pdb* dbptr, char* path, char* key, void* data, int type); int (*_pdb_del_fptr)(struct pdb* dbptr, char* path); - + char* (*_pdb_trace_fptr)(struct pdb_node_t* nptr); - + void (*_pdb_set_write_interval_fptr)(struct pdb* dbptr, int seconds); int (*_pdb_need_write_fptr)(struct pdb* dbptr); int (*_pdb_write_fptr)(struct pdb* dbptr, char* file); - + void (*_pdb_set_free_method_fptr)(struct pdb* dbptr, struct pdb_node_t* nptr, void* free_cb); - + int (*_pdb_count_children_fptr)(struct pdb* dbptr, char* path); - + int (*_pdb_free_node_fptr)(struct pdb_node_t* nptr); /* @@ -172,67 +173,67 @@ /* * A hash node. */ -struct hash_node_t { +struct pdb_hash_node_t { char* id; void* data; }; /* * The root hash type. */ -struct hash { +struct pdb_hash { int size; - struct linkList** tbl; + struct pdb_linkList** tbl; }; /* * Callback which can be passed to free_hash(). */ -typedef void (*hash_func_ptr)(void* dptr); +typedef void (*pdb_hash_func_ptr)(void* dptr); /* * LINKED LIST */ -enum list_add_seq { +enum pdb_list_add_seq { ADD_BEFORE, ADD_AFTER }; -typedef void (*list_func_ptr)(void* dptr); +typedef void (*pdb_list_func_ptr)(void* dptr); /* Individual Node Within The List */ -struct linkNode { - struct linkNode* prev; - struct linkNode* next; +struct pdb_linkNode { + struct pdb_linkNode* prev; + struct pdb_linkNode* next; void* data; }; /* List Structure */ -struct linkList { - struct linkNode* root; - struct linkNode* last; +struct pdb_linkList { + struct pdb_linkNode* root; + struct pdb_linkNode* last; }; /* * BINARY TREE */ -typedef void (*tree_func_ptr)(void* dptr); -typedef int (*tree_str_cmp_cb)(char* s1, char* s2); +typedef void (*pdb_tree_func_ptr)(void* dptr); +typedef int (*pdb_tree_str_cmp_cb)(char* s1, char* s2); /* * Individual Node * Within The Tree */ -struct treeNode { - struct treeNode* right; - struct treeNode* left; - struct treeNode* parent; +struct pdb_treeNode { + struct pdb_treeNode* right; + struct pdb_treeNode* left; + struct pdb_treeNode* parent; char* key; void* data; }; /* * Tree Structure */ -struct binaryTree { - struct treeNode* root; +struct pdb_binaryTree { + struct pdb_treeNode* root; int flags; - tree_str_cmp_cb _tree_str_cmp; + pdb_tree_str_cmp_cb _tree_str_cmp; }; /********************************************** @@ -245,7 +246,7 @@ extern "C" { #endif - + int load_pdb_lib(char* file); int unload_pdb_lib(); void recache_pdb_lib(); Index: pdb.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/api_src/pdb.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pdb.c 18 Feb 2005 21:25:29 -0000 1.2 +++ pdb.c 24 Feb 2005 16:48:38 -0000 1.3 @@ -20,7 +20,7 @@ * * * This header is used in conjunction with pdb - * compiled as a shared library. + * compiled as a shared library. * You can download pdb at http://pdatabase.sourceforge.net/ * */ @@ -30,11 +30,12 @@ #include <stdio.h> #include "pdb.h" -#ifdef POSIX - #include <dlfcn.h> -#elif defined(WIN32) - #include <windows.h> -#endif +#ifdef WIN32 + #define WIN32_LEAN_AND_MEAN + #include <windows.h> +#else + #include <dlfcn.h> +#endif static void* _pdb_obj; static struct _pdb_funcs_t _pdb_funcs = { @@ -51,19 +52,15 @@ #ifdef _PDB_VERBOSE printf("INFO: pdb.c: Loading pdb library \"%s\"... ", file); #endif - - #ifdef POSIX - _pdb_obj = dlopen(file, RTLD_NOW); - #elif defined(WIN32) - _pdb_obj = LoadLibrary(file); - #endif - + + _pdb_obj = pdb_dlopen(file, RTLD_NOW); + #ifdef _PDB_VERBOSE printf("%s\n", (_pdb_obj ? "success" : "failed")); #endif - + recache_pdb_lib(); - + return (_pdb_obj ? 1 : 0); } @@ -73,23 +70,19 @@ */ int unload_pdb_lib() { int r; - - if (!_pdb_obj) return 0; - + + if (!_pdb_obj) return 0; + #ifdef _PDB_VERBOSE printf("INFO: pdb.c: Unloading pdb library... "); #endif - #ifdef POSIX - r = dlclose(_pdb_obj); - #elif defined(WIN32) - r = FreeLibrary((struct HINSTANCE__*)_pdb_obj); - #endif - + r = pdb_dlclose(_pdb_obj); + #ifdef _PDB_VERBOSE printf("%s\n", (r ? "failed" : "success")); #endif - + return (r ? 0 : 1); } @@ -98,43 +91,43 @@ * (Re)cache the pdb shared object function pointers. */ void recache_pdb_lib() { - if (!_pdb_obj) return; - + if (!_pdb_obj) return; + #ifdef _PDB_VERBOSE printf("INFO: pdb.c: Caching pdb function pointers...\n"); #endif - - _pdb_funcs._pdb_load_fptr = dlsym(_pdb_obj, "pdb_load"); - _pdb_funcs._pdb_unload_fptr = dlsym(_pdb_obj, "pdb_unload"); - _pdb_funcs._pdb_load_fptr = dlsym(_pdb_obj, "pdb_load"); - _pdb_funcs._pdb_unload_fptr = dlsym(_pdb_obj, "pdb_unload"); - _pdb_funcs._pdb_enable_fptr = dlsym(_pdb_obj, "pdb_enable"); - _pdb_funcs._pdb_disable_fptr = dlsym(_pdb_obj, "pdb_disable"); - _pdb_funcs._pdb_is_set_fptr = dlsym(_pdb_obj, "pdb_is_set"); - _pdb_funcs._pdb_create_link_fptr = dlsym(_pdb_obj, "pdb_create_link"); - _pdb_funcs._pdb_query_node_fptr = dlsym(_pdb_obj, "pdb_query_node"); - _pdb_funcs._pdb_query_fptr = dlsym(_pdb_obj, "pdb_query"); - _pdb_funcs._pdb_set_fptr = dlsym(_pdb_obj, "pdb_set"); - _pdb_funcs._pdb_set_node_fptr = dlsym(_pdb_obj, "pdb_set_node"); - _pdb_funcs._pdb_del_fptr = dlsym(_pdb_obj, "pdb_del"); - _pdb_funcs._pdb_trace_fptr = dlsym(_pdb_obj, "pdb_trace"); + + _pdb_funcs._pdb_load_fptr = pdb_dlsym(_pdb_obj, "pdb_load"); + _pdb_funcs._pdb_unload_fptr = pdb_dlsym(_pdb_obj, "pdb_unload"); + _pdb_funcs._pdb_load_fptr = pdb_dlsym(_pdb_obj, "pdb_load"); + _pdb_funcs._pdb_unload_fptr = pdb_dlsym(_pdb_obj, "pdb_unload"); + _pdb_funcs._pdb_enable_fptr = pdb_dlsym(_pdb_obj, "pdb_enable"); + _pdb_funcs._pdb_disable_fptr = pdb_dlsym(_pdb_obj, "pdb_disable"); + _pdb_funcs._pdb_is_set_fptr = pdb_dlsym(_pdb_obj, "pdb_is_set"); + _pdb_funcs._pdb_create_link_fptr = pdb_dlsym(_pdb_obj, "pdb_create_link"); + _pdb_funcs._pdb_query_node_fptr = pdb_dlsym(_pdb_obj, "pdb_query_node"); + _pdb_funcs._pdb_query_fptr = pdb_dlsym(_pdb_obj, "pdb_query"); + _pdb_funcs._pdb_set_fptr = pdb_dlsym(_pdb_obj, "pdb_set"); + _pdb_funcs._pdb_set_node_fptr = pdb_dlsym(_pdb_obj, "pdb_set_node"); + _pdb_funcs._pdb_del_fptr = pdb_dlsym(_pdb_obj, "pdb_del"); + _pdb_funcs._pdb_trace_fptr = pdb_dlsym(_pdb_obj, "pdb_trace"); _pdb_funcs._pdb_set_write_interval_fptr = - dlsym(_pdb_obj, "pdb_set_write_interval"); - _pdb_funcs._pdb_need_write_fptr = dlsym(_pdb_obj, "pdb_need_write"); - _pdb_funcs._pdb_write_fptr = dlsym(_pdb_obj, "pdb_write"); + pdb_dlsym(_pdb_obj, "pdb_set_write_interval"); + _pdb_funcs._pdb_need_write_fptr = pdb_dlsym(_pdb_obj, "pdb_need_write"); + _pdb_funcs._pdb_write_fptr = pdb_dlsym(_pdb_obj, "pdb_write"); _pdb_funcs._pdb_set_free_method_fptr = - dlsym(_pdb_obj, "pdb_set_free_method"); - _pdb_funcs._pdb_count_children_fptr = dlsym(_pdb_obj, "pdb_count_children"); - - _pdb_funcs._pdb_free_node_fptr = dlsym(_pdb_obj, "pdb_free_node"); - _pdb_funcs._pdb_create_tree_fptr = dlsym(_pdb_obj, "pdb_create_tree"); - _pdb_funcs._pdb_create_list_fptr = dlsym(_pdb_obj, "pdb_create_list"); - _pdb_funcs._pdb_create_hash_fptr = dlsym(_pdb_obj, "pdb_create_hash"); - _pdb_funcs._pdb_create_abstract_fptr = dlsym(_pdb_obj, - "pdb_create_abstract"); - _pdb_funcs._pdb_set_int_fptr = dlsym(_pdb_obj, "pdb_set_int"); - + pdb_dlsym(_pdb_obj, "pdb_set_free_method"); + _pdb_funcs._pdb_count_children_fptr = pdb_dlsym(_pdb_obj, "pdb_count_children"); + _pdb_funcs._pdb_free_node_fptr = pdb_dlsym(_pdb_obj, "pdb_free_node"); + _pdb_funcs._pdb_create_tree_fptr = pdb_dlsym(_pdb_obj, "pdb_create_tree"); + _pdb_funcs._pdb_create_list_fptr = pdb_dlsym(_pdb_obj, "pdb_create_list"); + _pdb_funcs._pdb_create_hash_fptr = pdb_dlsym(_pdb_obj, "pdb_create_hash"); + _pdb_funcs._pdb_create_abstract_fptr = pdb_dlsym(_pdb_obj, + "pdb_create_abstract"); + _pdb_funcs._pdb_set_int_fptr = pdb_dlsym(_pdb_obj, "pdb_set_int"); + + #ifdef _PDB_VERBOSE printf("INFO: pdb.c: Cached pdb_load(): %s\n", (_pdb_funcs._pdb_load_fptr ? "success" : "failed")); @@ -170,20 +163,20 @@ (_pdb_funcs._pdb_set_free_method_fptr ? "success" : "failed")); printf("INFO: pdb.c: Cached pdb_count_children(): %s\n", (_pdb_funcs._pdb_count_children_fptr ? "success" : "failed")); - - printf("INFO: pdb.c: Cached pdb_free_node(): %s\n", - (_pdb_funcs._pdb_free_node_fptr ? "success" : "failed")); - - printf("INFO: pdb.c: Cached pdb_create_tree(): %s\n", - (_pdb_funcs._pdb_create_tree_fptr ? "success" : "failed")); - printf("INFO: pdb.c: Cached pdb_create_list(): %s\n", - (_pdb_funcs._pdb_create_list_fptr ? "success" : "failed")); - printf("INFO: pdb.c: Cached pdb_create_hash(): %s\n", - (_pdb_funcs._pdb_create_hash_fptr ? "success" : "failed")); - printf("INFO: pdb.c: Cached pdb_create_abstract(): %s\n", - (_pdb_funcs._pdb_create_abstract_fptr ? "success" : "failed")); - printf("INFO: pdb.c: Cached pdb_set_int(): %s\n", - (_pdb_funcs._pdb_set_int_fptr ? "success" : "failed")); + + printf("INFO: pdb.c: Cached pdb_free_node(): %s\n", + (_pdb_funcs._pdb_free_node_fptr ? "success" : "failed")); + + printf("INFO: pdb.c: Cached pdb_create_tree(): %s\n", + (_pdb_funcs._pdb_create_tree_fptr ? "success" : "failed")); + printf("INFO: pdb.c: Cached pdb_create_list(): %s\n", + (_pdb_funcs._pdb_create_list_fptr ? "success" : "failed")); + printf("INFO: pdb.c: Cached pdb_create_hash(): %s\n", + (_pdb_funcs._pdb_create_hash_fptr ? "success" : "failed")); + printf("INFO: pdb.c: Cached pdb_create_abstract(): %s\n", + (_pdb_funcs._pdb_create_abstract_fptr ? "success" : "failed")); + printf("INFO: pdb.c: Cached pdb_set_int(): %s\n", + (_pdb_funcs._pdb_set_int_fptr ? "success" : "failed")); #endif } @@ -218,7 +211,7 @@ int pdb_create_link(struct pdb* dbptr, char* path, char* key, struct pdb_node_t* tnptr) { - if (!_pdb_obj) return 0; + if (!_pdb_obj) return 0; return _pdb_funcs._pdb_create_link_fptr(dbptr, path, key, tnptr); } @@ -234,13 +227,13 @@ struct pdb_node_t* pdb_set(struct pdb* dbptr, char* path, char* key, void* data) { - if (!_pdb_obj) return NULL; + if (!_pdb_obj) return NULL; return _pdb_funcs._pdb_set_fptr(dbptr, path, key, data); } struct pdb_node_t* pdb_set_node(struct pdb* dbptr, char* path, char* key, void* data, int type) { - if (!_pdb_obj) return NULL; + if (!_pdb_obj) return NULL; return _pdb_funcs._pdb_set_node_fptr(dbptr, path, key, data, type); } @@ -271,12 +264,12 @@ void pdb_set_free_method(struct pdb* dbptr, struct pdb_node_t* nptr, void* free_cb) { - if (!_pdb_obj) return; + if (!_pdb_obj) return; _pdb_funcs._pdb_set_free_method_fptr(dbptr, nptr, free_cb); } int pdb_count_children(struct pdb* dbptr, char* path) { - if (!_pdb_obj) return 0; + if (!_pdb_obj) return 0; return _pdb_funcs._pdb_count_children_fptr(dbptr, path); } |
From: Michael L. <par...@us...> - 2005-02-24 16:49:11
|
Update of /cvsroot/pdatabase/pdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11142/src Modified Files: list.c pdb.c pdb_types.c str.c Log Message: Added some win32 porting updates by CyberMind Index: list.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/list.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- list.c 25 Jan 2005 02:29:42 -0000 1.4 +++ list.c 24 Feb 2005 16:48:38 -0000 1.5 @@ -356,7 +356,7 @@ } node_arr[node] = NULL; - node = ((nodes - 1) * .65 ); + node = (int)((nodes - 1) * .65 ); srand(time(NULL) * node); for (; node > 0; node--) { a = (rand() % (nodes - 1)); Index: pdb_types.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/pdb_types.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- pdb_types.c 22 Feb 2005 01:37:56 -0000 1.12 +++ pdb_types.c 24 Feb 2005 16:48:38 -0000 1.13 @@ -191,21 +191,21 @@ ******************/ -struct pdb_node_t* pdb_create_tree(struct pdb* dbptr, char* path, char* key) { +DLLEXP struct pdb_node_t* pdb_create_tree(struct pdb* dbptr, char* path, char* key) { return pdb_set_node(dbptr, path, key, NULL, TREE_NODE_TYPE); } -struct pdb_node_t* pdb_create_list(struct pdb* dbptr, char* path, char* key) { +DLLEXP struct pdb_node_t* pdb_create_list(struct pdb* dbptr, char* path, char* key) { return pdb_set_node(dbptr, path, key, NULL, LIST_NODE_TYPE); } -struct pdb_node_t* pdb_create_hash(struct pdb* dbptr, char* path, char* key, +DLLEXP struct pdb_node_t* pdb_create_hash(struct pdb* dbptr, char* path, char* key, int size) { return pdb_set_node(dbptr, path, key, &size, HASH_NODE_TYPE); } -struct pdb_node_t* pdb_create_abstract(struct pdb* dbptr, char* path, +DLLEXP struct pdb_node_t* pdb_create_abstract(struct pdb* dbptr, char* path, char* key, void* data, void* free_cb) { struct pdb_node_t* nptr = NULL; @@ -219,7 +219,7 @@ return nptr; } -struct pdb_node_t* pdb_set_int(struct pdb* dbptr, char* path, +DLLEXP struct pdb_node_t* pdb_set_int(struct pdb* dbptr, char* path, char* key, int data) { return pdb_set_node(dbptr, path, key, &data, INT_NODE_TYPE); @@ -423,8 +423,9 @@ * if you are deleting a single node from the structure * (e.g. pdb_del rather than pdb_unload). */ -int pdb_free_node(struct pdb_node_t* nptr) { +DLLEXP int pdb_free_node(struct pdb_node_t* nptr) { struct pdb_node_types_t* tiptr; + int ret = 0; if (!nptr) return 0; @@ -432,7 +433,6 @@ /* * Free data container. */ - int ret = 0; if (nptr->custom_free_cb) { /* * Use the custom free callback rather than the default. @@ -923,7 +923,7 @@ /* * Skip over the opening token. */ - for (i = 0; i < strlen(tiptr->open_token); ++i) + for (i = 0; i < (signed)strlen(tiptr->open_token); ++i) fgetc(fptr); /* @@ -1009,16 +1009,14 @@ int i = 0; struct linkList* lptr = NULL; struct linkNode* lnptr = NULL; - char* ic = NULL; /* * Write the table size to disk. */ for (; i < tabs; i++) fputc('\t', fptr); - ic = itoa(hptr->size); - fputs(ic, fptr); - free(ic); + + fprintf(fptr, "%i", hptr->size); fputc(PDB_TOKEN_TERM, fptr); fputc('\n', fptr); Index: str.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/str.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- str.c 13 Feb 2005 19:20:55 -0000 1.5 +++ str.c 24 Feb 2005 16:48:39 -0000 1.6 @@ -31,13 +31,15 @@ #include <ctype.h> #include <string.h> #include <stdlib.h> -//#ifdef POSIX +#ifdef WIN32 + #define WIN32_LEAN_AND_MEAN + #include <windows.h> + #include <winsock.h> + #include <time.h> +#else #include <sys/time.h> #include <pthread.h> -//#else -// #include <winsock.h> -// #include <time.h> -//#endif +#endif #include "str.h" @@ -708,46 +710,3 @@ return 1; return 0; } - - -/* - * Convert an integer to a char*. - */ -char* itoa(int i) { - char* str = (char*)malloc(sizeof(char) * 1024); - char* ostr = str; - int neg = 0; - int m, p; - char t; - - memset(str, 0, (sizeof(char) * 1024)); - - if (!i) { - *str = '0'; - return str; - } else if (i < 0) { - neg = 1; - i *= -1; - } - - while (i) { - *str = int_to_char(i % 10); - ++str; - i /= 10; - } - - if (neg) - *str = '-'; - - i = strlen(ostr); - m = (i / 2); /* save cycles, precalculate it */ - p = 0; - while (p < m) { - t = ostr[i - p - 1]; - ostr[i - p - 1] = ostr[p]; - ostr[p] = t; - ++p; - } - - return ostr; -} Index: pdb.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/pdb.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- pdb.c 22 Feb 2005 01:37:56 -0000 1.15 +++ pdb.c 24 Feb 2005 16:48:38 -0000 1.16 @@ -64,7 +64,7 @@ * Load a file and return a database pointer. * If file is NULL, create an empty database. */ -struct pdb* pdb_load(char* file) { +DLLEXP struct pdb* pdb_load(char* file) { struct pdb* dbptr; struct pdb_node_types_t* rntptr; int line = 1; @@ -123,13 +123,15 @@ /* * Unload a database. */ -int pdb_unload(struct pdb* dbptr) { +DLLEXP int pdb_unload(struct pdb* dbptr) { + int ret; + if (!dbptr) return 0; PDB_MUTEX_LOCK(dbptr); - int ret = pdb_free_node(dbptr->data); + ret = pdb_free_node(dbptr->data); #ifdef PDB_USING_THREADS pthread_mutex_destroy(dbptr->mutex); @@ -145,7 +147,7 @@ * Enable pdb setting(s). * settings are OR'ed togther. */ -void pdb_enable(struct pdb* dbptr, int settings) { +DLLEXP void pdb_enable(struct pdb* dbptr, int settings) { if (!dbptr) return; @@ -161,7 +163,7 @@ * Disable pdb setting(s). * settings are OR'ed togther. */ -void pdb_disable(struct pdb* dbptr, int settings) { +DLLEXP void pdb_disable(struct pdb* dbptr, int settings) { if (!dbptr) return; @@ -176,7 +178,7 @@ /* * Return 1 if the given setting is set. */ -int pdb_is_set(struct pdb* dbptr, int setting) { +DLLEXP int pdb_is_set(struct pdb* dbptr, int setting) { if (!dbptr) return 0; @@ -188,7 +190,7 @@ * Create a node link from path/key to tnptr. * Node links will be ignored when written to disk. */ -int pdb_create_link(struct pdb* dbptr, char* path, char* key, +DLLEXP int pdb_create_link(struct pdb* dbptr, char* path, char* key, struct pdb_node_t* tnptr) { struct pdb_node_t* nptr; @@ -216,7 +218,7 @@ /* * Return a given node from the database. */ -struct pdb_node_t* pdb_query_node(struct pdb* dbptr, char* path) { +DLLEXP struct pdb_node_t* pdb_query_node(struct pdb* dbptr, char* path) { char** tok_arr; struct pdb_node_t* nptr; struct pdb_node_types_t* tiptr; @@ -256,7 +258,7 @@ /* * Return a given node's data pointer from the database. */ -void* pdb_query(struct pdb* dbptr, char* path) { +DLLEXP void* pdb_query(struct pdb* dbptr, char* path) { struct pdb_node_t* nptr; if (!dbptr) @@ -273,7 +275,7 @@ * * This is for string node types. */ -struct pdb_node_t* pdb_set(struct pdb* dbptr, char* path, char* key, +DLLEXP struct pdb_node_t* pdb_set(struct pdb* dbptr, char* path, char* key, void* data) { return (pdb_set_node(dbptr, path, key, data, STRING_NODE_TYPE)); @@ -283,7 +285,7 @@ * Set a node's data. If it does not exist, create it. * Return a pointer to the node. */ -struct pdb_node_t* pdb_set_node(struct pdb* dbptr, char* path, char* key, +DLLEXP struct pdb_node_t* pdb_set_node(struct pdb* dbptr, char* path, char* key, void* data, int type) { struct pdb_node_types_t* tiptr; @@ -346,7 +348,7 @@ /* * Delete a node, recursively deleting all child nodes. */ -int pdb_del(struct pdb* dbptr, char* path) { +DLLEXP int pdb_del(struct pdb* dbptr, char* path) { struct pdb_node_t* nptr; int ret; @@ -378,7 +380,7 @@ * Create a backtrace of the given nodes location relative to the root. * The resulting string is allocated and must be freed. */ -char* pdb_trace(struct pdb_node_t* nptr) { +DLLEXP char* pdb_trace(struct pdb_node_t* nptr) { struct linkList* lptr; struct linkNode* lnptr; char* sbuf; @@ -435,7 +437,7 @@ /* * Set the disk write interval. */ -void pdb_set_write_interval(struct pdb* dbptr, int seconds) { +DLLEXP void pdb_set_write_interval(struct pdb* dbptr, int seconds) { if (!dbptr) return; @@ -447,7 +449,7 @@ /* * Return 1 if the pdb is scheduled for a disk write. */ -int pdb_need_write(struct pdb* dbptr) { +DLLEXP int pdb_need_write(struct pdb* dbptr) { if (!dbptr) return 0; @@ -458,7 +460,7 @@ /* * Write a loaded database structure to disk. */ -int pdb_write(struct pdb* dbptr, char* file) { +DLLEXP int pdb_write(struct pdb* dbptr, char* file) { FILE* fptr; struct pdb_node_t* nptr; int ret; @@ -506,7 +508,7 @@ * If set, this will be used rather than the types default * free method. */ -void pdb_set_free_method(struct pdb* dbptr, struct pdb_node_t* nptr, +DLLEXP void pdb_set_free_method(struct pdb* dbptr, struct pdb_node_t* nptr, void* free_cb) { if (!dbptr) @@ -521,7 +523,7 @@ /* * Return the number of children a container has. */ -int pdb_count_children(struct pdb* dbptr, char* path) { +DLLEXP int pdb_count_children(struct pdb* dbptr, char* path) { struct pdb_node_types_t* tiptr; struct pdb_node_t* nptr; int ret; |
From: Michael L. <par...@us...> - 2005-02-24 16:49:11
|
Update of /cvsroot/pdatabase/pdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11142 Modified Files: pdb.pws Log Message: Added some win32 porting updates by CyberMind Index: pdb.pws =================================================================== RCS file: /cvsroot/pdatabase/pdb/pdb.pws,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- pdb.pws 22 Feb 2005 01:37:55 -0000 1.17 +++ pdb.pws 24 Feb 2005 16:48:37 -0000 1.18 @@ -7,10 +7,12 @@ [filenumbers] 0=1 -1=389 -2=62 -3=398 -4=28 +1=196 +2=1 +3=389 +4=1 +5=14 +6=28 [filemarkers] 0= @@ -18,6 +20,8 @@ 2= 3= 4= +5= +6= [File View] filter.file.unmatch=*.so *.o *.a *.la @@ -25,11 +29,13 @@ filter.dir.ignore.hidden=0 [filelist] -0=/home/para/Projects/pdb/include/pdb_types.h -1=/home/para/Projects/pdb/src/binarytree.c -2=/home/para/Projects/pdb/src/pdb.c -3=/home/para/Projects/pdb/src/pdb_types.c -4=/home/para/Projects/pdb/src/str.c +0=/home/para/Projects/pdb_temp/api_src/pdb.c +1=/home/para/Projects/pdb_temp/include/pdb.h +2=/home/para/Projects/pdb/include/pdb_types.h +3=/home/para/Projects/pdb/src/binarytree.c +4=/home/para/Projects/pdb/src/pdb.c +5=/home/para/Projects/pdb/src/pdb_types.c +6=/home/para/Projects/pdb/src/str.c [Project Tree] 0=0 |
From: Michael L. <par...@us...> - 2005-02-24 16:48:09
|
Update of /cvsroot/pdatabase/pdb/msvc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10949/msvc Log Message: Directory /cvsroot/pdatabase/pdb/msvc added to the repository |
From: Michael L. <par...@us...> - 2005-02-22 01:38:05
|
Update of /cvsroot/pdatabase/pdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21163/src Modified Files: pdb.c pdb_types.c Log Message: Fixed segfault on pdb_del() calls. Index: pdb.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/pdb.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- pdb.c 18 Feb 2005 21:25:29 -0000 1.14 +++ pdb.c 22 Feb 2005 01:37:56 -0000 1.15 @@ -32,6 +32,7 @@ #include "pdb_parse.h" #include "pdb_types.h" #include "list.h" +#include "binarytree.h" /*int main(int argc, char** argv) { printf(PDB_COMPILE_INFO); @@ -347,6 +348,7 @@ */ int pdb_del(struct pdb* dbptr, char* path) { struct pdb_node_t* nptr; + int ret; if (!dbptr) return 0; @@ -360,7 +362,7 @@ /* * Free the node. */ - pdb_free_node(nptr); + ret = pdb_free_node(nptr); /* * Schedule a disk write. @@ -368,7 +370,7 @@ dbptr->altered = 1; PDB_MUTEX_UNLOCK(dbptr); - return pdb_free_node(nptr); + return ret; } Index: pdb_types.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/pdb_types.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- pdb_types.c 18 Feb 2005 21:25:29 -0000 1.11 +++ pdb_types.c 22 Feb 2005 01:37:56 -0000 1.12 @@ -426,6 +426,9 @@ int pdb_free_node(struct pdb_node_t* nptr) { struct pdb_node_types_t* tiptr; + if (!nptr) + return 0; + /* * Free data container. */ |
From: Michael L. <par...@us...> - 2005-02-22 01:38:05
|
Update of /cvsroot/pdatabase/pdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21163 Modified Files: pdb.pws Log Message: Fixed segfault on pdb_del() calls. Index: pdb.pws =================================================================== RCS file: /cvsroot/pdatabase/pdb/pdb.pws,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- pdb.pws 13 Feb 2005 19:20:55 -0000 1.16 +++ pdb.pws 22 Feb 2005 01:37:55 -0000 1.17 @@ -5,20 +5,32 @@ [Project State] clean before build=false -[filelist] -0=/home/para/Projects/pdb/src/str.c - [filenumbers] -0=28 +0=1 +1=389 +2=62 +3=398 +4=28 [filemarkers] 0= +1= +2= +3= +4= [File View] filter.file.unmatch=*.so *.o *.a *.la filter.file.ignore.hidden=0 filter.dir.ignore.hidden=0 +[filelist] +0=/home/para/Projects/pdb/include/pdb_types.h +1=/home/para/Projects/pdb/src/binarytree.c +2=/home/para/Projects/pdb/src/pdb.c +3=/home/para/Projects/pdb/src/pdb_types.c +4=/home/para/Projects/pdb/src/str.c + [Project Tree] 0=0 1=0:0 |
From: Michael L. <par...@us...> - 2005-02-18 21:25:38
|
Update of /cvsroot/pdatabase/pdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5663/src Modified Files: binarytree.c pdb.c pdb_types.c Log Message: pdb_del() now uses pdb_free_node(). Updated api_src/pdb.c Index: pdb.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/pdb.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- pdb.c 10 Feb 2005 02:51:06 -0000 1.13 +++ pdb.c 18 Feb 2005 21:25:29 -0000 1.14 @@ -41,11 +41,16 @@ printf("\n--DEBUG--\n\n"); - int* a = pdb_query(dbptr, "a/b"); - printf("%x\n", a); - printf("[%i]\n", *a); + struct pdb_node_t* nptr = pdb_query_node(dbptr, "modules"); + printf("%i ? %i\n", nptr->type, LIST_NODE_TYPE); + struct linkList* lptr = nptr->data; + struct linkNode* lnptr = lptr->root; + while (lnptr) { + nptr = lnptr->data; + printf("[%s]\n", nptr->id); + lnptr = lnptr->next; + } - pdb_write(dbptr, "/home/para/test.db2"); printf("\n--UNLOAD--\n\n"); if (dbptr) @@ -242,6 +247,7 @@ token_free(tok_arr); PDB_MUTEX_UNLOCK(dbptr); + return nptr; } @@ -341,7 +347,6 @@ */ int pdb_del(struct pdb* dbptr, char* path) { struct pdb_node_t* nptr; - struct pdb_node_types_t* tiptr; if (!dbptr) return 0; @@ -352,15 +357,10 @@ PDB_MUTEX_LOCK(dbptr); - tiptr = pdb_get_type_info(nptr->type); - - if (!tiptr->free_cb) { - fprintf(stderr, "%s:%s():%i: Error: Unable to free node %s; type %i " - "does not support deletion.\n", - __FILE__, __FUNCTION__, __LINE__, nptr->id, nptr->type); - PDB_MUTEX_UNLOCK(dbptr); - return 0; - } + /* + * Free the node. + */ + pdb_free_node(nptr); /* * Schedule a disk write. Index: binarytree.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/binarytree.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- binarytree.c 8 Feb 2005 21:17:03 -0000 1.7 +++ binarytree.c 18 Feb 2005 21:25:29 -0000 1.8 @@ -230,20 +230,23 @@ */ void* tree_get_node(struct binaryTree* tptr, char* key) { struct treeNode* nptr; + int cmp; if (tptr == NULL) - return 0; + return NULL; nptr = tptr->root; /* locate parent node */ while (nptr != NULL) { - if (tptr->_tree_str_cmp(key, nptr->key) < 0) { + cmp = tptr->_tree_str_cmp(key, nptr->key); + if (cmp < 0) { nptr = nptr->left; - } else if (tptr->_tree_str_cmp(key, nptr->key) > 0) { + } else if (cmp > 0) { nptr = nptr->right; - } else + } else { return nptr->data; + } } return NULL; } Index: pdb_types.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/pdb_types.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- pdb_types.c 8 Feb 2005 15:10:18 -0000 1.10 +++ pdb_types.c 18 Feb 2005 21:25:29 -0000 1.11 @@ -427,11 +427,6 @@ struct pdb_node_types_t* tiptr; /* - * Remove from parent. - */ - pdb_del_node_from_parent(nptr); - - /* * Free data container. */ int ret = 0; @@ -444,7 +439,12 @@ tiptr = pdb_get_type_info(nptr->type); ret = tiptr->free_cb(nptr); } + nptr->data = NULL; + /* + * Remove from parent. + */ + pdb_del_node_from_parent(nptr); /* * Free node. |
From: Michael L. <par...@us...> - 2005-02-18 21:25:37
|
Update of /cvsroot/pdatabase/pdb/api_src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5663/api_src Modified Files: pdb.c Log Message: pdb_del() now uses pdb_free_node(). Updated api_src/pdb.c Index: pdb.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/api_src/pdb.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pdb.c 8 Feb 2005 15:10:18 -0000 1.1 +++ pdb.c 18 Feb 2005 21:25:29 -0000 1.2 @@ -74,6 +74,8 @@ int unload_pdb_lib() { int r; + if (!_pdb_obj) return 0; + #ifdef _PDB_VERBOSE printf("INFO: pdb.c: Unloading pdb library... "); #endif @@ -96,6 +98,8 @@ * (Re)cache the pdb shared object function pointers. */ void recache_pdb_lib() { + if (!_pdb_obj) return; + #ifdef _PDB_VERBOSE printf("INFO: pdb.c: Caching pdb function pointers...\n"); #endif @@ -122,6 +126,15 @@ dlsym(_pdb_obj, "pdb_set_free_method"); _pdb_funcs._pdb_count_children_fptr = dlsym(_pdb_obj, "pdb_count_children"); + _pdb_funcs._pdb_free_node_fptr = dlsym(_pdb_obj, "pdb_free_node"); + _pdb_funcs._pdb_create_tree_fptr = dlsym(_pdb_obj, "pdb_create_tree"); + _pdb_funcs._pdb_create_list_fptr = dlsym(_pdb_obj, "pdb_create_list"); + _pdb_funcs._pdb_create_hash_fptr = dlsym(_pdb_obj, "pdb_create_hash"); + _pdb_funcs._pdb_create_abstract_fptr = dlsym(_pdb_obj, + "pdb_create_abstract"); + _pdb_funcs._pdb_set_int_fptr = dlsym(_pdb_obj, "pdb_set_int"); + + #ifdef _PDB_VERBOSE printf("INFO: pdb.c: Cached pdb_load(): %s\n", (_pdb_funcs._pdb_load_fptr ? "success" : "failed")); @@ -157,6 +170,20 @@ (_pdb_funcs._pdb_set_free_method_fptr ? "success" : "failed")); printf("INFO: pdb.c: Cached pdb_count_children(): %s\n", (_pdb_funcs._pdb_count_children_fptr ? "success" : "failed")); + + printf("INFO: pdb.c: Cached pdb_free_node(): %s\n", + (_pdb_funcs._pdb_free_node_fptr ? "success" : "failed")); + + printf("INFO: pdb.c: Cached pdb_create_tree(): %s\n", + (_pdb_funcs._pdb_create_tree_fptr ? "success" : "failed")); + printf("INFO: pdb.c: Cached pdb_create_list(): %s\n", + (_pdb_funcs._pdb_create_list_fptr ? "success" : "failed")); + printf("INFO: pdb.c: Cached pdb_create_hash(): %s\n", + (_pdb_funcs._pdb_create_hash_fptr ? "success" : "failed")); + printf("INFO: pdb.c: Cached pdb_create_abstract(): %s\n", + (_pdb_funcs._pdb_create_abstract_fptr ? "success" : "failed")); + printf("INFO: pdb.c: Cached pdb_set_int(): %s\n", + (_pdb_funcs._pdb_set_int_fptr ? "success" : "failed")); #endif } @@ -165,73 +192,127 @@ * Function wrappers from library. */ struct pdb* pdb_load(char* file) { + if (!_pdb_obj) return NULL; return _pdb_funcs._pdb_load_fptr(file); } int pdb_unload(struct pdb* dbptr) { + if (!_pdb_obj) return 0; return _pdb_funcs._pdb_unload_fptr(dbptr); } void pdb_enable(struct pdb* dbptr, int settings) { + if (!_pdb_obj) return; _pdb_funcs._pdb_enable_fptr(dbptr, settings); } void pdb_disable(struct pdb* dbptr, int settings) { + if (!_pdb_obj) return; _pdb_funcs._pdb_disable_fptr(dbptr, settings); } int pdb_is_set(struct pdb* dbptr, int setting) { + if (!_pdb_obj) return 0; return _pdb_funcs._pdb_is_set_fptr(dbptr, setting); } int pdb_create_link(struct pdb* dbptr, char* path, char* key, struct pdb_node_t* tnptr) { + if (!_pdb_obj) return 0; return _pdb_funcs._pdb_create_link_fptr(dbptr, path, key, tnptr); } struct pdb_node_t* pdb_query_node(struct pdb* dbptr, char* path) { - return _pdb_funcs._pdb_query_fptr(dbptr, path); + if (!_pdb_obj) return NULL; + return _pdb_funcs._pdb_query_node_fptr(dbptr, path); } void* pdb_query(struct pdb* dbptr, char* path) { + if (!_pdb_obj) return NULL; return _pdb_funcs._pdb_query_fptr(dbptr, path); } struct pdb_node_t* pdb_set(struct pdb* dbptr, char* path, char* key, void* data) { + if (!_pdb_obj) return NULL; return _pdb_funcs._pdb_set_fptr(dbptr, path, key, data); } struct pdb_node_t* pdb_set_node(struct pdb* dbptr, char* path, char* key, void* data, int type) { + if (!_pdb_obj) return NULL; return _pdb_funcs._pdb_set_node_fptr(dbptr, path, key, data, type); } int pdb_del(struct pdb* dbptr, char* path) { + if (!_pdb_obj) return 0; return _pdb_funcs._pdb_del_fptr(dbptr, path); } char* pdb_trace(struct pdb_node_t* nptr) { + if (!_pdb_obj) return NULL; return _pdb_funcs._pdb_trace_fptr(nptr); } void pdb_set_write_interval(struct pdb* dbptr, int seconds) { + if (!_pdb_obj) return; _pdb_funcs._pdb_set_write_interval_fptr(dbptr, seconds); } int pdb_need_write(struct pdb* dbptr) { + if (!_pdb_obj) return 0; return _pdb_funcs._pdb_need_write_fptr(dbptr); } int pdb_write(struct pdb* dbptr, char* file) { + if (!_pdb_obj) return 0; return _pdb_funcs._pdb_write_fptr(dbptr, file); } void pdb_set_free_method(struct pdb* dbptr, struct pdb_node_t* nptr, void* free_cb) { + if (!_pdb_obj) return; _pdb_funcs._pdb_set_free_method_fptr(dbptr, nptr, free_cb); } int pdb_count_children(struct pdb* dbptr, char* path) { + if (!_pdb_obj) return 0; return _pdb_funcs._pdb_count_children_fptr(dbptr, path); } + +int pdb_free_node(struct pdb_node_t* nptr) { + if (!_pdb_obj) return 0; + return _pdb_funcs._pdb_free_node_fptr(nptr); +} + +/* + * Extra wrappers for pdb_set_node -- provided by the lib. + */ +struct pdb_node_t* pdb_create_tree(struct pdb* dbptr, char* path, char* key) { + if (!_pdb_obj) return NULL; + return _pdb_funcs._pdb_create_tree_fptr(dbptr, path, key); +} + +struct pdb_node_t* pdb_create_list(struct pdb* dbptr, char* path, char* key) { + if (!_pdb_obj) return NULL; + return _pdb_funcs._pdb_create_list_fptr(dbptr, path, key); +} + +struct pdb_node_t* pdb_create_hash(struct pdb* dbptr, char* path, char* key, + int size) { + if (!_pdb_obj) return NULL; + return _pdb_funcs._pdb_create_hash_fptr(dbptr, path, key, size); +} + +struct pdb_node_t* pdb_create_abstract(struct pdb* dbptr, char* path, + char* key, void* data, void* free_cb) { + if (!_pdb_obj) return NULL; + return _pdb_funcs._pdb_create_abstract_fptr(dbptr, path, key, data, + free_cb); +} + +struct pdb_node_t* pdb_set_int(struct pdb* dbptr, char* path, char* key, + int data) { + if (!_pdb_obj) return NULL; + return _pdb_funcs._pdb_set_int_fptr(dbptr, path, key, data); +} |
From: Michael L. <par...@us...> - 2005-02-13 19:21:10
|
Update of /cvsroot/pdatabase/pdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5976/src Modified Files: Makefile str.c Log Message: Added Makefiles and Anjuta project files. Index: Makefile =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile 10 Feb 2005 02:51:06 -0000 1.4 +++ Makefile 13 Feb 2005 19:20:55 -0000 1.5 @@ -1,392 +1,34 @@ -# Makefile.in generated automatically by automake 1.5 from Makefile.am. - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - - -SHELL = /bin/sh - -srcdir = . -top_srcdir = .. - -prefix = /usr/local -exec_prefix = ${prefix} - -bindir = ${exec_prefix}/bin -sbindir = ${exec_prefix}/sbin -libexecdir = ${exec_prefix}/libexec -datadir = ${prefix}/share -sysconfdir = ${prefix}/etc -sharedstatedir = ${prefix}/com -localstatedir = ${prefix}/var -libdir = ${exec_prefix}/lib -infodir = ${prefix}/info -mandir = ${prefix}/man -includedir = ${prefix}/include -oldincludedir = /usr/include -pkgdatadir = $(datadir)/pdb -pkglibdir = $(libdir)/pdb -pkgincludedir = $(includedir)/pdb -top_builddir = .. - -ACLOCAL = ${SHELL} /home/para/Projects/pdb/missing --run aclocal -AUTOCONF = ${SHELL} /home/para/Projects/pdb/missing --run autoconf -AUTOMAKE = ${SHELL} /home/para/Projects/pdb/missing --run automake -AUTOHEADER = ${SHELL} /home/para/Projects/pdb/missing --run autoheader +# Minimal Makefile +# +# By: Michael Laforest <paralizer -AT- users -DOT- sourceforge -DOT- net> -INSTALL = /bin/install -c -INSTALL_PROGRAM = ${INSTALL} -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_SCRIPT = ${INSTALL} -INSTALL_HEADER = $(INSTALL_DATA) -transform = s,x,x, -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = -host_triplet = x86_64-unknown-linux-gnu -AMTAR = ${SHELL} /home/para/Projects/pdb/missing --run tar -AR = ar -AS = @AS@ -AWK = gawk CC = gcc -CFLAGS = -CXX = g++ -CXXCPP = g++ -E -CXXFLAGS = -DEPDIR = .deps -DLLTOOL = @DLLTOOL@ -ECHO = echo -EGREP = grep -E -EXEEXT = -F77 = g77 -GCJ = @GCJ@ -GCJFLAGS = @GCJFLAGS@ -INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LN_S = ln -s -NO_PREFIX_PACKAGE_DATA_DIR = share -NO_PREFIX_PACKAGE_DOC_DIR = doc/pdb -NO_PREFIX_PACKAGE_HELP_DIR = share/help -NO_PREFIX_PACKAGE_MENU_DIR = share -NO_PREFIX_PACKAGE_PIXMAPS_DIR = share/pixmaps -OBJDUMP = @OBJDUMP@ -OBJEXT = o -PACKAGE = pdb -PACKAGE_DATA_DIR = /usr/local/share -PACKAGE_DOC_DIR = /usr/local/doc/pdb -PACKAGE_HELP_DIR = /usr/local/share/help -PACKAGE_MENU_DIR = /usr/local/share -PACKAGE_PIXMAPS_DIR = /usr/local/share/pixmaps -RANLIB = ranlib -RC = @RC@ -STRIP = strip -VERSION = 0.1 -am__include = include -am__quote = -install_sh = /home/para/Projects/pdb/install-sh - -INCLUDES = \ - -I../include/ - - -AM_CFLAGS = \ - -fPIC\ - -Wall\ - -g -pg - - -AM_CXXFLAGS = \ - -fPIC\ - -Wall\ - -g -pg - - -bin_PROGRAMS = pdb - -pdb_SOURCES = \ - pdb.c\ - pdb_file.c\ - pdb_parse.c\ - pdb_types.c\ - binarytree.c\ - list.c\ - str.c\ - hash.c - - -pdb_LDFLAGS = \ - -shared - - -pdb_LDADD = \ - -lm - -subdir = src -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -bin_PROGRAMS = pdb$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) - -am_pdb_OBJECTS = pdb.$(OBJEXT) pdb_file.$(OBJEXT) pdb_parse.$(OBJEXT) \ - pdb_types.$(OBJEXT) binarytree.$(OBJEXT) list.$(OBJEXT) \ - str.$(OBJEXT) hash.$(OBJEXT) -pdb_OBJECTS = $(am_pdb_OBJECTS) -pdb_DEPENDENCIES = - -DEFS = -DHAVE_CONFIG_H -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -CPPFLAGS = -LDFLAGS = -LIBS = -depcomp = $(SHELL) $(top_srcdir)/depcomp -DEP_FILES = $(DEPDIR)/binarytree.Po $(DEPDIR)/hash.Po \ - $(DEPDIR)/list.Po $(DEPDIR)/pdb.Po \ - $(DEPDIR)/pdb_file.Po $(DEPDIR)/pdb_parse.Po \ - $(DEPDIR)/pdb_types.Po $(DEPDIR)/str.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(pdb_SOURCES) -DIST_COMMON = Makefile.am Makefile.in -SOURCES = $(pdb_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && \ - CONFIG_HEADERS= CONFIG_LINKS= \ - CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - || test -f $$p1 \ - ; then \ - f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f; \ - else :; fi; \ - done -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ - rm -f $(DESTDIR)$(bindir)/$$f; \ - done +CFLAGS = -Wall -g +LDFLAGS = -shared +DEPFLAGS = -fPIC -clean-binPROGRAMS: - -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) -pdb$(EXEEXT): $(pdb_OBJECTS) $(pdb_DEPENDENCIES) - @rm -f pdb$(EXEEXT) - $(LINK) $(pdb_LDFLAGS) $(pdb_OBJECTS) $(pdb_LDADD) $(LIBS) +# Needed to recognize .c as a file suffix +.SUFFIXES: $(SUFFIXES) . -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core +BIN = pdb +INCLUDES = -I. -I../include +OBJS = binarytree.o \ + hash.o \ + list.o \ + pdb.o \ + pdb_file.o \ + pdb_parse.o \ + pdb_types.o \ + str.o \ -distclean-compile: - -rm -f *.tab.c +all: $(BIN) -include $(DEPDIR)/binarytree.Po -include $(DEPDIR)/hash.Po -include $(DEPDIR)/list.Po -include $(DEPDIR)/pdb.Po -include $(DEPDIR)/pdb_file.Po -include $(DEPDIR)/pdb_parse.Po -include $(DEPDIR)/pdb_types.Po -include $(DEPDIR)/str.Po +clean: + rm *.o -distclean-depend: - -rm -rf $(DEPDIR) +$(BIN): $(OBJS) + $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $(BIN) .c.o: - source='$<' object='$@' libtool=no \ - depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \ - $(CCDEPMODE) $(depcomp) \ - $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< - -.c.obj: - source='$<' object='$@' libtool=no \ - depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \ - $(CCDEPMODE) $(depcomp) \ - $(COMPILE) -c `cygpath -w $<` - -.c.lo: - source='$<' object='$@' libtool=yes \ - depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' \ - $(CCDEPMODE) $(depcomp) \ - $(LTCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$< -CCDEPMODE = depmode=gcc3 -uninstall-info-am: - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique $(LISP) - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ - || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) - -GTAGS: - here=`CDPATH=: && cd $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH - -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @for file in $(DISTFILES); do \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - $(mkinstalldirs) "$(distdir)/$$dir"; \ - fi; \ - if test -d $$d/$$file; then \ - cp -pR $$d/$$file $(distdir) \ - || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) - -installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) - -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -distclean-am: clean-am distclean-compile distclean-depend \ - distclean-generic distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: install-binPROGRAMS - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -uninstall-am: uninstall-binPROGRAMS uninstall-info-am - -.PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libtool distclean distclean-compile \ - distclean-depend distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-binPROGRAMS install-data install-data-am \ - install-exec install-exec-am install-info install-info-am \ - install-man install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool tags uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: + $(CC) $(CFLAGS) $(DEPFLAGS) $(INCLUDES) -c $*.c Index: str.c =================================================================== RCS file: /cvsroot/pdatabase/pdb/src/str.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- str.c 25 Jan 2005 02:29:42 -0000 1.4 +++ str.c 13 Feb 2005 19:20:55 -0000 1.5 @@ -25,8 +25,6 @@ * related functions. */ -#include "../config.h" - #include <stdio.h> #include <stdarg.h> #include <malloc.h> |
From: Michael L. <par...@us...> - 2005-02-13 19:21:10
|
Update of /cvsroot/pdatabase/pdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5976 Modified Files: .cvsignore Added Files: Makefile pdb.prj pdb.pws Log Message: Added Makefiles and Anjuta project files. Index: .cvsignore =================================================================== RCS file: /cvsroot/pdatabase/pdb/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- .cvsignore 13 Feb 2005 19:09:30 -0000 1.2 +++ .cvsignore 13 Feb 2005 19:20:55 -0000 1.3 @@ -1 +1,4 @@ *valgrind* +pdb.prj +pdb.prj.bak +pdb.pws --- NEW FILE: Makefile --- # Minimal Makefile # # By: Michael Laforest <paralizer -AT- users -DOT- sourceforge -DOT- net> # # This Makefile will invoke the Makefile in # the src/ subdirectory. BIN = pdb all: $(BIN) $(BIN): cd src && make clean: cd src && make clean --- NEW FILE: pdb.pws --- [executer] RunInTerminal=true [Project State] clean before build=false [filelist] 0=/home/para/Projects/pdb/src/str.c [filenumbers] 0=28 [filemarkers] 0= [File View] filter.file.unmatch=*.so *.o *.a *.la filter.file.ignore.hidden=0 filter.dir.ignore.hidden=0 [Project Tree] 0=0 1=0:0 2=0:1 [File Tree] 0=0 --- NEW FILE: pdb.prj --- # Anjuta Version 1.2.2 Compatibility Level: 1 <PROJECT_DESCRIPTION_START> A small abstracted database-like dynamic data structure written in C. Can read and write to disk in a manner easily editable by text editors. The structure is intended for C/C++ developers who require a small, yet fast and flexible, data storage method.<PROJECT_DESCRIPTION_END> <CONFIG_PROGS_START> <CONFIG_PROGS_END> <CONFIG_LIBS_START> <CONFIG_LIBS_END> <CONFIG_HEADERS_START> <CONFIG_HEADERS_END> <CONFIG_CHARACTERISTICS_START> <CONFIG_CHARACTERISTICS_END> <CONFIG_LIB_FUNCS_START> <CONFIG_LIB_FUNCS_END> <CONFIG_ADDITIONAL_START> <CONFIG_ADDITIONAL_END> <CONFIG_FILES_START> <CONFIG_FILES_END> <MAKEFILE_AM_START> <MAKEFILE_AM_END> props.file.type=project anjuta.version=1.2.2 anjuta.compatibility.level=1 project.name=pdb project.type=GENERIC project.target.type=EXECUTABLE project.version=0.0.1 project.author=Michael Laforest <fi...@mc...> project.source.target=pdb project.has.gettext=0 project.gui.command= project.programming.language=C_C++ project.excluded.modules=intl project.config.extra.modules.before= project.config.extra.modules.after= project.config.blocked=1 project.config.disable.overwriting=1 1 1 1 1 1 1 1 1 project.menu.entry=pdb Version 0.0.1 project.menu.group=Application project.menu.comment=pdb Version 0.0.1 project.menu.icon= project.menu.need.terminal=0 project.configure.options= anjuta.program.arguments= preferences.build.option.jobs=0 preferences.build.option.silent=0 preferences.build.option.autosave=0 preferences.make=make preferences.build.option.keep.going=1 preferences.build.option.warn.undef=0 preferences.autoformat.custom.style= -i8 -sc -bli0 -bl0 -cbi0 -ss preferences.indent.opening=0 preferences.autoformat.disable=1 preferences.indent.automatic=1 preferences.use.tabs=1 preferences.indent.size=4 preferences.tabsize=4 preferences.indent.closing=0 module.include.name=. module.include.type= module.include.files=\ api_src/pdb.h\ include/binarytree.h\ include/hash.h\ include/list.h\ include/pdb.h\ include/pdb_file.h\ include/pdb_parse.h\ include/pdb_types.h\ include/str.h module.source.name=. module.source.type= module.source.files=\ api_src/pdb.c\ src/binarytree.c\ src/hash.c\ src/list.c\ src/pdb.c\ src/pdb_file.c\ src/pdb_parse.c\ src/pdb_types.c\ src/str.c module.pixmap.name=. module.pixmap.type= module.pixmap.files= module.data.name=. module.data.type= module.data.files= module.help.name=. module.help.type= module.help.files= module.doc.name=. module.doc.type= module.doc.files= module.po.files= compiler.options.supports= compiler.options.include.paths=\ .\ .. compiler.options.library.paths= compiler.options.libraries= compiler.options.libraries.selected= compiler.options.defines=\ HAVE_CONFIG_H compiler.options.defines.selected= compiler.options.warning.buttons=0 0 1 1 0 1 0 0 0 0 0 0 0 1 0 0 compiler.options.optimize.buttons=0 0 1 0 compiler.options.other.buttons=1 0 compiler.options.other.c.flags= compiler.options.other.l.flags= compiler.options.other.l.libs= project.src.paths= |
From: Michael L. <par...@us...> - 2005-02-13 19:09:56
|
Update of /cvsroot/pdatabase/pdb/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32682/include Removed Files: Makefile Makefile.am Makefile.in Log Message: Removed unneeded files. --- Makefile.in DELETED --- --- Makefile.am DELETED --- --- Makefile DELETED --- |
Update of /cvsroot/pdatabase/pdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32682 Modified Files: .cvsignore Removed Files: AUTHORS ChangeLog Makefile Makefile.am Makefile.in NEWS README TODO acconfig.h acinclude.m4 aclocal.m4 autogen.sh config.guess config.h config.h.in config.log config.status config.sub configure configure.in libtool ltmain.sh pdb.prj pdb.pws setup-gettext stamp-h stamp-h.in stamp-h1 Log Message: Removed unneeded files. Index: .cvsignore =================================================================== RCS file: /cvsroot/pdatabase/pdb/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- .cvsignore 18 Oct 2004 00:22:34 -0000 1.1 +++ .cvsignore 13 Feb 2005 19:09:30 -0000 1.2 @@ -1,30 +1 @@ *valgrind* -.tm_project.cache -Makefile -Makefile.am -Makefile.in -acconfig.h -acinclude.m4 -aclocal.m4 -autogen.sh -autom4te.cache -config.* -config.guess -config.h -config.h.in -config.log -config.status -config.sub -configure -configure.in -pdb.prj.bak -pdb.pws -install-sh -libtool -ltmain.sh -missing -mkinstalldirs -setup-gettext -stamp-h -stamp-h.in - --- setup-gettext DELETED --- --- configure DELETED --- --- configure.in DELETED --- --- Makefile.in DELETED --- --- config.sub DELETED --- --- config.status DELETED --- --- Makefile DELETED --- --- pdb.pws DELETED --- --- stamp-h DELETED --- --- libtool DELETED --- --- aclocal.m4 DELETED --- --- NEWS DELETED --- --- pdb.prj DELETED --- --- TODO DELETED --- --- config.h DELETED --- --- acconfig.h DELETED --- --- stamp-h.in DELETED --- --- config.h.in DELETED --- --- acinclude.m4 DELETED --- --- ChangeLog DELETED --- --- config.guess DELETED --- --- config.log DELETED --- --- ltmain.sh DELETED --- --- Makefile.am DELETED --- --- AUTHORS DELETED --- --- README DELETED --- --- stamp-h1 DELETED --- --- autogen.sh DELETED --- |