[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: algorithm of incremental updating
From: |
Shigio Yamaguchi |
Subject: |
Re: algorithm of incremental updating |
Date: |
Sat, 02 Jul 2005 20:17:52 +0900 |
> OK. I'll try to examine the method which satisfy both of the two requirements,
> one is your intention, another is keeping logging message.
> Please wait a little. (I'll try it in next month.)
Thank you for your waiting.
How about the following?
0. Changing specification
- 'Deleting' moved to the last and display all information at a time.
- 'GTAGS..GRTAGS..GSYMS..' are displayed real-time.
1. Original specification
[XXX Xxx 99 99:99:99 XXX 9999] Gtags started.
Using default configuration.
Tag found in '/tmp/global-4.8.6'.
Incremental update.
Updating tags of libutil/strbuf.c ...GTAGS..GRTAGS..GSYMS.. Done.
Adding tags of libutil/add.c ...GTAGS..GRTAGS..GSYMS.. Done.
Deleting tags of libutil/strbuf.h ...GTAGS..GRTAGS..GSYMS.. Done.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Global databases have been modified.
[XXX Xxx 99 99:99:99 XXX 9999] Done.
2. New specification
[XXX Xxx 99 99:99:99 XXX 9999] Gtags started.
Using default configuration.
Tag found in '/tmp/XXXXX
Incremental update.
Deleting tags for deleting libutil/strbuf.h and for updating
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libutil/strbuf.c ...GTAGS..GRTAGS..GSYMS.. Done.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Updating tags of libutil/strbuf.c ...GTAGS..GRTAGS..GSYMS.. Done.
Adding tags of libutil/add.c ...GTAGS..GRTAGS..GSYMS.. Done.
Global databases have been modified.
[XXX Xxx 99 99:99:99 XXX 9999] Done.
3. Implementation
This is pseudo code.
incremental(dbpath, cwd)
{
addlist = files which should be added
updatelist = files which should be updated
deletelist = files which should be deleted
deleteset = fid of updatelist and deletelist
(fidset)
/* Open all tags */
foreach db (GTAGS, GRTAGS, GSYMS) {
gtop[db] = gtags_open(db)
}
if (deleteset) {
log "Deleting tags for deleting <deletelist> and updating
<updatelist>."
foreach db (GTAGS, GRTAGS, GSYMS) {
log "..<name of tag>"
gtags_delete_by_fidset(gtop[db], deleteset, max_fid);
}
log newline
}
if (updatelist) {
foreach p (updatelist) {
log "Updating tags of <p>"
foreach db (GTAGS, GRTAGS, GSYMS) {
log "..<name of tag>"
gtags_add(gtop[db], p);
}
log newline
}
}
for (addlist) {
foreach p (addlist) {
log "Adding tags of <p>"
foreach db (GTAGS, GRTAGS, GSYMS) {
log "..<name of tag>"
gtags_add(gtop[db], p);
}
log newline
}
}
if (deletelist)
foreach p (deletelist)
gpath_delete(p);
/* Close all tags */
foreach db (GTAGS, GRTAGS, GSYMS) {
gtags_close(gtop[db]);
}
}
What do you think?
May I implement this?
--
Shigio YAMAGUCHI <address@hidden> - Tama Communications Corporation
PGP fingerprint: D1CB 0B89 B346 4AB6 5663 C4B6 3CA5 BBB3 57BE DDA3
- Re: algorithm of incremental updating,
Shigio Yamaguchi <=