#include "common.h"
Go to the source code of this file.
Data Structures | |
struct | file_path_t |
This structure is used to identify a file to be saved/restored. More... | |
Functions | |
void | file_register_fd_reclaimer (reclaim_fd_t callback) |
Register fd reclaiming callback. | |
FILE * | file_config_open_read (const gchar *what, const file_path_t *fv, gint fvcnt) |
Open configuration file, renaming it as ".orig". | |
FILE * | file_config_open_read_norename (const gchar *what, const file_path_t *fv, gint fvcnt) |
Open configuration file, without renaming it. | |
FILE * | file_config_open_read_norename_chosen (const gchar *what, const file_path_t *fv, gint fvcnt, gint *chosen) |
Same as file_config_open_read_norename(), but also returns the index of the path chosen within the array, if a file was opened at all. | |
FILE * | file_config_open_write (const gchar *what, const file_path_t *fv) |
Open configuration file for writing. | |
gboolean | file_config_close (FILE *out, const file_path_t *fv) |
Close configuration file opened for writing, and rename it. | |
void | file_config_preamble (FILE *out, const gchar *what) |
Emit the configuration preamble. | |
void | file_path_set (file_path_t *fp, const char *dir, const char *name) |
Initializes `fp' with directory path `dir' and filename `name'. | |
gint | file_open (const gchar *path, gint flags) |
Open file, returning file descriptor or -1 on error with errno set. | |
gint | file_open_missing (const gchar *path, gint flags) |
Open file, returning file descriptor or -1 on error with errno set. | |
gint | file_create (const gchar *path, gint flags, gint mode) |
Create file, returning file descriptor or -1 on error with errno set. | |
FILE * | file_fopen (const gchar *path, const gchar *mode) |
Open file, returning FILE pointer if success or NULL on error. | |
FILE * | file_fopen_missing (const gchar *path, const gchar *mode) |
Open file, returning FILE pointer if success or NULL on error. |
|
Close configuration file opened for writing, and rename it.
|
|
Open configuration file, renaming it as ".orig". If configuration file cannot be found, try opening the ".orig" variant if already present. If not found, try with successive alternatives, if supplied.
|
|
Open configuration file, without renaming it. If configuration file cannot be found, try opening the ".orig" variant if already present. If not found, try with successive alternatives, if supplied.
|
|
Same as file_config_open_read_norename(), but also returns the index of the path chosen within the array, if a file was opened at all.
|
|
Open configuration file for writing.
|
|
Emit the configuration preamble.
|
|
Create file, returning file descriptor or -1 on error with errno set. Errors are logged as a warning. |
|
Open file, returning FILE pointer if success or NULL on error. Errors are logged as a warning. |
|
Open file, returning FILE pointer if success or NULL on error. Errors are logged as a warning, unless the file is missing, in which case nothing is logged. |
|
Open file, returning file descriptor or -1 on error with errno set. Errors are logged as a warning. |
|
Open file, returning file descriptor or -1 on error with errno set. Errors are logged as a warning, unless the file is missing, in which case nothing is logged. |
|
Initializes `fp' with directory path `dir' and filename `name'.
|
|
Register fd reclaiming callback. Use NULL to unregister it. |