[Contents]   [Back]   [Prev]   [Up]   [Next]   [Forward]  


4. Other topics

4.1 How to config GLOBAL.

You can customize GLOBAL using configuration file.


    # cp gtags.conf /etc/gtags.conf         # system wide config file.
    # vi /etc/gtags.conf

    $ cp gtags.conf $HOME/.globalrc         # personal config file.
    $ vi $HOME/.globalrc

If `$HOME/.globalrc' exists then GLOBAL use it. Else if `/etc/gtags.conf' exists then GLOBAL use it. Otherwise default value will be used. The format of `gtags.conf' is resemble to termcap(5). By default, 'default' target is used. About the capabilities, please see each command manual. See section 5. Command References.

4.2 Plug-in parser.

You can write new parser and use as a plug-in parser.

4.2.1 How to plug in a parser.

Copy `gtags.conf' to `/etc/gtags.conf' or `$HOME/.globalrc'.

If you would like to use exuberant ctags included by Vim editor,


    $ cd /vim source directory/src/ctags
    $ cp Makefile.unix Makefile
    $ make
    # cp ctags /usr/local/bin/ctags-exuberant
    $ export GTAGSLABEL=ctags-exuberant     # see gtags.conf
    $ gtags
    $ ls G*
    GPATH   GTAGS

`GRTAGS' and `GSYMS' don't exist, simply because these parsers don't support the `-r' option and `-s' option like gtags-parser(1) does.

4.2.2 Requirement of plug-in parser.

Plug-in parser must print tag information to standard output in the same style as ctags -x, ie.:


    [1]    [2] [3]          [4]
    ----------------------------------------------------------------
    main    20 ./main.c     main(argc, argv)        /* xxx */
    
    [1] tag name
    [2] line number the tag appeared
    [3] path name. It must be equal to argument path name.
    [4] line image

Plug-in parser must process the files in the order they are given in the argument. In each file, any order is acceptable.

4.3 Incremental updating.

Modifying some source files, you need not remake whole tag files. Instead, you can use incremental updating facility (`-u' option).


    $ gtags
    $ cd kern
    $ vi tty.c                              # modify tty.c
    ...
    :wq
    $ global -vu                            # -v means verbose
    [Sun Dec  6 16:27:47 JST 1998] Gtags started
     Tag found in '/usr/src/sys'.
     Incremental update.
    [Sun Dec  6 16:28:48 JST 1998] Updating 'GTAGS'.
     [1/1] deleting tags of kern/tty.c
     [1/1] adding tags of kern/tty.c
    [Sun Dec  6 16:28:59 JST 1998] Updating 'GRTAGS'.
     [1/1] deleting tags of kern/tty.c
     [1/1] adding tags of kern/tty.c
    [Sun Dec  6 16:28:14 JST 1998] Updating 'GSYMS'.
     [1/1] deleting tags of kern/tty.c
     [1/1] adding tags of kern/tty.c
     Global databases have been modified.
    [Sun Dec  6 16:28:30 JST 1998] Done.
    $ global -vu                            # try again
    [Sun Dec  6 16:28:48 JST 1998] Gtags started
     Tag found in '/usr/src/sys'.
     Incremental update.
     Global databases are up to date.       # do nothing
    [Sun Dec  6 16:28:52 JST 1998] Done.


[Contents]   [Back]   [Prev]   [Up]   [Next]   [Forward]