PR: 2589
[openssl.git] / crypto / dso / dso.h
index c9d736654ac54de3e712c8664d3febd55bba08f1..839f2e06170882c5dde15a73da1e37ab69e404c0 100644 (file)
@@ -125,7 +125,7 @@ typedef char* (*DSO_NAME_CONVERTER_FUNC)(DSO *, const char *);
  * file specifications and added together in whatever fashion that is
  * sensible for the DSO method in question.  The only rule that really
  * applies is that if the two specification contain pieces of the same
- * type, the copy from the string string takes priority.  One could see
+ * type, the copy from the first string takes priority.  One could see
  * it as the first specification is the one given by the user and the
  * second being a bunch of defaults to add on if they're missing in the
  * first. */
@@ -173,6 +173,8 @@ typedef struct dso_meth_st
 
        /* Return pathname of the module containing location */
        int (*pathbyaddr)(void *addr,char *path,int sz);
+       /* Perform global symbol lookup, i.e. among *all* modules */
+       void *(*globallookup)(const char *symname);
        } DSO_METHOD;
 
 /**********************************************************************/
@@ -186,7 +188,7 @@ struct dso_st
         * for use in the dso_bind handler. All in all, let each
         * method control its own destiny. "Handles" and such go in
         * a STACK. */
-       STACK *meth_data;
+       STACK_OF(void) *meth_data;
        int references;
        int flags;
        /* For use by applications etc ... use this for your bits'n'pieces,
@@ -310,6 +312,19 @@ DSO_METHOD *DSO_METHOD_vms(void);
  */
 int DSO_pathbyaddr(void *addr,char *path,int sz);
 
+/* This function should be used with caution! It looks up symbols in
+ * *all* loaded modules and if module gets unloaded by somebody else
+ * attempt to dereference the pointer is doomed to have fatal
+ * consequences. Primary usage for this function is to probe *core*
+ * system functionality, e.g. check if getnameinfo(3) is available
+ * at run-time without bothering about OS-specific details such as
+ * libc.so.versioning or where does it actually reside: in libc
+ * itself or libsocket. */
+void *DSO_global_lookup(const char *name);
+
+/* If BeOS is defined, use shared images. If not, return NULL. */
+DSO_METHOD *DSO_METHOD_beos(void);
+
 /* BEGIN ERROR CODES */
 /* The following lines are auto generated by the script mkerr.pl. Any changes
  * made after this point may be overwritten when the script is next run.
@@ -319,6 +334,11 @@ void ERR_load_DSO_strings(void);
 /* Error codes for the DSO functions. */
 
 /* Function codes. */
+#define DSO_F_BEOS_BIND_FUNC                            144
+#define DSO_F_BEOS_BIND_VAR                             145
+#define DSO_F_BEOS_LOAD                                         146
+#define DSO_F_BEOS_NAME_CONVERTER                       147
+#define DSO_F_BEOS_UNLOAD                               148
 #define DSO_F_DLFCN_BIND_FUNC                           100
 #define DSO_F_DLFCN_BIND_VAR                            101
 #define DSO_F_DLFCN_LOAD                                102
@@ -338,25 +358,31 @@ void ERR_load_DSO_strings(void);
 #define DSO_F_DSO_FREE                                  111
 #define DSO_F_DSO_GET_FILENAME                          127
 #define DSO_F_DSO_GET_LOADED_FILENAME                   128
+#define DSO_F_DSO_GLOBAL_LOOKUP                                 139
 #define DSO_F_DSO_LOAD                                  112
 #define DSO_F_DSO_MERGE                                         132
 #define DSO_F_DSO_NEW_METHOD                            113
+#define DSO_F_DSO_PATHBYADDR                            140
 #define DSO_F_DSO_SET_FILENAME                          129
 #define DSO_F_DSO_SET_NAME_CONVERTER                    122
 #define DSO_F_DSO_UP_REF                                114
+#define DSO_F_GLOBAL_LOOKUP_FUNC                        138
+#define DSO_F_PATHBYADDR                                137
 #define DSO_F_VMS_BIND_SYM                              115
 #define DSO_F_VMS_LOAD                                  116
 #define DSO_F_VMS_MERGER                                133
 #define DSO_F_VMS_UNLOAD                                117
 #define DSO_F_WIN32_BIND_FUNC                           118
 #define DSO_F_WIN32_BIND_VAR                            119
+#define DSO_F_WIN32_GLOBALLOOKUP                        142
+#define DSO_F_WIN32_GLOBALLOOKUP_FUNC                   143
 #define DSO_F_WIN32_JOINER                              135
 #define DSO_F_WIN32_LOAD                                120
 #define DSO_F_WIN32_MERGER                              134
 #define DSO_F_WIN32_NAME_CONVERTER                      125
+#define DSO_F_WIN32_PATHBYADDR                          141
 #define DSO_F_WIN32_SPLITTER                            136
 #define DSO_F_WIN32_UNLOAD                              121
-#define DSO_F_PATHBYADDR                                137
 
 /* Reason codes. */
 #define DSO_R_CTRL_FAILED                               100