annotate libmpdvdkit2/common.h @ 17944:db2c775fb2b9

max_distance clarification
author ods15
date Sat, 25 Mar 2006 13:39:47 +0000
parents 880739620241
children 0783dd397f74
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7027
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
1 /*****************************************************************************
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
2 * common.h: common definitions
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
3 * Collection of useful common types and macros definitions
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
4 *****************************************************************************
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
5 * Copyright (C) 1998, 1999, 2000 VideoLAN
16726
880739620241 Compile fix: _lseeki64 is not available under cygwin
reimar
parents: 16714
diff changeset
6 *
880739620241 Compile fix: _lseeki64 is not available under cygwin
reimar
parents: 16714
diff changeset
7 * Modified for use with MPlayer, changes contained in libdvdread_changes.diff.
880739620241 Compile fix: _lseeki64 is not available under cygwin
reimar
parents: 16714
diff changeset
8 * detailed CVS changelog at http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
7027
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
9 * $Id$
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
10 *
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
11 * Authors: Samuel Hocevar <sam@via.ecp.fr>
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
12 * Vincent Seguin <seguin@via.ecp.fr>
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
13 * Gildas Bazin <gbazin@netcourrier.com>
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
14 *
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
15 * This program is free software; you can redistribute it and/or modify
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
16 * it under the terms of the GNU General Public License as published by
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
17 * the Free Software Foundation; either version 2 of the License, or
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
18 * (at your option) any later version.
9333
f0f0f176d298 sync with libdvdcss 1.2.5 (including u8->uint8_t and whitespace cosmetics...)
arpi
parents: 7027
diff changeset
19 *
7027
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
20 * This program is distributed in the hope that it will be useful,
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
23 * GNU General Public License for more details.
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
24 *
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
25 * You should have received a copy of the GNU General Public License
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
26 * along with this program; if not, write to the Free Software
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
27 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
28 *****************************************************************************/
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
29
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
30 /*****************************************************************************
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
31 * Basic types definitions
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
32 *****************************************************************************/
16714
2ab52c9b72b9 Replace unconditional #defines by build system trickery.
diego
parents: 16631
diff changeset
33 #if defined( HAVE_STDINT_H )
2ab52c9b72b9 Replace unconditional #defines by build system trickery.
diego
parents: 16631
diff changeset
34 # include <stdint.h>
2ab52c9b72b9 Replace unconditional #defines by build system trickery.
diego
parents: 16631
diff changeset
35 #elif defined( HAVE_INTTYPES_H )
2ab52c9b72b9 Replace unconditional #defines by build system trickery.
diego
parents: 16631
diff changeset
36 # include <inttypes.h>
2ab52c9b72b9 Replace unconditional #defines by build system trickery.
diego
parents: 16631
diff changeset
37 #elif defined( SYS_CYGWIN )
2ab52c9b72b9 Replace unconditional #defines by build system trickery.
diego
parents: 16631
diff changeset
38 # include <sys/types.h>
2ab52c9b72b9 Replace unconditional #defines by build system trickery.
diego
parents: 16631
diff changeset
39 /* Cygwin only defines half of these... */
2ab52c9b72b9 Replace unconditional #defines by build system trickery.
diego
parents: 16631
diff changeset
40 typedef u_int8_t uint8_t;
2ab52c9b72b9 Replace unconditional #defines by build system trickery.
diego
parents: 16631
diff changeset
41 typedef u_int32_t uint32_t;
2ab52c9b72b9 Replace unconditional #defines by build system trickery.
diego
parents: 16631
diff changeset
42 #else
2ab52c9b72b9 Replace unconditional #defines by build system trickery.
diego
parents: 16631
diff changeset
43 /* Fallback types (very x86-centric, sorry) */
2ab52c9b72b9 Replace unconditional #defines by build system trickery.
diego
parents: 16631
diff changeset
44 typedef unsigned char uint8_t;
2ab52c9b72b9 Replace unconditional #defines by build system trickery.
diego
parents: 16631
diff changeset
45 typedef signed char int8_t;
2ab52c9b72b9 Replace unconditional #defines by build system trickery.
diego
parents: 16631
diff changeset
46 typedef unsigned int uint32_t;
2ab52c9b72b9 Replace unconditional #defines by build system trickery.
diego
parents: 16631
diff changeset
47 typedef signed int int32_t;
10721
e482b16c7145 __CYGWIN__->SYS_CYGWIN define moved to the right place
arpi
parents: 10720
diff changeset
48 #endif
e482b16c7145 __CYGWIN__->SYS_CYGWIN define moved to the right place
arpi
parents: 10720
diff changeset
49
7027
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
50 #if defined( WIN32 )
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
51
10720
f23c35ce0d16 synced to libdvdcss 1.2.8 (except the DVDCSS_PATH guessing, we use our
arpi
parents: 9333
diff changeset
52 #ifndef PATH_MAX
f23c35ce0d16 synced to libdvdcss 1.2.8 (except the DVDCSS_PATH guessing, we use our
arpi
parents: 9333
diff changeset
53 # define PATH_MAX MAX_PATH
f23c35ce0d16 synced to libdvdcss 1.2.8 (except the DVDCSS_PATH guessing, we use our
arpi
parents: 9333
diff changeset
54 #endif
f23c35ce0d16 synced to libdvdcss 1.2.8 (except the DVDCSS_PATH guessing, we use our
arpi
parents: 9333
diff changeset
55
7027
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
56 /* several type definitions */
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
57 # if defined( __MINGW32__ )
16726
880739620241 Compile fix: _lseeki64 is not available under cygwin
reimar
parents: 16714
diff changeset
58 #define lseek _lseeki64
7027
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
59 # if !defined( _OFF_T_ )
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
60 typedef long long _off_t;
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
61 typedef _off_t off_t;
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
62 # define _OFF_T_
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
63 # else
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
64 # define off_t long long
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
65 # endif
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
66 # endif
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
67
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
68 # if defined( _MSC_VER )
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
69 # if !defined( _OFF_T_DEFINED )
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
70 typedef __int64 off_t;
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
71 # define _OFF_T_DEFINED
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
72 # else
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
73 # define off_t __int64
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
74 # endif
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
75 # define stat _stati64
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
76 # endif
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
77
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
78 # ifndef snprintf
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
79 # define snprintf _snprintf /* snprintf not defined in mingw32 (bug?) */
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
80 # endif
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
81
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
82 #endif
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
83