Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenff_error.h
Go to the documentation of this file.
00001 /***************************************************************************** 00002 * FullFAT - High Performance, Thread-Safe Embedded FAT File-System * 00003 * Copyright (C) 2009 James Walmsley (james@worm.me.uk) * 00004 * * 00005 * This program is free software: you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation, either version 3 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program. If not, see <http://www.gnu.org/licenses/>. * 00017 * * 00018 * IMPORTANT NOTICE: * 00019 * ================= * 00020 * Alternative Licensing is available directly from the Copyright holder, * 00021 * (James Walmsley). For more information consult LICENSING.TXT to obtain * 00022 * a Commercial license. * 00023 * * 00024 * See RESTRICTIONS.TXT for extra restrictions on the use of FullFAT. * 00025 * * 00026 * Removing the above notice is illegal and will invalidate this license. * 00027 ***************************************************************************** 00028 * See http://worm.me.uk/fullfat for more information. * 00029 * Or http://fullfat.googlecode.com/ for latest releases and the wiki. * 00030 *****************************************************************************/ 00031 #ifndef _FF_ERROR_H_ 00032 #define _FF_ERROR_H_ 00033 00040 #include "ff_config.h" 00041 #include "ff_types.h" 00042 00051 #define FF_GETERROR(x) (x & 0x0000FFFF) 00052 00053 #define FF_MODULE_SHIFT 24 00054 #define FF_FUNCTION_SHIFT 16 00055 00056 //----- FullFAT Module Identifiers 00057 #define FF_MODULE_IOMAN (1 << FF_MODULE_SHIFT) 00058 #define FF_MODULE_DIR (2 << FF_MODULE_SHIFT) 00059 #define FF_MODULE_FILE (3 << FF_MODULE_SHIFT) 00060 #define FF_MODULE_FAT (4 << FF_MODULE_SHIFT) 00061 #define FF_MODULE_CRC (5 << FF_MODULE_SHIFT) 00062 #define FF_MODULE_FORMAT (6 << FF_MODULE_SHIFT) 00063 #define FF_MODULE_HASH (7 << FF_MODULE_SHIFT) 00064 #define FF_MODULE_MEMORY (8 << FF_MODULE_SHIFT) 00065 #define FF_MODULE_STRING (9 << FF_MODULE_SHIFT) 00066 #define FF_MODULE_UNICODE (10 << FF_MODULE_SHIFT) 00067 #define FF_MODULE_SAFETY (11 << FF_MODULE_SHIFT) 00068 #define FF_MODULE_TIME (12 << FF_MODULE_SHIFT) 00069 #define FF_MODULE_DRIVER (13 << FF_MODULE_SHIFT) // We can mark underlying platform error codes with this. 00070 00071 //----- FullFAT Function Identifiers (In Modular Order) 00072 //----- FF_IOMAN - The FullFAT I/O Manager. 00073 #define FF_CREATEIOMAN (1 << FF_FUNCTION_SHIFT) | FF_MODULE_IOMAN 00074 #define FF_DESTROYIOMAN (2 << FF_FUNCTION_SHIFT) | FF_MODULE_IOMAN 00075 #define FF_REGISTERBLKDEVICE (3 << FF_FUNCTION_SHIFT) | FF_MODULE_IOMAN 00076 #define FF_UNREGISTERBLKDEVICE (4 << FF_FUNCTION_SHIFT) | FF_MODULE_IOMAN 00077 #define FF_MOUNTPARTITION (5 << FF_FUNCTION_SHIFT) | FF_MODULE_IOMAN 00078 #define FF_UNMOUNTPARTITION (6 << FF_FUNCTION_SHIFT) | FF_MODULE_IOMAN 00079 #define FF_FLUSHCACHE (7 << FF_FUNCTION_SHIFT) | FF_MODULE_IOMAN 00080 #define FF_GETPARTITIONBLOCKSIZE (8 << FF_FUNCTION_SHIFT) | FF_MODULE_IOMAN 00081 #define FF_BLOCKREAD (9 << FF_FUNCTION_SHIFT) | FF_MODULE_IOMAN 00082 #define FF_BLOCKWRITE (10 << FF_FUNCTION_SHIFT) | FF_MODULE_IOMAN 00083 00084 //----- FF_DIR - The FullFAT directory handling routines. 00085 // -- COMPLETE THESE ERROR CODES TOMORROW :P 00086 00087 00088 /* FullFAT defines different Error-Code spaces for each module. This ensures 00089 that all error codes remain unique, and their meaning can be quickly identified. 00090 */ 00091 // Global Error Codes 00092 #define FF_ERR_NONE 0 ///< No Error 00093 //#define FF_ERR_GENERIC 1 ///< BAD NEVER USE THIS! 00094 #define FF_ERR_NULL_POINTER 2 ///< pIoman was NULL. 00095 #define FF_ERR_NOT_ENOUGH_MEMORY 3 ///< malloc() failed! - Could not allocate handle memory. 00096 #define FF_ERR_DEVICE_DRIVER_FAILED 4 ///< The Block Device driver reported a FATAL error, cannot continue. 00097 00098 00099 // IOMAN Error Codes 00100 #define FF_ERR_IOMAN_BAD_BLKSIZE 11 ///< The provided blocksize was not a multiple of 512. 00101 #define FF_ERR_IOMAN_BAD_MEMSIZE 12 ///< The memory size was not a multiple of the blocksize. 00102 #define FF_ERR_IOMAN_DEV_ALREADY_REGD 13 ///< Device was already registered. Use FF_UnRegister() to re-use this IOMAN with another device. 00103 #define FF_ERR_IOMAN_NO_MOUNTABLE_PARTITION 14 ///< A mountable partition could not be found on the device. 00104 #define FF_ERR_IOMAN_INVALID_FORMAT 15 ///< The 00105 #define FF_ERR_IOMAN_INVALID_PARTITION_NUM 16 ///< The partition number provided was out of range. 00106 #define FF_ERR_IOMAN_NOT_FAT_FORMATTED 17 ///< The partition did not look like a FAT partition. 00107 #define FF_ERR_IOMAN_DEV_INVALID_BLKSIZE 18 ///< IOMAN object BlkSize is not compatible with the blocksize of this device driver. 00108 #define FF_ERR_IOMAN_PARTITION_MOUNTED 19 ///< Device is in use by an actively mounted partition. Unmount the partition first. 00109 #define FF_ERR_IOMAN_ACTIVE_HANDLES 20 ///< The partition cannot be unmounted until all active file handles are closed. (There may also be active handles on the cache). 00110 #define FF_ERR_IOMAN_GPT_HEADER_CORRUPT 21 ///< The GPT partition table appears to be corrupt, refusing to mount. 00111 #define FF_ERR_IOMAN_NOT_ENOUGH_FREE_SPACE 22 00112 #define FF_ERR_IOMAN_OUT_OF_BOUNDS_READ 23 00113 #define FF_ERR_IOMAN_OUT_OF_BOUNDS_WRITE 24 00114 00115 00116 // File Error Codes 30 + 00117 #define FF_ERR_FILE_ALREADY_OPEN 30 ///< File is in use. 00118 #define FF_ERR_FILE_NOT_FOUND 31 ///< File was not found. 00119 #define FF_ERR_FILE_OBJECT_IS_A_DIR 32 ///< Tried to FF_Open() a Directory. 00120 #define FF_ERR_FILE_IS_READ_ONLY 33 ///< Tried to FF_Open() a file marked read only. 00121 #define FF_ERR_FILE_INVALID_PATH 34 ///< The path of the file was not found. 00122 #define FF_ERR_FILE_NOT_OPENED_IN_WRITE_MODE 35 00123 #define FF_ERR_FILE_NOT_OPENED_IN_READ_MODE 36 00124 #define FF_ERR_FILE_EXTEND_FAILED 37 ///< Could not extend the file. 00125 #define FF_ERR_FILE_DESTINATION_EXISTS 38 00126 #define FF_ERR_FILE_SOURCE_NOT_FOUND 39 00127 #define FF_ERR_FILE_DIR_NOT_FOUND 40 00128 #define FF_ERR_FILE_COULD_NOT_CREATE_DIRENT 41 00129 00130 // Directory Error Codes 50 + 00131 #define FF_ERR_DIR_OBJECT_EXISTS 50 ///< A file or folder of the same name already exists in the current directory. 00132 #define FF_ERR_DIR_DIRECTORY_FULL 51 ///< No more items could be added to the directory. 00133 #define FF_ERR_DIR_END_OF_DIR 52 /// 00134 #define FF_ERR_DIR_NOT_EMPTY 53 ///< Cannot delete a directory that contains files or folders. 00135 #define FF_ERR_DIR_INVALID_PATH 54 ///< Could not find the directory specified by the path. 00136 #define FF_ERR_DIR_CANT_EXTEND_ROOT_DIR 55 ///< Can't extend the root dir. 00137 #define FF_ERR_DIR_EXTEND_FAILED 56 ///< Not enough space to extend the directory. 00138 #define FF_ERR_DIR_NAME_TOO_LONG 57 ///< Name exceeds the number of allowed charachters for a filename. 00139 00140 // Fat Error Codes 70 + 00141 #define FF_ERR_FAT_NO_FREE_CLUSTERS 70 ///< No more free space is available on the disk. 00142 00143 // UNICODE Error Codes 100 + 00144 #define FF_ERR_UNICODE_INVALID_CODE 100 ///< An invalid Unicode charachter was provided! 00145 #define FF_ERR_UNICODE_DEST_TOO_SMALL 101 ///< Not enough space in the UTF-16 buffer to encode the entire sequence as UTF-16. 00146 #define FF_ERR_UNICODE_INVALID_SEQUENCE 102 ///< An invalid UTF-16 sequence was encountered. 00147 #define FF_ERR_UNICODE_CONVERSION_EXCEEDED 103 ///< Filename exceeds MAX long-filename length when converted to UTF-16. 00148 00149 #ifdef FF_DEBUG 00150 const FF_T_INT8 *FF_GetErrMessage(FF_ERROR iErrorCode); 00151 #else 00152 #define FF_GetErrMessage(X) "" // A special MACRO incase FF_GetErrMessage() isn't gated with FF_DEBUG 00153 #endif // Function call is safely replaced with a NULL string. 00154 00155 #endif 00156 Generated on Sun May 27 2012 04:33:11 for ReactOS by
1.7.6.1
|