1N/Alib dllload,loadbind,shl_load -ldl
1N/Atst dll_DYNAMIC link{
1N/A extern struct link_dynamic _DYNAMIC;
1N/A then for s in "*.*" "*[!a]*"
1N/A do for i in $d/$b.$s
1N/A i=`echo $lib | sed 's,\([^0-9]*[0-9]*\).*,\1,'`
1N/A *) if test -f /usr$lib
1N/A echo "#define _DLL_NEXT_PATH \"$lib\""
1N/A #if defined(__MVS__) && !defined(__SUSV3)
1N/A #if _hdr_dlfcn && _lib_dlopen
1N/A #if _hdr_rld_interface
1N/A #if _hdr_rld_interface
1N/A static char* local[] = { "__elf_header", "_call_add_gp_range", "_etext" };
1N/A printf("#if defined(__MVS__) && !defined(__SUSV3)\n");
1N/A printf("#define __SUSV3 1\n");
1N/A #if _hdr_dlfcn && _lib_dlopen
1N/A printf("#define RTLD_LAZY 1\n");
1N/A printf("#define RTLD_NOW 2\n");
1N/A printf("#define RTLD_GLOBAL 0\n");
1N/A printf("#define RTLD_LOCAL 0\n");
1N/A printf("#define RTLD_PARENT 0\n");
1N/A #if defined(_hdr_mach_o_dyld) && !defined(RTLD_NEXT)
1N/A printf("#define RTLD_NEXT ((void*)16)\n");
1N/A #if _hdr_rld_interface
1N/A if (!(dll = dlopen(0, RTLD_LAZY)))
1N/A for (i = 0; i < sizeof(local) / sizeof(local[0]); i++)
1N/A if (dlsym(dll, local[i]))
1N/A if (i >= sizeof(local) / sizeof(local[0]))
1N/A printf("#define _DLL_RLD_SYM %s\n", local[i]);
1N/A printf("#define _DLL_RLD_SYM_STR \"%s\"\n", local[i]);
1N/A printf("#define _DLL_RLD_SYM_TYPE void*\n");
1N/A printf("#define DLL_INFO_PREVER 0x0001 /* pre-suffix style version */\n");
1N/A printf("#define DLL_INFO_DOTVER 0x0002 /* post-suffix style version */\n");
1N/A printf("typedef unsigned long (*Dll_plugin_version_f)(void);\n");
1N/A printf("typedef struct Dllinfo_s\n");
1N/A printf(" char** sibling; /* sibling dirs on $PATH */\n");
1N/A printf(" char* prefix; /* library name prefix */\n");
1N/A printf(" char* suffix; /* library name suffix */\n");
1N/A printf(" char* env; /* library path env var */\n");
1N/A printf(" int flags; /* DLL_INFO_* flags */\n");
1N/A printf("#ifdef _DLLINFO_PRIVATE_\n");
1N/A printf(" _DLLINFO_PRIVATE_\n");
1N/A printf("} Dllinfo_t;\n");
1N/A printf("typedef struct Dllent_s\n");
1N/A printf(" char* path;\n");
1N/A printf(" char* name;\n");
1N/A printf("#ifdef _DLLENT_PRIVATE_\n");
1N/A printf(" _DLLENT_PRIVATE_\n");
1N/A printf("} Dllent_t;\n");
1N/A printf("typedef struct Dllscan_s\n");
1N/A printf(" void* pad;\n");
1N/A printf("#ifdef _DLLSCAN_PRIVATE_\n");
1N/A printf(" _DLLSCAN_PRIVATE_\n");
1N/A printf("} Dllscan_t;\n");
1N/A #if !_hdr_dlfcn || !_lib_dlopen
1N/A printf("extern void* dlopen(const char*, int);\n");
1N/A printf("extern void* dlsym(void*, const char*);\n");
1N/A printf("extern int dlclose(void*);\n");
1N/A printf("extern char* dlerror(void);\n");
1N/A printf("#if _BLD_dll && defined(__EXPORT__)\n");
1N/A printf("#define extern __EXPORT__\n");
1N/A printf("extern Dllinfo_t* dllinfo(void);\n");
1N/A printf("extern void* dllplugin(const char*, const char*, const char*, unsigned long, unsigned long*, int, char*, size_t);\n");
1N/A printf("extern void* dllplug(const char*, const char*, const char*, int, char*, size_t);\n");
1N/A printf("extern void* dllfind(const char*, const char*, int, char*, size_t);\n");
1N/A printf("extern void* dllopen(const char*, int);\n");
1N/A printf("extern void* dllnext(int);\n");
1N/A printf("extern void* dlllook(void*, const char*);\n");
1N/A printf("extern int dllcheck(void*, const char*, unsigned long, unsigned long*);\n");
1N/A printf("extern unsigned long dllversion(void*, const char*);\n");
1N/A printf("extern char* dllerror(int);\n");
1N/A #if _hdr_rld_interface
1N/A printf("extern void* _dll_next(int, _DLL_RLD_SYM_TYPE*);\n");
1N/A printf("#define dllnext(f) _dll_next(f, &_DLL_RLD_SYM)\n");
1N/A printf("extern Dllscan_t* dllsopen(const char*, const char*, const char*);\n");
1N/A printf("extern Dllent_t* dllsread(Dllscan_t*);\n");
1N/A printf("extern int dllsclose(Dllscan_t*);\n");
1N/A printf("#undef extern\n");
1N/A #if _hdr_rld_interface
1N/A printf("extern _DLL_RLD_SYM_TYPE _DLL_RLD_SYM;\n");