7
7
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
10
<TITLE>Error handling</TITLE>
11
<META NAME="description" CONTENT="Error handling">
10
<TITLE>Initialization</TITLE>
11
<META NAME="description" CONTENT="Initialization">
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="node46.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="node44.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="tex2html796"
44
HREF="node46.html">Engine structure</A>
45
<B> Up:</B> <A NAME="tex2html792"
46
HREF="node43.html">Initialization</A>
47
<B> Previous:</B> <A NAME="tex2html786"
48
HREF="node44.html">Database loading</A>
49
<B> <A NAME="tex2html794"
43
<B> Next:</B> <A NAME="tex2html810"
44
HREF="node46.html">Database loading</A>
45
<B> Up:</B> <A NAME="tex2html806"
46
HREF="node43.html">API</A>
47
<B> Previous:</B> <A NAME="tex2html800"
48
HREF="node44.html">Header file</A>
49
<B> <A NAME="tex2html808"
50
50
HREF="node1.html">Contents</A></B>
53
53
<!--End of Navigation Panel-->
55
<H3><A NAME="SECTION00074200000000000000">
55
<H3><A NAME="SECTION00073200000000000000">
58
Use <code>cl_strerror()</code> to convert error codes into human readable
59
messages. The function returns a statically allocated string:
58
Before using libclamav, you should call <code>cl_init()</code> to initialize
59
it. When it's done, you're ready to create a new scan engine by calling
60
<code>cl_engine_new()</code>. To free resources allocated by the engine use
61
<code>cl_engine_free()</code>. Function prototypes:
61
if(ret != CL_SUCCESS) {
62
printf("cl_load() error: %s\n", cl_strerror(ret));
63
cl_engine_free(engine);
63
int cl_init(unsigned int options);
64
struct cl_engine *cl_engine_new(void);
65
int cl_engine_free(struct cl_engine *engine);
67
<code>cl_init()</code> and <code>cl_engine_free()</code> return <code>CL_SUCCESS</code>
68
on success or another code on error. <code>cl_engine_new()</code> return
69
a pointer or NULL if there's not enough memory to allocate a new