00001 #ifndef VSF_FILESTR_H 00002 #define VSF_FILESTR_H 00003 00004 /* Forward declares */ 00005 struct mystr; 00006 00007 /* str_fileread() 00008 * PURPOSE 00009 * Read the contents of a file into a string buffer, up to a size limit of 00010 * "maxsize" 00011 * PARAMETERS 00012 * p_str - destination buffer object to contain the file 00013 * p_filename - the filename to try and read into the buffer 00014 * maxsize - the maximum amount of buffer we will fill. Larger files will 00015 * be truncated. 00016 * RETURNS 00017 * An integer representing the success/failure of opening the file 00018 * "p_filename". Zero indicates success. If successful, the file is read into 00019 * the "p_str" string object. If not successful, "p_str" will point to an 00020 * empty buffer. 00021 */ 00022 int str_fileread(struct mystr* p_str, const char* p_filename, 00023 unsigned int maxsize); 00024 00025 #endif /* VSF_FILESTR_H */ 00026