67 static int dynamic_init(
ENGINE *
e);
68 static int dynamic_finish(
ENGINE *
e);
69 static int dynamic_ctrl(
ENGINE *
e,
int cmd,
long i,
void *
p,
void (*
f)(
void));
75 #define DYNAMIC_CMD_SO_PATH ENGINE_CMD_BASE
76 #define DYNAMIC_CMD_NO_VCHECK (ENGINE_CMD_BASE + 1)
77 #define DYNAMIC_CMD_ID (ENGINE_CMD_BASE + 2)
78 #define DYNAMIC_CMD_LIST_ADD (ENGINE_CMD_BASE + 3)
79 #define DYNAMIC_CMD_DIR_LOAD (ENGINE_CMD_BASE + 4)
80 #define DYNAMIC_CMD_DIR_ADD (ENGINE_CMD_BASE + 5)
81 #define DYNAMIC_CMD_LOAD (ENGINE_CMD_BASE + 6)
84 static const char *engine_dynamic_id =
"dynamic";
85 static const char *engine_dynamic_name =
"Dynamic engine loading support";
89 "Specifies the path to the new ENGINE shared library",
93 "Specifies to continue even if version checking fails (boolean)",
97 "Specifies an ENGINE id name for loading",
101 "Whether to add a loaded ENGINE to the internal list (0=no,1=yes,2=mandatory)",
105 "Specifies whether to load from 'DIR_ADD' directories (0=no,1=yes,2=mandatory)",
109 "Adds a directory from which ENGINEs can be loaded",
113 "Load up the ENGINE specified by other settings",
154 static int dynamic_ex_data_idx = -1;
164 static void dynamic_data_ctx_free_func(
void *parent,
void *
ptr,
215 dynamic_ex_data_idx)) == NULL)
235 if(dynamic_ex_data_idx < 0)
241 dynamic_data_ctx_free_func);
249 if(dynamic_ex_data_idx < 0)
252 dynamic_ex_data_idx = new_idx;
262 if((ctx == NULL) && !dynamic_set_data_ctx(e, &ctx))
268 static ENGINE *engine_dynamic(
void)
289 ENGINE *toadd = engine_dynamic();
301 static int dynamic_init(
ENGINE *e)
308 static int dynamic_finish(
ENGINE *e)
315 static int dynamic_ctrl(
ENGINE *e,
int cmd,
long i,
void *p,
void (*
f)(
void))
325 initialised = ((ctx->
dynamic_dso == NULL) ? 0 : 1);
337 if(p && (strlen((
const char *)p) < 1))
351 if(p && (strlen((
const char *)p) < 1))
361 if((i < 0) || (i > 2))
370 return dynamic_load(e, ctx);
372 if((i < 0) || (i > 2))
382 if(!p || (strlen((
const char *)p) < 1))
416 for(loop = 0; loop <
num; loop++)
469 unsigned long vcheck_res = 0;
493 memcpy(&cpy, e,
sizeof(
ENGINE));
523 memcpy(e, &cpy,
sizeof(
ENGINE));