64 #if !defined(OPENSSL_SYS_BEOS)
71 #include <kernel/image.h>
73 static int beos_load(
DSO *dso);
74 static int beos_unload(
DSO *dso);
75 static void *beos_bind_var(
DSO *dso,
const char *symname);
78 static int beos_unbind_var(
DSO *dso,
char *symname,
void *symptr);
80 static int beos_init(
DSO *dso);
81 static int beos_finish(
DSO *dso);
82 static long beos_ctrl(
DSO *dso,
int cmd,
long larg,
void *parg);
84 static char *beos_name_converter(
DSO *dso,
const char *
filename);
87 "OpenSSL 'beos' shared library method",
105 return(&dso_meth_beos);
113 static int beos_load(
DSO *dso)
124 id = load_add_on(filename);
131 if(!
sk_push(dso->meth_data, (
char *)
id))
148 static int beos_unload(
DSO *dso)
156 if(
sk_num(dso->meth_data) < 1)
158 id = (image_id)
sk_pop(dso->meth_data);
164 if(unload_add_on(
id) != B_OK)
169 sk_push(dso->meth_data, (
char *)
id);
175 static void *beos_bind_var(
DSO *dso,
const char *symname)
180 if((dso == NULL) || (symname == NULL))
185 if(
sk_num(dso->meth_data) < 1)
190 id = (image_id)
sk_value(dso->meth_data,
sk_num(dso->meth_data) - 1);
196 if(get_image_symbol(
id, symname, B_SYMBOL_TYPE_DATA, &sym) != B_OK)
210 if((dso == NULL) || (symname == NULL))
215 if(
sk_num(dso->meth_data) < 1)
220 id = (image_id)
sk_value(dso->meth_data,
sk_num(dso->meth_data) - 1);
226 if(get_image_symbol(
id, symname, B_SYMBOL_TYPE_TEXT, &sym) != B_OK)
236 static char *beos_name_converter(
DSO *dso,
const char *filename)
239 int len, rsize, transform;
241 len = strlen(filename);
243 transform = (strstr(filename,
"/") == NULL);
252 if(translated == NULL)
261 sprintf(translated,
"lib%s.so", filename);
263 sprintf(translated,
"%s.so", filename);
266 sprintf(translated,
"%s", filename);