#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <glib.h>
#include "util.h"
#include "error.h"
Go to the source code of this file.
Functions | |
void | defaultErrorFunc (const char *string, const char *filename, const char *function, int lineno) |
int | defaultPromptFunc (const char *title, const char *msg, int nTotal, int nDefault, const char *choice1, va_list args) |
void | lutil_error_setErrorFunc (UErrorFunc errorFunc) |
Set a new function to display errors with. | |
void | lutil_error_setPromptFunc (UPromptFunc promptFunc) |
Set a new function to prompt the user with. | |
void | lutil_error_resetErrorFunc (void) |
Reset the error function to the default error function. | |
void | lutil_error_resetPromptFunc (void) |
Reset the prompt function to the default prompt function. | |
void | lutil_error_fatal (const char *string, const char *filename, const char *function, int lineno) |
Display an error and die. | |
int | lutil_error_prompt (const char *title, const char *msg, int nTotal, int nDefault, const char *choice1,...) |
Prompt the user for input. | |
void | lutil_error (const char *filename, const char *function, int lineno, const char *template,...) |
Display an error and continue. | |
Variables | |
UErrorFunc | errorFunc_global = defaultErrorFunc |
UPromptFunc | promptFunc_global = defaultPromptFunc |
|
Definition at line 176 of file error.c. Referenced by lutil_error_resetErrorFunc(). |
|
Definition at line 182 of file error.c. Referenced by lutil_error_resetPromptFunc(). |
|
Display an error and continue.
Display an error using the defined error function (or the default, if none is defined). Default behavior (as defined by
*** ERROR *** luau: FILENAME: FUNCTION: STRING
Definition at line 159 of file error.c. References errorFunc_global, and lutil_valistToString(). |
|
Display an error and die. Display a fatal error message and die. Cannot be overridden. Only called internally when there is a memory failure.
|
|
Prompt the user for input. Prompt the user for input, using the defined prompt function (or the default, if none is defined). Default behavior is not to prompt the user at all, but instead to return the default value.
Definition at line 131 of file error.c. References promptFunc_global. Referenced by luau_downloadUpdate(), and luau_net_downloadUpdate(). |
|
Reset the error function to the default error function.
Definition at line 91 of file error.c. References defaultErrorFunc(), and errorFunc_global. Referenced by luau_resetErrorFunc(). |
|
Reset the prompt function to the default prompt function.
Definition at line 96 of file error.c. References defaultPromptFunc(), and promptFunc_global. Referenced by luau_resetPromptFunc(). |
|
Set a new function to display errors with.
Define a new function to be used for error output. The error function takes a number of pieces of information concerning where the error concerned, but any or all of them may be ignored in accordance with the user's discretion. Function should handle NULL values cleanly. Default behavior (as defined by
*** ERROR *** luau: FILENAME: FUNCTION: STRING
Definition at line 66 of file error.c. References errorFunc_global. Referenced by luau_registerErrorFunc(). |
|
Set a new function to prompt the user with.
Define a new function to be used for prompting the user for input. The default value, specified by
Definition at line 86 of file error.c. References promptFunc_global. Referenced by luau_registerPromptFunc(). |
|
Definition at line 43 of file error.c. Referenced by lutil_error(), lutil_error_resetErrorFunc(), and lutil_error_setErrorFunc(). |
|
Definition at line 44 of file error.c. Referenced by lutil_error_prompt(), lutil_error_resetPromptFunc(), and lutil_error_setPromptFunc(). |