| 173 | static int DDGR_num_msgs = 0; |
| 174 | |
| 175 | void ddgr_FatalError(const char *fmt, ...) { |
| 176 | // create our error list and flag a system error |
| 177 | char buf[768]; |
| 178 | |
| 179 | // get subsystem name. |
| 180 | int i; |
| 181 | for (i = 0; DDGR_subsystems[i] != -1; i++) { |
| 182 | if (DDGR_subsystems[i] == LIB_DATA(subsystem)) { |
| 183 | break; |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | // create whole error message |
| 188 | std::va_list arglist; |
| 189 | |
| 190 | va_start(arglist, fmt); |
| 191 | std::vsnprintf(buf, 768, fmt, arglist); |
| 192 | va_end(arglist); |
| 193 | |
| 194 | if (DDGR_subsystems[i] = !-1) { |
| 195 | strcat(buf, "\n\nSubsystem: "); |
| 196 | strcat(buf, DDGR_subsystem_names[i]); |
| 197 | } |
| 198 | strcat(buf, "\n\nError stack:"); |
| 199 | for (i = 0; i < DDGR_num_msgs; i++) { |
| 200 | strcat(buf, "\n"); |
| 201 | strcat(buf, DDGR_error_msgs[i]); |
| 202 | delete[] DDGR_error_msgs[i]; |
| 203 | } |
| 204 | |
| 205 | Error(buf); |
| 206 | } |
| 207 | |
| 208 | void ddgr_PushError(const char *fmt, ...) { |
| 209 | std::va_list arglist; |
no test coverage detected