Lines Matching defs:error
24 /* Simple error handling in SDL */
29 /* Routine to get the thread-specific error variable */
31 /* The SDL_arraysize(The ),default (non-thread-safe) global error variable */
53 SDL_error *error;
55 /* Copy in the key, mark error as valid */
56 error = SDL_GetErrBuf();
57 error->error = 1;
58 SDL_strlcpy((char *)error->key, fmt, sizeof(error->key));
61 error->argc = 0;
78 error->args[error->argc++].value_i =
82 error->args[error->argc++].value_f =
86 error->args[error->argc++].value_ptr =
91 int i = error->argc;
95 SDL_strlcpy((char *)error->args[i].buf, str, ERR_MAX_STRLEN);
96 error->argc++;
102 if ( error->argc >= ERR_MAX_ARGS ) {
109 /* If we are in debug mode, print out an error message */
115 /* This function has a bit more overhead than most error functions
120 SDL_error *error;
122 /* Clear the error string */
125 /* Get the thread-safe error, and print it out */
126 error = SDL_GetErrBuf();
127 if ( error->error ) {
133 fmt = SDL_LookupString(error->key);
156 len = SDL_snprintf(msg, maxlen, tmp, error->args[argi++].value_i);
161 len = SDL_snprintf(msg, maxlen, tmp, error->args[argi++].value_f);
166 len = SDL_snprintf(msg, maxlen, tmp, error->args[argi++].value_ptr);
171 len = SDL_snprintf(msg, maxlen, tmp, SDL_LookupString(error->args[argi++].buf));
196 SDL_error *error;
198 error = SDL_GetErrBuf();
199 error->error = 0;
210 SDL_SetError("Error reading from datastream");
213 SDL_SetError("Error writing to datastream");
216 SDL_SetError("Error seeking in datastream");
219 SDL_SetError("Unknown SDL error");
230 printf("Error 1: %s\n", SDL_GetError());
234 SDL_SetError("This is the error: %s (%f)", buffer, 1.0);
235 printf("Error 2: %s\n", SDL_GetError());