5 def __init__(self
, title
, filenames
):
7 self
.filenames
= filenames
10 def _get_sections(file):
16 m
= re
.match(r
'^# (.+API.*)$', line
)
20 sections
.append(_Section(cur_title
, cur_filenames
))
24 cur_title
= m
.group(1)
27 m
= re
.match(r
'^\s+(babeltrace/.+\.h).*$', line
)
30 if m
.group(1) != 'babeltrace/babeltrace.h':
31 cur_filenames
.append(m
.group(1))
35 if re
.match(r
'^noinst_HEADERS.*', line
):
39 sections
.append(_Section(cur_title
, cur_filenames
))
44 def _c_includes_from_sections(sections
):
47 for section
in sections
:
48 src
+= '/* {} */\n'.format(section
.title
)
50 for filename
in sorted(section
.filenames
):
51 src
+= '#include <{}>\n'.format(filename
)
59 with
open('include/Makefile.am') as f
:
60 sections
= _get_sections(f
)
62 print('''#ifndef BABELTRACE_BABELTRACE_H
63 #define BABELTRACE_BABELTRACE_H
68 * Copyright 2010-2018 EfficiOS Inc. <http://www.efficios.com/>
70 * Permission is hereby granted, free of charge, to any person obtaining a copy
71 * of this software and associated documentation files (the "Software"), to deal
72 * in the Software without restriction, including without limitation the rights
73 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
74 * copies of the Software, and to permit persons to whom the Software is
75 * furnished to do so, subject to the following conditions:
77 * The above copyright notice and this permission notice shall be included in
78 * all copies or substantial portions of the Software.
80 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
81 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
82 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
83 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
84 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
85 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
89 print(_c_includes_from_sections(sections
))
90 print('#endif /* BABELTRACE_BABELTRACE_H */')
92 if __name__
== '__main__':
This page took 0.031825 seconds and 4 git commands to generate.