yaffs working on the timothy_tests. just need to save the current state of the program.
[yaffs2.git] / direct / timothy_tests / error_handler.c
diff --git a/direct/timothy_tests/error_handler.c b/direct/timothy_tests/error_handler.c
new file mode 100644 (file)
index 0000000..f060caf
--- /dev/null
@@ -0,0 +1,19 @@
+#include "error_handler.h"
+
+void yaffs_check_for_errors(char output, buffer *message_buffer,char error_message[],char success_message[])
+{
+       if (output==-1)
+       {
+               add_to_buffer(message_buffer, "error##########",MESSAGE_LEVEL_ERROR);
+               add_to_buffer(message_buffer, error_message,MESSAGE_LEVEL_ERROR);
+               add_to_buffer(message_buffer, "error_code",MESSAGE_LEVEL_ERROR);
+                printf("%d\n",yaffs_get_error());              
+
+               //print_buffer(message_buffer,PRINT_ALL);
+       
+       }
+       else{
+               add_to_buffer(message_buffer, success_message,MESSAGE_LEVEL_BASIC_TASKS);
+       }
+               
+}