interface_2class_8c.tex
3.24 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
\hypertarget{interface_2class_8c}{
\section{src/interface/class.c File Reference}
\label{interface_2class_8c}\index{src/interface/class.c@{src/interface/class.c}}
}
{\ttfamily \#include $<$stdarg.h$>$}\par
{\ttfamily \#include $<$stdlib.h$>$}\par
{\ttfamily \#include $<$assert.h$>$}\par
{\ttfamily \#include \char`\"{}class.h\char`\"{}}\par
{\ttfamily \#include \char`\"{}interface/class.h\char`\"{}}\par
Include dependency graph for class.c:
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item
void $\ast$ \hyperlink{interface_2class_8c_a841e4a0f9bceb16fda262302d038bfa0}{classNew} (\hyperlink{structclass}{class\_\-ptr} \hyperlink{structclass}{class},...)
\item
void \hyperlink{interface_2class_8c_a292005216c251622a115ea90ff6d36c0}{classDelete} (void $\ast$$\ast$object)
\item
void $\ast$ \hyperlink{interface_2class_8c_ada46f0179448063a30f6f219270bf1e0}{classClone} (void $\ast$\_\-object)
\end{DoxyCompactItemize}
\subsection{Function Documentation}
\hypertarget{interface_2class_8c_ada46f0179448063a30f6f219270bf1e0}{
\index{interface/class.c@{interface/class.c}!classClone@{classClone}}
\index{classClone@{classClone}!interface/class.c@{interface/class.c}}
\subsubsection[{classClone}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ classClone (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{\_\-object}
\end{DoxyParamCaption}
)}}
\label{interface_2class_8c_ada46f0179448063a30f6f219270bf1e0}
Definition at line 42 of file class.c.
\begin{DoxyCode}
{
class_ptr class = class_getClass(_object);
void * object = calloc(1, class->object_size + sizeof(void*));
* (class_ptr *)object = class;
object += sizeof(void*);
#undef clone
CALL(object, Class, clone, _object);
return object;
}
\end{DoxyCode}
Here is the call graph for this function:
\hypertarget{interface_2class_8c_a292005216c251622a115ea90ff6d36c0}{
\index{interface/class.c@{interface/class.c}!classDelete@{classDelete}}
\index{classDelete@{classDelete}!interface/class.c@{interface/class.c}}
\subsubsection[{classDelete}]{\setlength{\rightskip}{0pt plus 5cm}void classDelete (
\begin{DoxyParamCaption}
\item[{void $\ast$$\ast$}]{object}
\end{DoxyParamCaption}
)}}
\label{interface_2class_8c_a292005216c251622a115ea90ff6d36c0}
Definition at line 33 of file class.c.
\begin{DoxyCode}
{
CALL(*object, Class, dtor);
free(*object - sizeof(void*));
*object = NULL;
}
\end{DoxyCode}
\hypertarget{interface_2class_8c_a841e4a0f9bceb16fda262302d038bfa0}{
\index{interface/class.c@{interface/class.c}!classNew@{classNew}}
\index{classNew@{classNew}!interface/class.c@{interface/class.c}}
\subsubsection[{classNew}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ classNew (
\begin{DoxyParamCaption}
\item[{{\bf class\_\-ptr}}]{class, }
\item[{}]{...}
\end{DoxyParamCaption}
)}}
\label{interface_2class_8c_a841e4a0f9bceb16fda262302d038bfa0}
Definition at line 15 of file class.c.
\begin{DoxyCode}
{
void * object = calloc(1, class->object_size + sizeof(void*));
va_list params;
if (class->init) class->init();
* (class_ptr *)object = class;
object += sizeof(void*);
va_start(params, class);
CALL(object, Class, ctor, ¶ms);
va_end(params);
return object;
}
\end{DoxyCode}