diff options
Diffstat (limited to 'src/error.h')
| -rw-r--r-- | src/error.h | 171 |
1 files changed, 171 insertions, 0 deletions
diff --git a/src/error.h b/src/error.h new file mode 100644 index 0000000..5c44633 --- /dev/null +++ b/src/error.h @@ -0,0 +1,171 @@ +#ifndef ERROR_H +#define ERROR_H + +enum { + LT_ERROR_FILTER_TYPE_NTH, + LT_ERROR_FILTER_TYPE_SEQ, + LT_ERROR_FILTER_TYPE_STACK, + LT_ERROR_FILTER_TYPE_INTERACTIVE, +}; + +struct lt_error_def_filter { + int type; +}; + +struct lt_error_def_sym { +#define LT_MAXNAME 20 + char symbol[LT_MAXNAME]; + long ret; + struct lt_error_def_filter filter; +}; + +struct lt_error_def { +#define LT_ERROR_MAXSYM 50 + struct lt_error_def_sym sym[LT_ERROR_MAXSYM]; + + /* call number */ + unsigned long n; +}; + +struct lt_error_audit_filter { + int type; + union { + int **nth; + }; +}; + +struct lt_error_sym { + char *name; + unsigned long ret; + unsigned long call; + struct lt_error_audit_filter filter; + + struct lt_list_head list; +}; + +struct lt_error_app_return_sym { + char *name; + long val; + + struct lt_list_head list; +}; + +struct lt_error_app_filter { + int type; +}; + +struct lt_error_app_return { + char *name; + struct lt_error_app_filter filter; + + struct lt_list_head head_sym; + struct lt_list_head list_app; + struct lt_list_head list_run; +}; + +struct lt_error_app_run { + char *name; + char **args; + + struct lt_list_head head_return; + struct lt_list_head list_go; + struct lt_list_head list_app; +}; + +struct lt_error_app_go { + int n; + char *name; + + struct lt_list_head head_run; + struct lt_list_head list; +}; + +struct lt_error_app { + char *name; + char *dir; + char *prog; + + struct lt_list_head head_run; + struct lt_list_head head_go; + struct lt_list_head head_return; + struct lt_list_head list; +}; + +struct lt_config_app; + +#ifdef CONFIG_ARCH_HAVE_ERROR_SIM +int lt_error_app(struct lt_config_app *cfg, + struct lt_error_app *error_app); +int lt_error_go(struct lt_config_app *cfg, + struct lt_error_app_go **go, + struct lt_error_app *error_app, + char *name, int n, + struct lt_list_head *runs); +int lt_error_run_return(struct lt_config_app *cfg, + struct lt_error_app_run **run, + struct lt_error_app *error_app, + struct lt_list_head *ret); +int lt_error_run_args(struct lt_config_app *cfg, + struct lt_error_app_run **run, + struct lt_list_head *args); +int lt_error_return_ass(struct lt_config_app *cfg, + struct lt_error_app_return **ret, + char *name, unsigned long val); +int lt_error_return_filter(struct lt_config_app *cfg, + struct lt_error_app_return **ret, + int type, void *data); + +int lt_error_app_init(struct lt_error_app *app); +#else +static inline int lt_error_app(struct lt_config_app *cfg, + struct lt_error_app *error_app) +{ + return -1; +} + +static inline int lt_error_go(struct lt_config_app *cfg, + struct lt_error_app_go **go, + struct lt_error_app *error_app, + char *name, int n, + struct lt_list_head *runs) +{ + return -1; +} + +static inline int lt_error_run_return(struct lt_config_app *cfg, + struct lt_error_app_run **run, + struct lt_error_app *error_app, + struct lt_list_head *ret) +{ + return -1; +} + +static inline int lt_error_run_args(struct lt_config_app *cfg, + struct lt_error_app_run **run, + struct lt_list_head *args) +{ + return -1; +} + +static inline int lt_error_app_init(struct lt_error_app *app) +{ + return -1; +} + +static inline int lt_error_return_ass(struct lt_config_app *cfg, + struct lt_error_app_return **ret, + char *name, unsigned long val) +{ + return -1; +} + +static inline int lt_error_return_filter(struct lt_config_app *cfg, + struct lt_error_app_return **ret, + int type, void *data) +{ + return -1; +} + +#endif + +#endif /* ERROR_H */ |
