This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author theller
Recipients collinwinter, loewis, nnorwitz, theller
Date 2008-03-25.08:44:05
SpamBayes Score 0.0045377086
Marked as misclassified No
Message-id <47E8BB52.104@ctypes.org>
In-reply-to <1206376898.67.0.57487519334.issue2470@psf.upfronthosting.co.za>
Content
> In the simplest case, convert
> 
> import dl
> libc = dl.open("libc.so.6")
> iconv = libc.call("iconv_open", "ISO-8859-1", "ISO-8859-2")
> print(iconv)
> 
> to
> 
> import ctypes
> libc = ctypes.CDLL("libc.so.6")
> iconv = libc.iconv_open("ISO-8859-1", "ISO-8859-2")
> print(iconv)
> 
> Notice that <dlobject>.call has up to 11 arguments, the first one being
> the function name.
> 
> Thomas, is it the case that all calls to dl.call can be converted to a
> ctypes call without parameter conversion? dl supports these parameter
> types:
> - byte string, passed as char*
> - integers, passed as int
> - None, passed as NULL

Yes, this is correct.
History
Date User Action Args
2008-03-25 08:44:07thellersetspambayes_score: 0.00453771 -> 0.0045377086
recipients: + theller, loewis, nnorwitz, collinwinter
2008-03-25 08:44:06thellerlinkissue2470 messages
2008-03-25 08:44:05thellercreate