Commit b6353e6b authored by Daniel Salzman's avatar Daniel Salzman

contrib: move strlcat and strcpy from internal

parent c9e2ce52
......@@ -31,6 +31,10 @@ libtap/tap/float.h
libtap/tap/macros.h
samples/Makefile.am
src/Makefile.am
src/contrib/openbsd/strlcat.c
src/contrib/openbsd/strlcat.h
src/contrib/openbsd/strlcpy.c
src/contrib/openbsd/strlcpy.h
src/contrib/ucw/array-sort.h
src/contrib/ucw/binsearch.h
src/contrib/ucw/heap.c
......@@ -375,10 +379,6 @@ src/libknot/internal/print.c
src/libknot/internal/print.h
src/libknot/internal/sockaddr.c
src/libknot/internal/sockaddr.h
src/libknot/internal/strlcat.c
src/libknot/internal/strlcat.h
src/libknot/internal/strlcpy.c
src/libknot/internal/strlcpy.h
src/libknot/internal/tolower.c
src/libknot/internal/tolower.h
src/libknot/internal/trie/hat-trie.c
......
......@@ -24,6 +24,8 @@ AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS)
libcontrib_ladir = $(includedir)
nobase_libcontrib_la_HEADERS = \
contrib/openbsd/strlcat.h \
contrib/openbsd/strlcpy.h \
contrib/ucw/array-sort.h \
contrib/ucw/binsearch.h \
contrib/ucw/heap.h \
......@@ -84,8 +86,6 @@ nobase_libknot_internal_la_HEADERS = \
libknot/internal/net.h \
libknot/internal/print.h \
libknot/internal/sockaddr.h \
libknot/internal/strlcat.h \
libknot/internal/strlcpy.h \
libknot/internal/tolower.h \
libknot/internal/trie/hat-trie.h \
libknot/internal/trie/murmurhash3.h \
......@@ -101,6 +101,8 @@ nobase_libknot_yparser_la_HEADERS = \
# dynamic: libknot sources
libcontrib_la_SOURCES = \
contrib/openbsd/strlcat.c \
contrib/openbsd/strlcpy.c \
contrib/ucw/heap.c \
contrib/ucw/mempool.c \
$(nobase_libcontrib_la_HEADERS)
......@@ -153,8 +155,6 @@ libknot_internal_la_SOURCES = \
libknot/internal/net.c \
libknot/internal/print.c \
libknot/internal/sockaddr.c \
libknot/internal/strlcat.c \
libknot/internal/strlcpy.c \
libknot/internal/tolower.c \
libknot/internal/trie/hat-trie.c \
libknot/internal/trie/murmurhash3.c \
......
......@@ -17,8 +17,7 @@
#include <sys/types.h>
#include <string.h>
#include "libknot/internal/macros.h"
#include "libknot/internal/strlcat.h"
#include "contrib/openbsd/strlcat.h"
size_t
knot_strlcat(char *dst, const char *src, size_t siz)
......
......@@ -17,8 +17,7 @@
#include <sys/types.h>
#include <string.h>
#include "libknot/internal/macros.h"
#include "libknot/internal/strlcpy.h"
#include "contrib/openbsd/strlcpy.h"
size_t
knot_strlcpy(char *dst, const char *src, size_t siz)
......
......@@ -20,8 +20,6 @@
#define strlcpy(dst, src, size) knot_strlcpy(dst, src, size)
#endif
#include "libknot/internal/macros.h"
/*
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
......
......@@ -33,7 +33,7 @@
#include "libknot/libknot.h"
#include "libknot/internal/lists.h"
#include "libknot/internal/macros.h"
#include "libknot/internal/strlcpy.h"
#include "contrib/openbsd/strlcpy.h"
/* Single log message buffer length (one line). */
#define LOG_BUFLEN 512
......
......@@ -26,8 +26,8 @@
#include "libknot/internal/macros.h"
#include "libknot/internal/mem.h"
#include "libknot/internal/sockaddr.h"
#include "libknot/internal/strlcat.h"
#include "libknot/yparser/yptrafo.h"
#include "contrib/openbsd/strlcat.h"
/*! Configuration specific logging. */
#define CONF_LOG(severity, msg, ...) do { \
......
......@@ -28,6 +28,7 @@
#include "knot/conf/confdb.h"
#include "libknot/errcode.h"
#include "libknot/yparser/yptrafo.h"
#include "contrib/openbsd/strlcpy.h"
/*
* A simple configuration:
......
......@@ -22,7 +22,7 @@
#include "knot/conf/tools.h"
#include "libknot/yparser/yptrafo.h"
#include "libknot/internal/mem.h"
#include "libknot/internal/strlcat.h"
#include "contrib/openbsd/strlcat.h"
#define FCN(io) (io->fcn != NULL) ? io->fcn(io) : KNOT_EOK
......
......@@ -33,8 +33,8 @@
#include "libknot/internal/macros.h"
#include "libknot/internal/mem.h"
#include "libknot/internal/net.h"
#include "libknot/internal/strlcpy.h"
#include "libknot/yparser/yptrafo.h"
#include "contrib/openbsd/strlcpy.h"
#define KNOT_CTL_REALM "knot."
#define KNOT_CTL_REALM_EXT ("." KNOT_CTL_REALM)
......
/* Copyright (C) 2015 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/>.
*/
#include "knot/nameserver/query_module.h"
#include "libknot/libknot.h"
#include "libknot/internal/strlcpy.h"
#include "contrib/openbsd/strlcpy.h"
/* Compiled-in module headers. */
#include "knot/modules/synth_record.h"
......
......@@ -22,8 +22,8 @@
#include "libknot/internal/utils.h"
#include "libknot/internal/sockaddr.h"
#include "libknot/internal/errcode.h"
#include "libknot/internal/strlcpy.h"
#include "libknot/internal/consts.h"
#include "contrib/openbsd/strlcpy.h"
int sockaddr_len(const struct sockaddr *ss)
{
......
......@@ -27,8 +27,8 @@
#include "libknot/internal/lists.h"
#include "libknot/internal/print.h"
#include "libknot/internal/sockaddr.h"
#include "libknot/internal/strlcat.h"
#include "libknot/internal/wire_ctx.h"
#include "contrib/openbsd/strlcat.h"
static lookup_table_t rtypes[] = {
{ KNOT_RRTYPE_A, "has IPv4 address" },
......
......@@ -30,7 +30,7 @@
#include "utils/common/token.h"
#include "libknot/libknot.h"
#include "libknot/internal/mempattern.h"
#include "libknot/internal/strlcpy.h"
#include "contrib/openbsd/strlcpy.h"
#define IPV4_REVERSE_DOMAIN "in-addr.arpa."
#define IPV6_REVERSE_DOMAIN "ip6.arpa."
......
......@@ -860,7 +860,7 @@ static yyconst flex_int32_t yy_rule_can_match_eol[92] =
#include "utils/knot1to2/includes.h"
#include "utils/knot1to2/extra.h"
#include "utils/knot1to2/cf-parse.tab.h"
#include "libknot/internal/strlcpy.h"
#include "contrib/openbsd/strlcpy.h"
/* Imported symbols. */
#define lval (yylval->tok)
......
......@@ -28,7 +28,7 @@
#include "utils/knot1to2/includes.h"
#include "utils/knot1to2/extra.h"
#include "utils/knot1to2/cf-parse.tab.h"
#include "libknot/internal/strlcpy.h"
#include "contrib/openbsd/strlcpy.h"
/* Imported symbols. */
#define lval (yylval->tok)
......
......@@ -80,8 +80,8 @@
#include "utils/knot1to2/scheme.h"
#include "utils/knot1to2/extra.h"
#include "utils/knot1to2/cf-parse.tab.h"
#include "libknot/internal/strlcat.h"
#include "libknot/internal/strlcpy.h"
#include "contrib/openbsd/strlcat.h"
#include "contrib/openbsd/strlcpy.h"
#define DEFAULT_PORT 53
#define DEFAULT_CTL_PORT 5533
......
......@@ -24,8 +24,8 @@
#include "utils/knot1to2/scheme.h"
#include "utils/knot1to2/extra.h"
#include "utils/knot1to2/cf-parse.tab.h"
#include "libknot/internal/strlcat.h"
#include "libknot/internal/strlcpy.h"
#include "contrib/openbsd/strlcat.h"
#include "contrib/openbsd/strlcpy.h"
#define DEFAULT_PORT 53
#define DEFAULT_CTL_PORT 5533
......
......@@ -34,7 +34,7 @@
#include "libknot/internal/getline.h"
#include "libknot/internal/macros.h"
#include "libknot/internal/mem.h"
#include "libknot/internal/strlcpy.h"
#include "contrib/openbsd/strlcpy.h"
/* Declarations of cmd parse functions. */
typedef int (*cmd_handle_f)(const char *lp, knsupdate_params_t *params);
......
......@@ -21,7 +21,7 @@
#include "libknot/libknot.h"
#include "libknot/internal/base32hex.h"
#include "libknot/internal/strlcpy.h"
#include "contrib/openbsd/strlcpy.h"
#define BUF_LEN 256
#define MAX_BIN_DATA_LEN ((INT32_MAX / 8) * 5)
......
......@@ -21,7 +21,7 @@
#include "libknot/libknot.h"
#include "libknot/internal/base64.h"
#include "libknot/internal/strlcpy.h"
#include "contrib/openbsd/strlcpy.h"
#define BUF_LEN 256
#define MAX_BIN_DATA_LEN ((INT32_MAX / 4) * 3)
......
......@@ -20,8 +20,8 @@
#include "knot/conf/confio.h"
#include "knot/conf/tools.h"
#include "knot/ctl/remote.h"
#include "libknot/internal/strlcat.h"
#include "libknot/internal/mem.h"
#include "contrib/openbsd/strlcat.h"
#define SKIP_OPENBSD skip("Nested transactions are not supported on OpenBSD");
#define OUT_LEN 1024
......
......@@ -26,8 +26,8 @@
#include "libknot/internal/mem.h"
#include "libknot/internal/namedb/namedb_lmdb.h"
#include "libknot/internal/namedb/namedb_trie.h"
#include "libknot/internal/strlcpy.h"
#include "libknot/libknot.h"
#include "contrib/openbsd/strlcpy.h"
#include "contrib/ucw/mempool.h"
/* UCW array sorting defines. */
......
......@@ -16,10 +16,10 @@
#include <tap/basic.h>
#include "libknot/internal/strlcat.h"
#include "libknot/internal/strlcpy.h"
#include "knot/zone/zone.h"
#include "knot/zone/zonedb.h"
#include "contrib/openbsd/strlcat.h"
#include "contrib/openbsd/strlcpy.h"
#define ZONE_COUNT 10
static const char *zone_list[ZONE_COUNT] = {
......
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