Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ClamAV: devel

A portable way to determine the version of libclamav

 

 

ClamAV devel RSS feed   Index | Next | Previous | View Threaded


tillmann.werner at gmx

Sep 20, 2009, 3:15 AM

Post #1 of 3 (300 views)
Permalink
A portable way to determine the version of libclamav

Hi list,

does anybody know of a portable way to determine the version of
libclamav? I'd like to link against it on different platforms that use
different versions of library in their application repositories. That
means I have to support the old (e.g. v0.94) and the new (e.g. 0.95.2)
interface.

From my perspective, best would be to have version information in
clamav.h and then use #ifdef's to distinguish between the different
APIs. Unfortunately, clamav.h seems not to contain such info.

I've searched a bit how other projects to it - without success. I am
sure there is a way. Could somebody please point me to it?

Thanks alot.

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


edwintorok at gmail

Sep 20, 2009, 3:38 AM

Post #2 of 3 (281 views)
Permalink
Re: A portable way to determine the version of libclamav [In reply to]

On 2009-09-20 13:15, Tillmann Werner wrote:
> Hi list,
>
> does anybody know of a portable way to determine the version of
> libclamav? I'd like to link against it on different platforms that use
> different versions of library in their application repositories. That
> means I have to support the old (e.g. v0.94) and the new (e.g. 0.95.2)
> interface.
>
> From my perspective, best would be to have version information in
> clamav.h and then use #ifdef's to distinguish between the different
> APIs. Unfortunately, clamav.h seems not to contain such info.
>
> I've searched a bit how other projects to it - without success. I am
> sure there is a way. Could somebody please point me to it?
>
>

You could use one of the macros that are defined in 0.95 and not in
0.94, such as CL_INIT_DEFAULT.

#ifdef CL_INIT_DEFAULT
// ... code for 0.95+ API
#else
// .. code for <0.95 API
#endif

And if you use cl_init for 0.95+ API (as you should), then if there is a
mismatch between the headers and the library (for example 0.95 headers
and 0.94 libraries), then you'll get a linker error about cl_init not
being defined.

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


tillmann.werner at gmx

Sep 20, 2009, 3:45 AM

Post #3 of 3 (285 views)
Permalink
Re: A portable way to determine the version of libclamav [In reply to]

> You could use one of the macros that are defined in 0.95 and not in
> 0.94, such as CL_INIT_DEFAULT.

That should do it, thanks alot.

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

ClamAV devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.