13#include "attributes.h"
16int _nfile_concatPaths(
char buf[static 1],
int maxLength,
17 const
char path[static 1], ... );
28#define nfile_concatPaths( buf, maxLength, path, ... ) \
29 _nfile_concatPaths( buf, maxLength, path, ##__VA_ARGS__, NULL )
45#if !SDL_VERSION_ATLEAST( 3, 0, 0 )
51typedef void( SDLCALL *SDL_DialogFileCallback )(
void *userdata,
52 const char *
const *filelist,
55void SDL_ShowOpenFileDialog( SDL_DialogFileCallback callback,
void *userdata,
58 const char *default_location,
59 SDL_bool allow_many );
60void SDL_ShowOpenFolderDialog( SDL_DialogFileCallback callback,
void *userdata,
61 SDL_Window *window,
const char *default_location,
62 SDL_bool allow_many );
63void SDL_ShowSaveFileDialog( SDL_DialogFileCallback callback,
void *userdata,
66 const char *default_location );
Header file with generic functions and naev-specifics.
int nfile_simplifyPath(char path[static 1])
Simplifies the path removing things like ".." or consecutive "/".
int nfile_copyIfExists(const char *file1, const char *file2)
Copy a file, if it exists.
const char * nfile_configPath(void)
Gets Naev's config path (for user preferences such as conf.lua)
int nfile_writeFile(const char *data, size_t len, const char *path)
Tries to write a file.
char * nfile_readFile(size_t *filesize, const char *path)
Tries to read a file.
int nfile_dirMakeExist(const char *path)
Creates a directory if it doesn't exist.
int nfile_backupIfExists(const char *path)
Backup a file, if it exists.
const char * nfile_cachePath(void)
Gets Naev's cache path (for cached data such as generated textures)
int nfile_fileExists(const char *path)
Checks to see if a file exists.
int nfile_touch(const char *path)
Tries to create the file if it doesn't exist.
int nfile_isSeparator(uint32_t c)
Checks to see if a character is used to separate files in a path.
int nfile_dirExists(const char *path)
Checks to see if a directory exists.