xstr — Extract Strings from C Programs

Synopsis

/usr/bin/xstr -c filename [-v][-l array] 
/usr/bin/xstr [-l array] 
/usr/bin/xstr filename [-v][-l array] 

Description

xstr maintains a file called strings into which a large program hashes strings in component parts. These strings are replaced with references to this common area. This approach implements shared constant strings, which are most useful if they are also read-only.

The following command extracts the strings from the C source in filename , replacing string references by expressions of the form &xstr[number ] for some number.

castle% xstr -c
						filename
					

An appropriate declaration of xstr is prepended to the file. The resulting C text is placed in the file x.c to then be compiled. The ...

Get Solaris™ 7 Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.