kconfig_load.c

来自「busybox最新版的源码:学习和应用的好东东,多的不说了,大家看后再说吧」· C语言 代码 · 共 36 行

C
36
字号
#include <dlfcn.h>#include <stdio.h>#include <stdlib.h>#include "lkc.h"#define P(name,type,arg)	type (*name ## _p) arg#include "lkc_proto.h"#undef Pvoid kconfig_load(void){	void *handle;	char *error;	handle = dlopen("./libkconfig.so", RTLD_LAZY);	if (!handle) {		handle = dlopen("./scripts/kconfig/libkconfig.so", RTLD_LAZY);		if (!handle) {			fprintf(stderr, "%s\n", dlerror());			exit(1);		}	}#define P(name,type,arg)			\{						\	name ## _p = dlsym(handle, #name);	\	if ((error = dlerror()))  {		\		fprintf(stderr, "%s\n", error);	\		exit(1);			\	}					\}#include "lkc_proto.h"#undef P}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?