Path: blob/21.2-virgl/src/gallium/auxiliary/util/u_dl.h
4561 views
/**************************************************************************1*2* Copyright 2009 VMware, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL16* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,17* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR18* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE19* USE OR OTHER DEALINGS IN THE SOFTWARE.20*21* The above copyright notice and this permission notice (including the22* next paragraph) shall be included in all copies or substantial portions23* of the Software.24*25**************************************************************************/262728#ifndef U_DL_H_29#define U_DL_H_303132#include "pipe/p_config.h"3334#ifdef __cplusplus35extern "C" {36#endif3738#if defined(PIPE_OS_WINDOWS)39# define UTIL_DL_EXT ".dll"40# define UTIL_DL_PREFIX ""41#elif defined(PIPE_OS_APPLE)42# define UTIL_DL_EXT ".dylib"43# define UTIL_DL_PREFIX "lib"44#else45# define UTIL_DL_EXT ".so"46# define UTIL_DL_PREFIX "lib"47#endif484950struct util_dl_library;515253typedef void (*util_dl_proc)(void);545556/**57* Open a library dynamically.58*/59struct util_dl_library *60util_dl_open(const char *filename);616263/**64* Lookup a function in a library.65*/66util_dl_proc67util_dl_get_proc_address(struct util_dl_library *library,68const char *procname);697071/**72* Close a library.73*/74void75util_dl_close(struct util_dl_library *library);767778/**79* Return most recent error message.80*/81const char *82util_dl_error(void);8384#ifdef __cplusplus85}86#endif8788#endif /* U_DL_H_ */899091