Mailing List Archive

API concerns
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
Re: API concerns [ In reply to ]
On Fri, 13 Mar 2009 17:12:06 -0500
Ladar Levison <ladar@lavabit.com> wrote:

> 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);

Please open a bug report, mark it as enhancement, and we will consider
such a feature for one of the future releases.

--
oo ..... Tomasz Kojm <tkojm@clamav.net>
(\/)\......... http://www.ClamAV.net/gpg/tkojm.gpg
\..........._ 0DCA5A08407D5288279DB43454822DC8985A444B
//\ /\ Fri Mar 13 23:43:58 CET 2009
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net
Re: API concerns [ In reply to ]
Would you accept a patch file if I ever have the time?

Tomasz Kojm wrote:
> On Fri, 13 Mar 2009 17:12:06 -0500
> Ladar Levison <ladar@lavabit.com> wrote:
>
>
>> 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);
>>
>
> Please open a bug report, mark it as enhancement, and we will consider
> such a feature for one of the future releases.
>
>

_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net