Data scan functions

It's possible to scan a file or descriptor using:
	int cl_scanfile(const char *filename, const char **virname,
	unsigned long int *scanned, const struct cl_engine *engine,
	unsigned int options);

	int cl_scandesc(int desc, const char **virname, unsigned
	long int *scanned, const struct cl_engine *engine,
	unsigned int options);
Both functions will store a virus name under the pointer virname, the virus name is part of the engine structure and must not be released directly. If the third argument (scanned) is not NULL, the functions will increase its value with the size of scanned data (in CL_COUNT_PRECISION units). The last argument (options) specified the scan options and supports the following flags (which can be combined using bit operators): All functions return CL_CLEAN when the file seems clean, CL_VIRUS when a virus is detected and another value on failure.
	    ...
	    const char *virname;

	if((ret = cl_scanfile("/tmp/test.exe", &virname, NULL, engine,
	CL_SCAN_STDOPT)) == CL_VIRUS) {
	    printf("Virus detected: %s\n", virname);
	} else {
	    printf("No virus detected.\n");
	    if(ret != CL_CLEAN)
	        printf("Error: %s\n", cl_strerror(ret));
	}

Tomasz Kojm 2011-03-21