1 /*
2  * BEGIN illumos section
3  *   This is an unstable interface; changes may be made
4  *   without notice.
5  * END illumos section
6  */
7 /***********************************************************************
8 *                                                                      *
9 *               This software is part of the ast package               *
10 *          Copyright (c) 1997-2025 AT&T Intellectual Property          *
11 *                      and is licensed under the                       *
12 *                 Eclipse Public License, Version 1.0                  *
13 *                    by AT&T Intellectual Property                     *
14 *                                                                      *
15 *                A copy of the License is available at                 *
16 *          http://www.eclipse.org/org/documents/epl-v10.html           *
17 *         (with md5 checksum b35adb5213ca9657e911e9befb180842)         *
18 *                                                                      *
19 *              Information and Software Systems Research               *
20 *                            AT&T Research                             *
21 *                           Florham Park NJ                            *
22 *                                                                      *
23 *                 Glenn Fowler <gsf@research.att.com>                  *
24 *                                                                      *
25 ***********************************************************************/
26 
27 /* : : generated by proto : : */
28 /* : : generated from contrib/ast/src/lib/libdll/features/dll by iffe version 2012-07-17 : : */
29 
30 #ifndef _def_dll_dll
31 #if !defined(__PROTO__)
32 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
33 #    if defined(__cplusplus)
34 #      define __LINKAGE__	"C"
35 #    else
36 #      define __LINKAGE__
37 #    endif
38 #    define __STDARG__
39 #    define __PROTO__(x)	x
40 #    define __OTORP__(x)
41 #    define __PARAM__(n,o)	n
42 #    if !defined(__STDC__) && !defined(__cplusplus)
43 #      if !defined(c_plusplus)
44 #      	define const
45 #      endif
46 #      define signed
47 #      define void		int
48 #      define volatile
49 #      define __V_		char
50 #    else
51 #      define __V_		void
52 #    endif
53 #  else
54 #    define __PROTO__(x)	()
55 #    define __OTORP__(x)	x
56 #    define __PARAM__(n,o)	o
57 #    define __LINKAGE__
58 #    define __V_		char
59 #    define const
60 #    define signed
61 #    define void		int
62 #    define volatile
63 #  endif
64 #  define __MANGLE__	__LINKAGE__
65 #  if defined(__cplusplus) || defined(c_plusplus)
66 #    define __VARARG__	...
67 #  else
68 #    define __VARARG__
69 #  endif
70 #  if defined(__STDARG__)
71 #    define __VA_START__(p,a)	va_start(p,a)
72 #  else
73 #    define __VA_START__(p,a)	va_start(p)
74 #  endif
75 #  if !defined(__INLINE__)
76 #    if defined(__cplusplus)
77 #      define __INLINE__	extern __MANGLE__ inline
78 #    else
79 #      if defined(_WIN32) && !defined(__GNUC__)
80 #      	define __INLINE__	__inline
81 #      endif
82 #    endif
83 #  endif
84 #endif
85 #if !defined(__LINKAGE__)
86 #define __LINKAGE__		/* 2004-08-11 transition */
87 #endif
88 
89 #define _def_dll_dll	1
90 #define _sys_types	1	/* #include <sys/types.h> ok */
91 #define _hdr_dlfcn	1	/* #include <dlfcn.h> ok */
92 #define _LIB_dl	1	/* -ldl is a library */
93 #define _lib_dlopen	1	/* dlopen() in default lib(s) */
94 #define _DLL_NEXT_PATH	"/usr/lib/libc.so.1"
95 
96 #if defined(__MVS__) && !defined(__SUSV3)
97 #define __SUSV3		1
98 #endif
99 #include <dlfcn.h>
100 
101 #define DLL_INFO_PREVER	0x0001	/* pre-suffix style version */
102 #define DLL_INFO_DOTVER	0x0002	/* post-suffix style version */
103 
104 typedef unsigned long (*Dll_plugin_version_f) __PROTO__((void));
105 typedef int (*Dllerror_f) __PROTO__((__V_*, __V_*, int, ...));
106 
107 typedef struct Dllinfo_s
108 {
109 	char**	sibling;	/* sibling dirs on $PATH */
110 	char*	prefix;		/* library name prefix */
111 	char*	suffix;		/* library name suffix */
112 	char*	env;		/* library path env var */
113 	int	flags;		/* DLL_INFO_* flags */
114 #ifdef _DLLINFO_PRIVATE_
115 	_DLLINFO_PRIVATE_
116 #endif
117 } Dllinfo_t;
118 
119 typedef struct Dllnames_s
120 {
121 	char*		id;
122 	char*		name;
123 	char*		base;
124 	char*		type;
125 	char*		opts;
126 	char*		path;
127 	char		data[1024];
128 } Dllnames_t;
129 
130 typedef struct Dllent_s
131 {
132 	char*		path;
133 	char*		name;
134 #ifdef _DLLENT_PRIVATE_
135 	_DLLENT_PRIVATE_
136 #endif
137 } Dllent_t;
138 
139 typedef struct Dllscan_s
140 {
141 	__V_*		pad;
142 #ifdef _DLLSCAN_PRIVATE_
143 	_DLLSCAN_PRIVATE_
144 #endif
145 } Dllscan_t;
146 
147 #if _BLD_dll && defined(__EXPORT__)
148 #undef __MANGLE__
149 #define __MANGLE__ __LINKAGE__          __EXPORT__
150 #endif
151 
152 extern __MANGLE__ Dllinfo_t*	dllinfo __PROTO__((void));
153 extern __MANGLE__ __V_*		dllplugin __PROTO__((const char*, const char*, const char*, unsigned long, unsigned long*, int, char*, size_t));
154 extern __MANGLE__ __V_*		dllplug __PROTO__((const char*, const char*, const char*, int, char*, size_t));
155 extern __MANGLE__ __V_*		dllfind __PROTO__((const char*, const char*, int, char*, size_t));
156 extern __MANGLE__ Dllnames_t*	dllnames __PROTO__((const char*, const char*, Dllnames_t*));
157 extern __MANGLE__ __V_*		dll_lib __PROTO__((Dllnames_t*, unsigned long, Dllerror_f, __V_*));
158 extern __MANGLE__ __V_*		dllmeth __PROTO__((const char*, const char*, unsigned long));
159 extern __MANGLE__ __V_*		dllopen __PROTO__((const char*, int));
160 extern __MANGLE__ __V_*		dllnext __PROTO__((int));
161 extern __MANGLE__ __V_*		dlllook __PROTO__((__V_*, const char*));
162 extern __MANGLE__ int		dllcheck __PROTO__((__V_*, const char*, unsigned long, unsigned long*));
163 extern __MANGLE__ unsigned long	dllversion __PROTO__((__V_*, const char*));
164 extern __MANGLE__ char*		dllerror __PROTO__((int));
165 
166 extern __MANGLE__ Dllscan_t*	dllsopen __PROTO__((const char*, const char*, const char*));
167 extern __MANGLE__ Dllent_t*	dllsread __PROTO__((Dllscan_t*));
168 extern __MANGLE__ int		dllsclose __PROTO__((Dllscan_t*));
169 
170 #undef __MANGLE__
171 #define __MANGLE__ __LINKAGE__
172 
173 #endif
174