2008-10-24 13:53:48 +04:00
|
|
|
/*
|
2012-07-19 22:11:40 +04:00
|
|
|
* Copyright 2003-2012 Haiku, Inc. All Rights Reserved.
|
2008-10-24 13:53:48 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2003-01-12 19:15:49 +03:00
|
|
|
#ifndef _DLFCN_H
|
|
|
|
#define _DLFCN_H
|
2008-10-24 13:53:48 +04:00
|
|
|
|
2003-01-12 19:15:49 +03:00
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
|
|
|
|
#define RTLD_LAZY 0 /* relocations are performed as needed */
|
|
|
|
#define RTLD_NOW 1 /* the file gets relocated at load time */
|
|
|
|
#define RTLD_LOCAL 0 /* symbols are not available for relocating any other object */
|
|
|
|
#define RTLD_GLOBAL 2 /* all symbols are available */
|
|
|
|
|
2008-11-09 01:40:56 +03:00
|
|
|
/* not-yet-POSIX extensions (dlsym() handles) */
|
|
|
|
#define RTLD_DEFAULT ((void*)0)
|
|
|
|
/* find the symbol in the global scope */
|
|
|
|
#define RTLD_NEXT ((void*)-1L)
|
|
|
|
/* find the next definition of the symbol */
|
2003-01-12 19:15:49 +03:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2008-10-24 13:53:48 +04:00
|
|
|
/* This is a gnu extension for the dladdr function */
|
|
|
|
typedef struct {
|
|
|
|
const char *dli_fname; /* Filename of defining object */
|
|
|
|
void *dli_fbase; /* Load address of that object */
|
|
|
|
const char *dli_sname; /* Name of nearest lower symbol */
|
|
|
|
void *dli_saddr; /* Exact value of nearest symbol */
|
|
|
|
} Dl_info;
|
|
|
|
|
2003-01-12 19:15:49 +03:00
|
|
|
extern int dlclose(void *image);
|
|
|
|
extern char *dlerror(void);
|
|
|
|
extern void *dlopen(const char *path, int mode);
|
|
|
|
extern void *dlsym(void *image, const char *symbolName);
|
2017-09-15 23:54:18 +03:00
|
|
|
extern int dladdr(const void *addr, Dl_info *info);
|
2003-01-12 19:15:49 +03:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _DLFCN_H */
|