projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib: standardize public include guards
[babeltrace.git]
/
extras
/
gen-babeltrace-h.py
diff --git
a/extras/gen-babeltrace-h.py
b/extras/gen-babeltrace-h.py
index 7c64a676e2220d5366ad63ab2d11cb6a34cdb89c..b83f262a8bee4b621d51820e6138dc96ed1b1960 100644
(file)
--- a/
extras/gen-babeltrace-h.py
+++ b/
extras/gen-babeltrace-h.py
@@
-45,14
+45,22
@@
def _c_includes_from_sections(sections):
src = ''
for section in sections:
src = ''
for section in sections:
+ # CTF writer is not part of the Babeltrace library
if 'ctf' in section.title.lower():
continue
src += '/* {} */\n'.format(section.title)
if 'ctf' in section.title.lower():
continue
src += '/* {} */\n'.format(section.title)
+ lines = []
for filename in sorted(section.filenames):
for filename in sorted(section.filenames):
- src += '#include <{}>\n'.format(filename)
+ # not part of the API
+ if 'func-status' in filename:
+ continue
+ lines.append('#include <{}>\n'.format(filename))
+
+ lines.sort()
+ src += ''.join(lines)
src += '\n'
return src[:-1]
src += '\n'
return src[:-1]
@@
-62,8
+70,8
@@
def _main():
with open('include/Makefile.am') as f:
sections = _get_sections(f)
with open('include/Makefile.am') as f:
sections = _get_sections(f)
- print('''#ifndef BABELTRACE_BABELTRACE_H
-#define BABELTRACE_BABELTRACE_H
+ print('''#ifndef BABELTRACE
2
_BABELTRACE_H
+#define BABELTRACE
2
_BABELTRACE_H
/*
* Babeltrace API
/*
* Babeltrace API
@@
-90,7
+98,8
@@
def _main():
*/
''')
print(_c_includes_from_sections(sections))
*/
''')
print(_c_includes_from_sections(sections))
- print('#endif /* BABELTRACE_BABELTRACE_H */')
+ print('#endif /* BABELTRACE2_BABELTRACE_H */')
+
if __name__ == '__main__':
_main()
if __name__ == '__main__':
_main()
This page took
0.023285 seconds
and
4
git commands to generate.