[libdvdcss-devel] [PATCH] OS/2 support
KO Myung-Hun
komh at chollian.net
Sun Feb 1 14:25:13 CET 2009
Hi/2.
Diego Biurrun wrote:
> On Sun, Feb 01, 2009 at 09:18:53PM +0900, KO Myung-Hun wrote:
>
>> Any comments ?
>>
>
> Some nits that might make this more palatable on this mailing
> list below:
>
>
>> --- 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.
>> @@ -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.
>> @@ -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.
>
>
Ok.
>> +
>> + if( rc == 0 )
>> + {
>> + /* Check for removable and for cylinders */
>> + if(( data.usDevAttr & 1 ) == 0 && data.usCylinders == 0xFFFF )
>> + {
>>
>
> ditto
>
>
Ok.
>> @@ -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.
>> @@ -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'.
>> @@ -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.
>> --- 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
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: os2.diff
Url: http://mailman.videolan.org/pipermail/libdvdcss-devel/attachments/20090201/0ce3cfa7/attachment-0001.txt
More information about the libdvdcss-devel
mailing list