mountpoint-list.h revision 6f5dca63ec5e5abeb9a5731e6e1c51ba3f007fe3
#ifndef MOUNTPOINT_LIST_H
#define MOUNTPOINT_LIST_H
#define MOUNTPOINT_LIST_FNAME "mounts"
#define MOUNTPOINT_STATE_DEFAULT "online"
#define MOUNTPOINT_STATE_IGNORE "ignore"
#define MOUNTPOINT_WRONGLY_NOT_MOUNTED(rec) \
struct mountpoint_list_rec {
const char *mount_path;
const char *state;
/* _add_missing() skips all mountpoints below this mount_path */
bool wildcard;
/* TRUE, if _add_missing() saw this mount */
bool mounted;
};
/* A default known good list of mountpoint types that don't contain emails
(e.g. proc, tmpfs, etc.) */
extern const char *const mountpoint_list_default_ignore_types[];
/* A default known good list of directories which shouldn't contain emails
(e.g. /media) */
extern const char *const mountpoint_list_default_ignore_prefixes[];
struct mountpoint_list *
struct mountpoint_list *
mountpoint_list_init_readonly(const char *state_path);
/* Reload the mountpoints if they have changed. Returns 0 if ok,
-1 if I/O error. */
/* Save the current list of mountpoints. Returns 0 if successful,
-1 if I/O error. */
/* Add a mountpoint. If it already exists, replace the old one. */
const struct mountpoint_list_rec *rec);
/* Remove a mountpoint. Returns TRUE if mountpoint was found and removed. */
const char *mount_path);
/* Add all currently mounted missing mountpoints to the list and update all
mountpoints' mounted state. The mountpoints that match existing wildcards
aren't added. Mountpoints with paths under ignore_prefixes aren't added.
Mountpoints with type in ignore_types list also aren't added.
Returns 0 if we successfully iterated through all mountpoints, -1 if not. */
const char *default_state,
const char *const *ignore_prefixes,
const char *const *ignore_types);
/* Update "mounted" status for all mountpoints. */
/* Find a mountpoint record for given path. */
struct mountpoint_list_rec *
/* Iterate through all mountpoints in the list. */
struct mountpoint_list_iter *
struct mountpoint_list_rec *
#endif