[libdvdcss-devel] [PATCH] OS/2 support

Diego Biurrun diego at biurrun.de
Sun Feb 1 13:29:39 CET 2009


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

> @@ -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.

> @@ -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.

> +
> +        if( rc == 0 )
> +        {
> +            /* Check for removable and for cylinders */
> +            if(( data.usDevAttr & 1 ) == 0 && data.usCylinders == 0xFFFF )
> +            {

ditto

> @@ -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

> @@ -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.

> @@ -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

> --- 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


More information about the libdvdcss-devel mailing list