9 static error_type_t current_error_type = ERROR_TYPE_OK;
11 error_type_t current_error(void)
13 return current_error_type;
16 void throw_error(error_type_t error_type)
18 assert(0 <= error_type && error_type < ERROR_TYPE_N);
19 current_error_type = error_type;
22 void reset_error(void)
24 current_error_type = ERROR_TYPE_OK;
27 void print_current_error_msg(const char *user_prefix)
29 print_error_msg(current_error_type, user_prefix);
30 current_error_type = ERROR_TYPE_OK;
33 void print_error_msg(error_type_t error_type, const char *user_prefix)
41 fprintf(stderr, "%s: %s", user_prefix, SDL_GetError());