.\" Automatically generated by Pandoc 3.1.3 .\" .\" Define V font for inline verbatim, using C font in formats .\" that render this, and otherwise B font. .ie "\f[CB]x\f[]"x" \{\ . ftr V B . ftr VI BI . ftr VB B . ftr VBI BI .\} .el \{\ . ftr V CR . ftr VI CI . ftr VB CB . ftr VBI CBI .\} .TH "al_open_memfile" "3alleg5" "" "Allegro reference manual" "" .hy .SH NAME .PP al_open_memfile - Allegro 5 API .SH SYNOPSIS .IP .nf \f[C] #include ALLEGRO_FILE *al_open_memfile(void *mem, int64_t size, const char *mode) \f[R] .fi .SH DESCRIPTION .PP Returns a file handle to the block of memory. All read and write operations act upon the memory directly, so it must not be freed while the file remains open. .PP The mode can be any combination of \[lq]r\[rq] (readable) and \[lq]w\[rq] (writable). Regardless of the mode, the file always opens at position 0. The file size is fixed and cannot be expanded. The file is always read from/written to in binary mode, which means that no newline translation is performed. .PP It should be closed with al_fclose(3alleg5). After the file is closed, you are responsible for freeing the memory (if needed).