Commit 98e1bc25 authored by Antony T Curtis's avatar Antony T Curtis

Merge from mariadb-5.5-oqgraph3

parents 5649377b aa8e86ff
# - Try to find Judy
# Once done this will define
#
# JUDY_FOUND - system has Judy
# JUDY_INCLUDE_DIR - the Judy include directory
# JUDY_LIBRARIES - Link these to use Judy
# JUDY_DEFINITIONS - Compiler switches required for using Judy
IF (JUDY_INCLUDE_DIR AND JUDY_LIBRARIES)
SET(Judy_FIND_QUIETLY TRUE)
ENDIF (JUDY_INCLUDE_DIR AND JUDY_LIBRARIES)
FIND_PATH(JUDY_INCLUDE_DIR Judy.h)
FIND_LIBRARY(JUDY_LIBRARIES NAMES Judy)
IF (JUDY_INCLUDE_DIR AND JUDY_LIBRARIES)
SET(JUDY_FOUND TRUE)
ELSE (JUDY_INCLUDE_DIR AND JUDY_LIBRARIES)
SET(JUDY_FOUND FALSE)
ENDIF (JUDY_INCLUDE_DIR AND JUDY_LIBRARIES)
IF (JUDY_FOUND)
IF (NOT Judy_FIND_QUIETLY)
MESSAGE(STATUS "Found libjudy: ${JUDY_LIBRARIES}")
ENDIF (NOT Judy_FIND_QUIETLY)
ELSE (JUDY_FOUND)
IF (Judy_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could NOT find libjudy")
ENDIF (Judy_FIND_REQUIRED)
ENDIF (JUDY_FOUND)
MARK_AS_ADVANCED(JUDY_INCLUDE_DIR JUDY_LIBRARIES)
FIND_PACKAGE(Boost 1.40.0) MESSAGE(STATUS "Configuring OQGraph")
FIND_PACKAGE(Boost)
IF(NOT Boost_FOUND) IF(NOT Boost_FOUND)
MESSAGE(STATUS "Boost not found")
RETURN() RETURN()
ENDIF() ENDIF()
INCLUDE_DIRECTORIES(BEFORE ${Boost_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(BEFORE ${Boost_INCLUDE_DIRS})
FIND_PACKAGE(JUDY)
IF(NOT JUDY_FOUND)
MESSAGE(STATUS "Judy not found")
RETURN()
ENDIF()
INCLUDE_DIRECTORIES(${JUDY_INCLUDE_DIR})
IF(MSVC) IF(MSVC)
# lp:756966 OQGRAPH on Win64 does not compile # lp:756966 OQGRAPH on Win64 does not compile
IF (CMAKE_SIZEOF_VOID_P EQUAL 8) IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
...@@ -33,4 +42,6 @@ IF(BOOST_OK) ...@@ -33,4 +42,6 @@ IF(BOOST_OK)
MYSQL_ADD_PLUGIN(oqgraph ha_oqgraph.cc graphcore.cc STORAGE_ENGINE MYSQL_ADD_PLUGIN(oqgraph ha_oqgraph.cc graphcore.cc STORAGE_ENGINE
MODULE_ONLY) MODULE_ONLY)
ELSE(BOOST_OK)
MESSAGE(STATUS "Requisites for OQGraph not met")
ENDIF(BOOST_OK) ENDIF(BOOST_OK)
Doug Baskinks
Owner and Main Author
Contributors:
Troy Heber:
Repackaging
Project Administration
1.0.4 Version (May 2007) by (twh)
o fixed the Checkit problem "error Judy1PrevEmpty Rcode != 1 = 0"
o Fixed memory allignment in JudyMallocIF.c (doug)
o Fixed messages from "make check" (doug).
1.0.3 Version (Feb 2006 ) by (twh)
o fixed make files to break out each copy element
to be a unique target, this also seems to have
resolved the issue where running make check rebuilds
the entire library again.
1.0.2 Version (Jan 2006 ) by (twh)
o fixed assumption of signed char in test programs.
o updated sh_build
o fixed generation of man pages from html
o fixed 32-bit and 64-bit configure
1.0.1 Version (Dec 2004) by (twh)
o fixed bootstrap to use later versions
o fixed manpage naming from (3X) to (3)
o Code changes to support Microsoft __inline directive
o Move away from using symlinks to using copies
o Added build.bat to support building on Windows
1.0.0 Version (Sept 2004) by (twh)
o Complete Autoconfisication of Judy
o Removed previous build environment
o Change INSTALL_IT back to INSTALL
o Moving to 1.0.0 to denote API change.
0.1.6 Version (1June2004) by (dlb)
o See src/sh_build in case of 'make' failures
o The is an endian-neutral version I.E. (jp_DcdPop0 deleted)
o Should not require any special platform specific compile flags
o Includes JudyHS*() -- very fast, scalable string version
o JudyHS*() is still preliminary and may need additional functionality.
o See test/manual/StringCompare.c for comparing different 'string' ADT's
o Deleted files: JudyMalloc.h, JudySL.h, JudySearch*
o All malloc() and free() is done thru interface routines in JudyMalloc.c
o Judy.h should work on all platforms that conform to ISO standards.
o After trying on many platforms, <stdint.h> was changed to <inttypes.h>
o jbgraph has some 'bash/ksh' isms that need to be removed.
o See test/manual/testjbgraph for plotting performance graphs
o 'libtools' stuff is in unknown shape.
o Does not "mangle" the root pointer (so old valgrind is not confused)
o Conform to standard "C"
o Change INSTALL to INSTALL_IT because it confused "make install"
o To he man pages need work to clean up the .html to be portable
o Plus hundreds of changes to make the source more portable.
=== QUICK INSTALLATION OF JUDY LIBRARY AND MANUAL ENTRIES ===
1. ./configure #NOTE: you must do configure with either
--enable-32-bit or --enable-64-bit
depending on your system. Also note if you
are doing a non-native compile you are
responsiable for setting the appropriate
CFLAGS. See README for more information.
2. make
3. make check
4. make install # NOTE: must be SUPERUSER for make install
# This installs /opt/Judy/* and symlinks to
# files there from /usr/include/, /usr/lib/,
# /usr/share/man/, and /usr/share/doc/Judy/.
(Installation done! The rest is optional but recommended.)
5) man Judy # nroff -man version, or...
6) file:/opt/Judy/usr/share/doc/Judy/Judy_3x.htm # from LOCAL Web browser.
# Tell automake we don't want to comply with every last clause in the
# GNU Maintainer's Manual.
AUTOMAKE_OPTIONS = foreign
# We need to build the following subdirectories in this order. Note that
# we put a Makefile.am in every subdirectory, even if there's nothing to
# 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
Judy - C library creating and accessing dynamic arrays
==============================================================
Content
---------
1. Introduction
2. Directory Contents
3. How to install
4. License
5. Change History
6. Reporting Bugs
7. Known Issues
1. INTRODUCTION
-----------------
This tree contains sources, documents, tests, and tools for the Judy package.
This file is in a form that can be validated using the tool/readme script.
NOTE: The README files here describe some files that are not included in
every Judy source package.
WHAT IS JUDY? (see below for list of top-level directories and files)
Judy is a C library that implements a dynamic array. Empty Judy arrays are
declared with null pointers. A Judy array consumes memory only when
populated yet can grow to take advantage of all available memory. Judy's key
benefits are: scalability, performance, memory efficiency, and ease of use.
Judy arrays are designed to grow without tuning into the peta-element range,
scaling near O(log-base-256) -- 1 more RAM access at 256 X population.
Judy arrays are accessed with insert, retrieve, and delete calls for number
or string indexes. Configuration and tuning are not required -- in fact not
possible. Judy offers sorting, counting, and neighbor/empty searching.
Indexes can be sequential, clustered, periodic, or random -- it doesn't
matter to the algorithm. Judy arrays can be arranged hierarchically to
handle any bit patterns -- large indexes, sets of keys, etc.
Judy is often an improvement over common data structures such as: arrays,
sparse arrays, hash tables, B-trees, binary trees, linear lists, skiplists,
other sort and search algorithms, and counting functions.
2. JUDY TOP DIRECTORY CONTENTS:
--------------------------------
AUTHORS Judy authors and contributors
README This file.
INSTALL Summary instructions to build, check and install Judy.
COPYING Judy deliverable license notice (the LGPL).
ChangeLog List of changes per version of Judy.
configure Autoconf configure script to allow a portable build e
environment.
src/ Header and source files used to build the package.
doc/ Documents, both external (to the package) and internal.
test/ Test support and some timing programs.
tool/ Primitive tool (jhton) to convert *.html files to "man" pages.
and build tables used by Judy to malloc() sizes of memory.
3. HOW TO INSTALL
-----------------
For a quick description see the INSTALL file.
Judy is now based on the GNU Auto tools. This means that you can do the standard
configure, make, make check and make install and everything should work, with
one minor differnece and a little caviot.
Judy is capiable of being built as a 32-bit or a 64-bit library. Therefor you
need to tell Judy what you want. You MUST run configure with one of the
following flags:
--enable-32-bit
--enable-64-bit
If your compiler generates 32-bit code by default, such as x86, and you run
configure with --enable-32-bit, your done. You can now run make, make check and
make install.
If your compiler generates 64-bit code by default, such as Linux IA-64, and you
run configure with --enable-64-bit, your done. You can now run make, make check
and make install.
The caviot comes in on machines that support both at 32-bit and 64-bit runtime
environments such as RISC platforms and x86-64. In this case your compiler will
either use 32-bit or 64-bit as default. If you plan to use the default you can
follow the above instructions and be finished.
However, if you wish to compile for the non-default target type. YOU ARE
RESPONSIABLE FOR SETTING THE CORRECT FLAGS! Such as CFLAGS to make your compiler
switch modes LDFLAGS to make your linker behave, etc.
For example: On HP-UX PA-RISC the compiler generates 32-bit code by default. If
I wish to stick with the defautls I can build Judy by:
./configure --enable-32-bit
make
make check
make install
If I want to build Judy as a 64-bit library on HP-UX PA-RISC I have to do:
CFLAGS=+DD64 ./configure --enable-64-bit
make
make check
make install
4. LICENSE
----------
The user library is licensed under the GNU Lesser Public License (LGPL)
Version 2.1, February 1999. The full text of the LGPL is located at:
COPYING
5. CHAGE HISTORY
----------------
See the ChangeLog file.
6. REPORTING BUGS
-----------------
If you encounter a bug, please submit it to the project bug list,
located on the project page:
https://sourceforge.net/projects/judy/
7. KNOWN ISSUES
---------------
When compiling on HP-UX, you may get a message like:
error 1000: Unexpected symbol:
This is a problem with the HP's compiler in that it doesn't like a typedef'ed
type following a static inline.
You can work around it by running this command from the Judy directory.
find ./ -name \*.[ch] | xargs perl -i.BAK -pe 's/static inline/static/g'
This diff is collapsed.
#! /bin/sh
set -x
libtoolize --force --copy
#aclocal-1.9
aclocal
#autoheader2.50
autoheader
#add --include-deps if you want to bootstrap with any other compiler than gcc
#automake --add-missing --copy --include-deps
automake-1.9 --add-missing --force --copy
#autoconf2.50
autoconf
rm -f config.cache
This diff is collapsed.
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
#undef HAVE_DOPRNT
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#undef HAVE_MALLOC
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define to 1 if you have the `munmap' function. */
#undef HAVE_MUNMAP
/* Define to 1 if you have the `pow' function. */
#undef HAVE_POW
/* Define to 1 if the system has the type `ptrdiff_t'. */
#undef HAVE_PTRDIFF_T
/* Define to 1 if `stat' has the bug that it succeeds when given the
zero-length file name argument. */
#undef HAVE_STAT_EMPTY_STRING_BUG
/* Define to 1 if stdbool.h conforms to C99. */
#undef HAVE_STDBOOL_H
/* Define to 1 if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strchr' function. */
#undef HAVE_STRCHR
/* Define to 1 if you have the `strcspn' function. */
#undef HAVE_STRCSPN
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strstr' function. */
#undef HAVE_STRSTR
/* Define to 1 if you have the `strtoul' function. */
#undef HAVE_STRTOUL
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the `uname' function. */
#undef HAVE_UNAME
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `vprintf' function. */
#undef HAVE_VPRINTF
/* Define to 1 if the system has the type `_Bool'. */
#undef HAVE__BOOL
/* Define to 1 on little-endian systems. */
#undef JU_LITTLE_ENDIAN
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of `void *', as computed by sizeof. */
#undef SIZEOF_VOID_P
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME
/* Version number of package */
#undef VERSION
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif
/* Define to rpl_malloc if the replacement function should be used. */
#undef malloc
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
/* Define to empty if the keyword `volatile' does not work. Warning: valid
code using `volatile' can become incorrect without. Disable with care. */
#undef volatile
This diff is collapsed.
AC_PREREQ(2.57)
AC_INIT(Judy, 1.0.0, doug@sourcejudy.com)
AM_MAINTAINER_MODE
dnl Turn on automake, and pass it the PACKAGE_NAME and PACKAGE_VERSION, too.
AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION)
dnl Tell autoconf we want to keep our preprocessor defines in a header named
dnl config.h. This keeps automake from passing a zillion -D directives to
dnl the C compiler.
AM_CONFIG_HEADER([config.h])
dnl==========================================================================
dnl WARNING - WARNING - Shared Library Versioning - WARNING - WARNING
dnl==========================================================================
dnl This is the most dangerous part of this file--making a mistake here can
dnl cause massively painful chaos for libJudy developers, and potentially
dnl even end users. So PLEASE pay attention, and read up on the theory of
dnl shared library versioning. Tens of thousands of Linux users (and several
dnl QA departments) may thank you someday.
dnl
dnl There are two major concerns:
dnl
dnl 1) When changing the libJudy ABI (application binary interface),
dnl VERSION_INFO *must* be updated according to libtool's rules. Failure
dnl to do this will make applications using libJudy dump core, typically
dnl under obscure conditions on user systems. I won't attempt to
dnl explain these rules here; please see 'info libtool' for details.
dnl
dnl 2) When changing the libJudy ABI, it is also desirable to make libJudy
dnl "parallel installable". This means that it should be possible to
dnl install development headers and libraries for more than one version
dnl of libJudy at once. Failure to do this may cause problems for
dnl Linux distributions which include libJudy. (For example, it's
dnl impossible to switch between libpng2-dev and libpng3-dev on a
dnl Debian system without uninstalling and reinstalling both the Gnome
dnl and KDE SDKs.) For more information, do a Google search for
dnl "parallel installable".
dnl
dnl Right now, this package only provides the mechanisms to handle concern
dnl (1). Concern (2) is slightly more complicated, and will require some
dnl careful thinking. Fortunately, concern (2) doesn't become important
dnl until other SDKs rely on the libJudy SDK.
dnl
dnl Of course, it's safe to avoid changing the libJudy ABI. :-)
dnl
dnl The version scheme used by Libtool tracks interfaces, where an interface is
dnl the set of exported entry points into the library. All Libtool libraries
dnl start with -version-info set to 0:0:0 - this will be the default version
dnl number if you don't explicitly set it on the Libtool link command line. The
dnl meaning of these numbers (from left to right) is as follows:
dnl
dnl current:
dnl The number of the current interface exported by the library. A current
dnl value of 0, means that you are calling the interface exported by this
dnl library interface 0.
dnl
dnl revision:
dnl The implementation number of the most recent interface exported by this
dnl library. In this case, a revision value of 0 means that this is the
dnl first implementation of the interface.
dnl
dnl If the next release of this library exports the same interface, but has
dnl different implementation (perhaps some bugs have been fixed), the
dnl revision number will be higher, but current number will be the same. In
dnl that case, when given a choice, the library with the highest revision
dnl will always be used by the runtime loader.
dnl
dnl age:
dnl The number of previous additional interfaces supported by this library.
dnl If age were 2, then this library can be linked into executables which
dnl were built with a release of this library that exported the current
dnl interface number, current, or any of the previous two interfaces.
dnl
dnl By definition age must be less than or equal to current. At the outset, only
dnl the first ever interface is implemented, so age can only be 0.
dnl
VERSION_INFO="-version-info 1:3:0"
AC_SUBST(VERSION_INFO)
dnl==========================================================================
dnl Flavors
dnl==========================================================================
dnl Judy can be compiled in one of three flavors: "product" (the default),
dnl "debug", or "cov". We allow the user to select flavors using
dnl --enable-debug and --enable-ccover arguments to automake, which is
dnl the typical way of doing things.
dnl
dnl Note how we perform string comparison:
dnl
dnl if test "x$enable_debug" = xyes; then
dnl
dnl We do several odd things here:
dnl
dnl 1) We use 'test' instead of '[ ]' for shell portability.
dnl 2) We prefix strings with 'x' when comparing them, to protect against
dnl empty strings.
dnl 3) We ALWAYS quote user-supplied shell variables, to protect against
dnl embedded spaces.
dnl
dnl The results of this test aren't used anywhere yet.
dnl Keep the user entertained.
AC_MSG_CHECKING(which flavor to build)
dnl Process our --enable-debug argument.
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug],
[enable debugging features]),
, enable_debug=no)
if test "x$enable_debug" != xyes -a "x$enable_debug" != xno; then
AC_MSG_ERROR(You may not pass an argument to --enable-debug)
fi
dnl Process our --enable-ccover argument.
AC_ARG_ENABLE(ccover,
AC_HELP_STRING([--enable-ccover],
[enable use of ccover code coverage tools]),
, enable_ccover=no)
if test "x$enable_ccover" != xyes -a "x$enable_ccover" != xno; then
AC_MSG_ERROR(You may not pass an argument to --enable-ccover)
fi
dnl Determine our flavor.
if test "x$enable_debug" = xyes -a "x$enable_ccover" = xyes; then
AC_MSG_ERROR(You may not use --enable-debug and --enable-ccover together)
elif test "x$enable_debug" = xyes; then
FLAVOR=debug
elif test "x$enable_ccover" = xyes; then
FLAVOR=cov
else
FLAVOR=product
fi
dnl Define FLAVOR in our makefiles.
AC_SUBST(FLAVOR)
dnl Tell the user what flavor we've decided to build.
AC_MSG_RESULT($FLAVOR)
dnl==========================================================================
dnl Checks for Programs
dnl==========================================================================
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
dnl==========================================================================
dnl Checks for Header Files
dnl==========================================================================
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stddef.h stdint.h stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h])
dnl==========================================================================
dnl Checks for Typedefs, Structures, and Compiler Characteristics
dnl==========================================================================
dnl Standard, boring stuff.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_C_VOLATILE
AC_CHECK_TYPES([ptrdiff_t])
dnl If we're compiling for a little-endian system, define JU_LITTLE_ENDIAN.
dnl If we can't tell what kind of system we're compling for, alert the
dnl user as described in 'info autoconf'.
AC_C_BIGENDIAN(, AC_DEFINE(JU_LITTLE_ENDIAN, 1,
[Define to 1 on little-endian systems.]))
dnl Figure out if we are 32-bit or 64-bit (LP64)
AC_CHECK_SIZEOF(void *)
if test "$ac_cv_sizeof_void_p" = 8; then
AC_MSG_RESULT(Building 64-bit)
CFLAGS="-DJU_64BIT $CFLAGS"
else
AC_MSG_RESULT(Building 32-bit)
CFLAGS="-UJU_64BIT $CFLAGS"
fi
# dnl Determine whether or not we're compiling for a 64-bit system by looking
# dnl at the size of a 'long'. This will define SIZEOF_LONG in config.h. We
# dnl append some text to the bottom of config.h to set JU_64BIT appropriately.
# dnl we try to do the correct thing if the user doesn't chose for us.
# AC_CHECK_SIZEOF(long)
# AH_BOTTOM([/* Define JU_64BIT to 1 if we're on a 64-bit system. */
# if SIZEOF_LONG == 8
# define JU_64BIT 1
# endif])
#fi
dnl==========================================================================
dnl Checks for Libraries
dnl==========================================================================
AC_FUNC_ERROR_AT_LINE
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_STAT
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([getpagesize gettimeofday memset munmap pow strchr strcspn strerror strstr strtoul uname])
dnl These must be called before AM_PROG_LIBTOOL, because it may want
dnl to call AC_CHECK_PROG.
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(LD, ld)
AC_CHECK_TOOL(RANLIB, ranlib, :)
dnl Checks for libtool - this must be done after we set cflags (abi issues)
dnl
AM_PROG_LIBTOOL
WARN_CFLAGS=""
build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
AC_ARG_ENABLE([build-warnings],
[ --enable-build-warnings Enable build-time compiler warnings for gcc])
if test x"$build_warnings" = xyes; then
if test x"$GCC" = xyes; then
WARN_CFLAGS="${build_warnings}"
fi
fi
AC_SUBST(WARN_CFLAGS)
AC_CONFIG_FILES([Makefile
src/Judy1/Makefile
src/JudyCommon/Makefile
src/JudyHS/Makefile
src/JudyL/Makefile
src/JudySL/Makefile
src/Makefile
src/obj/Makefile
tool/Makefile
doc/Makefile
test/Makefile])
AC_OUTPUT
man3_MANS = man/man3/Judy \
man/man3/Judy1 \
man/man3/Judy1_funcs \
man/man3/JudyL \
man/man3/JudyL_funcs \
man/man3/JudySL \
man/man3/JudySL_funcs \
man/man3/JudyHS \
man/man3/JudyHS_funcs \
man/man3/J1T \
man/man3/J1S \
man/man3/J1U \
man/man3/J1F \
man/man3/J1N \
man/man3/J1L \
man/man3/J1P \
man/man3/J1FE \
man/man3/J1NE \
man/man3/J1LE \
man/man3/J1PE \
man/man3/J1C \
man/man3/J1BC \
man/man3/J1FA \
man/man3/J1MU \
man/man3/Judy1Test \
man/man3/Judy1Set \
man/man3/Judy1Unset \
man/man3/Judy1First \
man/man3/Judy1Next \
man/man3/Judy1Last \
man/man3/Judy1Prev \
man/man3/Judy1FirstEmpty \
man/man3/Judy1NextEmpty \
man/man3/Judy1LastEmpty \
man/man3/Judy1PrevEmpty \
man/man3/Judy1Count \
man/man3/Judy1ByCount \
man/man3/Judy1FreeArray \
man/man3/Judy1MemUsed \
man/man3/JudyL \
man/man3/JLG \
man/man3/JLI \
man/man3/JLD \
man/man3/JLF \
man/man3/JLN \
man/man3/JLL \
man/man3/JLP \
man/man3/JLFE \
man/man3/JLNE \
man/man3/JLLE \
man/man3/JLPE \
man/man3/JLC \
man/man3/JLBC \
man/man3/JLFA \
man/man3/JLMU \
man/man3/JudyLGet \
man/man3/JudyLIns \
man/man3/JudyLDel \
man/man3/JudyLFirst \
man/man3/JudyLNext \
man/man3/JudyLLast \
man/man3/JudyLPrev \
man/man3/JudyLFirstEmpty \
man/man3/JudyLNextEmpty \
man/man3/JudyLLastEmpty \
man/man3/JudyLPrevEmpty \
man/man3/JudyLCount \
man/man3/JudyLByCount \
man/man3/JudyLFreeArray \
man/man3/JudyLMemUsed \
man/man3/JSLG \
man/man3/JSLI \
man/man3/JSLD \
man/man3/JSLF \
man/man3/JSLN \
man/man3/JSLL \
man/man3/JSLP \
man/man3/JSLFA \
man/man3/JudySLGet \
man/man3/JudySLIns \
man/man3/JudySLDel \
man/man3/JudySLFirst \
man/man3/JudySLNext \
man/man3/JudySLLast \
man/man3/JudySLPrev \
man/man3/JudySLFreeArray \
man/man3/JHSG \
man/man3/JHSI \
man/man3/JHSD \
man/man3/JHSFA \
man/man3/JudyHSGet \
man/man3/JudyHSIns \
man/man3/JudyHSDel \
man/man3/JudyHSFreeArray
man/man3/Judy: ext/Judy_3.htm
-mkdir -p $(@D)
../tool/jhton $< | grep -v '^[ ]*$$' | sed -e 's/\.C//' > $@
man/man3/Judy1: ext/Judy1_3.htm
-mkdir -p $(@D)
../tool/jhton $< | grep -v '^[ ]*$$' | sed -e 's/\.C//' > $@
cd man/man3; ln -s Judy J1T
cd man/man3; ln -s Judy J1S
cd man/man3; ln -s Judy J1U
cd man/man3; ln -s Judy J1F
cd man/man3; ln -s Judy J1N
cd man/man3; ln -s Judy J1L
cd man/man3; ln -s Judy J1P
cd man/man3; ln -s Judy J1FE
cd man/man3; ln -s Judy J1NE
cd man/man3; ln -s Judy J1LE
cd man/man3; ln -s Judy J1PE
cd man/man3; ln -s Judy J1C
cd man/man3; ln -s Judy J1BC
cd man/man3; ln -s Judy J1FA
cd man/man3; ln -s Judy J1MU
man/man3/Judy1_funcs: ext/Judy1_funcs_3.htm
-mkdir -p $(@D)
../tool/jhton $< | grep -v '^[ ]*$$' | sed -e 's/\.C//' > $@
cd man/man3; ln -s Judy1_funcs Judy1Test
cd man/man3; ln -s Judy1_funcs Judy1Set
cd man/man3; ln -s Judy1_funcs Judy1Unset
cd man/man3; ln -s Judy1_funcs Judy1First
cd man/man3; ln -s Judy1_funcs Judy1Next
cd man/man3; ln -s Judy1_funcs Judy1Last
cd man/man3; ln -s Judy1_funcs Judy1Prev
cd man/man3; ln -s Judy1_funcs Judy1FirstEmpty
cd man/man3; ln -s Judy1_funcs Judy1NextEmpty
cd man/man3; ln -s Judy1_funcs Judy1LastEmpty
cd man/man3; ln -s Judy1_funcs Judy1PrevEmpty
cd man/man3; ln -s Judy1_funcs Judy1Count
cd man/man3; ln -s Judy1_funcs Judy1ByCount
cd man/man3; ln -s Judy1_funcs Judy1FreeArray
cd man/man3; ln -s Judy1_funcs Judy1MemUsed
man/man3/JudyL: ext/JudyL_3.htm
-mkdir -p $(@D)
../tool/jhton $< | grep -v '^[ ]*$$' | sed -e 's/\.C//' > $@
cd man/man3; ln -s JudyL JLG
cd man/man3; ln -s JudyL JLI
cd man/man3; ln -s JudyL JLD
cd man/man3; ln -s JudyL JLF
cd man/man3; ln -s JudyL JLN
cd man/man3; ln -s JudyL JLL
cd man/man3; ln -s JudyL JLP
cd man/man3; ln -s JudyL JLFE
cd man/man3; ln -s JudyL JLNE
cd man/man3; ln -s JudyL JLLE
cd man/man3; ln -s JudyL JLPE
cd man/man3; ln -s JudyL JLC
cd man/man3; ln -s JudyL JLBC
cd man/man3; ln -s JudyL JLFA
cd man/man3; ln -s JudyL JLMU
man/man3/JudyL_funcs: ext/JudyL_funcs_3.htm
-mkdir -p $(@D)
../tool/jhton $< | grep -v '^[ ]*$$' | sed -e 's/\.C//' > $@
cd man/man3; ln -s JudyL_funcs JudyLGet
cd man/man3; ln -s JudyL_funcs JudyLIns
cd man/man3; ln -s JudyL_funcs JudyLDel
cd man/man3; ln -s JudyL_funcs JudyLFirst
cd man/man3; ln -s JudyL_funcs JudyLNext
cd man/man3; ln -s JudyL_funcs JudyLLast
cd man/man3; ln -s JudyL_funcs JudyLPrev
cd man/man3; ln -s JudyL_funcs JudyLFirstEmpty
cd man/man3; ln -s JudyL_funcs JudyLNextEmpty
cd man/man3; ln -s JudyL_funcs JudyLLastEmpty
cd man/man3; ln -s JudyL_funcs JudyLPrevEmpty
cd man/man3; ln -s JudyL_funcs JudyLCount
cd man/man3; ln -s JudyL_funcs JudyLByCount
cd man/man3; ln -s JudyL_funcs JudyLFreeArray
cd man/man3; ln -s JudyL_funcs JudyLMemUsed
man/man3/JudySL: ext/JudySL_3.htm
-mkdir -p $(@D)
../tool/jhton $< | grep -v '^[ ]*$$' | sed -e 's/\.C//' > $@
cd man/man3; ln -s JudySL JSLG
cd man/man3; ln -s JudySL JSLI
cd man/man3; ln -s JudySL JSLD
cd man/man3; ln -s JudySL JSLF
cd man/man3; ln -s JudySL JSLN
cd man/man3; ln -s JudySL JSLL
cd man/man3; ln -s JudySL JSLP
cd man/man3; ln -s JudySL JSLFA
man/man3/JudySL_funcs: ext/JudySL_funcs_3.htm
-mkdir -p $(@D)
../tool/jhton $< | grep -v '^[ ]*$$' | sed -e 's/\.C//' > $@
cd man/man3; ln -s JudySL_funcs JudySLGet
cd man/man3; ln -s JudySL_funcs JudySLIns
cd man/man3; ln -s JudySL_funcs JudySLDel
cd man/man3; ln -s JudySL_funcs JudySLFirst
cd man/man3; ln -s JudySL_funcs JudySLNext
cd man/man3; ln -s JudySL_funcs JudySLLast
cd man/man3; ln -s JudySL_funcs JudySLPrev
cd man/man3; ln -s JudySL_funcs JudySLFreeArray
man/man3/JudyHS: ext/JudyHS_3.htm
-mkdir -p $(@D)
../tool/jhton $< | grep -v '^[ ]*$$' | sed -e 's/\.C//' > $@
cd man/man3; ln -s JudyHS JHSG
cd man/man3; ln -s JudyHS JHSI
cd man/man3; ln -s JudyHS JHSD
cd man/man3; ln -s JudyHS JHSFA
man/man3/JudyHS_funcs: ext/JudyHS_funcs_3.htm
-mkdir -p $(@D)
../tool/jhton $< | grep -v '^[ ]*$$' | sed -e 's/\.C//' > $@
cd man/man3; ln -s JudyHS_funcs JudyHSGet
cd man/man3; ln -s JudyHS_funcs JudyHSIns
cd man/man3; ln -s JudyHS_funcs JudyHSDel
cd man/man3; ln -s JudyHS_funcs JudyHSFreeArray
This diff is collapsed.
<HTML>
<HEAD>
<!-- @(#) $Revision: 4.8 $ $Source: /cvsroot/judy/doc/ext/Judy1_funcs_3.htm,v $ --->
<TITLE>Judy1_funcs(3)</TITLE>
</HEAD>
<BODY>
<TABLE border=0 width="100%"><TR>
<TD width="40%" align="left">Judy1_funcs(3)</TD>
<TD width="10%" align="center"> </TD>
<TD width="40%" align="right">Judy1_funcs(3)</TD>
</TR></TABLE>
<P>
<DL>
<!----------------->
<DT><B>NAME</B></DT>
<DD>
Judy1 functions -
C library for creating and accessing a dynamic array of bits, using
any value of a word as an index
<!----------------->
<P>
<DT><B>SYNOPSIS</B></DT>
<DD>
<B><PRE>
int <A href="#Judy1Set" >Judy1Set</A>( PPvoid_t PPJ1Array, Word_t Index, PJError_t PJError);
int <A href="#Judy1Unset" >Judy1Unset</A>( PPvoid_t PPJ1Array, Word_t Index, PJError_t PJError);
int <A href="#Judy1Test" >Judy1Test</A>( Pcvoid_t PJ1Array, Word_t Index, PJError_t PJError);
Word_t <A href="#Judy1Count" >Judy1Count</A>( Pcvoid_t PJ1Array, Word_t Index1, Word_t Index2, PJError_t PJError);
int <A href="#Judy1ByCount" >Judy1ByCount</A>( Pcvoid_t PJ1Array, Word_t Nth, Word_t * PIndex, PJError_t PJError);
Word_t <A href="#Judy1FreeArray" >Judy1FreeArray</A>( PPvoid_t PPJ1Array, PJError_t PJError);
Word_t <A href="#Judy1MemUsed" >Judy1MemUsed</A>( Pcvoid_t PJ1Array);
int <A href="#Judy1First" >Judy1First</A>( Pcvoid_t PJ1Array, Word_t * PIndex, PJError_t PJError);
int <A href="#Judy1Next" >Judy1Next</A>( Pcvoid_t PJ1Array, Word_t * PIndex, PJError_t PJError);
int <A href="#Judy1Last" >Judy1Last</A>( Pcvoid_t PJ1Array, Word_t * PIndex, PJError_t PJError);
int <A href="#Judy1Prev" >Judy1Prev</A>( Pcvoid_t PJ1Array, Word_t * PIndex, PJError_t PJError);
int <A href="#Judy1FirstEmpty">Judy1FirstEmpty</A>(Pcvoid_t PJ1Array, Word_t * PIndex, PJError_t PJError);
int <A href="#Judy1NextEmpty" >Judy1NextEmpty</A>( Pcvoid_t PJ1Array, Word_t * PIndex, PJError_t PJError);
int <A href="#Judy1LastEmpty" >Judy1LastEmpty</A>( Pcvoid_t PJ1Array, Word_t * PIndex, PJError_t PJError);
int <A href="#Judy1PrevEmpty" >Judy1PrevEmpty</A>( Pcvoid_t PJ1Array, Word_t * PIndex, PJError_t PJError);
</PRE></B>
<!----------------->
<P>
<DT><B>DESCRIPTION</B></DT>
<DD>
A macro equivalent exists for each function call.
Because the macro forms are sometimes faster and have a simpler error
handling interface than the equivalent functions,
they are the preferred way of calling the Judy1 functions.
See <A href="Judy1_3.htm">Judy1(3)</A>
for more information.
The function call definitions are included here for completeness.
<P>
One of the difficulties in using the Judy1 function calls lies in
determining whether to pass a pointer or the address of a pointer.
Since the functions that modify the Judy1 array must also modify the
pointer to the Judy1 array, you must pass the address of the pointer
rather than the pointer itself.
This often leads to hard-to-debug programmatic errors.
In practice, the macros allow the compiler to catch programming
errors when pointers instead of addresses of pointers are passed.
<P>
The Judy1 function calls have an additional parameter beyond
those specified in the macro calls. This parameter is either a
pointer to an error structure, or <B>NULL</B> (in which case the
detailed error information is not returned).
<P>
In the following descriptions, the functions are described in
terms of how the macros use them (only in the case of
<B>#define JUDYERROR_NOTEST 1</B>). This is the suggested use
of the macros after your program has been fully debugged.
When the <B>JUDYERROR_NOTEST</B> macro is not specified,
an error structure is declared to store error information
returned from the Judy1 functions when an error occurs.
<P>
Notice the placement of the <B>&amp;</B> in the different functions.
<P>
<DL>
<DT><A name="Judy1Set"><B>Judy1Set(&amp;PJ1Array, Index, &amp;JError)</B></A></DT>
<DD>
<PRE>
#define J1S(Rc_int, PJ1Array, Index) \
Rc_int = Judy1Set(&amp;PJ1Array, Index, PJE0)
</PRE>
<P>
<DT><A name="Judy1Unset"><B>Judy1Unset(&amp;PJ1Array, Index, &amp;JError)</B></A></DT>
<DD>
<PRE>
#define J1U(Rc_int, PJ1Array, Index) \
Rc_int = Judy1Unset(&amp;PJ1Array, Index, PJE0)
</PRE>
<P>
<DT><A name="Judy1Test"><B>Judy1Test(PJ1Array, Index, &amp;JError)</B></A></DT>
<DD>
<PRE>
#define J1T(Rc_int, PJ1Array, Index) \
Rc_int = Judy1Test(PJ1Array, Index, PJE0)
</PRE>
<P>
<DT><A name="Judy1Count"><B>Judy1Count(PJ1Array, Index1, Index2, &amp;JError)</B></A></DT>
<DD>
<PRE>
#define J1C(Rc_word, PJ1Array, Index1, Index2) \
Rc_word = Judy1Count(PJ1Array, Index1, Index2, PJE0)
</PRE>
A return value of 0 can be an error, valid as a count, or it can indicate a special case
for a fully-populated array (32-bit machines only). If necessary, the following
code can be used to disambiguate this return:
<PRE>
JError_t JError;
Rc_word = Judy1Count(PJ1Array, Index1, Index2, &amp;JError);
if (Rc_word == 0)
{
if (JU_ERRNO(&amp;JError) == JU_ERRNO_NONE)
printf("Judy1 array population == 0\n");
if (JU_ERRNO(&amp;JError) == JU_ERRNO_FULL)
printf("Judy1 array population == 2^32\n");
if (JU_ERRNO(&amp;JError) == JU_ERRNO_NULLPPARRAY)
goto NullArray;
if (JU_ERRNO(&amp;JError) > JU_ERRNO_NFMAX)
goto Null_or_CorruptArray;
}
</PRE>
<P>
<DT><A name="Judy1ByCount"><B>Judy1ByCount(PJ1Array, Nth, &amp;Index, &amp;JError)</B></A></DT>
<DD>
<PRE>
#define J1BC(Rc_int, PJ1Array, Nth, Index) \
Rc_int = Judy1ByCount(PJ1Array, Nth, &amp;Index, PJE0)
</PRE>
<P>
<DT><A name="Judy1FreeArray"><B>Judy1FreeArray(&amp;PJ1Array, &amp;JError)</B></A></DT>
<DD>
<PRE>
#define J1FA(Rc_word, PJ1Array) \
Rc_word = Judy1FreeArray(&amp;PJ1Array, PJE0)
</PRE>
<P>
<DT><A name="Judy1MemUsed"><B>Judy1MemUsed(PJ1Array)</B></A></DT>
<DD>
<PRE>
#define J1MU(Rc_word, PJ1Array) \
Rc_word = Judy1MemUsed(PJ1Array)
</PRE>
<P>
<DT><A name="Judy1First"><B>Judy1First(PJ1Array, &amp;Index, &amp;JError)</B></A></DT>
<DD>
<PRE>
#define J1F(Rc_int, PJ1Array, Index) \
Rc_int = Judy1First(PJ1Array, &amp;Index, PJE0)
</PRE>
<P>
<DT><A name="Judy1Next"><B>Judy1Next(PJ1Array, &amp;Index, &amp;JError)</B></A></DT>
<DD>
<PRE>
#define J1N(Rc_int, PJ1Array, Index) \
Rc_int = Judy1Next(PJ1Array, &amp;Index, PJE0)
</PRE>
<P>
<DT><A name="Judy1Last"><B>Judy1Last(PJ1Array, &amp;Index, &amp;JError)</B></A></DT>
<DD>
<PRE>
#define J1L(Rc_int, PJ1Array, Index) \
Rc_int = Judy1Last(PJ1Array, &amp;Index, PJE0)
</PRE>
<P>
<DT><A name="Judy1Prev"><B>Judy1Prev(PJ1Array, &amp;Index, &amp;JError)</B></A></DT>
<DD>
<PRE>
#define J1P(Rc_int, PJ1Array, Index) \
Rc_int = Judy1Prev(PJ1Array, &amp;Index, PJE0)
</PRE>
<P>
<DT><A name="Judy1FirstEmpty"><B>Judy1FirstEmpty(PJ1Array, &amp;Index, &amp;JError)</B></A></DT>
<DD>
<PRE>
#define J1FE(Rc_int, PJ1Array, Index) \
Rc_int = Judy1FirstEmpty(PJ1Array, &amp;Index, PJE0)
</PRE>
<P>
<DT><A name="Judy1NextEmpty"><B>Judy1NextEmpty(PJ1Array, &amp;Index, &amp;JError)</B></A></DT>
<DD>
<PRE>
#define J1NE(Rc_int, PJ1Array, Index) \
Rc_int = Judy1NextEmpty(PJ1Array, &amp;Index, PJE0)
</PRE>
<P>
<DT><A name="Judy1LastEmpty"><B>Judy1LastEmpty(PJ1Array, &amp;Index, &amp;JError)</B></A></DT>
<DD>
<PRE>
#define J1LE(Rc_int, PJ1Array, Index) \
Rc_int = Judy1LastEmpty(PJ1Array, &amp;Index, PJE0)
</PRE>
<P>
<DT><A name="Judy1PrevEmpty"><B>Judy1PrevEmpty(PJ1Array, &amp;Index, &amp;JError)</B></A></DT>
<DD>
<PRE>
#define J1PE(Rc_int, PJ1Array, Index) \
Rc_int = Judy1PrevEmpty(PJ1Array, &amp;Index, PJE0)
</PRE>
</DL>
<P>
Definitions for all of the Judy functions, the types
<B>Pvoid_t</B>,
<B>Pcvoid_t</B>,
<B>PPvoid_t</B>,
<B>Word_t</B>,
<B>JError_t</B>,
and
<B>PJError_t</B>,
the constants
<B>NULL</B>,
<B>JU_ERRNO_*</B>,
<B>JERR</B>,
and
<B>PJE0</B>,
are provided in the <B>Judy.h</B> header file
(/usr/include/Judy.h).
<B>Note</B>: Callers should define Judy1 arrays as type <B>Pvoid_t</B>,
which can be passed by value to functions that take
<B>Pcvoid_t</B> (constant <B>Pvoid_t</B>),
and also by address to functions that take <B>PPvoid_t</B>.
<!----------------->
<P>
<DT><B>AUTHOR</B></DT>
<DD>
Judy was invented by Doug Baskins and implemented by Hewlett-Packard.
<!----------------->
<P>
<DT><B>SEE ALSO</B></DT>
<DD>
<A href="Judy_3.htm">Judy(3)</A>,
<A href="JudyL_3.htm">JudyL(3)</A>,
<A href="JudySL_3.htm">JudySL(3)</A>,
<A href="JudyHS_3.htm">JudyHS(3)</A>,
<BR>
<I>malloc()</I>,
<BR>
the Judy website,
<A href="http://judy.sourceforge.net">
http://judy.sourceforge.net</A>,
for more information and Application Notes.
</DL>
</BODY>
</HTML>
<HTML>
<HEAD>
<!-- @(#) $Revision: 4.43 $ $Source: /cvsroot/judy/doc/ext/JudyHS_3.htm,v $ --->
<TITLE>JudyHS(3)</TITLE>
</HEAD>
<BODY>
<TABLE border=0 width="100%"><TR>
<TD width="40%" align="left">JudyHS(3)</TD>
<TD width="10%" align="center"> </TD>
<TD width="40%" align="right">JudyHS(3)</TD>
</TR></TABLE>
<P>
<!----------------->
<DT><B>NAME</B></DT>
<DD>
JudyHS macros - C library for creating and accessing a dynamic array,
using an array-of-bytes of <B>Length</B> as an <B>Index</B> and a word
as a <B>Value</B>.
<!----------------->
<P>
<DT><B>SYNOPSIS</B></DT>
<DD>
<B><PRE>
cc [flags] <I>sourcefiles</I> -lJudy
#include &lt;Judy.h&gt;
Word_t * PValue; // JudyHS array element
int Rc_int; // return flag
Word_t Rc_word; // full word return value
Pvoid_t PJHSArray = (Pvoid_t) NULL; // initialize JudyHS array
uint8_t * Index; // array-of-bytes pointer
Word_t Length; // number of bytes in Index
<A href="#JHSI" >JHSI</A>( PValue, PJHSArray, Index, Length); // <A href="JudyHS_funcs_3.htm#JudyHSIns">JudyHSIns()</A>
<A href="#JHSD" >JHSD</A>( Rc_int, PJHSArray, Index, Length); // <A href="JudyHS_funcs_3.htm#JudyHSDel">JudyHSDel()</A>
<A href="#JHSG" >JHSG</A>( PValue, PJHSArray, Index, Length); // <A href="JudyHS_funcs_3.htm#JudyHSGet">JudyHSGet()</A>
<A href="#JHSFA">JHSFA</A>(Rc_word, PJHSArray); // <A href="JudyHS_funcs_3.htm#JudyHSFreeArray">JudyHSFreeArray()</A>
</PRE></B>
<!----------------->
<DT><B>DESCRIPTION</B></DT>
<DD>
A JudyHS array is the equivalent of an array of word-sized
value/pointers. An <B>Index</B> is a pointer to an array-of-bytes of
specified length: <B>Length</B>. Rather than using a null terminated
string, this difference from <A href="JudySL_3.htm">JudySL(3)</A>
allows strings to contain all bits (specifically the null character).
This new addition (May 2004) to Judy arrays is a hybird using the best
capabilities of hashing and Judy methods. <B>JudyHS</B> does not have a
poor performance case where knowledge of the hash algorithm can be used
to degrade the performance.
<P>
Since JudyHS is based on a hash method, <B>Indexes</B> are not stored in
any particular order. Therefore the JudyHSFirst(), JudyHSNext(),
JudyHSPrev() and JudyHSLast() neighbor search functions are not
practical. The <B>Length</B> of each array-of-bytes can be from 0 to
the limits of <I>malloc()</I> (about 2GB).
<P>
The hallmark of <B>JudyHS</B> is speed with scalability, but memory
efficiency is excellent. The speed is very competitive with the best
hashing methods. The memory efficiency is similar to a linked list of
the same <B>Indexes</B> and <B>Values</B>. <B>JudyHS</B> is designed to
scale from 0 to billions of <B>Indexes</B>.
<P>
A JudyHS array is allocated with a <B>NULL</B> pointer
<PRE>
Pvoid_t PJHSArray = (Pvoid_t) NULL;
</PRE>
<P>
Because the macro forms of the API have a simpler error handling
interface than the equivalent
<A href="JudyHS_funcs_3.htm">functions</A>,
they are the preferred way to use JudyHS.
<P>
<DT>
<A name="JHSI"><B>JHSI(PValue, PJHSArray, Index, Length)</B></A> // <A href="JudyHS_funcs_3.htm#JudyHSIns">JudyHSIns()</A></DT>
<DD>
Given a pointer to a JudyHS array (<B>PJHSArray</B>), insert an
<B>Index</B> string of length: <B>Length</B> and a <B>Value</B> into the
JudyHS array: <B>PJHSArray</B>. If the <B>Index</B> is successfully
inserted, the <B>Value</B> is initialized to 0. If the <B>Index</B> was
already present, the <B>Value</B> is not modified.
<P>
Return <B>PValue</B> pointing to <B>Value</B>. Your program should use
this pointer to read or modify the <B>Value</B>, for example:
<PRE>
Value = *PValue;
*PValue = 1234;
</PRE>
<P>
<B>Note</B>:
<B>JHSI()</B> and <B>JHSD</B> can reorganize the JudyHS array.
Therefore, pointers returned from previous <B>JudyHS</B> calls become
invalid and must be re-acquired (using <B>JHSG()</B>).
<P>
<DT><A name="JHSD"><B>JHSD(Rc_int, PJHSArray, Index, Length)</B></A> // <A href="JudyHS_funcs_3.htm#JudyHSDel">JudyHSDel()</A></DT>
<DD>
Given a pointer to a JudyHS array (<B>PJHSArray</B>), delete the
specified <B>Index</B> along with the <B>Value</B> from the JudyHS
array.
<P>
Return <B>Rc_int</B> set to 1 if successfully removed from the array.
Return <B>Rc_int</B> set to 0 if <B>Index</B> was not present.
<P>
<DT><A name="JHSG"><B>JHSG(PValue, PJHSArray, Index, Length)</B></A> // <A href="JudyHS_funcs_3.htm#JudyHSGet">JudyHSGet()</A></DT>
<DD>
Given a pointer to a JudyHS array (<B>PJHSArray</B>),
find <B>Value</B> associated with <B>Index</B>.
<P>
Return <B>PValue</B> pointing to <B>Index</B>'s <B>Value</B>.
Return <B>PValue</B> set to <B>NULL</B> if the <B>Index</B> was not present.
<P>
<DT><A name="JHSFA"><B>JHSFA(Rc_word, PJHSArray)</B></A> // <A href="JudyHS_funcs_3.htm#JudyHSFreeArray">JudyHSFreeArray()</A></DT>
<DD>
Given a pointer to a JudyHS array (<B>PJHSArray</B>), free the entire array.
<P>
Return <B>Rc_word</B> set to the number of bytes freed and <B>PJHSArray</B> set to NULL.
<!----------------->
<P>
<DT><A name="ERRORS"><B>ERRORS:</B> See: </A><A href="Judy_3.htm#ERRORS">Judy_3.htm#ERRORS</A></DT>
<DD>
<P>
<DT><B>EXAMPLES</B></DT>
<DD>
Show how to program with the JudyHS macros. This program will print
duplicate lines and their line number from <I>stdin</I>.
<P><PRE>
#include &lt;unistd.h&gt;
#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;Judy.h&gt;
// Compiled:
// cc -O PrintDupLines.c -lJudy -o PrintDupLines
#define MAXLINE 1000000 /* max fgets length of line */
uint8_t Index[MAXLINE]; // string to check
int // Usage: PrintDupLines &lt; file
main()
{
Pvoid_t PJArray = (PWord_t)NULL; // Judy array.
PWord_t PValue; // Judy array element pointer.
Word_t Bytes; // size of JudyHS array.
Word_t LineNumb = 0; // current line number
Word_t Dups = 0; // number of duplicate lines
while (fgets(Index, MAXLINE, stdin) != (char *)NULL)
{
LineNumb++; // line number
// store string into array
JHSI(PValue, PJArray, Index, strlen(Index));
if (PValue == PJERR) // See ERRORS section
{
fprintf(stderr, "Out of memory -- exit\n");
exit(1);
}
if (*PValue == 0) // check if duplicate
{
Dups++;
printf("Duplicate lines %lu:%lu:%s", *PValue, LineNumb, Index);
}
else
{
*PValue = LineNumb; // store Line number
}
}
printf("%lu Duplicates, free JudyHS array of %lu Lines\n",
Dups, LineNumb - Dups);
JHSFA(Bytes, PJArray); // free JudyHS array
printf("JudyHSFreeArray() free'ed %lu bytes of memory\n", Bytes);
return (0);
}
</PRE>
<!----------------->
<P>
<DT><B>AUTHOR</B></DT>
<DD>
JudyHS was invented and implemented by Doug Baskins after retiring from Hewlett-Packard.
<!----------------->
<P>
<DT><B>SEE ALSO</B></DT>
<DD>
<A href="Judy_3.htm">Judy(3)</A>,
<A href="Judy1_3.htm">Judy1(3)</A>,
<A href="JudyL_3.htm">JudyL(3)</A>,
<A href="JudySL_3.htm">JudySL(3)</A>,
<BR>
<I>malloc()</I>,
<BR>
the Judy website,
<A href="http://judy.sourceforge.net">
http://judy.sourceforge.net</A>,
for further information and Application Notes.
</BODY>
</HTML>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# @(#) $Revision: 4.11 $
Judy_3.htm the Judy(3) overview manual entry in HTML format;
normally placed where a web browser can read it
Judy1_3.htm describes the Judy1*() macros
Judy1_funcs_3.htm describes the Judy1*() functions
JudyL_3.htm describes the JudyL*() macros
JudyL_funcs_3.htm describes the JudyL*() functions
JudySL_3.htm describes the JudySL*() macros
JudySL_funcs_3.htm describes the JudySL*() functions
JudyHS_3.htm describes the JudyHS*() macros
JudyHS_funcs_3.htm describes the JudyHS*() functions
# Note: The library package README file comes from the following file, but the
# hierarchy of example sources package README files come from each
# corresponding directory:
README_deliver packaged with other Judy delivered files, renamed to just
"README" in that context
# @(#) $Revision: 4.11 $
Judy_3.htm the Judy(3) overview manual entry in HTML format;
normally placed where a web browser can read it
Judy1_3.htm describes the Judy1*() macros
Judy1_funcs_3.htm describes the Judy1*() functions
JudyL_3.htm describes the JudyL*() macros
JudyL_funcs_3.htm describes the JudyL*() functions
JudySL_3.htm describes the JudySL*() macros
JudySL_funcs_3.htm describes the JudySL*() functions
JudyHS_3.htm describes the JudyHS*() macros
JudyHS_funcs_3.htm describes the JudyHS*() functions
# Note: The library package README file comes from the following file, but the
# hierarchy of example sources package README files come from each
# corresponding directory:
README_deliver packaged with other Judy delivered files, renamed to just
"README" in that context
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
INCLUDES = -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../JudyCommon/
AM_CFLAGS = -DJUDY1 @WARN_CFLAGS@
noinst_LTLIBRARIES = libJudy1.la libnext.la libprev.la libcount.la libinline.la
libJudy1_la_SOURCES = Judy1Test.c Judy1Tables.c Judy1Set.c Judy1SetArray.c Judy1Unset.c Judy1Cascade.c Judy1Count.c Judy1CreateBranch.c Judy1Decascade.c Judy1First.c Judy1FreeArray.c Judy1InsertBranch.c Judy1MallocIF.c Judy1MemActive.c Judy1MemUsed.c
libnext_la_SOURCES = Judy1Next.c Judy1NextEmpty.c
libnext_la_CFLAGS = $(AM_CFLAGS) -DJUDYNEXT
libprev_la_SOURCES = Judy1Prev.c Judy1PrevEmpty.c
libprev_la_CFLAGS = $(AM_CFLAGS) -DJUDYPREV
libcount_la_SOURCES = Judy1ByCount.c
libcount_la_CFLAGS = $(AM_CFLAGS) -DNOSMARTJBB -DNOSMARTJBU -DNOSMARTJLB
libinline_la_SOURCES = j__udy1Test.c
libinline_la_CFLAGS = $(AM_CFLAGS) -DJUDYGETINLINE
Judy1Tables.c: Judy1TablesGen.c
$(CC) $(INCLUDES) $(AM_CFLAGS) @CFLAGS@ -o Judy1TablesGen Judy1TablesGen.c; ./Judy1TablesGen
Judy1ByCount.c:../JudyCommon/JudyByCount.c
cp -f $< $@
Judy1Cascade.c:../JudyCommon/JudyCascade.c
cp -f $< $@
Judy1Count.c:../JudyCommon/JudyCount.c
cp -f $< $@
Judy1CreateBranch.c:../JudyCommon/JudyCreateBranch.c
cp -f $< $@
Judy1Decascade.c:../JudyCommon/JudyDecascade.c
cp -f $< $@
Judy1Unset.c:../JudyCommon/JudyDel.c
cp -f $< $@
Judy1First.c:../JudyCommon/JudyFirst.c
cp -f $< $@
Judy1FreeArray.c:../JudyCommon/JudyFreeArray.c
cp -f $< $@
Judy1Test.c:../JudyCommon/JudyGet.c
cp -f $< $@
j__udy1Test.c:../JudyCommon/JudyGet.c
cp -f $< $@
Judy1SetArray.c:../JudyCommon/JudyInsArray.c
cp -f $< $@
Judy1Set.c:../JudyCommon/JudyIns.c
cp -f $< $@
Judy1InsertBranch.c:../JudyCommon/JudyInsertBranch.c
cp -f $< $@
Judy1MallocIF.c:../JudyCommon/JudyMallocIF.c
cp -f $< $@
Judy1MemActive.c:../JudyCommon/JudyMemActive.c
cp -f $< $@
Judy1MemUsed.c:../JudyCommon/JudyMemUsed.c
cp -f $< $@
Judy1Next.c:../JudyCommon/JudyPrevNext.c
cp -f $< $@
Judy1Prev.c:../JudyCommon/JudyPrevNext.c
cp -f $< $@
Judy1NextEmpty.c:../JudyCommon/JudyPrevNextEmpty.c
cp -f $< $@
Judy1PrevEmpty.c:../JudyCommon/JudyPrevNextEmpty.c
cp -f $< $@
Judy1TablesGen.c:../JudyCommon/JudyTables.c
cp -f $< $@
# @(#) $Revision: 4.22 $ $Source: /judy/src/Judy1/README $
# This tree contains sources for the Judy1*() functions.
#
# Note: At one time, all of the Judy sources were split between Judy1/ and
# JudyL/ variants, but now most of them are merged in JudyCommon/ and this
# directory is vestigal.
Judy1.h header for following functions
lint.waivers see usage in makefile
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
INCLUDES = -I$(srcdir) -I$(srcdir)/..
AM_CFLAGS = @CFLAGS@ @WARN_CFLAGS@
noinst_LTLIBRARIES = libJudyMalloc.la
libJudyMalloc_la_SOURCES = JudyMalloc.c
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
SUBDIRS = . JudyCommon JudyL Judy1 JudySL JudyHS obj
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment