/[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.68 by shigio, Wed Jul 6 01:25:04 2005 UTC revision 1.69 by h-iwamoto, Wed Jul 6 11:40:09 2005 UTC
# Line 36  Line 36 
36  #ifdef HAVE_UNISTD_H  #ifdef HAVE_UNISTD_H
37  #include <unistd.h>  #include <unistd.h>
38  #endif  #endif
 #ifdef HAVE_LIMITS_H  
 #include <limits.h>  
 #endif  
39    
40  #include "char.h"  #include "char.h"
41  #include "conf.h"  #include "conf.h"
# Line 58  Line 55 
55    
56  static const char *unpack_pathindex(const char *);  static const char *unpack_pathindex(const char *);
57  static const char *genrecord(GTOP *);  static const char *genrecord(GTOP *);
 static int belongto(GTOP *, const char *, const char *);  
58  static regex_t reg;  static regex_t reg;
59    
60  /*  /*
# Line 533  gtags_add(gtop, comline, path_list, flag Line 529  gtags_add(gtop, comline, path_list, flag
529          strbuf_close(ib);          strbuf_close(ib);
530  }  }
531  /*  /*
  * belongto: wheather or not record belongs to the path.  
  *  
  *      i)      gtop    GTOP structure  
  *      i)      path    path name (in standard format)  
  *                      path number (in compact format)  
  *      i)      line    record  
  *      r)              1: belong, 0: not belong  
  *  
  */  
 static int  
 belongto(gtop, path, line)  
         GTOP *gtop;  
         const char *path;  
         const char *line;               /* virtually const */  
 {  
         const char *p = NULL;  
         int status, n;  
         SPLIT ptable;  
   
         /*  
          * Get path.  
          */  
         n = split((char *)line, 4, &ptable);  
         if (gtop->format == GTAGS_STANDARD || gtop->format == GTAGS_PATHINDEX) {  
                 if (n < 4) {  
                         recover(&ptable);  
                         die("too small number of parts.\n'%s'", line);  
                 }  
                 p = ptable.part[2].start;  
         } else if (gtop->format & GTAGS_COMPACT) {  
                 if (n != 3)  
                         die("illegal compact format.\n");  
                 p = ptable.part[1].start;  
         }  
         status = !strcmp(p, path) ? 1 : 0;  
         recover(&ptable);  
         return status;  
 }  
 /*  
532   * gtags_delete: delete records belong to set of fid.   * gtags_delete: delete records belong to set of fid.
533   *   *
534   *      i)      gtop    GTOP structure   *      i)      gtop    GTOP structure
# Line 606  gtags_delete(gtop, deleteset) Line 563  gtags_delete(gtop, deleteset)
563                  }                  }
564                  fid = atoi(p);                  fid = atoi(p);
565                  recover(&ptable);                  recover(&ptable);
                 if (fid >= deleteset->max)  
                         continue;  
566                  if (idset_contains(deleteset, fid))                  if (idset_contains(deleteset, fid))
567                          dbop_delete(gtop->dbop, NULL);                          dbop_delete(gtop->dbop, NULL);
568          }          }

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

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