path: root/doc/gdbmtool.1
diff options
Diffstat (limited to 'doc/gdbmtool.1')
1 files changed, 86 insertions, 1 deletions
diff --git a/doc/gdbmtool.1 b/doc/gdbmtool.1
index 2326a32..a04fbef 100644
--- a/doc/gdbmtool.1
+++ b/doc/gdbmtool.1
@@ -13,7 +13,7 @@
.\" You should have received a copy of the GNU General Public License
.\" along with GDBM. If not, see <http://www.gnu.org/licenses/>. */
-.TH GDBM_DUMP 1 "May 9, 2013" "GDBM" "GDBM User Reference"
+.TH GDBM_DUMP 1 "May 17, 2013" "GDBM" "GDBM User Reference"
gdbmtool \- examine and modify a GDBM database
@@ -244,6 +244,91 @@ Unsets listed variables.
Print the version of
.BR gdbm .
+The \fBdefine\fR statement provides a mechanism for defining key or
+content structures. It is similar to the \fBC\fR \fBstruct\fR
+.in +4
+\fBdefine\fR \fBkey\fR|\fBcontent\fR \fB{\fR \fIdefnlist\fR \fB}\fR
+The \fIdefnlist\fR is a comma-separated list of member declarations.
+Within \fIdefnlist\fR the newline character looses its special meaning
+as the command terminator, so each declaration can appear on a
+separate line and arbitrary number of comments can be inserted to
+document the definition.
+Each declaration has one of the following formats
+.in +4
+\fItype\fR \fIname\fR
+\fItype\fR \fIname\fR \fB[\fIN\fB]\fR
+where \fItype\fR is a data type and \fIname\fR is the member name.
+The second format defines the member \fIname\fR as an array of \fIN\fR
+elements of \fItype\fR.
+The supported types are:
+.ta 8n 20n
+ type meaning
+ char single byte (signed)
+ short signed short integer
+ ushort unsigned short integer
+ int signed integer
+ unsigned unsigned integer
+ uint ditto
+ long signed long integer
+ ulong unsigned long integer
+ llong signed long long integer
+ ullong unsigned long long integer
+ float a floating point number
+ double double-precision floating point number
+ string array of characters (see the \fBNOTE\fR below)
+ stringz null-terminated string of characters
+The following alignment declarations can be used within \fIdefnlist\fR:
+\fBoffset\fR \fIN\fR
+The next member begins at offset \fIN\fR.
+\fBpad\fR \fIN\fR
+Add \fIN\fR bytes of padding to the previous member.
+For example:
+.in +4
+\fBdefine content {
+ int status,
+ pad 8,
+ char id[3],
+ stringz name
+To define data consisting of a single data member, the following
+simplified construct can be used:
+.in +4
+\fBdefine\fR \fBkey\fR|\fBcontent\fR \fItype\fR
+where \fItype\fR is one of the types discussed above.
+\fBNOTE\fR: The \fBstring\fR type can reasonably be used only if it is
+the last or the only member of the data structure. That's because it
+provides no information about the number of elements in the array, so
+it is interpreted to contain all bytes up to the end of the datum.
.BR confirm ", boolean"

Return to:

Send suggestions and report system problems to the System administrator.