There currently is no function call available via the public libclamav
API to return the total number of signatures in the database directory.
To find this number a developer would need to manually pass the file
names to the CVD functions. Since there are multiple files stored in the
directory, and filenames change, I don't feel that is a stable interface
model.
Why not store the number as part of the cl_stat structure, and return it
with a simple function call:
unsigned int cl_statsigtotal(const struct cl_stat *dbstat);
I like to write this total to the log files so I periodically check to
make sure the database is up to date, and has been refreshed inside the
daemon. Checking the number against the one on the clamav.net home page
is easiest, since I don't have freshclam installed on every server.
I used to use the number of signatures returned by the cl_load function,
but that function only returns the number of signatures loaded, not the
number of signatures available. (When I first implemented my interface,
there was no distinction.)
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net
API to return the total number of signatures in the database directory.
To find this number a developer would need to manually pass the file
names to the CVD functions. Since there are multiple files stored in the
directory, and filenames change, I don't feel that is a stable interface
model.
Why not store the number as part of the cl_stat structure, and return it
with a simple function call:
unsigned int cl_statsigtotal(const struct cl_stat *dbstat);
I like to write this total to the log files so I periodically check to
make sure the database is up to date, and has been refreshed inside the
daemon. Checking the number against the one on the clamav.net home page
is easiest, since I don't have freshclam installed on every server.
I used to use the number of signatures returned by the cl_load function,
but that function only returns the number of signatures loaded, not the
number of signatures available. (When I first implemented my interface,
there was no distinction.)
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net