1 /* 2 * gmodules.h -- gpart module header file 3 * 4 * gpart (c) 1999-2001 Michail Brzitwa <mb@ichabod.han.de> 5 * Guess PC-type hard disk partitions. 6 * 7 * gpart is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published 9 * by the Free Software Foundation; either version 2, or (at your 10 * option) any later version. 11 * 12 * Created: 04.01.1999 <mb@ichabod.han.de> 13 * Modified: 29.01.2001 <mb@ichabod.han.de> 14 * New modules: qnx & beos. 15 * 16 */ 17 18 #ifndef _GMODULES_H 19 #define _GMODULES_H 20 21 22 #define GM_NO (0.0) /* predefined probabilities */ 23 #define GM_PERHAPS (0.5) 24 #define GM_YES (0.8) 25 #define GM_UNDOUBTEDLY (1.0) 26 27 typedef struct g_mod 28 { 29 char *m_name; /* name of module */ 30 char *m_desc; /* readable description */ 31 int (*m_init)(disk_desc *,struct g_mod *); 32 int (*m_term)(disk_desc *); 33 int (*m_gfun)(disk_desc *,struct g_mod *); 34 float m_guess; 35 float m_weight; /* probability weight */ 36 void *m_hd; /* dlopen() descriptor */ 37 dos_part_entry m_part; /* a guessed partition entry */ 38 long m_align; /* alignment of partition */ 39 struct g_mod *m_next; 40 unsigned int m_hasptbl : 1; /* has a ptbl like entry in sec 0 */ 41 unsigned int m_notinext : 1; /* cannot exist in an ext part. */ 42 unsigned int m_skip : 1; /* skip this module this time */ 43 } g_module; 44 45 #define GM_LOOKUP 0 46 #define GM_INSERT 1 47 48 void g_mod_list(), g_mod_delete(g_module *), g_mod_deleteall(); 49 g_module *g_mod_head(), *g_mod_lookup(int,char *); 50 void g_mod_addinternals(); 51 int g_mod_count(), g_mod_addexternal(char *); 52 g_module *g_mod_setweight(char *,float); 53 54 55 56 /* 57 * preloaded guessing modules 58 */ 59 60 #define GMODDECL(mod) int mod##_init(disk_desc *,g_module *), \ 61 mod##_term(disk_desc *), \ 62 mod##_gfun(disk_desc *,g_module *) 63 64 GMODDECL(bsddl); GMODDECL(ext2); GMODDECL(fat); 65 GMODDECL(hpfs); GMODDECL(lswap); GMODDECL(ntfs); 66 GMODDECL(s86dl); GMODDECL(minix); GMODDECL(rfs); 67 GMODDECL(hmlvm); GMODDECL(qnx4); GMODDECL(beos); 68 GMODDECL(xfs); 69 70 71 #endif /* _GMODULES_H */ 72