view release on metacpan or search on metacpan
you have. You must make sure that they, too, receive or can get the
source code. And you must tell them 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.
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 Agreement applies to any program or other work which
contains a notice placed by the copyright holder saying it may be
the Program under this License. However, parties who have received
copies, or rights to use copies, from you under this General Public
License will not have their licenses terminated so long as such parties
remain in full compliance.
5. By copying, distributing or modifying 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.
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.
7. 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
cost, duplication charges, time of people involved, and so on. (You will
not be required to justify it to the Copyright Holder, but only to the
computing community at large as a market that must bear the fee.)
- "Freely Available" means that no fee is charged for the item itself, though
there may be fees involved in handling the item. It also means that
recipients of the item may redistribute it under the same conditions they
received it.
1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.
2. You may apply bug fixes, portability fixes and other modifications derived
from the Public Domain or from the Copyright Holder. A Package modified in such
a way shall still be considered the Standard Version.
3. You may otherwise modify your copy of this Package in any way, provided that
you insert a prominent notice in each changed file stating how and when you
changed that file, and provided that you do at least ONE of the following:
a) place your modifications in the Public Domain or otherwise make them
_build/build_params view on Meta::CPAN
'Module::Build' => 0,
'Cwd' => 0,
'ExtUtils::CBuilder' => 0
},
'install_path' => {},
'pm_files' => undef,
'quiet' => undef,
'extra_compiler_flags' => [],
'script_files' => undef,
'build_script' => 'Build',
'original_prefix' => {},
'c_source' => undef,
'program_name' => undef,
'autosplit' => undef,
'license' => 'perl',
'build_requires' => {
'File::Copy' => 0,
'warnings' => 0,
'File::Spec' => 0,
'Sub::Exporter' => 0,
'vars' => 0,
src/judy-1.0.5/COPYING view on Meta::CPAN
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
src/judy-1.0.5/COPYING view on Meta::CPAN
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
src/judy-1.0.5/COPYING view on Meta::CPAN
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.
src/judy-1.0.5/Makefile.am view on Meta::CPAN
# compile, so that we can support 'make dist' gracefully.
#
# Dependencies: src <- tool (for libJudy), tool <- doc (for jhton), src <-
# test (for libJudy).
#SUBDIRS = src tool doc test make_includes
#SUBDIRS = src/JudyCommon src/JudyL src/Judy1 src/JudySL src/JudyHS src/obj
SUBDIRS = src tool doc test
# These files will be included in our tarballs, even though automake knows
# nothing else about them.
#EXTRA_DIST = Makefile.multi original_configure .cvsignore
DISTCLEANFILES = config.log config.status Makefile libtool make.out
src/judy-1.0.5/Makefile.in view on Meta::CPAN
# compile, so that we can support 'make dist' gracefully.
#
# Dependencies: src <- tool (for libJudy), tool <- doc (for jhton), src <-
# test (for libJudy).
#SUBDIRS = src tool doc test make_includes
#SUBDIRS = src/JudyCommon src/JudyL src/Judy1 src/JudySL src/JudyHS src/obj
SUBDIRS = src tool doc test
# These files will be included in our tarballs, even though automake knows
# nothing else about them.
#EXTRA_DIST = Makefile.multi original_configure .cvsignore
DISTCLEANFILES = config.log config.status Makefile libtool make.out
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh:
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
src/judy-1.0.5/aclocal.m4 view on Meta::CPAN
# Oops. We lost completely, so just stick with echo.
echo=echo
fi
fi
fi
fi
fi
fi
# Copy echo and quote the copy suitably for passing to libtool from
# the Makefile, instead of quoting the original, which is used later.
ECHO=$echo
if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
fi
AC_SUBST(ECHO)
])])# _LT_AC_PROG_ECHO_BACKSLASH
# _LT_AC_LOCK
src/judy-1.0.5/autom4te.cache/output.0 view on Meta::CPAN
s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
{ echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
{ (exit 1); exit 1; }; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
src/judy-1.0.5/autom4te.cache/output.0 view on Meta::CPAN
# Oops. We lost completely, so just stick with echo.
echo=echo
fi
fi
fi
fi
fi
fi
# Copy echo and quote the copy suitably for passing to libtool from
# the Makefile, instead of quoting the original, which is used later.
ECHO=$echo
if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
fi
tagnames=${tagnames+${tagnames},}CXX
src/judy-1.0.5/autom4te.cache/output.0 view on Meta::CPAN
s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
{ echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
{ (exit 1); exit 1; }; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
src/judy-1.0.5/autom4te.cache/output.1 view on Meta::CPAN
s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
{ echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
{ (exit 1); exit 1; }; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
src/judy-1.0.5/autom4te.cache/output.1 view on Meta::CPAN
# Oops. We lost completely, so just stick with echo.
echo=echo
fi
fi
fi
fi
fi
fi
# Copy echo and quote the copy suitably for passing to libtool from
# the Makefile, instead of quoting the original, which is used later.
ECHO=$echo
if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
fi
tagnames=${tagnames+${tagnames},}CXX
src/judy-1.0.5/autom4te.cache/output.1 view on Meta::CPAN
s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
{ echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
{ (exit 1); exit 1; }; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
src/judy-1.0.5/autom4te.cache/traces.0 view on Meta::CPAN
# Oops. We lost completely, so just stick with echo.
echo=echo
fi
fi
fi
fi
fi
fi
# Copy echo and quote the copy suitably for passing to libtool from
# the Makefile, instead of quoting the original, which is used later.
ECHO=$echo
if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
fi
AC_SUBST(ECHO)
])])
m4trace:/usr/share/aclocal/libtool.m4:469: -1- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock],
[AC_HELP_STRING([--disable-libtool-lock],
[avoid locking (might break parallel builds)])])
src/judy-1.0.5/autom4te.cache/traces.0 view on Meta::CPAN
# Oops. We lost completely, so just stick with echo.
echo=echo
fi
fi
fi
fi
fi
fi
# Copy echo and quote the copy suitably for passing to libtool from
# the Makefile, instead of quoting the original, which is used later.
ECHO=$echo
if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
fi
AC_SUBST(ECHO)
])
m4trace:configure.ac:244: -1- m4_pattern_allow([^ECHO$])
m4trace:configure.ac:244: -1- m4_pattern_allow([^AR$])
m4trace:configure.ac:244: -1- m4_pattern_allow([^RANLIB$])
src/judy-1.0.5/configure view on Meta::CPAN
s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
{ echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
{ (exit 1); exit 1; }; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
src/judy-1.0.5/configure view on Meta::CPAN
# Oops. We lost completely, so just stick with echo.
echo=echo
fi
fi
fi
fi
fi
fi
# Copy echo and quote the copy suitably for passing to libtool from
# the Makefile, instead of quoting the original, which is used later.
ECHO=$echo
if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
fi
tagnames=${tagnames+${tagnames},}CXX
src/judy-1.0.5/configure view on Meta::CPAN
s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
{ echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
{ (exit 1); exit 1; }; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
src/judy-1.0.5/doc/ext/Judy_3.htm view on Meta::CPAN
<DD>
The default is to print error messages to <B>stderr</B>, for example:
<P>
<PRE>
File 'YourCfile.c', line 1234: JudyLIns(), JU_ERRNO_* == 2, ID == 321
</PRE>
This indicates that an error occurred in the <B>JudyLIns()</B> function
at line 321. Line 1234 is the line in 'YourCfile.c' where the
<B>JLI()</B> call failed. JU_ERRNO_* == 2 is equal to JU_ERRNO_NOMEM
(as defined in the <B>Judy.h</B> file). The ID number indicates the
source line number in the function where the error originated. Your
program then terminates with an <I>exit(1);</I>. By default, both
categories of Judy error returns are printed this way. (The 'ID == 321'
is for die hards that want more detail or for debugging Judy itself.)
<BR>
<P>
<DT><B>2) Disable Macro Error Handling</B> </DT>
<DD>
When your program is "bug free", the only errors returned should be
<I>malloc()</I> failures. Therefore all error returns can be treated as
a <I>malloc()</I> failure. By using the below <B>#define</B>, all
src/judy-1.0.5/examples/Judy1DupCheck.c view on Meta::CPAN
printf("Judy1Dup failed: error %d\n", JU_ERRNO(&JError));
return (2);
}
// compare the duped array with known values
for (i = 0, Index = 0L, Judy_rv = Judy1First(PJArrayNew, &Index, &JError);
Judy_rv == 1; i++, Judy_rv = Judy1Next(PJArrayNew, &Index, &JError))
{
if (Index != knowns[i])
{
printf("Judy1DupCheck Failed: Judy1Dup does not match original\n");
return (2);
}
}
if (i != LARRAYSIZE(knowns))
{
printf
("Judy1DupCheck Failed: Judy1Dup does not match original (too short)\n");
exit(2);
}
else
printf("Ok\n");
return (0);
}
src/judy-1.0.5/install-sh view on Meta::CPAN
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2005-05-14.22
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
src/judy-1.0.5/ltmain.sh view on Meta::CPAN
# $file with .exe has already been added to rmfiles,
# add $file without .exe
rmfiles="$rmfiles $file"
;;
esac
# Do a test to see if this is a libtool program.
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
relink_command=
. $dir/$noexename
# note $name still contains .exe if it was in $file originally
# as does the version of $file that was added into $rmfiles
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
if test "$fast_install" = yes && test -n "$relink_command"; then
rmfiles="$rmfiles $objdir/lt-$name"
fi
if test "X$noexename" != "X$name" ; then
rmfiles="$rmfiles $objdir/lt-${noexename}.c"
fi
fi
fi
src/judy-1.0.5/src/JudyCommon/JudyInsertBranch.c view on Meta::CPAN
Pjp_t Pjp, // JP containing narrow pointer.
Word_t Index, // outlier to Pjp.
Word_t BranchLevel, // of what JP points to, mapped from JP type.
Pjpm_t Pjpm) // for global accounting.
{
jp_t JP2 [2];
jp_t JP;
Pjp_t PjpNull;
Word_t XorExp;
Word_t Inew, Iold;
Word_t DCDMask; // initially for original BranchLevel.
int Ret;
uint8_t Exp2[2];
uint8_t DecodeByteN, DecodeByteO;
// Get the current mask for the DCD digits:
DCDMask = cJU_DCDMASK(BranchLevel);
// Obtain Dcd bits that differ between Index and JP, shifted so the
// digit for BranchLevel is the LSB:
src/judy-1.0.5/src/JudyCommon/JudyPrivate.h view on Meta::CPAN
// A Judy array is, effectively, a digital tree (or Trie) with 256 element
// branches (nodes), and with "compression tricks" applied to low-population
// branches or leaves to save a lot of memory at the cost of relatively little
// CPU time or cache fills.
//
// In the actual implementation, a Judy array is level-less, and traversing the
// "tree" actually means following the states in a state machine (SM) as
// directed by the Index. A Judy array is referred to here as an "SM", rather
// than as a "tree"; having "states", rather than "levels".
//
// Each branch or leaf in the SM decodes a portion ("digit") of the original
// Index; with 256-way branches there are 8 bits per digit. There are 3 kinds
// of branches, called: Linear, Bitmap and Uncompressed, of which the first 2
// are compressed to contain no NULL entries.
//
// An Uncompressed branch has a 1.0 cache line fill cost to decode 8 bits of
// (digit, part of an Index), but it might contain many NULL entries, and is
// therefore inefficient with memory if lightly populated.
//
// A Linear branch has a ~1.75 cache line fill cost when at maximum population.
// A Bitmap branch has ~2.0 cache line fills. Linear and Bitmap branches are
src/judy-1.0.5/src/JudySL/JudySL.c view on Meta::CPAN
// the last level for the Index (LASTWORD_BY_LEN()), use JudyLPrev() instead of
// JudyLGet(), to exclude the initial Index. If this doesnt result in finding
// a previous Index, work back up the tree using JudyLPrev() at each higher
// level to search for a previous index word. Upon finding a previous index
// word, descend again if/as necessary, this time inclusively, to find and
// return the full previous Index.
//
// Also support shortcut leaves.
//
// Since this function is recursive and it also needs to know if its still
// looking for the original Index (to exclude it at the LASTWORD_BY_LEN()
// level) or for the remaining words of the previous Index (inclusive),
// actually call a subroutine that takes an additional parameter.
//
// See also the technical notes in JudySLDel() regarding the use of recursion
// rather than iteration.
PPvoid_t
JudySLPrev(Pcvoid_t PArray, uint8_t * Index, PJError_t PJError) // optional, for returning error info.
{
// Check for caller error (null pointer), or empty JudySL array:
if (Index == (uint8_t *) NULL)
{
JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX);
return (PPJERR);
}
if (PArray == (Pvoid_t)NULL)
return ((PPvoid_t) NULL);
// Do the search:
return (JudySLPrevSub(PArray, Index, /* original = */ 1,
STRLEN(Index), PJError));
} // JudySLPrev()
// ****************************************************************************
// J U D Y S L P R E V S U B
//
// This is the "engine" for JudySLPrev() that knows whether its still looking
// for the original Index (exclusive) or a neighbor index (inclusive), and that
// expects aligned and len to already be computed (only once). See the header
// comments for JudySLPrev().
static PPvoid_t
JudySLPrevSub(Pcvoid_t PArray, uint8_t * Index, int orig,
Word_t len, // bytes remaining.
PJError_t PJError) // optional, for returning error info.
{
Word_t indexword; // next word to find.
PPvoid_t PPValue; // from JudyL array.
src/judy-1.0.5/src/JudySL/JudySL.c view on Meta::CPAN
{
JLG(PPValue, PArray, indexword);
if (PPValue != (PPvoid_t) NULL)
{
// If a previous JudySLIns() ran out of memory partway down the tree, it left a
// null *PPValue; this is automatically treated as a dead-end (not a core dump
// or assertion; see version 1.25):
PPValue = JudySLPrevSub(*PPValue, Index + WORDSIZE,
/* original = */ 1,
len - WORDSIZE, PJError);
if (PPValue == PPJERR)
return (PPJERR); // propagate error.
if (PPValue != (PPvoid_t) NULL)
return (PPValue); // see above.
}
}
// Search for previous index word:
//
src/judy-1.0.5/src/JudySL/JudySL.c view on Meta::CPAN
// If a previous JudySLIns() ran out of memory partway down the tree, it left a
// null *PPValue; this is automatically treated as a dead-end (not a core dump
// or assertion; see version 1.25):
if (PPValue == (PPvoid_t) NULL)
return ((PPvoid_t) NULL); // no previous index word.
}
// FOUND PREVIOUS INDEX WORD:
//
// A previous (if original) or last (if subsequent) index word was located in
// the current JudyL array. Store it into the callers Index (string). Then
// if the found (previous) Index ends here, return its value area; otherwise do
// a subsequent search below this point, which should never fail unless the
// JudySL tree is corrupt, but this is detected at a lower level by the above
// assertion.
//
// Note: Treat Index as unaligned, even if it is aligned, to avoid writing
// past the end of allocated memory (in case its less than a whole number of
// words).
COPYWORDtoSTRING(Index, indexword); // copy next 4[8] bytes.
if (LASTWORD_BY_VALUE(indexword))
return (PPValue);
// If a previous JudySLIns() ran out of memory partway down the tree, it left a
// null *PPValue; this is automatically treated as a dead-end (not a core dump
// or assertion; see version 1.25):
return (JudySLPrevSub(*PPValue, Index + WORDSIZE, /* original = */ 0,
len - WORDSIZE, PJError));
} // JudySLPrevSub()
// ****************************************************************************
// J U D Y S L N E X T
//
// See the comments in JudySLPrev(), which is very similar.
//
// TBD: Could the two functions call a common engine function with various
// subfunctions and other constants specified?
src/judy-1.0.5/src/JudySL/JudySL.c view on Meta::CPAN
if (Index == (uint8_t *) NULL)
{
JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX);
return (PPJERR);
}
if (PArray == (Pvoid_t)NULL)
return ((PPvoid_t) NULL);
// Do the search:
return (JudySLNextSub(PArray, Index, /* original = */ 1,
STRLEN(Index), PJError));
} // JudySLNext()
// ****************************************************************************
// J U D Y S L N E X T S U B
//
// See the comments in JudySLPrevSub(), which is very similar.
static PPvoid_t
JudySLNextSub(Pcvoid_t PArray, uint8_t * Index, int orig,
src/judy-1.0.5/src/JudySL/JudySL.c view on Meta::CPAN
if (len > WORDSIZE) // not at end of Index.
{
JLG(PPValue, PArray, indexword);
if (PPValue != (PPvoid_t) NULL)
{
// If a previous JudySLIns() ran out of memory partway down the tree, it left a
// null *PPValue; this is automatically treated as a dead-end (not a core dump
// or assertion; see version 1.25):
PPValue = JudySLNextSub(*PPValue, Index + WORDSIZE,
/* original = */ 1,
len - WORDSIZE, PJError);
if (PPValue == PPJERR)
return (PPJERR); // propagate error.
if (PPValue != (PPvoid_t) NULL)
return (PPValue); // see above.
}
}
if ((PPValue = JudyLNext(PArray, &indexword, PJError)) == PPJERR)
{
src/judy-1.0.5/src/JudySL/JudySL.c view on Meta::CPAN
if (PPValue == (PPvoid_t) NULL)
return ((PPvoid_t) NULL); // no next index word.
}
COPYWORDtoSTRING(Index, indexword); // copy next 4[8] bytes
if (LASTWORD_BY_VALUE(indexword))
return (PPValue);
// If a previous JudySLIns() ran out of memory partway down the tree, it left a
// null *PPValue; this is automatically treated as a dead-end (not a core dump
// or assertion; see version 1.25):
return (JudySLNextSub(*PPValue, Index + WORDSIZE, /* original = */ 0,
len - WORDSIZE, PJError));
} // JudySLNextSub()
// ****************************************************************************
// J U D Y S L F I R S T
//
// Like JudyLFirst(), do a JudySLGet(), then if necessary a JudySLNext().
PPvoid_t
JudySLFirst(Pcvoid_t PArray, uint8_t * Index, PJError_t PJError) // optional, for returning error info.
src/judy-1.0.5/test/malloc-pre2.8a.c view on Meta::CPAN
The main declaration needed is the mallinfo struct that is returned
(by-copy) by mallinfo(). The SVID/XPG malloinfo struct contains a
bunch of fields that are not even meaningful in this version of
malloc. These fields are are instead filled by mallinfo() with
other numbers that might be of interest.
HAVE_USR_INCLUDE_MALLOC_H should be set if you have a
/usr/include/malloc.h file that includes a declaration of struct
mallinfo. If so, it is included; else an SVID2/XPG2 compliant
version is declared below. These must be precisely the same for
mallinfo() to work. The original SVID version of this struct,
defined on most systems with mallinfo, declares all fields as
ints. But some others define as unsigned long. If your system
defines the fields using a type of different width than listed here,
you must #include your system version and #define
HAVE_USR_INCLUDE_MALLOC_H.
*/
/* #define HAVE_USR_INCLUDE_MALLOC_H */
#ifdef HAVE_USR_INCLUDE_MALLOC_H