Commit 8a7451f6 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

custom sort by filename and lineno

parent fdcd887c
...@@ -141,7 +141,7 @@ function init(){ ...@@ -141,7 +141,7 @@ function init(){
function update_debugfs_config(){ function update_debugfs_config(){
console.log("syncing debugfs config"); console.log("syncing debugfs config");
console.log(debugfs_data); //console.log(debugfs_data);
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "debugfs.php?cmd=sync", url: "debugfs.php?cmd=sync",
......
...@@ -5,6 +5,31 @@ if (isset($_GET['cmd'])) ...@@ -5,6 +5,31 @@ if (isset($_GET['cmd']))
else else
$cmd = "do_nothing"; $cmd = "do_nothing";
function control_records_sort($a,$b){
$ad1 = strpos($a,":");
$ad2 = strpos($a,"[");
$afile = substr($a,0,$ad1);
$aline = (int)substr($a,$ad1+1,($ad2-1)-$ad1-1);
$bd1 = strpos($b,":");
$bd2 = strpos($b,"[");
$bfile = substr($b,0,$bd1);
$bline = (int)substr($b,$bd1+1,($bd2-1)-$bd1-1);
if ($afile==$bfile){
if ($aline==$bline){
return 0;
}
return($aline<$bline)?-1:1;
}
return ($afile<$bfile)?-1:1;
}
function get_control($f){ function get_control($f){
$res = Array(); $res = Array();
$results = trim(file_get_contents($f)); $results = trim(file_get_contents($f));
...@@ -15,6 +40,8 @@ function get_control($f){ ...@@ -15,6 +40,8 @@ function get_control($f){
//then [module] inside brackets //then [module] inside brackets
//function from "]" to " " //function from "]" to " "
usort($ress,"control_records_sort");
$oldfile = ""; $oldfile = "";
foreach($ress as $line){ foreach($ress as $line){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment