]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: move mbr code to the library
authorKarel Zak <kzak@redhat.com>
Wed, 26 Jun 2013 08:21:31 +0000 (10:21 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 16 Sep 2013 14:47:04 +0000 (16:47 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
12 files changed:
fdisks/Makemodule.am
fdisks/cfdisk.c
fdisks/fdisk-menu.c
fdisks/fdisk.c
fdisks/fdiskbsdlabel.c
fdisks/fdiskdoslabel.h [deleted file]
fdisks/sfdisk.c
include/Makemodule.am
include/pt-mbr-partnames.h [moved from fdisks/dos_part_types.h with 100% similarity]
libfdisk/src/Makemodule.am
libfdisk/src/dos.c [moved from fdisks/fdiskdoslabel.c with 99% similarity]
libfdisk/src/libfdisk.h

index 3c07461583f1bf9844124ceb76559688c7edd6be..fa5dcdfd91c45022feb7fd5888b1ca6b915d5a63 100644 (file)
@@ -5,14 +5,11 @@ if BUILD_FDISK
 sbin_PROGRAMS += fdisk
 dist_man_MANS += fdisks/fdisk.8
 fdisk_SOURCES = \
-       fdisks/dos_part_types.h \
        fdisks/fdisk.c \
        fdisks/fdisk.h \
        fdisks/fdisk-ask.c \
        fdisks/fdiskbsdlabel.c \
        fdisks/fdiskbsdlabel.h \
-       fdisks/fdiskdoslabel.c \
-       fdisks/fdiskdoslabel.h \
        fdisks/fdisk-menu.c \
        fdisks/partname.c \
        fdisks/common.h
index ee03cd9f562c4be8d0f1c50c257ca272ad29501e..bc9c1596042988e953339e0787e5f2c8672412f2 100644 (file)
@@ -112,7 +112,7 @@ struct systypes {
 };
 
 static struct systypes i386_sys_types[] = {
-       #include "dos_part_types.h"
+       #include "pt-mbr-partnames.h"
 };
 
 #ifdef __GNU__
index 4096fed8ac30e8bb2a74bc4802fbc616821508cf..541e00d488375c3f1231b1418ddf5615803c20a4 100644 (file)
@@ -10,7 +10,6 @@
 #include "pt-sun.h"
 #include "pt-mbr.h"
 
-#include "fdiskdoslabel.h"
 #include "fdiskbsdlabel.h"
 
 struct menu_entry {
index 60c69d1f38feb548b31c4c1ed33d477f92805a7b..0ca88894371993dd69514cb4b17de155e834f10e 100644 (file)
@@ -37,7 +37,6 @@
 #include "closestream.h"
 
 #include "pt-sun.h"            /* to toggle flags */
-#include "fdiskdoslabel.h"
 #include "fdiskbsdlabel.h"
 
 #ifdef HAVE_LINUX_COMPILER_H
index 6194afda449c683469e8e23b904d7f32907a8380..bd1d77501070a93e19fe22f689cecf31fda6e1e3 100644 (file)
@@ -62,7 +62,6 @@
 #define NETBSD_PARTITION       0xa9
 #define DKTYPENAMES
 #include "fdiskbsdlabel.h"
-#include "fdiskdoslabel.h"
 #include "all-io.h"
 
 /*
diff --git a/fdisks/fdiskdoslabel.h b/fdisks/fdiskdoslabel.h
deleted file mode 100644 (file)
index 53fa58b..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef FDISK_DOS_LABEL_H
-#define FDISK_DOS_LABEL_H
-
-extern struct dos_partition *fdisk_dos_get_partition(
-                               struct fdisk_context *cxt,
-                               size_t i);
-
-extern int fdisk_dos_fix_order(struct fdisk_context *cxt);
-extern int fdisk_dos_move_begin(struct fdisk_context *cxt, int i);
-extern int fdisk_dos_list_extended(struct fdisk_context *cxt);
-
-/* toggle flags */
-#define DOS_FLAG_ACTIVE        1
-
-#endif
index 152e5f591da1f0ad0d841b32ddf12f1463065747..b078fc2e6a015f8bc7694850a5b91c14ad546287 100644 (file)
@@ -60,7 +60,7 @@ struct systypes {
 };
 
 static struct systypes i386_sys_types[] = {
-       #include "dos_part_types.h"
+       #include "pt-mbr-partnames.h"
 };
 
 /*
index ab2360338212fec0934bc400535a8b0e09d8f8da..73f0a7d43c151213ad0362049a750ec54e9e8256 100644 (file)
@@ -50,4 +50,5 @@ dist_noinst_HEADERS += \
        include/xgetpass.h \
        include/pt-sgi.h \
        include/pt-mbr.h \
+       include/pt-mbr-partnames.h \
        include/pt-sun.h
index 5363a5ec156547f721829639add44b572efa28ce..2dd90eeb36c6dc56fd1f813b8d1738ebd2754882 100644 (file)
@@ -20,6 +20,7 @@ libfdisk_la_SOURCES = \
        \
        libfdisk/src/sun.c \
        libfdisk/src/sgi.c \
+       libfdisk/src/dos.c \
        libfdisk/src/gpt.c
 
 
similarity index 99%
rename from fdisks/fdiskdoslabel.c
rename to libfdisk/src/dos.c
index e4ee6a4fbc0c6448589cffb359d4d82d9f304cf1..ef426cfa10d8d8b8500944d98e7514d7e0e70ebe 100644 (file)
@@ -1,6 +1,7 @@
 /*
  *
- * Copyright (C) 2013 Karel Zak <kzak@redhat.com>
+ * Copyright (C) 2007-2013 Karel Zak <kzak@redhat.com>
+ *                    2012 Davidlohr Bueso <dave@gnu.org>
  *
  * This is re-written version for libfdisk, the original was fdiskdoslabel.c
  * from util-linux fdisk.
@@ -8,13 +9,10 @@
 #include "c.h"
 #include "nls.h"
 #include "randutils.h"
-#include "common.h"
 #include "pt-mbr.h"
 
 #include "fdiskP.h"
 
-#include "fdiskdoslabel.h"
-
 #include <ctype.h>
 
 #define MAXIMUM_PARTS  60
@@ -61,7 +59,7 @@ struct fdisk_dos_label {
  * Partition types
  */
 static struct fdisk_parttype dos_parttypes[] = {
-       #include "dos_part_types.h"
+       #include "pt-mbr-partnames.h"
 };
 
 #define set_hsc(h,s,c,sector) { \
@@ -147,7 +145,6 @@ static int is_cleared_partition(struct dos_partition *p)
                 dos_partition_get_start(p) || dos_partition_get_size(p));
 }
 
-
 static int get_partition_unused_primary(struct fdisk_context *cxt)
 {
        size_t orgmax = cxt->label->nparts_max;
index 1d824177e9a1d6d9aef3b186a2c47767fad56b26..4da9e499501b9044b89892239e14f179b3770e15 100644 (file)
@@ -184,6 +184,17 @@ extern int sgi_create_info(struct fdisk_context *cxt);
 extern int fdisk_gpt_partition_set_uuid(struct fdisk_context *cxt, size_t i);
 extern int fdisk_gpt_partition_set_name(struct fdisk_context *cxt, size_t i);
 
+/* dos.c */
+extern struct dos_partition *fdisk_dos_get_partition(
+                               struct fdisk_context *cxt,
+                               size_t i);
+
+extern int fdisk_dos_fix_order(struct fdisk_context *cxt);
+extern int fdisk_dos_move_begin(struct fdisk_context *cxt, int i);
+extern int fdisk_dos_list_extended(struct fdisk_context *cxt);
+
+#define DOS_FLAG_ACTIVE        1
+
 /* ask.c */
 #define fdisk_is_ask(a, x) (fdisk_ask_get_type(a) == FDISK_ASKTYPE_ ## x)