Newer
Older
snipet / kyscript / trunk / lib / nstdc / include / nstdc_dlfcn.h
Nomura Kei on 26 Aug 2022 936 bytes old svn data to git
/**
 * @file      nstdc_dlfcn.h
 * @brief     動的リンクを扱うモジュール
 * @author    Nomura Kei
 * @copyright 2003 - 2017  Nomura Kei
 * License: New BSD License (3-cclause BSD license)
 */
#ifndef NSTDC_DLFCN_H
#define NSTDC_DLFCN_H

#include <stddef.h>
#include <stdbool.h>

#include <nstdc.h>
#include <nstdc_os.h>

#ifdef __cplusplus
extern "C" {
#endif

#if (nstdc_is_windows())
/* for Windows	*/
typedef HINSTANCE       nstdc_dl_handle_t;
typedef FARPROC WINAPI  nstdc_dl_func_t;

#else
/* for Posix	*/
typedef void*           nstdc_dl_handle_t;
typedef void*           nstdc_dl_func_t;

#endif	/* if (nstdc_is_windows())	*/


nstdc_dl_handle_t nstdc_dlopen(const char* filename);
char*             nstdc_dlerror(void);
nstdc_dl_func_t   nstdc_dlsym(nstdc_dl_handle_t handle, const char* symbol);
bool              nstdc_dlclose(nstdc_dl_handle_t handle);


#ifdef __cplusplus
}
#endif

#endif	/* NSTDC_DLFCN_H	*/