view include/error.h @ 73:4c47b80ad9ac

Added a function, nextFreeBlock that determines the next free block in the filesystem after a given block
author Jonathan Pevarnek <pevarnj@gmail.com>
date Tue, 26 Apr 2011 21:32:20 -0400
parents 7f312eb75ec0
children 36e6fc4a0487
line wrap: on
line source

#ifndef __ERROR_H
#define __ERROR_H

#define mkError(mod,code,sev) (((mod) << 12) | ((code) << 2) | (sev))
#define isError(code) (((code) & 3) == ERROR)
#define errCode(code) (((code) >> 2) & 1023)
#define makeWarn(code) (isError(code)?((((code) >> 2) << 2) | WARN):code) //convert an error into a warning

//Severities
#define INFO 0
#define WARN 1
#define ERROR 2

//Modules
#define MODFS 1 //stuff in the file system
#define MODTOD 2 //Time of date

#define NOERROR 0 //General error code for not an error

//Codes: filesystem
#define ALLOCFAIL 1 //a general code for a malloc failing
#define OUTOFRANGE 2 //
#define MUGGLE 3 //The magic code in the superblock was not set correctly
#define BLKREADFAIL 4 //failure for reading a filesystem block
#define NOTFILE 5
#define BLKWRITEFAIL 6 //failure to write a filesystem block
#define SIZETOOLARGE 7 //the user requested a size that is too large to be set for a file
#define NOTINCACHE 8
#define DISKFULL 9 //every block on the disk is currently set to be in use

//Codes: Time of date
#define UPTIME 1 //the actual time of date was not set in the system
#define INVALID 2


typedef u32 ErrCode;

#endif //__ERROR_H