[BACK]Return to make_vi_tags CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / pari-2.2 / src

Annotation of OpenXM_contrib/pari-2.2/src/make_vi_tags, Revision 1.1.1.1

1.1       noro        1: eval 'exec perl $0 $1'
                      2:   if $running_under_some_shell;
                      3: # Build a (sorted) VI(M) tags file including GP functions
                      4: #
                      5: $src=$ARGV[0] || "$ENV{HOME}/PARI/src";
                      6: $tmptags="$src/tags.tmp";
                      7: $tags="$src/tags";
                      8:
                      9: # assume ctags outputs sorted tags (e.g Exuberant Ctags)
                     10: system("ctags -f $tmptags `find $src -name '*.[chs]' -type f -print`");
                     11: getnames("$src/gp/gp_init.c");
                     12: getnames("$src/language/init.c");
                     13: open(T,"$tmptags");
                     14: @tags=""; $old="";
                     15: for (sort(@gp))
                     16: {
                     17:   ($a, $b) = split(/#/);
                     18:   if ($a eq $old) { push(@tags,"$b$rest\n"); next; }
                     19:   $old = $a;
                     20:   while(<T>)
                     21:   {
                     22:     push(@tags,$_);
                     23:     if (/^$a(.*)/) { $rest="$1"; push(@tags,"$b$rest\n"); last; }
                     24:   }
                     25: }
                     26: while(<T>) { push(@tags,$_); }
                     27: open(OUT,">$tags");
                     28: print OUT sort(@tags);
                     29: unlink $tmptags;
                     30:
                     31: sub getnames
                     32: {
                     33:   open(A,$_[0]);
                     34:   while (<A>)
                     35:   {
                     36:     if (/^entree functions_/../^$/)
                     37:     {
                     38:       push(@gp,"$2#$1") if (/[^"]*"([^"]*)".*\(void\*\) *([^,]*)/);
                     39:     }
                     40:   }
                     41:   close(A);
                     42: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>