New variant of gerrinfo() - output to log arbitrary message with file-line information

This commit is contained in:
Stas Degteff 2011-02-22 00:08:17 +00:00
parent 4ae22df357
commit bed4391df4
2 changed files with 13 additions and 1 deletions

View File

@ -72,6 +72,15 @@ char* gerrinfo(int __type, const char* __file, int __line) {
}
// -------------------------------------------------------------------
char* gerrinfo(const char* __message, const char* __file, int __line) {
snprintf(gerrbuf, sizeof(gerrbuf), "%s at [%s,%u].", __message, CleanFilename(__file), __line);
return gerrbuf;
}
// -------------------------------------------------------------------
char* gerrosinfo() {

View File

@ -106,8 +106,11 @@ void ErrorExit(int type);
// ------------------------------------------------------------------
// Return string (static array): Smth. error exit at [__file,__line].
char* gerrinfo(int __type, const char* __file, int __line);
// Return string (static array): __message at [__file,__line].
char* gerrinfo(const char* __message, const char* __file, int __line);
// Return string (static array): (OS version) reports error ##: strerror.
char* gerrosinfo();