File: verror.h

package info (click to toggle)
myproxy 6.2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,196 kB
  • sloc: ansic: 24,753; sh: 11,507; perl: 3,673; makefile: 353
file content (92 lines) | stat: -rw-r--r-- 1,769 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
 * verror.h
 *
 * Simple error-handling interface for MyProxy API.
 * Won't work with multi-threaded.
 */
#ifndef __VERROR_H
#define __VERROR_H

/*
 * verror_prepend_string()
 *
 * Prepend a string to the current error string. Accepts the
 * same arguments as sprintf().
 */
void verror_prepend_string(const char *format, ...);

/*
 * verror_put_string()
 *
 * Add a string to the current error. Accepts the same argumnets
 * as sprintf().
 */
void verror_put_string(const char *format, ...);

/*
 * verror_put_errno()
 *
 * Associate an error number with the current error.
 */
void verror_put_errno(int error_number);

/*
 * verror_put_value()
 *
 * Associate an arbitrary numeric value with the current error.
 */
void verror_put_value(int value);

/*
 * verror_is_error()
 *
 * Is there an error currently set? Returns 1 if set, 0 otherwise.
 */
int verror_is_error();

/*
 * verror_get_string()
 *
 * Return the string associated with the current error context.
 */
char *verror_get_string();

/*
 * verror_get_errno()
 *
 * Return the error number associated with the current error.
 */
int verror_get_errno();

/*
 * verror_strerror()
 *
 * Return a pointer to the error string associated with the current
 * error number or a empty string if no error number is currently
 * set. The string is statically allocated and should not be modified.
 */
char *verror_strerror();

/*
 * verror_get_value()
 *
 * Return the numeric value associated with the current error.
 */
int verror_get_value();

/*
 * verror_clear()
 *
 * Clear the current error state.
 */
void verror_clear();

/*
 * verror_print_error()
 *
 * A helper function to print both the error string and the error
 * number string.
 */
void verror_print_error(FILE *stream);

#endif /* __VERROR_H */