Determining the Size Requirements of a Memory File

To determine the smallest size memory file that will hold a given text file, call the function mf_size():

int mf_size(filespec, rowp, colp)
 
UCHAR *filespec
/* Pointer to filespec string (path optional)
*/
int *rowp;
/* Pointer to int to hold number of rows
*/
int *colp;
/* Pointer to int to hold number of columns
*/

mf_size() reads an ASCII file from disk to determine how many rows and columns are needed for the memory file. Automatically loaded and manually loaded keyword sections are taken into account.

If you plan to add lines to the memory file with mf_rowins(), you will need to allow for this when calling mf_def(). mf_size() calculates the minimum size needed for the memory file; it does not allow room for insertions.


Home Contents Previous Next