89 Commits

Author SHA1 Message Date
agibert
6a6ae07870 Fix release suffix problem. 2005-01-24 01:34:01 +00:00
agibert
b477d4b154 LibShMem 2.0.0 and LibDataStr 2.0.0 now supported ! 2005-01-24 01:19:50 +00:00
agibert
334f0cbeb1 Update to 2.1.0-1 release,
Cleanup and minor fixes.
2005-01-24 01:19:39 +00:00
agibert
676814b6cf Fix the release date of the 2.1.0 entry. 2005-01-24 00:50:55 +00:00
agibert
f7c1f8bc5f Add 2.1.0 entry: Symbol lookup support, news allocator/desallocator API and forthcoming news LibShMem support. 2005-01-20 00:26:48 +00:00
agibert
652ab987a4 Add DS_Open arg: symbol lookup support. 2005-01-20 00:07:27 +00:00
agibert
0431691352 Add Batch_Run test-*-s.ndb. 2005-01-20 00:05:52 +00:00
agibert
3ad6e01702 Add new DS_Open arg. 2005-01-20 00:05:05 +00:00
agibert
4bf44a1fff Initial Release. 2005-01-20 00:04:22 +00:00
agibert
aa69e7e7b1 Rename _MSC_VER #ifdef into _WIN32 #ifdef. 2005-01-20 00:00:25 +00:00
agibert
29f7064ed0 Re-enable Win32 support.
Rename _MSCVER #ifdef into _WIN32 #ifdef.
2005-01-19 23:59:41 +00:00
agibert
97d57e391f Add Makefile.var auto version label detection to 2.0.7-1 entry. 2005-01-19 23:40:40 +00:00
agibert
d1778a5431 Add PROG_VERSION_NAME varible auto filling from CVS TAG. 2005-01-19 23:30:05 +00:00
agibert
416ee6de00 Update release to libnode-2.0.7-1. 2005-01-19 23:02:30 +00:00
agibert
8c1000401d Reorder priority...
Remove need of debuging !
2005-01-19 22:37:44 +00:00
agibert
11f4f585b3 Update to 2.0.7 release. 2005-01-19 22:34:04 +00:00
agibert
0990ad102d Add Linux 2.6.x and Windows XP. 2005-01-19 22:32:05 +00:00
agibert
da9d517e9a Add 2.0.7-1 entry: should be the final release of the 2.0 branch and minor bug fixes in ND_*_Info_Print() functions and ND_Library_StdErr_Set alias defines. 2005-01-19 22:29:05 +00:00
agibert
d50da065a6 Minor variable definition fix. 2005-01-19 20:07:51 +00:00
agibert
f8f96b1ec8 Fix CFLAGS definition. Previous prevents to set debug mode... 2005-01-19 16:50:19 +00:00
agibert
b49d497bfb Add unconditionally -rdynamic and -ldl to CFLAGS. 2005-01-11 21:03:53 +00:00
agibert
80665f9931 Add dynamic symbol support to ND_Allocator_Exec_I(), ND_Desallocator_Exec_I(), ND_Manager_Exec_I() and ND_Manager_Exec_VI() functions, in order to add LibShMem support.
Break NDT_Allocator() API !!!
Win32 not compatible... 8^(
Code Cleanup.
2005-01-11 20:57:04 +00:00
agibert
1d9539466d Fix ND_Library_StdErr_Set alias defines. 2005-01-11 16:27:13 +00:00
agibert
3ce278d6e5 Fix printf into fprint in ND_*_Info_Print() functions.\n 2005-01-11 16:17:44 +00:00
agibert
3d91078a5c Add Index_Value_Break andDS_Check commands. 2004-08-24 20:32:47 +00:00
agibert
51482fb475 Add Index_Value_Break and Index_Node_Break commands,
Improve random number generation.
2004-08-24 20:31:28 +00:00
agibert
75cfc21e01 Add ndbech random number improvement in 2.0.6-1 entry. 2004-08-24 20:30:23 +00:00
agibert
5aea056299 Update to 2.0.6 release. 2004-08-23 22:53:02 +00:00
agibert
3f6d118ae2 Code cleanup. 2004-08-23 22:48:37 +00:00
agibert
7c96ad706b Implement signal support for Windows target,
Fix NDT_Root header for HP compilation: Index default number goes from 0 to 1.
2004-08-23 22:47:22 +00:00
agibert
c70c4e5aba Add final updates in libnode (ND_Check for Windows target) and *Break cmd for ndbench. 2004-08-23 22:45:17 +00:00
agibert
7f142acda3 Add re-implementation of address checking in 2.0.6-1 entry.
Fix Micot project spelling.
2004-08-02 21:33:53 +00:00
agibert
64baaa1bc5 Re-implement for unix target, address checking in ND_Address_Check: now use sigaction() and siglingjmp() instead of signal().
Minor code clean-up.
2004-08-02 21:26:03 +00:00
agibert
77330558f0 Add 2.0.6-1 entry,
Add TIMA project reference in 2.0.0-alpha1 entry,
extend -*- separators from 80 to 132 cols.
2004-08-02 00:25:43 +00:00
agibert
4634d49ce9 Fix 2.0.5-1 authorship: add M. Regimbeau ! 2004-08-01 23:49:13 +00:00
agibert
6cae72830f Initial creation. 2004-08-01 23:42:30 +00:00
agibert
61dfd5c682 Add Lib_Open and Lib_Close calls. 2004-08-01 23:41:02 +00:00
agibert
898992430e Add Lib_Open and Lib_Close commands,
Code clean up.
2004-08-01 23:38:52 +00:00
agibert
3c40fadbff Add ND_Library_Open() and ND_Library_Close() calls,
Code clean up.
2004-08-01 23:35:39 +00:00
agibert
126de83bc9 Add a check version of executables: *-c (ND_MODE=1). 2004-08-01 23:34:31 +00:00
agibert
8541d83655 Add OpenStruct tracing support in ND_Library_Open(), ND_Library_Close(), ND_DataStruct_Open() and ND_DataStruct_Close(),
Create NDG_Base global structure variable and move all the sparced global variables into it,
ND_Library_Open() call is now mandatory,
Add library open test in *_C() functions,
Code cleaning,
Fix code indentation.
2004-08-01 23:18:37 +00:00
agibert
2274de2cf2 Fix GPL Header. 2004-06-17 22:28:30 +00:00
agibert
fa40487565 Fix an index bug in ND_Tree_Node_Recursive_Add() and ND_List_Sort(),
Fix GPL Header.
2004-06-17 22:28:04 +00:00
agibert
79b8e412a2 Add Cache Value option entry. 2003-07-27 23:14:10 +00:00
agibert
de448e9237 Add 2.0.5-1 entry. 2003-07-27 23:13:17 +00:00
agibert
f3598b72e5 Add 'make _LIBVER_SUPPORT=1 all' example. 2003-07-27 23:10:55 +00:00
agibert
f2f8facb0e Fix FILE_DOC and FILE_LIB. 2003-07-16 23:46:14 +00:00
agibert
d299d7ce87 Remove node.h file installation. 2003-07-16 23:39:46 +00:00
agibert
05877292fa Initial release. 2003-07-16 23:38:10 +00:00
agibert
ee32700240 Exclude CVS directory from distrib generation. 2003-07-16 23:37:37 +00:00
agibert
7c7ecea547 Add include sub directory. 2003-07-16 23:32:06 +00:00
agibert
3b595554f4 Add %{libnode_name} variable. 2003-07-16 23:18:09 +00:00
agibert
352f592518 Rename $(MKD) into $(MKDIR). 2003-07-16 23:17:07 +00:00
agibert
211babbf5b Remove old comments,
Remove unused install chmod.
2003-07-16 22:57:12 +00:00
agibert
adbf463812 Add distrib rule. 2003-07-16 22:55:51 +00:00
agibert
c4617d7c1f Move "node.h" from lib to include. 2003-07-16 00:20:53 +00:00
agibert
2f56c19c82 move "node.h" into "../include". 2003-07-16 00:19:21 +00:00
agibert
3443aba602 Rename "nddemo0.txt" into "nddemo0.dat". 2003-07-16 00:17:02 +00:00
agibert
655e66ee8b Rename "demo0.*" into "nddemo0.*". 2003-07-16 00:16:07 +00:00
agibert
6410c70eb1 Rename "demo0.*" into "nddemo0.*",
Rename "nddemo0.txt" into "nddemo0.dat".
2003-07-16 00:13:20 +00:00
agibert
69d684f700 Update Makefile to Marc new system. 2003-07-15 23:57:50 +00:00
agibert
a10f0b1cf5 Initial release. 2003-07-15 23:53:15 +00:00
agibert
6ded620c00 Add lib subdir to libver,
Change _LIBVER_SUPPORT by LIBVER_SUPPORT.
2003-01-23 00:25:19 +00:00
agibert
0514715693 Add lib subdir to libver,
Change _LIBVER_SUPPORT by LIBVER_SUPPORT,
Fix unexported local symbols by adding -rdynamic flag in linking.
2003-01-23 00:24:36 +00:00
agibert
c4969560a3 Fix bad VER_INFO_EXPORT module name... 2003-01-23 00:23:08 +00:00
agibert
10a6a983c5 Add lib subdir to libver,
Fix unexported local symbols by adding -rdynamic flag in linking.
2003-01-23 00:21:20 +00:00
agibert
78e9d49e45 Improve libver support. 2003-01-17 17:07:41 +00:00
agibert
27c0b3cda7 Minor print-out improvments. 2003-01-17 17:03:33 +00:00
agibert
a0addad286 Fix LibVer support. 2003-01-17 08:06:57 +00:00
agibert
9bb2b42716 Fix libVer support. 2003-01-17 08:04:24 +00:00
agibert
76e61fb382 Add libnode home page URL and arnaud email address. 2002-08-02 12:34:32 +00:00
agibert
ebfe0b2aec Replace TIMAT_DataStruct by NDT_DataStruct . 2002-08-02 12:30:06 +00:00
agibert
6c7c5cd686 Fix demo0.dsp path. 2002-07-31 13:20:10 +00:00
agibert
490684cdb6 Add 2.0.4-1 entry:
Minor corrections in order to pass valgrind test.
2002-07-29 15:04:09 +00:00
agibert
2b81ff3566 Minor fixes... 2002-07-29 15:02:03 +00:00
agibert
5f92190c59 Add fclose() call at the end of batch_run.
ndbench pass valgrind test!
2002-07-29 14:55:57 +00:00
agibert
2260f97db2 Add and use ND_Index_Clear() private function.
libnode pass valgrind test!
2002-07-29 14:53:50 +00:00
agibert
a512c467f7 Add 2.0.3-1 entry:
Rework the Microsoft Visual Studio project files to generate correctly Debug and Release config,
   Minor fix in libnode.c.
2002-04-09 17:41:44 +00:00
agibert
af664cd6a0 Fix Release config generation,
Now generate ndbench.exe and ndbenchd.exe.
2002-04-09 17:16:54 +00:00
agibert
2966eb9115 Fix Release config generation,
Now generate demo0.exe and demo0d.exe.
2002-04-09 17:11:17 +00:00
agibert
ea02a52457 Fix Release config generation,
Now generate libnode.dll and libnoded.dll libraries.
2002-04-09 17:10:20 +00:00
agibert
882cde0d40 Change index type numeric print value from decimal to hexa in ND_Index_Info_Print_I() API,
Add new cases in ND_Index_Convert_I() handling (List->List:FIFO and List->List:LIFO).
2002-04-09 17:08:17 +00:00
agibert
5b48497b78 Add 2.0.2-2 entry:
Add/Fix license stuff.
2002-03-01 09:48:04 +00:00
agibert
189a24bcb7 Add license stuff. 2002-03-01 09:43:21 +00:00
agibert
5fe2168c92 Replace GPL by LGPL. 2002-03-01 09:35:58 +00:00
agibert
377c39b8de Add GPL header. 2002-02-28 22:00:00 +00:00
agibert
9704a9fb35 Fix LGPL header. 2002-02-28 21:53:47 +00:00
agibert
bb58630b79 Add LGPL header. 2002-02-28 19:02:32 +00:00
agibert
4d87a3c6f9 Initial creation. 2002-02-28 17:56:59 +00:00
36 changed files with 5081 additions and 1777 deletions

355
GNU-FDL.txt Normal file
View File

@@ -0,0 +1,355 @@
GNU Free Documentation License
Version 1.1, March 2000
Copyright (C) 2000 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other
written document "free" in the sense of freedom: to assure everyone
the effective freedom to copy and redistribute it, with or without
modifying it, either commercially or noncommercially. Secondarily,
this License preserves for the author and publisher a way to get
credit for their work, while not being considered responsible for
modifications made by others.
This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
1. APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work that contains a
notice placed by the copyright holder saying it can be distributed
under the terms of this License. The "Document", below, refers to any
such manual or work. Any member of the public is a licensee, and is
addressed as "you".
A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A "Secondary Section" is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall subject
(or to related matters) and contains nothing that could fall directly
within that overall subject. (For example, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any
mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The "Invariant Sections" are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License.
The "Cover Texts" are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License.
A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, whose contents can be viewed and edited directly and
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup has been designed to thwart or discourage
subsequent modification by readers is not Transparent. A copy that is
not "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML designed for human modification. Opaque formats include
PostScript, PDF, proprietary formats that can be read and edited only
by proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML produced by some word processors for output
purposes only.
The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, "Title Page" means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
3. COPYING IN QUANTITY
If you publish printed copies of the Document numbering more than 100,
and the Document's license notice requires Cover Texts, you must enclose
the copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a publicly-accessible computer-network location containing a complete
Transparent copy of the Document, free of added material, which the
general network-using public has access to download anonymously at no
charge using public-standard network protocols. If you use the latter
option, you must take reasonably prudent steps, when you begin
distribution of Opaque copies in quantity, to ensure that this
Transparent copy will remain thus accessible at the stated location
until at least one year after the last time you distribute an Opaque
copy (directly or through your agents or retailers) of that edition to
the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
B. List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has less than five).
C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
F. Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
G. Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
H. Include an unaltered copy of this License.
I. Preserve the section entitled "History", and its title, and add to
it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section entitled "History" in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
J. Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the "History" section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
K. In any section entitled "Acknowledgements" or "Dedications",
preserve the section's title, and preserve in the section all the
substance and tone of each of the contributor acknowledgements
and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
M. Delete any section entitled "Endorsements". Such a section
may not be included in the Modified Version.
N. Do not retitle any existing section as "Endorsements"
or to conflict in title with any Invariant Section.
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections entitled "History"
in the various original documents, forming one section entitled
"History"; likewise combine any sections entitled "Acknowledgements",
and any sections entitled "Dedications". You must delete all sections
entitled "Endorsements."
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, does not as a whole count as a Modified Version
of the Document, provided no compilation copyright is claimed for the
compilation. Such a compilation is called an "aggregate", and this
License does not apply to the other self-contained works thus compiled
with the Document, on account of their being thus compiled, if they
are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one quarter
of the entire aggregate, the Document's Cover Texts may be placed on
covers that surround only the Document within the aggregate.
Otherwise they must appear on covers around the whole aggregate.
8. TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License provided that you also include the
original English version of this License. In case of a disagreement
between the translation and the original English version of this
License, the original English version will prevail.
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
Copyright (c) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with the Invariant Sections being LIST THEIR TITLES, with the
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
If you have no Invariant Sections, write "with no Invariant Sections"
instead of saying which ones are invariant. If you have no
Front-Cover Texts, write "no Front-Cover Texts" instead of
"Front-Cover Texts being LIST"; likewise for Back-Cover Texts.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.

340
GNU-GPL.txt Normal file
View File

@@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

504
GNU-LGPL.txt Normal file
View File

@@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

25
Makefile Normal file
View 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
View File

@@ -0,0 +1,359 @@
# $RCSfile: Makefile.rule,v $
# $Revision: 1.4 $
# $Name: $
# $Date: 2003/07/16 23:37:37 $
# $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) -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
View 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

View File

@@ -1,28 +1,44 @@
# $RCSfile: ReadMe.txt,v $
# $Revision: 2.2 $
# $Revision: 2.8 $
# $Name: $
# $Date: 2002/02/25 23:40:42 $
# $Date: 2005/01/24 01:19:50 $
# $Author: agibert $
Welcome to LibNode 2.0.x !
Welcome to LibNode 2.1.x !
This release of LibNode support the following OS:
- Linux 2.2.X and 2.4.x (tested on RedHat & Mandrake),
This release of LibNode supports the following OS:
- Linux 2.2.x, 2.4.x and 2.6.x (tested on RedHat & Mandrake),
- Solaris 2.6,
- Windows NT4 & 2000.
- Windows NT4, 2000 and XP.
The support of LibVer is now optional.
LibShm and LibDataStr are no more supported.
Warning: Associated documentation is outdated...
The support of LibVer is now optional (To enable it, use: make _LIBVER_SUPPORT=1 all).
LibNode support LibShMem 2.0.0 and LibDataStr 2.0.0 !
Warning: Associated documentation (including the comments !) is outdated...
Please read demo and ndbench code.
Libnode is licensed under the LGPL/GPL GNU Licenses.
For more information, please read the corresponding source file headers.
The license details can be found in the GNU-GPL.txt, GNU-LGPL.txt and GNU-FDL.txt files.
Enjoy it!
Your LibNode Team.
arnaud@rx3.net
http://www.rx3.org/dvp/libnode

View File

@@ -1,47 +1,135 @@
# $RCSfile: ReleaseNotes.txt,v $
# $Revision: 2.7 $
# $Revision: 2.20 $
# $Name: $
# $Date: 2002/02/27 17:25:12 $
# $Date: 2005/01/24 00:50:55 $
# $Author: agibert $
--------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------
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
------------------------------------------------------------------------------------------------------------------------------------
All: This release of libnode pass with sucess valgrind test on linux.
LibNode: Add and use ND_Index_Clear() private API,
NbBench: Add fclose() call at the end of batch_run.
------------------------------------------------------------------------------------------------------------------------------------
LibNode V 2.0.3-1 - A. Gibert - 09/04/02
------------------------------------------------------------------------------------------------------------------------------------
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: Add new cases in ND_Index_Convert() handling (List->List:FIFO and List->List:LIFO),
LibNode: Generate in Debug mode libnoded.lib, libnoded.dll, libnoded_a.lib,
LibNode: Generate in Release mode libnode.lib, libnode.dll, libnode_a.lib,
Demo0: Generate in Debug mode demo0d.exe and in Release mode demo0d.exe,
NbBench: Generate in Debug mode ndbenchd.exe and in Release mode ndbenchd.exe.
------------------------------------------------------------------------------------------------------------------------------------
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 license stuff in ReandMe.
LibNode: Add LGPL header in libnode.c, libnode.h and node.h,
LibNode: Replace GPL by LGPL in libnode.rc,
Demo0: Add GPL header in demo0.c,
NbBench: Add GPL header in ndbench.c.
------------------------------------------------------------------------------------------------------------------------------------
LibNode V 2.0.2-1 - A. Gibert - 27/02/02
--------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------
All: Makefiles now generate static and dynamic objects,
All: Add no libver support in Makefiles,
LibNode: VisualStudio Project now generate Windows DLL and use libnode.rc resource file,
LibNode: Rename Index_Open_Nb into Index_Open_Count,
LibNode: Fix bugs in ND_Node_Root_Alloc() on Index_Open_Count handling,
LibNode: Minor fix into ND_DataStruct_Check_I() and ND_Index_Check_I() functions.
LibNode: Minor fix into ND_DataStruct_Check_I() and ND_Index_Check_I() functions,
NbBench: Implement Index_Close and Index_Info_Print functions.
--------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------
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 V 2.0.0-1 - A. Gibert - 26/11/01
--------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------
All: Merge the main CVS trunc with the win32 branche (2.0.0-alpha5),
Switch file release to 2.0.
--------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------
LibNode V 2.0.0-alpha5 - A. Gibert - 25/10/01
--------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------
LibNode: Add Open/Close Index support,
LibNode: Fix return code next to empty struct manipulations,
@@ -49,9 +137,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,
LibNode: Fix missing recursive offset args,
@@ -60,18 +148,18 @@ NdBench: Fix local stack pointer big bug.
--------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------
LibNode V 2.0.0-alpha3 - A. Gibert - 18/9/01
--------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------
New manager args interface (again !),
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,
Bug fixes,
@@ -79,53 +167,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,
Remove libver support,
Multi index support,
New manager args format,
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)
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)
--------------------------------------------------------------------------------
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).
--------------------------------------------------------------------------------
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).
--------------------------------------------------------------------------------
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).

View File

@@ -1,14 +1,14 @@
# $RCSfile: ToDo.txt,v $
# $Revision: 2.1 $
# $Revision: 2.5 $
# $Name: $
# $Date: 2001/11/26 11:25:11 $
# $Date: 2005/01/24 01:19:50 $
# $Author: agibert $
- More debug !
- Check LibShMem/LibDataStr support (via symbol lookup support),
- Add Cache Value option,
- New English documentation (man/tex),
- Improve API consitency,
- Re-enable LibShm/LibDataStr support (via TIMAT_DataStruct implementation).
- Improve API consitency.

View File

@@ -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:
rm -f demo0 demo0-static
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
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)

View File

@@ -1,34 +1,52 @@
/*---------------------------------------------------------------------------------*/
/* $RCSfile: nddemo0.c,v $ */
/*---------------------------------------------------------------------------------*/
/* $Revision: 2.0 $ */
/* $Revision: 2.8 $ */
/* $Name: $ */
/* $Date: 2001/11/26 10:53:34 $ */
/* $Date: 2004/08/23 22:48:37 $ */
/* $Author: agibert $ */
/*---------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------*/
/* This file is part of LibNode */
/* */
/* LibNode is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public Licence as published by */
/* the Free Software Foundation; either version 2 of the License, or */
/* (at your option) any later version. */
/* */
/* LibNode is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with LibNode; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*---------------------------------------------------------------------------------*/
#include <stdio.h>
#include <errno.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_SIZE ( short) ( STRING_LEN + 1)
#define VAL_LEN ( short) 64
#define VAL_SIZE ( short) ( VAL_LEN + 1)
#define INDEX_NB ( short) 4
#define NDT_CMD_INDEX0_PRINT (NDT_Command)64
#define NDT_CMD_INDEX1_PRINT (NDT_Command)65
#define NDT_CMD_INDEX2_PRINT (NDT_Command)66
#define NDT_CMD_INDEX3_PRINT (NDT_Command)67
#define NDD_CMD_INDEX0_PRINT ( NDT_Command) 64
#define NDD_CMD_INDEX1_PRINT ( NDT_Command) 65
#define NDD_CMD_INDEX2_PRINT ( NDT_Command) 66
#define NDD_CMD_INDEX3_PRINT ( NDT_Command) 67
@@ -46,7 +64,7 @@ typedef struct Demo_Value
/* 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 Demo( char *, short);
@@ -62,7 +80,7 @@ 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)
{
NDT_Command_Name Command_Name;
@@ -76,7 +94,7 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
Command_Name = "NDD_CMD_MANAGER_VERSION";
*Version_Name_Ptr = "$Revision: 2.0 $ $Name: $ $Date: 2001/11/26 10:53:34 $ $Author: agibert $";
*Version_Name_Ptr = "$Revision: 2.8 $ $Name: $ $Date: 2004/08/23 22:48:37 $ $Author: agibert $";
return( NDS_OK);
}
@@ -99,28 +117,28 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
switch(Cmd)
{
case NDT_CMD_INDEX0_PRINT:
case NDD_CMD_INDEX0_PRINT:
{
*Reply_Index_Id_Ptr = 0;
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
break;
}
case NDT_CMD_INDEX1_PRINT:
case NDD_CMD_INDEX1_PRINT:
{
*Reply_Index_Id_Ptr = 1;
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
break;
}
case NDT_CMD_INDEX2_PRINT:
case NDD_CMD_INDEX2_PRINT:
{
*Reply_Index_Id_Ptr = 2;
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
break;
}
case NDT_CMD_INDEX3_PRINT:
case NDD_CMD_INDEX3_PRINT:
{
*Reply_Index_Id_Ptr = 3;
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
@@ -305,6 +323,7 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
*/
Command_Name = "NDD_CMD_VALUE_REMOVE";
return( NDS_OK);
}
@@ -362,12 +381,12 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
default:
{
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);
return NDS_OK;
return( NDS_OK);
}
@@ -474,7 +493,7 @@ void DataStruct_Dump( NDT_Root *ds_ptr)
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);
}
@@ -485,7 +504,7 @@ void DataStruct_Dump( NDT_Root *ds_ptr)
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);
}
@@ -496,7 +515,7 @@ void DataStruct_Dump( NDT_Root *ds_ptr)
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);
}
@@ -507,7 +526,7 @@ void DataStruct_Dump( NDT_Root *ds_ptr)
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);
}
@@ -545,6 +564,16 @@ void Demo( char *Demo_File_Name, short Optimized_Mode)
FILE *demo_file;
printf( "Open library: ");
if( ( status = ND_Library_Open( NDD_TRUE)) != NDS_OK)
{
printf( "ND_Library_Open() failed (%d) !\n", status);
}
else
{
printf( "Ok !\n");
printf( "Create demo DataStructure: ");
if( Optimized_Mode)
@@ -556,9 +585,7 @@ void Demo( char *Demo_File_Name, short Optimized_Mode)
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)
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);
}
@@ -581,16 +608,11 @@ void Demo( char *Demo_File_Name, short Optimized_Mode)
printf( "\n\n\nLaod Data File:\n\n");
DataStruct_Load( demo_ds_ptr, demo_file);
if( Optimized_Mode)
{
printf( "\n\n\nInitial Structure Dump:\n\n");
DataStruct_Dump( demo_ds_ptr);
printf( "Convert data structure: ");
if( ( status = ND_DataStruct_Convert( demo_ds_ptr, index_type_final_tab)) != NDS_OK)
@@ -608,8 +630,6 @@ void Demo( char *Demo_File_Name, short Optimized_Mode)
printf( "\n\n\nFinal Structure Dump:\n\n");
DataStruct_Dump( demo_ds_ptr);
printf( "Close demo datafile: ");
if( fclose( demo_file) != 0)
@@ -623,7 +643,6 @@ void Demo( char *Demo_File_Name, short Optimized_Mode)
}
printf( "Close demo DataStructure: ");
if( ( status = ND_DataStruct_Close( demo_ds_ptr)) != NDS_OK)
@@ -635,6 +654,18 @@ void Demo( char *Demo_File_Name, short Optimized_Mode)
printf( "Ok !\n");
}
}
printf( "Close library: ");
if( ( status = ND_Library_Close()) != NDS_OK)
{
printf( "ND_Library_Close() failed (%d) !\n", status);
}
else
{
printf( "Ok !\n");
}
}
}
@@ -652,34 +683,4 @@ int main( int argc, char **argv)
printf( "\n\n\n\n\nOptimized Demo\n--------------\n\n\n");
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");
}
*/

View File

@@ -1,9 +1,9 @@
#---------------------------------------------------------------------------------
# $RCSfile: nddemo0.dat,v $
#---------------------------------------------------------------------------------
# $Revision: 2.0 $
# $Revision: 2.1 $
# $Name: $
# $Date: 2001/11/26 10:53:34 $
# $Date: 2003/07/16 00:17:02 $
# $Author: agibert $
#---------------------------------------------------------------------------------
ggg 1 xxxxxx example

View File

@@ -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
# ** DO NOT EDIT **
# 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 use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "demo0.mak".
!MESSAGE NMAKE /f "nddemo0.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "demo0.mak" CFG="demo0 - Win32 Debug"
!MESSAGE NMAKE /f "nddemo0.mak" CFG="nddemo0 - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "demo0 - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "demo0 - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE "nddemo0 - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "nddemo0 - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
@@ -28,7 +28,7 @@ CFG=demo0 - Win32 Debug
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "demo0 - Win32 Release"
!IF "$(CFG)" == "nddemo0 - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
@@ -37,11 +37,12 @@ RSC=rc.exe
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x809 /d "NDEBUG"
# ADD RSC /l 0x809 /d "NDEBUG"
BSC32=bscmake.exe
@@ -49,9 +50,9 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib 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 /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
!ELSEIF "$(CFG)" == "demo0 - Win32 Debug"
!ELSEIF "$(CFG)" == "nddemo0 - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
@@ -60,12 +61,12 @@ LINK32=link.exe
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0x809 /d "_DEBUG"
# ADD RSC /l 0x809 /d "_DEBUG"
BSC32=bscmake.exe
@@ -73,24 +74,24 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib 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 libnode.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:"nddemo0d.exe" /pdbtype:sept
!ENDIF
# Begin Target
# Name "demo0 - Win32 Release"
# Name "demo0 - Win32 Debug"
# Name "nddemo0 - Win32 Release"
# Name "nddemo0 - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# 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

View File

@@ -3,7 +3,7 @@ Microsoft Developer Studio Workspace File, Format Version 6.00
###############################################################################
Project: "demo0"=.\demo0\demo0.dsp - Package Owner=<4>
Project: "nddemo0"=.\nddemo0.dsp - Package Owner=<4>
Package=<5>
{{{

5
doc/Makefile Normal file
View File

@@ -0,0 +1,5 @@
FILE_DOC := libnode.doc
FILE_MAN := man3
include ../Makefile.var
include ../Makefile.rule

6
include/Makefile Normal file
View File

@@ -0,0 +1,6 @@
FILE_INCLUDE := node.h
include ../Makefile.var
include ../Makefile.rule

View File

@@ -1,12 +1,33 @@
/*---------------------------------------------------------------------------------*/
/* $RCSfile: node.h,v $ */
/*---------------------------------------------------------------------------------*/
/* $Revision: 2.3 $ */
/* $Revision: 2.12 $ */
/* $Name: $ */
/* $Date: 2002/02/27 16:04:10 $ */
/* $Date: 2005/01/20 00:00:25 $ */
/* $Author: agibert $ */
/*---------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------*/
/* This file is part of LibNode */
/* */
/* LibNode is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public Licence as published by */
/* the Free Software Foundation; either version 2.1 of the License, or */
/* (at your option) any later version. */
/* */
/* LibNode is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with LibNode; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*---------------------------------------------------------------------------------*/
#ifndef _LIBNODE_H_
@@ -16,10 +37,9 @@
extern "C" {
# endif
#include <stdio.h>
# include <stdlib.h>
# include <stdio.h>
# include <string.h>
#include <signal.h>
# include <stdarg.h>
# ifdef _LIBVER_SUPPORT
@@ -206,7 +226,7 @@ typedef NDT_Status NDT_Manager( struct NDT_Root *, NDT_Index_Id, struct NDT_Nod
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 */
@@ -240,8 +260,8 @@ typedef struct NDT_Index
typedef struct NDT_Root
{
// NDT_Root_Type Type; /* Root Structure Type */
// NDT_DataStruct_Type DS_Type; /* Type de la structure (liste, arbre ... ) */
/* NDT_Root_Type Type;*/ /* Root Structure Type */
/* NDT_DataStruct_Type DS_Type;*/ /* Type de la structure (liste, arbre ... ) */
NDT_Manager *Manager_Ptr; /* Pointeur sur la fonction manager */
char Manager_Name[NDD_MANAGER_NAME_SIZE_MAX]; /* Nom de la fonction manager */
@@ -251,11 +271,11 @@ typedef struct NDT_Root
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 */
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_Open_Count;
NDT_Index Index_Tab[0];
NDT_Index Index_Tab[1];
} NDT_Root;
@@ -288,10 +308,6 @@ typedef struct NDT_Node
char ND_Error_Msg [512];
typedef int NDT_Recursive_Mode;
typedef int NDT_Recursive_Depth;
typedef int NDT_Recursive_Offset;
@@ -318,7 +334,7 @@ typedef int NDT_Recursive_Offset;
#define ND_Library_Open ND_Library_Open_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_Close ND_DataStruct_Close_I
@@ -368,7 +384,7 @@ typedef int NDT_Recursive_Offset;
#define ND_Library_Open ND_Library_Open_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_Close ND_DataStruct_Close_C
@@ -420,7 +436,7 @@ typedef int NDT_Recursive_Offset;
/*------------------------------------------------------------------------------*/
# if defined(_MSC_VER) && !defined(LIBNODE_STATIC)
# if defined(_WIN32) && !defined(LIBNODE_STATIC)
# ifndef _LIBNODE_C_
# define NDD_DLL_API __declspec(dllimport)
# else
@@ -451,8 +467,8 @@ NDD_DLL_API NDT_Status ND_Library_Close_C( void);
/*------------------------------------------------------------------------------*/
/* 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_C( FILE *Out);
NDD_DLL_API NDT_Status ND_Library_StdErr_Set_I( FILE *);
NDD_DLL_API NDT_Status ND_Library_StdErr_Set_C( FILE *);
@@ -476,8 +492,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 */
/*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Close_I( NDT_Root *Root);
NDD_DLL_API NDT_Status ND_DataStruct_Close_C( 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 *);
@@ -486,8 +502,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 */
/*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Flush_I( NDT_Root *Root);
NDD_DLL_API NDT_Status ND_DataStruct_Flush_C( 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 *);
@@ -501,8 +517,8 @@ NDD_DLL_API NDT_Status ND_DataStruct_Flush_C( NDT_Root *Root);
/* (O) Nb_Corrected : pointeur sur le nombre d'erreurs */
/* (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_C( 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 *, int *, int *, FILE *);
@@ -513,8 +529,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 */
/*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Reorg_I( NDT_Root *Root);
NDD_DLL_API NDT_Status ND_DataStruct_Reorg_C( 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 *);
@@ -537,10 +553,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) 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_VC( NDT_Root *, NDT_Command 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_C( NDT_Root *, NDT_Command Command, ...);
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, va_list);
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, ...);
@@ -550,8 +566,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) 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_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_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 *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset);
@@ -561,8 +577,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) 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_C( 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 *, void *);
@@ -573,8 +589,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) 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_C( 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 *, void *);
@@ -599,10 +615,10 @@ NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_C( FILE *, NDT_Root *, NDT_R
/* (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_VC( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, 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_C( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, ...);
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 **, NDT_Root *, void *, va_list);
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 **, NDT_Root *, void *, ...);
@@ -651,8 +667,8 @@ NDD_DLL_API NDT_Status ND_Index_Flush_C( NDT_Root *, NDT_Index_Id);
/* (O) Nb_Corrected : pointeur sur le nombre d'erreurs */
/* (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_C( 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 *, NDT_Index_Id, int *, int *, FILE *);
@@ -662,8 +678,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) 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_C ( 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, NDT_Index_Type);
@@ -713,8 +729,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) 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_C( 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 *, NDT_Index_Id, void *);
@@ -725,8 +741,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) 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_C( 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 *, NDT_Index_Id, void *);
@@ -748,8 +764,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) 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_C( 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 *, NDT_Index_Id, NDT_Node *);
@@ -758,8 +774,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 */
/*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Node_Remove_I( NDT_Node * Node);
NDD_DLL_API NDT_Status ND_Index_Node_Remove_C( 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 *);
@@ -876,8 +892,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) 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_C( 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( void **, size_t, NDT_Allocator_Name, NDT_Allocator *, void *);
@@ -885,11 +901,12 @@ 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 */
/*------------------------------------------------------------------------------*/
/* (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) 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_C( 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( void *, NDT_Desallocator_Name, NDT_Desallocator *, void *);

View File

@@ -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
INCLUDE_VER = ../../libver/ver.h
LIB_VER = -I ../../libver
DEP += ../../libver/ver.h
INCLUDE += -I ../../libver/lib
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
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
libnode.o : libnode.c $(DEP)

File diff suppressed because it is too large Load Diff

View File

@@ -38,11 +38,12 @@ RSC=rc.exe
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBNODE_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBNODE_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBNODE_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x809 /d "NDEBUG"
@@ -52,13 +53,13 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /machine:I386
# Begin Custom Build - Creating static library libnode_a.lib...
InputPath=.\Release\libnode.dll
InputPath=.\libnode.dll
SOURCE="$(InputPath)"
"Release\libnode_a.lib" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
lib /nologo /out:Release\libnode_a.lib Release\*.obj
"libnode_a.lib" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
lib /nologo /out:libnode_a.lib Release\*.obj
# End Custom Build
@@ -71,7 +72,7 @@ SOURCE="$(InputPath)"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
@@ -87,14 +88,14 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"libnoded.dll" /pdbtype:sept
# SUBTRACT LINK32 /map
# Begin Custom Build - Creating static library libnode_a.lib...
InputPath=.\Debug\libnode.dll
# Begin Custom Build - Creating static library libnoded_a.lib...
InputPath=.\libnoded.dll
SOURCE="$(InputPath)"
"Debug\libnode_a.lib" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
lib /nologo /out:Debug\libnode_a.lib Debug\*.obj
"libnoded_a.lib" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
lib /nologo /out:libnoded_a.lib Debug\*.obj
# End Custom Build
@@ -125,7 +126,7 @@ SOURCE=.\libnode.h
# End Source File
# Begin Source File
SOURCE=.\node.h
SOURCE=..\include\node.h
# End Source File
# End Group
# Begin Group "Resource Files"

View File

@@ -1,19 +1,48 @@
/*---------------------------------------------------------------------------------*/
/* $RCSfile: libnode.h,v $ */
/*---------------------------------------------------------------------------------*/
/* $Revision: 2.1 $ */
/* $Revision: 2.9 $ */
/* $Name: $ */
/* $Date: 2002/02/27 16:05:15 $ */
/* $Date: 2005/01/19 23:59:42 $ */
/* $Author: agibert $ */
/*---------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------*/
/* This file is part of LibNode */
/* */
/* LibNode is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public Licence as published by */
/* the Free Software Foundation; either version 2.1 of the License, or */
/* (at your option) any later version. */
/* */
/* LibNode is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with LibNode; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*---------------------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.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>
@@ -23,13 +52,9 @@
#ifdef __linux
# define NDD_PRINTF_PTR_PREFIX ""
#else
# define NDD_PRINTF_PTR_PREFIX "0x"
#endif
@@ -38,24 +63,58 @@
#define NDD_HUGE_LONG ( long) 0xFFFFFFL
/* Sortie standard des messages d'erreur */
FILE * ND_stderr;
/* Table des symboles locale */
struct Symbol {
struct NDT_Symbol;
typedef struct NDT_Symbol
{
void *Ptr;
char *Name;
struct Symbol * Next;
} * Symbol_Table = NULL;
struct NDT_Symbol *Next;
} NDT_Symbol;
NDT_Root * Tmp_Root;
//extern char * strdup (const char *);
//extern int sigrelse (int sig);
/* 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
};
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
@@ -68,12 +127,19 @@ int Sig_Trapped;
/*------------------------------------------------------------------------------*/
/* (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 */
/*------------------------------------------------------------------------------*/
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 */
@@ -94,7 +160,19 @@ 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) 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 */
/*------------------------------------------------------------------------------*/
/* (O) Root: adresse d'un pointeur sur la racine de la nouvelle structure */
/* (I) Type: type de la structure.de données (liste ou arbre binaire) */
/* (I) Allocator: pointeur vers la fonction d'allocation */
/* (I) Desallocator: pointeur vers la fonction de désallocation */
/* (I) Data : pointeur de données utiles à l'allocateur */
/* (I) Own_Value : indique si la structure est propriétaire de ses valeurs */
/*------------------------------------------------------------------------------*/
NDT_Status ND_Index_Clear( NDT_Root *, NDT_Index_Id);
/*------------------------------------------------------------------------------*/
/* Création de la racine d'une structure de données quelconque */
@@ -112,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 */
/*------------------------------------------------------------------------------*/
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 */
@@ -182,14 +260,14 @@ NDT_Status ND_Tree_Equalize (NDT_Root *, NDT_Index_Id);
/*------------------------------------------------------------------------------*/
/* (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 */
/*------------------------------------------------------------------------------*/
/* (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 */
@@ -210,7 +288,7 @@ 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) */
/*------------------------------------------------------------------------------*/
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 */
@@ -219,9 +297,14 @@ int ND_Node_Compare (void ** Node1, void ** Node2);
/*------------------------------------------------------------------------------*/
NDT_Status ND_List_Sort( NDT_Root *, NDT_Index_Id);
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/* Fonctions et procédures privées de la librairie (bas niveau) */
/* PRIVATE FUNCTIONS */
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
@@ -241,24 +324,24 @@ 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 *);
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_Signal_Trap( int);
NDT_Status ND_Address_Check (void * Address);
NDT_Status ND_Address_Check( void *);

View File

@@ -73,9 +73,9 @@ BEGIN
VALUE "Comments", "Memory list or tree node structures management library\0"
VALUE "CompanyName", "Rx3\0"
VALUE "FileDescription", "Node Library\0"
VALUE "FileVersion", "$Revision: 1.2 $\0"
VALUE "FileVersion", "$Revision: 1.3 $\0"
VALUE "InternalName", "libnode\0"
VALUE "LegalCopyright", "GNU General Public Licence (GPL) - 1993-2002\0"
VALUE "LegalCopyright", "GNU Lesser General Public Licence (LGPL) V 2.1\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "libnode.dll\0"
VALUE "PrivateBuild", "\0"

76
libnode.spec Normal file
View File

@@ -0,0 +1,76 @@
Name: libnode
Version: 2.1.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/%{source}
Url: http://www.rx3.org/dvp/libnode/download/
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
* 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.

View 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
DEP_VER_STATIC = ../../libver/ver.h ../../libver/libver.a
DEP_VER_DYNAMIC = ../../libver/ver.h ../../libver/libver.so
LIB_VER_STATIC = -I ../../libver ../../libver/libver.a
LIB_VER_DYNAMIC = -I ../../libver -L ../../libver -lver
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
all: ndbench ndbench-static
CFLAGS += -D_LIBVER_SUPPORT
endif
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
ND_CHECK_FLAGS = -DND_MODE=0
ND_NOCHECK_FLAGS = -DND_MODE=1
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:
rm -f ndbench ndbench-static
ndbench: ndbench.c $(DEP_DYNAMIC)
$(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)

View File

@@ -1,12 +1,33 @@
/*---------------------------------------------------------------------------------*/
/* $RCSfile: ndbench.c,v $ */
/*---------------------------------------------------------------------------------*/
/* $Revision: 2.2 $ */
/* $Revision: 2.9 $ */
/* $Name: $ */
/* $Date: 2002/02/27 16:14:22 $ */
/* $Date: 2005/01/20 00:07:27 $ */
/* $Author: agibert $ */
/*---------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------*/
/* This file is part of LibNode */
/* */
/* LibNode is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public Licence as published by */
/* the Free Software Foundation; either version 2 of the License, or */
/* (at your option) any later version. */
/* */
/* LibNode is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with LibNode; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*---------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------*/
/* Includes */
@@ -20,19 +41,13 @@
#ifdef _WIN32
# include <sys/timeb.h>
#else
# include <sys/time.h>
#endif
#ifdef _LIBVER_SUPPORT
# include <ver.h>
#endif
@@ -43,43 +58,47 @@
/* Defines */
/*---------------------------------------------------------------------------------*/
#ifdef _LIBVER
VER_INFO_EXPORT( ndbench, "$Revision: 2.2 $", "$Name: $", __FILE__, "$Author: agibert $")
#ifdef _LIBVER_SUPPORT
VER_INFO_EXPORT( ndbench, "$Revision: 2.9 $", "$Name: $", __FILE__, "$Author: agibert $");
# define USAGE "Usage : %s [ --help | --version [-v] | --batch_run <batch_file_name>]\n"
#else
# define USAGE "Usage : %s [ --help | --batch_run <batch_file_name>]\n"
#endif
#define ND_MODE 1
#include <node.h>
#define USAGE "Usage : %s [ --help | --version [-v] | --batch_run <batch_file_name>]\n"
#define QUIT 0
#define DS_OPEN 1
#define DS_CLOSE 2
#define DS_FLUSH 3
#define DS_CHECK 4
#define DS_REORG 5
#define DS_INFO_PRINT 6
#define DS_VALUE_ADD 7
#define DS_VALUE_REMOVE 8
#define DS_VALUE_PRINT 9
#define DS_VALUE_FIND 10
#define INDEX_LIST_OPEN 11
#define INDEX_TREE_OPEN 12
#define INDEX_CLOSE 13
#define INDEX_FLUSH 14
#define INDEX_CHECK 15
#define INDEX_LIST_SUBTYPE_SET 16
#define INDEX_LIST_TO_TREE 17
#define INDEX_TREE_SUBTYPE_SET 18
#define INDEX_TREE_TO_LIST 19
#define INDEX_REORG 20
#define INDEX_INFO_PRINT 21
#define INDEX_VALUE_PRINT 22
#define BATCH_RUN 23
#define LIB_OPEN 1
#define LIB_CLOSE 2
#define DS_OPEN 3
#define DS_CLOSE 4
#define DS_FLUSH 5
#define DS_CHECK 6
#define DS_REORG 7
#define DS_INFO_PRINT 8
#define DS_VALUE_ADD 9
#define DS_VALUE_REMOVE 10
#define DS_VALUE_PRINT 11
#define DS_VALUE_FIND 12
#define INDEX_LIST_OPEN 13
#define INDEX_TREE_OPEN 14
#define INDEX_CLOSE 15
#define INDEX_FLUSH 16
#define INDEX_CHECK 17
#define INDEX_LIST_SUBTYPE_SET 18
#define INDEX_LIST_TO_TREE 19
#define INDEX_TREE_SUBTYPE_SET 20
#define INDEX_TREE_TO_LIST 21
#define INDEX_REORG 22
#define INDEX_INFO_PRINT 23
#define INDEX_VALUE_PRINT 24
#define INDEX_VALUE_BREAK 25
#define INDEX_NODE_BREAK 26
#define BATCH_RUN 27
#define COMMAND_NB 24
#define COMMAND_NB 28
#define INDEX_NB 32
@@ -95,6 +114,11 @@ VER_INFO_EXPORT( ndbench, "$Revision: 2.2 $", "$Name: $", __FILE__, "$Author: a
#define BUF_LEN 99
#define BUF_SIZE (BUF_LEN + 1)
/*---------------------------------------------------------------------------------*/
@@ -129,6 +153,7 @@ typedef struct
# define t_start(x) { _ftime( &(x.start));}
# define t_stop(x) { _ftime( &(x.stop)); x.sec = (double)(x.stop.time) - (double)(x.start.time) + ((double)(x.stop.millitm) - (double)(x.start.millitm)) / 1000;}
# define seed_get(x) (int)( (x).start.time)
#else
@@ -139,8 +164,9 @@ typedef struct
struct timeval stop;
} cpt;
# define t_start(x) { gettimeofday( &(x.start), NULL);}
# define t_stop(x) { gettimeofday( &(x.stop), NULL); x.sec = (double)(x.stop.tv_sec) - (double)(x.start.tv_sec) + ((double)(x.stop.tv_usec) - (double)(x.start.tv_usec)) / 1000000;}
# define t_start(x) { gettimeofday( &((x).start), NULL);}
# define t_stop(x) { gettimeofday( &((x).stop), NULL); (x).sec = (double)((x).stop.tv_sec) - (double)((x).start.tv_sec) + ((double)((x).stop.tv_usec) - (double)((x).start.tv_usec)) / 1000000;}
# define seed_get(x) (int)( (x).start.tv_sec)
#endif
@@ -195,6 +221,8 @@ void Batch_Run( NDT_Root **, FILE *, FILE *, short);
Command Command_Tab[] =
{
{ QUIT, "Quit", "Quit", ( DS_STATE_OPENED | DS_STATE_CLOSED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)},
{ LIB_OPEN, "Lib_Open", "Open Library", ( DS_STATE_OPENED | DS_STATE_CLOSED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)},
{ LIB_CLOSE, "Lib_Close", "Close Library", ( DS_STATE_OPENED | DS_STATE_CLOSED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)},
{ DS_OPEN, "DS_Open", "Open DataStructure", ( DS_STATE_CLOSED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)},
{ DS_CLOSE, "DS_Close", "Close DataStructure", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)},
{ DS_FLUSH, "DS_Flush", "Flush DataStructure", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)},
@@ -217,6 +245,8 @@ Command Command_Tab[] =
{ INDEX_REORG, "Index_Reorg", "Reorg Index", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)},
{ INDEX_INFO_PRINT, "Index_Info_Print", "Print Index Informations", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)},
{ INDEX_VALUE_PRINT, "Index_Value_Print", "Print Index Values", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)},
{ INDEX_VALUE_BREAK, "Index_Value_Break", "Break Index Value", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)},
{ INDEX_NODE_BREAK, "Index_Node_Break", "Break Index Node", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)},
{ BATCH_RUN, "Batch_Run", "Run NDBench Bach", ( DS_STATE_OPENED | DS_STATE_CLOSED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}
};
@@ -241,7 +271,7 @@ NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Nod
Command_Name = "NDD_CMD_MANAGER_VERSION";
*Version_Name_Ptr = "$Revision: 2.2 $ $Name: $ $Date: 2002/02/27 16:14:22 $ $Author: agibert $";
*Version_Name_Ptr = "$Revision: 2.9 $ $Name: $ $Date: 2005/01/20 00:07:27 $ $Author: agibert $";
return( NDS_OK);
}
@@ -528,7 +558,7 @@ void Command_Get( int *choice, char **arg1, char **arg2, FILE *File_Output,
fprintf( File_Output, "\nChoice ? ");
}
if( fgets( buf, 99, File_Input) != NULL)
if( fgets( buf, BUF_LEN, File_Input) != NULL)
{
while( ( buf[ strlen( buf) - 1] == '\r') || ( buf[ strlen( buf) - 1] == '\n') || ( buf[ strlen( buf) - 1] == '\t') || ( buf[ strlen( buf) - 1] == ' '))
{
@@ -642,7 +672,7 @@ void Command_Index_Range_Get( FILE *File_Output, int *Low, int *High, char
if( Arg == NULL)
{
fprintf( File_Output, "%s: %s range (?-?) : ", Command_Tab[Choice].Name, Obj_Name);
fgets( buf, 99, File_Input);
fgets( buf, BUF_LEN, File_Input);
Arg = buf;
}
@@ -681,7 +711,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
{
int low, high, i, j, nb_removed, Nb_Detected, Nb_Corrected;
T_Module Ref_Module, *Module_Ptr;
char buf[100];
char buf[BUF_SIZE];
NDT_Index_Type index_subtype;
@@ -694,17 +724,68 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
break;
}
case LIB_OPEN:
{
Command_Exec_Begin_Print( File_Output, Choice);
if( Arg1 == NULL)
{
fprintf( File_Output, "Library_Open: Debug Mode ( 0:OFF | 1:ON) ? ");
fgets( buf, BUF_LEN, File_Input);
Arg1 = buf;
}
Choice = atoi( Arg1);
t_start( t_exec);
ND_Library_Open( Choice);
t_stop( t_exec);
Command_Exec_End_Print( File_Output, Choice, t_exec, 1);
break;
}
case LIB_CLOSE:
{
Command_Exec_Begin_Print( File_Output, Choice);
t_start( t_exec);
ND_Library_Close();
t_stop( t_exec);
Command_Exec_End_Print( File_Output, Choice, t_exec, 1);
break;
}
case DS_OPEN:
{
Command_Exec_Begin_Print( File_Output, Choice);
if( Arg1 == NULL)
{
fprintf( File_Output, "DataStruct_Open: Symbol Lookup ( 0:OFF | 1:ON) ? ");
fgets( buf, BUF_LEN, File_Input);
Arg1 = buf;
}
Choice = atoi( Arg1);
for( i = 0; i < INDEX_NB; i++)
{
idx_type_tab[i] = NDD_INDEX_STATUS_CLOSED;
}
t_start( t_exec);
if( Choice == 0)
{
ND_DataStruct_Open( DS_Ptr_Ptr, INDEX_NB, idx_type_tab, "Module_Manager", Module_Manager, NULL, NULL, NULL, NULL, NDD_TRUE, NULL);
}
else
{
ND_DataStruct_Open( DS_Ptr_Ptr, INDEX_NB, idx_type_tab, "Module_Manager", NULL, NULL, NULL, NULL, NULL, NDD_TRUE, NULL);
}
t_stop( t_exec);
Command_Exec_End_Print( File_Output, Choice, t_exec, 1);
@@ -784,7 +865,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
if( Arg2 == NULL)
{
fprintf( File_Output, "DS_Value_Add: Add order ( 0:croissant | 1:decroissant) ? ");
fgets( buf, 99 ,stdin);
fgets( buf, BUF_LEN ,stdin);
Arg2 = buf;
}
@@ -858,7 +939,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
if( Arg2 == NULL)
{
fprintf( File_Output, "\nDS_Value_Remove: Remove order (croissant=0 | decroissant=1) ? ");
fgets( buf, 99, File_Input);
fgets( buf, BUF_LEN, File_Input);
Arg2 = buf;
}
@@ -943,7 +1024,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
while( i < j)
{
Ref_Module.Id = low +( rand( ) % ( high - low));
Ref_Module.Id = low + (int)( (double)( high - low) * rand() / ( RAND_MAX + 1.0));
ND_DataStruct_Value_Find( (void *)&Module_Ptr, *DS_Ptr_Ptr, &Ref_Module);
i++;
}
@@ -1032,6 +1113,9 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
case INDEX_LIST_SUBTYPE_SET:
{
int subtype;
Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index");
if( low != -1)
@@ -1039,14 +1123,14 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
if( Arg2 == NULL)
{
fprintf( File_Output, "Index_List_SubType_Set: List SubType ( 0:FIFO | 1:LIFO | 2:Sorted) ? ");
fgets( buf, 99, File_Input);
fgets( buf, BUF_LEN, File_Input);
Arg2 = buf;
}
Choice = atoi( Arg2);
subtype = atoi( Arg2);
switch( Choice)
switch( subtype)
{
case 0:
{
@@ -1069,7 +1153,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
default:
{
index_subtype = NDD_INDEX_SUBTYPE_UNKNOWN;
printf ("Index_List_SubType_Set: Invalid selection (%d) !\n", Choice);
printf ("Index_List_SubType_Set: Invalid selection (%d) !\n", subtype);
break;
}
}
@@ -1103,6 +1187,9 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
case INDEX_TREE_SUBTYPE_SET:
{
int subtype;
Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index");
if( low != -1)
@@ -1110,14 +1197,14 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
if( Arg2 == NULL)
{
fprintf( File_Output, "Index_Tree_SubType_Set: Tree SubType (0:UnBalanced | 1:Balanced) ? ");
fgets( buf, 99, stdin);
fgets( buf, BUF_LEN, stdin);
Arg2 = buf;
}
Choice = atoi( Arg2);
subtype = atoi( Arg2);
switch( Choice)
switch( subtype)
{
case 0:
{
@@ -1134,7 +1221,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
default:
{
index_subtype = NDD_INDEX_SUBTYPE_UNKNOWN;
printf ("Index_Tree_SubType_Set: Invalid selection (%d)!\n", Choice);
printf ("Index_Tree_SubType_Set: Invalid selection (%d)!\n", subtype);
break;
}
}
@@ -1243,7 +1330,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
if( low != -1)
{
fprintf( File_Output, "DS_Info_Print: Printing index from: (%d) to: (%d)...\n", low, high);
fprintf( File_Output, "Index_Info_Print: Printing index from: (%d) to: (%d)...\n", low, high);
fflush( File_Output);
for( i = low; i <= high; i++)
@@ -1264,6 +1351,88 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
break;
}
case INDEX_VALUE_BREAK:
{
int position;
NDT_Node *node_ptr;
Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index");
if( low != -1)
{
if( Arg2 == NULL)
{
fprintf( File_Output, "Index_Value_Break: Value position (0:Head | 1:Tail | 2:Random) ? ");
fgets( buf, BUF_LEN, stdin);
Arg2 = buf;
}
position = atoi( Arg2);
fprintf( File_Output, "Index_Value_Break: Breaking %s values from index : (%d) to: (%d)...\n",
( position == 0 ) ? "Head" : ( ( position == 1) ? "Tail" : "Random"),
low, high);
fflush( File_Output);
t_start( t_exec);
fprintf( File_Output, "Index_Value_Break: Breaking value of nodes: ");
fflush( File_Output);
for( i = low; i <= high; i++)
{
switch( position)
{
case 0:
{
node_ptr =(*DS_Ptr_Ptr)->Index_Tab[i].Head;
break;
}
case 1:
{
node_ptr=(*DS_Ptr_Ptr)->Index_Tab[i].Tail;
break;
}
case 2:
{
j = (int)( (double)( (*DS_Ptr_Ptr)->Index_Tab[i].Node_Number) * rand() / ( RAND_MAX + 1.0));
for( node_ptr = (*DS_Ptr_Ptr)->Index_Tab[i].Head; j > 0; j--)
{
node_ptr = node_ptr->Right;
}
break;
}
}
fprintf( File_Output, "0x(%x)", node_ptr);
fflush( File_Output);
node_ptr->Value = (void *)-1;
}
t_stop (t_exec);
fprintf( File_Output, "\n");
fflush( File_Output);
Command_Exec_End_Print( File_Output, Choice, t_exec, high - low);
}
break;
}
case INDEX_NODE_BREAK:
{
break;
}
case INDEX_CHECK:
{
Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index");
@@ -1299,7 +1468,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
{
fprintf( File_Output, "Batch_Run: Batch file name ? ");
fgets( buf, 99, stdin);
fgets( buf, BUF_LEN, stdin);
buf[ strlen( buf) - 1] = '\0';
Arg1 = buf;
}
@@ -1317,6 +1486,8 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
Batch_Run( DS_Ptr_Ptr, File_Output, file_input, 0);
fprintf( File_Output, "\n");
fprintf( File_Output, "Batch_Run: Ending execution (%s)...\n", Arg1);
fclose( file_input);
}
break;
@@ -1374,7 +1545,14 @@ void Batch_Run( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, FILE *File_Input,
int main( int argc, char **argv)
{
NDT_Root *ds_ptr = NULL;
int Debug = NDD_TRUE;
/* Init Random numbers... */
t_start( t_exec);
t_stop( t_exec);
srand( seed_get(t_exec));
/* Args Parsing */
@@ -1386,37 +1564,31 @@ int main( int argc, char ** argv)
fprintf( stderr, USAGE, argv[0]);
return( 1);
}
#ifdef _LIBVER_SUPPORT
else if( !strcmp( argv[1], "--version"))
{
if( argc >= 3 && !strcmp( argv[2], "-v"))
{
#ifdef _LIBVER_SUPPORT
return( VER_Object_Print( stdout, VERD_VERBOSE));
#endif
}
else
{
#ifdef _LIBVER_SUPPORT
return( VER_Object_Print( stdout, VERD_MINIMAL));
}
}
#endif
}
}
else if( !strcmp( argv[1], "--batch_run"))
{
/* Batch Mode */
ND_Library_Open( Debug);
Command_Exec( &ds_ptr, stdout, BATCH_RUN, argv[2], NULL, stdin);
ND_Library_Close();
return( 0);
}
else
{
fprintf( stderr, USAGE, argv[0]);
return(0);
return( -1);
}
}
@@ -1424,11 +1596,7 @@ int main( int argc, char ** argv)
/* Interactive Mode */
ND_Library_Open( Debug);
Batch_Run( &ds_ptr, stdout, stdin, 1);
ND_Library_Close();
return( 0);
}

View File

@@ -37,11 +37,12 @@ RSC=rc.exe
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x809 /d "NDEBUG"
# ADD RSC /l 0x809 /d "NDEBUG"
BSC32=bscmake.exe
@@ -49,7 +50,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib 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 /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
!ELSEIF "$(CFG)" == "ndbench - Win32 Debug"
@@ -60,7 +61,7 @@ LINK32=link.exe
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
@@ -73,8 +74,8 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib 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 libnode.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
# 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:"ndbenchd.exe" /pdbtype:sept
# SUBTRACT LINK32 /profile /pdb:none
!ENDIF

10
util/test-10-s.ndb Normal file
View 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
View 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
View 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

View File

@@ -1,4 +1,5 @@
DS_Open
Lib_Open 0
DS_Open 0
Index_List_Open 0-0
DS_Value_Add 1-100000 0
DS_Value_Find 49900-50100
@@ -6,3 +7,4 @@ Index_List_To_Tree 0-0
DS_Value_Find 1-100000
DS_Check
DS_Close
Lib_Close

10
util/test-10K-s.ndb Normal file
View 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

View File

@@ -1,4 +1,5 @@
DS_Open
Lib_Open 0
DS_Open 0
Index_List_Open 0-0
DS_Value_Add 1-10000 0
DS_Value_Find 4000-6000
@@ -6,3 +7,4 @@ Index_List_To_Tree 0-0
DS_Value_Find 1-10000
DS_Check
DS_Close
Lib_Close

10
util/test-1M-s.ndb Normal file
View 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

View File

@@ -1,4 +1,5 @@
DS_Open
Lib_Open 0
DS_Open 0
Index_List_Open 0-0
DS_Value_Add 1-1000000 0
DS_Value_Find 499990-500010
@@ -6,3 +7,4 @@ Index_List_To_Tree 0-0
DS_Value_Find 1-1000000
DS_Check
DS_Close
Lib_Close

View File

@@ -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-s.ndb
Batch_Run test-100K.ndb
Batch_Run test-100K-s.ndb
Batch_Run test-1M.ndb
Batch_Run test-1M-s.ndb

15
util/test-error.ndb Normal file
View 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