|
Server 0.0.1
HTTP/REST server implementation
|
#include <sys/types.h>#include <stdlib.h>#include "class/interface.h"#include "commons.h"
Go to the source code of this file.
Functions | |
| iface_ptr | interfaceGet (iface_impl_ptr iface_impl, const iface_ptr _iface) |
Copyright © 2012 Georg Hopp
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Definition in file interface.c.
| iface_ptr interfaceGet | ( | iface_impl_ptr | iface_impl, |
| const iface_ptr | _iface | ||
| ) |
this one is important in selector functions to get the correct interface implementation of a class.
Definition at line 44 of file interface.c.
{
const iface_ptr * iface = &_iface;
iface_ptr * found;
if (! iface_impl->simpl) {
qsort((void**)(iface_impl->impl), iface_impl->nimpl, sizeof(iface_ptr), comp);
iface_impl->simpl=TRUE;
}
found = bsearch(
&iface,
iface_impl->impl,
iface_impl->nimpl,
sizeof(iface_ptr),
comp);
return found? *found : (iface_ptr)NULL;
}