Discussion:
[libdvdcss-devel] [PATCH] OS/2 support
KO Myung-Hun
2008-10-01 14:39:36 UTC
Permalink
Hi/2.

This patch enable OS/2 support.
--
KO Myung-Hun

Using Mozilla SeaMonkey 1.1.11
Under OS/2 Warp 4 for Korean with FixPak #15
On AMD ThunderBird 1 GHz with 512 MB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr
KO Myung-Hun
2009-02-01 12:18:53 UTC
Permalink
Hi/2.
Post by KO Myung-Hun
Hi/2.
This patch enable OS/2 support.
This is a ping to enable OS/2 support. ^^

Any comments ?
--
KO Myung-Hun

Using Mozilla SeaMonkey 1.1.14
Under OS/2 Warp 4 for Korean with FixPak #15
On AMD ThunderBird 1 GHz with 512 MB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr
Diego Biurrun
2009-02-01 12:29:39 UTC
Permalink
Post by KO Myung-Hun
Any comments ?
Some nits that might make this more palatable on this mailing
Post by KO Myung-Hun
--- src/device.c.org 2008-07-13 05:25:34.000000000 +0900
+++ src/device.c 2009-02-01 21:06:16.000000000 +0900
@@ -93,6 +99,14 @@
static int aspi_read_internal ( int, void *, int );
#endif
+#ifdef SYS_OS2
#elif
Post by KO Myung-Hun
@@ -157,6 +181,28 @@
kern_return_t kern_result;
io_iterator_t media_iterator;
CFMutableDictionaryRef classes_to_match;
+#elif defined( SYS_OS2 )
+#pragma pack( 1 )
+ struct
+ {
Place the opening brace on the same line, as in other parts of libdvdcss.
Post by KO Myung-Hun
@@ -270,6 +316,32 @@
+ rc = DosDevIOCtl(( HFILE )-1, IOCTL_DISK, DSK_GETDEVICEPARAMS,
+ &param, sizeof( param ), &ulParamLen,
+ &data, sizeof( data ), &ulDataLen );
Respect surrounding code style, add a space after the opening parenthesis.
Post by KO Myung-Hun
+
+ if( rc == 0 )
+ {
+ /* Check for removable and for cylinders */
+ if(( data.usDevAttr & 1 ) == 0 && data.usCylinders == 0xFFFF )
+ {
ditto
Post by KO Myung-Hun
@@ -322,6 +394,18 @@
}
else
+#elif defined( SYS_OS2 )
+ /* If device is "X:" or "X:\", we are not actually opening a file. */
+ if (psz_device[0] && psz_device[1] == ':' &&
+ (!psz_device[2] || (psz_device[2] == '\\' && !psz_device[3])))
again
Post by KO Myung-Hun
@@ -385,11 +469,13 @@
#else
close( dvdcss->i_fd );
+ #ifndef SYS_OS2
if( dvdcss->i_raw_fd >= 0 )
{
close( dvdcss->i_raw_fd );
dvdcss->i_raw_fd = -1;
}
+ #endif
I think there is no need to indent these preprocessor directives.
Post by KO Myung-Hun
@@ -578,6 +664,35 @@
+ rc = DosOpen(( PSZ )psz_dvd, &hfile, &ulAction, 0, FILE_NORMAL,
+ OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW,
+ OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE | OPEN_FLAGS_DASD,
+ NULL );
see above
Post by KO Myung-Hun
--- src/libdvdcss.c.org 2008-08-29 11:41:38.000000000 +0900
+++ src/libdvdcss.c 2009-02-01 21:02:18.000000000 +0900
@@ -306,7 +306,25 @@
/* Cache our keys in ${HOME}/.dvdcss/ */
if( psz_home )
{
- snprintf( psz_buffer, PATH_MAX, "%s/.dvdcss", psz_home );
+ int home_pos = 0;
+
+# ifdef SYS_OS2
+ if( *psz_home == '/' || *psz_home == '\\')
again

Diego
KO Myung-Hun
2009-02-01 13:25:13 UTC
Permalink
Hi/2.
Post by Diego Biurrun
Post by KO Myung-Hun
Any comments ?
Some nits that might make this more palatable on this mailing
Post by KO Myung-Hun
--- src/device.c.org 2008-07-13 05:25:34.000000000 +0900
+++ src/device.c 2009-02-01 21:06:16.000000000 +0900
@@ -93,6 +99,14 @@
static int aspi_read_internal ( int, void *, int );
#endif
+#ifdef SYS_OS2
#elif
Fixed.
Post by Diego Biurrun
Post by KO Myung-Hun
@@ -157,6 +181,28 @@
kern_return_t kern_result;
io_iterator_t media_iterator;
CFMutableDictionaryRef classes_to_match;
+#elif defined( SYS_OS2 )
+#pragma pack( 1 )
+ struct
+ {
Place the opening brace on the same line, as in other parts of libdvdcss.
I'm confused because two styles are mixed in other parts. See 'css.h',
'device.h', 'libdvdcss.h' and so on.
Post by Diego Biurrun
Post by KO Myung-Hun
@@ -270,6 +316,32 @@
+ rc = DosDevIOCtl(( HFILE )-1, IOCTL_DISK, DSK_GETDEVICEPARAMS,
+ &param, sizeof( param ), &ulParamLen,
+ &data, sizeof( data ), &ulDataLen );
Respect surrounding code style, add a space after the opening parenthesis.
Ok.
Post by Diego Biurrun
Post by KO Myung-Hun
+
+ if( rc == 0 )
+ {
+ /* Check for removable and for cylinders */
+ if(( data.usDevAttr & 1 ) == 0 && data.usCylinders == 0xFFFF )
+ {
ditto
Ok.
Post by Diego Biurrun
Post by KO Myung-Hun
@@ -322,6 +394,18 @@
}
else
+#elif defined( SYS_OS2 )
+ /* If device is "X:" or "X:\", we are not actually opening a file. */
+ if (psz_device[0] && psz_device[1] == ':' &&
+ (!psz_device[2] || (psz_device[2] == '\\' && !psz_device[3])))
again
Those were copied from the above Win32 codes. Still it is problematic, I
willing to fix them.
Post by Diego Biurrun
Post by KO Myung-Hun
@@ -385,11 +469,13 @@
#else
close( dvdcss->i_fd );
+ #ifndef SYS_OS2
if( dvdcss->i_raw_fd >= 0 )
{
close( dvdcss->i_raw_fd );
dvdcss->i_raw_fd = -1;
}
+ #endif
I think there is no need to indent these preprocessor directives.
I think it is libdvdcss style. Of course, I should have placed '#' at
first column. See 'common.h' and the 'libdvdcss.c'.
Post by Diego Biurrun
Post by KO Myung-Hun
@@ -578,6 +664,35 @@
+ rc = DosOpen(( PSZ )psz_dvd, &hfile, &ulAction, 0, FILE_NORMAL,
+ OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW,
+ OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE | OPEN_FLAGS_DASD,
+ NULL );
see above
Fixed.
Post by Diego Biurrun
Post by KO Myung-Hun
--- src/libdvdcss.c.org 2008-08-29 11:41:38.000000000 +0900
+++ src/libdvdcss.c 2009-02-01 21:02:18.000000000 +0900
@@ -306,7 +306,25 @@
/* Cache our keys in ${HOME}/.dvdcss/ */
if( psz_home )
{
- snprintf( psz_buffer, PATH_MAX, "%s/.dvdcss", psz_home );
+ int home_pos = 0;
+
+# ifdef SYS_OS2
+ if( *psz_home == '/' || *psz_home == '\\')
Ditto.
--
KO Myung-Hun

Using Mozilla SeaMonkey 1.1.14
Under OS/2 Warp 4 for Korean with FixPak #15
On AMD ThunderBird 1 GHz with 512 MB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr
Diego Biurrun
2009-02-01 13:32:06 UTC
Permalink
Post by KO Myung-Hun
Post by Diego Biurrun
Post by KO Myung-Hun
Any comments ?
Some nits that might make this more palatable on this mailing
Post by KO Myung-Hun
--- src/device.c.org 2008-07-13 05:25:34.000000000 +0900
+++ src/device.c 2009-02-01 21:06:16.000000000 +0900
@@ -157,6 +181,28 @@
kern_return_t kern_result;
io_iterator_t media_iterator;
CFMutableDictionaryRef classes_to_match;
+#elif defined( SYS_OS2 )
+#pragma pack( 1 )
+ struct
+ {
Place the opening brace on the same line, as in other parts of libdvdcss.
I'm confused because two styles are mixed in other parts. See 'css.h',
'device.h', 'libdvdcss.h' and so on.
OK
Post by KO Myung-Hun
Post by Diego Biurrun
Post by KO Myung-Hun
@@ -322,6 +394,18 @@
}
else
+#elif defined( SYS_OS2 )
+ /* If device is "X:" or "X:\", we are not actually opening a file. */
+ if (psz_device[0] && psz_device[1] == ':' &&
+ (!psz_device[2] || (psz_device[2] == '\\' && !psz_device[3])))
again
Those were copied from the above Win32 codes. Still it is problematic, I
willing to fix them.
They were probably added by MPlayer patches. Use the more common style
with spaces.
Post by KO Myung-Hun
Post by Diego Biurrun
Post by KO Myung-Hun
--- src/libdvdcss.c.org 2008-08-29 11:41:38.000000000 +0900
+++ src/libdvdcss.c 2009-02-01 21:02:18.000000000 +0900
@@ -306,7 +306,25 @@
+
+# ifdef SYS_OS2
+ if( *psz_home == '/' || *psz_home == '\\')
Ditto.
Again, I think it is better to follow the more common style.

Diego
KO Myung-Hun
2009-02-01 13:59:28 UTC
Permalink
Hi/2.
Post by Diego Biurrun
Post by KO Myung-Hun
Post by KO Myung-Hun
@@ -322,6 +394,18 @@
}
else
+#elif defined( SYS_OS2 )
+ /* If device is "X:" or "X:\", we are not actually opening a file. */
+ if (psz_device[0] && psz_device[1] == ':' &&
+ (!psz_device[2] || (psz_device[2] == '\\' && !psz_device[3])))
again
Those were copied from the above Win32 codes. Still it is problematic, I
willing to fix them.
They were probably added by MPlayer patches. Use the more common style
with spaces.
Post by KO Myung-Hun
Post by KO Myung-Hun
--- src/libdvdcss.c.org 2008-08-29 11:41:38.000000000 +0900
+++ src/libdvdcss.c 2009-02-01 21:02:18.000000000 +0900
@@ -306,7 +306,25 @@
+
+# ifdef SYS_OS2
+ if( *psz_home == '/' || *psz_home == '\\')
Ditto.
Again, I think it is better to follow the more common style.
Ok. I fixed the all.
--
KO Myung-Hun

Using Mozilla SeaMonkey 1.1.14
Under OS/2 Warp 4 for Korean with FixPak #15
On AMD ThunderBird 1 GHz with 512 MB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr
Loading...