filestr.h 834 B

1234567891011121314151617181920212223242526
  1. #ifndef VSF_FILESTR_H
  2. #define VSF_FILESTR_H
  3. /* Forward declares */
  4. struct mystr;
  5. /* str_fileread()
  6. * PURPOSE
  7. * Read the contents of a file into a string buffer, up to a size limit of
  8. * "maxsize"
  9. * PARAMETERS
  10. * p_str - destination buffer object to contain the file
  11. * p_filename - the filename to try and read into the buffer
  12. * maxsize - the maximum amount of buffer we will fill. Larger files will
  13. * be truncated.
  14. * RETURNS
  15. * An integer representing the success/failure of opening the file
  16. * "p_filename". Zero indicates success. If successful, the file is read into
  17. * the "p_str" string object. If not successful, "p_str" will point to an
  18. * empty buffer.
  19. */
  20. int str_fileread(struct mystr* p_str, const char* p_filename,
  21. unsigned int maxsize);
  22. #endif /* VSF_FILESTR_H */