server 0.0.1
basicserverinfrastructure

src/interface.c File Reference

#include <sys/types.h>
#include <stdlib.h>
#include "interface.h"
Include dependency graph for interface.c:

Go to the source code of this file.

Defines

#define TRUE   1

Functions

struct interfaceinterfaceGet (iface_impl_ptr iface_impl, const iface_ptr _iface)

Define Documentation

#define TRUE   1

Definition at line 7 of file interface.c.


Function Documentation

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;
}
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines