[DVDnav-discuss] [PATCH] clean up header mess
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Tue Dec 30 14:41:25 CET 2008
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/.
Greetings,
Reimar Döffinger
-------------- next part --------------
Index: src/read_cache.c
===================================================================
--- src/read_cache.c (revision 1159)
+++ src/read_cache.c (working copy)
@@ -33,13 +33,12 @@
#include <limits.h>
#include <sys/time.h>
#include <time.h>
-#include "dvd_types.h"
+#include "dvdnav/dvdnav.h"
#include <dvdread/nav_types.h>
#include <dvdread/ifo_types.h>
#include "remap.h"
#include "vm/decoder.h"
#include "vm/vm.h"
-#include "dvdnav.h"
#include "dvdnav_internal.h"
#include "read_cache.h"
Index: src/navigation.c
===================================================================
--- src/navigation.c (revision 1159)
+++ src/navigation.c (working copy)
@@ -26,13 +26,12 @@
#include <limits.h>
#include <string.h>
#include <sys/time.h>
-#include "dvd_types.h"
+#include "dvdnav/dvdnav.h"
#include <dvdread/nav_types.h>
#include <dvdread/ifo_types.h>
#include "remap.h"
#include "vm/decoder.h"
#include "vm/vm.h"
-#include "dvdnav.h"
#include "dvdnav_internal.h"
/* Navigation API calls */
Index: src/settings.c
===================================================================
--- src/settings.c (revision 1159)
+++ src/settings.c (working copy)
@@ -26,13 +26,12 @@
#include <limits.h>
#include <string.h>
#include <sys/time.h>
-#include "dvd_types.h"
+#include "dvdnav/dvdnav.h"
#include <dvdread/nav_types.h>
#include <dvdread/ifo_types.h>
#include "remap.h"
#include "vm/decoder.h"
#include "vm/vm.h"
-#include "dvdnav.h"
#include "dvdnav_internal.h"
/* Characteristics/setting API calls */
Index: src/vm/vm.c
===================================================================
--- src/vm/vm.c (revision 1159)
+++ src/vm/vm.c (working copy)
@@ -40,12 +40,11 @@
#include <dvdread/nav_types.h>
#include <dvdread/ifo_types.h>
#include <dvdread/ifo_read.h>
-#include "dvd_types.h"
+#include "dvdnav/dvdnav.h"
#include "decoder.h"
#include "remap.h"
#include "vm.h"
-#include "dvdnav.h"
#include "dvdnav_internal.h"
#ifdef _MSC_VER
Index: src/vm/decoder.c
===================================================================
--- src/vm/decoder.c (revision 1159)
+++ src/vm/decoder.c (working copy)
@@ -33,12 +33,11 @@
#include <dvdread/nav_types.h>
#include <dvdread/ifo_types.h> /* vm_cmd_t */
-#include "dvd_types.h"
+#include "dvdnav/dvdnav.h"
#include "remap.h"
#include "decoder.h"
#include "vm.h"
#include "vmcmd.h"
-#include "dvdnav.h"
#include "dvdnav_internal.h"
uint32_t vm_getbits(command_t *command, int32_t start, int32_t count) {
Index: src/vm/vmcmd.c
===================================================================
--- src/vm/vmcmd.c (revision 1159)
+++ src/vm/vmcmd.c (working copy)
@@ -30,14 +30,13 @@
#include <limits.h>
#include <sys/time.h>
-#include "dvd_types.h"
+#include "dvdnav/dvdnav.h"
#include <dvdread/nav_types.h>
#include <dvdread/ifo_types.h>
#include "decoder.h"
#include "remap.h"
#include "vm.h"
#include "vmcmd.h"
-#include "dvdnav.h"
#include "dvdnav_internal.h"
/* freebsd compatibility */
Property changes on: src/dvdnav/dvd_types.h
___________________________________________________________________
Added: svn:mergeinfo
Index: src/dvdnav/dvdnav.h
===================================================================
--- src/dvdnav/dvdnav.h (revision 0)
+++ src/dvdnav/dvdnav.h (working copy)
@@ -32,13 +32,11 @@
extern "C" {
#endif
-#ifndef DVDNAV_COMPILE
-# include <dvdnav/dvd_types.h>
-# include <dvdread/dvd_reader.h>
-# include <dvdread/nav_types.h>
-# include <dvdread/ifo_types.h> /* For vm_cmd_t */
-# include <dvdnav/dvdnav_events.h>
-#endif
+#include <dvdnav/dvd_types.h>
+#include <dvdread/dvd_reader.h>
+#include <dvdread/nav_types.h>
+#include <dvdread/ifo_types.h> /* For vm_cmd_t */
+#include <dvdnav/dvdnav_events.h>
Property changes on: src/dvdnav/dvdnav.h
___________________________________________________________________
Added: svn:mergeinfo
Property changes on: src/dvdnav/dvdnav_events.h
___________________________________________________________________
Added: svn:mergeinfo
Index: src/searching.c
===================================================================
--- src/searching.c (revision 1159)
+++ src/searching.c (working copy)
@@ -29,13 +29,12 @@
#include <string.h>
#include <stdlib.h>
#include <sys/time.h>
-#include "dvd_types.h"
+#include "dvdnav/dvdnav.h"
#include <dvdread/nav_types.h>
#include <dvdread/ifo_types.h>
#include "remap.h"
#include "vm/decoder.h"
#include "vm/vm.h"
-#include "dvdnav.h"
#include "dvdnav_internal.h"
/*
Index: src/remap.c
===================================================================
--- src/remap.c (revision 1159)
+++ src/remap.c (working copy)
@@ -36,13 +36,12 @@
#include <inttypes.h>
#include <limits.h>
#include <sys/time.h>
-#include "dvd_types.h"
+#include "dvdnav/dvdnav.h"
#include <dvdread/nav_types.h>
#include <dvdread/ifo_types.h>
#include "remap.h"
#include "vm/decoder.h"
#include "vm/vm.h"
-#include "dvdnav.h"
#include "dvdnav_internal.h"
struct block_s {
Index: src/highlight.c
===================================================================
--- src/highlight.c (revision 1159)
+++ src/highlight.c (working copy)
@@ -30,13 +30,12 @@
#include <string.h>
#include <sys/time.h>
#include <dvdread/nav_types.h>
-#include "dvd_types.h"
+#include "dvdnav/dvdnav.h"
#include "remap.h"
#include "vm/decoder.h"
#include "vm/vm.h"
#include "vm/vmcmd.h"
#include "dvdnav_internal.h"
-#include "dvdnav.h"
/*
#define BUTTON_TESTING
Index: src/dvdnav.c
===================================================================
--- src/dvdnav.c (revision 1159)
+++ src/dvdnav.c (working copy)
@@ -33,15 +33,13 @@
#include <limits.h>
#include <string.h>
#include <sys/time.h>
-#include "dvd_types.h"
+#include "dvdnav/dvdnav.h"
#include <dvdread/dvd_reader.h>
#include <dvdread/nav_types.h>
#include <dvdread/ifo_types.h> /* For vm_cmd_t */
#include "remap.h"
#include "vm/decoder.h"
#include "vm/vm.h"
-#include "dvdnav.h"
-#include "dvdnav_events.h"
#include "dvdnav_internal.h"
#include "read_cache.h"
#include <dvdread/nav_read.h>
Index: src/Makefile.am
===================================================================
--- src/Makefile.am (revision 1159)
+++ src/Makefile.am (working copy)
@@ -4,7 +4,7 @@
includedir = ${prefix}/include/dvdnav
-AM_CPPFLAGS = -DDVDNAV_COMPILE $(THREAD_CFLAGS) $(DVDREAD_CFLAGS) \
+AM_CPPFLAGS = $(THREAD_CFLAGS) $(DVDREAD_CFLAGS) \
-I$(top_srcdir)/src/vm
EXTRA_DIST = README.MAP FELLOWSHIP.map
@@ -31,4 +31,4 @@
libdvdnavmini_la_LDFLAGS = $(libdvdnav_la_LDFLAGS)
-include_HEADERS = dvdnav.h dvdnav_events.h dvd_types.h
+include_HEADERS = dvdnav/dvdnav.h dvdnav/dvdnav_events.h dvdnav/dvd_types.h
Index: Makefile
===================================================================
--- Makefile (revision 1159)
+++ Makefile (working copy)
@@ -12,11 +12,11 @@
VPATH+= $(SRC_PATH_BARE)/src/vm
SRCS+= decoder.c vm.c vmcmd.c
-HEADERS = src/dvd_types.h src/dvdnav.h src/dvdnav_events.h
+HEADERS = src/dvdnav/dvd_types.h src/dvdnav/dvdnav.h src/dvdnav/dvdnav_events.h
CFLAGS += $(USEDEBUG) -Wall -funsigned-char
CFLAGS += -I$(CURDIR) -I$(SRC_PATH)/src -I$(SRC_PATH)/src/vm
-CFLAGS += -DDVDNAV_COMPILE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
+CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS += -DHAVE_CONFIG_H -DHAVE_DLFCN_H
L=libdvdnav
More information about the DVDnav-discuss
mailing list