~ubuntu-branches/ubuntu/utopic/mtbl/utopic-proposed

« back to all changes in this revision

Viewing changes to man/mtbl_reader.3

  • Committer: Package Import Robot
  • Author(s): Robert S. Edmonds
  • Date: 2014-01-21 16:30:22 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20140121163022-g1077ma2csn1gne8
Tags: 0.4-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
'\" t
2
 
.\"     Title: mtbl_reader
3
 
.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4
 
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
5
 
.\"      Date: 05/29/2012
6
 
.\"    Manual: \ \&
7
 
.\"    Source: \ \&
8
 
.\"  Language: English
9
 
.\"
10
 
.TH "MTBL_READER" "3" "05/29/2012" "\ \&" "\ \&"
11
 
.\" -----------------------------------------------------------------
12
 
.\" * Define some portability stuff
13
 
.\" -----------------------------------------------------------------
14
 
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
 
.\" http://bugs.debian.org/507673
16
 
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17
 
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18
 
.ie \n(.g .ds Aq \(aq
19
 
.el       .ds Aq '
20
 
.\" -----------------------------------------------------------------
21
 
.\" * set default formatting
22
 
.\" -----------------------------------------------------------------
23
 
.\" disable hyphenation
24
 
.nh
25
 
.\" disable justification (adjust text to left margin only)
26
 
.ad l
27
 
.\" -----------------------------------------------------------------
28
 
.\" * MAIN CONTENT STARTS HERE *
29
 
.\" -----------------------------------------------------------------
30
 
.SH "NAME"
31
 
mtbl_reader \- read an MTBL file
32
 
.SH "SYNOPSIS"
33
 
.sp
34
 
\fB#include <mtbl\&.h>\fR
35
 
.sp
36
 
Reader objects:
37
 
.sp
38
 
.nf
39
 
\fBstruct mtbl_reader *
40
 
mtbl_reader_init(const char *\fR\fB\fIfname\fR\fR\fB, const struct mtbl_reader_options *\fR\fB\fIropt\fR\fR\fB);\fR
41
 
.fi
42
 
.sp
43
 
.nf
44
 
\fBstruct mtbl_reader *
45
 
mtbl_reader_init_fd(int \fR\fB\fIfd\fR\fR\fB, const struct mtbl_reader_options *\fR\fB\fIropt\fR\fR\fB);\fR
46
 
.fi
47
 
.sp
48
 
.nf
49
 
\fBvoid
50
 
mtbl_reader_destroy(struct mtbl_reader **\fR\fB\fIr\fR\fR\fB);\fR
51
 
.fi
52
 
.sp
53
 
.nf
54
 
\fBconst struct mtbl_source *
55
 
mtbl_reader_source(struct mtbl_reader *\fR\fB\fIr\fR\fR\fB);\fR
56
 
.fi
57
 
.sp
58
 
Reader options:
59
 
.sp
60
 
.nf
61
 
\fBstruct mtbl_reader_options *
62
 
mtbl_reader_options_init(void);\fR
63
 
.fi
64
 
.sp
65
 
.nf
66
 
\fBvoid
67
 
mtbl_reader_options_destroy(struct mtbl_reader_options **\fR\fB\fIropt\fR\fR\fB);\fR
68
 
.fi
69
 
.sp
70
 
.nf
71
 
\fBvoid
72
 
mtbl_reader_options_set_verify_checksums(
73
 
        struct mtbl_reader_options *\fR\fB\fIropt\fR\fR\fB,
74
 
        bool \fR\fB\fIverify_checksums\fR\fR\fB);\fR
75
 
.fi
76
 
.SH "DESCRIPTION"
77
 
.sp
78
 
MTBL files are accessed by creating an \fBmtbl_reader\fR object, calling \fBmtbl_reader_source\fR() to obtain an \fBmtbl_source\fR handle, and using the \fBmtbl_source\fR(3) interface to read entries\&.
79
 
.sp
80
 
\fBmtbl_reader\fR objects may be created by calling \fBmtbl_reader_init\fR() with an \fIfname\fR argument specifying the filename to be opened, or \fBmtbl_reader_init_fd\fR() may be called with an \fIfd\fR argument specifying an open, readable file descriptor\&. Since MTBL files are immutable, the same MTBL file may be opened and read from concurrently by independent threads or processes\&.
81
 
.sp
82
 
If the \fIropt\fR parameter to \fBmtbl_reader_init\fR() or \fBmtbl_reader_init_fd\fR() is non\-NULL, the parameters specified in the \fBmtbl_reader_options\fR object will be configured into the \fBmtbl_reader\fR object\&.
83
 
.SS "Reader options"
84
 
.sp
85
 
.it 1 an-trap
86
 
.nr an-no-space-flag 1
87
 
.nr an-break-flag 1
88
 
.br
89
 
.ps +1
90
 
\fBverify_checksums\fR
91
 
.RS 4
92
 
.sp
93
 
Specifies whether or not the CRC32C checksum on each data block should be verified or not\&. If \fIverify_checksums\fR is enabled, a checksum mismatch will cause a runtime error\&. Note that the checksum on the index block is always verified, since the overhead of doing this once when the reader object is instantiated is minimal\&. The default is to not verify data block checksums\&.
94
 
.RE
95
 
.SH "RETURN VALUE"
96
 
.sp
97
 
\fBmtbl_reader_init\fR() and \fBmtbl_reader_init_fd\fR() return NULL on failure, and non\-NULL on success\&.