File: includes2cxref.pl

package info (click to toggle)
cxref 1.6c-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,608 kB
  • ctags: 2,058
  • sloc: ansic: 18,218; yacc: 2,086; sh: 915; lex: 462; perl: 452; makefile: 418; lisp: 256; cpp: 188; python: 80
file content (55 lines) | stat: -rwxr-xr-x 990 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
#
# C Cross Referencing & Documentation tool. Version 1.5b.
#
# A Perl script to determine the headers to process from the cxref.include file.
#
# Written by Andrew M. Bishop
#
# This file Copyright 1999 Andrew M. Bishop
# It may be distributed under the GNU Public License, version 2, or
# any higher version.  See section COPYING of the GNU Public license
# for conditions under which this file may be redistributed.
#

if [ ! -f "$1" ]; then
   echo "Usage: $0 cxref.include"
   exit 1
fi

exec perl -x $0 $1

exit 1

#!perl

$|=1;

open(INCLUDE,"<$ARGV[0]") || die "Cannot open $ARGV[0]\n";

@files=();

while(<INCLUDE>)
  {
   ($cfile,@hfiles)=split(/[ \n]+/);

   foreach $hfile (@hfiles)
       {
        push(@files,substr($hfile,1)) if ($hfile =~ m/^%/);
       }
  }

close(INCLUDE);

$lastfile='';
@files=sort(@files);

foreach $file (@files)
  {
   if($file ne $lastfile)
       {
        print "cxref $file\n";
        `cxref $file`;
       }
   $lastfile=$file;
  }