'\" t .\" Title: mtbl_merge .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 11/21/2016 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" .TH "MTBL_MERGE" "1" "11/21/2016" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" mtbl_merge \- merge MTBL data from multiple input files into a single output file .SH "SYNOPSIS" .sp User\-provided functions: .sp .nf \fBtypedef void * (*mtbl_merge_init_func)(void);\fR .fi .sp .nf \fBtypedef void (*mtbl_merge_free_func)(void *clos);\fR .fi .sp .nf \fBtypedef void (*mtbl_merge_func)(void *\fR\fB\fIclos\fR\fR\fB, const uint8_t *\fR\fB\fIkey\fR\fR\fB, size_t \fR\fB\fIlen_key\fR\fR\fB, const uint8_t *\fR\fB\fIval0\fR\fR\fB, size_t \fR\fB\fIlen_val0\fR\fR\fB, const uint8_t *\fR\fB\fIval1\fR\fR\fB, size_t \fR\fB\fIlen_val1\fR\fR\fB, uint8_t **\fR\fB\fImerged_val\fR\fR\fB, size_t *\fR\fB\fIlen_merged_val\fR\fR\fB);\fR .fi .sp Command line tool: .sp .nf \fBexport MTBL_MERGE_DSO="\fR\fB\fIlibexample\&.so\&.0\fR\fR\fB"\fR \fBexport MTBL_MERGE_FUNC_PREFIX="\fR\fB\fIexample_merge\fR\fR\fB"\fR \fBmtbl_merge\fR [\fB\-b\fR \fISIZE\fR] [\fB\-c\fR \fICOMPRESSION\fR] \fIINPUT\fR [\fIINPUT\fR]\&... \fIOUTPUT\fR .fi .SH "DESCRIPTION" .sp \fBmtbl_merge\fR(1) is a command\-line driver for the \fBmtbl_merger\fR(3) interface\&. The \fBmtbl_merger\fR(3) interface requires a user\-provided merge function, which is loaded from a shared object whose filename is specified in the environment variable \fIMTBL_MERGE_DSO\fR\&. .sp The user\-provided merge function must have the same type as the \fImtbl_merge_func\fR function type given above in the synopsis\&. The symbol name of the merge function to be loaded from the user\-provided DSO will be constructed by appending "_func" to the string provided in the \fIMTBL_MERGE_FUNC_PREFIX\fR environment variable, which must be non\-empty\&. .sp Additionally, two optional functions may be provided: an "init" function whose symbol name is "_init" appended to the function prefix, and a "free" function whose symbol name is "_free" appended to the function prefix\&. If the "init" function exists, it will be called at the beginning, before any calls to the merge function, and the return value from the init function will be passed as the first argument to the merge function\&. If the "free" function exists, it will be called at the end, after any calls to the merge function, and its argument will be the return value of the "init" function\&. .sp The environment variable \fIMTBL_MERGE_BLOCK_SIZE\fR may optionally be set in order to configure the MTBL block size (in bytes) of the output file\&. .SH "OPTIONS" .PP \fB\-b\fR \fISIZE\fR .RS 4 The uncompressed data block size hint for the output file, in bytes\&. The default value if unspecified is 8192 bytes (8 kilobytes)\&. .RE .PP \fB\-c\fR \fICOMPRESSION\fR .RS 4 The compression algorithm to use for data blocks in the output file\&. The default value if unspecified is \fBzlib\fR\&. See the \fBmtbl_info\fR(1) manpage for the list of possible compression algorithms\&. .RE .SH "SEE ALSO" .sp \fBmtbl_info\fR(1), \fBmtbl_merger\fR(3)