uqmi: print radio interfaces in serving system command
[project/uqmi.git] / data / gen-error-list.pl
1 #!/usr/bin/env perl
2 use strict;
3 my $doc_start;
4 my $error_data;
5 my $line;
6 my @errors;
7
8 while ($line = <>) {
9 chomp $line;
10
11 $line =~ /^\/\*\*/ and do {
12 $doc_start = 1;
13 next;
14 };
15
16 $line =~ /^\s*\*\// and undef $error_data;
17
18 $doc_start and $line =~ /^\s*\*\s*QmiProtocolError:/ and do {
19 $error_data = 1;
20 undef $doc_start;
21 next;
22 };
23 undef $doc_start;
24
25 $line =~ /^.*@([A-Z0-9_]+): ([A-z0-9 ]+)[.].*$/ and push @errors, [ $1, $2 ];
26 }
27
28 @errors > 0 or die "No data found\n";
29
30 print <<EOF;
31 static const struct {
32 QmiProtocolError code;
33 const char *text;
34 } qmi_errors[] = {
35 EOF
36 foreach my $error (@errors) {
37 print "\t{ ".$error->[0].", \"".$error->[1]."\" },\n";
38 }
39 print <<EOF;
40 };
41 EOF