Wrapping libhyphen.dll using ctypes

5 views
Skip to first unread message

Dr.Leo

unread,
Jul 21, 2012, 11:19:58 AM7/21/12
to pyhy...@googlegroups.com
Hi,

in an effort to make PyHyphen run on all flavors of Windows without
users needing to compile it, I would like to ad a DLL to the source
distribution and wrap it using ctypes.

However, as I am a seasoned C programmer at best, and have no or little
knowledge of ctypes from the Python standard library, I don't know how
to call the relevant C function. Its header is this:

int hnj_hyphen_hyphenate2 (HyphenDict *dict,
const char *word, int word_size, char * hyphens,
char *hyphenated_word, char *** rep, int ** pos, int ** cut);

So can anyone send me the handfull of lines of ctypes declarations to
call this function properly? I am also confused by the fact that
hyphen.c allocates memory for rep, pos and cut rather than using a
buffer allocated by ctypes. So I really really don't know how to go
further on what I think would be a useful enhancement to PyHyphen.

Thanks in advance.

Leo
Reply all
Reply to author
Forward
0 new messages