interface_8h.tex
7.97 KB
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
\hypertarget{interface_8h}{
\section{include/interface.h File Reference}
\label{interface_8h}\index{include/interface.h@{include/interface.h}}
}
{\ttfamily \#include $<$sys/types.h$>$}\par
Include dependency graph for interface.h:
This graph shows which files directly or indirectly include this file:
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item
struct \hyperlink{structinterface}{interface}
\item
struct \hyperlink{structiface__impl}{iface\_\-impl}
\end{DoxyCompactItemize}
\subsection*{Defines}
\begin{DoxyCompactItemize}
\item
\#define \hyperlink{interface_8h_ad620a89e939b586d6a025cf342da8e55}{MAX\_\-IFACE}~32
\item
\#define \hyperlink{interface_8h_a02255665665c91d905ec32d00d9a4a85}{IFACE}(name)~((const struct i\_\-\#\#name const$\ast$)\&i\_\-\#\#name\#\#\_\-impl)
\item
\#define \hyperlink{interface_8h_a446cc7d7282f8a0b8e62a371671ea605}{INIT\_\-IFACE}(name,...)~static const struct i\_\-\#\#name i\_\-\#\#name\#\#\_\-impl = \{\&i\_\-\#\#name,\_\-\_\-VA\_\-ARGS\_\-\_\-\}
\item
\#define \hyperlink{interface_8h_a9dda4d034150e3159927f83d9d15d840}{NUMARGS}(...)~(sizeof((const void$\ast$\mbox{[}$\,$\mbox{]})\{\_\-\_\-VA\_\-ARGS\_\-\_\-\})/sizeof(void$\ast$))
\item
\#define \hyperlink{interface_8h_a6e8015282e5aac5747daff5bb71d8601}{INIT\_\-IMPL}(...)~\{NUMARGS(\_\-\_\-VA\_\-ARGS\_\-\_\-), 0, \{\_\-\_\-VA\_\-ARGS\_\-\_\-\}\}
\item
\#define \hyperlink{interface_8h_a855b98f3119c2d64e7dd4c2c910bd5b5}{CREATE\_\-IMPL}(...)~static struct \hyperlink{structiface__impl}{iface\_\-impl} \hyperlink{structiface__impl}{iface\_\-impl} = INIT\_\-IMPL(\_\-\_\-VA\_\-ARGS\_\-\_\-)
\item
\#define \hyperlink{interface_8h_a12243bdd01e5366fecc15f395f09221a}{METHOD\_\-GET}(iface, method)~(iface-\/$>$method)
\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item
typedef struct \hyperlink{structinterface}{interface} $\ast$ \hyperlink{interface_8h_afaa63cd951f41a496111e88acf36dc40}{iface\_\-ptr}
\item
typedef struct \hyperlink{structiface__impl}{iface\_\-impl} $\ast$ \hyperlink{interface_8h_a998b025a5015049fd824424d6983f2df}{iface\_\-impl\_\-ptr}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item
struct \hyperlink{structinterface}{interface} $\ast$ \hyperlink{interface_8h_ae4bb16dde691d2513d444ce772f48718}{interfaceGet} (\hyperlink{structiface__impl}{iface\_\-impl\_\-ptr}, const \hyperlink{structinterface}{iface\_\-ptr})
\end{DoxyCompactItemize}
\subsection{Define Documentation}
\hypertarget{interface_8h_a855b98f3119c2d64e7dd4c2c910bd5b5}{
\index{interface.h@{interface.h}!CREATE\_\-IMPL@{CREATE\_\-IMPL}}
\index{CREATE\_\-IMPL@{CREATE\_\-IMPL}!interface.h@{interface.h}}
\subsubsection[{CREATE\_\-IMPL}]{\setlength{\rightskip}{0pt plus 5cm}\#define CREATE\_\-IMPL(
\begin{DoxyParamCaption}
\item[{}]{...}
\end{DoxyParamCaption}
)~static struct {\bf iface\_\-impl} {\bf iface\_\-impl} = INIT\_\-IMPL(\_\-\_\-VA\_\-ARGS\_\-\_\-)}}
\label{interface_8h_a855b98f3119c2d64e7dd4c2c910bd5b5}
Definition at line 16 of file interface.h.
\hypertarget{interface_8h_a02255665665c91d905ec32d00d9a4a85}{
\index{interface.h@{interface.h}!IFACE@{IFACE}}
\index{IFACE@{IFACE}!interface.h@{interface.h}}
\subsubsection[{IFACE}]{\setlength{\rightskip}{0pt plus 5cm}\#define IFACE(
\begin{DoxyParamCaption}
\item[{}]{name}
\end{DoxyParamCaption}
)~((const struct i\_\-\#\#name const$\ast$)\&i\_\-\#\#name\#\#\_\-impl)}}
\label{interface_8h_a02255665665c91d905ec32d00d9a4a85}
Definition at line 8 of file interface.h.
\hypertarget{interface_8h_a446cc7d7282f8a0b8e62a371671ea605}{
\index{interface.h@{interface.h}!INIT\_\-IFACE@{INIT\_\-IFACE}}
\index{INIT\_\-IFACE@{INIT\_\-IFACE}!interface.h@{interface.h}}
\subsubsection[{INIT\_\-IFACE}]{\setlength{\rightskip}{0pt plus 5cm}\#define INIT\_\-IFACE(
\begin{DoxyParamCaption}
\item[{}]{name, }
\item[{}]{...}
\end{DoxyParamCaption}
)~static const struct i\_\-\#\#name i\_\-\#\#name\#\#\_\-impl = \{\&i\_\-\#\#name,\_\-\_\-VA\_\-ARGS\_\-\_\-\}}}
\label{interface_8h_a446cc7d7282f8a0b8e62a371671ea605}
Definition at line 10 of file interface.h.
\hypertarget{interface_8h_a6e8015282e5aac5747daff5bb71d8601}{
\index{interface.h@{interface.h}!INIT\_\-IMPL@{INIT\_\-IMPL}}
\index{INIT\_\-IMPL@{INIT\_\-IMPL}!interface.h@{interface.h}}
\subsubsection[{INIT\_\-IMPL}]{\setlength{\rightskip}{0pt plus 5cm}\#define INIT\_\-IMPL(
\begin{DoxyParamCaption}
\item[{}]{...}
\end{DoxyParamCaption}
)~\{NUMARGS(\_\-\_\-VA\_\-ARGS\_\-\_\-), 0, \{\_\-\_\-VA\_\-ARGS\_\-\_\-\}\}}}
\label{interface_8h_a6e8015282e5aac5747daff5bb71d8601}
Definition at line 15 of file interface.h.
\hypertarget{interface_8h_ad620a89e939b586d6a025cf342da8e55}{
\index{interface.h@{interface.h}!MAX\_\-IFACE@{MAX\_\-IFACE}}
\index{MAX\_\-IFACE@{MAX\_\-IFACE}!interface.h@{interface.h}}
\subsubsection[{MAX\_\-IFACE}]{\setlength{\rightskip}{0pt plus 5cm}\#define MAX\_\-IFACE~32}}
\label{interface_8h_ad620a89e939b586d6a025cf342da8e55}
Definition at line 6 of file interface.h.
\hypertarget{interface_8h_a12243bdd01e5366fecc15f395f09221a}{
\index{interface.h@{interface.h}!METHOD\_\-GET@{METHOD\_\-GET}}
\index{METHOD\_\-GET@{METHOD\_\-GET}!interface.h@{interface.h}}
\subsubsection[{METHOD\_\-GET}]{\setlength{\rightskip}{0pt plus 5cm}\#define METHOD\_\-GET(
\begin{DoxyParamCaption}
\item[{}]{iface, }
\item[{}]{method}
\end{DoxyParamCaption}
)~(iface-\/$>$method)}}
\label{interface_8h_a12243bdd01e5366fecc15f395f09221a}
Definition at line 19 of file interface.h.
\hypertarget{interface_8h_a9dda4d034150e3159927f83d9d15d840}{
\index{interface.h@{interface.h}!NUMARGS@{NUMARGS}}
\index{NUMARGS@{NUMARGS}!interface.h@{interface.h}}
\subsubsection[{NUMARGS}]{\setlength{\rightskip}{0pt plus 5cm}\#define NUMARGS(
\begin{DoxyParamCaption}
\item[{}]{...}
\end{DoxyParamCaption}
)~(sizeof((const void$\ast$\mbox{[}$\,$\mbox{]})\{\_\-\_\-VA\_\-ARGS\_\-\_\-\})/sizeof(void$\ast$))}}
\label{interface_8h_a9dda4d034150e3159927f83d9d15d840}
Definition at line 13 of file interface.h.
\subsection{Typedef Documentation}
\hypertarget{interface_8h_a998b025a5015049fd824424d6983f2df}{
\index{interface.h@{interface.h}!iface\_\-impl\_\-ptr@{iface\_\-impl\_\-ptr}}
\index{iface\_\-impl\_\-ptr@{iface\_\-impl\_\-ptr}!interface.h@{interface.h}}
\subsubsection[{iface\_\-impl\_\-ptr}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf iface\_\-impl}$\ast$ {\bf iface\_\-impl\_\-ptr}}}
\label{interface_8h_a998b025a5015049fd824424d6983f2df}
Definition at line 33 of file interface.h.
\hypertarget{interface_8h_afaa63cd951f41a496111e88acf36dc40}{
\index{interface.h@{interface.h}!iface\_\-ptr@{iface\_\-ptr}}
\index{iface\_\-ptr@{iface\_\-ptr}!interface.h@{interface.h}}
\subsubsection[{iface\_\-ptr}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf interface}$\ast$ {\bf iface\_\-ptr}}}
\label{interface_8h_afaa63cd951f41a496111e88acf36dc40}
Definition at line 26 of file interface.h.
\subsection{Function Documentation}
\hypertarget{interface_8h_ae4bb16dde691d2513d444ce772f48718}{
\index{interface.h@{interface.h}!interfaceGet@{interfaceGet}}
\index{interfaceGet@{interfaceGet}!interface.h@{interface.h}}
\subsubsection[{interfaceGet}]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf interface}$\ast$ interfaceGet (
\begin{DoxyParamCaption}
\item[{{\bf iface\_\-impl\_\-ptr}}]{iface\_\-impl, }
\item[{const {\bf iface\_\-ptr}}]{\_\-iface}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily \mbox{[}read\mbox{]}}}}
\label{interface_8h_ae4bb16dde691d2513d444ce772f48718}
this one is important in selector functions to get the correct interface implementation of a class.
Definition at line 25 of file interface.c.
\begin{DoxyCode}
{
const iface_ptr * iface = &_iface;
void * dummy;
if (! iface_impl->simpl) {
qsort((void**)(iface_impl->impl), iface_impl->nimpl, sizeof(iface_ptr), c
omp);
iface_impl->simpl=TRUE;
}
dummy = bsearch(
&iface,
iface_impl->impl,
iface_impl->nimpl,
sizeof(iface_ptr),
comp);
return dummy? *(struct interface **)dummy : dummy;
}
\end{DoxyCode}