converted cb_file_props from using engine-based ctx to file-based ctx

remotes/push_mirror/klin/altstr-yara
Kevin Lin 11 years ago
parent 3a925de01f
commit 20a3b53b6c
  1. 2
      libclamav/clamav.h
  2. 5
      libclamav/others.c
  3. 2
      libclamav/others.h
  4. 2
      libclamav/scanners.c

@ -398,7 +398,7 @@ extern void cl_engine_set_clcb_meta(struct cl_engine *engine, clcb_meta callback
/* File properties callback */
typedef int (*clcb_file_props)(const char *j_propstr, int rc, void *cbdata);
extern void cl_engine_set_clcb_file_props(struct cl_engine *engine, clcb_file_props callback, void * cbdata);
extern void cl_engine_set_clcb_file_props(struct cl_engine *engine, clcb_file_props callback);
/* Statistics/intelligence gathering callbacks */
extern void cl_engine_set_stats_set_cbdata(struct cl_engine *engine, void *cbdata);

@ -747,7 +747,6 @@ struct cl_settings *cl_engine_settings_copy(const struct cl_engine *engine)
settings->cb_hash = engine->cb_hash;
settings->cb_meta = engine->cb_meta;
settings->cb_file_props = engine->cb_file_props;
settings->cb_file_props_data = engine->cb_file_props_data;
settings->engine_options = engine->engine_options;
settings->cb_stats_add_sample = engine->cb_stats_add_sample;
@ -816,7 +815,6 @@ int cl_engine_settings_apply(struct cl_engine *engine, const struct cl_settings
engine->cb_hash = settings->cb_hash;
engine->cb_meta = settings->cb_meta;
engine->cb_file_props = settings->cb_file_props;
engine->cb_file_props_data = settings->cb_file_props_data;
engine->cb_stats_add_sample = settings->cb_stats_add_sample;
engine->cb_stats_remove_sample = settings->cb_stats_remove_sample;
@ -1332,8 +1330,7 @@ void cl_engine_set_clcb_meta(struct cl_engine *engine, clcb_meta callback)
engine->cb_meta = callback;
}
void cl_engine_set_clcb_file_props(struct cl_engine *engine, clcb_file_props callback, void * cbdata)
void cl_engine_set_clcb_file_props(struct cl_engine *engine, clcb_file_props callback)
{
engine->cb_file_props = callback;
engine->cb_file_props_data = cbdata;
}

@ -315,7 +315,6 @@ struct cl_engine {
clcb_hash cb_hash;
clcb_meta cb_meta;
clcb_file_props cb_file_props;
void *cb_file_props_data;
/* Used for bytecode */
struct cli_all_bc bcs;
@ -386,7 +385,6 @@ struct cl_settings {
clcb_hash cb_hash;
clcb_meta cb_meta;
clcb_file_props cb_file_props;
void *cb_file_props_data;
/* Engine max settings */
uint64_t maxembeddedpe; /* max size to scan MSEXE for PE */

@ -3523,7 +3523,7 @@ static int scan_common(int desc, cl_fmap_t *map, const char **virname, unsigned
/* Invoke file props callback */
if (ctx.engine->cb_file_props != NULL) {
ret = ctx.engine->cb_file_props(jstring, rc, ctx.engine->cb_file_props_data);
ret = ctx.engine->cb_file_props(jstring, rc, ctx.cb_ctx);
if (ret != CL_SUCCESS)
rc = ret;
}

Loading…
Cancel
Save