refactor: rename regex field of parserDefinition to method

To support --<LANG>-cmd= option `regex' field of parserDefinition, a
boolean field, is generalized to bit flags named method.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
refactor: make common parts of addCompiledTagPattern and addCompiledCallbackPattern a function

make common parts of addCompiledTagPattern and addCompiledCallbackPattern a function
named addCompiledTagCommon. Both now functions call addCompiledTagCommon.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
refactor: delay the decision to use findRegexTags as a parser method till a regex is added

The decision to use findRegexTags was made when a language is created
with --langdef. However, when --<LANG>-cmd= is introduced,
findRegexTags is not suitable even for a language crated with
--langdef. Whether findRegexTags should be used or not is not clear
till a regex is added to the language.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
make writePseudoTag be usable from all source files with language extension

In --<LANG>-xcmd optoin, the pseudo tags from external commands will
be merged into the final output. In other word '--<LANG>-xcmd' related
code has to emit pseudo tags. writePseudoTag is implementated in entry.c
but it is static scoped. This patch makes writePseudoTag be usable from
all source files.

language optional parameter is added for making a external command be
able to record its own _TAG_PROGRAM_AUTHOR, _TAG_PROGRAM_NAME,
_TAG_PROGRAM_URL and TAG_PROGRAM_VERSION. If language is other than
NULL, writePseudoTag uses the value of language as suffix of each
pseudo tag.

e.g. (here "coffee" is specified as the value for language.)

    !_TAG_PROGRAM_AUTHOR!coffee	...
    !_TAG_PROGRAM_NAME!coffee	...
    !_TAG_PROGRAM_URL!coffee	...
    !_TAG_PROGRAM_VERSION!coffee	...

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
introduce general purpose hash table

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
introduce pcoproc_open/close, replacement for popen/pclose

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
introduce --<LANG>-xcmd=, facility for utilizing external tagging command

While ctags can deal multiple languages, there are commands which is
specialized to one language(external parser command). The external
parser command parses input files and generate ctags compatible tags
file.

With this new --<LANG>-xcmd=COMMAND option, ctags doesn't parse <LANG>
input. Instead ctags invokes COMMAND, an external parser
command. ctags gets the result lines from COMMAND and merge them to
tags file.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
add a unit test for xcmd

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
add doesExecutableExist, which is used in searching external parser command

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
add --libexec-dir option and CTAGS_LIBEXEC_PATH

--libexec-dir option is similar to --data-dir option.
"drivers" directory under the directory specified --libexec-dir
is used when searching xcmd specified with --<LANG>-xcmd=NAME.

Consider following command line:

	 ctags  --libexec-dir=FOO --swine-xcmd=swinetags

In this case FOO/drivers/swinetags is searched.

CTAGS_LIBEXEC_PATH is similar to CTAGS_DATA_PATH.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
add --libexec-dir when running ctags under Units test

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
add coffeetag driver

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
add a test case for coffee driver

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
introduce languages file to Units

If a parser is not available, tests for the parser should be skipped.
Therefore the availability of parses should be able to be checked
before running a test. This patch provides the stage for checking
the availability. testing.mak checks the availability of language
parsers enumerated in Unit/TEST/languages by invoking ctags
--list-languages before running TEST. If the language parser is not
available or disabled, TEST is skipped.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
use /usr/libexec/ctags/drivers as default place to search external parsers

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
write about xcmd in the hacking guide

Signed-off-by: Masatake YAMATO <yamato@redhat.com>