X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=extras%2Fgen-babeltrace-h.py;h=b83f262a8bee4b621d51820e6138dc96ed1b1960;hb=924dc299c8a893e92fcd985fa05c245b591ef314;hp=7c64a676e2220d5366ad63ab2d11cb6a34cdb89c;hpb=67d2ce028c96b6a3b3614b393d8928663bce4490;p=babeltrace.git diff --git a/extras/gen-babeltrace-h.py b/extras/gen-babeltrace-h.py index 7c64a676..b83f262a 100644 --- 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: + # CTF writer is not part of the Babeltrace library if 'ctf' in section.title.lower(): continue src += '/* {} */\n'.format(section.title) + lines = [] 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] @@ -62,8 +70,8 @@ def _main(): with open('include/Makefile.am') as f: sections = _get_sections(f) - print('''#ifndef BABELTRACE_BABELTRACE_H -#define BABELTRACE_BABELTRACE_H + print('''#ifndef BABELTRACE2_BABELTRACE_H +#define BABELTRACE2_BABELTRACE_H /* * Babeltrace API @@ -90,7 +98,8 @@ def _main(): */ ''') print(_c_includes_from_sections(sections)) - print('#endif /* BABELTRACE_BABELTRACE_H */') + print('#endif /* BABELTRACE2_BABELTRACE_H */') + if __name__ == '__main__': _main()