1 /*****************************************************************************
2 * libdvdcss.h: private DVD reading library data
3 *****************************************************************************
4 * Copyright (C) 1998-2001 VideoLAN
7 * Authors: Stéphane Borel <stef@via.ecp.fr>
8 * Sam Hocevar <sam@zoy.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with libdvdcss; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 *****************************************************************************/
25 #ifndef DVDCSS_LIBDVDCSS_H
26 #define DVDCSS_LIBDVDCSS_H
28 #include "dvdcss/dvdcss.h"
33 /*****************************************************************************
34 * The libdvdcss structure
35 *****************************************************************************/
45 int ( * pf_seek
) ( dvdcss_t
, int );
46 int ( * pf_read
) ( dvdcss_t
, void *, int );
47 int ( * pf_readv
) ( dvdcss_t
, struct iovec
*, int );
49 /* Decryption stuff */
54 dvd_title_t
*p_titles
;
56 /* Key cache directory and pointer to the filename */
57 char psz_cachefile
[PATH_MAX
];
60 /* Error management */
67 char * p_readv_buffer
;
71 #if !defined(WIN32) && !defined(SYS_OS2)
76 /*****************************************************************************
77 * libdvdcss method: used like init flags
78 *****************************************************************************/
79 #define DVDCSS_METHOD_KEY 0
80 #define DVDCSS_METHOD_DISC 1
81 #define DVDCSS_METHOD_TITLE 2
83 /*****************************************************************************
84 * Functions used across the library
85 *****************************************************************************/
86 #define print_error(dvdcss,msg) _print_error(dvdcss,msg)
87 #if defined( _MSC_VER )
89 __forceinline
void print_debug(dvdcss_t dvdcss
, const char *msg
,...)
93 fprintf( stderr
, "libdvdcss debug: " );
94 va_start( args
, msg
);
95 vfprintf( stderr
, msg
, args
);
97 fprintf( stderr
, "\n" );
100 #define print_debug(dvdcss,msg,args...) \
101 if( dvdcss->b_debug ) \
103 fprintf( stderr, "libdvdcss debug: " ); \
104 fprintf( stderr, msg, ##args ); \
105 fprintf( stderr, "\n" ); \
109 void _print_error ( dvdcss_t
, char * );
111 #endif /* DVDCSS_LIBDVDCSS_H */