~vibhavp/ubuntu/raring/dahdi-tools/merge-from-debian

« back to all changes in this revision

Viewing changes to xpp/oct612x/get_discards

  • Committer: Vibhav Pant
  • Date: 2012-12-26 17:23:16 UTC
  • mfrom: (2.1.6 sid)
  • Revision ID: vibhavp@gmail.com-20121226172316-o2jojsfcnr0aqrme
* Merge from Debian unstable. Remaining changes:
  - Bug Fix: If linux-headers are not installed, don't block, and print
    information for the user.
  - added debian/dahdi.postinst
  - added --error-handler=init_failed to debian/rules
  - debian/control: Added gawk as dependency for dkms build (LP: #493304)
  - Changes from Debian:
    - debian/control: Change Maintainer
    - debian/control: Removed Uploaders field.
    - debian/control: Removed Debian Vcs-Svn entry and replaced with
      ubuntu-voip Vcs-Bzr, to reflect divergence in packages.
    - debian/control: Package dahdi Depends on dahdi-dkms | dahdi-source 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/php
 
2
 
 
3
<?php
 
4
/*
 
5
 * Written by Jared Smith and Kevin P. Fleming
 
6
 *
 
7
 * Copyright (C) 2006, Jared Smith and Digium, Inc.
 
8
 *
 
9
 */
 
10
 
 
11
# create an array of all the different prefixes you want to match on,
 
12
# as Perl-compatible regular expressions
 
13
# (yes, this is a stupid example, as the second one is just a simplified
 
14
# version of the first, but it's just an example)
 
15
$prefixes = array('\.text\.Oct');
 
16
 
 
17
$fp = fopen('test.map','r');
 
18
 
 
19
while (!feof($fp))
 
20
{
 
21
        # Loop until we find the top of section we want
 
22
        while ($line = fgets($fp))
 
23
        {
 
24
                if (preg_match('/Discarded input sections/i',$line))
 
25
                {
 
26
                        break;
 
27
                }
 
28
        }
 
29
 
 
30
        # Now loop until we find the next section
 
31
        while ($line = fgets($fp))
 
32
        {
 
33
                if (preg_match('/Memory Configuration/i',$line))
 
34
                {
 
35
                        # we found it!
 
36
                        break;
 
37
                }
 
38
                foreach ($prefixes as $prefix)
 
39
                {
 
40
                        if (preg_match("/$prefix/i",$line))
 
41
                        {
 
42
                                preg_match("/Oct.*/", $line, $matches);
 
43
                                $line2 = fgets($fp);
 
44
                                echo "#define SKIP_".$matches[0]." 1\n";
 
45
                                break;
 
46
                        }
 
47
                }
 
48
        }
 
49
}
 
50
fclose($fp);
 
51
?>