1255365Sdes/*-
2255365Sdes * Copyright (c) 2013 Dag-Erling Sm��rgrav
3255365Sdes * All rights reserved.
4255365Sdes *
5255365Sdes * Redistribution and use in source and binary forms, with or without
6255365Sdes * modification, are permitted provided that the following conditions
7255365Sdes * are met:
8255365Sdes * 1. Redistributions of source code must retain the above copyright
9255365Sdes *    notice, this list of conditions and the following disclaimer.
10255365Sdes * 2. Redistributions in binary form must reproduce the above copyright
11255365Sdes *    notice, this list of conditions and the following disclaimer in the
12255365Sdes *    documentation and/or other materials provided with the distribution.
13255365Sdes *
14255365Sdes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15255365Sdes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16255365Sdes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17255365Sdes * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18255365Sdes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19255365Sdes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20255365Sdes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21255365Sdes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22255365Sdes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23255365Sdes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24255365Sdes * SUCH DAMAGE.
25255365Sdes *
26255365Sdes * $Id: openpam_dlfunc.h 660 2013-03-11 15:08:52Z des $
27255365Sdes */
28255365Sdes
29255365Sdes#ifndef OPENPAM_DLFCN_H_INCLUDED
30255365Sdes#define OPENPAM_DLFCN_H_INCLUDED
31255365Sdes
32255365Sdes#ifndef HAVE_DLFUNC
33255365Sdestypedef void (*dlfunc_t)();
34255365Sdes
35255365Sdesstatic inline dlfunc_t
36255365Sdesdlfunc(void *handle, const char *symbol)
37255365Sdes{
38255365Sdes
39255365Sdes	return ((dlfunc_t)dlsym(handle, symbol));
40255365Sdes}
41255365Sdes#endif
42255365Sdes
43255365Sdes#endif
44