annotate libdvdcss/error.c @ 35851:3ad8e723bb09

Simplify array index handling. Calculate index by a simple decrementation.
author ib
date Sun, 10 Mar 2013 14:27:22 +0000
parents 9e9595c779cf
children 691431d2289e
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 * error.c: error management functions
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-2002 VideoLAN
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
5 * $Id$
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
6 *
27462
60bd1a7f3fc6 Sync libdvdcss with upstream version 1.2.10.
diego
parents: 20613
diff changeset
7 * Author: Sam Hocevar <sam@zoy.org>
20613
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
8 *
31098
9e9595c779cf libdvdcss: cosmetics: Fix FSF address and program name in license headers.
diego
parents: 27462
diff changeset
9 * This library is free software; you can redistribute it and/or modify
20613
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 *
31098
9e9595c779cf libdvdcss: cosmetics: Fix FSF address and program name in license headers.
diego
parents: 27462
diff changeset
14 * This library is distributed in the hope that it will be useful,
20613
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 this library; 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
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
24 #include "config.h"
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
25
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
26 #include <stdio.h>
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
27 #include <stdlib.h>
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
28
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
29 #ifdef HAVE_SYS_PARAM_H
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
30 # include <sys/param.h>
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
31 #endif
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
32
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
33 #ifdef HAVE_LIMITS_H
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
34 # include <limits.h>
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
35 #endif
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
36
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
37 #include "dvdcss/dvdcss.h"
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
38
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
39 #include "common.h"
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
40 #include "css.h"
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
41 #include "libdvdcss.h"
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
42
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
43 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
44 * Error messages
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
45 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
46 void _print_error( dvdcss_t dvdcss, char *psz_string )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
47 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
48 if( dvdcss->b_errors )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
49 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
50 fprintf( stderr, "libdvdcss error: %s\n", psz_string );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
51 }
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
52
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
53 dvdcss->psz_error = psz_string;
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
54 }
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
55
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
56 /*****************************************************************************
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
57 * Debug messages
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
58 *****************************************************************************/
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
59 #if 0
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
60 void _print_debug( dvdcss_t dvdcss, char *psz_string )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
61 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
62 if( dvdcss->b_debug )
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
63 {
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
64 fprintf( stderr, "libdvdcss debug: %s\n", psz_string );
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
65 }
e68f255d7d64 Move libdvdcss into its own subdirectory.
diego
parents:
diff changeset
66 }
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