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. 13348980Sdes * 3. The name of the author may not be used to endorse or promote 14348980Sdes * products derived from this software without specific prior written 15348980Sdes * permission. 16255365Sdes * 17255365Sdes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18255365Sdes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19255365Sdes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20255365Sdes * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21255365Sdes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22255365Sdes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23255365Sdes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24255365Sdes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25255365Sdes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26255365Sdes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27255365Sdes * SUCH DAMAGE. 28255365Sdes * 29348980Sdes * $OpenPAM: openpam_dlfunc.h 938 2017-04-30 21:34:42Z des $ 30255365Sdes */ 31255365Sdes 32255365Sdes#ifndef OPENPAM_DLFCN_H_INCLUDED 33255365Sdes#define OPENPAM_DLFCN_H_INCLUDED 34255365Sdes 35255365Sdes#ifndef HAVE_DLFUNC 36255365Sdestypedef void (*dlfunc_t)(); 37255365Sdes 38255365Sdesstatic inline dlfunc_t 39255365Sdesdlfunc(void *handle, const char *symbol) 40255365Sdes{ 41255365Sdes 42255365Sdes return ((dlfunc_t)dlsym(handle, symbol)); 43255365Sdes} 44255365Sdes#endif 45255365Sdes 46255365Sdes#endif 47