[fetter-devel] Possible solution for multiple includes

Kenny Tilton ktilton at nyc.rr.com
Fri Oct 7 09:58:28 UTC 2005


I have joked before about the downside of generating bindings only for 
symbols mentioned in include files actually listed in a binding 
definition, as opposed to files reached via nested includes: large 
libraries customarily break their apis up into multiple includes, so 
these have to be listed in the binding definition to get bindings generated.

I just ran into an egregious case of this as I look to see if vzn can 
handle wxWidgets:

> #include "wx/defs.h"
> #include "wx/object.h"
> #include "wx/dynarray.h"
> #include "wx/list.h"
> #include "wx/hash.h"
> #include "wx/string.h"
> #include "wx/intl.h"
> #include "wx/log.h"
> #include "wx/event.h"
> #include "wx/app.h"
> #include "wx/utils.h"
> #include "wx/stream.h"
>
> #if wxUSE_GUI
>
> #include "wx/window.h"
> #include "wx/panel.h"
> #include "wx/frame.h"
> #include "wx/dc.h"
> #include "wx/dcclient.h"
> #include "wx/dcmemory.h"
> #include "wx/dcprint.h"
> #include "wx/dcscreen.h"
> #include "wx/button.h"
> #include "wx/menu.h"
> #include "wx/pen.h"
> #include "wx/brush.h"
> #include "wx/palette.h"
> #include "wx/icon.h"
> #include "wx/cursor.h"
> #include "wx/dialog.h"
> #include "wx/timer.h"
> #include "wx/settings.h"
> #include "wx/msgdlg.h"
> #include "wx/cmndata.h"
>
> #include "wx/control.h"
> #include "wx/ctrlsub.h"
> #include "wx/bmpbuttn.h"
> #include "wx/checkbox.h"
> #include "wx/checklst.h"
> #include "wx/choice.h"
> #include "wx/scrolbar.h"
> #include "wx/stattext.h"
> #include "wx/statbmp.h"
> #include "wx/statbox.h"
> #include "wx/listbox.h"
> #include "wx/radiobox.h"
> #include "wx/radiobut.h"
> #include "wx/textctrl.h"
> #include "wx/slider.h"
> #include "wx/gauge.h"
> #include "wx/scrolwin.h"
> #include "wx/dirdlg.h"
> #include "wx/toolbar.h"
> #include "wx/combobox.h"
> #include "wx/layout.h"
> #include "wx/sizer.h"
> #include "wx/memory.h"
> #include "wx/mdi.h"
> #include "wx/statusbr.h"
> #include "wx/scrolbar.h"
> #include "wx/choicdlg.h"
> #include "wx/textdlg.h"
> #include "wx/filedlg.h"
>
> #include "wx/validate.h"
>
> #include "wx/valtext.h"


<g>

Well, it is not that hard to paste the same list into a binding 
defintion, but it occurred to me that there is a natural solution to 
this minor annoyance. What if vzn generated bindings for any include 
found in the same directory tree as any listed include?

There is a gotcha here, perhaps. I gave up fighting VC++ at one point 
and just copied the headers for a package into /vc++/vc98/include. So 
one would now be back to pulling in every symbol ala windows.h. But! In 
this case, the source all includes "wx/wx....h", so I will be creating a 
"wx" subdirectory under the vc++ include directory, and the scheme I 
propose would thus work.

But! number two is that maybe I gave up too fast on vc++. It does allow 
specification of other search paths for includes. I tried that without 
success on something or other, but probably that could have been made to 
work, and again this scheme would hold up.

I have not thought this through exhaustively. Can anyone see an 
objection? Obviously the big one would be: vzn cannot see the paths! Can it?

-- 
Kenny

Why Lisp? http://wiki.alu.org/RtL_Highlight_Film

"I've wrestled with reality for 35 years, Doctor, and I'm happy to state I finally won out over it."
    Elwood P. Dowd, "Harvey", 1950






More information about the fetter-devel mailing list