running clamscan in c - header files

In c is there a header file to run clamscan in c code?

Else, I need to use system(“clamscan -r /”);

If use system, how to I redirect output to a buffer?

I figured out how redirect the output using popen.

I still have the question: is there a direct way to call clamscan with a c header file.

Yeah I think the same. It’s the best option.