]> git.sesse.net Git - vlc/blob - include/vlc/common.h
update module LIST file.
[vlc] / include / vlc / common.h
1 /*****************************************************************************
2  * vlc.h: global header for libvlc (old-style)
3  *****************************************************************************
4  * Copyright (C) 1998-2004 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Vincent Seguin <seguin@via.ecp.fr>
8  *          Samuel Hocevar <sam@zoy.org>
9  *          Gildas Bazin <gbazin@netcourrier.com>
10  *          Derk-Jan Hartman <hartman at videolan dot org>
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25  *****************************************************************************/
26
27 /**
28  * \defgroup libvlc_old Libvlc Old
29  * This is libvlc, the base library of the VLC program.
30  * This is the legacy API. Please consider using the new libvlc API
31  *
32  * @{
33  */
34
35
36 #ifndef _VLC_COMMON_H
37 #define _VLC_COMMON_H 1
38
39 # ifdef __cplusplus
40 extern "C" {
41 # else
42 #  include <stdbool.h>
43 # endif
44
45 /*****************************************************************************
46  * Our custom types
47  *****************************************************************************/
48 typedef bool vlc_bool_t; /* (shouldn't be exposed) */
49 typedef struct vlc_list_t vlc_list_t; /* (shouldn't be exposed) */
50 typedef struct vlc_object_t vlc_object_t; /* (shouldn't be exposed) */
51
52 #if (defined( WIN32 ) || defined( UNDER_CE )) && !defined( __MINGW32__ )
53 typedef signed __int64 vlc_int64_t;
54 # else
55 typedef signed long long vlc_int64_t;
56 #endif
57
58 /**
59  * VLC value structure (shouldn't be exposed)
60  */
61 typedef union
62 {
63     int             i_int;
64     vlc_bool_t      b_bool;
65     float           f_float;
66     char *          psz_string;
67     void *          p_address;
68     vlc_object_t *  p_object;
69     vlc_list_t *    p_list;
70     vlc_int64_t     i_time;
71
72     struct { char *psz_name; int i_object_id; } var;
73
74    /* Make sure the structure is at least 64bits */
75     struct { char a, b, c, d, e, f, g, h; } padding;
76
77 } vlc_value_t;
78
79 /**
80  * VLC list structure  (shouldn't be exposed)
81  */
82 struct vlc_list_t
83 {
84     int             i_count;
85     vlc_value_t *   p_values;
86     int *           pi_types;
87
88 };
89
90 /*****************************************************************************
91  * Error values (shouldn't be exposed)
92  *****************************************************************************/
93 #define VLC_SUCCESS         -0                                   /* No error */
94 #define VLC_ENOMEM          -1                          /* Not enough memory */
95 #define VLC_ETHREAD         -2                               /* Thread error */
96 #define VLC_ETIMEOUT        -3                                    /* Timeout */
97
98 #define VLC_ENOMOD         -10                           /* Module not found */
99
100 #define VLC_ENOOBJ         -20                           /* Object not found */
101 #define VLC_EBADOBJ        -21                            /* Bad object type */
102
103 #define VLC_ENOVAR         -30                         /* Variable not found */
104 #define VLC_EBADVAR        -31                         /* Bad variable value */
105
106 #define VLC_ENOITEM        -40                           /**< Item not found */
107
108 #define VLC_EEXIT         -255                             /* Program exited */
109 #define VLC_EEXITSUCCESS  -999                /* Program exited successfully */
110 #define VLC_EGENERIC      -666                              /* Generic error */
111
112 /*****************************************************************************
113  * Booleans (shouldn't be exposed)
114  *****************************************************************************/
115 #define VLC_FALSE false
116 #define VLC_TRUE  true
117
118 /**
119  * \defgroup var_type Variable types  (shouldn't be exposed)
120  * These are the different types a vlc variable can have.
121  * @{
122  */
123 #define VLC_VAR_VOID      0x0010
124 #define VLC_VAR_BOOL      0x0020
125 #define VLC_VAR_INTEGER   0x0030
126 #define VLC_VAR_HOTKEY    0x0031
127 #define VLC_VAR_STRING    0x0040
128 #define VLC_VAR_MODULE    0x0041
129 #define VLC_VAR_FILE      0x0042
130 #define VLC_VAR_DIRECTORY 0x0043
131 #define VLC_VAR_VARIABLE  0x0044
132 #define VLC_VAR_FLOAT     0x0050
133 #define VLC_VAR_TIME      0x0060
134 #define VLC_VAR_ADDRESS   0x0070
135 #define VLC_VAR_MUTEX     0x0080
136 #define VLC_VAR_LIST      0x0090
137 /**@}*/
138
139 /*****************************************************************************
140  * Required internal headers
141  *****************************************************************************/
142 #if defined( __LIBVLC__ )
143 #   include "vlc_common.h"
144 #endif
145
146
147 /*****************************************************************************
148  * Shared library Export macros
149  *****************************************************************************/
150 #ifndef VLC_PUBLIC_API
151 #  define VLC_PUBLIC_API extern
152 #endif
153
154 /*****************************************************************************
155  * Compiler specific
156  *****************************************************************************/
157
158 #ifndef VLC_DEPRECATED_API
159 # ifdef __LIBVLC__
160 /* Avoid unuseful warnings from libvlc with our deprecated APIs */
161 #    define VLC_DEPRECATED_API VLC_PUBLIC_API
162 # else /* __LIBVLC__ */
163 #  if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
164 #    define VLC_DEPRECATED_API VLC_PUBLIC_API __attribute__((deprecated))
165 #  else
166 #    define VLC_DEPRECATED_API VLC_PUBLIC_API
167 #  endif
168 # endif /* __LIBVLC__ */
169 #endif
170
171
172 # ifdef __cplusplus
173 }
174 # endif
175
176
177 #endif /* _VLC_COMMON_H */