Moving interface from Enterprise Architect to C include file

October 1, 2008 by · Leave a Comment
Filed under: Development, Editors 

After writing this, i realized the output after this is almost 100% the same as I got from exporting the original class as a C header from Enterprise Architect, still putting this out there as it’s a nice regex. Cut n paste each function line from EA to the header file. format will be a bit screwed up, for example:

functionname(varname: vartype, varname2: vartype2): void

Begin with moving trailing return type to beginning:

:%s/^\(.*)\): \(\w\+\)$/\2 \1;/g

Get all varnames and vartypes into correct positions:

:%s/\(\w\+\): \(\w\+\)/\2 \1/g

All function declarations should now be fixed.