Commit 49e1bc60 authored by Ondřej Surý's avatar Ondřej Surý

Merge libknot-int and libknot-yparser into libknot with versioned symbols to...

Merge libknot-int and libknot-yparser into libknot with versioned symbols to separate main KNOT library and INTERNAL+YPARSER
parent bbc4b5f2
......@@ -56,9 +56,7 @@
/m4/ltversion.m4
/m4/lt~obsolete.m4
/src/dnssec/libdnssec.pc
/src/libknot-int.pc
/src/libknot.pc
/src/libknot-yparser.pc
# dnstap
/src/dnstap/Makefile
......
......@@ -34,7 +34,6 @@ AC_CANONICAL_HOST
AC_SUBST([libknot_VERSION_INFO],["-version-info 1:0:1"])
AC_SUBST([libdnssec_VERSION_INFO],["-version-info 0:0:0"])
AC_SUBST([libknot_int_VERSION_INFO],["-avoid-version"])
AC_SUBST([libzscanner_VERSION_INFO],["-version-info 0:1:0"])
# Automatically update release date based on configure.ac date
......@@ -56,10 +55,12 @@ m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) # call AM_PROG_AR only if available
AC_PROG_LIBTOOL
LT_INIT
# Use -version-script if supported
gl_LD_VERSION_SCRIPT
# Use pkg-config
m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], [AC_SUBST([pkgconfigdir], ['${libdir}/pkgconfig'])])
AC_CONFIG_FILES([src/libknot.pc
src/libknot-int.pc
src/dnssec/libdnssec.pc])
# Build Knot DNS daemon
......
# ld-version-script.m4 serial 3
dnl Copyright (C) 2008-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Simon Josefsson
# FIXME: The test below returns a false positive for mingw
# cross-compiles, 'local:' statements does not reduce number of
# exported symbols in a DLL. Use --disable-ld-version-script to work
# around the problem.
# gl_LD_VERSION_SCRIPT
# --------------------
# Check if LD supports linker scripts, and define automake conditional
# HAVE_LD_VERSION_SCRIPT if so.
AC_DEFUN([gl_LD_VERSION_SCRIPT],
[
AC_ARG_ENABLE([ld-version-script],
AS_HELP_STRING([--enable-ld-version-script],
[enable linker version script (default is enabled when possible)]),
[have_ld_version_script=$enableval], [])
if test -z "$have_ld_version_script"; then
AC_MSG_CHECKING([if LD -Wl,--version-script works])
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
cat > conftest.map <<EOF
foo
EOF
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
[accepts_syntax_errors=yes], [accepts_syntax_errors=no])
if test "$accepts_syntax_errors" = no; then
cat > conftest.map <<EOF
VERS_1 {
global: sym;
};
VERS_2 {
global: sym;
} VERS_1;
EOF
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
[have_ld_version_script=yes], [have_ld_version_script=no])
else
have_ld_version_script=no
fi
rm -f conftest.map
LDFLAGS="$save_LDFLAGS"
AC_MSG_RESULT($have_ld_version_script)
fi
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
])
......@@ -2,9 +2,8 @@ ACLOCAL_AMFLAGS = -I $(top_srcdir)/m4
SUBDIRS = zscanner dnssec dnstap .
lib_LTLIBRARIES = \
libknot-int.la \
libknot.la
noinst_LTLIBRARIES =
noinst_LTLIBRARIES =
AM_CPPFLAGS = \
-include $(top_builddir)/src/config.h \
......@@ -20,62 +19,6 @@ AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS)
# Knot DNS Libraries #
######################
# dynamic: libknot internal headers
libknot_int_ladir = $(includedir)
nobase_libknot_int_la_HEADERS = \
libknot/internal/array-sort.h \
libknot/internal/base32hex.h \
libknot/internal/base64.h \
libknot/internal/binsearch.h \
libknot/internal/consts.h \
libknot/internal/endian.h \
libknot/internal/errcode.h \
libknot/internal/getline.h \
libknot/internal/heap.h \
libknot/internal/hhash.h \
libknot/internal/lists.h \
libknot/internal/macros.h \
libknot/internal/mem.h \
libknot/internal/mempattern.h \
libknot/internal/mempool.h \
libknot/internal/namedb/namedb.h \
libknot/internal/namedb/namedb_lmdb.h \
libknot/internal/namedb/namedb_trie.h \
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 \
libknot/internal/utils.h
# dynamic: libknot internal sources
libknot_int_la_SOURCES = \
libknot/internal/base32hex.c \
libknot/internal/base64.c \
libknot/internal/errcode.c \
libknot/internal/getline.c \
libknot/internal/heap.c \
libknot/internal/hhash.c \
libknot/internal/lists.c \
libknot/internal/mem.c \
libknot/internal/mempattern.c \
libknot/internal/mempool.c \
libknot/internal/namedb/namedb_lmdb.c \
libknot/internal/namedb/namedb_trie.c \
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 \
libknot/internal/utils.c \
$(nobase_libknot_int_la_HEADERS)
# dynamic: libknot headers
libknot_ladir = $(includedir)
nobase_libknot_la_HEADERS = \
......@@ -108,17 +51,42 @@ nobase_libknot_la_HEADERS = \
libknot/rrtype/rrsig.h \
libknot/rrtype/soa.h \
libknot/rrtype/tsig.h \
libknot/tsig-op.h
noinst_libknot_ladir = $(includedir)
noinst_libknot_la_HEADERS = \
libknot/tsig-op.h \
libknot/yparser/yparser.h \
libknot/yparser/ypformat.h \
libknot/yparser/ypscheme.h \
libknot/yparser/yptrafo.h
libknot/yparser/yptrafo.h \
libknot/internal/array-sort.h \
libknot/internal/base32hex.h \
libknot/internal/base64.h \
libknot/internal/binsearch.h \
libknot/internal/consts.h \
libknot/internal/endian.h \
libknot/internal/errcode.h \
libknot/internal/getline.h \
libknot/internal/heap.h \
libknot/internal/hhash.h \
libknot/internal/lists.h \
libknot/internal/macros.h \
libknot/internal/mem.h \
libknot/internal/mempattern.h \
libknot/internal/mempool.h \
libknot/internal/namedb/namedb.h \
libknot/internal/namedb/namedb_lmdb.h \
libknot/internal/namedb/namedb_trie.h \
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 \
libknot/internal/utils.h
# dynamic: libknot sources
libknot_la_SOURCES = \
libknot.map \
libknot/binary.c \
libknot/consts.c \
libknot/descriptor.c \
......@@ -145,28 +113,48 @@ libknot_la_SOURCES = \
libknot/yparser/ypformat.c \
libknot/yparser/ypscheme.c \
libknot/yparser/yptrafo.c \
$(nobase_libknot_la_HEADERS) \
$(noinst_libknot_la_HEADERS)
libknot_int_la_CPPFLAGS = $(AM_CPPFLAGS) $(lmdb_CFLAGS)
libknot_int_la_CFLAGS = $(AM_CFLAGS) -fvisibility=default
libknot_int_la_LDFLAGS = $(AM_LDFLAGS) $(libknot_int_VERSION_INFO) $(lmdb_LIBS)
libknot/internal/base32hex.c \
libknot/internal/base64.c \
libknot/internal/errcode.c \
libknot/internal/getline.c \
libknot/internal/heap.c \
libknot/internal/hhash.c \
libknot/internal/lists.c \
libknot/internal/mem.c \
libknot/internal/mempattern.c \
libknot/internal/mempool.c \
libknot/internal/namedb/namedb_lmdb.c \
libknot/internal/namedb/namedb_trie.c \
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 \
libknot/internal/utils.c \
$(nobase_libknot_la_HEADERS)
libknot_la_CPPFLAGS = $(AM_CPPFLAGS) $(lmdb_CFLAGS)
libknot_la_CFLAGS = $(AM_CFLAGS)
libknot_la_LDFLAGS = $(AM_LDFLAGS) $(libknot_VERSION_INFO)
libknot_la_LIBADD = libknot-int.la dnssec/libdnssec.la zscanner/libzscanner.la
libknot_la_LDFLAGS = $(AM_LDFLAGS) $(libknot_VERSION_INFO) $(lmdb_LIBS)
libknot_la_LIBADD = dnssec/libdnssec.la zscanner/libzscanner.la
if HAVE_LD_VERSION_SCRIPT
libknot_la_LDFLAGS += -Wl,--version-script,$(srcdir)/libknot.map
endif
# pkg-config
pkgconfig_DATA = libknot.pc libknot-int.pc
pkgconfig_DATA = libknot.pc
if !HAVE_LMDB
libknot_int_la_SOURCES += \
libknot_la_SOURCES += \
libknot/internal/namedb/mdb.c \
libknot/internal/namedb/midl.c \
libknot/internal/namedb/lmdb.h \
libknot/internal/namedb/midl.h
libknot_int_la_CPPFLAGS += \
libknot_la_CPPFLAGS += \
-I$(srcdir)/libknot/internal/namedb/
endif
......@@ -336,8 +324,8 @@ libknotd_la_LDFLAGS = $(AM_LDFLAGS) $(systemd_LIBS) $(liburcu_LIBS)
libknotd_la_LIBADD = libknot.la
knotd_LDADD = libknotd.la
knotc_LDADD = libknotd.la
knot1to2_LDADD = libknot.la libknot-int.la
knotc_LDADD = libknotd.la libknot.la
knot1to2_LDADD = libknot.la
####################################
# Optional Knot DNS Daemon modules #
......@@ -417,7 +405,7 @@ libknotus_la_SOURCES = \
libknotus_la_CPPFLAGS = $(AM_CPPFLAGS) $(libidn_CFLAGS)
libknotus_la_LDFLAGS = $(AM_LDFLAGS) $(libidn_LIBS)
libknotus_la_LIBADD = libknot-int.la libknot.la
libknotus_la_LIBADD = libknot.la
# bin programs
kdig_LDADD = $(libidn_LIBS) libknotus.la
......
prefix=@prefix@
exec_prefix=@prefix@
libdir=@libdir@
includedir=@includedir@
Name: libknot-int
Description: Knot DNS library (common data structures)
URL: https://www.knot-dns.cz
Version: @PACKAGE_VERSION@
Libs: -L${libdir}
Libs.private: @lmdb_LIBS@
Cflags: -I${includedir} @lmdb_CFLAGS@
KNOT_2.0
{
global:
KNOT_DUMP_STYLE_DEFAULT;
KNOT_TSIG_FUDGE_DEFAULT;
KNOT_TSIG_MAX_DIGEST_SIZE;
knot_binary_dup;
knot_binary_free;
knot_binary_from_base64;
knot_binary_from_string;
knot_compr_put_dname;
knot_copy_key_params;
knot_crypto_cleanup;
knot_crypto_cleanup_thread;
knot_crypto_cleanup_threads;
knot_crypto_init;
knot_crypto_init_threads;
knot_crypto_load_engines;
knot_crypto_unload_engines;
knot_dname_align;
knot_dname_cat;
knot_dname_cmp;
knot_dname_cmp_wire;
knot_dname_copy;
knot_dname_copy_part;
knot_dname_free;
knot_dname_from_str;
knot_dname_in;
knot_dname_is_equal;
knot_dname_is_sub;
knot_dname_is_wildcard;
knot_dname_labels;
knot_dname_lf;
knot_dname_matched_labels;
knot_dname_parse;
knot_dname_prefixlen;
knot_dname_realsize;
knot_dname_replace_suffix;
knot_dname_size;
knot_dname_to_lower;
knot_dname_to_str;
knot_dname_to_wire;
knot_dname_unpack;
knot_dname_wire_check;
knot_dnssec_alg_names;
knot_dnssec_algorithm_is_zonesign;
knot_dnssec_init_default_policy;
knot_dnssec_key_free;
knot_dnssec_key_from_params;
knot_dnssec_policy_refresh_time;
knot_dnssec_policy_set_sign_lifetime;
knot_dnssec_sign_add;
knot_dnssec_sign_free;
knot_dnssec_sign_init;
knot_dnssec_sign_new;
knot_dnssec_sign_size;
knot_dnssec_sign_verify;
knot_dnssec_sign_write;
knot_edns_add_option;
knot_edns_check_record;
knot_edns_client_subnet_create;
knot_edns_client_subnet_parse;
knot_edns_do;
knot_edns_get_ext_rcode;
knot_edns_get_payload;
knot_edns_get_version;
knot_edns_has_nsid;
knot_edns_has_option;
knot_edns_init;
knot_edns_set_do;
knot_edns_set_ext_rcode;
knot_edns_set_payload;
knot_edns_set_version;
knot_edns_wire_size;
knot_free_key_params;
knot_get_key_type;
knot_get_obsolete_rdata_descriptor;
knot_get_rdata_descriptor;
knot_getline;
knot_is_valid_signature;
knot_keytag;
knot_layer_begin;
knot_layer_consume;
knot_layer_finish;
knot_layer_produce;
knot_layer_reset;
knot_load_key_params;
knot_lookup_by_id;
knot_lookup_by_name;
knot_map_errno;
knot_map_errno_internal;
knot_memdup;
knot_nsec3_bitmap;
knot_nsec3_hash;
knot_nsec3param_free;
knot_nsec3param_from_wire;
knot_opcode_names;
knot_overlay_add;
knot_overlay_consume;
knot_overlay_deinit;
knot_overlay_finish;
knot_overlay_init;
knot_overlay_produce;
knot_overlay_reset;
knot_pkt_begin;
knot_pkt_clear;
knot_pkt_copy;
knot_pkt_free;
knot_pkt_get_ext_rcode;
knot_pkt_init_response;
knot_pkt_new;
knot_pkt_parse;
knot_pkt_parse_payload;
knot_pkt_parse_question;
knot_pkt_parse_rr;
knot_pkt_parse_section;
knot_pkt_put;
knot_pkt_put_question;
knot_pkt_qclass;
knot_pkt_qname;
knot_pkt_qtype;
knot_pkt_question_size;
knot_pkt_reclaim;
knot_pkt_reserve;
knot_pkt_rr;
knot_pkt_section;
knot_pkt_type;
knot_process_begin;
knot_process_finish;
knot_process_in;
knot_process_out;
knot_process_reset;
knot_rcode_names;
knot_rdata_array_size;
knot_rdata_cmp;
knot_rdata_data;
knot_rdata_init;
knot_rdata_rdlen;
knot_rdata_set_rdlen;
knot_rdata_set_ttl;
knot_rdata_ttl;
knot_rdataset_add;
knot_rdataset_at;
knot_rdataset_clear;
knot_rdataset_copy;
knot_rdataset_eq;
knot_rdataset_init;
knot_rdataset_intersect;
knot_rdataset_member;
knot_rdataset_merge;
knot_rdataset_reserve;
knot_rdataset_size;
knot_rdataset_sort_at;
knot_rdataset_subtract;
knot_rdataset_unreserve;
knot_request_free;
knot_request_make;
knot_requestor_clear;
knot_requestor_dequeue;
knot_requestor_enqueue;
knot_requestor_exec;
knot_requestor_finished;
knot_requestor_init;
knot_requestor_overlay;
knot_rrclass_from_string;
knot_rrclass_to_string;
knot_rrset_add_rdata;
knot_rrset_clear;
knot_rrset_copy;
knot_rrset_empty;
knot_rrset_equal;
knot_rrset_free;
knot_rrset_init;
knot_rrset_init_empty;
knot_rrset_new;
knot_rrset_rr_from_wire;
knot_rrset_rr_to_canonical;
knot_rrset_to_wire;
knot_rrset_ttl;
knot_rrset_txt_dump;
knot_rrset_txt_dump_data;
knot_rrset_txt_dump_header;
knot_rrsig_rdata_size;
knot_rrsig_write_rdata;
knot_rrtype_additional_needed;
knot_rrtype_from_string;
knot_rrtype_is_ddns_forbidden;
knot_rrtype_is_dnssec;
knot_rrtype_is_metatype;
knot_rrtype_should_be_lowercased;
knot_rrtype_to_string;
knot_serial_compare;
knot_sig0_sign;
knot_sign_rrset;
knot_strerror;
knot_synth_rrsig;
knot_tkey_err_names;
knot_tsig_add;
knot_tsig_alg_dnames;
knot_tsig_alg_dnames_str;
knot_tsig_alg_names;
knot_tsig_append;
knot_tsig_client_check;
knot_tsig_client_check_next;
knot_tsig_create_key;
knot_tsig_create_rdata;
knot_tsig_digest_length;
knot_tsig_err_names;
knot_tsig_key_free;
knot_tsig_key_from_params;
knot_tsig_rdata_alg;
knot_tsig_rdata_alg_name;
knot_tsig_rdata_error;
knot_tsig_rdata_fudge;
knot_tsig_rdata_is_ok;
knot_tsig_rdata_mac;
knot_tsig_rdata_mac_length;
knot_tsig_rdata_orig_id;
knot_tsig_rdata_other_data;
knot_tsig_rdata_other_data_length;
knot_tsig_rdata_set_fudge;
knot_tsig_rdata_set_mac;
knot_tsig_rdata_set_orig_id;
knot_tsig_rdata_set_other_data;
knot_tsig_rdata_set_time_signed;
knot_tsig_rdata_time_signed;
knot_tsig_rdata_tsig_timers_length;
knot_tsig_rdata_tsig_variables_length;
knot_tsig_server_check;
knot_tsig_sign;
knot_tsig_sign_next;
knot_tsig_wire_maxsize;
mm_alloc;
mm_ctx_init;
mm_ctx_mempool;
mm_free;
mm_realloc;
tsig_alg_from_name;
tsig_alg_to_dname;
tsig_alg_to_str;
tsig_create_rdata;
tsig_rdata_alg;
tsig_rdata_alg_name;
tsig_rdata_error;
tsig_rdata_fudge;
tsig_rdata_is_ok;
tsig_rdata_mac;
tsig_rdata_mac_length;
tsig_rdata_orig_id;
tsig_rdata_other_data;
tsig_rdata_other_data_length;
tsig_rdata_set_fudge;
tsig_rdata_set_mac;
tsig_rdata_set_orig_id;
tsig_rdata_set_other_data;
tsig_rdata_set_time_signed;
tsig_rdata_store_current_time;
tsig_rdata_time_signed;
tsig_rdata_tsig_timers_length;
tsig_rdata_tsig_variables_length;
tsig_wire_maxsize;
local:
*;
};
KNOT_INTERNAL_2.0
{
global:
NAMEDB_LMDB_NOTLS;
add_head;
add_tail;
add_tail_list;
base32hex_dec;
base32hex_decode;
base32hex_decode_alloc;
base32hex_enc;
base32hex_encode;
base32hex_encode_alloc;
base32hex_pad;
base64_dec;
base64_decode;
base64_decode_alloc;
base64_enc;
base64_encode;
base64_encode_alloc;
base64_pad;
hash;
hattrie_apply_rev;
hattrie_apply_rev_ahtable;
hattrie_build_index;
hattrie_clear;
hattrie_create;
hattrie_create_n;
hattrie_del;
hattrie_dup;
hattrie_find_leq;
hattrie_find_next;
hattrie_free;
hattrie_get;
hattrie_iter_begin;
hattrie_iter_finished;
hattrie_iter_free;
hattrie_iter_key;
hattrie_iter_next;
hattrie_iter_val;
hattrie_split_mid;
hattrie_tryget;
hattrie_weight;
heap_delete;
heap_delmin;
heap_find;
heap_init;
heap_insert;
hex_print;
hhash_build_index;
hhash_clear;
hhash_create;
hhash_create_mm;
hhash_del;
hhash_find;
hhash_find_leq;
hhash_find_next;
hhash_free;
hhash_indexval;
hhash_insert;
hhash_iter_begin;
hhash_iter_finished;
hhash_iter_key;
hhash_iter_next;
hhash_iter_val;
hhash_map;
init_list;
insert_node;
knot_char_table;
knot_getline;
knot_map_errno_internal;
knot_memdup;
knot_strlcat;
knot_strlcpy;
list_dup;
list_size;
lookup_by_id;
lookup_by_name;
mm_alloc;
mm_ctx_init;
mm_ctx_mempool;
mm_free;
mm_realloc;
mp_alloc;
mp_alloc_internal;
mp_alloc_noalign;
mp_alloc_zero;
mp_delete;
mp_flush;
mp_grow_internal;
mp_init;
mp_new;
mp_open;
mp_realloc;
mp_realloc_zero;
mp_spread_internal;
mp_start;
mp_start_internal;
mp_start_noalign;
mp_stats;
mp_total_size;
mreserve;
namedb_lmdb_api;
namedb_trie_api;
net_bound_socket;
net_connected_socket;
net_is_connected;
net_unbound_socket;
ptrlist_add;
ptrlist_contains;
ptrlist_free;
rem_node;
short_hex_print;
sockaddr_cmp;
sockaddr_hostname;
sockaddr_len;
sockaddr_port;
sockaddr_port_set;
sockaddr_raw;
sockaddr_set;
sockaddr_set_raw;
sockaddr_tostr;
sprintf_alloc;
strcdup;
tcp_recv_msg;
tcp_send_msg;
time_diff;
txt_print;
udp_recv_msg;
udp_send_msg;
usage_dump;
wire_read_u16;
wire_read_u32;
wire_read_u48;
wire_read_u64;
wire_write_u16;
wire_write_u32;
wire_write_u48;
wire_write_u64;
xmalloc;
xrealloc;
} KNOT_2.0;
KNOT_YPARSER_2.0
{
global:
yp_addr;
yp_deinit;
yp_format_id;
yp_format_key0;
yp_format_key1;
yp_init;
yp_item_to_bin;
yp_item_to_txt;
yp_parse;
yp_scheme_check_deinit;
yp_scheme_check_init;
yp_scheme_check_parser;
yp_scheme_copy;
yp_scheme_find;
yp_scheme_free;
yp_set_input_file;
yp_set_input_string;
} KNOT_2.0;
\ No newline at end of file
......@@ -14,6 +14,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "libknot/internal/macros.h"
#include "libknot/internal/base32hex.h"
#include "libknot/internal/errcode.h"
......@@ -80,6 +81,7 @@ const uint8_t base32hex_dec[256] = {
[ 42] = KO, ['U'] = 30, [128] = KO, [171] = KO, [214] = KO,
};
_public_
int32_t base32hex_encode(const uint8_t *in,
const uint32_t in_len,
uint8_t *out,
......@@ -162,6 +164,7 @@ int32_t base32hex_encode(const uint8_t *in,
return (text - out);
}
_public_
int32_t base32hex_encode_alloc(const uint8_t *in,
const uint32_t in_len,
uint8_t **out)
......@@ -192,6 +195,7 @@ int32_t base32hex_encode_alloc(const uint8_t *in,
return ret;
}
_public_
int32_t base32hex_decode(const uint8_t *in,
const uint32_t in_len,
uint8_t *out,
......@@ -319,6 +323,7 @@ int32_t base32hex_decode(const uint8_t *in,
return (bin - out);
}
_public_
int32_t base32hex_decode_alloc(const uint8_t *in,
const uint32_t in_len,
uint8_t **out)
......
......@@ -14,6 +14,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "libknot/internal/macros.h"
#include "libknot/internal/base64.h"
#include "libknot/internal/errcode.h"
......@@ -81,6 +82,7 @@ const uint8_t base64_dec[256] = {
[ 42] = KO, ['U'] = 20, [128] = KO, [171] = KO, [214] = KO,
};
_public_
int32_t base64_encode(const uint8_t *in,
const uint32_t in_len,
uint8_t *out,
......@@ -129,6 +131,7 @@ int32_t base64_encode(const uint8_t *in,
return (text - out);
}