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