view include/error.h @ 96:a480d02a10c8

merge
author Jonathan Pevarnek <pevarnj@gmail.com>
date Sat, 14 May 2011 12:54:47 -0400
parents 36e6fc4a0487
children 32560561ccea
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
#define EXISTS 10 //the user tried to create a file that already exists

//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