Permalink
Browse files

cfwrapper.py improved (cleaning of C header files)

  • Loading branch information...
1 parent b1b49d1 commit 556241731372c5c1b8137a161c35a13fd427fb65 @vmagnin vmagnin committed Feb 16, 2013
Showing with 55,239 additions and 52,952 deletions.
  1. +1,337 −1,307 src/atk-auto.f90
  2. +2,492 −1,932 src/cairo-auto.f90
  3. +9 −2 src/cfwrapper.py
  4. +3,451 −3,451 src/gdk-auto.f90
  5. +603 −577 src/gdk-pixbuf-auto.f90
  6. +21,509 −20,325 src/glib-auto.f90
  7. +21,318 −21,318 src/gtk-auto.f90
  8. +403 −157 src/gtk-fortran-index.csv
  9. +1,259 −1,208 src/gtkenums-auto.f90
  10. +2,855 −2,672 src/pango-auto.f90
  11. +3 −3 src/test.sh
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -25,7 +25,7 @@
# If not, see <http://www.gnu.org/licenses/>.
#
# Contributed by Vincent Magnin, 01.28.2011
-# Last modification: 19.05.2012 (Python 2.7.3, Linux Ubuntu 12.04)
+# Last modification: 16 feb. 2013 (Python 2.7.3, Linux Ubuntu 12.10)
""" This program generates the *-auto.f90 files
from the C header files of GTK+ in Linux.
@@ -392,7 +392,14 @@ def translate_enums(errorsfile, enum_list):
# Remove C structures
#whole_file = re.sub("(?ms)^static.*}$", "", whole_file)
- whole_file = re.sub("(?ms){.*?}[ \w]*;", "", whole_file)
+ # Remove two levels of { } structures:
+ whole_file = re.sub("(?ms){[^{]*?}$", "", whole_file)
+ whole_file = re.sub("(?ms){[^{]*?}$", "", whole_file)
+ # Remove structures like: { } a_name;
+ whole_file = re.sub("(?ms){[^{]*?}[ \w]*?;", "", whole_file)
+ # Remove "available_in" and "deprecated" directives:
+ whole_file = re.sub("(?m)^.*(_AVAILABLE_IN_|_DEPRECATED).*$", "", whole_file)
+
whole_file = re.sub("(?m)^(enum).*$", "", whole_file)
whole_file = re.sub("(?m)^(typedef|union|struct).*$", "", whole_file)
whole_file = re.sub("(?m)^.*(G_BEGIN_DECLS|CAIRO_BEGIN_DECLS) *$", "", whole_file)
Oops, something went wrong.

0 comments on commit 5562417

Please sign in to comment.