diff options
Diffstat (limited to 'includes/Exceptions.h')
-rw-r--r-- | includes/Exceptions.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/includes/Exceptions.h b/includes/Exceptions.h index ef697e7..49be085 100644 --- a/includes/Exceptions.h +++ b/includes/Exceptions.h @@ -21,6 +21,7 @@ class Base { void operator delete(void * p); static void free(void *& p); static void free(char *& p); + static void free(unsigned char *& p); static int pipe(int * p, int flag = 0); static pid_t fork(); }; @@ -32,7 +33,7 @@ class GeneralException : public Base { GeneralException(String); GeneralException(const GeneralException &); ~GeneralException(); - char * GetMsg(); + const char * GetMsg() const; protected: GeneralException(); @@ -44,6 +45,7 @@ char * xstrdup(const char *); void * xmalloc(size_t) throw (GeneralException); void xfree(void *&); void xfree(char *&); +void xfree(unsigned char *&); void * xrealloc(void *, size_t); int xpipe(int *, int = 0) throw (GeneralException); pid_t xfork() throw (GeneralException); @@ -84,6 +86,10 @@ INLINE void Base::free(char *& p) { xfree(p); } +INLINE void Base::free(unsigned char *& p) { + xfree(p); +} + INLINE int Base::pipe(int * p, int flag) { return xpipe(p, flag); } @@ -129,6 +135,14 @@ class TaskSwitch : public GeneralException { TaskSwitch(); }; +class Exit : public GeneralException { + public: + Exit(int); + int GetCode(); + private: + int code; +}; + #include <String.h> #else |