static int engine_internal_check(void)
	{
	int toret = 1;
	ENGINE *def_engine;
	if(engine_list_flag)
		return 1;
	def_engine = ENGINE_openssl();
	if(!engine_list_add(def_engine))
		toret = 0;
	else
		engine_list_flag = 1;
#if 0
	ENGINE_free(def_engine);
#else
	def_engine->struct_ref--;
	engine_ref_debug(def_engine, 0, -1)
#endif
	return 1;
	}
['static int engine_internal_check(void)\n\t{\n\tint toret = 1;\n\tENGINE *def_engine;\n\tif(engine_list_flag)\n\t\treturn 1;\n\tdef_engine = ENGINE_openssl();\n\tif(!engine_list_add(def_engine))\n\t\ttoret = 0;\n\telse\n\t\tengine_list_flag = 1;\n#if 0\n\tENGINE_free(def_engine);\n#else\n\tdef_engine->struct_ref--;\n\tengine_ref_debug(def_engine, 0, -1)\n#endif\n\treturn 1;\n\t}', 'ENGINE *ENGINE_openssl()\n\t{\n\tENGINE *ret = ENGINE_new();\n\tif(!ret)\n\t\treturn NULL;\n\tif(!ENGINE_set_id(ret, engine_openssl_id) ||\n\t\t\t!ENGINE_set_name(ret, engine_openssl_name) ||\n#ifndef OPENSSL_NO_RSA\n\t\t\t!ENGINE_set_RSA(ret, RSA_get_default_openssl_method()) ||\n#endif\n#ifndef OPENSSL_NO_DSA\n\t\t\t!ENGINE_set_DSA(ret, DSA_get_default_openssl_method()) ||\n#endif\n#ifndef OPENSSL_NO_DH\n\t\t\t!ENGINE_set_DH(ret, DH_get_default_openssl_method()) ||\n#endif\n\t\t\t!ENGINE_set_RAND(ret, RAND_SSLeay()) ||\n\t\t\t!ENGINE_set_BN_mod_exp(ret, BN_mod_exp) ||\n\t\t\t!ENGINE_set_BN_mod_exp_crt(ret, openssl_mod_exp_crt))\n\t\t{\n\t\tENGINE_free(ret);\n\t\treturn NULL;\n\t\t}\n\treturn ret;\n\t}', 'int ENGINE_set_id(ENGINE *e, const char *id)\n\t{\n\tif(id == NULL)\n\t\t{\n\t\tENGINEerr(ENGINE_F_ENGINE_SET_ID,\n\t\t\tERR_R_PASSED_NULL_PARAMETER);\n\t\treturn 0;\n\t\t}\n\te->id = id;\n\treturn 1;\n\t}', 'int ENGINE_set_name(ENGINE *e, const char *name)\n\t{\n\tif(name == NULL)\n\t\t{\n\t\tENGINEerr(ENGINE_F_ENGINE_SET_NAME,\n\t\t\tERR_R_PASSED_NULL_PARAMETER);\n\t\treturn 0;\n\t\t}\n\te->name = name;\n\treturn 1;\n\t}', 'void ERR_put_error(int lib, int func, int reason, const char *file,\n\t     int line)\n\t{\n\tERR_STATE *es;\n#ifdef _OSD_POSIX\n\tif (strncmp(file,"*POSIX(", sizeof("*POSIX(")-1) == 0) {\n\t\tchar *end;\n\t\tfile += sizeof("*POSIX(")-1;\n\t\tend = &file[strlen(file)-1];\n\t\tif (*end == \')\')\n\t\t\t*end = \'\\0\';\n\t\tif ((end = strrchr(file, \'/\')) != NULL)\n\t\t\tfile = &end[1];\n\t}\n#endif\n\tes=ERR_get_state();\n\tes->top=(es->top+1)%ERR_NUM_ERRORS;\n\tif (es->top == es->bottom)\n\t\tes->bottom=(es->bottom+1)%ERR_NUM_ERRORS;\n\tes->err_buffer[es->top]=ERR_PACK(lib,func,reason);\n\tes->err_file[es->top]=file;\n\tes->err_line[es->top]=line;\n\terr_clear_data(es,es->top);\n\t}', 'int ENGINE_free(ENGINE *e)\n\t{\n\tint i;\n\tif(e == NULL)\n\t\t{\n\t\tENGINEerr(ENGINE_F_ENGINE_FREE,\n\t\t\tERR_R_PASSED_NULL_PARAMETER);\n\t\treturn 0;\n\t\t}\n\ti = CRYPTO_add(&e->struct_ref,-1,CRYPTO_LOCK_ENGINE);\n\tengine_ref_debug(e, 0, -1)\n\tif (i > 0) return 1;\n#ifdef REF_CHECK\n\tif (i < 0)\n\t\t{\n\t\tfprintf(stderr,"ENGINE_free, bad structural reference count\\n");\n\t\tabort();\n\t\t}\n#endif\n\tCRYPTO_free_ex_data(engine_ex_data_stack, e, &e->ex_data);\n\tOPENSSL_free(e);\n\treturn 1;\n\t}', 'int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,\n\t     int line)\n\t{\n\tint ret = 0;\n\tif (add_lock_callback != NULL)\n\t\t{\n#ifdef LOCK_DEBUG\n\t\tint before= *pointer;\n#endif\n\t\tret=add_lock_callback(pointer,amount,type,file,line);\n#ifdef LOCK_DEBUG\n\t\tfprintf(stderr,"ladd:%08lx:%2d+%2d->%2d %-18s %s:%d\\n",\n\t\t\tCRYPTO_thread_id(),\n\t\t\tbefore,amount,ret,\n\t\t\tCRYPTO_get_lock_name(type),\n\t\t\tfile,line);\n#endif\n\t\t*pointer=ret;\n\t\t}\n\telse\n\t\t{\n\t\tCRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,file,line);\n\t\tret= *pointer+amount;\n#ifdef LOCK_DEBUG\n\t\tfprintf(stderr,"ladd:%08lx:%2d+%2d->%2d %-18s %s:%d\\n",\n\t\t\tCRYPTO_thread_id(),\n\t\t\t*pointer,amount,ret,\n\t\t\tCRYPTO_get_lock_name(type),\n\t\t\tfile,line);\n#endif\n\t\t*pointer=ret;\n\t\tCRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,file,line);\n\t\t}\n\treturn(ret);\n\t}']