Fix python wrapper pointer types
[yaffs2.git] / direct / python / yaffsfs.py
index 28d7097a39768f052087260106174c241b7ac9f9..79b6adb24a0f4ebc1f937a1289a2bd847262f751 100644 (file)
@@ -15,6 +15,12 @@ from ctypes import *
 cdll.LoadLibrary("./libyaffsfs.so")
 ylib = CDLL("./libyaffsfs.so")
 
+#const char * yaffs_error_to_str(int err);
+yaffs_error_to_str = ylib.yaffs_error_to_str
+yaffs_error_to_str.argtypes=[c_int]
+yaffs_error_to_str.restype=c_char_p
+
+
 #int yaffs_open_sharing(const YCHAR *path, int oflag, int mode, int sharingmode) ;
 yaffs_open_sharing = ylib.yaffs_open_sharing
 yaffs_open_sharing.argtypes = [ c_char_p, c_int, c_int, c_int]
@@ -165,21 +171,21 @@ class yaffs_dirent_struct(Structure):
 #yaffs_DIR *yaffs_opendir(const YCHAR *dirname) ;
 yaffs_opendir = ylib.yaffs_opendir
 yaffs_opendir.argtypes = [c_char_p]
-yaffs_opendir.restype = c_int
+yaffs_opendir.restype = c_void_p
 
 #struct yaffs_dirent *yaffs_readdir(yaffs_DIR *dirp) ;
 yaffs_readdir= ylib.yaffs_readdir
-yaffs_readdir.argtypes=[c_int]
+yaffs_readdir.argtypes=[c_void_p]
 yaffs_readdir.restype=POINTER(yaffs_dirent_struct)
 
 #void yaffs_rewinddir(yaffs_DIR *dirp) ;
 yaffs_rewinddir = ylib.yaffs_rewinddir
-yaffs_rewinddir.argtypes = [c_int]
-yaffs_rewinddir.restype = c_int ###### Should be void
+yaffs_rewinddir.argtypes = [c_void_p]
+yaffs_rewinddir.restype = None # void
 
 #int yaffs_closedir(yaffs_DIR *dirp) ;
 yaffs_closedir = ylib.yaffs_closedir
-yaffs_closedir.argtypes = [c_int]
+yaffs_closedir.argtypes = [c_void_p]
 yaffs_closedir.restype = c_int