|
server 0.0.1
basicserverinfrastructure
|
#include <sys/types.h>#include <stdlib.h>#include "interface.h"
Go to the source code of this file.
Defines | |
| #define | TRUE 1 |
Functions | |
| struct interface * | interfaceGet (iface_impl_ptr iface_impl, const iface_ptr _iface) |
| #define TRUE 1 |
Definition at line 7 of file interface.c.
| struct interface* interfaceGet | ( | iface_impl_ptr | iface_impl, |
| const iface_ptr | _iface | ||
| ) | [read] |
this one is important in selector functions to get the correct interface implementation of a class.
Definition at line 25 of file interface.c.
{
const iface_ptr * iface = &_iface;
void * dummy;
if (! iface_impl->simpl) {
qsort((void**)(iface_impl->impl), iface_impl->nimpl, sizeof(iface_ptr), comp);
iface_impl->simpl=TRUE;
}
dummy = bsearch(
&iface,
iface_impl->impl,
iface_impl->nimpl,
sizeof(iface_ptr),
comp);
return dummy? *(struct interface **)dummy : dummy;
}