Controlling the Browser Database With .sbinit |
26 |
![]() |
The information in this chapter pertains mainly to the use of the command line to complete tasks also available from within WorkShop. For more conceptual information on using source browsing, see the online help.
This chapter is organized into the following sections:
Basic Concepts
The text file, .sbinit, is used by the Source Browsing mode of WorkShop, the compilers, and sbtags to obtain control information about the Source Browsing database structure. Use .sbinit if you want to work with source files whose database information is stored in multiple directories. Moving the .sbinit File
The default is to look in the current working directory for the .sbinit file. To instruct WorkShop and the compiler to search for the .sbinit file in another directory:
![]() | Set the environment variable SUNPRO_SB_INIT_FILE_NAME to /absolute/pathname/.sbinit. |
import /pathname to directory |
For example, you may want to set up administrative boundaries so that programmers working on Project A cannot write into directories for Project B and vice versa. In that case, Project A and Project B each need to maintain their own database, both of which can then be read but not written by programmers working on the other project.
In the following figure, the current working directory is /project/source1. The database in source2 is read by including either of these commands in the source1 .sbinit file:
import /project/source2 import ../source2 |
export
Causes the compilers and sbtags to write database component files associated with source files to directories other than the current working directory used by the Source Browsing mode of WorkShop and the compiler.
export prefix into path
export /usr/include into /project/sys |
export /project/include into /project/include |
This places the database files and index file created for files from /project/include in the .sb subdirectory in the /project/include subdirectory. An implied import command caused the database in /project/include to be read.
The database files are stored in a common subdirectory even though it located the include file in a nonstandard location. The export command saves disk space if the project includes multiple references from many different directories to the same include file.
replacepath
This command specifies how to modify path names in the Source Browsing database.
replacepath from_prefix to_prefix
replacepath /tmp_mnt |
When used for this purpose, the command should be given as the mount point as the first argument and the trigger_point as the second argument.
automount-prefix
The automount-prefix command enables you to browse on a machine other than the one on which you compiled your program. This command is identical to the replacepath command except that automount-prefix path translations occur at compile time and are written into the database.
automount-prefix mount_point trigger_point
automount-prefix /tmp_mnt / |
The default rule is generated only if no automount-prefix commands are specified.
cleanup-delay
This command limits the time elapsed between rebuilding the index and the associated database garbage collection. The compilers automatically invoke sbcleanup if the limit is exceeded. The default value is 12 hours.