version 1.4, 1999/03/11 01:35:07 |
version 1.5, 1999/06/05 01:21:52 |
|
|
.\" |
.\" |
.Dd December 30, 1993 |
.Dd December 30, 1993 |
.Dt XSTR 1 |
.Dt XSTR 1 |
.Os BSD 3 |
.Os |
.Sh NAME |
.Sh NAME |
.Nm xstr |
.Nm xstr |
.Nd "extract strings from C programs to implement shared strings" |
.Nd "extract strings from C programs to implement shared strings" |
|
|
.Nm xstr |
.Nm xstr |
.Op Fl c |
.Op Fl c |
.Op Fl l Ar array |
.Op Fl l Ar array |
.Op Fl |
.Op Fl |
.Op Ar file |
.Op Ar file |
.Sh DESCRIPTION |
.Sh DESCRIPTION |
.Nm xstr |
.Nm |
maintains a file |
maintains a file |
.Pa strings |
.Pa strings |
into which strings in component parts of a large program are hashed. |
into which strings in component parts of a large program are hashed. |
|
|
Available options: |
Available options: |
.Bl -tag -width Ds |
.Bl -tag -width Ds |
.It Fl |
.It Fl |
.Nm xstr |
.Nm |
reads from the standard input. |
reads from the standard input. |
.It Fl c |
.It Fl c |
.Nm xstr |
.Nm |
will extract the strings from the C source |
will extract the strings from the C source |
.Ar file |
.Ar file |
or the standard input |
or the standard input |
|
|
string references by expressions of the form (&xstr[number]) |
string references by expressions of the form (&xstr[number]) |
for some number. |
for some number. |
An appropriate declaration of |
An appropriate declaration of |
.Nm xstr |
.Nm |
is prepended to the file. |
is prepended to the file. |
The resulting C text is placed in the file |
The resulting C text is placed in the file |
.Pa x.c , |
.Pa x.c , |
|
|
After all components of a large program have been compiled a file |
After all components of a large program have been compiled a file |
.Pa xs.c |
.Pa xs.c |
declaring the common |
declaring the common |
.Nm xstr |
.Nm |
space can be created by a command of the form |
space can be created by a command of the form |
.Bd -literal -offset indent |
.Bd -literal -offset indent |
xstr |
xstr |
|
|
If possible, the array can be made read-only (shared) saving |
If possible, the array can be made read-only (shared) saving |
space and swap overhead. |
space and swap overhead. |
.Pp |
.Pp |
.Nm xstr |
.Nm |
can also be used on a single file. |
can also be used on a single file. |
A command |
A command |
.Bd -literal -offset indent |
.Bd -literal -offset indent |
|
|
file in the same directory. |
file in the same directory. |
.Pp |
.Pp |
It may be useful to run |
It may be useful to run |
.Nm xstr |
.Nm |
after the C preprocessor if any macro definitions yield strings |
after the C preprocessor if any macro definitions yield strings |
or if there is conditional code which contains strings |
or if there is conditional code which contains strings |
which may not, in fact, be needed. |
which may not, in fact, be needed. |
An appropriate command sequence for running |
An appropriate command sequence for running |
.Nm xstr |
.Nm |
after the C preprocessor is: |
after the C preprocessor is: |
.Pp |
.Pp |
.Bd -literal -offset indent -compact |
.Bd -literal -offset indent -compact |
|
|
mv x.o name.o |
mv x.o name.o |
.Ed |
.Ed |
.Pp |
.Pp |
.Nm xstr |
.Nm |
does not touch the file |
does not touch the file |
.Pa strings |
.Pa strings |
unless new items are added, so that |
unless new items are added, so that |
|
|
.Sh BUGS |
.Sh BUGS |
If a string is a suffix of another string in the data base, |
If a string is a suffix of another string in the data base, |
but the shorter string is seen first by |
but the shorter string is seen first by |
.Nm xstr |
.Nm |
both strings will be placed in the data base, when just |
both strings will be placed in the data base, when just |
placing the longer one there will do. |
placing the longer one there will do. |
.Sh HISTORY |
.Sh HISTORY |