7
7
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
10
<TITLE>Database loading</TITLE>
11
<META NAME="description" CONTENT="Database loading">
10
<TITLE>Header file</TITLE>
11
<META NAME="description" CONTENT="Header file">
12
12
<META NAME="keywords" CONTENT="clamdoc">
13
13
<META NAME="resource-type" CONTENT="document">
14
14
<META NAME="distribution" CONTENT="global">
29
29
<DIV CLASS="navigation"><!--Navigation Panel-->
31
31
HREF="node45.html">
32
32
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
34
34
HREF="node43.html">
35
35
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
37
37
HREF="node43.html">
38
38
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
41
41
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
43
<B> Next:</B> <A NAME="tex2html784"
44
HREF="node45.html">Error handling</A>
45
<B> Up:</B> <A NAME="tex2html780"
46
HREF="node43.html">Initialization</A>
47
<B> Previous:</B> <A NAME="tex2html774"
48
HREF="node43.html">Initialization</A>
49
<B> <A NAME="tex2html782"
43
<B> Next:</B> <A NAME="tex2html798"
44
HREF="node45.html">Initialization</A>
45
<B> Up:</B> <A NAME="tex2html794"
46
HREF="node43.html">API</A>
47
<B> Previous:</B> <A NAME="tex2html788"
48
HREF="node43.html">API</A>
49
<B> <A NAME="tex2html796"
50
50
HREF="node1.html">Contents</A></B>
53
53
<!--End of Navigation Panel-->
55
<H3><A NAME="SECTION00074100000000000000">
55
<H3><A NAME="SECTION00073100000000000000">
58
The following set of functions provides an interface for loading
61
const char *cl_retdbdir(void);
63
int cl_load(const char *path, struct cl_engine *engine,
64
unsigned int *signo, unsigned int options);
66
<code>cl_retdbdir()</code> returns the default (hardcoded) path to the directory
67
with ClamAV databases.
68
<code>cl_load()</code> loads a single database file or all databases from a
69
given directory (when <code>path</code> points to a directory). The second
70
argument is used for passing in the pointer to the engine that should
71
be previously allocated with <code>cl_engine_new()</code>. A number of loaded
72
signatures will be <SPAN CLASS="textbf">added</SPAN> to <code>signo</code> <A NAME="tex2html20"
73
HREF="footnode.html#foot325"><SUP><SPAN CLASS="arabic">8</SPAN></SUP></A>. The last argument can
74
pass the following flags:
77
<LI><SPAN CLASS="textbf">CL_DB_STDOPT</SPAN>
79
This is an alias for a recommended set of scan options.
81
<LI><SPAN CLASS="textbf">CL_DB_PHISHING</SPAN>
83
Load phishing signatures.
85
<LI><SPAN CLASS="textbf">CL_DB_PHISHING_URLS</SPAN>
87
Initialize the phishing detection module and load .wdb and .pdb files.
89
<LI><SPAN CLASS="textbf">CL_DB_PUA</SPAN>
91
Load signatures for Potentially Unwanted Applications.
93
<LI><SPAN CLASS="textbf">CL_DB_CVDNOTMP</SPAN>
95
Load CVD files directly without unpacking them into a temporary
100
<code>cl_load()</code> returns <code>CL_SUCCESS</code> on success and another code on
104
struct cl_engine *engine;
105
unsigned int sigs = 0;
108
if((ret = cl_init()) != CL_SUCCESS) {
109
printf("cl_init() error: %s\n", cl_strerror(ret));
113
if(!(engine = cl_engine_new())) {
114
printf("Can't create new engine\n");
118
ret = cl_load(cl_retdbdir(), engine, &sigs, CL_DB_STDOPT);
58
Every program using libclamav must include the header file <code>clamav.h</code>:
60
#include <clamav.h>