Discussion:
[libdvdcss-devel] [PATCH] Replace BeOS support by Haiku support.
Diego Biurrun
2014-10-31 11:13:39 UTC
Permalink
From: Jerome Duval <***@gmail.com>

Adapted from a Haiku ports packaging patch.
---

My suspicion that BeOS is dead even among the old fans has proven true.
Only Haiku remains, but appears to work.

NEWS | 1 +
configure.ac | 2 +-
libdvdcss.spec.in | 4 ++--
src/ioctl.c | 32 ++++++++++++++++----------------
src/ioctl.h | 2 +-
src/libdvdcss.c | 2 +-
test/dvd_region.c | 2 +-
7 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/NEWS b/NEWS
index a5b0bc5..9a13bf9 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ Changes between 1.2.13 and 1.3.0:
* Support for Android
* Drop support for HP-UX, Windows 9x, and Windows NT 4.0.
Windows NT 4.0 SP4 with IE 5.0 is now required.
+ * Replace BeOS support by Haiku support.
* Miscellaneous cleanups to code, documentation, build system.


diff --git a/configure.ac b/configure.ac
index f4fa527..f8386c4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -138,7 +138,7 @@ AC_CHECK_HEADERS(windows.h,[
])
])

-dnl for Un*x and BeOS
+dnl for Unix
AC_CHECK_HEADERS(sys/ioctl.h,[
CAN_BUILD_LIBDVDCSS=1
AC_CHECK_HEADERS(sys/cdio.h sys/dvdio.h linux/cdrom.h dvd.h)
diff --git a/libdvdcss.spec.in b/libdvdcss.spec.in
index a1529da..7734df0 100644
--- a/libdvdcss.spec.in
+++ b/libdvdcss.spec.in
@@ -32,7 +32,7 @@ Conflicts: libdvdcss0.0.1, libdvdcss0.0.2
libdvdcss is a simple library designed for accessing DVDs like a block device
without having to bother about the decryption. The important features are:
* Portability: Currently supported platforms are GNU/Linux, FreeBSD, NetBSD,
- OpenBSD, BeOS, Mac OS X, Solaris, QNX, OS/2, and Windows NT 4.0 SP4 (with
+ OpenBSD, Haiku, Mac OS X, Solaris, QNX, OS/2, and Windows NT 4.0 SP4 (with
IE 5.0) or later.
* Adaptability: Unlike most similar projects, libdvdcss does not require the
region of your drive to be set and will try its best to read from the disc
@@ -49,7 +49,7 @@ Provides: %name = %version-%release
libdvdcss is a simple library designed for accessing DVDs like a block device
without having to bother about the decryption. The important features are:
* Portability: Currently supported platforms are GNU/Linux, FreeBSD, NetBSD,
- OpenBSD, BeOS, Mac OS X, Solaris, QNX, OS/2, and Windows NT 4.0 SP4 (with
+ OpenBSD, Haiku, Mac OS X, Solaris, QNX, OS/2, and Windows NT 4.0 SP4 (with
IE 5.0) or later.
* Adaptability: Unlike most similar projects, libdvdcss does not require the
region of your drive to be set and will try its best to read from the disc
diff --git a/src/ioctl.c b/src/ioctl.c
index 58e655a..05bae1e 100644
--- a/src/ioctl.c
+++ b/src/ioctl.c
@@ -64,7 +64,7 @@
#ifdef DVD_STRUCT_IN_DVD_H
# include <dvd.h>
#endif
-#ifdef __BEOS__
+#ifdef __HAIKU__
# include <malloc.h>
# include <scsi.h>
#endif
@@ -90,7 +90,7 @@
/*****************************************************************************
* Local prototypes, OS specific
*****************************************************************************/
-#if defined( __BEOS__ )
+#if defined( __HAIKU__ )
static void BeInitRDC ( raw_device_command *, int );
#elif defined( SOLARIS_USCSI )
static void SolarisInitUSCSI( struct uscsi_cmd *p_sc, int i_type );
@@ -130,7 +130,7 @@ int ioctl_ReadCopyright( int i_fd, int i_layer, int *pi_copyright )

*pi_copyright = dvd.cpst;

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_READ_DVD_STRUCTURE, 8 );

rdc.command[ 6 ] = i_layer;
@@ -251,7 +251,7 @@ int ioctl_ReadDiscKey( int i_fd, const int *pi_agid, uint8_t *p_key )

memcpy( p_key, dvd.data, DVD_DISCKEY_SIZE );

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_READ_DVD_STRUCTURE, DVD_DISCKEY_SIZE + 4 );

rdc.command[ 7 ] = DVD_STRUCT_DISCKEY;
@@ -376,7 +376,7 @@ int ioctl_ReadTitleKey( int i_fd, const int *pi_agid, int i_pos, uint8_t *p_key

memcpy( p_key, auth_info.keychal, DVD_KEY_SIZE );

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_REPORT_KEY, 12 );

rdc.command[ 2 ] = ( i_pos >> 24 ) & 0xff;
@@ -506,7 +506,7 @@ int ioctl_ReportAgid( int i_fd, int *pi_agid )

*pi_agid = auth_info.agid;

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_REPORT_KEY, 8 );

rdc.command[ 10 ] = DVD_REPORT_AGID | (*pi_agid << 6);
@@ -604,7 +604,7 @@ int ioctl_ReportChallenge( int i_fd, const int *pi_agid, uint8_t *p_challenge )

memcpy( p_challenge, auth_info.keychal, DVD_CHALLENGE_SIZE );

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_REPORT_KEY, 16 );

rdc.command[ 10 ] = DVD_REPORT_CHALLENGE | (*pi_agid << 6);
@@ -712,7 +712,7 @@ int ioctl_ReportASF( int i_fd, int *pi_asf )

*pi_asf = auth_info.asf;

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_REPORT_KEY, 8 );

rdc.command[ 10 ] = DVD_REPORT_ASF;
@@ -822,7 +822,7 @@ int ioctl_ReportKey1( int i_fd, const int *pi_agid, uint8_t *p_key )

memcpy( p_key, auth_info.keychal, DVD_KEY_SIZE );

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_REPORT_KEY, 12 );

rdc.command[ 10 ] = DVD_REPORT_KEY1 | (*pi_agid << 6);
@@ -921,7 +921,7 @@ int ioctl_InvalidateAgid( int i_fd, const int *pi_agid )

i_ret = ioctl( i_fd, DVDIOCREPORTKEY, &auth_info );

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_REPORT_KEY, 0 );

rdc.command[ 10 ] = DVDCSS_INVALIDATE_AGID | (*pi_agid << 6);
@@ -1008,7 +1008,7 @@ int ioctl_SendChallenge( int i_fd, const int *pi_agid, const uint8_t *p_challeng

i_ret = ioctl( i_fd, DVDIOCSENDKEY, &auth_info );

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_SEND_KEY, 16 );

rdc.command[ 10 ] = DVD_SEND_CHALLENGE | (*pi_agid << 6);
@@ -1117,7 +1117,7 @@ int ioctl_SendKey2( int i_fd, const int *pi_agid, const uint8_t *p_key )

i_ret = ioctl( i_fd, DVDIOCSENDKEY, &auth_info );

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_SEND_KEY, 12 );

rdc.command[ 10 ] = DVD_SEND_KEY2 | (*pi_agid << 6);
@@ -1232,7 +1232,7 @@ int ioctl_ReportRPC( int i_fd, int *p_type, int *p_mask, int *p_scheme )
*p_mask = auth_info.region; // ??
*p_scheme = auth_info.rpc_scheme;

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_REPORT_KEY, 8 );

rdc.command[ 10 ] = DVD_REPORT_RPC;
@@ -1328,11 +1328,11 @@ int ioctl_ReportRPC( int i_fd, int *p_type, int *p_mask, int *p_scheme )

/* Local prototypes */

-#if defined( __BEOS__ )
+#if defined( __HAIKU__ )
/*****************************************************************************
- * BeInitRDC: initialize a RDC structure for the BeOS kernel
+ * BeInitRDC: initialize a RDC structure for the Haiku kernel
*****************************************************************************
- * This function initializes a BeOS raw device command structure for future
+ * This function initializes a Haiku raw device command structure for future
* use, either a read command or a write command.
*****************************************************************************/
static void BeInitRDC( raw_device_command *p_rdc, int i_type )
diff --git a/src/ioctl.h b/src/ioctl.h
index 673fd1c..27823b1 100644
--- a/src/ioctl.h
+++ b/src/ioctl.h
@@ -44,7 +44,7 @@ int ioctl_ReportRPC ( int, int *, int *, int * );
/*****************************************************************************
* Common macros, OS specific
*****************************************************************************/
-#if defined( __BEOS__ )
+#if defined( __HAIKU__ )
#define INIT_RDC( TYPE, SIZE ) \
raw_device_command rdc = { 0 }; \
uint8_t p_buffer[ (SIZE)+1 ]; \
diff --git a/src/libdvdcss.c b/src/libdvdcss.c
index 5005478..6e8dc8d 100644
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -30,7 +30,7 @@
* device without having to bother about the decryption. The important features
* are:
* \li portability: Currently supported platforms are GNU/Linux, FreeBSD,
- * NetBSD, OpenBSD, BeOS, Mac OS X, Solaris, QNX, OS/2, and Windows
+ * NetBSD, OpenBSD, Haiku, Mac OS X, Solaris, QNX, OS/2, and Windows
* NT 4.0 SP4 (with IE 5.0) or later.
* \li adaptability: Unlike most similar projects, libdvdcss does not require
* the region of your drive to be set and will try its best to read from
diff --git a/test/dvd_region.c b/test/dvd_region.c
index dc44043..52fcc9d 100644
--- a/test/dvd_region.c
+++ b/test/dvd_region.c
@@ -59,7 +59,7 @@ static int ioctl_SendRPC( int i_fd, int i_pdrc )

i_ret = ioctl( i_fd, DVDIOCSENDKEY, &auth_info );

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_SEND_KEY, 8 );

rdc.command[ 10 ] = DVD_SEND_RPC;
--
1.9.1
Jerome Duval
2014-10-31 14:03:19 UTC
Permalink
libdvdcss | branch: master | Jerome Duval <***@gmail.com> | Fri Oct 31 12:10:25 2014 +0100| [50167f317a6c743cf3a2491835210b1fe2144837] | committer: Diego Biurrun

Replace BeOS support by Haiku support.

Adapted from a Haiku ports packaging patch.
http://git.videolan.org/gitweb.cgi/libdvdcss.git/?a=commit;h=50167f317a6c743cf3a2491835210b1fe2144837
---

NEWS | 1 +
configure.ac | 2 +-
libdvdcss.spec.in | 4 ++--
src/ioctl.c | 32 ++++++++++++++++----------------
src/ioctl.h | 2 +-
src/libdvdcss.c | 2 +-
test/dvd_region.c | 2 +-
7 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/NEWS b/NEWS
index a459800..72a6092 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ Changes between 1.2.13 and 1.3.0:
* Support for Android
* Drop support for HP-UX, Windows 9x, and Windows NT 4.0.
Windows NT 4.0 SP4 with IE 5.0 is now required.
+ * Replace BeOS support by Haiku support.


Changes between 1.2.12 and 1.2.13:
diff --git a/configure.ac b/configure.ac
index f4fa527..f8386c4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -138,7 +138,7 @@ AC_CHECK_HEADERS(windows.h,[
])
])

-dnl for Un*x and BeOS
+dnl for Unix
AC_CHECK_HEADERS(sys/ioctl.h,[
CAN_BUILD_LIBDVDCSS=1
AC_CHECK_HEADERS(sys/cdio.h sys/dvdio.h linux/cdrom.h dvd.h)
diff --git a/libdvdcss.spec.in b/libdvdcss.spec.in
index a1529da..7734df0 100644
--- a/libdvdcss.spec.in
+++ b/libdvdcss.spec.in
@@ -32,7 +32,7 @@ Conflicts: libdvdcss0.0.1, libdvdcss0.0.2
libdvdcss is a simple library designed for accessing DVDs like a block device
without having to bother about the decryption. The important features are:
* Portability: Currently supported platforms are GNU/Linux, FreeBSD, NetBSD,
- OpenBSD, BeOS, Mac OS X, Solaris, QNX, OS/2, and Windows NT 4.0 SP4 (with
+ OpenBSD, Haiku, Mac OS X, Solaris, QNX, OS/2, and Windows NT 4.0 SP4 (with
IE 5.0) or later.
* Adaptability: Unlike most similar projects, libdvdcss does not require the
region of your drive to be set and will try its best to read from the disc
@@ -49,7 +49,7 @@ Provides: %name = %version-%release
libdvdcss is a simple library designed for accessing DVDs like a block device
without having to bother about the decryption. The important features are:
* Portability: Currently supported platforms are GNU/Linux, FreeBSD, NetBSD,
- OpenBSD, BeOS, Mac OS X, Solaris, QNX, OS/2, and Windows NT 4.0 SP4 (with
+ OpenBSD, Haiku, Mac OS X, Solaris, QNX, OS/2, and Windows NT 4.0 SP4 (with
IE 5.0) or later.
* Adaptability: Unlike most similar projects, libdvdcss does not require the
region of your drive to be set and will try its best to read from the disc
diff --git a/src/ioctl.c b/src/ioctl.c
index f66aef0..0681309 100644
--- a/src/ioctl.c
+++ b/src/ioctl.c
@@ -64,7 +64,7 @@
#ifdef DVD_STRUCT_IN_DVD_H
# include <dvd.h>
#endif
-#ifdef __BEOS__
+#ifdef __HAIKU__
# include <malloc.h>
# include <scsi.h>
#endif
@@ -90,7 +90,7 @@
/*****************************************************************************
* Local prototypes, BeOS specific
*****************************************************************************/
-#if defined( __BEOS__ )
+#if defined( __HAIKU__ )
static void BeInitRDC ( raw_device_command *, int );
#endif

@@ -150,7 +150,7 @@ int ioctl_ReadCopyright( int i_fd, int i_layer, int *pi_copyright )

*pi_copyright = dvd.cpst;

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_READ_DVD_STRUCTURE, 8 );

rdc.command[ 6 ] = i_layer;
@@ -271,7 +271,7 @@ int ioctl_ReadDiscKey( int i_fd, int *pi_agid, uint8_t *p_key )

memcpy( p_key, dvd.data, DVD_DISCKEY_SIZE );

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_READ_DVD_STRUCTURE, DVD_DISCKEY_SIZE + 4 );

rdc.command[ 7 ] = DVD_STRUCT_DISCKEY;
@@ -396,7 +396,7 @@ int ioctl_ReadTitleKey( int i_fd, int *pi_agid, int i_pos, uint8_t *p_key )

memcpy( p_key, auth_info.keychal, DVD_KEY_SIZE );

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_REPORT_KEY, 12 );

rdc.command[ 2 ] = ( i_pos >> 24 ) & 0xff;
@@ -526,7 +526,7 @@ int ioctl_ReportAgid( int i_fd, int *pi_agid )

*pi_agid = auth_info.agid;

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_REPORT_KEY, 8 );

rdc.command[ 10 ] = DVD_REPORT_AGID | (*pi_agid << 6);
@@ -624,7 +624,7 @@ int ioctl_ReportChallenge( int i_fd, int *pi_agid, uint8_t *p_challenge )

memcpy( p_challenge, auth_info.keychal, DVD_CHALLENGE_SIZE );

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_REPORT_KEY, 16 );

rdc.command[ 10 ] = DVD_REPORT_CHALLENGE | (*pi_agid << 6);
@@ -732,7 +732,7 @@ int ioctl_ReportASF( int i_fd, int *pi_asf )

*pi_asf = auth_info.asf;

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_REPORT_KEY, 8 );

rdc.command[ 10 ] = DVD_REPORT_ASF;
@@ -842,7 +842,7 @@ int ioctl_ReportKey1( int i_fd, int *pi_agid, uint8_t *p_key )

memcpy( p_key, auth_info.keychal, DVD_KEY_SIZE );

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_REPORT_KEY, 12 );

rdc.command[ 10 ] = DVD_REPORT_KEY1 | (*pi_agid << 6);
@@ -941,7 +941,7 @@ int ioctl_InvalidateAgid( int i_fd, int *pi_agid )

i_ret = ioctl( i_fd, DVDIOCREPORTKEY, &auth_info );

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_REPORT_KEY, 0 );

rdc.command[ 10 ] = DVDCSS_INVALIDATE_AGID | (*pi_agid << 6);
@@ -1028,7 +1028,7 @@ int ioctl_SendChallenge( int i_fd, int *pi_agid, uint8_t *p_challenge )

i_ret = ioctl( i_fd, DVDIOCSENDKEY, &auth_info );

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_SEND_KEY, 16 );

rdc.command[ 10 ] = DVD_SEND_CHALLENGE | (*pi_agid << 6);
@@ -1137,7 +1137,7 @@ int ioctl_SendKey2( int i_fd, int *pi_agid, uint8_t *p_key )

i_ret = ioctl( i_fd, DVDIOCSENDKEY, &auth_info );

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_SEND_KEY, 12 );

rdc.command[ 10 ] = DVD_SEND_KEY2 | (*pi_agid << 6);
@@ -1252,7 +1252,7 @@ int ioctl_ReportRPC( int i_fd, int *p_type, int *p_mask, int *p_scheme )
*p_mask = auth_info.region; // ??
*p_scheme = auth_info.rpc_scheme;

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_REPORT_KEY, 8 );

rdc.command[ 10 ] = DVD_REPORT_RPC;
@@ -1348,11 +1348,11 @@ int ioctl_ReportRPC( int i_fd, int *p_type, int *p_mask, int *p_scheme )

/* Local prototypes */

-#if defined( __BEOS__ )
+#if defined( __HAIKU__ )
/*****************************************************************************
- * BeInitRDC: initialize a RDC structure for the BeOS kernel
+ * BeInitRDC: initialize a RDC structure for the Haiku kernel
*****************************************************************************
- * This function initializes a BeOS raw device command structure for future
+ * This function initializes a Haiku raw device command structure for future
* use, either a read command or a write command.
*****************************************************************************/
static void BeInitRDC( raw_device_command *p_rdc, int i_type )
diff --git a/src/ioctl.h b/src/ioctl.h
index 7cca0bc..d7f231a 100644
--- a/src/ioctl.h
+++ b/src/ioctl.h
@@ -44,7 +44,7 @@ int ioctl_ReportRPC ( int, int *, int *, int * );
/*****************************************************************************
* Common macro, BeOS specific
*****************************************************************************/
-#if defined( __BEOS__ )
+#if defined( __HAIKU__ )
#define INIT_RDC( TYPE, SIZE ) \
raw_device_command rdc = { 0 }; \
uint8_t p_buffer[ (SIZE)+1 ]; \
diff --git a/src/libdvdcss.c b/src/libdvdcss.c
index b03dbfd..1438f5c 100644
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -30,7 +30,7 @@
* device without having to bother about the decryption. The important features
* are:
* \li portability: Currently supported platforms are GNU/Linux, FreeBSD,
- * NetBSD, OpenBSD, BeOS, Mac OS X, Solaris, QNX, OS/2, and Windows
+ * NetBSD, OpenBSD, Haiku, Mac OS X, Solaris, QNX, OS/2, and Windows
* NT 4.0 SP4 (with IE 5.0) or later.
* \li adaptability: Unlike most similar projects, libdvdcss does not require
* the region of your drive to be set and will try its best to read from
diff --git a/test/dvd_region.c b/test/dvd_region.c
index dc44043..52fcc9d 100644
--- a/test/dvd_region.c
+++ b/test/dvd_region.c
@@ -59,7 +59,7 @@ static int ioctl_SendRPC( int i_fd, int i_pdrc )

i_ret = ioctl( i_fd, DVDIOCSENDKEY, &auth_info );

-#elif defined( __BEOS__ )
+#elif defined( __HAIKU__ )
INIT_RDC( GPCMD_SEND_KEY, 8 );

rdc.command[ 10 ] = DVD_SEND_RPC;

Loading...