To use ctags facility, you must first create the tags database, typically in the main project directory. This is done with the macro ctags.vdm.
To start ctags.vdm, select {
or { } (assuming you are using the standard User menu).
The main dialog box is now displayed:
The dialog box contains the following fields:
Default is the directory of any existing tags file, if one is found. On startup, ctags.vdm searches for any existing tags file or ctags.ini file, first from current file's directory, then from it's parent directory, then from the parent directory of that directory, and so on, until it finds either the tags file or ctags.ini file. If either one is found, it's directory is filled as default in the Tags dir field. If existing tags file or ctags.ini file is not found, current file's directory is used as default.
You should put tags file in the directory where your source files are located. If your project consists of multiple directories, you should put tags file in the root of your project directory tree. This way, utags.vdm will find the file wherever in the directory tree you are.
During the processing, the names of the files processed are displayed on the screen, and the number of files and number of symbols found are displayed on status line.
After all the files have been processed, the main dialog box opens again. Number of symols and files added to TAGS database are displayed at the bottom of dialog. [Cancel] button has changed into [Exit] if there are no more settings in the .ini file.
You can then continue to add more files. (Append tickbox is now automatically ticked.) When you have finished adding files, click [Exit] button to exit the macro.
If you selected "Symbol recognition pattern" radio button, this dialog box is presented after you click [ Add files to TAGS ]. Enter the rearch string and options to seach for symbols to be included in TAGS database.
Batch Processing allows you to re-build tags database in one go. It uses command file saved earlier to perform all the operations necessary to include all the different types of symbols from all the directories specified.
To open Batch Processing dialog box, click [ Batch ] button on the main dialog. The dialog box contains the following fields:
Ctags.vdm remembers the settings you have choosen. The settings are stored in file ctags.ini, which is stored in the same directory as the tags database (local .ini file). This allows you to have different configuration for each project, and the settings stored match the actual tags database.
If ctags.ini is not found in your project's folder structure, global ctags.ini file in Vedit user-mac directory is used. This file only contains the settings you used last, not all the settings needed to build tags database. Further, it does not contain the directory setting. Instead, current file's directory is used as default in the dialog.
The local ctags.ini file stores all the settings used for creating the tags database. That is, if you append files to TAGS from several directory trees, or process different file types (.c, .h, .asm etc.), all the settings are stored. When you start ctags.vdm next time, the first settings used for creating the TAGS database are loaded by default, so you can more easily repeat the process from the beginning.
You can process files with the old settings by just pressing Enter, or you can change the settings first. After you have run the first set, the new set of options is automatically fetched from ctags.ini. You can re-create the TAGS database step by step by just pressing Enter a few times. When all the settings in .ini file have been processed, the settings do not change any more, [Cancel] button changes to [Exit], and the message "Click [Exit] to finish adding files" is displayed on the dialog.
Click Exit if you just wanted to update the database. But you can continue add more symbols if you want.
You can select batch processing mode directly when calling ctags.vdm (for example from the User menu).
Call label BATCH_AUTO to run batch processing with the default search.ini file.
Call label BATCH_SET to select another .ini file. In this case, the filename must be given in text register 40.
Call_File(100,"ctags.vdm","BATCH_AUTO")
RS(40,"ctag1.ini") Call_File(100,"ctags.vdm","BATCH_SET")
Or, you can call ctags.vdm from DOS command line or .BAT file:
c:\vedit\vpw -q -c'Call_File(100,"ctags.vdm","BATCH_AUTO")'
c:\vedit\vpw -q -c'RS(40,"ctag1.ini") Call_File(100,"ctags.vdm","BATCH_SET")'
If the -q option is given, ctags.vdm runs quietly without displaying anything. When done, Vedit is closed.
If the -q option is not given, the filenames are displayed while processing as normally. When done, ctags.vdm dialog box stays open displaying the number of items found.
If you call ctags.vdm from DOS version of Vedit, text-mode input window is displayed instead of dialog box. You will be presented series of questions for filenames, type of patterns to search etc. After you have given all the necessary information, the processing begins.
You can force text mode interface in Windows version of Vedit (perhaps to automate your work by using input redirection) by calling label DOS_MODE, e.g
c:\vedit\vpw -c'Call_File(100,"ctags.vdm","DOS_MODE")'
However, since ctags.vdm now supports Batch Processing, it is no more necessary to use input redirection for automating tags file creation.