Using Sun WorkShop

export


export prefix 
into path

This command 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 Sun WorkShop and the compiler.

Whenever the compiler processes a source file whose absolute path starts with prefix, the resulting browser database (.bd) file is stored in path.

The export command contains an implied import command of path, so that exported database components are automatically read by the Source Browsing mode of Sun WorkShop.

The export command enables you to save disk space by placing database files associated with identical files, such as #include files from /usr/include, in a single database, while still retaining distinct databases for individual projects.

If your sb_init files include multiple export commands, then you must arrange them from the most specific to the least specific. The compiler scans export commands in the same order that it encounters them in the sb_init file.

In Figure D-2, to place the .bd file and index file created for files from /usr/include in a database subdirectory in the sys subdirectory, the user included this export command in the sb_init file for source1:


export /usr/include into /project/sys

Figure D-2 export Example 1

Graphic

If the configuration had included a source2 directory with a sb_init file containing the same export command, then you would save disk space because you did not create two identical database files. For the stdio.h files, the compiler would create a single database file for stdio.h in the sys subdirectory.

The sb_init file contains an implied export/into. command that instructs the compiler to put database files created for source files not explicitly mentioned by an export command in the current working directory. In Figure D-2, the .bd files associated with a.cc and b.cc are placed in the database subdirectory in the source1 directory.

When you include the export command in the sb_init file, an implied import command causes the specified database to be read. Given the configuration in Figure D-2, the database in the sys subdirectory, as well as the database in the source1 directory, is searched each time you issue a query.

As another example, suppose the user included this export command in the sb_init file for source1:


export /project/include into /project/include

As shown in Figure D-3, this places the database files and index file created for files from /project/include in the database subdirectory in the /project/include subdirectory. An implied import command caused the database in /project/include to be read.

Figure D-3 export Example 2

Graphic

The database files are stored in a common subdirectory even though the command 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.