1 % Copyright (C) 2008 Jaroslav Hajek <highegg@gmail.com>
3 % This file is part of OctaveForge.
5 % OctaveForge is free software; you can redistribute it and/or modify
6 % it under the terms of the GNU General Public License as published by
7 % the Free Software Foundation; either version 2 of the License, or
8 % (at your option) any later version.
10 % This program is distributed in the hope that it will be useful,
11 % but WITHOUT ANY WARRANTY; without even the implied warranty of
12 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 % GNU General Public License for more details.
15 % You should have received a copy of the GNU General Public License
16 % along with this software; see the file COPYING. If not, see
17 % <http://www.gnu.org/licenses/>.
20 % function [bench_desc, arg_desc, result_desc] = benchutil_parse_desc (mpath)
21 % parse the inline comment description from a benchmark
24 function [bench_desc, arg_desc, result_desc] = benchutil_parse_desc (mpath)
25 fid = fopen (mpath, 'rt');
29 while (~ (strncmp (line, '% description:', 14) || iseof))
37 while (~ (strncmp (line, '% arguments:', 12) || feof (fid)))
39 bench_desc = [bench_desc, line(3:end)];
46 while (~ (strncmp (line, '% results:', 10) || feof (fid)))
47 i = strfind (line, ' = ');
49 name = line (3:i(1)-1);
50 arg_desc.(name) = line (i(1)+3:end);
58 while (strncmp (line, '%', 1) && ~ feof (fid))
59 i = strfind (line, ' = ');
61 name = line (3:i(1)-1);
62 result_desc.(name) = line (i(1)+3:end);