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,
+ ¶m, 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