diff options
Diffstat (limited to 'portato/eix/libeix.pyx')
-rw-r--r-- | portato/eix/libeix.pyx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/portato/eix/libeix.pyx b/portato/eix/libeix.pyx new file mode 100644 index 0000000..2b3ebb0 --- /dev/null +++ b/portato/eix/libeix.pyx @@ -0,0 +1,14 @@ +from portato.eix.eix_utils cimport File, fopen, fclose, ffree, fget + +def test (f): + cdef File* cf + cdef char* buf + + print "Trying to open: ", f + cf = fopen(f, "r") + try: + buf = fget(cf, 20) + print "The first two chars:", buf[0], buf[1] + ffree(buf) + finally: + fclose(cf) |