dso.h revision 256281
1151497Sru/* dso.h -*- mode:C; c-file-style: "eay" -*- */
2151497Sru/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3151497Sru * project 2000.
4151497Sru */
5151497Sru/* ====================================================================
6151497Sru * Copyright (c) 2000 The OpenSSL Project.  All rights reserved.
7151497Sru *
8151497Sru * Redistribution and use in source and binary forms, with or without
9151497Sru * modification, are permitted provided that the following conditions
10151497Sru * are met:
11151497Sru *
12151497Sru * 1. Redistributions of source code must retain the above copyright
13151497Sru *    notice, this list of conditions and the following disclaimer.
14151497Sru *
15151497Sru * 2. Redistributions in binary form must reproduce the above copyright
16151497Sru *    notice, this list of conditions and the following disclaimer in
17151497Sru *    the documentation and/or other materials provided with the
18151497Sru *    distribution.
19151497Sru *
20151497Sru * 3. All advertising materials mentioning features or use of this
21151497Sru *    software must display the following acknowledgment:
22151497Sru *    "This product includes software developed by the OpenSSL Project
23151497Sru *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24151497Sru *
25151497Sru * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26151497Sru *    endorse or promote products derived from this software without
27151497Sru *    prior written permission. For written permission, please contact
28151497Sru *    licensing@OpenSSL.org.
29151497Sru *
30151497Sru * 5. Products derived from this software may not be called "OpenSSL"
31151497Sru *    nor may "OpenSSL" appear in their names without prior written
32151497Sru *    permission of the OpenSSL Project.
33151497Sru *
34151497Sru * 6. Redistributions of any form whatsoever must retain the following
35151497Sru *    acknowledgment:
36151497Sru *    "This product includes software developed by the OpenSSL Project
37151497Sru *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38151497Sru *
39151497Sru * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40151497Sru * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41151497Sru * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42151497Sru * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
43151497Sru * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44151497Sru * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45151497Sru * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46151497Sru * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47151497Sru * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48151497Sru * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49151497Sru * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50151497Sru * OF THE POSSIBILITY OF SUCH DAMAGE.
51151497Sru * ====================================================================
52151497Sru *
53151497Sru * This product includes cryptographic software written by Eric Young
54151497Sru * (eay@cryptsoft.com).  This product includes software written by Tim
55151497Sru * Hudson (tjh@cryptsoft.com).
56151497Sru *
57151497Sru */
58151497Sru
59151497Sru#ifndef HEADER_DSO_H
60151497Sru#define HEADER_DSO_H
61151497Sru
62151497Sru#include <openssl/crypto.h>
63151497Sru
64151497Sru#ifdef __cplusplus
65151497Sruextern "C" {
66151497Sru#endif
67151497Sru
68151497Sru/* These values are used as commands to DSO_ctrl() */
69151497Sru#define DSO_CTRL_GET_FLAGS	1
70151497Sru#define DSO_CTRL_SET_FLAGS	2
71151497Sru#define DSO_CTRL_OR_FLAGS	3
72151497Sru
73151497Sru/* By default, DSO_load() will translate the provided filename into a form
74151497Sru * typical for the platform (more specifically the DSO_METHOD) using the
75151497Sru * dso_name_converter function of the method. Eg. win32 will transform "blah"
76151497Sru * into "blah.dll", and dlfcn will transform it into "libblah.so". The
77151497Sru * behaviour can be overriden by setting the name_converter callback in the DSO
78151497Sru * object (using DSO_set_name_converter()). This callback could even utilise
79151497Sru * the DSO_METHOD's converter too if it only wants to override behaviour for
80151497Sru * one or two possible DSO methods. However, the following flag can be set in a
81151497Sru * DSO to prevent *any* native name-translation at all - eg. if the caller has
82151497Sru * prompted the user for a path to a driver library so the filename should be
83151497Sru * interpreted as-is. */
84151497Sru#define DSO_FLAG_NO_NAME_TRANSLATION		0x01
85151497Sru/* An extra flag to give if only the extension should be added as
86151497Sru * translation.  This is obviously only of importance on Unix and
87151497Sru * other operating systems where the translation also may prefix
88151497Sru * the name with something, like 'lib', and ignored everywhere else.
89151497Sru * This flag is also ignored if DSO_FLAG_NO_NAME_TRANSLATION is used
90151497Sru * at the same time. */
91151497Sru#define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY	0x02
92151497Sru
93151497Sru/* The following flag controls the translation of symbol names to upper
94151497Sru * case.  This is currently only being implemented for OpenVMS.
95151497Sru */
96151497Sru#define DSO_FLAG_UPCASE_SYMBOL			0x10
97151497Sru
98151497Sru/* This flag loads the library with public symbols.
99151497Sru * Meaning: The exported symbols of this library are public
100151497Sru * to all libraries loaded after this library.
101151497Sru * At the moment only implemented in unix.
102151497Sru */
103151497Sru#define DSO_FLAG_GLOBAL_SYMBOLS			0x20
104151497Sru
105151497Sru
106151497Srutypedef void (*DSO_FUNC_TYPE)(void);
107151497Sru
108151497Srutypedef struct dso_st DSO;
109151497Sru
110151497Sru/* The function prototype used for method functions (or caller-provided
111151497Sru * callbacks) that transform filenames. They are passed a DSO structure pointer
112151497Sru * (or NULL if they are to be used independantly of a DSO object) and a
113151497Sru * filename to transform. They should either return NULL (if there is an error
114151497Sru * condition) or a newly allocated string containing the transformed form that
115151497Sru * the caller will need to free with OPENSSL_free() when done. */
116151497Srutypedef char* (*DSO_NAME_CONVERTER_FUNC)(DSO *, const char *);
117151497Sru/* The function prototype used for method functions (or caller-provided
118151497Sru * callbacks) that merge two file specifications. They are passed a
119151497Sru * DSO structure pointer (or NULL if they are to be used independantly of
120151497Sru * a DSO object) and two file specifications to merge. They should
121151497Sru * either return NULL (if there is an error condition) or a newly allocated
122151497Sru * string containing the result of merging that the caller will need
123151497Sru * to free with OPENSSL_free() when done.
124151497Sru * Here, merging means that bits and pieces are taken from each of the
125151497Sru * file specifications and added together in whatever fashion that is
126151497Sru * sensible for the DSO method in question.  The only rule that really
127151497Sru * applies is that if the two specification contain pieces of the same
128151497Sru * type, the copy from the first string takes priority.  One could see
129151497Sru * it as the first specification is the one given by the user and the
130151497Sru * second being a bunch of defaults to add on if they're missing in the
131151497Sru * first. */
132151497Srutypedef char* (*DSO_MERGER_FUNC)(DSO *, const char *, const char *);
133151497Sru
134151497Srutypedef struct dso_meth_st
135151497Sru	{
136151497Sru	const char *name;
137151497Sru	/* Loads a shared library, NB: new DSO_METHODs must ensure that a
138151497Sru	 * successful load populates the loaded_filename field, and likewise a
139151497Sru	 * successful unload OPENSSL_frees and NULLs it out. */
140151497Sru	int (*dso_load)(DSO *dso);
141151497Sru	/* Unloads a shared library */
142151497Sru	int (*dso_unload)(DSO *dso);
143151497Sru	/* Binds a variable */
144151497Sru	void *(*dso_bind_var)(DSO *dso, const char *symname);
145151497Sru	/* Binds a function - assumes a return type of DSO_FUNC_TYPE.
146151497Sru	 * This should be cast to the real function prototype by the
147151497Sru	 * caller. Platforms that don't have compatible representations
148151497Sru	 * for different prototypes (this is possible within ANSI C)
149151497Sru	 * are highly unlikely to have shared libraries at all, let
150151497Sru	 * alone a DSO_METHOD implemented for them. */
151151497Sru	DSO_FUNC_TYPE (*dso_bind_func)(DSO *dso, const char *symname);
152151497Sru
153151497Sru/* I don't think this would actually be used in any circumstances. */
154151497Sru#if 0
155151497Sru	/* Unbinds a variable */
156151497Sru	int (*dso_unbind_var)(DSO *dso, char *symname, void *symptr);
157151497Sru	/* Unbinds a function */
158151497Sru	int (*dso_unbind_func)(DSO *dso, char *symname, DSO_FUNC_TYPE symptr);
159151497Sru#endif
160151497Sru	/* The generic (yuck) "ctrl()" function. NB: Negative return
161151497Sru	 * values (rather than zero) indicate errors. */
162151497Sru	long (*dso_ctrl)(DSO *dso, int cmd, long larg, void *parg);
163151497Sru	/* The default DSO_METHOD-specific function for converting filenames to
164151497Sru	 * a canonical native form. */
165151497Sru	DSO_NAME_CONVERTER_FUNC dso_name_converter;
166151497Sru	/* The default DSO_METHOD-specific function for converting filenames to
167151497Sru	 * a canonical native form. */
168151497Sru	DSO_MERGER_FUNC dso_merger;
169151497Sru
170151497Sru	/* [De]Initialisation handlers. */
171151497Sru	int (*init)(DSO *dso);
172151497Sru	int (*finish)(DSO *dso);
173151497Sru
174151497Sru	/* Return pathname of the module containing location */
175151497Sru	int (*pathbyaddr)(void *addr,char *path,int sz);
176151497Sru	/* Perform global symbol lookup, i.e. among *all* modules */
177151497Sru	void *(*globallookup)(const char *symname);
178151497Sru	} DSO_METHOD;
179151497Sru
180151497Sru/**********************************************************************/
181151497Sru/* The low-level handle type used to refer to a loaded shared library */
182151497Sru
183151497Srustruct dso_st
184151497Sru	{
185151497Sru	DSO_METHOD *meth;
186151497Sru	/* Standard dlopen uses a (void *). Win32 uses a HANDLE. VMS
187151497Sru	 * doesn't use anything but will need to cache the filename
188151497Sru	 * for use in the dso_bind handler. All in all, let each
189151497Sru	 * method control its own destiny. "Handles" and such go in
190151497Sru	 * a STACK. */
191151497Sru	STACK_OF(void) *meth_data;
192151497Sru	int references;
193151497Sru	int flags;
194151497Sru	/* For use by applications etc ... use this for your bits'n'pieces,
195151497Sru	 * don't touch meth_data! */
196151497Sru	CRYPTO_EX_DATA ex_data;
197151497Sru	/* If this callback function pointer is set to non-NULL, then it will
198151497Sru	 * be used in DSO_load() in place of meth->dso_name_converter. NB: This
199151497Sru	 * should normally set using DSO_set_name_converter(). */
200151497Sru	DSO_NAME_CONVERTER_FUNC name_converter;
201151497Sru	/* If this callback function pointer is set to non-NULL, then it will
202151497Sru	 * be used in DSO_load() in place of meth->dso_merger. NB: This
203151497Sru	 * should normally set using DSO_set_merger(). */
204151497Sru	DSO_MERGER_FUNC merger;
205151497Sru	/* This is populated with (a copy of) the platform-independant
206151497Sru	 * filename used for this DSO. */
207151497Sru	char *filename;
208151497Sru	/* This is populated with (a copy of) the translated filename by which
209151497Sru	 * the DSO was actually loaded. It is NULL iff the DSO is not currently
210151497Sru	 * loaded. NB: This is here because the filename translation process
211151497Sru	 * may involve a callback being invoked more than once not only to
212151497Sru	 * convert to a platform-specific form, but also to try different
213151497Sru	 * filenames in the process of trying to perform a load. As such, this
214151497Sru	 * variable can be used to indicate (a) whether this DSO structure
215151497Sru	 * corresponds to a loaded library or not, and (b) the filename with
216151497Sru	 * which it was actually loaded. */
217151497Sru	char *loaded_filename;
218151497Sru	};
219151497Sru
220151497Sru
221151497SruDSO *	DSO_new(void);
222151497SruDSO *	DSO_new_method(DSO_METHOD *method);
223151497Sruint	DSO_free(DSO *dso);
224151497Sruint	DSO_flags(DSO *dso);
225151497Sruint	DSO_up_ref(DSO *dso);
226151497Srulong	DSO_ctrl(DSO *dso, int cmd, long larg, void *parg);
227151497Sru
228151497Sru/* This function sets the DSO's name_converter callback. If it is non-NULL,
229151497Sru * then it will be used instead of the associated DSO_METHOD's function. If
230151497Sru * oldcb is non-NULL then it is set to the function pointer value being
231151497Sru * replaced. Return value is non-zero for success. */
232151497Sruint	DSO_set_name_converter(DSO *dso, DSO_NAME_CONVERTER_FUNC cb,
233151497Sru				DSO_NAME_CONVERTER_FUNC *oldcb);
234151497Sru/* These functions can be used to get/set the platform-independant filename
235151497Sru * used for a DSO. NB: set will fail if the DSO is already loaded. */
236151497Sruconst char *DSO_get_filename(DSO *dso);
237151497Sruint	DSO_set_filename(DSO *dso, const char *filename);
238151497Sru/* This function will invoke the DSO's name_converter callback to translate a
239151497Sru * filename, or if the callback isn't set it will instead use the DSO_METHOD's
240151497Sru * converter. If "filename" is NULL, the "filename" in the DSO itself will be
241151497Sru * used. If the DSO_FLAG_NO_NAME_TRANSLATION flag is set, then the filename is
242151497Sru * simply duplicated. NB: This function is usually called from within a
243151497Sru * DSO_METHOD during the processing of a DSO_load() call, and is exposed so that
244151497Sru * caller-created DSO_METHODs can do the same thing. A non-NULL return value
245151497Sru * will need to be OPENSSL_free()'d. */
246151497Sruchar	*DSO_convert_filename(DSO *dso, const char *filename);
247151497Sru/* This function will invoke the DSO's merger callback to merge two file
248151497Sru * specifications, or if the callback isn't set it will instead use the
249151497Sru * DSO_METHOD's merger.  A non-NULL return value will need to be
250151497Sru * OPENSSL_free()'d. */
251151497Sruchar	*DSO_merge(DSO *dso, const char *filespec1, const char *filespec2);
252151497Sru/* If the DSO is currently loaded, this returns the filename that it was loaded
253151497Sru * under, otherwise it returns NULL. So it is also useful as a test as to
254151497Sru * whether the DSO is currently loaded. NB: This will not necessarily return
255151497Sru * the same value as DSO_convert_filename(dso, dso->filename), because the
256151497Sru * DSO_METHOD's load function may have tried a variety of filenames (with
257151497Sru * and/or without the aid of the converters) before settling on the one it
258151497Sru * actually loaded. */
259151497Sruconst char *DSO_get_loaded_filename(DSO *dso);
260151497Sru
261151497Sruvoid	DSO_set_default_method(DSO_METHOD *meth);
262151497SruDSO_METHOD *DSO_get_default_method(void);
263151497SruDSO_METHOD *DSO_get_method(DSO *dso);
264151497SruDSO_METHOD *DSO_set_method(DSO *dso, DSO_METHOD *meth);
265151497Sru
266151497Sru/* The all-singing all-dancing load function, you normally pass NULL
267151497Sru * for the first and third parameters. Use DSO_up and DSO_free for
268151497Sru * subsequent reference count handling. Any flags passed in will be set
269151497Sru * in the constructed DSO after its init() function but before the
270151497Sru * load operation. If 'dso' is non-NULL, 'flags' is ignored. */
271151497SruDSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags);
272151497Sru
273151497Sru/* This function binds to a variable inside a shared library. */
274151497Sruvoid *DSO_bind_var(DSO *dso, const char *symname);
275151497Sru
276151497Sru/* This function binds to a function inside a shared library. */
277151497SruDSO_FUNC_TYPE DSO_bind_func(DSO *dso, const char *symname);
278151497Sru
279151497Sru/* This method is the default, but will beg, borrow, or steal whatever
280151497Sru * method should be the default on any particular platform (including
281151497Sru * DSO_METH_null() if necessary). */
282151497SruDSO_METHOD *DSO_METHOD_openssl(void);
283151497Sru
284151497Sru/* This method is defined for all platforms - if a platform has no
285151497Sru * DSO support then this will be the only method! */
286151497SruDSO_METHOD *DSO_METHOD_null(void);
287151497Sru
288151497Sru/* If DSO_DLFCN is defined, the standard dlfcn.h-style functions
289151497Sru * (dlopen, dlclose, dlsym, etc) will be used and incorporated into
290151497Sru * this method. If not, this method will return NULL. */
291151497SruDSO_METHOD *DSO_METHOD_dlfcn(void);
292151497Sru
293151497Sru/* If DSO_DL is defined, the standard dl.h-style functions (shl_load,
294151497Sru * shl_unload, shl_findsym, etc) will be used and incorporated into
295151497Sru * this method. If not, this method will return NULL. */
296151497SruDSO_METHOD *DSO_METHOD_dl(void);
297151497Sru
298151497Sru/* If WIN32 is defined, use DLLs. If not, return NULL. */
299151497SruDSO_METHOD *DSO_METHOD_win32(void);
300151497Sru
301151497Sru/* If VMS is defined, use shared images. If not, return NULL. */
302151497SruDSO_METHOD *DSO_METHOD_vms(void);
303151497Sru
304151497Sru/* This function writes null-terminated pathname of DSO module
305151497Sru * containing 'addr' into 'sz' large caller-provided 'path' and
306151497Sru * returns the number of characters [including trailing zero]
307151497Sru * written to it. If 'sz' is 0 or negative, 'path' is ignored and
308151497Sru * required amount of charachers [including trailing zero] to
309151497Sru * accomodate pathname is returned. If 'addr' is NULL, then
310151497Sru * pathname of cryptolib itself is returned. Negative or zero
311151497Sru * return value denotes error.
312151497Sru */
313151497Sruint DSO_pathbyaddr(void *addr,char *path,int sz);
314151497Sru
315151497Sru/* This function should be used with caution! It looks up symbols in
316151497Sru * *all* loaded modules and if module gets unloaded by somebody else
317151497Sru * attempt to dereference the pointer is doomed to have fatal
318151497Sru * consequences. Primary usage for this function is to probe *core*
319151497Sru * system functionality, e.g. check if getnameinfo(3) is available
320151497Sru * at run-time without bothering about OS-specific details such as
321151497Sru * libc.so.versioning or where does it actually reside: in libc
322151497Sru * itself or libsocket. */
323151497Sruvoid *DSO_global_lookup(const char *name);
324151497Sru
325151497Sru/* If BeOS is defined, use shared images. If not, return NULL. */
326151497SruDSO_METHOD *DSO_METHOD_beos(void);
327151497Sru
328151497Sru/* BEGIN ERROR CODES */
329151497Sru/* The following lines are auto generated by the script mkerr.pl. Any changes
330151497Sru * made after this point may be overwritten when the script is next run.
331151497Sru */
332151497Sruvoid ERR_load_DSO_strings(void);
333151497Sru
334151497Sru/* Error codes for the DSO functions. */
335151497Sru
336151497Sru/* Function codes. */
337151497Sru#define DSO_F_BEOS_BIND_FUNC				 144
338151497Sru#define DSO_F_BEOS_BIND_VAR				 145
339151497Sru#define DSO_F_BEOS_LOAD					 146
340151497Sru#define DSO_F_BEOS_NAME_CONVERTER			 147
341151497Sru#define DSO_F_BEOS_UNLOAD				 148
342151497Sru#define DSO_F_DLFCN_BIND_FUNC				 100
343151497Sru#define DSO_F_DLFCN_BIND_VAR				 101
344151497Sru#define DSO_F_DLFCN_LOAD				 102
345151497Sru#define DSO_F_DLFCN_MERGER				 130
346151497Sru#define DSO_F_DLFCN_NAME_CONVERTER			 123
347151497Sru#define DSO_F_DLFCN_UNLOAD				 103
348151497Sru#define DSO_F_DL_BIND_FUNC				 104
349151497Sru#define DSO_F_DL_BIND_VAR				 105
350151497Sru#define DSO_F_DL_LOAD					 106
351151497Sru#define DSO_F_DL_MERGER					 131
352151497Sru#define DSO_F_DL_NAME_CONVERTER				 124
353151497Sru#define DSO_F_DL_UNLOAD					 107
354151497Sru#define DSO_F_DSO_BIND_FUNC				 108
355151497Sru#define DSO_F_DSO_BIND_VAR				 109
356151497Sru#define DSO_F_DSO_CONVERT_FILENAME			 126
357151497Sru#define DSO_F_DSO_CTRL					 110
358151497Sru#define DSO_F_DSO_FREE					 111
359151497Sru#define DSO_F_DSO_GET_FILENAME				 127
360151497Sru#define DSO_F_DSO_GET_LOADED_FILENAME			 128
361151497Sru#define DSO_F_DSO_GLOBAL_LOOKUP				 139
362151497Sru#define DSO_F_DSO_LOAD					 112
363151497Sru#define DSO_F_DSO_MERGE					 132
364151497Sru#define DSO_F_DSO_NEW_METHOD				 113
365151497Sru#define DSO_F_DSO_PATHBYADDR				 140
366151497Sru#define DSO_F_DSO_SET_FILENAME				 129
367151497Sru#define DSO_F_DSO_SET_NAME_CONVERTER			 122
368151497Sru#define DSO_F_DSO_UP_REF				 114
369151497Sru#define DSO_F_GLOBAL_LOOKUP_FUNC			 138
370151497Sru#define DSO_F_PATHBYADDR				 137
371151497Sru#define DSO_F_VMS_BIND_SYM				 115
372151497Sru#define DSO_F_VMS_LOAD					 116
373151497Sru#define DSO_F_VMS_MERGER				 133
374151497Sru#define DSO_F_VMS_UNLOAD				 117
375151497Sru#define DSO_F_WIN32_BIND_FUNC				 118
376151497Sru#define DSO_F_WIN32_BIND_VAR				 119
377151497Sru#define DSO_F_WIN32_GLOBALLOOKUP			 142
378151497Sru#define DSO_F_WIN32_GLOBALLOOKUP_FUNC			 143
379151497Sru#define DSO_F_WIN32_JOINER				 135
380151497Sru#define DSO_F_WIN32_LOAD				 120
381151497Sru#define DSO_F_WIN32_MERGER				 134
382151497Sru#define DSO_F_WIN32_NAME_CONVERTER			 125
383151497Sru#define DSO_F_WIN32_PATHBYADDR				 141
384151497Sru#define DSO_F_WIN32_SPLITTER				 136
385151497Sru#define DSO_F_WIN32_UNLOAD				 121
386151497Sru
387151497Sru/* Reason codes. */
388151497Sru#define DSO_R_CTRL_FAILED				 100
389151497Sru#define DSO_R_DSO_ALREADY_LOADED			 110
390151497Sru#define DSO_R_EMPTY_FILE_STRUCTURE			 113
391151497Sru#define DSO_R_FAILURE					 114
392151497Sru#define DSO_R_FILENAME_TOO_BIG				 101
393151497Sru#define DSO_R_FINISH_FAILED				 102
394151497Sru#define DSO_R_INCORRECT_FILE_SYNTAX			 115
395151497Sru#define DSO_R_LOAD_FAILED				 103
396151497Sru#define DSO_R_NAME_TRANSLATION_FAILED			 109
397151497Sru#define DSO_R_NO_FILENAME				 111
398151497Sru#define DSO_R_NO_FILE_SPECIFICATION			 116
399151497Sru#define DSO_R_NULL_HANDLE				 104
400151497Sru#define DSO_R_SET_FILENAME_FAILED			 112
401151497Sru#define DSO_R_STACK_ERROR				 105
402151497Sru#define DSO_R_SYM_FAILURE				 106
403151497Sru#define DSO_R_UNLOAD_FAILED				 107
404151497Sru#define DSO_R_UNSUPPORTED				 108
405151497Sru
406151497Sru#ifdef  __cplusplus
407151497Sru}
408151497Sru#endif
409151497Sru#endif
410151497Sru