aboutsummaryrefslogtreecommitdiffstats
path: root/LIBAXL_ERROR.3
blob: 07233ca65b2884d2983b6395082b94005ed3ce99 (plain) (blame)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
.TH LIBAXL_ERROR 3 libaxl
.SH NAME
LIBAXL_ERROR - Error message
.SH SYNOPSIS
.nf
#include <libaxl.h>

#define LIBAXL_ERROR 0
union libaxl_error {
        struct {
                uint8_t  \fI__zero\fP;
                uint8_t  \fIcode\fP;
                uint16_t \fIsequence_number\fP;
                uint32_t \fI__detail\fP;
                uint16_t \fIminor_opcode\fP;
                uint8_t  \fImajor_opcode\fP;
        };
        struct libaxl_error_request        \fIrequest\fP;
        struct libaxl_error_value          \fIvalue\fP;
        struct libaxl_error_window         \fIwindow\fP;
        struct libaxl_error_pixmap         \fIpixmap\fP;
        struct libaxl_error_atom           \fIatom\fP;
        struct libaxl_error_cursor         \fIcursor\fP;
        struct libaxl_error_font           \fIfont\fP;
        struct libaxl_error_match          \fImatch\fP;
        struct libaxl_error_drawable       \fIdrawable\fP;
        struct libaxl_error_access         \fIaccess\fP;
        struct libaxl_error_alloc          \fIalloc\fP;
        struct libaxl_error_colormap       \fIcolormap\fP;
        struct libaxl_error_gcontext       \fIgcontext\fP;
        struct libaxl_error_id_choice      \fIid_choice\fP;
        struct libaxl_error_name           \fIname\fP;
        struct libaxl_error_length         \fIlength\fP;
        struct libaxl_error_implementation \fIimplementation\fP;
};
.fi
.SH DESCRIPTION
.B union libaxl_error
contains the
.BR struct s
for all error types and an anonymous
.B struct
with the common fields. A received message can
be identified as an error message checking that
the value of the first byte in the message is
.BR LIBAXL_ERROR .
.PP
Unless stated otherwise in the documentation for a
request, if an error message is received for the
request, it terminated without side-effects, that
is, without partial execution.
.PP
The value of the
.I __zero
field is 0
.RI ( LIBAXL_ERROR ),
which signifies that the received message is an
error message. The value of the
.I code
field should be one of the following, to
signify which error type the error has:
.TP
.B LIBAXL_ERROR_REQUEST
Invalid request operation code.
.TP
.B LIBAXL_ERROR_VALUE
Invalid value in request.
.TP
.B LIBAXL_ERROR_WINDOW
Invalid window ID in request.
.TP
.B LIBAXL_ERROR_PIXMAP
Invalid pixmap ID in request.
.TP
.B LIBAXL_ERROR_ATOM
Invalid atom ID in request.
.TP
.B LIBAXL_ERROR_CURSOR
Invalid cursor ID in request.
.TP
.B LIBAXL_ERROR_FONT
Invalid font ID or fontable ID in request.
.TP
.B LIBAXL_ERROR_MATCH
Argument do not match.
.TP
.B LIBAXL_ERROR_DRAWABLE
Invalid drawable ID in request.
.TP
.B LIBAXL_ERROR_ACCESS
Access failure.
.TP
.B LIBAXL_ERROR_ALLOC
Resource allocation failure.
.TP
.B LIBAXL_ERROR_COLORMAP
Invalid colormap ID in request.
.TP
.B LIBAXL_ERROR_GCONTEXT
Invalid graphics context ID in request.
.TP
.B LIBAXL_ERROR_ID_CHOICE
Invalid resource ID choice.
.TP
.B LIBAXL_ERROR_NAME
Invalid font name or color name in request.
.TP
.B LIBAXL_ERROR_LENGTH
Invalid request length.
.TP
.B LIBAXL_ERROR_IMPLEMENTATION
Feature not implemented.
.PP
The error
.B struct
for the specific error type is accessed via
the member, of the
.BR union ,
with the same name except in lower case and
without the
.B libaxl_error_
prefix. See the section 3 man pages with the
same names as the error type codes (the
constants listed above) for more information.
.PP
The value of the
.I sequence_number
field is the sequence number returned by the
.BR libaxl_send_request (3)
function for the failed request.
.PP
The value of the
.I major_opcode
and
.I minor_opcode
fields are the major and minor (if any) operation
codes in the failed request.
.PP
The value of the
.I __detail
field is error-specific.
.SH SEE ALSO
.BR libaxl_receive (3)