From 84f122f301b6a27295641fcbde3a6fbcfea78a99 Mon Sep 17 00:00:00 2001 From: Charles Manning Date: Fri, 3 Dec 2010 14:50:57 +1300 Subject: [PATCH] yaffs direct: Move yaffs error string function to diferent directory This was in the python directory but is generally handy so move it into the yaffs direct direcotory. Signed-off-by: Charles Manning --- direct/python/Makefile | 8 +++--- direct/python/yaffs_error_converter.h | 24 ----------------- direct/python/yaffs_python_helper.c | 1 - direct/timothy_tests/quick_tests/Makefile | 11 ++++---- .../timothy_tests/quick_tests/quick_tests.h | 1 - .../yaffs_error_converter.c => yaffs_error.c} | 2 +- direct/yaffsfs.h | 26 ++++++++++++++++++- 7 files changed, 36 insertions(+), 37 deletions(-) delete mode 100644 direct/python/yaffs_error_converter.h rename direct/{python/yaffs_error_converter.c => yaffs_error.c} (97%) diff --git a/direct/python/Makefile b/direct/python/Makefile index 6e0c5fd..4a54185 100644 --- a/direct/python/Makefile +++ b/direct/python/Makefile @@ -41,10 +41,11 @@ COMMONTESTOBJS = yaffscfg2k.o yaffs_osglue.o yaffs_hweight.o\ yaffs_norif1.o ynorsim.o \ yaffs_bitmap.o \ yaffs_verify.o \ - yaffs_yaffs1.o yaffs_yaffs2.o + yaffs_yaffs1.o yaffs_yaffs2.o \ + yaffs_error.o -YAFFSLIBOBJS = $(COMMONTESTOBJS) yaffs_python_helper.o yaffs_error_converter.o +YAFFSLIBOBJS = $(COMMONTESTOBJS) yaffs_python_helper.o @@ -65,7 +66,8 @@ YAFFSDIRECTSYMLINKS = yaffsfs.c yaffsfs.h yaffscfg.h yaffs_osglue.h ydirectenv yaffs_flashif.c yaffs_flashif.h yaffs_flashif2.h yaffs_list.h \ yaffs_nandif.c yaffs_nandif.h yaffs_qsort.c yaffs_nandemul2k.h \ yportenv.h yaffs_attribs.c \ - yaffs_hweight.c yaffs_hweight.h + yaffs_hweight.c yaffs_hweight.h \ + yaffs_error.c DIRECTEXTRASYMLINKS = yaffscfg2k.c yaffs_fileem2k.c yaffs_fileem2k.h\ yaffs_fileem.c yaffs_norif1.c yaffs_norif1.h \ diff --git a/direct/python/yaffs_error_converter.h b/direct/python/yaffs_error_converter.h deleted file mode 100644 index 8ff76d2..0000000 --- a/direct/python/yaffs_error_converter.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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 Timothy Manning - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. - */ - -#ifndef __error_handler_h__ -#define __error_handler_h__ -#include - -#include "yaffsfs.h" -#include "yportenv.h" - -const char * yaffs_error_to_str(int err); -#endif diff --git a/direct/python/yaffs_python_helper.c b/direct/python/yaffs_python_helper.c index 7c2c7e0..333ad58 100644 --- a/direct/python/yaffs_python_helper.c +++ b/direct/python/yaffs_python_helper.c @@ -22,7 +22,6 @@ #include "yaffsfs.h" #include "yaffs_trace.h" -#include "yaffs_error_converter.h" int simulate_power_failure; int random_seed; diff --git a/direct/timothy_tests/quick_tests/Makefile b/direct/timothy_tests/quick_tests/Makefile index 22a772d..f798ce9 100644 --- a/direct/timothy_tests/quick_tests/Makefile +++ b/direct/timothy_tests/quick_tests/Makefile @@ -41,7 +41,8 @@ COMMONTESTOBJS = yaffscfg2k.o yaffs_osglue.o yaffs_hweight.o \ yaffs_bitmap.o \ yaffs_yaffs1.o \ yaffs_yaffs2.o \ - yaffs_verify.o + yaffs_verify.o \ + yaffs_error.o # yaffs_checkptrwtest.o\ @@ -114,10 +115,7 @@ TESTFILES = quick_tests.o lib.o \ YAFFSTESTOBJS = $(COMMONTESTOBJS) $(TESTFILES) -PYTONOSYMLINKS = yaffs_error_converter.c yaffs_error_converter.h -PYTHONOBJS = yaffs_error_converter.o - -ALLOBJS = $(sort $(YAFFSTESTOBJS)) $(PYTHONOBJS) +ALLOBJS = $(sort $(YAFFSTESTOBJS)) YAFFSSYMLINKS = yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yaffs_tagscompat.c yaffs_tagscompat.h \ yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h \ @@ -137,7 +135,8 @@ YAFFSDIRECTSYMLINKS = yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\ yaffs_nandemul2k.h yaffs_list.h \ yaffs_attribs.c yaffs_osglue.h \ yaffs_nandif.c yaffs_nandif.h yportenv.h \ - yaffs_hweight.h yaffs_hweight.c + yaffs_hweight.h yaffs_hweight.c \ + yaffs_error.c DIRECTEXTRASYMLINKS = yaffscfg2k.c yaffs_fileem2k.c yaffs_fileem2k.h\ diff --git a/direct/timothy_tests/quick_tests/quick_tests.h b/direct/timothy_tests/quick_tests/quick_tests.h index 78ec211..bee341c 100644 --- a/direct/timothy_tests/quick_tests/quick_tests.h +++ b/direct/timothy_tests/quick_tests/quick_tests.h @@ -255,7 +255,6 @@ #include "test_yaffs_dup_EBADF.h" #include "yaffsfs.h" -#include "yaffs_error_converter.h" #include "lib.h" diff --git a/direct/python/yaffs_error_converter.c b/direct/yaffs_error.c similarity index 97% rename from direct/python/yaffs_error_converter.c rename to direct/yaffs_error.c index c7eb17c..6757eec 100644 --- a/direct/python/yaffs_error_converter.c +++ b/direct/yaffs_error.c @@ -11,7 +11,7 @@ * published by the Free Software Foundation. */ -#include "yaffs_error_converter.h" +#include "yaffsfs.h" struct error_entry { int code; diff --git a/direct/yaffsfs.h b/direct/yaffsfs.h index 6eb30ef..29d81fc 100644 --- a/direct/yaffsfs.h +++ b/direct/yaffsfs.h @@ -173,13 +173,15 @@ void yaffs_add_device(struct yaffs_dev *dev); int yaffs_start_up(void); int yaffsfs_GetLastError(void); -int yaffs_set_error(int error); + /* Function to get the last error */ int yaffs_get_error(void); +const char * yaffs_error_to_str(int err); /* Function only for debugging */ void * yaffs_getdev(const YCHAR *path); int yaffs_dump_dev(const YCHAR *path); +int yaffs_set_error(int error); /* Trace control functions */ unsigned yaffs_set_trace(unsigned tm); @@ -187,3 +189,25 @@ unsigned yaffs_get_trace(void); #endif +/* + * 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 Timothy Manning + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 2.1 as + * published by the Free Software Foundation. + * + * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. + */ + +#ifndef __error_handler_h__ +#define __error_handler_h__ +#include + +#include "yaffsfs.h" +#include "yportenv.h" +#endif -- 2.30.2