xstr.1 (9b50d9027575220cb6dd09b3e62f03f511e908b8) xstr.1 (7720a19d5d7456232e8e11909dd72d31ced622d1)
1.\" Copyright (c) 1980, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 27 unchanged lines hidden (view full) ---

36.Os BSD 3
37.Sh NAME
38.Nm xstr
39.Nd "extract strings from C programs to implement shared strings"
40.Sh SYNOPSIS
41.Nm xstr
42.Op Fl c
43.Op Fl
1.\" Copyright (c) 1980, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 27 unchanged lines hidden (view full) ---

36.Os BSD 3
37.Sh NAME
38.Nm xstr
39.Nd "extract strings from C programs to implement shared strings"
40.Sh SYNOPSIS
41.Nm xstr
42.Op Fl c
43.Op Fl
44.Op Fl v
44.Op Ar file
45.Sh DESCRIPTION
46.Nm Xstr
47maintains a file
48.Pa strings
49into which strings in component parts of a large program are hashed.
50These strings are replaced with references to this common area.
51This serves to implement shared constant strings, most useful if they

--- 9 unchanged lines hidden (view full) ---

61will extract the strings from the C source
62.Ar file
63or the standard input
64.Pq Fl ,
65replacing
66string references by expressions of the form (&xstr[number])
67for some number.
68An appropriate declaration of
45.Op Ar file
46.Sh DESCRIPTION
47.Nm Xstr
48maintains a file
49.Pa strings
50into which strings in component parts of a large program are hashed.
51These strings are replaced with references to this common area.
52This serves to implement shared constant strings, most useful if they

--- 9 unchanged lines hidden (view full) ---

62will extract the strings from the C source
63.Ar file
64or the standard input
65.Pq Fl ,
66replacing
67string references by expressions of the form (&xstr[number])
68for some number.
69An appropriate declaration of
69.Nm xstr
70.Nm
70is prepended to the file.
71The resulting C text is placed in the file
72.Pa x.c ,
73to then be compiled.
74The strings from this file are placed in the
75.Pa strings
76data base if they are not there already.
77Repeated strings and strings which are suffixes of existing strings
78do not cause changes to the data base.
71is prepended to the file.
72The resulting C text is placed in the file
73.Pa x.c ,
74to then be compiled.
75The strings from this file are placed in the
76.Pa strings
77data base if they are not there already.
78Repeated strings and strings which are suffixes of existing strings
79do not cause changes to the data base.
80.It Fl v
81Verbose mode.
79.El
80.Pp
81After all components of a large program have been compiled a file
82.Pa xs.c
83declaring the common
84.Nm xstr
85space can be created by a command of the form
86.Bd -literal -offset indent

--- 18 unchanged lines hidden (view full) ---

105.Pa x.c
106and
107.Pa xs.c
108as before, without using or affecting any
109.Pa strings
110file in the same directory.
111.Pp
112It may be useful to run
82.El
83.Pp
84After all components of a large program have been compiled a file
85.Pa xs.c
86declaring the common
87.Nm xstr
88space can be created by a command of the form
89.Bd -literal -offset indent

--- 18 unchanged lines hidden (view full) ---

108.Pa x.c
109and
110.Pa xs.c
111as before, without using or affecting any
112.Pa strings
113file in the same directory.
114.Pp
115It may be useful to run
113.Nm xstr
116.Nm
114after the C preprocessor if any macro definitions yield strings
115or if there is conditional code which contains strings
116which may not, in fact, be needed.
117An appropriate command sequence for running
118.Nm xstr
119after the C preprocessor is:
120.Pp
121.Bd -literal -offset indent -compact

--- 22 unchanged lines hidden (view full) ---

144Temp file when `xstr name' doesn't touch
145.Pa strings
146.El
147.Sh SEE ALSO
148.Xr mkstr 1
149.Sh BUGS
150If a string is a suffix of another string in the data base,
151but the shorter string is seen first by
117after the C preprocessor if any macro definitions yield strings
118or if there is conditional code which contains strings
119which may not, in fact, be needed.
120An appropriate command sequence for running
121.Nm xstr
122after the C preprocessor is:
123.Pp
124.Bd -literal -offset indent -compact

--- 22 unchanged lines hidden (view full) ---

147Temp file when `xstr name' doesn't touch
148.Pa strings
149.El
150.Sh SEE ALSO
151.Xr mkstr 1
152.Sh BUGS
153If a string is a suffix of another string in the data base,
154but the shorter string is seen first by
152.Nm xstr
155.Nm
153both strings will be placed in the data base, when just
154placing the longer one there will do.
155.Sh HISTORY
156The
157.Nm
158command appeared in
159.Bx 3.0 .
156both strings will be placed in the data base, when just
157placing the longer one there will do.
158.Sh HISTORY
159The
160.Nm
161command appeared in
162.Bx 3.0 .