xref: /openbsd-src/regress/usr.bin/mandoc/db/dbm_dump/dbm_dump.1 (revision 264ca2802d62fdf4b947bcac841b85c127a0b7c1)
1*264ca280Sschwarze.\"	$OpenBSD: dbm_dump.1,v 1.1 2016/07/30 10:56:13 schwarze Exp $
2*264ca280Sschwarze.\"
3*264ca280Sschwarze.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
4*264ca280Sschwarze.\"
5*264ca280Sschwarze.\" Permission to use, copy, modify, and distribute this software for any
6*264ca280Sschwarze.\" purpose with or without fee is hereby granted, provided that the above
7*264ca280Sschwarze.\" copyright notice and this permission notice appear in all copies.
8*264ca280Sschwarze.\"
9*264ca280Sschwarze.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10*264ca280Sschwarze.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11*264ca280Sschwarze.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12*264ca280Sschwarze.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13*264ca280Sschwarze.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14*264ca280Sschwarze.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15*264ca280Sschwarze.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16*264ca280Sschwarze.\"
17*264ca280Sschwarze.Dd $Mdocdate: July 30 2016 $
18*264ca280Sschwarze.Dt DBM_DUMP 1
19*264ca280Sschwarze.Os
20*264ca280Sschwarze.Sh NAME
21*264ca280Sschwarze.Nm dbm_dump
22*264ca280Sschwarze.Nd dump a mandoc.db(5) file
23*264ca280Sschwarze.Sh SYNOPSIS
24*264ca280Sschwarze.Nm dbm_dump
25*264ca280Sschwarze.Ar file
26*264ca280Sschwarze.Sh DESCRIPTION
27*264ca280SschwarzeThe
28*264ca280Sschwarze.Nm
29*264ca280Sschwarzeutility reads a
30*264ca280Sschwarze.Xr mandoc_db 5
31*264ca280Sschwarzedatabase from the given
32*264ca280Sschwarze.Ar file
33*264ca280Sschwarzeand dumps it to the standard output in a format that is suitable for
34*264ca280Sschwarze.Xr diff 1 .
35*264ca280Sschwarze.Pp
36*264ca280SschwarzeOffsets are given in bytes, zero-based, and printed in hexadecimal numbers.
37*264ca280SschwarzeCounts are printed in decimal numbers.
38*264ca280Sschwarze.Pp
39*264ca280SschwarzeEach non-empty table - the PAGES table, the MACROS table, and any
40*264ca280SschwarzeMACRO table - is preceded and followed by a line beginning with
41*264ca280Sschwarzethree equal signs
42*264ca280Sschwarze.Pq Sq === .
43*264ca280SschwarzeEmpty tables produce no output.
44*264ca280Sschwarze.Pp
45*264ca280SschwarzeIn the PAGES table, an entry may produce four or five lines of output,
46*264ca280Sschwarzedepending on whether an
47*264ca280Sschwarze.Fa arch
48*264ca280Sschwarzevalue is present.
49*264ca280SschwarzeEach
50*264ca280Sschwarze.Fa name
51*264ca280Sschwarzevalue is preceded by one or more attributes in square brackets,
52*264ca280Sschwarzetelling what kind of a name it is:
53*264ca280Sschwarze.Pp
54*264ca280Sschwarze.Bl -tag -width 1n -compact -offset indent
55*264ca280Sschwarze.It Sy f
56*264ca280Sschwarzea file name
57*264ca280Sschwarze.It Sy h
58*264ca280Sschwarzea header line name taken from a
59*264ca280Sschwarze.Ic \&Dt
60*264ca280Sschwarzeor
61*264ca280Sschwarze.Ic \&TH
62*264ca280Sschwarzemacro
63*264ca280Sschwarze.It Sy 1
64*264ca280Sschwarzethe name from the first
65*264ca280Sschwarze.Ic \&Nm
66*264ca280Sschwarzemacro in the NAME section
67*264ca280Sschwarze.It Sy t
68*264ca280Sschwarzea title name: a name from any
69*264ca280Sschwarze.Ic \&Nm
70*264ca280Sschwarzemacro in the NAME section
71*264ca280Sschwarze.It Sy s
72*264ca280Sschwarzeany name from a
73*264ca280Sschwarze.Ic \&Nm
74*264ca280Sschwarzemacro in the SYNOPSIS section
75*264ca280Sschwarze.El
76*264ca280Sschwarze.Pp
77*264ca280SschwarzeIn each MACRO table, macro values are followed by the primary name
78*264ca280Sschwarzeof each page in which they occur.
79*264ca280SschwarzeThis does not uniquely identify the pages because several pages
80*264ca280Sschwarzemay share the same primary name.
81*264ca280Sschwarze.Sh FILES
82*264ca280SschwarzeThe header files
83*264ca280Sschwarze.Qq Pa mansearch.h ,
84*264ca280Sschwarze.Qq Pa dbm_map.h ,
85*264ca280Sschwarzeand
86*264ca280Sschwarze.Qq Pa dbm.h
87*264ca280Sschwarzeand the object files
88*264ca280Sschwarze.Pa dbm_map.o
89*264ca280Sschwarzeand
90*264ca280Sschwarze.Pa dbm.o
91*264ca280Sschwarzefrom the
92*264ca280Sschwarze.Xr mandoc 1
93*264ca280Sschwarzebuild are required to compile and link
94*264ca280Sschwarze.Nm .
95*264ca280Sschwarze.Sh EXIT STATUS
96*264ca280Sschwarze.Ex -std
97*264ca280SschwarzeIt fails when no argument or more than one argument is given or when
98*264ca280Sschwarze.Fn dbm_open
99*264ca280Sschwarzefails.
100*264ca280SschwarzeThe pointer jumps described below
101*264ca280Sschwarze.Sx DIAGNOSTICS
102*264ca280Sschwarzedo not imply failure.
103*264ca280Sschwarze.Sh EXAMPLES
104*264ca280SschwarzeSeveral examples of
105*264ca280Sschwarze.Nm
106*264ca280Sschwarzeoutput can be found in the directory
107*264ca280Sschwarze.Pa /usr/src/regress/usr.bin/mandoc/db/out/ .
108*264ca280SschwarzeStandard output is saved in files with the extension
109*264ca280Sschwarze.Pa *.dout ,
110*264ca280Sschwarzestandard error is collected in the file
111*264ca280Sschwarze.Pa all.derr .
112*264ca280Sschwarze.Sh DIAGNOSTICS
113*264ca280SschwarzeThe function
114*264ca280Sschwarze.Fn dbm_open
115*264ca280Sschwarzedetects various kinds of issues with the file format
116*264ca280Sschwarzeand reports them on the standard error output.
117*264ca280Sschwarze.Pp
118*264ca280SschwarzeOtherwise, the
119*264ca280Sschwarze.Nm
120*264ca280Sschwarzeutility checks that the input file contains no holes
121*264ca280Sschwarzeand that no pointers point backwards.
122*264ca280SschwarzeFor each violation, the following message is printed:
123*264ca280Sschwarze.Pp
124*264ca280Sschwarze.D1 Ar pointer Sy jumps from Ar expected Sy to Ar specified
125*264ca280Sschwarze.Pp
126*264ca280SschwarzeHere,
127*264ca280Sschwarze.Ar pointer
128*264ca280Sschwarzespecifies what the dubious pointer is supposed to point to:
129*264ca280Sschwarze.Pp
130*264ca280Sschwarze.Bl -tag -width macros -compact
131*264ca280Sschwarze.It Sy name0
132*264ca280Sschwarzethe primary name of the first page
133*264ca280Sschwarze.It Sy name
134*264ca280Sschwarzethe primary name of another page
135*264ca280Sschwarze.It Sy sect0
136*264ca280Sschwarzethe first section of the first page
137*264ca280Sschwarze.It Sy sect
138*264ca280Sschwarzethe first section of another page
139*264ca280Sschwarze.It Sy arch0
140*264ca280Sschwarzethe first architecture of the first architecture-specific page
141*264ca280Sschwarze.It Sy arch
142*264ca280Sschwarzethe first architecture of another page
143*264ca280Sschwarze.It Sy desc0
144*264ca280Sschwarzethe one-line description of the first page
145*264ca280Sschwarze.It Sy desc
146*264ca280Sschwarzethe one-line description of another page
147*264ca280Sschwarze.It Sy file0
148*264ca280Sschwarzethe first filename of the first page
149*264ca280Sschwarze.It Sy file
150*264ca280Sschwarzethe first filename of another page
151*264ca280Sschwarze.It Sy macros
152*264ca280Sschwarzethe number of macro tables
153*264ca280Sschwarze.It Sy macro0
154*264ca280Sschwarzethe number of entries in the first macro table
155*264ca280Sschwarze.It Sy macro
156*264ca280Sschwarzethe number of entries in another macro table
157*264ca280Sschwarze.It Sy value0
158*264ca280Sschwarzethe first value of a macro
159*264ca280Sschwarze.It Sy value
160*264ca280Sschwarzeanother value of a macro
161*264ca280Sschwarze.It Sy pages0
162*264ca280Sschwarzethe list of pointers to pages mentioning the first macro value
163*264ca280Sschwarze.It Sy pages
164*264ca280Sschwarzethe list of pointers to pages mentioning another macro value
165*264ca280Sschwarze.It Sy end
166*264ca280Sschwarzethe final magic
167*264ca280Sschwarze.El
168*264ca280Sschwarze.Pp
169*264ca280SschwarzeThe hexadecimal 32-bit integers
170*264ca280Sschwarze.Ar expected
171*264ca280Sschwarzeand
172*264ca280Sschwarze.Ar specified
173*264ca280Sschwarzegive the byte offset of a specific data element in the file;
174*264ca280Sschwarzerespectively, the one
175*264ca280Sschwarze.Ar expected
176*264ca280Sschwarzefrom the end of the preceding data in the file and the one actually
177*264ca280Sschwarze.Ar found
178*264ca280Sschwarzewhen reading the location where the pointer ought to be.
179*264ca280SschwarzeIf
180*264ca280Sschwarze.Ar found
181*264ca280Sschwarzeis greater than
182*264ca280Sschwarze.Ar expected ,
183*264ca280Sschwarzethere is a hole, and the file could theoretically still be usable,
184*264ca280Sschwarzeeven though it is not likely to be correct.
185*264ca280SschwarzeIf
186*264ca280Sschwarze.Ar found
187*264ca280Sschwarzeis less than
188*264ca280Sschwarze.Ar expected ,
189*264ca280Sschwarzethe file is corrupt because it contains a backward pointer.
190*264ca280Sschwarze.Sh AUTHORS
191*264ca280Sschwarze.An Ingo Schwarze Aq Mt schwarze@openbsd.org
192