From: Karel Zak Date: Wed, 27 Jun 2007 21:36:08 +0000 (+0200) Subject: fdisk: move duplicate stuff from fdisk*label.h to fdisk.h X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=024353c9ea8a53da522a512fd2a4029a4aad3da3;p=util-linux fdisk: move duplicate stuff from fdisk*label.h to fdisk.h Signed-off-by: Karel Zak --- diff --git a/fdisk/fdisk.h b/fdisk/fdisk.h index 48e03f52..781c5050 100644 --- a/fdisk/fdisk.h +++ b/fdisk/fdisk.h @@ -76,6 +76,14 @@ extern int valid_part_table_flag(unsigned char *b); extern unsigned int read_int(unsigned int low, unsigned int dflt, unsigned int high, unsigned int base, char *mesg); +extern unsigned char MBRbuffer[MAX_SECTOR_SIZE]; +extern unsigned int heads, cylinders, sector_size; +extern unsigned long long sectors; +extern char *partition_type(unsigned char type); +extern void update_units(void); +extern char read_chars(char *mesg); +extern void set_changed(int); +extern void set_all_unchanged(void); #define PLURAL 0 #define SINGULAR 1 @@ -85,6 +93,9 @@ extern unsigned long long get_start_sect(struct partition *p); extern unsigned long long get_nr_sects(struct partition *p); extern int osf_label; +extern int sun_label; +extern int sgi_label; +extern int aix_label; /* prototypes for fdiskbsdlabel.c */ extern void bselect(void); diff --git a/fdisk/fdiskaixlabel.h b/fdisk/fdiskaixlabel.h index f58f1a0a..106b5ace 100644 --- a/fdisk/fdiskaixlabel.h +++ b/fdisk/fdiskaixlabel.h @@ -1,3 +1,6 @@ +#ifndef FDISK_AIX_LABEL_H +#define FDISK_AIX_LABEL_H + #include /* for __u32 etc */ /* * Copyright (C) Andreas Neuper, Sep 1998. @@ -19,17 +22,10 @@ typedef struct { /* fdisk.c */ #define aixlabel ((aix_partition *)MBRbuffer) -extern unsigned char MBRbuffer[MAX_SECTOR_SIZE]; -extern char changed[MAXIMUM_PARTS]; -extern unsigned int heads, cylinders; -extern unsigned long long sectors; -extern int show_begin; -extern int aix_label; -extern char *partition_type(unsigned char type); -extern void update_units(void); -extern char read_chars(char *mesg); /* fdiskaixlabel.c */ extern struct systypes aix_sys_types[]; -extern void aix_nolabel( void ); -extern int check_aix_label( void ); +extern void aix_nolabel( void ); +extern int check_aix_label( void ); + +#endif /* FDISK_AIX_LABEL_H */ diff --git a/fdisk/fdiskbsdlabel.h b/fdisk/fdiskbsdlabel.h index 40c37378..1fabaae4 100644 --- a/fdisk/fdiskbsdlabel.h +++ b/fdisk/fdiskbsdlabel.h @@ -1,3 +1,6 @@ +#ifndef FDISK_BSD_LABEL_H +#define FDISK_BSD_LABEL_H + /* * Copyright (c) 1987, 1988 Regents of the University of California. * All rights reserved. @@ -232,3 +235,5 @@ static struct systypes xbsd_fstypes[] = { #define BSD_D_RAMDISK 0x08 /* disk emulator */ #define BSD_D_CHAIN 0x10 /* can do back-back transfers */ #define BSD_D_DOSPART 0x20 /* within MSDOS partition */ + +#endif /* FDISK_BSD_LABEL_H */ diff --git a/fdisk/fdisksgilabel.h b/fdisk/fdisksgilabel.h index fa992fc6..fe757bf1 100644 --- a/fdisk/fdisksgilabel.h +++ b/fdisk/fdisksgilabel.h @@ -1,3 +1,6 @@ +#ifndef FDISK_SGI_LABEL_H +#define FDISK_SGI_LABEL_H + #include /* for __u32 etc */ /* * Copyright (C) Andreas Neuper, Sep 1998. @@ -103,20 +106,11 @@ typedef struct { /* fdisk.c */ #define sgilabel ((sgi_partition *)MBRbuffer) #define sgiparam (sgilabel->devparam) -extern unsigned char MBRbuffer[MAX_SECTOR_SIZE]; -extern unsigned int heads, cylinders, sector_size; -extern unsigned long long sectors; -extern int show_begin; -extern int sgi_label; -extern char *partition_type(unsigned char type); -extern void update_units(void); -extern char read_chars(char *mesg); -extern void set_changed(int); /* fdisksgilabel.c */ extern struct systypes sgi_sys_types[]; -extern void sgi_nolabel( void ); -extern int check_sgi_label( void ); +extern void sgi_nolabel( void ); +extern int check_sgi_label( void ); extern void sgi_list_table( int xtra ); extern void sgi_change_sysid( int i, int sys ); extern unsigned int sgi_get_start_sector( int i ); @@ -139,3 +133,5 @@ extern int sgi_get_bootpartition( void ); extern int sgi_get_swappartition( void ); extern void sgi_set_bootfile( const char* aFile ); extern const char *sgi_get_bootfile( void ); + +#endif /* FDISK_SGI_LABEL_H */ diff --git a/fdisk/fdisksunlabel.h b/fdisk/fdisksunlabel.h index 312bfea0..e322e66e 100644 --- a/fdisk/fdisksunlabel.h +++ b/fdisk/fdisksunlabel.h @@ -1,3 +1,6 @@ +#ifndef FDISK_SUN_LABEL_H +#define FDISK_SUN_LABEL_H + #include /* for __u16, __u32 */ typedef struct { @@ -35,19 +38,6 @@ typedef struct { : (__u16)(x)) #define SSWAP32(x) (other_endian ? __swap32(x) \ : (__u32)(x)) - -/* fdisk.c */ -extern unsigned char MBRbuffer[MAX_SECTOR_SIZE]; -extern unsigned int heads, cylinders; -extern unsigned long long sectors; -extern int show_begin; -extern int sun_label; -extern char *partition_type(unsigned char type); -extern void update_units(void); -extern char read_chars(char *mesg); -extern void set_all_unchanged(void); -extern void set_changed(int); - /* fdisksunlabel.c */ #define SUNOS_SWAP 3 #define WHOLE_DISK 5 @@ -72,3 +62,4 @@ extern void sun_set_rspeed(void); extern void sun_set_pcylcount(void); extern void toggle_sunflags(int i, unsigned char mask); +#endif /* FDISK_SUN_LABEL_H */