Commit bcd2b199 authored by Daniel Salzman's avatar Daniel Salzman

contrib: move lists from internal

parent 092fd1f2
......@@ -80,6 +80,8 @@ src/contrib/ucw/array-sort.h
src/contrib/ucw/binsearch.h
src/contrib/ucw/heap.c
src/contrib/ucw/heap.h
src/contrib/ucw/lists.c
src/contrib/ucw/lists.h
src/contrib/ucw/mempool.c
src/contrib/ucw/mempool.h
src/contrib/wire.h
......@@ -380,8 +382,6 @@ src/libknot/dnssec/rrset-sign.h
src/libknot/errcode.h
src/libknot/error.c
src/libknot/error.h
src/libknot/internal/lists.c
src/libknot/internal/lists.h
src/libknot/internal/namedb/namedb.h
src/libknot/internal/namedb/namedb_lmdb.c
src/libknot/internal/namedb/namedb_lmdb.h
......
......@@ -46,6 +46,7 @@ nobase_libcontrib_la_HEADERS = \
contrib/ucw/array-sort.h \
contrib/ucw/binsearch.h \
contrib/ucw/heap.h \
contrib/ucw/lists.h \
contrib/ucw/mempool.h
# dynamic: libknot headers
......@@ -90,7 +91,6 @@ nobase_libknot_la_HEADERS = \
libknot_internal_ladir = $(includedir)
nobase_libknot_internal_la_HEADERS = \
libknot/internal/lists.h \
libknot/internal/namedb/namedb.h \
libknot/internal/namedb/namedb_lmdb.h \
libknot/internal/namedb/namedb_trie.h
......@@ -118,6 +118,7 @@ libcontrib_la_SOURCES = \
contrib/openbsd/strlcat.c \
contrib/openbsd/strlcpy.c \
contrib/ucw/heap.c \
contrib/ucw/lists.c \
contrib/ucw/mempool.c \
$(nobase_libcontrib_la_HEADERS)
......@@ -160,7 +161,6 @@ libknot_yparser_la_SOURCES = \
$(nobase_libknot_yparser_la_HEADERS)
libknot_internal_la_SOURCES = \
libknot/internal/lists.c \
libknot/internal/namedb/namedb_lmdb.c \
libknot/internal/namedb/namedb_trie.c \
$(nobase_libknot_internal_la_HEADERS)
......
......@@ -24,11 +24,9 @@
* similar to that used in the &fib structure.
*/
#define _BIRD_LISTS_C_
#include <stdlib.h>
#include <string.h>
#include "libknot/internal/lists.h"
#include "contrib/ucw/lists.h"
#include "contrib/mempattern.h"
/**
......@@ -38,7 +36,7 @@
*
* add_tail() takes a node @n and appends it at the end of the list @l.
*/
LIST_INLINE void
void
add_tail(list_t *l, node_t *n)
{
node_t *z = l->tail;
......@@ -56,7 +54,7 @@ add_tail(list_t *l, node_t *n)
*
* add_head() takes a node @n and prepends it at the start of the list @l.
*/
LIST_INLINE void
void
add_head(list_t *l, node_t *n)
{
node_t *z = l->head;
......@@ -75,7 +73,7 @@ add_head(list_t *l, node_t *n)
* Inserts a node @n to a linked list after an already inserted
* node @after.
*/
LIST_INLINE void
void
insert_node(node_t *n, node_t *after)
{
node_t *z = after->next;
......@@ -92,7 +90,7 @@ insert_node(node_t *n, node_t *after)
*
* Removes a node @n from the list it's linked in.
*/
LIST_INLINE void
void
rem_node(node_t *n)
{
node_t *z = n->prev;
......@@ -111,7 +109,7 @@ rem_node(node_t *n)
* init_list() takes a &list structure and initializes its
* fields, so that it represents an empty list.
*/
LIST_INLINE void
void
init_list(list_t *l)
{
l->head = (node_t *) &l->null;
......@@ -127,7 +125,7 @@ init_list(list_t *l)
* This function appends all elements of the list @l to
* the list @to in constant time.
*/
LIST_INLINE void
void
add_tail_list(list_t *to, list_t *l)
{
node_t *p = to->tail;
......
/* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
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 3 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, see <http://www.gnu.org/licenses/>.
*/
/*
* BIRD Library -- Linked Lists
*
......@@ -36,7 +21,8 @@
* tail tail_node.prev
*/
#include <string.h> // size_t
#include <string.h>
#include "libknot/mm_ctx.h"
typedef struct node {
struct node *next, *prev;
......@@ -82,8 +68,6 @@ void insert_node(node_t *, node_t *);
void list_dup(list_t *dst, list_t *src, size_t itemsz);
size_t list_size(const list_t *);
#include <stdbool.h>
#include "libknot/mm_ctx.h"
/*!
* \brief Generic pointer list implementation.
*/
......@@ -96,13 +80,3 @@ ptrnode_t *ptrlist_add(list_t *, void *, knot_mm_t *);
void ptrlist_free(list_t *, knot_mm_t *);
void ptrlist_rem(ptrnode_t *node, knot_mm_t *mm);
/*! \todo This is broken atm.
#ifndef _BIRD_LISTS_C_
#define LIST_INLINE extern inline
#include "knot/lib/lists.c"
#undef LIST_INLINE
#else
#define LIST_INLINE
#endif
*/
#define LIST_INLINE
......@@ -31,9 +31,9 @@
#include "knot/common/log.h"
#include "libknot/libknot.h"
#include "libknot/internal/lists.h"
#include "contrib/macros.h"
#include "contrib/openbsd/strlcpy.h"
#include "contrib/ucw/lists.h"
/* Single log message buffer length (one line). */
#define LOG_BUFLEN 512
......
......@@ -26,9 +26,9 @@
#pragma once
#include "libknot/libknot.h"
#include "libknot/internal/lists.h"
#include "libknot/internal/namedb/namedb_lmdb.h"
#include "libknot/yparser/ypscheme.h"
#include "contrib/ucw/lists.h"
/*! Default template identifier. */
#define CONF_DEFAULT_ID ((uint8_t *)"\x08""default\0")
......
......@@ -20,10 +20,10 @@
#include "knot/zone/node.h"
#include "libknot/errcode.h"
#include "libknot/dname.h"
#include "libknot/internal/lists.h"
#include "libknot/descriptor.h"
#include "contrib/macros.h"
#include "contrib/string.h"
#include "contrib/ucw/lists.h"
// Addition constants used for tweaking, mostly malloc overhead
enum estim_consts {
......
......@@ -25,9 +25,9 @@
#include "knot/common/log.h"
#include "libknot/libknot.h"
#include "libknot/descriptor.h"
#include "libknot/internal/lists.h"
#include "contrib/print.h"
#include "contrib/sockaddr.h"
#include "contrib/ucw/lists.h"
/* AXFR context. @note aliasing the generic xfr_proc */
struct axfr_proc {
......
......@@ -41,10 +41,10 @@
#pragma once
#include "libknot/libknot.h"
#include "libknot/internal/lists.h"
#include "libknot/mm_ctx.h"
#include "knot/conf/conf.h"
#include "knot/conf/tools.h"
#include "contrib/ucw/lists.h"
#define MODULE_ERR(mod, msg, ...) \
log_error("module '%.*s', " msg, mod[0], mod + 1, ##__VA_ARGS__)
......
......@@ -32,13 +32,13 @@
#include "sys/socket.h"
#include "knot/common/evsched.h"
#include "libknot/internal/lists.h"
#include "knot/common/fdset.h"
#include "libknot/internal/namedb/namedb.h"
#include "knot/server/dthreads.h"
#include "knot/server/rrl.h"
#include "knot/worker/pool.h"
#include "knot/zone/zonedb.h"
#include "contrib/ucw/lists.h"
/* Forwad declarations. */
struct iface;
......
......@@ -26,8 +26,8 @@
#include <sys/socket.h>
#include "libknot/internal/lists.h"
#include "contrib/mempattern.h"
#include "contrib/ucw/lists.h"
#include "libknot/rrtype/tsig.h"
#include "knot/conf/conf.h"
......
......@@ -22,8 +22,8 @@
#include "knot/zone/zonefile.h"
#include "knot/common/log.h"
#include "libknot/libknot.h"
#include "libknot/internal/lists.h"
#include "contrib/macros.h"
#include "contrib/ucw/lists.h"
/* --------------------------- Update cleanup ------------------------------- */
......
......@@ -28,7 +28,7 @@
#include "libknot/rrset.h"
#include "knot/zone/contents.h"
#include "libknot/internal/lists.h"
#include "contrib/ucw/lists.h"
/*! \brief One zone change, from 'soa_from' to 'soa_to'. */
typedef struct {
......
......@@ -28,7 +28,7 @@
#include "libknot/consts.h"
#include "libknot/rrtype/soa.h"
#include "libknot/descriptor.h"
#include "libknot/internal/lists.h"
#include "contrib/ucw/lists.h"
/* ----------------------------- prereq check ------------------------------- */
......
......@@ -20,8 +20,7 @@
#include "knot/dnssec/zone-events.h"
#include "knot/updates/apply.h"
#include "knot/zone/serial.h"
#include "libknot/internal/lists.h"
#include "contrib/ucw/lists.h"
#include "contrib/ucw/mempool.h"
static int add_to_node(zone_node_t *node, const zone_node_t *add_node,
......
......@@ -16,7 +16,7 @@
#pragma once
#include "libknot/internal/lists.h"
#include "contrib/ucw/lists.h"
struct task;
typedef void (*task_cb)(struct task *);
......
......@@ -21,9 +21,7 @@
#include <urcu.h>
#include "dnssec/random.h"
#include "libknot/descriptor.h"
#include "knot/common/evsched.h"
#include "libknot/internal/lists.h"
#include "knot/common/log.h"
#include "knot/common/trim.h"
#include "knot/zone/node.h"
......@@ -33,12 +31,11 @@
#include "knot/zone/contents.h"
#include "knot/updates/acl.h"
#include "knot/updates/apply.h"
#include "libknot/processing/requestor.h"
#include "knot/nameserver/process_query.h"
#include "libknot/libknot.h"
#include "libknot/dname.h"
#include "libknot/processing/requestor.h"
#include "contrib/string.h"
#include "libknot/rrtype/soa.h"
#include "contrib/ucw/lists.h"
#define JOURNAL_SUFFIX ".diff.db"
......
......@@ -17,8 +17,8 @@
#include "libknot/attribute.h"
#include "libknot/processing/overlay.h"
#include "libknot/errcode.h"
#include "libknot/internal/lists.h"
#include "contrib/mempattern.h"
#include "contrib/ucw/lists.h"
#define LAYERS ((list_t *)overlay->layers)
......
......@@ -19,10 +19,10 @@
#include "libknot/attribute.h"
#include "libknot/processing/requestor.h"
#include "libknot/errcode.h"
#include "libknot/internal/lists.h"
#include "contrib/mempattern.h"
#include "contrib/net.h"
#include "contrib/sockaddr.h"
#include "contrib/ucw/lists.h"
#define PENDING ((list_t *)requestor->pending)
......
......@@ -24,11 +24,11 @@
#include "utils/common/netio.h"
#include "utils/common/params.h"
#include "libknot/libknot.h"
#include "libknot/internal/lists.h"
#include "contrib/lookup.h"
#include "contrib/print.h"
#include "contrib/sockaddr.h"
#include "contrib/openbsd/strlcat.h"
#include "contrib/ucw/lists.h"
#include "contrib/wire_ctx.h"
static lookup_table_t rtypes[] = {
......
......@@ -31,7 +31,6 @@
#include <sys/socket.h>
#include "utils/common/params.h"
#include "libknot/internal/lists.h"
/*! \brief Structure containing server information. */
typedef struct {
......
......@@ -31,7 +31,7 @@
#include <stdbool.h>
#include "libknot/libknot.h"
#include "libknot/internal/lists.h"
#include "contrib/ucw/lists.h"
#define DEFAULT_IPV4_NAME "127.0.0.1"
#define DEFAULT_IPV6_NAME "::1"
......
......@@ -21,7 +21,7 @@
#include "utils/common/msg.h"
#include "utils/common/params.h"
#include "libknot/libknot.h"
#include "libknot/internal/lists.h"
#include "contrib/ucw/lists.h"
#define RESOLV_FILE "/etc/resolv.conf"
......
......@@ -27,7 +27,7 @@
#pragma once
#include "utils/common/netio.h"
#include "libknot/internal/lists.h"
#include "contrib/ucw/lists.h"
srv_info_t* parse_nameserver(const char *str, const char *def_port);
......
......@@ -25,9 +25,9 @@
#include "utils/common/netio.h"
#include "utils/common/sign.h"
#include "libknot/libknot.h"
#include "libknot/internal/lists.h"
#include "contrib/sockaddr.h"
#include "contrib/print.h"
#include "contrib/ucw/lists.h"
#if USE_DNSTAP
# include "contrib/dnstap/convert.h"
......
......@@ -27,8 +27,8 @@
#include "utils/common/resolv.h"
#include "libknot/descriptor.h"
#include "libknot/libknot.h"
#include "libknot/internal/lists.h"
#include "contrib/sockaddr.h"
#include "contrib/ucw/lists.h"
#define DEFAULT_RETRIES_DIG 2
#define DEFAULT_TIMEOUT_DIG 5
......
......@@ -26,7 +26,7 @@
#include "utils/common/params.h"
#include "utils/common/resolv.h"
#include "libknot/libknot.h"
#include "libknot/internal/lists.h"
#include "contrib/ucw/lists.h"
#define DEFAULT_RETRIES_HOST 1
#define DEFAULT_TIMEOUT_HOST 2
......
......@@ -32,8 +32,8 @@
#include "utils/common/params.h"
#include "utils/common/sign.h"
#include "libknot/libknot.h"
#include "libknot/internal/lists.h"
#include "zscanner/scanner.h"
#include "contrib/ucw/lists.h"
#define KNSUPDATE_VERSION "knsupdate, version " PACKAGE_VERSION "\n"
......
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