[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC] Modification of GPATH format
From: |
Shigio YAMAGUCHI |
Subject: |
[RFC] Modification of GPATH format |
Date: |
Mon, 31 Oct 2005 10:24:49 +0900 |
Hello everyone,
I have a plan to modify GPATH format.
Any comment?
1. Problem and the cause
Though the --file option of gtags(1) limits the range of project,
global(1) and htags(1) with the -o option ignore the range.
It is because GPATH has only path names of the source files in the project,
and global(1) and htags(1) with the -o (--other) option need to traverse
file system by themselves without refering GPATH.
2. Solution
To solve the problem, I have an idea to make GPATH have all path
names in the range. If it is, global(1) and htags(1) can refer GPATH
without traversing file system. As a result, the range defined by the
--file option of gtags(1) is kept.
This brins another merit that the operation of global(1) and htags(1)
with -o option quickens more than now.
3. Imprementation (new GPATH)
a. GPATH has all path names in the range of the project.
[GPATH]
key data
--------------------
./aaa.c\0 11\0
|
v
key data
--------------------
./aaa.c\0 11\0
./README\0 12\0 <=== include README
b. Each record of GPATH has a flag value to distinguish source files
and the rest.
[GPATH]
key data
--------------------
./aaa.c\0 11\0
|
v
key data
--------------------
./aaa.c\0 11\0
./README\0 12\0o\0 <=== 'o' means other files.
c. GPATH has new format version 2.
GPATH version is independent with the other tag files.
New GLOBAL can distinguish new GPATH and old GPATH.
Older GLOBAL cannot distinguish them, because currently GPATH doesn't
have any idea about the format version.
4. Compatibility
It is difficult to guarantee complete compatibility for the matter.
o New commands and old GPATH
New commands with the -o option behave as if invoked without -o option.
But we can make them show error message like follows.
$ htags
Error: GPATH seems to be older version. Please remake or update.
$ global -go main
Error: GPATH seems to be older version. Please remake or update.
o Older commands and new GPATH
Older global(1) with the -g or -P command will always work as if ivoked
with the -o option.
Older htags(1) will try to parse files which are not source files.
We should write some disclaimers on the manual to explain above.
BUG:
htags(1): Please execute this command with the -g (--gtags) option, or
after invoking the same version of gtags(1).
global(1): To use the -g and -P commands, please invoke the same version of
gtags(1).
--
Shigio YAMAGUCHI <address@hidden> - Tama Communications Corporation
PGP fingerprint: D1CB 0B89 B346 4AB6 5663 C4B6 3CA5 BBB3 57BE DDA3
- [RFC] Modification of GPATH format,
Shigio YAMAGUCHI <=