1 /*****************************************************************************
2 * main.h: access to all program variables
3 * Declaration and extern access to global program object.
4 *****************************************************************************
5 * Copyright (C) 1999, 2000, 2001, 2002 the VideoLAN team
8 * Authors: Vincent Seguin <seguin@via.ecp.fr>
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.
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.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 /*****************************************************************************
26 * libvlc_global_data_t (global variable)
27 *****************************************************************************
28 * This structure has an unique instance, statically allocated in main and
29 * never accessed from the outside. It stores once-initialized data such as
30 * the CPU capabilities or the global lock.
31 *****************************************************************************/
32 struct libvlc_global_data_t
36 vlc_bool_t b_ready; ///< Initialization boolean
37 uint32_t i_cpu; ///< CPU extensions
39 int i_verbose; ///< info messages
40 vlc_bool_t b_color; ///< color messages?
42 /* Object structure data */
43 int i_counter; ///< object counter
44 int i_objects; ///< Attached objects count
45 vlc_object_t ** pp_objects; ///< Array of all objects
47 msg_bank_t msg_bank; ///< The message bank
49 module_bank_t * p_module_bank; ///< The module bank
51 vlc_bool_t b_stats; ///< Should we collect stats
53 vlc_mutex_t timer_lock; ///< Lock to protect timers
54 int i_timers; ///< Number of timers
55 counter_t **pp_timers; ///< Array of all timers
57 intf_thread_t *p_probe; ///< Devices prober
59 /* Arch-specific variables */
63 #if defined( SYS_BEOS )
64 vlc_object_t * p_appthread;
66 #elif defined( __APPLE__ )
68 vlc_iconv_t iconv_macosx; /* for HFS+ file names */
69 vlc_mutex_t iconv_lock;
70 #elif defined( WIN32 ) && !defined( UNDER_CE )
71 SIGNALOBJECTANDWAIT SignalObjectAndWait;
72 vlc_bool_t b_fast_mutex;
75 #elif defined( UNDER_CE )
80 /*****************************************************************************
81 * libvlc_internal_instance_t
82 *****************************************************************************
83 * This structure is a LibVLC instance, for use by libvlc core and plugins
84 *****************************************************************************/
89 /* Global properties */
90 int i_argc; /* command line arguments count */
91 char ** ppsz_argv; /* command line arguments */
92 char * psz_homedir; /* configuration directory */
93 char * psz_userdir; /* user's home directory */
94 char * psz_configfile; /* location of config file */
96 /* Fast memcpy plugin used */
97 module_t * p_memcpy_module;
98 void* ( *pf_memcpy ) ( void *, const void *, size_t );
99 void* ( *pf_memset ) ( void *, int, size_t );
101 /* Shared data - these structures are accessed directly from p_vlc by
105 vlc_mutex_t config_lock; /* lock for the config file */
107 vlc_mutex_t quicktime_lock; /* QT is not thread safe on OSX */
110 /* Structure storing the action name / key associations */
113 const char *psz_action;
117 /* hotkey accounting information */
118 mtime_t i_delta_date;/*< minimum delta time between two key presses */
119 mtime_t i_last_date; /*< last date key was pressed */
120 int i_times; /*< n times pressed within delta date*/