Mercurial > mplayer.hg
annotate libdvdcss/libdvdcss.h @ 34897:9f5d0eade1bd
Reduce code duplication in get_path.
Also avoid using a pointer to an on-stack array outside the
array's scope, a compiler might use its stack area for other variables
or it might optimize away all code modifying it right before it leaves
the scope, thus completely breaking the code.
author | reimar |
---|---|
date | Sat, 02 Jun 2012 17:59:01 +0000 |
parents | f7a3e6ad8eef |
children | 691431d2289e |
rev | line source |
---|---|
20613 | 1 /***************************************************************************** |
2 * libdvdcss.h: private DVD reading library data | |
3 ***************************************************************************** | |
4 * Copyright (C) 1998-2001 VideoLAN | |
5 * $Id$ | |
6 * | |
27442 | 7 * Authors: Stéphane Borel <stef@via.ecp.fr> |
27462 | 8 * Sam Hocevar <sam@zoy.org> |
20613 | 9 * |
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. | |
14 * | |
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. | |
19 * | |
31098
9e9595c779cf
libdvdcss: cosmetics: Fix FSF address and program name in license headers.
diego
parents:
27462
diff
changeset
|
20 * 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
|
21 * 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
|
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
20613 | 23 *****************************************************************************/ |
24 | |
32265
cda66f57f7a5
Sync some minor changes from upstream libdvdcss, up to r237.
diego
parents:
31099
diff
changeset
|
25 #ifndef DVDCSS_LIBDVDCSS_H |
cda66f57f7a5
Sync some minor changes from upstream libdvdcss, up to r237.
diego
parents:
31099
diff
changeset
|
26 #define DVDCSS_LIBDVDCSS_H |
cda66f57f7a5
Sync some minor changes from upstream libdvdcss, up to r237.
diego
parents:
31099
diff
changeset
|
27 |
cda66f57f7a5
Sync some minor changes from upstream libdvdcss, up to r237.
diego
parents:
31099
diff
changeset
|
28 #include "dvdcss/dvdcss.h" |
cda66f57f7a5
Sync some minor changes from upstream libdvdcss, up to r237.
diego
parents:
31099
diff
changeset
|
29 #include "css.h" |
cda66f57f7a5
Sync some minor changes from upstream libdvdcss, up to r237.
diego
parents:
31099
diff
changeset
|
30 |
20613 | 31 struct iovec; |
32 | |
33 /***************************************************************************** | |
34 * The libdvdcss structure | |
35 *****************************************************************************/ | |
36 struct dvdcss_s | |
37 { | |
38 /* File descriptor */ | |
39 char * psz_device; | |
40 int i_fd; | |
41 int i_read_fd; | |
42 int i_pos; | |
43 | |
44 /* File handling */ | |
45 int ( * pf_seek ) ( dvdcss_t, int ); | |
46 int ( * pf_read ) ( dvdcss_t, void *, int ); | |
47 int ( * pf_readv ) ( dvdcss_t, struct iovec *, int ); | |
48 | |
49 /* Decryption stuff */ | |
50 int i_method; | |
51 css_t css; | |
52 int b_ioctls; | |
53 int b_scrambled; | |
54 dvd_title_t *p_titles; | |
55 | |
56 /* Key cache directory and pointer to the filename */ | |
57 char psz_cachefile[PATH_MAX]; | |
58 char * psz_block; | |
59 | |
60 /* Error management */ | |
61 char * psz_error; | |
62 int b_errors; | |
63 int b_debug; | |
64 | |
65 #ifdef WIN32 | |
66 int b_file; | |
67 char * p_readv_buffer; | |
68 int i_readv_buf_size; | |
69 #endif | |
70 | |
31099
f43e87f69590
libdvdcss: OS/2 support; this merges upstream revisions 220 and 229.
diego
parents:
31098
diff
changeset
|
71 #if !defined(WIN32) && !defined(SYS_OS2) |
20613 | 72 int i_raw_fd; |
73 #endif | |
74 }; | |
75 | |
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 | |
82 | |
83 /***************************************************************************** | |
84 * Functions used across the library | |
85 *****************************************************************************/ | |
86 #define print_error(dvdcss,msg) _print_error(dvdcss,msg) | |
87 #if defined( _MSC_VER ) | |
88 #include <stdarg.h> | |
89 __forceinline void print_debug(dvdcss_t dvdcss, const char *msg,...) | |
90 { | |
34208
f7a3e6ad8eef
libdvdcss: sync some whitespace changes from upstream
diego
parents:
32265
diff
changeset
|
91 va_list args; |
20613 | 92 |
93 fprintf( stderr, "libdvdcss debug: " ); | |
34208
f7a3e6ad8eef
libdvdcss: sync some whitespace changes from upstream
diego
parents:
32265
diff
changeset
|
94 va_start( args, msg ); |
20613 | 95 vfprintf( stderr, msg, args ); |
34208
f7a3e6ad8eef
libdvdcss: sync some whitespace changes from upstream
diego
parents:
32265
diff
changeset
|
96 va_end( args ); |
20613 | 97 fprintf( stderr, "\n" ); |
98 } | |
99 #else | |
100 #define print_debug(dvdcss,msg,args...) \ | |
101 if( dvdcss->b_debug ) \ | |
102 { \ | |
103 fprintf( stderr, "libdvdcss debug: " ); \ | |
104 fprintf( stderr, msg, ##args ); \ | |
105 fprintf( stderr, "\n" ); \ | |
106 } | |
107 #endif | |
108 | |
109 void _print_error ( dvdcss_t, char * ); | |
110 | |
32265
cda66f57f7a5
Sync some minor changes from upstream libdvdcss, up to r237.
diego
parents:
31099
diff
changeset
|
111 #endif /* DVDCSS_LIBDVDCSS_H */ |