wmail: fixed possible NULL-pointer dereference in config-parser.
[dockapps.git] / wmhdplop / devnames.h
blob15b0f73b30652f395afde0d0946451f5025683ae
1 #ifndef DEVNAMES_H
2 #define DEVNAMES_H
3 #include "util.h"
5 #define IS_PARTITION(DL) ((DL)->part_id!=0)
7 typedef struct DiskList {
8 char *name, *dev_path;
9 unsigned major, minor;
10 int hd_id, part_id; /* part_id = 0 for disks */
11 int enable_hddtemp;
12 long nr, nw, touched_r, touched_w;
13 struct DiskList *next;
14 } DiskList;
16 int is_displayed(int hd_id, int part_id); /* wmhdplop.c function */
17 int short_name_for_device(unsigned major, unsigned minor, char *name);
19 const char *stripdev(const char *s);
20 DiskList *find_dev(unsigned major, unsigned minor);
21 DiskList *find_dev_by_name(const char *name);
22 DiskList *find_id(int hd_id, int part_id);
23 DiskList *next_hd_in_list(DiskList *current);
24 DiskList *first_hd_in_list();
25 DiskList *first_dev_in_list();
26 int nb_hd_in_list();
27 int nb_dev_in_list();
28 int is_partition(unsigned major, unsigned minor);
29 int add_device_by_name(const char *devname, const char *mtab_name);
30 int add_device_by_id(unsigned major, unsigned minor, const char *mtab_name);
31 void add_swap(const char *swapdev);
32 int device_info(unsigned major, unsigned minor, char *name, int *hd_id, int *part_id);
33 strlist *swap_list();
34 #endif