- const char* Description, va_list const &args) {
- char S[400];
- vsnprintf(S,sizeof(S),Description,args);
- snprintf(S + strlen(S),sizeof(S) - strlen(S),
- " - %s (%i: %s)", Function, errno, strerror(errno));
- return Insert(type, S, args);
-}
- /*}}}*/
-// GlobalError::Fatal - Add a fatal error to the list /*{{{*/
-bool GlobalError::Fatal(const char *Description,...) {
- va_list args;
- va_start(args,Description);
- return Insert(FATAL, Description, args);
-}
- /*}}}*/
-// GlobalError::Error - Add an error to the list /*{{{*/
-bool GlobalError::Error(const char *Description,...) {
- va_list args;
- va_start(args,Description);
- return Insert(ERROR, Description, args);
-}
- /*}}}*/
-// GlobalError::Warning - Add a warning to the list /*{{{*/
-bool GlobalError::Warning(const char *Description,...) {
- va_list args;
- va_start(args,Description);
- return Insert(WARNING, Description, args);
+ const char* Description, va_list &args,
+ int const errsv, size_t &msgSize) {
+ char* S = (char*) malloc(msgSize);
+ int const n = snprintf(S, msgSize, "%s - %s (%i: %s)", Description,
+ Function, errsv, strerror(errsv));
+ if (n > -1 && ((unsigned int) n) < msgSize);
+ else {
+ if (n > -1)
+ msgSize = n + 1;
+ else
+ msgSize *= 2;
+ free(S);
+ return true;
+ }
+
+ bool const geins = Insert(type, S, args, msgSize);
+ free(S);
+ return geins;