annotate libdvdcss/libdvdcss.h @ 36034:e1d1d404ee9e

Move function declaration where it belongs. Additionally, rename function.
author ib
date Mon, 01 Apr 2013 08:14:25 +0000
parents 691431d2289e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
1 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
2 * libdvdcss.h: private DVD reading library data
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
3 *****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
4 * Copyright (C) 1998-2001 VideoLAN
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
5 *
27442
afa2cc0166be Sync libdvdcss with upstream version r212.
diego
parents: 20613
diff changeset
6 * Authors: Stéphane Borel <stef@via.ecp.fr>
27462
60bd1a7f3fc6 Sync libdvdcss with upstream version 1.2.10.
diego
parents: 27442
diff changeset
7 * Sam Hocevar <sam@zoy.org>
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
8 *
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
12 * (at your option) any later version.
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
13 *
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
17 * GNU General Public License for more details.
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
18 *
31098
9e9595c779cf libdvdcss: cosmetics: Fix FSF address and program name in license headers.
diego
parents: 27462
diff changeset
19 * You should have received a copy of the GNU General Public License along
9e9595c779cf libdvdcss: cosmetics: Fix FSF address and program name in license headers.
diego
parents: 27462
diff changeset
20 * with libdvdcss; if not, write to the Free Software Foundation, Inc.,
9e9595c779cf libdvdcss: cosmetics: Fix FSF address and program name in license headers.
diego
parents: 27462
diff changeset
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
22 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
23
32265
cda66f57f7a5 Sync some minor changes from upstream libdvdcss, up to r237.
diego
parents: 31099
diff changeset
24 #ifndef DVDCSS_LIBDVDCSS_H
cda66f57f7a5 Sync some minor changes from upstream libdvdcss, up to r237.
diego
parents: 31099
diff changeset
25 #define DVDCSS_LIBDVDCSS_H
cda66f57f7a5 Sync some minor changes from upstream libdvdcss, up to r237.
diego
parents: 31099
diff changeset
26
cda66f57f7a5 Sync some minor changes from upstream libdvdcss, up to r237.
diego
parents: 31099
diff changeset
27 #include "dvdcss/dvdcss.h"
cda66f57f7a5 Sync some minor changes from upstream libdvdcss, up to r237.
diego
parents: 31099
diff changeset
28 #include "css.h"
35952
691431d2289e Update internal libdvdcss to Git revision 39e0e2b.
diego
parents: 34208
diff changeset
29 #include "device.h"
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
30
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
31 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
32 * The libdvdcss structure
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
33 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
34 struct dvdcss_s
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
35 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
36 /* File descriptor */
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
37 char * psz_device;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
38 int i_fd;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
39 int i_read_fd;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
40 int i_pos;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
41
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
42 /* File handling */
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
43 int ( * pf_seek ) ( dvdcss_t, int );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
44 int ( * pf_read ) ( dvdcss_t, void *, int );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
45 int ( * pf_readv ) ( dvdcss_t, struct iovec *, int );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
46
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
47 /* Decryption stuff */
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
48 int i_method;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
49 css_t css;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
50 int b_ioctls;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
51 int b_scrambled;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
52 dvd_title_t *p_titles;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
53
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
54 /* Key cache directory and pointer to the filename */
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
55 char psz_cachefile[PATH_MAX];
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
56 char * psz_block;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
57
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
58 /* Error management */
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
59 char * psz_error;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
60 int b_errors;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
61 int b_debug;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
62
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
63 #ifdef WIN32
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
64 int b_file;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
65 char * p_readv_buffer;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
66 int i_readv_buf_size;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
67 #endif
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
68
35952
691431d2289e Update internal libdvdcss to Git revision 39e0e2b.
diego
parents: 34208
diff changeset
69 #ifdef DVDCSS_RAW_OPEN
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
70 int i_raw_fd;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
71 #endif
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
72 };
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
73
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
74 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
75 * libdvdcss method: used like init flags
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
76 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
77 #define DVDCSS_METHOD_KEY 0
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
78 #define DVDCSS_METHOD_DISC 1
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
79 #define DVDCSS_METHOD_TITLE 2
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
80
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
81 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
82 * Functions used across the library
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
83 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
84 #define print_error(dvdcss,msg) _print_error(dvdcss,msg)
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
85 #if defined( _MSC_VER )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
86 #include <stdarg.h>
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
87 __forceinline void print_debug(dvdcss_t dvdcss, const char *msg,...)
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
88 {
34208
f7a3e6ad8eef libdvdcss: sync some whitespace changes from upstream
diego
parents: 32265
diff changeset
89 va_list args;
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
90
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
91 fprintf( stderr, "libdvdcss debug: " );
34208
f7a3e6ad8eef libdvdcss: sync some whitespace changes from upstream
diego
parents: 32265
diff changeset
92 va_start( args, msg );
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
93 vfprintf( stderr, msg, args );
34208
f7a3e6ad8eef libdvdcss: sync some whitespace changes from upstream
diego
parents: 32265
diff changeset
94 va_end( args );
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
95 fprintf( stderr, "\n" );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
96 }
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
97 #else
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
98 #define print_debug(dvdcss,msg,args...) \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
99 if( dvdcss->b_debug ) \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
100 { \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
101 fprintf( stderr, "libdvdcss debug: " ); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
102 fprintf( stderr, msg, ##args ); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
103 fprintf( stderr, "\n" ); \
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
104 }
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
105 #endif
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
106
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
107 void _print_error ( dvdcss_t, char * );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
108
32265
cda66f57f7a5 Sync some minor changes from upstream libdvdcss, up to r237.
diego
parents: 31099
diff changeset
109 #endif /* DVDCSS_LIBDVDCSS_H */