These routines are written to work both on posix systems and on Windows.
FILE * mp4tag_fopen (const char *filename, const char *mode)
filename : The file to open.
mode : The mode to use to open the file (see fopen).
Returns: A FILE pointer or NULL on error.
ssize_t mp4tag_file_size (const char *filename)
filename : The file to open.
Returns: The size of the file or -1 on error.
char * mp4tag_read_file (const char *filename, size_t *sz, int *mp4error)
filename : The file to read.
sz : Returned size.
mp4error : Error return.
Returns: An allocated pointer to the data. The application takes ownership of the returned data and must free it.
int mp4tag_file_delete (const char *filename)
filename : The file to delete.
Returns: 0 on success.
Renames a file.
int mp4tag_file_move (const char *filename, const char *nfn)
filename : The old filename.
nfn : The new filename.
Returns: 0 on success.
Copies the file times (modification time, et. al) from one open file to another.
void mp4tag_copy_file_times (FILE *ifh, FILE *ofh)
ifh : FILE pointer to open source file.
ofh : FILE pointer to open target file.
int64_t mp4tag_ftell (FILE *fh)
fh : FILE pointer to open file
int mp4tag_fseek (FILE *fh, int64_t offset, int whence)
fh : FILE pointer to open file
offset : offset into file
whence : SEEK_SET, SEEK_END, SEEK_CUR
Converts a utf8 string to Windows unicode.
wchar_t *mp4tag_towide (const char *buff)
buff : utf8 string
Returns: pointer to wchar_t
Converts a Windows unicode string to utf8.
char *mp4tag_fromwide (const wchar_t *buff)
buff : Windows unicode string
Returns: pointer to char
The caller takes ownership of the returned string and must free it.