\hypertarget{interface_2class_8h}{
\section{include/interface/class.h File Reference}
\label{interface_2class_8h}\index{include/interface/class.h@{include/interface/class.h}}
}
{\ttfamily \#include $<$stdarg.h$>$}\par
{\ttfamily \#include \char`\"{}class.h\char`\"{}}\par
{\ttfamily \#include \char`\"{}interface.h\char`\"{}}\par
Include dependency graph for class.h:
This graph shows which files directly or indirectly include this file:
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structi__Class}{i\_\-Class}
\end{DoxyCompactItemize}
\subsection*{Defines}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{interface_2class_8h_a323cb9a9088662b03bc37a47403e4212}{new}(\hyperlink{structclass}{class},...)~classNew(\_\-\#\#\hyperlink{structclass}{class}, \#\#\_\-\_\-VA\_\-ARGS\_\-\_\-)
\item 
\#define \hyperlink{interface_2class_8h_adb9a02719a59dd833c56e1a33ded59db}{delete}(object)~classDelete((void $\ast$$\ast$)(object))
\item 
\#define \hyperlink{interface_2class_8h_a864061d3c9c7f123efb63649bb0fade7}{clone}(object)~classClone((void $\ast$)(object))
\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef void($\ast$ \hyperlink{interface_2class_8h_a207fe2c25aae0b91e9df60b0ece4217e}{fptr\_\-ctor} )(void $\ast$, va\_\-list $\ast$)
\item 
typedef void($\ast$ \hyperlink{interface_2class_8h_a59366634eecbace7ae9c8c5e65199c91}{fptr\_\-dtor} )(void $\ast$)
\item 
typedef void($\ast$ \hyperlink{interface_2class_8h_a6d852b3640eeb6ef8a3d776b87736392}{fptr\_\-clone} )(void $\ast$, void $\ast$const)
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void $\ast$ \hyperlink{interface_2class_8h_adebe9bba79f753f5c44409a2ff664299}{classNew} (\hyperlink{structclass}{class\_\-ptr},...)
\item 
void \hyperlink{interface_2class_8h_ac064b1caf75bc6c8b1a4371748d55878}{classDelete} (void $\ast$$\ast$)
\item 
void $\ast$ \hyperlink{interface_2class_8h_a51116659174ec46c5a04721d31631053}{classClone} (void $\ast$)
\end{DoxyCompactItemize}


\subsection{Define Documentation}
\hypertarget{interface_2class_8h_a864061d3c9c7f123efb63649bb0fade7}{
\index{interface/class.h@{interface/class.h}!clone@{clone}}
\index{clone@{clone}!interface/class.h@{interface/class.h}}
\subsubsection[{clone}]{\setlength{\rightskip}{0pt plus 5cm}\#define clone(
\begin{DoxyParamCaption}
\item[{}]{object}
\end{DoxyParamCaption}
)~classClone((void $\ast$)(object))}}
\label{interface_2class_8h_a864061d3c9c7f123efb63649bb0fade7}


Definition at line 28 of file class.h.

\hypertarget{interface_2class_8h_adb9a02719a59dd833c56e1a33ded59db}{
\index{interface/class.h@{interface/class.h}!delete@{delete}}
\index{delete@{delete}!interface/class.h@{interface/class.h}}
\subsubsection[{delete}]{\setlength{\rightskip}{0pt plus 5cm}\#define delete(
\begin{DoxyParamCaption}
\item[{}]{object}
\end{DoxyParamCaption}
)~classDelete((void $\ast$$\ast$)(object))}}
\label{interface_2class_8h_adb9a02719a59dd833c56e1a33ded59db}


Definition at line 27 of file class.h.

\hypertarget{interface_2class_8h_a323cb9a9088662b03bc37a47403e4212}{
\index{interface/class.h@{interface/class.h}!new@{new}}
\index{new@{new}!interface/class.h@{interface/class.h}}
\subsubsection[{new}]{\setlength{\rightskip}{0pt plus 5cm}\#define new(
\begin{DoxyParamCaption}
\item[{}]{{\bf class}, }
\item[{}]{...}
\end{DoxyParamCaption}
)~classNew(\_\-\#\#{\bf class}, \#\#\_\-\_\-VA\_\-ARGS\_\-\_\-)}}
\label{interface_2class_8h_a323cb9a9088662b03bc37a47403e4212}


Definition at line 26 of file class.h.



\subsection{Typedef Documentation}
\hypertarget{interface_2class_8h_a6d852b3640eeb6ef8a3d776b87736392}{
\index{interface/class.h@{interface/class.h}!fptr\_\-clone@{fptr\_\-clone}}
\index{fptr\_\-clone@{fptr\_\-clone}!interface/class.h@{interface/class.h}}
\subsubsection[{fptr\_\-clone}]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$  {\bf fptr\_\-clone})(void $\ast$, void $\ast$const)}}
\label{interface_2class_8h_a6d852b3640eeb6ef8a3d776b87736392}


Definition at line 11 of file class.h.

\hypertarget{interface_2class_8h_a207fe2c25aae0b91e9df60b0ece4217e}{
\index{interface/class.h@{interface/class.h}!fptr\_\-ctor@{fptr\_\-ctor}}
\index{fptr\_\-ctor@{fptr\_\-ctor}!interface/class.h@{interface/class.h}}
\subsubsection[{fptr\_\-ctor}]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$  {\bf fptr\_\-ctor})(void $\ast$, va\_\-list $\ast$)}}
\label{interface_2class_8h_a207fe2c25aae0b91e9df60b0ece4217e}


Definition at line 9 of file class.h.

\hypertarget{interface_2class_8h_a59366634eecbace7ae9c8c5e65199c91}{
\index{interface/class.h@{interface/class.h}!fptr\_\-dtor@{fptr\_\-dtor}}
\index{fptr\_\-dtor@{fptr\_\-dtor}!interface/class.h@{interface/class.h}}
\subsubsection[{fptr\_\-dtor}]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$  {\bf fptr\_\-dtor})(void $\ast$)}}
\label{interface_2class_8h_a59366634eecbace7ae9c8c5e65199c91}


Definition at line 10 of file class.h.



\subsection{Function Documentation}
\hypertarget{interface_2class_8h_a51116659174ec46c5a04721d31631053}{
\index{interface/class.h@{interface/class.h}!classClone@{classClone}}
\index{classClone@{classClone}!interface/class.h@{interface/class.h}}
\subsubsection[{classClone}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ classClone (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{}
\end{DoxyParamCaption}
)}}
\label{interface_2class_8h_a51116659174ec46c5a04721d31631053}


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_8h_ac064b1caf75bc6c8b1a4371748d55878}{
\index{interface/class.h@{interface/class.h}!classDelete@{classDelete}}
\index{classDelete@{classDelete}!interface/class.h@{interface/class.h}}
\subsubsection[{classDelete}]{\setlength{\rightskip}{0pt plus 5cm}void classDelete (
\begin{DoxyParamCaption}
\item[{void $\ast$$\ast$}]{}
\end{DoxyParamCaption}
)}}
\label{interface_2class_8h_ac064b1caf75bc6c8b1a4371748d55878}


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_8h_adebe9bba79f753f5c44409a2ff664299}{
\index{interface/class.h@{interface/class.h}!classNew@{classNew}}
\index{classNew@{classNew}!interface/class.h@{interface/class.h}}
\subsubsection[{classNew}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ classNew (
\begin{DoxyParamCaption}
\item[{{\bf class\_\-ptr}}]{, }
\item[{}]{...}
\end{DoxyParamCaption}
)}}
\label{interface_2class_8h_adebe9bba79f753f5c44409a2ff664299}


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}
