Browse code

Adds new clamav-version.h to clamav.h so it doesn't have to be included separately, and adds example usage to the ex1.c example program.

Micah Snyder authored on 2019/09/08 00:29:15
Showing 3 changed files
... ...
@@ -96,7 +96,7 @@ changes.
96 96
   assurance test suites and enables automatic testing of all proposed changes
97 97
   to ClamAV, with customizable parameters to suit the testing needs of any
98 98
   given code change.
99
-- Added a new `clamav-version.h` generated header to provide  version number
99
+- Added a new `clamav-version.h` generated header to provide version number
100 100
   macros in text and numerical format for ClamAV, libclamav, and libfreshclam.
101 101
 
102 102
 ### Bug fixes
... ...
@@ -70,6 +70,12 @@ int main(int argc, char **argv)
70 70
         return 2;
71 71
     }
72 72
 
73
+    /* Example version macro usage to determine if new feature is available */
74
+#if defined(LIBCLAMAV_VERSION_NUM) && (LIBCLAMAV_VERSION_NUM >= 0x090400)
75
+    /* Example feature usage lowering max scan time to 15 seconds. */
76
+    cl_engine_set_num(engine, CL_ENGINE_MAX_SCANTIME, 15000);
77
+#endif
78
+
73 79
     /* load all available databases from default directory */
74 80
     if ((ret = cl_load(cl_retdbdir(), engine, &sigs, CL_DB_STDOPT)) != CL_SUCCESS) {
75 81
         printf("cl_load: %s\n", cl_strerror(ret));
... ...
@@ -66,6 +66,7 @@
66 66
 #include <sys/stat.h>
67 67
 
68 68
 #include "clamav-types.h"
69
+#include "clamav-version.h"
69 70
 
70 71
 #ifdef __cplusplus
71 72
 extern "C" {