Another abandoned server code base... this is kind of an ancestor of taskrambler.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

350 lines
12 KiB

\hypertarget{class_8h}{
\section{include/class.h File Reference}
\label{class_8h}\index{include/class.h@{include/class.h}}
}
{\ttfamily \#include $<$stdarg.h$>$}\par
{\ttfamily \#include $<$sys/types.h$>$}\par
{\ttfamily \#include $<$string.h$>$}\par
{\ttfamily \#include $<$assert.h$>$}\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{structclass}{class}
\end{DoxyCompactItemize}
\subsection*{Defines}
\begin{DoxyCompactItemize}
\item
\#define \hyperlink{class_8h_a04ec2c53aa9fcdb5b58dc8e9d552dec0}{\_\-ISOC99\_\-SOURCE}
\item
\#define \hyperlink{class_8h_a28c4c4c1ebf62795262a3553d59e8bff}{CLASS\_\-MAGIC}~0xFEFE
\item
\#define \hyperlink{class_8h_ab12c2142e0ec3f4f19a03b3879c67f32}{CLASS}(name)
\item
\#define \hyperlink{class_8h_a45e588b871b5b73461805ab4a5c59aa5}{EXTENDS}(parent)~const char \_\-\mbox{[}sizeof(struct c\_\-\#\#parent)\mbox{]}
\item
\#define \hyperlink{class_8h_ab9f9098d95379c04d979721396dabf68}{\_\-NULL}~NULL
\item
\#define \hyperlink{class_8h_a509b4880afb25bb862c448d7a71e7afe}{CREATE\_\-CLASS}(name, \_\-parent,...)
\item
\#define \hyperlink{class_8h_a2e9a0b177e4115cc7e547b51ac35c5af}{\_\-CALL}(object, \_\-iface, method,...)
\item
\#define \hyperlink{class_8h_ada752d9d1fdbf84e978606e8999c762d}{CALL}(object, \_\-iface, method,...)
\item
\#define \hyperlink{class_8h_a06fb0f2e08d1cbacbed6784319e7c3fc}{RETCALL}(object, \_\-iface, method, ret,...)
\item
\#define \hyperlink{class_8h_adb99542d8748b5108322ccb26bb367e0}{IFACE\_\-GET}(\hyperlink{structclass}{class}, iface)~(interfaceGet(\&((\hyperlink{structclass}{class})-\/$>$impl),(iface)))
\item
\#define \hyperlink{class_8h_a80e924aca338b869530dde0a9389e916}{IFACE\_\-EXISTS}(\hyperlink{structclass}{class}, iface)~(NULL != IFACE\_\-GET((\hyperlink{structclass}{class}),(iface)))
\item
\#define \hyperlink{class_8h_a5ea9893a0e62748b9d1154d5b77abed1}{HAS\_\-PARENT}(\hyperlink{structclass}{class})~(NULL != ((\hyperlink{structclass}{class})-\/$>$parent))
\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item
typedef void($\ast$ \hyperlink{class_8h_aa0ba47bce818b20155a8ef17a1fdc35c}{fptr\_\-classInit} )(void)
\item
typedef struct \hyperlink{structclass}{class} $\ast$ \hyperlink{class_8h_a68df9f6e346c5fad9f61bb2557d1d832}{class\_\-ptr}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item
void $\ast$ \hyperlink{class_8h_ad96186de45579eb423ab318a5caaf62f}{class\_\-getInterface} (\hyperlink{structclass}{class\_\-ptr} $\ast$, \hyperlink{structinterface}{iface\_\-ptr})
\item
\hyperlink{structclass}{class\_\-ptr} \hyperlink{class_8h_a1f382a42de272d5cc4d6bb5b17db6ede}{class\_\-getClass} (void $\ast$)
\end{DoxyCompactItemize}
\subsection{Define Documentation}
\hypertarget{class_8h_a2e9a0b177e4115cc7e547b51ac35c5af}{
\index{class.h@{class.h}!\_\-CALL@{\_\-CALL}}
\index{\_\-CALL@{\_\-CALL}!class.h@{class.h}}
\subsubsection[{\_\-CALL}]{\setlength{\rightskip}{0pt plus 5cm}\#define \_\-CALL(
\begin{DoxyParamCaption}
\item[{}]{object, }
\item[{}]{\_\-iface, }
\item[{}]{method, }
\item[{}]{...}
\end{DoxyParamCaption}
)}}
\label{class_8h_a2e9a0b177e4115cc7e547b51ac35c5af}
{\bfseries Value:}
\begin{DoxyCode}
class_ptr class = class_getClass((object)); \
struct i_##_iface * iface;
\
if (class->init) class->init();
\
iface = (struct i_##_iface *)class_getInterface(&class, &i_##_iface);
\
while ((NULL == iface || NULL == iface->method) && HAS_PARENT(class)) {
\
class = class->parent;
\
if (class->init) class->init();
\
iface = (struct i_##_iface *)class_getInterface(&class, &i_##_ifa
ce); \
};
\
assert(NULL != iface->method);
\end{DoxyCode}
: actually i use gcc feature \#\# for variadoc... think about a way to make this standard.
Definition at line 43 of file class.h.
\hypertarget{class_8h_a04ec2c53aa9fcdb5b58dc8e9d552dec0}{
\index{class.h@{class.h}!\_\-ISOC99\_\-SOURCE@{\_\-ISOC99\_\-SOURCE}}
\index{\_\-ISOC99\_\-SOURCE@{\_\-ISOC99\_\-SOURCE}!class.h@{class.h}}
\subsubsection[{\_\-ISOC99\_\-SOURCE}]{\setlength{\rightskip}{0pt plus 5cm}\#define \_\-ISOC99\_\-SOURCE}}
\label{class_8h_a04ec2c53aa9fcdb5b58dc8e9d552dec0}
Definition at line 11 of file class.h.
\hypertarget{class_8h_ab9f9098d95379c04d979721396dabf68}{
\index{class.h@{class.h}!\_\-NULL@{\_\-NULL}}
\index{\_\-NULL@{\_\-NULL}!class.h@{class.h}}
\subsubsection[{\_\-NULL}]{\setlength{\rightskip}{0pt plus 5cm}\#define \_\-NULL~NULL}}
\label{class_8h_ab9f9098d95379c04d979721396dabf68}
Definition at line 24 of file class.h.
\hypertarget{class_8h_ada752d9d1fdbf84e978606e8999c762d}{
\index{class.h@{class.h}!CALL@{CALL}}
\index{CALL@{CALL}!class.h@{class.h}}
\subsubsection[{CALL}]{\setlength{\rightskip}{0pt plus 5cm}\#define CALL(
\begin{DoxyParamCaption}
\item[{}]{object, }
\item[{}]{\_\-iface, }
\item[{}]{method, }
\item[{}]{...}
\end{DoxyParamCaption}
)}}
\label{class_8h_ada752d9d1fdbf84e978606e8999c762d}
{\bfseries Value:}
\begin{DoxyCode}
do { \
_CALL(object, _iface, method, ##__VA_ARGS__); \
iface->method(object, ##__VA_ARGS__); \
} while(0)
\end{DoxyCode}
Definition at line 55 of file class.h.
\hypertarget{class_8h_ab12c2142e0ec3f4f19a03b3879c67f32}{
\index{class.h@{class.h}!CLASS@{CLASS}}
\index{CLASS@{CLASS}!class.h@{class.h}}
\subsubsection[{CLASS}]{\setlength{\rightskip}{0pt plus 5cm}\#define CLASS(
\begin{DoxyParamCaption}
\item[{}]{name}
\end{DoxyParamCaption}
)}}
\label{class_8h_ab12c2142e0ec3f4f19a03b3879c67f32}
{\bfseries Value:}
\begin{DoxyCode}
struct c_##name; \
typedef struct c_##name * name; \
extern struct class * const _##name; \
struct c_##name
\end{DoxyCode}
Definition at line 15 of file class.h.
\hypertarget{class_8h_a28c4c4c1ebf62795262a3553d59e8bff}{
\index{class.h@{class.h}!CLASS\_\-MAGIC@{CLASS\_\-MAGIC}}
\index{CLASS\_\-MAGIC@{CLASS\_\-MAGIC}!class.h@{class.h}}
\subsubsection[{CLASS\_\-MAGIC}]{\setlength{\rightskip}{0pt plus 5cm}\#define CLASS\_\-MAGIC~0xFEFE}}
\label{class_8h_a28c4c4c1ebf62795262a3553d59e8bff}
Definition at line 13 of file class.h.
\hypertarget{class_8h_a509b4880afb25bb862c448d7a71e7afe}{
\index{class.h@{class.h}!CREATE\_\-CLASS@{CREATE\_\-CLASS}}
\index{CREATE\_\-CLASS@{CREATE\_\-CLASS}!class.h@{class.h}}
\subsubsection[{CREATE\_\-CLASS}]{\setlength{\rightskip}{0pt plus 5cm}\#define CREATE\_\-CLASS(
\begin{DoxyParamCaption}
\item[{}]{name, }
\item[{}]{\_\-parent, }
\item[{}]{...}
\end{DoxyParamCaption}
)}}
\label{class_8h_a509b4880afb25bb862c448d7a71e7afe}
{\bfseries Value:}
\begin{DoxyCode}
static struct class c_##name; \
static void _classInit_(void) { \
c_##name.parent = _##_parent; \
c_##name.init = NULL; \
} \
static struct class c_##name = { \
CLASS_MAGIC, \
NULL, \
sizeof(struct c_##name), \
_classInit_, \
INIT_IMPL(__VA_ARGS__) \
}; struct class * const _##name = &c_##name
\end{DoxyCode}
Definition at line 25 of file class.h.
\hypertarget{class_8h_a45e588b871b5b73461805ab4a5c59aa5}{
\index{class.h@{class.h}!EXTENDS@{EXTENDS}}
\index{EXTENDS@{EXTENDS}!class.h@{class.h}}
\subsubsection[{EXTENDS}]{\setlength{\rightskip}{0pt plus 5cm}\#define EXTENDS(
\begin{DoxyParamCaption}
\item[{}]{parent}
\end{DoxyParamCaption}
)~const char \_\-\mbox{[}sizeof(struct c\_\-\#\#parent)\mbox{]}}}
\label{class_8h_a45e588b871b5b73461805ab4a5c59aa5}
Definition at line 21 of file class.h.
\hypertarget{class_8h_a5ea9893a0e62748b9d1154d5b77abed1}{
\index{class.h@{class.h}!HAS\_\-PARENT@{HAS\_\-PARENT}}
\index{HAS\_\-PARENT@{HAS\_\-PARENT}!class.h@{class.h}}
\subsubsection[{HAS\_\-PARENT}]{\setlength{\rightskip}{0pt plus 5cm}\#define HAS\_\-PARENT(
\begin{DoxyParamCaption}
\item[{}]{{\bf class}}
\end{DoxyParamCaption}
)~(NULL != (({\bf class})-\/$>$parent))}}
\label{class_8h_a5ea9893a0e62748b9d1154d5b77abed1}
Definition at line 71 of file class.h.
\hypertarget{class_8h_a80e924aca338b869530dde0a9389e916}{
\index{class.h@{class.h}!IFACE\_\-EXISTS@{IFACE\_\-EXISTS}}
\index{IFACE\_\-EXISTS@{IFACE\_\-EXISTS}!class.h@{class.h}}
\subsubsection[{IFACE\_\-EXISTS}]{\setlength{\rightskip}{0pt plus 5cm}\#define IFACE\_\-EXISTS(
\begin{DoxyParamCaption}
\item[{}]{{\bf class}, }
\item[{}]{iface}
\end{DoxyParamCaption}
)~(NULL != IFACE\_\-GET(({\bf class}),(iface)))}}
\label{class_8h_a80e924aca338b869530dde0a9389e916}
Definition at line 69 of file class.h.
\hypertarget{class_8h_adb99542d8748b5108322ccb26bb367e0}{
\index{class.h@{class.h}!IFACE\_\-GET@{IFACE\_\-GET}}
\index{IFACE\_\-GET@{IFACE\_\-GET}!class.h@{class.h}}
\subsubsection[{IFACE\_\-GET}]{\setlength{\rightskip}{0pt plus 5cm}\#define IFACE\_\-GET(
\begin{DoxyParamCaption}
\item[{}]{{\bf class}, }
\item[{}]{iface}
\end{DoxyParamCaption}
)~(interfaceGet(\&(({\bf class})-\/$>$impl),(iface)))}}
\label{class_8h_adb99542d8748b5108322ccb26bb367e0}
Definition at line 68 of file class.h.
\hypertarget{class_8h_a06fb0f2e08d1cbacbed6784319e7c3fc}{
\index{class.h@{class.h}!RETCALL@{RETCALL}}
\index{RETCALL@{RETCALL}!class.h@{class.h}}
\subsubsection[{RETCALL}]{\setlength{\rightskip}{0pt plus 5cm}\#define RETCALL(
\begin{DoxyParamCaption}
\item[{}]{object, }
\item[{}]{\_\-iface, }
\item[{}]{method, }
\item[{}]{ret, }
\item[{}]{...}
\end{DoxyParamCaption}
)}}
\label{class_8h_a06fb0f2e08d1cbacbed6784319e7c3fc}
{\bfseries Value:}
\begin{DoxyCode}
do { \
_CALL(object, _iface, method, ##__VA_ARGS__); \
ret = iface->method(object, ##__VA_ARGS__); \
} while(0)
\end{DoxyCode}
Definition at line 61 of file class.h.
\subsection{Typedef Documentation}
\hypertarget{class_8h_a68df9f6e346c5fad9f61bb2557d1d832}{
\index{class.h@{class.h}!class\_\-ptr@{class\_\-ptr}}
\index{class\_\-ptr@{class\_\-ptr}!class.h@{class.h}}
\subsubsection[{class\_\-ptr}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf class}$\ast$ {\bf class\_\-ptr}}}
\label{class_8h_a68df9f6e346c5fad9f61bb2557d1d832}
Definition at line 76 of file class.h.
\hypertarget{class_8h_aa0ba47bce818b20155a8ef17a1fdc35c}{
\index{class.h@{class.h}!fptr\_\-classInit@{fptr\_\-classInit}}
\index{fptr\_\-classInit@{fptr\_\-classInit}!class.h@{class.h}}
\subsubsection[{fptr\_\-classInit}]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$ {\bf fptr\_\-classInit})(void)}}
\label{class_8h_aa0ba47bce818b20155a8ef17a1fdc35c}
Definition at line 73 of file class.h.
\subsection{Function Documentation}
\hypertarget{class_8h_a1f382a42de272d5cc4d6bb5b17db6ede}{
\index{class.h@{class.h}!class\_\-getClass@{class\_\-getClass}}
\index{class\_\-getClass@{class\_\-getClass}!class.h@{class.h}}
\subsubsection[{class\_\-getClass}]{\setlength{\rightskip}{0pt plus 5cm}{\bf class\_\-ptr} class\_\-getClass (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{}
\end{DoxyParamCaption}
)}}
\label{class_8h_a1f382a42de272d5cc4d6bb5b17db6ede}
Definition at line 21 of file class.c.
\begin{DoxyCode}
{
return *(class_ptr *)(object - sizeof(void*));
}
\end{DoxyCode}
Here is the caller graph for this function:
\hypertarget{class_8h_ad96186de45579eb423ab318a5caaf62f}{
\index{class.h@{class.h}!class\_\-getInterface@{class\_\-getInterface}}
\index{class\_\-getInterface@{class\_\-getInterface}!class.h@{class.h}}
\subsubsection[{class\_\-getInterface}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ class\_\-getInterface (
\begin{DoxyParamCaption}
\item[{{\bf class\_\-ptr} $\ast$}]{, }
\item[{{\bf iface\_\-ptr}}]{}
\end{DoxyParamCaption}
)}}
\label{class_8h_ad96186de45579eb423ab318a5caaf62f}
Definition at line 8 of file class.c.
\begin{DoxyCode}
{
void * iface = (void *)IFACE_GET(*class, _iface);
while(NULL == iface && HAS_PARENT(*class)) {
*class = (*class)->parent;
iface = (void *)IFACE_GET(*class, _iface);
}
return iface;
}
\end{DoxyCode}