X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=direct%2Fpython%2Fyaffsfs.py;h=79b6adb24a0f4ebc1f937a1289a2bd847262f751;hb=65181386582a6257c55c1d114c82697d7a35231c;hp=03583fdea6a1fdacf086c548aad9832f6fd3b166;hpb=7396445d7d0d13469b9505791114b9dc6b76ffe4;p=yaffs2.git diff --git a/direct/python/yaffsfs.py b/direct/python/yaffsfs.py index 03583fd..79b6adb 100644 --- a/direct/python/yaffsfs.py +++ b/direct/python/yaffsfs.py @@ -1,7 +1,26 @@ +## +## YAFFS: Yet Another Flash File System. A NAND-flash specific file system. +## +## Copyright (C) 2002-2010 Aleph One Ltd. +## for Toby Churchill Ltd and Brightstar Engineering +## +## Created by Charles Manning +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License version 2 as +## published by the Free Software Foundation. +## + 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] @@ -152,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