Compare commits
79 Commits
libnode-2_
...
libnode-2_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7afac7d349 | ||
|
|
e1409ab6d8 | ||
|
|
702c0f117d | ||
|
|
0d4b1d3125 | ||
|
|
ec7a688881 | ||
|
|
90eb853801 | ||
|
|
8cfdf696d1 | ||
|
|
986c67d2fc | ||
|
|
b7ce3250e1 | ||
|
|
6a6ae07870 | ||
|
|
b477d4b154 | ||
|
|
334f0cbeb1 | ||
|
|
676814b6cf | ||
|
|
f7c1f8bc5f | ||
|
|
652ab987a4 | ||
|
|
0431691352 | ||
|
|
3ad6e01702 | ||
|
|
4bf44a1fff | ||
|
|
aa69e7e7b1 | ||
|
|
29f7064ed0 | ||
|
|
97d57e391f | ||
|
|
d1778a5431 | ||
|
|
416ee6de00 | ||
|
|
8c1000401d | ||
|
|
11f4f585b3 | ||
|
|
0990ad102d | ||
|
|
da9d517e9a | ||
|
|
d50da065a6 | ||
|
|
f8f96b1ec8 | ||
|
|
b49d497bfb | ||
|
|
80665f9931 | ||
|
|
1d9539466d | ||
|
|
3ce278d6e5 | ||
|
|
3d91078a5c | ||
|
|
51482fb475 | ||
|
|
75cfc21e01 | ||
|
|
5aea056299 | ||
|
|
3f6d118ae2 | ||
|
|
7c96ad706b | ||
|
|
c70c4e5aba | ||
|
|
7f142acda3 | ||
|
|
64baaa1bc5 | ||
|
|
77330558f0 | ||
|
|
4634d49ce9 | ||
|
|
6cae72830f | ||
|
|
61dfd5c682 | ||
|
|
898992430e | ||
|
|
3c40fadbff | ||
|
|
126de83bc9 | ||
|
|
8541d83655 | ||
|
|
2274de2cf2 | ||
|
|
fa40487565 | ||
|
|
79b8e412a2 | ||
|
|
de448e9237 | ||
|
|
f3598b72e5 | ||
|
|
f2f8facb0e | ||
|
|
d299d7ce87 | ||
|
|
05877292fa | ||
|
|
ee32700240 | ||
|
|
7c7ecea547 | ||
|
|
3b595554f4 | ||
|
|
352f592518 | ||
|
|
211babbf5b | ||
|
|
adbf463812 | ||
|
|
c4617d7c1f | ||
|
|
2f56c19c82 | ||
|
|
3443aba602 | ||
|
|
655e66ee8b | ||
|
|
6410c70eb1 | ||
|
|
69d684f700 | ||
|
|
a10f0b1cf5 | ||
|
|
6ded620c00 | ||
|
|
0514715693 | ||
|
|
c4969560a3 | ||
|
|
10a6a983c5 | ||
|
|
78e9d49e45 | ||
|
|
27c0b3cda7 | ||
|
|
a0addad286 | ||
|
|
9bb2b42716 |
25
Makefile
Normal file
25
Makefile
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# $RCSfile: Makefile,v $
|
||||||
|
# $Revision: 1.3 $
|
||||||
|
# $Name: $
|
||||||
|
# $Date: 2003/07/16 23:32:06 $
|
||||||
|
# $Author: agibert $
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Main Makefile
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
SUBDIRS := include lib util demo doc
|
||||||
|
|
||||||
|
FILE_DOC := *.txt
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
include Makefile.var
|
||||||
|
include Makefile.rule
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
dir_clean:
|
||||||
|
$(RM) $(PROG_VERSION_NAME).src.*
|
||||||
359
Makefile.rule
Normal file
359
Makefile.rule
Normal file
@@ -0,0 +1,359 @@
|
|||||||
|
# $RCSfile: Makefile.rule,v $
|
||||||
|
# $Revision: 1.5 $
|
||||||
|
# $Name: $
|
||||||
|
# $Date: 2010/06/06 21:28:14 $
|
||||||
|
# $Author: agibert $
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Rule Makefile
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------- DEFAULT RULES ---------------------
|
||||||
|
default:all
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------- IMPLICITES RULES ---------------------
|
||||||
|
|
||||||
|
# Here are all the rules allowing to compile sources files
|
||||||
|
# c -> o
|
||||||
|
%.o:%.c
|
||||||
|
$(CC) $(CFLAGS) $(INCLUDE) -fPIC -c $< -o $@
|
||||||
|
|
||||||
|
# c -> executable
|
||||||
|
.c :
|
||||||
|
$(CC) $(CFLAGS) $(INCLUDE) $< -o $@ -I . $(LIB)
|
||||||
|
|
||||||
|
# o -> executable
|
||||||
|
%:%.o
|
||||||
|
$(CC) $(LFLAGS) -o $@ $? $(LIB)
|
||||||
|
|
||||||
|
# .o -> .so
|
||||||
|
%.so:%.o
|
||||||
|
$(CC) $(LDSOFLAGS) -shared -o $@ $? $(LIB)
|
||||||
|
|
||||||
|
%.a:%.o
|
||||||
|
$(AR) -r $@ $?
|
||||||
|
|
||||||
|
$(OBJECTS) : $(SRC)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# "depend" rule allow to build the dependancy file
|
||||||
|
depend:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# "all" Rule
|
||||||
|
all: dir_all
|
||||||
|
ifneq ($(SUBDIRS),)
|
||||||
|
for d in $(SUBDIRS) ; do $(MAKE) all -C $$d/ ; done
|
||||||
|
endif
|
||||||
|
|
||||||
|
dir_all: $(TARGETS)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# "clean" Rule
|
||||||
|
clean: dir_clean
|
||||||
|
ifneq ($(SUBDIRS),)
|
||||||
|
for d in $(SUBDIRS) ; do $(MAKE) clean -C $$d/ ; done
|
||||||
|
endif
|
||||||
|
|
||||||
|
dir_clean:
|
||||||
|
@(command="$(RM) $(TARGETS) $$(echo $(SRC) | sed "s/\.c/\.o/g") ;" ; \
|
||||||
|
echo $$command ; \
|
||||||
|
eval $$command ;)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# "pre_install" Rule
|
||||||
|
# This empty rule can be overiden in module Makefile in order to run pre-install commands.
|
||||||
|
pre_install:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# "post_install" Rule
|
||||||
|
# This empty rule can be overiden in module Makefile in order to run post-install commands.
|
||||||
|
post_install:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# "install" Rule
|
||||||
|
install: dir_install
|
||||||
|
ifneq ($(SUBDIRS),)
|
||||||
|
for d in $(SUBDIRS) ; do $(MAKE) install -C $$d/ ; done
|
||||||
|
endif
|
||||||
|
|
||||||
|
dir_install: dir_all
|
||||||
|
$(MAKE) pre_install
|
||||||
|
ifneq ($(FILE_BIN),)
|
||||||
|
@if test ! -d $(PATH_BIN) ; then $(MKDIR) $(PATH_BIN) ; fi
|
||||||
|
$(INSTALLBIN) $(FILE_BIN) $(PATH_BIN)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_BINSUID),)
|
||||||
|
@if test ! -d $(PATH_BINSUID) ; then $(MKDIR) $(PATH_BINSUID) ; fi
|
||||||
|
$(INSTALLBINSUID) $(FILE_BINSUID) $(PATH_BINSUID)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_CGI),)
|
||||||
|
@if test ! -d $(PATH_CGI) ; then $(MKDIR) $(PATH_CGI) ; fi
|
||||||
|
$(INSTALLCGI) $(FILE_CGI) $(PATH_CGI)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_DOC),)
|
||||||
|
@if test ! -d $(PATH_DOC) ; then $(MKDIR) $(PATH_DOC) ; fi
|
||||||
|
$(INSTALLDOC) $(FILE_DOC) $(PATH_DOC)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_ETC),)
|
||||||
|
@if test ! -d $(PATH_ETC) ; then $(MKDIR) $(PATH_ETC) ; fi
|
||||||
|
$(INSTALLETC) $(FILE_ETC) $(PATH_ETC)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_HOME),)
|
||||||
|
@if test ! -d $(PATH_HOME) ; then $(MKDIR) $(PATH_HOME) ; fi
|
||||||
|
$(INSTALLHOME) $(FILE_HOME) $(PATH_HOME)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_HOMEBIN),)
|
||||||
|
@if test ! -d $(PATH_HOMEBIN) ; then $(MKDIR) $(PATH_HOMEBIN) ; fi
|
||||||
|
$(INSTALLHOMEBIN) $(FILE_HOMEBIN) $(PATH_HOMEBIN)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_LIB),)
|
||||||
|
@if test ! -d $(PATH_LIB) ; then $(MKDIR) $(PATH_LIB) ; fi
|
||||||
|
$(INSTALLLIB) $(FILE_LIB) $(PATH_LIB)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_HOMELIB),)
|
||||||
|
@if test ! -d $(PATH_HOMELIB) ; then $(MKDIR) $(PATH_HOMELIB) ; fi
|
||||||
|
$(INSTALLHOMELIB) $(FILE_HOMELIB) $(PATH_HOMELIB)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_INCLUDE),)
|
||||||
|
@if test ! -d $(PATH_INCLUDE) ; then $(MKDIR) $(PATH_INCLUDE) ; fi
|
||||||
|
$(INSTALLINCLUDE) $(FILE_INCLUDE) $(PATH_INCLUDE)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_MAN),)
|
||||||
|
@for d in $(FILE_MAN) ; do \
|
||||||
|
if test ! -d $(PATH_MAN)/$(FILE_MAN) ; then \
|
||||||
|
$(MKDIR) $(PATH_MAN)/$(FILE_MAN) ; \
|
||||||
|
fi ; \
|
||||||
|
$(INSTALLMAN) $(FILE_MAN)/* $(PATH_MAN)/$(FILE_MAN) ; \
|
||||||
|
done
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_WEBCONF),)
|
||||||
|
@if test ! -d $(PATH_WEBCONF) ; then $(MKDIR) $(PATH_WEBCONF) ; fi
|
||||||
|
$(INSTALLWEBCONF) $(FILE_WEBCONF) $(PATH_WEBCONF)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_WEBCONFSSL),)
|
||||||
|
@if test ! -d $(PATH_WEBCONFSSL) ; then $(MKDIR) $(PATH_WEBCONFSSL) ; fi
|
||||||
|
$(INSTALLWEBCONFSSL) $(FILE_WEBCONFSSL) $(PATH_WEBCONFSSL)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_HTML),)
|
||||||
|
@if test ! -d $(PATH_HTML) ; then $(MKDIR) $(PATH_HTML) ; fi
|
||||||
|
$(INSTALLHTML) $(FILE_HTML) $(PATH_HTML)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_WEBICONS),)
|
||||||
|
@if test ! -d $(PATH_WEBICONS) ; then $(MKDIR) $(PATH_WEBICONS) ; fi
|
||||||
|
$(INSTALLWEBICONS) $(FILE_WEBICONS) $(PATH_WEBICONS)
|
||||||
|
endif
|
||||||
|
$(MAKE) post_install
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# "pre_uninstall" Rule
|
||||||
|
# This empty rule can be overiden in module Makefile in order to run pre-uninstall commands.
|
||||||
|
|
||||||
|
pre_uninstall:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# "post_uninstall" Rule
|
||||||
|
# This empty rule can be overiden in module Makefile in order to run post-uninstall commands.
|
||||||
|
post_uninstall:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# "uninstall" Rule
|
||||||
|
uninstall: dir_uninstall
|
||||||
|
ifneq ($(SUBDIRS),)
|
||||||
|
for d in $(SUBDIRS) ; do $(MAKE) uninstall -C $$d/ ; done
|
||||||
|
endif
|
||||||
|
|
||||||
|
dir_uninstall:
|
||||||
|
$(MAKE) pre_uninstall
|
||||||
|
ifneq ($(FILE_BIN),)
|
||||||
|
@(if test -d $(PATH_BIN) ; then \
|
||||||
|
$(CD) $(PATH_BIN) ; \
|
||||||
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
||||||
|
if [ $$? -ne 0 ] ; then \
|
||||||
|
echo "$(CD) $(PATH_BIN)" ; \
|
||||||
|
echo "$(RM) $(FILE_BIN)" ; \
|
||||||
|
fi ; \
|
||||||
|
$(RM) $(FILE_BIN) ; \
|
||||||
|
fi)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_BINSUID),)
|
||||||
|
@(if test -d $(PATH_BINSUID) ; then \
|
||||||
|
$(CD) $(PATH_BINSUID) ; \
|
||||||
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
||||||
|
if [ $$? -ne 0 ] ; then \
|
||||||
|
echo "$(CD) $(PATH_BINSUID)" ; \
|
||||||
|
echo "$(RM) $(FILE_BINSUID)" ; \
|
||||||
|
fi ; \
|
||||||
|
$(RM) $(FILE_BINSUID) ; \
|
||||||
|
fi)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_CGI),)
|
||||||
|
@(if test -d $(PATH_CGI) ; then \
|
||||||
|
$(CD) $(PATH_CGI) ; \
|
||||||
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
||||||
|
if [ $$? -ne 0 ] ; then \
|
||||||
|
echo "$(CD) $(PATH_CGI)" ; \
|
||||||
|
echo "$(RM) $(FILE_CGI)" ; \
|
||||||
|
fi ; \
|
||||||
|
$(RM) $(FILE_CGI) ; \
|
||||||
|
fi)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_DOC),)
|
||||||
|
@(if test -d $(PATH_DOC) ; then \
|
||||||
|
$(CD) $(PATH_DOC) ; \
|
||||||
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
||||||
|
if [ $$? -ne 0 ] ; then \
|
||||||
|
echo "$(CD) $(PATH_DOC)" ; \
|
||||||
|
echo "$(RM) $(FILE_DOC)" ; \
|
||||||
|
fi ; \
|
||||||
|
$(RM) $(FILE_DOC) ; \
|
||||||
|
fi)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_ETC),)
|
||||||
|
@(if test -d $(PATH_ETC) ; then \
|
||||||
|
$(CD) $(PATH_ETC) ; \
|
||||||
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
||||||
|
if [ $$? -ne 0 ] ; then \
|
||||||
|
echo "$(CD) $(PATH_ETC)" ; \
|
||||||
|
echo "$(RM) $(FILE_ETC)" ; \
|
||||||
|
fi ; \
|
||||||
|
$(RM) $(FILE_ETC) ; \
|
||||||
|
fi)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_HOME),)
|
||||||
|
@(if test -d $(PATH_HOME) ; then \
|
||||||
|
$(CD) $(PATH_HOME) ; \
|
||||||
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
||||||
|
if [ $$? -ne 0 ] ; then \
|
||||||
|
echo "$(CD) $(PATH_HOME)" ; \
|
||||||
|
echo "$(RM) $(FILE_HOME)" ; \
|
||||||
|
fi ; \
|
||||||
|
$(RM) $(FILE_HOME) ; \
|
||||||
|
fi)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_HOMEBIN),)
|
||||||
|
@(if test -d $(PATH_HOMEBIN) ; then \
|
||||||
|
$(CD) $(PATH_HOMEBIN) ; \
|
||||||
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
||||||
|
if [ $$? -ne 0 ] ; then \
|
||||||
|
echo "$(CD) $(PATH_HOMEBIN)" ; \
|
||||||
|
echo "$(RM) $(FILE_HOMEBIN)" ; \
|
||||||
|
fi ; \
|
||||||
|
$(RM) $(FILE_HOMEBIN) ; \
|
||||||
|
fi)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_LIB),)
|
||||||
|
@(if test -d $(PATH_LIB) ; then \
|
||||||
|
$(CD) $(PATH_LIB) ; \
|
||||||
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
||||||
|
if [ $$? -ne 0 ] ; then \
|
||||||
|
echo "$(CD) $(PATH_LIB)" ; \
|
||||||
|
echo "$(RM) $(FILE_LIB)" ; \
|
||||||
|
fi ; \
|
||||||
|
$(RM) $(FILE_LIB) ; \
|
||||||
|
fi)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_HOMELIB),)
|
||||||
|
@(if test -d $(PATH_HOMELIB) ; then \
|
||||||
|
$(CD) $(PATH_HOMELIB) ; \
|
||||||
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
||||||
|
if [ $$? -ne 0 ] ; then \
|
||||||
|
echo "$(CD) $(PATH_HOMELIB)" ; \
|
||||||
|
echo "$(RM) $(FILE_HOMELIB)" ; \
|
||||||
|
fi ; \
|
||||||
|
$(RM) $(FILE_HOMELIB) ; \
|
||||||
|
fi)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_INCLUDE),)
|
||||||
|
@(if test -d $(PATH_INCLUDE) ; then \
|
||||||
|
$(CD) $(PATH_INCLUDE) ; \
|
||||||
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
||||||
|
if [ $$? -ne 0 ] ; then \
|
||||||
|
echo "$(CD) $(PATH_INCLUDE)" ; \
|
||||||
|
echo "$(RM) $(FILE_INCLUDE)" ; \
|
||||||
|
fi ; \
|
||||||
|
$(RM) $(FILE_INCLUDE) ; \
|
||||||
|
fi)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_MAN),)
|
||||||
|
@(if test -d $(PATH_MAN) ; then \
|
||||||
|
$(CD) $(PATH_MAN) ; \
|
||||||
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
||||||
|
if [ $$? -ne 0 ] ; then \
|
||||||
|
echo "$(CD) $(PATH_MAN)" ; \
|
||||||
|
echo "$(RM) $(FILE_MAN)" ; \
|
||||||
|
fi ; \
|
||||||
|
$(RM) $(FILE_MAN) ; \
|
||||||
|
fi)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_WEBCONF),)
|
||||||
|
@(if test -d $(PATH_WEBCONF) ; then \
|
||||||
|
$(CD) $(PATH_WEBCONF) ; \
|
||||||
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
||||||
|
if [ $$? -ne 0 ] ; then \
|
||||||
|
echo "$(CD) $(PATH_WEBCONF)" ; \
|
||||||
|
echo "$(RM) $(FILE_WEBCONF)" ; \
|
||||||
|
fi ; \
|
||||||
|
$(RM) $(FILE_WEBCONF) ; \
|
||||||
|
fi)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_WEBCONFSSL),)
|
||||||
|
@(if test -d $(PATH_WEBCONFSSL) ; then \
|
||||||
|
$(CD) $(PATH_WEBCONFSSL) ; \
|
||||||
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
||||||
|
if [ $$? -ne 0 ] ; then \
|
||||||
|
echo "$(CD) $(PATH_WEBCONFSSL)" ; \
|
||||||
|
echo "$(RM) $(FILE_WEBCONFSSL)" ; \
|
||||||
|
fi ; \
|
||||||
|
$(RM) $(FILE_WEBCONFSSL) ; \
|
||||||
|
fi)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_HTML),)
|
||||||
|
@(if test -d $(PATH_HTML) ; then \
|
||||||
|
$(CD) $(PATH_HTML) ; \
|
||||||
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
||||||
|
if [ $$? -ne 0 ] ; then \
|
||||||
|
echo "$(CD) $(PATH_HTML)" ; \
|
||||||
|
echo "$(RM) $(FILE_HTML)" ; \
|
||||||
|
fi ; \
|
||||||
|
$(RM) $(FILE_HTML) ; \
|
||||||
|
fi)
|
||||||
|
endif
|
||||||
|
ifneq ($(FILE_WEBICONS),)
|
||||||
|
@(if test -d $(PATH_WEBICONS) ; then \
|
||||||
|
$(CD) $(PATH_WEBICONS) ; \
|
||||||
|
(echo $(MAKEFLAGS) | grep s) > /dev/null ; \
|
||||||
|
if [ $$? -ne 0 ] ; then \
|
||||||
|
echo "$(CD) $(PATH_WEBICONS)" ; \
|
||||||
|
echo "$(RM) $(FILE_WEBICONS)" ; \
|
||||||
|
fi ; \
|
||||||
|
$(RM) $(FILE_WEBICONS) ; \
|
||||||
|
fi)
|
||||||
|
endif
|
||||||
|
$(MAKE) post_uninstall
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# "distrib" Rule
|
||||||
|
distrib:
|
||||||
|
$(MAKE) clean
|
||||||
|
$(MKDIR) $(TMP_DIR)/$(PROG_VERSION_NAME)
|
||||||
|
$(TAR) cf - . | $(TAR) xvpf - -C $(TMP_DIR)/$(PROG_VERSION_NAME)
|
||||||
|
$(TAR) cvf - -C $(TMP_DIR) --exclude CVS $(PROG_VERSION_NAME) | $(GZIP) -9 >$(PROG_VERSION_NAME).src.tgz
|
||||||
|
$(TAR) cvf - -C $(TMP_DIR) --exclude CVS $(PROG_VERSION_NAME) | $(BZIP2) -9 >$(PROG_VERSION_NAME).src.tbz2
|
||||||
|
$(MV) $(TMP_DIR)/$(PROG_VERSION_NAME) .
|
||||||
|
$(ZIP) -r -m -9 $(PROG_VERSION_NAME).src.zip $(PROG_VERSION_NAME) -x \*/CVS/\*
|
||||||
|
$(RM) -r $(PROG_VERSION_NAME)
|
||||||
92
Makefile.var
Normal file
92
Makefile.var
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
# $RCSfile: Makefile.var,v $
|
||||||
|
# $Revision: 1.4 $
|
||||||
|
# $Name: $
|
||||||
|
# $Date: 2005/01/19 23:30:05 $
|
||||||
|
# $Author: agibert $
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Variable Makefile
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
PROG_NAME=libnode
|
||||||
|
PROG_TAG=$Name: $
|
||||||
|
|
||||||
|
ifeq ($(words $(PROG_TAG)),2)
|
||||||
|
PROG_VERSION_NAME=$(subst _,.,$(word 2, $(PROG_TAG)))
|
||||||
|
else
|
||||||
|
PROG_VERSION_NAME=$(PROG_NAME)
|
||||||
|
endif
|
||||||
|
|
||||||
|
CC=/usr/bin/gcc
|
||||||
|
AR=/usr/bin/ar
|
||||||
|
|
||||||
|
CD=cd
|
||||||
|
MKDIR=/bin/mkdir -p
|
||||||
|
RM=/bin/rm -f
|
||||||
|
MV=/bin/mv
|
||||||
|
TAR=tar
|
||||||
|
GZIP=gzip
|
||||||
|
BZIP2=bzip2
|
||||||
|
ZIP=zip
|
||||||
|
|
||||||
|
PATH_WEB=$(addprefix /var/httpd/, $(PROG_NAME))
|
||||||
|
|
||||||
|
INSTALLBIN=/usr/bin/install -m 755
|
||||||
|
INSTALLBINSUID=/usr/bin/install -m 4755
|
||||||
|
INSTALLCGI=/usr/bin/install -m 555
|
||||||
|
INSTALLDOC=/usr/bin/install -m 444
|
||||||
|
INSTALLETC=/usr/bin/install -m 600
|
||||||
|
INSTALLHOME=/usr/bin/install -m 400
|
||||||
|
INSTALLHOMEBIN=/usr/bin/install -m 750
|
||||||
|
INSTALLLIB=/usr/bin/install -m 755
|
||||||
|
INSTALLHOMELIB=/usr/bin/install -m 755
|
||||||
|
INSTALLINCLUDE=/usr/bin/install -m 644
|
||||||
|
INSTALLMAN=/usr/bin/install -m 644
|
||||||
|
INSTALLWEBCONF=/usr/bin/install -m 644
|
||||||
|
INSTALLWEBCONFSSL=/usr/bin/install -m 644
|
||||||
|
INSTALLHTML=/usr/bin/install -m 444
|
||||||
|
INSTALLWEBICONS=/usr/bin/install -m 444
|
||||||
|
|
||||||
|
ifeq ($(ROOT),)
|
||||||
|
HOME_DIR := /
|
||||||
|
else
|
||||||
|
HOME_DIR := $(ROOT)
|
||||||
|
endif
|
||||||
|
|
||||||
|
PATH_BIN := $(addprefix $(HOME_DIR),/usr/bin)
|
||||||
|
PATH_BINSUID := $(PATH_BIN)
|
||||||
|
PATH_CGI := $(addprefix $(HOME_DIR),$(addprefix $(PATH_WEB),/cgi-bin))
|
||||||
|
PATH_DOC := $(addprefix $(HOME_DIR),$(addprefix /usr/share/doc/,$(PROG_VERSION_NAME)))
|
||||||
|
PATH_ETC := $(addprefix $(HOME_DIR),$(addprefix /etc/,$(MODULE)))
|
||||||
|
PATH_HOME := $(addprefix $(HOME_DIR),$(addprefix $(addprefix /var/lib/, $(PROG_NAME)), $(MODULE)))
|
||||||
|
PATH_HOMEBIN := $(addprefix $(HOME_DIR), $(addprefix $(addprefix /var/lib/, $(PROG_NAME)), /bin))
|
||||||
|
PATH_LIB := $(addprefix $(HOME_DIR),/usr/lib)
|
||||||
|
PATH_HOMELIB := $(addprefix $(HOME_DIR), $(addprefix $(addprefix /var/lib/, $(PROG_NAME)), /lib))
|
||||||
|
PATH_INCLUDE := $(addprefix $(HOME_DIR),/usr/include)
|
||||||
|
PATH_MAN := $(addprefix $(HOME_DIR),/usr/share/man)
|
||||||
|
PATH_WEBCONF := $(addprefix $(HOME_DIR),/etc/httpd/conf/vhosts)
|
||||||
|
PATH_WEBCONFSSL := $(addprefix $(HOME_DIR),/etc/httpd/conf/ssl)
|
||||||
|
PATH_HTML := $(addprefix $(HOME_DIR),$(addprefix $(addprefix $(PATH_WEB),/html/),$(MODULE)))
|
||||||
|
PATH_WEBICONS := $(addprefix $(HOME_DIR),$(addprefix $(PATH_WEB),/icons))
|
||||||
|
|
||||||
|
PATH_LOG := $(addprefix $(HOME_DIR),/var/log)
|
||||||
|
|
||||||
|
TMP_DIR=/tmp
|
||||||
|
|
||||||
|
CFLAGS=
|
||||||
|
|
||||||
|
ifeq ($(DEBUG), YES)
|
||||||
|
CFLAGS += -g -D_DEBUG
|
||||||
|
endif
|
||||||
|
ifeq ($(DEBUG), Y)
|
||||||
|
CFLAGS += -g -D_DEBUG
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(OPTIM), YES)
|
||||||
|
CFLAGS += -O3
|
||||||
|
endif
|
||||||
|
ifeq ($(OPTIM), Y)
|
||||||
|
CFLAGS += -O3
|
||||||
|
endif
|
||||||
17
ReadMe.txt
17
ReadMe.txt
@@ -1,26 +1,27 @@
|
|||||||
# $RCSfile: ReadMe.txt,v $
|
# $RCSfile: ReadMe.txt,v $
|
||||||
# $Revision: 2.5 $
|
# $Revision: 2.10 $
|
||||||
# $Name: $
|
# $Name: $
|
||||||
# $Date: 2002/08/02 12:34:32 $
|
# $Date: 2010/06/06 21:38:28 $
|
||||||
# $Author: agibert $
|
# $Author: agibert $
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Welcome to LibNode 2.0.x !
|
Welcome to LibNode 2.2.x !
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
This release of LibNode supports the following OS:
|
This release of LibNode supports the following OS:
|
||||||
- Linux 2.2.X and 2.4.x (tested on RedHat & Mandrake),
|
- Linux 2.2.x, 2.4.x and 2.6.x (tested on RedHat & Mandriva),
|
||||||
- Solaris 2.6,
|
- Solaris 2.6,
|
||||||
- Windows NT4 & 2000.
|
- Windows NT4, 2000 and XP.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
The support of LibVer is now optional.
|
The support of LibVer is now optional (To enable it, use: make _LIBVER_SUPPORT=1 all).
|
||||||
LibShm and LibDataStr are no more supported.
|
|
||||||
|
LibNode support LibShMem 2.0.0 and LibDataStr 2.0.0 !
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -40,4 +41,4 @@ Enjoy it!
|
|||||||
Your LibNode Team.
|
Your LibNode Team.
|
||||||
|
|
||||||
arnaud@rx3.net
|
arnaud@rx3.net
|
||||||
http://www.rx3.org/dvp/libnode
|
http://www.rx3.org/dvp/?dvp=libnode
|
||||||
|
|||||||
151
ReleaseNotes.txt
151
ReleaseNotes.txt
@@ -1,16 +1,82 @@
|
|||||||
# $RCSfile: ReleaseNotes.txt,v $
|
# $RCSfile: ReleaseNotes.txt,v $
|
||||||
# $Revision: 2.10 $
|
# $Revision: 2.22 $
|
||||||
# $Name: $
|
# $Name: $
|
||||||
# $Date: 2002/07/29 15:04:09 $
|
# $Date: 2010/06/06 21:30:59 $
|
||||||
# $Author: agibert $
|
# $Author: agibert $
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
LibNode V 2.2.0-1 - A. Gibert - 06/06/10
|
||||||
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
All: Add support C99 va_arg for curent gcc (4.4.1),
|
||||||
|
Add -fPIC flag in .c to .o makefile rule,
|
||||||
|
LibNode: Add ND_VA_* macros to help manager varargs,
|
||||||
|
Update Managers to use ND_VA_* macros,
|
||||||
|
Improve LibShMem support by restricting OpenStruct tracking on local DataStruct (Manager_Ptr != NULL),
|
||||||
|
Add example manager template in public node.h file,
|
||||||
|
NDDemo0: Add LibNode 2.2 support: Use ND_VA_* macros in manager,
|
||||||
|
NDBench: Add LibNode 2.2 support: Use ND_VA_* macros in manager.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
LibNode V 2.1.0-1 - A. Gibert - 24/01/05
|
||||||
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
All: This new LibNode branch (2.1.x) should support the forthcoming new LibShMem branch (2.0.x),
|
||||||
|
LibNode: Add symbol lookup support for manager, allocator and desallocator functions call,
|
||||||
|
New Allocator and desallocator API interace,
|
||||||
|
Code cleanup,
|
||||||
|
NDBench: DS_Open now support an arg in order to use or not symbol lookup,
|
||||||
|
Add test-*-s.ndb batch files witch use symbol lookup.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
LibNode V 2.0.7-1 - A. Gibert - 20/01/05
|
||||||
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
All: Add to Makefile.var auto version label detection from CVS Tag.
|
||||||
|
This should be the final release of the 2.0 branch,
|
||||||
|
This new release is developped for the MICOT/Target project (Banque de France - Paris).
|
||||||
|
LibNode: Minor bug fixes in ND_*_Info_Print() functions and ND_Library_StdErr_Set alias defines.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
LibNode V 2.0.6-1 - A. Gibert - 24/08/04
|
||||||
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
All: Generate *-c executables with checking mode enabled (ND_MODE=1),
|
||||||
|
Code clean up and more cleanly indented,
|
||||||
|
This new release is developped for the MICOT/Target project (Banque de France - Paris),
|
||||||
|
LibNode: Add OpenStruct tracing support (Enabled by ND_MODE=1 and Debug=1),
|
||||||
|
Re-implement for Unix and Windows target, full address checking in ND_Address_Check(),
|
||||||
|
NDDemo0: Add LibNode 2.0.6 support: Add ND_Library_Open/Close() calls,
|
||||||
|
NDBench: Add Lib_Open, Lib_Close, Index_Value_Break and Index_Node_Break command,
|
||||||
|
Improve random number generation,
|
||||||
|
Add test-10.ndb and test-errror.ndb batch files.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
LibNode V 2.0.5-1 - A. Gibert / M. Regimbeau - 28/07/03
|
||||||
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
All: Add a new Makefile system (Makefile.rule and Makefile.var),
|
||||||
|
Add 'make distrib' support,
|
||||||
|
Add libnode.spec file,
|
||||||
|
Move node.h from lib directory to include directory.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
LibNode V 2.0.4-1 - A. Gibert - 29/07/02
|
LibNode V 2.0.4-1 - A. Gibert - 29/07/02
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
All: This release of libnode pass with sucess valgrind test on linux.
|
All: This release of libnode pass with sucess valgrind test on linux.
|
||||||
LibNode: Add and use ND_Index_Clear() private API,
|
LibNode: Add and use ND_Index_Clear() private API,
|
||||||
@@ -18,9 +84,9 @@ NbBench: Add fclose() call at the end of batch_run.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
LibNode V 2.0.3-1 - A. Gibert - 09/04/02
|
LibNode V 2.0.3-1 - A. Gibert - 09/04/02
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
All: Fix Microsoft Visual Project to generate Debug and Release config correctly,
|
All: Fix Microsoft Visual Project to generate Debug and Release config correctly,
|
||||||
LibNode: Change index type numeric print value from decimal to hexa in ND_Index_Info_Print() API,
|
LibNode: Change index type numeric print value from decimal to hexa in ND_Index_Info_Print() API,
|
||||||
@@ -32,9 +98,9 @@ NbBench: Generate in Debug mode ndbenchd.exe and in Release mode ndbenchd.exe.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
LibNode V 2.0.2-2 - A. Gibert - 01/03/02
|
LibNode V 2.0.2-2 - A. Gibert - 01/03/02
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
All: Add GNU-GPL.txt, GNU-LGPL.txt and GNU-FDL.txt license files,
|
All: Add GNU-GPL.txt, GNU-LGPL.txt and GNU-FDL.txt license files,
|
||||||
All: Add license stuff in ReandMe.
|
All: Add license stuff in ReandMe.
|
||||||
@@ -45,9 +111,9 @@ NbBench: Add GPL header in ndbench.c.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
LibNode V 2.0.2-1 - A. Gibert - 27/02/02
|
LibNode V 2.0.2-1 - A. Gibert - 27/02/02
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
All: Makefiles now generate static and dynamic objects,
|
All: Makefiles now generate static and dynamic objects,
|
||||||
All: Add no libver support in Makefiles,
|
All: Add no libver support in Makefiles,
|
||||||
@@ -59,26 +125,26 @@ NbBench: Implement Index_Close and Index_Info_Print functions.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
LibNode V 2.0.1-1 - A. Gibert - 28/11/01
|
LibNode V 2.0.1-1 - A. Gibert - 28/11/01
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
LibNode: Fix the error level of TIMAS_KO: it's now an error status.
|
LibNode: Fix the error level of TIMAS_KO: it's now an error status.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
LibNode V 2.0.0-1 - A. Gibert - 26/11/01
|
LibNode V 2.0.0-1 - A. Gibert - 26/11/01
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
All: Merge the main CVS trunc with the win32 branche (2.0.0-alpha5),
|
All: Merge the main CVS trunc with the win32 branche (2.0.0-alpha5),
|
||||||
Switch file release to 2.0.
|
Switch file release to 2.0.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
LibNode V 2.0.0-alpha5 - A. Gibert - 25/10/01
|
LibNode V 2.0.0-alpha5 - A. Gibert - 25/10/01
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
LibNode: Add Open/Close Index support,
|
LibNode: Add Open/Close Index support,
|
||||||
LibNode: Fix return code next to empty struct manipulations,
|
LibNode: Fix return code next to empty struct manipulations,
|
||||||
@@ -86,9 +152,9 @@ NdBench: Add full multi index support.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
LibNode V 2.0.0-alpha4 - A. Gibert - 28/9/01
|
LibNode V 2.0.0-alpha4 - A. Gibert - 28/09/01
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
All: Add optional libver support,
|
All: Add optional libver support,
|
||||||
LibNode: Fix missing recursive offset args,
|
LibNode: Fix missing recursive offset args,
|
||||||
@@ -97,18 +163,18 @@ NdBench: Fix local stack pointer big bug.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
LibNode V 2.0.0-alpha3 - A. Gibert - 18/9/01
|
LibNode V 2.0.0-alpha3 - A. Gibert - 18/9/01
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
New manager args interface (again !),
|
New manager args interface (again !),
|
||||||
ndbench support batch mode.
|
ndbench support batch mode.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
LibNode V 2.0.0-alpha2 - A. Gibert - 8/9/01
|
LibNode V 2.0.0-alpha2 - A. Gibert - 08/09/01
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
Re-enable libver support for unix,
|
Re-enable libver support for unix,
|
||||||
Bug fixes,
|
Bug fixes,
|
||||||
@@ -116,53 +182,54 @@ Code cleanup.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
LibNode V 2.0.0-alpha1 - A. Gibert - 7/9/01
|
LibNode V 2.0.0-alpha1 - A. Gibert - 07/09/01
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
Add Full win32 support,
|
Add Full win32 support,
|
||||||
Remove libver support,
|
Remove libver support,
|
||||||
Multi index support,
|
Multi index support,
|
||||||
New manager args format,
|
New manager args format,
|
||||||
Major Code cleanup et standardisation.
|
Major Code cleanup et standardisation.
|
||||||
|
This new version (2.0.x) is developped for the TIMA project (Misys IBS - France).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
LibNode V 1.0.0 - S. Mas / A. Gibert - 18/7/00
|
LibNode V 1.0.0 - S. Mas / A. Gibert - 18/07/00
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
Unix (Linux and Solaris) version only, for BDM project (Société Générale - Paris)
|
Unix (Linux and Solaris) version only, for BDM project (Société Générale - Paris)
|
||||||
Major code rewrite.
|
Major code rewrite.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
LibNode V 0.2.2 - A. Gibert - 1/6/93
|
LibNode V 0.2.2 - A. Gibert - 01/06/93
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
Embeded version on OS/2 2.1 (Companie Générale des Eaux - Paris)
|
Embeded version on OS/2 2.1 (Companie Générale des Eaux - Paris)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
LibNode V 0.2.1 - A. Gibert - 1/4/92
|
LibNode V 0.2.1 - A. Gibert - 01/04/92
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
Amiga and PC support (Bareau de Draguignan - Ste Maxime).
|
Amiga and PC support (Bareau de Draguignan - Ste Maxime).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
LibNode V 0.2.0 - A. Gibert - 1/3/91
|
LibNode V 0.2.0 - A. Gibert - 01/03/91
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
C version aided by p2c tools on Pyramid (Swansee University - Wales).
|
C version aided by p2c tools on Pyramid (Swansee University - Wales).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
LibNode V 0.1.0 - A. Gibert - 1/12/90
|
LibNode V 0.1.0 - A. Gibert - 01/12/90
|
||||||
--------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
Inital version in Pascal on Pyramid (Swansee University - Wales).
|
Inital version in Pascal on Pyramid (Swansee University - Wales).
|
||||||
|
|||||||
10
ToDo.txt
10
ToDo.txt
@@ -1,14 +1,14 @@
|
|||||||
# $RCSfile: ToDo.txt,v $
|
# $RCSfile: ToDo.txt,v $
|
||||||
# $Revision: 2.2 $
|
# $Revision: 2.5 $
|
||||||
# $Name: $
|
# $Name: $
|
||||||
# $Date: 2002/08/02 12:30:06 $
|
# $Date: 2005/01/24 01:19:50 $
|
||||||
# $Author: agibert $
|
# $Author: agibert $
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- More debug !
|
- Check LibShMem/LibDataStr support (via symbol lookup support),
|
||||||
|
- Add Cache Value option,
|
||||||
- New English documentation (man/tex),
|
- New English documentation (man/tex),
|
||||||
- Improve API consitency,
|
- Improve API consitency.
|
||||||
- Re-enable LibShm/LibDataStr support (via NDT_DataStruct implementation).
|
|
||||||
|
|||||||
@@ -1,10 +1,54 @@
|
|||||||
all: demo0 demo0-static
|
SRC := nddemo0.c
|
||||||
|
TARGETS := nddemo0 nddemo0-c nddemo0-static nddemo0-static-c
|
||||||
|
FILE_BIN := nddemo0 nddemo0-c nddemo0-static nddemo0-static-c
|
||||||
|
FILE_LIB := nddemo0.dat
|
||||||
|
|
||||||
demo0-static: demo0.c ../lib/node.h ../lib/libnode.a Makefile
|
|
||||||
gcc -g -o demo0-static -I ../lib -ldl demo0.c ../lib/libnode.a
|
|
||||||
|
|
||||||
demo0: demo0.c ../lib/node.h ../lib/libnode.so Makefile
|
|
||||||
gcc -g -o demo0 -I ../lib -L ../lib -ldl -lnode demo0.c
|
|
||||||
|
|
||||||
clean:
|
include ../Makefile.var
|
||||||
rm -f demo0 demo0-static
|
include ../Makefile.rule
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DEP_STATIC += ../lib/libnode.a
|
||||||
|
DEP_DYNAMIC += ../lib/libnode.so
|
||||||
|
INCLUDE += -I . -I ../include
|
||||||
|
LIBDIR += -L . -L ../lib
|
||||||
|
LIB_STATIC += ../lib/libnode.a -ldl
|
||||||
|
LIB_DYNAMIC += -lnode -ldl
|
||||||
|
CFLAGS += -rdynamic
|
||||||
|
|
||||||
|
ifdef _LIBVER_SUPPORT
|
||||||
|
DEP_STATIC += ../../libver/ver.h ../../libver/libver.a
|
||||||
|
DEP_DYNAMIC += ../../libver/ver.h ../../libver/libver.so
|
||||||
|
INCLUDE += -I ../../libver/lib
|
||||||
|
LIBDIR += -L ../../libver/lib
|
||||||
|
|
||||||
|
ifeq ($(OSTYPE),linux-gnu)
|
||||||
|
LIB_STATIC += ../../libver/lib/libver.a
|
||||||
|
LIB_DYNAMIC += -lver
|
||||||
|
else
|
||||||
|
LIB_STATIC += ../../libver/lib/libver.a
|
||||||
|
LIB_DYNAMIC += -lver
|
||||||
|
endif
|
||||||
|
|
||||||
|
CFLAGS += -D_LIBVER_SUPPORT
|
||||||
|
endif
|
||||||
|
|
||||||
|
ND_CHECK_FLAGS = -DND_MODE=0
|
||||||
|
ND_NOCHECK_FLAGS = -DND_MODE=1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
nddemo0: nddemo0.c $(DEP_DYNAMIC)
|
||||||
|
$(CC) -o $@ $(CFLAGS) $(ND_NOCHECK_FLAGS) $(INCLUDE) $(LIBDIR) $(LIB_DYNAMIC) $<
|
||||||
|
|
||||||
|
nddemo0-c: nddemo0.c $(DEP_DYNAMIC)
|
||||||
|
$(CC) -o $@ $(CFLAGS) $(ND_CHECK_FLAGS) $(INCLUDE) $(LIBDIR) $(LIB_DYNAMIC) $<
|
||||||
|
|
||||||
|
nddemo0-static: nddemo0.c $(DEP_STATIC)
|
||||||
|
$(CC) -o $@ $(CFLAGS) $(ND_NOCHECK_FLAGS) $(INCLUDE) $< $(LIB_STATIC)
|
||||||
|
|
||||||
|
nddemo0-static-c: nddemo0.c $(DEP_STATIC)
|
||||||
|
$(CC) -o $@ $(CFLAGS) $(ND_CHECK_FLAGS) $(INCLUDE) $< $(LIB_STATIC)
|
||||||
|
|
||||||
|
|||||||
460
demo/nddemo0.c
460
demo/nddemo0.c
@@ -1,9 +1,9 @@
|
|||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
/* $RCSfile: nddemo0.c,v $ */
|
/* $RCSfile: nddemo0.c,v $ */
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
/* $Revision: 2.1 $ */
|
/* $Revision: 2.9 $ */
|
||||||
/* $Name: $ */
|
/* $Name: $ */
|
||||||
/* $Date: 2002/02/28 22:00:35 $ */
|
/* $Date: 2010/06/06 21:27:12 $ */
|
||||||
/* $Author: agibert $ */
|
/* $Author: agibert $ */
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
/* GNU Lesser General Public License for more details. */
|
/* GNU Lesser General Public License for more details. */
|
||||||
/* */
|
/* */
|
||||||
/* You should have received a copy of the GNU General Public License */
|
/* You should have received a copy of the GNU General Public License */
|
||||||
/* along with Foobar; if not, write to the Free Software */
|
/* along with LibNode; if not, write to the Free Software */
|
||||||
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@@ -31,40 +31,40 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <node.h>
|
#include <node.h>
|
||||||
//#include <windows.h>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define DEMO_FILE_NAME "demo0.txt"
|
#define DEMO_FILE_NAME "nddemo0.dat"
|
||||||
#define STRING_LEN (short)1024
|
#define STRING_LEN ( short) 1024
|
||||||
#define STRING_SIZE (short)(STRING_LEN + 1)
|
#define STRING_SIZE ( short) ( STRING_LEN + 1)
|
||||||
#define VAL_LEN (short)64
|
#define VAL_LEN ( short) 64
|
||||||
#define VAL_SIZE (short)(VAL_LEN + 1)
|
#define VAL_SIZE ( short) ( VAL_LEN + 1)
|
||||||
#define INDEX_NB (short)4
|
#define INDEX_NB ( short) 4
|
||||||
|
|
||||||
#define NDT_CMD_INDEX0_PRINT (NDT_Command)64
|
#define NDD_CMD_INDEX0_PRINT ( NDT_Command) 64
|
||||||
#define NDT_CMD_INDEX1_PRINT (NDT_Command)65
|
#define NDD_CMD_INDEX1_PRINT ( NDT_Command) 65
|
||||||
#define NDT_CMD_INDEX2_PRINT (NDT_Command)66
|
#define NDD_CMD_INDEX2_PRINT ( NDT_Command) 66
|
||||||
#define NDT_CMD_INDEX3_PRINT (NDT_Command)67
|
#define NDD_CMD_INDEX3_PRINT ( NDT_Command) 67
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct Demo_Value
|
typedef struct Demo_Value
|
||||||
{
|
{
|
||||||
char Val0[VAL_SIZE];
|
char Val0[ VAL_SIZE];
|
||||||
char Val1[VAL_SIZE];
|
char Val1[ VAL_SIZE];
|
||||||
char Val2[VAL_SIZE];
|
char Val2[ VAL_SIZE];
|
||||||
char Val3[VAL_SIZE];
|
char Val3[ VAL_SIZE];
|
||||||
} Demo_Value;
|
} Demo_Value;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
/* Prototypes */
|
/* Prototypes */
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
NDT_Status Manager_Demo_DS( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list);
|
NDT_Status Demo_DS_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
||||||
void DataStruct_Load( NDT_Root *, FILE *);
|
void DataStruct_Load( NDT_Root *, FILE *);
|
||||||
void DataStruct_Load( NDT_Root *, FILE *);
|
void DataStruct_Load( NDT_Root *, FILE *);
|
||||||
void Demo( char *, short);
|
void Demo( char *, short);
|
||||||
@@ -77,10 +77,10 @@ int main( int, char **);
|
|||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
/* */
|
/* */
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args)
|
NDT_Status Demo_DS_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list *Args_Ptr)
|
||||||
{
|
{
|
||||||
NDT_Command_Name Command_Name;
|
NDT_Command_Name Command_Name;
|
||||||
|
|
||||||
@@ -89,12 +89,12 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
|||||||
{
|
{
|
||||||
case NDD_CMD_MANAGER_VERSION:
|
case NDD_CMD_MANAGER_VERSION:
|
||||||
{
|
{
|
||||||
NDT_Version_Name *Version_Name_Ptr = (NDT_Version_Name *)va_arg( Args, NDT_Version_Name *);
|
ND_VA_ARG_GET( Version_Name_Ptr, *Args_Ptr, NDT_Version_Name *);
|
||||||
|
|
||||||
|
|
||||||
Command_Name = "NDD_CMD_MANAGER_VERSION";
|
Command_Name = "NDD_CMD_MANAGER_VERSION";
|
||||||
|
|
||||||
*Version_Name_Ptr = "$Revision: 2.1 $ $Name: $ $Date: 2002/02/28 22:00:35 $ $Author: agibert $";
|
*Version_Name_Ptr = "$Revision: 2.9 $ $Name: $ $Date: 2010/06/06 21:27:12 $ $Author: agibert $";
|
||||||
|
|
||||||
return( NDS_OK);
|
return( NDS_OK);
|
||||||
}
|
}
|
||||||
@@ -102,43 +102,43 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
|||||||
case NDD_CMD_INDEX_GET:
|
case NDD_CMD_INDEX_GET:
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *);
|
ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
|
||||||
NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *);
|
ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
|
||||||
NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command);
|
ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
|
||||||
void *Value_ptr = (void *)va_arg( Args, void *);
|
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||||
*/
|
*/
|
||||||
NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *);
|
ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
|
||||||
NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *);
|
ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
|
||||||
NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command);
|
ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
|
||||||
Demo_Value *Value_ptr = (Demo_Value *)va_arg( Args, Demo_Value *);
|
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, Demo_Value *);
|
||||||
|
|
||||||
|
|
||||||
Command_Name = "NDD_CMD_INDEX_GET";
|
Command_Name = "NDD_CMD_INDEX_GET";
|
||||||
|
|
||||||
switch(Cmd)
|
switch(Cmd)
|
||||||
{
|
{
|
||||||
case NDT_CMD_INDEX0_PRINT:
|
case NDD_CMD_INDEX0_PRINT:
|
||||||
{
|
{
|
||||||
*Reply_Index_Id_Ptr = 0;
|
*Reply_Index_Id_Ptr = 0;
|
||||||
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
|
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case NDT_CMD_INDEX1_PRINT:
|
case NDD_CMD_INDEX1_PRINT:
|
||||||
{
|
{
|
||||||
*Reply_Index_Id_Ptr = 1;
|
*Reply_Index_Id_Ptr = 1;
|
||||||
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
|
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case NDT_CMD_INDEX2_PRINT:
|
case NDD_CMD_INDEX2_PRINT:
|
||||||
{
|
{
|
||||||
*Reply_Index_Id_Ptr = 2;
|
*Reply_Index_Id_Ptr = 2;
|
||||||
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
|
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case NDT_CMD_INDEX3_PRINT:
|
case NDD_CMD_INDEX3_PRINT:
|
||||||
{
|
{
|
||||||
*Reply_Index_Id_Ptr = 3;
|
*Reply_Index_Id_Ptr = 3;
|
||||||
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
|
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
|
||||||
@@ -159,12 +159,15 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
|||||||
case NDD_CMD_VALUE_ALLOC:
|
case NDD_CMD_VALUE_ALLOC:
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
void **Value_Ptr_Ptr = (void **)va_arg( Args, void **);
|
ND_VA_ARG_GET( Value_Ptr_Ptr, *Args_Ptr, void **);
|
||||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
|
||||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||||
... = (...)va_arg( user_args, ...);
|
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||||
|
ND_VA_ARG_GET( ..., user_args, ...);
|
||||||
|
|
||||||
|
ND_VA_LIST_CLOSE( user_args);
|
||||||
*/
|
*/
|
||||||
Demo_Value **Value_Ptr_Ptr = va_arg( Args, Demo_Value **);
|
ND_VA_ARG_GET( Value_Ptr_Ptr, *Args_Ptr, Demo_Value **);
|
||||||
|
|
||||||
|
|
||||||
Command_Name = "NDD_CMD_VALUE_ALLOC";
|
Command_Name = "NDD_CMD_VALUE_ALLOC";
|
||||||
@@ -187,12 +190,15 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
|||||||
case NDD_CMD_VALUE_FREE:
|
case NDD_CMD_VALUE_FREE:
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
void *Value_Ptr = (void *)va_arg( Args, void *);
|
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
|
||||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||||
... = (...)va_arg( user_args, ...);
|
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||||
|
ND_VA_ARG_GET( ..., user_args, ...);
|
||||||
|
|
||||||
|
ND_VA_LIST_CLOSE( user_args);
|
||||||
*/
|
*/
|
||||||
Demo_Value *Value_Ptr = (Demo_Value *)va_arg( Args, Demo_Value *);
|
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, Demo_Value *);
|
||||||
|
|
||||||
|
|
||||||
Command_Name = "NDD_CMD_VALUE_FREE";
|
Command_Name = "NDD_CMD_VALUE_FREE";
|
||||||
@@ -205,14 +211,17 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
|||||||
case NDD_CMD_VALUE_COMP:
|
case NDD_CMD_VALUE_COMP:
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
void *Value1_Ptr = (void *)va_arg( Args, void *);
|
ND_VA_ARG_GET( Value1_Ptr, *Args_Ptr, void *);
|
||||||
void *Value2_Ptr = (void *)va_arg( Args, void *);
|
ND_VA_ARG_GET( Value2_Ptr, *Args_Ptr, void *);
|
||||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
|
||||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||||
... = (...)va_arg( user_args, ...);
|
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||||
|
ND_VA_ARG_GET( ..., user_args, ...);
|
||||||
|
|
||||||
|
ND_VA_LIST_CLOSE( user_args);
|
||||||
*/
|
*/
|
||||||
Demo_Value *Value1_Ptr = va_arg( Args, Demo_Value *);
|
ND_VA_ARG_GET( Value1_Ptr, *Args_Ptr, Demo_Value *);
|
||||||
Demo_Value *Value2_Ptr = va_arg( Args, Demo_Value *);
|
ND_VA_ARG_GET( Value2_Ptr, *Args_Ptr, Demo_Value *);
|
||||||
|
|
||||||
|
|
||||||
Command_Name = "NDD_CMD_VALUE_COMP";
|
Command_Name = "NDD_CMD_VALUE_COMP";
|
||||||
@@ -228,63 +237,63 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
|||||||
|
|
||||||
if( rc < 0)
|
if( rc < 0)
|
||||||
{
|
{
|
||||||
return(NDS_LOWER);
|
return( NDS_LOWER);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( rc > 0)
|
if( rc > 0)
|
||||||
{
|
{
|
||||||
return(NDS_GREATER);
|
return( NDS_GREATER);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return(NDS_EQUAL);
|
return( NDS_EQUAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
int val1 = atoi(Value1_Ptr->Val1);
|
int val1 = atoi( Value1_Ptr->Val1);
|
||||||
int val2 = atoi(Value2_Ptr->Val1);
|
int val2 = atoi( Value2_Ptr->Val1);
|
||||||
|
|
||||||
|
|
||||||
if( val1 < val2)
|
if( val1 < val2)
|
||||||
{
|
{
|
||||||
return(NDS_LOWER);
|
return( NDS_LOWER);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( val1 > val2)
|
if( val1 > val2)
|
||||||
{
|
{
|
||||||
return(NDS_GREATER);
|
return( NDS_GREATER);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return(NDS_EQUAL);
|
return( NDS_EQUAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
int val1 = strlen(Value1_Ptr->Val2);
|
int val1 = strlen( Value1_Ptr->Val2);
|
||||||
int val2 = strlen(Value2_Ptr->Val2);
|
int val2 = strlen( Value2_Ptr->Val2);
|
||||||
|
|
||||||
|
|
||||||
if( val1 < val2)
|
if( val1 < val2)
|
||||||
{
|
{
|
||||||
return(NDS_LOWER);
|
return( NDS_LOWER);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( val1 > val2)
|
if( val1 > val2)
|
||||||
{
|
{
|
||||||
return(NDS_GREATER);
|
return( NDS_GREATER);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return(NDS_EQUAL);
|
return( NDS_EQUAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -302,12 +311,17 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
|||||||
case NDD_CMD_VALUE_ADD:
|
case NDD_CMD_VALUE_ADD:
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
void *Value_Ptr = (void *)va_arg( Args, void *);
|
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
|
||||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||||
... = (...)va_arg( user_args, ...);
|
|
||||||
|
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||||
|
ND_VA_ARG_GET( ..., user_args, ...);
|
||||||
|
|
||||||
|
ND_VA_LIST_CLOSE( user_args);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
Command_Name = "NDD_CMD_VALUE_ADD";
|
Command_Name = "NDD_CMD_VALUE_ADD";
|
||||||
|
|
||||||
return( NDS_OK);
|
return( NDS_OK);
|
||||||
@@ -316,43 +330,62 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
|||||||
case NDD_CMD_VALUE_REMOVE:
|
case NDD_CMD_VALUE_REMOVE:
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
void *Value_Ptr = (void *)va_arg( Args, void *);
|
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
|
||||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||||
... = (...)va_arg( user_args, ...);
|
|
||||||
|
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||||
|
ND_VA_ARG_GET( ..., user_args, ...);
|
||||||
|
|
||||||
|
ND_VA_LIST_CLOSE( user_args);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
Command_Name = "NDD_CMD_VALUE_REMOVE";
|
Command_Name = "NDD_CMD_VALUE_REMOVE";
|
||||||
|
|
||||||
return( NDS_OK);
|
return( NDS_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
case NDD_CMD_VALUE_PRINT:
|
case NDD_CMD_VALUE_PRINT:
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *);
|
ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||||
va_list lib_args = (va_list)va_arg( Args, va_list);
|
|
||||||
FILE *Out = (FILE *)va_arg( lib_args, FILE *);
|
|
||||||
NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode);
|
|
||||||
NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth);
|
|
||||||
va_list user_args = (va_list)va_arg( lib_args, va_list);
|
|
||||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
|
||||||
... = (...)va_arg( user_args, ...);
|
|
||||||
|
|
||||||
void *Value_Ptr = Node_Ptr->Value;
|
ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
|
||||||
*/
|
|
||||||
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *);
|
|
||||||
va_list lib_args = (va_list)va_arg( Args, va_list);
|
|
||||||
FILE *Out = (FILE *)va_arg( lib_args, FILE *);
|
|
||||||
NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode);
|
|
||||||
NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth);
|
|
||||||
|
|
||||||
Demo_Value *Value_Ptr = Node_Ptr->Value;
|
ND_VA_ARG_GET( Out, lib_args, FILE *);
|
||||||
|
ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
|
||||||
|
ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
|
||||||
|
ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
|
||||||
|
|
||||||
|
ND_VA_LIST_OPEN( user_args, lib_args);
|
||||||
|
|
||||||
|
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||||
|
ND_VA_ARG_GET( ..., user_args, ...);
|
||||||
|
|
||||||
|
ND_VA_LIST_CLOSE( user_args);
|
||||||
|
ND_VA_LIST_CLOSE( lib_args);
|
||||||
|
*/
|
||||||
|
ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||||
|
|
||||||
|
ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
|
||||||
|
|
||||||
|
ND_VA_ARG_GET( Out, lib_args, FILE *);
|
||||||
|
ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
|
||||||
|
ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
|
||||||
|
ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
|
||||||
|
|
||||||
|
ND_VA_LIST_CLOSE( lib_args);
|
||||||
|
|
||||||
|
|
||||||
|
Demo_Value *Value_Ptr = Node_Ptr->Value;
|
||||||
|
|
||||||
|
|
||||||
Command_Name = "NDD_CMD_VALUE_PRINT";
|
Command_Name = "NDD_CMD_VALUE_PRINT";
|
||||||
|
|
||||||
fprintf( Out, "Val0: (%s) Val1: (%s) Val2: (%s) Val3: (%s)\n",
|
fprintf( Out, "Val0: (%s) Val1: (%s) Val2: (%s) Val3: (%s)\n",
|
||||||
Value_Ptr->Val0, Value_Ptr->Val1, Value_Ptr->Val2, Value_Ptr->Val3);
|
Value_Ptr->Val0, Value_Ptr->Val1, Value_Ptr->Val2, Value_Ptr->Val3);
|
||||||
|
|
||||||
return( NDS_OK);
|
return( NDS_OK);
|
||||||
}
|
}
|
||||||
@@ -360,18 +393,25 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
|||||||
case NDD_CMD_INFO_PRINT:
|
case NDD_CMD_INFO_PRINT:
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *);
|
ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||||
va_list lib_args = (va_list)va_arg( Args, va_list);
|
|
||||||
FILE *Out = (FILE *)va_arg( lib_args, FILE *);
|
|
||||||
NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode);
|
|
||||||
NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth);
|
|
||||||
va_list user_args = (va_list)va_arg( lib_args, va_list);
|
|
||||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
|
||||||
... = (...)va_arg( user_args, ...);
|
|
||||||
|
|
||||||
void *Value_Ptr = Node_Ptr->Value;
|
ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
|
||||||
|
|
||||||
|
ND_VA_ARG_GET( Out, lib_args, FILE *);
|
||||||
|
ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
|
||||||
|
ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
|
||||||
|
ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
|
||||||
|
|
||||||
|
ND_VA_LIST_OPEN( user_args, lib_args);
|
||||||
|
|
||||||
|
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||||
|
ND_VA_ARG_GET( ..., user_args, ...);
|
||||||
|
|
||||||
|
ND_VA_LIST_CLOSE( user_args);
|
||||||
|
ND_VA_LIST_CLOSE( lib_args);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
Command_Name = "NDD_CMD_INFO_PRINT";
|
Command_Name = "NDD_CMD_INFO_PRINT";
|
||||||
|
|
||||||
return( NDS_OK);
|
return( NDS_OK);
|
||||||
@@ -380,12 +420,12 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
|||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
printf( "Demo_DS_Manager() called with an undefined command %d\n", Command);
|
printf( "Demo_DS_Manager() called with an undefined command %d\n", Command);
|
||||||
return NDS_ERRAPI;
|
return( NDS_ERRAPI);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf( "Demo_DS_Manager() called with command %d (%s)\n", Command, Command_Name);
|
printf( "Demo_DS_Manager() called with command %d (%s)\n", Command, Command_Name);
|
||||||
return NDS_OK;
|
return( NDS_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -393,7 +433,7 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
|||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
/* */
|
/* */
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
void DataStruct_Load( NDT_Root *ds_ptr, FILE *demo_file)
|
void DataStruct_Load( NDT_Root *ds_ptr, FILE *demo_file)
|
||||||
@@ -408,7 +448,7 @@ void DataStruct_Load( NDT_Root *ds_ptr, FILE *demo_file)
|
|||||||
while( !feof( demo_file))
|
while( !feof( demo_file))
|
||||||
{
|
{
|
||||||
str = fgets( input_string, STRING_SIZE, demo_file);
|
str = fgets( input_string, STRING_SIZE, demo_file);
|
||||||
if( ( (const int)str != EOF) && ( str != NULL))
|
if( str != NULL)
|
||||||
{
|
{
|
||||||
if( strlen( input_string) >= STRING_LEN)
|
if( strlen( input_string) >= STRING_LEN)
|
||||||
{
|
{
|
||||||
@@ -433,7 +473,7 @@ void DataStruct_Load( NDT_Root *ds_ptr, FILE *demo_file)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf( "Input line read: \t(%s)\t(%s)\t(%s)\t(%s)\n", val0, val1, val2, val3);
|
printf( "Input line read: \t(%s)\t(%s)\t(%s)\t(%s)\n", val0, val1, val2, val3);
|
||||||
printf( "Allocate Vallue: ");
|
printf( "Allocate Vallue: ");
|
||||||
|
|
||||||
if( ( status = ND_Value_Alloc( ds_ptr, (void **)&value_ptr)) != NDS_OK)
|
if( ( status = ND_Value_Alloc( ds_ptr, (void **)&value_ptr)) != NDS_OK)
|
||||||
{
|
{
|
||||||
@@ -492,7 +532,7 @@ void DataStruct_Dump( NDT_Root *ds_ptr)
|
|||||||
|
|
||||||
printf( "Traverse DataStructure Index 0:\n");
|
printf( "Traverse DataStructure Index 0:\n");
|
||||||
|
|
||||||
if( ( status = ND_DataStruct_Traverse( ds_ptr, NDT_CMD_INDEX0_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK)
|
if( ( status = ND_DataStruct_Traverse( ds_ptr, NDD_CMD_INDEX0_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK)
|
||||||
{
|
{
|
||||||
printf( "ND_DataStruct_Traverse() failed (%d) !\n", status);
|
printf( "ND_DataStruct_Traverse() failed (%d) !\n", status);
|
||||||
}
|
}
|
||||||
@@ -503,7 +543,7 @@ void DataStruct_Dump( NDT_Root *ds_ptr)
|
|||||||
|
|
||||||
printf( "Traverse DataStructure Index 1:\n");
|
printf( "Traverse DataStructure Index 1:\n");
|
||||||
|
|
||||||
if( ( status = ND_DataStruct_Traverse( ds_ptr, NDT_CMD_INDEX1_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK)
|
if( ( status = ND_DataStruct_Traverse( ds_ptr, NDD_CMD_INDEX1_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK)
|
||||||
{
|
{
|
||||||
printf( "ND_DataStruct_Traverse() failed (%d) !\n", status);
|
printf( "ND_DataStruct_Traverse() failed (%d) !\n", status);
|
||||||
}
|
}
|
||||||
@@ -514,7 +554,7 @@ void DataStruct_Dump( NDT_Root *ds_ptr)
|
|||||||
|
|
||||||
printf( "Traverse DataStructure Index 2:\n");
|
printf( "Traverse DataStructure Index 2:\n");
|
||||||
|
|
||||||
if( ( status = ND_DataStruct_Traverse( ds_ptr, NDT_CMD_INDEX2_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK)
|
if( ( status = ND_DataStruct_Traverse( ds_ptr, NDD_CMD_INDEX2_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK)
|
||||||
{
|
{
|
||||||
printf( "ND_DataStruct_Traverse() failed (%d) !\n", status);
|
printf( "ND_DataStruct_Traverse() failed (%d) !\n", status);
|
||||||
}
|
}
|
||||||
@@ -525,7 +565,7 @@ void DataStruct_Dump( NDT_Root *ds_ptr)
|
|||||||
|
|
||||||
printf( "Traverse DataStructure Index 3:\n");
|
printf( "Traverse DataStructure Index 3:\n");
|
||||||
|
|
||||||
if( ( status = ND_DataStruct_Traverse( ds_ptr, NDT_CMD_INDEX3_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK)
|
if( ( status = ND_DataStruct_Traverse( ds_ptr, NDD_CMD_INDEX3_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK)
|
||||||
{
|
{
|
||||||
printf( "ND_DataStruct_Traverse() failed (%d) !\n", status);
|
printf( "ND_DataStruct_Traverse() failed (%d) !\n", status);
|
||||||
}
|
}
|
||||||
@@ -538,7 +578,7 @@ void DataStruct_Dump( NDT_Root *ds_ptr)
|
|||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
/* */
|
/* */
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
void Demo( char *Demo_File_Name, short Optimized_Mode)
|
void Demo( char *Demo_File_Name, short Optimized_Mode)
|
||||||
@@ -546,107 +586,119 @@ void Demo( char *Demo_File_Name, short Optimized_Mode)
|
|||||||
NDT_Status status;
|
NDT_Status status;
|
||||||
NDT_Root *demo_ds_ptr;
|
NDT_Root *demo_ds_ptr;
|
||||||
NDT_Index_Type index_type_initial_tab[INDEX_NB] =
|
NDT_Index_Type index_type_initial_tab[INDEX_NB] =
|
||||||
{
|
{
|
||||||
(NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO),
|
(NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO),
|
||||||
(NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO),
|
(NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO),
|
||||||
(NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO),
|
(NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO),
|
||||||
(NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO)
|
(NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO)
|
||||||
};
|
};
|
||||||
NDT_Index_Type index_type_final_tab[INDEX_NB] =
|
NDT_Index_Type index_type_final_tab[INDEX_NB] =
|
||||||
{
|
{
|
||||||
(NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED),
|
(NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED),
|
||||||
(NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_SORTED),
|
(NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_SORTED),
|
||||||
(NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED),
|
(NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED),
|
||||||
(NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO)
|
(NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO)
|
||||||
};
|
};
|
||||||
NDT_Index_Type *index_type_ptr;
|
NDT_Index_Type *index_type_ptr;
|
||||||
FILE *demo_file;
|
FILE *demo_file;
|
||||||
|
|
||||||
|
|
||||||
printf( "Create demo DataStructure: ");
|
printf( "Open library: ");
|
||||||
|
|
||||||
if( Optimized_Mode)
|
if( ( status = ND_Library_Open( NDD_TRUE)) != NDS_OK)
|
||||||
{
|
{
|
||||||
index_type_ptr = index_type_initial_tab;
|
printf( "ND_Library_Open() failed (%d) !\n", status);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
index_type_ptr = index_type_final_tab;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if( ( status = ND_DataStruct_Open( &demo_ds_ptr, INDEX_NB, index_type_ptr, "Manager_Demo_DS", Manager_Demo_DS, NULL, NULL, NULL, NULL,0, NULL)) != NDS_OK)
|
|
||||||
{
|
|
||||||
printf( "ND_DataStruct_Open() failed (%d) !\n", status);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf( "Ok !\n");
|
printf( "Ok !\n");
|
||||||
|
|
||||||
printf( "Open demo datafile: ");
|
printf( "Create demo DataStructure: ");
|
||||||
|
|
||||||
if( ( demo_file = fopen( Demo_File_Name, "r")) == NULL)
|
if( Optimized_Mode)
|
||||||
{
|
{
|
||||||
printf( "fopen() failed (%d/%s) !\n", errno, strerror(errno));
|
index_type_ptr = index_type_initial_tab;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf( "Ok !\n");
|
index_type_ptr = index_type_final_tab;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ( status = ND_DataStruct_Open( &demo_ds_ptr, INDEX_NB, index_type_ptr, "Demo_DS_Manager", Demo_DS_Manager, NULL, NULL, NULL, NULL,0, NULL)) != NDS_OK)
|
||||||
|
{
|
||||||
|
printf( "ND_DataStruct_Open() failed (%d) !\n", status);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf( "Ok !\n");
|
||||||
|
|
||||||
|
printf( "Open demo datafile: ");
|
||||||
|
|
||||||
|
if( ( demo_file = fopen( Demo_File_Name, "r")) == NULL)
|
||||||
|
{
|
||||||
|
printf( "fopen() failed (%d/%s) !\n", errno, strerror(errno));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf( "Ok !\n");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
printf( "\n\n\nLaod Data File:\n\n");
|
printf( "\n\n\nLaod Data File:\n\n");
|
||||||
DataStruct_Load( demo_ds_ptr, demo_file);
|
DataStruct_Load( demo_ds_ptr, demo_file);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if( Optimized_Mode)
|
if( Optimized_Mode)
|
||||||
{
|
{
|
||||||
|
printf( "\n\n\nInitial Structure Dump:\n\n");
|
||||||
printf( "\n\n\nInitial Structure Dump:\n\n");
|
DataStruct_Dump( demo_ds_ptr);
|
||||||
DataStruct_Dump( demo_ds_ptr);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
printf( "Convert data structure: ");
|
printf( "Convert data structure: ");
|
||||||
|
|
||||||
if( ( status = ND_DataStruct_Convert( demo_ds_ptr, index_type_final_tab)) != NDS_OK)
|
if( ( status = ND_DataStruct_Convert( demo_ds_ptr, index_type_final_tab)) != NDS_OK)
|
||||||
{
|
{
|
||||||
printf( "ND_DataStruct_Convert() failed (%d) !\n", status);
|
printf( "ND_DataStruct_Convert() failed (%d) !\n", status);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf( "Ok !\n");
|
printf( "Ok !\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
printf( "\n\n\nFinal Structure Dump:\n\n");
|
printf( "\n\n\nFinal Structure Dump:\n\n");
|
||||||
DataStruct_Dump( demo_ds_ptr);
|
DataStruct_Dump( demo_ds_ptr);
|
||||||
|
|
||||||
|
printf( "Close demo datafile: ");
|
||||||
|
|
||||||
|
if( fclose( demo_file) != 0)
|
||||||
|
{
|
||||||
|
printf( "fclose() failed (%d/%s) !\n", errno, strerror(errno));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf( "Ok !\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
printf( "Close demo DataStructure: ");
|
||||||
printf( "Close demo datafile: ");
|
|
||||||
|
|
||||||
if( fclose( demo_file) != 0)
|
|
||||||
{
|
|
||||||
printf( "fclose() failed (%d/%s) !\n", errno, strerror(errno));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
printf( "Ok !\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
printf( "Close demo DataStructure: ");
|
|
||||||
|
|
||||||
if( ( status = ND_DataStruct_Close( demo_ds_ptr)) != NDS_OK)
|
if( ( status = ND_DataStruct_Close( demo_ds_ptr)) != NDS_OK)
|
||||||
|
{
|
||||||
|
printf( "ND_DataStruct_Close() failed (%d) !\n", status);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf( "Ok !\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
printf( "Close library: ");
|
||||||
|
|
||||||
|
if( ( status = ND_Library_Close()) != NDS_OK)
|
||||||
{
|
{
|
||||||
printf( "ND_DataStruct_Close() failed (%d) !\n", status);
|
printf( "ND_Library_Close() failed (%d) !\n", status);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -660,7 +712,7 @@ void Demo( char *Demo_File_Name, short Optimized_Mode)
|
|||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
/* */
|
/* */
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
int main( int argc, char **argv)
|
int main( int argc, char **argv)
|
||||||
@@ -670,34 +722,4 @@ int main( int argc, char **argv)
|
|||||||
|
|
||||||
printf( "\n\n\n\n\nOptimized Demo\n--------------\n\n\n");
|
printf( "\n\n\n\n\nOptimized Demo\n--------------\n\n\n");
|
||||||
Demo( DEMO_FILE_NAME, 1);
|
Demo( DEMO_FILE_NAME, 1);
|
||||||
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
HMODULE my_module;
|
|
||||||
char buf[256];
|
|
||||||
FARPROC my_function;
|
|
||||||
|
|
||||||
my_module = GetModuleHandle( NULL);
|
|
||||||
printf( "Module_Handle: (%p)\n", my_module);
|
|
||||||
|
|
||||||
buf[0] = '\0';
|
|
||||||
GetModuleFileName( my_module, buf, 255);
|
|
||||||
printf( "Module_Name: (%s)\n", buf);
|
|
||||||
|
|
||||||
my_function = GetProcAddress( my_module, "zob");
|
|
||||||
printf( "Function_Addr: (%p)\n", my_function);
|
|
||||||
|
|
||||||
my_function();
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
__declspec(dllexport) void zob(void)
|
|
||||||
{
|
|
||||||
printf( "Zoby la mouche qui pête...!!!\n");
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# $RCSfile: nddemo0.dat,v $
|
# $RCSfile: nddemo0.dat,v $
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# $Revision: 2.0 $
|
# $Revision: 2.1 $
|
||||||
# $Name: $
|
# $Name: $
|
||||||
# $Date: 2001/11/26 10:53:34 $
|
# $Date: 2003/07/16 00:17:02 $
|
||||||
# $Author: agibert $
|
# $Author: agibert $
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
ggg 1 xxxxxx example
|
ggg 1 xxxxxx example
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
# Microsoft Developer Studio Project File - Name="demo0" - Package Owner=<4>
|
# Microsoft Developer Studio Project File - Name="nddemo0" - Package Owner=<4>
|
||||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||||
# ** DO NOT EDIT **
|
# ** DO NOT EDIT **
|
||||||
|
|
||||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||||
|
|
||||||
CFG=demo0 - Win32 Debug
|
CFG=nddemo0 - Win32 Debug
|
||||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||||
!MESSAGE use the Export Makefile command and run
|
!MESSAGE use the Export Makefile command and run
|
||||||
!MESSAGE
|
!MESSAGE
|
||||||
!MESSAGE NMAKE /f "demo0.mak".
|
!MESSAGE NMAKE /f "nddemo0.mak".
|
||||||
!MESSAGE
|
!MESSAGE
|
||||||
!MESSAGE You can specify a configuration when running NMAKE
|
!MESSAGE You can specify a configuration when running NMAKE
|
||||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||||
!MESSAGE
|
!MESSAGE
|
||||||
!MESSAGE NMAKE /f "demo0.mak" CFG="demo0 - Win32 Debug"
|
!MESSAGE NMAKE /f "nddemo0.mak" CFG="nddemo0 - Win32 Debug"
|
||||||
!MESSAGE
|
!MESSAGE
|
||||||
!MESSAGE Possible choices for configuration are:
|
!MESSAGE Possible choices for configuration are:
|
||||||
!MESSAGE
|
!MESSAGE
|
||||||
!MESSAGE "demo0 - Win32 Release" (based on "Win32 (x86) Console Application")
|
!MESSAGE "nddemo0 - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||||
!MESSAGE "demo0 - Win32 Debug" (based on "Win32 (x86) Console Application")
|
!MESSAGE "nddemo0 - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||||
!MESSAGE
|
!MESSAGE
|
||||||
|
|
||||||
# Begin Project
|
# Begin Project
|
||||||
@@ -28,7 +28,7 @@ CFG=demo0 - Win32 Debug
|
|||||||
CPP=cl.exe
|
CPP=cl.exe
|
||||||
RSC=rc.exe
|
RSC=rc.exe
|
||||||
|
|
||||||
!IF "$(CFG)" == "demo0 - Win32 Release"
|
!IF "$(CFG)" == "nddemo0 - Win32 Release"
|
||||||
|
|
||||||
# PROP BASE Use_MFC 0
|
# PROP BASE Use_MFC 0
|
||||||
# PROP BASE Use_Debug_Libraries 0
|
# PROP BASE Use_Debug_Libraries 0
|
||||||
@@ -52,7 +52,7 @@ 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 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 /subsystem:console /machine:I386
|
# 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 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 /subsystem:console /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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libnode.lib /nologo /subsystem:console /incremental:yes /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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libnode.lib /nologo /subsystem:console /incremental:yes /machine:I386
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "demo0 - Win32 Debug"
|
!ELSEIF "$(CFG)" == "nddemo0 - Win32 Debug"
|
||||||
|
|
||||||
# PROP BASE Use_MFC 0
|
# PROP BASE Use_MFC 0
|
||||||
# PROP BASE Use_Debug_Libraries 1
|
# PROP BASE Use_Debug_Libraries 1
|
||||||
@@ -74,24 +74,24 @@ BSC32=bscmake.exe
|
|||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
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 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 /subsystem:console /debug /machine:I386 /pdbtype:sept
|
# 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 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 /subsystem:console /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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libnoded.lib /nologo /subsystem:console /debug /machine:I386 /out:"demo0d.exe" /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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libnoded.lib /nologo /subsystem:console /debug /machine:I386 /out:"nddemo0d.exe" /pdbtype:sept
|
||||||
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
# Begin Target
|
# Begin Target
|
||||||
|
|
||||||
# Name "demo0 - Win32 Release"
|
# Name "nddemo0 - Win32 Release"
|
||||||
# Name "demo0 - Win32 Debug"
|
# Name "nddemo0 - Win32 Debug"
|
||||||
# Begin Group "Source Files"
|
# Begin Group "Source Files"
|
||||||
|
|
||||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\demo0.c
|
SOURCE=.\nddemo0.c
|
||||||
|
|
||||||
!IF "$(CFG)" == "demo0 - Win32 Release"
|
!IF "$(CFG)" == "nddemo0 - Win32 Release"
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "demo0 - Win32 Debug"
|
!ELSEIF "$(CFG)" == "nddemo0 - Win32 Debug"
|
||||||
|
|
||||||
# ADD CPP /MDd
|
# ADD CPP /MDd
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ Microsoft Developer Studio Workspace File, Format Version 6.00
|
|||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
Project: "demo0"=.\demo0.dsp - Package Owner=<4>
|
Project: "nddemo0"=.\nddemo0.dsp - Package Owner=<4>
|
||||||
|
|
||||||
Package=<5>
|
Package=<5>
|
||||||
{{{
|
{{{
|
||||||
|
|||||||
5
doc/Makefile
Normal file
5
doc/Makefile
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
FILE_DOC := libnode.doc
|
||||||
|
FILE_MAN := man3
|
||||||
|
|
||||||
|
include ../Makefile.var
|
||||||
|
include ../Makefile.rule
|
||||||
6
include/Makefile
Normal file
6
include/Makefile
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
FILE_INCLUDE := node.h
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
include ../Makefile.var
|
||||||
|
include ../Makefile.rule
|
||||||
671
include/node.h
671
include/node.h
@@ -1,10 +1,10 @@
|
|||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
/* $RCSfile: node.h,v $ */
|
/* $RCSfile: node.h,v $ */
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
/* $Revision: 2.5 $ */
|
/* $Revision: 2.13 $ */
|
||||||
/* $Name: $ */
|
/* $Name: $ */
|
||||||
/* $Date: 2002/02/28 21:53:47 $ */
|
/* $Date: 2010/06/06 21:26:31 $ */
|
||||||
/* $Author: agibert $ */
|
/* $Author: agibert $ */
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
/* GNU Lesser General Public License for more details. */
|
/* GNU Lesser General Public License for more details. */
|
||||||
/* */
|
/* */
|
||||||
/* You should have received a copy of the GNU Lesser General Public License */
|
/* You should have received a copy of the GNU Lesser General Public License */
|
||||||
/* along with Foobar; if not, write to the Free Software */
|
/* along with LibNode; if not, write to the Free Software */
|
||||||
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@@ -31,21 +31,20 @@
|
|||||||
|
|
||||||
|
|
||||||
#ifndef _LIBNODE_H_
|
#ifndef _LIBNODE_H_
|
||||||
#define _LIBNODE_H_
|
# define _LIBNODE_H_
|
||||||
|
|
||||||
#ifdef __cplusplus
|
# ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#include <stdio.h>
|
# include <stdlib.h>
|
||||||
#include <stdlib.h>
|
# include <stdio.h>
|
||||||
#include <string.h>
|
# include <string.h>
|
||||||
#include <signal.h>
|
# include <stdarg.h>
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
#ifdef _LIBVER_SUPPORT
|
# ifdef _LIBVER_SUPPORT
|
||||||
# include <ver.h>
|
# include <ver.h>
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -64,9 +63,9 @@ extern "C" {
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Différence de profondeur entre la branche la plus courte et
|
Différence de profondeur entre la branche la plus courte et
|
||||||
la plus longue d'un arbre.
|
la plus longue d'un arbre.
|
||||||
Le dépassement de ce seuil provoque le rééquilibrage de l'arbre
|
Le dépassement de ce seuil provoque le rééquilibrage de l'arbre
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define DEF_MAX_DIF 100
|
#define DEF_MAX_DIF 100
|
||||||
@@ -131,9 +130,9 @@ typedef int NDT_Index_Type;
|
|||||||
|
|
||||||
#define ND_INDEX_SUBTYPE_VALUE_UNKNOWN_IS( v) ( ( (v) & NDD_INDEX_SUBTYPE_MSK) == NDD_INDEX_SUBTYPE_UNKNOWN)
|
#define ND_INDEX_SUBTYPE_VALUE_UNKNOWN_IS( v) ( ( (v) & NDD_INDEX_SUBTYPE_MSK) == NDD_INDEX_SUBTYPE_UNKNOWN)
|
||||||
#define ND_INDEX_SUBTYPE_VALUE_FIFO_IS( v) ( ( (v) & NDD_INDEX_SUBTYPE_MSK) == NDD_INDEX_SUBTYPE_FIFO)
|
#define ND_INDEX_SUBTYPE_VALUE_FIFO_IS( v) ( ( (v) & NDD_INDEX_SUBTYPE_MSK) == NDD_INDEX_SUBTYPE_FIFO)
|
||||||
#define ND_INDEX_SUBTYPE_VALUE_LILO_IS( v) ND_INDEX_SUBTYPE_VALUE_FIFO_IS( v)
|
#define ND_INDEX_SUBTYPE_VALUE_LILO_IS( v) ND_INDEX_SUBTYPE_VALUE_FIFO_IS( v)
|
||||||
#define ND_INDEX_SUBTYPE_VALUE_LIFO_IS( v) ( ( (v) & NDD_INDEX_SUBTYPE_MSK) == NDD_INDEX_SUBTYPE_LIFO)
|
#define ND_INDEX_SUBTYPE_VALUE_LIFO_IS( v) ( ( (v) & NDD_INDEX_SUBTYPE_MSK) == NDD_INDEX_SUBTYPE_LIFO)
|
||||||
#define ND_INDEX_SUBTYPE_VALUE_FILO_IS( v) ND_INDEX_SUBTYPE_LIFO_IS( r, i)
|
#define ND_INDEX_SUBTYPE_VALUE_FILO_IS( v) ND_INDEX_SUBTYPE_LIFO_IS( r, i)
|
||||||
#define ND_INDEX_SUBTYPE_VALUE_SORTED_IS( v) ( ( (v) & NDD_INDEX_SUBTYPE_MSK) == NDD_INDEX_SUBTYPE_SORTED)
|
#define ND_INDEX_SUBTYPE_VALUE_SORTED_IS( v) ( ( (v) & NDD_INDEX_SUBTYPE_MSK) == NDD_INDEX_SUBTYPE_SORTED)
|
||||||
#define ND_INDEX_SUBTYPE_VALUE_UNBALANCED_IS( v) ( ( (v) & NDD_INDEX_SUBTYPE_MSK) == NDD_INDEX_SUBTYPE_UNBALANCED)
|
#define ND_INDEX_SUBTYPE_VALUE_UNBALANCED_IS( v) ( ( (v) & NDD_INDEX_SUBTYPE_MSK) == NDD_INDEX_SUBTYPE_UNBALANCED)
|
||||||
#define ND_INDEX_SUBTYPE_VALUE_BALANCED_IS( v) ( ( (v) & NDD_INDEX_SUBTYPE_MSK) == NDD_INDEX_SUBTYPE_BALANCED)
|
#define ND_INDEX_SUBTYPE_VALUE_BALANCED_IS( v) ( ( (v) & NDD_INDEX_SUBTYPE_MSK) == NDD_INDEX_SUBTYPE_BALANCED)
|
||||||
@@ -152,6 +151,349 @@ typedef int NDT_Index_Type;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Manager Template */
|
||||||
|
|
||||||
|
// NDT_Status ND_Example_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list *Args_Ptr)
|
||||||
|
// {
|
||||||
|
// NDT_Command_Name Command_Name;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// switch( Command)
|
||||||
|
// {
|
||||||
|
// case NDD_CMD_MANAGER_VERSION:
|
||||||
|
// {
|
||||||
|
// ND_VA_ARG_GET( Version_Name_Ptr, *Args_Ptr, NDT_Version_Name *);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Command_Name = "NDD_CMD_MANAGER_VERSION";
|
||||||
|
//
|
||||||
|
// *Version_Name_Ptr = "$Revision: 2.13 $ $Name: $ $Date: 2010/06/06 21:26:31 $ $Author: agibert $";
|
||||||
|
//
|
||||||
|
// return( NDS_OK);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// case NDD_CMD_INDEX_GET:
|
||||||
|
// {
|
||||||
|
// /*
|
||||||
|
// ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
|
||||||
|
// ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
|
||||||
|
// ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
|
||||||
|
// ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||||
|
// */
|
||||||
|
// ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
|
||||||
|
// ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
|
||||||
|
// ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
|
||||||
|
// ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Command_Name = "NDD_CMD_INDEX_GET";
|
||||||
|
//
|
||||||
|
// switch(Cmd)
|
||||||
|
// {
|
||||||
|
// /*
|
||||||
|
// case NDT_CMD_SOME_USER_CMD:
|
||||||
|
// {
|
||||||
|
// *Reply_Index_Id_Ptr = 0;
|
||||||
|
// *Reply_Command_Ptr = NDD_CMD_SOME_OTHER_CMD;
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// ...
|
||||||
|
// */
|
||||||
|
//
|
||||||
|
// default:
|
||||||
|
// {
|
||||||
|
// *Reply_Index_Id_Ptr = Index_Id;
|
||||||
|
// *Reply_Command_Ptr = Cmd;
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// return( NDS_OK);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// case NDD_CMD_VALUE_ALLOC:
|
||||||
|
// {
|
||||||
|
// /*
|
||||||
|
// ND_VA_ARG_GET( Value_Ptr_Ptr, *Args_Ptr, void **);
|
||||||
|
//
|
||||||
|
// ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||||
|
//
|
||||||
|
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||||
|
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||||
|
//
|
||||||
|
// ND_VA_LIST_CLOSE( user_args);
|
||||||
|
// */
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Command_Name = "NDD_CMD_VALUE_ALLOC";
|
||||||
|
//
|
||||||
|
// /*
|
||||||
|
// if( ( *Value_Ptr_Ptr = (void *)malloc( sizeof(void))) == NULL)
|
||||||
|
// {
|
||||||
|
// return(NDS_ERRMEM);
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// ...
|
||||||
|
//
|
||||||
|
// return( NDS_OK);
|
||||||
|
// }
|
||||||
|
// */
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// case NDD_CMD_VALUE_FREE:
|
||||||
|
// {
|
||||||
|
// /*
|
||||||
|
// ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||||
|
//
|
||||||
|
// ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||||
|
//
|
||||||
|
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||||
|
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||||
|
//
|
||||||
|
// ND_VA_LIST_CLOSE( user_args);
|
||||||
|
// */
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Command_Name = "NDD_CMD_VALUE_FREE";
|
||||||
|
//
|
||||||
|
// /*
|
||||||
|
// free( Value_Ptr);
|
||||||
|
//
|
||||||
|
// return( NDS_OK);
|
||||||
|
// */
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// case NDD_CMD_VALUE_COMP:
|
||||||
|
// {
|
||||||
|
// /*
|
||||||
|
// ND_VA_ARG_GET( Value1_Ptr, *Args_Ptr, void *);
|
||||||
|
// ND_VA_ARG_GET( Value2_Ptr, *Args_Ptr, void *);
|
||||||
|
//
|
||||||
|
// ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||||
|
//
|
||||||
|
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||||
|
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||||
|
//
|
||||||
|
// ND_VA_LIST_CLOSE( user_args);
|
||||||
|
// */
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Command_Name = "NDD_CMD_VALUE_COMP";
|
||||||
|
//
|
||||||
|
// switch( Index_Id)
|
||||||
|
// {
|
||||||
|
// case 0:
|
||||||
|
// {
|
||||||
|
// int rc;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// rc = strcmp( Value1_Ptr->..., Value2_Ptr->...);
|
||||||
|
//
|
||||||
|
// if( rc < 0)
|
||||||
|
// {
|
||||||
|
// return(NDS_LOWER);
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// if( rc > 0)
|
||||||
|
// {
|
||||||
|
// return(NDS_GREATER);
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// return(NDS_EQUAL);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// case 1:
|
||||||
|
// {
|
||||||
|
// int val1 = atoi(Value1_Ptr->...);
|
||||||
|
// int val2 = atoi(Value2_Ptr->...);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// if( val1 < val2)
|
||||||
|
// {
|
||||||
|
// return(NDS_LOWER);
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// if( val1 > val2)
|
||||||
|
// {
|
||||||
|
// return(NDS_GREATER);
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// return(NDS_EQUAL);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// case 2:
|
||||||
|
// {
|
||||||
|
// ...
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// default:
|
||||||
|
// {
|
||||||
|
// printf( "Unknown COMP idx (%d) !\n", Index_Id);
|
||||||
|
// return( NDS_KO);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// return( NDS_OK);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// case NDD_CMD_VALUE_ADD:
|
||||||
|
// {
|
||||||
|
// /*
|
||||||
|
// ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||||
|
//
|
||||||
|
// ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||||
|
//
|
||||||
|
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||||
|
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||||
|
//
|
||||||
|
// ND_VA_LIST_CLOSE( user_args);
|
||||||
|
// */
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Command_Name = "NDD_CMD_VALUE_ADD";
|
||||||
|
//
|
||||||
|
// /*
|
||||||
|
// return( NDS_OK);
|
||||||
|
// */
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// case NDD_CMD_VALUE_REMOVE:
|
||||||
|
// {
|
||||||
|
// /*
|
||||||
|
// ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||||
|
//
|
||||||
|
// ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||||
|
//
|
||||||
|
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||||
|
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||||
|
//
|
||||||
|
// ND_VA_LIST_CLOSE( user_args);
|
||||||
|
// */
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Command_Name = "NDD_CMD_VALUE_REMOVE";
|
||||||
|
// /*
|
||||||
|
// return( NDS_OK);
|
||||||
|
// */
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// case NDD_CMD_VALUE_PRINT:
|
||||||
|
// {
|
||||||
|
// /*
|
||||||
|
// ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||||
|
//
|
||||||
|
// ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
|
||||||
|
//
|
||||||
|
// ND_VA_ARG_GET( Out, lib_args, FILE *);
|
||||||
|
// ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
|
||||||
|
// ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
|
||||||
|
// ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
|
||||||
|
//
|
||||||
|
// ND_VA_LIST_OPEN( user_args, lib_args);
|
||||||
|
//
|
||||||
|
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||||
|
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||||
|
//
|
||||||
|
// ND_VA_LIST_CLOSE( user_args);
|
||||||
|
// ND_VA_LIST_CLOSE( lib_args);
|
||||||
|
//
|
||||||
|
// void *Value_Ptr = Node_Ptr->Value;
|
||||||
|
// */
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Command_Name = "NDD_CMD_VALUE_PRINT";
|
||||||
|
//
|
||||||
|
// /*
|
||||||
|
// fprintf( Out, "...\n", Value_Ptr->..., ...);
|
||||||
|
//
|
||||||
|
// return( NDS_OK);
|
||||||
|
// */
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// case NDD_CMD_INFO_PRINT:
|
||||||
|
// {
|
||||||
|
// /*
|
||||||
|
// ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||||
|
//
|
||||||
|
// ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
|
||||||
|
//
|
||||||
|
// ND_VA_ARG_GET( Out, lib_args, FILE *);
|
||||||
|
// ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
|
||||||
|
// ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
|
||||||
|
// ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
|
||||||
|
//
|
||||||
|
// ND_VA_LIST_OPEN( user_args, lib_args);
|
||||||
|
//
|
||||||
|
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||||
|
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||||
|
//
|
||||||
|
// ND_VA_LIST_CLOSE( user_args);
|
||||||
|
// ND_VA_LIST_CLOSE( lib_args);
|
||||||
|
// */
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Command_Name = "NDD_CMD_INFO_PRINT";
|
||||||
|
//
|
||||||
|
// /*
|
||||||
|
// return( NDS_OK);
|
||||||
|
// */
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// case NDD_CMD_USER_TRAVERSE:
|
||||||
|
// {
|
||||||
|
// /*
|
||||||
|
// ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||||
|
//
|
||||||
|
// ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||||
|
//
|
||||||
|
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||||
|
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||||
|
//
|
||||||
|
// ND_VA_LIST_CLOSE( user_args);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// void *Value_Ptr = Node_Ptr->Value;
|
||||||
|
// */
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Command_Name = "NDD_CMD_USER_TRAVERSE";
|
||||||
|
//
|
||||||
|
// /*
|
||||||
|
// return( NDS_OK);
|
||||||
|
// */
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// default:
|
||||||
|
// {
|
||||||
|
// printf( "ND_Default_Manager() called with an undefined command %d\n", Command);
|
||||||
|
// return(NDS_ERRAPI);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// printf( "ND_Default_Manager() called with command %d (%s)\n", Command, Command_Name);
|
||||||
|
// return(NDS_OK);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Var Args Manager Macros */
|
||||||
|
|
||||||
|
#define ND_VA_LIST_OPEN( VA_List_Target, VA_List_Source) va_list VA_List_Target; va_copy( VA_List_Target, *va_arg( VA_List_Source, va_list *))
|
||||||
|
#define ND_VA_LIST_CLOSE( VA_List) va_end( VA_List)
|
||||||
|
#define ND_VA_ARG_GET( Arg, VA_List, Type) Type Arg = va_arg( VA_List, Type)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Commandes du manager */
|
/* Commandes du manager */
|
||||||
|
|
||||||
typedef int NDT_Command;
|
typedef int NDT_Command;
|
||||||
@@ -217,7 +559,7 @@ struct NDT_Node;
|
|||||||
|
|
||||||
typedef char *NDT_Manager_Name;
|
typedef char *NDT_Manager_Name;
|
||||||
|
|
||||||
typedef NDT_Status NDT_Manager( struct NDT_Root *, NDT_Index_Id, struct NDT_Node *, NDT_Command, va_list);
|
typedef NDT_Status NDT_Manager( struct NDT_Root *, NDT_Index_Id, struct NDT_Node *, NDT_Command, va_list *);
|
||||||
|
|
||||||
|
|
||||||
/* Pointeur de fonction sur l'allocateur */
|
/* Pointeur de fonction sur l'allocateur */
|
||||||
@@ -227,7 +569,7 @@ typedef NDT_Status NDT_Manager( struct NDT_Root *, NDT_Index_Id, struct NDT_Nod
|
|||||||
|
|
||||||
typedef char *NDT_Allocator_Name;
|
typedef char *NDT_Allocator_Name;
|
||||||
|
|
||||||
typedef NDT_Status NDT_Allocator(size_t, void **, void *);
|
typedef NDT_Status NDT_Allocator( void **, size_t, void *);
|
||||||
|
|
||||||
|
|
||||||
/* Pointeur de fonction sur le désallocateur */
|
/* Pointeur de fonction sur le désallocateur */
|
||||||
@@ -237,23 +579,23 @@ typedef NDT_Status NDT_Allocator(size_t, void **, void *);
|
|||||||
|
|
||||||
typedef char *NDT_Desallocator_Name;
|
typedef char *NDT_Desallocator_Name;
|
||||||
|
|
||||||
typedef NDT_Status NDT_Desallocator(void *, void *);
|
typedef NDT_Status NDT_Desallocator( void *, void *);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct NDT_Index
|
typedef struct NDT_Index
|
||||||
{
|
{
|
||||||
NDT_Index_Type Type; /* Type de la structure (liste, arbre ... ) */
|
NDT_Index_Type Type; /* Type de la structure (liste, arbre ... ) */
|
||||||
|
|
||||||
long Node_Number; /* Nombre de noeuds dans la structure */
|
long Node_Number; /* Nombre de noeuds dans la structure */
|
||||||
long Min_Depth; /* Profondeur minimale de l'arbre */
|
long Min_Depth; /* Profondeur minimale de l'arbre */
|
||||||
long Max_Depth; /* Profondeur maximale de l'arbre */
|
long Max_Depth; /* Profondeur maximale de l'arbre */
|
||||||
long Max_Dif; /* Différence maximale autorisée entre la branche la plus courte et la plus longue */
|
long Max_Dif; /* Différence maximale autorisée entre la branche la plus courte et la plus longue */
|
||||||
long Nb_Equ; /* Nombre de réquilibrages réalisés sur l'arbre */
|
long Nb_Equ; /* Nombre de réquilibrages réalisés sur l'arbre */
|
||||||
struct NDT_Node * Head; /* Noeud de tête */
|
struct NDT_Node *Head; /* Noeud de tête */
|
||||||
struct NDT_Node * Tail; /* Noeud de queue */
|
struct NDT_Node *Tail; /* Noeud de queue */
|
||||||
struct NDT_Node * Save; /* Pointeur de sauvegarde (utile pour la fonction de restauration) */
|
struct NDT_Node *Save; /* Pointeur de sauvegarde (utile pour la fonction de restauration) */
|
||||||
|
|
||||||
} NDT_Index;
|
} NDT_Index;
|
||||||
|
|
||||||
@@ -261,22 +603,22 @@ typedef struct NDT_Index
|
|||||||
|
|
||||||
typedef struct NDT_Root
|
typedef struct NDT_Root
|
||||||
{
|
{
|
||||||
// NDT_Root_Type Type; /* Root Structure Type */
|
/* NDT_Root_Type Type;*/ /* Root Structure Type */
|
||||||
// NDT_DataStruct_Type DS_Type; /* Type de la structure (liste, arbre ... ) */
|
/* NDT_DataStruct_Type DS_Type;*/ /* Type de la structure (liste, arbre ... ) */
|
||||||
|
|
||||||
NDT_Manager *Manager_Ptr; /* Pointeur sur la fonction manager */
|
NDT_Manager *Manager_Ptr; /* Pointeur sur la fonction manager */
|
||||||
char Manager_Name[NDD_MANAGER_NAME_SIZE_MAX]; /* Nom de la fonction manager */
|
char Manager_Name[NDD_MANAGER_NAME_SIZE_MAX]; /* Nom de la fonction manager */
|
||||||
NDT_Allocator *Allocator_Ptr; /* Pointeur sur la fonction d'allocation */
|
NDT_Allocator *Allocator_Ptr; /* Pointeur sur la fonction d'allocation */
|
||||||
char Allocator_Name[NDD_ALLOCATOR_NAME_SIZE_MAX]; /* Nom de la fonction d'allocation */
|
char Allocator_Name[NDD_ALLOCATOR_NAME_SIZE_MAX]; /* Nom de la fonction d'allocation */
|
||||||
NDT_Desallocator *Desallocator_Ptr; /* Pointeur sur la fonction de désallocation */
|
NDT_Desallocator *Desallocator_Ptr; /* Pointeur sur la fonction de désallocation */
|
||||||
char Desallocator_Name[NDD_DESALLOCATOR_NAME_SIZE_MAX]; /* Nom de la fonction de désallocation */
|
char Desallocator_Name[NDD_DESALLOCATOR_NAME_SIZE_MAX]; /* Nom de la fonction de désallocation */
|
||||||
|
|
||||||
short Own_Value; /* Indique si la structure est propriétaire de ses valeurs */
|
short Own_Value; /* Indique si la structure est propriétaire de ses valeurs */
|
||||||
void *User; /* Pointeur utilisable librement par l'utilisateur */
|
void *User_Ptr; /* Pointeur utilisable librement par l'utilisateur */
|
||||||
|
|
||||||
NDT_Index_Nb Index_Nb;
|
NDT_Index_Nb Index_Nb;
|
||||||
NDT_Index_Nb Index_Open_Count;
|
NDT_Index_Nb Index_Open_Count;
|
||||||
NDT_Index Index_Tab[0];
|
NDT_Index Index_Tab[1];
|
||||||
|
|
||||||
} NDT_Root;
|
} NDT_Root;
|
||||||
|
|
||||||
@@ -285,11 +627,11 @@ typedef struct NDT_Root
|
|||||||
typedef struct NDT_DataStruct
|
typedef struct NDT_DataStruct
|
||||||
{
|
{
|
||||||
|
|
||||||
NDT_Root *Root_Ptr;
|
NDT_Root *Root_Ptr;
|
||||||
|
|
||||||
NDT_Manager *Manager_Ptr; /* Manager function pointer */
|
NDT_Manager *Manager_Ptr; /* Manager function pointer */
|
||||||
NDT_Allocator *Allocator_Ptr; /* Allocator function pointer */
|
NDT_Allocator *Allocator_Ptr; /* Allocator function pointer */
|
||||||
NDT_Desallocator *Desallocator_Ptr; /* Desallocator function pointer */
|
NDT_Desallocator *Desallocator_Ptr; /* Desallocator function pointer */
|
||||||
|
|
||||||
} NDT_DataStruct;
|
} NDT_DataStruct;
|
||||||
|
|
||||||
@@ -299,33 +641,29 @@ typedef struct NDT_DataStruct
|
|||||||
|
|
||||||
typedef struct NDT_Node
|
typedef struct NDT_Node
|
||||||
{
|
{
|
||||||
NDT_Root *Root;
|
NDT_Root *Root;
|
||||||
NDT_Index_Id Index;
|
NDT_Index_Id Index;
|
||||||
struct NDT_Node *Parent;
|
struct NDT_Node *Parent;
|
||||||
struct NDT_Node *Left;
|
struct NDT_Node *Left;
|
||||||
struct NDT_Node *Right;
|
struct NDT_Node *Right;
|
||||||
void *Value;
|
void *Value;
|
||||||
} NDT_Node;
|
} NDT_Node;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
char ND_Error_Msg [512];
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef int NDT_Recursive_Mode;
|
typedef int NDT_Recursive_Mode;
|
||||||
typedef int NDT_Recursive_Depth;
|
typedef int NDT_Recursive_Depth;
|
||||||
typedef int NDT_Recursive_Offset;
|
typedef int NDT_Recursive_Offset;
|
||||||
|
|
||||||
#define NDD_RECURSIVE_MODE_UNKNOWN (NDT_Recursive_Mode)0x00
|
#define NDD_RECURSIVE_MODE_UNKNOWN (NDT_Recursive_Mode)0x00
|
||||||
#define NDD_RECURSIVE_MODE_PARENT (NDT_Recursive_Mode)0x01
|
#define NDD_RECURSIVE_MODE_PARENT (NDT_Recursive_Mode)0x01
|
||||||
#define NDD_RECURSIVE_MODE_CHILD (NDT_Recursive_Mode)0x02
|
#define NDD_RECURSIVE_MODE_CHILD (NDT_Recursive_Mode)0x02
|
||||||
#define NDD_RECURSIVE_MODE_PARENT_CHILD (NDT_Recursive_Mode)0x03
|
#define NDD_RECURSIVE_MODE_PARENT_CHILD (NDT_Recursive_Mode)0x03
|
||||||
|
|
||||||
#define ND_RECURSIVE_PARENT_IS(m) (m & NDD_RECURSIVE_MODE_PARENT)
|
#define ND_RECURSIVE_PARENT_IS(m) (m & NDD_RECURSIVE_MODE_PARENT)
|
||||||
#define ND_RECURSIVE_CHILD_IS(m) (m & NDD_RECURSIVE_MODE_CHILD)
|
#define ND_RECURSIVE_CHILD_IS(m) (m & NDD_RECURSIVE_MODE_CHILD)
|
||||||
|
|
||||||
#define ND_RECURSIVE_PRINT_OFFSET 8
|
#define ND_RECURSIVE_PRINT_OFFSET 8
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -339,7 +677,7 @@ typedef int NDT_Recursive_Offset;
|
|||||||
|
|
||||||
#define ND_Library_Open ND_Library_Open_I
|
#define ND_Library_Open ND_Library_Open_I
|
||||||
#define ND_Library_Close ND_Library_Close_I
|
#define ND_Library_Close ND_Library_Close_I
|
||||||
#define ND_Library_Stderr_Set ND_Library_Stderr_Set_I
|
#define ND_Library_StdErr_Set ND_Library_StdErr_Set_I
|
||||||
|
|
||||||
#define ND_DataStruct_Open ND_DataStruct_Open_I
|
#define ND_DataStruct_Open ND_DataStruct_Open_I
|
||||||
#define ND_DataStruct_Close ND_DataStruct_Close_I
|
#define ND_DataStruct_Close ND_DataStruct_Close_I
|
||||||
@@ -355,25 +693,25 @@ typedef int NDT_Recursive_Offset;
|
|||||||
#define ND_DataStruct_Value_Print ND_DataStruct_Value_Print_I
|
#define ND_DataStruct_Value_Print ND_DataStruct_Value_Print_I
|
||||||
#define ND_DataStruct_Value_Find ND_DataStruct_Value_Find_I
|
#define ND_DataStruct_Value_Find ND_DataStruct_Value_Find_I
|
||||||
|
|
||||||
#define ND_Index_Open ND_Index_Open_I
|
#define ND_Index_Open ND_Index_Open_I
|
||||||
#define ND_Index_Close ND_Index_Close_I
|
#define ND_Index_Close ND_Index_Close_I
|
||||||
#define ND_Index_Flush ND_Index_Flush_I
|
#define ND_Index_Flush ND_Index_Flush_I
|
||||||
#define ND_Index_Check ND_Index_Check_I
|
#define ND_Index_Check ND_Index_Check_I
|
||||||
#define ND_Index_Convert ND_Index_Convert_I
|
#define ND_Index_Convert ND_Index_Convert_I
|
||||||
#define ND_Index_Reorg ND_Index_Reorg_I
|
#define ND_Index_Reorg ND_Index_Reorg_I
|
||||||
#define ND_Index_Traverse_V ND_Index_Traverse_VI
|
#define ND_Index_Traverse_V ND_Index_Traverse_VI
|
||||||
#define ND_Index_Traverse ND_Index_Traverse_I
|
#define ND_Index_Traverse ND_Index_Traverse_I
|
||||||
#define ND_Index_Info_Print ND_Index_Info_Print_I
|
#define ND_Index_Info_Print ND_Index_Info_Print_I
|
||||||
#define ND_Index_Value_Add ND_Index_Value_Add_I
|
#define ND_Index_Value_Add ND_Index_Value_Add_I
|
||||||
#define ND_Index_Value_Remove ND_Index_Value_Remove_I
|
#define ND_Index_Value_Remove ND_Index_Value_Remove_I
|
||||||
#define ND_Index_Value_Print ND_Index_Value_Print_I
|
#define ND_Index_Value_Print ND_Index_Value_Print_I
|
||||||
#define ND_Index_Node_Add ND_Index_Node_Add_I
|
#define ND_Index_Node_Add ND_Index_Node_Add_I
|
||||||
#define ND_Index_Node_Remove ND_Index_Node_Remove_I
|
#define ND_Index_Node_Remove ND_Index_Node_Remove_I
|
||||||
#define ND_Index_Node_First_Get ND_Index_Node_First_Get_I
|
#define ND_Index_Node_First_Get ND_Index_Node_First_Get_I
|
||||||
#define ND_Index_Node_Last_Get ND_Index_Node_Last_Get_I
|
#define ND_Index_Node_Last_Get ND_Index_Node_Last_Get_I
|
||||||
#define ND_Index_Node_Next_Get ND_Index_Node_Next_Get_I
|
#define ND_Index_Node_Next_Get ND_Index_Node_Next_Get_I
|
||||||
#define ND_Index_Node_Previous_Get ND_Index_Node_Previous_Get_I
|
#define ND_Index_Node_Previous_Get ND_Index_Node_Previous_Get_I
|
||||||
#define ND_Index_Node_Find ND_Index_Node_Find_I
|
#define ND_Index_Node_Find ND_Index_Node_Find_I
|
||||||
|
|
||||||
#define ND_Node_Root_Get ND_Node_Root_Get_I
|
#define ND_Node_Root_Get ND_Node_Root_Get_I
|
||||||
|
|
||||||
@@ -389,7 +727,7 @@ typedef int NDT_Recursive_Offset;
|
|||||||
|
|
||||||
#define ND_Library_Open ND_Library_Open_C
|
#define ND_Library_Open ND_Library_Open_C
|
||||||
#define ND_Library_Close ND_Library_Close_C
|
#define ND_Library_Close ND_Library_Close_C
|
||||||
#define ND_Library_Stderr_Set ND_Library_Stderr_Set_C
|
#define ND_Library_StdErr_Set ND_Library_StdErr_Set_C
|
||||||
|
|
||||||
#define ND_DataStruct_Open ND_DataStruct_Open_C
|
#define ND_DataStruct_Open ND_DataStruct_Open_C
|
||||||
#define ND_DataStruct_Close ND_DataStruct_Close_C
|
#define ND_DataStruct_Close ND_DataStruct_Close_C
|
||||||
@@ -405,25 +743,25 @@ typedef int NDT_Recursive_Offset;
|
|||||||
#define ND_DataStruct_Value_Print ND_DataStruct_Value_Print_C
|
#define ND_DataStruct_Value_Print ND_DataStruct_Value_Print_C
|
||||||
#define ND_DataStruct_Value_Find ND_DataStruct_Value_Find_C
|
#define ND_DataStruct_Value_Find ND_DataStruct_Value_Find_C
|
||||||
|
|
||||||
#define ND_Index_Open ND_Index_Open_C
|
#define ND_Index_Open ND_Index_Open_C
|
||||||
#define ND_Index_Close ND_Index_Close_C
|
#define ND_Index_Close ND_Index_Close_C
|
||||||
#define ND_Index_Flush ND_Index_Flush_C
|
#define ND_Index_Flush ND_Index_Flush_C
|
||||||
#define ND_Index_Check ND_Index_Check_C
|
#define ND_Index_Check ND_Index_Check_C
|
||||||
#define ND_Index_Convert ND_Index_Convert_C
|
#define ND_Index_Convert ND_Index_Convert_C
|
||||||
#define ND_Index_Reorg ND_Index_Reorg_C
|
#define ND_Index_Reorg ND_Index_Reorg_C
|
||||||
#define ND_Index_Traverse_V ND_Index_Traverse_VC
|
#define ND_Index_Traverse_V ND_Index_Traverse_VC
|
||||||
#define ND_Index_Traverse ND_Index_Traverse_C
|
#define ND_Index_Traverse ND_Index_Traverse_C
|
||||||
#define ND_Index_Info_Print ND_Index_Info_Print_C
|
#define ND_Index_Info_Print ND_Index_Info_Print_C
|
||||||
#define ND_Index_Value_Add ND_Index_Value_Add_C
|
#define ND_Index_Value_Add ND_Index_Value_Add_C
|
||||||
#define ND_Index_Value_Remove ND_Index_Value_Remove_C
|
#define ND_Index_Value_Remove ND_Index_Value_Remove_C
|
||||||
#define ND_Index_Value_Print ND_Index_Value_Print_C
|
#define ND_Index_Value_Print ND_Index_Value_Print_C
|
||||||
#define ND_Index_Node_Add ND_Index_Node_Add_C
|
#define ND_Index_Node_Add ND_Index_Node_Add_C
|
||||||
#define ND_Index_Node_Remove ND_Index_Node_Remove_C
|
#define ND_Index_Node_Remove ND_Index_Node_Remove_C
|
||||||
#define ND_Index_Node_First_Get ND_Index_Node_First_Get_C
|
#define ND_Index_Node_First_Get ND_Index_Node_First_Get_C
|
||||||
#define ND_Index_Node_Last_Get ND_Index_Node_Last_Get_C
|
#define ND_Index_Node_Last_Get ND_Index_Node_Last_Get_C
|
||||||
#define ND_Index_Node_Next_Get ND_Index_Node_Next_Get_C
|
#define ND_Index_Node_Next_Get ND_Index_Node_Next_Get_C
|
||||||
#define ND_Index_Node_Previous_Get ND_Index_Node_Previous_Get_C
|
#define ND_Index_Node_Previous_Get ND_Index_Node_Previous_Get_C
|
||||||
#define ND_Index_Node_Find ND_Index_Node_Find_C
|
#define ND_Index_Node_Find ND_Index_Node_Find_C
|
||||||
|
|
||||||
#define ND_Node_Root_Get ND_Node_Root_Get_C
|
#define ND_Node_Root_Get ND_Node_Root_Get_C
|
||||||
|
|
||||||
@@ -441,7 +779,7 @@ typedef int NDT_Recursive_Offset;
|
|||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
# if defined(_MSC_VER) && !defined(LIBNODE_STATIC)
|
# if defined(_WIN32) && !defined(LIBNODE_STATIC)
|
||||||
# ifndef _LIBNODE_C_
|
# ifndef _LIBNODE_C_
|
||||||
# define NDD_DLL_API __declspec(dllimport)
|
# define NDD_DLL_API __declspec(dllimport)
|
||||||
# else
|
# else
|
||||||
@@ -472,8 +810,8 @@ NDD_DLL_API NDT_Status ND_Library_Close_C( void);
|
|||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Définition de la sortie standard des messages d'erreur de la librairie */
|
/* Définition de la sortie standard des messages d'erreur de la librairie */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_Library_Stderr_Set_I( FILE *Out);
|
NDD_DLL_API NDT_Status ND_Library_StdErr_Set_I( FILE *);
|
||||||
NDD_DLL_API NDT_Status ND_Library_Stderr_Set_C( FILE *Out);
|
NDD_DLL_API NDT_Status ND_Library_StdErr_Set_C( FILE *);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -497,8 +835,8 @@ NDD_DLL_API NDT_Status ND_DataStruct_Open_C( NDT_Root **, NDT_Index_Nb, NDT_In
|
|||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* (O) Root: pointeur sur la racine de la structure de données */
|
/* (O) Root: pointeur sur la racine de la structure de données */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Close_I( NDT_Root *Root);
|
NDD_DLL_API NDT_Status ND_DataStruct_Close_I( NDT_Root *);
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Close_C( NDT_Root *Root);
|
NDD_DLL_API NDT_Status ND_DataStruct_Close_C( NDT_Root *);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -507,8 +845,8 @@ NDD_DLL_API NDT_Status ND_DataStruct_Close_C( NDT_Root *Root);
|
|||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* (O) Root: pointeur sur la racine de la structure de données */
|
/* (O) Root: pointeur sur la racine de la structure de données */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Flush_I( NDT_Root *Root);
|
NDD_DLL_API NDT_Status ND_DataStruct_Flush_I( NDT_Root *);
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Flush_C( NDT_Root *Root);
|
NDD_DLL_API NDT_Status ND_DataStruct_Flush_C( NDT_Root *);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -522,8 +860,8 @@ NDD_DLL_API NDT_Status ND_DataStruct_Flush_C( NDT_Root *Root);
|
|||||||
/* (O) Nb_Corrected : pointeur sur le nombre d'erreurs */
|
/* (O) Nb_Corrected : pointeur sur le nombre d'erreurs */
|
||||||
/* (I) Out : flux de sortie du rapport */
|
/* (I) Out : flux de sortie du rapport */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Check_I( NDT_Root *Root, int *Nb_Detected, int *Nb_Corrected, FILE *Out);
|
NDD_DLL_API NDT_Status ND_DataStruct_Check_I( NDT_Root *, int *, int *, FILE *);
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Check_C( NDT_Root *Root, int *Nb_Detected, int *Nb_Corrected, FILE *Out);
|
NDD_DLL_API NDT_Status ND_DataStruct_Check_C( NDT_Root *, int *, int *, FILE *);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -534,8 +872,8 @@ NDD_DLL_API NDT_Status ND_DataStruct_Check_C( NDT_Root *Root, int *Nb_Detecte
|
|||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* (I) Root: pointeur sur la racine de la structure de données */
|
/* (I) Root: pointeur sur la racine de la structure de données */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Reorg_I( NDT_Root *Root);
|
NDD_DLL_API NDT_Status ND_DataStruct_Reorg_I( NDT_Root *);
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Reorg_C( NDT_Root *Root);
|
NDD_DLL_API NDT_Status ND_DataStruct_Reorg_C( NDT_Root *);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -558,10 +896,10 @@ NDD_DLL_API NDT_Status ND_DataStruct_Convert_C( NDT_Root *, NDT_Index_Type *)
|
|||||||
/* (I) Command: Commande à exécuter sur chaque noeud traversé */
|
/* (I) Command: Commande à exécuter sur chaque noeud traversé */
|
||||||
/* (I) Data: pointeur de données utilisateur */
|
/* (I) Data: pointeur de données utilisateur */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_VI( NDT_Root *, NDT_Command Command, va_list);
|
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_VI( NDT_Root *, NDT_Command, va_list *);
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_VC( NDT_Root *, NDT_Command Command, va_list);
|
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_VC( NDT_Root *, NDT_Command, va_list *);
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_I( NDT_Root *, NDT_Command Command, ...);
|
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_I( NDT_Root *, NDT_Command, ...);
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_C( NDT_Root *, NDT_Command Command, ...);
|
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_C( NDT_Root *, NDT_Command, ...);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -571,8 +909,8 @@ NDD_DLL_API NDT_Status ND_DataStruct_Traverse_C( NDT_Root *, NDT_Command Comm
|
|||||||
/* (I) Root: pointeur sur la racine de la structure de données */
|
/* (I) Root: pointeur sur la racine de la structure de données */
|
||||||
/* (I) Out : flux de sortie */
|
/* (I) Out : flux de sortie */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Info_Print_I( FILE *, NDT_Root *Root, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset);
|
NDD_DLL_API NDT_Status ND_DataStruct_Info_Print_I( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset);
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Info_Print_C( FILE *, NDT_Root *Root, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset);
|
NDD_DLL_API NDT_Status ND_DataStruct_Info_Print_C( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -582,8 +920,8 @@ NDD_DLL_API NDT_Status ND_DataStruct_Info_Print_C( FILE *, NDT_Root *Root, ND
|
|||||||
/* (I) Root: pointeur sur la racine de la structure de données */
|
/* (I) Root: pointeur sur la racine de la structure de données */
|
||||||
/* (I) Value: pointeur sur la valeur à ajouter */
|
/* (I) Value: pointeur sur la valeur à ajouter */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Add_I( NDT_Root *Root, void *Value);
|
NDD_DLL_API NDT_Status ND_DataStruct_Value_Add_I( NDT_Root *, void *);
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Add_C( NDT_Root *Root, void *Value);
|
NDD_DLL_API NDT_Status ND_DataStruct_Value_Add_C( NDT_Root *, void *);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -594,8 +932,8 @@ NDD_DLL_API NDT_Status ND_DataStruct_Value_Add_C( NDT_Root *Root, void *Value
|
|||||||
/* (I) Reference_Value : pointeur sur la valeur de référence */
|
/* (I) Reference_Value : pointeur sur la valeur de référence */
|
||||||
/* (I) Removed_Value : adresse d'un pointeur sur la valeur supprimée */
|
/* (I) Removed_Value : adresse d'un pointeur sur la valeur supprimée */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Remove_I( NDT_Root *Root, void *Value);
|
NDD_DLL_API NDT_Status ND_DataStruct_Value_Remove_I( NDT_Root *, void *);
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Remove_C( NDT_Root *Root, void *Value);
|
NDD_DLL_API NDT_Status ND_DataStruct_Value_Remove_C( NDT_Root *, void *);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -605,9 +943,9 @@ NDD_DLL_API NDT_Status ND_DataStruct_Value_Remove_C( NDT_Root *Root, void *Va
|
|||||||
/* (I) Root: pointeur sur la racine de la structure de données */
|
/* (I) Root: pointeur sur la racine de la structure de données */
|
||||||
/* (I) Out : flux de sortie */
|
/* (I) Out : flux de sortie */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_VI( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, va_list);
|
NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_VI( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, va_list *);
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_I( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...);
|
NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_I( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...);
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_C( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...);
|
NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_C( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -620,10 +958,10 @@ NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_C( FILE *, NDT_Root *, NDT_R
|
|||||||
/* (I) Data : pointeur de données */
|
/* (I) Data : pointeur de données */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_VI( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, va_list);
|
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_VI( void **, NDT_Root *, void *, va_list *);
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_VC( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, va_list);
|
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_VC( void **, NDT_Root *, void *, va_list *);
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_I( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, ...);
|
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_I( void **, NDT_Root *, void *, ...);
|
||||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_C( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, ...);
|
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_C( void **, NDT_Root *, void *, ...);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -672,8 +1010,8 @@ NDD_DLL_API NDT_Status ND_Index_Flush_C( NDT_Root *, NDT_Index_Id);
|
|||||||
/* (O) Nb_Corrected : pointeur sur le nombre d'erreurs */
|
/* (O) Nb_Corrected : pointeur sur le nombre d'erreurs */
|
||||||
/* (I) Out : flux de sortie du rapport */
|
/* (I) Out : flux de sortie du rapport */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_Index_Check_I( NDT_Root *Root, NDT_Index_Id, int *, int *, FILE *);
|
NDD_DLL_API NDT_Status ND_Index_Check_I( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
|
||||||
NDD_DLL_API NDT_Status ND_Index_Check_C( NDT_Root *Root, NDT_Index_Id, int *, int *, FILE *);
|
NDD_DLL_API NDT_Status ND_Index_Check_C( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -683,8 +1021,8 @@ NDD_DLL_API NDT_Status ND_Index_Check_C( NDT_Root *Root, NDT_Index_Id, int *,
|
|||||||
/* (I) Root: pointeur sur la racine de la structure de données */
|
/* (I) Root: pointeur sur la racine de la structure de données */
|
||||||
/* (I) Target_Type: type de structure cible */
|
/* (I) Target_Type: type de structure cible */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_Index_Convert_I ( NDT_Root *, NDT_Index_Id Index_Id, NDT_Index_Type);
|
NDD_DLL_API NDT_Status ND_Index_Convert_I ( NDT_Root *, NDT_Index_Id, NDT_Index_Type);
|
||||||
NDD_DLL_API NDT_Status ND_Index_Convert_C ( NDT_Root *, NDT_Index_Id Index_Id, NDT_Index_Type);
|
NDD_DLL_API NDT_Status ND_Index_Convert_C ( NDT_Root *, NDT_Index_Id, NDT_Index_Type);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -708,10 +1046,10 @@ NDD_DLL_API NDT_Status ND_Index_Reorg_C( NDT_Root *, NDT_Index_Id);
|
|||||||
/* (I) Command: Commande à exécuter sur chaque noeud traversé */
|
/* (I) Command: Commande à exécuter sur chaque noeud traversé */
|
||||||
/* (I) Data: pointeur de données utilisateur */
|
/* (I) Data: pointeur de données utilisateur */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_Index_Traverse_VI( NDT_Root *, NDT_Index_Id, NDT_Command, va_list);
|
NDD_DLL_API NDT_Status ND_Index_Traverse_VI( NDT_Root *, NDT_Index_Id, NDT_Command, va_list *);
|
||||||
NDD_DLL_API NDT_Status ND_Index_Traverse_VC( NDT_Root *, NDT_Index_Id, NDT_Command, va_list);
|
NDD_DLL_API NDT_Status ND_Index_Traverse_VC( NDT_Root *, NDT_Index_Id, NDT_Command, va_list *);
|
||||||
NDD_DLL_API NDT_Status ND_Index_Traverse_I( NDT_Root *, NDT_Index_Id, NDT_Command, ...);
|
NDD_DLL_API NDT_Status ND_Index_Traverse_I( NDT_Root *, NDT_Index_Id, NDT_Command, ...);
|
||||||
NDD_DLL_API NDT_Status ND_Index_Traverse_C( NDT_Root *, NDT_Index_Id, NDT_Command, ...);
|
NDD_DLL_API NDT_Status ND_Index_Traverse_C( NDT_Root *, NDT_Index_Id, NDT_Command, ...);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -734,8 +1072,8 @@ NDD_DLL_API NDT_Status ND_Index_Info_Print_C( FILE *, NDT_Root *, NDT_Index_I
|
|||||||
/* (I) Root: pointeur sur la racine de la structure de données */
|
/* (I) Root: pointeur sur la racine de la structure de données */
|
||||||
/* (I) Value: pointeur sur la valeur à ajouter */
|
/* (I) Value: pointeur sur la valeur à ajouter */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_Index_Value_Add_I( NDT_Root *Root, NDT_Index_Id, void *Value);
|
NDD_DLL_API NDT_Status ND_Index_Value_Add_I( NDT_Root *, NDT_Index_Id, void *);
|
||||||
NDD_DLL_API NDT_Status ND_Index_Value_Add_C( NDT_Root *Root, NDT_Index_Id, void *Value);
|
NDD_DLL_API NDT_Status ND_Index_Value_Add_C( NDT_Root *, NDT_Index_Id, void *);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -746,8 +1084,8 @@ NDD_DLL_API NDT_Status ND_Index_Value_Add_C( NDT_Root *Root, NDT_Index_Id, voi
|
|||||||
/* (I) Reference_Value : pointeur sur la valeur de référence */
|
/* (I) Reference_Value : pointeur sur la valeur de référence */
|
||||||
/* (I) Removed_Value : adresse d'un pointeur sur la valeur supprimée */
|
/* (I) Removed_Value : adresse d'un pointeur sur la valeur supprimée */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_Index_Value_Remove_I( NDT_Root *Root, NDT_Index_Id, void *Value);
|
NDD_DLL_API NDT_Status ND_Index_Value_Remove_I( NDT_Root *, NDT_Index_Id, void *);
|
||||||
NDD_DLL_API NDT_Status ND_Index_Value_Remove_C( NDT_Root *Root, NDT_Index_Id, void *Value);
|
NDD_DLL_API NDT_Status ND_Index_Value_Remove_C( NDT_Root *, NDT_Index_Id, void *);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -757,9 +1095,9 @@ NDD_DLL_API NDT_Status ND_Index_Value_Remove_C( NDT_Root *Root, NDT_Index_Id,
|
|||||||
/* (I) Root: pointeur sur la racine de la structure de données */
|
/* (I) Root: pointeur sur la racine de la structure de données */
|
||||||
/* (I) Out : flux de sortie */
|
/* (I) Out : flux de sortie */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_Index_Value_Print_VI( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, va_list);
|
NDD_DLL_API NDT_Status ND_Index_Value_Print_VI( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, va_list *);
|
||||||
NDD_DLL_API NDT_Status ND_Index_Value_Print_I( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...);
|
NDD_DLL_API NDT_Status ND_Index_Value_Print_I( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...);
|
||||||
NDD_DLL_API NDT_Status ND_Index_Value_Print_C( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...);
|
NDD_DLL_API NDT_Status ND_Index_Value_Print_C( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -769,8 +1107,8 @@ NDD_DLL_API NDT_Status ND_Index_Value_Print_C( FILE *, NDT_Root *, NDT_Index_
|
|||||||
/* (I) Root: pointeur sur la racine de la structure de données */
|
/* (I) Root: pointeur sur la racine de la structure de données */
|
||||||
/* (I) Node: pointeur sur le noeud à ajouter */
|
/* (I) Node: pointeur sur le noeud à ajouter */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_Index_Node_Add_I( NDT_Root * Root, NDT_Index_Id Index_Id, NDT_Node * Node );
|
NDD_DLL_API NDT_Status ND_Index_Node_Add_I( NDT_Root *, NDT_Index_Id, NDT_Node *);
|
||||||
NDD_DLL_API NDT_Status ND_Index_Node_Add_C( NDT_Root * Root, NDT_Index_Id Index_Id, NDT_Node * Node );
|
NDD_DLL_API NDT_Status ND_Index_Node_Add_C( NDT_Root *, NDT_Index_Id, NDT_Node *);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -779,8 +1117,8 @@ NDD_DLL_API NDT_Status ND_Index_Node_Add_C( NDT_Root * Root, NDT_Index_Id Inde
|
|||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* (I) Node: pointeur sur le noeud à supprimer de la structure de données */
|
/* (I) Node: pointeur sur le noeud à supprimer de la structure de données */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_Index_Node_Remove_I( NDT_Node * Node);
|
NDD_DLL_API NDT_Status ND_Index_Node_Remove_I( NDT_Node *);
|
||||||
NDD_DLL_API NDT_Status ND_Index_Node_Remove_C( NDT_Node * Node);
|
NDD_DLL_API NDT_Status ND_Index_Node_Remove_C( NDT_Node *);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -836,10 +1174,10 @@ NDD_DLL_API NDT_Status ND_Index_Node_Previous_Get_C( NDT_Node **, NDT_Node *)
|
|||||||
/* (I) Value : pointeur sur la valeur à rechercher */
|
/* (I) Value : pointeur sur la valeur à rechercher */
|
||||||
/* (I) Data : pointeur de données */
|
/* (I) Data : pointeur de données */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_Index_Node_Find_VI( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, va_list);
|
NDD_DLL_API NDT_Status ND_Index_Node_Find_VI( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, va_list *);
|
||||||
NDD_DLL_API NDT_Status ND_Index_Node_Find_VC( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, va_list);
|
NDD_DLL_API NDT_Status ND_Index_Node_Find_VC( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, va_list *);
|
||||||
NDD_DLL_API NDT_Status ND_Index_Node_Find_I( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, ...);
|
NDD_DLL_API NDT_Status ND_Index_Node_Find_I( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, ...);
|
||||||
NDD_DLL_API NDT_Status ND_Index_Node_Find_C( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, ...);
|
NDD_DLL_API NDT_Status ND_Index_Node_Find_C( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, ...);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -882,10 +1220,10 @@ NDD_DLL_API NDT_Status ND_Value_Free_C( NDT_Root *, void *);
|
|||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* (I) Function : nom de la fonction manager à exécuter */
|
/* (I) Function : nom de la fonction manager à exécuter */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_Manager_Exec_VI( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list);
|
NDD_DLL_API NDT_Status ND_Manager_Exec_VI( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
||||||
NDD_DLL_API NDT_Status ND_Manager_Exec_VC( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list);
|
NDD_DLL_API NDT_Status ND_Manager_Exec_VC( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
||||||
NDD_DLL_API NDT_Status ND_Manager_Exec_I( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, ...);
|
NDD_DLL_API NDT_Status ND_Manager_Exec_I( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, ...);
|
||||||
NDD_DLL_API NDT_Status ND_Manager_Exec_C( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, ...);
|
NDD_DLL_API NDT_Status ND_Manager_Exec_C( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, ...);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -897,8 +1235,8 @@ NDD_DLL_API NDT_Status ND_Manager_Exec_C( NDT_Root *, NDT_Index_Id, NDT_Node
|
|||||||
/* (I) Size : taille de la zone à allouer */
|
/* (I) Size : taille de la zone à allouer */
|
||||||
/* (I) Data : pointeur de données utiles à l'allocateur */
|
/* (I) Data : pointeur de données utiles à l'allocateur */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_Allocator_Exec_I( NDT_Allocator *, void **, size_t, void *);
|
NDD_DLL_API NDT_Status ND_Allocator_Exec_I( void **, size_t, NDT_Allocator_Name, NDT_Allocator *, void *);
|
||||||
NDD_DLL_API NDT_Status ND_Allocator_Exec_C( NDT_Allocator *, void **, size_t, void *);
|
NDD_DLL_API NDT_Status ND_Allocator_Exec_C( void **, size_t, NDT_Allocator_Name, NDT_Allocator *, void *);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -906,16 +1244,17 @@ NDD_DLL_API NDT_Status ND_Allocator_Exec_C( NDT_Allocator *, void **, size_t,
|
|||||||
/* Exécution d'une fonction de désallocation le dont nom est passé en paramètre */
|
/* Exécution d'une fonction de désallocation le dont nom est passé en paramètre */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* (I) Function : nom de la fonction à exécuter */
|
/* (I) Function : nom de la fonction à exécuter */
|
||||||
|
/* (I) Function : nom de la fonction à exécuter */
|
||||||
/* (I) Ptr : adresse de la zone à désallouer */
|
/* (I) Ptr : adresse de la zone à désallouer */
|
||||||
/* (I) Data : pointeur de données utiles au désallocateur */
|
/* (I) Data : pointeur de données utiles au désallocateur */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDD_DLL_API NDT_Status ND_Desallocator_Exec_I( NDT_Desallocator *, void *, void *);
|
NDD_DLL_API NDT_Status ND_Desallocator_Exec_I( void *, NDT_Desallocator_Name, NDT_Desallocator *, void *);
|
||||||
NDD_DLL_API NDT_Status ND_Desallocator_Exec_C( NDT_Desallocator *, void *, void *);
|
NDD_DLL_API NDT_Status ND_Desallocator_Exec_C( void *, NDT_Desallocator_Name, NDT_Desallocator *, void *);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
# ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
30
lib/Makefile
30
lib/Makefile
@@ -1,18 +1,22 @@
|
|||||||
|
SRC := libnode.c
|
||||||
|
TARGETS := libnode.a libnode.so
|
||||||
|
FILE_LIB := libnode.a libnode.so
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
include ../Makefile.var
|
||||||
|
include ../Makefile.rule
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DEP += libnode.h ../include/node.h Makefile
|
||||||
|
INCLUDE += -I . -I ../include
|
||||||
|
|
||||||
ifdef _LIBVER_SUPPORT
|
ifdef _LIBVER_SUPPORT
|
||||||
INCLUDE_VER = ../../libver/ver.h
|
DEP += ../../libver/ver.h
|
||||||
LIB_VER = -I ../../libver
|
INCLUDE += -I ../../libver/lib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: libnode.a libnode.so
|
|
||||||
|
|
||||||
libnode.o: libnode.c node.h libnode.h $(INCLUDE_VER) Makefile
|
|
||||||
gcc -c -g -o libnode.o -I . $(LIB_VER) libnode.c
|
|
||||||
|
|
||||||
libnode.a: libnode.o
|
libnode.o : libnode.c $(DEP)
|
||||||
ar -r libnode.a libnode.o
|
|
||||||
|
|
||||||
libnode.so: libnode.o
|
|
||||||
ld -shared -o libnode.so libnode.o
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f libnode.o libnode.a libnode.so
|
|
||||||
|
|||||||
2863
lib/libnode.c
2863
lib/libnode.c
File diff suppressed because it is too large
Load Diff
@@ -126,7 +126,7 @@ SOURCE=.\libnode.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\node.h
|
SOURCE=..\include\node.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Group "Resource Files"
|
# Begin Group "Resource Files"
|
||||||
|
|||||||
181
lib/libnode.h
181
lib/libnode.h
@@ -1,10 +1,10 @@
|
|||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
/* $RCSfile: libnode.h,v $ */
|
/* $RCSfile: libnode.h,v $ */
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
/* $Revision: 2.4 $ */
|
/* $Revision: 2.10 $ */
|
||||||
/* $Name: $ */
|
/* $Name: $ */
|
||||||
/* $Date: 2002/07/29 14:53:51 $ */
|
/* $Date: 2010/06/06 21:26:31 $ */
|
||||||
/* $Author: agibert $ */
|
/* $Author: agibert $ */
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
/* GNU Lesser General Public License for more details. */
|
/* GNU Lesser General Public License for more details. */
|
||||||
/* */
|
/* */
|
||||||
/* You should have received a copy of the GNU Lesser General Public License */
|
/* You should have received a copy of the GNU Lesser General Public License */
|
||||||
/* along with Foobar; if not, write to the Free Software */
|
/* along with LibNode; if not, write to the Free Software */
|
||||||
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@@ -29,11 +29,20 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
//#include <dlfcn.h>
|
#include <setjmp.h>
|
||||||
|
#include <dlfcn.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Utilisation des API de la LIBNODE sans vérification des arguments */
|
||||||
|
|
||||||
|
#define ND_MODE 1
|
||||||
|
|
||||||
#include <node.h>
|
#include <node.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -43,39 +52,69 @@
|
|||||||
|
|
||||||
|
|
||||||
#ifdef __linux
|
#ifdef __linux
|
||||||
|
|
||||||
# define NDD_PRINTF_PTR_PREFIX ""
|
# define NDD_PRINTF_PTR_PREFIX ""
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
# define NDD_PRINTF_PTR_PREFIX "0x"
|
# define NDD_PRINTF_PTR_PREFIX "0x"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define NDD_HUGE_LONG (long)0xFFFFFFL
|
#define NDD_HUGE_LONG ( long) 0xFFFFFFL
|
||||||
|
|
||||||
/* Sortie standard des messages d'erreur */
|
|
||||||
|
|
||||||
FILE * ND_stderr;
|
|
||||||
|
|
||||||
/* Table des symboles locale */
|
/* Table des symboles locale */
|
||||||
|
|
||||||
struct Symbol {
|
struct NDT_Symbol;
|
||||||
void * Ptr;
|
|
||||||
char * Name;
|
typedef struct NDT_Symbol
|
||||||
struct Symbol * Next;
|
{
|
||||||
} * Symbol_Table = NULL;
|
void *Ptr;
|
||||||
|
char *Name;
|
||||||
|
struct NDT_Symbol *Next;
|
||||||
|
} NDT_Symbol;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* LibNode Global Base Structure */
|
||||||
|
|
||||||
|
typedef struct NDT_Base
|
||||||
|
{
|
||||||
|
int Open_Status;
|
||||||
|
int Debug_Mode;
|
||||||
|
char Err_String[512];
|
||||||
|
FILE *Err_Stream;
|
||||||
|
int Sig_Trapped;
|
||||||
|
#if !defined(_WIN32)
|
||||||
|
sigjmp_buf SigLongJmp_Env;
|
||||||
|
#else
|
||||||
|
jmp_buf SigLongJmp_Env;
|
||||||
|
#endif
|
||||||
|
NDT_Symbol *Symbol_First_Ptr;
|
||||||
|
void *DL_Ptr;
|
||||||
|
NDT_Index_Type OpenStruct_Index_Type[1];
|
||||||
|
NDT_Root *OpenStruct_Ptr;
|
||||||
|
} NDT_Base;
|
||||||
|
|
||||||
|
NDT_Base NDG_Base =
|
||||||
|
{
|
||||||
|
NDD_FALSE,
|
||||||
|
NDD_TRUE,
|
||||||
|
"",
|
||||||
|
(FILE *) -1,
|
||||||
|
0,
|
||||||
|
{0},
|
||||||
|
(NDT_Symbol *) NULL,
|
||||||
|
NULL,
|
||||||
|
{ NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO},
|
||||||
|
(NDT_Root *) NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
NDT_Root * Tmp_Root;
|
|
||||||
|
|
||||||
//extern char * strdup (const char *);
|
|
||||||
//extern int sigrelse (int sig);
|
|
||||||
|
|
||||||
int Sig_Trapped;
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
@@ -88,17 +127,24 @@ int Sig_Trapped;
|
|||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* (I) va_list Arguments : Liste d'arguments contextuels */
|
/* (I) va_list Arguments : Liste d'arguments contextuels */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDT_Status Default_Manager( NDT_Root *, NDT_Index_Id, NDT_Command, va_list);
|
NDT_Status ND_Default_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------------*/
|
||||||
|
/* OpenStruct Manager */
|
||||||
|
/*------------------------------------------------------------------------------*/
|
||||||
|
/* (I) va_list Arguments : Liste d'arguments contextuels */
|
||||||
|
/*------------------------------------------------------------------------------*/
|
||||||
|
NDT_Status ND_OpenStruct_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Redéfinition de la fonction malloc() avec retour de type NDT_Status */
|
/* Redéfinition de la fonction malloc() avec retour de type NDT_Status */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDT_Status ND_Default_Allocator( size_t Size, void **ptr, void *User);
|
NDT_Status ND_Default_Allocator( void **, size_t, void *);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Redéfinition de la fonction free() avec retour de type NDT_Status */
|
/* Redéfinition de la fonction free() avec retour de type NDT_Status */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDT_Status ND_Default_Desallocator( void *, void *);
|
NDT_Status ND_Default_Desallocator( void *, void *);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Création d'un noeud */
|
/* Création d'un noeud */
|
||||||
@@ -106,7 +152,7 @@ NDT_Status ND_Default_Desallocator( void *, void *);
|
|||||||
/* (I) Root : adresse de la racine pour laquelle on crée un noeud */
|
/* (I) Root : adresse de la racine pour laquelle on crée un noeud */
|
||||||
/* (O) New_Node : adresse du pointeur sur le nouveau noeud */
|
/* (O) New_Node : adresse du pointeur sur le nouveau noeud */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDT_Status ND_Node_Alloc (NDT_Root * Root, NDT_Node ** New_Node);
|
NDT_Status ND_Node_Alloc( NDT_Root * Root, NDT_Node ** New_Node);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Destruction d'un noeud */
|
/* Destruction d'un noeud */
|
||||||
@@ -114,7 +160,7 @@ NDT_Status ND_Node_Alloc (NDT_Root * Root, NDT_Node ** New_Node);
|
|||||||
/* (I) Root : adresse de la racine dans laquelle on détruit un noeud */
|
/* (I) Root : adresse de la racine dans laquelle on détruit un noeud */
|
||||||
/* (I) Node : pointeur sur le noeud à détruire */
|
/* (I) Node : pointeur sur le noeud à détruire */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDT_Status ND_Node_Free (NDT_Root * Root, NDT_Node * Node);
|
NDT_Status ND_Node_Free( NDT_Root *, NDT_Node *);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Création d'une nouvelle structure de données */
|
/* Création d'une nouvelle structure de données */
|
||||||
@@ -144,7 +190,7 @@ NDT_Status ND_Node_Root_Alloc( NDT_Root **, NDT_Index_Nb, NDT_Index_Type[], ch
|
|||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* (I) Root : pointeur sur la racine à détruire */
|
/* (I) Root : pointeur sur la racine à détruire */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDT_Status ND_Node_Root_Free (NDT_Root * Root);
|
NDT_Status ND_Node_Root_Free( NDT_Root *);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Ajout d'un noeud à une liste chaînée */
|
/* Ajout d'un noeud à une liste chaînée */
|
||||||
@@ -152,7 +198,7 @@ NDT_Status ND_Node_Root_Free (NDT_Root * Root);
|
|||||||
/* (I) Root : pointeur sur la racine de la liste */
|
/* (I) Root : pointeur sur la racine de la liste */
|
||||||
/* (I) New_Node : pointeur sur le noeud à ajouter */
|
/* (I) New_Node : pointeur sur le noeud à ajouter */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDT_Status ND_List_Node_Add (NDT_Root *, NDT_Index_Id, NDT_Node *);
|
NDT_Status ND_List_Node_Add( NDT_Root *, NDT_Index_Id, NDT_Node *);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Ajout d'une nouvelle valeur à une liste */
|
/* Ajout d'une nouvelle valeur à une liste */
|
||||||
@@ -160,7 +206,7 @@ NDT_Status ND_List_Node_Add (NDT_Root *, NDT_Index_Id, NDT_Node *);
|
|||||||
/* (I) Root : pointeur sur la racine de la liste */
|
/* (I) Root : pointeur sur la racine de la liste */
|
||||||
/* (I) Value : pointeur sur la valeur à ajouter */
|
/* (I) Value : pointeur sur la valeur à ajouter */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDT_Status ND_List_Value_Add (NDT_Root *, NDT_Index_Id, void *);
|
NDT_Status ND_List_Value_Add( NDT_Root *, NDT_Index_Id, void *);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Ajout d'un noeud à un arbre binaire */
|
/* Ajout d'un noeud à un arbre binaire */
|
||||||
@@ -168,31 +214,31 @@ NDT_Status ND_List_Value_Add (NDT_Root *, NDT_Index_Id, void *);
|
|||||||
/* (I) Root : pointeur sur la racine de l'arbre */
|
/* (I) Root : pointeur sur la racine de l'arbre */
|
||||||
/* (I) Value : pointeur sur la valeur à ajouter */
|
/* (I) Value : pointeur sur la valeur à ajouter */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDT_Status ND_Tree_Value_Add (NDT_Root *, NDT_Index_Id, void *);
|
NDT_Status ND_Tree_Value_Add( NDT_Root *, NDT_Index_Id, void *);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Supprime le noeud d'une liste */
|
/* Supprime le noeud d'une liste */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* (I) Node : pointeur sur le noeud à supprimer */
|
/* (I) Node : pointeur sur le noeud à supprimer */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDT_Status ND_List_Node_Remove (NDT_Node *);
|
NDT_Status ND_List_Node_Remove( NDT_Node *);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Conversion d'une structure en liste chaînée */
|
/* Conversion d'une structure en liste chaînée */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* (I) Root : pointeur sur la racine du la structure à convertir */
|
/* (I) Root : pointeur sur la racine du la structure à convertir */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDT_Status ND_List_Make (NDT_Root *, NDT_Index_Id);
|
NDT_Status ND_List_Make( NDT_Root *, NDT_Index_Id);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Recherche une valeur dans une liste et retourne le noeud correspondant */
|
/* Recherche une valeur dans une liste et retourne le noeud correspondant */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDT_Node * ND_List_Node_Find (NDT_Root *, NDT_Index_Id, void *, va_list);
|
NDT_Node *ND_List_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list *);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Recherche un noeud dans un arbre et retourne le pointeur sur le noeud */
|
/* Recherche un noeud dans un arbre et retourne le pointeur sur le noeud */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDT_Node *ND_Tree_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list);
|
NDT_Node *ND_Tree_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list *);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Conversion d'une structure en arbre binaire */
|
/* Conversion d'une structure en arbre binaire */
|
||||||
@@ -200,28 +246,28 @@ NDT_Node *ND_Tree_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list);
|
|||||||
/* (I) Root : pointeur sur la racine du la structure à convertir */
|
/* (I) Root : pointeur sur la racine du la structure à convertir */
|
||||||
/* (I) Type : type du futur arbre */
|
/* (I) Type : type du futur arbre */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDT_Status ND_Tree_Make (NDT_Root *, NDT_Index_Id);
|
NDT_Status ND_Tree_Make( NDT_Root *, NDT_Index_Id);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Equilibrage d'un arbre */
|
/* Equilibrage d'un arbre */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* (I) Root : pointeur sur la racine de l'arbre */
|
/* (I) Root : pointeur sur la racine de l'arbre */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDT_Status ND_Tree_Equalize (NDT_Root *, NDT_Index_Id);
|
NDT_Status ND_Tree_Equalize( NDT_Root *, NDT_Index_Id);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Retourne la profondeur de la plus grande branche à partir d'un noeud */
|
/* Retourne la profondeur de la plus grande branche à partir d'un noeud */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* (I) Node : pointeur sur le noeud */
|
/* (I) Node : pointeur sur le noeud */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
long ND_Tree_MaxDepth_Get (NDT_Node *Node);
|
long ND_Tree_MaxDepth_Get( NDT_Node *);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Retourne la profondeur de la plus petite branche à partir d'un noeud */
|
/* Retourne la profondeur de la plus petite branche à partir d'un noeud */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* (I) Node : pointeur sur le noeud */
|
/* (I) Node : pointeur sur le noeud */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
long ND_Tree_MinDepth_Get (NDT_Node *Node);
|
long ND_Tree_MinDepth_Get( NDT_Node *);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Ajout d'un noeud à un arbre binaire */
|
/* Ajout d'un noeud à un arbre binaire */
|
||||||
@@ -229,7 +275,7 @@ long ND_Tree_MinDepth_Get (NDT_Node *Node);
|
|||||||
/* (I) Root : pointeur sur la racine de l'arbre */
|
/* (I) Root : pointeur sur la racine de l'arbre */
|
||||||
/* (I) Node : pointeur sur le noeud à ajouter */
|
/* (I) Node : pointeur sur le noeud à ajouter */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDT_Status ND_Tree_Node_Add (NDT_Root *, NDT_Index_Id, NDT_Node *);
|
NDT_Status ND_Tree_Node_Add( NDT_Root *, NDT_Index_Id, NDT_Node *);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Ajoute tous les noeud d'une liste à un arbre */
|
/* Ajoute tous les noeud d'une liste à un arbre */
|
||||||
@@ -237,60 +283,65 @@ NDT_Status ND_Tree_Node_Add (NDT_Root *, NDT_Index_Id, NDT_Node *);
|
|||||||
/* (I) Tree_Root : pointeur sur la racine de l'arbre */
|
/* (I) Tree_Root : pointeur sur la racine de l'arbre */
|
||||||
/* (I) List_Root : pointeur sur la racine de la liste */
|
/* (I) List_Root : pointeur sur la racine de la liste */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDT_Status ND_Tree_List_Add (NDT_Root *, NDT_Index_Id, NDT_Root *, NDT_Index_Id);
|
NDT_Status ND_Tree_List_Add( NDT_Root *, NDT_Index_Id, NDT_Root *, NDT_Index_Id);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Fonction de comparaison de noeuds (pour le quick sort) */
|
/* Fonction de comparaison de noeuds (pour le quick sort) */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
int ND_Node_Compare (void ** Node1, void ** Node2);
|
int ND_Node_Compare( void **, void **);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Ordonne une liste chaînée selon l'algorithme du tri à bulle */
|
/* Ordonne une liste chaînée selon l'algorithme du tri à bulle */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* (I) Root : pointeur sur la racine de la liste à trier */
|
/* (I) Root : pointeur sur la racine de la liste à trier */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
NDT_Status ND_List_Sort (NDT_Root *, NDT_Index_Id);
|
NDT_Status ND_List_Sort( NDT_Root *, NDT_Index_Id);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/* Fonctions et procédures privées de la librairie (bas niveau) */
|
/* PRIVATE FUNCTIONS */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
void ND_List_Check (NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
|
void ND_List_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
|
||||||
|
|
||||||
void ND_List_Link_Check (NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
|
void ND_List_Link_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
|
||||||
|
|
||||||
void ND_Value_Check (NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
|
void ND_Value_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
|
||||||
|
|
||||||
void ND_Tree_Check (NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
|
void ND_Tree_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
|
||||||
|
|
||||||
void ND_Tree_Link_Check (NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
|
void ND_Tree_Link_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
|
||||||
|
|
||||||
NDT_Status ND_List_Recursive_Make (NDT_Node *, NDT_Root *, NDT_Index_Id);
|
NDT_Status ND_List_Recursive_Make( NDT_Node *, NDT_Root *, NDT_Index_Id);
|
||||||
|
|
||||||
NDT_Node * ND_Tree_Recursive_Make (long, long, NDT_Node *);
|
NDT_Node *ND_Tree_Recursive_Make( long, long, NDT_Node *);
|
||||||
|
|
||||||
void ND_Tree_Node_Recursive_Add( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Node **, long , NDT_Node *);
|
void ND_Tree_Node_Recursive_Add( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Node **, long , NDT_Node *);
|
||||||
|
|
||||||
NDT_Node * ND_Tree_Node_First_Recursive_Get (NDT_Node * Node);
|
NDT_Node *ND_Tree_Node_First_Recursive_Get( NDT_Node *);
|
||||||
|
|
||||||
NDT_Node * ND_Tree_Node_Last_Recursive_Get (NDT_Node * Node);
|
NDT_Node *ND_Tree_Node_Last_Recursive_Get( NDT_Node *);
|
||||||
|
|
||||||
NDT_Node * ND_Tree_Node_Recursive_Find (NDT_Node * Node, void * Value, va_list);
|
NDT_Node *ND_Tree_Node_Recursive_Find( NDT_Node *, void *, va_list *);
|
||||||
|
|
||||||
NDT_Node * ND_Tree_Parent_Next_Recursive_Get (NDT_Node * Node);
|
NDT_Node *ND_Tree_Parent_Next_Recursive_Get( NDT_Node *);
|
||||||
|
|
||||||
NDT_Node * ND_Tree_Parent_Previous_Recursive_Get (NDT_Node * Node);
|
NDT_Node *ND_Tree_Parent_Previous_Recursive_Get( NDT_Node *);
|
||||||
|
|
||||||
void ND_Tree_Recursive_Print (NDT_Node * Node, long Depth, FILE *);
|
void ND_Tree_Recursive_Print( NDT_Node *, long, FILE *);
|
||||||
|
|
||||||
void ND_Tree_Link_Recursive_Check (NDT_Node * Node, int *, int *, FILE *);
|
void ND_Tree_Link_Recursive_Check( NDT_Node *, int *, int *, FILE *);
|
||||||
|
|
||||||
void * ND_Symbol_Find (const char *);
|
NDT_Status ND_Symbol_Find( void **, const char *);
|
||||||
|
|
||||||
void ND_Error_Print (void);
|
void ND_Error_Print( void);
|
||||||
|
|
||||||
void ND_Signal_Trap (int);
|
void ND_Signal_Trap( int);
|
||||||
|
|
||||||
NDT_Status ND_Address_Check (void * Address);
|
NDT_Status ND_Address_Check( void *);
|
||||||
|
|||||||
80
libnode.spec
Normal file
80
libnode.spec
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
Name: libnode
|
||||||
|
Version: 2.2.0
|
||||||
|
|
||||||
|
%define release_nb 1
|
||||||
|
|
||||||
|
Release: %{release_nb}rx3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%define libnode_name %{name}-%{version}-%{release_nb}
|
||||||
|
%define source %{libnode_name}.src.tgz
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Summary: Manages generic list and/or tree node structures
|
||||||
|
Copyright: GPL/LGPL
|
||||||
|
Group: Application/Utilitaires
|
||||||
|
Distribution: Rx3 OpenSource
|
||||||
|
Vendor: Rx3
|
||||||
|
Packager: Arnaud G. Gibert <arnaud@rx3.net>
|
||||||
|
|
||||||
|
Source: ftp://ftp.rx3.org/pub/arc/dvp/%{source}
|
||||||
|
Url: http://www.rx3.org/dvp/?dvp=libnode
|
||||||
|
BuildRoot: %{_tmppath}/%{libnode_name}-buildroot
|
||||||
|
AutoReqProv: no
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%description
|
||||||
|
Manages generic list and/or tree node structures.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%files
|
||||||
|
/usr
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%build
|
||||||
|
rm -rf %{libnode_name}
|
||||||
|
tar -xzvvf /usr/src/RPM/SOURCES/%{source}
|
||||||
|
cd %{libnode_name}
|
||||||
|
make clean
|
||||||
|
make all
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%install
|
||||||
|
cd %{libnode_name}
|
||||||
|
make install ROOT=$RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%clean
|
||||||
|
rm -rf %{libnode_name}
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Sun Jun 6 2010 Arnaud G. Gibert <arnaud@rx3.net> 2.2.0-1rx3
|
||||||
|
- Update to 2.2.0 release,
|
||||||
|
- Update Source and URL entry.
|
||||||
|
|
||||||
|
* Mon Jan 24 2005 Arnaud G. Gibert <arnaud@rx3.net> 2.1.0-1rx3
|
||||||
|
- Update to 2.1.0 release,
|
||||||
|
- Now use "rx3" as release suffix,
|
||||||
|
- Fix copyright entry.
|
||||||
|
|
||||||
|
* Wed Jan 19 2005 Arnaud G. Gibert <arnaud@rx3.net> 2.0.7-1
|
||||||
|
- Update to 2.0.7 release.
|
||||||
|
|
||||||
|
* Tue Aug 24 2004 Arnaud G. Gibert <arnaud@rx3.net> 2.0.6-1
|
||||||
|
- Update to 2.0.6 release.
|
||||||
|
|
||||||
|
* Tue Jul 15 2003 Arnaud G. Gibert <arnaud@rx3.net> - 2.0.5-1
|
||||||
|
- Add release in libnode dir name support.
|
||||||
|
|
||||||
|
* Tue Jul 15 2003 Marc Regimbeau <marc.regimbeau@flomaco.net> - 2.0.4-2
|
||||||
|
- Initial release of this spec file.
|
||||||
@@ -1,17 +1,54 @@
|
|||||||
|
SRC := ndbench.c
|
||||||
|
TARGETS := ndbench ndbench-c ndbench-static ndbench-static-c
|
||||||
|
FILE_BIN := ndbench ndbench-c ndbench-static ndbench-static-c
|
||||||
|
FILE_LIB := *.ndb
|
||||||
|
FILE_DOC := ndbench.xls
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
include ../Makefile.var
|
||||||
|
include ../Makefile.rule
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DEP_STATIC += ../lib/libnode.a
|
||||||
|
DEP_DYNAMIC += ../lib/libnode.so
|
||||||
|
INCLUDE += -I . -I ../include
|
||||||
|
LIBDIR += -L . -L ../lib
|
||||||
|
LIB_STATIC += ../lib/libnode.a -ldl
|
||||||
|
LIB_DYNAMIC += -lnode -ldl
|
||||||
|
CFLAGS += -rdynamic
|
||||||
|
|
||||||
ifdef _LIBVER_SUPPORT
|
ifdef _LIBVER_SUPPORT
|
||||||
DEP_VER_STATIC = ../../libver/ver.h ../../libver/libver.a
|
DEP_STATIC += ../../libver/ver.h ../../libver/libver.a
|
||||||
DEP_VER_DYNAMIC = ../../libver/ver.h ../../libver/libver.so
|
DEP_DYNAMIC += ../../libver/ver.h ../../libver/libver.so
|
||||||
LIB_VER_STATIC = -I ../../libver ../../libver/libver.a
|
INCLUDE += -I ../../libver/lib
|
||||||
LIB_VER_DYNAMIC = -I ../../libver -L ../../libver -lver
|
LIBDIR += -L ../../libver/lib
|
||||||
|
|
||||||
|
ifeq ($(OSTYPE),linux-gnu)
|
||||||
|
LIB_STATIC += ../../libver/lib/libver.a
|
||||||
|
LIB_DYNAMIC += -lver
|
||||||
|
else
|
||||||
|
LIB_STATIC += ../../libver/lib/libver.a
|
||||||
|
LIB_DYNAMIC += -lver
|
||||||
|
endif
|
||||||
|
|
||||||
|
CFLAGS += -D_LIBVER_SUPPORT
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: ndbench ndbench-static
|
ND_CHECK_FLAGS = -DND_MODE=0
|
||||||
|
ND_NOCHECK_FLAGS = -DND_MODE=1
|
||||||
|
|
||||||
ndbench-static: ndbench.c $(DEP_VER_STATIC) ../lib/node.h ../lib/libnode.a Makefile
|
|
||||||
gcc -g -o ndbench-static -I ../lib ndbench.c -ldl $(LIB_VER_STATIC) ../lib/libnode.a
|
|
||||||
|
|
||||||
ndbench: ndbench.c $(DEP_VER_DYNAMIC) ../lib/node.h ../lib/libnode.so Makefile
|
|
||||||
gcc -g -o ndbench -ldl $(LIB_VER_DYNAMIC) -I ../lib -L ../lib -lnode ndbench.c
|
|
||||||
|
|
||||||
clean:
|
ndbench: ndbench.c $(DEP_DYNAMIC)
|
||||||
rm -f ndbench ndbench-static
|
$(CC) -o $@ $(CFLAGS) $(ND_NOCHECK_FLAGS) $(INCLUDE) $(LIBDIR) $(LIB_DYNAMIC) $<
|
||||||
|
|
||||||
|
ndbench-c: ndbench.c $(DEP_DYNAMIC)
|
||||||
|
$(CC) -o $@ $(CFLAGS) $(ND_CHECK_FLAGS) $(INCLUDE) $(LIBDIR) $(LIB_DYNAMIC) $<
|
||||||
|
|
||||||
|
ndbench-static: ndbench.c $(DEP_STATIC)
|
||||||
|
$(CC) -o $@ $(CFLAGS) $(ND_NOCHECK_FLAGS) $(INCLUDE) $< $(LIB_STATIC)
|
||||||
|
|
||||||
|
ndbench-static-c: ndbench.c $(DEP_STATIC)
|
||||||
|
$(CC) -o $@ $(CFLAGS) $(ND_CHECK_FLAGS) $(INCLUDE) $< $(LIB_STATIC)
|
||||||
|
|||||||
991
util/ndbench.c
991
util/ndbench.c
File diff suppressed because it is too large
Load Diff
10
util/test-10-s.ndb
Normal file
10
util/test-10-s.ndb
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
Lib_Open 0
|
||||||
|
DS_Open 1
|
||||||
|
Index_List_Open 0-0
|
||||||
|
DS_Value_Add 1-10 0
|
||||||
|
DS_Value_Find 1-10
|
||||||
|
Index_List_To_Tree 0-0
|
||||||
|
DS_Value_Find 1-10
|
||||||
|
DS_Check
|
||||||
|
DS_Close
|
||||||
|
Lib_Close
|
||||||
10
util/test-10.ndb
Normal file
10
util/test-10.ndb
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
Lib_Open 0
|
||||||
|
DS_Open 0
|
||||||
|
Index_List_Open 0-0
|
||||||
|
DS_Value_Add 1-10 0
|
||||||
|
DS_Value_Find 1-10
|
||||||
|
Index_List_To_Tree 0-0
|
||||||
|
DS_Value_Find 1-10
|
||||||
|
DS_Check
|
||||||
|
DS_Close
|
||||||
|
Lib_Close
|
||||||
10
util/test-100K-s.ndb
Normal file
10
util/test-100K-s.ndb
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
Lib_Open 0
|
||||||
|
DS_Open 1
|
||||||
|
Index_List_Open 0-0
|
||||||
|
DS_Value_Add 1-100000 0
|
||||||
|
DS_Value_Find 49900-50100
|
||||||
|
Index_List_To_Tree 0-0
|
||||||
|
DS_Value_Find 1-100000
|
||||||
|
DS_Check
|
||||||
|
DS_Close
|
||||||
|
Lib_Close
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
DS_Open
|
Lib_Open 0
|
||||||
|
DS_Open 0
|
||||||
Index_List_Open 0-0
|
Index_List_Open 0-0
|
||||||
DS_Value_Add 1-100000 0
|
DS_Value_Add 1-100000 0
|
||||||
DS_Value_Find 49900-50100
|
DS_Value_Find 49900-50100
|
||||||
@@ -6,3 +7,4 @@ Index_List_To_Tree 0-0
|
|||||||
DS_Value_Find 1-100000
|
DS_Value_Find 1-100000
|
||||||
DS_Check
|
DS_Check
|
||||||
DS_Close
|
DS_Close
|
||||||
|
Lib_Close
|
||||||
|
|||||||
10
util/test-10K-s.ndb
Normal file
10
util/test-10K-s.ndb
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
Lib_Open 0
|
||||||
|
DS_Open 1
|
||||||
|
Index_List_Open 0-0
|
||||||
|
DS_Value_Add 1-10000 0
|
||||||
|
DS_Value_Find 4000-6000
|
||||||
|
Index_List_To_Tree 0-0
|
||||||
|
DS_Value_Find 1-10000
|
||||||
|
DS_Check
|
||||||
|
DS_Close
|
||||||
|
Lib_Close
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
DS_Open
|
Lib_Open 0
|
||||||
|
DS_Open 0
|
||||||
Index_List_Open 0-0
|
Index_List_Open 0-0
|
||||||
DS_Value_Add 1-10000 0
|
DS_Value_Add 1-10000 0
|
||||||
DS_Value_Find 4000-6000
|
DS_Value_Find 4000-6000
|
||||||
@@ -6,3 +7,4 @@ Index_List_To_Tree 0-0
|
|||||||
DS_Value_Find 1-10000
|
DS_Value_Find 1-10000
|
||||||
DS_Check
|
DS_Check
|
||||||
DS_Close
|
DS_Close
|
||||||
|
Lib_Close
|
||||||
|
|||||||
10
util/test-1M-s.ndb
Normal file
10
util/test-1M-s.ndb
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
Lib_Open 0
|
||||||
|
DS_Open 1
|
||||||
|
Index_List_Open 0-0
|
||||||
|
DS_Value_Add 1-1000000 0
|
||||||
|
DS_Value_Find 499990-500010
|
||||||
|
Index_List_To_Tree 0-0
|
||||||
|
DS_Value_Find 1-1000000
|
||||||
|
DS_Check
|
||||||
|
DS_Close
|
||||||
|
Lib_Close
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
DS_Open
|
Lib_Open 0
|
||||||
|
DS_Open 0
|
||||||
Index_List_Open 0-0
|
Index_List_Open 0-0
|
||||||
DS_Value_Add 1-1000000 0
|
DS_Value_Add 1-1000000 0
|
||||||
DS_Value_Find 499990-500010
|
DS_Value_Find 499990-500010
|
||||||
@@ -6,3 +7,4 @@ Index_List_To_Tree 0-0
|
|||||||
DS_Value_Find 1-1000000
|
DS_Value_Find 1-1000000
|
||||||
DS_Check
|
DS_Check
|
||||||
DS_Close
|
DS_Close
|
||||||
|
Lib_Close
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
Batch_Run test-error.ndb
|
||||||
|
Batch_Run test-10.ndb
|
||||||
|
Batch_Run test-10-s.ndb
|
||||||
Batch_Run test-10K.ndb
|
Batch_Run test-10K.ndb
|
||||||
|
Batch_Run test-10K-s.ndb
|
||||||
Batch_Run test-100K.ndb
|
Batch_Run test-100K.ndb
|
||||||
|
Batch_Run test-100K-s.ndb
|
||||||
Batch_Run test-1M.ndb
|
Batch_Run test-1M.ndb
|
||||||
|
Batch_Run test-1M-s.ndb
|
||||||
|
|||||||
15
util/test-error.ndb
Normal file
15
util/test-error.ndb
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
DS_Open 0
|
||||||
|
Lib_Open 0
|
||||||
|
DS_Open 0
|
||||||
|
Index_List_Open 0-0
|
||||||
|
DS_Value_Add 1-10 0
|
||||||
|
Lib_Close
|
||||||
|
Lib_Open 1
|
||||||
|
DS_Open 0
|
||||||
|
Index_List_Open 0-0
|
||||||
|
DS_Value_Add 1-10 0
|
||||||
|
Index_Value_Break 0-0 0
|
||||||
|
Index_Value_Break 0-0 1
|
||||||
|
Index_Value_Break 0-0 2
|
||||||
|
DS_Check
|
||||||
|
Lib_Close
|
||||||
Reference in New Issue
Block a user