source: anuga_work/development/anugavis/src/error.c @ 5260

Last change on this file since 5260 was 5260, checked in by jack, 17 years ago

anugavis: added event loop. Now drawing an empty screen.

File size: 584 bytes
Line 
1#include <stdarg.h>
2#include <netcdf.h>
3#include <SDL.h>
4#include "error.h"
5
6#define MAX_ERROR_LEN 100
7
8static char error[MAX_ERROR_LEN];
9
10char* AnugaVis_GetError(void){
11  return error;
12}
13
14void AnugaVis_SetError(const char *format, ...){
15  va_list args;
16  va_start(args, format);
17  vsnprintf(error, MAX_ERROR_LEN, format, args);
18  va_end(args);
19}
20
21void AnugaVis_SDLError(void){
22  AnugaVis_SetError("SDL Error: %s", SDL_GetError());
23  SDL_ClearError();
24}
25
26void AnugaVis_NetCDFError(int ncerr){
27  AnugaVis_SetError("NetCDF Error: %s", nc_strerror(ncerr));
28}
Note: See TracBrowser for help on using the repository browser.