/[global]/global/libutil/gtagsop.c
ViewVC logotype

Diff of /global/libutil/gtagsop.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.67 by h-iwamoto, Tue Jul 5 11:40:47 2005 UTC revision 1.68 by shigio, Wed Jul 6 01:25:04 2005 UTC
# Line 572  belongto(gtop, path, line) Line 572  belongto(gtop, path, line)
572          return status;          return status;
573  }  }
574  /*  /*
575   * gtags_delete: delete records belong to path.   * gtags_delete: delete records belong to set of fid.
576   *   *
577   *      i)      gtop    GTOP structure   *      i)      gtop    GTOP structure
578   *      i)      path    path name   *      i)      deleteset bit array of fid
579   */   */
580  void  void
581  gtags_delete(gtop, path)  gtags_delete(gtop, deleteset)
582          GTOP *gtop;          GTOP *gtop;
583          const char *path;          IDSET *deleteset;
 {  
         const char *p, *fid;  
         /*  
          * In compact format, a path is saved as a file number.  
          */  
         if (gtop->format & GTAGS_PATHINDEX) {  
                 if ((fid = gpath_path2fid(path)) == NULL)  
                         die("GPATH is corrupted.('%s' not found)", path);  
                 path = fid;  
         }  
         /*  
          * read sequentially, because db(1) has just one index.  
          */  
         for (p = dbop_first(gtop->dbop, NULL, NULL, 0); p; p = dbop_next(gtop->dbop))  
                 if (belongto(gtop, path, p))  
                         dbop_delete(gtop->dbop, NULL);  
         /*  
          * don't delete from path index.  
          */  
 }  
 /*  
  * gtags_delete_by_fidset: delete records belong to set of fid.  
  *  
  *      i)      gtop    GTOP structure  
  *      i)      fidset  bit array of fid  
  *      i)      max_fid number of bits in bit array  
  */  
 void  
 gtags_delete_by_fidset(gtop, fidset, max_fid)  
         GTOP *gtop;  
         const unsigned char *fidset;  
         int max_fid;  
584  {  {
585          const char *line, *p;          const char *line, *p;
586          SPLIT ptable;          SPLIT ptable;
# Line 638  gtags_delete_by_fidset(gtop, fidset, max Line 606  gtags_delete_by_fidset(gtop, fidset, max
606                  }                  }
607                  fid = atoi(p);                  fid = atoi(p);
608                  recover(&ptable);                  recover(&ptable);
609                  if (fid >= max_fid)                  if (fid >= deleteset->max)
610                          continue;                          continue;
611                  if (fidset[fid  / CHAR_BIT] & (1 << (fid % CHAR_BIT)))                  if (idset_contains(deleteset, fid))
612                          dbop_delete(gtop->dbop, NULL);                          dbop_delete(gtop->dbop, NULL);
613          }          }
614  }  }

Legend:
Removed from v.1.67  
changed lines
  Added in v.1.68

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26