Grid Community Toolkit  6.2.1705709074 (tag: v6.2.20240202)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
verror.h
1 /*
2  * verror.h
3  *
4  * Simple error-handling interface for MyProxy API.
5  * Won't work with multi-threaded.
6  */
7 #ifndef __VERROR_H
8 #define __VERROR_H
9 
10 /*
11  * verror_prepend_string()
12  *
13  * Prepend a string to the current error string. Accepts the
14  * same arguments as sprintf().
15  */
16 void verror_prepend_string(const char *format, ...);
17 
18 /*
19  * verror_put_string()
20  *
21  * Add a string to the current error. Accepts the same argumnets
22  * as sprintf().
23  */
24 void verror_put_string(const char *format, ...);
25 
26 /*
27  * verror_put_errno()
28  *
29  * Associate an error number with the current error.
30  */
31 void verror_put_errno(int error_number);
32 
33 /*
34  * verror_put_value()
35  *
36  * Associate an arbitrary numeric value with the current error.
37  */
38 void verror_put_value(int value);
39 
40 /*
41  * verror_is_error()
42  *
43  * Is there an error currently set? Returns 1 if set, 0 otherwise.
44  */
45 int verror_is_error();
46 
47 /*
48  * verror_get_string()
49  *
50  * Return the string associated with the current error context.
51  */
52 char *verror_get_string();
53 
54 /*
55  * verror_get_errno()
56  *
57  * Return the error number associated with the current error.
58  */
59 int verror_get_errno();
60 
61 /*
62  * verror_strerror()
63  *
64  * Return a pointer to the error string associated with the current
65  * error number or a empty string if no error number is currently
66  * set. The string is statically allocated and should not be modified.
67  */
68 char *verror_strerror();
69 
70 /*
71  * verror_get_value()
72  *
73  * Return the numeric value associated with the current error.
74  */
75 int verror_get_value();
76 
77 /*
78  * verror_clear()
79  *
80  * Clear the current error state.
81  */
82 void verror_clear();
83 
84 /*
85  * verror_print_error()
86  *
87  * A helper function to print both the error string and the error
88  * number string.
89  */
90 void verror_print_error(FILE *stream);
91 
92 #endif /* __VERROR_H */