rem: dbf.replace = (db_update_f)find_mod_export(tmp, "db_replace", 2, 0);
add: dbf.replace = (db_replace_f)find_mod_export(tmp, "db_replace", 2, 0);
context: int bind_dbmod(char* mod, db_func_t* mydbf){	char* tmp, *p;	int len;	db_func_t dbf;	if (!mod) {		LOG(L_CRIT, "BUG: bind_dbmod(): null database module name\n");		return -1;	}	if (mydbf==0) {		LOG(L_CRIT, "BUG: bind_dbmod(): null dbf parameter\n");		return -1;	}	/* for safety we initialize mydbf with 0 (this will cause	 *  a segfault immediately if someone tries to call a function	 *  from it without checking the return code from bind_dbmod -- andrei */	memset((void*)mydbf, 0, sizeof(db_func_t));	p = strchr(mod, ':');	if (p) {		len = p - mod;		tmp = (char*)pkg_malloc(len + 1);		if (!tmp) {			LOG(L_ERR, "ERROR: bind_dbmod(): No memory left\n");			return -1;		}		memcpy(tmp, mod, len);		tmp[len] = '\0';	} else {		tmp = mod;	}	dbf.cap = 0;	     /* All modules must export db_use_table */	dbf.use_table = (db_use_table_f)find_mod_export(tmp, "db_use_table", 2, 0);	if (dbf.use_table == 0) {		LOG(L_ERR, "bind_dbmod: Module %s does not export db_use_table function\n", tmp);		goto err;	}	     /* All modules must export db_init */	dbf.init = (db_init_f)find_mod_export(tmp, "db_init", 1, 0);	if (dbf.init == 0) {		LOG(L_ERR, "bind_dbmod: Module %s does not export db_init function\n", tmp);		goto err;	}	     /* All modules must export db_close */	dbf.close = (db_close_f)find_mod_export(tmp, "db_close", 2, 0);	if (dbf.close == 0) {		LOG(L_ERR, "bind_dbmod: Module %s does not export db_close function\n", tmp);		goto err;	}	dbf.query = (db_query_f)find_mod_export(tmp, "db_query", 2, 0);	if (dbf.query) {		dbf.cap |= DB_CAP_QUERY;	}	dbf.raw_query = (db_raw_query_f)find_mod_export(tmp, "db_raw_query", 2, 0);	if (dbf.raw_query) {		dbf.cap |= DB_CAP_RAW_QUERY;	}	     /* Free result must be exported if DB_CAP_QUERY 	      * or DB_CAP_RAW_QUERY is set	      */	dbf.free_result = (db_free_result_f)find_mod_export(tmp, "db_free_result", 2, 0);	if ((dbf.cap & (DB_CAP_QUERY | DB_CAP_RAW_QUERY))	    && (dbf.free_result == 0)) {		LOG(L_ERR, "bind_dbmod: Module %s supports quries but does not export free_result function\n", tmp);		goto err;	}	dbf.insert = (db_insert_f)find_mod_export(tmp, "db_insert", 2, 0);	if (dbf.insert) {		dbf.cap |= DB_CAP_INSERT;	}	dbf.delete = (db_delete_f)find_mod_export(tmp, "db_delete", 2, 0);	if (dbf.delete) {		dbf.cap |= DB_CAP_DELETE;	}	dbf.update = (db_update_f)find_mod_export(tmp, "db_update", 2, 0);	if (dbf.update) {		dbf.cap |= DB_CAP_UPDATE;	}	dbf.replace = (db_update_f)find_mod_export(tmp, "db_replace", 2, 0);	if (dbf.replace) {		dbf.cap |= DB_CAP_REPLACE;	}	*mydbf=dbf; /* copy */	return 0; err:	if (tmp != mod) pkg_free(tmp);	return -1;}