interface_2class_8c.tex 3.24 KB
\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, &params);
        va_end(params);

        return object;
}
\end{DoxyCode}