2011-01-28 20:21:53 -08:00
|
|
|
#ifndef EEZE_DISK_PRIVATE_H
|
|
|
|
#define EEZE_DISK_PRIVATE_H
|
|
|
|
#include <Eeze.h>
|
|
|
|
#include <Ecore_File.h>
|
|
|
|
|
|
|
|
#ifndef EEZE_DISK_COLOR_DEFAULT
|
|
|
|
#define EEZE_DISK_COLOR_DEFAULT EINA_COLOR_LIGHTBLUE
|
|
|
|
#endif
|
|
|
|
extern int _eeze_disk_log_dom;
|
2011-02-10 19:14:00 -08:00
|
|
|
#ifdef CRI
|
|
|
|
#undef CRI
|
|
|
|
#endif
|
|
|
|
|
2011-01-28 20:21:53 -08:00
|
|
|
#ifdef ERR
|
|
|
|
#undef ERR
|
|
|
|
#endif
|
|
|
|
#ifdef INF
|
|
|
|
#undef INF
|
|
|
|
#endif
|
|
|
|
#ifdef WARN
|
|
|
|
#undef WARN
|
|
|
|
#endif
|
|
|
|
#ifdef DBG
|
|
|
|
#undef DBG
|
|
|
|
#endif
|
|
|
|
|
2011-02-10 19:14:00 -08:00
|
|
|
#define CRI(...) EINA_LOG_DOM_CRIT(_eeze_disk_log_dom, __VA_ARGS__)
|
2011-01-28 20:21:53 -08:00
|
|
|
#define DBG(...) EINA_LOG_DOM_DBG(_eeze_disk_log_dom, __VA_ARGS__)
|
|
|
|
#define INF(...) EINA_LOG_DOM_INFO(_eeze_disk_log_dom, __VA_ARGS__)
|
|
|
|
#define WARN(...) EINA_LOG_DOM_WARN(_eeze_disk_log_dom, __VA_ARGS__)
|
|
|
|
#define ERR(...) EINA_LOG_DOM_ERR(_eeze_disk_log_dom, __VA_ARGS__)
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
2011-05-16 04:24:26 -07:00
|
|
|
EEZE_DISK_NULL = 0,
|
|
|
|
EEZE_DISK_MOUNTING = 1,
|
|
|
|
EEZE_DISK_UNMOUNTING = 2,
|
|
|
|
EEZE_DISK_EJECTING = 4
|
2011-01-28 20:21:53 -08:00
|
|
|
} Eeze_Disk_Status;
|
|
|
|
|
|
|
|
struct _Eeze_Disk
|
|
|
|
{
|
|
|
|
_udev_device *device;
|
|
|
|
void *data;
|
|
|
|
|
2011-05-16 04:24:26 -07:00
|
|
|
int mount_status;
|
2011-01-28 20:21:53 -08:00
|
|
|
Eina_Strbuf *mount_cmd;
|
|
|
|
Eina_Strbuf *unmount_cmd;
|
2011-05-16 04:03:06 -07:00
|
|
|
Eina_Strbuf *eject_cmd;
|
2011-01-28 20:21:53 -08:00
|
|
|
Eina_Bool mount_cmd_changed : 1;
|
|
|
|
Eina_Bool unmount_cmd_changed : 1;
|
2011-05-16 02:52:16 -07:00
|
|
|
Eina_Bool mounted : 1;
|
2011-01-28 20:21:53 -08:00
|
|
|
Ecore_Exe *mounter;
|
2012-08-01 05:43:55 -07:00
|
|
|
unsigned int mount_fail_count;
|
2011-03-12 10:41:03 -08:00
|
|
|
|
2011-01-28 20:21:53 -08:00
|
|
|
const char *syspath;
|
|
|
|
const char *devpath;
|
|
|
|
const char *fstype;
|
|
|
|
const char *mount_point;
|
2011-05-15 15:56:14 -07:00
|
|
|
const char *mount_wrapper;
|
2011-02-10 19:14:00 -08:00
|
|
|
unsigned long mount_opts;
|
2011-05-15 17:06:41 -07:00
|
|
|
uid_t uid;
|
2011-03-12 10:41:03 -08:00
|
|
|
|
2011-01-28 20:21:53 -08:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
Eeze_Disk_Type type;
|
|
|
|
Eina_Bool removable : 1;
|
|
|
|
const char *vendor;
|
|
|
|
const char *model;
|
|
|
|
const char *serial;
|
|
|
|
const char *uuid;
|
|
|
|
const char *label;
|
|
|
|
Eina_Bool filled : 1;
|
|
|
|
} cache;
|
|
|
|
};
|
|
|
|
|
2011-05-21 12:34:26 -07:00
|
|
|
Eina_Bool eeze_disk_init(void);
|
|
|
|
void eeze_disk_shutdown(void);
|
|
|
|
|
2011-01-28 20:21:53 -08:00
|
|
|
Eina_Bool eeze_mount_init(void);
|
|
|
|
void eeze_mount_shutdown(void);
|
|
|
|
|
|
|
|
Eina_Bool eeze_libmount_init(void);
|
|
|
|
void eeze_libmount_shutdown(void);
|
|
|
|
Eina_Bool eeze_disk_libmount_mounted_get(Eeze_Disk *disk);
|
2011-02-10 19:14:00 -08:00
|
|
|
unsigned long eeze_disk_libmount_opts_get(Eeze_Disk *disk);
|
2011-01-28 20:21:53 -08:00
|
|
|
const char *eeze_disk_libmount_mp_find_source(const char *mount_point);
|
|
|
|
|
|
|
|
const char *eeze_disk_libmount_mp_lookup_by_uuid(const char *uuid);
|
|
|
|
const char *eeze_disk_libmount_mp_lookup_by_label(const char *label);
|
|
|
|
const char *eeze_disk_libmount_mp_lookup_by_devpath(const char *devpath);
|
|
|
|
|
|
|
|
#endif
|