lib: strictly type function return status enumerations
[babeltrace.git] / extras / gen-babeltrace-h.py
index 18310b5ec5d0596e22ac5f89225cefae380cdd3a..75d328febbf85af36c92f0fc63b26ce9303834fc 100644 (file)
@@ -24,10 +24,10 @@ def _get_sections(file):
             cur_title = m.group(1)
             continue
 
-        m = re.match(r'^\s+(babeltrace/.+\.h).*$', line)
+        m = re.match(r'^\s+(babeltrace2/.+\.h).*$', line)
 
         if m:
-            if m.group(1) != 'babeltrace/babeltrace.h':
+            if m.group(1) != 'babeltrace2/babeltrace.h':
                 cur_filenames.append(m.group(1))
 
             continue
@@ -45,11 +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]
@@ -65,7 +76,7 @@ def _main():
 /*
  * Babeltrace API
  *
- * Copyright 2010-2017 EfficiOS Inc. <http://www.efficios.com/>
+ * Copyright 2010-2018 EfficiOS Inc. <http://www.efficios.com/>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -89,5 +100,6 @@ def _main():
     print(_c_includes_from_sections(sections))
     print('#endif /* BABELTRACE_BABELTRACE_H */')
 
+
 if __name__ == '__main__':
     _main()
This page took 0.023782 seconds and 4 git commands to generate.