Commit 7fc3a4fe authored by Geoff Simmons's avatar Geoff Simmons

Remove the patricia interface.

parent 7f6a85f9
......@@ -7,8 +7,6 @@ vmod_LTLIBRARIES = libvmod_selector.la
libvmod_selector_la_SOURCES = \
vmod_selector.c \
patricia.h \
patricia.c \
qp.h \
qp.c \
popcnt_compat.h \
......@@ -26,11 +24,9 @@ dist_man_MANS = vmod_selector.3
@BUILD_VSC_SELECTOR@
vmod_selector.c patricia.c: patricia.h
vmod_selector.c qp.c: qp.h popcnt_compat.h
qp.c: qp.h popcnt_compat.h
ph.c: ph.h rnd.h
vmod_selector.c ph.c: ph.h rnd.h
vmod_selector.lo: $(nodist_libvmod_selector_la_SOURCES)
......
This diff is collapsed.
/*-
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Author: Geoffrey Simmons <geoffrey.simmons@uplex.de>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <errno.h>
#include <limits.h>
#include <unistd.h>
#include "vsb.h"
struct pt_y;
struct match_data {
unsigned magic;
#define MATCH_DATA_MAGIC 0x0d9a845e
unsigned *indices;
unsigned limit;
unsigned n;
unsigned exact;
unsigned min;
unsigned max;
};
struct pt_stats {
unsigned magic;
#define PT_STATS_MAGIC 0xf1c1114e
uint64_t nodes;
uint64_t leaves;
uint64_t terms;
uint64_t nodesz;
uint64_t dmin;
uint64_t dmax;
double davg;
};
void PT_Init(void);
int PT_Inited(void);
int PT_Insert(struct pt_y * * restrict root, unsigned idx,
char * const restrict * const restrict strings);
unsigned PT_Lookup(const struct pt_y * const restrict root,
char * const restrict * const restrict strings,
const char * const restrict subject);
int PT_Prefixes(const struct pt_y * const restrict root,
char * const restrict * const restrict strings,
const char * const restrict subject,
struct match_data * const restrict match);
void PT_Stats(const struct pt_y * const restrict root,
char * const restrict * const restrict strings,
struct pt_stats * const restrict stats);
void PT_Free(struct pt_y *y);
struct vsb * PT_Dump(struct pt_y *root, char **strings);
......@@ -4,11 +4,7 @@ AM_CFLAGS = $(VARNISHAPI_CFLAGS) -I$(top_srcdir)/src -Wall -Werror -Wextra \
-std=c99
AM_LDFLAGS = $(VARNISHAPI_LIBS)
bin_PROGRAMS = bench bench_qp bench_ph
bench_SOURCES = bench.c
bench_LDADD = $(top_builddir)/src/.libs/patricia.o
bin_PROGRAMS = bench_qp bench_ph
bench_qp_SOURCES = bench_qp.c
......
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