- {
- shl_t ptr;
- if(dso == NULL)
- {
- DSOerr(DSO_F_DL_UNLOAD,ERR_R_PASSED_NULL_PARAMETER);
- return(0);
- }
- if(sk_num(dso->meth_data) < 1)
- return(1);
- /* Is this statement legal? */
- ptr = (shl_t)sk_pop(dso->meth_data);
- if(ptr == NULL)
- {
- DSOerr(DSO_F_DL_UNLOAD,DSO_R_NULL_HANDLE);
- /* Should push the value back onto the stack in
- * case of a retry. */
- sk_push(dso->meth_data, (char *)ptr);
- return(0);
- }
- shl_unload(ptr);
- return(1);
- }
-
-static void *dl_bind_var(DSO *dso, const char *symname)
- {
- shl_t ptr;
- void *sym;
-
- if((dso == NULL) || (symname == NULL))
- {
- DSOerr(DSO_F_DL_BIND_VAR,ERR_R_PASSED_NULL_PARAMETER);
- return(NULL);
- }
- if(sk_num(dso->meth_data) < 1)
- {
- DSOerr(DSO_F_DL_BIND_VAR,DSO_R_STACK_ERROR);
- return(NULL);
- }
- ptr = (shl_t)sk_value(dso->meth_data, sk_num(dso->meth_data) - 1);
- if(ptr == NULL)
- {
- DSOerr(DSO_F_DL_BIND_VAR,DSO_R_NULL_HANDLE);
- return(NULL);
- }
- if (shl_findsym(&ptr, symname, TYPE_UNDEFINED, &sym) < 0)
- {
- DSOerr(DSO_F_DL_BIND_VAR,DSO_R_SYM_FAILURE);
- ERR_add_error_data(4, "symname(", symname, "): ",
- strerror(errno));
- return(NULL);
- }
- return(sym);
- }
+{
+ shl_t ptr;
+ if (dso == NULL) {
+ DSOerr(DSO_F_DL_UNLOAD, ERR_R_PASSED_NULL_PARAMETER);
+ return (0);
+ }
+ if (sk_num(dso->meth_data) < 1)
+ return (1);
+ /* Is this statement legal? */
+ ptr = (shl_t) sk_pop(dso->meth_data);
+ if (ptr == NULL) {
+ DSOerr(DSO_F_DL_UNLOAD, DSO_R_NULL_HANDLE);
+ /*
+ * Should push the value back onto the stack in case of a retry.
+ */
+ sk_push(dso->meth_data, (char *)ptr);
+ return (0);
+ }
+ shl_unload(ptr);
+ return (1);
+}