]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: add context functions
authorKarel Zak <kzak@redhat.com>
Thu, 6 Dec 2012 14:17:53 +0000 (15:17 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 11 Mar 2013 11:46:37 +0000 (12:46 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
fdisks/Makemodule.am
fdisks/fdisk.h
libfdisk/src/Makemodule.am
libfdisk/src/context.c [moved from fdisks/utils.c with 60% similarity]
libfdisk/src/libfdisk.h

index 69445354297c6d21be1ee9c3e2669a4fb977f74f..442d4bf0c634900c15f36d47a57b0d46a6f107c0 100644 (file)
@@ -22,7 +22,6 @@ fdisk_SOURCES = \
        fdisks/gpt.c \
        fdisks/gpt.h \
        fdisks/partname.c \
-       fdisks/utils.c \
        fdisks/common.h
 
 fdisk_LDADD = $(LDADD) libcommon.la libfdisk.la
index c8d5aab91453ab8f9f8d6fdd4bf1b01123daf04f..ec20837df203f7be551e4d7adaede4c09690daf8 100644 (file)
@@ -63,8 +63,6 @@ enum failure {
 /*
  * labels
  */
-extern struct fdisk_context *fdisk_new_context_from_filename(const char *fname, int readonly);
-extern void fdisk_free_context(struct fdisk_context *cxt);
 extern struct fdisk_parttype *fdisk_get_partition_type(struct fdisk_context *cxt, int partnum);
 extern int fdisk_set_partition_type(struct fdisk_context *cxt, int partnum,
                             struct fdisk_parttype *t);
index 639a3d2f00f7f1e5f39480021e0b99063a7bf5d9..4f9048e90a658a41ca2dca34b978c3803f0690da 100644 (file)
@@ -12,6 +12,7 @@ libfdisk_la_SOURCES = \
        libfdisk/src/alignment.c \
        libfdisk/src/label.c \
        libfdisk/src/utils.c \
+       libfdisk/src/context.c \
        libfdisk/src/parttype.c
 
 
similarity index 60%
rename from fdisks/utils.c
rename to libfdisk/src/context.c
index 3a6332f2ea1105943768bca5ff51c0947852dcb9..302020590d9141ba3f3ab16e80dff7aa2fb9b445 100644 (file)
@@ -1,39 +1,5 @@
-/*
- *  Copyright (C) 2012 Davidlohr Bueso <dave@gnu.org>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <ctype.h>
-#ifdef HAVE_LIBBLKID
-#include <blkid.h>
-#endif
 
-#include "nls.h"
-#include "blkdev.h"
-#include "common.h"
-#include "fdisk.h"
-
-#include "fdiskdoslabel.h"
-#include "fdisksunlabel.h"
-
-int fdisk_debug_mask;
+#include "fdiskP.h"
 
 /**
  * fdisk_new_context:
@@ -110,6 +76,3 @@ void fdisk_free_context(struct fdisk_context *cxt)
        free(cxt->firstsector);
        free(cxt);
 }
-
-
-
index 08df05bed4c1591cf9e5a9a33a933c1b29f7b686..276f79b83e25833b54c503d0471d31c34ed0ecf5 100644 (file)
@@ -45,6 +45,11 @@ enum fdisk_labeltype {
 /* init.c */
 extern void fdisk_init_debug(int mask);
 
+/* context.h */
+extern struct fdisk_context *fdisk_new_context_from_filename(
+                               const char *fname, int readonly);
+extern void fdisk_free_context(struct fdisk_context *cxt);
+
 /* parttype.c */
 extern struct fdisk_parttype *fdisk_get_parttype_from_code(struct fdisk_context *cxt,
                                 unsigned int code);