[libbluray-devel] bdjo_dump: use only exported functions

hpi1 git at videolan.org
Tue Dec 2 12:46:13 CET 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Fri Nov 28 15:32:35 2014 +0200| [12416bd37d4dfb0a5448eb349c74f0493110f20b] | committer: hpi1

bdjo_dump: use only exported functions

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=12416bd37d4dfb0a5448eb349c74f0493110f20b
---

 src/Makefile.am          |   17 ++---------------
 src/examples/bdjo_dump.c |    6 +++---
 src/libbluray/bluray.c   |   17 +++++++++++++++++
 src/libbluray/bluray.h   |    4 ++++
 4 files changed, 26 insertions(+), 18 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 3085b96..f464ab8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -244,21 +244,8 @@ mobj_dump_SOURCES = examples/mobj_dump.c \
 	libbluray/hdmv/mobj_print.c
 mobj_dump_LDADD = libbluray.la
 
-bdjo_dump_CFLAGS = $(AM_CFLAGS)
-bdjo_dump_SOURCES = \
-	examples/bdjo_dump.c \
-	file/file.c \
-	libbluray/bdj/bdjo_parse.c \
-	util/bits.c \
-	util/logging.c \
-	util/strutl.c
-if HAVE_WIN32
-bdjo_dump_SOURCES += \
-	file/file_win32.c
-else
-bdjo_dump_SOURCES += \
-	file/file_posix.c
-endif
+bdjo_dump_SOURCES = examples/bdjo_dump.c
+bdjo_dump_LDADD = libbluray.la
 
 sound_dump_SOURCES = examples/sound_dump.c
 sound_dump_LDADD = libbluray.la
diff --git a/src/examples/bdjo_dump.c b/src/examples/bdjo_dump.c
index 8477439..bcbd2af 100644
--- a/src/examples/bdjo_dump.c
+++ b/src/examples/bdjo_dump.c
@@ -17,8 +17,8 @@
  * <http://www.gnu.org/licenses/>.
  */
 
+#include "libbluray/bluray.h"
 #include "libbluray/bdj/bdjo_data.h"
-#include "libbluray/bdj/bdjo_parse.h"
 
 #include <stdio.h>
 #include <string.h>
@@ -194,10 +194,10 @@ int main(int argc, const char *argv[])
 
         printf("%s\n", argv[cnt]);
 
-        BDJO *bdjo = bdjo_parse(argv[cnt]);
+        BDJO *bdjo = bd_read_bdjo(argv[cnt]);
         if (bdjo) {
             _bdjo_print(bdjo);
-            bdjo_free(&bdjo);
+            bd_free_bdjo(bdjo);
         }
         printf("\n");
     }
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 6afbe00..43ec17d 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -47,6 +47,7 @@
 #include "file/mount.h"
 #ifdef USING_BDJAVA
 #include "bdj/bdj.h"
+#include "bdj/bdjo_parse.h"
 #endif
 
 #include "file/libbdplus.h"
@@ -3522,3 +3523,19 @@ void bd_free_mobj(struct mobj_objects *obj)
 {
     mobj_free(&obj);
 }
+
+struct bdjo_data *bd_read_bdjo(const char *bdjo_file)
+{
+#ifdef USING_BDJAVA
+    return bdjo_parse(bdjo_file);
+#else
+    return NULL;
+#endif
+}
+
+void bd_free_bdjo(struct bdjo_data *obj)
+{
+#ifdef USING_BDJAVA
+    bdjo_free(&obj);
+#endif
+}
diff --git a/src/libbluray/bluray.h b/src/libbluray/bluray.h
index 4e28175..f18c1bb 100644
--- a/src/libbluray/bluray.h
+++ b/src/libbluray/bluray.h
@@ -891,6 +891,10 @@ struct mobj_objects;
 struct mobj_objects *bd_read_mobj(const char *mobj_file);
 void bd_free_mobj(struct mobj_objects *);
 
+struct bdjo_data;
+struct bdjo_data *bd_read_bdjo(const char *bdjo_file);
+void bd_free_bdjo(struct bdjo_data *);
+
 /* BD-J testing */
 
 int  bd_start_bdj(BLURAY *bd, const char* start_object); // start BD-J from the specified BD-J object (should be a 5 character string)



More information about the libbluray-devel mailing list