cfile

#include <lfp/lfp.h>

lfp_protocol *lfp_cfile(FILE*)

C FILE protocol.

This protocol provides an lfp interface to FILE.

The protocol will immediately ftell() and consider this as the start of the file by lfp. This allows reading past particular garbage, noise, or sensitive details before giving control to lfp.

The cfile protocol supports everything the specific FILE instance support, which means features may degrade when FILE is a stream (pipe) or similar. Typically, this means seek and tell will fail.

This function takes ownership of the handle, and the FILE will be fclose()d when lfp_close() is called on it.