C Configuration Space and Tuning Library (CCS)
Loading...
Searching...
No Matches
error_stack.h
Go to the documentation of this file.
1#ifndef _CCS_ERROR_STACK_H
2#define _CCS_ERROR_STACK_H
3
9#ifdef __cplusplus
10extern "C" {
11#endif
12
21
32extern ccs_result_t
34
41extern void
43
49 const char *file;
51 int line;
53 const char *func;
54};
55
60
73extern ccs_result_t
74ccs_create_thread_error(ccs_result_t error_code, const char *msg, ...);
75
89extern ccs_result_t
90ccs_thread_error_stack_push(const char *file, int line, const char *func);
91
106extern ccs_result_t
108 ccs_error_stack_t *error_stack_ret,
109 ccs_result_t error_code,
110 const char *msg,
111 ...);
112
129extern ccs_result_t
131 ccs_error_stack_t error_stack,
132 const char *file,
133 int line,
134 const char *func);
135
148extern ccs_result_t
150 ccs_error_stack_t error_stack,
151 const char **message_ret);
152
165extern ccs_result_t
167 ccs_error_stack_t error_stack,
168 ccs_result_t *error_code_ret);
169
190extern ccs_result_t
192 ccs_error_stack_t error_stack,
193 size_t num_elems,
195 size_t *num_elems_ret);
196
197#ifdef __cplusplus
198}
199#endif
200
201#endif //_CCS_ERROR_STACK_H
struct _ccs_error_stack_s * ccs_error_stack_t
An opaque type defining a CCS error stack.
Definition base.h:155
enum ccs_result_e ccs_result_t
A commodity type to represent CCS errors and returned by most functions.
Definition base.h:247
ccs_result_t ccs_error_stack_get_elems(ccs_error_stack_t error_stack, size_t num_elems, ccs_error_stack_elem_t *elems, size_t *num_elems_ret)
Retrieves the stack elements from an error stack.
ccs_result_t ccs_error_stack_push(ccs_error_stack_t error_stack, const char *file, int line, const char *func)
Pushes a stack trace element in an error stack.
ccs_result_t ccs_create_thread_error(ccs_result_t error_code, const char *msg,...)
Creates a new error stack and sets it for the current thread, potentially replacing the previous one.
void ccs_clear_thread_error(void)
Clears the error stack of the calling thread, releasing the current error if it existed.
ccs_result_t ccs_set_thread_error(ccs_error_stack_t error_stack)
Transfers ownership of error stack from the user to CCS.
ccs_result_t ccs_thread_error_stack_push(const char *file, int line, const char *func)
Pushes a stack trace element on the thread error stack.
ccs_result_t ccs_error_stack_get_message(ccs_error_stack_t error_stack, const char **message_ret)
Retrieves the message from an error stack.
ccs_result_t ccs_create_error_stack(ccs_error_stack_t *error_stack_ret, ccs_result_t error_code, const char *msg,...)
Creates a new error stack object.
ccs_result_t ccs_error_stack_get_code(ccs_error_stack_t error_stack, ccs_result_t *error_code_ret)
Retrieves the error code from an error stack.
ccs_error_stack_t ccs_get_thread_error(void)
Transfers ownership of thread error stack from CCS to the user.
An element of stack.
Definition error_stack.h:47
const char * func
The function name.
Definition error_stack.h:53
int line
The line number.
Definition error_stack.h:51
const char * file
The file name.
Definition error_stack.h:49