summaryrefslogtreecommitdiffstats
path: root/games/fortune/strfile/strfile.8
diff options
context:
space:
mode:
Diffstat (limited to 'games/fortune/strfile/strfile.8')
-rw-r--r--games/fortune/strfile/strfile.839
1 files changed, 22 insertions, 17 deletions
diff --git a/games/fortune/strfile/strfile.8 b/games/fortune/strfile/strfile.8
index aa9fa59..5c2d642 100644
--- a/games/fortune/strfile/strfile.8
+++ b/games/fortune/strfile/strfile.8
@@ -36,7 +36,7 @@
.\" @(#)strfile.8 8.1 (Berkeley) 6/9/93
.\" $FreeBSD$
.\"
-.Dd June 9, 1993
+.Dd February 17, 2005
.Dt STRFILE 8
.Os
.Sh NAME
@@ -52,28 +52,32 @@
.Nm unstr
.Ar source_file
.Sh DESCRIPTION
-.Nm Strfile
+The
+.Nm
+utility
reads a file containing groups of lines separated by a line containing
a single percent
-.Ql \&%
+.Ql %
sign and creates a data file which contains
a header structure and a table of file offsets for each group of lines.
This allows random access of the strings.
.Pp
The output file, if not specified on the command line, is named
-.Ar source_file Ns Sy .dat .
+.Ar source_file Ns Pa .dat .
.Pp
The options are as follows:
-.Bl -tag -width "-c char"
+.Bl -tag -width ".Fl c Ar char"
.It Fl C
Flag the file as containing comments.
This option cases the
.Dv STR_COMMENTS
bit in the header
-.Ar str_flags
+.Va str_flags
field to be set.
Comments are designated by two delimiter characters at the
-beginning of the line, though strfile does not give any special
+beginning of the line, though
+.Nm
+does not give any special
treatment to comment lines.
.It Fl c Ar char
Change the delimiting character from the percent sign to
@@ -88,7 +92,7 @@ Any initial non-alphanumeric characters are ignored.
This option causes the
.Dv STR_ORDERED
bit in the header
-.Ar str_flags
+.Va str_flags
field to be set.
.It Fl r
Randomize access to the strings.
@@ -96,7 +100,7 @@ Entries in the offset table will be randomly ordered.
This option causes the
.Dv STR_RANDOM
bit in the header
-.Ar str_flags
+.Va str_flags
field to be set.
.It Fl s
Run silently; do not give a summary message when finished.
@@ -106,22 +110,23 @@ Note that each alphabetic character in the groups of lines is rotated
This option causes the
.Dv STR_ROTATED
bit in the header
-.Ar str_flags
+.Va str_flags
field to be set.
.El
.Pp
The format of the header is:
.Bd -literal
#define VERSION 1
-unsigned long str_version; /* version number */
-unsigned long str_numstr; /* # of strings in the file */
-unsigned long str_longlen; /* length of longest string */
-unsigned long str_shortlen; /* length of shortest string */
+uint32_t str_version; /* version number */
+uint32_t str_numstr; /* # of strings in the file */
+uint32_t str_longlen; /* length of longest string */
+uint32_t str_shortlen; /* length of shortest string */
#define STR_RANDOM 0x1 /* randomized pointers */
#define STR_ORDERED 0x2 /* ordered pointers */
#define STR_ROTATED 0x4 /* rot-13'd text */
-unsigned long str_flags; /* bit field for flags */
-char str_delim; /* delimiting character */
+#define STR_COMMENTS 0x8 /* embedded comments */
+uint32_t str_flags; /* bit field for flags */
+char str_delim; /* delimiting character */
.Ed
.Pp
All fields are written in network byte order.
@@ -144,7 +149,7 @@ is run and then using
.Nm unstr
to dump them out in the table order.
.Sh FILES
-.Bl -tag -width strfile.dat -compact
+.Bl -tag -width ".Pa strfile.dat" -compact
.It Pa strfile.dat
default output file.
.El
OpenPOWER on IntegriCloud