1160814Ssimon/* dso.h -*- mode:C; c-file-style: "eay" -*- */
268651Skris/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
368651Skris * project 2000.
468651Skris */
568651Skris/* ====================================================================
668651Skris * Copyright (c) 2000 The OpenSSL Project.  All rights reserved.
768651Skris *
868651Skris * Redistribution and use in source and binary forms, with or without
968651Skris * modification, are permitted provided that the following conditions
1068651Skris * are met:
1168651Skris *
1268651Skris * 1. Redistributions of source code must retain the above copyright
1368651Skris *    notice, this list of conditions and the following disclaimer.
1468651Skris *
1568651Skris * 2. Redistributions in binary form must reproduce the above copyright
1668651Skris *    notice, this list of conditions and the following disclaimer in
1768651Skris *    the documentation and/or other materials provided with the
1868651Skris *    distribution.
1968651Skris *
2068651Skris * 3. All advertising materials mentioning features or use of this
2168651Skris *    software must display the following acknowledgment:
2268651Skris *    "This product includes software developed by the OpenSSL Project
2368651Skris *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
2468651Skris *
2568651Skris * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
2668651Skris *    endorse or promote products derived from this software without
2768651Skris *    prior written permission. For written permission, please contact
2868651Skris *    licensing@OpenSSL.org.
2968651Skris *
3068651Skris * 5. Products derived from this software may not be called "OpenSSL"
3168651Skris *    nor may "OpenSSL" appear in their names without prior written
3268651Skris *    permission of the OpenSSL Project.
3368651Skris *
3468651Skris * 6. Redistributions of any form whatsoever must retain the following
3568651Skris *    acknowledgment:
3668651Skris *    "This product includes software developed by the OpenSSL Project
3768651Skris *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
3868651Skris *
3968651Skris * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
4068651Skris * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4168651Skris * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
4268651Skris * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
4368651Skris * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
4468651Skris * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4568651Skris * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
4668651Skris * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
4768651Skris * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
4868651Skris * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
4968651Skris * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
5068651Skris * OF THE POSSIBILITY OF SUCH DAMAGE.
5168651Skris * ====================================================================
5268651Skris *
5368651Skris * This product includes cryptographic software written by Eric Young
5468651Skris * (eay@cryptsoft.com).  This product includes software written by Tim
5568651Skris * Hudson (tjh@cryptsoft.com).
5668651Skris *
5768651Skris */
5868651Skris
5968651Skris#ifndef HEADER_DSO_H
6068651Skris#define HEADER_DSO_H
6168651Skris
6268651Skris#include <openssl/crypto.h>
6368651Skris
6468651Skris#ifdef __cplusplus
6568651Skrisextern "C" {
6668651Skris#endif
6768651Skris
6868651Skris/* These values are used as commands to DSO_ctrl() */
6968651Skris#define DSO_CTRL_GET_FLAGS	1
7068651Skris#define DSO_CTRL_SET_FLAGS	2
7168651Skris#define DSO_CTRL_OR_FLAGS	3
7268651Skris
73109998Smarkm/* By default, DSO_load() will translate the provided filename into a form
74109998Smarkm * typical for the platform (more specifically the DSO_METHOD) using the
75109998Smarkm * dso_name_converter function of the method. Eg. win32 will transform "blah"
76109998Smarkm * into "blah.dll", and dlfcn will transform it into "libblah.so". The
77109998Smarkm * behaviour can be overriden by setting the name_converter callback in the DSO
78109998Smarkm * object (using DSO_set_name_converter()). This callback could even utilise
79109998Smarkm * the DSO_METHOD's converter too if it only wants to override behaviour for
80109998Smarkm * one or two possible DSO methods. However, the following flag can be set in a
81109998Smarkm * DSO to prevent *any* native name-translation at all - eg. if the caller has
82109998Smarkm * prompted the user for a path to a driver library so the filename should be
83109998Smarkm * interpreted as-is. */
84109998Smarkm#define DSO_FLAG_NO_NAME_TRANSLATION		0x01
85109998Smarkm/* An extra flag to give if only the extension should be added as
86109998Smarkm * translation.  This is obviously only of importance on Unix and
87109998Smarkm * other operating systems where the translation also may prefix
88109998Smarkm * the name with something, like 'lib', and ignored everywhere else.
89109998Smarkm * This flag is also ignored if DSO_FLAG_NO_NAME_TRANSLATION is used
90109998Smarkm * at the same time. */
91109998Smarkm#define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY	0x02
9268651Skris
9368651Skris/* The following flag controls the translation of symbol names to upper
9468651Skris * case.  This is currently only being implemented for OpenVMS.
9568651Skris */
96109998Smarkm#define DSO_FLAG_UPCASE_SYMBOL			0x10
9768651Skris
98160814Ssimon/* This flag loads the library with public symbols.
99160814Ssimon * Meaning: The exported symbols of this library are public
100160814Ssimon * to all libraries loaded after this library.
101160814Ssimon * At the moment only implemented in unix.
102160814Ssimon */
103160814Ssimon#define DSO_FLAG_GLOBAL_SYMBOLS			0x20
10468651Skris
105160814Ssimon
10668651Skristypedef void (*DSO_FUNC_TYPE)(void);
10768651Skris
10868651Skristypedef struct dso_st DSO;
10968651Skris
110109998Smarkm/* The function prototype used for method functions (or caller-provided
111109998Smarkm * callbacks) that transform filenames. They are passed a DSO structure pointer
112109998Smarkm * (or NULL if they are to be used independantly of a DSO object) and a
113109998Smarkm * filename to transform. They should either return NULL (if there is an error
114109998Smarkm * condition) or a newly allocated string containing the transformed form that
115109998Smarkm * the caller will need to free with OPENSSL_free() when done. */
116109998Smarkmtypedef char* (*DSO_NAME_CONVERTER_FUNC)(DSO *, const char *);
117160814Ssimon/* The function prototype used for method functions (or caller-provided
118160814Ssimon * callbacks) that merge two file specifications. They are passed a
119160814Ssimon * DSO structure pointer (or NULL if they are to be used independantly of
120160814Ssimon * a DSO object) and two file specifications to merge. They should
121160814Ssimon * either return NULL (if there is an error condition) or a newly allocated
122160814Ssimon * string containing the result of merging that the caller will need
123160814Ssimon * to free with OPENSSL_free() when done.
124160814Ssimon * Here, merging means that bits and pieces are taken from each of the
125160814Ssimon * file specifications and added together in whatever fashion that is
126160814Ssimon * sensible for the DSO method in question.  The only rule that really
127160814Ssimon * applies is that if the two specification contain pieces of the same
128160814Ssimon * type, the copy from the first string takes priority.  One could see
129160814Ssimon * it as the first specification is the one given by the user and the
130160814Ssimon * second being a bunch of defaults to add on if they're missing in the
131160814Ssimon * first. */
132160814Ssimontypedef char* (*DSO_MERGER_FUNC)(DSO *, const char *, const char *);
133109998Smarkm
13468651Skristypedef struct dso_meth_st
13568651Skris	{
13668651Skris	const char *name;
137109998Smarkm	/* Loads a shared library, NB: new DSO_METHODs must ensure that a
138109998Smarkm	 * successful load populates the loaded_filename field, and likewise a
139109998Smarkm	 * successful unload OPENSSL_frees and NULLs it out. */
140109998Smarkm	int (*dso_load)(DSO *dso);
14168651Skris	/* Unloads a shared library */
14268651Skris	int (*dso_unload)(DSO *dso);
14368651Skris	/* Binds a variable */
14468651Skris	void *(*dso_bind_var)(DSO *dso, const char *symname);
14568651Skris	/* Binds a function - assumes a return type of DSO_FUNC_TYPE.
14668651Skris	 * This should be cast to the real function prototype by the
14768651Skris	 * caller. Platforms that don't have compatible representations
14868651Skris	 * for different prototypes (this is possible within ANSI C)
14968651Skris	 * are highly unlikely to have shared libraries at all, let
15068651Skris	 * alone a DSO_METHOD implemented for them. */
15168651Skris	DSO_FUNC_TYPE (*dso_bind_func)(DSO *dso, const char *symname);
15268651Skris
15368651Skris/* I don't think this would actually be used in any circumstances. */
15468651Skris#if 0
15568651Skris	/* Unbinds a variable */
15668651Skris	int (*dso_unbind_var)(DSO *dso, char *symname, void *symptr);
15768651Skris	/* Unbinds a function */
15868651Skris	int (*dso_unbind_func)(DSO *dso, char *symname, DSO_FUNC_TYPE symptr);
15968651Skris#endif
16068651Skris	/* The generic (yuck) "ctrl()" function. NB: Negative return
16168651Skris	 * values (rather than zero) indicate errors. */
16268651Skris	long (*dso_ctrl)(DSO *dso, int cmd, long larg, void *parg);
163109998Smarkm	/* The default DSO_METHOD-specific function for converting filenames to
164109998Smarkm	 * a canonical native form. */
165109998Smarkm	DSO_NAME_CONVERTER_FUNC dso_name_converter;
166160814Ssimon	/* The default DSO_METHOD-specific function for converting filenames to
167160814Ssimon	 * a canonical native form. */
168160814Ssimon	DSO_MERGER_FUNC dso_merger;
16968651Skris
17068651Skris	/* [De]Initialisation handlers. */
17168651Skris	int (*init)(DSO *dso);
17268651Skris	int (*finish)(DSO *dso);
173238405Sjkim
174238405Sjkim	/* Return pathname of the module containing location */
175238405Sjkim	int (*pathbyaddr)(void *addr,char *path,int sz);
176238405Sjkim	/* Perform global symbol lookup, i.e. among *all* modules */
177238405Sjkim	void *(*globallookup)(const char *symname);
17868651Skris	} DSO_METHOD;
17968651Skris
18068651Skris/**********************************************************************/
18168651Skris/* The low-level handle type used to refer to a loaded shared library */
18268651Skris
18368651Skrisstruct dso_st
18468651Skris	{
18568651Skris	DSO_METHOD *meth;
18668651Skris	/* Standard dlopen uses a (void *). Win32 uses a HANDLE. VMS
18768651Skris	 * doesn't use anything but will need to cache the filename
18868651Skris	 * for use in the dso_bind handler. All in all, let each
18968651Skris	 * method control its own destiny. "Handles" and such go in
19068651Skris	 * a STACK. */
191238405Sjkim	STACK_OF(void) *meth_data;
19268651Skris	int references;
19368651Skris	int flags;
19468651Skris	/* For use by applications etc ... use this for your bits'n'pieces,
19568651Skris	 * don't touch meth_data! */
19668651Skris	CRYPTO_EX_DATA ex_data;
197109998Smarkm	/* If this callback function pointer is set to non-NULL, then it will
198160814Ssimon	 * be used in DSO_load() in place of meth->dso_name_converter. NB: This
199109998Smarkm	 * should normally set using DSO_set_name_converter(). */
200109998Smarkm	DSO_NAME_CONVERTER_FUNC name_converter;
201160814Ssimon	/* If this callback function pointer is set to non-NULL, then it will
202160814Ssimon	 * be used in DSO_load() in place of meth->dso_merger. NB: This
203160814Ssimon	 * should normally set using DSO_set_merger(). */
204160814Ssimon	DSO_MERGER_FUNC merger;
205109998Smarkm	/* This is populated with (a copy of) the platform-independant
206109998Smarkm	 * filename used for this DSO. */
207109998Smarkm	char *filename;
208109998Smarkm	/* This is populated with (a copy of) the translated filename by which
209109998Smarkm	 * the DSO was actually loaded. It is NULL iff the DSO is not currently
210109998Smarkm	 * loaded. NB: This is here because the filename translation process
211109998Smarkm	 * may involve a callback being invoked more than once not only to
212109998Smarkm	 * convert to a platform-specific form, but also to try different
213109998Smarkm	 * filenames in the process of trying to perform a load. As such, this
214109998Smarkm	 * variable can be used to indicate (a) whether this DSO structure
215109998Smarkm	 * corresponds to a loaded library or not, and (b) the filename with
216109998Smarkm	 * which it was actually loaded. */
217109998Smarkm	char *loaded_filename;
21868651Skris	};
21968651Skris
22068651Skris
22168651SkrisDSO *	DSO_new(void);
22268651SkrisDSO *	DSO_new_method(DSO_METHOD *method);
22368651Skrisint	DSO_free(DSO *dso);
22468651Skrisint	DSO_flags(DSO *dso);
225109998Smarkmint	DSO_up_ref(DSO *dso);
22668651Skrislong	DSO_ctrl(DSO *dso, int cmd, long larg, void *parg);
22768651Skris
228109998Smarkm/* This function sets the DSO's name_converter callback. If it is non-NULL,
229109998Smarkm * then it will be used instead of the associated DSO_METHOD's function. If
230109998Smarkm * oldcb is non-NULL then it is set to the function pointer value being
231109998Smarkm * replaced. Return value is non-zero for success. */
232109998Smarkmint	DSO_set_name_converter(DSO *dso, DSO_NAME_CONVERTER_FUNC cb,
233109998Smarkm				DSO_NAME_CONVERTER_FUNC *oldcb);
234109998Smarkm/* These functions can be used to get/set the platform-independant filename
235109998Smarkm * used for a DSO. NB: set will fail if the DSO is already loaded. */
236109998Smarkmconst char *DSO_get_filename(DSO *dso);
237109998Smarkmint	DSO_set_filename(DSO *dso, const char *filename);
238109998Smarkm/* This function will invoke the DSO's name_converter callback to translate a
239109998Smarkm * filename, or if the callback isn't set it will instead use the DSO_METHOD's
240109998Smarkm * converter. If "filename" is NULL, the "filename" in the DSO itself will be
241109998Smarkm * used. If the DSO_FLAG_NO_NAME_TRANSLATION flag is set, then the filename is
242109998Smarkm * simply duplicated. NB: This function is usually called from within a
243109998Smarkm * DSO_METHOD during the processing of a DSO_load() call, and is exposed so that
244109998Smarkm * caller-created DSO_METHODs can do the same thing. A non-NULL return value
245109998Smarkm * will need to be OPENSSL_free()'d. */
246109998Smarkmchar	*DSO_convert_filename(DSO *dso, const char *filename);
247160814Ssimon/* This function will invoke the DSO's merger callback to merge two file
248160814Ssimon * specifications, or if the callback isn't set it will instead use the
249160814Ssimon * DSO_METHOD's merger.  A non-NULL return value will need to be
250160814Ssimon * OPENSSL_free()'d. */
251160814Ssimonchar	*DSO_merge(DSO *dso, const char *filespec1, const char *filespec2);
252109998Smarkm/* If the DSO is currently loaded, this returns the filename that it was loaded
253109998Smarkm * under, otherwise it returns NULL. So it is also useful as a test as to
254109998Smarkm * whether the DSO is currently loaded. NB: This will not necessarily return
255109998Smarkm * the same value as DSO_convert_filename(dso, dso->filename), because the
256109998Smarkm * DSO_METHOD's load function may have tried a variety of filenames (with
257109998Smarkm * and/or without the aid of the converters) before settling on the one it
258109998Smarkm * actually loaded. */
259109998Smarkmconst char *DSO_get_loaded_filename(DSO *dso);
260109998Smarkm
261109998Smarkmvoid	DSO_set_default_method(DSO_METHOD *meth);
26268651SkrisDSO_METHOD *DSO_get_default_method(void);
26368651SkrisDSO_METHOD *DSO_get_method(DSO *dso);
26468651SkrisDSO_METHOD *DSO_set_method(DSO *dso, DSO_METHOD *meth);
26568651Skris
26668651Skris/* The all-singing all-dancing load function, you normally pass NULL
26768651Skris * for the first and third parameters. Use DSO_up and DSO_free for
26868651Skris * subsequent reference count handling. Any flags passed in will be set
26968651Skris * in the constructed DSO after its init() function but before the
270109998Smarkm * load operation. If 'dso' is non-NULL, 'flags' is ignored. */
27168651SkrisDSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags);
27268651Skris
27368651Skris/* This function binds to a variable inside a shared library. */
27468651Skrisvoid *DSO_bind_var(DSO *dso, const char *symname);
27568651Skris
27668651Skris/* This function binds to a function inside a shared library. */
27768651SkrisDSO_FUNC_TYPE DSO_bind_func(DSO *dso, const char *symname);
27868651Skris
27968651Skris/* This method is the default, but will beg, borrow, or steal whatever
28068651Skris * method should be the default on any particular platform (including
28168651Skris * DSO_METH_null() if necessary). */
28268651SkrisDSO_METHOD *DSO_METHOD_openssl(void);
28368651Skris
28468651Skris/* This method is defined for all platforms - if a platform has no
28568651Skris * DSO support then this will be the only method! */
28668651SkrisDSO_METHOD *DSO_METHOD_null(void);
28768651Skris
28868651Skris/* If DSO_DLFCN is defined, the standard dlfcn.h-style functions
28968651Skris * (dlopen, dlclose, dlsym, etc) will be used and incorporated into
29068651Skris * this method. If not, this method will return NULL. */
29168651SkrisDSO_METHOD *DSO_METHOD_dlfcn(void);
29268651Skris
29368651Skris/* If DSO_DL is defined, the standard dl.h-style functions (shl_load,
29468651Skris * shl_unload, shl_findsym, etc) will be used and incorporated into
29568651Skris * this method. If not, this method will return NULL. */
29668651SkrisDSO_METHOD *DSO_METHOD_dl(void);
29768651Skris
29868651Skris/* If WIN32 is defined, use DLLs. If not, return NULL. */
29968651SkrisDSO_METHOD *DSO_METHOD_win32(void);
30068651Skris
30168651Skris/* If VMS is defined, use shared images. If not, return NULL. */
30268651SkrisDSO_METHOD *DSO_METHOD_vms(void);
30368651Skris
304238405Sjkim/* This function writes null-terminated pathname of DSO module
305238405Sjkim * containing 'addr' into 'sz' large caller-provided 'path' and
306238405Sjkim * returns the number of characters [including trailing zero]
307238405Sjkim * written to it. If 'sz' is 0 or negative, 'path' is ignored and
308238405Sjkim * required amount of charachers [including trailing zero] to
309238405Sjkim * accomodate pathname is returned. If 'addr' is NULL, then
310238405Sjkim * pathname of cryptolib itself is returned. Negative or zero
311238405Sjkim * return value denotes error.
312238405Sjkim */
313238405Sjkimint DSO_pathbyaddr(void *addr,char *path,int sz);
314238405Sjkim
315238405Sjkim/* This function should be used with caution! It looks up symbols in
316238405Sjkim * *all* loaded modules and if module gets unloaded by somebody else
317238405Sjkim * attempt to dereference the pointer is doomed to have fatal
318238405Sjkim * consequences. Primary usage for this function is to probe *core*
319238405Sjkim * system functionality, e.g. check if getnameinfo(3) is available
320238405Sjkim * at run-time without bothering about OS-specific details such as
321238405Sjkim * libc.so.versioning or where does it actually reside: in libc
322238405Sjkim * itself or libsocket. */
323238405Sjkimvoid *DSO_global_lookup(const char *name);
324238405Sjkim
325238405Sjkim/* If BeOS is defined, use shared images. If not, return NULL. */
326238405SjkimDSO_METHOD *DSO_METHOD_beos(void);
327238405Sjkim
32868651Skris/* BEGIN ERROR CODES */
32968651Skris/* The following lines are auto generated by the script mkerr.pl. Any changes
33068651Skris * made after this point may be overwritten when the script is next run.
33168651Skris */
33289837Skrisvoid ERR_load_DSO_strings(void);
33368651Skris
33468651Skris/* Error codes for the DSO functions. */
33568651Skris
33668651Skris/* Function codes. */
337238405Sjkim#define DSO_F_BEOS_BIND_FUNC				 144
338238405Sjkim#define DSO_F_BEOS_BIND_VAR				 145
339238405Sjkim#define DSO_F_BEOS_LOAD					 146
340238405Sjkim#define DSO_F_BEOS_NAME_CONVERTER			 147
341238405Sjkim#define DSO_F_BEOS_UNLOAD				 148
34268651Skris#define DSO_F_DLFCN_BIND_FUNC				 100
34368651Skris#define DSO_F_DLFCN_BIND_VAR				 101
344109998Smarkm#define DSO_F_DLFCN_LOAD				 102
345160814Ssimon#define DSO_F_DLFCN_MERGER				 130
346109998Smarkm#define DSO_F_DLFCN_NAME_CONVERTER			 123
347109998Smarkm#define DSO_F_DLFCN_UNLOAD				 103
348109998Smarkm#define DSO_F_DL_BIND_FUNC				 104
349109998Smarkm#define DSO_F_DL_BIND_VAR				 105
350109998Smarkm#define DSO_F_DL_LOAD					 106
351160814Ssimon#define DSO_F_DL_MERGER					 131
352109998Smarkm#define DSO_F_DL_NAME_CONVERTER				 124
353109998Smarkm#define DSO_F_DL_UNLOAD					 107
354109998Smarkm#define DSO_F_DSO_BIND_FUNC				 108
355109998Smarkm#define DSO_F_DSO_BIND_VAR				 109
356109998Smarkm#define DSO_F_DSO_CONVERT_FILENAME			 126
357109998Smarkm#define DSO_F_DSO_CTRL					 110
358109998Smarkm#define DSO_F_DSO_FREE					 111
359109998Smarkm#define DSO_F_DSO_GET_FILENAME				 127
360109998Smarkm#define DSO_F_DSO_GET_LOADED_FILENAME			 128
361238405Sjkim#define DSO_F_DSO_GLOBAL_LOOKUP				 139
362109998Smarkm#define DSO_F_DSO_LOAD					 112
363160814Ssimon#define DSO_F_DSO_MERGE					 132
364109998Smarkm#define DSO_F_DSO_NEW_METHOD				 113
365238405Sjkim#define DSO_F_DSO_PATHBYADDR				 140
366109998Smarkm#define DSO_F_DSO_SET_FILENAME				 129
367109998Smarkm#define DSO_F_DSO_SET_NAME_CONVERTER			 122
368109998Smarkm#define DSO_F_DSO_UP_REF				 114
369238405Sjkim#define DSO_F_GLOBAL_LOOKUP_FUNC			 138
370238405Sjkim#define DSO_F_PATHBYADDR				 137
371160814Ssimon#define DSO_F_VMS_BIND_SYM				 115
372109998Smarkm#define DSO_F_VMS_LOAD					 116
373160814Ssimon#define DSO_F_VMS_MERGER				 133
374109998Smarkm#define DSO_F_VMS_UNLOAD				 117
375109998Smarkm#define DSO_F_WIN32_BIND_FUNC				 118
376109998Smarkm#define DSO_F_WIN32_BIND_VAR				 119
377238405Sjkim#define DSO_F_WIN32_GLOBALLOOKUP			 142
378238405Sjkim#define DSO_F_WIN32_GLOBALLOOKUP_FUNC			 143
379160814Ssimon#define DSO_F_WIN32_JOINER				 135
38068651Skris#define DSO_F_WIN32_LOAD				 120
381160814Ssimon#define DSO_F_WIN32_MERGER				 134
382109998Smarkm#define DSO_F_WIN32_NAME_CONVERTER			 125
383238405Sjkim#define DSO_F_WIN32_PATHBYADDR				 141
384160814Ssimon#define DSO_F_WIN32_SPLITTER				 136
38568651Skris#define DSO_F_WIN32_UNLOAD				 121
38668651Skris
38768651Skris/* Reason codes. */
38868651Skris#define DSO_R_CTRL_FAILED				 100
389109998Smarkm#define DSO_R_DSO_ALREADY_LOADED			 110
390160814Ssimon#define DSO_R_EMPTY_FILE_STRUCTURE			 113
391160814Ssimon#define DSO_R_FAILURE					 114
392109998Smarkm#define DSO_R_FILENAME_TOO_BIG				 101
393109998Smarkm#define DSO_R_FINISH_FAILED				 102
394160814Ssimon#define DSO_R_INCORRECT_FILE_SYNTAX			 115
395109998Smarkm#define DSO_R_LOAD_FAILED				 103
396109998Smarkm#define DSO_R_NAME_TRANSLATION_FAILED			 109
397109998Smarkm#define DSO_R_NO_FILENAME				 111
398160814Ssimon#define DSO_R_NO_FILE_SPECIFICATION			 116
399109998Smarkm#define DSO_R_NULL_HANDLE				 104
400109998Smarkm#define DSO_R_SET_FILENAME_FAILED			 112
401109998Smarkm#define DSO_R_STACK_ERROR				 105
402109998Smarkm#define DSO_R_SYM_FAILURE				 106
40368651Skris#define DSO_R_UNLOAD_FAILED				 107
40468651Skris#define DSO_R_UNSUPPORTED				 108
40568651Skris
40668651Skris#ifdef  __cplusplus
40768651Skris}
40868651Skris#endif
40968651Skris#endif
410