From 57633137f749b0098eaf703f49ed00c96128966d Mon Sep 17 00:00:00 2001 From: Pixel Date: Tue, 30 Oct 2001 17:38:54 +0000 Subject: Huge work on Tasking System. --- lib/Exceptions.cc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'lib/Exceptions.cc') diff --git a/lib/Exceptions.cc b/lib/Exceptions.cc index eed138a..a4fca0f 100644 --- a/lib/Exceptions.cc +++ b/lib/Exceptions.cc @@ -32,14 +32,12 @@ IOException::IOException(String fn, op_t op, ssize_t s) { msg = strdup(t); } -IOInternal::IOInternal(String fn, op_t op) { - sprintf(t, _("Internal error: has occured while %s from %s: open for %s."), op == IO_WRITE ? _("writing") : _("reading"), - fn.to_charp(), op == IO_WRITE ? _("reading") : _("writing")); - msg = strdup(t); -} - IOGeneral::IOGeneral(String fn) : GeneralException(fn) { } +IOGeneral::IOGeneral() { } + +IOAgain::IOAgain() : IOGeneral(_("No more bytes for reading or writing.")) { } + char * xstrdup(const char * s) throw (MemoryException) { char * r; @@ -62,6 +60,16 @@ void * xmalloc(ssize_t s) throw (MemoryException) { return r; } +void * xrealloc(void * ptr, size_t s) throw (MemoryException) { + void * r; + + if (!(r = ::realloc(ptr, s))) { + throw MemoryException(s); + } + + return r; +} + #ifdef OVER_FREE #undef free #endif -- cgit v1.2.3