[DVDnav-discuss] [PATCH] clean up header mess

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Tue Dec 30 16:10:17 CET 2008


On Tue, Dec 30, 2008 at 03:01:51PM +0100, Nico Sabbi wrote:
> Il giorno mar, 30/12/2008 alle 14.41 +0100, Reimar Döffinger ha scritto:
> > On Tue, Dec 30, 2008 at 02:21:22PM +0100, Reimar Döffinger wrote:
> > > I think the way headers are currently are a mess, it needs that ugly
> > > -DDVDNAV_COMPILE and it makes it impossible to use dvdnav directly from
> > > the directory where it was compiled without installing (which is also a
> > > useful feature for directly integrating dvdnav into a project like it is
> > > done for dvdread in MPlayer).
> > > The patch looks a bit ugly, but the most it does is moving the dvdnav.h,
> > > dvd_types.h and dvdnav_events.h headers into a dvdnav subdirectory (if
> > > only svn diff could display file moves in a readable way!),
> > > adjusts the paths in the includes and makes dvdnav.h always include
> > > dvd_types.h and dvdnav_events.h which means quite a few #includes can be
> > > removed.
> > > If this looks ok, I'd like to do the same with dvdread and hopefully
> > > soon replacing the MPlayer copy with an svn external somewhen...
> > 
> > For better readability and because the other mail got stuck in
> > moderation due to size, here the patch with the parts removed that
> > show the three moved headers being removed from src/.
> > 
> 
> ok to commit anytime. Thanks

Applied. Attached is the patch for dvdread, again all public headers
moved into dvdread/.
Adding -I$(SOURCE)/dvdread to build flags would require less changes to
the code - on the other hand it is more consistent and easier to
integrate this way.
Integration in MPlayer looks like it should be smooth, except that I
decided to try on Windows first and I have a make version that currently
can't build MPlayer at all there. Grrr...

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: src/dvd_reader.c
===================================================================
--- src/dvd_reader.c	(revision 1159)
+++ src/dvd_reader.c	(working copy)
@@ -65,9 +65,9 @@
 #include <mntent.h>
 #endif
 
-#include "dvd_udf.h"
+#include "dvdread/dvd_udf.h"
 #include "dvd_input.h"
-#include "dvd_reader.h"
+#include "dvdread/dvd_reader.h"
 #include "md5.h"
 
 #define DEFAULT_UDF_CACHE_LEVEL 1
Index: src/nav_print.c
===================================================================
--- src/nav_print.c	(revision 1159)
+++ src/nav_print.c	(working copy)
@@ -28,9 +28,9 @@
 #include <stdio.h>
 #include <inttypes.h>
 
-#include "nav_types.h"
-#include "nav_print.h"
-#include "ifo_print.h"
+#include "dvdread/nav_types.h"
+#include "dvdread/nav_print.h"
+#include "dvdread/ifo_print.h"
 
 static void navPrint_PCI_GI(pci_gi_t *pci_gi) {
   int i;
Index: src/bitreader.c
===================================================================
--- src/bitreader.c	(revision 1159)
+++ src/bitreader.c	(working copy)
@@ -25,7 +25,7 @@
 #include <string.h>
 #include <inttypes.h>
 
-#include "bitreader.h"
+#include "dvdread/bitreader.h"
 
 int dvdread_getbits_init(getbits_state_t *state, uint8_t *start) {
   if ((state == NULL) || (start == NULL)) return 0;
Index: src/ifo_read.c
===================================================================
--- src/ifo_read.c	(revision 1159)
+++ src/ifo_read.c	(working copy)
@@ -28,11 +28,11 @@
 #include <string.h>
 
 #include "bswap.h"
-#include "ifo_types.h"
-#include "ifo_read.h"
-#include "dvd_reader.h"
+#include "dvdread/ifo_types.h"
+#include "dvdread/ifo_read.h"
+#include "dvdread/dvd_reader.h"
 #include "dvdread_internal.h"
-#include "bitreader.h"
+#include "dvdread/bitreader.h"
 
 #ifndef DVD_BLOCK_LEN
 #define DVD_BLOCK_LEN 2048
Index: src/dvd_udf.c
===================================================================
--- src/dvd_udf.c	(revision 1159)
+++ src/dvd_udf.c	(working copy)
@@ -39,8 +39,8 @@
 #include <unistd.h>
 #include <inttypes.h>
 
-#include "dvd_reader.h"
-#include "dvd_udf.h"
+#include "dvdread/dvd_reader.h"
+#include "dvdread/dvd_udf.h"
 
 /* Private but located in/shared with dvd_reader.c */
 extern int UDFReadBlocksRaw( dvd_reader_t *device, uint32_t lb_number,
Index: src/nav_read.c
===================================================================
--- src/nav_read.c	(revision 1159)
+++ src/nav_read.c	(working copy)
@@ -26,10 +26,10 @@
 #include <inttypes.h>
 
 #include "bswap.h"
-#include "nav_types.h"
-#include "nav_read.h"
+#include "dvdread/nav_types.h"
+#include "dvdread/nav_read.h"
 #include "dvdread_internal.h"
-#include "bitreader.h"
+#include "dvdread/bitreader.h"
 
 #define getbits_init dvdread_getbits_init
 #define getbits dvdread_getbits
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 1159)
+++ src/Makefile.am	(working copy)
@@ -15,5 +15,5 @@
 libdvdread_la_LDFLAGS = -version-info $(DVDREAD_LT_CURRENT):$(DVDREAD_LT_REVISION):$(DVDREAD_LT_AGE) \
 	-export-symbols-regex "(^dvd.*|^nav.*|^ifo.*|^DVD.*|^UDF.*)"
 
-include_HEADERS = dvd_reader.h nav_read.h ifo_read.h \
-	nav_print.h ifo_print.h ifo_types.h nav_types.h dvd_udf.h bitreader.h
+include_HEADERS = dvdread/dvd_reader.h dvdread/nav_read.h dvdread/ifo_read.h \
+	dvdread/nav_print.h dvdread/ifo_print.h dvdread/ifo_types.h dvdread/nav_types.h dvdread/dvd_udf.h dvdread/bitreader.h

Property changes on: src/dvdread/ifo_print.h
___________________________________________________________________
Added: svn:mergeinfo

Index: src/dvdread/dvd_udf.h
===================================================================
--- src/dvdread/dvd_udf.h	(revision 0)
+++ src/dvdread/dvd_udf.h	(working copy)
@@ -33,7 +33,7 @@
 
 #include <inttypes.h>
 
-#include "dvd_reader.h"
+#include "dvdread/dvd_reader.h"
 
 #ifdef __cplusplus
 extern "C" {

Property changes on: src/dvdread/dvd_udf.h
___________________________________________________________________
Added: svn:mergeinfo


Property changes on: src/dvdread/dvd_reader.h
___________________________________________________________________
Added: svn:mergeinfo


Property changes on: src/dvdread/nav_read.h
___________________________________________________________________
Added: svn:mergeinfo


Property changes on: src/dvdread/nav_print.h
___________________________________________________________________
Added: svn:mergeinfo


Property changes on: src/dvdread/bitreader.h
___________________________________________________________________
Added: svn:mergeinfo

Index: src/dvdread/ifo_types.h
===================================================================
--- src/dvdread/ifo_types.h	(revision 0)
+++ src/dvdread/ifo_types.h	(working copy)
@@ -23,7 +23,7 @@
 #define LIBDVDREAD_IFO_TYPES_H
 
 #include <inttypes.h>
-#include "dvd_reader.h"
+#include "dvdread/dvd_reader.h"
 
 
 #undef ATTRIBUTE_PACKED

Property changes on: src/dvdread/ifo_types.h
___________________________________________________________________
Added: svn:mergeinfo

Index: src/dvdread/ifo_read.h
===================================================================
--- src/dvdread/ifo_read.h	(revision 0)
+++ src/dvdread/ifo_read.h	(working copy)
@@ -23,7 +23,7 @@
 #define LIBDVDREAD_IFO_READ_H
 
 #include "ifo_types.h"
-#include "dvd_reader.h"
+#include "dvdread/dvd_reader.h"
 
 #ifdef __cplusplus
 extern "C" {

Property changes on: src/dvdread/ifo_read.h
___________________________________________________________________
Added: svn:mergeinfo


Property changes on: src/dvdread/nav_types.h
___________________________________________________________________
Added: svn:mergeinfo

Index: src/ifo_print.c
===================================================================
--- src/ifo_print.c	(revision 1159)
+++ src/ifo_print.c	(working copy)
@@ -24,9 +24,9 @@
 #include <ctype.h>
 #include <assert.h>
 
-#include "ifo_types.h"
-#include "ifo_read.h"
-#include "ifo_print.h"
+#include "dvdread/ifo_types.h"
+#include "dvdread/ifo_read.h"
+#include "dvdread/ifo_print.h"
 
 /* Put this in some other file / package?  It's used in nav_print too. */
 static void ifo_print_time(int level, dvd_time_t *dtime) {
Index: src/dvd_input.c
===================================================================
--- src/dvd_input.c	(revision 1159)
+++ src/dvd_input.c	(working copy)
@@ -26,7 +26,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-#include "dvd_reader.h"
+#include "dvdread/dvd_reader.h"
 #include "dvd_input.h"
 
 
Index: Makefile
===================================================================
--- Makefile	(revision 1159)
+++ Makefile	(working copy)
@@ -18,15 +18,15 @@
 DVDREAD_LIB = $(DVDREAD_L).a
 DVDREAD_SHLIB = $(DVDREAD_L).so
 VPATH+= $(SRC_PATH_BARE)/src
-DVDREAD_HEADERS = src/dvd_reader.h \
-	src/ifo_print.h \
-	src/ifo_read.h \
-	src/ifo_types.h \
-	src/nav_print.h \
-	src/nav_read.h \
-	src/dvd_udf.h \
-	src/nav_types.h \
-	src/bitreader.h
+DVDREAD_HEADERS = src/dvdread/dvd_reader.h \
+	src/dvdread/ifo_print.h \
+	src/dvdread/ifo_read.h \
+	src/dvdread/ifo_types.h \
+	src/dvdread/nav_print.h \
+	src/dvdread/nav_read.h \
+	src/dvdread/dvd_udf.h \
+	src/dvdread/nav_types.h \
+	src/dvdread/bitreader.h
 DVDREAD_SRCS = dvd_input.c dvd_reader.c dvd_udf.c ifo_print.c ifo_read.c \
 	md5.c nav_print.c nav_read.c bitreader.c
 CFLAGS += -I$(SRC_PATH)/src


More information about the DVDnav-discuss mailing list