summaryrefslogtreecommitdiff
path: root/drivers/dahdi/oct612x/get_discards
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2010-08-13 19:38:32 +0000
committerShaun Ruffell <sruffell@digium.com>2010-08-13 19:38:32 +0000
commitd0bee2cdc4164114734d9a9ff13be63908181d22 (patch)
tree721282d1724d8279fb4189d284c1ff4cfa02ff55 /drivers/dahdi/oct612x/get_discards
parentdbd50c8eb5dd7d0cdc386a7acc09423f1f448517 (diff)
wct4xxp: Move 'oct612x' from an svn:external directly into dahdi-linux.
From http://svn.digium.com/svn/octasic_api/oct612x/tags/PR49-03/software@44 This is only currently maintained as part of DAHDI linux so it makes sense to have it directly in DAHDI linux. This obliterates any chance of having 0 checkpatch.pl errors between the 2.3.0 and 2.4.0 releases. Oh well... Signed-off-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9138 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/oct612x/get_discards')
-rwxr-xr-xdrivers/dahdi/oct612x/get_discards51
1 files changed, 51 insertions, 0 deletions
diff --git a/drivers/dahdi/oct612x/get_discards b/drivers/dahdi/oct612x/get_discards
new file mode 100755
index 0000000..5436118
--- /dev/null
+++ b/drivers/dahdi/oct612x/get_discards
@@ -0,0 +1,51 @@
+#!/usr/bin/php
+
+<?php
+/*
+ * Written by Jared Smith and Kevin P. Fleming
+ *
+ * Copyright (C) 2006, Jared Smith and Digium, Inc.
+ *
+ */
+
+# create an array of all the different prefixes you want to match on,
+# as Perl-compatible regular expressions
+# (yes, this is a stupid example, as the second one is just a simplified
+# version of the first, but it's just an example)
+$prefixes = array('\.text\.Oct');
+
+$fp = fopen('test.map','r');
+
+while (!feof($fp))
+{
+ # Loop until we find the top of section we want
+ while ($line = fgets($fp))
+ {
+ if (preg_match('/Discarded input sections/i',$line))
+ {
+ break;
+ }
+ }
+
+ # Now loop until we find the next section
+ while ($line = fgets($fp))
+ {
+ if (preg_match('/Memory Configuration/i',$line))
+ {
+ # we found it!
+ break;
+ }
+ foreach ($prefixes as $prefix)
+ {
+ if (preg_match("/$prefix/i",$line))
+ {
+ preg_match("/Oct.*/", $line, $matches);
+ $line2 = fgets($fp);
+ echo "#define SKIP_".$matches[0]." 1\n";
+ break;
+ }
+ }
+ }
+}
+fclose($fp);
+?>