public void Initialize() { if (null == engine) { engine = SafeNativeMethods.ENGINE_by_id(Name); if (engine.IsInvalid) { throw new InvalidOperationException($"Unable to load engine '{Name}'"); } var result = SafeNativeMethods.ENGINE_init(engine); if (0 == result) { SafeNativeMethods.ENGINE_free(engine); throw new InvalidOperationException($"Unable to load engine '{Name}'. ENGINE_init returned {result}"); } } }
internal static extern void ENGINE_free(DynamicEngineHandle engine);
internal static extern int ENGINE_set_default(DynamicEngineHandle engine, EngineDefaults defaults);
internal static extern void ENGINE_register_complete(DynamicEngineHandle engine);
internal static extern int ENGINE_finish(DynamicEngineHandle engine);
internal static extern IntPtr ENGINE_get_id(DynamicEngineHandle engine);
internal static extern int ENGINE_get_flags(DynamicEngineHandle engine);