yaffs Add error retrieval function for yaffs direct testing
authorTimothy Manning <tfhmanning@gmail.com>
Fri, 15 Oct 2010 02:40:53 +0000 (15:40 +1300)
committerTimothy Manning <tfhmanning@gmail.com>
Fri, 15 Oct 2010 02:40:53 +0000 (15:40 +1300)
Allows yaffs direct errors to be read in python.

Signed-off-by: Timothy Manning <tfhmanning@gmail.com>
direct/python/yaffsfs.py
direct/yaffsfs.c
direct/yaffsfs.h

index 986f35892a741769f5aaf648a4e1ee09afcadde1..7347687cf9a1ff461e758ac82361e77253f9c22a 100644 (file)
@@ -255,6 +255,11 @@ yaffs_get_trace=ylib.yaffs_get_trace
 yaffs_get_trace.argtypes=[]
 yaffs_get_trace.restypes=c_uint
 
 yaffs_get_trace.argtypes=[]
 yaffs_get_trace.restypes=c_uint
 
+#int yaffs_get_error(void)
+yaffs_get_error=ylib.yaffs_get_error
+yaffs_get_error.argtypes=[]
+yaffs_get_error.restypes=c_int
+
 yaffs_O_CREAT=ylib.yaffs_O_CREAT()
 yaffs_O_RDONLY=ylib.yaffs_O_RDONLY()
 yaffs_O_WRONLY=ylib.yaffs_O_WRONLY()
 yaffs_O_CREAT=ylib.yaffs_O_CREAT()
 yaffs_O_RDONLY=ylib.yaffs_O_RDONLY()
 yaffs_O_WRONLY=ylib.yaffs_O_WRONLY()
index 22948881b5081e1eb8b8da97674b952f6c852a2d..83605c57a44064fde95c9f79bb7050d0dc28f672 100644 (file)
@@ -2326,6 +2326,11 @@ int yaffs_n_handles(const YCHAR *path)
        return yaffsfs_CountHandles(obj);
 }
 
        return yaffsfs_CountHandles(obj);
 }
 
+int yaffs_get_error(void)
+{
+       return yaffsfs_GetLastError();
+}
+
 int yaffs_DumpDevStruct(const YCHAR *path)
 {
 #if 0
 int yaffs_DumpDevStruct(const YCHAR *path)
 {
 #if 0
index 36b7e5a8555596dab811cbec1722d7ca672b592e..6dd2c943f731a60d19a2162a4eac01e3f749e95b 100644 (file)
@@ -171,11 +171,14 @@ void yaffs_AddDevice(struct yaffs_DeviceStruct *dev);
 
 int yaffs_StartUp(void);
 
 
 int yaffs_StartUp(void);
 
+/* Function to get the last error */
+int yaffs_get_error(void);
 
 /* Function only for debugging */
 void * yaffs_getdev(const YCHAR *path);
 int yaffs_DumpDevStruct(const YCHAR *path);
 
 
 /* Function only for debugging */
 void * yaffs_getdev(const YCHAR *path);
 int yaffs_DumpDevStruct(const YCHAR *path);
 
+
 #endif
 
 
 #endif