caca_file - Online Linux Manual PageSection : 3caca
Updated : Tue Jan 26 2021
Source : Version 0.99.beta19
Note : libcaca

NAMEcaca_file − libcaca file IO

SYNOPSIS

Moduleslibcaca importers/exporters from/to various

Functions__extern caca_file_t * caca_file_open (char const *, const char *)
Open a file for reading or writing​.
__extern int caca_file_close (caca_file_t *)
Close a file handle​.
__extern uint64_t caca_file_tell (caca_file_t *)
Return the position in a file handle​.
__extern size_t caca_file_read (caca_file_t *, void *, size_t)
Read data from a file handle​.
__extern size_t caca_file_write (caca_file_t *, const void *, size_t)
Write data to a file handle​.
__extern char * caca_file_gets (caca_file_t *, char *, int)
Read a line from a file handle​.
__extern int caca_file_eof (caca_file_t *)
Tell whether a file handle reached end of file​.

Detailed DescriptionThese functions allow to read and write files in a platform-independent way​.

Function Documentation

__extern caca_file_t* caca_file_open (char const * path, const char * mode)Create a caca file handle for a file​. If the file is zipped, it is decompressed on the fly​. If an error occurs, NULL is returned and errno is set accordingly: • ENOSTS Function not implemented​. • EINVAL File not found or permission denied​. Parameters path The file path
mode The file open mode
Returns A file handle to path​. Referenced by caca_import_canvas_from_file()​.

__extern int caca_file_close (caca_file_t * fp)Close and destroy the resources associated with a caca file handle​. This function is a wrapper for fclose() or, if available, gzclose()​. Parameters fp The file handle Returns The return value of fclose() or gzclose()​. Referenced by caca_import_canvas_from_file()​.

__extern uint64_t caca_file_tell (caca_file_t * fp)Return the file handle position, in bytes​. Parameters fp The file handle Returns The current offset in the file handle​.

__extern size_t caca_file_read (caca_file_t * fp, void * ptr, size_t size)Read data from a file handle and copy them into the given buffer​. Parameters fp The file handle
ptr The destination buffer
size The number of bytes to read
Returns The number of bytes read Referenced by caca_import_canvas_from_file()​.

__extern size_t caca_file_write (caca_file_t * fp, const void * ptr, size_t size)Write the contents of the given buffer to the file handle​. Parameters fp The file handle
ptr The source buffer
size The number of bytes to write
Returns The number of bytes written

__extern char* caca_file_gets (caca_file_t * fp, char * s, int size)Read one line of data from a file handle, up to one less than the given number of bytes​. A trailing zero is appended to the data​. Parameters fp The file handle
s The destination buffer
size The maximum number of bytes to read
Returns The number of bytes read, including the trailing zero

__extern int caca_file_eof (caca_file_t * fp)Return the end-of-file status of the file handle​. This function is a wrapper for feof() or, if available, gzeof()​. Parameters fp The file handle Returns 1 if EOF was reached, 0 otherwise Referenced by caca_import_canvas_from_file()​.

AuthorGenerated automatically by Doxygen for libcaca from the source code​.
0
Johanes Gumabo
Data Size   :   20,533 byte
man-caca_file_open.3cacaBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   2 / 181,204
Visitor ID   :     :  
Visitor IP   :   3.137.170.38   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.