test/formats/check_conf.c
/* Create a temporary ini file at the given path with the given contents. */
Create a temporary ini file at the given path with the given contents.
Create a temporary ini file at the given path with the given contents .
static M_bool create_ini(const char *path, const char *contents)
{
	M_fs_file_t  *fd;
	M_fs_error_t  res;
	res = M_fs_file_open(&fd, path, 0, M_FS_FILE_MODE_WRITE, NULL);
	if (res != M_FS_ERROR_SUCCESS)
		return M_FALSE;
	res = M_fs_file_write(fd, (const unsigned char *)contents, M_str_len(contents), NULL, 0);
	if (res != M_FS_ERROR_SUCCESS) {
		M_fs_file_close(fd);
		return M_FALSE;
	}
	M_fs_file_close(fd);
	return M_TRUE;
}
static M_bool create_ini ( const char * path , const char * contents ) { M_fs_file_t * fd ; M_fs_error_t res ; res = M_fs_file_open ( & fd , path , 0 , M_FS_FILE_MODE_WRITE , NULL ) ; if ( res != M_FS_ERROR_SUCCESS ) return M_FALSE ; res = M_fs_file_write ( fd , ( const unsigned char * ) contents , M_str_len ( contents ) , NULL , 0 ) ; if ( res != M_FS_ERROR_SUCCESS ) { M_fs_file_close ( fd ) ; return M_FALSE ; } M_fs_file_close ( fd ) ; return M_TRUE ; }
Create a temporary ini file at the given path with the given contents.
Create a temporary ini file at the given path with the given contents .