[C++-sig] [Py++] Generate Python code for ctypes?

Roman Yakovenko roman.yakovenko at gmail.com
Tue Dec 15 06:33:44 CET 2009


On Tue, Dec 15, 2009 at 12:35 AM, Nikolaus Rath <Nikolaus at rath.org> wrote:
> Roman Yakovenko <roman.yakovenko at gmail.com> writes:
>>> Certainly all the exported symbols should already be available from
>>> parsing the header file... Is it possible to omit the symbols file
>>> and generate code based only on the headers?
>>
>> I don't think so( it didn't worked in my use case ) but you can try.
>> Start to comment out code in ctypes_builder.py and post the result :-)
>
> I looked into the xml file created by gccxml and (at least in the case
> of C code) it seems to contain all the information that's needed.
>
> I modified parsers.py to return an empty dict if no symbols_file is
> provided:
>
> def merge_information( global_ns, fname, runs_under_unittest=False ):
>    """high level function - select the appropriate binary file parser and integrates
>    the information from the file to the declarations tree. """
>    if fname is None:
>        return dict()
>
>
> this seems to work partially. I can still export all the struct's, but I
> no longer get any function exports. I can mark them as to be exported
> without any error, but they don't show up in the generated code.
>
> Any idea?

Yes. Py++ thinks that those functions are "private" and doesn't export
them. You should dig father ( creators_factory/ctypes_creator.py ).

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/


More information about the Cplusplus-sig mailing list