00001 /*************************************************************************** 00002 *cr 00003 *cr (C) Copyright 1995-2019 The Board of Trustees of the 00004 *cr University of Illinois 00005 *cr All Rights Reserved 00006 *cr 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * RCS INFORMATION: 00011 * 00012 * $RCSfile: vmddlopen.h,v $ 00013 * $Author: johns $ $Locker: $ $State: Exp $ 00014 * $Revision: 1.12 $ $Date: 2019/01/17 21:21:03 $ 00015 * 00016 *************************************************************************** 00017 * DESCRIPTION: 00018 * Routines for loading dynamic link libraries and shared object files 00019 * on various platforms, abstracting from machine dependent APIs. 00020 * 00021 * LICENSE: 00022 * UIUC Open Source License 00023 * http://www.ks.uiuc.edu/Research/vmd/plugins/pluginlicense.html 00024 * 00025 ***************************************************************************/ 00026 00027 /* 00028 * vmddlopen: thin multi-platform wrapper around dlopen/LoadLibrary 00029 */ 00030 00031 #ifndef VMD_DLOPEN__ 00032 00033 #ifdef __cplusplus 00034 extern "C" { 00035 #endif 00036 00037 /* Try to open the specified library. All symbols must be resolved or the 00038 * load will fail (RTLD_NOW). 00039 */ 00040 void *vmddlopen(const char *fname); 00041 00042 /* Try to load the specified symbol using the given handle. Returns NULL if 00043 * the symbol cannot be loaded. 00044 */ 00045 void *vmddlsym(void *h, const char *sym); 00046 00047 /* Unload the library. Return 0 on success, nonzero on error. 00048 */ 00049 int vmddlclose(void *h); 00050 00051 /* Return last error from any of the above functions. Not thread-safe on 00052 * Windows due to static buffer in our code. 00053 */ 00054 const char *vmddlerror(void); 00055 00056 #ifdef __cplusplus 00057 } 00058 #endif 00059 00060 #endif 00061