Anonymous avatar Anonymous committed e0888e1

Reorder. Rename do_ to perform_ for fdisk's sake (fdisk@sv.gnu.org/fdisk--main--0--patch-33)
fdisk@sv.gnu.org/fdisk--main--0--patch-33
Keywords:

Comments (0)

Files changed (8)

 		strlist.c	\
 		strlist.h	\
 		hacks.c		\
-		hacks.h
+		hacks.h		\
+		sys_types.h
 
 cfdisk_LDADD = $(PARTED_LIBS) $(CURSES_LIBS)
 
-endif MAKE_CFDISK
+endif MAKE_CFDISK
 static int
 getpartpos (const char* prompt, const void* context, const char *possibilities)
 {
+	menu_title(prompt);
 	return do_menu((MenuItem*) context, 11, MENU_BUTTON | MENU_TITLE,
 	               possibilities, NULL);
 }
 	                        NULL,&opts))
 		return 0;
 
-	if (!do_mkpart(disk,start,end,type,NULL,part,opts)) {
+	if (!perform_mkpart(disk,start,end,type,NULL,part,opts)) {
 		if (!*part) {
 			do {
 				temp = ped_disk_next_partition(disk,temp);
 	
 
 	if (opts & UI_CUSTOM_VALUES || start != (*part)->geom.start || end != (*part)->geom.end)
-		if (!do_resize(disk,*part,start,end,opts)) {
+		if (!perform_resize(disk,*part,start,end,opts)) {
 			warning_waitkey(N_("Couldn't resize partition."));
 			/* Ooopsy */
 			if (!(opts & UI_NO_FS_RESIZE) && uiquery.need_commit)
 		return 0;
 	}
 	ped_constraint_destroy (constraint);
-	if (!do_move(disk,*part,start,end,opts)) {
+	if (!perform_move(disk,*part,start,end,opts)) {
 		warning_waitkey(N_("Partition move failed"));
 		/* Oooops */
 		if (uiquery.need_commit) _disk_reread(part);
 			warning_waitkey(buf);
 		}
 	}
-	if (!do_mkfs (disk, *part, type, UI_WARN_COMMIT)) {
+	if (!perform_mkfs (disk, *part, type, UI_WARN_COMMIT)) {
 		warning_waitkey(N_("Partition not formatted successfully"));
 		return 0;
 	}
 
 static int
 action_check (PedPartition **part) {
-	if (!do_check(disk,*part)) {
+	if (!perform_check(disk,*part)) {
 		warning_waitkey(N_("The consistency check failed."));
 		return 0;
 	}
 	if (temp && temp->type & PED_PARTITION_FREESPACE)
 		temp = disk_get_prev_nmd_partition(disk, temp); 
 #endif
-	if(!do_rescue (disk, (*part)->geom.start, (*part)->geom.end, 
+	if(!perform_rescue (disk, (*part)->geom.start, (*part)->geom.end, 
 	           UI_WARN_COMMIT | (key == 'c' ? UI_CUSTOM_VALUES : 0))) {
 		warning_waitkey(N_("There was an error during rescue"));
 		return 0;
 
 static int
 action_copy(PedPartition **part) {
-	if (!do_cp(disk,*part, UI_WARN_COMMIT)) {
+	if (!perform_cp(disk,*part, UI_WARN_COMMIT)) {
 		if (uiquery.need_commit) _disk_reread(part);
 		warning_waitkey(N_("Partition not copied successfully"));
 		return 0;
 
 	getbool(_("Do you want to delete this partition?"),&go);
 	if (!go) return 0;
-	if (!do_rm(disk,*part)) {
+	if (!perform_rm(disk,*part)) {
 		warning_waitkey(N_("Can't delete partition"));
 		return 0;
 	}
 
 static int
 action_maximize(PedPartition **part) {
-	if (!do_maximize(disk,*part)) {
+	if (!perform_maximize(disk,*part)) {
 		warning_waitkey(N_("Couldn't maximize this partition"));
 		return 0;
 	}
 
 static int
 action_commit () {
-	if (!do_commit(disk,UI_WARN_COMMIT)) {
+	if (!perform_commit(disk,UI_WARN_COMMIT)) {
 		warning_waitkey(N_("Commit failed."));
 		return 0;
 	} 
 		return 0;
 	else if (key == 'a')
 		type = ped_file_system_probe(&(*part)->geom);
-	if (!do_set_system(disk,*part,type)) {
+	if (!perform_set_system(disk,*part,type)) {
 		warning_waitkey(N_("Couldn't change the filesystem type"));
 		return 0;
 	}
 		warning_waitkey(N_("The partition label doesn't support partition names"));
 		return 0;
 	}
-	if (!do_name(disk,*part, NULL)) {
+	if (!perform_name(disk,*part, NULL)) {
 		warning_waitkey(N_("Name wasn't changed successfully."));
 		return 0;
 	} 
 				print_warning(_("Invalid key"),0);
 		}
 		else if (key == CR || key == ' ') {
-			do_set(disk,*part,selected,UI_FLAG_TOGGLE);
+			perform_set(disk,*part,selected,UI_FLAG_TOGGLE);
 			redraw = 1;
 		}
 		else 
 			ped_exception_leave_all();
 			menu_title(_("Cannot find a partition table on the disk"));
 			if ('c' == do_menu(custom_label, 8, MENU_BUTTON | MENU_TITLE, "cq", 0)) {
-				if (!do_mklabel (dev, &disk, NULL))
+				if (!perform_mklabel (dev, &disk, NULL))
 					do_quit(1,_("Creation of partition table failed"));
 			}
 			else do_quit (0,NULL);
 			ped_exception_leave_all();
 		}
 	} else {
-		if (!do_mklabel (dev, &disk, NULL))
+		if (!perform_mklabel (dev, &disk, NULL))
 			do_quit(1,_("Creation of partition table failed"));
 	}
 	//ped_unit_set_default(PED_UNIT_MEGABYTE);
 
 /* Check partition consistency */
 int
-do_check (PedDisk* disk, PedPartition* part)
+perform_check (PedDisk* disk, PedPartition* part)
 {
         PedFileSystem*  fs;
 	if (!part) {
    Writes partition table to disk */
 /* If warn is set to 1, warns the user TODO: get rid of warn */
 int
-do_cp (PedDisk* dst_disk, PedPartition* dst, UIOpts opts)
+perform_cp (PedDisk* dst_disk, PedPartition* dst, UIOpts opts)
 {
         PedDisk*                src_disk = NULL;
         PedPartition*           src = NULL;
 		(_("WARNING: This writes all data to disk automatically, continue?"))) 
 			return 0;
 	/* It doesn't hurt to commit at that point, right? */
-	if (uiquery->need_commit) if (!do_commit(dst_disk,UI_DEFAULT)) goto error;
+	if (uiquery->need_commit && !perform_commit(dst_disk,UI_DEFAULT)) goto error;
         
 
         src_disk = dst_disk;
    in addition it takes a label type, if NULL, queries... */
 
 int
-do_mklabel (PedDevice* dev, PedDisk** disk, const PedDiskType* type)
+perform_mklabel (PedDevice* dev, PedDisk** disk, const PedDiskType* type)
 {
 	/*
         ped_exception_fetch_all ();
 /* Create a filesystem. Takes filesystem type as an optional parameter */
 /* If warn is set to 1, warns the user TODO: get rid of warn */
 int
-do_mkfs (PedDisk* disk, PedPartition* part, const PedFileSystemType* type, UIOpts opts)
+perform_mkfs (PedDisk* disk, PedPartition* part, const PedFileSystemType* type, UIOpts opts)
 {
 
         PedFileSystem*          fs;
  * If the parameter newpart is not NULL, it is set to the newly created partition */
 /* NOTE: On some occassions it changes the *newpart to NULL! */
 int
-do_mkpart (PedDisk* disk, PedSector start, PedSector end, PedPartitionType part_type,
+perform_mkpart (PedDisk* disk, PedSector start, PedSector end, PedPartitionType part_type,
 	const PedFileSystemType* fs_type, PedPartition **newpart, UIOpts opts)
 {
 	PedGeometry		*range_start = NULL, *range_end = NULL;
 }
 
 int
-do_mkpartfs (PedDisk* disk, PedSector start, PedSector end, PedPartitionType part_type,
+perform_mkpartfs (PedDisk* disk, PedSector start, PedSector end, PedPartitionType part_type,
 	const PedFileSystemType* fs_type, PedPartition **newpart, UIOpts opts)
 {
 
                 if (!get_fs_type (_("File system type"), &fs_type, 1))
                         return 0;
         }
-	if (!do_mkpart(disk,start,end,part_type,fs_type,&part,opts))
+	if (!perform_mkpart(disk,start,end,part_type,fs_type,&part,opts))
 		return 0;
-	if (!do_mkfs(disk,part,fs_type,opts & ~UI_WARN_COMMIT))
+	if (!perform_mkfs(disk,part,fs_type,opts & ~UI_WARN_COMMIT))
 		return 0;
 	if (newpart) *newpart = part;
 	return 1;
 
 /* FIXME: This function seems to be problematic, deal with it appropriately in the ui */
 int
-do_move (PedDisk *disk, PedPartition *part, PedSector start, PedSector end, UIOpts opts)
+perform_move (PedDisk *disk, PedPartition *part, PedSector start, PedSector end, UIOpts opts)
 {
        
         PedFileSystem*  fs;
 	}
 	/* So the best we can do here is to commit */
 	if (uiquery->need_commit)
-		if (!do_commit(disk,UI_DEFAULT))
+		if (!perform_commit(disk,UI_DEFAULT))
 			goto error;
 	if (!part)
         	if (!get_partition (_("Partition"), disk, &part))
 }
 
 int
-do_name (PedDisk* disk, PedPartition* part, char *name)
+perform_name (PedDisk* disk, PedPartition* part, char *name)
 {
 	const char *temp;
 	int n;
 }
 
 int
-do_rescue (PedDisk* disk, PedSector start, PedSector end, UIOpts opts)
+perform_rescue (PedDisk* disk, PedSector start, PedSector end, UIOpts opts)
 {
 
         PedSector               fuzz;
 			return 0;
 	/* Why the hell I use two seperate ifs, instead of one? I wish I knew */
 	if (uiquery->need_commit)
-		if (!do_commit(disk,UI_DEFAULT))
+		if (!perform_commit(disk,UI_DEFAULT))
 			goto error;
         if (!get_sector (_("Start"), disk->dev, &start, NULL, opts & UI_CUSTOM_VALUES))
                 goto error;
 
 /* FIXME: It doesn't always work as expected */
 int
-do_resize (PedDisk *disk, PedPartition *part, PedSector start, PedSector end, UIOpts opts)
+perform_resize (PedDisk *disk, PedPartition *part, PedSector start, PedSector end, UIOpts opts)
 {
 
         PedFileSystem           *fs;
 		(_("WARNING: This writes all data to disk automatically, continue?"))) 
 			return 0;
 		if (uiquery->need_commit)
-			if (!do_commit(disk,UI_DEFAULT))
+			if (!perform_commit(disk,UI_DEFAULT))
 				goto error;
 	}
 
 }
 
 int
-do_rm (PedDisk* disk, PedPartition* part)
+perform_rm (PedDisk* disk, PedPartition* part)
 {
        
 
 }
 
 int
-do_maximize (PedDisk* disk, PedPartition* part)
+perform_maximize (PedDisk* disk, PedPartition* part)
 {
 	PedConstraint *constraint = NULL;
 	if (!disk)
 }
 
 int
-do_set_system (PedDisk* disk, PedPartition* part, const PedFileSystemType *type)
+perform_set_system (PedDisk* disk, PedPartition* part, const PedFileSystemType *type)
 {
 	if (!disk)
 		return 0;
 
 
 int
-do_set (PedDisk *disk, PedPartition *part, PedPartitionFlag flag, UIOpts opts)
+perform_set (PedDisk *disk, PedPartition *part, PedPartitionFlag flag, UIOpts opts)
 {
         int                     state;
 
 }
 
 int
-do_commit (PedDisk* disk, UIOpts opts)
+perform_commit (PedDisk* disk, UIOpts opts)
 {
 	if (opts & UI_WARN_COMMIT)
 		if (!ask_boolean_question 
 	UI_FUNCTION_SPECIFIC_1 = 8
 };
 
-/* Specific for do_resize: */
+/* Specific for perform_resize: */
 #define UI_NO_FS_RESIZE UI_FUNCTION_SPECIFIC_1	/* Will only change geometry */
-/* Specific for do_set: */
-#define UI_FLAG_TOGGLE UI_FUNCTION_SPECIFIC_1	/* do_set must toggle flags */
+/* Specific for perform_set: */
+#define UI_FLAG_TOGGLE UI_FUNCTION_SPECIFIC_1	/* perform_set must toggle flags */
 
 
 /* Setting of UICalls */
 /* NOTE: resize, move and perhaps copy are dangerous. Please, make your ui check their status.
    if they FAIL and leave need_commit to true, please reread the partition table from the device.
    Sorry for the inconvinience. I might change this in the future so that it is not needed */
-extern int do_check (PedDisk*, PedPartition*);
+extern int perform_check (PedDisk*, PedPartition*);
 /* The parameters are the *destination* disk and partition */
-extern int do_cp (PedDisk*, PedPartition*, UIOpts);
-extern int do_mklabel (PedDevice*, PedDisk**, const PedDiskType*);
+extern int perform_cp (PedDisk*, PedPartition*, UIOpts);
+extern int perform_mklabel (PedDevice*, PedDisk**, const PedDiskType*);
 
-extern int do_mkfs (PedDisk*, PedPartition*, const PedFileSystemType*, UIOpts);
+extern int perform_mkfs (PedDisk*, PedPartition*, const PedFileSystemType*, UIOpts);
 
-extern int do_mkpart (PedDisk*, PedSector start, PedSector end,
+extern int perform_mkpart (PedDisk*, PedSector start, PedSector end,
                       PedPartitionType,	const PedFileSystemType*,
                       PedPartition **newpart, UIOpts);
 
-extern int do_mkpartfs (PedDisk*, PedSector start, PedSector end,
+extern int perform_mkpartfs (PedDisk*, PedSector start, PedSector end,
                         PedPartitionType, const PedFileSystemType*,
                         PedPartition **newpart, UIOpts);
 
-extern int do_move (PedDisk*, PedPartition*, PedSector start, PedSector end,
+extern int perform_move (PedDisk*, PedPartition*, PedSector start, PedSector end,
                     UIOpts);
-extern int do_name (PedDisk*, PedPartition*, char*);
-extern int do_rescue (PedDisk*, PedSector start, PedSector end, UIOpts);
-extern int do_resize (PedDisk*, PedPartition*, PedSector start, PedSector end,
+extern int perform_name (PedDisk*, PedPartition*, char*);
+extern int perform_rescue (PedDisk*, PedSector start, PedSector end, UIOpts);
+extern int perform_resize (PedDisk*, PedPartition*, PedSector start, PedSector end,
                       UIOpts);
-extern int do_rm (PedDisk*, PedPartition*);
-extern int do_set_system (PedDisk*, PedPartition*, const PedFileSystemType*);
-extern int do_set (PedDisk*, PedPartition*, PedPartitionFlag, UIOpts);
-extern int do_commit (PedDisk*, UIOpts);
-extern int do_maximize (PedDisk*, PedPartition*);
+extern int perform_rm (PedDisk*, PedPartition*);
+extern int perform_set_system (PedDisk*, PedPartition*, const PedFileSystemType*);
+extern int perform_set (PedDisk*, PedPartition*, PedPartitionFlag, UIOpts);
+extern int perform_commit (PedDisk*, UIOpts);
+extern int perform_maximize (PedDisk*, PedPartition*);
 
 /* Additional functions */
 extern char* partition_print_flags (PedPartition*);
 #include <stdint.h>
 #include <sys/stat.h>
 #include "hacks.h"
+#include "sys_types.h"
 
 #define MSDOS_HACK 1
 #define MAC_HACK 1
 #define SUN_HACK 1
-#define BSD_HACK 0
+#define BSD_HACK 1
 #define DVH_HACK 0
 #define GPT_HACK 0 /* No, thank you */
 #define PC98_HACK 0
 #define AMIGA_HACK 0
 
+/* FIXME: As the file is needed for lfdisk, calling it "hacks" might
+ * not be the greatest idea
+ */
+
 /* Check if it is a block device. Returns -1 if not found. */
 int is_blockdev(const char *file) {
 	struct stat file_stat;
 	if (!part->disk_specific) return NULL;
 	#if MSDOS_HACK
 	if (!strcmp(part->disk->type->name,"msdos")) {
+		int i;
 		DosPartitionData *pdata = (DosPartitionData *) part->disk_specific;
-		switch (pdata->system) {
-			/* TODO: I don't like some of the strings, change them */
-			case 0x00: return NULL;//return "Empty";
-			case 0x01: return "FAT12";
-			case 0x02: return "XENIX root";
-			case 0x03: return "XENIX usr";
-			case 0x04: return "Small FAT16";
-			case 0x05: return NULL;//return "Extended";
-			case 0x06: return "FAT16";
-			case 0x07: return "HPFS/NTFS";
-			case 0x08: return "AIX";
-			case 0x09: return "AIX bootable";
-			case 0x0a: return "OS/2 boot mgr";
-			case 0x0b: return "FAT32";
-			case 0x0c: return "FAT32 LBA";
-			case 0x0e: return "FAT16 LBA";
-			case 0x0f: return "Extended LBA";
-			case 0x10: return "OPUS";
-			case 0x11: return "Hidden FAT12";
-			case 0x12: return "Compaq diag";
-			case 0x14: return "Hidd Sm FAT16";
-			case 0x16: return "Hidd FAT16";
-			case 0x17: return "Hidd HPFS/NTFS";
-			case 0x18: return "AST SmartSleep";
-			case 0x1b: return "Hidd FAT32";
-			case 0x1c: return "Hidd FAT32 LBA";
-			case 0x1e: return "Hidd FAT16 LBA";
-			case 0x24: return "NEC DOS";
-			case 0x39: return "Plan 9";
-			case 0x3c: return "PMagic recovery";
-			case 0x40: return "Venix 80286";
-			case 0x41: return "PPC PReP Boot";
-			case 0x42: return "SFS";
-			case 0x4d: return "QNX4.x";
-			case 0x4e: return "QNX4.x 2nd part";
-			case 0x4f: return "QNX4.x 3rd part";
-			case 0x50: return "OnTrack DM";
-			case 0x51: return "OnTrackDM6 Aux1";
-			case 0x52: return "CP/M";
-			case 0x53: return "OnTrackDM6 Aux3";
-			case 0x54: return "OnTrack DM6";
-			case 0x55: return "EZ Drive";
-			case 0x56: return "Golden Bow";
-			case 0x5c: return "Priam Edisk";
-			case 0x61: return "SpeedStor";
-			case 0x63: return "GNU HURD/SysV";
-			case 0x64: return "Netware 286";
-			case 0x65: return "Netware 386";
-			case 0x70: return "DiskSec MltBoot";
-			case 0x75: return "PC/IX";
-			case 0x80: return "Minix <1.4a";
-			case 0x81: return "Minix >1.4b";
-			case 0x82: return "Linux swap";
-			case 0x83: return "Linux";
-			case 0x84: return "OS/2 hidden C:";
-			case 0x85: return "Linux extended";
-			case 0x86:
-			case 0x87: return "NTFS volume set";
-			case 0x88: return "Linux plaintext";
-			case 0x8e: return "Linux LVM";
-			case 0x93: return "Amoeba";
-			case 0x94: return "Amoeba BBT"; /*This guys created a seperate partition for badblocks?! */
-			case 0x9f: return "BSD/OS";
-			case 0xa0: return "Thinkpad hib";
-			case 0xa5: return "FreeBSD";
-			case 0xa6: return "OpenBSD";
-			case 0xa7: return "NeXTSTEP";
-			case 0xa8: return "Darwin UFS";
-			case 0xa9: return "NetBSD";
-			case 0xab: return "Darwin boot";
-			case 0xb7: return "BSDI fs";
-			case 0xb8: return "BSDI swap";
-			case 0xbb: return "Boot Wizard Hid"; /* Beware of the hidden wizard */
-			case 0xbe: return "Solaris boot";
-			case 0xbf: return "Solaris";
-			case 0xc1: return "DRDOS/2 FAT12";
-			case 0xc4: return "DRDOS/2 smFAT16";
-			case 0xc6: return "DRDOS/2 FAT16";
-			case 0xc7: return "Syrinx"; /* Reminds me of Rush - 2112 */
-			case 0xda: return "Non-FS data"; /* Whatever... */
-			case 0xdb: return "CP/M / CTOS";
-			case 0xde: return "Dell Utility";
-			case 0xdf: return "BootIt"; /* Should 0x20 be DontBootIt then? */
-			case 0xe1: return "DOS access";
-			case 0xe3: return "DOS R/O";
-			case 0xe4: return "SpeedStor"; /*I sense some strange déjà vu */
-			case 0xeb: return "BeOS fs";
-			case 0xee: return "EFI GPT";
-			case 0xef: return "EFI FAT";
-			case 0xf0: return "Lnx/PA-RISC bt";
-			case 0xf1: return "SpeedStor";
-			case 0xf2: return "DOS secondary";
-			case 0xf4: return "SpeedStor"; /* Are these guys trying for a Guinness record or something? */
-			case 0xfd: return "Lnx RAID auto";
-			case 0xfe: return "LANstep";
-			case 0xff: return "XENIX BBT";
-			default: return NULL;
+		for (i = 0; msdos_systypes[i].name; i++) {
+			if(msdos_systypes[i].type == pdata->system) {
+				return msdos_systypes[i].name;
+			}
 		}
 	}
 	else

tests/check_advanced.c

 		unlink_tempfile();
 		fail("Could not open the tempfile");
 	}
-	if (mklabel && !do_mklabel(dev,&disk,ped_disk_type_get("msdos")))
+	if (mklabel && !perform_mklabel(dev,&disk,ped_disk_type_get("msdos")))
 		fail("Could not create a label on the tempfile");
 	
 }
 	PedSector oldstart,oldend;
 	fail_unless(_mkpart (0, start,  end,
 				PED_PARTITION_NORMAL,
- 				fs_type, &part, do_mkpartfs),
+ 				fs_type, &part, perform_mkpartfs),
 	            "Failed to create the partition");
 	/* We seed and move 16 times */
 	srand(173813981);
 		                    "to %llds-%llds in %llds-%llds",
 		                     i, oldstart, oldend, start, end,
 		                     where.start, where.end);
-		fail_unless(_resmov(i, part, start, end, UI_DEFAULT, do_move),
+		fail_unless(_resmov(i, part, start, end, UI_DEFAULT,
+		                    perform_move),
 		            "Failed to move %d partition "
 		            "from %llds-%llds to %llds-%llds in %llds-%llds",
 		            i, oldstart, oldend, start, end,
 	PedFileSystemType *fs_type = ped_file_system_type_get("fat32");
 	open_tempfile(0);
 	/* Why not amiga? */
-	fail_unless(do_mklabel(dev,&disk,ped_disk_type_get("msdos")),
+	fail_unless(perform_mklabel(dev,&disk,ped_disk_type_get("msdos")),
 	            "Failed to create partition table for partition copy");
 	PedConstraint *constraint = ped_device_get_constraint(dev);
 	
 			"%llds-%llds", i, geom->start, geom->end);
 		fail_unless(_mkpart (0, geom->start,  geom->end,
 				PED_PARTITION_NORMAL,
- 				fs_type, &part, do_mkpart),
+ 				fs_type, &part, perform_mkpart),
 			"Failed to create %d partition for copy. "
 			"Size %llds, start %llds, end %llds",
 			i, geom->length, geom->start, geom->end);
 		integer = i+1;
 		set_exception_error("Copying %d to %llds-%llds",
 		                    i, part->geom.start, part->geom.end);
-		fail_unless(do_cp (disk, part, UI_DEFAULT), 
+		fail_unless(perform_cp (disk, part, UI_DEFAULT), 
 		            "%d partition copy failed (from %llds-%llds "
 		            "to %llds-%llds)", i, 0LL, 0LL, part->geom.start,
 		            part->geom.end);
 	/* Now we try to copy from a partition on the same disk */
 	device = dev;
 	integer = 1;
-	fail_unless(do_cp (disk, part, UI_DEFAULT), 
+	fail_unless(perform_cp (disk, part, UI_DEFAULT), 
 	            "Partition copy on a single disk failed");
 	ped_disk_destroy(disk2);
 	ped_device_destroy(dev2);
 /* I'm lazy to type too much, so */
 #define CREATE_PART(num,start,end) \
 	fail_unless(_mkpart(0, start, end, PED_PARTITION_NORMAL, \
-	                    fs_type, NULL, do_mkpartfs), \
+	                    fs_type, NULL, perform_mkpartfs), \
 	            "Failed to create num partition for rescue")
 /* This does not take any additional disk space */
 START_TEST (test_rescue) {
 		PedPartition *temp = part;
 		part = part->prev;
 		if (!temp->type) {
-			fail_unless(do_rm(disk, part),
+			fail_unless(perform_rm(disk, part),
 			            "Rescue could not delete %d partition",
 			            part->num);
 		}
 	}
 	
 	/* Then we try to undelete the last one */
-	fail_unless(do_rescue(disk, geom.start, geom.end, UI_DEFAULT),
+	fail_unless(perform_rescue(disk, geom.start, geom.end, UI_DEFAULT),
 	            "Failed to rescue a single partition at %llds-%llds",
 	            geom.start, geom.end);
 	/* part should be the undeleted partition */
                     "Deleted was %llds-%llds, we got %llds-%llds.",
 	            geom.start, geom.end, part->geom.start, part->geom.end);
 	/* We delete it again and try to rescue all */
-	fail_unless(do_rm(disk, part),
+	fail_unless(perform_rm(disk, part),
 	            "Rescue could not delete %d partition",
 	            part->num);
 
 	/* The end of the last partition is before 8388604s */
-	fail_unless(do_rescue(disk, 0LL, geom.end, UI_DEFAULT),
+	fail_unless(perform_rescue(disk, 0LL, geom.end, UI_DEFAULT),
 	            "Failed to rescue the partitions");
 	/* Now we count them, if they aren't four, we did something wrong */
 	for (part = ped_disk_next_partition(disk,NULL), i = 0;

tests/check_common.c

 	/* First we will test with giving it the string */
 	uiquery.getstring = getstring;
 	uiquery.getdisktype = NULL;
-	fail_unless (do_mklabel(dev, &disk, NULL), 
+	fail_unless (perform_mklabel(dev, &disk, NULL), 
 	             "Failed to create a label with a getstring query");
 	fail_unless (disk != NULL, "mklabel reported success, but failed");
 	fail_unless (!strcmp(string[0],disk->type->name),
 	/* Then we do it the other way */
 	uiquery.getstring = NULL;
 	uiquery.getdisktype = getdisktype;
-	fail_unless (do_mklabel(dev,&disk, NULL),
+	fail_unless (perform_mklabel(dev,&disk, NULL),
 	             "Failed to create a label with a getdisktype query");
 	fail_unless (disk != NULL,
 	             "mklabel reported success, but failed, getdisktype");
 	disk = NULL;
 	/* Then we do it the third way */	
 	uiquery.getdisktype = NULL;
-	fail_unless (do_mklabel(dev,&disk,disk_type),
+	fail_unless (perform_mklabel(dev,&disk,disk_type),
 	             "Failed to create a label with a specified type");
 	fail_unless (disk != NULL,
 	             "mklabel reported success, but failed, specified");
 	int i;
 	/* First we create an extended partition */
 	//set_exception_error("Juggling partitions");
-	fail_unless(do_mklabel(dev,&disk,ped_disk_type_get("msdos")),
+	fail_unless(perform_mklabel(dev,&disk,ped_disk_type_get("msdos")),
 	            "We could create the label for juggling partitions");
-	fail_unless(do_mkpart(disk,0LL,20000LL,PED_PARTITION_EXTENDED,NULL,NULL,
+	fail_unless(perform_mkpart(disk,0LL,20000LL,PED_PARTITION_EXTENDED,NULL,NULL,
 	                      UI_DEFAULT),
 	            "Failed to create an extended partition");
 
 	fail_unless(part != NULL, "Can't find the extended partition");
 
 	/* Then we maximize it */
-	fail_unless(do_maximize(disk,part), "Could not maximize the extended");
+	fail_unless(perform_maximize(disk,part), "Could not maximize the extended");
 
 	/* We check if our partition is "near" to what they should */
 	fail_unless(are_near(constraint->start_range->start,part->geom.start)
 	/* We first try to create 20 partitions */
 	for (i = 0; i < 20; i++) {
 		next_part_geometry(&geom, constraint, 1);
-		fail_unless(_mkpart (i, geom->start,  geom->end,
-				PED_PARTITION_LOGICAL, walk, &part, do_mkpart),
+		fail_unless(_mkpart (i, geom->start,  geom->end, 
+			             PED_PARTITION_LOGICAL, walk, &part,
+			             perform_mkpart),
 			"Failed to create %s partition. "
 			"Number %d, size %llds, start %llds, end %llds",
 			walk->name, i, geom->length, geom->start, geom->end);
 		if (part && (part->type & PED_PARTITION_FREESPACE))
 			fail("We reached a hole at %llds-%llds, number %d",
 			     part->geom.start, part->geom.end, i);
-		fail_unless (do_rm(disk,temp),
+		fail_unless (perform_rm(disk,temp),
 		             "Failed to delete partition after %d",
 		             (part ? part->num : -1));
 		i--;
 
 
 /* TODO: This fails on dvh and mac.  Figure out why. */
-/* Here we test (*only*) the size changing with do_resize */
+/* Here we test (*only*) the size changing with perform_resize */
 START_TEST (test_chsize_msdos) {
 	change_size("msdos", UI_NO_FS_RESIZE);
 	test_exception();

tests/functions.c

 	PedPartition *part = NULL;
 	PedFileSystemType *fs_type = ped_file_system_type_get("fat32");
 	int i;
-	fail_unless(do_mklabel(dev,&disk,ped_disk_type_get(ltype)),
+	fail_unless(perform_mklabel(dev,&disk,ped_disk_type_get(ltype)),
 	            "We could create the %s label for resizing partitions",
 	            ltype);
 	/* NOTE: This might blow up if ltype is less than three chars */
 		fail_unless(_mkpart (0, geom->start,  geom->end,
 				PED_PARTITION_NORMAL,
  				fs_type, &part, (opts & UI_NO_FS_RESIZE ?
-				                 do_mkpart : do_mkpartfs)),
+				           perform_mkpart : perform_mkpartfs)),
 			"Failed to create partition for resize on %s. "
 			"Number %d, size %llds, start %llds, end %llds",
 			ltype, i, geom->length, geom->start, geom->end);
 			   types, and when we are querying the user,
 			   exact values should be used... Or? FIXME? */
 			//fail_unless(_resmov (strncmp("ms",ltype,2) ? 0 : i, 
-			fail_unless(_resmov (i,
-			                     part, start, end, opts, do_resize),
+			fail_unless(_resmov (i, part, start,
+			                     end, opts, perform_resize),
 			            "Could not do %d resize of partition %d "
 			            "from %llds-%llds to %llds-%llds "
 			            "in region %llds-%llds on %s",
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.