[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cdi-devel] [PATCH] Header cleanups



There were CDI headers which included stdio.h and sys/types.h and used
types of these header files. Usage of both headers is not permissible in
the context of CDI, so replace them by standard types.

Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
---
 include/cdi-osdep.h |   11 +++++++++++
 include/cdi/dma.h   |    7 +++----
 include/cdi/fs.h    |   18 +++++++-----------
 iso9660/init.c      |    1 +
 serial/res.c        |    1 +
 5 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/include/cdi-osdep.h b/include/cdi-osdep.h
index 279001a..726aab0 100644
--- a/include/cdi-osdep.h
+++ b/include/cdi-osdep.h
@@ -67,4 +67,15 @@ typedef struct
 typedef struct {
 } cdi_mem_osdep;
 
+/**
+ * \german
+ * OS-spezifische Daten fuer Dateisysteme
+ * \endgerman
+ * \english
+ * OS-specific data for file systems
+ * \endenglish
+ */
+typedef struct {
+} cdi_fs_osdep;
+
 #endif
diff --git a/include/cdi/dma.h b/include/cdi/dma.h
index 9a33a86..ecc3811 100644
--- a/include/cdi/dma.h
+++ b/include/cdi/dma.h
@@ -2,17 +2,16 @@
  * Copyright (c) 2007 Antoine Kaufmann
  *
  * This program is free software. It comes without any warranty, to
- * the extent permitted by applicable law. You can redistribute it 
- * and/or modify it under the terms of the Do What The Fuck You Want 
+ * the extent permitted by applicable law. You can redistribute it
+ * and/or modify it under the terms of the Do What The Fuck You Want
  * To Public License, Version 2, as published by Sam Hocevar. See
  * http://sam.zoy.org/projects/COPYING.WTFPL for more details.
- */  
+ */
 
 #ifndef _CDI_DMA_H_
 #define _CDI_DMA_H_
 
 #include <stdint.h>
-#include <stdio.h>
 
 #include <cdi.h>
 #include <cdi-osdep.h>
diff --git a/include/cdi/fs.h b/include/cdi/fs.h
index 6a9f3eb..31ef4a0 100644
--- a/include/cdi/fs.h
+++ b/include/cdi/fs.h
@@ -17,14 +17,10 @@
 #ifndef _CDI_FS_
 #define _CDI_FS_
 
-#include <stdio.h>
-
 #include <cdi.h>
 #include <cdi/lists.h>
 #include <cdi/cache.h>
 
-#include <sys/types.h>
-
 struct cdi_fs_filesystem;
 /**
  * Diese Struktur wird fuer jeden Dateisystemtreiber einmal erstellt
@@ -82,13 +78,13 @@ struct cdi_fs_filesystem {
      */
 
 
-    /** OS-spezifisch: Deskriptor fuer den Datentraeger */
-    FILE*                   device;
-
     /**
      * Zeiger den der Treiber fuer eigene Daten zum Dateisystem benutzen kann
      */
     void*                   opaque;
+
+    /** OS-spezifische Daten */
+    cdi_fs_osdep            osdep;
 };
 
 
@@ -541,7 +537,7 @@ struct cdi_fs_res_special {
      *
      * @return Falls die Geraeteadresse erfolgreich gelesen wurde 1, sonst 0
      */
-    int (*dev_read)(struct cdi_fs_stream* stream, dev_t* dev);
+    int (*dev_read)(struct cdi_fs_stream* stream, uint64_t* dev);
 
     /**
      * Geraeteadresse der Spezialdatei Aendern
@@ -551,7 +547,7 @@ struct cdi_fs_res_special {
      *
      * @return Falls die Geraeteadresse erfolgreich geaendert wurde 1, sonst 0
      */
-    int (*dev_write)(struct cdi_fs_stream* stream, dev_t dev);
+    int (*dev_write)(struct cdi_fs_stream* stream, uint64_t dev);
 };
 
 
@@ -593,7 +589,7 @@ struct cdi_fs_acl_entry_usr_num {
     struct cdi_fs_acl_entry entry;
 
     /** Benutzer-ID */
-    uid_t                   user_id;
+    int                     user_id;
 };
 
 struct cdi_fs_acl_entry_usr_str {
@@ -607,7 +603,7 @@ struct cdi_fs_acl_entry_grp_num {
     struct cdi_fs_acl_entry entry;
 
     /** Gruppen-ID */
-    gid_t                   group_id;
+    int                     group_id;
 };
 
 struct cdi_fs_acl_entry_grp_str {
diff --git a/iso9660/init.c b/iso9660/init.c
index 641d4f3..81aa7ab 100644
--- a/iso9660/init.c
+++ b/iso9660/init.c
@@ -17,6 +17,7 @@
 */
 
 #include <stdlib.h>
+#include <stdio.h>
 
 #include "cdi/fs.h"
 #include "cdi/cache.h"
diff --git a/serial/res.c b/serial/res.c
index ae32487..b611d85 100644
--- a/serial/res.c
+++ b/serial/res.c
@@ -26,6 +26,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <stdio.h>
 #include <string.h>
 
 #include "serial_cdi.h"
-- 
1.6.0.2