summaryrefslogtreecommitdiff
path: root/lib/Exceptions.cc
diff options
context:
space:
mode:
authorPixel <Pixel>2001-10-30 17:38:54 +0000
committerPixel <Pixel>2001-10-30 17:38:54 +0000
commit57633137f749b0098eaf703f49ed00c96128966d (patch)
treef7e55be48d4724d44e5ed2362cf836162e866d05 /lib/Exceptions.cc
parente5057005049b11af44cb804118f95370f03ab32c (diff)
Huge work on Tasking System.
Diffstat (limited to 'lib/Exceptions.cc')
-rw-r--r--lib/Exceptions.cc20
1 files changed, 14 insertions, 6 deletions
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