📄 dynload.h
字号:
/* *---------------------------------------------------------------------- * T-Kernel / Standard Extension * * Copyright (C) 2006 by Ken Sakamura. All rights reserved. * T-Kernel / Standard Extension is distributed * under the T-License for T-Kernel / Standard Extension. *---------------------------------------------------------------------- * * Version: 1.00.00 * Released by T-Engine Forum(http://www.t-engine.org) at 2006/8/11. * *---------------------------------------------------------------------- *//* * @(#)dynload.h * * Dynamic loading */#ifndef __EXTENSION_DYNLOAD_H__#define __EXTENSION_DYNLOAD_H__#include <basic.h>#include "typedef.h"#include <sys/pinfo.h>#ifdef __cplusplusextern "C" {#endif/* * tkse_dlsearch mode */#define DL_BASE 0x08 /* File specified at "Ink" */#define DL_WORK 0x04 /* Current working file */#define DL_PROC 0x02 /* The invoking process program file */#define DL_STDLIB 0x01 /* Standard library file /SYS/lib *//* * tkse_dlopen flag */#define DL_LAZY 0x0001 /* Resolve the undefined symbol sequentially at runtime */#define DL_NOW 0x0002 /* Resolve the undefined symbol at the time of loading */#define DL_GLOBAL 0x0100 /* the symbol shall be handled as a global scope */#define DL_BINDING_MASK (DL_LAZY | DL_NOW) /* Mask that specifies linking */#define RTLD_LAZY DL_LAZY /* Resolve the undefined symbol sequentially at runtime */#define RTLD_NOW DL_NOW /* Resolve the undefined symbol at the time of loading */#define RTLD_GLOBAL DL_GLOBAL /* the symbol shall be handled as a global scope */#define RTLD_BINDING_MASK DL_BINDING_MASK /* Mask that specifies linking *//* * tkse_dlsym special handl */#define DL_NEXT (-1) /* Search the symbol of the lower rank than itself */#define DL_DEFAULT 0 /* Search global symbol */#define RTLD_NEXT ((void *)DL_NEXT) /* Search the symbol of the lower rank than itself */#define RTLD_DEFAULT ((void *)DL_DEFAULT) /* Search global symbol */typedef struct { ATR atr; /* object attribute */ VP path; /* filename */ W mode; /* open mode */} T_DLOPEN;typedef struct { ATR atr; /* object attribute */ VP path; /* filename */ VP fbase; /* base address */ const B *sname; /* symbol name */ VP saddr; /* symbol address */} T_DLINFO;typedef struct { const char *dli_fname; /* filename */ void *dli_fbase; /* base address */ const char *dli_sname; /* symbol name */ void *dli_saddr; /* symbol address */} Dl_info;/* * Library function */IMPORT ER tkse_dlsearch( TC *path, LINK *lnk, W mode );IMPORT WER tkse_dlopen( T_DLOPEN *info );IMPORT ER tkse_dlsym( W handle, const char *symbol, UW *val );IMPORT ER tkse_dladdr( VP addr, T_DLINFO *info );IMPORT ER tkse_dlclose( W handle );IMPORT void *dlopen(const char *filename, int flag);IMPORT int dlclose( void *handle );IMPORT int dladdr( void *addr, Dl_info *info );IMPORT void *dlsym(void *handle, const char *symbol);#ifdef __cplusplus}#endif#endif /* __EXTENSION_DYNLOAD_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -